mdkg 0.3.6 → 0.3.7

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 (48) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/CLI_COMMAND_MATRIX.md +56 -7
  3. package/README.md +33 -3
  4. package/dist/cli.js +132 -11
  5. package/dist/command-contract.json +431 -16
  6. package/dist/commands/bundle.js +2 -0
  7. package/dist/commands/checkpoint.js +139 -1
  8. package/dist/commands/db.js +8 -0
  9. package/dist/commands/format.js +116 -0
  10. package/dist/commands/goal.js +60 -0
  11. package/dist/commands/graph.js +148 -0
  12. package/dist/commands/handoff.js +295 -0
  13. package/dist/commands/mcp.js +9 -0
  14. package/dist/commands/pack.js +3 -1
  15. package/dist/commands/query_output.js +2 -0
  16. package/dist/commands/show.js +8 -0
  17. package/dist/commands/status.js +1 -0
  18. package/dist/commands/task.js +2 -0
  19. package/dist/commands/upgrade.js +61 -0
  20. package/dist/commands/validate.js +162 -3
  21. package/dist/commands/work.js +164 -0
  22. package/dist/core/project_db_queue_contract.js +101 -0
  23. package/dist/graph/edges.js +15 -0
  24. package/dist/graph/frontmatter.js +4 -1
  25. package/dist/graph/indexer.js +8 -0
  26. package/dist/graph/node.js +12 -1
  27. package/dist/graph/sqlite_index.js +2 -0
  28. package/dist/graph/subgraphs.js +2 -0
  29. package/dist/graph/validate_graph.js +5 -0
  30. package/dist/graph/visibility.js +6 -0
  31. package/dist/init/AGENT_START.md +4 -1
  32. package/dist/init/CLI_COMMAND_MATRIX.md +24 -3
  33. package/dist/init/README.md +17 -2
  34. package/dist/init/init-manifest.json +12 -12
  35. package/dist/init/templates/default/bug.md +2 -0
  36. package/dist/init/templates/default/chk.md +3 -0
  37. package/dist/init/templates/default/epic.md +2 -0
  38. package/dist/init/templates/default/feat.md +2 -0
  39. package/dist/init/templates/default/goal.md +3 -0
  40. package/dist/init/templates/default/spike.md +2 -0
  41. package/dist/init/templates/default/task.md +2 -0
  42. package/dist/init/templates/default/test.md +2 -0
  43. package/dist/pack/export_json.js +20 -8
  44. package/dist/pack/export_md.js +15 -4
  45. package/dist/pack/export_xml.js +9 -4
  46. package/dist/pack/metrics.js +12 -4
  47. package/dist/pack/pack.js +9 -1
  48. package/package.json +6 -2
package/dist/cli.js CHANGED
@@ -15,6 +15,7 @@ const list_1 = require("./commands/list");
15
15
  const search_1 = require("./commands/search");
16
16
  const show_1 = require("./commands/show");
17
17
  const pack_1 = require("./commands/pack");
18
+ const handoff_1 = require("./commands/handoff");
18
19
  const next_1 = require("./commands/next");
19
20
  const validate_1 = require("./commands/validate");
20
21
  const format_1 = require("./commands/format");
