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

Function provision

packages/core/execution/src/tool-invoker.test.ts:452–477  ·  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

450// Provision: register each plugin's integration and create one org `main`
451// connection so per-connection tools exist and are addressable.
452const provision = (
453 executor: {
454 readonly connections: {
455 readonly create: (input: {
456 readonly owner: "org";
457 readonly name: typeof CONN;
458 readonly integration: ReturnType<typeof IntegrationSlug.make>;
459 readonly template: typeof TEMPLATE;
460 readonly value: string;
461 }) => Effect.Effect<unknown, unknown>;
462 };
463 } & Record<string, { readonly seed: () => Effect.Effect<unknown, unknown> }>,
464 specs: readonly { readonly pluginId: string; readonly integration: string }[],
465): Effect.Effect<void, unknown> =>
466 Effect.gen(function* () {
467 for (const spec of specs) {
468 yield* executor[spec.pluginId]!.seed();
469 yield* executor.connections.create({
470 owner: "org",
471 name: CONN,
472 integration: IntegrationSlug.make(spec.integration),
473 template: TEMPLATE,
474 value: "token",
475 });
476 }
477 });
478
479const makeExecutorWith = <const TPlugins extends readonly AnyPlugin[]>(plugins: TPlugins) =>
480 createExecutor(makeTestConfig({ plugins }));

Callers 4

makeSearchExecutorFunction · 0.85
makeElicitingExecutorFunction · 0.85
attachOrProvisionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected