(
address: ToolAddress,
)
| 3904 | }); |
| 3905 | |
| 3906 | const policiesResolve = ( |
| 3907 | address: ToolAddress, |
| 3908 | ): Effect.Effect<EffectivePolicy, StorageFailure> => |
| 3909 | Effect.gen(function* () { |
| 3910 | const parsed = parseToolAddress(String(address)); |
| 3911 | const policyRows = yield* core.findMany("tool_policy", {}); |
| 3912 | const toolId = parsed |
| 3913 | ? `${parsed.integration}.${parsed.owner}.${parsed.connection}.${parsed.tool}` |
| 3914 | : String(address); |
| 3915 | // Find the tool to read its default approval annotation. |
| 3916 | let requiresApproval: boolean | undefined; |
| 3917 | if (parsed) { |
| 3918 | const row = yield* core.findFirst("tool", { |
| 3919 | where: (b: AnyCb) => |
| 3920 | b.and( |
| 3921 | byOwner(parsed.owner)(b), |
| 3922 | b("integration", "=", String(parsed.integration)), |
| 3923 | b("connection", "=", String(parsed.connection)), |
| 3924 | b("name", "=", String(parsed.tool)), |
| 3925 | ), |
| 3926 | }); |
| 3927 | if (row) { |
| 3928 | const annotations = decodeJsonColumn(row.annotations) as ToolAnnotations | undefined; |
| 3929 | requiresApproval = annotations?.requiresApproval; |
| 3930 | } |
| 3931 | } |
| 3932 | return resolveEffectivePolicy(toolId, policyRows, ownerRankForRow, requiresApproval); |
| 3933 | }); |
| 3934 | |
| 3935 | // ------------------------------------------------------------------ |
| 3936 | // Artifacts — saved generative-UI components, owner-scoped. |
nothing calls this directly
no test coverage detected