@event4u/agent-config 14.10.0 → 14.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 (399) hide show
  1. package/.augment-plugin/marketplace.json +3 -3
  2. package/.augment-plugin/plugin.json +1 -1
  3. package/.claude-plugin/marketplace.json +1 -1
  4. package/CHANGELOG.md +335 -0
  5. package/README.md +1 -1
  6. package/dist/agent-src/commands/design.md +88 -0
  7. package/dist/agent-src/commands/project/analyze.md +47 -0
  8. package/dist/agent-src/commands/review/changes.md +67 -6
  9. package/dist/agent-src/commands/roadmap/create.md +49 -0
  10. package/dist/agent-src/commands/roadmap/next.md +27 -11
  11. package/dist/agent-src/commands/roadmap/process-full.md +14 -0
  12. package/dist/agent-src/commands/video/from-script.md +60 -3
  13. package/dist/agent-src/commands/video/stitch.md +14 -0
  14. package/dist/agent-src/contexts/communication/rules-auto/guidelines-mechanics.md +1 -0
  15. package/dist/agent-src/contexts/execution/roadmap-process-loop.md +154 -2
  16. package/dist/agent-src/rules/active-remediation.md +3 -3
  17. package/dist/agent-src/rules/code-provenance.md +2 -2
  18. package/dist/agent-src/rules/context-hygiene.md +13 -33
  19. package/dist/agent-src/rules/council-availability.md +2 -2
  20. package/dist/agent-src/rules/decision-revisit-gate.md +3 -1
  21. package/dist/agent-src/rules/design-fidelity.md +18 -0
  22. package/dist/agent-src/rules/design-review-after-ui-write.md +2 -2
  23. package/dist/agent-src/rules/evaluator-independence.md +56 -44
  24. package/dist/agent-src/rules/fix-what-you-see.md +9 -1
  25. package/dist/agent-src/rules/framework-neutrality-in-generic-skills.md +1 -1
  26. package/dist/agent-src/rules/minimal-safe-diff.md +14 -20
  27. package/dist/agent-src/rules/missing-skill-recovery.md +13 -1
  28. package/dist/agent-src/rules/playbook-precedence.md +105 -0
  29. package/dist/agent-src/rules/recurring-criticism.md +3 -1
  30. package/dist/agent-src/rules/roadmap-progress-sync.md +14 -13
  31. package/dist/agent-src/rules/scale-discipline.md +24 -0
  32. package/dist/agent-src/rules/security-sensitive-stop.md +2 -2
  33. package/dist/agent-src/rules/settings-ask-protocol.md +2 -2
  34. package/dist/agent-src/rules/ui-audit-gate.md +27 -15
  35. package/dist/agent-src/rules/untrusted-input-defense.md +2 -2
  36. package/dist/agent-src/skills/accessibility-auditor/SKILL.md +19 -0
  37. package/dist/agent-src/skills/adr-create/SKILL.md +7 -0
  38. package/dist/agent-src/skills/agents-md-thin-root/SKILL.md +33 -0
  39. package/dist/agent-src/skills/ai-council/references/advanced-modes.md +17 -3
  40. package/dist/agent-src/skills/ai-council/references/output-and-synthesis.md +31 -0
  41. package/dist/agent-src/skills/ai-council/references/procedure.md +19 -0
  42. package/dist/agent-src/skills/alerting-doctrine/SKILL.md +225 -0
  43. package/dist/agent-src/skills/alerting-doctrine/evals/triggers.json +17 -0
  44. package/dist/agent-src/skills/authz-review/SKILL.md +0 -1
  45. package/dist/agent-src/skills/blast-radius-analyzer/SKILL.md +32 -0
  46. package/dist/agent-src/skills/brand/SKILL.md +3 -0
  47. package/dist/agent-src/skills/brand-asset-generation/SKILL.md +3 -0
  48. package/dist/agent-src/skills/brand-audit/SKILL.md +3 -0
  49. package/dist/agent-src/skills/brand-identity/SKILL.md +3 -0
  50. package/dist/agent-src/skills/brand-strategy/SKILL.md +3 -0
  51. package/dist/agent-src/skills/brand-to-tokens/SKILL.md +3 -0
  52. package/dist/agent-src/skills/check-refs/SKILL.md +3 -0
  53. package/dist/agent-src/skills/code-review/SKILL.md +11 -0
  54. package/dist/agent-src/skills/command-routing/SKILL.md +6 -0
  55. package/dist/agent-src/skills/condense-memory/SKILL.md +3 -0
  56. package/dist/agent-src/skills/context-authoring/SKILL.md +1 -1
  57. package/dist/agent-src/skills/conventional-commits-writing/SKILL.md +3 -0
  58. package/dist/agent-src/skills/copilot-agents-optimization/SKILL.md +10 -0
  59. package/dist/agent-src/skills/corpus-grounding/SKILL.md +3 -0
  60. package/dist/agent-src/skills/design-intelligence/SKILL.md +3 -0
  61. package/dist/agent-src/skills/design-intelligence/data/landing.csv +36 -35
  62. package/dist/agent-src/skills/design-intelligence/data/stacks/threejs.csv +1 -0
  63. package/dist/agent-src/skills/design-review/SKILL.md +79 -1
  64. package/dist/agent-src/skills/design-review/references/verification-automation.md +41 -0
  65. package/dist/agent-src/skills/design-system-capture/SKILL.md +35 -40
  66. package/dist/agent-src/skills/design-system-capture/references/import-procedure.md +50 -0
  67. package/dist/agent-src/skills/design-tokens/SKILL.md +3 -0
  68. package/dist/agent-src/skills/design-variations/SKILL.md +3 -0
  69. package/dist/agent-src/skills/developer-like-execution/SKILL.md +3 -0
  70. package/dist/agent-src/skills/estimate-ticket/SKILL.md +3 -0
  71. package/dist/agent-src/skills/existing-ui-audit/SKILL.md +20 -3
  72. package/dist/agent-src/skills/fe-design/SKILL.md +74 -41
  73. package/dist/agent-src/skills/fe-design/evals/triggers.json +65 -53
  74. package/dist/agent-src/skills/fe-design/references/craft-floor.md +52 -0
  75. package/dist/agent-src/skills/fe-design/references/source-led-port.md +36 -0
  76. package/dist/agent-src/skills/file-editor/SKILL.md +5 -0
  77. package/dist/agent-src/skills/finishing-a-development-branch/SKILL.md +2 -2
  78. package/dist/agent-src/skills/git-workflow/SKILL.md +3 -0
  79. package/dist/agent-src/skills/html-deck/SKILL.md +3 -0
  80. package/dist/agent-src/skills/iconography/SKILL.md +3 -0
  81. package/dist/agent-src/skills/image-editing/SKILL.md +3 -0
  82. package/dist/agent-src/skills/image-generation/SKILL.md +3 -0
  83. package/dist/agent-src/skills/image-provider-routing/SKILL.md +3 -0
  84. package/dist/agent-src/skills/incident-commander/SKILL.md +10 -0
  85. package/dist/agent-src/skills/js-library-packaging/SKILL.md +173 -0
  86. package/dist/agent-src/skills/js-library-packaging/evals/triggers.json +17 -0
  87. package/dist/agent-src/skills/js-library-packaging/scripts/check_package_surface.ts +270 -0
  88. package/dist/agent-src/skills/laravel-migration/SKILL.md +3 -0
  89. package/dist/agent-src/skills/learning-to-rule-or-skill/SKILL.md +3 -0
  90. package/dist/agent-src/skills/lint-skills/SKILL.md +3 -0
  91. package/dist/agent-src/skills/llm-provider-knowledge/SKILL.md +3 -0
  92. package/dist/agent-src/skills/logging-monitoring/SKILL.md +234 -51
  93. package/dist/agent-src/skills/logo-generation/SKILL.md +3 -0
  94. package/dist/agent-src/skills/md-language-check/SKILL.md +3 -0
  95. package/dist/agent-src/skills/monorepo-workspace/SKILL.md +149 -0
  96. package/dist/agent-src/skills/monorepo-workspace/evals/triggers.json +17 -0
  97. package/dist/agent-src/skills/motion-choreographer/SKILL.md +6 -0
  98. package/dist/agent-src/skills/multi-tenancy/SKILL.md +4 -0
  99. package/dist/agent-src/skills/operational-readiness/SKILL.md +184 -0
  100. package/dist/agent-src/skills/operational-readiness/evals/triggers.json +17 -0
  101. package/dist/agent-src/skills/override-management/SKILL.md +3 -0
  102. package/dist/agent-src/skills/persona-improvement/SKILL.md +3 -0
  103. package/dist/agent-src/skills/pest-testing/SKILL.md +3 -0
  104. package/dist/agent-src/skills/playbook-authoring/SKILL.md +162 -0
  105. package/dist/agent-src/skills/playwright-testing/SKILL.md +3 -0
  106. package/dist/agent-src/skills/privacy-review/SKILL.md +3 -0
  107. package/dist/agent-src/skills/prompt-engineering-image/SKILL.md +3 -0
  108. package/dist/agent-src/skills/quality-tools/SKILL.md +5 -0
  109. package/dist/agent-src/skills/react-shadcn-ui/SKILL.md +52 -21
  110. package/dist/agent-src/skills/readme-reviewer/SKILL.md +3 -0
  111. package/dist/agent-src/skills/readme-writing/SKILL.md +3 -0
  112. package/dist/agent-src/skills/readme-writing-package/SKILL.md +3 -0
  113. package/dist/agent-src/skills/receiving-code-review/SKILL.md +2 -2
  114. package/dist/agent-src/skills/refine-prompt/SKILL.md +3 -0
  115. package/dist/agent-src/skills/refine-ticket/SKILL.md +3 -0
  116. package/dist/agent-src/skills/requesting-code-review/SKILL.md +2 -2
  117. package/dist/agent-src/skills/review-routing/SKILL.md +2 -2
  118. package/dist/agent-src/skills/roadmap-writing/SKILL.md +23 -41
  119. package/dist/agent-src/skills/roadmap-writing/references/follow-up-roadmap-shape.md +47 -0
  120. package/dist/agent-src/skills/rtk-output-filtering/SKILL.md +22 -6
  121. package/dist/agent-src/skills/runway-cognition/SKILL.md +3 -0
  122. package/dist/agent-src/skills/scene-expander/scene-blueprint.schema.yaml +26 -0
  123. package/dist/agent-src/skills/secrets-management/SKILL.md +4 -0
  124. package/dist/agent-src/skills/server-hardening/SKILL.md +159 -0
  125. package/dist/agent-src/skills/server-hardening/evals/triggers.json +17 -0
  126. package/dist/agent-src/skills/skill-improvement-pipeline/SKILL.md +3 -0
  127. package/dist/agent-src/skills/skill-management/SKILL.md +3 -0
  128. package/dist/agent-src/skills/skill-reviewer/SKILL.md +3 -0
  129. package/dist/agent-src/skills/skill-writing/SKILL.md +6 -0
  130. package/dist/agent-src/skills/spreadsheet-authoring/SKILL.md +3 -0
  131. package/dist/agent-src/skills/storybook-workshop/SKILL.md +194 -0
  132. package/dist/agent-src/skills/storybook-workshop/evals/triggers.json +17 -0
  133. package/dist/agent-src/skills/storybook-workshop/scripts/story_contrast_floor.ts +134 -0
  134. package/dist/agent-src/skills/subagent-orchestration/SKILL.md +1 -1
  135. package/dist/agent-src/skills/subagent-orchestration/prompts/README.md +25 -0
  136. package/dist/agent-src/skills/supply-chain-intake/SKILL.md +12 -0
  137. package/dist/agent-src/skills/systematic-debugging/SKILL.md +1 -1
  138. package/dist/agent-src/skills/terraform/SKILL.md +3 -0
  139. package/dist/agent-src/skills/test-driven-development/SKILL.md +1 -1
  140. package/dist/agent-src/skills/threat-modeling/SKILL.md +0 -3
  141. package/dist/agent-src/skills/token-optimizer/SKILL.md +3 -0
  142. package/dist/agent-src/skills/typography-system/SKILL.md +3 -0
  143. package/dist/agent-src/skills/ui-component-architect/SKILL.md +9 -1
  144. package/dist/agent-src/skills/upstream-contribute/SKILL.md +3 -0
  145. package/dist/agent-src/skills/validate-feature-fit/SKILL.md +3 -0
  146. package/dist/agent-src/skills/verify-completion-evidence/SKILL.md +2 -2
  147. package/dist/agent-src/skills/wireframe/SKILL.md +3 -0
  148. package/dist/agent-src/skills/wireframe/references/story-beat-ledger.schema.json +115 -0
  149. package/dist/agent-src/skills/workspace-link/SKILL.md +131 -0
  150. package/dist/agent-src/skills/workspace-link/evals/triggers.json +17 -0
  151. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  152. package/dist/agent-src/templates/playbook.md +75 -0
  153. package/dist/agent-src/templates/roadmaps.md +37 -0
  154. package/dist/agent-src/templates/scripts/check_playbook_invokes.ts +231 -0
  155. package/dist/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +24 -0
  156. package/dist/agent-src/templates/scripts/work_engine/directives/ui/polish.ts +2 -0
  157. package/dist/agent-src/templates/scripts/work_engine/directives/ui/review.ts +216 -0
  158. package/dist/agent-src/templates/scripts/work_engine/directives/ui/scaffold.ts +159 -0
  159. package/dist/agent-src/templates/scripts/work_engine/directives/ui/stack_bundles.ts +73 -4
  160. package/dist/agent-src/templates/scripts/work_engine/stack/detect.ts +325 -40
  161. package/dist/cli/commands/uiAudit.js +221 -0
  162. package/dist/cli/commands/uiAudit.js.map +1 -0
  163. package/dist/cli/commands/uiRender.js +206 -0
  164. package/dist/cli/commands/uiRender.js.map +1 -0
  165. package/dist/cli/main.js +22 -1
  166. package/dist/cli/main.js.map +1 -1
  167. package/dist/cli/mcp/content.js +64 -1
  168. package/dist/cli/mcp/content.js.map +1 -1
  169. package/dist/cli/mcp/dispatch.js +175 -10
  170. package/dist/cli/mcp/dispatch.js.map +1 -1
  171. package/dist/cli/registry.js +3 -0
  172. package/dist/cli/registry.js.map +1 -1
  173. package/dist/cli-delegate/{chunk-H4VIVD4C.js → chunk-236PNQZK.js} +413 -391
  174. package/dist/cli-delegate/{chunk-G23AT6GD.js → chunk-DMSZHXZS.js} +57 -1
  175. package/dist/cli-delegate/{chunk-77GR3VD4.js → chunk-FF7WAFMR.js} +58 -3
  176. package/dist/cli-delegate/{chunk-PLSG6UL5.js → chunk-K4FFODTS.js} +341 -204
  177. package/dist/cli-delegate/{chunk-YM4GZDJG.js → chunk-L43NCYPB.js} +5 -0
  178. package/dist/cli-delegate/{chunk-B2ERU2VA.js → chunk-WOKWX5PL.js} +1 -1
  179. package/dist/cli-delegate/cmd_brand_status.js +8 -6
  180. package/dist/cli-delegate/cmd_conformance.js +3 -3
  181. package/dist/cli-delegate/cmd_doctor.js +3 -3
  182. package/dist/cli-delegate/cmd_export.js +4 -4
  183. package/dist/cli-delegate/cmd_handoff.js +1 -1
  184. package/dist/cli-delegate/cmd_preflight.js +2 -2
  185. package/dist/cli-delegate/cmd_prune.js +4 -4
  186. package/dist/cli-delegate/cmd_session_recycle.js +70 -9
  187. package/dist/cli-delegate/cmd_settings_migrate.js +4 -4
  188. package/dist/cli-delegate/cmd_settings_set.js +1 -1
  189. package/dist/cli-delegate/cmd_sync.js +4 -4
  190. package/dist/cli-delegate/cmd_uninstall.js +4 -4
  191. package/dist/cli-delegate/cmd_validate.js +4 -4
  192. package/dist/discovery/deprecation-report.md +1 -1
  193. package/dist/discovery/discovery-manifest.json +359 -124
  194. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  195. package/dist/discovery/discovery-manifest.summary.md +4 -4
  196. package/dist/discovery/dormancy-report.md +1 -1
  197. package/dist/discovery/orphan-report.md +1 -1
  198. package/dist/discovery/packs.json +18 -8
  199. package/dist/discovery/trust-report.md +3 -3
  200. package/dist/discovery/workspaces.json +16 -6
  201. package/dist/hooks/dispatch.js +2337 -1436
  202. package/dist/install/install.mjs +795 -708
  203. package/dist/mcp/registry-manifest.json +3 -3
  204. package/dist/mcp/server.json +2 -2
  205. package/dist/mcp/server.mjs +1685 -1250
  206. package/dist/router.json +1 -1
  207. package/dist/scripts/_lib/lean_projection_mode.js +40 -0
  208. package/dist/scripts/_lib/lean_projection_mode.js.map +1 -0
  209. package/dist/scripts/_lib/scoped_projection.js +84 -0
  210. package/dist/scripts/_lib/scoped_projection.js.map +1 -1
  211. package/dist/scripts/_lib/ui_surface.js +89 -0
  212. package/dist/scripts/_lib/ui_surface.js.map +1 -0
  213. package/dist/scripts/condense.js +6 -10
  214. package/dist/scripts/condense.js.map +1 -1
  215. package/dist/scripts/project_thin_rules.js +40 -2
  216. package/dist/scripts/project_thin_rules.js.map +1 -1
  217. package/dist/server/schemas/settings.js +3 -0
  218. package/dist/server/schemas/settings.js.map +1 -1
  219. package/dist/shared/skillRanking.js +159 -0
  220. package/dist/shared/skillRanking.js.map +1 -0
  221. package/docs/contracts/provider-lifecycle.md +47 -18
  222. package/docs/contracts/settings-classes.md +14 -4
  223. package/docs/guidelines/agent-infra/context-hygiene-mechanics.md +49 -0
  224. package/docs/guidelines/agent-infra/evaluator-independence-mechanics.md +92 -0
  225. package/docs/guidelines/agent-infra/minimal-safe-diff-mechanics.md +45 -1
  226. package/docs/guidelines/agent-infra/roadmap-deferred-resolution-provenance.md +54 -0
  227. package/docs/guidelines/design-antipatterns.md +4 -2
  228. package/docs/guidelines/design-asset-discipline.md +38 -0
  229. package/docs/guidelines/design-fidelity-mechanics.md +45 -29
  230. package/docs/guidelines/design-handover-extraction.md +35 -5
  231. package/docs/guidelines/design-modes.md +41 -1
  232. package/docs/guidelines/monorepo-antipatterns.md +141 -0
  233. package/llms.txt +50 -39
  234. package/package.json +1 -1
  235. package/src/agent-src/templates/scripts/check_playbook_invokes.ts +231 -0
  236. package/src/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +24 -0
  237. package/src/agent-src/templates/scripts/work_engine/directives/ui/polish.ts +2 -0
  238. package/src/agent-src/templates/scripts/work_engine/directives/ui/review.ts +216 -0
  239. package/src/agent-src/templates/scripts/work_engine/directives/ui/scaffold.ts +159 -0
  240. package/src/agent-src/templates/scripts/work_engine/directives/ui/stack_bundles.ts +73 -4
  241. package/src/agent-src/templates/scripts/work_engine/stack/detect.ts +325 -40
  242. package/src/config/agent-settings.template.yml +28 -0
  243. package/src/config/assurance-capability-registry.json +223 -0
  244. package/src/config/assurance-threshold-budget.json +65 -0
  245. package/src/config/ci-local-parity.yml +14 -0
  246. package/src/config/discovery/unassigned-artefacts.yml +2 -0
  247. package/src/config/dispatch-economy-metrics.json +4 -2
  248. package/src/config/evaluator-budgets.json +14 -14
  249. package/src/config/gate-coverage.yml +207 -8
  250. package/src/config/gate-violation-baselines.json +76 -72
  251. package/src/config/hook-latency-budget.json +1 -0
  252. package/src/config/hook-token-budget.json +137 -125
  253. package/src/config/pack-size-budget.json +4 -2
  254. package/src/config/quorum-attendance-budget.json +12 -4
  255. package/src/config/rule-activation-census.json +7 -3
  256. package/src/config/rule-enforcement-baseline.json +0 -1
  257. package/src/config/rule-stub-ceilings.json +112 -91
  258. package/src/scripts/_cli/cmd_doctor.ts +15 -16
  259. package/src/scripts/_cli/doctor_install_mode.ts +49 -0
  260. package/src/scripts/_cli/doctor_overrides.ts +154 -0
  261. package/src/scripts/_dispatch.bash +17 -0
  262. package/src/scripts/_lib/as_of.ts +412 -0
  263. package/src/scripts/_lib/exec_evidence.ts +7 -0
  264. package/src/scripts/_lib/hook_settings.ts +33 -0
  265. package/src/scripts/_lib/host_listing_model.ts +192 -0
  266. package/src/scripts/_lib/lean_projection_mode.ts +44 -0
  267. package/src/scripts/_lib/mcp_bridge.ts +199 -0
  268. package/src/scripts/_lib/review_independence.ts +62 -10
  269. package/src/scripts/_lib/rule_injection.ts +239 -0
  270. package/src/scripts/_lib/run_checkpoint.ts +54 -1
  271. package/src/scripts/_lib/scoped_projection.ts +96 -0
  272. package/src/scripts/_lib/session_register.ts +44 -2
  273. package/src/scripts/_lib/skill_catalogue.ts +38 -2
  274. package/src/scripts/_lib/transcript_reads.ts +207 -0
  275. package/src/scripts/_lib/ui_authority.test.ts +251 -0
  276. package/src/scripts/_lib/ui_authority.ts +343 -0
  277. package/src/scripts/ai-video/adapters/fal.sh +8 -3
  278. package/src/scripts/ai-video/adapters/gemini-veo.sh +10 -0
  279. package/src/scripts/ai-video/adapters/higgsfield.sh +10 -2
  280. package/src/scripts/ai-video/adapters/kling.sh +10 -0
  281. package/src/scripts/ai-video/adapters/sora.sh +10 -0
  282. package/src/scripts/ai-video/lib/calibrate-cost.sh +145 -0
  283. package/src/scripts/ai-video/lib/model-capabilities/README.md +53 -7
  284. package/src/scripts/ai-video/lib/model-capabilities/comfyui.json +15 -3
  285. package/src/scripts/ai-video/lib/model-capabilities/fal.json +36 -6
  286. package/src/scripts/ai-video/lib/model-capabilities/gemini-veo.json +23 -0
  287. package/src/scripts/ai-video/lib/model-capabilities/higgsfield.json +23 -0
  288. package/src/scripts/ai-video/lib/model-capabilities/kling.json +23 -0
  289. package/src/scripts/ai-video/lib/model-capabilities/musetalk.json +8 -2
  290. package/src/scripts/ai-video/lib/model-capabilities/replicate.json +36 -6
  291. package/src/scripts/ai-video/lib/model-capabilities/sora.json +45 -0
  292. package/src/scripts/ai-video/lib/model-capabilities/syncso.json +8 -2
  293. package/src/scripts/ai-video/lib/parse-blueprint.sh +52 -5
  294. package/src/scripts/ai-video/lib/resume-scan.sh +92 -3
  295. package/src/scripts/ai-video/lib/seam-plan.sh +212 -0
  296. package/src/scripts/ai-video/smoke-trace.sh +450 -2
  297. package/src/scripts/ai-video/stitch.sh +191 -10
  298. package/src/scripts/ai-video/test-pipeline.sh +84 -6
  299. package/src/scripts/ai_council/cli_agency_bounds.ts +139 -0
  300. package/src/scripts/ai_council/cli_least_agency_canary.ts +347 -0
  301. package/src/scripts/ai_council/clients.ts +3 -2
  302. package/src/scripts/ai_council/consensus.ts +63 -6
  303. package/src/scripts/ai_council/events_log.ts +46 -1
  304. package/src/scripts/ai_council/orchestrator.ts +103 -108
  305. package/src/scripts/ai_council/orchestrator_results.ts +166 -0
  306. package/src/scripts/ai_council/prompts.ts +12 -5
  307. package/src/scripts/ai_council/quorum.ts +82 -1
  308. package/src/scripts/ai_council/quorum_wiring.ts +82 -5
  309. package/src/scripts/ai_council/stance_tally.ts +22 -0
  310. package/src/scripts/bench_hook_latency.ts +62 -0
  311. package/src/scripts/build_proof.ts +12 -1
  312. package/src/scripts/capture_skill_catalogue.ts +21 -0
  313. package/src/scripts/check_always_budget.ts +2 -1
  314. package/src/scripts/check_augmentignore.ts +2 -1
  315. package/src/scripts/check_beta_review_markers.ts +2 -1
  316. package/src/scripts/check_composite_arming.ts +364 -0
  317. package/src/scripts/check_corpus_staleness.ts +2 -1
  318. package/src/scripts/check_council_pin_staleness.ts +3 -1
  319. package/src/scripts/check_enforcement_coverage.ts +116 -3
  320. package/src/scripts/check_enforcement_denominator.ts +365 -0
  321. package/src/scripts/check_gate_coverage.ts +2 -1
  322. package/src/scripts/check_hook_bundle_freshness.ts +13 -1
  323. package/src/scripts/check_knowledge_cards.ts +2 -1
  324. package/src/scripts/check_knowledge_pages.ts +3 -2
  325. package/src/scripts/check_memory.ts +2 -1
  326. package/src/scripts/check_no_automerge_key.ts +287 -0
  327. package/src/scripts/check_pack_conformance_fixture.ts +565 -0
  328. package/src/scripts/check_proposal.ts +2 -1
  329. package/src/scripts/check_reach_staleness.ts +2 -1
  330. package/src/scripts/check_release_adjacent_health.ts +2 -1
  331. package/src/scripts/check_release_pr_shape.ts +5 -0
  332. package/src/scripts/check_review_schema.ts +34 -1
  333. package/src/scripts/check_roadmap_trackable.ts +48 -3
  334. package/src/scripts/check_source_size_budget.ts +2 -1
  335. package/src/scripts/check_standing_payload_delta.ts +505 -0
  336. package/src/scripts/check_trigger_evals.ts +2 -1
  337. package/src/scripts/classify_change_risk.ts +281 -0
  338. package/src/scripts/compute_skill_tiers.ts +186 -0
  339. package/src/scripts/condense.ts +8 -13
  340. package/src/scripts/council_attendance_metrics.ts +183 -0
  341. package/src/scripts/council_cli.ts +10 -8
  342. package/src/scripts/council_parse_rate.ts +116 -0
  343. package/src/scripts/derive_playbooks.ts +406 -0
  344. package/src/scripts/design_slop_rules.test.ts +7 -0
  345. package/src/scripts/design_slop_rules.ts +56 -2
  346. package/src/scripts/dispatch_r2_reviewer.ts +16 -0
  347. package/src/scripts/frontend_corpus_hash.ts +116 -0
  348. package/src/scripts/grade_target_readiness.ts +478 -0
  349. package/src/scripts/hook_manifest.json +1 -1
  350. package/src/scripts/hook_manifest.yaml +97 -16
  351. package/src/scripts/hooks/concern_registry.ts +4 -0
  352. package/src/scripts/hooks/design_pass_hook.ts +356 -0
  353. package/src/scripts/hooks/rtk_wrap_hook.ts +30 -7
  354. package/src/scripts/hooks/rule_inject_hook.ts +318 -0
  355. package/src/scripts/hot_context_hook.ts +74 -7
  356. package/src/scripts/install.ts +40 -89
  357. package/src/scripts/lint_adapter_tier.ts +663 -0
  358. package/src/scripts/lint_archived_skills.ts +93 -0
  359. package/src/scripts/lint_budget_ownership.ts +2 -1
  360. package/src/scripts/lint_deterministic_time.ts +470 -0
  361. package/src/scripts/lint_framework_leakage.ts +5 -0
  362. package/src/scripts/lint_handoffs.ts +525 -1
  363. package/src/scripts/lint_judge_prompt_expectation.ts +155 -0
  364. package/src/scripts/lint_marketplace.ts +88 -0
  365. package/src/scripts/lint_media_policy_linkage.ts +140 -1
  366. package/src/scripts/lint_one_off_age.ts +6 -1
  367. package/src/scripts/lint_override_kernel_guard.ts +87 -5
  368. package/src/scripts/lint_roadmap_complexity.ts +56 -0
  369. package/src/scripts/lint_rule_enforcement_declaration.ts +24 -7
  370. package/src/scripts/lint_rule_norm_pin.ts +321 -0
  371. package/src/scripts/lint_spawn_payload.ts +42 -5
  372. package/src/scripts/lint_symptom_intake.ts +2 -1
  373. package/src/scripts/mcp_parity_smoke.ts +30 -4
  374. package/src/scripts/mcp_render.ts +66 -1
  375. package/src/scripts/mcp_tool_fingerprint.ts +241 -0
  376. package/src/scripts/measure_risk_class_drift.ts +140 -0
  377. package/src/scripts/measure_skill_ranker_baseline.ts +212 -0
  378. package/src/scripts/media/lib/adapter-common.sh +211 -1
  379. package/src/scripts/media/lib/adapter-contract.md +74 -6
  380. package/src/scripts/model_rule_injection.ts +907 -0
  381. package/src/scripts/project_thin_rules.ts +45 -2
  382. package/src/scripts/release.ts +66 -860
  383. package/src/scripts/release_drill.ts +59 -3
  384. package/src/scripts/release_env.ts +298 -0
  385. package/src/scripts/release_publication.ts +720 -0
  386. package/src/scripts/roadmap_context.ts +778 -0
  387. package/src/scripts/schemas/fidelity-measurement-sheet.schema.json +169 -0
  388. package/src/scripts/schemas/rule.schema.json +24 -2
  389. package/src/scripts/schemas/skill.schema.json +39 -0
  390. package/src/scripts/schemas/ui-authority.schema.json +114 -0
  391. package/src/scripts/session_register_hook.ts +29 -3
  392. package/src/scripts/sessions_cli.ts +67 -3
  393. package/src/scripts/skill_tools/score_skill_relevance.ts +36 -53
  394. package/src/scripts/token_sink_report.ts +239 -0
  395. package/src/scripts/trigger_coverage.ts +122 -3
  396. package/src/scripts/update_counts.ts +7 -3
  397. package/src/scripts/validate_frontmatter.ts +66 -0
  398. package/src/server/schemas/settings.ts +5 -0
  399. package/src/shared/skillRanking.ts +183 -0
