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

Function loadTarget

e2e/scripts/cli.ts:358–366  ·  view source on GitHub ↗
(targetName: string)

Source from the content-addressed store, hash-verified

356
357/** Point the targets module at the running instance, then import it. */
358const loadTarget = async (targetName: string) => {
359 const state = readState(targetName);
360 if (!state || state.status !== "ready" || !alive(state.runnerPid)) {
361 throw new Error(`${targetName} is not up — run: bun scripts/cli.ts up ${targetName}`);
362 }
363 for (const [key, value] of Object.entries(state.env ?? {})) process.env[key] = value;
364 const { resolveTarget } = await import("../targets/registry");
365 return { target: resolveTarget(), state };
366};
367
368const runEffect = async <A>(effect: unknown): Promise<A> => {
369 const { Effect } = await import("effect");

Callers 3

identityFunction · 0.85
apiCallFunction · 0.85
mcpCallFunction · 0.85

Calls 3

readStateFunction · 0.85
aliveFunction · 0.85
resolveTargetFunction · 0.85

Tested by

no test coverage detected