@detergent-software/conductor 1.0.0-dev.9 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/CHANGELOG.md +298 -0
  2. package/README.md +277 -24
  3. package/build/brief-cli.js +68 -0
  4. package/build/brief-cli.js.map +1 -0
  5. package/build/brief.js +211 -0
  6. package/build/brief.js.map +1 -0
  7. package/build/broker-cli.js +126 -0
  8. package/build/broker-cli.js.map +1 -0
  9. package/build/broker.js +154 -0
  10. package/build/broker.js.map +1 -0
  11. package/build/cli.js +438 -132
  12. package/build/cli.js.map +1 -1
  13. package/build/conditions.js +15 -8
  14. package/build/conditions.js.map +1 -1
  15. package/build/config.js +26 -3
  16. package/build/config.js.map +1 -1
  17. package/build/console.js +176 -0
  18. package/build/console.js.map +1 -0
  19. package/build/daemon.js +136 -5
  20. package/build/daemon.js.map +1 -1
  21. package/build/events.js +2 -1
  22. package/build/events.js.map +1 -1
  23. package/build/help.js +447 -0
  24. package/build/help.js.map +1 -0
  25. package/build/history.js +637 -0
  26. package/build/history.js.map +1 -0
  27. package/build/inbox.js +117 -18
  28. package/build/inbox.js.map +1 -1
  29. package/build/manager.js +118 -43
  30. package/build/manager.js.map +1 -1
  31. package/build/notes.js +27 -43
  32. package/build/notes.js.map +1 -1
  33. package/build/notify.js +32 -3
  34. package/build/notify.js.map +1 -1
  35. package/build/overrides.js +83 -0
  36. package/build/overrides.js.map +1 -0
  37. package/build/paths.js +10 -1
  38. package/build/paths.js.map +1 -1
  39. package/build/profile.js +68 -2
  40. package/build/profile.js.map +1 -1
  41. package/build/queue.js +183 -0
  42. package/build/queue.js.map +1 -0
  43. package/build/registry.js +17 -10
  44. package/build/registry.js.map +1 -1
  45. package/build/rule-actions.js +444 -0
  46. package/build/rule-actions.js.map +1 -0
  47. package/build/rule-input.js +17 -0
  48. package/build/rule-input.js.map +1 -0
  49. package/build/rules-service.js +402 -0
  50. package/build/rules-service.js.map +1 -0
  51. package/build/rules.js +850 -0
  52. package/build/rules.js.map +1 -0
  53. package/build/scheduler.js +293 -0
  54. package/build/scheduler.js.map +1 -0
  55. package/build/serve.js +51 -0
  56. package/build/serve.js.map +1 -0
  57. package/build/server.js +230 -7
  58. package/build/server.js.map +1 -1
  59. package/build/spend.js +42 -0
  60. package/build/spend.js.map +1 -1
  61. package/build/store.js +266 -12
  62. package/build/store.js.map +1 -1
  63. package/build/trackers.js +15 -0
  64. package/build/trackers.js.map +1 -0
  65. package/build/upgrade.js +16 -14
  66. package/build/upgrade.js.map +1 -1
  67. package/build/wait.js +3 -9
  68. package/build/wait.js.map +1 -1
  69. package/build/watchers/ado-api.js +55 -0
  70. package/build/watchers/ado-api.js.map +1 -0
  71. package/build/watchers/ado.js +60 -52
  72. package/build/watchers/ado.js.map +1 -1
  73. package/build/watchers/boards-brief.js +63 -0
  74. package/build/watchers/boards-brief.js.map +1 -0
  75. package/build/watchers/boards-queue.js +120 -0
  76. package/build/watchers/boards-queue.js.map +1 -0
  77. package/build/watchers/boards-writes.js +83 -0
  78. package/build/watchers/boards-writes.js.map +1 -0
  79. package/build/watchers/boards.js +271 -0
  80. package/build/watchers/boards.js.map +1 -0
  81. package/build/watchers/conflicts.js +132 -0
  82. package/build/watchers/conflicts.js.map +1 -0
  83. package/build/watchers/github.js +5 -2
  84. package/build/watchers/github.js.map +1 -1
  85. package/build/watchers/index.js +21 -7
  86. package/build/watchers/index.js.map +1 -1
  87. package/build/watchers/linear-api.js +55 -0
  88. package/build/watchers/linear-api.js.map +1 -0
  89. package/build/watchers/linear-labels.js +43 -0
  90. package/build/watchers/linear-labels.js.map +1 -0
  91. package/build/watchers/linear-queue.js +96 -0
  92. package/build/watchers/linear-queue.js.map +1 -0
  93. package/build/watchers/linear.js +18 -16
  94. package/build/watchers/linear.js.map +1 -1
  95. package/build/watchers/source.js +3 -3
  96. package/build/watchers/source.js.map +1 -1
  97. package/build/why.js +78 -0
  98. package/build/why.js.map +1 -0
  99. package/mod/.claude-plugin/plugin.json +1 -1
  100. package/mod/README.md +2 -2
  101. package/mod/hooks/model.ts +135 -8
  102. package/mod/hooks/register.tsx +219 -19
  103. package/mod/types/index.d.ts +6 -0
  104. package/package.json +1 -1
