agent-yes 1.226.1 → 1.227.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.
- package/dist/{SUPPORTED_CLIS-xM8S6xqo.js → SUPPORTED_CLIS-CFd1V2O5.js} +2 -2
- package/dist/SUPPORTED_CLIS-CJiLdm01.js +11 -0
- package/dist/{agent-yes.config-DmW_TVFI.js → agent-yes.config-0G11aPWe.js} +2 -2
- package/dist/{agentShare-DSYm87vH.js → agentShare-C_rydTfo.js} +7 -7
- package/dist/{callback-DlzoC3fU.js → callback-BV3AhWeB.js} +5 -5
- package/dist/callback-BgWZmpqC.js +12 -0
- package/dist/{callbackCore-DSxbO_6a.js → callbackCore-B3DNe_SP.js} +1 -1
- package/dist/{callbackCore-CgnOT1Cp.js → callbackCore-BlNdDILy.js} +1 -1
- package/dist/cli.js +9 -9
- package/dist/{configShared-nnIwDYY-.js → configShared-YKfS6NMe.js} +1 -1
- package/dist/{cwdConflictWarn-CnxkLs7T.js → cwdConflictWarn-CJZRp4S0.js} +1 -1
- package/dist/{e2e-D5jaSHyY.js → e2e-DB7BDdEA.js} +1 -1
- package/dist/{expose-CKWXAkzK.js → expose-GWRXTGpj.js} +1 -1
- package/dist/{forkNested-DJ2QzBsc.js → forkNested-BWdv2mXC.js} +1 -1
- package/dist/index.js +3 -4
- package/dist/{nodeRuntime-CR0NwnnO.js → nodeRuntime-CgXWHe9p.js} +1 -1
- package/dist/{notifyDaemon-4qxS_FjO.js → notifyDaemon-CyLvaAwc.js} +6 -6
- package/dist/{openBrowser-D9VVE6cq.js → openBrowser-CSfI8zCG.js} +1 -1
- package/dist/{remotes-DZ_G2wkM.js → remotes-BCgowsiu.js} +3 -3
- package/dist/{remotes-BtXom7Rp.js → remotes-ZqD0FHl_.js} +3 -3
- package/dist/{rustBinary-KhrcXvB6.js → rustBinary-DHgMI1uK.js} +2 -2
- package/dist/{schedule-HHBT6eGE.js → schedule-0p4V_khb.js} +7 -7
- package/dist/{serve-BeHHkDIn.js → serve-C2KCUxTP.js} +29 -29
- package/dist/{setup-nAQJffmr.js → setup-CCKS4rtW.js} +3 -3
- package/dist/{share-BwEUEHfy.js → share-CrvxZO7o.js} +2 -2
- package/dist/{share-B7VP4_UF.js → share-ieE7D0C1.js} +2 -2
- package/dist/{spawnGate-CfcpmQmk.js → spawnGate-CIC7b7nm.js} +1 -1
- package/dist/{spawnGate-ChYCj6Dm.js → spawnGate-CeFYH-Ib.js} +2 -2
- package/dist/{subcommands-DYeJJ2Rh.js → subcommands-CsVEI376.js} +5 -5
- package/dist/{subcommands-D8zJxifk.js → subcommands-FTkZkqKy.js} +15 -15
- package/dist/{todoAutomation-fxtfT_44.js → todoAutomation-Cwnh4aWo.js} +300 -4
- package/dist/todoCli-6v1CYdxN.js +427 -0
- package/dist/{tray-BZqJtEmL.js → tray-DBt8X-Qj.js} +1 -1
- package/dist/{ts-yPc1x2-7.js → ts-CT75CpeM.js} +3 -3
- package/dist/{versionChecker-8h_rjT-C.js → versionChecker-Bd09mqkZ.js} +2 -2
- package/dist/{webrtcLink-DknpJQ0y.js → webrtcLink-CjckgIZe.js} +2 -2
- package/dist/{webrtcRemote-C974zjSt.js → webrtcRemote-BMzEt9Cp.js} +3 -3
- package/dist/{workspaceConfig-BRl-GwSN.js → workspaceConfig-De5tgjeO.js} +1 -1
- package/dist/{ws-YCNt3rNz.js → ws-B4zHUwc6.js} +7 -7
- package/package.json +1 -1
- package/ts/todoCli.spec.ts +80 -5
- package/ts/todoCli.ts +471 -336
- package/ts/todoStore.spec.ts +58 -0
- package/ts/todoStore.ts +42 -0
- package/dist/SUPPORTED_CLIS-C5vBin1r.js +0 -11
- package/dist/callback-BmgFE-2j.js +0 -12
- package/dist/todoCli-D8bL164c.js +0 -336
- package/dist/todoDigest-DSTG9ksk.js +0 -284
- package/dist/todoDigest-gKP1XibO.js +0 -3
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
import "./logger-CDIsZ-Pp.js";
|
|
2
|
+
import "./JsonlStore-Bm5Nj6v_.js";
|
|
3
|
+
import { i as readGlobalPids } from "./globalPidIndex-CoNr7tS8.js";
|
|
4
|
+
import { _ as isKnownKind, a as renderTree, d as openStore, i as renderDigest, l as CycleError, n as buildTreeJSON, o as unblockedTasks, p as LIFECYCLES, s as describeBlock, t as reconcileTodos } from "./todoAutomation-Cwnh4aWo.js";
|
|
5
|
+
import yargs from "yargs";
|
|
6
|
+
|
|
7
|
+
//#region ts/todoCli.ts
|
|
8
|
+
/**
|
|
9
|
+
* `ay todo <verb>` — CLI surface for the lifecycle engine (`todoStore.ts`),
|
|
10
|
+
* typed blocks (`todoBlock.ts`), and read-side views (`todoDigest.ts`).
|
|
11
|
+
*
|
|
12
|
+
* Registered from `ts/subcommands.ts` the same way larger subsystems like
|
|
13
|
+
* `serve`/`schedule`/`expose` are: a lazy `case "todo":` import into
|
|
14
|
+
* `runTodoSubcommand`, so this file (and everything it pulls in) is only
|
|
15
|
+
* loaded when `ay todo ...` is actually invoked.
|
|
16
|
+
*
|
|
17
|
+
* Store location: `--root <dir>` (default: current working directory) is
|
|
18
|
+
* where `.agent-yes/todos.jsonl` lives, mirroring `PidStore`'s own
|
|
19
|
+
* `<workingDir>/.agent-yes/...` convention. This module has no notion of any
|
|
20
|
+
* particular consuming project's directory-resolution rules (e.g. "find the
|
|
21
|
+
* monorepo root") — a project wanting that behavior supplies it by always
|
|
22
|
+
* invoking with an explicit `--root`, or by calling `openStore()` as a
|
|
23
|
+
* library from its own code instead of through this CLI.
|
|
24
|
+
*
|
|
25
|
+
* Argument parsing: a real yargs COMMAND TREE — one `yargs(argv)` instance
|
|
26
|
+
* with a `CommandModule` per verb registered via `.command()`, `--root`/
|
|
27
|
+
* `--format` declared once as `global: true` options on that same instance —
|
|
28
|
+
* matching the pattern `tools/symval-dev-cli`'s `sv` CLI already uses
|
|
29
|
+
* (`todoCommand`/`lsCmd` etc. in that repo's `commands/todo.ts`), per taku's
|
|
30
|
+
* explicit feedback that this gives better help behavior for free: a real
|
|
31
|
+
* `.command()` tree yields an auto-generated `ay todo --help` listing every
|
|
32
|
+
* verb with its description, and per-verb `--help`/usage, neither of which
|
|
33
|
+
* a hand-rolled switch dispatch provides out of the box.
|
|
34
|
+
*
|
|
35
|
+
* An EARLIER version of this file used a hand-rolled switch with a separate
|
|
36
|
+
* `yargs(args)` parse PER verb (declaring `--root`/`--format` on each one via
|
|
37
|
+
* a shared `commonOptions()` helper) specifically to avoid an even earlier
|
|
38
|
+
* bug where a single outer parse swallowed every verb's own flags. That
|
|
39
|
+
* workaround is no longer needed: the swallowing bug was a property of an
|
|
40
|
+
* outer parse with NO knowledge of subcommand-specific options, not of
|
|
41
|
+
* single-parse command trees in general — a genuine yargs `.command()` tree
|
|
42
|
+
* (this file, now) natively supports `global: true` options that behave
|
|
43
|
+
* correctly regardless of position, which is exactly the position-
|
|
44
|
+
* dependence class of bug the per-verb-parse workaround existed to avoid in
|
|
45
|
+
* the first place.
|
|
46
|
+
*/
|
|
47
|
+
function fail(message) {
|
|
48
|
+
throw new Error(message);
|
|
49
|
+
}
|
|
50
|
+
function parseKind(raw) {
|
|
51
|
+
if (!raw) fail(`--kind is required (one of: ${Object.keys(LIFECYCLES).join(", ")})`);
|
|
52
|
+
if (!isKnownKind(raw)) fail(`unknown kind "${raw}" (one of: ${Object.keys(LIFECYCLES).join(", ")})`);
|
|
53
|
+
return raw;
|
|
54
|
+
}
|
|
55
|
+
function renderRecord(t) {
|
|
56
|
+
const lines = [
|
|
57
|
+
`${t._id} [${t.state}] ${t.summary}`,
|
|
58
|
+
`kind: ${t.kind}${t.targetTier ? ` tier:${t.targetTier}` : ""}`,
|
|
59
|
+
...t.owner ? [`owner: ${t.owner}`] : [],
|
|
60
|
+
...t.acceptanceCriteria ? [`acceptanceCriteria: ${t.acceptanceCriteria}`] : [],
|
|
61
|
+
...t.block ? [`block: ${describeBlock(t.block)}`] : [],
|
|
62
|
+
...t.blockedBy.length ? [`blockedBy: ${t.blockedBy.join(", ")}`] : [],
|
|
63
|
+
...t.tags.length ? [`tags: ${t.tags.join(", ")}`] : [],
|
|
64
|
+
...t.satisfiedGates.length ? [`satisfiedGates: ${t.satisfiedGates.join(", ")}`] : [],
|
|
65
|
+
...t.verifyEvidence.length ? [`evidence: ${t.verifyEvidence.map((e) => `${e.gate} by ${e.validator}${e.link ? ` (${e.link})` : ""}${e.acceptanceCriteriaAtApproval ? ` [criteria: ${e.acceptanceCriteriaAtApproval}]` : ""}`).join("; ")}`] : [],
|
|
66
|
+
`created: ${t.createdAt}`,
|
|
67
|
+
`updated: ${t.updatedAt}`
|
|
68
|
+
];
|
|
69
|
+
if (t.description) lines.push("", t.description);
|
|
70
|
+
return lines.join("\n");
|
|
71
|
+
}
|
|
72
|
+
function renderList(tasks) {
|
|
73
|
+
if (tasks.length === 0) return "(no tasks match)";
|
|
74
|
+
const rows = tasks.map((t) => [
|
|
75
|
+
t._id,
|
|
76
|
+
t.state,
|
|
77
|
+
t.kind,
|
|
78
|
+
t.owner ?? "",
|
|
79
|
+
t.summary
|
|
80
|
+
]);
|
|
81
|
+
const header = [
|
|
82
|
+
"ID",
|
|
83
|
+
"STATE",
|
|
84
|
+
"KIND",
|
|
85
|
+
"OWNER",
|
|
86
|
+
"SUMMARY"
|
|
87
|
+
];
|
|
88
|
+
const widths = header.map((h, i) => Math.max(h.length, ...rows.map((r) => r[i].length)));
|
|
89
|
+
const line = (xs) => xs.map((x, i) => x.padEnd(widths[i])).join(" ").trimEnd();
|
|
90
|
+
return [line(header), ...rows.map(line)].join("\n");
|
|
91
|
+
}
|
|
92
|
+
function emit(opts, obj, human) {
|
|
93
|
+
process.stdout.write((opts.format === "json" ? JSON.stringify(obj, null, 2) : human) + "\n");
|
|
94
|
+
}
|
|
95
|
+
const newCmd = {
|
|
96
|
+
command: "new <summary..>",
|
|
97
|
+
describe: "create a new task",
|
|
98
|
+
builder: (y) => y.positional("summary", {
|
|
99
|
+
type: "string",
|
|
100
|
+
array: true,
|
|
101
|
+
demandOption: true,
|
|
102
|
+
describe: "task summary (unquoted words are joined — quote if it must contain a literal --flag)"
|
|
103
|
+
}).option("kind", {
|
|
104
|
+
type: "string",
|
|
105
|
+
describe: `one of: ${Object.keys(LIFECYCLES).join(", ")}`
|
|
106
|
+
}).option("description", { type: "string" }).option("tier", {
|
|
107
|
+
type: "string",
|
|
108
|
+
describe: "targetTier, e.g. canary-done / shipped-done"
|
|
109
|
+
}).option("acceptance-criteria", {
|
|
110
|
+
type: "string",
|
|
111
|
+
describe: "definition of done for this task — what an independent validator should check before approving/verifying it"
|
|
112
|
+
}).option("owner", { type: "string" }).option("tag", {
|
|
113
|
+
type: "string",
|
|
114
|
+
array: true
|
|
115
|
+
}).option("dep", {
|
|
116
|
+
type: "string",
|
|
117
|
+
array: true,
|
|
118
|
+
describe: "blocker task id(s)"
|
|
119
|
+
}),
|
|
120
|
+
handler: async (argv) => {
|
|
121
|
+
const store = await openStore(argv.root);
|
|
122
|
+
const summary = argv.summary.map(String).join(" ");
|
|
123
|
+
if (!summary) fail("usage: ay todo new <summary> --kind <kind> [--description ...] [--tier ...] [--acceptance-criteria ...] [--owner ...] [--tag t]... [--dep id]...");
|
|
124
|
+
const rec = await store.create({
|
|
125
|
+
summary,
|
|
126
|
+
kind: parseKind(argv.kind),
|
|
127
|
+
description: argv.description,
|
|
128
|
+
targetTier: argv.tier,
|
|
129
|
+
acceptanceCriteria: argv["acceptance-criteria"],
|
|
130
|
+
owner: argv.owner,
|
|
131
|
+
tags: argv.tag ?? [],
|
|
132
|
+
blockedBy: argv.dep ?? []
|
|
133
|
+
});
|
|
134
|
+
emit(argv, rec, `created ${rec._id}\n${renderRecord(rec)}`);
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
const lsCmd = {
|
|
138
|
+
command: "ls",
|
|
139
|
+
describe: "list tasks (filter by --kind, --state, --owner, --tag, --blocked)",
|
|
140
|
+
builder: (y) => y.option("kind", { type: "string" }).option("state", { type: "string" }).option("owner", { type: "string" }).option("tag", { type: "string" }).option("blocked", {
|
|
141
|
+
type: "boolean",
|
|
142
|
+
default: false
|
|
143
|
+
}),
|
|
144
|
+
handler: async (argv) => {
|
|
145
|
+
const tasks = (await openStore(argv.root)).list({
|
|
146
|
+
kind: argv.kind ? parseKind(argv.kind) : void 0,
|
|
147
|
+
state: argv.state,
|
|
148
|
+
owner: argv.owner,
|
|
149
|
+
tag: argv.tag,
|
|
150
|
+
blocked: argv.blocked
|
|
151
|
+
});
|
|
152
|
+
emit(argv, tasks, renderList(tasks));
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
const getCmd = {
|
|
156
|
+
command: "get <id>",
|
|
157
|
+
describe: "show one task",
|
|
158
|
+
builder: (y) => y.positional("id", {
|
|
159
|
+
type: "string",
|
|
160
|
+
demandOption: true
|
|
161
|
+
}),
|
|
162
|
+
handler: async (argv) => {
|
|
163
|
+
const rec = (await openStore(argv.root)).get(argv.id);
|
|
164
|
+
if (!rec) fail(`no such task: ${argv.id}`);
|
|
165
|
+
emit(argv, rec, renderRecord(rec));
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
const transitionCmd = {
|
|
169
|
+
command: "transition <id> <toState>",
|
|
170
|
+
describe: "move a task to a new state (fails naming the missing gate if one is required)",
|
|
171
|
+
builder: (y) => y.positional("id", {
|
|
172
|
+
type: "string",
|
|
173
|
+
demandOption: true
|
|
174
|
+
}).positional("toState", {
|
|
175
|
+
type: "string",
|
|
176
|
+
demandOption: true
|
|
177
|
+
}),
|
|
178
|
+
handler: async (argv) => {
|
|
179
|
+
const rec = await (await openStore(argv.root)).transition(argv.id, argv.toState);
|
|
180
|
+
emit(argv, rec, `transitioned ${rec._id} -> ${rec.state}\n${renderRecord(rec)}`);
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
const approveCmd = {
|
|
184
|
+
command: "approve <id> <gate> <validatorIdentity>",
|
|
185
|
+
describe: "manually satisfy a non-registered gate as a DIFFERENT identity from the task's owner",
|
|
186
|
+
builder: (y) => y.positional("id", {
|
|
187
|
+
type: "string",
|
|
188
|
+
demandOption: true
|
|
189
|
+
}).positional("gate", {
|
|
190
|
+
type: "string",
|
|
191
|
+
demandOption: true
|
|
192
|
+
}).positional("validatorIdentity", {
|
|
193
|
+
type: "string",
|
|
194
|
+
demandOption: true
|
|
195
|
+
}).option("note", { type: "string" }).option("link", { type: "string" }),
|
|
196
|
+
handler: async (argv) => {
|
|
197
|
+
const rec = await (await openStore(argv.root)).approve(argv.id, argv.gate, argv.validatorIdentity, {
|
|
198
|
+
note: argv.note,
|
|
199
|
+
link: argv.link
|
|
200
|
+
});
|
|
201
|
+
emit(argv, rec, `approved "${argv.gate}" on ${rec._id} (validator: ${argv.validatorIdentity})\n${renderRecord(rec)}`);
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
const verifyCmd = {
|
|
205
|
+
command: "verify <id> [gate]",
|
|
206
|
+
describe: "re-run a registered gate for a task and apply its result",
|
|
207
|
+
builder: (y) => y.positional("id", {
|
|
208
|
+
type: "string",
|
|
209
|
+
demandOption: true
|
|
210
|
+
}).positional("gate", { type: "string" }),
|
|
211
|
+
handler: async (argv) => {
|
|
212
|
+
const rec = await (await openStore(argv.root)).verify(argv.id, argv.gate || void 0);
|
|
213
|
+
emit(argv, rec, `verified ${rec._id} -> ${rec.state}\n${renderRecord(rec)}`);
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
const BLOCK_TYPES = [
|
|
217
|
+
"blocked-by-task",
|
|
218
|
+
"blocked-by-human",
|
|
219
|
+
"blocked-by-external",
|
|
220
|
+
"waiting-on-agent"
|
|
221
|
+
];
|
|
222
|
+
const blockCmd = {
|
|
223
|
+
command: "block <id>",
|
|
224
|
+
describe: "mark a task blocked (--type blocked-by-task|blocked-by-human|blocked-by-external|waiting-on-agent)",
|
|
225
|
+
builder: (y) => y.positional("id", {
|
|
226
|
+
type: "string",
|
|
227
|
+
demandOption: true
|
|
228
|
+
}).option("type", {
|
|
229
|
+
type: "string",
|
|
230
|
+
choices: BLOCK_TYPES
|
|
231
|
+
}).option("task", {
|
|
232
|
+
type: "string",
|
|
233
|
+
describe: "required for --type blocked-by-task"
|
|
234
|
+
}).option("who", {
|
|
235
|
+
type: "string",
|
|
236
|
+
describe: "required for --type blocked-by-human"
|
|
237
|
+
}).option("question", { type: "string" }).option("options", {
|
|
238
|
+
type: "string",
|
|
239
|
+
array: true
|
|
240
|
+
}).option("signal", {
|
|
241
|
+
type: "string",
|
|
242
|
+
describe: "required for --type blocked-by-external"
|
|
243
|
+
}).option("agent", {
|
|
244
|
+
type: "string",
|
|
245
|
+
describe: "required for --type waiting-on-agent"
|
|
246
|
+
}),
|
|
247
|
+
handler: async (argv) => {
|
|
248
|
+
if (!argv.type) fail("usage: ay todo block <id> --type <blocked-by-task|blocked-by-human|blocked-by-external|waiting-on-agent> ...");
|
|
249
|
+
let block;
|
|
250
|
+
switch (argv.type) {
|
|
251
|
+
case "blocked-by-task":
|
|
252
|
+
if (!argv.task) fail("--task <id> is required for --type blocked-by-task");
|
|
253
|
+
block = {
|
|
254
|
+
type: "blocked-by-task",
|
|
255
|
+
taskId: argv.task
|
|
256
|
+
};
|
|
257
|
+
break;
|
|
258
|
+
case "blocked-by-human":
|
|
259
|
+
if (!argv.who) fail("--who <name> is required for --type blocked-by-human");
|
|
260
|
+
block = {
|
|
261
|
+
type: "blocked-by-human",
|
|
262
|
+
who: argv.who,
|
|
263
|
+
question: argv.question,
|
|
264
|
+
options: argv.options
|
|
265
|
+
};
|
|
266
|
+
break;
|
|
267
|
+
case "blocked-by-external":
|
|
268
|
+
if (!argv.signal) fail("--signal <name> is required for --type blocked-by-external");
|
|
269
|
+
block = {
|
|
270
|
+
type: "blocked-by-external",
|
|
271
|
+
signal: argv.signal
|
|
272
|
+
};
|
|
273
|
+
break;
|
|
274
|
+
case "waiting-on-agent":
|
|
275
|
+
if (!argv.agent) fail("--agent <id> is required for --type waiting-on-agent");
|
|
276
|
+
block = {
|
|
277
|
+
type: "waiting-on-agent",
|
|
278
|
+
agentId: argv.agent
|
|
279
|
+
};
|
|
280
|
+
break;
|
|
281
|
+
}
|
|
282
|
+
const rec = await (await openStore(argv.root)).setBlock(argv.id, block);
|
|
283
|
+
emit(argv, rec, `blocked ${rec._id}: ${describeBlock(block)}\n${renderRecord(rec)}`);
|
|
284
|
+
}
|
|
285
|
+
};
|
|
286
|
+
const unblockCmd = {
|
|
287
|
+
command: "unblock <id>",
|
|
288
|
+
describe: "clear a task's block (does not touch blockedBy — see `dep`)",
|
|
289
|
+
builder: (y) => y.positional("id", {
|
|
290
|
+
type: "string",
|
|
291
|
+
demandOption: true
|
|
292
|
+
}),
|
|
293
|
+
handler: async (argv) => {
|
|
294
|
+
const rec = await (await openStore(argv.root)).setBlock(argv.id, null);
|
|
295
|
+
emit(argv, rec, `unblocked ${rec._id}\n${renderRecord(rec)}`);
|
|
296
|
+
}
|
|
297
|
+
};
|
|
298
|
+
const setCriteriaCmd = {
|
|
299
|
+
command: "set-criteria <id> <text..>",
|
|
300
|
+
describe: "set or update a task's acceptance criteria (definition of done)",
|
|
301
|
+
builder: (y) => y.positional("id", {
|
|
302
|
+
type: "string",
|
|
303
|
+
demandOption: true
|
|
304
|
+
}).positional("text", {
|
|
305
|
+
type: "string",
|
|
306
|
+
array: true,
|
|
307
|
+
demandOption: true
|
|
308
|
+
}),
|
|
309
|
+
handler: async (argv) => {
|
|
310
|
+
const store = await openStore(argv.root);
|
|
311
|
+
const text = argv.text.map(String).join(" ");
|
|
312
|
+
const rec = await store.setAcceptanceCriteria(argv.id, text);
|
|
313
|
+
emit(argv, rec, `set acceptance criteria on ${rec._id}\n${renderRecord(rec)}`);
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
const depCmd = {
|
|
317
|
+
command: "dep <verb> <id> <blockerId>",
|
|
318
|
+
describe: "manage task dependencies: dep add T2 T1 (T2 waits for T1) / dep rm T2 T1. Cycles are rejected",
|
|
319
|
+
builder: (y) => y.positional("verb", {
|
|
320
|
+
type: "string",
|
|
321
|
+
choices: ["add", "rm"],
|
|
322
|
+
demandOption: true
|
|
323
|
+
}).positional("id", {
|
|
324
|
+
type: "string",
|
|
325
|
+
demandOption: true,
|
|
326
|
+
describe: "the task that is blocked"
|
|
327
|
+
}).positional("blockerId", {
|
|
328
|
+
type: "string",
|
|
329
|
+
demandOption: true,
|
|
330
|
+
describe: "task id it waits for"
|
|
331
|
+
}),
|
|
332
|
+
handler: async (argv) => {
|
|
333
|
+
const store = await openStore(argv.root);
|
|
334
|
+
try {
|
|
335
|
+
const rec = argv.verb === "add" ? await store.addDep(argv.id, argv.blockerId) : await store.rmDep(argv.id, argv.blockerId);
|
|
336
|
+
emit(argv, rec, `${argv.verb === "add" ? "added" : "removed"} dep ${argv.blockerId} on ${rec._id}\n${renderRecord(rec)}`);
|
|
337
|
+
} catch (err) {
|
|
338
|
+
if (err instanceof CycleError) fail(err.message);
|
|
339
|
+
throw err;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
};
|
|
343
|
+
const treeCmd = {
|
|
344
|
+
command: "tree [id]",
|
|
345
|
+
describe: "dependency tree (children = what a task waits for). Default: all dependency roots",
|
|
346
|
+
builder: (y) => y.positional("id", {
|
|
347
|
+
type: "string",
|
|
348
|
+
describe: "root task id (default: all roots)"
|
|
349
|
+
}),
|
|
350
|
+
handler: async (argv) => {
|
|
351
|
+
const tasks = (await openStore(argv.root)).all();
|
|
352
|
+
if (argv.format === "json") emit(argv, buildTreeJSON(tasks, argv.id), "");
|
|
353
|
+
else process.stdout.write(renderTree(tasks, argv.id) + "\n");
|
|
354
|
+
}
|
|
355
|
+
};
|
|
356
|
+
const digestCmd = {
|
|
357
|
+
command: "digest",
|
|
358
|
+
describe: "per-tag board: state counts, blockers, unblocked tasks",
|
|
359
|
+
handler: async (argv) => {
|
|
360
|
+
const tasks = (await openStore(argv.root)).all();
|
|
361
|
+
if (argv.format === "json") emit(argv, {
|
|
362
|
+
tasks,
|
|
363
|
+
unblocked: unblockedTasks(tasks).map((t) => t._id)
|
|
364
|
+
}, "");
|
|
365
|
+
else process.stdout.write(renderDigest(tasks) + "\n");
|
|
366
|
+
}
|
|
367
|
+
};
|
|
368
|
+
const reconcileCmd = {
|
|
369
|
+
command: "reconcile",
|
|
370
|
+
describe: "apply automation: orphan dead-owned tasks, clear stale waiting-on-agent blocks, auto-verify, report unblocked tasks",
|
|
371
|
+
handler: async (argv) => {
|
|
372
|
+
const store = await openStore(argv.root);
|
|
373
|
+
const agents = await readGlobalPids({ liveOnly: false });
|
|
374
|
+
const registeredGates = new Set(store.registeredGateNames());
|
|
375
|
+
const actions = reconcileTodos(store.all(), agents, registeredGates);
|
|
376
|
+
const applied = [];
|
|
377
|
+
for (const action of actions) try {
|
|
378
|
+
switch (action.type) {
|
|
379
|
+
case "orphan":
|
|
380
|
+
await store.markOrphaned(action.taskId, action.expectedOwner, action.candidates);
|
|
381
|
+
applied.push(`orphaned ${action.taskId} (was ${action.from}) — reassign candidates: ${action.candidates.join(", ") || "(none idle)"}`);
|
|
382
|
+
break;
|
|
383
|
+
case "clear-waiting-on-agent":
|
|
384
|
+
await store.clearWaitingOnAgentBlock(action.taskId, action.expectedAgentId);
|
|
385
|
+
applied.push(`cleared waiting-on-agent block on ${action.taskId} (agent ${action.expectedAgentId})`);
|
|
386
|
+
break;
|
|
387
|
+
case "auto-verify": {
|
|
388
|
+
const result = await store.verify(action.taskId);
|
|
389
|
+
applied.push(`auto-verified ${action.taskId} -> ${result.state}`);
|
|
390
|
+
break;
|
|
391
|
+
}
|
|
392
|
+
case "notify-unblocked":
|
|
393
|
+
applied.push(`${action.taskId} is now unblocked (owner: ${action.owner})`);
|
|
394
|
+
break;
|
|
395
|
+
}
|
|
396
|
+
} catch (err) {
|
|
397
|
+
applied.push(`skipped ${action.type} on ${action.taskId}: ${err instanceof Error ? err.message : String(err)}`);
|
|
398
|
+
}
|
|
399
|
+
emit(argv, {
|
|
400
|
+
actions,
|
|
401
|
+
applied
|
|
402
|
+
}, applied.length ? applied.join("\n") : "(nothing to reconcile)");
|
|
403
|
+
}
|
|
404
|
+
};
|
|
405
|
+
async function runTodoSubcommand(rest0) {
|
|
406
|
+
await yargs(rest0).scriptName("ay todo").option("root", {
|
|
407
|
+
type: "string",
|
|
408
|
+
default: process.cwd(),
|
|
409
|
+
describe: "project root holding .agent-yes/todos.jsonl",
|
|
410
|
+
global: true
|
|
411
|
+
}).option("format", {
|
|
412
|
+
choices: ["table", "json"],
|
|
413
|
+
default: "table",
|
|
414
|
+
describe: "output format",
|
|
415
|
+
global: true
|
|
416
|
+
}).check((argv) => {
|
|
417
|
+
if (argv.root === "") fail("--root must not be empty");
|
|
418
|
+
return true;
|
|
419
|
+
}).command(newCmd).command(lsCmd).command(getCmd).command(transitionCmd).command(approveCmd).command(verifyCmd).command(setCriteriaCmd).command(blockCmd).command(unblockCmd).command(depCmd).command(treeCmd).command(digestCmd).command(reconcileCmd).demandCommand(1, "unknown \"ay todo\" verb (expected: new/ls/get/transition/approve/verify/set-criteria/block/unblock/dep/tree/digest/reconcile)").strict().help().version(false).exitProcess(false).fail((msg, err) => {
|
|
420
|
+
throw err ?? new Error(msg);
|
|
421
|
+
}).parseAsync();
|
|
422
|
+
return 0;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
//#endregion
|
|
426
|
+
export { runTodoSubcommand };
|
|
427
|
+
//# sourceMappingURL=todoCli-6v1CYdxN.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as logger, t as addTransport } from "./logger-CDIsZ-Pp.js";
|
|
2
|
-
import { r as getInstalledPackage } from "./versionChecker-
|
|
2
|
+
import { r as getInstalledPackage } from "./versionChecker-Bd09mqkZ.js";
|
|
3
3
|
import { t as agentYesHome } from "./agentYesHome-CtHb5b71.js";
|
|
4
4
|
import { i as shouldUseLock, r as releaseLock, t as acquireLock } from "./runningLock-CNMl13dC.js";
|
|
5
5
|
import { i as readGlobalPids } from "./globalPidIndex-CoNr7tS8.js";
|
|
@@ -1160,7 +1160,7 @@ async function notifyWebhook(status, details, cwd = process.cwd()) {
|
|
|
1160
1160
|
|
|
1161
1161
|
//#endregion
|
|
1162
1162
|
//#region ts/index.ts
|
|
1163
|
-
const config = await import("./agent-yes.config-
|
|
1163
|
+
const config = await import("./agent-yes.config-0G11aPWe.js").then((mod) => mod.default || mod);
|
|
1164
1164
|
const CLIS_CONFIG = config.clis;
|
|
1165
1165
|
/**
|
|
1166
1166
|
* Main function to run agent-cli with automatic yes/no responses
|
|
@@ -1919,4 +1919,4 @@ function sleep(ms) {
|
|
|
1919
1919
|
|
|
1920
1920
|
//#endregion
|
|
1921
1921
|
export { CLAUDE_SESSION_PIN_ENV as a, AgentContext as i, agentYes as n, removeControlCharacters as o, config as r, CLIS_CONFIG as t };
|
|
1922
|
-
//# sourceMappingURL=ts-
|
|
1922
|
+
//# sourceMappingURL=ts-CT75CpeM.js.map
|
|
@@ -7,7 +7,7 @@ import { fileURLToPath } from "url";
|
|
|
7
7
|
|
|
8
8
|
//#region package.json
|
|
9
9
|
var name = "agent-yes";
|
|
10
|
-
var version = "1.
|
|
10
|
+
var version = "1.227.0";
|
|
11
11
|
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region ts/versionChecker.ts
|
|
@@ -215,4 +215,4 @@ async function displayVersion() {
|
|
|
215
215
|
|
|
216
216
|
//#endregion
|
|
217
217
|
export { versionString as i, displayVersion as n, getInstalledPackage as r, checkAndAutoUpdate as t };
|
|
218
|
-
//# sourceMappingURL=versionChecker-
|
|
218
|
+
//# sourceMappingURL=versionChecker-Bd09mqkZ.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { u as parseSecret } from "./e2e-
|
|
1
|
+
import { u as parseSecret } from "./e2e-DB7BDdEA.js";
|
|
2
2
|
|
|
3
3
|
//#region ts/webrtcLink.ts
|
|
4
4
|
const SIGNAL_SUBPROTOCOL = "ay-signal-1";
|
|
@@ -42,4 +42,4 @@ function isWebrtcSpec(spec) {
|
|
|
42
42
|
|
|
43
43
|
//#endregion
|
|
44
44
|
export { isWebrtcSpec as n, parseWebrtcLink as r, SIGNAL_SUBPROTOCOL as t };
|
|
45
|
-
//# sourceMappingURL=webrtcLink-
|
|
45
|
+
//# sourceMappingURL=webrtcLink-CjckgIZe.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as computeTranscriptHash, c as open, d as randomHex, f as seal, l as packEnvelope, n as FLAG_CONFIRM, o as deriveAuthToken, p as unpackEnvelope, s as deriveDirKeys } from "./e2e-
|
|
2
|
-
import { n as isWebrtcSpec, r as parseWebrtcLink, t as SIGNAL_SUBPROTOCOL } from "./webrtcLink-
|
|
1
|
+
import { a as computeTranscriptHash, c as open, d as randomHex, f as seal, l as packEnvelope, n as FLAG_CONFIRM, o as deriveAuthToken, p as unpackEnvelope, s as deriveDirKeys } from "./e2e-DB7BDdEA.js";
|
|
2
|
+
import { n as isWebrtcSpec, r as parseWebrtcLink, t as SIGNAL_SUBPROTOCOL } from "./webrtcLink-CjckgIZe.js";
|
|
3
3
|
import { RTCPeerConnection } from "node-datachannel/polyfill";
|
|
4
4
|
|
|
5
5
|
//#region ts/webrtcRemote.ts
|
|
@@ -256,4 +256,4 @@ async function startWebrtcBridge(link) {
|
|
|
256
256
|
|
|
257
257
|
//#endregion
|
|
258
258
|
export { startWebrtcBridge };
|
|
259
|
-
//# sourceMappingURL=webrtcRemote-
|
|
259
|
+
//# sourceMappingURL=webrtcRemote-BMzEt9Cp.js.map
|
|
@@ -193,4 +193,4 @@ function resolveSpawnCwd(input) {
|
|
|
193
193
|
|
|
194
194
|
//#endregion
|
|
195
195
|
export { getSpawnHook as a, hasProvisionHook as c, resolveSpawnCwd as d, setWorkspaceRoot as f, getProvisionRoot as i, hasSpawnHook as l, getMinFreeMb as n, getSpawnWaitMs as o, getProvisionHook as r, getWorkspaceRoot as s, getMaxAgents as t, isProvisionAllowed as u };
|
|
196
|
-
//# sourceMappingURL=workspaceConfig-
|
|
196
|
+
//# sourceMappingURL=workspaceConfig-De5tgjeO.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import "./logger-CDIsZ-Pp.js";
|
|
2
2
|
import "./globalPidIndex-CoNr7tS8.js";
|
|
3
3
|
import "./messageLog-Bb_Ie3Ck.js";
|
|
4
|
-
import "./configShared-
|
|
5
|
-
import { S as listRecords } from "./subcommands-
|
|
6
|
-
import "./e2e-
|
|
7
|
-
import "./webrtcLink-
|
|
8
|
-
import "./remotes-
|
|
9
|
-
import { i as getProvisionRoot } from "./workspaceConfig-
|
|
4
|
+
import "./configShared-YKfS6NMe.js";
|
|
5
|
+
import { S as listRecords } from "./subcommands-FTkZkqKy.js";
|
|
6
|
+
import "./e2e-DB7BDdEA.js";
|
|
7
|
+
import "./webrtcLink-CjckgIZe.js";
|
|
8
|
+
import "./remotes-ZqD0FHl_.js";
|
|
9
|
+
import { i as getProvisionRoot } from "./workspaceConfig-De5tgjeO.js";
|
|
10
10
|
import { existsSync } from "fs";
|
|
11
11
|
import { lstat, opendir } from "fs/promises";
|
|
12
12
|
import path from "path";
|
|
@@ -418,4 +418,4 @@ async function cmdWs(args) {
|
|
|
418
418
|
|
|
419
419
|
//#endregion
|
|
420
420
|
export { WS_JSON_SCHEMA, cmdWs, collectWorkspaces, isPathInside, loadProvision, workspaceStatus };
|
|
421
|
-
//# sourceMappingURL=ws-
|
|
421
|
+
//# sourceMappingURL=ws-B4zHUwc6.js.map
|
package/package.json
CHANGED
package/ts/todoCli.spec.ts
CHANGED
|
@@ -277,11 +277,11 @@ describe("ay todo CLI", () => {
|
|
|
277
277
|
expect(parsed.unblocked).toEqual(["T3"]);
|
|
278
278
|
});
|
|
279
279
|
|
|
280
|
-
it("dep rejects a malformed invocation (missing blockerId, or a verb that isn't add|rm)
|
|
280
|
+
it("dep rejects a malformed invocation (missing blockerId, or a verb that isn't add|rm) via yargs' own positional validation", async () => {
|
|
281
281
|
await run("new", "a", "--kind", "code");
|
|
282
282
|
await run("new", "b", "--kind", "code");
|
|
283
|
-
await expect(run("dep", "add", "T2")).rejects.toThrow(/
|
|
284
|
-
await expect(run("dep", "bogus", "T2", "T1")).rejects.toThrow(/
|
|
283
|
+
await expect(run("dep", "add", "T2")).rejects.toThrow(/not enough non-option arguments/i);
|
|
284
|
+
await expect(run("dep", "bogus", "T2", "T1")).rejects.toThrow(/invalid values/i);
|
|
285
285
|
});
|
|
286
286
|
|
|
287
287
|
it("dep surfaces a non-cycle store error (unknown task id) by rethrowing it, not swallowing it as a cycle", async () => {
|
|
@@ -297,8 +297,83 @@ describe("ay todo CLI", () => {
|
|
|
297
297
|
expect(got.out).toContain("the long form details");
|
|
298
298
|
});
|
|
299
299
|
|
|
300
|
-
it("an unknown verb fails with a clear
|
|
301
|
-
await expect(run("bogus")).rejects.toThrow(/unknown
|
|
300
|
+
it("an unknown verb fails with a clear error from yargs' own command-tree validation", async () => {
|
|
301
|
+
await expect(run("bogus")).rejects.toThrow(/unknown argument: bogus/i);
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
it("no verb at all fails naming every expected one, via demandCommand", async () => {
|
|
305
|
+
await expect(run()).rejects.toThrow(
|
|
306
|
+
/unknown "ay todo" verb.*new\/ls\/get\/transition\/approve\/verify\/set-criteria\/block\/unblock\/dep\/tree\/digest\/reconcile/,
|
|
307
|
+
);
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
it("new --acceptance-criteria stores it, and get renders it; set-criteria updates it later (Milestone 1.5)", async () => {
|
|
311
|
+
const created = await run(
|
|
312
|
+
"new",
|
|
313
|
+
"ship",
|
|
314
|
+
"the",
|
|
315
|
+
"feature",
|
|
316
|
+
"--kind",
|
|
317
|
+
"code",
|
|
318
|
+
"--acceptance-criteria",
|
|
319
|
+
"all tests pass and the feature flag is off by default",
|
|
320
|
+
);
|
|
321
|
+
expect(created.out).toContain(
|
|
322
|
+
"acceptanceCriteria: all tests pass and the feature flag is off by default",
|
|
323
|
+
);
|
|
324
|
+
const updated = await run(
|
|
325
|
+
"set-criteria",
|
|
326
|
+
"T1",
|
|
327
|
+
"all",
|
|
328
|
+
"tests",
|
|
329
|
+
"pass",
|
|
330
|
+
"and",
|
|
331
|
+
"docs",
|
|
332
|
+
"are",
|
|
333
|
+
"updated",
|
|
334
|
+
);
|
|
335
|
+
expect(updated.out).toContain("set acceptance criteria on T1");
|
|
336
|
+
const got = await run("get", "T1");
|
|
337
|
+
expect(got.out).toContain("acceptanceCriteria: all tests pass and docs are updated");
|
|
338
|
+
});
|
|
339
|
+
|
|
340
|
+
it("approve() snapshots acceptanceCriteria into evidence, rendered in get's output", async () => {
|
|
341
|
+
await run(
|
|
342
|
+
"new",
|
|
343
|
+
"x",
|
|
344
|
+
"--kind",
|
|
345
|
+
"doc",
|
|
346
|
+
"--owner",
|
|
347
|
+
"worker",
|
|
348
|
+
"--acceptance-criteria",
|
|
349
|
+
"reviewed by a human",
|
|
350
|
+
);
|
|
351
|
+
await run("transition", "T1", "review");
|
|
352
|
+
await run("approve", "T1", "human-approved", "reviewer");
|
|
353
|
+
const got = await run("get", "T1");
|
|
354
|
+
expect(got.out).toContain("[criteria: reviewed by a human]");
|
|
355
|
+
});
|
|
356
|
+
|
|
357
|
+
it("--help resolves cleanly (exit 0, no throw) — a real yargs command tree auto-generates the verb listing (taku feedback); yargs' own help writer bypasses the stdout mock in this harness, so content is verified manually rather than asserted here", async () => {
|
|
358
|
+
const cap = captureStdout();
|
|
359
|
+
let code: number | undefined;
|
|
360
|
+
try {
|
|
361
|
+
code = await runTodoSubcommand(["--help", "--root", TEST_ROOT]);
|
|
362
|
+
} finally {
|
|
363
|
+
cap.restore();
|
|
364
|
+
}
|
|
365
|
+
expect(code).toBe(0);
|
|
366
|
+
});
|
|
367
|
+
|
|
368
|
+
it("a per-verb --help (e.g. `ay todo ls --help`) also resolves cleanly", async () => {
|
|
369
|
+
const cap = captureStdout();
|
|
370
|
+
let code: number | undefined;
|
|
371
|
+
try {
|
|
372
|
+
code = await runTodoSubcommand(["ls", "--help", "--root", TEST_ROOT]);
|
|
373
|
+
} finally {
|
|
374
|
+
cap.restore();
|
|
375
|
+
}
|
|
376
|
+
expect(code).toBe(0);
|
|
302
377
|
});
|
|
303
378
|
});
|
|
304
379
|
|