@event4u/agent-config 9.8.0 → 9.10.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 (1115) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +234 -295
  3. package/CONTRIBUTING.md +23 -7
  4. package/MIGRATION.md +20 -0
  5. package/README.md +55 -9
  6. package/dist/agent-src/commands/agent-status.md +12 -11
  7. package/dist/agent-src/commands/agents/audit.md +1 -1
  8. package/dist/agent-src/commands/agents/optimize.md +2 -2
  9. package/dist/agent-src/commands/agents/user/accept.md +115 -30
  10. package/dist/agent-src/commands/agents/user/delete.md +147 -0
  11. package/dist/agent-src/commands/agents/user/review.md +65 -28
  12. package/dist/agent-src/commands/agents/user/show.md +82 -29
  13. package/dist/agent-src/commands/agents/user/update.md +2 -2
  14. package/dist/agent-src/commands/agents/user.md +17 -4
  15. package/dist/agent-src/commands/agents.md +1 -1
  16. package/dist/agent-src/commands/check-current-md.md +3 -13
  17. package/dist/agent-src/commands/condense.md +28 -97
  18. package/dist/agent-src/commands/cost/report.md +7 -0
  19. package/dist/agent-src/commands/fix/portability.md +2 -10
  20. package/dist/agent-src/commands/fix/pr-comments-loop.md +136 -0
  21. package/dist/agent-src/commands/fix/refs.md +2 -10
  22. package/dist/agent-src/commands/fix/route.md +4 -3
  23. package/dist/agent-src/commands/fix.md +9 -6
  24. package/dist/agent-src/commands/ghostwriter.md +1 -1
  25. package/dist/agent-src/commands/humanize.md +2 -2
  26. package/dist/agent-src/commands/image.md +1 -1
  27. package/dist/agent-src/commands/jira-ticket.md +1 -1
  28. package/dist/agent-src/commands/memory/load.md +11 -0
  29. package/dist/agent-src/commands/optimize/augmentignore.md +1 -1
  30. package/dist/agent-src/commands/optimize/skills.md +3 -3
  31. package/dist/agent-src/commands/post-as.md +1 -1
  32. package/dist/agent-src/commands/pr/create.md +4 -4
  33. package/dist/agent-src/commands/profile/show.md +3 -3
  34. package/dist/agent-src/commands/research.md +1 -1
  35. package/dist/agent-src/commands/roadmap/ai-council.md +1 -1
  36. package/dist/agent-src/commands/rule-compliance-audit.md +5 -4
  37. package/dist/agent-src/commands/sync/gitignore/fix.md +1 -1
  38. package/dist/agent-src/commands/tdd.md +21 -0
  39. package/dist/agent-src/commands/team/delegate.md +4 -0
  40. package/dist/agent-src/commands/team-knowledge/bootstrap.md +9 -8
  41. package/dist/agent-src/commands/team-knowledge/consolidate.md +8 -7
  42. package/dist/agent-src/commands/team.md +4 -1
  43. package/dist/agent-src/commands/upstream-contribute.md +0 -1
  44. package/dist/agent-src/commands/video.md +1 -1
  45. package/dist/agent-src/contexts/authority/commit-mechanics.md +7 -0
  46. package/dist/agent-src/contexts/authority/destructive-mechanics.md +16 -0
  47. package/dist/agent-src/contexts/authority/kernel-rule-edits.md +1 -1
  48. package/dist/agent-src/contexts/authority/scope-mechanics.md +61 -0
  49. package/dist/agent-src/contexts/communication/rules-auto/reply-close-mechanics.md +20 -18
  50. package/dist/agent-src/contexts/communication/rules-auto/skill-quality-mechanics.md +1 -1
  51. package/dist/agent-src/contexts/communication/rules-auto/slash-command-routing-policy-mechanics.md +1 -1
  52. package/dist/agent-src/contexts/communication/rules-auto/source-of-truth-mechanics.md +9 -10
  53. package/dist/agent-src/contexts/communication/rules-auto/think-before-action-mechanics.md +1 -1
  54. package/dist/agent-src/contexts/communication/rules-auto/user-interaction-mechanics.md +11 -0
  55. package/dist/agent-src/contexts/contracts/artifact-engagement-flow.md +26 -15
  56. package/dist/agent-src/contexts/contracts/command-suggestion-flow.md +3 -0
  57. package/dist/agent-src/contexts/contracts/emergency-triage-block.md +2 -2
  58. package/dist/agent-src/contexts/execution/auto-dispatch-classification.md +99 -23
  59. package/dist/agent-src/contexts/execution/auto-orchestration-activation.md +1 -1
  60. package/dist/agent-src/contexts/execution/autonomy-examples.md +1 -1
  61. package/dist/agent-src/contexts/execution/autonomy-mechanics.md +7 -6
  62. package/dist/agent-src/contexts/execution/evidence-discipline.md +92 -77
  63. package/dist/agent-src/contexts/execution/orchestration-benchmark-gate.md +22 -21
  64. package/dist/agent-src/contexts/execution/orchestration-telemetry.md +34 -0
  65. package/dist/agent-src/contexts/execution/project-intelligence.md +122 -103
  66. package/dist/agent-src/contexts/execution/roadmap-execution-contract.md +23 -21
  67. package/dist/agent-src/contexts/execution/subagent-modes-detail.md +109 -8
  68. package/dist/agent-src/contexts/execution/subagent-response-contract.md +20 -0
  69. package/dist/agent-src/contexts/execution/subagent-routing.md +11 -0
  70. package/dist/agent-src/contexts/execution/subagent-spawn-contract.md +53 -3
  71. package/dist/agent-src/contexts/execution/subagent-steering.md +36 -34
  72. package/dist/agent-src/contexts/execution/toolchain-resolver.md +1 -1
  73. package/dist/agent-src/contexts/execution/user-memory-channels.md +189 -0
  74. package/dist/agent-src/contexts/execution/verification-mechanics.md +9 -0
  75. package/dist/agent-src/contexts/model-recommendations.md +3 -2
  76. package/dist/agent-src/contexts/subagent-configuration.md +3 -3
  77. package/dist/agent-src/ghostwriter/README.md +2 -2
  78. package/dist/agent-src/packs/README.md +1 -1
  79. package/dist/agent-src/personas/README.md +5 -5
  80. package/dist/agent-src/personas/_template-specialist/persona.md +3 -3
  81. package/dist/agent-src/personas/backend-architect.md +24 -23
  82. package/dist/agent-src/personas/eloquent-tamer.md +30 -30
  83. package/dist/agent-src/personas/frontend-engineer.md +30 -30
  84. package/dist/agent-src/personas/product-owner.md +41 -38
  85. package/dist/agent-src/personas/qa.md +13 -13
  86. package/dist/agent-src/personas/security-engineer.md +22 -22
  87. package/dist/agent-src/presets/README.md +3 -3
  88. package/dist/agent-src/profiles/README.md +3 -3
  89. package/dist/agent-src/rules/active-remediation.md +2 -2
  90. package/dist/agent-src/rules/artifact-engagement-recording.md +4 -4
  91. package/dist/agent-src/rules/ask-when-uncertain.md +0 -4
  92. package/dist/agent-src/rules/augment-edit-discipline.md +1 -1
  93. package/dist/agent-src/rules/broken-access-control.md +4 -4
  94. package/dist/agent-src/rules/code-comment-discipline.md +1 -1
  95. package/dist/agent-src/rules/code-provenance.md +112 -0
  96. package/dist/agent-src/rules/commit-policy.md +4 -9
  97. package/dist/agent-src/rules/communication-through-line.md +5 -5
  98. package/dist/agent-src/rules/decision-revisit-gate.md +1 -1
  99. package/dist/agent-src/rules/doc-screenshot-hygiene.md +1 -1
  100. package/dist/agent-src/rules/domain-adoption-policy.md +1 -1
  101. package/dist/agent-src/rules/domain-safety-pii.md +1 -1
  102. package/dist/agent-src/rules/external-code-graph-interop.md +5 -5
  103. package/dist/agent-src/rules/fast-path-marker-visibility.md +43 -7
  104. package/dist/agent-src/rules/finance-safety-floor.md +1 -1
  105. package/dist/agent-src/rules/framework-neutrality-in-generic-skills.md +3 -3
  106. package/dist/agent-src/rules/history-discipline.md +80 -0
  107. package/dist/agent-src/rules/legal-safety-floor.md +1 -1
  108. package/dist/agent-src/rules/lethal-trifecta-guard.md +5 -5
  109. package/dist/agent-src/rules/low-impact-corpus-privacy-floor.md +10 -8
  110. package/dist/agent-src/rules/media-governance-routing.md +13 -13
  111. package/dist/agent-src/rules/media-sync-ground-truth.md +29 -11
  112. package/dist/agent-src/rules/no-cheap-questions.md +7 -7
  113. package/dist/agent-src/rules/no-decorative-emojis-in-git-surfaces.md +29 -18
  114. package/dist/agent-src/rules/no-roadmap-references.md +1 -1
  115. package/dist/agent-src/rules/non-destructive-by-default.md +5 -23
  116. package/dist/agent-src/rules/onboarding-gate.md +14 -4
  117. package/dist/agent-src/rules/persona-governance.md +2 -2
  118. package/dist/agent-src/rules/php-coding.md +1 -0
  119. package/dist/agent-src/rules/prefer-enums-over-literals.md +9 -9
  120. package/dist/agent-src/rules/preservation-guard.md +10 -2
  121. package/dist/agent-src/rules/question-not-instruction.md +1 -1
  122. package/dist/agent-src/rules/reviewer-awareness.md +1 -0
  123. package/dist/agent-src/rules/roadmap-ci-steps-policy.md +1 -0
  124. package/dist/agent-src/rules/roadmap-progress-sync.md +7 -0
  125. package/dist/agent-src/rules/rule-type-governance.md +1 -1
  126. package/dist/agent-src/rules/scale-discipline.md +92 -0
  127. package/dist/agent-src/rules/scope-control.md +1 -1
  128. package/dist/agent-src/rules/secret-vcs-guard.md +1 -1
  129. package/dist/agent-src/rules/security-sensitive-stop.md +24 -8
  130. package/dist/agent-src/rules/senior-engineering-discipline.md +17 -17
  131. package/dist/agent-src/rules/session-canary.md +77 -0
  132. package/dist/agent-src/rules/skill-quality.md +1 -1
  133. package/dist/agent-src/rules/source-confidentiality.md +21 -19
  134. package/dist/agent-src/rules/source-of-truth.md +6 -5
  135. package/dist/agent-src/rules/spreadsheet-source-quality.md +2 -2
  136. package/dist/agent-src/rules/strategy-safety-floor.md +1 -1
  137. package/dist/agent-src/rules/think-before-action.md +5 -5
  138. package/dist/agent-src/rules/token-budget-discipline.md +5 -3
  139. package/dist/agent-src/rules/token-efficiency.md +2 -2
  140. package/dist/agent-src/rules/token-optimizer-maintenance.md +1 -1
  141. package/dist/agent-src/rules/tool-safety.md +3 -1
  142. package/dist/agent-src/rules/untrusted-input-defense.md +10 -0
  143. package/dist/agent-src/rules/user-interaction.md +12 -0
  144. package/dist/agent-src/rules/verify-before-complete.md +4 -24
  145. package/dist/agent-src/skills/adversarial-review/SKILL.md +2 -2
  146. package/dist/agent-src/skills/agent-security-review/SKILL.md +53 -46
  147. package/dist/agent-src/skills/agents-md-thin-root/SKILL.md +2 -2
  148. package/dist/agent-src/skills/ai-code-blindspots/SKILL.md +20 -20
  149. package/dist/agent-src/skills/ai-council/SKILL.md +185 -128
  150. package/dist/agent-src/skills/analysis-skill-router/SKILL.md +3 -3
  151. package/dist/agent-src/skills/api-endpoint/SKILL.md +2 -2
  152. package/dist/agent-src/skills/artisan-commands/SKILL.md +2 -2
  153. package/dist/agent-src/skills/async-python-patterns/SKILL.md +8 -7
  154. package/dist/agent-src/skills/authz-review/SKILL.md +16 -15
  155. package/dist/agent-src/skills/aws-infrastructure/SKILL.md +5 -5
  156. package/dist/agent-src/skills/blade-ui/SKILL.md +1 -1
  157. package/dist/agent-src/skills/bug-analyzer/SKILL.md +30 -12
  158. package/dist/agent-src/skills/code-intelligence/SKILL.md +17 -15
  159. package/dist/agent-src/skills/code-intelligence/evals/triggers.json +52 -0
  160. package/dist/agent-src/skills/code-review/SKILL.md +6 -6
  161. package/dist/agent-src/skills/command-routing/SKILL.md +5 -4
  162. package/dist/agent-src/skills/composer-packages/SKILL.md +2 -2
  163. package/dist/agent-src/skills/condense-memory/SKILL.md +43 -41
  164. package/dist/agent-src/skills/context-document/SKILL.md +23 -21
  165. package/dist/agent-src/skills/copilot-config/SKILL.md +6 -1
  166. package/dist/agent-src/skills/corpus-grounding/SKILL.md +0 -3
  167. package/dist/agent-src/skills/decision-record/SKILL.md +20 -18
  168. package/dist/agent-src/skills/description-assist/SKILL.md +1 -1
  169. package/dist/agent-src/skills/design-intelligence/SKILL.md +4 -4
  170. package/dist/agent-src/skills/design-review/SKILL.md +20 -20
  171. package/dist/agent-src/skills/design-system-capture/reference/design-system-json.md +28 -25
  172. package/dist/agent-src/skills/design-tokens/SKILL.md +0 -1
  173. package/dist/agent-src/skills/devcontainer/SKILL.md +2 -2
  174. package/dist/agent-src/skills/docker/SKILL.md +1 -1
  175. package/dist/agent-src/skills/docx-authoring/evals/triggers.json +52 -0
  176. package/dist/agent-src/skills/emit-tickets/SKILL.md +2 -2
  177. package/dist/agent-src/skills/error-handling-patterns/SKILL.md +1 -1
  178. package/dist/agent-src/skills/estimate-ticket/SKILL.md +2 -2
  179. package/dist/agent-src/skills/evaluate-llm-feature/SKILL.md +0 -1
  180. package/dist/agent-src/skills/evaluate-llm-feature/evals/triggers.json +52 -0
  181. package/dist/agent-src/skills/existing-ui-audit/SKILL.md +6 -5
  182. package/dist/agent-src/skills/feature-planning/SKILL.md +2 -2
  183. package/dist/agent-src/skills/finishing-a-development-branch/SKILL.md +3 -3
  184. package/dist/agent-src/skills/flux/SKILL.md +1 -1
  185. package/dist/agent-src/skills/frontend-render-security/SKILL.md +13 -13
  186. package/dist/agent-src/skills/git-workflow/SKILL.md +33 -33
  187. package/dist/agent-src/skills/grafana/SKILL.md +5 -0
  188. package/dist/agent-src/skills/history-design/SKILL.md +101 -0
  189. package/dist/agent-src/skills/history-design/evals/triggers.json +17 -0
  190. package/dist/agent-src/skills/humanizer/SKILL.md +84 -67
  191. package/dist/agent-src/skills/humanizer/data/patterns.md +14 -14
  192. package/dist/agent-src/skills/humanizer/references/anti-aiisms.md +4 -4
  193. package/dist/agent-src/skills/image-editing/SKILL.md +1 -1
  194. package/dist/agent-src/skills/image-generation/SKILL.md +2 -1
  195. package/dist/agent-src/skills/image-provider-routing/SKILL.md +2 -2
  196. package/dist/agent-src/skills/judge-artifact-completeness/SKILL.md +82 -37
  197. package/dist/agent-src/skills/judge-bug-hunter/SKILL.md +17 -5
  198. package/dist/agent-src/skills/judge-injection-defense/SKILL.md +63 -25
  199. package/dist/agent-src/skills/judge-security-auditor/SKILL.md +2 -0
  200. package/dist/agent-src/skills/judge-synthesis/SKILL.md +72 -28
  201. package/dist/agent-src/skills/laravel-horizon/SKILL.md +5 -0
  202. package/dist/agent-src/skills/laravel-mail/SKILL.md +5 -4
  203. package/dist/agent-src/skills/laravel-middleware/SKILL.md +5 -4
  204. package/dist/agent-src/skills/laravel-notifications/SKILL.md +10 -9
  205. package/dist/agent-src/skills/laravel-pennant/SKILL.md +1 -1
  206. package/dist/agent-src/skills/laravel-pulse/SKILL.md +9 -8
  207. package/dist/agent-src/skills/laravel-reverb/SKILL.md +6 -5
  208. package/dist/agent-src/skills/laravel-scheduling/SKILL.md +6 -1
  209. package/dist/agent-src/skills/laravel-validation/SKILL.md +12 -0
  210. package/dist/agent-src/skills/launch-readiness/SKILL.md +2 -2
  211. package/dist/agent-src/skills/learning-to-rule-or-skill/SKILL.md +7 -7
  212. package/dist/agent-src/skills/learning-tutor/SKILL.md +44 -43
  213. package/dist/agent-src/skills/learning-tutor/evals/triggers.json +52 -0
  214. package/dist/agent-src/skills/license-compliance-audit/SKILL.md +161 -0
  215. package/dist/agent-src/skills/license-compliance-audit/evals/triggers.json +52 -0
  216. package/dist/agent-src/skills/license-compliance-borrow-check/SKILL.md +145 -0
  217. package/dist/agent-src/skills/license-compliance-borrow-check/evals/triggers.json +52 -0
  218. package/dist/agent-src/skills/license-compliance-credits/SKILL.md +97 -0
  219. package/dist/agent-src/skills/license-compliance-credits/evals/triggers.json +52 -0
  220. package/dist/agent-src/skills/llm-provider-knowledge/SKILL.md +0 -1
  221. package/dist/agent-src/skills/md-language-check/SKILL.md +1 -1
  222. package/dist/agent-src/skills/memory-consolidation/SKILL.md +69 -64
  223. package/dist/agent-src/skills/motion-choreographer/SKILL.md +6 -6
  224. package/dist/agent-src/skills/override-management/SKILL.md +1 -1
  225. package/dist/agent-src/skills/pdf-tools/evals/triggers.json +52 -0
  226. package/dist/agent-src/skills/performance-analysis/SKILL.md +7 -3
  227. package/dist/agent-src/skills/persona-improvement/SKILL.md +0 -2
  228. package/dist/agent-src/skills/persona-improvement/evals/triggers.json +52 -0
  229. package/dist/agent-src/skills/php-coder/SKILL.md +10 -0
  230. package/dist/agent-src/skills/prediction-pool-optimizer/SKILL.md +136 -127
  231. package/dist/agent-src/skills/prediction-pool-optimizer/reference/ev-fixtures.md +36 -35
  232. package/dist/agent-src/skills/prediction-pool-optimizer/reference/odds-and-bonus.md +45 -41
  233. package/dist/agent-src/skills/project-analysis-core/SKILL.md +5 -5
  234. package/dist/agent-src/skills/project-analysis-hypothesis-driven/SKILL.md +3 -3
  235. package/dist/agent-src/skills/project-analysis-react/SKILL.md +1 -1
  236. package/dist/agent-src/skills/project-analysis-symfony/SKILL.md +1 -1
  237. package/dist/agent-src/skills/project-analysis-zend-laminas/SKILL.md +2 -2
  238. package/dist/agent-src/skills/prompt-engineering-image/SKILL.md +3 -2
  239. package/dist/agent-src/skills/prompt-engineering-patterns/SKILL.md +1 -1
  240. package/dist/agent-src/skills/prompt-validator/SKILL.md +39 -39
  241. package/dist/agent-src/skills/quality-tools/SKILL.md +15 -15
  242. package/dist/agent-src/skills/react-shadcn-ui/SKILL.md +57 -21
  243. package/dist/agent-src/skills/react-shadcn-ui/reference/registry.md +29 -27
  244. package/dist/agent-src/skills/readme-writing-package/SKILL.md +2 -2
  245. package/dist/agent-src/skills/reasoning-orchestrator/SKILL.md +25 -25
  246. package/dist/agent-src/skills/recursive-verification/SKILL.md +7 -0
  247. package/dist/agent-src/skills/refine-prompt/SKILL.md +1 -1
  248. package/dist/agent-src/skills/refine-ticket/SKILL.md +23 -5
  249. package/dist/agent-src/skills/repomix-packer/SKILL.md +1 -1
  250. package/dist/agent-src/skills/requesting-code-review/SKILL.md +2 -2
  251. package/dist/agent-src/skills/roadmap-management/SKILL.md +80 -66
  252. package/dist/agent-src/skills/roadmap-writing/SKILL.md +84 -73
  253. package/dist/agent-src/skills/rtk-output-filtering/SKILL.md +31 -12
  254. package/dist/agent-src/skills/rule-refactor/SKILL.md +4 -4
  255. package/dist/agent-src/skills/schema-review/SKILL.md +92 -0
  256. package/dist/agent-src/skills/schema-review/evals/triggers.json +17 -0
  257. package/dist/agent-src/skills/screenshot-hygiene/evals/triggers.json +52 -0
  258. package/dist/agent-src/skills/secrets-management/SKILL.md +3 -4
  259. package/dist/agent-src/skills/security-audit/SKILL.md +27 -10
  260. package/dist/agent-src/skills/security-maturity-assessment/SKILL.md +39 -17
  261. package/dist/agent-src/skills/skill-improvement-pipeline/SKILL.md +17 -14
  262. package/dist/agent-src/skills/skill-writing/SKILL.md +11 -10
  263. package/dist/agent-src/skills/song-to-script/SKILL.md +93 -85
  264. package/dist/agent-src/skills/source-discovery/SKILL.md +5 -5
  265. package/dist/agent-src/skills/sql-writing/SKILL.md +2 -2
  266. package/dist/agent-src/skills/stakeholder-tradeoff/SKILL.md +4 -3
  267. package/dist/agent-src/skills/standards-from-config/SKILL.md +61 -43
  268. package/dist/agent-src/skills/subagent-orchestration/SKILL.md +60 -86
  269. package/dist/agent-src/skills/subagent-orchestration/prompts/README.md +33 -6
  270. package/dist/agent-src/skills/supply-chain-intake/SKILL.md +13 -13
  271. package/dist/agent-src/skills/systematic-debugging/SKILL.md +24 -23
  272. package/dist/agent-src/skills/tailwind-engineer/SKILL.md +3 -4
  273. package/dist/agent-src/skills/technical-specification/SKILL.md +5 -0
  274. package/dist/agent-src/skills/terraform/SKILL.md +2 -2
  275. package/dist/agent-src/skills/terragrunt/SKILL.md +8 -8
  276. package/dist/agent-src/skills/testing-anti-patterns/process-anti-patterns.md +1 -1
  277. package/dist/agent-src/skills/threat-modeling/SKILL.md +19 -13
  278. package/dist/agent-src/skills/token-optimizer/SKILL.md +4 -4
  279. package/dist/agent-src/skills/universal-project-analysis/SKILL.md +1 -1
  280. package/dist/agent-src/skills/upstream-contribute/SKILL.md +0 -1
  281. package/dist/agent-src/skills/using-git-worktrees/SKILL.md +9 -9
  282. package/dist/agent-src/skills/validate-feature-fit/SKILL.md +3 -1
  283. package/dist/agent-src/skills/verify-completion-evidence/SKILL.md +4 -6
  284. package/dist/agent-src/skills/verify-repair-loop/SKILL.md +67 -61
  285. package/dist/agent-src/skills/video-director/SKILL.md +7 -7
  286. package/dist/agent-src/skills/worktree-lifecycle/SKILL.md +5 -6
  287. package/dist/agent-src/templates/AGENTS.md +1 -1
  288. package/dist/agent-src/templates/agents/.gitattributes.fragment +25 -6
  289. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  290. package/dist/agent-src/templates/command.md +3 -3
  291. package/dist/agent-src/templates/contexts/knowledge-pages.md +47 -45
  292. package/dist/agent-src/templates/contexts/lesson-card.md +2 -2
  293. package/dist/agent-src/templates/contexts/tenant-boundaries.md +2 -2
  294. package/dist/agent-src/templates/contexts.md +1 -1
  295. package/dist/agent-src/templates/features.md +1 -1
  296. package/dist/agent-src/templates/persona.md +2 -2
  297. package/dist/agent-src/templates/roadmaps.md +125 -116
  298. package/dist/agent-src/templates/rule.md +4 -3
  299. package/dist/agent-src/templates/scripts/pr_risk_review.ts +0 -0
  300. package/dist/agent-src/templates/scripts/telemetry/aggregator.ts +0 -0
  301. package/dist/agent-src/templates/scripts/telemetry/engagement.ts +77 -0
  302. package/dist/agent-src/templates/scripts/telemetry_record.ts +33 -1
  303. package/dist/agent-src/templates/scripts/tier_usage_report.ts +2 -2
  304. package/dist/agent-src/templates/scripts/work_engine/directives/ui/polish.ts +2 -2
  305. package/dist/agent-src/templates/scripts/work_engine/directives/ui/review.ts +1 -1
  306. package/dist/agent-src/user-types/README.md +8 -8
  307. package/dist/agent-src/user-types/galabau-field-crew.md +34 -33
  308. package/dist/agent-src/user-types/metalworking-shop.md +35 -34
  309. package/dist/agent-src/user-types/truck-driver.md +22 -20
  310. package/dist/cli/commands/doctorShell.js +20 -0
  311. package/dist/cli/commands/doctorShell.js.map +1 -1
  312. package/dist/cli/commands/rtkDetect.js +58 -0
  313. package/dist/cli/commands/rtkDetect.js.map +1 -0
  314. package/dist/cli/firstRunNotice.js +70 -0
  315. package/dist/cli/firstRunNotice.js.map +1 -0
  316. package/dist/cli/main.js +35 -3
  317. package/dist/cli/main.js.map +1 -1
  318. package/dist/cli/python/workspace_roles.js +2 -2
  319. package/dist/cli/python/workspace_roles.js.map +1 -1
  320. package/dist/cli/registry.js +7 -1
  321. package/dist/cli/registry.js.map +1 -1
  322. package/dist/discovery/deprecation-report.md +1 -1
  323. package/dist/discovery/discovery-manifest.json +429 -119
  324. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  325. package/dist/discovery/discovery-manifest.summary.md +6 -4
  326. package/dist/discovery/orphan-report.md +1 -1
  327. package/dist/discovery/packs.json +91 -8
  328. package/dist/discovery/trust-report.md +11 -11
  329. package/dist/discovery/workspaces.json +32 -7
  330. package/dist/hooks/dispatch.js +19649 -0
  331. package/dist/install/agentSwitchDetection.js +75 -0
  332. package/dist/install/agentSwitchDetection.js.map +1 -0
  333. package/dist/install/agentSwitchProfile.js +117 -0
  334. package/dist/install/agentSwitchProfile.js.map +1 -0
  335. package/dist/install/atomic.js +1 -1
  336. package/dist/install/detect.js +1 -1
  337. package/dist/install/install.mjs +783 -486
  338. package/dist/install/rtkDetection.js +213 -0
  339. package/dist/install/rtkDetection.js.map +1 -0
  340. package/dist/install/rule_scope.js +2 -1
  341. package/dist/install/rule_scope.js.map +1 -1
  342. package/dist/install/types.js +2 -2
  343. package/dist/install/wizard-plan.js +1 -1
  344. package/dist/install/wizardDismissals.js +58 -0
  345. package/dist/install/wizardDismissals.js.map +1 -0
  346. package/dist/mcp/awesome-mcp-servers.row.md +1 -1
  347. package/dist/mcp/mcp-cloudflare-catalogue.json +1 -1
  348. package/dist/mcp/registry-manifest.json +15 -4
  349. package/dist/mcp/server.json +20 -0
  350. package/dist/mcp/server.mjs +44634 -0
  351. package/dist/router.json +1 -1
  352. package/dist/scripts/_lib/compile_time_toggles.js +48 -0
  353. package/dist/scripts/_lib/compile_time_toggles.js.map +1 -0
  354. package/dist/scripts/condense.js +248 -224
  355. package/dist/scripts/condense.js.map +1 -1
  356. package/dist/server/app.js +4 -2
  357. package/dist/server/app.js.map +1 -1
  358. package/dist/server/io/sharedWriteCheck.js +101 -0
  359. package/dist/server/io/sharedWriteCheck.js.map +1 -0
  360. package/dist/server/routes/ping.js +14 -0
  361. package/dist/server/routes/ping.js.map +1 -1
  362. package/dist/server/routes/settings.js +21 -4
  363. package/dist/server/routes/settings.js.map +1 -1
  364. package/dist/server/routes/userMd.js +21 -4
  365. package/dist/server/routes/userMd.js.map +1 -1
  366. package/dist/server/routes/wizard.js +68 -25
  367. package/dist/server/routes/wizard.js.map +1 -1
  368. package/dist/server/schemas/settings.js +8 -2
  369. package/dist/server/schemas/settings.js.map +1 -1
  370. package/dist/shared/userMd/utils.js +30 -0
  371. package/dist/shared/userMd/utils.js.map +1 -1
  372. package/dist/ui/assets/index-BpSQt5vm.js +40 -0
  373. package/dist/ui/assets/index-BpSQt5vm.js.map +1 -0
  374. package/dist/ui/assets/index-jSfMW8_t.css +1 -0
  375. package/dist/ui/index.html +2 -2
  376. package/docs/MIGRATION.md +16 -0
  377. package/docs/guidelines/agent-infra/api-cost-levers.md +56 -5
  378. package/docs/guidelines/agent-infra/simplicity-and-goal-demos.md +93 -33
  379. package/docs/guidelines/component-oriented-and-oop-development.md +4 -2
  380. package/package.json +21 -11
  381. package/src/agent-src/templates/AGENTS.md +1 -1
  382. package/src/agent-src/templates/scripts/pr_risk_review.ts +0 -0
  383. package/src/agent-src/templates/scripts/telemetry/aggregator.ts +0 -0
  384. package/src/agent-src/templates/scripts/telemetry/engagement.ts +77 -0
  385. package/src/agent-src/templates/scripts/telemetry_record.ts +33 -1
  386. package/src/agent-src/templates/scripts/tier_usage_report.ts +2 -2
  387. package/src/agent-src/templates/scripts/work_engine/directives/ui/polish.ts +2 -2
  388. package/src/agent-src/templates/scripts/work_engine/directives/ui/review.ts +1 -1
  389. package/src/config/agent-settings.template.yml +84 -16
  390. package/src/config/ci-local-parity.yml +142 -0
  391. package/src/config/discovery/packs.yml +22 -0
  392. package/src/config/discovery/workspaces.yml +1 -1
  393. package/src/config/evaluator-budgets.json +47 -0
  394. package/src/config/gate-coverage.yml +127 -0
  395. package/src/config/hook-latency-budget.json +20 -0
  396. package/src/config/preamble-payload-budget.json +44 -0
  397. package/src/install/agentSwitchDetection.ts +90 -0
  398. package/src/install/agentSwitchProfile.ts +131 -0
  399. package/src/install/atomic.ts +1 -1
  400. package/src/install/detect.ts +1 -1
  401. package/src/install/rtkDetection.ts +274 -0
  402. package/src/install/rule_scope.ts +9 -2
  403. package/src/install/types.ts +2 -2
  404. package/src/install/wizard-plan.ts +1 -1
  405. package/src/install/wizardDismissals.ts +60 -0
  406. package/src/scripts/_cli/cmd_doctor.ts +139 -2
  407. package/src/scripts/_cli/cmd_memory_get.ts +197 -0
  408. package/src/scripts/_cli/cmd_refresh.ts +30 -0
  409. package/src/scripts/_dispatch.bash +81 -0
  410. package/src/scripts/_lib/agent_user_profile.ts +381 -0
  411. package/src/scripts/_lib/agents_overlay.ts +9 -0
  412. package/src/scripts/_lib/anchor_eval.ts +311 -0
  413. package/src/scripts/_lib/auto_dispatch.corpus.test.ts +64 -1
  414. package/src/scripts/_lib/auto_dispatch.ts +76 -0
  415. package/src/scripts/_lib/cc_transcript.ts +316 -0
  416. package/src/scripts/_lib/compile_time_toggles.ts +79 -0
  417. package/src/scripts/_lib/confusables.ts +101 -0
  418. package/src/scripts/_lib/detect_target_license.ts +714 -0
  419. package/src/scripts/_lib/duplicate_scope_census.ts +77 -0
  420. package/src/scripts/_lib/fixtures/secret-detector/negatives.txt +5 -0
  421. package/src/scripts/_lib/fixtures/secret-detector/positives.txt +4 -0
  422. package/src/scripts/_lib/install_drift.ts +194 -0
  423. package/src/scripts/_lib/managed_agents_folder.ts +181 -0
  424. package/src/scripts/_lib/memory_fts_index.ts +390 -0
  425. package/src/scripts/_lib/orchestration_record.ts +91 -2
  426. package/src/scripts/_lib/payload_hash_drift.ts +126 -0
  427. package/src/scripts/_lib/persistence/adapter_raw_sql.ts +443 -0
  428. package/src/scripts/_lib/persistence/detect_audit_coverage.ts +423 -0
  429. package/src/scripts/_lib/persistence/detect_bounded_reads.ts +154 -0
  430. package/src/scripts/_lib/persistence/detect_index_parity.ts +576 -0
  431. package/src/scripts/_lib/persistence/detect_n1_eloquent.ts +226 -0
  432. package/src/scripts/_lib/persistence/detect_offload.ts +441 -0
  433. package/src/scripts/_lib/persistence/detect_prisma_growth.ts +74 -0
  434. package/src/scripts/_lib/persistence/offload_catalog.ts +73 -0
  435. package/src/scripts/_lib/persistence/types.ts +109 -0
  436. package/src/scripts/_lib/preservation_migration.ts +291 -0
  437. package/src/scripts/_lib/retrieval_sanitize.ts +166 -2
  438. package/src/scripts/_lib/rtk_allowlist.ts +44 -0
  439. package/src/scripts/_lib/scan_scope.ts +115 -0
  440. package/src/scripts/_lib/secret_detector.test.ts +5 -0
  441. package/src/scripts/_lib/secret_detector.ts +9 -0
  442. package/src/scripts/_lib/secret_detector_adversarial.test.ts +116 -0
  443. package/src/scripts/_lib/spawn_env.ts +7 -0
  444. package/src/scripts/_lib/sqlite_guard.ts +191 -0
  445. package/src/scripts/_lib/subagent_spawn.ts +53 -0
  446. package/src/scripts/_lib/user_global_memory_audit.ts +187 -0
  447. package/src/scripts/_lib/user_global_observations.ts +830 -0
  448. package/src/scripts/_lib/user_global_revocations.ts +110 -0
  449. package/src/scripts/_lib/user_memory_gate_counters.ts +291 -0
  450. package/src/scripts/_lib/worker_budget.ts +107 -0
  451. package/src/scripts/ai_council/blind_review.ts +212 -0
  452. package/src/scripts/ai_council/budget_guard.ts +90 -11
  453. package/src/scripts/ai_council/bundler.ts +2 -2
  454. package/src/scripts/ai_council/clients.ts +59 -3
  455. package/src/scripts/ai_council/config.ts +50 -6
  456. package/src/scripts/ai_council/orchestrator.ts +127 -12
  457. package/src/scripts/ai_team/review_gate.ts +8 -10
  458. package/src/scripts/ai_team/team_dispatch.ts +65 -6
  459. package/src/scripts/anchor_eval_falsify.ts +198 -0
  460. package/src/scripts/anchor_scoring_run.ts +239 -0
  461. package/src/scripts/annotate_discovery.ts +1 -65
  462. package/src/scripts/audit_initial_context.ts +1 -1
  463. package/src/scripts/bench_cross_source_eval.ts +400 -0
  464. package/src/scripts/bench_honesty_score.ts +1093 -0
  465. package/src/scripts/bench_hook_latency.ts +218 -0
  466. package/src/scripts/bench_quality_run.ts +168 -4
  467. package/src/scripts/build_mcp_catalog.ts +275 -0
  468. package/src/scripts/build_mcp_registry_manifest.ts +46 -0
  469. package/src/scripts/build_proof.ts +45 -0
  470. package/src/scripts/cache_realization_report.ts +782 -0
  471. package/src/scripts/chat_history.ts +8 -5
  472. package/src/scripts/check_artefact_count_messaging.ts +5 -1
  473. package/src/scripts/check_augment_description_cap.ts +15 -4
  474. package/src/scripts/check_backstop_debt.ts +23 -13
  475. package/src/scripts/check_bundle_path_leakage.ts +343 -0
  476. package/src/scripts/check_ci_local_parity.ts +317 -0
  477. package/src/scripts/check_condensation.ts +96 -191
  478. package/src/scripts/check_context_paths.ts +38 -9
  479. package/src/scripts/check_evaluator_budgets.ts +99 -0
  480. package/src/scripts/check_gate_coverage.ts +299 -0
  481. package/src/scripts/check_iron_law_prominence.ts +22 -1
  482. package/src/scripts/check_kernel_prefix_stability.ts +0 -0
  483. package/src/scripts/check_knowledge_sharing.ts +12 -1
  484. package/src/scripts/check_no_external_sources.ts +2 -2
  485. package/src/scripts/check_no_new_legacy_path.ts +16 -6
  486. package/src/scripts/check_no_roadmap_refs.ts +22 -9
  487. package/src/scripts/check_originality_freshness.ts +167 -0
  488. package/src/scripts/check_preamble_payload_budget.ts +130 -0
  489. package/src/scripts/check_proposal.ts +0 -0
  490. package/src/scripts/check_references.ts +0 -1
  491. package/src/scripts/check_safety_floor_untouched.ts +171 -24
  492. package/src/scripts/check_site_links.ts +62 -3
  493. package/src/scripts/check_source_pointer_freshness.ts +28 -3
  494. package/src/scripts/ci_status.ts +0 -0
  495. package/src/scripts/cluster_near_miss_patterns.ts +0 -0
  496. package/src/scripts/code_graph/build.ts +0 -0
  497. package/src/scripts/code_graph/cli.ts +181 -9
  498. package/src/scripts/code_graph/detect.ts +52 -0
  499. package/src/scripts/code_graph/intent.ts +45 -0
  500. package/src/scripts/code_graph/query.ts +143 -29
  501. package/src/scripts/code_graph/sqlite_store.ts +174 -0
  502. package/src/scripts/command_suggester/types.ts +0 -0
  503. package/src/scripts/compile_router.ts +10 -14
  504. package/src/scripts/condense.sh +3 -4
  505. package/src/scripts/condense.ts +261 -234
  506. package/src/scripts/context_hygiene_hook.ts +8 -5
  507. package/src/scripts/cost/track.mjs +168 -33
  508. package/src/scripts/cost_summary.ts +33 -1
  509. package/src/scripts/council_cli.ts +171 -15
  510. package/src/scripts/detect_target_license.ts +203 -0
  511. package/src/scripts/discovery_graph.ts +0 -0
  512. package/src/scripts/encoding_corpus.ts +500 -0
  513. package/src/scripts/encoding_corpus_report.ts +216 -0
  514. package/src/scripts/evaluator_umbrella.sh +145 -0
  515. package/src/scripts/external_sources_denylist.json +5 -3
  516. package/src/scripts/first_run_gate_hook.ts +9 -5
  517. package/src/scripts/generate_index.ts +19 -2
  518. package/src/scripts/hermetic-install.sh +3 -3
  519. package/src/scripts/hook_manifest.yaml +55 -16
  520. package/src/scripts/hooks/block_kernel_rule_writes.ts +212 -0
  521. package/src/scripts/hooks/block_no_verify.ts +9 -9
  522. package/src/scripts/hooks/code_graph_nudge_hook.ts +11 -4
  523. package/src/scripts/hooks/concern_registry.ts +75 -0
  524. package/src/scripts/hooks/design_slop_hook.ts +8 -5
  525. package/src/scripts/hooks/dispatch_entry.ts +37 -0
  526. package/src/scripts/hooks/dispatch_hook.ts +176 -3
  527. package/src/scripts/hooks/hook_stdin.ts +42 -0
  528. package/src/scripts/hooks/rtk_wrap_hook.ts +26 -12
  529. package/src/scripts/hot_context_hook.ts +7 -6
  530. package/src/scripts/injection_scan_hook.ts +9 -1
  531. package/src/scripts/install +6 -6
  532. package/src/scripts/install-hooks.sh +6 -6
  533. package/src/scripts/install.sh +5 -4
  534. package/src/scripts/install.ts +264 -23
  535. package/src/scripts/learning_sidecar.ts +0 -0
  536. package/src/scripts/lint_budget_ownership.ts +89 -0
  537. package/src/scripts/lint_command_routing.ts +35 -5
  538. package/src/scripts/lint_command_verbs.ts +42 -9
  539. package/src/scripts/lint_confusables.ts +10 -72
  540. package/src/scripts/lint_consumer_internal_refs.ts +211 -0
  541. package/src/scripts/lint_discovery_vocabulary.ts +2 -0
  542. package/src/scripts/lint_documented_commands.ts +670 -0
  543. package/src/scripts/lint_featured_skills.ts +0 -0
  544. package/src/scripts/lint_framework_leakage.ts +17 -3
  545. package/src/scripts/lint_framework_leakage_allowlist.json +32 -0
  546. package/src/scripts/lint_governed_writes.ts +335 -0
  547. package/src/scripts/lint_hidden_unicode.ts +214 -0
  548. package/src/scripts/lint_load_context.ts +17 -5
  549. package/src/scripts/lint_mcp_registry_manifest.ts +26 -1
  550. package/src/scripts/lint_memory_tripwire.ts +186 -0
  551. package/src/scripts/lint_new_skill_gate.ts +9 -3
  552. package/src/scripts/lint_no_python_twin_rationale.ts +17 -2
  553. package/src/scripts/lint_originality.ts +1 -1
  554. package/src/scripts/lint_override_kernel_guard.ts +74 -26
  555. package/src/scripts/lint_persistence.ts +171 -0
  556. package/src/scripts/lint_pre_migration_refs.ts +106 -0
  557. package/src/scripts/lint_provenance.ts +547 -0
  558. package/src/scripts/lint_provenance_vocabulary.ts +437 -0
  559. package/src/scripts/lint_skill_originality.ts +1 -1
  560. package/src/scripts/lint_spawn_payload.ts +283 -0
  561. package/src/scripts/lint_store_boundary.ts +152 -0
  562. package/src/scripts/lint_ticket_buildable.ts +1 -1
  563. package/src/scripts/lint_versioned_cache.ts +7 -1
  564. package/src/scripts/mcp_server/__main__.ts +7 -2
  565. package/src/scripts/mcp_server/catalog.ts +23 -1
  566. package/src/scripts/mcp_server/consumer_tool_catalog.json +563 -193
  567. package/src/scripts/mcp_server/prompts.ts +6 -0
  568. package/src/scripts/mcp_server/tool_catalog_source.ts +332 -0
  569. package/src/scripts/mcp_server/tools.ts +57 -6
  570. package/src/scripts/mcp_telemetry_query.ts +2 -33
  571. package/src/scripts/mcp_telemetry_store.ts +64 -34
  572. package/src/scripts/measure_scope_dedup.ts +224 -0
  573. package/src/scripts/memory_learn_hook.ts +126 -0
  574. package/src/scripts/memory_lookup.ts +0 -0
  575. package/src/scripts/memory_replay_24.ts +312 -0
  576. package/src/scripts/memory_report.ts +16 -3
  577. package/src/scripts/memory_signal.ts +48 -0
  578. package/src/scripts/memory_status.ts +6 -0
  579. package/src/scripts/mine_session.ts +98 -0
  580. package/src/scripts/minimal_safe_diff_hook.ts +8 -5
  581. package/src/scripts/onboarding_gate_hook.ts +8 -5
  582. package/src/scripts/orchestration_payload_hash_drift.ts +145 -0
  583. package/src/scripts/orchestration_record.ts +16 -0
  584. package/src/scripts/pr_url_reminder_hook.ts +8 -1
  585. package/src/scripts/preamble_byte_census.ts +574 -0
  586. package/src/scripts/prepack-check.mjs +17 -0
  587. package/src/scripts/prepack_lifecycle_check.d.mts +8 -0
  588. package/src/scripts/prepack_lifecycle_check.mjs +82 -0
  589. package/src/scripts/probe_skill_registration.ts +2 -2
  590. package/src/scripts/profile_staleness_hook.ts +8 -7
  591. package/src/scripts/redact_hook_capture.ts +13 -0
  592. package/src/scripts/release.ts +65 -10
  593. package/src/scripts/report_install_drift.ts +109 -0
  594. package/src/scripts/roadmap_progress_hook.ts +8 -5
  595. package/src/scripts/router_telemetry.ts +1 -1
  596. package/src/scripts/schemas/license-policy.schema.json +89 -0
  597. package/src/scripts/schemas/provenance-borrow.schema.json +46 -0
  598. package/src/scripts/schemas/rule.schema.json +10 -0
  599. package/src/scripts/second_brain_retrieval.ts +14 -4
  600. package/src/scripts/self_review_gate.test.ts +173 -1
  601. package/src/scripts/self_review_gate.ts +155 -15
  602. package/src/scripts/session_canary_hook.ts +182 -0
  603. package/src/scripts/skill_linter.ts +5 -0
  604. package/src/scripts/smoke_quickstart.ts +2 -2
  605. package/src/scripts/surface-tiers.yml +2 -0
  606. package/src/scripts/surface_probe_hook.ts +8 -7
  607. package/src/scripts/sync_gitattributes.ts +310 -0
  608. package/src/scripts/team_review_gate_hook.ts +13 -16
  609. package/src/scripts/validate_pack_yaml.ts +0 -0
  610. package/src/scripts/verify_before_complete_hook.ts +8 -5
  611. package/src/scripts/wrapper_freshness_hook.ts +8 -7
  612. package/src/server/schemas/settings.ts +16 -2
  613. package/src/shared/userMd/utils.ts +31 -0
  614. package/dist/agent-src/rules/telegraph-speak.md +0 -87
  615. package/dist/ui/assets/index-BPFMZWUs.css +0 -1
  616. package/dist/ui/assets/index-CrmZ34Rg.js +0 -40
  617. package/dist/ui/assets/index-CrmZ34Rg.js.map +0 -1
  618. package/docs/CLAIMS.md +0 -286
  619. package/docs/DISTRIBUTION_CHECKLIST.md +0 -170
  620. package/docs/RELEASE_STORY_TEMPLATE.md +0 -37
  621. package/docs/SKILL_CENSUS.md +0 -352
  622. package/docs/adrs/cost/0001-hard-stop-hook.md +0 -114
  623. package/docs/adrs/cost/README.md +0 -9
  624. package/docs/adrs/memory/0001-consumer-side-snapshot.md +0 -119
  625. package/docs/adrs/memory/README.md +0 -10
  626. package/docs/adrs/router/0001-three-tier-routing.md +0 -119
  627. package/docs/adrs/router/README.md +0 -9
  628. package/docs/adrs/schema/0001-json-schema-frontmatter.md +0 -102
  629. package/docs/adrs/schema/README.md +0 -9
  630. package/docs/adrs/smoke/0001-per-tier-smoke-scripts.md +0 -99
  631. package/docs/adrs/smoke/README.md +0 -9
  632. package/docs/adrs/telegraph/0001-default-off-until-bench.md +0 -93
  633. package/docs/adrs/telegraph/README.md +0 -9
  634. package/docs/announcements/2026-05-non-dev-launch.md +0 -79
  635. package/docs/announcements/2026-07-honest-cost-sweep-launch.md +0 -84
  636. package/docs/anti-reskin-gate.md +0 -60
  637. package/docs/architecture/augment-projection.md +0 -70
  638. package/docs/architecture/claude-bundle.md +0 -77
  639. package/docs/architecture/current-onboard-baseline.md +0 -126
  640. package/docs/architecture/current-safety-behavior.md +0 -137
  641. package/docs/architecture/multi-tool-projection.md +0 -125
  642. package/docs/architecture/setup-vs-settings-shared-surface.md +0 -114
  643. package/docs/architecture/source-projection.md +0 -85
  644. package/docs/architecture.md +0 -390
  645. package/docs/archive/CHANGELOG-6.0.0-overview.md +0 -953
  646. package/docs/archive/CHANGELOG-7.0.0.md +0 -419
  647. package/docs/archive/CHANGELOG-pre-2.11.0.md +0 -141
  648. package/docs/archive/CHANGELOG-pre-2.15.0.md +0 -244
  649. package/docs/archive/CHANGELOG-pre-2.16.0.md +0 -48
  650. package/docs/archive/CHANGELOG-pre-2.17.0.md +0 -63
  651. package/docs/archive/CHANGELOG-pre-2.2.0.md +0 -2138
  652. package/docs/archive/CHANGELOG-pre-2.20.0.md +0 -159
  653. package/docs/archive/CHANGELOG-pre-2.25.0.md +0 -191
  654. package/docs/archive/CHANGELOG-pre-2.7.0.md +0 -185
  655. package/docs/archive/CHANGELOG-pre-3.0.0.md +0 -130
  656. package/docs/archive/CHANGELOG-pre-3.1.0.md +0 -167
  657. package/docs/archive/CHANGELOG-pre-3.2.0.md +0 -268
  658. package/docs/archive/CHANGELOG-pre-4.0.0.md +0 -80
  659. package/docs/archive/CHANGELOG-pre-4.5.0.md +0 -289
  660. package/docs/archive/CHANGELOG-pre-5.4.0.md +0 -260
  661. package/docs/archive/CHANGELOG-pre-5.9.0.md +0 -270
  662. package/docs/archive/CHANGELOG-pre-6.0.0.md +0 -473
  663. package/docs/archive/CHANGELOG-pre-7.0.0.md +0 -126
  664. package/docs/archive/CHANGELOG-pre-8.0.0.md +0 -301
  665. package/docs/archive/CHANGELOG-pre-8.1.0.md +0 -316
  666. package/docs/archive/CHANGELOG-pre-8.12.0.md +0 -304
  667. package/docs/archive/CHANGELOG-pre-8.9.0.md +0 -306
  668. package/docs/archive/CHANGELOG-pre-9.2.0.md +0 -276
  669. package/docs/artefact-census.md +0 -71
  670. package/docs/benchmark.md +0 -785
  671. package/docs/benchmark.pinned.yml +0 -31
  672. package/docs/benchmarks.md +0 -85
  673. package/docs/capability-matrix.md +0 -33
  674. package/docs/case-studies/_template.md +0 -60
  675. package/docs/case-studies/frontend-design-positioning.md +0 -86
  676. package/docs/catalog.md +0 -726
  677. package/docs/command-flows.md +0 -272
  678. package/docs/command-naming-audit.md +0 -60
  679. package/docs/comparison.yaml +0 -87
  680. package/docs/contracts/CHANGELOG-conventions.md +0 -149
  681. package/docs/contracts/STABILITY.md +0 -188
  682. package/docs/contracts/adoption-signal-floor.md +0 -127
  683. package/docs/contracts/adr-architectural-consensus-mechanism.md +0 -68
  684. package/docs/contracts/adr-chat-history-split.md +0 -140
  685. package/docs/contracts/adr-command-suggestion.md +0 -144
  686. package/docs/contracts/adr-forecast-construction-shape.md +0 -90
  687. package/docs/contracts/adr-gtm-context-spine.md +0 -116
  688. package/docs/contracts/adr-implement-ticket-runtime.md +0 -121
  689. package/docs/contracts/adr-install-user-type-axis.md +0 -107
  690. package/docs/contracts/adr-layout.md +0 -107
  691. package/docs/contracts/adr-level-6-productization.md +0 -145
  692. package/docs/contracts/adr-mcp-runtime.md +0 -128
  693. package/docs/contracts/adr-product-ui-track.md +0 -381
  694. package/docs/contracts/adr-prompt-driven-execution.md +0 -186
  695. package/docs/contracts/adr-settings-sync-engine.md +0 -128
  696. package/docs/contracts/adr-user-types-axis.md +0 -127
  697. package/docs/contracts/adr-wing4-context-spine.md +0 -126
  698. package/docs/contracts/agent-user-schema.md +0 -170
  699. package/docs/contracts/agents-layout.md +0 -148
  700. package/docs/contracts/agents-md-tech-stack.md +0 -75
  701. package/docs/contracts/ai-council-config.md +0 -829
  702. package/docs/contracts/ai-team-config.md +0 -224
  703. package/docs/contracts/analysis-memory-loop.md +0 -149
  704. package/docs/contracts/at-rest-encryption.md +0 -191
  705. package/docs/contracts/audit-log-v1.md +0 -150
  706. package/docs/contracts/auto-orchestration-v1.md +0 -70
  707. package/docs/contracts/benchmark-ab-contract.md +0 -106
  708. package/docs/contracts/benchmark-corpus-spec.md +0 -125
  709. package/docs/contracts/benchmark-report-schema.md +0 -113
  710. package/docs/contracts/branch-protection-policy.md +0 -139
  711. package/docs/contracts/brand-token-consumption.md +0 -74
  712. package/docs/contracts/capability-boundary.md +0 -69
  713. package/docs/contracts/capability-packs.md +0 -217
  714. package/docs/contracts/ci-cost-budget.md +0 -111
  715. package/docs/contracts/ci-green-floor.md +0 -141
  716. package/docs/contracts/command-category-governance.md +0 -84
  717. package/docs/contracts/command-clusters.md +0 -399
  718. package/docs/contracts/command-surface-tiers.md +0 -176
  719. package/docs/contracts/command-taxonomy.md +0 -137
  720. package/docs/contracts/condensation-default-kill-criterion.md +0 -116
  721. package/docs/contracts/config-presets.md +0 -144
  722. package/docs/contracts/conformance.md +0 -84
  723. package/docs/contracts/consumer-bridge.md +0 -73
  724. package/docs/contracts/context-paths.md +0 -101
  725. package/docs/contracts/context-spine.md +0 -179
  726. package/docs/contracts/cost-dashboard.md +0 -143
  727. package/docs/contracts/cost-enforcement.md +0 -134
  728. package/docs/contracts/cost-profile-defaults.md +0 -110
  729. package/docs/contracts/cost-summary-schema.md +0 -107
  730. package/docs/contracts/creative-pack-boundary.md +0 -63
  731. package/docs/contracts/cross-repo-retrieval.md +0 -64
  732. package/docs/contracts/cross-wing-handoff.md +0 -134
  733. package/docs/contracts/daily-workspace.md +0 -147
  734. package/docs/contracts/decision-engine-gates.md +0 -120
  735. package/docs/contracts/decision-trace-v1.md +0 -177
  736. package/docs/contracts/design-artifact-lifecycle.md +0 -93
  737. package/docs/contracts/design-artifact-verification.md +0 -153
  738. package/docs/contracts/discovery-manifest.md +0 -209
  739. package/docs/contracts/discovery-manifest.schema.json +0 -254
  740. package/docs/contracts/evidence-based-pruning.md +0 -102
  741. package/docs/contracts/explain-modes.md +0 -187
  742. package/docs/contracts/explain-trace.schema.json +0 -144
  743. package/docs/contracts/file-ownership-matrix.json +0 -13941
  744. package/docs/contracts/file-ownership-matrix.md +0 -135
  745. package/docs/contracts/frontmatter-contract.md +0 -140
  746. package/docs/contracts/ghostwriter-schema.md +0 -337
  747. package/docs/contracts/governance-enforcement-projection.md +0 -159
  748. package/docs/contracts/gui-wizard.md +0 -350
  749. package/docs/contracts/harness-expectations.md +0 -128
  750. package/docs/contracts/hook-architecture-v1.md +0 -325
  751. package/docs/contracts/host-agent-protocol.md +0 -110
  752. package/docs/contracts/implement-ticket-flow.md +0 -625
  753. package/docs/contracts/init-telemetry.md +0 -132
  754. package/docs/contracts/injected-block-authenticity-model.md +0 -66
  755. package/docs/contracts/install-layout.md +0 -249
  756. package/docs/contracts/install-scopes.md +0 -82
  757. package/docs/contracts/installed-tools-lockfile.md +0 -144
  758. package/docs/contracts/installer-agent-mode.md +0 -137
  759. package/docs/contracts/iron-law-overrides.txt +0 -26
  760. package/docs/contracts/kernel-membership.md +0 -339
  761. package/docs/contracts/linear-ai-rules-inclusion.md +0 -143
  762. package/docs/contracts/linear-ai-three-layers.md +0 -130
  763. package/docs/contracts/linter-structural-model.md +0 -181
  764. package/docs/contracts/load-context-budget-model.md +0 -259
  765. package/docs/contracts/load-context-schema.md +0 -220
  766. package/docs/contracts/local-analytics.md +0 -160
  767. package/docs/contracts/local-knowledge-ingestion.md +0 -96
  768. package/docs/contracts/local-server-api.md +0 -134
  769. package/docs/contracts/local-server-ports.md +0 -53
  770. package/docs/contracts/low-impact-corpus-format.md +0 -95
  771. package/docs/contracts/mcp-beta-criteria.md +0 -130
  772. package/docs/contracts/mcp-cloud-scope.md +0 -355
  773. package/docs/contracts/mcp-discovery-phase-notice.md +0 -60
  774. package/docs/contracts/mcp-phase-1-scope.md +0 -272
  775. package/docs/contracts/mcp-registry-manifest.schema.json +0 -129
  776. package/docs/contracts/mcp-tool-inventory.md +0 -64
  777. package/docs/contracts/mcp-tool-stub-envelope.md +0 -78
  778. package/docs/contracts/measurement-baseline.md +0 -103
  779. package/docs/contracts/memory-visibility-v1.md +0 -160
  780. package/docs/contracts/mental-models.md +0 -336
  781. package/docs/contracts/migrate-command.md +0 -233
  782. package/docs/contracts/multi-tool-projection-fidelity.md +0 -134
  783. package/docs/contracts/namespace.md +0 -125
  784. package/docs/contracts/no-runtime-boundary.md +0 -61
  785. package/docs/contracts/one-off-script-lifecycle.md +0 -110
  786. package/docs/contracts/orchestration-dsl-v1.md +0 -153
  787. package/docs/contracts/package-self-orientation.md +0 -163
  788. package/docs/contracts/pilot/agent-authority.md +0 -24
  789. package/docs/contracts/pilot/direct-answers.md +0 -70
  790. package/docs/contracts/pilot/language-and-tone.md +0 -63
  791. package/docs/contracts/plain-language-surface.md +0 -117
  792. package/docs/contracts/prelaunch-diagnostics.md +0 -151
  793. package/docs/contracts/profile-system.md +0 -167
  794. package/docs/contracts/reasoning-discipline-protocol.md +0 -83
  795. package/docs/contracts/release-pr-gating.md +0 -151
  796. package/docs/contracts/release-sizing.md +0 -107
  797. package/docs/contracts/release-trunk-sync.md +0 -105
  798. package/docs/contracts/review-lens-schema.md +0 -64
  799. package/docs/contracts/roadmap-complexity-standard.md +0 -138
  800. package/docs/contracts/role-experience.md +0 -125
  801. package/docs/contracts/router-blending.md +0 -71
  802. package/docs/contracts/rule-classification.md +0 -171
  803. package/docs/contracts/rule-interactions.md +0 -132
  804. package/docs/contracts/rule-interactions.yml +0 -260
  805. package/docs/contracts/rule-priority-hierarchy.md +0 -88
  806. package/docs/contracts/rule-router.md +0 -287
  807. package/docs/contracts/safety-model.md +0 -129
  808. package/docs/contracts/session-profile-overlay.md +0 -157
  809. package/docs/contracts/settings-api.md +0 -264
  810. package/docs/contracts/settings-gui-agent-mode.schema.json +0 -128
  811. package/docs/contracts/settings-sync-yaml-subset.md +0 -139
  812. package/docs/contracts/skill-bundled-assets.md +0 -62
  813. package/docs/contracts/skill-discovery.md +0 -80
  814. package/docs/contracts/skill-distribution-channels.md +0 -66
  815. package/docs/contracts/skill-domains.md +0 -144
  816. package/docs/contracts/skill-dry-run.md +0 -47
  817. package/docs/contracts/skill-family-map.yml +0 -915
  818. package/docs/contracts/smoke-contracts.md +0 -144
  819. package/docs/contracts/subagent-boundary.md +0 -74
  820. package/docs/contracts/surface-agent-contracts.md +0 -153
  821. package/docs/contracts/surface-matrix.md +0 -108
  822. package/docs/contracts/surface-tiers.md +0 -81
  823. package/docs/contracts/telegraph-telemetry.md +0 -83
  824. package/docs/contracts/ticket-bundle-format.md +0 -233
  825. package/docs/contracts/tier-3-contrib-plugin.md +0 -137
  826. package/docs/contracts/trust-and-safety.md +0 -144
  827. package/docs/contracts/ui-stack-extension.md +0 -237
  828. package/docs/contracts/ui-track-flow.md +0 -329
  829. package/docs/contracts/universal-skills.md +0 -91
  830. package/docs/contracts/user-type-schema.md +0 -146
  831. package/docs/contracts/value-dashboard-spec.md +0 -378
  832. package/docs/contracts/value-report-schema.md +0 -168
  833. package/docs/contracts/workflow-packs.md +0 -121
  834. package/docs/contracts/workspace-boundary.md +0 -84
  835. package/docs/contracts/workspace-documents.md +0 -144
  836. package/docs/contracts/write-engine.md +0 -182
  837. package/docs/cookbook.md +0 -152
  838. package/docs/customization.md +0 -696
  839. package/docs/decisions/ADR-001-kernel-swap-deferred.md +0 -109
  840. package/docs/decisions/ADR-002-kernel-bucket-overrides.md +0 -135
  841. package/docs/decisions/ADR-003-flat-cluster-subs-and-colon-syntax.md +0 -137
  842. package/docs/decisions/ADR-004-rule-governance-pruning.md +0 -240
  843. package/docs/decisions/ADR-005-subagent-worktrees.md +0 -120
  844. package/docs/decisions/ADR-006-skill-tools-python-pilot.md +0 -114
  845. package/docs/decisions/ADR-007-agent-discovery-scopes.md +0 -371
  846. package/docs/decisions/ADR-008-installed-tools-manifest.md +0 -160
  847. package/docs/decisions/ADR-009-event4u-namespace.md +0 -188
  848. package/docs/decisions/ADR-010-profile-pack-preset-boundary.md +0 -168
  849. package/docs/decisions/ADR-011-domain-pack-readiness.md +0 -213
  850. package/docs/decisions/ADR-012-typescript-cli-shell.md +0 -162
  851. package/docs/decisions/ADR-013-discovery-frontmatter-contract.md +0 -342
  852. package/docs/decisions/ADR-014-gui-framework-choice.md +0 -136
  853. package/docs/decisions/ADR-015-discovery-manifest-contract.md +0 -146
  854. package/docs/decisions/ADR-016-installer-architecture.md +0 -191
  855. package/docs/decisions/ADR-017-monorepo-physical-layout.md +0 -261
  856. package/docs/decisions/ADR-018-trust-and-safety-layer.md +0 -159
  857. package/docs/decisions/ADR-019-router-json-dist-location.md +0 -124
  858. package/docs/decisions/ADR-020-global-only-consumer-scope.md +0 -213
  859. package/docs/decisions/ADR-021-deployment-shape.md +0 -153
  860. package/docs/decisions/ADR-022-daily-workspace-decomposition.md +0 -140
  861. package/docs/decisions/ADR-023-host-agent-protocol.md +0 -129
  862. package/docs/decisions/ADR-024-workspace-v0-feature-floor.md +0 -126
  863. package/docs/decisions/ADR-025-workspace-chrome.md +0 -119
  864. package/docs/decisions/ADR-026-explain-mode-translation.md +0 -117
  865. package/docs/decisions/ADR-027-changelog-machine-vs-manual.md +0 -129
  866. package/docs/decisions/ADR-028-root-layout.md +0 -147
  867. package/docs/decisions/ADR-029-multi-workspace-deferred.md +0 -122
  868. package/docs/decisions/ADR-030-claude-code-command-projection.md +0 -147
  869. package/docs/decisions/ADR-031-validation-severity-tiers-and-projection-roundtrip.md +0 -97
  870. package/docs/decisions/ADR-032-linked-projects-scope.md +0 -122
  871. package/docs/decisions/ADR-033-distribution-identity-npm-primary.md +0 -81
  872. package/docs/decisions/ADR-034-per-skill-model-recommendation-transport.md +0 -63
  873. package/docs/decisions/ADR-035-model-capability-tiers.md +0 -104
  874. package/docs/decisions/ADR-036-global-install-browser-wizard-handoff.md +0 -106
  875. package/docs/decisions/ADR-037-cost-profile-untangle.md +0 -117
  876. package/docs/decisions/ADR-038-canonical-settings-path.md +0 -96
  877. package/docs/decisions/ADR-039-claude-skills-untracked.md +0 -139
  878. package/docs/decisions/ADR-040-execution-model-projection-time-filtering.md +0 -244
  879. package/docs/decisions/ADR-041-controlled-command-verbs.md +0 -133
  880. package/docs/decisions/ADR-042-runtime-resolver-decision-gate.md +0 -113
  881. package/docs/decisions/ADR-043-monorepo-collapse-to-src-domains.md +0 -128
  882. package/docs/decisions/ADR-044-command-naming-scheme-hyphenated.md +0 -250
  883. package/docs/decisions/ADR-045-src-source-layout-and-profiles-as-views.md +0 -111
  884. package/docs/decisions/ADR-046-thin-command-principle.md +0 -93
  885. package/docs/decisions/ADR-047-framework-neutral-stack-adaptive-commands.md +0 -94
  886. package/docs/decisions/ADR-048-command-justification-rule.md +0 -106
  887. package/docs/decisions/ADR-049-configuration-trust-boundary.md +0 -132
  888. package/docs/decisions/ADR-050-workspace-vs-package-root-boundary.md +0 -121
  889. package/docs/decisions/ADR-051-uncondensed-source-container-relocation.md +0 -114
  890. package/docs/decisions/ADR-052-packages-removal-and-pack-home-migration.md +0 -86
  891. package/docs/decisions/ADR-053-agents-namespace-dual-role-resolution.md +0 -132
  892. package/docs/decisions/ADR-054-rule-adherence-decay-triggered-restate.md +0 -143
  893. package/docs/decisions/ADR-055-flow-layer-data-model.md +0 -235
  894. package/docs/decisions/ADR-056-unvalidated-video-adapters-disposition.md +0 -124
  895. package/docs/decisions/ADR-057-consolidation-evidence-gate-outcomes.md +0 -135
  896. package/docs/decisions/ADR-058-condensed-output-relocation-to-dist.md +0 -94
  897. package/docs/decisions/ADR-059-render-resume-filesystem-as-state.md +0 -161
  898. package/docs/decisions/ADR-060-comfyui-sandbox-model.md +0 -154
  899. package/docs/decisions/ADR-061-corpus-grounding-layer.md +0 -230
  900. package/docs/decisions/ADR-062-encrypt-at-rest-store-architecture.md +0 -121
  901. package/docs/decisions/ADR-063-append-jsonl-encryption-deferred.md +0 -83
  902. package/docs/decisions/ADR-064-append-jsonl-per-record-encryption.md +0 -113
  903. package/docs/decisions/ADR-065-tier3-inbox-handoff-v0.md +0 -86
  904. package/docs/decisions/ADR-066-skill-body-prerendering.md +0 -93
  905. package/docs/decisions/ADR-067-glama-registry-listing.md +0 -259
  906. package/docs/decisions/ADR-068-host-tier-detection.md +0 -90
  907. package/docs/decisions/ADR-069-prompt-renderer.md +0 -97
  908. package/docs/decisions/ADR-070-tier1-drive-loop.md +0 -94
  909. package/docs/decisions/ADR-071-launch-drive-integration.md +0 -95
  910. package/docs/decisions/ADR-072-codex-gemini-drive-configs.md +0 -90
  911. package/docs/decisions/ADR-073-drive-health-kill-switch.md +0 -81
  912. package/docs/decisions/ADR-074-drive-kill-switch-auto-recovery.md +0 -84
  913. package/docs/decisions/ADR-075-workspace-gui-drive.md +0 -83
  914. package/docs/decisions/ADR-076-workspace-multi-turn.md +0 -92
  915. package/docs/decisions/ADR-077-workspace-followup-gui.md +0 -70
  916. package/docs/decisions/ADR-078-drive-health-panel.md +0 -70
  917. package/docs/decisions/ADR-079-workspace-host-picker.md +0 -81
  918. package/docs/decisions/ADR-080-host-session-expired-410.md +0 -92
  919. package/docs/decisions/ADR-081-drive-health-reset-and-410-affordance.md +0 -71
  920. package/docs/decisions/ADR-082-410-one-click-relaunch.md +0 -58
  921. package/docs/decisions/ADR-083-session-thread-and-arbitrary-continuation.md +0 -85
  922. package/docs/decisions/ADR-084-drive-health-refresh-on-drive.md +0 -52
  923. package/docs/decisions/ADR-085-mcp-stdio-end-user-distribution-shape.md +0 -158
  924. package/docs/decisions/ADR-086-read-only-cross-agent-mcp-discovery-helper.md +0 -171
  925. package/docs/decisions/ADR-087-installer-e2e-test-strategy.md +0 -111
  926. package/docs/decisions/ADR-088-no-external-runtime-federation.md +0 -144
  927. package/docs/decisions/ADR-089-lean-local-plugin-install.md +0 -111
  928. package/docs/decisions/ADR-090-visibility-command-frontmatter-field.md +0 -95
  929. package/docs/decisions/ADR-091-split-meta-capability-packs.md +0 -113
  930. package/docs/decisions/ADR-092-defer-command-tier-alias-removal.md +0 -117
  931. package/docs/decisions/ADR-093-ai-council-config-user-global.md +0 -117
  932. package/docs/decisions/ADR-094-agent-memory-layer-removal.md +0 -94
  933. package/docs/decisions/ADR-095-workspace-boundary-contract.md +0 -108
  934. package/docs/decisions/ADR-096-analysis-workbench.md +0 -110
  935. package/docs/decisions/ADR-097-mission-recipe-privilege-boundary.md +0 -121
  936. package/docs/decisions/ADR-098-evidence-first-structure-discovery.md +0 -154
  937. package/docs/decisions/ADR-099-file-first-pattern-library.md +0 -87
  938. package/docs/decisions/ADR-100-global-knowledge-card-sharing.md +0 -140
  939. package/docs/decisions/ADR-101-ticket-bundle-emission.md +0 -109
  940. package/docs/decisions/ADR-102-ticket-handoff-paste-and-mcp.md +0 -72
  941. package/docs/decisions/ADR-103-global-knowledge-default-off-until-measured.md +0 -92
  942. package/docs/decisions/ADR-104-ai-council-config-global-only.md +0 -119
  943. package/docs/decisions/ADR-105-automatic-subagent-orchestration.md +0 -108
  944. package/docs/decisions/ADR-106-recursive-verification-benchmark-gate.md +0 -126
  945. package/docs/decisions/ADR-107-legal-domain-pack-adoption.md +0 -70
  946. package/docs/decisions/ADR-108-open-source-forever-no-commercial-tier.md +0 -46
  947. package/docs/decisions/ADR-109-subagent-v1-contract.md +0 -248
  948. package/docs/decisions/ADR-110-discipline-profile-resolution-locus.md +0 -112
  949. package/docs/decisions/ADR-111-canonical-glama-listing.md +0 -97
  950. package/docs/decisions/ADR-112-stdio-lite-stays-read-only.md +0 -92
  951. package/docs/decisions/ADR-113-ci-native-release-label-trigger.md +0 -209
  952. package/docs/decisions/ADR-114-commit-policy-iron-law-override.md +0 -85
  953. package/docs/decisions/ADR-115-command-cluster-consolidation-phase-4.md +0 -91
  954. package/docs/decisions/ADR-116-memory-tripwire-activation-path.md +0 -144
  955. package/docs/decisions/ADR-117-subagents-auto-default-on.md +0 -89
  956. package/docs/decisions/ADR-118-loop-engineering-boundaries.md +0 -162
  957. package/docs/decisions/ADR-119-global-knowledge-default-on.md +0 -104
  958. package/docs/decisions/ADR-120-council-chairman-mode.md +0 -70
  959. package/docs/decisions/ADR-121-knowledge-sensitivity-classes.md +0 -90
  960. package/docs/decisions/ADR-122-adversarial-verification-council.md +0 -166
  961. package/docs/decisions/ADR-123-runtime-security-scope-and-spawn-hardening.md +0 -142
  962. package/docs/decisions/ADR-124-embedded-engine-doctrine.md +0 -255
  963. package/docs/decisions/ADR-125-doc-screenshot-anonymization.md +0 -131
  964. package/docs/decisions/ADR-126-internet-reach-operator-tooling.md +0 -254
  965. package/docs/decisions/ADR-127-enforcement-claims-must-resolve.md +0 -150
  966. package/docs/decisions/ADR-128-executable-evidence-and-measured-escalation.md +0 -201
  967. package/docs/decisions/ADR-200-python-to-typescript-migration.md +0 -203
  968. package/docs/decisions/ADR-rule-kernel-and-router.md +0 -133
  969. package/docs/decisions/INDEX.md +0 -157
  970. package/docs/decisions/engine-reclassification-2026-07.md +0 -104
  971. package/docs/deploy/connector-setup.md +0 -129
  972. package/docs/deploy/env-vars.md +0 -70
  973. package/docs/deploy/policy-cookbook.md +0 -130
  974. package/docs/deploy/quickstart.md +0 -112
  975. package/docs/deploy/small-team-recipe.md +0 -148
  976. package/docs/deploy/team-deployment-posture.md +0 -111
  977. package/docs/design/adversarial-council-eval.md +0 -106
  978. package/docs/design/council-vs-solo-baseline.md +0 -92
  979. package/docs/design/cross-model-parity-eval.md +0 -82
  980. package/docs/design/length-neutral-judge-rerun.md +0 -92
  981. package/docs/design/utilization-window-criteria.md +0 -51
  982. package/docs/development.md +0 -230
  983. package/docs/distribution/awesome-list-submission.md +0 -46
  984. package/docs/distribution/consumer-matrix.md +0 -96
  985. package/docs/distribution/launch-story-draft.md +0 -58
  986. package/docs/distribution/mcp-submission-checklist.md +0 -95
  987. package/docs/distribution/public-install-smoke.md +0 -68
  988. package/docs/distribution/registries.md +0 -126
  989. package/docs/distribution/registry-submissions.md +0 -85
  990. package/docs/distribution/telemetry-privacy.md +0 -128
  991. package/docs/distribution/telemetry-schema.md +0 -174
  992. package/docs/distribution/topics-equivalents-decay-policy.md +0 -51
  993. package/docs/end-to-end-walkthroughs.md +0 -165
  994. package/docs/enforcement-by-host.md +0 -51
  995. package/docs/examples/agent-user.example.md +0 -22
  996. package/docs/experiences/agency.md +0 -49
  997. package/docs/experiences/content_creator.md +0 -49
  998. package/docs/experiences/developer.md +0 -49
  999. package/docs/experiences/finance.md +0 -50
  1000. package/docs/experiences/founder.md +0 -49
  1001. package/docs/experiences/ops.md +0 -49
  1002. package/docs/featured-commands.md +0 -27
  1003. package/docs/featured-skills.md +0 -95
  1004. package/docs/flows.md +0 -67
  1005. package/docs/getting-started-by-role.md +0 -190
  1006. package/docs/getting-started-laravel.md +0 -72
  1007. package/docs/getting-started-local-stdio.md +0 -77
  1008. package/docs/getting-started.md +0 -254
  1009. package/docs/github-topics.md +0 -93
  1010. package/docs/governance-advantage.md +0 -72
  1011. package/docs/governance.md +0 -96
  1012. package/docs/guides/cross-repo-linked-projects.md +0 -93
  1013. package/docs/guides/cross-repo-retrieval.md +0 -61
  1014. package/docs/guides/frontend-design-corpus-refresh.md +0 -83
  1015. package/docs/guides/gated-platform-reads.md +0 -221
  1016. package/docs/guides/local-analytics.md +0 -125
  1017. package/docs/guides/local-knowledge.md +0 -127
  1018. package/docs/guides/skill-discovery.md +0 -71
  1019. package/docs/guides/skill-preview.md +0 -71
  1020. package/docs/hook-payload-capture.md +0 -221
  1021. package/docs/install-friction-report.md +0 -66
  1022. package/docs/installation.md +0 -959
  1023. package/docs/maintainers/branch-protection.md +0 -105
  1024. package/docs/maintainers/dev-mode.md +0 -106
  1025. package/docs/maintainers/optional-media-deps.md +0 -50
  1026. package/docs/maintainers/system-map.md +0 -85
  1027. package/docs/mcp-registries.md +0 -94
  1028. package/docs/mcp-server.md +0 -175
  1029. package/docs/mcp.md +0 -147
  1030. package/docs/media/proof-demo.cast +0 -14
  1031. package/docs/media/proof-demo.gif +0 -0
  1032. package/docs/migration/consumer-template-consumption-model.md +0 -145
  1033. package/docs/migration/divergences/README.md +0 -55
  1034. package/docs/migration/divergences/_template.md +0 -50
  1035. package/docs/migration/divergences/bench-stats-float-precision.md +0 -72
  1036. package/docs/migration/divergences/mcp-telemetry-node-sqlite.md +0 -61
  1037. package/docs/migration/divergences/pack-mcp-content-gzip-body.md +0 -53
  1038. package/docs/migration/divergences/src-scripts-build_cloud_bundle.md +0 -63
  1039. package/docs/migration/divergences/src-scripts-check_memory.md +0 -91
  1040. package/docs/migration/divergences/src-scripts-inventory_abstraction_budget.md +0 -65
  1041. package/docs/migration/divergences/src-scripts-lint_marketplace.md +0 -57
  1042. package/docs/migration/divergences/src-scripts-lint_mcp_registry_manifest.md +0 -70
  1043. package/docs/migration/divergences/src-scripts-spotcheck_thin_root.md +0 -60
  1044. package/docs/migration/divergences/src-scripts-validate_agent_settings.md +0 -58
  1045. package/docs/migration/node-floor.md +0 -86
  1046. package/docs/migration/v1-to-v2.md +0 -156
  1047. package/docs/migration/yaml-roundtrip-spike.md +0 -163
  1048. package/docs/migrations/commands-1.15.0.md +0 -117
  1049. package/docs/parity/bench-external.json +0 -58
  1050. package/docs/parity/bench.json +0 -41
  1051. package/docs/parity/command-frontmatter.md +0 -60
  1052. package/docs/parity/external-runtime.md +0 -46
  1053. package/docs/personas.md +0 -178
  1054. package/docs/positioning-evidence.md +0 -86
  1055. package/docs/profiles.md +0 -108
  1056. package/docs/proof.md +0 -252
  1057. package/docs/quality.md +0 -98
  1058. package/docs/readme-split-plan.md +0 -102
  1059. package/docs/recruits/_template.md +0 -81
  1060. package/docs/release-runbook.md +0 -141
  1061. package/docs/role-experiences.md +0 -19
  1062. package/docs/safety.md +0 -30
  1063. package/docs/second-brain-scope.md +0 -116
  1064. package/docs/self-review-gate.md +0 -65
  1065. package/docs/setup/enterprise-and-offline.md +0 -201
  1066. package/docs/setup/mcp-client-config.md +0 -358
  1067. package/docs/setup/mcp-cloud-endpoints.md +0 -116
  1068. package/docs/setup/mcp-cloud-registry-listing.md +0 -99
  1069. package/docs/setup/mcp-cloud-setup.md +0 -183
  1070. package/docs/setup/mcp-r2-bootstrap.md +0 -82
  1071. package/docs/setup/mcp-server-docker.md +0 -101
  1072. package/docs/setup/per-ide/aider.md +0 -48
  1073. package/docs/setup/per-ide/antigravity.md +0 -68
  1074. package/docs/setup/per-ide/augment.md +0 -89
  1075. package/docs/setup/per-ide/claude-code.md +0 -97
  1076. package/docs/setup/per-ide/claude-desktop.md +0 -207
  1077. package/docs/setup/per-ide/cline.md +0 -43
  1078. package/docs/setup/per-ide/codebuddy.md +0 -63
  1079. package/docs/setup/per-ide/codex.md +0 -46
  1080. package/docs/setup/per-ide/continue.md +0 -68
  1081. package/docs/setup/per-ide/copilot.md +0 -80
  1082. package/docs/setup/per-ide/cursor.md +0 -125
  1083. package/docs/setup/per-ide/droid.md +0 -65
  1084. package/docs/setup/per-ide/gemini-cli.md +0 -45
  1085. package/docs/setup/per-ide/jetbrains.md +0 -76
  1086. package/docs/setup/per-ide/kilocode.md +0 -66
  1087. package/docs/setup/per-ide/kiro.md +0 -72
  1088. package/docs/setup/per-ide/opencode.md +0 -62
  1089. package/docs/setup/per-ide/qoder.md +0 -63
  1090. package/docs/setup/per-ide/roocode.md +0 -68
  1091. package/docs/setup/per-ide/trae.md +0 -63
  1092. package/docs/setup/per-ide/warp.md +0 -63
  1093. package/docs/setup/per-ide/windsurf.md +0 -109
  1094. package/docs/setup/per-ide/zed.md +0 -73
  1095. package/docs/showcase.md +0 -209
  1096. package/docs/skill-duplication-findings.md +0 -91
  1097. package/docs/skills-catalog.md +0 -265
  1098. package/docs/skills-taxonomy.md +0 -90
  1099. package/docs/spawn-site-policy.md +0 -72
  1100. package/docs/succession.md +0 -80
  1101. package/docs/threat-model.md +0 -30
  1102. package/docs/troubleshooting.md +0 -155
  1103. package/docs/ui-track-mental-model.md +0 -121
  1104. package/docs/us-vs-the-category.md +0 -38
  1105. package/docs/value.md +0 -86
  1106. package/docs/walkthroughs/assets/workspace-role-grid.png +0 -0
  1107. package/docs/walkthroughs/assets/workspace-session-started.png +0 -0
  1108. package/docs/walkthroughs/assets/workspace-task-picker.png +0 -0
  1109. package/docs/walkthroughs/daily-workspace-a11y.md +0 -87
  1110. package/docs/walkthroughs/daily-workspace.md +0 -127
  1111. package/docs/wedge/production-validator/README.md +0 -81
  1112. package/docs/wedge/production-validator/first-run-check.sh +0 -42
  1113. package/docs/wedge/production-validator/production-validator.md +0 -83
  1114. package/docs/wizard.md +0 -173
  1115. package/src/scripts/postinstall_gui.ts +0 -129
