@event4u/agent-config 9.9.0 → 9.11.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 (479) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +212 -194
  3. package/README.md +13 -16
  4. package/agents/templates/.ai-council.yml.example +481 -0
  5. package/agents/templates/.ai-video.xml.example +247 -0
  6. package/dist/agent-src/commands/agent-status.md +12 -11
  7. package/dist/agent-src/commands/agents/user/accept.md +115 -30
  8. package/dist/agent-src/commands/agents/user/delete.md +147 -0
  9. package/dist/agent-src/commands/agents/user/review.md +65 -28
  10. package/dist/agent-src/commands/agents/user/show.md +82 -29
  11. package/dist/agent-src/commands/agents/user/update.md +2 -2
  12. package/dist/agent-src/commands/agents/user.md +16 -3
  13. package/dist/agent-src/commands/check-current-md.md +0 -10
  14. package/dist/agent-src/commands/condense.md +28 -97
  15. package/dist/agent-src/commands/cost/report.md +7 -0
  16. package/dist/agent-src/commands/fix/portability.md +0 -8
  17. package/dist/agent-src/commands/fix/refs.md +0 -8
  18. package/dist/agent-src/commands/humanize.md +2 -2
  19. package/dist/agent-src/commands/jira-ticket.md +1 -1
  20. package/dist/agent-src/commands/memory/load.md +11 -0
  21. package/dist/agent-src/commands/optimize/skills.md +1 -1
  22. package/dist/agent-src/commands/pr/create.md +4 -4
  23. package/dist/agent-src/commands/profile/show.md +3 -3
  24. package/dist/agent-src/commands/rule-compliance-audit.md +5 -4
  25. package/dist/agent-src/commands/security-audit-config.md +1 -1
  26. package/dist/agent-src/commands/sync/gitignore/fix.md +1 -1
  27. package/dist/agent-src/commands/tdd.md +21 -0
  28. package/dist/agent-src/commands/team/delegate.md +2 -2
  29. package/dist/agent-src/commands/team-knowledge/bootstrap.md +9 -8
  30. package/dist/agent-src/commands/team-knowledge/consolidate.md +8 -7
  31. package/dist/agent-src/commands/team.md +4 -1
  32. package/dist/agent-src/commands/upstream-contribute.md +0 -1
  33. package/dist/agent-src/contexts/authority/commit-mechanics.md +7 -0
  34. package/dist/agent-src/contexts/authority/destructive-mechanics.md +16 -0
  35. package/dist/agent-src/contexts/authority/scope-mechanics.md +61 -0
  36. package/dist/agent-src/contexts/communication/rules-auto/reply-close-mechanics.md +20 -18
  37. package/dist/agent-src/contexts/communication/rules-auto/skill-quality-mechanics.md +1 -1
  38. package/dist/agent-src/contexts/communication/rules-auto/slash-command-routing-policy-mechanics.md +1 -1
  39. package/dist/agent-src/contexts/communication/rules-auto/source-of-truth-mechanics.md +9 -10
  40. package/dist/agent-src/contexts/communication/rules-auto/think-before-action-mechanics.md +1 -1
  41. package/dist/agent-src/contexts/communication/rules-auto/user-interaction-mechanics.md +11 -0
  42. package/dist/agent-src/contexts/contracts/artifact-engagement-flow.md +26 -15
  43. package/dist/agent-src/contexts/contracts/command-suggestion-flow.md +3 -0
  44. package/dist/agent-src/contexts/execution/auto-dispatch-classification.md +67 -37
  45. package/dist/agent-src/contexts/execution/auto-orchestration-activation.md +1 -1
  46. package/dist/agent-src/contexts/execution/autonomy-examples.md +1 -1
  47. package/dist/agent-src/contexts/execution/autonomy-mechanics.md +7 -6
  48. package/dist/agent-src/contexts/execution/evidence-discipline.md +92 -77
  49. package/dist/agent-src/contexts/execution/orchestration-benchmark-gate.md +22 -21
  50. package/dist/agent-src/contexts/execution/orchestration-telemetry.md +24 -0
  51. package/dist/agent-src/contexts/execution/project-intelligence.md +122 -103
  52. package/dist/agent-src/contexts/execution/roadmap-execution-contract.md +23 -21
  53. package/dist/agent-src/contexts/execution/subagent-response-contract.md +5 -5
  54. package/dist/agent-src/contexts/execution/subagent-routing.md +11 -0
  55. package/dist/agent-src/contexts/execution/subagent-spawn-contract.md +13 -13
  56. package/dist/agent-src/contexts/execution/subagent-steering.md +36 -34
  57. package/dist/agent-src/contexts/execution/toolchain-resolver.md +1 -1
  58. package/dist/agent-src/contexts/execution/user-memory-channels.md +189 -0
  59. package/dist/agent-src/contexts/execution/verification-mechanics.md +9 -0
  60. package/dist/agent-src/contexts/model-recommendations.md +3 -2
  61. package/dist/agent-src/contexts/subagent-configuration.md +3 -3
  62. package/dist/agent-src/ghostwriter/README.md +2 -2
  63. package/dist/agent-src/packs/README.md +1 -1
  64. package/dist/agent-src/personas/README.md +5 -5
  65. package/dist/agent-src/personas/_template-specialist/persona.md +3 -3
  66. package/dist/agent-src/personas/backend-architect.md +24 -23
  67. package/dist/agent-src/personas/eloquent-tamer.md +30 -30
  68. package/dist/agent-src/personas/frontend-engineer.md +30 -30
  69. package/dist/agent-src/personas/product-owner.md +41 -38
  70. package/dist/agent-src/personas/qa.md +13 -13
  71. package/dist/agent-src/personas/security-engineer.md +22 -22
  72. package/dist/agent-src/presets/README.md +3 -3
  73. package/dist/agent-src/profiles/README.md +3 -3
  74. package/dist/agent-src/rules/active-remediation.md +2 -2
  75. package/dist/agent-src/rules/artifact-engagement-recording.md +4 -4
  76. package/dist/agent-src/rules/ask-when-uncertain.md +0 -4
  77. package/dist/agent-src/rules/augment-edit-discipline.md +1 -1
  78. package/dist/agent-src/rules/broken-access-control.md +4 -4
  79. package/dist/agent-src/rules/code-comment-discipline.md +1 -1
  80. package/dist/agent-src/rules/code-provenance.md +2 -2
  81. package/dist/agent-src/rules/commit-policy.md +4 -9
  82. package/dist/agent-src/rules/communication-through-line.md +5 -5
  83. package/dist/agent-src/rules/decision-revisit-gate.md +1 -1
  84. package/dist/agent-src/rules/design-fidelity.md +1 -1
  85. package/dist/agent-src/rules/doc-screenshot-hygiene.md +1 -1
  86. package/dist/agent-src/rules/domain-adoption-policy.md +1 -1
  87. package/dist/agent-src/rules/domain-safety-pii.md +1 -1
  88. package/dist/agent-src/rules/external-code-graph-interop.md +1 -1
  89. package/dist/agent-src/rules/fast-path-marker-visibility.md +43 -7
  90. package/dist/agent-src/rules/finance-safety-floor.md +1 -1
  91. package/dist/agent-src/rules/framework-neutrality-in-generic-skills.md +3 -3
  92. package/dist/agent-src/rules/history-discipline.md +1 -1
  93. package/dist/agent-src/rules/legal-safety-floor.md +1 -1
  94. package/dist/agent-src/rules/lethal-trifecta-guard.md +5 -5
  95. package/dist/agent-src/rules/low-impact-corpus-privacy-floor.md +10 -8
  96. package/dist/agent-src/rules/media-governance-routing.md +13 -13
  97. package/dist/agent-src/rules/media-sync-ground-truth.md +29 -11
  98. package/dist/agent-src/rules/no-cheap-questions.md +7 -7
  99. package/dist/agent-src/rules/no-decorative-emojis-in-git-surfaces.md +29 -18
  100. package/dist/agent-src/rules/non-destructive-by-default.md +5 -23
  101. package/dist/agent-src/rules/onboarding-gate.md +14 -4
  102. package/dist/agent-src/rules/persona-governance.md +2 -2
  103. package/dist/agent-src/rules/prefer-enums-over-literals.md +9 -9
  104. package/dist/agent-src/rules/preservation-guard.md +10 -2
  105. package/dist/agent-src/rules/question-not-instruction.md +1 -1
  106. package/dist/agent-src/rules/roadmap-progress-sync.md +6 -6
  107. package/dist/agent-src/rules/rule-type-governance.md +1 -1
  108. package/dist/agent-src/rules/scale-discipline.md +1 -1
  109. package/dist/agent-src/rules/scope-control.md +1 -1
  110. package/dist/agent-src/rules/secret-vcs-guard.md +1 -1
  111. package/dist/agent-src/rules/security-sensitive-stop.md +17 -11
  112. package/dist/agent-src/rules/senior-engineering-discipline.md +17 -17
  113. package/dist/agent-src/rules/session-canary.md +1 -1
  114. package/dist/agent-src/rules/skill-quality.md +1 -1
  115. package/dist/agent-src/rules/source-confidentiality.md +21 -19
  116. package/dist/agent-src/rules/source-of-truth.md +6 -5
  117. package/dist/agent-src/rules/spreadsheet-source-quality.md +2 -2
  118. package/dist/agent-src/rules/strategy-safety-floor.md +1 -1
  119. package/dist/agent-src/rules/think-before-action.md +5 -5
  120. package/dist/agent-src/rules/token-budget-discipline.md +5 -3
  121. package/dist/agent-src/rules/token-efficiency.md +2 -2
  122. package/dist/agent-src/rules/untrusted-input-defense.md +4 -4
  123. package/dist/agent-src/rules/user-interaction.md +12 -0
  124. package/dist/agent-src/rules/verify-before-complete.md +4 -24
  125. package/dist/agent-src/skills/adversarial-review/SKILL.md +2 -2
  126. package/dist/agent-src/skills/agent-security-review/SKILL.md +52 -45
  127. package/dist/agent-src/skills/agents-md-thin-root/SKILL.md +2 -2
  128. package/dist/agent-src/skills/ai-code-blindspots/SKILL.md +20 -20
  129. package/dist/agent-src/skills/ai-council/SKILL.md +185 -128
  130. package/dist/agent-src/skills/analysis-skill-router/SKILL.md +3 -3
  131. package/dist/agent-src/skills/api-endpoint/SKILL.md +2 -2
  132. package/dist/agent-src/skills/artisan-commands/SKILL.md +2 -2
  133. package/dist/agent-src/skills/async-python-patterns/SKILL.md +8 -7
  134. package/dist/agent-src/skills/authz-review/SKILL.md +16 -15
  135. package/dist/agent-src/skills/aws-infrastructure/SKILL.md +5 -5
  136. package/dist/agent-src/skills/blade-ui/SKILL.md +1 -1
  137. package/dist/agent-src/skills/bug-analyzer/SKILL.md +30 -12
  138. package/dist/agent-src/skills/code-intelligence/SKILL.md +0 -1
  139. package/dist/agent-src/skills/code-intelligence/evals/triggers.json +52 -0
  140. package/dist/agent-src/skills/code-review/SKILL.md +6 -6
  141. package/dist/agent-src/skills/command-routing/SKILL.md +5 -4
  142. package/dist/agent-src/skills/composer-packages/SKILL.md +2 -2
  143. package/dist/agent-src/skills/condense-memory/SKILL.md +43 -41
  144. package/dist/agent-src/skills/context-document/SKILL.md +23 -21
  145. package/dist/agent-src/skills/copilot-config/SKILL.md +6 -1
  146. package/dist/agent-src/skills/decision-record/SKILL.md +20 -18
  147. package/dist/agent-src/skills/design-intelligence/SKILL.md +4 -4
  148. package/dist/agent-src/skills/design-review/SKILL.md +15 -14
  149. package/dist/agent-src/skills/design-system-capture/reference/design-system-json.md +28 -25
  150. package/dist/agent-src/skills/devcontainer/SKILL.md +2 -2
  151. package/dist/agent-src/skills/docker/SKILL.md +1 -1
  152. package/dist/agent-src/skills/docx-authoring/evals/triggers.json +52 -0
  153. package/dist/agent-src/skills/emit-tickets/SKILL.md +2 -2
  154. package/dist/agent-src/skills/error-handling-patterns/SKILL.md +1 -1
  155. package/dist/agent-src/skills/estimate-ticket/SKILL.md +2 -2
  156. package/dist/agent-src/skills/evaluate-llm-feature/SKILL.md +0 -1
  157. package/dist/agent-src/skills/evaluate-llm-feature/evals/triggers.json +52 -0
  158. package/dist/agent-src/skills/existing-ui-audit/SKILL.md +21 -7
  159. package/dist/agent-src/skills/fe-design/SKILL.md +10 -0
  160. package/dist/agent-src/skills/feature-planning/SKILL.md +2 -2
  161. package/dist/agent-src/skills/finishing-a-development-branch/SKILL.md +3 -3
  162. package/dist/agent-src/skills/flux/SKILL.md +1 -1
  163. package/dist/agent-src/skills/frontend-render-security/SKILL.md +13 -13
  164. package/dist/agent-src/skills/git-workflow/SKILL.md +33 -33
  165. package/dist/agent-src/skills/grafana/SKILL.md +5 -0
  166. package/dist/agent-src/skills/humanizer/SKILL.md +83 -66
  167. package/dist/agent-src/skills/humanizer/data/patterns.md +14 -14
  168. package/dist/agent-src/skills/humanizer/references/anti-aiisms.md +4 -4
  169. package/dist/agent-src/skills/judge-artifact-completeness/SKILL.md +82 -37
  170. package/dist/agent-src/skills/judge-bug-hunter/SKILL.md +17 -5
  171. package/dist/agent-src/skills/judge-injection-defense/SKILL.md +63 -25
  172. package/dist/agent-src/skills/judge-security-auditor/SKILL.md +2 -0
  173. package/dist/agent-src/skills/judge-synthesis/SKILL.md +72 -28
  174. package/dist/agent-src/skills/laravel-horizon/SKILL.md +5 -0
  175. package/dist/agent-src/skills/laravel-mail/SKILL.md +5 -4
  176. package/dist/agent-src/skills/laravel-middleware/SKILL.md +5 -4
  177. package/dist/agent-src/skills/laravel-notifications/SKILL.md +10 -9
  178. package/dist/agent-src/skills/laravel-pennant/SKILL.md +1 -1
  179. package/dist/agent-src/skills/laravel-pulse/SKILL.md +9 -8
  180. package/dist/agent-src/skills/laravel-reverb/SKILL.md +6 -5
  181. package/dist/agent-src/skills/laravel-scheduling/SKILL.md +6 -1
  182. package/dist/agent-src/skills/laravel-validation/SKILL.md +12 -0
  183. package/dist/agent-src/skills/launch-readiness/SKILL.md +1 -1
  184. package/dist/agent-src/skills/learning-to-rule-or-skill/SKILL.md +7 -7
  185. package/dist/agent-src/skills/learning-tutor/SKILL.md +44 -43
  186. package/dist/agent-src/skills/learning-tutor/evals/triggers.json +52 -0
  187. package/dist/agent-src/skills/license-compliance-audit/SKILL.md +7 -7
  188. package/dist/agent-src/skills/license-compliance-borrow-check/SKILL.md +3 -3
  189. package/dist/agent-src/skills/license-compliance-credits/SKILL.md +4 -4
  190. package/dist/agent-src/skills/llm-provider-knowledge/SKILL.md +0 -1
  191. package/dist/agent-src/skills/memory-consolidation/SKILL.md +69 -64
  192. package/dist/agent-src/skills/motion-choreographer/SKILL.md +6 -6
  193. package/dist/agent-src/skills/pdf-tools/evals/triggers.json +52 -0
  194. package/dist/agent-src/skills/performance-analysis/SKILL.md +7 -3
  195. package/dist/agent-src/skills/persona-improvement/SKILL.md +0 -2
  196. package/dist/agent-src/skills/persona-improvement/evals/triggers.json +52 -0
  197. package/dist/agent-src/skills/php-coder/SKILL.md +10 -0
  198. package/dist/agent-src/skills/prediction-pool-optimizer/SKILL.md +129 -120
  199. package/dist/agent-src/skills/prediction-pool-optimizer/reference/ev-fixtures.md +36 -35
  200. package/dist/agent-src/skills/prediction-pool-optimizer/reference/odds-and-bonus.md +45 -41
  201. package/dist/agent-src/skills/project-analysis-core/SKILL.md +4 -4
  202. package/dist/agent-src/skills/project-analysis-hypothesis-driven/SKILL.md +3 -3
  203. package/dist/agent-src/skills/project-analysis-react/SKILL.md +1 -1
  204. package/dist/agent-src/skills/project-analysis-symfony/SKILL.md +1 -1
  205. package/dist/agent-src/skills/project-analysis-zend-laminas/SKILL.md +2 -2
  206. package/dist/agent-src/skills/prompt-engineering-patterns/SKILL.md +1 -1
  207. package/dist/agent-src/skills/prompt-validator/SKILL.md +39 -39
  208. package/dist/agent-src/skills/quality-tools/SKILL.md +15 -15
  209. package/dist/agent-src/skills/react-shadcn-ui/SKILL.md +55 -19
  210. package/dist/agent-src/skills/react-shadcn-ui/reference/registry.md +29 -27
  211. package/dist/agent-src/skills/readme-writing-package/SKILL.md +2 -2
  212. package/dist/agent-src/skills/reasoning-orchestrator/SKILL.md +25 -25
  213. package/dist/agent-src/skills/recursive-verification/SKILL.md +6 -5
  214. package/dist/agent-src/skills/refine-prompt/SKILL.md +1 -1
  215. package/dist/agent-src/skills/refine-ticket/SKILL.md +20 -2
  216. package/dist/agent-src/skills/repomix-packer/SKILL.md +1 -1
  217. package/dist/agent-src/skills/requesting-code-review/SKILL.md +2 -2
  218. package/dist/agent-src/skills/roadmap-management/SKILL.md +80 -66
  219. package/dist/agent-src/skills/roadmap-writing/SKILL.md +84 -77
  220. package/dist/agent-src/skills/rule-refactor/SKILL.md +1 -1
  221. package/dist/agent-src/skills/screenshot-hygiene/evals/triggers.json +52 -0
  222. package/dist/agent-src/skills/security-audit/SKILL.md +26 -9
  223. package/dist/agent-src/skills/security-maturity-assessment/SKILL.md +38 -16
  224. package/dist/agent-src/skills/skill-improvement-pipeline/SKILL.md +14 -11
  225. package/dist/agent-src/skills/skill-writing/SKILL.md +9 -8
  226. package/dist/agent-src/skills/song-to-script/SKILL.md +93 -85
  227. package/dist/agent-src/skills/sql-writing/SKILL.md +2 -2
  228. package/dist/agent-src/skills/stakeholder-tradeoff/SKILL.md +4 -3
  229. package/dist/agent-src/skills/standards-from-config/SKILL.md +61 -43
  230. package/dist/agent-src/skills/subagent-orchestration/SKILL.md +22 -8
  231. package/dist/agent-src/skills/subagent-orchestration/prompts/README.md +28 -2
  232. package/dist/agent-src/skills/supply-chain-intake/SKILL.md +13 -13
  233. package/dist/agent-src/skills/systematic-debugging/SKILL.md +22 -21
  234. package/dist/agent-src/skills/tailwind-engineer/SKILL.md +1 -1
  235. package/dist/agent-src/skills/technical-specification/SKILL.md +5 -0
  236. package/dist/agent-src/skills/terraform/SKILL.md +2 -2
  237. package/dist/agent-src/skills/terragrunt/SKILL.md +8 -8
  238. package/dist/agent-src/skills/testing-anti-patterns/process-anti-patterns.md +1 -1
  239. package/dist/agent-src/skills/threat-modeling/SKILL.md +19 -13
  240. package/dist/agent-src/skills/universal-project-analysis/SKILL.md +1 -1
  241. package/dist/agent-src/skills/upstream-contribute/SKILL.md +0 -1
  242. package/dist/agent-src/skills/using-git-worktrees/SKILL.md +9 -9
  243. package/dist/agent-src/skills/validate-feature-fit/SKILL.md +3 -1
  244. package/dist/agent-src/skills/verify-completion-evidence/SKILL.md +4 -6
  245. package/dist/agent-src/skills/verify-repair-loop/SKILL.md +67 -61
  246. package/dist/agent-src/skills/video-director/SKILL.md +7 -7
  247. package/dist/agent-src/skills/worktree-lifecycle/SKILL.md +3 -3
  248. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  249. package/dist/agent-src/templates/contexts/knowledge-pages.md +47 -45
  250. package/dist/agent-src/templates/contexts/lesson-card.md +2 -2
  251. package/dist/agent-src/templates/contexts/tenant-boundaries.md +2 -2
  252. package/dist/agent-src/templates/contexts.md +1 -1
  253. package/dist/agent-src/templates/features.md +1 -1
  254. package/dist/agent-src/templates/roadmaps.md +125 -116
  255. package/dist/agent-src/templates/rule.md +2 -1
  256. package/dist/agent-src/templates/scripts/pr_risk_review.ts +0 -0
  257. package/dist/agent-src/templates/scripts/telemetry/aggregator.ts +0 -0
  258. package/dist/agent-src/templates/scripts/tier_usage_report.ts +2 -2
  259. package/dist/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +30 -30
  260. package/dist/agent-src/templates/scripts/work_engine/directives/ui/design.ts +88 -33
  261. package/dist/agent-src/templates/scripts/work_engine/directives/ui/polish.ts +22 -2
  262. package/dist/agent-src/templates/scripts/work_engine/directives/ui/review.ts +21 -2
  263. package/dist/agent-src/templates/scripts/work_engine/directives/ui/stack_bundles.ts +179 -0
  264. package/dist/agent-src/templates/scripts/work_engine/stack/detect.ts +155 -4
  265. package/dist/agent-src/templates/scripts/work_engine/state.ts +21 -4
  266. package/dist/agent-src/user-types/README.md +8 -8
  267. package/dist/agent-src/user-types/galabau-field-crew.md +34 -33
  268. package/dist/agent-src/user-types/metalworking-shop.md +35 -34
  269. package/dist/agent-src/user-types/truck-driver.md +22 -20
  270. package/dist/cli/initRouting.js +74 -11
  271. package/dist/cli/initRouting.js.map +1 -1
  272. package/dist/cli/main.js +14 -3
  273. package/dist/cli/main.js.map +1 -1
  274. package/dist/cli/python/workspace_roles.js +2 -2
  275. package/dist/cli/python/workspace_roles.js.map +1 -1
  276. package/dist/cli-delegate/chunk-4SV3XGFA.js +6910 -0
  277. package/dist/cli-delegate/chunk-736JCWLM.js +1104 -0
  278. package/dist/cli-delegate/chunk-7DSAMZFU.js +356 -0
  279. package/dist/cli-delegate/chunk-7HQ52DHU.js +74 -0
  280. package/dist/cli-delegate/chunk-BJGXZNPM.js +266 -0
  281. package/dist/cli-delegate/chunk-FTAISGDQ.js +117 -0
  282. package/dist/cli-delegate/chunk-GME3Q44L.js +82 -0
  283. package/dist/cli-delegate/chunk-GRRPEPRN.js +336 -0
  284. package/dist/cli-delegate/chunk-HJ6DAJHR.js +502 -0
  285. package/dist/cli-delegate/chunk-IR7P7JWA.js +872 -0
  286. package/dist/cli-delegate/chunk-J55WI3RR.js +47 -0
  287. package/dist/cli-delegate/chunk-MCJYCQPF.js +35 -0
  288. package/dist/cli-delegate/chunk-NDJLNC6Q.js +169 -0
  289. package/dist/cli-delegate/chunk-OMIVVCG2.js +26 -0
  290. package/dist/cli-delegate/chunk-OY53J6II.js +7336 -0
  291. package/dist/cli-delegate/chunk-RDGRHAAB.js +259 -0
  292. package/dist/cli-delegate/chunk-TFG57JJM.js +1969 -0
  293. package/dist/cli-delegate/chunk-XX6TOPD7.js +715 -0
  294. package/dist/cli-delegate/chunk-YMFO6FDN.js +10603 -0
  295. package/dist/cli-delegate/cmd_analyze_session.js +294 -0
  296. package/dist/cli-delegate/cmd_conformance.js +646 -0
  297. package/dist/cli-delegate/cmd_converge.js +326 -0
  298. package/dist/cli-delegate/cmd_doctor.js +144 -0
  299. package/dist/cli-delegate/cmd_explain.js +2508 -0
  300. package/dist/cli-delegate/cmd_export.js +296 -0
  301. package/dist/cli-delegate/cmd_fleet.js +332 -0
  302. package/dist/cli-delegate/cmd_memory_get.js +3878 -0
  303. package/dist/cli-delegate/cmd_migrate.js +11 -0
  304. package/dist/cli-delegate/cmd_preflight.js +270 -0
  305. package/dist/cli-delegate/cmd_prune.js +444 -0
  306. package/dist/cli-delegate/cmd_refresh.js +28 -0
  307. package/dist/cli-delegate/cmd_settings_check.js +574 -0
  308. package/dist/cli-delegate/cmd_settings_migrate.js +223 -0
  309. package/dist/cli-delegate/cmd_sync.js +264 -0
  310. package/dist/cli-delegate/cmd_uninstall.js +656 -0
  311. package/dist/cli-delegate/cmd_update.js +425 -0
  312. package/dist/cli-delegate/cmd_upgrade.js +444 -0
  313. package/dist/cli-delegate/cmd_validate.js +305 -0
  314. package/dist/cli-delegate/cmd_versions.js +370 -0
  315. package/dist/discovery/deprecation-report.md +1 -1
  316. package/dist/discovery/discovery-manifest.json +100 -67
  317. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  318. package/dist/discovery/discovery-manifest.summary.md +4 -4
  319. package/dist/discovery/orphan-report.md +1 -1
  320. package/dist/discovery/packs.json +16 -10
  321. package/dist/discovery/trust-report.md +2 -2
  322. package/dist/discovery/workspaces.json +7 -5
  323. package/dist/hooks/dispatch.js +186 -12
  324. package/dist/install/emit_host_rules_cli.js +2 -1
  325. package/dist/install/emit_host_rules_cli.js.map +1 -1
  326. package/dist/install/install.mjs +418 -378
  327. package/dist/install/rule_scope.js +5 -1
  328. package/dist/install/rule_scope.js.map +1 -1
  329. package/dist/install/toolDetection.js +40 -12
  330. package/dist/install/toolDetection.js.map +1 -1
  331. package/dist/install/wizard-plan.js +2 -2
  332. package/dist/install/wizard-plan.js.map +1 -1
  333. package/dist/mcp/registry-manifest.json +3 -3
  334. package/dist/mcp/server.json +2 -2
  335. package/dist/mcp/server.mjs +2194 -1003
  336. package/dist/router.json +1 -1
  337. package/dist/scripts/_lib/compile_time_toggles.js +48 -0
  338. package/dist/scripts/_lib/compile_time_toggles.js.map +1 -0
  339. package/dist/scripts/condense.js +234 -217
  340. package/dist/scripts/condense.js.map +1 -1
  341. package/dist/server/schemas/settings.js +4 -0
  342. package/dist/server/schemas/settings.js.map +1 -1
  343. package/dist/shared/userMd/utils.js +30 -0
  344. package/dist/shared/userMd/utils.js.map +1 -1
  345. package/dist/ui/assets/index-BpSQt5vm.js.map +1 -1
  346. package/docs/guidelines/agent-infra/api-cost-levers.md +56 -5
  347. package/docs/guidelines/agent-infra/simplicity-and-goal-demos.md +93 -33
  348. package/package.json +4 -2
  349. package/src/agent-src/templates/scripts/pr_risk_review.ts +0 -0
  350. package/src/agent-src/templates/scripts/telemetry/aggregator.ts +0 -0
  351. package/src/agent-src/templates/scripts/tier_usage_report.ts +2 -2
  352. package/src/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +30 -30
  353. package/src/agent-src/templates/scripts/work_engine/directives/ui/design.ts +88 -33
  354. package/src/agent-src/templates/scripts/work_engine/directives/ui/polish.ts +22 -2
  355. package/src/agent-src/templates/scripts/work_engine/directives/ui/review.ts +21 -2
  356. package/src/agent-src/templates/scripts/work_engine/directives/ui/stack_bundles.ts +179 -0
  357. package/src/agent-src/templates/scripts/work_engine/stack/detect.ts +155 -4
  358. package/src/agent-src/templates/scripts/work_engine/state.ts +21 -4
  359. package/src/config/agent-settings.template.yml +32 -2
  360. package/src/config/ci-local-parity.yml +142 -0
  361. package/src/config/discovery/packs.yml +7 -0
  362. package/src/config/evaluator-budgets.json +1 -1
  363. package/src/config/gate-coverage.yml +127 -0
  364. package/src/config/pack-size-budget.json +27 -0
  365. package/src/config/preamble-payload-budget.json +44 -0
  366. package/src/install/emit_host_rules_cli.ts +2 -1
  367. package/src/install/rule_scope.ts +5 -1
  368. package/src/install/toolDetection.ts +39 -8
  369. package/src/install/wizard-plan.ts +2 -2
  370. package/src/scripts/_cli/cmd_conformance.ts +2 -1
  371. package/src/scripts/_cli/cmd_converge.ts +2 -1
  372. package/src/scripts/_cli/cmd_doctor.ts +292 -15
  373. package/src/scripts/_cli/cmd_export.ts +2 -1
  374. package/src/scripts/_cli/cmd_fleet.ts +2 -1
  375. package/src/scripts/_cli/cmd_migrate.ts +2 -1
  376. package/src/scripts/_cli/cmd_preflight.ts +2 -1
  377. package/src/scripts/_cli/cmd_refresh.ts +2 -1
  378. package/src/scripts/_cli/cmd_update.ts +2 -1
  379. package/src/scripts/_cli/cmd_upgrade.ts +2 -1
  380. package/src/scripts/_cli/cmd_versions.ts +2 -1
  381. package/src/scripts/_cli/detection_report.ts +480 -0
  382. package/src/scripts/_dispatch.bash +52 -14
  383. package/src/scripts/_lib/agent_user_profile.ts +381 -0
  384. package/src/scripts/_lib/agents_overlay.ts +9 -0
  385. package/src/scripts/_lib/anchor_eval.ts +311 -0
  386. package/src/scripts/_lib/cc_transcript.ts +316 -0
  387. package/src/scripts/_lib/changelog_eras.ts +103 -9
  388. package/src/scripts/_lib/compile_time_toggles.ts +79 -0
  389. package/src/scripts/_lib/confusables.ts +101 -0
  390. package/src/scripts/_lib/duplicate_scope_census.ts +77 -0
  391. package/src/scripts/_lib/environment_detector.ts +441 -0
  392. package/src/scripts/_lib/managed_agents_folder.ts +181 -0
  393. package/src/scripts/_lib/package_root.ts +72 -0
  394. package/src/scripts/_lib/payload_hash_drift.ts +126 -0
  395. package/src/scripts/_lib/preservation_migration.ts +291 -0
  396. package/src/scripts/_lib/retrieval_sanitize.ts +166 -2
  397. package/src/scripts/_lib/scan_scope.ts +115 -0
  398. package/src/scripts/_lib/user_global_memory_audit.ts +187 -0
  399. package/src/scripts/_lib/user_global_observations.ts +830 -0
  400. package/src/scripts/_lib/user_global_revocations.ts +110 -0
  401. package/src/scripts/_lib/user_memory_gate_counters.ts +291 -0
  402. package/src/scripts/ai_council/blind_review.ts +0 -0
  403. package/src/scripts/ai_council/budget_guard.ts +90 -11
  404. package/src/scripts/ai_council/bundler.ts +2 -2
  405. package/src/scripts/ai_council/clients.ts +59 -3
  406. package/src/scripts/ai_council/config.ts +53 -7
  407. package/src/scripts/ai_council/modes.ts +68 -2
  408. package/src/scripts/ai_council/orchestrator.ts +54 -9
  409. package/src/scripts/ai_council/transport_resolver.ts +331 -0
  410. package/src/scripts/ai_team/team_dispatch.ts +17 -6
  411. package/src/scripts/anchor_eval_falsify.ts +198 -0
  412. package/src/scripts/anchor_scoring_run.ts +239 -0
  413. package/src/scripts/annotate_discovery.ts +1 -65
  414. package/src/scripts/bench_quality_run.ts +168 -4
  415. package/src/scripts/cache_realization_report.ts +782 -0
  416. package/src/scripts/check_artefact_count_messaging.ts +5 -1
  417. package/src/scripts/check_augment_description_cap.ts +15 -4
  418. package/src/scripts/check_bundle_path_leakage.ts +10 -4
  419. package/src/scripts/check_ci_local_parity.ts +317 -0
  420. package/src/scripts/check_condensation.ts +96 -191
  421. package/src/scripts/check_context_paths.ts +38 -9
  422. package/src/scripts/check_dependency_floors.ts +153 -0
  423. package/src/scripts/check_gate_coverage.ts +299 -0
  424. package/src/scripts/check_iron_law_prominence.ts +22 -1
  425. package/src/scripts/check_kernel_prefix_stability.ts +0 -0
  426. package/src/scripts/check_no_new_legacy_path.ts +16 -6
  427. package/src/scripts/check_no_roadmap_refs.ts +22 -9
  428. package/src/scripts/check_originality_freshness.ts +167 -0
  429. package/src/scripts/check_pack_size.ts +188 -0
  430. package/src/scripts/check_preamble_payload_budget.ts +130 -0
  431. package/src/scripts/check_proposal.ts +0 -0
  432. package/src/scripts/check_references.ts +0 -1
  433. package/src/scripts/check_safety_floor_untouched.ts +171 -24
  434. package/src/scripts/check_site_links.ts +62 -3
  435. package/src/scripts/ci_status.ts +0 -0
  436. package/src/scripts/cluster_near_miss_patterns.ts +0 -0
  437. package/src/scripts/code_graph/build.ts +0 -0
  438. package/src/scripts/command_suggester/types.ts +0 -0
  439. package/src/scripts/compile_router.ts +10 -14
  440. package/src/scripts/condense.sh +3 -4
  441. package/src/scripts/condense.ts +247 -228
  442. package/src/scripts/cost/track.mjs +168 -33
  443. package/src/scripts/cost_summary.ts +33 -1
  444. package/src/scripts/council_cli.ts +51 -5
  445. package/src/scripts/discovery_graph.ts +0 -0
  446. package/src/scripts/encoding_corpus.ts +500 -0
  447. package/src/scripts/encoding_corpus_report.ts +216 -0
  448. package/src/scripts/evaluator_umbrella.sh +34 -1
  449. package/src/scripts/generate_index.ts +19 -2
  450. package/src/scripts/install-hooks.sh +2 -2
  451. package/src/scripts/learning_sidecar.ts +0 -0
  452. package/src/scripts/lint_confusables.ts +10 -72
  453. package/src/scripts/lint_eval_fixture_citations.ts +113 -0
  454. package/src/scripts/lint_featured_skills.ts +0 -0
  455. package/src/scripts/lint_hidden_unicode.ts +208 -0
  456. package/src/scripts/lint_load_context.ts +17 -5
  457. package/src/scripts/lint_new_skill_gate.ts +9 -3
  458. package/src/scripts/lint_no_python_twin_rationale.ts +17 -2
  459. package/src/scripts/lint_originality.ts +1 -1
  460. package/src/scripts/lint_skill_originality.ts +1 -1
  461. package/src/scripts/lint_ticket_buildable.ts +1 -1
  462. package/src/scripts/lint_ui_stack_bundles.ts +170 -0
  463. package/src/scripts/mcp_server/tools.ts +4 -4
  464. package/src/scripts/measure_scope_dedup.ts +224 -0
  465. package/src/scripts/memory_lookup.ts +0 -0
  466. package/src/scripts/mine_session.ts +98 -0
  467. package/src/scripts/orchestration_payload_hash_drift.ts +145 -0
  468. package/src/scripts/preamble_byte_census.ts +574 -0
  469. package/src/scripts/probe_skill_registration.ts +2 -2
  470. package/src/scripts/redact_hook_capture.ts +13 -0
  471. package/src/scripts/release.ts +65 -10
  472. package/src/scripts/router_telemetry.ts +1 -1
  473. package/src/scripts/second_brain_retrieval.ts +14 -4
  474. package/src/scripts/skill_linter.ts +5 -0
  475. package/src/scripts/surface-tiers.yml +2 -0
  476. package/src/scripts/validate_pack_yaml.ts +0 -0
  477. package/src/server/schemas/settings.ts +8 -0
  478. package/src/shared/userMd/utils.ts +31 -0
  479. package/dist/agent-src/rules/telegraph-speak.md +0 -87
