@event4u/agent-config 14.11.0 → 14.12.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 (350) hide show
  1. package/.augment-plugin/marketplace.json +3 -3
  2. package/.augment-plugin/plugin.json +1 -1
  3. package/.claude-plugin/marketplace.json +1 -1
  4. package/CHANGELOG.md +156 -538
  5. package/README.md +1 -1
  6. package/dist/agent-src/contexts/execution/evidence-discipline.md +26 -0
  7. package/dist/agent-src/skills/code-refactoring/SKILL.md +45 -1
  8. package/dist/agent-src/skills/code-review/SKILL.md +65 -6
  9. package/dist/agent-src/skills/command-writing/SKILL.md +35 -0
  10. package/dist/agent-src/skills/existing-ui-audit/SKILL.md +8 -1
  11. package/dist/agent-src/skills/project-analysis-core/SKILL.md +23 -0
  12. package/dist/agent-src/skills/react-shadcn-ui/SKILL.md +29 -12
  13. package/dist/agent-src/skills/skill-writing/references/procedure.md +24 -2
  14. package/dist/agent-src/skills/storybook-workshop/SKILL.md +9 -0
  15. package/dist/agent-src/skills/ui-component-architect/SKILL.md +8 -0
  16. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  17. package/dist/cli-delegate/{chunk-L43NCYPB.js → chunk-JCW7ZLHK.js} +5 -0
  18. package/dist/cli-delegate/{chunk-236PNQZK.js → chunk-JJA2QEWA.js} +1 -1
  19. package/dist/cli-delegate/cmd_export.js +2 -2
  20. package/dist/cli-delegate/cmd_prune.js +2 -2
  21. package/dist/cli-delegate/cmd_settings_migrate.js +2 -2
  22. package/dist/cli-delegate/cmd_settings_set.js +1 -1
  23. package/dist/cli-delegate/cmd_sync.js +2 -2
  24. package/dist/cli-delegate/cmd_uninstall.js +2 -2
  25. package/dist/cli-delegate/cmd_validate.js +2 -2
  26. package/dist/discovery/deprecation-report.md +1 -1
  27. package/dist/discovery/discovery-manifest.json +10 -10
  28. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  29. package/dist/discovery/discovery-manifest.summary.md +1 -1
  30. package/dist/discovery/dormancy-report.md +1 -1
  31. package/dist/discovery/orphan-report.md +1 -1
  32. package/dist/discovery/packs.json +2 -2
  33. package/dist/discovery/trust-report.md +1 -1
  34. package/dist/discovery/workspaces.json +2 -2
  35. package/dist/hooks/dispatch.js +1081 -879
  36. package/dist/install/install.mjs +5 -0
  37. package/dist/mcp/registry-manifest.json +2 -2
  38. package/dist/mcp/server.json +2 -2
  39. package/dist/server/schemas/settings.js +3 -0
  40. package/docs/contracts/settings-classes.md +24 -4
  41. package/docs/guidelines/agent-infra/downstream-changes-mechanics.md +91 -0
  42. package/docs/guidelines/code-clarity.md +21 -0
  43. package/docs/guidelines/redundancy-taxonomy.md +180 -0
  44. package/package.json +6 -2
  45. package/src/config/agent-settings.template.yml +16 -0
  46. package/src/config/budgets.yml +19 -0
  47. package/src/config/ci-local-parity.yml +15 -0
  48. package/src/config/discovery/prompt-patterns.yml +56 -0
  49. package/src/config/estate-count-budget.json +8 -3
  50. package/src/config/gate-coverage.yml +191 -6
  51. package/src/config/gate-violation-baselines.json +3 -3
  52. package/src/config/pack-size-budget.json +39 -12
  53. package/src/config/preamble-payload-budget.json +97 -71
  54. package/src/config/routing-coverage-seed.json +29 -0
  55. package/src/config/suggestion-capture.json +28 -0
  56. package/src/config/surface-matrix.yml +21 -2
  57. package/src/config/web-launch-readiness.json +188 -0
  58. package/src/scripts/_lib/gate_baseline.ts +150 -1
  59. package/src/scripts/_lib/skill_estate.ts +115 -0
  60. package/src/scripts/ai_council/argument_exhaustion.ts +130 -0
  61. package/src/scripts/check_bundle_path_leakage.ts +162 -7
  62. package/src/scripts/check_command_examples.ts +557 -0
  63. package/src/scripts/check_estate_count.ts +122 -3
  64. package/src/scripts/check_preamble_payload_budget.ts +30 -3
  65. package/src/scripts/check_routing_coverage.ts +352 -0
  66. package/src/scripts/check_score_contract.ts +505 -0
  67. package/src/scripts/check_skill_admissions.ts +514 -0
  68. package/src/scripts/check_web_launch_readiness.ts +705 -0
  69. package/src/scripts/description_route_check.ts +494 -0
  70. package/src/scripts/hook_manifest.json +1 -1
  71. package/src/scripts/hook_manifest.yaml +29 -2
  72. package/src/scripts/hooks/concern_registry.ts +2 -0
  73. package/src/scripts/hooks/suggestion_capture_hook.ts +368 -0
  74. package/src/scripts/lint_budget_ownership.ts +54 -4
  75. package/src/scripts/lint_skill_trigger_corpus.ts +349 -0
  76. package/src/scripts/pack_install_smoke.ts +363 -0
  77. package/src/scripts/pr_conflict_census.ts +187 -0
  78. package/src/scripts/report_pack_delta.ts +204 -0
  79. package/src/scripts/select_analysis_mode.ts +112 -0
  80. package/src/scripts/sync_pr_branch.ts +40 -1
  81. package/src/server/schemas/settings.ts +5 -0
  82. package/dist/agent-src/skills/accessibility-auditor/evals/evals.json +0 -15
  83. package/dist/agent-src/skills/agent-security-review/evals/triggers.json +0 -52
  84. package/dist/agent-src/skills/ai-code-blindspots/evals/triggers.json +0 -52
  85. package/dist/agent-src/skills/alerting-doctrine/evals/triggers.json +0 -17
  86. package/dist/agent-src/skills/analysis-skill-router/evals/evals.json +0 -13
  87. package/dist/agent-src/skills/brand/evals/triggers.json +0 -17
  88. package/dist/agent-src/skills/brand-asset-generation/evals/triggers.json +0 -17
  89. package/dist/agent-src/skills/brand-audit/evals/triggers.json +0 -17
  90. package/dist/agent-src/skills/brand-identity/evals/triggers.json +0 -17
  91. package/dist/agent-src/skills/brand-strategy/evals/triggers.json +0 -17
  92. package/dist/agent-src/skills/brand-to-tokens/evals/triggers.json +0 -17
  93. package/dist/agent-src/skills/bug-analyzer/evals/evals.json +0 -13
  94. package/dist/agent-src/skills/canvas-design/evals/triggers.json +0 -17
  95. package/dist/agent-src/skills/character-consistency/evals/evals.json +0 -16
  96. package/dist/agent-src/skills/code-intelligence/evals/triggers.json +0 -52
  97. package/dist/agent-src/skills/code-review/evals/evals.json +0 -100
  98. package/dist/agent-src/skills/command-routing/evals/evals.json +0 -14
  99. package/dist/agent-src/skills/complexity-first-planning/evals/triggers.json +0 -17
  100. package/dist/agent-src/skills/contract-review/evals/triggers.json +0 -17
  101. package/dist/agent-src/skills/conventional-commits-writing/evals/evals.json +0 -15
  102. package/dist/agent-src/skills/corpus-grounding/evals/triggers.json +0 -17
  103. package/dist/agent-src/skills/dashboard-design/evals/evals.json +0 -16
  104. package/dist/agent-src/skills/dcf-modeling/evals/domain-truth.json +0 -29
  105. package/dist/agent-src/skills/dcf-modeling/evals/evals.json +0 -20
  106. package/dist/agent-src/skills/decision-record/evals/evals.json +0 -20
  107. package/dist/agent-src/skills/decision-record/evals/triggers.json +0 -87
  108. package/dist/agent-src/skills/design-intelligence/evals/evals.json +0 -14
  109. package/dist/agent-src/skills/design-intelligence/evals/triggers.json +0 -17
  110. package/dist/agent-src/skills/design-system-capture/evals/evals.json +0 -15
  111. package/dist/agent-src/skills/design-tokens/evals/triggers.json +0 -17
  112. package/dist/agent-src/skills/design-variations/evals/triggers.json +0 -17
  113. package/dist/agent-src/skills/developer-like-execution/evals/evals.json +0 -16
  114. package/dist/agent-src/skills/doc-coauthoring/evals/evals.json +0 -16
  115. package/dist/agent-src/skills/doc-coauthoring/evals/triggers.json +0 -17
  116. package/dist/agent-src/skills/docx-authoring/evals/triggers.json +0 -52
  117. package/dist/agent-src/skills/dpa-review/evals/triggers.json +0 -17
  118. package/dist/agent-src/skills/editorial-calendar/evals/domain-truth.json +0 -16
  119. package/dist/agent-src/skills/editorial-calendar/evals/evals.json +0 -16
  120. package/dist/agent-src/skills/eloquent/evals/triggers.json +0 -17
  121. package/dist/agent-src/skills/estimate-ticket/evals/evals.json +0 -16
  122. package/dist/agent-src/skills/estimate-ticket/evals/output-schema.yml +0 -20
  123. package/dist/agent-src/skills/estimate-ticket/evals/triggers.json +0 -19
  124. package/dist/agent-src/skills/evaluate-llm-feature/evals/triggers.json +0 -52
  125. package/dist/agent-src/skills/existing-ui-audit/evals/triggers.json +0 -47
  126. package/dist/agent-src/skills/experiment-loop/evals/output-schema.yml +0 -27
  127. package/dist/agent-src/skills/experiment-loop/evals/triggers.json +0 -17
  128. package/dist/agent-src/skills/fe-design/evals/triggers.json +0 -67
  129. package/dist/agent-src/skills/forecasting/evals/domain-truth.json +0 -29
  130. package/dist/agent-src/skills/forecasting/evals/evals.json +0 -20
  131. package/dist/agent-src/skills/forensics-report/evals/triggers.json +0 -17
  132. package/dist/agent-src/skills/frontend-render-security/evals/triggers.json +0 -52
  133. package/dist/agent-src/skills/fundraising-narrative/evals/domain-truth.json +0 -16
  134. package/dist/agent-src/skills/fundraising-narrative/evals/evals.json +0 -16
  135. package/dist/agent-src/skills/gated-reach/evals/triggers.json +0 -72
  136. package/dist/agent-src/skills/github-ci/evals/evals.json +0 -25
  137. package/dist/agent-src/skills/history-design/evals/triggers.json +0 -17
  138. package/dist/agent-src/skills/html-deck/evals/triggers.json +0 -17
  139. package/dist/agent-src/skills/humanizer/evals/strip_fixtures.json +0 -57
  140. package/dist/agent-src/skills/humanizer/evals/triggers.json +0 -17
  141. package/dist/agent-src/skills/iconography/evals/triggers.json +0 -17
  142. package/dist/agent-src/skills/image-analyser/evals/triggers.json +0 -17
  143. package/dist/agent-src/skills/image-creator/evals/triggers.json +0 -17
  144. package/dist/agent-src/skills/image-editing/evals/triggers.json +0 -17
  145. package/dist/agent-src/skills/image-generation/evals/triggers.json +0 -17
  146. package/dist/agent-src/skills/image-provider-routing/evals/triggers.json +0 -17
  147. package/dist/agent-src/skills/incident-commander/evals/domain-truth.json +0 -16
  148. package/dist/agent-src/skills/incident-commander/evals/evals.json +0 -20
  149. package/dist/agent-src/skills/js-library-packaging/evals/triggers.json +0 -17
  150. package/dist/agent-src/skills/judge-artifact-completeness/evals/triggers.json +0 -17
  151. package/dist/agent-src/skills/judge-injection-defense/evals/triggers.json +0 -17
  152. package/dist/agent-src/skills/judge-synthesis/evals/triggers.json +0 -17
  153. package/dist/agent-src/skills/launch-readiness/evals/evals.json +0 -21
  154. package/dist/agent-src/skills/learning-tutor/evals/triggers.json +0 -52
  155. package/dist/agent-src/skills/legal-intake-triage/evals/triggers.json +0 -17
  156. package/dist/agent-src/skills/legal-practice-profile/evals/triggers.json +0 -17
  157. package/dist/agent-src/skills/license-compliance-audit/evals/triggers.json +0 -52
  158. package/dist/agent-src/skills/license-compliance-borrow-check/evals/triggers.json +0 -52
  159. package/dist/agent-src/skills/license-compliance-credits/evals/triggers.json +0 -52
  160. package/dist/agent-src/skills/llm-provider-knowledge/evals/triggers.json +0 -20
  161. package/dist/agent-src/skills/logging-monitoring/evals/evals.json +0 -16
  162. package/dist/agent-src/skills/logo-generation/evals/triggers.json +0 -17
  163. package/dist/agent-src/skills/messaging-architecture/evals/domain-truth.json +0 -16
  164. package/dist/agent-src/skills/messaging-architecture/evals/evals.json +0 -16
  165. package/dist/agent-src/skills/monorepo-workspace/evals/triggers.json +0 -17
  166. package/dist/agent-src/skills/nda-triage/evals/triggers.json +0 -17
  167. package/dist/agent-src/skills/operational-readiness/evals/triggers.json +0 -17
  168. package/dist/agent-src/skills/pdf-tools/evals/triggers.json +0 -52
  169. package/dist/agent-src/skills/perf-feedback-craft/evals/evals.json +0 -16
  170. package/dist/agent-src/skills/persona-improvement/evals/triggers.json +0 -52
  171. package/dist/agent-src/skills/php-coder/evals/triggers.json +0 -17
  172. package/dist/agent-src/skills/prediction-pool-optimizer/evals/triggers.json +0 -21
  173. package/dist/agent-src/skills/prompt-engineering-image/evals/triggers.json +0 -17
  174. package/dist/agent-src/skills/prompt-engineering-patterns/evals/evals.json +0 -16
  175. package/dist/agent-src/skills/prompt-validator/evals/triggers.json +0 -17
  176. package/dist/agent-src/skills/quality-tools/evals/evals.json +0 -15
  177. package/dist/agent-src/skills/reasoning-orchestrator/evals/triggers.json +0 -17
  178. package/dist/agent-src/skills/refine-prompt/evals/evals.json +0 -16
  179. package/dist/agent-src/skills/refine-ticket/evals/evals.json +0 -16
  180. package/dist/agent-src/skills/refine-ticket/evals/output-schema.yml +0 -16
  181. package/dist/agent-src/skills/refine-ticket/evals/triggers.json +0 -17
  182. package/dist/agent-src/skills/release-comms/evals/evals.json +0 -16
  183. package/dist/agent-src/skills/rice-prioritization/evals/evals.json +0 -20
  184. package/dist/agent-src/skills/runway-cognition/evals/domain-truth.json +0 -29
  185. package/dist/agent-src/skills/runway-cognition/evals/evals.json +0 -20
  186. package/dist/agent-src/skills/scenario-modeling/evals/domain-truth.json +0 -29
  187. package/dist/agent-src/skills/scenario-modeling/evals/evals.json +0 -20
  188. package/dist/agent-src/skills/schema-review/evals/triggers.json +0 -17
  189. package/dist/agent-src/skills/screenshot-hygiene/evals/triggers.json +0 -52
  190. package/dist/agent-src/skills/security-maturity-assessment/evals/triggers.json +0 -52
  191. package/dist/agent-src/skills/server-hardening/evals/triggers.json +0 -17
  192. package/dist/agent-src/skills/skill-writing/evals/triggers.json +0 -17
  193. package/dist/agent-src/skills/spreadsheet-authoring/evals/triggers.json +0 -47
  194. package/dist/agent-src/skills/storybook-workshop/evals/triggers.json +0 -17
  195. package/dist/agent-src/skills/subagent-orchestration/evals/evals.json +0 -60
  196. package/dist/agent-src/skills/supply-chain-intake/evals/triggers.json +0 -52
  197. package/dist/agent-src/skills/systematic-debugging/evals/evals.json +0 -20
  198. package/dist/agent-src/skills/test-case-discovery/evals/triggers.json +0 -52
  199. package/dist/agent-src/skills/test-driven-development/evals/evals.json +0 -16
  200. package/dist/agent-src/skills/threat-modeling/evals/evals.json +0 -21
  201. package/dist/agent-src/skills/typography-system/evals/evals.json +0 -14
  202. package/dist/agent-src/skills/typography-system/evals/triggers.json +0 -17
  203. package/dist/agent-src/skills/unit-economics-modeling/evals/domain-truth.json +0 -40
  204. package/dist/agent-src/skills/unit-economics-modeling/evals/evals.json +0 -24
  205. package/dist/agent-src/skills/verify-completion-evidence/evals/evals.json +0 -16
  206. package/dist/agent-src/skills/verify-repair-loop/evals/output-schema.yml +0 -20
  207. package/dist/agent-src/skills/verify-repair-loop/evals/triggers.json +0 -17
  208. package/dist/agent-src/skills/vision-articulation/evals/evals.json +0 -16
  209. package/dist/agent-src/skills/voice-and-tone-design/evals/evals.json +0 -16
  210. package/dist/agent-src/skills/wireframe/evals/triggers.json +0 -17
  211. package/dist/agent-src/skills/workspace-link/evals/triggers.json +0 -17
  212. package/dist/agent-src/skills/worktree-lifecycle/evals/evals.json +0 -38
  213. package/dist/agent-src/skills/worktree-lifecycle/evals/triggers.json +0 -52
  214. package/dist/cli/agent-config.js.map +0 -1
  215. package/dist/cli/bash/runBash.js.map +0 -1
  216. package/dist/cli/commands/commands.js.map +0 -1
  217. package/dist/cli/commands/config.js.map +0 -1
  218. package/dist/cli/commands/doctorShell.js.map +0 -1
  219. package/dist/cli/commands/mcpServer.js.map +0 -1
  220. package/dist/cli/commands/packs.js.map +0 -1
  221. package/dist/cli/commands/profiles.js.map +0 -1
  222. package/dist/cli/commands/recordTriggerEval.js.map +0 -1
  223. package/dist/cli/commands/rtkDetect.js.map +0 -1
  224. package/dist/cli/commands/settings.js.map +0 -1
  225. package/dist/cli/commands/uiAudit.js.map +0 -1
  226. package/dist/cli/commands/uiRender.js.map +0 -1
  227. package/dist/cli/commands/uiServe.js.map +0 -1
  228. package/dist/cli/commands/versions.js.map +0 -1
  229. package/dist/cli/commands/workspaces.js.map +0 -1
  230. package/dist/cli/configRoot.js.map +0 -1
  231. package/dist/cli/discovery/loadManifest.js.map +0 -1
  232. package/dist/cli/firstRunNotice.js.map +0 -1
  233. package/dist/cli/help.js.map +0 -1
  234. package/dist/cli/initRouting.js.map +0 -1
  235. package/dist/cli/log/logger.js.map +0 -1
  236. package/dist/cli/main.js.map +0 -1
  237. package/dist/cli/mcp/content.js.map +0 -1
  238. package/dist/cli/mcp/dispatch.js.map +0 -1
  239. package/dist/cli/mcp/stdio.js.map +0 -1
  240. package/dist/cli/paths.js.map +0 -1
  241. package/dist/cli/python/knowledge_ingest.js.map +0 -1
  242. package/dist/cli/python/workspace_analytics.js.map +0 -1
  243. package/dist/cli/python/workspace_crypto.js.map +0 -1
  244. package/dist/cli/python/workspace_documents.js.map +0 -1
  245. package/dist/cli/python/workspace_drive.js.map +0 -1
  246. package/dist/cli/python/workspace_drive_health.js.map +0 -1
  247. package/dist/cli/python/workspace_explain.js.map +0 -1
  248. package/dist/cli/python/workspace_hosts.js.map +0 -1
  249. package/dist/cli/python/workspace_inbox.js.map +0 -1
  250. package/dist/cli/python/workspace_render.js.map +0 -1
  251. package/dist/cli/python/workspace_roles.js.map +0 -1
  252. package/dist/cli/python/workspace_secrets.js.map +0 -1
  253. package/dist/cli/python/workspace_sessions.js.map +0 -1
  254. package/dist/cli/python/workspace_skills.js.map +0 -1
  255. package/dist/cli/registry.js.map +0 -1
  256. package/dist/install/agentSwitchDetection.js.map +0 -1
  257. package/dist/install/agentSwitchProfile.js.map +0 -1
  258. package/dist/install/atomic.js.map +0 -1
  259. package/dist/install/claudePathsPlan.js.map +0 -1
  260. package/dist/install/conflict.js.map +0 -1
  261. package/dist/install/detect.js.map +0 -1
  262. package/dist/install/emit_host_rules_cli.js.map +0 -1
  263. package/dist/install/globalRuleLayers.js.map +0 -1
  264. package/dist/install/hostLayerFingerprint.js.map +0 -1
  265. package/dist/install/partitionEligibility.js.map +0 -1
  266. package/dist/install/paths.js.map +0 -1
  267. package/dist/install/plan.js.map +0 -1
  268. package/dist/install/preflight.js.map +0 -1
  269. package/dist/install/rtkDetection.js.map +0 -1
  270. package/dist/install/ruleInScope.js.map +0 -1
  271. package/dist/install/ruleLayerPartition.js.map +0 -1
  272. package/dist/install/rule_scope.js.map +0 -1
  273. package/dist/install/rule_scope_cli.js.map +0 -1
  274. package/dist/install/selectedTools.js.map +0 -1
  275. package/dist/install/toolDetection.js.map +0 -1
  276. package/dist/install/txlog.js.map +0 -1
  277. package/dist/install/types.js.map +0 -1
  278. package/dist/install/wizard-plan.js.map +0 -1
  279. package/dist/install/wizardDismissals.js.map +0 -1
  280. package/dist/scripts/_lib/agent_settings.js.map +0 -1
  281. package/dist/scripts/_lib/agent_src.js.map +0 -1
  282. package/dist/scripts/_lib/claude_builtin_names.js.map +0 -1
  283. package/dist/scripts/_lib/claude_plugin.js.map +0 -1
  284. package/dist/scripts/_lib/claude_settings_hooks.js.map +0 -1
  285. package/dist/scripts/_lib/compile_time_toggles.js.map +0 -1
  286. package/dist/scripts/_lib/environment_detector.js.map +0 -1
  287. package/dist/scripts/_lib/host_launch.js.map +0 -1
  288. package/dist/scripts/_lib/install_layout.js.map +0 -1
  289. package/dist/scripts/_lib/installed_lock.js.map +0 -1
  290. package/dist/scripts/_lib/lean_projection_mode.js.map +0 -1
  291. package/dist/scripts/_lib/model_tier.js.map +0 -1
  292. package/dist/scripts/_lib/prune_empty_dirs.js.map +0 -1
  293. package/dist/scripts/_lib/scoped_projection.js.map +0 -1
  294. package/dist/scripts/_lib/script_output.js.map +0 -1
  295. package/dist/scripts/_lib/spawn_env.js.map +0 -1
  296. package/dist/scripts/_lib/surface_tiers.js.map +0 -1
  297. package/dist/scripts/_lib/token_count.js.map +0 -1
  298. package/dist/scripts/_lib/trigger_eval_floors.js.map +0 -1
  299. package/dist/scripts/_lib/ui_surface.js.map +0 -1
  300. package/dist/scripts/_lib/user_global_paths.js.map +0 -1
  301. package/dist/scripts/ai_council/modes.js.map +0 -1
  302. package/dist/scripts/ai_council/transport_resolver.js.map +0 -1
  303. package/dist/scripts/condense.js.map +0 -1
  304. package/dist/scripts/project_thin_rules.js.map +0 -1
  305. package/dist/server/app.js.map +0 -1
  306. package/dist/server/io/atomicMultiWrite.js.map +0 -1
  307. package/dist/server/io/atomicWrite.js.map +0 -1
  308. package/dist/server/io/sharedWriteCheck.js.map +0 -1
  309. package/dist/server/io/substituteTemplate.js.map +0 -1
  310. package/dist/server/io/yamlIO.js.map +0 -1
  311. package/dist/server/nicknameResolver.js.map +0 -1
  312. package/dist/server/port.js.map +0 -1
  313. package/dist/server/routes/discovery.js.map +0 -1
  314. package/dist/server/routes/install.js.map +0 -1
  315. package/dist/server/routes/ping.js.map +0 -1
  316. package/dist/server/routes/schema.js.map +0 -1
  317. package/dist/server/routes/settings.js.map +0 -1
  318. package/dist/server/routes/settingsChanges.js.map +0 -1
  319. package/dist/server/routes/userMd.js.map +0 -1
  320. package/dist/server/routes/wizard.js.map +0 -1
  321. package/dist/server/routes/workspace.js.map +0 -1
  322. package/dist/server/schemas/settings.js.map +0 -1
  323. package/dist/server/serverInfo.js.map +0 -1
  324. package/dist/server/token.js.map +0 -1
  325. package/dist/server/writeRoot.js.map +0 -1
  326. package/dist/shared/capabilities.js.map +0 -1
  327. package/dist/shared/interactiveContext.js.map +0 -1
  328. package/dist/shared/nicknamePrefill.js.map +0 -1
  329. package/dist/shared/settingsAsks.js.map +0 -1
  330. package/dist/shared/settingsCarveOut.js.map +0 -1
  331. package/dist/shared/settingsClasses.js.map +0 -1
  332. package/dist/shared/settingsConsent.js.map +0 -1
  333. package/dist/shared/settingsSurface.js.map +0 -1
  334. package/dist/shared/skillRanking.js.map +0 -1
  335. package/dist/shared/userMd/formAdapter.js.map +0 -1
  336. package/dist/shared/userMd/schema.js.map +0 -1
  337. package/dist/shared/userMd/utils.js.map +0 -1
  338. package/dist/ui/assets/index-Cxgy63kz.js.map +0 -1
  339. package/src/scripts/_lib/adr_frontmatter.test.ts +0 -365
  340. package/src/scripts/_lib/adversarial_council_gate.test.ts +0 -112
  341. package/src/scripts/_lib/adversarial_reconcile.test.ts +0 -197
  342. package/src/scripts/_lib/auto_dispatch.corpus.test.ts +0 -150
  343. package/src/scripts/_lib/secret_detector.test.ts +0 -108
  344. package/src/scripts/_lib/secret_detector_adversarial.test.ts +0 -116
  345. package/src/scripts/_lib/ui_authority.test.ts +0 -251
  346. package/src/scripts/_lib/untrusted_content.test.ts +0 -175
  347. package/src/scripts/check_secret_leak.test.ts +0 -90
  348. package/src/scripts/design_slop_rules.test.ts +0 -246
  349. package/src/scripts/self_review_gate.test.ts +0 -296
  350. package/src/shared/capabilities.test.ts +0 -43
