(input: {
readonly integration: string;
readonly name: string;
readonly owner?: "org" | "user";
readonly connection?: string;
readonly description?: string;
readonly inputSchema?: unknown;
readonly requiresApproval?: boolean;
readonly static?: boolean;
})
| 28 | // --------------------------------------------------------------------------- |
| 29 | |
| 30 | const projection = (input: { |
| 31 | readonly integration: string; |
| 32 | readonly name: string; |
| 33 | readonly owner?: "org" | "user"; |
| 34 | readonly connection?: string; |
| 35 | readonly description?: string; |
| 36 | readonly inputSchema?: unknown; |
| 37 | readonly requiresApproval?: boolean; |
| 38 | readonly static?: boolean; |
| 39 | }): Tool => { |
| 40 | const owner = input.owner ?? "org"; |
| 41 | const connection = input.connection ?? "main"; |
| 42 | return { |
| 43 | address: ToolAddress.make(`tools.${input.integration}.${owner}.${connection}.${input.name}`), |
| 44 | integration: IntegrationSlug.make(input.integration), |
| 45 | owner, |
| 46 | connection: ConnectionName.make(connection), |
| 47 | name: ToolName.make(input.name), |
| 48 | pluginId: "test", |
| 49 | description: input.description ?? `${input.integration} ${input.name}`, |
| 50 | ...(input.inputSchema === undefined ? {} : { inputSchema: input.inputSchema }), |
| 51 | ...(input.requiresApproval === undefined |
| 52 | ? {} |
| 53 | : { annotations: { requiresApproval: input.requiresApproval } }), |
| 54 | ...(input.static === undefined ? {} : { static: input.static }), |
| 55 | }; |
| 56 | }; |
| 57 | |
| 58 | /** Exercise the existing list/schema seam and record which schemas were requested. */ |
| 59 | const toolPort = ( |
no outgoing calls
no test coverage detected