@@ -117,17 +117,17 @@ var require_visit = __commonJS({
117
117
  visit.BREAK = BREAK;
118
118
  visit.SKIP = SKIP;
119
119
  visit.REMOVE = REMOVE;
120
- function visit_(key, node, visitor, path13) {
121
- const ctrl = callVisitor(key, node, visitor, path13);
120
+ function visit_(key, node, visitor, path14) {
121
+ const ctrl = callVisitor(key, node, visitor, path14);
122
122
  if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
123
- replaceNode(key, path13, ctrl);
124
- return visit_(key, ctrl, visitor, path13);
123
+ replaceNode(key, path14, ctrl);
124
+ return visit_(key, ctrl, visitor, path14);
125
125
  }
126
126
  if (typeof ctrl !== "symbol") {
127
127
  if (identity.isCollection(node)) {
128
- path13 = Object.freeze(path13.concat(node));
128
+ path14 = Object.freeze(path14.concat(node));
129
129
  for (let i = 0; i < node.items.length; ++i) {
130
- const ci = visit_(i, node.items[i], visitor, path13);
130
+ const ci = visit_(i, node.items[i], visitor, path14);
131
131
  if (typeof ci === "number")
132
132
  i = ci - 1;
133
133
  else if (ci === BREAK)
@@ -138,13 +138,13 @@ var require_visit = __commonJS({
138
138
  }
139
139
  }
140
140
  } else if (identity.isPair(node)) {
141
- path13 = Object.freeze(path13.concat(node));
142
- const ck = visit_("key", node.key, visitor, path13);
141
+ path14 = Object.freeze(path14.concat(node));
142
+ const ck = visit_("key", node.key, visitor, path14);
143
143
  if (ck === BREAK)
144
144
  return BREAK;
145
145
  else if (ck === REMOVE)
146
146
  node.key = null;
147
- const cv = visit_("value", node.value, visitor, path13);
147
+ const cv = visit_("value", node.value, visitor, path14);
148
148
  if (cv === BREAK)
149
149
  return BREAK;
150
150
  else if (cv === REMOVE)
@@ -165,17 +165,17 @@ var require_visit = __commonJS({
165
165
  visitAsync.BREAK = BREAK;
166
166
  visitAsync.SKIP = SKIP;
167
167
  visitAsync.REMOVE = REMOVE;
168
- async function visitAsync_(key, node, visitor, path13) {
169
- const ctrl = await callVisitor(key, node, visitor, path13);
168
+ async function visitAsync_(key, node, visitor, path14) {
169
+ const ctrl = await callVisitor(key, node, visitor, path14);
170
170
  if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
171
- replaceNode(key, path13, ctrl);
172
- return visitAsync_(key, ctrl, visitor, path13);
171
+ replaceNode(key, path14, ctrl);
172
+ return visitAsync_(key, ctrl, visitor, path14);
173
173
  }
174
174
  if (typeof ctrl !== "symbol") {
175
175
  if (identity.isCollection(node)) {
176
- path13 = Object.freeze(path13.concat(node));
176
+ path14 = Object.freeze(path14.concat(node));
177
177
  for (let i = 0; i < node.items.length; ++i) {
178
- const ci = await visitAsync_(i, node.items[i], visitor, path13);
178
+ const ci = await visitAsync_(i, node.items[i], visitor, path14);
179
179
  if (typeof ci === "number")
180
180
  i = ci - 1;
181
181
  else if (ci === BREAK)
@@ -186,13 +186,13 @@ var require_visit = __commonJS({
186
186
  }
187
187
  }
188
188
  } else if (identity.isPair(node)) {
189
- path13 = Object.freeze(path13.concat(node));
190
- const ck = await visitAsync_("key", node.key, visitor, path13);
189
+ path14 = Object.freeze(path14.concat(node));
190
+ const ck = await visitAsync_("key", node.key, visitor, path14);
191
191
  if (ck === BREAK)
192
192
  return BREAK;
193
193
  else if (ck === REMOVE)
194
194
  node.key = null;
195
- const cv = await visitAsync_("value", node.value, visitor, path13);
195
+ const cv = await visitAsync_("value", node.value, visitor, path14);
196
196
  if (cv === BREAK)
197
197
  return BREAK;
198
198
  else if (cv === REMOVE)
@@ -219,23 +219,23 @@ var require_visit = __commonJS({
219
219
  }
220
220
  return visitor;
221
221
  }
222
- function callVisitor(key, node, visitor, path13) {
222
+ function callVisitor(key, node, visitor, path14) {
223
223
  if (typeof visitor === "function")
224
- return visitor(key, node, path13);
224
+ return visitor(key, node, path14);
225
225
  if (identity.isMap(node))
226
- return visitor.Map?.(key, node, path13);
226
+ return visitor.Map?.(key, node, path14);
227
227
  if (identity.isSeq(node))
228
- return visitor.Seq?.(key, node, path13);
228
+ return visitor.Seq?.(key, node, path14);
229
229
  if (identity.isPair(node))
230
- return visitor.Pair?.(key, node, path13);
230
+ return visitor.Pair?.(key, node, path14);
231
231
  if (identity.isScalar(node))
232
- return visitor.Scalar?.(key, node, path13);
232
+ return visitor.Scalar?.(key, node, path14);
233
233
  if (identity.isAlias(node))
234
- return visitor.Alias?.(key, node, path13);
234
+ return visitor.Alias?.(key, node, path14);
235
235
  return void 0;
236
236
  }
237
- function replaceNode(key, path13, node) {
238
- const parent = path13[path13.length - 1];
237
+ function replaceNode(key, path14, node) {
238
+ const parent = path14[path14.length - 1];
239
239
  if (identity.isCollection(parent)) {
240
240
  parent.items[key] = node;
241
241
  } else if (identity.isPair(parent)) {
@@ -845,10 +845,10 @@ var require_Collection = __commonJS({
845
845
  var createNode = require_createNode();
846
846
  var identity = require_identity();
847
847
  var Node = require_Node();
848
- function collectionFromPath(schema, path13, value) {
848
+ function collectionFromPath(schema, path14, value) {
849
849
  let v = value;
850
- for (let i = path13.length - 1; i >= 0; --i) {
851
- const k = path13[i];
850
+ for (let i = path14.length - 1; i >= 0; --i) {
851
+ const k = path14[i];
852
852
  if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
853
853
  const a = [];
854
854
  a[k] = v;
@@ -867,7 +867,7 @@ var require_Collection = __commonJS({
867
867
  sourceObjects: /* @__PURE__ */ new Map()
868
868
  });
869
869
  }
870
- var isEmptyPath = (path13) => path13 == null || typeof path13 === "object" && !!path13[Symbol.iterator]().next().done;
870
+ var isEmptyPath = (path14) => path14 == null || typeof path14 === "object" && !!path14[Symbol.iterator]().next().done;
871
871
  var Collection = class extends Node.NodeBase {
872
872
  constructor(type, schema) {
873
873
  super(type);
@@ -897,11 +897,11 @@ var require_Collection = __commonJS({
897
897
  * be a Pair instance or a `{ key, value }` object, which may not have a key
898
898
  * that already exists in the map.
899
899
  */
900
- addIn(path13, value) {
901
- if (isEmptyPath(path13))
900
+ addIn(path14, value) {
901
+ if (isEmptyPath(path14))
902
902
  this.add(value);
903
903
  else {
904
- const [key, ...rest] = path13;
904
+ const [key, ...rest] = path14;
905
905
  const node = this.get(key, true);
906
906
  if (identity.isCollection(node))
907
907
  node.addIn(rest, value);
@@ -915,8 +915,8 @@ var require_Collection = __commonJS({
915
915
  * Removes a value from the collection.
916
916
  * @returns `true` if the item was found and removed.
917
917
  */
918
- deleteIn(path13) {
919
- const [key, ...rest] = path13;
918
+ deleteIn(path14) {
919
+ const [key, ...rest] = path14;
920
920
  if (rest.length === 0)
921
921
  return this.delete(key);
922
922
  const node = this.get(key, true);
@@ -930,8 +930,8 @@ var require_Collection = __commonJS({
930
930
  * scalar values from their surrounding node; to disable set `keepScalar` to
931
931
  * `true` (collections are always returned intact).
932
932
  */
933
- getIn(path13, keepScalar) {
934
- const [key, ...rest] = path13;
933
+ getIn(path14, keepScalar) {
934
+ const [key, ...rest] = path14;
935
935
  const node = this.get(key, true);
936
936
  if (rest.length === 0)
937
937
  return !keepScalar && identity.isScalar(node) ? node.value : node;
@@ -949,8 +949,8 @@ var require_Collection = __commonJS({
949
949
  /**
950
950
  * Checks if the collection includes a value with the key `key`.
951
951
  */
952
- hasIn(path13) {
953
- const [key, ...rest] = path13;
952
+ hasIn(path14) {
953
+ const [key, ...rest] = path14;
954
954
  if (rest.length === 0)
955
955
  return this.has(key);
956
956
  const node = this.get(key, true);
@@ -960,8 +960,8 @@ var require_Collection = __commonJS({
960
960
  * Sets a value in this collection. For `!!set`, `value` needs to be a
961
961
  * boolean to add/remove the item from the set.
962
962
  */
963
- setIn(path13, value) {
964
- const [key, ...rest] = path13;
963
+ setIn(path14, value) {
964
+ const [key, ...rest] = path14;
965
965
  if (rest.length === 0) {
966
966
  this.set(key, value);
967
967
  } else {
@@ -3476,9 +3476,9 @@ var require_Document = __commonJS({
3476
3476
  this.contents.add(value);
3477
3477
  }
3478
3478
  /** Adds a value to the document. */
3479
- addIn(path13, value) {
3479
+ addIn(path14, value) {
3480
3480
  if (assertCollection(this.contents))
3481
- this.contents.addIn(path13, value);
3481
+ this.contents.addIn(path14, value);
3482
3482
  }
3483
3483
  /**
3484
3484
  * Create a new `Alias` node, ensuring that the target `node` has the required anchor.
@@ -3553,14 +3553,14 @@ var require_Document = __commonJS({
3553
3553
  * Removes a value from the document.
3554
3554
  * @returns `true` if the item was found and removed.
3555
3555
  */
3556
- deleteIn(path13) {
3557
- if (Collection.isEmptyPath(path13)) {
3556
+ deleteIn(path14) {
3557
+ if (Collection.isEmptyPath(path14)) {
3558
3558
  if (this.contents == null)
3559
3559
  return false;
3560
3560
  this.contents = null;
3561
3561
  return true;
3562
3562
  }
3563
- return assertCollection(this.contents) ? this.contents.deleteIn(path13) : false;
3563
+ return assertCollection(this.contents) ? this.contents.deleteIn(path14) : false;
3564
3564
  }
3565
3565
  /**
3566
3566
  * Returns item at `key`, or `undefined` if not found. By default unwraps
@@ -3575,10 +3575,10 @@ var require_Document = __commonJS({
3575
3575
  * scalar values from their surrounding node; to disable set `keepScalar` to
3576
3576
  * `true` (collections are always returned intact).
3577
3577
  */
3578
- getIn(path13, keepScalar) {
3579
- if (Collection.isEmptyPath(path13))
3578
+ getIn(path14, keepScalar) {
3579
+ if (Collection.isEmptyPath(path14))
3580
3580
  return !keepScalar && identity.isScalar(this.contents) ? this.contents.value : this.contents;
3581
- return identity.isCollection(this.contents) ? this.contents.getIn(path13, keepScalar) : void 0;
3581
+ return identity.isCollection(this.contents) ? this.contents.getIn(path14, keepScalar) : void 0;
3582
3582
  }
3583
3583
  /**
3584
3584
  * Checks if the document includes a value with the key `key`.
@@ -3589,10 +3589,10 @@ var require_Document = __commonJS({
3589
3589
  /**
3590
3590
  * Checks if the document includes a value at `path`.
3591
3591
  */
3592
- hasIn(path13) {
3593
- if (Collection.isEmptyPath(path13))
3592
+ hasIn(path14) {
3593
+ if (Collection.isEmptyPath(path14))
3594
3594
  return this.contents !== void 0;
3595
- return identity.isCollection(this.contents) ? this.contents.hasIn(path13) : false;
3595
+ return identity.isCollection(this.contents) ? this.contents.hasIn(path14) : false;
3596
3596
  }
3597
3597
  /**
3598
3598
  * Sets a value in this document. For `!!set`, `value` needs to be a
@@ -3609,13 +3609,13 @@ var require_Document = __commonJS({
3609
3609
  * Sets a value in this document. For `!!set`, `value` needs to be a
3610
3610
  * boolean to add/remove the item from the set.
3611
3611
  */
3612
- setIn(path13, value) {
3613
- if (Collection.isEmptyPath(path13)) {
3612
+ setIn(path14, value) {
3613
+ if (Collection.isEmptyPath(path14)) {
3614
3614
  this.contents = value;
3615
3615
  } else if (this.contents == null) {
3616
- this.contents = Collection.collectionFromPath(this.schema, Array.from(path13), value);
3616
+ this.contents = Collection.collectionFromPath(this.schema, Array.from(path14), value);
3617
3617
  } else if (assertCollection(this.contents)) {
3618
- this.contents.setIn(path13, value);
3618
+ this.contents.setIn(path14, value);
3619
3619
  }
3620
3620
  }
3621
3621
  /**
@@ -5575,9 +5575,9 @@ var require_cst_visit = __commonJS({
5575
5575
  visit.BREAK = BREAK;
5576
5576
  visit.SKIP = SKIP;
5577
5577
  visit.REMOVE = REMOVE;
5578
- visit.itemAtPath = (cst, path13) => {
5578
+ visit.itemAtPath = (cst, path14) => {
5579
5579
  let item = cst;
5580
- for (const [field, index] of path13) {
5580
+ for (const [field, index] of path14) {
5581
5581
  const tok = item?.[field];
5582
5582
  if (tok && "items" in tok) {
5583
5583
  item = tok.items[index];
@@ -5586,23 +5586,23 @@ var require_cst_visit = __commonJS({
5586
5586
  }
5587
5587
  return item;
5588
5588
  };
5589
- visit.parentCollection = (cst, path13) => {
5590
- const parent = visit.itemAtPath(cst, path13.slice(0, -1));
5591
- const field = path13[path13.length - 1][0];
5589
+ visit.parentCollection = (cst, path14) => {
5590
+ const parent = visit.itemAtPath(cst, path14.slice(0, -1));
5591
+ const field = path14[path14.length - 1][0];
5592
5592
  const coll = parent?.[field];
5593
5593
  if (coll && "items" in coll)
5594
5594
  return coll;
5595
5595
  throw new Error("Parent collection not found");
5596
5596
  };
5597
- function _visit(path13, item, visitor) {
5598
- let ctrl = visitor(item, path13);
5597
+ function _visit(path14, item, visitor) {
5598
+ let ctrl = visitor(item, path14);
5599
5599
  if (typeof ctrl === "symbol")
5600
5600
  return ctrl;
5601
5601
  for (const field of ["key", "value"]) {
5602
5602
  const token = item[field];
5603
5603
  if (token && "items" in token) {
5604
5604
  for (let i = 0; i < token.items.length; ++i) {
5605
- const ci = _visit(Object.freeze(path13.concat([[field, i]])), token.items[i], visitor);
5605
+ const ci = _visit(Object.freeze(path14.concat([[field, i]])), token.items[i], visitor);
5606
5606
  if (typeof ci === "number")
5607
5607
  i = ci - 1;
5608
5608
  else if (ci === BREAK)
@@ -5613,10 +5613,10 @@ var require_cst_visit = __commonJS({
5613
5613
  }
5614
5614
  }
5615
5615
  if (typeof ctrl === "function" && field === "key")
5616
- ctrl = ctrl(item, path13);
5616
+ ctrl = ctrl(item, path14);
5617
5617
  }
5618
5618
  }
5619
- return typeof ctrl === "function" ? ctrl(item, path13) : ctrl;
5619
+ return typeof ctrl === "function" ? ctrl(item, path14) : ctrl;
5620
5620
  }
5621
5621
  exports.visit = visit;
5622
5622
  }
@@ -6918,14 +6918,14 @@ var require_parser = __commonJS({
6918
6918
  case "scalar":
6919
6919
  case "single-quoted-scalar":
6920
6920
  case "double-quoted-scalar": {
6921
- const fs15 = this.flowScalar(this.type);
6921
+ const fs16 = this.flowScalar(this.type);
6922
6922
  if (atNextItem || it.value) {
6923
- map.items.push({ start, key: fs15, sep: [] });
6923
+ map.items.push({ start, key: fs16, sep: [] });
6924
6924
  this.onKeyLine = true;
6925
6925
  } else if (it.sep) {
6926
- this.stack.push(fs15);
6926
+ this.stack.push(fs16);
6927
6927
  } else {
6928
- Object.assign(it, { key: fs15, sep: [] });
6928
+ Object.assign(it, { key: fs16, sep: [] });
6929
6929
  this.onKeyLine = true;
6930
6930
  }
6931
6931
  return;
@@ -7053,13 +7053,13 @@ var require_parser = __commonJS({
7053
7053
  case "scalar":
7054
7054
  case "single-quoted-scalar":
7055
7055
  case "double-quoted-scalar": {
7056
- const fs15 = this.flowScalar(this.type);
7056
+ const fs16 = this.flowScalar(this.type);
7057
7057
  if (!it || it.value)
7058
- fc.items.push({ start: [], key: fs15, sep: [] });
7058
+ fc.items.push({ start: [], key: fs16, sep: [] });
7059
7059
  else if (it.sep)
7060
- this.stack.push(fs15);
7060
+ this.stack.push(fs16);
7061
7061
  else
7062
- Object.assign(it, { key: fs15, sep: [] });
7062
+ Object.assign(it, { key: fs16, sep: [] });
7063
7063
  return;
7064
7064
  }
7065
7065
  case "flow-map-end":
@@ -7370,11 +7370,11 @@ var require_dist = __commonJS({
7370
7370
  // src/scripts/install.ts
7371
7371
  import { spawn, spawnSync as spawnSync2 } from "node:child_process";
7372
7372
  import * as crypto3 from "node:crypto";
7373
- import * as fs14 from "node:fs";
7373
+ import * as fs15 from "node:fs";
7374
7374
  import * as os7 from "node:os";
7375
- import * as path12 from "node:path";
7375
+ import * as path13 from "node:path";
7376
7376
  import process3 from "node:process";
7377
- import { fileURLToPath as fileURLToPath3, pathToFileURL as pathToFileURL2 } from "node:url";
7377
+ import { fileURLToPath as fileURLToPath4, pathToFileURL as pathToFileURL2 } from "node:url";
7378
7378
 
7379
7379
  // src/scripts/_lib/json_pointers.ts
7380
7380
  import { createHash } from "node:crypto";
@@ -7872,8 +7872,8 @@ function lockfile_write_path(env) {
7872
7872
  }
7873
7873
  return write_target("installed.lock", { env: env ?? null });
7874
7874
  }
7875
- function read_lockfile(path13) {
7876
- const target = path13 ?? lockfile_path();
7875
+ function read_lockfile(path14) {
7876
+ const target = path14 ?? lockfile_path();
7877
7877
  let text;
7878
7878
  try {
7879
7879
  text = fs2.readFileSync(target, { encoding: "utf-8" });
@@ -8741,18 +8741,18 @@ function manifest_path(project_root, env) {
8741
8741
  var _TOP_KEY_RE = /^([A-Za-z_][A-Za-z0-9_]*)\s*:\s*"?([^"\n]*?)"?\s*$/;
8742
8742
  var _LIST_DASH_RE = /^\s*-\s*(.+?)\s*$/;
8743
8743
  var _INDENT_KEY_RE = /^\s+([A-Za-z_][A-Za-z0-9_]*)\s*:\s*"?([^"\n]*?)"?\s*$/;
8744
- function read_manifest(path13) {
8744
+ function read_manifest(path14) {
8745
8745
  let text;
8746
8746
  try {
8747
- text = require_read_text(path13);
8747
+ text = require_read_text(path14);
8748
8748
  } catch {
8749
8749
  return null;
8750
8750
  }
8751
8751
  const data = _parse_manual(text);
8752
8752
  return _normalise_v2_shape(data);
8753
8753
  }
8754
- function require_read_text(path13) {
8755
- return fs6.readFileSync(path13, { encoding: "utf-8" });
8754
+ function require_read_text(path14) {
8755
+ return fs6.readFileSync(path14, { encoding: "utf-8" });
8756
8756
  }
8757
8757
  function _normalise_v2_shape(data) {
8758
8758
  if (data["tools"] === void 0 || data["tools"] === null) {
@@ -8933,9 +8933,9 @@ function stable_sort(items, key) {
8933
8933
  return a.index - b.index;
8934
8934
  }).map((entry) => entry.item);
8935
8935
  }
8936
- function write_manifest(path13, version, tools, options = {}) {
8936
+ function write_manifest(path14, version, tools, options = {}) {
8937
8937
  const rendered = _render2(version, tools, { deploy_roots: options.deploy_roots ?? null });
8938
- return write_atomic(path13, rendered);
8938
+ return write_atomic(path14, rendered);
8939
8939
  }
8940
8940
  var ScopeMismatchError = class extends Error {
8941
8941
  name_;
@@ -10529,8 +10529,8 @@ function getErrorMap() {
10529
10529
 
10530
10530
  // node_modules/zod/v3/helpers/parseUtil.js
10531
10531
  var makeIssue = (params) => {
10532
- const { data, path: path13, errorMaps, issueData } = params;
10533
- const fullPath = [...path13, ...issueData.path || []];
10532
+ const { data, path: path14, errorMaps, issueData } = params;
10533
+ const fullPath = [...path14, ...issueData.path || []];
10534
10534
  const fullIssue = {
10535
10535
  ...issueData,
10536
10536
  path: fullPath
@@ -10646,11 +10646,11 @@ var errorUtil;
10646
10646
 
10647
10647
  // node_modules/zod/v3/types.js
10648
10648
  var ParseInputLazyPath = class {
10649
- constructor(parent, value, path13, key) {
10649
+ constructor(parent, value, path14, key) {
10650
10650
  this._cachedPath = [];
10651
10651
  this.parent = parent;
10652
10652
  this.data = value;
10653
- this._path = path13;
10653
+ this._path = path14;
10654
10654
  this._key = key;
10655
10655
  }
10656
10656
  get path() {
@@ -14302,6 +14302,14 @@ var settingsSchema = external_exports.object({
14302
14302
  "Consumed by the doc-screenshot-hygiene rule. on (default) = a data-bearing screenshot embed is gated behind this-turn human confirmation; uncertain/unresolved regions redact-or-refuse, never ship-and-hope; illustrative/no-data screenshots may embed with a stated justification. off = no data-bearing gate (the anonymization taxonomy still applies)."
14303
14303
  )
14304
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" }),
14305
14313
  tokens: external_exports.object({
14306
14314
  rich_skills: richSkillsMode.default("on").describe(
14307
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."
@@ -16000,10 +16008,42 @@ function render_native_model_md(text, tier) {
16000
16008
 
16001
16009
  // src/scripts/_cli/cmd_migrate.ts
16002
16010
  import { spawnSync } from "node:child_process";
16011
+ import * as fs14 from "node:fs";
16012
+ import * as path12 from "node:path";
16013
+ import process2 from "node:process";
16014
+ import { fileURLToPath as fileURLToPath3, pathToFileURL } from "node:url";
16015
+
16016
+ // src/scripts/_lib/package_root.ts
16003
16017
  import * as fs13 from "node:fs";
16004
16018
  import * as path11 from "node:path";
16005
- import process2 from "node:process";
16006
- import { fileURLToPath as fileURLToPath2, pathToFileURL } from "node:url";
16019
+ import { fileURLToPath as fileURLToPath2 } from "node:url";
16020
+ var PACKAGE_NAME = "@event4u/agent-config";
16021
+ var MAX_ASCENT = 16;
16022
+ function resolvePackageRoot(fromUrlOrPath, legacyHops = 3) {
16023
+ const start = fromUrlOrPath.startsWith("file:") ? fileURLToPath2(fromUrlOrPath) : fromUrlOrPath;
16024
+ const startDir = path11.dirname(start);
16025
+ let dir = startDir;
16026
+ for (let i = 0; i < MAX_ASCENT; i++) {
16027
+ const manifest = path11.join(dir, "package.json");
16028
+ if (fs13.existsSync(manifest)) {
16029
+ try {
16030
+ const parsed = JSON.parse(fs13.readFileSync(manifest, "utf8"));
16031
+ if (parsed.name === PACKAGE_NAME) {
16032
+ return dir;
16033
+ }
16034
+ } catch {
16035
+ }
16036
+ }
16037
+ const parent = path11.dirname(dir);
16038
+ if (parent === dir) {
16039
+ break;
16040
+ }
16041
+ dir = parent;
16042
+ }
16043
+ return path11.resolve(startDir, ...Array.from({ length: legacyHops }, () => ".."));
16044
+ }
16045
+
16046
+ // src/scripts/_cli/cmd_migrate.ts
16007
16047
  var PACKAGE_NAME_NPM = "@event4u/agent-config";
16008
16048
  var PACKAGE_NAME_COMPOSER = "event4u/agent-config";
16009
16049
  var LEGACY_DIRS = ["vendor", "node_modules"];
@@ -16021,7 +16061,7 @@ var LEGACY_SETTINGS_FILES = [".agent-settings.yml", ".agent-user.yml"];
16021
16061
  var LEGACY_STATE_FILENAME = ".implement-ticket-state.json";
16022
16062
  var LEGACY_STATE_V1_FILENAME = ".work-state.json";
16023
16063
  var LEGACY_AGENT_CONFIG_SHELL = "agent-config";
16024
- var _HERE_DIR = path11.dirname(fileURLToPath2(import.meta.url));
16064
+ var _HERE_DIR = path12.dirname(fileURLToPath3(import.meta.url));
16025
16065
  var ArgparseExit = class extends Error {
16026
16066
  code;
16027
16067
  constructor(code) {
@@ -16120,38 +16160,38 @@ function _jsonDumpsIndentAscii(value, indent) {
16120
16160
  }
16121
16161
  function _isFile2(p) {
16122
16162
  try {
16123
- return fs13.statSync(p).isFile();
16163
+ return fs14.statSync(p).isFile();
16124
16164
  } catch {
16125
16165
  return false;
16126
16166
  }
16127
16167
  }
16128
16168
  function _isDir2(p) {
16129
16169
  try {
16130
- return fs13.statSync(p).isDirectory();
16170
+ return fs14.statSync(p).isDirectory();
16131
16171
  } catch {
16132
16172
  return false;
16133
16173
  }
16134
16174
  }
16135
16175
  function _isSymlink(p) {
16136
16176
  try {
16137
- return fs13.lstatSync(p).isSymbolicLink();
16177
+ return fs14.lstatSync(p).isSymbolicLink();
16138
16178
  } catch {
16139
16179
  return false;
16140
16180
  }
16141
16181
  }
16142
16182
  function _exists2(p) {
16143
16183
  try {
16144
- fs13.lstatSync(p);
16184
+ fs14.lstatSync(p);
16145
16185
  return true;
16146
16186
  } catch {
16147
16187
  return false;
16148
16188
  }
16149
16189
  }
16150
16190
  function _readText(p) {
16151
- return fs13.readFileSync(p, { encoding: "utf-8" });
16191
+ return fs14.readFileSync(p, { encoding: "utf-8" });
16152
16192
  }
16153
16193
  function _writeText(p, text) {
16154
- fs13.writeFileSync(p, text, { encoding: "utf-8" });
16194
+ fs14.writeFileSync(p, text, { encoding: "utf-8" });
16155
16195
  }
16156
16196
  function _jsonLoadFile(p) {
16157
16197
  return JSON.parse(_readText(p));
@@ -16207,7 +16247,7 @@ function _classify_symlink(link) {
16207
16247
  }
16208
16248
  let target;
16209
16249
  try {
16210
- target = fs13.readlinkSync(link);
16250
+ target = fs14.readlinkSync(link);
16211
16251
  } catch {
16212
16252
  return null;
16213
16253
  }
@@ -16218,16 +16258,16 @@ function _classify_symlink(link) {
16218
16258
  return "user";
16219
16259
  }
16220
16260
  function _detect_legacy_state(project) {
16221
- return _isFile2(path11.join(project, LEGACY_STATE_FILENAME));
16261
+ return _isFile2(path12.join(project, LEGACY_STATE_FILENAME));
16222
16262
  }
16223
16263
  function _detect_legacy_settings(project) {
16224
16264
  const found = [];
16225
16265
  for (const name of LEGACY_SETTINGS_FILES) {
16226
- const flat = path11.join(project, name);
16266
+ const flat = path12.join(project, name);
16227
16267
  if (_isFile2(flat)) {
16228
16268
  found.push(flat);
16229
16269
  }
16230
- const typed = path11.join(project, "settings", name);
16270
+ const typed = path12.join(project, "settings", name);
16231
16271
  if (_isFile2(typed)) {
16232
16272
  found.push(typed);
16233
16273
  }
@@ -16235,25 +16275,25 @@ function _detect_legacy_settings(project) {
16235
16275
  return found;
16236
16276
  }
16237
16277
  function _detect_empty_shell(project) {
16238
- const shell = path11.join(project, LEGACY_AGENT_CONFIG_SHELL);
16278
+ const shell = path12.join(project, LEGACY_AGENT_CONFIG_SHELL);
16239
16279
  if (!_isDir2(shell) || _isSymlink(shell)) {
16240
16280
  return false;
16241
16281
  }
16242
16282
  try {
16243
- return fs13.readdirSync(shell).length === 0;
16283
+ return fs14.readdirSync(shell).length === 0;
16244
16284
  } catch {
16245
16285
  return false;
16246
16286
  }
16247
16287
  }
16248
16288
  function _detect_already_migrated(project) {
16249
- if (_detect_npm(path11.join(project, "package.json"))) {
16289
+ if (_detect_npm(path12.join(project, "package.json"))) {
16250
16290
  return false;
16251
16291
  }
16252
- if (_detect_composer(path11.join(project, "composer.json"))) {
16292
+ if (_detect_composer(path12.join(project, "composer.json"))) {
16253
16293
  return false;
16254
16294
  }
16255
16295
  for (const name of MANAGED_SYMLINKS) {
16256
- if (_classify_symlink(path11.join(project, name)) === "legacy") {
16296
+ if (_classify_symlink(path12.join(project, name)) === "legacy") {
16257
16297
  return false;
16258
16298
  }
16259
16299
  }
@@ -16324,11 +16364,11 @@ function _purge_legacy_symlinks(project) {
16324
16364
  const removed = [];
16325
16365
  const preserved = [];
16326
16366
  for (const name of MANAGED_SYMLINKS) {
16327
- const link = path11.join(project, name);
16367
+ const link = path12.join(project, name);
16328
16368
  const kind = _classify_symlink(link);
16329
16369
  if (kind === "legacy") {
16330
16370
  try {
16331
- fs13.unlinkSync(link);
16371
+ fs14.unlinkSync(link);
16332
16372
  removed.push(name);
16333
16373
  } catch {
16334
16374
  preserved.push(name);
@@ -16340,14 +16380,14 @@ function _purge_legacy_symlinks(project) {
16340
16380
  return [removed, preserved];
16341
16381
  }
16342
16382
  function _migrate_state_file(project) {
16343
- const source = path11.join(project, LEGACY_STATE_FILENAME);
16383
+ const source = path12.join(project, LEGACY_STATE_FILENAME);
16344
16384
  if (!_isFile2(source)) {
16345
16385
  return null;
16346
16386
  }
16347
- const target = path11.join(project, LEGACY_STATE_V1_FILENAME);
16387
+ const target = path12.join(project, LEGACY_STATE_V1_FILENAME);
16348
16388
  if (_exists2(target)) {
16349
16389
  try {
16350
- fs13.unlinkSync(source);
16390
+ fs14.unlinkSync(source);
16351
16391
  return `removed stale ${LEGACY_STATE_FILENAME} (v1 already present)`;
16352
16392
  } catch {
16353
16393
  return null;
@@ -16361,8 +16401,8 @@ function _migrate_state_file(project) {
16361
16401
  return `migrated ${LEGACY_STATE_FILENAME} \u2192 ${LEGACY_STATE_V1_FILENAME}`;
16362
16402
  }
16363
16403
  function _load_state_migrator() {
16364
- const pkg_root = path11.resolve(_HERE_DIR, "..", "..", "..");
16365
- const rel = path11.join(
16404
+ const pkg_root = resolvePackageRoot(import.meta.url);
16405
+ const rel = path12.join(
16366
16406
  "agent-src",
16367
16407
  "templates",
16368
16408
  "scripts",
@@ -16370,8 +16410,8 @@ function _load_state_migrator() {
16370
16410
  "migration",
16371
16411
  "v0_to_v1.ts"
16372
16412
  );
16373
- const driver = [path11.join(pkg_root, "dist", rel), path11.join(pkg_root, "src", rel)].find(
16374
- (p) => fs13.existsSync(p)
16413
+ const driver = [path12.join(pkg_root, "dist", rel), path12.join(pkg_root, "src", rel)].find(
16414
+ (p) => fs14.existsSync(p)
16375
16415
  ) ?? null;
16376
16416
  if (driver === null) {
16377
16417
  return null;
@@ -16379,12 +16419,12 @@ function _load_state_migrator() {
16379
16419
  const binName = process2.platform === "win32" ? "tsx.cmd" : "tsx";
16380
16420
  let tsxBin = null;
16381
16421
  for (let dir = pkg_root; ; ) {
16382
- const cand = path11.join(dir, "node_modules", ".bin", binName);
16383
- if (fs13.existsSync(cand)) {
16422
+ const cand = path12.join(dir, "node_modules", ".bin", binName);
16423
+ if (fs14.existsSync(cand)) {
16384
16424
  tsxBin = cand;
16385
16425
  break;
16386
16426
  }
16387
- const parent = path11.dirname(dir);
16427
+ const parent = path12.dirname(dir);
16388
16428
  if (parent === dir) break;
16389
16429
  dir = parent;
16390
16430
  }
@@ -16411,17 +16451,17 @@ function _delete_legacy_settings(project) {
16411
16451
  const removed = [];
16412
16452
  for (const p of _detect_legacy_settings(project)) {
16413
16453
  try {
16414
- fs13.unlinkSync(p);
16415
- removed.push(path11.relative(project, p));
16454
+ fs14.unlinkSync(p);
16455
+ removed.push(path12.relative(project, p));
16416
16456
  } catch {
16417
16457
  continue;
16418
16458
  }
16419
16459
  }
16420
- const settings_dir = path11.join(project, "settings");
16460
+ const settings_dir = path12.join(project, "settings");
16421
16461
  if (_isDir2(settings_dir) && !_isSymlink(settings_dir)) {
16422
16462
  try {
16423
- if (fs13.readdirSync(settings_dir).length === 0) {
16424
- fs13.rmdirSync(settings_dir);
16463
+ if (fs14.readdirSync(settings_dir).length === 0) {
16464
+ fs14.rmdirSync(settings_dir);
16425
16465
  removed.push("settings/");
16426
16466
  }
16427
16467
  } catch {
@@ -16430,12 +16470,12 @@ function _delete_legacy_settings(project) {
16430
16470
  return removed;
16431
16471
  }
16432
16472
  function _remove_empty_shell(project) {
16433
- const shell = path11.join(project, LEGACY_AGENT_CONFIG_SHELL);
16473
+ const shell = path12.join(project, LEGACY_AGENT_CONFIG_SHELL);
16434
16474
  if (!_detect_empty_shell(project)) {
16435
16475
  return false;
16436
16476
  }
16437
16477
  try {
16438
- fs13.rmdirSync(shell);
16478
+ fs14.rmdirSync(shell);
16439
16479
  } catch {
16440
16480
  return false;
16441
16481
  }
@@ -16445,7 +16485,7 @@ function _reEscape(s) {
16445
16485
  return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
16446
16486
  }
16447
16487
  function _update_gitignore(project) {
16448
- const gitignore = path11.join(project, ".gitignore");
16488
+ const gitignore = path12.join(project, ".gitignore");
16449
16489
  const block = `${GITIGNORE_BLOCK_START}
16450
16490
  ${GITIGNORE_NEW_BODY}${GITIGNORE_BLOCK_END}
16451
16491
  `;
@@ -16476,16 +16516,16 @@ ${GITIGNORE_NEW_BODY}${GITIGNORE_BLOCK_END}
16476
16516
  }
16477
16517
  function _build_plan(project) {
16478
16518
  return {
16479
- npm: _detect_npm(path11.join(project, "package.json")),
16480
- composer: _detect_composer(path11.join(project, "composer.json")),
16519
+ npm: _detect_npm(path12.join(project, "package.json")),
16520
+ composer: _detect_composer(path12.join(project, "composer.json")),
16481
16521
  symlinks_legacy: MANAGED_SYMLINKS.filter(
16482
- (name) => _classify_symlink(path11.join(project, name)) === "legacy"
16522
+ (name) => _classify_symlink(path12.join(project, name)) === "legacy"
16483
16523
  ),
16484
16524
  symlinks_user: MANAGED_SYMLINKS.filter(
16485
- (name) => _classify_symlink(path11.join(project, name)) === "user"
16525
+ (name) => _classify_symlink(path12.join(project, name)) === "user"
16486
16526
  ),
16487
- state_file: _isFile2(path11.join(project, LEGACY_STATE_FILENAME)),
16488
- settings_files: _detect_legacy_settings(project).map((p) => path11.relative(project, p)),
16527
+ state_file: _isFile2(path12.join(project, LEGACY_STATE_FILENAME)),
16528
+ settings_files: _detect_legacy_settings(project).map((p) => path12.relative(project, p)),
16489
16529
  empty_shell: _detect_empty_shell(project)
16490
16530
  };
16491
16531
  }
@@ -16549,10 +16589,10 @@ function _warn_on_major_mismatch(from_major, plan, out) {
16549
16589
  }
16550
16590
  function _apply(project, out, err) {
16551
16591
  const summary = [];
16552
- if (_strip_npm_entry(path11.join(project, "package.json"))) {
16592
+ if (_strip_npm_entry(path12.join(project, "package.json"))) {
16553
16593
  summary.push(`removed ${PACKAGE_NAME_NPM} from package.json`);
16554
16594
  }
16555
- if (_strip_composer_entry(path11.join(project, "composer.json"))) {
16595
+ if (_strip_composer_entry(path12.join(project, "composer.json"))) {
16556
16596
  summary.push(`removed ${PACKAGE_NAME_COMPOSER} from composer.json`);
16557
16597
  }
16558
16598
  const [removed_links, preserved_links] = _purge_legacy_symlinks(project);
@@ -16673,18 +16713,18 @@ function main(argv = null, options = {}) {
16673
16713
  return _apply(project, out, err);
16674
16714
  }
16675
16715
  var _bundled = true;
16676
- var _HERE = fileURLToPath2(import.meta.url);
16716
+ var _HERE = fileURLToPath3(import.meta.url);
16677
16717
  function _isCliEntry() {
16678
16718
  if (process2.argv[1] === void 0) {
16679
16719
  return false;
16680
16720
  }
16681
- const argvUrl = pathToFileURL(path11.resolve(process2.argv[1])).href;
16721
+ const argvUrl = pathToFileURL(path12.resolve(process2.argv[1])).href;
16682
16722
  if (import.meta.url === argvUrl) {
16683
16723
  return true;
16684
16724
  }
16685
16725
  try {
16686
- const here = fs13.realpathSync(fileURLToPath2(import.meta.url));
16687
- const argv = fs13.realpathSync(path11.resolve(process2.argv[1]));
16726
+ const here = fs14.realpathSync(fileURLToPath3(import.meta.url));
16727
+ const argv = fs14.realpathSync(path12.resolve(process2.argv[1]));
16688
16728
  return here === argv;
16689
16729
  } catch {
16690
16730
  return false;
@@ -16703,7 +16743,7 @@ if (!_bundled && (_isCliEntry() || process2.argv[1] === _HERE)) {
16703
16743
  }
16704
16744
 
16705
16745
  // src/scripts/install.ts
16706
- var _HERE2 = fileURLToPath3(import.meta.url);
16746
+ var _HERE2 = fileURLToPath4(import.meta.url);
16707
16747
  var SystemExitError = class extends Error {
16708
16748
  constructor(code) {
16709
16749
  super(`system-exit-${code}`);
@@ -16721,34 +16761,34 @@ var ArgparseExit2 = class extends Error {
16721
16761
  function expanduser6(p) {
16722
16762
  if (p === "~") return os7.homedir();
16723
16763
  if (p.startsWith("~/") || p.startsWith("~\\")) {
16724
- return path12.join(os7.homedir(), p.slice(2));
16764
+ return path13.join(os7.homedir(), p.slice(2));
16725
16765
  }
16726
16766
  return p;
16727
16767
  }
16728
16768
  function resolvePath(p) {
16729
16769
  try {
16730
- return fs14.realpathSync(path12.resolve(p));
16770
+ return fs15.realpathSync(path13.resolve(p));
16731
16771
  } catch {
16732
- return path12.resolve(p);
16772
+ return path13.resolve(p);
16733
16773
  }
16734
16774
  }
16735
16775
  function isFile(p) {
16736
16776
  try {
16737
- return fs14.statSync(p).isFile();
16777
+ return fs15.statSync(p).isFile();
16738
16778
  } catch {
16739
16779
  return false;
16740
16780
  }
16741
16781
  }
16742
16782
  function isDir(p) {
16743
16783
  try {
16744
- return fs14.statSync(p).isDirectory();
16784
+ return fs15.statSync(p).isDirectory();
16745
16785
  } catch {
16746
16786
  return false;
16747
16787
  }
16748
16788
  }
16749
16789
  function pathExists(p) {
16750
16790
  try {
16751
- fs14.statSync(p);
16791
+ fs15.statSync(p);
16752
16792
  return true;
16753
16793
  } catch {
16754
16794
  return false;
@@ -16756,24 +16796,24 @@ function pathExists(p) {
16756
16796
  }
16757
16797
  function isSymlink(p) {
16758
16798
  try {
16759
- return fs14.lstatSync(p).isSymbolicLink();
16799
+ return fs15.lstatSync(p).isSymbolicLink();
16760
16800
  } catch {
16761
16801
  return false;
16762
16802
  }
16763
16803
  }
16764
16804
  function readText(p) {
16765
- return fs14.readFileSync(p, "utf-8");
16805
+ return fs15.readFileSync(p, "utf-8");
16766
16806
  }
16767
16807
  function writeText(p, content) {
16768
- fs14.writeFileSync(p, content, "utf-8");
16808
+ fs15.writeFileSync(p, content, "utf-8");
16769
16809
  }
16770
16810
  function mkdirp(p) {
16771
- fs14.mkdirSync(p, { recursive: true });
16811
+ fs15.mkdirSync(p, { recursive: true });
16772
16812
  }
16773
16813
  function sortedGlobStems(directory, suffix) {
16774
16814
  let entries;
16775
16815
  try {
16776
- entries = fs14.readdirSync(directory);
16816
+ entries = fs15.readdirSync(directory);
16777
16817
  } catch {
16778
16818
  return [];
16779
16819
  }
@@ -16793,7 +16833,7 @@ function sortedGlobStems(directory, suffix) {
16793
16833
  function countZips(directory) {
16794
16834
  if (!isDir(directory)) return 0;
16795
16835
  let n = 0;
16796
- for (const name of fs14.readdirSync(directory)) {
16836
+ for (const name of fs15.readdirSync(directory)) {
16797
16837
  if (name.endsWith(".zip")) n += 1;
16798
16838
  }
16799
16839
  return n;
@@ -16801,35 +16841,35 @@ function countZips(directory) {
16801
16841
  function sha256OfFile(p) {
16802
16842
  let data;
16803
16843
  try {
16804
- data = fs14.readFileSync(p);
16844
+ data = fs15.readFileSync(p);
16805
16845
  } catch {
16806
16846
  return null;
16807
16847
  }
16808
16848
  return crypto3.createHash("sha256").update(data).digest("hex");
16809
16849
  }
16810
16850
  function atomicWrite0644(target, body, prefix) {
16811
- const dir = path12.dirname(target);
16812
- const tmpName = path12.join(
16851
+ const dir = path13.dirname(target);
16852
+ const tmpName = path13.join(
16813
16853
  dir,
16814
16854
  `${prefix}${process3.pid}.${crypto3.randomBytes(6).toString("hex")}.yml.tmp`
16815
16855
  );
16816
16856
  let fd = null;
16817
16857
  try {
16818
- fd = fs14.openSync(tmpName, "wx", 420);
16819
- fs14.writeFileSync(fd, body, "utf-8");
16820
- fs14.closeSync(fd);
16858
+ fd = fs15.openSync(tmpName, "wx", 420);
16859
+ fs15.writeFileSync(fd, body, "utf-8");
16860
+ fs15.closeSync(fd);
16821
16861
  fd = null;
16822
- fs14.chmodSync(tmpName, 420);
16823
- fs14.renameSync(tmpName, target);
16862
+ fs15.chmodSync(tmpName, 420);
16863
+ fs15.renameSync(tmpName, target);
16824
16864
  } catch (err) {
16825
16865
  if (fd !== null) {
16826
16866
  try {
16827
- fs14.closeSync(fd);
16867
+ fs15.closeSync(fd);
16828
16868
  } catch {
16829
16869
  }
16830
16870
  }
16831
16871
  try {
16832
- fs14.unlinkSync(tmpName);
16872
+ fs15.unlinkSync(tmpName);
16833
16873
  } catch {
16834
16874
  }
16835
16875
  throw err;
@@ -16953,12 +16993,12 @@ var LEGACY_SETTINGS_FILE = ".agent-settings";
16953
16993
  var LEGACY_BACKUP_FILE = ".agent-settings.backup.key-value";
16954
16994
  var SETTINGS_SUBDIR = ["agents", "settings"];
16955
16995
  function _canonical_settings_target(project_root) {
16956
- return path12.join(project_root, ...SETTINGS_SUBDIR, SETTINGS_FILE);
16996
+ return path13.join(project_root, ...SETTINGS_SUBDIR, SETTINGS_FILE);
16957
16997
  }
16958
16998
  function _resolve_settings_read(project_root) {
16959
16999
  const canonical = _canonical_settings_target(project_root);
16960
17000
  if (pathExists(canonical)) return canonical;
16961
- const legacy = path12.join(project_root, SETTINGS_FILE);
17001
+ const legacy = path13.join(project_root, SETTINGS_FILE);
16962
17002
  if (pathExists(legacy)) return legacy;
16963
17003
  return canonical;
16964
17004
  }
@@ -17022,9 +17062,9 @@ function fail(msg) {
17022
17062
  throw new SystemExitError(1);
17023
17063
  }
17024
17064
  function detect_package_root(project_root) {
17025
- const npm_path = path12.join(project_root, "node_modules", "@event4u", "agent-config");
17065
+ const npm_path = path13.join(project_root, "node_modules", "@event4u", "agent-config");
17026
17066
  if (isDir(npm_path)) return resolvePath(npm_path);
17027
- if (pathExists(path12.join(project_root, "src", "config", "profiles", "minimal.ini"))) {
17067
+ if (pathExists(path13.join(project_root, "src", "config", "profiles", "minimal.ini"))) {
17028
17068
  return project_root;
17029
17069
  }
17030
17070
  fail(
@@ -17032,12 +17072,12 @@ function detect_package_root(project_root) {
17032
17072
  );
17033
17073
  }
17034
17074
  function detect_package_type(package_root) {
17035
- if (package_root.split(path12.sep).includes("node_modules")) return "npm";
17075
+ if (package_root.split(path13.sep).includes("node_modules")) return "npm";
17036
17076
  return "local";
17037
17077
  }
17038
17078
  function detect_package_type_for_project(project_root, package_root) {
17039
17079
  const npm_path = resolvePath(
17040
- path12.join(project_root, "node_modules", "@event4u", "agent-config")
17080
+ path13.join(project_root, "node_modules", "@event4u", "agent-config")
17041
17081
  );
17042
17082
  const package_resolved = resolvePath(package_root);
17043
17083
  if (package_resolved === npm_path) return "npm";
@@ -17057,7 +17097,7 @@ function ensure_directory(p) {
17057
17097
  mkdirp(p);
17058
17098
  }
17059
17099
  function write_file(p, content) {
17060
- ensure_directory(path12.dirname(p));
17100
+ ensure_directory(path13.dirname(p));
17061
17101
  writeText(p, content);
17062
17102
  }
17063
17103
  function read_json_file(p) {
@@ -17228,7 +17268,7 @@ function _append_unknown_legacy(rendered, legacy_values, unknown_keys) {
17228
17268
  return rendered + "\n" + suffix;
17229
17269
  }
17230
17270
  function _migrate_legacy_if_present(project_root, template_body) {
17231
- const legacy_target = path12.join(project_root, LEGACY_SETTINGS_FILE);
17271
+ const legacy_target = path13.join(project_root, LEGACY_SETTINGS_FILE);
17232
17272
  if (!isFile(legacy_target)) return null;
17233
17273
  const legacy_text = readText(legacy_target);
17234
17274
  const [values, unknown] = _parse_legacy_settings(legacy_text);
@@ -17243,9 +17283,9 @@ function _migrate_legacy_if_present(project_root, template_body) {
17243
17283
  }
17244
17284
  }
17245
17285
  rendered = _append_unknown_legacy(rendered, values, unknown);
17246
- const backup_target = path12.join(project_root, LEGACY_BACKUP_FILE);
17286
+ const backup_target = path13.join(project_root, LEGACY_BACKUP_FILE);
17247
17287
  writeText(backup_target, legacy_text);
17248
- fs14.unlinkSync(legacy_target);
17288
+ fs15.unlinkSync(legacy_target);
17249
17289
  info(`Migrated legacy ${LEGACY_SETTINGS_FILE} \u2192 ${SETTINGS_FILE}`);
17250
17290
  info(`Backup saved to ${LEGACY_BACKUP_FILE}`);
17251
17291
  if (unknown.length > 0) {
@@ -17280,7 +17320,7 @@ function _render_template(template, profile_values) {
17280
17320
  return body;
17281
17321
  }
17282
17322
  function _load_valid_user_types(package_root) {
17283
- const directory = path12.join(package_root, USER_TYPES_DIR);
17323
+ const directory = path13.join(package_root, USER_TYPES_DIR);
17284
17324
  if (!isDir(directory)) return [];
17285
17325
  return sortedGlobStems(directory, ".yml");
17286
17326
  }
@@ -17337,8 +17377,8 @@ function splitlinesKeepends(text) {
17337
17377
  }
17338
17378
  function ensure_agent_settings(project_root, package_root, profile, force, user_type = "", packs = null) {
17339
17379
  const target = _canonical_settings_target(project_root);
17340
- const profile_source = path12.join(package_root, "src", "config", "profiles", `${profile}.ini`);
17341
- const template_source = path12.join(package_root, "src", "config", "agent-settings.template.yml");
17380
+ const profile_source = path13.join(package_root, "src", "config", "profiles", `${profile}.ini`);
17381
+ const template_source = path13.join(package_root, "src", "config", "agent-settings.template.yml");
17342
17382
  if (!pathExists(profile_source)) fail(`Missing profile preset: ${profile_source}`);
17343
17383
  if (!pathExists(template_source)) fail(`Missing settings template: ${template_source}`);
17344
17384
  const template = readText(template_source);
@@ -17352,21 +17392,21 @@ function ensure_agent_settings(project_root, package_root, profile, force, user_
17352
17392
  if (profile_values["rule_loading_tier"] !== profile) {
17353
17393
  const got = "rule_loading_tier" in profile_values ? `'${profile_values["rule_loading_tier"]}'` : "None";
17354
17394
  fail(
17355
- `Profile preset ${path12.basename(profile_source)} has rule_loading_tier=${got} but --profile=${profile}`
17395
+ `Profile preset ${path13.basename(profile_source)} has rule_loading_tier=${got} but --profile=${profile}`
17356
17396
  );
17357
17397
  }
17358
17398
  profile_values["user_type"] = _validate_user_type(package_root, user_type);
17359
17399
  let template_body = _render_template(template, profile_values);
17360
17400
  template_body = _inject_packs(template_body, packs ?? []);
17361
- const legacy_root = path12.join(project_root, SETTINGS_FILE);
17401
+ const legacy_root = path13.join(project_root, SETTINGS_FILE);
17362
17402
  if (isFile(legacy_root) && !pathExists(target)) {
17363
- mkdirp(path12.dirname(target));
17403
+ mkdirp(path13.dirname(target));
17364
17404
  writeText(target, readText(legacy_root));
17365
- fs14.unlinkSync(legacy_root);
17405
+ fs15.unlinkSync(legacy_root);
17366
17406
  success(`Migrated ${SETTINGS_FILE} \u2192 agents/settings/${SETTINGS_FILE} (ADR-038)`);
17367
17407
  return;
17368
17408
  }
17369
- const legacy_target = path12.join(project_root, LEGACY_SETTINGS_FILE);
17409
+ const legacy_target = path13.join(project_root, LEGACY_SETTINGS_FILE);
17370
17410
  if (isFile(legacy_target) && pathExists(target)) {
17371
17411
  warn(
17372
17412
  `Both ${SETTINGS_FILE} and legacy ${LEGACY_SETTINGS_FILE} exist. Skipping migration to avoid overwriting ${SETTINGS_FILE}. Delete one of them manually and re-run.`
@@ -17383,7 +17423,7 @@ function ensure_agent_settings(project_root, package_root, profile, force, user_
17383
17423
  skip(`${SETTINGS_FILE} already exists`);
17384
17424
  return;
17385
17425
  }
17386
- mkdirp(path12.dirname(target));
17426
+ mkdirp(path13.dirname(target));
17387
17427
  write_file(target, template_body);
17388
17428
  const user_type_value = profile_values["user_type"] ?? "";
17389
17429
  const suffix = user_type_value ? `, user_type=${user_type_value}` : "";
@@ -17396,7 +17436,7 @@ function ensure_vscode_bridge(project_root, package_type, force) {
17396
17436
  const plugin_path = plugin_paths[package_type] ?? "./plugin/agent-config";
17397
17437
  const bridge = { "chat.pluginLocations": { [plugin_path]: true } };
17398
17438
  merge_json_file(
17399
- path12.join(project_root, ".vscode", "settings.json"),
17439
+ path13.join(project_root, ".vscode", "settings.json"),
17400
17440
  bridge,
17401
17441
  force,
17402
17442
  ".vscode/settings.json"
@@ -17405,14 +17445,14 @@ function ensure_vscode_bridge(project_root, package_type, force) {
17405
17445
  function ensure_augment_bridge(project_root, force) {
17406
17446
  const bridge = { enabledPlugins: { "agent-config@event4u": true } };
17407
17447
  return merge_json_file(
17408
- path12.join(project_root, ".augment", "settings.json"),
17448
+ path13.join(project_root, ".augment", "settings.json"),
17409
17449
  bridge,
17410
17450
  force,
17411
17451
  ".augment/settings.json"
17412
17452
  );
17413
17453
  }
17414
- var AUGMENT_USER_DIR = path12.join(os7.homedir(), ".augment");
17415
- var AUGMENT_USER_HOOKS_DIR = path12.join(AUGMENT_USER_DIR, "hooks");
17454
+ var AUGMENT_USER_DIR = path13.join(os7.homedir(), ".augment");
17455
+ var AUGMENT_USER_HOOKS_DIR = path13.join(AUGMENT_USER_DIR, "hooks");
17416
17456
  var AUGMENT_DISPATCHER_TRAMPOLINE = "augment-dispatcher.sh";
17417
17457
  var AUGMENT_LEGACY_TRAMPOLINES = [
17418
17458
  "augment-chat-history.sh",
@@ -17428,29 +17468,29 @@ var AUGMENT_DISPATCHER_BINDINGS = [
17428
17468
  ["post_tool_use", "PostToolUse"]
17429
17469
  ];
17430
17470
  function _deploy_augment_trampoline(package_root, name, force) {
17431
- const src = path12.join(package_root, "scripts", "hooks", name);
17471
+ const src = path13.join(package_root, "scripts", "hooks", name);
17432
17472
  if (!pathExists(src)) {
17433
17473
  skip(`augment trampoline missing in package: ${src}`);
17434
17474
  return null;
17435
17475
  }
17436
17476
  mkdirp(AUGMENT_USER_HOOKS_DIR);
17437
- const dst = path12.join(AUGMENT_USER_HOOKS_DIR, name);
17477
+ const dst = path13.join(AUGMENT_USER_HOOKS_DIR, name);
17438
17478
  const src_text = readText(src);
17439
17479
  if (pathExists(dst) && readText(dst) === src_text && !force) {
17440
17480
  skip(`~/.augment/hooks/${name} already up to date`);
17441
17481
  } else {
17442
17482
  writeText(dst, src_text);
17443
- fs14.chmodSync(dst, 493);
17483
+ fs15.chmodSync(dst, 493);
17444
17484
  success(`~/.augment/hooks/${name} installed`);
17445
17485
  }
17446
17486
  return dst;
17447
17487
  }
17448
17488
  function _remove_legacy_augment_trampolines() {
17449
17489
  for (const name of AUGMENT_LEGACY_TRAMPOLINES) {
17450
- const legacy = path12.join(AUGMENT_USER_HOOKS_DIR, name);
17490
+ const legacy = path13.join(AUGMENT_USER_HOOKS_DIR, name);
17451
17491
  try {
17452
17492
  if (isFile(legacy)) {
17453
- fs14.unlinkSync(legacy);
17493
+ fs15.unlinkSync(legacy);
17454
17494
  skip(`removed legacy ~/.augment/hooks/${name}`);
17455
17495
  }
17456
17496
  } catch {
@@ -17469,7 +17509,7 @@ function ensure_augment_user_hooks(package_root, force) {
17469
17509
  }
17470
17510
  const settings_patch = { hooks: per_event };
17471
17511
  return merge_json_file(
17472
- path12.join(AUGMENT_USER_DIR, "settings.json"),
17512
+ path13.join(AUGMENT_USER_DIR, "settings.json"),
17473
17513
  settings_patch,
17474
17514
  force,
17475
17515
  "~/.augment/settings.json"
@@ -17494,7 +17534,7 @@ function _heal_legacy_claude_plugin_ids(p) {
17494
17534
  return removed;
17495
17535
  }
17496
17536
  function ensure_claude_bridge(project_root, force) {
17497
- const target = path12.join(project_root, ".claude", "settings.json");
17537
+ const target = path13.join(project_root, ".claude", "settings.json");
17498
17538
  const healed = _heal_legacy_claude_plugin_ids(target);
17499
17539
  for (const pid of healed) {
17500
17540
  success(`.claude/settings.json: removed stale plugin id \`${pid}\``);
@@ -17519,29 +17559,29 @@ function ensure_cursor_bridge(project_root, force) {
17519
17559
  }
17520
17560
  const bridge = { version: 1, hooks };
17521
17561
  return merge_json_file(
17522
- path12.join(project_root, ".cursor", "hooks.json"),
17562
+ path13.join(project_root, ".cursor", "hooks.json"),
17523
17563
  bridge,
17524
17564
  force,
17525
17565
  ".cursor/hooks.json"
17526
17566
  );
17527
17567
  }
17528
- var CURSOR_USER_DIR = path12.join(os7.homedir(), ".cursor");
17529
- var CURSOR_USER_HOOKS_DIR = path12.join(CURSOR_USER_DIR, "hooks");
17568
+ var CURSOR_USER_DIR = path13.join(os7.homedir(), ".cursor");
17569
+ var CURSOR_USER_HOOKS_DIR = path13.join(CURSOR_USER_DIR, "hooks");
17530
17570
  var CURSOR_DISPATCHER_TRAMPOLINE = "cursor-dispatcher.sh";
17531
17571
  function ensure_cursor_user_hooks(package_root, force) {
17532
- const src = path12.join(package_root, "scripts", "hooks", CURSOR_DISPATCHER_TRAMPOLINE);
17572
+ const src = path13.join(package_root, "scripts", "hooks", CURSOR_DISPATCHER_TRAMPOLINE);
17533
17573
  if (!pathExists(src)) {
17534
17574
  skip(`cursor trampoline missing in package: ${src}`);
17535
17575
  return [];
17536
17576
  }
17537
17577
  mkdirp(CURSOR_USER_HOOKS_DIR);
17538
- const dst = path12.join(CURSOR_USER_HOOKS_DIR, CURSOR_DISPATCHER_TRAMPOLINE);
17578
+ const dst = path13.join(CURSOR_USER_HOOKS_DIR, CURSOR_DISPATCHER_TRAMPOLINE);
17539
17579
  const src_text = readText(src);
17540
17580
  if (pathExists(dst) && readText(dst) === src_text && !force) {
17541
17581
  skip(`~/.cursor/hooks/${CURSOR_DISPATCHER_TRAMPOLINE} already up to date`);
17542
17582
  } else {
17543
17583
  writeText(dst, src_text);
17544
- fs14.chmodSync(dst, 493);
17584
+ fs15.chmodSync(dst, 493);
17545
17585
  success(`~/.cursor/hooks/${CURSOR_DISPATCHER_TRAMPOLINE} installed`);
17546
17586
  }
17547
17587
  const hooks = {};
@@ -17550,7 +17590,7 @@ function ensure_cursor_user_hooks(package_root, force) {
17550
17590
  }
17551
17591
  const settings_patch = { version: 1, hooks };
17552
17592
  return merge_json_file(
17553
- path12.join(CURSOR_USER_DIR, "hooks.json"),
17593
+ path13.join(CURSOR_USER_DIR, "hooks.json"),
17554
17594
  settings_patch,
17555
17595
  force,
17556
17596
  "~/.cursor/hooks.json"
@@ -17593,12 +17633,12 @@ exit 0
17593
17633
  `;
17594
17634
  }
17595
17635
  function ensure_cline_bridge(project_root, force) {
17596
- const hooks_dir = path12.join(project_root, ".clinerules", "hooks");
17636
+ const hooks_dir = path13.join(project_root, ".clinerules", "hooks");
17597
17637
  mkdirp(hooks_dir);
17598
17638
  const workspace_quoted = shlexQuote(resolvePath(project_root));
17599
17639
  let written = 0;
17600
17640
  for (const [ac_event, native_event] of CLINE_DISPATCHER_BINDINGS) {
17601
- const target = path12.join(hooks_dir, native_event);
17641
+ const target = path13.join(hooks_dir, native_event);
17602
17642
  const body = clineProjectHookBody(native_event, ac_event, workspace_quoted);
17603
17643
  if (pathExists(target) && readText(target) === body && !force) {
17604
17644
  continue;
@@ -17608,7 +17648,7 @@ function ensure_cline_bridge(project_root, force) {
17608
17648
  continue;
17609
17649
  }
17610
17650
  writeText(target, body);
17611
- fs14.chmodSync(target, 493);
17651
+ fs15.chmodSync(target, 493);
17612
17652
  written += 1;
17613
17653
  }
17614
17654
  if (written) {
@@ -17617,27 +17657,27 @@ function ensure_cline_bridge(project_root, force) {
17617
17657
  skip(".clinerules/hooks/ already up to date");
17618
17658
  }
17619
17659
  }
17620
- var CLINE_USER_DIR = path12.join(os7.homedir(), "Documents", "Cline", "Hooks");
17660
+ var CLINE_USER_DIR = path13.join(os7.homedir(), "Documents", "Cline", "Hooks");
17621
17661
  var CLINE_DISPATCHER_TRAMPOLINE = "cline-dispatcher.sh";
17622
17662
  function ensure_cline_user_hooks(package_root, force) {
17623
- const src = path12.join(package_root, "scripts", "hooks", CLINE_DISPATCHER_TRAMPOLINE);
17663
+ const src = path13.join(package_root, "scripts", "hooks", CLINE_DISPATCHER_TRAMPOLINE);
17624
17664
  if (!pathExists(src)) {
17625
17665
  skip(`cline trampoline missing in package: ${src}`);
17626
17666
  return;
17627
17667
  }
17628
17668
  mkdirp(CLINE_USER_DIR);
17629
- const trampoline = path12.join(CLINE_USER_DIR, CLINE_DISPATCHER_TRAMPOLINE);
17669
+ const trampoline = path13.join(CLINE_USER_DIR, CLINE_DISPATCHER_TRAMPOLINE);
17630
17670
  const src_text = readText(src);
17631
17671
  if (pathExists(trampoline) && readText(trampoline) === src_text && !force) {
17632
17672
  skip(`~/Documents/Cline/Hooks/${CLINE_DISPATCHER_TRAMPOLINE} already up to date`);
17633
17673
  } else {
17634
17674
  writeText(trampoline, src_text);
17635
- fs14.chmodSync(trampoline, 493);
17675
+ fs15.chmodSync(trampoline, 493);
17636
17676
  success(`~/Documents/Cline/Hooks/${CLINE_DISPATCHER_TRAMPOLINE} installed`);
17637
17677
  }
17638
17678
  const trampoline_quoted = shlexQuote(trampoline);
17639
17679
  for (const [ac_event, native_event] of CLINE_DISPATCHER_BINDINGS) {
17640
- const wrapper = path12.join(CLINE_USER_DIR, native_event);
17680
+ const wrapper = path13.join(CLINE_USER_DIR, native_event);
17641
17681
  const body = `#!/usr/bin/env bash
17642
17682
  # Generated by event4u/agent-config install.py \u2014 DO NOT EDIT.
17643
17683
  # User-scope Cline hook for ${native_event} \u2192 agent-config ${ac_event}.
@@ -17647,7 +17687,7 @@ exec ${trampoline_quoted} ${ac_event} ${native_event}
17647
17687
  continue;
17648
17688
  }
17649
17689
  writeText(wrapper, body);
17650
- fs14.chmodSync(wrapper, 493);
17690
+ fs15.chmodSync(wrapper, 493);
17651
17691
  }
17652
17692
  }
17653
17693
  var WINDSURF_DISPATCHER_BINDINGS = [
@@ -17668,29 +17708,29 @@ function ensure_windsurf_bridge(project_root, force) {
17668
17708
  }
17669
17709
  const bridge = { hooks };
17670
17710
  return merge_json_file(
17671
- path12.join(project_root, ".windsurf", "hooks.json"),
17711
+ path13.join(project_root, ".windsurf", "hooks.json"),
17672
17712
  bridge,
17673
17713
  force,
17674
17714
  ".windsurf/hooks.json"
17675
17715
  );
17676
17716
  }
17677
- var WINDSURF_USER_DIR = path12.join(os7.homedir(), ".codeium", "windsurf");
17678
- var WINDSURF_USER_HOOKS_DIR = path12.join(WINDSURF_USER_DIR, "hooks");
17717
+ var WINDSURF_USER_DIR = path13.join(os7.homedir(), ".codeium", "windsurf");
17718
+ var WINDSURF_USER_HOOKS_DIR = path13.join(WINDSURF_USER_DIR, "hooks");
17679
17719
  var WINDSURF_DISPATCHER_TRAMPOLINE = "windsurf-dispatcher.sh";
17680
17720
  function ensure_windsurf_user_hooks(package_root, force) {
17681
- const src = path12.join(package_root, "scripts", "hooks", WINDSURF_DISPATCHER_TRAMPOLINE);
17721
+ const src = path13.join(package_root, "scripts", "hooks", WINDSURF_DISPATCHER_TRAMPOLINE);
17682
17722
  if (!pathExists(src)) {
17683
17723
  skip(`windsurf trampoline missing in package: ${src}`);
17684
17724
  return [];
17685
17725
  }
17686
17726
  mkdirp(WINDSURF_USER_HOOKS_DIR);
17687
- const dst = path12.join(WINDSURF_USER_HOOKS_DIR, WINDSURF_DISPATCHER_TRAMPOLINE);
17727
+ const dst = path13.join(WINDSURF_USER_HOOKS_DIR, WINDSURF_DISPATCHER_TRAMPOLINE);
17688
17728
  const src_text = readText(src);
17689
17729
  if (pathExists(dst) && readText(dst) === src_text && !force) {
17690
17730
  skip(`~/.codeium/windsurf/hooks/${WINDSURF_DISPATCHER_TRAMPOLINE} already up to date`);
17691
17731
  } else {
17692
17732
  writeText(dst, src_text);
17693
- fs14.chmodSync(dst, 493);
17733
+ fs15.chmodSync(dst, 493);
17694
17734
  success(`~/.codeium/windsurf/hooks/${WINDSURF_DISPATCHER_TRAMPOLINE} installed`);
17695
17735
  }
17696
17736
  const hooks = {};
@@ -17702,7 +17742,7 @@ function ensure_windsurf_user_hooks(package_root, force) {
17702
17742
  }
17703
17743
  const settings_patch = { hooks };
17704
17744
  return merge_json_file(
17705
- path12.join(WINDSURF_USER_DIR, "hooks.json"),
17745
+ path13.join(WINDSURF_USER_DIR, "hooks.json"),
17706
17746
  settings_patch,
17707
17747
  force,
17708
17748
  "~/.codeium/windsurf/hooks.json"
@@ -17731,43 +17771,43 @@ function _gemini_hooks_dict(command_factory) {
17731
17771
  function ensure_gemini_bridge(project_root, force) {
17732
17772
  const bridge = { hooks: _gemini_hooks_dict(_gemini_dispatch_command) };
17733
17773
  return merge_json_file(
17734
- path12.join(project_root, ".gemini", "settings.json"),
17774
+ path13.join(project_root, ".gemini", "settings.json"),
17735
17775
  bridge,
17736
17776
  force,
17737
17777
  ".gemini/settings.json"
17738
17778
  );
17739
17779
  }
17740
- var GEMINI_USER_DIR = path12.join(os7.homedir(), ".gemini");
17741
- var GEMINI_USER_HOOKS_DIR = path12.join(GEMINI_USER_DIR, "hooks");
17780
+ var GEMINI_USER_DIR = path13.join(os7.homedir(), ".gemini");
17781
+ var GEMINI_USER_HOOKS_DIR = path13.join(GEMINI_USER_DIR, "hooks");
17742
17782
  var GEMINI_DISPATCHER_TRAMPOLINE = "gemini-dispatcher.sh";
17743
17783
  function ensure_gemini_user_hooks(package_root, force) {
17744
- const src = path12.join(package_root, "scripts", "hooks", GEMINI_DISPATCHER_TRAMPOLINE);
17784
+ const src = path13.join(package_root, "scripts", "hooks", GEMINI_DISPATCHER_TRAMPOLINE);
17745
17785
  if (!pathExists(src)) {
17746
17786
  skip(`gemini trampoline missing in package: ${src}`);
17747
17787
  return [];
17748
17788
  }
17749
17789
  mkdirp(GEMINI_USER_HOOKS_DIR);
17750
- const dst = path12.join(GEMINI_USER_HOOKS_DIR, GEMINI_DISPATCHER_TRAMPOLINE);
17790
+ const dst = path13.join(GEMINI_USER_HOOKS_DIR, GEMINI_DISPATCHER_TRAMPOLINE);
17751
17791
  const src_text = readText(src);
17752
17792
  if (pathExists(dst) && readText(dst) === src_text && !force) {
17753
17793
  skip(`~/.gemini/hooks/${GEMINI_DISPATCHER_TRAMPOLINE} already up to date`);
17754
17794
  } else {
17755
17795
  writeText(dst, src_text);
17756
- fs14.chmodSync(dst, 493);
17796
+ fs15.chmodSync(dst, 493);
17757
17797
  success(`~/.gemini/hooks/${GEMINI_DISPATCHER_TRAMPOLINE} installed`);
17758
17798
  }
17759
17799
  const settings_patch = {
17760
17800
  hooks: _gemini_hooks_dict((ac_event, native) => `${dst} ${ac_event} ${native}`)
17761
17801
  };
17762
17802
  return merge_json_file(
17763
- path12.join(GEMINI_USER_DIR, "settings.json"),
17803
+ path13.join(GEMINI_USER_DIR, "settings.json"),
17764
17804
  settings_patch,
17765
17805
  force,
17766
17806
  "~/.gemini/settings.json"
17767
17807
  );
17768
17808
  }
17769
17809
  function ensure_copilot_bridge(project_root, force) {
17770
- const target = path12.join(project_root, ".github", "plugin", "marketplace.json");
17810
+ const target = path13.join(project_root, ".github", "plugin", "marketplace.json");
17771
17811
  const bridge = {
17772
17812
  marketplace: {
17773
17813
  name: "event4u-agent-marketplace",
@@ -17810,7 +17850,7 @@ See \`docs/setup/per-ide/roocode.md\` for the full activation guide.
17810
17850
  Run \`./agent-config --help\` for available commands.
17811
17851
  `;
17812
17852
  function ensure_roocode_bridge(project_root, force) {
17813
- const target = path12.join(project_root, ".roo", "rules", "agent-config.md");
17853
+ const target = path13.join(project_root, ".roo", "rules", "agent-config.md");
17814
17854
  if (pathExists(target) && !force) {
17815
17855
  skip(".roo/rules/agent-config.md already exists");
17816
17856
  return;
@@ -17832,7 +17872,7 @@ To wire Claude Desktop to this project's rules, run:
17832
17872
  Canonical rule and skill source: \`.augment/\` (see \`AGENTS.md\`).
17833
17873
  `;
17834
17874
  function ensure_claude_desktop_bridge(project_root, force) {
17835
- const target = path12.join(project_root, ".claude-desktop", "agent-config.md");
17875
+ const target = path13.join(project_root, ".claude-desktop", "agent-config.md");
17836
17876
  if (pathExists(target) && !force) {
17837
17877
  skip(".claude-desktop/agent-config.md already exists");
17838
17878
  return;
@@ -17857,7 +17897,7 @@ Or pass \`--read .aider/agent-config.md\` on the command line.
17857
17897
  Canonical rule and skill source: \`.augment/\` (see \`AGENTS.md\`).
17858
17898
  `;
17859
17899
  function ensure_aider_bridge(project_root, force) {
17860
- const target = path12.join(project_root, ".aider", "agent-config.md");
17900
+ const target = path13.join(project_root, ".aider", "agent-config.md");
17861
17901
  if (pathExists(target) && !force) {
17862
17902
  skip(".aider/agent-config.md already exists");
17863
17903
  return;
@@ -17876,7 +17916,7 @@ developers where the rules and skills live.
17876
17916
  Canonical rule and skill source: \`.augment/\` (see project \`AGENTS.md\`).
17877
17917
  `;
17878
17918
  function ensure_codex_bridge(project_root, force) {
17879
- const target = path12.join(project_root, ".codex", "agent-config.md");
17919
+ const target = path13.join(project_root, ".codex", "agent-config.md");
17880
17920
  if (pathExists(target) && !force) {
17881
17921
  skip(".codex/agent-config.md already exists");
17882
17922
  return;
@@ -17894,7 +17934,7 @@ rules per session. The canonical rule and skill source lives under
17894
17934
  orientation).
17895
17935
  `;
17896
17936
  function ensure_continue_bridge(project_root, force) {
17897
- const target = path12.join(project_root, ".continue", "rules", "agent-config.md");
17937
+ const target = path13.join(project_root, ".continue", "rules", "agent-config.md");
17898
17938
  if (pathExists(target) && !force) {
17899
17939
  skip(".continue/rules/agent-config.md already exists");
17900
17940
  return;
@@ -17925,7 +17965,7 @@ orientation).
17925
17965
  See \`docs/setup/per-ide/kilocode.md\` for the full activation guide.
17926
17966
  `;
17927
17967
  function ensure_kilocode_bridge(project_root, force) {
17928
- const target = path12.join(project_root, ".kilocode", "rules", "agent-config.md");
17968
+ const target = path13.join(project_root, ".kilocode", "rules", "agent-config.md");
17929
17969
  if (pathExists(target) && !force) {
17930
17970
  skip(".kilocode/rules/agent-config.md already exists");
17931
17971
  return;
@@ -17952,7 +17992,7 @@ canonical source (or symlink it):
17952
17992
  Canonical rule and skill source: \`.augment/\` (see \`AGENTS.md\`).
17953
17993
  `;
17954
17994
  function ensure_zed_bridge(project_root, force) {
17955
- const target = path12.join(project_root, ".zed", "agent-config.md");
17995
+ const target = path13.join(project_root, ".zed", "agent-config.md");
17956
17996
  if (pathExists(target) && !force) {
17957
17997
  skip(".zed/agent-config.md already exists");
17958
17998
  return;
@@ -17973,7 +18013,7 @@ rules into your JetBrains profile.
17973
18013
  Canonical rule and skill source: \`.augment/\` (see \`AGENTS.md\`).
17974
18014
  `;
17975
18015
  function ensure_jetbrains_bridge(project_root, force) {
17976
- const target = path12.join(project_root, ".jetbrains", "agent-config.md");
18016
+ const target = path13.join(project_root, ".jetbrains", "agent-config.md");
17977
18017
  if (pathExists(target) && !force) {
17978
18018
  skip(".jetbrains/agent-config.md already exists");
17979
18019
  return;
@@ -18004,7 +18044,7 @@ session. The canonical rule and skill source lives under \`.augment/\`
18004
18044
  See \`docs/setup/per-ide/kiro.md\` for the full activation guide.
18005
18045
  `;
18006
18046
  function ensure_kiro_bridge(project_root, force) {
18007
- const target = path12.join(project_root, ".kiro", "steering", "agent-config.md");
18047
+ const target = path13.join(project_root, ".kiro", "steering", "agent-config.md");
18008
18048
  if (pathExists(target) && !force) {
18009
18049
  skip(".kiro/steering/agent-config.md already exists");
18010
18050
  return;
@@ -18030,35 +18070,35 @@ var SMOKE_BRIDGE_PATHS = {
18030
18070
  };
18031
18071
  function dirHasEntries(p) {
18032
18072
  try {
18033
- return fs14.readdirSync(p).length > 0;
18073
+ return fs15.readdirSync(p).length > 0;
18034
18074
  } catch {
18035
18075
  return false;
18036
18076
  }
18037
18077
  }
18038
18078
  function _resolve_tsx_invocation(scriptPath, scriptArgs) {
18039
18079
  const binName = process3.platform === "win32" ? "tsx.cmd" : "tsx";
18040
- let dir = path12.dirname(scriptPath);
18080
+ let dir = path13.dirname(scriptPath);
18041
18081
  for (; ; ) {
18042
- const candidate = path12.join(dir, "node_modules", ".bin", binName);
18082
+ const candidate = path13.join(dir, "node_modules", ".bin", binName);
18043
18083
  if (isFile(candidate)) {
18044
18084
  return { command: candidate, args: [scriptPath, ...scriptArgs] };
18045
18085
  }
18046
- const parent = path12.dirname(dir);
18086
+ const parent = path13.dirname(dir);
18047
18087
  if (parent === dir) break;
18048
18088
  dir = parent;
18049
18089
  }
18050
18090
  return { command: "npx", args: ["tsx", scriptPath, ...scriptArgs] };
18051
18091
  }
18052
18092
  function _smoke_test_hooks(project_root, package_root) {
18053
- const dispatcher = path12.join(package_root, "scripts", "hooks", "dispatch_hook.ts");
18054
- const manifest = path12.join(package_root, "scripts", "hook_manifest.yaml");
18093
+ const dispatcher = path13.join(package_root, "scripts", "hooks", "dispatch_hook.ts");
18094
+ const manifest = path13.join(package_root, "scripts", "hook_manifest.yaml");
18055
18095
  if (!isFile(dispatcher) || !isFile(manifest)) return 0;
18056
18096
  const failed = [];
18057
18097
  const skipped = [];
18058
18098
  const passed = [];
18059
18099
  for (const [platform, native] of SMOKE_PROBE_EVENTS) {
18060
18100
  const rel_bridge = SMOKE_BRIDGE_PATHS[platform] ?? "";
18061
- const bridge_path = rel_bridge ? path12.join(project_root, rel_bridge) : null;
18101
+ const bridge_path = rel_bridge ? path13.join(project_root, rel_bridge) : null;
18062
18102
  const bridge_present = Boolean(
18063
18103
  bridge_path && (isFile(bridge_path) || isDir(bridge_path) && dirHasEntries(bridge_path))
18064
18104
  );
@@ -18258,9 +18298,9 @@ To remove this marker, delete this file.
18258
18298
  `;
18259
18299
  }
18260
18300
  var _CLAUDE_DESKTOP_BUNDLES_SUBPATH = "claude-desktop/bundles";
18261
- var GLOBAL_ROOT = path12.join(os7.homedir(), ".event4u", "agent-config");
18262
- var GLOBAL_USER_SETTINGS_PATH = path12.join(GLOBAL_ROOT, ".agent-user.yml");
18263
- var GLOBAL_AGENT_SETTINGS_PATH = path12.join(GLOBAL_ROOT, ".agent-settings.yml");
18301
+ var GLOBAL_ROOT = path13.join(os7.homedir(), ".event4u", "agent-config");
18302
+ var GLOBAL_USER_SETTINGS_PATH = path13.join(GLOBAL_ROOT, ".agent-user.yml");
18303
+ var GLOBAL_AGENT_SETTINGS_PATH = path13.join(GLOBAL_ROOT, ".agent-settings.yml");
18264
18304
  function _bridge_marker(tool_id, scope) {
18265
18305
  if (scope === "global") return USER_SCOPE_PATHS[tool_id] ?? "";
18266
18306
  return PROJECT_BRIDGE_MARKERS[tool_id] ?? "";
@@ -18309,7 +18349,7 @@ function _load_yaml_doc(p) {
18309
18349
  return _isPlainObject2(data) ? data : {};
18310
18350
  }
18311
18351
  function _load_default_settings(package_root) {
18312
- const template_source = path12.join(package_root, "src", "config", "agent-settings.template.yml");
18352
+ const template_source = path13.join(package_root, "src", "config", "agent-settings.template.yml");
18313
18353
  if (!pathExists(template_source)) return {};
18314
18354
  let text;
18315
18355
  try {
@@ -18397,9 +18437,9 @@ function detect_scope(cwd) {
18397
18437
  if (pathExists(_resolve_settings_read(cwd))) {
18398
18438
  return ["project", `existing ${SETTINGS_FILE}`];
18399
18439
  }
18400
- const has_manifest = SCOPE_DETECT_MANIFESTS.find((m) => pathExists(path12.join(cwd, m))) ?? null;
18401
- const has_ai_dir = SCOPE_DETECT_AI_DIRS.find((d) => isDir(path12.join(cwd, d))) ?? null;
18402
- const has_ai_file = SCOPE_DETECT_AI_FILES.find((f) => pathExists(path12.join(cwd, f))) ?? null;
18440
+ const has_manifest = SCOPE_DETECT_MANIFESTS.find((m) => pathExists(path13.join(cwd, m))) ?? null;
18441
+ const has_ai_dir = SCOPE_DETECT_AI_DIRS.find((d) => isDir(path13.join(cwd, d))) ?? null;
18442
+ const has_ai_file = SCOPE_DETECT_AI_FILES.find((f) => pathExists(path13.join(cwd, f))) ?? null;
18403
18443
  if (has_manifest && (has_ai_dir || has_ai_file)) {
18404
18444
  const marker = has_ai_dir || has_ai_file;
18405
18445
  return ["prompt", `manifest (${has_manifest}) + AI-tool config (${marker})`];
@@ -18420,7 +18460,7 @@ function readLineSyncRaw(promptText) {
18420
18460
  for (; ; ) {
18421
18461
  let n;
18422
18462
  try {
18423
- n = fs14.readSync(0, buf, 0, 1, null);
18463
+ n = fs15.readSync(0, buf, 0, 1, null);
18424
18464
  } catch (err) {
18425
18465
  const code = err.code;
18426
18466
  if (code === "EAGAIN") {
@@ -18495,8 +18535,8 @@ function _files_by_tool_from_bridges(tools, project_root, scope) {
18495
18535
  const marker = _bridge_marker(tool_id, scope);
18496
18536
  if (!marker) continue;
18497
18537
  let marker_path = marker;
18498
- if (!path12.isAbsolute(marker_path)) {
18499
- marker_path = path12.join(project_root, marker_path);
18538
+ if (!path13.isAbsolute(marker_path)) {
18539
+ marker_path = path13.join(project_root, marker_path);
18500
18540
  }
18501
18541
  out[tool_id] = [_file_entry(marker_path, "bridge", false)];
18502
18542
  }
@@ -18535,26 +18575,26 @@ function _update_installed_tools_manifest(project_root, tools, scope, force, fil
18535
18575
  }
18536
18576
  write_manifest(target, version, entries);
18537
18577
  if (!state.QUIET) {
18538
- const rel = isRelativeTo(target, project_root) ? path12.relative(project_root, target) : target;
18578
+ const rel = isRelativeTo(target, project_root) ? path13.relative(project_root, target) : target;
18539
18579
  info(`Manifest updated: ${rel}`);
18540
18580
  }
18541
18581
  return 0;
18542
18582
  }
18543
18583
  function isRelativeTo(child, parent) {
18544
- const rel = path12.relative(parent, child);
18545
- return rel === "" || !rel.startsWith("..") && !path12.isAbsolute(rel);
18584
+ const rel = path13.relative(parent, child);
18585
+ return rel === "" || !rel.startsWith("..") && !path13.isAbsolute(rel);
18546
18586
  }
18547
18587
  function _resolve_package_root_for_global() {
18548
18588
  const here = resolvePath(_HERE2);
18549
- const candidate = path12.dirname(path12.dirname(path12.dirname(here)));
18550
- if (!pathExists(path12.join(candidate, "src", "config", "profiles", "minimal.ini"))) {
18589
+ const candidate = path13.dirname(path13.dirname(path13.dirname(here)));
18590
+ if (!pathExists(path13.join(candidate, "src", "config", "profiles", "minimal.ini"))) {
18551
18591
  fail(
18552
18592
  `Could not locate agent-config package root from ${here}. Expected src/config/profiles/minimal.ini at the parent directory.`
18553
18593
  );
18554
18594
  }
18555
18595
  return candidate;
18556
18596
  }
18557
- var CONSUMER_BRIDGE_MARKER_RELPATH = path12.join("agents", ".event4u-bridge.yml");
18597
+ var CONSUMER_BRIDGE_MARKER_RELPATH = path13.join("agents", ".event4u-bridge.yml");
18558
18598
  var MIGRATE_LEGACY_YAML_FILES = [".agent-settings.yml", ".agent-user.yml"];
18559
18599
  var MIGRATE_LEGACY_TOOL_DIRS = [".augment", ".claude", ".cursor"];
18560
18600
  var AGENT_CONFIG_PACKAGE_NAME = "@event4u/agent-config";
@@ -18562,7 +18602,7 @@ function _is_agent_config_source_repo(project_root) {
18562
18602
  if (process3.env["AGENT_CONFIG_CONSUMER_MODE"] === "1") {
18563
18603
  return [false, "consumer-mode-override"];
18564
18604
  }
18565
- const pkg_json = path12.join(project_root, "package.json");
18605
+ const pkg_json = path13.join(project_root, "package.json");
18566
18606
  if (isFile(pkg_json)) {
18567
18607
  let data = {};
18568
18608
  try {
@@ -18574,18 +18614,18 @@ function _is_agent_config_source_repo(project_root) {
18574
18614
  return [true, "package.json:name"];
18575
18615
  }
18576
18616
  }
18577
- if (isDir(path12.join(project_root, ".agent-src.uncondensed"))) {
18617
+ if (isDir(path13.join(project_root, ".agent-src.uncondensed"))) {
18578
18618
  return [true, ".agent-src.uncondensed/"];
18579
18619
  }
18580
- const packages_dir = path12.join(project_root, "packages");
18620
+ const packages_dir = path13.join(project_root, "packages");
18581
18621
  if (isDir(packages_dir)) {
18582
- for (const child of fs14.readdirSync(packages_dir)) {
18583
- if (isDir(path12.join(packages_dir, child, ".agent-src.uncondensed"))) {
18622
+ for (const child of fs15.readdirSync(packages_dir)) {
18623
+ if (isDir(path13.join(packages_dir, child, ".agent-src.uncondensed"))) {
18584
18624
  return [true, `packages/${child}/.agent-src.uncondensed/`];
18585
18625
  }
18586
18626
  }
18587
18627
  }
18588
- const installer_self = path12.join(project_root, "scripts", "install.py");
18628
+ const installer_self = path13.join(project_root, "scripts", "install.py");
18589
18629
  try {
18590
18630
  if (isFile(installer_self) && resolvePath(installer_self) === resolvePath(_HERE2)) {
18591
18631
  return [true, "src/scripts/install.py (self)"];
@@ -18605,17 +18645,17 @@ function _detect_legacy_for_migration(project_root) {
18605
18645
  }
18606
18646
  return [];
18607
18647
  }
18608
- if (isFile(path12.join(project_root, INSTALL_MODE_MARKER_REL))) return [];
18648
+ if (isFile(path13.join(project_root, INSTALL_MODE_MARKER_REL))) return [];
18609
18649
  const found = [];
18610
18650
  for (const name of MIGRATE_LEGACY_YAML_FILES) {
18611
- if (isFile(path12.join(project_root, name))) {
18651
+ if (isFile(path13.join(project_root, name))) {
18612
18652
  found.push(name);
18613
- } else if (isFile(path12.join(project_root, "settings", name))) {
18653
+ } else if (isFile(path13.join(project_root, "settings", name))) {
18614
18654
  found.push(`settings/${name}`);
18615
18655
  }
18616
18656
  }
18617
18657
  for (const name of MIGRATE_LEGACY_TOOL_DIRS) {
18618
- const p = path12.join(project_root, name);
18658
+ const p = path13.join(project_root, name);
18619
18659
  if (isDir(p) && !isSymlink(p)) {
18620
18660
  found.push(`${name}/`);
18621
18661
  }
@@ -18627,7 +18667,7 @@ function _prompt_migrate_to_global(project_root, artefacts) {
18627
18667
  process3.stdout.write("\n");
18628
18668
  warn("Legacy project-local artefacts detected \u2014 pre-ADR-020 layout:");
18629
18669
  for (const rel of artefacts) {
18630
- info(` ${path12.join(project_root, rel)}`);
18670
+ info(` ${path13.join(project_root, rel)}`);
18631
18671
  }
18632
18672
  info("The unified `agent-config migrate` sweeps these in one pass.");
18633
18673
  info("The wizard recreates fresh config afterwards.");
@@ -18658,20 +18698,20 @@ function _run_migrate_to_global(project_root) {
18658
18698
  function _format_global_root_for_marker(global_root) {
18659
18699
  const home = resolvePath(os7.homedir());
18660
18700
  const resolved = resolvePath(global_root);
18661
- const rel = path12.relative(home, resolved);
18662
- if (rel === "" || rel.startsWith("..") || path12.isAbsolute(rel)) {
18701
+ const rel = path13.relative(home, resolved);
18702
+ if (rel === "" || rel.startsWith("..") || path13.isAbsolute(rel)) {
18663
18703
  return global_root;
18664
18704
  }
18665
- return `~/${rel.split(path12.sep).join("/")}`;
18705
+ return `~/${rel.split(path13.sep).join("/")}`;
18666
18706
  }
18667
18707
  function _remove_legacy_consumer_bridge_marker(project_root, env = null) {
18668
18708
  const env_map = env ?? process3.env;
18669
18709
  if (env_map["AGENT_CONFIG_DEV_MODE"] === "1") return null;
18670
- if (isDir(path12.join(project_root, ".agent-src.uncondensed"))) return null;
18671
- const target = path12.join(project_root, CONSUMER_BRIDGE_MARKER_RELPATH);
18710
+ if (isDir(path13.join(project_root, ".agent-src.uncondensed"))) return null;
18711
+ const target = path13.join(project_root, CONSUMER_BRIDGE_MARKER_RELPATH);
18672
18712
  if (!isFile(target)) return null;
18673
18713
  try {
18674
- fs14.rmSync(target);
18714
+ fs15.rmSync(target);
18675
18715
  } catch {
18676
18716
  return null;
18677
18717
  }
@@ -18685,7 +18725,7 @@ var PROJECT_ANCHOR_TOOLS = {
18685
18725
  function _write_per_tool_project_anchors(project_root, tools, env = null, now = null) {
18686
18726
  const env_map = env ?? process3.env;
18687
18727
  if (env_map["AGENT_CONFIG_DEV_MODE"] === "1") return [];
18688
- if (isDir(path12.join(project_root, ".agent-src.uncondensed"))) return [];
18728
+ if (isDir(path13.join(project_root, ".agent-src.uncondensed"))) return [];
18689
18729
  const global_root_str = _format_global_root_for_marker(
18690
18730
  event4u_root(env_map)
18691
18731
  );
@@ -18694,8 +18734,8 @@ function _write_per_tool_project_anchors(project_root, tools, env = null, now =
18694
18734
  for (const tool_id of Object.keys(PROJECT_ANCHOR_TOOLS).sort()) {
18695
18735
  const rel_path = PROJECT_ANCHOR_TOOLS[tool_id];
18696
18736
  if (!tools.has(tool_id)) continue;
18697
- const target = path12.join(project_root, rel_path);
18698
- mkdirp(path12.dirname(target));
18737
+ const target = path13.join(project_root, rel_path);
18738
+ mkdirp(path13.dirname(target));
18699
18739
  const body = `# event4u/agent-config \u2014 per-tool project anchor (auto-written).
18700
18740
  # Spec: docs/contracts/consumer-bridge.md \xA7 Per-tool anchor strategy.
18701
18741
  # Tool: ${tool_id}. Resolves the global install directly \u2014 no
@@ -18713,7 +18753,7 @@ installed_at: ${stamp}
18713
18753
  }
18714
18754
  var PACKAGE_TAG_ID = "event4u/agent-config";
18715
18755
  function _inject_package_tag(target, source, package_root) {
18716
- if (path12.extname(target) !== ".md") return;
18756
+ if (path13.extname(target) !== ".md") return;
18717
18757
  let text;
18718
18758
  try {
18719
18759
  text = readText(target);
@@ -18741,8 +18781,8 @@ function _inject_package_tag(target, source, package_root) {
18741
18781
  resolved_src = source;
18742
18782
  }
18743
18783
  if (package_root !== null) {
18744
- const rel = path12.relative(resolvePath(package_root), resolved_src);
18745
- if (rel !== "" && !rel.startsWith("..") && !path12.isAbsolute(rel)) {
18784
+ const rel = path13.relative(resolvePath(package_root), resolved_src);
18785
+ if (rel !== "" && !rel.startsWith("..") && !path13.isAbsolute(rel)) {
18746
18786
  source_value = rel;
18747
18787
  } else {
18748
18788
  source_value = resolved_src;
@@ -18779,10 +18819,10 @@ function _copy_dir_dereferencing_symlinks(src, dest, force, package_root = null)
18779
18819
  const written_paths = [];
18780
18820
  if (!pathExists(src)) return [0, 0, written_paths];
18781
18821
  if (!isDir(src)) {
18782
- mkdirp(path12.dirname(dest));
18822
+ mkdirp(path13.dirname(dest));
18783
18823
  const decision = _resolve_file_conflict(dest, force);
18784
18824
  if (decision === "skip") return [0, 1, written_paths];
18785
- fs14.copyFileSync(src, dest);
18825
+ fs15.copyFileSync(src, dest);
18786
18826
  _inject_package_tag(dest, src, package_root);
18787
18827
  written_paths.push(dest);
18788
18828
  return [1, 0, written_paths];
@@ -18790,11 +18830,11 @@ function _copy_dir_dereferencing_symlinks(src, dest, force, package_root = null)
18790
18830
  mkdirp(dest);
18791
18831
  const walk = (node) => {
18792
18832
  const acc = [];
18793
- const names = fs14.readdirSync(node).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
18833
+ const names = fs15.readdirSync(node).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
18794
18834
  for (const name of names) {
18795
- const entry = path12.join(node, name);
18835
+ const entry = path13.join(node, name);
18796
18836
  acc.push(entry);
18797
- const lst = fs14.lstatSync(entry);
18837
+ const lst = fs15.lstatSync(entry);
18798
18838
  if (lst.isDirectory() && !lst.isSymbolicLink()) {
18799
18839
  acc.push(...walk(entry));
18800
18840
  }
@@ -18802,9 +18842,9 @@ function _copy_dir_dereferencing_symlinks(src, dest, force, package_root = null)
18802
18842
  return acc;
18803
18843
  };
18804
18844
  for (const entry of walk(src)) {
18805
- const rel = path12.relative(src, entry);
18806
- const target = path12.join(dest, rel);
18807
- const lst = fs14.lstatSync(entry);
18845
+ const rel = path13.relative(src, entry);
18846
+ const target = path13.join(dest, rel);
18847
+ const lst = fs15.lstatSync(entry);
18808
18848
  if (lst.isDirectory() && !lst.isSymbolicLink()) {
18809
18849
  mkdirp(target);
18810
18850
  continue;
@@ -18812,8 +18852,8 @@ function _copy_dir_dereferencing_symlinks(src, dest, force, package_root = null)
18812
18852
  let resolvedIsDir = false;
18813
18853
  let resolved = entry;
18814
18854
  try {
18815
- resolved = fs14.realpathSync(entry);
18816
- resolvedIsDir = fs14.statSync(entry).isDirectory();
18855
+ resolved = fs15.realpathSync(entry);
18856
+ resolvedIsDir = fs15.statSync(entry).isDirectory();
18817
18857
  } catch {
18818
18858
  resolvedIsDir = false;
18819
18859
  }
@@ -18835,8 +18875,8 @@ function _copy_dir_dereferencing_symlinks(src, dest, force, package_root = null)
18835
18875
  skipped += 1;
18836
18876
  continue;
18837
18877
  }
18838
- mkdirp(path12.dirname(target));
18839
- fs14.copyFileSync(resolved, target);
18878
+ mkdirp(path13.dirname(target));
18879
+ fs15.copyFileSync(resolved, target);
18840
18880
  _inject_package_tag(target, resolved, package_root);
18841
18881
  written += 1;
18842
18882
  written_paths.push(target);
@@ -18848,7 +18888,7 @@ function _claude_desktop_bundles_dir() {
18848
18888
  }
18849
18889
  function _write_claude_desktop_marker(_force, lockfile_path2, bundles_dir, bundle_count) {
18850
18890
  const anchor = expanduser6(USER_SCOPE_PATHS["claude-desktop"]);
18851
- const target = path12.join(anchor, "agent-config.md");
18891
+ const target = path13.join(anchor, "agent-config.md");
18852
18892
  mkdirp(anchor);
18853
18893
  const body = claudeDesktopMarkerBody(lockfile_path2, anchor, bundles_dir, bundle_count);
18854
18894
  writeText(target, body);
@@ -18872,23 +18912,23 @@ function _apply_claude_flat_command_wrappers(anchor, package_root, current_files
18872
18912
  const wrapped = [];
18873
18913
  const collisions = [];
18874
18914
  const reserved = [];
18875
- const commands_dir = path12.join(anchor, "commands");
18915
+ const commands_dir = path13.join(anchor, "commands");
18876
18916
  let flat_entries = [];
18877
18917
  try {
18878
- flat_entries = fs14.readdirSync(commands_dir).filter((f) => f.endsWith(".md"));
18918
+ flat_entries = fs15.readdirSync(commands_dir).filter((f) => f.endsWith(".md"));
18879
18919
  } catch {
18880
18920
  }
18881
18921
  for (const fname of flat_entries.sort()) {
18882
18922
  const slug = fname.slice(0, -".md".length);
18883
18923
  if (!is_claude_builtin_name(slug)) continue;
18884
- fs14.rmSync(path12.join(commands_dir, fname), { force: true });
18924
+ fs15.rmSync(path13.join(commands_dir, fname), { force: true });
18885
18925
  current_files.delete(`commands/${fname}`);
18886
18926
  reserved.push(slug);
18887
18927
  }
18888
18928
  const eligible = new Set(_CLAUDE_FLAT_WRAPPER_EXTRA);
18889
18929
  try {
18890
18930
  const manifest = JSON.parse(
18891
- fs14.readFileSync(path12.join(package_root, "dist", "discovery", "discovery-manifest.json"), "utf8")
18931
+ fs15.readFileSync(path13.join(package_root, "dist", "discovery", "discovery-manifest.json"), "utf8")
18892
18932
  );
18893
18933
  for (const a of manifest.artefacts ?? []) {
18894
18934
  if (a.category !== "command" || typeof a.slug !== "string") continue;
@@ -18899,22 +18939,22 @@ function _apply_claude_flat_command_wrappers(anchor, package_root, current_files
18899
18939
  }
18900
18940
  for (const slug of [...eligible].sort()) {
18901
18941
  const flat_rel = `commands/${slug}.md`;
18902
- const flat_abs = path12.join(anchor, "commands", `${slug}.md`);
18903
- if (!fs14.existsSync(flat_abs)) continue;
18904
- const skill_dir = path12.join(anchor, "skills", slug);
18905
- if (fs14.existsSync(skill_dir)) {
18942
+ const flat_abs = path13.join(anchor, "commands", `${slug}.md`);
18943
+ if (!fs15.existsSync(flat_abs)) continue;
18944
+ const skill_dir = path13.join(anchor, "skills", slug);
18945
+ if (fs15.existsSync(skill_dir)) {
18906
18946
  collisions.push(slug);
18907
18947
  continue;
18908
18948
  }
18909
- let body = fs14.readFileSync(flat_abs, "utf8");
18949
+ let body = fs15.readFileSync(flat_abs, "utf8");
18910
18950
  if (body.startsWith("---\n") && !/^name:/m.test(body.split("\n---")[0] ?? "")) {
18911
18951
  body = body.replace("---\n", `---
18912
18952
  name: ${slug}
18913
18953
  `);
18914
18954
  }
18915
- fs14.mkdirSync(skill_dir, { recursive: true });
18916
- fs14.writeFileSync(path12.join(skill_dir, "SKILL.md"), body, "utf8");
18917
- fs14.rmSync(flat_abs, { force: true });
18955
+ fs15.mkdirSync(skill_dir, { recursive: true });
18956
+ fs15.writeFileSync(path13.join(skill_dir, "SKILL.md"), body, "utf8");
18957
+ fs15.rmSync(flat_abs, { force: true });
18918
18958
  current_files.delete(flat_rel);
18919
18959
  current_files.add(`skills/${slug}/SKILL.md`);
18920
18960
  wrapped.push(slug);
@@ -18945,8 +18985,8 @@ function _deploy_global_content(tools, force, package_root, lockfile_path2) {
18945
18985
  const written_paths = [];
18946
18986
  let current_files = /* @__PURE__ */ new Set();
18947
18987
  for (const [src_rel, dest_sub] of plan) {
18948
- const src = path12.join(package_root, src_rel);
18949
- const dest = dest_sub ? path12.join(anchor, dest_sub) : anchor;
18988
+ const src = path13.join(package_root, src_rel);
18989
+ const dest = dest_sub ? path13.join(anchor, dest_sub) : anchor;
18950
18990
  const [w, s, paths] = _copy_dir_dereferencing_symlinks(src, dest, force, package_root);
18951
18991
  written_total += w;
18952
18992
  skipped_total += s;
@@ -19009,10 +19049,10 @@ function _deploy_global_content(tools, force, package_root, lockfile_path2) {
19009
19049
  results[tool_id] = [written_total, skipped_total, "deployed", written_paths];
19010
19050
  if (tool_id === "claude-code") {
19011
19051
  try {
19012
- const manifest = path12.join(package_root, "src", "scripts", "hook_manifest.yaml");
19052
+ const manifest = path13.join(package_root, "src", "scripts", "hook_manifest.yaml");
19013
19053
  const matrix = build_claude_hook_matrix(manifest);
19014
19054
  const res = ensure_managed_hooks(
19015
- path12.join(anchor, "settings.json"),
19055
+ path13.join(anchor, "settings.json"),
19016
19056
  matrix
19017
19057
  );
19018
19058
  if (!state.QUIET) {
@@ -19048,7 +19088,7 @@ function _preview_global_reap(tools, package_root) {
19048
19088
  const anchor = expanduser6(anchor_raw);
19049
19089
  let current_files = /* @__PURE__ */ new Set();
19050
19090
  for (const [src_rel, dest_sub] of plan) {
19051
- const src = path12.join(package_root, src_rel);
19091
+ const src = path13.join(package_root, src_rel);
19052
19092
  current_files = setUnion(
19053
19093
  current_files,
19054
19094
  expected_deploy_files(src, dest_sub ? dest_sub : "")
@@ -19078,14 +19118,14 @@ function _preview_global_reap(tools, package_root) {
19078
19118
  function _verify_deploy_targets(anchor, plan) {
19079
19119
  const missing = [];
19080
19120
  for (const [, dest_sub] of plan) {
19081
- const target = dest_sub ? path12.join(anchor, dest_sub) : anchor;
19121
+ const target = dest_sub ? path13.join(anchor, dest_sub) : anchor;
19082
19122
  const label = dest_sub || ".";
19083
19123
  if (!isDir(target)) {
19084
19124
  missing.push(label);
19085
19125
  continue;
19086
19126
  }
19087
19127
  try {
19088
- const entries = fs14.readdirSync(target);
19128
+ const entries = fs15.readdirSync(target);
19089
19129
  if (entries.length === 0) missing.push(label);
19090
19130
  } catch {
19091
19131
  missing.push(label);
@@ -19100,13 +19140,13 @@ function _prune_modules_by(deploy_results, is_pruned) {
19100
19140
  const [written, skipped, status, paths] = deploy_results[tool_id];
19101
19141
  const pruned_skill_dirs = /* @__PURE__ */ new Set();
19102
19142
  for (const p of paths) {
19103
- const parts = p.split(path12.sep);
19143
+ const parts = p.split(path13.sep);
19104
19144
  if (parts.includes("skills")) {
19105
19145
  const i = parts.indexOf("skills");
19106
19146
  if (i + 1 < parts.length) {
19107
- const skill_root = parts.slice(0, i + 2).join(path12.sep);
19147
+ const skill_root = parts.slice(0, i + 2).join(path13.sep);
19108
19148
  if (!pruned_skill_dirs.has(skill_root)) {
19109
- const skillmd = path12.join(skill_root, "SKILL.md");
19149
+ const skillmd = path13.join(skill_root, "SKILL.md");
19110
19150
  if (pathExists(skillmd) && is_pruned(skillmd)) {
19111
19151
  pruned_skill_dirs.add(skill_root);
19112
19152
  }
@@ -19117,25 +19157,25 @@ function _prune_modules_by(deploy_results, is_pruned) {
19117
19157
  const keep = [];
19118
19158
  const delete_files = [];
19119
19159
  for (const p of paths) {
19120
- const parts = p.split(path12.sep);
19160
+ const parts = p.split(path13.sep);
19121
19161
  let is_target = false;
19122
19162
  if (parts.includes("skills")) {
19123
19163
  const i = parts.indexOf("skills");
19124
- if (i + 1 < parts.length && pruned_skill_dirs.has(parts.slice(0, i + 2).join(path12.sep))) {
19164
+ if (i + 1 < parts.length && pruned_skill_dirs.has(parts.slice(0, i + 2).join(path13.sep))) {
19125
19165
  is_target = true;
19126
19166
  }
19127
- } else if (parts.includes("commands") && path12.extname(p) === ".md" && is_pruned(p)) {
19167
+ } else if (parts.includes("commands") && path13.extname(p) === ".md" && is_pruned(p)) {
19128
19168
  is_target = true;
19129
19169
  }
19130
19170
  (is_target ? delete_files : keep).push(p);
19131
19171
  }
19132
19172
  for (const d of pruned_skill_dirs) {
19133
- fs14.rmSync(d, { recursive: true, force: true });
19173
+ fs15.rmSync(d, { recursive: true, force: true });
19134
19174
  }
19135
19175
  for (const p of delete_files) {
19136
- if (p.split(path12.sep).includes("commands") && pathExists(p)) {
19176
+ if (p.split(path13.sep).includes("commands") && pathExists(p)) {
19137
19177
  try {
19138
- fs14.unlinkSync(p);
19178
+ fs15.unlinkSync(p);
19139
19179
  } catch {
19140
19180
  }
19141
19181
  }
@@ -19150,7 +19190,7 @@ function _prune_lab_modules(deploy_results, lab_ids) {
19150
19190
  }
19151
19191
  var SCOPED_ACTIVE_WORKSPACES = /* @__PURE__ */ new Set(["engineering", "agent-config-maintainer"]);
19152
19192
  function _load_packs_registry(package_root) {
19153
- const vocab_path = path12.join(package_root, "src", "config", "discovery", "packs.yml");
19193
+ const vocab_path = path13.join(package_root, "src", "config", "discovery", "packs.yml");
19154
19194
  const data = yamlSafeLoad(readText(vocab_path));
19155
19195
  if (!Array.isArray(data)) {
19156
19196
  throw new Error(`packs.yml did not parse to a list: ${vocab_path}`);
@@ -19199,9 +19239,9 @@ function _compute_active_pack_ids(packs, runtime_active_packs) {
19199
19239
  }
19200
19240
  function _resolve_global_settings_doc() {
19201
19241
  const root = event4u_root();
19202
- const canonical = path12.join(root, "settings", SETTINGS_FILE);
19242
+ const canonical = path13.join(root, "settings", SETTINGS_FILE);
19203
19243
  if (pathExists(canonical)) return _load_yaml_doc(canonical);
19204
- const legacy = path12.join(root, SETTINGS_FILE);
19244
+ const legacy = path13.join(root, SETTINGS_FILE);
19205
19245
  if (pathExists(legacy)) return _load_yaml_doc(legacy);
19206
19246
  return null;
19207
19247
  }
@@ -19278,7 +19318,7 @@ function install_global(tools, force, project_root = null, core_only = false) {
19278
19318
  info(` schema_version=1, agent_config_version=${installed_version}`);
19279
19319
  info(` tools=${merged_tools.join(",")}`);
19280
19320
  }
19281
- if (project_root !== null && pathExists(_resolve_settings_read(project_root)) && !isDir(path12.join(project_root, ".agent-src.uncondensed"))) {
19321
+ if (project_root !== null && pathExists(_resolve_settings_read(project_root)) && !isDir(path13.join(project_root, ".agent-src.uncondensed"))) {
19282
19322
  const drift = collect_drift(project_root);
19283
19323
  if (!state.QUIET) {
19284
19324
  process3.stdout.write("\n");
@@ -19378,19 +19418,19 @@ function install_global(tools, force, project_root = null, core_only = false) {
19378
19418
  }
19379
19419
  }
19380
19420
  }
19381
- if (project_root !== null && pathExists(_resolve_settings_read(project_root)) && !isDir(path12.join(project_root, ".agent-src.uncondensed"))) {
19421
+ if (project_root !== null && pathExists(_resolve_settings_read(project_root)) && !isDir(path13.join(project_root, ".agent-src.uncondensed"))) {
19382
19422
  const files_by_tool = _files_by_tool_from_deploy(deploy_results);
19383
19423
  const rc = _update_installed_tools_manifest(project_root, tools, "global", force, files_by_tool);
19384
19424
  if (rc !== 0) return rc;
19385
19425
  const removed_marker = _remove_legacy_consumer_bridge_marker(project_root);
19386
19426
  if (removed_marker !== null && !state.QUIET) {
19387
- const rel = isRelativeTo(removed_marker, project_root) ? path12.relative(project_root, removed_marker) : removed_marker;
19427
+ const rel = isRelativeTo(removed_marker, project_root) ? path13.relative(project_root, removed_marker) : removed_marker;
19388
19428
  info(`Removed legacy bridge marker: ${rel}`);
19389
19429
  }
19390
19430
  const anchor_paths = _write_per_tool_project_anchors(project_root, tools);
19391
19431
  if (anchor_paths.length > 0 && !state.QUIET) {
19392
19432
  for (const p of anchor_paths) {
19393
- const rel = isRelativeTo(p, project_root) ? path12.relative(project_root, p) : p;
19433
+ const rel = isRelativeTo(p, project_root) ? path13.relative(project_root, p) : p;
19394
19434
  info(`Project anchor written: ${rel}`);
19395
19435
  }
19396
19436
  }
@@ -19407,8 +19447,8 @@ function install_global(tools, force, project_root = null, core_only = false) {
19407
19447
  }
19408
19448
  return 0;
19409
19449
  }
19410
- var SETTINGS_SURFACE_REL = path12.join("state", "settings-surface.json");
19411
- var SETTINGS_DELTA_REL = path12.join("state", "settings-delta.json");
19450
+ var SETTINGS_SURFACE_REL = path13.join("state", "settings-surface.json");
19451
+ var SETTINGS_DELTA_REL = path13.join("state", "settings-delta.json");
19412
19452
  function _current_settings_surface(version) {
19413
19453
  const jsonSchema = zodToJsonSchema(settingsSchema, {
19414
19454
  name: "AgentSettings",
@@ -19419,20 +19459,20 @@ function _current_settings_surface(version) {
19419
19459
  }
19420
19460
  function _write_settings_surface_snapshot(installed_version) {
19421
19461
  const root = event4u_root();
19422
- const surface_path = path12.join(root, SETTINGS_SURFACE_REL);
19423
- const delta_path = path12.join(root, SETTINGS_DELTA_REL);
19462
+ const surface_path = path13.join(root, SETTINGS_SURFACE_REL);
19463
+ const delta_path = path13.join(root, SETTINGS_DELTA_REL);
19424
19464
  const next = _current_settings_surface(installed_version);
19425
19465
  let previous = null;
19426
19466
  try {
19427
- const parsed = JSON.parse(fs14.readFileSync(surface_path, "utf8"));
19467
+ const parsed = JSON.parse(fs15.readFileSync(surface_path, "utf8"));
19428
19468
  if (parsed !== null && typeof parsed === "object" && parsed.entries !== void 0) previous = parsed;
19429
19469
  } catch {
19430
19470
  }
19431
19471
  if (previous !== null && previous.version !== next.version) {
19432
19472
  const delta = computeSurfaceDelta(previous, next);
19433
19473
  if (delta.changes.length > 0) {
19434
- fs14.mkdirSync(path12.dirname(delta_path), { recursive: true, mode: 448 });
19435
- fs14.writeFileSync(delta_path, `${JSON.stringify(delta, null, 2)}
19474
+ fs15.mkdirSync(path13.dirname(delta_path), { recursive: true, mode: 448 });
19475
+ fs15.writeFileSync(delta_path, `${JSON.stringify(delta, null, 2)}
19436
19476
  `, { mode: 384 });
19437
19477
  if (!state.QUIET) {
19438
19478
  const counts = {};
@@ -19444,8 +19484,8 @@ function _write_settings_surface_snapshot(installed_version) {
19444
19484
  }
19445
19485
  }
19446
19486
  }
19447
- fs14.mkdirSync(path12.dirname(surface_path), { recursive: true, mode: 448 });
19448
- fs14.writeFileSync(surface_path, `${JSON.stringify(next, null, 2)}
19487
+ fs15.mkdirSync(path13.dirname(surface_path), { recursive: true, mode: 448 });
19488
+ fs15.writeFileSync(surface_path, `${JSON.stringify(next, null, 2)}
19449
19489
  `, { mode: 384 });
19450
19490
  }
19451
19491
  function arrayStrEqual(a, b) {
@@ -19657,13 +19697,13 @@ function _minimal_templates_root() {
19657
19697
  const chain = [start];
19658
19698
  let cur = start;
19659
19699
  for (; ; ) {
19660
- const parent = path12.dirname(cur);
19700
+ const parent = path13.dirname(cur);
19661
19701
  if (parent === cur) break;
19662
19702
  chain.push(parent);
19663
19703
  cur = parent;
19664
19704
  }
19665
19705
  for (const ancestor of chain) {
19666
- const candidate = path12.join(ancestor, "src", "templates", "minimal");
19706
+ const candidate = path13.join(ancestor, "src", "templates", "minimal");
19667
19707
  if (isDir(candidate)) return candidate;
19668
19708
  }
19669
19709
  fail("Could not locate src/templates/minimal/ \u2014 package install is corrupt.");
@@ -19671,9 +19711,9 @@ function _minimal_templates_root() {
19671
19711
  var INSTALL_MODE_MARKER_REL = "agents/.agent-state/install-mode.txt";
19672
19712
  function _write_install_mode_marker(project_root, mode) {
19673
19713
  if (mode !== "minimal" && mode !== "full") return;
19674
- const marker = path12.join(project_root, INSTALL_MODE_MARKER_REL);
19714
+ const marker = path13.join(project_root, INSTALL_MODE_MARKER_REL);
19675
19715
  try {
19676
- mkdirp(path12.dirname(marker));
19716
+ mkdirp(path13.dirname(marker));
19677
19717
  writeText(marker, `${mode}
19678
19718
  `);
19679
19719
  } catch {
@@ -19682,7 +19722,7 @@ function _write_install_mode_marker(project_root, mode) {
19682
19722
  function install_minimal(target_root_in, force, user_type = "") {
19683
19723
  let target_root = resolvePath(target_root_in);
19684
19724
  mkdirp(target_root);
19685
- const parent = path12.dirname(target_root);
19725
+ const parent = path13.dirname(target_root);
19686
19726
  if (parent !== target_root) {
19687
19727
  const existing = find_project_root_with_anchor(parent);
19688
19728
  if (existing !== null && existing[0] !== target_root) {
@@ -19693,21 +19733,21 @@ function install_minimal(target_root_in, force, user_type = "") {
19693
19733
  }
19694
19734
  }
19695
19735
  const templates = _minimal_templates_root();
19696
- const settings_src = path12.join(templates, SETTINGS_FILE);
19697
- const overrides_gitkeep_src = path12.join(templates, "overrides-gitkeep");
19698
- const overrides_readme_src = path12.join(templates, "agents-overrides-readme.md");
19736
+ const settings_src = path13.join(templates, SETTINGS_FILE);
19737
+ const overrides_gitkeep_src = path13.join(templates, "overrides-gitkeep");
19738
+ const overrides_readme_src = path13.join(templates, "agents-overrides-readme.md");
19699
19739
  if (!isFile(settings_src)) fail(`Bundled minimal settings template missing under ${templates}`);
19700
19740
  if (!isFile(overrides_gitkeep_src) || !isFile(overrides_readme_src)) {
19701
19741
  fail(`Bundled overrides scaffold templates missing under ${templates}`);
19702
19742
  }
19703
19743
  info(`Minimal init \u2192 ${target_root}`);
19704
- const overrides_root = path12.join(target_root, "agents", "overrides");
19744
+ const overrides_root = path13.join(target_root, "agents", "overrides");
19705
19745
  mkdirp(overrides_root);
19706
19746
  const gitkeep_body = readText(overrides_gitkeep_src);
19707
19747
  for (const sub of ["rules", "skills", "commands"]) {
19708
- const sub_dir = path12.join(overrides_root, sub);
19748
+ const sub_dir = path13.join(overrides_root, sub);
19709
19749
  mkdirp(sub_dir);
19710
- const gitkeep_dst = path12.join(sub_dir, ".gitkeep");
19750
+ const gitkeep_dst = path13.join(sub_dir, ".gitkeep");
19711
19751
  if (pathExists(gitkeep_dst) && !force) {
19712
19752
  skip(`agents/overrides/${sub}/.gitkeep already exists (use --force to overwrite)`);
19713
19753
  } else {
@@ -19715,7 +19755,7 @@ function install_minimal(target_root_in, force, user_type = "") {
19715
19755
  success(`Wrote agents/overrides/${sub}/.gitkeep`);
19716
19756
  }
19717
19757
  }
19718
- const readme_dst = path12.join(overrides_root, "README.md");
19758
+ const readme_dst = path13.join(overrides_root, "README.md");
19719
19759
  if (pathExists(readme_dst) && !force) {
19720
19760
  skip("agents/overrides/README.md already exists (use --force to overwrite)");
19721
19761
  } else {
@@ -19733,14 +19773,14 @@ function install_minimal(target_root_in, force, user_type = "") {
19733
19773
  personal:
19734
19774
  user_type: ${user_type}
19735
19775
  `;
19736
- mkdirp(path12.dirname(settings_dst));
19776
+ mkdirp(path13.dirname(settings_dst));
19737
19777
  writeText(settings_dst, body);
19738
19778
  success(`Wrote ${SETTINGS_FILE} (user_type=${user_type})`);
19739
19779
  }
19740
19780
  }
19741
19781
  const removed_marker = _remove_legacy_consumer_bridge_marker(target_root);
19742
19782
  if (removed_marker !== null) {
19743
- const rel = isRelativeTo(removed_marker, target_root) ? path12.relative(target_root, removed_marker) : removed_marker;
19783
+ const rel = isRelativeTo(removed_marker, target_root) ? path13.relative(target_root, removed_marker) : removed_marker;
19744
19784
  success(`Removed legacy bridge marker: ${rel}`);
19745
19785
  }
19746
19786
  _write_install_mode_marker(target_root, "minimal");
@@ -19814,7 +19854,7 @@ function run_interactive_init(project_root, force) {
19814
19854
  );
19815
19855
  return 0;
19816
19856
  }
19817
- const target = path12.join(project_root, _LOCAL_CONFIG_FILE);
19857
+ const target = path13.join(project_root, _LOCAL_CONFIG_FILE);
19818
19858
  if (pathExists(target) && !force) {
19819
19859
  warn(
19820
19860
  `${_LOCAL_CONFIG_FILE} already exists; re-run with --force to overwrite. Skipping interactive init.`
@@ -19841,7 +19881,7 @@ function run_interactive_init(project_root, force) {
19841
19881
  warn(`Could not write ${target}: ${String(exc)}`);
19842
19882
  return 1;
19843
19883
  }
19844
- success(`Wrote ${path12.relative(project_root, target)} (${user_type} / ${stack} / ${verbosity})`);
19884
+ success(`Wrote ${path13.relative(project_root, target)} (${user_type} / ${stack} / ${verbosity})`);
19845
19885
  return 0;
19846
19886
  }
19847
19887
  var _WIZARD_READY_RE = /^WIZARD_READY (http:\/\/(?:127\.0\.0\.1|localhost):\d+\/\S*)\r?$/;
@@ -19859,12 +19899,12 @@ function _wizard_should_launch(opts) {
19859
19899
  return [true, ""];
19860
19900
  }
19861
19901
  function _wizard_cli_dist(_project_root) {
19862
- const package_root = path12.dirname(path12.dirname(path12.dirname(resolvePath(_HERE2))));
19863
- const cli = path12.join(package_root, "dist", "cli", "agent-config.js");
19902
+ const package_root = path13.dirname(path13.dirname(path13.dirname(resolvePath(_HERE2))));
19903
+ const cli = path13.join(package_root, "dist", "cli", "agent-config.js");
19864
19904
  return pathExists(cli) ? cli : null;
19865
19905
  }
19866
19906
  function _server_info_path() {
19867
- return path12.join(os7.homedir(), ".event4u", "agent-config", "local-server.json");
19907
+ return path13.join(os7.homedir(), ".event4u", "agent-config", "local-server.json");
19868
19908
  }
19869
19909
  function _pid_is_agent_config(pid) {
19870
19910
  let res;
@@ -19881,7 +19921,7 @@ function _pid_is_agent_config(pid) {
19881
19921
  }
19882
19922
  function unlinkMissingOk(p) {
19883
19923
  try {
19884
- fs14.unlinkSync(p);
19924
+ fs15.unlinkSync(p);
19885
19925
  } catch {
19886
19926
  }
19887
19927
  }
@@ -19959,14 +19999,14 @@ function _wizard_spawn(project_root, pass_project_root = true) {
19959
19999
  }
19960
20000
  function _wizard_run_sync(cmd, env, cli) {
19961
20001
  const total = _WIZARD_TIMEOUTS.reduce((a, b) => a + b, 0);
19962
- const log_path = path12.join(
20002
+ const log_path = path13.join(
19963
20003
  os7.tmpdir(),
19964
20004
  `agent-config-wizard-${process3.pid}-${Date.now()}.log`
19965
20005
  );
19966
20006
  let child;
19967
20007
  let log_fd = null;
19968
20008
  try {
19969
- log_fd = fs14.openSync(log_path, "w");
20009
+ log_fd = fs15.openSync(log_path, "w");
19970
20010
  child = spawn(cmd[0], cmd.slice(1), {
19971
20011
  env,
19972
20012
  detached: true,
@@ -19984,7 +20024,7 @@ function _wizard_run_sync(cmd, env, cli) {
19984
20024
  } finally {
19985
20025
  if (log_fd !== null) {
19986
20026
  try {
19987
- fs14.closeSync(log_fd);
20027
+ fs15.closeSync(log_fd);
19988
20028
  } catch {
19989
20029
  }
19990
20030
  }
@@ -20234,8 +20274,8 @@ function main2(argv) {
20234
20274
  const target_root = resolvePath(
20235
20275
  opts.custom_path || opts.project || process3.env["PROJECT_ROOT"] || process3.cwd()
20236
20276
  );
20237
- const minimal_package_root = path12.dirname(
20238
- path12.dirname(path12.dirname(_minimal_templates_root()))
20277
+ const minimal_package_root = path13.dirname(
20278
+ path13.dirname(path13.dirname(_minimal_templates_root()))
20239
20279
  );
20240
20280
  const validated_user_type = _validate_user_type(minimal_package_root, opts.user_type);
20241
20281
  return install_minimal(target_root, opts.force, validated_user_type);
@@ -20264,7 +20304,7 @@ function main2(argv) {
20264
20304
  return rc2;
20265
20305
  }
20266
20306
  const project_root = custom_path || resolvePath(opts.project || process3.env["PROJECT_ROOT"] || process3.cwd());
20267
- const is_first_run = !pathExists(path12.join(project_root, SETTINGS_FILE));
20307
+ const is_first_run = !pathExists(path13.join(project_root, SETTINGS_FILE));
20268
20308
  const rc = _main_project_install(opts, project_root, parsed_tools, is_first_run);
20269
20309
  if (rc === 0 && opts.interactive) {
20270
20310
  run_interactive_init(project_root, opts.force);
@@ -20328,16 +20368,16 @@ function _team_setup_hint_line(project_root) {
20328
20368
  return " \u2022 Claude Code team mode (optional cross-model review via the official codex plugin): run `agent-config doctor --check team` for setup status.";
20329
20369
  }
20330
20370
  function finalize_claude_model_tiers(project_root) {
20331
- const claude_skills = path12.join(project_root, ".claude", "skills");
20332
- const augment_skills = path12.join(project_root, ".augment", "skills");
20371
+ const claude_skills = path13.join(project_root, ".claude", "skills");
20372
+ const augment_skills = path13.join(project_root, ".augment", "skills");
20333
20373
  if (!isDir(claude_skills) || !isDir(augment_skills)) return 0;
20334
20374
  if (_read_consumer_auto_switch(project_root) !== "auto") return 0;
20335
20375
  let rendered = 0;
20336
- const entries = fs14.readdirSync(claude_skills).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
20376
+ const entries = fs15.readdirSync(claude_skills).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
20337
20377
  for (const name of entries) {
20338
- const entry = path12.join(claude_skills, name);
20339
- const src_dir = path12.join(augment_skills, name);
20340
- const src_md = path12.join(src_dir, "SKILL.md");
20378
+ const entry = path13.join(claude_skills, name);
20379
+ const src_dir = path13.join(augment_skills, name);
20380
+ const src_md = path13.join(src_dir, "SKILL.md");
20341
20381
  let tier;
20342
20382
  try {
20343
20383
  tier = read_model_tier(src_md);
@@ -20346,22 +20386,22 @@ function finalize_claude_model_tiers(project_root) {
20346
20386
  }
20347
20387
  if (tier === null || !(tier in TIER_TO_CLAUDE_MODEL) || !isDir(src_dir)) continue;
20348
20388
  if (isSymlink(entry) || isFile(entry)) {
20349
- fs14.unlinkSync(entry);
20389
+ fs15.unlinkSync(entry);
20350
20390
  } else if (isDir(entry)) {
20351
- fs14.rmSync(entry, { recursive: true, force: true });
20391
+ fs15.rmSync(entry, { recursive: true, force: true });
20352
20392
  }
20353
20393
  mkdirp(entry);
20354
- const srcFiles = fs14.readdirSync(src_dir).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
20394
+ const srcFiles = fs15.readdirSync(src_dir).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
20355
20395
  for (const fname of srcFiles) {
20356
20396
  if (fname === "SKILL.md") {
20357
20397
  writeText(
20358
- path12.join(entry, "SKILL.md"),
20398
+ path13.join(entry, "SKILL.md"),
20359
20399
  render_native_model_md(readText(src_md), tier)
20360
20400
  );
20361
20401
  } else {
20362
- fs14.symlinkSync(
20363
- path12.join("../../../.augment/skills", name, fname),
20364
- path12.join(entry, fname)
20402
+ fs15.symlinkSync(
20403
+ path13.join("../../../.augment/skills", name, fname),
20404
+ path13.join(entry, fname)
20365
20405
  );
20366
20406
  }
20367
20407
  }
@@ -20379,7 +20419,7 @@ function _main_project_install(opts, project_root, parsed_tools, is_first_run) {
20379
20419
  let package_type;
20380
20420
  if (opts.package) {
20381
20421
  package_root = resolvePath(opts.package);
20382
- if (!pathExists(path12.join(package_root, "src", "config", "profiles", "minimal.ini"))) {
20422
+ if (!pathExists(path13.join(package_root, "src", "config", "profiles", "minimal.ini"))) {
20383
20423
  fail(`Invalid --package path (missing src/config/profiles/minimal.ini): ${package_root}`);
20384
20424
  }
20385
20425
  package_type = detect_package_type_for_project(project_root, package_root);
@@ -20514,9 +20554,9 @@ function _main_project_install(opts, project_root, parsed_tools, is_first_run) {
20514
20554
  function _resolvedArgv1() {
20515
20555
  if (process3.argv[1] === void 0) return void 0;
20516
20556
  try {
20517
- return fs14.realpathSync(path12.resolve(process3.argv[1]));
20557
+ return fs15.realpathSync(path13.resolve(process3.argv[1]));
20518
20558
  } catch {
20519
- return path12.resolve(process3.argv[1]);
20559
+ return path13.resolve(process3.argv[1]);
20520
20560
  }
20521
20561
  }
20522
20562
  var _argv1 = _resolvedArgv1();