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

Function provision

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

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

Callers 4

makeSearchExecutorFunction · 0.85
makeElicitingExecutorFunction · 0.85
attachOrProvisionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected