- cloud: resolves userId from the authenticated session and builds a [userOrgScope, orgScope] stack via createScopedExecutor(userId, orgId, orgName). userId threaded through execution-stack, mcp-session, and MCP dispatch init. - cloud env refactor: deletes the lazy Proxy apps/cloud/src/env.ts in favor of cloudflare:workers env imported at call sites; adds env-augment.d.ts to type secrets not present in generated wrangler types. - cloud/server.ts: env-guarded OTEL wiring (skips instrument() when AXIOM_TOKEN absent); captures rawFetch before instrument() mutates it so dev requests still land on the Hono app. - cloud/services/db.ts: prefers DATABASE_URL over the hyperdrive proxy so local dev works without the tunnel. - vite.config.ts: devCrashGuard plugin that prints uncaught Worker errors with a stable exit. - hosts/mcp: optional debug flag surfaces verbose session logging, wired up from cloud mcp-session. - local/examples/marketing: migrated to scopes: [scope].
Showing the changes to examples (2 of 25 files). Show all
Unified · Split
| @@ -83,7 +83,7 @@ const plugins = [ · 82 unmodified lines | |||
| 83 | ] as const; | 83 | ] as const; |
| 84 | 84 | ||
| 85 | const config = { | 85 | const config = { |
| 86 | scope, | 86 | scopes: [scope], |
| 87 | adapter: makeMemoryAdapter({ schema: collectSchemas(plugins) }), | 87 | adapter: makeMemoryAdapter({ schema: collectSchemas(plugins) }), |
| 88 | blobs: makeInMemoryBlobStore(), | 88 | blobs: makeInMemoryBlobStore(), |
| 89 | plugins, | 89 | plugins, |
| @@ -208,6 +208,7 @@ const program = Effect.gen(function* () { · 118 unmodified lines | |||
| 208 | yield* executor.secrets.set( | 208 | yield* executor.secrets.set( |
| 209 | new SetSecretInput({ | 209 | new SetSecretInput({ |
| 210 | id: SecretId.make("example-api-token"), | 210 | id: SecretId.make("example-api-token"), |
| 211 | scope: "example-scope" as SetSecretInput["scope"], | ||
| 211 | name: "Example API Token", | 212 | name: "Example API Token", |
| 212 | value: "sk-example-redacted", | 213 | value: "sk-example-redacted", |
| 213 | provider: "file", | 214 | provider: "file", |
| @@ -262,6 +263,7 @@ const program = Effect.gen(function* () { · 48 unmodified lines | |||
| 262 | spec: exampleOpenApiSpec, | 263 | spec: exampleOpenApiSpec, |
| 263 | namespace: "example-api", | 264 | namespace: "example-api", |
| 264 | baseUrl: "https://example.com/api", | 265 | baseUrl: "https://example.com/api", |
| 266 | scope: "example-scope", | ||
| 265 | }); | 267 | }); |
| 266 | console.log("Registered OpenAPI source:", addSpecResult); | 268 | console.log("Registered OpenAPI source:", addSpecResult); |
| 267 | 269 | ||
| @@ -371,6 +373,7 @@ const program = Effect.gen(function* () { · 103 unmodified lines | |||
| 371 | endpoint: "https://example.com/graphql", | 373 | endpoint: "https://example.com/graphql", |
| 372 | introspectionJson, | 374 | introspectionJson, |
| 373 | namespace: "example-graphql", | 375 | namespace: "example-graphql", |
| 376 | scope: "example-scope", | ||
| 374 | }); | 377 | }); |
| 375 | console.log("Registered GraphQL source:", gqlResult); | 378 | console.log("Registered GraphQL source:", gqlResult); |
| 376 | 379 | ||
| @@ -12,7 +12,7 @@ import { graphqlPlugin } from "@executor/plugin-graphql/promise"; · 11 unmodified lines | |||
| 12 | // --------------------------------------------------------------------------- | 12 | // --------------------------------------------------------------------------- |
| 13 | 13 | ||
| 14 | const executor = await createExecutor({ | 14 | const executor = await createExecutor({ |
| 15 | scope: { name: "my-app" }, | 15 | scopes: [{ id: "my-app", name: "my-app" }], |
| 16 | plugins: [mcpPlugin(), openApiPlugin(), graphqlPlugin()] as const, | 16 | plugins: [mcpPlugin(), openApiPlugin(), graphqlPlugin()] as const, |
| 17 | }); | 17 | }); |
| 18 | 18 | ||
| @@ -24,6 +24,7 @@ await executor.mcp.addSource({ · 5 unmodified lines | |||
| 24 | transport: "remote", | 24 | transport: "remote", |
| 25 | name: "Context7", | 25 | name: "Context7", |
| 26 | endpoint: "https://mcp.context7.com/mcp", | 26 | endpoint: "https://mcp.context7.com/mcp", |
| 27 | scope: "my-app", | ||
| 27 | }); | 28 | }); |
| 28 | 29 | ||
| 29 | // Stdio server | 30 | // Stdio server |
| @@ -41,6 +42,7 @@ await executor.mcp.addSource({ · 11 unmodified lines | |||
| 41 | await executor.openapi.addSpec({ | 42 | await executor.openapi.addSpec({ |
| 42 | spec: "https://petstore3.swagger.io/api/v3/openapi.json", | 43 | spec: "https://petstore3.swagger.io/api/v3/openapi.json", |
| 43 | namespace: "petstore", | 44 | namespace: "petstore", |
| 45 | scope: "my-app", | ||
| 44 | }); | 46 | }); |
| 45 | 47 | ||
| 46 | // With auth headers (static or secret-backed) | 48 | // With auth headers (static or secret-backed) |
| @@ -62,6 +64,7 @@ await executor.openapi.addSpec({ · 15 unmodified lines | |||
| 62 | await executor.graphql.addSource({ | 64 | await executor.graphql.addSource({ |
| 63 | endpoint: "https://graphql.anilist.co", | 65 | endpoint: "https://graphql.anilist.co", |
| 64 | namespace: "anilist", | 66 | namespace: "anilist", |
| 67 | scope: "my-app", | ||
| 65 | }); | 68 | }); |
| 66 | 69 | ||
| 67 | // --------------------------------------------------------------------------- | 70 | // --------------------------------------------------------------------------- |
| @@ -97,6 +100,7 @@ if (anilistTool) { · 29 unmodified lines | |||
| 97 | await executor.secrets.set( | 100 | await executor.secrets.set( |
| 98 | new SetSecretInput({ | 101 | new SetSecretInput({ |
| 99 | id: SecretId.make("api-key"), | 102 | id: SecretId.make("api-key"), |
| 103 | scope: "my-app" as SetSecretInput["scope"], | ||
| 100 | name: "Shared API Key", | 104 | name: "Shared API Key", |
| 101 | value: "sk_...", | 105 | value: "sk_...", |
| 102 | }), | 106 | }), |