@@ -2,13 +2,13 @@ import { createRequire as __acCreateRequire } from 'node:module'; const require
2
2
  import {
3
3
  ZodFirstPartyTypeKind,
4
4
  settingsSchema
5
- } from "./chunk-YM4GZDJG.js";
5
+ } from "./chunk-L43NCYPB.js";
6
6
  import {
7
7
  main
8
8
  } from "./chunk-6RJA2F5A.js";
9
9
  import {
10
10
  RULE_SOURCE_REL
11
- } from "./chunk-B2ERU2VA.js";
11
+ } from "./chunk-WOKWX5PL.js";
12
12
  import {
13
13
  ScopeMismatchError,
14
14
  build_claude_hook_matrix,
@@ -38,14 +38,15 @@ import {
38
38
  import {
39
39
  LEGACY_ALL,
40
40
  compute_active_pack_ids,
41
- is_lab_artefact,
42
41
  is_pruned_under_scoped,
43
42
  load_lab_pack_ids,
44
43
  load_packs_registry,
45
44
  parseFrontmatter,
45
+ prune_lab_modules,
46
+ prune_modules_by,
46
47
  ruleFileArrives,
47
48
  ruleScopeFromSettings
48
- } from "./chunk-G23AT6GD.js";
49
+ } from "./chunk-DMSZHXZS.js";
49
50
  import {
50
51
  require_dist
51
52
  } from "./chunk-OY53J6II.js";
@@ -267,9 +268,9 @@ function subtract_pointers(doc, entries) {
267
268
  // src/scripts/install.ts
268
269
  import { spawn, spawnSync } from "node:child_process";
269
270
  import * as crypto3 from "node:crypto";
270
- import * as fs9 from "node:fs";
271
+ import * as fs10 from "node:fs";
271
272
  import * as os3 from "node:os";
272
- import * as path7 from "node:path";
273
+ import * as path8 from "node:path";
273
274
  import process2 from "node:process";
274
275
  import { fileURLToPath, pathToFileURL } from "node:url";
275
276
 
@@ -389,9 +390,66 @@ function is_claude_builtin_name(slug) {
389
390
  return CLAUDE_CODE_BUILTIN_NAMES.has(slug.toLowerCase());
390
391
  }
391
392
 
392
- // src/scripts/_lib/rule_layer_overlap.ts
393
+ // src/scripts/_lib/mcp_bridge.ts
393
394
  import * as fs from "node:fs";
394
395
  import * as path from "node:path";
396
+ var MCP_SERVER_KEY = "agent-config";
397
+ var MCP_BRIDGE_ENTRY = {
398
+ mcpServers: {
399
+ [MCP_SERVER_KEY]: {
400
+ command: "npx",
401
+ args: ["-y", "@event4u/agent-config", "mcp-server"]
402
+ }
403
+ }
404
+ };
405
+ function makeEnsureMcpBridge(mergeJsonFile) {
406
+ return (projectRoot, force) => mergeJsonFile(path.join(projectRoot, ".mcp.json"), MCP_BRIDGE_ENTRY, force, ".mcp.json");
407
+ }
408
+ function projectionModeOf(raw) {
409
+ return raw === "scoped" ? "scoped" : raw === "tiered" ? "tiered" : "legacy-all";
410
+ }
411
+ function resolveTierB(packageRoot) {
412
+ const p = path.join(packageRoot, "agents", "runtime", "state", "skill-tiers.json");
413
+ if (!fs.existsSync(p)) return null;
414
+ try {
415
+ const parsed = JSON.parse(fs.readFileSync(p, "utf-8"));
416
+ if (!Array.isArray(parsed.tier_b)) return null;
417
+ return new Set(parsed.tier_b.filter((n) => typeof n === "string"));
418
+ } catch {
419
+ return null;
420
+ }
421
+ }
422
+ function tierBPrunePredicate(tierB) {
423
+ return (mdPath) => tierB.has(path.basename(path.dirname(mdPath)));
424
+ }
425
+ function tierBAdvisory(packageRoot) {
426
+ const tierB = resolveTierB(packageRoot);
427
+ if (tierB === null || tierB.size === 0) return null;
428
+ return `\u2139\uFE0F ${tierB.size} skill(s) are predicted to reach the model WITHOUT their description on a default 200k window.
429
+ Two levers, neither applied for you:
430
+ \u2022 raise \`skillListingBudgetFraction\` in your Claude Code settings \u2014 restores descriptions at a token cost (100% delivery of this catalogue measures ~13,003 tok)
431
+ \u2022 or set \`projection.mode: tiered\` to withhold them from the catalogue and reach them via the MCP server instead (opt-in, still unproven \u2014 see docs/mcp-server.md)`;
432
+ }
433
+ function applyTieredPrune(deployResults, packageRoot, pruneBy) {
434
+ const tierB = resolveTierB(packageRoot);
435
+ if (tierB === null || tierB.size === 0) {
436
+ return {
437
+ deployResults,
438
+ level: "warn",
439
+ message: "projection.mode: tiered but no skill-tier split exists (agents/runtime/state/skill-tiers.json) \u2014 shipping the full surface. Compute one with `./scripts-run src/scripts/compute_skill_tiers` first."
440
+ };
441
+ }
442
+ const [pruned, adjusted] = pruneBy(deployResults, tierBPrunePredicate(tierB));
443
+ return {
444
+ deployResults: adjusted,
445
+ level: "info",
446
+ message: `\u{1F9F9} Tiered install: pruned ${pruned} Tier-B skill artefact(s) \u2014 still reachable via the MCP server's suggest_skill_for_task / read_skill. Set projection.mode: legacy-all to restore the full surface.`
447
+ };
448
+ }
449
+
450
+ // src/scripts/_lib/rule_layer_overlap.ts
451
+ import * as fs2 from "node:fs";
452
+ import * as path2 from "node:path";
395
453
  var INSTALLER_PROVENANCE_KEYS = ["package", "source_path"];
396
454
  function stripProvenance(text) {
397
455
  const lines = text.split("\n");
@@ -445,14 +503,14 @@ function compareLayers(global_layer, project_layer) {
445
503
  function readRuleLayer(dir) {
446
504
  let names;
447
505
  try {
448
- names = fs.readdirSync(dir);
506
+ names = fs2.readdirSync(dir);
449
507
  } catch {
450
508
  return null;
451
509
  }
452
510
  const files = /* @__PURE__ */ new Map();
453
511
  for (const name of names.filter((n) => n.endsWith(".md")).sort()) {
454
512
  try {
455
- files.set(name, fs.readFileSync(path.join(dir, name), "utf-8"));
513
+ files.set(name, fs2.readFileSync(path2.join(dir, name), "utf-8"));
456
514
  } catch {
457
515
  continue;
458
516
  }
@@ -460,7 +518,7 @@ function readRuleLayer(dir) {
460
518
  return { dir, files };
461
519
  }
462
520
  function claudeMdExcludesGlob(dir) {
463
- return `${path.resolve(dir).replace(/\/+$/, "")}/**`;
521
+ return `${path2.resolve(dir).replace(/\/+$/, "")}/**`;
464
522
  }
465
523
  function mergeClaudeMdExcludes(existing, entry) {
466
524
  if (!Array.isArray(existing)) return [entry];
@@ -491,25 +549,25 @@ function decideLayerAction(report, choice, global_dir, project_dir) {
491
549
  // src/scripts/_lib/install_drift.ts
492
550
  var import_yaml = __toESM(require_dist(), 1);
493
551
  import * as crypto from "node:crypto";
494
- import * as fs2 from "node:fs";
552
+ import * as fs3 from "node:fs";
495
553
  import * as os from "node:os";
496
- import * as path2 from "node:path";
554
+ import * as path3 from "node:path";
497
555
  function expanduser(p) {
498
556
  if (p === "~") {
499
557
  return os.homedir();
500
558
  }
501
559
  if (p.startsWith("~/") || process.platform === "win32" && p.startsWith("~\\")) {
502
- return path2.join(os.homedir(), p.slice(2));
560
+ return path3.join(os.homedir(), p.slice(2));
503
561
  }
504
562
  return p;
505
563
  }
506
564
  function resolve_entry_path(project_root, raw) {
507
565
  const p = expanduser(raw);
508
- return path2.isAbsolute(p) ? p : path2.join(project_root, p);
566
+ return path3.isAbsolute(p) ? p : path3.join(project_root, p);
509
567
  }
510
568
  function sha256_of_file(p) {
511
569
  try {
512
- return crypto.createHash("sha256").update(fs2.readFileSync(p)).digest("hex");
570
+ return crypto.createHash("sha256").update(fs3.readFileSync(p)).digest("hex");
513
571
  } catch {
514
572
  return null;
515
573
  }
@@ -518,7 +576,7 @@ function collect_drift(project_root, env) {
518
576
  const target = manifest_path(project_root, env);
519
577
  let text;
520
578
  try {
521
- text = fs2.readFileSync(target, "utf-8");
579
+ text = fs3.readFileSync(target, "utf-8");
522
580
  } catch {
523
581
  return null;
524
582
  }
@@ -563,7 +621,7 @@ function collect_drift(project_root, env) {
563
621
  continue;
564
622
  }
565
623
  const resolved = resolve_entry_path(project_root, raw_path);
566
- if (!fs2.existsSync(resolved)) {
624
+ if (!fs3.existsSync(resolved)) {
567
625
  out.push({
568
626
  tool_id,
569
627
  path: resolved,
@@ -616,9 +674,9 @@ function format_drift_report(entries) {
616
674
  }
617
675
 
618
676
  // src/scripts/_lib/skill_catalogue.ts
619
- import * as fs3 from "node:fs";
620
- import * as path3 from "node:path";
621
- var OBSERVATION_LOG = path3.join(
677
+ import * as fs4 from "node:fs";
678
+ import * as path4 from "node:path";
679
+ var OBSERVATION_LOG = path4.join(
622
680
  "agents",
623
681
  "evidence",
624
682
  "metrics",
@@ -662,9 +720,9 @@ function descriptionOf(frontmatter) {
662
720
  return "";
663
721
  }
664
722
  function readProjectedCatalogue(root) {
665
- const names = fs3.readdirSync(root).filter((n) => fs3.existsSync(path3.join(root, n, "SKILL.md"))).sort();
723
+ const names = fs4.readdirSync(root).filter((n) => fs4.existsSync(path4.join(root, n, "SKILL.md"))).sort();
666
724
  return names.map((name, index) => {
667
- const content = fs3.readFileSync(path3.join(root, name, "SKILL.md"), "utf-8");
725
+ const content = fs4.readFileSync(path4.join(root, name, "SKILL.md"), "utf-8");
668
726
  const frontmatter = frontmatterOf(content);
669
727
  const description = descriptionOf(frontmatter);
670
728
  return {
@@ -681,12 +739,12 @@ function truncationModeOf(record) {
681
739
  return record.truncation_mode ?? "per-entry";
682
740
  }
683
741
  function markdownFilesUnder(root) {
684
- if (!fs3.existsSync(root)) return [];
742
+ if (!fs4.existsSync(root)) return [];
685
743
  const out = [];
686
744
  const walk = (dir) => {
687
- for (const entry of fs3.readdirSync(dir, { withFileTypes: true })) {
688
- const full = path3.join(dir, entry.name);
689
- if (fs3.statSync(full).isDirectory()) walk(full);
745
+ for (const entry of fs4.readdirSync(dir, { withFileTypes: true })) {
746
+ const full = path4.join(dir, entry.name);
747
+ if (fs4.statSync(full).isDirectory()) walk(full);
690
748
  else if (entry.name.endsWith(".md")) out.push(full);
691
749
  }
692
750
  };
@@ -694,9 +752,9 @@ function markdownFilesUnder(root) {
694
752
  return out;
695
753
  }
696
754
  function measureCatalogueVolume(host, root) {
697
- const skillsRoot = path3.join(root, "skills");
698
- const skills = fs3.existsSync(skillsRoot) ? readProjectedCatalogue(skillsRoot) : [];
699
- const commandEntries = markdownFilesUnder(path3.join(root, "commands")).length;
755
+ const skillsRoot = path4.join(root, "skills");
756
+ const skills = fs4.existsSync(skillsRoot) ? readProjectedCatalogue(skillsRoot) : [];
757
+ const commandEntries = markdownFilesUnder(path4.join(root, "commands")).length;
700
758
  return {
701
759
  host,
702
760
  root,
@@ -740,6 +798,7 @@ function catalogueLimitWarning(volume, limit) {
740
798
  }
741
799
  function migrationEligibility(host, resolvedMode, currentSkillCount, limits) {
742
800
  if (resolvedMode === "scoped") return { eligible: false, reason: "already-scoped" };
801
+ if (resolvedMode === "tiered") return { eligible: false, reason: "already-tiered" };
743
802
  const limit = limits.get(host);
744
803
  if (limit === void 0) return { eligible: false, reason: "no-observation-for-host" };
745
804
  if (limit.projectedSkills === null) return { eligible: false, reason: "observation-not-comparable" };
@@ -773,9 +832,9 @@ function migrationPromptLines(host, eligibility, settingsPath) {
773
832
  ];
774
833
  }
775
834
  function readObservationLog(logPath) {
776
- if (!fs3.existsSync(logPath)) return [];
835
+ if (!fs4.existsSync(logPath)) return [];
777
836
  const out = [];
778
- for (const line of fs3.readFileSync(logPath, "utf-8").split("\n")) {
837
+ for (const line of fs4.readFileSync(logPath, "utf-8").split("\n")) {
779
838
  const trimmed = line.trim();
780
839
  if (trimmed.length === 0) continue;
781
840
  try {
@@ -816,8 +875,8 @@ function isInteractiveSession(probe) {
816
875
 
817
876
  // src/scripts/_lib/claude_desktop_bundler.ts
818
877
  import * as crypto2 from "node:crypto";
819
- import * as fs4 from "node:fs";
820
- import * as path4 from "node:path";
878
+ import * as fs5 from "node:fs";
879
+ import * as path5 from "node:path";
821
880
 
822
881
  // src/scripts/_lib/zip_min.ts
823
882
  import * as zlib from "node:zlib";
@@ -924,7 +983,7 @@ function _is_excluded(rel_parts) {
924
983
  }
925
984
  function _is_dir(p) {
926
985
  try {
927
- return fs4.statSync(p).isDirectory();
986
+ return fs5.statSync(p).isDirectory();
928
987
  } catch {
929
988
  return false;
930
989
  }
@@ -936,12 +995,12 @@ function _compare_rel_parts(a, b) {
936
995
  }
937
996
  function _walk_skill_files(skill_dir) {
938
997
  const out = [];
939
- const resolved = fs4.realpathSync(skill_dir);
998
+ const resolved = fs5.realpathSync(skill_dir);
940
999
  const walk = (root, relRoot) => {
941
1000
  const dirNames = [];
942
1001
  const fileNames = [];
943
- for (const dirent of fs4.readdirSync(root, { withFileTypes: true })) {
944
- const full = path4.join(root, dirent.name);
1002
+ for (const dirent of fs5.readdirSync(root, { withFileTypes: true })) {
1003
+ const full = path5.join(root, dirent.name);
945
1004
  const isDir2 = dirent.isDirectory() || dirent.isSymbolicLink() && _is_dir(full);
946
1005
  if (isDir2) {
947
1006
  dirNames.push(dirent.name);
@@ -954,13 +1013,13 @@ function _walk_skill_files(skill_dir) {
954
1013
  if (_is_excluded(rel_parts)) {
955
1014
  continue;
956
1015
  }
957
- out.push([path4.join(root, fname), rel_parts]);
1016
+ out.push([path5.join(root, fname), rel_parts]);
958
1017
  }
959
1018
  for (const dname of dirNames) {
960
1019
  if (_is_excluded([dname])) {
961
1020
  continue;
962
1021
  }
963
- walk(path4.join(root, dname), [...relRoot, dname]);
1022
+ walk(path5.join(root, dname), [...relRoot, dname]);
964
1023
  }
965
1024
  };
966
1025
  walk(resolved, []);
@@ -973,53 +1032,53 @@ function _manifest_digest(files) {
973
1032
  const rel = rel_parts.join("/");
974
1033
  h.update(Buffer.from(rel, "utf-8"));
975
1034
  h.update(Buffer.from([0]));
976
- h.update(crypto2.createHash("sha256").update(fs4.readFileSync(abs_path)).digest());
1035
+ h.update(crypto2.createHash("sha256").update(fs5.readFileSync(abs_path)).digest());
977
1036
  h.update(Buffer.from([0]));
978
1037
  }
979
1038
  return h.digest("hex");
980
1039
  }
981
1040
  function _atomic_write_zip(zip_path, files) {
982
- fs4.mkdirSync(path4.dirname(zip_path), { recursive: true });
983
- const stem = path4.basename(zip_path, path4.extname(zip_path));
984
- const tmp_path = path4.join(
985
- path4.dirname(zip_path),
1041
+ fs5.mkdirSync(path5.dirname(zip_path), { recursive: true });
1042
+ const stem = path5.basename(zip_path, path5.extname(zip_path));
1043
+ const tmp_path = path5.join(
1044
+ path5.dirname(zip_path),
986
1045
  `.${stem}.${crypto2.randomBytes(6).toString("hex")}.zip.tmp`
987
1046
  );
988
1047
  try {
989
1048
  const entries = files.map(([abs_path, rel_parts]) => ({
990
1049
  name: rel_parts.join("/"),
991
- data: fs4.readFileSync(abs_path)
1050
+ data: fs5.readFileSync(abs_path)
992
1051
  }));
993
- fs4.writeFileSync(tmp_path, zip_write_sync(entries));
994
- fs4.renameSync(tmp_path, zip_path);
1052
+ fs5.writeFileSync(tmp_path, zip_write_sync(entries));
1053
+ fs5.renameSync(tmp_path, zip_path);
995
1054
  } finally {
996
- if (fs4.existsSync(tmp_path)) {
997
- fs4.unlinkSync(tmp_path);
1055
+ if (fs5.existsSync(tmp_path)) {
1056
+ fs5.unlinkSync(tmp_path);
998
1057
  }
999
1058
  }
1000
1059
  }
1001
1060
  function _write_if_changed(dest_dir, slug, files, force, written) {
1002
1061
  const digest = _manifest_digest(files);
1003
- const zip_path = path4.join(dest_dir, `${slug}.zip`);
1004
- const digest_path = path4.join(dest_dir, `${slug}.sha256`);
1005
- const recorded = fs4.existsSync(digest_path) ? fs4.readFileSync(digest_path, "utf-8").trim() : "";
1006
- if (!force && recorded === digest && fs4.existsSync(zip_path)) {
1062
+ const zip_path = path5.join(dest_dir, `${slug}.zip`);
1063
+ const digest_path = path5.join(dest_dir, `${slug}.sha256`);
1064
+ const recorded = fs5.existsSync(digest_path) ? fs5.readFileSync(digest_path, "utf-8").trim() : "";
1065
+ if (!force && recorded === digest && fs5.existsSync(zip_path)) {
1007
1066
  return;
1008
1067
  }
1009
1068
  _atomic_write_zip(zip_path, files);
1010
- fs4.writeFileSync(digest_path, digest + "\n", "utf-8");
1069
+ fs5.writeFileSync(digest_path, digest + "\n", "utf-8");
1011
1070
  written.push(zip_path);
1012
1071
  }
1013
1072
  function build_skill_bundles(package_root, dest_dir, force = false, curation = null) {
1014
- const skills_root = path4.join(package_root, "dist/agent-src", "skills");
1073
+ const skills_root = path5.join(package_root, "dist/agent-src", "skills");
1015
1074
  if (!_is_dir(skills_root)) {
1016
1075
  return [];
1017
1076
  }
1018
- fs4.mkdirSync(dest_dir, { recursive: true });
1077
+ fs5.mkdirSync(dest_dir, { recursive: true });
1019
1078
  const written = [];
1020
- for (const name of fs4.readdirSync(skills_root).sort()) {
1021
- const entry = path4.join(skills_root, name);
1022
- const isSymlink2 = fs4.lstatSync(entry).isSymbolicLink();
1079
+ for (const name of fs5.readdirSync(skills_root).sort()) {
1080
+ const entry = path5.join(skills_root, name);
1081
+ const isSymlink2 = fs5.lstatSync(entry).isSymbolicLink();
1023
1082
  if (!(_is_dir(entry) || isSymlink2)) {
1024
1083
  continue;
1025
1084
  }
@@ -1027,8 +1086,8 @@ function build_skill_bundles(package_root, dest_dir, force = false, curation = n
1027
1086
  if (curation !== null && !curation.includes(skill_name)) {
1028
1087
  continue;
1029
1088
  }
1030
- const skill_md = path4.join(entry, "SKILL.md");
1031
- if (!fs4.existsSync(skill_md)) {
1089
+ const skill_md = path5.join(entry, "SKILL.md");
1090
+ if (!fs5.existsSync(skill_md)) {
1032
1091
  continue;
1033
1092
  }
1034
1093
  const files = _walk_skill_files(entry);
@@ -1040,15 +1099,15 @@ function build_skill_bundles(package_root, dest_dir, force = false, curation = n
1040
1099
  return written;
1041
1100
  }
1042
1101
  function _command_slug(source_file, commands_root) {
1043
- const rel = path4.relative(commands_root, source_file);
1044
- const noExt = rel.slice(0, rel.length - path4.extname(rel).length);
1045
- return noExt.split(path4.sep).join("-");
1102
+ const rel = path5.relative(commands_root, source_file);
1103
+ const noExt = rel.slice(0, rel.length - path5.extname(rel).length);
1104
+ return noExt.split(path5.sep).join("-");
1046
1105
  }
1047
1106
  function _iter_command_files(commands_root) {
1048
1107
  const found = [];
1049
1108
  const walk = (dir) => {
1050
- for (const dirent of fs4.readdirSync(dir, { withFileTypes: true })) {
1051
- const full = path4.join(dir, dirent.name);
1109
+ for (const dirent of fs5.readdirSync(dir, { withFileTypes: true })) {
1110
+ const full = path5.join(dir, dirent.name);
1052
1111
  if (dirent.isDirectory() || dirent.isSymbolicLink() && _is_dir(full)) {
1053
1112
  walk(full);
1054
1113
  } else if (dirent.name.endsWith(".md")) {
@@ -1058,21 +1117,21 @@ function _iter_command_files(commands_root) {
1058
1117
  };
1059
1118
  walk(commands_root);
1060
1119
  found.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
1061
- return found.filter((source_file) => path4.basename(source_file) !== "AGENTS.md");
1120
+ return found.filter((source_file) => path5.basename(source_file) !== "AGENTS.md");
1062
1121
  }
1063
1122
  function build_command_bundles(package_root, dest_dir, force = false, curation = null) {
1064
- const commands_root = path4.join(package_root, "dist/agent-src", "commands");
1123
+ const commands_root = path5.join(package_root, "dist/agent-src", "commands");
1065
1124
  if (!_is_dir(commands_root)) {
1066
1125
  return [];
1067
1126
  }
1068
- const skills_root = path4.join(package_root, "dist/agent-src", "skills");
1127
+ const skills_root = path5.join(package_root, "dist/agent-src", "skills");
1069
1128
  let skill_names = /* @__PURE__ */ new Set();
1070
1129
  if (_is_dir(skills_root)) {
1071
1130
  skill_names = new Set(
1072
- fs4.readdirSync(skills_root).filter((name) => _is_dir(path4.join(skills_root, name)))
1131
+ fs5.readdirSync(skills_root).filter((name) => _is_dir(path5.join(skills_root, name)))
1073
1132
  );
1074
1133
  }
1075
- fs4.mkdirSync(dest_dir, { recursive: true });
1134
+ fs5.mkdirSync(dest_dir, { recursive: true });
1076
1135
  const written = [];
1077
1136
  for (const source_file of _iter_command_files(commands_root)) {
1078
1137
  const slug = _command_slug(source_file, commands_root);
@@ -1082,33 +1141,33 @@ function build_command_bundles(package_root, dest_dir, force = false, curation =
1082
1141
  if (curation !== null && !curation.includes(slug)) {
1083
1142
  continue;
1084
1143
  }
1085
- const files = [[fs4.realpathSync(source_file), ["SKILL.md"]]];
1144
+ const files = [[fs5.realpathSync(source_file), ["SKILL.md"]]];
1086
1145
  _write_if_changed(dest_dir, slug, files, force, written);
1087
1146
  }
1088
1147
  return written;
1089
1148
  }
1090
1149
 
1091
1150
  // src/install/partitionEligibility.ts
1092
- import * as fs6 from "node:fs";
1151
+ import * as fs7 from "node:fs";
1093
1152
  import * as os2 from "node:os";
1094
1153
 
1095
1154
  // src/install/hostLayerFingerprint.ts
1096
1155
  import { createHash as createHash4 } from "node:crypto";
1097
- import * as fs5 from "node:fs";
1098
- import * as path5 from "node:path";
1156
+ import * as fs6 from "node:fs";
1157
+ import * as path6 from "node:path";
1099
1158
  var FINGERPRINT_SCHEMA = 1;
1100
1159
  function collectFiles(dir) {
1101
1160
  const out = [];
1102
1161
  const walk = (d) => {
1103
1162
  let entries;
1104
1163
  try {
1105
- entries = fs5.readdirSync(d, { withFileTypes: true });
1164
+ entries = fs6.readdirSync(d, { withFileTypes: true });
1106
1165
  } catch {
1107
1166
  return;
1108
1167
  }
1109
1168
  const sorted = [...entries].sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0);
1110
1169
  for (const e of sorted) {
1111
- const p = path5.join(d, e.name);
1170
+ const p = path6.join(d, e.name);
1112
1171
  if (e.isDirectory()) {
1113
1172
  walk(p);
1114
1173
  } else if (e.isFile()) {
@@ -1125,10 +1184,10 @@ function fingerprintLayers(layers) {
1125
1184
  for (const layer of layers) {
1126
1185
  h.update(`layer:${layer.label}\0`);
1127
1186
  for (const file of collectFiles(layer.root)) {
1128
- h.update(path5.relative(layer.root, file));
1187
+ h.update(path6.relative(layer.root, file));
1129
1188
  h.update("\0");
1130
1189
  try {
1131
- h.update(fs5.readFileSync(file));
1190
+ h.update(fs6.readFileSync(file));
1132
1191
  } catch {
1133
1192
  h.update("\0unreadable\0");
1134
1193
  }
@@ -1138,11 +1197,11 @@ function fingerprintLayers(layers) {
1138
1197
  return h.digest("hex");
1139
1198
  }
1140
1199
  function hostLayerInputs(userHome) {
1141
- const claude = path5.join(userHome, ".claude");
1200
+ const claude = path6.join(userHome, ".claude");
1142
1201
  return [
1143
- { label: "rules", root: path5.join(claude, "rules") },
1144
- { label: "skills", root: path5.join(claude, "skills") },
1145
- { label: "commands", root: path5.join(claude, "commands") }
1202
+ { label: "rules", root: path6.join(claude, "rules") },
1203
+ { label: "skills", root: path6.join(claude, "skills") },
1204
+ { label: "commands", root: path6.join(claude, "commands") }
1146
1205
  ];
1147
1206
  }
1148
1207
 
@@ -1151,7 +1210,7 @@ var MAINTAINER_WORKSPACE = "agent-config-maintainer";
1151
1210
  function isExclusivelyPackageOnly(source_path) {
1152
1211
  let meta;
1153
1212
  try {
1154
- [meta] = parseFrontmatter(fs6.readFileSync(source_path, "utf-8"));
1213
+ [meta] = parseFrontmatter(fs7.readFileSync(source_path, "utf-8"));
1155
1214
  } catch {
1156
1215
  return false;
1157
1216
  }
@@ -2536,8 +2595,8 @@ var zodToJsonSchema = (schema, options) => {
2536
2595
  };
2537
2596
 
2538
2597
  // src/scripts/_lib/module_detection.ts
2539
- import * as fs7 from "node:fs";
2540
- import * as path6 from "node:path";
2598
+ import * as fs8 from "node:fs";
2599
+ import * as path7 from "node:path";
2541
2600
  var _SKIP_DIRS = /* @__PURE__ */ new Set([".module-template", ".example"]);
2542
2601
  var _RULES = [
2543
2602
  ["app/Modules", "laravel-hmvc", "App\\Modules\\{ModuleName}"],
@@ -2551,14 +2610,14 @@ var _RULES = [
2551
2610
  ];
2552
2611
  function _isDir(p) {
2553
2612
  try {
2554
- return fs7.statSync(p).isDirectory();
2613
+ return fs8.statSync(p).isDirectory();
2555
2614
  } catch {
2556
2615
  return false;
2557
2616
  }
2558
2617
  }
2559
2618
  function _isFile(p) {
2560
2619
  try {
2561
- return fs7.statSync(p).isFile();
2620
+ return fs8.statSync(p).isFile();
2562
2621
  } catch {
2563
2622
  return false;
2564
2623
  }
@@ -2572,13 +2631,13 @@ function _isUpperChar(ch) {
2572
2631
  function _list_module_subdirs(root) {
2573
2632
  let entries;
2574
2633
  try {
2575
- entries = fs7.readdirSync(root).sort();
2634
+ entries = fs8.readdirSync(root).sort();
2576
2635
  } catch {
2577
2636
  return [];
2578
2637
  }
2579
2638
  const out = [];
2580
2639
  for (const name of entries) {
2581
- if (!_isDir(path6.join(root, name))) {
2640
+ if (!_isDir(path7.join(root, name))) {
2582
2641
  continue;
2583
2642
  }
2584
2643
  if (name.startsWith(".")) {
@@ -2600,11 +2659,11 @@ function _score_confidence(stack, root, subdirs) {
2600
2659
  return capitalized.length > 0 ? "high" : "medium";
2601
2660
  }
2602
2661
  if (stack === "node-monorepo") {
2603
- const withPkgJson = subdirs.filter((name) => _isFile(path6.join(root, name, "package.json")));
2662
+ const withPkgJson = subdirs.filter((name) => _isFile(path7.join(root, name, "package.json")));
2604
2663
  return withPkgJson.length > 0 ? "high" : "medium";
2605
2664
  }
2606
2665
  if (stack === "python-src") {
2607
- const withInit = subdirs.filter((name) => _isFile(path6.join(root, name, "__init__.py")));
2666
+ const withInit = subdirs.filter((name) => _isFile(path7.join(root, name, "__init__.py")));
2608
2667
  return withInit.length > 0 ? "high" : "medium";
2609
2668
  }
2610
2669
  if (stack === "go-internal") {
@@ -2616,7 +2675,7 @@ function detect_module_roots(project_root) {
2616
2675
  const high = [];
2617
2676
  const medium = [];
2618
2677
  for (const [rel_path, stack, namespace_template] of _RULES) {
2619
- const abs_path = path6.join(project_root, rel_path);
2678
+ const abs_path = path7.join(project_root, rel_path);
2620
2679
  if (!_isDir(abs_path)) {
2621
2680
  continue;
2622
2681
  }
@@ -2638,7 +2697,7 @@ function detect_module_roots(project_root) {
2638
2697
  }
2639
2698
 
2640
2699
  // src/scripts/_lib/model_tier.ts
2641
- import fs8 from "node:fs";
2700
+ import fs9 from "node:fs";
2642
2701
  var TIER_TO_CLAUDE_MODEL = {
2643
2702
  frontier: "fable",
2644
2703
  high: "opus",
@@ -2647,8 +2706,8 @@ var TIER_TO_CLAUDE_MODEL = {
2647
2706
  };
2648
2707
  var MODEL_TIER_RE = /^model_tier:\s*"?([a-z]+)"?\s*$/m;
2649
2708
  function read_model_tier(skill_md) {
2650
- if (!fs8.existsSync(skill_md)) return null;
2651
- const text = fs8.readFileSync(skill_md).toString("utf-8");
2709
+ if (!fs9.existsSync(skill_md)) return null;
2710
+ const text = fs9.readFileSync(skill_md).toString("utf-8");
2652
2711
  if (!text.startsWith("---\n")) return null;
2653
2712
  const end = text.indexOf("\n---\n", 4);
2654
2713
  if (end === -1) return null;
@@ -2682,34 +2741,34 @@ var ArgparseExit = class extends Error {
2682
2741
  function expanduser2(p) {
2683
2742
  if (p === "~") return os3.homedir();
2684
2743
  if (p.startsWith("~/") || p.startsWith("~\\")) {
2685
- return path7.join(os3.homedir(), p.slice(2));
2744
+ return path8.join(os3.homedir(), p.slice(2));
2686
2745
  }
2687
2746
  return p;
2688
2747
  }
2689
2748
  function resolvePath(p) {
2690
2749
  try {
2691
- return fs9.realpathSync(path7.resolve(p));
2750
+ return fs10.realpathSync(path8.resolve(p));
2692
2751
  } catch {
2693
- return path7.resolve(p);
2752
+ return path8.resolve(p);
2694
2753
  }
2695
2754
  }
2696
2755
  function isFile(p) {
2697
2756
  try {
2698
- return fs9.statSync(p).isFile();
2757
+ return fs10.statSync(p).isFile();
2699
2758
  } catch {
2700
2759
  return false;
2701
2760
  }
2702
2761
  }
2703
2762
  function isDir(p) {
2704
2763
  try {
2705
- return fs9.statSync(p).isDirectory();
2764
+ return fs10.statSync(p).isDirectory();
2706
2765
  } catch {
2707
2766
  return false;
2708
2767
  }
2709
2768
  }
2710
2769
  function pathExists(p) {
2711
2770
  try {
2712
- fs9.statSync(p);
2771
+ fs10.statSync(p);
2713
2772
  return true;
2714
2773
  } catch {
2715
2774
  return false;
@@ -2717,24 +2776,24 @@ function pathExists(p) {
2717
2776
  }
2718
2777
  function isSymlink(p) {
2719
2778
  try {
2720
- return fs9.lstatSync(p).isSymbolicLink();
2779
+ return fs10.lstatSync(p).isSymbolicLink();
2721
2780
  } catch {
2722
2781
  return false;
2723
2782
  }
2724
2783
  }
2725
2784
  function readText(p) {
2726
- return fs9.readFileSync(p, "utf-8");
2785
+ return fs10.readFileSync(p, "utf-8");
2727
2786
  }
2728
2787
  function writeText(p, content) {
2729
- fs9.writeFileSync(p, content, "utf-8");
2788
+ fs10.writeFileSync(p, content, "utf-8");
2730
2789
  }
2731
2790
  function mkdirp(p) {
2732
- fs9.mkdirSync(p, { recursive: true });
2791
+ fs10.mkdirSync(p, { recursive: true });
2733
2792
  }
2734
2793
  function sortedGlobStems(directory, suffix) {
2735
2794
  let entries;
2736
2795
  try {
2737
- entries = fs9.readdirSync(directory);
2796
+ entries = fs10.readdirSync(directory);
2738
2797
  } catch {
2739
2798
  return [];
2740
2799
  }
@@ -2754,7 +2813,7 @@ function sortedGlobStems(directory, suffix) {
2754
2813
  function countZips(directory) {
2755
2814
  if (!isDir(directory)) return 0;
2756
2815
  let n = 0;
2757
- for (const name of fs9.readdirSync(directory)) {
2816
+ for (const name of fs10.readdirSync(directory)) {
2758
2817
  if (name.endsWith(".zip")) n += 1;
2759
2818
  }
2760
2819
  return n;
@@ -2762,35 +2821,35 @@ function countZips(directory) {
2762
2821
  function sha256OfFile(p) {
2763
2822
  let data;
2764
2823
  try {
2765
- data = fs9.readFileSync(p);
2824
+ data = fs10.readFileSync(p);
2766
2825
  } catch {
2767
2826
  return null;
2768
2827
  }
2769
2828
  return crypto3.createHash("sha256").update(data).digest("hex");
2770
2829
  }
2771
2830
  function atomicWrite0644(target, body, prefix) {
2772
- const dir = path7.dirname(target);
2773
- const tmpName = path7.join(
2831
+ const dir = path8.dirname(target);
2832
+ const tmpName = path8.join(
2774
2833
  dir,
2775
2834
  `${prefix}${process2.pid}.${crypto3.randomBytes(6).toString("hex")}.yml.tmp`
2776
2835
  );
2777
2836
  let fd = null;
2778
2837
  try {
2779
- fd = fs9.openSync(tmpName, "wx", 420);
2780
- fs9.writeFileSync(fd, body, "utf-8");
2781
- fs9.closeSync(fd);
2838
+ fd = fs10.openSync(tmpName, "wx", 420);
2839
+ fs10.writeFileSync(fd, body, "utf-8");
2840
+ fs10.closeSync(fd);
2782
2841
  fd = null;
2783
- fs9.chmodSync(tmpName, 420);
2784
- fs9.renameSync(tmpName, target);
2842
+ fs10.chmodSync(tmpName, 420);
2843
+ fs10.renameSync(tmpName, target);
2785
2844
  } catch (err) {
2786
2845
  if (fd !== null) {
2787
2846
  try {
2788
- fs9.closeSync(fd);
2847
+ fs10.closeSync(fd);
2789
2848
  } catch {
2790
2849
  }
2791
2850
  }
2792
2851
  try {
2793
- fs9.unlinkSync(tmpName);
2852
+ fs10.unlinkSync(tmpName);
2794
2853
  } catch {
2795
2854
  }
2796
2855
  throw err;
@@ -2914,12 +2973,12 @@ var LEGACY_SETTINGS_FILE = ".agent-settings";
2914
2973
  var LEGACY_BACKUP_FILE = ".agent-settings.backup.key-value";
2915
2974
  var SETTINGS_SUBDIR = ["agents", "settings"];
2916
2975
  function _canonical_settings_target(project_root) {
2917
- return path7.join(project_root, ...SETTINGS_SUBDIR, SETTINGS_FILE);
2976
+ return path8.join(project_root, ...SETTINGS_SUBDIR, SETTINGS_FILE);
2918
2977
  }
2919
2978
  function _resolve_settings_read(project_root) {
2920
2979
  const canonical = _canonical_settings_target(project_root);
2921
2980
  if (pathExists(canonical)) return canonical;
2922
- const legacy = path7.join(project_root, SETTINGS_FILE);
2981
+ const legacy = path8.join(project_root, SETTINGS_FILE);
2923
2982
  if (pathExists(legacy)) return legacy;
2924
2983
  return canonical;
2925
2984
  }
@@ -2983,9 +3042,9 @@ function fail(msg) {
2983
3042
  throw new SystemExitError(1);
2984
3043
  }
2985
3044
  function detect_package_root(project_root) {
2986
- const npm_path = path7.join(project_root, "node_modules", "@event4u", "agent-config");
3045
+ const npm_path = path8.join(project_root, "node_modules", "@event4u", "agent-config");
2987
3046
  if (isDir(npm_path)) return resolvePath(npm_path);
2988
- if (pathExists(path7.join(project_root, "src", "config", "profiles", "minimal.ini"))) {
3047
+ if (pathExists(path8.join(project_root, "src", "config", "profiles", "minimal.ini"))) {
2989
3048
  return project_root;
2990
3049
  }
2991
3050
  fail(
@@ -2993,12 +3052,12 @@ function detect_package_root(project_root) {
2993
3052
  );
2994
3053
  }
2995
3054
  function detect_package_type(package_root) {
2996
- if (package_root.split(path7.sep).includes("node_modules")) return "npm";
3055
+ if (package_root.split(path8.sep).includes("node_modules")) return "npm";
2997
3056
  return "local";
2998
3057
  }
2999
3058
  function detect_package_type_for_project(project_root, package_root) {
3000
3059
  const npm_path = resolvePath(
3001
- path7.join(project_root, "node_modules", "@event4u", "agent-config")
3060
+ path8.join(project_root, "node_modules", "@event4u", "agent-config")
3002
3061
  );
3003
3062
  const package_resolved = resolvePath(package_root);
3004
3063
  if (package_resolved === npm_path) return "npm";
@@ -3018,7 +3077,7 @@ function ensure_directory(p) {
3018
3077
  mkdirp(p);
3019
3078
  }
3020
3079
  function write_file(p, content) {
3021
- ensure_directory(path7.dirname(p));
3080
+ ensure_directory(path8.dirname(p));
3022
3081
  writeText(p, content);
3023
3082
  }
3024
3083
  function read_json_file(p) {
@@ -3189,7 +3248,7 @@ function _append_unknown_legacy(rendered, legacy_values, unknown_keys) {
3189
3248
  return rendered + "\n" + suffix;
3190
3249
  }
3191
3250
  function _migrate_legacy_if_present(project_root, template_body) {
3192
- const legacy_target = path7.join(project_root, LEGACY_SETTINGS_FILE);
3251
+ const legacy_target = path8.join(project_root, LEGACY_SETTINGS_FILE);
3193
3252
  if (!isFile(legacy_target)) return null;
3194
3253
  const legacy_text = readText(legacy_target);
3195
3254
  const [values, unknown] = _parse_legacy_settings(legacy_text);
@@ -3204,9 +3263,9 @@ function _migrate_legacy_if_present(project_root, template_body) {
3204
3263
  }
3205
3264
  }
3206
3265
  rendered = _append_unknown_legacy(rendered, values, unknown);
3207
- const backup_target = path7.join(project_root, LEGACY_BACKUP_FILE);
3266
+ const backup_target = path8.join(project_root, LEGACY_BACKUP_FILE);
3208
3267
  writeText(backup_target, legacy_text);
3209
- fs9.unlinkSync(legacy_target);
3268
+ fs10.unlinkSync(legacy_target);
3210
3269
  info(`Migrated legacy ${LEGACY_SETTINGS_FILE} \u2192 ${SETTINGS_FILE}`);
3211
3270
  info(`Backup saved to ${LEGACY_BACKUP_FILE}`);
3212
3271
  if (unknown.length > 0) {
@@ -3241,7 +3300,7 @@ function _render_template(template, profile_values) {
3241
3300
  return body;
3242
3301
  }
3243
3302
  function _load_valid_user_types(package_root) {
3244
- const directory = path7.join(package_root, USER_TYPES_DIR);
3303
+ const directory = path8.join(package_root, USER_TYPES_DIR);
3245
3304
  if (!isDir(directory)) return [];
3246
3305
  return sortedGlobStems(directory, ".yml");
3247
3306
  }
@@ -3298,8 +3357,8 @@ function splitlinesKeepends(text) {
3298
3357
  }
3299
3358
  function ensure_agent_settings(project_root, package_root, profile, force, user_type = "", packs = null) {
3300
3359
  const target = _canonical_settings_target(project_root);
3301
- const profile_source = path7.join(package_root, "src", "config", "profiles", `${profile}.ini`);
3302
- const template_source = path7.join(package_root, "src", "config", "agent-settings.template.yml");
3360
+ const profile_source = path8.join(package_root, "src", "config", "profiles", `${profile}.ini`);
3361
+ const template_source = path8.join(package_root, "src", "config", "agent-settings.template.yml");
3303
3362
  if (!pathExists(profile_source)) fail(`Missing profile preset: ${profile_source}`);
3304
3363
  if (!pathExists(template_source)) fail(`Missing settings template: ${template_source}`);
3305
3364
  const template = readText(template_source);
@@ -3313,21 +3372,21 @@ function ensure_agent_settings(project_root, package_root, profile, force, user_
3313
3372
  if (profile_values["rule_loading_tier"] !== profile) {
3314
3373
  const got = "rule_loading_tier" in profile_values ? `'${profile_values["rule_loading_tier"]}'` : "None";
3315
3374
  fail(
3316
- `Profile preset ${path7.basename(profile_source)} has rule_loading_tier=${got} but --profile=${profile}`
3375
+ `Profile preset ${path8.basename(profile_source)} has rule_loading_tier=${got} but --profile=${profile}`
3317
3376
  );
3318
3377
  }
3319
3378
  profile_values["user_type"] = _validate_user_type(package_root, user_type);
3320
3379
  let template_body = _render_template(template, profile_values);
3321
3380
  template_body = _inject_packs(template_body, packs ?? []);
3322
- const legacy_root = path7.join(project_root, SETTINGS_FILE);
3381
+ const legacy_root = path8.join(project_root, SETTINGS_FILE);
3323
3382
  if (isFile(legacy_root) && !pathExists(target)) {
3324
- mkdirp(path7.dirname(target));
3383
+ mkdirp(path8.dirname(target));
3325
3384
  writeText(target, readText(legacy_root));
3326
- fs9.unlinkSync(legacy_root);
3385
+ fs10.unlinkSync(legacy_root);
3327
3386
  success(`Migrated ${SETTINGS_FILE} \u2192 agents/settings/${SETTINGS_FILE} (ADR-038)`);
3328
3387
  return;
3329
3388
  }
3330
- const legacy_target = path7.join(project_root, LEGACY_SETTINGS_FILE);
3389
+ const legacy_target = path8.join(project_root, LEGACY_SETTINGS_FILE);
3331
3390
  if (isFile(legacy_target) && pathExists(target)) {
3332
3391
  warn(
3333
3392
  `Both ${SETTINGS_FILE} and legacy ${LEGACY_SETTINGS_FILE} exist. Skipping migration to avoid overwriting ${SETTINGS_FILE}. Delete one of them manually and re-run.`
@@ -3344,7 +3403,7 @@ function ensure_agent_settings(project_root, package_root, profile, force, user_
3344
3403
  skip(`${SETTINGS_FILE} already exists`);
3345
3404
  return;
3346
3405
  }
3347
- mkdirp(path7.dirname(target));
3406
+ mkdirp(path8.dirname(target));
3348
3407
  write_file(target, template_body);
3349
3408
  const user_type_value = profile_values["user_type"] ?? "";
3350
3409
  const suffix = user_type_value ? `, user_type=${user_type_value}` : "";
@@ -3357,7 +3416,7 @@ function ensure_vscode_bridge(project_root, package_type, force) {
3357
3416
  const plugin_path = plugin_paths[package_type] ?? "./plugin/agent-config";
3358
3417
  const bridge = { "chat.pluginLocations": { [plugin_path]: true } };
3359
3418
  return merge_json_file(
3360
- path7.join(project_root, ".vscode", "settings.json"),
3419
+ path8.join(project_root, ".vscode", "settings.json"),
3361
3420
  bridge,
3362
3421
  force,
3363
3422
  ".vscode/settings.json"
@@ -3366,14 +3425,14 @@ function ensure_vscode_bridge(project_root, package_type, force) {
3366
3425
  function ensure_augment_bridge(project_root, force) {
3367
3426
  const bridge = { enabledPlugins: { "agent-config@event4u": true } };
3368
3427
  return merge_json_file(
3369
- path7.join(project_root, ".augment", "settings.json"),
3428
+ path8.join(project_root, ".augment", "settings.json"),
3370
3429
  bridge,
3371
3430
  force,
3372
3431
  ".augment/settings.json"
3373
3432
  );
3374
3433
  }
3375
- var AUGMENT_USER_DIR = path7.join(os3.homedir(), ".augment");
3376
- var AUGMENT_USER_HOOKS_DIR = path7.join(AUGMENT_USER_DIR, "hooks");
3434
+ var AUGMENT_USER_DIR = path8.join(os3.homedir(), ".augment");
3435
+ var AUGMENT_USER_HOOKS_DIR = path8.join(AUGMENT_USER_DIR, "hooks");
3377
3436
  var AUGMENT_DISPATCHER_TRAMPOLINE = "augment-dispatcher.sh";
3378
3437
  var AUGMENT_LEGACY_TRAMPOLINES = [
3379
3438
  "augment-chat-history.sh",
@@ -3389,29 +3448,29 @@ var AUGMENT_DISPATCHER_BINDINGS = [
3389
3448
  ["post_tool_use", "PostToolUse"]
3390
3449
  ];
3391
3450
  function _deploy_augment_trampoline(package_root, name, force) {
3392
- const src = path7.join(package_root, "scripts", "hooks", name);
3451
+ const src = path8.join(package_root, "scripts", "hooks", name);
3393
3452
  if (!pathExists(src)) {
3394
3453
  skip(`augment trampoline missing in package: ${src}`);
3395
3454
  return null;
3396
3455
  }
3397
3456
  mkdirp(AUGMENT_USER_HOOKS_DIR);
3398
- const dst = path7.join(AUGMENT_USER_HOOKS_DIR, name);
3457
+ const dst = path8.join(AUGMENT_USER_HOOKS_DIR, name);
3399
3458
  const src_text = readText(src);
3400
3459
  if (pathExists(dst) && readText(dst) === src_text && !force) {
3401
3460
  skip(`~/.augment/hooks/${name} already up to date`);
3402
3461
  } else {
3403
3462
  writeText(dst, src_text);
3404
- fs9.chmodSync(dst, 493);
3463
+ fs10.chmodSync(dst, 493);
3405
3464
  success(`~/.augment/hooks/${name} installed`);
3406
3465
  }
3407
3466
  return dst;
3408
3467
  }
3409
3468
  function _remove_legacy_augment_trampolines() {
3410
3469
  for (const name of AUGMENT_LEGACY_TRAMPOLINES) {
3411
- const legacy = path7.join(AUGMENT_USER_HOOKS_DIR, name);
3470
+ const legacy = path8.join(AUGMENT_USER_HOOKS_DIR, name);
3412
3471
  try {
3413
3472
  if (isFile(legacy)) {
3414
- fs9.unlinkSync(legacy);
3473
+ fs10.unlinkSync(legacy);
3415
3474
  skip(`removed legacy ~/.augment/hooks/${name}`);
3416
3475
  }
3417
3476
  } catch (err) {
@@ -3431,7 +3490,7 @@ function ensure_augment_user_hooks(package_root, force) {
3431
3490
  }
3432
3491
  const settings_patch = { hooks: per_event };
3433
3492
  return merge_json_file(
3434
- path7.join(AUGMENT_USER_DIR, "settings.json"),
3493
+ path8.join(AUGMENT_USER_DIR, "settings.json"),
3435
3494
  settings_patch,
3436
3495
  force,
3437
3496
  "~/.augment/settings.json"
@@ -3456,7 +3515,7 @@ function _heal_legacy_claude_plugin_ids(p) {
3456
3515
  return removed;
3457
3516
  }
3458
3517
  function ensure_claude_bridge(project_root, force) {
3459
- const target = path7.join(project_root, ".claude", "settings.json");
3518
+ const target = path8.join(project_root, ".claude", "settings.json");
3460
3519
  const healed = _heal_legacy_claude_plugin_ids(target);
3461
3520
  for (const pid of healed) {
3462
3521
  success(`.claude/settings.json: removed stale plugin id \`${pid}\``);
@@ -3464,6 +3523,8 @@ function ensure_claude_bridge(project_root, force) {
3464
3523
  const bridge = { enabledPlugins: { [CLAUDE_PLUGIN_ID]: true } };
3465
3524
  return merge_json_file(target, bridge, force || healed.length > 0, ".claude/settings.json");
3466
3525
  }
3526
+ var ensure_mcp_bridge = makeEnsureMcpBridge(merge_json_file);
3527
+ var _tier_b_advisory = tierBAdvisory;
3467
3528
  var CURSOR_DISPATCHER_BINDINGS = [
3468
3529
  ["session_start", "sessionStart"],
3469
3530
  ["session_end", "sessionEnd"],
@@ -3481,29 +3542,29 @@ function ensure_cursor_bridge(project_root, force) {
3481
3542
  }
3482
3543
  const bridge = { version: 1, hooks };
3483
3544
  return merge_json_file(
3484
- path7.join(project_root, ".cursor", "hooks.json"),
3545
+ path8.join(project_root, ".cursor", "hooks.json"),
3485
3546
  bridge,
3486
3547
  force,
3487
3548
  ".cursor/hooks.json"
3488
3549
  );
3489
3550
  }
3490
- var CURSOR_USER_DIR = path7.join(os3.homedir(), ".cursor");
3491
- var CURSOR_USER_HOOKS_DIR = path7.join(CURSOR_USER_DIR, "hooks");
3551
+ var CURSOR_USER_DIR = path8.join(os3.homedir(), ".cursor");
3552
+ var CURSOR_USER_HOOKS_DIR = path8.join(CURSOR_USER_DIR, "hooks");
3492
3553
  var CURSOR_DISPATCHER_TRAMPOLINE = "cursor-dispatcher.sh";
3493
3554
  function ensure_cursor_user_hooks(package_root, force) {
3494
- const src = path7.join(package_root, "scripts", "hooks", CURSOR_DISPATCHER_TRAMPOLINE);
3555
+ const src = path8.join(package_root, "scripts", "hooks", CURSOR_DISPATCHER_TRAMPOLINE);
3495
3556
  if (!pathExists(src)) {
3496
3557
  skip(`cursor trampoline missing in package: ${src}`);
3497
3558
  return [];
3498
3559
  }
3499
3560
  mkdirp(CURSOR_USER_HOOKS_DIR);
3500
- const dst = path7.join(CURSOR_USER_HOOKS_DIR, CURSOR_DISPATCHER_TRAMPOLINE);
3561
+ const dst = path8.join(CURSOR_USER_HOOKS_DIR, CURSOR_DISPATCHER_TRAMPOLINE);
3501
3562
  const src_text = readText(src);
3502
3563
  if (pathExists(dst) && readText(dst) === src_text && !force) {
3503
3564
  skip(`~/.cursor/hooks/${CURSOR_DISPATCHER_TRAMPOLINE} already up to date`);
3504
3565
  } else {
3505
3566
  writeText(dst, src_text);
3506
- fs9.chmodSync(dst, 493);
3567
+ fs10.chmodSync(dst, 493);
3507
3568
  success(`~/.cursor/hooks/${CURSOR_DISPATCHER_TRAMPOLINE} installed`);
3508
3569
  }
3509
3570
  const hooks = {};
@@ -3512,7 +3573,7 @@ function ensure_cursor_user_hooks(package_root, force) {
3512
3573
  }
3513
3574
  const settings_patch = { version: 1, hooks };
3514
3575
  return merge_json_file(
3515
- path7.join(CURSOR_USER_DIR, "hooks.json"),
3576
+ path8.join(CURSOR_USER_DIR, "hooks.json"),
3516
3577
  settings_patch,
3517
3578
  force,
3518
3579
  "~/.cursor/hooks.json"
@@ -3555,12 +3616,12 @@ exit 0
3555
3616
  `;
3556
3617
  }
3557
3618
  function ensure_cline_bridge(project_root, force) {
3558
- const hooks_dir = path7.join(project_root, ".clinerules", "hooks");
3619
+ const hooks_dir = path8.join(project_root, ".clinerules", "hooks");
3559
3620
  mkdirp(hooks_dir);
3560
3621
  const workspace_quoted = shlexQuote(resolvePath(project_root));
3561
3622
  let written = 0;
3562
3623
  for (const [ac_event, native_event] of CLINE_DISPATCHER_BINDINGS) {
3563
- const target = path7.join(hooks_dir, native_event);
3624
+ const target = path8.join(hooks_dir, native_event);
3564
3625
  const body = clineProjectHookBody(native_event, ac_event, workspace_quoted);
3565
3626
  if (pathExists(target) && readText(target) === body && !force) {
3566
3627
  continue;
@@ -3570,7 +3631,7 @@ function ensure_cline_bridge(project_root, force) {
3570
3631
  continue;
3571
3632
  }
3572
3633
  writeText(target, body);
3573
- fs9.chmodSync(target, 493);
3634
+ fs10.chmodSync(target, 493);
3574
3635
  written += 1;
3575
3636
  }
3576
3637
  if (written) {
@@ -3579,27 +3640,27 @@ function ensure_cline_bridge(project_root, force) {
3579
3640
  skip(".clinerules/hooks/ already up to date");
3580
3641
  }
3581
3642
  }
3582
- var CLINE_USER_DIR = path7.join(os3.homedir(), "Documents", "Cline", "Hooks");
3643
+ var CLINE_USER_DIR = path8.join(os3.homedir(), "Documents", "Cline", "Hooks");
3583
3644
  var CLINE_DISPATCHER_TRAMPOLINE = "cline-dispatcher.sh";
3584
3645
  function ensure_cline_user_hooks(package_root, force) {
3585
- const src = path7.join(package_root, "scripts", "hooks", CLINE_DISPATCHER_TRAMPOLINE);
3646
+ const src = path8.join(package_root, "scripts", "hooks", CLINE_DISPATCHER_TRAMPOLINE);
3586
3647
  if (!pathExists(src)) {
3587
3648
  skip(`cline trampoline missing in package: ${src}`);
3588
3649
  return;
3589
3650
  }
3590
3651
  mkdirp(CLINE_USER_DIR);
3591
- const trampoline = path7.join(CLINE_USER_DIR, CLINE_DISPATCHER_TRAMPOLINE);
3652
+ const trampoline = path8.join(CLINE_USER_DIR, CLINE_DISPATCHER_TRAMPOLINE);
3592
3653
  const src_text = readText(src);
3593
3654
  if (pathExists(trampoline) && readText(trampoline) === src_text && !force) {
3594
3655
  skip(`~/Documents/Cline/Hooks/${CLINE_DISPATCHER_TRAMPOLINE} already up to date`);
3595
3656
  } else {
3596
3657
  writeText(trampoline, src_text);
3597
- fs9.chmodSync(trampoline, 493);
3658
+ fs10.chmodSync(trampoline, 493);
3598
3659
  success(`~/Documents/Cline/Hooks/${CLINE_DISPATCHER_TRAMPOLINE} installed`);
3599
3660
  }
3600
3661
  const trampoline_quoted = shlexQuote(trampoline);
3601
3662
  for (const [ac_event, native_event] of CLINE_DISPATCHER_BINDINGS) {
3602
- const wrapper = path7.join(CLINE_USER_DIR, native_event);
3663
+ const wrapper = path8.join(CLINE_USER_DIR, native_event);
3603
3664
  const body = `#!/usr/bin/env bash
3604
3665
  # Generated by event4u/agent-config install.py \u2014 DO NOT EDIT.
3605
3666
  # User-scope Cline hook for ${native_event} \u2192 agent-config ${ac_event}.
@@ -3609,7 +3670,7 @@ exec ${trampoline_quoted} ${ac_event} ${native_event}
3609
3670
  continue;
3610
3671
  }
3611
3672
  writeText(wrapper, body);
3612
- fs9.chmodSync(wrapper, 493);
3673
+ fs10.chmodSync(wrapper, 493);
3613
3674
  }
3614
3675
  }
3615
3676
  var WINDSURF_DISPATCHER_BINDINGS = [
@@ -3630,29 +3691,29 @@ function ensure_windsurf_bridge(project_root, force) {
3630
3691
  }
3631
3692
  const bridge = { hooks };
3632
3693
  return merge_json_file(
3633
- path7.join(project_root, ".windsurf", "hooks.json"),
3694
+ path8.join(project_root, ".windsurf", "hooks.json"),
3634
3695
  bridge,
3635
3696
  force,
3636
3697
  ".windsurf/hooks.json"
3637
3698
  );
3638
3699
  }
3639
- var WINDSURF_USER_DIR = path7.join(os3.homedir(), ".codeium", "windsurf");
3640
- var WINDSURF_USER_HOOKS_DIR = path7.join(WINDSURF_USER_DIR, "hooks");
3700
+ var WINDSURF_USER_DIR = path8.join(os3.homedir(), ".codeium", "windsurf");
3701
+ var WINDSURF_USER_HOOKS_DIR = path8.join(WINDSURF_USER_DIR, "hooks");
3641
3702
  var WINDSURF_DISPATCHER_TRAMPOLINE = "windsurf-dispatcher.sh";
3642
3703
  function ensure_windsurf_user_hooks(package_root, force) {
3643
- const src = path7.join(package_root, "scripts", "hooks", WINDSURF_DISPATCHER_TRAMPOLINE);
3704
+ const src = path8.join(package_root, "scripts", "hooks", WINDSURF_DISPATCHER_TRAMPOLINE);
3644
3705
  if (!pathExists(src)) {
3645
3706
  skip(`windsurf trampoline missing in package: ${src}`);
3646
3707
  return [];
3647
3708
  }
3648
3709
  mkdirp(WINDSURF_USER_HOOKS_DIR);
3649
- const dst = path7.join(WINDSURF_USER_HOOKS_DIR, WINDSURF_DISPATCHER_TRAMPOLINE);
3710
+ const dst = path8.join(WINDSURF_USER_HOOKS_DIR, WINDSURF_DISPATCHER_TRAMPOLINE);
3650
3711
  const src_text = readText(src);
3651
3712
  if (pathExists(dst) && readText(dst) === src_text && !force) {
3652
3713
  skip(`~/.codeium/windsurf/hooks/${WINDSURF_DISPATCHER_TRAMPOLINE} already up to date`);
3653
3714
  } else {
3654
3715
  writeText(dst, src_text);
3655
- fs9.chmodSync(dst, 493);
3716
+ fs10.chmodSync(dst, 493);
3656
3717
  success(`~/.codeium/windsurf/hooks/${WINDSURF_DISPATCHER_TRAMPOLINE} installed`);
3657
3718
  }
3658
3719
  const hooks = {};
@@ -3664,7 +3725,7 @@ function ensure_windsurf_user_hooks(package_root, force) {
3664
3725
  }
3665
3726
  const settings_patch = { hooks };
3666
3727
  return merge_json_file(
3667
- path7.join(WINDSURF_USER_DIR, "hooks.json"),
3728
+ path8.join(WINDSURF_USER_DIR, "hooks.json"),
3668
3729
  settings_patch,
3669
3730
  force,
3670
3731
  "~/.codeium/windsurf/hooks.json"
@@ -3693,43 +3754,43 @@ function _gemini_hooks_dict(command_factory) {
3693
3754
  function ensure_gemini_bridge(project_root, force) {
3694
3755
  const bridge = { hooks: _gemini_hooks_dict(_gemini_dispatch_command) };
3695
3756
  return merge_json_file(
3696
- path7.join(project_root, ".gemini", "settings.json"),
3757
+ path8.join(project_root, ".gemini", "settings.json"),
3697
3758
  bridge,
3698
3759
  force,
3699
3760
  ".gemini/settings.json"
3700
3761
  );
3701
3762
  }
3702
- var GEMINI_USER_DIR = path7.join(os3.homedir(), ".gemini");
3703
- var GEMINI_USER_HOOKS_DIR = path7.join(GEMINI_USER_DIR, "hooks");
3763
+ var GEMINI_USER_DIR = path8.join(os3.homedir(), ".gemini");
3764
+ var GEMINI_USER_HOOKS_DIR = path8.join(GEMINI_USER_DIR, "hooks");
3704
3765
  var GEMINI_DISPATCHER_TRAMPOLINE = "gemini-dispatcher.sh";
3705
3766
  function ensure_gemini_user_hooks(package_root, force) {
3706
- const src = path7.join(package_root, "scripts", "hooks", GEMINI_DISPATCHER_TRAMPOLINE);
3767
+ const src = path8.join(package_root, "scripts", "hooks", GEMINI_DISPATCHER_TRAMPOLINE);
3707
3768
  if (!pathExists(src)) {
3708
3769
  skip(`gemini trampoline missing in package: ${src}`);
3709
3770
  return [];
3710
3771
  }
3711
3772
  mkdirp(GEMINI_USER_HOOKS_DIR);
3712
- const dst = path7.join(GEMINI_USER_HOOKS_DIR, GEMINI_DISPATCHER_TRAMPOLINE);
3773
+ const dst = path8.join(GEMINI_USER_HOOKS_DIR, GEMINI_DISPATCHER_TRAMPOLINE);
3713
3774
  const src_text = readText(src);
3714
3775
  if (pathExists(dst) && readText(dst) === src_text && !force) {
3715
3776
  skip(`~/.gemini/hooks/${GEMINI_DISPATCHER_TRAMPOLINE} already up to date`);
3716
3777
  } else {
3717
3778
  writeText(dst, src_text);
3718
- fs9.chmodSync(dst, 493);
3779
+ fs10.chmodSync(dst, 493);
3719
3780
  success(`~/.gemini/hooks/${GEMINI_DISPATCHER_TRAMPOLINE} installed`);
3720
3781
  }
3721
3782
  const settings_patch = {
3722
3783
  hooks: _gemini_hooks_dict((ac_event, native) => `${dst} ${ac_event} ${native}`)
3723
3784
  };
3724
3785
  return merge_json_file(
3725
- path7.join(GEMINI_USER_DIR, "settings.json"),
3786
+ path8.join(GEMINI_USER_DIR, "settings.json"),
3726
3787
  settings_patch,
3727
3788
  force,
3728
3789
  "~/.gemini/settings.json"
3729
3790
  );
3730
3791
  }
3731
3792
  function ensure_copilot_bridge(project_root, force) {
3732
- const target = path7.join(project_root, ".github", "plugin", "marketplace.json");
3793
+ const target = path8.join(project_root, ".github", "plugin", "marketplace.json");
3733
3794
  const bridge = {
3734
3795
  marketplace: {
3735
3796
  name: "event4u-agent-marketplace",
@@ -3772,7 +3833,7 @@ See \`docs/setup/per-ide/roocode.md\` for the full activation guide.
3772
3833
  Run \`./agent-config --help\` for available commands.
3773
3834
  `;
3774
3835
  function ensure_roocode_bridge(project_root, force) {
3775
- const target = path7.join(project_root, ".roo", "rules", "agent-config.md");
3836
+ const target = path8.join(project_root, ".roo", "rules", "agent-config.md");
3776
3837
  if (pathExists(target) && !force) {
3777
3838
  skip(".roo/rules/agent-config.md already exists");
3778
3839
  return;
@@ -3794,7 +3855,7 @@ To wire Claude Desktop to this project's rules, run:
3794
3855
  Canonical rule and skill source: \`.augment/\` (see \`AGENTS.md\`).
3795
3856
  `;
3796
3857
  function ensure_claude_desktop_bridge(project_root, force) {
3797
- const target = path7.join(project_root, ".claude-desktop", "agent-config.md");
3858
+ const target = path8.join(project_root, ".claude-desktop", "agent-config.md");
3798
3859
  if (pathExists(target) && !force) {
3799
3860
  skip(".claude-desktop/agent-config.md already exists");
3800
3861
  return;
@@ -3819,7 +3880,7 @@ Or pass \`--read .aider/agent-config.md\` on the command line.
3819
3880
  Canonical rule and skill source: \`.augment/\` (see \`AGENTS.md\`).
3820
3881
  `;
3821
3882
  function ensure_aider_bridge(project_root, force) {
3822
- const target = path7.join(project_root, ".aider", "agent-config.md");
3883
+ const target = path8.join(project_root, ".aider", "agent-config.md");
3823
3884
  if (pathExists(target) && !force) {
3824
3885
  skip(".aider/agent-config.md already exists");
3825
3886
  return;
@@ -3838,7 +3899,7 @@ developers where the rules and skills live.
3838
3899
  Canonical rule and skill source: \`.augment/\` (see project \`AGENTS.md\`).
3839
3900
  `;
3840
3901
  function ensure_codex_bridge(project_root, force) {
3841
- const target = path7.join(project_root, ".codex", "agent-config.md");
3902
+ const target = path8.join(project_root, ".codex", "agent-config.md");
3842
3903
  if (pathExists(target) && !force) {
3843
3904
  skip(".codex/agent-config.md already exists");
3844
3905
  return;
@@ -3856,7 +3917,7 @@ rules per session. The canonical rule and skill source lives under
3856
3917
  orientation).
3857
3918
  `;
3858
3919
  function ensure_continue_bridge(project_root, force) {
3859
- const target = path7.join(project_root, ".continue", "rules", "agent-config.md");
3920
+ const target = path8.join(project_root, ".continue", "rules", "agent-config.md");
3860
3921
  if (pathExists(target) && !force) {
3861
3922
  skip(".continue/rules/agent-config.md already exists");
3862
3923
  return;
@@ -3887,7 +3948,7 @@ orientation).
3887
3948
  See \`docs/setup/per-ide/kilocode.md\` for the full activation guide.
3888
3949
  `;
3889
3950
  function ensure_kilocode_bridge(project_root, force) {
3890
- const target = path7.join(project_root, ".kilocode", "rules", "agent-config.md");
3951
+ const target = path8.join(project_root, ".kilocode", "rules", "agent-config.md");
3891
3952
  if (pathExists(target) && !force) {
3892
3953
  skip(".kilocode/rules/agent-config.md already exists");
3893
3954
  return;
@@ -3914,7 +3975,7 @@ canonical source (or symlink it):
3914
3975
  Canonical rule and skill source: \`.augment/\` (see \`AGENTS.md\`).
3915
3976
  `;
3916
3977
  function ensure_zed_bridge(project_root, force) {
3917
- const target = path7.join(project_root, ".zed", "agent-config.md");
3978
+ const target = path8.join(project_root, ".zed", "agent-config.md");
3918
3979
  if (pathExists(target) && !force) {
3919
3980
  skip(".zed/agent-config.md already exists");
3920
3981
  return;
@@ -3935,7 +3996,7 @@ rules into your JetBrains profile.
3935
3996
  Canonical rule and skill source: \`.augment/\` (see \`AGENTS.md\`).
3936
3997
  `;
3937
3998
  function ensure_jetbrains_bridge(project_root, force) {
3938
- const target = path7.join(project_root, ".jetbrains", "agent-config.md");
3999
+ const target = path8.join(project_root, ".jetbrains", "agent-config.md");
3939
4000
  if (pathExists(target) && !force) {
3940
4001
  skip(".jetbrains/agent-config.md already exists");
3941
4002
  return;
@@ -3966,7 +4027,7 @@ session. The canonical rule and skill source lives under \`.augment/\`
3966
4027
  See \`docs/setup/per-ide/kiro.md\` for the full activation guide.
3967
4028
  `;
3968
4029
  function ensure_kiro_bridge(project_root, force) {
3969
- const target = path7.join(project_root, ".kiro", "steering", "agent-config.md");
4030
+ const target = path8.join(project_root, ".kiro", "steering", "agent-config.md");
3970
4031
  if (pathExists(target) && !force) {
3971
4032
  skip(".kiro/steering/agent-config.md already exists");
3972
4033
  return;
@@ -3992,35 +4053,35 @@ var SMOKE_BRIDGE_PATHS = {
3992
4053
  };
3993
4054
  function dirHasEntries(p) {
3994
4055
  try {
3995
- return fs9.readdirSync(p).length > 0;
4056
+ return fs10.readdirSync(p).length > 0;
3996
4057
  } catch {
3997
4058
  return false;
3998
4059
  }
3999
4060
  }
4000
4061
  function _resolve_tsx_invocation(scriptPath, scriptArgs) {
4001
4062
  const binName = process2.platform === "win32" ? "tsx.cmd" : "tsx";
4002
- let dir = path7.dirname(scriptPath);
4063
+ let dir = path8.dirname(scriptPath);
4003
4064
  for (; ; ) {
4004
- const candidate = path7.join(dir, "node_modules", ".bin", binName);
4065
+ const candidate = path8.join(dir, "node_modules", ".bin", binName);
4005
4066
  if (isFile(candidate)) {
4006
4067
  return { command: candidate, args: [scriptPath, ...scriptArgs] };
4007
4068
  }
4008
- const parent = path7.dirname(dir);
4069
+ const parent = path8.dirname(dir);
4009
4070
  if (parent === dir) break;
4010
4071
  dir = parent;
4011
4072
  }
4012
4073
  return { command: "npx", args: ["tsx", scriptPath, ...scriptArgs] };
4013
4074
  }
4014
4075
  function _smoke_test_hooks(project_root, package_root) {
4015
- const dispatcher = path7.join(package_root, "scripts", "hooks", "dispatch_hook.ts");
4016
- const manifest = path7.join(package_root, "scripts", "hook_manifest.yaml");
4076
+ const dispatcher = path8.join(package_root, "scripts", "hooks", "dispatch_hook.ts");
4077
+ const manifest = path8.join(package_root, "scripts", "hook_manifest.yaml");
4017
4078
  if (!isFile(dispatcher) || !isFile(manifest)) return 0;
4018
4079
  const failed = [];
4019
4080
  const skipped = [];
4020
4081
  const passed = [];
4021
4082
  for (const [platform, native] of SMOKE_PROBE_EVENTS) {
4022
4083
  const rel_bridge = SMOKE_BRIDGE_PATHS[platform] ?? "";
4023
- const bridge_path = rel_bridge ? path7.join(project_root, rel_bridge) : null;
4084
+ const bridge_path = rel_bridge ? path8.join(project_root, rel_bridge) : null;
4024
4085
  const bridge_present = Boolean(
4025
4086
  bridge_path && (isFile(bridge_path) || isDir(bridge_path) && dirHasEntries(bridge_path))
4026
4087
  );
@@ -4220,9 +4281,9 @@ To remove this marker, delete this file.
4220
4281
  `;
4221
4282
  }
4222
4283
  var _CLAUDE_DESKTOP_BUNDLES_SUBPATH = "claude-desktop/bundles";
4223
- var GLOBAL_ROOT = path7.join(os3.homedir(), ".event4u", "agent-config");
4224
- var GLOBAL_USER_SETTINGS_PATH = path7.join(GLOBAL_ROOT, ".agent-user.yml");
4225
- var GLOBAL_AGENT_SETTINGS_PATH = path7.join(GLOBAL_ROOT, ".agent-settings.yml");
4284
+ var GLOBAL_ROOT = path8.join(os3.homedir(), ".event4u", "agent-config");
4285
+ var GLOBAL_USER_SETTINGS_PATH = path8.join(GLOBAL_ROOT, ".agent-user.yml");
4286
+ var GLOBAL_AGENT_SETTINGS_PATH = path8.join(GLOBAL_ROOT, ".agent-settings.yml");
4226
4287
  function _bridge_marker(tool_id, scope) {
4227
4288
  if (scope === "global") return USER_SCOPE_PATHS[tool_id] ?? "";
4228
4289
  return PROJECT_BRIDGE_MARKERS[tool_id] ?? "";
@@ -4271,7 +4332,7 @@ function _load_yaml_doc(p) {
4271
4332
  return _isPlainObject(data) ? data : {};
4272
4333
  }
4273
4334
  function _load_default_settings(package_root) {
4274
- const template_source = path7.join(package_root, "src", "config", "agent-settings.template.yml");
4335
+ const template_source = path8.join(package_root, "src", "config", "agent-settings.template.yml");
4275
4336
  if (!pathExists(template_source)) return {};
4276
4337
  let text;
4277
4338
  try {
@@ -4285,11 +4346,11 @@ function _load_default_settings(package_root) {
4285
4346
  }
4286
4347
  var RULE_LAYER_CHOICES = ["global", "project", "both-acknowledged"];
4287
4348
  function _suppress_rule_layer(project_root, suppress_dir) {
4288
- const target = path7.join(project_root, ".claude", "settings.local.json");
4349
+ const target = path8.join(project_root, ".claude", "settings.local.json");
4289
4350
  const existing = pathExists(target) ? read_json_file(target) : {};
4290
4351
  let real_dir = suppress_dir;
4291
4352
  try {
4292
- real_dir = fs9.realpathSync(suppress_dir);
4353
+ real_dir = fs10.realpathSync(suppress_dir);
4293
4354
  } catch {
4294
4355
  real_dir = suppress_dir;
4295
4356
  }
@@ -4300,8 +4361,8 @@ function _suppress_rule_layer(project_root, suppress_dir) {
4300
4361
  success(`.claude/settings.local.json: claudeMdExcludes += ${entry}`);
4301
4362
  }
4302
4363
  function _gate_rule_layer_overlap(project_root, layer, dry_run) {
4303
- const global_dir = path7.join(os3.homedir(), ".claude", "rules");
4304
- const project_dir = path7.join(project_root, ".claude", "rules");
4364
+ const global_dir = path8.join(os3.homedir(), ".claude", "rules");
4365
+ const project_dir = path8.join(project_root, ".claude", "rules");
4305
4366
  const g = readRuleLayer(global_dir);
4306
4367
  const p = readRuleLayer(project_dir);
4307
4368
  if (g === null || p === null) return true;
@@ -4411,9 +4472,9 @@ function detect_scope(cwd) {
4411
4472
  if (pathExists(_resolve_settings_read(cwd))) {
4412
4473
  return ["project", `existing ${SETTINGS_FILE}`];
4413
4474
  }
4414
- const has_manifest = SCOPE_DETECT_MANIFESTS.find((m) => pathExists(path7.join(cwd, m))) ?? null;
4415
- const has_ai_dir = SCOPE_DETECT_AI_DIRS.find((d) => isDir(path7.join(cwd, d))) ?? null;
4416
- const has_ai_file = SCOPE_DETECT_AI_FILES.find((f) => pathExists(path7.join(cwd, f))) ?? null;
4475
+ const has_manifest = SCOPE_DETECT_MANIFESTS.find((m) => pathExists(path8.join(cwd, m))) ?? null;
4476
+ const has_ai_dir = SCOPE_DETECT_AI_DIRS.find((d) => isDir(path8.join(cwd, d))) ?? null;
4477
+ const has_ai_file = SCOPE_DETECT_AI_FILES.find((f) => pathExists(path8.join(cwd, f))) ?? null;
4417
4478
  if (has_manifest && (has_ai_dir || has_ai_file)) {
4418
4479
  const marker = has_ai_dir || has_ai_file;
4419
4480
  return ["prompt", `manifest (${has_manifest}) + AI-tool config (${marker})`];
@@ -4434,7 +4495,7 @@ function readLineSyncRaw(promptText) {
4434
4495
  for (; ; ) {
4435
4496
  let n;
4436
4497
  try {
4437
- n = fs9.readSync(0, buf, 0, 1, null);
4498
+ n = fs10.readSync(0, buf, 0, 1, null);
4438
4499
  } catch (err) {
4439
4500
  const code = err.code;
4440
4501
  if (code === "EAGAIN") {
@@ -4509,8 +4570,8 @@ function _files_by_tool_from_bridges(tools, project_root, scope) {
4509
4570
  const marker = _bridge_marker(tool_id, scope);
4510
4571
  if (!marker) continue;
4511
4572
  let marker_path = marker;
4512
- if (!path7.isAbsolute(marker_path)) {
4513
- marker_path = path7.join(project_root, marker_path);
4573
+ if (!path8.isAbsolute(marker_path)) {
4574
+ marker_path = path8.join(project_root, marker_path);
4514
4575
  }
4515
4576
  out[tool_id] = [_file_entry(marker_path, "bridge", false)];
4516
4577
  }
@@ -4549,26 +4610,26 @@ function _update_installed_tools_manifest(project_root, tools, scope, force, fil
4549
4610
  }
4550
4611
  write_manifest(target, version, entries);
4551
4612
  if (!state.QUIET) {
4552
- const rel = isRelativeTo(target, project_root) ? path7.relative(project_root, target) : target;
4613
+ const rel = isRelativeTo(target, project_root) ? path8.relative(project_root, target) : target;
4553
4614
  info(`Manifest updated: ${rel}`);
4554
4615
  }
4555
4616
  return 0;
4556
4617
  }
4557
4618
  function isRelativeTo(child, parent) {
4558
- const rel = path7.relative(parent, child);
4559
- return rel === "" || !rel.startsWith("..") && !path7.isAbsolute(rel);
4619
+ const rel = path8.relative(parent, child);
4620
+ return rel === "" || !rel.startsWith("..") && !path8.isAbsolute(rel);
4560
4621
  }
4561
4622
  function _resolve_package_root_for_global() {
4562
4623
  const here = resolvePath(_HERE);
4563
- const candidate = path7.dirname(path7.dirname(path7.dirname(here)));
4564
- if (!pathExists(path7.join(candidate, "src", "config", "profiles", "minimal.ini"))) {
4624
+ const candidate = path8.dirname(path8.dirname(path8.dirname(here)));
4625
+ if (!pathExists(path8.join(candidate, "src", "config", "profiles", "minimal.ini"))) {
4565
4626
  fail(
4566
4627
  `Could not locate agent-config package root from ${here}. Expected src/config/profiles/minimal.ini at the parent directory.`
4567
4628
  );
4568
4629
  }
4569
4630
  return candidate;
4570
4631
  }
4571
- var CONSUMER_BRIDGE_MARKER_RELPATH = path7.join("agents", ".event4u-bridge.yml");
4632
+ var CONSUMER_BRIDGE_MARKER_RELPATH = path8.join("agents", ".event4u-bridge.yml");
4572
4633
  var MIGRATE_LEGACY_YAML_FILES = [".agent-settings.yml", ".agent-user.yml"];
4573
4634
  var MIGRATE_LEGACY_TOOL_DIRS = [".augment", ".claude", ".cursor"];
4574
4635
  var AGENT_CONFIG_PACKAGE_NAME = "@event4u/agent-config";
@@ -4576,7 +4637,7 @@ function _is_agent_config_source_repo(project_root) {
4576
4637
  if (process2.env["AGENT_CONFIG_CONSUMER_MODE"] === "1") {
4577
4638
  return [false, "consumer-mode-override"];
4578
4639
  }
4579
- const pkg_json = path7.join(project_root, "package.json");
4640
+ const pkg_json = path8.join(project_root, "package.json");
4580
4641
  if (isFile(pkg_json)) {
4581
4642
  let data = {};
4582
4643
  try {
@@ -4588,18 +4649,18 @@ function _is_agent_config_source_repo(project_root) {
4588
4649
  return [true, "package.json:name"];
4589
4650
  }
4590
4651
  }
4591
- if (isDir(path7.join(project_root, ".agent-src.uncondensed"))) {
4652
+ if (isDir(path8.join(project_root, ".agent-src.uncondensed"))) {
4592
4653
  return [true, ".agent-src.uncondensed/"];
4593
4654
  }
4594
- const packages_dir = path7.join(project_root, "packages");
4655
+ const packages_dir = path8.join(project_root, "packages");
4595
4656
  if (isDir(packages_dir)) {
4596
- for (const child of fs9.readdirSync(packages_dir)) {
4597
- if (isDir(path7.join(packages_dir, child, ".agent-src.uncondensed"))) {
4657
+ for (const child of fs10.readdirSync(packages_dir)) {
4658
+ if (isDir(path8.join(packages_dir, child, ".agent-src.uncondensed"))) {
4598
4659
  return [true, `packages/${child}/.agent-src.uncondensed/`];
4599
4660
  }
4600
4661
  }
4601
4662
  }
4602
- const installer_self = path7.join(project_root, "scripts", "install.py");
4663
+ const installer_self = path8.join(project_root, "scripts", "install.py");
4603
4664
  try {
4604
4665
  if (isFile(installer_self) && resolvePath(installer_self) === resolvePath(_HERE)) {
4605
4666
  return [true, "src/scripts/install.py (self)"];
@@ -4619,17 +4680,17 @@ function _detect_legacy_for_migration(project_root) {
4619
4680
  }
4620
4681
  return [];
4621
4682
  }
4622
- if (isFile(path7.join(project_root, INSTALL_MODE_MARKER_REL))) return [];
4683
+ if (isFile(path8.join(project_root, INSTALL_MODE_MARKER_REL))) return [];
4623
4684
  const found = [];
4624
4685
  for (const name of MIGRATE_LEGACY_YAML_FILES) {
4625
- if (isFile(path7.join(project_root, name))) {
4686
+ if (isFile(path8.join(project_root, name))) {
4626
4687
  found.push(name);
4627
- } else if (isFile(path7.join(project_root, "settings", name))) {
4688
+ } else if (isFile(path8.join(project_root, "settings", name))) {
4628
4689
  found.push(`settings/${name}`);
4629
4690
  }
4630
4691
  }
4631
4692
  for (const name of MIGRATE_LEGACY_TOOL_DIRS) {
4632
- const p = path7.join(project_root, name);
4693
+ const p = path8.join(project_root, name);
4633
4694
  if (isDir(p) && !isSymlink(p)) {
4634
4695
  found.push(`${name}/`);
4635
4696
  }
@@ -4641,7 +4702,7 @@ function _prompt_migrate_to_global(project_root, artefacts) {
4641
4702
  process2.stdout.write("\n");
4642
4703
  warn("Legacy project-local artefacts detected \u2014 pre-ADR-020 layout:");
4643
4704
  for (const rel of artefacts) {
4644
- info(` ${path7.join(project_root, rel)}`);
4705
+ info(` ${path8.join(project_root, rel)}`);
4645
4706
  }
4646
4707
  info("The unified `agent-config migrate` sweeps these in one pass.");
4647
4708
  info("The wizard recreates fresh config afterwards.");
@@ -4672,20 +4733,20 @@ function _run_migrate_to_global(project_root) {
4672
4733
  function _format_global_root_for_marker(global_root) {
4673
4734
  const home = resolvePath(os3.homedir());
4674
4735
  const resolved = resolvePath(global_root);
4675
- const rel = path7.relative(home, resolved);
4676
- if (rel === "" || rel.startsWith("..") || path7.isAbsolute(rel)) {
4736
+ const rel = path8.relative(home, resolved);
4737
+ if (rel === "" || rel.startsWith("..") || path8.isAbsolute(rel)) {
4677
4738
  return global_root;
4678
4739
  }
4679
- return `~/${rel.split(path7.sep).join("/")}`;
4740
+ return `~/${rel.split(path8.sep).join("/")}`;
4680
4741
  }
4681
4742
  function _remove_legacy_consumer_bridge_marker(project_root, env = null) {
4682
4743
  const env_map = env ?? process2.env;
4683
4744
  if (env_map["AGENT_CONFIG_DEV_MODE"] === "1") return null;
4684
- if (isDir(path7.join(project_root, ".agent-src.uncondensed"))) return null;
4685
- const target = path7.join(project_root, CONSUMER_BRIDGE_MARKER_RELPATH);
4745
+ if (isDir(path8.join(project_root, ".agent-src.uncondensed"))) return null;
4746
+ const target = path8.join(project_root, CONSUMER_BRIDGE_MARKER_RELPATH);
4686
4747
  if (!isFile(target)) return null;
4687
4748
  try {
4688
- fs9.rmSync(target);
4749
+ fs10.rmSync(target);
4689
4750
  } catch {
4690
4751
  return null;
4691
4752
  }
@@ -4699,7 +4760,7 @@ var PROJECT_ANCHOR_TOOLS = {
4699
4760
  function _write_per_tool_project_anchors(project_root, tools, env = null, now = null) {
4700
4761
  const env_map = env ?? process2.env;
4701
4762
  if (env_map["AGENT_CONFIG_DEV_MODE"] === "1") return [];
4702
- if (isDir(path7.join(project_root, ".agent-src.uncondensed"))) return [];
4763
+ if (isDir(path8.join(project_root, ".agent-src.uncondensed"))) return [];
4703
4764
  const global_root_str = _format_global_root_for_marker(
4704
4765
  event4u_root(env_map)
4705
4766
  );
@@ -4708,8 +4769,8 @@ function _write_per_tool_project_anchors(project_root, tools, env = null, now =
4708
4769
  for (const tool_id of Object.keys(PROJECT_ANCHOR_TOOLS).sort()) {
4709
4770
  const rel_path = PROJECT_ANCHOR_TOOLS[tool_id];
4710
4771
  if (!tools.has(tool_id)) continue;
4711
- const target = path7.join(project_root, rel_path);
4712
- mkdirp(path7.dirname(target));
4772
+ const target = path8.join(project_root, rel_path);
4773
+ mkdirp(path8.dirname(target));
4713
4774
  const body = `# event4u/agent-config \u2014 per-tool project anchor (auto-written).
4714
4775
  # Spec: docs/contracts/consumer-bridge.md \xA7 Per-tool anchor strategy.
4715
4776
  # Tool: ${tool_id}. Resolves the global install directly \u2014 no
@@ -4727,7 +4788,7 @@ installed_at: ${stamp}
4727
4788
  }
4728
4789
  var PACKAGE_TAG_ID = "event4u/agent-config";
4729
4790
  function _inject_package_tag(target, source, package_root) {
4730
- if (path7.extname(target) !== ".md") return;
4791
+ if (path8.extname(target) !== ".md") return;
4731
4792
  let text;
4732
4793
  try {
4733
4794
  text = readText(target);
@@ -4755,8 +4816,8 @@ function _inject_package_tag(target, source, package_root) {
4755
4816
  resolved_src = source;
4756
4817
  }
4757
4818
  if (package_root !== null) {
4758
- const rel = path7.relative(resolvePath(package_root), resolved_src);
4759
- if (rel !== "" && !rel.startsWith("..") && !path7.isAbsolute(rel)) {
4819
+ const rel = path8.relative(resolvePath(package_root), resolved_src);
4820
+ if (rel !== "" && !rel.startsWith("..") && !path8.isAbsolute(rel)) {
4760
4821
  source_value = rel;
4761
4822
  } else {
4762
4823
  source_value = resolved_src;
@@ -4791,7 +4852,7 @@ function _escapes_package_root(resolved, package_root) {
4791
4852
  if (package_root === null) return false;
4792
4853
  let root;
4793
4854
  try {
4794
- root = fs9.realpathSync(package_root);
4855
+ root = fs10.realpathSync(package_root);
4795
4856
  } catch {
4796
4857
  return false;
4797
4858
  }
@@ -4806,7 +4867,7 @@ function _copy_dir_dereferencing_symlinks(src, dest, force, package_root = null,
4806
4867
  if (file_filter !== null && !file_filter(src)) return [0, 0, written_paths];
4807
4868
  let resolved_src = src;
4808
4869
  try {
4809
- resolved_src = fs9.realpathSync(src);
4870
+ resolved_src = fs10.realpathSync(src);
4810
4871
  } catch {
4811
4872
  resolved_src = src;
4812
4873
  }
@@ -4814,10 +4875,10 @@ function _copy_dir_dereferencing_symlinks(src, dest, force, package_root = null,
4814
4875
  warn(`refused: ${src} dereferences outside the package root \u2014 not copied`);
4815
4876
  return [0, 0, written_paths];
4816
4877
  }
4817
- mkdirp(path7.dirname(dest));
4878
+ mkdirp(path8.dirname(dest));
4818
4879
  const decision = _resolve_file_conflict(dest, force);
4819
4880
  if (decision === "skip") return [0, 1, written_paths];
4820
- fs9.copyFileSync(src, dest);
4881
+ fs10.copyFileSync(src, dest);
4821
4882
  _inject_package_tag(dest, src, package_root);
4822
4883
  written_paths.push(dest);
4823
4884
  return [1, 0, written_paths];
@@ -4825,11 +4886,11 @@ function _copy_dir_dereferencing_symlinks(src, dest, force, package_root = null,
4825
4886
  mkdirp(dest);
4826
4887
  const walk = (node) => {
4827
4888
  const acc = [];
4828
- const names = fs9.readdirSync(node).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
4889
+ const names = fs10.readdirSync(node).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
4829
4890
  for (const name of names) {
4830
- const entry = path7.join(node, name);
4891
+ const entry = path8.join(node, name);
4831
4892
  acc.push(entry);
4832
- const lst = fs9.lstatSync(entry);
4893
+ const lst = fs10.lstatSync(entry);
4833
4894
  if (lst.isDirectory() && !lst.isSymbolicLink()) {
4834
4895
  acc.push(...walk(entry));
4835
4896
  }
@@ -4837,9 +4898,9 @@ function _copy_dir_dereferencing_symlinks(src, dest, force, package_root = null,
4837
4898
  return acc;
4838
4899
  };
4839
4900
  for (const entry of walk(src)) {
4840
- const rel = path7.relative(src, entry);
4841
- const target = path7.join(dest, rel);
4842
- const lst = fs9.lstatSync(entry);
4901
+ const rel = path8.relative(src, entry);
4902
+ const target = path8.join(dest, rel);
4903
+ const lst = fs10.lstatSync(entry);
4843
4904
  if (lst.isDirectory() && !lst.isSymbolicLink()) {
4844
4905
  mkdirp(target);
4845
4906
  continue;
@@ -4847,8 +4908,8 @@ function _copy_dir_dereferencing_symlinks(src, dest, force, package_root = null,
4847
4908
  let resolvedIsDir = false;
4848
4909
  let resolved = entry;
4849
4910
  try {
4850
- resolved = fs9.realpathSync(entry);
4851
- resolvedIsDir = fs9.statSync(entry).isDirectory();
4911
+ resolved = fs10.realpathSync(entry);
4912
+ resolvedIsDir = fs10.statSync(entry).isDirectory();
4852
4913
  } catch {
4853
4914
  resolvedIsDir = false;
4854
4915
  }
@@ -4878,8 +4939,8 @@ function _copy_dir_dereferencing_symlinks(src, dest, force, package_root = null,
4878
4939
  skipped += 1;
4879
4940
  continue;
4880
4941
  }
4881
- mkdirp(path7.dirname(target));
4882
- fs9.copyFileSync(resolved, target);
4942
+ mkdirp(path8.dirname(target));
4943
+ fs10.copyFileSync(resolved, target);
4883
4944
  _inject_package_tag(target, resolved, package_root);
4884
4945
  written += 1;
4885
4946
  written_paths.push(target);
@@ -4891,7 +4952,7 @@ function _claude_desktop_bundles_dir() {
4891
4952
  }
4892
4953
  function _write_claude_desktop_marker(_force, lockfile_path2, bundles_dir, bundle_count) {
4893
4954
  const anchor = expanduser2(USER_SCOPE_PATHS["claude-desktop"]);
4894
- const target = path7.join(anchor, "agent-config.md");
4955
+ const target = path8.join(anchor, "agent-config.md");
4895
4956
  mkdirp(anchor);
4896
4957
  const body = claudeDesktopMarkerBody(lockfile_path2, anchor, bundles_dir, bundle_count);
4897
4958
  writeText(target, body);
@@ -4915,23 +4976,23 @@ function _apply_claude_flat_command_wrappers(anchor, package_root, current_files
4915
4976
  const wrapped = [];
4916
4977
  const collisions = [];
4917
4978
  const reserved = [];
4918
- const commands_dir = path7.join(anchor, "commands");
4979
+ const commands_dir = path8.join(anchor, "commands");
4919
4980
  let flat_entries = [];
4920
4981
  try {
4921
- flat_entries = fs9.readdirSync(commands_dir).filter((f) => f.endsWith(".md"));
4982
+ flat_entries = fs10.readdirSync(commands_dir).filter((f) => f.endsWith(".md"));
4922
4983
  } catch {
4923
4984
  }
4924
4985
  for (const fname of flat_entries.sort()) {
4925
4986
  const slug = fname.slice(0, -".md".length);
4926
4987
  if (!is_claude_builtin_name(slug)) continue;
4927
- fs9.rmSync(path7.join(commands_dir, fname), { force: true });
4988
+ fs10.rmSync(path8.join(commands_dir, fname), { force: true });
4928
4989
  current_files.delete(`commands/${fname}`);
4929
4990
  reserved.push(slug);
4930
4991
  }
4931
4992
  const eligible = new Set(_CLAUDE_FLAT_WRAPPER_EXTRA);
4932
4993
  try {
4933
4994
  const manifest = JSON.parse(
4934
- fs9.readFileSync(path7.join(package_root, "dist", "discovery", "discovery-manifest.json"), "utf8")
4995
+ fs10.readFileSync(path8.join(package_root, "dist", "discovery", "discovery-manifest.json"), "utf8")
4935
4996
  );
4936
4997
  for (const a of manifest.artefacts ?? []) {
4937
4998
  if (a.category !== "command" || typeof a.slug !== "string") continue;
@@ -4942,22 +5003,22 @@ function _apply_claude_flat_command_wrappers(anchor, package_root, current_files
4942
5003
  }
4943
5004
  for (const slug of [...eligible].sort()) {
4944
5005
  const flat_rel = `commands/${slug}.md`;
4945
- const flat_abs = path7.join(anchor, "commands", `${slug}.md`);
4946
- if (!fs9.existsSync(flat_abs)) continue;
4947
- const skill_dir = path7.join(anchor, "skills", slug);
4948
- if (fs9.existsSync(skill_dir)) {
5006
+ const flat_abs = path8.join(anchor, "commands", `${slug}.md`);
5007
+ if (!fs10.existsSync(flat_abs)) continue;
5008
+ const skill_dir = path8.join(anchor, "skills", slug);
5009
+ if (fs10.existsSync(skill_dir)) {
4949
5010
  collisions.push(slug);
4950
5011
  continue;
4951
5012
  }
4952
- let body = fs9.readFileSync(flat_abs, "utf8");
5013
+ let body = fs10.readFileSync(flat_abs, "utf8");
4953
5014
  if (body.startsWith("---\n") && !/^name:/m.test(body.split("\n---")[0] ?? "")) {
4954
5015
  body = body.replace("---\n", `---
4955
5016
  name: ${slug}
4956
5017
  `);
4957
5018
  }
4958
- fs9.mkdirSync(skill_dir, { recursive: true });
4959
- fs9.writeFileSync(path7.join(skill_dir, "SKILL.md"), body, "utf8");
4960
- fs9.rmSync(flat_abs, { force: true });
5019
+ fs10.mkdirSync(skill_dir, { recursive: true });
5020
+ fs10.writeFileSync(path8.join(skill_dir, "SKILL.md"), body, "utf8");
5021
+ fs10.rmSync(flat_abs, { force: true });
4961
5022
  current_files.delete(flat_rel);
4962
5023
  current_files.add(`skills/${slug}/SKILL.md`);
4963
5024
  wrapped.push(slug);
@@ -4989,8 +5050,8 @@ function _deploy_global_content(tools, force, package_root, lockfile_path2) {
4989
5050
  const written_paths = [];
4990
5051
  let current_files = /* @__PURE__ */ new Set();
4991
5052
  for (const [src_rel, dest_sub] of plan) {
4992
- const src = path7.join(package_root, src_rel);
4993
- const dest = dest_sub ? path7.join(anchor, dest_sub) : anchor;
5053
+ const src = path8.join(package_root, src_rel);
5054
+ const dest = dest_sub ? path8.join(anchor, dest_sub) : anchor;
4994
5055
  const rule_filter = _rule_filter_for_source(src_rel, rule_scope);
4995
5056
  const [w, s, paths] = _copy_dir_dereferencing_symlinks(
4996
5057
  src,
@@ -5064,10 +5125,10 @@ function _deploy_global_content(tools, force, package_root, lockfile_path2) {
5064
5125
  results[tool_id] = [written_total, skipped_total, "deployed", written_paths];
5065
5126
  if (tool_id === "claude-code") {
5066
5127
  try {
5067
- const manifest = path7.join(package_root, "src", "scripts", "hook_manifest.yaml");
5128
+ const manifest = path8.join(package_root, "src", "scripts", "hook_manifest.yaml");
5068
5129
  const matrix = build_claude_hook_matrix(manifest);
5069
5130
  const res = ensure_managed_hooks(
5070
- path7.join(anchor, "settings.json"),
5131
+ path8.join(anchor, "settings.json"),
5071
5132
  matrix
5072
5133
  );
5073
5134
  if (!state.QUIET) {
@@ -5104,7 +5165,7 @@ function _preview_global_reap(tools, package_root) {
5104
5165
  const anchor = expanduser2(anchor_raw);
5105
5166
  let current_files = /* @__PURE__ */ new Set();
5106
5167
  for (const [src_rel, dest_sub] of plan) {
5107
- const src = path7.join(package_root, src_rel);
5168
+ const src = path8.join(package_root, src_rel);
5108
5169
  current_files = setUnion(
5109
5170
  current_files,
5110
5171
  expected_deploy_files(
@@ -5138,14 +5199,14 @@ function _preview_global_reap(tools, package_root) {
5138
5199
  function _verify_deploy_targets(anchor, plan) {
5139
5200
  const missing = [];
5140
5201
  for (const [, dest_sub] of plan) {
5141
- const target = dest_sub ? path7.join(anchor, dest_sub) : anchor;
5202
+ const target = dest_sub ? path8.join(anchor, dest_sub) : anchor;
5142
5203
  const label = dest_sub || ".";
5143
5204
  if (!isDir(target)) {
5144
5205
  missing.push(label);
5145
5206
  continue;
5146
5207
  }
5147
5208
  try {
5148
- const entries = fs9.readdirSync(target);
5209
+ const entries = fs10.readdirSync(target);
5149
5210
  if (entries.length === 0) missing.push(label);
5150
5211
  } catch {
5151
5212
  missing.push(label);
@@ -5153,61 +5214,8 @@ function _verify_deploy_targets(anchor, plan) {
5153
5214
  }
5154
5215
  return missing;
5155
5216
  }
5156
- function _prune_modules_by(deploy_results, is_pruned) {
5157
- let pruned = 0;
5158
- const adjusted = {};
5159
- for (const tool_id of Object.keys(deploy_results)) {
5160
- const [written, skipped, status, paths] = deploy_results[tool_id];
5161
- const pruned_skill_dirs = /* @__PURE__ */ new Set();
5162
- for (const p of paths) {
5163
- const parts = p.split(path7.sep);
5164
- if (parts.includes("skills")) {
5165
- const i = parts.indexOf("skills");
5166
- if (i + 1 < parts.length) {
5167
- const skill_root = parts.slice(0, i + 2).join(path7.sep);
5168
- if (!pruned_skill_dirs.has(skill_root)) {
5169
- const skillmd = path7.join(skill_root, "SKILL.md");
5170
- if (pathExists(skillmd) && is_pruned(skillmd)) {
5171
- pruned_skill_dirs.add(skill_root);
5172
- }
5173
- }
5174
- }
5175
- }
5176
- }
5177
- const keep = [];
5178
- const delete_files = [];
5179
- for (const p of paths) {
5180
- const parts = p.split(path7.sep);
5181
- let is_target = false;
5182
- if (parts.includes("skills")) {
5183
- const i = parts.indexOf("skills");
5184
- if (i + 1 < parts.length && pruned_skill_dirs.has(parts.slice(0, i + 2).join(path7.sep))) {
5185
- is_target = true;
5186
- }
5187
- } else if (parts.includes("commands") && path7.extname(p) === ".md" && is_pruned(p)) {
5188
- is_target = true;
5189
- }
5190
- (is_target ? delete_files : keep).push(p);
5191
- }
5192
- for (const d of pruned_skill_dirs) {
5193
- fs9.rmSync(d, { recursive: true, force: true });
5194
- }
5195
- for (const p of delete_files) {
5196
- if (p.split(path7.sep).includes("commands") && pathExists(p)) {
5197
- try {
5198
- fs9.unlinkSync(p);
5199
- } catch {
5200
- }
5201
- }
5202
- }
5203
- pruned += delete_files.length;
5204
- adjusted[tool_id] = [Math.max(0, written - delete_files.length), skipped, status, keep];
5205
- }
5206
- return [pruned, adjusted];
5207
- }
5208
- function _prune_lab_modules(deploy_results, lab_ids) {
5209
- return _prune_modules_by(deploy_results, (p) => is_lab_artefact(p, lab_ids));
5210
- }
5217
+ var _prune_modules_by = prune_modules_by;
5218
+ var _prune_lab_modules = prune_lab_modules;
5211
5219
  var _load_packs_registry = load_packs_registry;
5212
5220
  var _compute_active_pack_ids = compute_active_pack_ids;
5213
5221
  function _resolve_global_settings_doc() {
@@ -5216,16 +5224,16 @@ function _resolve_global_settings_doc() {
5216
5224
  }
5217
5225
  function _resolve_global_settings_path() {
5218
5226
  const root = event4u_root();
5219
- const canonical = path7.join(root, "settings", SETTINGS_FILE);
5227
+ const canonical = path8.join(root, "settings", SETTINGS_FILE);
5220
5228
  if (pathExists(canonical)) return canonical;
5221
- const legacy = path7.join(root, SETTINGS_FILE);
5229
+ const legacy = path8.join(root, SETTINGS_FILE);
5222
5230
  if (pathExists(legacy)) return legacy;
5223
5231
  return null;
5224
5232
  }
5225
5233
  function _resolve_scoped_projection(package_root) {
5226
5234
  const doc = _resolve_global_settings_doc() ?? _load_default_settings(package_root);
5227
5235
  const projection = _isPlainObject(doc["projection"]) ? doc["projection"] : {};
5228
- const mode = projection["mode"] === "scoped" ? "scoped" : "legacy-all";
5236
+ const mode = projectionModeOf(projection["mode"]);
5229
5237
  const runtime = _isPlainObject(doc["runtime"]) ? doc["runtime"] : {};
5230
5238
  const active_packs_raw = runtime["active_packs"];
5231
5239
  const active_packs = Array.isArray(active_packs_raw) ? active_packs_raw.filter((v) => typeof v === "string") : [];
@@ -5329,7 +5337,7 @@ function install_global(tools, force, project_root = null, core_only = false) {
5329
5337
  info(` schema_version=1, agent_config_version=${installed_version}`);
5330
5338
  info(` tools=${merged_tools.join(",")}`);
5331
5339
  }
5332
- if (project_root !== null && pathExists(_resolve_settings_read(project_root)) && !isDir(path7.join(project_root, ".agent-src.uncondensed"))) {
5340
+ if (project_root !== null && pathExists(_resolve_settings_read(project_root)) && !isDir(path8.join(project_root, ".agent-src.uncondensed"))) {
5333
5341
  const drift = collect_drift(project_root);
5334
5342
  if (!state.QUIET) {
5335
5343
  process2.stdout.write("\n");
@@ -5352,6 +5360,13 @@ function install_global(tools, force, project_root = null, core_only = false) {
5352
5360
  }
5353
5361
  try {
5354
5362
  const { mode, active_packs } = _resolve_scoped_projection(package_root);
5363
+ if (mode === "tiered") {
5364
+ const outcome = applyTieredPrune(deploy_results, package_root, _prune_modules_by);
5365
+ deploy_results = outcome.deployResults;
5366
+ if (!state.QUIET && outcome.message !== null) {
5367
+ (outcome.level === "warn" ? warn : info)(outcome.message);
5368
+ }
5369
+ }
5355
5370
  if (mode === "scoped") {
5356
5371
  const packs_registry = _load_packs_registry(package_root);
5357
5372
  const active_ids = _compute_active_pack_ids(packs_registry, active_packs);
@@ -5436,19 +5451,19 @@ function install_global(tools, force, project_root = null, core_only = false) {
5436
5451
  }
5437
5452
  }
5438
5453
  }
5439
- if (project_root !== null && pathExists(_resolve_settings_read(project_root)) && !isDir(path7.join(project_root, ".agent-src.uncondensed"))) {
5454
+ if (project_root !== null && pathExists(_resolve_settings_read(project_root)) && !isDir(path8.join(project_root, ".agent-src.uncondensed"))) {
5440
5455
  const files_by_tool = _files_by_tool_from_deploy(deploy_results);
5441
5456
  const rc = _update_installed_tools_manifest(project_root, tools, "global", force, files_by_tool);
5442
5457
  if (rc !== 0) return rc;
5443
5458
  const removed_marker = _remove_legacy_consumer_bridge_marker(project_root);
5444
5459
  if (removed_marker !== null && !state.QUIET) {
5445
- const rel = isRelativeTo(removed_marker, project_root) ? path7.relative(project_root, removed_marker) : removed_marker;
5460
+ const rel = isRelativeTo(removed_marker, project_root) ? path8.relative(project_root, removed_marker) : removed_marker;
5446
5461
  info(`Removed legacy bridge marker: ${rel}`);
5447
5462
  }
5448
5463
  const anchor_paths = _write_per_tool_project_anchors(project_root, tools);
5449
5464
  if (anchor_paths.length > 0 && !state.QUIET) {
5450
5465
  for (const p of anchor_paths) {
5451
- const rel = isRelativeTo(p, project_root) ? path7.relative(project_root, p) : p;
5466
+ const rel = isRelativeTo(p, project_root) ? path8.relative(project_root, p) : p;
5452
5467
  info(`Project anchor written: ${rel}`);
5453
5468
  }
5454
5469
  }
@@ -5484,8 +5499,8 @@ function install_global(tools, force, project_root = null, core_only = false) {
5484
5499
  }
5485
5500
  function _catalogue_truncation_warnings(deploy_results, project_root) {
5486
5501
  const log_candidates = [
5487
- path7.join(event4u_root(), "state", "skill-catalogue.jsonl"),
5488
- ...project_root ? [path7.join(project_root, OBSERVATION_LOG)] : []
5502
+ path8.join(event4u_root(), "state", "skill-catalogue.jsonl"),
5503
+ ...project_root ? [path8.join(project_root, OBSERVATION_LOG)] : []
5489
5504
  ];
5490
5505
  const records = log_candidates.flatMap((p) => readObservationLog(p));
5491
5506
  if (records.length === 0) return [];
@@ -5508,13 +5523,13 @@ function _catalogue_truncation_warnings(deploy_results, project_root) {
5508
5523
  function _scoped_migration_notice(deploy_results, project_root, package_root, probe) {
5509
5524
  if (!isInteractiveSession(probe)) return [];
5510
5525
  const log_candidates = [
5511
- path7.join(event4u_root(), "state", "skill-catalogue.jsonl"),
5512
- ...project_root ? [path7.join(project_root, OBSERVATION_LOG)] : []
5526
+ path8.join(event4u_root(), "state", "skill-catalogue.jsonl"),
5527
+ ...project_root ? [path8.join(project_root, OBSERVATION_LOG)] : []
5513
5528
  ];
5514
5529
  const limits = knownHostLimits(log_candidates.flatMap((p) => readObservationLog(p)));
5515
5530
  if (limits.size === 0) return [];
5516
5531
  const resolved = _resolve_scoped_projection(package_root);
5517
- const settings_path = _resolve_global_settings_path() ?? path7.join(event4u_root(), "settings", SETTINGS_FILE);
5532
+ const settings_path = _resolve_global_settings_path() ?? path8.join(event4u_root(), "settings", SETTINGS_FILE);
5518
5533
  for (const tool_id of Object.keys(deploy_results).sort()) {
5519
5534
  const [, , status] = deploy_results[tool_id];
5520
5535
  if (status !== "deployed") continue;
@@ -5533,8 +5548,8 @@ function _scoped_migration_notice(deploy_results, project_root, package_root, pr
5533
5548
  }
5534
5549
  return [];
5535
5550
  }
5536
- var SETTINGS_SURFACE_REL = path7.join("state", "settings-surface.json");
5537
- var SETTINGS_DELTA_REL = path7.join("state", "settings-delta.json");
5551
+ var SETTINGS_SURFACE_REL = path8.join("state", "settings-surface.json");
5552
+ var SETTINGS_DELTA_REL = path8.join("state", "settings-delta.json");
5538
5553
  function _current_settings_surface(version) {
5539
5554
  const jsonSchema = zodToJsonSchema(settingsSchema, {
5540
5555
  name: "AgentSettings",
@@ -5545,20 +5560,20 @@ function _current_settings_surface(version) {
5545
5560
  }
5546
5561
  function _write_settings_surface_snapshot(installed_version) {
5547
5562
  const root = event4u_root();
5548
- const surface_path = path7.join(root, SETTINGS_SURFACE_REL);
5549
- const delta_path = path7.join(root, SETTINGS_DELTA_REL);
5563
+ const surface_path = path8.join(root, SETTINGS_SURFACE_REL);
5564
+ const delta_path = path8.join(root, SETTINGS_DELTA_REL);
5550
5565
  const next = _current_settings_surface(installed_version);
5551
5566
  let previous = null;
5552
5567
  try {
5553
- const parsed = JSON.parse(fs9.readFileSync(surface_path, "utf8"));
5568
+ const parsed = JSON.parse(fs10.readFileSync(surface_path, "utf8"));
5554
5569
  if (parsed !== null && typeof parsed === "object" && parsed.entries !== void 0) previous = parsed;
5555
5570
  } catch {
5556
5571
  }
5557
5572
  if (previous !== null && previous.version !== next.version) {
5558
5573
  const delta = computeSurfaceDelta(previous, next);
5559
5574
  if (delta.changes.length > 0) {
5560
- fs9.mkdirSync(path7.dirname(delta_path), { recursive: true, mode: 448 });
5561
- fs9.writeFileSync(delta_path, `${JSON.stringify(delta, null, 2)}
5575
+ fs10.mkdirSync(path8.dirname(delta_path), { recursive: true, mode: 448 });
5576
+ fs10.writeFileSync(delta_path, `${JSON.stringify(delta, null, 2)}
5562
5577
  `, { mode: 384 });
5563
5578
  if (!state.QUIET) {
5564
5579
  const counts = {};
@@ -5570,8 +5585,8 @@ function _write_settings_surface_snapshot(installed_version) {
5570
5585
  }
5571
5586
  }
5572
5587
  }
5573
- fs9.mkdirSync(path7.dirname(surface_path), { recursive: true, mode: 448 });
5574
- fs9.writeFileSync(surface_path, `${JSON.stringify(next, null, 2)}
5588
+ fs10.mkdirSync(path8.dirname(surface_path), { recursive: true, mode: 448 });
5589
+ fs10.writeFileSync(surface_path, `${JSON.stringify(next, null, 2)}
5575
5590
  `, { mode: 384 });
5576
5591
  }
5577
5592
  function arrayStrEqual(a, b) {
@@ -5791,13 +5806,13 @@ function _minimal_templates_root() {
5791
5806
  const chain = [start];
5792
5807
  let cur = start;
5793
5808
  for (; ; ) {
5794
- const parent = path7.dirname(cur);
5809
+ const parent = path8.dirname(cur);
5795
5810
  if (parent === cur) break;
5796
5811
  chain.push(parent);
5797
5812
  cur = parent;
5798
5813
  }
5799
5814
  for (const ancestor of chain) {
5800
- const candidate = path7.join(ancestor, "src", "templates", "minimal");
5815
+ const candidate = path8.join(ancestor, "src", "templates", "minimal");
5801
5816
  if (isDir(candidate)) return candidate;
5802
5817
  }
5803
5818
  fail("Could not locate src/templates/minimal/ \u2014 package install is corrupt.");
@@ -5805,9 +5820,9 @@ function _minimal_templates_root() {
5805
5820
  var INSTALL_MODE_MARKER_REL = "agents/.agent-state/install-mode.txt";
5806
5821
  function _write_install_mode_marker(project_root, mode) {
5807
5822
  if (mode !== "minimal" && mode !== "full") return;
5808
- const marker = path7.join(project_root, INSTALL_MODE_MARKER_REL);
5823
+ const marker = path8.join(project_root, INSTALL_MODE_MARKER_REL);
5809
5824
  try {
5810
- mkdirp(path7.dirname(marker));
5825
+ mkdirp(path8.dirname(marker));
5811
5826
  writeText(marker, `${mode}
5812
5827
  `);
5813
5828
  } catch {
@@ -5816,7 +5831,7 @@ function _write_install_mode_marker(project_root, mode) {
5816
5831
  function install_minimal(target_root_in, force, user_type = "") {
5817
5832
  let target_root = resolvePath(target_root_in);
5818
5833
  mkdirp(target_root);
5819
- const parent = path7.dirname(target_root);
5834
+ const parent = path8.dirname(target_root);
5820
5835
  if (parent !== target_root) {
5821
5836
  const existing = find_project_root_with_anchor(parent);
5822
5837
  if (existing !== null && existing[0] !== target_root) {
@@ -5827,21 +5842,21 @@ function install_minimal(target_root_in, force, user_type = "") {
5827
5842
  }
5828
5843
  }
5829
5844
  const templates = _minimal_templates_root();
5830
- const settings_src = path7.join(templates, SETTINGS_FILE);
5831
- const overrides_gitkeep_src = path7.join(templates, "overrides-gitkeep");
5832
- const overrides_readme_src = path7.join(templates, "agents-overrides-readme.md");
5845
+ const settings_src = path8.join(templates, SETTINGS_FILE);
5846
+ const overrides_gitkeep_src = path8.join(templates, "overrides-gitkeep");
5847
+ const overrides_readme_src = path8.join(templates, "agents-overrides-readme.md");
5833
5848
  if (!isFile(settings_src)) fail(`Bundled minimal settings template missing under ${templates}`);
5834
5849
  if (!isFile(overrides_gitkeep_src) || !isFile(overrides_readme_src)) {
5835
5850
  fail(`Bundled overrides scaffold templates missing under ${templates}`);
5836
5851
  }
5837
5852
  info(`Minimal init \u2192 ${target_root}`);
5838
- const overrides_root = path7.join(target_root, "agents", "overrides");
5853
+ const overrides_root = path8.join(target_root, "agents", "overrides");
5839
5854
  mkdirp(overrides_root);
5840
5855
  const gitkeep_body = readText(overrides_gitkeep_src);
5841
5856
  for (const sub of ["rules", "skills", "commands"]) {
5842
- const sub_dir = path7.join(overrides_root, sub);
5857
+ const sub_dir = path8.join(overrides_root, sub);
5843
5858
  mkdirp(sub_dir);
5844
- const gitkeep_dst = path7.join(sub_dir, ".gitkeep");
5859
+ const gitkeep_dst = path8.join(sub_dir, ".gitkeep");
5845
5860
  if (pathExists(gitkeep_dst) && !force) {
5846
5861
  skip(`agents/overrides/${sub}/.gitkeep already exists (use --force to overwrite)`);
5847
5862
  } else {
@@ -5849,7 +5864,7 @@ function install_minimal(target_root_in, force, user_type = "") {
5849
5864
  success(`Wrote agents/overrides/${sub}/.gitkeep`);
5850
5865
  }
5851
5866
  }
5852
- const readme_dst = path7.join(overrides_root, "README.md");
5867
+ const readme_dst = path8.join(overrides_root, "README.md");
5853
5868
  if (pathExists(readme_dst) && !force) {
5854
5869
  skip("agents/overrides/README.md already exists (use --force to overwrite)");
5855
5870
  } else {
@@ -5867,14 +5882,14 @@ function install_minimal(target_root_in, force, user_type = "") {
5867
5882
  personal:
5868
5883
  user_type: ${user_type}
5869
5884
  `;
5870
- mkdirp(path7.dirname(settings_dst));
5885
+ mkdirp(path8.dirname(settings_dst));
5871
5886
  writeText(settings_dst, body);
5872
5887
  success(`Wrote ${SETTINGS_FILE} (user_type=${user_type})`);
5873
5888
  }
5874
5889
  }
5875
5890
  const removed_marker = _remove_legacy_consumer_bridge_marker(target_root);
5876
5891
  if (removed_marker !== null) {
5877
- const rel = isRelativeTo(removed_marker, target_root) ? path7.relative(target_root, removed_marker) : removed_marker;
5892
+ const rel = isRelativeTo(removed_marker, target_root) ? path8.relative(target_root, removed_marker) : removed_marker;
5878
5893
  success(`Removed legacy bridge marker: ${rel}`);
5879
5894
  }
5880
5895
  _write_install_mode_marker(target_root, "minimal");
@@ -5948,7 +5963,7 @@ function run_interactive_init(project_root, force) {
5948
5963
  );
5949
5964
  return 0;
5950
5965
  }
5951
- const target = path7.join(project_root, _LOCAL_CONFIG_FILE);
5966
+ const target = path8.join(project_root, _LOCAL_CONFIG_FILE);
5952
5967
  if (pathExists(target) && !force) {
5953
5968
  warn(
5954
5969
  `${_LOCAL_CONFIG_FILE} already exists; re-run with --force to overwrite. Skipping interactive init.`
@@ -5975,7 +5990,7 @@ function run_interactive_init(project_root, force) {
5975
5990
  warn(`Could not write ${target}: ${String(exc)}`);
5976
5991
  return 1;
5977
5992
  }
5978
- success(`Wrote ${path7.relative(project_root, target)} (${user_type} / ${stack} / ${verbosity})`);
5993
+ success(`Wrote ${path8.relative(project_root, target)} (${user_type} / ${stack} / ${verbosity})`);
5979
5994
  return 0;
5980
5995
  }
5981
5996
  var _WIZARD_READY_RE = /^WIZARD_READY (http:\/\/(?:127\.0\.0\.1|localhost):\d+\/\S*)\r?$/;
@@ -5993,12 +6008,12 @@ function _wizard_should_launch(opts) {
5993
6008
  return [true, ""];
5994
6009
  }
5995
6010
  function _wizard_cli_dist(_project_root) {
5996
- const package_root = path7.dirname(path7.dirname(path7.dirname(resolvePath(_HERE))));
5997
- const cli = path7.join(package_root, "dist", "cli", "agent-config.js");
6011
+ const package_root = path8.dirname(path8.dirname(path8.dirname(resolvePath(_HERE))));
6012
+ const cli = path8.join(package_root, "dist", "cli", "agent-config.js");
5998
6013
  return pathExists(cli) ? cli : null;
5999
6014
  }
6000
6015
  function _server_info_path() {
6001
- return path7.join(os3.homedir(), ".event4u", "agent-config", "local-server.json");
6016
+ return path8.join(os3.homedir(), ".event4u", "agent-config", "local-server.json");
6002
6017
  }
6003
6018
  function _pid_is_agent_config(pid) {
6004
6019
  let res;
@@ -6015,7 +6030,7 @@ function _pid_is_agent_config(pid) {
6015
6030
  }
6016
6031
  function unlinkMissingOk(p) {
6017
6032
  try {
6018
- fs9.unlinkSync(p);
6033
+ fs10.unlinkSync(p);
6019
6034
  } catch {
6020
6035
  }
6021
6036
  }
@@ -6093,14 +6108,14 @@ function _wizard_spawn(project_root, pass_project_root = true) {
6093
6108
  }
6094
6109
  function _wizard_run_sync(cmd, env, cli) {
6095
6110
  const total = _WIZARD_TIMEOUTS.reduce((a, b) => a + b, 0);
6096
- const log_path = path7.join(
6111
+ const log_path = path8.join(
6097
6112
  os3.tmpdir(),
6098
6113
  `agent-config-wizard-${process2.pid}-${Date.now()}.log`
6099
6114
  );
6100
6115
  let child;
6101
6116
  let log_fd = null;
6102
6117
  try {
6103
- log_fd = fs9.openSync(log_path, "w");
6118
+ log_fd = fs10.openSync(log_path, "w");
6104
6119
  child = spawn(cmd[0], cmd.slice(1), {
6105
6120
  env,
6106
6121
  detached: true,
@@ -6118,7 +6133,7 @@ function _wizard_run_sync(cmd, env, cli) {
6118
6133
  } finally {
6119
6134
  if (log_fd !== null) {
6120
6135
  try {
6121
- fs9.closeSync(log_fd);
6136
+ fs10.closeSync(log_fd);
6122
6137
  } catch {
6123
6138
  }
6124
6139
  }
@@ -6368,8 +6383,8 @@ function main2(argv) {
6368
6383
  const target_root = resolvePath(
6369
6384
  opts.custom_path || opts.project || process2.env["PROJECT_ROOT"] || process2.cwd()
6370
6385
  );
6371
- const minimal_package_root = path7.dirname(
6372
- path7.dirname(path7.dirname(_minimal_templates_root()))
6386
+ const minimal_package_root = path8.dirname(
6387
+ path8.dirname(path8.dirname(_minimal_templates_root()))
6373
6388
  );
6374
6389
  const validated_user_type = _validate_user_type(minimal_package_root, opts.user_type);
6375
6390
  return install_minimal(target_root, opts.force, validated_user_type);
@@ -6401,7 +6416,7 @@ function main2(argv) {
6401
6416
  return rc2;
6402
6417
  }
6403
6418
  const project_root = custom_path || resolvePath(opts.project || process2.env["PROJECT_ROOT"] || process2.cwd());
6404
- const is_first_run = !pathExists(path7.join(project_root, SETTINGS_FILE));
6419
+ const is_first_run = !pathExists(path8.join(project_root, SETTINGS_FILE));
6405
6420
  const rc = _main_project_install(opts, project_root, parsed_tools, is_first_run);
6406
6421
  if (rc === 0 && opts.interactive) {
6407
6422
  run_interactive_init(project_root, opts.force);
@@ -6465,16 +6480,16 @@ function _team_setup_hint_line(project_root) {
6465
6480
  return " \u2022 Claude Code team mode (optional cross-model review via the official codex plugin): run `agent-config doctor --check team` for setup status.";
6466
6481
  }
6467
6482
  function finalize_claude_model_tiers(project_root) {
6468
- const claude_skills = path7.join(project_root, ".claude", "skills");
6469
- const augment_skills = path7.join(project_root, ".augment", "skills");
6483
+ const claude_skills = path8.join(project_root, ".claude", "skills");
6484
+ const augment_skills = path8.join(project_root, ".augment", "skills");
6470
6485
  if (!isDir(claude_skills) || !isDir(augment_skills)) return 0;
6471
6486
  if (_read_consumer_auto_switch(project_root) !== "auto") return 0;
6472
6487
  let rendered = 0;
6473
- const entries = fs9.readdirSync(claude_skills).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
6488
+ const entries = fs10.readdirSync(claude_skills).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
6474
6489
  for (const name of entries) {
6475
- const entry = path7.join(claude_skills, name);
6476
- const src_dir = path7.join(augment_skills, name);
6477
- const src_md = path7.join(src_dir, "SKILL.md");
6490
+ const entry = path8.join(claude_skills, name);
6491
+ const src_dir = path8.join(augment_skills, name);
6492
+ const src_md = path8.join(src_dir, "SKILL.md");
6478
6493
  let tier;
6479
6494
  try {
6480
6495
  tier = read_model_tier(src_md);
@@ -6483,22 +6498,22 @@ function finalize_claude_model_tiers(project_root) {
6483
6498
  }
6484
6499
  if (tier === null || !(tier in TIER_TO_CLAUDE_MODEL) || !isDir(src_dir)) continue;
6485
6500
  if (isSymlink(entry) || isFile(entry)) {
6486
- fs9.unlinkSync(entry);
6501
+ fs10.unlinkSync(entry);
6487
6502
  } else if (isDir(entry)) {
6488
- fs9.rmSync(entry, { recursive: true, force: true });
6503
+ fs10.rmSync(entry, { recursive: true, force: true });
6489
6504
  }
6490
6505
  mkdirp(entry);
6491
- const srcFiles = fs9.readdirSync(src_dir).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
6506
+ const srcFiles = fs10.readdirSync(src_dir).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
6492
6507
  for (const fname of srcFiles) {
6493
6508
  if (fname === "SKILL.md") {
6494
6509
  writeText(
6495
- path7.join(entry, "SKILL.md"),
6510
+ path8.join(entry, "SKILL.md"),
6496
6511
  render_native_model_md(readText(src_md), tier)
6497
6512
  );
6498
6513
  } else {
6499
- fs9.symlinkSync(
6500
- path7.join("../../../.augment/skills", name, fname),
6501
- path7.join(entry, fname)
6514
+ fs10.symlinkSync(
6515
+ path8.join("../../../.augment/skills", name, fname),
6516
+ path8.join(entry, fname)
6502
6517
  );
6503
6518
  }
6504
6519
  }
@@ -6516,7 +6531,7 @@ function _main_project_install(opts, project_root, parsed_tools, is_first_run) {
6516
6531
  let package_type;
6517
6532
  if (opts.package) {
6518
6533
  package_root = resolvePath(opts.package);
6519
- if (!pathExists(path7.join(package_root, "src", "config", "profiles", "minimal.ini"))) {
6534
+ if (!pathExists(path8.join(package_root, "src", "config", "profiles", "minimal.ini"))) {
6520
6535
  fail(`Invalid --package path (missing src/config/profiles/minimal.ini): ${package_root}`);
6521
6536
  }
6522
6537
  package_type = detect_package_type_for_project(project_root, package_root);
@@ -6544,7 +6559,10 @@ function _main_project_install(opts, project_root, parsed_tools, is_first_run) {
6544
6559
  ...ensure_augment_bridge(project_root, opts.force)
6545
6560
  ];
6546
6561
  if (_is_tool_enabled(tools, "claude-code")) {
6547
- merged_keys_by_tool["claude-code"] = ensure_claude_bridge(project_root, opts.force);
6562
+ merged_keys_by_tool["claude-code"] = [
6563
+ ...ensure_claude_bridge(project_root, opts.force),
6564
+ ...ensure_mcp_bridge(project_root, opts.force)
6565
+ ];
6548
6566
  }
6549
6567
  if (_is_tool_enabled(tools, "cursor")) {
6550
6568
  merged_keys_by_tool["cursor"] = ensure_cursor_bridge(project_root, opts.force);
@@ -6567,6 +6585,10 @@ function _main_project_install(opts, project_root, parsed_tools, is_first_run) {
6567
6585
  if (_is_tool_enabled(tools, "jetbrains")) ensure_jetbrains_bridge(project_root, opts.force);
6568
6586
  if (_is_tool_enabled(tools, "kiro")) ensure_kiro_bridge(project_root, opts.force);
6569
6587
  }
6588
+ const tier_advisory = _tier_b_advisory(package_root);
6589
+ if (tier_advisory !== null && !state.QUIET) {
6590
+ info(tier_advisory);
6591
+ }
6570
6592
  if (opts.augment_user_hooks) {
6571
6593
  (merged_keys_by_tool["augment"] ??= []).push(...ensure_augment_user_hooks(package_root, opts.force));
6572
6594
  }
@@ -6653,9 +6675,9 @@ function _main_project_install(opts, project_root, parsed_tools, is_first_run) {
6653
6675
  function _resolvedArgv1() {
6654
6676
  if (process2.argv[1] === void 0) return void 0;
6655
6677
  try {
6656
- return fs9.realpathSync(path7.resolve(process2.argv[1]));
6678
+ return fs10.realpathSync(path8.resolve(process2.argv[1]));
6657
6679
  } catch {
6658
- return path7.resolve(process2.argv[1]);
6680
+ return path8.resolve(process2.argv[1]);
6659
6681
  }
6660
6682
  }
6661
6683
  var _argv1 = _resolvedArgv1();