( row: ToolInvocationRow & Partial<Pick<ToolRow, "input_schema" | "output_schema">>, annotations?: ToolAnnotations, )
| 912 | // schema columns); `Tool.inputSchema`/`outputSchema` are optional and stay |
| 913 | // absent for those callers — `tools.schema` is the schema-bearing surface. |
| 914 | const rowToTool = ( |
| 915 | row: ToolInvocationRow & Partial<Pick<ToolRow, "input_schema" | "output_schema">>, |
| 916 | annotations?: ToolAnnotations, |
| 917 | ): Tool => { |
| 918 | const owner = row.owner as Owner; |
| 919 | const integration = IntegrationSlug.make(row.integration); |
| 920 | const connection = ConnectionName.make(row.connection); |
| 921 | const name = ToolName.make(row.name); |
| 922 | return { |
| 923 | address: toolAddress(owner, integration, connection, name), |
| 924 | owner, |
| 925 | integration, |
| 926 | connection, |
| 927 | name, |
| 928 | pluginId: row.plugin_id, |
| 929 | description: row.description, |
| 930 | inputSchema: decodeJsonColumn(row.input_schema), |
| 931 | outputSchema: decodeJsonColumn(row.output_schema), |
| 932 | annotations: annotations ?? (decodeJsonColumn(row.annotations) as ToolAnnotations | undefined), |
| 933 | }; |
| 934 | }; |
| 935 | |
| 936 | // --------------------------------------------------------------------------- |
| 937 | // Condition builders |
no test coverage detected