@scp-dev/cli 0.2.1 → 0.2.2

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.
@@ -374,7 +374,8 @@ var OPTIONS = {
374
374
  who: { type: "boolean" },
375
375
  peek: { type: "string" },
376
376
  endpoint: { type: "string" },
377
- live: { type: "boolean" }
377
+ live: { type: "boolean" },
378
+ parent: { type: "string" }
378
379
  };
379
380
  var SPAWN_OPTIONS = [
380
381
  "as",
@@ -486,7 +487,7 @@ async function open(verb, values, cwd, bodyFromStdin, walk) {
486
487
  `${CLI_NAME2} ${verb} needs an identity: --as HANDLE (or $SCP_NAME) for an agent, or --human for your own inbox me/ (no terminal is attached, so me/ is not assumed)`
487
488
  );
488
489
  }
489
- const { machineName, openCloud } = await import("./remote-2OWBWLJH.js");
490
+ const { machineName, openCloud } = await import("./remote-NTHRHVEP.js");
490
491
  const handle2 = named ? localHandle(named) : void 0;
491
492
  const claim = handle2 ? {
492
493
  handle: handle2,
@@ -743,7 +744,7 @@ function relayVerb(positionals, asJson, env = process.env) {
743
744
  }
744
745
  async function loginMain(positionals, values) {
745
746
  if (positionals.length) throw new RelayUsage(`${CLI_NAME3} login takes only flags`);
746
- return (await import("./login-UB72MU7W.js")).login(values);
747
+ return (await import("./login-IPS75GLQ.js")).login(values);
747
748
  }
748
749
  function logoutMain(positionals, asJson, env = process.env) {
749
750
  if (positionals.length) throw new RelayUsage(`${CLI_NAME3} logout takes no arguments`);
@@ -10,11 +10,11 @@ import {
10
10
  mergeHooks,
11
11
  musePlugin,
12
12
  opencodePlugin
13
- } from "./chunk-HF4KP6AR.js";
13
+ } from "./chunk-OTO6DBU6.js";
14
14
  import {
15
15
  RelayUsage,
16
16
  gitToplevel
17
- } from "./chunk-ZLL5EGI2.js";
17
+ } from "./chunk-E7JG5PJB.js";
18
18
 
19
19
  // src/install.ts
20
20
  import { chmodSync, copyFileSync, existsSync, lstatSync, mkdirSync, readFileSync, realpathSync, renameSync, statSync, unlinkSync, writeFileSync } from "fs";
@@ -3,10 +3,10 @@ import {
3
3
  agySettingsFile,
4
4
  mcpFile,
5
5
  mountedEntry
6
- } from "./chunk-NJLFHBSS.js";
6
+ } from "./chunk-NOYMSD4F.js";
7
7
  import {
8
8
  steerPrompt
9
- } from "./chunk-HF4KP6AR.js";
9
+ } from "./chunk-OTO6DBU6.js";
10
10
  import {
11
11
  OPTIONS,
12
12
  RelayUsage,
@@ -18,7 +18,7 @@ import {
18
18
  selectorList,
19
19
  spawnerKey,
20
20
  walkNow
21
- } from "./chunk-ZLL5EGI2.js";
21
+ } from "./chunk-E7JG5PJB.js";
22
22
  import {
23
23
  SELF,
24
24
  note
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  hooksTarget
3
- } from "./chunk-KC5AV5NQ.js";
3
+ } from "./chunk-F5QVHJIT.js";
4
4
  import {
5
5
  AGY_HOOK_SET,
6
6
  BLOCK_STOP,
@@ -12,12 +12,12 @@ import {
12
12
  mergeHooks,
13
13
  musePlugin,
14
14
  opencodePlugin
15
- } from "./chunk-HF4KP6AR.js";
15
+ } from "./chunk-OTO6DBU6.js";
16
16
  import {
17
17
  RelayUsage,
18
18
  gitToplevel,
19
19
  setJoinMode
20
- } from "./chunk-ZLL5EGI2.js";
20
+ } from "./chunk-E7JG5PJB.js";
21
21
 
22
22
  // src/setup.ts
