@event4u/agent-config 9.11.0 → 9.13.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 (183) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +80 -204
  3. package/README.md +8 -1
  4. package/dist/agent-src/commands/fix/ci.md +29 -0
  5. package/dist/agent-src/commands/pr/create.md +60 -0
  6. package/dist/agent-src/contexts/authority/kernel-rule-edits.md +18 -2
  7. package/dist/agent-src/rules/active-remediation.md +0 -2
  8. package/dist/agent-src/rules/architecture.md +0 -1
  9. package/dist/agent-src/rules/artifact-drafting-protocol.md +0 -4
  10. package/dist/agent-src/rules/autonomous-execution.md +1 -2
  11. package/dist/agent-src/rules/broken-access-control.md +0 -2
  12. package/dist/agent-src/rules/code-comment-discipline.md +0 -3
  13. package/dist/agent-src/rules/code-provenance.md +0 -3
  14. package/dist/agent-src/rules/communication-through-line.md +2 -3
  15. package/dist/agent-src/rules/content-quoting-floor.md +0 -2
  16. package/dist/agent-src/rules/context-hygiene.md +1 -3
  17. package/dist/agent-src/rules/decision-revisit-gate.md +0 -2
  18. package/dist/agent-src/rules/design-fidelity.md +30 -1
  19. package/dist/agent-src/rules/domain-adoption-policy.md +0 -3
  20. package/dist/agent-src/rules/downstream-changes.md +10 -1
  21. package/dist/agent-src/rules/external-reference-deep-dive.md +0 -7
  22. package/dist/agent-src/rules/fast-path-marker-visibility.md +0 -1
  23. package/dist/agent-src/rules/git-history-discipline.md +0 -7
  24. package/dist/agent-src/rules/guidelines.md +0 -2
  25. package/dist/agent-src/rules/improve-before-implement.md +4 -2
  26. package/dist/agent-src/rules/invite-challenge.md +0 -4
  27. package/dist/agent-src/rules/linked-projects-onboarding-gate.md +0 -2
  28. package/dist/agent-src/rules/markdown-safe-codeblocks.md +0 -1
  29. package/dist/agent-src/rules/minimal-safe-diff.md +2 -2
  30. package/dist/agent-src/rules/missing-tool-handling.md +0 -1
  31. package/dist/agent-src/rules/no-attribution-footers.md +0 -3
  32. package/dist/agent-src/rules/no-decorative-emojis-in-git-surfaces.md +8 -5
  33. package/dist/agent-src/rules/no-pr-progress-comments.md +1 -3
  34. package/dist/agent-src/rules/no-roadmap-references.md +0 -2
  35. package/dist/agent-src/rules/output-discipline.md +0 -1
  36. package/dist/agent-src/rules/prefer-enums-over-literals.md +0 -2
  37. package/dist/agent-src/rules/preservation-guard.md +0 -3
  38. package/dist/agent-src/rules/role-mode-adherence.md +0 -1
  39. package/dist/agent-src/rules/secret-vcs-guard.md +0 -2
  40. package/dist/agent-src/rules/senior-engineering-discipline.md +0 -2
  41. package/dist/agent-src/rules/session-canary.md +0 -2
  42. package/dist/agent-src/rules/size-enforcement.md +0 -5
  43. package/dist/agent-src/rules/source-confidentiality.md +0 -3
  44. package/dist/agent-src/rules/source-discovery-gate.md +0 -2
  45. package/dist/agent-src/rules/think-before-action.md +3 -3
  46. package/dist/agent-src/rules/token-budget-discipline.md +0 -1
  47. package/dist/agent-src/rules/token-efficiency.md +1 -2
  48. package/dist/agent-src/rules/tool-safety.md +0 -1
  49. package/dist/agent-src/rules/user-interaction.md +0 -3
  50. package/dist/agent-src/rules/user-interrupt-priority.md +0 -1
  51. package/dist/agent-src/skills/agent-docs-writing/SKILL.md +8 -0
  52. package/dist/agent-src/skills/ai-code-blindspots/SKILL.md +1 -0
  53. package/dist/agent-src/skills/analysis-skill-router/SKILL.md +55 -86
  54. package/dist/agent-src/skills/character-consistency/SKILL.md +7 -4
  55. package/dist/agent-src/skills/decision-record/SKILL.md +8 -0
  56. package/dist/agent-src/skills/design-intelligence/SKILL.md +27 -1
  57. package/dist/agent-src/skills/design-intelligence/data/font-pairings-reference.csv +74 -74
  58. package/dist/agent-src/skills/design-intelligence/data/manifest.json +2 -0
  59. package/dist/agent-src/skills/design-review/SKILL.md +11 -0
  60. package/dist/agent-src/skills/design-system-capture/reference/design-system-json.md +8 -0
  61. package/dist/agent-src/skills/design-tokens/scripts/tokens.ts +0 -7
  62. package/dist/agent-src/skills/existing-ui-audit/SKILL.md +34 -3
  63. package/dist/agent-src/skills/fe-design/SKILL.md +10 -0
  64. package/dist/agent-src/skills/motion-choreographer/SKILL.md +7 -4
  65. package/dist/agent-src/skills/overbuild-review-lens/SKILL.md +201 -0
  66. package/dist/agent-src/skills/performance/SKILL.md +14 -0
  67. package/dist/agent-src/skills/pixar-storyteller/SKILL.md +8 -5
  68. package/dist/agent-src/skills/scene-expander/SKILL.md +9 -6
  69. package/dist/agent-src/skills/supply-chain-intake/SKILL.md +10 -0
  70. package/dist/agent-src/skills/typography-system/SKILL.md +55 -11
  71. package/dist/agent-src/skills/ui-apply-generic/SKILL.md +180 -0
  72. package/dist/agent-src/skills/universal-project-analysis/SKILL.md +14 -37
  73. package/dist/agent-src/skills/video-director/SKILL.md +9 -6
  74. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  75. package/dist/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +162 -17
  76. package/dist/agent-src/templates/scripts/work_engine/directives/ui/design.ts +118 -0
  77. package/dist/agent-src/templates/scripts/work_engine/directives/ui/polish.ts +49 -6
  78. package/dist/agent-src/templates/scripts/work_engine/directives/ui/review.ts +9 -5
  79. package/dist/agent-src/templates/scripts/work_engine/directives/ui/stack_bundles.ts +182 -29
  80. package/dist/agent-src/templates/scripts/work_engine/stack/detect.ts +311 -24
  81. package/dist/agent-src/templates/scripts/work_engine/state.ts +55 -0
  82. package/dist/cli-delegate/chunk-523HCFYO.js +90 -0
  83. package/dist/cli-delegate/{chunk-IR7P7JWA.js → chunk-A3HJ6NTI.js} +271 -59
  84. package/dist/cli-delegate/chunk-EJYIGZ3T.js +125 -0
  85. package/dist/cli-delegate/{chunk-RDGRHAAB.js → chunk-HYWSRNUX.js} +6 -86
  86. package/dist/cli-delegate/{chunk-YMFO6FDN.js → chunk-QFKQLQ7X.js} +313 -81
  87. package/dist/cli-delegate/{chunk-4SV3XGFA.js → chunk-TEGJU2JX.js} +7 -9
  88. package/dist/cli-delegate/chunk-TJIAM5FW.js +133 -0
  89. package/dist/cli-delegate/cmd_conformance.js +4 -7
  90. package/dist/cli-delegate/cmd_doctor.js +3 -5
  91. package/dist/cli-delegate/cmd_explain.js +153 -85
  92. package/dist/cli-delegate/cmd_export.js +5 -3
  93. package/dist/cli-delegate/cmd_fleet.js +2 -1
  94. package/dist/cli-delegate/cmd_preflight.js +6 -123
  95. package/dist/cli-delegate/cmd_prune.js +5 -3
  96. package/dist/cli-delegate/cmd_settings_migrate.js +5 -3
  97. package/dist/cli-delegate/cmd_sync.js +5 -3
  98. package/dist/cli-delegate/cmd_uninstall.js +6 -5
  99. package/dist/cli-delegate/cmd_validate.js +5 -3
  100. package/dist/discovery/deprecation-report.md +1 -1
  101. package/dist/discovery/discovery-manifest.json +116 -72
  102. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  103. package/dist/discovery/discovery-manifest.summary.md +3 -3
  104. package/dist/discovery/orphan-report.md +1 -1
  105. package/dist/discovery/packs.json +7 -5
  106. package/dist/discovery/trust-report.md +2 -2
  107. package/dist/discovery/workspaces.json +6 -4
  108. package/dist/hooks/dispatch.js +174 -13
  109. package/dist/install/install.mjs +605 -412
  110. package/dist/install/ruleInScope.js +123 -0
  111. package/dist/install/ruleInScope.js.map +1 -0
  112. package/dist/install/rule_scope.js +2 -2
  113. package/dist/install/rule_scope.js.map +1 -1
  114. package/dist/install/wizard-plan.js +10 -1
  115. package/dist/install/wizard-plan.js.map +1 -1
  116. package/dist/mcp/registry-manifest.json +3 -3
  117. package/dist/mcp/server.json +2 -2
  118. package/dist/mcp/server.mjs +710 -2491
  119. package/dist/router.json +1 -1
  120. package/dist/scripts/condense.js +8 -24
  121. package/dist/scripts/condense.js.map +1 -1
  122. package/docs/MIGRATION.md +1 -1
  123. package/docs/guidelines/agent-infra/agent-interaction-and-decision-quality.md +71 -0
  124. package/docs/guidelines/agent-infra/minimal-safe-diff-mechanics.md +24 -1
  125. package/docs/guidelines/code-clarity.md +9 -2
  126. package/docs/guidelines/design-fidelity-mechanics.md +58 -0
  127. package/llms.txt +63 -27
  128. package/package.json +4 -4
  129. package/src/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +162 -17
  130. package/src/agent-src/templates/scripts/work_engine/directives/ui/design.ts +118 -0
  131. package/src/agent-src/templates/scripts/work_engine/directives/ui/polish.ts +49 -6
  132. package/src/agent-src/templates/scripts/work_engine/directives/ui/review.ts +9 -5
  133. package/src/agent-src/templates/scripts/work_engine/directives/ui/stack_bundles.ts +182 -29
  134. package/src/agent-src/templates/scripts/work_engine/stack/detect.ts +311 -24
  135. package/src/agent-src/templates/scripts/work_engine/state.ts +55 -0
  136. package/src/config/agent-settings.template.yml +8 -0
  137. package/src/install/ruleInScope.ts +133 -0
  138. package/src/install/rule_scope.ts +2 -2
  139. package/src/install/wizard-plan.ts +11 -1
  140. package/src/scripts/_lib/counted_probe.ts +142 -0
  141. package/src/scripts/_lib/global_deploy_inventory.ts +38 -2
  142. package/src/scripts/_lib/overbuild_lens_contract.ts +196 -0
  143. package/src/scripts/_lib/release_scope.ts +207 -0
  144. package/src/scripts/ai_council/stance_tally.ts +37 -2
  145. package/src/scripts/audit_auto_rules.ts +9 -9
  146. package/src/scripts/audit_likelihood.ts +3 -3
  147. package/src/scripts/audit_overlap.ts +2 -2
  148. package/src/scripts/audit_skill_overlap.ts +233 -95
  149. package/src/scripts/audit_skill_overlap_allowlist.json +4 -0
  150. package/src/scripts/build_proof.ts +15 -1
  151. package/src/scripts/check_dependency_floors.ts +16 -6
  152. package/src/scripts/check_gate_coverage.ts +6 -6
  153. package/src/scripts/check_installer_import_purity.ts +295 -0
  154. package/src/scripts/check_kernel_rule_bundle.ts +5 -4
  155. package/src/scripts/check_token_quality_golden.ts +0 -18
  156. package/src/scripts/code_graph/loader.ts +35 -6
  157. package/src/scripts/compile_router.ts +3 -8
  158. package/src/scripts/condense.ts +9 -30
  159. package/src/scripts/explain_run.ts +0 -1
  160. package/src/scripts/generate_pack_manifests.ts +3 -20
  161. package/src/scripts/hooks/block_kernel_rule_writes.ts +145 -10
  162. package/src/scripts/hooks/block_no_verify.ts +101 -0
  163. package/src/scripts/install-hooks.sh +36 -4
  164. package/src/scripts/install.ts +210 -5
  165. package/src/scripts/lint_agent_security.ts +5 -4
  166. package/src/scripts/lint_framework_leakage_allowlist.json +2 -2
  167. package/src/scripts/lint_regression.ts +92 -1
  168. package/src/scripts/lint_skill_descriptions.ts +93 -5
  169. package/src/scripts/lint_ui_stack_bundles.ts +31 -0
  170. package/src/scripts/project_thin_rules.ts +2 -2
  171. package/src/scripts/release.ts +107 -3
  172. package/src/scripts/resolve_lint_scope.ts +53 -0
  173. package/src/scripts/router_telemetry.ts +0 -5
  174. package/src/scripts/runtime_dispatcher.ts +40 -0
  175. package/src/scripts/schemas/pack.schema.json +1 -5
  176. package/src/scripts/schemas/rule.schema.json +1 -2
  177. package/src/scripts/self_review_gate.ts +15 -73
  178. package/src/scripts/skill_linter.ts +93 -11
  179. package/src/scripts/sweep_dead_scan_roots.ts +550 -0
  180. package/src/scripts/trigger_coverage.ts +11 -37
  181. package/dist/cli-delegate/chunk-7DSAMZFU.js +0 -356
  182. package/dist/cli-delegate/chunk-BJGXZNPM.js +0 -266
  183. package/dist/cli-delegate/chunk-TFG57JJM.js +0 -1969
