mainflow 0.28.0 → 0.29.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/facts.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as SLUG, i as SERVES_REF, n as FORMAT_VERSION, o as SurveyLine, r as ID_PATTERNS, s as Until, t as CHECKLIST_REF } from "./index-bIFT1ORw.js";
1
+ import { _ as Until, c as ID_PATTERNS, f as SERVES_REF, h as SurveyLine, o as FORMAT_VERSION, p as SLUG, r as CHECKLIST_REF } from "./index-DV6Gqu8K.js";
2
2
  //#region src/facts.d.ts
3
3
  export interface CommandSpec {
4
4
  usage: string;
@@ -7,6 +7,8 @@ export interface CommandSpec {
7
7
  args: number;
8
8
  /** Extra positional arguments the command also accepts */
9
9
  optionalArgs?: number;
10
+ /** The last argument is text taken as written, so a list line such as "- 完成" is not read as an option */
11
+ literalLast?: boolean;
10
12
  needsHub: boolean;
11
13
  }
12
14
  export declare const COMMAND_SPECS: {
@@ -169,6 +171,12 @@ export declare const COMMAND_SPECS: {
169
171
  readonly args: 1;
170
172
  readonly needsHub: true;
171
173
  };
174
+ readonly 'criterion add': {
175
+ readonly usage: 'criterion add <m> <text> --done-when <text>';
176
+ readonly summary: 'Add an open criterion at the end of the mainline\'s criteria with the next r id';
177
+ readonly args: 2;
178
+ readonly needsHub: true;
179
+ };
172
180
  readonly 'criterion check': {
173
181
  readonly usage: 'criterion check <m#r> --evidence <evidence>';
174
182
  readonly summary: 'Mark a criterion as met';
@@ -199,6 +207,12 @@ export declare const COMMAND_SPECS: {
199
207
  readonly args: 1;
200
208
  readonly needsHub: true;
201
209
  };
210
+ readonly 'item add': {
211
+ readonly usage: 'item add <m/t> <text> --done-when <text> [--serves <r>[,...]]';
212
+ readonly summary: 'Add an open checklist item at the end of the task\'s checklist with the next c id; --serves names criteria of its mainline';
213
+ readonly args: 2;
214
+ readonly needsHub: true;
215
+ };
202
216
  readonly 'item check': {
203
217
  readonly usage: 'item check <m/t#c> --evidence <evidence>';
204
218
  readonly summary: 'Check an item with evidence';
@@ -301,6 +315,13 @@ export declare const COMMAND_SPECS: {
301
315
  readonly args: 0;
302
316
  readonly needsHub: true;
303
317
  };
318
+ readonly 'section append': {
319
+ readonly usage: 'section append <m|m/t|m/d|i|f> <heading> <text>';
320
+ readonly summary: 'Add text at the end of a section of a document\'s body, such as a line under a task\'s 紀錄; two appends keep both, in order. The text is taken as written, even when it starts with "-"; a list line follows the list directly, other text comes after a blank line';
321
+ readonly args: 3;
322
+ readonly literalLast: true;
323
+ readonly needsHub: true;
324
+ };
304
325
  readonly 'decision supersede': {
305
326
  readonly usage: 'decision supersede <m/d> --by <d>';
306
327
  readonly summary: 'Mark a decision as replaced by another';
@@ -315,10 +336,28 @@ export declare const COMMAND_SPECS: {
315
336
  };
316
337
  readonly retro: {
317
338
  readonly usage: 'retro <m> [--json]';
318
- readonly summary: 'Read the Claude Code transcripts of the sessions that served a mainline, and their subagents\', into estimated list-price cost (per model, opening context, cache hit rate, hook injections) and candidates for where work went wrong (tool errors, rerun Bash commands, hook injections followed by no tool call, blocks, pauses over 5 minutes, failed completion checks); read-only';
339
+ readonly summary: 'Read the Claude Code transcripts of the sessions that served a mainline, and their subagents\', into estimated list-price cost (per model, opening context, cache hit rate, hook injections) and candidates for where work went wrong (tool errors, rerun Bash commands, hook injections followed by no tool call, blocks, pauses over 5 minutes, failed completion checks); read-only. With MAINFLOW_TELEMETRY_URL and MAINFLOW_TELEMETRY_TOKEN set it also reads the measurement receiver\'s export: billed cost per request, and the run time of every hook, the silent ones too';
319
340
  readonly args: 1;
320
341
  readonly needsHub: true;
321
342
  };
343
+ readonly sync: {
344
+ readonly usage: 'sync';
345
+ readonly summary: `Keep .mainflow/ in step with the hub on the sync server until stopped: pull its changes, send every local change. The server and token come from MAINFLOW_SYNC_URL and MAINFLOW_SYNC_TOKEN, or url and token in .mainflow/local/sync.json. While it runs, or with a server and token set, every mainflow write is applied here and put in the outbox, which it sends in order; a writing command waits up to 15 s for the server's answer`;
346
+ readonly args: 0;
347
+ readonly needsHub: true;
348
+ };
349
+ readonly 'sync flush': {
350
+ readonly usage: 'sync flush [--hook]';
351
+ readonly summary: 'Send every change to .mainflow/ now and print what did not reach the hub as written, such as a refused edit and where it was saved; --hook reads a PostToolUse payload from stdin and answers as the hook';
352
+ readonly args: 0;
353
+ readonly needsHub: true;
354
+ };
355
+ readonly 'sync status': {
356
+ readonly usage: 'sync status';
357
+ readonly summary: 'Say whether mainflow sync runs for this hub, whether it is online and caught up with the server, and how many writes wait to be sent';
358
+ readonly args: 0;
359
+ readonly needsHub: true;
360
+ };
322
361
  };
323
362
  export type CommandName = keyof typeof COMMAND_SPECS;
324
363
  export declare const OPTIONS: {
@@ -445,6 +484,10 @@ export declare const OPTIONS: {
445
484
  readonly type: 'boolean';
446
485
  readonly default: false;
447
486
  };
487
+ readonly hook: {
488
+ readonly type: 'boolean';
489
+ readonly default: false;
490
+ };
448
491
  readonly 'dry-run': {
449
492
  readonly type: 'boolean';
450
493
  readonly default: false;
@@ -508,6 +551,25 @@ export declare const REFERENCES: readonly [{
508
551
  readonly format: '{sessionId}#a{NNN}';
509
552
  readonly example: 'claude-code-1a2b3c4d#a003';
510
553
  }];
554
+ /**
555
+ * The formats `retro` reads from a delegation. `label` is the subagent's description, `{item} {role} r{round}`:
556
+ * the item is a checklist item or task reference, or `noItem`; the role is one of `roles`; the round counts from 1
557
+ * per item and role. `findings` is the block a reviewer ends its reply with: a `fence` code block, one JSON object
558
+ * per line with `fields`, `sev` one of `severities` and `class` one of `classes`.
559
+ */
560
+ export declare const RETRO_FORMATS: {
561
+ readonly label: {
562
+ readonly pattern: '{item} {role} r{round}';
563
+ readonly roles: readonly ["impl", "review", "check", "survey", "explore"];
564
+ readonly noItem: "-";
565
+ };
566
+ readonly findings: {
567
+ readonly fence: "review-findings";
568
+ readonly fields: readonly ["id", "sev", "class", "src"];
569
+ readonly severities: readonly ["high", "mid", "low"];
570
+ readonly classes: readonly ["preexisting", "spec-gap", "impl-bug"];
571
+ };
572
+ };
511
573
  /**
512
574
  * Conditions a blocked action's `until` takes and `wait` checks, one example each: a commit on a branch whose
513
575
  * message contains the text (git log runs at the hub root), an action that is done, a path relative to the hub root that exists (`..` reaches sibling repositories).
package/dist/facts.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { A as WORK_STATUS, C as SESSION_STATUS, D as TASK_REQUIRED_SECTIONS, E as SURVEY_SECTION, J as GRANT_ACTIONS, O as TASK_SECTIONS, T as SURVEY_LINES, X as GRANT_TARGET_FORMS, Y as GRANT_FORMS, _ as MERGE_STATES, a as DECISION_SECTIONS, c as FINDING_SECTIONS, d as ID_PATTERNS, f as ISSUE_SECTIONS, g as MAINLINE_STATUS, h as MAINLINE_SECTIONS, i as DECISION_BASES, k as UNTIL_FORMS, l as FINDING_STATUS, m as LINK_RELS, n as CLOSED_STATUS, o as DECISION_STATUS, p as ISSUE_STATUS, r as DECIDERS, s as DEFAULT_CATEGORIES, t as CHECKLIST_REF, u as FORMAT_VERSION, v as PRIORITIES, w as SLUG, x as SERVES_REF } from "./dist-BbamrIPW.js";
2
+ import { a as LABEL_ROLES, i as FINDING_SEVERITIES, n as FINDING_CLASSES, r as FINDING_FIELDS, t as FINDINGS_FENCE } from "./retro-formats-ECy0gGOL.js";
2
3
  //#region src/facts.ts
3
4
  const COMMAND_SPECS = {
4
5
  init: {
@@ -160,6 +161,12 @@ const COMMAND_SPECS = {
160
161
  args: 1,
161
162
  needsHub: true
162
163
  },
164
+ "criterion add": {
165
+ usage: "criterion add <m> <text> --done-when <text>",
166
+ summary: "Add an open criterion at the end of the mainline's criteria with the next r id",
167
+ args: 2,
168
+ needsHub: true
169
+ },
163
170
  "criterion check": {
164
171
  usage: "criterion check <m#r> --evidence <evidence>",
165
172
  summary: "Mark a criterion as met",
@@ -190,6 +197,12 @@ const COMMAND_SPECS = {
190
197
  args: 1,
191
198
  needsHub: true
192
199
  },
200
+ "item add": {
201
+ usage: "item add <m/t> <text> --done-when <text> [--serves <r>[,...]]",
202
+ summary: "Add an open checklist item at the end of the task's checklist with the next c id; --serves names criteria of its mainline",
203
+ args: 2,
204
+ needsHub: true
205
+ },
193
206
  "item check": {
194
207
  usage: "item check <m/t#c> --evidence <evidence>",
195
208
  summary: "Check an item with evidence",
@@ -292,6 +305,13 @@ const COMMAND_SPECS = {
292
305
  args: 0,
293
306
  needsHub: true
294
307
  },
308
+ "section append": {
309
+ usage: "section append <m|m/t|m/d|i|f> <heading> <text>",
310
+ summary: "Add text at the end of a section of a document's body, such as a line under a task's 紀錄; two appends keep both, in order. The text is taken as written, even when it starts with \"-\"; a list line follows the list directly, other text comes after a blank line",
311
+ args: 3,
312
+ literalLast: true,
313
+ needsHub: true
314
+ },
295
315
  "decision supersede": {
296
316
  usage: "decision supersede <m/d> --by <d>",
297
317
  summary: "Mark a decision as replaced by another",
@@ -306,9 +326,27 @@ const COMMAND_SPECS = {
306
326
  },
307
327
  retro: {
308
328
  usage: "retro <m> [--json]",
309
- summary: "Read the Claude Code transcripts of the sessions that served a mainline, and their subagents', into estimated list-price cost (per model, opening context, cache hit rate, hook injections) and candidates for where work went wrong (tool errors, rerun Bash commands, hook injections followed by no tool call, blocks, pauses over 5 minutes, failed completion checks); read-only",
329
+ summary: "Read the Claude Code transcripts of the sessions that served a mainline, and their subagents', into estimated list-price cost (per model, opening context, cache hit rate, hook injections) and candidates for where work went wrong (tool errors, rerun Bash commands, hook injections followed by no tool call, blocks, pauses over 5 minutes, failed completion checks); read-only. With MAINFLOW_TELEMETRY_URL and MAINFLOW_TELEMETRY_TOKEN set it also reads the measurement receiver's export: billed cost per request, and the run time of every hook, the silent ones too",
310
330
  args: 1,
311
331
  needsHub: true
332
+ },
333
+ sync: {
334
+ usage: "sync",
335
+ summary: `Keep .mainflow/ in step with the hub on the sync server until stopped: pull its changes, send every local change. The server and token come from MAINFLOW_SYNC_URL and MAINFLOW_SYNC_TOKEN, or url and token in .mainflow/local/sync.json. While it runs, or with a server and token set, every mainflow write is applied here and put in the outbox, which it sends in order; a writing command waits up to 15 s for the server's answer`,
336
+ args: 0,
337
+ needsHub: true
338
+ },
339
+ "sync flush": {
340
+ usage: "sync flush [--hook]",
341
+ summary: "Send every change to .mainflow/ now and print what did not reach the hub as written, such as a refused edit and where it was saved; --hook reads a PostToolUse payload from stdin and answers as the hook",
342
+ args: 0,
343
+ needsHub: true
344
+ },
345
+ "sync status": {
346
+ usage: "sync status",
347
+ summary: "Say whether mainflow sync runs for this hub, whether it is online and caught up with the server, and how many writes wait to be sent",
348
+ args: 0,
349
+ needsHub: true
312
350
  }
313
351
  };
314
352
  const OPTIONS = {
@@ -361,6 +399,10 @@ const OPTIONS = {
361
399
  type: "boolean",
362
400
  default: false
363
401
  },
402
+ hook: {
403
+ type: "boolean",
404
+ default: false
405
+ },
364
406
  "dry-run": {
365
407
  type: "boolean",
366
408
  default: false
@@ -435,6 +477,25 @@ const REFERENCES = [
435
477
  }
436
478
  ];
437
479
  /**
480
+ * The formats `retro` reads from a delegation. `label` is the subagent's description, `{item} {role} r{round}`:
481
+ * the item is a checklist item or task reference, or `noItem`; the role is one of `roles`; the round counts from 1
482
+ * per item and role. `findings` is the block a reviewer ends its reply with: a `fence` code block, one JSON object
483
+ * per line with `fields`, `sev` one of `severities` and `class` one of `classes`.
484
+ */
485
+ const RETRO_FORMATS = {
486
+ label: {
487
+ pattern: "{item} {role} r{round}",
488
+ roles: LABEL_ROLES,
489
+ noItem: "-"
490
+ },
491
+ findings: {
492
+ fence: FINDINGS_FENCE,
493
+ fields: FINDING_FIELDS,
494
+ severities: FINDING_SEVERITIES,
495
+ classes: FINDING_CLASSES
496
+ }
497
+ };
498
+ /**
438
499
  * Conditions a blocked action's `until` takes and `wait` checks, one example each: a commit on a branch whose
439
500
  * message contains the text (git log runs at the hub root), an action that is done, a path relative to the hub root that exists (`..` reaches sibling repositories).
440
501
  */
@@ -527,7 +588,7 @@ const EVERY = [
527
588
  ];
528
589
  /** Criteria and checklist items share these; items add serves. */
529
590
  const LIST_ITEM = [
530
- field("id", true, "清單內不重複的編號,解決條件為 r{NNN},checklist 項目為 c{NNN};直接改檔時自己寫下一個"),
591
+ field("id", true, "清單內不重複的編號,解決條件為 r{NNN},checklist 項目為 c{NNN};由 criterion add 或 item add 配發,直接改檔時自己寫下一個"),
531
592
  field("text", true, "要做到的事,一句話"),
532
593
  field("doneWhen", false, "怎樣才算完成;還沒結束的條目必填,check 會檢查"),
533
594
  field("done", true, "是否已完成,用 check 指令改"),
@@ -611,4 +672,4 @@ const FIELDS = {
611
672
  ]
612
673
  };
613
674
  //#endregion
614
- export { CHECKLIST_REF, CLASSIFICATION, CLOSED_STATUSES, COMMAND_SPECS, FIELDS, FORMAT_VERSION, GRANTS, ID_PATTERNS, LAYOUT, LINKS, OPTIONS, REFERENCES, SECTIONS, SERVES_REF, SLUG, STATUSES, SURVEY, UNTIL };
675
+ export { CHECKLIST_REF, CLASSIFICATION, CLOSED_STATUSES, COMMAND_SPECS, FIELDS, FORMAT_VERSION, GRANTS, ID_PATTERNS, LAYOUT, LINKS, OPTIONS, REFERENCES, RETRO_FORMATS, SECTIONS, SERVES_REF, SLUG, STATUSES, SURVEY, UNTIL };
@@ -1,4 +1,4 @@
1
- import "./index-bIFT1ORw.js";
1
+ import "./index-DV6Gqu8K.js";
2
2
  //#region ../schema/dist/grants.d.ts
3
3
  /** An operation about to run, resolved to what a grant is written against. */
4
4
  type GrantRequest = {