Showing the changes to packages/core/api/src/server/execution-stack.ts (1 of 161 files). Show all
Unified · Split
| @@ -27,7 +27,7 @@ import { Context, Effect, Layer } from "effect"; · 26 unmodified lines | ||
| 27 | 27 | import type * as Cause from "effect/Cause"; |
| 28 | 28 | |
| 29 | 29 | import type { McpResource } from "@executor-js/host-mcp"; |
| 30 | −import type { AnyPlugin, Executor, ExecutorConfig, StorageFailure } from "@executor-js/sdk"; | |
| 30 | +import type { AnyPlugin, Executor, ExecutorAccess, StorageFailure } from "@executor-js/sdk"; | |
| 31 | 31 | import { |
| 32 | 32 | createExecutionEngine, |
| 33 | 33 | type ExecutionEngine, |
| @@ -112,11 +112,12 @@ export const makeExecutionStack = < · 78 unmodified lines | ||
| 112 | 112 | accountId: string, |
| 113 | 113 | organizationId: string, |
| 114 | 114 | organizationName: string, |
| 115 | − options?: { | |
| 115 | + options: { | |
| 116 | 116 | readonly mcpResource?: McpResource; |
| 117 | − /** Workspace-settings permission for this binding (see | |
| 118 | − * `ExecutorConfig.orgWrites`), derived from the acting member's role. */ | |
| 119 | − readonly orgWrites?: ExecutorConfig<TPlugins>["orgWrites"]; | |
| 117 | + /** The product's access decisions for this binding (see | |
| 118 | + * `ExecutorConfig.access`), selected by the host — role-derived on the | |
| 119 | + * HTTP plane, request-bound on MCP session stacks. */ | |
| 120 | + readonly access: ExecutorAccess; | |
| 120 | 121 | }, |
| 121 | 122 | ): Effect.Effect< |
| 122 | 123 | { readonly executor: Executor<TPlugins>; readonly engine: ExecutionEngine<Cause.YieldableError> }, |
| @@ -129,8 +130,8 @@ export const makeExecutionStack = < · 6 unmodified lines | ||
| 129 | 130 | organizationId, |
| 130 | 131 | organizationName, |
| 131 | 132 | { |
| 132 | − plugins: { mcpResource: options?.mcpResource }, | |
| 133 | − ...(options?.orgWrites === undefined ? {} : { orgWrites: options.orgWrites }), | |
| 133 | + plugins: { mcpResource: options.mcpResource }, | |
| 134 | + access: options.access, | |
| 134 | 135 | }, |
| 135 | 136 | ).pipe(Effect.withSpan("executor.stack.scoped_executor")); |
| 136 | 137 | const codeExecutor = yield* CodeExecutorProvider.asEffect().pipe( |
| @@ -147,7 +148,7 @@ export const makeExecutionStack = < · 10 unmodified lines | ||
| 147 | 148 | organizationId, |
| 148 | 149 | organizationName, |
| 149 | 150 | }, |
| 150 | − { mcpResource: options?.mcpResource }, | |
| 151 | + { mcpResource: options.mcpResource }, | |
| 151 | 152 | ), |
| 152 | 153 | ); |
| 153 | 154 | return { executor, engine }; |