( row: ToolInvocationRow & Partial<Pick<ToolRow, "input_schema" | "output_schema">>, annotations?: ToolAnnotations, )
| 1012 | // schema columns); `Tool.inputSchema`/`outputSchema` are optional and stay |
| 1013 | // absent for those callers — `tools.schema` is the schema-bearing surface. |
| 1014 | const rowToTool = ( |
| 1015 | row: ToolInvocationRow & Partial<Pick<ToolRow, "input_schema" | "output_schema">>, |
| 1016 | annotations?: ToolAnnotations, |
| 1017 | ): Tool => { |
| 1018 | const owner = row.owner as Owner; |
| 1019 | const integration = IntegrationSlug.make(row.integration); |
| 1020 | const connection = ConnectionName.make(row.connection); |
| 1021 | const name = ToolName.make(row.name); |
| 1022 | return { |
| 1023 | address: toolAddress(owner, integration, connection, name), |
| 1024 | owner, |
| 1025 | integration, |
| 1026 | connection, |
| 1027 | name, |
| 1028 | pluginId: row.plugin_id, |
| 1029 | description: row.description, |
| 1030 | inputSchema: decodeJsonColumn(row.input_schema), |
| 1031 | outputSchema: decodeJsonColumn(row.output_schema), |
| 1032 | annotations: annotations ?? (decodeJsonColumn(row.annotations) as ToolAnnotations | undefined), |
| 1033 | }; |
| 1034 | }; |
| 1035 | |
| 1036 | // --------------------------------------------------------------------------- |
| 1037 | // Condition builders |
no test coverage detected