( row: ToolInvocationRow & Partial<Pick<ToolRow, "input_schema" | "output_schema">>, annotations?: ToolAnnotations, )
| 1198 | // schema columns); `Tool.inputSchema`/`outputSchema` are optional and stay |
| 1199 | // absent for those callers — `tools.schema` is the schema-bearing surface. |
| 1200 | const rowToTool = ( |
| 1201 | row: ToolInvocationRow & Partial<Pick<ToolRow, "input_schema" | "output_schema">>, |
| 1202 | annotations?: ToolAnnotations, |
| 1203 | ): Tool => { |
| 1204 | const owner = row.owner as Owner; |
| 1205 | const integration = IntegrationSlug.make(row.integration); |
| 1206 | const connection = ConnectionName.make(row.connection); |
| 1207 | const name = ToolName.make(row.name); |
| 1208 | return { |
| 1209 | address: toolAddress(owner, integration, connection, name), |
| 1210 | owner, |
| 1211 | integration, |
| 1212 | connection, |
| 1213 | name, |
| 1214 | pluginId: row.plugin_id, |
| 1215 | description: row.description, |
| 1216 | inputSchema: decodeJsonColumn(row.input_schema), |
| 1217 | outputSchema: decodeJsonColumn(row.output_schema), |
| 1218 | annotations: annotations ?? (decodeJsonColumn(row.annotations) as ToolAnnotations | undefined), |
| 1219 | }; |
| 1220 | }; |
| 1221 | |
| 1222 | // --------------------------------------------------------------------------- |
| 1223 | // Condition builders |
no test coverage detected