@@ -4,9 +4,6 @@ import {
4
4
  StateLoadError,
5
5
  load_state
6
6
  } from "./chunk-GME3Q44L.js";
7
- import {
8
- artefact_roots
9
- } from "./chunk-BJGXZNPM.js";
10
7
  import {
11
8
  DEFAULT_PROJECT_FILE,
12
9
  ProjectRootError,
@@ -20,15 +17,86 @@ import {
20
17
  } from "./chunk-J55WI3RR.js";
21
18
 
22
19
  // src/scripts/_cli/cmd_explain.ts
23
- import * as fs8 from "node:fs";
24
- import * as path7 from "node:path";
20
+ import * as fs9 from "node:fs";
21
+ import * as path8 from "node:path";
25
22
  import process2 from "node:process";
26
- import { fileURLToPath, pathToFileURL } from "node:url";
23
+ import { fileURLToPath as fileURLToPath2, pathToFileURL } from "node:url";
27
24
 
28
25
  // src/scripts/config/presets.ts
29
- import * as fs from "node:fs";
26
+ import * as fs2 from "node:fs";
30
27
  import { createRequire } from "node:module";
28
+ import * as path2 from "node:path";
29
+
30
+ // src/scripts/_lib/agent_src.ts
31
+ import * as fs from "node:fs";
31
32
  import * as path from "node:path";
33
+ import { fileURLToPath } from "node:url";
34
+ var _HERE = path.dirname(fileURLToPath(import.meta.url));
35
+ var _DEFAULT_ROOT = path.resolve(_HERE, "..", "..", "..");
36
+ function _deriveRoots(root) {
37
+ const packages = path.join(root, "packages");
38
+ const src = path.join(root, "src");
39
+ return {
40
+ ROOT: root,
41
+ LEGACY_SRC: path.join(root, ".agent-src.uncondensed"),
42
+ PACKAGES: packages,
43
+ PACKAGE_CORE: path.join(packages, "core"),
44
+ SRC: src,
45
+ SRC_SKILLS: path.join(src, "skills"),
46
+ SRC_RULES: path.join(src, "rules"),
47
+ SRC_AGENT: path.join(src, "agent-src"),
48
+ SRC_DOMAINS: path.join(src, "domains")
49
+ };
50
+ }
51
+ var _roots = _deriveRoots(_DEFAULT_ROOT);
52
+ function _isDir(p) {
53
+ try {
54
+ return fs.statSync(p).isDirectory();
55
+ } catch {
56
+ return false;
57
+ }
58
+ }
59
+ function _exists(p) {
60
+ try {
61
+ fs.statSync(p);
62
+ return true;
63
+ } catch {
64
+ return false;
65
+ }
66
+ }
67
+ function _iterdirSorted(p) {
68
+ let names;
69
+ try {
70
+ names = fs.readdirSync(p);
71
+ } catch {
72
+ return [];
73
+ }
74
+ names.sort();
75
+ return names.map((name) => path.join(p, name));
76
+ }
77
+ function artefact_roots() {
78
+ const roots = [];
79
+ if (_exists(_roots.LEGACY_SRC)) {
80
+ roots.push(_roots.LEGACY_SRC);
81
+ }
82
+ if (_exists(_roots.PACKAGES)) {
83
+ for (const pkg of _iterdirSorted(_roots.PACKAGES)) {
84
+ const sub = path.join(pkg, ".agent-src.uncondensed");
85
+ if (_isDir(sub)) {
86
+ roots.push(sub);
87
+ }
88
+ }
89
+ }
90
+ if (_isDir(_roots.SRC_AGENT)) {
91
+ roots.push(_roots.SRC_AGENT);
92
+ }
93
+ if (_isDir(_roots.SRC_SKILLS) || _isDir(_roots.SRC_RULES)) {
94
+ roots.push(_roots.SRC);
95
+ }
96
+ return roots;
97
+ }
98
+
99
+ // src/scripts/config/presets.ts
32
100
  var _require = createRequire(import.meta.url);
33
101
  var PRESET_ID_ENV = "AGENT_CONFIG_PRESET_ID";
34
102
  var DEFAULT_PRESET_ID = "balanced";
@@ -79,7 +147,7 @@ function _load_yaml(p) {
79
147
  }
80
148
  let text;
81
149
  try {
82
- text = fs.readFileSync(p, "utf-8");
150
+ text = fs2.readFileSync(p, "utf-8");
83
151
  } catch (exc) {
84
152
  logger.warning("preset read failed for %s: %s", p, String(exc));
85
153
  return {};
@@ -97,8 +165,8 @@ function _load_yaml(p) {
97
165
  return _isPlainDict(data) ? data : {};
98
166
  }
99
167
  function _preset_file(project_root, preset_id) {
100
- const legacy = path.join(project_root, PRESETS_DIRNAME, `${preset_id}.yml`);
101
- if (_exists(legacy)) {
168
+ const legacy = path2.join(project_root, PRESETS_DIRNAME, `${preset_id}.yml`);
169
+ if (_exists2(legacy)) {
102
170
  return legacy;
103
171
  }
104
172
  let roots;
@@ -108,8 +176,8 @@ function _preset_file(project_root, preset_id) {
108
176
  return legacy;
109
177
  }
110
178
  for (const root of roots) {
111
- const candidate = path.join(root, "presets", `${preset_id}.yml`);
112
- if (_exists(candidate)) {
179
+ const candidate = path2.join(root, "presets", `${preset_id}.yml`);
180
+ if (_exists2(candidate)) {
113
181
  return candidate;
114
182
  }
115
183
  }
@@ -180,7 +248,7 @@ function resolve_preset(params) {
180
248
  source = SOURCE_DEFAULT;
181
249
  }
182
250
  const yaml_path = _preset_file(params.project_root, preset_id);
183
- if (!_exists(yaml_path)) {
251
+ if (!_exists2(yaml_path)) {
184
252
  throw new PresetError(
185
253
  `preset.id=${_repr(preset_id)} (${source}) but ${yaml_path} not found`
186
254
  );
@@ -242,9 +310,9 @@ function resolve_preset(params) {
242
310
  overrides
243
311
  });
244
312
  }
245
- function _exists(p) {
313
+ function _exists2(p) {
246
314
  try {
247
- fs.statSync(p);
315
+ fs2.statSync(p);
248
316
  return true;
249
317
  } catch {
250
318
  return false;
@@ -297,9 +365,9 @@ function _repr(s) {
297
365
  }
298
366
 
299
367
  // src/scripts/config/profiles.ts
300
- import * as fs2 from "node:fs";
368
+ import * as fs3 from "node:fs";
301
369
  import { createRequire as createRequire2 } from "node:module";
302
- import * as path2 from "node:path";
370
+ import * as path3 from "node:path";
303
371
  var _require2 = createRequire2(import.meta.url);
304
372
  var PROFILE_ID_ENV = "AGENT_CONFIG_PROFILE_ID";
305
373
  var DEFAULT_PROFILE_ID = "developer";
@@ -350,7 +418,7 @@ function _load_yaml2(p) {
350
418
  }
351
419
  let text;
352
420
  try {
353
- text = fs2.readFileSync(p, "utf-8");
421
+ text = fs3.readFileSync(p, "utf-8");
354
422
  } catch (exc) {
355
423
  logger.warning("profile read failed for %s: %s", p, String(exc));
356
424
  return {};
@@ -368,8 +436,8 @@ function _load_yaml2(p) {
368
436
  return _isPlainDict2(data) ? data : {};
369
437
  }
370
438
  function _profile_file(project_root, profile_id) {
371
- const legacy = path2.join(project_root, PROFILES_DIRNAME, `${profile_id}.yml`);
372
- if (_exists2(legacy)) {
439
+ const legacy = path3.join(project_root, PROFILES_DIRNAME, `${profile_id}.yml`);
440
+ if (_exists3(legacy)) {
373
441
  return legacy;
374
442
  }
375
443
  let roots;
@@ -379,8 +447,8 @@ function _profile_file(project_root, profile_id) {
379
447
  return legacy;
380
448
  }
381
449
  for (const root of roots) {
382
- const candidate = path2.join(root, "profiles", `${profile_id}.yml`);
383
- if (_exists2(candidate)) {
450
+ const candidate = path3.join(root, "profiles", `${profile_id}.yml`);
451
+ if (_exists3(candidate)) {
384
452
  return candidate;
385
453
  }
386
454
  }
@@ -432,14 +500,14 @@ function _pick_id2(pack_profile_id, user_settings, runtime_id) {
432
500
  }
433
501
  function resolve_profile(params) {
434
502
  const settings = params.user_settings ?? {};
435
- const settings_file = path2.join(params.project_root, DEFAULT_PROJECT_FILE);
503
+ const settings_file = path3.join(params.project_root, DEFAULT_PROJECT_FILE);
436
504
  const [profile_id, source] = _pick_id2(
437
505
  params.pack_profile_id ?? null,
438
506
  settings,
439
507
  params.runtime_id ?? null
440
508
  );
441
509
  if (profile_id === null) {
442
- if (_exists2(settings_file)) {
510
+ if (_exists3(settings_file)) {
443
511
  return new ResolvedProfile({
444
512
  id: DEFAULT_PROFILE_ID,
445
513
  source: SOURCE_MISSING,
@@ -453,16 +521,16 @@ function resolve_profile(params) {
453
521
  );
454
522
  }
455
523
  const yaml_path = _profile_file(params.project_root, profile_id);
456
- if (!_exists2(yaml_path)) {
524
+ if (!_exists3(yaml_path)) {
457
525
  throw new ProfileError(
458
526
  `profile.id=${_repr2(profile_id)} (${source}) but ${yaml_path} not found`
459
527
  );
460
528
  }
461
529
  return _build_resolved(profile_id, _load_yaml2(yaml_path), { source });
462
530
  }
463
- function _exists2(p) {
531
+ function _exists3(p) {
464
532
  try {
465
- fs2.statSync(p);
533
+ fs3.statSync(p);
466
534
  return true;
467
535
  } catch {
468
536
  return false;
@@ -482,7 +550,7 @@ function _repr2(s) {
482
550
  }
483
551
 
484
552
  // src/scripts/_cli/explain_last/index.ts
485
- import * as fs7 from "node:fs";
553
+ import * as fs8 from "node:fs";
486
554
 
487
555
  // src/scripts/_cli/explain_last/scrubber.ts
488
556
  var LONG_STRING_THRESHOLD = 200;
@@ -638,8 +706,8 @@ function build(state) {
638
706
  }
639
707
 
640
708
  // src/scripts/_cli/explain_last/council.ts
641
- import * as fs3 from "node:fs";
642
- import * as path3 from "node:path";
709
+ import * as fs4 from "node:fs";
710
+ import * as path4 from "node:path";
643
711
  var RUN_WINDOW_SECONDS = 3600;
644
712
  function _pySlice200(s) {
645
713
  const cps = Array.from(s);
@@ -650,26 +718,26 @@ function _firstLine(s) {
650
718
  return m.length > 0 ? m[0] : void 0;
651
719
  }
652
720
  function _candidate_files(project_root) {
653
- const sessions_root = path3.join(
721
+ const sessions_root = path4.join(
654
722
  project_root,
655
723
  "agents",
656
724
  "runtime",
657
725
  "council",
658
726
  "sessions"
659
727
  );
660
- const tmp_root = path3.join(project_root, "tmp");
728
+ const tmp_root = path4.join(project_root, "tmp");
661
729
  const candidates = [];
662
- if (_isDir(sessions_root)) {
730
+ if (_isDir2(sessions_root)) {
663
731
  for (const sub of _iterdir(sessions_root)) {
664
- if (_isDir(sub)) {
665
- const candidate = path3.join(sub, "council-responses.json");
666
- if (fs3.existsSync(candidate)) {
732
+ if (_isDir2(sub)) {
733
+ const candidate = path4.join(sub, "council-responses.json");
734
+ if (fs4.existsSync(candidate)) {
667
735
  candidates.push(candidate);
668
736
  }
669
737
  }
670
738
  }
671
739
  }
672
- if (fs3.existsSync(tmp_root)) {
740
+ if (fs4.existsSync(tmp_root)) {
673
741
  candidates.push(..._glob(tmp_root, "council-", ".json").sort());
674
742
  }
675
743
  return candidates;
@@ -679,7 +747,7 @@ function _pick_recent(candidates, anchor_mtime) {
679
747
  for (const p of candidates) {
680
748
  let mtime;
681
749
  try {
682
- mtime = fs3.statSync(p).mtimeMs / 1e3;
750
+ mtime = fs4.statSync(p).mtimeMs / 1e3;
683
751
  } catch {
684
752
  continue;
685
753
  }
@@ -718,7 +786,7 @@ function _extract_member(entry) {
718
786
  function build2(project_root, state_file) {
719
787
  let anchor;
720
788
  try {
721
- anchor = fs3.statSync(state_file).mtimeMs / 1e3;
789
+ anchor = fs4.statSync(state_file).mtimeMs / 1e3;
722
790
  } catch {
723
791
  return null;
724
792
  }
@@ -732,7 +800,7 @@ function build2(project_root, state_file) {
732
800
  }
733
801
  let raw;
734
802
  try {
735
- raw = JSON.parse(fs3.readFileSync(picked, "utf-8"));
803
+ raw = JSON.parse(fs4.readFileSync(picked, "utf-8"));
736
804
  } catch {
737
805
  return null;
738
806
  }
@@ -751,9 +819,9 @@ function build2(project_root, state_file) {
751
819
  }
752
820
  return members.length > 0 ? members : null;
753
821
  }
754
- function _isDir(p) {
822
+ function _isDir2(p) {
755
823
  try {
756
- return fs3.statSync(p).isDirectory();
824
+ return fs4.statSync(p).isDirectory();
757
825
  } catch {
758
826
  return false;
759
827
  }
@@ -761,20 +829,20 @@ function _isDir(p) {
761
829
  function _iterdir(p) {
762
830
  let names;
763
831
  try {
764
- names = fs3.readdirSync(p);
832
+ names = fs4.readdirSync(p);
765
833
  } catch {
766
834
  return [];
767
835
  }
768
- return names.map((n) => path3.join(p, n));
836
+ return names.map((n) => path4.join(p, n));
769
837
  }
770
838
  function _glob(dir, prefix, suffix) {
771
839
  let names;
772
840
  try {
773
- names = fs3.readdirSync(dir);
841
+ names = fs4.readdirSync(dir);
774
842
  } catch {
775
843
  return [];
776
844
  }
777
- return names.filter((n) => n.startsWith(prefix) && n.endsWith(suffix)).map((n) => path3.join(dir, n));
845
+ return names.filter((n) => n.startsWith(prefix) && n.endsWith(suffix)).map((n) => path4.join(dir, n));
778
846
  }
779
847
  function _pyTruthy2(value) {
780
848
  if (value === null || value === void 0) {
@@ -853,8 +921,8 @@ function build3(state) {
853
921
 
854
922
  // src/scripts/_cli/explain_last/inputs.ts
855
923
  import { createRequire as createRequire3 } from "node:module";
856
- import * as fs4 from "node:fs";
857
- import * as path4 from "node:path";
924
+ import * as fs5 from "node:fs";
925
+ import * as path5 from "node:path";
858
926
  var _require3 = createRequire3(import.meta.url);
859
927
  var _DEFAULT_RULE_LOADING_TIER = "balanced";
860
928
  var _SILENCED_LOGGERS = [
@@ -867,8 +935,8 @@ function _silence_resolver_warnings(body) {
867
935
  return body();
868
936
  }
869
937
  function _load_settings(project_root) {
870
- const p = path4.join(project_root, DEFAULT_PROJECT_FILE);
871
- if (!fs4.existsSync(p)) {
938
+ const p = path5.join(project_root, DEFAULT_PROJECT_FILE);
939
+ if (!fs5.existsSync(p)) {
872
940
  return {};
873
941
  }
874
942
  return load_agent_settings({ project_path: p }) ?? {};
@@ -947,10 +1015,10 @@ function build4(project_root) {
947
1015
  }
948
1016
  function _pack_marker(project_root) {
949
1017
  for (const candidate of [
950
- path4.join(project_root, ".agent-pack.yml"),
951
- path4.join(project_root, ".agent-src.uncondensed", ".agent-pack.yml")
1018
+ path5.join(project_root, ".agent-pack.yml"),
1019
+ path5.join(project_root, ".agent-src.uncondensed", ".agent-pack.yml")
952
1020
  ]) {
953
- if (fs4.existsSync(candidate)) {
1021
+ if (fs5.existsSync(candidate)) {
954
1022
  return candidate;
955
1023
  }
956
1024
  }
@@ -969,7 +1037,7 @@ function build_pack(project_root) {
969
1037
  }
970
1038
  let raw;
971
1039
  try {
972
- const text = fs4.readFileSync(marker, "utf-8");
1040
+ const text = fs5.readFileSync(marker, "utf-8");
973
1041
  raw = YAML.parse(text, { version: "1.1" });
974
1042
  if (raw === null || raw === void 0) {
975
1043
  raw = {};
@@ -985,7 +1053,7 @@ function build_pack(project_root) {
985
1053
  if (typeof pack_id !== "string" || pack_id.trim() === "") {
986
1054
  return null;
987
1055
  }
988
- const reasonRaw = _pyTruthy4(rawDict.reason) ? rawDict.reason : `declared in ${path4.basename(marker)}`;
1056
+ const reasonRaw = _pyTruthy4(rawDict.reason) ? rawDict.reason : `declared in ${path5.basename(marker)}`;
989
1057
  return {
990
1058
  id: scrub_string(pack_id.trim()),
991
1059
  reason: scrub_string(String(reasonRaw))
@@ -996,15 +1064,15 @@ function _isOsError(exc) {
996
1064
  }
997
1065
 
998
1066
  // src/scripts/_cli/explain_last/memory.ts
999
- import * as fs5 from "node:fs";
1000
- import * as path5 from "node:path";
1067
+ import * as fs6 from "node:fs";
1068
+ import * as path6 from "node:path";
1001
1069
  var PyFloat = class {
1002
1070
  constructor(value) {
1003
1071
  this.value = value;
1004
1072
  }
1005
1073
  value;
1006
1074
  };
1007
- var MEMORY_SIDECAR = path5.join(".agent-memory", "hits.jsonl");
1075
+ var MEMORY_SIDECAR = path6.join(".agent-memory", "hits.jsonl");
1008
1076
  function _pyTruthy5(value) {
1009
1077
  if (value === null || value === void 0) {
1010
1078
  return false;
@@ -1126,14 +1194,14 @@ function _splitlines(s) {
1126
1194
  return out;
1127
1195
  }
1128
1196
  function _from_sidecar(project_root, run_id) {
1129
- const p = path5.join(project_root, MEMORY_SIDECAR);
1130
- if (!fs5.existsSync(p)) {
1197
+ const p = path6.join(project_root, MEMORY_SIDECAR);
1198
+ if (!fs6.existsSync(p)) {
1131
1199
  return [];
1132
1200
  }
1133
1201
  const entries = [];
1134
1202
  let content;
1135
1203
  try {
1136
- content = fs5.readFileSync(p, "utf-8");
1204
+ content = fs6.readFileSync(p, "utf-8");
1137
1205
  } catch {
1138
1206
  return [];
1139
1207
  }
@@ -1241,17 +1309,17 @@ function build6(state) {
1241
1309
  }
1242
1310
 
1243
1311
  // src/scripts/_cli/explain_last/route.ts
1244
- import * as fs6 from "node:fs";
1245
- import * as path6 from "node:path";
1312
+ import * as fs7 from "node:fs";
1313
+ import * as path7 from "node:path";
1246
1314
  var ROUTER_FILENAME = "router.json";
1247
- var ROUTER_RELATIVE = path6.join("dist", ROUTER_FILENAME);
1315
+ var ROUTER_RELATIVE = path7.join("dist", ROUTER_FILENAME);
1248
1316
  function _load_router(project_root) {
1249
- const p = path6.join(project_root, ROUTER_RELATIVE);
1250
- if (!fs6.existsSync(p)) {
1317
+ const p = path7.join(project_root, ROUTER_RELATIVE);
1318
+ if (!fs7.existsSync(p)) {
1251
1319
  return null;
1252
1320
  }
1253
1321
  try {
1254
- const parsed = JSON.parse(fs6.readFileSync(p, "utf-8"));
1322
+ const parsed = JSON.parse(fs7.readFileSync(p, "utf-8"));
1255
1323
  return parsed;
1256
1324
  } catch {
1257
1325
  return null;
@@ -1354,7 +1422,7 @@ function _derive_run_id(state, state_file) {
1354
1422
  }
1355
1423
  let mtime = 0;
1356
1424
  try {
1357
- mtime = fs7.statSync(state_file).mtimeMs / 1e3;
1425
+ mtime = fs8.statSync(state_file).mtimeMs / 1e3;
1358
1426
  } catch {
1359
1427
  mtime = 0;
1360
1428
  }
@@ -1901,8 +1969,8 @@ ${TIP_FOOTER}`;
1901
1969
 
1902
1970
  // src/scripts/_cli/cmd_explain.ts
1903
1971
  var ROUTER_FILENAME2 = "router.json";
1904
- var ROUTER_RELATIVE2 = path7.join("dist", ROUTER_FILENAME2);
1905
- var _HERE = fileURLToPath(import.meta.url);
1972
+ var ROUTER_RELATIVE2 = path8.join("dist", ROUTER_FILENAME2);
1973
+ var _HERE2 = fileURLToPath2(import.meta.url);
1906
1974
  var ArgparseExit = class extends Error {
1907
1975
  constructor(code) {
1908
1976
  super(`argparse-exit-${code}`);
@@ -2011,9 +2079,9 @@ function _dumpJson(payload) {
2011
2079
  process2.stdout.write(_jsonDumpsIndentSortedAscii(payload));
2012
2080
  process2.stdout.write("\n");
2013
2081
  }
2014
- function _exists3(p) {
2082
+ function _exists4(p) {
2015
2083
  try {
2016
- fs8.statSync(p);
2084
+ fs9.statSync(p);
2017
2085
  return true;
2018
2086
  } catch {
2019
2087
  return false;
@@ -2038,19 +2106,19 @@ function _resolve_root(arg) {
2038
2106
  }
2039
2107
  }
2040
2108
  function _load_user_settings(project_root) {
2041
- const p = path7.join(project_root, DEFAULT_PROJECT_FILE);
2042
- if (!_exists3(p)) {
2109
+ const p = path8.join(project_root, DEFAULT_PROJECT_FILE);
2110
+ if (!_exists4(p)) {
2043
2111
  return {};
2044
2112
  }
2045
2113
  return load_agent_settings({ project_path: p }) || {};
2046
2114
  }
2047
2115
  function _load_router2(project_root) {
2048
- const p = path7.join(project_root, ROUTER_RELATIVE2);
2049
- if (!_exists3(p)) {
2116
+ const p = path8.join(project_root, ROUTER_RELATIVE2);
2117
+ if (!_exists4(p)) {
2050
2118
  return {};
2051
2119
  }
2052
2120
  try {
2053
- return JSON.parse(fs8.readFileSync(p, { encoding: "utf-8" }));
2121
+ return JSON.parse(fs9.readFileSync(p, { encoding: "utf-8" }));
2054
2122
  } catch (exc) {
2055
2123
  eprint(`\u274C explain: cannot read ${p}: ${osErrorStr(exc)}`);
2056
2124
  throw new SystemExitError(2);
@@ -2269,7 +2337,7 @@ function _explain_last(project_root, state_file, as_json, quiet) {
2269
2337
  print("explain last disabled by settings (explain.enable_last)");
2270
2338
  return 0;
2271
2339
  }
2272
- const target_state = state_file || path7.join(project_root, ".work-state.json");
2340
+ const target_state = state_file || path8.join(project_root, ".work-state.json");
2273
2341
  let trace;
2274
2342
  try {
2275
2343
  trace = build_trace(project_root, target_state);
@@ -2280,7 +2348,7 @@ function _explain_last(project_root, state_file, as_json, quiet) {
2280
2348
  if (relativeTo !== null) {
2281
2349
  rel = relativeTo;
2282
2350
  } else {
2283
- rel = path7.basename(target_state);
2351
+ rel = path8.basename(target_state);
2284
2352
  }
2285
2353
  const msg = exc.message.split(target_state).join(rel);
2286
2354
  eprint(`\u274C explain last: ${msg}`);
@@ -2296,9 +2364,9 @@ function _explain_last(project_root, state_file, as_json, quiet) {
2296
2364
  return 0;
2297
2365
  }
2298
2366
  function relativeToOrNull(p, base) {
2299
- const rel = path7.relative(base, p);
2367
+ const rel = path8.relative(base, p);
2300
2368
  if (rel === "") return rel;
2301
- if (rel.startsWith("..") || path7.isAbsolute(rel)) {
2369
+ if (rel.startsWith("..") || path8.isAbsolute(rel)) {
2302
2370
  return null;
2303
2371
  }
2304
2372
  return rel;
@@ -2465,19 +2533,19 @@ function _isCliEntry() {
2465
2533
  if (process2.argv[1] === void 0) {
2466
2534
  return false;
2467
2535
  }
2468
- const argvUrl = pathToFileURL(path7.resolve(process2.argv[1])).href;
2536
+ const argvUrl = pathToFileURL(path8.resolve(process2.argv[1])).href;
2469
2537
  if (import.meta.url === argvUrl) {
2470
2538
  return true;
2471
2539
  }
2472
2540
  try {
2473
- const here = fs8.realpathSync(fileURLToPath(import.meta.url));
2474
- const argv = fs8.realpathSync(path7.resolve(process2.argv[1]));
2541
+ const here = fs9.realpathSync(fileURLToPath2(import.meta.url));
2542
+ const argv = fs9.realpathSync(path8.resolve(process2.argv[1]));
2475
2543
  return here === argv;
2476
2544
  } catch {
2477
2545
  return false;
2478
2546
  }
2479
2547
  }
2480
- if (_isCliEntry() || process2.argv[1] === _HERE) {
2548
+ if (_isCliEntry() || process2.argv[1] === _HERE2) {
2481
2549
  try {
2482
2550
  process2.exitCode = main(process2.argv.slice(2));
2483
2551
  } catch (e) {
@@ -9,13 +9,15 @@ import {
9
9
  KIRO_MARKER,
10
10
  ROOCODE_MARKER,
11
11
  ZED_MARKER
12
- } from "./chunk-YMFO6FDN.js";
12
+ } from "./chunk-QFKQLQ7X.js";
13
13
  import "./chunk-XX6TOPD7.js";
14
- import "./chunk-IR7P7JWA.js";
14
+ import "./chunk-EJYIGZ3T.js";
15
+ import "./chunk-A3HJ6NTI.js";
15
16
  import "./chunk-GRRPEPRN.js";
16
- import "./chunk-7DSAMZFU.js";
17
+ import "./chunk-TJIAM5FW.js";
17
18
  import "./chunk-HJ6DAJHR.js";
18
19
  import "./chunk-NDJLNC6Q.js";
20
+ import "./chunk-523HCFYO.js";
19
21
  import {
20
22
  resolvePackageRoot
21
23
  } from "./chunk-MCJYCQPF.js";
@@ -2,8 +2,9 @@ import { createRequire as __acCreateRequire } from 'node:module'; const require
2
2
  import {
3
3
  hasBlockingFinding,
4
4
  runPreflight
5
- } from "./chunk-RDGRHAAB.js";
5
+ } from "./chunk-HYWSRNUX.js";
6
6
  import "./chunk-OMIVVCG2.js";
7
+ import "./chunk-523HCFYO.js";
7
8
  import {
8
9
  resolvePackageRoot
9
10
  } from "./chunk-MCJYCQPF.js";