@scp-dev/cli 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/{chunk-XQHPDNVG.js → chunk-277BAY7J.js} +23 -3
  2. package/dist/{chunk-AAFHLHXG.js → chunk-3SOIVANO.js} +49 -4
  3. package/dist/{chunk-2342GTME.js → chunk-LRQP25RI.js} +2 -2
  4. package/dist/{chunk-H2XQXMZU.js → chunk-LUDLDWH2.js} +1 -1
  5. package/dist/{codex-OSGHQMK6.js → chunk-LWMTZH36.js} +6 -10
  6. package/dist/{chunk-7RA7E5WR.js → chunk-RZUQ422C.js} +14 -6
  7. package/dist/{chunk-UKQBH4AQ.js → chunk-SNW53KT3.js} +3 -3
  8. package/dist/claude-WEHOLJ26.js +290 -0
  9. package/dist/cli.js +1 -1
  10. package/dist/codex-54UWPDY5.js +26 -0
  11. package/dist/{hooks-BZANUJPY.js → hooks-ULKKUHPF.js} +6 -2
  12. package/dist/{install-25J5QB63.js → install-5A3ETGF6.js} +3 -3
  13. package/dist/{join-EOLHE3LJ.js → join-FFT7RQRW.js} +1 -1
  14. package/dist/{login-6MVD3VLC.js → login-DCNCC3RS.js} +2 -2
  15. package/dist/{main-F2NFQ2KC.js → main-CDLW3MV5.js} +45 -26
  16. package/dist/{mcp-BH526TOG.js → mcp-7GB35CTY.js} +7 -6
  17. package/dist/{mesh-OZILTV5P.js → mesh-TDOVAHZ3.js} +1 -1
  18. package/dist/muse-S7FPY4CL.js +429 -0
  19. package/dist/{opencode-XV33XTL5.js → opencode-WFMQYCI2.js} +4 -4
  20. package/dist/{peek-LFQR6TCS.js → peek-X4QQFMQJ.js} +1 -1
  21. package/dist/{pi-N3DX37PD.js → pi-5IPU6GA4.js} +1 -1
  22. package/dist/{relay-SF3UWIPM.js → relay-7WBNUACH.js} +1 -1
  23. package/dist/{remote-UQJ5YYCC.js → remote-YO5B2HQI.js} +2 -2
  24. package/dist/resume-3ZRDXSTX.js +308 -0
  25. package/dist/{setup-UJCIMYU4.js → setup-U7CWN5QP.js} +4 -4
  26. package/dist/{spawn-JYD7NCQT.js → spawn-VZK5MD3R.js} +13 -5
  27. package/dist/{up-3YJU7YX6.js → up-S4KJBWI6.js} +8 -6
  28. package/package.json +6 -6
  29. package/dist/claude-RNH2E4GU.js +0 -130
@@ -1,4 +1,5 @@
1
1
  import {
2
+ AGY_CONVERSATION,
2
3
  AGY_HOOK_SET,
3
4
  AGY_UNVERIFIED,
4
5
  BLOCK_STOP,
@@ -30,6 +31,7 @@ import {
30
31
  promptTitle,
31
32
  pushText,
32
33
  pushWait,
34
+ recordAgyConversation,
33
35
  relayHookCommand,
34
36
  runHook,
35
37
  steerPrompt,
@@ -40,13 +42,14 @@ import {
40
42
  tldrEvery,
41
43
  transcriptTitle,
42
44
  unreadPointer
43
- } from "./chunk-XQHPDNVG.js";
45
+ } from "./chunk-277BAY7J.js";
44
46
  import {
45
47
  SUBAGENT
46
48
  } from "./chunk-YYSLYVNZ.js";
47
- import "./chunk-AAFHLHXG.js";
49
+ import "./chunk-3SOIVANO.js";
48
50
  import "./chunk-MNTIEWKF.js";
49
51
  export {
52
+ AGY_CONVERSATION,
50
53
  AGY_HOOK_SET,
51
54
  AGY_UNVERIFIED,
52
55
  BLOCK_STOP,
@@ -79,6 +82,7 @@ export {
79
82
  promptTitle,
80
83
  pushText,
81
84
  pushWait,
85
+ recordAgyConversation,
82
86
  relayHookCommand,
83
87
  runHook,
84
88
  steerPrompt,
@@ -2,10 +2,10 @@ import {
2
2
  hooksTarget,
3
3
  installHooks,
4
4
  mcpInstall
5
- } from "./chunk-2342GTME.js";
6
- import "./chunk-XQHPDNVG.js";
5
+ } from "./chunk-LRQP25RI.js";
6
+ import "./chunk-277BAY7J.js";
7
7
  import "./chunk-YYSLYVNZ.js";
8
- import "./chunk-AAFHLHXG.js";
8
+ import "./chunk-3SOIVANO.js";
9
9
  import "./chunk-MNTIEWKF.js";
10
10
  export {
11
11
  hooksTarget,
@@ -7,7 +7,7 @@ import {
7
7
  sessionKey,
8
8
  startDaemon,
9
9
  walkNow
10
- } from "./chunk-AAFHLHXG.js";
10
+ } from "./chunk-3SOIVANO.js";
11
11
  import "./chunk-MNTIEWKF.js";
12
12
 
13
13
  // src/join.ts
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  machineName
3
- } from "./chunk-H2XQXMZU.js";
3
+ } from "./chunk-LUDLDWH2.js";
4
4
  import {
5
5
  RelayUsage,
6
6
  activeRelay,
7
7
  saveCredential
8
- } from "./chunk-AAFHLHXG.js";
8
+ } from "./chunk-3SOIVANO.js";
9
9
  import {
10
10
  note
11
11
  } from "./chunk-MNTIEWKF.js";
