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