@event4u/agent-config 9.7.0 → 9.9.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 (901) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +314 -190
  3. package/CONTRIBUTING.md +23 -7
  4. package/MIGRATION.md +20 -0
  5. package/README.md +57 -11
  6. package/dist/agent-src/commands/agents/audit.md +1 -1
  7. package/dist/agent-src/commands/agents/optimize.md +2 -2
  8. package/dist/agent-src/commands/agents/user.md +1 -1
  9. package/dist/agent-src/commands/agents.md +1 -1
  10. package/dist/agent-src/commands/check-current-md.md +3 -3
  11. package/dist/agent-src/commands/commit/in-chunks.md +8 -0
  12. package/dist/agent-src/commands/commit.md +17 -0
  13. package/dist/agent-src/commands/fix/portability.md +2 -2
  14. package/dist/agent-src/commands/fix/pr-comments-loop.md +136 -0
  15. package/dist/agent-src/commands/fix/refs.md +2 -2
  16. package/dist/agent-src/commands/fix/route.md +4 -3
  17. package/dist/agent-src/commands/fix.md +9 -6
  18. package/dist/agent-src/commands/ghostwriter.md +1 -1
  19. package/dist/agent-src/commands/image.md +1 -1
  20. package/dist/agent-src/commands/optimize/augmentignore.md +1 -1
  21. package/dist/agent-src/commands/optimize/skills.md +2 -2
  22. package/dist/agent-src/commands/post-as.md +1 -1
  23. package/dist/agent-src/commands/pr/create.md +4 -0
  24. package/dist/agent-src/commands/research.md +1 -1
  25. package/dist/agent-src/commands/roadmap/ai-council.md +1 -1
  26. package/dist/agent-src/commands/security-audit-config.md +1 -1
  27. package/dist/agent-src/commands/team/delegate.md +4 -0
  28. package/dist/agent-src/commands/video.md +1 -1
  29. package/dist/agent-src/contexts/authority/kernel-rule-edits.md +1 -1
  30. package/dist/agent-src/contexts/contracts/emergency-triage-block.md +2 -2
  31. package/dist/agent-src/contexts/execution/auto-dispatch-classification.md +48 -2
  32. package/dist/agent-src/contexts/execution/orchestration-telemetry.md +10 -0
  33. package/dist/agent-src/contexts/execution/subagent-modes-detail.md +109 -8
  34. package/dist/agent-src/contexts/execution/subagent-response-contract.md +20 -0
  35. package/dist/agent-src/contexts/execution/subagent-spawn-contract.md +53 -3
  36. package/dist/agent-src/contexts/override-system.md +75 -5
  37. package/dist/agent-src/rules/code-provenance.md +112 -0
  38. package/dist/agent-src/rules/context-hygiene.md +2 -0
  39. package/dist/agent-src/rules/doc-screenshot-hygiene.md +97 -0
  40. package/dist/agent-src/rules/domain-safety-pii.md +1 -0
  41. package/dist/agent-src/rules/external-code-graph-interop.md +13 -3
  42. package/dist/agent-src/rules/framework-neutrality-in-generic-skills.md +2 -0
  43. package/dist/agent-src/rules/git-history-discipline.md +2 -0
  44. package/dist/agent-src/rules/history-discipline.md +80 -0
  45. package/dist/agent-src/rules/language-and-tone.md +2 -0
  46. package/dist/agent-src/rules/lethal-trifecta-guard.md +3 -0
  47. package/dist/agent-src/rules/media-governance-routing.md +2 -0
  48. package/dist/agent-src/rules/minimal-safe-diff.md +2 -0
  49. package/dist/agent-src/rules/no-roadmap-references.md +4 -1
  50. package/dist/agent-src/rules/non-destructive-by-default.md +20 -0
  51. package/dist/agent-src/rules/onboarding-gate.md +2 -0
  52. package/dist/agent-src/rules/output-discipline.md +2 -0
  53. package/dist/agent-src/rules/persona-governance.md +2 -0
  54. package/dist/agent-src/rules/php-coding.md +1 -0
  55. package/dist/agent-src/rules/preservation-guard.md +3 -0
  56. package/dist/agent-src/rules/reviewer-awareness.md +1 -0
  57. package/dist/agent-src/rules/roadmap-ci-steps-policy.md +1 -0
  58. package/dist/agent-src/rules/roadmap-progress-sync.md +9 -0
  59. package/dist/agent-src/rules/scale-discipline.md +92 -0
  60. package/dist/agent-src/rules/secret-vcs-guard.md +106 -0
  61. package/dist/agent-src/rules/security-sensitive-stop.md +11 -1
  62. package/dist/agent-src/rules/session-canary.md +77 -0
  63. package/dist/agent-src/rules/skill-quality.md +2 -0
  64. package/dist/agent-src/rules/source-confidentiality.md +2 -0
  65. package/dist/agent-src/rules/source-of-truth.md +2 -0
  66. package/dist/agent-src/rules/telegraph-speak.md +2 -0
  67. package/dist/agent-src/rules/token-optimizer-maintenance.md +3 -1
  68. package/dist/agent-src/rules/tool-safety.md +4 -1
  69. package/dist/agent-src/rules/untrusted-input-defense.md +10 -0
  70. package/dist/agent-src/rules/verify-before-complete.md +2 -0
  71. package/dist/agent-src/skills/adr-create/SKILL.md +17 -1
  72. package/dist/agent-src/skills/agent-security-review/SKILL.md +1 -1
  73. package/dist/agent-src/skills/code-intelligence/SKILL.md +97 -0
  74. package/dist/agent-src/skills/condense-memory/SKILL.md +1 -1
  75. package/dist/agent-src/skills/corpus-grounding/SKILL.md +0 -3
  76. package/dist/agent-src/skills/description-assist/SKILL.md +1 -1
  77. package/dist/agent-src/skills/design-review/SKILL.md +5 -6
  78. package/dist/agent-src/skills/design-tokens/SKILL.md +0 -1
  79. package/dist/agent-src/skills/gated-reach/SKILL.md +185 -0
  80. package/dist/agent-src/skills/gated-reach/evals/triggers.json +72 -0
  81. package/dist/agent-src/skills/history-design/SKILL.md +101 -0
  82. package/dist/agent-src/skills/history-design/evals/triggers.json +17 -0
  83. package/dist/agent-src/skills/humanizer/SKILL.md +3 -3
  84. package/dist/agent-src/skills/image-analyser/SKILL.md +14 -12
  85. package/dist/agent-src/skills/image-editing/SKILL.md +2 -1
  86. package/dist/agent-src/skills/image-generation/SKILL.md +2 -1
  87. package/dist/agent-src/skills/image-provider-routing/SKILL.md +2 -2
  88. package/dist/agent-src/skills/launch-readiness/SKILL.md +1 -1
  89. package/dist/agent-src/skills/license-compliance-audit/SKILL.md +161 -0
  90. package/dist/agent-src/skills/license-compliance-audit/evals/triggers.json +52 -0
  91. package/dist/agent-src/skills/license-compliance-borrow-check/SKILL.md +145 -0
  92. package/dist/agent-src/skills/license-compliance-borrow-check/evals/triggers.json +52 -0
  93. package/dist/agent-src/skills/license-compliance-credits/SKILL.md +97 -0
  94. package/dist/agent-src/skills/license-compliance-credits/evals/triggers.json +52 -0
  95. package/dist/agent-src/skills/md-language-check/SKILL.md +1 -1
  96. package/dist/agent-src/skills/override-management/SKILL.md +1 -1
  97. package/dist/agent-src/skills/prediction-pool-optimizer/SKILL.md +7 -7
  98. package/dist/agent-src/skills/project-analysis-core/SKILL.md +1 -1
  99. package/dist/agent-src/skills/prompt-engineering-image/SKILL.md +3 -2
  100. package/dist/agent-src/skills/react-shadcn-ui/SKILL.md +2 -2
  101. package/dist/agent-src/skills/readme-writing/SKILL.md +6 -1
  102. package/dist/agent-src/skills/recursive-verification/SKILL.md +6 -0
  103. package/dist/agent-src/skills/refine-ticket/SKILL.md +3 -3
  104. package/dist/agent-src/skills/roadmap-writing/SKILL.md +4 -0
  105. package/dist/agent-src/skills/rtk-output-filtering/SKILL.md +31 -12
  106. package/dist/agent-src/skills/rule-refactor/SKILL.md +3 -3
  107. package/dist/agent-src/skills/schema-review/SKILL.md +92 -0
  108. package/dist/agent-src/skills/schema-review/evals/triggers.json +17 -0
  109. package/dist/agent-src/skills/screenshot-hygiene/SKILL.md +171 -0
  110. package/dist/agent-src/skills/secrets-management/SKILL.md +43 -1
  111. package/dist/agent-src/skills/security-audit/SKILL.md +1 -1
  112. package/dist/agent-src/skills/security-maturity-assessment/SKILL.md +1 -1
  113. package/dist/agent-src/skills/skill-improvement-pipeline/SKILL.md +3 -3
  114. package/dist/agent-src/skills/skill-writing/SKILL.md +2 -2
  115. package/dist/agent-src/skills/source-discovery/SKILL.md +5 -5
  116. package/dist/agent-src/skills/subagent-orchestration/SKILL.md +45 -85
  117. package/dist/agent-src/skills/subagent-orchestration/prompts/README.md +5 -4
  118. package/dist/agent-src/skills/subagent-orchestration/prompts/adversarial-verification-council.md +29 -0
  119. package/dist/agent-src/skills/subagent-orchestration/prompts/do-and-judge-two-stage.md +29 -0
  120. package/dist/agent-src/skills/subagent-orchestration/prompts/do-and-judge.md +29 -0
  121. package/dist/agent-src/skills/subagent-orchestration/prompts/do-competitively.md +29 -0
  122. package/dist/agent-src/skills/subagent-orchestration/prompts/do-in-parallel.md +29 -0
  123. package/dist/agent-src/skills/subagent-orchestration/prompts/do-in-steps.md +29 -0
  124. package/dist/agent-src/skills/subagent-orchestration/prompts/do-in-worktrees.md +29 -0
  125. package/dist/agent-src/skills/subagent-orchestration/prompts/judge-with-debate.md +29 -0
  126. package/dist/agent-src/skills/systematic-debugging/SKILL.md +2 -2
  127. package/dist/agent-src/skills/tailwind-engineer/SKILL.md +2 -3
  128. package/dist/agent-src/skills/token-optimizer/SKILL.md +4 -4
  129. package/dist/agent-src/skills/verify-repair-loop/SKILL.md +4 -0
  130. package/dist/agent-src/skills/worktree-lifecycle/SKILL.md +2 -3
  131. package/dist/agent-src/templates/AGENTS.md +1 -1
  132. package/dist/agent-src/templates/agents/.gitattributes.fragment +25 -6
  133. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  134. package/dist/agent-src/templates/command.md +3 -3
  135. package/dist/agent-src/templates/github-workflows/secret-scan.yml +65 -0
  136. package/dist/agent-src/templates/persona.md +2 -2
  137. package/dist/agent-src/templates/rule.md +2 -2
  138. package/dist/agent-src/templates/scripts/telemetry/engagement.ts +77 -0
  139. package/dist/agent-src/templates/scripts/telemetry_record.ts +33 -1
  140. package/dist/cli/commands/doctorShell.js +20 -0
  141. package/dist/cli/commands/doctorShell.js.map +1 -1
  142. package/dist/cli/commands/rtkDetect.js +58 -0
  143. package/dist/cli/commands/rtkDetect.js.map +1 -0
  144. package/dist/cli/configRoot.js +112 -0
  145. package/dist/cli/configRoot.js.map +1 -0
  146. package/dist/cli/configRoot.test.js +97 -0
  147. package/dist/cli/configRoot.test.js.map +1 -0
  148. package/dist/cli/firstRunNotice.js +70 -0
  149. package/dist/cli/firstRunNotice.js.map +1 -0
  150. package/dist/cli/help.js +4 -1
  151. package/dist/cli/help.js.map +1 -1
  152. package/dist/cli/main.js +54 -5
  153. package/dist/cli/main.js.map +1 -1
  154. package/dist/cli/registry.js +8 -1
  155. package/dist/cli/registry.js.map +1 -1
  156. package/dist/discovery/deprecation-report.md +1 -1
  157. package/dist/discovery/discovery-manifest.json +502 -101
  158. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  159. package/dist/discovery/discovery-manifest.summary.md +6 -4
  160. package/dist/discovery/orphan-report.md +1 -1
  161. package/dist/discovery/packs.json +95 -8
  162. package/dist/discovery/trust-report.md +11 -11
  163. package/dist/discovery/workspaces.json +36 -7
  164. package/dist/hooks/dispatch.js +19475 -0
  165. package/dist/install/agentSwitchDetection.js +75 -0
  166. package/dist/install/agentSwitchDetection.js.map +1 -0
  167. package/dist/install/agentSwitchProfile.js +117 -0
  168. package/dist/install/agentSwitchProfile.js.map +1 -0
  169. package/dist/install/atomic.js +1 -1
  170. package/dist/install/detect.js +1 -1
  171. package/dist/install/install.mjs +791 -486
  172. package/dist/install/rtkDetection.js +213 -0
  173. package/dist/install/rtkDetection.js.map +1 -0
  174. package/dist/install/rule_scope.js +2 -1
  175. package/dist/install/rule_scope.js.map +1 -1
  176. package/dist/install/types.js +2 -2
  177. package/dist/install/wizard-plan.js +1 -1
  178. package/dist/install/wizardDismissals.js +58 -0
  179. package/dist/install/wizardDismissals.js.map +1 -0
  180. package/dist/mcp/awesome-mcp-servers.row.md +1 -1
  181. package/dist/mcp/mcp-cloudflare-catalogue.json +1 -1
  182. package/dist/mcp/registry-manifest.json +15 -4
  183. package/dist/mcp/server.json +20 -0
  184. package/dist/mcp/server.mjs +44292 -0
  185. package/dist/router.json +1 -1
  186. package/dist/scripts/condense.js +14 -7
  187. package/dist/scripts/condense.js.map +1 -1
  188. package/dist/server/app.js +12 -0
  189. package/dist/server/app.js.map +1 -1
  190. package/dist/server/io/sharedWriteCheck.js +101 -0
  191. package/dist/server/io/sharedWriteCheck.js.map +1 -0
  192. package/dist/server/routes/ping.js +32 -0
  193. package/dist/server/routes/ping.js.map +1 -1
  194. package/dist/server/routes/settings.js +21 -4
  195. package/dist/server/routes/settings.js.map +1 -1
  196. package/dist/server/routes/userMd.js +21 -4
  197. package/dist/server/routes/userMd.js.map +1 -1
  198. package/dist/server/routes/wizard.js +68 -25
  199. package/dist/server/routes/wizard.js.map +1 -1
  200. package/dist/server/schemas/settings.js +12 -2
  201. package/dist/server/schemas/settings.js.map +1 -1
  202. package/dist/server/serverInfo.js +6 -2
  203. package/dist/server/serverInfo.js.map +1 -1
  204. package/dist/server/token.js +11 -4
  205. package/dist/server/token.js.map +1 -1
  206. package/dist/server/writeRoot.js +15 -1
  207. package/dist/server/writeRoot.js.map +1 -1
  208. package/dist/shared/capabilities.js +33 -0
  209. package/dist/shared/capabilities.js.map +1 -0
  210. package/dist/shared/capabilities.test.js +39 -0
  211. package/dist/shared/capabilities.test.js.map +1 -0
  212. package/dist/ui/assets/index-BpSQt5vm.js +40 -0
  213. package/dist/ui/assets/index-BpSQt5vm.js.map +1 -0
  214. package/dist/ui/assets/index-jSfMW8_t.css +1 -0
  215. package/dist/ui/index.html +15 -6
  216. package/docs/MIGRATION.md +16 -0
  217. package/docs/guidelines/component-oriented-and-oop-development.md +4 -2
  218. package/package.json +22 -9
  219. package/src/agent-src/templates/AGENTS.md +1 -1
  220. package/src/agent-src/templates/scripts/telemetry/engagement.ts +77 -0
  221. package/src/agent-src/templates/scripts/telemetry_record.ts +33 -1
  222. package/src/config/agent-settings.template.yml +94 -13
  223. package/src/config/discovery/packs.yml +22 -0
  224. package/src/config/discovery/workspaces.yml +1 -1
  225. package/src/config/evaluator-budgets.json +47 -0
  226. package/src/config/hook-latency-budget.json +20 -0
  227. package/src/config/reach-channels.yml +217 -0
  228. package/src/config/reach-prescriptions-intake.yml +200 -0
  229. package/src/install/agentSwitchDetection.ts +90 -0
  230. package/src/install/agentSwitchProfile.ts +131 -0
  231. package/src/install/atomic.ts +1 -1
  232. package/src/install/detect.ts +1 -1
  233. package/src/install/rtkDetection.ts +274 -0
  234. package/src/install/rule_scope.ts +9 -2
  235. package/src/install/types.ts +2 -2
  236. package/src/install/wizard-plan.ts +1 -1
  237. package/src/install/wizardDismissals.ts +60 -0
  238. package/src/scripts/_cli/cmd_doctor.ts +62 -1
  239. package/src/scripts/_cli/cmd_memory_get.ts +197 -0
  240. package/src/scripts/_cli/cmd_refresh.ts +30 -0
  241. package/src/scripts/_dispatch.bash +96 -0
  242. package/src/scripts/_lib/auto_dispatch.corpus.test.ts +64 -1
  243. package/src/scripts/_lib/auto_dispatch.ts +76 -0
  244. package/src/scripts/_lib/detect_target_license.ts +714 -0
  245. package/src/scripts/_lib/exec_evidence.ts +251 -0
  246. package/src/scripts/_lib/fixtures/secret-detector/negatives.txt +15 -0
  247. package/src/scripts/_lib/fixtures/secret-detector/positives.txt +15 -0
  248. package/src/scripts/_lib/install_drift.ts +194 -0
  249. package/src/scripts/_lib/kernel_rules.ts +46 -0
  250. package/src/scripts/_lib/memory_fts_index.ts +390 -0
  251. package/src/scripts/_lib/orchestration_record.ts +91 -2
  252. package/src/scripts/_lib/persistence/adapter_raw_sql.ts +443 -0
  253. package/src/scripts/_lib/persistence/detect_audit_coverage.ts +423 -0
  254. package/src/scripts/_lib/persistence/detect_bounded_reads.ts +154 -0
  255. package/src/scripts/_lib/persistence/detect_index_parity.ts +576 -0
  256. package/src/scripts/_lib/persistence/detect_n1_eloquent.ts +226 -0
  257. package/src/scripts/_lib/persistence/detect_offload.ts +441 -0
  258. package/src/scripts/_lib/persistence/detect_prisma_growth.ts +74 -0
  259. package/src/scripts/_lib/persistence/offload_catalog.ts +73 -0
  260. package/src/scripts/_lib/persistence/types.ts +109 -0
  261. package/src/scripts/_lib/reddit_thread_parse.ts +598 -0
  262. package/src/scripts/_lib/risk_paths.ts +160 -0
  263. package/src/scripts/_lib/rtk_allowlist.ts +44 -0
  264. package/src/scripts/_lib/secret_detector.test.ts +108 -0
  265. package/src/scripts/_lib/secret_detector.ts +328 -0
  266. package/src/scripts/_lib/secret_detector_adversarial.test.ts +116 -0
  267. package/src/scripts/_lib/spawn_env.ts +7 -0
  268. package/src/scripts/_lib/sqlite_guard.ts +191 -0
  269. package/src/scripts/_lib/subagent_spawn.ts +53 -0
  270. package/src/scripts/_lib/tool_probe.ts +359 -0
  271. package/src/scripts/_lib/worker_budget.ts +107 -0
  272. package/src/scripts/adr/regenerate_index.ts +81 -6
  273. package/src/scripts/ai_council/blind_review.ts +0 -0
  274. package/src/scripts/ai_council/config.ts +12 -6
  275. package/src/scripts/ai_council/orchestrator.ts +73 -3
  276. package/src/scripts/ai_team/review_gate.ts +8 -10
  277. package/src/scripts/ai_team/team_dispatch.ts +48 -0
  278. package/src/scripts/audit_adr_coverage.ts +33 -0
  279. package/src/scripts/audit_initial_context.ts +1 -1
  280. package/src/scripts/bench_cross_source_eval.ts +400 -0
  281. package/src/scripts/bench_honesty_score.ts +1093 -0
  282. package/src/scripts/bench_hook_latency.ts +218 -0
  283. package/src/scripts/build_mcp_catalog.ts +275 -0
  284. package/src/scripts/build_mcp_registry_manifest.ts +46 -0
  285. package/src/scripts/build_proof.ts +207 -0
  286. package/src/scripts/chat_history.ts +8 -5
  287. package/src/scripts/check_adr_frontmatter.ts +195 -0
  288. package/src/scripts/check_artefact_count_messaging.ts +4 -0
  289. package/src/scripts/check_backstop_debt.ts +210 -0
  290. package/src/scripts/check_bundle_path_leakage.ts +343 -0
  291. package/src/scripts/check_claims.ts +188 -8
  292. package/src/scripts/check_comparison.ts +12 -0
  293. package/src/scripts/check_enforcement_coverage.ts +592 -0
  294. package/src/scripts/check_evaluator_budgets.ts +99 -0
  295. package/src/scripts/check_kernel_rule_bundle.ts +16 -12
  296. package/src/scripts/check_knowledge_sharing.ts +12 -1
  297. package/src/scripts/check_no_external_sources.ts +2 -2
  298. package/src/scripts/check_reach_channels.ts +407 -0
  299. package/src/scripts/check_reach_staleness.ts +364 -0
  300. package/src/scripts/check_secret_leak.test.ts +47 -0
  301. package/src/scripts/check_secret_leak.ts +290 -0
  302. package/src/scripts/check_source_pointer_freshness.ts +28 -3
  303. package/src/scripts/code_graph/build.ts +0 -0
  304. package/src/scripts/code_graph/cli.ts +379 -0
  305. package/src/scripts/code_graph/detect.ts +186 -0
  306. package/src/scripts/code_graph/extract.ts +386 -0
  307. package/src/scripts/code_graph/intent.ts +45 -0
  308. package/src/scripts/code_graph/loader.ts +123 -0
  309. package/src/scripts/code_graph/query.ts +290 -0
  310. package/src/scripts/code_graph/sanitize.ts +30 -0
  311. package/src/scripts/code_graph/sqlite_store.ts +174 -0
  312. package/src/scripts/code_graph/types.ts +83 -0
  313. package/src/scripts/code_graph/validate.ts +63 -0
  314. package/src/scripts/condense.ts +14 -6
  315. package/src/scripts/context_hygiene_hook.ts +8 -5
  316. package/src/scripts/council_cli.ts +126 -12
  317. package/src/scripts/detect_target_license.ts +203 -0
  318. package/src/scripts/evaluator_umbrella.sh +145 -0
  319. package/src/scripts/external_sources_denylist.json +8 -4
  320. package/src/scripts/first_run_gate_hook.ts +9 -5
  321. package/src/scripts/generate_subagent_floor.ts +194 -0
  322. package/src/scripts/hermetic-install.sh +3 -3
  323. package/src/scripts/hook_manifest.yaml +65 -16
  324. package/src/scripts/hooks/block_kernel_rule_writes.ts +212 -0
  325. package/src/scripts/hooks/block_no_verify.ts +9 -9
  326. package/src/scripts/hooks/code_graph_nudge_hook.ts +191 -0
  327. package/src/scripts/hooks/concern_registry.ts +75 -0
  328. package/src/scripts/hooks/design_slop_hook.ts +8 -5
  329. package/src/scripts/hooks/dispatch_entry.ts +37 -0
  330. package/src/scripts/hooks/dispatch_hook.ts +176 -3
  331. package/src/scripts/hooks/hook_stdin.ts +42 -0
  332. package/src/scripts/hooks/rtk_wrap_hook.ts +26 -12
  333. package/src/scripts/hot_context_hook.ts +7 -6
  334. package/src/scripts/injection_scan_hook.ts +9 -1
  335. package/src/scripts/install +6 -6
  336. package/src/scripts/install-hooks.sh +4 -4
  337. package/src/scripts/install.sh +5 -4
  338. package/src/scripts/install.ts +264 -23
  339. package/src/scripts/iron_law_sha.ts +3 -12
  340. package/src/scripts/learning_sidecar.ts +0 -0
  341. package/src/scripts/lint_budget_ownership.ts +89 -0
  342. package/src/scripts/lint_command_routing.ts +35 -5
  343. package/src/scripts/lint_command_verbs.ts +42 -9
  344. package/src/scripts/lint_consumer_internal_refs.ts +211 -0
  345. package/src/scripts/lint_discovery_vocabulary.ts +2 -0
  346. package/src/scripts/lint_documented_commands.ts +670 -0
  347. package/src/scripts/lint_framework_leakage.ts +17 -3
  348. package/src/scripts/lint_framework_leakage_allowlist.json +32 -0
  349. package/src/scripts/lint_governed_writes.ts +335 -0
  350. package/src/scripts/lint_hidden_unicode.ts +6 -0
  351. package/src/scripts/lint_mcp_registry_manifest.ts +26 -1
  352. package/src/scripts/lint_memory_tripwire.ts +186 -0
  353. package/src/scripts/lint_override_kernel_guard.ts +267 -0
  354. package/src/scripts/lint_persistence.ts +171 -0
  355. package/src/scripts/lint_pre_migration_refs.ts +106 -0
  356. package/src/scripts/lint_provenance.ts +547 -0
  357. package/src/scripts/lint_provenance_vocabulary.ts +437 -0
  358. package/src/scripts/lint_spawn_payload.ts +283 -0
  359. package/src/scripts/lint_store_boundary.ts +152 -0
  360. package/src/scripts/lint_versioned_cache.ts +7 -1
  361. package/src/scripts/mcp_server/__main__.ts +7 -2
  362. package/src/scripts/mcp_server/catalog.ts +23 -1
  363. package/src/scripts/mcp_server/consumer_tool_catalog.json +563 -193
  364. package/src/scripts/mcp_server/prompts.ts +6 -0
  365. package/src/scripts/mcp_server/tool_catalog_source.ts +332 -0
  366. package/src/scripts/mcp_server/tools.ts +56 -5
  367. package/src/scripts/mcp_telemetry_query.ts +2 -33
  368. package/src/scripts/mcp_telemetry_store.ts +64 -34
  369. package/src/scripts/measure_rule_budget.ts +3 -12
  370. package/src/scripts/memory_learn_hook.ts +126 -0
  371. package/src/scripts/memory_lookup.ts +0 -0
  372. package/src/scripts/memory_replay_24.ts +312 -0
  373. package/src/scripts/memory_report.ts +16 -3
  374. package/src/scripts/memory_signal.ts +48 -0
  375. package/src/scripts/memory_status.ts +6 -0
  376. package/src/scripts/minimal_safe_diff_hook.ts +8 -5
  377. package/src/scripts/onboarding_gate_hook.ts +8 -5
  378. package/src/scripts/orchestration_record.ts +16 -0
  379. package/src/scripts/pr_url_reminder_hook.ts +8 -1
  380. package/src/scripts/prepack-check.mjs +17 -0
  381. package/src/scripts/prepack_lifecycle_check.d.mts +8 -0
  382. package/src/scripts/prepack_lifecycle_check.mjs +82 -0
  383. package/src/scripts/profile_staleness_hook.ts +8 -7
  384. package/src/scripts/reach_doctor.ts +1651 -0
  385. package/src/scripts/release.ts +24 -3
  386. package/src/scripts/report_install_drift.ts +109 -0
  387. package/src/scripts/risk_escalation_shadow.ts +160 -0
  388. package/src/scripts/roadmap_progress_hook.ts +8 -5
  389. package/src/scripts/schemas/agent-settings.schema.json +23 -0
  390. package/src/scripts/schemas/license-policy.schema.json +89 -0
  391. package/src/scripts/schemas/provenance-borrow.schema.json +46 -0
  392. package/src/scripts/schemas/reach-channels.schema.json +134 -0
  393. package/src/scripts/schemas/reach-doctor-payload.schema.json +220 -0
  394. package/src/scripts/schemas/rule.schema.json +20 -0
  395. package/src/scripts/self_review_gate.test.ts +173 -1
  396. package/src/scripts/self_review_gate.ts +155 -15
  397. package/src/scripts/session_canary_hook.ts +182 -0
  398. package/src/scripts/skill_linter.ts +55 -0
  399. package/src/scripts/smoke_quickstart.ts +2 -2
  400. package/src/scripts/surface_probe_hook.ts +8 -7
  401. package/src/scripts/sync_gitattributes.ts +310 -0
  402. package/src/scripts/team_review_gate_hook.ts +13 -16
  403. package/src/scripts/validate_reach_prescriptions.ts +751 -0
  404. package/src/scripts/verify_before_complete_hook.ts +8 -5
  405. package/src/scripts/wrapper_freshness_hook.ts +8 -7
  406. package/src/server/schemas/settings.ts +24 -2
  407. package/src/shared/capabilities.test.ts +43 -0
  408. package/src/shared/capabilities.ts +75 -0
  409. package/src/templates/minimal/agents-overrides-readme.md +20 -0
  410. package/dist/ui/assets/index-BPFMZWUs.css +0 -1
  411. package/dist/ui/assets/index-BiEZiZ31.js +0 -40
  412. package/dist/ui/assets/index-BiEZiZ31.js.map +0 -1
  413. package/docs/CLAIMS.md +0 -261
  414. package/docs/DISTRIBUTION_CHECKLIST.md +0 -170
  415. package/docs/RELEASE_STORY_TEMPLATE.md +0 -37
  416. package/docs/SKILL_CENSUS.md +0 -352
  417. package/docs/adrs/cost/0001-hard-stop-hook.md +0 -114
  418. package/docs/adrs/cost/README.md +0 -9
  419. package/docs/adrs/memory/0001-consumer-side-snapshot.md +0 -119
  420. package/docs/adrs/memory/README.md +0 -10
  421. package/docs/adrs/router/0001-three-tier-routing.md +0 -119
  422. package/docs/adrs/router/README.md +0 -9
  423. package/docs/adrs/schema/0001-json-schema-frontmatter.md +0 -102
  424. package/docs/adrs/schema/README.md +0 -9
  425. package/docs/adrs/smoke/0001-per-tier-smoke-scripts.md +0 -99
  426. package/docs/adrs/smoke/README.md +0 -9
  427. package/docs/adrs/telegraph/0001-default-off-until-bench.md +0 -93
  428. package/docs/adrs/telegraph/README.md +0 -9
  429. package/docs/announcements/2026-05-non-dev-launch.md +0 -79
  430. package/docs/announcements/2026-07-honest-cost-sweep-launch.md +0 -84
  431. package/docs/anti-reskin-gate.md +0 -60
  432. package/docs/architecture/augment-projection.md +0 -70
  433. package/docs/architecture/claude-bundle.md +0 -77
  434. package/docs/architecture/current-onboard-baseline.md +0 -126
  435. package/docs/architecture/current-safety-behavior.md +0 -137
  436. package/docs/architecture/multi-tool-projection.md +0 -125
  437. package/docs/architecture/setup-vs-settings-shared-surface.md +0 -114
  438. package/docs/architecture/source-projection.md +0 -85
  439. package/docs/architecture.md +0 -390
  440. package/docs/archive/CHANGELOG-6.0.0-overview.md +0 -953
  441. package/docs/archive/CHANGELOG-7.0.0.md +0 -419
  442. package/docs/archive/CHANGELOG-pre-2.11.0.md +0 -141
  443. package/docs/archive/CHANGELOG-pre-2.15.0.md +0 -244
  444. package/docs/archive/CHANGELOG-pre-2.16.0.md +0 -48
  445. package/docs/archive/CHANGELOG-pre-2.17.0.md +0 -63
  446. package/docs/archive/CHANGELOG-pre-2.2.0.md +0 -2138
  447. package/docs/archive/CHANGELOG-pre-2.20.0.md +0 -159
  448. package/docs/archive/CHANGELOG-pre-2.25.0.md +0 -191
  449. package/docs/archive/CHANGELOG-pre-2.7.0.md +0 -185
  450. package/docs/archive/CHANGELOG-pre-3.0.0.md +0 -130
  451. package/docs/archive/CHANGELOG-pre-3.1.0.md +0 -167
  452. package/docs/archive/CHANGELOG-pre-3.2.0.md +0 -268
  453. package/docs/archive/CHANGELOG-pre-4.0.0.md +0 -80
  454. package/docs/archive/CHANGELOG-pre-4.5.0.md +0 -289
  455. package/docs/archive/CHANGELOG-pre-5.4.0.md +0 -260
  456. package/docs/archive/CHANGELOG-pre-5.9.0.md +0 -270
  457. package/docs/archive/CHANGELOG-pre-6.0.0.md +0 -473
  458. package/docs/archive/CHANGELOG-pre-7.0.0.md +0 -126
  459. package/docs/archive/CHANGELOG-pre-8.0.0.md +0 -301
  460. package/docs/archive/CHANGELOG-pre-8.1.0.md +0 -316
  461. package/docs/archive/CHANGELOG-pre-8.12.0.md +0 -304
  462. package/docs/archive/CHANGELOG-pre-8.9.0.md +0 -306
  463. package/docs/archive/CHANGELOG-pre-9.2.0.md +0 -276
  464. package/docs/artefact-census.md +0 -71
  465. package/docs/benchmark.md +0 -648
  466. package/docs/benchmark.pinned.yml +0 -31
  467. package/docs/benchmarks.md +0 -85
  468. package/docs/capability-matrix.md +0 -33
  469. package/docs/case-studies/_template.md +0 -60
  470. package/docs/case-studies/frontend-design-positioning.md +0 -86
  471. package/docs/catalog.md +0 -721
  472. package/docs/command-flows.md +0 -272
  473. package/docs/command-naming-audit.md +0 -60
  474. package/docs/comparison.yaml +0 -45
  475. package/docs/contracts/CHANGELOG-conventions.md +0 -149
  476. package/docs/contracts/STABILITY.md +0 -188
  477. package/docs/contracts/adoption-signal-floor.md +0 -127
  478. package/docs/contracts/adr-architectural-consensus-mechanism.md +0 -68
  479. package/docs/contracts/adr-chat-history-split.md +0 -140
  480. package/docs/contracts/adr-command-suggestion.md +0 -144
  481. package/docs/contracts/adr-forecast-construction-shape.md +0 -90
  482. package/docs/contracts/adr-gtm-context-spine.md +0 -116
  483. package/docs/contracts/adr-implement-ticket-runtime.md +0 -121
  484. package/docs/contracts/adr-install-user-type-axis.md +0 -107
  485. package/docs/contracts/adr-layout.md +0 -107
  486. package/docs/contracts/adr-level-6-productization.md +0 -145
  487. package/docs/contracts/adr-mcp-runtime.md +0 -128
  488. package/docs/contracts/adr-product-ui-track.md +0 -381
  489. package/docs/contracts/adr-prompt-driven-execution.md +0 -186
  490. package/docs/contracts/adr-settings-sync-engine.md +0 -128
  491. package/docs/contracts/adr-user-types-axis.md +0 -127
  492. package/docs/contracts/adr-wing4-context-spine.md +0 -126
  493. package/docs/contracts/agent-user-schema.md +0 -170
  494. package/docs/contracts/agents-layout.md +0 -148
  495. package/docs/contracts/agents-md-tech-stack.md +0 -75
  496. package/docs/contracts/ai-council-config.md +0 -829
  497. package/docs/contracts/ai-team-config.md +0 -224
  498. package/docs/contracts/analysis-memory-loop.md +0 -149
  499. package/docs/contracts/at-rest-encryption.md +0 -191
  500. package/docs/contracts/audit-log-v1.md +0 -150
  501. package/docs/contracts/auto-orchestration-v1.md +0 -70
  502. package/docs/contracts/benchmark-ab-contract.md +0 -106
  503. package/docs/contracts/benchmark-corpus-spec.md +0 -125
  504. package/docs/contracts/benchmark-report-schema.md +0 -113
  505. package/docs/contracts/branch-protection-policy.md +0 -139
  506. package/docs/contracts/brand-token-consumption.md +0 -74
  507. package/docs/contracts/capability-boundary.md +0 -69
  508. package/docs/contracts/capability-packs.md +0 -217
  509. package/docs/contracts/ci-cost-budget.md +0 -111
  510. package/docs/contracts/ci-green-floor.md +0 -141
  511. package/docs/contracts/command-category-governance.md +0 -84
  512. package/docs/contracts/command-clusters.md +0 -399
  513. package/docs/contracts/command-surface-tiers.md +0 -176
  514. package/docs/contracts/command-taxonomy.md +0 -137
  515. package/docs/contracts/condensation-default-kill-criterion.md +0 -116
  516. package/docs/contracts/config-presets.md +0 -144
  517. package/docs/contracts/conformance.md +0 -84
  518. package/docs/contracts/consumer-bridge.md +0 -73
  519. package/docs/contracts/context-paths.md +0 -101
  520. package/docs/contracts/context-spine.md +0 -179
  521. package/docs/contracts/cost-dashboard.md +0 -143
  522. package/docs/contracts/cost-enforcement.md +0 -134
  523. package/docs/contracts/cost-profile-defaults.md +0 -110
  524. package/docs/contracts/cost-summary-schema.md +0 -107
  525. package/docs/contracts/creative-pack-boundary.md +0 -63
  526. package/docs/contracts/cross-repo-retrieval.md +0 -64
  527. package/docs/contracts/cross-wing-handoff.md +0 -134
  528. package/docs/contracts/daily-workspace.md +0 -147
  529. package/docs/contracts/decision-engine-gates.md +0 -120
  530. package/docs/contracts/decision-trace-v1.md +0 -177
  531. package/docs/contracts/design-artifact-lifecycle.md +0 -93
  532. package/docs/contracts/design-artifact-verification.md +0 -153
  533. package/docs/contracts/discovery-manifest.md +0 -209
  534. package/docs/contracts/discovery-manifest.schema.json +0 -254
  535. package/docs/contracts/evidence-based-pruning.md +0 -102
  536. package/docs/contracts/explain-modes.md +0 -187
  537. package/docs/contracts/explain-trace.schema.json +0 -144
  538. package/docs/contracts/file-ownership-matrix.json +0 -13941
  539. package/docs/contracts/file-ownership-matrix.md +0 -135
  540. package/docs/contracts/frontmatter-contract.md +0 -140
  541. package/docs/contracts/ghostwriter-schema.md +0 -337
  542. package/docs/contracts/governance-enforcement-projection.md +0 -159
  543. package/docs/contracts/gui-wizard.md +0 -350
  544. package/docs/contracts/harness-expectations.md +0 -128
  545. package/docs/contracts/hook-architecture-v1.md +0 -325
  546. package/docs/contracts/host-agent-protocol.md +0 -110
  547. package/docs/contracts/implement-ticket-flow.md +0 -625
  548. package/docs/contracts/init-telemetry.md +0 -132
  549. package/docs/contracts/injected-block-authenticity-model.md +0 -66
  550. package/docs/contracts/install-layout.md +0 -249
  551. package/docs/contracts/install-scopes.md +0 -82
  552. package/docs/contracts/installed-tools-lockfile.md +0 -144
  553. package/docs/contracts/installer-agent-mode.md +0 -137
  554. package/docs/contracts/iron-law-overrides.txt +0 -26
  555. package/docs/contracts/kernel-membership.md +0 -339
  556. package/docs/contracts/linear-ai-rules-inclusion.md +0 -143
  557. package/docs/contracts/linear-ai-three-layers.md +0 -130
  558. package/docs/contracts/linter-structural-model.md +0 -181
  559. package/docs/contracts/load-context-budget-model.md +0 -259
  560. package/docs/contracts/load-context-schema.md +0 -220
  561. package/docs/contracts/local-analytics.md +0 -160
  562. package/docs/contracts/local-knowledge-ingestion.md +0 -96
  563. package/docs/contracts/local-server-api.md +0 -134
  564. package/docs/contracts/low-impact-corpus-format.md +0 -95
  565. package/docs/contracts/mcp-beta-criteria.md +0 -130
  566. package/docs/contracts/mcp-cloud-scope.md +0 -355
  567. package/docs/contracts/mcp-discovery-phase-notice.md +0 -60
  568. package/docs/contracts/mcp-phase-1-scope.md +0 -272
  569. package/docs/contracts/mcp-registry-manifest.schema.json +0 -129
  570. package/docs/contracts/mcp-tool-inventory.md +0 -64
  571. package/docs/contracts/mcp-tool-stub-envelope.md +0 -78
  572. package/docs/contracts/measurement-baseline.md +0 -103
  573. package/docs/contracts/memory-visibility-v1.md +0 -160
  574. package/docs/contracts/mental-models.md +0 -336
  575. package/docs/contracts/migrate-command.md +0 -233
  576. package/docs/contracts/multi-tool-projection-fidelity.md +0 -134
  577. package/docs/contracts/namespace.md +0 -125
  578. package/docs/contracts/no-runtime-boundary.md +0 -61
  579. package/docs/contracts/one-off-script-lifecycle.md +0 -110
  580. package/docs/contracts/orchestration-dsl-v1.md +0 -153
  581. package/docs/contracts/package-self-orientation.md +0 -163
  582. package/docs/contracts/pilot/agent-authority.md +0 -24
  583. package/docs/contracts/pilot/direct-answers.md +0 -70
  584. package/docs/contracts/pilot/language-and-tone.md +0 -63
  585. package/docs/contracts/plain-language-surface.md +0 -117
  586. package/docs/contracts/prelaunch-diagnostics.md +0 -151
  587. package/docs/contracts/profile-system.md +0 -167
  588. package/docs/contracts/reasoning-discipline-protocol.md +0 -83
  589. package/docs/contracts/release-pr-gating.md +0 -151
  590. package/docs/contracts/release-sizing.md +0 -107
  591. package/docs/contracts/release-trunk-sync.md +0 -105
  592. package/docs/contracts/review-lens-schema.md +0 -64
  593. package/docs/contracts/roadmap-complexity-standard.md +0 -138
  594. package/docs/contracts/role-experience.md +0 -125
  595. package/docs/contracts/router-blending.md +0 -71
  596. package/docs/contracts/rule-classification.md +0 -171
  597. package/docs/contracts/rule-interactions.md +0 -132
  598. package/docs/contracts/rule-interactions.yml +0 -260
  599. package/docs/contracts/rule-priority-hierarchy.md +0 -88
  600. package/docs/contracts/rule-router.md +0 -287
  601. package/docs/contracts/safety-model.md +0 -129
  602. package/docs/contracts/session-profile-overlay.md +0 -157
  603. package/docs/contracts/settings-api.md +0 -264
  604. package/docs/contracts/settings-gui-agent-mode.schema.json +0 -128
  605. package/docs/contracts/settings-sync-yaml-subset.md +0 -139
  606. package/docs/contracts/skill-bundled-assets.md +0 -62
  607. package/docs/contracts/skill-discovery.md +0 -80
  608. package/docs/contracts/skill-distribution-channels.md +0 -66
  609. package/docs/contracts/skill-domains.md +0 -144
  610. package/docs/contracts/skill-dry-run.md +0 -47
  611. package/docs/contracts/skill-family-map.yml +0 -915
  612. package/docs/contracts/smoke-contracts.md +0 -144
  613. package/docs/contracts/subagent-boundary.md +0 -59
  614. package/docs/contracts/surface-agent-contracts.md +0 -153
  615. package/docs/contracts/surface-matrix.md +0 -108
  616. package/docs/contracts/surface-tiers.md +0 -81
  617. package/docs/contracts/telegraph-telemetry.md +0 -83
  618. package/docs/contracts/ticket-bundle-format.md +0 -233
  619. package/docs/contracts/tier-3-contrib-plugin.md +0 -137
  620. package/docs/contracts/trust-and-safety.md +0 -144
  621. package/docs/contracts/ui-stack-extension.md +0 -237
  622. package/docs/contracts/ui-track-flow.md +0 -329
  623. package/docs/contracts/universal-skills.md +0 -91
  624. package/docs/contracts/user-type-schema.md +0 -146
  625. package/docs/contracts/value-dashboard-spec.md +0 -378
  626. package/docs/contracts/value-report-schema.md +0 -168
  627. package/docs/contracts/workflow-packs.md +0 -121
  628. package/docs/contracts/workspace-boundary.md +0 -84
  629. package/docs/contracts/workspace-documents.md +0 -144
  630. package/docs/contracts/write-engine.md +0 -182
  631. package/docs/cookbook.md +0 -152
  632. package/docs/customization.md +0 -685
  633. package/docs/decisions/ADR-001-kernel-swap-deferred.md +0 -109
  634. package/docs/decisions/ADR-002-kernel-bucket-overrides.md +0 -135
  635. package/docs/decisions/ADR-003-flat-cluster-subs-and-colon-syntax.md +0 -137
  636. package/docs/decisions/ADR-004-rule-governance-pruning.md +0 -240
  637. package/docs/decisions/ADR-005-subagent-worktrees.md +0 -120
  638. package/docs/decisions/ADR-006-skill-tools-python-pilot.md +0 -114
  639. package/docs/decisions/ADR-007-agent-discovery-scopes.md +0 -371
  640. package/docs/decisions/ADR-008-installed-tools-manifest.md +0 -160
  641. package/docs/decisions/ADR-009-event4u-namespace.md +0 -188
  642. package/docs/decisions/ADR-010-profile-pack-preset-boundary.md +0 -168
  643. package/docs/decisions/ADR-011-domain-pack-readiness.md +0 -213
  644. package/docs/decisions/ADR-012-typescript-cli-shell.md +0 -162
  645. package/docs/decisions/ADR-013-discovery-frontmatter-contract.md +0 -342
  646. package/docs/decisions/ADR-014-gui-framework-choice.md +0 -136
  647. package/docs/decisions/ADR-015-discovery-manifest-contract.md +0 -146
  648. package/docs/decisions/ADR-016-installer-architecture.md +0 -189
  649. package/docs/decisions/ADR-017-monorepo-physical-layout.md +0 -261
  650. package/docs/decisions/ADR-018-trust-and-safety-layer.md +0 -159
  651. package/docs/decisions/ADR-019-router-json-dist-location.md +0 -124
  652. package/docs/decisions/ADR-020-global-only-consumer-scope.md +0 -213
  653. package/docs/decisions/ADR-021-deployment-shape.md +0 -153
  654. package/docs/decisions/ADR-022-daily-workspace-decomposition.md +0 -140
  655. package/docs/decisions/ADR-023-host-agent-protocol.md +0 -129
  656. package/docs/decisions/ADR-024-workspace-v0-feature-floor.md +0 -126
  657. package/docs/decisions/ADR-025-workspace-chrome.md +0 -119
  658. package/docs/decisions/ADR-026-explain-mode-translation.md +0 -117
  659. package/docs/decisions/ADR-027-changelog-machine-vs-manual.md +0 -129
  660. package/docs/decisions/ADR-028-root-layout.md +0 -147
  661. package/docs/decisions/ADR-029-multi-workspace-deferred.md +0 -122
  662. package/docs/decisions/ADR-030-claude-code-command-projection.md +0 -147
  663. package/docs/decisions/ADR-031-validation-severity-tiers-and-projection-roundtrip.md +0 -97
  664. package/docs/decisions/ADR-032-linked-projects-scope.md +0 -122
  665. package/docs/decisions/ADR-033-distribution-identity-npm-primary.md +0 -81
  666. package/docs/decisions/ADR-034-per-skill-model-recommendation-transport.md +0 -63
  667. package/docs/decisions/ADR-035-model-capability-tiers.md +0 -104
  668. package/docs/decisions/ADR-036-global-install-browser-wizard-handoff.md +0 -106
  669. package/docs/decisions/ADR-037-cost-profile-untangle.md +0 -117
  670. package/docs/decisions/ADR-038-canonical-settings-path.md +0 -96
  671. package/docs/decisions/ADR-039-claude-skills-untracked.md +0 -139
  672. package/docs/decisions/ADR-040-execution-model-projection-time-filtering.md +0 -244
  673. package/docs/decisions/ADR-041-controlled-command-verbs.md +0 -133
  674. package/docs/decisions/ADR-042-runtime-resolver-decision-gate.md +0 -113
  675. package/docs/decisions/ADR-043-monorepo-collapse-to-src-domains.md +0 -128
  676. package/docs/decisions/ADR-044-command-naming-scheme-hyphenated.md +0 -250
  677. package/docs/decisions/ADR-045-src-source-layout-and-profiles-as-views.md +0 -111
  678. package/docs/decisions/ADR-046-thin-command-principle.md +0 -93
  679. package/docs/decisions/ADR-047-framework-neutral-stack-adaptive-commands.md +0 -94
  680. package/docs/decisions/ADR-048-command-justification-rule.md +0 -106
  681. package/docs/decisions/ADR-049-configuration-trust-boundary.md +0 -132
  682. package/docs/decisions/ADR-050-workspace-vs-package-root-boundary.md +0 -121
  683. package/docs/decisions/ADR-051-uncondensed-source-container-relocation.md +0 -114
  684. package/docs/decisions/ADR-052-packages-removal-and-pack-home-migration.md +0 -86
  685. package/docs/decisions/ADR-053-agents-namespace-dual-role-resolution.md +0 -132
  686. package/docs/decisions/ADR-054-rule-adherence-decay-triggered-restate.md +0 -143
  687. package/docs/decisions/ADR-055-flow-layer-data-model.md +0 -235
  688. package/docs/decisions/ADR-056-unvalidated-video-adapters-disposition.md +0 -124
  689. package/docs/decisions/ADR-057-consolidation-evidence-gate-outcomes.md +0 -135
  690. package/docs/decisions/ADR-058-condensed-output-relocation-to-dist.md +0 -94
  691. package/docs/decisions/ADR-059-render-resume-filesystem-as-state.md +0 -161
  692. package/docs/decisions/ADR-060-comfyui-sandbox-model.md +0 -154
  693. package/docs/decisions/ADR-061-corpus-grounding-layer.md +0 -230
  694. package/docs/decisions/ADR-062-encrypt-at-rest-store-architecture.md +0 -121
  695. package/docs/decisions/ADR-063-append-jsonl-encryption-deferred.md +0 -83
  696. package/docs/decisions/ADR-064-append-jsonl-per-record-encryption.md +0 -113
  697. package/docs/decisions/ADR-065-tier3-inbox-handoff-v0.md +0 -86
  698. package/docs/decisions/ADR-066-skill-body-prerendering.md +0 -93
  699. package/docs/decisions/ADR-067-glama-registry-listing.md +0 -259
  700. package/docs/decisions/ADR-068-host-tier-detection.md +0 -90
  701. package/docs/decisions/ADR-069-prompt-renderer.md +0 -97
  702. package/docs/decisions/ADR-070-tier1-drive-loop.md +0 -94
  703. package/docs/decisions/ADR-071-launch-drive-integration.md +0 -95
  704. package/docs/decisions/ADR-072-codex-gemini-drive-configs.md +0 -90
  705. package/docs/decisions/ADR-073-drive-health-kill-switch.md +0 -81
  706. package/docs/decisions/ADR-074-drive-kill-switch-auto-recovery.md +0 -84
  707. package/docs/decisions/ADR-075-workspace-gui-drive.md +0 -83
  708. package/docs/decisions/ADR-076-workspace-multi-turn.md +0 -92
  709. package/docs/decisions/ADR-077-workspace-followup-gui.md +0 -70
  710. package/docs/decisions/ADR-078-drive-health-panel.md +0 -70
  711. package/docs/decisions/ADR-079-workspace-host-picker.md +0 -81
  712. package/docs/decisions/ADR-080-host-session-expired-410.md +0 -92
  713. package/docs/decisions/ADR-081-drive-health-reset-and-410-affordance.md +0 -71
  714. package/docs/decisions/ADR-082-410-one-click-relaunch.md +0 -58
  715. package/docs/decisions/ADR-083-session-thread-and-arbitrary-continuation.md +0 -85
  716. package/docs/decisions/ADR-084-drive-health-refresh-on-drive.md +0 -52
  717. package/docs/decisions/ADR-085-mcp-stdio-end-user-distribution-shape.md +0 -158
  718. package/docs/decisions/ADR-086-read-only-cross-agent-mcp-discovery-helper.md +0 -171
  719. package/docs/decisions/ADR-087-installer-e2e-test-strategy.md +0 -111
  720. package/docs/decisions/ADR-088-no-external-runtime-federation.md +0 -144
  721. package/docs/decisions/ADR-089-lean-local-plugin-install.md +0 -111
  722. package/docs/decisions/ADR-090-visibility-command-frontmatter-field.md +0 -95
  723. package/docs/decisions/ADR-091-split-meta-capability-packs.md +0 -113
  724. package/docs/decisions/ADR-092-defer-command-tier-alias-removal.md +0 -117
  725. package/docs/decisions/ADR-093-ai-council-config-user-global.md +0 -117
  726. package/docs/decisions/ADR-094-agent-memory-layer-removal.md +0 -94
  727. package/docs/decisions/ADR-095-workspace-boundary-contract.md +0 -108
  728. package/docs/decisions/ADR-096-analysis-workbench.md +0 -110
  729. package/docs/decisions/ADR-097-mission-recipe-privilege-boundary.md +0 -121
  730. package/docs/decisions/ADR-098-evidence-first-structure-discovery.md +0 -154
  731. package/docs/decisions/ADR-099-file-first-pattern-library.md +0 -87
  732. package/docs/decisions/ADR-100-global-knowledge-card-sharing.md +0 -140
  733. package/docs/decisions/ADR-101-ticket-bundle-emission.md +0 -109
  734. package/docs/decisions/ADR-102-ticket-handoff-paste-and-mcp.md +0 -72
  735. package/docs/decisions/ADR-103-global-knowledge-default-off-until-measured.md +0 -92
  736. package/docs/decisions/ADR-104-ai-council-config-global-only.md +0 -119
  737. package/docs/decisions/ADR-105-automatic-subagent-orchestration.md +0 -108
  738. package/docs/decisions/ADR-106-recursive-verification-benchmark-gate.md +0 -126
  739. package/docs/decisions/ADR-107-legal-domain-pack-adoption.md +0 -70
  740. package/docs/decisions/ADR-108-open-source-forever-no-commercial-tier.md +0 -46
  741. package/docs/decisions/ADR-109-subagent-v1-contract.md +0 -246
  742. package/docs/decisions/ADR-110-discipline-profile-resolution-locus.md +0 -110
  743. package/docs/decisions/ADR-111-canonical-glama-listing.md +0 -97
  744. package/docs/decisions/ADR-112-stdio-lite-stays-read-only.md +0 -92
  745. package/docs/decisions/ADR-113-ci-native-release-label-trigger.md +0 -201
  746. package/docs/decisions/ADR-114-commit-policy-iron-law-override.md +0 -85
  747. package/docs/decisions/ADR-115-command-cluster-consolidation-phase-4.md +0 -91
  748. package/docs/decisions/ADR-116-memory-tripwire-activation-path.md +0 -144
  749. package/docs/decisions/ADR-117-subagents-auto-default-on.md +0 -89
  750. package/docs/decisions/ADR-118-loop-engineering-boundaries.md +0 -162
  751. package/docs/decisions/ADR-119-global-knowledge-default-on.md +0 -104
  752. package/docs/decisions/ADR-120-council-chairman-mode.md +0 -70
  753. package/docs/decisions/ADR-121-knowledge-sensitivity-classes.md +0 -90
  754. package/docs/decisions/ADR-122-adversarial-verification-council.md +0 -166
  755. package/docs/decisions/ADR-123-runtime-security-scope-and-spawn-hardening.md +0 -142
  756. package/docs/decisions/ADR-200-python-to-typescript-migration.md +0 -203
  757. package/docs/decisions/ADR-rule-kernel-and-router.md +0 -133
  758. package/docs/decisions/INDEX.md +0 -136
  759. package/docs/deploy/connector-setup.md +0 -129
  760. package/docs/deploy/env-vars.md +0 -70
  761. package/docs/deploy/policy-cookbook.md +0 -130
  762. package/docs/deploy/quickstart.md +0 -112
  763. package/docs/deploy/small-team-recipe.md +0 -148
  764. package/docs/deploy/team-deployment-posture.md +0 -111
  765. package/docs/design/adversarial-council-eval.md +0 -106
  766. package/docs/design/council-vs-solo-baseline.md +0 -92
  767. package/docs/design/cross-model-parity-eval.md +0 -82
  768. package/docs/design/length-neutral-judge-rerun.md +0 -92
  769. package/docs/design/utilization-window-criteria.md +0 -51
  770. package/docs/development.md +0 -230
  771. package/docs/distribution/awesome-list-submission.md +0 -46
  772. package/docs/distribution/consumer-matrix.md +0 -96
  773. package/docs/distribution/launch-story-draft.md +0 -58
  774. package/docs/distribution/mcp-submission-checklist.md +0 -95
  775. package/docs/distribution/public-install-smoke.md +0 -68
  776. package/docs/distribution/registries.md +0 -117
  777. package/docs/distribution/registry-submissions.md +0 -85
  778. package/docs/distribution/telemetry-privacy.md +0 -128
  779. package/docs/distribution/telemetry-schema.md +0 -174
  780. package/docs/distribution/topics-equivalents-decay-policy.md +0 -51
  781. package/docs/end-to-end-walkthroughs.md +0 -165
  782. package/docs/enforcement-by-host.md +0 -44
  783. package/docs/examples/agent-user.example.md +0 -22
  784. package/docs/experiences/agency.md +0 -49
  785. package/docs/experiences/content_creator.md +0 -49
  786. package/docs/experiences/developer.md +0 -49
  787. package/docs/experiences/finance.md +0 -50
  788. package/docs/experiences/founder.md +0 -49
  789. package/docs/experiences/ops.md +0 -49
  790. package/docs/featured-commands.md +0 -27
  791. package/docs/featured-skills.md +0 -95
  792. package/docs/flows.md +0 -67
  793. package/docs/getting-started-by-role.md +0 -190
  794. package/docs/getting-started-laravel.md +0 -72
  795. package/docs/getting-started-local-stdio.md +0 -77
  796. package/docs/getting-started.md +0 -254
  797. package/docs/github-topics.md +0 -93
  798. package/docs/governance-advantage.md +0 -72
  799. package/docs/governance.md +0 -96
  800. package/docs/guides/cross-repo-linked-projects.md +0 -93
  801. package/docs/guides/cross-repo-retrieval.md +0 -61
  802. package/docs/guides/frontend-design-corpus-refresh.md +0 -83
  803. package/docs/guides/local-analytics.md +0 -125
  804. package/docs/guides/local-knowledge.md +0 -127
  805. package/docs/guides/skill-discovery.md +0 -71
  806. package/docs/guides/skill-preview.md +0 -71
  807. package/docs/hook-payload-capture.md +0 -221
  808. package/docs/install-friction-report.md +0 -66
  809. package/docs/installation.md +0 -959
  810. package/docs/maintainers/branch-protection.md +0 -105
  811. package/docs/maintainers/dev-mode.md +0 -106
  812. package/docs/maintainers/optional-media-deps.md +0 -50
  813. package/docs/maintainers/system-map.md +0 -85
  814. package/docs/mcp-registries.md +0 -94
  815. package/docs/mcp-server.md +0 -175
  816. package/docs/mcp.md +0 -147
  817. package/docs/media/proof-demo.cast +0 -14
  818. package/docs/media/proof-demo.gif +0 -0
  819. package/docs/migration/consumer-template-consumption-model.md +0 -145
  820. package/docs/migration/divergences/README.md +0 -55
  821. package/docs/migration/divergences/_template.md +0 -50
  822. package/docs/migration/divergences/bench-stats-float-precision.md +0 -72
  823. package/docs/migration/divergences/mcp-telemetry-node-sqlite.md +0 -61
  824. package/docs/migration/divergences/pack-mcp-content-gzip-body.md +0 -53
  825. package/docs/migration/divergences/src-scripts-build_cloud_bundle.md +0 -63
  826. package/docs/migration/divergences/src-scripts-check_memory.md +0 -91
  827. package/docs/migration/divergences/src-scripts-inventory_abstraction_budget.md +0 -65
  828. package/docs/migration/divergences/src-scripts-lint_marketplace.md +0 -57
  829. package/docs/migration/divergences/src-scripts-lint_mcp_registry_manifest.md +0 -70
  830. package/docs/migration/divergences/src-scripts-spotcheck_thin_root.md +0 -60
  831. package/docs/migration/divergences/src-scripts-validate_agent_settings.md +0 -58
  832. package/docs/migration/node-floor.md +0 -86
  833. package/docs/migration/v1-to-v2.md +0 -156
  834. package/docs/migration/yaml-roundtrip-spike.md +0 -163
  835. package/docs/migrations/commands-1.15.0.md +0 -117
  836. package/docs/parity/bench-external.json +0 -58
  837. package/docs/parity/bench.json +0 -41
  838. package/docs/parity/command-frontmatter.md +0 -60
  839. package/docs/parity/external-runtime.md +0 -46
  840. package/docs/personas.md +0 -178
  841. package/docs/positioning-evidence.md +0 -86
  842. package/docs/profiles.md +0 -108
  843. package/docs/proof.md +0 -176
  844. package/docs/quality.md +0 -98
  845. package/docs/readme-split-plan.md +0 -102
  846. package/docs/recruits/_template.md +0 -81
  847. package/docs/release-runbook.md +0 -141
  848. package/docs/role-experiences.md +0 -19
  849. package/docs/safety.md +0 -30
  850. package/docs/second-brain-scope.md +0 -116
  851. package/docs/self-review-gate.md +0 -65
  852. package/docs/setup/enterprise-and-offline.md +0 -201
  853. package/docs/setup/mcp-client-config.md +0 -358
  854. package/docs/setup/mcp-cloud-endpoints.md +0 -116
  855. package/docs/setup/mcp-cloud-registry-listing.md +0 -99
  856. package/docs/setup/mcp-cloud-setup.md +0 -183
  857. package/docs/setup/mcp-r2-bootstrap.md +0 -82
  858. package/docs/setup/mcp-server-docker.md +0 -101
  859. package/docs/setup/per-ide/aider.md +0 -48
  860. package/docs/setup/per-ide/antigravity.md +0 -68
  861. package/docs/setup/per-ide/augment.md +0 -89
  862. package/docs/setup/per-ide/claude-code.md +0 -97
  863. package/docs/setup/per-ide/claude-desktop.md +0 -207
  864. package/docs/setup/per-ide/cline.md +0 -43
  865. package/docs/setup/per-ide/codebuddy.md +0 -63
  866. package/docs/setup/per-ide/codex.md +0 -46
  867. package/docs/setup/per-ide/continue.md +0 -68
  868. package/docs/setup/per-ide/copilot.md +0 -80
  869. package/docs/setup/per-ide/cursor.md +0 -125
  870. package/docs/setup/per-ide/droid.md +0 -65
  871. package/docs/setup/per-ide/gemini-cli.md +0 -45
  872. package/docs/setup/per-ide/jetbrains.md +0 -76
  873. package/docs/setup/per-ide/kilocode.md +0 -66
  874. package/docs/setup/per-ide/kiro.md +0 -72
  875. package/docs/setup/per-ide/opencode.md +0 -62
  876. package/docs/setup/per-ide/qoder.md +0 -63
  877. package/docs/setup/per-ide/roocode.md +0 -68
  878. package/docs/setup/per-ide/trae.md +0 -63
  879. package/docs/setup/per-ide/warp.md +0 -63
  880. package/docs/setup/per-ide/windsurf.md +0 -109
  881. package/docs/setup/per-ide/zed.md +0 -73
  882. package/docs/showcase.md +0 -209
  883. package/docs/skill-duplication-findings.md +0 -91
  884. package/docs/skills-catalog.md +0 -265
  885. package/docs/skills-taxonomy.md +0 -90
  886. package/docs/spawn-site-policy.md +0 -72
  887. package/docs/succession.md +0 -80
  888. package/docs/threat-model.md +0 -29
  889. package/docs/troubleshooting.md +0 -155
  890. package/docs/ui-track-mental-model.md +0 -121
  891. package/docs/us-vs-the-category.md +0 -38
  892. package/docs/value.md +0 -86
  893. package/docs/walkthroughs/assets/workspace-role-grid.png +0 -0
  894. package/docs/walkthroughs/assets/workspace-session-started.png +0 -0
  895. package/docs/walkthroughs/assets/workspace-task-picker.png +0 -0
  896. package/docs/walkthroughs/daily-workspace-a11y.md +0 -87
  897. package/docs/walkthroughs/daily-workspace.md +0 -127
  898. package/docs/wedge/production-validator/README.md +0 -81
  899. package/docs/wedge/production-validator/first-run-check.sh +0 -42
  900. package/docs/wedge/production-validator/production-validator.md +0 -83
  901. package/docs/wizard.md +0 -173
