( row: ToolInvocationRow & Partial<Pick<ToolRow, "input_schema" | "output_schema">>, annotations?: ToolAnnotations, )
| 874 | // schema columns); `Tool.inputSchema`/`outputSchema` are optional and stay |
| 875 | // absent for those callers — `tools.schema` is the schema-bearing surface. |
| 876 | const rowToTool = ( |
| 877 | row: ToolInvocationRow & Partial<Pick<ToolRow, "input_schema" | "output_schema">>, |
| 878 | annotations?: ToolAnnotations, |
| 879 | ): Tool => { |
| 880 | const owner = row.owner as Owner; |
| 881 | const integration = IntegrationSlug.make(row.integration); |
| 882 | const connection = ConnectionName.make(row.connection); |
| 883 | const name = ToolName.make(row.name); |
| 884 | return { |
| 885 | address: toolAddress(owner, integration, connection, name), |
| 886 | owner, |
| 887 | integration, |
| 888 | connection, |
| 889 | name, |
| 890 | pluginId: row.plugin_id, |
| 891 | description: row.description, |
| 892 | inputSchema: decodeJsonColumn(row.input_schema), |
| 893 | outputSchema: decodeJsonColumn(row.output_schema), |
| 894 | annotations: annotations ?? (decodeJsonColumn(row.annotations) as ToolAnnotations | undefined), |
| 895 | }; |
| 896 | }; |
| 897 | |
| 898 | // --------------------------------------------------------------------------- |
| 899 | // Condition builders |
no test coverage detected