Unified · Split
| @@ -73,6 +73,9 @@ import { · 72 unmodified lines | |||
| 73 | import { | 73 | import { |
| 74 | loadRuntimeLocalScopePolicies, | 74 | loadRuntimeLocalScopePolicies, |
| 75 | } from "../../../policies/operations"; | 75 | } from "../../../policies/operations"; |
| 76 | import { | ||
| 77 | RuntimeLocalScopeService, | ||
| 78 | } from "../../scope/runtime-context"; | ||
| 76 | import { | 79 | import { |
| 77 | provideRuntimeLocalScope, | 80 | provideRuntimeLocalScope, |
| 78 | } from "./local"; | 81 | } from "./local"; |
| @@ -177,9 +180,19 @@ export const createScopeToolInvoker = (input: { · 98 unmodified lines | |||
| 177 | return catalog; | 180 | return catalog; |
| 178 | }, | 181 | }, |
| 179 | filterDiscoverResults: async (results: readonly DiscoverResultItem[]) => { | 182 | filterDiscoverResults: async (results: readonly DiscoverResultItem[]) => { |
| 183 | if (!input.runtimeLocalScope) { | ||
| 184 | return results; | ||
| 185 | } | ||
| 186 | |||
| 180 | const { policies } = await Effect.runPromise( | 187 | const { policies } = await Effect.runPromise( |
| 181 | loadRuntimeLocalScopePolicies(input.scopeId).pipe( | 188 | loadRuntimeLocalScopePolicies(input.scopeId).pipe( |
| 182 | Effect.provide(persistedToolRuntimeLayer), | 189 | Effect.provide(persistedToolRuntimeLayer), |
| 190 | Effect.provide( | ||
| 191 | Layer.succeed( | ||
| 192 | RuntimeLocalScopeService, | ||
| 193 | input.runtimeLocalScope, | ||
| 194 | ), | ||
| 195 | ), | ||
| 183 | ), | 196 | ), |
| 184 | ); | 197 | ); |
| 185 | 198 | ||