package/build/help.js ADDED
@@ -0,0 +1,447 @@
1
+ import { ConductorError } from "./errors.js";
2
+ // By task, in the order a reader needs them; the commands inside each are listed A–Z.
3
+ export const GROUPS = [
4
+ 'Daemon',
5
+ 'Projects and workers',
6
+ 'Inbox and approvals',
7
+ 'Scheduling',
8
+ 'Console and rules',
9
+ 'Logs and reports',
10
+ 'Used by work skills',
11
+ 'Setup',
12
+ ];
13
+ const DEFAULT_WIDTH = 80;
14
+ // Narrower than this, a hanging indent leaves no room for the text.
15
+ const MIN_WIDTH = 40;
16
+ // A longer term goes on a line of its own, with its description under it.
17
+ const MAX_TERM = 24;
18
+ const RANGE = 'A <range> is today, yesterday, a date (2026-10-10), A..B (2026-10-10..2026-10-11), or a span (24h, the default; 7d).';
19
+ const WHEN = '<when> is 17:00 (the next one), tomorrow, a day such as monday, or a date and time.';
20
+ const WINDOW = 'A --since or --until <when> is now, today, yesterday, a span ago (30m, 24h, 7d), a date, or a date and time. Give a <range> or --since/--until, not both.';
21
+ export const COMMANDS = [
22
+ {
23
+ details: [
24
+ 'Posts "approve" on the item as you and wakes its worker. <item> is the item (ATK-312), or the inbox item\'s id as #12.',
25
+ '--text adds to the comment: "approve: <text>".',
26
+ ],
27
+ group: 'Inbox and approvals',
28
+ name: 'approve',
29
+ summary: 'approve a plan and wake its worker',
30
+ usage: ['approve <item> [--text <text>]'],
31
+ },
32
+ {
33
+ details: ['Wakes a parked worker (with no event text) and opens its session in a tab.'],
34
+ group: 'Projects and workers',
35
+ name: 'attach',
36
+ summary: 'wake a parked worker and open it in a tab',
37
+ usage: ['attach <worker>'],
38
+ },
39
+ {
40
+ details: [
41
+ 'The item\'s context for a worker\'s orient step, read by the conductor from the tracker (no MCP): title, status, project, Area and labels, blockers, the items it blocks and related items, its phase notes, the approve or revise: after the newest Plan, and the description.',
42
+ 'A brief is kept for 30 seconds, and anything the conductor sees happen to the item (a note, an approve or revise it posted, a wait resolved) drops it. --fresh reads the tracker again, as a check for an approval after a wake should.',
43
+ 'Exit 3 when no conductor gave it (none running, one without the brief API, or one that couldn\'t read the tracker): read the item from the tracker then.',
44
+ ],
45
+ group: 'Used by work skills',
46
+ name: 'brief',
47
+ summary: 'an item\'s title, status, links, notes and approval',
48
+ usage: ['brief <item> [--json] [--fresh]'],
49
+ },
50
+ {
51
+ details: [
52
+ 'Opens the console, the Claude session the conductor mod serves, in a Windows Terminal tab in the project\'s main checkout. --here runs it in this terminal.',
53
+ 'The tab needs Windows Terminal, and refuses while CONDUCTOR_HOME is set (a tab would not see it): use --here then.',
54
+ 'Also how to get it back after it closed: it keeps no state of its own.',
55
+ ],
56
+ group: 'Console and rules',
57
+ name: 'console',
58
+ summary: 'open the console, the session the conductor mod serves',
59
+ usage: ['console [--project <name>] [--here]'],
60
+ },
61
+ {
62
+ details: ['For a physical action, or one you handled yourself. <id> is the inbox id as conduct inbox prints it (#12, or 12).'],
63
+ group: 'Inbox and approvals',
64
+ name: 'done',
65
+ summary: 'mark an inbox item done',
66
+ usage: ['done <id>'],
67
+ },
68
+ {
69
+ details: [
70
+ [
71
+ ['escalations [--json]', 'what rules escalated to the console in the last 14 days and it hasn\'t handled'],
72
+ ['done <id> [--ask] <text>', 'log the console\'s finding on escalation #<id>; --ask also puts it in the inbox for you (a "console" item). Every word after <id> is the text'],
73
+ ],
74
+ ],
75
+ group: 'Console and rules',
76
+ name: 'escalations',
77
+ summary: 'what rules escalated to the console and it hasn\'t handled',
78
+ usage: ['escalations [--json]', 'escalations done <id> [--ask] <text>'],
79
+ },
80
+ {
81
+ details: [
82
+ 'The event log after <id> (all of it without --since), one JSON event per line.',
83
+ '--follow keeps following it (live without --since), reconnecting when the conductor restarts; the state lines conduct.connected and conduct.disconnected say so.',
84
+ '--console (or CONDUCTOR_CONSOLE=1) marks the console\'s stream, as the conductor mod runs it: with none open, escalations raise an inbox item after 30 s.',
85
+ ],
86
+ group: 'Logs and reports',
87
+ name: 'events',
88
+ summary: 'the event log, one JSON event per line',
89
+ usage: ['events [--since <id>]', 'events --follow [--since <id>] [--console]'],
90
+ },
91
+ {
92
+ details: [
93
+ '--slots and --weight set the project\'s slots or ordering weight (-100 to 100) until <when>; with neither, its items go first (weight 100).',
94
+ WHEN,
95
+ ],
96
+ group: 'Scheduling',
97
+ name: 'focus',
98
+ summary: 'more slots or weight for a project, for a while',
99
+ usage: ['focus <project> [--slots <n>] [--weight <n>] --until <when>'],
100
+ },
101
+ {
102
+ details: [
103
+ 'What a window of the log says: shipped items, time in each phase by tier, plan latency, waits by kind, stalls, failures, inbox, slot use, rules and spend.',
104
+ RANGE,
105
+ WINDOW,
106
+ ],
107
+ group: 'Logs and reports',
108
+ name: 'history',
109
+ summary: 'what a window of the log says, from shipped items to spend',
110
+ usage: ['history [<range>] [--since <when>] [--until <when>] [--project <name>] [--json]'],
111
+ },
112
+ {
113
+ details: ['Each open item with its age, its commands and its links.'],
114
+ group: 'Inbox and approvals',
115
+ name: 'inbox',
116
+ summary: 'what waits on you',
117
+ usage: ['inbox [--json]'],
118
+ },
119
+ {
120
+ details: [
121
+ 'Installs the conductor mod from this package in Claude Code (user scope): the inbox band, pane and commands in the console (a session started with CONDUCTOR_CONSOLE=1).',
122
+ '--remove uninstalls it.',
123
+ ],
124
+ group: 'Setup',
125
+ name: 'install-mod',
126
+ summary: 'install the conductor mod in Claude Code',
127
+ usage: ['install-mod', 'install-mod --remove'],
128
+ },
129
+ {
130
+ details: [
131
+ 'Registers a Windows Task Scheduler task that runs conduct serve at logon. Run it from the main checkout: a worktree\'s build goes away.',
132
+ '--remove removes that logon task.',
133
+ ],
134
+ group: 'Setup',
135
+ name: 'install-startup',
136
+ summary: 'start the daemon at logon (Windows Task Scheduler)',
137
+ usage: ['install-startup', 'install-startup --remove'],
138
+ },
139
+ {
140
+ details: [
141
+ 'Starts a worker on the item: its worktree, a background session running the project\'s work skill, and a tab.',
142
+ [
143
+ ['--project <name>', 'the project the item belongs to'],
144
+ ['--probe', 'a probe that works no issue: its session and worktree are probe-<item>, out of the fleet\'s way'],
145
+ ['--prompt <text>', 'the session\'s first prompt instead of the work skill (or the probe prompt)'],
146
+ ['--conductor <name>', 'passed to the work skill as --conductor'],
147
+ ],
148
+ ],
149
+ group: 'Projects and workers',
150
+ name: 'launch',
151
+ summary: 'start a worker: its worktree, a background session, a tab',
152
+ usage: ['launch <item> [--project <name>] [--probe] [--prompt <text>] [--conductor <name>]'],
153
+ },
154
+ {
155
+ details: [
156
+ 'acquire, release or show a lock every project shares, such as chrome for verify runs. It goes stale 30 minutes after its holder last acquired it: acquire it again to keep it.',
157
+ 'The owner is this checkout\'s worker\'s item unless --owner gives one. --wait polls for up to that many minutes.',
158
+ 'Prints JSON. Exit 3 when no conductor answers.',
159
+ ],
160
+ group: 'Used by work skills',
161
+ name: 'lock',
162
+ summary: 'a lock every project shares, such as chrome',
163
+ usage: ['lock acquire|release|status <name> [--owner <id>] [--wait <minutes>]'],
164
+ },
165
+ {
166
+ details: [
167
+ 'Posts the file as a phase note on the item ("## <work skill> · <Phase>") and records its phase on the worker: this checkout\'s, or --worker <worker>.',
168
+ 'Exit 3 when nobody posted it (no conductor, or the tracker refused it).',
169
+ ],
170
+ group: 'Used by work skills',
171
+ name: 'note',
172
+ summary: 'post a phase note on the item and record the phase',
173
+ usage: ['note <item> <file> [--worker <worker>]'],
174
+ },
175
+ {
176
+ details: [
177
+ [
178
+ ['notify [--json]', 'the notification profile, quiet hours, and each channel\'s state'],
179
+ ['profile [<name>]', 'switch the profile now (built in: default, away, focus); --until 17:00 or a date and time hands back to the one before it then. Without <name>, the same as conduct notify'],
180
+ ['test', 'push a sample item (default npm-otp) on the profile\'s channels now; --raise puts a real item in the inbox instead, routed by the profile (quiet hours, reminders), so it takes no --channel'],
181
+ ],
182
+ ],
183
+ group: 'Inbox and approvals',
184
+ name: 'notify',
185
+ summary: 'the notification profile and channels; switch or test them',
186
+ usage: ['notify [--json]', 'notify profile [<name>] [--until <when>]', 'notify test [--kind <kind>] [--channel remote-control|pushover] [--raise]'],
187
+ },
188
+ {
189
+ details: [
190
+ 'No new launches in the project, or in every project without one, until <when> or conduct unpause.',
191
+ WHEN,
192
+ ],
193
+ group: 'Scheduling',
194
+ name: 'pause',
195
+ summary: 'no new launches, until a time or unpause',
196
+ usage: ['pause [<project>] [--until <when>]'],
197
+ },
198
+ {
199
+ details: [
200
+ 'The checkout\'s dev ports from the port broker: its project\'s base ports plus its slot, which no other project\'s worktree shares (a main checkout: slot 0). --prefer asks for a slot first. Without <path>, every worktree\'s.',
201
+ 'Exit 3 when no conductor brokered it, so the caller keeps its own ports.',
202
+ ],
203
+ group: 'Used by work skills',
204
+ name: 'ports',
205
+ summary: 'a checkout\'s dev ports, from the port broker',
206
+ usage: ['ports [<path>] [--prefer <slot>] [--json]'],
207
+ },
208
+ {
209
+ details: [
210
+ [
211
+ ['add <path>', 'register the project whose checkout holds .claude/conductor.json (again after changing it); works without the daemon'],
212
+ ['list [--json]', 'the registered projects'],
213
+ ],
214
+ ],
215
+ group: 'Projects and workers',
216
+ name: 'project',
217
+ summary: 'register a project, or list the registered ones',
218
+ usage: ['project add <path>', 'project list [--json]'],
219
+ },
220
+ {
221
+ details: ['--fresh asks every project\'s tracker now, instead of using the last read.'],
222
+ group: 'Scheduling',
223
+ name: 'queue',
224
+ summary: 'what the scheduler picks next, and why the rest wait',
225
+ usage: ['queue [--json] [--fresh]'],
226
+ },
227
+ {
228
+ details: [
229
+ 'Stops the worker\'s session and removes its worktree. It refuses while the worker\'s turn runs or its worktree has unfinished work (uncommitted or unpushed); --force retires it anyway and throws that work away.',
230
+ ],
231
+ group: 'Projects and workers',
232
+ name: 'retire',
233
+ summary: 'stop a worker and remove its worktree and session',
234
+ usage: ['retire <worker> [--force]'],
235
+ },
236
+ {
237
+ details: ['The same report as conduct history, as Markdown.', RANGE,
238
+ WINDOW],
239
+ group: 'Logs and reports',
240
+ name: 'retro',
241
+ summary: 'the history report as Markdown',
242
+ usage: ['retro [<range>] [--since <when>] [--until <when>] [--project <name>] [--json]'],
243
+ },
244
+ {
245
+ details: ['Posts "revise: <text>" on the item as you and wakes its worker. Every word after <item> is the text, quoted or not.'],
246
+ group: 'Inbox and approvals',
247
+ name: 'revise',
248
+ summary: 'ask for a revised plan and wake its worker',
249
+ usage: ['revise <item> <text>'],
250
+ },
251
+ {
252
+ details: [
253
+ [
254
+ ['rules [--json]', 'the rules in force (project, machine, built-in defaults), what replaces what, and any rules file refused. Machine rules are ~/.conductor/rules.json'],
255
+ ['test <file> [--json]', 'dry-run the rules on a sample JSON file (no event: a state rule\'s subject); acts on nothing'],
256
+ ],
257
+ 'A sample:',
258
+ { pre: ['{ "event": "pr.comment", "project": "atk",', ' "fields": { "wait.kind": "merge" } }'] },
259
+ ],
260
+ group: 'Console and rules',
261
+ name: 'rules',
262
+ summary: 'the rules in force; dry-run them on a sample',
263
+ usage: ['rules [--json]', 'rules test <file> [--json]'],
264
+ },
265
+ {
266
+ details: ['One daemon per machine. conduct start runs it detached instead.'],
267
+ group: 'Daemon',
268
+ name: 'serve',
269
+ summary: 'run the daemon in this process',
270
+ usage: ['serve'],
271
+ },
272
+ {
273
+ details: [
274
+ 'Starts the logon task when it runs this build, else a detached conduct serve, and waits until the daemon answers. Does nothing when one runs already.',
275
+ ],
276
+ group: 'Daemon',
277
+ name: 'start',
278
+ summary: 'start the daemon detached and wait until it answers',
279
+ usage: ['start'],
280
+ },
281
+ {
282
+ details: ['--json prints it as JSON. With no daemon running, that JSON says running: false, lists the workers from the store, and exits 1.'],
283
+ group: 'Daemon',
284
+ name: 'status',
285
+ summary: 'the daemon\'s pid, port, projects, workers and held locks',
286
+ usage: ['status [--json]'],
287
+ },
288
+ {
289
+ details: [],
290
+ group: 'Daemon',
291
+ name: 'stop',
292
+ summary: 'stop the running daemon',
293
+ usage: ['stop'],
294
+ },
295
+ {
296
+ details: ['Ends the project\'s pause, or without <project> the pause of every project. Unpausing one project leaves a pause of every project in force.'],
297
+ group: 'Scheduling',
298
+ name: 'unpause',
299
+ summary: 'launch again after a pause',
300
+ usage: ['unpause [<project>]'],
301
+ },
302
+ {
303
+ details: [
304
+ 'Stops the daemon, installs the newest version on the tag with npm, and starts the daemon again. The tag defaults to the one the installed version came from.',
305
+ '--allow-downgrade installs the tag\'s version even when it is older than the installed one.',
306
+ ],
307
+ group: 'Daemon',
308
+ name: 'upgrade',
309
+ summary: 'install the newest version and restart the daemon',
310
+ usage: ['upgrade [--tag dev|latest] [--allow-downgrade]'],
311
+ },
312
+ {
313
+ details: [
314
+ 'In a worker\'s worktree with the daemon running, registers the wait and exits 0 at once: end the turn, and the daemon resumes the session when the condition holds. Otherwise checks it here and blocks: exit 0 when it holds, 2 at --timeout (minutes, local only; 29 by default). --local checks it here even with the daemon running.',
315
+ 'Conditions:',
316
+ [
317
+ ['pr <n> merged|checks|comment', 'a pull request merged, its checks finished, or a new comment; --repo <owner>/<repo> for a GitHub repo'],
318
+ ['run <pipeline> <run id> [done]', 'a pipeline run finished'],
319
+ ['npm <version>', 'a version on npm; --tag <dist-tag> (default latest), --package <name> (default the profile\'s)'],
320
+ ['health <env>', 'the environment\'s health answers --version <x> or --commit <sha>'],
321
+ ['approval [<item>]', 'an approve or revise: comment after the item\'s newest Plan note'],
322
+ ['item <item> <state>', 'the item reaches a state; item <item> state|label|note <value> for a state, a label or a note of more than one word'],
323
+ ['time <when>', 'such as 17:00 (the next one) or 2026-10-10T09:00 (local)'],
324
+ ['<full form>', 'such as pr:ado:Emergent.AgenticToolkit#1850:merged'],
325
+ ],
326
+ ],
327
+ group: 'Used by work skills',
328
+ name: 'wait',
329
+ summary: 'wait for an outside event, such as a merge or an approval',
330
+ usage: ['wait <condition> [--local] [--timeout <minutes>] [--worker <worker>] [--item <item>]'],
331
+ },
332
+ {
333
+ details: ['With an event id, that event\'s rule and the events that led to it; with an item (ATK-312), the same for each of its newest actions.'],
334
+ group: 'Console and rules',
335
+ name: 'why',
336
+ summary: 'the rule behind an action, and the events that led to it',
337
+ usage: ['why <event id | item> [--json]'],
338
+ },
339
+ ];
340
+ // The rows under the groups, which share their column.
341
+ const HELP_ROWS = [
342
+ ['help [<command>]', 'this listing, or one command\'s help (also <command> --help)'],
343
+ ['--version', 'the installed version'],
344
+ ];
345
+ // `conduct help <command>`: the summary, every form, then the details.
346
+ export function commandHelp(name, width = terminalWidth()) {
347
+ const command = find(name);
348
+ const lines = [...hang(`conduct ${name}: `, command.summary.split(' '), width), '', ...usageLines(command, width)];
349
+ for (const detail of command.details)
350
+ lines.push('', ...detailLines(detail, width));
351
+ return lines.join('\n');
352
+ }
353
+ // The text after `prefix`, word by word, with every line after the first indented to the prefix's
354
+ // length. A word wider than the room left gets a line of its own.
355
+ export function hang(prefix, words, width) {
356
+ const indent = ' '.repeat(prefix.length);
357
+ const lines = [];
358
+ let line = prefix;
359
+ let empty = true;
360
+ for (const word of words.filter((w) => w !== '')) {
361
+ if (!empty && line.length + 1 + word.length > width) {
362
+ lines.push(line);
363
+ line = indent;
364
+ empty = true;
365
+ }
366
+ line += empty ? word : ` ${word}`;
367
+ empty = false;
368
+ }
369
+ lines.push(line);
370
+ return lines.map((l) => l.trimEnd());
371
+ }
372
+ export function isCommand(name) {
373
+ return COMMANDS.some((c) => c.name === name);
374
+ }
375
+ // `conduct` and `conduct help`: one line per command under its group, A–Z, then the help rows.
376
+ export function listing(width = terminalWidth()) {
377
+ const column = Math.max(...[...COMMANDS.map((c) => c.name), ...HELP_ROWS.map(([term]) => term)].map((t) => t.length)) + 4;
378
+ const row = (term, text) => hang(` ${term}`.padEnd(column), text.split(' '), width);
379
+ const lines = ['Usage: conduct <command> [options]'];
380
+ for (const group of GROUPS) {
381
+ const names = COMMANDS.filter((c) => c.group === group).toSorted((a, b) => a.name.localeCompare(b.name));
382
+ lines.push('', group, ...names.flatMap((c) => row(c.name, c.summary)));
383
+ }
384
+ lines.push('', 'Help', ...HELP_ROWS.flatMap(([term, text]) => row(term, text)));
385
+ lines.push('', ...hang('', 'A <worker> is its item (ATK-309) or its name (probe-ATK-309).'.split(' '), width));
386
+ lines.push(...hang('', 'Files live in ~/.conductor (CONDUCTOR_HOME overrides it).'.split(' '), width));
387
+ return lines.join('\n');
388
+ }
389
+ // The width to wrap to: the terminal's, or 80 when it isn't one.
390
+ export function terminalWidth(stream = process.stdout) {
391
+ return Math.max(stream.columns ?? DEFAULT_WIDTH, MIN_WIDTH);
392
+ }
393
+ // What `conduct help <name>` refuses for a name that is no command.
394
+ export function unknownCommand(name) {
395
+ return new ConductorError(`unknown command "${name}"`, ['run `conduct help` for the commands']);
396
+ }
397
+ // A usage error for one command: the message, then its forms and where its help is. Never the
398
+ // whole listing. The CLI prints the details indented by two.
399
+ export function usageError(name, message = `wrong or missing arguments for conduct ${name}`) {
400
+ return new ConductorError(message, [...usageLines(find(name), terminalWidth(process.stderr) - 2), `run \`conduct help ${name}\` for the details`]);
401
+ }
402
+ function detailLines(detail, width) {
403
+ if (typeof detail === 'string')
404
+ return hang('', detail.split(' '), width);
405
+ if ('pre' in detail)
406
+ return detail.pre.map((line) => ` ${line}`);
407
+ const short = detail.map(([term]) => term.length).filter((n) => n <= MAX_TERM);
408
+ const column = 2 + Math.max(0, ...short) + 2;
409
+ return detail.flatMap(([term, text]) => term.length <= MAX_TERM
410
+ ? hang(` ${term}`.padEnd(column), text.split(' '), width)
411
+ : [` ${term}`, ...hang(' '.repeat(column), text.split(' '), width)]);
412
+ }
413
+ function find(name) {
414
+ const command = COMMANDS.find((c) => c.name === name);
415
+ if (!command)
416
+ throw new Error(`no help for ${name}`);
417
+ return command;
418
+ }
419
+ // A form split at its top-level spaces, so `[--since <when>]` stays on one line.
420
+ function synopsisWords(form) {
421
+ const words = [];
422
+ let depth = 0;
423
+ let word = '';
424
+ for (const char of form) {
425
+ if (char === '[' || char === '<')
426
+ depth += 1;
427
+ if (char === ']' || char === '>')
428
+ depth -= 1;
429
+ if (char === ' ' && depth === 0) {
430
+ words.push(word);
431
+ word = '';
432
+ }
433
+ else {
434
+ word += char;
435
+ }
436
+ }
437
+ return [...words, word];
438
+ }
439
+ // `usage: conduct <form>`, one line per form, a long form wrapped under its first argument.
440
+ function usageLines(command, width) {
441
+ return command.usage.flatMap((form, i) => {
442
+ const [name = '', ...words] = synopsisWords(form);
443
+ const head = `${i === 0 ? 'usage: ' : ' '}conduct ${name} `;
444
+ return hang(head, words, width);
445
+ });
446
+ }
447
+ //# sourceMappingURL=help.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"help.js","sourceRoot":"","sources":["../src/help.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAoB7C,sFAAsF;AACtF,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,QAAQ;IACR,sBAAsB;IACtB,qBAAqB;IACrB,YAAY;IACZ,mBAAmB;IACnB,kBAAkB;IAClB,qBAAqB;IACrB,OAAO;CACC,CAAC;AAEX,MAAM,aAAa,GAAG,EAAE,CAAC;AACzB,oEAAoE;AACpE,MAAM,SAAS,GAAG,EAAE,CAAC;AACrB,0EAA0E;AAC1E,MAAM,QAAQ,GAAG,EAAE,CAAC;AAEpB,MAAM,KAAK,GACT,sHAAsH,CAAC;AACzH,MAAM,IAAI,GAAG,qFAAqF,CAAC;AACnG,MAAM,MAAM,GACV,2JAA2J,CAAC;AAE9J,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB;QACE,OAAO,EAAE;YACP,wHAAwH;YACxH,gDAAgD;SACjD;QACD,KAAK,EAAE,qBAAqB;QAC5B,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,oCAAoC;QAC7C,KAAK,EAAE,CAAC,gCAAgC,CAAC;KAC1C;IACD;QACE,OAAO,EAAE,CAAC,4EAA4E,CAAC;QACvF,KAAK,EAAE,sBAAsB;QAC7B,IAAI,EAAE,QAAQ;QACd,O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