23
23
  import { spawnSync } from "child_process";
@@ -12,7 +12,7 @@ import {
12
12
  psStart,
13
13
  relayIdentity,
14
14
  sessionKey
15
- } from "./chunk-ZLL5EGI2.js";
15
+ } from "./chunk-E7JG5PJB.js";
16
16
 
17
17
  // src/hooks.ts
18
18
  import { Readable } from "stream";
@@ -5,7 +5,7 @@ import {
5
5
  configDir,
6
6
  relayCredential,
7
7
  writePrivateJson
8
- } from "./chunk-ZLL5EGI2.js";
8
+ } from "./chunk-E7JG5PJB.js";
9
9
  import {
10
10
  note,
11
11
  printTable
@@ -3,16 +3,16 @@ import {
3
3
  mcpFile,
4
4
  mountedEntry,
5
5
  whichOnPath
6
- } from "./chunk-NJLFHBSS.js";
7
- import "./chunk-KC5AV5NQ.js";
8
- import "./chunk-HF4KP6AR.js";
6
+ } from "./chunk-NOYMSD4F.js";
7
+ import "./chunk-F5QVHJIT.js";
8
+ import "./chunk-OTO6DBU6.js";
9
9
  import "./chunk-YYSLYVNZ.js";
10
10
  import {
11
11
  CHANNELS_ENV,
12
12
  RelayUsage,
13
13
  deriveHandle,
14
14
  joinMode
15
- } from "./chunk-ZLL5EGI2.js";
15
+ } from "./chunk-E7JG5PJB.js";
16
16
  import "./chunk-MNTIEWKF.js";
17
17
 
18
18
  // src/claude.ts
package/dist/cli.js CHANGED
@@ -17,6 +17,6 @@ function quietSqliteWarning() {
17
17
  // src/cli.ts
18
18
  if (!await subagentFastPath(process.argv.slice(2))) {
19
19
  quietSqliteWarning();
20
- const { run } = await import("./main-I4F53MMA.js");
20
+ const { run } = await import("./main-YN3J6MGW.js");
21
21
  await run(process.argv.slice(2));
22
22
  }
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  codexMount,
3
3
  codexOverrides
4
- } from "./chunk-25ZVL5LD.js";
4
+ } from "./chunk-G2SQPY6E.js";
5
5
  import "./chunk-KN7WEIE4.js";
6
- import "./chunk-NJLFHBSS.js";
7
- import "./chunk-KC5AV5NQ.js";
8
- import "./chunk-HF4KP6AR.js";
6
+ import "./chunk-NOYMSD4F.js";
7
+ import "./chunk-F5QVHJIT.js";
8
+ import "./chunk-OTO6DBU6.js";
9
9
  import "./chunk-YYSLYVNZ.js";
10
10
  import {
11
11
  RelayUsage,
12
12
  readPsTable,
13
13
  relayIdentity,
14
14
  startDaemon
15
- } from "./chunk-ZLL5EGI2.js";
15
+ } from "./chunk-E7JG5PJB.js";
16
16
  import {
17
17
  SELF
18
18
  } from "./chunk-MNTIEWKF.js";
@@ -38,11 +38,11 @@ import {
38
38
  tldrEvery,
39
39
  transcriptTitle,
40
40
  unreadPointer
41
- } from "./chunk-HF4KP6AR.js";
41
+ } from "./chunk-OTO6DBU6.js";
42
42
  import {
43
43
  SUBAGENT
44
44
  } from "./chunk-YYSLYVNZ.js";
45
- import "./chunk-ZLL5EGI2.js";
45
+ import "./chunk-E7JG5PJB.js";
46
46
  import "./chunk-MNTIEWKF.js";
47
47
  export {
48
48
  AGY_HOOK_SET,
@@ -2,10 +2,10 @@ import {
2
2
  hooksTarget,
3
3
  installHooks,
4
4
  mcpInstall
5
- } from "./chunk-KC5AV5NQ.js";
6
- import "./chunk-HF4KP6AR.js";
5
+ } from "./chunk-F5QVHJIT.js";
6
+ import "./chunk-OTO6DBU6.js";
7
7
  import "./chunk-YYSLYVNZ.js";
8
- import "./chunk-ZLL5EGI2.js";
8
+ import "./chunk-E7JG5PJB.js";
9
9
  import "./chunk-MNTIEWKF.js";
10
10
  export {
11
11
  hooksTarget,
@@ -5,7 +5,7 @@ import {
5
5
  sessionKey,
6
6
  startDaemon,
7
7
  walkNow
8
- } from "./chunk-ZLL5EGI2.js";
8
+ } from "./chunk-E7JG5PJB.js";
9
9
  import "./chunk-MNTIEWKF.js";
10
10
 
11
11
  // src/join.ts
@@ -32,9 +32,12 @@ async function joinCommand(values, positionals, cwd, out) {
32
32
  });
33
33
  const client = await connectBroker(dir, () => startDaemon(dir));
34
34
  try {
35
- const hello = await client.hello({ transient: true, claim, join: handle ? { handle } : {} });
36
- if (values.json === true) out(JSON.stringify(hello.endpoint, null, 2));
37
- else out(`joined as ${hello.endpoint.address}: peers can message it, and its hooks hand it new messages at turn boundaries`);
35
+ const under = typeof values.under === "string" ? values.under : void 0;
36
+ const hello = await client.hello({ transient: true, claim, join: { ...handle ? { handle } : {}, ...under ? { under } : {} } });
37
+ const view = hello.endpoint;
38
+ if (values.json === true) out(JSON.stringify(view, null, 2));
39
+ else
40
+ out(`joined as ${view.address}${view.parent ? ` under ${view.parent}` : ""}: peers can message it, and its hooks hand it new messages at turn boundaries`);
38
41
  } finally {
39
42
  client.close();
40
43
  }
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  machineName
3
- } from "./chunk-MXQ7B3CQ.js";
3
+ } from "./chunk-ZDU53ZRF.js";
4
4
  import {
5
5
  RelayUsage,
6
6
  activeRelay,
7
7
  saveCredential
8
- } from "./chunk-ZLL5EGI2.js";
8
+ } from "./chunk-E7JG5PJB.js";
9
9
  import {
10
10
  note
11
11
  } from "./chunk-MNTIEWKF.js";
