Luigit
repositories / smith

smith

There are many coding harnesses - but this one is fast

owned by admin

plugins/example-typescript/src/plugin.ts

Raw
export const plugin = {
  declareTools() {
    return [
      {
        name: "typescript-echo",
        description: "Echoes canonical JSON through TypeScript.",
        inputSchemaJson: '{"type":"object"}',
      },
    ];
  },
  invoke(name: string, inputJson: string) {
    if (name !== "typescript-echo") {
      throw new Error(`unknown tool: ${name}`);
    }
    return inputJson;
  },
};

export const provider = {
  declareSettings() {
    return { includeUsage: false, subscription: false, provenance: { tag: "built-in" } };
  },
  validateSettings() {
    throw new Error("typescript-echo has no provider codec");
  },
  buildRequest() {
    throw new Error("typescript-echo has no provider codec");
  },
  decodeResponse() {
    throw new Error("typescript-echo has no provider codec");
  },
};

export const registration = {
  declare() {
    return { credentialSources: [], providers: [], models: [] };
  },
};