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

Function provision

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

370// Provision: register each plugin's integration and create one org `main`
371// connection so per-connection tools exist and are addressable.
372const provision = (
373 executor: {
374 readonly connections: {
375 readonly create: (input: {
376 readonly owner: "org";
377 readonly name: typeof CONN;
378 readonly integration: ReturnType<typeof IntegrationSlug.make>;
379 readonly template: typeof TEMPLATE;
380 readonly value: string;
381 }) => Effect.Effect<unknown, unknown>;
382 };
383 } & Record<string, { readonly seed: () => Effect.Effect<unknown, unknown> }>,
384 specs: readonly { readonly pluginId: string; readonly integration: string }[],
385): Effect.Effect<void, unknown> =>
386 Effect.gen(function* () {
387 for (const spec of specs) {
388 yield* executor[spec.pluginId]!.seed();
389 yield* executor.connections.create({
390 owner: "org",
391 name: CONN,
392 integration: IntegrationSlug.make(spec.integration),
393 template: TEMPLATE,
394 value: "token",
395 });
396 }
397 });
398
399const makeExecutorWith = <const TPlugins extends readonly AnyPlugin[]>(plugins: TPlugins) =>
400 createExecutor(makeTestConfig({ plugins }));

Callers 4

makeSearchExecutorFunction · 0.85
makeElicitingExecutorFunction · 0.85
attachOrProvisionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected