@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.
- package/dist/{chunk-ZLL5EGI2.js → chunk-E7JG5PJB.js} +4 -3
- package/dist/{chunk-KC5AV5NQ.js → chunk-F5QVHJIT.js} +2 -2
- package/dist/{chunk-25ZVL5LD.js → chunk-G2SQPY6E.js} +3 -3
- package/dist/{chunk-NJLFHBSS.js → chunk-NOYMSD4F.js} +3 -3
- package/dist/{chunk-HF4KP6AR.js → chunk-OTO6DBU6.js} +1 -1
- package/dist/{chunk-MXQ7B3CQ.js → chunk-ZDU53ZRF.js} +1 -1
- package/dist/{claude-WTCPUYU3.js → claude-CVWECMRQ.js} +4 -4
- package/dist/cli.js +1 -1
- package/dist/{codex-YZZNH6IQ.js → codex-Y7SGLZ64.js} +5 -5
- package/dist/{hooks-4B5NOH7X.js → hooks-EKGY5O5N.js} +2 -2
- package/dist/{install-2ZM3IYXG.js → install-4VBSX6RI.js} +3 -3
- package/dist/{join-BH5CS6SL.js → join-RGFHOSLE.js} +7 -4
- package/dist/{login-UB72MU7W.js → login-IPS75GLQ.js} +2 -2
- package/dist/{main-I4F53MMA.js → main-YN3J6MGW.js} +58 -22
- package/dist/{mcp-RXAVQBMP.js → mcp-BVC4PLZ7.js} +5 -5
- package/dist/mesh-VNZV3POO.js +28 -0
- package/dist/{peek-M2HQVO4O.js → peek-4D4VGKOW.js} +1 -1
- package/dist/{pi-IAVFVOOO.js → pi-R23XR4AC.js} +1 -1
- package/dist/{relay-QDX2BNZH.js → relay-U634RHIJ.js} +1 -1
- package/dist/{remote-2OWBWLJH.js → remote-NTHRHVEP.js} +2 -2
- package/dist/{setup-HPH7HE6O.js → setup-H7GGUID2.js} +4 -4
- package/dist/{spawn-V66GYUNC.js → spawn-AJAYD6CW.js} +5 -5
- package/dist/{up-2YGEDA5J.js → up-HZKGURPI.js} +4 -4
- package/package.json +6 -5
|
@@ -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-
|
|
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-
|
|
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-
|
|
13
|
+
} from "./chunk-OTO6DBU6.js";
|
|
14
14
|
import {
|
|
15
15
|
RelayUsage,
|
|
16
16
|
gitToplevel
|
|
17
|
-
} from "./chunk-
|
|
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-
|
|
6
|
+
} from "./chunk-NOYMSD4F.js";
|
|
7
7
|
import {
|
|
8
8
|
steerPrompt
|
|
9
|
-
} from "./chunk-
|
|
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-
|
|
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-
|
|
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-
|
|
15
|
+
} from "./chunk-OTO6DBU6.js";
|
|
16
16
|
import {
|
|
17
17
|
RelayUsage,
|
|
18
18
|
gitToplevel,
|
|
19
19
|
setJoinMode
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-E7JG5PJB.js";
|
|
21
21
|
|
|
22
22
|
// src/setup.ts
|
|
23
23
|
import { spawnSync } from "child_process";
|
|
@@ -3,16 +3,16 @@ import {
|
|
|
3
3
|
mcpFile,
|
|
4
4
|
mountedEntry,
|
|
5
5
|
whichOnPath
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
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-
|
|
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-
|
|
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-
|
|
4
|
+
} from "./chunk-G2SQPY6E.js";
|
|
5
5
|
import "./chunk-KN7WEIE4.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
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-
|
|
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-
|
|
41
|
+
} from "./chunk-OTO6DBU6.js";
|
|
42
42
|
import {
|
|
43
43
|
SUBAGENT
|
|
44
44
|
} from "./chunk-YYSLYVNZ.js";
|
|
45
|
-
import "./chunk-
|
|
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-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-F5QVHJIT.js";
|
|
6
|
+
import "./chunk-OTO6DBU6.js";
|
|
7
7
|
import "./chunk-YYSLYVNZ.js";
|
|
8
|
-
import "./chunk-
|
|
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-
|
|
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
|
|
36
|
-
|
|
37
|
-
|
|
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-
|
|
3
|
+
} from "./chunk-ZDU53ZRF.js";
|
|
4
4
|
import {
|
|
5
5
|
RelayUsage,
|
|
6
6
|
activeRelay,
|
|
7
7
|
saveCredential
|
|
8
|
-
} from "./chunk-
|
|
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-
|
|
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.
|
|
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-
|
|
524
|
-
if (verb === "setup") return (await import("./setup-
|
|
525
|
-
if (verb === "claude") return (await import("./claude-
|
|
526
|
-
if (verb === "pi") return (await import("./pi-
|
|
527
|
-
if (verb === "codex") return (await import("./codex-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
572
|
-
if (verb === "up") return (await import("./up-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
783
|
+
return (await import("./peek-4D4VGKOW.js")).peekCommand(localClient(client, broker, verb), values, positionals);
|
|
768
784
|
case "set-peek":
|
|
769
|
-
return (await import("./peek-
|
|
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-
|
|
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-
|
|
3
|
+
} from "./chunk-G2SQPY6E.js";
|
|
4
4
|
import "./chunk-KN7WEIE4.js";
|
|
5
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-NOYMSD4F.js";
|
|
6
6
|
import {
|
|
7
7
|
mcpInstall
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
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-
|
|
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
|
+
};
|
|
@@ -15,11 +15,11 @@ import {
|
|
|
15
15
|
verifyMount,
|
|
16
16
|
verifyMusePlugin,
|
|
17
17
|
whichOnPath
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
18
|
+
} from "./chunk-NOYMSD4F.js";
|
|
19
|
+
import "./chunk-F5QVHJIT.js";
|
|
20
|
+
import "./chunk-OTO6DBU6.js";
|
|
21
21
|
import "./chunk-YYSLYVNZ.js";
|
|
22
|
-
import "./chunk-
|
|
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-
|
|
32
|
+
} from "./chunk-G2SQPY6E.js";
|
|
33
33
|
import {
|
|
34
34
|
SPAWN_HELP
|
|
35
35
|
} from "./chunk-KN7WEIE4.js";
|
|
36
|
-
import "./chunk-
|
|
37
|
-
import "./chunk-
|
|
38
|
-
import "./chunk-
|
|
36
|
+
import "./chunk-NOYMSD4F.js";
|
|
37
|
+
import "./chunk-F5QVHJIT.js";
|
|
38
|
+
import "./chunk-OTO6DBU6.js";
|
|
39
39
|
import "./chunk-YYSLYVNZ.js";
|
|
40
|
-
import "./chunk-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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.
|
|
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.
|
|
28
|
-
"@scp-dev/broker": "0.1.
|
|
29
|
-
"@scp-dev/hub": "0.
|
|
30
|
-
"@scp-dev/mcp": "0.1.
|
|
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
|
},
|