( row: ToolInvocationRow & Partial<Pick<ToolRow, "input_schema" | "output_schema">>, annotations?: ToolAnnotations, )
| 1137 | // schema columns); `Tool.inputSchema`/`outputSchema` are optional and stay |
| 1138 | // absent for those callers — `tools.schema` is the schema-bearing surface. |
| 1139 | const rowToTool = ( |
| 1140 | row: ToolInvocationRow & Partial<Pick<ToolRow, "input_schema" | "output_schema">>, |
| 1141 | annotations?: ToolAnnotations, |
| 1142 | ): Tool => { |
| 1143 | const owner = row.owner as Owner; |
| 1144 | const integration = IntegrationSlug.make(row.integration); |
| 1145 | const connection = ConnectionName.make(row.connection); |
| 1146 | const name = ToolName.make(row.name); |
| 1147 | return { |
| 1148 | address: toolAddress(owner, integration, connection, name), |
| 1149 | owner, |
| 1150 | integration, |
| 1151 | connection, |
| 1152 | name, |
| 1153 | pluginId: row.plugin_id, |
| 1154 | description: row.description, |
| 1155 | inputSchema: decodeJsonColumn(row.input_schema), |
| 1156 | outputSchema: decodeJsonColumn(row.output_schema), |
| 1157 | annotations: annotations ?? (decodeJsonColumn(row.annotations) as ToolAnnotations | undefined), |
| 1158 | }; |
| 1159 | }; |
| 1160 | |
| 1161 | // --------------------------------------------------------------------------- |
| 1162 | // Condition builders |
no test coverage detected