@@ -13,7 +13,11 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
13
13
  throw Error('Dynamic require of "' + x + '" is not supported');
14
14
  });
15
15
  var __commonJS = (cb, mod) => function __require2() {
16
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
16
+ try {
17
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
18
+ } catch (e) {
19
+ throw mod = 0, e;
20
+ }
17
21
  };
18
22
  var __export = (target, all) => {
19
23
  for (var name in all)
@@ -113,17 +117,17 @@ var require_visit = __commonJS({
113
117
  visit.BREAK = BREAK;
114
118
  visit.SKIP = SKIP;
115
119
  visit.REMOVE = REMOVE;
116
- function visit_(key, node, visitor, path12) {
117
- const ctrl = callVisitor(key, node, visitor, path12);
120
+ function visit_(key, node, visitor, path13) {
121
+ const ctrl = callVisitor(key, node, visitor, path13);
118
122
  if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
119
- replaceNode(key, path12, ctrl);
120
- return visit_(key, ctrl, visitor, path12);
123
+ replaceNode(key, path13, ctrl);
124
+ return visit_(key, ctrl, visitor, path13);
121
125
  }
122
126
  if (typeof ctrl !== "symbol") {
123
127
  if (identity.isCollection(node)) {
124
- path12 = Object.freeze(path12.concat(node));
128
+ path13 = Object.freeze(path13.concat(node));
125
129
  for (let i = 0; i < node.items.length; ++i) {
126
- const ci = visit_(i, node.items[i], visitor, path12);
130
+ const ci = visit_(i, node.items[i], visitor, path13);
127
131
  if (typeof ci === "number")
128
132
  i = ci - 1;
129
133
  else if (ci === BREAK)
@@ -134,13 +138,13 @@ var require_visit = __commonJS({
134
138
  }
135
139
  }
136
140
  } else if (identity.isPair(node)) {
137
- path12 = Object.freeze(path12.concat(node));
138
- const ck = visit_("key", node.key, visitor, path12);
141
+ path13 = Object.freeze(path13.concat(node));
142
+ const ck = visit_("key", node.key, visitor, path13);
139
143
  if (ck === BREAK)
140
144
  return BREAK;
141
145
  else if (ck === REMOVE)
142
146
  node.key = null;
143
- const cv = visit_("value", node.value, visitor, path12);
147
+ const cv = visit_("value", node.value, visitor, path13);
144
148
  if (cv === BREAK)
145
149
  return BREAK;
146
150
  else if (cv === REMOVE)
@@ -161,17 +165,17 @@ var require_visit = __commonJS({
161
165
  visitAsync.BREAK = BREAK;
162
166
  visitAsync.SKIP = SKIP;
163
167
  visitAsync.REMOVE = REMOVE;
164
- async function visitAsync_(key, node, visitor, path12) {
165
- const ctrl = await callVisitor(key, node, visitor, path12);
168
+ async function visitAsync_(key, node, visitor, path13) {
169
+ const ctrl = await callVisitor(key, node, visitor, path13);
166
170
  if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
167
- replaceNode(key, path12, ctrl);
168
- return visitAsync_(key, ctrl, visitor, path12);
171
+ replaceNode(key, path13, ctrl);
172
+ return visitAsync_(key, ctrl, visitor, path13);
169
173
  }
170
174
  if (typeof ctrl !== "symbol") {
171
175
  if (identity.isCollection(node)) {
172
- path12 = Object.freeze(path12.concat(node));
176
+ path13 = Object.freeze(path13.concat(node));
173
177
  for (let i = 0; i < node.items.length; ++i) {
174
- const ci = await visitAsync_(i, node.items[i], visitor, path12);
178
+ const ci = await visitAsync_(i, node.items[i], visitor, path13);
175
179
  if (typeof ci === "number")
176
180
  i = ci - 1;
177
181
  else if (ci === BREAK)
@@ -182,13 +186,13 @@ var require_visit = __commonJS({
182
186
  }
183
187
  }
184
188
  } else if (identity.isPair(node)) {
185
- path12 = Object.freeze(path12.concat(node));
186
- const ck = await visitAsync_("key", node.key, visitor, path12);
189
+ path13 = Object.freeze(path13.concat(node));
190
+ const ck = await visitAsync_("key", node.key, visitor, path13);
187
191
  if (ck === BREAK)
188
192
  return BREAK;
189
193
  else if (ck === REMOVE)
190
194
  node.key = null;
191
- const cv = await visitAsync_("value", node.value, visitor, path12);
195
+ const cv = await visitAsync_("value", node.value, visitor, path13);
192
196
  if (cv === BREAK)
193
197
  return BREAK;
194
198
  else if (cv === REMOVE)
@@ -215,23 +219,23 @@ var require_visit = __commonJS({
215
219
  }
216
220
  return visitor;
217
221
  }
218
- function callVisitor(key, node, visitor, path12) {
222
+ function callVisitor(key, node, visitor, path13) {
219
223
  if (typeof visitor === "function")
220
- return visitor(key, node, path12);
224
+ return visitor(key, node, path13);
221
225
  if (identity.isMap(node))
222
- return visitor.Map?.(key, node, path12);
226
+ return visitor.Map?.(key, node, path13);
223
227
  if (identity.isSeq(node))
224
- return visitor.Seq?.(key, node, path12);
228
+ return visitor.Seq?.(key, node, path13);
225
229
  if (identity.isPair(node))
226
- return visitor.Pair?.(key, node, path12);
230
+ return visitor.Pair?.(key, node, path13);
227
231
  if (identity.isScalar(node))
228
- return visitor.Scalar?.(key, node, path12);
232
+ return visitor.Scalar?.(key, node, path13);
229
233
  if (identity.isAlias(node))
230
- return visitor.Alias?.(key, node, path12);
234
+ return visitor.Alias?.(key, node, path13);
231
235
  return void 0;
232
236
  }
233
- function replaceNode(key, path12, node) {
234
- const parent = path12[path12.length - 1];
237
+ function replaceNode(key, path13, node) {
238
+ const parent = path13[path13.length - 1];
235
239
  if (identity.isCollection(parent)) {
236
240
  parent.items[key] = node;
237
241
  } else if (identity.isPair(parent)) {
@@ -841,10 +845,10 @@ var require_Collection = __commonJS({
841
845
  var createNode = require_createNode();
842
846
  var identity = require_identity();
843
847
  var Node = require_Node();
844
- function collectionFromPath(schema, path12, value) {
848
+ function collectionFromPath(schema, path13, value) {
845
849
  let v = value;
846
- for (let i = path12.length - 1; i >= 0; --i) {
847
- const k = path12[i];
850
+ for (let i = path13.length - 1; i >= 0; --i) {
851
+ const k = path13[i];
848
852
  if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
849
853
  const a = [];
850
854
  a[k] = v;
@@ -863,7 +867,7 @@ var require_Collection = __commonJS({
863
867
  sourceObjects: /* @__PURE__ */ new Map()
864
868
  });
865
869
  }
866
- var isEmptyPath = (path12) => path12 == null || typeof path12 === "object" && !!path12[Symbol.iterator]().next().done;
870
+ var isEmptyPath = (path13) => path13 == null || typeof path13 === "object" && !!path13[Symbol.iterator]().next().done;
867
871
  var Collection = class extends Node.NodeBase {
868
872
  constructor(type, schema) {
869
873
  super(type);
@@ -893,11 +897,11 @@ var require_Collection = __commonJS({
893
897
  * be a Pair instance or a `{ key, value }` object, which may not have a key
894
898
  * that already exists in the map.
895
899
  */
896
- addIn(path12, value) {
897
- if (isEmptyPath(path12))
900
+ addIn(path13, value) {
901
+ if (isEmptyPath(path13))
898
902
  this.add(value);
899
903
  else {
900
- const [key, ...rest] = path12;
904
+ const [key, ...rest] = path13;
901
905
  const node = this.get(key, true);
902
906
  if (identity.isCollection(node))
903
907
  node.addIn(rest, value);
@@ -911,8 +915,8 @@ var require_Collection = __commonJS({
911
915
  * Removes a value from the collection.
912
916
  * @returns `true` if the item was found and removed.
913
917
  */
914
- deleteIn(path12) {
915
- const [key, ...rest] = path12;
918
+ deleteIn(path13) {
919
+ const [key, ...rest] = path13;
916
920
  if (rest.length === 0)
917
921
  return this.delete(key);
918
922
  const node = this.get(key, true);
@@ -926,8 +930,8 @@ var require_Collection = __commonJS({
926
930
  * scalar values from their surrounding node; to disable set `keepScalar` to
927
931
  * `true` (collections are always returned intact).
928
932
  */
929
- getIn(path12, keepScalar) {
930
- const [key, ...rest] = path12;
933
+ getIn(path13, keepScalar) {
934
+ const [key, ...rest] = path13;
931
935
  const node = this.get(key, true);
932
936
  if (rest.length === 0)
933
937
  return !keepScalar && identity.isScalar(node) ? node.value : node;
@@ -945,8 +949,8 @@ var require_Collection = __commonJS({
945
949
  /**
946
950
  * Checks if the collection includes a value with the key `key`.
947
951
  */
948
- hasIn(path12) {
949
- const [key, ...rest] = path12;
952
+ hasIn(path13) {
953
+ const [key, ...rest] = path13;
950
954
  if (rest.length === 0)
951
955
  return this.has(key);
952
956
  const node = this.get(key, true);
@@ -956,8 +960,8 @@ var require_Collection = __commonJS({
956
960
  * Sets a value in this collection. For `!!set`, `value` needs to be a
957
961
  * boolean to add/remove the item from the set.
958
962
  */
959
- setIn(path12, value) {
960
- const [key, ...rest] = path12;
963
+ setIn(path13, value) {
964
+ const [key, ...rest] = path13;
961
965
  if (rest.length === 0) {
962
966
  this.set(key, value);
963
967
  } else {
@@ -3472,9 +3476,9 @@ var require_Document = __commonJS({
3472
3476
  this.contents.add(value);
3473
3477
  }
3474
3478
  /** Adds a value to the document. */
3475
- addIn(path12, value) {
3479
+ addIn(path13, value) {
3476
3480
  if (assertCollection(this.contents))
3477
- this.contents.addIn(path12, value);
3481
+ this.contents.addIn(path13, value);
3478
3482
  }
3479
3483
  /**
3480
3484
  * Create a new `Alias` node, ensuring that the target `node` has the required anchor.
@@ -3549,14 +3553,14 @@ var require_Document = __commonJS({
3549
3553
  * Removes a value from the document.
3550
3554
  * @returns `true` if the item was found and removed.
3551
3555
  */
3552
- deleteIn(path12) {
3553
- if (Collection.isEmptyPath(path12)) {
3556
+ deleteIn(path13) {
3557
+ if (Collection.isEmptyPath(path13)) {
3554
3558
  if (this.contents == null)
3555
3559
  return false;
3556
3560
  this.contents = null;
3557
3561
  return true;
3558
3562
  }
3559
- return assertCollection(this.contents) ? this.contents.deleteIn(path12) : false;
3563
+ return assertCollection(this.contents) ? this.contents.deleteIn(path13) : false;
3560
3564
  }
3561
3565
  /**
3562
3566
  * Returns item at `key`, or `undefined` if not found. By default unwraps
@@ -3571,10 +3575,10 @@ var require_Document = __commonJS({
3571
3575
  * scalar values from their surrounding node; to disable set `keepScalar` to
3572
3576
  * `true` (collections are always returned intact).
3573
3577
  */
3574
- getIn(path12, keepScalar) {
3575
- if (Collection.isEmptyPath(path12))
3578
+ getIn(path13, keepScalar) {
3579
+ if (Collection.isEmptyPath(path13))
3576
3580
  return !keepScalar && identity.isScalar(this.contents) ? this.contents.value : this.contents;
3577
- return identity.isCollection(this.contents) ? this.contents.getIn(path12, keepScalar) : void 0;
3581
+ return identity.isCollection(this.contents) ? this.contents.getIn(path13, keepScalar) : void 0;
3578
3582
  }
3579
3583
  /**
3580
3584
  * Checks if the document includes a value with the key `key`.
@@ -3585,10 +3589,10 @@ var require_Document = __commonJS({
3585
3589
  /**
3586
3590
  * Checks if the document includes a value at `path`.
3587
3591
  */
3588
- hasIn(path12) {
3589
- if (Collection.isEmptyPath(path12))
3592
+ hasIn(path13) {
3593
+ if (Collection.isEmptyPath(path13))
3590
3594
  return this.contents !== void 0;
3591
- return identity.isCollection(this.contents) ? this.contents.hasIn(path12) : false;
3595
+ return identity.isCollection(this.contents) ? this.contents.hasIn(path13) : false;
3592
3596
  }
3593
3597
  /**
3594
3598
  * Sets a value in this document. For `!!set`, `value` needs to be a
@@ -3605,13 +3609,13 @@ var require_Document = __commonJS({
3605
3609
  * Sets a value in this document. For `!!set`, `value` needs to be a
3606
3610
  * boolean to add/remove the item from the set.
3607
3611
  */
3608
- setIn(path12, value) {
3609
- if (Collection.isEmptyPath(path12)) {
3612
+ setIn(path13, value) {
3613
+ if (Collection.isEmptyPath(path13)) {
3610
3614
  this.contents = value;
3611
3615
  } else if (this.contents == null) {
3612
- this.contents = Collection.collectionFromPath(this.schema, Array.from(path12), value);
3616
+ this.contents = Collection.collectionFromPath(this.schema, Array.from(path13), value);
3613
3617
  } else if (assertCollection(this.contents)) {
3614
- this.contents.setIn(path12, value);
3618
+ this.contents.setIn(path13, value);
3615
3619
  }
3616
3620
  }
3617
3621
  /**
@@ -5571,9 +5575,9 @@ var require_cst_visit = __commonJS({
5571
5575
  visit.BREAK = BREAK;
5572
5576
  visit.SKIP = SKIP;
5573
5577
  visit.REMOVE = REMOVE;
5574
- visit.itemAtPath = (cst, path12) => {
5578
+ visit.itemAtPath = (cst, path13) => {
5575
5579
  let item = cst;
5576
- for (const [field, index] of path12) {
5580
+ for (const [field, index] of path13) {
5577
5581
  const tok = item?.[field];
5578
5582
  if (tok && "items" in tok) {
5579
5583
  item = tok.items[index];
@@ -5582,23 +5586,23 @@ var require_cst_visit = __commonJS({
5582
5586
  }
5583
5587
  return item;
5584
5588
  };
5585
- visit.parentCollection = (cst, path12) => {
5586
- const parent = visit.itemAtPath(cst, path12.slice(0, -1));
5587
- const field = path12[path12.length - 1][0];
5589
+ visit.parentCollection = (cst, path13) => {
5590
+ const parent = visit.itemAtPath(cst, path13.slice(0, -1));
5591
+ const field = path13[path13.length - 1][0];
5588
5592
  const coll = parent?.[field];
5589
5593
  if (coll && "items" in coll)
5590
5594
  return coll;
5591
5595
  throw new Error("Parent collection not found");
5592
5596
  };
5593
- function _visit(path12, item, visitor) {
5594
- let ctrl = visitor(item, path12);
5597
+ function _visit(path13, item, visitor) {
5598
+ let ctrl = visitor(item, path13);
5595
5599
  if (typeof ctrl === "symbol")
5596
5600
  return ctrl;
5597
5601
  for (const field of ["key", "value"]) {
5598
5602
  const token = item[field];
5599
5603
  if (token && "items" in token) {
5600
5604
  for (let i = 0; i < token.items.length; ++i) {
5601
- const ci = _visit(Object.freeze(path12.concat([[field, i]])), token.items[i], visitor);
5605
+ const ci = _visit(Object.freeze(path13.concat([[field, i]])), token.items[i], visitor);
5602
5606
  if (typeof ci === "number")
5603
5607
  i = ci - 1;
5604
5608
  else if (ci === BREAK)
@@ -5609,10 +5613,10 @@ var require_cst_visit = __commonJS({
5609
5613
  }
5610
5614
  }
5611
5615
  if (typeof ctrl === "function" && field === "key")
5612
- ctrl = ctrl(item, path12);
5616
+ ctrl = ctrl(item, path13);
5613
5617
  }
5614
5618
  }
5615
- return typeof ctrl === "function" ? ctrl(item, path12) : ctrl;
5619
+ return typeof ctrl === "function" ? ctrl(item, path13) : ctrl;
5616
5620
  }
5617
5621
  exports.visit = visit;
5618
5622
  }
@@ -6914,14 +6918,14 @@ var require_parser = __commonJS({
6914
6918
  case "scalar":
6915
6919
  case "single-quoted-scalar":
6916
6920
  case "double-quoted-scalar": {
6917
- const fs14 = this.flowScalar(this.type);
6921
+ const fs15 = this.flowScalar(this.type);
6918
6922
  if (atNextItem || it.value) {
6919
- map.items.push({ start, key: fs14, sep: [] });
6923
+ map.items.push({ start, key: fs15, sep: [] });
6920
6924
  this.onKeyLine = true;
6921
6925
  } else if (it.sep) {
6922
- this.stack.push(fs14);
6926
+ this.stack.push(fs15);
6923
6927
  } else {
6924
- Object.assign(it, { key: fs14, sep: [] });
6928
+ Object.assign(it, { key: fs15, sep: [] });
6925
6929
  this.onKeyLine = true;
6926
6930
  }
6927
6931
  return;
@@ -7049,13 +7053,13 @@ var require_parser = __commonJS({
7049
7053
  case "scalar":
7050
7054
  case "single-quoted-scalar":
7051
7055
  case "double-quoted-scalar": {
7052
- const fs14 = this.flowScalar(this.type);
7056
+ const fs15 = this.flowScalar(this.type);
7053
7057
  if (!it || it.value)
7054
- fc.items.push({ start: [], key: fs14, sep: [] });
7058
+ fc.items.push({ start: [], key: fs15, sep: [] });
7055
7059
  else if (it.sep)
7056
- this.stack.push(fs14);
7060
+ this.stack.push(fs15);
7057
7061
  else
7058
- Object.assign(it, { key: fs14, sep: [] });
7062
+ Object.assign(it, { key: fs15, sep: [] });
7059
7063
  return;
7060
7064
  }
7061
7065
  case "flow-map-end":
@@ -7365,10 +7369,10 @@ var require_dist = __commonJS({
7365
7369
 
7366
7370
  // src/scripts/install.ts
7367
7371
  import { spawn, spawnSync as spawnSync2 } from "node:child_process";
7368
- import * as crypto2 from "node:crypto";
7369
- import * as fs13 from "node:fs";
7370
- import * as os6 from "node:os";
7371
- import * as path11 from "node:path";
7372
+ import * as crypto3 from "node:crypto";
7373
+ import * as fs14 from "node:fs";
7374
+ import * as os7 from "node:os";
7375
+ import * as path12 from "node:path";
7372
7376
  import process3 from "node:process";
7373
7377
  import { fileURLToPath as fileURLToPath3, pathToFileURL as pathToFileURL2 } from "node:url";
7374
7378
 
@@ -7868,8 +7872,8 @@ function lockfile_write_path(env) {
7868
7872
  }
7869
7873
  return write_target("installed.lock", { env: env ?? null });
7870
7874
  }
7871
- function read_lockfile(path12) {
7872
- const target = path12 ?? lockfile_path();
7875
+ function read_lockfile(path13) {
7876
+ const target = path13 ?? lockfile_path();
7873
7877
  let text;
7874
7878
  try {
7875
7879
  text = fs2.readFileSync(target, { encoding: "utf-8" });
@@ -8737,18 +8741,18 @@ function manifest_path(project_root, env) {
8737
8741
  var _TOP_KEY_RE = /^([A-Za-z_][A-Za-z0-9_]*)\s*:\s*"?([^"\n]*?)"?\s*$/;
8738
8742
  var _LIST_DASH_RE = /^\s*-\s*(.+?)\s*$/;
8739
8743
  var _INDENT_KEY_RE = /^\s+([A-Za-z_][A-Za-z0-9_]*)\s*:\s*"?([^"\n]*?)"?\s*$/;
8740
- function read_manifest(path12) {
8744
+ function read_manifest(path13) {
8741
8745
  let text;
8742
8746
  try {
8743
- text = require_read_text(path12);
8747
+ text = require_read_text(path13);
8744
8748
  } catch {
8745
8749
  return null;
8746
8750
  }
8747
8751
  const data = _parse_manual(text);
8748
8752
  return _normalise_v2_shape(data);
8749
8753
  }
8750
- function require_read_text(path12) {
8751
- return fs6.readFileSync(path12, { encoding: "utf-8" });
8754
+ function require_read_text(path13) {
8755
+ return fs6.readFileSync(path13, { encoding: "utf-8" });
8752
8756
  }
8753
8757
  function _normalise_v2_shape(data) {
8754
8758
  if (data["tools"] === void 0 || data["tools"] === null) {
@@ -8929,9 +8933,9 @@ function stable_sort(items, key) {
8929
8933
  return a.index - b.index;
8930
8934
  }).map((entry) => entry.item);
8931
8935
  }
8932
- function write_manifest(path12, version, tools, options = {}) {
8936
+ function write_manifest(path13, version, tools, options = {}) {
8933
8937
  const rendered = _render2(version, tools, { deploy_roots: options.deploy_roots ?? null });
8934
- return write_atomic(path12, rendered);
8938
+ return write_atomic(path13, rendered);
8935
8939
  }
8936
8940
  var ScopeMismatchError = class extends Error {
8937
8941
  name_;
@@ -9019,10 +9023,137 @@ function _today() {
9019
9023
  return (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
9020
9024
  }
9021
9025
 
9022
- // src/scripts/_lib/claude_desktop_bundler.ts
9026
+ // src/scripts/_lib/install_drift.ts
9027
+ var import_yaml = __toESM(require_dist(), 1);
9023
9028
  import * as crypto from "node:crypto";
9024
9029
  import * as fs7 from "node:fs";
9030
+ import * as os5 from "node:os";
9025
9031
  import * as path6 from "node:path";
9032
+ function expanduser5(p) {
9033
+ if (p === "~") {
9034
+ return os5.homedir();
9035
+ }
9036
+ if (p.startsWith("~/") || process.platform === "win32" && p.startsWith("~\\")) {
9037
+ return path6.join(os5.homedir(), p.slice(2));
9038
+ }
9039
+ return p;
9040
+ }
9041
+ function resolve_entry_path(project_root, raw) {
9042
+ const p = expanduser5(raw);
9043
+ return path6.isAbsolute(p) ? p : path6.join(project_root, p);
9044
+ }
9045
+ function sha256_of_file(p) {
9046
+ try {
9047
+ return crypto.createHash("sha256").update(fs7.readFileSync(p)).digest("hex");
9048
+ } catch {
9049
+ return null;
9050
+ }
9051
+ }
9052
+ function collect_drift(project_root, env) {
9053
+ const target = manifest_path(project_root, env);
9054
+ let text;
9055
+ try {
9056
+ text = fs7.readFileSync(target, "utf-8");
9057
+ } catch {
9058
+ return null;
9059
+ }
9060
+ let data;
9061
+ try {
9062
+ data = (0, import_yaml.parse)(text, { version: "1.1" });
9063
+ } catch {
9064
+ return null;
9065
+ }
9066
+ if (typeof data !== "object" || data === null) {
9067
+ return null;
9068
+ }
9069
+ const tools = data["tools"];
9070
+ if (!Array.isArray(tools)) {
9071
+ return [];
9072
+ }
9073
+ const out = [];
9074
+ for (const tool of tools) {
9075
+ if (typeof tool !== "object" || tool === null) {
9076
+ continue;
9077
+ }
9078
+ const t = tool;
9079
+ const tool_id = t["name"] === void 0 ? "" : String(t["name"]);
9080
+ const files = t["files"];
9081
+ if (!Array.isArray(files)) {
9082
+ continue;
9083
+ }
9084
+ for (const entry of files) {
9085
+ if (typeof entry !== "object" || entry === null) {
9086
+ continue;
9087
+ }
9088
+ const e = entry;
9089
+ if (e["kind"] !== "deployed") {
9090
+ continue;
9091
+ }
9092
+ const recorded_sha256 = e["sha256"];
9093
+ if (typeof recorded_sha256 !== "string" || recorded_sha256 === "") {
9094
+ continue;
9095
+ }
9096
+ const raw_path = e["path"];
9097
+ if (typeof raw_path !== "string" || raw_path === "") {
9098
+ continue;
9099
+ }
9100
+ const resolved = resolve_entry_path(project_root, raw_path);
9101
+ if (!fs7.existsSync(resolved)) {
9102
+ out.push({
9103
+ tool_id,
9104
+ path: resolved,
9105
+ status: "missing",
9106
+ recorded_sha256,
9107
+ current_sha256: null
9108
+ });
9109
+ continue;
9110
+ }
9111
+ const current = sha256_of_file(resolved);
9112
+ if (current === recorded_sha256) {
9113
+ continue;
9114
+ }
9115
+ out.push({
9116
+ tool_id,
9117
+ path: resolved,
9118
+ status: "modified",
9119
+ recorded_sha256,
9120
+ current_sha256: current
9121
+ });
9122
+ }
9123
+ }
9124
+ out.sort((a, b) => {
9125
+ if (a.tool_id !== b.tool_id) {
9126
+ return a.tool_id < b.tool_id ? -1 : 1;
9127
+ }
9128
+ return a.path < b.path ? -1 : a.path > b.path ? 1 : 0;
9129
+ });
9130
+ return out;
9131
+ }
9132
+ function format_drift_report(entries) {
9133
+ if (entries === null) {
9134
+ return "Installer drift: no installed-tools manifest found \u2014 nothing to report.\n";
9135
+ }
9136
+ if (entries.length === 0) {
9137
+ return "Installer drift: no local modifications detected in framework-authoritative files.\n";
9138
+ }
9139
+ const lines = [];
9140
+ for (const e of entries) {
9141
+ const label = e.status === "missing" ? "missing " : "modified";
9142
+ lines.push(` ${label} [${e.tool_id}] ${e.path}`);
9143
+ }
9144
+ const modified = entries.filter((e) => e.status === "modified").length;
9145
+ const missing = entries.filter((e) => e.status === "missing").length;
9146
+ lines.push("");
9147
+ lines.push(
9148
+ `Installer drift: ${entries.length} framework-authoritative file(s) locally modified since the last install (${modified} modified, ${missing} missing).`
9149
+ );
9150
+ return lines.join("\n") + "\n";
9151
+ }
9152
+
9153
+ // src/scripts/_lib/claude_desktop_bundler.ts
9154
+ import * as crypto2 from "node:crypto";
9155
+ import * as fs8 from "node:fs";
9156
+ import * as path7 from "node:path";
9026
9157
 
9027
9158
  // src/scripts/_lib/zip_min.ts
9028
9159
  import * as zlib from "node:zlib";
@@ -9129,7 +9260,7 @@ function _is_excluded(rel_parts) {
9129
9260
  }
9130
9261
  function _is_dir(p) {
9131
9262
  try {
9132
- return fs7.statSync(p).isDirectory();
9263
+ return fs8.statSync(p).isDirectory();
9133
9264
  } catch {
9134
9265
  return false;
9135
9266
  }
@@ -9141,12 +9272,12 @@ function _compare_rel_parts(a, b) {
9141
9272
  }
9142
9273
  function _walk_skill_files(skill_dir) {
9143
9274
  const out = [];
9144
- const resolved = fs7.realpathSync(skill_dir);
9275
+ const resolved = fs8.realpathSync(skill_dir);
9145
9276
  const walk = (root, relRoot) => {
9146
9277
  const dirNames = [];
9147
9278
  const fileNames = [];
9148
- for (const dirent of fs7.readdirSync(root, { withFileTypes: true })) {
9149
- const full = path6.join(root, dirent.name);
9279
+ for (const dirent of fs8.readdirSync(root, { withFileTypes: true })) {
9280
+ const full = path7.join(root, dirent.name);
9150
9281
  const isDir2 = dirent.isDirectory() || dirent.isSymbolicLink() && _is_dir(full);
9151
9282
  if (isDir2) {
9152
9283
  dirNames.push(dirent.name);
@@ -9159,13 +9290,13 @@ function _walk_skill_files(skill_dir) {
9159
9290
  if (_is_excluded(rel_parts)) {
9160
9291
  continue;
9161
9292
  }
9162
- out.push([path6.join(root, fname), rel_parts]);
9293
+ out.push([path7.join(root, fname), rel_parts]);
9163
9294
  }
9164
9295
  for (const dname of dirNames) {
9165
9296
  if (_is_excluded([dname])) {
9166
9297
  continue;
9167
9298
  }
9168
- walk(path6.join(root, dname), [...relRoot, dname]);
9299
+ walk(path7.join(root, dname), [...relRoot, dname]);
9169
9300
  }
9170
9301
  };
9171
9302
  walk(resolved, []);
@@ -9173,58 +9304,58 @@ function _walk_skill_files(skill_dir) {
9173
9304
  return out;
9174
9305
  }
9175
9306
  function _manifest_digest(files) {
9176
- const h = crypto.createHash("sha256");
9307
+ const h = crypto2.createHash("sha256");
9177
9308
  for (const [abs_path, rel_parts] of files) {
9178
9309
  const rel = rel_parts.join("/");
9179
9310
  h.update(Buffer.from(rel, "utf-8"));
9180
9311
  h.update(Buffer.from([0]));
9181
- h.update(crypto.createHash("sha256").update(fs7.readFileSync(abs_path)).digest());
9312
+ h.update(crypto2.createHash("sha256").update(fs8.readFileSync(abs_path)).digest());
9182
9313
  h.update(Buffer.from([0]));
9183
9314
  }
9184
9315
  return h.digest("hex");
9185
9316
  }
9186
9317
  function _atomic_write_zip(zip_path, files) {
9187
- fs7.mkdirSync(path6.dirname(zip_path), { recursive: true });
9188
- const stem = path6.basename(zip_path, path6.extname(zip_path));
9189
- const tmp_path = path6.join(
9190
- path6.dirname(zip_path),
9191
- `.${stem}.${crypto.randomBytes(6).toString("hex")}.zip.tmp`
9318
+ fs8.mkdirSync(path7.dirname(zip_path), { recursive: true });
9319
+ const stem = path7.basename(zip_path, path7.extname(zip_path));
9320
+ const tmp_path = path7.join(
9321
+ path7.dirname(zip_path),
9322
+ `.${stem}.${crypto2.randomBytes(6).toString("hex")}.zip.tmp`
9192
9323
  );
9193
9324
  try {
9194
9325
  const entries = files.map(([abs_path, rel_parts]) => ({
9195
9326
  name: rel_parts.join("/"),
9196
- data: fs7.readFileSync(abs_path)
9327
+ data: fs8.readFileSync(abs_path)
9197
9328
  }));
9198
- fs7.writeFileSync(tmp_path, zip_write_sync(entries));
9199
- fs7.renameSync(tmp_path, zip_path);
9329
+ fs8.writeFileSync(tmp_path, zip_write_sync(entries));
9330
+ fs8.renameSync(tmp_path, zip_path);
9200
9331
  } finally {
9201
- if (fs7.existsSync(tmp_path)) {
9202
- fs7.unlinkSync(tmp_path);
9332
+ if (fs8.existsSync(tmp_path)) {
9333
+ fs8.unlinkSync(tmp_path);
9203
9334
  }
9204
9335
  }
9205
9336
  }
9206
9337
  function _write_if_changed(dest_dir, slug, files, force, written) {
9207
9338
  const digest = _manifest_digest(files);
9208
- const zip_path = path6.join(dest_dir, `${slug}.zip`);
9209
- const digest_path = path6.join(dest_dir, `${slug}.sha256`);
9210
- const recorded = fs7.existsSync(digest_path) ? fs7.readFileSync(digest_path, "utf-8").trim() : "";
9211
- if (!force && recorded === digest && fs7.existsSync(zip_path)) {
9339
+ const zip_path = path7.join(dest_dir, `${slug}.zip`);
9340
+ const digest_path = path7.join(dest_dir, `${slug}.sha256`);
9341
+ const recorded = fs8.existsSync(digest_path) ? fs8.readFileSync(digest_path, "utf-8").trim() : "";
9342
+ if (!force && recorded === digest && fs8.existsSync(zip_path)) {
9212
9343
  return;
9213
9344
  }
9214
9345
  _atomic_write_zip(zip_path, files);
9215
- fs7.writeFileSync(digest_path, digest + "\n", "utf-8");
9346
+ fs8.writeFileSync(digest_path, digest + "\n", "utf-8");
9216
9347
  written.push(zip_path);
9217
9348
  }
9218
9349
  function build_skill_bundles(package_root, dest_dir, force = false, curation = null) {
9219
- const skills_root = path6.join(package_root, "dist/agent-src", "skills");
9350
+ const skills_root = path7.join(package_root, "dist/agent-src", "skills");
9220
9351
  if (!_is_dir(skills_root)) {
9221
9352
  return [];
9222
9353
  }
9223
- fs7.mkdirSync(dest_dir, { recursive: true });
9354
+ fs8.mkdirSync(dest_dir, { recursive: true });
9224
9355
  const written = [];
9225
- for (const name of fs7.readdirSync(skills_root).sort()) {
9226
- const entry = path6.join(skills_root, name);
9227
- const isSymlink2 = fs7.lstatSync(entry).isSymbolicLink();
9356
+ for (const name of fs8.readdirSync(skills_root).sort()) {
9357
+ const entry = path7.join(skills_root, name);
9358
+ const isSymlink2 = fs8.lstatSync(entry).isSymbolicLink();
9228
9359
  if (!(_is_dir(entry) || isSymlink2)) {
9229
9360
  continue;
9230
9361
  }
@@ -9232,8 +9363,8 @@ function build_skill_bundles(package_root, dest_dir, force = false, curation = n
9232
9363
  if (curation !== null && !curation.includes(skill_name)) {
9233
9364
  continue;
9234
9365
  }
9235
- const skill_md = path6.join(entry, "SKILL.md");
9236
- if (!fs7.existsSync(skill_md)) {
9366
+ const skill_md = path7.join(entry, "SKILL.md");
9367
+ if (!fs8.existsSync(skill_md)) {
9237
9368
  continue;
9238
9369
  }
9239
9370
  const files = _walk_skill_files(entry);
@@ -9245,15 +9376,15 @@ function build_skill_bundles(package_root, dest_dir, force = false, curation = n
9245
9376
  return written;
9246
9377
  }
9247
9378
  function _command_slug(source_file, commands_root) {
9248
- const rel = path6.relative(commands_root, source_file);
9249
- const noExt = rel.slice(0, rel.length - path6.extname(rel).length);
9250
- return noExt.split(path6.sep).join("-");
9379
+ const rel = path7.relative(commands_root, source_file);
9380
+ const noExt = rel.slice(0, rel.length - path7.extname(rel).length);
9381
+ return noExt.split(path7.sep).join("-");
9251
9382
  }
9252
9383
  function _iter_command_files(commands_root) {
9253
9384
  const found = [];
9254
9385
  const walk = (dir) => {
9255
- for (const dirent of fs7.readdirSync(dir, { withFileTypes: true })) {
9256
- const full = path6.join(dir, dirent.name);
9386
+ for (const dirent of fs8.readdirSync(dir, { withFileTypes: true })) {
9387
+ const full = path7.join(dir, dirent.name);
9257
9388
  if (dirent.isDirectory() || dirent.isSymbolicLink() && _is_dir(full)) {
9258
9389
  walk(full);
9259
9390
  } else if (dirent.name.endsWith(".md")) {
@@ -9263,21 +9394,21 @@ function _iter_command_files(commands_root) {
9263
9394
  };
9264
9395
  walk(commands_root);
9265
9396
  found.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
9266
- return found.filter((source_file) => path6.basename(source_file) !== "AGENTS.md");
9397
+ return found.filter((source_file) => path7.basename(source_file) !== "AGENTS.md");
9267
9398
  }
9268
9399
  function build_command_bundles(package_root, dest_dir, force = false, curation = null) {
9269
- const commands_root = path6.join(package_root, "dist/agent-src", "commands");
9400
+ const commands_root = path7.join(package_root, "dist/agent-src", "commands");
9270
9401
  if (!_is_dir(commands_root)) {
9271
9402
  return [];
9272
9403
  }
9273
- const skills_root = path6.join(package_root, "dist/agent-src", "skills");
9404
+ const skills_root = path7.join(package_root, "dist/agent-src", "skills");
9274
9405
  let skill_names = /* @__PURE__ */ new Set();
9275
9406
  if (_is_dir(skills_root)) {
9276
9407
  skill_names = new Set(
9277
- fs7.readdirSync(skills_root).filter((name) => _is_dir(path6.join(skills_root, name)))
9408
+ fs8.readdirSync(skills_root).filter((name) => _is_dir(path7.join(skills_root, name)))
9278
9409
  );
9279
9410
  }
9280
- fs7.mkdirSync(dest_dir, { recursive: true });
9411
+ fs8.mkdirSync(dest_dir, { recursive: true });
9281
9412
  const written = [];
9282
9413
  for (const source_file of _iter_command_files(commands_root)) {
9283
9414
  const slug = _command_slug(source_file, commands_root);
@@ -9287,7 +9418,7 @@ function build_command_bundles(package_root, dest_dir, force = false, curation =
9287
9418
  if (curation !== null && !curation.includes(slug)) {
9288
9419
  continue;
9289
9420
  }
9290
- const files = [[fs7.realpathSync(source_file), ["SKILL.md"]]];
9421
+ const files = [[fs8.realpathSync(source_file), ["SKILL.md"]]];
9291
9422
  _write_if_changed(dest_dir, slug, files, force, written);
9292
9423
  }
9293
9424
  return written;
@@ -9295,8 +9426,8 @@ function build_command_bundles(package_root, dest_dir, force = false, curation =
9295
9426
 
9296
9427
  // src/scripts/_lib/claude_settings_hooks.ts
9297
9428
  var YAML = __toESM(require_dist(), 1);
9298
- import * as fs8 from "node:fs";
9299
- import * as path7 from "node:path";
9429
+ import * as fs9 from "node:fs";
9430
+ import * as path8 from "node:path";
9300
9431
 
9301
9432
  // src/install/atomic.ts
9302
9433
  import {
@@ -9304,17 +9435,17 @@ import {
9304
9435
  fsyncSync,
9305
9436
  mkdirSync as mkdirSync5,
9306
9437
  openSync as openSync3,
9307
- readFileSync as readFileSync6,
9438
+ readFileSync as readFileSync7,
9308
9439
  renameSync as renameSync5,
9309
9440
  unlinkSync as unlinkSync4,
9310
9441
  writeSync
9311
9442
  } from "node:fs";
9312
- import { dirname as dirname4, join as join7 } from "node:path";
9443
+ import { dirname as dirname4, join as join8 } from "node:path";
9313
9444
  function atomicWriteFile(target, data, options = {}) {
9314
9445
  const mode = options.mode ?? 420;
9315
9446
  const parent = dirname4(target);
9316
9447
  mkdirSync5(parent, { recursive: true });
9317
- const tmp = join7(parent, `.tmp.${process.pid}.${randSuffix()}`);
9448
+ const tmp = join8(parent, `.tmp.${process.pid}.${randSuffix()}`);
9318
9449
  let fd = null;
9319
9450
  try {
9320
9451
  fd = openSync3(tmp, "w", mode);
@@ -9364,7 +9495,7 @@ var SettingsLockError = class extends Error {
9364
9495
  }
9365
9496
  };
9366
9497
  function build_claude_hook_matrix(manifest_path2) {
9367
- const raw = fs8.readFileSync(manifest_path2, "utf8");
9498
+ const raw = fs9.readFileSync(manifest_path2, "utf8");
9368
9499
  const manifest = _yaml_parse(raw) ?? {};
9369
9500
  const hook_spec = manifest["schema_version"] ?? 1;
9370
9501
  const platforms = manifest["platforms"] ?? {};
@@ -9393,8 +9524,8 @@ function _is_managed_group(group) {
9393
9524
  );
9394
9525
  }
9395
9526
  function _read_settings(settings_path) {
9396
- if (!fs8.existsSync(settings_path)) return {};
9397
- const raw = fs8.readFileSync(settings_path, "utf8");
9527
+ if (!fs9.existsSync(settings_path)) return {};
9528
+ const raw = fs9.readFileSync(settings_path, "utf8");
9398
9529
  if (raw.trim() === "") return {};
9399
9530
  let parsed;
9400
9531
  try {
@@ -9409,18 +9540,18 @@ function _read_settings(settings_path) {
9409
9540
  }
9410
9541
  function _with_lock(settings_path, fn) {
9411
9542
  const lockPath = settings_path + ".agent-config.lock";
9412
- fs8.mkdirSync(path7.dirname(lockPath), { recursive: true });
9543
+ fs9.mkdirSync(path8.dirname(lockPath), { recursive: true });
9413
9544
  let fd;
9414
9545
  try {
9415
- fd = fs8.openSync(lockPath, "wx");
9546
+ fd = fs9.openSync(lockPath, "wx");
9416
9547
  } catch {
9417
9548
  throw new SettingsLockError(lockPath);
9418
9549
  }
9419
9550
  try {
9420
9551
  return fn();
9421
9552
  } finally {
9422
- fs8.closeSync(fd);
9423
- fs8.rmSync(lockPath, { force: true });
9553
+ fs9.closeSync(fd);
9554
+ fs9.rmSync(lockPath, { force: true });
9424
9555
  }
9425
9556
  }
9426
9557
  function ensure_managed_hooks(settings_path, matrix) {
@@ -9451,9 +9582,9 @@ function ensure_managed_hooks(settings_path, matrix) {
9451
9582
 
9452
9583
  // src/scripts/_lib/agent_settings.ts
9453
9584
  import { createRequire } from "node:module";
9454
- import * as fs9 from "node:fs";
9455
- import * as os5 from "node:os";
9456
- import * as path8 from "node:path";
9585
+ import * as fs10 from "node:fs";
9586
+ import * as os6 from "node:os";
9587
+ import * as path9 from "node:path";
9457
9588
  var _require = createRequire(import.meta.url);
9458
9589
  var Logger = class {
9459
9590
  name = "scripts._lib.agent_settings";
@@ -9493,10 +9624,10 @@ var DEFAULT_PROJECT_FILE = ".agent-settings.yml";
9493
9624
  var LOCAL_PROJECT_FILE = ".agent-settings.local.yml";
9494
9625
  var LOCAL_PROJECT_SUBDIR = ["agents", "settings"];
9495
9626
  function _local_settings_path(project_root) {
9496
- return path8.join(project_root, ...LOCAL_PROJECT_SUBDIR, LOCAL_PROJECT_FILE);
9627
+ return path9.join(project_root, ...LOCAL_PROJECT_SUBDIR, LOCAL_PROJECT_FILE);
9497
9628
  }
9498
9629
  function _canonical_settings_path(project_root) {
9499
- return path8.join(project_root, ...LOCAL_PROJECT_SUBDIR, DEFAULT_PROJECT_FILE);
9630
+ return path9.join(project_root, ...LOCAL_PROJECT_SUBDIR, DEFAULT_PROJECT_FILE);
9500
9631
  }
9501
9632
  var USER_GLOBAL_FILENAME = "agent-settings.yml";
9502
9633
  function DEFAULT_USER_GLOBAL_FILE() {
@@ -9544,8 +9675,8 @@ var _AGENTS_DIR_MARKERS = [
9544
9675
  var _LEGACY_ANCHOR_ENV = "AGENT_CONFIG_LEGACY_ANCHOR";
9545
9676
  function _exists(p) {
9546
9677
  try {
9547
- fs9.lstatSync(p);
9548
- fs9.statSync(p);
9678
+ fs10.lstatSync(p);
9679
+ fs10.statSync(p);
9549
9680
  return true;
9550
9681
  } catch {
9551
9682
  return false;
@@ -9553,22 +9684,22 @@ function _exists(p) {
9553
9684
  }
9554
9685
  function _is_dir2(p) {
9555
9686
  try {
9556
- return fs9.statSync(p).isDirectory();
9687
+ return fs10.statSync(p).isDirectory();
9557
9688
  } catch {
9558
9689
  return false;
9559
9690
  }
9560
9691
  }
9561
9692
  function _is_file(p) {
9562
9693
  try {
9563
- return fs9.statSync(p).isFile();
9694
+ return fs10.statSync(p).isFile();
9564
9695
  } catch {
9565
9696
  return false;
9566
9697
  }
9567
9698
  }
9568
9699
  function _resolve(p) {
9569
- const absolute = path8.resolve(p);
9700
+ const absolute = path9.resolve(p);
9570
9701
  try {
9571
- return fs9.realpathSync(absolute);
9702
+ return fs10.realpathSync(absolute);
9572
9703
  } catch {
9573
9704
  return absolute;
9574
9705
  }
@@ -9578,7 +9709,7 @@ function _ancestor_chain(start) {
9578
9709
  let cursor = start;
9579
9710
  for (; ; ) {
9580
9711
  chain.push(cursor);
9581
- const parent = path8.dirname(cursor);
9712
+ const parent = path9.dirname(cursor);
9582
9713
  if (parent === cursor) {
9583
9714
  break;
9584
9715
  }
@@ -9587,15 +9718,15 @@ function _ancestor_chain(start) {
9587
9718
  return chain;
9588
9719
  }
9589
9720
  function _boundary_anchor_at(dir) {
9590
- const agents_dir = path8.join(dir, "agents");
9721
+ const agents_dir = path9.join(dir, "agents");
9591
9722
  if (_is_dir2(agents_dir)) {
9592
9723
  for (const marker of _AGENTS_DIR_MARKERS) {
9593
- if (_exists(path8.join(agents_dir, marker))) {
9724
+ if (_exists(path9.join(agents_dir, marker))) {
9594
9725
  return ANCHOR_AGENTS_DIR;
9595
9726
  }
9596
9727
  }
9597
9728
  }
9598
- if (_exists(path8.join(dir, ".git"))) {
9729
+ if (_exists(path9.join(dir, ".git"))) {
9599
9730
  return ANCHOR_GIT;
9600
9731
  }
9601
9732
  return null;
@@ -9606,7 +9737,7 @@ function find_project_root_with_anchor(start) {
9606
9737
  const chain = _ancestor_chain(current);
9607
9738
  if (legacy) {
9608
9739
  for (const candidate of chain) {
9609
- if (_exists(path8.join(candidate, ".git"))) {
9740
+ if (_exists(path9.join(candidate, ".git"))) {
9610
9741
  return [candidate, ANCHOR_GIT];
9611
9742
  }
9612
9743
  }
@@ -9620,7 +9751,7 @@ function find_project_root_with_anchor(start) {
9620
9751
  }
9621
9752
  let outermost = null;
9622
9753
  for (const candidate of chain) {
9623
- if (_exists(path8.join(candidate, DEFAULT_PROJECT_FILE))) {
9754
+ if (_exists(path9.join(candidate, DEFAULT_PROJECT_FILE))) {
9624
9755
  outermost = candidate;
9625
9756
  }
9626
9757
  }
@@ -9661,10 +9792,10 @@ function _validate_root_path(p, origin_label) {
9661
9792
  }
9662
9793
  function _expanduser(p) {
9663
9794
  if (p === "~") {
9664
- return os5.homedir();
9795
+ return os6.homedir();
9665
9796
  }
9666
9797
  if (p.startsWith("~/") || process.platform === "win32" && p.startsWith("~\\")) {
9667
- return path8.join(os5.homedir(), p.slice(2));
9798
+ return path9.join(os6.homedir(), p.slice(2));
9668
9799
  }
9669
9800
  return p;
9670
9801
  }
@@ -9693,13 +9824,13 @@ function resolve_project_root(arg, options = {}) {
9693
9824
  function _resolve_cascade_paths(cwd, project_path) {
9694
9825
  if (cwd === null) {
9695
9826
  const legacy = project_path ? project_path : DEFAULT_PROJECT_FILE;
9696
- const parent = path8.dirname(legacy);
9827
+ const parent = path9.dirname(legacy);
9697
9828
  return [legacy, _canonical_settings_path(parent), _local_settings_path(parent)];
9698
9829
  }
9699
9830
  const root = find_project_root(cwd);
9700
9831
  if (root === null) {
9701
9832
  const legacy = project_path ? project_path : DEFAULT_PROJECT_FILE;
9702
- const parent = path8.dirname(legacy);
9833
+ const parent = path9.dirname(legacy);
9703
9834
  return [legacy, _canonical_settings_path(parent), _local_settings_path(parent)];
9704
9835
  }
9705
9836
  const cwd_resolved = _resolve(cwd);
@@ -9710,7 +9841,7 @@ function _resolve_cascade_paths(cwd, project_path) {
9710
9841
  if (cursor === root) {
9711
9842
  break;
9712
9843
  }
9713
- const parent = path8.dirname(cursor);
9844
+ const parent = path9.dirname(cursor);
9714
9845
  if (parent === cursor) {
9715
9846
  break;
9716
9847
  }
@@ -9718,7 +9849,7 @@ function _resolve_cascade_paths(cwd, project_path) {
9718
9849
  }
9719
9850
  chain.reverse();
9720
9851
  return [
9721
- ...chain.map((d) => path8.join(d, DEFAULT_PROJECT_FILE)),
9852
+ ...chain.map((d) => path9.join(d, DEFAULT_PROJECT_FILE)),
9722
9853
  _canonical_settings_path(root),
9723
9854
  _local_settings_path(root)
9724
9855
  ];
@@ -9759,7 +9890,7 @@ function _read_yaml(p) {
9759
9890
  }
9760
9891
  let data;
9761
9892
  try {
9762
- const text = fs9.readFileSync(p, "utf-8");
9893
+ const text = fs10.readFileSync(p, "utf-8");
9763
9894
  data = YAML2.parse(text, { version: "1.1" });
9764
9895
  if (data === null || data === void 0) {
9765
9896
  data = {};
@@ -10398,8 +10529,8 @@ function getErrorMap() {
10398
10529
 
10399
10530
  // node_modules/zod/v3/helpers/parseUtil.js
10400
10531
  var makeIssue = (params) => {
10401
- const { data, path: path12, errorMaps, issueData } = params;
10402
- const fullPath = [...path12, ...issueData.path || []];
10532
+ const { data, path: path13, errorMaps, issueData } = params;
10533
+ const fullPath = [...path13, ...issueData.path || []];
10403
10534
  const fullIssue = {
10404
10535
  ...issueData,
10405
10536
  path: fullPath
@@ -10515,11 +10646,11 @@ var errorUtil;
10515
10646
 
10516
10647
  // node_modules/zod/v3/types.js
10517
10648
  var ParseInputLazyPath = class {
10518
- constructor(parent, value, path12, key) {
10649
+ constructor(parent, value, path13, key) {
10519
10650
  this._cachedPath = [];
10520
10651
  this.parent = parent;
10521
10652
  this.data = value;
10522
- this._path = path12;
10653
+ this._path = path13;
10523
10654
  this._key = key;
10524
10655
  }
10525
10656
  get path() {
@@ -14045,11 +14176,14 @@ var settingsSchema = external_exports.object({
14045
14176
  "After the agent edits a file, run `<ide> <path>` to surface it in your editor immediately. Off by default to avoid window-stealing during long agent runs."
14046
14177
  ),
14047
14178
  rtk_installed: external_exports.boolean().default(false).describe(
14048
- "Does this machine have rtk (Rust Token Killer, https://github.com/event4u-app/rtk) on PATH? When true the agent wraps verbose CLI output (git, tests, linters, docker, npm, composer) with rtk for ~60-90% token savings. Leave false if rtk is missing \u2014 the agent falls back to tail / grep."
14179
+ "Does this machine have rtk (Rust Token Killer, a third-party Apache-2.0 tool: https://github.com/rtk-ai/rtk) on PATH \u2014 verified as the real Token Killer, not the unrelated Rust Type Kit that shares the binary name? When true the agent wraps verbose CLI output (git, tests, linters, docker, npm, composer) with rtk (upstream reports 60-90% token savings \u2014 their estimate). Leave false if rtk is missing \u2014 the agent falls back to tail / grep. The wizard overwrites this from a live two-stage probe (PATH presence + `rtk gain` identity check)."
14049
14180
  ),
14050
14181
  minimal_output: external_exports.boolean().default(true).describe(
14051
14182
  "Prefer short bullets and tables (true, default) vs verbose prose with rationale (false). Affects every chat reply; flip to false during debugging when you want the agent to think out loud."
14052
14183
  ),
14184
+ canary_name: external_exports.string().default("").describe(
14185
+ 'Session canary \u2014 the name the agent addresses you with at the start of every new task (e.g. "Alex"). When the greeting silently disappears, the context window is degrading: start a fresh conversation. Also keeps the reply-close markers (end-summary, PR URL as literal last line) alive. Empty = off. See rules/session-canary.md.'
14186
+ ),
14053
14187
  play_by_play: external_exports.boolean().default(false).describe(
14054
14188
  `Narrate intermediate findings between tool calls ("Found it.", "Let me check Y."). Off by default \u2014 most users find it noisy. Turn on when you want to follow the agent's reasoning step by step.`
14055
14189
  ),
@@ -14157,6 +14291,17 @@ var settingsSchema = external_exports.object({
14157
14291
  "Consumed by the cross-source-consistency rule. When the agent works from multiple sources (ticket text, an attached image/mockup, the spec, the codebase) it checks them against each other and asks before proceeding on a discrepancy \u2014 instead of silently guessing. on (default) = surface every real cross-source contradiction / silent-scope-expansion as one question; auto = surface only high-confidence contradictions, state low-confidence as an assumption; off = no cross-source checking."
14158
14292
  )
14159
14293
  }).default({ cross_source: "on" }),
14294
+ screenshots: external_exports.object({
14295
+ identity_allowlist: external_exports.array(external_exports.string()).default([]).describe(
14296
+ "Consumed by the doc-screenshot-hygiene rule and screenshot-hygiene skill. Public identity tokens SAFE to show unredacted in a documentation screenshot \u2014 the maintainer's own public handles plus well-known fake-data tokens. Not a general fake-data dictionary and not identity-resolution: everything not listed is treated as sensitive by default, and a public handle co-located with a real name does not whitelist the real name. Default [] = nothing auto-allowed."
14297
+ ),
14298
+ forbid_terminal_capture: external_exports.boolean().default(true).describe(
14299
+ "Consumed by the doc-screenshot-hygiene rule. true (default) = terminal/CLI/IDE screenshots are forbidden (highest leak vector: absolute local paths, env tokens); use text code blocks with text redaction instead. false = allowed, still subject to the data-bearing human gate."
14300
+ ),
14301
+ data_bearing_gate: external_exports.enum(["on", "off"]).default("on").describe(
14302
+ "Consumed by the doc-screenshot-hygiene rule. on (default) = a data-bearing screenshot embed is gated behind this-turn human confirmation; uncertain/unresolved regions redact-or-refuse, never ship-and-hope; illustrative/no-data screenshots may embed with a stated justification. off = no data-bearing gate (the anonymization taxonomy still applies)."
14303
+ )
14304
+ }).default({ identity_allowlist: [], forbid_terminal_capture: true, data_bearing_gate: "on" }),
14160
14305
  tokens: external_exports.object({
14161
14306
  rich_skills: richSkillsMode.default("on").describe(
14162
14307
  "Whether skills marked token_budget_class: rich may load in full (exempt from telegraph-speak + thin-projector trimming), consumed by the token-budget-discipline rule. on = allowed (default); off = fall back to standard condensed behavior; ask = surface an estimated token delta (tokens, not dollars) and ask once per session before loading."
@@ -14329,6 +14474,9 @@ var settingsSchema = external_exports.object({
14329
14474
  ),
14330
14475
  session_index: external_exports.enum(["on", "off"]).default("off").describe(
14331
14476
  "Opt-in compact memory index at session start (road-to-memory-retrieval-economy P5). on = inject a compact id + title + ~tokens index of curated entries (hard cap 30 rows, bodies never included) through the hot-context hook; the agent fetches full entries via memory_get on demand. off (default) = no injection \u2014 the ship-criterion (measured hit-rate gain) is unproven, so off unless proven."
14477
+ ),
14478
+ learn_on_session_end: external_exports.boolean().default(false).describe(
14479
+ "session_end learning-sidecar aggregation (road-to-reachable-code-memory P4). true = the session_end hook aggregates agents/memory/intake/*.jsonl through the learning sidecar into the gitignored .agent-learning.json + LESSONS.md (local-only, 2 s budget, fail-open; promotion stays human via /memory:propose). false (default, council 2026-07-27) = no-op; the flip is proposed only after the 30-day dogfood shows non-trivial signal AND session-end p95 < 2 s."
14332
14480
  )
14333
14481
  }),
14334
14482
  knowledge: external_exports.object({
@@ -14379,13 +14527,18 @@ var settingsSchema = external_exports.object({
14379
14527
  }).default({}),
14380
14528
  rtk_wrap: external_exports.object({
14381
14529
  enabled: external_exports.boolean().default(false).describe(
14382
- 'PreToolUse RTK-wrap nudge (token-saving Phase 3). Default off. When on AND rtk is on PATH (a live probe \u2014 not a self-reported flag), warns (never blocks) "re-run wrapped with rtk" before a single verbose CLI command (git/npm/cargo/docker/\u2026) for 60\u201390% token saving. Skips completeness-critical / piped / compound commands and git diff. No-op when rtk is absent.'
14530
+ 'PreToolUse RTK-wrap nudge (token-saving Phase 3). Default off. When on AND the binary on PATH is verified as Rust Token Killer (a live two-stage identity probe \u2014 not a self-reported flag, and never a colliding same-name binary), warns (never blocks) "re-run wrapped with rtk" before a single verbose CLI command (git/npm/cargo/docker/\u2026) \u2014 upstream reports 60\u201390% output-token savings (their estimate). Skips completeness-critical / piped / compound commands and git diff. No-op when rtk is absent, unverified, or a different tool.'
14383
14531
  )
14384
14532
  }).default({}),
14385
14533
  design_slop: external_exports.object({
14386
14534
  enabled: external_exports.boolean().default(false).describe(
14387
14535
  "PreToolUse anti-slop nudge (road-to-anti-slop-detector Phase 3). Default off. When on, runs the lint_design_slop registry against about-to-be-written UI content and WARNS (never blocks) on P0/P1 aesthetic tells (side-stripe, gradient-text, magic z-index, \u2026). Flags are rebuttable via DESIGN.md / design-slop-disable. Anti-loop: a file::rule signature surfaced 3x goes silent. Host-limited convenience layer; the universal gate is the lint_design_slop linter/CI."
14388
14536
  )
14537
+ }).default({}),
14538
+ code_graph: external_exports.object({
14539
+ enabled: external_exports.boolean().default(false).describe(
14540
+ "PreToolUse code-graph nudge (ADR-124 Phase 4). Default off. When on AND a native code-graph cache or a consumer-shipped graph.json/SCIP index is present, warns once per session (never blocks) as the agent is about to Grep/Glob or Read a source file \u2014 query the graph first for who-calls/where-used/impact questions (or rebuild if stale, build if absent). Source G\u2019s strict block-first-read mode is deliberately un-ported."
14541
+ )
14389
14542
  }).default({})
14390
14543
  }),
14391
14544
  decision_engine: external_exports.object({
@@ -15719,8 +15872,8 @@ var zodToJsonSchema = (schema, options) => {
15719
15872
  };
15720
15873
 
15721
15874
  // src/scripts/_lib/module_detection.ts
15722
- import * as fs10 from "node:fs";
15723
- import * as path9 from "node:path";
15875
+ import * as fs11 from "node:fs";
15876
+ import * as path10 from "node:path";
15724
15877
  var _SKIP_DIRS = /* @__PURE__ */ new Set([".module-template", ".example"]);
15725
15878
  var _RULES = [
15726
15879
  ["app/Modules", "laravel-hmvc", "App\\Modules\\{ModuleName}"],
@@ -15734,14 +15887,14 @@ var _RULES = [
15734
15887
  ];
15735
15888
  function _isDir(p) {
15736
15889
  try {
15737
- return fs10.statSync(p).isDirectory();
15890
+ return fs11.statSync(p).isDirectory();
15738
15891
  } catch {
15739
15892
  return false;
15740
15893
  }
15741
15894
  }
15742
15895
  function _isFile(p) {
15743
15896
  try {
15744
- return fs10.statSync(p).isFile();
15897
+ return fs11.statSync(p).isFile();
15745
15898
  } catch {
15746
15899
  return false;
15747
15900
  }
@@ -15755,13 +15908,13 @@ function _isUpperChar(ch) {
15755
15908
  function _list_module_subdirs(root) {
15756
15909
  let entries;
15757
15910
  try {
15758
- entries = fs10.readdirSync(root).sort();
15911
+ entries = fs11.readdirSync(root).sort();
15759
15912
  } catch {
15760
15913
  return [];
15761
15914
  }
15762
15915
  const out = [];
15763
15916
  for (const name of entries) {
15764
- if (!_isDir(path9.join(root, name))) {
15917
+ if (!_isDir(path10.join(root, name))) {
15765
15918
  continue;
15766
15919
  }
15767
15920
  if (name.startsWith(".")) {
@@ -15783,11 +15936,11 @@ function _score_confidence(stack, root, subdirs) {
15783
15936
  return capitalized.length > 0 ? "high" : "medium";
15784
15937
  }
15785
15938
  if (stack === "node-monorepo") {
15786
- const withPkgJson = subdirs.filter((name) => _isFile(path9.join(root, name, "package.json")));
15939
+ const withPkgJson = subdirs.filter((name) => _isFile(path10.join(root, name, "package.json")));
15787
15940
  return withPkgJson.length > 0 ? "high" : "medium";
15788
15941
  }
15789
15942
  if (stack === "python-src") {
15790
- const withInit = subdirs.filter((name) => _isFile(path9.join(root, name, "__init__.py")));
15943
+ const withInit = subdirs.filter((name) => _isFile(path10.join(root, name, "__init__.py")));
15791
15944
  return withInit.length > 0 ? "high" : "medium";
15792
15945
  }
15793
15946
  if (stack === "go-internal") {
@@ -15799,7 +15952,7 @@ function detect_module_roots(project_root) {
15799
15952
  const high = [];
15800
15953
  const medium = [];
15801
15954
  for (const [rel_path, stack, namespace_template] of _RULES) {
15802
- const abs_path = path9.join(project_root, rel_path);
15955
+ const abs_path = path10.join(project_root, rel_path);
15803
15956
  if (!_isDir(abs_path)) {
15804
15957
  continue;
15805
15958
  }
@@ -15821,7 +15974,7 @@ function detect_module_roots(project_root) {
15821
15974
  }
15822
15975
 
15823
15976
  // src/scripts/_lib/model_tier.ts
15824
- import fs11 from "node:fs";
15977
+ import fs12 from "node:fs";
15825
15978
  var TIER_TO_CLAUDE_MODEL = {
15826
15979
  high: "opus",
15827
15980
  medium: "sonnet",
@@ -15829,8 +15982,8 @@ var TIER_TO_CLAUDE_MODEL = {
15829
15982
  };
15830
15983
  var MODEL_TIER_RE = /^model_tier:\s*"?([a-z]+)"?\s*$/m;
15831
15984
  function read_model_tier(skill_md) {
15832
- if (!fs11.existsSync(skill_md)) return null;
15833
- const text = fs11.readFileSync(skill_md).toString("utf-8");
15985
+ if (!fs12.existsSync(skill_md)) return null;
15986
+ const text = fs12.readFileSync(skill_md).toString("utf-8");
15834
15987
  if (!text.startsWith("---\n")) return null;
15835
15988
  const end = text.indexOf("\n---\n", 4);
15836
15989
  if (end === -1) return null;
@@ -15847,8 +16000,8 @@ function render_native_model_md(text, tier) {
15847
16000
 
15848
16001
  // src/scripts/_cli/cmd_migrate.ts
15849
16002
  import { spawnSync } from "node:child_process";
15850
- import * as fs12 from "node:fs";
15851
- import * as path10 from "node:path";
16003
+ import * as fs13 from "node:fs";
16004
+ import * as path11 from "node:path";
15852
16005
  import process2 from "node:process";
15853
16006
  import { fileURLToPath as fileURLToPath2, pathToFileURL } from "node:url";
15854
16007
  var PACKAGE_NAME_NPM = "@event4u/agent-config";
@@ -15868,7 +16021,7 @@ var LEGACY_SETTINGS_FILES = [".agent-settings.yml", ".agent-user.yml"];
15868
16021
  var LEGACY_STATE_FILENAME = ".implement-ticket-state.json";
15869
16022
  var LEGACY_STATE_V1_FILENAME = ".work-state.json";
15870
16023
  var LEGACY_AGENT_CONFIG_SHELL = "agent-config";
15871
- var _HERE_DIR = path10.dirname(fileURLToPath2(import.meta.url));
16024
+ var _HERE_DIR = path11.dirname(fileURLToPath2(import.meta.url));
15872
16025
  var ArgparseExit = class extends Error {
15873
16026
  code;
15874
16027
  constructor(code) {
@@ -15967,38 +16120,38 @@ function _jsonDumpsIndentAscii(value, indent) {
15967
16120
  }
15968
16121
  function _isFile2(p) {
15969
16122
  try {
15970
- return fs12.statSync(p).isFile();
16123
+ return fs13.statSync(p).isFile();
15971
16124
  } catch {
15972
16125
  return false;
15973
16126
  }
15974
16127
  }
15975
16128
  function _isDir2(p) {
15976
16129
  try {
15977
- return fs12.statSync(p).isDirectory();
16130
+ return fs13.statSync(p).isDirectory();
15978
16131
  } catch {
15979
16132
  return false;
15980
16133
  }
15981
16134
  }
15982
16135
  function _isSymlink(p) {
15983
16136
  try {
15984
- return fs12.lstatSync(p).isSymbolicLink();
16137
+ return fs13.lstatSync(p).isSymbolicLink();
15985
16138
  } catch {
15986
16139
  return false;
15987
16140
  }
15988
16141
  }
15989
16142
  function _exists2(p) {
15990
16143
  try {
15991
- fs12.lstatSync(p);
16144
+ fs13.lstatSync(p);
15992
16145
  return true;
15993
16146
  } catch {
15994
16147
  return false;
15995
16148
  }
15996
16149
  }
15997
16150
  function _readText(p) {
15998
- return fs12.readFileSync(p, { encoding: "utf-8" });
16151
+ return fs13.readFileSync(p, { encoding: "utf-8" });
15999
16152
  }
16000
16153
  function _writeText(p, text) {
16001
- fs12.writeFileSync(p, text, { encoding: "utf-8" });
16154
+ fs13.writeFileSync(p, text, { encoding: "utf-8" });
16002
16155
  }
16003
16156
  function _jsonLoadFile(p) {
16004
16157
  return JSON.parse(_readText(p));
@@ -16054,7 +16207,7 @@ function _classify_symlink(link) {
16054
16207
  }
16055
16208
  let target;
16056
16209
  try {
16057
- target = fs12.readlinkSync(link);
16210
+ target = fs13.readlinkSync(link);
16058
16211
  } catch {
16059
16212
  return null;
16060
16213
  }
@@ -16065,16 +16218,16 @@ function _classify_symlink(link) {
16065
16218
  return "user";
16066
16219
  }
16067
16220
  function _detect_legacy_state(project) {
16068
- return _isFile2(path10.join(project, LEGACY_STATE_FILENAME));
16221
+ return _isFile2(path11.join(project, LEGACY_STATE_FILENAME));
16069
16222
  }
16070
16223
  function _detect_legacy_settings(project) {
16071
16224
  const found = [];
16072
16225
  for (const name of LEGACY_SETTINGS_FILES) {
16073
- const flat = path10.join(project, name);
16226
+ const flat = path11.join(project, name);
16074
16227
  if (_isFile2(flat)) {
16075
16228
  found.push(flat);
16076
16229
  }
16077
- const typed = path10.join(project, "settings", name);
16230
+ const typed = path11.join(project, "settings", name);
16078
16231
  if (_isFile2(typed)) {
16079
16232
  found.push(typed);
16080
16233
  }
@@ -16082,25 +16235,25 @@ function _detect_legacy_settings(project) {
16082
16235
  return found;
16083
16236
  }
16084
16237
  function _detect_empty_shell(project) {
16085
- const shell = path10.join(project, LEGACY_AGENT_CONFIG_SHELL);
16238
+ const shell = path11.join(project, LEGACY_AGENT_CONFIG_SHELL);
16086
16239
  if (!_isDir2(shell) || _isSymlink(shell)) {
16087
16240
  return false;
16088
16241
  }
16089
16242
  try {
16090
- return fs12.readdirSync(shell).length === 0;
16243
+ return fs13.readdirSync(shell).length === 0;
16091
16244
  } catch {
16092
16245
  return false;
16093
16246
  }
16094
16247
  }
16095
16248
  function _detect_already_migrated(project) {
16096
- if (_detect_npm(path10.join(project, "package.json"))) {
16249
+ if (_detect_npm(path11.join(project, "package.json"))) {
16097
16250
  return false;
16098
16251
  }
16099
- if (_detect_composer(path10.join(project, "composer.json"))) {
16252
+ if (_detect_composer(path11.join(project, "composer.json"))) {
16100
16253
  return false;
16101
16254
  }
16102
16255
  for (const name of MANAGED_SYMLINKS) {
16103
- if (_classify_symlink(path10.join(project, name)) === "legacy") {
16256
+ if (_classify_symlink(path11.join(project, name)) === "legacy") {
16104
16257
  return false;
16105
16258
  }
16106
16259
  }
@@ -16171,11 +16324,11 @@ function _purge_legacy_symlinks(project) {
16171
16324
  const removed = [];
16172
16325
  const preserved = [];
16173
16326
  for (const name of MANAGED_SYMLINKS) {
16174
- const link = path10.join(project, name);
16327
+ const link = path11.join(project, name);
16175
16328
  const kind = _classify_symlink(link);
16176
16329
  if (kind === "legacy") {
16177
16330
  try {
16178
- fs12.unlinkSync(link);
16331
+ fs13.unlinkSync(link);
16179
16332
  removed.push(name);
16180
16333
  } catch {
16181
16334
  preserved.push(name);
@@ -16187,14 +16340,14 @@ function _purge_legacy_symlinks(project) {
16187
16340
  return [removed, preserved];
16188
16341
  }
16189
16342
  function _migrate_state_file(project) {
16190
- const source = path10.join(project, LEGACY_STATE_FILENAME);
16343
+ const source = path11.join(project, LEGACY_STATE_FILENAME);
16191
16344
  if (!_isFile2(source)) {
16192
16345
  return null;
16193
16346
  }
16194
- const target = path10.join(project, LEGACY_STATE_V1_FILENAME);
16347
+ const target = path11.join(project, LEGACY_STATE_V1_FILENAME);
16195
16348
  if (_exists2(target)) {
16196
16349
  try {
16197
- fs12.unlinkSync(source);
16350
+ fs13.unlinkSync(source);
16198
16351
  return `removed stale ${LEGACY_STATE_FILENAME} (v1 already present)`;
16199
16352
  } catch {
16200
16353
  return null;
@@ -16208,8 +16361,8 @@ function _migrate_state_file(project) {
16208
16361
  return `migrated ${LEGACY_STATE_FILENAME} \u2192 ${LEGACY_STATE_V1_FILENAME}`;
16209
16362
  }
16210
16363
  function _load_state_migrator() {
16211
- const pkg_root = path10.resolve(_HERE_DIR, "..", "..", "..");
16212
- const rel = path10.join(
16364
+ const pkg_root = path11.resolve(_HERE_DIR, "..", "..", "..");
16365
+ const rel = path11.join(
16213
16366
  "agent-src",
16214
16367
  "templates",
16215
16368
  "scripts",
@@ -16217,8 +16370,8 @@ function _load_state_migrator() {
16217
16370
  "migration",
16218
16371
  "v0_to_v1.ts"
16219
16372
  );
16220
- const driver = [path10.join(pkg_root, "dist", rel), path10.join(pkg_root, "src", rel)].find(
16221
- (p) => fs12.existsSync(p)
16373
+ const driver = [path11.join(pkg_root, "dist", rel), path11.join(pkg_root, "src", rel)].find(
16374
+ (p) => fs13.existsSync(p)
16222
16375
  ) ?? null;
16223
16376
  if (driver === null) {
16224
16377
  return null;
@@ -16226,12 +16379,12 @@ function _load_state_migrator() {
16226
16379
  const binName = process2.platform === "win32" ? "tsx.cmd" : "tsx";
16227
16380
  let tsxBin = null;
16228
16381
  for (let dir = pkg_root; ; ) {
16229
- const cand = path10.join(dir, "node_modules", ".bin", binName);
16230
- if (fs12.existsSync(cand)) {
16382
+ const cand = path11.join(dir, "node_modules", ".bin", binName);
16383
+ if (fs13.existsSync(cand)) {
16231
16384
  tsxBin = cand;
16232
16385
  break;
16233
16386
  }
16234
- const parent = path10.dirname(dir);
16387
+ const parent = path11.dirname(dir);
16235
16388
  if (parent === dir) break;
16236
16389
  dir = parent;
16237
16390
  }
@@ -16258,17 +16411,17 @@ function _delete_legacy_settings(project) {
16258
16411
  const removed = [];
16259
16412
  for (const p of _detect_legacy_settings(project)) {
16260
16413
  try {
16261
- fs12.unlinkSync(p);
16262
- removed.push(path10.relative(project, p));
16414
+ fs13.unlinkSync(p);
16415
+ removed.push(path11.relative(project, p));
16263
16416
  } catch {
16264
16417
  continue;
16265
16418
  }
16266
16419
  }
16267
- const settings_dir = path10.join(project, "settings");
16420
+ const settings_dir = path11.join(project, "settings");
16268
16421
  if (_isDir2(settings_dir) && !_isSymlink(settings_dir)) {
16269
16422
  try {
16270
- if (fs12.readdirSync(settings_dir).length === 0) {
16271
- fs12.rmdirSync(settings_dir);
16423
+ if (fs13.readdirSync(settings_dir).length === 0) {
16424
+ fs13.rmdirSync(settings_dir);
16272
16425
  removed.push("settings/");
16273
16426
  }
16274
16427
  } catch {
@@ -16277,12 +16430,12 @@ function _delete_legacy_settings(project) {
16277
16430
  return removed;
16278
16431
  }
16279
16432
  function _remove_empty_shell(project) {
16280
- const shell = path10.join(project, LEGACY_AGENT_CONFIG_SHELL);
16433
+ const shell = path11.join(project, LEGACY_AGENT_CONFIG_SHELL);
16281
16434
  if (!_detect_empty_shell(project)) {
16282
16435
  return false;
16283
16436
  }
16284
16437
  try {
16285
- fs12.rmdirSync(shell);
16438
+ fs13.rmdirSync(shell);
16286
16439
  } catch {
16287
16440
  return false;
16288
16441
  }
@@ -16292,7 +16445,7 @@ function _reEscape(s) {
16292
16445
  return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
16293
16446
  }
16294
16447
  function _update_gitignore(project) {
16295
- const gitignore = path10.join(project, ".gitignore");
16448
+ const gitignore = path11.join(project, ".gitignore");
16296
16449
  const block = `${GITIGNORE_BLOCK_START}
16297
16450
  ${GITIGNORE_NEW_BODY}${GITIGNORE_BLOCK_END}
16298
16451
  `;
@@ -16323,16 +16476,16 @@ ${GITIGNORE_NEW_BODY}${GITIGNORE_BLOCK_END}
16323
16476
  }
16324
16477
  function _build_plan(project) {
16325
16478
  return {
16326
- npm: _detect_npm(path10.join(project, "package.json")),
16327
- composer: _detect_composer(path10.join(project, "composer.json")),
16479
+ npm: _detect_npm(path11.join(project, "package.json")),
16480
+ composer: _detect_composer(path11.join(project, "composer.json")),
16328
16481
  symlinks_legacy: MANAGED_SYMLINKS.filter(
16329
- (name) => _classify_symlink(path10.join(project, name)) === "legacy"
16482
+ (name) => _classify_symlink(path11.join(project, name)) === "legacy"
16330
16483
  ),
16331
16484
  symlinks_user: MANAGED_SYMLINKS.filter(
16332
- (name) => _classify_symlink(path10.join(project, name)) === "user"
16485
+ (name) => _classify_symlink(path11.join(project, name)) === "user"
16333
16486
  ),
16334
- state_file: _isFile2(path10.join(project, LEGACY_STATE_FILENAME)),
16335
- settings_files: _detect_legacy_settings(project).map((p) => path10.relative(project, p)),
16487
+ state_file: _isFile2(path11.join(project, LEGACY_STATE_FILENAME)),
16488
+ settings_files: _detect_legacy_settings(project).map((p) => path11.relative(project, p)),
16336
16489
  empty_shell: _detect_empty_shell(project)
16337
16490
  };
16338
16491
  }
@@ -16396,10 +16549,10 @@ function _warn_on_major_mismatch(from_major, plan, out) {
16396
16549
  }
16397
16550
  function _apply(project, out, err) {
16398
16551
  const summary = [];
16399
- if (_strip_npm_entry(path10.join(project, "package.json"))) {
16552
+ if (_strip_npm_entry(path11.join(project, "package.json"))) {
16400
16553
  summary.push(`removed ${PACKAGE_NAME_NPM} from package.json`);
16401
16554
  }
16402
- if (_strip_composer_entry(path10.join(project, "composer.json"))) {
16555
+ if (_strip_composer_entry(path11.join(project, "composer.json"))) {
16403
16556
  summary.push(`removed ${PACKAGE_NAME_COMPOSER} from composer.json`);
16404
16557
  }
16405
16558
  const [removed_links, preserved_links] = _purge_legacy_symlinks(project);
@@ -16525,13 +16678,13 @@ function _isCliEntry() {
16525
16678
  if (process2.argv[1] === void 0) {
16526
16679
  return false;
16527
16680
  }
16528
- const argvUrl = pathToFileURL(path10.resolve(process2.argv[1])).href;
16681
+ const argvUrl = pathToFileURL(path11.resolve(process2.argv[1])).href;
16529
16682
  if (import.meta.url === argvUrl) {
16530
16683
  return true;
16531
16684
  }
16532
16685
  try {
16533
- const here = fs12.realpathSync(fileURLToPath2(import.meta.url));
16534
- const argv = fs12.realpathSync(path10.resolve(process2.argv[1]));
16686
+ const here = fs13.realpathSync(fileURLToPath2(import.meta.url));
16687
+ const argv = fs13.realpathSync(path11.resolve(process2.argv[1]));
16535
16688
  return here === argv;
16536
16689
  } catch {
16537
16690
  return false;
@@ -16565,37 +16718,37 @@ var ArgparseExit2 = class extends Error {
16565
16718
  }
16566
16719
  code;
16567
16720
  };
16568
- function expanduser5(p) {
16569
- if (p === "~") return os6.homedir();
16721
+ function expanduser6(p) {
16722
+ if (p === "~") return os7.homedir();
16570
16723
  if (p.startsWith("~/") || p.startsWith("~\\")) {
16571
- return path11.join(os6.homedir(), p.slice(2));
16724
+ return path12.join(os7.homedir(), p.slice(2));
16572
16725
  }
16573
16726
  return p;
16574
16727
  }
16575
16728
  function resolvePath(p) {
16576
16729
  try {
16577
- return fs13.realpathSync(path11.resolve(p));
16730
+ return fs14.realpathSync(path12.resolve(p));
16578
16731
  } catch {
16579
- return path11.resolve(p);
16732
+ return path12.resolve(p);
16580
16733
  }
16581
16734
  }
16582
16735
  function isFile(p) {
16583
16736
  try {
16584
- return fs13.statSync(p).isFile();
16737
+ return fs14.statSync(p).isFile();
16585
16738
  } catch {
16586
16739
  return false;
16587
16740
  }
16588
16741
  }
16589
16742
  function isDir(p) {
16590
16743
  try {
16591
- return fs13.statSync(p).isDirectory();
16744
+ return fs14.statSync(p).isDirectory();
16592
16745
  } catch {
16593
16746
  return false;
16594
16747
  }
16595
16748
  }
16596
16749
  function pathExists(p) {
16597
16750
  try {
16598
- fs13.statSync(p);
16751
+ fs14.statSync(p);
16599
16752
  return true;
16600
16753
  } catch {
16601
16754
  return false;
@@ -16603,24 +16756,24 @@ function pathExists(p) {
16603
16756
  }
16604
16757
  function isSymlink(p) {
16605
16758
  try {
16606
- return fs13.lstatSync(p).isSymbolicLink();
16759
+ return fs14.lstatSync(p).isSymbolicLink();
16607
16760
  } catch {
16608
16761
  return false;
16609
16762
  }
16610
16763
  }
16611
16764
  function readText(p) {
16612
- return fs13.readFileSync(p, "utf-8");
16765
+ return fs14.readFileSync(p, "utf-8");
16613
16766
  }
16614
16767
  function writeText(p, content) {
16615
- fs13.writeFileSync(p, content, "utf-8");
16768
+ fs14.writeFileSync(p, content, "utf-8");
16616
16769
  }
16617
16770
  function mkdirp(p) {
16618
- fs13.mkdirSync(p, { recursive: true });
16771
+ fs14.mkdirSync(p, { recursive: true });
16619
16772
  }
16620
16773
  function sortedGlobStems(directory, suffix) {
16621
16774
  let entries;
16622
16775
  try {
16623
- entries = fs13.readdirSync(directory);
16776
+ entries = fs14.readdirSync(directory);
16624
16777
  } catch {
16625
16778
  return [];
16626
16779
  }
@@ -16640,7 +16793,7 @@ function sortedGlobStems(directory, suffix) {
16640
16793
  function countZips(directory) {
16641
16794
  if (!isDir(directory)) return 0;
16642
16795
  let n = 0;
16643
- for (const name of fs13.readdirSync(directory)) {
16796
+ for (const name of fs14.readdirSync(directory)) {
16644
16797
  if (name.endsWith(".zip")) n += 1;
16645
16798
  }
16646
16799
  return n;
@@ -16648,35 +16801,35 @@ function countZips(directory) {
16648
16801
  function sha256OfFile(p) {
16649
16802
  let data;
16650
16803
  try {
16651
- data = fs13.readFileSync(p);
16804
+ data = fs14.readFileSync(p);
16652
16805
  } catch {
16653
16806
  return null;
16654
16807
  }
16655
- return crypto2.createHash("sha256").update(data).digest("hex");
16808
+ return crypto3.createHash("sha256").update(data).digest("hex");
16656
16809
  }
16657
16810
  function atomicWrite0644(target, body, prefix) {
16658
- const dir = path11.dirname(target);
16659
- const tmpName = path11.join(
16811
+ const dir = path12.dirname(target);
16812
+ const tmpName = path12.join(
16660
16813
  dir,
16661
- `${prefix}${process3.pid}.${crypto2.randomBytes(6).toString("hex")}.yml.tmp`
16814
+ `${prefix}${process3.pid}.${crypto3.randomBytes(6).toString("hex")}.yml.tmp`
16662
16815
  );
16663
16816
  let fd = null;
16664
16817
  try {
16665
- fd = fs13.openSync(tmpName, "wx", 420);
16666
- fs13.writeFileSync(fd, body, "utf-8");
16667
- fs13.closeSync(fd);
16818
+ fd = fs14.openSync(tmpName, "wx", 420);
16819
+ fs14.writeFileSync(fd, body, "utf-8");
16820
+ fs14.closeSync(fd);
16668
16821
  fd = null;
16669
- fs13.chmodSync(tmpName, 420);
16670
- fs13.renameSync(tmpName, target);
16822
+ fs14.chmodSync(tmpName, 420);
16823
+ fs14.renameSync(tmpName, target);
16671
16824
  } catch (err) {
16672
16825
  if (fd !== null) {
16673
16826
  try {
16674
- fs13.closeSync(fd);
16827
+ fs14.closeSync(fd);
16675
16828
  } catch {
16676
16829
  }
16677
16830
  }
16678
16831
  try {
16679
- fs13.unlinkSync(tmpName);
16832
+ fs14.unlinkSync(tmpName);
16680
16833
  } catch {
16681
16834
  }
16682
16835
  throw err;
@@ -16776,6 +16929,20 @@ function jsonDumpsCompact(value) {
16776
16929
  }
16777
16930
  return _jsonStrNoAscii(String(value));
16778
16931
  }
16932
+ function yamlSafeLoad(text) {
16933
+ let YAML2;
16934
+ try {
16935
+ YAML2 = require_dist();
16936
+ } catch {
16937
+ return null;
16938
+ }
16939
+ try {
16940
+ const data = YAML2.parse(text, { version: "1.1" });
16941
+ return data;
16942
+ } catch {
16943
+ return void 0;
16944
+ }
16945
+ }
16779
16946
  var DEFAULT_PROFILE = "balanced";
16780
16947
  var SUPPORTED_PROFILES = ["minimal", "balanced", "full"];
16781
16948
  var RULE_LOADING_TIER_PLACEHOLDER = "__RULE_LOADING_TIER__";
@@ -16786,12 +16953,12 @@ var LEGACY_SETTINGS_FILE = ".agent-settings";
16786
16953
  var LEGACY_BACKUP_FILE = ".agent-settings.backup.key-value";
16787
16954
  var SETTINGS_SUBDIR = ["agents", "settings"];
16788
16955
  function _canonical_settings_target(project_root) {
16789
- return path11.join(project_root, ...SETTINGS_SUBDIR, SETTINGS_FILE);
16956
+ return path12.join(project_root, ...SETTINGS_SUBDIR, SETTINGS_FILE);
16790
16957
  }
16791
16958
  function _resolve_settings_read(project_root) {
16792
16959
  const canonical = _canonical_settings_target(project_root);
16793
16960
  if (pathExists(canonical)) return canonical;
16794
- const legacy = path11.join(project_root, SETTINGS_FILE);
16961
+ const legacy = path12.join(project_root, SETTINGS_FILE);
16795
16962
  if (pathExists(legacy)) return legacy;
16796
16963
  return canonical;
16797
16964
  }
@@ -16855,9 +17022,9 @@ function fail(msg) {
16855
17022
  throw new SystemExitError(1);
16856
17023
  }
16857
17024
  function detect_package_root(project_root) {
16858
- const npm_path = path11.join(project_root, "node_modules", "@event4u", "agent-config");
17025
+ const npm_path = path12.join(project_root, "node_modules", "@event4u", "agent-config");
16859
17026
  if (isDir(npm_path)) return resolvePath(npm_path);
16860
- if (pathExists(path11.join(project_root, "src", "config", "profiles", "minimal.ini"))) {
17027
+ if (pathExists(path12.join(project_root, "src", "config", "profiles", "minimal.ini"))) {
16861
17028
  return project_root;
16862
17029
  }
16863
17030
  fail(
@@ -16865,12 +17032,12 @@ function detect_package_root(project_root) {
16865
17032
  );
16866
17033
  }
16867
17034
  function detect_package_type(package_root) {
16868
- if (package_root.split(path11.sep).includes("node_modules")) return "npm";
17035
+ if (package_root.split(path12.sep).includes("node_modules")) return "npm";
16869
17036
  return "local";
16870
17037
  }
16871
17038
  function detect_package_type_for_project(project_root, package_root) {
16872
17039
  const npm_path = resolvePath(
16873
- path11.join(project_root, "node_modules", "@event4u", "agent-config")
17040
+ path12.join(project_root, "node_modules", "@event4u", "agent-config")
16874
17041
  );
16875
17042
  const package_resolved = resolvePath(package_root);
16876
17043
  if (package_resolved === npm_path) return "npm";
@@ -16890,7 +17057,7 @@ function ensure_directory(p) {
16890
17057
  mkdirp(p);
16891
17058
  }
16892
17059
  function write_file(p, content) {
16893
- ensure_directory(path11.dirname(p));
17060
+ ensure_directory(path12.dirname(p));
16894
17061
  writeText(p, content);
16895
17062
  }
16896
17063
  function read_json_file(p) {
@@ -17061,7 +17228,7 @@ function _append_unknown_legacy(rendered, legacy_values, unknown_keys) {
17061
17228
  return rendered + "\n" + suffix;
17062
17229
  }
17063
17230
  function _migrate_legacy_if_present(project_root, template_body) {
17064
- const legacy_target = path11.join(project_root, LEGACY_SETTINGS_FILE);
17231
+ const legacy_target = path12.join(project_root, LEGACY_SETTINGS_FILE);
17065
17232
  if (!isFile(legacy_target)) return null;
17066
17233
  const legacy_text = readText(legacy_target);
17067
17234
  const [values, unknown] = _parse_legacy_settings(legacy_text);
@@ -17076,9 +17243,9 @@ function _migrate_legacy_if_present(project_root, template_body) {
17076
17243
  }
17077
17244
  }
17078
17245
  rendered = _append_unknown_legacy(rendered, values, unknown);
17079
- const backup_target = path11.join(project_root, LEGACY_BACKUP_FILE);
17246
+ const backup_target = path12.join(project_root, LEGACY_BACKUP_FILE);
17080
17247
  writeText(backup_target, legacy_text);
17081
- fs13.unlinkSync(legacy_target);
17248
+ fs14.unlinkSync(legacy_target);
17082
17249
  info(`Migrated legacy ${LEGACY_SETTINGS_FILE} \u2192 ${SETTINGS_FILE}`);
17083
17250
  info(`Backup saved to ${LEGACY_BACKUP_FILE}`);
17084
17251
  if (unknown.length > 0) {
@@ -17113,7 +17280,7 @@ function _render_template(template, profile_values) {
17113
17280
  return body;
17114
17281
  }
17115
17282
  function _load_valid_user_types(package_root) {
17116
- const directory = path11.join(package_root, USER_TYPES_DIR);
17283
+ const directory = path12.join(package_root, USER_TYPES_DIR);
17117
17284
  if (!isDir(directory)) return [];
17118
17285
  return sortedGlobStems(directory, ".yml");
17119
17286
  }
@@ -17170,8 +17337,8 @@ function splitlinesKeepends(text) {
17170
17337
  }
17171
17338
  function ensure_agent_settings(project_root, package_root, profile, force, user_type = "", packs = null) {
17172
17339
  const target = _canonical_settings_target(project_root);
17173
- const profile_source = path11.join(package_root, "src", "config", "profiles", `${profile}.ini`);
17174
- const template_source = path11.join(package_root, "src", "config", "agent-settings.template.yml");
17340
+ const profile_source = path12.join(package_root, "src", "config", "profiles", `${profile}.ini`);
17341
+ const template_source = path12.join(package_root, "src", "config", "agent-settings.template.yml");
17175
17342
  if (!pathExists(profile_source)) fail(`Missing profile preset: ${profile_source}`);
17176
17343
  if (!pathExists(template_source)) fail(`Missing settings template: ${template_source}`);
17177
17344
  const template = readText(template_source);
@@ -17185,21 +17352,21 @@ function ensure_agent_settings(project_root, package_root, profile, force, user_
17185
17352
  if (profile_values["rule_loading_tier"] !== profile) {
17186
17353
  const got = "rule_loading_tier" in profile_values ? `'${profile_values["rule_loading_tier"]}'` : "None";
17187
17354
  fail(
17188
- `Profile preset ${path11.basename(profile_source)} has rule_loading_tier=${got} but --profile=${profile}`
17355
+ `Profile preset ${path12.basename(profile_source)} has rule_loading_tier=${got} but --profile=${profile}`
17189
17356
  );
17190
17357
  }
17191
17358
  profile_values["user_type"] = _validate_user_type(package_root, user_type);
17192
17359
  let template_body = _render_template(template, profile_values);
17193
17360
  template_body = _inject_packs(template_body, packs ?? []);
17194
- const legacy_root = path11.join(project_root, SETTINGS_FILE);
17361
+ const legacy_root = path12.join(project_root, SETTINGS_FILE);
17195
17362
  if (isFile(legacy_root) && !pathExists(target)) {
17196
- mkdirp(path11.dirname(target));
17363
+ mkdirp(path12.dirname(target));
17197
17364
  writeText(target, readText(legacy_root));
17198
- fs13.unlinkSync(legacy_root);
17365
+ fs14.unlinkSync(legacy_root);
17199
17366
  success(`Migrated ${SETTINGS_FILE} \u2192 agents/settings/${SETTINGS_FILE} (ADR-038)`);
17200
17367
  return;
17201
17368
  }
17202
- const legacy_target = path11.join(project_root, LEGACY_SETTINGS_FILE);
17369
+ const legacy_target = path12.join(project_root, LEGACY_SETTINGS_FILE);
17203
17370
  if (isFile(legacy_target) && pathExists(target)) {
17204
17371
  warn(
17205
17372
  `Both ${SETTINGS_FILE} and legacy ${LEGACY_SETTINGS_FILE} exist. Skipping migration to avoid overwriting ${SETTINGS_FILE}. Delete one of them manually and re-run.`
@@ -17216,7 +17383,7 @@ function ensure_agent_settings(project_root, package_root, profile, force, user_
17216
17383
  skip(`${SETTINGS_FILE} already exists`);
17217
17384
  return;
17218
17385
  }
17219
- mkdirp(path11.dirname(target));
17386
+ mkdirp(path12.dirname(target));
17220
17387
  write_file(target, template_body);
17221
17388
  const user_type_value = profile_values["user_type"] ?? "";
17222
17389
  const suffix = user_type_value ? `, user_type=${user_type_value}` : "";
@@ -17229,7 +17396,7 @@ function ensure_vscode_bridge(project_root, package_type, force) {
17229
17396
  const plugin_path = plugin_paths[package_type] ?? "./plugin/agent-config";
17230
17397
  const bridge = { "chat.pluginLocations": { [plugin_path]: true } };
17231
17398
  merge_json_file(
17232
- path11.join(project_root, ".vscode", "settings.json"),
17399
+ path12.join(project_root, ".vscode", "settings.json"),
17233
17400
  bridge,
17234
17401
  force,
17235
17402
  ".vscode/settings.json"
@@ -17238,14 +17405,14 @@ function ensure_vscode_bridge(project_root, package_type, force) {
17238
17405
  function ensure_augment_bridge(project_root, force) {
17239
17406
  const bridge = { enabledPlugins: { "agent-config@event4u": true } };
17240
17407
  return merge_json_file(
17241
- path11.join(project_root, ".augment", "settings.json"),
17408
+ path12.join(project_root, ".augment", "settings.json"),
17242
17409
  bridge,
17243
17410
  force,
17244
17411
  ".augment/settings.json"
17245
17412
  );
17246
17413
  }
17247
- var AUGMENT_USER_DIR = path11.join(os6.homedir(), ".augment");
17248
- var AUGMENT_USER_HOOKS_DIR = path11.join(AUGMENT_USER_DIR, "hooks");
17414
+ var AUGMENT_USER_DIR = path12.join(os7.homedir(), ".augment");
17415
+ var AUGMENT_USER_HOOKS_DIR = path12.join(AUGMENT_USER_DIR, "hooks");
17249
17416
  var AUGMENT_DISPATCHER_TRAMPOLINE = "augment-dispatcher.sh";
17250
17417
  var AUGMENT_LEGACY_TRAMPOLINES = [
17251
17418
  "augment-chat-history.sh",
@@ -17261,29 +17428,29 @@ var AUGMENT_DISPATCHER_BINDINGS = [
17261
17428
  ["post_tool_use", "PostToolUse"]
17262
17429
  ];
17263
17430
  function _deploy_augment_trampoline(package_root, name, force) {
17264
- const src = path11.join(package_root, "scripts", "hooks", name);
17431
+ const src = path12.join(package_root, "scripts", "hooks", name);
17265
17432
  if (!pathExists(src)) {
17266
17433
  skip(`augment trampoline missing in package: ${src}`);
17267
17434
  return null;
17268
17435
  }
17269
17436
  mkdirp(AUGMENT_USER_HOOKS_DIR);
17270
- const dst = path11.join(AUGMENT_USER_HOOKS_DIR, name);
17437
+ const dst = path12.join(AUGMENT_USER_HOOKS_DIR, name);
17271
17438
  const src_text = readText(src);
17272
17439
  if (pathExists(dst) && readText(dst) === src_text && !force) {
17273
17440
  skip(`~/.augment/hooks/${name} already up to date`);
17274
17441
  } else {
17275
17442
  writeText(dst, src_text);
17276
- fs13.chmodSync(dst, 493);
17443
+ fs14.chmodSync(dst, 493);
17277
17444
  success(`~/.augment/hooks/${name} installed`);
17278
17445
  }
17279
17446
  return dst;
17280
17447
  }
17281
17448
  function _remove_legacy_augment_trampolines() {
17282
17449
  for (const name of AUGMENT_LEGACY_TRAMPOLINES) {
17283
- const legacy = path11.join(AUGMENT_USER_HOOKS_DIR, name);
17450
+ const legacy = path12.join(AUGMENT_USER_HOOKS_DIR, name);
17284
17451
  try {
17285
17452
  if (isFile(legacy)) {
17286
- fs13.unlinkSync(legacy);
17453
+ fs14.unlinkSync(legacy);
17287
17454
  skip(`removed legacy ~/.augment/hooks/${name}`);
17288
17455
  }
17289
17456
  } catch {
@@ -17302,7 +17469,7 @@ function ensure_augment_user_hooks(package_root, force) {
17302
17469
  }
17303
17470
  const settings_patch = { hooks: per_event };
17304
17471
  return merge_json_file(
17305
- path11.join(AUGMENT_USER_DIR, "settings.json"),
17472
+ path12.join(AUGMENT_USER_DIR, "settings.json"),
17306
17473
  settings_patch,
17307
17474
  force,
17308
17475
  "~/.augment/settings.json"
@@ -17327,7 +17494,7 @@ function _heal_legacy_claude_plugin_ids(p) {
17327
17494
  return removed;
17328
17495
  }
17329
17496
  function ensure_claude_bridge(project_root, force) {
17330
- const target = path11.join(project_root, ".claude", "settings.json");
17497
+ const target = path12.join(project_root, ".claude", "settings.json");
17331
17498
  const healed = _heal_legacy_claude_plugin_ids(target);
17332
17499
  for (const pid of healed) {
17333
17500
  success(`.claude/settings.json: removed stale plugin id \`${pid}\``);
@@ -17352,29 +17519,29 @@ function ensure_cursor_bridge(project_root, force) {
17352
17519
  }
17353
17520
  const bridge = { version: 1, hooks };
17354
17521
  return merge_json_file(
17355
- path11.join(project_root, ".cursor", "hooks.json"),
17522
+ path12.join(project_root, ".cursor", "hooks.json"),
17356
17523
  bridge,
17357
17524
  force,
17358
17525
  ".cursor/hooks.json"
17359
17526
  );
17360
17527
  }
17361
- var CURSOR_USER_DIR = path11.join(os6.homedir(), ".cursor");
17362
- var CURSOR_USER_HOOKS_DIR = path11.join(CURSOR_USER_DIR, "hooks");
17528
+ var CURSOR_USER_DIR = path12.join(os7.homedir(), ".cursor");
17529
+ var CURSOR_USER_HOOKS_DIR = path12.join(CURSOR_USER_DIR, "hooks");
17363
17530
  var CURSOR_DISPATCHER_TRAMPOLINE = "cursor-dispatcher.sh";
17364
17531
  function ensure_cursor_user_hooks(package_root, force) {
17365
- const src = path11.join(package_root, "scripts", "hooks", CURSOR_DISPATCHER_TRAMPOLINE);
17532
+ const src = path12.join(package_root, "scripts", "hooks", CURSOR_DISPATCHER_TRAMPOLINE);
17366
17533
  if (!pathExists(src)) {
17367
17534
  skip(`cursor trampoline missing in package: ${src}`);
17368
17535
  return [];
17369
17536
  }
17370
17537
  mkdirp(CURSOR_USER_HOOKS_DIR);
17371
- const dst = path11.join(CURSOR_USER_HOOKS_DIR, CURSOR_DISPATCHER_TRAMPOLINE);
17538
+ const dst = path12.join(CURSOR_USER_HOOKS_DIR, CURSOR_DISPATCHER_TRAMPOLINE);
17372
17539
  const src_text = readText(src);
17373
17540
  if (pathExists(dst) && readText(dst) === src_text && !force) {
17374
17541
  skip(`~/.cursor/hooks/${CURSOR_DISPATCHER_TRAMPOLINE} already up to date`);
17375
17542
  } else {
17376
17543
  writeText(dst, src_text);
17377
- fs13.chmodSync(dst, 493);
17544
+ fs14.chmodSync(dst, 493);
17378
17545
  success(`~/.cursor/hooks/${CURSOR_DISPATCHER_TRAMPOLINE} installed`);
17379
17546
  }
17380
17547
  const hooks = {};
@@ -17383,7 +17550,7 @@ function ensure_cursor_user_hooks(package_root, force) {
17383
17550
  }
17384
17551
  const settings_patch = { version: 1, hooks };
17385
17552
  return merge_json_file(
17386
- path11.join(CURSOR_USER_DIR, "hooks.json"),
17553
+ path12.join(CURSOR_USER_DIR, "hooks.json"),
17387
17554
  settings_patch,
17388
17555
  force,
17389
17556
  "~/.cursor/hooks.json"
@@ -17426,12 +17593,12 @@ exit 0
17426
17593
  `;
17427
17594
  }
17428
17595
  function ensure_cline_bridge(project_root, force) {
17429
- const hooks_dir = path11.join(project_root, ".clinerules", "hooks");
17596
+ const hooks_dir = path12.join(project_root, ".clinerules", "hooks");
17430
17597
  mkdirp(hooks_dir);
17431
17598
  const workspace_quoted = shlexQuote(resolvePath(project_root));
17432
17599
  let written = 0;
17433
17600
  for (const [ac_event, native_event] of CLINE_DISPATCHER_BINDINGS) {
17434
- const target = path11.join(hooks_dir, native_event);
17601
+ const target = path12.join(hooks_dir, native_event);
17435
17602
  const body = clineProjectHookBody(native_event, ac_event, workspace_quoted);
17436
17603
  if (pathExists(target) && readText(target) === body && !force) {
17437
17604
  continue;
@@ -17441,7 +17608,7 @@ function ensure_cline_bridge(project_root, force) {
17441
17608
  continue;
17442
17609
  }
17443
17610
  writeText(target, body);
17444
- fs13.chmodSync(target, 493);
17611
+ fs14.chmodSync(target, 493);
17445
17612
  written += 1;
17446
17613
  }
17447
17614
  if (written) {
@@ -17450,27 +17617,27 @@ function ensure_cline_bridge(project_root, force) {
17450
17617
  skip(".clinerules/hooks/ already up to date");
17451
17618
  }
17452
17619
  }
17453
- var CLINE_USER_DIR = path11.join(os6.homedir(), "Documents", "Cline", "Hooks");
17620
+ var CLINE_USER_DIR = path12.join(os7.homedir(), "Documents", "Cline", "Hooks");
17454
17621
  var CLINE_DISPATCHER_TRAMPOLINE = "cline-dispatcher.sh";
17455
17622
  function ensure_cline_user_hooks(package_root, force) {
17456
- const src = path11.join(package_root, "scripts", "hooks", CLINE_DISPATCHER_TRAMPOLINE);
17623
+ const src = path12.join(package_root, "scripts", "hooks", CLINE_DISPATCHER_TRAMPOLINE);
17457
17624
  if (!pathExists(src)) {
17458
17625
  skip(`cline trampoline missing in package: ${src}`);
17459
17626
  return;
17460
17627
  }
17461
17628
  mkdirp(CLINE_USER_DIR);
17462
- const trampoline = path11.join(CLINE_USER_DIR, CLINE_DISPATCHER_TRAMPOLINE);
17629
+ const trampoline = path12.join(CLINE_USER_DIR, CLINE_DISPATCHER_TRAMPOLINE);
17463
17630
  const src_text = readText(src);
17464
17631
  if (pathExists(trampoline) && readText(trampoline) === src_text && !force) {
17465
17632
  skip(`~/Documents/Cline/Hooks/${CLINE_DISPATCHER_TRAMPOLINE} already up to date`);
17466
17633
  } else {
17467
17634
  writeText(trampoline, src_text);
17468
- fs13.chmodSync(trampoline, 493);
17635
+ fs14.chmodSync(trampoline, 493);
17469
17636
  success(`~/Documents/Cline/Hooks/${CLINE_DISPATCHER_TRAMPOLINE} installed`);
17470
17637
  }
17471
17638
  const trampoline_quoted = shlexQuote(trampoline);
17472
17639
  for (const [ac_event, native_event] of CLINE_DISPATCHER_BINDINGS) {
17473
- const wrapper = path11.join(CLINE_USER_DIR, native_event);
17640
+ const wrapper = path12.join(CLINE_USER_DIR, native_event);
17474
17641
  const body = `#!/usr/bin/env bash
17475
17642
  # Generated by event4u/agent-config install.py \u2014 DO NOT EDIT.
17476
17643
  # User-scope Cline hook for ${native_event} \u2192 agent-config ${ac_event}.
@@ -17480,7 +17647,7 @@ exec ${trampoline_quoted} ${ac_event} ${native_event}
17480
17647
  continue;
17481
17648
  }
17482
17649
  writeText(wrapper, body);
17483
- fs13.chmodSync(wrapper, 493);
17650
+ fs14.chmodSync(wrapper, 493);
17484
17651
  }
17485
17652
  }
17486
17653
  var WINDSURF_DISPATCHER_BINDINGS = [
@@ -17501,29 +17668,29 @@ function ensure_windsurf_bridge(project_root, force) {
17501
17668
  }
17502
17669
  const bridge = { hooks };
17503
17670
  return merge_json_file(
17504
- path11.join(project_root, ".windsurf", "hooks.json"),
17671
+ path12.join(project_root, ".windsurf", "hooks.json"),
17505
17672
  bridge,
17506
17673
  force,
17507
17674
  ".windsurf/hooks.json"
17508
17675
  );
17509
17676
  }
17510
- var WINDSURF_USER_DIR = path11.join(os6.homedir(), ".codeium", "windsurf");
17511
- var WINDSURF_USER_HOOKS_DIR = path11.join(WINDSURF_USER_DIR, "hooks");
17677
+ var WINDSURF_USER_DIR = path12.join(os7.homedir(), ".codeium", "windsurf");
17678
+ var WINDSURF_USER_HOOKS_DIR = path12.join(WINDSURF_USER_DIR, "hooks");
17512
17679
  var WINDSURF_DISPATCHER_TRAMPOLINE = "windsurf-dispatcher.sh";
17513
17680
  function ensure_windsurf_user_hooks(package_root, force) {
17514
- const src = path11.join(package_root, "scripts", "hooks", WINDSURF_DISPATCHER_TRAMPOLINE);
17681
+ const src = path12.join(package_root, "scripts", "hooks", WINDSURF_DISPATCHER_TRAMPOLINE);
17515
17682
  if (!pathExists(src)) {
17516
17683
  skip(`windsurf trampoline missing in package: ${src}`);
17517
17684
  return [];
17518
17685
  }
17519
17686
  mkdirp(WINDSURF_USER_HOOKS_DIR);
17520
- const dst = path11.join(WINDSURF_USER_HOOKS_DIR, WINDSURF_DISPATCHER_TRAMPOLINE);
17687
+ const dst = path12.join(WINDSURF_USER_HOOKS_DIR, WINDSURF_DISPATCHER_TRAMPOLINE);
17521
17688
  const src_text = readText(src);
17522
17689
  if (pathExists(dst) && readText(dst) === src_text && !force) {
17523
17690
  skip(`~/.codeium/windsurf/hooks/${WINDSURF_DISPATCHER_TRAMPOLINE} already up to date`);
17524
17691
  } else {
17525
17692
  writeText(dst, src_text);
17526
- fs13.chmodSync(dst, 493);
17693
+ fs14.chmodSync(dst, 493);
17527
17694
  success(`~/.codeium/windsurf/hooks/${WINDSURF_DISPATCHER_TRAMPOLINE} installed`);
17528
17695
  }
17529
17696
  const hooks = {};
@@ -17535,7 +17702,7 @@ function ensure_windsurf_user_hooks(package_root, force) {
17535
17702
  }
17536
17703
  const settings_patch = { hooks };
17537
17704
  return merge_json_file(
17538
- path11.join(WINDSURF_USER_DIR, "hooks.json"),
17705
+ path12.join(WINDSURF_USER_DIR, "hooks.json"),
17539
17706
  settings_patch,
17540
17707
  force,
17541
17708
  "~/.codeium/windsurf/hooks.json"
@@ -17564,43 +17731,43 @@ function _gemini_hooks_dict(command_factory) {
17564
17731
  function ensure_gemini_bridge(project_root, force) {
17565
17732
  const bridge = { hooks: _gemini_hooks_dict(_gemini_dispatch_command) };
17566
17733
  return merge_json_file(
17567
- path11.join(project_root, ".gemini", "settings.json"),
17734
+ path12.join(project_root, ".gemini", "settings.json"),
17568
17735
  bridge,
17569
17736
  force,
17570
17737
  ".gemini/settings.json"
17571
17738
  );
17572
17739
  }
17573
- var GEMINI_USER_DIR = path11.join(os6.homedir(), ".gemini");
17574
- var GEMINI_USER_HOOKS_DIR = path11.join(GEMINI_USER_DIR, "hooks");
17740
+ var GEMINI_USER_DIR = path12.join(os7.homedir(), ".gemini");
17741
+ var GEMINI_USER_HOOKS_DIR = path12.join(GEMINI_USER_DIR, "hooks");
17575
17742
  var GEMINI_DISPATCHER_TRAMPOLINE = "gemini-dispatcher.sh";
17576
17743
  function ensure_gemini_user_hooks(package_root, force) {
17577
- const src = path11.join(package_root, "scripts", "hooks", GEMINI_DISPATCHER_TRAMPOLINE);
17744
+ const src = path12.join(package_root, "scripts", "hooks", GEMINI_DISPATCHER_TRAMPOLINE);
17578
17745
  if (!pathExists(src)) {
17579
17746
  skip(`gemini trampoline missing in package: ${src}`);
17580
17747
  return [];
17581
17748
  }
17582
17749
  mkdirp(GEMINI_USER_HOOKS_DIR);
17583
- const dst = path11.join(GEMINI_USER_HOOKS_DIR, GEMINI_DISPATCHER_TRAMPOLINE);
17750
+ const dst = path12.join(GEMINI_USER_HOOKS_DIR, GEMINI_DISPATCHER_TRAMPOLINE);
17584
17751
  const src_text = readText(src);
17585
17752
  if (pathExists(dst) && readText(dst) === src_text && !force) {
17586
17753
  skip(`~/.gemini/hooks/${GEMINI_DISPATCHER_TRAMPOLINE} already up to date`);
17587
17754
  } else {
17588
17755
  writeText(dst, src_text);
17589
- fs13.chmodSync(dst, 493);
17756
+ fs14.chmodSync(dst, 493);
17590
17757
  success(`~/.gemini/hooks/${GEMINI_DISPATCHER_TRAMPOLINE} installed`);
17591
17758
  }
17592
17759
  const settings_patch = {
17593
17760
  hooks: _gemini_hooks_dict((ac_event, native) => `${dst} ${ac_event} ${native}`)
17594
17761
  };
17595
17762
  return merge_json_file(
17596
- path11.join(GEMINI_USER_DIR, "settings.json"),
17763
+ path12.join(GEMINI_USER_DIR, "settings.json"),
17597
17764
  settings_patch,
17598
17765
  force,
17599
17766
  "~/.gemini/settings.json"
17600
17767
  );
17601
17768
  }
17602
17769
  function ensure_copilot_bridge(project_root, force) {
17603
- const target = path11.join(project_root, ".github", "plugin", "marketplace.json");
17770
+ const target = path12.join(project_root, ".github", "plugin", "marketplace.json");
17604
17771
  const bridge = {
17605
17772
  marketplace: {
17606
17773
  name: "event4u-agent-marketplace",
@@ -17643,7 +17810,7 @@ See \`docs/setup/per-ide/roocode.md\` for the full activation guide.
17643
17810
  Run \`./agent-config --help\` for available commands.
17644
17811
  `;
17645
17812
  function ensure_roocode_bridge(project_root, force) {
17646
- const target = path11.join(project_root, ".roo", "rules", "agent-config.md");
17813
+ const target = path12.join(project_root, ".roo", "rules", "agent-config.md");
17647
17814
  if (pathExists(target) && !force) {
17648
17815
  skip(".roo/rules/agent-config.md already exists");
17649
17816
  return;
@@ -17665,7 +17832,7 @@ To wire Claude Desktop to this project's rules, run:
17665
17832
  Canonical rule and skill source: \`.augment/\` (see \`AGENTS.md\`).
17666
17833
  `;
17667
17834
  function ensure_claude_desktop_bridge(project_root, force) {
17668
- const target = path11.join(project_root, ".claude-desktop", "agent-config.md");
17835
+ const target = path12.join(project_root, ".claude-desktop", "agent-config.md");
17669
17836
  if (pathExists(target) && !force) {
17670
17837
  skip(".claude-desktop/agent-config.md already exists");
17671
17838
  return;
@@ -17690,7 +17857,7 @@ Or pass \`--read .aider/agent-config.md\` on the command line.
17690
17857
  Canonical rule and skill source: \`.augment/\` (see \`AGENTS.md\`).
17691
17858
  `;
17692
17859
  function ensure_aider_bridge(project_root, force) {
17693
- const target = path11.join(project_root, ".aider", "agent-config.md");
17860
+ const target = path12.join(project_root, ".aider", "agent-config.md");
17694
17861
  if (pathExists(target) && !force) {
17695
17862
  skip(".aider/agent-config.md already exists");
17696
17863
  return;
@@ -17709,7 +17876,7 @@ developers where the rules and skills live.
17709
17876
  Canonical rule and skill source: \`.augment/\` (see project \`AGENTS.md\`).
17710
17877
  `;
17711
17878
  function ensure_codex_bridge(project_root, force) {
17712
- const target = path11.join(project_root, ".codex", "agent-config.md");
17879
+ const target = path12.join(project_root, ".codex", "agent-config.md");
17713
17880
  if (pathExists(target) && !force) {
17714
17881
  skip(".codex/agent-config.md already exists");
17715
17882
  return;
@@ -17727,7 +17894,7 @@ rules per session. The canonical rule and skill source lives under
17727
17894
  orientation).
17728
17895
  `;
17729
17896
  function ensure_continue_bridge(project_root, force) {
17730
- const target = path11.join(project_root, ".continue", "rules", "agent-config.md");
17897
+ const target = path12.join(project_root, ".continue", "rules", "agent-config.md");
17731
17898
  if (pathExists(target) && !force) {
17732
17899
  skip(".continue/rules/agent-config.md already exists");
17733
17900
  return;
@@ -17758,7 +17925,7 @@ orientation).
17758
17925
  See \`docs/setup/per-ide/kilocode.md\` for the full activation guide.
17759
17926
  `;
17760
17927
  function ensure_kilocode_bridge(project_root, force) {
17761
- const target = path11.join(project_root, ".kilocode", "rules", "agent-config.md");
17928
+ const target = path12.join(project_root, ".kilocode", "rules", "agent-config.md");
17762
17929
  if (pathExists(target) && !force) {
17763
17930
  skip(".kilocode/rules/agent-config.md already exists");
17764
17931
  return;
@@ -17785,7 +17952,7 @@ canonical source (or symlink it):
17785
17952
  Canonical rule and skill source: \`.augment/\` (see \`AGENTS.md\`).
17786
17953
  `;
17787
17954
  function ensure_zed_bridge(project_root, force) {
17788
- const target = path11.join(project_root, ".zed", "agent-config.md");
17955
+ const target = path12.join(project_root, ".zed", "agent-config.md");
17789
17956
  if (pathExists(target) && !force) {
17790
17957
  skip(".zed/agent-config.md already exists");
17791
17958
  return;
@@ -17806,7 +17973,7 @@ rules into your JetBrains profile.
17806
17973
  Canonical rule and skill source: \`.augment/\` (see \`AGENTS.md\`).
17807
17974
  `;
17808
17975
  function ensure_jetbrains_bridge(project_root, force) {
17809
- const target = path11.join(project_root, ".jetbrains", "agent-config.md");
17976
+ const target = path12.join(project_root, ".jetbrains", "agent-config.md");
17810
17977
  if (pathExists(target) && !force) {
17811
17978
  skip(".jetbrains/agent-config.md already exists");
17812
17979
  return;
@@ -17837,7 +18004,7 @@ session. The canonical rule and skill source lives under \`.augment/\`
17837
18004
  See \`docs/setup/per-ide/kiro.md\` for the full activation guide.
17838
18005
  `;
17839
18006
  function ensure_kiro_bridge(project_root, force) {
17840
- const target = path11.join(project_root, ".kiro", "steering", "agent-config.md");
18007
+ const target = path12.join(project_root, ".kiro", "steering", "agent-config.md");
17841
18008
  if (pathExists(target) && !force) {
17842
18009
  skip(".kiro/steering/agent-config.md already exists");
17843
18010
  return;
@@ -17863,35 +18030,35 @@ var SMOKE_BRIDGE_PATHS = {
17863
18030
  };
17864
18031
  function dirHasEntries(p) {
17865
18032
  try {
17866
- return fs13.readdirSync(p).length > 0;
18033
+ return fs14.readdirSync(p).length > 0;
17867
18034
  } catch {
17868
18035
  return false;
17869
18036
  }
17870
18037
  }
17871
18038
  function _resolve_tsx_invocation(scriptPath, scriptArgs) {
17872
18039
  const binName = process3.platform === "win32" ? "tsx.cmd" : "tsx";
17873
- let dir = path11.dirname(scriptPath);
18040
+ let dir = path12.dirname(scriptPath);
17874
18041
  for (; ; ) {
17875
- const candidate = path11.join(dir, "node_modules", ".bin", binName);
18042
+ const candidate = path12.join(dir, "node_modules", ".bin", binName);
17876
18043
  if (isFile(candidate)) {
17877
18044
  return { command: candidate, args: [scriptPath, ...scriptArgs] };
17878
18045
  }
17879
- const parent = path11.dirname(dir);
18046
+ const parent = path12.dirname(dir);
17880
18047
  if (parent === dir) break;
17881
18048
  dir = parent;
17882
18049
  }
17883
18050
  return { command: "npx", args: ["tsx", scriptPath, ...scriptArgs] };
17884
18051
  }
17885
18052
  function _smoke_test_hooks(project_root, package_root) {
17886
- const dispatcher = path11.join(package_root, "scripts", "hooks", "dispatch_hook.ts");
17887
- const manifest = path11.join(package_root, "scripts", "hook_manifest.yaml");
18053
+ const dispatcher = path12.join(package_root, "scripts", "hooks", "dispatch_hook.ts");
18054
+ const manifest = path12.join(package_root, "scripts", "hook_manifest.yaml");
17888
18055
  if (!isFile(dispatcher) || !isFile(manifest)) return 0;
17889
18056
  const failed = [];
17890
18057
  const skipped = [];
17891
18058
  const passed = [];
17892
18059
  for (const [platform, native] of SMOKE_PROBE_EVENTS) {
17893
18060
  const rel_bridge = SMOKE_BRIDGE_PATHS[platform] ?? "";
17894
- const bridge_path = rel_bridge ? path11.join(project_root, rel_bridge) : null;
18061
+ const bridge_path = rel_bridge ? path12.join(project_root, rel_bridge) : null;
17895
18062
  const bridge_present = Boolean(
17896
18063
  bridge_path && (isFile(bridge_path) || isDir(bridge_path) && dirHasEntries(bridge_path))
17897
18064
  );
@@ -18091,9 +18258,9 @@ To remove this marker, delete this file.
18091
18258
  `;
18092
18259
  }
18093
18260
  var _CLAUDE_DESKTOP_BUNDLES_SUBPATH = "claude-desktop/bundles";
18094
- var GLOBAL_ROOT = path11.join(os6.homedir(), ".event4u", "agent-config");
18095
- var GLOBAL_USER_SETTINGS_PATH = path11.join(GLOBAL_ROOT, ".agent-user.yml");
18096
- var GLOBAL_AGENT_SETTINGS_PATH = path11.join(GLOBAL_ROOT, ".agent-settings.yml");
18261
+ var GLOBAL_ROOT = path12.join(os7.homedir(), ".event4u", "agent-config");
18262
+ var GLOBAL_USER_SETTINGS_PATH = path12.join(GLOBAL_ROOT, ".agent-user.yml");
18263
+ var GLOBAL_AGENT_SETTINGS_PATH = path12.join(GLOBAL_ROOT, ".agent-settings.yml");
18097
18264
  function _bridge_marker(tool_id, scope) {
18098
18265
  if (scope === "global") return USER_SCOPE_PATHS[tool_id] ?? "";
18099
18266
  return PROJECT_BRIDGE_MARKERS[tool_id] ?? "";
@@ -18130,6 +18297,30 @@ function _enforce_not_source_repo(scope, project_root) {
18130
18297
  `Refusing to install agent-config into its own source checkout (detected: ${signature}). The source repo is global-only \u2014 a project-scope install would recreate the .augment/ .claude/ .cursor/ projection trees in the repo (double token cost). Run \`task sync\` to regenerate them from .agent-src.uncondensed/ instead, or set AGENT_CONFIG_ALLOW_SELF_INSTALL=1 to force.`
18131
18298
  );
18132
18299
  }
18300
+ function _load_yaml_doc(p) {
18301
+ if (!pathExists(p) || !isFile(p)) return {};
18302
+ let text;
18303
+ try {
18304
+ text = readText(p);
18305
+ } catch {
18306
+ return {};
18307
+ }
18308
+ const data = yamlSafeLoad(text);
18309
+ return _isPlainObject2(data) ? data : {};
18310
+ }
18311
+ function _load_default_settings(package_root) {
18312
+ const template_source = path12.join(package_root, "src", "config", "agent-settings.template.yml");
18313
+ if (!pathExists(template_source)) return {};
18314
+ let text;
18315
+ try {
18316
+ text = readText(template_source);
18317
+ } catch {
18318
+ return {};
18319
+ }
18320
+ const rendered = text.split(RULE_LOADING_TIER_PLACEHOLDER).join(DEFAULT_PROFILE).split(USER_TYPE_PLACEHOLDER).join("");
18321
+ const data = yamlSafeLoad(rendered);
18322
+ return _isPlainObject2(data) ? data : {};
18323
+ }
18133
18324
  function _resolve_scope(opts, detected, detect_reason, custom_path) {
18134
18325
  if (opts.scope === "project") return "project";
18135
18326
  if (opts.scope === "global") return "global";
@@ -18167,7 +18358,7 @@ function _run_scope_prompt(opts, reason, custom_path) {
18167
18358
  fail("Custom-path prompt aborted (EOF on stdin)");
18168
18359
  }
18169
18360
  if (!raw) fail("Custom-path prompt requires a non-empty path");
18170
- cp = resolvePath(expanduser5(raw));
18361
+ cp = resolvePath(expanduser6(raw));
18171
18362
  opts.custom_path = cp;
18172
18363
  }
18173
18364
  if (!state.QUIET) info(`Custom destination: ${cp}`);
@@ -18206,9 +18397,9 @@ function detect_scope(cwd) {
18206
18397
  if (pathExists(_resolve_settings_read(cwd))) {
18207
18398
  return ["project", `existing ${SETTINGS_FILE}`];
18208
18399
  }
18209
- const has_manifest = SCOPE_DETECT_MANIFESTS.find((m) => pathExists(path11.join(cwd, m))) ?? null;
18210
- const has_ai_dir = SCOPE_DETECT_AI_DIRS.find((d) => isDir(path11.join(cwd, d))) ?? null;
18211
- const has_ai_file = SCOPE_DETECT_AI_FILES.find((f) => pathExists(path11.join(cwd, f))) ?? null;
18400
+ const has_manifest = SCOPE_DETECT_MANIFESTS.find((m) => pathExists(path12.join(cwd, m))) ?? null;
18401
+ const has_ai_dir = SCOPE_DETECT_AI_DIRS.find((d) => isDir(path12.join(cwd, d))) ?? null;
18402
+ const has_ai_file = SCOPE_DETECT_AI_FILES.find((f) => pathExists(path12.join(cwd, f))) ?? null;
18212
18403
  if (has_manifest && (has_ai_dir || has_ai_file)) {
18213
18404
  const marker = has_ai_dir || has_ai_file;
18214
18405
  return ["prompt", `manifest (${has_manifest}) + AI-tool config (${marker})`];
@@ -18229,7 +18420,7 @@ function readLineSyncRaw(promptText) {
18229
18420
  for (; ; ) {
18230
18421
  let n;
18231
18422
  try {
18232
- n = fs13.readSync(0, buf, 0, 1, null);
18423
+ n = fs14.readSync(0, buf, 0, 1, null);
18233
18424
  } catch (err) {
18234
18425
  const code = err.code;
18235
18426
  if (code === "EAGAIN") {
@@ -18304,8 +18495,8 @@ function _files_by_tool_from_bridges(tools, project_root, scope) {
18304
18495
  const marker = _bridge_marker(tool_id, scope);
18305
18496
  if (!marker) continue;
18306
18497
  let marker_path = marker;
18307
- if (!path11.isAbsolute(marker_path)) {
18308
- marker_path = path11.join(project_root, marker_path);
18498
+ if (!path12.isAbsolute(marker_path)) {
18499
+ marker_path = path12.join(project_root, marker_path);
18309
18500
  }
18310
18501
  out[tool_id] = [_file_entry(marker_path, "bridge", false)];
18311
18502
  }
@@ -18344,26 +18535,26 @@ function _update_installed_tools_manifest(project_root, tools, scope, force, fil
18344
18535
  }
18345
18536
  write_manifest(target, version, entries);
18346
18537
  if (!state.QUIET) {
18347
- const rel = isRelativeTo(target, project_root) ? path11.relative(project_root, target) : target;
18538
+ const rel = isRelativeTo(target, project_root) ? path12.relative(project_root, target) : target;
18348
18539
  info(`Manifest updated: ${rel}`);
18349
18540
  }
18350
18541
  return 0;
18351
18542
  }
18352
18543
  function isRelativeTo(child, parent) {
18353
- const rel = path11.relative(parent, child);
18354
- return rel === "" || !rel.startsWith("..") && !path11.isAbsolute(rel);
18544
+ const rel = path12.relative(parent, child);
18545
+ return rel === "" || !rel.startsWith("..") && !path12.isAbsolute(rel);
18355
18546
  }
18356
18547
  function _resolve_package_root_for_global() {
18357
18548
  const here = resolvePath(_HERE2);
18358
- const candidate = path11.dirname(path11.dirname(path11.dirname(here)));
18359
- if (!pathExists(path11.join(candidate, "src", "config", "profiles", "minimal.ini"))) {
18549
+ const candidate = path12.dirname(path12.dirname(path12.dirname(here)));
18550
+ if (!pathExists(path12.join(candidate, "src", "config", "profiles", "minimal.ini"))) {
18360
18551
  fail(
18361
18552
  `Could not locate agent-config package root from ${here}. Expected src/config/profiles/minimal.ini at the parent directory.`
18362
18553
  );
18363
18554
  }
18364
18555
  return candidate;
18365
18556
  }
18366
- var CONSUMER_BRIDGE_MARKER_RELPATH = path11.join("agents", ".event4u-bridge.yml");
18557
+ var CONSUMER_BRIDGE_MARKER_RELPATH = path12.join("agents", ".event4u-bridge.yml");
18367
18558
  var MIGRATE_LEGACY_YAML_FILES = [".agent-settings.yml", ".agent-user.yml"];
18368
18559
  var MIGRATE_LEGACY_TOOL_DIRS = [".augment", ".claude", ".cursor"];
18369
18560
  var AGENT_CONFIG_PACKAGE_NAME = "@event4u/agent-config";
@@ -18371,7 +18562,7 @@ function _is_agent_config_source_repo(project_root) {
18371
18562
  if (process3.env["AGENT_CONFIG_CONSUMER_MODE"] === "1") {
18372
18563
  return [false, "consumer-mode-override"];
18373
18564
  }
18374
- const pkg_json = path11.join(project_root, "package.json");
18565
+ const pkg_json = path12.join(project_root, "package.json");
18375
18566
  if (isFile(pkg_json)) {
18376
18567
  let data = {};
18377
18568
  try {
@@ -18383,18 +18574,18 @@ function _is_agent_config_source_repo(project_root) {
18383
18574
  return [true, "package.json:name"];
18384
18575
  }
18385
18576
  }
18386
- if (isDir(path11.join(project_root, ".agent-src.uncondensed"))) {
18577
+ if (isDir(path12.join(project_root, ".agent-src.uncondensed"))) {
18387
18578
  return [true, ".agent-src.uncondensed/"];
18388
18579
  }
18389
- const packages_dir = path11.join(project_root, "packages");
18580
+ const packages_dir = path12.join(project_root, "packages");
18390
18581
  if (isDir(packages_dir)) {
18391
- for (const child of fs13.readdirSync(packages_dir)) {
18392
- if (isDir(path11.join(packages_dir, child, ".agent-src.uncondensed"))) {
18582
+ for (const child of fs14.readdirSync(packages_dir)) {
18583
+ if (isDir(path12.join(packages_dir, child, ".agent-src.uncondensed"))) {
18393
18584
  return [true, `packages/${child}/.agent-src.uncondensed/`];
18394
18585
  }
18395
18586
  }
18396
18587
  }
18397
- const installer_self = path11.join(project_root, "scripts", "install.py");
18588
+ const installer_self = path12.join(project_root, "scripts", "install.py");
18398
18589
  try {
18399
18590
  if (isFile(installer_self) && resolvePath(installer_self) === resolvePath(_HERE2)) {
18400
18591
  return [true, "src/scripts/install.py (self)"];
@@ -18414,17 +18605,17 @@ function _detect_legacy_for_migration(project_root) {
18414
18605
  }
18415
18606
  return [];
18416
18607
  }
18417
- if (isFile(path11.join(project_root, INSTALL_MODE_MARKER_REL))) return [];
18608
+ if (isFile(path12.join(project_root, INSTALL_MODE_MARKER_REL))) return [];
18418
18609
  const found = [];
18419
18610
  for (const name of MIGRATE_LEGACY_YAML_FILES) {
18420
- if (isFile(path11.join(project_root, name))) {
18611
+ if (isFile(path12.join(project_root, name))) {
18421
18612
  found.push(name);
18422
- } else if (isFile(path11.join(project_root, "settings", name))) {
18613
+ } else if (isFile(path12.join(project_root, "settings", name))) {
18423
18614
  found.push(`settings/${name}`);
18424
18615
  }
18425
18616
  }
18426
18617
  for (const name of MIGRATE_LEGACY_TOOL_DIRS) {
18427
- const p = path11.join(project_root, name);
18618
+ const p = path12.join(project_root, name);
18428
18619
  if (isDir(p) && !isSymlink(p)) {
18429
18620
  found.push(`${name}/`);
18430
18621
  }
@@ -18436,7 +18627,7 @@ function _prompt_migrate_to_global(project_root, artefacts) {
18436
18627
  process3.stdout.write("\n");
18437
18628
  warn("Legacy project-local artefacts detected \u2014 pre-ADR-020 layout:");
18438
18629
  for (const rel of artefacts) {
18439
- info(` ${path11.join(project_root, rel)}`);
18630
+ info(` ${path12.join(project_root, rel)}`);
18440
18631
  }
18441
18632
  info("The unified `agent-config migrate` sweeps these in one pass.");
18442
18633
  info("The wizard recreates fresh config afterwards.");
@@ -18465,22 +18656,22 @@ function _run_migrate_to_global(project_root) {
18465
18656
  }
18466
18657
  }
18467
18658
  function _format_global_root_for_marker(global_root) {
18468
- const home = resolvePath(os6.homedir());
18659
+ const home = resolvePath(os7.homedir());
18469
18660
  const resolved = resolvePath(global_root);
18470
- const rel = path11.relative(home, resolved);
18471
- if (rel === "" || rel.startsWith("..") || path11.isAbsolute(rel)) {
18661
+ const rel = path12.relative(home, resolved);
18662
+ if (rel === "" || rel.startsWith("..") || path12.isAbsolute(rel)) {
18472
18663
  return global_root;
18473
18664
  }
18474
- return `~/${rel.split(path11.sep).join("/")}`;
18665
+ return `~/${rel.split(path12.sep).join("/")}`;
18475
18666
  }
18476
18667
  function _remove_legacy_consumer_bridge_marker(project_root, env = null) {
18477
18668
  const env_map = env ?? process3.env;
18478
18669
  if (env_map["AGENT_CONFIG_DEV_MODE"] === "1") return null;
18479
- if (isDir(path11.join(project_root, ".agent-src.uncondensed"))) return null;
18480
- const target = path11.join(project_root, CONSUMER_BRIDGE_MARKER_RELPATH);
18670
+ if (isDir(path12.join(project_root, ".agent-src.uncondensed"))) return null;
18671
+ const target = path12.join(project_root, CONSUMER_BRIDGE_MARKER_RELPATH);
18481
18672
  if (!isFile(target)) return null;
18482
18673
  try {
18483
- fs13.rmSync(target);
18674
+ fs14.rmSync(target);
18484
18675
  } catch {
18485
18676
  return null;
18486
18677
  }
@@ -18494,7 +18685,7 @@ var PROJECT_ANCHOR_TOOLS = {
18494
18685
  function _write_per_tool_project_anchors(project_root, tools, env = null, now = null) {
18495
18686
  const env_map = env ?? process3.env;
18496
18687
  if (env_map["AGENT_CONFIG_DEV_MODE"] === "1") return [];
18497
- if (isDir(path11.join(project_root, ".agent-src.uncondensed"))) return [];
18688
+ if (isDir(path12.join(project_root, ".agent-src.uncondensed"))) return [];
18498
18689
  const global_root_str = _format_global_root_for_marker(
18499
18690
  event4u_root(env_map)
18500
18691
  );
@@ -18503,8 +18694,8 @@ function _write_per_tool_project_anchors(project_root, tools, env = null, now =
18503
18694
  for (const tool_id of Object.keys(PROJECT_ANCHOR_TOOLS).sort()) {
18504
18695
  const rel_path = PROJECT_ANCHOR_TOOLS[tool_id];
18505
18696
  if (!tools.has(tool_id)) continue;
18506
- const target = path11.join(project_root, rel_path);
18507
- mkdirp(path11.dirname(target));
18697
+ const target = path12.join(project_root, rel_path);
18698
+ mkdirp(path12.dirname(target));
18508
18699
  const body = `# event4u/agent-config \u2014 per-tool project anchor (auto-written).
18509
18700
  # Spec: docs/contracts/consumer-bridge.md \xA7 Per-tool anchor strategy.
18510
18701
  # Tool: ${tool_id}. Resolves the global install directly \u2014 no
@@ -18522,7 +18713,7 @@ installed_at: ${stamp}
18522
18713
  }
18523
18714
  var PACKAGE_TAG_ID = "event4u/agent-config";
18524
18715
  function _inject_package_tag(target, source, package_root) {
18525
- if (path11.extname(target) !== ".md") return;
18716
+ if (path12.extname(target) !== ".md") return;
18526
18717
  let text;
18527
18718
  try {
18528
18719
  text = readText(target);
@@ -18550,8 +18741,8 @@ function _inject_package_tag(target, source, package_root) {
18550
18741
  resolved_src = source;
18551
18742
  }
18552
18743
  if (package_root !== null) {
18553
- const rel = path11.relative(resolvePath(package_root), resolved_src);
18554
- if (rel !== "" && !rel.startsWith("..") && !path11.isAbsolute(rel)) {
18744
+ const rel = path12.relative(resolvePath(package_root), resolved_src);
18745
+ if (rel !== "" && !rel.startsWith("..") && !path12.isAbsolute(rel)) {
18555
18746
  source_value = rel;
18556
18747
  } else {
18557
18748
  source_value = resolved_src;
@@ -18588,10 +18779,10 @@ function _copy_dir_dereferencing_symlinks(src, dest, force, package_root = null)
18588
18779
  const written_paths = [];
18589
18780
  if (!pathExists(src)) return [0, 0, written_paths];
18590
18781
  if (!isDir(src)) {
18591
- mkdirp(path11.dirname(dest));
18782
+ mkdirp(path12.dirname(dest));
18592
18783
  const decision = _resolve_file_conflict(dest, force);
18593
18784
  if (decision === "skip") return [0, 1, written_paths];
18594
- fs13.copyFileSync(src, dest);
18785
+ fs14.copyFileSync(src, dest);
18595
18786
  _inject_package_tag(dest, src, package_root);
18596
18787
  written_paths.push(dest);
18597
18788
  return [1, 0, written_paths];
@@ -18599,11 +18790,11 @@ function _copy_dir_dereferencing_symlinks(src, dest, force, package_root = null)
18599
18790
  mkdirp(dest);
18600
18791
  const walk = (node) => {
18601
18792
  const acc = [];
18602
- const names = fs13.readdirSync(node).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
18793
+ const names = fs14.readdirSync(node).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
18603
18794
  for (const name of names) {
18604
- const entry = path11.join(node, name);
18795
+ const entry = path12.join(node, name);
18605
18796
  acc.push(entry);
18606
- const lst = fs13.lstatSync(entry);
18797
+ const lst = fs14.lstatSync(entry);
18607
18798
  if (lst.isDirectory() && !lst.isSymbolicLink()) {
18608
18799
  acc.push(...walk(entry));
18609
18800
  }
@@ -18611,9 +18802,9 @@ function _copy_dir_dereferencing_symlinks(src, dest, force, package_root = null)
18611
18802
  return acc;
18612
18803
  };
18613
18804
  for (const entry of walk(src)) {
18614
- const rel = path11.relative(src, entry);
18615
- const target = path11.join(dest, rel);
18616
- const lst = fs13.lstatSync(entry);
18805
+ const rel = path12.relative(src, entry);
18806
+ const target = path12.join(dest, rel);
18807
+ const lst = fs14.lstatSync(entry);
18617
18808
  if (lst.isDirectory() && !lst.isSymbolicLink()) {
18618
18809
  mkdirp(target);
18619
18810
  continue;
@@ -18621,8 +18812,8 @@ function _copy_dir_dereferencing_symlinks(src, dest, force, package_root = null)
18621
18812
  let resolvedIsDir = false;
18622
18813
  let resolved = entry;
18623
18814
  try {
18624
- resolved = fs13.realpathSync(entry);
18625
- resolvedIsDir = fs13.statSync(entry).isDirectory();
18815
+ resolved = fs14.realpathSync(entry);
18816
+ resolvedIsDir = fs14.statSync(entry).isDirectory();
18626
18817
  } catch {
18627
18818
  resolvedIsDir = false;
18628
18819
  }
@@ -18644,8 +18835,8 @@ function _copy_dir_dereferencing_symlinks(src, dest, force, package_root = null)
18644
18835
  skipped += 1;
18645
18836
  continue;
18646
18837
  }
18647
- mkdirp(path11.dirname(target));
18648
- fs13.copyFileSync(resolved, target);
18838
+ mkdirp(path12.dirname(target));
18839
+ fs14.copyFileSync(resolved, target);
18649
18840
  _inject_package_tag(target, resolved, package_root);
18650
18841
  written += 1;
18651
18842
  written_paths.push(target);
@@ -18656,8 +18847,8 @@ function _claude_desktop_bundles_dir() {
18656
18847
  return write_target(_CLAUDE_DESKTOP_BUNDLES_SUBPATH);
18657
18848
  }
18658
18849
  function _write_claude_desktop_marker(_force, lockfile_path2, bundles_dir, bundle_count) {
18659
- const anchor = expanduser5(USER_SCOPE_PATHS["claude-desktop"]);
18660
- const target = path11.join(anchor, "agent-config.md");
18850
+ const anchor = expanduser6(USER_SCOPE_PATHS["claude-desktop"]);
18851
+ const target = path12.join(anchor, "agent-config.md");
18661
18852
  mkdirp(anchor);
18662
18853
  const body = claudeDesktopMarkerBody(lockfile_path2, anchor, bundles_dir, bundle_count);
18663
18854
  writeText(target, body);
@@ -18681,48 +18872,49 @@ function _apply_claude_flat_command_wrappers(anchor, package_root, current_files
18681
18872
  const wrapped = [];
18682
18873
  const collisions = [];
18683
18874
  const reserved = [];
18684
- const commands_dir = path11.join(anchor, "commands");
18875
+ const commands_dir = path12.join(anchor, "commands");
18685
18876
  let flat_entries = [];
18686
18877
  try {
18687
- flat_entries = fs13.readdirSync(commands_dir).filter((f) => f.endsWith(".md"));
18878
+ flat_entries = fs14.readdirSync(commands_dir).filter((f) => f.endsWith(".md"));
18688
18879
  } catch {
18689
18880
  }
18690
18881
  for (const fname of flat_entries.sort()) {
18691
18882
  const slug = fname.slice(0, -".md".length);
18692
18883
  if (!is_claude_builtin_name(slug)) continue;
18693
- fs13.rmSync(path11.join(commands_dir, fname), { force: true });
18884
+ fs14.rmSync(path12.join(commands_dir, fname), { force: true });
18694
18885
  current_files.delete(`commands/${fname}`);
18695
18886
  reserved.push(slug);
18696
18887
  }
18697
18888
  const eligible = new Set(_CLAUDE_FLAT_WRAPPER_EXTRA);
18698
18889
  try {
18699
18890
  const manifest = JSON.parse(
18700
- fs13.readFileSync(path11.join(package_root, "dist", "discovery", "discovery-manifest.json"), "utf8")
18891
+ fs14.readFileSync(path12.join(package_root, "dist", "discovery", "discovery-manifest.json"), "utf8")
18701
18892
  );
18702
18893
  for (const a of manifest.artefacts ?? []) {
18703
18894
  if (a.category !== "command" || typeof a.slug !== "string") continue;
18704
- if ((a.tier ?? 2) <= 1 && a.visibility !== "internal") eligible.add(a.slug);
18895
+ const visible = typeof a.visibility === "string" ? a.visibility !== "internal" : typeof a.tier === "number" ? a.tier <= 1 : false;
18896
+ if (visible) eligible.add(a.slug);
18705
18897
  }
18706
18898
  } catch {
18707
18899
  }
18708
18900
  for (const slug of [...eligible].sort()) {
18709
18901
  const flat_rel = `commands/${slug}.md`;
18710
- const flat_abs = path11.join(anchor, "commands", `${slug}.md`);
18711
- if (!fs13.existsSync(flat_abs)) continue;
18712
- const skill_dir = path11.join(anchor, "skills", slug);
18713
- if (fs13.existsSync(skill_dir)) {
18902
+ const flat_abs = path12.join(anchor, "commands", `${slug}.md`);
18903
+ if (!fs14.existsSync(flat_abs)) continue;
18904
+ const skill_dir = path12.join(anchor, "skills", slug);
18905
+ if (fs14.existsSync(skill_dir)) {
18714
18906
  collisions.push(slug);
18715
18907
  continue;
18716
18908
  }
18717
- let body = fs13.readFileSync(flat_abs, "utf8");
18909
+ let body = fs14.readFileSync(flat_abs, "utf8");
18718
18910
  if (body.startsWith("---\n") && !/^name:/m.test(body.split("\n---")[0] ?? "")) {
18719
18911
  body = body.replace("---\n", `---
18720
18912
  name: ${slug}
18721
18913
  `);
18722
18914
  }
18723
- fs13.mkdirSync(skill_dir, { recursive: true });
18724
- fs13.writeFileSync(path11.join(skill_dir, "SKILL.md"), body, "utf8");
18725
- fs13.rmSync(flat_abs, { force: true });
18915
+ fs14.mkdirSync(skill_dir, { recursive: true });
18916
+ fs14.writeFileSync(path12.join(skill_dir, "SKILL.md"), body, "utf8");
18917
+ fs14.rmSync(flat_abs, { force: true });
18726
18918
  current_files.delete(flat_rel);
18727
18919
  current_files.add(`skills/${slug}/SKILL.md`);
18728
18920
  wrapped.push(slug);
@@ -18747,14 +18939,14 @@ function _deploy_global_content(tools, force, package_root, lockfile_path2) {
18747
18939
  results[tool_id] = [0, 0, "unsupported", []];
18748
18940
  continue;
18749
18941
  }
18750
- const anchor = expanduser5(anchor_raw);
18942
+ const anchor = expanduser6(anchor_raw);
18751
18943
  let written_total = 0;
18752
18944
  let skipped_total = 0;
18753
18945
  const written_paths = [];
18754
18946
  let current_files = /* @__PURE__ */ new Set();
18755
18947
  for (const [src_rel, dest_sub] of plan) {
18756
- const src = path11.join(package_root, src_rel);
18757
- const dest = dest_sub ? path11.join(anchor, dest_sub) : anchor;
18948
+ const src = path12.join(package_root, src_rel);
18949
+ const dest = dest_sub ? path12.join(anchor, dest_sub) : anchor;
18758
18950
  const [w, s, paths] = _copy_dir_dereferencing_symlinks(src, dest, force, package_root);
18759
18951
  written_total += w;
18760
18952
  skipped_total += s;
@@ -18817,10 +19009,10 @@ function _deploy_global_content(tools, force, package_root, lockfile_path2) {
18817
19009
  results[tool_id] = [written_total, skipped_total, "deployed", written_paths];
18818
19010
  if (tool_id === "claude-code") {
18819
19011
  try {
18820
- const manifest = path11.join(package_root, "src", "scripts", "hook_manifest.yaml");
19012
+ const manifest = path12.join(package_root, "src", "scripts", "hook_manifest.yaml");
18821
19013
  const matrix = build_claude_hook_matrix(manifest);
18822
19014
  const res = ensure_managed_hooks(
18823
- path11.join(anchor, "settings.json"),
19015
+ path12.join(anchor, "settings.json"),
18824
19016
  matrix
18825
19017
  );
18826
19018
  if (!state.QUIET) {
@@ -18853,10 +19045,10 @@ function _preview_global_reap(tools, package_root) {
18853
19045
  if (plan === void 0) continue;
18854
19046
  const anchor_raw = USER_SCOPE_PATHS[tool_id];
18855
19047
  if (!anchor_raw) continue;
18856
- const anchor = expanduser5(anchor_raw);
19048
+ const anchor = expanduser6(anchor_raw);
18857
19049
  let current_files = /* @__PURE__ */ new Set();
18858
19050
  for (const [src_rel, dest_sub] of plan) {
18859
- const src = path11.join(package_root, src_rel);
19051
+ const src = path12.join(package_root, src_rel);
18860
19052
  current_files = setUnion(
18861
19053
  current_files,
18862
19054
  expected_deploy_files(src, dest_sub ? dest_sub : "")
@@ -18886,14 +19078,14 @@ function _preview_global_reap(tools, package_root) {
18886
19078
  function _verify_deploy_targets(anchor, plan) {
18887
19079
  const missing = [];
18888
19080
  for (const [, dest_sub] of plan) {
18889
- const target = dest_sub ? path11.join(anchor, dest_sub) : anchor;
19081
+ const target = dest_sub ? path12.join(anchor, dest_sub) : anchor;
18890
19082
  const label = dest_sub || ".";
18891
19083
  if (!isDir(target)) {
18892
19084
  missing.push(label);
18893
19085
  continue;
18894
19086
  }
18895
19087
  try {
18896
- const entries = fs13.readdirSync(target);
19088
+ const entries = fs14.readdirSync(target);
18897
19089
  if (entries.length === 0) missing.push(label);
18898
19090
  } catch {
18899
19091
  missing.push(label);
@@ -18901,22 +19093,22 @@ function _verify_deploy_targets(anchor, plan) {
18901
19093
  }
18902
19094
  return missing;
18903
19095
  }
18904
- function _prune_lab_modules(deploy_results, lab_ids) {
19096
+ function _prune_modules_by(deploy_results, is_pruned) {
18905
19097
  let pruned = 0;
18906
19098
  const adjusted = {};
18907
19099
  for (const tool_id of Object.keys(deploy_results)) {
18908
19100
  const [written, skipped, status, paths] = deploy_results[tool_id];
18909
- const lab_skill_dirs = /* @__PURE__ */ new Set();
19101
+ const pruned_skill_dirs = /* @__PURE__ */ new Set();
18910
19102
  for (const p of paths) {
18911
- const parts = p.split(path11.sep);
19103
+ const parts = p.split(path12.sep);
18912
19104
  if (parts.includes("skills")) {
18913
19105
  const i = parts.indexOf("skills");
18914
19106
  if (i + 1 < parts.length) {
18915
- const skill_root = parts.slice(0, i + 2).join(path11.sep);
18916
- if (!lab_skill_dirs.has(skill_root)) {
18917
- const skillmd = path11.join(skill_root, "SKILL.md");
18918
- if (pathExists(skillmd) && is_lab_artefact(skillmd, lab_ids)) {
18919
- lab_skill_dirs.add(skill_root);
19107
+ const skill_root = parts.slice(0, i + 2).join(path12.sep);
19108
+ if (!pruned_skill_dirs.has(skill_root)) {
19109
+ const skillmd = path12.join(skill_root, "SKILL.md");
19110
+ if (pathExists(skillmd) && is_pruned(skillmd)) {
19111
+ pruned_skill_dirs.add(skill_root);
18920
19112
  }
18921
19113
  }
18922
19114
  }
@@ -18925,25 +19117,25 @@ function _prune_lab_modules(deploy_results, lab_ids) {
18925
19117
  const keep = [];
18926
19118
  const delete_files = [];
18927
19119
  for (const p of paths) {
18928
- const parts = p.split(path11.sep);
18929
- let is_lab = false;
19120
+ const parts = p.split(path12.sep);
19121
+ let is_target = false;
18930
19122
  if (parts.includes("skills")) {
18931
19123
  const i = parts.indexOf("skills");
18932
- if (i + 1 < parts.length && lab_skill_dirs.has(parts.slice(0, i + 2).join(path11.sep))) {
18933
- is_lab = true;
19124
+ if (i + 1 < parts.length && pruned_skill_dirs.has(parts.slice(0, i + 2).join(path12.sep))) {
19125
+ is_target = true;
18934
19126
  }
18935
- } else if (parts.includes("commands") && path11.extname(p) === ".md" && is_lab_artefact(p, lab_ids)) {
18936
- is_lab = true;
19127
+ } else if (parts.includes("commands") && path12.extname(p) === ".md" && is_pruned(p)) {
19128
+ is_target = true;
18937
19129
  }
18938
- (is_lab ? delete_files : keep).push(p);
19130
+ (is_target ? delete_files : keep).push(p);
18939
19131
  }
18940
- for (const d of lab_skill_dirs) {
18941
- fs13.rmSync(d, { recursive: true, force: true });
19132
+ for (const d of pruned_skill_dirs) {
19133
+ fs14.rmSync(d, { recursive: true, force: true });
18942
19134
  }
18943
19135
  for (const p of delete_files) {
18944
- if (p.split(path11.sep).includes("commands") && pathExists(p)) {
19136
+ if (p.split(path12.sep).includes("commands") && pathExists(p)) {
18945
19137
  try {
18946
- fs13.unlinkSync(p);
19138
+ fs14.unlinkSync(p);
18947
19139
  } catch {
18948
19140
  }
18949
19141
  }
@@ -18953,6 +19145,85 @@ function _prune_lab_modules(deploy_results, lab_ids) {
18953
19145
  }
18954
19146
  return [pruned, adjusted];
18955
19147
  }
19148
+ function _prune_lab_modules(deploy_results, lab_ids) {
19149
+ return _prune_modules_by(deploy_results, (p) => is_lab_artefact(p, lab_ids));
19150
+ }
19151
+ var SCOPED_ACTIVE_WORKSPACES = /* @__PURE__ */ new Set(["engineering", "agent-config-maintainer"]);
19152
+ function _load_packs_registry(package_root) {
19153
+ const vocab_path = path12.join(package_root, "src", "config", "discovery", "packs.yml");
19154
+ const data = yamlSafeLoad(readText(vocab_path));
19155
+ if (!Array.isArray(data)) {
19156
+ throw new Error(`packs.yml did not parse to a list: ${vocab_path}`);
19157
+ }
19158
+ const out = [];
19159
+ for (const entry of data) {
19160
+ if (!_isPlainObject2(entry)) continue;
19161
+ const id = entry["id"];
19162
+ if (typeof id !== "string" || id === "") continue;
19163
+ const workspaces_raw = entry["workspaces"];
19164
+ const workspaces = Array.isArray(workspaces_raw) ? workspaces_raw.filter((w) => typeof w === "string") : [];
19165
+ const requires_raw = entry["requires"] ?? entry["requires_hint"];
19166
+ const requires = Array.isArray(requires_raw) ? requires_raw.filter((r) => typeof r === "string") : [];
19167
+ out.push({ id, workspaces, requires });
19168
+ }
19169
+ return out;
19170
+ }
19171
+ function _compute_active_pack_ids(packs, runtime_active_packs) {
19172
+ const by_id = /* @__PURE__ */ new Map();
19173
+ for (const p of packs) by_id.set(p.id, p);
19174
+ const active = /* @__PURE__ */ new Set();
19175
+ for (const p of packs) {
19176
+ if (p.workspaces.some((w) => SCOPED_ACTIVE_WORKSPACES.has(w))) {
19177
+ active.add(p.id);
19178
+ }
19179
+ }
19180
+ for (const id of runtime_active_packs) {
19181
+ active.add(id);
19182
+ }
19183
+ let frontier = [...active];
19184
+ while (frontier.length > 0) {
19185
+ const next = [];
19186
+ for (const id of frontier) {
19187
+ const rec = by_id.get(id);
19188
+ if (rec === void 0) continue;
19189
+ for (const dep of rec.requires) {
19190
+ if (!active.has(dep)) {
19191
+ active.add(dep);
19192
+ next.push(dep);
19193
+ }
19194
+ }
19195
+ }
19196
+ frontier = next;
19197
+ }
19198
+ return active;
19199
+ }
19200
+ function _resolve_global_settings_doc() {
19201
+ const root = event4u_root();
19202
+ const canonical = path12.join(root, "settings", SETTINGS_FILE);
19203
+ if (pathExists(canonical)) return _load_yaml_doc(canonical);
19204
+ const legacy = path12.join(root, SETTINGS_FILE);
19205
+ if (pathExists(legacy)) return _load_yaml_doc(legacy);
19206
+ return null;
19207
+ }
19208
+ function _resolve_scoped_projection(package_root) {
19209
+ const doc = _resolve_global_settings_doc() ?? _load_default_settings(package_root);
19210
+ const projection = _isPlainObject2(doc["projection"]) ? doc["projection"] : {};
19211
+ const mode = projection["mode"] === "scoped" ? "scoped" : "legacy-all";
19212
+ const runtime = _isPlainObject2(doc["runtime"]) ? doc["runtime"] : {};
19213
+ const active_packs_raw = runtime["active_packs"];
19214
+ const active_packs = Array.isArray(active_packs_raw) ? active_packs_raw.filter((v) => typeof v === "string") : [];
19215
+ return { mode, active_packs };
19216
+ }
19217
+ function _prune_scoped_modules(deploy_results, active_ids) {
19218
+ return _prune_modules_by(deploy_results, (p) => {
19219
+ const packs = frontmatter_packs(p);
19220
+ if (packs.size === 0) return false;
19221
+ for (const id of packs) {
19222
+ if (active_ids.has(id)) return false;
19223
+ }
19224
+ return true;
19225
+ });
19226
+ }
18956
19227
  function install_global(tools, force, project_root = null, core_only = false) {
18957
19228
  const migrated = migrate_legacy_namespace();
18958
19229
  if (migrated && !state.QUIET) {
@@ -19007,6 +19278,15 @@ function install_global(tools, force, project_root = null, core_only = false) {
19007
19278
  info(` schema_version=1, agent_config_version=${installed_version}`);
19008
19279
  info(` tools=${merged_tools.join(",")}`);
19009
19280
  }
19281
+ if (project_root !== null && pathExists(_resolve_settings_read(project_root)) && !isDir(path12.join(project_root, ".agent-src.uncondensed"))) {
19282
+ const drift = collect_drift(project_root);
19283
+ if (!state.QUIET) {
19284
+ process3.stdout.write("\n");
19285
+ for (const line of format_drift_report(drift).replace(/\n$/, "").split("\n")) {
19286
+ info(line);
19287
+ }
19288
+ }
19289
+ }
19010
19290
  const package_root = _resolve_package_root_for_global();
19011
19291
  let deploy_results = _deploy_global_content(tools, force, package_root, written);
19012
19292
  if (core_only) {
@@ -19019,6 +19299,24 @@ function install_global(tools, force, project_root = null, core_only = false) {
19019
19299
  );
19020
19300
  }
19021
19301
  }
19302
+ try {
19303
+ const { mode, active_packs } = _resolve_scoped_projection(package_root);
19304
+ if (mode === "scoped") {
19305
+ const packs_registry = _load_packs_registry(package_root);
19306
+ const active_ids = _compute_active_pack_ids(packs_registry, active_packs);
19307
+ let scoped_pruned;
19308
+ [scoped_pruned, deploy_results] = _prune_scoped_modules(deploy_results, active_ids);
19309
+ if (!state.QUIET) {
19310
+ info(
19311
+ `\u{1F9F9} Scoped install: pruned ${scoped_pruned} non-active-pack artefact(s) (active packs: ${[...active_ids].sort().join(", ") || "(none)"}). Set projection.mode: legacy-all in .agent-settings.yml to restore the full surface.`
19312
+ );
19313
+ }
19314
+ }
19315
+ } catch (e) {
19316
+ if (!state.QUIET) {
19317
+ warn(`Scoped-projection prune failed \u2014 restoring full tree (${String(e)}).`);
19318
+ }
19319
+ }
19022
19320
  const failed_tools = new Set(
19023
19321
  Object.keys(deploy_results).filter(
19024
19322
  (tool_id) => deploy_results[tool_id][2] === "deploy_failed"
@@ -19080,19 +19378,19 @@ function install_global(tools, force, project_root = null, core_only = false) {
19080
19378
  }
19081
19379
  }
19082
19380
  }
19083
- if (project_root !== null && pathExists(_resolve_settings_read(project_root)) && !isDir(path11.join(project_root, ".agent-src.uncondensed"))) {
19381
+ if (project_root !== null && pathExists(_resolve_settings_read(project_root)) && !isDir(path12.join(project_root, ".agent-src.uncondensed"))) {
19084
19382
  const files_by_tool = _files_by_tool_from_deploy(deploy_results);
19085
19383
  const rc = _update_installed_tools_manifest(project_root, tools, "global", force, files_by_tool);
19086
19384
  if (rc !== 0) return rc;
19087
19385
  const removed_marker = _remove_legacy_consumer_bridge_marker(project_root);
19088
19386
  if (removed_marker !== null && !state.QUIET) {
19089
- const rel = isRelativeTo(removed_marker, project_root) ? path11.relative(project_root, removed_marker) : removed_marker;
19387
+ const rel = isRelativeTo(removed_marker, project_root) ? path12.relative(project_root, removed_marker) : removed_marker;
19090
19388
  info(`Removed legacy bridge marker: ${rel}`);
19091
19389
  }
19092
19390
  const anchor_paths = _write_per_tool_project_anchors(project_root, tools);
19093
19391
  if (anchor_paths.length > 0 && !state.QUIET) {
19094
19392
  for (const p of anchor_paths) {
19095
- const rel = isRelativeTo(p, project_root) ? path11.relative(project_root, p) : p;
19393
+ const rel = isRelativeTo(p, project_root) ? path12.relative(project_root, p) : p;
19096
19394
  info(`Project anchor written: ${rel}`);
19097
19395
  }
19098
19396
  }
@@ -19109,8 +19407,8 @@ function install_global(tools, force, project_root = null, core_only = false) {
19109
19407
  }
19110
19408
  return 0;
19111
19409
  }
19112
- var SETTINGS_SURFACE_REL = path11.join("state", "settings-surface.json");
19113
- var SETTINGS_DELTA_REL = path11.join("state", "settings-delta.json");
19410
+ var SETTINGS_SURFACE_REL = path12.join("state", "settings-surface.json");
19411
+ var SETTINGS_DELTA_REL = path12.join("state", "settings-delta.json");
19114
19412
  function _current_settings_surface(version) {
19115
19413
  const jsonSchema = zodToJsonSchema(settingsSchema, {
19116
19414
  name: "AgentSettings",
@@ -19121,20 +19419,20 @@ function _current_settings_surface(version) {
19121
19419
  }
19122
19420
  function _write_settings_surface_snapshot(installed_version) {
19123
19421
  const root = event4u_root();
19124
- const surface_path = path11.join(root, SETTINGS_SURFACE_REL);
19125
- const delta_path = path11.join(root, SETTINGS_DELTA_REL);
19422
+ const surface_path = path12.join(root, SETTINGS_SURFACE_REL);
19423
+ const delta_path = path12.join(root, SETTINGS_DELTA_REL);
19126
19424
  const next = _current_settings_surface(installed_version);
19127
19425
  let previous = null;
19128
19426
  try {
19129
- const parsed = JSON.parse(fs13.readFileSync(surface_path, "utf8"));
19427
+ const parsed = JSON.parse(fs14.readFileSync(surface_path, "utf8"));
19130
19428
  if (parsed !== null && typeof parsed === "object" && parsed.entries !== void 0) previous = parsed;
19131
19429
  } catch {
19132
19430
  }
19133
19431
  if (previous !== null && previous.version !== next.version) {
19134
19432
  const delta = computeSurfaceDelta(previous, next);
19135
19433
  if (delta.changes.length > 0) {
19136
- fs13.mkdirSync(path11.dirname(delta_path), { recursive: true, mode: 448 });
19137
- fs13.writeFileSync(delta_path, `${JSON.stringify(delta, null, 2)}
19434
+ fs14.mkdirSync(path12.dirname(delta_path), { recursive: true, mode: 448 });
19435
+ fs14.writeFileSync(delta_path, `${JSON.stringify(delta, null, 2)}
19138
19436
  `, { mode: 384 });
19139
19437
  if (!state.QUIET) {
19140
19438
  const counts = {};
@@ -19146,8 +19444,8 @@ function _write_settings_surface_snapshot(installed_version) {
19146
19444
  }
19147
19445
  }
19148
19446
  }
19149
- fs13.mkdirSync(path11.dirname(surface_path), { recursive: true, mode: 448 });
19150
- fs13.writeFileSync(surface_path, `${JSON.stringify(next, null, 2)}
19447
+ fs14.mkdirSync(path12.dirname(surface_path), { recursive: true, mode: 448 });
19448
+ fs14.writeFileSync(surface_path, `${JSON.stringify(next, null, 2)}
19151
19449
  `, { mode: 384 });
19152
19450
  }
19153
19451
  function arrayStrEqual(a, b) {
@@ -19359,13 +19657,13 @@ function _minimal_templates_root() {
19359
19657
  const chain = [start];
19360
19658
  let cur = start;
19361
19659
  for (; ; ) {
19362
- const parent = path11.dirname(cur);
19660
+ const parent = path12.dirname(cur);
19363
19661
  if (parent === cur) break;
19364
19662
  chain.push(parent);
19365
19663
  cur = parent;
19366
19664
  }
19367
19665
  for (const ancestor of chain) {
19368
- const candidate = path11.join(ancestor, "src", "templates", "minimal");
19666
+ const candidate = path12.join(ancestor, "src", "templates", "minimal");
19369
19667
  if (isDir(candidate)) return candidate;
19370
19668
  }
19371
19669
  fail("Could not locate src/templates/minimal/ \u2014 package install is corrupt.");
@@ -19373,9 +19671,9 @@ function _minimal_templates_root() {
19373
19671
  var INSTALL_MODE_MARKER_REL = "agents/.agent-state/install-mode.txt";
19374
19672
  function _write_install_mode_marker(project_root, mode) {
19375
19673
  if (mode !== "minimal" && mode !== "full") return;
19376
- const marker = path11.join(project_root, INSTALL_MODE_MARKER_REL);
19674
+ const marker = path12.join(project_root, INSTALL_MODE_MARKER_REL);
19377
19675
  try {
19378
- mkdirp(path11.dirname(marker));
19676
+ mkdirp(path12.dirname(marker));
19379
19677
  writeText(marker, `${mode}
19380
19678
  `);
19381
19679
  } catch {
@@ -19384,7 +19682,7 @@ function _write_install_mode_marker(project_root, mode) {
19384
19682
  function install_minimal(target_root_in, force, user_type = "") {
19385
19683
  let target_root = resolvePath(target_root_in);
19386
19684
  mkdirp(target_root);
19387
- const parent = path11.dirname(target_root);
19685
+ const parent = path12.dirname(target_root);
19388
19686
  if (parent !== target_root) {
19389
19687
  const existing = find_project_root_with_anchor(parent);
19390
19688
  if (existing !== null && existing[0] !== target_root) {
@@ -19395,21 +19693,21 @@ function install_minimal(target_root_in, force, user_type = "") {
19395
19693
  }
19396
19694
  }
19397
19695
  const templates = _minimal_templates_root();
19398
- const settings_src = path11.join(templates, SETTINGS_FILE);
19399
- const overrides_gitkeep_src = path11.join(templates, "overrides-gitkeep");
19400
- const overrides_readme_src = path11.join(templates, "agents-overrides-readme.md");
19696
+ const settings_src = path12.join(templates, SETTINGS_FILE);
19697
+ const overrides_gitkeep_src = path12.join(templates, "overrides-gitkeep");
19698
+ const overrides_readme_src = path12.join(templates, "agents-overrides-readme.md");
19401
19699
  if (!isFile(settings_src)) fail(`Bundled minimal settings template missing under ${templates}`);
19402
19700
  if (!isFile(overrides_gitkeep_src) || !isFile(overrides_readme_src)) {
19403
19701
  fail(`Bundled overrides scaffold templates missing under ${templates}`);
19404
19702
  }
19405
19703
  info(`Minimal init \u2192 ${target_root}`);
19406
- const overrides_root = path11.join(target_root, "agents", "overrides");
19704
+ const overrides_root = path12.join(target_root, "agents", "overrides");
19407
19705
  mkdirp(overrides_root);
19408
19706
  const gitkeep_body = readText(overrides_gitkeep_src);
19409
19707
  for (const sub of ["rules", "skills", "commands"]) {
19410
- const sub_dir = path11.join(overrides_root, sub);
19708
+ const sub_dir = path12.join(overrides_root, sub);
19411
19709
  mkdirp(sub_dir);
19412
- const gitkeep_dst = path11.join(sub_dir, ".gitkeep");
19710
+ const gitkeep_dst = path12.join(sub_dir, ".gitkeep");
19413
19711
  if (pathExists(gitkeep_dst) && !force) {
19414
19712
  skip(`agents/overrides/${sub}/.gitkeep already exists (use --force to overwrite)`);
19415
19713
  } else {
@@ -19417,7 +19715,7 @@ function install_minimal(target_root_in, force, user_type = "") {
19417
19715
  success(`Wrote agents/overrides/${sub}/.gitkeep`);
19418
19716
  }
19419
19717
  }
19420
- const readme_dst = path11.join(overrides_root, "README.md");
19718
+ const readme_dst = path12.join(overrides_root, "README.md");
19421
19719
  if (pathExists(readme_dst) && !force) {
19422
19720
  skip("agents/overrides/README.md already exists (use --force to overwrite)");
19423
19721
  } else {
@@ -19435,14 +19733,14 @@ function install_minimal(target_root_in, force, user_type = "") {
19435
19733
  personal:
19436
19734
  user_type: ${user_type}
19437
19735
  `;
19438
- mkdirp(path11.dirname(settings_dst));
19736
+ mkdirp(path12.dirname(settings_dst));
19439
19737
  writeText(settings_dst, body);
19440
19738
  success(`Wrote ${SETTINGS_FILE} (user_type=${user_type})`);
19441
19739
  }
19442
19740
  }
19443
19741
  const removed_marker = _remove_legacy_consumer_bridge_marker(target_root);
19444
19742
  if (removed_marker !== null) {
19445
- const rel = isRelativeTo(removed_marker, target_root) ? path11.relative(target_root, removed_marker) : removed_marker;
19743
+ const rel = isRelativeTo(removed_marker, target_root) ? path12.relative(target_root, removed_marker) : removed_marker;
19446
19744
  success(`Removed legacy bridge marker: ${rel}`);
19447
19745
  }
19448
19746
  _write_install_mode_marker(target_root, "minimal");
@@ -19516,7 +19814,7 @@ function run_interactive_init(project_root, force) {
19516
19814
  );
19517
19815
  return 0;
19518
19816
  }
19519
- const target = path11.join(project_root, _LOCAL_CONFIG_FILE);
19817
+ const target = path12.join(project_root, _LOCAL_CONFIG_FILE);
19520
19818
  if (pathExists(target) && !force) {
19521
19819
  warn(
19522
19820
  `${_LOCAL_CONFIG_FILE} already exists; re-run with --force to overwrite. Skipping interactive init.`
@@ -19543,7 +19841,7 @@ function run_interactive_init(project_root, force) {
19543
19841
  warn(`Could not write ${target}: ${String(exc)}`);
19544
19842
  return 1;
19545
19843
  }
19546
- success(`Wrote ${path11.relative(project_root, target)} (${user_type} / ${stack} / ${verbosity})`);
19844
+ success(`Wrote ${path12.relative(project_root, target)} (${user_type} / ${stack} / ${verbosity})`);
19547
19845
  return 0;
19548
19846
  }
19549
19847
  var _WIZARD_READY_RE = /^WIZARD_READY (http:\/\/(?:127\.0\.0\.1|localhost):\d+\/\S*)\r?$/;
@@ -19561,12 +19859,12 @@ function _wizard_should_launch(opts) {
19561
19859
  return [true, ""];
19562
19860
  }
19563
19861
  function _wizard_cli_dist(_project_root) {
19564
- const package_root = path11.dirname(path11.dirname(path11.dirname(resolvePath(_HERE2))));
19565
- const cli = path11.join(package_root, "dist", "cli", "agent-config.js");
19862
+ const package_root = path12.dirname(path12.dirname(path12.dirname(resolvePath(_HERE2))));
19863
+ const cli = path12.join(package_root, "dist", "cli", "agent-config.js");
19566
19864
  return pathExists(cli) ? cli : null;
19567
19865
  }
19568
19866
  function _server_info_path() {
19569
- return path11.join(os6.homedir(), ".event4u", "agent-config", "local-server.json");
19867
+ return path12.join(os7.homedir(), ".event4u", "agent-config", "local-server.json");
19570
19868
  }
19571
19869
  function _pid_is_agent_config(pid) {
19572
19870
  let res;
@@ -19583,7 +19881,7 @@ function _pid_is_agent_config(pid) {
19583
19881
  }
19584
19882
  function unlinkMissingOk(p) {
19585
19883
  try {
19586
- fs13.unlinkSync(p);
19884
+ fs14.unlinkSync(p);
19587
19885
  } catch {
19588
19886
  }
19589
19887
  }
@@ -19661,14 +19959,14 @@ function _wizard_spawn(project_root, pass_project_root = true) {
19661
19959
  }
19662
19960
  function _wizard_run_sync(cmd, env, cli) {
19663
19961
  const total = _WIZARD_TIMEOUTS.reduce((a, b) => a + b, 0);
19664
- const log_path = path11.join(
19665
- os6.tmpdir(),
19962
+ const log_path = path12.join(
19963
+ os7.tmpdir(),
19666
19964
  `agent-config-wizard-${process3.pid}-${Date.now()}.log`
19667
19965
  );
19668
19966
  let child;
19669
19967
  let log_fd = null;
19670
19968
  try {
19671
- log_fd = fs13.openSync(log_path, "w");
19969
+ log_fd = fs14.openSync(log_path, "w");
19672
19970
  child = spawn(cmd[0], cmd.slice(1), {
19673
19971
  env,
19674
19972
  detached: true,
@@ -19686,7 +19984,7 @@ function _wizard_run_sync(cmd, env, cli) {
19686
19984
  } finally {
19687
19985
  if (log_fd !== null) {
19688
19986
  try {
19689
- fs13.closeSync(log_fd);
19987
+ fs14.closeSync(log_fd);
19690
19988
  } catch {
19691
19989
  }
19692
19990
  }
@@ -19936,8 +20234,8 @@ function main2(argv) {
19936
20234
  const target_root = resolvePath(
19937
20235
  opts.custom_path || opts.project || process3.env["PROJECT_ROOT"] || process3.cwd()
19938
20236
  );
19939
- const minimal_package_root = path11.dirname(
19940
- path11.dirname(path11.dirname(_minimal_templates_root()))
20237
+ const minimal_package_root = path12.dirname(
20238
+ path12.dirname(path12.dirname(_minimal_templates_root()))
19941
20239
  );
19942
20240
  const validated_user_type = _validate_user_type(minimal_package_root, opts.user_type);
19943
20241
  return install_minimal(target_root, opts.force, validated_user_type);
@@ -19966,7 +20264,7 @@ function main2(argv) {
19966
20264
  return rc2;
19967
20265
  }
19968
20266
  const project_root = custom_path || resolvePath(opts.project || process3.env["PROJECT_ROOT"] || process3.cwd());
19969
- const is_first_run = !pathExists(path11.join(project_root, SETTINGS_FILE));
20267
+ const is_first_run = !pathExists(path12.join(project_root, SETTINGS_FILE));
19970
20268
  const rc = _main_project_install(opts, project_root, parsed_tools, is_first_run);
19971
20269
  if (rc === 0 && opts.interactive) {
19972
20270
  run_interactive_init(project_root, opts.force);
@@ -20030,16 +20328,16 @@ function _team_setup_hint_line(project_root) {
20030
20328
  return " \u2022 Claude Code team mode (optional cross-model review via the official codex plugin): run `agent-config doctor --check team` for setup status.";
20031
20329
  }
20032
20330
  function finalize_claude_model_tiers(project_root) {
20033
- const claude_skills = path11.join(project_root, ".claude", "skills");
20034
- const augment_skills = path11.join(project_root, ".augment", "skills");
20331
+ const claude_skills = path12.join(project_root, ".claude", "skills");
20332
+ const augment_skills = path12.join(project_root, ".augment", "skills");
20035
20333
  if (!isDir(claude_skills) || !isDir(augment_skills)) return 0;
20036
20334
  if (_read_consumer_auto_switch(project_root) !== "auto") return 0;
20037
20335
  let rendered = 0;
20038
- const entries = fs13.readdirSync(claude_skills).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
20336
+ const entries = fs14.readdirSync(claude_skills).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
20039
20337
  for (const name of entries) {
20040
- const entry = path11.join(claude_skills, name);
20041
- const src_dir = path11.join(augment_skills, name);
20042
- const src_md = path11.join(src_dir, "SKILL.md");
20338
+ const entry = path12.join(claude_skills, name);
20339
+ const src_dir = path12.join(augment_skills, name);
20340
+ const src_md = path12.join(src_dir, "SKILL.md");
20043
20341
  let tier;
20044
20342
  try {
20045
20343
  tier = read_model_tier(src_md);
@@ -20048,22 +20346,22 @@ function finalize_claude_model_tiers(project_root) {
20048
20346
  }
20049
20347
  if (tier === null || !(tier in TIER_TO_CLAUDE_MODEL) || !isDir(src_dir)) continue;
20050
20348
  if (isSymlink(entry) || isFile(entry)) {
20051
- fs13.unlinkSync(entry);
20349
+ fs14.unlinkSync(entry);
20052
20350
  } else if (isDir(entry)) {
20053
- fs13.rmSync(entry, { recursive: true, force: true });
20351
+ fs14.rmSync(entry, { recursive: true, force: true });
20054
20352
  }
20055
20353
  mkdirp(entry);
20056
- const srcFiles = fs13.readdirSync(src_dir).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
20354
+ const srcFiles = fs14.readdirSync(src_dir).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
20057
20355
  for (const fname of srcFiles) {
20058
20356
  if (fname === "SKILL.md") {
20059
20357
  writeText(
20060
- path11.join(entry, "SKILL.md"),
20358
+ path12.join(entry, "SKILL.md"),
20061
20359
  render_native_model_md(readText(src_md), tier)
20062
20360
  );
20063
20361
  } else {
20064
- fs13.symlinkSync(
20065
- path11.join("../../../.augment/skills", name, fname),
20066
- path11.join(entry, fname)
20362
+ fs14.symlinkSync(
20363
+ path12.join("../../../.augment/skills", name, fname),
20364
+ path12.join(entry, fname)
20067
20365
  );
20068
20366
  }
20069
20367
  }
@@ -20081,7 +20379,7 @@ function _main_project_install(opts, project_root, parsed_tools, is_first_run) {
20081
20379
  let package_type;
20082
20380
  if (opts.package) {
20083
20381
  package_root = resolvePath(opts.package);
20084
- if (!pathExists(path11.join(package_root, "src", "config", "profiles", "minimal.ini"))) {
20382
+ if (!pathExists(path12.join(package_root, "src", "config", "profiles", "minimal.ini"))) {
20085
20383
  fail(`Invalid --package path (missing src/config/profiles/minimal.ini): ${package_root}`);
20086
20384
  }
20087
20385
  package_type = detect_package_type_for_project(project_root, package_root);
@@ -20216,9 +20514,9 @@ function _main_project_install(opts, project_root, parsed_tools, is_first_run) {
20216
20514
  function _resolvedArgv1() {
20217
20515
  if (process3.argv[1] === void 0) return void 0;
20218
20516
  try {
20219
- return fs13.realpathSync(path11.resolve(process3.argv[1]));
20517
+ return fs14.realpathSync(path12.resolve(process3.argv[1]));
20220
20518
  } catch {
20221
- return path11.resolve(process3.argv[1]);
20519
+ return path12.resolve(process3.argv[1]);
20222
20520
  }
20223
20521
  }
20224
20522
  var _argv1 = _resolvedArgv1();
@@ -20263,6 +20561,7 @@ export {
20263
20561
  _apply_payload_preview,
20264
20562
  _bridge_marker,
20265
20563
  _canonical_settings_target,
20564
+ _compute_active_pack_ids,
20266
20565
  _current_settings_surface,
20267
20566
  _detect_legacy_for_migration,
20268
20567
  _dry_run_summary,
@@ -20272,14 +20571,20 @@ export {
20272
20571
  _inject_packs,
20273
20572
  _is_agent_config_source_repo,
20274
20573
  _is_tool_enabled,
20574
+ _load_packs_registry,
20275
20575
  _merge_tools_aliases,
20276
20576
  _parse_legacy_settings,
20277
20577
  _parse_profile_ini,
20278
20578
  _parse_tools,
20579
+ _prune_lab_modules,
20580
+ _prune_modules_by,
20581
+ _prune_scoped_modules,
20279
20582
  _render_template,
20280
20583
  _replace_template_value,
20281
20584
  _replace_template_value_raw,
20585
+ _resolve_global_settings_doc,
20282
20586
  _resolve_scope,
20587
+ _resolve_scoped_projection,
20283
20588
  _resolve_settings_read,
20284
20589
  _team_setup_hint_line,
20285
20590
  _tools_was_all,