@event4u/agent-config 9.8.0 → 9.9.0

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