History

disable admin tools

Rhys Sullivan committed 7 months ago

Commit f2797e51 parent f2a7b1116 files · +43 −909Browse files

Unified · Split

16 files
  1. apps/executor/package.json +1 −1
  2. apps/executor/src/cli/main.ts +4 −2
  3. bun.lock +17 −18
  4. packages/platform/internal/src/index.ts +0 −1
  5. packages/platform/internal/src/tools/executor-admin.ts +0 −758
  6. packages/platform/sdk-file/src/index.ts +0 −3
  7. packages/platform/sdk/src/executor-effect.ts +0 −2
  8. packages/platform/sdk/src/runtime/execution/scope/environment.ts +0 −29
  9. packages/platform/sdk/src/runtime/execution/scope/tool-invoker.ts +0 −52
  10. packages/platform/sdk/src/runtime/index.ts +0 −10
  11. packages/platform/sdk/src/runtime/sources/source-plugins/index.ts +5 −14
  12. packages/platform/server/package.json +1 −1
  13. packages/platform/server/src/index.ts +2 −2
  14. plugins/internal/sdk/index.ts +4 −9
  15. plugins/internal/sdk/package.json +7 −5
  16. plugins/internal/sdk/tsconfig.json +2 −2
apps/executor/package.json+1−1
@@ -40,10 +40,10 @@ · 39 unmodified lines
4040 "@executor/executor-mcp": "workspace:*",
4141 "@executor/plugin-google-discovery-sdk": "workspace:*",
4242 "@executor/plugin-graphql-sdk": "workspace:*",
43+ "@executor/plugin-internal-sdk": "workspace:*",
4344 "@executor/plugin-mcp-sdk": "workspace:*",
4445 "@executor/plugin-openapi-sdk": "workspace:*",
4546 "@executor/platform-api": "workspace:*",
46− "@executor/platform-internal": "workspace:*",
4747 "@executor/platform-sdk": "workspace:*",
4848 "@executor/platform-sdk-file": "workspace:*",
4949 "@executor/server": "workspace:*",
apps/executor/src/cli/main.ts+4−2
@@ -20,13 +20,15 @@ import { · 19 unmodified lines
2020 import {
2121 graphqlSdkPlugin,
2222 } from "@executor/plugin-graphql-sdk";
23+import {
24+ internalSdkPlugin,
25+} from "@executor/plugin-internal-sdk";
2326 import {
2427 mcpSdkPlugin,
2528 } from "@executor/plugin-mcp-sdk";
2629 import {
2730 openApiSdkPlugin,
2831 } from "@executor/plugin-openapi-sdk";
29−import { createWorkspaceExecutorAdminToolMap } from "@executor/platform-internal";
3032 import {
3133 getExecutorSourcesAddHelpLines,
3234 RuntimeExecutionResolverService,
@@ -303,6 +305,7 @@ const loadRunWorkflowText = (): Effect.Effect<string, Error, never> => · 270 unmodified lines
303305 localDataDir: DEFAULT_LOCAL_DATA_DIR,
304306 }),
305307 plugins: [
308+ internalSdkPlugin(),
306309 graphqlSdkPlugin({
307310 storage: createFileGraphqlSourceStorage({
308311 rootDir: `${DEFAULT_LOCAL_DATA_DIR}/plugins/graphql/sources`,
@@ -330,7 +333,6 @@ const loadRunWorkflowText = (): Effect.Effect<string, Error, never> => · 21 unmodified lines
330333 }),
331334 }),
332335 ] as const,
333− createInternalToolMap: createWorkspaceExecutorAdminToolMap,
334336 }).pipe(Effect.mapError(toError)),
335337 (executor) =>
336338 Effect.gen(function* () {
bun.lock+17−18
@@ -29,11 +29,11 @@ · 28 unmodified lines
2929 "@executor/codemode-core": "workspace:*",
3030 "@executor/executor-mcp": "workspace:*",
3131 "@executor/platform-api": "workspace:*",
32− "@executor/platform-internal": "workspace:*",
3332 "@executor/platform-sdk": "workspace:*",
3433 "@executor/platform-sdk-file": "workspace:*",
3534 "@executor/plugin-google-discovery-sdk": "workspace:*",
3635 "@executor/plugin-graphql-sdk": "workspace:*",
36+ "@executor/plugin-internal-sdk": "workspace:*",
3737 "@executor/plugin-mcp-sdk": "workspace:*",
3838 "@executor/plugin-openapi-sdk": "workspace:*",
3939 "@executor/server": "workspace:*",
@@ -308,20 +308,6 @@ · 268 unmodified lines
308308 "vitest": "catalog:",
309309 },
310310 },
311− "packages/platform/internal": {
312− "name": "@executor/platform-internal",
313− "version": "0.0.0",
314− "dependencies": {
315− "@executor/codemode-core": "workspace:*",
316− "@executor/platform-sdk": "workspace:*",
317− "effect": "catalog:",
318− },
319− "devDependencies": {
320− "@types/node": "catalog:",
321− "bun-types": "catalog:",
322− "typescript": "^5.9.3",
323− },
324− },
325311 "packages/platform/sdk": {
326312 "name": "@executor/platform-sdk",
327313 "version": "0.0.0",
@@ -379,7 +365,6 @@ · 51 unmodified lines
379365 "@effect/platform-node": "catalog:",
380366 "@executor/executor-mcp": "workspace:*",
381367 "@executor/platform-api": "workspace:*",
382− "@executor/platform-internal": "workspace:*",
383368 "@executor/platform-sdk": "workspace:*",
384369 "@executor/platform-sdk-file": "workspace:*",
385370 "@executor/plugin-google-discovery-http": "workspace:*",
@@ -388,6 +373,7 @@ · 2 unmodified lines
388373 "@executor/plugin-graphql-http": "workspace:*",
389374 "@executor/plugin-graphql-sdk": "workspace:*",
390375 "@executor/plugin-graphql-shared": "workspace:*",
376+ "@executor/plugin-internal-sdk": "workspace:*",
391377 "@executor/plugin-mcp-http": "workspace:*",
392378 "@executor/plugin-mcp-sdk": "workspace:*",
393379 "@executor/plugin-mcp-shared": "workspace:*",
@@ -541,6 +527,19 @@ · 147 unmodified lines
541527 "bun-types": "catalog:",
542528 },
543529 },
530+ "plugins/internal/sdk": {
531+ "name": "@executor/plugin-internal-sdk",
532+ "version": "0.0.0",
533+ "dependencies": {
534+ "@executor/platform-sdk": "workspace:*",
535+ "@executor/source-core": "workspace:*",
536+ "effect": "catalog:",
537+ },
538+ "devDependencies": {
539+ "@types/node": "catalog:",
540+ "bun-types": "catalog:",
541+ },
542+ },
544543 "plugins/mcp/http": {
545544 "name": "@executor/plugin-mcp-http",
546545 "version": "0.0.0",
@@ -886,8 +885,6 @@ · 339 unmodified lines
886885
887886 "@executor/platform-api": ["@executor/platform-api@workspace:packages/platform/api"],
888887
889− "@executor/platform-internal": ["@executor/platform-internal@workspace:packages/platform/internal"],
890−
891888 "@executor/platform-sdk": ["@executor/platform-sdk@workspace:packages/platform/sdk"],
892889
893890 "@executor/platform-sdk-file": ["@executor/platform-sdk-file@workspace:packages/platform/sdk-file"],
@@ -908,6 +905,8 @@ · 14 unmodified lines
908905
909906 "@executor/plugin-graphql-shared": ["@executor/plugin-graphql-shared@workspace:plugins/graphql/shared"],
910907
908+ "@executor/plugin-internal-sdk": ["@executor/plugin-internal-sdk@workspace:plugins/internal/sdk"],
909+
911910 "@executor/plugin-mcp-http": ["@executor/plugin-mcp-http@workspace:plugins/mcp/http"],
912911
913912 "@executor/plugin-mcp-react": ["@executor/plugin-mcp-react@workspace:plugins/mcp/react"],
packages/platform/internal/src/index.ts+0−1
@@ -1 +0,0 @@
1−export * from "./tools/executor-admin";
packages/platform/internal/src/tools/executor-admin.ts+0−758
@@ -1,758 +0,0 @@
1−import { toTool, type ToolMap } from "@executor/codemode-core";
2−import type { Executor } from "@executor/platform-sdk";
3−import {
4− type ScopeId as AccountId,
5− LocalInstallationSchema,
6− LocalScopePolicySchema,
7− SourceIdSchema,
8− SourceInspectionDiscoverPayloadSchema,
9− SourceInspectionDiscoverResultSchema,
10− SourceInspectionSchema,
11− SourceInspectionToolDetailSchema,
12− SourceSchema,
13− type ScopeId as WorkspaceId,
14−} from "@executor/platform-sdk/schema";
15−import * as Effect from "effect/Effect";
16−import * as Layer from "effect/Layer";
17−import * as Schema from "effect/Schema";
18−
19−import {
20− ExecutorStateStore,
21− LocalInstanceConfigService,
22− SecretMaterialDeleterService,
23− SecretMaterialStorerService,
24− SecretMaterialUpdaterService,
25− type ExecutorStateStoreShape,
26− type ScopeInternalToolContext as WorkspaceInternalToolContext,
27− RuntimeSourceCatalogSyncService,
28− RuntimeSourceStore,
29− RuntimeSourceStoreService,
30−} from "@executor/platform-sdk/runtime";
31−import {
32− type RuntimeLocalScopeState,
33− provideOptionalRuntimeLocalScope,
34−} from "../../../sdk/src/runtime/scope/runtime-context";
35−import {
36− SourceArtifactStore,
37− type SourceArtifactStoreShape,
38− ScopeConfigStore,
39− type ScopeConfigStoreShape,
40− ScopeStateStore,
41− type ScopeStateStoreShape,
42− makeScopeStorageLayer,
43−} from "../../../sdk/src/runtime/scope/storage";
44−import {
45− CreateSecretPayloadSchema,
46− CreateSecretResultSchema,
47− type CreateSecretPayload,
48− DeleteSecretResultSchema,
49− InstanceConfigSchema,
50− SecretListItemSchema,
51− UpdateSecretPayloadSchema,
52− UpdateSecretResultSchema,
53− type UpdateSecretPayload,
54−} from "@executor/platform-sdk/contracts";
55−import {
56− createLocalSecret,
57− createPolicy,
58− deleteLocalSecret,
59− discoverSourceInspectionTools,
60− getPolicy,
61− getSource,
62− getSourceInspection,
63− getSourceInspectionToolDetail,
64− listLocalSecrets,
65− listPolicies,
66− listSources,
67− removePolicy,
68− removeSource,
69− updateLocalSecret,
70− updatePolicy,
71−} from "@executor/platform-sdk/operations";
72−import {
73− CreatePolicyPayloadSchema,
74− type CreatePolicyPayload,
75− type UpdatePolicyPayload,
76− UpdatePolicyPayloadSchema,
77−} from "@executor/platform-sdk/contracts";
78−const emptyInputSchema = Schema.standardSchemaV1(Schema.Struct({}));
79−const localInstallationOutputSchema = Schema.standardSchemaV1(
80− LocalInstallationSchema,
81−);
82−const instanceConfigOutputSchema =
83− Schema.standardSchemaV1(InstanceConfigSchema);
84−const secretListOutputSchema = Schema.standardSchemaV1(
85− Schema.Array(SecretListItemSchema),
86−);
87−const createSecretInputSchema = Schema.standardSchemaV1(
88− CreateSecretPayloadSchema,
89−);
90−const updateSecretInputSchema = Schema.standardSchemaV1(
91− Schema.Struct({
92− secretId: Schema.String,
93− payload: UpdateSecretPayloadSchema,
94− }),
95−);
96−const removeSecretInputSchema = Schema.standardSchemaV1(
97− Schema.Struct({
98− secretId: Schema.String,
99− }),
100−);
101−const removeResultSchema = Schema.standardSchemaV1(
102− Schema.Struct({
103− removed: Schema.Boolean,
104− }),
105−);
106−const listSourcesOutputSchema = Schema.standardSchemaV1(
107− Schema.Array(SourceSchema),
108−);
109−const getSourceInputSchema = Schema.standardSchemaV1(
110− Schema.Struct({
111− sourceId: SourceIdSchema,
112− }),
113−);
114−const inspectToolInputSchema = Schema.standardSchemaV1(
115− Schema.Struct({
116− sourceId: SourceIdSchema,
117− toolPath: Schema.String,
118− }),
119−);
120−const inspectDiscoverInputSchema = Schema.standardSchemaV1(
121− Schema.Struct({
122− sourceId: SourceIdSchema,
123− payload: SourceInspectionDiscoverPayloadSchema,
124− }),
125−);
126−const listPoliciesOutputSchema = Schema.standardSchemaV1(
127− Schema.Array(LocalScopePolicySchema),
128−);
129−const policyIdInputSchema = Schema.standardSchemaV1(
130− Schema.Struct({
131− policyId: Schema.String,
132− }),
133−);
134−const createPolicyInputSchema = Schema.standardSchemaV1(
135− CreatePolicyPayloadSchema,
136−);
137−const updatePolicyInputSchema = Schema.standardSchemaV1(
138− Schema.Struct({
139− policyId: Schema.String,
140− payload: UpdatePolicyPayloadSchema,
141− }),
142−);
143−const sourceOutputSchema = Schema.standardSchemaV1(SourceSchema);
144−const sourceInspectionOutputSchema = Schema.standardSchemaV1(
145− SourceInspectionSchema,
146−);
147−const sourceInspectionToolOutputSchema = Schema.standardSchemaV1(
148− SourceInspectionToolDetailSchema,
149−);
150−const sourceInspectionDiscoverOutputSchema = Schema.standardSchemaV1(
151− SourceInspectionDiscoverResultSchema,
152−);
153−const localScopePolicyOutputSchema = Schema.standardSchemaV1(
154− LocalScopePolicySchema,
155−);
156−
157−const makeRuntimeLayer = (input: {
158− executorStateStore: ExecutorStateStoreShape;
159− sourceStore: RuntimeSourceStore;
160− sourceCatalogSyncService: Effect.Effect.Success<
161− typeof RuntimeSourceCatalogSyncService
162− >;
163− scopeConfigStore: ScopeConfigStoreShape;
164− scopeStateStore: ScopeStateStoreShape;
165− sourceArtifactStore: SourceArtifactStoreShape;
166− instanceConfigResolver: WorkspaceInternalToolContext["instanceConfigResolver"];
167− storeSecretMaterial: WorkspaceInternalToolContext["storeSecretMaterial"];
168− deleteSecretMaterial: WorkspaceInternalToolContext["deleteSecretMaterial"];
169− updateSecretMaterial: WorkspaceInternalToolContext["updateSecretMaterial"];
170−}) =>
171− Layer.mergeAll(
172− Layer.succeed(ExecutorStateStore, input.executorStateStore),
173− Layer.succeed(RuntimeSourceStoreService, input.sourceStore),
174− Layer.succeed(
175− RuntimeSourceCatalogSyncService,
176− input.sourceCatalogSyncService,
177− ),
178− Layer.succeed(LocalInstanceConfigService, input.instanceConfigResolver),
179− Layer.succeed(SecretMaterialStorerService, input.storeSecretMaterial),
180− Layer.succeed(SecretMaterialDeleterService, input.deleteSecretMaterial),
181− Layer.succeed(SecretMaterialUpdaterService, input.updateSecretMaterial),
182− makeScopeStorageLayer({
183− scopeConfigStore: input.scopeConfigStore,
184− scopeStateStore: input.scopeStateStore,
185− sourceArtifactStore: input.sourceArtifactStore,
186− }),
187− );
188−
189−const runRuntimeEffect = <A, E, R>(input: {
190− effect: Effect.Effect<A, E, R>;
191− runtimeLayer: Layer.Layer<
192− | ExecutorStateStore
193− | LocalInstanceConfigService
194− | RuntimeSourceStoreService
195− | RuntimeSourceCatalogSyncService
196− | SecretMaterialStorerService
197− | SecretMaterialDeleterService
198− | SecretMaterialUpdaterService
199− | ScopeConfigStore
200− | ScopeStateStore
201− | SourceArtifactStore,
202− never,
203− never
204− >;
205− runtimeLocalScope: RuntimeLocalScopeState | null;
206−}) =>
207− Effect.runPromise(
208− provideOptionalRuntimeLocalScope(
209− input.effect.pipe(Effect.provide(input.runtimeLayer)),
210− input.runtimeLocalScope,
211− ) as Effect.Effect<A, E, never>,
212− );
213−
214−const runScopeStorageEffect = <A, E, R>(input: {
215− effect: Effect.Effect<A, E, R>;
216− scopeStorageLayer: Layer.Layer<
217− ScopeConfigStore | ScopeStateStore | SourceArtifactStore,
218− never,
219− never
220− >;
221− runtimeLocalScope: RuntimeLocalScopeState | null;
222−}) =>
223− Effect.runPromise(
224− provideOptionalRuntimeLocalScope(
225− input.effect.pipe(Effect.provide(input.scopeStorageLayer)),
226− input.runtimeLocalScope,
227− ) as Effect.Effect<A, E, never>,
228− );
229−
230−export const createWorkspaceExecutorAdminToolMap = (
231− input: WorkspaceInternalToolContext,
232−): ToolMap => {
233− const runtimeLayer = makeRuntimeLayer({
234− executorStateStore: input.executorStateStore,
235− sourceStore: input.sourceStore,
236− sourceCatalogSyncService: input.sourceCatalogSyncService,
237− scopeConfigStore: input.scopeConfigStore,
238− scopeStateStore: input.scopeStateStore,
239− sourceArtifactStore: input.sourceArtifactStore,
240− instanceConfigResolver: input.instanceConfigResolver,
241− storeSecretMaterial: input.storeSecretMaterial,
242− deleteSecretMaterial: input.deleteSecretMaterial,
243− updateSecretMaterial: input.updateSecretMaterial,
244− });
245− const scopeStorageLayer = makeScopeStorageLayer({
246− scopeConfigStore: input.scopeConfigStore,
247− scopeStateStore: input.scopeStateStore,
248− sourceArtifactStore: input.sourceArtifactStore,
249− });
250−
251− const metadata = {
252− sourceKey: "executor",
253− interaction: "auto" as const,
254− };
255−
256− return {
257− "executor.local.installation.get": toTool({
258− tool: {
259− description:
260− "Get the active local executor installation account and workspace ids.",
261− inputSchema: emptyInputSchema,
262− outputSchema: localInstallationOutputSchema,
263− execute: async () => ({
264− scopeId: input.scopeId,
265− actorScopeId: input.actorScopeId,
266− }),
267− },
268− metadata,
269− }),
270− "executor.local.config.get": toTool({
271− tool: {
272− description:
273− "Get local instance config such as supported secret providers.",
274− inputSchema: emptyInputSchema,
275− outputSchema: instanceConfigOutputSchema,
276− execute: () => Effect.runPromise(input.instanceConfigResolver()),
277− },
278− metadata,
279− }),
280− "executor.secrets.list": toTool({
281− tool: {
282− description:
283− "List locally stored secrets and the sources linked to them.",
284− inputSchema: emptyInputSchema,
285− outputSchema: secretListOutputSchema,
286− execute: () =>
287− runRuntimeEffect({
288− effect: listLocalSecrets(),
289− runtimeLayer,
290− runtimeLocalScope: input.runtimeLocalScope,
291− }),
292− },
293− metadata,
294− }),
295− "executor.secrets.create": toTool({
296− tool: {
297− description:
298− "Create a local secret without putting the raw value into source config.",
299− inputSchema: createSecretInputSchema,
300− outputSchema: Schema.standardSchemaV1(CreateSecretResultSchema),
301− execute: (payload: CreateSecretPayload) =>
302− runRuntimeEffect({
303− effect: createLocalSecret(payload),
304− runtimeLayer,
305− runtimeLocalScope: input.runtimeLocalScope,
306− }),
307− },
308− metadata,
309− }),
310− "executor.secrets.update": toTool({
311− tool: {
312− description:
313− "Update a stored secret name and optionally rotate its value.",
314− inputSchema: updateSecretInputSchema,
315− outputSchema: Schema.standardSchemaV1(UpdateSecretResultSchema),
316− execute: (payload: {
317− secretId: string;
318− payload: UpdateSecretPayload;
319− }) =>
320− runRuntimeEffect({
321− effect: updateLocalSecret(payload),
322− runtimeLayer,
323− runtimeLocalScope: input.runtimeLocalScope,
324− }),
325− },
326− metadata,
327− }),
328− "executor.secrets.remove": toTool({
329− tool: {
330− description: "Remove a stored local secret.",
331− inputSchema: removeSecretInputSchema,
332− outputSchema: Schema.standardSchemaV1(DeleteSecretResultSchema),
333− execute: ({ secretId }: { secretId: string }) =>
334− runRuntimeEffect({
335− effect: deleteLocalSecret(secretId),
336− runtimeLayer,
337− runtimeLocalScope: input.runtimeLocalScope,
338− }),
339− },
340− metadata,
341− }),
342− "executor.sources.list": toTool({
343− tool: {
344− description: "List sources connected in the current workspace.",
345− inputSchema: emptyInputSchema,
346− outputSchema: listSourcesOutputSchema,
347− execute: () =>
348− runRuntimeEffect({
349− effect: listSources({
350− scopeId: input.scopeId,
351− actorScopeId: input.actorScopeId as never,
352− }),
353− runtimeLayer,
354− runtimeLocalScope: input.runtimeLocalScope,
355− }),
356− },
357− metadata,
358− }),
359− "executor.sources.get": toTool({
360− tool: {
361− description: "Get one source by id.",
362− inputSchema: getSourceInputSchema,
363− outputSchema: sourceOutputSchema,
364− execute: ({ sourceId }: { sourceId: string }) =>
365− runRuntimeEffect({
366− effect: getSource({
367− scopeId: input.scopeId,
368− sourceId: sourceId as never,
369− actorScopeId: input.actorScopeId as never,
370− }),
371− runtimeLayer,
372− runtimeLocalScope: input.runtimeLocalScope,
373− }),
374− },
375− metadata,
376− }),
377− "executor.sources.remove": toTool({
378− tool: {
379− description: "Remove a source from the current workspace.",
380− inputSchema: getSourceInputSchema,
381− outputSchema: removeResultSchema,
382− execute: ({ sourceId }: { sourceId: string }) =>
383− runRuntimeEffect({
384− effect: removeSource({
385− scopeId: input.scopeId,
386− sourceId: sourceId as never,
387− }),
388− runtimeLayer,
389− runtimeLocalScope: input.runtimeLocalScope,
390− }),
391− },
392− metadata,
393− }),
394− "executor.sources.inspect.get": toTool({
395− tool: {
396− description: "Inspect the tool model for one connected source.",
397− inputSchema: getSourceInputSchema,
398− outputSchema: sourceInspectionOutputSchema,
399− execute: ({ sourceId }: { sourceId: string }) =>
400− runRuntimeEffect({
401− effect: getSourceInspection({
402− scopeId: input.scopeId,
403− sourceId: sourceId as never,
404− }),
405− runtimeLayer,
406− runtimeLocalScope: input.runtimeLocalScope,
407− }),
408− },
409− metadata,
410− }),
411− "executor.sources.inspect.tool": toTool({
412− tool: {
413− description: "Inspect one tool inside a connected source.",
414− inputSchema: inspectToolInputSchema,
415− outputSchema: sourceInspectionToolOutputSchema,
416− execute: ({
417− sourceId,
418− toolPath,
419− }: {
420− sourceId: string;
421− toolPath: string;
422− }) =>
423− runRuntimeEffect({
424− effect: getSourceInspectionToolDetail({
425− scopeId: input.scopeId,
426− sourceId: sourceId as never,
427− toolPath,
428− }),
429− runtimeLayer,
430− runtimeLocalScope: input.runtimeLocalScope,
431− }),
432− },
433− metadata,
434− }),
435− "executor.sources.inspect.discover": toTool({
436− tool: {
437− description: "Search within a single source's inspected tools.",
438− inputSchema: inspectDiscoverInputSchema,
439− outputSchema: sourceInspectionDiscoverOutputSchema,
440− execute: ({
441− sourceId,
442− payload,
443− }: {
444− sourceId: string;
445− payload: { query: string; limit?: number };
446− }) =>
447− runRuntimeEffect({
448− effect: discoverSourceInspectionTools({
449− scopeId: input.scopeId,
450− sourceId: sourceId as never,
451− payload: payload as never,
452− }),
453− runtimeLayer,
454− runtimeLocalScope: input.runtimeLocalScope,
455− }),
456− },
457− metadata,
458− }),
459− "executor.policies.list": toTool({
460− tool: {
461− description: "List local workspace policies.",
462− inputSchema: emptyInputSchema,
463− outputSchema: listPoliciesOutputSchema,
464− execute: () =>
465− runRuntimeEffect({
466− effect: listPolicies(input.scopeId),
467− runtimeLayer,
468− runtimeLocalScope: input.runtimeLocalScope,
469− }),
470− },
471− metadata,
472− }),
473− "executor.policies.create": toTool({
474− tool: {
475− description: "Create a local workspace policy.",
476− inputSchema: createPolicyInputSchema,
477− outputSchema: localScopePolicyOutputSchema,
478− execute: (payload: CreatePolicyPayload) =>
479− runRuntimeEffect({
480− effect: createPolicy({
481− scopeId: input.scopeId,
482− payload,
483− }),
484− runtimeLayer,
485− runtimeLocalScope: input.runtimeLocalScope,
486− }),
487− },
488− metadata,
489− }),
490− "executor.policies.get": toTool({
491− tool: {
492− description: "Get one local workspace policy by id.",
493− inputSchema: policyIdInputSchema,
494− outputSchema: localScopePolicyOutputSchema,
495− execute: ({ policyId }: { policyId: string }) =>
496− runRuntimeEffect({
497− effect: getPolicy({
498− scopeId: input.scopeId,
499− policyId: policyId as never,
500− }),
501− runtimeLayer,
502− runtimeLocalScope: input.runtimeLocalScope,
503− }),
504− },
505− metadata,
506− }),
507− "executor.policies.update": toTool({
508− tool: {
509− description: "Update a local workspace policy.",
510− inputSchema: updatePolicyInputSchema,
511− outputSchema: localScopePolicyOutputSchema,
512− execute: ({
513− policyId,
514− payload,
515− }: {
516− policyId: string;
517− payload: UpdatePolicyPayload;
518− }) =>
519− runRuntimeEffect({
520− effect: updatePolicy({
521− scopeId: input.scopeId,
522− policyId: policyId as never,
523− payload,
524− }),
525− runtimeLayer,
526− runtimeLocalScope: input.runtimeLocalScope,
527− }),
528− },
529− metadata,
530− }),
531− "executor.policies.remove": toTool({
532− tool: {
533− description: "Remove a local workspace policy.",
534− inputSchema: policyIdInputSchema,
535− outputSchema: removeResultSchema,
536− execute: ({ policyId }: { policyId: string }) =>
537− runRuntimeEffect({
538− effect: removePolicy({
539− scopeId: input.scopeId,
540− policyId: policyId as never,
541− }),
542− runtimeLayer,
543− runtimeLocalScope: input.runtimeLocalScope,
544− }),
545− },
546− metadata,
547− }),
548− };
549−};
550−
551−export const createExecutorAdminToolMap = (input: {
552− executor: Executor;
553−}): ToolMap => {
554− const metadata = {
555− sourceKey: "executor",
556− interaction: "auto" as const,
557− };
558−
559− return {
560− "executor.local.installation.get": toTool({
561− tool: {
562− description:
563− "Get the active local executor installation account and workspace ids.",
564− inputSchema: emptyInputSchema,
565− outputSchema: localInstallationOutputSchema,
566− execute: () => Promise.resolve(input.executor.installation),
567− },
568− metadata,
569− }),
570− "executor.local.config.get": toTool({
571− tool: {
572− description:
573− "Get local instance config such as supported secret providers.",
574− inputSchema: emptyInputSchema,
575− outputSchema: instanceConfigOutputSchema,
576− execute: () => input.executor.local.config(),
577− },
578− metadata,
579− }),
580− "executor.secrets.list": toTool({
581− tool: {
582− description:
583− "List locally stored secrets and the sources linked to them.",
584− inputSchema: emptyInputSchema,
585− outputSchema: secretListOutputSchema,
586− execute: () => input.executor.secrets.list(),
587− },
588− metadata,
589− }),
590− "executor.secrets.create": toTool({
591− tool: {
592− description:
593− "Create a local secret without putting the raw value into source config.",
594− inputSchema: createSecretInputSchema,
595− outputSchema: Schema.standardSchemaV1(CreateSecretResultSchema),
596− execute: (payload: CreateSecretPayload) =>
597− input.executor.secrets.create(payload),
598− },
599− metadata,
600− }),
601− "executor.secrets.update": toTool({
602− tool: {
603− description:
604− "Update a stored secret name and optionally rotate its value.",
605− inputSchema: updateSecretInputSchema,
606− outputSchema: Schema.standardSchemaV1(UpdateSecretResultSchema),
607− execute: (payload: {
608− secretId: string;
609− payload: UpdateSecretPayload;
610− }) => input.executor.secrets.update(payload),
611− },
612− metadata,
613− }),
614− "executor.secrets.remove": toTool({
615− tool: {
616− description: "Remove a stored local secret.",
617− inputSchema: removeSecretInputSchema,
618− outputSchema: Schema.standardSchemaV1(DeleteSecretResultSchema),
619− execute: ({ secretId }: { secretId: string }) =>
620− input.executor.secrets.remove(secretId),
621− },
622− metadata,
623− }),
624− "executor.sources.list": toTool({
625− tool: {
626− description: "List sources connected in the current workspace.",
627− inputSchema: emptyInputSchema,
628− outputSchema: listSourcesOutputSchema,
629− execute: () => input.executor.sources.list(),
630− },
631− metadata,
632− }),
633− "executor.sources.get": toTool({
634− tool: {
635− description: "Get one source by id.",
636− inputSchema: getSourceInputSchema,
637− outputSchema: sourceOutputSchema,
638− execute: ({ sourceId }: { sourceId: string }) =>
639− input.executor.sources.get(sourceId as never),
640− },
641− metadata,
642− }),
643− "executor.sources.remove": toTool({
644− tool: {
645− description: "Remove a source from the current workspace.",
646− inputSchema: getSourceInputSchema,
647− outputSchema: removeResultSchema,
648− execute: async ({ sourceId }: { sourceId: string }) => ({
649− removed: await input.executor.sources.remove(sourceId as never),
650− }),
651− },
652− metadata,
653− }),
654− "executor.sources.inspect.get": toTool({
655− tool: {
656− description: "Inspect the tool model for one connected source.",
657− inputSchema: getSourceInputSchema,
658− outputSchema: sourceInspectionOutputSchema,
659− execute: ({ sourceId }: { sourceId: string }) =>
660− input.executor.sources.inspection.get(sourceId as never),
661− },
662− metadata,
663− }),
664− "executor.sources.inspect.tool": toTool({
665− tool: {
666− description: "Inspect one tool inside a connected source.",
667− inputSchema: inspectToolInputSchema,
668− outputSchema: sourceInspectionToolOutputSchema,
669− execute: ({
670− sourceId,
671− toolPath,
672− }: {
673− sourceId: string;
674− toolPath: string;
675− }) =>
676− input.executor.sources.inspection.tool({
677− sourceId: sourceId as never,
678− toolPath,
679− }),
680− },
681− metadata,
682− }),
683− "executor.sources.inspect.discover": toTool({
684− tool: {
685− description: "Search within a single source's inspected tools.",
686− inputSchema: inspectDiscoverInputSchema,
687− outputSchema: sourceInspectionDiscoverOutputSchema,
688− execute: ({
689− sourceId,
690− payload,
691− }: {
692− sourceId: string;
693− payload: { query: string; limit?: number };
694− }) =>
695− input.executor.sources.inspection.discover({
696− sourceId: sourceId as never,
697− payload: payload as never,
698− }),
699− },
700− metadata,
701− }),
702− "executor.policies.list": toTool({
703− tool: {
704− description: "List local workspace policies.",
705− inputSchema: emptyInputSchema,
706− outputSchema: listPoliciesOutputSchema,
707− execute: () => input.executor.policies.list(),
708− },
709− metadata,
710− }),
711− "executor.policies.create": toTool({
712− tool: {
713− description: "Create a local workspace policy.",
714− inputSchema: createPolicyInputSchema,
715− outputSchema: localScopePolicyOutputSchema,
716− execute: (payload: CreatePolicyPayload) =>
717− input.executor.policies.create(payload),
718− },
719− metadata,
720− }),
721− "executor.policies.get": toTool({
722− tool: {
723− description: "Get one local workspace policy by id.",
724− inputSchema: policyIdInputSchema,
725− outputSchema: localScopePolicyOutputSchema,
726− execute: ({ policyId }: { policyId: string }) =>
727− input.executor.policies.get(policyId),
728− },
729− metadata,
730− }),
731− "executor.policies.update": toTool({
732− tool: {
733− description: "Update a local workspace policy.",
734− inputSchema: updatePolicyInputSchema,
735− outputSchema: localScopePolicyOutputSchema,
736− execute: ({
737− policyId,
738− payload,
739− }: {
740− policyId: string;
741− payload: UpdatePolicyPayload;
742− }) => input.executor.policies.update(policyId, payload),
743− },
744− metadata,
745− }),
746− "executor.policies.remove": toTool({
747− tool: {
748− description: "Remove a local workspace policy.",
749− inputSchema: policyIdInputSchema,
750− outputSchema: removeResultSchema,
751− execute: async ({ policyId }: { policyId: string }) => ({
752− removed: await input.executor.policies.remove(policyId),
753− }),
754− },
755− metadata,
756− }),
757− };
758−};
packages/platform/sdk-file/src/index.ts+0−3
@@ -313,7 +313,6 @@ export const createLocalExecutorRuntime = ( · 312 unmodified lines
313313 ): Effect.Effect<ExecutorRuntime, Error> =>
314314 createLocalExecutorBackend(options).createRuntime({
315315 executionResolver: options.executionResolver,
316− createInternalToolMap: options.createInternalToolMap,
317316 resolveSecretMaterial: options.resolveSecretMaterial,
318317 getLocalServerBaseUrl: options.getLocalServerBaseUrl,
319318 });
@@ -336,7 +335,6 @@ export const createLocalExecutorEffect = < · 16 unmodified lines
336335 backend: createLocalExecutorBackend(options),
337336 plugins: options.plugins,
338337 executionResolver: options.executionResolver,
339− createInternalToolMap: options.createInternalToolMap,
340338 resolveSecretMaterial: options.resolveSecretMaterial,
341339 getLocalServerBaseUrl: options.getLocalServerBaseUrl,
342340 } satisfies CreateExecutorEffectOptions & { plugins?: TPlugins });
@@ -350,7 +348,6 @@ export const createLocalExecutor = < · 7 unmodified lines
350348 backend: createLocalExecutorBackend(options),
351349 plugins: options.plugins,
352350 executionResolver: options.executionResolver,
353− createInternalToolMap: options.createInternalToolMap,
354351 resolveSecretMaterial: options.resolveSecretMaterial,
355352 getLocalServerBaseUrl: options.getLocalServerBaseUrl,
356353 });
packages/platform/sdk/src/executor-effect.ts+0−2
@@ -58,7 +58,6 @@ import { · 57 unmodified lines
5858 import type { ExecutorBackend } from "./backend";
5959 import {
6060 provideExecutorRuntime,
61− type CreateScopeInternalToolMap,
6261 type ExecutorRuntime,
6362 type ExecutorRuntimeOptions,
6463 type ResolveExecutionEnvironment,
@@ -271,7 +270,6 @@ export const createExecutorEffect = < · 206 unmodified lines
271270 return Effect.map(
272271 options.backend.createRuntime({
273272 executionResolver: options.executionResolver,
274− createInternalToolMap: options.createInternalToolMap,
275273 resolveSecretMaterial: options.resolveSecretMaterial,
276274 getLocalServerBaseUrl: options.getLocalServerBaseUrl,
277275 }),
packages/platform/sdk/src/runtime/execution/scope/environment.ts+0−29
@@ -26,12 +26,6 @@ import { · 25 unmodified lines
2626 import {
2727 getRuntimeLocalScopeOption,
2828 } from "../../scope/runtime-context";
29−import {
30− LocalInstanceConfigService,
31− SecretMaterialDeleterService,
32− SecretMaterialStorerService,
33− SecretMaterialUpdaterService,
34−} from "../../scope/secret-material-providers";
3529 import {
3630 LocalToolRuntimeLoaderService,
3731 type LocalToolRuntimeLoaderShape,
@@ -53,9 +47,6 @@ import { · 15 unmodified lines
5347 import {
5448 RuntimeSourceStoreService,
5549 } from "../../sources/source-store";
56−import type {
57− CreateScopeInternalToolMap,
58−} from "./tool-invoker";
5950 export {
6051 createCodeExecutorForRuntime,
6152 resolveConfiguredExecutionRuntime,
@@ -80,14 +71,9 @@ export const createScopeExecutionEnvironmentResolver = · 18 unmodified lines
8071 >;
8172 localToolRuntimeLoader: LocalToolRuntimeLoaderShape;
8273 installationStore: InstallationStoreShape;
83− instanceConfigResolver: Effect.Effect.Success<typeof LocalInstanceConfigService>;
84− storeSecretMaterial: Effect.Effect.Success<typeof SecretMaterialStorerService>;
85− deleteSecretMaterial: Effect.Effect.Success<typeof SecretMaterialDeleterService>;
86− updateSecretMaterial: Effect.Effect.Success<typeof SecretMaterialUpdaterService>;
8774 scopeConfigStore: ScopeConfigStoreShape;
8875 scopeStateStore: ScopeStateStoreShape;
8976 sourceArtifactStore: SourceArtifactStoreShape;
90− createInternalToolMap?: CreateScopeInternalToolMap;
9177 }): ResolveExecutionEnvironment =>
9278 ({ scopeId, actorScopeId, onElicitation }) =>
9379 Effect.gen(function* () {
@@ -108,16 +94,11 @@ export const createScopeExecutionEnvironmentResolver = · 14 unmodified lines
10894 sourceCatalogSyncService: input.sourceCatalogSyncService,
10995 sourceCatalogStore: input.sourceCatalogStore,
11096 installationStore: input.installationStore,
111− instanceConfigResolver: input.instanceConfigResolver,
112− storeSecretMaterial: input.storeSecretMaterial,
113− deleteSecretMaterial: input.deleteSecretMaterial,
114− updateSecretMaterial: input.updateSecretMaterial,
11597 scopeConfigStore: input.scopeConfigStore,
11698 scopeStateStore: input.scopeStateStore,
11799 sourceArtifactStore: input.sourceArtifactStore,
118100 runtimeLocalScope,
119101 localToolRuntime,
120− createInternalToolMap: input.createInternalToolMap,
121102 onElicitation,
122103 });
123104
@@ -142,7 +123,6 @@ export class RuntimeExecutionResolverService extends Context.Tag( · 18 unmodified lines
142123 export const RuntimeExecutionResolverLive = (
143124 input: {
144125 executionResolver?: ResolveExecutionEnvironment;
145− createInternalToolMap?: CreateScopeInternalToolMap;
146126 } = {},
147127 ) =>
148128 input.executionResolver
@@ -157,10 +137,6 @@ export const RuntimeExecutionResolverLive = ( · 8 unmodified lines
157137 const sourceCatalogStore = yield* RuntimeSourceCatalogStoreService;
158138 const localToolRuntimeLoader = yield* LocalToolRuntimeLoaderService;
159139 const installationStore = yield* InstallationStore;
160− const instanceConfigResolver = yield* LocalInstanceConfigService;
161− const storeSecretMaterial = yield* SecretMaterialStorerService;
162− const deleteSecretMaterial = yield* SecretMaterialDeleterService;
163− const updateSecretMaterial = yield* SecretMaterialUpdaterService;
164140 const scopeConfigStore = yield* ScopeConfigStore;
165141 const scopeStateStore = yield* ScopeStateStore;
166142 const sourceArtifactStore = yield* SourceArtifactStore;
@@ -172,14 +148,9 @@ export const RuntimeExecutionResolverLive = ( · 5 unmodified lines
172148 sourceCatalogStore,
173149 localToolRuntimeLoader,
174150 installationStore,
175− instanceConfigResolver,
176− storeSecretMaterial,
177− deleteSecretMaterial,
178− updateSecretMaterial,
179151 scopeConfigStore,
180152 scopeStateStore,
181153 sourceArtifactStore,
182− createInternalToolMap: input.createInternalToolMap,
183154 });
184155 }),
185156 );
packages/platform/sdk/src/runtime/execution/scope/tool-invoker.ts+0−52
@@ -30,12 +30,6 @@ import { · 29 unmodified lines
3030 type ScopeConfigStoreShape,
3131 type ScopeStateStoreShape,
3232 } from "../../scope/storage";
33−import type {
34− DeleteSecretMaterial,
35− ResolveInstanceConfig,
36− StoreSecretMaterial,
37− UpdateSecretMaterial,
38−} from "../../scope/secret-material-providers";
3933 import type {
4034 ExecutorStateStoreShape,
4135 } from "../../executor-state-store";
@@ -66,29 +60,6 @@ import { · 24 unmodified lines
6660 runtimeEffectError,
6761 } from "../../effect-errors";
6862
69−export type ScopeInternalToolContext = {
70− scopeId: Source["scopeId"];
71− actorScopeId: ScopeId;
72− executorStateStore: ExecutorStateStoreShape;
73− sourceStore: RuntimeSourceStore;
74− sourceCatalogSyncService: Effect.Effect.Success<
75− typeof RuntimeSourceCatalogSyncService
76− >;
77− installationStore: InstallationStoreShape;
78− instanceConfigResolver: ResolveInstanceConfig;
79− storeSecretMaterial: StoreSecretMaterial;
80− deleteSecretMaterial: DeleteSecretMaterial;
81− updateSecretMaterial: UpdateSecretMaterial;
82− scopeConfigStore: ScopeConfigStoreShape;
83− scopeStateStore: ScopeStateStoreShape;
84− sourceArtifactStore: SourceArtifactStoreShape;
85− runtimeLocalScope: RuntimeLocalScopeState | null;
86−};
87−
88−export type CreateScopeInternalToolMap = (
89− input: ScopeInternalToolContext,
90−) => ToolMap;
91−
9263 export const createScopeToolInvoker = (input: {
9364 scopeId: Source["scopeId"];
9465 actorScopeId: ScopeId;
@@ -101,16 +72,11 @@ export const createScopeToolInvoker = (input: { · 6 unmodified lines
10172 typeof RuntimeSourceCatalogStoreService
10273 >;
10374 installationStore: InstallationStoreShape;
104− instanceConfigResolver: ResolveInstanceConfig;
105− storeSecretMaterial: StoreSecretMaterial;
106− deleteSecretMaterial: DeleteSecretMaterial;
107− updateSecretMaterial: UpdateSecretMaterial;
10875 scopeConfigStore: ScopeConfigStoreShape;
10976 scopeStateStore: ScopeStateStoreShape;
11077 sourceArtifactStore: SourceArtifactStoreShape;
11178 runtimeLocalScope: RuntimeLocalScopeState | null;
11279 localToolRuntime: LocalToolRuntime;
113− createInternalToolMap?: CreateScopeInternalToolMap;
11480 onElicitation?: Parameters<
11581 typeof makeToolInvokerFromTools
11682 >[0]["onElicitation"];
@@ -138,23 +104,6 @@ export const createScopeToolInvoker = (input: { · 21 unmodified lines
138104 sourceArtifactStore: input.sourceArtifactStore,
139105 runtimeLocalScope: input.runtimeLocalScope,
140106 });
141− const internalTools =
142− input.createInternalToolMap?.({
143− scopeId: input.scopeId,
144− actorScopeId: input.actorScopeId,
145− executorStateStore: input.executorStateStore,
146− sourceStore: input.sourceStore,
147− sourceCatalogSyncService: input.sourceCatalogSyncService,
148− installationStore: input.installationStore,
149− instanceConfigResolver: input.instanceConfigResolver,
150− storeSecretMaterial: input.storeSecretMaterial,
151− deleteSecretMaterial: input.deleteSecretMaterial,
152− updateSecretMaterial: input.updateSecretMaterial,
153− scopeConfigStore: input.scopeConfigStore,
154− scopeStateStore: input.scopeStateStore,
155− sourceArtifactStore: input.sourceArtifactStore,
156− runtimeLocalScope: input.runtimeLocalScope,
157− }) ?? {};
158107 const sourceCatalog = createScopeSourceCatalog({
159108 scopeId: input.scopeId,
160109 actorScopeId: input.actorScopeId,
@@ -177,7 +126,6 @@ export const createScopeToolInvoker = (input: { · 16 unmodified lines
177126 const authoredTools = mergeToolMaps([
178127 systemTools,
179128 executorTools,
180− internalTools,
181129 input.localToolRuntime.tools,
182130 ]);
183131 const authoredCatalog = createToolCatalogFromTools({
packages/platform/sdk/src/runtime/index.ts+0−10
@@ -31,10 +31,6 @@ import { · 30 unmodified lines
3131 import {
3232 RuntimeExecutionResolverLive,
3333 } from "./execution/scope/environment";
34−import type {
35− CreateScopeInternalToolMap,
36− ScopeInternalToolContext,
37−} from "./execution/scope/tool-invoker";
3834 import type {
3935 LoadedLocalExecutorConfig,
4036 } from "./scope-config";
@@ -104,10 +100,6 @@ export * from "./executor-state-store"; · 63 unmodified lines
104100 export * from "./execution/scope/environment";
105101 export * from "../sources/inspection";
106102 export * from "./execution/service";
107−export type {
108− CreateScopeInternalToolMap,
109− ScopeInternalToolContext,
110−} from "./execution/scope/tool-invoker";
111103 export {
112104 LocalInstanceConfigService,
113105 SecretMaterialDeleterService,
@@ -133,7 +125,6 @@ export { · 19 unmodified lines
133125
134126 export type ExecutorRuntimeOptions = {
135127 executionResolver?: ResolveExecutionEnvironment;
136− createInternalToolMap?: CreateScopeInternalToolMap;
137128 resolveSecretMaterial?: ResolveSecretMaterial;
138129 getLocalServerBaseUrl?: () => string | undefined;
139130 };
@@ -362,7 +353,6 @@ export const createExecutorRuntimeLayer = ( · 222 unmodified lines
362353
363354 const executionResolverLayer = RuntimeExecutionResolverLive({
364355 executionResolver: input.executionResolver,
365− createInternalToolMap: input.createInternalToolMap,
366356 }).pipe(
367357 Layer.provide(
368358 Layer.mergeAll(
packages/platform/sdk/src/runtime/sources/source-plugins/index.ts+5−14
@@ -3,26 +3,17 @@ import { · 2 unmodified lines
33 type ExecutorSdkPlugin,
44 } from "../../../plugins";
55
6−import {
7− InternalSourceSdkPlugin,
8−} from "./internal";
9−
10−let configuredExternalSourcePlugins: readonly ExecutorSdkPlugin[] = [];
11−let registry = registerExecutorSdkPlugins([
12− InternalSourceSdkPlugin,
13−]);
6+let configuredSourcePlugins: readonly ExecutorSdkPlugin[] = [];
7+let registry = registerExecutorSdkPlugins(configuredSourcePlugins);
148
159 const refreshRegistry = () => {
16− registry = registerExecutorSdkPlugins([
17− ...configuredExternalSourcePlugins,
18− InternalSourceSdkPlugin,
19− ]);
10+ registry = registerExecutorSdkPlugins(configuredSourcePlugins);
2011 };
2112
2213 export const configureExecutorSourcePlugins = (
2314 plugins: readonly ExecutorSdkPlugin[],
2415 ): void => {
25− configuredExternalSourcePlugins = plugins;
16+ configuredSourcePlugins = plugins;
2617 refreshRegistry();
2718 };
2819
@@ -39,4 +30,4 @@ export const isInternalSourcePluginKind = (kind: string) => · 10 unmodified lines
3930 registry.isInternalSourcePluginKind(kind);
4031
4132 export const hasRegisteredExternalSourcePlugins = () =>
42− configuredExternalSourcePlugins.length > 0;
33+ configuredSourcePlugins.length > 0;
packages/platform/server/package.json+1−1
@@ -15,6 +15,7 @@ · 14 unmodified lines
1515 "@effect/platform": "catalog:",
1616 "@effect/platform-node": "catalog:",
1717 "@executor/executor-mcp": "workspace:*",
18+ "@executor/plugin-internal-sdk": "workspace:*",
1819 "@executor/plugin-google-discovery-http": "workspace:*",
1920 "@executor/plugin-google-discovery-shared": "workspace:*",
2021 "@executor/plugin-google-discovery-sdk": "workspace:*",
@@ -28,7 +29,6 @@ · 7 unmodified lines
2829 "@executor/plugin-openapi-shared": "workspace:*",
2930 "@executor/plugin-openapi-sdk": "workspace:*",
3031 "@executor/platform-api": "workspace:*",
31− "@executor/platform-internal": "workspace:*",
3232 "@executor/platform-sdk": "workspace:*",
3333 "@executor/platform-sdk-file": "workspace:*",
3434 "@opentelemetry/api": "^1.9.0",
packages/platform/server/src/index.ts+2−2
@@ -8,6 +8,7 @@ import { dirname, extname, resolve } from "node:path"; · 7 unmodified lines
88 import { Readable } from "node:stream";
99 import { FileSystem, HttpApiBuilder, HttpServer } from "@effect/platform";
1010 import { NodeFileSystem } from "@effect/platform-node";
11+import { internalSdkPlugin } from "@executor/plugin-internal-sdk";
1112 import { googleDiscoveryHttpPlugin } from "@executor/plugin-google-discovery-http";
1213 import { googleDiscoverySdkPlugin } from "@executor/plugin-google-discovery-sdk";
1314 import { graphqlHttpPlugin } from "@executor/plugin-graphql-http";
@@ -22,7 +23,6 @@ import { · 8 unmodified lines
2223 createExecutorApiLayer,
2324 } from "@executor/platform-api/http";
2425 import { createExecutorMcpRequestHandler } from "@executor/executor-mcp";
25−import { createWorkspaceExecutorAdminToolMap } from "@executor/platform-internal";
2626 import {
2727 createExecutorEffect,
2828 type ExecutorEffect as Executor,
@@ -155,6 +155,7 @@ const createExecutorRuntime = ( · 126 unmodified lines
155155 localDataDir,
156156 }),
157157 plugins: [
158+ internalSdkPlugin(),
158159 graphqlSdkPlugin({
159160 storage: createFileGraphqlSourceStorage({
160161 rootDir: resolve(localDataDir, "plugins", "graphql", "sources"),
@@ -183,7 +184,6 @@ const createExecutorRuntime = ( · 22 unmodified lines
183184 }),
184185 ] as const,
185186 executionResolver: options.executionResolver,
186− createInternalToolMap: createWorkspaceExecutorAdminToolMap,
187187 resolveSecretMaterial: options.resolveSecretMaterial,
188188 getLocalServerBaseUrl,
189189 }).pipe(
plugins/internal/sdk/index.tsrenamed from packages/platform/sdk/src/runtime/sources/source-plugins/internal.ts+4−9
@@ -4,11 +4,9 @@ import { · 3 unmodified lines
44 createCatalogImportMetadata,
55 createSourceCatalogSyncResult,
66 } from "@executor/source-core";
7−import type { ExecutorSdkPlugin } from "../../../plugins";
7+import type { ExecutorSdkPlugin } from "@executor/platform-sdk/plugins";
88
9−import { runtimeEffectError } from "../../effect-errors";
10−
11−export const InternalSourceSdkPlugin = {
9+export const internalSdkPlugin = (): ExecutorSdkPlugin<"internal"> => ({
1210 key: "internal",
1311 sources: [
1412 {
@@ -38,11 +36,8 @@ export const InternalSourceSdkPlugin = { · 23 unmodified lines
3836 ),
3937 invoke: () =>
4038 Effect.fail(
41− runtimeEffectError(
42− "sources/source-plugins/internal",
43− "Internal sources do not support persisted plugin invocation",
44− ),
39+ new Error("Internal sources do not support persisted plugin invocation"),
4540 ),
4641 },
4742 ],
48−} satisfies ExecutorSdkPlugin<"internal">;
43+});
plugins/internal/sdk/package.jsonrenamed from packages/platform/internal/package.json+7−5
@@ -1,22 +1,24 @@
11 {
2− "name": "@executor/platform-internal",
2+ "name": "@executor/plugin-internal-sdk",
33 "private": true,
44 "type": "module",
55 "exports": {
6− ".": "./src/index.ts"
6+ ".": "./index.ts"
77 },
8+ "files": [
9+ "*.ts"
10+ ],
811 "scripts": {
912 "typecheck": "bunx tsc --noEmit -p tsconfig.json"
1013 },
1114 "dependencies": {
12− "@executor/codemode-core": "workspace:*",
1315 "@executor/platform-sdk": "workspace:*",
16+ "@executor/source-core": "workspace:*",
1417 "effect": "catalog:"
1518 },
1619 "devDependencies": {
1720 "@types/node": "catalog:",
18− "bun-types": "catalog:",
19− "typescript": "^5.9.3"
21+ "bun-types": "catalog:"
2022 },
2123 "version": "0.0.0"
2224 }
plugins/internal/sdk/tsconfig.jsonrenamed from packages/platform/internal/tsconfig.json+2−2
@@ -6,8 +6,8 @@ · 5 unmodified lines
66 "strict": true,
77 "skipLibCheck": true,
88 "noEmit": true,
9− "lib": ["ES2022"],
9+ "lib": ["ES2022", "DOM"],
1010 "types": ["bun-types", "node"]
1111 },
12− "include": ["src/**/*.ts"]
12+ "include": ["*.ts"]
1313 }