| @@ -23,7 +23,9 @@ import { · 22 unmodified lines |
| 23 | type OpenApiToolDefinition, | 23 | type OpenApiToolDefinition, |
| 24 | type OpenApiToolManifest, | 24 | type OpenApiToolManifest, |
| 25 | } from "@executor/codemode-openapi"; | 25 | } from "@executor/codemode-openapi"; |
| 26 | import { makeDenoSubprocessExecutor } from "@executor/runtime-deno-subprocess"; | 26 | import { isDenoAvailable, |
| | 27 | makeDenoSubprocessExecutor } from "@executor/runtime-deno-subprocess"; |
| | 28 | import { makeSesExecutor } from "@executor/runtime-ses"; |
| 27 | import { | 29 | import { |
| 28 | SqlControlPlaneRowsService, | 30 | SqlControlPlaneRowsService, |
| 29 | type SqlControlPlaneRows, | 31 | type SqlControlPlaneRows, |
| @@ -389,7 +391,7 @@ const loadOpenApiWorkspaceTools = (input: { · 359 unmodified lines |
| 389 | description: definition.description, | 391 | description: definition.description, |
| 390 | interaction: | 392 | interaction: |
| 391 | definition.method.toUpperCase() === "GET" | 393 | definition.method.toUpperCase() === "GET" |
| 392 | || definition.method.toUpperCase() === "HEAD" | 394 | || definition.method.toUpperCase() === "HEAD" |
| 393 | ? "auto" | 395 | ? "auto" |
| 394 | : "required", | 396 | : "required", |
| 395 | inputType: presentation.inputType, | 397 | inputType: presentation.inputType, |
| @@ -627,13 +629,13 @@ const authorizePersistedToolInvocation = (input: { · 231 unmodified lines |
| 627 | ); | 629 | ); |
| 628 | const policies = Option.isSome(workspace) | 630 | const policies = Option.isSome(workspace) |
| 629 | ? yield* input.rows.policies.listForWorkspaceContext({ | 631 | ? yield* input.rows.policies.listForWorkspaceContext({ |
| 630 | organizationId: workspace.value.organizationId, | 632 | organizationId: workspace.value.organizationId, |
| 631 | workspaceId: input.workspaceId, | 633 | workspaceId: input.workspaceId, |
| 632 | }).pipe( | 634 | }).pipe( |
| 633 | Effect.mapError((cause) => | 635 | Effect.mapError((cause) => |
| 634 | cause instanceof Error ? cause : new Error(String(cause)), | 636 | cause instanceof Error ? cause : new Error(String(cause)), |
| 635 | ), | 637 | ), |
| 636 | ) | 638 | ) |
| 637 | : []; | 639 | : []; |
| 638 | | 640 | |
| 639 | const decision = evaluateInvocationPolicy({ | 641 | const decision = evaluateInvocationPolicy({ |
| @@ -648,7 +650,7 @@ const authorizePersistedToolInvocation = (input: { · 8 unmodified lines |
| 648 | accountId: input.accountId, | 650 | accountId: input.accountId, |
| 649 | clientId: | 651 | clientId: |
| 650 | typeof input.context?.clientId === "string" | 652 | typeof input.context?.clientId === "string" |
| 651 | && input.context.clientId.length > 0 | 653 | && input.context.clientId.length > 0 |
| 652 | ? input.context.clientId | 654 | ? input.context.clientId |
| 653 | : null, | 655 | : null, |
| 654 | }, | 656 | }, |
| @@ -1214,8 +1216,12 @@ export const createWorkspaceExecutionEnvironmentResolver = (input: { · 559 unmodified lines |
| 1214 | onElicitation, | 1216 | onElicitation, |
| 1215 | }); | 1217 | }); |
| 1216 | | 1218 | |
| | 1219 | const executor = isDenoAvailable() |
| | 1220 | ? makeDenoSubprocessExecutor() |
| | 1221 | : makeSesExecutor(); |
| | 1222 | |
| 1217 | return { | 1223 | return { |
| 1218 | executor: makeDenoSubprocessExecutor(), | 1224 | executor, |
| 1219 | toolInvoker, | 1225 | toolInvoker, |
| 1220 | catalog, | 1226 | catalog, |
| 1221 | } satisfies ExecutionEnvironment; | 1227 | } satisfies ExecutionEnvironment; |