(
address: ToolAddress,
)
| 6064 | ); |
| 6065 | |
| 6066 | const policiesResolve = ( |
| 6067 | address: ToolAddress, |
| 6068 | ): Effect.Effect<EffectivePolicy, StorageFailure> => |
| 6069 | Effect.gen(function* () { |
| 6070 | const parsed = parseToolAddress(String(address)); |
| 6071 | const policyRows = yield* core.findMany("tool_policy", {}); |
| 6072 | const toolId = parsed |
| 6073 | ? `${parsed.integration}.${parsed.owner}.${parsed.connection}.${parsed.tool}` |
| 6074 | : String(address); |
| 6075 | // Find the tool to read its default approval annotation. |
| 6076 | let requiresApproval: boolean | undefined; |
| 6077 | if (parsed) { |
| 6078 | const row = yield* core.findFirst("tool", { |
| 6079 | where: (b: AnyCb) => |
| 6080 | b.and( |
| 6081 | byOwner(parsed.owner)(b), |
| 6082 | b("integration", "=", String(parsed.integration)), |
| 6083 | b("connection", "=", String(parsed.connection)), |
| 6084 | b("name", "=", String(parsed.tool)), |
| 6085 | ), |
| 6086 | }); |
| 6087 | if (row) { |
| 6088 | const annotations = decodeJsonColumn(row.annotations) as ToolAnnotations | undefined; |
| 6089 | requiresApproval = annotations?.requiresApproval; |
| 6090 | } |
| 6091 | } |
| 6092 | return resolveEffectivePolicy(toolId, policyRows, ownerRankForRow, requiresApproval); |
| 6093 | }); |
| 6094 | |
| 6095 | // ------------------------------------------------------------------ |
| 6096 | // Artifacts — saved generative-UI components, owner-scoped. |
nothing calls this directly
no test coverage detected