( row: ToolInvocationRow & Partial<Pick<ToolRow, "input_schema" | "output_schema">>, annotations?: ToolAnnotations, )
| 613 | // schema columns); `Tool.inputSchema`/`outputSchema` are optional and stay |
| 614 | // absent for those callers — `tools.schema` is the schema-bearing surface. |
| 615 | const rowToTool = ( |
| 616 | row: ToolInvocationRow & Partial<Pick<ToolRow, "input_schema" | "output_schema">>, |
| 617 | annotations?: ToolAnnotations, |
| 618 | ): Tool => { |
| 619 | const owner = row.owner as Owner; |
| 620 | const integration = IntegrationSlug.make(row.integration); |
| 621 | const connection = ConnectionName.make(row.connection); |
| 622 | const name = ToolName.make(row.name); |
| 623 | return { |
| 624 | address: toolAddress(owner, integration, connection, name), |
| 625 | owner, |
| 626 | integration, |
| 627 | connection, |
| 628 | name, |
| 629 | pluginId: row.plugin_id, |
| 630 | description: row.description, |
| 631 | inputSchema: decodeJsonColumn(row.input_schema), |
| 632 | outputSchema: decodeJsonColumn(row.output_schema), |
| 633 | annotations: annotations ?? (decodeJsonColumn(row.annotations) as ToolAnnotations | undefined), |
| 634 | }; |
| 635 | }; |
| 636 | |
| 637 | // --------------------------------------------------------------------------- |
| 638 | // Condition builders |
no test coverage detected