@@ -112,17 +112,17 @@ var require_visit = __commonJS({
112
112
  visit.BREAK = BREAK;
113
113
  visit.SKIP = SKIP;
114
114
  visit.REMOVE = REMOVE;
115
- function visit_(key, node, visitor, path95) {
116
- const ctrl = callVisitor(key, node, visitor, path95);
115
+ function visit_(key, node, visitor, path96) {
116
+ const ctrl = callVisitor(key, node, visitor, path96);
117
117
  if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
118
- replaceNode(key, path95, ctrl);
119
- return visit_(key, ctrl, visitor, path95);
118
+ replaceNode(key, path96, ctrl);
119
+ return visit_(key, ctrl, visitor, path96);
120
120
  }
121
121
  if (typeof ctrl !== "symbol") {
122
122
  if (identity.isCollection(node)) {
123
- path95 = Object.freeze(path95.concat(node));
123
+ path96 = Object.freeze(path96.concat(node));
124
124
  for (let i = 0; i < node.items.length; ++i) {
125
- const ci = visit_(i, node.items[i], visitor, path95);
125
+ const ci = visit_(i, node.items[i], visitor, path96);
126
126
  if (typeof ci === "number")
127
127
  i = ci - 1;
128
128
  else if (ci === BREAK)
@@ -133,13 +133,13 @@ var require_visit = __commonJS({
133
133
  }
134
134
  }
135
135
  } else if (identity.isPair(node)) {
136
- path95 = Object.freeze(path95.concat(node));
137
- const ck = visit_("key", node.key, visitor, path95);
136
+ path96 = Object.freeze(path96.concat(node));
137
+ const ck = visit_("key", node.key, visitor, path96);
138
138
  if (ck === BREAK)
139
139
  return BREAK;
140
140
  else if (ck === REMOVE)
141
141
  node.key = null;
142
- const cv = visit_("value", node.value, visitor, path95);
142
+ const cv = visit_("value", node.value, visitor, path96);
143
143
  if (cv === BREAK)
144
144
  return BREAK;
145
145
  else if (cv === REMOVE)
@@ -160,17 +160,17 @@ var require_visit = __commonJS({
160
160
  visitAsync.BREAK = BREAK;
161
161
  visitAsync.SKIP = SKIP;
162
162
  visitAsync.REMOVE = REMOVE;
163
- async function visitAsync_(key, node, visitor, path95) {
164
- const ctrl = await callVisitor(key, node, visitor, path95);
163
+ async function visitAsync_(key, node, visitor, path96) {
164
+ const ctrl = await callVisitor(key, node, visitor, path96);
165
165
  if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
166
- replaceNode(key, path95, ctrl);
167
- return visitAsync_(key, ctrl, visitor, path95);
166
+ replaceNode(key, path96, ctrl);
167
+ return visitAsync_(key, ctrl, visitor, path96);
168
168
  }
169
169
  if (typeof ctrl !== "symbol") {
170
170
  if (identity.isCollection(node)) {
171
- path95 = Object.freeze(path95.concat(node));
171
+ path96 = Object.freeze(path96.concat(node));
172
172
  for (let i = 0; i < node.items.length; ++i) {
173
- const ci = await visitAsync_(i, node.items[i], visitor, path95);
173
+ const ci = await visitAsync_(i, node.items[i], visitor, path96);
174
174
  if (typeof ci === "number")
175
175
  i = ci - 1;
176
176
  else if (ci === BREAK)
@@ -181,13 +181,13 @@ var require_visit = __commonJS({
181
181
  }
182
182
  }
183
183
  } else if (identity.isPair(node)) {
184
- path95 = Object.freeze(path95.concat(node));
185
- const ck = await visitAsync_("key", node.key, visitor, path95);
184
+ path96 = Object.freeze(path96.concat(node));
185
+ const ck = await visitAsync_("key", node.key, visitor, path96);
186
186
  if (ck === BREAK)
187
187
  return BREAK;
188
188
  else if (ck === REMOVE)
189
189
  node.key = null;
190
- const cv = await visitAsync_("value", node.value, visitor, path95);
190
+ const cv = await visitAsync_("value", node.value, visitor, path96);
191
191
  if (cv === BREAK)
192
192
  return BREAK;
193
193
  else if (cv === REMOVE)
@@ -214,23 +214,23 @@ var require_visit = __commonJS({
214
214
  }
215
215
  return visitor;
216
216
  }
217
- function callVisitor(key, node, visitor, path95) {
217
+ function callVisitor(key, node, visitor, path96) {
218
218
  if (typeof visitor === "function")
219
- return visitor(key, node, path95);
219
+ return visitor(key, node, path96);
220
220
  if (identity.isMap(node))
221
- return visitor.Map?.(key, node, path95);
221
+ return visitor.Map?.(key, node, path96);
222
222
  if (identity.isSeq(node))
223
- return visitor.Seq?.(key, node, path95);
223
+ return visitor.Seq?.(key, node, path96);
224
224
  if (identity.isPair(node))
225
- return visitor.Pair?.(key, node, path95);
225
+ return visitor.Pair?.(key, node, path96);
226
226
  if (identity.isScalar(node))
227
- return visitor.Scalar?.(key, node, path95);
227
+ return visitor.Scalar?.(key, node, path96);
228
228
  if (identity.isAlias(node))
229
- return visitor.Alias?.(key, node, path95);
229
+ return visitor.Alias?.(key, node, path96);
230
230
  return void 0;
231
231
  }
232
- function replaceNode(key, path95, node) {
233
- const parent = path95[path95.length - 1];
232
+ function replaceNode(key, path96, node) {
233
+ const parent = path96[path96.length - 1];
234
234
  if (identity.isCollection(parent)) {
235
235
  parent.items[key] = node;
236
236
  } else if (identity.isPair(parent)) {
@@ -840,10 +840,10 @@ var require_Collection = __commonJS({
840
840
  var createNode = require_createNode();
841
841
  var identity = require_identity();
842
842
  var Node = require_Node();
843
- function collectionFromPath(schema, path95, value) {
843
+ function collectionFromPath(schema, path96, value) {
844
844
  let v = value;
845
- for (let i = path95.length - 1; i >= 0; --i) {
846
- const k = path95[i];
845
+ for (let i = path96.length - 1; i >= 0; --i) {
846
+ const k = path96[i];
847
847
  if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
848
848
  const a = [];
849
849
  a[k] = v;
@@ -862,7 +862,7 @@ var require_Collection = __commonJS({
862
862
  sourceObjects: /* @__PURE__ */ new Map()
863
863
  });
864
864
  }
865
- var isEmptyPath = (path95) => path95 == null || typeof path95 === "object" && !!path95[Symbol.iterator]().next().done;
865
+ var isEmptyPath = (path96) => path96 == null || typeof path96 === "object" && !!path96[Symbol.iterator]().next().done;
866
866
  var Collection = class extends Node.NodeBase {
867
867
  constructor(type, schema) {
868
868
  super(type);
@@ -892,11 +892,11 @@ var require_Collection = __commonJS({
892
892
  * be a Pair instance or a `{ key, value }` object, which may not have a key
893
893
  * that already exists in the map.
894
894
  */
895
- addIn(path95, value) {
896
- if (isEmptyPath(path95))
895
+ addIn(path96, value) {
896
+ if (isEmptyPath(path96))
897
897
  this.add(value);
898
898
  else {
899
- const [key, ...rest] = path95;
899
+ const [key, ...rest] = path96;
900
900
  const node = this.get(key, true);
901
901
  if (identity.isCollection(node))
902
902
  node.addIn(rest, value);
@@ -910,8 +910,8 @@ var require_Collection = __commonJS({
910
910
  * Removes a value from the collection.
911
911
  * @returns `true` if the item was found and removed.
912
912
  */
913
- deleteIn(path95) {
914
- const [key, ...rest] = path95;
913
+ deleteIn(path96) {
914
+ const [key, ...rest] = path96;
915
915
  if (rest.length === 0)
916
916
  return this.delete(key);
917
917
  const node = this.get(key, true);
@@ -925,8 +925,8 @@ var require_Collection = __commonJS({
925
925
  * scalar values from their surrounding node; to disable set `keepScalar` to
926
926
  * `true` (collections are always returned intact).
927
927
  */
928
- getIn(path95, keepScalar) {
929
- const [key, ...rest] = path95;
928
+ getIn(path96, keepScalar) {
929
+ const [key, ...rest] = path96;
930
930
  const node = this.get(key, true);
931
931
  if (rest.length === 0)
932
932
  return !keepScalar && identity.isScalar(node) ? node.value : node;
@@ -944,8 +944,8 @@ var require_Collection = __commonJS({
944
944
  /**
945
945
  * Checks if the collection includes a value with the key `key`.
946
946
  */
947
- hasIn(path95) {
948
- const [key, ...rest] = path95;
947
+ hasIn(path96) {
948
+ const [key, ...rest] = path96;
949
949
  if (rest.length === 0)
950
950
  return this.has(key);
951
951
  const node = this.get(key, true);
@@ -955,8 +955,8 @@ var require_Collection = __commonJS({
955
955
  * Sets a value in this collection. For `!!set`, `value` needs to be a
956
956
  * boolean to add/remove the item from the set.
957
957
  */
958
- setIn(path95, value) {
959
- const [key, ...rest] = path95;
958
+ setIn(path96, value) {
959
+ const [key, ...rest] = path96;
960
960
  if (rest.length === 0) {
961
961
  this.set(key, value);
962
962
  } else {
@@ -980,13 +980,13 @@ var require_Collection = __commonJS({
980
980
  var require_stringifyComment = __commonJS({
981
981
  "node_modules/yaml/dist/stringify/stringifyComment.js"(exports) {
982
982
  "use strict";
983
- var stringifyComment = (str14) => str14.replace(/^(?!$)(?: $)?/gm, "#");
983
+ var stringifyComment = (str15) => str15.replace(/^(?!$)(?: $)?/gm, "#");
984
984
  function indentComment(comment, indent) {
985
985
  if (/^\n+$/.test(comment))
986
986
  return comment.substring(1);
987
987
  return indent ? comment.replace(/^(?! *$)/gm, indent) : comment;
988
988
  }
989
- var lineComment = (str14, indent, comment) => str14.endsWith("\n") ? indentComment(comment, indent) : comment.includes("\n") ? "\n" + indentComment(comment, indent) : (str14.endsWith(" ") ? "" : " ") + comment;
989
+ var lineComment = (str15, indent, comment) => str15.endsWith("\n") ? indentComment(comment, indent) : comment.includes("\n") ? "\n" + indentComment(comment, indent) : (str15.endsWith(" ") ? "" : " ") + comment;
990
990
  exports.indentComment = indentComment;
991
991
  exports.lineComment = lineComment;
992
992
  exports.stringifyComment = stringifyComment;
@@ -1140,16 +1140,16 @@ var require_stringifyString = __commonJS({
1140
1140
  lineWidth: ctx.options.lineWidth,
1141
1141
  minContentWidth: ctx.options.minContentWidth
1142
1142
  });
1143
- var containsDocumentMarker = (str14) => /^(%|---|\.\.\.)/m.test(str14);
1144
- function lineLengthOverLimit(str14, lineWidth, indentLength) {
1143
+ var containsDocumentMarker = (str15) => /^(%|---|\.\.\.)/m.test(str15);
1144
+ function lineLengthOverLimit(str15, lineWidth, indentLength) {
1145
1145
  if (!lineWidth || lineWidth < 0)
1146
1146
  return false;
1147
1147
  const limit = lineWidth - indentLength;
1148
- const strLen = str14.length;
1148
+ const strLen = str15.length;
1149
1149
  if (strLen <= limit)
1150
1150
  return false;
1151
1151
  for (let i = 0, start = 0; i < strLen; ++i) {
1152
- if (str14[i] === "\n") {
1152
+ if (str15[i] === "\n") {
1153
1153
  if (i - start > limit)
1154
1154
  return true;
1155
1155
  start = i + 1;
@@ -1166,11 +1166,11 @@ var require_stringifyString = __commonJS({
1166
1166
  const { implicitKey } = ctx;
1167
1167
  const minMultiLineLength = ctx.options.doubleQuotedMinMultiLineLength;
1168
1168
  const indent = ctx.indent || (containsDocumentMarker(value) ? " " : "");
1169
- let str14 = "";
1169
+ let str15 = "";
1170
1170
  let start = 0;
1171
1171
  for (let i = 0, ch = json[i]; ch; ch = json[++i]) {
1172
1172
  if (ch === " " && json[i + 1] === "\\" && json[i + 2] === "n") {
1173
- str14 += json.slice(start, i) + "\\ ";
1173
+ str15 += json.slice(start, i) + "\\ ";
1174
1174
  i += 1;
1175
1175
  start = i;
1176
1176
  ch = "\\";
@@ -1179,38 +1179,38 @@ var require_stringifyString = __commonJS({
1179
1179
  switch (json[i + 1]) {
1180
1180
  case "u":
1181
1181
  {
1182
- str14 += json.slice(start, i);
1182
+ str15 += json.slice(start, i);
1183
1183
  const code = json.substr(i + 2, 4);
1184
1184
  switch (code) {
1185
1185
  case "0000":
1186
- str14 += "\\0";
1186
+ str15 += "\\0";
1187
1187
  break;
1188
1188
  case "0007":
1189
- str14 += "\\a";
1189
+ str15 += "\\a";
1190
1190
  break;
1191
1191
  case "000b":
1192
- str14 += "\\v";
1192
+ str15 += "\\v";
1193
1193
  break;
1194
1194
  case "001b":
1195
- str14 += "\\e";
1195
+ str15 += "\\e";
1196
1196
  break;
1197
1197
  case "0085":
1198
- str14 += "\\N";
1198
+ str15 += "\\N";
1199
1199
  break;
1200
1200
  case "00a0":
1201
- str14 += "\\_";
1201
+ str15 += "\\_";
1202
1202
  break;
1203
1203
  case "2028":
1204
- str14 += "\\L";
1204
+ str15 += "\\L";
1205
1205
  break;
1206
1206
  case "2029":
1207
- str14 += "\\P";
1207
+ str15 += "\\P";
1208
1208
  break;
1209
1209
  default:
1210
1210
  if (code.substr(0, 2) === "00")
1211
- str14 += "\\x" + code.substr(2);
1211
+ str15 += "\\x" + code.substr(2);
1212
1212
  else
1213
- str14 += json.substr(i, 6);
1213
+ str15 += json.substr(i, 6);
1214
1214
  }
1215
1215
  i += 5;
1216
1216
  start = i + 1;
@@ -1220,14 +1220,14 @@ var require_stringifyString = __commonJS({
1220
1220
  if (implicitKey || json[i + 2] === '"' || json.length < minMultiLineLength) {
1221
1221
  i += 1;
1222
1222
  } else {
1223
- str14 += json.slice(start, i) + "\n\n";
1223
+ str15 += json.slice(start, i) + "\n\n";
1224
1224
  while (json[i + 2] === "\\" && json[i + 3] === "n" && json[i + 4] !== '"') {
1225
- str14 += "\n";
1225
+ str15 += "\n";
1226
1226
  i += 2;
1227
1227
  }
1228
- str14 += indent;
1228
+ str15 += indent;
1229
1229
  if (json[i + 2] === " ")
1230
- str14 += "\\";
1230
+ str15 += "\\";
1231
1231
  i += 1;
1232
1232
  start = i + 1;
1233
1233
  }
@@ -1236,8 +1236,8 @@ var require_stringifyString = __commonJS({
1236
1236
  i += 1;
1237
1237
  }
1238
1238
  }
1239
- str14 = start ? str14 + json.slice(start) : json;
1240
- return implicitKey ? str14 : foldFlowLines.foldFlowLines(str14, indent, foldFlowLines.FOLD_QUOTED, getFoldOptions(ctx, false));
1239
+ str15 = start ? str15 + json.slice(start) : json;
1240
+ return implicitKey ? str15 : foldFlowLines.foldFlowLines(str15, indent, foldFlowLines.FOLD_QUOTED, getFoldOptions(ctx, false));
1241
1241
  }
1242
1242
  function singleQuotedString(value, ctx) {
1243
1243
  if (ctx.options.singleQuote === false || ctx.implicitKey && value.includes("\n") || /[ \t]\n|\n[ \t]/.test(value))
@@ -1365,15 +1365,15 @@ ${indent}${start}${value}${end}`;
1365
1365
  return quotedString(value, ctx);
1366
1366
  }
1367
1367
  }
1368
- const str14 = value.replace(/\n+/g, `$&
1368
+ const str15 = value.replace(/\n+/g, `$&
1369
1369
  ${indent}`);
1370
1370
  if (actualString) {
1371
- const test = (tag) => tag.default && tag.tag !== "tag:yaml.org,2002:str" && tag.test?.test(str14);
1371
+ const test = (tag) => tag.default && tag.tag !== "tag:yaml.org,2002:str" && tag.test?.test(str15);
1372
1372
  const { compat, tags } = ctx.doc.schema;
1373
1373
  if (tags.some(test) || compat?.some(test))
1374
1374
  return quotedString(value, ctx);
1375
1375
  }
1376
- return implicitKey ? str14 : foldFlowLines.foldFlowLines(str14, indent, foldFlowLines.FOLD_FLOW, getFoldOptions(ctx, false));
1376
+ return implicitKey ? str15 : foldFlowLines.foldFlowLines(str15, indent, foldFlowLines.FOLD_FLOW, getFoldOptions(ctx, false));
1377
1377
  }
1378
1378
  function stringifyString(item, ctx, onComment, onChompKeep) {
1379
1379
  const { implicitKey, inFlow } = ctx;
@@ -1525,11 +1525,11 @@ var require_stringify = __commonJS({
1525
1525
  const props = stringifyProps(node, tagObj, ctx);
1526
1526
  if (props.length > 0)
1527
1527
  ctx.indentAtStart = (ctx.indentAtStart ?? 0) + props.length + 1;
1528
- const str14 = typeof tagObj.stringify === "function" ? tagObj.stringify(node, ctx, onComment, onChompKeep) : identity.isScalar(node) ? stringifyString.stringifyString(node, ctx, onComment, onChompKeep) : node.toString(ctx, onComment, onChompKeep);
1528
+ const str15 = typeof tagObj.stringify === "function" ? tagObj.stringify(node, ctx, onComment, onChompKeep) : identity.isScalar(node) ? stringifyString.stringifyString(node, ctx, onComment, onChompKeep) : node.toString(ctx, onComment, onChompKeep);
1529
1529
  if (!props)
1530
- return str14;
1531
- return identity.isScalar(node) || str14[0] === "{" || str14[0] === "[" ? `${props} ${str14}` : `${props}
1532
- ${ctx.indent}${str14}`;
1530
+ return str15;
1531
+ return identity.isScalar(node) || str15[0] === "{" || str15[0] === "[" ? `${props} ${str15}` : `${props}
1532
+ ${ctx.indent}${str15}`;
1533
1533
  }
1534
1534
  exports.createStringifyContext = createStringifyContext;
1535
1535
  exports.stringify = stringify;
@@ -1564,8 +1564,8 @@ var require_stringifyPair = __commonJS({
1564
1564
  });
1565
1565
  let keyCommentDone = false;
1566
1566
  let chompKeep = false;
1567
- let str14 = stringify.stringify(key, ctx, () => keyCommentDone = true, () => chompKeep = true);
1568
- if (!explicitKey && !ctx.inFlow && str14.length > 1024) {
1567
+ let str15 = stringify.stringify(key, ctx, () => keyCommentDone = true, () => chompKeep = true);
1568
+ if (!explicitKey && !ctx.inFlow && str15.length > 1024) {
1569
1569
  if (simpleKeys)
1570
1570
  throw new Error("With simple keys, single line scalar must not span more than 1024 characters");
1571
1571
  explicitKey = true;
@@ -1574,27 +1574,27 @@ var require_stringifyPair = __commonJS({
1574
1574
  if (allNullValues || value == null) {
1575
1575
  if (keyCommentDone && onComment)
1576
1576
  onComment();
1577
- return str14 === "" ? "?" : explicitKey ? `? ${str14}` : str14;
1577
+ return str15 === "" ? "?" : explicitKey ? `? ${str15}` : str15;
1578
1578
  }
1579
1579
  } else if (allNullValues && !simpleKeys || value == null && explicitKey) {
1580
- str14 = `? ${str14}`;
1580
+ str15 = `? ${str15}`;
1581
1581
  if (keyComment && !keyCommentDone) {
1582
- str14 += stringifyComment.lineComment(str14, ctx.indent, commentString(keyComment));
1582
+ str15 += stringifyComment.lineComment(str15, ctx.indent, commentString(keyComment));
1583
1583
  } else if (chompKeep && onChompKeep)
1584
1584
  onChompKeep();
1585
- return str14;
1585
+ return str15;
1586
1586
  }
1587
1587
  if (keyCommentDone)
1588
1588
  keyComment = null;
1589
1589
  if (explicitKey) {
1590
1590
  if (keyComment)
1591
- str14 += stringifyComment.lineComment(str14, ctx.indent, commentString(keyComment));
1592
- str14 = `? ${str14}
1591
+ str15 += stringifyComment.lineComment(str15, ctx.indent, commentString(keyComment));
1592
+ str15 = `? ${str15}
1593
1593
  ${indent}:`;
1594
1594
  } else {
1595
- str14 = `${str14}:`;
1595
+ str15 = `${str15}:`;
1596
1596
  if (keyComment)
1597
- str14 += stringifyComment.lineComment(str14, ctx.indent, commentString(keyComment));
1597
+ str15 += stringifyComment.lineComment(str15, ctx.indent, commentString(keyComment));
1598
1598
  }
1599
1599
  let vsb, vcb, valueComment;
1600
1600
  if (identity.isNode(value)) {
@@ -1610,7 +1610,7 @@ ${indent}:`;
1610
1610
  }
1611
1611
  ctx.implicitKey = false;
1612
1612
  if (!explicitKey && !keyComment && identity.isScalar(value))
1613
- ctx.indentAtStart = str14.length + 1;
1613
+ ctx.indentAtStart = str15.length + 1;
1614
1614
  chompKeep = false;
1615
1615
  if (!indentSeq && indentStep.length >= 2 && !ctx.inFlow && !explicitKey && identity.isSeq(value) && !value.flow && !value.tag && !value.anchor) {
1616
1616
  ctx.indent = ctx.indent.substring(2);
@@ -1654,16 +1654,16 @@ ${ctx.indent}`;
1654
1654
  } else if (valueStr === "" || valueStr[0] === "\n") {
1655
1655
  ws = "";
1656
1656
  }
1657
- str14 += ws + valueStr;
1657
+ str15 += ws + valueStr;
1658
1658
  if (ctx.inFlow) {
1659
1659
  if (valueCommentDone && onComment)
1660
1660
  onComment();
1661
1661
  } else if (valueComment && !valueCommentDone) {
1662
- str14 += stringifyComment.lineComment(str14, ctx.indent, commentString(valueComment));
1662
+ str15 += stringifyComment.lineComment(str15, ctx.indent, commentString(valueComment));
1663
1663
  } else if (chompKeep && onChompKeep) {
1664
1664
  onChompKeep();
1665
1665
  }
1666
- return str14;
1666
+ return str15;
1667
1667
  }
1668
1668
  exports.stringifyPair = stringifyPair;
1669
1669
  }
@@ -1890,31 +1890,31 @@ var require_stringifyCollection = __commonJS({
1890
1890
  }
1891
1891
  }
1892
1892
  chompKeep = false;
1893
- let str15 = stringify.stringify(item, itemCtx, () => comment2 = null, () => chompKeep = true);
1893
+ let str16 = stringify.stringify(item, itemCtx, () => comment2 = null, () => chompKeep = true);
1894
1894
  if (comment2)
1895
- str15 += stringifyComment.lineComment(str15, itemIndent, commentString(comment2));
1895
+ str16 += stringifyComment.lineComment(str16, itemIndent, commentString(comment2));
1896
1896
  if (chompKeep && comment2)
1897
1897
  chompKeep = false;
1898
- lines.push(blockItemPrefix + str15);
1898
+ lines.push(blockItemPrefix + str16);
1899
1899
  }
1900
- let str14;
1900
+ let str15;
1901
1901
  if (lines.length === 0) {
1902
- str14 = flowChars.start + flowChars.end;
1902
+ str15 = flowChars.start + flowChars.end;
1903
1903
  } else {
1904
- str14 = lines[0];
1904
+ str15 = lines[0];
1905
1905
  for (let i = 1; i < lines.length; ++i) {
1906
1906
  const line = lines[i];
1907
- str14 += line ? `
1907
+ str15 += line ? `
1908
1908
  ${indent}${line}` : "\n";
1909
1909
  }
1910
1910
  }
1911
1911
  if (comment) {
1912
- str14 += "\n" + stringifyComment.indentComment(commentString(comment), indent);
1912
+ str15 += "\n" + stringifyComment.indentComment(commentString(comment), indent);
1913
1913
  if (onComment)
1914
1914
  onComment();
1915
1915
  } else if (chompKeep && onChompKeep)
1916
1916
  onChompKeep();
1917
- return str14;
1917
+ return str15;
1918
1918
  }
1919
1919
  function stringifyFlowCollection({ items }, ctx, { flowChars, itemIndent }) {
1920
1920
  const { indent, indentStep, flowCollectionPadding: fcPadding, options: { commentString } } = ctx;
@@ -1957,21 +1957,21 @@ ${indent}${line}` : "\n";
1957
1957
  }
1958
1958
  if (comment)
1959
1959
  reqNewline = true;
1960
- let str14 = stringify.stringify(item, itemCtx, () => comment = null);
1961
- reqNewline || (reqNewline = lines.length > linesAtValue || str14.includes("\n"));
1960
+ let str15 = stringify.stringify(item, itemCtx, () => comment = null);
1961
+ reqNewline || (reqNewline = lines.length > linesAtValue || str15.includes("\n"));
1962
1962
  if (i < items.length - 1) {
1963
- str14 += ",";
1963
+ str15 += ",";
1964
1964
  } else if (ctx.options.trailingComma) {
1965
1965
  if (ctx.options.lineWidth > 0) {
1966
- reqNewline || (reqNewline = lines.reduce((sum, line) => sum + line.length + 2, 2) + (str14.length + 2) > ctx.options.lineWidth);
1966
+ reqNewline || (reqNewline = lines.reduce((sum, line) => sum + line.length + 2, 2) + (str15.length + 2) > ctx.options.lineWidth);
1967
1967
  }
1968
1968
  if (reqNewline) {
1969
- str14 += ",";
1969
+ str15 += ",";
1970
1970
  }
1971
1971
  }
1972
1972
  if (comment)
1973
- str14 += stringifyComment.lineComment(str14, itemIndent, commentString(comment));
1974
- lines.push(str14);
1973
+ str15 += stringifyComment.lineComment(str15, itemIndent, commentString(comment));
1974
+ lines.push(str15);
1975
1975
  linesAtValue = lines.length;
1976
1976
  }
1977
1977
  const { start, end } = flowChars;
@@ -1983,11 +1983,11 @@ ${indent}${line}` : "\n";
1983
1983
  reqNewline = ctx.options.lineWidth > 0 && len > ctx.options.lineWidth;
1984
1984
  }
1985
1985
  if (reqNewline) {
1986
- let str14 = start;
1986
+ let str15 = start;
1987
1987
  for (const line of lines)
1988
- str14 += line ? `
1988
+ str15 += line ? `
1989
1989
  ${indentStep}${indent}${line}` : "\n";
1990
- return `${str14}
1990
+ return `${str15}
1991
1991
  ${indent}${end}`;
1992
1992
  } else {
1993
1993
  return `${start}${fcPadding}${lines.join(" ")}${fcPadding}${end}`;
@@ -2319,7 +2319,7 @@ var require_string = __commonJS({
2319
2319
  identify: (value) => typeof value === "string",
2320
2320
  default: true,
2321
2321
  tag: "tag:yaml.org,2002:str",
2322
- resolve: (str14) => str14,
2322
+ resolve: (str15) => str15,
2323
2323
  stringify(item, ctx, onComment, onChompKeep) {
2324
2324
  ctx = Object.assign({ actualString: true }, ctx);
2325
2325
  return stringifyString.stringifyString(item, ctx, onComment, onChompKeep);
@@ -2357,7 +2357,7 @@ var require_bool = __commonJS({
2357
2357
  default: true,
2358
2358
  tag: "tag:yaml.org,2002:bool",
2359
2359
  test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,
2360
- resolve: (str14) => new Scalar.Scalar(str14[0] === "t" || str14[0] === "T"),
2360
+ resolve: (str15) => new Scalar.Scalar(str15[0] === "t" || str15[0] === "T"),
2361
2361
  stringify({ source, value }, ctx) {
2362
2362
  if (source && boolTag.test.test(source)) {
2363
2363
  const sv = source[0] === "t" || source[0] === "T";
@@ -2409,7 +2409,7 @@ var require_float = __commonJS({
2409
2409
  default: true,
2410
2410
  tag: "tag:yaml.org,2002:float",
2411
2411
  test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
2412
- resolve: (str14) => str14.slice(-3).toLowerCase() === "nan" ? NaN : str14[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
2412
+ resolve: (str15) => str15.slice(-3).toLowerCase() === "nan" ? NaN : str15[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
2413
2413
  stringify: stringifyNumber.stringifyNumber
2414
2414
  };
2415
2415
  var floatExp = {
@@ -2418,7 +2418,7 @@ var require_float = __commonJS({
2418
2418
  tag: "tag:yaml.org,2002:float",
2419
2419
  format: "EXP",
2420
2420
  test: /^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,
2421
- resolve: (str14) => parseFloat(str14),
2421
+ resolve: (str15) => parseFloat(str15),
2422
2422
  stringify(node) {
2423
2423
  const num = Number(node.value);
2424
2424
  return isFinite(num) ? num.toExponential() : stringifyNumber.stringifyNumber(node);
@@ -2429,11 +2429,11 @@ var require_float = __commonJS({
2429
2429
  default: true,
2430
2430
  tag: "tag:yaml.org,2002:float",
2431
2431
  test: /^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,
2432
- resolve(str14) {
2433
- const node = new Scalar.Scalar(parseFloat(str14));
2434
- const dot = str14.indexOf(".");
2435
- if (dot !== -1 && str14[str14.length - 1] === "0")
2436
- node.minFractionDigits = str14.length - dot - 1;
2432
+ resolve(str15) {
2433
+ const node = new Scalar.Scalar(parseFloat(str15));
2434
+ const dot = str15.indexOf(".");
2435
+ if (dot !== -1 && str15[str15.length - 1] === "0")
2436
+ node.minFractionDigits = str15.length - dot - 1;
2437
2437
  return node;
2438
2438
  },
2439
2439
  stringify: stringifyNumber.stringifyNumber
@@ -2450,7 +2450,7 @@ var require_int = __commonJS({
2450
2450
  "use strict";
2451
2451
  var stringifyNumber = require_stringifyNumber();
2452
2452
  var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value);
2453
- var intResolve = (str14, offset, radix, { intAsBigInt }) => intAsBigInt ? BigInt(str14) : parseInt(str14.substring(offset), radix);
2453
+ var intResolve = (str15, offset, radix, { intAsBigInt }) => intAsBigInt ? BigInt(str15) : parseInt(str15.substring(offset), radix);
2454
2454
  function intStringify(node, radix, prefix) {
2455
2455
  const { value } = node;
2456
2456
  if (intIdentify(value) && value >= 0)
@@ -2463,7 +2463,7 @@ var require_int = __commonJS({
2463
2463
  tag: "tag:yaml.org,2002:int",
2464
2464
  format: "OCT",
2465
2465
  test: /^0o[0-7]+$/,
2466
- resolve: (str14, _onError, opt) => intResolve(str14, 2, 8, opt),
2466
+ resolve: (str15, _onError, opt) => intResolve(str15, 2, 8, opt),
2467
2467
  stringify: (node) => intStringify(node, 8, "0o")
2468
2468
  };
2469
2469
  var int2 = {
@@ -2471,7 +2471,7 @@ var require_int = __commonJS({
2471
2471
  default: true,
2472
2472
  tag: "tag:yaml.org,2002:int",
2473
2473
  test: /^[-+]?[0-9]+$/,
2474
- resolve: (str14, _onError, opt) => intResolve(str14, 0, 10, opt),
2474
+ resolve: (str15, _onError, opt) => intResolve(str15, 0, 10, opt),
2475
2475
  stringify: stringifyNumber.stringifyNumber
2476
2476
  };
2477
2477
  var intHex = {
@@ -2480,7 +2480,7 @@ var require_int = __commonJS({
2480
2480
  tag: "tag:yaml.org,2002:int",
2481
2481
  format: "HEX",
2482
2482
  test: /^0x[0-9a-fA-F]+$/,
2483
- resolve: (str14, _onError, opt) => intResolve(str14, 2, 16, opt),
2483
+ resolve: (str15, _onError, opt) => intResolve(str15, 2, 16, opt),
2484
2484
  stringify: (node) => intStringify(node, 16, "0x")
2485
2485
  };
2486
2486
  exports.int = int2;
@@ -2533,7 +2533,7 @@ var require_schema2 = __commonJS({
2533
2533
  identify: (value) => typeof value === "string",
2534
2534
  default: true,
2535
2535
  tag: "tag:yaml.org,2002:str",
2536
- resolve: (str14) => str14,
2536
+ resolve: (str15) => str15,
2537
2537
  stringify: stringifyJSON
2538
2538
  },
2539
2539
  {
@@ -2550,7 +2550,7 @@ var require_schema2 = __commonJS({
2550
2550
  default: true,
2551
2551
  tag: "tag:yaml.org,2002:bool",
2552
2552
  test: /^true$|^false$/,
2553
- resolve: (str14) => str14 === "true",
2553
+ resolve: (str15) => str15 === "true",
2554
2554
  stringify: stringifyJSON
2555
2555
  },
2556
2556
  {
@@ -2558,7 +2558,7 @@ var require_schema2 = __commonJS({
2558
2558
  default: true,
2559
2559
  tag: "tag:yaml.org,2002:int",
2560
2560
  test: /^-?(?:0|[1-9][0-9]*)$/,
2561
- resolve: (str14, _onError, { intAsBigInt }) => intAsBigInt ? BigInt(str14) : parseInt(str14, 10),
2561
+ resolve: (str15, _onError, { intAsBigInt }) => intAsBigInt ? BigInt(str15) : parseInt(str15, 10),
2562
2562
  stringify: ({ value }) => intIdentify(value) ? value.toString() : JSON.stringify(value)
2563
2563
  },
2564
2564
  {
@@ -2566,7 +2566,7 @@ var require_schema2 = __commonJS({
2566
2566
  default: true,
2567
2567
  tag: "tag:yaml.org,2002:float",
2568
2568
  test: /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,
2569
- resolve: (str14) => parseFloat(str14),
2569
+ resolve: (str15) => parseFloat(str15),
2570
2570
  stringify: stringifyJSON
2571
2571
  }
2572
2572
  ];
@@ -2574,9 +2574,9 @@ var require_schema2 = __commonJS({
2574
2574
  default: true,
2575
2575
  tag: "",
2576
2576
  test: /^/,
2577
- resolve(str14, onError) {
2578
- onError(`Unresolved plain scalar ${JSON.stringify(str14)}`);
2579
- return str14;
2577
+ resolve(str15, onError) {
2578
+ onError(`Unresolved plain scalar ${JSON.stringify(str15)}`);
2579
+ return str15;
2580
2580
  }
2581
2581
  };
2582
2582
  var schema = [map.map, seq.seq].concat(jsonScalars, jsonError);
@@ -2608,10 +2608,10 @@ var require_binary = __commonJS({
2608
2608
  if (typeof node_buffer.Buffer === "function") {
2609
2609
  return node_buffer.Buffer.from(src, "base64");
2610
2610
  } else if (typeof atob === "function") {
2611
- const str14 = atob(src.replace(/[\n\r]/g, ""));
2612
- const buffer = new Uint8Array(str14.length);
2613
- for (let i = 0; i < str14.length; ++i)
2614
- buffer[i] = str14.charCodeAt(i);
2611
+ const str15 = atob(src.replace(/[\n\r]/g, ""));
2612
+ const buffer = new Uint8Array(str15.length);
2613
+ for (let i = 0; i < str15.length; ++i)
2614
+ buffer[i] = str15.charCodeAt(i);
2615
2615
  return buffer;
2616
2616
  } else {
2617
2617
  onError("This environment does not support reading binary tags; either Buffer or atob is required");
@@ -2622,28 +2622,28 @@ var require_binary = __commonJS({
2622
2622
  if (!value)
2623
2623
  return "";
2624
2624
  const buf = value;
2625
- let str14;
2625
+ let str15;
2626
2626
  if (typeof node_buffer.Buffer === "function") {
2627
- str14 = buf instanceof node_buffer.Buffer ? buf.toString("base64") : node_buffer.Buffer.from(buf.buffer).toString("base64");
2627
+ str15 = buf instanceof node_buffer.Buffer ? buf.toString("base64") : node_buffer.Buffer.from(buf.buffer).toString("base64");
2628
2628
  } else if (typeof btoa === "function") {
2629
2629
  let s = "";
2630
2630
  for (let i = 0; i < buf.length; ++i)
2631
2631
  s += String.fromCharCode(buf[i]);
2632
- str14 = btoa(s);
2632
+ str15 = btoa(s);
2633
2633
  } else {
2634
2634
  throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");
2635
2635
  }
2636
2636
  type ?? (type = Scalar.Scalar.BLOCK_LITERAL);
2637
2637
  if (type !== Scalar.Scalar.QUOTE_DOUBLE) {
2638
2638
  const lineWidth = Math.max(ctx.options.lineWidth - ctx.indent.length, ctx.options.minContentWidth);
2639
- const n = Math.ceil(str14.length / lineWidth);
2639
+ const n = Math.ceil(str15.length / lineWidth);
2640
2640
  const lines = new Array(n);
2641
2641
  for (let i = 0, o = 0; i < n; ++i, o += lineWidth) {
2642
- lines[i] = str14.substr(o, lineWidth);
2642
+ lines[i] = str15.substr(o, lineWidth);
2643
2643
  }
2644
- str14 = lines.join(type === Scalar.Scalar.BLOCK_LITERAL ? "\n" : " ");
2644
+ str15 = lines.join(type === Scalar.Scalar.BLOCK_LITERAL ? "\n" : " ");
2645
2645
  }
2646
- return stringifyString.stringifyString({ comment, type, value: str14 }, ctx, onComment, onChompKeep);
2646
+ return stringifyString.stringifyString({ comment, type, value: str15 }, ctx, onComment, onChompKeep);
2647
2647
  }
2648
2648
  };
2649
2649
  exports.binary = binary;
@@ -2849,7 +2849,7 @@ var require_float2 = __commonJS({
2849
2849
  default: true,
2850
2850
  tag: "tag:yaml.org,2002:float",
2851
2851
  test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
2852
- resolve: (str14) => str14.slice(-3).toLowerCase() === "nan" ? NaN : str14[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
2852
+ resolve: (str15) => str15.slice(-3).toLowerCase() === "nan" ? NaN : str15[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
2853
2853
  stringify: stringifyNumber.stringifyNumber
2854
2854
  };
2855
2855
  var floatExp = {
@@ -2858,7 +2858,7 @@ var require_float2 = __commonJS({
2858
2858
  tag: "tag:yaml.org,2002:float",
2859
2859
  format: "EXP",
2860
2860
  test: /^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,
2861
- resolve: (str14) => parseFloat(str14.replace(/_/g, "")),
2861
+ resolve: (str15) => parseFloat(str15.replace(/_/g, "")),
2862
2862
  stringify(node) {
2863
2863
  const num = Number(node.value);
2864
2864
  return isFinite(num) ? num.toExponential() : stringifyNumber.stringifyNumber(node);
@@ -2869,11 +2869,11 @@ var require_float2 = __commonJS({
2869
2869
  default: true,
2870
2870
  tag: "tag:yaml.org,2002:float",
2871
2871
  test: /^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,
2872
- resolve(str14) {
2873
- const node = new Scalar.Scalar(parseFloat(str14.replace(/_/g, "")));
2874
- const dot = str14.indexOf(".");
2872
+ resolve(str15) {
2873
+ const node = new Scalar.Scalar(parseFloat(str15.replace(/_/g, "")));
2874
+ const dot = str15.indexOf(".");
2875
2875
  if (dot !== -1) {
2876
- const f = str14.substring(dot + 1).replace(/_/g, "");
2876
+ const f = str15.substring(dot + 1).replace(/_/g, "");
2877
2877
  if (f[f.length - 1] === "0")
2878
2878
  node.minFractionDigits = f.length;
2879
2879
  }
@@ -2893,34 +2893,34 @@ var require_int2 = __commonJS({
2893
2893
  "use strict";
2894
2894
  var stringifyNumber = require_stringifyNumber();
2895
2895
  var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value);
2896
- function intResolve(str14, offset, radix, { intAsBigInt }) {
2897
- const sign = str14[0];
2896
+ function intResolve(str15, offset, radix, { intAsBigInt }) {
2897
+ const sign = str15[0];
2898
2898
  if (sign === "-" || sign === "+")
2899
2899
  offset += 1;
2900
- str14 = str14.substring(offset).replace(/_/g, "");
2900
+ str15 = str15.substring(offset).replace(/_/g, "");
2901
2901
  if (intAsBigInt) {
2902
2902
  switch (radix) {
2903
2903
  case 2:
2904
- str14 = `0b${str14}`;
2904
+ str15 = `0b${str15}`;
2905
2905
  break;
2906
2906
  case 8:
2907
- str14 = `0o${str14}`;
2907
+ str15 = `0o${str15}`;
2908
2908
  break;
2909
2909
  case 16:
2910
- str14 = `0x${str14}`;
2910
+ str15 = `0x${str15}`;
2911
2911
  break;
2912
2912
  }
2913
- const n2 = BigInt(str14);
2913
+ const n2 = BigInt(str15);
2914
2914
  return sign === "-" ? BigInt(-1) * n2 : n2;
2915
2915
  }
2916
- const n = parseInt(str14, radix);
2916
+ const n = parseInt(str15, radix);
2917
2917
  return sign === "-" ? -1 * n : n;
2918
2918
  }
2919
2919
  function intStringify(node, radix, prefix) {
2920
2920
  const { value } = node;
2921
2921
  if (intIdentify(value)) {
2922
- const str14 = value.toString(radix);
2923
- return value < 0 ? "-" + prefix + str14.substr(1) : prefix + str14;
2922
+ const str15 = value.toString(radix);
2923
+ return value < 0 ? "-" + prefix + str15.substr(1) : prefix + str15;
2924
2924
  }
2925
2925
  return stringifyNumber.stringifyNumber(node);
2926
2926
  }
@@ -2930,7 +2930,7 @@ var require_int2 = __commonJS({
2930
2930
  tag: "tag:yaml.org,2002:int",
2931
2931
  format: "BIN",
2932
2932
  test: /^[-+]?0b[0-1_]+$/,
2933
- resolve: (str14, _onError, opt) => intResolve(str14, 2, 2, opt),
2933
+ resolve: (str15, _onError, opt) => intResolve(str15, 2, 2, opt),
2934
2934
  stringify: (node) => intStringify(node, 2, "0b")
2935
2935
  };
2936
2936
  var intOct = {
@@ -2939,7 +2939,7 @@ var require_int2 = __commonJS({
2939
2939
  tag: "tag:yaml.org,2002:int",
2940
2940
  format: "OCT",
2941
2941
  test: /^[-+]?0[0-7_]+$/,
2942
- resolve: (str14, _onError, opt) => intResolve(str14, 1, 8, opt),
2942
+ resolve: (str15, _onError, opt) => intResolve(str15, 1, 8, opt),
2943
2943
  stringify: (node) => intStringify(node, 8, "0")
2944
2944
  };
2945
2945
  var int2 = {
@@ -2947,7 +2947,7 @@ var require_int2 = __commonJS({
2947
2947
  default: true,
2948
2948
  tag: "tag:yaml.org,2002:int",
2949
2949
  test: /^[-+]?[0-9][0-9_]*$/,
2950
- resolve: (str14, _onError, opt) => intResolve(str14, 0, 10, opt),
2950
+ resolve: (str15, _onError, opt) => intResolve(str15, 0, 10, opt),
2951
2951
  stringify: stringifyNumber.stringifyNumber
2952
2952
  };
2953
2953
  var intHex = {
@@ -2956,7 +2956,7 @@ var require_int2 = __commonJS({
2956
2956
  tag: "tag:yaml.org,2002:int",
2957
2957
  format: "HEX",
2958
2958
  test: /^[-+]?0x[0-9a-fA-F_]+$/,
2959
- resolve: (str14, _onError, opt) => intResolve(str14, 2, 16, opt),
2959
+ resolve: (str15, _onError, opt) => intResolve(str15, 2, 16, opt),
2960
2960
  stringify: (node) => intStringify(node, 16, "0x")
2961
2961
  };
2962
2962
  exports.int = int2;
@@ -3060,9 +3060,9 @@ var require_timestamp = __commonJS({
3060
3060
  "node_modules/yaml/dist/schema/yaml-1.1/timestamp.js"(exports) {
3061
3061
  "use strict";
3062
3062
  var stringifyNumber = require_stringifyNumber();
3063
- function parseSexagesimal(str14, asBigInt) {
3064
- const sign = str14[0];
3065
- const parts = sign === "-" || sign === "+" ? str14.substring(1) : str14;
3063
+ function parseSexagesimal(str15, asBigInt) {
3064
+ const sign = str15[0];
3065
+ const parts = sign === "-" || sign === "+" ? str15.substring(1) : str15;
3066
3066
  const num = (n) => asBigInt ? BigInt(n) : Number(n);
3067
3067
  const res = parts.replace(/_/g, "").split(":").reduce((res2, p) => res2 * num(60) + num(p), num(0));
3068
3068
  return sign === "-" ? num(-1) * res : res;
@@ -3099,7 +3099,7 @@ var require_timestamp = __commonJS({
3099
3099
  tag: "tag:yaml.org,2002:int",
3100
3100
  format: "TIME",
3101
3101
  test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,
3102
- resolve: (str14, _onError, { intAsBigInt }) => parseSexagesimal(str14, intAsBigInt),
3102
+ resolve: (str15, _onError, { intAsBigInt }) => parseSexagesimal(str15, intAsBigInt),
3103
3103
  stringify: stringifySexagesimal
3104
3104
  };
3105
3105
  var floatTime = {
@@ -3108,7 +3108,7 @@ var require_timestamp = __commonJS({
3108
3108
  tag: "tag:yaml.org,2002:float",
3109
3109
  format: "TIME",
3110
3110
  test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,
3111
- resolve: (str14) => parseSexagesimal(str14, false),
3111
+ resolve: (str15) => parseSexagesimal(str15, false),
3112
3112
  stringify: stringifySexagesimal
3113
3113
  };
3114
3114
  var timestamp = {
@@ -3119,8 +3119,8 @@ var require_timestamp = __commonJS({
3119
3119
  // may be omitted altogether, resulting in a date format. In such a case, the time part is
3120
3120
  // assumed to be 00:00:00Z (start of day, UTC).
3121
3121
  test: RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),
3122
- resolve(str14) {
3123
- const match = str14.match(timestamp.test);
3122
+ resolve(str15) {
3123
+ const match = str15.match(timestamp.test);
3124
3124
  if (!match)
3125
3125
  throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");
3126
3126
  const [, year, month, day, hour, minute, second] = match.map(Number);
@@ -3471,9 +3471,9 @@ var require_Document = __commonJS({
3471
3471
  this.contents.add(value);
3472
3472
  }
3473
3473
  /** Adds a value to the document. */
3474
- addIn(path95, value) {
3474
+ addIn(path96, value) {
3475
3475
  if (assertCollection(this.contents))
3476
- this.contents.addIn(path95, value);
3476
+ this.contents.addIn(path96, value);
3477
3477
  }
3478
3478
  /**
3479
3479
  * Create a new `Alias` node, ensuring that the target `node` has the required anchor.
@@ -3548,14 +3548,14 @@ var require_Document = __commonJS({
3548
3548
  * Removes a value from the document.
3549
3549
  * @returns `true` if the item was found and removed.
3550
3550
  */
3551
- deleteIn(path95) {
3552
- if (Collection.isEmptyPath(path95)) {
3551
+ deleteIn(path96) {
3552
+ if (Collection.isEmptyPath(path96)) {
3553
3553
  if (this.contents == null)
3554
3554
  return false;
3555
3555
  this.contents = null;
3556
3556
  return true;
3557
3557
  }
3558
- return assertCollection(this.contents) ? this.contents.deleteIn(path95) : false;
3558
+ return assertCollection(this.contents) ? this.contents.deleteIn(path96) : false;
3559
3559
  }
3560
3560
  /**
3561
3561
  * Returns item at `key`, or `undefined` if not found. By default unwraps
@@ -3570,10 +3570,10 @@ var require_Document = __commonJS({
3570
3570
  * scalar values from their surrounding node; to disable set `keepScalar` to
3571
3571
  * `true` (collections are always returned intact).
3572
3572
  */
3573
- getIn(path95, keepScalar) {
3574
- if (Collection.isEmptyPath(path95))
3573
+ getIn(path96, keepScalar) {
3574
+ if (Collection.isEmptyPath(path96))
3575
3575
  return !keepScalar && identity.isScalar(this.contents) ? this.contents.value : this.contents;
3576
- return identity.isCollection(this.contents) ? this.contents.getIn(path95, keepScalar) : void 0;
3576
+ return identity.isCollection(this.contents) ? this.contents.getIn(path96, keepScalar) : void 0;
3577
3577
  }
3578
3578
  /**
3579
3579
  * Checks if the document includes a value with the key `key`.
@@ -3584,10 +3584,10 @@ var require_Document = __commonJS({
3584
3584
  /**
3585
3585
  * Checks if the document includes a value at `path`.
3586
3586
  */
3587
- hasIn(path95) {
3588
- if (Collection.isEmptyPath(path95))
3587
+ hasIn(path96) {
3588
+ if (Collection.isEmptyPath(path96))
3589
3589
  return this.contents !== void 0;
3590
- return identity.isCollection(this.contents) ? this.contents.hasIn(path95) : false;
3590
+ return identity.isCollection(this.contents) ? this.contents.hasIn(path96) : false;
3591
3591
  }
3592
3592
  /**
3593
3593
  * Sets a value in this document. For `!!set`, `value` needs to be a
@@ -3604,13 +3604,13 @@ var require_Document = __commonJS({
3604
3604
  * Sets a value in this document. For `!!set`, `value` needs to be a
3605
3605
  * boolean to add/remove the item from the set.
3606
3606
  */
3607
- setIn(path95, value) {
3608
- if (Collection.isEmptyPath(path95)) {
3607
+ setIn(path96, value) {
3608
+ if (Collection.isEmptyPath(path96)) {
3609
3609
  this.contents = value;
3610
3610
  } else if (this.contents == null) {
3611
- this.contents = Collection.collectionFromPath(this.schema, Array.from(path95), value);
3611
+ this.contents = Collection.collectionFromPath(this.schema, Array.from(path96), value);
3612
3612
  } else if (assertCollection(this.contents)) {
3613
- this.contents.setIn(path95, value);
3613
+ this.contents.setIn(path96, value);
3614
3614
  }
3615
3615
  }
3616
3616
  /**
@@ -5570,9 +5570,9 @@ var require_cst_visit = __commonJS({
5570
5570
  visit.BREAK = BREAK;
5571
5571
  visit.SKIP = SKIP;
5572
5572
  visit.REMOVE = REMOVE;
5573
- visit.itemAtPath = (cst, path95) => {
5573
+ visit.itemAtPath = (cst, path96) => {
5574
5574
  let item = cst;
5575
- for (const [field, index] of path95) {
5575
+ for (const [field, index] of path96) {
5576
5576
  const tok = item?.[field];
5577
5577
  if (tok && "items" in tok) {
5578
5578
  item = tok.items[index];
@@ -5581,23 +5581,23 @@ var require_cst_visit = __commonJS({
5581
5581
  }
5582
5582
  return item;
5583
5583
  };
5584
- visit.parentCollection = (cst, path95) => {
5585
- const parent = visit.itemAtPath(cst, path95.slice(0, -1));
5586
- const field = path95[path95.length - 1][0];
5584
+ visit.parentCollection = (cst, path96) => {
5585
+ const parent = visit.itemAtPath(cst, path96.slice(0, -1));
5586
+ const field = path96[path96.length - 1][0];
5587
5587
  const coll = parent?.[field];
5588
5588
  if (coll && "items" in coll)
5589
5589
  return coll;
5590
5590
  throw new Error("Parent collection not found");
5591
5591
  };
5592
- function _visit(path95, item, visitor) {
5593
- let ctrl = visitor(item, path95);
5592
+ function _visit(path96, item, visitor) {
5593
+ let ctrl = visitor(item, path96);
5594
5594
  if (typeof ctrl === "symbol")
5595
5595
  return ctrl;
5596
5596
  for (const field of ["key", "value"]) {
5597
5597
  const token = item[field];
5598
5598
  if (token && "items" in token) {
5599
5599
  for (let i = 0; i < token.items.length; ++i) {
5600
- const ci = _visit(Object.freeze(path95.concat([[field, i]])), token.items[i], visitor);
5600
+ const ci = _visit(Object.freeze(path96.concat([[field, i]])), token.items[i], visitor);
5601
5601
  if (typeof ci === "number")
5602
5602
  i = ci - 1;
5603
5603
  else if (ci === BREAK)
@@ -5608,10 +5608,10 @@ var require_cst_visit = __commonJS({
5608
5608
  }
5609
5609
  }
5610
5610
  if (typeof ctrl === "function" && field === "key")
5611
- ctrl = ctrl(item, path95);
5611
+ ctrl = ctrl(item, path96);
5612
5612
  }
5613
5613
  }
5614
- return typeof ctrl === "function" ? ctrl(item, path95) : ctrl;
5614
+ return typeof ctrl === "function" ? ctrl(item, path96) : ctrl;
5615
5615
  }
5616
5616
  exports.visit = visit;
5617
5617
  }
@@ -6913,14 +6913,14 @@ var require_parser = __commonJS({
6913
6913
  case "scalar":
6914
6914
  case "single-quoted-scalar":
6915
6915
  case "double-quoted-scalar": {
6916
- const fs93 = this.flowScalar(this.type);
6916
+ const fs94 = this.flowScalar(this.type);
6917
6917
  if (atNextItem || it.value) {
6918
- map.items.push({ start, key: fs93, sep: [] });
6918
+ map.items.push({ start, key: fs94, sep: [] });
6919
6919
  this.onKeyLine = true;
6920
6920
  } else if (it.sep) {
6921
- this.stack.push(fs93);
6921
+ this.stack.push(fs94);
6922
6922
  } else {
6923
- Object.assign(it, { key: fs93, sep: [] });
6923
+ Object.assign(it, { key: fs94, sep: [] });
6924
6924
  this.onKeyLine = true;
6925
6925
  }
6926
6926
  return;
@@ -7048,13 +7048,13 @@ var require_parser = __commonJS({
7048
7048
  case "scalar":
7049
7049
  case "single-quoted-scalar":
7050
7050
  case "double-quoted-scalar": {
7051
- const fs93 = this.flowScalar(this.type);
7051
+ const fs94 = this.flowScalar(this.type);
7052
7052
  if (!it || it.value)
7053
- fc.items.push({ start: [], key: fs93, sep: [] });
7053
+ fc.items.push({ start: [], key: fs94, sep: [] });
7054
7054
  else if (it.sep)
7055
- this.stack.push(fs93);
7055
+ this.stack.push(fs94);
7056
7056
  else
7057
- Object.assign(it, { key: fs93, sep: [] });
7057
+ Object.assign(it, { key: fs94, sep: [] });
7058
7058
  return;
7059
7059
  }
7060
7060
  case "flow-map-end":
@@ -7363,16 +7363,16 @@ var require_dist = __commonJS({
7363
7363
  });
7364
7364
 
7365
7365
  // src/scripts/hooks/dispatch_entry.ts
7366
- import * as path94 from "node:path";
7367
- import { fileURLToPath as fileURLToPath62 } from "node:url";
7366
+ import * as path95 from "node:path";
7367
+ import { fileURLToPath as fileURLToPath63 } from "node:url";
7368
7368
 
7369
7369
  // src/scripts/hooks/dispatch_hook.ts
7370
7370
  var import_yaml6 = __toESM(require_dist(), 1);
7371
7371
  import { spawnSync as spawnSync8 } from "node:child_process";
7372
- import fs92 from "node:fs";
7373
- import path93 from "node:path";
7372
+ import fs93 from "node:fs";
7373
+ import path94 from "node:path";
7374
7374
  import * as tty2 from "node:tty";
7375
- import { fileURLToPath as fileURLToPath61, pathToFileURL as pathToFileURL55 } from "node:url";
7375
+ import { fileURLToPath as fileURLToPath62, pathToFileURL as pathToFileURL56 } from "node:url";
7376
7376
 
7377
7377
  // src/scripts/_lib/spawn_env.ts
7378
7378
  var DENY_EXACT = /* @__PURE__ */ new Set([
@@ -16819,8 +16819,8 @@ function load_council_config(p) {
16819
16819
  return _build_config(raw, p);
16820
16820
  }
16821
16821
  function _build_config(raw, source_path) {
16822
- const enabled5 = _get(raw, "enabled", false);
16823
- if (!_isBool(enabled5)) {
16822
+ const enabled6 = _get(raw, "enabled", false);
16823
+ if (!_isBool(enabled6)) {
16824
16824
  throw new CouncilConfigError("`enabled` must be a bool.");
16825
16825
  }
16826
16826
  const ignored_transport_keys = [];
@@ -16922,7 +16922,7 @@ function _build_config(raw, source_path) {
16922
16922
  _asDict(_getOr(raw, "lenses", {}))
16923
16923
  );
16924
16924
  return {
16925
- enabled: enabled5,
16925
+ enabled: enabled6,
16926
16926
  defaults,
16927
16927
  cost_budget,
16928
16928
  members,
@@ -16962,8 +16962,8 @@ function _build_necessity_classifier(d) {
16962
16962
  if (!_isDict(d)) {
16963
16963
  throw new CouncilConfigError("`necessity_classifier` must be a mapping.");
16964
16964
  }
16965
- const enabled5 = _get(d, "enabled", true);
16966
- if (!_isBool(enabled5)) {
16965
+ const enabled6 = _get(d, "enabled", true);
16966
+ if (!_isBool(enabled6)) {
16967
16967
  throw new CouncilConfigError(
16968
16968
  "`necessity_classifier.enabled` must be a bool."
16969
16969
  );
@@ -16981,7 +16981,7 @@ function _build_necessity_classifier(d) {
16981
16981
  );
16982
16982
  }
16983
16983
  return {
16984
- enabled: Boolean(enabled5),
16984
+ enabled: Boolean(enabled6),
16985
16985
  mode,
16986
16986
  user_explicit_mode
16987
16987
  };
@@ -16990,8 +16990,8 @@ function _build_model_downgrade(d) {
16990
16990
  if (!_isDict(d)) {
16991
16991
  throw new CouncilConfigError("`model_downgrade` must be a mapping.");
16992
16992
  }
16993
- const enabled5 = _get(d, "enabled", true);
16994
- if (!_isBool(enabled5)) {
16993
+ const enabled6 = _get(d, "enabled", true);
16994
+ if (!_isBool(enabled6)) {
16995
16995
  throw new CouncilConfigError("`model_downgrade.enabled` must be a bool.");
16996
16996
  }
16997
16997
  const auto_apply = _get(d, "auto_apply", false);
@@ -17011,7 +17011,7 @@ function _build_model_downgrade(d) {
17011
17011
  }
17012
17012
  model_tier_override[k] = v;
17013
17013
  }
17014
- return { enabled: Boolean(enabled5), auto_apply: Boolean(auto_apply), model_tier_override };
17014
+ return { enabled: Boolean(enabled6), auto_apply: Boolean(auto_apply), model_tier_override };
17015
17015
  }
17016
17016
  function _build_cost_disclosure(d, scope) {
17017
17017
  if (!_isDict(d)) {
@@ -17060,8 +17060,8 @@ function _build_decision_replay(d, scope) {
17060
17060
  if (!_isDict(d)) {
17061
17061
  throw new CouncilConfigError(`\`${scope}\` must be a mapping.`);
17062
17062
  }
17063
- const enabled5 = _get(d, "enabled", true);
17064
- if (!_isBool(enabled5)) {
17063
+ const enabled6 = _get(d, "enabled", true);
17064
+ if (!_isBool(enabled6)) {
17065
17065
  throw new CouncilConfigError(`\`${scope}.enabled\` must be a bool.`);
17066
17066
  }
17067
17067
  const include_args = _get(d, "include_member_arguments", true);
@@ -17071,7 +17071,7 @@ function _build_decision_replay(d, scope) {
17071
17071
  );
17072
17072
  }
17073
17073
  return {
17074
- enabled: Boolean(enabled5),
17074
+ enabled: Boolean(enabled6),
17075
17075
  include_member_arguments: Boolean(include_args)
17076
17076
  };
17077
17077
  }
@@ -17079,11 +17079,11 @@ function _build_stance_tally(d, scope) {
17079
17079
  if (!_isDict(d)) {
17080
17080
  throw new CouncilConfigError(`\`${scope}\` must be a mapping.`);
17081
17081
  }
17082
- const enabled5 = _get(d, "enabled", false);
17083
- if (!_isBool(enabled5)) {
17082
+ const enabled6 = _get(d, "enabled", false);
17083
+ if (!_isBool(enabled6)) {
17084
17084
  throw new CouncilConfigError(`\`${scope}.enabled\` must be a bool.`);
17085
17085
  }
17086
- return { enabled: Boolean(enabled5) };
17086
+ return { enabled: Boolean(enabled6) };
17087
17087
  }
17088
17088
  function _build_chairman(d, scope, members) {
17089
17089
  if (!_isDict(d)) {
@@ -17127,21 +17127,21 @@ function _build_debate_gates(d, scope) {
17127
17127
  if (!_isDict(d)) {
17128
17128
  throw new CouncilConfigError(`\`${scope}\` must be a mapping.`);
17129
17129
  }
17130
- const enabled5 = _get(d, "enabled", false);
17131
- if (!_isBool(enabled5)) {
17130
+ const enabled6 = _get(d, "enabled", false);
17131
+ if (!_isBool(enabled6)) {
17132
17132
  throw new CouncilConfigError(`\`${scope}.enabled\` must be a bool.`);
17133
17133
  }
17134
- return { enabled: Boolean(enabled5) };
17134
+ return { enabled: Boolean(enabled6) };
17135
17135
  }
17136
17136
  function _build_restate(d, scope) {
17137
17137
  if (!_isDict(d)) {
17138
17138
  throw new CouncilConfigError(`\`${scope}\` must be a mapping.`);
17139
17139
  }
17140
- const enabled5 = _get(d, "enabled", false);
17141
- if (!_isBool(enabled5)) {
17140
+ const enabled6 = _get(d, "enabled", false);
17141
+ if (!_isBool(enabled6)) {
17142
17142
  throw new CouncilConfigError(`\`${scope}.enabled\` must be a bool.`);
17143
17143
  }
17144
- return { enabled: Boolean(enabled5) };
17144
+ return { enabled: Boolean(enabled6) };
17145
17145
  }
17146
17146
  var _VALID_CRITIC_PROTOCOLS = /* @__PURE__ */ new Set(["legacy", "load_bearing"]);
17147
17147
  function _build_critic_protocol(v) {
@@ -17180,8 +17180,8 @@ function _build_decision_resolution(d) {
17180
17180
  if (!_isDict(d)) {
17181
17181
  throw new CouncilConfigError("`decision_resolution` must be a mapping.");
17182
17182
  }
17183
- const enabled5 = _get(d, "enabled", true);
17184
- if (!_isBool(enabled5)) {
17183
+ const enabled6 = _get(d, "enabled", true);
17184
+ if (!_isBool(enabled6)) {
17185
17185
  throw new CouncilConfigError(
17186
17186
  "`decision_resolution.enabled` must be a bool."
17187
17187
  );
@@ -17237,7 +17237,7 @@ function _build_decision_resolution(d) {
17237
17237
  );
17238
17238
  }
17239
17239
  const fast_path = _build_fast_path(_asDict(fast_path_raw));
17240
- return { enabled: Boolean(enabled5), classes, fast_path };
17240
+ return { enabled: Boolean(enabled6), classes, fast_path };
17241
17241
  }
17242
17242
  function _build_fast_path(d) {
17243
17243
  const max_members = _get(d, "max_members", 2);
@@ -17290,10 +17290,10 @@ function _build_fuzzy_match(d) {
17290
17290
  "decision_resolution.fast_path.fuzzy_match must be a mapping."
17291
17291
  );
17292
17292
  }
17293
- const enabled5 = _get(d, "enabled", false);
17294
- if (!_isBool(enabled5)) {
17293
+ const enabled6 = _get(d, "enabled", false);
17294
+ if (!_isBool(enabled6)) {
17295
17295
  throw new CouncilConfigError(
17296
- `decision_resolution.fast_path.fuzzy_match.enabled must be a bool (got ${_pyTypeName(enabled5)}).`
17296
+ `decision_resolution.fast_path.fuzzy_match.enabled must be a bool (got ${_pyTypeName(enabled6)}).`
17297
17297
  );
17298
17298
  }
17299
17299
  const threshold_raw = _get(d, "threshold", 0.92);
@@ -17308,7 +17308,7 @@ function _build_fuzzy_match(d) {
17308
17308
  `decision_resolution.fast_path.fuzzy_match.threshold must be in (0.0, 1.0] (got ${_pyRepr5(_f(threshold))}).`
17309
17309
  );
17310
17310
  }
17311
- return { enabled: enabled5, threshold };
17311
+ return { enabled: enabled6, threshold };
17312
17312
  }
17313
17313
  function _build_lens_overrides(d) {
17314
17314
  if (!_isDict(d)) {
@@ -21323,11 +21323,11 @@ function _plugin_enabled(consumer_root) {
21323
21323
  if (typeof data !== "object" || data === null || Array.isArray(data)) {
21324
21324
  return false;
21325
21325
  }
21326
- const enabled5 = data["enabledPlugins"];
21327
- if (typeof enabled5 !== "object" || enabled5 === null || Array.isArray(enabled5)) {
21326
+ const enabled6 = data["enabledPlugins"];
21327
+ if (typeof enabled6 !== "object" || enabled6 === null || Array.isArray(enabled6)) {
21328
21328
  return false;
21329
21329
  }
21330
- return Boolean(enabled5[PLUGIN_ID]);
21330
+ return Boolean(enabled6[PLUGIN_ID]);
21331
21331
  }
21332
21332
  function _agent_config_executable(consumer_root) {
21333
21333
  const p = path30.join(consumer_root, "agent-config");
@@ -22848,14 +22848,14 @@ function resolveAvailability(cwd, env) {
22848
22848
  }
22849
22849
  try {
22850
22850
  const cfg = load_council_config(p);
22851
- const enabled5 = [...cfg.members.entries()].filter(([, m]) => m.enabled).map(([n]) => n);
22851
+ const enabled6 = [...cfg.members.entries()].filter(([, m]) => m.enabled).map(([n]) => n);
22852
22852
  return {
22853
- configured: cfg.enabled && enabled5.length > 0,
22853
+ configured: cfg.enabled && enabled6.length > 0,
22854
22854
  path: p,
22855
22855
  exists: true,
22856
22856
  provenance: provenance2,
22857
- membersEnabled: enabled5.length,
22858
- memberNames: enabled5
22857
+ membersEnabled: enabled6.length,
22858
+ memberNames: enabled6
22859
22859
  };
22860
22860
  } catch {
22861
22861
  return { configured: false, path: p, exists: true, provenance: provenance2, membersEnabled: 0, memberNames: [] };
@@ -24667,8 +24667,8 @@ function lockfile_path(env) {
24667
24667
  }
24668
24668
  return write_target("installed.lock", { env: env ?? null });
24669
24669
  }
24670
- function read_lockfile(path95) {
24671
- const target = path95 ?? lockfile_path();
24670
+ function read_lockfile(path96) {
24671
+ const target = path96 ?? lockfile_path();
24672
24672
  let text;
24673
24673
  try {
24674
24674
  text = fs51.readFileSync(target, { encoding: "utf-8" });
@@ -29213,21 +29213,222 @@ function isCliEntry11() {
29213
29213
  }
29214
29214
  if (isCliEntry11()) process.exit(main40());
29215
29215
 
29216
- // src/scripts/hooks/ui_route_nudge_hook.ts
29217
- import * as fs68 from "node:fs";
29218
- import * as path68 from "node:path";
29216
+ // src/scripts/hooks/suggestion_capture_hook.ts
29217
+ import fs67 from "node:fs";
29218
+ import path67 from "node:path";
29219
29219
  import { fileURLToPath as fileURLToPath43, pathToFileURL as pathToFileURL36 } from "node:url";
29220
+ var EXIT_ALLOW18 = 0;
29221
+ var SETTINGS_FILE10 = ".agent-settings.yml";
29222
+ var SINK_REL = path67.join("agents", "runtime", "state", "audit", "suggestion-capture.jsonl");
29223
+ var LATCH_REL = path67.join("agents", "runtime", "state", "suggestion-latch.json");
29224
+ var LATCH_TTL_MS = 15 * 60 * 1e3;
29225
+ var isObject6 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
29226
+ var str3 = (v) => typeof v === "string" ? v : "";
29227
+ function detectBlock(text) {
29228
+ if (text === "") return { emitted: false, optionsCount: 0 };
29229
+ const lines = text.split("\n");
29230
+ const recommendation = lines.filter((l) => /^\s*(?:\*\*)?(?:Recommendation|Empfehlung)\s*:/i.test(l)).length;
29231
+ const numbered = /* @__PURE__ */ new Set();
29232
+ for (const l of lines) {
29233
+ const m = /^\s*(\d{1,2})[.)]\s+\S/.exec(l);
29234
+ if (m?.[1] !== void 0) numbered.add(m[1]);
29235
+ }
29236
+ const emitted = recommendation === 1 && numbered.size >= 2;
29237
+ return { emitted, optionsCount: emitted ? numbered.size : 0 };
29238
+ }
29239
+ var AS_IS_RE = /\b(as[- ]is|as is|unver(?:ä|ae)ndert|so lassen|wie es ist|keep it|leave it|no change)\b/i;
29240
+ function classify3(prompt, optionsCount) {
29241
+ const t = prompt.trim();
29242
+ if (t === "") return "other";
29243
+ if (AS_IS_RE.test(t)) return "as_is";
29244
+ const bare = /^(\d{1,2})\s*[.)]?\s*$/.exec(t);
29245
+ if (bare?.[1] !== void 0) {
29246
+ const n = Number(bare[1]);
29247
+ if (n >= 1 && (optionsCount === 0 || n <= optionsCount)) return "option_n";
29248
+ }
29249
+ return "other";
29250
+ }
29251
+ function enabled5(root) {
29252
+ let raw;
29253
+ try {
29254
+ raw = fs67.readFileSync(path67.join(root, SETTINGS_FILE10), "utf8");
29255
+ } catch {
29256
+ return false;
29257
+ }
29258
+ let inHooks = false;
29259
+ let inSection = false;
29260
+ for (const line of raw.split("\n")) {
29261
+ if (/^hooks:\s*$/.test(line)) {
29262
+ inHooks = true;
29263
+ inSection = false;
29264
+ continue;
29265
+ }
29266
+ if (/^\S/.test(line)) {
29267
+ inHooks = false;
29268
+ inSection = false;
29269
+ continue;
29270
+ }
29271
+ if (!inHooks) continue;
29272
+ if (/^\s{2}suggestion_capture:\s*$/.test(line)) {
29273
+ inSection = true;
29274
+ continue;
29275
+ }
29276
+ if (/^\s{2}\S/.test(line)) {
29277
+ inSection = false;
29278
+ continue;
29279
+ }
29280
+ if (inSection && /^\s{4}enabled:\s*true\s*$/.test(line)) return true;
29281
+ }
29282
+ return false;
29283
+ }
29284
+ function writeLatch(root, latch2) {
29285
+ const p = path67.join(root, LATCH_REL);
29286
+ fs67.mkdirSync(path67.dirname(p), { recursive: true });
29287
+ fs67.writeFileSync(p, `${JSON.stringify(latch2)}
29288
+ `, "utf8");
29289
+ }
29290
+ function consumeLatch(root) {
29291
+ const p = path67.join(root, LATCH_REL);
29292
+ let raw;
29293
+ try {
29294
+ raw = fs67.readFileSync(p, "utf8");
29295
+ } catch {
29296
+ return null;
29297
+ }
29298
+ try {
29299
+ fs67.rmSync(p, { force: true });
29300
+ } catch {
29301
+ }
29302
+ try {
29303
+ const v = JSON.parse(raw);
29304
+ if (!isObject6(v)) return null;
29305
+ const at = v["at"];
29306
+ const oc = v["options_count"];
29307
+ const pid = v["prompt_id"];
29308
+ if (typeof at !== "number" || typeof oc !== "number" || typeof pid !== "string") return null;
29309
+ return { prompt_id: pid, options_count: oc, at };
29310
+ } catch {
29311
+ return null;
29312
+ }
29313
+ }
29314
+ function appendRecord(root, rec, now) {
29315
+ const p = path67.join(root, SINK_REL);
29316
+ fs67.mkdirSync(path67.dirname(p), { recursive: true });
29317
+ const line = {
29318
+ ts: now.toISOString().replace(/\.\d{3}Z$/, "Z"),
29319
+ block_emitted: rec.block_emitted,
29320
+ options_count: rec.options_count,
29321
+ evidence_class: rec.evidence_class,
29322
+ turn_classification: rec.turn_classification
29323
+ };
29324
+ fs67.appendFileSync(p, `${JSON.stringify(line)}
29325
+ `, "utf8");
29326
+ }
29327
+ function classifyTurn(prompt, latch2, nowMs) {
29328
+ if (latch2 === null) {
29329
+ return { record: false, evidence_class: "no-latch", turn_classification: "other", options_count: 0 };
29330
+ }
29331
+ if (nowMs - latch2.at > LATCH_TTL_MS) {
29332
+ return {
29333
+ record: true,
29334
+ evidence_class: "latch-stale",
29335
+ turn_classification: "stale_block",
29336
+ options_count: latch2.options_count
29337
+ };
29338
+ }
29339
+ return {
29340
+ record: true,
29341
+ evidence_class: "latch-consumed",
29342
+ turn_classification: classify3(prompt, latch2.options_count),
29343
+ options_count: latch2.options_count
29344
+ };
29345
+ }
29346
+ function eventOf(envelope, payload) {
29347
+ const canonical2 = str3(envelope["event"]);
29348
+ const native = str3(
29349
+ envelope["native_event"] ?? payload["hook_event_name"]
29350
+ );
29351
+ const raw = (canonical2 !== "" ? canonical2 : native).toLowerCase();
29352
+ if (raw === "stop") return "stop";
29353
+ if (raw === "userpromptsubmit" || raw === "user_prompt_submit") return "user_prompt_submit";
29354
+ return raw;
29355
+ }
29356
+ function main41(_argv = [], now = /* @__PURE__ */ new Date()) {
29357
+ let envelope;
29358
+ let payload;
29359
+ try {
29360
+ [envelope, payload] = unwrap(readHookStdin(), "claude");
29361
+ } catch {
29362
+ return EXIT_ALLOW18;
29363
+ }
29364
+ const root = str3(envelope["workspace_root"]) || str3(payload["cwd"]) || str3(envelope["project_root"]) || ".";
29365
+ if (!enabled5(root)) return EXIT_ALLOW18;
29366
+ const event = eventOf(envelope, payload);
29367
+ try {
29368
+ if (event === "stop") {
29369
+ const { emitted, optionsCount } = detectBlock(
29370
+ str3(payload["last_assistant_message"])
29371
+ );
29372
+ if (emitted) {
29373
+ writeLatch(root, {
29374
+ prompt_id: str3(payload["prompt_id"]),
29375
+ options_count: optionsCount,
29376
+ at: now.getTime()
29377
+ });
29378
+ }
29379
+ return EXIT_ALLOW18;
29380
+ }
29381
+ if (event === "user_prompt_submit") {
29382
+ const latch2 = consumeLatch(root);
29383
+ const v = classifyTurn(str3(payload["prompt"]), latch2, now.getTime());
29384
+ if (v.record) {
29385
+ appendRecord(
29386
+ root,
29387
+ {
29388
+ ts: "",
29389
+ block_emitted: true,
29390
+ options_count: v.options_count,
29391
+ evidence_class: v.evidence_class,
29392
+ turn_classification: v.turn_classification
29393
+ },
29394
+ now
29395
+ );
29396
+ }
29397
+ return EXIT_ALLOW18;
29398
+ }
29399
+ } catch {
29400
+ return EXIT_ALLOW18;
29401
+ }
29402
+ return EXIT_ALLOW18;
29403
+ }
29404
+ function isCliEntry12() {
29405
+ if (true) return false;
29406
+ if (process.argv[1] === void 0) return false;
29407
+ const argvUrl = pathToFileURL36(path67.resolve(process.argv[1])).href;
29408
+ if (import.meta.url === argvUrl) return true;
29409
+ try {
29410
+ return fs67.realpathSync(fileURLToPath43(import.meta.url)) === fs67.realpathSync(path67.resolve(process.argv[1]));
29411
+ } catch {
29412
+ return false;
29413
+ }
29414
+ }
29415
+ if (isCliEntry12()) process.exit(main41());
29416
+
29417
+ // src/scripts/hooks/ui_route_nudge_hook.ts
29418
+ import * as fs69 from "node:fs";
29419
+ import * as path69 from "node:path";
29420
+ import { fileURLToPath as fileURLToPath44, pathToFileURL as pathToFileURL37 } from "node:url";
29220
29421
 
29221
29422
  // src/scripts/_lib/hook_settings.ts
29222
- import * as fs67 from "node:fs";
29223
- import * as path67 from "node:path";
29224
- var SETTINGS_FILE10 = ".agent-settings.yml";
29423
+ import * as fs68 from "node:fs";
29424
+ import * as path68 from "node:path";
29425
+ var SETTINGS_FILE11 = ".agent-settings.yml";
29225
29426
  function hookSectionEnabled(root, section) {
29226
- const file = path67.join(root, SETTINGS_FILE10);
29427
+ const file = path68.join(root, SETTINGS_FILE11);
29227
29428
  let text;
29228
29429
  try {
29229
- if (!fs67.statSync(file).isFile()) return false;
29230
- text = fs67.readFileSync(file, "utf-8");
29430
+ if (!fs68.statSync(file).isFile()) return false;
29431
+ text = fs68.readFileSync(file, "utf-8");
29231
29432
  } catch {
29232
29433
  return false;
29233
29434
  }
@@ -29259,11 +29460,11 @@ function hookSectionEnabled(root, section) {
29259
29460
  return false;
29260
29461
  }
29261
29462
  function leanProjectionModeRaw(root) {
29262
- const file = path67.join(root, SETTINGS_FILE10);
29463
+ const file = path68.join(root, SETTINGS_FILE11);
29263
29464
  let text;
29264
29465
  try {
29265
- if (!fs67.statSync(file).isFile()) return "";
29266
- text = fs67.readFileSync(file, "utf-8");
29466
+ if (!fs68.statSync(file).isFile()) return "";
29467
+ text = fs68.readFileSync(file, "utf-8");
29267
29468
  } catch {
29268
29469
  return "";
29269
29470
  }
@@ -29283,7 +29484,7 @@ function leanProjectionModeRaw(root) {
29283
29484
  }
29284
29485
 
29285
29486
  // src/scripts/hooks/ui_route_nudge_hook.ts
29286
- var EXIT_ALLOW18 = 0;
29487
+ var EXIT_ALLOW19 = 0;
29287
29488
  var EXIT_WARN9 = 2;
29288
29489
  var MAX_NUDGES = 2;
29289
29490
  var DESIGN_SURFACES = [
@@ -29292,17 +29493,17 @@ var DESIGN_SURFACES = [
29292
29493
  "design-review",
29293
29494
  "design-intelligence"
29294
29495
  ];
29295
- function isObject6(v) {
29496
+ function isObject7(v) {
29296
29497
  return typeof v === "object" && v !== null && !Array.isArray(v);
29297
29498
  }
29298
29499
  function unwrap2(envelope) {
29299
29500
  const inner = envelope["payload"];
29300
- return isObject6(inner) ? inner : envelope;
29501
+ return isObject7(inner) ? inner : envelope;
29301
29502
  }
29302
29503
  function extractEvent(outer) {
29303
29504
  const envelope = unwrap2(outer);
29304
29505
  const ti = envelope["tool_input"] ?? envelope["toolInput"] ?? envelope["input"];
29305
- if (!isObject6(ti)) return null;
29506
+ if (!isObject7(ti)) return null;
29306
29507
  const fileVal = ti["file_path"] ?? ti["path"] ?? ti["filePath"];
29307
29508
  const file = typeof fileVal === "string" ? fileVal : "";
29308
29509
  let isWrite = false;
@@ -29321,11 +29522,11 @@ function isUiWrite(event) {
29321
29522
  return isUiPath(event.file) || isUiTreePath(event.file);
29322
29523
  }
29323
29524
  function stateFile2(root) {
29324
- return path68.join(root, "agents", "runtime", "state", "ui-route-nudge.json");
29525
+ return path69.join(root, "agents", "runtime", "state", "ui-route-nudge.json");
29325
29526
  }
29326
29527
  function readState3(root, session) {
29327
29528
  try {
29328
- const all = JSON.parse(fs68.readFileSync(stateFile2(root), "utf-8"));
29529
+ const all = JSON.parse(fs69.readFileSync(stateFile2(root), "utf-8"));
29329
29530
  const entry = all[session];
29330
29531
  if (entry && typeof entry.consulted === "boolean" && typeof entry.nudges === "number") {
29331
29532
  return entry;
@@ -29348,13 +29549,13 @@ function writeState3(root, session, state) {
29348
29549
  const file = stateFile2(root);
29349
29550
  let all = {};
29350
29551
  try {
29351
- all = JSON.parse(fs68.readFileSync(file, "utf-8"));
29552
+ all = JSON.parse(fs69.readFileSync(file, "utf-8"));
29352
29553
  } catch {
29353
29554
  }
29354
29555
  if (typeof all !== "object" || all === null || Array.isArray(all)) all = {};
29355
29556
  all[session] = state;
29356
- fs68.mkdirSync(path68.dirname(file), { recursive: true });
29357
- fs68.writeFileSync(file, JSON.stringify(pruneSessions(all)));
29557
+ fs69.mkdirSync(path69.dirname(file), { recursive: true });
29558
+ fs69.writeFileSync(file, JSON.stringify(pruneSessions(all)));
29358
29559
  } catch {
29359
29560
  }
29360
29561
  }
@@ -29373,46 +29574,46 @@ function stateChanged(before, after) {
29373
29574
  function nudgeReason2(file) {
29374
29575
  return `Non-trivial UI write to ${file} with no design consultation this session. Run \`existing-ui-audit\` first, then the fe-design loop (brief \u2192 inventory, if an artifact was provided \u2192 build \u2192 review). Skip only if this is ui-trivial: <=1 file, <=5 lines, no new component, no new state, no new dependency.`;
29375
29576
  }
29376
- function main41() {
29577
+ function main42() {
29377
29578
  let envelope;
29378
29579
  try {
29379
29580
  const raw = readHookStdin();
29380
- if (!raw.trim()) return EXIT_ALLOW18;
29581
+ if (!raw.trim()) return EXIT_ALLOW19;
29381
29582
  envelope = JSON.parse(raw);
29382
29583
  } catch {
29383
- return EXIT_ALLOW18;
29584
+ return EXIT_ALLOW19;
29384
29585
  }
29385
- if (!isObject6(envelope)) return EXIT_ALLOW18;
29586
+ if (!isObject7(envelope)) return EXIT_ALLOW19;
29386
29587
  const rootVal = envelope["workspace_root"];
29387
29588
  const root = typeof rootVal === "string" && rootVal ? rootVal : process.cwd();
29388
- if (!hookSectionEnabled(root, "ui_route_nudge")) return EXIT_ALLOW18;
29589
+ if (!hookSectionEnabled(root, "ui_route_nudge")) return EXIT_ALLOW19;
29389
29590
  const sessionVal = envelope["session_id"];
29390
29591
  const session = typeof sessionVal === "string" && sessionVal ? sessionVal : "unknown";
29391
29592
  const event = extractEvent(envelope);
29392
- if (!event) return EXIT_ALLOW18;
29593
+ if (!event) return EXIT_ALLOW19;
29393
29594
  const before = readState3(root, session);
29394
29595
  const { state, warn } = decide5(event, before);
29395
29596
  if (stateChanged(before, state)) {
29396
29597
  writeState3(root, session, state);
29397
29598
  }
29398
- if (!warn) return EXIT_ALLOW18;
29599
+ if (!warn) return EXIT_ALLOW19;
29399
29600
  process.stdout.write(`${JSON.stringify({ reason: nudgeReason2(event.file) })}
29400
29601
  `);
29401
29602
  return EXIT_WARN9;
29402
29603
  }
29403
- function isCliEntry12() {
29604
+ function isCliEntry13() {
29404
29605
  const entry = process.argv[1];
29405
29606
  if (!entry) return false;
29406
- return pathToFileURL36(path68.resolve(entry)).href === import.meta.url;
29607
+ return pathToFileURL37(path69.resolve(entry)).href === import.meta.url;
29407
29608
  }
29408
- if (isCliEntry12()) process.exit(main41());
29409
- var _HOOK_FILE = fileURLToPath43(import.meta.url);
29609
+ if (isCliEntry13()) process.exit(main42());
29610
+ var _HOOK_FILE = fileURLToPath44(import.meta.url);
29410
29611
 
29411
29612
  // src/scripts/hooks/orchestration_record_hook.ts
29412
29613
  import * as crypto8 from "node:crypto";
29413
- import * as fs70 from "node:fs";
29414
- import * as path70 from "node:path";
29415
- import { fileURLToPath as fileURLToPath44, pathToFileURL as pathToFileURL38 } from "node:url";
29614
+ import * as fs71 from "node:fs";
29615
+ import * as path71 from "node:path";
29616
+ import { fileURLToPath as fileURLToPath45, pathToFileURL as pathToFileURL39 } from "node:url";
29416
29617
 
29417
29618
  // src/scripts/_lib/orchestration_record.ts
29418
29619
  var DISPATCH_OUTCOMES = ["DONE", "DONE_WITH_CONCERNS", "NEEDS_CONTEXT", "BLOCKED", "killed"];
@@ -29608,9 +29809,9 @@ function buildOrchestrationLine(input) {
29608
29809
 
29609
29810
  // src/scripts/orchestration_record.ts
29610
29811
  import * as crypto7 from "node:crypto";
29611
- import * as fs69 from "node:fs";
29612
- import * as path69 from "node:path";
29613
- import { pathToFileURL as pathToFileURL37 } from "node:url";
29812
+ import * as fs70 from "node:fs";
29813
+ import * as path70 from "node:path";
29814
+ import { pathToFileURL as pathToFileURL38 } from "node:url";
29614
29815
  var DEFAULT_DIR = "agents/runtime/state/audit";
29615
29816
  function parseFlags(argv) {
29616
29817
  const flags = {};
@@ -29633,7 +29834,7 @@ function parseFlags(argv) {
29633
29834
  }
29634
29835
  return flags;
29635
29836
  }
29636
- function str3(flags, key) {
29837
+ function str4(flags, key) {
29637
29838
  const v = flags[key];
29638
29839
  return typeof v === "string" ? v : void 0;
29639
29840
  }
@@ -29645,7 +29846,7 @@ function bool(flags, key) {
29645
29846
  return v;
29646
29847
  }
29647
29848
  function int(flags, key) {
29648
- const v = str3(flags, key);
29849
+ const v = str4(flags, key);
29649
29850
  if (v === void 0) return void 0;
29650
29851
  const n = Number(v);
29651
29852
  return Number.isFinite(n) ? n : NaN;
@@ -29660,52 +29861,52 @@ function contentHashId(input) {
29660
29861
  });
29661
29862
  return crypto7.createHash("sha256").update(canonical2).digest("hex").slice(0, 26).toUpperCase();
29662
29863
  }
29663
- function main42(argv = process.argv.slice(2)) {
29864
+ function main43(argv = process.argv.slice(2)) {
29664
29865
  const flags = parseFlags(argv);
29665
- const dir = str3(flags, "dir") ?? DEFAULT_DIR;
29866
+ const dir = str4(flags, "dir") ?? DEFAULT_DIR;
29666
29867
  const dryRun = flags["dry-run"] === true;
29667
29868
  const ts = (/* @__PURE__ */ new Date()).toISOString();
29668
29869
  const partial = {
29669
29870
  spawn_count: int(flags, "spawn-count") ?? NaN,
29670
29871
  token_delta: int(flags, "token-delta") ?? NaN,
29671
- token_delta_provenance: str3(flags, "provenance"),
29672
- tiers: str3(flags, "tiers")?.split(",").map((s) => s.trim()).filter(Boolean),
29673
- agent_combo: str3(flags, "agent-combo")?.split(",").map((s) => s.trim()).filter(Boolean),
29674
- tier_chosen: str3(flags, "tier-chosen"),
29675
- tier_source: str3(flags, "tier-source"),
29676
- task_class: str3(flags, "task-class"),
29677
- dispatch_mode: str3(flags, "dispatch-mode"),
29872
+ token_delta_provenance: str4(flags, "provenance"),
29873
+ tiers: str4(flags, "tiers")?.split(",").map((s) => s.trim()).filter(Boolean),
29874
+ agent_combo: str4(flags, "agent-combo")?.split(",").map((s) => s.trim()).filter(Boolean),
29875
+ tier_chosen: str4(flags, "tier-chosen"),
29876
+ tier_source: str4(flags, "tier-source"),
29877
+ task_class: str4(flags, "task-class"),
29878
+ dispatch_mode: str4(flags, "dispatch-mode"),
29678
29879
  task_size_estimate: int(flags, "task-size-estimate"),
29679
29880
  wall_clock_ms: int(flags, "wall-clock-ms"),
29680
29881
  dispatch_tokens: int(flags, "dispatch-tokens"),
29681
- session_tier: str3(flags, "session-tier"),
29682
- dispatch_outcome: str3(flags, "dispatch-outcome"),
29683
- verify_mode: str3(flags, "verify-mode"),
29882
+ session_tier: str4(flags, "session-tier"),
29883
+ dispatch_outcome: str4(flags, "dispatch-outcome"),
29884
+ verify_mode: str4(flags, "verify-mode"),
29684
29885
  first_pass_success: bool(flags, "first-pass-success"),
29685
29886
  escalated: bool(flags, "escalated"),
29686
29887
  init_tokens: int(flags, "init-tokens"),
29687
- payload_hash: str3(flags, "payload-hash"),
29688
- lookup_class: str3(flags, "lookup-class"),
29689
- route_taken: str3(flags, "route-taken"),
29888
+ payload_hash: str4(flags, "payload-hash"),
29889
+ lookup_class: str4(flags, "lookup-class"),
29890
+ route_taken: str4(flags, "route-taken"),
29690
29891
  budget_hit: bool(flags, "budget-hit"),
29691
29892
  correctness_match: bool(flags, "correctness-match"),
29692
29893
  cache_hit: bool(flags, "cache-hit"),
29693
- origin: str3(flags, "origin"),
29894
+ origin: str4(flags, "origin"),
29694
29895
  rules_carried: int(flags, "rules-carried"),
29695
29896
  rules_used: int(flags, "rules-used"),
29696
29897
  work_tokens: int(flags, "work-tokens"),
29697
- floor_provenance: str3(flags, "floor-provenance"),
29898
+ floor_provenance: str4(flags, "floor-provenance"),
29698
29899
  capsule_emitted: bool(flags, "capsule-emitted"),
29699
29900
  capsule_entries: int(flags, "capsule-entries"),
29700
29901
  watermark_step: int(flags, "watermark-step"),
29701
29902
  saturation_step: int(flags, "saturation-step"),
29702
- trigger_arm_earlier: str3(flags, "trigger-arm-earlier"),
29703
- phase: str3(flags, "phase"),
29704
- outcome: str3(flags, "outcome"),
29705
- confidence_band: str3(flags, "confidence-band"),
29706
- risk_class: str3(flags, "risk-class"),
29707
- persona: str3(flags, "persona"),
29708
- work_id: str3(flags, "work-id"),
29903
+ trigger_arm_earlier: str4(flags, "trigger-arm-earlier"),
29904
+ phase: str4(flags, "phase"),
29905
+ outcome: str4(flags, "outcome"),
29906
+ confidence_band: str4(flags, "confidence-band"),
29907
+ risk_class: str4(flags, "risk-class"),
29908
+ persona: str4(flags, "persona"),
29909
+ work_id: str4(flags, "work-id"),
29709
29910
  ts
29710
29911
  };
29711
29912
  const input = { ...partial, id: contentHashId({ ...partial, id: "" }) };
@@ -29721,27 +29922,27 @@ function main42(argv = process.argv.slice(2)) {
29721
29922
  process.stdout.write(serialized + "\n");
29722
29923
  return 0;
29723
29924
  }
29724
- fs69.mkdirSync(dir, { recursive: true });
29725
- const file = path69.join(dir, `${ts.slice(0, 7)}.jsonl`);
29726
- fs69.appendFileSync(file, serialized + "\n", "utf8");
29925
+ fs70.mkdirSync(dir, { recursive: true });
29926
+ const file = path70.join(dir, `${ts.slice(0, 7)}.jsonl`);
29927
+ fs70.appendFileSync(file, serialized + "\n", "utf8");
29727
29928
  process.stdout.write(`orchestration telemetry recorded \u2192 ${file} (id ${line.id})
29728
29929
  `);
29729
29930
  return 0;
29730
29931
  }
29731
29932
  if (process.argv[1] !== void 0) {
29732
- const invokedUrl = pathToFileURL37(path69.resolve(process.argv[1])).href;
29733
- if (import.meta.url === invokedUrl) process.exit(main42());
29933
+ const invokedUrl = pathToFileURL38(path70.resolve(process.argv[1])).href;
29934
+ if (import.meta.url === invokedUrl) process.exit(main43());
29734
29935
  }
29735
29936
 
29736
29937
  // src/scripts/hooks/orchestration_record_hook.ts
29737
- var EXIT_ALLOW19 = 0;
29738
- function isObject7(v) {
29938
+ var EXIT_ALLOW20 = 0;
29939
+ function isObject8(v) {
29739
29940
  return typeof v === "object" && v !== null && !Array.isArray(v);
29740
29941
  }
29741
29942
  var DISPATCH_TOOL_NAMES = /* @__PURE__ */ new Set(["Agent", "Task"]);
29742
29943
  function unwrapPayload2(envelope) {
29743
29944
  const inner = envelope["payload"];
29744
- return isObject7(inner) ? inner : envelope;
29945
+ return isObject8(inner) ? inner : envelope;
29745
29946
  }
29746
29947
  function extractToolName2(payload) {
29747
29948
  const v = payload["tool_name"] ?? payload["toolName"] ?? payload["tool"];
@@ -29749,12 +29950,12 @@ function extractToolName2(payload) {
29749
29950
  }
29750
29951
  function extractToolInput(payload) {
29751
29952
  const v = payload["tool_input"] ?? payload["toolInput"];
29752
- return isObject7(v) ? v : null;
29953
+ return isObject8(v) ? v : null;
29753
29954
  }
29754
29955
  function extractToolResult(payload) {
29755
29956
  for (const key of ["tool_response", "toolResponse", "tool_result", "toolUseResult"]) {
29756
29957
  const v = payload[key];
29757
- if (isObject7(v)) return v;
29958
+ if (isObject8(v)) return v;
29758
29959
  }
29759
29960
  return null;
29760
29961
  }
@@ -29775,7 +29976,7 @@ function extractDispatchFacts(payload) {
29775
29976
  const result = extractToolResult(payload);
29776
29977
  const resolvedModel = result && typeof result["resolvedModel"] === "string" ? result["resolvedModel"] : null;
29777
29978
  let totalTokens = result ? numOrNull(result["totalTokens"]) : null;
29778
- if (totalTokens === null && result && isObject7(result["usage"])) {
29979
+ if (totalTokens === null && result && isObject8(result["usage"])) {
29779
29980
  const usage = result["usage"];
29780
29981
  const inTok = numOrNull(usage["input_tokens"]);
29781
29982
  const outTok = numOrNull(usage["output_tokens"]);
@@ -29825,35 +30026,35 @@ function buildRecordInput(facts, ts, id) {
29825
30026
  return input;
29826
30027
  }
29827
30028
  function auditFileFor(consumerRoot, ts) {
29828
- return path70.join(consumerRoot, DEFAULT_DIR, `${ts.slice(0, 7)}.jsonl`);
30029
+ return path71.join(consumerRoot, DEFAULT_DIR, `${ts.slice(0, 7)}.jsonl`);
29829
30030
  }
29830
30031
  function appendLine(consumerRoot, ts, line) {
29831
30032
  if (is_replay_mode()) return;
29832
30033
  const file = auditFileFor(consumerRoot, ts);
29833
- fs70.mkdirSync(path70.dirname(file), { recursive: true });
29834
- fs70.appendFileSync(file, `${JSON.stringify(line)}
30034
+ fs71.mkdirSync(path71.dirname(file), { recursive: true });
30035
+ fs71.appendFileSync(file, `${JSON.stringify(line)}
29835
30036
  `, "utf8");
29836
30037
  }
29837
30038
  function processEnvelope2(envelope, consumer_root) {
29838
30039
  try {
29839
- if (!isObject7(envelope)) return EXIT_ALLOW19;
30040
+ if (!isObject8(envelope)) return EXIT_ALLOW20;
29840
30041
  const payload = unwrapPayload2(envelope);
29841
30042
  const toolName = extractToolName2(payload);
29842
- if (toolName === null || !DISPATCH_TOOL_NAMES.has(toolName)) return EXIT_ALLOW19;
30043
+ if (toolName === null || !DISPATCH_TOOL_NAMES.has(toolName)) return EXIT_ALLOW20;
29843
30044
  const facts = extractDispatchFacts(payload);
29844
30045
  const ts = (/* @__PURE__ */ new Date()).toISOString();
29845
30046
  const id = crypto8.randomUUID();
29846
30047
  const input = buildRecordInput(facts, ts, id);
29847
30048
  const { line, errors } = buildOrchestrationLine(input);
29848
- if (errors.length || line === null) return EXIT_ALLOW19;
30049
+ if (errors.length || line === null) return EXIT_ALLOW20;
29849
30050
  appendLine(consumer_root, ts, line);
29850
30051
  } catch {
29851
- return EXIT_ALLOW19;
30052
+ return EXIT_ALLOW20;
29852
30053
  }
29853
- return EXIT_ALLOW19;
30054
+ return EXIT_ALLOW20;
29854
30055
  }
29855
30056
  function _resolveRoot2(envelope) {
29856
- if (isObject7(envelope)) {
30057
+ if (isObject8(envelope)) {
29857
30058
  const cwd = envelope["cwd"];
29858
30059
  if (typeof cwd === "string" && cwd) return cwd;
29859
30060
  const pr = envelope["workspace_root"] ?? envelope["project_root"];
@@ -29861,13 +30062,13 @@ function _resolveRoot2(envelope) {
29861
30062
  }
29862
30063
  return process.cwd();
29863
30064
  }
29864
- function main43() {
30065
+ function main44() {
29865
30066
  const raw = readHookStdin();
29866
30067
  let envelope = {};
29867
30068
  try {
29868
30069
  envelope = raw.trim() ? JSON.parse(raw) : {};
29869
30070
  } catch {
29870
- return EXIT_ALLOW19;
30071
+ return EXIT_ALLOW20;
29871
30072
  }
29872
30073
  return processEnvelope2(envelope, _resolveRoot2(envelope));
29873
30074
  }
@@ -29876,27 +30077,27 @@ function _isCliEntry32() {
29876
30077
  return false;
29877
30078
  }
29878
30079
  if (process.argv[1] === void 0) return false;
29879
- const argvUrl = pathToFileURL38(path70.resolve(process.argv[1])).href;
30080
+ const argvUrl = pathToFileURL39(path71.resolve(process.argv[1])).href;
29880
30081
  if (import.meta.url === argvUrl) return true;
29881
30082
  try {
29882
- return fs70.realpathSync(fileURLToPath44(import.meta.url)) === fs70.realpathSync(path70.resolve(process.argv[1]));
30083
+ return fs71.realpathSync(fileURLToPath45(import.meta.url)) === fs71.realpathSync(path71.resolve(process.argv[1]));
29883
30084
  } catch {
29884
30085
  return false;
29885
30086
  }
29886
30087
  }
29887
- if (_isCliEntry32()) process.exit(main43());
30088
+ if (_isCliEntry32()) process.exit(main44());
29888
30089
 
29889
30090
  // src/scripts/hooks/telemetry_flush_hook.ts
29890
- import * as fs71 from "node:fs";
29891
- import * as path71 from "node:path";
29892
- import { fileURLToPath as fileURLToPath45, pathToFileURL as pathToFileURL39 } from "node:url";
29893
- var EXIT_ALLOW20 = 0;
30091
+ import * as fs72 from "node:fs";
30092
+ import * as path72 from "node:path";
30093
+ import { fileURLToPath as fileURLToPath46, pathToFileURL as pathToFileURL40 } from "node:url";
30094
+ var EXIT_ALLOW21 = 0;
29894
30095
  var SENDER_REL = "../../agent-src/templates/scripts/telemetry/flush_sender.mjs";
29895
30096
  function resolveSenderScript() {
29896
30097
  try {
29897
- const here = path71.dirname(fileURLToPath45(import.meta.url));
29898
- const candidate = path71.resolve(here, SENDER_REL);
29899
- return fs71.statSync(candidate).isFile() ? candidate : null;
30098
+ const here = path72.dirname(fileURLToPath46(import.meta.url));
30099
+ const candidate = path72.resolve(here, SENDER_REL);
30100
+ return fs72.statSync(candidate).isFile() ? candidate : null;
29900
30101
  } catch {
29901
30102
  return null;
29902
30103
  }
@@ -29907,7 +30108,7 @@ function flushFor(consumer_root, sender = resolveSenderScript()) {
29907
30108
  if (!settings.active) return { result: "inactive" };
29908
30109
  if (settings.flush !== FLUSH_SESSION_END) return { result: "flush-never" };
29909
30110
  if (is_replay_mode()) return { result: "replay" };
29910
- const logPath = path71.isAbsolute(settings.log_path) ? settings.log_path : path71.join(root, settings.log_path);
30111
+ const logPath = path72.isAbsolute(settings.log_path) ? settings.log_path : path72.join(root, settings.log_path);
29911
30112
  const spool = spool_path_for(logPath);
29912
30113
  if (!spool_has_work(spool)) return { result: "empty-spool" };
29913
30114
  if (sender === null) return { result: "no-sender" };
@@ -29922,7 +30123,7 @@ function flushFor(consumer_root, sender = resolveSenderScript()) {
29922
30123
  return { result: "inactive" };
29923
30124
  }
29924
30125
  }
29925
- function main44() {
30126
+ function main45() {
29926
30127
  const raw = readHookStdin();
29927
30128
  let envelope = {};
29928
30129
  try {
@@ -29931,27 +30132,27 @@ function main44() {
29931
30132
  envelope = {};
29932
30133
  }
29933
30134
  flushFor(_resolveRoot(envelope));
29934
- return EXIT_ALLOW20;
30135
+ return EXIT_ALLOW21;
29935
30136
  }
29936
30137
  function _isCliEntry33() {
29937
30138
  if (true) {
29938
30139
  return false;
29939
30140
  }
29940
30141
  if (process.argv[1] === void 0) return false;
29941
- const argvUrl = pathToFileURL39(path71.resolve(process.argv[1])).href;
30142
+ const argvUrl = pathToFileURL40(path72.resolve(process.argv[1])).href;
29942
30143
  if (import.meta.url === argvUrl) return true;
29943
30144
  try {
29944
- return fs71.realpathSync(fileURLToPath45(import.meta.url)) === fs71.realpathSync(path71.resolve(process.argv[1]));
30145
+ return fs72.realpathSync(fileURLToPath46(import.meta.url)) === fs72.realpathSync(path72.resolve(process.argv[1]));
29945
30146
  } catch {
29946
30147
  return false;
29947
30148
  }
29948
30149
  }
29949
- if (_isCliEntry33()) process.exit(main44());
30150
+ if (_isCliEntry33()) process.exit(main45());
29950
30151
 
29951
30152
  // src/scripts/hooks/delegation_nudge_hook.ts
29952
- import fs72 from "node:fs";
29953
- import path72 from "node:path";
29954
- import { fileURLToPath as fileURLToPath46, pathToFileURL as pathToFileURL40 } from "node:url";
30153
+ import fs73 from "node:fs";
30154
+ import path73 from "node:path";
30155
+ import { fileURLToPath as fileURLToPath47, pathToFileURL as pathToFileURL41 } from "node:url";
29955
30156
 
29956
30157
  // src/scripts/_lib/host_capability.ts
29957
30158
  import process10 from "node:process";
@@ -30278,7 +30479,7 @@ function resolveSubagentRouting(inp) {
30278
30479
  }
30279
30480
 
30280
30481
  // src/scripts/hooks/delegation_nudge_hook.ts
30281
- var EXIT_ALLOW21 = 0;
30482
+ var EXIT_ALLOW22 = 0;
30282
30483
  var EXIT_WARN10 = 2;
30283
30484
  function _isObject14(v) {
30284
30485
  return typeof v === "object" && v !== null && !Array.isArray(v);
@@ -30439,34 +30640,34 @@ function _workspaceRoot4(envelope) {
30439
30640
  }
30440
30641
  return process.cwd();
30441
30642
  }
30442
- function main45() {
30643
+ function main46() {
30443
30644
  let envelope = {};
30444
30645
  try {
30445
30646
  const raw = readHookStdin();
30446
30647
  envelope = raw.trim() ? JSON.parse(raw) : {};
30447
30648
  } catch {
30448
- return EXIT_ALLOW21;
30649
+ return EXIT_ALLOW22;
30449
30650
  }
30450
30651
  const env = _isObject14(envelope) ? envelope : {};
30451
30652
  const event = env["event"];
30452
30653
  const slot = typeof event === "string" && event !== "" ? event : "user_prompt_submit";
30453
30654
  if (slot !== "user_prompt_submit") {
30454
- return EXIT_ALLOW21;
30655
+ return EXIT_ALLOW22;
30455
30656
  }
30456
30657
  const payload = _isObject14(env["payload"]) ? env["payload"] : env;
30457
30658
  const prompt = _extractPrompt2(payload);
30458
30659
  if (!prompt) {
30459
- return EXIT_ALLOW21;
30660
+ return EXIT_ALLOW22;
30460
30661
  }
30461
30662
  if (isSyntheticPrompt(prompt)) {
30462
- return EXIT_ALLOW21;
30663
+ return EXIT_ALLOW22;
30463
30664
  }
30464
30665
  const root = _workspaceRoot4(env);
30465
30666
  const platform = env["platform"];
30466
30667
  const hostId = typeof platform === "string" && platform ? platform : null;
30467
30668
  const result = classifyPrompt(prompt, root, hostId);
30468
30669
  if (!result) {
30469
- return EXIT_ALLOW21;
30670
+ return EXIT_ALLOW22;
30470
30671
  }
30471
30672
  process.stdout.write(
30472
30673
  `${JSON.stringify({
@@ -30485,42 +30686,42 @@ function _isCliEntry34() {
30485
30686
  if (process.argv[1] === void 0) {
30486
30687
  return false;
30487
30688
  }
30488
- const argvUrl = pathToFileURL40(path72.resolve(process.argv[1])).href;
30689
+ const argvUrl = pathToFileURL41(path73.resolve(process.argv[1])).href;
30489
30690
  if (import.meta.url === argvUrl) {
30490
30691
  return true;
30491
30692
  }
30492
30693
  try {
30493
- const here = fs72.realpathSync(fileURLToPath46(import.meta.url));
30494
- const argv = fs72.realpathSync(path72.resolve(process.argv[1]));
30694
+ const here = fs73.realpathSync(fileURLToPath47(import.meta.url));
30695
+ const argv = fs73.realpathSync(path73.resolve(process.argv[1]));
30495
30696
  return here === argv;
30496
30697
  } catch {
30497
30698
  return false;
30498
30699
  }
30499
30700
  }
30500
30701
  if (_isCliEntry34()) {
30501
- process.exit(main45());
30702
+ process.exit(main46());
30502
30703
  }
30503
30704
 
30504
30705
  // src/scripts/hooks/skill_route_hook.ts
30505
- import fs75 from "node:fs";
30506
- import path75 from "node:path";
30507
- import { fileURLToPath as fileURLToPath48, pathToFileURL as pathToFileURL42 } from "node:url";
30706
+ import fs76 from "node:fs";
30707
+ import path76 from "node:path";
30708
+ import { fileURLToPath as fileURLToPath49, pathToFileURL as pathToFileURL43 } from "node:url";
30508
30709
 
30509
30710
  // src/scripts/_lib/skill_catalogue.ts
30510
- import * as fs73 from "node:fs";
30511
- import * as path73 from "node:path";
30711
+ import * as fs74 from "node:fs";
30712
+ import * as path74 from "node:path";
30512
30713
  var DEFAULT_CATALOGUE_ROOTS = [".claude/skills", "src/skills"];
30513
30714
  function resolveSkillsRoot(workspaceRoot3) {
30514
30715
  for (const candidate of DEFAULT_CATALOGUE_ROOTS) {
30515
- const abs = path73.join(workspaceRoot3, candidate);
30716
+ const abs = path74.join(workspaceRoot3, candidate);
30516
30717
  try {
30517
- if (fs73.existsSync(abs) && fs73.statSync(abs).isDirectory()) return abs;
30718
+ if (fs74.existsSync(abs) && fs74.statSync(abs).isDirectory()) return abs;
30518
30719
  } catch {
30519
30720
  }
30520
30721
  }
30521
30722
  return null;
30522
30723
  }
30523
- var OBSERVATION_LOG = path73.join(
30724
+ var OBSERVATION_LOG = path74.join(
30524
30725
  "agents",
30525
30726
  "evidence",
30526
30727
  "metrics",
@@ -30546,9 +30747,9 @@ function headlineRecordPerHost(records) {
30546
30747
  return out;
30547
30748
  }
30548
30749
  function readObservationLog(logPath) {
30549
- if (!fs73.existsSync(logPath)) return [];
30750
+ if (!fs74.existsSync(logPath)) return [];
30550
30751
  const out = [];
30551
- for (const line of fs73.readFileSync(logPath, "utf-8").split("\n")) {
30752
+ for (const line of fs74.readFileSync(logPath, "utf-8").split("\n")) {
30552
30753
  const trimmed = line.trim();
30553
30754
  if (trimmed.length === 0) continue;
30554
30755
  try {
@@ -30573,9 +30774,9 @@ function knownBareNames(records, host) {
30573
30774
  }
30574
30775
 
30575
30776
  // src/scripts/skill_tools/score_skill_relevance.ts
30576
- import * as fs74 from "node:fs";
30577
- import * as path74 from "node:path";
30578
- import { fileURLToPath as fileURLToPath47, pathToFileURL as pathToFileURL41 } from "node:url";
30777
+ import * as fs75 from "node:fs";
30778
+ import * as path75 from "node:path";
30779
+ import { fileURLToPath as fileURLToPath48, pathToFileURL as pathToFileURL42 } from "node:url";
30579
30780
 
30580
30781
  // src/shared/skillRanking.ts
30581
30782
  var TOKEN_RE2 = /[a-z][a-z0-9]+/g;
@@ -30706,9 +30907,9 @@ function scoreSkill(taskTerms, skill, terms) {
30706
30907
  }
30707
30908
 
30708
30909
  // src/scripts/skill_tools/score_skill_relevance.ts
30709
- var _HERE8 = fileURLToPath47(import.meta.url);
30710
- var ROOT2 = path74.resolve(path74.dirname(_HERE8), "..", "..", "..");
30711
- var DEFAULT_SKILLS_DIR = path74.join(ROOT2, ".agent-src.uncondensed", "skills");
30910
+ var _HERE8 = fileURLToPath48(import.meta.url);
30911
+ var ROOT2 = path75.resolve(path75.dirname(_HERE8), "..", "..", "..");
30912
+ var DEFAULT_SKILLS_DIR = path75.join(ROOT2, ".agent-src.uncondensed", "skills");
30712
30913
  function pyLen2(s) {
30713
30914
  let n = 0;
30714
30915
  for (const _ of s) {
@@ -30720,7 +30921,7 @@ function _tokenize(text) {
30720
30921
  return tokenize2(text);
30721
30922
  }
30722
30923
  function _parse_frontmatter(filePath) {
30723
- const text = fs74.readFileSync(filePath, "utf-8");
30924
+ const text = fs75.readFileSync(filePath, "utf-8");
30724
30925
  if (!text.startsWith("---")) {
30725
30926
  return {};
30726
30927
  }
@@ -30777,7 +30978,7 @@ function _load_skills(skillsDir) {
30777
30978
  for (const skillMd of _globSkillMd(skillsDir)) {
30778
30979
  const fm = _parse_frontmatter(skillMd);
30779
30980
  const rawName = fm["name"];
30780
- const name = _truthyStr(rawName) ? String(rawName) : path74.basename(path74.dirname(skillMd));
30981
+ const name = _truthyStr(rawName) ? String(rawName) : path75.basename(path75.dirname(skillMd));
30781
30982
  const rawDesc = fm["description"];
30782
30983
  const desc = _truthyStr(rawDesc) ? String(rawDesc) : "";
30783
30984
  let personas = fm["personas"] ?? [];
@@ -30806,23 +31007,23 @@ function _truthyStr(v) {
30806
31007
  function _globSkillMd(root) {
30807
31008
  let names;
30808
31009
  try {
30809
- names = fs74.readdirSync(root);
31010
+ names = fs75.readdirSync(root);
30810
31011
  } catch {
30811
31012
  return [];
30812
31013
  }
30813
31014
  const dirs = [];
30814
31015
  for (const name of names) {
30815
- const dir = path74.join(root, name);
30816
- const skillMd = path74.join(dir, "SKILL.md");
31016
+ const dir = path75.join(root, name);
31017
+ const skillMd = path75.join(dir, "SKILL.md");
30817
31018
  try {
30818
- if (fs74.statSync(dir).isDirectory() && fs74.statSync(skillMd).isFile()) {
31019
+ if (fs75.statSync(dir).isDirectory() && fs75.statSync(skillMd).isFile()) {
30819
31020
  dirs.push(name);
30820
31021
  }
30821
31022
  } catch {
30822
31023
  }
30823
31024
  }
30824
31025
  dirs.sort();
30825
- return dirs.map((name) => path74.join(root, name, "SKILL.md"));
31026
+ return dirs.map((name) => path75.join(root, name, "SKILL.md"));
30826
31027
  }
30827
31028
  function _score3(taskTerms, skill, opts = {}) {
30828
31029
  const rankable = {
@@ -31013,7 +31214,7 @@ function parse_args8(argv) {
31013
31214
  var _SAMPLE = {
31014
31215
  task: "build a livewire component for the user dashboard with reactive state"
31015
31216
  };
31016
- function main46(argv = null) {
31217
+ function main47(argv = null) {
31017
31218
  const args = parse_args8(argv ?? process.argv.slice(2));
31018
31219
  const task = args.sample ? _SAMPLE.task : args.task;
31019
31220
  if (!task) {
@@ -31035,13 +31236,13 @@ function _isCliEntry35() {
31035
31236
  if (process.argv[1] === void 0) {
31036
31237
  return false;
31037
31238
  }
31038
- const argvUrl = pathToFileURL41(path74.resolve(process.argv[1])).href;
31239
+ const argvUrl = pathToFileURL42(path75.resolve(process.argv[1])).href;
31039
31240
  if (import.meta.url === argvUrl) {
31040
31241
  return true;
31041
31242
  }
31042
31243
  try {
31043
- const here = fs74.realpathSync(fileURLToPath47(import.meta.url));
31044
- const argv = fs74.realpathSync(path74.resolve(process.argv[1]));
31244
+ const here = fs75.realpathSync(fileURLToPath48(import.meta.url));
31245
+ const argv = fs75.realpathSync(path75.resolve(process.argv[1]));
31045
31246
  return here === argv;
31046
31247
  } catch {
31047
31248
  return false;
@@ -31049,11 +31250,11 @@ function _isCliEntry35() {
31049
31250
  }
31050
31251
  var _isMain5 = _isCliEntry35();
31051
31252
  if (_isMain5) {
31052
- process.exitCode = main46();
31253
+ process.exitCode = main47();
31053
31254
  }
31054
31255
 
31055
31256
  // src/scripts/hooks/skill_route_hook.ts
31056
- var EXIT_ALLOW22 = 0;
31257
+ var EXIT_ALLOW23 = 0;
31057
31258
  var EXIT_WARN11 = 2;
31058
31259
  var MIN_TOP_SCORE = 31;
31059
31260
  var MIN_TASK_TERMS = 3;
@@ -31064,7 +31265,7 @@ function _isObject15(v) {
31064
31265
  function knownBareForHost(workspaceRoot3, host) {
31065
31266
  if (host === null || host === "") return null;
31066
31267
  try {
31067
- return knownBareNames(readObservationLog(path75.join(workspaceRoot3, OBSERVATION_LOG)), host);
31268
+ return knownBareNames(readObservationLog(path76.join(workspaceRoot3, OBSERVATION_LOG)), host);
31068
31269
  } catch {
31069
31270
  return null;
31070
31271
  }
@@ -31116,22 +31317,22 @@ function _workspaceRoot5(envelope) {
31116
31317
  const v = envelope["workspace_root"];
31117
31318
  return typeof v === "string" && v ? v : process.cwd();
31118
31319
  }
31119
- function main47() {
31320
+ function main48() {
31120
31321
  let envelope = {};
31121
31322
  try {
31122
31323
  const raw = readHookStdin();
31123
31324
  envelope = raw.trim() ? JSON.parse(raw) : {};
31124
31325
  } catch {
31125
- return EXIT_ALLOW22;
31326
+ return EXIT_ALLOW23;
31126
31327
  }
31127
31328
  const env = _isObject15(envelope) ? envelope : {};
31128
31329
  const event = env["event"];
31129
31330
  const slot = typeof event === "string" && event !== "" ? event : "user_prompt_submit";
31130
- if (slot !== "user_prompt_submit") return EXIT_ALLOW22;
31331
+ if (slot !== "user_prompt_submit") return EXIT_ALLOW23;
31131
31332
  const payload = _isObject15(env["payload"]) ? env["payload"] : env;
31132
31333
  const prompt = _extractPrompt3(payload);
31133
- if (!prompt) return EXIT_ALLOW22;
31134
- if (isSyntheticPrompt(prompt)) return EXIT_ALLOW22;
31334
+ if (!prompt) return EXIT_ALLOW23;
31335
+ if (isSyntheticPrompt(prompt)) return EXIT_ALLOW23;
31135
31336
  const root = _workspaceRoot5(env);
31136
31337
  const platform = env["platform"];
31137
31338
  const host = typeof platform === "string" && platform ? platform : null;
@@ -31140,7 +31341,7 @@ function main47() {
31140
31341
  resolveSkillsRoot(root),
31141
31342
  () => knownBareForHost(root, host)
31142
31343
  );
31143
- if (rows.length === 0) return EXIT_ALLOW22;
31344
+ if (rows.length === 0) return EXIT_ALLOW23;
31144
31345
  process.stdout.write(
31145
31346
  `${JSON.stringify({
31146
31347
  decision: "warn",
@@ -31156,25 +31357,25 @@ function main47() {
31156
31357
  function _isCliEntry36() {
31157
31358
  if (true) return false;
31158
31359
  if (process.argv[1] === void 0) return false;
31159
- const argvUrl = pathToFileURL42(path75.resolve(process.argv[1])).href;
31360
+ const argvUrl = pathToFileURL43(path76.resolve(process.argv[1])).href;
31160
31361
  if (import.meta.url === argvUrl) return true;
31161
31362
  try {
31162
- const here = fs75.realpathSync(fileURLToPath48(import.meta.url));
31163
- const argv = fs75.realpathSync(path75.resolve(process.argv[1]));
31363
+ const here = fs76.realpathSync(fileURLToPath49(import.meta.url));
31364
+ const argv = fs76.realpathSync(path76.resolve(process.argv[1]));
31164
31365
  return here === argv;
31165
31366
  } catch {
31166
31367
  return false;
31167
31368
  }
31168
31369
  }
31169
31370
  if (_isCliEntry36()) {
31170
- process.exit(main47());
31371
+ process.exit(main48());
31171
31372
  }
31172
31373
 
31173
31374
  // src/scripts/hooks/rule_inject_hook.ts
31174
- import * as fs77 from "node:fs";
31175
- import * as path77 from "node:path";
31375
+ import * as fs78 from "node:fs";
31376
+ import * as path78 from "node:path";
31176
31377
  import process11 from "node:process";
31177
- import { fileURLToPath as fileURLToPath49, pathToFileURL as pathToFileURL43 } from "node:url";
31378
+ import { fileURLToPath as fileURLToPath50, pathToFileURL as pathToFileURL44 } from "node:url";
31178
31379
 
31179
31380
  // src/scripts/_lib/lean_projection_mode.ts
31180
31381
  var DEFAULT_LEAN_PROJECTION_MODE = "eager-all";
@@ -31189,8 +31390,8 @@ function deliversBodies(mode) {
31189
31390
  }
31190
31391
 
31191
31392
  // src/scripts/_lib/rule_injection.ts
31192
- import * as fs76 from "node:fs";
31193
- import * as path76 from "node:path";
31393
+ import * as fs77 from "node:fs";
31394
+ import * as path77 from "node:path";
31194
31395
 
31195
31396
  // src/scripts/_lib/router_match.ts
31196
31397
  function _fnmatchToRegExp(pat) {
@@ -31370,8 +31571,8 @@ function match_prompt(router, prompt, profile = "full", open_files, command) {
31370
31571
 
31371
31572
  // src/scripts/_lib/rule_injection.ts
31372
31573
  function loadRouter(repoRoot) {
31373
- const p = path76.join(repoRoot, "dist", "router.json");
31374
- return JSON.parse(fs76.readFileSync(p, "utf8"));
31574
+ const p = path77.join(repoRoot, "dist", "router.json");
31575
+ return JSON.parse(fs77.readFileSync(p, "utf8"));
31375
31576
  }
31376
31577
  function kernelIds(router) {
31377
31578
  const k = Array.isArray(router["kernel"]) ? router["kernel"] : [];
@@ -31415,12 +31616,12 @@ function matchTierRules(router, prompt, openFiles, command) {
31415
31616
  return out;
31416
31617
  }
31417
31618
  function ruleBodyPath(repoRoot, id) {
31418
- return path76.join(repoRoot, "dist", "agent-src", "rules", `${id}.md`);
31619
+ return path77.join(repoRoot, "dist", "agent-src", "rules", `${id}.md`);
31419
31620
  }
31420
31621
  function loadRuleBody(repoRoot, id) {
31421
31622
  const p = ruleBodyPath(repoRoot, id);
31422
- if (!fs76.existsSync(p)) return null;
31423
- return fs76.readFileSync(p, "utf8");
31623
+ if (!fs77.existsSync(p)) return null;
31624
+ return fs77.readFileSync(p, "utf8");
31424
31625
  }
31425
31626
  function bytesOf(text) {
31426
31627
  return Buffer.byteLength(text, "utf8");
@@ -31450,14 +31651,14 @@ function selectForInjection(repoRoot, matches, capBytes) {
31450
31651
  }
31451
31652
 
31452
31653
  // src/scripts/hooks/rule_inject_hook.ts
31453
- var EXIT_ALLOW23 = 0;
31654
+ var EXIT_ALLOW24 = 0;
31454
31655
  var EXIT_WARN12 = 2;
31455
31656
  var CAP_BYTES = 20480;
31456
31657
  var FILE_TOOLS = /* @__PURE__ */ new Set(["Write", "Edit", "NotebookEdit", "Read", "MultiEdit"]);
31457
- function isObject8(v) {
31658
+ function isObject9(v) {
31458
31659
  return typeof v === "object" && v !== null && !Array.isArray(v);
31459
31660
  }
31460
- function str4(o, ...keys) {
31661
+ function str5(o, ...keys) {
31461
31662
  for (const k of keys) {
31462
31663
  const v = o[k];
31463
31664
  if (typeof v === "string" && v !== "") return v;
@@ -31465,15 +31666,15 @@ function str4(o, ...keys) {
31465
31666
  return null;
31466
31667
  }
31467
31668
  function workspaceRoot2(env) {
31468
- return str4(env, "workspace", "cwd", "project_dir") ?? process11.cwd();
31669
+ return str5(env, "workspace", "cwd", "project_dir") ?? process11.cwd();
31469
31670
  }
31470
31671
  function statePath(root, session) {
31471
31672
  const safe = session.replace(/[^A-Za-z0-9_-]/g, "_").slice(0, 80) || "unknown";
31472
- return path77.join(root, "agents", "runtime", "state", "rule-inject", `${safe}.json`);
31673
+ return path78.join(root, "agents", "runtime", "state", "rule-inject", `${safe}.json`);
31473
31674
  }
31474
31675
  function readSeen(root, session) {
31475
31676
  try {
31476
- const raw = fs77.readFileSync(statePath(root, session), "utf-8");
31677
+ const raw = fs78.readFileSync(statePath(root, session), "utf-8");
31477
31678
  const parsed = JSON.parse(raw);
31478
31679
  return new Set(Array.isArray(parsed.rules) ? parsed.rules.map(String) : []);
31479
31680
  } catch {
@@ -31483,27 +31684,27 @@ function readSeen(root, session) {
31483
31684
  function writeSeen(root, session, seen) {
31484
31685
  const p = statePath(root, session);
31485
31686
  try {
31486
- fs77.mkdirSync(path77.dirname(p), { recursive: true });
31687
+ fs78.mkdirSync(path78.dirname(p), { recursive: true });
31487
31688
  const payload = { rules: [...seen].sort() };
31488
- fs77.writeFileSync(`${p}.tmp`, `${JSON.stringify(payload)}
31689
+ fs78.writeFileSync(`${p}.tmp`, `${JSON.stringify(payload)}
31489
31690
  `, "utf-8");
31490
- fs77.renameSync(`${p}.tmp`, p);
31691
+ fs78.renameSync(`${p}.tmp`, p);
31491
31692
  } catch {
31492
31693
  }
31493
31694
  }
31494
31695
  function clearSeen(root, session) {
31495
31696
  try {
31496
- fs77.rmSync(statePath(root, session), { force: true });
31697
+ fs78.rmSync(statePath(root, session), { force: true });
31497
31698
  } catch {
31498
31699
  }
31499
31700
  }
31500
31701
  function extractPrompt(payload) {
31501
- return str4(payload, "prompt", "user_prompt", "userPrompt", "message", "text") ?? "";
31702
+ return str5(payload, "prompt", "user_prompt", "userPrompt", "message", "text") ?? "";
31502
31703
  }
31503
31704
  function extractFilePath(payload) {
31504
31705
  const ti = payload["tool_input"] ?? payload["toolInput"] ?? payload["input"];
31505
- if (!isObject8(ti)) return null;
31506
- return str4(ti, "file_path", "path", "filePath", "notebook_path");
31706
+ if (!isObject9(ti)) return null;
31707
+ return str5(ti, "file_path", "path", "filePath", "notebook_path");
31507
31708
  }
31508
31709
  function buildInjection(root, prompt, openFiles, command, seen) {
31509
31710
  let router;
@@ -31535,7 +31736,7 @@ function gateOpen(root, cliEntry) {
31535
31736
  if (hookSectionEnabled(root, "rule_inject")) return true;
31536
31737
  return cliEntry && process11.env["AGENT_CONFIG_REPLAY"] !== "1";
31537
31738
  }
31538
- function main48(argv = process11.argv.slice(2)) {
31739
+ function main49(argv = process11.argv.slice(2)) {
31539
31740
  let eventOverride = null;
31540
31741
  for (let i = 0; i < argv.length; i += 1) {
31541
31742
  if (argv[i] === "--event") {
@@ -31547,38 +31748,38 @@ function main48(argv = process11.argv.slice(2)) {
31547
31748
  try {
31548
31749
  const raw = readHookStdin();
31549
31750
  const parsed = raw.trim() ? JSON.parse(raw) : {};
31550
- env = isObject8(parsed) ? parsed : {};
31751
+ env = isObject9(parsed) ? parsed : {};
31551
31752
  } catch {
31552
- return EXIT_ALLOW23;
31753
+ return EXIT_ALLOW24;
31553
31754
  }
31554
31755
  const root = workspaceRoot2(env);
31555
- const payload = isObject8(env["payload"]) ? env["payload"] : env;
31556
- const slot = eventOverride ?? str4(env, "event") ?? "user_prompt_submit";
31557
- const session = str4(env, "session_id", "sessionId") ?? str4(payload, "session_id", "sessionId") ?? "unknown";
31756
+ const payload = isObject9(env["payload"]) ? env["payload"] : env;
31757
+ const slot = eventOverride ?? str5(env, "event") ?? "user_prompt_submit";
31758
+ const session = str5(env, "session_id", "sessionId") ?? str5(payload, "session_id", "sessionId") ?? "unknown";
31558
31759
  if (slot === "pre_compact") {
31559
31760
  clearSeen(root, session);
31560
- return EXIT_ALLOW23;
31761
+ return EXIT_ALLOW24;
31561
31762
  }
31562
- if (slot !== "user_prompt_submit" && slot !== "pre_tool_use") return EXIT_ALLOW23;
31563
- if (!gateOpen(root, _isCliEntry37())) return EXIT_ALLOW23;
31763
+ if (slot !== "user_prompt_submit" && slot !== "pre_tool_use") return EXIT_ALLOW24;
31764
+ if (!gateOpen(root, _isCliEntry37())) return EXIT_ALLOW24;
31564
31765
  let prompt = "";
31565
31766
  let openFiles = null;
31566
31767
  let command = null;
31567
31768
  if (slot === "user_prompt_submit") {
31568
31769
  prompt = extractPrompt(payload);
31569
- if (prompt === "") return EXIT_ALLOW23;
31770
+ if (prompt === "") return EXIT_ALLOW24;
31570
31771
  const m = /^\s*(\/[A-Za-z0-9:_-]+)/.exec(prompt);
31571
31772
  command = m ? m[1] : null;
31572
31773
  } else {
31573
- const tool = str4(payload, "tool_name", "toolName", "tool");
31574
- if (tool === null || !FILE_TOOLS.has(tool)) return EXIT_ALLOW23;
31774
+ const tool = str5(payload, "tool_name", "toolName", "tool");
31775
+ if (tool === null || !FILE_TOOLS.has(tool)) return EXIT_ALLOW24;
31575
31776
  const fp = extractFilePath(payload);
31576
- if (fp === null) return EXIT_ALLOW23;
31777
+ if (fp === null) return EXIT_ALLOW24;
31577
31778
  openFiles = [fp];
31578
31779
  }
31579
31780
  const seen = readSeen(root, session);
31580
31781
  const injection = buildInjection(root, prompt, openFiles, command, seen);
31581
- if (injection === null) return EXIT_ALLOW23;
31782
+ if (injection === null) return EXIT_ALLOW24;
31582
31783
  for (const id of injection.rules) seen.add(id);
31583
31784
  writeSeen(root, session, seen);
31584
31785
  process11.stdout.write(
@@ -31594,25 +31795,25 @@ function main48(argv = process11.argv.slice(2)) {
31594
31795
  function _isCliEntry37() {
31595
31796
  if (true) return false;
31596
31797
  if (process11.argv[1] === void 0) return false;
31597
- const argvUrl = pathToFileURL43(path77.resolve(process11.argv[1])).href;
31798
+ const argvUrl = pathToFileURL44(path78.resolve(process11.argv[1])).href;
31598
31799
  if (import.meta.url === argvUrl) return true;
31599
31800
  try {
31600
- return fs77.realpathSync(fileURLToPath49(import.meta.url)) === fs77.realpathSync(path77.resolve(process11.argv[1]));
31801
+ return fs78.realpathSync(fileURLToPath50(import.meta.url)) === fs78.realpathSync(path78.resolve(process11.argv[1]));
31601
31802
  } catch {
31602
31803
  return false;
31603
31804
  }
31604
31805
  }
31605
31806
  if (_isCliEntry37()) {
31606
- process11.exit(main48());
31807
+ process11.exit(main49());
31607
31808
  }
31608
31809
 
31609
31810
  // src/scripts/hooks/end_review_nudge_hook.ts
31610
31811
  import { spawnSync as spawnSync6 } from "node:child_process";
31611
31812
  import * as crypto9 from "node:crypto";
31612
- import * as fs78 from "node:fs";
31813
+ import * as fs79 from "node:fs";
31613
31814
  import * as os10 from "node:os";
31614
- import * as path78 from "node:path";
31615
- import { fileURLToPath as fileURLToPath50, pathToFileURL as pathToFileURL44 } from "node:url";
31815
+ import * as path79 from "node:path";
31816
+ import { fileURLToPath as fileURLToPath51, pathToFileURL as pathToFileURL45 } from "node:url";
31616
31817
 
31617
31818
  // src/scripts/_lib/review_skipped_record.ts
31618
31819
  function isNonNegInt(n) {
@@ -31659,13 +31860,13 @@ function isSafeTranscriptPath(rawPath, opts = {}) {
31659
31860
  const homeDir = opts.homeDir ?? os10.homedir();
31660
31861
  const maxBytes = opts.maxBytes ?? TRANSCRIPT_SCAN_MAX_BYTES;
31661
31862
  try {
31662
- const realHome = fs78.realpathSync(homeDir);
31663
- const realPath = fs78.realpathSync(rawPath);
31664
- const relative10 = path78.relative(realHome, realPath);
31665
- if (relative10 === "" || relative10.startsWith("..") || path78.isAbsolute(relative10)) {
31863
+ const realHome = fs79.realpathSync(homeDir);
31864
+ const realPath = fs79.realpathSync(rawPath);
31865
+ const relative10 = path79.relative(realHome, realPath);
31866
+ if (relative10 === "" || relative10.startsWith("..") || path79.isAbsolute(relative10)) {
31666
31867
  return false;
31667
31868
  }
31668
- const { size } = fs78.statSync(realPath);
31869
+ const { size } = fs79.statSync(realPath);
31669
31870
  return size <= maxBytes;
31670
31871
  } catch {
31671
31872
  return false;
@@ -31724,13 +31925,13 @@ var BINARY_PROBE_BYTES = 8e3;
31724
31925
  var UNTRACKED_FILE_READ_CAP_BYTES = 8 * 1024 * 1024;
31725
31926
  function untrackedFileLineCount(cwd, relPath) {
31726
31927
  try {
31727
- const abs = path78.resolve(cwd, relPath);
31728
- const size = fs78.statSync(abs).size;
31928
+ const abs = path79.resolve(cwd, relPath);
31929
+ const size = fs79.statSync(abs).size;
31729
31930
  if (size === 0) return 0;
31730
31931
  if (size > UNTRACKED_FILE_READ_CAP_BYTES) {
31731
31932
  return MUTATION_LINE_THRESHOLD + 1;
31732
31933
  }
31733
- const buf = fs78.readFileSync(abs);
31934
+ const buf = fs79.readFileSync(abs);
31734
31935
  if (buf.length === 0) return 0;
31735
31936
  const probe = buf.subarray(0, Math.min(buf.length, BINARY_PROBE_BYTES));
31736
31937
  if (probe.includes(0)) return 0;
@@ -31756,10 +31957,10 @@ function totalNonDocMutatedLinesWithMeasure(cwd) {
31756
31957
  );
31757
31958
  return { lines: trackedLines + untrackedLines, measure: "exact" };
31758
31959
  }
31759
- function isObject9(v) {
31960
+ function isObject10(v) {
31760
31961
  return typeof v === "object" && v !== null && !Array.isArray(v);
31761
31962
  }
31762
- function str5(v) {
31963
+ function str6(v) {
31763
31964
  return typeof v === "string" ? v : "";
31764
31965
  }
31765
31966
  var DISPATCH_TOOL_RE = /^(agent|task)$/i;
@@ -31776,28 +31977,28 @@ function scanTranscriptForReviewer(transcriptText) {
31776
31977
  } catch {
31777
31978
  continue;
31778
31979
  }
31779
- if (!isObject9(obj) || obj["type"] !== "assistant") continue;
31980
+ if (!isObject10(obj) || obj["type"] !== "assistant") continue;
31780
31981
  const msg = obj["message"];
31781
- if (!isObject9(msg)) continue;
31982
+ if (!isObject10(msg)) continue;
31782
31983
  const content = msg["content"];
31783
31984
  if (!Array.isArray(content)) continue;
31784
31985
  for (const blk of content) {
31785
- if (!isObject9(blk) || blk["type"] !== "tool_use") continue;
31786
- const name = str5(blk["name"]);
31986
+ if (!isObject10(blk) || blk["type"] !== "tool_use") continue;
31987
+ const name = str6(blk["name"]);
31787
31988
  const input = blk["input"];
31788
- const inputObj = isObject9(input) ? input : {};
31989
+ const inputObj = isObject10(input) ? input : {};
31789
31990
  if (DISPATCH_TOOL_RE.test(name)) {
31790
31991
  const label = [
31791
- str5(inputObj["description"]),
31792
- str5(inputObj["subagent_type"])
31992
+ str6(inputObj["description"]),
31993
+ str6(inputObj["subagent_type"])
31793
31994
  ].filter(Boolean).join(" ");
31794
31995
  if (REVIEW_SHAPED_LABEL_RE.test(label)) return true;
31795
- const prompt = str5(inputObj["prompt"]);
31996
+ const prompt = str6(inputObj["prompt"]);
31796
31997
  if (REVIEW_SHAPED_PROMPT_RE.test(prompt)) return true;
31797
31998
  continue;
31798
31999
  }
31799
32000
  if (/^skill$/i.test(name)) {
31800
- const skillName = str5(inputObj["skill"]) || str5(inputObj["name"]) || str5(inputObj["command"]);
32001
+ const skillName = str6(inputObj["skill"]) || str6(inputObj["name"]) || str6(inputObj["command"]);
31801
32002
  if (REVIEW_SKILL_NAME_RE.test(skillName)) return true;
31802
32003
  continue;
31803
32004
  }
@@ -31820,28 +32021,28 @@ function appendReviewSkippedTelemetry(workspaceRoot3, diffLines, mutationMeasure
31820
32021
  });
31821
32022
  if (errors.length || line === null) return;
31822
32023
  try {
31823
- const dir = path78.join(workspaceRoot3, "agents", "runtime", "state", "audit");
31824
- fs78.mkdirSync(dir, { recursive: true });
31825
- const file = path78.join(dir, `${ts.slice(0, 7)}.jsonl`);
31826
- fs78.appendFileSync(file, `${JSON.stringify(line)}
32024
+ const dir = path79.join(workspaceRoot3, "agents", "runtime", "state", "audit");
32025
+ fs79.mkdirSync(dir, { recursive: true });
32026
+ const file = path79.join(dir, `${ts.slice(0, 7)}.jsonl`);
32027
+ fs79.appendFileSync(file, `${JSON.stringify(line)}
31827
32028
  `, "utf8");
31828
32029
  } catch {
31829
32030
  }
31830
32031
  }
31831
32032
  function sessionStateDir(workspaceRoot3) {
31832
- return path78.join(workspaceRoot3, "agents", "runtime", "state", "end-review-nudge");
32033
+ return path79.join(workspaceRoot3, "agents", "runtime", "state", "end-review-nudge");
31833
32034
  }
31834
32035
  function sessionStateFile(workspaceRoot3, sessionKey) {
31835
- return path78.join(sessionStateDir(workspaceRoot3), `${sessionKey}.json`);
32036
+ return path79.join(sessionStateDir(workspaceRoot3), `${sessionKey}.json`);
31836
32037
  }
31837
32038
  function deriveSessionKey2(envelope, payload) {
31838
- const raw = str5(envelope["session_id"]) || str5(payload["transcript_path"] ?? payload["transcriptPath"]);
32039
+ const raw = str6(envelope["session_id"]) || str6(payload["transcript_path"] ?? payload["transcriptPath"]);
31839
32040
  const material = raw || "unknown-session";
31840
32041
  return crypto9.createHash("sha256").update(material).digest("hex");
31841
32042
  }
31842
32043
  function hasFiredThisSession(workspaceRoot3, sessionKey) {
31843
32044
  try {
31844
- return fs78.existsSync(sessionStateFile(workspaceRoot3, sessionKey));
32045
+ return fs79.existsSync(sessionStateFile(workspaceRoot3, sessionKey));
31845
32046
  } catch {
31846
32047
  return false;
31847
32048
  }
@@ -31855,7 +32056,7 @@ function markFiredThisSession(workspaceRoot3, sessionKey, ts) {
31855
32056
  function _read_stdin3() {
31856
32057
  return readHookStdin();
31857
32058
  }
31858
- function main49() {
32059
+ function main50() {
31859
32060
  const [envelope, payload] = unwrap(_read_stdin3(), "claude");
31860
32061
  const event = String(envelope["event"] ?? "");
31861
32062
  if (event !== "" && event !== "stop") {
@@ -31878,13 +32079,13 @@ function main49() {
31878
32079
  if (hasFiredThisSession(workspace_root, sessionKey)) {
31879
32080
  return 0;
31880
32081
  }
31881
- const transcriptPath = str5(
32082
+ const transcriptPath = str6(
31882
32083
  payload["transcript_path"] ?? payload["transcriptPath"]
31883
32084
  ).trim();
31884
32085
  let reviewerRan = false;
31885
32086
  if (transcriptPath && isSafeTranscriptPath(transcriptPath)) {
31886
32087
  try {
31887
- reviewerRan = scanTranscriptForReviewer(fs78.readFileSync(transcriptPath, "utf-8"));
32088
+ reviewerRan = scanTranscriptForReviewer(fs79.readFileSync(transcriptPath, "utf-8"));
31888
32089
  } catch {
31889
32090
  reviewerRan = false;
31890
32091
  }
@@ -31914,32 +32115,32 @@ function _isCliEntry38() {
31914
32115
  if (process.argv[1] === void 0) {
31915
32116
  return false;
31916
32117
  }
31917
- const argvUrl = pathToFileURL44(path78.resolve(process.argv[1])).href;
32118
+ const argvUrl = pathToFileURL45(path79.resolve(process.argv[1])).href;
31918
32119
  if (import.meta.url === argvUrl) {
31919
32120
  return true;
31920
32121
  }
31921
32122
  try {
31922
- const here = fs78.realpathSync(fileURLToPath50(import.meta.url));
31923
- const argv = fs78.realpathSync(path78.resolve(process.argv[1]));
32123
+ const here = fs79.realpathSync(fileURLToPath51(import.meta.url));
32124
+ const argv = fs79.realpathSync(path79.resolve(process.argv[1]));
31924
32125
  return here === argv;
31925
32126
  } catch {
31926
32127
  return false;
31927
32128
  }
31928
32129
  }
31929
32130
  if (_isCliEntry38()) {
31930
- process.exit(main49());
32131
+ process.exit(main50());
31931
32132
  }
31932
32133
 
31933
32134
  // src/scripts/hooks/turn_end_gate_hook.ts
31934
- import * as fs80 from "node:fs";
31935
- import * as path80 from "node:path";
31936
- import { fileURLToPath as fileURLToPath52, pathToFileURL as pathToFileURL46 } from "node:url";
32135
+ import * as fs81 from "node:fs";
32136
+ import * as path81 from "node:path";
32137
+ import { fileURLToPath as fileURLToPath53, pathToFileURL as pathToFileURL47 } from "node:url";
31937
32138
 
31938
32139
  // src/scripts/hooks/subagent_ledger_hook.ts
31939
32140
  import * as crypto10 from "node:crypto";
31940
- import * as fs79 from "node:fs";
31941
- import * as path79 from "node:path";
31942
- import { fileURLToPath as fileURLToPath51, pathToFileURL as pathToFileURL45 } from "node:url";
32141
+ import * as fs80 from "node:fs";
32142
+ import * as path80 from "node:path";
32143
+ import { fileURLToPath as fileURLToPath52, pathToFileURL as pathToFileURL46 } from "node:url";
31943
32144
 
31944
32145
  // src/scripts/_lib/subagent_response.ts
31945
32146
  var MAX_SUMMARY_CHARS = 2e3;
@@ -32041,11 +32242,11 @@ function validateResponse(input) {
32041
32242
  }
32042
32243
 
32043
32244
  // src/scripts/hooks/subagent_ledger_hook.ts
32044
- var EXIT_ALLOW24 = 0;
32045
- function isObject10(v) {
32245
+ var EXIT_ALLOW25 = 0;
32246
+ function isObject11(v) {
32046
32247
  return typeof v === "object" && v !== null && !Array.isArray(v);
32047
32248
  }
32048
- var LEDGER_DIR = path79.join("agents", "runtime", "state", "subagent-ledger");
32249
+ var LEDGER_DIR = path80.join("agents", "runtime", "state", "subagent-ledger");
32049
32250
  var OPEN_SUBDIR = "open";
32050
32251
  var OPEN_RECORD_TTL_MS = 24 * 60 * 60 * 1e3;
32051
32252
  function refFor(agentId) {
@@ -32053,9 +32254,9 @@ function refFor(agentId) {
32053
32254
  }
32054
32255
  function unwrapPayload3(envelope) {
32055
32256
  const inner = envelope["payload"];
32056
- return isObject10(inner) ? inner : envelope;
32257
+ return isObject11(inner) ? inner : envelope;
32057
32258
  }
32058
- function str6(payload, ...keys) {
32259
+ function str7(payload, ...keys) {
32059
32260
  for (const k of keys) {
32060
32261
  const v = payload[k];
32061
32262
  if (typeof v === "string" && v) return v;
@@ -32063,11 +32264,11 @@ function str6(payload, ...keys) {
32063
32264
  return null;
32064
32265
  }
32065
32266
  function extractParentId(payload, ownId) {
32066
- const explicit = str6(payload, "parent_agent_id", "parentAgentId");
32267
+ const explicit = str7(payload, "parent_agent_id", "parentAgentId");
32067
32268
  if (explicit) return explicit;
32068
32269
  const session = payload["session"];
32069
- if (isObject10(session)) {
32070
- const sessionAgent = str6(session, "agent_id", "agentId");
32270
+ if (isObject11(session)) {
32271
+ const sessionAgent = str7(session, "agent_id", "agentId");
32071
32272
  if (sessionAgent && sessionAgent !== ownId) return sessionAgent;
32072
32273
  }
32073
32274
  return null;
@@ -32135,14 +32336,14 @@ function _jsonObjectCandidates(message) {
32135
32336
  return out;
32136
32337
  }
32137
32338
  function openDir(root) {
32138
- return path79.join(root, LEDGER_DIR, OPEN_SUBDIR);
32339
+ return path80.join(root, LEDGER_DIR, OPEN_SUBDIR);
32139
32340
  }
32140
32341
  function openFile(root, ref) {
32141
- return path79.join(openDir(root), `${ref}.json`);
32342
+ return path80.join(openDir(root), `${ref}.json`);
32142
32343
  }
32143
32344
  var DEPTH_BASES = /* @__PURE__ */ new Set(["observed", "asserted-parent", "assumed-root"]);
32144
32345
  function _asOpenRecord(value, expectedRef) {
32145
- if (!isObject10(value)) return null;
32346
+ if (!isObject11(value)) return null;
32146
32347
  const ref = value["ref"];
32147
32348
  if (typeof ref !== "string" || ref !== expectedRef) return null;
32148
32349
  if (typeof value["started_at"] !== "string") return null;
@@ -32165,7 +32366,7 @@ function readOpenRecords(root) {
32165
32366
  const out = /* @__PURE__ */ new Map();
32166
32367
  let names;
32167
32368
  try {
32168
- names = fs79.readdirSync(openDir(root));
32369
+ names = fs80.readdirSync(openDir(root));
32169
32370
  } catch {
32170
32371
  return out;
32171
32372
  }
@@ -32173,7 +32374,7 @@ function readOpenRecords(root) {
32173
32374
  if (!name.endsWith(".json")) continue;
32174
32375
  const expectedRef = name.slice(0, -".json".length);
32175
32376
  try {
32176
- const raw = fs79.readFileSync(path79.join(openDir(root), name), "utf8");
32377
+ const raw = fs80.readFileSync(path80.join(openDir(root), name), "utf8");
32177
32378
  const rec = _asOpenRecord(JSON.parse(raw), expectedRef);
32178
32379
  if (rec) out.set(rec.ref, rec);
32179
32380
  } catch {
@@ -32188,13 +32389,13 @@ function resolveDepth(parentRef, open) {
32188
32389
  return { depth: parent.depth + 1, depth_basis: "observed" };
32189
32390
  }
32190
32391
  function ledgerFileFor2(root, ts) {
32191
- return path79.join(root, LEDGER_DIR, `${ts.slice(0, 7)}.jsonl`);
32392
+ return path80.join(root, LEDGER_DIR, `${ts.slice(0, 7)}.jsonl`);
32192
32393
  }
32193
32394
  function appendLedgerLine(root, ts, line) {
32194
32395
  if (is_replay_mode()) return;
32195
32396
  const file = ledgerFileFor2(root, ts);
32196
- fs79.mkdirSync(path79.dirname(file), { recursive: true });
32197
- fs79.appendFileSync(file, `${JSON.stringify(line)}
32397
+ fs80.mkdirSync(path80.dirname(file), { recursive: true });
32398
+ fs80.appendFileSync(file, `${JSON.stringify(line)}
32198
32399
  `, "utf8");
32199
32400
  }
32200
32401
  var WALL_CLOCK_ARMS_MS = [
@@ -32208,7 +32409,7 @@ function armsExceeded(elapsedMs) {
32208
32409
  return WALL_CLOCK_ARMS_MS.filter((a) => elapsedMs >= a.ms).map((a) => a.label);
32209
32410
  }
32210
32411
  function openRecordStats(root, nowMs = Date.now()) {
32211
- const ledgerPresent = fs79.existsSync(path79.join(root, LEDGER_DIR));
32412
+ const ledgerPresent = fs80.existsSync(path80.join(root, LEDGER_DIR));
32212
32413
  const open = readOpenRecords(root);
32213
32414
  let maxDepth = 0;
32214
32415
  let counted = 0;
@@ -32236,13 +32437,13 @@ function writeOpenRecord(root, rec) {
32236
32437
  function removeOpenRecord(root, ref) {
32237
32438
  if (is_replay_mode()) return;
32238
32439
  try {
32239
- fs79.unlinkSync(openFile(root, ref));
32440
+ fs80.unlinkSync(openFile(root, ref));
32240
32441
  } catch {
32241
32442
  }
32242
32443
  }
32243
32444
  function countOpen(root) {
32244
32445
  try {
32245
- return fs79.readdirSync(openDir(root)).filter((n) => n.endsWith(".json")).length;
32446
+ return fs80.readdirSync(openDir(root)).filter((n) => n.endsWith(".json")).length;
32246
32447
  } catch {
32247
32448
  return 0;
32248
32449
  }
@@ -32283,12 +32484,12 @@ function appendUnidentified(root, event, nowIso, payload) {
32283
32484
  unidentified: true,
32284
32485
  // The agent TYPE is an id-shaped enum and may still be present; it is
32285
32486
  // the only thing salvageable from a payload with no id.
32286
- agent_type: str6(payload, "agent_type", "agentType", "subagent_type", "subagentType"),
32487
+ agent_type: str7(payload, "agent_type", "agentType", "subagent_type", "subagentType"),
32287
32488
  reason: "payload carried no agent id \u2014 nothing to correlate start with stop"
32288
32489
  });
32289
32490
  }
32290
32491
  function handleStart(root, payload, nowIso, sessionId2) {
32291
- const agentId = str6(payload, "agent_id", "agentId");
32492
+ const agentId = str7(payload, "agent_id", "agentId");
32292
32493
  if (agentId === null) {
32293
32494
  appendUnidentified(root, "subagent_start", nowIso, payload);
32294
32495
  return;
@@ -32299,7 +32500,7 @@ function handleStart(root, payload, nowIso, sessionId2) {
32299
32500
  const { depth, depth_basis } = resolveDepth(parentRef, readOpenRecords(root));
32300
32501
  const rec = {
32301
32502
  ref,
32302
- agent_type: str6(payload, "agent_type", "agentType", "subagent_type", "subagentType"),
32503
+ agent_type: str7(payload, "agent_type", "agentType", "subagent_type", "subagentType"),
32303
32504
  started_at: nowIso,
32304
32505
  parent_ref: parentRef,
32305
32506
  depth,
@@ -32326,7 +32527,7 @@ function handleStart(root, payload, nowIso, sessionId2) {
32326
32527
  });
32327
32528
  }
32328
32529
  function handleStop(root, payload, nowIso, sessionId2) {
32329
- const agentId = str6(payload, "agent_id", "agentId");
32530
+ const agentId = str7(payload, "agent_id", "agentId");
32330
32531
  if (agentId === null) {
32331
32532
  appendUnidentified(root, "subagent_stop", nowIso, payload);
32332
32533
  return;
@@ -32338,7 +32539,7 @@ function handleStop(root, payload, nowIso, sessionId2) {
32338
32539
  const started = Date.parse(rec.started_at);
32339
32540
  if (Number.isFinite(started)) durationMs = Math.max(0, Date.parse(nowIso) - started);
32340
32541
  }
32341
- const parse = classifyEnvelope(str6(payload, "last_assistant_message", "lastAssistantMessage"));
32542
+ const parse = classifyEnvelope(str7(payload, "last_assistant_message", "lastAssistantMessage"));
32342
32543
  removeOpenRecord(root, ref);
32343
32544
  appendLedgerLine(root, nowIso, {
32344
32545
  event: "subagent_stop",
@@ -32349,7 +32550,7 @@ function handleStop(root, payload, nowIso, sessionId2) {
32349
32550
  // relabel a cross-session stop as belonging to the dispatching session
32350
32551
  // and hide exactly the mismatch this field exists to expose.
32351
32552
  session_id: sessionId2,
32352
- agent_type: rec?.agent_type ?? str6(payload, "agent_type", "agentType", "subagent_type", "subagentType"),
32553
+ agent_type: rec?.agent_type ?? str7(payload, "agent_type", "agentType", "subagent_type", "subagentType"),
32353
32554
  depth: rec?.depth ?? null,
32354
32555
  depth_basis: rec?.depth_basis ?? null,
32355
32556
  // `null` = the matching start was never seen. That is a finding about
@@ -32369,37 +32570,37 @@ function handleStop(root, payload, nowIso, sessionId2) {
32369
32570
  }
32370
32571
  function processEnvelope3(envelope, consumerRoot) {
32371
32572
  try {
32372
- if (!isObject10(envelope)) return EXIT_ALLOW24;
32573
+ if (!isObject11(envelope)) return EXIT_ALLOW25;
32373
32574
  const event = envelope["event"];
32374
- if (event !== "subagent_start" && event !== "subagent_stop") return EXIT_ALLOW24;
32575
+ if (event !== "subagent_start" && event !== "subagent_stop") return EXIT_ALLOW25;
32375
32576
  const payload = unwrapPayload3(envelope);
32376
32577
  const nowIso = (/* @__PURE__ */ new Date()).toISOString();
32377
- const sessionId2 = str6(payload, "session_id", "sessionId") ?? str6(envelope, "session_id", "sessionId");
32578
+ const sessionId2 = str7(payload, "session_id", "sessionId") ?? str7(envelope, "session_id", "sessionId");
32378
32579
  reapStaleOpenRecords(consumerRoot, nowIso);
32379
32580
  if (event === "subagent_start") handleStart(consumerRoot, payload, nowIso, sessionId2);
32380
32581
  else handleStop(consumerRoot, payload, nowIso, sessionId2);
32381
32582
  } catch {
32382
- return EXIT_ALLOW24;
32583
+ return EXIT_ALLOW25;
32383
32584
  }
32384
- return EXIT_ALLOW24;
32585
+ return EXIT_ALLOW25;
32385
32586
  }
32386
32587
  function resolveConsumerRoot(envelope) {
32387
- if (isObject10(envelope)) {
32388
- const pr = str6(envelope, "workspace_root", "project_root");
32588
+ if (isObject11(envelope)) {
32589
+ const pr = str7(envelope, "workspace_root", "project_root");
32389
32590
  if (pr) return pr;
32390
32591
  const payload = unwrapPayload3(envelope);
32391
- const cwd = str6(payload, "cwd");
32592
+ const cwd = str7(payload, "cwd");
32392
32593
  if (cwd) return cwd;
32393
32594
  }
32394
32595
  return process.cwd();
32395
32596
  }
32396
- function main50() {
32597
+ function main51() {
32397
32598
  const raw = readHookStdin();
32398
32599
  let envelope = {};
32399
32600
  try {
32400
32601
  envelope = raw.trim() ? JSON.parse(raw) : {};
32401
32602
  } catch {
32402
- return EXIT_ALLOW24;
32603
+ return EXIT_ALLOW25;
32403
32604
  }
32404
32605
  return processEnvelope3(envelope, resolveConsumerRoot(envelope));
32405
32606
  }
@@ -32408,19 +32609,19 @@ function _isCliEntry39() {
32408
32609
  return false;
32409
32610
  }
32410
32611
  if (process.argv[1] === void 0) return false;
32411
- const argvUrl = pathToFileURL45(path79.resolve(process.argv[1])).href;
32612
+ const argvUrl = pathToFileURL46(path80.resolve(process.argv[1])).href;
32412
32613
  if (import.meta.url === argvUrl) return true;
32413
32614
  try {
32414
- return fs79.realpathSync(fileURLToPath51(import.meta.url)) === fs79.realpathSync(path79.resolve(process.argv[1]));
32615
+ return fs80.realpathSync(fileURLToPath52(import.meta.url)) === fs80.realpathSync(path80.resolve(process.argv[1]));
32415
32616
  } catch {
32416
32617
  return false;
32417
32618
  }
32418
32619
  }
32419
- if (_isCliEntry39()) process.exit(main50());
32620
+ if (_isCliEntry39()) process.exit(main51());
32420
32621
 
32421
32622
  // src/scripts/hooks/turn_end_gate_hook.ts
32422
32623
  var EXIT_BLOCK4 = 1;
32423
- var EXIT_ALLOW25 = 0;
32624
+ var EXIT_ALLOW26 = 0;
32424
32625
  var TRANSCRIPT_READ_MAX_BYTES = 8 * 1024 * 1024;
32425
32626
  function stripFencedBlocks(text) {
32426
32627
  const out = [];
@@ -32525,7 +32726,7 @@ function detectPromissory(reply) {
32525
32726
  function readCiSettled(workspaceRoot3, session_id) {
32526
32727
  if (!hasStableSessionId(session_id)) return { seen: false, settled: false };
32527
32728
  try {
32528
- const raw = fs80.readFileSync(path80.join(workspaceRoot3, statePathFor(session_id)), "utf-8");
32729
+ const raw = fs81.readFileSync(path81.join(workspaceRoot3, statePathFor(session_id)), "utf-8");
32529
32730
  const decoded = JSON.parse(raw);
32530
32731
  if (!owns_session_state(decoded, session_id)) return { seen: false, settled: false };
32531
32732
  if (typeof decoded === "object" && decoded !== null && !Array.isArray(decoded)) {
@@ -32561,8 +32762,8 @@ function detectCompletionClaim(reply, ci) {
32561
32762
  function readLanguagePin(workspaceRoot3, session_id) {
32562
32763
  if (!hasStableSessionId(session_id)) return "und";
32563
32764
  try {
32564
- const raw = fs80.readFileSync(
32565
- path80.join(workspaceRoot3, statePathFor2(session_id)),
32765
+ const raw = fs81.readFileSync(
32766
+ path81.join(workspaceRoot3, statePathFor2(session_id)),
32566
32767
  "utf-8"
32567
32768
  );
32568
32769
  const decoded = JSON.parse(raw);
@@ -32618,7 +32819,7 @@ function sessionStateFile2(workspaceRoot3, sessionKey) {
32618
32819
  }
32619
32820
  function alreadyRefusedTurn(workspaceRoot3, sessionKey, turnOrdinal) {
32620
32821
  try {
32621
- const raw = fs80.readFileSync(sessionStateFile2(workspaceRoot3, sessionKey), "utf-8");
32822
+ const raw = fs81.readFileSync(sessionStateFile2(workspaceRoot3, sessionKey), "utf-8");
32622
32823
  const decoded = JSON.parse(raw);
32623
32824
  if (typeof decoded === "object" && decoded !== null && !Array.isArray(decoded)) {
32624
32825
  return decoded["refused_turn"] === turnOrdinal;
@@ -32632,7 +32833,7 @@ function markRefusedTurn(workspaceRoot3, sessionKey, turnOrdinal, detectors) {
32632
32833
  const file = sessionStateFile2(workspaceRoot3, sessionKey);
32633
32834
  let prev = null;
32634
32835
  try {
32635
- prev = parseRecord(fs80.readFileSync(file, "utf-8"));
32836
+ prev = parseRecord(fs81.readFileSync(file, "utf-8"));
32636
32837
  } catch {
32637
32838
  }
32638
32839
  let version;
@@ -32659,10 +32860,10 @@ function readTranscriptTail(transcriptPath, opts = {}) {
32659
32860
  if (!transcriptPath || !isSafeTranscriptPath(transcriptPath, opts)) return empty;
32660
32861
  let lines;
32661
32862
  try {
32662
- if (opts.maxBytes !== void 0 && fs80.statSync(transcriptPath).size > opts.maxBytes) {
32863
+ if (opts.maxBytes !== void 0 && fs81.statSync(transcriptPath).size > opts.maxBytes) {
32663
32864
  return empty;
32664
32865
  }
32665
- lines = fs80.readFileSync(transcriptPath, "utf-8").split("\n");
32866
+ lines = fs81.readFileSync(transcriptPath, "utf-8").split("\n");
32666
32867
  } catch {
32667
32868
  return empty;
32668
32869
  }
@@ -32735,34 +32936,34 @@ function _messageText(content) {
32735
32936
  }
32736
32937
  return parts.length > 0 ? parts.join("\n") : null;
32737
32938
  }
32738
- function str7(v) {
32939
+ function str8(v) {
32739
32940
  return typeof v === "string" ? v : "";
32740
32941
  }
32741
- function main51() {
32942
+ function main52() {
32742
32943
  let envelope;
32743
32944
  let payload;
32744
32945
  try {
32745
32946
  [envelope, payload] = unwrap(readHookStdin(), "claude");
32746
32947
  } catch {
32747
- return EXIT_ALLOW25;
32948
+ return EXIT_ALLOW26;
32748
32949
  }
32749
- if (payload["stop_hook_active"] === true) return EXIT_ALLOW25;
32750
- const workspaceRoot3 = str7(envelope["workspace_root"]) || process.cwd();
32950
+ if (payload["stop_hook_active"] === true) return EXIT_ALLOW26;
32951
+ const workspaceRoot3 = str8(envelope["workspace_root"]) || process.cwd();
32751
32952
  let dispatchOpen = false;
32752
32953
  try {
32753
32954
  dispatchOpen = openRecordStats(workspaceRoot3).open_count > 0;
32754
32955
  } catch {
32755
32956
  }
32756
- const transcriptPath = str7(
32957
+ const transcriptPath = str8(
32757
32958
  payload["transcript_path"] ?? payload["transcriptPath"]
32758
32959
  );
32759
32960
  const { lastAssistant, turnOrdinal, toolCalls } = readTranscriptTail(transcriptPath, {
32760
32961
  maxBytes: TRANSCRIPT_READ_MAX_BYTES
32761
32962
  });
32762
- if (!lastAssistant) return EXIT_ALLOW25;
32763
- const rawSessionId = str7(envelope["session_id"]) || "";
32963
+ if (!lastAssistant) return EXIT_ALLOW26;
32964
+ const rawSessionId = str8(envelope["session_id"]) || "";
32764
32965
  const sessionKey = deriveSessionKey(rawSessionId || "unknown-session");
32765
- if (alreadyRefusedTurn(workspaceRoot3, sessionKey, turnOrdinal)) return EXIT_ALLOW25;
32966
+ if (alreadyRefusedTurn(workspaceRoot3, sessionKey, turnOrdinal)) return EXIT_ALLOW26;
32766
32967
  const findings = [];
32767
32968
  for (const f of [
32768
32969
  // A and D are the completion-adjacent pair a pending dispatch excuses
@@ -32785,7 +32986,7 @@ function main51() {
32785
32986
  ]) {
32786
32987
  if (f) findings.push(f);
32787
32988
  }
32788
- if (findings.length === 0) return EXIT_ALLOW25;
32989
+ if (findings.length === 0) return EXIT_ALLOW26;
32789
32990
  markRefusedTurn(
32790
32991
  workspaceRoot3,
32791
32992
  sessionKey,
@@ -32812,29 +33013,29 @@ function _isCliEntry40() {
32812
33013
  if (process.argv[1] === void 0) {
32813
33014
  return false;
32814
33015
  }
32815
- const argvUrl = pathToFileURL46(path80.resolve(process.argv[1])).href;
33016
+ const argvUrl = pathToFileURL47(path81.resolve(process.argv[1])).href;
32816
33017
  if (import.meta.url === argvUrl) {
32817
33018
  return true;
32818
33019
  }
32819
33020
  try {
32820
- const here = fs80.realpathSync(fileURLToPath52(import.meta.url));
32821
- const argv = fs80.realpathSync(path80.resolve(process.argv[1]));
33021
+ const here = fs81.realpathSync(fileURLToPath53(import.meta.url));
33022
+ const argv = fs81.realpathSync(path81.resolve(process.argv[1]));
32822
33023
  return here === argv;
32823
33024
  } catch {
32824
33025
  return false;
32825
33026
  }
32826
33027
  }
32827
33028
  if (_isCliEntry40()) {
32828
- process.exit(main51());
33029
+ process.exit(main52());
32829
33030
  }
32830
33031
 
32831
33032
  // src/scripts/hooks/edit_shape_hook.ts
32832
33033
  import { spawnSync as spawnSync7 } from "node:child_process";
32833
33034
  import * as crypto11 from "node:crypto";
32834
- import * as fs81 from "node:fs";
32835
- import * as path81 from "node:path";
32836
- import { fileURLToPath as fileURLToPath53, pathToFileURL as pathToFileURL47 } from "node:url";
32837
- var EXIT_ALLOW26 = 0;
33035
+ import * as fs82 from "node:fs";
33036
+ import * as path82 from "node:path";
33037
+ import { fileURLToPath as fileURLToPath54, pathToFileURL as pathToFileURL48 } from "node:url";
33038
+ var EXIT_ALLOW27 = 0;
32838
33039
  var EXIT_WARN14 = 2;
32839
33040
  var MIN_FILE_LINES = 50;
32840
33041
  var MAX_DIFF_RATIO = 0.2;
@@ -32850,10 +33051,10 @@ var EXEMPT_PATH_PATTERNS = [
32850
33051
  /(^|\/)agents\/runtime\//i
32851
33052
  // agents/runtime/**
32852
33053
  ];
32853
- function isObject11(v) {
33054
+ function isObject12(v) {
32854
33055
  return typeof v === "object" && v !== null && !Array.isArray(v);
32855
33056
  }
32856
- function str8(v) {
33057
+ function str9(v) {
32857
33058
  return typeof v === "string" ? v : "";
32858
33059
  }
32859
33060
  function isExemptPath(filePath) {
@@ -32886,7 +33087,7 @@ function effectiveDiffLines(cwd, relPath) {
32886
33087
  }
32887
33088
  function fileLineCount(absPath) {
32888
33089
  try {
32889
- const text = fs81.readFileSync(absPath, "utf8");
33090
+ const text = fs82.readFileSync(absPath, "utf8");
32890
33091
  if (text.length === 0) return 0;
32891
33092
  return text.split("\n").length - (text.endsWith("\n") ? 1 : 0);
32892
33093
  } catch {
@@ -32898,16 +33099,16 @@ function buildAdvisoryLine2(fileLines, diffLines) {
32898
33099
  return `this Write replaced ${fileLines} lines for an effective diff of ~${pct}% (${diffLines} changed lines) \u2014 a targeted Edit pays for the diff, not the file.`;
32899
33100
  }
32900
33101
  function deriveSessionKey3(envelope, payload) {
32901
- const raw = str8(envelope["session_id"]) || str8(payload["session_id"] ?? payload["sessionId"]);
33102
+ const raw = str9(envelope["session_id"]) || str9(payload["session_id"] ?? payload["sessionId"]);
32902
33103
  const material = raw || "unknown-session";
32903
33104
  return crypto11.createHash("sha256").update(material).digest("hex");
32904
33105
  }
32905
33106
  function sessionStateFile3(workspaceRoot3, sessionKey) {
32906
- return path81.join(workspaceRoot3, "agents", "runtime", "state", "edit-shape", `${sessionKey}.json`);
33107
+ return path82.join(workspaceRoot3, "agents", "runtime", "state", "edit-shape", `${sessionKey}.json`);
32907
33108
  }
32908
33109
  function hasFiredThisSession2(workspaceRoot3, sessionKey) {
32909
33110
  try {
32910
- return fs81.existsSync(sessionStateFile3(workspaceRoot3, sessionKey));
33111
+ return fs82.existsSync(sessionStateFile3(workspaceRoot3, sessionKey));
32911
33112
  } catch {
32912
33113
  return false;
32913
33114
  }
@@ -32921,33 +33122,33 @@ function markFiredThisSession2(workspaceRoot3, sessionKey) {
32921
33122
  }
32922
33123
  }
32923
33124
  function extractToolName3(payload) {
32924
- return str8(payload["tool_name"] ?? payload["toolName"] ?? payload["tool"]);
33125
+ return str9(payload["tool_name"] ?? payload["toolName"] ?? payload["tool"]);
32925
33126
  }
32926
33127
  function extractFilePath2(payload) {
32927
33128
  const ti = payload["tool_input"] ?? payload["toolInput"] ?? payload["input"];
32928
- if (!isObject11(ti)) return "";
32929
- return str8(ti["file_path"] ?? ti["path"] ?? ti["filePath"]);
33129
+ if (!isObject12(ti)) return "";
33130
+ return str9(ti["file_path"] ?? ti["path"] ?? ti["filePath"]);
32930
33131
  }
32931
- function main52() {
33132
+ function main53() {
32932
33133
  try {
32933
33134
  const [envelope, payload] = unwrap(readHookStdin(), "claude");
32934
- const event = str8(envelope["event"]);
32935
- if (event !== "" && event !== "post_tool_use") return EXIT_ALLOW26;
33135
+ const event = str9(envelope["event"]);
33136
+ if (event !== "" && event !== "post_tool_use") return EXIT_ALLOW27;
32936
33137
  const toolName = extractToolName3(payload);
32937
- if (toolName !== "Write") return EXIT_ALLOW26;
33138
+ if (toolName !== "Write") return EXIT_ALLOW27;
32938
33139
  const filePath = extractFilePath2(payload);
32939
- if (!filePath) return EXIT_ALLOW26;
32940
- const workspaceRoot3 = str8(envelope["workspace_root"]).trim() || process.cwd();
32941
- const absPath = path81.isAbsolute(filePath) ? filePath : path81.resolve(workspaceRoot3, filePath);
32942
- const relPath = path81.relative(workspaceRoot3, absPath);
32943
- if (isExemptPath(relPath) || isExemptPath(absPath)) return EXIT_ALLOW26;
33140
+ if (!filePath) return EXIT_ALLOW27;
33141
+ const workspaceRoot3 = str9(envelope["workspace_root"]).trim() || process.cwd();
33142
+ const absPath = path82.isAbsolute(filePath) ? filePath : path82.resolve(workspaceRoot3, filePath);
33143
+ const relPath = path82.relative(workspaceRoot3, absPath);
33144
+ if (isExemptPath(relPath) || isExemptPath(absPath)) return EXIT_ALLOW27;
32944
33145
  const fileLines = fileLineCount(absPath);
32945
- if (fileLines < MIN_FILE_LINES) return EXIT_ALLOW26;
33146
+ if (fileLines < MIN_FILE_LINES) return EXIT_ALLOW27;
32946
33147
  const diffLines = effectiveDiffLines(workspaceRoot3, relPath.startsWith("..") ? absPath : relPath);
32947
- if (diffLines === 0) return EXIT_ALLOW26;
32948
- if (diffLines / fileLines > MAX_DIFF_RATIO) return EXIT_ALLOW26;
33148
+ if (diffLines === 0) return EXIT_ALLOW27;
33149
+ if (diffLines / fileLines > MAX_DIFF_RATIO) return EXIT_ALLOW27;
32949
33150
  const sessionKey = deriveSessionKey3(envelope, payload);
32950
- if (hasFiredThisSession2(workspaceRoot3, sessionKey)) return EXIT_ALLOW26;
33151
+ if (hasFiredThisSession2(workspaceRoot3, sessionKey)) return EXIT_ALLOW27;
32951
33152
  markFiredThisSession2(workspaceRoot3, sessionKey);
32952
33153
  process.stdout.write(
32953
33154
  `${JSON.stringify({
@@ -32959,7 +33160,7 @@ function main52() {
32959
33160
  );
32960
33161
  return EXIT_WARN14;
32961
33162
  } catch {
32962
- return EXIT_ALLOW26;
33163
+ return EXIT_ALLOW27;
32963
33164
  }
32964
33165
  }
32965
33166
  function _isCliEntry41() {
@@ -32969,28 +33170,28 @@ function _isCliEntry41() {
32969
33170
  if (process.argv[1] === void 0) {
32970
33171
  return false;
32971
33172
  }
32972
- const argvUrl = pathToFileURL47(path81.resolve(process.argv[1])).href;
33173
+ const argvUrl = pathToFileURL48(path82.resolve(process.argv[1])).href;
32973
33174
  if (import.meta.url === argvUrl) {
32974
33175
  return true;
32975
33176
  }
32976
33177
  try {
32977
- const here = fs81.realpathSync(fileURLToPath53(import.meta.url));
32978
- const argv = fs81.realpathSync(path81.resolve(process.argv[1]));
33178
+ const here = fs82.realpathSync(fileURLToPath54(import.meta.url));
33179
+ const argv = fs82.realpathSync(path82.resolve(process.argv[1]));
32979
33180
  return here === argv;
32980
33181
  } catch {
32981
33182
  return false;
32982
33183
  }
32983
33184
  }
32984
33185
  if (_isCliEntry41()) {
32985
- process.exit(main52());
33186
+ process.exit(main53());
32986
33187
  }
32987
33188
 
32988
33189
  // src/scripts/hooks/reread_guard_hook.ts
32989
33190
  import * as crypto12 from "node:crypto";
32990
- import * as fs82 from "node:fs";
32991
- import * as path82 from "node:path";
32992
- import { fileURLToPath as fileURLToPath54, pathToFileURL as pathToFileURL48 } from "node:url";
32993
- var EXIT_ALLOW27 = 0;
33191
+ import * as fs83 from "node:fs";
33192
+ import * as path83 from "node:path";
33193
+ import { fileURLToPath as fileURLToPath55, pathToFileURL as pathToFileURL49 } from "node:url";
33194
+ var EXIT_ALLOW28 = 0;
32994
33195
  var EXIT_WARN15 = 2;
32995
33196
  var EXEMPT_PATH_PATTERNS2 = [
32996
33197
  /(^|\/)dist\//i,
@@ -33006,10 +33207,10 @@ var EXEMPT_PATH_PATTERNS2 = [
33006
33207
  ];
33007
33208
  var READ_TOOLS = /* @__PURE__ */ new Set(["Read"]);
33008
33209
  var WRITE_TOOLS2 = /* @__PURE__ */ new Set(["Edit", "Write"]);
33009
- function isObject12(v) {
33210
+ function isObject13(v) {
33010
33211
  return typeof v === "object" && v !== null && !Array.isArray(v);
33011
33212
  }
33012
- function str9(v) {
33213
+ function str10(v) {
33013
33214
  return typeof v === "string" ? v : "";
33014
33215
  }
33015
33216
  function isExemptPath2(filePath) {
@@ -33020,21 +33221,21 @@ function emptyLedger() {
33020
33221
  return { reads: {}, writes: {}, fired: {} };
33021
33222
  }
33022
33223
  function deriveSessionKey4(envelope, payload) {
33023
- const raw = str9(envelope["session_id"]) || str9(payload["session_id"] ?? payload["sessionId"]);
33224
+ const raw = str10(envelope["session_id"]) || str10(payload["session_id"] ?? payload["sessionId"]);
33024
33225
  const material = raw || "unknown-session";
33025
33226
  return crypto12.createHash("sha256").update(material).digest("hex");
33026
33227
  }
33027
33228
  function ledgerFile(workspaceRoot3, sessionKey) {
33028
- return path82.join(workspaceRoot3, "agents", "runtime", "state", "reread-guard", `${sessionKey}.json`);
33229
+ return path83.join(workspaceRoot3, "agents", "runtime", "state", "reread-guard", `${sessionKey}.json`);
33029
33230
  }
33030
33231
  function readLedger(workspaceRoot3, sessionKey) {
33031
33232
  try {
33032
- const parsed = JSON.parse(fs82.readFileSync(ledgerFile(workspaceRoot3, sessionKey), "utf8"));
33033
- if (!isObject12(parsed)) return emptyLedger();
33233
+ const parsed = JSON.parse(fs83.readFileSync(ledgerFile(workspaceRoot3, sessionKey), "utf8"));
33234
+ if (!isObject13(parsed)) return emptyLedger();
33034
33235
  return {
33035
- reads: isObject12(parsed["reads"]) ? parsed["reads"] : {},
33036
- writes: isObject12(parsed["writes"]) ? parsed["writes"] : {},
33037
- fired: isObject12(parsed["fired"]) ? parsed["fired"] : {}
33236
+ reads: isObject13(parsed["reads"]) ? parsed["reads"] : {},
33237
+ writes: isObject13(parsed["writes"]) ? parsed["writes"] : {},
33238
+ fired: isObject13(parsed["fired"]) ? parsed["fired"] : {}
33038
33239
  };
33039
33240
  } catch {
33040
33241
  return emptyLedger();
@@ -33047,14 +33248,14 @@ function writeLedger(workspaceRoot3, sessionKey, ledger) {
33047
33248
  }
33048
33249
  }
33049
33250
  function extractToolName4(payload) {
33050
- return str9(payload["tool_name"] ?? payload["toolName"] ?? payload["tool"]);
33251
+ return str10(payload["tool_name"] ?? payload["toolName"] ?? payload["tool"]);
33051
33252
  }
33052
33253
  function extractToolInput2(payload) {
33053
33254
  const ti = payload["tool_input"] ?? payload["toolInput"] ?? payload["input"];
33054
- return isObject12(ti) ? ti : {};
33255
+ return isObject13(ti) ? ti : {};
33055
33256
  }
33056
33257
  function extractFilePath3(toolInput) {
33057
- return str9(toolInput["file_path"] ?? toolInput["path"] ?? toolInput["filePath"]);
33258
+ return str10(toolInput["file_path"] ?? toolInput["path"] ?? toolInput["filePath"]);
33058
33259
  }
33059
33260
  function isRangedRead(toolInput) {
33060
33261
  for (const key of ["offset", "limit", "start_line", "end_line", "startLine", "endLine"]) {
@@ -33070,41 +33271,41 @@ function buildDuplicateReadLine(relPath, earlierTs) {
33070
33271
  function buildPostEditReadLine(relPath) {
33071
33272
  return `re-read guard: this session just edited ${relPath} \u2014 a full-file re-read re-pays for content you already have; a ranged Read (offset/limit) over the edited hunk is enough to verify the change.`;
33072
33273
  }
33073
- function main53() {
33274
+ function main54() {
33074
33275
  try {
33075
33276
  const [envelope, payload] = unwrap(readHookStdin(), "claude");
33076
- const event = str9(envelope["event"]);
33077
- if (event !== "" && event !== "pre_tool_use") return EXIT_ALLOW27;
33277
+ const event = str10(envelope["event"]);
33278
+ if (event !== "" && event !== "pre_tool_use") return EXIT_ALLOW28;
33078
33279
  const toolName = extractToolName4(payload);
33079
33280
  const isRead = READ_TOOLS.has(toolName);
33080
33281
  const isWrite = WRITE_TOOLS2.has(toolName);
33081
- if (!isRead && !isWrite) return EXIT_ALLOW27;
33282
+ if (!isRead && !isWrite) return EXIT_ALLOW28;
33082
33283
  const toolInput = extractToolInput2(payload);
33083
33284
  const filePath = extractFilePath3(toolInput);
33084
- if (!filePath) return EXIT_ALLOW27;
33085
- const workspaceRoot3 = str9(envelope["workspace_root"]).trim() || process.cwd();
33086
- const absPath = path82.isAbsolute(filePath) ? filePath : path82.resolve(workspaceRoot3, filePath);
33087
- const relPath = path82.relative(workspaceRoot3, absPath);
33088
- if (isExemptPath2(relPath) || isExemptPath2(absPath)) return EXIT_ALLOW27;
33285
+ if (!filePath) return EXIT_ALLOW28;
33286
+ const workspaceRoot3 = str10(envelope["workspace_root"]).trim() || process.cwd();
33287
+ const absPath = path83.isAbsolute(filePath) ? filePath : path83.resolve(workspaceRoot3, filePath);
33288
+ const relPath = path83.relative(workspaceRoot3, absPath);
33289
+ if (isExemptPath2(relPath) || isExemptPath2(absPath)) return EXIT_ALLOW28;
33089
33290
  const sessionKey = deriveSessionKey4(envelope, payload);
33090
33291
  const ledger = readLedger(workspaceRoot3, sessionKey);
33091
33292
  const key = relPath.startsWith("..") ? absPath : relPath;
33092
33293
  if (isWrite) {
33093
33294
  ledger.writes[key] = Date.now();
33094
33295
  writeLedger(workspaceRoot3, sessionKey, ledger);
33095
- return EXIT_ALLOW27;
33296
+ return EXIT_ALLOW28;
33096
33297
  }
33097
33298
  if (isRangedRead(toolInput)) {
33098
- return EXIT_ALLOW27;
33299
+ return EXIT_ALLOW28;
33099
33300
  }
33100
33301
  let mtime;
33101
33302
  let size;
33102
33303
  try {
33103
- const st = fs82.statSync(absPath);
33304
+ const st = fs83.statSync(absPath);
33104
33305
  mtime = st.mtimeMs;
33105
33306
  size = st.size;
33106
33307
  } catch {
33107
- return EXIT_ALLOW27;
33308
+ return EXIT_ALLOW28;
33108
33309
  }
33109
33310
  const prior = ledger.reads[key];
33110
33311
  const ownWrite = ledger.writes[key];
@@ -33119,7 +33320,7 @@ function main53() {
33119
33320
  if (ownWrite !== void 0) delete ledger.writes[key];
33120
33321
  if (advisory !== null) ledger.fired[key] = true;
33121
33322
  writeLedger(workspaceRoot3, sessionKey, ledger);
33122
- if (advisory === null) return EXIT_ALLOW27;
33323
+ if (advisory === null) return EXIT_ALLOW28;
33123
33324
  process.stdout.write(
33124
33325
  `${JSON.stringify({
33125
33326
  decision: "warn",
@@ -33130,7 +33331,7 @@ function main53() {
33130
33331
  );
33131
33332
  return EXIT_WARN15;
33132
33333
  } catch {
33133
- return EXIT_ALLOW27;
33334
+ return EXIT_ALLOW28;
33134
33335
  }
33135
33336
  }
33136
33337
  function _isCliEntry42() {
@@ -33140,27 +33341,27 @@ function _isCliEntry42() {
33140
33341
  if (process.argv[1] === void 0) {
33141
33342
  return false;
33142
33343
  }
33143
- const argvUrl = pathToFileURL48(path82.resolve(process.argv[1])).href;
33344
+ const argvUrl = pathToFileURL49(path83.resolve(process.argv[1])).href;
33144
33345
  if (import.meta.url === argvUrl) {
33145
33346
  return true;
33146
33347
  }
33147
33348
  try {
33148
- const here = fs82.realpathSync(fileURLToPath54(import.meta.url));
33149
- const argv = fs82.realpathSync(path82.resolve(process.argv[1]));
33349
+ const here = fs83.realpathSync(fileURLToPath55(import.meta.url));
33350
+ const argv = fs83.realpathSync(path83.resolve(process.argv[1]));
33150
33351
  return here === argv;
33151
33352
  } catch {
33152
33353
  return false;
33153
33354
  }
33154
33355
  }
33155
33356
  if (_isCliEntry42()) {
33156
- process.exit(main53());
33357
+ process.exit(main54());
33157
33358
  }
33158
33359
 
33159
33360
  // src/scripts/hooks/session_eol_hook.ts
33160
- import * as fs85 from "node:fs";
33161
- import * as path86 from "node:path";
33361
+ import * as fs86 from "node:fs";
33362
+ import * as path87 from "node:path";
33162
33363
  import process12 from "node:process";
33163
- import { fileURLToPath as fileURLToPath55, pathToFileURL as pathToFileURL49 } from "node:url";
33364
+ import { fileURLToPath as fileURLToPath56, pathToFileURL as pathToFileURL50 } from "node:url";
33164
33365
 
33165
33366
  // src/config/recycle-threshold-budget.json
33166
33367
  var recycle_threshold_budget_default = {
@@ -33178,13 +33379,13 @@ var recycle_threshold_budget_default = {
33178
33379
 
33179
33380
  // src/scripts/_lib/session_eol.ts
33180
33381
  import * as crypto13 from "node:crypto";
33181
- import * as fs83 from "node:fs";
33182
- import * as path84 from "node:path";
33382
+ import * as fs84 from "node:fs";
33383
+ import * as path85 from "node:path";
33183
33384
 
33184
33385
  // src/scripts/_lib/cc_transcript.ts
33185
- import * as path83 from "node:path";
33386
+ import * as path84 from "node:path";
33186
33387
  import { homedir as homedir7 } from "node:os";
33187
- var DEFAULT_PROJECTS_ROOT = path83.join(homedir7(), ".claude", "projects");
33388
+ var DEFAULT_PROJECTS_ROOT = path84.join(homedir7(), ".claude", "projects");
33188
33389
  function billableInputTokens(u) {
33189
33390
  return u.input_tokens + u.cache_read_input_tokens + u.cache_creation_input_tokens;
33190
33391
  }
@@ -33293,17 +33494,17 @@ function scanEolSlice(text, prior) {
33293
33494
  return next;
33294
33495
  }
33295
33496
  function eolStateDir(workspaceRoot3) {
33296
- return path84.join(workspaceRoot3, "agents", "runtime", "state", "session-eol");
33497
+ return path85.join(workspaceRoot3, "agents", "runtime", "state", "session-eol");
33297
33498
  }
33298
33499
  function eolStateFile(workspaceRoot3, sessionKey) {
33299
- return path84.join(eolStateDir(workspaceRoot3), `${sessionKey}.json`);
33500
+ return path85.join(eolStateDir(workspaceRoot3), `${sessionKey}.json`);
33300
33501
  }
33301
33502
  function eolSessionKey(raw) {
33302
33503
  return crypto13.createHash("sha256").update(raw || "unknown-session").digest("hex");
33303
33504
  }
33304
33505
  function readNewCompleteLines(filePath, fromByte) {
33305
33506
  try {
33306
- const { size } = fs83.statSync(filePath);
33507
+ const { size } = fs84.statSync(filePath);
33307
33508
  if (size < fromByte) {
33308
33509
  return { text: "", nextOffset: 0, truncated: true };
33309
33510
  }
@@ -33312,11 +33513,11 @@ function readNewCompleteLines(filePath, fromByte) {
33312
33513
  }
33313
33514
  const length = size - fromByte;
33314
33515
  const buffer = Buffer.alloc(length);
33315
- const fd = fs83.openSync(filePath, "r");
33516
+ const fd = fs84.openSync(filePath, "r");
33316
33517
  try {
33317
- fs83.readSync(fd, buffer, 0, length, fromByte);
33518
+ fs84.readSync(fd, buffer, 0, length, fromByte);
33318
33519
  } finally {
33319
- fs83.closeSync(fd);
33520
+ fs84.closeSync(fd);
33320
33521
  }
33321
33522
  const lastNewline = buffer.lastIndexOf(10);
33322
33523
  if (lastNewline === -1) {
@@ -33333,8 +33534,8 @@ function readNewCompleteLines(filePath, fromByte) {
33333
33534
  }
33334
33535
 
33335
33536
  // src/scripts/_lib/run_checkpoint.ts
33336
- import * as fs84 from "node:fs";
33337
- import * as path85 from "node:path";
33537
+ import * as fs85 from "node:fs";
33538
+ import * as path86 from "node:path";
33338
33539
 
33339
33540
  // src/scripts/_lib/roadmap_checkboxes.ts
33340
33541
  var CHECKBOX_LINE = /^[ \t]*[-*][ \t]+\[([ xX~-])\][ \t]+(.*)$/;
@@ -33364,7 +33565,7 @@ function phaseLines(text) {
33364
33565
  }
33365
33566
 
33366
33567
  // src/scripts/_lib/run_checkpoint.ts
33367
- var CHECKPOINT_DIR_REL = path85.join("agents", "runtime", "state", "checkpoints");
33568
+ var CHECKPOINT_DIR_REL = path86.join("agents", "runtime", "state", "checkpoints");
33368
33569
  function countRoadmap(text) {
33369
33570
  const counts = { open: 0, done: 0, parked: 0, next: null };
33370
33571
  for (const raw of phaseLines(text)) {
@@ -33385,34 +33586,34 @@ function countRoadmap(text) {
33385
33586
  return counts;
33386
33587
  }
33387
33588
  function checkpointFile(repoRoot, runId) {
33388
- return path85.join(repoRoot, CHECKPOINT_DIR_REL, `${runId.replace(/[^A-Za-z0-9_-]/g, "_")}.json`);
33589
+ return path86.join(repoRoot, CHECKPOINT_DIR_REL, `${runId.replace(/[^A-Za-z0-9_-]/g, "_")}.json`);
33389
33590
  }
33390
33591
  function roadmapPath(repoRoot, slug) {
33391
- return path85.join(repoRoot, "agents", "roadmaps", `${slug}.md`);
33592
+ return path86.join(repoRoot, "agents", "roadmaps", `${slug}.md`);
33392
33593
  }
33393
33594
  function readHead(repoRoot) {
33394
33595
  try {
33395
- let gitDir = path85.join(repoRoot, ".git");
33396
- if (fs84.statSync(gitDir).isFile()) {
33397
- const m = /^gitdir:\s*(.+)$/m.exec(fs84.readFileSync(gitDir, "utf-8").trim());
33596
+ let gitDir = path86.join(repoRoot, ".git");
33597
+ if (fs85.statSync(gitDir).isFile()) {
33598
+ const m = /^gitdir:\s*(.+)$/m.exec(fs85.readFileSync(gitDir, "utf-8").trim());
33398
33599
  if (m === null) return null;
33399
- gitDir = path85.resolve(repoRoot, m[1]);
33600
+ gitDir = path86.resolve(repoRoot, m[1]);
33400
33601
  }
33401
33602
  let refRoot = gitDir;
33402
33603
  try {
33403
- const common = fs84.readFileSync(path85.join(gitDir, "commondir"), "utf-8").trim();
33404
- if (common !== "") refRoot = path85.resolve(gitDir, common);
33604
+ const common = fs85.readFileSync(path86.join(gitDir, "commondir"), "utf-8").trim();
33605
+ if (common !== "") refRoot = path86.resolve(gitDir, common);
33405
33606
  } catch {
33406
33607
  }
33407
- const head = fs84.readFileSync(path85.join(gitDir, "HEAD"), "utf-8").trim();
33608
+ const head = fs85.readFileSync(path86.join(gitDir, "HEAD"), "utf-8").trim();
33408
33609
  if (/^[0-9a-f]{40}$/.test(head)) return head;
33409
33610
  const ref = /^ref:\s*(.+)$/.exec(head);
33410
33611
  if (ref === null) return null;
33411
33612
  const refName = ref[1];
33412
33613
  try {
33413
- return fs84.readFileSync(path85.join(refRoot, refName), "utf-8").trim() || null;
33614
+ return fs85.readFileSync(path86.join(refRoot, refName), "utf-8").trim() || null;
33414
33615
  } catch {
33415
- const packed = fs84.readFileSync(path85.join(refRoot, "packed-refs"), "utf-8");
33616
+ const packed = fs85.readFileSync(path86.join(refRoot, "packed-refs"), "utf-8");
33416
33617
  for (const line of packed.split("\n")) {
33417
33618
  const pm = /^([0-9a-f]{40})\s+(.+)$/.exec(line.trim());
33418
33619
  if (pm !== null && pm[2] === refName) return pm[1];
@@ -33426,7 +33627,7 @@ function readHead(repoRoot) {
33426
33627
  function buildCheckpoint(repoRoot, runId, slug, opts = {}) {
33427
33628
  let text;
33428
33629
  try {
33429
- text = fs84.readFileSync(roadmapPath(repoRoot, slug), "utf-8");
33630
+ text = fs85.readFileSync(roadmapPath(repoRoot, slug), "utf-8");
33430
33631
  } catch {
33431
33632
  return null;
33432
33633
  }
@@ -33450,8 +33651,8 @@ function buildCheckpoint(repoRoot, runId, slug, opts = {}) {
33450
33651
  function writeCheckpoint(repoRoot, cp) {
33451
33652
  const file = checkpointFile(repoRoot, cp.run_id);
33452
33653
  try {
33453
- fs84.mkdirSync(path85.dirname(file), { recursive: true });
33454
- fs84.writeFileSync(file, `${JSON.stringify(cp, null, 2)}
33654
+ fs85.mkdirSync(path86.dirname(file), { recursive: true });
33655
+ fs85.writeFileSync(file, `${JSON.stringify(cp, null, 2)}
33455
33656
  `, "utf-8");
33456
33657
  return file;
33457
33658
  } catch {
@@ -33462,22 +33663,22 @@ function writeCheckpoint(repoRoot, cp) {
33462
33663
  // src/scripts/hooks/session_eol_hook.ts
33463
33664
  var EXIT_WARN16 = 2;
33464
33665
  var THRESHOLD_OVERRIDE_ENV = "AGENT_RECYCLE_THRESHOLD_TOKENS";
33465
- var CONTEXT_FILL_REL = path86.join("agents", "runtime", "state", "context-fill.json");
33466
- function str10(value) {
33666
+ var CONTEXT_FILL_REL = path87.join("agents", "runtime", "state", "context-fill.json");
33667
+ function str11(value) {
33467
33668
  return typeof value === "string" ? value : "";
33468
33669
  }
33469
33670
  var stateFile3 = eolStateFile;
33470
33671
  function deriveSessionKey5(envelope, payload) {
33471
33672
  return eolSessionKey(
33472
- str10(envelope["session_id"]) || str10(payload["transcript_path"] ?? payload["transcriptPath"])
33673
+ str11(envelope["session_id"]) || str11(payload["transcript_path"] ?? payload["transcriptPath"])
33473
33674
  );
33474
33675
  }
33475
33676
  function payloadSessionId(payload, envelope) {
33476
- return (str10(payload["session_id"]) || str10(envelope["session_id"])).trim();
33677
+ return (str11(payload["session_id"]) || str11(envelope["session_id"])).trim();
33477
33678
  }
33478
33679
  function readState4(file) {
33479
33680
  try {
33480
- const parsed = JSON.parse(fs85.readFileSync(file, "utf-8"));
33681
+ const parsed = JSON.parse(fs86.readFileSync(file, "utf-8"));
33481
33682
  if (parsed && typeof parsed === "object" && parsed.schema_version === 1 && parsed.counters && typeof parsed.counters.scanned_bytes === "number") {
33482
33683
  return {
33483
33684
  schema_version: 1,
@@ -33498,10 +33699,10 @@ function readState4(file) {
33498
33699
  };
33499
33700
  }
33500
33701
  function envelopeExists(workspaceRoot3, since = null) {
33501
- const target = path86.join(workspaceRoot3, RECYCLE_ENVELOPE_REL);
33702
+ const target = path87.join(workspaceRoot3, RECYCLE_ENVELOPE_REL);
33502
33703
  let raw;
33503
33704
  try {
33504
- raw = fs85.readFileSync(target, "utf-8");
33705
+ raw = fs86.readFileSync(target, "utf-8");
33505
33706
  } catch (exc) {
33506
33707
  return exc?.code !== "ENOENT";
33507
33708
  }
@@ -33515,7 +33716,7 @@ function envelopeExists(workspaceRoot3, since = null) {
33515
33716
  }
33516
33717
  }
33517
33718
  function buildMissingEnvelopeLine(workspaceRoot3) {
33518
- return `recycle advised earlier, but no envelope exists at ${path86.join(workspaceRoot3, RECYCLE_ENVELOPE_REL)} \u2014 /clear now starts the successor from nothing. Re-run \`agent-config session:recycle\` and check that it prints the absolute path it wrote before clearing.`;
33719
+ return `recycle advised earlier, but no envelope exists at ${path87.join(workspaceRoot3, RECYCLE_ENVELOPE_REL)} \u2014 /clear now starts the successor from nothing. Re-run \`agent-config session:recycle\` and check that it prints the absolute path it wrote before clearing.`;
33519
33720
  }
33520
33721
  function readThresholdTokens() {
33521
33722
  const override = process12.env[THRESHOLD_OVERRIDE_ENV];
@@ -33531,7 +33732,7 @@ function buildAdvisoryLine3(tokens, threshold) {
33531
33732
  }
33532
33733
  function writeContextFill(workspaceRoot3, tokens, threshold, ts) {
33533
33734
  try {
33534
- atomic_write_json(path86.join(workspaceRoot3, CONTEXT_FILL_REL), {
33735
+ atomic_write_json(path87.join(workspaceRoot3, CONTEXT_FILL_REL), {
33535
33736
  schema_version: 1,
33536
33737
  final_context_tokens: tokens,
33537
33738
  recycle_threshold_tokens: threshold,
@@ -33541,7 +33742,7 @@ function writeContextFill(workspaceRoot3, tokens, threshold, ts) {
33541
33742
  } catch {
33542
33743
  }
33543
33744
  }
33544
- function main54() {
33745
+ function main55() {
33545
33746
  const [envelope, payload] = unwrap(readHookStdin(), "claude");
33546
33747
  const event = String(envelope["event"] ?? "");
33547
33748
  if (event !== "" && event !== "stop") {
@@ -33551,7 +33752,7 @@ function main54() {
33551
33752
  return 0;
33552
33753
  }
33553
33754
  const workspaceRoot3 = String(envelope["workspace_root"] ?? "").trim() || process12.cwd();
33554
- const transcriptPath = str10(
33755
+ const transcriptPath = str11(
33555
33756
  payload["transcript_path"] ?? payload["transcriptPath"]
33556
33757
  ).trim();
33557
33758
  if (!transcriptPath || !isSafeTranscriptPath(transcriptPath)) {
@@ -33631,31 +33832,31 @@ function _isCliEntry43() {
33631
33832
  if (process12.argv[1] === void 0) {
33632
33833
  return false;
33633
33834
  }
33634
- const argvUrl = pathToFileURL49(path86.resolve(process12.argv[1])).href;
33835
+ const argvUrl = pathToFileURL50(path87.resolve(process12.argv[1])).href;
33635
33836
  if (import.meta.url === argvUrl) {
33636
33837
  return true;
33637
33838
  }
33638
33839
  try {
33639
- const here = fs85.realpathSync(fileURLToPath55(import.meta.url));
33640
- const argv = fs85.realpathSync(path86.resolve(process12.argv[1]));
33840
+ const here = fs86.realpathSync(fileURLToPath56(import.meta.url));
33841
+ const argv = fs86.realpathSync(path87.resolve(process12.argv[1]));
33641
33842
  return here === argv;
33642
33843
  } catch {
33643
33844
  return false;
33644
33845
  }
33645
33846
  }
33646
33847
  if (_isCliEntry43()) {
33647
- process12.exit(main54());
33848
+ process12.exit(main55());
33648
33849
  }
33649
33850
 
33650
33851
  // src/scripts/hooks/tool_result_bytes_hook.ts
33651
- import * as fs86 from "node:fs";
33652
- import * as path87 from "node:path";
33653
- import { fileURLToPath as fileURLToPath56, pathToFileURL as pathToFileURL50 } from "node:url";
33654
- var EXIT_ALLOW28 = 0;
33655
- function isObject13(v) {
33852
+ import * as fs87 from "node:fs";
33853
+ import * as path88 from "node:path";
33854
+ import { fileURLToPath as fileURLToPath57, pathToFileURL as pathToFileURL51 } from "node:url";
33855
+ var EXIT_ALLOW29 = 0;
33856
+ function isObject14(v) {
33656
33857
  return typeof v === "object" && v !== null && !Array.isArray(v);
33657
33858
  }
33658
- var CENSUS_FILE = path87.join("agents", "runtime", "state", "tool-result-census.jsonl");
33859
+ var CENSUS_FILE = path88.join("agents", "runtime", "state", "tool-result-census.jsonl");
33659
33860
  var RESULT_KEYS = ["tool_response", "toolResponse", "tool_result", "toolUseResult"];
33660
33861
  function _resultBytes(payload) {
33661
33862
  for (const key of RESULT_KEYS) {
@@ -33687,22 +33888,22 @@ function _toolName(payload, envelope) {
33687
33888
  }
33688
33889
  function unwrapPayload4(envelope) {
33689
33890
  const inner = envelope["payload"];
33690
- return isObject13(inner) ? inner : envelope;
33891
+ return isObject14(inner) ? inner : envelope;
33691
33892
  }
33692
33893
  function censusFile(consumerRoot) {
33693
- return path87.join(consumerRoot, CENSUS_FILE);
33894
+ return path88.join(consumerRoot, CENSUS_FILE);
33694
33895
  }
33695
33896
  function _appendCensusLine(consumerRoot, line) {
33696
33897
  if (is_replay_mode()) return;
33697
33898
  const file = censusFile(consumerRoot);
33698
- fs86.mkdirSync(path87.dirname(file), { recursive: true });
33699
- fs86.appendFileSync(file, `${JSON.stringify(line)}
33899
+ fs87.mkdirSync(path88.dirname(file), { recursive: true });
33900
+ fs87.appendFileSync(file, `${JSON.stringify(line)}
33700
33901
  `, "utf8");
33701
33902
  }
33702
33903
  function processEnvelope4(envelope, consumerRoot) {
33703
33904
  try {
33704
- if (!isObject13(envelope)) return EXIT_ALLOW28;
33705
- if (envelope["event"] !== "post_tool_use") return EXIT_ALLOW28;
33905
+ if (!isObject14(envelope)) return EXIT_ALLOW29;
33906
+ if (envelope["event"] !== "post_tool_use") return EXIT_ALLOW29;
33706
33907
  const payload = unwrapPayload4(envelope);
33707
33908
  const bytes = _resultBytes(payload);
33708
33909
  _appendCensusLine(consumerRoot, {
@@ -33712,12 +33913,12 @@ function processEnvelope4(envelope, consumerRoot) {
33712
33913
  measurable: bytes !== null
33713
33914
  });
33714
33915
  } catch {
33715
- return EXIT_ALLOW28;
33916
+ return EXIT_ALLOW29;
33716
33917
  }
33717
- return EXIT_ALLOW28;
33918
+ return EXIT_ALLOW29;
33718
33919
  }
33719
33920
  function resolveConsumerRoot2(envelope) {
33720
- if (isObject13(envelope)) {
33921
+ if (isObject14(envelope)) {
33721
33922
  for (const key of ["workspace_root", "project_root"]) {
33722
33923
  const v = envelope[key];
33723
33924
  if (typeof v === "string" && v) return v;
@@ -33727,13 +33928,13 @@ function resolveConsumerRoot2(envelope) {
33727
33928
  }
33728
33929
  return process.cwd();
33729
33930
  }
33730
- function main55() {
33931
+ function main56() {
33731
33932
  const raw = readHookStdin();
33732
33933
  let envelope = {};
33733
33934
  try {
33734
33935
  envelope = raw.trim() ? JSON.parse(raw) : {};
33735
33936
  } catch {
33736
- return EXIT_ALLOW28;
33937
+ return EXIT_ALLOW29;
33737
33938
  }
33738
33939
  return processEnvelope4(envelope, resolveConsumerRoot2(envelope));
33739
33940
  }
@@ -33742,22 +33943,22 @@ function _isCliEntry44() {
33742
33943
  return false;
33743
33944
  }
33744
33945
  if (process.argv[1] === void 0) return false;
33745
- const argvUrl = pathToFileURL50(path87.resolve(process.argv[1])).href;
33946
+ const argvUrl = pathToFileURL51(path88.resolve(process.argv[1])).href;
33746
33947
  if (import.meta.url === argvUrl) return true;
33747
33948
  try {
33748
- return fs86.realpathSync(fileURLToPath56(import.meta.url)) === fs86.realpathSync(path87.resolve(process.argv[1]));
33949
+ return fs87.realpathSync(fileURLToPath57(import.meta.url)) === fs87.realpathSync(path88.resolve(process.argv[1]));
33749
33950
  } catch {
33750
33951
  return false;
33751
33952
  }
33752
33953
  }
33753
- if (_isCliEntry44()) process.exit(main55());
33954
+ if (_isCliEntry44()) process.exit(main56());
33754
33955
 
33755
33956
  // src/scripts/hooks/spawn_guard_shadow_hook.ts
33756
- import * as fs87 from "node:fs";
33757
- import * as path88 from "node:path";
33758
- import { fileURLToPath as fileURLToPath57, pathToFileURL as pathToFileURL51 } from "node:url";
33759
- var EXIT_ALLOW29 = 0;
33760
- function isObject14(v) {
33957
+ import * as fs88 from "node:fs";
33958
+ import * as path89 from "node:path";
33959
+ import { fileURLToPath as fileURLToPath58, pathToFileURL as pathToFileURL52 } from "node:url";
33960
+ var EXIT_ALLOW30 = 0;
33961
+ function isObject15(v) {
33761
33962
  return typeof v === "object" && v !== null && !Array.isArray(v);
33762
33963
  }
33763
33964
  var DISPATCH_TOOL_NAMES2 = /* @__PURE__ */ new Set(["Agent", "Task"]);
@@ -33776,7 +33977,7 @@ function evaluateCandidates(depthEstimate, concurrentOpen) {
33776
33977
  }
33777
33978
  function unwrapPayload5(envelope) {
33778
33979
  const inner = envelope["payload"];
33779
- return isObject14(inner) ? inner : envelope;
33980
+ return isObject15(inner) ? inner : envelope;
33780
33981
  }
33781
33982
  function extractToolName5(payload) {
33782
33983
  const v = payload["tool_name"] ?? payload["toolName"] ?? payload["tool"];
@@ -33784,10 +33985,10 @@ function extractToolName5(payload) {
33784
33985
  }
33785
33986
  function processEnvelope5(envelope, consumerRoot) {
33786
33987
  try {
33787
- if (!isObject14(envelope)) return EXIT_ALLOW29;
33988
+ if (!isObject15(envelope)) return EXIT_ALLOW30;
33788
33989
  const payload = unwrapPayload5(envelope);
33789
33990
  const toolName = extractToolName5(payload);
33790
- if (toolName === null || !DISPATCH_TOOL_NAMES2.has(toolName)) return EXIT_ALLOW29;
33991
+ if (toolName === null || !DISPATCH_TOOL_NAMES2.has(toolName)) return EXIT_ALLOW30;
33791
33992
  const stats = openRecordStats(consumerRoot);
33792
33993
  const depthEstimate = stats.max_depth + 1;
33793
33994
  const verdicts = evaluateCandidates(depthEstimate, stats.open_count);
@@ -33815,47 +34016,47 @@ function processEnvelope5(envelope, consumerRoot) {
33815
34016
  posture: "shadow"
33816
34017
  });
33817
34018
  } catch {
33818
- return EXIT_ALLOW29;
34019
+ return EXIT_ALLOW30;
33819
34020
  }
33820
- return EXIT_ALLOW29;
34021
+ return EXIT_ALLOW30;
33821
34022
  }
33822
- function main56() {
34023
+ function main57() {
33823
34024
  const raw = readHookStdin();
33824
34025
  let envelope = {};
33825
34026
  try {
33826
34027
  envelope = raw.trim() ? JSON.parse(raw) : {};
33827
34028
  } catch {
33828
- return EXIT_ALLOW29;
34029
+ return EXIT_ALLOW30;
33829
34030
  }
33830
34031
  return processEnvelope5(envelope, resolveConsumerRoot(envelope));
33831
34032
  }
33832
34033
  function _isCliEntry45() {
33833
34034
  if (true) return false;
33834
34035
  if (process.argv[1] === void 0) return false;
33835
- const argvUrl = pathToFileURL51(path88.resolve(process.argv[1])).href;
34036
+ const argvUrl = pathToFileURL52(path89.resolve(process.argv[1])).href;
33836
34037
  if (import.meta.url === argvUrl) return true;
33837
34038
  try {
33838
- return fs87.realpathSync(fileURLToPath57(import.meta.url)) === fs87.realpathSync(path88.resolve(process.argv[1]));
34039
+ return fs88.realpathSync(fileURLToPath58(import.meta.url)) === fs88.realpathSync(path89.resolve(process.argv[1]));
33839
34040
  } catch {
33840
34041
  return false;
33841
34042
  }
33842
34043
  }
33843
- if (_isCliEntry45()) process.exit(main56());
34044
+ if (_isCliEntry45()) process.exit(main57());
33844
34045
 
33845
34046
  // src/scripts/hooks/source_first_gate_hook.ts
33846
- import * as fs88 from "node:fs";
33847
- import * as path89 from "node:path";
33848
- import { fileURLToPath as fileURLToPath58, pathToFileURL as pathToFileURL52 } from "node:url";
33849
- var EXIT_ALLOW30 = 0;
34047
+ import * as fs89 from "node:fs";
34048
+ import * as path90 from "node:path";
34049
+ import { fileURLToPath as fileURLToPath59, pathToFileURL as pathToFileURL53 } from "node:url";
34050
+ var EXIT_ALLOW31 = 0;
33850
34051
  var MAX_SHADOW_WARNS = 2;
33851
- var SHADOW_LOG = path89.join("agents", "runtime", "state", "source-first-gate.jsonl");
33852
- var STATE_FILE9 = path89.join("agents", "runtime", "state", "source-first-gate.json");
33853
- function isObject15(v) {
34052
+ var SHADOW_LOG = path90.join("agents", "runtime", "state", "source-first-gate.jsonl");
34053
+ var STATE_FILE9 = path90.join("agents", "runtime", "state", "source-first-gate.json");
34054
+ function isObject16(v) {
33854
34055
  return typeof v === "object" && v !== null && !Array.isArray(v);
33855
34056
  }
33856
34057
  function unwrapPayload6(envelope) {
33857
34058
  const inner = envelope["payload"];
33858
- return isObject15(inner) ? inner : envelope;
34059
+ return isObject16(inner) ? inner : envelope;
33859
34060
  }
33860
34061
  var TOOL_MATCHERS = [
33861
34062
  { pattern: /^browser_take_screenshot$/i, hit: { label: "playwright-mcp", capture_kind: "page" } },
@@ -33875,7 +34076,7 @@ function isHandoverPath(file) {
33875
34076
  const normalized = file.replace(/\\/g, "/").toLowerCase();
33876
34077
  return normalized.endsWith("design.html") || normalized.includes(".claude/design-system/");
33877
34078
  }
33878
- function str11(o, ...keys) {
34079
+ function str12(o, ...keys) {
33879
34080
  for (const k of keys) {
33880
34081
  const v = o[k];
33881
34082
  if (typeof v === "string" && v) return v;
@@ -33883,12 +34084,12 @@ function str11(o, ...keys) {
33883
34084
  return null;
33884
34085
  }
33885
34086
  function extractEvent2(outer) {
33886
- if (!isObject15(outer)) return null;
34087
+ if (!isObject16(outer)) return null;
33887
34088
  const payload = unwrapPayload6(outer);
33888
- const toolName = str11(payload, "tool_name", "toolName", "tool");
34089
+ const toolName = str12(payload, "tool_name", "toolName", "tool");
33889
34090
  const ti = payload["tool_input"] ?? payload["toolInput"] ?? payload["input"];
33890
- const input = isObject15(ti) ? ti : {};
33891
- const file = str11(input, "file_path", "path", "filePath") ?? "";
34091
+ const input = isObject16(ti) ? ti : {};
34092
+ const file = str12(input, "file_path", "path", "filePath") ?? "";
33892
34093
  let isWrite = false;
33893
34094
  for (const key of ["content", "new_string", "new_str", "text", "newText"]) {
33894
34095
  if (typeof input[key] === "string" && input[key].length > 0) isWrite = true;
@@ -33902,7 +34103,7 @@ function extractEvent2(outer) {
33902
34103
  }
33903
34104
  }
33904
34105
  if (!capture && SHELL_TOOLS.test(toolName)) {
33905
- const command = str11(input, "command", "cmd", "script") ?? "";
34106
+ const command = str12(input, "command", "cmd", "script") ?? "";
33906
34107
  for (const m of COMMAND_MATCHERS) {
33907
34108
  if (m.pattern.test(command)) {
33908
34109
  capture = m.hit;
@@ -33915,15 +34116,15 @@ function extractEvent2(outer) {
33915
34116
  capture,
33916
34117
  file,
33917
34118
  isWrite,
33918
- agentIdPresent: str11(payload, "agent_id", "agentId") !== null,
33919
- agentType: str11(payload, "agent_type", "agentType")
34119
+ agentIdPresent: str12(payload, "agent_id", "agentId") !== null,
34120
+ agentType: str12(payload, "agent_type", "agentType")
33920
34121
  };
33921
34122
  }
33922
34123
  var EMPTY_STATE = { handoverSeen: false, sourceRead: false, wouldWarn: 0 };
33923
34124
  var MAX_SESSIONS2 = 50;
33924
34125
  function readState5(root, session) {
33925
34126
  try {
33926
- const all = JSON.parse(fs88.readFileSync(path89.join(root, STATE_FILE9), "utf-8"));
34127
+ const all = JSON.parse(fs89.readFileSync(path90.join(root, STATE_FILE9), "utf-8"));
33927
34128
  const entry = all[session];
33928
34129
  if (entry && typeof entry.handoverSeen === "boolean" && typeof entry.sourceRead === "boolean" && typeof entry.wouldWarn === "number") {
33929
34130
  return entry;
@@ -33935,13 +34136,13 @@ function readState5(root, session) {
33935
34136
  function writeState4(root, session, state) {
33936
34137
  if (is_replay_mode()) return;
33937
34138
  try {
33938
- const file = path89.join(root, STATE_FILE9);
34139
+ const file = path90.join(root, STATE_FILE9);
33939
34140
  let all = {};
33940
34141
  try {
33941
- all = JSON.parse(fs88.readFileSync(file, "utf-8"));
34142
+ all = JSON.parse(fs89.readFileSync(file, "utf-8"));
33942
34143
  } catch {
33943
34144
  }
33944
- if (!isObject15(all)) all = {};
34145
+ if (!isObject16(all)) all = {};
33945
34146
  all[session] = state;
33946
34147
  const keys = Object.keys(all);
33947
34148
  if (keys.length > MAX_SESSIONS2) {
@@ -33949,8 +34150,8 @@ function writeState4(root, session, state) {
33949
34150
  for (const key of keys.slice(keys.length - MAX_SESSIONS2)) pruned[key] = all[key];
33950
34151
  all = pruned;
33951
34152
  }
33952
- fs88.mkdirSync(path89.dirname(file), { recursive: true });
33953
- fs88.writeFileSync(file, JSON.stringify(all));
34153
+ fs89.mkdirSync(path90.dirname(file), { recursive: true });
34154
+ fs89.writeFileSync(file, JSON.stringify(all));
33954
34155
  } catch {
33955
34156
  }
33956
34157
  }
@@ -33971,7 +34172,7 @@ function evaluateCandidates2(handoverSeen, handoverOnDisk, sourceRead) {
33971
34172
  }
33972
34173
  function handoverPresentOnDisk(root) {
33973
34174
  try {
33974
- return fs88.statSync(path89.join(root, ".claude", "design-system")).isDirectory();
34175
+ return fs89.statSync(path90.join(root, ".claude", "design-system")).isDirectory();
33975
34176
  } catch {
33976
34177
  return false;
33977
34178
  }
@@ -33979,9 +34180,9 @@ function handoverPresentOnDisk(root) {
33979
34180
  function appendShadowLine(root, line) {
33980
34181
  if (is_replay_mode()) return;
33981
34182
  try {
33982
- const file = path89.join(root, SHADOW_LOG);
33983
- fs88.mkdirSync(path89.dirname(file), { recursive: true });
33984
- fs88.appendFileSync(file, `${JSON.stringify(line)}
34183
+ const file = path90.join(root, SHADOW_LOG);
34184
+ fs89.mkdirSync(path90.dirname(file), { recursive: true });
34185
+ fs89.appendFileSync(file, `${JSON.stringify(line)}
33985
34186
  `, "utf8");
33986
34187
  } catch {
33987
34188
  }
@@ -33995,14 +34196,14 @@ function nextState2(event, state) {
33995
34196
  function processEnvelope6(envelope, consumerRoot, session) {
33996
34197
  try {
33997
34198
  const event = extractEvent2(envelope);
33998
- if (!event) return EXIT_ALLOW30;
34199
+ if (!event) return EXIT_ALLOW31;
33999
34200
  const before = readState5(consumerRoot, session);
34000
34201
  const after = nextState2(event, before);
34001
34202
  if (event.capture === null) {
34002
34203
  if (after.handoverSeen !== before.handoverSeen || after.sourceRead !== before.sourceRead) {
34003
34204
  writeState4(consumerRoot, session, after);
34004
34205
  }
34005
- return EXIT_ALLOW30;
34206
+ return EXIT_ALLOW31;
34006
34207
  }
34007
34208
  const onDisk = handoverPresentOnDisk(consumerRoot);
34008
34209
  const verdicts = evaluateCandidates2(after.handoverSeen, onDisk, after.sourceRead);
@@ -34038,42 +34239,42 @@ function processEnvelope6(envelope, consumerRoot, session) {
34038
34239
  const persisted = anyWarn && !valveWouldSilence ? { ...after, wouldWarn: after.wouldWarn + 1 } : after;
34039
34240
  writeState4(consumerRoot, session, persisted);
34040
34241
  } catch {
34041
- return EXIT_ALLOW30;
34242
+ return EXIT_ALLOW31;
34042
34243
  }
34043
- return EXIT_ALLOW30;
34244
+ return EXIT_ALLOW31;
34044
34245
  }
34045
- function main57() {
34246
+ function main58() {
34046
34247
  const raw = readHookStdin();
34047
34248
  let envelope = {};
34048
34249
  try {
34049
34250
  envelope = raw.trim() ? JSON.parse(raw) : {};
34050
34251
  } catch {
34051
- return EXIT_ALLOW30;
34252
+ return EXIT_ALLOW31;
34052
34253
  }
34053
- const sessionVal = isObject15(envelope) ? envelope["session_id"] : null;
34254
+ const sessionVal = isObject16(envelope) ? envelope["session_id"] : null;
34054
34255
  const session = typeof sessionVal === "string" && sessionVal ? sessionVal : "unknown";
34055
34256
  return processEnvelope6(envelope, resolveConsumerRoot(envelope), session);
34056
34257
  }
34057
34258
  function _isCliEntry46() {
34058
34259
  if (true) return false;
34059
34260
  if (process.argv[1] === void 0) return false;
34060
- const argvUrl = pathToFileURL52(path89.resolve(process.argv[1])).href;
34261
+ const argvUrl = pathToFileURL53(path90.resolve(process.argv[1])).href;
34061
34262
  if (import.meta.url === argvUrl) return true;
34062
34263
  try {
34063
- return fs88.realpathSync(fileURLToPath58(import.meta.url)) === fs88.realpathSync(path89.resolve(process.argv[1]));
34264
+ return fs89.realpathSync(fileURLToPath59(import.meta.url)) === fs89.realpathSync(path90.resolve(process.argv[1]));
34064
34265
  } catch {
34065
34266
  return false;
34066
34267
  }
34067
34268
  }
34068
- if (_isCliEntry46()) process.exit(main57());
34269
+ if (_isCliEntry46()) process.exit(main58());
34069
34270
 
34070
34271
  // src/scripts/hooks/interruption_ledger_hook.ts
34071
- import * as fs89 from "node:fs";
34072
- import * as path90 from "node:path";
34073
- import { fileURLToPath as fileURLToPath59, pathToFileURL as pathToFileURL53 } from "node:url";
34272
+ import * as fs90 from "node:fs";
34273
+ import * as path91 from "node:path";
34274
+ import { fileURLToPath as fileURLToPath60, pathToFileURL as pathToFileURL54 } from "node:url";
34074
34275
  var EXIT_OK2 = 0;
34075
34276
  var TRANSCRIPT_READ_MAX_BYTES2 = 2 * 1024 * 1024;
34076
- var LEDGER_RELPATH = path90.join("agents", "runtime", "state", "interruptions.jsonl");
34277
+ var LEDGER_RELPATH = path91.join("agents", "runtime", "state", "interruptions.jsonl");
34077
34278
  function hasNumberedOptions(reply) {
34078
34279
  let count = 0;
34079
34280
  for (const line of reply.split("\n")) {
@@ -34097,14 +34298,14 @@ function classifyReply(reply) {
34097
34298
  function readClaimedRoadmap(workspaceRoot3, sessionId2) {
34098
34299
  if (!sessionId2) return null;
34099
34300
  try {
34100
- const file = path90.join(
34301
+ const file = path91.join(
34101
34302
  workspaceRoot3,
34102
34303
  "agents",
34103
34304
  "runtime",
34104
34305
  "state",
34105
34306
  `roadmap-claim-${sessionId2}.json`
34106
34307
  );
34107
- const parsed = JSON.parse(fs89.readFileSync(file, "utf8"));
34308
+ const parsed = JSON.parse(fs90.readFileSync(file, "utf8"));
34108
34309
  if (parsed === null || typeof parsed !== "object") return null;
34109
34310
  const slug = parsed["slug"];
34110
34311
  return typeof slug === "string" && slug.length > 0 ? slug : null;
@@ -34115,7 +34316,7 @@ function readClaimedRoadmap(workspaceRoot3, sessionId2) {
34115
34316
  function alreadyRecorded(ledgerPath, runId, turn) {
34116
34317
  let raw;
34117
34318
  try {
34118
- raw = fs89.readFileSync(ledgerPath, "utf8");
34319
+ raw = fs90.readFileSync(ledgerPath, "utf8");
34119
34320
  } catch {
34120
34321
  return false;
34121
34322
  }
@@ -34131,10 +34332,10 @@ function alreadyRecorded(ledgerPath, runId, turn) {
34131
34332
  }
34132
34333
  return false;
34133
34334
  }
34134
- function str12(v) {
34335
+ function str13(v) {
34135
34336
  return typeof v === "string" ? v : "";
34136
34337
  }
34137
- function main58() {
34338
+ function main59() {
34138
34339
  let envelope;
34139
34340
  let payload;
34140
34341
  try {
@@ -34142,8 +34343,8 @@ function main58() {
34142
34343
  } catch {
34143
34344
  return EXIT_OK2;
34144
34345
  }
34145
- const workspaceRoot3 = str12(envelope["workspace_root"]) || process.cwd();
34146
- const transcriptPath = str12(
34346
+ const workspaceRoot3 = str13(envelope["workspace_root"]) || process.cwd();
34347
+ const transcriptPath = str13(
34147
34348
  payload["transcript_path"] ?? payload["transcriptPath"]
34148
34349
  );
34149
34350
  if (!transcriptPath) return EXIT_OK2;
@@ -34157,9 +34358,9 @@ function main58() {
34157
34358
  return EXIT_OK2;
34158
34359
  }
34159
34360
  if (!lastAssistant) return EXIT_OK2;
34160
- const sessionId2 = str12(payload["session_id"]) || str12(envelope["session_id"]);
34361
+ const sessionId2 = str13(payload["session_id"]) || str13(envelope["session_id"]);
34161
34362
  const runId = sessionId2 ? derive_session_tag(sessionId2) : "unknown";
34162
- const ledgerPath = path90.join(workspaceRoot3, LEDGER_RELPATH);
34363
+ const ledgerPath = path91.join(workspaceRoot3, LEDGER_RELPATH);
34163
34364
  if (alreadyRecorded(ledgerPath, runId, turnOrdinal)) return EXIT_OK2;
34164
34365
  const verdict = classifyReply(lastAssistant);
34165
34366
  const record = {
@@ -34171,8 +34372,8 @@ function main58() {
34171
34372
  at: (/* @__PURE__ */ new Date()).toISOString()
34172
34373
  };
34173
34374
  try {
34174
- fs89.mkdirSync(path90.dirname(ledgerPath), { recursive: true });
34175
- fs89.appendFileSync(ledgerPath, `${JSON.stringify(record)}
34375
+ fs90.mkdirSync(path91.dirname(ledgerPath), { recursive: true });
34376
+ fs90.appendFileSync(ledgerPath, `${JSON.stringify(record)}
34176
34377
  `, "utf8");
34177
34378
  } catch {
34178
34379
  }
@@ -34182,32 +34383,32 @@ function _isCliEntry47() {
34182
34383
  if (process.argv[1] === void 0) {
34183
34384
  return false;
34184
34385
  }
34185
- const argvUrl = pathToFileURL53(path90.resolve(process.argv[1])).href;
34386
+ const argvUrl = pathToFileURL54(path91.resolve(process.argv[1])).href;
34186
34387
  if (import.meta.url === argvUrl) {
34187
34388
  return true;
34188
34389
  }
34189
34390
  try {
34190
- const here = fs89.realpathSync(fileURLToPath59(import.meta.url));
34191
- const argv = fs89.realpathSync(path90.resolve(process.argv[1]));
34391
+ const here = fs90.realpathSync(fileURLToPath60(import.meta.url));
34392
+ const argv = fs90.realpathSync(path91.resolve(process.argv[1]));
34192
34393
  return here === argv;
34193
34394
  } catch {
34194
34395
  return false;
34195
34396
  }
34196
34397
  }
34197
34398
  if (_isCliEntry47()) {
34198
- process.exit(main58());
34399
+ process.exit(main59());
34199
34400
  }
34200
34401
 
34201
34402
  // src/scripts/hooks/run_continuation_hook.ts
34202
- import * as fs91 from "node:fs";
34403
+ import * as fs92 from "node:fs";
34203
34404
 
34204
34405
  // src/scripts/_lib/billing_grant.ts
34205
- import * as fs90 from "node:fs";
34206
- import * as path91 from "node:path";
34207
- var BILLING_GRANT_DIR_REL = path91.join("agents", "runtime", "billing-grants");
34406
+ import * as fs91 from "node:fs";
34407
+ import * as path92 from "node:path";
34408
+ var BILLING_GRANT_DIR_REL = path92.join("agents", "runtime", "billing-grants");
34208
34409
  var BILLING_GRANT_MAX_AGE_MS = 24 * 60 * 60 * 1e3;
34209
34410
  function grantFile(repoRoot, runId) {
34210
- return path91.join(
34411
+ return path92.join(
34211
34412
  repoRoot,
34212
34413
  BILLING_GRANT_DIR_REL,
34213
34414
  `${runId.replace(/[^A-Za-z0-9_-]/g, "_")}.json`
@@ -34215,25 +34416,25 @@ function grantFile(repoRoot, runId) {
34215
34416
  }
34216
34417
  function revokeBillingGrant(repoRoot, runId) {
34217
34418
  try {
34218
- fs90.unlinkSync(grantFile(repoRoot, runId));
34419
+ fs91.unlinkSync(grantFile(repoRoot, runId));
34219
34420
  } catch {
34220
34421
  }
34221
34422
  }
34222
34423
 
34223
34424
  // src/scripts/hooks/run_continuation_hook.ts
34224
- import * as path92 from "node:path";
34225
- import { fileURLToPath as fileURLToPath60, pathToFileURL as pathToFileURL54 } from "node:url";
34226
- var EXIT_ALLOW31 = 0;
34425
+ import * as path93 from "node:path";
34426
+ import { fileURLToPath as fileURLToPath61, pathToFileURL as pathToFileURL55 } from "node:url";
34427
+ var EXIT_ALLOW32 = 0;
34227
34428
  var EXIT_BLOCK5 = 1;
34228
34429
  var BLOCKED_BY_MARKER = /<!--\s*blocked-by:\s*\S[^>]*-->/;
34229
34430
  var LEDGER_TAIL_MAX_BYTES = 512 * 1024;
34230
- var EVENTS_RELPATH = path92.join(
34431
+ var EVENTS_RELPATH = path93.join(
34231
34432
  "agents",
34232
34433
  "runtime",
34233
34434
  "state",
34234
34435
  "run-continuation.jsonl"
34235
34436
  );
34236
- var STATE_DIR_REL = path92.join("agents", "runtime", "state");
34437
+ var STATE_DIR_REL = path93.join("agents", "runtime", "state");
34237
34438
  var MAX_ITERATIONS = 25;
34238
34439
  var WALL_CLOCK_CAP_MS = 4 * 60 * 60 * 1e3;
34239
34440
  var STALL_WINDOW = 3;
@@ -34331,20 +34532,20 @@ function ladder(state, openCount, nowMs, blockedCount, caps = {
34331
34532
  function stateRelPath(runId, slug) {
34332
34533
  const safeRun = runId.replace(/[^A-Za-z0-9_-]/g, "_");
34333
34534
  const safeSlug = slug.replace(/[^A-Za-z0-9_-]/g, "_");
34334
- return path92.join(STATE_DIR_REL, `run-continuation-${safeRun}-${safeSlug}.json`);
34535
+ return path93.join(STATE_DIR_REL, `run-continuation-${safeRun}-${safeSlug}.json`);
34335
34536
  }
34336
34537
  function legacyStateRelPath(runId) {
34337
34538
  const safe = runId.replace(/[^A-Za-z0-9_-]/g, "_");
34338
- return path92.join(STATE_DIR_REL, `run-continuation-${safe}.json`);
34539
+ return path93.join(STATE_DIR_REL, `run-continuation-${safe}.json`);
34339
34540
  }
34340
34541
  function readRunState(workspaceRoot3, runId, slug) {
34341
- const keyedFile = path92.join(workspaceRoot3, stateRelPath(runId, slug));
34542
+ const keyedFile = path93.join(workspaceRoot3, stateRelPath(runId, slug));
34342
34543
  const keyed = readState6(keyedFile);
34343
34544
  if (keyed !== null) return { state: keyed, from: "keyed", keyedFile };
34344
34545
  if (fileExists(keyedFile)) {
34345
34546
  return { state: null, from: "keyed", keyedFile };
34346
34547
  }
34347
- const legacy = readState6(path92.join(workspaceRoot3, legacyStateRelPath(runId)));
34548
+ const legacy = readState6(path93.join(workspaceRoot3, legacyStateRelPath(runId)));
34348
34549
  if (legacy === null) return { state: null, from: "none", keyedFile };
34349
34550
  if (legacy.roadmap !== void 0 && legacy.roadmap !== slug) {
34350
34551
  return { state: null, from: "none", keyedFile };
@@ -34353,8 +34554,8 @@ function readRunState(workspaceRoot3, runId, slug) {
34353
34554
  }
34354
34555
  function writeState5(file, state) {
34355
34556
  try {
34356
- fs91.mkdirSync(path92.dirname(file), { recursive: true });
34357
- fs91.writeFileSync(file, `${JSON.stringify(state)}
34557
+ fs92.mkdirSync(path93.dirname(file), { recursive: true });
34558
+ fs92.writeFileSync(file, `${JSON.stringify(state)}
34358
34559
  `, "utf8");
34359
34560
  return true;
34360
34561
  } catch {
@@ -34364,25 +34565,25 @@ function writeState5(file, state) {
34364
34565
  function clearRunState(workspaceRoot3, runId, keyedFile, adoptedLegacy) {
34365
34566
  revokeBillingGrant(workspaceRoot3, runId);
34366
34567
  try {
34367
- fs91.rmSync(keyedFile, { force: true });
34568
+ fs92.rmSync(keyedFile, { force: true });
34368
34569
  } catch {
34369
34570
  }
34370
34571
  if (!adoptedLegacy) return;
34371
34572
  try {
34372
- fs91.rmSync(path92.join(workspaceRoot3, legacyStateRelPath(runId)), { force: true });
34573
+ fs92.rmSync(path93.join(workspaceRoot3, legacyStateRelPath(runId)), { force: true });
34373
34574
  } catch {
34374
34575
  }
34375
34576
  }
34376
34577
  function fileExists(p) {
34377
34578
  try {
34378
- return fs91.statSync(p).isFile();
34579
+ return fs92.statSync(p).isFile();
34379
34580
  } catch {
34380
34581
  return false;
34381
34582
  }
34382
34583
  }
34383
34584
  function readState6(file) {
34384
34585
  try {
34385
- const parsed = JSON.parse(fs91.readFileSync(file, "utf8"));
34586
+ const parsed = JSON.parse(fs92.readFileSync(file, "utf8"));
34386
34587
  if (parsed === null || typeof parsed !== "object") return null;
34387
34588
  const o = parsed;
34388
34589
  if (typeof o["started_at"] !== "string") return null;
@@ -34422,16 +34623,16 @@ function readState6(file) {
34422
34623
  }
34423
34624
  }
34424
34625
  function normalizeDir(p) {
34425
- const abs = path92.resolve(p);
34626
+ const abs = path93.resolve(p);
34426
34627
  try {
34427
- return fs91.realpathSync(abs);
34628
+ return fs92.realpathSync(abs);
34428
34629
  } catch {
34429
34630
  return abs;
34430
34631
  }
34431
34632
  }
34432
34633
  function normalizeFile(p) {
34433
- const abs = path92.resolve(p);
34434
- return path92.join(normalizeDir(path92.dirname(abs)), path92.basename(abs));
34634
+ const abs = path93.resolve(p);
34635
+ return path93.join(normalizeDir(path93.dirname(abs)), path93.basename(abs));
34435
34636
  }
34436
34637
  function provenance(workspaceRoot3, claimPath, sessionRoot, sessionCwd) {
34437
34638
  const reader = normalizeDir(workspaceRoot3);
@@ -34458,36 +34659,36 @@ function provenance(workspaceRoot3, claimPath, sessionRoot, sessionCwd) {
34458
34659
  };
34459
34660
  }
34460
34661
  function resolveRoadmap(sessionRoot, workspaceRoot3, slug) {
34461
- const dirRel = path92.join("agents", "roadmaps");
34662
+ const dirRel = path93.join("agents", "roadmaps");
34462
34663
  const stem = slug.trim().replace(/\.md$/, "");
34463
- const rel = path92.join(dirRel, `${stem}.md`);
34464
- const norm = path92.normalize(rel);
34465
- if (path92.dirname(norm) !== dirRel) return null;
34466
- if (sessionRoot !== workspaceRoot3 && isDirectory(path92.join(sessionRoot, dirRel))) {
34467
- return path92.join(sessionRoot, norm);
34664
+ const rel = path93.join(dirRel, `${stem}.md`);
34665
+ const norm = path93.normalize(rel);
34666
+ if (path93.dirname(norm) !== dirRel) return null;
34667
+ if (sessionRoot !== workspaceRoot3 && isDirectory(path93.join(sessionRoot, dirRel))) {
34668
+ return path93.join(sessionRoot, norm);
34468
34669
  }
34469
- return path92.join(normalizeDir(workspaceRoot3), norm);
34670
+ return path93.join(normalizeDir(workspaceRoot3), norm);
34470
34671
  }
34471
34672
  function isDirectory(p) {
34472
34673
  try {
34473
- return fs91.statSync(p).isDirectory();
34674
+ return fs92.statSync(p).isDirectory();
34474
34675
  } catch {
34475
34676
  return false;
34476
34677
  }
34477
34678
  }
34478
34679
  function eventAlreadyLogged(workspaceRoot3, runId, slug, event) {
34479
34680
  try {
34480
- const file = path92.join(workspaceRoot3, EVENTS_RELPATH);
34481
- const size = fs91.statSync(file).size;
34681
+ const file = path93.join(workspaceRoot3, EVENTS_RELPATH);
34682
+ const size = fs92.statSync(file).size;
34482
34683
  const start = Math.max(0, size - LEDGER_TAIL_MAX_BYTES);
34483
- const fd = fs91.openSync(file, "r");
34684
+ const fd = fs92.openSync(file, "r");
34484
34685
  let text;
34485
34686
  try {
34486
34687
  const buf = Buffer.alloc(size - start);
34487
- const read = fs91.readSync(fd, buf, 0, buf.length, start);
34688
+ const read = fs92.readSync(fd, buf, 0, buf.length, start);
34488
34689
  text = buf.subarray(0, read).toString("utf8");
34489
34690
  } finally {
34490
- fs91.closeSync(fd);
34691
+ fs92.closeSync(fd);
34491
34692
  }
34492
34693
  for (const line of text.split("\n")) {
34493
34694
  if (line === "") continue;
@@ -34510,9 +34711,9 @@ function eventAlreadyLogged(workspaceRoot3, runId, slug, event) {
34510
34711
  }
34511
34712
  function appendEvent2(workspaceRoot3, record) {
34512
34713
  try {
34513
- const file = path92.join(workspaceRoot3, EVENTS_RELPATH);
34514
- fs91.mkdirSync(path92.dirname(file), { recursive: true });
34515
- fs91.appendFileSync(file, `${JSON.stringify(record)}
34714
+ const file = path93.join(workspaceRoot3, EVENTS_RELPATH);
34715
+ fs92.mkdirSync(path93.dirname(file), { recursive: true });
34716
+ fs92.appendFileSync(file, `${JSON.stringify(record)}
34516
34717
  `, "utf8");
34517
34718
  } catch {
34518
34719
  }
@@ -34520,33 +34721,33 @@ function appendEvent2(workspaceRoot3, record) {
34520
34721
  function refusedThisTurn(workspaceRoot3, sessionId2, turnOrdinal) {
34521
34722
  try {
34522
34723
  const file = sessionRefusalFile(workspaceRoot3, deriveSessionKey(sessionId2 || "unknown-session"));
34523
- const rec = parseRecord(fs91.readFileSync(file, "utf-8"));
34724
+ const rec = parseRecord(fs92.readFileSync(file, "utf-8"));
34524
34725
  return rec !== null && rec.refused_turn === turnOrdinal;
34525
34726
  } catch {
34526
34727
  return false;
34527
34728
  }
34528
34729
  }
34529
- function str13(v) {
34730
+ function str14(v) {
34530
34731
  return typeof v === "string" ? v : "";
34531
34732
  }
34532
- function main59() {
34533
- if (is_replay_mode()) return EXIT_ALLOW31;
34534
- if (process.env["AGENT_CONFIG_NO_RUN_CONTINUATION"] === "1") return EXIT_ALLOW31;
34733
+ function main60() {
34734
+ if (is_replay_mode()) return EXIT_ALLOW32;
34735
+ if (process.env["AGENT_CONFIG_NO_RUN_CONTINUATION"] === "1") return EXIT_ALLOW32;
34535
34736
  let envelope;
34536
34737
  let payload;
34537
34738
  try {
34538
34739
  [envelope, payload] = unwrap(readHookStdin(), "claude");
34539
34740
  } catch {
34540
- return EXIT_ALLOW31;
34741
+ return EXIT_ALLOW32;
34541
34742
  }
34542
- const workspaceRoot3 = str13(envelope["workspace_root"]) || process.cwd();
34543
- const sessionId2 = str13(payload["session_id"]) || str13(envelope["session_id"]);
34743
+ const workspaceRoot3 = str14(envelope["workspace_root"]) || process.cwd();
34744
+ const sessionId2 = str14(payload["session_id"]) || str14(envelope["session_id"]);
34544
34745
  const claim = resolve_claim(workspaceRoot3, sessionId2 || null);
34545
- if (claim === null) return EXIT_ALLOW31;
34746
+ if (claim === null) return EXIT_ALLOW32;
34546
34747
  const slug = claim.slug;
34547
34748
  const sessionRoot = session_checkout(
34548
34749
  workspaceRoot3,
34549
- str13(payload["cwd"])
34750
+ str14(payload["cwd"])
34550
34751
  );
34551
34752
  const roadmapPath2 = resolveRoadmap(sessionRoot, workspaceRoot3, slug);
34552
34753
  const runId = deriveSessionKey(sessionId2 || "unknown-session");
@@ -34554,7 +34755,7 @@ function main59() {
34554
34755
  let roadmapText = null;
34555
34756
  if (roadmapPath2 !== null) {
34556
34757
  try {
34557
- roadmapText = fs91.readFileSync(roadmapPath2, "utf8");
34758
+ roadmapText = fs92.readFileSync(roadmapPath2, "utf8");
34558
34759
  roadmapFile = roadmapPath2;
34559
34760
  } catch {
34560
34761
  roadmapText = null;
@@ -34563,13 +34764,13 @@ function main59() {
34563
34764
  if (roadmapText === null || roadmapFile === null) {
34564
34765
  const runState = readRunState(workspaceRoot3, runId, slug);
34565
34766
  const driven = runState.state;
34566
- if (driven === null && runState.from === "none") return EXIT_ALLOW31;
34567
- if (driven?.halted !== void 0) return EXIT_ALLOW31;
34767
+ if (driven === null && runState.from === "none") return EXIT_ALLOW32;
34768
+ if (driven?.halted !== void 0) return EXIT_ALLOW32;
34568
34769
  const absenceRoots = provenance(
34569
34770
  workspaceRoot3,
34570
34771
  claim.path,
34571
34772
  sessionRoot,
34572
- str13(payload["cwd"])
34773
+ str14(payload["cwd"])
34573
34774
  );
34574
34775
  absenceRoots["roadmap_path"] = roadmapPath2;
34575
34776
  const absentFires = (driven?.absent_fires ?? 0) + 1;
@@ -34588,29 +34789,29 @@ function main59() {
34588
34789
  ...absenceRoots
34589
34790
  });
34590
34791
  }
34591
- if (driven === null) return EXIT_ALLOW31;
34792
+ if (driven === null) return EXIT_ALLOW32;
34592
34793
  if (absentFires < ABSENT_CONFIRM_FIRES) {
34593
34794
  driven.absent_fires = absentFires;
34594
34795
  writeState5(runState.keyedFile, driven);
34595
- return EXIT_ALLOW31;
34796
+ return EXIT_ALLOW32;
34596
34797
  }
34597
34798
  clearRunState(workspaceRoot3, runId, runState.keyedFile, runState.from === "legacy");
34598
- return EXIT_ALLOW31;
34799
+ return EXIT_ALLOW32;
34599
34800
  }
34600
- if (parseExecutionMode(roadmapText) !== "autonomous") return EXIT_ALLOW31;
34601
- const transcriptPath = str13(
34801
+ if (parseExecutionMode(roadmapText) !== "autonomous") return EXIT_ALLOW32;
34802
+ const transcriptPath = str14(
34602
34803
  payload["transcript_path"] ?? payload["transcriptPath"]
34603
34804
  );
34604
- if (!transcriptPath) return EXIT_ALLOW31;
34805
+ if (!transcriptPath) return EXIT_ALLOW32;
34605
34806
  try {
34606
- if (fs91.statSync(transcriptPath).size > TRANSCRIPT_READ_MAX_BYTES) {
34807
+ if (fs92.statSync(transcriptPath).size > TRANSCRIPT_READ_MAX_BYTES) {
34607
34808
  const inert = readRunState(workspaceRoot3, runId, slug);
34608
34809
  if (inert.state !== null && inert.state.inert_reported !== true) {
34609
34810
  const inertRoots = provenance(
34610
34811
  workspaceRoot3,
34611
34812
  claim.path,
34612
34813
  sessionRoot,
34613
- str13(payload["cwd"])
34814
+ str14(payload["cwd"])
34614
34815
  );
34615
34816
  inertRoots["roadmap_path"] = roadmapFile;
34616
34817
  appendEvent2(workspaceRoot3, {
@@ -34624,10 +34825,10 @@ function main59() {
34624
34825
  inert.state.inert_reported = true;
34625
34826
  writeState5(inert.keyedFile, inert.state);
34626
34827
  }
34627
- return EXIT_ALLOW31;
34828
+ return EXIT_ALLOW32;
34628
34829
  }
34629
34830
  } catch {
34630
- return EXIT_ALLOW31;
34831
+ return EXIT_ALLOW32;
34631
34832
  }
34632
34833
  let turnOrdinal = 0;
34633
34834
  try {
@@ -34635,13 +34836,13 @@ function main59() {
34635
34836
  maxBytes: TRANSCRIPT_READ_MAX_BYTES
34636
34837
  }).turnOrdinal;
34637
34838
  } catch {
34638
- return EXIT_ALLOW31;
34839
+ return EXIT_ALLOW32;
34639
34840
  }
34640
34841
  const roots = provenance(
34641
34842
  workspaceRoot3,
34642
34843
  claim.path,
34643
34844
  sessionRoot,
34644
- str13(payload["cwd"])
34845
+ str14(payload["cwd"])
34645
34846
  );
34646
34847
  roots["roadmap_path"] = roadmapFile;
34647
34848
  if (refusedThisTurn(workspaceRoot3, sessionId2, turnOrdinal)) {
@@ -34653,7 +34854,7 @@ function main59() {
34653
34854
  at: (/* @__PURE__ */ new Date()).toISOString(),
34654
34855
  ...roots
34655
34856
  });
34656
- return EXIT_ALLOW31;
34857
+ return EXIT_ALLOW32;
34657
34858
  }
34658
34859
  const mainState = readRunState(workspaceRoot3, runId, slug);
34659
34860
  const stateFile4 = mainState.keyedFile;
@@ -34695,24 +34896,24 @@ function main59() {
34695
34896
  }
34696
34897
  if (action === "complete") {
34697
34898
  clearRunState(workspaceRoot3, runId, stateFile4, mainState.from === "legacy");
34698
- return EXIT_ALLOW31;
34899
+ return EXIT_ALLOW32;
34699
34900
  }
34700
34901
  if (action === "blocked") {
34701
34902
  clearRunState(workspaceRoot3, runId, stateFile4, mainState.from === "legacy");
34702
- return EXIT_ALLOW31;
34903
+ return EXIT_ALLOW32;
34703
34904
  }
34704
34905
  if (!state.halted) {
34705
34906
  state.halted = action;
34706
34907
  writeState5(stateFile4, state);
34707
34908
  }
34708
- return EXIT_ALLOW31;
34909
+ return EXIT_ALLOW32;
34709
34910
  }
34710
34911
  state.iterations += 1;
34711
34912
  state.last_turn = turnOrdinal;
34712
34913
  state.history.push(scan.open);
34713
34914
  state.last_engaged_at = (/* @__PURE__ */ new Date()).toISOString();
34714
34915
  if (!writeState5(stateFile4, state)) {
34715
- return EXIT_ALLOW31;
34916
+ return EXIT_ALLOW32;
34716
34917
  }
34717
34918
  appendEvent2(workspaceRoot3, {
34718
34919
  event: "engage",
@@ -34741,18 +34942,18 @@ function _isCliEntry48() {
34741
34942
  return false;
34742
34943
  }
34743
34944
  if (process.argv[1] === void 0) return false;
34744
- const argvUrl = pathToFileURL54(path92.resolve(process.argv[1])).href;
34945
+ const argvUrl = pathToFileURL55(path93.resolve(process.argv[1])).href;
34745
34946
  if (import.meta.url === argvUrl) return true;
34746
34947
  try {
34747
- const here = fs91.realpathSync(fileURLToPath60(import.meta.url));
34748
- const argv = fs91.realpathSync(path92.resolve(process.argv[1]));
34948
+ const here = fs92.realpathSync(fileURLToPath61(import.meta.url));
34949
+ const argv = fs92.realpathSync(path93.resolve(process.argv[1]));
34749
34950
  return here === argv;
34750
34951
  } catch {
34751
34952
  return false;
34752
34953
  }
34753
34954
  }
34754
34955
  if (_isCliEntry48()) {
34755
- process.exit(main59());
34956
+ process.exit(main60());
34756
34957
  }
34757
34958
 
34758
34959
  // src/scripts/hooks/concern_registry.ts
@@ -34790,24 +34991,25 @@ var CONCERN_REGISTRY = {
34790
34991
  "src/scripts/hooks/design_pass_hook.ts": main38,
34791
34992
  "src/scripts/hooks/design_slop_hook.ts": main39,
34792
34993
  "src/scripts/hooks/code_graph_nudge_hook.ts": main40,
34793
- "src/scripts/hooks/ui_route_nudge_hook.ts": main41,
34794
- "src/scripts/hooks/orchestration_record_hook.ts": main43,
34994
+ "src/scripts/hooks/suggestion_capture_hook.ts": main41,
34995
+ "src/scripts/hooks/ui_route_nudge_hook.ts": main42,
34996
+ "src/scripts/hooks/orchestration_record_hook.ts": main44,
34795
34997
  "src/scripts/hooks/telemetry_usage_hook.ts": main25,
34796
- "src/scripts/hooks/telemetry_flush_hook.ts": main44,
34797
- "src/scripts/hooks/delegation_nudge_hook.ts": main45,
34798
- "src/scripts/hooks/skill_route_hook.ts": main47,
34799
- "src/scripts/hooks/rule_inject_hook.ts": main48,
34800
- "src/scripts/hooks/end_review_nudge_hook.ts": main49,
34801
- "src/scripts/hooks/turn_end_gate_hook.ts": main51,
34802
- "src/scripts/hooks/edit_shape_hook.ts": main52,
34803
- "src/scripts/hooks/reread_guard_hook.ts": main53,
34804
- "src/scripts/hooks/session_eol_hook.ts": main54,
34805
- "src/scripts/hooks/subagent_ledger_hook.ts": main50,
34806
- "src/scripts/hooks/tool_result_bytes_hook.ts": main55,
34807
- "src/scripts/hooks/spawn_guard_shadow_hook.ts": main56,
34808
- "src/scripts/hooks/source_first_gate_hook.ts": main57,
34809
- "src/scripts/hooks/interruption_ledger_hook.ts": main58,
34810
- "src/scripts/hooks/run_continuation_hook.ts": main59
34998
+ "src/scripts/hooks/telemetry_flush_hook.ts": main45,
34999
+ "src/scripts/hooks/delegation_nudge_hook.ts": main46,
35000
+ "src/scripts/hooks/skill_route_hook.ts": main48,
35001
+ "src/scripts/hooks/rule_inject_hook.ts": main49,
35002
+ "src/scripts/hooks/end_review_nudge_hook.ts": main50,
35003
+ "src/scripts/hooks/turn_end_gate_hook.ts": main52,
35004
+ "src/scripts/hooks/edit_shape_hook.ts": main53,
35005
+ "src/scripts/hooks/reread_guard_hook.ts": main54,
35006
+ "src/scripts/hooks/session_eol_hook.ts": main55,
35007
+ "src/scripts/hooks/subagent_ledger_hook.ts": main51,
35008
+ "src/scripts/hooks/tool_result_bytes_hook.ts": main56,
35009
+ "src/scripts/hooks/spawn_guard_shadow_hook.ts": main57,
35010
+ "src/scripts/hooks/source_first_gate_hook.ts": main58,
35011
+ "src/scripts/hooks/interruption_ledger_hook.ts": main59,
35012
+ "src/scripts/hooks/run_continuation_hook.ts": main60
34811
35013
  };
34812
35014
 
34813
35015
  // src/scripts/hooks/stdin_failure_policy.ts
@@ -34907,12 +35109,12 @@ function _py_json_dumps2(value, indent) {
34907
35109
 
34908
35110
  // src/scripts/hooks/dispatch_hook.ts
34909
35111
  var _IN_BUNDLE = true;
34910
- var REPO_ROOT = path93.resolve(
34911
- path93.dirname(fileURLToPath61(import.meta.url)),
35112
+ var REPO_ROOT = path94.resolve(
35113
+ path94.dirname(fileURLToPath62(import.meta.url)),
34912
35114
  ..._IN_BUNDLE ? ["..", ".."] : ["..", "..", ".."]
34913
35115
  );
34914
- var MANIFEST_PATH = path93.join(REPO_ROOT, "src", "scripts", "hook_manifest.yaml");
34915
- var EXIT_ALLOW32 = 0;
35116
+ var MANIFEST_PATH = path94.join(REPO_ROOT, "src", "scripts", "hook_manifest.yaml");
35117
+ var EXIT_ALLOW33 = 0;
34916
35118
  var EXIT_BLOCK6 = 1;
34917
35119
  var EXIT_WARN17 = 2;
34918
35120
  var EVENT_VOCABULARY = /* @__PURE__ */ new Set([
@@ -34928,7 +35130,7 @@ var EVENT_VOCABULARY = /* @__PURE__ */ new Set([
34928
35130
  "subagent_stop"
34929
35131
  ]);
34930
35132
  var _SEVERITY_BY_EXIT = {
34931
- [EXIT_ALLOW32]: "allow",
35133
+ [EXIT_ALLOW33]: "allow",
34932
35134
  [EXIT_BLOCK6]: "block",
34933
35135
  [EXIT_WARN17]: "warn"
34934
35136
  };
@@ -34973,11 +35175,11 @@ function _manifest_fingerprint(text) {
34973
35175
  return `${h.toString(16)}:${String(text.length)}`;
34974
35176
  }
34975
35177
  function _load_yaml3(p) {
34976
- const text = fs92.readFileSync(p, "utf-8");
35178
+ const text = fs93.readFileSync(p, "utf-8");
34977
35179
  const compiled = p.replace(/\.ya?ml$/u, ".json");
34978
35180
  if (compiled !== p) {
34979
35181
  try {
34980
- const raw = JSON.parse(fs92.readFileSync(compiled, "utf-8"));
35182
+ const raw = JSON.parse(fs93.readFileSync(compiled, "utf-8"));
34981
35183
  if (_isObject16(raw) && raw["fingerprint"] === _manifest_fingerprint(text) && _isObject16(raw["manifest"])) {
34982
35184
  return raw["manifest"];
34983
35185
  }
@@ -35083,7 +35285,7 @@ function _maybe_capture_payload(args, payload_text) {
35083
35285
  }
35084
35286
  try {
35085
35287
  const target = _expanduser3(capture_dir);
35086
- fs92.mkdirSync(target, { recursive: true });
35288
+ fs93.mkdirSync(target, { recursive: true });
35087
35289
  let payload;
35088
35290
  try {
35089
35291
  payload = payload_text.trim() ? JSON.parse(payload_text) : {};
@@ -35100,8 +35302,8 @@ function _maybe_capture_payload(args, payload_text) {
35100
35302
  const ts = Date.now();
35101
35303
  const native = (args.native_event || args.event).replace(/\//g, "_");
35102
35304
  const fname = `${args.platform}__${native}__${ts}__${process.pid}.json`;
35103
- fs92.writeFileSync(
35104
- path93.join(target, fname),
35305
+ fs93.writeFileSync(
35306
+ path94.join(target, fname),
35105
35307
  _py_json_dumps2(record, 2) + "\n",
35106
35308
  { encoding: "utf-8" }
35107
35309
  );
@@ -35112,7 +35314,7 @@ function _maybe_capture_payload(args, payload_text) {
35112
35314
  function _expanduser3(p) {
35113
35315
  if (p === "~" || p.startsWith("~/")) {
35114
35316
  const home = process.env["HOME"] || process.env["USERPROFILE"] || "";
35115
- return path93.join(home, p.slice(1));
35317
+ return path94.join(home, p.slice(1));
35116
35318
  }
35117
35319
  return p;
35118
35320
  }
@@ -35144,25 +35346,25 @@ function _resolve_tsx_invocation2(scriptPath, scriptArgs) {
35144
35346
  const walkUp = (start) => {
35145
35347
  let dir = start;
35146
35348
  for (; ; ) {
35147
- const candidate = path93.join(dir, "node_modules", ".bin", binName);
35349
+ const candidate = path94.join(dir, "node_modules", ".bin", binName);
35148
35350
  if (_isFile8(candidate)) {
35149
35351
  return candidate;
35150
35352
  }
35151
- const parent = path93.dirname(dir);
35353
+ const parent = path94.dirname(dir);
35152
35354
  if (parent === dir) {
35153
35355
  return null;
35154
35356
  }
35155
35357
  dir = parent;
35156
35358
  }
35157
35359
  };
35158
- const tsx = walkUp(path93.dirname(scriptPath)) ?? walkUp(path93.dirname(fileURLToPath61(import.meta.url)));
35360
+ const tsx = walkUp(path94.dirname(scriptPath)) ?? walkUp(path94.dirname(fileURLToPath62(import.meta.url)));
35159
35361
  if (tsx !== null) {
35160
35362
  return { command: tsx, args: [scriptPath, ...scriptArgs] };
35161
35363
  }
35162
35364
  return { command: "npx", args: ["tsx", scriptPath, ...scriptArgs] };
35163
35365
  }
35164
35366
  function _run_concern_inproc(main_fn, concern, envelope) {
35165
- const scriptAbs = path93.join(REPO_ROOT, String(concern["script"]));
35367
+ const scriptAbs = path94.join(REPO_ROOT, String(concern["script"]));
35166
35368
  const argsList = Array.isArray(concern["args"]) ? concern["args"].map((a) => String(a)) : [];
35167
35369
  argsList.push("--platform", String(envelope["platform"] || "generic"));
35168
35370
  const workspace = String(envelope["workspace_root"] || process.cwd());
@@ -35239,7 +35441,7 @@ function _run_concern(concern, envelope) {
35239
35441
  return _run_concern_inproc(inproc, concern, envelope);
35240
35442
  }
35241
35443
  }
35242
- const script = path93.join(REPO_ROOT, String(concern["script"]));
35444
+ const script = path94.join(REPO_ROOT, String(concern["script"]));
35243
35445
  const argsList = Array.isArray(concern["args"]) ? concern["args"].map((a) => String(a)) : [];
35244
35446
  const cmd = [script, ...argsList];
35245
35447
  cmd.push("--platform", String(envelope["platform"] || "generic"));
@@ -35296,7 +35498,7 @@ function _run_concern(concern, envelope) {
35296
35498
  }
35297
35499
  function _isFile8(p) {
35298
35500
  try {
35299
- return fs92.statSync(p).isFile();
35501
+ return fs93.statSync(p).isFile();
35300
35502
  } catch {
35301
35503
  return false;
35302
35504
  }
@@ -35311,17 +35513,17 @@ function _reduce(rcs) {
35311
35513
  if (rcs.some((rc) => rc === EXIT_WARN17)) {
35312
35514
  return EXIT_WARN17;
35313
35515
  }
35314
- return EXIT_ALLOW32;
35516
+ return EXIT_ALLOW33;
35315
35517
  }
35316
35518
  function _write_feedback(envelope, session_id, entries, final_rc, started_at) {
35317
35519
  if (is_replay_mode()) {
35318
35520
  return;
35319
35521
  }
35320
35522
  const workspace = String(envelope["workspace_root"] || process.cwd());
35321
- const state_root = path93.join(workspace, "agents", "runtime", "state");
35523
+ const state_root = path94.join(workspace, "agents", "runtime", "state");
35322
35524
  const fb_dir = feedback_dir(state_root, session_id);
35323
35525
  try {
35324
- fs92.mkdirSync(fb_dir, { recursive: true });
35526
+ fs93.mkdirSync(fb_dir, { recursive: true });
35325
35527
  } catch (exc) {
35326
35528
  const msg = exc instanceof Error ? exc.message : String(exc);
35327
35529
  process.stderr.write(`dispatch_hook: feedback dir unavailable: ${msg}
@@ -35329,7 +35531,7 @@ function _write_feedback(envelope, session_id, entries, final_rc, started_at) {
35329
35531
  return;
35330
35532
  }
35331
35533
  for (const entry of entries) {
35332
- const target = path93.join(fb_dir, `${entry["concern"]}.json`);
35534
+ const target = path94.join(fb_dir, `${entry["concern"]}.json`);
35333
35535
  try {
35334
35536
  atomic_write_json(target, entry);
35335
35537
  } catch (exc) {
@@ -35378,7 +35580,7 @@ function _write_feedback(envelope, session_id, entries, final_rc, started_at) {
35378
35580
  };
35379
35581
  try {
35380
35582
  const invocation = `${String(process.pid)}-${process.hrtime.bigint().toString()}`;
35381
- update_json_under_lock(path93.join(fb_dir, "summary.json"), (loaded) => {
35583
+ update_json_under_lock(path94.join(fb_dir, "summary.json"), (loaded) => {
35382
35584
  const priorRaw = loaded["invocations"];
35383
35585
  const prior = Array.isArray(priorRaw) ? priorRaw : [];
35384
35586
  const next = [...prior, { invocation, ...summary }];
@@ -35405,8 +35607,8 @@ function _record_rule_trips(envelope, entries) {
35405
35607
  if (tripped.length === 0) return;
35406
35608
  try {
35407
35609
  const workspace = String(envelope["workspace_root"] || process.cwd());
35408
- const state_dir = path93.join(workspace, "agents", "runtime", "state");
35409
- const target = path93.join(state_dir, "rule-trips.json");
35610
+ const state_dir = path94.join(workspace, "agents", "runtime", "state");
35611
+ const target = path94.join(state_dir, "rule-trips.json");
35410
35612
  const today = _now_iso3().slice(0, 10);
35411
35613
  update_json_under_lock(target, (loaded) => {
35412
35614
  const doc = { schema_version: 1, concerns: {}, ...loaded };
@@ -35511,7 +35713,7 @@ function _parse_args(argv) {
35511
35713
  }
35512
35714
  return args;
35513
35715
  }
35514
- function main60(argv) {
35716
+ function main61(argv) {
35515
35717
  const args = _parse_args(argv ?? process.argv.slice(2));
35516
35718
  if (args.project_dir) {
35517
35719
  const project_dir = _expanduser3(args.project_dir);
@@ -35529,27 +35731,27 @@ function main60(argv) {
35529
35731
  if (probe.failure !== null) {
35530
35732
  process.stderr.write(`dispatch_hook: --read-exit read failed: ${probe.failure}
35531
35733
  `);
35532
- return EXIT_ALLOW32;
35734
+ return EXIT_ALLOW33;
35533
35735
  }
35534
35736
  const envelope2 = _build_envelope(args, probe.text);
35535
35737
  process.stderr.write(
35536
35738
  `dispatch_hook: --read-exit ok (${probe.text.length} chars, ${Object.keys(_isObject16(envelope2["payload"]) ? envelope2["payload"] : {}).length} payload keys)
35537
35739
  `
35538
35740
  );
35539
- return EXIT_ALLOW32;
35741
+ return EXIT_ALLOW33;
35540
35742
  }
35541
35743
  if (!EVENT_VOCABULARY.has(args.event)) {
35542
35744
  process.stderr.write(
35543
35745
  `dispatch_hook: unknown event '${args.event}'; allowed: ${_sortedRepr(EVENT_VOCABULARY)}
35544
35746
  `
35545
35747
  );
35546
- return EXIT_ALLOW32;
35748
+ return EXIT_ALLOW33;
35547
35749
  }
35548
35750
  const manifest_path = args.manifest;
35549
- if (!fs92.existsSync(manifest_path)) {
35751
+ if (!fs93.existsSync(manifest_path)) {
35550
35752
  process.stderr.write(`dispatch_hook: manifest missing at ${manifest_path}
35551
35753
  `);
35552
- return EXIT_ALLOW32;
35754
+ return EXIT_ALLOW33;
35553
35755
  }
35554
35756
  const manifest = _load_yaml3(manifest_path);
35555
35757
  if (args.min_version) {
@@ -35595,10 +35797,10 @@ function main60(argv) {
35595
35797
  concerns: concerns.map((c) => c["name"])
35596
35798
  };
35597
35799
  process.stdout.write(_py_json_dumps2(plan, 2) + "\n");
35598
- return EXIT_ALLOW32;
35800
+ return EXIT_ALLOW33;
35599
35801
  }
35600
35802
  if (concerns.length === 0) {
35601
- return EXIT_ALLOW32;
35803
+ return EXIT_ALLOW33;
35602
35804
  }
35603
35805
  if (_stdin_read_failed !== null) {
35604
35806
  const deny = denyOnStdinFailure(args.platform, args.event, concerns, _stdin_read_failed);
@@ -35637,7 +35839,7 @@ function main60(argv) {
35637
35839
  const raw_rc = rc;
35638
35840
  if (rc >= 3) {
35639
35841
  if (!concern["fail_closed"]) {
35640
- rc = EXIT_ALLOW32;
35842
+ rc = EXIT_ALLOW33;
35641
35843
  } else {
35642
35844
  rc = EXIT_BLOCK6;
35643
35845
  }
@@ -35660,7 +35862,7 @@ function main60(argv) {
35660
35862
  if (message) {
35661
35863
  concern_messages.push({ rc, text: message, def: concern });
35662
35864
  }
35663
- if (args.event === "session_start" && rc === EXIT_ALLOW32 && typeof reply["context"] === "string" && reply["context"].trim()) {
35865
+ if (args.event === "session_start" && rc === EXIT_ALLOW33 && typeof reply["context"] === "string" && reply["context"].trim()) {
35664
35866
  context_blocks.push(reply["context"].trim());
35665
35867
  }
35666
35868
  feedback_entries.push({
@@ -35688,7 +35890,7 @@ function main60(argv) {
35688
35890
  const final_rc = _reduce(rcs);
35689
35891
  _write_feedback(envelope, session_id, feedback_entries, final_rc, started_at);
35690
35892
  _record_rule_trips(envelope, feedback_entries);
35691
- if (context_blocks.length > 0 && final_rc === EXIT_ALLOW32) {
35893
+ if (context_blocks.length > 0 && final_rc === EXIT_ALLOW33) {
35692
35894
  process.stdout.write(context_blocks.join("\n\n") + "\n");
35693
35895
  }
35694
35896
  const decidingReasons = shapeAndRecord(
@@ -35713,7 +35915,7 @@ function main60(argv) {
35713
35915
  }
35714
35916
  function _isDir4(p) {
35715
35917
  try {
35716
- return fs92.statSync(p).isDirectory();
35918
+ return fs93.statSync(p).isDirectory();
35717
35919
  } catch {
35718
35920
  return false;
35719
35921
  }
@@ -35730,29 +35932,29 @@ function _isCliEntry49() {
35730
35932
  if (process.argv[1] === void 0) {
35731
35933
  return false;
35732
35934
  }
35733
- const argvUrl = pathToFileURL55(path93.resolve(process.argv[1])).href;
35935
+ const argvUrl = pathToFileURL56(path94.resolve(process.argv[1])).href;
35734
35936
  if (import.meta.url === argvUrl) {
35735
35937
  return true;
35736
35938
  }
35737
35939
  try {
35738
- const here = fs92.realpathSync(fileURLToPath61(import.meta.url));
35739
- const argv = fs92.realpathSync(path93.resolve(process.argv[1]));
35940
+ const here = fs93.realpathSync(fileURLToPath62(import.meta.url));
35941
+ const argv = fs93.realpathSync(path94.resolve(process.argv[1]));
35740
35942
  return here === argv;
35741
35943
  } catch {
35742
35944
  return false;
35743
35945
  }
35744
35946
  }
35745
- var isCliEntry13 = _isCliEntry49();
35746
- if (isCliEntry13) {
35747
- process.exit(main60(process.argv.slice(2)));
35947
+ var isCliEntry14 = _isCliEntry49();
35948
+ if (isCliEntry14) {
35949
+ process.exit(main61(process.argv.slice(2)));
35748
35950
  }
35749
35951
 
35750
35952
  // src/scripts/hooks/dispatch_entry.ts
35751
- var _selfPath = fileURLToPath62(import.meta.url);
35752
- var _invokedDirectly2 = globalThis.__AC_HOOKS_BUNDLE_DIRECT === true || process.argv[1] !== void 0 && path94.resolve(process.argv[1]) === path94.resolve(_selfPath);
35953
+ var _selfPath = fileURLToPath63(import.meta.url);
35954
+ var _invokedDirectly2 = globalThis.__AC_HOOKS_BUNDLE_DIRECT === true || process.argv[1] !== void 0 && path95.resolve(process.argv[1]) === path95.resolve(_selfPath);
35753
35955
  if (_invokedDirectly2) {
35754
- process.exitCode = main60(process.argv.slice(2));
35956
+ process.exitCode = main61(process.argv.slice(2));
35755
35957
  }
35756
35958
  export {
35757
- main60 as main
35959
+ main61 as main
35758
35960
  };