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

Function loadTarget

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

Source from the content-addressed store, hash-verified

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