@@ -67,12 +68,13 @@ function printUsage(log) {
67
68
  log(" list List nodes with filters");
68
69
  log(" search Search nodes by query");
69
70
  log(" pack Generate a context pack");
71
+ log(" handoff Create sanitized agent handoff prompts from graph context");
70
72
  log(" skill Create, list, show, search, and validate skills");
71
73
  log(" capability List, search, show, and resolve cached capability surfaces");
72
74
  log(" spec List, show, and validate optional SPEC.md capability records");
73
75
  log(" archive Add, list, show, verify, and compress archive sidecars");
74
76
  log(" bundle Create, list, show, and verify full graph snapshot bundles");
75
- log(" graph Clone and fork whole mdkg graphs");
77
+ log(" graph Clone, fork, import, and inspect mdkg graph references");
76
78
  log(" subgraph Register, audit, plan, sync, materialize, and verify read-only child graph snapshots");
77
79
  log(" work Create and update work contracts, orders, receipts, and artifacts");
78
80
  log(" goal Inspect and advance recursive goal nodes");
@@ -236,8 +238,10 @@ function printDbHelp(log, subcommand) {
236
238
  log(" mdkg db queue stats [queue] [--json]");
237
239
  log(" mdkg db queue list <queue> [--status ready|leased|acked|dead_letter|all] [--limit <n>] [--json]");
238
240
  log(" mdkg db queue show <queue> <message-id> [--json]");
241
+ log(" mdkg db queue contract [--json]");
239
242
  log("\nSemantics:");
240
243
  log(" - queues are durable local delivery state, not canonical event history");
244
+ log(" - contract is read-only adapter metadata and does not require an initialized project DB");
241
245
  log(" - paused queues reject enqueue and claim");
242
246
  log(" - ack, fail, dead-letter, and release-expired are allowed while paused so leased work can settle");
243
247
  log(" - no raw SQL or hosted queue dependency is exposed");
@@ -258,6 +262,7 @@ function printDbHelp(log, subcommand) {
258
262
  log(" mdkg db queue ack|fail|dead-letter <queue> <message-id> --lease-owner <owner> [--json]");
259
263
  log(" mdkg db queue pause|resume <queue> [--json]");
260
264
  log(" mdkg db queue stats|list|show ... [--json]");
265
+ log(" mdkg db queue contract [--json]");
261
266
  log(" mdkg db snapshot seal [--queue-policy drain|paused] [--json]");
262
267
  log(" mdkg db snapshot verify [--json]");
263
268
  log(" mdkg db snapshot status [--json]");
@@ -326,12 +331,14 @@ function printPackHelp(log) {
326
331
  log(" --list-profiles List built-in pack profiles and exit");
327
332
  log("\nAdvanced shaping / debug flags:");
328
333
  log(" --depth --edges --strip-code --max-code-lines --max-chars --max-lines --max-tokens");
334
+ log(" --edges accepts parent, epic, relates, blocked_by, blocks, prev, next, context_refs, evidence_refs");
329
335
  log(" --truncation-report --stats-out");
330
336
  log("\nExamples:");
331
337
  log(" mdkg pack --list-profiles");
332
338
  log(" mdkg pack task-1");
333
339
  log(" mdkg pack task-1 --profile concise --dry-run --stats");
334
340
  log(" mdkg pack task-1 --visibility public --dry-run");
341
+ log(" mdkg pack task-1 --edges context_refs,evidence_refs --format json");
335
342
  log(" mdkg pack task-1 --skills auto --skills-depth full");
336
343
  log(" mdkg pack epic-2 --format json --profile headers");
337
344
  printGlobalOptions(log);
@@ -347,6 +354,19 @@ function printPackProfiles(log) {
347
354
  }
348
355
  }
349
356
  }
357
+ function printHandoffHelp(log) {
358
+ log("Usage:");
359
+ log(" mdkg handoff create <id-or-qid> [--ws <alias>] [--depth <n>] [--out <path>] [--json]");
360
+ log("\nPurpose:");
361
+ log(" - create a sanitized, copy-ready agent handoff from mdkg graph context");
362
+ log(" - summarize goal/work state, included pack nodes, latest checkpoint, boundaries, required checks, and next actions");
363
+ log(" - include raw secret, prompt, token, or payload marker warnings without copying raw node bodies into the handoff");
364
+ log(" - use pack traversal with context_refs and evidence_refs for background and proof nodes");
365
+ log("\nBoundaries:");
366
+ log(" - handoff create does not execute work, mutate graph nodes, or generate detailed node content");
367
+ log(" - --out must stay inside the repo root");
368
+ printGlobalOptions(log);
369
+ }
350
370
  function printSkillHelp(log, subcommand) {
351
371
  switch ((subcommand ?? "").toLowerCase()) {
352
372
  case "new":
@@ -586,14 +606,24 @@ function printGraphHelp(log, subcommand) {
586
606
  log(" - rewrites canonical numeric IDs and structured graph links deterministically");
587
607
  log(" - --select-goal requires --start-goal; on apply it activates the imported start goal, pauses competing active root goals, validates, then writes selected-goal state");
588
608
  break;
609
+ case "refs":
610
+ log("Usage:");
611
+ log(" mdkg graph refs <id-or-qid> [--ws <alias>] [--json]");
612
+ log("\nNotes:");
613
+ log(" - read-only summary of inbound and outbound graph references");
614
+ log(" - reports scope_refs, context_refs, evidence_refs, blockers, related refs, and structural links");
615
+ log(" - subgraph qids are inspectable but remain read-only");
616
+ break;
589
617
  default:
590
618
  log("Usage:");
591
619
  log(" mdkg graph clone <source-bundle-or-mdkg-dir> --target <path> [--json]");
592
620
  log(" mdkg graph fork <source-bundle-or-mdkg-dir> --target <path> [--start-goal <goal-id>] [--json]");
593
621
  log(" mdkg graph import-template <source-bundle-or-mdkg-dir> [--start-goal <goal-id>] [--select-goal] [--id-prefix <prefix>] [--dry-run] [--apply] [--json]");
622
+ log(" mdkg graph refs <id-or-qid> [--ws <alias>] [--json]");
594
623
  log("\nNotes:");
595
624
  log(" - graph clone/fork create authored graph state in separate target directories and preserve IDs");
596
625
  log(" - graph import-template imports template work nodes into the current graph with rewritten IDs");
626
+ log(" - graph refs is read-only and explains local plus subgraph graph relationships");
597
627
  log(" - subgraphs remain read-only bundle projections for orchestration context");
598
628
  }
599
629
  printGlobalOptions(log);
@@ -715,6 +745,14 @@ function printWorkHelp(log, subcommand) {
715
745
  log("Usage:");
716
746
  log(" mdkg work artifact add <order-or-receipt-id-or-qid> <file> [--id <archive.id>] [--kind source|artifact] [--json]");
717
747
  break;
748
+ case "validate":
749
+ log("Usage:");
750
+ log(" mdkg work validate [<id-or-qid>] [--type spec|work|work_order|receipt|feedback|dispute|proposal] [--json]");
751
+ log("\nNotes:");
752
+ log(" Read-only focused validation for agent workflow mirrors.");
753
+ log(" Reports typed diagnostics for SPEC.md, WORK.md, WORK_ORDER.md, RECEIPT.md, FEEDBACK.md, DISPUTE.md, and PROPOSAL.md files.");
754
+ log(" Obvious raw secret, prompt, token, or payload markers are warnings so humans and agents can review boundaries.");
755
+ break;
718
756
  default:
719
757
  log("Usage:");
720
758
  log(" mdkg work contract new ...");
@@ -722,8 +760,10 @@ function printWorkHelp(log, subcommand) {
722
760
  log(" mdkg work order new|status|update ...");
723
761
  log(" mdkg work receipt new|verify|update ...");
724
762
  log(" mdkg work artifact add ...");
763
+ log(" mdkg work validate [<id-or-qid>] [--type <workflow-type>] [--json]");
725
764
  log("\nNotes:");
726
765
  log(" - work commands mutate semantic mirror files only");
766
+ log(" - work validate is read-only and reports typed workflow diagnostics");
727
767
  log(" - production order, receipt, feedback, dispute, payment, ledger, marketplace inventory, fulfillment, and execution state remains canonical outside mdkg");
728
768
  log(" - do not store raw secrets, credentials, live payment state, ledger mutations, or canonical marketplace state in work mirrors");
729
769
  log(" - artifact:// refs identify external/runtime-managed artifacts; archive:// refs identify committed mdkg archive sidecars");
@@ -754,7 +794,7 @@ function printTaskHelp(log, subcommand) {
754
794
  case "done":
755
795
  log("Usage:");
756
796
  log(' mdkg task done <id-or-qid> [--ws <alias>] [--add-artifacts <a,...>] [--add-links <l,...>]');
757
- log(' [--add-refs <id,...>] [--checkpoint "<title>"] [--run-id <id>] [--note "<text>"] [--json]');
797
+ log(' [--add-refs <id,...>] [--checkpoint "<title>"] [--checkpoint-kind implementation|test-proof|goal-closeout|audit|handoff] [--run-id <id>] [--note "<text>"] [--json]');
758
798
  log("\nWhen to use:");
759
799
  log(" Mark a task-like node done, optionally create a checkpoint, and emit a completion event when enabled.");
760
800
  log(" Use `--checkpoint` for milestone compression, not every routine task completion.");
@@ -764,7 +804,7 @@ function printTaskHelp(log, subcommand) {
764
804
  log("Usage:");
765
805
  log(' mdkg task start <id-or-qid> [--ws <alias>] [--run-id <id>] [--note "<text>"] [--json]');
766
806
  log(" mdkg task update <id-or-qid> [options] [--json]");
767
- log(' mdkg task done <id-or-qid> [--checkpoint "<title>"] [options] [--json]');
807
+ log(' mdkg task done <id-or-qid> [--checkpoint "<title>"] [--checkpoint-kind implementation|test-proof|goal-closeout|audit|handoff] [options] [--json]');
768
808
  log("\nNotes:");
769
809
  log(" `mdkg task ...` only supports feat, task, bug, test, and spike nodes.");
770
810
  log(" Spikes use this lifecycle; there is no separate `mdkg spike ...` command family.");
@@ -778,7 +818,7 @@ function printGoalHelp(log, subcommand) {
778
818
  log("Usage:");
779
819
  log(" mdkg goal show <goal-id-or-qid> [--ws <alias>] [--json]");
780
820
  log("\nWhen to use:");
781
- log(" Inspect a goal condition, current goal state, active node, required skills, and required checks.");
821
+ log(" Inspect a goal condition, current goal state, active node, last active node, required skills, and required checks.");
782
822
  printGlobalOptions(log);
783
823
  return;
784
824
  case "next":
@@ -847,6 +887,9 @@ function printGoalHelp(log, subcommand) {
847
887
  log(` mdkg goal ${subcommand} <goal-id-or-qid> [--ws <alias>] [--json]`);
848
888
  log("\nWhen to use:");
849
889
  log(" Update durable goal state after agent or human review.");
890
+ if (subcommand === "done") {
891
+ log(" Done goals preserve the final active_node as last_active_node and stop routing actionable work.");
892
+ }
850
893
  printGlobalOptions(log);
851
894
  return;
852
895
  default:
@@ -863,6 +906,7 @@ function printGoalHelp(log, subcommand) {
863
906
  log("\nNotes:");
864
907
  log(" - goals orchestrate recursive progress; features, tasks, bugs, tests, and spikes are iterable work units");
865
908
  log(" - `mdkg goal next` is read-only; use `mdkg goal claim` to update active_node");
909
+ log(" - `mdkg goal done` moves active_node to last_active_node so completed goals keep history without staying actionable");
866
910
  log(" - `mdkg goal activate` enforces one active local root goal and pauses competing active goals");
867
911
  log(" - goal evaluation is report-only and never executes required_checks");
868
912
  log(" - subgraph goal qids are read-only; update the source workspace instead");
@@ -901,13 +945,18 @@ function printNextHelp(log) {
901
945
  }
902
946
  function printCheckpointHelp(log) {
903
947
  log("Usage:");
904
- log(" mdkg checkpoint new <title> [--ws <alias>] [--json]");
948
+ log(" mdkg checkpoint new <title> [--kind implementation|test-proof|goal-closeout|audit|handoff] [--ws <alias>] [--json]");
949
+ log(" Checkpoint bodies include command evidence, pass/fail status, warnings, changed surfaces, boundaries, and follow-up refs.");
905
950
  log(' [--relates <id,id,...>] [--scope <id,id,...>] [--run-id <id>] [--note "<text>"]');
906
951
  printGlobalOptions(log);
907
952
  }
908
953
  function printValidateHelp(log) {
909
954
  log("Usage:");
910
- log(" mdkg validate [--out <path>] [--quiet] [--json]");
955
+ log(" mdkg validate [--out <path>] [--quiet] [--changed-only] [--json]");
956
+ log("\nNotes:");
957
+ log(" Validates frontmatter schemas, graph references, visibility, skills, and events.");
958
+ log(" --changed-only filters warning presentation to changed .mdkg files while full graph errors still run.");
959
+ log(" JSON output includes warning_diagnostics with warning ids, categories, severity, paths, refs, and remediation text.");
911
960
  printGlobalOptions(log);
912
961
  }
913
962
  function printStatusHelp(log) {
@@ -1011,6 +1060,10 @@ function printFixHelp(log, subcommand) {
1011
1060
  function printFormatHelp(log) {
1012
1061
  log("Usage:");
1013
1062
  log(" mdkg format");
1063
+ log(" mdkg format --headings [--dry-run|--apply] [--json]");
1064
+ log("\nNotes:");
1065
+ log(" Default format normalizes frontmatter in place.");
1066
+ log(" --headings adds missing recommended body headings; it defaults to dry-run and requires --apply to write files.");
1014
1067
  printGlobalOptions(log);
1015
1068
  }
1016
1069
  function printDoctorHelp(log) {
@@ -1072,6 +1125,9 @@ function printCommandHelp(log, command, subcommand) {
1072
1125
  case "pack":
1073
1126
  printPackHelp(log);
1074
1127
  return;
1128
+ case "handoff":
1129
+ printHandoffHelp(log);
1130
+ return;
1075
1131
  case "skill":
1076
1132
  printSkillHelp(log, subcommand);
1077
1133
  return;
@@ -1436,6 +1492,12 @@ function runDbSubcommand(parsed, root) {
1436
1492
  }
1437
1493
  (0, db_1.runDbQueueCreateCommand)(common);
1438
1494
  return 0;
1495
+ case "contract":
1496
+ if (parsed.positionals.length > 3) {
1497
+ throw new errors_1.UsageError("mdkg db queue contract accepts no positional arguments");
1498
+ }
1499
+ (0, db_1.runDbQueueContractCommand)(common);
1500
+ return 0;
1439
1501
  case "pause":
1440
1502
  if (!queueName || parsed.positionals.length > 4) {
1441
1503
  throw new errors_1.UsageError("mdkg db queue pause requires <queue>");
@@ -1503,7 +1565,7 @@ function runDbSubcommand(parsed, root) {
1503
1565
  (0, db_1.runDbQueueShowCommand)(common);
1504
1566
  return 0;
1505
1567
  default:
1506
- throw new errors_1.UsageError("mdkg db queue requires create/pause/resume/enqueue/claim/ack/fail/dead-letter/release-expired/stats/list/show");
1568
+ throw new errors_1.UsageError("mdkg db queue requires create/contract/pause/resume/enqueue/claim/ack/fail/dead-letter/release-expired/stats/list/show");
1507
1569
  }
1508
1570
  }
1509
1571
  case "snapshot": {
@@ -1799,8 +1861,17 @@ function runGraphSubcommand(parsed, root) {
1799
1861
  (0, graph_1.runGraphImportTemplateCommand)({ root, source, startGoal, idPrefix, dryRun, apply, selectGoal, json });
1800
1862
  return 0;
1801
1863
  }
1864
+ case "refs": {
1865
+ const id = parsed.positionals[2];
1866
+ if (!id || parsed.positionals.length > 3) {
1867
+ throw new errors_1.UsageError("graph refs requires <id-or-qid>");
1868
+ }
1869
+ const ws = requireFlagValue("--ws", parsed.flags["--ws"]);
1870
+ (0, graph_1.runGraphRefsCommand)({ root, id, ws, json });
1871
+ return 0;
1872
+ }
1802
1873
  default:
1803
- throw new errors_1.UsageError("graph requires clone/fork/import-template");
1874
+ throw new errors_1.UsageError("graph requires clone/fork/import-template/refs");
1804
1875
  }
1805
1876
  }
1806
1877
  function runSubgraphSubcommand(parsed, root) {
@@ -1956,6 +2027,15 @@ function runWorkSubcommand(parsed, root) {
1956
2027
  (0, work_1.runWorkTriggerCommand)({ root, ws, targetRef, id, title, requester, enqueue, json });
1957
2028
  return 0;
1958
2029
  }
2030
+ if (domain === "validate") {
2031
+ const id = parsed.positionals[2];
2032
+ if (parsed.positionals.length > 3) {
2033
+ throw new errors_1.UsageError("work validate accepts at most one workflow reference");
2034
+ }
2035
+ const type = requireFlagValue("--type", parsed.flags["--type"]);
2036
+ (0, work_1.runWorkValidateCommand)({ root, ws, id, type, json });
2037
+ return 0;
2038
+ }
1959
2039
  if (domain === "contract" && action === "new") {
1960
2040
  const title = parsed.positionals.slice(3).join(" ");
1961
2041
  const id = requireFlagValue("--id", parsed.flags["--id"]);
@@ -2115,7 +2195,7 @@ function runWorkSubcommand(parsed, root) {
2115
2195
  (0, work_1.runWorkArtifactAddCommand)({ root, ws, targetId, file, id, kind, json });
2116
2196
  return 0;
2117
2197
  }
2118
- throw new errors_1.UsageError("work requires contract new, order new/update, receipt new/update, or artifact add");
2198
+ throw new errors_1.UsageError("work requires contract new, trigger, order new/update/status, receipt new/update/verify, artifact add, or validate");
2119
2199
  }
2120
2200
  function runSkillSubcommand(parsed, root) {
2121
2201
  const subcommand = (parsed.positionals[1] ?? "").toLowerCase();
@@ -2400,6 +2480,7 @@ function runTaskSubcommand(parsed, root) {
2400
2480
  const addLinks = requireFlagValue("--add-links", parsed.flags["--add-links"]);
2401
2481
  const addRefs = requireFlagValue("--add-refs", parsed.flags["--add-refs"]);
2402
2482
  const checkpoint = requireFlagValue("--checkpoint", parsed.flags["--checkpoint"]);
2483
+ const checkpointKind = requireFlagValue("--checkpoint-kind", parsed.flags["--checkpoint-kind"]);
2403
2484
  const runId = requireFlagValue("--run-id", parsed.flags["--run-id"]);
2404
2485
  const note = requireFlagValue("--note", parsed.flags["--note"]);
2405
2486
  const json = parseBooleanFlag("--json", parsed.flags["--json"]);
@@ -2411,6 +2492,7 @@ function runTaskSubcommand(parsed, root) {
2411
2492
  addLinks,
2412
2493
  addRefs,
2413
2494
  checkpoint,
2495
+ checkpointKind,
2414
2496
  runId,
2415
2497
  note,
2416
2498
  json,
@@ -2749,6 +2831,32 @@ function runCommand(parsed, root, runtime) {
2749
2831
  });
2750
2832
  return 0;
2751
2833
  }
2834
+ case "handoff": {
2835
+ const sub = (parsed.positionals[1] ?? "").toLowerCase();
2836
+ if (!sub) {
2837
+ throw new errors_1.UsageError("handoff requires a subcommand");
2838
+ }
2839
+ if (sub !== "create") {
2840
+ throw new errors_1.UsageError(`unknown handoff subcommand: ${sub}`);
2841
+ }
2842
+ const id = parsed.positionals[2];
2843
+ if (!id || parsed.positionals.length > 3) {
2844
+ throw new errors_1.UsageError("mdkg handoff create requires <id-or-qid>");
2845
+ }
2846
+ const ws = requireFlagValue("--ws", parsed.flags["--ws"]);
2847
+ const out = requireFlagValue("--out", parsed.flags["--out"]);
2848
+ const depth = parseNumberFlag("--depth", parsed.flags["--depth"]);
2849
+ const json = parseBooleanFlag("--json", parsed.flags["--json"]);
2850
+ (0, handoff_1.runHandoffCreateCommand)({
2851
+ root,
2852
+ id,
2853
+ ws,
2854
+ out,
2855
+ depth,
2856
+ json,
2857
+ });
2858
+ return 0;
2859
+ }
2752
2860
  case "next": {
2753
2861
  if (parsed.positionals.length > 2) {
2754
2862
  throw new errors_1.UsageError("next accepts at most one id");
@@ -2778,6 +2886,7 @@ function runCommand(parsed, root, runtime) {
2778
2886
  const ws = requireFlagValue("--ws", parsed.flags["--ws"]);
2779
2887
  const relates = requireFlagValue("--relates", parsed.flags["--relates"]);
2780
2888
  const scope = requireFlagValue("--scope", parsed.flags["--scope"]);
2889
+ const kind = requireFlagValue("--kind", parsed.flags["--kind"]);
2781
2890
  const status = requireFlagValue("--status", parsed.flags["--status"]);
2782
2891
  const priority = parseNumberFlag("--priority", parsed.flags["--priority"]);
2783
2892
  const template = requireFlagValue("--template", parsed.flags["--template"]);
@@ -2790,6 +2899,7 @@ function runCommand(parsed, root, runtime) {
2790
2899
  ws,
2791
2900
  relates,
2792
2901
  scope,
2902
+ kind,
2793
2903
  status,
2794
2904
  priority,
2795
2905
  template,
@@ -2805,8 +2915,9 @@ function runCommand(parsed, root, runtime) {
2805
2915
  }
2806
2916
  const out = requireFlagValue("--out", parsed.flags["--out"]);
2807
2917
  const quiet = parseBooleanFlag("--quiet", parsed.flags["--quiet"]);
2918
+ const changedOnly = parseBooleanFlag("--changed-only", parsed.flags["--changed-only"]);
2808
2919
  const json = parseBooleanFlag("--json", parsed.flags["--json"]);
2809
- (0, validate_1.runValidateCommand)({ root, out, quiet, json });
2920
+ (0, validate_1.runValidateCommand)({ root, out, quiet, json, changedOnly });
2810
2921
  return 0;
2811
2922
  }
2812
2923
  case "status": {
@@ -2850,7 +2961,17 @@ function runCommand(parsed, root, runtime) {
2850
2961
  if (parsed.positionals.length > 1) {
2851
2962
  throw new errors_1.UsageError("format does not accept positional arguments");
2852
2963
  }
2853
- (0, format_1.runFormatCommand)({ root });
2964
+ const headings = parseBooleanFlag("--headings", parsed.flags["--headings"]);
2965
+ const dryRun = parseBooleanFlag("--dry-run", parsed.flags["--dry-run"]);
2966
+ const apply = parseBooleanFlag("--apply", parsed.flags["--apply"]);
2967
+ const json = parseBooleanFlag("--json", parsed.flags["--json"]);
2968
+ if (!headings && (dryRun || apply || json)) {
2969
+ throw new errors_1.UsageError("format --dry-run, --apply, and --json require --headings");
2970
+ }
2971
+ if (dryRun && apply) {
2972
+ throw new errors_1.UsageError("format --headings cannot use --dry-run and --apply together");
2973
+ }
2974
+ (0, format_1.runFormatCommand)({ root, headings, dryRun, apply, json });
2854
2975
  return 0;
2855
2976
  case "doctor": {
2856
2977
  if (parsed.positionals.length > 1) {