MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / provision

Function provision

packages/core/execution/src/tool-invoker.test.ts:434–459  ·  view source on GitHub ↗
(
  executor: {
    readonly connections: {
      readonly create: (input: {
        readonly owner: "org";
        readonly name: typeof CONN;
        readonly integration: ReturnType<typeof IntegrationSlug.make>;
        readonly template: typeof TEMPLATE;
        readonly value: string;
      }) => Effect.Effect<unknown, unknown>;
    };
  } & Record<string, { readonly seed: () => Effect.Effect<unknown, unknown> }>,
  specs: readonly { readonly pluginId: string; readonly integration: string }[],
)

Source from the content-addressed store, hash-verified

432// Provision: register each plugin's integration and create one org `main`
433// connection so per-connection tools exist and are addressable.
434const provision = (
435 executor: {
436 readonly connections: {
437 readonly create: (input: {
438 readonly owner: "org";
439 readonly name: typeof CONN;
440 readonly integration: ReturnType<typeof IntegrationSlug.make>;
441 readonly template: typeof TEMPLATE;
442 readonly value: string;
443 }) => Effect.Effect<unknown, unknown>;
444 };
445 } & Record<string, { readonly seed: () => Effect.Effect<unknown, unknown> }>,
446 specs: readonly { readonly pluginId: string; readonly integration: string }[],
447): Effect.Effect<void, unknown> =>
448 Effect.gen(function* () {
449 for (const spec of specs) {
450 yield* executor[spec.pluginId]!.seed();
451 yield* executor.connections.create({
452 owner: "org",
453 name: CONN,
454 integration: IntegrationSlug.make(spec.integration),
455 template: TEMPLATE,
456 value: "token",
457 });
458 }
459 });
460
461const makeExecutorWith = <const TPlugins extends readonly AnyPlugin[]>(plugins: TPlugins) =>
462 createExecutor(makeTestConfig({ plugins }));

Callers 4

makeSearchExecutorFunction · 0.85
makeElicitingExecutorFunction · 0.85
attachOrProvisionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected