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

Function cliTarget

e2e/targets/cli.ts:23–59  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21};
22
23export const cliTarget = (): Target => {
24 const baseUrl = env("E2E_CLI_BASE_URL");
25 const os = (process.env.E2E_VM_OS ?? "macos") as VmOs;
26
27 return {
28 name: process.env.E2E_TARGET ?? "cli",
29 baseUrl,
30 mcpUrl: `${baseUrl}/mcp`,
31 capabilities: new Set<Capability>(["api"]),
32 // The supervised daemon is bearer-gated (auth.json); globalsetup reads the
33 // token from the guest and publishes it. A wrong/absent token still gets a
34 // clean 401, which the api surface treats as "up".
35 newIdentity: () =>
36 Effect.sync(
37 (): Identity => ({
38 label: "cli-daemon",
39 headers: { Authorization: `Bearer ${env("E2E_CLI_AUTH_TOKEN")}` },
40 }),
41 ),
42 // A genuine machine reboot, not a service kick: reboot the guest OS, GATE on
43 // the daemon actually going down (an orderly shutdown serves for several
44 // seconds + the reconnecting tunnel re-forwards, so "reachable" right after
45 // the reboot command would false-pass), then wait for the supervised daemon
46 // to auto-start and serve again — proving the boot-time auto-start path.
47 restart: () =>
48 Effect.promise(async () => {
49 const host = env("E2E_CLI_VM_HOST");
50 if (os === "windows") {
51 await ec2RebootGuest(host, env("E2E_CLI_SSH_KEY"), os);
52 } else {
53 await sshRebootGuest(host);
54 }
55 await waitForHttpDown(`${baseUrl}/`, { timeoutMs: 120_000 });
56 await waitForHttp(`${baseUrl}/`, { timeoutMs: 240_000 });
57 }),
58 };
59};

Callers

nothing calls this directly

Calls 6

ec2RebootGuestFunction · 0.90
sshRebootGuestFunction · 0.90
waitForHttpDownFunction · 0.90
waitForHttpFunction · 0.90
envFunction · 0.85
syncMethod · 0.65

Tested by

no test coverage detected