@@ -15,7 +15,7 @@ import {
15
15
  stamp,
16
16
  startDaemon,
17
17
  time
18
- } from "./chunk-ZLL5EGI2.js";
18
+ } from "./chunk-E7JG5PJB.js";
19
19
  import {
20
20
  FAILED,
21
21
  exitFlushed,
@@ -33,7 +33,7 @@ import { parseArgs } from "util";
33
33
  // package.json
34
34
  var package_default = {
35
35
  name: "@scp-dev/cli",
36
- version: "0.2.1",
36
+ version: "0.2.2",
37
37
  description: "The swarm command line tool.",
38
38
  license: "Apache-2.0",
39
39
  homepage: "https://scp.dev",
@@ -65,6 +65,7 @@ var package_default = {
65
65
  },
66
66
  devDependencies: {
67
67
  "@openai/codex": "0.159.0",
68
+ "@scp-dev/mesh": "workspace:*",
68
69
  "opencode-ai": "1.18.34",
69
70
  tsup: "^8.5.1"
70
71
  },
@@ -100,6 +101,7 @@ results back, as with native subagents.
100
101
  ${CLI_NAME} inbox [--wait S] your unread messages, then marked read: ${CLI_NAME} inbox
101
102
  ${CLI_NAME} list [--all] agents on the relay: address, title, presence, status; --all adds offline ones
102
103
  ${CLI_NAME} join [name] put this session on the relay, named once: ${CLI_NAME} join lead (${CLI_NAME} name renames it)
104
+ ${CLI_NAME} join --under <parent> link this session under an orchestrator, as a spawned worker sits: ${CLI_NAME} join --under lead
103
105
  ${CLI_NAME} status [id] the fleet in short; with the id of a message you sent: who read it when
104
106
  ${CLI_NAME} peek <ep> a short, redacted view of a peekable agent's last turns: ${CLI_NAME} peek rev
105
107
  ${CLI_NAME} set-status <state> [note] working, waiting, blocked or done: ${CLI_NAME} set-status done "PR open"
@@ -276,6 +278,17 @@ agent sessions:
276
278
  and title stay; a handle another endpoint holds, live or offline, is refused;
277
279
  a spawned worker is named by its spawner (policy defaults.rename: self lets it);
278
280
  --endpoint renames another agent, for the human at a terminal
281
+ ${CLI_NAME} join [<handle>] --under <parent> link the session under the agent <parent> (local, one it may message), as if
282
+ <parent> had spawned it: it shows under <parent> in list --tree, the dashboard
283
+ and the graph, and takes on a worker's scope (the policy's child_default: by
284
+ default it reaches only what <parent> reaches). Narrowing, so always allowed
285
+ ${CLI_NAME} adopt <child> [--parent <p>] link a local root agent and its subtree under <p>, for the human at a terminal;
286
+ from an agent's shell with a terminal attached <p> defaults to that agent.
287
+ An agent without a terminal is refused: the session joins with --under itself
288
+ ${CLI_NAME} unlink [<child>] put a linked agent back at the root, its subtree along and the child scope off;
289
+ widening, so the human at a terminal only (policy defaults.unlink: self lets
290
+ an agent unlink itself). A link that would put a parent under its own child
291
+ (a cycle) is refused; both are audited, as adopt and unlink
279
292
  ${CLI_NAME} leave [--endpoint EP] take this session off the relay: offline, no messages pushed, mail kept until
280
293
  ${CLI_NAME} join; a spawned worker stays joined while it runs
281
294
  With setup --join manual a session stays off the relay until it runs ${CLI_NAME} join; the default, auto, joins every
@@ -347,7 +360,9 @@ var IDENTITY = ["as", "harness", "human", "json", "cloud", "machine"];
347
360
  var VERBS = {
348
361
  list: [...IDENTITY, "all", "tree", "roots", "contacts"],
349
362
  send: [...IDENTITY, "reply-to", "thread", "private", "attach", "live"],
350
- join: ["harness", "json"],
363
+ join: ["harness", "json", "under"],
364
+ adopt: [...IDENTITY, "parent"],
365
+ unlink: IDENTITY,
351
366
  leave: [...IDENTITY, "endpoint"],
352
367
  name: [...IDENTITY, "endpoint"],
353
368
  inbox: [...IDENTITY, "wait", "ack", "keep"],
@@ -520,13 +535,13 @@ async function relayMain(argv, cwd = process.cwd()) {
520
535
  out(package_default.version);
521
536
  return 0;
522
537
  }
523
- if (verb === "hook") return (await import("./hooks-4B5NOH7X.js")).relayHookCommand(rest, startDaemon);
524
- if (verb === "setup") return (await import("./setup-HPH7HE6O.js")).relaySetupCommand(rest, cwd, out);
525
- if (verb === "claude") return (await import("./claude-WTCPUYU3.js")).claudeCommand(rest);
526
- if (verb === "pi") return (await import("./pi-IAVFVOOO.js")).piCommand(rest);
527
- if (verb === "codex") return (await import("./codex-YZZNH6IQ.js")).codexCommand(rest);
538
+ if (verb === "hook") return (await import("./hooks-EKGY5O5N.js")).relayHookCommand(rest, startDaemon);
539
+ if (verb === "setup") return (await import("./setup-H7GGUID2.js")).relaySetupCommand(rest, cwd, out);
540
+ if (verb === "claude") return (await import("./claude-CVWECMRQ.js")).claudeCommand(rest);
541
+ if (verb === "pi") return (await import("./pi-R23XR4AC.js")).piCommand(rest);
542
+ if (verb === "codex") return (await import("./codex-Y7SGLZ64.js")).codexCommand(rest);
528
543
  if (verb === "spawn") {
529
- const { splitSpawn, spawnCommand } = await import("./spawn-V66GYUNC.js");
544
+ const { splitSpawn, spawnCommand } = await import("./spawn-AJAYD6CW.js");
530
545
  const { flags } = splitSpawn(rest);
531
546
  if (flags.includes("--help") || flags.includes("-h")) {
532
547
  out(flags.includes("--all") ? RELAY_HELP : SPAWN_HELP);
@@ -534,6 +549,7 @@ async function relayMain(argv, cwd = process.cwd()) {
534
549
  }
535
550
  return spawnCommand(rest, cwd);
536
551
  }
552
+ if (verb === "mesh") return (await import("./mesh-VNZV3POO.js")).meshCommand(rest);
537
553
  const allowed = VERBS[verb];
538
554
  if (!allowed) throw new RelayUsage(`unknown command "${verb}"`);
539
555
  let parsed;
@@ -553,11 +569,11 @@ async function relayMain(argv, cwd = process.cwd()) {
553
569
  return daemon(values.idle, values.policy);
554
570
  }
555
571
  if (verb === "mcp")
556
- return (await import("./mcp-RXAVQBMP.js")).relayMcpCommand(values, positionals);
572
+ return (await import("./mcp-BVC4PLZ7.js")).relayMcpCommand(values, positionals);
557
573
  if (verb === "hooks") {
558
574
  if (positionals[0] !== "install" || positionals.length > 1) throw new RelayUsage(`${CLI_NAME} hooks takes install --harness claude|codex|opencode|agy|muse`);
559
575
  if (values.write && values.print) throw new RelayUsage("--print and --write: pick one");
560
- return (await import("./install-2ZM3IYXG.js")).installHooks({
576
+ return (await import("./install-4VBSX6RI.js")).installHooks({
561
577
  harness: values.harness,
562
578
  scope: values.scope,
563
579
  write: values.write === true,
@@ -568,26 +584,26 @@ async function relayMain(argv, cwd = process.cwd()) {
568
584
  out
569
585
  });
570
586
  }
571
- if (verb === "relay") return (await import("./relay-QDX2BNZH.js")).relayVerb(positionals, values.json === true);
572
- if (verb === "up") return (await import("./up-2YGEDA5J.js")).up(positionals, values, cwd, relinkBroker);
587
+ if (verb === "relay") return (await import("./relay-U634RHIJ.js")).relayVerb(positionals, values.json === true);
588
+ if (verb === "up") return (await import("./up-HZKGURPI.js")).up(positionals, values, cwd, relinkBroker);
573
589
  if (verb === "login") {
574
- const code = await (await import("./relay-QDX2BNZH.js")).loginMain(positionals, values);
590
+ const code = await (await import("./relay-U634RHIJ.js")).loginMain(positionals, values);
575
591
  if (code === 0) await relinkRunning();
576
592
  return code;
577
593
  }
578
- if (verb === "logout") return (await import("./relay-QDX2BNZH.js")).logoutMain(positionals, values.json === true);
594
+ if (verb === "logout") return (await import("./relay-U634RHIJ.js")).logoutMain(positionals, values.json === true);
579
595
  if (verb === "cloud") {
580
- const code = await (await import("./remote-2OWBWLJH.js")).cloudMain(positionals, values, cloudStatus);
596
+ const code = await (await import("./remote-NTHRHVEP.js")).cloudMain(positionals, values, cloudStatus);
581
597
  if (code === 0 && positionals[0] === "enable") await relinkRunning();
582
598
  return code;
583
599
  }
584
- if (verb === "join") return (await import("./join-BH5CS6SL.js")).joinCommand(values, positionals, cwd, out);
600
+ if (verb === "join") return (await import("./join-RGFHOSLE.js")).joinCommand(values, positionals, cwd, out);
585
601
  if (verb === "holds") holdsArgs(values, positionals);
586
602
  const bodyFromStdin = (verb === "send" || verb === "ask" || verb === "reply") && (positionals[1] === void 0 || positionals[1] === "-");
587
603
  const opened = await open(verb, values, cwd, bodyFromStdin);
588
604
  const { client } = opened;
589
605
  try {
590
- if (verb === "machines") return await (await import("./remote-2OWBWLJH.js")).machinesVerb(client, positionals, values.json === true);
606
+ if (verb === "machines") return await (await import("./remote-NTHRHVEP.js")).machinesVerb(client, positionals, values.json === true);
591
607
  return await runVerb(opened, verb, values, positionals, cwd);
592
608
  } finally {
593
609
  client.close();
@@ -764,9 +780,9 @@ async function runVerb({ client, me, broker, where, bound, harnessPid }, verb, v
764
780
  return 0;
765
781
  }
766
782
  case "peek":
767
- return (await import("./peek-M2HQVO4O.js")).peekCommand(localClient(client, broker, verb), values, positionals);
783
+ return (await import("./peek-4D4VGKOW.js")).peekCommand(localClient(client, broker, verb), values, positionals);
768
784
  case "set-peek":
769
- return (await import("./peek-M2HQVO4O.js")).setPeekCommand(localClient(client, broker, verb), values, positionals);
785
+ return (await import("./peek-4D4VGKOW.js")).setPeekCommand(localClient(client, broker, verb), values, positionals);
770
786
  case "why": {
771
787
  const [from, to] = positionals;
772
788
  if (!from || !to || positionals.length > 2) throw new RelayUsage(`${CLI_NAME} why takes <from> <to>`);
@@ -983,6 +999,26 @@ async function runVerb({ client, me, broker, where, bound, harnessPid }, verb, v
983
999
  else out(before && before !== view.address ? `${before} is now ${view.address}` : `${view.address}`);
984
1000
  return 0;
985
1001
  }
1002
+ case "adopt": {
1003
+ if (positionals.length !== 1) throw new RelayUsage(`${CLI_NAME} adopt takes the child to link: ${CLI_NAME} adopt <child> [--parent <p>]`);
1004
+ const parent = values.parent;
1005
+ if (parent === void 0 && me?.kind !== "agent")
1006
+ throw new RelayUsage(`${CLI_NAME} adopt: name the parent with --parent <p> (run from an agent's shell, it defaults to that agent)`);
1007
+ const result = await client.request("adopt", {
1008
+ endpoint: positionals[0],
1009
+ ...parent !== void 0 ? { parent } : {}
1010
+ });
1011
+ if (asJson) json(result);
1012
+ else out(`${result.endpoint.address} now sits under ${result.parent}`);
1013
+ return 0;
1014
+ }
1015
+ case "unlink": {
1016
+ if (positionals.length > 1) throw new RelayUsage(`${CLI_NAME} unlink takes one child, or none for this session`);
1017
+ const result = await client.request("unlink", positionals.length ? { endpoint: positionals[0] } : {});
1018
+ if (asJson) json(result);
1019
+ else out(`${result.endpoint.address} is a root again (was under ${result.parent})`);
1020
+ return 0;
1021
+ }
986
1022
  case "leave": {
987
1023
  if (positionals.length) throw new RelayUsage(`${CLI_NAME} leave takes no arguments (--endpoint EP for the human at a terminal)`);
988
1024
  const endpoint = values.endpoint;
@@ -1343,11 +1379,11 @@ async function daemon(idle, policyFile) {
1343
1379
  });
1344
1380
  let broker;
1345
1381
  try {
1346
- const { daemonBridge } = await import("./remote-2OWBWLJH.js");
1382
+ const { daemonBridge } = await import("./remote-NTHRHVEP.js");
1347
1383
  const bridge = await daemonBridge();
1348
1384
  broker = await startBroker({
1349
1385
  dir: relayDir(),
1350
- ...bridge ? { bridge } : {},
1386
+ ...bridge ? { bridge } : await (await import("./mesh-VNZV3POO.js")).meshBrokerOptions(),
1351
1387
  bridgeConfig: () => daemonBridge(),
1352
1388
  ...idleMs !== void 0 ? { idleMs } : {},
1353
1389
  ...policyFile ? { policyPath: resolve(policyFile) } : {}
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  spawnDetached
3
- } from "./chunk-25ZVL5LD.js";
3
+ } from "./chunk-G2SQPY6E.js";
4
4
  import "./chunk-KN7WEIE4.js";
5
- import "./chunk-NJLFHBSS.js";
5
+ import "./chunk-NOYMSD4F.js";
6
6
  import {
7
7
  mcpInstall
8
- } from "./chunk-KC5AV5NQ.js";
9
- import "./chunk-HF4KP6AR.js";
8
+ } from "./chunk-F5QVHJIT.js";
9
+ import "./chunk-OTO6DBU6.js";
10
10
  import "./chunk-YYSLYVNZ.js";
11
11
  import {
12
12
  CHANNELS_ENV,
@@ -16,7 +16,7 @@ import {
16
16
  psParent,
17
17
  relayIdentity,
18
18
  startDaemon
19
- } from "./chunk-ZLL5EGI2.js";
19
+ } from "./chunk-E7JG5PJB.js";
20
20
  import "./chunk-MNTIEWKF.js";
21
21
 
22
22
  // src/mcp.ts
@@ -0,0 +1,28 @@
1
+ import {
2
+ RelayUsage
3
+ } from "./chunk-E7JG5PJB.js";
4
+ import "./chunk-MNTIEWKF.js";
5
+
6
+ // src/mesh.ts
7
+ import { existsSync } from "fs";
8
+ import { join } from "path";
9
+ import { relayDir } from "@scp-dev/broker";
10
+ var MESH_MODULE = "@scp-dev/mesh";
11
+ async function load() {
12
+ try {
13
+ return await import(MESH_MODULE);
14
+ } catch {
15
+ throw new RelayUsage("swarm mesh is experimental and runs only from a source checkout of the swarm CLI");
16
+ }
17
+ }
18
+ async function meshCommand(argv) {
19
+ return (await load()).meshCommand(argv);
20
+ }
21
+ async function meshBrokerOptions() {
22
+ if (!existsSync(join(relayDir(), "mesh", "mesh.json"))) return {};
23
+ return (await load()).meshBrokerOptions();
24
+ }
25
+ export {
26
+ meshBrokerOptions,
27
+ meshCommand
28
+ };
@@ -2,7 +2,7 @@ import {
2
2
  RelayUsage,
3
3
  peekGrant,
4
4
  stamp
5
- } from "./chunk-ZLL5EGI2.js";
5
+ } from "./chunk-E7JG5PJB.js";
6
6
  import {
7
7
  note
8
8
  } from "./chunk-MNTIEWKF.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  RelayUsage
3
- } from "./chunk-ZLL5EGI2.js";
3
+ } from "./chunk-E7JG5PJB.js";
4
4
  import "./chunk-MNTIEWKF.js";
5
5
 
6
6
  // src/pi.ts
@@ -13,7 +13,7 @@ import {
13
13
  saveCredential,
14
14
  setJoinMode,
15
15
  writePrivateJson
16
- } from "./chunk-ZLL5EGI2.js";
16
+ } from "./chunk-E7JG5PJB.js";
17
17
  import "./chunk-MNTIEWKF.js";
18
18
  export {
19
19
  DEFAULT_RELAY,
@@ -9,8 +9,8 @@ import {
9
9
  machinesVerb,
10
10
  openCloud,
11
11
  readCloudFile
12
- } from "./chunk-MXQ7B3CQ.js";
13
- import "./chunk-ZLL5EGI2.js";
12
+ } from "./chunk-ZDU53ZRF.js";
13
+ import "./chunk-E7JG5PJB.js";
14
14
  import "./chunk-MNTIEWKF.js";
15
15
  export {
16
16
  CloudRelayClient,
@@ -15,11 +15,11 @@ import {
15
15
  verifyMount,
16
16
  verifyMusePlugin,
17
17
  whichOnPath
18
- } from "./chunk-NJLFHBSS.js";
19
- import "./chunk-KC5AV5NQ.js";
20
- import "./chunk-HF4KP6AR.js";
18
+ } from "./chunk-NOYMSD4F.js";
19
+ import "./chunk-F5QVHJIT.js";
20
+ import "./chunk-OTO6DBU6.js";
21
21
  import "./chunk-YYSLYVNZ.js";
22
- import "./chunk-ZLL5EGI2.js";
22
+ import "./chunk-E7JG5PJB.js";
23
23
  import "./chunk-MNTIEWKF.js";
24
24
  export {
25
25
  SETUP_HARNESSES,
@@ -29,15 +29,15 @@ import {
29
29
  steerArgv,
30
30
  transcriptReplies,
31
31
  workerName
32
- } from "./chunk-25ZVL5LD.js";
32
+ } from "./chunk-G2SQPY6E.js";
33
33
  import {
34
34
  SPAWN_HELP
35
35
  } from "./chunk-KN7WEIE4.js";
36
- import "./chunk-NJLFHBSS.js";
37
- import "./chunk-KC5AV5NQ.js";
38
- import "./chunk-HF4KP6AR.js";
36
+ import "./chunk-NOYMSD4F.js";
37
+ import "./chunk-F5QVHJIT.js";
38
+ import "./chunk-OTO6DBU6.js";
39
39
  import "./chunk-YYSLYVNZ.js";
40
- import "./chunk-ZLL5EGI2.js";
40
+ import "./chunk-E7JG5PJB.js";
41
41
  import "./chunk-MNTIEWKF.js";
42
42
  export {
43
43
  MESSAGING,
@@ -2,7 +2,7 @@ import {
2
2
  RelayUsage,
3
3
  activeRelay,
4
4
  relayCredential
5
- } from "./chunk-ZLL5EGI2.js";
5
+ } from "./chunk-E7JG5PJB.js";
6
6
  import "./chunk-MNTIEWKF.js";
7
7
 
8
8
  // src/up.ts
@@ -14,16 +14,16 @@ async function up(positionals, values, cwd, brokerStatus) {
14
14
  const { url } = activeRelay(process.env);
15
15
  const headless = values.token !== void 0 || Boolean(process.env.SCP_TOKEN?.trim());
16
16
  if (headless || !relayCredential(process.env, url).token) {
17
- const code = await (await import("./login-UB72MU7W.js")).login({
17
+ const code = await (await import("./login-IPS75GLQ.js")).login({
18
18
  ...values.token !== void 0 ? { token: values.token } : {},
19
19
  ...values.label !== void 0 ? { label: values.label } : {},
20
20
  ...values["no-browser"] ? { "no-browser": true } : {}
21
21
  });
22
22
  if (code !== 0) return code;
23
23
  } else out(`already logged in to ${url}`);
24
- const enabled = await (await import("./remote-2OWBWLJH.js")).cloudMain(["enable"], values.machine !== void 0 ? { machine: values.machine } : {}, brokerStatus);
24
+ const enabled = await (await import("./remote-NTHRHVEP.js")).cloudMain(["enable"], values.machine !== void 0 ? { machine: values.machine } : {}, brokerStatus);
25
25
  if (enabled !== 0) return enabled;
26
- const setup = (await import("./setup-HPH7HE6O.js")).relaySetupCommand(["--write"], cwd, out);
26
+ const setup = (await import("./setup-H7GGUID2.js")).relaySetupCommand(["--write"], cwd, out);
27
27
  if (setup !== 0) return setup;
28
28
  const broker = await brokerStatus();
29
29
  if (!broker.enabled) out(`the broker is still local-only; run \`${CLI_NAME} daemon restart\` to link it to ${url}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scp-dev/cli",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "The swarm command line tool.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://scp.dev",
@@ -24,14 +24,15 @@
24
24
  "typecheck": "tsc -p ."
25
25
  },
26
26
  "dependencies": {
27
- "@scp-dev/core": "0.1.2",
28
- "@scp-dev/broker": "0.1.3",
29
- "@scp-dev/hub": "0.2.0",
30
- "@scp-dev/mcp": "0.1.3",
27
+ "@scp-dev/core": "0.1.3",
28
+ "@scp-dev/broker": "0.1.4",
29
+ "@scp-dev/hub": "0.3.0",
30
+ "@scp-dev/mcp": "0.1.4",
31
31
  "smol-toml": "^1.9.1"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@openai/codex": "0.159.0",
35
+ "@scp-dev/mesh": "0.0.1",
35
36
  "opencode-ai": "1.18.34",
36
37
  "tsup": "^8.5.1"
37
38
  },