@@ -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
  ),
@@ -14168,6 +14302,14 @@ var settingsSchema = external_exports.object({
14168
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)."
14169
14303
  )
14170
14304
  }).default({ identity_allowlist: [], forbid_terminal_capture: true, data_bearing_gate: "on" }),
14305
+ telegraph: external_exports.object({
14306
+ speak: external_exports.boolean().default(false).describe(
14307
+ "Whether the telegraph-speak rule ships at all. false (default) = DORMANT: compile_router omits the rule from dist/router.json entirely, so its body never reaches a host. This \u2014 not speak_scope \u2014 is the lever that stops the cost. Set true only after an output-side bench clears the kill-criterion bar (docs/adrs/telegraph/0002)."
14308
+ ),
14309
+ speak_scope: external_exports.enum(["off", "reply", "all"]).default("off").describe(
14310
+ "Where telegraph condensation applies WHEN speak is true. off (default) = agent reply prose is exempt. compile_router never reads this key: with speak false the rule does not ship, so this setting has no effect on its own. Quote the value in YAML \u2014 bare `off` parses as a boolean under YAML 1.1 and is rejected."
14311
+ )
14312
+ }).default({ speak: false, speak_scope: "off" }),
14171
14313
  tokens: external_exports.object({
14172
14314
  rich_skills: richSkillsMode.default("on").describe(
14173
14315
  "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."
@@ -14340,6 +14482,9 @@ var settingsSchema = external_exports.object({
14340
14482
  ),
14341
14483
  session_index: external_exports.enum(["on", "off"]).default("off").describe(
14342
14484
  "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."
14485
+ ),
14486
+ learn_on_session_end: external_exports.boolean().default(false).describe(
14487
+ "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."
14343
14488
  )
14344
14489
  }),
14345
14490
  knowledge: external_exports.object({
@@ -14390,7 +14535,7 @@ var settingsSchema = external_exports.object({
14390
14535
  }).default({}),
14391
14536
  rtk_wrap: external_exports.object({
14392
14537
  enabled: external_exports.boolean().default(false).describe(
14393
- '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.'
14538
+ '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.'
14394
14539
  )
14395
14540
  }).default({}),
14396
14541
  design_slop: external_exports.object({
@@ -15735,8 +15880,8 @@ var zodToJsonSchema = (schema, options) => {
15735
15880
  };
15736
15881
 
15737
15882
  // src/scripts/_lib/module_detection.ts
15738
- import * as fs10 from "node:fs";
15739
- import * as path9 from "node:path";
15883
+ import * as fs11 from "node:fs";
15884
+ import * as path10 from "node:path";
15740
15885
  var _SKIP_DIRS = /* @__PURE__ */ new Set([".module-template", ".example"]);
15741
15886
  var _RULES = [
15742
15887
  ["app/Modules", "laravel-hmvc", "App\\Modules\\{ModuleName}"],
@@ -15750,14 +15895,14 @@ var _RULES = [
15750
15895
  ];
15751
15896
  function _isDir(p) {
15752
15897
  try {
15753
- return fs10.statSync(p).isDirectory();
15898
+ return fs11.statSync(p).isDirectory();
15754
15899
  } catch {
15755
15900
  return false;
15756
15901
  }
15757
15902
  }
15758
15903
  function _isFile(p) {
15759
15904
  try {
15760
- return fs10.statSync(p).isFile();
15905
+ return fs11.statSync(p).isFile();
15761
15906
  } catch {
15762
15907
  return false;
15763
15908
  }
@@ -15771,13 +15916,13 @@ function _isUpperChar(ch) {
15771
15916
  function _list_module_subdirs(root) {
15772
15917
  let entries;
15773
15918
  try {
15774
- entries = fs10.readdirSync(root).sort();
15919
+ entries = fs11.readdirSync(root).sort();
15775
15920
  } catch {
15776
15921
  return [];
15777
15922
  }
15778
15923
  const out = [];
15779
15924
  for (const name of entries) {
15780
- if (!_isDir(path9.join(root, name))) {
15925
+ if (!_isDir(path10.join(root, name))) {
15781
15926
  continue;
15782
15927
  }
15783
15928
  if (name.startsWith(".")) {
@@ -15799,11 +15944,11 @@ function _score_confidence(stack, root, subdirs) {
15799
15944
  return capitalized.length > 0 ? "high" : "medium";
15800
15945
  }
15801
15946
  if (stack === "node-monorepo") {
15802
- const withPkgJson = subdirs.filter((name) => _isFile(path9.join(root, name, "package.json")));
15947
+ const withPkgJson = subdirs.filter((name) => _isFile(path10.join(root, name, "package.json")));
15803
15948
  return withPkgJson.length > 0 ? "high" : "medium";
15804
15949
  }
15805
15950
  if (stack === "python-src") {
15806
- const withInit = subdirs.filter((name) => _isFile(path9.join(root, name, "__init__.py")));
15951
+ const withInit = subdirs.filter((name) => _isFile(path10.join(root, name, "__init__.py")));
15807
15952
  return withInit.length > 0 ? "high" : "medium";
15808
15953
  }
15809
15954
  if (stack === "go-internal") {
@@ -15815,7 +15960,7 @@ function detect_module_roots(project_root) {
15815
15960
  const high = [];
15816
15961
  const medium = [];
15817
15962
  for (const [rel_path, stack, namespace_template] of _RULES) {
15818
- const abs_path = path9.join(project_root, rel_path);
15963
+ const abs_path = path10.join(project_root, rel_path);
15819
15964
  if (!_isDir(abs_path)) {
15820
15965
  continue;
15821
15966
  }
@@ -15837,7 +15982,7 @@ function detect_module_roots(project_root) {
15837
15982
  }
15838
15983
 
15839
15984
  // src/scripts/_lib/model_tier.ts
15840
- import fs11 from "node:fs";
15985
+ import fs12 from "node:fs";
15841
15986
  var TIER_TO_CLAUDE_MODEL = {
15842
15987
  high: "opus",
15843
15988
  medium: "sonnet",
@@ -15845,8 +15990,8 @@ var TIER_TO_CLAUDE_MODEL = {
15845
15990
  };
15846
15991
  var MODEL_TIER_RE = /^model_tier:\s*"?([a-z]+)"?\s*$/m;
15847
15992
  function read_model_tier(skill_md) {
15848
- if (!fs11.existsSync(skill_md)) return null;
15849
- const text = fs11.readFileSync(skill_md).toString("utf-8");
15993
+ if (!fs12.existsSync(skill_md)) return null;
15994
+ const text = fs12.readFileSync(skill_md).toString("utf-8");
15850
15995
  if (!text.startsWith("---\n")) return null;
15851
15996
  const end = text.indexOf("\n---\n", 4);
15852
15997
  if (end === -1) return null;
@@ -15863,8 +16008,8 @@ function render_native_model_md(text, tier) {
15863
16008
 
15864
16009
  // src/scripts/_cli/cmd_migrate.ts
15865
16010
  import { spawnSync } from "node:child_process";
15866
- import * as fs12 from "node:fs";
15867
- import * as path10 from "node:path";
16011
+ import * as fs13 from "node:fs";
16012
+ import * as path11 from "node:path";
15868
16013
  import process2 from "node:process";
15869
16014
  import { fileURLToPath as fileURLToPath2, pathToFileURL } from "node:url";
15870
16015
  var PACKAGE_NAME_NPM = "@event4u/agent-config";
@@ -15884,7 +16029,7 @@ var LEGACY_SETTINGS_FILES = [".agent-settings.yml", ".agent-user.yml"];
15884
16029
  var LEGACY_STATE_FILENAME = ".implement-ticket-state.json";
15885
16030
  var LEGACY_STATE_V1_FILENAME = ".work-state.json";
15886
16031
  var LEGACY_AGENT_CONFIG_SHELL = "agent-config";
15887
- var _HERE_DIR = path10.dirname(fileURLToPath2(import.meta.url));
16032
+ var _HERE_DIR = path11.dirname(fileURLToPath2(import.meta.url));
15888
16033
  var ArgparseExit = class extends Error {
15889
16034
  code;
15890
16035
  constructor(code) {
@@ -15983,38 +16128,38 @@ function _jsonDumpsIndentAscii(value, indent) {
15983
16128
  }
15984
16129
  function _isFile2(p) {
15985
16130
  try {
15986
- return fs12.statSync(p).isFile();
16131
+ return fs13.statSync(p).isFile();
15987
16132
  } catch {
15988
16133
  return false;
15989
16134
  }
15990
16135
  }
15991
16136
  function _isDir2(p) {
15992
16137
  try {
15993
- return fs12.statSync(p).isDirectory();
16138
+ return fs13.statSync(p).isDirectory();
15994
16139
  } catch {
15995
16140
  return false;
15996
16141
  }
15997
16142
  }
15998
16143
  function _isSymlink(p) {
15999
16144
  try {
16000
- return fs12.lstatSync(p).isSymbolicLink();
16145
+ return fs13.lstatSync(p).isSymbolicLink();
16001
16146
  } catch {
16002
16147
  return false;
16003
16148
  }
16004
16149
  }
16005
16150
  function _exists2(p) {
16006
16151
  try {
16007
- fs12.lstatSync(p);
16152
+ fs13.lstatSync(p);
16008
16153
  return true;
16009
16154
  } catch {
16010
16155
  return false;
16011
16156
  }
16012
16157
  }
16013
16158
  function _readText(p) {
16014
- return fs12.readFileSync(p, { encoding: "utf-8" });
16159
+ return fs13.readFileSync(p, { encoding: "utf-8" });
16015
16160
  }
16016
16161
  function _writeText(p, text) {
16017
- fs12.writeFileSync(p, text, { encoding: "utf-8" });
16162
+ fs13.writeFileSync(p, text, { encoding: "utf-8" });
16018
16163
  }
16019
16164
  function _jsonLoadFile(p) {
16020
16165
  return JSON.parse(_readText(p));
@@ -16070,7 +16215,7 @@ function _classify_symlink(link) {
16070
16215
  }
16071
16216
  let target;
16072
16217
  try {
16073
- target = fs12.readlinkSync(link);
16218
+ target = fs13.readlinkSync(link);
16074
16219
  } catch {
16075
16220
  return null;
16076
16221
  }
@@ -16081,16 +16226,16 @@ function _classify_symlink(link) {
16081
16226
  return "user";
16082
16227
  }
16083
16228
  function _detect_legacy_state(project) {
16084
- return _isFile2(path10.join(project, LEGACY_STATE_FILENAME));
16229
+ return _isFile2(path11.join(project, LEGACY_STATE_FILENAME));
16085
16230
  }
16086
16231
  function _detect_legacy_settings(project) {
16087
16232
  const found = [];
16088
16233
  for (const name of LEGACY_SETTINGS_FILES) {
16089
- const flat = path10.join(project, name);
16234
+ const flat = path11.join(project, name);
16090
16235
  if (_isFile2(flat)) {
16091
16236
  found.push(flat);
16092
16237
  }
16093
- const typed = path10.join(project, "settings", name);
16238
+ const typed = path11.join(project, "settings", name);
16094
16239
  if (_isFile2(typed)) {
16095
16240
  found.push(typed);
16096
16241
  }
@@ -16098,25 +16243,25 @@ function _detect_legacy_settings(project) {
16098
16243
  return found;
16099
16244
  }
16100
16245
  function _detect_empty_shell(project) {
16101
- const shell = path10.join(project, LEGACY_AGENT_CONFIG_SHELL);
16246
+ const shell = path11.join(project, LEGACY_AGENT_CONFIG_SHELL);
16102
16247
  if (!_isDir2(shell) || _isSymlink(shell)) {
16103
16248
  return false;
16104
16249
  }
16105
16250
  try {
16106
- return fs12.readdirSync(shell).length === 0;
16251
+ return fs13.readdirSync(shell).length === 0;
16107
16252
  } catch {
16108
16253
  return false;
16109
16254
  }
16110
16255
  }
16111
16256
  function _detect_already_migrated(project) {
16112
- if (_detect_npm(path10.join(project, "package.json"))) {
16257
+ if (_detect_npm(path11.join(project, "package.json"))) {
16113
16258
  return false;
16114
16259
  }
16115
- if (_detect_composer(path10.join(project, "composer.json"))) {
16260
+ if (_detect_composer(path11.join(project, "composer.json"))) {
16116
16261
  return false;
16117
16262
  }
16118
16263
  for (const name of MANAGED_SYMLINKS) {
16119
- if (_classify_symlink(path10.join(project, name)) === "legacy") {
16264
+ if (_classify_symlink(path11.join(project, name)) === "legacy") {
16120
16265
  return false;
16121
16266
  }
16122
16267
  }
@@ -16187,11 +16332,11 @@ function _purge_legacy_symlinks(project) {
16187
16332
  const removed = [];
16188
16333
  const preserved = [];
16189
16334
  for (const name of MANAGED_SYMLINKS) {
16190
- const link = path10.join(project, name);
16335
+ const link = path11.join(project, name);
16191
16336
  const kind = _classify_symlink(link);
16192
16337
  if (kind === "legacy") {
16193
16338
  try {
16194
- fs12.unlinkSync(link);
16339
+ fs13.unlinkSync(link);
16195
16340
  removed.push(name);
16196
16341
  } catch {
16197
16342
  preserved.push(name);
@@ -16203,14 +16348,14 @@ function _purge_legacy_symlinks(project) {
16203
16348
  return [removed, preserved];
16204
16349
  }
16205
16350
  function _migrate_state_file(project) {
16206
- const source = path10.join(project, LEGACY_STATE_FILENAME);
16351
+ const source = path11.join(project, LEGACY_STATE_FILENAME);
16207
16352
  if (!_isFile2(source)) {
16208
16353
  return null;
16209
16354
  }
16210
- const target = path10.join(project, LEGACY_STATE_V1_FILENAME);
16355
+ const target = path11.join(project, LEGACY_STATE_V1_FILENAME);
16211
16356
  if (_exists2(target)) {
16212
16357
  try {
16213
- fs12.unlinkSync(source);
16358
+ fs13.unlinkSync(source);
16214
16359
  return `removed stale ${LEGACY_STATE_FILENAME} (v1 already present)`;
16215
16360
  } catch {
16216
16361
  return null;
@@ -16224,8 +16369,8 @@ function _migrate_state_file(project) {
16224
16369
  return `migrated ${LEGACY_STATE_FILENAME} \u2192 ${LEGACY_STATE_V1_FILENAME}`;
16225
16370
  }
16226
16371
  function _load_state_migrator() {
16227
- const pkg_root = path10.resolve(_HERE_DIR, "..", "..", "..");
16228
- const rel = path10.join(
16372
+ const pkg_root = path11.resolve(_HERE_DIR, "..", "..", "..");
16373
+ const rel = path11.join(
16229
16374
  "agent-src",
16230
16375
  "templates",
16231
16376
  "scripts",
@@ -16233,8 +16378,8 @@ function _load_state_migrator() {
16233
16378
  "migration",
16234
16379
  "v0_to_v1.ts"
16235
16380
  );
16236
- const driver = [path10.join(pkg_root, "dist", rel), path10.join(pkg_root, "src", rel)].find(
16237
- (p) => fs12.existsSync(p)
16381
+ const driver = [path11.join(pkg_root, "dist", rel), path11.join(pkg_root, "src", rel)].find(
16382
+ (p) => fs13.existsSync(p)
16238
16383
  ) ?? null;
16239
16384
  if (driver === null) {
16240
16385
  return null;
@@ -16242,12 +16387,12 @@ function _load_state_migrator() {
16242
16387
  const binName = process2.platform === "win32" ? "tsx.cmd" : "tsx";
16243
16388
  let tsxBin = null;
16244
16389
  for (let dir = pkg_root; ; ) {
16245
- const cand = path10.join(dir, "node_modules", ".bin", binName);
16246
- if (fs12.existsSync(cand)) {
16390
+ const cand = path11.join(dir, "node_modules", ".bin", binName);
16391
+ if (fs13.existsSync(cand)) {
16247
16392
  tsxBin = cand;
16248
16393
  break;
16249
16394
  }
16250
- const parent = path10.dirname(dir);
16395
+ const parent = path11.dirname(dir);
16251
16396
  if (parent === dir) break;
16252
16397
  dir = parent;
16253
16398
  }
@@ -16274,17 +16419,17 @@ function _delete_legacy_settings(project) {
16274
16419
  const removed = [];
16275
16420
  for (const p of _detect_legacy_settings(project)) {
16276
16421
  try {
16277
- fs12.unlinkSync(p);
16278
- removed.push(path10.relative(project, p));
16422
+ fs13.unlinkSync(p);
16423
+ removed.push(path11.relative(project, p));
16279
16424
  } catch {
16280
16425
  continue;
16281
16426
  }
16282
16427
  }
16283
- const settings_dir = path10.join(project, "settings");
16428
+ const settings_dir = path11.join(project, "settings");
16284
16429
  if (_isDir2(settings_dir) && !_isSymlink(settings_dir)) {
16285
16430
  try {
16286
- if (fs12.readdirSync(settings_dir).length === 0) {
16287
- fs12.rmdirSync(settings_dir);
16431
+ if (fs13.readdirSync(settings_dir).length === 0) {
16432
+ fs13.rmdirSync(settings_dir);
16288
16433
  removed.push("settings/");
16289
16434
  }
16290
16435
  } catch {
@@ -16293,12 +16438,12 @@ function _delete_legacy_settings(project) {
16293
16438
  return removed;
16294
16439
  }
16295
16440
  function _remove_empty_shell(project) {
16296
- const shell = path10.join(project, LEGACY_AGENT_CONFIG_SHELL);
16441
+ const shell = path11.join(project, LEGACY_AGENT_CONFIG_SHELL);
16297
16442
  if (!_detect_empty_shell(project)) {
16298
16443
  return false;
16299
16444
  }
16300
16445
  try {
16301
- fs12.rmdirSync(shell);
16446
+ fs13.rmdirSync(shell);
16302
16447
  } catch {
16303
16448
  return false;
16304
16449
  }
@@ -16308,7 +16453,7 @@ function _reEscape(s) {
16308
16453
  return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
16309
16454
  }
16310
16455
  function _update_gitignore(project) {
16311
- const gitignore = path10.join(project, ".gitignore");
16456
+ const gitignore = path11.join(project, ".gitignore");
16312
16457
  const block = `${GITIGNORE_BLOCK_START}
16313
16458
  ${GITIGNORE_NEW_BODY}${GITIGNORE_BLOCK_END}
16314
16459
  `;
@@ -16339,16 +16484,16 @@ ${GITIGNORE_NEW_BODY}${GITIGNORE_BLOCK_END}
16339
16484
  }
16340
16485
  function _build_plan(project) {
16341
16486
  return {
16342
- npm: _detect_npm(path10.join(project, "package.json")),
16343
- composer: _detect_composer(path10.join(project, "composer.json")),
16487
+ npm: _detect_npm(path11.join(project, "package.json")),
16488
+ composer: _detect_composer(path11.join(project, "composer.json")),
16344
16489
  symlinks_legacy: MANAGED_SYMLINKS.filter(
16345
- (name) => _classify_symlink(path10.join(project, name)) === "legacy"
16490
+ (name) => _classify_symlink(path11.join(project, name)) === "legacy"
16346
16491
  ),
16347
16492
  symlinks_user: MANAGED_SYMLINKS.filter(
16348
- (name) => _classify_symlink(path10.join(project, name)) === "user"
16493
+ (name) => _classify_symlink(path11.join(project, name)) === "user"
16349
16494
  ),
16350
- state_file: _isFile2(path10.join(project, LEGACY_STATE_FILENAME)),
16351
- settings_files: _detect_legacy_settings(project).map((p) => path10.relative(project, p)),
16495
+ state_file: _isFile2(path11.join(project, LEGACY_STATE_FILENAME)),
16496
+ settings_files: _detect_legacy_settings(project).map((p) => path11.relative(project, p)),
16352
16497
  empty_shell: _detect_empty_shell(project)
16353
16498
  };
16354
16499
  }
@@ -16412,10 +16557,10 @@ function _warn_on_major_mismatch(from_major, plan, out) {
16412
16557
  }
16413
16558
  function _apply(project, out, err) {
16414
16559
  const summary = [];
16415
- if (_strip_npm_entry(path10.join(project, "package.json"))) {
16560
+ if (_strip_npm_entry(path11.join(project, "package.json"))) {
16416
16561
  summary.push(`removed ${PACKAGE_NAME_NPM} from package.json`);
16417
16562
  }
16418
- if (_strip_composer_entry(path10.join(project, "composer.json"))) {
16563
+ if (_strip_composer_entry(path11.join(project, "composer.json"))) {
16419
16564
  summary.push(`removed ${PACKAGE_NAME_COMPOSER} from composer.json`);
16420
16565
  }
16421
16566
  const [removed_links, preserved_links] = _purge_legacy_symlinks(project);
@@ -16541,13 +16686,13 @@ function _isCliEntry() {
16541
16686
  if (process2.argv[1] === void 0) {
16542
16687
  return false;
16543
16688
  }
16544
- const argvUrl = pathToFileURL(path10.resolve(process2.argv[1])).href;
16689
+ const argvUrl = pathToFileURL(path11.resolve(process2.argv[1])).href;
16545
16690
  if (import.meta.url === argvUrl) {
16546
16691
  return true;
16547
16692
  }
16548
16693
  try {
16549
- const here = fs12.realpathSync(fileURLToPath2(import.meta.url));
16550
- const argv = fs12.realpathSync(path10.resolve(process2.argv[1]));
16694
+ const here = fs13.realpathSync(fileURLToPath2(import.meta.url));
16695
+ const argv = fs13.realpathSync(path11.resolve(process2.argv[1]));
16551
16696
  return here === argv;
16552
16697
  } catch {
16553
16698
  return false;
@@ -16581,37 +16726,37 @@ var ArgparseExit2 = class extends Error {
16581
16726
  }
16582
16727
  code;
16583
16728
  };
16584
- function expanduser5(p) {
16585
- if (p === "~") return os6.homedir();
16729
+ function expanduser6(p) {
16730
+ if (p === "~") return os7.homedir();
16586
16731
  if (p.startsWith("~/") || p.startsWith("~\\")) {
16587
- return path11.join(os6.homedir(), p.slice(2));
16732
+ return path12.join(os7.homedir(), p.slice(2));
16588
16733
  }
16589
16734
  return p;
16590
16735
  }
16591
16736
  function resolvePath(p) {
16592
16737
  try {
16593
- return fs13.realpathSync(path11.resolve(p));
16738
+ return fs14.realpathSync(path12.resolve(p));
16594
16739
  } catch {
16595
- return path11.resolve(p);
16740
+ return path12.resolve(p);
16596
16741
  }
16597
16742
  }
16598
16743
  function isFile(p) {
16599
16744
  try {
16600
- return fs13.statSync(p).isFile();
16745
+ return fs14.statSync(p).isFile();
16601
16746
  } catch {
16602
16747
  return false;
16603
16748
  }
16604
16749
  }
16605
16750
  function isDir(p) {
16606
16751
  try {
16607
- return fs13.statSync(p).isDirectory();
16752
+ return fs14.statSync(p).isDirectory();
16608
16753
  } catch {
16609
16754
  return false;
16610
16755
  }
16611
16756
  }
16612
16757
  function pathExists(p) {
16613
16758
  try {
16614
- fs13.statSync(p);
16759
+ fs14.statSync(p);
16615
16760
  return true;
16616
16761
  } catch {
16617
16762
  return false;
@@ -16619,24 +16764,24 @@ function pathExists(p) {
16619
16764
  }
16620
16765
  function isSymlink(p) {
16621
16766
  try {
16622
- return fs13.lstatSync(p).isSymbolicLink();
16767
+ return fs14.lstatSync(p).isSymbolicLink();
16623
16768
  } catch {
16624
16769
  return false;
16625
16770
  }
16626
16771
  }
16627
16772
  function readText(p) {
16628
- return fs13.readFileSync(p, "utf-8");
16773
+ return fs14.readFileSync(p, "utf-8");
16629
16774
  }
16630
16775
  function writeText(p, content) {
16631
- fs13.writeFileSync(p, content, "utf-8");
16776
+ fs14.writeFileSync(p, content, "utf-8");
16632
16777
  }
16633
16778
  function mkdirp(p) {
16634
- fs13.mkdirSync(p, { recursive: true });
16779
+ fs14.mkdirSync(p, { recursive: true });
16635
16780
  }
16636
16781
  function sortedGlobStems(directory, suffix) {
16637
16782
  let entries;
16638
16783
  try {
16639
- entries = fs13.readdirSync(directory);
16784
+ entries = fs14.readdirSync(directory);
16640
16785
  } catch {
16641
16786
  return [];
16642
16787
  }
@@ -16656,7 +16801,7 @@ function sortedGlobStems(directory, suffix) {
16656
16801
  function countZips(directory) {
16657
16802
  if (!isDir(directory)) return 0;
16658
16803
  let n = 0;
16659
- for (const name of fs13.readdirSync(directory)) {
16804
+ for (const name of fs14.readdirSync(directory)) {
16660
16805
  if (name.endsWith(".zip")) n += 1;
16661
16806
  }
16662
16807
  return n;
@@ -16664,35 +16809,35 @@ function countZips(directory) {
16664
16809
  function sha256OfFile(p) {
16665
16810
  let data;
16666
16811
  try {
16667
- data = fs13.readFileSync(p);
16812
+ data = fs14.readFileSync(p);
16668
16813
  } catch {
16669
16814
  return null;
16670
16815
  }
16671
- return crypto2.createHash("sha256").update(data).digest("hex");
16816
+ return crypto3.createHash("sha256").update(data).digest("hex");
16672
16817
  }
16673
16818
  function atomicWrite0644(target, body, prefix) {
16674
- const dir = path11.dirname(target);
16675
- const tmpName = path11.join(
16819
+ const dir = path12.dirname(target);
16820
+ const tmpName = path12.join(
16676
16821
  dir,
16677
- `${prefix}${process3.pid}.${crypto2.randomBytes(6).toString("hex")}.yml.tmp`
16822
+ `${prefix}${process3.pid}.${crypto3.randomBytes(6).toString("hex")}.yml.tmp`
16678
16823
  );
16679
16824
  let fd = null;
16680
16825
  try {
16681
- fd = fs13.openSync(tmpName, "wx", 420);
16682
- fs13.writeFileSync(fd, body, "utf-8");
16683
- fs13.closeSync(fd);
16826
+ fd = fs14.openSync(tmpName, "wx", 420);
16827
+ fs14.writeFileSync(fd, body, "utf-8");
16828
+ fs14.closeSync(fd);
16684
16829
  fd = null;
16685
- fs13.chmodSync(tmpName, 420);
16686
- fs13.renameSync(tmpName, target);
16830
+ fs14.chmodSync(tmpName, 420);
16831
+ fs14.renameSync(tmpName, target);
16687
16832
  } catch (err) {
16688
16833
  if (fd !== null) {
16689
16834
  try {
16690
- fs13.closeSync(fd);
16835
+ fs14.closeSync(fd);
16691
16836
  } catch {
16692
16837
  }
16693
16838
  }
16694
16839
  try {
16695
- fs13.unlinkSync(tmpName);
16840
+ fs14.unlinkSync(tmpName);
16696
16841
  } catch {
16697
16842
  }
16698
16843
  throw err;
@@ -16792,6 +16937,20 @@ function jsonDumpsCompact(value) {
16792
16937
  }
16793
16938
  return _jsonStrNoAscii(String(value));
16794
16939
  }
16940
+ function yamlSafeLoad(text) {
16941
+ let YAML2;
16942
+ try {
16943
+ YAML2 = require_dist();
16944
+ } catch {
16945
+ return null;
16946
+ }
16947
+ try {
16948
+ const data = YAML2.parse(text, { version: "1.1" });
16949
+ return data;
16950
+ } catch {
16951
+ return void 0;
16952
+ }
16953
+ }
16795
16954
  var DEFAULT_PROFILE = "balanced";
16796
16955
  var SUPPORTED_PROFILES = ["minimal", "balanced", "full"];
16797
16956
  var RULE_LOADING_TIER_PLACEHOLDER = "__RULE_LOADING_TIER__";
@@ -16802,12 +16961,12 @@ var LEGACY_SETTINGS_FILE = ".agent-settings";
16802
16961
  var LEGACY_BACKUP_FILE = ".agent-settings.backup.key-value";
16803
16962
  var SETTINGS_SUBDIR = ["agents", "settings"];
16804
16963
  function _canonical_settings_target(project_root) {
16805
- return path11.join(project_root, ...SETTINGS_SUBDIR, SETTINGS_FILE);
16964
+ return path12.join(project_root, ...SETTINGS_SUBDIR, SETTINGS_FILE);
16806
16965
  }
16807
16966
  function _resolve_settings_read(project_root) {
16808
16967
  const canonical = _canonical_settings_target(project_root);
16809
16968
  if (pathExists(canonical)) return canonical;
16810
- const legacy = path11.join(project_root, SETTINGS_FILE);
16969
+ const legacy = path12.join(project_root, SETTINGS_FILE);
16811
16970
  if (pathExists(legacy)) return legacy;
16812
16971
  return canonical;
16813
16972
  }
@@ -16871,9 +17030,9 @@ function fail(msg) {
16871
17030
  throw new SystemExitError(1);
16872
17031
  }
16873
17032
  function detect_package_root(project_root) {
16874
- const npm_path = path11.join(project_root, "node_modules", "@event4u", "agent-config");
17033
+ const npm_path = path12.join(project_root, "node_modules", "@event4u", "agent-config");
16875
17034
  if (isDir(npm_path)) return resolvePath(npm_path);
16876
- if (pathExists(path11.join(project_root, "src", "config", "profiles", "minimal.ini"))) {
17035
+ if (pathExists(path12.join(project_root, "src", "config", "profiles", "minimal.ini"))) {
16877
17036
  return project_root;
16878
17037
  }
16879
17038
  fail(
@@ -16881,12 +17040,12 @@ function detect_package_root(project_root) {
16881
17040
  );
16882
17041
  }
16883
17042
  function detect_package_type(package_root) {
16884
- if (package_root.split(path11.sep).includes("node_modules")) return "npm";
17043
+ if (package_root.split(path12.sep).includes("node_modules")) return "npm";
16885
17044
  return "local";
16886
17045
  }
16887
17046
  function detect_package_type_for_project(project_root, package_root) {
16888
17047
  const npm_path = resolvePath(
16889
- path11.join(project_root, "node_modules", "@event4u", "agent-config")
17048
+ path12.join(project_root, "node_modules", "@event4u", "agent-config")
16890
17049
  );
16891
17050
  const package_resolved = resolvePath(package_root);
16892
17051
  if (package_resolved === npm_path) return "npm";
@@ -16906,7 +17065,7 @@ function ensure_directory(p) {
16906
17065
  mkdirp(p);
16907
17066
  }
16908
17067
  function write_file(p, content) {
16909
- ensure_directory(path11.dirname(p));
17068
+ ensure_directory(path12.dirname(p));
16910
17069
  writeText(p, content);
16911
17070
  }
16912
17071
  function read_json_file(p) {
@@ -17077,7 +17236,7 @@ function _append_unknown_legacy(rendered, legacy_values, unknown_keys) {
17077
17236
  return rendered + "\n" + suffix;
17078
17237
  }
17079
17238
  function _migrate_legacy_if_present(project_root, template_body) {
17080
- const legacy_target = path11.join(project_root, LEGACY_SETTINGS_FILE);
17239
+ const legacy_target = path12.join(project_root, LEGACY_SETTINGS_FILE);
17081
17240
  if (!isFile(legacy_target)) return null;
17082
17241
  const legacy_text = readText(legacy_target);
17083
17242
  const [values, unknown] = _parse_legacy_settings(legacy_text);
@@ -17092,9 +17251,9 @@ function _migrate_legacy_if_present(project_root, template_body) {
17092
17251
  }
17093
17252
  }
17094
17253
  rendered = _append_unknown_legacy(rendered, values, unknown);
17095
- const backup_target = path11.join(project_root, LEGACY_BACKUP_FILE);
17254
+ const backup_target = path12.join(project_root, LEGACY_BACKUP_FILE);
17096
17255
  writeText(backup_target, legacy_text);
17097
- fs13.unlinkSync(legacy_target);
17256
+ fs14.unlinkSync(legacy_target);
17098
17257
  info(`Migrated legacy ${LEGACY_SETTINGS_FILE} \u2192 ${SETTINGS_FILE}`);
17099
17258
  info(`Backup saved to ${LEGACY_BACKUP_FILE}`);
17100
17259
  if (unknown.length > 0) {
@@ -17129,7 +17288,7 @@ function _render_template(template, profile_values) {
17129
17288
  return body;
17130
17289
  }
17131
17290
  function _load_valid_user_types(package_root) {
17132
- const directory = path11.join(package_root, USER_TYPES_DIR);
17291
+ const directory = path12.join(package_root, USER_TYPES_DIR);
17133
17292
  if (!isDir(directory)) return [];
17134
17293
  return sortedGlobStems(directory, ".yml");
17135
17294
  }
@@ -17186,8 +17345,8 @@ function splitlinesKeepends(text) {
17186
17345
  }
17187
17346
  function ensure_agent_settings(project_root, package_root, profile, force, user_type = "", packs = null) {
17188
17347
  const target = _canonical_settings_target(project_root);
17189
- const profile_source = path11.join(package_root, "src", "config", "profiles", `${profile}.ini`);
17190
- const template_source = path11.join(package_root, "src", "config", "agent-settings.template.yml");
17348
+ const profile_source = path12.join(package_root, "src", "config", "profiles", `${profile}.ini`);
17349
+ const template_source = path12.join(package_root, "src", "config", "agent-settings.template.yml");
17191
17350
  if (!pathExists(profile_source)) fail(`Missing profile preset: ${profile_source}`);
17192
17351
  if (!pathExists(template_source)) fail(`Missing settings template: ${template_source}`);
17193
17352
  const template = readText(template_source);
@@ -17201,21 +17360,21 @@ function ensure_agent_settings(project_root, package_root, profile, force, user_
17201
17360
  if (profile_values["rule_loading_tier"] !== profile) {
17202
17361
  const got = "rule_loading_tier" in profile_values ? `'${profile_values["rule_loading_tier"]}'` : "None";
17203
17362
  fail(
17204
- `Profile preset ${path11.basename(profile_source)} has rule_loading_tier=${got} but --profile=${profile}`
17363
+ `Profile preset ${path12.basename(profile_source)} has rule_loading_tier=${got} but --profile=${profile}`
17205
17364
  );
17206
17365
  }
17207
17366
  profile_values["user_type"] = _validate_user_type(package_root, user_type);
17208
17367
  let template_body = _render_template(template, profile_values);
17209
17368
  template_body = _inject_packs(template_body, packs ?? []);
17210
- const legacy_root = path11.join(project_root, SETTINGS_FILE);
17369
+ const legacy_root = path12.join(project_root, SETTINGS_FILE);
17211
17370
  if (isFile(legacy_root) && !pathExists(target)) {
17212
- mkdirp(path11.dirname(target));
17371
+ mkdirp(path12.dirname(target));
17213
17372
  writeText(target, readText(legacy_root));
17214
- fs13.unlinkSync(legacy_root);
17373
+ fs14.unlinkSync(legacy_root);
17215
17374
  success(`Migrated ${SETTINGS_FILE} \u2192 agents/settings/${SETTINGS_FILE} (ADR-038)`);
17216
17375
  return;
17217
17376
  }
17218
- const legacy_target = path11.join(project_root, LEGACY_SETTINGS_FILE);
17377
+ const legacy_target = path12.join(project_root, LEGACY_SETTINGS_FILE);
17219
17378
  if (isFile(legacy_target) && pathExists(target)) {
17220
17379
  warn(
17221
17380
  `Both ${SETTINGS_FILE} and legacy ${LEGACY_SETTINGS_FILE} exist. Skipping migration to avoid overwriting ${SETTINGS_FILE}. Delete one of them manually and re-run.`
@@ -17232,7 +17391,7 @@ function ensure_agent_settings(project_root, package_root, profile, force, user_
17232
17391
  skip(`${SETTINGS_FILE} already exists`);
17233
17392
  return;
17234
17393
  }
17235
- mkdirp(path11.dirname(target));
17394
+ mkdirp(path12.dirname(target));
17236
17395
  write_file(target, template_body);
17237
17396
  const user_type_value = profile_values["user_type"] ?? "";
17238
17397
  const suffix = user_type_value ? `, user_type=${user_type_value}` : "";
@@ -17245,7 +17404,7 @@ function ensure_vscode_bridge(project_root, package_type, force) {
17245
17404
  const plugin_path = plugin_paths[package_type] ?? "./plugin/agent-config";
17246
17405
  const bridge = { "chat.pluginLocations": { [plugin_path]: true } };
17247
17406
  merge_json_file(
17248
- path11.join(project_root, ".vscode", "settings.json"),
17407
+ path12.join(project_root, ".vscode", "settings.json"),
17249
17408
  bridge,
17250
17409
  force,
17251
17410
  ".vscode/settings.json"
@@ -17254,14 +17413,14 @@ function ensure_vscode_bridge(project_root, package_type, force) {
17254
17413
  function ensure_augment_bridge(project_root, force) {
17255
17414
  const bridge = { enabledPlugins: { "agent-config@event4u": true } };
17256
17415
  return merge_json_file(
17257
- path11.join(project_root, ".augment", "settings.json"),
17416
+ path12.join(project_root, ".augment", "settings.json"),
17258
17417
  bridge,
17259
17418
  force,
17260
17419
  ".augment/settings.json"
17261
17420
  );
17262
17421
  }
17263
- var AUGMENT_USER_DIR = path11.join(os6.homedir(), ".augment");
17264
- var AUGMENT_USER_HOOKS_DIR = path11.join(AUGMENT_USER_DIR, "hooks");
17422
+ var AUGMENT_USER_DIR = path12.join(os7.homedir(), ".augment");
17423
+ var AUGMENT_USER_HOOKS_DIR = path12.join(AUGMENT_USER_DIR, "hooks");
17265
17424
  var AUGMENT_DISPATCHER_TRAMPOLINE = "augment-dispatcher.sh";
17266
17425
  var AUGMENT_LEGACY_TRAMPOLINES = [
17267
17426
  "augment-chat-history.sh",
@@ -17277,29 +17436,29 @@ var AUGMENT_DISPATCHER_BINDINGS = [
17277
17436
  ["post_tool_use", "PostToolUse"]
17278
17437
  ];
17279
17438
  function _deploy_augment_trampoline(package_root, name, force) {
17280
- const src = path11.join(package_root, "scripts", "hooks", name);
17439
+ const src = path12.join(package_root, "scripts", "hooks", name);
17281
17440
  if (!pathExists(src)) {
17282
17441
  skip(`augment trampoline missing in package: ${src}`);
17283
17442
  return null;
17284
17443
  }
17285
17444
  mkdirp(AUGMENT_USER_HOOKS_DIR);
17286
- const dst = path11.join(AUGMENT_USER_HOOKS_DIR, name);
17445
+ const dst = path12.join(AUGMENT_USER_HOOKS_DIR, name);
17287
17446
  const src_text = readText(src);
17288
17447
  if (pathExists(dst) && readText(dst) === src_text && !force) {
17289
17448
  skip(`~/.augment/hooks/${name} already up to date`);
17290
17449
  } else {
17291
17450
  writeText(dst, src_text);
17292
- fs13.chmodSync(dst, 493);
17451
+ fs14.chmodSync(dst, 493);
17293
17452
  success(`~/.augment/hooks/${name} installed`);
17294
17453
  }
17295
17454
  return dst;
17296
17455
  }
17297
17456
  function _remove_legacy_augment_trampolines() {
17298
17457
  for (const name of AUGMENT_LEGACY_TRAMPOLINES) {
17299
- const legacy = path11.join(AUGMENT_USER_HOOKS_DIR, name);
17458
+ const legacy = path12.join(AUGMENT_USER_HOOKS_DIR, name);
17300
17459
  try {
17301
17460
  if (isFile(legacy)) {
17302
- fs13.unlinkSync(legacy);
17461
+ fs14.unlinkSync(legacy);
17303
17462
  skip(`removed legacy ~/.augment/hooks/${name}`);
17304
17463
  }
17305
17464
  } catch {
@@ -17318,7 +17477,7 @@ function ensure_augment_user_hooks(package_root, force) {
17318
17477
  }
17319
17478
  const settings_patch = { hooks: per_event };
17320
17479
  return merge_json_file(
17321
- path11.join(AUGMENT_USER_DIR, "settings.json"),
17480
+ path12.join(AUGMENT_USER_DIR, "settings.json"),
17322
17481
  settings_patch,
17323
17482
  force,
17324
17483
  "~/.augment/settings.json"
@@ -17343,7 +17502,7 @@ function _heal_legacy_claude_plugin_ids(p) {
17343
17502
  return removed;
17344
17503
  }
17345
17504
  function ensure_claude_bridge(project_root, force) {
17346
- const target = path11.join(project_root, ".claude", "settings.json");
17505
+ const target = path12.join(project_root, ".claude", "settings.json");
17347
17506
  const healed = _heal_legacy_claude_plugin_ids(target);
17348
17507
  for (const pid of healed) {
17349
17508
  success(`.claude/settings.json: removed stale plugin id \`${pid}\``);
@@ -17368,29 +17527,29 @@ function ensure_cursor_bridge(project_root, force) {
17368
17527
  }
17369
17528
  const bridge = { version: 1, hooks };
17370
17529
  return merge_json_file(
17371
- path11.join(project_root, ".cursor", "hooks.json"),
17530
+ path12.join(project_root, ".cursor", "hooks.json"),
17372
17531
  bridge,
17373
17532
  force,
17374
17533
  ".cursor/hooks.json"
17375
17534
  );
17376
17535
  }
17377
- var CURSOR_USER_DIR = path11.join(os6.homedir(), ".cursor");
17378
- var CURSOR_USER_HOOKS_DIR = path11.join(CURSOR_USER_DIR, "hooks");
17536
+ var CURSOR_USER_DIR = path12.join(os7.homedir(), ".cursor");
17537
+ var CURSOR_USER_HOOKS_DIR = path12.join(CURSOR_USER_DIR, "hooks");
17379
17538
  var CURSOR_DISPATCHER_TRAMPOLINE = "cursor-dispatcher.sh";
17380
17539
  function ensure_cursor_user_hooks(package_root, force) {
17381
- const src = path11.join(package_root, "scripts", "hooks", CURSOR_DISPATCHER_TRAMPOLINE);
17540
+ const src = path12.join(package_root, "scripts", "hooks", CURSOR_DISPATCHER_TRAMPOLINE);
17382
17541
  if (!pathExists(src)) {
17383
17542
  skip(`cursor trampoline missing in package: ${src}`);
17384
17543
  return [];
17385
17544
  }
17386
17545
  mkdirp(CURSOR_USER_HOOKS_DIR);
17387
- const dst = path11.join(CURSOR_USER_HOOKS_DIR, CURSOR_DISPATCHER_TRAMPOLINE);
17546
+ const dst = path12.join(CURSOR_USER_HOOKS_DIR, CURSOR_DISPATCHER_TRAMPOLINE);
17388
17547
  const src_text = readText(src);
17389
17548
  if (pathExists(dst) && readText(dst) === src_text && !force) {
17390
17549
  skip(`~/.cursor/hooks/${CURSOR_DISPATCHER_TRAMPOLINE} already up to date`);
17391
17550
  } else {
17392
17551
  writeText(dst, src_text);
17393
- fs13.chmodSync(dst, 493);
17552
+ fs14.chmodSync(dst, 493);
17394
17553
  success(`~/.cursor/hooks/${CURSOR_DISPATCHER_TRAMPOLINE} installed`);
17395
17554
  }
17396
17555
  const hooks = {};
@@ -17399,7 +17558,7 @@ function ensure_cursor_user_hooks(package_root, force) {
17399
17558
  }
17400
17559
  const settings_patch = { version: 1, hooks };
17401
17560
  return merge_json_file(
17402
- path11.join(CURSOR_USER_DIR, "hooks.json"),
17561
+ path12.join(CURSOR_USER_DIR, "hooks.json"),
17403
17562
  settings_patch,
17404
17563
  force,
17405
17564
  "~/.cursor/hooks.json"
@@ -17442,12 +17601,12 @@ exit 0
17442
17601
  `;
17443
17602
  }
17444
17603
  function ensure_cline_bridge(project_root, force) {
17445
- const hooks_dir = path11.join(project_root, ".clinerules", "hooks");
17604
+ const hooks_dir = path12.join(project_root, ".clinerules", "hooks");
17446
17605
  mkdirp(hooks_dir);
17447
17606
  const workspace_quoted = shlexQuote(resolvePath(project_root));
17448
17607
  let written = 0;
17449
17608
  for (const [ac_event, native_event] of CLINE_DISPATCHER_BINDINGS) {
17450
- const target = path11.join(hooks_dir, native_event);
17609
+ const target = path12.join(hooks_dir, native_event);
17451
17610
  const body = clineProjectHookBody(native_event, ac_event, workspace_quoted);
17452
17611
  if (pathExists(target) && readText(target) === body && !force) {
17453
17612
  continue;
@@ -17457,7 +17616,7 @@ function ensure_cline_bridge(project_root, force) {
17457
17616
  continue;
17458
17617
  }
17459
17618
  writeText(target, body);
17460
- fs13.chmodSync(target, 493);
17619
+ fs14.chmodSync(target, 493);
17461
17620
  written += 1;
17462
17621
  }
17463
17622
  if (written) {
@@ -17466,27 +17625,27 @@ function ensure_cline_bridge(project_root, force) {
17466
17625
  skip(".clinerules/hooks/ already up to date");
17467
17626
  }
17468
17627
  }
17469
- var CLINE_USER_DIR = path11.join(os6.homedir(), "Documents", "Cline", "Hooks");
17628
+ var CLINE_USER_DIR = path12.join(os7.homedir(), "Documents", "Cline", "Hooks");
17470
17629
  var CLINE_DISPATCHER_TRAMPOLINE = "cline-dispatcher.sh";
17471
17630
  function ensure_cline_user_hooks(package_root, force) {
17472
- const src = path11.join(package_root, "scripts", "hooks", CLINE_DISPATCHER_TRAMPOLINE);
17631
+ const src = path12.join(package_root, "scripts", "hooks", CLINE_DISPATCHER_TRAMPOLINE);
17473
17632
  if (!pathExists(src)) {
17474
17633
  skip(`cline trampoline missing in package: ${src}`);
17475
17634
  return;
17476
17635
  }
17477
17636
  mkdirp(CLINE_USER_DIR);
17478
- const trampoline = path11.join(CLINE_USER_DIR, CLINE_DISPATCHER_TRAMPOLINE);
17637
+ const trampoline = path12.join(CLINE_USER_DIR, CLINE_DISPATCHER_TRAMPOLINE);
17479
17638
  const src_text = readText(src);
17480
17639
  if (pathExists(trampoline) && readText(trampoline) === src_text && !force) {
17481
17640
  skip(`~/Documents/Cline/Hooks/${CLINE_DISPATCHER_TRAMPOLINE} already up to date`);
17482
17641
  } else {
17483
17642
  writeText(trampoline, src_text);
17484
- fs13.chmodSync(trampoline, 493);
17643
+ fs14.chmodSync(trampoline, 493);
17485
17644
  success(`~/Documents/Cline/Hooks/${CLINE_DISPATCHER_TRAMPOLINE} installed`);
17486
17645
  }
17487
17646
  const trampoline_quoted = shlexQuote(trampoline);
17488
17647
  for (const [ac_event, native_event] of CLINE_DISPATCHER_BINDINGS) {
17489
- const wrapper = path11.join(CLINE_USER_DIR, native_event);
17648
+ const wrapper = path12.join(CLINE_USER_DIR, native_event);
17490
17649
  const body = `#!/usr/bin/env bash
17491
17650
  # Generated by event4u/agent-config install.py \u2014 DO NOT EDIT.
17492
17651
  # User-scope Cline hook for ${native_event} \u2192 agent-config ${ac_event}.
@@ -17496,7 +17655,7 @@ exec ${trampoline_quoted} ${ac_event} ${native_event}
17496
17655
  continue;
17497
17656
  }
17498
17657
  writeText(wrapper, body);
17499
- fs13.chmodSync(wrapper, 493);
17658
+ fs14.chmodSync(wrapper, 493);
17500
17659
  }
17501
17660
  }
17502
17661
  var WINDSURF_DISPATCHER_BINDINGS = [
@@ -17517,29 +17676,29 @@ function ensure_windsurf_bridge(project_root, force) {
17517
17676
  }
17518
17677
  const bridge = { hooks };
17519
17678
  return merge_json_file(
17520
- path11.join(project_root, ".windsurf", "hooks.json"),
17679
+ path12.join(project_root, ".windsurf", "hooks.json"),
17521
17680
  bridge,
17522
17681
  force,
17523
17682
  ".windsurf/hooks.json"
17524
17683
  );
17525
17684
  }
17526
- var WINDSURF_USER_DIR = path11.join(os6.homedir(), ".codeium", "windsurf");
17527
- var WINDSURF_USER_HOOKS_DIR = path11.join(WINDSURF_USER_DIR, "hooks");
17685
+ var WINDSURF_USER_DIR = path12.join(os7.homedir(), ".codeium", "windsurf");
17686
+ var WINDSURF_USER_HOOKS_DIR = path12.join(WINDSURF_USER_DIR, "hooks");
17528
17687
  var WINDSURF_DISPATCHER_TRAMPOLINE = "windsurf-dispatcher.sh";
17529
17688
  function ensure_windsurf_user_hooks(package_root, force) {
17530
- const src = path11.join(package_root, "scripts", "hooks", WINDSURF_DISPATCHER_TRAMPOLINE);
17689
+ const src = path12.join(package_root, "scripts", "hooks", WINDSURF_DISPATCHER_TRAMPOLINE);
17531
17690
  if (!pathExists(src)) {
17532
17691
  skip(`windsurf trampoline missing in package: ${src}`);
17533
17692
  return [];
17534
17693
  }
17535
17694
  mkdirp(WINDSURF_USER_HOOKS_DIR);
17536
- const dst = path11.join(WINDSURF_USER_HOOKS_DIR, WINDSURF_DISPATCHER_TRAMPOLINE);
17695
+ const dst = path12.join(WINDSURF_USER_HOOKS_DIR, WINDSURF_DISPATCHER_TRAMPOLINE);
17537
17696
  const src_text = readText(src);
17538
17697
  if (pathExists(dst) && readText(dst) === src_text && !force) {
17539
17698
  skip(`~/.codeium/windsurf/hooks/${WINDSURF_DISPATCHER_TRAMPOLINE} already up to date`);
17540
17699
  } else {
17541
17700
  writeText(dst, src_text);
17542
- fs13.chmodSync(dst, 493);
17701
+ fs14.chmodSync(dst, 493);
17543
17702
  success(`~/.codeium/windsurf/hooks/${WINDSURF_DISPATCHER_TRAMPOLINE} installed`);
17544
17703
  }
17545
17704
  const hooks = {};
@@ -17551,7 +17710,7 @@ function ensure_windsurf_user_hooks(package_root, force) {
17551
17710
  }
17552
17711
  const settings_patch = { hooks };
17553
17712
  return merge_json_file(
17554
- path11.join(WINDSURF_USER_DIR, "hooks.json"),
17713
+ path12.join(WINDSURF_USER_DIR, "hooks.json"),
17555
17714
  settings_patch,
17556
17715
  force,
17557
17716
  "~/.codeium/windsurf/hooks.json"
@@ -17580,43 +17739,43 @@ function _gemini_hooks_dict(command_factory) {
17580
17739
  function ensure_gemini_bridge(project_root, force) {
17581
17740
  const bridge = { hooks: _gemini_hooks_dict(_gemini_dispatch_command) };
17582
17741
  return merge_json_file(
17583
- path11.join(project_root, ".gemini", "settings.json"),
17742
+ path12.join(project_root, ".gemini", "settings.json"),
17584
17743
  bridge,
17585
17744
  force,
17586
17745
  ".gemini/settings.json"
17587
17746
  );
17588
17747
  }
17589
- var GEMINI_USER_DIR = path11.join(os6.homedir(), ".gemini");
17590
- var GEMINI_USER_HOOKS_DIR = path11.join(GEMINI_USER_DIR, "hooks");
17748
+ var GEMINI_USER_DIR = path12.join(os7.homedir(), ".gemini");
17749
+ var GEMINI_USER_HOOKS_DIR = path12.join(GEMINI_USER_DIR, "hooks");
17591
17750
  var GEMINI_DISPATCHER_TRAMPOLINE = "gemini-dispatcher.sh";
17592
17751
  function ensure_gemini_user_hooks(package_root, force) {
17593
- const src = path11.join(package_root, "scripts", "hooks", GEMINI_DISPATCHER_TRAMPOLINE);
17752
+ const src = path12.join(package_root, "scripts", "hooks", GEMINI_DISPATCHER_TRAMPOLINE);
17594
17753
  if (!pathExists(src)) {
17595
17754
  skip(`gemini trampoline missing in package: ${src}`);
17596
17755
  return [];
17597
17756
  }
17598
17757
  mkdirp(GEMINI_USER_HOOKS_DIR);
17599
- const dst = path11.join(GEMINI_USER_HOOKS_DIR, GEMINI_DISPATCHER_TRAMPOLINE);
17758
+ const dst = path12.join(GEMINI_USER_HOOKS_DIR, GEMINI_DISPATCHER_TRAMPOLINE);
17600
17759
  const src_text = readText(src);
17601
17760
  if (pathExists(dst) && readText(dst) === src_text && !force) {
17602
17761
  skip(`~/.gemini/hooks/${GEMINI_DISPATCHER_TRAMPOLINE} already up to date`);
17603
17762
  } else {
17604
17763
  writeText(dst, src_text);
17605
- fs13.chmodSync(dst, 493);
17764
+ fs14.chmodSync(dst, 493);
17606
17765
  success(`~/.gemini/hooks/${GEMINI_DISPATCHER_TRAMPOLINE} installed`);
17607
17766
  }
17608
17767
  const settings_patch = {
17609
17768
  hooks: _gemini_hooks_dict((ac_event, native) => `${dst} ${ac_event} ${native}`)
17610
17769
  };
17611
17770
  return merge_json_file(
17612
- path11.join(GEMINI_USER_DIR, "settings.json"),
17771
+ path12.join(GEMINI_USER_DIR, "settings.json"),
17613
17772
  settings_patch,
17614
17773
  force,
17615
17774
  "~/.gemini/settings.json"
17616
17775
  );
17617
17776
  }
17618
17777
  function ensure_copilot_bridge(project_root, force) {
17619
- const target = path11.join(project_root, ".github", "plugin", "marketplace.json");
17778
+ const target = path12.join(project_root, ".github", "plugin", "marketplace.json");
17620
17779
  const bridge = {
17621
17780
  marketplace: {
17622
17781
  name: "event4u-agent-marketplace",
@@ -17659,7 +17818,7 @@ See \`docs/setup/per-ide/roocode.md\` for the full activation guide.
17659
17818
  Run \`./agent-config --help\` for available commands.
17660
17819
  `;
17661
17820
  function ensure_roocode_bridge(project_root, force) {
17662
- const target = path11.join(project_root, ".roo", "rules", "agent-config.md");
17821
+ const target = path12.join(project_root, ".roo", "rules", "agent-config.md");
17663
17822
  if (pathExists(target) && !force) {
17664
17823
  skip(".roo/rules/agent-config.md already exists");
17665
17824
  return;
@@ -17681,7 +17840,7 @@ To wire Claude Desktop to this project's rules, run:
17681
17840
  Canonical rule and skill source: \`.augment/\` (see \`AGENTS.md\`).
17682
17841
  `;
17683
17842
  function ensure_claude_desktop_bridge(project_root, force) {
17684
- const target = path11.join(project_root, ".claude-desktop", "agent-config.md");
17843
+ const target = path12.join(project_root, ".claude-desktop", "agent-config.md");
17685
17844
  if (pathExists(target) && !force) {
17686
17845
  skip(".claude-desktop/agent-config.md already exists");
17687
17846
  return;
@@ -17706,7 +17865,7 @@ Or pass \`--read .aider/agent-config.md\` on the command line.
17706
17865
  Canonical rule and skill source: \`.augment/\` (see \`AGENTS.md\`).
17707
17866
  `;
17708
17867
  function ensure_aider_bridge(project_root, force) {
17709
- const target = path11.join(project_root, ".aider", "agent-config.md");
17868
+ const target = path12.join(project_root, ".aider", "agent-config.md");
17710
17869
  if (pathExists(target) && !force) {
17711
17870
  skip(".aider/agent-config.md already exists");
17712
17871
  return;
@@ -17725,7 +17884,7 @@ developers where the rules and skills live.
17725
17884
  Canonical rule and skill source: \`.augment/\` (see project \`AGENTS.md\`).
17726
17885
  `;
17727
17886
  function ensure_codex_bridge(project_root, force) {
17728
- const target = path11.join(project_root, ".codex", "agent-config.md");
17887
+ const target = path12.join(project_root, ".codex", "agent-config.md");
17729
17888
  if (pathExists(target) && !force) {
17730
17889
  skip(".codex/agent-config.md already exists");
17731
17890
  return;
@@ -17743,7 +17902,7 @@ rules per session. The canonical rule and skill source lives under
17743
17902
  orientation).
17744
17903
  `;
17745
17904
  function ensure_continue_bridge(project_root, force) {
17746
- const target = path11.join(project_root, ".continue", "rules", "agent-config.md");
17905
+ const target = path12.join(project_root, ".continue", "rules", "agent-config.md");
17747
17906
  if (pathExists(target) && !force) {
17748
17907
  skip(".continue/rules/agent-config.md already exists");
17749
17908
  return;
@@ -17774,7 +17933,7 @@ orientation).
17774
17933
  See \`docs/setup/per-ide/kilocode.md\` for the full activation guide.
17775
17934
  `;
17776
17935
  function ensure_kilocode_bridge(project_root, force) {
17777
- const target = path11.join(project_root, ".kilocode", "rules", "agent-config.md");
17936
+ const target = path12.join(project_root, ".kilocode", "rules", "agent-config.md");
17778
17937
  if (pathExists(target) && !force) {
17779
17938
  skip(".kilocode/rules/agent-config.md already exists");
17780
17939
  return;
@@ -17801,7 +17960,7 @@ canonical source (or symlink it):
17801
17960
  Canonical rule and skill source: \`.augment/\` (see \`AGENTS.md\`).
17802
17961
  `;
17803
17962
  function ensure_zed_bridge(project_root, force) {
17804
- const target = path11.join(project_root, ".zed", "agent-config.md");
17963
+ const target = path12.join(project_root, ".zed", "agent-config.md");
17805
17964
  if (pathExists(target) && !force) {
17806
17965
  skip(".zed/agent-config.md already exists");
17807
17966
  return;
@@ -17822,7 +17981,7 @@ rules into your JetBrains profile.
17822
17981
  Canonical rule and skill source: \`.augment/\` (see \`AGENTS.md\`).
17823
17982
  `;
17824
17983
  function ensure_jetbrains_bridge(project_root, force) {
17825
- const target = path11.join(project_root, ".jetbrains", "agent-config.md");
17984
+ const target = path12.join(project_root, ".jetbrains", "agent-config.md");
17826
17985
  if (pathExists(target) && !force) {
17827
17986
  skip(".jetbrains/agent-config.md already exists");
17828
17987
  return;
@@ -17853,7 +18012,7 @@ session. The canonical rule and skill source lives under \`.augment/\`
17853
18012
  See \`docs/setup/per-ide/kiro.md\` for the full activation guide.
17854
18013
  `;
17855
18014
  function ensure_kiro_bridge(project_root, force) {
17856
- const target = path11.join(project_root, ".kiro", "steering", "agent-config.md");
18015
+ const target = path12.join(project_root, ".kiro", "steering", "agent-config.md");
17857
18016
  if (pathExists(target) && !force) {
17858
18017
  skip(".kiro/steering/agent-config.md already exists");
17859
18018
  return;
@@ -17879,35 +18038,35 @@ var SMOKE_BRIDGE_PATHS = {
17879
18038
  };
17880
18039
  function dirHasEntries(p) {
17881
18040
  try {
17882
- return fs13.readdirSync(p).length > 0;
18041
+ return fs14.readdirSync(p).length > 0;
17883
18042
  } catch {
17884
18043
  return false;
17885
18044
  }
17886
18045
  }
17887
18046
  function _resolve_tsx_invocation(scriptPath, scriptArgs) {
17888
18047
  const binName = process3.platform === "win32" ? "tsx.cmd" : "tsx";
17889
- let dir = path11.dirname(scriptPath);
18048
+ let dir = path12.dirname(scriptPath);
17890
18049
  for (; ; ) {
17891
- const candidate = path11.join(dir, "node_modules", ".bin", binName);
18050
+ const candidate = path12.join(dir, "node_modules", ".bin", binName);
17892
18051
  if (isFile(candidate)) {
17893
18052
  return { command: candidate, args: [scriptPath, ...scriptArgs] };
17894
18053
  }
17895
- const parent = path11.dirname(dir);
18054
+ const parent = path12.dirname(dir);
17896
18055
  if (parent === dir) break;
17897
18056
  dir = parent;
17898
18057
  }
17899
18058
  return { command: "npx", args: ["tsx", scriptPath, ...scriptArgs] };
17900
18059
  }
17901
18060
  function _smoke_test_hooks(project_root, package_root) {
17902
- const dispatcher = path11.join(package_root, "scripts", "hooks", "dispatch_hook.ts");
17903
- const manifest = path11.join(package_root, "scripts", "hook_manifest.yaml");
18061
+ const dispatcher = path12.join(package_root, "scripts", "hooks", "dispatch_hook.ts");
18062
+ const manifest = path12.join(package_root, "scripts", "hook_manifest.yaml");
17904
18063
  if (!isFile(dispatcher) || !isFile(manifest)) return 0;
17905
18064
  const failed = [];
17906
18065
  const skipped = [];
17907
18066
  const passed = [];
17908
18067
  for (const [platform, native] of SMOKE_PROBE_EVENTS) {
17909
18068
  const rel_bridge = SMOKE_BRIDGE_PATHS[platform] ?? "";
17910
- const bridge_path = rel_bridge ? path11.join(project_root, rel_bridge) : null;
18069
+ const bridge_path = rel_bridge ? path12.join(project_root, rel_bridge) : null;
17911
18070
  const bridge_present = Boolean(
17912
18071
  bridge_path && (isFile(bridge_path) || isDir(bridge_path) && dirHasEntries(bridge_path))
17913
18072
  );
@@ -18107,9 +18266,9 @@ To remove this marker, delete this file.
18107
18266
  `;
18108
18267
  }
18109
18268
  var _CLAUDE_DESKTOP_BUNDLES_SUBPATH = "claude-desktop/bundles";
18110
- var GLOBAL_ROOT = path11.join(os6.homedir(), ".event4u", "agent-config");
18111
- var GLOBAL_USER_SETTINGS_PATH = path11.join(GLOBAL_ROOT, ".agent-user.yml");
18112
- var GLOBAL_AGENT_SETTINGS_PATH = path11.join(GLOBAL_ROOT, ".agent-settings.yml");
18269
+ var GLOBAL_ROOT = path12.join(os7.homedir(), ".event4u", "agent-config");
18270
+ var GLOBAL_USER_SETTINGS_PATH = path12.join(GLOBAL_ROOT, ".agent-user.yml");
18271
+ var GLOBAL_AGENT_SETTINGS_PATH = path12.join(GLOBAL_ROOT, ".agent-settings.yml");
18113
18272
  function _bridge_marker(tool_id, scope) {
18114
18273
  if (scope === "global") return USER_SCOPE_PATHS[tool_id] ?? "";
18115
18274
  return PROJECT_BRIDGE_MARKERS[tool_id] ?? "";
@@ -18146,6 +18305,30 @@ function _enforce_not_source_repo(scope, project_root) {
18146
18305
  `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.`
18147
18306
  );
18148
18307
  }
18308
+ function _load_yaml_doc(p) {
18309
+ if (!pathExists(p) || !isFile(p)) return {};
18310
+ let text;
18311
+ try {
18312
+ text = readText(p);
18313
+ } catch {
18314
+ return {};
18315
+ }
18316
+ const data = yamlSafeLoad(text);
18317
+ return _isPlainObject2(data) ? data : {};
18318
+ }
18319
+ function _load_default_settings(package_root) {
18320
+ const template_source = path12.join(package_root, "src", "config", "agent-settings.template.yml");
18321
+ if (!pathExists(template_source)) return {};
18322
+ let text;
18323
+ try {
18324
+ text = readText(template_source);
18325
+ } catch {
18326
+ return {};
18327
+ }
18328
+ const rendered = text.split(RULE_LOADING_TIER_PLACEHOLDER).join(DEFAULT_PROFILE).split(USER_TYPE_PLACEHOLDER).join("");
18329
+ const data = yamlSafeLoad(rendered);
18330
+ return _isPlainObject2(data) ? data : {};
18331
+ }
18149
18332
  function _resolve_scope(opts, detected, detect_reason, custom_path) {
18150
18333
  if (opts.scope === "project") return "project";
18151
18334
  if (opts.scope === "global") return "global";
@@ -18183,7 +18366,7 @@ function _run_scope_prompt(opts, reason, custom_path) {
18183
18366
  fail("Custom-path prompt aborted (EOF on stdin)");
18184
18367
  }
18185
18368
  if (!raw) fail("Custom-path prompt requires a non-empty path");
18186
- cp = resolvePath(expanduser5(raw));
18369
+ cp = resolvePath(expanduser6(raw));
18187
18370
  opts.custom_path = cp;
18188
18371
  }
18189
18372
  if (!state.QUIET) info(`Custom destination: ${cp}`);
@@ -18222,9 +18405,9 @@ function detect_scope(cwd) {
18222
18405
  if (pathExists(_resolve_settings_read(cwd))) {
18223
18406
  return ["project", `existing ${SETTINGS_FILE}`];
18224
18407
  }
18225
- const has_manifest = SCOPE_DETECT_MANIFESTS.find((m) => pathExists(path11.join(cwd, m))) ?? null;
18226
- const has_ai_dir = SCOPE_DETECT_AI_DIRS.find((d) => isDir(path11.join(cwd, d))) ?? null;
18227
- const has_ai_file = SCOPE_DETECT_AI_FILES.find((f) => pathExists(path11.join(cwd, f))) ?? null;
18408
+ const has_manifest = SCOPE_DETECT_MANIFESTS.find((m) => pathExists(path12.join(cwd, m))) ?? null;
18409
+ const has_ai_dir = SCOPE_DETECT_AI_DIRS.find((d) => isDir(path12.join(cwd, d))) ?? null;
18410
+ const has_ai_file = SCOPE_DETECT_AI_FILES.find((f) => pathExists(path12.join(cwd, f))) ?? null;
18228
18411
  if (has_manifest && (has_ai_dir || has_ai_file)) {
18229
18412
  const marker = has_ai_dir || has_ai_file;
18230
18413
  return ["prompt", `manifest (${has_manifest}) + AI-tool config (${marker})`];
@@ -18245,7 +18428,7 @@ function readLineSyncRaw(promptText) {
18245
18428
  for (; ; ) {
18246
18429
  let n;
18247
18430
  try {
18248
- n = fs13.readSync(0, buf, 0, 1, null);
18431
+ n = fs14.readSync(0, buf, 0, 1, null);
18249
18432
  } catch (err) {
18250
18433
  const code = err.code;
18251
18434
  if (code === "EAGAIN") {
@@ -18320,8 +18503,8 @@ function _files_by_tool_from_bridges(tools, project_root, scope) {
18320
18503
  const marker = _bridge_marker(tool_id, scope);
18321
18504
  if (!marker) continue;
18322
18505
  let marker_path = marker;
18323
- if (!path11.isAbsolute(marker_path)) {
18324
- marker_path = path11.join(project_root, marker_path);
18506
+ if (!path12.isAbsolute(marker_path)) {
18507
+ marker_path = path12.join(project_root, marker_path);
18325
18508
  }
18326
18509
  out[tool_id] = [_file_entry(marker_path, "bridge", false)];
18327
18510
  }
@@ -18360,26 +18543,26 @@ function _update_installed_tools_manifest(project_root, tools, scope, force, fil
18360
18543
  }
18361
18544
  write_manifest(target, version, entries);
18362
18545
  if (!state.QUIET) {
18363
- const rel = isRelativeTo(target, project_root) ? path11.relative(project_root, target) : target;
18546
+ const rel = isRelativeTo(target, project_root) ? path12.relative(project_root, target) : target;
18364
18547
  info(`Manifest updated: ${rel}`);
18365
18548
  }
18366
18549
  return 0;
18367
18550
  }
18368
18551
  function isRelativeTo(child, parent) {
18369
- const rel = path11.relative(parent, child);
18370
- return rel === "" || !rel.startsWith("..") && !path11.isAbsolute(rel);
18552
+ const rel = path12.relative(parent, child);
18553
+ return rel === "" || !rel.startsWith("..") && !path12.isAbsolute(rel);
18371
18554
  }
18372
18555
  function _resolve_package_root_for_global() {
18373
18556
  const here = resolvePath(_HERE2);
18374
- const candidate = path11.dirname(path11.dirname(path11.dirname(here)));
18375
- if (!pathExists(path11.join(candidate, "src", "config", "profiles", "minimal.ini"))) {
18557
+ const candidate = path12.dirname(path12.dirname(path12.dirname(here)));
18558
+ if (!pathExists(path12.join(candidate, "src", "config", "profiles", "minimal.ini"))) {
18376
18559
  fail(
18377
18560
  `Could not locate agent-config package root from ${here}. Expected src/config/profiles/minimal.ini at the parent directory.`
18378
18561
  );
18379
18562
  }
18380
18563
  return candidate;
18381
18564
  }
18382
- var CONSUMER_BRIDGE_MARKER_RELPATH = path11.join("agents", ".event4u-bridge.yml");
18565
+ var CONSUMER_BRIDGE_MARKER_RELPATH = path12.join("agents", ".event4u-bridge.yml");
18383
18566
  var MIGRATE_LEGACY_YAML_FILES = [".agent-settings.yml", ".agent-user.yml"];
18384
18567
  var MIGRATE_LEGACY_TOOL_DIRS = [".augment", ".claude", ".cursor"];
18385
18568
  var AGENT_CONFIG_PACKAGE_NAME = "@event4u/agent-config";
@@ -18387,7 +18570,7 @@ function _is_agent_config_source_repo(project_root) {
18387
18570
  if (process3.env["AGENT_CONFIG_CONSUMER_MODE"] === "1") {
18388
18571
  return [false, "consumer-mode-override"];
18389
18572
  }
18390
- const pkg_json = path11.join(project_root, "package.json");
18573
+ const pkg_json = path12.join(project_root, "package.json");
18391
18574
  if (isFile(pkg_json)) {
18392
18575
  let data = {};
18393
18576
  try {
@@ -18399,18 +18582,18 @@ function _is_agent_config_source_repo(project_root) {
18399
18582
  return [true, "package.json:name"];
18400
18583
  }
18401
18584
  }
18402
- if (isDir(path11.join(project_root, ".agent-src.uncondensed"))) {
18585
+ if (isDir(path12.join(project_root, ".agent-src.uncondensed"))) {
18403
18586
  return [true, ".agent-src.uncondensed/"];
18404
18587
  }
18405
- const packages_dir = path11.join(project_root, "packages");
18588
+ const packages_dir = path12.join(project_root, "packages");
18406
18589
  if (isDir(packages_dir)) {
18407
- for (const child of fs13.readdirSync(packages_dir)) {
18408
- if (isDir(path11.join(packages_dir, child, ".agent-src.uncondensed"))) {
18590
+ for (const child of fs14.readdirSync(packages_dir)) {
18591
+ if (isDir(path12.join(packages_dir, child, ".agent-src.uncondensed"))) {
18409
18592
  return [true, `packages/${child}/.agent-src.uncondensed/`];
18410
18593
  }
18411
18594
  }
18412
18595
  }
18413
- const installer_self = path11.join(project_root, "scripts", "install.py");
18596
+ const installer_self = path12.join(project_root, "scripts", "install.py");
18414
18597
  try {
18415
18598
  if (isFile(installer_self) && resolvePath(installer_self) === resolvePath(_HERE2)) {
18416
18599
  return [true, "src/scripts/install.py (self)"];
@@ -18430,17 +18613,17 @@ function _detect_legacy_for_migration(project_root) {
18430
18613
  }
18431
18614
  return [];
18432
18615
  }
18433
- if (isFile(path11.join(project_root, INSTALL_MODE_MARKER_REL))) return [];
18616
+ if (isFile(path12.join(project_root, INSTALL_MODE_MARKER_REL))) return [];
18434
18617
  const found = [];
18435
18618
  for (const name of MIGRATE_LEGACY_YAML_FILES) {
18436
- if (isFile(path11.join(project_root, name))) {
18619
+ if (isFile(path12.join(project_root, name))) {
18437
18620
  found.push(name);
18438
- } else if (isFile(path11.join(project_root, "settings", name))) {
18621
+ } else if (isFile(path12.join(project_root, "settings", name))) {
18439
18622
  found.push(`settings/${name}`);
18440
18623
  }
18441
18624
  }
18442
18625
  for (const name of MIGRATE_LEGACY_TOOL_DIRS) {
18443
- const p = path11.join(project_root, name);
18626
+ const p = path12.join(project_root, name);
18444
18627
  if (isDir(p) && !isSymlink(p)) {
18445
18628
  found.push(`${name}/`);
18446
18629
  }
@@ -18452,7 +18635,7 @@ function _prompt_migrate_to_global(project_root, artefacts) {
18452
18635
  process3.stdout.write("\n");
18453
18636
  warn("Legacy project-local artefacts detected \u2014 pre-ADR-020 layout:");
18454
18637
  for (const rel of artefacts) {
18455
- info(` ${path11.join(project_root, rel)}`);
18638
+ info(` ${path12.join(project_root, rel)}`);
18456
18639
  }
18457
18640
  info("The unified `agent-config migrate` sweeps these in one pass.");
18458
18641
  info("The wizard recreates fresh config afterwards.");
@@ -18481,22 +18664,22 @@ function _run_migrate_to_global(project_root) {
18481
18664
  }
18482
18665
  }
18483
18666
  function _format_global_root_for_marker(global_root) {
18484
- const home = resolvePath(os6.homedir());
18667
+ const home = resolvePath(os7.homedir());
18485
18668
  const resolved = resolvePath(global_root);
18486
- const rel = path11.relative(home, resolved);
18487
- if (rel === "" || rel.startsWith("..") || path11.isAbsolute(rel)) {
18669
+ const rel = path12.relative(home, resolved);
18670
+ if (rel === "" || rel.startsWith("..") || path12.isAbsolute(rel)) {
18488
18671
  return global_root;
18489
18672
  }
18490
- return `~/${rel.split(path11.sep).join("/")}`;
18673
+ return `~/${rel.split(path12.sep).join("/")}`;
18491
18674
  }
18492
18675
  function _remove_legacy_consumer_bridge_marker(project_root, env = null) {
18493
18676
  const env_map = env ?? process3.env;
18494
18677
  if (env_map["AGENT_CONFIG_DEV_MODE"] === "1") return null;
18495
- if (isDir(path11.join(project_root, ".agent-src.uncondensed"))) return null;
18496
- const target = path11.join(project_root, CONSUMER_BRIDGE_MARKER_RELPATH);
18678
+ if (isDir(path12.join(project_root, ".agent-src.uncondensed"))) return null;
18679
+ const target = path12.join(project_root, CONSUMER_BRIDGE_MARKER_RELPATH);
18497
18680
  if (!isFile(target)) return null;
18498
18681
  try {
18499
- fs13.rmSync(target);
18682
+ fs14.rmSync(target);
18500
18683
  } catch {
18501
18684
  return null;
18502
18685
  }
@@ -18510,7 +18693,7 @@ var PROJECT_ANCHOR_TOOLS = {
18510
18693
  function _write_per_tool_project_anchors(project_root, tools, env = null, now = null) {
18511
18694
  const env_map = env ?? process3.env;
18512
18695
  if (env_map["AGENT_CONFIG_DEV_MODE"] === "1") return [];
18513
- if (isDir(path11.join(project_root, ".agent-src.uncondensed"))) return [];
18696
+ if (isDir(path12.join(project_root, ".agent-src.uncondensed"))) return [];
18514
18697
  const global_root_str = _format_global_root_for_marker(
18515
18698
  event4u_root(env_map)
18516
18699
  );
@@ -18519,8 +18702,8 @@ function _write_per_tool_project_anchors(project_root, tools, env = null, now =
18519
18702
  for (const tool_id of Object.keys(PROJECT_ANCHOR_TOOLS).sort()) {
18520
18703
  const rel_path = PROJECT_ANCHOR_TOOLS[tool_id];
18521
18704
  if (!tools.has(tool_id)) continue;
18522
- const target = path11.join(project_root, rel_path);
18523
- mkdirp(path11.dirname(target));
18705
+ const target = path12.join(project_root, rel_path);
18706
+ mkdirp(path12.dirname(target));
18524
18707
  const body = `# event4u/agent-config \u2014 per-tool project anchor (auto-written).
18525
18708
  # Spec: docs/contracts/consumer-bridge.md \xA7 Per-tool anchor strategy.
18526
18709
  # Tool: ${tool_id}. Resolves the global install directly \u2014 no
@@ -18538,7 +18721,7 @@ installed_at: ${stamp}
18538
18721
  }
18539
18722
  var PACKAGE_TAG_ID = "event4u/agent-config";
18540
18723
  function _inject_package_tag(target, source, package_root) {
18541
- if (path11.extname(target) !== ".md") return;
18724
+ if (path12.extname(target) !== ".md") return;
18542
18725
  let text;
18543
18726
  try {
18544
18727
  text = readText(target);
@@ -18566,8 +18749,8 @@ function _inject_package_tag(target, source, package_root) {
18566
18749
  resolved_src = source;
18567
18750
  }
18568
18751
  if (package_root !== null) {
18569
- const rel = path11.relative(resolvePath(package_root), resolved_src);
18570
- if (rel !== "" && !rel.startsWith("..") && !path11.isAbsolute(rel)) {
18752
+ const rel = path12.relative(resolvePath(package_root), resolved_src);
18753
+ if (rel !== "" && !rel.startsWith("..") && !path12.isAbsolute(rel)) {
18571
18754
  source_value = rel;
18572
18755
  } else {
18573
18756
  source_value = resolved_src;
@@ -18604,10 +18787,10 @@ function _copy_dir_dereferencing_symlinks(src, dest, force, package_root = null)
18604
18787
  const written_paths = [];
18605
18788
  if (!pathExists(src)) return [0, 0, written_paths];
18606
18789
  if (!isDir(src)) {
18607
- mkdirp(path11.dirname(dest));
18790
+ mkdirp(path12.dirname(dest));
18608
18791
  const decision = _resolve_file_conflict(dest, force);
18609
18792
  if (decision === "skip") return [0, 1, written_paths];
18610
- fs13.copyFileSync(src, dest);
18793
+ fs14.copyFileSync(src, dest);
18611
18794
  _inject_package_tag(dest, src, package_root);
18612
18795
  written_paths.push(dest);
18613
18796
  return [1, 0, written_paths];
@@ -18615,11 +18798,11 @@ function _copy_dir_dereferencing_symlinks(src, dest, force, package_root = null)
18615
18798
  mkdirp(dest);
18616
18799
  const walk = (node) => {
18617
18800
  const acc = [];
18618
- const names = fs13.readdirSync(node).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
18801
+ const names = fs14.readdirSync(node).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
18619
18802
  for (const name of names) {
18620
- const entry = path11.join(node, name);
18803
+ const entry = path12.join(node, name);
18621
18804
  acc.push(entry);
18622
- const lst = fs13.lstatSync(entry);
18805
+ const lst = fs14.lstatSync(entry);
18623
18806
  if (lst.isDirectory() && !lst.isSymbolicLink()) {
18624
18807
  acc.push(...walk(entry));
18625
18808
  }
@@ -18627,9 +18810,9 @@ function _copy_dir_dereferencing_symlinks(src, dest, force, package_root = null)
18627
18810
  return acc;
18628
18811
  };
18629
18812
  for (const entry of walk(src)) {
18630
- const rel = path11.relative(src, entry);
18631
- const target = path11.join(dest, rel);
18632
- const lst = fs13.lstatSync(entry);
18813
+ const rel = path12.relative(src, entry);
18814
+ const target = path12.join(dest, rel);
18815
+ const lst = fs14.lstatSync(entry);
18633
18816
  if (lst.isDirectory() && !lst.isSymbolicLink()) {
18634
18817
  mkdirp(target);
18635
18818
  continue;
@@ -18637,8 +18820,8 @@ function _copy_dir_dereferencing_symlinks(src, dest, force, package_root = null)
18637
18820
  let resolvedIsDir = false;
18638
18821
  let resolved = entry;
18639
18822
  try {
18640
- resolved = fs13.realpathSync(entry);
18641
- resolvedIsDir = fs13.statSync(entry).isDirectory();
18823
+ resolved = fs14.realpathSync(entry);
18824
+ resolvedIsDir = fs14.statSync(entry).isDirectory();
18642
18825
  } catch {
18643
18826
  resolvedIsDir = false;
18644
18827
  }
@@ -18660,8 +18843,8 @@ function _copy_dir_dereferencing_symlinks(src, dest, force, package_root = null)
18660
18843
  skipped += 1;
18661
18844
  continue;
18662
18845
  }
18663
- mkdirp(path11.dirname(target));
18664
- fs13.copyFileSync(resolved, target);
18846
+ mkdirp(path12.dirname(target));
18847
+ fs14.copyFileSync(resolved, target);
18665
18848
  _inject_package_tag(target, resolved, package_root);
18666
18849
  written += 1;
18667
18850
  written_paths.push(target);
@@ -18672,8 +18855,8 @@ function _claude_desktop_bundles_dir() {
18672
18855
  return write_target(_CLAUDE_DESKTOP_BUNDLES_SUBPATH);
18673
18856
  }
18674
18857
  function _write_claude_desktop_marker(_force, lockfile_path2, bundles_dir, bundle_count) {
18675
- const anchor = expanduser5(USER_SCOPE_PATHS["claude-desktop"]);
18676
- const target = path11.join(anchor, "agent-config.md");
18858
+ const anchor = expanduser6(USER_SCOPE_PATHS["claude-desktop"]);
18859
+ const target = path12.join(anchor, "agent-config.md");
18677
18860
  mkdirp(anchor);
18678
18861
  const body = claudeDesktopMarkerBody(lockfile_path2, anchor, bundles_dir, bundle_count);
18679
18862
  writeText(target, body);
@@ -18697,48 +18880,49 @@ function _apply_claude_flat_command_wrappers(anchor, package_root, current_files
18697
18880
  const wrapped = [];
18698
18881
  const collisions = [];
18699
18882
  const reserved = [];
18700
- const commands_dir = path11.join(anchor, "commands");
18883
+ const commands_dir = path12.join(anchor, "commands");
18701
18884
  let flat_entries = [];
18702
18885
  try {
18703
- flat_entries = fs13.readdirSync(commands_dir).filter((f) => f.endsWith(".md"));
18886
+ flat_entries = fs14.readdirSync(commands_dir).filter((f) => f.endsWith(".md"));
18704
18887
  } catch {
18705
18888
  }
18706
18889
  for (const fname of flat_entries.sort()) {
18707
18890
  const slug = fname.slice(0, -".md".length);
18708
18891
  if (!is_claude_builtin_name(slug)) continue;
18709
- fs13.rmSync(path11.join(commands_dir, fname), { force: true });
18892
+ fs14.rmSync(path12.join(commands_dir, fname), { force: true });
18710
18893
  current_files.delete(`commands/${fname}`);
18711
18894
  reserved.push(slug);
18712
18895
  }
18713
18896
  const eligible = new Set(_CLAUDE_FLAT_WRAPPER_EXTRA);
18714
18897
  try {
18715
18898
  const manifest = JSON.parse(
18716
- fs13.readFileSync(path11.join(package_root, "dist", "discovery", "discovery-manifest.json"), "utf8")
18899
+ fs14.readFileSync(path12.join(package_root, "dist", "discovery", "discovery-manifest.json"), "utf8")
18717
18900
  );
18718
18901
  for (const a of manifest.artefacts ?? []) {
18719
18902
  if (a.category !== "command" || typeof a.slug !== "string") continue;
18720
- if ((a.tier ?? 2) <= 1 && a.visibility !== "internal") eligible.add(a.slug);
18903
+ const visible = typeof a.visibility === "string" ? a.visibility !== "internal" : typeof a.tier === "number" ? a.tier <= 1 : false;
18904
+ if (visible) eligible.add(a.slug);
18721
18905
  }
18722
18906
  } catch {
18723
18907
  }
18724
18908
  for (const slug of [...eligible].sort()) {
18725
18909
  const flat_rel = `commands/${slug}.md`;
18726
- const flat_abs = path11.join(anchor, "commands", `${slug}.md`);
18727
- if (!fs13.existsSync(flat_abs)) continue;
18728
- const skill_dir = path11.join(anchor, "skills", slug);
18729
- if (fs13.existsSync(skill_dir)) {
18910
+ const flat_abs = path12.join(anchor, "commands", `${slug}.md`);
18911
+ if (!fs14.existsSync(flat_abs)) continue;
18912
+ const skill_dir = path12.join(anchor, "skills", slug);
18913
+ if (fs14.existsSync(skill_dir)) {
18730
18914
  collisions.push(slug);
18731
18915
  continue;
18732
18916
  }
18733
- let body = fs13.readFileSync(flat_abs, "utf8");
18917
+ let body = fs14.readFileSync(flat_abs, "utf8");
18734
18918
  if (body.startsWith("---\n") && !/^name:/m.test(body.split("\n---")[0] ?? "")) {
18735
18919
  body = body.replace("---\n", `---
18736
18920
  name: ${slug}
18737
18921
  `);
18738
18922
  }
18739
- fs13.mkdirSync(skill_dir, { recursive: true });
18740
- fs13.writeFileSync(path11.join(skill_dir, "SKILL.md"), body, "utf8");
18741
- fs13.rmSync(flat_abs, { force: true });
18923
+ fs14.mkdirSync(skill_dir, { recursive: true });
18924
+ fs14.writeFileSync(path12.join(skill_dir, "SKILL.md"), body, "utf8");
18925
+ fs14.rmSync(flat_abs, { force: true });
18742
18926
  current_files.delete(flat_rel);
18743
18927
  current_files.add(`skills/${slug}/SKILL.md`);
18744
18928
  wrapped.push(slug);
@@ -18763,14 +18947,14 @@ function _deploy_global_content(tools, force, package_root, lockfile_path2) {
18763
18947
  results[tool_id] = [0, 0, "unsupported", []];
18764
18948
  continue;
18765
18949
  }
18766
- const anchor = expanduser5(anchor_raw);
18950
+ const anchor = expanduser6(anchor_raw);
18767
18951
  let written_total = 0;
18768
18952
  let skipped_total = 0;
18769
18953
  const written_paths = [];
18770
18954
  let current_files = /* @__PURE__ */ new Set();
18771
18955
  for (const [src_rel, dest_sub] of plan) {
18772
- const src = path11.join(package_root, src_rel);
18773
- const dest = dest_sub ? path11.join(anchor, dest_sub) : anchor;
18956
+ const src = path12.join(package_root, src_rel);
18957
+ const dest = dest_sub ? path12.join(anchor, dest_sub) : anchor;
18774
18958
  const [w, s, paths] = _copy_dir_dereferencing_symlinks(src, dest, force, package_root);
18775
18959
  written_total += w;
18776
18960
  skipped_total += s;
@@ -18833,10 +19017,10 @@ function _deploy_global_content(tools, force, package_root, lockfile_path2) {
18833
19017
  results[tool_id] = [written_total, skipped_total, "deployed", written_paths];
18834
19018
  if (tool_id === "claude-code") {
18835
19019
  try {
18836
- const manifest = path11.join(package_root, "src", "scripts", "hook_manifest.yaml");
19020
+ const manifest = path12.join(package_root, "src", "scripts", "hook_manifest.yaml");
18837
19021
  const matrix = build_claude_hook_matrix(manifest);
18838
19022
  const res = ensure_managed_hooks(
18839
- path11.join(anchor, "settings.json"),
19023
+ path12.join(anchor, "settings.json"),
18840
19024
  matrix
18841
19025
  );
18842
19026
  if (!state.QUIET) {
@@ -18869,10 +19053,10 @@ function _preview_global_reap(tools, package_root) {
18869
19053
  if (plan === void 0) continue;
18870
19054
  const anchor_raw = USER_SCOPE_PATHS[tool_id];
18871
19055
  if (!anchor_raw) continue;
18872
- const anchor = expanduser5(anchor_raw);
19056
+ const anchor = expanduser6(anchor_raw);
18873
19057
  let current_files = /* @__PURE__ */ new Set();
18874
19058
  for (const [src_rel, dest_sub] of plan) {
18875
- const src = path11.join(package_root, src_rel);
19059
+ const src = path12.join(package_root, src_rel);
18876
19060
  current_files = setUnion(
18877
19061
  current_files,
18878
19062
  expected_deploy_files(src, dest_sub ? dest_sub : "")
@@ -18902,14 +19086,14 @@ function _preview_global_reap(tools, package_root) {
18902
19086
  function _verify_deploy_targets(anchor, plan) {
18903
19087
  const missing = [];
18904
19088
  for (const [, dest_sub] of plan) {
18905
- const target = dest_sub ? path11.join(anchor, dest_sub) : anchor;
19089
+ const target = dest_sub ? path12.join(anchor, dest_sub) : anchor;
18906
19090
  const label = dest_sub || ".";
18907
19091
  if (!isDir(target)) {
18908
19092
  missing.push(label);
18909
19093
  continue;
18910
19094
  }
18911
19095
  try {
18912
- const entries = fs13.readdirSync(target);
19096
+ const entries = fs14.readdirSync(target);
18913
19097
  if (entries.length === 0) missing.push(label);
18914
19098
  } catch {
18915
19099
  missing.push(label);
@@ -18917,22 +19101,22 @@ function _verify_deploy_targets(anchor, plan) {
18917
19101
  }
18918
19102
  return missing;
18919
19103
  }
18920
- function _prune_lab_modules(deploy_results, lab_ids) {
19104
+ function _prune_modules_by(deploy_results, is_pruned) {
18921
19105
  let pruned = 0;
18922
19106
  const adjusted = {};
18923
19107
  for (const tool_id of Object.keys(deploy_results)) {
18924
19108
  const [written, skipped, status, paths] = deploy_results[tool_id];
18925
- const lab_skill_dirs = /* @__PURE__ */ new Set();
19109
+ const pruned_skill_dirs = /* @__PURE__ */ new Set();
18926
19110
  for (const p of paths) {
18927
- const parts = p.split(path11.sep);
19111
+ const parts = p.split(path12.sep);
18928
19112
  if (parts.includes("skills")) {
18929
19113
  const i = parts.indexOf("skills");
18930
19114
  if (i + 1 < parts.length) {
18931
- const skill_root = parts.slice(0, i + 2).join(path11.sep);
18932
- if (!lab_skill_dirs.has(skill_root)) {
18933
- const skillmd = path11.join(skill_root, "SKILL.md");
18934
- if (pathExists(skillmd) && is_lab_artefact(skillmd, lab_ids)) {
18935
- lab_skill_dirs.add(skill_root);
19115
+ const skill_root = parts.slice(0, i + 2).join(path12.sep);
19116
+ if (!pruned_skill_dirs.has(skill_root)) {
19117
+ const skillmd = path12.join(skill_root, "SKILL.md");
19118
+ if (pathExists(skillmd) && is_pruned(skillmd)) {
19119
+ pruned_skill_dirs.add(skill_root);
18936
19120
  }
18937
19121
  }
18938
19122
  }
@@ -18941,25 +19125,25 @@ function _prune_lab_modules(deploy_results, lab_ids) {
18941
19125
  const keep = [];
18942
19126
  const delete_files = [];
18943
19127
  for (const p of paths) {
18944
- const parts = p.split(path11.sep);
18945
- let is_lab = false;
19128
+ const parts = p.split(path12.sep);
19129
+ let is_target = false;
18946
19130
  if (parts.includes("skills")) {
18947
19131
  const i = parts.indexOf("skills");
18948
- if (i + 1 < parts.length && lab_skill_dirs.has(parts.slice(0, i + 2).join(path11.sep))) {
18949
- is_lab = true;
19132
+ if (i + 1 < parts.length && pruned_skill_dirs.has(parts.slice(0, i + 2).join(path12.sep))) {
19133
+ is_target = true;
18950
19134
  }
18951
- } else if (parts.includes("commands") && path11.extname(p) === ".md" && is_lab_artefact(p, lab_ids)) {
18952
- is_lab = true;
19135
+ } else if (parts.includes("commands") && path12.extname(p) === ".md" && is_pruned(p)) {
19136
+ is_target = true;
18953
19137
  }
18954
- (is_lab ? delete_files : keep).push(p);
19138
+ (is_target ? delete_files : keep).push(p);
18955
19139
  }
18956
- for (const d of lab_skill_dirs) {
18957
- fs13.rmSync(d, { recursive: true, force: true });
19140
+ for (const d of pruned_skill_dirs) {
19141
+ fs14.rmSync(d, { recursive: true, force: true });
18958
19142
  }
18959
19143
  for (const p of delete_files) {
18960
- if (p.split(path11.sep).includes("commands") && pathExists(p)) {
19144
+ if (p.split(path12.sep).includes("commands") && pathExists(p)) {
18961
19145
  try {
18962
- fs13.unlinkSync(p);
19146
+ fs14.unlinkSync(p);
18963
19147
  } catch {
18964
19148
  }
18965
19149
  }
@@ -18969,6 +19153,85 @@ function _prune_lab_modules(deploy_results, lab_ids) {
18969
19153
  }
18970
19154
  return [pruned, adjusted];
18971
19155
  }
19156
+ function _prune_lab_modules(deploy_results, lab_ids) {
19157
+ return _prune_modules_by(deploy_results, (p) => is_lab_artefact(p, lab_ids));
19158
+ }
19159
+ var SCOPED_ACTIVE_WORKSPACES = /* @__PURE__ */ new Set(["engineering", "agent-config-maintainer"]);
19160
+ function _load_packs_registry(package_root) {
19161
+ const vocab_path = path12.join(package_root, "src", "config", "discovery", "packs.yml");
19162
+ const data = yamlSafeLoad(readText(vocab_path));
19163
+ if (!Array.isArray(data)) {
19164
+ throw new Error(`packs.yml did not parse to a list: ${vocab_path}`);
19165
+ }
19166
+ const out = [];
19167
+ for (const entry of data) {
19168
+ if (!_isPlainObject2(entry)) continue;
19169
+ const id = entry["id"];
19170
+ if (typeof id !== "string" || id === "") continue;
19171
+ const workspaces_raw = entry["workspaces"];
19172
+ const workspaces = Array.isArray(workspaces_raw) ? workspaces_raw.filter((w) => typeof w === "string") : [];
19173
+ const requires_raw = entry["requires"] ?? entry["requires_hint"];
19174
+ const requires = Array.isArray(requires_raw) ? requires_raw.filter((r) => typeof r === "string") : [];
19175
+ out.push({ id, workspaces, requires });
19176
+ }
19177
+ return out;
19178
+ }
19179
+ function _compute_active_pack_ids(packs, runtime_active_packs) {
19180
+ const by_id = /* @__PURE__ */ new Map();
19181
+ for (const p of packs) by_id.set(p.id, p);
19182
+ const active = /* @__PURE__ */ new Set();
19183
+ for (const p of packs) {
19184
+ if (p.workspaces.some((w) => SCOPED_ACTIVE_WORKSPACES.has(w))) {
19185
+ active.add(p.id);
19186
+ }
19187
+ }
19188
+ for (const id of runtime_active_packs) {
19189
+ active.add(id);
19190
+ }
19191
+ let frontier = [...active];
19192
+ while (frontier.length > 0) {
19193
+ const next = [];
19194
+ for (const id of frontier) {
19195
+ const rec = by_id.get(id);
19196
+ if (rec === void 0) continue;
19197
+ for (const dep of rec.requires) {
19198
+ if (!active.has(dep)) {
19199
+ active.add(dep);
19200
+ next.push(dep);
19201
+ }
19202
+ }
19203
+ }
19204
+ frontier = next;
19205
+ }
19206
+ return active;
19207
+ }
19208
+ function _resolve_global_settings_doc() {
19209
+ const root = event4u_root();
19210
+ const canonical = path12.join(root, "settings", SETTINGS_FILE);
19211
+ if (pathExists(canonical)) return _load_yaml_doc(canonical);
19212
+ const legacy = path12.join(root, SETTINGS_FILE);
19213
+ if (pathExists(legacy)) return _load_yaml_doc(legacy);
19214
+ return null;
19215
+ }
19216
+ function _resolve_scoped_projection(package_root) {
19217
+ const doc = _resolve_global_settings_doc() ?? _load_default_settings(package_root);
19218
+ const projection = _isPlainObject2(doc["projection"]) ? doc["projection"] : {};
19219
+ const mode = projection["mode"] === "scoped" ? "scoped" : "legacy-all";
19220
+ const runtime = _isPlainObject2(doc["runtime"]) ? doc["runtime"] : {};
19221
+ const active_packs_raw = runtime["active_packs"];
19222
+ const active_packs = Array.isArray(active_packs_raw) ? active_packs_raw.filter((v) => typeof v === "string") : [];
19223
+ return { mode, active_packs };
19224
+ }
19225
+ function _prune_scoped_modules(deploy_results, active_ids) {
19226
+ return _prune_modules_by(deploy_results, (p) => {
19227
+ const packs = frontmatter_packs(p);
19228
+ if (packs.size === 0) return false;
19229
+ for (const id of packs) {
19230
+ if (active_ids.has(id)) return false;
19231
+ }
19232
+ return true;
19233
+ });
19234
+ }
18972
19235
  function install_global(tools, force, project_root = null, core_only = false) {
18973
19236
  const migrated = migrate_legacy_namespace();
18974
19237
  if (migrated && !state.QUIET) {
@@ -19023,6 +19286,15 @@ function install_global(tools, force, project_root = null, core_only = false) {
19023
19286
  info(` schema_version=1, agent_config_version=${installed_version}`);
19024
19287
  info(` tools=${merged_tools.join(",")}`);
19025
19288
  }
19289
+ if (project_root !== null && pathExists(_resolve_settings_read(project_root)) && !isDir(path12.join(project_root, ".agent-src.uncondensed"))) {
19290
+ const drift = collect_drift(project_root);
19291
+ if (!state.QUIET) {
19292
+ process3.stdout.write("\n");
19293
+ for (const line of format_drift_report(drift).replace(/\n$/, "").split("\n")) {
19294
+ info(line);
19295
+ }
19296
+ }
19297
+ }
19026
19298
  const package_root = _resolve_package_root_for_global();
19027
19299
  let deploy_results = _deploy_global_content(tools, force, package_root, written);
19028
19300
  if (core_only) {
@@ -19035,6 +19307,24 @@ function install_global(tools, force, project_root = null, core_only = false) {
19035
19307
  );
19036
19308
  }
19037
19309
  }
19310
+ try {
19311
+ const { mode, active_packs } = _resolve_scoped_projection(package_root);
19312
+ if (mode === "scoped") {
19313
+ const packs_registry = _load_packs_registry(package_root);
19314
+ const active_ids = _compute_active_pack_ids(packs_registry, active_packs);
19315
+ let scoped_pruned;
19316
+ [scoped_pruned, deploy_results] = _prune_scoped_modules(deploy_results, active_ids);
19317
+ if (!state.QUIET) {
19318
+ info(
19319
+ `\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.`
19320
+ );
19321
+ }
19322
+ }
19323
+ } catch (e) {
19324
+ if (!state.QUIET) {
19325
+ warn(`Scoped-projection prune failed \u2014 restoring full tree (${String(e)}).`);
19326
+ }
19327
+ }
19038
19328
  const failed_tools = new Set(
19039
19329
  Object.keys(deploy_results).filter(
19040
19330
  (tool_id) => deploy_results[tool_id][2] === "deploy_failed"
@@ -19096,19 +19386,19 @@ function install_global(tools, force, project_root = null, core_only = false) {
19096
19386
  }
19097
19387
  }
19098
19388
  }
19099
- if (project_root !== null && pathExists(_resolve_settings_read(project_root)) && !isDir(path11.join(project_root, ".agent-src.uncondensed"))) {
19389
+ if (project_root !== null && pathExists(_resolve_settings_read(project_root)) && !isDir(path12.join(project_root, ".agent-src.uncondensed"))) {
19100
19390
  const files_by_tool = _files_by_tool_from_deploy(deploy_results);
19101
19391
  const rc = _update_installed_tools_manifest(project_root, tools, "global", force, files_by_tool);
19102
19392
  if (rc !== 0) return rc;
19103
19393
  const removed_marker = _remove_legacy_consumer_bridge_marker(project_root);
19104
19394
  if (removed_marker !== null && !state.QUIET) {
19105
- const rel = isRelativeTo(removed_marker, project_root) ? path11.relative(project_root, removed_marker) : removed_marker;
19395
+ const rel = isRelativeTo(removed_marker, project_root) ? path12.relative(project_root, removed_marker) : removed_marker;
19106
19396
  info(`Removed legacy bridge marker: ${rel}`);
19107
19397
  }
19108
19398
  const anchor_paths = _write_per_tool_project_anchors(project_root, tools);
19109
19399
  if (anchor_paths.length > 0 && !state.QUIET) {
19110
19400
  for (const p of anchor_paths) {
19111
- const rel = isRelativeTo(p, project_root) ? path11.relative(project_root, p) : p;
19401
+ const rel = isRelativeTo(p, project_root) ? path12.relative(project_root, p) : p;
19112
19402
  info(`Project anchor written: ${rel}`);
19113
19403
  }
19114
19404
  }
@@ -19125,8 +19415,8 @@ function install_global(tools, force, project_root = null, core_only = false) {
19125
19415
  }
19126
19416
  return 0;
19127
19417
  }
19128
- var SETTINGS_SURFACE_REL = path11.join("state", "settings-surface.json");
19129
- var SETTINGS_DELTA_REL = path11.join("state", "settings-delta.json");
19418
+ var SETTINGS_SURFACE_REL = path12.join("state", "settings-surface.json");
19419
+ var SETTINGS_DELTA_REL = path12.join("state", "settings-delta.json");
19130
19420
  function _current_settings_surface(version) {
19131
19421
  const jsonSchema = zodToJsonSchema(settingsSchema, {
19132
19422
  name: "AgentSettings",
@@ -19137,20 +19427,20 @@ function _current_settings_surface(version) {
19137
19427
  }
19138
19428
  function _write_settings_surface_snapshot(installed_version) {
19139
19429
  const root = event4u_root();
19140
- const surface_path = path11.join(root, SETTINGS_SURFACE_REL);
19141
- const delta_path = path11.join(root, SETTINGS_DELTA_REL);
19430
+ const surface_path = path12.join(root, SETTINGS_SURFACE_REL);
19431
+ const delta_path = path12.join(root, SETTINGS_DELTA_REL);
19142
19432
  const next = _current_settings_surface(installed_version);
19143
19433
  let previous = null;
19144
19434
  try {
19145
- const parsed = JSON.parse(fs13.readFileSync(surface_path, "utf8"));
19435
+ const parsed = JSON.parse(fs14.readFileSync(surface_path, "utf8"));
19146
19436
  if (parsed !== null && typeof parsed === "object" && parsed.entries !== void 0) previous = parsed;
19147
19437
  } catch {
19148
19438
  }
19149
19439
  if (previous !== null && previous.version !== next.version) {
19150
19440
  const delta = computeSurfaceDelta(previous, next);
19151
19441
  if (delta.changes.length > 0) {
19152
- fs13.mkdirSync(path11.dirname(delta_path), { recursive: true, mode: 448 });
19153
- fs13.writeFileSync(delta_path, `${JSON.stringify(delta, null, 2)}
19442
+ fs14.mkdirSync(path12.dirname(delta_path), { recursive: true, mode: 448 });
19443
+ fs14.writeFileSync(delta_path, `${JSON.stringify(delta, null, 2)}
19154
19444
  `, { mode: 384 });
19155
19445
  if (!state.QUIET) {
19156
19446
  const counts = {};
@@ -19162,8 +19452,8 @@ function _write_settings_surface_snapshot(installed_version) {
19162
19452
  }
19163
19453
  }
19164
19454
  }
19165
- fs13.mkdirSync(path11.dirname(surface_path), { recursive: true, mode: 448 });
19166
- fs13.writeFileSync(surface_path, `${JSON.stringify(next, null, 2)}
19455
+ fs14.mkdirSync(path12.dirname(surface_path), { recursive: true, mode: 448 });
19456
+ fs14.writeFileSync(surface_path, `${JSON.stringify(next, null, 2)}
19167
19457
  `, { mode: 384 });
19168
19458
  }
19169
19459
  function arrayStrEqual(a, b) {
@@ -19375,13 +19665,13 @@ function _minimal_templates_root() {
19375
19665
  const chain = [start];
19376
19666
  let cur = start;
19377
19667
  for (; ; ) {
19378
- const parent = path11.dirname(cur);
19668
+ const parent = path12.dirname(cur);
19379
19669
  if (parent === cur) break;
19380
19670
  chain.push(parent);
19381
19671
  cur = parent;
19382
19672
  }
19383
19673
  for (const ancestor of chain) {
19384
- const candidate = path11.join(ancestor, "src", "templates", "minimal");
19674
+ const candidate = path12.join(ancestor, "src", "templates", "minimal");
19385
19675
  if (isDir(candidate)) return candidate;
19386
19676
  }
19387
19677
  fail("Could not locate src/templates/minimal/ \u2014 package install is corrupt.");
@@ -19389,9 +19679,9 @@ function _minimal_templates_root() {
19389
19679
  var INSTALL_MODE_MARKER_REL = "agents/.agent-state/install-mode.txt";
19390
19680
  function _write_install_mode_marker(project_root, mode) {
19391
19681
  if (mode !== "minimal" && mode !== "full") return;
19392
- const marker = path11.join(project_root, INSTALL_MODE_MARKER_REL);
19682
+ const marker = path12.join(project_root, INSTALL_MODE_MARKER_REL);
19393
19683
  try {
19394
- mkdirp(path11.dirname(marker));
19684
+ mkdirp(path12.dirname(marker));
19395
19685
  writeText(marker, `${mode}
19396
19686
  `);
19397
19687
  } catch {
@@ -19400,7 +19690,7 @@ function _write_install_mode_marker(project_root, mode) {
19400
19690
  function install_minimal(target_root_in, force, user_type = "") {
19401
19691
  let target_root = resolvePath(target_root_in);
19402
19692
  mkdirp(target_root);
19403
- const parent = path11.dirname(target_root);
19693
+ const parent = path12.dirname(target_root);
19404
19694
  if (parent !== target_root) {
19405
19695
  const existing = find_project_root_with_anchor(parent);
19406
19696
  if (existing !== null && existing[0] !== target_root) {
@@ -19411,21 +19701,21 @@ function install_minimal(target_root_in, force, user_type = "") {
19411
19701
  }
19412
19702
  }
19413
19703
  const templates = _minimal_templates_root();
19414
- const settings_src = path11.join(templates, SETTINGS_FILE);
19415
- const overrides_gitkeep_src = path11.join(templates, "overrides-gitkeep");
19416
- const overrides_readme_src = path11.join(templates, "agents-overrides-readme.md");
19704
+ const settings_src = path12.join(templates, SETTINGS_FILE);
19705
+ const overrides_gitkeep_src = path12.join(templates, "overrides-gitkeep");
19706
+ const overrides_readme_src = path12.join(templates, "agents-overrides-readme.md");
19417
19707
  if (!isFile(settings_src)) fail(`Bundled minimal settings template missing under ${templates}`);
19418
19708
  if (!isFile(overrides_gitkeep_src) || !isFile(overrides_readme_src)) {
19419
19709
  fail(`Bundled overrides scaffold templates missing under ${templates}`);
19420
19710
  }
19421
19711
  info(`Minimal init \u2192 ${target_root}`);
19422
- const overrides_root = path11.join(target_root, "agents", "overrides");
19712
+ const overrides_root = path12.join(target_root, "agents", "overrides");
19423
19713
  mkdirp(overrides_root);
19424
19714
  const gitkeep_body = readText(overrides_gitkeep_src);
19425
19715
  for (const sub of ["rules", "skills", "commands"]) {
19426
- const sub_dir = path11.join(overrides_root, sub);
19716
+ const sub_dir = path12.join(overrides_root, sub);
19427
19717
  mkdirp(sub_dir);
19428
- const gitkeep_dst = path11.join(sub_dir, ".gitkeep");
19718
+ const gitkeep_dst = path12.join(sub_dir, ".gitkeep");
19429
19719
  if (pathExists(gitkeep_dst) && !force) {
19430
19720
  skip(`agents/overrides/${sub}/.gitkeep already exists (use --force to overwrite)`);
19431
19721
  } else {
@@ -19433,7 +19723,7 @@ function install_minimal(target_root_in, force, user_type = "") {
19433
19723
  success(`Wrote agents/overrides/${sub}/.gitkeep`);
19434
19724
  }
19435
19725
  }
19436
- const readme_dst = path11.join(overrides_root, "README.md");
19726
+ const readme_dst = path12.join(overrides_root, "README.md");
19437
19727
  if (pathExists(readme_dst) && !force) {
19438
19728
  skip("agents/overrides/README.md already exists (use --force to overwrite)");
19439
19729
  } else {
@@ -19451,14 +19741,14 @@ function install_minimal(target_root_in, force, user_type = "") {
19451
19741
  personal:
19452
19742
  user_type: ${user_type}
19453
19743
  `;
19454
- mkdirp(path11.dirname(settings_dst));
19744
+ mkdirp(path12.dirname(settings_dst));
19455
19745
  writeText(settings_dst, body);
19456
19746
  success(`Wrote ${SETTINGS_FILE} (user_type=${user_type})`);
19457
19747
  }
19458
19748
  }
19459
19749
  const removed_marker = _remove_legacy_consumer_bridge_marker(target_root);
19460
19750
  if (removed_marker !== null) {
19461
- const rel = isRelativeTo(removed_marker, target_root) ? path11.relative(target_root, removed_marker) : removed_marker;
19751
+ const rel = isRelativeTo(removed_marker, target_root) ? path12.relative(target_root, removed_marker) : removed_marker;
19462
19752
  success(`Removed legacy bridge marker: ${rel}`);
19463
19753
  }
19464
19754
  _write_install_mode_marker(target_root, "minimal");
@@ -19532,7 +19822,7 @@ function run_interactive_init(project_root, force) {
19532
19822
  );
19533
19823
  return 0;
19534
19824
  }
19535
- const target = path11.join(project_root, _LOCAL_CONFIG_FILE);
19825
+ const target = path12.join(project_root, _LOCAL_CONFIG_FILE);
19536
19826
  if (pathExists(target) && !force) {
19537
19827
  warn(
19538
19828
  `${_LOCAL_CONFIG_FILE} already exists; re-run with --force to overwrite. Skipping interactive init.`
@@ -19559,7 +19849,7 @@ function run_interactive_init(project_root, force) {
19559
19849
  warn(`Could not write ${target}: ${String(exc)}`);
19560
19850
  return 1;
19561
19851
  }
19562
- success(`Wrote ${path11.relative(project_root, target)} (${user_type} / ${stack} / ${verbosity})`);
19852
+ success(`Wrote ${path12.relative(project_root, target)} (${user_type} / ${stack} / ${verbosity})`);
19563
19853
  return 0;
19564
19854
  }
19565
19855
  var _WIZARD_READY_RE = /^WIZARD_READY (http:\/\/(?:127\.0\.0\.1|localhost):\d+\/\S*)\r?$/;
@@ -19577,12 +19867,12 @@ function _wizard_should_launch(opts) {
19577
19867
  return [true, ""];
19578
19868
  }
19579
19869
  function _wizard_cli_dist(_project_root) {
19580
- const package_root = path11.dirname(path11.dirname(path11.dirname(resolvePath(_HERE2))));
19581
- const cli = path11.join(package_root, "dist", "cli", "agent-config.js");
19870
+ const package_root = path12.dirname(path12.dirname(path12.dirname(resolvePath(_HERE2))));
19871
+ const cli = path12.join(package_root, "dist", "cli", "agent-config.js");
19582
19872
  return pathExists(cli) ? cli : null;
19583
19873
  }
19584
19874
  function _server_info_path() {
19585
- return path11.join(os6.homedir(), ".event4u", "agent-config", "local-server.json");
19875
+ return path12.join(os7.homedir(), ".event4u", "agent-config", "local-server.json");
19586
19876
  }
19587
19877
  function _pid_is_agent_config(pid) {
19588
19878
  let res;
@@ -19599,7 +19889,7 @@ function _pid_is_agent_config(pid) {
19599
19889
  }
19600
19890
  function unlinkMissingOk(p) {
19601
19891
  try {
19602
- fs13.unlinkSync(p);
19892
+ fs14.unlinkSync(p);
19603
19893
  } catch {
19604
19894
  }
19605
19895
  }
@@ -19677,14 +19967,14 @@ function _wizard_spawn(project_root, pass_project_root = true) {
19677
19967
  }
19678
19968
  function _wizard_run_sync(cmd, env, cli) {
19679
19969
  const total = _WIZARD_TIMEOUTS.reduce((a, b) => a + b, 0);
19680
- const log_path = path11.join(
19681
- os6.tmpdir(),
19970
+ const log_path = path12.join(
19971
+ os7.tmpdir(),
19682
19972
  `agent-config-wizard-${process3.pid}-${Date.now()}.log`
19683
19973
  );
19684
19974
  let child;
19685
19975
  let log_fd = null;
19686
19976
  try {
19687
- log_fd = fs13.openSync(log_path, "w");
19977
+ log_fd = fs14.openSync(log_path, "w");
19688
19978
  child = spawn(cmd[0], cmd.slice(1), {
19689
19979
  env,
19690
19980
  detached: true,
@@ -19702,7 +19992,7 @@ function _wizard_run_sync(cmd, env, cli) {
19702
19992
  } finally {
19703
19993
  if (log_fd !== null) {
19704
19994
  try {
19705
- fs13.closeSync(log_fd);
19995
+ fs14.closeSync(log_fd);
19706
19996
  } catch {
19707
19997
  }
19708
19998
  }
@@ -19952,8 +20242,8 @@ function main2(argv) {
19952
20242
  const target_root = resolvePath(
19953
20243
  opts.custom_path || opts.project || process3.env["PROJECT_ROOT"] || process3.cwd()
19954
20244
  );
19955
- const minimal_package_root = path11.dirname(
19956
- path11.dirname(path11.dirname(_minimal_templates_root()))
20245
+ const minimal_package_root = path12.dirname(
20246
+ path12.dirname(path12.dirname(_minimal_templates_root()))
19957
20247
  );
19958
20248
  const validated_user_type = _validate_user_type(minimal_package_root, opts.user_type);
19959
20249
  return install_minimal(target_root, opts.force, validated_user_type);
@@ -19982,7 +20272,7 @@ function main2(argv) {
19982
20272
  return rc2;
19983
20273
  }
19984
20274
  const project_root = custom_path || resolvePath(opts.project || process3.env["PROJECT_ROOT"] || process3.cwd());
19985
- const is_first_run = !pathExists(path11.join(project_root, SETTINGS_FILE));
20275
+ const is_first_run = !pathExists(path12.join(project_root, SETTINGS_FILE));
19986
20276
  const rc = _main_project_install(opts, project_root, parsed_tools, is_first_run);
19987
20277
  if (rc === 0 && opts.interactive) {
19988
20278
  run_interactive_init(project_root, opts.force);
@@ -20046,16 +20336,16 @@ function _team_setup_hint_line(project_root) {
20046
20336
  return " \u2022 Claude Code team mode (optional cross-model review via the official codex plugin): run `agent-config doctor --check team` for setup status.";
20047
20337
  }
20048
20338
  function finalize_claude_model_tiers(project_root) {
20049
- const claude_skills = path11.join(project_root, ".claude", "skills");
20050
- const augment_skills = path11.join(project_root, ".augment", "skills");
20339
+ const claude_skills = path12.join(project_root, ".claude", "skills");
20340
+ const augment_skills = path12.join(project_root, ".augment", "skills");
20051
20341
  if (!isDir(claude_skills) || !isDir(augment_skills)) return 0;
20052
20342
  if (_read_consumer_auto_switch(project_root) !== "auto") return 0;
20053
20343
  let rendered = 0;
20054
- const entries = fs13.readdirSync(claude_skills).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
20344
+ const entries = fs14.readdirSync(claude_skills).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
20055
20345
  for (const name of entries) {
20056
- const entry = path11.join(claude_skills, name);
20057
- const src_dir = path11.join(augment_skills, name);
20058
- const src_md = path11.join(src_dir, "SKILL.md");
20346
+ const entry = path12.join(claude_skills, name);
20347
+ const src_dir = path12.join(augment_skills, name);
20348
+ const src_md = path12.join(src_dir, "SKILL.md");
20059
20349
  let tier;
20060
20350
  try {
20061
20351
  tier = read_model_tier(src_md);
@@ -20064,22 +20354,22 @@ function finalize_claude_model_tiers(project_root) {
20064
20354
  }
20065
20355
  if (tier === null || !(tier in TIER_TO_CLAUDE_MODEL) || !isDir(src_dir)) continue;
20066
20356
  if (isSymlink(entry) || isFile(entry)) {
20067
- fs13.unlinkSync(entry);
20357
+ fs14.unlinkSync(entry);
20068
20358
  } else if (isDir(entry)) {
20069
- fs13.rmSync(entry, { recursive: true, force: true });
20359
+ fs14.rmSync(entry, { recursive: true, force: true });
20070
20360
  }
20071
20361
  mkdirp(entry);
20072
- const srcFiles = fs13.readdirSync(src_dir).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
20362
+ const srcFiles = fs14.readdirSync(src_dir).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
20073
20363
  for (const fname of srcFiles) {
20074
20364
  if (fname === "SKILL.md") {
20075
20365
  writeText(
20076
- path11.join(entry, "SKILL.md"),
20366
+ path12.join(entry, "SKILL.md"),
20077
20367
  render_native_model_md(readText(src_md), tier)
20078
20368
  );
20079
20369
  } else {
20080
- fs13.symlinkSync(
20081
- path11.join("../../../.augment/skills", name, fname),
20082
- path11.join(entry, fname)
20370
+ fs14.symlinkSync(
20371
+ path12.join("../../../.augment/skills", name, fname),
20372
+ path12.join(entry, fname)
20083
20373
  );
20084
20374
  }
20085
20375
  }
@@ -20097,7 +20387,7 @@ function _main_project_install(opts, project_root, parsed_tools, is_first_run) {
20097
20387
  let package_type;
20098
20388
  if (opts.package) {
20099
20389
  package_root = resolvePath(opts.package);
20100
- if (!pathExists(path11.join(package_root, "src", "config", "profiles", "minimal.ini"))) {
20390
+ if (!pathExists(path12.join(package_root, "src", "config", "profiles", "minimal.ini"))) {
20101
20391
  fail(`Invalid --package path (missing src/config/profiles/minimal.ini): ${package_root}`);
20102
20392
  }
20103
20393
  package_type = detect_package_type_for_project(project_root, package_root);
@@ -20232,9 +20522,9 @@ function _main_project_install(opts, project_root, parsed_tools, is_first_run) {
20232
20522
  function _resolvedArgv1() {
20233
20523
  if (process3.argv[1] === void 0) return void 0;
20234
20524
  try {
20235
- return fs13.realpathSync(path11.resolve(process3.argv[1]));
20525
+ return fs14.realpathSync(path12.resolve(process3.argv[1]));
20236
20526
  } catch {
20237
- return path11.resolve(process3.argv[1]);
20527
+ return path12.resolve(process3.argv[1]);
20238
20528
  }
20239
20529
  }
20240
20530
  var _argv1 = _resolvedArgv1();
@@ -20279,6 +20569,7 @@ export {
20279
20569
  _apply_payload_preview,
20280
20570
  _bridge_marker,
20281
20571
  _canonical_settings_target,
20572
+ _compute_active_pack_ids,
20282
20573
  _current_settings_surface,
20283
20574
  _detect_legacy_for_migration,
20284
20575
  _dry_run_summary,
@@ -20288,14 +20579,20 @@ export {
20288
20579
  _inject_packs,
20289
20580
  _is_agent_config_source_repo,
20290
20581
  _is_tool_enabled,
20582
+ _load_packs_registry,
20291
20583
  _merge_tools_aliases,
20292
20584
  _parse_legacy_settings,
20293
20585
  _parse_profile_ini,
20294
20586
  _parse_tools,
20587
+ _prune_lab_modules,
20588
+ _prune_modules_by,
20589
+ _prune_scoped_modules,
20295
20590
  _render_template,
20296
20591
  _replace_template_value,
20297
20592
  _replace_template_value_raw,
20593
+ _resolve_global_settings_doc,
20298
20594
  _resolve_scope,
20595
+ _resolve_scoped_projection,
20299
20596
  _resolve_settings_read,
20300
20597
  _team_setup_hint_line,
20301
20598
  _tools_was_all,