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