@nodii/dev 0.6.62 → 0.6.63
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/README.md +56 -0
- package/dist/cli.js +84 -1
- package/dist/core.js +1 -1
- package/dist/devops-openapi.json +1 -1
- package/dist/doctor.js +21 -0
- package/dist/flags.js +3 -1
- package/dist/host.js +27 -0
- package/dist/lanes.js +118 -17
- package/dist/starting.js +8 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -36,6 +36,15 @@ same way (the OAuth client and hosts from the machine's newest config, the
|
|
|
36
36
|
person and installation from the token; `NODII_DEV_*` variables override),
|
|
37
37
|
so a new lane needs no login and no hand-seeded config.
|
|
38
38
|
|
|
39
|
+
A typo in `--name` is fixed with `agent rename [ID] --name NEW`: with no ID it
|
|
40
|
+
renames this config's agent, and an ID may be any other agent of yours (Dev
|
|
41
|
+
refuses another person's with `AGENT_OWNER_REQUIRED`). The name is trimmed and
|
|
42
|
+
must be 1–100 characters with no control characters, as at registration.
|
|
43
|
+
`agent list` shows your agents (`*` marks this config's), and
|
|
44
|
+
`agent disconnect ID` retires one. There is no delete: a disconnected agent
|
|
45
|
+
stays on record and its id can't be used again. Disconnecting this config's
|
|
46
|
+
own agent removes it from the config, so the next step is `agent register`.
|
|
47
|
+
|
|
39
48
|
`nodii-dev` talks only to Dev, through the platform edge
|
|
40
49
|
(`https://platform.nucleus-cloud.in/devops/*`), signed in as the platform
|
|
41
50
|
tenant's nodii-dev OAuth app (D1368). There is no other host and no other way
|
|
@@ -94,6 +103,9 @@ nodii-dev api OPERATION_ID [--param name=value ...] [--body @file|-|JSON]
|
|
|
94
103
|
|
|
95
104
|
nodii-dev agent register --name NAME [--session ID] # staff bind the agent to a service on the Dev Agents page
|
|
96
105
|
nodii-dev agent heartbeat
|
|
106
|
+
nodii-dev agent rename [ID] --name NAME # no ID: this config's agent
|
|
107
|
+
nodii-dev agent list # your agents; * marks this config's
|
|
108
|
+
nodii-dev agent disconnect ID # retire one of your agents; no delete
|
|
97
109
|
nodii-dev agents spawn SERVICE [--repo-root DIR]
|
|
98
110
|
nodii-dev agents cowork-tick [--json]
|
|
99
111
|
nodii-dev agents cowork-tick --plist [--interval SECONDS]
|
|
@@ -420,6 +432,15 @@ nodii-dev lane heartbeat KEY [--note TEXT]
|
|
|
420
432
|
# a note starting "BLOCKED" or "WAITING:" (capitals) marks
|
|
421
433
|
# the lane blocked: an exit then ends its run blocked and
|
|
422
434
|
# never counts toward the two-deaths stop (AGENT-HARNESS-46)
|
|
435
|
+
nodii-dev lane resume --host-lost [--min-free-gb N] [--stagger-seconds N]
|
|
436
|
+
# after a reboot (coordinator): resume every host_lost lane
|
|
437
|
+
# on this machine in priority order, each under its own
|
|
438
|
+
# key, agent, worktree and branch. Stops at the memory floor
|
|
439
|
+
# (default 4 GiB, 15 s between lanes); run it again to carry
|
|
440
|
+
# on (AGENT-HARNESS-67)
|
|
441
|
+
nodii-dev lane transfer KEY --reason TEXT [--to-agent ID]
|
|
442
|
+
# move a host_lost lane to the recovering agent on this
|
|
443
|
+
# machine under a fresh run (AGENT-HARNESS-67)
|
|
423
444
|
nodii-dev lane resume KEY [--override --reason TEXT]
|
|
424
445
|
# --override (coordinator): resume a lane the two-identical-
|
|
425
446
|
# deaths rule stopped; Dev refuses it with
|
|
@@ -908,6 +929,7 @@ exits 0 only when every check is `OK`. `--json` returns the same checks as
|
|
|
908
929
|
| `figma_scopes` | With `figma_file`, when the file is registered: the change set this agent holds in the file and its lock scopes (or the whole file), or that it holds none (DEC-0032). |
|
|
909
930
|
| `hooks_claude` | Whether Claude hooks are installed, trusted by that runtime, and have a private firing receipt. |
|
|
910
931
|
| `hooks_codex_personal`, `hooks_codex_work` | For `~/.codex` and `~/.codex-work`, whether Codex's own hook registry reports the hooks installed and trusted (including managed status), whether the managed absolute CLI is present and new enough, and whether that profile has fired one. |
|
|
932
|
+
| `host_restart` | For the machine's coordinator: whether Dev has recorded this machine's boot, then whether any lane is still `host_lost`. `MISSING` names the next command. Other agents read `OK`. |
|
|
911
933
|
| `lane_env` | Every `claude` and `codex` process whose working directory is in an active lane's worktree on this machine, and whether its environment carries `NODII_DEV_CONFIG_PATH` naming that lane's `lane-<key>.json`. The managed hooks exit without acting for a process without it (AGENT-HARNESS-61). Run inside a lane, it checks that lane only. `MISSING` names each process; `lane launch` and `lane resume` start the agent with the variable set. `lane check` prints the same report for its lane as `lane_env:` lines, without blocking the review. |
|
|
912
934
|
|
|
913
935
|
Doctor may refresh the access token, as any command does. The permission table
|
|
@@ -975,6 +997,40 @@ first.
|
|
|
975
997
|
|
|
976
998
|
## Build lanes and repository setup
|
|
977
999
|
|
|
1000
|
+
### After a host crash
|
|
1001
|
+
|
|
1002
|
+
`coordinator start` sends the machine's boot time. Every run whose last
|
|
1003
|
+
heartbeat is older than that boot becomes an Orphan with the reason `host_lost`.
|
|
1004
|
+
It does not count toward the two-identical-deaths stop, and it needs no
|
|
1005
|
+
amendment, `--override` or staff stop. It does the same for a
|
|
1006
|
+
lane's newest run if Dev closed it during the outage, by the heartbeat timeout
|
|
1007
|
+
or the watchdog, as an orphan or as blocked. A run that exited on its own while
|
|
1008
|
+
the host was up keeps its record. The same start takes over the previous
|
|
1009
|
+
coordinator run and lists the `host_lost` lanes.
|
|
1010
|
+
|
|
1011
|
+
To recover a machine, in order:
|
|
1012
|
+
|
|
1013
|
+
```
|
|
1014
|
+
nodii-dev coordinator start --machine NAME
|
|
1015
|
+
nodii-dev lane resume --host-lost
|
|
1016
|
+
nodii-dev doctor
|
|
1017
|
+
```
|
|
1018
|
+
|
|
1019
|
+
A lane agent's heartbeat newer than the boot is a live process, so that lane is
|
|
1020
|
+
refused with `LANE_PROCESS_LIVE`. A coordinator heartbeating on schedule
|
|
1021
|
+
disproves a reboot: Dev marks nothing, and the start is refused as usual.
|
|
1022
|
+
|
|
1023
|
+
No session sends a dead agent's identity (K04-10). When a lane should go on
|
|
1024
|
+
under another agent, `lane transfer KEY --reason TEXT [--to-agent ID]` moves it,
|
|
1025
|
+
on the same machine only. The recovering agent is a fresh agent registered as
|
|
1026
|
+
`lane-<key>` (S01-57) with its own id, so Dev refuses any other name
|
|
1027
|
+
(`TRANSFER_AGENT_NAME_REQUIRED`). The machine's coordinator may do this, and so
|
|
1028
|
+
may that session under its own agent, for a lane held by the same person.
|
|
1029
|
+
Dev fences the dead run, starts a fresh one and moves the lane's issue claims.
|
|
1030
|
+
Change sets, their file locks and the old agent's other claims move too, unless
|
|
1031
|
+
that agent has another active lane; then they stay and are listed. Move one
|
|
1032
|
+
with `figma transfer CS --to LANE --reason TEXT`.
|
|
1033
|
+
|
|
978
1034
|
`coordinator start --machine NAME` registers the machine's one watched
|
|
979
1035
|
coordinator run and shows its running lanes, orphaned runs and unclaimed
|
|
980
1036
|
results. A live second coordinator is refused; a coordinator whose heartbeat
|
package/dist/cli.js
CHANGED
|
@@ -112,6 +112,11 @@ Usage: nodii-dev <command> [options] [--json]
|
|
|
112
112
|
doctor [--figma-file KEY] [--json] # preflight: sign-in, agent, permissions, machine, repo, lane slots,
|
|
113
113
|
# local Ollama + pinned Gather model, and optional Figma registration
|
|
114
114
|
agent register --name NAME | agent heartbeat
|
|
115
|
+
agent rename [ID] --name NAME # fix a name; no ID renames this config's agent, an ID
|
|
116
|
+
# may be another of your own agents
|
|
117
|
+
agent list # your agents; * marks this config's agent
|
|
118
|
+
agent disconnect ID # retire one of your agents (there is no delete); its id
|
|
119
|
+
# can't be used again
|
|
115
120
|
issues list|show|create|update|claim|release
|
|
116
121
|
issues comment ISSUE --body TEXT # or --body-file FILE; issues update --comment TEXT|--comment-file FILE adds one too
|
|
117
122
|
issues transition ISSUE --to STATUS [--reason TEXT] [--dev-check REF]
|
|
@@ -263,6 +268,16 @@ Usage: nodii-dev <command> [options] [--json]
|
|
|
263
268
|
# its last death; the reason is kept on the new run. Any resume is
|
|
264
269
|
# refused (LANE_PROCESS_LIVE) while the lane has a running run or a
|
|
265
270
|
# fresh lane-agent heartbeat since the death: one process per lane
|
|
271
|
+
lane resume --host-lost [--min-free-gb N] [--stagger-seconds N]
|
|
272
|
+
# coordinator, after a reboot: resume every host_lost lane on this machine
|
|
273
|
+
# in priority order under its own key, agent, worktree and branch. No
|
|
274
|
+
# amendment or override. Stops at the memory floor (default 4 GiB); run
|
|
275
|
+
# it again to carry on
|
|
276
|
+
lane transfer <key> --reason TEXT [--to-agent ID]
|
|
277
|
+
# move a host_lost lane to the recovering agent (this config's, or ID), which
|
|
278
|
+
# must be a fresh agent named lane-<key> on the same machine: a fresh run,
|
|
279
|
+
# its claims, change sets and file locks. The lane keeps its key, history,
|
|
280
|
+
# worktree and branch; no identity is reused
|
|
266
281
|
lane review <key> --file REVIEW.json # base/head, outcome and clause-cited findings
|
|
267
282
|
lane review <key> --not-required --decision DEC-nnnn|--question ID|--quote TEXT --at ISO-TIME
|
|
268
283
|
# no review needed for this diff: cites the ruling Dev validates (hub-58)
|
|
@@ -692,7 +707,10 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
692
707
|
const agent = c.agentId ? (await devRequest("GET", `/api/v1/agents/${encode(c.agentId)}`)).data : null;
|
|
693
708
|
return emit({ data: { person: c.person, app: c.clientId, installation: c.installationId, edge: c.edgeUrl, agent } }, json);
|
|
694
709
|
}
|
|
695
|
-
const emitCommand = async (result) =>
|
|
710
|
+
const emitCommand = async (result) => {
|
|
711
|
+
emit(result.payload, json, result.human);
|
|
712
|
+
if (result.exitCode) process.exitCode = result.exitCode;
|
|
713
|
+
};
|
|
696
714
|
if (command === "setup") return emitCommand(await setupCommand(f));
|
|
697
715
|
if (command === "doctor") {
|
|
698
716
|
if (action) throw new CliError("USAGE", `doctor takes no arguments, got: ${[action, ...rest].join(" ")}`, 2);
|
|
@@ -865,6 +883,61 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
865
883
|
json,
|
|
866
884
|
"Heartbeat recorded.",
|
|
867
885
|
);
|
|
886
|
+
// Dev admits another agent only when it belongs to the same person, so a
|
|
887
|
+
// typo'd or stale agent whose credential is gone can still be fixed.
|
|
888
|
+
if (action === "rename") {
|
|
889
|
+
const id = rest[0] ?? c.agentId;
|
|
890
|
+
if (!id)
|
|
891
|
+
throw new CliError(
|
|
892
|
+
"USAGE",
|
|
893
|
+
"agent rename needs an agent ID, or a registered agent in this config",
|
|
894
|
+
2,
|
|
895
|
+
);
|
|
896
|
+
const result = await devRequest(
|
|
897
|
+
"PUT",
|
|
898
|
+
`/api/v1/agents/${encode(id)}/name`,
|
|
899
|
+
{ name: requireFlag(f, "name") },
|
|
900
|
+
);
|
|
901
|
+
return emit(result, json, `Renamed ${result.data.id} to ${result.data.name}.`);
|
|
902
|
+
}
|
|
903
|
+
if (action === "list")
|
|
904
|
+
return emit(
|
|
905
|
+
await devRequest("GET", "/api/v1/agents"),
|
|
906
|
+
json,
|
|
907
|
+
(p) =>
|
|
908
|
+
p.data
|
|
909
|
+
.map(
|
|
910
|
+
(a) =>
|
|
911
|
+
`${a.id === c.agentId ? "*" : " "} ${a.id}\t${a.status}\t${a.name}`,
|
|
912
|
+
)
|
|
913
|
+
.join("\n") || "No agents.",
|
|
914
|
+
);
|
|
915
|
+
if (action === "disconnect") {
|
|
916
|
+
const id = rest[0];
|
|
917
|
+
if (!id)
|
|
918
|
+
throw new CliError(
|
|
919
|
+
"USAGE",
|
|
920
|
+
"agent disconnect needs the agent ID (see `nodii-dev agent list`)",
|
|
921
|
+
2,
|
|
922
|
+
);
|
|
923
|
+
const result = await devRequest(
|
|
924
|
+
"POST",
|
|
925
|
+
`/api/v1/agents/${encode(id)}/disconnect`,
|
|
926
|
+
{},
|
|
927
|
+
);
|
|
928
|
+
// A disconnected agent can't call again: drop it from this config so
|
|
929
|
+
// the next step is a fresh registration, not a refused request.
|
|
930
|
+
if (id === c.agentId) {
|
|
931
|
+
const { agentId: _retired, ...signedIn } = c;
|
|
932
|
+
await writeConfig(signedIn);
|
|
933
|
+
return emit(
|
|
934
|
+
result,
|
|
935
|
+
json,
|
|
936
|
+
`Disconnected ${id}, this config's agent. Run \`nodii-dev agent register --name NAME\` next.`,
|
|
937
|
+
);
|
|
938
|
+
}
|
|
939
|
+
return emit(result, json, `Disconnected ${result.data.name} (${id}).`);
|
|
940
|
+
}
|
|
868
941
|
}
|
|
869
942
|
if (command === "issues") return issues(action, rest, f, json);
|
|
870
943
|
if (command === "inbox") {
|
|
@@ -1102,6 +1175,16 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
1102
1175
|
json,
|
|
1103
1176
|
);
|
|
1104
1177
|
}
|
|
1178
|
+
if (action === "transfer") {
|
|
1179
|
+
const reason = requireFlag(f, "reason");
|
|
1180
|
+
const to = requireFlag(f, "to");
|
|
1181
|
+
const toAgentId = (await devRequest("GET", `/api/v1/lanes/${encode(to)}`)).data.agentId;
|
|
1182
|
+
return emit(
|
|
1183
|
+
await devRequest("POST", `/api/v1/design/change-sets/${encode(rest[0])}/transfer`, { toAgentId, reason }),
|
|
1184
|
+
json,
|
|
1185
|
+
`${rest[0]}: moved to lane ${to}'s agent ${toAgentId}.`,
|
|
1186
|
+
);
|
|
1187
|
+
}
|
|
1105
1188
|
if (action === "withdraw")
|
|
1106
1189
|
return emit(await figmaWithdraw(rest[0]), json, (p) => `Withdrew ${rest[0]}; it is back in ${p.data?.state ?? "editing"}.`);
|
|
1107
1190
|
if (action === "resubmit")
|
package/dist/core.js
CHANGED
|
@@ -4,7 +4,7 @@ import { chmod, mkdir, readFile, rm, writeFile } from "node:fs/promises";
|
|
|
4
4
|
import { homedir, platform } from "node:os";
|
|
5
5
|
import { dirname, join } from "node:path";
|
|
6
6
|
|
|
7
|
-
export const VERSION = "0.6.
|
|
7
|
+
export const VERSION = "0.6.63";
|
|
8
8
|
export const configPath = () =>
|
|
9
9
|
process.env.NODII_DEV_CONFIG_PATH ??
|
|
10
10
|
join(homedir(), ".config/nodii-dev/config.json");
|