( row: ToolInvocationRow & Partial<Pick<ToolRow, "input_schema" | "output_schema">>, annotations?: ToolAnnotations, )
| 635 | // schema columns); `Tool.inputSchema`/`outputSchema` are optional and stay |
| 636 | // absent for those callers — `tools.schema` is the schema-bearing surface. |
| 637 | const rowToTool = ( |
| 638 | row: ToolInvocationRow & Partial<Pick<ToolRow, "input_schema" | "output_schema">>, |
| 639 | annotations?: ToolAnnotations, |
| 640 | ): Tool => { |
| 641 | const owner = row.owner as Owner; |
| 642 | const integration = IntegrationSlug.make(row.integration); |
| 643 | const connection = ConnectionName.make(row.connection); |
| 644 | const name = ToolName.make(row.name); |
| 645 | return { |
| 646 | address: toolAddress(owner, integration, connection, name), |
| 647 | owner, |
| 648 | integration, |
| 649 | connection, |
| 650 | name, |
| 651 | pluginId: row.plugin_id, |
| 652 | description: row.description, |
| 653 | inputSchema: decodeJsonColumn(row.input_schema), |
| 654 | outputSchema: decodeJsonColumn(row.output_schema), |
| 655 | annotations: annotations ?? (decodeJsonColumn(row.annotations) as ToolAnnotations | undefined), |
| 656 | }; |
| 657 | }; |
| 658 | |
| 659 | // --------------------------------------------------------------------------- |
| 660 | // Condition builders |
no test coverage detected