History

Serve every MCP endpoint as a projection of one executor

Rhys Sullivan committed 2 months ago

Commit 971b3f41 parent 5e4da2a41 files · +1406 −728Browse files

Showing the changes to apps/cloud/src/engine/execution-stack.ts (1 of 41 files). Show all

Unified · Split

apps/cloud/src/engine/execution-stack.ts+1−4
@@ -63,21 +63,18 @@ const cloudPluginFactory = executorConfig.plugins as (deps: { · 62 unmodified lines
63 readonly clientId: string;63 readonly clientId: string;
64 readonly apiUrl?: string;64 readonly apiUrl?: string;
65 };65 };
66 readonly activeToolkitSlug?: string;
67}) => readonly AnyPlugin[];66}) => readonly AnyPlugin[];
68 67
69// Fresh plugin instances per request, carrying the Worker env's WorkOS Vault68// Fresh plugin instances per request, carrying the Worker env's WorkOS Vault
70// credentials. Matches the old `createScopedExecutor`'s `orgPlugins()`.69// credentials. Matches the old `createScopedExecutor`'s `orgPlugins()`.
71export const CloudPluginsProvider: Layer.Layer<PluginsProvider> = Layer.succeed(PluginsProvider)({70export const CloudPluginsProvider: Layer.Layer<PluginsProvider> = Layer.succeed(PluginsProvider)({
72 plugins: (context) =>71 plugins: () =>
73 cloudPluginFactory({72 cloudPluginFactory({
74 workosCredentials: {73 workosCredentials: {
75 apiKey: env.WORKOS_API_KEY,74 apiKey: env.WORKOS_API_KEY,
76 clientId: env.WORKOS_CLIENT_ID,75 clientId: env.WORKOS_CLIENT_ID,
77 apiUrl: env.WORKOS_API_URL,76 apiUrl: env.WORKOS_API_URL,
78 },77 },
79 activeToolkitSlug:
80 context?.mcpResource?.kind === "toolkit" ? context.mcpResource.slug : undefined,
81 }),78 }),
82});79});
83 80