@event4u/agent-config 16.4.0 → 17.0.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 (1052) hide show
  1. package/.augment-plugin/marketplace.json +3 -3
  2. package/.augment-plugin/plugin.json +1 -1
  3. package/.claude-plugin/marketplace.json +2 -2
  4. package/.claude-plugin/skills/install-agent-config/SKILL.md +4 -4
  5. package/CHANGELOG.md +483 -669
  6. package/CONTRIBUTING.md +47 -0
  7. package/README.md +25 -25
  8. package/dist/agent-src/commands/{design.md → agent-design.md} +11 -7
  9. package/dist/agent-src/commands/agents/init.md +66 -3
  10. package/dist/agent-src/commands/agents/user/init.md +3 -0
  11. package/dist/agent-src/commands/{optimize/deep.md → analyze/and-optimize.md} +72 -33
  12. package/dist/agent-src/commands/analyze/inbox.md +168 -37
  13. package/dist/agent-src/commands/analyze/pr.md +144 -0
  14. package/dist/agent-src/commands/analyze/{repo.md → reference.md} +85 -14
  15. package/dist/agent-src/commands/analyze/roadmap-repos.md +19 -10
  16. package/dist/agent-src/commands/analyze.md +28 -12
  17. package/dist/agent-src/commands/audit.md +115 -0
  18. package/dist/agent-src/commands/brand/review.md +13 -2
  19. package/dist/agent-src/commands/brand/tokens.md +3 -3
  20. package/dist/agent-src/commands/brand/voice.md +8 -5
  21. package/dist/agent-src/commands/brand.md +2 -2
  22. package/dist/agent-src/commands/challenge-me/closure.md +25 -0
  23. package/dist/agent-src/commands/design-system/import.md +8 -3
  24. package/dist/agent-src/commands/design-system/sync.md +98 -0
  25. package/dist/agent-src/commands/design-system.md +6 -1
  26. package/dist/agent-src/commands/evals/analyze.json +44 -0
  27. package/dist/agent-src/commands/evals/audit.json +12 -0
  28. package/dist/agent-src/commands/evals/retro.json +12 -0
  29. package/dist/agent-src/commands/fix/ci.md +10 -8
  30. package/dist/agent-src/commands/ghostwriter/write.md +22 -0
  31. package/dist/agent-src/commands/memory/learn-low-impact.md +70 -83
  32. package/dist/agent-src/commands/memory/propose.md +12 -0
  33. package/dist/agent-src/commands/memory.md +1 -1
  34. package/dist/agent-src/commands/optimize.md +4 -3
  35. package/dist/agent-src/commands/post-as/me.md +18 -0
  36. package/dist/agent-src/commands/pr/create.md +17 -342
  37. package/dist/agent-src/commands/pr/merge.md +129 -368
  38. package/dist/agent-src/commands/retro.md +121 -0
  39. package/dist/agent-src/commands/review/routing.md +1 -1
  40. package/dist/agent-src/commands/roadmap/next.md +4 -1
  41. package/dist/agent-src/commands/roadmap/process-full.md +46 -333
  42. package/dist/agent-src/commands/roadmap/triage-parked.md +6 -2
  43. package/dist/agent-src/commands/team-knowledge/consolidate.md +2 -2
  44. package/dist/agent-src/commands/team-knowledge.md +1 -1
  45. package/dist/agent-src/commands/threat-model.md +1 -1
  46. package/dist/agent-src/commands/upstream-contribute.md +91 -101
  47. package/dist/agent-src/commands/worktree/cleanup.md +18 -11
  48. package/dist/agent-src/contexts/contracts/consumer-agents-md-guide.md +54 -0
  49. package/dist/agent-src/contexts/execution/analysis-loop.md +137 -0
  50. package/dist/agent-src/contexts/execution/auto-dispatch-classification.md +3 -3
  51. package/dist/agent-src/contexts/execution/decision-closure-execution.md +1 -1
  52. package/dist/agent-src/contexts/execution/host-capability-manifest.md +6 -0
  53. package/dist/agent-src/contexts/execution/orchestration-telemetry.md +11 -4
  54. package/dist/agent-src/contexts/execution/pr-create-branches-content.md +250 -0
  55. package/dist/agent-src/contexts/execution/pr-create-branches-freshness.md +150 -0
  56. package/dist/agent-src/contexts/execution/pr-merge-queue.md +287 -0
  57. package/dist/agent-src/contexts/execution/pr-merge-sync.md +276 -0
  58. package/dist/agent-src/contexts/execution/pr-merge-trust-boundary.md +69 -0
  59. package/dist/agent-src/contexts/execution/process-full-all.md +233 -0
  60. package/dist/agent-src/contexts/execution/process-full-delivery.md +231 -0
  61. package/dist/agent-src/contexts/execution/roadmap-execution-contract-branches.md +42 -0
  62. package/dist/agent-src/contexts/execution/roadmap-execution-contract.md +1 -35
  63. package/dist/agent-src/contexts/execution/roadmap-process-loop-close.md +235 -0
  64. package/dist/agent-src/contexts/execution/roadmap-process-loop-prescan.md +216 -0
  65. package/dist/agent-src/contexts/execution/roadmap-process-loop-run.md +253 -0
  66. package/dist/agent-src/contexts/execution/roadmap-process-loop-set.md +212 -0
  67. package/dist/agent-src/contexts/execution/roadmap-process-loop.md +25 -864
  68. package/dist/agent-src/contexts/execution/subagent-spawn-contract.md +14 -2
  69. package/dist/agent-src/contexts/execution/subagent-steering.md +65 -8
  70. package/dist/agent-src/contexts/model-recommendations.md +5 -5
  71. package/dist/agent-src/contexts/subagent-configuration.md +1 -1
  72. package/dist/agent-src/guidelines/agent-infra/api-cost-levers.md +4 -3
  73. package/dist/agent-src/guidelines/agent-infra/model-recommendation.md +11 -5
  74. package/dist/agent-src/guidelines/agent-infra/rule-body-migration-inventory.md +1 -1
  75. package/dist/agent-src/guidelines/agent-infra/self-improvement-pipeline.md +47 -24
  76. package/dist/agent-src/guidelines/design-antipatterns.md +6 -1
  77. package/dist/agent-src/guidelines/design-asset-discipline.md +17 -0
  78. package/dist/agent-src/guidelines/design-fidelity-routing.md +1 -0
  79. package/dist/agent-src/guidelines/php/api-design.md +10 -1
  80. package/dist/agent-src/rules/brand-source-of-truth.md +7 -6
  81. package/dist/agent-src/rules/code-provenance.md +1 -1
  82. package/dist/agent-src/rules/context-hygiene.md +0 -1
  83. package/dist/agent-src/rules/design-fidelity.md +12 -13
  84. package/dist/agent-src/rules/external-reference-deep-dive.md +2 -2
  85. package/dist/agent-src/rules/fix-what-you-see.md +1 -1
  86. package/dist/agent-src/rules/low-impact-corpus-privacy-floor.md +14 -15
  87. package/dist/agent-src/rules/missing-skill-recovery.md +12 -11
  88. package/dist/agent-src/rules/neighbour-precedence.md +1 -1
  89. package/dist/agent-src/rules/recurring-criticism.md +1 -1
  90. package/dist/agent-src/rules/roadmap-ci-steps-policy.md +0 -2
  91. package/dist/agent-src/rules/self-repair-loop.md +2 -2
  92. package/dist/agent-src/rules/token-budget-discipline.md +2 -2
  93. package/dist/agent-src/scripts/dashboard_mode.ts +4 -1
  94. package/dist/agent-src/scripts/roadmap_age.ts +175 -0
  95. package/dist/agent-src/scripts/update_roadmap_progress.ts +10 -2
  96. package/dist/agent-src/skills/accessibility-auditor/SKILL.md +3 -3
  97. package/dist/agent-src/skills/accessibility-auditor/data/aria-patterns.csv +2 -0
  98. package/dist/agent-src/skills/accessibility-auditor/data/manifest.json +3 -3
  99. package/dist/agent-src/skills/agent-security-review/SKILL.md +2 -2
  100. package/dist/agent-src/skills/agents-md-thin-root/SKILL.md +12 -4
  101. package/dist/agent-src/skills/ai-code-blindspots/SKILL.md +7 -0
  102. package/dist/agent-src/skills/ai-council/references/advanced-modes.md +11 -1
  103. package/dist/agent-src/skills/ai-council/references/cost-and-redaction.md +7 -0
  104. package/dist/agent-src/skills/ai-council/references/execution-modes.md +7 -0
  105. package/dist/agent-src/skills/ai-council/references/output-and-synthesis.md +19 -0
  106. package/dist/agent-src/skills/ai-council/references/procedure.md +7 -0
  107. package/dist/agent-src/skills/api-design/SKILL.md +2 -2
  108. package/dist/agent-src/skills/api-endpoint/SKILL.md +2 -2
  109. package/dist/agent-src/skills/authz-review/SKILL.md +5 -3
  110. package/dist/agent-src/skills/blade-ui/SKILL.md +2 -2
  111. package/dist/agent-src/skills/brand/SKILL.md +7 -3
  112. package/dist/agent-src/skills/brand-asset-generation/SKILL.md +13 -6
  113. package/dist/agent-src/skills/brand-audit/SKILL.md +2 -1
  114. package/dist/agent-src/skills/brand-identity/SKILL.md +5 -4
  115. package/dist/agent-src/skills/brand-strategy/SKILL.md +5 -4
  116. package/dist/agent-src/skills/brand-to-tokens/SKILL.md +18 -39
  117. package/dist/agent-src/skills/brand-to-tokens/templates/marp-brand-deck.md.example +2 -2
  118. package/dist/agent-src/skills/brand-to-tokens/templates/reveal-brand-deck.yaml +2 -2
  119. package/dist/agent-src/skills/canvas-design/SKILL.md +16 -4
  120. package/dist/agent-src/skills/competitive-positioning/SKILL.md +2 -2
  121. package/dist/agent-src/skills/composer-packages/SKILL.md +18 -0
  122. package/dist/agent-src/skills/condense-memory/SKILL.md +1 -1
  123. package/dist/agent-src/skills/content-funnel-design/SKILL.md +8 -1
  124. package/dist/agent-src/skills/context-authoring/SKILL.md +1 -1
  125. package/dist/agent-src/skills/context-document/SKILL.md +2 -2
  126. package/dist/agent-src/skills/corpus-grounding/SKILL.md +6 -6
  127. package/dist/agent-src/skills/corpus-grounding/scripts/decision_engine.ts +13 -11
  128. package/dist/agent-src/skills/corpus-grounding/scripts/ground.mjs +1706 -0
  129. package/dist/agent-src/skills/corpus-grounding/scripts/schema_validator.ts +7 -1
  130. package/dist/agent-src/skills/dashboard-design/SKILL.md +1 -1
  131. package/dist/agent-src/skills/data-flow-mapper/SKILL.md +5 -2
  132. package/dist/agent-src/skills/database/SKILL.md +5 -4
  133. package/dist/agent-src/skills/decision-record/references/weighted-matrix.md +12 -0
  134. package/dist/agent-src/skills/deep-reading-analyst/SKILL.md +1 -1
  135. package/dist/agent-src/skills/dependency-upgrade/SKILL.md +61 -11
  136. package/dist/agent-src/skills/description-assist/SKILL.md +1 -1
  137. package/dist/agent-src/skills/design-intelligence/SKILL.md +1 -1
  138. package/dist/agent-src/skills/design-intelligence/data/landing.csv +1 -1
  139. package/dist/agent-src/skills/design-intelligence/references/context-and-registers.md +10 -2
  140. package/dist/agent-src/skills/design-intelligence/references/design-languages.md +1 -1
  141. package/dist/agent-src/skills/design-intelligence/references/design-rules-checklist.md +4 -3
  142. package/dist/agent-src/skills/design-intelligence/references/integration-mapping.md +25 -22
  143. package/dist/agent-src/skills/{wireframe → design-review}/references/story-beat-ledger.schema.json +1 -1
  144. package/dist/agent-src/skills/design-review/references/verification-automation.md +11 -3
  145. package/dist/agent-src/skills/design-system-capture/SKILL.md +15 -10
  146. package/dist/agent-src/skills/design-system-capture/references/design-system-json.md +20 -5
  147. package/dist/agent-src/skills/design-system-capture/references/import-procedure.md +2 -2
  148. package/dist/agent-src/skills/design-tokens/SKILL.md +23 -23
  149. package/dist/agent-src/skills/design-tokens/scripts/tokens.mjs +1037 -0
  150. package/dist/agent-src/skills/design-tokens/scripts/tokens.ts +336 -13
  151. package/dist/agent-src/skills/design-tokens/templates/design-tokens-starter.json +52 -53
  152. package/dist/agent-src/skills/docker/SKILL.md +1 -1
  153. package/dist/agent-src/skills/estimate-ticket/SKILL.md +1 -1
  154. package/dist/agent-src/skills/existing-ui-audit/SKILL.md +14 -276
  155. package/dist/agent-src/skills/existing-ui-audit/procedure.yaml +44 -0
  156. package/dist/agent-src/skills/existing-ui-audit/references/anti-slop-cross-reference.md +1 -1
  157. package/dist/agent-src/skills/existing-ui-audit/references/steps/00-inspect-stack-and-input.md +4 -0
  158. package/dist/agent-src/skills/existing-ui-audit/references/steps/01-enumerate-components.md +26 -0
  159. package/dist/agent-src/skills/existing-ui-audit/references/steps/01b-detect-component-taxonomy.md +7 -0
  160. package/dist/agent-src/skills/existing-ui-audit/references/steps/02-identify-design-system.md +12 -0
  161. package/dist/agent-src/skills/existing-ui-audit/references/steps/03-detect-design-tokens.md +35 -0
  162. package/dist/agent-src/skills/existing-ui-audit/references/steps/04-detect-shadcn-inventory.md +13 -0
  163. package/dist/agent-src/skills/existing-ui-audit/references/steps/04b-live-storybook-read.md +26 -0
  164. package/dist/agent-src/skills/existing-ui-audit/references/steps/05-list-reusable-patterns.md +14 -0
  165. package/dist/agent-src/skills/existing-ui-audit/references/steps/06-match-candidates.md +52 -0
  166. package/dist/agent-src/skills/existing-ui-audit/references/steps/07-greenfield-branch.md +29 -0
  167. package/dist/agent-src/skills/existing-ui-audit/references/steps/08-a11y-baseline.md +40 -0
  168. package/dist/agent-src/skills/existing-ui-audit/references/steps/09-validate-and-write.md +5 -0
  169. package/dist/agent-src/skills/experiment-loop/SKILL.md +1 -1
  170. package/dist/agent-src/skills/fe-design/references/design-patterns.md +65 -4
  171. package/dist/agent-src/skills/fe-design/references/design-read-and-memory.md +1 -1
  172. package/dist/agent-src/skills/fe-design/references/source-led-port.md +1 -1
  173. package/dist/agent-src/skills/finishing-a-development-branch/SKILL.md +6 -6
  174. package/dist/agent-src/skills/flux/SKILL.md +1 -1
  175. package/dist/agent-src/skills/form-handler/SKILL.md +15 -2
  176. package/dist/agent-src/skills/frontend-render-security/SKILL.md +9 -0
  177. package/dist/agent-src/skills/git-workflow/SKILL.md +2 -2
  178. package/dist/agent-src/skills/git-workflow/references/branch-update.md +7 -0
  179. package/dist/agent-src/skills/git-workflow/references/commit-subject.md +12 -0
  180. package/dist/agent-src/skills/git-workflow/references/push-closes-its-loop.md +10 -0
  181. package/dist/agent-src/skills/gtm-launch/SKILL.md +8 -1
  182. package/dist/agent-src/skills/html-deck/SKILL.md +7 -2
  183. package/dist/agent-src/skills/humanizer/SKILL.md +16 -3
  184. package/dist/agent-src/skills/humanizer/references/anti-aiisms.md +13 -1
  185. package/dist/agent-src/skills/humanizer/references/fixtures.md +8 -0
  186. package/dist/agent-src/skills/iconography/SKILL.md +4 -2
  187. package/dist/agent-src/skills/image-provider-routing/SKILL.md +16 -5
  188. package/dist/agent-src/skills/js-library-packaging/SKILL.md +5 -4
  189. package/dist/agent-src/skills/js-library-packaging/scripts/check_package_surface.mjs +197 -0
  190. package/dist/agent-src/skills/judge-artifact-completeness/SKILL.md +1 -1
  191. package/dist/agent-src/skills/judge-security-auditor/SKILL.md +2 -2
  192. package/dist/agent-src/skills/launch-readiness/SKILL.md +18 -22
  193. package/dist/agent-src/skills/learning-to-rule-or-skill/SKILL.md +5 -5
  194. package/dist/agent-src/skills/livewire/SKILL.md +1 -1
  195. package/dist/agent-src/skills/llm-provider-knowledge/SKILL.md +18 -0
  196. package/dist/agent-src/skills/logo-generation/SKILL.md +21 -11
  197. package/dist/agent-src/skills/market-entry-analysis/SKILL.md +6 -1
  198. package/dist/agent-src/skills/markitdown/SKILL.md +1 -1
  199. package/dist/agent-src/skills/memory-consolidation/SKILL.md +2 -2
  200. package/dist/agent-src/skills/messaging-architecture/SKILL.md +8 -1
  201. package/dist/agent-src/skills/motion-choreographer/SKILL.md +2 -2
  202. package/dist/agent-src/skills/playwright-testing/SKILL.md +2 -0
  203. package/dist/agent-src/skills/positioning-strategy/SKILL.md +10 -2
  204. package/dist/agent-src/skills/prediction-pool-optimizer/references/ev-fixtures.md +13 -0
  205. package/dist/agent-src/skills/prediction-pool-optimizer/references/odds-and-bonus.md +7 -0
  206. package/dist/agent-src/skills/project-analysis-core/SKILL.md +1 -1
  207. package/dist/agent-src/skills/project-analysis-hypothesis-driven/SKILL.md +1 -1
  208. package/dist/agent-src/skills/project-analyzer/SKILL.md +14 -75
  209. package/dist/agent-src/skills/project-analyzer/procedure.yaml +39 -0
  210. package/dist/agent-src/skills/project-analyzer/references/steps/01-project-overview.md +9 -0
  211. package/dist/agent-src/skills/project-analyzer/references/steps/02-architecture.md +7 -0
  212. package/dist/agent-src/skills/project-analyzer/references/steps/03-data-layer.md +6 -0
  213. package/dist/agent-src/skills/project-analyzer/references/steps/04-business-domains.md +7 -0
  214. package/dist/agent-src/skills/project-analyzer/references/steps/05-api-surface.md +6 -0
  215. package/dist/agent-src/skills/project-analyzer/references/steps/06-service-map.md +6 -0
  216. package/dist/agent-src/skills/project-analyzer/references/steps/07-module-inventory.md +6 -0
  217. package/dist/agent-src/skills/project-analyzer/references/steps/08-infrastructure-and-testing.md +5 -0
  218. package/dist/agent-src/skills/project-analyzer/references/steps/09-agent-docs-audit.md +6 -0
  219. package/dist/agent-src/skills/project-analyzer/references/steps/10-gap-analysis.md +6 -0
  220. package/dist/agent-src/skills/quality-tools/references/js-ts-tools.md +10 -0
  221. package/dist/agent-src/skills/quality-tools/references/php-tools.md +13 -0
  222. package/dist/agent-src/skills/quality-tools/references/python-tools.md +11 -0
  223. package/dist/agent-src/skills/react-native-setup/SKILL.md +7 -2
  224. package/dist/agent-src/skills/react-shadcn-ui/SKILL.md +5 -1
  225. package/dist/agent-src/skills/react-shadcn-ui/references/registry.md +13 -0
  226. package/dist/agent-src/skills/react-shadcn-ui/scripts/shadcn_add.mjs +315 -0
  227. package/dist/agent-src/skills/react-shadcn-ui/scripts/shadcn_add.ts +6 -6
  228. package/dist/agent-src/skills/receiving-code-review/SKILL.md +1 -1
  229. package/dist/agent-src/skills/refine-ticket/SKILL.md +2 -2
  230. package/dist/agent-src/skills/release-comms/SKILL.md +2 -1
  231. package/dist/agent-src/skills/repomix-packer/SKILL.md +2 -2
  232. package/dist/agent-src/skills/requesting-code-review/SKILL.md +3 -3
  233. package/dist/agent-src/skills/roadmap-management/references/archival.md +3 -3
  234. package/dist/agent-src/skills/roadmap-management/references/authoring.md +9 -2
  235. package/dist/agent-src/skills/roadmap-management/references/dashboard.md +3 -3
  236. package/dist/agent-src/skills/roadmap-management/references/lifecycle.md +3 -3
  237. package/dist/agent-src/skills/roadmap-writing/SKILL.md +4 -4
  238. package/dist/agent-src/skills/rtk-output-filtering/SKILL.md +1 -1
  239. package/dist/agent-src/skills/rule-writing/SKILL.md +1 -2
  240. package/dist/agent-src/skills/security/SKILL.md +41 -5
  241. package/dist/agent-src/skills/skill-improvement-pipeline/SKILL.md +5 -3
  242. package/dist/agent-src/skills/skill-reviewer/SKILL.md +1 -1
  243. package/dist/agent-src/skills/skill-writing/SKILL.md +23 -8
  244. package/dist/agent-src/skills/skill-writing/references/section-patterns.md +19 -1
  245. package/dist/agent-src/skills/source-discovery/SKILL.md +3 -3
  246. package/dist/agent-src/skills/sql-writing/SKILL.md +2 -2
  247. package/dist/agent-src/skills/standards-from-config/SKILL.md +2 -2
  248. package/dist/agent-src/skills/storybook-workshop/SKILL.md +5 -0
  249. package/dist/agent-src/skills/storybook-workshop/scripts/story_contrast_floor.mjs +99 -0
  250. package/dist/agent-src/skills/subagent-orchestration/SKILL.md +13 -13
  251. package/dist/agent-src/skills/subagent-orchestration/prompts/README.md +4 -3
  252. package/dist/agent-src/skills/svg-authoring/SKILL.md +324 -0
  253. package/dist/agent-src/skills/systematic-debugging/SKILL.md +2 -2
  254. package/dist/agent-src/skills/tailwind-engineer/SKILL.md +8 -3
  255. package/dist/agent-src/skills/tailwind-engineer/scripts/tailwind_config_gen.mjs +482 -0
  256. package/dist/agent-src/skills/test-case-discovery/SKILL.md +1 -1
  257. package/dist/agent-src/skills/threat-modeling/SKILL.md +8 -1
  258. package/dist/agent-src/skills/threat-modeling/data/manifest.json +5 -2
  259. package/dist/agent-src/skills/threat-modeling/data/reasoning.csv +10 -10
  260. package/dist/agent-src/skills/threat-modeling/data/surfaces.csv +11 -10
  261. package/dist/agent-src/skills/threat-modeling/data/threats.csv +34 -20
  262. package/dist/agent-src/skills/type-design/SKILL.md +196 -0
  263. package/dist/agent-src/skills/type-design/references/font-spec.md +90 -0
  264. package/dist/agent-src/skills/type-design/references/gates.md +113 -0
  265. package/dist/agent-src/skills/type-design/references/toolchain.md +66 -0
  266. package/dist/agent-src/skills/typography-system/SKILL.md +21 -11
  267. package/dist/agent-src/skills/typography-system/references/worked-scales.md +85 -0
  268. package/dist/agent-src/skills/ui-apply-generic/SKILL.md +1 -1
  269. package/dist/agent-src/skills/universal-project-analysis/SKILL.md +1 -1
  270. package/dist/agent-src/skills/upstream-contribute/SKILL.md +120 -125
  271. package/dist/agent-src/skills/using-git-worktrees/SKILL.md +1 -0
  272. package/dist/agent-src/skills/verify-repair-loop/SKILL.md +1 -1
  273. package/dist/agent-src/skills/voice-and-tone-design/SKILL.md +71 -2
  274. package/dist/agent-src/skills/wireframe/SKILL.md +5 -2
  275. package/dist/agent-src/skills/worktree-lifecycle/SKILL.md +16 -14
  276. package/dist/agent-src/templates/AGENTS.md +1 -1
  277. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  278. package/dist/agent-src/templates/agents/proposal.example.md +1 -1
  279. package/dist/agent-src/templates/github-workflows/advisories-daily.yml +85 -0
  280. package/dist/agent-src/templates/roadmaps.md +39 -1
  281. package/dist/agent-src/templates/scripts/check_memory.ts +2 -2
  282. package/dist/agent-src/templates/scripts/historical-bug-patterns.example.yml +13 -1
  283. package/dist/agent-src/templates/scripts/work_engine/cli.ts +17 -0
  284. package/dist/agent-src/templates/scripts/work_engine/cli_args.ts +10 -0
  285. package/dist/agent-src/templates/scripts/work_engine/directives/ui/scaffold.ts +22 -13
  286. package/dist/agent-src/templates/scripts/work_engine/dispatcher.ts +18 -4
  287. package/dist/agent-src/templates/scripts/work_engine/procedure/checks.ts +283 -0
  288. package/dist/agent-src/templates/scripts/work_engine/procedure/run.ts +432 -0
  289. package/dist/agent-src/templates/scripts/work_engine/procedure/sidecar.ts +185 -0
  290. package/dist/agent-src/templates/scripts/work_engine/state.ts +3 -0
  291. package/dist/cli/commands/uiRender.js +265 -13
  292. package/dist/cli/commands/uiRenderAsset.js +1316 -0
  293. package/dist/cli/commands/uiRenderAssetCompare.js +752 -0
  294. package/dist/cli/commands/uiRenderAssetFonts.js +158 -0
  295. package/dist/cli/commands/uiRenderAssetGrid.js +265 -0
  296. package/dist/cli/commands/uiRenderAssetGrounds.js +323 -0
  297. package/dist/cli/commands/uiRenderAssetIsolation.js +85 -0
  298. package/dist/cli/commands/uiRenderAssetTypes.js +133 -0
  299. package/dist/cli/initRouting.js +1 -1
  300. package/dist/cli/main.js +47 -1
  301. package/dist/cli/mcp/dispatch.js +31 -9
  302. package/dist/cli/python/knowledge_ingest.js +7 -39
  303. package/dist/cli/python/workspace_secrets.js +4 -177
  304. package/dist/cli/registry.js +5 -2
  305. package/dist/cli-delegate/archive_completed_roadmaps.js +3 -2
  306. package/dist/cli-delegate/check_update_banner.js +635 -266
  307. package/dist/cli-delegate/{chunk-AED2VQGM.js → chunk-2CX7NWRB.js} +233 -437
  308. package/dist/cli-delegate/{chunk-F3QDG2GT.js → chunk-2SFOOFJJ.js} +259 -159
  309. package/dist/cli-delegate/chunk-2Y5AMLMY.js +136 -0
  310. package/dist/cli-delegate/{chunk-OKJUIAPS.js → chunk-4E2W63DA.js} +1 -62
  311. package/dist/cli-delegate/{chunk-6SRJTYJS.js → chunk-4SHNERBL.js} +37 -16
  312. package/dist/cli-delegate/chunk-5VO3RTMV.js +208 -0
  313. package/dist/cli-delegate/chunk-6E2LDY4F.js +27 -0
  314. package/dist/cli-delegate/{chunk-XQTPXKFA.js → chunk-6ZD2QZMN.js} +8 -17
  315. package/dist/cli-delegate/{chunk-6V5FMA3P.js → chunk-7CEI2YPS.js} +1 -1
  316. package/dist/cli-delegate/{chunk-DMSZHXZS.js → chunk-7DRWULEQ.js} +80 -7
  317. package/dist/cli-delegate/chunk-7NXCZSDL.js +54 -0
  318. package/dist/cli-delegate/chunk-AX3U3UWJ.js +328 -0
  319. package/dist/cli-delegate/{chunk-WOKWX5PL.js → chunk-BKALSTBZ.js} +18 -3
  320. package/dist/cli-delegate/chunk-BMGUGSY6.js +103 -0
  321. package/dist/cli-delegate/chunk-BYV46VRM.js +3309 -0
  322. package/dist/cli-delegate/{chunk-5GPULQBE.js → chunk-CAL76ADI.js} +4215 -682
  323. package/dist/cli-delegate/chunk-DSY6LLCQ.js +127 -0
  324. package/dist/cli-delegate/chunk-E6XNBVE4.js +581 -0
  325. package/dist/cli-delegate/{chunk-ZUZKZYCN.js → chunk-ESUNQ5XR.js} +46 -10
  326. package/dist/cli-delegate/{chunk-G5VVIZRC.js → chunk-F7HLSW6P.js} +1 -1
  327. package/dist/cli-delegate/chunk-FIEEOH5C.js +133 -0
  328. package/dist/cli-delegate/chunk-FKYZOWVD.js +719 -0
  329. package/dist/cli-delegate/chunk-GOMILC3O.js +918 -0
  330. package/dist/cli-delegate/chunk-I4KJYVPB.js +69 -0
  331. package/dist/cli-delegate/{chunk-JQOM7TTM.js → chunk-IDAOTDPE.js} +1 -100
  332. package/dist/cli-delegate/chunk-IROAQ77A.js +137 -0
  333. package/dist/cli-delegate/chunk-J2SJZICO.js +698 -0
  334. package/dist/cli-delegate/{chunk-6YQC2HLF.js → chunk-JHMMWNJ2.js} +54 -40
  335. package/dist/cli-delegate/{chunk-WQWXGIWB.js → chunk-M6CRG5O6.js} +165 -15
  336. package/dist/cli-delegate/{chunk-PHD7OOLE.js → chunk-MQ2UDEGV.js} +14 -3
  337. package/dist/cli-delegate/chunk-NTM7G2V4.js +220 -0
  338. package/dist/cli-delegate/chunk-PV7S5DPJ.js +175 -0
  339. package/dist/cli-delegate/{chunk-F7DQWYR5.js → chunk-RAXQOETZ.js} +6 -2
  340. package/dist/cli-delegate/{chunk-T7XSJSUQ.js → chunk-SIOMDAKL.js} +980 -784
  341. package/dist/cli-delegate/{chunk-KR6EM23A.js → chunk-TULVDQ4L.js} +3 -48
  342. package/dist/cli-delegate/chunk-UUYEKXKR.js +20 -0
  343. package/dist/cli-delegate/{chunk-7XGD2OEU.js → chunk-UXWHY6CQ.js} +2 -1
  344. package/dist/cli-delegate/{chunk-PWX7CKMD.js → chunk-VC3ECUEK.js} +1 -1
  345. package/dist/cli-delegate/{chunk-KXXWJTDO.js → chunk-WMNYVIYX.js} +1 -1
  346. package/dist/cli-delegate/chunk-XCY5KKUC.js +181 -0
  347. package/dist/cli-delegate/{chunk-H76PHZBI.js → chunk-XLY5G3CM.js} +14 -19
  348. package/dist/cli-delegate/cmd_adr_effective.js +41 -2
  349. package/dist/cli-delegate/cmd_analyze_session.js +7 -7
  350. package/dist/cli-delegate/cmd_brand_status.js +1287 -10
  351. package/dist/cli-delegate/cmd_ci_settle.js +330 -0
  352. package/dist/cli-delegate/cmd_conformance.js +669 -822
  353. package/dist/cli-delegate/cmd_doctor.js +26 -16
  354. package/dist/cli-delegate/cmd_doctor_neighbours.js +10 -7
  355. package/dist/cli-delegate/cmd_explain.js +9 -24
  356. package/dist/cli-delegate/cmd_export.js +14 -11
  357. package/dist/cli-delegate/cmd_fleet.js +5 -3
  358. package/dist/cli-delegate/cmd_git_convention.js +8 -4
  359. package/dist/cli-delegate/cmd_handoff.js +79 -242
  360. package/dist/cli-delegate/cmd_mcp_available.js +1 -1
  361. package/dist/cli-delegate/cmd_memory_get.js +4 -2
  362. package/dist/cli-delegate/cmd_migrate.js +2 -2
  363. package/dist/cli-delegate/cmd_packs_active.js +2 -2
  364. package/dist/cli-delegate/cmd_preflight.js +7 -5
  365. package/dist/cli-delegate/cmd_prune.js +16 -13
  366. package/dist/cli-delegate/cmd_route_audit.js +11 -8
  367. package/dist/cli-delegate/cmd_route_explain.js +649 -16
  368. package/dist/cli-delegate/cmd_session_recycle.js +15 -6
  369. package/dist/cli-delegate/cmd_settings_check.js +2 -2
  370. package/dist/cli-delegate/cmd_settings_get.js +1 -1
  371. package/dist/cli-delegate/cmd_settings_migrate.js +14 -11
  372. package/dist/cli-delegate/cmd_settings_set.js +1 -1
  373. package/dist/cli-delegate/cmd_sync.js +16 -13
  374. package/dist/cli-delegate/cmd_uninstall.js +185 -31
  375. package/dist/cli-delegate/cmd_update.js +67 -3
  376. package/dist/cli-delegate/cmd_upgrade.js +38 -7
  377. package/dist/cli-delegate/cmd_validate.js +16 -13
  378. package/dist/cli-delegate/cmd_versions.js +1 -1
  379. package/dist/cli-delegate/dashboard_mode.js +1 -1
  380. package/dist/cli-delegate/gate_execute.js +4 -3
  381. package/dist/cli-delegate/roadmap_age.js +22 -0
  382. package/dist/cli-delegate/roadmap_gates.js +4 -3
  383. package/dist/cli-delegate/update_roadmap_progress.js +3 -2
  384. package/dist/cli-delegate/upgrade_unattended-VVL6JLSX.js +541 -0
  385. package/dist/discovery/deprecation-report.md +1 -1
  386. package/dist/discovery/discovery-manifest.json +409 -201
  387. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  388. package/dist/discovery/discovery-manifest.summary.md +8 -8
  389. package/dist/discovery/dormancy-report.md +1 -1
  390. package/dist/discovery/orphan-report.md +1 -1
  391. package/dist/discovery/packs.json +36 -27
  392. package/dist/discovery/trust-report.md +3 -3
  393. package/dist/discovery/workspaces.json +25 -16
  394. package/dist/hooks/chat_history.chunk.cjs +6852 -0
  395. package/dist/hooks/chat_history.chunk.cjs.sha256 +1 -0
  396. package/dist/hooks/dispatch.js +17706 -18627
  397. package/dist/hooks/dispatch.sha256 +1 -1
  398. package/dist/hooks/egress_engine.chunk.cjs +915 -0
  399. package/dist/hooks/egress_engine.chunk.cjs.sha256 +1 -0
  400. package/dist/hooks/svg_rules.chunk.cjs +1858 -0
  401. package/dist/hooks/svg_rules.chunk.cjs.sha256 +1 -0
  402. package/dist/install/conflict.js +36 -6
  403. package/dist/install/conflictTracker.js +81 -7
  404. package/dist/install/detect.js +3 -3
  405. package/dist/install/hostPermissionsAdapter.js +106 -0
  406. package/dist/install/install.mjs +3117 -1949
  407. package/dist/install/installThinLayer.js +1 -1
  408. package/dist/install/manifestFiles.js +21 -0
  409. package/dist/install/noGoDenyRows.js +300 -0
  410. package/dist/install/noGoRules.js +368 -0
  411. package/dist/install/ownershipLedger.js +133 -0
  412. package/dist/install/plan.js +1 -1
  413. package/dist/install/preflight.js +39 -8
  414. package/dist/install/preserve.js +74 -12
  415. package/dist/install/recordedOwnership.js +88 -5
  416. package/dist/install/rule_scope.js +20 -3
  417. package/dist/install/stagedRuntime.js +455 -0
  418. package/dist/install/toolsArg.js +19 -0
  419. package/dist/install/userPin.js +47 -0
  420. package/dist/install/wizard-plan.js +26 -4
  421. package/dist/mcp/awesome-mcp-servers.row.md +1 -1
  422. package/dist/mcp/mcp-cloudflare-catalogue.json +3 -2
  423. package/dist/mcp/registry-manifest.json +6 -5
  424. package/dist/mcp/server.json +3 -3
  425. package/dist/mcp/server.mjs +9814 -5333
  426. package/dist/router.json +1 -1
  427. package/dist/scripts/_lib/agent_settings.js +7 -12
  428. package/dist/scripts/_lib/asset_render_record.js +219 -0
  429. package/dist/scripts/_lib/claude_builtin_names.js +9 -4
  430. package/dist/scripts/_lib/claude_settings_hooks.js +102 -34
  431. package/dist/scripts/_lib/egress_rules.js +766 -0
  432. package/dist/scripts/_lib/environment_detector.js +24 -33
  433. package/dist/scripts/_lib/global_deploy_inventory.js +146 -9
  434. package/dist/scripts/_lib/guidelines_lane.js +10 -1
  435. package/dist/scripts/_lib/identifier_redaction.js +24 -0
  436. package/dist/scripts/_lib/installed_layer.js +17 -0
  437. package/dist/scripts/_lib/installed_layer_normalise.js +72 -0
  438. package/dist/scripts/_lib/lean_projection_mode.js +34 -152
  439. package/dist/scripts/_lib/project_tree_form.js +118 -0
  440. package/dist/scripts/_lib/scan_scope.js +105 -0
  441. package/dist/scripts/_lib/scoped_projection.js +133 -3
  442. package/dist/scripts/_lib/settings_removed_keys.js +29 -0
  443. package/dist/scripts/_lib/settings_renamed_keys.js +17 -5
  444. package/dist/scripts/_lib/subagent_native_fields.js +35 -0
  445. package/dist/scripts/_lib/svg_dom.js +284 -0
  446. package/dist/scripts/_lib/svg_filled_counter.js +285 -0
  447. package/dist/scripts/_lib/svg_geometry.js +477 -0
  448. package/dist/scripts/_lib/svg_motion.js +179 -0
  449. package/dist/scripts/_lib/svg_rules.js +1339 -0
  450. package/dist/scripts/_lib/svg_urls.js +67 -0
  451. package/dist/scripts/_lib/ui_surface.js +19 -0
  452. package/dist/scripts/_lib/verification_command.js +364 -0
  453. package/dist/scripts/_lib/workspace_secrets.js +229 -0
  454. package/dist/scripts/ai_council/seat_policy.js +27 -0
  455. package/dist/scripts/ai_council/transport_resolver.js +9 -10
  456. package/dist/scripts/condense.js +25 -29
  457. package/dist/scripts/lint_svg_asset.js +324 -0
  458. package/dist/server/io/substituteTemplate.js +2 -2
  459. package/dist/server/io/yamlIO.js +2 -2
  460. package/dist/server/routes/install.js +5 -1
  461. package/dist/server/routes/settings.js +2 -2
  462. package/dist/server/routes/wizard.js +1 -1
  463. package/dist/server/schemas/settings.js +22 -16
  464. package/dist/server/serverInfo.js +1 -1
  465. package/dist/shared/brandTokenDocument.js +47 -0
  466. package/dist/shared/brandTokenPaths.js +43 -0
  467. package/dist/shared/settingsCarveOut.js +0 -7
  468. package/dist/shared/skillRanking.js +103 -5
  469. package/dist/shared/userMd/formAdapter.js +16 -0
  470. package/dist/shared/userMd/schema.js +17 -0
  471. package/dist/ui/assets/index-w70Ado09.js +23 -0
  472. package/dist/ui/index.html +1 -1
  473. package/docs/MIGRATION.md +89 -2
  474. package/docs/THIRD-PARTY-NOTICES.md +27 -0
  475. package/docs/contracts/settings-classes.md +27 -9
  476. package/docs/guidelines/agent-infra/api-cost-levers.md +4 -3
  477. package/docs/guidelines/agent-infra/model-recommendation.md +11 -5
  478. package/docs/guidelines/agent-infra/rule-body-migration-inventory.md +1 -1
  479. package/docs/guidelines/agent-infra/self-improvement-pipeline.md +47 -24
  480. package/docs/guidelines/design-antipatterns.md +6 -1
  481. package/docs/guidelines/design-asset-discipline.md +17 -0
  482. package/docs/guidelines/design-fidelity-routing.md +1 -0
  483. package/docs/guidelines/php/api-design.md +10 -1
  484. package/llms.txt +12 -10
  485. package/package.json +15 -5
  486. package/src/agent-src/scripts/dashboard_mode.ts +4 -1
  487. package/src/agent-src/scripts/roadmap_age.ts +175 -0
  488. package/src/agent-src/scripts/update_roadmap_progress.ts +10 -2
  489. package/src/agent-src/templates/AGENTS.md +1 -1
  490. package/src/agent-src/templates/scripts/check_memory.ts +2 -2
  491. package/src/agent-src/templates/scripts/historical-bug-patterns.example.yml +13 -1
  492. package/src/agent-src/templates/scripts/work_engine/cli.ts +17 -0
  493. package/src/agent-src/templates/scripts/work_engine/cli_args.ts +10 -0
  494. package/src/agent-src/templates/scripts/work_engine/directives/ui/scaffold.ts +22 -13
  495. package/src/agent-src/templates/scripts/work_engine/dispatcher.ts +18 -4
  496. package/src/agent-src/templates/scripts/work_engine/procedure/checks.ts +283 -0
  497. package/src/agent-src/templates/scripts/work_engine/procedure/run.ts +432 -0
  498. package/src/agent-src/templates/scripts/work_engine/procedure/sidecar.ts +185 -0
  499. package/src/agent-src/templates/scripts/work_engine/state.ts +3 -0
  500. package/src/config/agent-settings.template.yml +120 -57
  501. package/src/config/agents-paths.yml +13 -7
  502. package/src/config/ci-local-parity.yml +44 -0
  503. package/src/config/continuity-surface.json +51 -2
  504. package/src/config/depth-audit-samples.json +5 -0
  505. package/src/config/discovery/command-verbs.yml +1 -0
  506. package/src/config/dispatch-economy-metrics.json +1 -0
  507. package/src/config/egress-mutations/class-precedence-swapped.json +7 -0
  508. package/src/config/egress-mutations/credential-token-restores.json +7 -0
  509. package/src/config/egress-mutations/iban-checksum-disabled.json +7 -0
  510. package/src/config/egress-mutations/raw-value-in-the-count-record.json +7 -0
  511. package/src/config/evaluator-budgets.json +4 -4
  512. package/src/config/gate-coverage.yml +149 -3
  513. package/src/config/gate-reachability-exemptions.json +3 -5
  514. package/src/config/gate-violation-baselines.json +29 -25
  515. package/src/config/gitignore-block.txt +6 -3
  516. package/src/config/hook-bundle-budget.json +34 -3
  517. package/src/config/hook-carrier-probes.json +30 -0
  518. package/src/config/hook-latency-budget.json +4 -2
  519. package/src/config/host-injection-effect.json +8 -1
  520. package/src/config/host-skill-frontmatter-keys.json +56 -0
  521. package/src/config/layer-form-brakes.json +4 -0
  522. package/src/config/layer-form-comparison-corpus.json +42 -0
  523. package/src/config/loop-surfaces.yaml +28 -47
  524. package/src/config/memory-twin-verdicts.yml +9 -1
  525. package/src/config/metric-registry.yml +40 -3
  526. package/src/config/pack-size-budget.json +15 -0
  527. package/src/config/procedure-core-budget.json +21 -0
  528. package/src/config/profiles/minimal.ini +1 -1
  529. package/src/config/project-tree-form.json +24 -0
  530. package/src/config/reach-channels.yml +3 -3
  531. package/src/config/reach-prescriptions-intake.yml +1 -1
  532. package/src/config/roadmap-step-size-baseline.json +118 -0
  533. package/src/config/routing-coverage-seed.json +100 -2
  534. package/src/config/skill-body-budget.json +686 -0
  535. package/src/config/skill-fork-pilot.json +17 -0
  536. package/src/config/skill-lifecycle-probes-codex.json +57 -0
  537. package/src/config/skill-lifecycle-probes.json +57 -0
  538. package/src/config/skill-output-shape.json +316 -0
  539. package/src/config/step-depth-table.json +58 -0
  540. package/src/config/turnaround-budget.json +90 -0
  541. package/src/install/conflict.ts +38 -6
  542. package/src/install/conflictTracker.ts +126 -8
  543. package/src/install/detect.ts +3 -3
  544. package/src/install/hostPermissionsAdapter.ts +136 -0
  545. package/src/install/installThinLayer.ts +6 -1
  546. package/src/install/manifestFiles.ts +24 -0
  547. package/src/install/noGoDenyRows.ts +368 -0
  548. package/src/install/noGoRules.ts +438 -0
  549. package/src/install/ownershipLedger.ts +180 -0
  550. package/src/install/plan.ts +1 -1
  551. package/src/install/preflight.ts +42 -10
  552. package/src/install/preserve.ts +94 -12
  553. package/src/install/recordedOwnership.ts +121 -3
  554. package/src/install/rule_scope.ts +20 -3
  555. package/src/install/stagedRuntime.ts +528 -0
  556. package/src/install/toolsArg.ts +16 -0
  557. package/src/install/types.ts +23 -2
  558. package/src/install/userPin.ts +54 -0
  559. package/src/install/wizard-plan.ts +25 -4
  560. package/src/scripts/_cli/_doctor_emit.ts +24 -0
  561. package/src/scripts/_cli/cmd_brand_status.ts +223 -12
  562. package/src/scripts/_cli/cmd_ci_settle.ts +32 -0
  563. package/src/scripts/_cli/cmd_doctor.ts +23 -44
  564. package/src/scripts/_cli/cmd_route_explain.ts +176 -2
  565. package/src/scripts/_cli/cmd_uninstall.ts +270 -26
  566. package/src/scripts/_cli/cmd_update.ts +34 -1
  567. package/src/scripts/_cli/cmd_upgrade.ts +38 -2
  568. package/src/scripts/_cli/detection_report.ts +7 -0
  569. package/src/scripts/_cli/doctor_execution.ts +1 -2
  570. package/src/scripts/_cli/doctor_install_mode.ts +39 -0
  571. package/src/scripts/_cli/doctor_network_posture.ts +3 -3
  572. package/src/scripts/_cli/doctor_ownership_ledger.ts +126 -0
  573. package/src/scripts/_cli/doctor_update_verdict.ts +104 -0
  574. package/src/scripts/_cli/explain_last/scrubber.ts +9 -21
  575. package/src/scripts/_cli/upgrade_unattended.ts +548 -0
  576. package/src/scripts/_dispatch.bash +42 -9
  577. package/src/scripts/_lib/activation_ladder.ts +1 -1
  578. package/src/scripts/_lib/advisory_inventory.ts +405 -0
  579. package/src/scripts/_lib/advisory_notice.ts +270 -0
  580. package/src/scripts/_lib/advisory_sources.ts +752 -0
  581. package/src/scripts/_lib/advisory_verdicts.ts +363 -0
  582. package/src/scripts/_lib/agent_artifact_location.ts +177 -0
  583. package/src/scripts/_lib/agent_settings.ts +7 -12
  584. package/src/scripts/_lib/arrival_record.ts +217 -0
  585. package/src/scripts/_lib/asset_render_record.ts +247 -0
  586. package/src/scripts/_lib/billing_grant.ts +4 -2
  587. package/src/scripts/_lib/brand_voice_slot.ts +258 -0
  588. package/src/scripts/_lib/canary_status.ts +24 -0
  589. package/src/scripts/_lib/cc_transcript.ts +276 -0
  590. package/src/scripts/_lib/changelog_eras.ts +83 -0
  591. package/src/scripts/_lib/claim_phrases.ts +71 -0
  592. package/src/scripts/_lib/classify_update.ts +171 -0
  593. package/src/scripts/_lib/claude_builtin_names.ts +9 -4
  594. package/src/scripts/_lib/claude_hook_scope.ts +195 -0
  595. package/src/scripts/_lib/claude_settings_hooks.ts +118 -34
  596. package/src/scripts/_lib/codex_resident_set.ts +460 -0
  597. package/src/scripts/_lib/codex_skill_finder.ts +225 -0
  598. package/src/scripts/_lib/confusables.ts +19 -0
  599. package/src/scripts/_lib/consumer_impact.ts +199 -0
  600. package/src/scripts/_lib/content_class.ts +127 -0
  601. package/src/scripts/_lib/counted_probe.ts +68 -1
  602. package/src/scripts/_lib/credential_deny_rows.ts +151 -0
  603. package/src/scripts/_lib/credential_files.ts +367 -0
  604. package/src/scripts/_lib/delivery_arm_experiment.ts +2 -2
  605. package/src/scripts/_lib/depth_flip.ts +141 -0
  606. package/src/scripts/_lib/design_lock.ts +117 -0
  607. package/src/scripts/_lib/design_sync_ledger.ts +142 -0
  608. package/src/scripts/_lib/design_sync_plan.ts +177 -0
  609. package/src/scripts/_lib/design_sync_reconcile.ts +159 -0
  610. package/src/scripts/_lib/design_sync_verify.ts +99 -0
  611. package/src/scripts/_lib/design_system_claude_design.ts +323 -0
  612. package/src/scripts/_lib/design_system_import.ts +84 -6
  613. package/src/scripts/_lib/dispatch_import_closure.ts +42 -11
  614. package/src/scripts/_lib/egress_credential_env.ts +35 -0
  615. package/src/scripts/_lib/egress_engine.ts +22 -0
  616. package/src/scripts/_lib/egress_known_values.ts +223 -0
  617. package/src/scripts/_lib/egress_normalize.ts +67 -0
  618. package/src/scripts/_lib/egress_prefixes.ts +42 -0
  619. package/src/scripts/_lib/egress_rules.ts +896 -0
  620. package/src/scripts/_lib/egress_rules_linearity.ts +56 -0
  621. package/src/scripts/_lib/egress_sender_scan.ts +290 -0
  622. package/src/scripts/_lib/egress_session_table.ts +510 -0
  623. package/src/scripts/_lib/egress_text.ts +63 -0
  624. package/src/scripts/_lib/egress_token.ts +252 -0
  625. package/src/scripts/_lib/empty_cycles.ts +1 -1
  626. package/src/scripts/_lib/environment_detector.ts +45 -30
  627. package/src/scripts/_lib/exemption_shape.ts +75 -1
  628. package/src/scripts/_lib/floor_posture.ts +185 -0
  629. package/src/scripts/_lib/forge_protection.ts +140 -2
  630. package/src/scripts/_lib/global_deploy_inventory.ts +159 -6
  631. package/src/scripts/_lib/guidelines_lane.ts +12 -1
  632. package/src/scripts/_lib/hand_kinds.ts +65 -0
  633. package/src/scripts/_lib/headless_invocation.ts +3 -3
  634. package/src/scripts/_lib/host_capability.ts +34 -2
  635. package/src/scripts/_lib/host_env_write.ts +39 -18
  636. package/src/scripts/_lib/host_listing_model.ts +14 -7
  637. package/src/scripts/_lib/identifier_redaction.ts +26 -0
  638. package/src/scripts/_lib/impact_bump.ts +70 -0
  639. package/src/scripts/_lib/install_reach_checks.ts +53 -1
  640. package/src/scripts/_lib/installed_layer.ts +31 -0
  641. package/src/scripts/_lib/installed_layer_normalise.ts +75 -0
  642. package/src/scripts/_lib/instructions_loaded_classify.ts +75 -0
  643. package/src/scripts/_lib/instructions_loaded_event.ts +53 -0
  644. package/src/scripts/_lib/knowledge_global_redaction.ts +2 -2
  645. package/src/scripts/_lib/layer_form_corpus.ts +165 -0
  646. package/src/scripts/_lib/layer_form_decision.ts +248 -0
  647. package/src/scripts/_lib/layer_form_evidence.ts +112 -0
  648. package/src/scripts/_lib/lean_projection_mode.ts +32 -161
  649. package/src/scripts/_lib/llm_proposer_transport.ts +1 -0
  650. package/src/scripts/_lib/loop_guards.ts +8 -120
  651. package/src/scripts/_lib/major_surface.ts +207 -0
  652. package/src/scripts/_lib/mcp_bridge.ts +30 -69
  653. package/src/scripts/_lib/merge_clearance_record.ts +384 -0
  654. package/src/scripts/_lib/neighbour_census.ts +18 -1
  655. package/src/scripts/_lib/orchestration_record.ts +61 -0
  656. package/src/scripts/_lib/outcome_vocabularies.ts +15 -23
  657. package/src/scripts/_lib/pin_advice.ts +49 -0
  658. package/src/scripts/_lib/platform_anchor.ts +222 -0
  659. package/src/scripts/_lib/procedure_checks.ts +5 -0
  660. package/src/scripts/_lib/project_tree_form.ts +134 -0
  661. package/src/scripts/_lib/projection_key_migration.ts +122 -0
  662. package/src/scripts/_lib/prompt_shape.ts +13 -2
  663. package/src/scripts/_lib/provenance_verify.ts +272 -0
  664. package/src/scripts/_lib/quota_parked.ts +27 -1
  665. package/src/scripts/_lib/ratification_artifact.ts +64 -1
  666. package/src/scripts/_lib/ratification_subject.ts +508 -46
  667. package/src/scripts/_lib/release_findings_ingest.ts +52 -5
  668. package/src/scripts/_lib/release_highlights.ts +72 -2
  669. package/src/scripts/_lib/release_settings_surface.ts +392 -0
  670. package/src/scripts/_lib/review_round.ts +134 -0
  671. package/src/scripts/_lib/roadmap_checkboxes.ts +1 -1
  672. package/src/scripts/_lib/roadmap_slug_lock.ts +254 -0
  673. package/src/scripts/_lib/roadmap_step_size.ts +75 -0
  674. package/src/scripts/_lib/run_checkpoint.ts +60 -3
  675. package/src/scripts/_lib/runtime_wiring_checks.ts +15 -1
  676. package/src/scripts/_lib/scope_guard.sh +64 -5
  677. package/src/scripts/_lib/scoped_projection.ts +136 -3
  678. package/src/scripts/_lib/secret_detector.ts +24 -103
  679. package/src/scripts/_lib/security_fix.ts +429 -0
  680. package/src/scripts/_lib/security_fix_context.ts +133 -0
  681. package/src/scripts/_lib/self_repair.ts +69 -39
  682. package/src/scripts/_lib/self_repair_outgoing.ts +209 -0
  683. package/src/scripts/_lib/self_repair_payload.ts +86 -0
  684. package/src/scripts/_lib/session_eol.ts +3 -0
  685. package/src/scripts/_lib/session_pr_watch.ts +207 -0
  686. package/src/scripts/_lib/session_register.ts +51 -1
  687. package/src/scripts/_lib/session_tag.ts +51 -0
  688. package/src/scripts/_lib/settings_removed_keys.ts +30 -0
  689. package/src/scripts/_lib/settings_renamed_keys.ts +19 -5
  690. package/src/scripts/_lib/skill_catalogue.ts +66 -25
  691. package/src/scripts/_lib/skill_fork_pilot.ts +121 -0
  692. package/src/scripts/_lib/skill_leases.ts +203 -0
  693. package/src/scripts/_lib/skill_listing_overrides.ts +294 -0
  694. package/src/scripts/_lib/skill_materialisation.ts +388 -0
  695. package/src/scripts/_lib/skill_materialisation_gate.ts +210 -0
  696. package/src/scripts/_lib/skill_materialisation_lock.ts +149 -0
  697. package/src/scripts/_lib/skill_materialisation_triggers.ts +96 -0
  698. package/src/scripts/_lib/skill_origin.ts +21 -1
  699. package/src/scripts/_lib/skill_reach.ts +342 -0
  700. package/src/scripts/_lib/source_shape.ts +7 -2
  701. package/src/scripts/_lib/sqlite_guard.ts +1 -1
  702. package/src/scripts/_lib/step_anatomy.ts +330 -0
  703. package/src/scripts/_lib/subagent_capsule.ts +8 -2
  704. package/src/scripts/_lib/subagent_native_fields.ts +30 -0
  705. package/src/scripts/_lib/subagent_spawn.ts +36 -0
  706. package/src/scripts/_lib/subagent_steering.ts +367 -0
  707. package/src/scripts/_lib/svg_dom.ts +318 -0
  708. package/src/scripts/_lib/svg_filled_counter.ts +287 -0
  709. package/src/scripts/_lib/svg_geometry.ts +480 -0
  710. package/src/scripts/_lib/svg_motion.ts +208 -0
  711. package/src/scripts/_lib/svg_rules.ts +1455 -0
  712. package/src/scripts/_lib/svg_urls.ts +72 -0
  713. package/src/scripts/_lib/test_delta.ts +89 -6
  714. package/src/scripts/_lib/tier_downshift_verdict.ts +222 -0
  715. package/src/scripts/_lib/tool_result_census.ts +62 -0
  716. package/src/scripts/_lib/trigger_routers.ts +1 -0
  717. package/src/scripts/_lib/turnaround_throughput.ts +378 -0
  718. package/src/scripts/_lib/ui_surface.ts +22 -0
  719. package/src/scripts/_lib/unattended_gates.ts +100 -0
  720. package/src/scripts/_lib/undeployed_fixes.ts +34 -0
  721. package/src/scripts/_lib/update_check.ts +143 -12
  722. package/src/scripts/_lib/update_invite.ts +116 -0
  723. package/src/scripts/_lib/update_notice.ts +259 -0
  724. package/src/scripts/_lib/verification_command.ts +59 -0
  725. package/src/scripts/_lib/verify_clause.ts +31 -19
  726. package/src/scripts/_lib/version_order.ts +146 -0
  727. package/src/scripts/_lib/worker_reuse.ts +191 -0
  728. package/src/scripts/_lib/workspace_secrets.ts +273 -0
  729. package/src/scripts/_lib/worktree_git.ts +67 -0
  730. package/src/scripts/_lib/worktree_ignored.ts +116 -0
  731. package/src/scripts/adoption_status.ts +330 -3
  732. package/src/scripts/adr_cite_check.ts +93 -0
  733. package/src/scripts/advisories.ts +803 -0
  734. package/src/scripts/ai-image/adapters/flux.sh +1 -0
  735. package/src/scripts/ai-image/adapters/gemini-image.sh +1 -0
  736. package/src/scripts/ai-image/adapters/ideogram.sh +1 -0
  737. package/src/scripts/ai-image/adapters/recraft.sh +1 -0
  738. package/src/scripts/ai-video/adapters/comfyui.sh +1 -0
  739. package/src/scripts/ai-video/adapters/fal.sh +1 -0
  740. package/src/scripts/ai-video/adapters/gemini-veo.sh +1 -0
  741. package/src/scripts/ai-video/adapters/higgsfield.sh +1 -0
  742. package/src/scripts/ai-video/adapters/kling.sh +1 -0
  743. package/src/scripts/ai-video/adapters/musetalk.sh +1 -0
  744. package/src/scripts/ai-video/adapters/openai-images.sh +1 -0
  745. package/src/scripts/ai-video/adapters/replicate.sh +1 -0
  746. package/src/scripts/ai-video/adapters/sora.sh +1 -0
  747. package/src/scripts/ai-video/adapters/syncso.sh +1 -0
  748. package/src/scripts/ai-video/stitch.sh +115 -2
  749. package/src/scripts/ai_council/airgap.ts +1 -0
  750. package/src/scripts/ai_council/api_transport.ts +27 -4
  751. package/src/scripts/ai_council/budget_guard.ts +300 -11
  752. package/src/scripts/ai_council/bundler.ts +20 -29
  753. package/src/scripts/ai_council/chairman.ts +17 -2
  754. package/src/scripts/ai_council/cli_agency_bounds.ts +158 -0
  755. package/src/scripts/ai_council/cli_launch_env.ts +54 -0
  756. package/src/scripts/ai_council/cli_least_agency_canary.ts +18 -2
  757. package/src/scripts/ai_council/clients.ts +55 -73
  758. package/src/scripts/ai_council/config.ts +16 -22
  759. package/src/scripts/ai_council/council_egress.ts +167 -0
  760. package/src/scripts/ai_council/exposure_ledger.ts +117 -0
  761. package/src/scripts/ai_council/free_hand_shadow.ts +276 -0
  762. package/src/scripts/ai_council/free_route.ts +216 -0
  763. package/src/scripts/ai_council/free_route_catalog.ts +173 -0
  764. package/src/scripts/ai_council/free_route_client.ts +95 -0
  765. package/src/scripts/ai_council/free_rung.ts +61 -0
  766. package/src/scripts/ai_council/hand_payload.ts +230 -0
  767. package/src/scripts/ai_council/hand_schemas.ts +123 -0
  768. package/src/scripts/ai_council/jury_aggregate.ts +155 -1
  769. package/src/scripts/ai_council/kind_flip.ts +221 -0
  770. package/src/scripts/ai_council/kind_flip_state.ts +19 -0
  771. package/src/scripts/ai_council/learn_low_impact_preview.ts +50 -22
  772. package/src/scripts/ai_council/modification_review.ts +98 -5
  773. package/src/scripts/ai_council/necessity.ts +7 -0
  774. package/src/scripts/ai_council/orchestrator.ts +16 -16
  775. package/src/scripts/ai_council/pricing.ts +10 -0
  776. package/src/scripts/ai_council/redact_low_impact_entry.ts +5 -2
  777. package/src/scripts/ai_council/response_render.ts +27 -4
  778. package/src/scripts/ai_council/round_reservations.ts +119 -0
  779. package/src/scripts/ai_council/route_chooser.ts +161 -0
  780. package/src/scripts/ai_council/route_liveness.ts +152 -0
  781. package/src/scripts/ai_council/route_member.ts +52 -0
  782. package/src/scripts/ai_council/seat_policy.ts +40 -0
  783. package/src/scripts/ai_council/seat_resume.ts +40 -0
  784. package/src/scripts/ai_council/shadow_dispatch.ts +13 -3
  785. package/src/scripts/ai_council/spend_gate.ts +18 -2
  786. package/src/scripts/ai_council/status_surface.ts +37 -0
  787. package/src/scripts/ai_council/transport_resolver.ts +15 -18
  788. package/src/scripts/analysis_analysts.ts +226 -0
  789. package/src/scripts/analysis_anchors.ts +140 -0
  790. package/src/scripts/analysis_and_optimize.ts +44 -0
  791. package/src/scripts/analysis_emit.ts +150 -0
  792. package/src/scripts/analysis_exchange.ts +186 -0
  793. package/src/scripts/analysis_gate.ts +158 -0
  794. package/src/scripts/analysis_inbox_final.ts +173 -0
  795. package/src/scripts/analysis_ledger.ts +119 -0
  796. package/src/scripts/analysis_pr_optimize.ts +219 -0
  797. package/src/scripts/analysis_pr_review.ts +240 -0
  798. package/src/scripts/analysis_pr_target.ts +121 -0
  799. package/src/scripts/analysis_prompts.ts +130 -0
  800. package/src/scripts/analysis_publish.ts +358 -0
  801. package/src/scripts/analysis_questions.ts +78 -0
  802. package/src/scripts/analysis_run.ts +248 -0
  803. package/src/scripts/analysis_run_record.ts +210 -0
  804. package/src/scripts/analysis_target.ts +343 -0
  805. package/src/scripts/analysis_validate.ts +161 -0
  806. package/src/scripts/anchor_eval_falsify.ts +1 -1
  807. package/src/scripts/arrival_report.ts +115 -0
  808. package/src/scripts/ask_transport.ts +284 -35
  809. package/src/scripts/backfill_model_tier.ts +4 -5
  810. package/src/scripts/before_complete_hook.ts +48 -2
  811. package/src/scripts/bench_hook_latency.ts +3 -3
  812. package/src/scripts/bench_procedure_cursor.ts +440 -0
  813. package/src/scripts/bootstrap.sh +3 -3
  814. package/src/scripts/build_exit_code_register.ts +440 -0
  815. package/src/scripts/build_proof.ts +23 -1
  816. package/src/scripts/cache_realization_report.ts +155 -14
  817. package/src/scripts/canary_liveness.ts +117 -0
  818. package/src/scripts/chat_history.ts +12 -15
  819. package/src/scripts/check_account_surface.ts +318 -0
  820. package/src/scripts/check_agent_artifact_location.ts +17 -160
  821. package/src/scripts/check_bundle_path_leakage.ts +6 -0
  822. package/src/scripts/check_ci_local_parity.ts +21 -13
  823. package/src/scripts/check_claims.ts +77 -2
  824. package/src/scripts/check_completion_review.ts +34 -1
  825. package/src/scripts/check_concern_admissions.ts +41 -5
  826. package/src/scripts/check_consumer_scope_flip.ts +1 -1
  827. package/src/scripts/check_context_paths.ts +2 -0
  828. package/src/scripts/check_council_layout.ts +9 -0
  829. package/src/scripts/check_credential_spelling.ts +267 -0
  830. package/src/scripts/check_egress_mutations.ts +239 -0
  831. package/src/scripts/check_enforcement_coverage.ts +16 -3
  832. package/src/scripts/check_estate_count.ts +16 -1
  833. package/src/scripts/check_finding_dispositions.ts +147 -0
  834. package/src/scripts/check_gate_coverage.ts +123 -21
  835. package/src/scripts/check_gate_reachability.ts +16 -2
  836. package/src/scripts/check_generator_sync.ts +46 -0
  837. package/src/scripts/check_hook_bundle_composition.ts +139 -1
  838. package/src/scripts/check_host_docs_digest.ts +142 -5
  839. package/src/scripts/check_kernel_edit_ratified.ts +301 -76
  840. package/src/scripts/check_kernel_rule_bundle.ts +14 -10
  841. package/src/scripts/check_knowledge_cards.ts +83 -3
  842. package/src/scripts/check_memory.ts +13 -3
  843. package/src/scripts/check_pack_size.ts +1 -1
  844. package/src/scripts/check_permission_deny_syntax.ts +247 -0
  845. package/src/scripts/check_platform_anchor.ts +243 -0
  846. package/src/scripts/check_proposal.ts +183 -1
  847. package/src/scripts/check_reach_channels.ts +5 -3
  848. package/src/scripts/check_references.ts +5 -2
  849. package/src/scripts/check_release_manifest_content.ts +33 -0
  850. package/src/scripts/check_release_pr_shape.ts +5 -0
  851. package/src/scripts/check_rule_invariants.ts +9 -1
  852. package/src/scripts/check_skill_body_budget.ts +343 -0
  853. package/src/scripts/check_skill_requires.ts +137 -1
  854. package/src/scripts/check_step_receipts.ts +246 -0
  855. package/src/scripts/check_structural_breaking.ts +7 -1
  856. package/src/scripts/check_suppression_hygiene.ts +8 -0
  857. package/src/scripts/check_test_weakening.ts +14 -0
  858. package/src/scripts/check_token_quality_golden.ts +5 -1
  859. package/src/scripts/check_update_banner.ts +50 -3
  860. package/src/scripts/check_verify_expectation_delta.ts +2 -1
  861. package/src/scripts/check_voice_lexicon.ts +531 -0
  862. package/src/scripts/ci_os_attribution.ts +327 -0
  863. package/src/scripts/ci_platform_scope.ts +69 -0
  864. package/src/scripts/ci_settle.ts +4 -1
  865. package/src/scripts/ci_status.ts +0 -1
  866. package/src/scripts/ci_time_to_green.ts +748 -0
  867. package/src/scripts/classify_merge_risk.ts +407 -19
  868. package/src/scripts/code_graph/sqlite_store.ts +1 -1
  869. package/src/scripts/compile_trigger_evals.ts +353 -0
  870. package/src/scripts/condense.ts +25 -31
  871. package/src/scripts/consumer_matrix.ts +61 -3
  872. package/src/scripts/council_availability_hook.ts +12 -4
  873. package/src/scripts/council_cli.ts +48 -38
  874. package/src/scripts/cross_repo_retrieve.ts +9 -72
  875. package/src/scripts/design_lock.ts +106 -0
  876. package/src/scripts/design_slop_rules.ts +30 -0
  877. package/src/scripts/design_sync.ts +264 -0
  878. package/src/scripts/design_system_import.ts +30 -13
  879. package/src/scripts/dispatch_economy_report.ts +46 -1
  880. package/src/scripts/dispatch_r2_reviewer.ts +41 -5
  881. package/src/scripts/egress_canary.ts +166 -0
  882. package/src/scripts/egress_sender_census.ts +101 -0
  883. package/src/scripts/external_sources_denylist.json +94 -12
  884. package/src/scripts/generate_catalog.ts +6 -2
  885. package/src/scripts/generate_owned_digest.ts +163 -0
  886. package/src/scripts/generate_reference_toc.ts +143 -0
  887. package/src/scripts/generate_subagent_floor.ts +11 -1
  888. package/src/scripts/handoff_context_hook.ts +34 -0
  889. package/src/scripts/hook_carrier_census.ts +263 -0
  890. package/src/scripts/hook_chunks.d.mts +12 -0
  891. package/src/scripts/hook_chunks.mjs +114 -0
  892. package/src/scripts/hook_manifest.json +1 -1
  893. package/src/scripts/hook_manifest.yaml +65 -42
  894. package/src/scripts/hooks/block_config_weakening.ts +127 -3
  895. package/src/scripts/hooks/block_credential_reads.ts +165 -0
  896. package/src/scripts/hooks/block_no_verify.ts +47 -23
  897. package/src/scripts/hooks/block_speaking_inbox_dir.ts +54 -8
  898. package/src/scripts/hooks/category_a.ts +202 -25
  899. package/src/scripts/hooks/concern_failure_policy.ts +6 -6
  900. package/src/scripts/hooks/concern_registry.ts +31 -6
  901. package/src/scripts/hooks/concern_registry_types.ts +11 -0
  902. package/src/scripts/hooks/delegation_nudge_hook.ts +105 -15
  903. package/src/scripts/hooks/design_pass_hook.ts +199 -13
  904. package/src/scripts/hooks/dispatch_hook.ts +13 -12
  905. package/src/scripts/hooks/egress_engine_loader.ts +125 -0
  906. package/src/scripts/hooks/egress_stage.ts +440 -0
  907. package/src/scripts/hooks/hook_stdin.ts +29 -4
  908. package/src/scripts/hooks/host_docs_pages.ts +194 -0
  909. package/src/scripts/hooks/host_docs_pages.yaml +75 -0
  910. package/src/scripts/hooks/host_lowering.json +1 -1
  911. package/src/scripts/hooks/host_lowering.yaml +22 -21
  912. package/src/scripts/hooks/host_rate_marker_hook.ts +73 -0
  913. package/src/scripts/hooks/instructions_observer_hook.ts +170 -0
  914. package/src/scripts/hooks/interruption_ledger_hook.ts +1 -1
  915. package/src/scripts/hooks/lazy_concern.ts +148 -0
  916. package/src/scripts/hooks/orchestration_record_hook.ts +80 -2
  917. package/src/scripts/hooks/payload_stub.ts +16 -6
  918. package/src/scripts/hooks/permission_gate.ts +7 -7
  919. package/src/scripts/hooks/push_settle_hook.ts +32 -3
  920. package/src/scripts/hooks/replay_hook.ts +43 -0
  921. package/src/scripts/hooks/reread_guard_hook.ts +87 -10
  922. package/src/scripts/hooks/rtk_wrap_hook.ts +4 -3
  923. package/src/scripts/hooks/rule_inject_hook.ts +8 -1
  924. package/src/scripts/hooks/session_eol_hook.ts +48 -1
  925. package/src/scripts/hooks/source_first_gate_hook.ts +6 -8
  926. package/src/scripts/hooks/spawn_guard_shadow_hook.ts +203 -10
  927. package/src/scripts/hooks/state_io.ts +2 -2
  928. package/src/scripts/hooks/svg_obligation.ts +553 -0
  929. package/src/scripts/hooks/svg_rules_loader.ts +133 -0
  930. package/src/scripts/hooks/tool_result_bytes_hook.ts +14 -5
  931. package/src/scripts/hooks/turn_end_gate_hook.ts +5 -3
  932. package/src/scripts/hooks/ui_route_nudge_hook.ts +2 -12
  933. package/src/scripts/hooks_doctor.ts +31 -0
  934. package/src/scripts/hooks_status.ts +58 -3
  935. package/src/scripts/inbox_source_census.ts +74 -13
  936. package/src/scripts/install +25 -3
  937. package/src/scripts/install.ts +60 -91
  938. package/src/scripts/interruption_report.ts +11 -1
  939. package/src/scripts/layer_baseline_report.ts +267 -0
  940. package/src/scripts/learning_sidecar.ts +1 -1
  941. package/src/scripts/lint_agents_layout.ts +3 -0
  942. package/src/scripts/lint_blocker_citations.ts +104 -0
  943. package/src/scripts/lint_breaking_changes_index.ts +40 -7
  944. package/src/scripts/lint_consolidation_lineage.ts +150 -19
  945. package/src/scripts/lint_consumer_internal_refs.ts +90 -42
  946. package/src/scripts/lint_context_spine_usage.ts +21 -0
  947. package/src/scripts/lint_design_antipattern_parity.ts +39 -7
  948. package/src/scripts/lint_design_quality.ts +60 -12
  949. package/src/scripts/lint_evidence_artifacts.ts +31 -0
  950. package/src/scripts/lint_example_fences.ts +11 -2
  951. package/src/scripts/lint_ghostwriter_source.ts +42 -10
  952. package/src/scripts/lint_hook_manifest.ts +94 -0
  953. package/src/scripts/lint_marketplace_install_completeness.ts +4 -0
  954. package/src/scripts/lint_mcp_config_security.ts +9 -11
  955. package/src/scripts/lint_motion_authority_drift.ts +27 -0
  956. package/src/scripts/lint_plan_risk_register.ts +28 -1
  957. package/src/scripts/lint_positioning.ts +4 -4
  958. package/src/scripts/lint_provenance.ts +1 -0
  959. package/src/scripts/lint_roadmap_blockers.ts +65 -4
  960. package/src/scripts/lint_roadmap_complexity.ts +98 -0
  961. package/src/scripts/lint_skill_link_reach.ts +251 -9
  962. package/src/scripts/lint_skill_procedures.ts +252 -0
  963. package/src/scripts/lint_skill_scripts_readonly.ts +12 -1
  964. package/src/scripts/lint_subagent_determinism.ts +14 -1
  965. package/src/scripts/lint_svg_asset.ts +365 -0
  966. package/src/scripts/lint_ticked_unmet_criteria.ts +300 -21
  967. package/src/scripts/mcp_registry_submit.sh +2 -2
  968. package/src/scripts/mcp_server/consumer_tool_catalog.json +4 -4
  969. package/src/scripts/mcp_server/suggest_skill.ts +89 -4
  970. package/src/scripts/mcp_server/tools.ts +2 -33
  971. package/src/scripts/measure_skill_ranker_baseline.ts +203 -5
  972. package/src/scripts/measure_turn_end_gate.ts +61 -1
  973. package/src/scripts/merge_clearance.ts +225 -0
  974. package/src/scripts/migrate_command_suggestions.ts +1 -1
  975. package/src/scripts/network_sources.ts +236 -0
  976. package/src/scripts/no_go_deny_rows.ts +225 -0
  977. package/src/scripts/orchestration_record.ts +15 -2
  978. package/src/scripts/plan_test_shards.ts +103 -0
  979. package/src/scripts/pr_url_reminder_hook.ts +10 -0
  980. package/src/scripts/print_required_checks.ts +5 -5
  981. package/src/scripts/probe_depth_shadow.ts +406 -0
  982. package/src/scripts/probe_turnaround.ts +342 -10
  983. package/src/scripts/ratification_subject.ts +176 -0
  984. package/src/scripts/rdp_gate_classify.ts +1 -0
  985. package/src/scripts/rdp_quality_eval.ts +1 -0
  986. package/src/scripts/release.ts +26 -55
  987. package/src/scripts/release_drill.ts +52 -23
  988. package/src/scripts/release_env.ts +37 -0
  989. package/src/scripts/release_publication.ts +11 -1
  990. package/src/scripts/report_consumer_gate_reach.ts +233 -0
  991. package/src/scripts/report_merge_gate_load.ts +295 -0
  992. package/src/scripts/report_project_contract.ts +123 -0
  993. package/src/scripts/report_reducible_classes.ts +342 -0
  994. package/src/scripts/report_required_checks_drift.ts +5 -3
  995. package/src/scripts/report_skill_host_census.ts +199 -0
  996. package/src/scripts/report_standing_payload_by_host.ts +7 -7
  997. package/src/scripts/retro.ts +758 -0
  998. package/src/scripts/retro_facts.ts +575 -0
  999. package/src/scripts/retro_queue.ts +739 -0
  1000. package/src/scripts/retro_session_facts.ts +218 -0
  1001. package/src/scripts/retro_sweep.ts +493 -0
  1002. package/src/scripts/retro_triage.ts +126 -0
  1003. package/src/scripts/roadmap_context.ts +2 -2
  1004. package/src/scripts/roadmap_drain_queue.ts +601 -0
  1005. package/src/scripts/run_supervise.ts +24 -2
  1006. package/src/scripts/schemas/agent-settings.schema.json +0 -16
  1007. package/src/scripts/schemas/command.schema.json +3 -3
  1008. package/src/scripts/schemas/review-findings.schema.json +8 -0
  1009. package/src/scripts/schemas/skill.schema.json +7 -6
  1010. package/src/scripts/schemas/subagent.schema.json +33 -2
  1011. package/src/scripts/score_skill_selection.ts +5 -2
  1012. package/src/scripts/second_brain_retrieval.ts +1 -0
  1013. package/src/scripts/second_brain_run.ts +1 -0
  1014. package/src/scripts/self_repair_cli.ts +563 -87
  1015. package/src/scripts/self_review_gate.ts +59 -4
  1016. package/src/scripts/session_register_hook.ts +91 -4
  1017. package/src/scripts/sessions_cli.ts +100 -5
  1018. package/src/scripts/skill_collision_clusters.ts +1 -1
  1019. package/src/scripts/skill_tools/score_skill_relevance.ts +31 -2
  1020. package/src/scripts/skill_trigger_eval.ts +4 -2
  1021. package/src/scripts/source_adapters.ts +183 -0
  1022. package/src/scripts/step_receipt.ts +100 -0
  1023. package/src/scripts/sync_pr_branch.ts +4 -0
  1024. package/src/scripts/test_council_qualification.ts +1 -1
  1025. package/src/scripts/trigger_eval_grandfather.json +3 -49
  1026. package/src/scripts/trigger_eval_rotation.ts +31 -3
  1027. package/src/scripts/ui_conformance_probe.ts +405 -1
  1028. package/src/scripts/update_counts.ts +230 -11
  1029. package/src/scripts/update_invite_hook.ts +245 -0
  1030. package/src/scripts/update_notice_hook.ts +298 -0
  1031. package/src/scripts/validate_frontmatter.ts +85 -0
  1032. package/src/scripts/worker_reuse_shadow_report.ts +121 -0
  1033. package/src/scripts/worktree_cleanup_check.ts +915 -121
  1034. package/src/server/io/yamlIO.ts +2 -2
  1035. package/src/server/schemas/settings.ts +37 -23
  1036. package/src/shared/brandTokenDocument.ts +46 -0
  1037. package/src/shared/brandTokenPaths.ts +43 -0
  1038. package/src/shared/settingsCarveOut.ts +0 -8
  1039. package/src/shared/skillRanking.ts +106 -5
  1040. package/src/shared/userMd/formAdapter.ts +15 -1
  1041. package/src/shared/userMd/schema.ts +22 -0
  1042. package/src/templates/agent-user.md +4 -0
  1043. package/src/templates/agent-user.yml +4 -0
  1044. package/dist/cli-delegate/chunk-523HCFYO.js +0 -90
  1045. package/dist/cli-delegate/chunk-AL3RZ22D.js +0 -74
  1046. package/dist/cli-delegate/chunk-KB5FZ655.js +0 -208
  1047. package/dist/cli-delegate/chunk-MDPPKQCQ.js +0 -875
  1048. package/dist/cli-delegate/chunk-MSUL5NYP.js +0 -1123
  1049. package/dist/cli-delegate/chunk-OAFSJBHH.js +0 -272
  1050. package/dist/ui/assets/index-C3djEJah.js +0 -23
  1051. package/src/scripts/_lib/continuation_ladder.ts +0 -335
  1052. package/src/scripts/hooks/run_continuation_hook.ts +0 -1524
