History

Move product access rules out of the SDK

Rhys Sullivan committed 1 month ago

Commit c676e561 parent a72e51d161 files · +3935 −867Browse files

Showing the changes to examples (6 of 161 files). Show all

Unified · Split

6 files
  1. examples/all-plugins/package.json +1 −0
  2. examples/all-plugins/src/main.ts +3 −0
  3. examples/docs-sdk-quickstart/package.json +1 −0
  4. examples/docs-sdk-quickstart/src/main.ts +4 −0
  5. examples/promise-sdk/package.json +1 −0
  6. examples/promise-sdk/src/main.ts +4 −0
examples/all-plugins/package.json+1−0
@@ -16,6 +16,7 @@ · 15 unmodified lines
1616 "@executor-js/plugin-onepassword": "workspace:*",
1717 "@executor-js/plugin-openapi": "workspace:*",
1818 "@executor-js/plugin-workos-vault": "workspace:*",
19+ "@executor-js/product-access": "workspace:*",
1920 "@executor-js/sdk": "workspace:*",
2021 "effect": "catalog:"
2122 },
examples/all-plugins/src/main.ts+3−0
@@ -31,6 +31,7 @@ import { · 30 unmodified lines
3131 ToolAddress,
3232 type CredentialProvider,
3333 } from "@executor-js/sdk";
34+import { workspaceServiceAccess } from "@executor-js/product-access";
3435
3536 import { fileSecretsPlugin } from "@executor-js/plugin-file-secrets";
3637 import {
@@ -192,6 +193,8 @@ const program = Effect.gen(function* () { · 155 unmodified lines
192193
193194 const executor = yield* createExecutor({
194195 tenant: Tenant.make("example-tenant"),
196+ // Subject-less single-workspace example: org partition, writes allowed.
197+ access: workspaceServiceAccess(),
195198 plugins,
196199 providers: [memoryProvider],
197200 onElicitation: "accept-all" as const,
examples/docs-sdk-quickstart/package.json+1−0
@@ -10,6 +10,7 @@ · 9 unmodified lines
1010 },
1111 "dependencies": {
1212 "@executor-js/plugin-openapi": "workspace:*",
13+ "@executor-js/product-access": "workspace:*",
1314 "@executor-js/sdk": "workspace:*",
1415 "effect": "catalog:"
1516 },
examples/docs-sdk-quickstart/src/main.ts+4−0
@@ -8,6 +8,7 @@ import { · 7 unmodified lines
88 type CredentialProvider,
99 } from "@executor-js/sdk/promise";
1010 import { openApiPlugin, variable } from "@executor-js/plugin-openapi/promise";
11+import { workspaceServiceAccess } from "@executor-js/product-access";
1112
1213 const inventoryApi = {
1314 openapi: "3.0.0",
@@ -92,6 +93,9 @@ const memoryProvider: CredentialProvider = { · 78 unmodified lines
9293 };
9394
9495 const executor = await createExecutor({
96+ // Subject-less single-workspace embedder: the product posture is stated
97+ // explicitly — the SDK ships no default.
98+ access: workspaceServiceAccess(),
9599 plugins: [openApiPlugin()],
96100 providers: [memoryProvider],
97101 onElicitation: "accept-all",
examples/promise-sdk/package.json+1−0
@@ -12,6 +12,7 @@ · 11 unmodified lines
1212 "@executor-js/plugin-graphql": "workspace:*",
1313 "@executor-js/plugin-mcp": "workspace:*",
1414 "@executor-js/plugin-openapi": "workspace:*",
15+ "@executor-js/product-access": "workspace:*",
1516 "@executor-js/sdk": "workspace:*"
1617 },
1718 "devDependencies": {
examples/promise-sdk/src/main.ts+4−0
@@ -20,6 +20,7 @@ import { Effect } from "effect"; · 19 unmodified lines
2020 import { mcpPlugin } from "@executor-js/plugin-mcp/promise";
2121 import { openApiPlugin, variable } from "@executor-js/plugin-openapi/promise";
2222 import { graphqlPlugin } from "@executor-js/plugin-graphql/promise";
23+import { workspaceServiceAccess } from "@executor-js/product-access";
2324
2425 // ---------------------------------------------------------------------------
2526 // 1. Create the executor with all plugins
@@ -44,6 +45,9 @@ const memoryProvider: CredentialProvider = { · 18 unmodified lines
4445 };
4546
4647 const executor = await createExecutor({
48+ // Subject-less single-workspace embedder: the product posture is stated
49+ // explicitly — the SDK ships no default.
50+ access: workspaceServiceAccess(),
4751 plugins,
4852 providers: [memoryProvider],
4953 onElicitation: "accept-all",