( row: ToolInvocationRow & Partial<Pick<ToolRow, "input_schema" | "output_schema">>, annotations?: ToolAnnotations, )
| 860 | // schema columns); `Tool.inputSchema`/`outputSchema` are optional and stay |
| 861 | // absent for those callers — `tools.schema` is the schema-bearing surface. |
| 862 | const rowToTool = ( |
| 863 | row: ToolInvocationRow & Partial<Pick<ToolRow, "input_schema" | "output_schema">>, |
| 864 | annotations?: ToolAnnotations, |
| 865 | ): Tool => { |
| 866 | const owner = row.owner as Owner; |
| 867 | const integration = IntegrationSlug.make(row.integration); |
| 868 | const connection = ConnectionName.make(row.connection); |
| 869 | const name = ToolName.make(row.name); |
| 870 | return { |
| 871 | address: toolAddress(owner, integration, connection, name), |
| 872 | owner, |
| 873 | integration, |
| 874 | connection, |
| 875 | name, |
| 876 | pluginId: row.plugin_id, |
| 877 | description: row.description, |
| 878 | inputSchema: decodeJsonColumn(row.input_schema), |
| 879 | outputSchema: decodeJsonColumn(row.output_schema), |
| 880 | annotations: annotations ?? (decodeJsonColumn(row.annotations) as ToolAnnotations | undefined), |
| 881 | }; |
| 882 | }; |
| 883 | |
| 884 | // --------------------------------------------------------------------------- |
| 885 | // Condition builders |
no test coverage detected