@@ -1,23 +0,0 @@
1
- (function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,ee={},h=[],g=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,te=Array.isArray;function _(e,t){for(var n in t)e[n]=t[n];return e}function ne(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function v(t,n,r){var i,a,o,s={};for(o in n)o==`key`?i=n[o]:o==`ref`?a=n[o]:s[o]=n[o];if(arguments.length>2&&(s.children=arguments.length>3?e.call(arguments,2):r),typeof t==`function`&&t.defaultProps!=null)for(o in t.defaultProps)s[o]===void 0&&(s[o]=t.defaultProps[o]);return y(t,s,i,a,null)}function y(e,r,i,a,o){var s={type:e,props:r,key:i,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++n,__i:-1,__u:0};return o==null&&t.vnode!=null&&t.vnode(s),s}function b(e){return e.children}function re(e,t){this.props=e,this.context=t}function ie(e,t){if(t==null)return e.__?ie(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?ie(e):null}function x(e){if(e.__P&&e.__d){var n=e.__v,r=n.__e,i=[],a=[],o=_({},n);o.__v=n.__v+1,t.vnode&&t.vnode(o),fe(e.__P,o,n,e.__n,e.__P.namespaceURI,32&n.__u?[r]:null,i,r??ie(n),!!(32&n.__u),a),o.__v=n.__v,o.__.__k[o.__i]=o,me(i,o,a),n.__e=n.__=null,o.__e!=r&&S(o)}}function S(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),S(e)}function ae(e){(!e.__d&&(e.__d=!0)&&i.push(e)&&!C.__r++||a!=t.debounceRendering)&&((a=t.debounceRendering)||o)(C)}function C(){try{for(var e,t=1;i.length;)i.length>t&&i.sort(s),e=i.shift(),t=i.length,x(e)}finally{i.length=C.__r=0}}function oe(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,g,te,_=r&&r.__k||h,ne=t.length;for(c=se(n,t,_,c,ne),d=0;d<ne;d++)(p=n.__k[d])!=null&&(f=p.__i!=-1&&_[p.__i]||ee,p.__i=d,te=fe(e,p,f,i,a,o,s,c,l,u),m=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&_e(f.ref,null,p),u.push(p.ref,p.__c||m,p)),g==null&&m!=null&&(g=m),4&p.__u?(c=ce(p,c,e),f.__e&&(f.__e=null)):typeof p.type==`function`&&te!==void 0?c=te:m&&(c=m.nextSibling),p.__u&=-7);return n.__e=g,c}function se(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?o=e.__k[a]=y(null,o,null,null,null):te(o)?o=e.__k[a]=y(b,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=e.__k[a]=y(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[a]=o,c=a+f,o.__=e,o.__b=e.__b+1,s=null,(l=o.__i=le(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=ie(s)),ve(s,s));return r}function ce(e,t,n){var r,i;if(typeof e.type==`function`){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=ce(r[i],t,n));return t}e.__e!=t&&(t&&e.type&&!t.parentNode&&(t=ie(e)),t=n.insertBefore(e.__e,t||null));do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function le(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&!(2&l.__u);if(l===null&&s==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function ue(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n==null?``:typeof n!=`number`||g.test(t)?n:n+`px`}function w(e,t,n,r,i){var a,o;n:if(t==`style`){if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||ue(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||ue(e.style,t,n[t])}}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(d,`$1`)),o=t.toLowerCase(),t=o in e||t==`onFocusOut`||t==`onFocusIn`?o.slice(2):t.slice(2),e.l||={},e.l[t+a]=n,n?r?n[u]=r[u]:(n[u]=f,e.addEventListener(t,a?m:p,a)):e.removeEventListener(t,a?m:p,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function de(e){return function(n){if(this.l){var r=this.l[n.type+e];if(n[l]==null)n[l]=f++;else if(n[l]<r[u])return;return r(t.event?t.event(n):n)}}}function fe(e,n,r,i,a,o,s,c,l,u){var d,f,p,m,ee,g,v,y,x,S,ae,C,se,ce,le,ue,w=n.type;if(n.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),o=[c=n.__e=r.__e]),(d=t.__b)&&d(n);n:if(typeof w==`function`){f=s.length;try{if(x=n.props,S=w.prototype&&w.prototype.render,ae=(d=w.contextType)&&i[d.__c],C=d?ae?ae.props.value:d.__:i,r.__c?y=(p=n.__c=r.__c).__=p.__E:(S?n.__c=p=new w(x,C):(n.__c=p=new re(x,C),p.constructor=w,p.render=ye),ae&&ae.sub(p),p.state||(p.state={}),p.__n=i,m=p.__d=!0,p.__h=[],p._sb=[]),S&&p.__s==null&&(p.__s=p.state),S&&w.getDerivedStateFromProps!=null&&(p.__s==p.state&&(p.__s=_({},p.__s)),_(p.__s,w.getDerivedStateFromProps(x,p.__s))),ee=p.props,g=p.state,p.__v=n,m)S&&w.getDerivedStateFromProps==null&&p.componentWillMount!=null&&p.componentWillMount(),S&&p.componentDidMount!=null&&p.__h.push(p.componentDidMount);else{if(S&&w.getDerivedStateFromProps==null&&x!==ee&&p.componentWillReceiveProps!=null&&p.componentWillReceiveProps(x,C),n.__v==r.__v||!p.__e&&p.shouldComponentUpdate!=null&&!1===p.shouldComponentUpdate(x,p.__s,C)){n.__v!=r.__v&&(p.props=x,p.state=p.__s,p.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.some(function(e){e&&(e.__=n)}),h.push.apply(p.__h,p._sb),p._sb=[],p.__h.length&&s.push(p),c=ie(r);break n}p.componentWillUpdate!=null&&p.componentWillUpdate(x,p.__s,C),S&&p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(ee,g,v)})}if(p.context=C,p.props=x,p.__P=e,p.__e=!1,se=t.__r,ce=0,S)p.state=p.__s,p.__d=!1,se&&se(n),d=p.render(p.props,p.state,p.context),h.push.apply(p.__h,p._sb),p._sb=[];else do p.__d=!1,se&&se(n),d=p.render(p.props,p.state,p.context),p.state=p.__s;while(p.__d&&++ce<25);p.state=p.__s,p.getChildContext!=null&&(i=_(_({},i),p.getChildContext())),S&&!m&&p.getSnapshotBeforeUpdate!=null&&(v=p.getSnapshotBeforeUpdate(ee,g)),le=d!=null&&d.type===b&&d.key==null?he(d.props.children):d,c=oe(e,te(le)?le:[le],n,r,i,a,o,s,c,l,u),p.base=n.__e,n.__u&=-161,p.__h.length&&s.push(p),y&&(p.__E=p.__=null)}catch(e){if(s.length=f,n.__v=null,l||o!=null){if(e.then){for(n.__u|=l?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;o!=null&&(o[o.indexOf(c)]=null),n.__e=c}else if(o!=null)for(ue=o.length;ue--;)ne(o[ue])}else n.__e=r.__e;n.__k??=r.__k||[],e.then||pe(n),t.__e(e,n,r)}}else o==null&&n.__v==r.__v?(n.__k=r.__k,n.__e=r.__e):c=n.__e=ge(r.__e,n,r,i,a,o,s,l,u);return(d=t.diffed)&&d(n),128&n.__u?void 0:c}function pe(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(pe))}function me(e,n,r){for(var i=0;i<r.length;i++)_e(r[i],r[++i],r[++i]);t.__c&&t.__c(n,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(e){e.call(n)})}catch(e){t.__e(e,n.__v)}})}function he(e){return typeof e!=`object`||!e||e.__b>0?e:te(e)?e.map(he):e.constructor===void 0?_({},e):null}function ge(n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_,v=i.props||ee,y=r.props,b=r.type;if(b==`svg`?o=`http://www.w3.org/2000/svg`:b==`math`?o=`http://www.w3.org/1998/Math/MathML`:o||=`http://www.w3.org/1999/xhtml`,s!=null){for(d=0;d<s.length;d++)if((h=s[d])&&`setAttribute`in h==!!b&&(b?h.localName==b:h.nodeType==3)){n=h,s[d]=null;break}}if(n==null){if(b==null)return document.createTextNode(y);n=document.createElementNS(o,b,y.is&&y),l&&=(t.__m&&t.__m(r,s),!1),s=null}if(b==null)v===y||l&&n.data==y||(n.data=y);else{if(s=b==`textarea`&&y.defaultValue!=null?null:s&&e.call(n.childNodes),!l&&s!=null)for(v={},d=0;d<n.attributes.length;d++)v[(h=n.attributes[d]).name]=h.value;for(d in v)h=v[d],d==`dangerouslySetInnerHTML`?p=h:d==`children`||d in y||d==`value`&&`defaultValue`in y||d==`checked`&&`defaultChecked`in y||w(n,d,null,h,o);for(d in y)h=y[d],d==`children`?m=h:d==`dangerouslySetInnerHTML`?f=h:d==`value`?g=h:d==`checked`?_=h:l&&typeof h!=`function`||v[d]===h||w(n,d,h,v[d],o);if(f)l||p&&(f.__html==p.__html||f.__html==n.innerHTML)||(n.innerHTML=f.__html),r.__k=[];else if(p&&(n.innerHTML=``),oe(r.type==`template`?n.content:n,te(m)?m:[m],r,i,a,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:o,s,c,s?s[0]:i.__k&&ie(i,0),l,u),s!=null)for(d=s.length;d--;)ne(s[d]);l&&b!=`textarea`||(d=`value`,b==`progress`&&g==null?n.removeAttribute(`value`):g!=null&&(g!==n[d]||b==`progress`&&!g||b==`option`&&g!=v[d])&&w(n,d,g,v[d],o),d=`checked`,_!=null&&_!=n[d]&&w(n,d,_,v[d],o))}return n}function _e(e,n,r){try{if(typeof e==`function`){var i=typeof e.__u==`function`;i&&e.__u(),i&&n==null||(e.__u=e(n))}else e.current=n}catch(e){t.__e(e,r)}}function ve(e,n,r){var i,a;if(t.unmount&&t.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||_e(i,null,n)),(i=e.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){t.__e(e,n)}i.base=i.__P=i.__n=null}if(i=e.__k)for(a=0;a<i.length;a++)i[a]&&ve(i[a],n,r||typeof e.type!=`function`);r||ne(e.__e),e.__c=e.__=e.__e=void 0}function ye(e,t,n){return this.constructor(e,n)}function be(n,r,i){var a,o,s,c;r==document&&(r=document.documentElement),t.__&&t.__(n,r),o=(a=typeof i==`function`)?null:i&&i.__k||r.__k,s=[],c=[],fe(r,n=(!a&&i||r).__k=v(b,null,[n]),o||ee,ee,r.namespaceURI,!a&&i?[i]:o?null:r.firstChild?e.call(r.childNodes):null,s,!a&&i?i:o?o.__e:r.firstChild,a,c),me(s,n,c),n.props.children=null}e=h.slice,t={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},n=0,r=function(e){return e!=null&&e.constructor===void 0},re.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=_({},this.state);typeof e==`function`&&(e=e(_({},n),this.props)),e&&_(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),ae(this))},re.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ae(this))},re.prototype.render=b,i=[],o=typeof Promise==`function`?Promise.prototype.then.bind(Promise.resolve()):setTimeout,s=function(e,t){return e.__v.__b-t.__v.__b},C.__r=0,c=Math.random().toString(8),l=`__d`+c,u=`__a`+c,d=/(PointerCapture)$|Capture$/i,f=0,p=de(!1),m=de(!0);var xe,T,Se,Ce,we=0,Te=[],E=t,Ee=E.__b,De=E.__r,Oe=E.diffed,ke=E.__c,Ae=E.unmount,je=E.__;function Me(e,t){E.__h&&E.__h(T,e,we||t),we=0;var n=T.__H||(T.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function Ne(e){return we=1,Pe(He,e)}function Pe(e,t,n){var r=Me(xe++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):He(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=T,!T.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=!1,o=r.__c.props!==e;if(r.__c.__H.__.some(function(e){if(e.__N){i=!0;var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),a){var s=a.call(this,e,t,n);return i?s||o:s}return!i||o};T.__f=!0;var a=T.shouldComponentUpdate,o=T.componentWillUpdate;T.componentWillUpdate=function(e,t,n){if(this.__e){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},T.shouldComponentUpdate=i}return r.__N||r.__}function D(e,t){var n=Me(xe++,3);!E.__s&&Ve(n.__H,t)&&(n.__=e,n.u=t,T.__H.__h.push(n))}function Fe(e,t){var n=Me(xe++,7);return Ve(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Ie(){for(var e;e=Te.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(ze),t.__h.some(Be),t.__h=[]}catch(n){t.__h=[],E.__e(n,e.__v)}}}E.__b=function(e){T=null,Ee&&Ee(e)},E.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),je&&je(e,t)},E.__r=function(e){De&&De(e),xe=0;var t=(T=e.__c).__H;t&&(Se===T?(t.__h=[],T.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(ze),t.__h.some(Be),t.__h=[],xe=0)),Se=T},E.diffed=function(e){Oe&&Oe(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Te.push(t)!==1&&Ce===E.requestAnimationFrame||((Ce=E.requestAnimationFrame)||Re)(Ie)),t.__H.__.some(function(e){e.u&&=(e.__H=e.u,void 0)})),Se=T=null},E.__c=function(e,t){t.some(function(e){try{e.__h.some(ze),e.__h=e.__h.filter(function(e){return!e.__||Be(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],E.__e(n,e.__v)}}),ke&&ke(e,t)},E.unmount=function(e){Ae&&Ae(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{ze(e)}catch(e){t=e}}),n.__H=void 0,t&&E.__e(t,n.__v))};var Le=typeof requestAnimationFrame==`function`;function Re(e){var t,n=function(){clearTimeout(r),Le&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Le&&(t=requestAnimationFrame(n))}function ze(e){var t=T,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),T=t}function Be(e){var t=T;e.__c=e.__(),T=t}function Ve(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function He(e,t){return typeof t==`function`?t(e):t}var Ue=Symbol.for(`preact-signals`);function We(){if(Ye>1)Ye--;else{var e,t=!1;for((function(){var e=$e;for($e=void 0;e!==void 0;){var t=e.S;if(t.v===e.v)for(var n=t.t;n!==void 0;n=n.x)n.i===e.i&&(n.i=t.i);e=e.o}})();Je!==void 0;){var n=Je;for(Je=void 0,Xe++;n!==void 0;){var r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&nt(n))try{n.c()}catch(n){t||=(e=n,!0)}n=r}}if(Xe=0,Ye--,t)throw e}}function Ge(e){if(Ye>0)return e();Qe=++Ze,Ye++;try{return e()}finally{We()}}var Ke,O=void 0;function qe(e){var t=O,n=Ke;O=void 0,Ke=void 0;try{return e()}finally{O=t,Ke=n}}var Je=void 0,Ye=0,Xe=0,Ze=0,Qe=0,$e=void 0,et=0;function tt(e){if(O!==void 0){var t=e.n;if(t===void 0||t.t!==O)return t={i:0,S:e,p:O.s,n:void 0,t:O,e:void 0,x:void 0,r:t},O.s!==void 0&&(O.s.n=t),O.s=t,e.n=t,32&O.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=O.s,t.n=void 0,O.s.n=t,O.s=t),t}}function k(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}k.prototype.brand=Ue,k.prototype.h=function(){return!0},k.prototype.S=function(e){var t=this,n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n===void 0?qe(function(){var e;(e=t.W)==null||e.call(t)}):n.e=e)},k.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,r=e.x;n!==void 0&&(n.x=r,e.e=void 0),r!==void 0&&(r.e=n,e.x=void 0),e===this.t&&(this.t=r,r===void 0&&qe(function(){var e;(e=t.Z)==null||e.call(t)}))}},k.prototype.subscribe=function(e){var t=this;return dt(function(){var n=t.value;qe(function(){return e(n)})},{name:`sub`})},k.prototype.valueOf=function(){return this.value},k.prototype.toString=function(){return this.value+``},k.prototype.toJSON=function(){return this.value},k.prototype.peek=function(){var e=this;return qe(function(){return e.value})},Object.defineProperty(k.prototype,"value",{get:function(){var e=tt(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Xe>100)throw Error(`Cycle detected`);(function(e){Ye!==0&&Xe===0&&e.l!==Qe&&(e.l=Qe,$e={S:e,v:e.v,i:e.i,o:$e})})(this),this.v=e,this.i++,et++,Ye++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{We()}}}});function A(e,t){return new k(e,t)}function nt(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function rt(e){for(var t=e.s;t!==void 0;t=t.n){var n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function it(e){for(var t=e.s,n=void 0;t!==void 0;){var r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}e.s=n}function at(e,t){k.call(this,void 0,t),this.x=e,this.s=void 0,this.g=et-1,this.f=4}at.prototype=new k,at.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===et))return!0;if(this.g=et,this.f|=1,this.i>0&&!nt(this))return this.f&=-2,!0;var e=O;try{rt(this),O=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return O=e,it(this),this.f&=-2,!0},at.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}k.prototype.S.call(this,e)},at.prototype.U=function(e){if(this.t!==void 0&&(k.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}},at.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(at.prototype,"value",{get:function(){if(1&this.f)throw Error(`Cycle detected`);var e=tt(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function ot(e,t){return new at(e,t)}function st(e){var t=e.m;if(e.m=void 0,typeof t==`function`){Ye++;var n=O;O=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,ct(e),t}finally{O=n,We()}}}function ct(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,st(e)}function lt(e){if(O!==this)throw Error(`Out-of-order effect`);it(this),O=e,this.f&=-2,8&this.f&&ct(this),We()}function ut(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,Ke&&Ke.push(this)}ut.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t==`function`&&(this.m=t)}finally{e()}},ut.prototype.S=function(){if(1&this.f)throw Error(`Cycle detected`);this.f|=1,this.f&=-9,st(this),rt(this),Ye++;var e=O;return O=this,lt.bind(this,e)},ut.prototype.N=function(){2&this.f||(this.f|=2,this.u=Je,Je=this)},ut.prototype.d=function(){this.f|=8,1&this.f||ct(this)},ut.prototype.dispose=function(){this.d()};function dt(e,t){var n=new ut(e,t);try{n.c()}catch(e){throw n.d(),e}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}var ft,pt,mt=typeof window<`u`&&!!window.__PREACT_SIGNALS_DEVTOOLS__,ht=[];dt(function(){ft=this.N})();function gt(e,n){t[e]=n.bind(null,t[e]||function(){})}function _t(e){if(pt){var t=pt;pt=void 0,t()}pt=e&&e.S()}function vt(e){var t=this,n=e.data,i=bt(n);i.name=`ReactiveDom`,i.value=n;var a=Fe(function(){for(var e=t,n=t.__v;n=n.__;)if(n.__c){n.__c.__$f|=4;break}var a=ot(function(){var e=i.value.value;return e===0?0:!0===e?``:e||``}),o=ot(function(){return!Array.isArray(a.value)&&!r(a.value)}),s=dt(function(){if(this.N=Ct,o.value){var t=a.value;e.__v&&e.__v.__e&&e.__v.__e.nodeType===3&&(e.__v.__e.data=t)}}),c=t.__$u.d;return t.__$u.d=function(){s(),c.call(this)},[o,a]},[]),o=a[0],s=a[1];return o.value?s.peek():s.value}vt.displayName=`ReactiveTextNode`,Object.defineProperties(k.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:vt},props:{configurable:!0,get:function(){var e=this;return{data:{get value(){return e.value}}}}},__b:{configurable:!0,value:1}}),gt(`__b`,function(e,t){if(typeof t.type==`string`){var n,r=t.props;for(var i in r)if(i!==`children`){var a=r[i];a instanceof k&&(n||(t.__np=n={}),n[i]=a,r[i]=a.peek())}}e(t)}),gt(`__r`,function(e,t){if(e(t),t.type!==b){_t();var n,r=t.__c;r&&(r.__$f&=-2,(n=r.__$u)===void 0&&(r.__$u=n=function(e,t){var n;return dt(function(){n=this},{name:t}),n.c=e,n}(function(e){return function(){var t;mt&&((t=this.y)==null||t.call(this)),e.__$f|=1,e.setState({})}}(r),typeof t.type==`function`?t.type.displayName||t.type.name:``))),_t(n)}}),gt(`__e`,function(e,t,n,r){_t(),e(t,n,r)}),gt(`diffed`,function(e,t){_t();var n;if(typeof t.type==`string`&&(n=t.__e)){var r=t.__np,i=t.props,a=n.U;if(a)for(var o in a){var s=a[o];s===void 0||r&&o in r||(s.d(),a[o]=void 0)}if(r)for(var c in a||(a={},n.U=a),r){var l=a[c],u=r[c];l===void 0?(l=yt(n,c,u,i),a[c]=l):l.o(u,i)}}e(t)});function yt(e,t,n,r){var i=t in e&&e.ownerSVGElement===void 0,a=A(n);return{o:function(e,t){a.value=e,r=t},d:dt(function(){this.N=Ct;var n=a.value.value;r[t]!==n&&(r[t]=n,i?e[t]=n:n!=null&&(!1!==n||t[4]===`-`)?e.setAttribute(t,n):e.removeAttribute(t))})}}gt(`unmount`,function(e,t){if(typeof t.type==`string`){var n=t.__e;if(n){var r=n.U;if(r)for(var i in n.U=void 0,r){var a=r[i];a&&a.d()}}var o=t.__np;if(o){var s=t.props;for(var c in o)s[c]=o[c]}t.__np=void 0}else{var l=t.__c;if(l){var u=l.__$u;u&&(l.__$u=void 0,u.d())}}e(t)}),gt(`__h`,function(e,t,n,r){r<3&&(t.__$f|=2),e(t,n,r)}),re.prototype.shouldComponentUpdate=function(e,t){if(this.__R)return!0;var n=this.__$u,r=n&&n.s!==void 0;for(var i in t)return!0;if(this.__f||typeof this.u==`boolean`&&!0===this.u){var a=2&this.__$f;if(!(r||a||4&this.__$f)||1&this.__$f)return!0}else if(!(r||4&this.__$f)||3&this.__$f)return!0;for(var o in e)if(o!==`__source`&&e[o]!==this.props[o])return!0;for(var s in this.props)if(!(s in e))return!0;return!1};function bt(e,t){return Fe(function(){return A(e,t)},[])}var xt=function(e){queueMicrotask(function(){queueMicrotask(e)})};function St(){Ge(function(){for(var e;e=ht.shift();)ft.call(e)})}function Ct(){ht.push(this)===1&&(t.requestAnimationFrame||xt)(St)}function wt(){let e=window.location.hash;return e===``||e===`#`?`/`:e.startsWith(`#`)?e.slice(1):e}var Tt=A(wt());function Et(e){let t=e.startsWith(`/`)?e:`/${e}`;`#${t}`!==window.location.hash&&(window.location.hash=t)}var Dt=!1;function Ot(){Dt||(Dt=!0,window.addEventListener(`hashchange`,()=>{Tt.value=wt()}))}var kt=null;function At(e){kt=e}var j=class extends Error{status;body;constructor(e,t,n){super(n),this.status=e,this.body=t}};async function M(e,t={}){let n={Accept:`application/json`,...t.headers??{}};kt!==null&&(n.Authorization=`Bearer ${kt}`);let{body:r,...i}=t,a={...i,headers:n};r!==void 0&&(a.body=JSON.stringify(r),n[`Content-Type`]=`application/json`);let o=await fetch(e,a),s=await o.text(),c=s===``?{}:JSON.parse(s);if(!o.ok){let e=c.error?.message??`request failed (${o.status})`;throw new j(o.status,c,e)}return c}async function jt(e,t,n,r={}){let i={Accept:`text/event-stream`,"Content-Type":`application/json`,...r.headers??{}};kt!==null&&(i.Authorization=`Bearer ${kt}`);let a=await fetch(e,{...r,method:`POST`,headers:i,body:JSON.stringify(t)});if(!a.ok||a.body===null){let e=await a.text().catch(()=>``),t={};try{t=e===``?{}:JSON.parse(e)}catch{}throw new j(a.status,t,t.error?.message??`stream failed (${a.status})`)}let o=a.body.getReader(),s=new TextDecoder,c=``,l=e=>{for(let t of e.split(`
2
- `)){if(!t.startsWith(`data:`))continue;let e=t.slice(5).trim();if(e!==``)try{n(JSON.parse(e))}catch{}}};for(;;){let{done:e,value:t}=await o.read();if(e)break;c+=s.decode(t,{stream:!0});let n=c.indexOf(`
3
-
4
- `);for(;n!==-1;)l(c.slice(0,n)),c=c.slice(n+2),n=c.indexOf(`
5
-
6
- `)}c.trim()!==``&&l(c)}var Mt=A(null);async function Nt(){try{let e=await M(`/api/v1/ping`);Mt.value={...e,projectScopeAvailable:e.projectScopeAvailable===!0,projectSurface:e.projectSurface===!0,devSurfaces:e.devSurfaces===!0}}catch{Mt.value=null}}function N(e){switch(e.code){case`VALIDATION`:return`Some fields need attention before saving.`;case`CONFLICT`:return`This file changed on disk while you were editing. Review the latest version and re-save.`;case`PRECONDITION_REQUIRED`:return`Reload the page once — the optimistic-lock token is missing.`;case`NOT_FOUND`:return`The file does not exist yet. Use the wizard to create it.`;case`ATOMIC_WRITE`:return`Write failed mid-flight. The file was not partially modified.`;case`YAML_PARSE`:return`YAML parse error — fix the file by hand, then reload.`;default:return e.message}}function Pt(e){return/expected (boolean|string|number)/i.test(e)?e.replace(/^expected/i,`Expected`):e}function Ft(e){let t={};for(let n of e.fields??[])t[n.path]=Pt(n.message);return t}var It=0;Array.isArray;function P(e,n,r,i,a,o){n||={};var s,c,l=n;if(`ref`in l)for(c in l={},n)c==`ref`?s=n[c]:l[c]=n[c];var u={type:e,props:l,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--It,__i:-1,__u:0,__source:a,__self:o};if(typeof e==`function`&&(s=e.defaultProps))for(c in s)l[c]===void 0&&(l[c]=s[c]);return t.vnode&&t.vnode(u),u}function Lt({id:e,children:t}){return P(`p`,{class:`ac-field__description`,id:e,children:t})}function Rt({id:e,children:t}){return P(`p`,{class:`ac-field__error`,id:e,role:`alert`,"aria-live":`polite`,children:t})}function zt({id:e,label:t,description:n,error:r,children:i}){let a=n===void 0?void 0:`${e}-desc`,o=r===void 0?void 0:`${e}-err`;return P(`div`,{class:`ac-field`,"data-invalid":r===void 0?void 0:`true`,children:[P(`label`,{class:`ac-field__label`,for:e,children:t}),n===void 0?null:P(Lt,{id:a,children:n}),P(`div`,{class:`ac-field__control`,"aria-describedby":a,"aria-errormessage":o,children:i}),r===void 0?null:P(Rt,{id:o,children:r})]})}function Bt(e){return P(zt,{id:e.id,label:e.label,description:e.description,error:e.error,children:P(`input`,{class:`ac-input`,type:`text`,id:e.id,name:e.name,value:e.value,placeholder:e.placeholder,"aria-invalid":e.error===void 0?void 0:`true`,onInput:t=>e.onChange(t.currentTarget.value)})})}function Vt(e){let t=e.step??(e.integer===!0?1:`any`);return P(zt,{id:e.id,label:e.label,description:e.description,error:e.error,children:P(`input`,{class:`ac-input`,type:`number`,id:e.id,name:e.name,value:Number.isFinite(e.value)?String(e.value):`0`,min:e.min,max:e.max,step:t,"aria-invalid":e.error===void 0?void 0:`true`,onInput:t=>{let n=t.currentTarget.value,r=n===``?0:Number(n);e.onChange(Number.isFinite(r)?r:0)}})})}function Ht(e){return P(zt,{id:e.id,label:e.label,description:e.description,error:e.error,children:P(`label`,{class:`ac-toggle`,children:[P(`input`,{type:`checkbox`,id:e.id,name:e.name,checked:e.value,"aria-invalid":e.error===void 0?void 0:`true`,onChange:t=>e.onChange(t.currentTarget.checked)}),P(`span`,{class:`ac-toggle__track`,"aria-hidden":`true`}),P(`span`,{class:`ac-toggle__state`,children:e.value?`On`:`Off`})]})})}function Ut(e){let t=e.options.length>3;return P(zt,{id:e.id,label:e.label,description:e.description,error:e.error,children:t?P(`select`,{class:`ac-input`,id:e.id,name:e.name,value:e.value,"aria-invalid":e.error===void 0?void 0:`true`,onChange:t=>e.onChange(t.currentTarget.value),children:e.options.map(e=>P(`option`,{value:e.value,children:e.label??(e.value===``?`(none)`:e.value)},e.value))}):P(`div`,{class:`ac-radio-group`,role:`radiogroup`,"aria-labelledby":`${e.id}-label`,children:e.options.map(t=>{let n=`${e.id}-${t.value||`none`}`;return P(`label`,{class:`ac-radio`,for:n,children:[P(`input`,{type:`radio`,id:n,name:e.name,value:t.value,checked:t.value===e.value,onChange:()=>e.onChange(t.value)}),P(`span`,{children:t.label??(t.value===``?`(none)`:t.value)})]},t.value)})})})}function Wt(e){return P(zt,{id:e.id,label:e.label,description:e.description,error:e.error,children:P(`textarea`,{class:`ac-textarea`,id:e.id,name:e.name,rows:e.rows??6,placeholder:e.placeholder,"aria-invalid":e.error===void 0?void 0:`true`,onInput:t=>e.onChange(t.currentTarget.value),children:e.value})})}function Gt(e){return e.replace(/_/g,` `).replace(/\./g,` › `).replace(/\b\w/g,e=>e.toUpperCase())}function Kt(e){return e.enum!==void 0&&e.enum.length>0?`enum`:e.type===`integer`?`integer`:e.type===`number`?`number`:e.type===`boolean`?`boolean`:e.type===`string`?`string`:e.type===`array`&&e.items?.type===`string`?`array-of-strings`:`unsupported`}function qt(e,t){return{path:e,kind:Kt(t),label:Gt(e[e.length-1]??``),description:t.description,options:t.enum,min:t.minimum,max:t.maximum,defaultValue:t.default}}function Jt(e){let t=[],n=e.properties??{};for(let[e,r]of Object.entries(n))if(r.type===`object`&&r.properties!==void 0){let n=[];for(let[t,i]of Object.entries(r.properties))if(i.type===`object`&&i.properties!==void 0)for(let[r,a]of Object.entries(i.properties))n.push(qt([e,t,r],a));else n.push(qt([e,t],i));t.push({path:[e],label:Gt(e),description:r.description,fields:n})}else{let n=t.find(e=>e.path[0]===`__general`),i=qt([e],r);n===void 0?t.unshift({path:[`__general`],label:`General`,fields:[i]}):n.fields.push(i)}return t}function Yt(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n||Array.isArray(n))return;n=n[e]}return n}function Xt(e,t,n){if(t.length===0)return e;let[r,...i]=t;if(r===void 0)return e;let a={...e};if(i.length===0)return a[r]=n,a;let o=a[r];return a[r]=Xt(typeof o==`object`&&o&&!Array.isArray(o)?o:{},i,n),a}function Zt(e){return e.join(`.`)}function Qt(e,t,n,r){let i=Zt(e.path),a=i,o=Yt(t,e.path),s=n[i],c=n=>{r(Xt(t,e.path,n))};switch(e.kind){case`string`:{let t=typeof o==`string`?o:``;return t.length>80?P(Wt,{id:i,name:a,label:e.label,description:e.description,error:s,value:t,onChange:c}):P(Bt,{id:i,name:a,label:e.label,description:e.description,error:s,value:t,onChange:c})}case`enum`:{let t=typeof o==`string`||typeof o==`number`?String(o):``,n=(e.options??[]).map(e=>({value:String(e)}));return P(Ut,{id:i,name:a,label:e.label,description:e.description,error:s,value:t,options:n,onChange:c})}case`number`:case`integer`:{let t=typeof o==`number`?o:0;return P(Vt,{id:i,name:a,label:e.label,description:e.description,error:s,value:t,integer:e.kind===`integer`,min:e.min,max:e.max,onChange:c})}case`boolean`:{let t=typeof o==`boolean`&&o;return P(Ht,{id:i,name:a,label:e.label,description:e.description,error:s,value:t,onChange:c})}case`array-of-strings`:{let t=(Array.isArray(o)?o.filter(e=>typeof e==`string`):[]).join(`
7
- `);return P(Wt,{id:i,name:a,label:e.label,description:`${e.description??``} (one entry per line)`.trim(),error:s,value:t,onChange:e=>{let t=e.split(`
8
- `).map(e=>e.trim()).filter(e=>e!==``);c(t)}})}default:return null}}function $t({field:e,values:t,errors:n,onChange:r,decorate:i}){let a=Zt(e.path),o=i?.(a,e);return o===void 0?P(`div`,{children:Qt(e,t,n,r)},a):P(`div`,{class:`ac-field-row${o.modified?` ac-field-row--modified`:``}`,children:[P(`div`,{class:`ac-field-row__body`,children:Qt(e,t,n,r)}),P(`div`,{class:`ac-field-row__meta`,children:[o.sourceLabel===void 0?null:P(`span`,{class:`ac-badge ac-badge--source`,title:`Value set in the ${o.sourceLabel} layer`,children:o.sourceLabel}),o.modified&&o.onReset!==void 0?P(`button`,{type:`button`,class:`ac-field-row__reset`,title:`Reset to default`,onClick:o.onReset,children:`Reset`}):null]})]})}function en({section:e,values:t,errors:n,onChange:r,decorate:i,footer:a}){return P(`section`,{class:`ac-section`,"aria-labelledby":`section-${Zt(e.path)}`,children:[P(`h2`,{class:`ac-section__title`,id:`section-${Zt(e.path)}`,children:e.label}),e.description===void 0?null:P(`p`,{class:`ac-section__description`,children:e.description}),P(`div`,{class:`ac-section__fields`,children:e.fields.map(e=>P($t,{field:e,values:t,errors:n,onChange:r,decorate:i},Zt(e.path)))}),a]})}function tn(e){let t=Jt(e.schema),n=e.errors??{};return P(`form`,{class:`ac-form`,onSubmit:e=>e.preventDefault(),children:[t.map(t=>P(en,{section:t,values:e.values,errors:n,onChange:e.onChange,decorate:e.decorate},Zt(t.path))),e.actions===void 0?null:P(`div`,{class:`ac-form__actions`,children:e.actions})]})}function nn(e){let[t]=Ne(()=>`${e.id}-list`);return P(zt,{id:e.id,label:e.label,description:e.description,error:e.error,children:[P(`input`,{class:`ac-input`,type:`text`,id:e.id,name:e.name,value:e.value,placeholder:e.placeholder,list:t,"aria-invalid":e.error===void 0?void 0:`true`,onInput:t=>e.onChange(t.currentTarget.value)}),P(`datalist`,{id:t,children:e.suggestions.map(e=>P(`option`,{value:e},e))})]})}var rn=[`developer`,`reviewer`,`designer`,`product-manager`,`ops`,`qa`,`maintainer`],an=[`de`,`en`,`en-US`,`en-GB`,`fr`,`es`,`it`,`nl`,`pt`,`pt-BR`];function on(){return new Date().toISOString().slice(0,10)}function sn(e,t){return e?.[t]}function cn({value:e,onChange:t,errors:n,hideRole:r,hideIdentityBasics:i}){let[a,o]=Ne(``),s=`umd-role-suggestions`;function c(n){t({...e,...n,last_updated:on()})}let l=e.role.filter(e=>e.trim()!==``);function u(e){let t=e.trim();if(t===``||l.includes(t)){o(``);return}c({role:[...l,t]}),o(``)}function d(e){l.length<=1||c({role:l.filter(t=>t!==e)})}function f(n){let r={...e,last_updated:on()};n===``?delete r.notes:r.notes=n,t(r)}let p=rn.filter(e=>!l.includes(e));return P(`div`,{class:`ac-user-md-form`,children:[i?null:P(Bt,{id:`umd-name`,name:`identity.name`,label:`Name`,description:`How the agent addresses you in chat (e.g. "Matze", "Sarah"). Required.`,value:e.identity.name,error:sn(n,`identity.name`),onChange:t=>c({identity:{...e.identity,name:t}})}),i?null:P(nn,{id:`umd-language`,name:`language`,label:`Language`,description:`BCP-47 tag the agent mirrors in replies (e.g. 'de', 'en', 'en-US').`,value:e.language,suggestions:an,error:sn(n,`language`),onChange:e=>c({language:e})}),r?null:P(zt,{id:`umd-role-input`,label:`Roles`,description:`One or more roles. Seeded suggestions are non-binding — type anything and press Enter.`,error:sn(n,`role`),children:[P(`ul`,{class:`ac-chip-list`,"data-testid":`umd-role-list`,children:l.map(e=>P(`li`,{class:`ac-chip`,children:[P(`span`,{children:e}),P(`button`,{type:`button`,class:`ac-chip__remove`,"aria-label":`Remove ${e}`,disabled:l.length<=1,onClick:()=>d(e),children:`×`})]},e))}),P(`div`,{class:`ac-role-add`,children:[P(`input`,{class:`ac-input`,type:`text`,id:`umd-role-input`,name:`role-add`,list:s,placeholder:`Add a role and press Enter`,value:a,onInput:e=>o(e.currentTarget.value),onKeyDown:e=>{(e.key===`Enter`||e.key===`,`)&&(e.preventDefault(),u(a))}}),P(`datalist`,{id:s,children:p.map(e=>P(`option`,{value:e},e))}),P(`button`,{type:`button`,class:`ac-button`,onClick:()=>u(a),children:`Add role`})]})]}),P(Ut,{id:`umd-pace`,name:`style.pace`,label:`Pace`,value:e.style.pace,error:sn(n,`style.pace`),options:[{value:`pragmatic`,label:`Pragmatic`},{value:`thorough`,label:`Thorough`},{value:`rapid`,label:`Rapid`}],onChange:t=>c({style:{...e.style,pace:t}})}),P(Wt,{id:`umd-voice`,name:`voice_sample`,label:`Voice sample`,description:`One to three sentences in your own style. The agent uses it as a tone anchor.`,rows:4,value:e.voice_sample,error:sn(n,`voice_sample`),onChange:e=>c({voice_sample:e})}),P(Wt,{id:`umd-notes`,name:`notes`,label:`Notes`,description:`Optional free-form prose the agent remembers across sessions.`,rows:6,value:e.notes??``,error:sn(n,`notes`),onChange:f})]})}function ln(){return{version:1,identity:{name:``},language:`en`,role:[],style:{pace:`pragmatic`},voice_sample:``,last_updated:`1970-01-01`}}function un(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function dn(e,t){return typeof e==`string`?e:t}function fn(e){return e===`thorough`||e===`rapid`?e:`pragmatic`}function pn(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`&&e.trim()!==``):[]}function mn(e){if(typeof e==`string`)return e===``?void 0:e}function hn(e){let t=ln(),n=un(e.identity)?e.identity:{},r=un(e.style)?e.style:{},i=mn(e.notes),a={version:1,identity:{name:dn(n.name,t.identity.name)},language:dn(e.language,t.language),role:pn(e.role),style:{pace:fn(r.pace)},voice_sample:dn(e.voice_sample,t.voice_sample),last_updated:dn(e.last_updated,t.last_updated)};return i!==void 0&&(a.notes=i),a}var F=Symbol(`NOT_RESOLVED`);function I(e,t){return{tagName:e,nodeKind:`scalar`,implicit:t.implicit??!1,matchByTagPrefix:t.matchByTagPrefix??!1,implicitFirstChars:t.implicitFirstChars??null,resolve:t.resolve,identify:t.identify,represent:t.represent??(e=>String(e)),representTagName:t.representTagName??(()=>e)}}function gn(e,t){let n=t.finalize===void 0;return{tagName:e,nodeKind:`sequence`,implicit:!1,matchByTagPrefix:t.matchByTagPrefix??!1,create:t.create,addItem:t.addItem,finalize:t.finalize??(e=>e),carrierIsResult:n,identify:t.identify,represent:t.represent??(e=>e),representTagName:t.representTagName??(()=>e)}}function _n(e,t){let n=t.finalize===void 0;return{tagName:e,nodeKind:`mapping`,implicit:!1,matchByTagPrefix:t.matchByTagPrefix??!1,create:t.create,addPair:t.addPair,has:t.has,keys:t.keys,get:t.get,finalize:t.finalize??(e=>e),carrierIsResult:n,identify:t.identify,represent:t.represent??(e=>e),representTagName:t.representTagName??(()=>e)}}var vn=I(`tag:yaml.org,2002:str`,{resolve:e=>e,identify:e=>typeof e==`string`}),yn=[``,`~`,`null`,`Null`,`NULL`],bn=I(`tag:yaml.org,2002:null`,{implicit:!0,implicitFirstChars:[``,`~`,`n`,`N`],resolve:e=>yn.indexOf(e)===-1?F:null,identify:e=>e===null,represent:()=>`null`}),xn=I(`tag:yaml.org,2002:null`,{implicit:!0,implicitFirstChars:[`n`],resolve:(e,t)=>e===`null`||t&&e===``?null:F,identify:e=>e===null,represent:()=>`null`}),Sn=[``,`~`,`null`,`Null`,`NULL`],Cn=I(`tag:yaml.org,2002:null`,{implicit:!0,implicitFirstChars:[``,`~`,`n`,`N`],resolve:e=>Sn.indexOf(e)===-1?F:null,identify:e=>e===null,represent:()=>`null`}),wn=[`true`,`True`,`TRUE`],Tn=[`false`,`False`,`FALSE`],En=I(`tag:yaml.org,2002:bool`,{implicit:!0,implicitFirstChars:[`t`,`T`,`f`,`F`],resolve:e=>wn.indexOf(e)!==-1||Tn.indexOf(e)===-1&&F,identify:e=>Object.prototype.toString.call(e)===`[object Boolean]`,represent:e=>e?`true`:`false`}),Dn=[`true`],On=[`false`],kn=I(`tag:yaml.org,2002:bool`,{implicit:!0,implicitFirstChars:[`t`,`f`],resolve:e=>Dn.indexOf(e)!==-1||On.indexOf(e)===-1&&F,identify:e=>Object.prototype.toString.call(e)===`[object Boolean]`,represent:e=>e?`true`:`false`}),An=[`true`,`True`,`TRUE`,`y`,`Y`,`yes`,`Yes`,`YES`,`on`,`On`,`ON`],jn=[`false`,`False`,`FALSE`,`n`,`N`,`no`,`No`,`NO`,`off`,`Off`,`OFF`],Mn=I(`tag:yaml.org,2002:bool`,{implicit:!0,implicitFirstChars:[`y`,`Y`,`n`,`N`,`t`,`T`,`f`,`F`,`o`,`O`],resolve:e=>An.indexOf(e)!==-1||jn.indexOf(e)===-1&&F,identify:e=>Object.prototype.toString.call(e)===`[object Boolean]`,represent:e=>e?`true`:`false`}),Nn=RegExp(`^(?:0o[0-7]+|0x[0-9a-fA-F]+|[-+]?[0-9]+)$`),Pn=RegExp(`^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$`);function Fn(e){let t=e,n=1;return(t[0]===`-`||t[0]===`+`)&&(t[0]===`-`&&(n=-1),t=t.slice(1)),t.startsWith(`0b`)?n*parseInt(t.slice(2),2):t.startsWith(`0o`)?n*parseInt(t.slice(2),8):t.startsWith(`0x`)?n*parseInt(t.slice(2),16):n*parseInt(t,10)}function In(e,t){if(t){if(!Pn.test(e))return F}else if(!Nn.test(e))return F;let n=Fn(e);return Number.isFinite(n)?n:F}var Ln=I(`tag:yaml.org,2002:int`,{implicit:!0,implicitFirstChars:[`-`,`+`,...`0123456789`],resolve:In,identify:e=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf(`e`)<0,represent:e=>e.toString(10)}),Rn=RegExp(`^-?(?:0|[1-9][0-9]*)$`),zn=RegExp(`^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$`);function Bn(e){let t=e,n=1;return(t[0]===`-`||t[0]===`+`)&&(t[0]===`-`&&(n=-1),t=t.slice(1)),t.startsWith(`0b`)?n*parseInt(t.slice(2),2):t.startsWith(`0o`)?n*parseInt(t.slice(2),8):t.startsWith(`0x`)?n*parseInt(t.slice(2),16):n*parseInt(t,10)}function Vn(e,t){if(t){if(!zn.test(e))return F}else if(!Rn.test(e))return F;let n=Bn(e);return Number.isFinite(n)?n:F}var Hn=I(`tag:yaml.org,2002:int`,{implicit:!0,implicitFirstChars:[`-`,...`0123456789`],resolve:Vn,identify:e=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf(`e`)<0,represent:e=>e.toString(10)}),Un=RegExp(`^(?:[-+]?0b[0-1_]+|[-+]?0[0-7_]+|[-+]?0x[0-9a-fA-F_]+|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+|[-+]?(?:0|[1-9][0-9_]*))$`);function Wn(e){let t=e.replace(/_/g,``),n=1;if((t[0]===`-`||t[0]===`+`)&&(t[0]===`-`&&(n=-1),t=t.slice(1)),t.startsWith(`0b`))return n*parseInt(t.slice(2),2);if(t.startsWith(`0x`))return n*parseInt(t.slice(2),16);if(t.includes(`:`)){let e=0;for(let n of t.split(`:`))e=e*60+Number(n);return n*e}return t!==`0`&&t[0]===`0`?n*parseInt(t,8):n*parseInt(t,10)}function Gn(e){if(!Un.test(e))return F;let t=Wn(e);return Number.isFinite(t)?t:F}var Kn=I(`tag:yaml.org,2002:int`,{implicit:!0,implicitFirstChars:[`-`,`+`,...`0123456789`],resolve:Gn,identify:e=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf(`e`)<0,represent:e=>e.toString(10)}),qn=RegExp(`^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`),Jn=RegExp(`^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`);function Yn(e){if(!qn.test(e))return F;let t=e.toLowerCase(),n=t[0]===`-`?-1:1;if(`+-`.includes(t[0])&&(t=t.slice(1)),t===`.inf`)return n===1?1/0:-1/0;if(t===`.nan`)return NaN;let r=n*parseFloat(t);return Number.isFinite(r)||Jn.test(e)?r:F}function Xn(e){if(isNaN(e))return`.nan`;if(e===1/0)return`.inf`;if(e===-1/0)return`-.inf`;if(Object.is(e,-0))return`-0.0`;let t=e.toString(10);return/^[-+]?[0-9]+e/.test(t)?t.replace(`e`,`.e`):t}var Zn=I(`tag:yaml.org,2002:float`,{implicit:!0,implicitFirstChars:[`-`,`+`,`.`,...`0123456789`],resolve:Yn,identify:e=>typeof e==`number`&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf(`e`)>=0),represent:Xn}),Qn=RegExp(`^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$`),$n=RegExp(`^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`);function er(e,t){if(t){if(!$n.test(e))return F;let t=e.toLowerCase(),n=t[0]===`-`?-1:1;if(`+-`.includes(t[0])&&(t=t.slice(1)),t===`.inf`)return n===1?1/0:-1/0;if(t===`.nan`)return NaN;let r=n*parseFloat(t);return Number.isFinite(r)?r:F}if(!Qn.test(e))return F;let n=Number(e);return Number.isFinite(n)?n:F}function tr(e){if(isNaN(e))return`.nan`;if(e===1/0)return`.inf`;if(e===-1/0)return`-.inf`;if(Object.is(e,-0))return`-0.0`;let t=e.toString(10);return/^[-+]?[0-9]+e/.test(t)?t.replace(`e`,`.e`):t}var nr=I(`tag:yaml.org,2002:float`,{implicit:!0,implicitFirstChars:[`-`,...`0123456789`],resolve:er,identify:e=>typeof e==`number`&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf(`e`)>=0),represent:tr}),rr=RegExp(`^(?:[-+]?(?:(?:[0-9][0-9_]*)?\\.[0-9_]*)(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`),ir=RegExp(`^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`);function ar(e){if(!rr.test(e))return F;let t=e.toLowerCase().replace(/_/g,``),n=t[0]===`-`?-1:1;if(`+-`.includes(t[0])&&(t=t.slice(1)),t===`.inf`)return n===1?1/0:-1/0;if(t===`.nan`)return NaN;let r=0;if(t.includes(`:`)){for(let e of t.split(`:`))r=r*60+Number(e);r*=n}else r=n*parseFloat(t);return Number.isFinite(r)||ir.test(e)?r:F}function or(e){if(isNaN(e))return`.nan`;if(e===1/0)return`.inf`;if(e===-1/0)return`-.inf`;if(Object.is(e,-0))return`-0.0`;let t=e.toString(10);return/^[-+]?[0-9]+e/.test(t)?t.replace(`e`,`.e`):t}var sr=I(`tag:yaml.org,2002:float`,{implicit:!0,implicitFirstChars:[`-`,`+`,`.`,...`0123456789`],resolve:ar,identify:e=>typeof e==`number`&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf(`e`)>=0),represent:or}),cr=I(`tag:yaml.org,2002:merge`,{implicit:!0,implicitFirstChars:[`<`],resolve:(e,t)=>e===`<<`||t&&e===``?`<<`:F,identify:()=>!1}),lr=/^[A-Za-z0-9+/]*={0,2}$/;function ur(e){let t=e.replace(/\s/g,``);if(t.length%4!=0||!lr.test(t))return F;let n=atob(t),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r}function dr(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}var fr=I(`tag:yaml.org,2002:binary`,{resolve:ur,identify:e=>Object.prototype.toString.call(e)===`[object Uint8Array]`,represent:dr}),pr=RegExp(`^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$`),mr=RegExp(`^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$`);function hr(e,t,n,r=0,i=0,a=0,o=0){let s=new Date(Date.UTC(e,t,n,r,i,a,o));return s.setUTCFullYear(e,t,n),s}function gr(e){let t=pr.exec(e);if(t===null&&(t=mr.exec(e)),t===null)return F;let n=+t[1],r=t[2]-1,i=+t[3];if(!t[4]){let e=hr(n,r,i);return e.getUTCFullYear()!==n||e.getUTCMonth()!==r||e.getUTCDate()!==i?F:e}let a=+t[4],o=+t[5],s=+t[6],c=0;if(a>23||o>59||s>59)return F;if(t[7]){let e=t[7].slice(0,3);for(;e.length<3;)e+=`0`;c=+e}let l=hr(n,r,i,a,o,s,c);if(l.getUTCFullYear()!==n||l.getUTCMonth()!==r||l.getUTCDate()!==i)return F;if(t[9]){let e=+t[10],n=+(t[11]||0);if(e>23||n>59)return F;let r=(e*60+n)*6e4;l.setTime(l.getTime()-(t[9]===`-`?-r:r))}return l}var _r=I(`tag:yaml.org,2002:timestamp`,{implicit:!0,implicitFirstChars:[...`0123456789`],resolve:gr,identify:e=>e instanceof Date,represent:e=>e.toISOString()}),vr=gn(`tag:yaml.org,2002:seq`,{create:()=>[],addItem:(e,t)=>{e.push(t)},identify:Array.isArray});function yr(e){if(typeof e!=`object`||!e||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function br(e,t){let n={};for(let r of t)e[r]!==void 0&&(n[r]=e[r]);return n}var xr=gn(`tag:yaml.org,2002:omap`,{create:()=>({list:[],seen:new Set}),addItem:(e,t)=>{let n;if(t instanceof Map){if(t.size!==1)return`cannot resolve an ordered map item`;n=t.keys().next().value}else if(yr(t)){let e=Object.keys(t);if(e.length!==1)return`cannot resolve an ordered map item`;n=e[0]}else return`cannot resolve an ordered map item`;return e.seen.has(n)?`duplicate key in ordered map`:(e.seen.add(n),e.list.push(t),``)},finalize:e=>e.list,identify:()=>!1}),Sr=gn(`tag:yaml.org,2002:pairs`,{create:()=>[],addItem:(e,t)=>{if(t instanceof Map)return t.size===1?(e.push(t.entries().next().value),``):`cannot resolve a pairs item`;if(Object.prototype.toString.call(t)!==`[object Object]`)return`cannot resolve a pairs item`;let n=t,r=Object.keys(n);return r.length===1?(e.push([r[0],n[r[0]]]),``):`cannot resolve a pairs item`},identify:()=>!1}),Cr=_n(`tag:yaml.org,2002:map`,{create:()=>({}),identify:yr,represent:e=>{let t=new Map;for(let n of Object.keys(e))t.set(n,e[n]);return t},addPair:(e,t,n)=>{if(typeof t==`object`&&t)return`object-based map does not support complex keys`;let r=String(t);return r===`__proto__`?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,``},has:(e,t)=>typeof t==`object`&&t?!1:Object.prototype.hasOwnProperty.call(e,String(t)),keys:e=>Object.keys(e),get:(e,t)=>{let n=String(t);return Object.prototype.hasOwnProperty.call(e,n)?e[n]:null}}),wr=_n(`tag:yaml.org,2002:set`,{create:()=>new Set,identify:e=>e instanceof Set,represent:e=>{let t=new Map;for(let n of e)t.set(n,null);return t},addPair:(e,t,n)=>n===null?(e.add(t),``):`cannot resolve a set item`,has:(e,t)=>e.has(t),keys:e=>e.keys(),get:()=>null});function Tr(){return{scalar:Object.create(null),sequence:Object.create(null),mapping:Object.create(null)}}function Er(){return{scalar:[],sequence:[],mapping:[]}}function Dr(e){let t=[];for(let n of e){let e=t.length;for(let r=0;r<t.length;r++){let i=t[r];if(i.nodeKind===n.nodeKind&&i.tagName===n.tagName&&i.matchByTagPrefix===n.matchByTagPrefix){e=r;break}}t[e]=n}return t}var Or=class e{tags;implicitScalarTags;implicitScalarByFirstChar;implicitScalarAnyFirstChar;defaultScalarTag;defaultSequenceTag;defaultMappingTag;exact;prefix;constructor(e){let t=Dr(e),n=[],r=Tr(),i=Er();for(let e of t){if(e.nodeKind===`scalar`&&e.implicit){if(e.matchByTagPrefix)throw Error(`Implicit scalar tags cannot match by tag prefix`);n.push(e)}switch(e.nodeKind){case`scalar`:e.matchByTagPrefix?i.scalar.push(e):r.scalar[e.tagName]=e;break;case`sequence`:e.matchByTagPrefix?i.sequence.push(e):r.sequence[e.tagName]=e;break;case`mapping`:e.matchByTagPrefix?i.mapping.push(e):r.mapping[e.tagName]=e}}let a=n.filter(e=>e.implicitFirstChars===null),o=new Set;for(let e of n)if(e.implicitFirstChars!==null)for(let t of e.implicitFirstChars)o.add(t);let s=new Map;for(let e of o)s.set(e,n.filter(t=>t.implicitFirstChars===null||t.implicitFirstChars.indexOf(e)!==-1));let c=r.scalar[`tag:yaml.org,2002:str`];if(!c)throw Error(`schema does not define the default scalar tag (tag:yaml.org,2002:str)`);this.tags=t,this.implicitScalarTags=n,this.implicitScalarByFirstChar=s,this.implicitScalarAnyFirstChar=a,this.defaultScalarTag=c,this.defaultSequenceTag=r.sequence[`tag:yaml.org,2002:seq`],this.defaultMappingTag=r.mapping[`tag:yaml.org,2002:map`],this.exact=r,this.prefix=i}lookupScalarTag(e){let t=this.exact.scalar[e];if(t)return t;for(let t of this.prefix.scalar)if(e.startsWith(t.tagName))return t}lookupSequenceTag(e){let t=this.exact.sequence[e];if(t)return t;for(let t of this.prefix.sequence)if(e.startsWith(t.tagName))return t}lookupMappingTag(e){let t=this.exact.mapping[e];if(t)return t;for(let t of this.prefix.mapping)if(e.startsWith(t.tagName))return t}resolveImplicitScalarTag(e){let t=this.implicitScalarByFirstChar.get(e.charAt(0))??this.implicitScalarAnyFirstChar;for(let n of t){let t=n.resolve(e,!1,n.tagName);if(t!==F)return{value:t,tag:n}}let n=this.defaultScalarTag;return{value:n.resolve(e,!1,n.tagName),tag:n}}withTags(...t){let n=[];for(let e of t)n=n.concat(e);return new e([...this.tags,...n])}},kr=new Or([vn,vr,Cr]);new Or([...kr.tags,xn,kn,Hn,nr]);var Ar=new Or([...kr.tags,bn,En,Ln,Zn]);new Or([...kr.tags,Cn,Mn,Kn,sr,_r,cr,fr,xr,Sr,wr]).withTags({...Kn,resolve:(e,t,n)=>{let r=Kn.resolve(e,t,n);return r===F?Ln.resolve(e,t,n):r}},{...sr,resolve:(e,t,n)=>{let r=sr.resolve(e,t,n);return r===F?Zn.resolve(e,t,n):r}}),_n(`tag:yaml.org,2002:map`,{create:()=>new Map,addPair:(e,t,n)=>(e.set(t,n),``),has:(e,t)=>e.has(t),keys:e=>e.keys(),get:(e,t)=>e.get(t),identify:e=>e instanceof Map||yr(e),represent:e=>{if(e instanceof Map)return e;let t=new Map,n=e;for(let e of Object.keys(n))t.set(e,n[e]);return t}});function jr(e){if(Array.isArray(e)){let t=Array.prototype.slice.call(e);for(let e=0;e<t.length;e++){if(Array.isArray(t[e]))return null;typeof t[e]==`object`&&Object.prototype.toString.call(t[e])===`[object Object]`&&(t[e]=`[object Object]`)}return String(t)}return typeof e==`object`&&Object.prototype.toString.call(e)===`[object Object]`?`[object Object]`:String(e)}_n(`tag:yaml.org,2002:map`,{create:()=>({}),identify:yr,represent:e=>{let t=new Map;for(let n of Object.keys(e))t.set(n,e[n]);return t},addPair:(e,t,n)=>{let r=jr(t);return r===null?`nested arrays are not supported inside keys`:(r===`__proto__`?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,``)},has:(e,t)=>{let n=jr(t);return n!==null&&Object.prototype.hasOwnProperty.call(e,n)},keys:e=>Object.keys(e),get:(e,t)=>{let n=String(t);return Object.prototype.hasOwnProperty.call(e,n)?e[n]:null}});var Mr={maxLength:79,indent:1,linesBefore:3,linesAfter:2};function Nr(e,t,n,r,i){let a=``,o=``,s=Math.floor(i/2)-1;return r-t>s&&(a=` ... `,t=r-s+a.length),n-r>s&&(o=` ...`,n=r+s-o.length),{str:a+e.slice(t,n).replace(/\t/g,`→`)+o,pos:r-t+a.length}}function Pr(e,t){return` `.repeat(Math.max(t-e.length,0))+e}function Fr(e,t){if(!e.buffer)return null;let n={...Mr,...t},r=/\r?\n|\r|\0/g,i=[0],a=[],o,s=-1;for(;o=r.exec(e.buffer);)a.push(o.index),i.push(o.index+o[0].length),e.position<=o.index&&s<0&&(s=i.length-2);s<0&&(s=i.length-1);let c=``,l=Math.min(e.line+n.linesAfter,a.length).toString().length,u=n.maxLength-(n.indent+l+3);for(let t=1;t<=n.linesBefore&&!(s-t<0);t++){let r=Nr(e.buffer,i[s-t],a[s-t],e.position-(i[s]-i[s-t]),u);c=`${` `.repeat(n.indent)}${Pr((e.line-t+1).toString(),l)} | ${r.str}\n${c}`}let d=Nr(e.buffer,i[s],a[s],e.position,u);c+=`${` `.repeat(n.indent)}${Pr((e.line+1).toString(),l)} | ${d.str}\n`,c+=`${`-`.repeat(n.indent+l+3+d.pos)}^\n`;for(let t=1;t<=n.linesAfter&&!(s+t>=a.length);t++){let r=Nr(e.buffer,i[s+t],a[s+t],e.position-(i[s]-i[s+t]),u);c+=`${` `.repeat(n.indent)}${Pr((e.line+t+1).toString(),l)} | ${r.str}\n`}return c.replace(/\n$/,``)}function Ir(e,t){let n=``;return e.mark?(e.mark.name&&(n+=`in "${e.mark.name}" `),n+=`(${e.mark.line+1}:${e.mark.column+1})`,!t&&e.mark.snippet&&(n+=`\n\n${e.mark.snippet}`),`${e.reason} ${n}`):e.reason}var Lr=class e extends Error{reason;mark;constructor(e,t){super(),this.name=`YAMLException`,this.reason=e,this.mark=t,this.message=Ir(this,!1),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}toString(e){return`${this.name}: ${Ir(this,e)}`}static throwAt(t,n,r,i=``){let a=0,o=0;for(let e=0;e<n;e++){let n=t.charCodeAt(e);n===10?(a++,o=e+1):n===13&&(a++,t.charCodeAt(e+1)===10&&e++,o=e+1)}let s={name:i,buffer:t,position:n,line:a,column:n-o};throw s.snippet=Fr(s),new e(r,s)}},L={DOCUMENT:1,SEQUENCE:2,MAPPING:3,SCALAR:4,ALIAS:5,POP:6},R={PLAIN:1,SINGLE_QUOTED:2,DOUBLE_QUOTED:3,LITERAL_BLOCK:4,FOLDED_BLOCK:5},Rr={BLOCK:1,FLOW:2},z={CLIP:1,STRIP:2,KEEP:3},zr=-1;function Br(e){switch(e){case 48:return`\0`;case 97:return`\x07`;case 98:return`\b`;case 116:return` `;case 9:return` `;case 110:return`
9
- `;case 118:return`\v`;case 102:return`\f`;case 114:return`\r`;case 101:return`\x1B`;case 32:return` `;case 34:return`"`;case 47:return`/`;case 92:return`\\`;case 78:return`…`;case 95:return`\xA0`;case 76:return`\u2028`;case 80:return`\u2029`;default:return``}}var Vr=Array(256),Hr=Array(256);for(let e=0;e<256;e++)Vr[e]=+!!Br(e),Hr[e]=Br(e);function Ur(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function Wr(e){return e>=48&&e<=57?e-48:(e|32)-97+10}function Gr(e){return e===120?2:e===117?4:8}function Kr(e,t,n){let r=0;for(;t<n;){let n=e.charCodeAt(t);if(n===10)r++,t++;else if(n===13)r++,t++,e.charCodeAt(t)===10&&t++;else if(n===32||n===9)t++;else break}return{position:t,breaks:r}}function qr(e){return e===1?` `:`
10
- `.repeat(e-1)}function Jr(e,t,n){let r=``,i=t,a=t,o=t;for(;i<n;){let t=e.charCodeAt(i);if(t===10||t===13){r+=e.slice(a,o);let t=Kr(e,i,n);r+=qr(t.breaks),i=a=o=t.position}else i++,t!==32&&t!==9&&(o=i)}return r+e.slice(a,o)}function Yr(e,t,n){let r=``,i=t,a=t,o=t;for(;i<n;){let t=e.charCodeAt(i);if(t===39)r+=e.slice(a,i)+`'`,i+=2,a=o=i;else if(t===10||t===13){r+=e.slice(a,o);let t=Kr(e,i,n);r+=qr(t.breaks),i=a=o=t.position}else i++,t!==32&&t!==9&&(o=i)}return r+e.slice(a,n)}function Xr(e,t,n){let r=``,i=t,a=t,o=t;for(;i<n;){let t=e.charCodeAt(i);if(t===92){r+=e.slice(a,i),i++;let t=e.charCodeAt(i);if(t===10||t===13)i=Kr(e,i,n).position;else if(t<256&&Vr[t])r+=Hr[t],i++;else{let n=Gr(t),a=0;for(;n>0;n--){i++;let t=Wr(e.charCodeAt(i));a=(a<<4)+t}r+=Ur(a),i++}a=o=i}else if(t===10||t===13){r+=e.slice(a,o);let t=Kr(e,i,n);r+=qr(t.breaks),i=a=o=t.position}else i++,t!==32&&t!==9&&(o=i)}return r+e.slice(a,n)}function Zr(e,t,n,r,i,a){let o=r<0?0:r,s=e.slice(t,n).replace(/\r\n?/g,`
11
- `),c=s===``?[]:(s.endsWith(`
12
- `)?s.slice(0,-1):s).split(`
13
- `),l=``,u=!1,d=0,f=!1;for(let e of c){let t=0;for(;t<o&&e.charCodeAt(t)===32;)t++;if(r<0||t>=e.length){d++;continue}let n=e.slice(o),i=n.charCodeAt(0);a?i===32||i===9?(f=!0,l+=`
14
- `.repeat(u?1+d:d)):f?(f=!1,l+=`
15
- `.repeat(d+1)):d===0?u&&(l+=` `):l+=`
16
- `.repeat(d):l+=`
17
- `.repeat(u?1+d:d),l+=n,u=!0,d=0}return i===z.KEEP?l+=`
18
- `.repeat(u?1+d:d):i!==z.STRIP&&u&&(l+=`
19
- `),l}function Qr(e,t){if(t.valueStart===zr)return``;let{valueStart:n,valueEnd:r}=t;if(t.fast)return e.slice(n,r);switch(t.style){case R.SINGLE_QUOTED:return Yr(e,n,r);case R.DOUBLE_QUOTED:return Xr(e,n,r);case R.LITERAL_BLOCK:return Zr(e,n,r,t.indent,t.chomping,!1);case R.FOLDED_BLOCK:return Zr(e,n,r,t.indent,t.chomping,!0);default:return Jr(e,n,r)}}var $r=Object.assign(Object.create(null),{"!":`!`,"!!":`tag:yaml.org,2002:`});function ei(e,t){if(e.startsWith(`!<`)&&e.endsWith(`>`))return decodeURIComponent(e.slice(2,-1));let n=e.indexOf(`!`,1),r=n===-1?`!`:e.slice(0,n+1),i=t?.[r]??$r[r]??r;return decodeURIComponent(i)+decodeURIComponent(e.slice(r.length))}var ti=-1,ni=`tag:yaml.org,2002:merge`,ri={filename:``,schema:Ar,json:!1,maxTotalMergeKeys:1e4,maxAliases:-1};function ii(e){return`tagStart`in e&&e.tagStart!==ti?e.tagStart:`anchorStart`in e&&e.anchorStart!==ti?e.anchorStart:`valueStart`in e&&e.valueStart!==ti?e.valueStart:`start`in e?e.start:0}function B(e,t){Lr.throwAt(e.source,e.position,t,e.filename)}function ai(e,t,n,r){try{return n.finalize(r)}catch(n){if(n instanceof Lr)throw n;Lr.throwAt(e.source,t,n instanceof Error?n.message:String(n),e.filename)}}function oi(e,t){let n=Qr(e.source,t),r=t.tagStart===ti?``:e.source.slice(t.tagStart,t.tagEnd),i=e.schema.defaultScalarTag;if(r!==``){if(r===`!`)return{value:n,tag:i};let t=ei(r,e.tagHandlers),a=e.schema.lookupScalarTag(t);if(a){let r=a.resolve(n,!0,t);return r===F&&B(e,`cannot resolve a node with !<${t}> explicit tag`),{value:r,tag:a}}let o=e.schema.lookupMappingTag(t)??e.schema.lookupSequenceTag(t);if(o){n!==``&&B(e,`cannot resolve a node with !<${t}> explicit tag`);let r=o.create(t);return{value:o.carrierIsResult?r:ai(e,e.position,o,r),tag:o}}B(e,`unknown scalar tag !<${t}>`)}return t.style===R.PLAIN?e.schema.resolveImplicitScalarTag(n):{value:i.resolve(n,!1,i.tagName),tag:i}}function si(e,t,n){let r=t.tagStart===ti?``:e.source.slice(t.tagStart,t.tagEnd);return r===``||r===`!`?n:ei(r,e.tagHandlers)}function ci(e){return e.nodeKind===`mapping`}function li(e){e.totalMergeKeys++,e.maxTotalMergeKeys!==-1&&e.totalMergeKeys>e.maxTotalMergeKeys&&B(e,`merge keys exceeded maxTotalMergeKeys (${e.maxTotalMergeKeys})`)}function ui(e,t,n,r){li(e);for(let i of r.keys(n)){if(li(e),t.tag.has(t.value,i))continue;let a=t.tag.addPair(t.value,i,r.get(n,i));a&&B(e,a),t.overridable??=new Set,t.overridable.add(i)}}function di(e,t,n,r){if(e.position=t.keyPosition,ci(r))ui(e,t,n,r);else if(r.nodeKind===`sequence`&&Array.isArray(n)){n.length>100&&B(e,`abnormal merge sequence size`);for(let r of n){let n=e.nodeTags.get(r);n||B(e,`cannot merge mappings; the provided source object is unacceptable`),ui(e,t,r,n)}}else B(e,`cannot merge mappings; the provided source object is unacceptable`)}function fi(e,t,n,r,i){if(e.position=t.keyPosition,t.keyIsMerge){di(e,t,r,i);return}!e.json&&t.tag.has(t.value,n)&&!t.overridable?.has(n)&&B(e,`duplicated mapping key`);let a=t.tag.addPair(t.value,n,r);a&&B(e,a),t.overridable?.delete(n)}function pi(e,t,n){let r=e.frames[e.frames.length-1];if(r.kind===`document`)r.value=t,r.hasValue=!0;else if(r.kind===`sequence`){ci(n)&&e.nodeTags.set(t,n);let i=r.tag.addItem(r.value,t,r.index++);i&&B(e,i)}else if(r.hasKey){let i=r.key;r.key=void 0,r.hasKey=!1,fi(e,r,i,t,n)}else r.key=t,r.keyPosition=e.position,r.hasKey=!0,r.keyIsMerge=n.tagName===ni}function mi(e,t,n,r,i){if(t.anchorStart!==ti){let a={value:n,tag:r,isValueFinal:i};return e.anchors.set(e.source.slice(t.anchorStart,t.anchorEnd),a),a}return null}function hi(e,t){let n={...ri,...t,events:e,documents:[],eventIndex:0,position:0,frames:[],anchors:new Map,nodeTags:new Map,tagHandlers:Object.create(null),totalMergeKeys:0,aliasCount:0};for(;n.eventIndex<n.events.length;){let e=n.events[n.eventIndex++];switch(n.position=ii(e),e.type){case L.DOCUMENT:n.anchors=new Map,n.nodeTags=new Map,n.aliasCount=0,n.tagHandlers=Object.create(null);for(let t of e.directives)t.kind===`tag`&&(n.tagHandlers[t.handle]=t.prefix);n.frames.push({kind:`document`,position:n.position,value:void 0,hasValue:!1});break;case L.SCALAR:{let{value:t,tag:r}=oi(n,e);mi(n,e,t,r,!0),pi(n,t,r);break}case L.SEQUENCE:{let t=si(n,e,`tag:yaml.org,2002:seq`),r=n.schema.lookupSequenceTag(t);r||B(n,`unknown sequence tag !<${t}>`);let i=r.create(t),a=mi(n,e,i,r,r.carrierIsResult);n.frames.push({kind:`sequence`,position:n.position,value:i,tag:r,anchor:a,index:0});break}case L.MAPPING:{let t=si(n,e,`tag:yaml.org,2002:map`),r=n.schema.lookupMappingTag(t);r||B(n,`unknown mapping tag !<${t}>`);let i=r.create(t),a=mi(n,e,i,r,r.carrierIsResult);n.frames.push({kind:`mapping`,position:n.position,value:i,tag:r,anchor:a,key:void 0,keyPosition:n.position,hasKey:!1,keyIsMerge:!1,overridable:null});break}case L.ALIAS:{n.maxAliases!==-1&&++n.aliasCount>n.maxAliases&&B(n,`aliases exceeded maxAliases (${n.maxAliases})`);let t=n.source.slice(e.anchorStart,e.anchorEnd),r=n.anchors.get(t);r||B(n,`unidentified alias "${t}"`),r.isValueFinal||B(n,`recursive alias "${t}" is not supported for tag ${r.tag.tagName} because it uses finalize()`),pi(n,r.value,r.tag);break}case L.POP:{let e=n.frames.pop();if(e.kind===`mapping`&&e.hasKey&&(n.position=e.keyPosition,B(n,`incomplete mapping pair in event stream`)),e.kind===`document`)n.documents.push(e.value);else{let t=e.tag.carrierIsResult?e.value:ai(n,e.position,e.tag,e.value);e.anchor&&(e.anchor.value=t,e.anchor.isValueFinal=!0),pi(n,t,e.tag)}break}}}return n.documents}var V=-1,gi=Object.prototype.hasOwnProperty,_i=1,vi=2,yi=3,bi=4,xi=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Si=/[,\[\]{}]/,Ci=/^(?:!|!!|![0-9A-Za-z-]+!)$/,wi=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]])`,Ti=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$.~*'()_])`,Ei=RegExp(`^(?:${wi})*$`),Di=RegExp(`^(?:${Ti})+$`),Oi=RegExp(`^(?:!(?:${wi})*|${Ti}(?:${wi})*)$`),ki={filename:``,maxDepth:100};function Ai(e,t,n){e.events.push({type:L.DOCUMENT,explicitStart:t,explicitEnd:n,directives:e.directives})}function ji(e,t,n,r,i,a,o){e.events.push({type:L.SEQUENCE,start:t,anchorStart:n,anchorEnd:r,tagStart:i,tagEnd:a,style:o})}function Mi(e,t,n,r,i,a,o){e.events.push({type:L.MAPPING,start:t,anchorStart:n,anchorEnd:r,tagStart:i,tagEnd:a,style:o})}function Ni(e,t){e.events.splice(t.eventsLength,0,{type:L.MAPPING,start:t.position,anchorStart:V,anchorEnd:V,tagStart:V,tagEnd:V,style:Rr.FLOW})}function Pi(e,t,n,r,i,a,o,s,c=z.CLIP,l=-1,u=!1){e.events.push({type:L.SCALAR,valueStart:t,valueEnd:n,anchorStart:r,anchorEnd:i,tagStart:a,tagEnd:o,style:s,chomping:c,indent:l,fast:u})}function Fi(e,t,n){e.events.push({type:L.ALIAS,anchorStart:t,anchorEnd:n})}function Ii(e){e.events.push({type:L.POP})}function H(e){Pi(e,V,V,V,V,V,V,R.PLAIN)}function Li(){return{anchorStart:V,anchorEnd:V,tagStart:V,tagEnd:V}}function Ri(e){return{position:e.position,line:e.line,lineStart:e.lineStart,lineIndent:e.lineIndent,firstTabInLine:e.firstTabInLine,eventsLength:e.events.length}}function zi(e,t){e.position=t.position,e.line=t.line,e.lineStart=t.lineStart,e.lineIndent=t.lineIndent,e.firstTabInLine=t.firstTabInLine,e.events.length=t.eventsLength}function U(e,t){Lr.throwAt(e.input.slice(0,e.length),e.position,t,e.filename)}function W(e){return e===10||e===13}function Bi(e){return e===9||e===32}function G(e){return Bi(e)||W(e)}function Vi(e){return e===0||G(e)}function Hi(e){return e===44||e===91||e===93||e===123||e===125}function Ui(e){return e>=48&&e<=57?e-48:-1}function Wi(e){if(e>=48&&e<=57)return e-48;let t=e|32;return t>=97&&t<=102?t-97+10:-1}function Gi(e){return e===120?2:e===117?4:e===85?8:0}function Ki(e){return e===48||e===97||e===98||e===116||e===9||e===110||e===118||e===102||e===114||e===101||e===32||e===34||e===47||e===92||e===78||e===95||e===76||e===80}function qi(e){e.input.charCodeAt(e.position)===10?e.position++:(e.position++,e.input.charCodeAt(e.position)===10&&e.position++),e.line++,e.lineStart=e.position,e.lineIndent=0,e.firstTabInLine=-1}function K(e,t){let n=0,r=e.input.charCodeAt(e.position),i=e.position===e.lineStart||G(e.input.charCodeAt(e.position-1));for(;r!==0;){for(;Bi(r);)i=!0,r===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),r=e.input.charCodeAt(++e.position);if(t&&i&&r===35)do r=e.input.charCodeAt(++e.position);while(!W(r)&&r!==0);if(!W(r))break;for(qi(e),n++,i=!0,r=e.input.charCodeAt(e.position);r===32;)e.lineIndent++,r=e.input.charCodeAt(++e.position)}return n}function Ji(e,t=e.position){let n=e.input.charCodeAt(t);if((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)){let n=e.input.charCodeAt(t+3);return n===0||G(n)}return!1}function Yi(e){e.position===e.lineStart&&e.input.charCodeAt(e.position)===65279&&(e.position++,e.lineStart=e.position)}function Xi(e){if(e.position!==e.lineStart)return!1;if(Ji(e))return!0;if(e.input.charCodeAt(e.position)!==65279)return!1;let t=Ri(e);Yi(e),K(e,!0);let n=e.input.charCodeAt(e.position),r=e.position===e.lineStart&&(n===37||n===45&&Ji(e));return zi(e,t),r}function Zi(e){let t=e.input.charCodeAt(e.position);for(;t!==0&&!W(t);)t=e.input.charCodeAt(++e.position)}function Qi(e,t,n){xi.test(e.input.slice(t,n))&&U(e,`the stream contains non-printable characters`)}function $i(e,t,n){if(e.input.charCodeAt(e.position)!==33)return!1;t.tagStart!==V&&U(e,`duplication of a tag property`);let r=e.position,i=!1,a=!1,o=`!`,s=e.input.charCodeAt(++e.position);s===60?(i=!0,s=e.input.charCodeAt(++e.position)):s===33&&(a=!0,o=`!!`,s=e.input.charCodeAt(++e.position));let c=e.position,l;if(i){for(;s!==0&&s!==62;)s=e.input.charCodeAt(++e.position);s!==62&&U(e,`unexpected end of the stream within a verbatim tag`),l=e.input.slice(c,e.position),e.position++}else{for(;s!==0&&!G(s)&&!(n&&Hi(s));)s===33&&(a?U(e,`tag suffix cannot contain exclamation marks`):(o=e.input.slice(c-1,e.position+1),Ci.test(o)||U(e,`named tag handle cannot contain such characters`),a=!0,c=e.position+1)),s=e.input.charCodeAt(++e.position);l=e.input.slice(c,e.position),Si.test(l)&&U(e,`tag suffix cannot contain flow indicator characters`)}return l&&!(i?Ei.test(l):Di.test(l))&&U(e,`tag name cannot contain such characters: ${l}`),!i&&o!==`!`&&o!==`!!`&&!gi.call(e.tagHandlers,o)&&U(e,`undeclared tag handle "${o}"`),t.tagStart=r,t.tagEnd=e.position,!0}function ea(e,t){if(e.input.charCodeAt(e.position)!==38)return!1;t.anchorStart!==V&&U(e,`duplication of an anchor property`),e.position++;let n=e.position;for(;e.input.charCodeAt(e.position)!==0&&!G(e.input.charCodeAt(e.position))&&!Hi(e.input.charCodeAt(e.position));)e.position++;return e.position===n&&U(e,`name of an anchor node must contain at least one character`),t.anchorStart=n,t.anchorEnd=e.position,!0}function ta(e,t){if(e.input.charCodeAt(e.position)!==42)return!1;(t.anchorStart!==V||t.tagStart!==V)&&U(e,`alias node should not have any properties`),e.position++;let n=e.position;for(;e.input.charCodeAt(e.position)!==0&&!G(e.input.charCodeAt(e.position))&&!Hi(e.input.charCodeAt(e.position));)e.position++;return e.position===n&&U(e,`name of an alias node must contain at least one character`),Fi(e,n,e.position),!0}function na(e,t){K(e,!1),e.lineIndent<t&&U(e,`deficient indentation`)}function ra(e,t,n){if(e.input.charCodeAt(e.position)!==39)return!1;e.position++;let r=e.position,i=!0;for(;e.input.charCodeAt(e.position)!==0;){let a=e.input.charCodeAt(e.position);if(a===39){if(e.input.charCodeAt(e.position+1)===39){i=!1,e.position+=2;continue}let t=e.position;return e.position++,Pi(e,r,t,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,R.SINGLE_QUOTED,z.CLIP,-1,i),!0}W(a)?(i=!1,na(e,t)):e.position===e.lineStart&&Ji(e)?U(e,`unexpected end of the document within a single quoted scalar`):a!==9&&a<32?U(e,`expected valid JSON character`):e.position++}U(e,`unexpected end of the stream within a single quoted scalar`)}function ia(e,t,n){if(e.input.charCodeAt(e.position)!==34)return!1;e.position++;let r=e.position,i=!0;for(;e.input.charCodeAt(e.position)!==0;){let a=e.input.charCodeAt(e.position);if(a===34){let t=e.position;return e.position++,Pi(e,r,t,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,R.DOUBLE_QUOTED,z.CLIP,-1,i),!0}if(a===92){i=!1;let n=e.input.charCodeAt(++e.position);if(W(n))na(e,t);else if(Ki(n))e.position++;else{let t=Gi(n);for(t===0&&U(e,`unknown escape sequence`);t-->0;)e.position++,Wi(e.input.charCodeAt(e.position))<0&&U(e,`expected hexadecimal character`);e.position++}}else W(a)?(i=!1,na(e,t)):e.position===e.lineStart&&Ji(e)?U(e,`unexpected end of the document within a double quoted scalar`):a!==9&&a<32?U(e,`expected valid JSON character`):e.position++}U(e,`unexpected end of the stream within a double quoted scalar`)}function aa(e,t,n){let r=e.input.charCodeAt(e.position),i=z.CLIP,a=-1,o=!1;if(r!==124&&r!==62)return!1;let s=r===124?R.LITERAL_BLOCK:R.FOLDED_BLOCK;for(e.position++;e.input.charCodeAt(e.position)!==0;){let n=e.input.charCodeAt(e.position),r=Ui(n);if(n===43||n===45)i!==z.CLIP&&U(e,`repeat of a chomping mode identifier`),i=n===43?z.KEEP:z.STRIP,e.position++;else if(r>=0)r===0&&U(e,`bad explicit indentation width of a block scalar; it cannot be less than one`),o&&U(e,`repeat of an indentation width identifier`),a=t+r-1,o=!0,e.position++;else break}let c=!1;for(;Bi(e.input.charCodeAt(e.position));)c=!0,e.position++;c&&e.input.charCodeAt(e.position)===35&&Zi(e),W(e.input.charCodeAt(e.position))?qi(e):e.input.charCodeAt(e.position)!==0&&U(e,`a line break is expected`);let l=o?a:-1,u=0,d=e.position,f=e.position;for(;e.input.charCodeAt(e.position)!==0;){let n=e.position,r=0;for(;e.input.charCodeAt(n+r)===32;)r++;let i=e.input.charCodeAt(n+r);if(i===0){l>=0?r>l&&(f=n+r):r>0&&(f=n+r);break}if(Xi(e))break;if(!o&&l===-1&&W(i)&&(u=Math.max(u,r)),!o&&l===-1&&!W(i)&&(i===9&&r<t&&(e.position=n+r,U(e,`tab characters must not be used in indentation`)),r<u&&(e.position=n+r,U(e,`bad indentation of a mapping entry`))),l===-1&&i!==0&&!W(i)&&r<t){e.lineIndent=r,e.position=n+r;break}!o&&i!==0&&!W(i)&&l===-1&&(l=r);let a=l===-1?t+1:l;if(i!==0&&!W(i)&&r<a){e.lineIndent=r,e.position=n+r;break}Zi(e),f=e.position,W(e.input.charCodeAt(e.position))&&(qi(e),f=e.position)}return Qi(e,d,f),Pi(e,d,f,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,s,i,l),!0}function oa(e,t){let n=e.input.charCodeAt(e.position),r=t===_i;if(n===0||G(n)||n===35||n===38||n===42||n===33||n===124||n===62||n===39||n===34||n===37||n===64||n===96||r&&Hi(n))return!1;if(n===63||n===45){let t=e.input.charCodeAt(e.position+1);if(Vi(t)||r&&Hi(t))return!1}return!0}function sa(e,t,n,r){if(!oa(e,n))return!1;let i=e.position,a=e.position,o=e.input.charCodeAt(e.position),s=n===_i,c=!1;for(;o!==0&&!Xi(e);){if(o===58){let t=e.input.charCodeAt(e.position+1);if(Vi(t)||s&&Hi(t))break}else if(o===35){if(G(e.input.charCodeAt(e.position-1)))break}else if(s&&Hi(o))break;else if(W(o)){let n=e.position,r=e.line,i=e.lineStart,a=e.lineIndent;if(K(e,!1),e.lineIndent>=t){c=!0,o=e.input.charCodeAt(e.position);continue}e.position=n,e.line=r,e.lineStart=i,e.lineIndent=a;break}Bi(o)||(a=e.position+1),o=e.input.charCodeAt(++e.position)}return a!==i&&(Qi(e,i,a),Pi(e,i,a,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,R.PLAIN,z.CLIP,-1,!c),!0)}function ca(e,t){let n=e.line;K(e,!0),(e.line>n&&e.lineIndent<t||e.firstTabInLine!==-1&&e.lineIndent<t)&&U(e,`deficient indentation`)}function la(e,t,n){let r=e.input.charCodeAt(e.position),i=r===123,a=e.position,o=!0;if(r!==91&&r!==123)return!1;let s=i?125:93;for(i?Mi(e,a,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,Rr.FLOW):ji(e,a,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,Rr.FLOW),e.position++;e.input.charCodeAt(e.position)!==0;){ca(e,t);let n=e.input.charCodeAt(e.position);if(n===s)return e.position++,Ii(e),!0;o?n===44&&U(e,`expected the node content, but found ','`):U(e,`missed comma between flow collection entries`);let r=!1,a=!1;n===63&&G(e.input.charCodeAt(e.position+1))&&(r=a=!0,e.position+=1,ca(e,t));let c=e.line,l=Ri(e),u=fa(e,t,_i,!1,!0);ca(e,t),n=e.input.charCodeAt(e.position),(i||a||e.line===c)&&n===58?(r=!0,e.position++,ca(e,t),i||Ni(e,l),u||H(e),fa(e,t,_i,!1,!0)||H(e),ca(e,t),i||Ii(e)):i&&r?(u||H(e),H(e)):i?H(e):r&&(Ni(e,l),u||H(e),H(e),Ii(e)),n=e.input.charCodeAt(e.position),n===44?(o=!0,e.position++):o=!1}U(e,`unexpected end of the stream within a flow collection`)}function ua(e,t,n){if(e.firstTabInLine!==-1||e.input.charCodeAt(e.position)!==45||!Vi(e.input.charCodeAt(e.position+1)))return!1;for(ji(e,e.position,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,Rr.BLOCK);e.input.charCodeAt(e.position)===45&&Vi(e.input.charCodeAt(e.position+1));){e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,U(e,`tab characters must not be used in indentation`));let n=e.line;e.position++;let r=K(e,!0)>0;if(e.firstTabInLine!==-1&&e.input.charCodeAt(e.position)===45&&Vi(e.input.charCodeAt(e.position+1))&&U(e,`bad indentation of a sequence entry`),r&&e.lineIndent<=t?H(e):fa(e,t,yi,!1,!0),K(e,!0),e.lineIndent<t||e.position>=e.length)break;e.lineIndent>t&&U(e,`bad indentation of a sequence entry`),e.line===n&&e.input.charCodeAt(e.position)===45&&Vi(e.input.charCodeAt(e.position+1))&&U(e,`bad indentation of a sequence entry`)}return Ii(e),!0}function da(e,t,n,r){let i=!1,a=!1,o=!1,s=!1;if(e.firstTabInLine!==-1)return!1;let c=e.input.charCodeAt(e.position);for(;c!==0;){!i&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,U(e,`tab characters must not be used in indentation`));let l=e.input.charCodeAt(e.position+1),u=e.line;if((c===63||c===58)&&Vi(l))o||=(Mi(e,e.position,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,Rr.BLOCK),!0),c===63?(i&&H(e),a=!0,i=!0):i?i=!1:(H(e),a=!0,i=!1),e.position+=1,s=!0;else{i&&=(H(e),!1);let t=Ri(e);if(!fa(e,n,vi,!1,!0))break;if(e.line===u){for(c=e.input.charCodeAt(e.position);Bi(c);)c=e.input.charCodeAt(++e.position);if(c===58){if(c=e.input.charCodeAt(++e.position),Vi(c)||U(e,`a whitespace character is expected after the key-value separator within a block mapping`),!o){for(zi(e,t),Mi(e,t.position,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,Rr.BLOCK),o=!0,fa(e,n,vi,!1,!0),c=e.input.charCodeAt(e.position);Bi(c);)c=e.input.charCodeAt(++e.position);e.position++}a=!0,i=!1,s=!1}else if(a)U(e,`expected ':' after a mapping key`);else return r.anchorStart!==V||r.tagStart!==V?(zi(e,t),!1):!0}else if(a)U(e,`can not read a block mapping entry; a multiline key may not be an implicit key`);else return r.anchorStart!==V||r.tagStart!==V?(zi(e,t),!1):!0}if(fa(e,t,bi,!0,s)&&(s=!1),i||(s&&=(H(e),!1)),K(e,!0),c=e.input.charCodeAt(e.position),(e.line===u||e.lineIndent>t)&&c!==0)U(e,`bad indentation of a mapping entry`);else if(e.lineIndent<t)break}return a?(i&&H(e),o&&Ii(e),!0):!1}function fa(e,t,n,r,i,a=!0){e.depth>=e.maxDepth&&U(e,`nesting exceeded maxDepth (${e.maxDepth})`),e.depth++;let o=1,s=!1,c=!1,l=null,u=Li(),d=n===bi||n===yi,f=d,p=d;if(r&&K(e,!0)&&(s=!0,o=e.lineIndent>t?1:e.lineIndent===t?0:-1),o===1)for(;;){let r=e.input.charCodeAt(e.position),i=Ri(e);if(s&&o!==1&&(r===33||r===38))break;if(s&&p&&(u.tagStart!==V||u.anchorStart!==V)&&(r===33||r===38)){let n=Ri(e),r=t+1;if(da(e,e.position-e.lineStart,r,u)&&e.events[n.eventsLength]?.type===L.MAPPING)return e.depth--,!0;zi(e,n)}if(s&&(r===33&&u.tagStart!==V||r===38&&u.anchorStart!==V)||!$i(e,u,n===_i)&&!ea(e,u))break;l===null&&(l=i),K(e,!0)?(s=!0,f=p,o=e.lineIndent>t?1:e.lineIndent===t?0:-1):f=!1}if(f&&=s||i,o===1||n===bi){let r=n===_i||n===vi?t:t+1,i=e.position-e.lineStart;if(o===1){if(f&&(ua(e,i,u)||da(e,i,r,u))||la(e,r,u))c=!0;else{let t=e.input.charCodeAt(e.position);if(l!==null&&a&&p&&!f&&t!==124&&t!==62){let t=Ri(e),n=l.position-l.lineStart;zi(e,l),da(e,n,r,Li())&&e.events[t.eventsLength]?.type===L.MAPPING?c=!0:zi(e,t)}!c&&(d&&aa(e,r,u)||ra(e,r,u)||ia(e,r,u)||ta(e,u)||sa(e,r,n,u))&&(c=!0)}}else o===0&&(c=f&&ua(e,i,u))}return d&&=!c,!c&&(u.anchorStart!==V||u.tagStart!==V||d)&&(Pi(e,V,V,u.anchorStart,u.anchorEnd,u.tagStart,u.tagEnd,R.PLAIN),c=!0),e.depth--,c||u.anchorStart!==V||u.tagStart!==V}function pa(e){if(e.lineIndent>0||e.input.charCodeAt(e.position)!==37)return!1;e.position++;let t=e.position;for(;e.input.charCodeAt(e.position)!==0&&!G(e.input.charCodeAt(e.position));)e.position++;let n=e.input.slice(t,e.position),r=[];for(n.length===0&&U(e,`directive name must not be less than one character in length`);e.input.charCodeAt(e.position)!==0&&!W(e.input.charCodeAt(e.position));){for(;Bi(e.input.charCodeAt(e.position));)e.position++;if(e.input.charCodeAt(e.position)===35||W(e.input.charCodeAt(e.position))||e.input.charCodeAt(e.position)===0)break;let t=e.position;for(;e.input.charCodeAt(e.position)!==0&&!G(e.input.charCodeAt(e.position));)e.position++;r.push(e.input.slice(t,e.position))}if(W(e.input.charCodeAt(e.position))&&qi(e),n===`YAML`){e.directives.some(e=>e.kind===`yaml`)&&U(e,`duplication of %YAML directive`),r.length!==1&&U(e,`YAML directive accepts exactly one argument`);let t=/^([0-9]+)\.([0-9]+)$/.exec(r[0]);t===null&&U(e,`ill-formed argument of the YAML directive`),parseInt(t[1],10)!==1&&U(e,`unacceptable YAML version of the document`),e.directives.push({kind:`yaml`,version:r[0]})}else if(n===`TAG`){r.length!==2&&U(e,`TAG directive accepts exactly two arguments`);let[t,n]=r;Ci.test(t)||U(e,`ill-formed tag handle (first argument) of the TAG directive`),gi.call(e.tagHandlers,t)&&U(e,`there is a previously declared suffix for "${t}" tag handle`),Oi.test(n)||U(e,`ill-formed tag prefix (second argument) of the TAG directive`),e.tagHandlers[t]=n,e.directives.push({kind:`tag`,handle:t,prefix:n})}return!0}function ma(e){e.directives=[],e.tagHandlers=Object.create(null);let t=!1;for(K(e,!0);pa(e);)t=!0,K(e,!0);let n=!1,r=!1,i=!0;if(e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45&&Vi(e.input.charCodeAt(e.position+3))){n=!0;let t=e.line;e.position+=3,K(e,!0),i=e.line>t}else t&&U(e,`directives end mark is expected`);let a=e.events.length;if(!n&&e.position===e.lineStart&&e.input.charCodeAt(e.position)===46&&Ji(e)){e.position+=3,K(e,!0);return}if(Ai(e,n,!1),fa(e,e.lineIndent-1,bi,!1,i,i)||H(e),K(e,!0),e.position===e.lineStart&&Ji(e)&&(r=e.input.charCodeAt(e.position)===46,r)){let t=e.line;e.position+=3,K(e,!0),e.line===t&&e.position<e.length&&U(e,`end of the stream or a document separator is expected`)}let o=e.events[a];o?.type===L.DOCUMENT&&(o.explicitEnd=r),Ii(e),!r&&e.position<e.length&&!Xi(e)&&U(e,`end of the stream or a document separator is expected`)}function ha(e,t){let n=e.length,r={...ki,...t,input:`${e}\0`,length:n,position:0,line:0,lineStart:0,lineIndent:0,firstTabInLine:-1,depth:0,directives:[],tagHandlers:Object.create(null),events:[]},i=e.indexOf(`\0`);for(i!==-1&&Lr.throwAt(e,i,`null byte is not allowed in input`,r.filename);r.position<r.length&&(Yi(r),K(r,!0),!(r.position>=r.length));){let e=r.position;ma(r),r.position===e&&U(r,`can not read a document`)}return r.events}var ga={...ki,...ri};function _a(e,t={}){let n={...ga,...t},r=String(e),i=Object.keys(ki),a=Object.keys(ri);return hi(ha(r,br(n,i)),{...br(n,a),source:r})}function va(e,t){let n=_a(e,t);if(n.length===0)throw new Lr(`expected a document, but the input is empty`);if(n.length===1)return n[0];throw new Lr(`expected a single document in the stream, but found more`)}function ya(e,t){return!!(e&1<<t)}var ba={applyQuoteFlowKeysOption:Sa,doubleQuoteForInvisibles:Ca,doubleQuoteWhitespaceOnly:wa,applyForceQuotesOption:Ta,tryLongOrMultilineAsBlock:Ea,quoteInvalidPlain:Da,fallbackToDoubleQuoted:Oa};function xa(e){return e.presenterOptions.quoteStyle===`single`&&ya(e.allowedStylesMask,R.SINGLE_QUOTED)?R.SINGLE_QUOTED:R.DOUBLE_QUOTED}function Sa(e){e.presenterOptions.quoteFlowKeys&&e.isKey&&e.flowOnly&&e.style===R.PLAIN&&(e.style=R.DOUBLE_QUOTED)}function Ca(e){e.style===R.PLAIN&&/[\t\x7F-\xA0\u2028\u2029\uFEFF\uFFFE\uFFFF]/.test(e.node.value)&&(e.style=R.DOUBLE_QUOTED)}function wa(e){e.style===R.PLAIN&&/^\s+$/.test(e.node.value)&&(e.style=R.DOUBLE_QUOTED)}function Ta(e){e.presenterOptions.forceQuotes&&(e.isKey||e.style!==R.PLAIN||(e.style=e.node.value.includes(`
20
- `)?R.DOUBLE_QUOTED:xa(e)))}function Ea(e){if(e.style!==R.PLAIN||e.isKey)return;let t=e.node.value,n=t.indexOf(`
21
- `)!==-1;if(!ya(e.allowedStylesMask,R.LITERAL_BLOCK)){n&&(e.style=R.DOUBLE_QUOTED);return}let r=e.presenterOptions.lineWidth;if(r===-1){n&&(e.style=R.LITERAL_BLOCK);return}let i=Math.max(Math.min(r,40),r-e.shiftOfContent),a=0,o=!1;for(;a<=t.length;){let e=t.length,n=t.indexOf(`
22
- `,a);n!==-1&&(e=n);let r=t.slice(a,e);if(r.length>i&&r[0]!==` `&&/ [^ \t]/.test(r)&&(o=!0),n===-1)break;a=n+1}o?e.style=R.FOLDED_BLOCK:n&&(e.style=R.LITERAL_BLOCK)}function Da(e){e.style===R.PLAIN&&!ya(e.allowedStylesMask,R.PLAIN)&&(e.style=xa(e))}function Oa(e){ya(e.allowedStylesMask,e.style)||(e.style=R.DOUBLE_QUOTED)}var ka=`[\\x09\\x0A\\x0D\\x20-\\x7E\\x85\\xA0-\\uD7FF\\uE000-\\uFFFD\\u{10000}-\\u{10FFFF}]`,Aa=`[\\n\\r]`,ja=`\\uFEFF`,Ma=`[ \\t]`,Na=`(?:(?!(?:${Aa}|${ja}))${ka})`,Pa=`(?:(?!${Ma})${Na})`,Fa=`[\\x09\\x20-\\uD7FF\\uE000-\\uFFFF\\u{10000}-\\u{10FFFF}]`,Ia=`[-?:,\\[\\]{}#&*!|>'"%@\`]`,La=`[,\\[\\]{}]`,Ra=Pa,za=`(?:(?!${La})${Pa})`,Ba=`(?:(?:(?!${Ia})${Pa})|[?:-](?=${Ra}))`,Va=`(?:(?:(?!${Ia})${Pa})|[?:-](?=${za}))`,Ha=`(?:(?:(?![:#])${Ra})|:(?=${Ra}))#*`,Ua=`(?:(?:(?![:#])${za})|:(?=${za}))#*`,Wa=`(?:${Ma}*${Ha})*`,Ga=`(?:${Ma}*${Ua})*`,Ka=`${Ba}#*${Wa}`,qa=`${Va}#*${Ga}`,Ja=Ka,Ya=qa,Xa=`\\n+${Ha}${Wa}`,Za=`\\n+${Ua}${Ga}`,Qa=`${Ka}(?:${Xa})*`,$a=`${qa}(?:${Za})*`;RegExp(`^(?:${Qa})$`,`u`),RegExp(`^(?:${$a})$`,`u`),RegExp(`^(?:${Ja})$`,`u`),RegExp(`^(?:${Ya})$`,`u`),RegExp(`^(?:${Fa})*$`,`u`),RegExp(`^(?:${Fa}|\\n)*$`,`u`),RegExp(`^(?:${Na}|\\n)*$`,`u`),Object.keys(ba).map(e=>Reflect.get(ba,e)),L.DOCUMENT,L.SEQUENCE,L.MAPPING,L.SCALAR,L.ALIAS,L.POP,R.PLAIN,R.SINGLE_QUOTED,R.DOUBLE_QUOTED,R.LITERAL_BLOCK,R.FOLDED_BLOCK,Rr.BLOCK,Rr.FLOW,z.CLIP,z.STRIP,z.KEEP;function eo(e){if(e.trim()===``)return{};let t=va(e);if(t==null)return{};if(typeof t!=`object`||Array.isArray(t))throw Error(`.agent-user.yml must parse to an object`);return t}var to={id:`welcome`,title:`Welcome — who are you?`,navLabel:`You`,subtitle:`Your name and language. Stored in .agent-user.yml; we pre-fill what we can detect.`,kind:`welcome`},no={id:`profile`,title:`Which experience?`,navLabel:`Experience`,subtitle:"Pick the experience that fits you — developer · content · founder · agency · finance · ops. It selects your default command/skill surface and persona pre-selection. Cost tier is a secondary knob on a later step. You can switch later with `agent-config use --profile=<id>`.",kind:`form`,paths:[`profile.id`]},ro=[{id:`ai-tools`,title:`Which AI tools do you use?`,navLabel:`AI tools`,subtitle:`Pick the editors and CLIs that should pick up this config. Auto-detect runs first; you can override.`,kind:`aiTools`},{id:`roles`,title:`What do you work on?`,navLabel:`Roles`,subtitle:`Pick the areas you work in. We use them to recommend capability packs on the next step, and they become your roles in .agent-user.yml.`,kind:`roles`},{id:`packs`,title:`Which capability packs do you want?`,navLabel:`Packs`,subtitle:`Founder-strategy, finance-basic, gtm-sales, ops-people, ai-video — pick zero or more. You can change this later.`,kind:`packs`},{id:`legal-consent`,title:`Legal review-prep — not legal advice`,navLabel:`Legal consent`,subtitle:`Only relevant if you picked the legal-review-prep pack. It provides templates and general information, never legal advice — check the box to acknowledge before it activates. Leave unchecked otherwise; the pack stays inactive.`,kind:`form`,paths:[`legal_review_prep.acknowledged`]}],io=[{id:`identity`,title:`Editor & behaviour`,navLabel:`Preferences`,subtitle:`Your IDE plus how autonomously the agent works. rtk presence is auto-detected (see the rtk row). Your name lives in .agent-user.yml (later step).`,kind:`form`,paths:[`personal.ide`,`personal.open_edited_files`,`personal.autonomy`]},{id:`cost`,title:`Budgets, rules & cadence`,navLabel:`Budgets & cadence`,subtitle:`Independent levers: rule_loading_tier (how many behavioural rules load — token footprint), cost.budgets (optional USD ceilings), model.auto_switch (per-skill model tier), plus quality/roadmap cadence and memory redaction patterns.`,kind:`form`,paths:[`rule_loading_tier`,`cost.budgets.daily`,`cost.budgets.weekly`,`cost.budgets.monthly`,`cost.enforcement`,`model.auto_switch`,`roadmap.quality_cadence`,`quality.local_auto_run`,`memory.redact_patterns`]},{id:`user-md`,title:`Your .agent-user.yml`,navLabel:`User profile`,subtitle:`Identity, voice, preferences. Stored at agents/settings/.agent-user.yml. Skip to leave empty.`,kind:`userMd`},{id:`review`,title:`Review & finish`,navLabel:`Review`,subtitle:`These keys will change. Confirm to write .agent-settings.yml and .agent-user.yml atomically.`,kind:`review`}];io.length+2;function ao(e={}){return e.extended===!0?[to,no,...ro,...io]:[to,no,...io]}function oo(e,t={}){let n=ao(t);return n[Math.max(0,Math.min(n.length-1,e))]}function so(e){let t={},n=n=>{t[n]=!0;let r=e.clusterOf.get(n);r!==void 0&&(t[r]=!0)};for(let t of e.installed)n(t);for(let t of e.roleDefaults)n(t);for(let t of e.detected)n(t);return t}function co(e,t){let n=new Set(t);return e.filter(e=>e!==`engineering-base`&&!n.has(e)).sort()}function lo(e,t){let n={type:`object`,properties:{},...e.description===void 0?{}:{description:e.description}},r=n.properties,i=e.properties??{};for(let e of t){let t=e.split(`.`).filter(e=>e.length>0);if(t.length===0)continue;let[n,a,o]=t;if(n===void 0)continue;let s=i[n];if(s===void 0)continue;if(a===void 0){r[n]=s;continue}let c=s.properties?.[a];if(c===void 0)continue;let l=r[n]??{type:`object`,properties:{},...s.description===void 0?{}:{description:s.description}},u=l.properties??={};if(o===void 0){u[a]=c,r[n]=l;continue}let d=c.properties?.[o];if(d===void 0)continue;let f=u[a]??{type:`object`,properties:{},...c.description===void 0?{}:{description:c.description}},p=f.properties??={};p[o]=d,u[a]=f,r[n]=l}return n}function uo({current:e,total:t}){let n=Math.max(1,t),r=Math.max(0,Math.min(n-1,e)),i=Array.from({length:n},(e,t)=>t<=r),a=Math.round((r+1)/n*100);return P(`div`,{class:`ac-wizard__progress`,role:`progressbar`,"aria-valuenow":r+1,"aria-valuemin":1,"aria-valuemax":n,"aria-valuetext":`Step ${r+1} of ${n} (${a}%)`,children:i.map((e,t)=>P(`span`,{class:`ac-wizard__progress-segment${e?` ac-wizard__progress-segment--filled`:``}`,"aria-hidden":`true`},t))})}function fo({step:e,index:t,total:n}){return P(`header`,{class:`ac-page__header ac-wizard__header`,children:[P(`p`,{class:`ac-wizard__step-count`,children:[`Step `,t+1,` of `,n]}),P(`div`,{class:`ac-wizard__header-text`,children:[P(`h1`,{children:e.title}),P(`p`,{class:`ac-wizard__subtitle`,children:e.subtitle})]}),P(uo,{current:t,total:n})]})}function po(e){let t=e.canFinish??!0,n=e.completed??!1;return P(`div`,{class:`ac-form__actions ac-wizard__nav`,children:[P(`button`,{type:`button`,class:`ac-button`,disabled:!e.canGoPrev||e.busy,onClick:e.onPrev,children:`Back`}),e.canSkip&&e.onSkip!==void 0?P(`button`,{type:`button`,class:`ac-button ac-wizard__skip`,disabled:e.busy,onClick:e.onSkip,children:e.skipLabel??`Skip`}):null,e.isLast?n?null:P(`button`,{type:`button`,class:`ac-button ac-button--primary`,disabled:e.busy||!t,onClick:e.onFinish,children:e.busy?`Saving…`:`Finish & save`}):P(`button`,{type:`button`,class:`ac-button ac-button--primary`,disabled:!e.canGoNext||e.busy,onClick:e.onNext,children:e.nextLabel??`Next`})]})}function mo(e,t){return e.kind!==`form`||e.paths===void 0?!1:!!(e.paths.includes(t)||e.id===`cost`&&(t.startsWith(`telegraph.`)||t.startsWith(`verbosity.`)))}function ho(e,t){return e.kind===`userMd`?t===`body`||t.startsWith(`body.`):mo(e,t)}function go(e,t){for(let n of Object.keys(t.errors))if(ho(e,n))return!0;return!1}function _o(e,t){if(go(e,t))return{label:`needs attention`,tone:`error`};if(e.kind===`userMd`)return t.userMdChanged?{label:t.userMdAction===`create`?`will create`:`will replace`,tone:`changed`}:{label:``,tone:`idle`};if(e.kind===`form`){let n=t.changes.filter(t=>mo(e,t.path)).length;return n===0?{label:``,tone:`idle`}:{label:`${n} change${n===1?``:`s`}`,tone:`changed`}}if(e.kind===`aiTools`){let e=t.selectedToolsCount??0;return e===0?{label:``,tone:`idle`}:{label:`${e} tool${e===1?``:`s`}`,tone:`changed`}}if(e.kind===`packs`){let e=t.selectedPacksCount??0;return e===0?{label:``,tone:`idle`}:{label:`${e} pack${e===1?``:`s`}`,tone:`changed`}}return{label:``,tone:`idle`}}function vo(e){let t=e.steps.filter((t,n)=>n!==e.currentIndex),n=e.packRemovals??[],r=e.selectedToolIds??[],i=e.packAdditions??[],a=e.changes.length;return P(b,{children:[r.length>0||i.length>0||a>0||e.userMdChanged?P(`section`,{class:`ac-review-summary`,"aria-label":`What happens on Finish`,children:[P(`h2`,{class:`ac-review-summary__title`,children:`What happens on Finish`}),P(`ul`,{class:`ac-review-summary__list`,children:[a>0?P(`li`,{children:[P(`strong`,{children:a}),` setting`,a===1?``:`s`,` will change`,` `,`in `,P(`code`,{children:`.agent-settings.yml`}),`.`]}):P(`li`,{children:`No settings change.`}),e.userMdChanged?P(`li`,{children:[P(`code`,{children:`.agent-user.yml`}),` will be`,` `,e.userMdAction===`create`?`created`:`updated`,`.`]}):null,r.length>0?P(`li`,{children:[`Config is installed for `,r.length,` tool`,r.length===1?``:`s`,`:`,P(`span`,{class:`ac-review-summary__chips`,children:r.map(e=>P(`code`,{class:`ac-review-summary__chip`,children:e},e))})]}):null,i.length>0?P(`li`,{children:[`New pack`,i.length===1?``:`s`,`:`,P(`span`,{class:`ac-review-summary__chips`,children:i.map(e=>P(`code`,{class:`ac-review-summary__chip`,children:e},e))})]}):null]})]}):null,n.length>0?P(`div`,{class:`ac-review-removals`,role:`alert`,children:[P(`p`,{class:`ac-review-removals__title`,children:[`⚠️ `,n.length===1?`1 installed pack will be removed`:`${n.length} installed packs will be removed`]}),P(`ul`,{class:`ac-review-removals__list`,children:n.map(e=>P(`li`,{children:P(`code`,{children:e})},e))}),P(`label`,{class:`ac-review-removals__confirm`,children:[P(`input`,{type:`checkbox`,checked:e.removalsConfirmed??!1,onChange:t=>{e.onConfirmRemovals?.(t.currentTarget.checked)}}),P(`span`,{children:`I understand these packs will no longer be installed. Re-check them on the packs step to keep them.`})]})]}):null,P(`nav`,{class:`ac-wizard__review-nav`,"aria-label":`Jump back to a step`,children:[P(`p`,{class:`ac-wizard__review-nav-label`,children:`Jump back to a step:`}),P(`ul`,{class:`ac-wizard__review-nav-list`,children:t.map(t=>{let n=e.steps.indexOf(t),r=_o(t,e);return P(`li`,{children:P(`button`,{type:`button`,class:r.tone===`error`?`ac-wizard__review-nav-button ac-wizard__review-nav-button--error`:`ac-wizard__review-nav-button`,onClick:()=>{e.onJump(n)},children:[P(`span`,{class:`ac-wizard__review-nav-index`,children:n+1}),P(`span`,{class:`ac-wizard__review-nav-text`,children:t.navLabel}),r.label===``?null:P(`span`,{class:`ac-wizard__review-nav-status ac-wizard__review-nav-status--${r.tone}`,children:r.label})]})},t.id)})})]})]})}function yo(e){let t=e.abortedAt??`unknown time`,n=e.abortNote??`no further detail recorded`,r=e.writesSinceRollback;return P(`aside`,{class:`ac-banner ac-banner--recovery`,role:`alert`,children:[P(`strong`,{children:`Previous install was interrupted.`}),P(`p`,{children:[`Aborted at `,P(`code`,{children:t}),` — `,n,`. `,r,` write`,r===1?``:`s`,` landed before the abort marker.`]}),P(`p`,{children:`Pick how to recover before continuing. Resume reopens the wizard fresh, Rollback discards the abort state, Ignore hides this banner without touching the log.`}),P(`div`,{class:`ac-banner__actions`,children:[P(`button`,{type:`button`,disabled:e.busy,onClick:()=>e.onResume(),children:`Resume install`}),P(`button`,{type:`button`,disabled:e.busy,onClick:()=>e.onRollback(),children:`Rollback`}),P(`button`,{type:`button`,disabled:e.busy,onClick:()=>e.onIgnore(),children:`Ignore`})]})]})}function bo(){return P(`section`,{class:`ac-continue-screen`,"aria-labelledby":`ac-continue-title`,children:[P(`h2`,{id:`ac-continue-title`,children:`Install complete — continue with setup?`}),P(`p`,{children:`Your install selections (AI tools, roles, capability packs) are captured. Use the footer to continue:`}),P(`ul`,{children:[P(`li`,{children:[P(`strong`,{children:`Next`}),` — go through the remaining personalisation steps: editor + tooling, personality, cost profile, roadmap & quality, memory, your`,P(`code`,{children:` .agent-user.yml`}),`, and finally the project module roots.`]}),P(`li`,{children:[P(`strong`,{children:`Finish install here`}),` — skip the rest and write `,P(`code`,{children:`.agent-settings.yml`}),` with the install-only selections. You can re-run `,P(`code`,{children:`agent-config setup`}),`later to pick up the personalisation steps.`]})]})]})}function xo(e){let t=e.version??`unknown`;return P(`section`,{class:`ac-backup-screen`,"aria-labelledby":`ac-backup-title`,children:[P(`h2`,{id:`ac-backup-title`,children:`Existing v3 install detected`}),P(`p`,{children:[`Found a v3.x install at `,P(`code`,{children:e.sourcePath}),` `,`(VERSION: `,P(`code`,{children:t}),`). v4 is a hard-cut release with no auto-migration — settings, identity, and history layouts changed. The wizard can back up the v3 tree before writing the v4 layout so you can roll back manually if needed.`]}),e.error===null?null:P(`p`,{class:`ac-banner ac-banner--error`,children:[`Backup failed: `,e.error]}),P(`ul`,{children:[P(`li`,{children:[P(`strong`,{children:`Backup v3 and proceed`}),` — copies the tree to `,P(`code`,{children:e.backupTarget}),`, then runs the v4 install. Restore later with`,P(`code`,{children:[` mv `,e.backupTarget,` `,e.sourcePath]}),`.`]}),P(`li`,{children:[P(`strong`,{children:`Abort, uninstall v3 first`}),` — closes the wizard. You decide what to keep.`]})]}),P(`div`,{class:`ac-backup-screen__actions`,children:[P(`button`,{type:`button`,class:`ac-button ac-button--primary`,disabled:e.busy,onClick:()=>e.onBackupAndProceed(),children:e.busy?`Backing up…`:`Backup v3 and proceed`}),P(`button`,{type:`button`,class:`ac-button`,disabled:e.busy,onClick:()=>e.onAbort(),children:`Abort, uninstall v3 first`})]})]})}var So=[{title:`Restart your AI tools`,detail:`Editors and CLIs pick up the new skills, rules, and commands on their next start.`},{title:`Verify the installation`,detail:`A read-only health report — scope, deployed files, drift.`,command:`agent-config doctor`},{title:`Tune your settings any time`,detail:`Opens the configuration GUI (global settings; --project for a project).`,command:`agent-config config`},{title:`Initialize a project`,detail:`Adds the minimal agents/ bridge + .gitignore block to a repository.`,command:`agent-config init --project`},{title:`Stay up to date`,detail:`Upgrades the global install and additively syncs your settings.`,command:`agent-config upgrade`}];function Co({text:e}){let[t,n]=Ne(!1);return P(`button`,{type:`button`,class:`ac-button ac-checklist__copy`,onClick:()=>{navigator.clipboard?.writeText(e).then(()=>{n(!0),setTimeout(()=>{n(!1)},1500)})},children:t?`Copied ✓`:`Copy`})}function wo({message:e}){return P(`div`,{class:`ac-checklist`,children:[P(`div`,{class:`ac-checklist__hero`,children:[P(`h2`,{class:`ac-checklist__headline`,children:`Setup complete`}),e===null?null:P(`p`,{class:`ac-checklist__message`,children:e})]}),P(`ol`,{class:`ac-checklist__items`,children:So.map(e=>P(`li`,{class:`ac-checklist__item`,children:[P(`div`,{class:`ac-checklist__text`,children:[P(`span`,{class:`ac-checklist__item-title`,children:e.title}),P(`span`,{class:`ac-checklist__item-detail`,children:e.detail})]}),e.command===void 0?null:P(`div`,{class:`ac-checklist__cmd-row`,children:[P(`code`,{class:`ac-checklist__cmd`,children:e.command}),P(Co,{text:e.command})]})]},e.title))}),P(`p`,{class:`ac-checklist__close-hint`,children:`You can close this browser window — the local server shuts down on its own.`})]})}var To=A(!1),Eo=A(null),q=A(null),Do=A(!1),Oo=A(!1),ko=A(0),Ao=A(null),J=A({}),jo=A({}),Mo=A(0),No=A({}),Y=A(null),Po=A(null),Fo=A(!1),Io=A(!1),Lo=A(!1),Ro=A({}),zo=A([]);A(`global`);var Bo=A(!1),X=A(!1),Vo=A(!1),Ho=A(!1),Uo=A(null),Wo=A([]),Go=A({}),Ko=A(!0),qo=A(``),Jo=A(`agents`);A(!1);var Yo=A(null),Xo=[{id:`claude-code`,label:`Claude Code`},{id:`claude-desktop`,label:`Claude Desktop`},{id:`cursor`,label:`Cursor`},{id:`windsurf`,label:`Windsurf`},{id:`cline`,label:`Cline`},{id:`gemini-cli`,label:`Gemini CLI`},{id:`copilot`,label:`GitHub Copilot`},{id:`augment`,label:`Augment`},{id:`aider`,label:`Aider`},{id:`codex`,label:`Codex`},{id:`roocode`,label:`Roo Code`},{id:`continue`,label:`Continue`},{id:`kilocode`,label:`Kilo Code`},{id:`zed`,label:`Zed`},{id:`jetbrains`,label:`JetBrains`},{id:`kiro`,label:`Kiro`},{id:`qoder`,label:`Qoder`},{id:`opencode`,label:`OpenCode`},{id:`trae`,label:`Trae`},{id:`antigravity`,label:`Antigravity`},{id:`codebuddy`,label:`CodeBuddy`},{id:`droid`,label:`Droid`},{id:`warp`,label:`Warp`}],Zo=A(!1),Qo=A(!1),$o=A(null),es=A([]),ts=A([]),ns=A([]),rs=A(!1),is=A([]),as=A({}),os=A(!1),ss=A(!1),cs=A(!1),ls=A({}),us=A(!1),ds=A(null),fs=A(null),ps=A(null),ms=A(null),hs=A(null),gs=A(null),_s=A(`https://github.com/rtk-ai/rtk`),vs=A(!1),ys=A(null),bs=A(null),xs=A(null),Ss=A(`event4u-app/agent-switch`),Cs=A(!1);A(!1),A(null),A([]),A({}),A({});var ws=A({}),Ts=A({}),Es=A(!1),Ds=A(!1);A({}),A(null),A(null),A(!1),A(null);var Os=A(null),ks=A(!1),As=A(null),js=A(!1),Ms=A(!1),Ns=A(null),Ps=A(null),Fs=A(!1),Is=A(!1);function Ls(){return ao({extended:X.value})}function Rs(){return Ls().length}function zs(e){return e??new Date().toISOString()}function Bs(e){return Math.max(0,Math.min(Rs()-1,e))}function Vs(e){if(`$ref`in e&&e.$ref!==void 0&&`definitions`in e&&e.definitions!==void 0){let t=e.$ref.replace(`#/definitions/`,``),n=e.definitions[t];if(n!==void 0)return n}return e}async function Hs(){try{return await M(`/api/v1/settings`)}catch(e){if(e instanceof j&&e.status===404&&e.body.error?.code===`NOT_FOUND`){let t=e.body;return t.defaults!==void 0&&t.schema!==void 0?{values:t.defaults,lastModified:t.lastModified??0,path:t.path??`.agent-settings.yml`,schema:t.schema}:{values:{},lastModified:0,path:`.agent-settings.yml`,schema:(await M(`/api/v1/schema`)).settings}}throw e}}async function Us(){try{let e=await M(`/api/v1/install/recovery`);Os.value=e.incomplete?e:null}catch{Os.value=null}}async function Ws(){try{let e=await M(`/api/v1/install/legacy-v3`);As.value=e.present?e:null}catch{As.value=null}}async function Gs(){Ms.value=!0,Ns.value=null;try{await M(`/api/v1/install/backup-v3`,{method:`POST`}),js.value=!0}catch(e){Ns.value=e instanceof j?N(e.body.error??{code:`UNKNOWN`,message:e.message}):e instanceof Error?e.message:String(e)}finally{Ms.value=!1}}async function Ks(e){try{await M(`/api/v1/install/recovery/dismiss`,{method:`POST`,body:{reason:e}})}catch(e){q.value={message:e instanceof Error?e.message:String(e),tone:`error`};return}Os.value=null,ks.value=!0}async function qs(){Eo.value=null;try{Us(),Ws();let[e,t]=await Promise.all([M(`/api/v1/wizard/state`),Hs()]);Ao.value=Vs(t.schema),Mo.value=t.lastModified,jo.value=t.values,Ro.value=t.legacyHints??{},X.value=e.extendedSteps===!0,Ps.value=e.wizardMode??null,J.value=Object.keys(e.partial??{}).length>0?{...t.values,...e.partial}:t.values,ko.value=Bs(e.step),Bo.value=!1,To.value=!0;let n=oo(ko.value,{extended:X.value});(n.kind===`welcome`||n.kind===`userMd`||n.kind===`review`)&&Ys(),(n.kind===`roles`||n.kind===`aiTools`||n.kind===`packs`)&&Zs(),n.kind===`roles`&&oc(),n.kind===`aiTools`&&Qs(),n.id===`identity`&&($s(),ec()),n.kind===`review`&&nc()}catch(e){Eo.value=e instanceof j?N(e.body.error??{code:`UNKNOWN`,message:e.message}):e instanceof Error?e.message:String(e)}}function Js(e,t){return e.identity.name.trim()===``?{...e,identity:{...e.identity,name:t}}:e}async function Ys(){if(!Io.value)try{let e=await M(`/api/v1/user-md`);if(Fo.value=e.exists,e.exists&&e.identity!==null){let t=hn(e.identity);Po.value=t,Y.value=t}else{let e;try{e=hn(eo((await M(`/api/v1/user-md/template`)).body))}catch{e=ln()}let t=Ro.value.user_name;typeof t==`string`&&t.trim()!==``&&(e=Js(e,t)),Po.value=e,Y.value=e}}catch(e){q.value={message:e instanceof Error?e.message:String(e),tone:`error`}}finally{Io.value=!0}}var Xs=new Set([`python`]);async function Zs(){if(!(Zo.value||Qo.value)){Qo.value=!0,$o.value=null;try{let[e,t]=await Promise.all([M(`/api/v1/wizard/manifest`),M(`/api/v1/wizard/auto-detect`)]),n=(e.packs??[]).map(e=>({id:e.id,label:e.label??e.id,description:e.description??``,requires_hint:e.requires_hint,cluster:e.cluster??void 0,workspaces:e.workspaces}));es.value=n,is.value=(e.workspaces??[]).filter(e=>e.id!==`agent-config-maintainer`).map(e=>({id:e.id,label:e.label??e.id,description:e.description??``,default_packs:e.default_packs??[],optional_packs:e.optional_packs??[],...e.example_roles===void 0?{}:{example_roles:e.example_roles}}));let r=new Set(n.map(e=>e.id));ts.value=t.signals.map(e=>e.id.startsWith(`pack-`)?e.id.slice(5):e.id).filter(e=>r.has(e)).filter(e=>!Xs.has(e)),ns.value=(e.installedPacks??[]).filter(e=>r.has(e))}catch(e){$o.value=e instanceof j?N(e.body.error??{code:`UNKNOWN`,message:e.message}):e instanceof Error?e.message:String(e)}finally{Qo.value=!1,Zo.value=!0}}}async function Qs(){if(!(ss.value||cs.value)){cs.value=!0;try{let e=await M(`/api/v1/wizard/detect-tools`),t=e.tools??{},n=e.configured??[];if(ls.value=t,Object.keys(ws.value).length===0){let e={};if(n.length>0)for(let t of n)e[t]=!0;else for(let[n,r]of Object.entries(t))r&&(e[n]=!0);ws.value=e}}catch{}finally{cs.value=!1,ss.value=!0}}}async function $s(){if(!us.value){us.value=!0;try{let e=await M(`/api/v1/wizard/detect-rtk`),t=e.installed===!0;ds.value=t,fs.value=e.present===!0,ps.value=e.identity??null,ms.value=e.version??null,hs.value=e.installCommand??null,gs.value=e.installCommands??null,typeof e.repo==`string`&&(_s.value=e.repo);let n=J.value.personal??{};J.value={...J.value,personal:{...n,rtk_installed:t}}}catch{}}}async function ec(){if(!vs.value){vs.value=!0;try{let e=await M(`/api/v1/wizard/detect-agent-switch`);ys.value=e.installed===!0,bs.value=e.version??null,xs.value=e.installCommand??null,typeof e.repo==`string`&&(Ss.value=e.repo),Cs.value=e.dismissed===!0}catch{}}}async function tc(e,t){try{await M(`/api/v1/wizard/state`,{method:`POST`,body:{step:e,totalSteps:Rs(),partial:t,startedAt:zs(null)}})}catch(e){q.value={message:e instanceof Error?e.message:String(e),tone:`error`}}}async function nc(){Oo.value=!0;try{zo.value=(await M(`/api/v1/settings/diff`,{method:`POST`,body:{values:J.value,ifUnmodifiedSince:Mo.value}})).changes,No.value={}}catch(e){e instanceof j?(No.value=Ft(e.body.error??{code:`UNKNOWN`,message:e.message}),q.value={message:N(e.body.error??{code:`UNKNOWN`,message:e.message}),tone:`error`}):q.value={message:e instanceof Error?e.message:String(e),tone:`error`}}finally{Oo.value=!1}}function rc(){return Lo.value?!1:Y.value===null||Po.value===null?Y.value!==Po.value:JSON.stringify(Y.value)!==JSON.stringify(Po.value)}async function ic(e){let t=Bs(e);await tc(t,J.value),ko.value=t,q.value=null;let n=oo(t,{extended:X.value});(n.kind===`welcome`||n.kind===`userMd`)&&Ys(),(n.kind===`roles`||n.kind===`aiTools`||n.kind===`packs`)&&Zs(),n.kind===`roles`&&oc(),n.kind===`packs`&&sc(),n.kind===`aiTools`&&Qs(),n.id===`identity`&&($s(),ec()),n.kind===`review`&&nc()}function ac(){let e=Ts.value,t=new Map(es.value.map(e=>[e.id,e])),n=Object.entries(e).filter(([,e])=>e===!0).map(([e])=>e).filter(n=>{let r=t.get(n)?.cluster;return r===void 0||e[r]===!0}),r=new Set,i=e=>{if(!r.has(e)){r.add(e);for(let n of t.get(e)?.requires_hint??[])i(n)}};for(let e of n)i(e);return[...r].sort()}async function oc(){if(await Promise.all([Zs(),Ys()]),os.value||Object.values(as.value).some(Boolean))return;let e=Y.value?.role??[];if(e.length===0)return;let t=new Set(is.value.map(e=>e.id)),n={};for(let r of e)t.has(r)&&(n[r]=!0);Object.keys(n).length!==0&&(as.value=n,sc())}function sc(){if(Es.value)return;let e=Object.entries(as.value).filter(([,e])=>e===!0).map(([e])=>e),t=new Map(is.value.map(e=>[e.id,e])),n=[];for(let r of e)for(let e of t.get(r)?.default_packs??[])n.push(e);let r=new Map;for(let e of es.value)e.cluster!==void 0&&r.set(e.id,e.cluster);Ts.value=so({installed:ns.value,roleDefaults:n,detected:ts.value,clusterOf:r})}function cc(){let e=Object.entries(ws.value).filter(([,e])=>e===!0).map(([e])=>e);if(e.length===0)return null;let t={schema_version:`wizard-v2`,tools:e,packs:ac(),settings:J.value};return Mt.value?.dryRun===!0&&(t.dry_run=!0),t}async function lc(){Do.value=!0,q.value=null;try{let e={settings:J.value},t=Object.entries(as.value).filter(([,e])=>e===!0).map(([e])=>e),n=Y.value!==null&&typeof Y.value.identity?.name==`string`&&Y.value.identity.name.trim().length>0;Y.value!==null&&n&&(rc()||t.length>0)&&(e.identity=t.length>0?{...Y.value,role:t}:Y.value);let r=await M(`/api/v1/wizard/finish`,{method:`POST`,body:e}),i=r.dryRun===!0?`Dry-run complete — no files written. Settings would be saved.`:Array.isArray(r.writtenPaths)?`Saved (${r.writtenPaths.join(`, `)}). Wizard complete.`:`Wizard complete.`,a=X.value?cc():null,o=``;if(a!==null&&a.dry_run===!0)try{await M(`/api/v1/wizard/apply`,{method:`POST`,body:a}),o=` Installer preview OK (dry-run) — no files written.`}catch(e){o=` Installer preview failed: ${e instanceof j?N(e.body.error??{code:`UNKNOWN`,message:e.message}):e instanceof Error?e.message:String(e)}.`}else if(a!==null)try{let e=null,t=0;await jt(`/api/v1/wizard/apply`,a,n=>{if(n.type===`error`)e=typeof n.message==`string`?n.message:`install failed`;else if(n.type===`done`){let e=n.summary;t=typeof e?.conflicts==`number`?e.conflicts:0}});let n=a.tools.length,r=a.packs.length;o=e===null?` Installer applied ${n} tool${n===1?``:`s`}`+(r>0?` and ${r} pack${r===1?``:`s`}.`:`.`)+(t>0?` ${t} file${t===1?``:`s`} you had edited ${t===1?`was`:`were`} kept; the new package content is staged alongside as *.agent-config.new. This installation is not current until you merge it.`:``):` Installer failed: ${e}. Settings were saved; re-run the wizard to retry.`}catch(e){o=` Installer bridge failed: ${e instanceof j?N(e.body.error??{code:`UNKNOWN`,message:e.message}):e instanceof Error?e.message:String(e)}. Settings were saved; re-run the wizard to retry the install plan.`}q.value={message:`${i}${o} You can close this browser window now.`,tone:`success`},ko.value=Bs(Rs()-1),jo.value=J.value,Po.value=rc()?Y.value:Po.value,zo.value=[],Bo.value=!0}catch(e){e instanceof j?(No.value=Ft(e.body.error??{code:`UNKNOWN`,message:e.message}),q.value={message:N(e.body.error??{code:`UNKNOWN`,message:e.message}),tone:`error`}):q.value={message:e instanceof Error?e.message:String(e),tone:`error`}}finally{Do.value=!1}}async function uc(){Is.value=!0,await Promise.all([Zs(),Qs()]),await oc(),sc(),await ic(Rs()-1)}function dc(){D(()=>{Zs(),Qs()},[]);let e=Qo.value||cs.value||!Zo.value||!ss.value,t=Object.values(ls.value).filter(Boolean).length,n=ns.value.length,r=ts.value.filter(e=>!ns.value.includes(e)).length;return P(`div`,{class:`ac-start`,children:[P(`section`,{class:`ac-start__card ac-start__card--primary`,children:[P(`h2`,{class:`ac-start__title`,children:`Recommended setup`}),P(`p`,{class:`ac-start__desc`,children:`The fastest path — we pre-select everything we can detect and you confirm one review screen before anything is written.`}),P(`ul`,{class:`ac-start__facts`,children:[P(`li`,{children:e?`Detecting your AI tools…`:t===0?`No AI tools detected — pick them on the review screen.`:`${t} AI tool${t===1?``:`s`} detected and pre-selected.`}),P(`li`,{children:e?`Detecting capability packs…`:n>0?`${n} installed pack${n===1?``:`s`} kept${r>0?`, ${r} more auto-detected`:``}.`:r>0?`${r} capability pack${r===1?``:`s`} auto-detected.`:`No packs pre-selected — add them any time later.`}),P(`li`,{children:`Settings keep their current values (or safe defaults on a first run).`}),P(`li`,{children:`Nothing is written until you confirm the review screen.`})]}),P(`button`,{type:`button`,class:`ac-button ac-button--primary ac-start__cta`,disabled:e,onClick:()=>{uc()},children:e?`Detecting…`:`Use recommended setup`})]}),P(`section`,{class:`ac-start__card`,children:[P(`h2`,{class:`ac-start__title`,children:`Customize`}),P(`p`,{class:`ac-start__desc`,children:`Walk through every step — tools, roles, packs, behaviour, budgets — and tune each choice yourself.`}),P(`button`,{type:`button`,class:`ac-button ac-start__cta`,onClick:()=>{Is.value=!0},children:`Customize step by step`})]})]})}var fc=[`de`,`en`,`en-US`,`en-GB`,`fr`,`es`,`it`,`nl`,`pt`,`pt-BR`];function pc(){if(Ds.value)return;let e=Y.value;if(e===null)return;Ds.value=!0;let t=e;if(e.identity.name.trim()===``){let e=Mt.value?.systemUser;e!==void 0&&e.trim()!==``&&(t={...t,identity:{...t.identity,name:e}})}if(!Fo.value&&typeof navigator<`u`){let e=(navigator.language||``).split(`-`)[0];e.length>=2&&(t={...t,language:e})}t!==e&&(Y.value=t)}function mc(){let e=Y.value;if(D(()=>{pc()},[e]),e===null)return P(`p`,{children:`Loading…`});let t=e=>{Y.value={...e,last_updated:new Date().toISOString().slice(0,10)},Lo.value=!1};return P(`div`,{class:`ac-wizard-step-stub ac-wizard__module-fields`,children:[P(`p`,{children:[`Tell the agent who you are. We pre-filled what we could detect — adjust freely. Stored in `,P(`code`,{children:`.agent-user.yml`}),`.`]}),P(`div`,{class:`ac-field`,children:[P(`label`,{class:`ac-field__label`,for:`welcome-name`,children:`Name`}),P(`input`,{class:`ac-input`,id:`welcome-name`,type:`text`,placeholder:`How should the agent address you?`,value:e.identity.name,onInput:n=>t({...e,identity:{...e.identity,name:n.currentTarget.value}})})]}),P(`div`,{class:`ac-field`,children:[P(`label`,{class:`ac-field__label`,for:`welcome-lang`,children:`Language`}),P(`input`,{class:`ac-input`,id:`welcome-lang`,type:`text`,list:`welcome-lang-list`,placeholder:`BCP-47 code, e.g. de, en, en-US`,value:e.language,onInput:n=>t({...e,language:n.currentTarget.value})}),P(`datalist`,{id:`welcome-lang-list`,children:fc.map(e=>P(`option`,{value:e},e))})]})]})}function hc(){let e=ws.value,t=ls.value;return P(`div`,{class:`ac-wizard-step-stub`,children:[P(`p`,{children:`Pick the AI tools you use. Tools detected on this machine are pre-selected on first run. The installer wires each selected tool's surface (skills, rules, commands) on apply; you can change this list later by re-running the wizard.`}),P(`ul`,{class:`ac-wizard__tool-list`,children:Xo.map(n=>{let r=t[n.id]===!0;return P(`li`,{class:`ac-wizard__tool-row`,children:[P(`label`,{class:`ac-wizard__tool-label`,children:[P(`input`,{type:`checkbox`,checked:e[n.id]??!1,onChange:t=>{let r=t.currentTarget.checked;ws.value={...e,[n.id]:r}}}),` `,n.label]}),P(`span`,{class:`ac-badge ${r?`ac-badge--installed`:`ac-badge--missing`}`,title:r?`Detected on this machine`:`Not detected on this machine`,children:r?`installed`:`not installed`})]},n.id)})})]})}function gc(){if(Qo.value)return P(`p`,{children:`Loading roles…`});if($o.value!==null)return P(`div`,{class:`ac-wizard-step-stub`,children:P(`p`,{class:`ac-banner ac-banner--error`,children:[`Discovery failed: `,$o.value]})});let e=as.value,t=is.value,n=(e,t)=>{os.value=!0,as.value={...as.value,[e]:t},sc()};return P(`div`,{class:`ac-wizard-step-stub`,children:[P(`p`,{children:[`Pick the areas you work in. We use them to recommend capability packs on the next step, and they become your roles in`,P(`code`,{children:` .agent-user.yml`}),`.`]}),t.length===0?P(`p`,{children:P(`em`,{children:`No roles available in the manifest.`})}):P(`div`,{class:`ac-wizard__pack-grid`,children:t.map(t=>P(`section`,{class:`ac-pack-tile`,children:[P(`label`,{class:`ac-pack-tile__head`,children:[P(`input`,{type:`checkbox`,checked:e[t.id]??!1,onChange:e=>{n(t.id,e.currentTarget.checked)}}),P(`span`,{class:`ac-pack-tile__title`,children:t.label})]}),(t.example_roles??[]).length>0?P(`p`,{class:`ac-pack-tile__role`,children:[`e.g. `,(t.example_roles??[]).join(`, `)]}):null,t.description===``?null:P(`p`,{class:`ac-pack-tile__desc`,children:t.description})]},t.id))})]})}function _c(){if(Qo.value)return P(`p`,{children:`Loading discovery manifest…`});if($o.value!==null)return P(`div`,{class:`ac-wizard-step-stub`,children:[P(`p`,{class:`ac-banner ac-banner--error`,children:[`Discovery failed: `,$o.value]}),P(`p`,{children:`The manifest endpoint is gated on extended-mode. Re-run the server with extended steps enabled to populate this list.`})]});let e=Ts.value,t=new Set(ts.value),n=new Set(ns.value),r=e=>n.has(e)?P(`span`,{class:`ac-badge ac-badge--installed`,children:`installed`}):t.has(e)?P(`span`,{class:`ac-badge ac-badge--detected`,children:`auto-detected`}):null,i=new Map(is.value.map(e=>[e.id,e.label])),a=as.value,o=e=>{let t=(e??[]).filter(e=>e!==`agent-config-maintainer`);return t.length===0?null:P(`span`,{class:`ac-pack-tile__ws`,children:t.map(e=>P(`span`,{class:`ac-badge ac-badge--ws${a[e]===!0?` ac-badge--ws-active`:``}`,title:a[e]===!0?`Matches a role you picked`:`Workspace / area`,children:i.get(e)??e},e))})},s=es.value.filter(e=>e.id!==`engineering-base`),c=new Map;for(let e of s)if(e.cluster!==void 0){let t=c.get(e.cluster)??[];t.push(e),c.set(e.cluster,t)}let l=new Set(s.filter(e=>e.cluster!==void 0).map(e=>e.id)),u=s.filter(e=>!l.has(e.id)),d=(e,t)=>{Es.value=!0,Ts.value={...Ts.value,[e]:t}},f=(e,t)=>{Es.value=!0;let n={...Ts.value,[e]:t};if(t)for(let t of c.get(e)??[])n[t.id]===void 0&&(n[t.id]=!0);Ts.value=n};return P(`div`,{class:`ac-wizard-step-stub`,children:[P(`p`,{children:`Pick the capability packs to install. Auto-detected packs are pre-selected; engineering hygiene is included automatically when a pack needs it. A language tile expands to its frameworks — turn the language off to skip them all.`}),u.length===0?P(`p`,{children:P(`em`,{children:`No packs available in the manifest.`})}):P(`div`,{class:`ac-wizard__pack-grid`,children:u.map(t=>{let n=c.get(t.id)??[],i=n.length>0,a=e[t.id]??!1;return P(`section`,{class:`ac-pack-tile`,children:[P(`label`,{class:`ac-pack-tile__head`,children:[P(`input`,{type:`checkbox`,checked:a,onChange:e=>{let n=e.currentTarget.checked;i?f(t.id,n):d(t.id,n)}}),P(`span`,{class:`ac-pack-tile__title`,children:t.label}),r(t.id)]}),o(t.workspaces),t.description===``?null:P(`p`,{class:`ac-pack-tile__desc`,children:t.description}),i?P(`fieldset`,{class:`ac-pack-tile__children`,disabled:!a,children:n.map(t=>P(`label`,{class:`ac-pack-tile__child`,children:[P(`input`,{type:`checkbox`,checked:e[t.id]??!1,disabled:!a,onChange:e=>{d(t.id,e.currentTarget.checked)}}),P(`span`,{children:t.label}),r(t.id)]},t.id))}):null]},t.id)})})]})}function vc(){let e=ds.value,t=fs.value,n=ps.value,r=ms.value,i=gs.value,a=e===null?P(`span`,{class:`ac-badge ac-badge--missing`,children:`detecting…`}):e?P(`span`,{class:`ac-badge ac-badge--installed`,children:[`installed`,r===null?``:` (v${r})`]}):t===!0?P(`span`,{class:`ac-badge ac-badge--missing`,children:n===`unknown-rtk`?`different tool`:`unverified`}):P(`span`,{class:`ac-badge ac-badge--missing`,children:`not installed`});return P(`div`,{class:`ac-rtk-row`,children:[P(`div`,{class:`ac-rtk-row__head`,children:[P(`span`,{class:`ac-rtk-row__label`,children:[`rtk `,P(`small`,{children:`(Rust Token Killer — third-party, Apache-2.0)`})]}),a]}),t===!0&&n===`unknown-rtk`?P(`div`,{class:`ac-rtk-row__install`,children:[P(`p`,{class:`ac-field__description`,children:[`A binary named `,P(`code`,{children:`rtk`}),` is on PATH, but it is not Rust Token Killer — two unrelated projects share the name (the other is Rust Type Kit). The token-saving integration stays off. See the upstream name-collision guidance:`]}),P(`a`,{class:`ac-button`,href:`${_s.value}/blob/master/INSTALL.md`,target:`_blank`,rel:`noreferrer noopener`,children:`Open rtk install guide`})]}):null,t===!0&&n===`unverified`?P(`p`,{class:`ac-field__description`,children:[`rtk found but the identity check failed — verify manually with `,P(`code`,{children:`rtk gain`}),` (Rust Token Killer renders a token-savings dashboard; the colliding Rust Type Kit does not).`]}):null,t===!1?P(`div`,{class:`ac-rtk-row__install`,children:[P(`p`,{class:`ac-field__description`,children:`rtk wraps verbose CLI output — upstream reports 60–90% token savings (their estimate). Install it, then re-open the wizard to pick up detection:`}),i===null?hs.value===null?null:P(`code`,{class:`ac-rtk-row__cmd`,children:hs.value}):P(b,{children:[i.recommendedLabel===void 0?null:P(`p`,{class:`ac-field__description`,children:[i.recommendedLabel,`:`]}),P(`code`,{class:`ac-rtk-row__cmd`,children:i.recommended}),i.manual===void 0?null:P(b,{children:[P(`p`,{class:`ac-field__description`,children:[i.manualLabel??`Manual`,`:`]}),P(`code`,{class:`ac-rtk-row__cmd`,children:i.manual})]}),i.note===void 0?null:P(`p`,{class:`ac-field__description`,children:i.note})]}),P(`a`,{class:`ac-button`,href:_s.value,target:`_blank`,rel:`noreferrer noopener`,children:`Open rtk repo`})]}):null]})}async function yc(){try{await M(`/api/v1/wizard/dismiss-recommendation`,{method:`POST`,body:{id:`agent-switch`}})}catch(e){q.value={message:e instanceof Error?e.message:String(e),tone:`error`};return}Cs.value=!0}function bc(){return!vs.value||ys.value!==!1||Cs.value?null:P(`div`,{class:`ac-rtk-row`,children:[P(`div`,{class:`ac-rtk-row__head`,children:[P(`span`,{class:`ac-rtk-row__label`,children:[`agent-switch `,P(`small`,{children:`(third-party, MIT)`})]}),P(`span`,{class:`ac-badge ac-badge--missing`,children:`not installed`})]}),P(`div`,{class:`ac-rtk-row__install`,children:[P(`p`,{class:`ac-field__description`,children:[`agent-switch isolates multiple agent accounts into per-account profiles (`,P(`code`,{children:`CLAUDE_CONFIG_DIR`}),`) so switching accounts never requires a re-login. Free and MIT-licensed.`]}),xs.value===null?null:P(`code`,{class:`ac-rtk-row__cmd`,children:xs.value}),P(`a`,{class:`ac-button`,href:`https://github.com/${Ss.value}`,target:`_blank`,rel:`noreferrer noopener`,children:`Open agent-switch repo`}),P(`button`,{type:`button`,class:`ac-button ac-button--small`,onClick:()=>{yc()},children:`Don't show again`})]})]})}function xc(){let e=oo(ko.value,{extended:X.value});if(X.value&&Ps.value===`install`&&e.id===`identity`&&!Fs.value)return P(bo,{});if(e.kind===`form`){let t=lo(Ao.value,e.paths??[]);return P(b,{children:[e.id===`identity`?P(vc,{}):null,e.id===`identity`?P(bc,{}):null,P(tn,{schema:t,values:J.value,errors:No.value,onChange:e=>{J.value=e}})]})}return e.kind===`userMd`?!Io.value||Y.value===null?P(`p`,{children:`Loading .agent-user.yml…`}):P(cn,{value:Y.value,errors:No.value,hideRole:X.value&&Ps.value===`install`,hideIdentityBasics:X.value&&Ps.value===`install`,onChange:e=>{Y.value=e,Lo.value=!1}}):e.kind===`welcome`?P(mc,{}):e.kind===`aiTools`?P(hc,{}):e.kind===`roles`?P(gc,{}):e.kind===`packs`?P(_c,{}):P(vo,{steps:Ls(),currentIndex:ko.value,changes:zo.value,errors:No.value,userMdChanged:rc(),userMdAction:Fo.value?`replace`:`create`,loading:Oo.value,onJump:e=>{ic(e)},selectedToolsCount:Object.values(ws.value).filter(Boolean).length,selectedPacksCount:Object.values(Ts.value).filter(Boolean).length,packRemovals:Sc(),removalsConfirmed:rs.value,onConfirmRemovals:e=>{rs.value=e},selectedToolIds:Object.entries(ws.value).filter(([,e])=>e).map(([e])=>e),packAdditions:X.value?ac().filter(e=>e!==`engineering-base`&&!ns.value.includes(e)):[]})}function Sc(){return X.value?co(ns.value,ac()):[]}function Cc({path:e}){if(D(()=>{qs()},[]),!To.value||Ao.value===null)return P(`div`,{class:`ac-page`,children:[P(`h1`,{children:`Setup wizard`}),Eo.value===null?P(`p`,{children:`Loading…`}):P(`p`,{class:`ac-banner ac-banner--error`,children:Eo.value})]});let t=ko.value,n=Rs(),r=oo(t,{extended:X.value}),i=t===n-1,a=r.kind===`aiTools`&&Object.values(ws.value).filter(Boolean).length===0||r.kind===`roles`&&Object.values(as.value).filter(Boolean).length===0||r.kind===`packs`&&ac().length===0,o=X.value&&Ps.value===`install`&&r.id===`identity`&&!Fs.value,s=Os.value,c=s!==null&&!ks.value,l=As.value,u=l!==null&&l.present&&!js.value,d=X.value&&Ps.value===`install`&&t===0&&!Is.value&&!Bo.value;return u?P(`div`,{class:`ac-page`,children:P(xo,{sourcePath:l.path,backupTarget:l.backupTarget,version:l.version,busy:Ms.value,error:Ns.value,onBackupAndProceed:()=>{Gs()},onAbort:()=>{q.value={tone:`info`,message:"Aborted. Uninstall v3 manually, then re-run `agent-config install`."},js.value=!0}})}):d?P(`div`,{class:`ac-page`,children:[P(`header`,{class:`ac-page__header`,children:P(`h1`,{children:`Set up agent-config`})}),q.value===null?null:P(`p`,{class:`ac-banner${q.value.tone===`error`?` ac-banner--error`:``}`,children:q.value.message}),P(dc,{})]}):P(`div`,{class:`ac-page`,children:[P(fo,{step:r,index:t,total:n}),c?P(yo,{abortedAt:s.abortedAt,abortNote:s.abortNote,writesSinceRollback:s.writesSinceRollback,busy:Do.value,onResume:()=>{Ks(`resume`)},onRollback:()=>{Ks(`rollback`)},onIgnore:()=>{Ks(`ignore`)}}):null,q.value!==null&&!(Bo.value&&i&&q.value.tone===`success`)?P(`p`,{class:`ac-banner${q.value.tone===`error`?` ac-banner--error`:``}`,children:q.value.message}):null,P(`div`,{class:`ac-wizard__step`,children:Bo.value&&i?P(wo,{message:q.value?.tone===`success`?q.value.message:null}):P(xc,{})}),a?P(`p`,{class:`ac-wizard__hint`,children:r.kind===`aiTools`?`Select at least one AI tool to continue.`:r.kind===`roles`?`Select at least one role to continue.`:`Select at least one capability pack to continue.`}):null,P(po,{canGoPrev:t>0,canGoNext:!i&&!a,canSkip:o||r.kind===`userMd`,skipLabel:o?`Finish install here`:`Skip`,isLast:i,busy:Do.value||Oo.value,canFinish:(zo.value.length>0||rc()||Sc().length>0||X.value&&Object.values(ws.value).some(Boolean))&&(Sc().length===0||rs.value),completed:Bo.value,onPrev:()=>{ic(t-1)},onNext:()=>{if(o){Fs.value=!0;return}ic(t+1)},onSkip:()=>{if(o){Fs.value=!0,ic(Rs()-1);return}Lo.value=!0,ic(t+1)},onFinish:()=>{lc()}})]})}var wc=new Set([`profile.id`,`rule_loading_tier`,`discipline_profile`,`personal.ide`,`personal.open_edited_files`,`personal.autonomy`,`personal.pr_progress_comments`,`cost.budgets.daily`,`cost.budgets.weekly`,`cost.budgets.monthly`,`cost.enforcement`,`model.auto_switch`,`roadmap.quality_cadence`,`quality.local_auto_run`,`memory.redact_patterns`,`chat_history.enabled`,`update_check.enabled`,`legal_review_prep.acknowledged`]);function Tc(e){return wc.has(e)}function Ec(e,t){return JSON.stringify(e??null)===JSON.stringify(t??null)}function Dc(e,t){if(e.kind===`enum_removed`){let n=new Set(e.values??[]);return t!==void 0&&n.has(t)?`must_fix`:`info`}return e.kind===`type_changed`?`must_fix`:e.kind===`default_changed`?t===void 0||Ec(t,e.old?.default)?`adopt`:`review`:e.kind===`added`&&e.new?.default===void 0?`must_fix`:`info`}var Oc=A(!0),kc=A(null),Ac=A(!1),jc=A(null),Mc=A({}),Nc=A(0),Pc=A({}),Fc=A(null),Ic=A(!1),Lc=A(!1);function Rc(e){return`${e.key}:${e.kind}`}async function zc(){Oc.value=!0,kc.value=null,Ac.value=!1,Lc.value=!1;try{let e=await M(`/api/v1/settings/changes`),t=await M(`/api/v1/settings`);jc.value=e.delta,Mc.value=t.values,Nc.value=t.lastModified,Bc(e.delta,t.values)}catch(e){e instanceof j&&e.status===404?Ac.value=!0:kc.value=e instanceof Error?e.message:String(e)}finally{Oc.value=!1}}function Bc(e,t){let n={};for(let r of e.changes){let e=Dc(r,Yt(t,r.key.split(`.`)));e===`adopt`?n[Rc(r)]={mode:`adopt`}:e===`review`?n[Rc(r)]={mode:`keep`}:e===`must_fix`&&(n[Rc(r)]={mode:null})}Pc.value=n}function Vc(e){return Dc(e,Yt(Mc.value,e.key.split(`.`)))}function Hc(e,t){Pc.value={...Pc.value,[e]:t}}function Uc(){let e=jc.value;return e===null?[]:e.changes.filter(e=>{if(Vc(e)!==`must_fix`)return!1;let t=Pc.value[Rc(e)];return t===void 0||t.mode===null||t.mode===`custom`&&(t.value===void 0||t.value===``)})}function Wc(){let e=jc.value,t=Mc.value;if(e===null)return t;for(let n of e.changes){let e=Pc.value[Rc(n)];if(e===void 0||e.mode===null||e.mode===`keep`)continue;let r=n.key.split(`.`);e.mode===`adopt`&&n.new?.default!==void 0?t=Xt(t,r,n.new.default):e.mode===`custom`&&e.value!==void 0&&(t=Xt(t,r,e.value))}return t}async function Gc(){if(Ic.value)return;let e=Uc();if(e.length>0){Fc.value=`Resolve the ${e.length} “Must fix” item${e.length===1?``:`s`} first.`;return}Ic.value=!0,Fc.value=null;try{let e=Wc();if(JSON.stringify(e)!==JSON.stringify(Mc.value)){let t=await M(`/api/v1/settings`,{method:`PUT`,headers:{"If-Unmodified-Since":String(Nc.value)},body:{values:e}});Mc.value=e,Nc.value=t.lastModified}await M(`/api/v1/settings/changes/ack`,{method:`POST`}),Lc.value=!0}catch(e){Fc.value=e instanceof j?N(e.body.error??{code:`UNKNOWN`,message:e.message}):e instanceof Error?e.message:String(e)}finally{Ic.value=!1}}async function Kc(){if(!Ic.value){if(Uc().length>0){Fc.value=`Cannot dismiss — “Must fix” items would leave invalid values in place.`;return}Ic.value=!0;try{await M(`/api/v1/settings/changes/ack`,{method:`POST`}),Lc.value=!0}catch(e){Fc.value=e instanceof Error?e.message:String(e)}finally{Ic.value=!1}}}function qc(e){return e===void 0?`—`:typeof e==`string`?e:JSON.stringify(e)}function Jc({change:e,id:t}){let n=e.new,r=Pc.value[t]?.value;return n?.enum===void 0?n?.type===`boolean`?P(`select`,{class:`ac-input`,"aria-label":`New value for ${e.key}`,value:r===void 0?``:String(r),onChange:e=>{Hc(t,{mode:`custom`,value:e.currentTarget.value===`true`})},children:[P(`option`,{value:``,disabled:!0,children:`Choose…`}),P(`option`,{value:`true`,children:`true`}),P(`option`,{value:`false`,children:`false`})]}):P(`input`,{class:`ac-input`,type:n?.type===`number`||n?.type===`integer`?`number`:`text`,"aria-label":`New value for ${e.key}`,value:r===void 0?``:String(r),onInput:e=>{let r=e.currentTarget.value;Hc(t,{mode:`custom`,value:n?.type===`number`||n?.type===`integer`?Number(r):r})}}):P(`select`,{class:`ac-input`,"aria-label":`New value for ${e.key}`,value:r===void 0?``:String(r),onChange:e=>{let n=e.currentTarget.value;Hc(t,{mode:`custom`,value:n})},children:[P(`option`,{value:``,disabled:!0,children:`Choose a value…`}),n.enum.map(e=>P(`option`,{value:String(e),children:String(e)},String(e)))]})}function Yc({change:e}){let t=Vc(e),n=Rc(e),r=Pc.value[n],i=Yt(Mc.value,e.key.split(`.`));return P(`li`,{class:`ac-change-card ac-change-card--${t}`,"data-key":e.key,"data-kind":e.kind,children:[P(`div`,{class:`ac-change-card__head`,children:[P(`code`,{class:`ac-change-card__key`,children:e.key}),P(`span`,{class:`ac-change-card__badge ac-change-card__badge--${t}`,children:t===`must_fix`?`Must fix`:t===`adopt`?`New default`:t===`review`?`Review`:`Info`})]}),e.new?.description===void 0?null:P(`p`,{class:`ac-change-card__desc`,children:e.new.description}),e.kind===`default_changed`?P(b,{children:[P(`p`,{class:`ac-change-card__detail`,children:[`Default changed: `,P(`code`,{children:qc(e.old?.default)}),` → `,P(`code`,{children:qc(e.new?.default)}),t===`review`?P(b,{children:[` · your value: `,P(`code`,{children:qc(i)})]}):null]}),P(`div`,{class:`ac-change-card__choices`,role:`radiogroup`,"aria-label":`Resolution for ${e.key}`,children:[P(`label`,{class:`ac-change-card__choice`,children:[P(`input`,{type:`radio`,name:n,checked:r?.mode===`adopt`,onChange:()=>{Hc(n,{mode:`adopt`})}}),P(`span`,{children:[`Adopt new default (`,P(`code`,{children:qc(e.new?.default)}),`)`]})]}),P(`label`,{class:`ac-change-card__choice`,children:[P(`input`,{type:`radio`,name:n,checked:r?.mode===`keep`,onChange:()=>{Hc(n,{mode:`keep`})}}),P(`span`,{children:[`Keep current (`,P(`code`,{children:qc(i??e.old?.default)}),`)`]})]})]})]}):null,e.kind===`enum_removed`?t===`must_fix`?P(b,{children:[P(`p`,{class:`ac-change-card__detail`,children:[`Your value `,P(`code`,{children:qc(i)}),` is no longer valid — removed option`,(e.values?.length??0)===1?``:`s`,`: `,P(`code`,{children:(e.values??[]).join(`, `)}),`. Pick a replacement:`]}),P(Jc,{change:e,id:n})]}):P(`p`,{class:`ac-change-card__detail`,children:[`Removed option`,(e.values?.length??0)===1?``:`s`,`: `,P(`code`,{children:(e.values??[]).join(`, `)}),` — your value `,P(`code`,{children:qc(i??e.new?.default)}),` is unaffected.`]}):null,e.kind===`enum_added`?P(`p`,{class:`ac-change-card__detail`,children:[`New option`,(e.values?.length??0)===1?``:`s`,` available: `,P(`code`,{children:(e.values??[]).join(`, `)})]}):null,e.kind===`added`?t===`must_fix`?P(b,{children:[P(`p`,{class:`ac-change-card__detail`,children:`New setting without a shipped default — define a value:`}),P(Jc,{change:e,id:n})]}):P(`p`,{class:`ac-change-card__detail`,children:[`New setting · default: `,P(`code`,{children:qc(e.new?.default)}),e.new?.enum===void 0?null:P(b,{children:[` · options: `,P(`code`,{children:e.new.enum.join(`, `)})]})]}):null,e.kind===`removed`?P(`p`,{class:`ac-change-card__detail`,children:`This setting no longer exists. Your stored value is kept in place and ignored (nothing is deleted).`}):null,e.kind===`type_changed`?P(b,{children:[P(`p`,{class:`ac-change-card__detail`,children:[`Type changed: `,P(`code`,{children:e.old?.type}),` → `,P(`code`,{children:e.new?.type}),`. Define a new value:`]}),P(Jc,{change:e,id:n})]}):null]})}function Xc(e){let t=new Map;for(let n of e.changes){let e=Vc(n);t.set(e,[...t.get(e)??[],n])}let n=[],r=t.get(`must_fix`)??[];r.length>0&&n.push({title:`Must fix`,hint:`These stored values are invalid after the upgrade — saving is blocked until each has a valid value.`,changes:r});let i=[...t.get(`adopt`)??[],...t.get(`review`)??[]];i.length>0&&n.push({title:`Changed defaults`,hint:`Values you never customized are preselected to adopt the new default; customized values are kept unless you choose otherwise.`,changes:i});let a=t.get(`info`)??[],o=a.filter(e=>e.kind===`added`),s=a.filter(e=>e.kind===`enum_added`),c=a.filter(e=>e.kind!==`added`&&e.kind!==`enum_added`);return o.length>0&&n.push({title:`New settings`,changes:o}),s.length>0&&n.push({title:`New options`,changes:s}),c.length>0&&n.push({title:`Removed / other`,changes:c}),n}function Zc(){if(D(()=>{zc()},[]),Oc.value)return P(`div`,{class:`ac-page`,children:[P(`h1`,{children:`Settings changes`}),P(`p`,{children:`Loading…`})]});if(kc.value!==null)return P(`div`,{class:`ac-page`,children:[P(`h1`,{children:`Settings changes`}),P(`p`,{class:`ac-banner ac-banner--error`,children:kc.value})]});if(Lc.value||Ac.value)return P(`div`,{class:`ac-page ac-settings-changes`,children:[P(`h1`,{children:`Settings changes`}),P(`p`,{class:`ac-banner`,children:Lc.value?`Review complete — all changes resolved.`:`Nothing to review — your settings are up to date.`}),P(`button`,{type:`button`,class:`ac-button`,onClick:()=>Et(`/settings`),children:`Back to Settings`})]});let e=jc.value;if(e===null)return P(`div`,{class:`ac-page`,children:P(`h1`,{children:`Settings changes`})});let t=Xc(e),n=Uc().length;return P(`div`,{class:`ac-page ac-settings-changes`,children:[P(`header`,{class:`ac-page__header`,children:[P(`h1`,{children:`Settings changes`}),P(`p`,{class:`ac-page__lede`,children:[`The upgrade `,P(`code`,{children:e.oldVersion}),` → `,P(`code`,{children:e.newVersion}),` changed the available settings. Review below — nothing was changed automatically.`]})]}),Fc.value===null?null:P(`p`,{class:`ac-banner ac-banner--error`,role:`alert`,children:Fc.value}),t.map(e=>P(`section`,{class:`ac-settings-changes__group`,children:[P(`h2`,{children:[e.title,` `,P(`span`,{class:`ac-settings-changes__count`,children:[`(`,e.changes.length,`)`]})]}),e.hint===void 0?null:P(`p`,{class:`ac-settings-changes__hint`,children:e.hint}),P(`ul`,{class:`ac-settings-changes__list`,children:e.changes.map(e=>P(Yc,{change:e},Rc(e)))})]},e.title)),P(`div`,{class:`ac-form__actions`,children:[P(`button`,{type:`button`,class:`ac-button`,disabled:Ic.value,onClick:()=>{Kc()},children:`Dismiss (keep everything)`}),P(`button`,{type:`button`,class:`ac-button ac-button--primary`,disabled:Ic.value||n>0,title:n>0?`${n} “Must fix” item${n===1?``:`s`} unresolved`:void 0,onClick:()=>{Gc()},children:Ic.value?`Saving…`:`Apply & finish review`})]})]})}var Qc=A(null);function $c(){return D(()=>{(async()=>{try{Qc.value=(await M(`/api/v1/settings/changes`)).delta.changes.length}catch{Qc.value=null}})()},[]),Qc.value===null||Qc.value===0?null:P(`div`,{class:`ac-banner ac-banner--pending`,role:`status`,children:[P(`span`,{children:[`An upgrade changed `,Qc.value,` setting`,Qc.value===1?``:`s`,` — review recommended.`]}),P(`button`,{type:`button`,class:`ac-button ac-button--small`,onClick:()=>Et(`/settings/changes`),children:`Review changes`})]})}var el=A(!1),tl=A(null),Z=A({}),nl=A(null),rl=A(0),il=A({}),al=A(null),ol=A(!1),sl=A(null),cl=A(null),ll=A(``),ul=A(!1),dl=A({}),fl=A({global:new Set,project:new Set});function pl(e){if(`$ref`in e&&e.$ref!==void 0&&`definitions`in e&&e.definitions!==void 0){let t=e.$ref.replace(`#/definitions/`,``),n=e.definitions[t];if(n!==void 0)return n}return e}async function ml(){tl.value=null;try{let e=await M(`/api/v1/settings`);Z.value=e.values,nl.value=pl(e.schema),rl.value=e.lastModified,fl.value={global:new Set(e.sources?.global??[]),project:new Set(e.sources?.project??[])},el.value=!0}catch(e){if(e instanceof j&&e.status===404&&e.body.error?.code===`NOT_FOUND`){let t=e.body;if(t.defaults!==void 0&&t.schema!==void 0){Z.value=t.defaults,nl.value=pl(t.schema),rl.value=t.lastModified??0,el.value=!0;return}}tl.value=e instanceof Error?e.message:String(e)}}async function hl(){if(!ol.value){al.value=null,il.value={};try{let e=await M(`/api/v1/settings/diff`,{method:`POST`,body:{values:Z.value,ifUnmodifiedSince:rl.value}});if(e.changes.length===0){al.value=`No changes to save.`;return}sl.value=e.changes}catch(e){e instanceof j?(il.value=Ft(e.body.error??{code:`UNKNOWN`,message:e.message}),al.value=N(e.body.error??{code:`UNKNOWN`,message:e.message})):al.value=e instanceof Error?e.message:String(e)}}}async function gl(e=!1){ol.value=!0;try{let t=await M(`/api/v1/settings`,{method:`PUT`,headers:{"If-Unmodified-Since":String(rl.value)},body:e?{values:Z.value,confirmSharedWrite:!0}:{values:Z.value}});rl.value=t.lastModified,sl.value=null,cl.value=null,al.value=`Saved (${t.writtenPaths.join(`, `)}).`}catch(e){if(e instanceof j){let t=e.body;if(e.status===409&&t.error===`shared-write`){sl.value=null,cl.value={sharedPath:typeof t.sharedPath==`string`?t.sharedPath:``,message:typeof t.message==`string`?t.message:`This write affects a shared agent-switch profile.`};return}let n=e.body.error??{code:`UNKNOWN`,message:e.message};il.value=Ft(n),al.value=N(n),sl.value=null;let r=Object.keys(il.value)[0];r!==void 0&&queueMicrotask(()=>{let e=document.getElementById(r);e!==null&&e.focus()})}else al.value=e instanceof Error?e.message:String(e)}finally{ol.value=!1}}function _l(e){if(e.defaultValue===void 0)return!1;let t=Yt(Z.value,e.path);return t!==void 0&&JSON.stringify(t)!==JSON.stringify(e.defaultValue)}function vl(e,t){let n=_l(t),r=fl.value.project.has(e)?`project`:fl.value.global.has(e)&&fl.value.project.size>0?`global`:void 0;return{modified:n,onReset:n&&t.defaultValue!==void 0?()=>{Z.value=Xt(Z.value,t.path,t.defaultValue)}:void 0,sourceLabel:r}}function yl(e,t){let n=t.toLowerCase();return e.path.join(`.`).toLowerCase().includes(n)||e.label.toLowerCase().includes(n)||(e.description??``).toLowerCase().includes(n)}function bl(e){let t=ll.value.trim(),n=ul.value,r=e.path.join(`.`),i=dl.value[r]===!0,a=e.fields.filter(e=>e.kind!==`unsupported`);if(t!==``&&(a=a.filter(e=>yl(e,t))),n&&(a=a.filter(e=>_l(e))),t!==``||n)return a.length===0?null:{section:e,visible:a,hiddenAdvancedCount:0,expanded:i};let o=a.filter(e=>Tc(e.path.join(`.`))),s=a.filter(e=>!Tc(e.path.join(`.`))),c=i?[...o,...s]:o;return c.length===0&&s.length===0?null:{section:e,visible:c,hiddenAdvancedCount:i?0:s.length,expanded:i}}function xl(e){dl.value={...dl.value,[e]:dl.value[e]!==!0}}function Sl(){let e=Mt.value?.agentSwitchProfile;return e===void 0||e.active!==!0?null:P(`div`,{class:`ac-banner`,role:`status`,children:P(`span`,{children:[`Running under agent-switch profile `,P(`code`,{children:e.provider!==null&&e.profile!==null?`${e.provider}/${e.profile}`:`an unidentified profile`}),` — settings shown and saved here are profile-scoped. Switching profiles shows that profile's own settings; nothing is lost.`]})})}function Cl({block:e}){return P(`div`,{class:`ac-modal`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`shared-write-title`,children:P(`div`,{class:`ac-modal__panel`,children:[P(`h2`,{id:`shared-write-title`,children:`Shared write — affects all profiles`}),P(`p`,{children:e.message}),P(`p`,{children:P(`code`,{children:e.sharedPath})}),P(`div`,{class:`ac-modal__actions`,children:[P(`button`,{type:`button`,class:`ac-button`,onClick:()=>{cl.value=null},children:`Cancel`}),P(`button`,{type:`button`,class:`ac-button ac-button--primary`,disabled:ol.value,onClick:()=>{gl(!0)},children:ol.value?`Writing…`:`Write (affects all profiles)`})]})]})})}function wl({changes:e}){return P(`div`,{class:`ac-modal`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`diff-title`,children:P(`div`,{class:`ac-modal__panel`,children:[P(`h2`,{id:`diff-title`,children:`Confirm changes`}),P(`ul`,{class:`ac-diff`,children:e.map(e=>P(`li`,{children:[P(`code`,{children:e.path}),P(`span`,{class:`ac-diff__before`,children:JSON.stringify(e.from)}),P(`span`,{class:`ac-diff__arrow`,children:`→`}),P(`span`,{class:`ac-diff__after`,children:JSON.stringify(e.to)})]},e.path))}),P(`div`,{class:`ac-modal__actions`,children:[P(`button`,{type:`button`,class:`ac-button`,onClick:()=>{sl.value=null},children:`Cancel`}),P(`button`,{type:`button`,class:`ac-button ac-button--primary`,disabled:ol.value,onClick:()=>{gl()},children:ol.value?`Saving…`:`Save`})]})]})})}function Tl(){if(D(()=>{ml()},[]),!el.value||nl.value===null)return P(`div`,{class:`ac-page`,children:[P(`h1`,{children:`Settings`}),tl.value===null?P(`p`,{children:`Loading…`}):P(`p`,{class:`ac-banner ac-banner--error`,children:tl.value})]});let e=Jt(nl.value),t=e.map(bl).filter(e=>e!==null),n=e.flatMap(e=>e.fields).filter(e=>_l(e)).length,r=ll.value.trim()!==``||ul.value;return P(`div`,{class:`ac-page ac-settings-hub`,children:[P(`header`,{class:`ac-page__header`,children:[P(`h1`,{children:`Settings`}),P(`nav`,{class:`ac-page__nav`,children:P(`a`,{href:`#/settings/user`,children:`Edit .agent-user.yml →`})})]}),P($c,{}),P(Sl,{}),P(`div`,{class:`ac-settings-hub__toolbar`,role:`search`,children:[P(`input`,{class:`ac-input ac-settings-hub__search`,type:`search`,placeholder:`Search all settings (basic and advanced)…`,value:ll.value,onInput:e=>{ll.value=e.currentTarget.value}}),P(`button`,{type:`button`,class:`ac-chip-toggle${ul.value?` ac-chip-toggle--active`:``}`,"aria-pressed":ul.value,onClick:()=>{ul.value=!ul.value},children:[`@modified`,n>0?` (${n})`:``]})]}),al.value===null?null:P(`p`,{class:`ac-banner`,children:al.value}),P(`form`,{class:`ac-form`,onSubmit:e=>e.preventDefault(),children:[t.length===0?P(`p`,{class:`ac-settings-hub__empty`,children:`No settings match.`}):t.map(e=>{let t=e.section.path.join(`.`);return P(en,{section:{...e.section,fields:e.visible},values:Z.value,errors:il.value,onChange:e=>{Z.value=e},decorate:vl,footer:!r&&(e.hiddenAdvancedCount>0||e.expanded)?P(`button`,{type:`button`,class:`ac-settings-hub__disclosure`,"aria-expanded":e.expanded,onClick:()=>{xl(t)},children:e.expanded?`Hide advanced settings`:`Show ${e.hiddenAdvancedCount} advanced setting${e.hiddenAdvancedCount===1?``:`s`}`}):void 0},t)}),P(`div`,{class:`ac-form__actions`,children:[P(`button`,{type:`button`,class:`ac-button`,onClick:()=>{ml()},children:`Reload`}),P(`button`,{type:`button`,class:`ac-button ac-button--primary`,onClick:()=>{hl()},children:`Preview & Save`})]})]}),sl.value===null?null:P(wl,{changes:sl.value}),cl.value===null?null:P(Cl,{block:cl.value})]})}var El=A(!1),Dl=A(null);async function Ol(){Ho.value=!0,Uo.value=null;try{let e=await M(`/api/v1/modules/detect`);Wo.value=e.candidates,Yo.value=e.project_root;let t={};for(let n of e.candidates)t[n.path]=!0;Go.value=t,Ko.value=e.proposed_block.enabled,qo.value=e.proposed_block.namespace_template??``,Jo.value=e.proposed_block.agent_folder??`agents`}catch(e){Uo.value=e instanceof j?N(e.body.error??{code:`UNKNOWN`,message:e.message}):e instanceof Error?e.message:String(e)}finally{Ho.value=!1,Vo.value=!0}}function kl(){let e=new Set(Wo.value.map(e=>e.path)),t=Go.value,n=Object.keys(t).filter(n=>t[n]===!0&&e.has(n));return{enabled:Ko.value,root_paths:n,namespace_template:qo.value,agent_folder:Jo.value||`agents`}}async function Al(){El.value=!0,Dl.value=null;try{let e=await M(`/api/v1/modules/apply`,{method:`POST`,body:kl()});Dl.value={message:e.appliedTo===null?`Saved project settings to ${e.projectRoot}.`:`Saved project settings to ${e.appliedTo}.`,tone:`success`}}catch(e){Dl.value={message:`Could not save project settings: ${e instanceof j?N(e.body.error??{code:`UNKNOWN`,message:e.message}):e instanceof Error?e.message:String(e)}`,tone:`error`}}finally{El.value=!1}}function jl(){if(Ho.value)return P(`p`,{children:`Detecting module roots…`});if(Uo.value!==null)return P(`p`,{class:`ac-banner ac-banner--error`,children:[`Module detection failed: `,Uo.value]});let e=Wo.value,t=Go.value,n=Yo.value;return P(`div`,{class:`ac-section`,children:[n===null?null:P(`p`,{class:`ac-section__description`,children:[`Scanning `,P(`code`,{children:n}),`. Pick which detected roots the agent should treat as modules. These write to`,P(`code`,{children:` .agent-project-settings.yml`}),` in this repo only.`]}),P(`label`,{children:[P(`input`,{type:`checkbox`,checked:Ko.value,onChange:e=>{Ko.value=e.currentTarget.checked}}),` `,`Enable module discovery (writes `,P(`code`,{children:`modules.enabled`}),`)`]}),e.length===0?P(`p`,{children:[P(`em`,{children:`No module roots detected.`}),` The scan found no common module layouts (Laravel `,P(`code`,{children:`app/Modules/`}),`, Symfony`,P(`code`,{children:` src/Module/`}),`, Node `,P(`code`,{children:`packages/`}),`, Python`,P(`code`,{children:` src/`}),`, Go `,P(`code`,{children:`internal/`}),`).`]}):P(`ul`,{style:`list-style: none; padding-left: 0;`,children:e.map(e=>P(`li`,{children:P(`label`,{children:[P(`input`,{type:`checkbox`,checked:t[e.path]??!1,onChange:n=>{let r=n.currentTarget.checked;Go.value={...t,[e.path]:r}}}),` `,P(`code`,{children:e.path}),` — `,e.stack,` `,P(`small`,{children:[`(`,e.confidence,` confidence)`]})]})},e.path))}),P(`div`,{class:`ac-wizard__module-fields`,children:[P(`div`,{class:`ac-field`,children:[P(`label`,{class:`ac-field__label`,for:`ac-modules-namespace`,children:`Namespace template`}),P(`input`,{id:`ac-modules-namespace`,class:`ac-input`,type:`text`,value:qo.value,placeholder:`e.g. App\\\\Modules\\\\{ModuleName}\\\\App`,onInput:e=>{qo.value=e.currentTarget.value}}),P(`span`,{class:`ac-field__description`,children:`How a module path maps to its namespace. Leave blank to skip namespacing.`})]}),P(`div`,{class:`ac-field`,children:[P(`label`,{class:`ac-field__label`,for:`ac-modules-agent-folder`,children:`Agent folder`}),P(`input`,{id:`ac-modules-agent-folder`,class:`ac-input`,type:`text`,value:Jo.value,placeholder:`agents`,onInput:e=>{Jo.value=e.currentTarget.value}}),P(`span`,{class:`ac-field__description`,children:[`Folder name that holds per-module agent docs (default `,P(`code`,{children:`agents`}),`).`]})]})]})]})}function Ml(){return D(()=>{Ol()},[]),P(`div`,{class:`ac-page`,children:[P(`header`,{class:`ac-page__header`,children:[P(`h1`,{children:`Project settings`}),P(`p`,{class:`ac-section__description`,children:[`Configuration scoped to this repository — written to`,P(`code`,{children:` .agent-project-settings.yml`}),`, not the global tree.`]})]}),Dl.value===null?null:P(`p`,{class:`ac-banner ac-banner--${Dl.value.tone===`success`?`success`:`error`}`,children:Dl.value.message}),P(`section`,{class:`ac-section`,children:[P(`h2`,{class:`ac-section__title`,children:`Modules`}),P(jl,{})]}),P(`div`,{class:`ac-form__actions ac-wizard__nav`,children:P(`button`,{type:`button`,class:`ac-button ac-button--primary`,disabled:El.value||Ho.value,onClick:()=>{Al()},children:El.value?`Saving…`:`Save project settings`})})]})}var Nl=A([]),Pl=A([]),Fl=A([]),Il=A([]),Ll=A(null),Rl=A(!1),zl=A(null),Q=A(null),Bl=A(`plain`),Vl=A({}),Hl=A([]),Ul={"claude-code":`Claude Code`,codex:`Codex`,gemini:`Gemini`};function Wl(){try{return globalThis.sessionStorage?.getItem(`ac-workspace-host`)??`claude-code`}catch{return`claude-code`}}var Gl=A(Wl());function Kl(e){Gl.value=e;try{globalThis.sessionStorage?.setItem(`ac-workspace-host`,e)}catch{}}var ql=A([]),$=A(null),Jl=A({}),Yl=A(!1),Xl=A(null),Zl=A(``),Ql=A(!1),$l=A(!1),eu=A(null),tu=A(null),nu=A([]),ru=A(new Set),iu=`claude-code`,au=2e3;async function ou(){zl.value=null;try{let[e,t,n,r,i,a]=await Promise.all([M(`/api/v1/workspace/roles`),M(`/api/v1/workspace/sessions?limit=20`),M(`/api/v1/workspace/knowledge?limit=20`),M(`/api/v1/workspace/documents?limit=20`),M(`/api/v1/workspace/drive-health`).catch(()=>({health:{}})),M(`/api/v1/workspace/hosts`).catch(()=>({hosts:[]}))]);Nl.value=e.roles,Pl.value=t.sessions,Fl.value=n.chunks,Il.value=r.documents,Vl.value=i.health??{},Hl.value=a.hosts??[],Rl.value=!0}catch(e){zl.value=e instanceof j?e.body?.error?.message??e.message:e instanceof Error?e.message:String(e)}}async function su(e,t){try{ql.value=(await M(`/api/v1/workspace/roles/${e}/tasks`)).tasks}catch{ql.value=t}}async function cu(e){tu.value=e,ru.value=new Set;try{let t=await M(`/api/v1/workspace/sessions/${e}`);nu.value=Array.isArray(t.log)?t.log:[]}catch{nu.value=[]}}async function lu(e){Q.value=null,$l.value=!1,Zl.value=``,$.value=null,await cu(e)}async function uu(e,t,n){Q.value=null,Yl.value=!0,Zl.value=``,$l.value=!1,eu.value={role:e,task:t,inputs:n};try{let r=await M(`/api/v1/workspace/launch`,{method:`POST`,body:{role:e,task:t,inputs:n,host:Gl.value}});Xl.value=r,Q.value=mu(r),$.value=null,await cu(r.id),Pl.value=(await M(`/api/v1/workspace/sessions?limit=20`)).sessions,await fu()}catch(e){Xl.value=null,Q.value=e instanceof j?e.body?.error?.message??e.message:e instanceof Error?e.message:String(e)}finally{Yl.value=!1}}async function du(e,t){if(!(t.trim()===``||Ql.value)){Ql.value=!0,Q.value=null;try{let n=await M(`/api/v1/workspace/sessions/${e}/continue`,{method:`POST`,body:{prompt:t}});Xl.value=n,Q.value=mu(n),n.driven&&(Zl.value=``),await cu(e),Pl.value=(await M(`/api/v1/workspace/sessions?limit=20`)).sessions,await fu()}catch(e){e instanceof j&&e.status===410?($l.value=!0,Q.value=`Host session expired — start a new conversation.`):Q.value=e instanceof j?e.body?.error?.message??e.message:e instanceof Error?e.message:String(e)}finally{Ql.value=!1}}}async function fu(){try{Vl.value=(await M(`/api/v1/workspace/drive-health`)).health??{}}catch{}}async function pu(e){try{await M(`/api/v1/workspace/drive-health/${e}/reset`,{method:`POST`}),await fu()}catch{}}function mu(e){return e.driven?e.recovered===!0?`Host recovered — drove the turn for ${e.role} · ${e.task}.`:`Drove the turn for ${e.role} · ${e.task}.`:e.host_killed===!0?`Host ${iu} is paused after repeated failures — handed off to the inbox.`:e.error_kind===`render-error`?`Couldn't fill the prompt: ${e.error??`missing input`}.`:e.reason===`no-prompt-for-task`?`Recorded the session — this task has no runnable prompt yet.`:typeof e.handoff==`string`?`Prepared a hand-off — open ${e.handoff} and paste it into your host.`:`Recorded the session ${e.id} (${e.role} · ${e.task}).`}function hu({role:e}){let t=Ll.value===e.slug;return P(`button`,{type:`button`,class:`ac-workspace__role${t?` ac-workspace__role--active`:``}`,"aria-current":t?`true`:void 0,"aria-label":`Pick role ${e.display_name}`,onClick:()=>{Ll.value=e.slug,Q.value=null,Xl.value=null,$.value=null,Jl.value={},ql.value=e.first_tasks,su(e.slug,e.first_tasks)},children:[P(`span`,{class:`ac-workspace__role-name`,children:e.display_name}),P(`span`,{class:`ac-workspace__role-status`,"data-status":e.status,children:e.status}),P(`span`,{class:`ac-workspace__role-tagline`,children:e.tagline})]})}function gu({role:e,task:t}){let n=t.inputs??[],r=Jl.value,i=n.some(e=>e.required&&(r[e.name]??``).trim()===``);return P(`form`,{class:`ac-workspace__task-form`,onSubmit:n=>{n.preventDefault(),!i&&!Yl.value&&uu(e,t.name,Jl.value)},children:[n.length===0?P(`p`,{class:`ac-workspace__form-note`,children:`No inputs — runs the prompt as-is.`}):n.map(e=>P(`label`,{class:`ac-workspace__field`,children:[P(`span`,{class:`ac-workspace__field-label`,children:[e.name,e.required?P(`span`,{class:`ac-workspace__req`,"aria-hidden":`true`,children:` *`}):null]}),P(`textarea`,{class:`ac-workspace__field-input`,placeholder:e.shape,required:e.required,"aria-label":`${e.name}${e.required?` (required)`:``}`,value:r[e.name]??``,onInput:t=>{Jl.value={...Jl.value,[e.name]:t.target.value}}})]},e.name)),P(`div`,{class:`ac-workspace__form-actions`,children:[P(`button`,{type:`submit`,class:`ac-button ac-button--primary`,disabled:i||Yl.value,children:Yl.value?`Running…`:`Run task`}),P(`button`,{type:`button`,class:`ac-button`,onClick:()=>{$.value=null},children:`Cancel`})]})]})}function _u(e){let t=[];for(let n of e){let e=n.data??{};if(n.kind===`launcher.input`)e.followup===!0?t.push({kind:`user`,text:typeof e.prompt==`string`?e.prompt:``}):t.push({kind:`task`,text:typeof e.task==`string`?e.task:``});else if(n.kind===`host.turn`){let n=e.usage,r=n==null?void 0:`${typeof e.model==`string`?e.model:iu} · in ${n.input_tokens??0} / out ${n.output_tokens??0} tokens`;t.push({kind:`assistant`,text:typeof e.text==`string`?e.text:``,meta:r})}else if(n.kind===`host.error`){let n=typeof e.error_kind==`string`?e.error_kind:`error`;t.push({kind:`error`,text:`${n}: ${typeof e.error==`string`?e.error:``}`})}}return t}function vu(){if(tu.value===null)return null;let e=_u(nu.value),t=nu.value.some(e=>e.kind===`host.turn`);return P(`section`,{class:`ac-workspace__thread`,"aria-label":`Conversation thread`,children:[P(`h2`,{class:`ac-workspace__heading`,children:`Conversation`}),e.length===0?P(`p`,{class:`ac-workspace__empty`,children:`No turns yet.`}):P(`ol`,{class:`ac-workspace__thread-list`,children:e.map((e,t)=>{let n=e.kind===`assistant`&&e.text.length>au,r=ru.value.has(t),i=n&&!r?`${e.text.slice(0,au)}…`:e.text;return P(`li`,{class:`ac-workspace__thread-block ac-workspace__thread-block--${e.kind}`,children:[P(`span`,{class:`ac-workspace__thread-role`,children:e.kind===`task`?`Task`:e.kind===`user`?`You`:e.kind===`assistant`?`Host`:`Error`}),P(`pre`,{class:`ac-workspace__thread-text`,children:i}),n?P(`button`,{type:`button`,class:`ac-button`,onClick:()=>{let e=new Set(ru.value);e.has(t)?e.delete(t):e.add(t),ru.value=e},children:r?`Show less`:`Show full`}):null,e.meta==null?null:P(`p`,{class:`ac-workspace__turn-meta`,children:e.meta})]},t)})}),$l.value?P(`div`,{class:`ac-workspace__followup-gone`,role:`status`,children:[P(`p`,{children:`Host session expired.`}),eu.value===null?P(`p`,{children:`Pick a task above to start a new conversation.`}):P(`button`,{type:`button`,class:`ac-button ac-button--primary`,disabled:Yl.value,onClick:()=>{let e=eu.value;e!==null&&uu(e.role,e.task,e.inputs)},children:Yl.value?`Starting…`:`Start a new conversation`})]}):t?P(`form`,{class:`ac-workspace__followup`,onSubmit:e=>{e.preventDefault(),tu.value!==null&&du(tu.value,Zl.value)},children:[P(`label`,{class:`ac-workspace__field`,children:[P(`span`,{class:`ac-workspace__field-label`,children:`Follow up`}),P(`textarea`,{class:`ac-workspace__field-input`,placeholder:`Continue this conversation — e.g. make it shorter`,"aria-label":`Follow-up prompt`,value:Zl.value,onInput:e=>{Zl.value=e.target.value}})]}),P(`button`,{type:`submit`,class:`ac-button ac-button--primary`,disabled:Zl.value.trim()===``||Ql.value,children:Ql.value?`Continuing…`:`Send follow-up`})]}):null]})}function yu({role:e}){let t=ql.value.length>0?ql.value:e.first_tasks;return P(`section`,{class:`ac-workspace__tasks`,"aria-labelledby":`task-heading`,children:[P(`h2`,{id:`task-heading`,class:`ac-workspace__heading`,children:[`First tasks · `,e.display_name]}),t.length===0?P(`p`,{class:`ac-workspace__empty`,children:`No tasks scaffolded yet for this role.`}):P(`ul`,{class:`ac-workspace__task-list`,children:t.map(t=>P(`li`,{class:`ac-workspace__task`,children:[P(`div`,{class:`ac-workspace__task-head`,children:[P(`span`,{class:`ac-workspace__task-name`,children:t.name}),P(`button`,{type:`button`,class:`ac-button ac-button--primary`,"aria-expanded":$.value===t.name,onClick:()=>{$.value=$.value===t.name?null:t.name,Jl.value={},Xl.value=null,tu.value=null,nu.value=[]},children:$.value===t.name?`Close`:`Start session`})]}),P(`p`,{class:`ac-workspace__task-intent`,children:t.intent}),t.prompt===``?null:P(`code`,{class:`ac-workspace__task-prompt`,children:[`prompts/`,t.prompt]}),$.value===t.name?P(gu,{role:e.slug,task:t}):null]},t.name))}),e.skills.length>0?P(`details`,{class:`ac-workspace__skills`,children:[P(`summary`,{children:[`Skill shortlist (`,e.skills.length,`)`]}),P(`ul`,{class:`ac-workspace__skill-list`,children:[e.skills.slice(0,5).map(e=>P(`li`,{class:`ac-workspace__skill`,children:[P(`code`,{children:e.id}),` — `,e.why]},e.id)),e.skills.length>5?P(`li`,{class:`ac-workspace__skill-more`,children:[`+ `,e.skills.length-5,` more`]}):null]})]}):null]})}function bu(){return P(`section`,{class:`ac-workspace__sessions`,"aria-labelledby":`sessions-heading`,children:[P(`h2`,{id:`sessions-heading`,class:`ac-workspace__heading`,children:`Recent sessions`}),Pl.value.length===0?P(`p`,{class:`ac-workspace__empty`,children:`No sessions yet — pick a role and start one.`}):P(`ul`,{class:`ac-workspace__session-list`,children:Pl.value.map(e=>P(`li`,{class:`ac-workspace__session`,children:P(`button`,{type:`button`,class:`ac-workspace__session-open${tu.value===e.id?` ac-workspace__session-open--active`:``}`,"aria-label":`Open session ${e.task}`,"aria-current":tu.value===e.id?`true`:void 0,onClick:()=>{lu(e.id)},children:[P(`span`,{class:`ac-workspace__session-id`,children:e.id.slice(0,16)}),P(`span`,{class:`ac-workspace__session-role`,children:e.role}),P(`span`,{class:`ac-workspace__session-task`,children:e.task})]})},e.id))})]})}function xu(){return P(`section`,{class:`ac-workspace__knowledge`,"aria-labelledby":`knowledge-heading`,children:[P(`h2`,{id:`knowledge-heading`,class:`ac-workspace__heading`,children:`Knowledge sources`}),Fl.value.length===0?P(`p`,{class:`ac-workspace__empty`,children:[`No sources yet. Run `,P(`code`,{children:`/knowledge:ingest <path>`}),` to add documents.`]}):P(`ol`,{class:`ac-workspace__citation-list`,children:Fl.value.map((e,t)=>P(`li`,{class:`ac-workspace__citation`,children:[P(`span`,{class:`ac-workspace__citation-marker`,"aria-label":`Citation ${t+1}`,children:[`[`,t+1,`]`]}),P(`a`,{href:`file://${e.source}`,class:`ac-workspace__citation-source`,title:`Open source in OS default app`,children:e.source.split(`/`).pop()??e.source}),e.pinned?P(`span`,{class:`ac-workspace__citation-pin`,"aria-label":`pinned`,children:`★`}):null,P(`p`,{class:`ac-workspace__citation-excerpt`,children:[e.excerpt.slice(0,200),e.excerpt.length>200?`…`:``]})]},e.id))})]})}function Su(){return P(`section`,{class:`ac-workspace__recent`,"aria-labelledby":`recent-heading`,children:[P(`h2`,{id:`recent-heading`,class:`ac-workspace__heading`,children:`Recent documents`}),Il.value.length===0?P(`p`,{class:`ac-workspace__empty`,children:`No documents yet. Saved drafts land here.`}):P(`ul`,{class:`ac-workspace__doc-list`,children:Il.value.map(e=>P(`li`,{class:`ac-workspace__doc`,children:[P(`span`,{class:`ac-workspace__doc-type`,"data-type":e.type,children:e.type}),P(`span`,{class:`ac-workspace__doc-title`,children:e.title}),P(`time`,{class:`ac-workspace__doc-time`,dateTime:e.updated_at,children:e.updated_at.slice(0,10)})]},`${e.type}/${e.slug}`))})]})}function Cu(){let e=Object.values(Vl.value).filter(e=>e.killed||e.consecutive_failures>0);return P(`section`,{class:`ac-workspace__drive-health`,"aria-labelledby":`drive-health-heading`,children:[P(`h2`,{id:`drive-health-heading`,class:`ac-workspace__heading`,children:`Host health`}),e.length===0?P(`p`,{class:`ac-workspace__empty`,children:`All hosts healthy.`}):P(`ul`,{class:`ac-workspace__health-list`,children:Object.entries(Vl.value).filter(([,e])=>e.killed||e.consecutive_failures>0).map(([e,t])=>{let n=t.killed?t.kill_reason===`manual`?`paused (manual)`:`paused — auto-recovering`:`degraded`;return P(`li`,{class:`ac-workspace__health`,"data-killed":t.killed?`true`:`false`,children:[P(`span`,{class:`ac-workspace__health-host`,children:e}),P(`span`,{class:`ac-workspace__health-state`,children:n}),P(`span`,{class:`ac-workspace__health-meta`,children:[t.consecutive_failures,` fail streak`,t.last_error_kind==null?``:` · ${t.last_error_kind}`]}),t.killed?P(`button`,{type:`button`,class:`ac-button ac-workspace__health-reset`,"aria-label":`Reset ${e}`,onClick:()=>{pu(e)},children:`Reset`}):null]},e)})})]})}function wu(){let e=Bl.value;return P(`fieldset`,{class:`ac-workspace__explain`,children:[P(`legend`,{class:`ac-workspace__heading`,children:`Explanation style`}),P(`label`,{class:`ac-workspace__explain-option`,children:[P(`input`,{type:`radio`,name:`explain-mode`,value:`plain`,checked:e===`plain`,onChange:()=>{Bl.value=`plain`},"aria-label":`Plain language`}),P(`span`,{children:`Plain language`})]}),P(`label`,{class:`ac-workspace__explain-option`,children:[P(`input`,{type:`radio`,name:`explain-mode`,value:`technical`,checked:e===`technical`,onChange:()=>{Bl.value=`technical`},"aria-label":`Technical detail`}),P(`span`,{children:`Technical detail`})]}),P(`p`,{class:`ac-workspace__explain-hint`,children:e===`plain`?`Replies use everyday words. Toggle to see the technical view.`:`Replies keep the technical vocabulary. Toggle for the plain view.`})]})}function Tu(){let e=Hl.value,t=e.length>0?e.map(e=>e.id):Object.keys(Ul),n=new Map(e.map(e=>[e.id,e.cli_present]));return P(`label`,{class:`ac-workspace__host-picker`,children:[P(`span`,{class:`ac-workspace__host-label`,children:`Host`}),P(`select`,{class:`ac-workspace__host-select`,"aria-label":`Host agent`,value:Gl.value,onChange:e=>{Kl(e.target.value)},children:t.map(e=>{let t=n.get(e)!==!1,r=Ul[e]??e;return P(`option`,{value:e,disabled:!t,children:[r,` (`,e,`)`,t?``:` — not installed`]},e)})})]})}function Eu(){if(D(()=>{ou()},[]),zl.value!==null)return P(`div`,{class:`ac-page ac-page--error`,children:[P(`h1`,{children:`Workspace`}),P(`p`,{class:`ac-banner ac-banner--error`,children:zl.value})]});if(!Rl.value)return P(`div`,{class:`ac-page`,children:[P(`h1`,{children:`Workspace`}),P(`p`,{children:`Loading…`})]});let e=Ll.value===null?null:Nl.value.find(e=>e.slug===Ll.value)??null;return P(`div`,{class:`ac-page ac-workspace`,children:[P(`header`,{class:`ac-page__header`,children:[P(`h1`,{children:`Workspace`}),P(`p`,{class:`ac-page__subtitle`,children:`Pick a role, pick a first task, run it.`}),P(Tu,{})]}),Q.value===null?null:P(`p`,{class:`ac-banner`,role:`status`,children:Q.value}),P(`div`,{class:`ac-workspace__grid`,children:[P(`section`,{class:`ac-workspace__roles`,"aria-labelledby":`roles-heading`,children:[P(`h2`,{id:`roles-heading`,class:`ac-workspace__heading`,children:`Roles`}),Nl.value.length===0?P(`p`,{class:`ac-workspace__empty`,children:`No roles installed.`}):P(`div`,{class:`ac-workspace__role-grid`,children:Nl.value.map(e=>P(hu,{role:e},e.slug))})]}),P(`main`,{class:`ac-workspace__main`,"aria-label":`Tasks and sessions`,children:[e===null?P(`p`,{class:`ac-workspace__empty`,children:`Pick a role on the left to see its first tasks.`}):P(yu,{role:e}),P(vu,{}),P(bu,{})]}),P(`aside`,{class:`ac-workspace__rail`,"aria-label":`Knowledge and documents`,children:[P(xu,{}),P(Su,{}),P(Cu,{}),P(wu,{})]})]})]})}var Du=`agent-config-theme`;function Ou(){return(typeof document<`u`?document.documentElement.getAttribute(`data-theme`):null)===`dark`?`dark`:`light`}var ku=A(Ou());function Au(){try{let e=localStorage.getItem(Du);return e===`light`||e===`dark`?e:null}catch{return null}}function ju(){if(typeof window>`u`)return null;try{let e=new URLSearchParams(window.location.search).get(`theme`);return e===`light`||e===`dark`?e:null}catch{return null}}function Mu(){return Au()===null&&ju()===null}function Nu(e){ku.value=e,document.documentElement.setAttribute(`data-theme`,e)}function Pu(){let e=ku.value===`dark`?`light`:`dark`;try{localStorage.setItem(Du,e)}catch{}Nu(e)}function Fu(){if(typeof window>`u`||typeof window.matchMedia!=`function`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);typeof e.addEventListener==`function`&&e.addEventListener(`change`,()=>{Mu()&&Nu(e.matches?`dark`:`light`)})}function Iu(){return typeof window>`u`?!1:new URLSearchParams(window.location.search).get(`embed`)===`1`}var Lu=Iu(),Ru=[{id:`setup`,label:`Setup`,hashPath:`/setup`,matches:[`/setup`,`/wizard`]},{id:`settings`,label:`Settings`,hashPath:`/settings`,matches:[`/settings`]},{id:`project`,label:`Project`,hashPath:`/project`,matches:[`/project`]},{id:`workspace`,label:`Workspace`,hashPath:`/workspace`,matches:[`/workspace`]}];function zu(e){for(let t of Ru)for(let n of t.matches)if(e===n||e.startsWith(`${n}/`))return t.id;return null}function Bu(e){let t=Mt.value,n=zu(e);return Ru.filter(e=>e.id===`project`?t?.projectSurface===!0||n===`project`:e.id!==`workspace`||t?.devSurfaces===!0||n===`workspace`)}function Vu(){let e=Tt.value,t=zu(e);return P(`header`,{class:`ac-topnav`,children:P(`div`,{class:`ac-topnav__inner`,children:[P(`div`,{class:`ac-topnav__brand`,children:[P(`h1`,{class:`ac-topnav__title`,children:`@event4u/agent-config`}),P(`p`,{class:`ac-topnav__subtitle`,children:`Browser Wizard`})]}),P(`nav`,{class:`ac-topnav__tabs`,"aria-label":`Surfaces`,children:Bu(e).map(e=>P(`button`,{type:`button`,class:`ac-topnav__tab${t===e.id?` ac-topnav__tab--active`:``}`,"aria-current":t===e.id?`page`:void 0,onClick:()=>Et(e.hashPath),children:e.label},e.id))}),P(`button`,{type:`button`,class:`ac-topnav__theme`,"aria-label":ku.value===`dark`?`Switch to light theme`:`Switch to dark theme`,title:ku.value===`dark`?`Switch to light theme`:`Switch to dark theme`,onClick:()=>{Pu()},children:ku.value===`dark`?`☀`:`☾`})]})})}function Hu({path:e}){return P(`div`,{class:`ac-page ac-page--error`,children:[P(`h1`,{children:`Page not found`}),P(`p`,{children:[`Nothing routed to `,P(`code`,{children:e}),`. Try `,P(`a`,{href:`#/setup`,children:`Setup`}),`.`]})]})}function Uu(){let e=Mt.value;return e===null||e.dryRun!==!0?null:P(`div`,{class:`ac-dryrun-banner`,role:`status`,"aria-live":`polite`,children:[P(`strong`,{children:`DRY RUN`}),P(`span`,{children:` · no files will be written. Validation + rendering run normally; commits return a preview.`})]})}function Wu(e){return e===`/`||e===`/setup`||e.startsWith(`/setup/`)||e.startsWith(`/wizard`)?P(Cc,{path:e}):e===`/settings/changes`?P(Zc,{}):e===`/settings`||e.startsWith(`/settings/`)?P(Tl,{}):e===`/project`||e.startsWith(`/project/`)?P(Ml,{}):e===`/workspace`?P(Eu,{}):P(Hu,{path:e})}function Gu(){return D(()=>{Ot(),Tt.value===`/`&&Et(`/setup`),Nt()},[]),P(b,{children:[P(Uu,{}),Lu?null:P(Vu,{}),Wu(Tt.value)]})}var Ku=3e4,qu=18e5,Ju=null,Yu=!1;function Xu(e){if(!Yu&&(Yu=!0,typeof navigator<`u`&&typeof navigator.sendBeacon==`function`))try{navigator.sendBeacon(`/api/v1/shutdown?token=${encodeURIComponent(e)}`)}catch{}}function Zu(e){if(typeof window>`u`)return()=>{};let t=Date.now(),n=()=>{t=Date.now()},r=[`pointerdown`,`keydown`,`wheel`,`touchstart`];for(let e of r)window.addEventListener(e,n,{passive:!0});let i=()=>{document.hidden||n()};document.addEventListener(`visibilitychange`,i);let a=()=>{Ju!==null&&clearInterval(Ju),Ju=null;for(let e of r)window.removeEventListener(e,n);document.removeEventListener(`visibilitychange`,i),window.removeEventListener(`pagehide`,o)};Ju=setInterval(()=>{if(!document.hidden){if(Date.now()-t>qu){Xu(e),a();return}M(`/api/v1/ping`).catch(()=>{})}},Ku);function o(){Xu(e)}return window.addEventListener(`pagehide`,o),a}function Qu(){if(typeof window>`u`||typeof window.history?.replaceState!=`function`)return;let e=new URLSearchParams(window.location.search);if(!e.has(`token`))return;e.delete(`token`);let t=e.toString(),n=window.location.pathname+(t?`?${t}`:``)+window.location.hash;window.history.replaceState(window.history.state,``,n)}function $u(){return new URLSearchParams(window.location.search).get(`token`)}function ed(){let e=document.getElementById(`app`);if(e===null)return;let t=$u();if(t===null){e.textContent="agent-config UI · missing token — re-open via `agent-config ui:serve`.";return}At(t),Qu(),Zu(t),Fu(),e.textContent=``,be(P(Gu,{}),e)}ed();
23
- //# sourceMappingURL=index-C3djEJah.js.map