@@ -16,7 +16,7 @@ import {
16
16
  startDaemon,
17
17
  terminalAttached,
18
18
  time
19
- } from "./chunk-AAFHLHXG.js";
19
+ } from "./chunk-3SOIVANO.js";
20
20
  import {
21
21
  FAILED,
22
22
  exitFlushed,
@@ -35,7 +35,7 @@ import { parseArgs } from "util";
35
35
  // package.json
36
36
  var package_default = {
37
37
  name: "@scp-dev/cli",
38
- version: "0.5.0",
38
+ version: "0.7.0",
39
39
  description: "The swarm command line tool.",
40
40
  license: "Apache-2.0",
41
41
  homepage: "https://scp.dev",
@@ -242,9 +242,16 @@ scopes (selectors are comma-separated, e.g. tree:parent,tree:children,group:team
242
242
  message as a turn (steering a running one, waking an idle session)
243
243
  ${CLI_NAME} codex [--name N] [--headless] [--] [codex args...]
244
244
  runs codex with relay messages waking an idle thread or steering a running turn
245
+ ${CLI_NAME} muse [--name N] [--resume S] [--] [muse serve args...]
246
+ runs a headless Muse session that relay messages wake, printing its replies
245
247
  ${CLI_NAME} opencode [--name N] [--] [opencode args...]
246
248
  runs OpenCode with your own config and arguments, wake on: the plugin wakes an
247
249
  idle session, or opens one; refuses to start without the current plugin
250
+ ${CLI_NAME} agy [--name N] [--] [agy args...]
251
+ runs agy headless: each new message resumes its conversation as a turn;
252
+ refuses interactive flags and starts only with the scp hooks installed
253
+ ${CLI_NAME} grok [--name N] [--] [grok args...]
254
+ runs grok headless: each new message resumes its session as a turn
248
255
  ${CLI_NAME} peers [--all] [--roots] who you may message: title, status and the rule that admits each; offline ones and
249
256
  sessions nobody spawned that spawned nobody only with --all (--roots: those sessions)
250
257
  ${CLI_NAME} why <from> <to> whether from may message to, and why
@@ -281,6 +288,9 @@ agent sessions:
281
288
  it while idle (claude --dangerously-load-development-channels server:scp; SCP_NAME=N)
282
289
  --channels pushes messages into a Claude Code that ${CLI_NAME} claude started; setup mounts claude's shim with it.
283
290
  Without --name, ${CLI_NAME} claude asks the session to pick its own name with ${CLI_NAME} name <name>.
291
+ ${CLI_NAME} claude --bg [--name N] [--] [claude args...] the same in the background (claude --bg): an scp mount claims N and
292
+ $SCP_GRANT, so under env $(${CLI_NAME} spawn-env --name N) it links under you; prints its short id
293
+ ${CLI_NAME} claude attach <id|name> [--name N] claude attach, renaming its endpoint to N first; --resume of a live bg session attaches
284
294
  ${CLI_NAME} join [<handle>] put the session that runs this shell on the relay (it then shows in list,
285
295
  peers can message it, and its hooks hand it new messages), named <handle>
286
296
  when given; on a joined session it renames it in place. Works for a session
@@ -289,6 +299,9 @@ agent sessions:
289
299
  and title stay; a handle another endpoint holds, live or offline, is refused;
290
300
  a spawned worker is named by its spawner (policy defaults.rename: self lets it);
291
301
  --endpoint renames another agent, for the human at a terminal
302
+ ${CLI_NAME} name <handle> --take-over [--endpoint EP] take the handle from an offline endpoint: it is retired and its
303
+ children, links and unread mail move over (the same harness session, such as
304
+ a resumed one, needs no flag); for the human at a terminal
292
305
  ${CLI_NAME} join [<handle>] --under <parent> link the session under the agent <parent> (one it may message), as if
293
306
  <parent> had spawned it: it shows under <parent> in list --tree, the dashboard
294
307
  and the graph, and takes on a worker's scope (the policy's child_default: by
@@ -396,7 +409,7 @@ var VERBS = {
396
409
  link: IDENTITY,
397
410
  unlink: IDENTITY,
398
411
  leave: [...IDENTITY, "endpoint"],
399
- name: [...IDENTITY, "endpoint"],
412
+ name: [...IDENTITY, "endpoint", "take-over"],
400
413
  inbox: [...IDENTITY, "wait", "ack", "keep"],
401
414
  reply: IDENTITY,
402
415
  ack: [...IDENTITY, "all"],
@@ -569,14 +582,16 @@ async function relayMain(argv, cwd = process.cwd()) {
569
582
  out(cliVersion());
570
583
  return 0;
571
584
  }
572
- if (verb === "hook") return (await import("./hooks-BZANUJPY.js")).relayHookCommand(rest, startDaemon);
573
- if (verb === "setup") return (await import("./setup-UJCIMYU4.js")).relaySetupCommand(rest, cwd, out);
574
- if (verb === "claude") return (await import("./claude-RNH2E4GU.js")).claudeCommand(rest);
575
- if (verb === "pi") return (await import("./pi-N3DX37PD.js")).piCommand(rest);
576
- if (verb === "codex") return (await import("./codex-OSGHQMK6.js")).codexCommand(rest);
577
- if (verb === "opencode") return (await import("./opencode-XV33XTL5.js")).opencodeCommand(rest, process.env, void 0, cwd);
585
+ if (verb === "hook") return (await import("./hooks-ULKKUHPF.js")).relayHookCommand(rest, startDaemon);
586
+ if (verb === "setup") return (await import("./setup-U7CWN5QP.js")).relaySetupCommand(rest, cwd, out);
587
+ if (verb === "claude") return (await import("./claude-WEHOLJ26.js")).claudeCommand(rest);
588
+ if (verb === "pi") return (await import("./pi-5IPU6GA4.js")).piCommand(rest);
589
+ if (verb === "codex") return (await import("./codex-54UWPDY5.js")).codexCommand(rest);
590
+ if (verb === "muse") return (await import("./muse-S7FPY4CL.js")).museCommand(rest);
591
+ if (verb === "opencode") return (await import("./opencode-WFMQYCI2.js")).opencodeCommand(rest, process.env, void 0, cwd);
592
+ if (verb === "agy" || verb === "grok") return (await import("./resume-3ZRDXSTX.js")).resumeCommand(verb, rest, process.env, cwd);
578
593
  if (verb === "spawn") {
579
- const { splitSpawn, spawnCommand } = await import("./spawn-JYD7NCQT.js");
594
+ const { splitSpawn, spawnCommand } = await import("./spawn-VZK5MD3R.js");
580
595
  const { flags } = splitSpawn(rest);
581
596
  if (flags.includes("--help") || flags.includes("-h")) {
582
597
  out(flags.includes("--all") ? RELAY_HELP : SPAWN_HELP);
@@ -584,7 +599,7 @@ async function relayMain(argv, cwd = process.cwd()) {
584
599
  }
585
600
  return spawnCommand(rest, cwd);
586
601
  }
587
- if (verb === "mesh") return (await import("./mesh-OZILTV5P.js")).meshCommand(rest);
602
+ if (verb === "mesh") return (await import("./mesh-TDOVAHZ3.js")).meshCommand(rest);
588
603
  const allowed = VERBS[verb];
589
604
  if (!allowed) throw new RelayUsage(`unknown command "${verb}"`);
590
605
  let parsed;
@@ -604,11 +619,11 @@ async function relayMain(argv, cwd = process.cwd()) {
604
619
  return daemon(values.idle, values.policy);
605
620
  }
606
621
  if (verb === "mcp")
607
- return (await import("./mcp-BH526TOG.js")).relayMcpCommand(values, positionals);
622
+ return (await import("./mcp-7GB35CTY.js")).relayMcpCommand(values, positionals);
608
623
  if (verb === "hooks") {
609
624
  if (positionals[0] !== "install" || positionals.length > 1) throw new RelayUsage(`${CLI_NAME} hooks takes install --harness claude|codex|opencode|agy|muse`);
610
625
  if (values.write && values.print) throw new RelayUsage("--print and --write: pick one");
611
- return (await import("./install-25J5QB63.js")).installHooks({
626
+ return (await import("./install-5A3ETGF6.js")).installHooks({
612
627
  harness: values.harness,
613
628
  scope: values.scope,
614
629
  write: values.write === true,
@@ -619,27 +634,27 @@ async function relayMain(argv, cwd = process.cwd()) {
619
634
  out
620
635
  });
621
636
  }
622
- if (verb === "relay") return (await import("./relay-SF3UWIPM.js")).relayVerb(positionals, values.json === true);
623
- if (verb === "up") return (await import("./up-3YJU7YX6.js")).up(positionals, values, cwd, relinkBroker);
637
+ if (verb === "relay") return (await import("./relay-7WBNUACH.js")).relayVerb(positionals, values.json === true);
638
+ if (verb === "up") return (await import("./up-S4KJBWI6.js")).up(positionals, values, cwd, relinkBroker);
624
639
  if (verb === "login") {
625
- const code = await (await import("./relay-SF3UWIPM.js")).loginMain(positionals, values);
640
+ const code = await (await import("./relay-7WBNUACH.js")).loginMain(positionals, values);
626
641
  if (code === 0) await relinkRunning();
627
642
  return code;
628
643
  }
629
- if (verb === "logout") return (await import("./relay-SF3UWIPM.js")).logoutMain(positionals, values.json === true);
644
+ if (verb === "logout") return (await import("./relay-7WBNUACH.js")).logoutMain(positionals, values.json === true);
630
645
  if (verb === "cloud") {
631
- const code = await (await import("./remote-UQJ5YYCC.js")).cloudMain(positionals, values, cloudStatus);
646
+ const code = await (await import("./remote-YO5B2HQI.js")).cloudMain(positionals, values, cloudStatus);
632
647
  if (code === 0 && positionals[0] === "enable") await relinkRunning();
633
648
  return code;
634
649
  }
635
- if (verb === "join") return (await import("./join-EOLHE3LJ.js")).joinCommand(values, positionals, cwd, out);
650
+ if (verb === "join") return (await import("./join-FFT7RQRW.js")).joinCommand(values, positionals, cwd, out);
636
651
  if (verb === "holds") holdsArgs(values, positionals);
637
652
  const bodyFromStdin = (verb === "send" || verb === "ask" || verb === "reply") && (positionals[1] === void 0 || positionals[1] === "-");
638
653
  const humanAdopt = verb === "adopt" && values.parent !== void 0 && values.as === void 0 && terminalAttached(process, false);
639
654
  const opened = humanAdopt ? await openAdoptHuman(cwd, values) : await open(verb, values, cwd, bodyFromStdin);
640
655
  const { client } = opened;
641
656
  try {
642
- if (verb === "machines") return await (await import("./remote-UQJ5YYCC.js")).machinesVerb(client, positionals, values.json === true);
657
+ if (verb === "machines") return await (await import("./remote-YO5B2HQI.js")).machinesVerb(client, positionals, values.json === true);
643
658
  return await runVerb(opened, verb, values, positionals, cwd);
644
659
  } finally {
645
660
  client.close();
@@ -647,7 +662,7 @@ async function relayMain(argv, cwd = process.cwd()) {
647
662
  }
648
663
  async function openAdoptHuman(cwd, values) {
649
664
  if (values.cloud || process.env.SCP_TRANSPORT === "cloud") {
650
- const { openCloud } = await import("./remote-UQJ5YYCC.js");
665
+ const { openCloud } = await import("./remote-YO5B2HQI.js");
651
666
  return { ...await openCloud({ tty: true, ...values.machine !== void 0 ? { machine: values.machine } : {} }), broker: null, bound: "human" };
652
667
  }
653
668
  if (values.machine !== void 0) throw new RelayUsage("--machine names the machine of the cloud transport: add --cloud");
@@ -832,9 +847,9 @@ async function runVerb({ client, me, broker, where, bound, harnessPid }, verb, v
832
847
  return 0;
833
848
  }
834
849
  case "peek":
835
- return (await import("./peek-LFQR6TCS.js")).peekCommand(localClient(client, broker, verb), values, positionals);
850
+ return (await import("./peek-X4QQFMQJ.js")).peekCommand(localClient(client, broker, verb), values, positionals);
836
851
  case "set-peek":
837
- return (await import("./peek-LFQR6TCS.js")).setPeekCommand(localClient(client, broker, verb), values, positionals);
852
+ return (await import("./peek-X4QQFMQJ.js")).setPeekCommand(localClient(client, broker, verb), values, positionals);
838
853
  case "why": {
839
854
  const [from, to] = positionals;
840
855
  if (!from || !to || positionals.length > 2) throw new RelayUsage(`${CLI_NAME} why takes <from> <to>`);
@@ -1058,7 +1073,11 @@ async function runVerb({ client, me, broker, where, bound, harnessPid }, verb, v
1058
1073
  return 0;
1059
1074
  }
1060
1075
  const before = endpoint ?? me?.address;
1061
- const view = await client.request("rename", { handle: positionals[0], ...endpoint !== void 0 ? { endpoint } : {} });
1076
+ const view = await client.request("rename", {
1077
+ handle: positionals[0],
1078
+ ...endpoint !== void 0 ? { endpoint } : {},
1079
+ ...values["take-over"] === true ? { take_over: true } : {}
1080
+ });
1062
1081
  if (asJson) json(view);
1063
1082
  else out(before && before !== view.address ? `${before} is now ${view.address}` : `${view.address}`);
1064
1083
  return 0;
@@ -1454,11 +1473,11 @@ async function daemon(idle, policyFile) {
1454
1473
  });
1455
1474
  let broker;
1456
1475
  try {
1457
- const { daemonBridge } = await import("./remote-UQJ5YYCC.js");
1476
+ const { daemonBridge } = await import("./remote-YO5B2HQI.js");
1458
1477
  const bridge = await daemonBridge();
1459
1478
  broker = await startBroker({
1460
1479
  dir: relayDir(),
1461
- ...bridge ? { bridge } : await (await import("./mesh-OZILTV5P.js")).meshBrokerOptions(),
1480
+ ...bridge ? { bridge } : await (await import("./mesh-TDOVAHZ3.js")).meshBrokerOptions(),
1462
1481
  bridgeConfig: () => daemonBridge(),
1463
1482
  ...idleMs !== void 0 ? { idleMs } : {},
1464
1483
  ...policyFile ? { policyPath: resolve(policyFile) } : {}
@@ -1,24 +1,25 @@
1
1
  import {
2
2
  spawnDetached
3
- } from "./chunk-7RA7E5WR.js";
3
+ } from "./chunk-RZUQ422C.js";
4
4
  import "./chunk-KN7WEIE4.js";
5
- import "./chunk-UKQBH4AQ.js";
5
+ import "./chunk-SNW53KT3.js";
6
6
  import {
7
7
  mcpInstall
8
- } from "./chunk-2342GTME.js";
9
- import "./chunk-XQHPDNVG.js";
8
+ } from "./chunk-LRQP25RI.js";
9
+ import "./chunk-277BAY7J.js";
10
10
  import "./chunk-YYSLYVNZ.js";
11
11
  import {
12
12
  CHANNELS_ENV,
13
13
  RelayUsage,
14
14
  harnessAt,
15
15
  harnessPid,
16
+ launcherPid,
16
17
  membership,
17
18
  psParent,
18
19
  relayIdentity,
19
20
  startDaemon,
20
21
  writeShimBinding
21
- } from "./chunk-AAFHLHXG.js";
22
+ } from "./chunk-3SOIVANO.js";
22
23
  import "./chunk-MNTIEWKF.js";
23
24
 
24
25
  // src/mcp.ts
@@ -40,7 +41,7 @@ async function relayMcpCommand(values, positionals) {
40
41
  fallbackHarness: "mcp",
41
42
  cwd: process.cwd(),
42
43
  env: process.env,
43
- harnessPid: () => harnessPid(),
44
+ harnessPid: () => launcherPid(process.env) ?? harnessPid(),
44
45
  inferHarness: (pid) => harnessAt(pid)
45
46
  });
46
47
  if (!validHandle(claim.handle)) throw new RelayUsage(`${JSON.stringify(claim.handle)} is not a valid agent handle (me, user and relay are reserved)`);
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  RelayUsage
3
- } from "./chunk-AAFHLHXG.js";
3
+ } from "./chunk-3SOIVANO.js";
4
4
  import "./chunk-MNTIEWKF.js";
5
5
 
6
6
  // src/mesh.ts