@event4u/agent-config 9.8.0 → 9.10.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 (1115) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +234 -295
  3. package/CONTRIBUTING.md +23 -7
  4. package/MIGRATION.md +20 -0
  5. package/README.md +55 -9
  6. package/dist/agent-src/commands/agent-status.md +12 -11
  7. package/dist/agent-src/commands/agents/audit.md +1 -1
  8. package/dist/agent-src/commands/agents/optimize.md +2 -2
  9. package/dist/agent-src/commands/agents/user/accept.md +115 -30
  10. package/dist/agent-src/commands/agents/user/delete.md +147 -0
  11. package/dist/agent-src/commands/agents/user/review.md +65 -28
  12. package/dist/agent-src/commands/agents/user/show.md +82 -29
  13. package/dist/agent-src/commands/agents/user/update.md +2 -2
  14. package/dist/agent-src/commands/agents/user.md +17 -4
  15. package/dist/agent-src/commands/agents.md +1 -1
  16. package/dist/agent-src/commands/check-current-md.md +3 -13
  17. package/dist/agent-src/commands/condense.md +28 -97
  18. package/dist/agent-src/commands/cost/report.md +7 -0
  19. package/dist/agent-src/commands/fix/portability.md +2 -10
  20. package/dist/agent-src/commands/fix/pr-comments-loop.md +136 -0
  21. package/dist/agent-src/commands/fix/refs.md +2 -10
  22. package/dist/agent-src/commands/fix/route.md +4 -3
  23. package/dist/agent-src/commands/fix.md +9 -6
  24. package/dist/agent-src/commands/ghostwriter.md +1 -1
  25. package/dist/agent-src/commands/humanize.md +2 -2
  26. package/dist/agent-src/commands/image.md +1 -1
  27. package/dist/agent-src/commands/jira-ticket.md +1 -1
  28. package/dist/agent-src/commands/memory/load.md +11 -0
  29. package/dist/agent-src/commands/optimize/augmentignore.md +1 -1
  30. package/dist/agent-src/commands/optimize/skills.md +3 -3
  31. package/dist/agent-src/commands/post-as.md +1 -1
  32. package/dist/agent-src/commands/pr/create.md +4 -4
  33. package/dist/agent-src/commands/profile/show.md +3 -3
  34. package/dist/agent-src/commands/research.md +1 -1
  35. package/dist/agent-src/commands/roadmap/ai-council.md +1 -1
  36. package/dist/agent-src/commands/rule-compliance-audit.md +5 -4
  37. package/dist/agent-src/commands/sync/gitignore/fix.md +1 -1
  38. package/dist/agent-src/commands/tdd.md +21 -0
  39. package/dist/agent-src/commands/team/delegate.md +4 -0
  40. package/dist/agent-src/commands/team-knowledge/bootstrap.md +9 -8
  41. package/dist/agent-src/commands/team-knowledge/consolidate.md +8 -7
  42. package/dist/agent-src/commands/team.md +4 -1
  43. package/dist/agent-src/commands/upstream-contribute.md +0 -1
  44. package/dist/agent-src/commands/video.md +1 -1
  45. package/dist/agent-src/contexts/authority/commit-mechanics.md +7 -0
  46. package/dist/agent-src/contexts/authority/destructive-mechanics.md +16 -0
  47. package/dist/agent-src/contexts/authority/kernel-rule-edits.md +1 -1
  48. package/dist/agent-src/contexts/authority/scope-mechanics.md +61 -0
  49. package/dist/agent-src/contexts/communication/rules-auto/reply-close-mechanics.md +20 -18
  50. package/dist/agent-src/contexts/communication/rules-auto/skill-quality-mechanics.md +1 -1
  51. package/dist/agent-src/contexts/communication/rules-auto/slash-command-routing-policy-mechanics.md +1 -1
  52. package/dist/agent-src/contexts/communication/rules-auto/source-of-truth-mechanics.md +9 -10
  53. package/dist/agent-src/contexts/communication/rules-auto/think-before-action-mechanics.md +1 -1
  54. package/dist/agent-src/contexts/communication/rules-auto/user-interaction-mechanics.md +11 -0
  55. package/dist/agent-src/contexts/contracts/artifact-engagement-flow.md +26 -15
  56. package/dist/agent-src/contexts/contracts/command-suggestion-flow.md +3 -0
  57. package/dist/agent-src/contexts/contracts/emergency-triage-block.md +2 -2
  58. package/dist/agent-src/contexts/execution/auto-dispatch-classification.md +99 -23
  59. package/dist/agent-src/contexts/execution/auto-orchestration-activation.md +1 -1
  60. package/dist/agent-src/contexts/execution/autonomy-examples.md +1 -1
  61. package/dist/agent-src/contexts/execution/autonomy-mechanics.md +7 -6
  62. package/dist/agent-src/contexts/execution/evidence-discipline.md +92 -77
  63. package/dist/agent-src/contexts/execution/orchestration-benchmark-gate.md +22 -21
  64. package/dist/agent-src/contexts/execution/orchestration-telemetry.md +34 -0
  65. package/dist/agent-src/contexts/execution/project-intelligence.md +122 -103
  66. package/dist/agent-src/contexts/execution/roadmap-execution-contract.md +23 -21
  67. package/dist/agent-src/contexts/execution/subagent-modes-detail.md +109 -8
  68. package/dist/agent-src/contexts/execution/subagent-response-contract.md +20 -0
  69. package/dist/agent-src/contexts/execution/subagent-routing.md +11 -0
  70. package/dist/agent-src/contexts/execution/subagent-spawn-contract.md +53 -3
  71. package/dist/agent-src/contexts/execution/subagent-steering.md +36 -34
  72. package/dist/agent-src/contexts/execution/toolchain-resolver.md +1 -1
  73. package/dist/agent-src/contexts/execution/user-memory-channels.md +189 -0
  74. package/dist/agent-src/contexts/execution/verification-mechanics.md +9 -0
  75. package/dist/agent-src/contexts/model-recommendations.md +3 -2
  76. package/dist/agent-src/contexts/subagent-configuration.md +3 -3
  77. package/dist/agent-src/ghostwriter/README.md +2 -2
  78. package/dist/agent-src/packs/README.md +1 -1
  79. package/dist/agent-src/personas/README.md +5 -5
  80. package/dist/agent-src/personas/_template-specialist/persona.md +3 -3
  81. package/dist/agent-src/personas/backend-architect.md +24 -23
  82. package/dist/agent-src/personas/eloquent-tamer.md +30 -30
  83. package/dist/agent-src/personas/frontend-engineer.md +30 -30
  84. package/dist/agent-src/personas/product-owner.md +41 -38
  85. package/dist/agent-src/personas/qa.md +13 -13
  86. package/dist/agent-src/personas/security-engineer.md +22 -22
  87. package/dist/agent-src/presets/README.md +3 -3
  88. package/dist/agent-src/profiles/README.md +3 -3
  89. package/dist/agent-src/rules/active-remediation.md +2 -2
  90. package/dist/agent-src/rules/artifact-engagement-recording.md +4 -4
  91. package/dist/agent-src/rules/ask-when-uncertain.md +0 -4
  92. package/dist/agent-src/rules/augment-edit-discipline.md +1 -1
  93. package/dist/agent-src/rules/broken-access-control.md +4 -4
  94. package/dist/agent-src/rules/code-comment-discipline.md +1 -1
  95. package/dist/agent-src/rules/code-provenance.md +112 -0
  96. package/dist/agent-src/rules/commit-policy.md +4 -9
  97. package/dist/agent-src/rules/communication-through-line.md +5 -5
  98. package/dist/agent-src/rules/decision-revisit-gate.md +1 -1
  99. package/dist/agent-src/rules/doc-screenshot-hygiene.md +1 -1
  100. package/dist/agent-src/rules/domain-adoption-policy.md +1 -1
  101. package/dist/agent-src/rules/domain-safety-pii.md +1 -1
  102. package/dist/agent-src/rules/external-code-graph-interop.md +5 -5
  103. package/dist/agent-src/rules/fast-path-marker-visibility.md +43 -7
  104. package/dist/agent-src/rules/finance-safety-floor.md +1 -1
  105. package/dist/agent-src/rules/framework-neutrality-in-generic-skills.md +3 -3
  106. package/dist/agent-src/rules/history-discipline.md +80 -0
  107. package/dist/agent-src/rules/legal-safety-floor.md +1 -1
  108. package/dist/agent-src/rules/lethal-trifecta-guard.md +5 -5
  109. package/dist/agent-src/rules/low-impact-corpus-privacy-floor.md +10 -8
  110. package/dist/agent-src/rules/media-governance-routing.md +13 -13
  111. package/dist/agent-src/rules/media-sync-ground-truth.md +29 -11
  112. package/dist/agent-src/rules/no-cheap-questions.md +7 -7
  113. package/dist/agent-src/rules/no-decorative-emojis-in-git-surfaces.md +29 -18
  114. package/dist/agent-src/rules/no-roadmap-references.md +1 -1
  115. package/dist/agent-src/rules/non-destructive-by-default.md +5 -23
  116. package/dist/agent-src/rules/onboarding-gate.md +14 -4
  117. package/dist/agent-src/rules/persona-governance.md +2 -2
  118. package/dist/agent-src/rules/php-coding.md +1 -0
  119. package/dist/agent-src/rules/prefer-enums-over-literals.md +9 -9
  120. package/dist/agent-src/rules/preservation-guard.md +10 -2
  121. package/dist/agent-src/rules/question-not-instruction.md +1 -1
  122. package/dist/agent-src/rules/reviewer-awareness.md +1 -0
  123. package/dist/agent-src/rules/roadmap-ci-steps-policy.md +1 -0
  124. package/dist/agent-src/rules/roadmap-progress-sync.md +7 -0
  125. package/dist/agent-src/rules/rule-type-governance.md +1 -1
  126. package/dist/agent-src/rules/scale-discipline.md +92 -0
  127. package/dist/agent-src/rules/scope-control.md +1 -1
  128. package/dist/agent-src/rules/secret-vcs-guard.md +1 -1
  129. package/dist/agent-src/rules/security-sensitive-stop.md +24 -8
  130. package/dist/agent-src/rules/senior-engineering-discipline.md +17 -17
  131. package/dist/agent-src/rules/session-canary.md +77 -0
  132. package/dist/agent-src/rules/skill-quality.md +1 -1
  133. package/dist/agent-src/rules/source-confidentiality.md +21 -19
  134. package/dist/agent-src/rules/source-of-truth.md +6 -5
  135. package/dist/agent-src/rules/spreadsheet-source-quality.md +2 -2
  136. package/dist/agent-src/rules/strategy-safety-floor.md +1 -1
  137. package/dist/agent-src/rules/think-before-action.md +5 -5
  138. package/dist/agent-src/rules/token-budget-discipline.md +5 -3
  139. package/dist/agent-src/rules/token-efficiency.md +2 -2
  140. package/dist/agent-src/rules/token-optimizer-maintenance.md +1 -1
  141. package/dist/agent-src/rules/tool-safety.md +3 -1
  142. package/dist/agent-src/rules/untrusted-input-defense.md +10 -0
  143. package/dist/agent-src/rules/user-interaction.md +12 -0
  144. package/dist/agent-src/rules/verify-before-complete.md +4 -24
  145. package/dist/agent-src/skills/adversarial-review/SKILL.md +2 -2
  146. package/dist/agent-src/skills/agent-security-review/SKILL.md +53 -46
  147. package/dist/agent-src/skills/agents-md-thin-root/SKILL.md +2 -2
  148. package/dist/agent-src/skills/ai-code-blindspots/SKILL.md +20 -20
  149. package/dist/agent-src/skills/ai-council/SKILL.md +185 -128
  150. package/dist/agent-src/skills/analysis-skill-router/SKILL.md +3 -3
  151. package/dist/agent-src/skills/api-endpoint/SKILL.md +2 -2
  152. package/dist/agent-src/skills/artisan-commands/SKILL.md +2 -2
  153. package/dist/agent-src/skills/async-python-patterns/SKILL.md +8 -7
  154. package/dist/agent-src/skills/authz-review/SKILL.md +16 -15
  155. package/dist/agent-src/skills/aws-infrastructure/SKILL.md +5 -5
  156. package/dist/agent-src/skills/blade-ui/SKILL.md +1 -1
  157. package/dist/agent-src/skills/bug-analyzer/SKILL.md +30 -12
  158. package/dist/agent-src/skills/code-intelligence/SKILL.md +17 -15
  159. package/dist/agent-src/skills/code-intelligence/evals/triggers.json +52 -0
  160. package/dist/agent-src/skills/code-review/SKILL.md +6 -6
  161. package/dist/agent-src/skills/command-routing/SKILL.md +5 -4
  162. package/dist/agent-src/skills/composer-packages/SKILL.md +2 -2
  163. package/dist/agent-src/skills/condense-memory/SKILL.md +43 -41
  164. package/dist/agent-src/skills/context-document/SKILL.md +23 -21
  165. package/dist/agent-src/skills/copilot-config/SKILL.md +6 -1
  166. package/dist/agent-src/skills/corpus-grounding/SKILL.md +0 -3
  167. package/dist/agent-src/skills/decision-record/SKILL.md +20 -18
  168. package/dist/agent-src/skills/description-assist/SKILL.md +1 -1
  169. package/dist/agent-src/skills/design-intelligence/SKILL.md +4 -4
  170. package/dist/agent-src/skills/design-review/SKILL.md +20 -20
  171. package/dist/agent-src/skills/design-system-capture/reference/design-system-json.md +28 -25
  172. package/dist/agent-src/skills/design-tokens/SKILL.md +0 -1
  173. package/dist/agent-src/skills/devcontainer/SKILL.md +2 -2
  174. package/dist/agent-src/skills/docker/SKILL.md +1 -1
  175. package/dist/agent-src/skills/docx-authoring/evals/triggers.json +52 -0
  176. package/dist/agent-src/skills/emit-tickets/SKILL.md +2 -2
  177. package/dist/agent-src/skills/error-handling-patterns/SKILL.md +1 -1
  178. package/dist/agent-src/skills/estimate-ticket/SKILL.md +2 -2
  179. package/dist/agent-src/skills/evaluate-llm-feature/SKILL.md +0 -1
  180. package/dist/agent-src/skills/evaluate-llm-feature/evals/triggers.json +52 -0
  181. package/dist/agent-src/skills/existing-ui-audit/SKILL.md +6 -5
  182. package/dist/agent-src/skills/feature-planning/SKILL.md +2 -2
  183. package/dist/agent-src/skills/finishing-a-development-branch/SKILL.md +3 -3
  184. package/dist/agent-src/skills/flux/SKILL.md +1 -1
  185. package/dist/agent-src/skills/frontend-render-security/SKILL.md +13 -13
  186. package/dist/agent-src/skills/git-workflow/SKILL.md +33 -33
  187. package/dist/agent-src/skills/grafana/SKILL.md +5 -0
  188. package/dist/agent-src/skills/history-design/SKILL.md +101 -0
  189. package/dist/agent-src/skills/history-design/evals/triggers.json +17 -0
  190. package/dist/agent-src/skills/humanizer/SKILL.md +84 -67
  191. package/dist/agent-src/skills/humanizer/data/patterns.md +14 -14
  192. package/dist/agent-src/skills/humanizer/references/anti-aiisms.md +4 -4
  193. package/dist/agent-src/skills/image-editing/SKILL.md +1 -1
  194. package/dist/agent-src/skills/image-generation/SKILL.md +2 -1
  195. package/dist/agent-src/skills/image-provider-routing/SKILL.md +2 -2
  196. package/dist/agent-src/skills/judge-artifact-completeness/SKILL.md +82 -37
  197. package/dist/agent-src/skills/judge-bug-hunter/SKILL.md +17 -5
  198. package/dist/agent-src/skills/judge-injection-defense/SKILL.md +63 -25
  199. package/dist/agent-src/skills/judge-security-auditor/SKILL.md +2 -0
  200. package/dist/agent-src/skills/judge-synthesis/SKILL.md +72 -28
  201. package/dist/agent-src/skills/laravel-horizon/SKILL.md +5 -0
  202. package/dist/agent-src/skills/laravel-mail/SKILL.md +5 -4
  203. package/dist/agent-src/skills/laravel-middleware/SKILL.md +5 -4
  204. package/dist/agent-src/skills/laravel-notifications/SKILL.md +10 -9
  205. package/dist/agent-src/skills/laravel-pennant/SKILL.md +1 -1
  206. package/dist/agent-src/skills/laravel-pulse/SKILL.md +9 -8
  207. package/dist/agent-src/skills/laravel-reverb/SKILL.md +6 -5
  208. package/dist/agent-src/skills/laravel-scheduling/SKILL.md +6 -1
  209. package/dist/agent-src/skills/laravel-validation/SKILL.md +12 -0
  210. package/dist/agent-src/skills/launch-readiness/SKILL.md +2 -2
  211. package/dist/agent-src/skills/learning-to-rule-or-skill/SKILL.md +7 -7
  212. package/dist/agent-src/skills/learning-tutor/SKILL.md +44 -43
  213. package/dist/agent-src/skills/learning-tutor/evals/triggers.json +52 -0
  214. package/dist/agent-src/skills/license-compliance-audit/SKILL.md +161 -0
  215. package/dist/agent-src/skills/license-compliance-audit/evals/triggers.json +52 -0
  216. package/dist/agent-src/skills/license-compliance-borrow-check/SKILL.md +145 -0
  217. package/dist/agent-src/skills/license-compliance-borrow-check/evals/triggers.json +52 -0
  218. package/dist/agent-src/skills/license-compliance-credits/SKILL.md +97 -0
  219. package/dist/agent-src/skills/license-compliance-credits/evals/triggers.json +52 -0
  220. package/dist/agent-src/skills/llm-provider-knowledge/SKILL.md +0 -1
  221. package/dist/agent-src/skills/md-language-check/SKILL.md +1 -1
  222. package/dist/agent-src/skills/memory-consolidation/SKILL.md +69 -64
  223. package/dist/agent-src/skills/motion-choreographer/SKILL.md +6 -6
  224. package/dist/agent-src/skills/override-management/SKILL.md +1 -1
  225. package/dist/agent-src/skills/pdf-tools/evals/triggers.json +52 -0
  226. package/dist/agent-src/skills/performance-analysis/SKILL.md +7 -3
  227. package/dist/agent-src/skills/persona-improvement/SKILL.md +0 -2
  228. package/dist/agent-src/skills/persona-improvement/evals/triggers.json +52 -0
  229. package/dist/agent-src/skills/php-coder/SKILL.md +10 -0
  230. package/dist/agent-src/skills/prediction-pool-optimizer/SKILL.md +136 -127
  231. package/dist/agent-src/skills/prediction-pool-optimizer/reference/ev-fixtures.md +36 -35
  232. package/dist/agent-src/skills/prediction-pool-optimizer/reference/odds-and-bonus.md +45 -41
  233. package/dist/agent-src/skills/project-analysis-core/SKILL.md +5 -5
  234. package/dist/agent-src/skills/project-analysis-hypothesis-driven/SKILL.md +3 -3
  235. package/dist/agent-src/skills/project-analysis-react/SKILL.md +1 -1
  236. package/dist/agent-src/skills/project-analysis-symfony/SKILL.md +1 -1
  237. package/dist/agent-src/skills/project-analysis-zend-laminas/SKILL.md +2 -2
  238. package/dist/agent-src/skills/prompt-engineering-image/SKILL.md +3 -2
  239. package/dist/agent-src/skills/prompt-engineering-patterns/SKILL.md +1 -1
  240. package/dist/agent-src/skills/prompt-validator/SKILL.md +39 -39
  241. package/dist/agent-src/skills/quality-tools/SKILL.md +15 -15
  242. package/dist/agent-src/skills/react-shadcn-ui/SKILL.md +57 -21
  243. package/dist/agent-src/skills/react-shadcn-ui/reference/registry.md +29 -27
  244. package/dist/agent-src/skills/readme-writing-package/SKILL.md +2 -2
  245. package/dist/agent-src/skills/reasoning-orchestrator/SKILL.md +25 -25
  246. package/dist/agent-src/skills/recursive-verification/SKILL.md +7 -0
  247. package/dist/agent-src/skills/refine-prompt/SKILL.md +1 -1
  248. package/dist/agent-src/skills/refine-ticket/SKILL.md +23 -5
  249. package/dist/agent-src/skills/repomix-packer/SKILL.md +1 -1
  250. package/dist/agent-src/skills/requesting-code-review/SKILL.md +2 -2
  251. package/dist/agent-src/skills/roadmap-management/SKILL.md +80 -66
  252. package/dist/agent-src/skills/roadmap-writing/SKILL.md +84 -73
  253. package/dist/agent-src/skills/rtk-output-filtering/SKILL.md +31 -12
  254. package/dist/agent-src/skills/rule-refactor/SKILL.md +4 -4
  255. package/dist/agent-src/skills/schema-review/SKILL.md +92 -0
  256. package/dist/agent-src/skills/schema-review/evals/triggers.json +17 -0
  257. package/dist/agent-src/skills/screenshot-hygiene/evals/triggers.json +52 -0
  258. package/dist/agent-src/skills/secrets-management/SKILL.md +3 -4
  259. package/dist/agent-src/skills/security-audit/SKILL.md +27 -10
  260. package/dist/agent-src/skills/security-maturity-assessment/SKILL.md +39 -17
  261. package/dist/agent-src/skills/skill-improvement-pipeline/SKILL.md +17 -14
  262. package/dist/agent-src/skills/skill-writing/SKILL.md +11 -10
  263. package/dist/agent-src/skills/song-to-script/SKILL.md +93 -85
  264. package/dist/agent-src/skills/source-discovery/SKILL.md +5 -5
  265. package/dist/agent-src/skills/sql-writing/SKILL.md +2 -2
  266. package/dist/agent-src/skills/stakeholder-tradeoff/SKILL.md +4 -3
  267. package/dist/agent-src/skills/standards-from-config/SKILL.md +61 -43
  268. package/dist/agent-src/skills/subagent-orchestration/SKILL.md +60 -86
  269. package/dist/agent-src/skills/subagent-orchestration/prompts/README.md +33 -6
  270. package/dist/agent-src/skills/supply-chain-intake/SKILL.md +13 -13
  271. package/dist/agent-src/skills/systematic-debugging/SKILL.md +24 -23
  272. package/dist/agent-src/skills/tailwind-engineer/SKILL.md +3 -4
  273. package/dist/agent-src/skills/technical-specification/SKILL.md +5 -0
  274. package/dist/agent-src/skills/terraform/SKILL.md +2 -2
  275. package/dist/agent-src/skills/terragrunt/SKILL.md +8 -8
  276. package/dist/agent-src/skills/testing-anti-patterns/process-anti-patterns.md +1 -1
  277. package/dist/agent-src/skills/threat-modeling/SKILL.md +19 -13
  278. package/dist/agent-src/skills/token-optimizer/SKILL.md +4 -4
  279. package/dist/agent-src/skills/universal-project-analysis/SKILL.md +1 -1
  280. package/dist/agent-src/skills/upstream-contribute/SKILL.md +0 -1
  281. package/dist/agent-src/skills/using-git-worktrees/SKILL.md +9 -9
  282. package/dist/agent-src/skills/validate-feature-fit/SKILL.md +3 -1
  283. package/dist/agent-src/skills/verify-completion-evidence/SKILL.md +4 -6
  284. package/dist/agent-src/skills/verify-repair-loop/SKILL.md +67 -61
  285. package/dist/agent-src/skills/video-director/SKILL.md +7 -7
  286. package/dist/agent-src/skills/worktree-lifecycle/SKILL.md +5 -6
  287. package/dist/agent-src/templates/AGENTS.md +1 -1
  288. package/dist/agent-src/templates/agents/.gitattributes.fragment +25 -6
  289. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  290. package/dist/agent-src/templates/command.md +3 -3
  291. package/dist/agent-src/templates/contexts/knowledge-pages.md +47 -45
  292. package/dist/agent-src/templates/contexts/lesson-card.md +2 -2
  293. package/dist/agent-src/templates/contexts/tenant-boundaries.md +2 -2
  294. package/dist/agent-src/templates/contexts.md +1 -1
  295. package/dist/agent-src/templates/features.md +1 -1
  296. package/dist/agent-src/templates/persona.md +2 -2
  297. package/dist/agent-src/templates/roadmaps.md +125 -116
  298. package/dist/agent-src/templates/rule.md +4 -3
  299. package/dist/agent-src/templates/scripts/pr_risk_review.ts +0 -0
  300. package/dist/agent-src/templates/scripts/telemetry/aggregator.ts +0 -0
  301. package/dist/agent-src/templates/scripts/telemetry/engagement.ts +77 -0
  302. package/dist/agent-src/templates/scripts/telemetry_record.ts +33 -1
  303. package/dist/agent-src/templates/scripts/tier_usage_report.ts +2 -2
  304. package/dist/agent-src/templates/scripts/work_engine/directives/ui/polish.ts +2 -2
  305. package/dist/agent-src/templates/scripts/work_engine/directives/ui/review.ts +1 -1
  306. package/dist/agent-src/user-types/README.md +8 -8
  307. package/dist/agent-src/user-types/galabau-field-crew.md +34 -33
  308. package/dist/agent-src/user-types/metalworking-shop.md +35 -34
  309. package/dist/agent-src/user-types/truck-driver.md +22 -20
  310. package/dist/cli/commands/doctorShell.js +20 -0
  311. package/dist/cli/commands/doctorShell.js.map +1 -1
  312. package/dist/cli/commands/rtkDetect.js +58 -0
  313. package/dist/cli/commands/rtkDetect.js.map +1 -0
  314. package/dist/cli/firstRunNotice.js +70 -0
  315. package/dist/cli/firstRunNotice.js.map +1 -0
  316. package/dist/cli/main.js +35 -3
  317. package/dist/cli/main.js.map +1 -1
  318. package/dist/cli/python/workspace_roles.js +2 -2
  319. package/dist/cli/python/workspace_roles.js.map +1 -1
  320. package/dist/cli/registry.js +7 -1
  321. package/dist/cli/registry.js.map +1 -1
  322. package/dist/discovery/deprecation-report.md +1 -1
  323. package/dist/discovery/discovery-manifest.json +429 -119
  324. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  325. package/dist/discovery/discovery-manifest.summary.md +6 -4
  326. package/dist/discovery/orphan-report.md +1 -1
  327. package/dist/discovery/packs.json +91 -8
  328. package/dist/discovery/trust-report.md +11 -11
  329. package/dist/discovery/workspaces.json +32 -7
  330. package/dist/hooks/dispatch.js +19649 -0
  331. package/dist/install/agentSwitchDetection.js +75 -0
  332. package/dist/install/agentSwitchDetection.js.map +1 -0
  333. package/dist/install/agentSwitchProfile.js +117 -0
  334. package/dist/install/agentSwitchProfile.js.map +1 -0
  335. package/dist/install/atomic.js +1 -1
  336. package/dist/install/detect.js +1 -1
  337. package/dist/install/install.mjs +783 -486
  338. package/dist/install/rtkDetection.js +213 -0
  339. package/dist/install/rtkDetection.js.map +1 -0
  340. package/dist/install/rule_scope.js +2 -1
  341. package/dist/install/rule_scope.js.map +1 -1
  342. package/dist/install/types.js +2 -2
  343. package/dist/install/wizard-plan.js +1 -1
  344. package/dist/install/wizardDismissals.js +58 -0
  345. package/dist/install/wizardDismissals.js.map +1 -0
  346. package/dist/mcp/awesome-mcp-servers.row.md +1 -1
  347. package/dist/mcp/mcp-cloudflare-catalogue.json +1 -1
  348. package/dist/mcp/registry-manifest.json +15 -4
  349. package/dist/mcp/server.json +20 -0
  350. package/dist/mcp/server.mjs +44634 -0
  351. package/dist/router.json +1 -1
  352. package/dist/scripts/_lib/compile_time_toggles.js +48 -0
  353. package/dist/scripts/_lib/compile_time_toggles.js.map +1 -0
  354. package/dist/scripts/condense.js +248 -224
  355. package/dist/scripts/condense.js.map +1 -1
  356. package/dist/server/app.js +4 -2
  357. package/dist/server/app.js.map +1 -1
  358. package/dist/server/io/sharedWriteCheck.js +101 -0
  359. package/dist/server/io/sharedWriteCheck.js.map +1 -0
  360. package/dist/server/routes/ping.js +14 -0
  361. package/dist/server/routes/ping.js.map +1 -1
  362. package/dist/server/routes/settings.js +21 -4
  363. package/dist/server/routes/settings.js.map +1 -1
  364. package/dist/server/routes/userMd.js +21 -4
  365. package/dist/server/routes/userMd.js.map +1 -1
  366. package/dist/server/routes/wizard.js +68 -25
  367. package/dist/server/routes/wizard.js.map +1 -1
  368. package/dist/server/schemas/settings.js +8 -2
  369. package/dist/server/schemas/settings.js.map +1 -1
  370. package/dist/shared/userMd/utils.js +30 -0
  371. package/dist/shared/userMd/utils.js.map +1 -1
  372. package/dist/ui/assets/index-BpSQt5vm.js +40 -0
  373. package/dist/ui/assets/index-BpSQt5vm.js.map +1 -0
  374. package/dist/ui/assets/index-jSfMW8_t.css +1 -0
  375. package/dist/ui/index.html +2 -2
  376. package/docs/MIGRATION.md +16 -0
  377. package/docs/guidelines/agent-infra/api-cost-levers.md +56 -5
  378. package/docs/guidelines/agent-infra/simplicity-and-goal-demos.md +93 -33
  379. package/docs/guidelines/component-oriented-and-oop-development.md +4 -2
  380. package/package.json +21 -11
  381. package/src/agent-src/templates/AGENTS.md +1 -1
  382. package/src/agent-src/templates/scripts/pr_risk_review.ts +0 -0
  383. package/src/agent-src/templates/scripts/telemetry/aggregator.ts +0 -0
  384. package/src/agent-src/templates/scripts/telemetry/engagement.ts +77 -0
  385. package/src/agent-src/templates/scripts/telemetry_record.ts +33 -1
  386. package/src/agent-src/templates/scripts/tier_usage_report.ts +2 -2
  387. package/src/agent-src/templates/scripts/work_engine/directives/ui/polish.ts +2 -2
  388. package/src/agent-src/templates/scripts/work_engine/directives/ui/review.ts +1 -1
  389. package/src/config/agent-settings.template.yml +84 -16
  390. package/src/config/ci-local-parity.yml +142 -0
  391. package/src/config/discovery/packs.yml +22 -0
  392. package/src/config/discovery/workspaces.yml +1 -1
  393. package/src/config/evaluator-budgets.json +47 -0
  394. package/src/config/gate-coverage.yml +127 -0
  395. package/src/config/hook-latency-budget.json +20 -0
  396. package/src/config/preamble-payload-budget.json +44 -0
  397. package/src/install/agentSwitchDetection.ts +90 -0
  398. package/src/install/agentSwitchProfile.ts +131 -0
  399. package/src/install/atomic.ts +1 -1
  400. package/src/install/detect.ts +1 -1
  401. package/src/install/rtkDetection.ts +274 -0
  402. package/src/install/rule_scope.ts +9 -2
  403. package/src/install/types.ts +2 -2
  404. package/src/install/wizard-plan.ts +1 -1
  405. package/src/install/wizardDismissals.ts +60 -0
  406. package/src/scripts/_cli/cmd_doctor.ts +139 -2
  407. package/src/scripts/_cli/cmd_memory_get.ts +197 -0
  408. package/src/scripts/_cli/cmd_refresh.ts +30 -0
  409. package/src/scripts/_dispatch.bash +81 -0
  410. package/src/scripts/_lib/agent_user_profile.ts +381 -0
  411. package/src/scripts/_lib/agents_overlay.ts +9 -0
  412. package/src/scripts/_lib/anchor_eval.ts +311 -0
  413. package/src/scripts/_lib/auto_dispatch.corpus.test.ts +64 -1
  414. package/src/scripts/_lib/auto_dispatch.ts +76 -0
  415. package/src/scripts/_lib/cc_transcript.ts +316 -0
  416. package/src/scripts/_lib/compile_time_toggles.ts +79 -0
  417. package/src/scripts/_lib/confusables.ts +101 -0
  418. package/src/scripts/_lib/detect_target_license.ts +714 -0
  419. package/src/scripts/_lib/duplicate_scope_census.ts +77 -0
  420. package/src/scripts/_lib/fixtures/secret-detector/negatives.txt +5 -0
  421. package/src/scripts/_lib/fixtures/secret-detector/positives.txt +4 -0
  422. package/src/scripts/_lib/install_drift.ts +194 -0
  423. package/src/scripts/_lib/managed_agents_folder.ts +181 -0
  424. package/src/scripts/_lib/memory_fts_index.ts +390 -0
  425. package/src/scripts/_lib/orchestration_record.ts +91 -2
  426. package/src/scripts/_lib/payload_hash_drift.ts +126 -0
  427. package/src/scripts/_lib/persistence/adapter_raw_sql.ts +443 -0
  428. package/src/scripts/_lib/persistence/detect_audit_coverage.ts +423 -0
  429. package/src/scripts/_lib/persistence/detect_bounded_reads.ts +154 -0
  430. package/src/scripts/_lib/persistence/detect_index_parity.ts +576 -0
  431. package/src/scripts/_lib/persistence/detect_n1_eloquent.ts +226 -0
  432. package/src/scripts/_lib/persistence/detect_offload.ts +441 -0
  433. package/src/scripts/_lib/persistence/detect_prisma_growth.ts +74 -0
  434. package/src/scripts/_lib/persistence/offload_catalog.ts +73 -0
  435. package/src/scripts/_lib/persistence/types.ts +109 -0
  436. package/src/scripts/_lib/preservation_migration.ts +291 -0
  437. package/src/scripts/_lib/retrieval_sanitize.ts +166 -2
  438. package/src/scripts/_lib/rtk_allowlist.ts +44 -0
  439. package/src/scripts/_lib/scan_scope.ts +115 -0
  440. package/src/scripts/_lib/secret_detector.test.ts +5 -0
  441. package/src/scripts/_lib/secret_detector.ts +9 -0
  442. package/src/scripts/_lib/secret_detector_adversarial.test.ts +116 -0
  443. package/src/scripts/_lib/spawn_env.ts +7 -0
  444. package/src/scripts/_lib/sqlite_guard.ts +191 -0
  445. package/src/scripts/_lib/subagent_spawn.ts +53 -0
  446. package/src/scripts/_lib/user_global_memory_audit.ts +187 -0
  447. package/src/scripts/_lib/user_global_observations.ts +830 -0
  448. package/src/scripts/_lib/user_global_revocations.ts +110 -0
  449. package/src/scripts/_lib/user_memory_gate_counters.ts +291 -0
  450. package/src/scripts/_lib/worker_budget.ts +107 -0
  451. package/src/scripts/ai_council/blind_review.ts +212 -0
  452. package/src/scripts/ai_council/budget_guard.ts +90 -11
  453. package/src/scripts/ai_council/bundler.ts +2 -2
  454. package/src/scripts/ai_council/clients.ts +59 -3
  455. package/src/scripts/ai_council/config.ts +50 -6
  456. package/src/scripts/ai_council/orchestrator.ts +127 -12
  457. package/src/scripts/ai_team/review_gate.ts +8 -10
  458. package/src/scripts/ai_team/team_dispatch.ts +65 -6
  459. package/src/scripts/anchor_eval_falsify.ts +198 -0
  460. package/src/scripts/anchor_scoring_run.ts +239 -0
  461. package/src/scripts/annotate_discovery.ts +1 -65
  462. package/src/scripts/audit_initial_context.ts +1 -1
  463. package/src/scripts/bench_cross_source_eval.ts +400 -0
  464. package/src/scripts/bench_honesty_score.ts +1093 -0
  465. package/src/scripts/bench_hook_latency.ts +218 -0
  466. package/src/scripts/bench_quality_run.ts +168 -4
  467. package/src/scripts/build_mcp_catalog.ts +275 -0
  468. package/src/scripts/build_mcp_registry_manifest.ts +46 -0
  469. package/src/scripts/build_proof.ts +45 -0
  470. package/src/scripts/cache_realization_report.ts +782 -0
  471. package/src/scripts/chat_history.ts +8 -5
  472. package/src/scripts/check_artefact_count_messaging.ts +5 -1
  473. package/src/scripts/check_augment_description_cap.ts +15 -4
  474. package/src/scripts/check_backstop_debt.ts +23 -13
  475. package/src/scripts/check_bundle_path_leakage.ts +343 -0
  476. package/src/scripts/check_ci_local_parity.ts +317 -0
  477. package/src/scripts/check_condensation.ts +96 -191
  478. package/src/scripts/check_context_paths.ts +38 -9
  479. package/src/scripts/check_evaluator_budgets.ts +99 -0
  480. package/src/scripts/check_gate_coverage.ts +299 -0
  481. package/src/scripts/check_iron_law_prominence.ts +22 -1
  482. package/src/scripts/check_kernel_prefix_stability.ts +0 -0
  483. package/src/scripts/check_knowledge_sharing.ts +12 -1
  484. package/src/scripts/check_no_external_sources.ts +2 -2
  485. package/src/scripts/check_no_new_legacy_path.ts +16 -6
  486. package/src/scripts/check_no_roadmap_refs.ts +22 -9
  487. package/src/scripts/check_originality_freshness.ts +167 -0
  488. package/src/scripts/check_preamble_payload_budget.ts +130 -0
  489. package/src/scripts/check_proposal.ts +0 -0
  490. package/src/scripts/check_references.ts +0 -1
  491. package/src/scripts/check_safety_floor_untouched.ts +171 -24
  492. package/src/scripts/check_site_links.ts +62 -3
  493. package/src/scripts/check_source_pointer_freshness.ts +28 -3
  494. package/src/scripts/ci_status.ts +0 -0
  495. package/src/scripts/cluster_near_miss_patterns.ts +0 -0
  496. package/src/scripts/code_graph/build.ts +0 -0
  497. package/src/scripts/code_graph/cli.ts +181 -9
  498. package/src/scripts/code_graph/detect.ts +52 -0
  499. package/src/scripts/code_graph/intent.ts +45 -0
  500. package/src/scripts/code_graph/query.ts +143 -29
  501. package/src/scripts/code_graph/sqlite_store.ts +174 -0
  502. package/src/scripts/command_suggester/types.ts +0 -0
  503. package/src/scripts/compile_router.ts +10 -14
  504. package/src/scripts/condense.sh +3 -4
  505. package/src/scripts/condense.ts +261 -234
  506. package/src/scripts/context_hygiene_hook.ts +8 -5
  507. package/src/scripts/cost/track.mjs +168 -33
  508. package/src/scripts/cost_summary.ts +33 -1
  509. package/src/scripts/council_cli.ts +171 -15
  510. package/src/scripts/detect_target_license.ts +203 -0
  511. package/src/scripts/discovery_graph.ts +0 -0
  512. package/src/scripts/encoding_corpus.ts +500 -0
  513. package/src/scripts/encoding_corpus_report.ts +216 -0
  514. package/src/scripts/evaluator_umbrella.sh +145 -0
  515. package/src/scripts/external_sources_denylist.json +5 -3
  516. package/src/scripts/first_run_gate_hook.ts +9 -5
  517. package/src/scripts/generate_index.ts +19 -2
  518. package/src/scripts/hermetic-install.sh +3 -3
  519. package/src/scripts/hook_manifest.yaml +55 -16
  520. package/src/scripts/hooks/block_kernel_rule_writes.ts +212 -0
  521. package/src/scripts/hooks/block_no_verify.ts +9 -9
  522. package/src/scripts/hooks/code_graph_nudge_hook.ts +11 -4
  523. package/src/scripts/hooks/concern_registry.ts +75 -0
  524. package/src/scripts/hooks/design_slop_hook.ts +8 -5
  525. package/src/scripts/hooks/dispatch_entry.ts +37 -0
  526. package/src/scripts/hooks/dispatch_hook.ts +176 -3
  527. package/src/scripts/hooks/hook_stdin.ts +42 -0
  528. package/src/scripts/hooks/rtk_wrap_hook.ts +26 -12
  529. package/src/scripts/hot_context_hook.ts +7 -6
  530. package/src/scripts/injection_scan_hook.ts +9 -1
  531. package/src/scripts/install +6 -6
  532. package/src/scripts/install-hooks.sh +6 -6
  533. package/src/scripts/install.sh +5 -4
  534. package/src/scripts/install.ts +264 -23
  535. package/src/scripts/learning_sidecar.ts +0 -0
  536. package/src/scripts/lint_budget_ownership.ts +89 -0
  537. package/src/scripts/lint_command_routing.ts +35 -5
  538. package/src/scripts/lint_command_verbs.ts +42 -9
  539. package/src/scripts/lint_confusables.ts +10 -72
  540. package/src/scripts/lint_consumer_internal_refs.ts +211 -0
  541. package/src/scripts/lint_discovery_vocabulary.ts +2 -0
  542. package/src/scripts/lint_documented_commands.ts +670 -0
  543. package/src/scripts/lint_featured_skills.ts +0 -0
  544. package/src/scripts/lint_framework_leakage.ts +17 -3
  545. package/src/scripts/lint_framework_leakage_allowlist.json +32 -0
  546. package/src/scripts/lint_governed_writes.ts +335 -0
  547. package/src/scripts/lint_hidden_unicode.ts +214 -0
  548. package/src/scripts/lint_load_context.ts +17 -5
  549. package/src/scripts/lint_mcp_registry_manifest.ts +26 -1
  550. package/src/scripts/lint_memory_tripwire.ts +186 -0
  551. package/src/scripts/lint_new_skill_gate.ts +9 -3
  552. package/src/scripts/lint_no_python_twin_rationale.ts +17 -2
  553. package/src/scripts/lint_originality.ts +1 -1
  554. package/src/scripts/lint_override_kernel_guard.ts +74 -26
  555. package/src/scripts/lint_persistence.ts +171 -0
  556. package/src/scripts/lint_pre_migration_refs.ts +106 -0
  557. package/src/scripts/lint_provenance.ts +547 -0
  558. package/src/scripts/lint_provenance_vocabulary.ts +437 -0
  559. package/src/scripts/lint_skill_originality.ts +1 -1
  560. package/src/scripts/lint_spawn_payload.ts +283 -0
  561. package/src/scripts/lint_store_boundary.ts +152 -0
  562. package/src/scripts/lint_ticket_buildable.ts +1 -1
  563. package/src/scripts/lint_versioned_cache.ts +7 -1
  564. package/src/scripts/mcp_server/__main__.ts +7 -2
  565. package/src/scripts/mcp_server/catalog.ts +23 -1
  566. package/src/scripts/mcp_server/consumer_tool_catalog.json +563 -193
  567. package/src/scripts/mcp_server/prompts.ts +6 -0
  568. package/src/scripts/mcp_server/tool_catalog_source.ts +332 -0
  569. package/src/scripts/mcp_server/tools.ts +57 -6
  570. package/src/scripts/mcp_telemetry_query.ts +2 -33
  571. package/src/scripts/mcp_telemetry_store.ts +64 -34
  572. package/src/scripts/measure_scope_dedup.ts +224 -0
  573. package/src/scripts/memory_learn_hook.ts +126 -0
  574. package/src/scripts/memory_lookup.ts +0 -0
  575. package/src/scripts/memory_replay_24.ts +312 -0
  576. package/src/scripts/memory_report.ts +16 -3
  577. package/src/scripts/memory_signal.ts +48 -0
  578. package/src/scripts/memory_status.ts +6 -0
  579. package/src/scripts/mine_session.ts +98 -0
  580. package/src/scripts/minimal_safe_diff_hook.ts +8 -5
  581. package/src/scripts/onboarding_gate_hook.ts +8 -5
  582. package/src/scripts/orchestration_payload_hash_drift.ts +145 -0
  583. package/src/scripts/orchestration_record.ts +16 -0
  584. package/src/scripts/pr_url_reminder_hook.ts +8 -1
  585. package/src/scripts/preamble_byte_census.ts +574 -0
  586. package/src/scripts/prepack-check.mjs +17 -0
  587. package/src/scripts/prepack_lifecycle_check.d.mts +8 -0
  588. package/src/scripts/prepack_lifecycle_check.mjs +82 -0
  589. package/src/scripts/probe_skill_registration.ts +2 -2
  590. package/src/scripts/profile_staleness_hook.ts +8 -7
  591. package/src/scripts/redact_hook_capture.ts +13 -0
  592. package/src/scripts/release.ts +65 -10
  593. package/src/scripts/report_install_drift.ts +109 -0
  594. package/src/scripts/roadmap_progress_hook.ts +8 -5
  595. package/src/scripts/router_telemetry.ts +1 -1
  596. package/src/scripts/schemas/license-policy.schema.json +89 -0
  597. package/src/scripts/schemas/provenance-borrow.schema.json +46 -0
  598. package/src/scripts/schemas/rule.schema.json +10 -0
  599. package/src/scripts/second_brain_retrieval.ts +14 -4
  600. package/src/scripts/self_review_gate.test.ts +173 -1
  601. package/src/scripts/self_review_gate.ts +155 -15
  602. package/src/scripts/session_canary_hook.ts +182 -0
  603. package/src/scripts/skill_linter.ts +5 -0
  604. package/src/scripts/smoke_quickstart.ts +2 -2
  605. package/src/scripts/surface-tiers.yml +2 -0
  606. package/src/scripts/surface_probe_hook.ts +8 -7
  607. package/src/scripts/sync_gitattributes.ts +310 -0
  608. package/src/scripts/team_review_gate_hook.ts +13 -16
  609. package/src/scripts/validate_pack_yaml.ts +0 -0
  610. package/src/scripts/verify_before_complete_hook.ts +8 -5
  611. package/src/scripts/wrapper_freshness_hook.ts +8 -7
  612. package/src/server/schemas/settings.ts +16 -2
  613. package/src/shared/userMd/utils.ts +31 -0
  614. package/dist/agent-src/rules/telegraph-speak.md +0 -87
  615. package/dist/ui/assets/index-BPFMZWUs.css +0 -1
  616. package/dist/ui/assets/index-CrmZ34Rg.js +0 -40
  617. package/dist/ui/assets/index-CrmZ34Rg.js.map +0 -1
  618. package/docs/CLAIMS.md +0 -286
  619. package/docs/DISTRIBUTION_CHECKLIST.md +0 -170
  620. package/docs/RELEASE_STORY_TEMPLATE.md +0 -37
  621. package/docs/SKILL_CENSUS.md +0 -352
  622. package/docs/adrs/cost/0001-hard-stop-hook.md +0 -114
  623. package/docs/adrs/cost/README.md +0 -9
  624. package/docs/adrs/memory/0001-consumer-side-snapshot.md +0 -119
  625. package/docs/adrs/memory/README.md +0 -10
  626. package/docs/adrs/router/0001-three-tier-routing.md +0 -119
  627. package/docs/adrs/router/README.md +0 -9
  628. package/docs/adrs/schema/0001-json-schema-frontmatter.md +0 -102
  629. package/docs/adrs/schema/README.md +0 -9
  630. package/docs/adrs/smoke/0001-per-tier-smoke-scripts.md +0 -99
  631. package/docs/adrs/smoke/README.md +0 -9
  632. package/docs/adrs/telegraph/0001-default-off-until-bench.md +0 -93
  633. package/docs/adrs/telegraph/README.md +0 -9
  634. package/docs/announcements/2026-05-non-dev-launch.md +0 -79
  635. package/docs/announcements/2026-07-honest-cost-sweep-launch.md +0 -84
  636. package/docs/anti-reskin-gate.md +0 -60
  637. package/docs/architecture/augment-projection.md +0 -70
  638. package/docs/architecture/claude-bundle.md +0 -77
  639. package/docs/architecture/current-onboard-baseline.md +0 -126
  640. package/docs/architecture/current-safety-behavior.md +0 -137
  641. package/docs/architecture/multi-tool-projection.md +0 -125
  642. package/docs/architecture/setup-vs-settings-shared-surface.md +0 -114
  643. package/docs/architecture/source-projection.md +0 -85
  644. package/docs/architecture.md +0 -390
  645. package/docs/archive/CHANGELOG-6.0.0-overview.md +0 -953
  646. package/docs/archive/CHANGELOG-7.0.0.md +0 -419
  647. package/docs/archive/CHANGELOG-pre-2.11.0.md +0 -141
  648. package/docs/archive/CHANGELOG-pre-2.15.0.md +0 -244
  649. package/docs/archive/CHANGELOG-pre-2.16.0.md +0 -48
  650. package/docs/archive/CHANGELOG-pre-2.17.0.md +0 -63
  651. package/docs/archive/CHANGELOG-pre-2.2.0.md +0 -2138
  652. package/docs/archive/CHANGELOG-pre-2.20.0.md +0 -159
  653. package/docs/archive/CHANGELOG-pre-2.25.0.md +0 -191
  654. package/docs/archive/CHANGELOG-pre-2.7.0.md +0 -185
  655. package/docs/archive/CHANGELOG-pre-3.0.0.md +0 -130
  656. package/docs/archive/CHANGELOG-pre-3.1.0.md +0 -167
  657. package/docs/archive/CHANGELOG-pre-3.2.0.md +0 -268
  658. package/docs/archive/CHANGELOG-pre-4.0.0.md +0 -80
  659. package/docs/archive/CHANGELOG-pre-4.5.0.md +0 -289
  660. package/docs/archive/CHANGELOG-pre-5.4.0.md +0 -260
  661. package/docs/archive/CHANGELOG-pre-5.9.0.md +0 -270
  662. package/docs/archive/CHANGELOG-pre-6.0.0.md +0 -473
  663. package/docs/archive/CHANGELOG-pre-7.0.0.md +0 -126
  664. package/docs/archive/CHANGELOG-pre-8.0.0.md +0 -301
  665. package/docs/archive/CHANGELOG-pre-8.1.0.md +0 -316
  666. package/docs/archive/CHANGELOG-pre-8.12.0.md +0 -304
  667. package/docs/archive/CHANGELOG-pre-8.9.0.md +0 -306
  668. package/docs/archive/CHANGELOG-pre-9.2.0.md +0 -276
  669. package/docs/artefact-census.md +0 -71
  670. package/docs/benchmark.md +0 -785
  671. package/docs/benchmark.pinned.yml +0 -31
  672. package/docs/benchmarks.md +0 -85
  673. package/docs/capability-matrix.md +0 -33
  674. package/docs/case-studies/_template.md +0 -60
  675. package/docs/case-studies/frontend-design-positioning.md +0 -86
  676. package/docs/catalog.md +0 -726
  677. package/docs/command-flows.md +0 -272
  678. package/docs/command-naming-audit.md +0 -60
  679. package/docs/comparison.yaml +0 -87
  680. package/docs/contracts/CHANGELOG-conventions.md +0 -149
  681. package/docs/contracts/STABILITY.md +0 -188
  682. package/docs/contracts/adoption-signal-floor.md +0 -127
  683. package/docs/contracts/adr-architectural-consensus-mechanism.md +0 -68
  684. package/docs/contracts/adr-chat-history-split.md +0 -140
  685. package/docs/contracts/adr-command-suggestion.md +0 -144
  686. package/docs/contracts/adr-forecast-construction-shape.md +0 -90
  687. package/docs/contracts/adr-gtm-context-spine.md +0 -116
  688. package/docs/contracts/adr-implement-ticket-runtime.md +0 -121
  689. package/docs/contracts/adr-install-user-type-axis.md +0 -107
  690. package/docs/contracts/adr-layout.md +0 -107
  691. package/docs/contracts/adr-level-6-productization.md +0 -145
  692. package/docs/contracts/adr-mcp-runtime.md +0 -128
  693. package/docs/contracts/adr-product-ui-track.md +0 -381
  694. package/docs/contracts/adr-prompt-driven-execution.md +0 -186
  695. package/docs/contracts/adr-settings-sync-engine.md +0 -128
  696. package/docs/contracts/adr-user-types-axis.md +0 -127
  697. package/docs/contracts/adr-wing4-context-spine.md +0 -126
  698. package/docs/contracts/agent-user-schema.md +0 -170
  699. package/docs/contracts/agents-layout.md +0 -148
  700. package/docs/contracts/agents-md-tech-stack.md +0 -75
  701. package/docs/contracts/ai-council-config.md +0 -829
  702. package/docs/contracts/ai-team-config.md +0 -224
  703. package/docs/contracts/analysis-memory-loop.md +0 -149
  704. package/docs/contracts/at-rest-encryption.md +0 -191
  705. package/docs/contracts/audit-log-v1.md +0 -150
  706. package/docs/contracts/auto-orchestration-v1.md +0 -70
  707. package/docs/contracts/benchmark-ab-contract.md +0 -106
  708. package/docs/contracts/benchmark-corpus-spec.md +0 -125
  709. package/docs/contracts/benchmark-report-schema.md +0 -113
  710. package/docs/contracts/branch-protection-policy.md +0 -139
  711. package/docs/contracts/brand-token-consumption.md +0 -74
  712. package/docs/contracts/capability-boundary.md +0 -69
  713. package/docs/contracts/capability-packs.md +0 -217
  714. package/docs/contracts/ci-cost-budget.md +0 -111
  715. package/docs/contracts/ci-green-floor.md +0 -141
  716. package/docs/contracts/command-category-governance.md +0 -84
  717. package/docs/contracts/command-clusters.md +0 -399
  718. package/docs/contracts/command-surface-tiers.md +0 -176
  719. package/docs/contracts/command-taxonomy.md +0 -137
  720. package/docs/contracts/condensation-default-kill-criterion.md +0 -116
  721. package/docs/contracts/config-presets.md +0 -144
  722. package/docs/contracts/conformance.md +0 -84
  723. package/docs/contracts/consumer-bridge.md +0 -73
  724. package/docs/contracts/context-paths.md +0 -101
  725. package/docs/contracts/context-spine.md +0 -179
  726. package/docs/contracts/cost-dashboard.md +0 -143
  727. package/docs/contracts/cost-enforcement.md +0 -134
  728. package/docs/contracts/cost-profile-defaults.md +0 -110
  729. package/docs/contracts/cost-summary-schema.md +0 -107
  730. package/docs/contracts/creative-pack-boundary.md +0 -63
  731. package/docs/contracts/cross-repo-retrieval.md +0 -64
  732. package/docs/contracts/cross-wing-handoff.md +0 -134
  733. package/docs/contracts/daily-workspace.md +0 -147
  734. package/docs/contracts/decision-engine-gates.md +0 -120
  735. package/docs/contracts/decision-trace-v1.md +0 -177
  736. package/docs/contracts/design-artifact-lifecycle.md +0 -93
  737. package/docs/contracts/design-artifact-verification.md +0 -153
  738. package/docs/contracts/discovery-manifest.md +0 -209
  739. package/docs/contracts/discovery-manifest.schema.json +0 -254
  740. package/docs/contracts/evidence-based-pruning.md +0 -102
  741. package/docs/contracts/explain-modes.md +0 -187
  742. package/docs/contracts/explain-trace.schema.json +0 -144
  743. package/docs/contracts/file-ownership-matrix.json +0 -13941
  744. package/docs/contracts/file-ownership-matrix.md +0 -135
  745. package/docs/contracts/frontmatter-contract.md +0 -140
  746. package/docs/contracts/ghostwriter-schema.md +0 -337
  747. package/docs/contracts/governance-enforcement-projection.md +0 -159
  748. package/docs/contracts/gui-wizard.md +0 -350
  749. package/docs/contracts/harness-expectations.md +0 -128
  750. package/docs/contracts/hook-architecture-v1.md +0 -325
  751. package/docs/contracts/host-agent-protocol.md +0 -110
  752. package/docs/contracts/implement-ticket-flow.md +0 -625
  753. package/docs/contracts/init-telemetry.md +0 -132
  754. package/docs/contracts/injected-block-authenticity-model.md +0 -66
  755. package/docs/contracts/install-layout.md +0 -249
  756. package/docs/contracts/install-scopes.md +0 -82
  757. package/docs/contracts/installed-tools-lockfile.md +0 -144
  758. package/docs/contracts/installer-agent-mode.md +0 -137
  759. package/docs/contracts/iron-law-overrides.txt +0 -26
  760. package/docs/contracts/kernel-membership.md +0 -339
  761. package/docs/contracts/linear-ai-rules-inclusion.md +0 -143
  762. package/docs/contracts/linear-ai-three-layers.md +0 -130
  763. package/docs/contracts/linter-structural-model.md +0 -181
  764. package/docs/contracts/load-context-budget-model.md +0 -259
  765. package/docs/contracts/load-context-schema.md +0 -220
  766. package/docs/contracts/local-analytics.md +0 -160
  767. package/docs/contracts/local-knowledge-ingestion.md +0 -96
  768. package/docs/contracts/local-server-api.md +0 -134
  769. package/docs/contracts/local-server-ports.md +0 -53
  770. package/docs/contracts/low-impact-corpus-format.md +0 -95
  771. package/docs/contracts/mcp-beta-criteria.md +0 -130
  772. package/docs/contracts/mcp-cloud-scope.md +0 -355
  773. package/docs/contracts/mcp-discovery-phase-notice.md +0 -60
  774. package/docs/contracts/mcp-phase-1-scope.md +0 -272
  775. package/docs/contracts/mcp-registry-manifest.schema.json +0 -129
  776. package/docs/contracts/mcp-tool-inventory.md +0 -64
  777. package/docs/contracts/mcp-tool-stub-envelope.md +0 -78
  778. package/docs/contracts/measurement-baseline.md +0 -103
  779. package/docs/contracts/memory-visibility-v1.md +0 -160
  780. package/docs/contracts/mental-models.md +0 -336
  781. package/docs/contracts/migrate-command.md +0 -233
  782. package/docs/contracts/multi-tool-projection-fidelity.md +0 -134
  783. package/docs/contracts/namespace.md +0 -125
  784. package/docs/contracts/no-runtime-boundary.md +0 -61
  785. package/docs/contracts/one-off-script-lifecycle.md +0 -110
  786. package/docs/contracts/orchestration-dsl-v1.md +0 -153
  787. package/docs/contracts/package-self-orientation.md +0 -163
  788. package/docs/contracts/pilot/agent-authority.md +0 -24
  789. package/docs/contracts/pilot/direct-answers.md +0 -70
  790. package/docs/contracts/pilot/language-and-tone.md +0 -63
  791. package/docs/contracts/plain-language-surface.md +0 -117
  792. package/docs/contracts/prelaunch-diagnostics.md +0 -151
  793. package/docs/contracts/profile-system.md +0 -167
  794. package/docs/contracts/reasoning-discipline-protocol.md +0 -83
  795. package/docs/contracts/release-pr-gating.md +0 -151
  796. package/docs/contracts/release-sizing.md +0 -107
  797. package/docs/contracts/release-trunk-sync.md +0 -105
  798. package/docs/contracts/review-lens-schema.md +0 -64
  799. package/docs/contracts/roadmap-complexity-standard.md +0 -138
  800. package/docs/contracts/role-experience.md +0 -125
  801. package/docs/contracts/router-blending.md +0 -71
  802. package/docs/contracts/rule-classification.md +0 -171
  803. package/docs/contracts/rule-interactions.md +0 -132
  804. package/docs/contracts/rule-interactions.yml +0 -260
  805. package/docs/contracts/rule-priority-hierarchy.md +0 -88
  806. package/docs/contracts/rule-router.md +0 -287
  807. package/docs/contracts/safety-model.md +0 -129
  808. package/docs/contracts/session-profile-overlay.md +0 -157
  809. package/docs/contracts/settings-api.md +0 -264
  810. package/docs/contracts/settings-gui-agent-mode.schema.json +0 -128
  811. package/docs/contracts/settings-sync-yaml-subset.md +0 -139
  812. package/docs/contracts/skill-bundled-assets.md +0 -62
  813. package/docs/contracts/skill-discovery.md +0 -80
  814. package/docs/contracts/skill-distribution-channels.md +0 -66
  815. package/docs/contracts/skill-domains.md +0 -144
  816. package/docs/contracts/skill-dry-run.md +0 -47
  817. package/docs/contracts/skill-family-map.yml +0 -915
  818. package/docs/contracts/smoke-contracts.md +0 -144
  819. package/docs/contracts/subagent-boundary.md +0 -74
  820. package/docs/contracts/surface-agent-contracts.md +0 -153
  821. package/docs/contracts/surface-matrix.md +0 -108
  822. package/docs/contracts/surface-tiers.md +0 -81
  823. package/docs/contracts/telegraph-telemetry.md +0 -83
  824. package/docs/contracts/ticket-bundle-format.md +0 -233
  825. package/docs/contracts/tier-3-contrib-plugin.md +0 -137
  826. package/docs/contracts/trust-and-safety.md +0 -144
  827. package/docs/contracts/ui-stack-extension.md +0 -237
  828. package/docs/contracts/ui-track-flow.md +0 -329
  829. package/docs/contracts/universal-skills.md +0 -91
  830. package/docs/contracts/user-type-schema.md +0 -146
  831. package/docs/contracts/value-dashboard-spec.md +0 -378
  832. package/docs/contracts/value-report-schema.md +0 -168
  833. package/docs/contracts/workflow-packs.md +0 -121
  834. package/docs/contracts/workspace-boundary.md +0 -84
  835. package/docs/contracts/workspace-documents.md +0 -144
  836. package/docs/contracts/write-engine.md +0 -182
  837. package/docs/cookbook.md +0 -152
  838. package/docs/customization.md +0 -696
  839. package/docs/decisions/ADR-001-kernel-swap-deferred.md +0 -109
  840. package/docs/decisions/ADR-002-kernel-bucket-overrides.md +0 -135
  841. package/docs/decisions/ADR-003-flat-cluster-subs-and-colon-syntax.md +0 -137
  842. package/docs/decisions/ADR-004-rule-governance-pruning.md +0 -240
  843. package/docs/decisions/ADR-005-subagent-worktrees.md +0 -120
  844. package/docs/decisions/ADR-006-skill-tools-python-pilot.md +0 -114
  845. package/docs/decisions/ADR-007-agent-discovery-scopes.md +0 -371
  846. package/docs/decisions/ADR-008-installed-tools-manifest.md +0 -160
  847. package/docs/decisions/ADR-009-event4u-namespace.md +0 -188
  848. package/docs/decisions/ADR-010-profile-pack-preset-boundary.md +0 -168
  849. package/docs/decisions/ADR-011-domain-pack-readiness.md +0 -213
  850. package/docs/decisions/ADR-012-typescript-cli-shell.md +0 -162
  851. package/docs/decisions/ADR-013-discovery-frontmatter-contract.md +0 -342
  852. package/docs/decisions/ADR-014-gui-framework-choice.md +0 -136
  853. package/docs/decisions/ADR-015-discovery-manifest-contract.md +0 -146
  854. package/docs/decisions/ADR-016-installer-architecture.md +0 -191
  855. package/docs/decisions/ADR-017-monorepo-physical-layout.md +0 -261
  856. package/docs/decisions/ADR-018-trust-and-safety-layer.md +0 -159
  857. package/docs/decisions/ADR-019-router-json-dist-location.md +0 -124
  858. package/docs/decisions/ADR-020-global-only-consumer-scope.md +0 -213
  859. package/docs/decisions/ADR-021-deployment-shape.md +0 -153
  860. package/docs/decisions/ADR-022-daily-workspace-decomposition.md +0 -140
  861. package/docs/decisions/ADR-023-host-agent-protocol.md +0 -129
  862. package/docs/decisions/ADR-024-workspace-v0-feature-floor.md +0 -126
  863. package/docs/decisions/ADR-025-workspace-chrome.md +0 -119
  864. package/docs/decisions/ADR-026-explain-mode-translation.md +0 -117
  865. package/docs/decisions/ADR-027-changelog-machine-vs-manual.md +0 -129
  866. package/docs/decisions/ADR-028-root-layout.md +0 -147
  867. package/docs/decisions/ADR-029-multi-workspace-deferred.md +0 -122
  868. package/docs/decisions/ADR-030-claude-code-command-projection.md +0 -147
  869. package/docs/decisions/ADR-031-validation-severity-tiers-and-projection-roundtrip.md +0 -97
  870. package/docs/decisions/ADR-032-linked-projects-scope.md +0 -122
  871. package/docs/decisions/ADR-033-distribution-identity-npm-primary.md +0 -81
  872. package/docs/decisions/ADR-034-per-skill-model-recommendation-transport.md +0 -63
  873. package/docs/decisions/ADR-035-model-capability-tiers.md +0 -104
  874. package/docs/decisions/ADR-036-global-install-browser-wizard-handoff.md +0 -106
  875. package/docs/decisions/ADR-037-cost-profile-untangle.md +0 -117
  876. package/docs/decisions/ADR-038-canonical-settings-path.md +0 -96
  877. package/docs/decisions/ADR-039-claude-skills-untracked.md +0 -139
  878. package/docs/decisions/ADR-040-execution-model-projection-time-filtering.md +0 -244
  879. package/docs/decisions/ADR-041-controlled-command-verbs.md +0 -133
  880. package/docs/decisions/ADR-042-runtime-resolver-decision-gate.md +0 -113
  881. package/docs/decisions/ADR-043-monorepo-collapse-to-src-domains.md +0 -128
  882. package/docs/decisions/ADR-044-command-naming-scheme-hyphenated.md +0 -250
  883. package/docs/decisions/ADR-045-src-source-layout-and-profiles-as-views.md +0 -111
  884. package/docs/decisions/ADR-046-thin-command-principle.md +0 -93
  885. package/docs/decisions/ADR-047-framework-neutral-stack-adaptive-commands.md +0 -94
  886. package/docs/decisions/ADR-048-command-justification-rule.md +0 -106
  887. package/docs/decisions/ADR-049-configuration-trust-boundary.md +0 -132
  888. package/docs/decisions/ADR-050-workspace-vs-package-root-boundary.md +0 -121
  889. package/docs/decisions/ADR-051-uncondensed-source-container-relocation.md +0 -114
  890. package/docs/decisions/ADR-052-packages-removal-and-pack-home-migration.md +0 -86
  891. package/docs/decisions/ADR-053-agents-namespace-dual-role-resolution.md +0 -132
  892. package/docs/decisions/ADR-054-rule-adherence-decay-triggered-restate.md +0 -143
  893. package/docs/decisions/ADR-055-flow-layer-data-model.md +0 -235
  894. package/docs/decisions/ADR-056-unvalidated-video-adapters-disposition.md +0 -124
  895. package/docs/decisions/ADR-057-consolidation-evidence-gate-outcomes.md +0 -135
  896. package/docs/decisions/ADR-058-condensed-output-relocation-to-dist.md +0 -94
  897. package/docs/decisions/ADR-059-render-resume-filesystem-as-state.md +0 -161
  898. package/docs/decisions/ADR-060-comfyui-sandbox-model.md +0 -154
  899. package/docs/decisions/ADR-061-corpus-grounding-layer.md +0 -230
  900. package/docs/decisions/ADR-062-encrypt-at-rest-store-architecture.md +0 -121
  901. package/docs/decisions/ADR-063-append-jsonl-encryption-deferred.md +0 -83
  902. package/docs/decisions/ADR-064-append-jsonl-per-record-encryption.md +0 -113
  903. package/docs/decisions/ADR-065-tier3-inbox-handoff-v0.md +0 -86
  904. package/docs/decisions/ADR-066-skill-body-prerendering.md +0 -93
  905. package/docs/decisions/ADR-067-glama-registry-listing.md +0 -259
  906. package/docs/decisions/ADR-068-host-tier-detection.md +0 -90
  907. package/docs/decisions/ADR-069-prompt-renderer.md +0 -97
  908. package/docs/decisions/ADR-070-tier1-drive-loop.md +0 -94
  909. package/docs/decisions/ADR-071-launch-drive-integration.md +0 -95
  910. package/docs/decisions/ADR-072-codex-gemini-drive-configs.md +0 -90
  911. package/docs/decisions/ADR-073-drive-health-kill-switch.md +0 -81
  912. package/docs/decisions/ADR-074-drive-kill-switch-auto-recovery.md +0 -84
  913. package/docs/decisions/ADR-075-workspace-gui-drive.md +0 -83
  914. package/docs/decisions/ADR-076-workspace-multi-turn.md +0 -92
  915. package/docs/decisions/ADR-077-workspace-followup-gui.md +0 -70
  916. package/docs/decisions/ADR-078-drive-health-panel.md +0 -70
  917. package/docs/decisions/ADR-079-workspace-host-picker.md +0 -81
  918. package/docs/decisions/ADR-080-host-session-expired-410.md +0 -92
  919. package/docs/decisions/ADR-081-drive-health-reset-and-410-affordance.md +0 -71
  920. package/docs/decisions/ADR-082-410-one-click-relaunch.md +0 -58
  921. package/docs/decisions/ADR-083-session-thread-and-arbitrary-continuation.md +0 -85
  922. package/docs/decisions/ADR-084-drive-health-refresh-on-drive.md +0 -52
  923. package/docs/decisions/ADR-085-mcp-stdio-end-user-distribution-shape.md +0 -158
  924. package/docs/decisions/ADR-086-read-only-cross-agent-mcp-discovery-helper.md +0 -171
  925. package/docs/decisions/ADR-087-installer-e2e-test-strategy.md +0 -111
  926. package/docs/decisions/ADR-088-no-external-runtime-federation.md +0 -144
  927. package/docs/decisions/ADR-089-lean-local-plugin-install.md +0 -111
  928. package/docs/decisions/ADR-090-visibility-command-frontmatter-field.md +0 -95
  929. package/docs/decisions/ADR-091-split-meta-capability-packs.md +0 -113
  930. package/docs/decisions/ADR-092-defer-command-tier-alias-removal.md +0 -117
  931. package/docs/decisions/ADR-093-ai-council-config-user-global.md +0 -117
  932. package/docs/decisions/ADR-094-agent-memory-layer-removal.md +0 -94
  933. package/docs/decisions/ADR-095-workspace-boundary-contract.md +0 -108
  934. package/docs/decisions/ADR-096-analysis-workbench.md +0 -110
  935. package/docs/decisions/ADR-097-mission-recipe-privilege-boundary.md +0 -121
  936. package/docs/decisions/ADR-098-evidence-first-structure-discovery.md +0 -154
  937. package/docs/decisions/ADR-099-file-first-pattern-library.md +0 -87
  938. package/docs/decisions/ADR-100-global-knowledge-card-sharing.md +0 -140
  939. package/docs/decisions/ADR-101-ticket-bundle-emission.md +0 -109
  940. package/docs/decisions/ADR-102-ticket-handoff-paste-and-mcp.md +0 -72
  941. package/docs/decisions/ADR-103-global-knowledge-default-off-until-measured.md +0 -92
  942. package/docs/decisions/ADR-104-ai-council-config-global-only.md +0 -119
  943. package/docs/decisions/ADR-105-automatic-subagent-orchestration.md +0 -108
  944. package/docs/decisions/ADR-106-recursive-verification-benchmark-gate.md +0 -126
  945. package/docs/decisions/ADR-107-legal-domain-pack-adoption.md +0 -70
  946. package/docs/decisions/ADR-108-open-source-forever-no-commercial-tier.md +0 -46
  947. package/docs/decisions/ADR-109-subagent-v1-contract.md +0 -248
  948. package/docs/decisions/ADR-110-discipline-profile-resolution-locus.md +0 -112
  949. package/docs/decisions/ADR-111-canonical-glama-listing.md +0 -97
  950. package/docs/decisions/ADR-112-stdio-lite-stays-read-only.md +0 -92
  951. package/docs/decisions/ADR-113-ci-native-release-label-trigger.md +0 -209
  952. package/docs/decisions/ADR-114-commit-policy-iron-law-override.md +0 -85
  953. package/docs/decisions/ADR-115-command-cluster-consolidation-phase-4.md +0 -91
  954. package/docs/decisions/ADR-116-memory-tripwire-activation-path.md +0 -144
  955. package/docs/decisions/ADR-117-subagents-auto-default-on.md +0 -89
  956. package/docs/decisions/ADR-118-loop-engineering-boundaries.md +0 -162
  957. package/docs/decisions/ADR-119-global-knowledge-default-on.md +0 -104
  958. package/docs/decisions/ADR-120-council-chairman-mode.md +0 -70
  959. package/docs/decisions/ADR-121-knowledge-sensitivity-classes.md +0 -90
  960. package/docs/decisions/ADR-122-adversarial-verification-council.md +0 -166
  961. package/docs/decisions/ADR-123-runtime-security-scope-and-spawn-hardening.md +0 -142
  962. package/docs/decisions/ADR-124-embedded-engine-doctrine.md +0 -255
  963. package/docs/decisions/ADR-125-doc-screenshot-anonymization.md +0 -131
  964. package/docs/decisions/ADR-126-internet-reach-operator-tooling.md +0 -254
  965. package/docs/decisions/ADR-127-enforcement-claims-must-resolve.md +0 -150
  966. package/docs/decisions/ADR-128-executable-evidence-and-measured-escalation.md +0 -201
  967. package/docs/decisions/ADR-200-python-to-typescript-migration.md +0 -203
  968. package/docs/decisions/ADR-rule-kernel-and-router.md +0 -133
  969. package/docs/decisions/INDEX.md +0 -157
  970. package/docs/decisions/engine-reclassification-2026-07.md +0 -104
  971. package/docs/deploy/connector-setup.md +0 -129
  972. package/docs/deploy/env-vars.md +0 -70
  973. package/docs/deploy/policy-cookbook.md +0 -130
  974. package/docs/deploy/quickstart.md +0 -112
  975. package/docs/deploy/small-team-recipe.md +0 -148
  976. package/docs/deploy/team-deployment-posture.md +0 -111
  977. package/docs/design/adversarial-council-eval.md +0 -106
  978. package/docs/design/council-vs-solo-baseline.md +0 -92
  979. package/docs/design/cross-model-parity-eval.md +0 -82
  980. package/docs/design/length-neutral-judge-rerun.md +0 -92
  981. package/docs/design/utilization-window-criteria.md +0 -51
  982. package/docs/development.md +0 -230
  983. package/docs/distribution/awesome-list-submission.md +0 -46
  984. package/docs/distribution/consumer-matrix.md +0 -96
  985. package/docs/distribution/launch-story-draft.md +0 -58
  986. package/docs/distribution/mcp-submission-checklist.md +0 -95
  987. package/docs/distribution/public-install-smoke.md +0 -68
  988. package/docs/distribution/registries.md +0 -126
  989. package/docs/distribution/registry-submissions.md +0 -85
  990. package/docs/distribution/telemetry-privacy.md +0 -128
  991. package/docs/distribution/telemetry-schema.md +0 -174
  992. package/docs/distribution/topics-equivalents-decay-policy.md +0 -51
  993. package/docs/end-to-end-walkthroughs.md +0 -165
  994. package/docs/enforcement-by-host.md +0 -51
  995. package/docs/examples/agent-user.example.md +0 -22
  996. package/docs/experiences/agency.md +0 -49
  997. package/docs/experiences/content_creator.md +0 -49
  998. package/docs/experiences/developer.md +0 -49
  999. package/docs/experiences/finance.md +0 -50
  1000. package/docs/experiences/founder.md +0 -49
  1001. package/docs/experiences/ops.md +0 -49
  1002. package/docs/featured-commands.md +0 -27
  1003. package/docs/featured-skills.md +0 -95
  1004. package/docs/flows.md +0 -67
  1005. package/docs/getting-started-by-role.md +0 -190
  1006. package/docs/getting-started-laravel.md +0 -72
  1007. package/docs/getting-started-local-stdio.md +0 -77
  1008. package/docs/getting-started.md +0 -254
  1009. package/docs/github-topics.md +0 -93
  1010. package/docs/governance-advantage.md +0 -72
  1011. package/docs/governance.md +0 -96
  1012. package/docs/guides/cross-repo-linked-projects.md +0 -93
  1013. package/docs/guides/cross-repo-retrieval.md +0 -61
  1014. package/docs/guides/frontend-design-corpus-refresh.md +0 -83
  1015. package/docs/guides/gated-platform-reads.md +0 -221
  1016. package/docs/guides/local-analytics.md +0 -125
  1017. package/docs/guides/local-knowledge.md +0 -127
  1018. package/docs/guides/skill-discovery.md +0 -71
  1019. package/docs/guides/skill-preview.md +0 -71
  1020. package/docs/hook-payload-capture.md +0 -221
  1021. package/docs/install-friction-report.md +0 -66
  1022. package/docs/installation.md +0 -959
  1023. package/docs/maintainers/branch-protection.md +0 -105
  1024. package/docs/maintainers/dev-mode.md +0 -106
  1025. package/docs/maintainers/optional-media-deps.md +0 -50
  1026. package/docs/maintainers/system-map.md +0 -85
  1027. package/docs/mcp-registries.md +0 -94
  1028. package/docs/mcp-server.md +0 -175
  1029. package/docs/mcp.md +0 -147
  1030. package/docs/media/proof-demo.cast +0 -14
  1031. package/docs/media/proof-demo.gif +0 -0
  1032. package/docs/migration/consumer-template-consumption-model.md +0 -145
  1033. package/docs/migration/divergences/README.md +0 -55
  1034. package/docs/migration/divergences/_template.md +0 -50
  1035. package/docs/migration/divergences/bench-stats-float-precision.md +0 -72
  1036. package/docs/migration/divergences/mcp-telemetry-node-sqlite.md +0 -61
  1037. package/docs/migration/divergences/pack-mcp-content-gzip-body.md +0 -53
  1038. package/docs/migration/divergences/src-scripts-build_cloud_bundle.md +0 -63
  1039. package/docs/migration/divergences/src-scripts-check_memory.md +0 -91
  1040. package/docs/migration/divergences/src-scripts-inventory_abstraction_budget.md +0 -65
  1041. package/docs/migration/divergences/src-scripts-lint_marketplace.md +0 -57
  1042. package/docs/migration/divergences/src-scripts-lint_mcp_registry_manifest.md +0 -70
  1043. package/docs/migration/divergences/src-scripts-spotcheck_thin_root.md +0 -60
  1044. package/docs/migration/divergences/src-scripts-validate_agent_settings.md +0 -58
  1045. package/docs/migration/node-floor.md +0 -86
  1046. package/docs/migration/v1-to-v2.md +0 -156
  1047. package/docs/migration/yaml-roundtrip-spike.md +0 -163
  1048. package/docs/migrations/commands-1.15.0.md +0 -117
  1049. package/docs/parity/bench-external.json +0 -58
  1050. package/docs/parity/bench.json +0 -41
  1051. package/docs/parity/command-frontmatter.md +0 -60
  1052. package/docs/parity/external-runtime.md +0 -46
  1053. package/docs/personas.md +0 -178
  1054. package/docs/positioning-evidence.md +0 -86
  1055. package/docs/profiles.md +0 -108
  1056. package/docs/proof.md +0 -252
  1057. package/docs/quality.md +0 -98
  1058. package/docs/readme-split-plan.md +0 -102
  1059. package/docs/recruits/_template.md +0 -81
  1060. package/docs/release-runbook.md +0 -141
  1061. package/docs/role-experiences.md +0 -19
  1062. package/docs/safety.md +0 -30
  1063. package/docs/second-brain-scope.md +0 -116
  1064. package/docs/self-review-gate.md +0 -65
  1065. package/docs/setup/enterprise-and-offline.md +0 -201
  1066. package/docs/setup/mcp-client-config.md +0 -358
  1067. package/docs/setup/mcp-cloud-endpoints.md +0 -116
  1068. package/docs/setup/mcp-cloud-registry-listing.md +0 -99
  1069. package/docs/setup/mcp-cloud-setup.md +0 -183
  1070. package/docs/setup/mcp-r2-bootstrap.md +0 -82
  1071. package/docs/setup/mcp-server-docker.md +0 -101
  1072. package/docs/setup/per-ide/aider.md +0 -48
  1073. package/docs/setup/per-ide/antigravity.md +0 -68
  1074. package/docs/setup/per-ide/augment.md +0 -89
  1075. package/docs/setup/per-ide/claude-code.md +0 -97
  1076. package/docs/setup/per-ide/claude-desktop.md +0 -207
  1077. package/docs/setup/per-ide/cline.md +0 -43
  1078. package/docs/setup/per-ide/codebuddy.md +0 -63
  1079. package/docs/setup/per-ide/codex.md +0 -46
  1080. package/docs/setup/per-ide/continue.md +0 -68
  1081. package/docs/setup/per-ide/copilot.md +0 -80
  1082. package/docs/setup/per-ide/cursor.md +0 -125
  1083. package/docs/setup/per-ide/droid.md +0 -65
  1084. package/docs/setup/per-ide/gemini-cli.md +0 -45
  1085. package/docs/setup/per-ide/jetbrains.md +0 -76
  1086. package/docs/setup/per-ide/kilocode.md +0 -66
  1087. package/docs/setup/per-ide/kiro.md +0 -72
  1088. package/docs/setup/per-ide/opencode.md +0 -62
  1089. package/docs/setup/per-ide/qoder.md +0 -63
  1090. package/docs/setup/per-ide/roocode.md +0 -68
  1091. package/docs/setup/per-ide/trae.md +0 -63
  1092. package/docs/setup/per-ide/warp.md +0 -63
  1093. package/docs/setup/per-ide/windsurf.md +0 -109
  1094. package/docs/setup/per-ide/zed.md +0 -73
  1095. package/docs/showcase.md +0 -209
  1096. package/docs/skill-duplication-findings.md +0 -91
  1097. package/docs/skills-catalog.md +0 -265
  1098. package/docs/skills-taxonomy.md +0 -90
  1099. package/docs/spawn-site-policy.md +0 -72
  1100. package/docs/succession.md +0 -80
  1101. package/docs/threat-model.md +0 -30
  1102. package/docs/troubleshooting.md +0 -155
  1103. package/docs/ui-track-mental-model.md +0 -121
  1104. package/docs/us-vs-the-category.md +0 -38
  1105. package/docs/value.md +0 -86
  1106. package/docs/walkthroughs/assets/workspace-role-grid.png +0 -0
  1107. package/docs/walkthroughs/assets/workspace-session-started.png +0 -0
  1108. package/docs/walkthroughs/assets/workspace-task-picker.png +0 -0
  1109. package/docs/walkthroughs/daily-workspace-a11y.md +0 -87
  1110. package/docs/walkthroughs/daily-workspace.md +0 -127
  1111. package/docs/wedge/production-validator/README.md +0 -81
  1112. package/docs/wedge/production-validator/first-run-check.sh +0 -42
  1113. package/docs/wedge/production-validator/production-validator.md +0 -83
  1114. package/docs/wizard.md +0 -173
  1115. package/src/scripts/postinstall_gui.ts +0 -129
@@ -0,0 +1,40 @@
1
+ (function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))l(a);new MutationObserver(a=>{for(const o of a)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&l(s)}).observe(document,{childList:!0,subtree:!0});function i(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerPolicy&&(o.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?o.credentials="include":a.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function l(a){if(a.ep)return;a.ep=!0;const o=i(a);fetch(a.href,o)}})();var Yt,B,Ul,Bl,Ne,jr,Hl,ql,fi,ut,wn,Wl,hr,Ui,Bi,bt={},kt=[],ho=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,zt=Array.isArray;function ge(e,n){for(var i in n)e[i]=n[i];return e}function pr(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function po(e,n,i){var l,a,o,s={};for(o in n)o=="key"?l=n[o]:o=="ref"?a=n[o]:s[o]=n[o];if(arguments.length>2&&(s.children=arguments.length>3?Yt.call(arguments,2):i),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)s[o]===void 0&&(s[o]=e.defaultProps[o]);return dt(e,s,l,a,null)}function dt(e,n,i,l,a){var o={type:e,props:n,key:i,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:a??++Ul,__i:-1,__u:0};return a==null&&B.vnode!=null&&B.vnode(o),o}function te(e){return e.children}function Sn(e,n){this.props=e,this.context=n}function dn(e,n){if(n==null)return e.__?dn(e.__,e.__i+1):null;for(var i;n<e.__k.length;n++)if((i=e.__k[n])!=null&&i.__e!=null)return i.__e;return typeof e.type=="function"?dn(e):null}function vo(e){if(e.__P&&e.__d){var n=e.__v,i=n.__e,l=[],a=[],o=ge({},n);o.__v=n.__v+1,B.vnode&&B.vnode(o),vr(e.__P,o,n,e.__n,e.__P.namespaceURI,32&n.__u?[i]:null,l,i??dn(n),!!(32&n.__u),a),o.__v=n.__v,o.__.__k[o.__i]=o,Gl(l,o,a),n.__e=n.__=null,o.__e!=i&&Yl(o)}}function Yl(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(n){if(n!=null&&n.__e!=null)return e.__e=e.__c.base=n.__e}),Yl(e)}function Dr(e){(!e.__d&&(e.__d=!0)&&Ne.push(e)&&!wt.__r++||jr!=B.debounceRendering)&&((jr=B.debounceRendering)||Hl)(wt)}function wt(){try{for(var e,n=1;Ne.length;)Ne.length>n&&Ne.sort(ql),e=Ne.shift(),n=Ne.length,vo(e)}finally{Ne.length=wt.__r=0}}function zl(e,n,i,l,a,o,s,d,h,u,p){var f,T,y,O,R,D,F,M=l&&l.__k||kt,q=n.length;for(h=_o(i,n,M,h,q),f=0;f<q;f++)(y=i.__k[f])!=null&&(T=y.__i!=-1&&M[y.__i]||bt,y.__i=f,D=vr(e,y,T,a,o,s,d,h,u,p),O=y.__e,y.ref&&T.ref!=y.ref&&(T.ref&&_r(T.ref,null,y),p.push(y.ref,y.__c||O,y)),R==null&&O!=null&&(R=O),(F=!!(4&y.__u))||T.__k===y.__k?(h=Kl(y,h,e,F),F&&T.__e&&(T.__e=null)):typeof y.type=="function"&&D!==void 0?h=D:O&&(h=O.nextSibling),y.__u&=-7);return i.__e=R,h}function _o(e,n,i,l,a){var o,s,d,h,u,p=i.length,f=p,T=0;for(e.__k=new Array(a),o=0;o<a;o++)(s=n[o])!=null&&typeof s!="boolean"&&typeof s!="function"?(typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?s=e.__k[o]=dt(null,s,null,null,null):zt(s)?s=e.__k[o]=dt(te,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=e.__k[o]=dt(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[o]=s,h=o+T,s.__=e,s.__b=e.__b+1,d=null,(u=s.__i=mo(s,i,h,f))!=-1&&(f--,(d=i[u])&&(d.__u|=2)),d==null||d.__v==null?(u==-1&&(a>p?T--:a<p&&T++),typeof s.type!="function"&&(s.__u|=4)):u!=h&&(u==h-1?T--:u==h+1?T++:(u>h?T--:T++,s.__u|=4))):e.__k[o]=null;if(f)for(o=0;o<p;o++)(d=i[o])!=null&&!(2&d.__u)&&(d.__e==l&&(l=dn(d)),Jl(d,d));return l}function Kl(e,n,i,l){var a,o;if(typeof e.type=="function"){for(a=e.__k,o=0;a&&o<a.length;o++)a[o]&&(a[o].__=e,n=Kl(a[o],n,i,l));return n}e.__e!=n&&(l&&(n&&e.type&&!n.parentNode&&(n=dn(e)),i.insertBefore(e.__e,n||null)),n=e.__e);do n=n&&n.nextSibling;while(n!=null&&n.nodeType==8);return n}function mo(e,n,i,l){var a,o,s,d=e.key,h=e.type,u=n[i],p=u!=null&&(2&u.__u)==0;if(u===null&&d==null||p&&d==u.key&&h==u.type)return i;if(l>(p?1:0)){for(a=i-1,o=i+1;a>=0||o<n.length;)if((u=n[s=a>=0?a--:o++])!=null&&!(2&u.__u)&&d==u.key&&h==u.type)return s}return-1}function Ur(e,n,i){n[0]=="-"?e.setProperty(n,i??""):e[n]=i==null?"":typeof i!="number"||ho.test(n)?i:i+"px"}function lt(e,n,i,l,a){var o,s;e:if(n=="style")if(typeof i=="string")e.style.cssText=i;else{if(typeof l=="string"&&(e.style.cssText=l=""),l)for(n in l)i&&n in i||Ur(e.style,n,"");if(i)for(n in i)l&&i[n]==l[n]||Ur(e.style,n,i[n])}else if(n[0]=="o"&&n[1]=="n")o=n!=(n=n.replace(Wl,"$1")),s=n.toLowerCase(),n=s in e||n=="onFocusOut"||n=="onFocusIn"?s.slice(2):n.slice(2),e.l||(e.l={}),e.l[n+o]=i,i?l?i[wn]=l[wn]:(i[wn]=hr,e.addEventListener(n,o?Bi:Ui,o)):e.removeEventListener(n,o?Bi:Ui,o);else{if(a=="http://www.w3.org/2000/svg")n=n.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(n!="width"&&n!="height"&&n!="href"&&n!="list"&&n!="form"&&n!="tabIndex"&&n!="download"&&n!="rowSpan"&&n!="colSpan"&&n!="role"&&n!="popover"&&n in e)try{e[n]=i??"";break e}catch{}typeof i=="function"||(i==null||i===!1&&n[4]!="-"?e.removeAttribute(n):e.setAttribute(n,n=="popover"&&i==1?"":i))}}function Br(e){return function(n){if(this.l){var i=this.l[n.type+e];if(n[ut]==null)n[ut]=hr++;else if(n[ut]<i[wn])return;return i(B.event?B.event(n):n)}}}function vr(e,n,i,l,a,o,s,d,h,u){var p,f,T,y,O,R,D,F,M,q,Y,le,Ge,Ce,xe,ee=n.type;if(n.constructor!==void 0)return null;128&i.__u&&(h=!!(32&i.__u),o=[d=n.__e=i.__e]),(p=B.__b)&&p(n);e:if(typeof ee=="function")try{if(F=n.props,M=ee.prototype&&ee.prototype.render,q=(p=ee.contextType)&&l[p.__c],Y=p?q?q.props.value:p.__:l,i.__c?D=(f=n.__c=i.__c).__=f.__E:(M?n.__c=f=new ee(F,Y):(n.__c=f=new Sn(F,Y),f.constructor=ee,f.render=yo),q&&q.sub(f),f.state||(f.state={}),f.__n=l,T=f.__d=!0,f.__h=[],f._sb=[]),M&&f.__s==null&&(f.__s=f.state),M&&ee.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=ge({},f.__s)),ge(f.__s,ee.getDerivedStateFromProps(F,f.__s))),y=f.props,O=f.state,f.__v=n,T)M&&ee.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),M&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(M&&ee.getDerivedStateFromProps==null&&F!==y&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(F,Y),n.__v==i.__v||!f.__e&&f.shouldComponentUpdate!=null&&f.shouldComponentUpdate(F,f.__s,Y)===!1){n.__v!=i.__v&&(f.props=F,f.state=f.__s,f.__d=!1),n.__e=i.__e,n.__k=i.__k,n.__k.some(function(ue){ue&&(ue.__=n)}),kt.push.apply(f.__h,f._sb),f._sb=[],f.__h.length&&s.push(f);break e}f.componentWillUpdate!=null&&f.componentWillUpdate(F,f.__s,Y),M&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(y,O,R)})}if(f.context=Y,f.props=F,f.__P=e,f.__e=!1,le=B.__r,Ge=0,M)f.state=f.__s,f.__d=!1,le&&le(n),p=f.render(f.props,f.state,f.context),kt.push.apply(f.__h,f._sb),f._sb=[];else do f.__d=!1,le&&le(n),p=f.render(f.props,f.state,f.context),f.state=f.__s;while(f.__d&&++Ge<25);f.state=f.__s,f.getChildContext!=null&&(l=ge(ge({},l),f.getChildContext())),M&&!T&&f.getSnapshotBeforeUpdate!=null&&(R=f.getSnapshotBeforeUpdate(y,O)),Ce=p!=null&&p.type===te&&p.key==null?Vl(p.props.children):p,d=zl(e,zt(Ce)?Ce:[Ce],n,i,l,a,o,s,d,h,u),f.base=n.__e,n.__u&=-161,f.__h.length&&s.push(f),D&&(f.__E=f.__=null)}catch(ue){if(n.__v=null,h||o!=null)if(ue.then){for(n.__u|=h?160:128;d&&d.nodeType==8&&d.nextSibling;)d=d.nextSibling;o[o.indexOf(d)]=null,n.__e=d}else{for(xe=o.length;xe--;)pr(o[xe]);Hi(n)}else n.__e=i.__e,n.__k=i.__k,ue.then||Hi(n);B.__e(ue,n,i)}else o==null&&n.__v==i.__v?(n.__k=i.__k,n.__e=i.__e):d=n.__e=go(i.__e,n,i,l,a,o,s,h,u);return(p=B.diffed)&&p(n),128&n.__u?void 0:d}function Hi(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Hi))}function Gl(e,n,i){for(var l=0;l<i.length;l++)_r(i[l],i[++l],i[++l]);B.__c&&B.__c(n,e),e.some(function(a){try{e=a.__h,a.__h=[],e.some(function(o){o.call(a)})}catch(o){B.__e(o,a.__v)}})}function Vl(e){return typeof e!="object"||e==null||e.__b>0?e:zt(e)?e.map(Vl):e.constructor!==void 0?null:ge({},e)}function go(e,n,i,l,a,o,s,d,h){var u,p,f,T,y,O,R,D=i.props||bt,F=n.props,M=n.type;if(M=="svg"?a="http://www.w3.org/2000/svg":M=="math"?a="http://www.w3.org/1998/Math/MathML":a||(a="http://www.w3.org/1999/xhtml"),o!=null){for(u=0;u<o.length;u++)if((y=o[u])&&"setAttribute"in y==!!M&&(M?y.localName==M:y.nodeType==3)){e=y,o[u]=null;break}}if(e==null){if(M==null)return document.createTextNode(F);e=document.createElementNS(a,M,F.is&&F),d&&(B.__m&&B.__m(n,o),d=!1),o=null}if(M==null)D===F||d&&e.data==F||(e.data=F);else{if(o=M=="textarea"&&F.defaultValue!=null?null:o&&Yt.call(e.childNodes),!d&&o!=null)for(D={},u=0;u<e.attributes.length;u++)D[(y=e.attributes[u]).name]=y.value;for(u in D)y=D[u],u=="dangerouslySetInnerHTML"?f=y:u=="children"||u in F||u=="value"&&"defaultValue"in F||u=="checked"&&"defaultChecked"in F||lt(e,u,null,y,a);for(u in F)y=F[u],u=="children"?T=y:u=="dangerouslySetInnerHTML"?p=y:u=="value"?O=y:u=="checked"?R=y:d&&typeof y!="function"||D[u]===y||lt(e,u,y,D[u],a);if(p)d||f&&(p.__html==f.__html||p.__html==e.innerHTML)||(e.innerHTML=p.__html),n.__k=[];else if(f&&(e.innerHTML=""),zl(n.type=="template"?e.content:e,zt(T)?T:[T],n,i,l,M=="foreignObject"?"http://www.w3.org/1999/xhtml":a,o,s,o?o[0]:i.__k&&dn(i,0),d,h),o!=null)for(u=o.length;u--;)pr(o[u]);d&&M!="textarea"||(u="value",M=="progress"&&O==null?e.removeAttribute("value"):O!=null&&(O!==e[u]||M=="progress"&&!O||M=="option"&&O!=D[u])&&lt(e,u,O,D[u],a),u="checked",R!=null&&R!=e[u]&&lt(e,u,R,D[u],a))}return e}function _r(e,n,i){try{if(typeof e=="function"){var l=typeof e.__u=="function";l&&e.__u(),l&&n==null||(e.__u=e(n))}else e.current=n}catch(a){B.__e(a,i)}}function Jl(e,n,i){var l,a;if(B.unmount&&B.unmount(e),(l=e.ref)&&(l.current&&l.current!=e.__e||_r(l,null,n)),(l=e.__c)!=null){if(l.componentWillUnmount)try{l.componentWillUnmount()}catch(o){B.__e(o,n)}l.base=l.__P=null}if(l=e.__k)for(a=0;a<l.length;a++)l[a]&&Jl(l[a],n,i||typeof e.type!="function");i||pr(e.__e),e.__c=e.__=e.__e=void 0}function yo(e,n,i){return this.constructor(e,i)}function bo(e,n,i){var l,a,o,s;n==document&&(n=document.documentElement),B.__&&B.__(e,n),a=(l=!1)?null:n.__k,o=[],s=[],vr(n,e=n.__k=po(te,null,[e]),a||bt,bt,n.namespaceURI,a?null:n.firstChild?Yt.call(n.childNodes):null,o,a?a.__e:n.firstChild,l,s),Gl(o,e,s)}Yt=kt.slice,B={__e:function(e,n,i,l){for(var a,o,s;n=n.__;)if((a=n.__c)&&!a.__)try{if((o=a.constructor)&&o.getDerivedStateFromError!=null&&(a.setState(o.getDerivedStateFromError(e)),s=a.__d),a.componentDidCatch!=null&&(a.componentDidCatch(e,l||{}),s=a.__d),s)return a.__E=a}catch(d){e=d}throw e}},Ul=0,Bl=function(e){return e!=null&&e.constructor===void 0},Sn.prototype.setState=function(e,n){var i;i=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=ge({},this.state),typeof e=="function"&&(e=e(ge({},i),this.props)),e&&ge(i,e),e!=null&&this.__v&&(n&&this._sb.push(n),Dr(this))},Sn.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Dr(this))},Sn.prototype.render=te,Ne=[],Hl=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ql=function(e,n){return e.__v.__b-n.__v.__b},wt.__r=0,fi=Math.random().toString(8),ut="__d"+fi,wn="__a"+fi,Wl=/(PointerCapture)$|Capture$/i,hr=0,Ui=Br(!1),Bi=Br(!0);var ko=0;function r(e,n,i,l,a,o){n||(n={});var s,d,h=n;if("ref"in h)for(d in h={},n)d=="ref"?s=n[d]:h[d]=n[d];var u={type:e,props:h,key:i,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--ko,__i:-1,__u:0,__source:a,__self:o};if(typeof e=="function"&&(s=e.defaultProps))for(d in s)h[d]===void 0&&(h[d]=s[d]);return B.vnode&&B.vnode(u),u}var Nn,G,hi,Hr,qi=0,Ql=[],J=B,qr=J.__b,Wr=J.__r,Yr=J.diffed,zr=J.__c,Kr=J.unmount,Gr=J.__;function mr(e,n){J.__h&&J.__h(G,e,qi||n),qi=0;var i=G.__H||(G.__H={__:[],__h:[]});return e>=i.__.length&&i.__.push({}),i.__[e]}function gr(e){return qi=1,wo(ea,e)}function wo(e,n,i){var l=mr(Nn++,2);if(l.t=e,!l.__c&&(l.__=[ea(void 0,n),function(d){var h=l.__N?l.__N[0]:l.__[0],u=l.t(h,d);h!==u&&(l.__N=[u,l.__[1]],l.__c.setState({}))}],l.__c=G,!G.__f)){var a=function(d,h,u){if(!l.__c.__H)return!0;var p=l.__c.__H.__.filter(function(T){return T.__c});if(p.every(function(T){return!T.__N}))return!o||o.call(this,d,h,u);var f=l.__c.props!==d;return p.some(function(T){if(T.__N){var y=T.__[0];T.__=T.__N,T.__N=void 0,y!==T.__[0]&&(f=!0)}}),o&&o.call(this,d,h,u)||f};G.__f=!0;var o=G.shouldComponentUpdate,s=G.componentWillUpdate;G.componentWillUpdate=function(d,h,u){if(this.__e){var p=o;o=void 0,a(d,h,u),o=p}s&&s.call(this,d,h,u)},G.shouldComponentUpdate=a}return l.__N||l.__}function Ae(e,n){var i=mr(Nn++,3);!J.__s&&Xl(i.__H,n)&&(i.__=e,i.u=n,G.__H.__h.push(i))}function Zl(e,n){var i=mr(Nn++,7);return Xl(i.__H,n)&&(i.__=e(),i.__H=n,i.__h=e),i.__}function So(){for(var e;e=Ql.shift();){var n=e.__H;if(e.__P&&n)try{n.__h.some(ft),n.__h.some(Wi),n.__h=[]}catch(i){n.__h=[],J.__e(i,e.__v)}}}J.__b=function(e){G=null,qr&&qr(e)},J.__=function(e,n){e&&n.__k&&n.__k.__m&&(e.__m=n.__k.__m),Gr&&Gr(e,n)},J.__r=function(e){Wr&&Wr(e),Nn=0;var n=(G=e.__c).__H;n&&(hi===G?(n.__h=[],G.__h=[],n.__.some(function(i){i.__N&&(i.__=i.__N),i.u=i.__N=void 0})):(n.__h.some(ft),n.__h.some(Wi),n.__h=[],Nn=0)),hi=G},J.diffed=function(e){Yr&&Yr(e);var n=e.__c;n&&n.__H&&(n.__H.__h.length&&(Ql.push(n)!==1&&Hr===J.requestAnimationFrame||((Hr=J.requestAnimationFrame)||Ao)(So)),n.__H.__.some(function(i){i.u&&(i.__H=i.u),i.u=void 0})),hi=G=null},J.__c=function(e,n){n.some(function(i){try{i.__h.some(ft),i.__h=i.__h.filter(function(l){return!l.__||Wi(l)})}catch(l){n.some(function(a){a.__h&&(a.__h=[])}),n=[],J.__e(l,i.__v)}}),zr&&zr(e,n)},J.unmount=function(e){Kr&&Kr(e);var n,i=e.__c;i&&i.__H&&(i.__H.__.some(function(l){try{ft(l)}catch(a){n=a}}),i.__H=void 0,n&&J.__e(n,i.__v))};var Vr=typeof requestAnimationFrame=="function";function Ao(e){var n,i=function(){clearTimeout(l),Vr&&cancelAnimationFrame(n),setTimeout(e)},l=setTimeout(i,35);Vr&&(n=requestAnimationFrame(i))}function ft(e){var n=G,i=e.__c;typeof i=="function"&&(e.__c=void 0,i()),G=n}function Wi(e){var n=G;e.__c=e.__(),G=n}function Xl(e,n){return!e||e.length!==n.length||n.some(function(i,l){return i!==e[l]})}function ea(e,n){return typeof n=="function"?n(e):n}var Co=Symbol.for("preact-signals");function Kt(){if(be>1)be--;else{var e,n=!1;for(function(){var a=At;for(At=void 0;a!==void 0;)a.S.v===a.v&&(a.S.i=a.i),a=a.o}();An!==void 0;){var i=An;for(An=void 0,St++;i!==void 0;){var l=i.u;if(i.u=void 0,i.f&=-3,!(8&i.f)&&ta(i))try{i.c()}catch(a){n||(e=a,n=!0)}i=l}}if(St=0,be--,n)throw e}}function xo(e){if(be>0)return e();Yi=++To,be++;try{return e()}finally{Kt()}}var H=void 0;function yr(e){var n=H;H=void 0;try{return e()}finally{H=n}}var An=void 0,be=0,St=0,To=0,Yi=0,At=void 0,Ct=0;function na(e){if(H!==void 0){var n=e.n;if(n===void 0||n.t!==H)return n={i:0,S:e,p:H.s,n:void 0,t:H,e:void 0,x:void 0,r:n},H.s!==void 0&&(H.s.n=n),H.s=n,e.n=n,32&H.f&&e.S(n),n;if(n.i===-1)return n.i=0,n.n!==void 0&&(n.n.p=n.p,n.p!==void 0&&(n.p.n=n.n),n.p=H.s,n.n=void 0,H.s.n=n,H.s=n),n}}function X(e,n){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=n?.watched,this.Z=n?.unwatched,this.name=n?.name}X.prototype.brand=Co;X.prototype.h=function(){return!0};X.prototype.S=function(e){var n=this,i=this.t;i!==e&&e.e===void 0&&(e.x=i,this.t=e,i!==void 0?i.e=e:yr(function(){var l;(l=n.W)==null||l.call(n)}))};X.prototype.U=function(e){var n=this;if(this.t!==void 0){var i=e.e,l=e.x;i!==void 0&&(i.x=l,e.e=void 0),l!==void 0&&(l.e=i,e.x=void 0),e===this.t&&(this.t=l,l===void 0&&yr(function(){var a;(a=n.Z)==null||a.call(n)}))}};X.prototype.subscribe=function(e){var n=this;return Bn(function(){var i=n.value,l=H;H=void 0;try{e(i)}finally{H=l}},{name:"sub"})};X.prototype.valueOf=function(){return this.value};X.prototype.toString=function(){return this.value+""};X.prototype.toJSON=function(){return this.value};X.prototype.peek=function(){var e=this;return yr(function(){return e.value})};Object.defineProperty(X.prototype,"value",{get:function(){var e=na(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(St>100)throw new Error("Cycle detected");(function(i){be!==0&&St===0&&i.l!==Yi&&(i.l=Yi,At={S:i,v:i.v,i:i.i,o:At})})(this),this.v=e,this.i++,Ct++,be++;try{for(var n=this.t;n!==void 0;n=n.x)n.t.N()}finally{Kt()}}}});function m(e,n){return new X(e,n)}function ta(e){for(var n=e.s;n!==void 0;n=n.n)if(n.S.i!==n.i||!n.S.h()||n.S.i!==n.i)return!0;return!1}function ia(e){for(var n=e.s;n!==void 0;n=n.n){var i=n.S.n;if(i!==void 0&&(n.r=i),n.S.n=n,n.i=-1,n.n===void 0){e.s=n;break}}}function ra(e){for(var n=e.s,i=void 0;n!==void 0;){var l=n.p;n.i===-1?(n.S.U(n),l!==void 0&&(l.n=n.n),n.n!==void 0&&(n.n.p=l)):i=n,n.S.n=n.r,n.r!==void 0&&(n.r=void 0),n=l}e.s=i}function ze(e,n){X.call(this,void 0),this.x=e,this.s=void 0,this.g=Ct-1,this.f=4,this.W=n?.watched,this.Z=n?.unwatched,this.name=n?.name}ze.prototype=new X;ze.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Ct))return!0;if(this.g=Ct,this.f|=1,this.i>0&&!ta(this))return this.f&=-2,!0;var e=H;try{ia(this),H=this;var n=this.x();(16&this.f||this.v!==n||this.i===0)&&(this.v=n,this.f&=-17,this.i++)}catch(i){this.v=i,this.f|=16,this.i++}return H=e,ra(this),this.f&=-2,!0};ze.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var n=this.s;n!==void 0;n=n.n)n.S.S(n)}X.prototype.S.call(this,e)};ze.prototype.U=function(e){if(this.t!==void 0&&(X.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var n=this.s;n!==void 0;n=n.n)n.S.U(n)}};ze.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(ze.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=na(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function Jr(e,n){return new ze(e,n)}function la(e){var n=e.m;if(e.m=void 0,typeof n=="function"){be++;var i=H;H=void 0;try{n()}catch(l){throw e.f&=-2,e.f|=8,br(e),l}finally{H=i,Kt()}}}function br(e){for(var n=e.s;n!==void 0;n=n.n)n.S.U(n);e.x=void 0,e.s=void 0,la(e)}function Eo(e){if(H!==this)throw new Error("Out-of-order effect");ra(this),H=e,this.f&=-2,8&this.f&&br(this),Kt()}function pn(e,n){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=n?.name}pn.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var n=this.x();typeof n=="function"&&(this.m=n)}finally{e()}};pn.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,la(this),ia(this),be++;var e=H;return H=this,Eo.bind(this,e)};pn.prototype.N=function(){2&this.f||(this.f|=2,this.u=An,An=this)};pn.prototype.d=function(){this.f|=8,1&this.f||br(this)};pn.prototype.dispose=function(){this.d()};function Bn(e,n){var i=new pn(e,n);try{i.c()}catch(a){throw i.d(),a}var l=i.d.bind(i);return l[Symbol.dispose]=l,l}var aa,at,Oo=typeof window<"u"&&!!window.__PREACT_SIGNALS_DEVTOOLS__,oa=[];Bn(function(){aa=this.N})();function vn(e,n){B[e]=n.bind(null,B[e]||function(){})}function xt(e){if(at){var n=at;at=void 0,n()}at=e&&e.S()}function ca(e){var n=this,i=e.data,l=Io(i);l.value=i;var a=Zl(function(){for(var d=n,h=n.__v;h=h.__;)if(h.__c){h.__c.__$f|=4;break}var u=Jr(function(){var y=l.value.value;return y===0?0:y===!0?"":y||""}),p=Jr(function(){return!Array.isArray(u.value)&&!Bl(u.value)}),f=Bn(function(){if(this.N=sa,p.value){var y=u.value;d.__v&&d.__v.__e&&d.__v.__e.nodeType===3&&(d.__v.__e.data=y)}}),T=n.__$u.d;return n.__$u.d=function(){f(),T.call(this)},[p,u]},[]),o=a[0],s=a[1];return o.value?s.peek():s.value}ca.displayName="ReactiveTextNode";Object.defineProperties(X.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:ca},props:{configurable:!0,get:function(){var e=this;return{data:{get value(){return e.value}}}}},__b:{configurable:!0,value:1}});vn("__b",function(e,n){if(typeof n.type=="string"){var i,l=n.props;for(var a in l)if(a!=="children"){var o=l[a];o instanceof X&&(i||(n.__np=i={}),i[a]=o,l[a]=o.peek())}}e(n)});vn("__r",function(e,n){if(e(n),n.type!==te){xt();var i,l=n.__c;l&&(l.__$f&=-2,(i=l.__$u)===void 0&&(l.__$u=i=function(a,o){var s;return Bn(function(){s=this},{name:o}),s.c=a,s}(function(){var a;Oo&&((a=i.y)==null||a.call(i)),l.__$f|=1,l.setState({})},typeof n.type=="function"?n.type.displayName||n.type.name:""))),xt(i)}});vn("__e",function(e,n,i,l){xt(),e(n,i,l)});vn("diffed",function(e,n){xt();var i;if(typeof n.type=="string"&&(i=n.__e)){var l=n.__np,a=n.props;if(l){var o=i.U;if(o)for(var s in o){var d=o[s];d!==void 0&&!(s in l)&&(d.d(),o[s]=void 0)}else o={},i.U=o;for(var h in l){var u=o[h],p=l[h];u===void 0?(u=No(i,h,p),o[h]=u):u.o(p,a)}for(var f in l)a[f]=l[f]}}e(n)});function No(e,n,i,l){var a=n in e&&e.ownerSVGElement===void 0,o=m(i),s=i.peek();return{o:function(d,h){o.value=d,s=d.peek()},d:Bn(function(){this.N=sa;var d=o.value.value;s!==d?(s=void 0,a?e[n]=d:d!=null&&(d!==!1||n[4]==="-")?e.setAttribute(n,d):e.removeAttribute(n)):s=void 0})}}vn("unmount",function(e,n){if(typeof n.type=="string"){var i=n.__e;if(i){var l=i.U;if(l){i.U=void 0;for(var a in l){var o=l[a];o&&o.d()}}}n.__np=void 0}else{var s=n.__c;if(s){var d=s.__$u;d&&(s.__$u=void 0,d.d())}}e(n)});vn("__h",function(e,n,i,l){(l<3||l===9)&&(n.__$f|=2),e(n,i,l)});Sn.prototype.shouldComponentUpdate=function(e,n){if(this.__R)return!0;var i=this.__$u,l=i&&i.s!==void 0;for(var a in n)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var o=2&this.__$f;if(!(l||o||4&this.__$f)||1&this.__$f)return!0}else if(!(l||4&this.__$f)||3&this.__$f)return!0;for(var s in e)if(s!=="__source"&&e[s]!==this.props[s])return!0;for(var d in this.props)if(!(d in e))return!0;return!1};function Io(e,n){return Zl(function(){return m(e,n)},[])}var Ro=function(e){queueMicrotask(function(){queueMicrotask(e)})};function Lo(){xo(function(){for(var e;e=oa.shift();)aa.call(e)})}function sa(){oa.push(this)===1&&(B.requestAnimationFrame||Ro)(Lo)}function ua(){const e=window.location.hash;return e===""||e==="#"?"/":e.startsWith("#")?e.slice(1):e}const Tt=m(ua());function Gt(e){const n=e.startsWith("/")?e:`/${e}`;`#${n}`!==window.location.hash&&(window.location.hash=n)}let Qr=!1;function $o(){Qr||(Qr=!0,window.addEventListener("hashchange",()=>{Tt.value=ua()}))}let In=null;function Po(e){In=e}class V extends Error{status;body;constructor(n,i,l){super(l),this.status=n,this.body=i}}async function j(e,n={}){const i={Accept:"application/json",...n.headers??{}};In!==null&&(i.Authorization=`Bearer ${In}`);const{body:l,...a}=n,o={...a,headers:i};l!==void 0&&(o.body=JSON.stringify(l),i["Content-Type"]="application/json");const s=await fetch(e,o),d=await s.text(),h=d===""?{}:JSON.parse(d);if(!s.ok){const u=h.error?.message??`request failed (${s.status})`;throw new V(s.status,h,u)}return h}async function Mo(e,n,i,l={}){const a={Accept:"text/event-stream","Content-Type":"application/json",...l.headers??{}};In!==null&&(a.Authorization=`Bearer ${In}`);const o=await fetch(e,{...l,method:"POST",headers:a,body:JSON.stringify(n)});if(!o.ok||o.body===null){const p=await o.text().catch(()=>"");let f={};try{f=p===""?{}:JSON.parse(p)}catch{}throw new V(o.status,f,f.error?.message??`stream failed (${o.status})`)}const s=o.body.getReader(),d=new TextDecoder;let h="";const u=p=>{for(const f of p.split(`
2
+ `)){if(!f.startsWith("data:"))continue;const T=f.slice(5).trim();if(T!=="")try{i(JSON.parse(T))}catch{}}};for(;;){const{done:p,value:f}=await s.read();if(p)break;h+=d.decode(f,{stream:!0});let T=h.indexOf(`
3
+
4
+ `);for(;T!==-1;)u(h.slice(0,T)),h=h.slice(T+2),T=h.indexOf(`
5
+
6
+ `)}h.trim()!==""&&u(h)}const Be=m(null);async function Fo(){try{const e=await j("/api/v1/ping");Be.value={...e,projectScopeAvailable:e.projectScopeAvailable===!0,projectSurface:e.projectSurface===!0,devSurfaces:e.devSurfaces===!0}}catch{Be.value=null}}function ce(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 jo(e){return/expected (boolean|string|number)/i.test(e)?e.replace(/^expected/i,"Expected"):e}function Vt(e){const n={};for(const i of e.fields??[])n[i.path]=jo(i.message);return n}function Do({id:e,children:n}){return r("p",{class:"ac-field__description",id:e,children:n})}function Uo({id:e,children:n}){return r("p",{class:"ac-field__error",id:e,role:"alert","aria-live":"polite",children:n})}function Ke({id:e,label:n,description:i,error:l,children:a}){const o=i!==void 0?`${e}-desc`:void 0,s=l!==void 0?`${e}-err`:void 0;return r("div",{class:"ac-field","data-invalid":l!==void 0?"true":void 0,children:[r("label",{class:"ac-field__label",for:e,children:n}),i!==void 0?r(Do,{id:o,children:i}):null,r("div",{class:"ac-field__control","aria-describedby":o,"aria-errormessage":s,children:a}),l!==void 0?r(Uo,{id:s,children:l}):null]})}function da(e){return r(Ke,{id:e.id,label:e.label,description:e.description,error:e.error,children:r("input",{class:"ac-input",type:"text",id:e.id,name:e.name,value:e.value,placeholder:e.placeholder,"aria-invalid":e.error!==void 0?"true":void 0,onInput:n=>e.onChange(n.currentTarget.value)})})}function Bo(e){const n=e.step??(e.integer===!0?1:"any");return r(Ke,{id:e.id,label:e.label,description:e.description,error:e.error,children:r("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:n,"aria-invalid":e.error!==void 0?"true":void 0,onInput:i=>{const l=i.currentTarget.value,a=l===""?0:Number(l);e.onChange(Number.isFinite(a)?a:0)}})})}function Ho(e){return r(Ke,{id:e.id,label:e.label,description:e.description,error:e.error,children:r("label",{class:"ac-toggle",children:[r("input",{type:"checkbox",id:e.id,name:e.name,checked:e.value,"aria-invalid":e.error!==void 0?"true":void 0,onChange:n=>e.onChange(n.currentTarget.checked)}),r("span",{class:"ac-toggle__track","aria-hidden":"true"}),r("span",{class:"ac-toggle__state",children:e.value?"On":"Off"})]})})}function fa(e){const n=e.options.length>3;return r(Ke,{id:e.id,label:e.label,description:e.description,error:e.error,children:n?r("select",{class:"ac-input",id:e.id,name:e.name,value:e.value,"aria-invalid":e.error!==void 0?"true":void 0,onChange:i=>e.onChange(i.currentTarget.value),children:e.options.map(i=>r("option",{value:i.value,children:i.label??(i.value===""?"(none)":i.value)},i.value))}):r("div",{class:"ac-radio-group",role:"radiogroup","aria-labelledby":`${e.id}-label`,children:e.options.map(i=>{const l=`${e.id}-${i.value||"none"}`;return r("label",{class:"ac-radio",for:l,children:[r("input",{type:"radio",id:l,name:e.name,value:i.value,checked:i.value===e.value,onChange:()=>e.onChange(i.value)}),r("span",{children:i.label??(i.value===""?"(none)":i.value)})]},i.value)})})})}function Et(e){return r(Ke,{id:e.id,label:e.label,description:e.description,error:e.error,children:r("textarea",{class:"ac-textarea",id:e.id,name:e.name,rows:e.rows??6,placeholder:e.placeholder,"aria-invalid":e.error!==void 0?"true":void 0,onInput:n=>e.onChange(n.currentTarget.value),children:e.value})})}function ha(e){return e.replace(/_/g," ").replace(/\./g," › ").replace(/\b\w/g,n=>n.toUpperCase())}function qo(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 pi(e,n){const i=qo(n);return{path:e,kind:i,label:ha(e[e.length-1]??""),description:n.description,options:n.enum,min:n.minimum,max:n.maximum,defaultValue:n.default}}function pa(e){const n=[],i=e.properties??{};for(const[l,a]of Object.entries(i))if(a.type==="object"&&a.properties!==void 0){const o=[];for(const[s,d]of Object.entries(a.properties))if(d.type==="object"&&d.properties!==void 0)for(const[h,u]of Object.entries(d.properties))o.push(pi([l,s,h],u));else o.push(pi([l,s],d));n.push({path:[l],label:ha(l),description:a.description,fields:o})}else{const o=n.find(d=>d.path[0]==="__general"),s=pi([l],a);o===void 0?n.unshift({path:["__general"],label:"General",fields:[s]}):o.fields.push(s)}return n}function Hn(e,n){let i=e;for(const l of n){if(i===null||typeof i!="object"||Array.isArray(i))return;i=i[l]}return i}function Rn(e,n,i){if(n.length===0)return e;const[l,...a]=n;if(l===void 0)return e;const o={...e};if(a.length===0)return o[l]=i,o;const s=o[l],d=s!==null&&typeof s=="object"&&!Array.isArray(s)?s:{};return o[l]=Rn(d,a,i),o}function an(e){return e.join(".")}function Zr(e,n,i,l){const a=an(e.path),o=a,s=Hn(n,e.path),d=i[a],h=u=>{l(Rn(n,e.path,u))};switch(e.kind){case"string":{const u=typeof s=="string"?s:"";return u.length>80?r(Et,{id:a,name:o,label:e.label,description:e.description,error:d,value:u,onChange:h}):r(da,{id:a,name:o,label:e.label,description:e.description,error:d,value:u,onChange:h})}case"enum":{const u=typeof s=="string"||typeof s=="number"?String(s):"",p=(e.options??[]).map(f=>({value:String(f)}));return r(fa,{id:a,name:o,label:e.label,description:e.description,error:d,value:u,options:p,onChange:h})}case"number":case"integer":{const u=typeof s=="number"?s:0;return r(Bo,{id:a,name:o,label:e.label,description:e.description,error:d,value:u,integer:e.kind==="integer",min:e.min,max:e.max,onChange:h})}case"boolean":{const u=typeof s=="boolean"?s:!1;return r(Ho,{id:a,name:o,label:e.label,description:e.description,error:d,value:u,onChange:h})}case"array-of-strings":{const p=(Array.isArray(s)?s.filter(f=>typeof f=="string"):[]).join(`
7
+ `);return r(Et,{id:a,name:o,label:e.label,description:`${e.description??""} (one entry per line)`.trim(),error:d,value:p,onChange:f=>{const T=f.split(`
8
+ `).map(y=>y.trim()).filter(y=>y!=="");h(T)}})}default:return null}}function Wo({field:e,values:n,errors:i,onChange:l,decorate:a}){const o=an(e.path),s=a?.(o,e);return s===void 0?r("div",{children:Zr(e,n,i,l)},o):r("div",{class:`ac-field-row${s.modified?" ac-field-row--modified":""}`,children:[r("div",{class:"ac-field-row__body",children:Zr(e,n,i,l)}),r("div",{class:"ac-field-row__meta",children:[s.sourceLabel!==void 0?r("span",{class:"ac-badge ac-badge--source",title:`Value set in the ${s.sourceLabel} layer`,children:s.sourceLabel}):null,s.modified&&s.onReset!==void 0?r("button",{type:"button",class:"ac-field-row__reset",title:"Reset to default",onClick:s.onReset,children:"Reset"}):null]})]})}function va({section:e,values:n,errors:i,onChange:l,decorate:a,footer:o}){return r("section",{class:"ac-section","aria-labelledby":`section-${an(e.path)}`,children:[r("h2",{class:"ac-section__title",id:`section-${an(e.path)}`,children:e.label}),e.description!==void 0?r("p",{class:"ac-section__description",children:e.description}):null,r("div",{class:"ac-section__fields",children:e.fields.map(s=>r(Wo,{field:s,values:n,errors:i,onChange:l,decorate:a},an(s.path)))}),o]})}function Yo(e){const n=pa(e.schema),i=e.errors??{};return r("form",{class:"ac-form",onSubmit:l=>l.preventDefault(),children:[n.map(l=>r(va,{section:l,values:e.values,errors:i,onChange:e.onChange,decorate:e.decorate},an(l.path))),e.actions!==void 0?r("div",{class:"ac-form__actions",children:e.actions}):null]})}function zo(e){const[n]=gr(()=>`${e.id}-list`);return r(Ke,{id:e.id,label:e.label,description:e.description,error:e.error,children:[r("input",{class:"ac-input",type:"text",id:e.id,name:e.name,value:e.value,placeholder:e.placeholder,list:n,"aria-invalid":e.error!==void 0?"true":void 0,onInput:i=>e.onChange(i.currentTarget.value)}),r("datalist",{id:n,children:e.suggestions.map(i=>r("option",{value:i},i))})]})}const Ko=["developer","reviewer","designer","product-manager","ops","qa","maintainer"],Go=["de","en","en-US","en-GB","fr","es","it","nl","pt","pt-BR"];function Xr(){return new Date().toISOString().slice(0,10)}function Xe(e,n){return e?.[n]}function Vo({value:e,onChange:n,errors:i,hideRole:l,hideIdentityBasics:a}){const[o,s]=gr(""),d="umd-role-suggestions";function h(O){n({...e,...O,last_updated:Xr()})}const u=e.role.filter(O=>O.trim()!=="");function p(O){const R=O.trim();if(R===""||u.includes(R)){s("");return}h({role:[...u,R]}),s("")}function f(O){u.length<=1||h({role:u.filter(R=>R!==O)})}function T(O){const R={...e,last_updated:Xr()};O===""?delete R.notes:R.notes=O,n(R)}const y=Ko.filter(O=>!u.includes(O));return r("div",{class:"ac-user-md-form",children:[a?null:r(da,{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:Xe(i,"identity.name"),onChange:O=>h({identity:{...e.identity,name:O}})}),a?null:r(zo,{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:Go,error:Xe(i,"language"),onChange:O=>h({language:O})}),l?null:r(Ke,{id:"umd-role-input",label:"Roles",description:"One or more roles. Seeded suggestions are non-binding — type anything and press Enter.",error:Xe(i,"role"),children:[r("ul",{class:"ac-chip-list","data-testid":"umd-role-list",children:u.map(O=>r("li",{class:"ac-chip",children:[r("span",{children:O}),r("button",{type:"button",class:"ac-chip__remove","aria-label":`Remove ${O}`,disabled:u.length<=1,onClick:()=>f(O),children:"×"})]},O))}),r("div",{class:"ac-role-add",children:[r("input",{class:"ac-input",type:"text",id:"umd-role-input",name:"role-add",list:d,placeholder:"Add a role and press Enter",value:o,onInput:O=>s(O.currentTarget.value),onKeyDown:O=>{(O.key==="Enter"||O.key===",")&&(O.preventDefault(),p(o))}}),r("datalist",{id:d,children:y.map(O=>r("option",{value:O},O))}),r("button",{type:"button",class:"ac-button",onClick:()=>p(o),children:"Add role"})]})]}),r(fa,{id:"umd-pace",name:"style.pace",label:"Pace",value:e.style.pace,error:Xe(i,"style.pace"),options:[{value:"pragmatic",label:"Pragmatic"},{value:"thorough",label:"Thorough"},{value:"rapid",label:"Rapid"}],onChange:O=>h({style:{...e.style,pace:O}})}),r(Et,{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:Xe(i,"voice_sample"),onChange:O=>h({voice_sample:O})}),r(Et,{id:"umd-notes",name:"notes",label:"Notes",description:"Optional free-form prose the agent remembers across sessions.",rows:6,value:e.notes??"",error:Xe(i,"notes"),onChange:T})]})}function _a(){return{version:1,identity:{name:""},language:"en",role:[],style:{pace:"pragmatic"},voice_sample:"",last_updated:"1970-01-01"}}function el(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ot(e,n){return typeof e=="string"?e:n}function Jo(e){return e==="thorough"||e==="rapid"?e:"pragmatic"}function Qo(e){return Array.isArray(e)?e.filter(n=>typeof n=="string"&&n.trim()!==""):[]}function Zo(e){if(typeof e=="string")return e===""?void 0:e}function nl(e){const n=_a(),i=el(e.identity)?e.identity:{},l=el(e.style)?e.style:{},a=Zo(e.notes),o={version:1,identity:{name:ot(i.name,n.identity.name)},language:ot(e.language,n.language),role:Qo(e.role),style:{pace:Jo(l.pace)},voice_sample:ot(e.voice_sample,n.voice_sample),last_updated:ot(e.last_updated,n.last_updated)};return a!==void 0&&(o.notes=a),o}function Xo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ne={},ct={},Ee={},tl;function qn(){if(tl)return Ee;tl=1;function e(s){return typeof s>"u"||s===null}function n(s){return typeof s=="object"&&s!==null}function i(s){return Array.isArray(s)?s:e(s)?[]:[s]}function l(s,d){if(d){const h=Object.keys(d);for(let u=0,p=h.length;u<p;u+=1){const f=h[u];s[f]=d[f]}}return s}function a(s,d){let h="";for(let u=0;u<d;u+=1)h+=s;return h}function o(s){return s===0&&Number.NEGATIVE_INFINITY===1/s}return Ee.isNothing=e,Ee.isObject=n,Ee.toArray=i,Ee.repeat=a,Ee.isNegativeZero=o,Ee.extend=l,Ee}var vi,il;function Wn(){if(il)return vi;il=1;function e(i,l){let a="";const o=i.reason||"(unknown reason)";return i.mark?(i.mark.name&&(a+='in "'+i.mark.name+'" '),a+="("+(i.mark.line+1)+":"+(i.mark.column+1)+")",!l&&i.mark.snippet&&(a+=`
9
+
10
+ `+i.mark.snippet),o+" "+a):o}function n(i,l){Error.call(this),this.name="YAMLException",this.reason=i,this.mark=l,this.message=e(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n.prototype.toString=function(l){return this.name+": "+e(this,l)},vi=n,vi}var _i,rl;function ec(){if(rl)return _i;rl=1;const e=qn();function n(a,o,s,d,h){let u="",p="";const f=Math.floor(h/2)-1;return d-o>f&&(u=" ... ",o=d-f+u.length),s-d>f&&(p=" ...",s=d+f-p.length),{str:u+a.slice(o,s).replace(/\t/g,"→")+p,pos:d-o+u.length}}function i(a,o){return e.repeat(" ",o-a.length)+a}function l(a,o){if(o=Object.create(o||null),!a.buffer)return null;o.maxLength||(o.maxLength=79),typeof o.indent!="number"&&(o.indent=1),typeof o.linesBefore!="number"&&(o.linesBefore=3),typeof o.linesAfter!="number"&&(o.linesAfter=2);const s=/\r?\n|\r|\0/g,d=[0],h=[];let u,p=-1;for(;u=s.exec(a.buffer);)h.push(u.index),d.push(u.index+u[0].length),a.position<=u.index&&p<0&&(p=d.length-2);p<0&&(p=d.length-1);let f="";const T=Math.min(a.line+o.linesAfter,h.length).toString().length,y=o.maxLength-(o.indent+T+3);for(let R=1;R<=o.linesBefore&&!(p-R<0);R++){const D=n(a.buffer,d[p-R],h[p-R],a.position-(d[p]-d[p-R]),y);f=e.repeat(" ",o.indent)+i((a.line-R+1).toString(),T)+" | "+D.str+`
11
+ `+f}const O=n(a.buffer,d[p],h[p],a.position,y);f+=e.repeat(" ",o.indent)+i((a.line+1).toString(),T)+" | "+O.str+`
12
+ `,f+=e.repeat("-",o.indent+T+3+O.pos)+`^
13
+ `;for(let R=1;R<=o.linesAfter&&!(p+R>=h.length);R++){const D=n(a.buffer,d[p+R],h[p+R],a.position-(d[p]-d[p+R]),y);f+=e.repeat(" ",o.indent)+i((a.line+R+1).toString(),T)+" | "+D.str+`
14
+ `}return f.replace(/\n$/,"")}return _i=l,_i}var mi,ll;function re(){if(ll)return mi;ll=1;const e=Wn(),n=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],i=["scalar","sequence","mapping"];function l(o){const s={};return o!==null&&Object.keys(o).forEach(function(d){o[d].forEach(function(h){s[String(h)]=d})}),s}function a(o,s){if(s=s||{},Object.keys(s).forEach(function(d){if(n.indexOf(d)===-1)throw new e('Unknown option "'+d+'" is met in definition of "'+o+'" YAML type.')}),this.options=s,this.tag=o,this.kind=s.kind||null,this.resolve=s.resolve||function(){return!0},this.construct=s.construct||function(d){return d},this.instanceOf=s.instanceOf||null,this.predicate=s.predicate||null,this.represent=s.represent||null,this.representName=s.representName||null,this.defaultStyle=s.defaultStyle||null,this.multi=s.multi||!1,this.styleAliases=l(s.styleAliases||null),i.indexOf(this.kind)===-1)throw new e('Unknown kind "'+this.kind+'" is specified for "'+o+'" YAML type.')}return mi=a,mi}var gi,al;function ma(){if(al)return gi;al=1;const e=Wn(),n=re();function i(o,s){const d=[];return o[s].forEach(function(h){let u=d.length;d.forEach(function(p,f){p.tag===h.tag&&p.kind===h.kind&&p.multi===h.multi&&(u=f)}),d[u]=h}),d}function l(){const o={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function s(d){d.multi?(o.multi[d.kind].push(d),o.multi.fallback.push(d)):o[d.kind][d.tag]=o.fallback[d.tag]=d}for(let d=0,h=arguments.length;d<h;d+=1)arguments[d].forEach(s);return o}function a(o){return this.extend(o)}return a.prototype.extend=function(s){let d=[],h=[];if(s instanceof n)h.push(s);else if(Array.isArray(s))h=h.concat(s);else if(s&&(Array.isArray(s.implicit)||Array.isArray(s.explicit)))s.implicit&&(d=d.concat(s.implicit)),s.explicit&&(h=h.concat(s.explicit));else throw new e("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");d.forEach(function(p){if(!(p instanceof n))throw new e("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(p.loadKind&&p.loadKind!=="scalar")throw new e("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(p.multi)throw new e("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),h.forEach(function(p){if(!(p instanceof n))throw new e("Specified list of YAML types (or a single Type object) contains a non-Type object.")});const u=Object.create(a.prototype);return u.implicit=(this.implicit||[]).concat(d),u.explicit=(this.explicit||[]).concat(h),u.compiledImplicit=i(u,"implicit"),u.compiledExplicit=i(u,"explicit"),u.compiledTypeMap=l(u.compiledImplicit,u.compiledExplicit),u},gi=a,gi}var yi,ol;function ga(){if(ol)return yi;ol=1;const e=re();return yi=new e("tag:yaml.org,2002:str",{kind:"scalar",construct:function(n){return n!==null?n:""}}),yi}var bi,cl;function ya(){if(cl)return bi;cl=1;const e=re();return bi=new e("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(n){return n!==null?n:[]}}),bi}var ki,sl;function ba(){if(sl)return ki;sl=1;const e=re();return ki=new e("tag:yaml.org,2002:map",{kind:"mapping",construct:function(n){return n!==null?n:{}}}),ki}var wi,ul;function ka(){if(ul)return wi;ul=1;const e=ma();return wi=new e({explicit:[ga(),ya(),ba()]}),wi}var Si,dl;function wa(){if(dl)return Si;dl=1;const e=re();function n(a){if(a===null)return!0;const o=a.length;return o===1&&a==="~"||o===4&&(a==="null"||a==="Null"||a==="NULL")}function i(){return null}function l(a){return a===null}return Si=new e("tag:yaml.org,2002:null",{kind:"scalar",resolve:n,construct:i,predicate:l,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"}),Si}var Ai,fl;function Sa(){if(fl)return Ai;fl=1;const e=re();function n(a){if(a===null)return!1;const o=a.length;return o===4&&(a==="true"||a==="True"||a==="TRUE")||o===5&&(a==="false"||a==="False"||a==="FALSE")}function i(a){return a==="true"||a==="True"||a==="TRUE"}function l(a){return Object.prototype.toString.call(a)==="[object Boolean]"}return Ai=new e("tag:yaml.org,2002:bool",{kind:"scalar",resolve:n,construct:i,predicate:l,represent:{lowercase:function(a){return a?"true":"false"},uppercase:function(a){return a?"TRUE":"FALSE"},camelcase:function(a){return a?"True":"False"}},defaultStyle:"lowercase"}),Ai}var Ci,hl;function Aa(){if(hl)return Ci;hl=1;const e=qn(),n=re();function i(u){return u>=48&&u<=57||u>=65&&u<=70||u>=97&&u<=102}function l(u){return u>=48&&u<=55}function a(u){return u>=48&&u<=57}function o(u){if(u===null)return!1;const p=u.length;let f=0,T=!1;if(!p)return!1;let y=u[f];if((y==="-"||y==="+")&&(y=u[++f]),y==="0"){if(f+1===p)return!0;if(y=u[++f],y==="b"){for(f++;f<p;f++){if(y=u[f],y!=="0"&&y!=="1")return!1;T=!0}return T&&isFinite(s(u))}if(y==="x"){for(f++;f<p;f++){if(!i(u.charCodeAt(f)))return!1;T=!0}return T&&isFinite(s(u))}if(y==="o"){for(f++;f<p;f++){if(!l(u.charCodeAt(f)))return!1;T=!0}return T&&isFinite(s(u))}}for(;f<p;f++){if(!a(u.charCodeAt(f)))return!1;T=!0}return T?isFinite(s(u)):!1}function s(u){let p=u,f=1,T=p[0];if((T==="-"||T==="+")&&(T==="-"&&(f=-1),p=p.slice(1),T=p[0]),p==="0")return 0;if(T==="0"){if(p[1]==="b")return f*parseInt(p.slice(2),2);if(p[1]==="x")return f*parseInt(p.slice(2),16);if(p[1]==="o")return f*parseInt(p.slice(2),8)}return f*parseInt(p,10)}function d(u){return s(u)}function h(u){return Object.prototype.toString.call(u)==="[object Number]"&&u%1===0&&!e.isNegativeZero(u)}return Ci=new n("tag:yaml.org,2002:int",{kind:"scalar",resolve:o,construct:d,predicate:h,represent:{binary:function(u){return u>=0?"0b"+u.toString(2):"-0b"+u.toString(2).slice(1)},octal:function(u){return u>=0?"0o"+u.toString(8):"-0o"+u.toString(8).slice(1)},decimal:function(u){return u.toString(10)},hexadecimal:function(u){return u>=0?"0x"+u.toString(16).toUpperCase():"-0x"+u.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Ci}var xi,pl;function Ca(){if(pl)return xi;pl=1;const e=qn(),n=re(),i=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),l=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function a(u){return u===null||!i.test(u)?!1:isFinite(parseFloat(u,10))?!0:l.test(u)}function o(u){let p=u.toLowerCase();const f=p[0]==="-"?-1:1;return"+-".indexOf(p[0])>=0&&(p=p.slice(1)),p===".inf"?f===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:p===".nan"?NaN:f*parseFloat(p,10)}const s=/^[-+]?[0-9]+e/;function d(u,p){if(isNaN(u))switch(p){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===u)switch(p){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===u)switch(p){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(e.isNegativeZero(u))return"-0.0";const f=u.toString(10);return s.test(f)?f.replace("e",".e"):f}function h(u){return Object.prototype.toString.call(u)==="[object Number]"&&(u%1!==0||e.isNegativeZero(u))}return xi=new n("tag:yaml.org,2002:float",{kind:"scalar",resolve:a,construct:o,predicate:h,represent:d,defaultStyle:"lowercase"}),xi}var Ti,vl;function xa(){return vl||(vl=1,Ti=ka().extend({implicit:[wa(),Sa(),Aa(),Ca()]})),Ti}var Ei,_l;function Ta(){return _l||(_l=1,Ei=xa()),Ei}var Oi,ml;function Ea(){if(ml)return Oi;ml=1;const e=re(),n=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),i=new 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 l(s){return s===null?!1:n.exec(s)!==null||i.exec(s)!==null}function a(s){let d=0,h=null,u=n.exec(s);if(u===null&&(u=i.exec(s)),u===null)throw new Error("Date resolve error");const p=+u[1],f=+u[2]-1,T=+u[3];if(!u[4])return new Date(Date.UTC(p,f,T));const y=+u[4],O=+u[5],R=+u[6];if(u[7]){for(d=u[7].slice(0,3);d.length<3;)d+="0";d=+d}if(u[9]){const F=+u[10],M=+(u[11]||0);h=(F*60+M)*6e4,u[9]==="-"&&(h=-h)}const D=new Date(Date.UTC(p,f,T,y,O,R,d));return h&&D.setTime(D.getTime()-h),D}function o(s){return s.toISOString()}return Oi=new e("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:l,construct:a,instanceOf:Date,represent:o}),Oi}var Ni,gl;function Oa(){if(gl)return Ni;gl=1;const e=re();function n(i){return i==="<<"||i===null}return Ni=new e("tag:yaml.org,2002:merge",{kind:"scalar",resolve:n}),Ni}var Ii,yl;function Na(){if(yl)return Ii;yl=1;const e=re(),n=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
15
+ \r`;function i(s){if(s===null)return!1;let d=0;const h=s.length,u=n;for(let p=0;p<h;p++){const f=u.indexOf(s.charAt(p));if(!(f>64)){if(f<0)return!1;d+=6}}return d%8===0}function l(s){const d=s.replace(/[\r\n=]/g,""),h=d.length,u=n;let p=0;const f=[];for(let y=0;y<h;y++)y%4===0&&y&&(f.push(p>>16&255),f.push(p>>8&255),f.push(p&255)),p=p<<6|u.indexOf(d.charAt(y));const T=h%4*6;return T===0?(f.push(p>>16&255),f.push(p>>8&255),f.push(p&255)):T===18?(f.push(p>>10&255),f.push(p>>2&255)):T===12&&f.push(p>>4&255),new Uint8Array(f)}function a(s){let d="",h=0;const u=s.length,p=n;for(let T=0;T<u;T++)T%3===0&&T&&(d+=p[h>>18&63],d+=p[h>>12&63],d+=p[h>>6&63],d+=p[h&63]),h=(h<<8)+s[T];const f=u%3;return f===0?(d+=p[h>>18&63],d+=p[h>>12&63],d+=p[h>>6&63],d+=p[h&63]):f===2?(d+=p[h>>10&63],d+=p[h>>4&63],d+=p[h<<2&63],d+=p[64]):f===1&&(d+=p[h>>2&63],d+=p[h<<4&63],d+=p[64],d+=p[64]),d}function o(s){return Object.prototype.toString.call(s)==="[object Uint8Array]"}return Ii=new e("tag:yaml.org,2002:binary",{kind:"scalar",resolve:i,construct:l,predicate:o,represent:a}),Ii}var Ri,bl;function Ia(){if(bl)return Ri;bl=1;const e=re(),n=Object.prototype.hasOwnProperty,i=Object.prototype.toString;function l(o){if(o===null)return!0;const s=[],d=o;for(let h=0,u=d.length;h<u;h+=1){const p=d[h];let f=!1;if(i.call(p)!=="[object Object]")return!1;let T;for(T in p)if(n.call(p,T))if(!f)f=!0;else return!1;if(!f)return!1;if(s.indexOf(T)===-1)s.push(T);else return!1}return!0}function a(o){return o!==null?o:[]}return Ri=new e("tag:yaml.org,2002:omap",{kind:"sequence",resolve:l,construct:a}),Ri}var Li,kl;function Ra(){if(kl)return Li;kl=1;const e=re(),n=Object.prototype.toString;function i(a){if(a===null)return!0;const o=a,s=new Array(o.length);for(let d=0,h=o.length;d<h;d+=1){const u=o[d];if(n.call(u)!=="[object Object]")return!1;const p=Object.keys(u);if(p.length!==1)return!1;s[d]=[p[0],u[p[0]]]}return!0}function l(a){if(a===null)return[];const o=a,s=new Array(o.length);for(let d=0,h=o.length;d<h;d+=1){const u=o[d],p=Object.keys(u);s[d]=[p[0],u[p[0]]]}return s}return Li=new e("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:i,construct:l}),Li}var $i,wl;function La(){if(wl)return $i;wl=1;const e=re(),n=Object.prototype.hasOwnProperty;function i(a){if(a===null)return!0;const o=a;for(const s in o)if(n.call(o,s)&&o[s]!==null)return!1;return!0}function l(a){return a!==null?a:{}}return $i=new e("tag:yaml.org,2002:set",{kind:"mapping",resolve:i,construct:l}),$i}var Pi,Sl;function kr(){return Sl||(Sl=1,Pi=Ta().extend({implicit:[Ea(),Oa()],explicit:[Na(),Ia(),Ra(),La()]})),Pi}var Al;function nc(){if(Al)return ct;Al=1;const e=qn(),n=Wn(),i=ec(),l=kr(),a=Object.prototype.hasOwnProperty,o=1,s=2,d=3,h=4,u=1,p=2,f=3,T=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,y=/[\x85\u2028\u2029]/,O=/[,\[\]{}]/,R=/^(?:!|!!|![0-9A-Za-z-]+!)$/,D=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function F(t){return Object.prototype.toString.call(t)}function M(t){return t===10||t===13}function q(t){return t===9||t===32}function Y(t){return t===9||t===32||t===10||t===13}function le(t){return t===44||t===91||t===93||t===123||t===125}function Ge(t){if(t>=48&&t<=57)return t-48;const v=t|32;return v>=97&&v<=102?v-97+10:-1}function Ce(t){return t===120?2:t===117?4:t===85?8:0}function xe(t){return t>=48&&t<=57?t-48:-1}function ee(t){switch(t){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
16
+ `;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" ";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function ue(t){return t<=65535?String.fromCharCode(t):String.fromCharCode((t-65536>>10)+55296,(t-65536&1023)+56320)}function _n(t,v,b){v==="__proto__"?Object.defineProperty(t,v,{configurable:!0,enumerable:!0,writable:!0,value:b}):t[v]=b}const Kn=new Array(256),mn=new Array(256);for(let t=0;t<256;t++)Kn[t]=ee(t)?1:0,mn[t]=ee(t);function Z(t,v){this.input=t,this.filename=v.filename||null,this.schema=v.schema||l,this.onWarning=v.onWarning||null,this.legacy=v.legacy||!1,this.json=v.json||!1,this.listener=v.listener||null,this.maxDepth=typeof v.maxDepth=="number"?v.maxDepth:100,this.maxTotalMergeKeys=typeof v.maxTotalMergeKeys=="number"?v.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.totalMergeKeys=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function Gn(t,v){const b={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return b.snippet=i(b),new n(v,b)}function L(t,v){throw Gn(t,v)}function Ve(t,v){t.onWarning&&t.onWarning.call(null,Gn(t,v))}function fe(t,v,b){const S=t.anchorMapTransactions;if(S.length!==0){const g=S[S.length-1];a.call(g,v)||(g[v]={existed:a.call(t.anchorMap,v),value:t.anchorMap[v]})}t.anchorMap[v]=b}function ai(t){t.anchorMapTransactions.push(Object.create(null))}function Le(t){const v=t.anchorMapTransactions.pop(),b=t.anchorMapTransactions;if(b.length===0)return;const S=b[b.length-1],g=Object.keys(v);for(let E=0,c=g.length;E<c;E+=1){const _=g[E];a.call(S,_)||(S[_]=v[_])}}function oi(t){const v=t.anchorMapTransactions.pop(),b=Object.keys(v);for(let S=b.length-1;S>=0;S-=1){const g=v[b[S]];g.existed?t.anchorMap[b[S]]=g.value:delete t.anchorMap[b[S]]}}function gn(t){return{position:t.position,line:t.line,lineStart:t.lineStart,lineIndent:t.lineIndent,firstTabInLine:t.firstTabInLine,tag:t.tag,anchor:t.anchor,kind:t.kind,result:t.result}}function Je(t,v){t.position=v.position,t.line=v.line,t.lineStart=v.lineStart,t.lineIndent=v.lineIndent,t.firstTabInLine=v.firstTabInLine,t.tag=v.tag,t.anchor=v.anchor,t.kind=v.kind,t.result=v.result}const Vn={YAML:function(v,b,S){v.version!==null&&L(v,"duplication of %YAML directive"),S.length!==1&&L(v,"YAML directive accepts exactly one argument");const g=/^([0-9]+)\.([0-9]+)$/.exec(S[0]);g===null&&L(v,"ill-formed argument of the YAML directive");const E=parseInt(g[1],10),c=parseInt(g[2],10);E!==1&&L(v,"unacceptable YAML version of the document"),v.version=S[0],v.checkLineBreaks=c<2,c!==1&&c!==2&&Ve(v,"unsupported YAML version of the document")},TAG:function(v,b,S){let g;S.length!==2&&L(v,"TAG directive accepts exactly two arguments");const E=S[0];g=S[1],R.test(E)||L(v,"ill-formed tag handle (first argument) of the TAG directive"),a.call(v.tagMap,E)&&L(v,'there is a previously declared suffix for "'+E+'" tag handle'),D.test(g)||L(v,"ill-formed tag prefix (second argument) of the TAG directive");try{g=decodeURIComponent(g)}catch{L(v,"tag prefix is malformed: "+g)}v.tagMap[E]=g}};function ae(t,v,b,S){if(v<b){const g=t.input.slice(v,b);if(S)for(let E=0,c=g.length;E<c;E+=1){const _=g.charCodeAt(E);_===9||_>=32&&_<=1114111||L(t,"expected valid JSON character")}else T.test(g)&&L(t,"the stream contains non-printable characters");t.result+=g}}function Te(t,v,b,S){e.isObject(b)||L(t,"cannot merge mappings; the provided source object is unacceptable");const g=Object.keys(b);for(let E=0,c=g.length;E<c;E+=1){const _=g[E];t.maxTotalMergeKeys!==-1&&++t.totalMergeKeys>t.maxTotalMergeKeys&&L(t,"merge keys exceeded maxTotalMergeKeys ("+t.maxTotalMergeKeys+")"),a.call(v,_)||(_n(v,_,b[_]),S[_]=!0)}}function he(t,v,b,S,g,E,c,_,C){if(Array.isArray(g)){g=Array.prototype.slice.call(g);for(let k=0,w=g.length;k<w;k+=1)Array.isArray(g[k])&&L(t,"nested arrays are not supported inside keys"),typeof g=="object"&&F(g[k])==="[object Object]"&&(g[k]="[object Object]")}if(typeof g=="object"&&F(g)==="[object Object]"&&(g="[object Object]"),g=String(g),v===null&&(v={}),S==="tag:yaml.org,2002:merge")if(Array.isArray(E))for(let k=0,w=E.length;k<w;k+=1)Te(t,v,E[k],b);else Te(t,v,E,b);else!t.json&&!a.call(b,g)&&a.call(v,g)&&(t.line=c||t.line,t.lineStart=_||t.lineStart,t.position=C||t.position,L(t,"duplicated mapping key")),_n(v,g,E),delete b[g];return v}function Qe(t){const v=t.input.charCodeAt(t.position);v===10?t.position++:v===13?(t.position++,t.input.charCodeAt(t.position)===10&&t.position++):L(t,"a line break is expected"),t.line+=1,t.lineStart=t.position,t.firstTabInLine=-1}function z(t,v,b){let S=0,g=t.input.charCodeAt(t.position);for(;g!==0;){for(;q(g);)g===9&&t.firstTabInLine===-1&&(t.firstTabInLine=t.position),g=t.input.charCodeAt(++t.position);if(v&&g===35)do g=t.input.charCodeAt(++t.position);while(g!==10&&g!==13&&g!==0);if(M(g))for(Qe(t),g=t.input.charCodeAt(t.position),S++,t.lineIndent=0;g===32;)t.lineIndent++,g=t.input.charCodeAt(++t.position);else break}return b!==-1&&S!==0&&t.lineIndent<b&&Ve(t,"deficient indentation"),S}function Ze(t){let v=t.position,b=t.input.charCodeAt(v);return!!((b===45||b===46)&&b===t.input.charCodeAt(v+1)&&b===t.input.charCodeAt(v+2)&&(v+=3,b=t.input.charCodeAt(v),b===0||Y(b)))}function pe(t,v){v===1?t.result+=" ":v>1&&(t.result+=e.repeat(`
17
+ `,v-1))}function Jn(t,v,b){let S,g,E,c,_,C;const k=t.kind,w=t.result;let x=t.input.charCodeAt(t.position);if(Y(x)||le(x)||x===35||x===38||x===42||x===33||x===124||x===62||x===39||x===34||x===37||x===64||x===96)return!1;if(x===63||x===45){const A=t.input.charCodeAt(t.position+1);if(Y(A)||b&&le(A))return!1}for(t.kind="scalar",t.result="",S=g=t.position,E=!1;x!==0;){if(x===58){const A=t.input.charCodeAt(t.position+1);if(Y(A)||b&&le(A))break}else if(x===35){const A=t.input.charCodeAt(t.position-1);if(Y(A))break}else{if(t.position===t.lineStart&&Ze(t)||b&&le(x))break;if(M(x))if(c=t.line,_=t.lineStart,C=t.lineIndent,z(t,!1,-1),t.lineIndent>=v){E=!0,x=t.input.charCodeAt(t.position);continue}else{t.position=g,t.line=c,t.lineStart=_,t.lineIndent=C;break}}E&&(ae(t,S,g,!1),pe(t,t.line-c),S=g=t.position,E=!1),q(x)||(g=t.position+1),x=t.input.charCodeAt(++t.position)}return ae(t,S,g,!1),t.result?!0:(t.kind=k,t.result=w,!1)}function Qn(t,v){let b,S,g=t.input.charCodeAt(t.position);if(g!==39)return!1;for(t.kind="scalar",t.result="",t.position++,b=S=t.position;(g=t.input.charCodeAt(t.position))!==0;)if(g===39)if(ae(t,b,t.position,!0),g=t.input.charCodeAt(++t.position),g===39)b=t.position,t.position++,S=t.position;else return!0;else M(g)?(ae(t,b,S,!0),pe(t,z(t,!1,v)),b=S=t.position):t.position===t.lineStart&&Ze(t)?L(t,"unexpected end of the document within a single quoted scalar"):(t.position++,q(g)||(S=t.position));L(t,"unexpected end of the stream within a single quoted scalar")}function yn(t,v){let b,S,g,E=t.input.charCodeAt(t.position);if(E!==34)return!1;for(t.kind="scalar",t.result="",t.position++,b=S=t.position;(E=t.input.charCodeAt(t.position))!==0;){if(E===34)return ae(t,b,t.position,!0),t.position++,!0;if(E===92){if(ae(t,b,t.position,!0),E=t.input.charCodeAt(++t.position),M(E))z(t,!1,v);else if(E<256&&Kn[E])t.result+=mn[E],t.position++;else if((g=Ce(E))>0){let c=g,_=0;for(;c>0;c--)E=t.input.charCodeAt(++t.position),(g=Ge(E))>=0?_=(_<<4)+g:L(t,"expected hexadecimal character");t.result+=ue(_),t.position++}else L(t,"unknown escape sequence");b=S=t.position}else M(E)?(ae(t,b,S,!0),pe(t,z(t,!1,v)),b=S=t.position):t.position===t.lineStart&&Ze(t)?L(t,"unexpected end of the document within a double quoted scalar"):(t.position++,q(E)||(S=t.position))}L(t,"unexpected end of the stream within a double quoted scalar")}function Zn(t,v){let b=!0,S,g,E;const c=t.tag;let _;const C=t.anchor;let k,w,x,A;const I=Object.create(null);let N,$,P,U=t.input.charCodeAt(t.position);if(U===91)k=93,A=!1,_=[];else if(U===123)k=125,A=!0,_={};else return!1;for(t.anchor!==null&&fe(t,t.anchor,_),U=t.input.charCodeAt(++t.position);U!==0;){if(z(t,!0,v),U=t.input.charCodeAt(t.position),U===k)return t.position++,t.tag=c,t.anchor=C,t.kind=A?"mapping":"sequence",t.result=_,!0;if(b?U===44&&L(t,"expected the node content, but found ','"):L(t,"missed comma between flow collection entries"),$=N=P=null,w=x=!1,U===63){const W=t.input.charCodeAt(t.position+1);Y(W)&&(w=x=!0,t.position++,z(t,!0,v))}S=t.line,g=t.lineStart,E=t.position,_e(t,v,o,!1,!0),$=t.tag,N=t.result,z(t,!0,v),U=t.input.charCodeAt(t.position),(x||t.line===S)&&U===58&&(w=!0,U=t.input.charCodeAt(++t.position),z(t,!0,v),_e(t,v,o,!1,!0),P=t.result),A?he(t,_,I,$,N,P,S,g,E):w?_.push(he(t,null,I,$,N,P,S,g,E)):_.push(N),z(t,!0,v),U=t.input.charCodeAt(t.position),U===44?(b=!0,U=t.input.charCodeAt(++t.position)):b=!1}L(t,"unexpected end of the stream within a flow collection")}function Xn(t,v){let b,S=u,g=!1,E=!1,c=v,_=0,C=!1,k,w=t.input.charCodeAt(t.position);if(w===124)b=!1;else if(w===62)b=!0;else return!1;for(t.kind="scalar",t.result="";w!==0;)if(w=t.input.charCodeAt(++t.position),w===43||w===45)u===S?S=w===43?f:p:L(t,"repeat of a chomping mode identifier");else if((k=xe(w))>=0)k===0?L(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):E?L(t,"repeat of an indentation width identifier"):(c=v+k-1,E=!0);else break;if(q(w)){do w=t.input.charCodeAt(++t.position);while(q(w));if(w===35)do w=t.input.charCodeAt(++t.position);while(!M(w)&&w!==0)}for(;w!==0;){for(Qe(t),t.lineIndent=0,w=t.input.charCodeAt(t.position);(!E||t.lineIndent<c)&&w===32;)t.lineIndent++,w=t.input.charCodeAt(++t.position);if(!E&&t.lineIndent>c&&(c=t.lineIndent),M(w)){_++;continue}if(!E&&c===0&&L(t,"missing indentation for block scalar"),t.lineIndent<c){S===f?t.result+=e.repeat(`
18
+ `,g?1+_:_):S===u&&g&&(t.result+=`
19
+ `);break}b?q(w)?(C=!0,t.result+=e.repeat(`
20
+ `,g?1+_:_)):C?(C=!1,t.result+=e.repeat(`
21
+ `,_+1)):_===0?g&&(t.result+=" "):t.result+=e.repeat(`
22
+ `,_):t.result+=e.repeat(`
23
+ `,g?1+_:_),g=!0,E=!0,_=0;const x=t.position;for(;!M(w)&&w!==0;)w=t.input.charCodeAt(++t.position);ae(t,x,t.position,!1)}return!0}function ve(t,v){const b=t.tag,S=t.anchor,g=[];let E=!1;if(t.firstTabInLine!==-1)return!1;t.anchor!==null&&fe(t,t.anchor,g);let c=t.input.charCodeAt(t.position);for(;c!==0&&(t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,L(t,"tab characters must not be used in indentation")),c===45);){const _=t.input.charCodeAt(t.position+1);if(!Y(_))break;if(E=!0,t.position++,z(t,!0,-1)&&t.lineIndent<=v){g.push(null),c=t.input.charCodeAt(t.position);continue}const C=t.line;if(_e(t,v,d,!1,!0),g.push(t.result),z(t,!0,-1),c=t.input.charCodeAt(t.position),(t.line===C||t.lineIndent>v)&&c!==0)L(t,"bad indentation of a sequence entry");else if(t.lineIndent<v)break}return E?(t.tag=b,t.anchor=S,t.kind="sequence",t.result=g,!0):!1}function et(t,v,b){let S,g,E,c;const _=t.tag,C=t.anchor,k={},w=Object.create(null);let x=null,A=null,I=null,N=!1,$=!1;if(t.firstTabInLine!==-1)return!1;t.anchor!==null&&fe(t,t.anchor,k);let P=t.input.charCodeAt(t.position);for(;P!==0;){!N&&t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,L(t,"tab characters must not be used in indentation"));const U=t.input.charCodeAt(t.position+1),W=t.line;if((P===63||P===58)&&Y(U))P===63?(N&&(he(t,k,w,x,A,null,g,E,c),x=A=I=null),$=!0,N=!0,S=!0):N?(N=!1,S=!0):L(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,P=U;else{if(g=t.line,E=t.lineStart,c=t.position,!_e(t,b,s,!1,!0))break;if(t.line===W){for(P=t.input.charCodeAt(t.position);q(P);)P=t.input.charCodeAt(++t.position);if(P===58)P=t.input.charCodeAt(++t.position),Y(P)||L(t,"a whitespace character is expected after the key-value separator within a block mapping"),N&&(he(t,k,w,x,A,null,g,E,c),x=A=I=null),$=!0,N=!1,S=!1,x=t.tag,A=t.result;else if($)L(t,"can not read an implicit mapping pair; a colon is missed");else return t.tag=_,t.anchor=C,!0}else if($)L(t,"can not read a block mapping entry; a multiline key may not be an implicit key");else return t.tag=_,t.anchor=C,!0}if((t.line===W||t.lineIndent>v)&&(N&&(g=t.line,E=t.lineStart,c=t.position),_e(t,v,h,!0,S)&&(N?A=t.result:I=t.result),N||(he(t,k,w,x,A,I,g,E,c),x=A=I=null),z(t,!0,-1),P=t.input.charCodeAt(t.position)),(t.line===W||t.lineIndent>v)&&P!==0)L(t,"bad indentation of a mapping entry");else if(t.lineIndent<v)break}return N&&he(t,k,w,x,A,null,g,E,c),$&&(t.tag=_,t.anchor=C,t.kind="mapping",t.result=k),$}function ci(t){let v=!1,b=!1,S,g,E=t.input.charCodeAt(t.position);if(E!==33)return!1;t.tag!==null&&L(t,"duplication of a tag property"),E=t.input.charCodeAt(++t.position),E===60?(v=!0,E=t.input.charCodeAt(++t.position)):E===33?(b=!0,S="!!",E=t.input.charCodeAt(++t.position)):S="!";let c=t.position;if(v){do E=t.input.charCodeAt(++t.position);while(E!==0&&E!==62);t.position<t.length?(g=t.input.slice(c,t.position),E=t.input.charCodeAt(++t.position)):L(t,"unexpected end of the stream within a verbatim tag")}else{for(;E!==0&&!Y(E);)E===33&&(b?L(t,"tag suffix cannot contain exclamation marks"):(S=t.input.slice(c-1,t.position+1),R.test(S)||L(t,"named tag handle cannot contain such characters"),b=!0,c=t.position+1)),E=t.input.charCodeAt(++t.position);g=t.input.slice(c,t.position),O.test(g)&&L(t,"tag suffix cannot contain flow indicator characters")}g&&!D.test(g)&&L(t,"tag name cannot contain such characters: "+g);try{g=decodeURIComponent(g)}catch{L(t,"tag name is malformed: "+g)}return v?t.tag=g:a.call(t.tagMap,S)?t.tag=t.tagMap[S]+g:S==="!"?t.tag="!"+g:S==="!!"?t.tag="tag:yaml.org,2002:"+g:L(t,'undeclared tag handle "'+S+'"'),!0}function nt(t){let v=t.input.charCodeAt(t.position);if(v!==38)return!1;t.anchor!==null&&L(t,"duplication of an anchor property"),v=t.input.charCodeAt(++t.position);const b=t.position;for(;v!==0&&!Y(v)&&!le(v);)v=t.input.charCodeAt(++t.position);return t.position===b&&L(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(b,t.position),!0}function tt(t){let v=t.input.charCodeAt(t.position);if(v!==42)return!1;v=t.input.charCodeAt(++t.position);const b=t.position;for(;v!==0&&!Y(v)&&!le(v);)v=t.input.charCodeAt(++t.position);t.position===b&&L(t,"name of an alias node must contain at least one character");const S=t.input.slice(b,t.position);return a.call(t.anchorMap,S)||L(t,'unidentified alias "'+S+'"'),t.result=t.anchorMap[S],z(t,!0,-1),!0}function si(t,v,b,S){const g=gn(t);return ai(t),Je(t,v),t.tag=null,t.anchor=null,t.kind=null,t.result=null,et(t,b,S)&&t.kind==="mapping"?(Le(t),!0):(oi(t),Je(t,g),!1)}function _e(t,v,b,S,g){let E,c,_=1,C=!1,k=!1,w=null,x,A,I;t.depth>=t.maxDepth&&L(t,"nesting exceeded maxDepth ("+t.maxDepth+")"),t.depth+=1,t.listener!==null&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null;const N=E=c=h===b||d===b;if(S&&z(t,!0,-1)&&(C=!0,t.lineIndent>v?_=1:t.lineIndent===v?_=0:t.lineIndent<v&&(_=-1)),_===1)for(;;){const $=t.input.charCodeAt(t.position),P=gn(t);if(C&&($===33&&t.tag!==null||$===38&&t.anchor!==null)||!ci(t)&&!nt(t))break;w===null&&(w=P),z(t,!0,-1)?(C=!0,c=N,t.lineIndent>v?_=1:t.lineIndent===v?_=0:t.lineIndent<v&&(_=-1)):c=!1}if(c&&(c=C||g),_===1||h===b)if(o===b||s===b?A=v:A=v+1,I=t.position-t.lineStart,_===1)if(c&&(ve(t,I)||et(t,I,A))||Zn(t,A))k=!0;else{const $=t.input.charCodeAt(t.position);w!==null&&N&&!c&&$!==124&&$!==62&&si(t,w,w.position-w.lineStart,A)||E&&Xn(t,A)||Qn(t,A)||yn(t,A)?k=!0:tt(t)?(k=!0,(t.tag!==null||t.anchor!==null)&&L(t,"alias node should not have any properties")):Jn(t,A,o===b)&&(k=!0,t.tag===null&&(t.tag="?")),t.anchor!==null&&fe(t,t.anchor,t.result)}else _===0&&(k=c&&ve(t,I));if(t.tag===null)t.anchor!==null&&fe(t,t.anchor,t.result);else if(t.tag==="?"){t.result!==null&&t.kind!=="scalar"&&L(t,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+t.kind+'"');for(let $=0,P=t.implicitTypes.length;$<P;$+=1)if(x=t.implicitTypes[$],x.resolve(t.result)){t.result=x.construct(t.result),t.tag=x.tag,t.anchor!==null&&fe(t,t.anchor,t.result);break}}else if(t.tag!=="!"){if(a.call(t.typeMap[t.kind||"fallback"],t.tag))x=t.typeMap[t.kind||"fallback"][t.tag];else{x=null;const $=t.typeMap.multi[t.kind||"fallback"];for(let P=0,U=$.length;P<U;P+=1)if(t.tag.slice(0,$[P].tag.length)===$[P].tag){x=$[P];break}}x||L(t,"unknown tag !<"+t.tag+">"),t.result!==null&&x.kind!==t.kind&&L(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+x.kind+'", not "'+t.kind+'"'),x.resolve(t.result,t.tag)?(t.result=x.construct(t.result,t.tag),t.anchor!==null&&fe(t,t.anchor,t.result)):L(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.depth-=1,t.tag!==null||t.anchor!==null||k}function ui(t){const v=t.position;let b=!1,S;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(S=t.input.charCodeAt(t.position))!==0&&(z(t,!0,-1),S=t.input.charCodeAt(t.position),!(t.lineIndent>0||S!==37));){b=!0,S=t.input.charCodeAt(++t.position);let g=t.position;for(;S!==0&&!Y(S);)S=t.input.charCodeAt(++t.position);const E=t.input.slice(g,t.position),c=[];for(E.length<1&&L(t,"directive name must not be less than one character in length");S!==0;){for(;q(S);)S=t.input.charCodeAt(++t.position);if(S===35){do S=t.input.charCodeAt(++t.position);while(S!==0&&!M(S));break}if(M(S))break;for(g=t.position;S!==0&&!Y(S);)S=t.input.charCodeAt(++t.position);c.push(t.input.slice(g,t.position))}S!==0&&Qe(t),a.call(Vn,E)?Vn[E](t,E,c):Ve(t,'unknown document directive "'+E+'"')}if(z(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,z(t,!0,-1)):b&&L(t,"directives end mark is expected"),_e(t,t.lineIndent-1,h,!1,!0),z(t,!0,-1),t.checkLineBreaks&&y.test(t.input.slice(v,t.position))&&Ve(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&Ze(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,z(t,!0,-1));return}t.position<t.length-1&&L(t,"end of the stream or a document separator is expected")}function it(t,v){t=String(t),v=v||{},t.length!==0&&(t.charCodeAt(t.length-1)!==10&&t.charCodeAt(t.length-1)!==13&&(t+=`
24
+ `),t.charCodeAt(0)===65279&&(t=t.slice(1)));const b=new Z(t,v),S=t.indexOf("\0");for(S!==-1&&(b.position=S,L(b,"null byte is not allowed in input")),b.input+="\0";b.input.charCodeAt(b.position)===32;)b.lineIndent+=1,b.position+=1;for(;b.position<b.length-1;)ui(b);return b.documents}function rt(t,v,b){v!==null&&typeof v=="object"&&typeof b>"u"&&(b=v,v=null);const S=it(t,b);if(typeof v!="function")return S;for(let g=0,E=S.length;g<E;g+=1)v(S[g])}function di(t,v){const b=it(t,v);if(b.length!==0){if(b.length===1)return b[0];throw new n("expected a single document in the stream, but found more")}}return ct.loadAll=rt,ct.load=di,ct}var Mi={},Cl;function tc(){if(Cl)return Mi;Cl=1;const e=qn(),n=Wn(),i=kr(),l=Object.prototype.toString,a=Object.prototype.hasOwnProperty,o=65279,s=9,d=10,h=13,u=32,p=33,f=34,T=35,y=37,O=38,R=39,D=42,F=44,M=45,q=58,Y=61,le=62,Ge=63,Ce=64,xe=91,ee=93,ue=96,_n=123,Kn=124,mn=125,Z={};Z[0]="\\0",Z[7]="\\a",Z[8]="\\b",Z[9]="\\t",Z[10]="\\n",Z[11]="\\v",Z[12]="\\f",Z[13]="\\r",Z[27]="\\e",Z[34]='\\"',Z[92]="\\\\",Z[133]="\\N",Z[160]="\\_",Z[8232]="\\L",Z[8233]="\\P";const Gn=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],L=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Ve(c,_){if(_===null)return{};const C={},k=Object.keys(_);for(let w=0,x=k.length;w<x;w+=1){let A=k[w],I=String(_[A]);A.slice(0,2)==="!!"&&(A="tag:yaml.org,2002:"+A.slice(2));const N=c.compiledTypeMap.fallback[A];N&&a.call(N.styleAliases,I)&&(I=N.styleAliases[I]),C[A]=I}return C}function fe(c){let _,C;const k=c.toString(16).toUpperCase();if(c<=255)_="x",C=2;else if(c<=65535)_="u",C=4;else if(c<=4294967295)_="U",C=8;else throw new n("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+_+e.repeat("0",C-k.length)+k}const ai=1,Le=2;function oi(c){this.schema=c.schema||i,this.indent=Math.max(1,c.indent||2),this.noArrayIndent=c.noArrayIndent||!1,this.skipInvalid=c.skipInvalid||!1,this.flowLevel=e.isNothing(c.flowLevel)?-1:c.flowLevel,this.styleMap=Ve(this.schema,c.styles||null),this.sortKeys=c.sortKeys||!1,this.lineWidth=c.lineWidth||80,this.noRefs=c.noRefs||!1,this.noCompatMode=c.noCompatMode||!1,this.condenseFlow=c.condenseFlow||!1,this.quotingType=c.quotingType==='"'?Le:ai,this.forceQuotes=c.forceQuotes||!1,this.replacer=typeof c.replacer=="function"?c.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function gn(c,_){const C=e.repeat(" ",_);let k=0,w="";const x=c.length;for(;k<x;){let A;const I=c.indexOf(`
25
+ `,k);I===-1?(A=c.slice(k),k=x):(A=c.slice(k,I+1),k=I+1),A.length&&A!==`
26
+ `&&(w+=C),w+=A}return w}function Je(c,_){return`
27
+ `+e.repeat(" ",c.indent*_)}function Vn(c,_){for(let C=0,k=c.implicitTypes.length;C<k;C+=1)if(c.implicitTypes[C].resolve(_))return!0;return!1}function ae(c){return c===u||c===s}function Te(c){return c>=32&&c<=126||c>=161&&c<=55295&&c!==8232&&c!==8233||c>=57344&&c<=65533&&c!==o||c>=65536&&c<=1114111}function he(c){return Te(c)&&c!==o&&c!==h&&c!==d}function Qe(c,_,C){const k=he(c),w=k&&!ae(c);return(C?k:k&&c!==F&&c!==xe&&c!==ee&&c!==_n&&c!==mn)&&c!==T&&!(_===q&&!w)||he(_)&&!ae(_)&&c===T||_===q&&w}function z(c){return Te(c)&&c!==o&&!ae(c)&&c!==M&&c!==Ge&&c!==q&&c!==F&&c!==xe&&c!==ee&&c!==_n&&c!==mn&&c!==T&&c!==O&&c!==D&&c!==p&&c!==Kn&&c!==Y&&c!==le&&c!==R&&c!==f&&c!==y&&c!==Ce&&c!==ue}function Ze(c){return!ae(c)&&c!==q}function pe(c,_){const C=c.charCodeAt(_);let k;return C>=55296&&C<=56319&&_+1<c.length&&(k=c.charCodeAt(_+1),k>=56320&&k<=57343)?(C-55296)*1024+k-56320+65536:C}function Jn(c){return/^\n* /.test(c)}const Qn=1,yn=2,Zn=3,Xn=4,ve=5;function et(c,_,C,k,w,x,A,I){let N,$=0,P=null,U=!1,W=!1;const Fr=k!==-1;let bn=-1,kn=z(pe(c,0))&&Ze(pe(c,c.length-1));if(_||A)for(N=0;N<c.length;$>=65536?N+=2:N++){if($=pe(c,N),!Te($))return ve;kn=kn&&Qe($,P,I),P=$}else{for(N=0;N<c.length;$>=65536?N+=2:N++){if($=pe(c,N),$===d)U=!0,Fr&&(W=W||N-bn-1>k&&c[bn+1]!==" ",bn=N);else if(!Te($))return ve;kn=kn&&Qe($,P,I),P=$}W=W||Fr&&N-bn-1>k&&c[bn+1]!==" "}return!U&&!W?kn&&!A&&!w(c)?Qn:x===Le?ve:yn:C>9&&Jn(c)?ve:A?x===Le?ve:yn:W?Xn:Zn}function ci(c,_,C,k,w){c.dump=function(){if(_.length===0)return c.quotingType===Le?'""':"''";if(!c.noCompatMode&&(Gn.indexOf(_)!==-1||L.test(_)))return c.quotingType===Le?'"'+_+'"':"'"+_+"'";const x=c.indent*Math.max(1,C),A=c.lineWidth===-1?-1:Math.max(Math.min(c.lineWidth,40),c.lineWidth-x),I=k||c.flowLevel>-1&&C>=c.flowLevel;function N($){return Vn(c,$)}switch(et(_,I,c.indent,A,N,c.quotingType,c.forceQuotes&&!k,w)){case Qn:return _;case yn:return"'"+_.replace(/'/g,"''")+"'";case Zn:return"|"+nt(_,c.indent)+tt(gn(_,x));case Xn:return">"+nt(_,c.indent)+tt(gn(si(_,A),x));case ve:return'"'+ui(_)+'"';default:throw new n("impossible error: invalid scalar style")}}()}function nt(c,_){const C=Jn(c)?String(_):"",k=c[c.length-1]===`
28
+ `,x=k&&(c[c.length-2]===`
29
+ `||c===`
30
+ `)?"+":k?"":"-";return C+x+`
31
+ `}function tt(c){return c[c.length-1]===`
32
+ `?c.slice(0,-1):c}function si(c,_){const C=/(\n+)([^\n]*)/g;let k=function(){let I=c.indexOf(`
33
+ `);return I=I!==-1?I:c.length,C.lastIndex=I,_e(c.slice(0,I),_)}(),w=c[0]===`
34
+ `||c[0]===" ",x,A;for(;A=C.exec(c);){const I=A[1],N=A[2];x=N[0]===" ",k+=I+(!w&&!x&&N!==""?`
35
+ `:"")+_e(N,_),w=x}return k}function _e(c,_){if(c===""||c[0]===" ")return c;const C=/ [^ ]/g;let k,w=0,x,A=0,I=0,N="";for(;k=C.exec(c);)I=k.index,I-w>_&&(x=A>w?A:I,N+=`
36
+ `+c.slice(w,x),w=x+1),A=I;return N+=`
37
+ `,c.length-w>_&&A>w?N+=c.slice(w,A)+`
38
+ `+c.slice(A+1):N+=c.slice(w),N.slice(1)}function ui(c){let _="",C=0;for(let k=0;k<c.length;C>=65536?k+=2:k++){C=pe(c,k);const w=Z[C];!w&&Te(C)?(_+=c[k],C>=65536&&(_+=c[k+1])):_+=w||fe(C)}return _}function it(c,_,C){let k="";const w=c.tag;for(let x=0,A=C.length;x<A;x+=1){let I=C[x];c.replacer&&(I=c.replacer.call(C,String(x),I)),(b(c,_,I,!1,!1)||typeof I>"u"&&b(c,_,null,!1,!1))&&(k!==""&&(k+=","+(c.condenseFlow?"":" ")),k+=c.dump)}c.tag=w,c.dump="["+k+"]"}function rt(c,_,C,k){let w="";const x=c.tag;for(let A=0,I=C.length;A<I;A+=1){let N=C[A];c.replacer&&(N=c.replacer.call(C,String(A),N)),(b(c,_+1,N,!0,!0,!1,!0)||typeof N>"u"&&b(c,_+1,null,!0,!0,!1,!0))&&((!k||w!=="")&&(w+=Je(c,_)),c.dump&&d===c.dump.charCodeAt(0)?w+="-":w+="- ",w+=c.dump)}c.tag=x,c.dump=w||"[]"}function di(c,_,C){let k="";const w=c.tag,x=Object.keys(C);for(let A=0,I=x.length;A<I;A+=1){let N="";k!==""&&(N+=", "),c.condenseFlow&&(N+='"');const $=x[A];let P=C[$];c.replacer&&(P=c.replacer.call(C,$,P)),b(c,_,$,!1,!1)&&(c.dump.length>1024&&(N+="? "),N+=c.dump+(c.condenseFlow?'"':"")+":"+(c.condenseFlow?"":" "),b(c,_,P,!1,!1)&&(N+=c.dump,k+=N))}c.tag=w,c.dump="{"+k+"}"}function t(c,_,C,k){let w="";const x=c.tag,A=Object.keys(C);if(c.sortKeys===!0)A.sort();else if(typeof c.sortKeys=="function")A.sort(c.sortKeys);else if(c.sortKeys)throw new n("sortKeys must be a boolean or a function");for(let I=0,N=A.length;I<N;I+=1){let $="";(!k||w!=="")&&($+=Je(c,_));const P=A[I];let U=C[P];if(c.replacer&&(U=c.replacer.call(C,P,U)),!b(c,_+1,P,!0,!0,!0))continue;const W=c.tag!==null&&c.tag!=="?"||c.dump&&c.dump.length>1024;W&&(c.dump&&d===c.dump.charCodeAt(0)?$+="?":$+="? "),$+=c.dump,W&&($+=Je(c,_)),b(c,_+1,U,!0,W)&&(c.dump&&d===c.dump.charCodeAt(0)?$+=":":$+=": ",$+=c.dump,w+=$)}c.tag=x,c.dump=w||"{}"}function v(c,_,C){const k=C?c.explicitTypes:c.implicitTypes;for(let w=0,x=k.length;w<x;w+=1){const A=k[w];if((A.instanceOf||A.predicate)&&(!A.instanceOf||typeof _=="object"&&_ instanceof A.instanceOf)&&(!A.predicate||A.predicate(_))){if(C?A.multi&&A.representName?c.tag=A.representName(_):c.tag=A.tag:c.tag="?",A.represent){const I=c.styleMap[A.tag]||A.defaultStyle;let N;if(l.call(A.represent)==="[object Function]")N=A.represent(_,I);else if(a.call(A.represent,I))N=A.represent[I](_,I);else throw new n("!<"+A.tag+'> tag resolver accepts not "'+I+'" style');c.dump=N}return!0}}return!1}function b(c,_,C,k,w,x,A){c.tag=null,c.dump=C,v(c,C,!1)||v(c,C,!0);const I=l.call(c.dump),N=k;k&&(k=c.flowLevel<0||c.flowLevel>_);const $=I==="[object Object]"||I==="[object Array]";let P,U;if($&&(P=c.duplicates.indexOf(C),U=P!==-1),(c.tag!==null&&c.tag!=="?"||U||c.indent!==2&&_>0)&&(w=!1),U&&c.usedDuplicates[P])c.dump="*ref_"+P;else{if($&&U&&!c.usedDuplicates[P]&&(c.usedDuplicates[P]=!0),I==="[object Object]")k&&Object.keys(c.dump).length!==0?(t(c,_,c.dump,w),U&&(c.dump="&ref_"+P+c.dump)):(di(c,_,c.dump),U&&(c.dump="&ref_"+P+" "+c.dump));else if(I==="[object Array]")k&&c.dump.length!==0?(c.noArrayIndent&&!A&&_>0?rt(c,_-1,c.dump,w):rt(c,_,c.dump,w),U&&(c.dump="&ref_"+P+c.dump)):(it(c,_,c.dump),U&&(c.dump="&ref_"+P+" "+c.dump));else if(I==="[object String]")c.tag!=="?"&&ci(c,c.dump,_,x,N);else{if(I==="[object Undefined]")return!1;if(c.skipInvalid)return!1;throw new n("unacceptable kind of an object to dump "+I)}if(c.tag!==null&&c.tag!=="?"){let W=encodeURI(c.tag[0]==="!"?c.tag.slice(1):c.tag).replace(/!/g,"%21");c.tag[0]==="!"?W="!"+W:W.slice(0,18)==="tag:yaml.org,2002:"?W="!!"+W.slice(18):W="!<"+W+">",c.dump=W+" "+c.dump}}return!0}function S(c,_){const C=[],k=[];g(c,C,k);const w=k.length;for(let x=0;x<w;x+=1)_.duplicates.push(C[k[x]]);_.usedDuplicates=new Array(w)}function g(c,_,C){if(c!==null&&typeof c=="object"){const k=_.indexOf(c);if(k!==-1)C.indexOf(k)===-1&&C.push(k);else if(_.push(c),Array.isArray(c))for(let w=0,x=c.length;w<x;w+=1)g(c[w],_,C);else{const w=Object.keys(c);for(let x=0,A=w.length;x<A;x+=1)g(c[w[x]],_,C)}}}function E(c,_){_=_||{};const C=new oi(_);C.noRefs||S(c,C);let k=c;return C.replacer&&(k=C.replacer.call({"":k},"",k)),b(C,0,k,!0,!0)?C.dump+`
39
+ `:""}return Mi.dump=E,Mi}var xl;function ic(){if(xl)return ne;xl=1;const e=nc(),n=tc();function i(l,a){return function(){throw new Error("Function yaml."+l+" is removed in js-yaml 4. Use yaml."+a+" instead, which is now safe by default.")}}return ne.Type=re(),ne.Schema=ma(),ne.FAILSAFE_SCHEMA=ka(),ne.JSON_SCHEMA=xa(),ne.CORE_SCHEMA=Ta(),ne.DEFAULT_SCHEMA=kr(),ne.load=e.load,ne.loadAll=e.loadAll,ne.dump=n.dump,ne.YAMLException=Wn(),ne.types={binary:Na(),float:Ca(),map:ba(),null:wa(),pairs:Ra(),set:La(),timestamp:Ea(),bool:Sa(),int:Aa(),merge:Oa(),omap:Ia(),seq:ya(),str:ga()},ne.safeLoad=i("safeLoad","load"),ne.safeLoadAll=i("safeLoadAll","loadAll"),ne.safeDump=i("safeDump","dump"),ne}var rc=ic();const $a=Xo(rc),{Type:au,Schema:ou,FAILSAFE_SCHEMA:cu,JSON_SCHEMA:su,CORE_SCHEMA:uu,DEFAULT_SCHEMA:du,load:fu,loadAll:hu,dump:pu,YAMLException:vu,types:_u,safeLoad:mu,safeLoadAll:gu,safeDump:yu}=$a;function lc(e){if(e.trim()==="")return{};const i=$a.load(e);if(i==null)return{};if(typeof i!="object"||Array.isArray(i))throw new Error(".agent-user.yml must parse to an object");return i}const Tl={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"},El={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"]},ac=[{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"]}],Ol=[{id:"identity",title:"Editor & behaviour",navLabel:"Preferences",subtitle:"Your IDE plus how the agent behaves: autonomy, output verbosity, PR-comment style. 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","personal.minimal_output","personal.play_by_play","personal.pr_comment_bot_icon"]},{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 thresholds.",kind:"form",paths:["rule_loading_tier","cost.budgets.daily","cost.budgets.weekly","cost.budgets.monthly","cost.enforcement","model.auto_switch","tokens.rich_skills","roadmap.quality_cadence","roadmap.dashboard_regen_cadence","quality.local_auto_run","quality.wait_for_remote_ci","memory.review_threshold","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"}];function Pa(e={}){return e.extended===!0?[Tl,El,...ac,...Ol]:[Tl,El,...Ol]}function Jt(e,n={}){const i=Pa(n),l=Math.max(0,Math.min(i.length-1,e));return i[l]}function oc(e){const n={},i=l=>{n[l]=!0;const a=e.clusterOf.get(l);a!==void 0&&(n[a]=!0)};for(const l of e.installed)i(l);for(const l of e.roleDefaults)i(l);for(const l of e.detected)i(l);return n}function cc(e,n){const i=new Set(n);return e.filter(l=>l!=="engineering-base"&&!i.has(l)).sort()}function sc(e,n){const i={type:"object",properties:{},...e.description!==void 0?{description:e.description}:{}},l=i.properties,a=e.properties??{};for(const o of n){const s=o.split(".").filter(q=>q.length>0);if(s.length===0)continue;const[d,h,u]=s;if(d===void 0)continue;const p=a[d];if(p===void 0)continue;if(h===void 0){l[d]=p;continue}const f=p.properties?.[h];if(f===void 0)continue;const y=l[d]??{type:"object",properties:{},...p.description!==void 0?{description:p.description}:{}},O=y.properties??={};if(u===void 0){O[h]=f,l[d]=y;continue}const R=f.properties?.[u];if(R===void 0)continue;const F=O[h]??{type:"object",properties:{},...f.description!==void 0?{description:f.description}:{}},M=F.properties??={};M[u]=R,O[h]=F,l[d]=y}return i}function uc({current:e,total:n}){const i=Math.max(1,n),l=Math.max(0,Math.min(i-1,e)),a=Array.from({length:i},(s,d)=>d<=l),o=Math.round((l+1)/i*100);return r("div",{class:"ac-wizard__progress",role:"progressbar","aria-valuenow":l+1,"aria-valuemin":1,"aria-valuemax":i,"aria-valuetext":`Step ${l+1} of ${i} (${o}%)`,children:a.map((s,d)=>r("span",{class:`ac-wizard__progress-segment${s?" ac-wizard__progress-segment--filled":""}`,"aria-hidden":"true"},d))})}function dc({step:e,index:n,total:i}){return r("header",{class:"ac-page__header ac-wizard__header",children:[r("p",{class:"ac-wizard__step-count",children:["Step ",n+1," of ",i]}),r("div",{class:"ac-wizard__header-text",children:[r("h1",{children:e.title}),r("p",{class:"ac-wizard__subtitle",children:e.subtitle})]}),r(uc,{current:n,total:i})]})}function fc(e){const n=e.canFinish??!0,i=e.completed??!1;return r("div",{class:"ac-form__actions ac-wizard__nav",children:[r("button",{type:"button",class:"ac-button",disabled:!e.canGoPrev||e.busy,onClick:e.onPrev,children:"Back"}),e.canSkip&&e.onSkip!==void 0?r("button",{type:"button",class:"ac-button ac-wizard__skip",disabled:e.busy,onClick:e.onSkip,children:e.skipLabel??"Skip"}):null,e.isLast?i?null:r("button",{type:"button",class:"ac-button ac-button--primary",disabled:e.busy||!n,onClick:e.onFinish,children:e.busy?"Saving…":"Finish & save"}):r("button",{type:"button",class:"ac-button ac-button--primary",disabled:!e.canGoNext||e.busy,onClick:e.onNext,children:e.nextLabel??"Next"})]})}function Ma(e,n){return e.kind!=="form"||e.paths===void 0?!1:!!(e.paths.includes(n)||e.id==="cost"&&(n.startsWith("telegraph.")||n.startsWith("verbosity.")))}function hc(e,n){return e.kind==="userMd"?n==="body"||n.startsWith("body."):Ma(e,n)}function pc(e,n){for(const i of Object.keys(n.errors))if(hc(e,i))return!0;return!1}function vc(e,n){if(pc(e,n))return{label:"needs attention",tone:"error"};if(e.kind==="userMd")return n.userMdChanged?{label:n.userMdAction==="create"?"will create":"will replace",tone:"changed"}:{label:"",tone:"idle"};if(e.kind==="form"){const i=n.changes.filter(l=>Ma(e,l.path)).length;return i===0?{label:"",tone:"idle"}:{label:`${i} change${i===1?"":"s"}`,tone:"changed"}}if(e.kind==="aiTools"){const i=n.selectedToolsCount??0;return i===0?{label:"",tone:"idle"}:{label:`${i} tool${i===1?"":"s"}`,tone:"changed"}}if(e.kind==="packs"){const i=n.selectedPacksCount??0;return i===0?{label:"",tone:"idle"}:{label:`${i} pack${i===1?"":"s"}`,tone:"changed"}}return{label:"",tone:"idle"}}function _c(e){const n=e.steps.filter((d,h)=>h!==e.currentIndex),i=e.packRemovals??[],l=e.selectedToolIds??[],a=e.packAdditions??[],o=e.changes.length,s=l.length>0||a.length>0||o>0||e.userMdChanged;return r(te,{children:[s?r("section",{class:"ac-review-summary","aria-label":"What happens on Finish",children:[r("h2",{class:"ac-review-summary__title",children:"What happens on Finish"}),r("ul",{class:"ac-review-summary__list",children:[o>0?r("li",{children:[r("strong",{children:o})," setting",o===1?"":"s"," will change"," ","in ",r("code",{children:".agent-settings.yml"}),"."]}):r("li",{children:"No settings change."}),e.userMdChanged?r("li",{children:[r("code",{children:".agent-user.yml"})," will be"," ",e.userMdAction==="create"?"created":"updated","."]}):null,l.length>0?r("li",{children:["Config is installed for ",l.length," tool",l.length===1?"":"s",":",r("span",{class:"ac-review-summary__chips",children:l.map(d=>r("code",{class:"ac-review-summary__chip",children:d},d))})]}):null,a.length>0?r("li",{children:["New pack",a.length===1?"":"s",":",r("span",{class:"ac-review-summary__chips",children:a.map(d=>r("code",{class:"ac-review-summary__chip",children:d},d))})]}):null]})]}):null,i.length>0?r("div",{class:"ac-review-removals",role:"alert",children:[r("p",{class:"ac-review-removals__title",children:["⚠️ ",i.length===1?"1 installed pack will be removed":`${i.length} installed packs will be removed`]}),r("ul",{class:"ac-review-removals__list",children:i.map(d=>r("li",{children:r("code",{children:d})},d))}),r("label",{class:"ac-review-removals__confirm",children:[r("input",{type:"checkbox",checked:e.removalsConfirmed??!1,onChange:d=>{e.onConfirmRemovals?.(d.currentTarget.checked)}}),r("span",{children:"I understand these packs will no longer be installed. Re-check them on the packs step to keep them."})]})]}):null,r("nav",{class:"ac-wizard__review-nav","aria-label":"Jump back to a step",children:[r("p",{class:"ac-wizard__review-nav-label",children:"Jump back to a step:"}),r("ul",{class:"ac-wizard__review-nav-list",children:n.map(d=>{const h=e.steps.indexOf(d),u=vc(d,e),p=u.tone==="error"?"ac-wizard__review-nav-button ac-wizard__review-nav-button--error":"ac-wizard__review-nav-button";return r("li",{children:r("button",{type:"button",class:p,onClick:()=>{e.onJump(h)},children:[r("span",{class:"ac-wizard__review-nav-index",children:h+1}),r("span",{class:"ac-wizard__review-nav-text",children:d.navLabel}),u.label!==""?r("span",{class:`ac-wizard__review-nav-status ac-wizard__review-nav-status--${u.tone}`,children:u.label}):null]})},d.id)})})]})]})}function mc(e){const n=e.abortedAt??"unknown time",i=e.abortNote??"no further detail recorded",l=e.writesSinceRollback;return r("aside",{class:"ac-banner ac-banner--recovery",role:"alert",children:[r("strong",{children:"Previous install was interrupted."}),r("p",{children:["Aborted at ",r("code",{children:n})," — ",i,". ",l," write",l===1?"":"s"," landed before the abort marker."]}),r("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."}),r("div",{class:"ac-banner__actions",children:[r("button",{type:"button",disabled:e.busy,onClick:()=>e.onResume(),children:"Resume install"}),r("button",{type:"button",disabled:e.busy,onClick:()=>e.onRollback(),children:"Rollback"}),r("button",{type:"button",disabled:e.busy,onClick:()=>e.onIgnore(),children:"Ignore"})]})]})}function gc(){return r("section",{class:"ac-continue-screen","aria-labelledby":"ac-continue-title",children:[r("h2",{id:"ac-continue-title",children:"Install complete — continue with setup?"}),r("p",{children:"Your install selections (AI tools, roles, capability packs) are captured. Use the footer to continue:"}),r("ul",{children:[r("li",{children:[r("strong",{children:"Next"})," — go through the remaining personalisation steps: editor + tooling, personality, cost profile, roadmap & quality, memory, your",r("code",{children:" .agent-user.yml"}),", and finally the project module roots."]}),r("li",{children:[r("strong",{children:"Finish install here"})," — skip the rest and write ",r("code",{children:".agent-settings.yml"})," with the install-only selections. You can re-run ",r("code",{children:"agent-config setup"}),"later to pick up the personalisation steps."]})]})]})}function yc(e){const n=e.version??"unknown";return r("section",{class:"ac-backup-screen","aria-labelledby":"ac-backup-title",children:[r("h2",{id:"ac-backup-title",children:"Existing v3 install detected"}),r("p",{children:["Found a v3.x install at ",r("code",{children:e.sourcePath})," ","(VERSION: ",r("code",{children:n}),"). 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?r("p",{class:"ac-banner ac-banner--error",children:["Backup failed: ",e.error]}):null,r("ul",{children:[r("li",{children:[r("strong",{children:"Backup v3 and proceed"})," — copies the tree to ",r("code",{children:e.backupTarget}),", then runs the v4 install. Restore later with",r("code",{children:[" mv ",e.backupTarget," ",e.sourcePath]}),"."]}),r("li",{children:[r("strong",{children:"Abort, uninstall v3 first"})," — closes the wizard. You decide what to keep."]})]}),r("div",{class:"ac-backup-screen__actions",children:[r("button",{type:"button",class:"ac-button ac-button--primary",disabled:e.busy,onClick:()=>e.onBackupAndProceed(),children:e.busy?"Backing up…":"Backup v3 and proceed"}),r("button",{type:"button",class:"ac-button",disabled:e.busy,onClick:()=>e.onAbort(),children:"Abort, uninstall v3 first"})]})]})}const bc=[{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 kc({text:e}){const[n,i]=gr(!1);return r("button",{type:"button",class:"ac-button ac-checklist__copy",onClick:()=>{navigator.clipboard?.writeText(e).then(()=>{i(!0),setTimeout(()=>{i(!1)},1500)})},children:n?"Copied ✓":"Copy"})}function wc({message:e}){return r("div",{class:"ac-checklist",children:[r("div",{class:"ac-checklist__hero",children:[r("h2",{class:"ac-checklist__headline",children:"Setup complete"}),e!==null?r("p",{class:"ac-checklist__message",children:e}):null]}),r("ol",{class:"ac-checklist__items",children:bc.map(n=>r("li",{class:"ac-checklist__item",children:[r("div",{class:"ac-checklist__text",children:[r("span",{class:"ac-checklist__item-title",children:n.title}),r("span",{class:"ac-checklist__item-detail",children:n.detail})]}),n.command!==void 0?r("div",{class:"ac-checklist__cmd-row",children:[r("code",{class:"ac-checklist__cmd",children:n.command}),r(kc,{text:n.command})]}):null]},n.title))}),r("p",{class:"ac-checklist__close-hint",children:"You can close this browser window — the local server shuts down on its own."})]})}const Fa=m(!1),Cn=m(null),K=m(null),Ot=m(!1),Nt=m(!1),He=m(0),wr=m(null),se=m({}),ja=m({}),Da=m(0),on=m({}),Q=m(null),Pe=m(null),Sr=m(!1),zi=m(!1),Qt=m(!1),Ua=m({}),Zt=m([]);m("global");const tn=m(!1),ie=m(!1),Sc=m(!1),It=m(!1),Rt=m(null),Ar=m([]),Lt=m({}),$t=m(!0),Pt=m(""),Mt=m("agents");m(!1);const Ba=m(null),Ac=[{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"}],Ki=m(!1),cn=m(!1),Me=m(null),Xt=m([]),ei=m([]),qe=m([]),Gi=m(!1),Yn=m([]),ke=m({}),Ha=m(!1),Vi=m(!1),ht=m(!1),Cr=m({}),Nl=m(!1),qa=m(null),Wa=m(null),Ya=m(null),za=m(null),Ji=m(null),Ka=m(null),Qi=m("https://github.com/rtk-ai/rtk"),Zi=m(!1),Ga=m(null),Cc=m(null),Xi=m(null),Va=m("event4u-app/agent-switch"),xr=m(!1);m(!1);m(null);m([]);m({});m({});const Se=m({}),Ie=m({}),er=m(!1),Il=m(!1);m({});m(null);m(null);m(!1);m(null);const Ft=m(null),Ja=m(!1),nr=m(null),tr=m(!1),ir=m(!1),rr=m(null),sn=m(null),pt=m(!1),Tr=m(!1);function Qa(){return Pa({extended:ie.value})}function fn(){return Qa().length}function xc(e){return e??new Date().toISOString()}function Er(e){return Math.max(0,Math.min(fn()-1,e))}function Tc(e){if("$ref"in e&&e.$ref!==void 0&&"definitions"in e&&e.definitions!==void 0){const n=e.$ref.replace("#/definitions/",""),i=e.definitions[n];if(i!==void 0)return i}return e}async function Ec(){try{return await j("/api/v1/settings")}catch(e){if(e instanceof V&&e.status===404&&e.body.error?.code==="NOT_FOUND"){const n=e.body;if(n.defaults!==void 0&&n.schema!==void 0)return{values:n.defaults,lastModified:n.lastModified??0,path:n.path??".agent-settings.yml",schema:n.schema};const i=await j("/api/v1/schema");return{values:{},lastModified:0,path:".agent-settings.yml",schema:i.settings}}throw e}}async function Oc(){try{const e=await j("/api/v1/install/recovery");Ft.value=e.incomplete?e:null}catch{Ft.value=null}}async function Nc(){try{const e=await j("/api/v1/install/legacy-v3");nr.value=e.present?e:null}catch{nr.value=null}}async function Ic(){ir.value=!0,rr.value=null;try{await j("/api/v1/install/backup-v3",{method:"POST"}),tr.value=!0}catch(e){rr.value=e instanceof V?ce(e.body.error??{code:"UNKNOWN",message:e.message}):e instanceof Error?e.message:String(e)}finally{ir.value=!1}}async function Fi(e){try{await j("/api/v1/install/recovery/dismiss",{method:"POST",body:{reason:e}})}catch(n){K.value={message:n instanceof Error?n.message:String(n),tone:"error"};return}Ft.value=null,Ja.value=!0}async function Rc(){Cn.value=null;try{Oc(),Nc();const[e,n]=await Promise.all([j("/api/v1/wizard/state"),Ec()]);wr.value=Tc(n.schema),Da.value=n.lastModified,ja.value=n.values,Ua.value=n.legacyHints??{},ie.value=e.extendedSteps===!0,sn.value=e.wizardMode??null;const i=Object.keys(e.partial??{});se.value=i.length>0?{...n.values,...e.partial}:n.values,He.value=Er(e.step),tn.value=!1,Fa.value=!0;const l=Jt(He.value,{extended:ie.value});(l.kind==="welcome"||l.kind==="userMd"||l.kind==="review")&&Or(),(l.kind==="roles"||l.kind==="aiTools"||l.kind==="packs")&&zn(),l.kind==="roles"&&Nr(),l.kind==="aiTools"&&ni(),l.id==="identity"&&(Za(),Xa()),l.kind==="review"&&eo()}catch(e){e instanceof V?Cn.value=ce(e.body.error??{code:"UNKNOWN",message:e.message}):Cn.value=e instanceof Error?e.message:String(e)}}function Lc(e,n){return e.identity.name.trim()!==""?e:{...e,identity:{...e.identity,name:n}}}async function Or(){if(!zi.value)try{const e=await j("/api/v1/user-md");if(Sr.value=e.exists,e.exists&&e.identity!==null){const n=nl(e.identity);Pe.value=n,Q.value=n}else{let n;try{const l=await j("/api/v1/user-md/template");n=nl(lc(l.body))}catch{n=_a()}const i=Ua.value.user_name;typeof i=="string"&&i.trim()!==""&&(n=Lc(n,i)),Pe.value=n,Q.value=n}}catch(e){K.value={message:e instanceof Error?e.message:String(e),tone:"error"}}finally{zi.value=!0}}const $c=new Set(["python"]);async function zn(){if(!(Ki.value||cn.value)){cn.value=!0,Me.value=null;try{const[e,n]=await Promise.all([j("/api/v1/wizard/manifest"),j("/api/v1/wizard/auto-detect")]),i=(e.packs??[]).map(o=>({id:o.id,label:o.label??o.id,description:o.description??"",requires_hint:o.requires_hint,cluster:o.cluster??void 0,workspaces:o.workspaces}));Xt.value=i,Yn.value=(e.workspaces??[]).filter(o=>o.id!=="agent-config-maintainer").map(o=>({id:o.id,label:o.label??o.id,description:o.description??"",default_packs:o.default_packs??[],optional_packs:o.optional_packs??[],...o.example_roles!==void 0?{example_roles:o.example_roles}:{}}));const l=new Set(i.map(o=>o.id)),a=n.signals.map(o=>o.id.startsWith("pack-")?o.id.slice(5):o.id).filter(o=>l.has(o)).filter(o=>!$c.has(o));ei.value=a,qe.value=(e.installedPacks??[]).filter(o=>l.has(o))}catch(e){e instanceof V?Me.value=ce(e.body.error??{code:"UNKNOWN",message:e.message}):Me.value=e instanceof Error?e.message:String(e)}finally{cn.value=!1,Ki.value=!0}}}async function ni(){if(!(Vi.value||ht.value)){ht.value=!0;try{const e=await j("/api/v1/wizard/detect-tools"),n=e.tools??{},i=e.configured??[];if(Cr.value=n,Object.keys(Se.value).length===0){const l={};if(i.length>0)for(const a of i)l[a]=!0;else for(const[a,o]of Object.entries(n))o&&(l[a]=!0);Se.value=l}}catch{}finally{ht.value=!1,Vi.value=!0}}}async function Za(){if(!Nl.value){Nl.value=!0;try{const e=await j("/api/v1/wizard/detect-rtk"),n=e.installed===!0;qa.value=n,Wa.value=e.present===!0,Ya.value=e.identity??null,za.value=e.version??null,Ji.value=e.installCommand??null,Ka.value=e.installCommands??null,typeof e.repo=="string"&&(Qi.value=e.repo);const i=se.value.personal??{};se.value={...se.value,personal:{...i,rtk_installed:n}}}catch{}}}async function Xa(){if(!Zi.value){Zi.value=!0;try{const e=await j("/api/v1/wizard/detect-agent-switch");Ga.value=e.installed===!0,Cc.value=e.version??null,Xi.value=e.installCommand??null,typeof e.repo=="string"&&(Va.value=e.repo),xr.value=e.dismissed===!0}catch{}}}async function Pc(e,n){try{await j("/api/v1/wizard/state",{method:"POST",body:{step:e,totalSteps:fn(),partial:n,startedAt:xc(null)}})}catch(i){K.value={message:i instanceof Error?i.message:String(i),tone:"error"}}}async function eo(){Nt.value=!0;try{const e=await j("/api/v1/settings/diff",{method:"POST",body:{values:se.value,ifUnmodifiedSince:Da.value}});Zt.value=e.changes,on.value={}}catch(e){e instanceof V?(on.value=Vt(e.body.error??{message:e.message}),K.value={message:ce(e.body.error??{code:"UNKNOWN",message:e.message}),tone:"error"}):K.value={message:e instanceof Error?e.message:String(e),tone:"error"}}finally{Nt.value=!1}}function jt(){return Qt.value?!1:Q.value===null||Pe.value===null?Q.value!==Pe.value:JSON.stringify(Q.value)!==JSON.stringify(Pe.value)}async function rn(e){const n=Er(e);await Pc(n,se.value),He.value=n,K.value=null;const i=Jt(n,{extended:ie.value});(i.kind==="welcome"||i.kind==="userMd")&&Or(),(i.kind==="roles"||i.kind==="aiTools"||i.kind==="packs")&&zn(),i.kind==="roles"&&Nr(),i.kind==="packs"&&ii(),i.kind==="aiTools"&&ni(),i.id==="identity"&&(Za(),Xa()),i.kind==="review"&&eo()}function ti(){const e=Ie.value,n=new Map(Xt.value.map(o=>[o.id,o])),i=Object.entries(e).filter(([,o])=>o===!0).map(([o])=>o).filter(o=>{const s=n.get(o)?.cluster;return s===void 0||e[s]===!0}),l=new Set,a=o=>{if(!l.has(o)){l.add(o);for(const s of n.get(o)?.requires_hint??[])a(s)}};for(const o of i)a(o);return[...l].sort()}async function Nr(){if(await Promise.all([zn(),Or()]),Ha.value||Object.values(ke.value).some(Boolean))return;const e=Q.value?.role??[];if(e.length===0)return;const n=new Set(Yn.value.map(l=>l.id)),i={};for(const l of e)n.has(l)&&(i[l]=!0);Object.keys(i).length!==0&&(ke.value=i,ii())}function ii(){if(er.value)return;const e=Object.entries(ke.value).filter(([,a])=>a===!0).map(([a])=>a),n=new Map(Yn.value.map(a=>[a.id,a])),i=[];for(const a of e)for(const o of n.get(a)?.default_packs??[])i.push(o);const l=new Map;for(const a of Xt.value)a.cluster!==void 0&&l.set(a.id,a.cluster);Ie.value=oc({installed:qe.value,roleDefaults:i,detected:ei.value,clusterOf:l})}function Mc(){const e=Object.entries(Se.value).filter(([,l])=>l===!0).map(([l])=>l);if(e.length===0)return null;const n=ti(),i={schema_version:"wizard-v2",tools:e,packs:n,settings:se.value};return Be.value?.dryRun===!0&&(i.dry_run=!0),i}async function Fc(){Ot.value=!0,K.value=null;try{const e={settings:se.value},n=Object.entries(ke.value).filter(([,h])=>h===!0).map(([h])=>h),i=Q.value!==null&&typeof Q.value.identity?.name=="string"&&Q.value.identity.name.trim().length>0;Q.value!==null&&i&&(jt()||n.length>0)&&(e.identity=n.length>0?{...Q.value,role:n}:Q.value);const l=await j("/api/v1/wizard/finish",{method:"POST",body:e}),a="You can close this browser window now.",o=l.dryRun===!0?"Dry-run complete — no files written. Settings would be saved.":Array.isArray(l.writtenPaths)?`Saved (${l.writtenPaths.join(", ")}). Wizard complete.`:"Wizard complete.",s=ie.value?Mc():null;let d="";if(s!==null&&s.dry_run===!0)try{await j("/api/v1/wizard/apply",{method:"POST",body:s}),d=" Installer preview OK (dry-run) — no files written."}catch(h){d=` Installer preview failed: ${h instanceof V?ce(h.body.error??{code:"UNKNOWN",message:h.message}):h instanceof Error?h.message:String(h)}.`}else if(s!==null)try{let h=null;await Mo("/api/v1/wizard/apply",s,f=>{f.type==="error"&&(h=typeof f.message=="string"?f.message:"install failed")});const u=s.tools.length,p=s.packs.length;d=h!==null?` Installer failed: ${h}. Settings were saved; re-run the wizard to retry.`:` Installer applied ${u} tool${u===1?"":"s"}`+(p>0?` and ${p} pack${p===1?"":"s"}.`:".")}catch(h){d=` Installer bridge failed: ${h instanceof V?ce(h.body.error??{code:"UNKNOWN",message:h.message}):h instanceof Error?h.message:String(h)}. Settings were saved; re-run the wizard to retry the install plan.`}K.value={message:`${o}${d} ${a}`,tone:"success"},He.value=Er(fn()-1),ja.value=se.value,Pe.value=jt()?Q.value:Pe.value,Zt.value=[],tn.value=!0}catch(e){e instanceof V?(on.value=Vt(e.body.error??{message:e.message}),K.value={message:ce(e.body.error??{code:"UNKNOWN",message:e.message}),tone:"error"}):K.value={message:e instanceof Error?e.message:String(e),tone:"error"}}finally{Ot.value=!1}}async function jc(){Tr.value=!0,await Promise.all([zn(),ni()]),await Nr(),ii(),await rn(fn()-1)}function Dc(){Ae(()=>{zn(),ni()},[]);const e=cn.value||ht.value||!Ki.value||!Vi.value,n=Object.values(Cr.value).filter(Boolean).length,i=qe.value.length,l=ei.value.filter(a=>!qe.value.includes(a)).length;return r("div",{class:"ac-start",children:[r("section",{class:"ac-start__card ac-start__card--primary",children:[r("h2",{class:"ac-start__title",children:"Recommended setup"}),r("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."}),r("ul",{class:"ac-start__facts",children:[r("li",{children:e?"Detecting your AI tools…":n===0?"No AI tools detected — pick them on the review screen.":`${n} AI tool${n===1?"":"s"} detected and pre-selected.`}),r("li",{children:e?"Detecting capability packs…":i>0?`${i} installed pack${i===1?"":"s"} kept${l>0?`, ${l} more auto-detected`:""}.`:l>0?`${l} capability pack${l===1?"":"s"} auto-detected.`:"No packs pre-selected — add them any time later."}),r("li",{children:"Settings keep their current values (or safe defaults on a first run)."}),r("li",{children:"Nothing is written until you confirm the review screen."})]}),r("button",{type:"button",class:"ac-button ac-button--primary ac-start__cta",disabled:e,onClick:()=>{jc()},children:e?"Detecting…":"Use recommended setup"})]}),r("section",{class:"ac-start__card",children:[r("h2",{class:"ac-start__title",children:"Customize"}),r("p",{class:"ac-start__desc",children:"Walk through every step — tools, roles, packs, behaviour, budgets — and tune each choice yourself."}),r("button",{type:"button",class:"ac-button ac-start__cta",onClick:()=>{Tr.value=!0},children:"Customize step by step"})]})]})}const Uc=["de","en","en-US","en-GB","fr","es","it","nl","pt","pt-BR"];function Bc(){if(Il.value)return;const e=Q.value;if(e===null)return;Il.value=!0;let n=e;if(e.identity.name.trim()===""){const i=Be.value?.systemUser;i!==void 0&&i.trim()!==""&&(n={...n,identity:{...n.identity,name:i}})}if(!Sr.value&&typeof navigator<"u"){const i=(navigator.language||"").split("-")[0];i.length>=2&&(n={...n,language:i})}n!==e&&(Q.value=n)}function Hc(){const e=Q.value;if(Ae(()=>{Bc()},[e]),e===null)return r("p",{children:"Loading…"});const n=i=>{Q.value={...i,last_updated:new Date().toISOString().slice(0,10)},Qt.value=!1};return r("div",{class:"ac-wizard-step-stub ac-wizard__module-fields",children:[r("p",{children:["Tell the agent who you are. We pre-filled what we could detect — adjust freely. Stored in ",r("code",{children:".agent-user.yml"}),"."]}),r("div",{class:"ac-field",children:[r("label",{class:"ac-field__label",for:"welcome-name",children:"Name"}),r("input",{class:"ac-input",id:"welcome-name",type:"text",placeholder:"How should the agent address you?",value:e.identity.name,onInput:i=>n({...e,identity:{...e.identity,name:i.currentTarget.value}})})]}),r("div",{class:"ac-field",children:[r("label",{class:"ac-field__label",for:"welcome-lang",children:"Language"}),r("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:i=>n({...e,language:i.currentTarget.value})}),r("datalist",{id:"welcome-lang-list",children:Uc.map(i=>r("option",{value:i},i))})]})]})}function qc(){const e=Se.value,n=Cr.value;return r("div",{class:"ac-wizard-step-stub",children:[r("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."}),r("ul",{class:"ac-wizard__tool-list",children:Ac.map(i=>{const l=n[i.id]===!0;return r("li",{class:"ac-wizard__tool-row",children:[r("label",{class:"ac-wizard__tool-label",children:[r("input",{type:"checkbox",checked:e[i.id]??!1,onChange:a=>{const o=a.currentTarget.checked;Se.value={...e,[i.id]:o}}})," ",i.label]}),r("span",{class:`ac-badge ${l?"ac-badge--installed":"ac-badge--missing"}`,title:l?"Detected on this machine":"Not detected on this machine",children:l?"installed":"not installed"})]},i.id)})})]})}function Wc(){if(cn.value)return r("p",{children:"Loading roles…"});if(Me.value!==null)return r("div",{class:"ac-wizard-step-stub",children:r("p",{class:"ac-banner ac-banner--error",children:["Discovery failed: ",Me.value]})});const e=ke.value,n=Yn.value,i=(l,a)=>{Ha.value=!0,ke.value={...ke.value,[l]:a},ii()};return r("div",{class:"ac-wizard-step-stub",children:[r("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",r("code",{children:" .agent-user.yml"}),"."]}),n.length===0?r("p",{children:r("em",{children:"No roles available in the manifest."})}):r("div",{class:"ac-wizard__pack-grid",children:n.map(l=>r("section",{class:"ac-pack-tile",children:[r("label",{class:"ac-pack-tile__head",children:[r("input",{type:"checkbox",checked:e[l.id]??!1,onChange:a=>{i(l.id,a.currentTarget.checked)}}),r("span",{class:"ac-pack-tile__title",children:l.label})]}),(l.example_roles??[]).length>0?r("p",{class:"ac-pack-tile__role",children:["e.g. ",(l.example_roles??[]).join(", ")]}):null,l.description!==""?r("p",{class:"ac-pack-tile__desc",children:l.description}):null]},l.id))})]})}function Yc(){if(cn.value)return r("p",{children:"Loading discovery manifest…"});if(Me.value!==null)return r("div",{class:"ac-wizard-step-stub",children:[r("p",{class:"ac-banner ac-banner--error",children:["Discovery failed: ",Me.value]}),r("p",{children:"The manifest endpoint is gated on extended-mode. Re-run the server with extended steps enabled to populate this list."})]});const e=Ie.value,n=new Set(ei.value),i=new Set(qe.value),l=y=>i.has(y)?r("span",{class:"ac-badge ac-badge--installed",children:"installed"}):n.has(y)?r("span",{class:"ac-badge ac-badge--detected",children:"auto-detected"}):null,a=new Map(Yn.value.map(y=>[y.id,y.label])),o=ke.value,s=y=>{const O=(y??[]).filter(R=>R!=="agent-config-maintainer");return O.length===0?null:r("span",{class:"ac-pack-tile__ws",children:O.map(R=>r("span",{class:`ac-badge ac-badge--ws${o[R]===!0?" ac-badge--ws-active":""}`,title:o[R]===!0?"Matches a role you picked":"Workspace / area",children:a.get(R)??R},R))})},d=Xt.value.filter(y=>y.id!=="engineering-base"),h=new Map;for(const y of d)if(y.cluster!==void 0){const O=h.get(y.cluster)??[];O.push(y),h.set(y.cluster,O)}const u=new Set(d.filter(y=>y.cluster!==void 0).map(y=>y.id)),p=d.filter(y=>!u.has(y.id)),f=(y,O)=>{er.value=!0,Ie.value={...Ie.value,[y]:O}},T=(y,O)=>{er.value=!0;const R={...Ie.value,[y]:O};if(O)for(const D of h.get(y)??[])R[D.id]===void 0&&(R[D.id]=!0);Ie.value=R};return r("div",{class:"ac-wizard-step-stub",children:[r("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."}),p.length===0?r("p",{children:r("em",{children:"No packs available in the manifest."})}):r("div",{class:"ac-wizard__pack-grid",children:p.map(y=>{const O=h.get(y.id)??[],R=O.length>0,D=e[y.id]??!1;return r("section",{class:"ac-pack-tile",children:[r("label",{class:"ac-pack-tile__head",children:[r("input",{type:"checkbox",checked:D,onChange:F=>{const M=F.currentTarget.checked;R?T(y.id,M):f(y.id,M)}}),r("span",{class:"ac-pack-tile__title",children:y.label}),l(y.id)]}),s(y.workspaces),y.description!==""?r("p",{class:"ac-pack-tile__desc",children:y.description}):null,R?r("fieldset",{class:"ac-pack-tile__children",disabled:!D,children:O.map(F=>r("label",{class:"ac-pack-tile__child",children:[r("input",{type:"checkbox",checked:e[F.id]??!1,disabled:!D,onChange:M=>{f(F.id,M.currentTarget.checked)}}),r("span",{children:F.label}),l(F.id)]},F.id))}):null]},y.id)})})]})}function zc(){const e=qa.value,n=Wa.value,i=Ya.value,l=za.value,a=Ka.value,o=e===null?r("span",{class:"ac-badge ac-badge--missing",children:"detecting…"}):e?r("span",{class:"ac-badge ac-badge--installed",children:["installed",l!==null?` (v${l})`:""]}):n===!0?r("span",{class:"ac-badge ac-badge--missing",children:i==="unknown-rtk"?"different tool":"unverified"}):r("span",{class:"ac-badge ac-badge--missing",children:"not installed"});return r("div",{class:"ac-rtk-row",children:[r("div",{class:"ac-rtk-row__head",children:[r("span",{class:"ac-rtk-row__label",children:["rtk ",r("small",{children:"(Rust Token Killer — third-party, Apache-2.0)"})]}),o]}),n===!0&&i==="unknown-rtk"?r("div",{class:"ac-rtk-row__install",children:[r("p",{class:"ac-field__description",children:["A binary named ",r("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:"]}),r("a",{class:"ac-button",href:`${Qi.value}/blob/master/INSTALL.md`,target:"_blank",rel:"noreferrer noopener",children:"Open rtk install guide"})]}):null,n===!0&&i==="unverified"?r("p",{class:"ac-field__description",children:["rtk found but the identity check failed — verify manually with ",r("code",{children:"rtk gain"})," (Rust Token Killer renders a token-savings dashboard; the colliding Rust Type Kit does not)."]}):null,n===!1?r("div",{class:"ac-rtk-row__install",children:[r("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:"}),a!==null?r(te,{children:[a.recommendedLabel!==void 0?r("p",{class:"ac-field__description",children:[a.recommendedLabel,":"]}):null,r("code",{class:"ac-rtk-row__cmd",children:a.recommended}),a.manual!==void 0?r(te,{children:[r("p",{class:"ac-field__description",children:[a.manualLabel??"Manual",":"]}),r("code",{class:"ac-rtk-row__cmd",children:a.manual})]}):null,a.note!==void 0?r("p",{class:"ac-field__description",children:a.note}):null]}):Ji.value!==null?r("code",{class:"ac-rtk-row__cmd",children:Ji.value}):null,r("a",{class:"ac-button",href:Qi.value,target:"_blank",rel:"noreferrer noopener",children:"Open rtk repo"})]}):null]})}async function Kc(){try{await j("/api/v1/wizard/dismiss-recommendation",{method:"POST",body:{id:"agent-switch"}})}catch(e){K.value={message:e instanceof Error?e.message:String(e),tone:"error"};return}xr.value=!0}function Gc(){return!Zi.value||Ga.value!==!1||xr.value?null:r("div",{class:"ac-rtk-row",children:[r("div",{class:"ac-rtk-row__head",children:[r("span",{class:"ac-rtk-row__label",children:["agent-switch ",r("small",{children:"(third-party, MIT)"})]}),r("span",{class:"ac-badge ac-badge--missing",children:"not installed"})]}),r("div",{class:"ac-rtk-row__install",children:[r("p",{class:"ac-field__description",children:["agent-switch isolates multiple agent accounts into per-account profiles (",r("code",{children:"CLAUDE_CONFIG_DIR"}),") so switching accounts never requires a re-login. Free and MIT-licensed."]}),Xi.value!==null?r("code",{class:"ac-rtk-row__cmd",children:Xi.value}):null,r("a",{class:"ac-button",href:`https://github.com/${Va.value}`,target:"_blank",rel:"noreferrer noopener",children:"Open agent-switch repo"}),r("button",{type:"button",class:"ac-button ac-button--small",onClick:()=>{Kc()},children:"Don't show again"})]})]})}function Vc(){const e=Jt(He.value,{extended:ie.value});if(ie.value&&sn.value==="install"&&e.id==="identity"&&!pt.value)return r(gc,{});if(e.kind==="form"){const i=sc(wr.value,e.paths??[]);return r(te,{children:[e.id==="identity"?r(zc,{}):null,e.id==="identity"?r(Gc,{}):null,r(Yo,{schema:i,values:se.value,errors:on.value,onChange:l=>{se.value=l}})]})}return e.kind==="userMd"?!zi.value||Q.value===null?r("p",{children:"Loading .agent-user.yml…"}):r(Vo,{value:Q.value,errors:on.value,hideRole:ie.value&&sn.value==="install",hideIdentityBasics:ie.value&&sn.value==="install",onChange:i=>{Q.value=i,Qt.value=!1}}):e.kind==="welcome"?r(Hc,{}):e.kind==="aiTools"?r(qc,{}):e.kind==="roles"?r(Wc,{}):e.kind==="packs"?r(Yc,{}):r(_c,{steps:Qa(),currentIndex:He.value,changes:Zt.value,errors:on.value,userMdChanged:jt(),userMdAction:Sr.value?"replace":"create",loading:Nt.value,onJump:i=>{rn(i)},selectedToolsCount:Object.values(Se.value).filter(Boolean).length,selectedPacksCount:Object.values(Ie.value).filter(Boolean).length,packRemovals:lr(),removalsConfirmed:Gi.value,onConfirmRemovals:i=>{Gi.value=i},selectedToolIds:Object.entries(Se.value).filter(([,i])=>i).map(([i])=>i),packAdditions:ie.value?ti().filter(i=>i!=="engineering-base"&&!qe.value.includes(i)):[]})}function lr(){return ie.value?cc(qe.value,ti()):[]}function Rl({path:e}){if(Ae(()=>{Rc()},[]),!Fa.value||wr.value===null)return r("div",{class:"ac-page",children:[r("h1",{children:"Setup wizard"}),Cn.value!==null?r("p",{class:"ac-banner ac-banner--error",children:Cn.value}):r("p",{children:"Loading…"})]});const n=He.value,i=fn(),l=Jt(n,{extended:ie.value}),a=n===i-1,o=l.kind==="aiTools"&&Object.values(Se.value).filter(Boolean).length===0||l.kind==="roles"&&Object.values(ke.value).filter(Boolean).length===0||l.kind==="packs"&&ti().length===0,s=ie.value&&sn.value==="install"&&l.id==="identity"&&!pt.value,d=Ft.value,h=d!==null&&!Ja.value,u=nr.value,p=u!==null&&u.present&&!tr.value,f=ie.value&&sn.value==="install"&&n===0&&!Tr.value&&!tn.value;return p?r("div",{class:"ac-page",children:r(yc,{sourcePath:u.path,backupTarget:u.backupTarget,version:u.version,busy:ir.value,error:rr.value,onBackupAndProceed:()=>{Ic()},onAbort:()=>{K.value={tone:"info",message:"Aborted. Uninstall v3 manually, then re-run `agent-config install`."},tr.value=!0}})}):f?r("div",{class:"ac-page",children:[r("header",{class:"ac-page__header",children:r("h1",{children:"Set up agent-config"})}),K.value!==null?r("p",{class:`ac-banner${K.value.tone==="error"?" ac-banner--error":""}`,children:K.value.message}):null,r(Dc,{})]}):r("div",{class:"ac-page",children:[r(dc,{step:l,index:n,total:i}),h?r(mc,{abortedAt:d.abortedAt,abortNote:d.abortNote,writesSinceRollback:d.writesSinceRollback,busy:Ot.value,onResume:()=>{Fi("resume")},onRollback:()=>{Fi("rollback")},onIgnore:()=>{Fi("ignore")}}):null,K.value!==null&&!(tn.value&&a&&K.value.tone==="success")?r("p",{class:`ac-banner${K.value.tone==="error"?" ac-banner--error":""}`,children:K.value.message}):null,r("div",{class:"ac-wizard__step",children:tn.value&&a?r(wc,{message:K.value?.tone==="success"?K.value.message:null}):r(Vc,{})}),o?r("p",{class:"ac-wizard__hint",children:l.kind==="aiTools"?"Select at least one AI tool to continue.":l.kind==="roles"?"Select at least one role to continue.":"Select at least one capability pack to continue."}):null,r(fc,{canGoPrev:n>0,canGoNext:!a&&!o,canSkip:s||l.kind==="userMd",skipLabel:s?"Finish install here":"Skip",isLast:a,busy:Ot.value||Nt.value,canFinish:(Zt.value.length>0||jt()||lr().length>0||ie.value&&Object.values(Se.value).some(Boolean))&&(lr().length===0||Gi.value),completed:tn.value,onPrev:()=>{rn(n-1)},onNext:()=>{if(s){pt.value=!0;return}rn(n+1)},onSkip:()=>{if(s){pt.value=!0,rn(fn()-1);return}Qt.value=!0,rn(n+1)},onFinish:()=>{Fc()}})]})}const Jc=new Set(["profile.id","rule_loading_tier","discipline_profile","personal.ide","personal.open_edited_files","personal.autonomy","personal.minimal_output","personal.play_by_play","personal.pr_comment_bot_icon","personal.pr_progress_comments","cost.budgets.daily","cost.budgets.weekly","cost.budgets.monthly","cost.enforcement","model.auto_switch","tokens.rich_skills","roadmap.quality_cadence","roadmap.dashboard_regen_cadence","quality.local_auto_run","quality.wait_for_remote_ci","memory.review_threshold","memory.redact_patterns","memory.cadence","chat_history.enabled","update_check.enabled","subagents.enabled","subagents.auto","worktrees.mode","legal_review_prep.acknowledged"]);function Ll(e){return Jc.has(e)}function Qc(e,n){return JSON.stringify(e??null)===JSON.stringify(n??null)}function no(e,n){if(e.kind==="enum_removed"){const i=new Set(e.values??[]);return n!==void 0&&i.has(n)?"must_fix":"info"}return e.kind==="type_changed"?"must_fix":e.kind==="default_changed"?n===void 0||Qc(n,e.old?.default)?"adopt":"review":e.kind==="added"&&e.new?.default===void 0?"must_fix":"info"}const ar=m(!0),Dt=m(null),or=m(!1),ri=m(null),hn=m({}),cr=m(0),We=m({}),Re=m(null),we=m(!1),Ln=m(!1);function Fe(e){return`${e.key}:${e.kind}`}async function Zc(){ar.value=!0,Dt.value=null,or.value=!1,Ln.value=!1;try{const e=await j("/api/v1/settings/changes"),n=await j("/api/v1/settings");ri.value=e.delta,hn.value=n.values,cr.value=n.lastModified,Xc(e.delta,n.values)}catch(e){e instanceof V&&e.status===404?or.value=!0:Dt.value=e instanceof Error?e.message:String(e)}finally{ar.value=!1}}function Xc(e,n){const i={};for(const l of e.changes){const a=no(l,Hn(n,l.key.split(".")));a==="adopt"?i[Fe(l)]={mode:"adopt"}:a==="review"?i[Fe(l)]={mode:"keep"}:a==="must_fix"&&(i[Fe(l)]={mode:null})}We.value=i}function Ir(e){return no(e,Hn(hn.value,e.key.split(".")))}function xn(e,n){We.value={...We.value,[e]:n}}function Rr(){const e=ri.value;return e===null?[]:e.changes.filter(n=>{if(Ir(n)!=="must_fix")return!1;const i=We.value[Fe(n)];return i===void 0||i.mode===null||i.mode==="custom"&&(i.value===void 0||i.value==="")})}function es(){const e=ri.value;let n=hn.value;if(e===null)return n;for(const i of e.changes){const l=We.value[Fe(i)];if(l===void 0||l.mode===null||l.mode==="keep")continue;const a=i.key.split(".");l.mode==="adopt"&&i.new?.default!==void 0?n=Rn(n,a,i.new.default):l.mode==="custom"&&l.value!==void 0&&(n=Rn(n,a,l.value))}return n}async function ns(){if(we.value)return;const e=Rr();if(e.length>0){Re.value=`Resolve the ${e.length} “Must fix” item${e.length===1?"":"s"} first.`;return}we.value=!0,Re.value=null;try{const n=es();if(JSON.stringify(n)!==JSON.stringify(hn.value)){const i=await j("/api/v1/settings",{method:"PUT",headers:{"If-Unmodified-Since":String(cr.value)},body:{values:n}});hn.value=n,cr.value=i.lastModified}await j("/api/v1/settings/changes/ack",{method:"POST"}),Ln.value=!0}catch(n){n instanceof V?Re.value=ce(n.body.error??{code:"UNKNOWN",message:n.message}):Re.value=n instanceof Error?n.message:String(n)}finally{we.value=!1}}async function ts(){if(we.value)return;if(Rr().length>0){Re.value="Cannot dismiss — “Must fix” items would leave invalid values in place.";return}we.value=!0;try{await j("/api/v1/settings/changes/ack",{method:"POST"}),Ln.value=!0}catch(n){Re.value=n instanceof Error?n.message:String(n)}finally{we.value=!1}}function Oe(e){return e===void 0?"—":typeof e=="string"?e:JSON.stringify(e)}function ji({change:e,id:n}){const i=e.new,a=We.value[n]?.value;return i?.enum!==void 0?r("select",{class:"ac-input","aria-label":`New value for ${e.key}`,value:a===void 0?"":String(a),onChange:o=>{const s=o.currentTarget.value;xn(n,{mode:"custom",value:s})},children:[r("option",{value:"",disabled:!0,children:"Choose a value…"}),i.enum.map(o=>r("option",{value:String(o),children:String(o)},String(o)))]}):i?.type==="boolean"?r("select",{class:"ac-input","aria-label":`New value for ${e.key}`,value:a===void 0?"":String(a),onChange:o=>{xn(n,{mode:"custom",value:o.currentTarget.value==="true"})},children:[r("option",{value:"",disabled:!0,children:"Choose…"}),r("option",{value:"true",children:"true"}),r("option",{value:"false",children:"false"})]}):r("input",{class:"ac-input",type:i?.type==="number"||i?.type==="integer"?"number":"text","aria-label":`New value for ${e.key}`,value:a===void 0?"":String(a),onInput:o=>{const s=o.currentTarget.value,d=i?.type==="number"||i?.type==="integer"?Number(s):s;xn(n,{mode:"custom",value:d})}})}function is({change:e}){const n=Ir(e),i=Fe(e),l=We.value[i],a=Hn(hn.value,e.key.split("."));return r("li",{class:`ac-change-card ac-change-card--${n}`,"data-key":e.key,"data-kind":e.kind,children:[r("div",{class:"ac-change-card__head",children:[r("code",{class:"ac-change-card__key",children:e.key}),r("span",{class:`ac-change-card__badge ac-change-card__badge--${n}`,children:n==="must_fix"?"Must fix":n==="adopt"?"New default":n==="review"?"Review":"Info"})]}),e.new?.description!==void 0?r("p",{class:"ac-change-card__desc",children:e.new.description}):null,e.kind==="default_changed"?r(te,{children:[r("p",{class:"ac-change-card__detail",children:["Default changed: ",r("code",{children:Oe(e.old?.default)})," → ",r("code",{children:Oe(e.new?.default)}),n==="review"?r(te,{children:[" · your value: ",r("code",{children:Oe(a)})]}):null]}),r("div",{class:"ac-change-card__choices",role:"radiogroup","aria-label":`Resolution for ${e.key}`,children:[r("label",{class:"ac-change-card__choice",children:[r("input",{type:"radio",name:i,checked:l?.mode==="adopt",onChange:()=>{xn(i,{mode:"adopt"})}}),r("span",{children:["Adopt new default (",r("code",{children:Oe(e.new?.default)}),")"]})]}),r("label",{class:"ac-change-card__choice",children:[r("input",{type:"radio",name:i,checked:l?.mode==="keep",onChange:()=>{xn(i,{mode:"keep"})}}),r("span",{children:["Keep current (",r("code",{children:Oe(a??e.old?.default)}),")"]})]})]})]}):null,e.kind==="enum_removed"?n==="must_fix"?r(te,{children:[r("p",{class:"ac-change-card__detail",children:["Your value ",r("code",{children:Oe(a)})," is no longer valid — removed option",(e.values?.length??0)===1?"":"s",": ",r("code",{children:(e.values??[]).join(", ")}),". Pick a replacement:"]}),r(ji,{change:e,id:i})]}):r("p",{class:"ac-change-card__detail",children:["Removed option",(e.values?.length??0)===1?"":"s",": ",r("code",{children:(e.values??[]).join(", ")})," — your value ",r("code",{children:Oe(a??e.new?.default)})," is unaffected."]}):null,e.kind==="enum_added"?r("p",{class:"ac-change-card__detail",children:["New option",(e.values?.length??0)===1?"":"s"," available: ",r("code",{children:(e.values??[]).join(", ")})]}):null,e.kind==="added"?n==="must_fix"?r(te,{children:[r("p",{class:"ac-change-card__detail",children:"New setting without a shipped default — define a value:"}),r(ji,{change:e,id:i})]}):r("p",{class:"ac-change-card__detail",children:["New setting · default: ",r("code",{children:Oe(e.new?.default)}),e.new?.enum!==void 0?r(te,{children:[" · options: ",r("code",{children:e.new.enum.join(", ")})]}):null]}):null,e.kind==="removed"?r("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"?r(te,{children:[r("p",{class:"ac-change-card__detail",children:["Type changed: ",r("code",{children:e.old?.type})," → ",r("code",{children:e.new?.type}),". Define a new value:"]}),r(ji,{change:e,id:i})]}):null]})}function rs(e){const n=new Map;for(const u of e.changes){const p=Ir(u);n.set(p,[...n.get(p)??[],u])}const i=[],l=n.get("must_fix")??[];l.length>0&&i.push({title:"Must fix",hint:"These stored values are invalid after the upgrade — saving is blocked until each has a valid value.",changes:l});const a=[...n.get("adopt")??[],...n.get("review")??[]];a.length>0&&i.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:a});const o=n.get("info")??[],s=o.filter(u=>u.kind==="added"),d=o.filter(u=>u.kind==="enum_added"),h=o.filter(u=>u.kind!=="added"&&u.kind!=="enum_added");return s.length>0&&i.push({title:"New settings",changes:s}),d.length>0&&i.push({title:"New options",changes:d}),h.length>0&&i.push({title:"Removed / other",changes:h}),i}function ls(){if(Ae(()=>{Zc()},[]),ar.value)return r("div",{class:"ac-page",children:[r("h1",{children:"Settings changes"}),r("p",{children:"Loading…"})]});if(Dt.value!==null)return r("div",{class:"ac-page",children:[r("h1",{children:"Settings changes"}),r("p",{class:"ac-banner ac-banner--error",children:Dt.value})]});if(Ln.value||or.value)return r("div",{class:"ac-page ac-settings-changes",children:[r("h1",{children:"Settings changes"}),r("p",{class:"ac-banner",children:Ln.value?"Review complete — all changes resolved.":"Nothing to review — your settings are up to date."}),r("button",{type:"button",class:"ac-button",onClick:()=>Gt("/settings"),children:"Back to Settings"})]});const e=ri.value;if(e===null)return r("div",{class:"ac-page",children:r("h1",{children:"Settings changes"})});const n=rs(e),i=Rr().length;return r("div",{class:"ac-page ac-settings-changes",children:[r("header",{class:"ac-page__header",children:[r("h1",{children:"Settings changes"}),r("p",{class:"ac-page__lede",children:["The upgrade ",r("code",{children:e.oldVersion})," → ",r("code",{children:e.newVersion})," changed the available settings. Review below — nothing was changed automatically."]})]}),Re.value!==null?r("p",{class:"ac-banner ac-banner--error",role:"alert",children:Re.value}):null,n.map(l=>r("section",{class:"ac-settings-changes__group",children:[r("h2",{children:[l.title," ",r("span",{class:"ac-settings-changes__count",children:["(",l.changes.length,")"]})]}),l.hint!==void 0?r("p",{class:"ac-settings-changes__hint",children:l.hint}):null,r("ul",{class:"ac-settings-changes__list",children:l.changes.map(a=>r(is,{change:a},Fe(a)))})]},l.title)),r("div",{class:"ac-form__actions",children:[r("button",{type:"button",class:"ac-button",disabled:we.value,onClick:()=>{ts()},children:"Dismiss (keep everything)"}),r("button",{type:"button",class:"ac-button ac-button--primary",disabled:we.value||i>0,title:i>0?`${i} “Must fix” item${i===1?"":"s"} unresolved`:void 0,onClick:()=>{ns()},children:we.value?"Saving…":"Apply & finish review"})]})]})}const en=m(null);function as(){return Ae(()=>{(async()=>{try{const e=await j("/api/v1/settings/changes");en.value=e.delta.changes.length}catch{en.value=null}})()},[]),en.value===null||en.value===0?null:r("div",{class:"ac-banner ac-banner--pending",role:"status",children:[r("span",{children:["An upgrade changed ",en.value," setting",en.value===1?"":"s"," — review recommended."]}),r("button",{type:"button",class:"ac-button ac-button--small",onClick:()=>Gt("/settings/changes"),children:"Review changes"})]})}const sr=m(!1),Ut=m(null),de=m({}),Bt=m(null),$n=m(0),Pn=m({}),ye=m(null),Ye=m(!1),je=m(null),Mn=m(null),vt=m(""),nn=m(!1),_t=m({}),mt=m({global:new Set,project:new Set});function $l(e){if("$ref"in e&&e.$ref!==void 0&&"definitions"in e&&e.definitions!==void 0){const n=e.$ref.replace("#/definitions/",""),i=e.definitions[n];if(i!==void 0)return i}return e}async function Pl(){Ut.value=null;try{const e=await j("/api/v1/settings");de.value=e.values,Bt.value=$l(e.schema),$n.value=e.lastModified,mt.value={global:new Set(e.sources?.global??[]),project:new Set(e.sources?.project??[])},sr.value=!0}catch(e){if(e instanceof V&&e.status===404&&e.body.error?.code==="NOT_FOUND"){const n=e.body;if(n.defaults!==void 0&&n.schema!==void 0){de.value=n.defaults,Bt.value=$l(n.schema),$n.value=n.lastModified??0,sr.value=!0;return}}Ut.value=e instanceof Error?e.message:String(e)}}async function os(){if(!Ye.value){ye.value=null,Pn.value={};try{const e=await j("/api/v1/settings/diff",{method:"POST",body:{values:de.value,ifUnmodifiedSince:$n.value}});if(e.changes.length===0){ye.value="No changes to save.";return}je.value=e.changes}catch(e){e instanceof V?(Pn.value=Vt(e.body.error??{message:e.message}),ye.value=ce(e.body.error??{code:"UNKNOWN",message:e.message})):ye.value=e instanceof Error?e.message:String(e)}}}async function to(e=!1){Ye.value=!0;try{const n=await j("/api/v1/settings",{method:"PUT",headers:{"If-Unmodified-Since":String($n.value)},body:e?{values:de.value,confirmSharedWrite:!0}:{values:de.value}});$n.value=n.lastModified,je.value=null,Mn.value=null,ye.value=`Saved (${n.writtenPaths.join(", ")}).`}catch(n){if(n instanceof V){const i=n.body;if(n.status===409&&i.error==="shared-write"){je.value=null,Mn.value={sharedPath:typeof i.sharedPath=="string"?i.sharedPath:"",message:typeof i.message=="string"?i.message:"This write affects a shared agent-switch profile."};return}const l=n.body.error??{code:"UNKNOWN",message:n.message};Pn.value=Vt(l),ye.value=ce(l),je.value=null;const a=Object.keys(Pn.value)[0];a!==void 0&&queueMicrotask(()=>{const o=document.getElementById(a);o!==null&&o.focus()})}else ye.value=n instanceof Error?n.message:String(n)}finally{Ye.value=!1}}function Lr(e){if(e.defaultValue===void 0)return!1;const n=Hn(de.value,e.path);return n===void 0?!1:JSON.stringify(n)!==JSON.stringify(e.defaultValue)}function cs(e,n){const i=Lr(n),l=mt.value.project.has(e)?"project":mt.value.global.has(e)&&mt.value.project.size>0?"global":void 0;return{modified:i,onReset:i&&n.defaultValue!==void 0?()=>{de.value=Rn(de.value,n.path,n.defaultValue)}:void 0,sourceLabel:l}}function ss(e,n){const i=n.toLowerCase();return e.path.join(".").toLowerCase().includes(i)||e.label.toLowerCase().includes(i)||(e.description??"").toLowerCase().includes(i)}function us(e){const n=vt.value.trim(),i=nn.value,l=e.path.join("."),a=_t.value[l]===!0;let o=e.fields.filter(u=>u.kind!=="unsupported");if(n!==""&&(o=o.filter(u=>ss(u,n))),i&&(o=o.filter(u=>Lr(u))),n!==""||i)return o.length===0?null:{section:e,visible:o,hiddenAdvancedCount:0,expanded:a};const s=o.filter(u=>Ll(u.path.join("."))),d=o.filter(u=>!Ll(u.path.join("."))),h=a?[...s,...d]:s;return h.length===0&&d.length===0?null:{section:e,visible:h,hiddenAdvancedCount:a?0:d.length,expanded:a}}function ds(e){_t.value={..._t.value,[e]:_t.value[e]!==!0}}function fs(){const e=Be.value?.agentSwitchProfile;if(e===void 0||e.active!==!0)return null;const n=e.provider!==null&&e.profile!==null?`${e.provider}/${e.profile}`:"an unidentified profile";return r("div",{class:"ac-banner",role:"status",children:r("span",{children:["Running under agent-switch profile ",r("code",{children:n})," — settings shown and saved here are profile-scoped. Switching profiles shows that profile's own settings; nothing is lost."]})})}function hs({block:e}){return r("div",{class:"ac-modal",role:"dialog","aria-modal":"true","aria-labelledby":"shared-write-title",children:r("div",{class:"ac-modal__panel",children:[r("h2",{id:"shared-write-title",children:"Shared write — affects all profiles"}),r("p",{children:e.message}),r("p",{children:r("code",{children:e.sharedPath})}),r("div",{class:"ac-modal__actions",children:[r("button",{type:"button",class:"ac-button",onClick:()=>{Mn.value=null},children:"Cancel"}),r("button",{type:"button",class:"ac-button ac-button--primary",disabled:Ye.value,onClick:()=>{to(!0)},children:Ye.value?"Writing…":"Write (affects all profiles)"})]})]})})}function ps({changes:e}){return r("div",{class:"ac-modal",role:"dialog","aria-modal":"true","aria-labelledby":"diff-title",children:r("div",{class:"ac-modal__panel",children:[r("h2",{id:"diff-title",children:"Confirm changes"}),r("ul",{class:"ac-diff",children:e.map(n=>r("li",{children:[r("code",{children:n.path}),r("span",{class:"ac-diff__before",children:JSON.stringify(n.from)}),r("span",{class:"ac-diff__arrow",children:"→"}),r("span",{class:"ac-diff__after",children:JSON.stringify(n.to)})]},n.path))}),r("div",{class:"ac-modal__actions",children:[r("button",{type:"button",class:"ac-button",onClick:()=>{je.value=null},children:"Cancel"}),r("button",{type:"button",class:"ac-button ac-button--primary",disabled:Ye.value,onClick:()=>{to()},children:Ye.value?"Saving…":"Save"})]})]})})}function vs(){if(Ae(()=>{Pl()},[]),!sr.value||Bt.value===null)return r("div",{class:"ac-page",children:[r("h1",{children:"Settings"}),Ut.value!==null?r("p",{class:"ac-banner ac-banner--error",children:Ut.value}):r("p",{children:"Loading…"})]});const e=pa(Bt.value),n=e.map(us).filter(a=>a!==null),i=e.flatMap(a=>a.fields).filter(a=>Lr(a)).length,l=vt.value.trim()!==""||nn.value;return r("div",{class:"ac-page ac-settings-hub",children:[r("header",{class:"ac-page__header",children:[r("h1",{children:"Settings"}),r("nav",{class:"ac-page__nav",children:r("a",{href:"#/settings/user",children:"Edit .agent-user.yml →"})})]}),r(as,{}),r(fs,{}),r("div",{class:"ac-settings-hub__toolbar",role:"search",children:[r("input",{class:"ac-input ac-settings-hub__search",type:"search",placeholder:"Search all settings (basic and advanced)…",value:vt.value,onInput:a=>{vt.value=a.currentTarget.value}}),r("button",{type:"button",class:`ac-chip-toggle${nn.value?" ac-chip-toggle--active":""}`,"aria-pressed":nn.value,onClick:()=>{nn.value=!nn.value},children:["@modified",i>0?` (${i})`:""]})]}),ye.value!==null?r("p",{class:"ac-banner",children:ye.value}):null,r("form",{class:"ac-form",onSubmit:a=>a.preventDefault(),children:[n.length===0?r("p",{class:"ac-settings-hub__empty",children:"No settings match."}):n.map(a=>{const o=a.section.path.join(".");return r(va,{section:{...a.section,fields:a.visible},values:de.value,errors:Pn.value,onChange:s=>{de.value=s},decorate:cs,footer:!l&&(a.hiddenAdvancedCount>0||a.expanded)?r("button",{type:"button",class:"ac-settings-hub__disclosure","aria-expanded":a.expanded,onClick:()=>{ds(o)},children:a.expanded?"Hide advanced settings":`Show ${a.hiddenAdvancedCount} advanced setting${a.hiddenAdvancedCount===1?"":"s"}`}):void 0},o)}),r("div",{class:"ac-form__actions",children:[r("button",{type:"button",class:"ac-button",onClick:()=>{Pl()},children:"Reload"}),r("button",{type:"button",class:"ac-button ac-button--primary",onClick:()=>{os()},children:"Preview & Save"})]})]}),je.value!==null?r(ps,{changes:je.value}):null,Mn.value!==null?r(hs,{block:Mn.value}):null]})}const Ht=m(!1),un=m(null);async function _s(){It.value=!0,Rt.value=null;try{const e=await j("/api/v1/modules/detect");Ar.value=e.candidates,Ba.value=e.project_root;const n={};for(const i of e.candidates)n[i.path]=!0;Lt.value=n,$t.value=e.proposed_block.enabled,Pt.value=e.proposed_block.namespace_template??"",Mt.value=e.proposed_block.agent_folder??"agents"}catch(e){Rt.value=e instanceof V?ce(e.body.error??{code:"UNKNOWN",message:e.message}):e instanceof Error?e.message:String(e)}finally{It.value=!1,Sc.value=!0}}function ms(){const e=new Set(Ar.value.map(l=>l.path)),n=Lt.value,i=Object.keys(n).filter(l=>n[l]===!0&&e.has(l));return{enabled:$t.value,root_paths:i,namespace_template:Pt.value,agent_folder:Mt.value||"agents"}}async function gs(){Ht.value=!0,un.value=null;try{const e=await j("/api/v1/modules/apply",{method:"POST",body:ms()});un.value={message:e.appliedTo!==null?`Saved project settings to ${e.appliedTo}.`:`Saved project settings to ${e.projectRoot}.`,tone:"success"}}catch(e){const n=e instanceof V?ce(e.body.error??{code:"UNKNOWN",message:e.message}):e instanceof Error?e.message:String(e);un.value={message:`Could not save project settings: ${n}`,tone:"error"}}finally{Ht.value=!1}}function ys(){if(It.value)return r("p",{children:"Detecting module roots…"});if(Rt.value!==null)return r("p",{class:"ac-banner ac-banner--error",children:["Module detection failed: ",Rt.value]});const e=Ar.value,n=Lt.value,i=Ba.value;return r("div",{class:"ac-section",children:[i!==null?r("p",{class:"ac-section__description",children:["Scanning ",r("code",{children:i}),". Pick which detected roots the agent should treat as modules. These write to",r("code",{children:" .agent-project-settings.yml"})," in this repo only."]}):null,r("label",{children:[r("input",{type:"checkbox",checked:$t.value,onChange:l=>{$t.value=l.currentTarget.checked}})," ","Enable module discovery (writes ",r("code",{children:"modules.enabled"}),")"]}),e.length===0?r("p",{children:[r("em",{children:"No module roots detected."})," The scan found no common module layouts (Laravel ",r("code",{children:"app/Modules/"}),", Symfony",r("code",{children:" src/Module/"}),", Node ",r("code",{children:"packages/"}),", Python",r("code",{children:" src/"}),", Go ",r("code",{children:"internal/"}),")."]}):r("ul",{style:"list-style: none; padding-left: 0;",children:e.map(l=>r("li",{children:r("label",{children:[r("input",{type:"checkbox",checked:n[l.path]??!1,onChange:a=>{const o=a.currentTarget.checked;Lt.value={...n,[l.path]:o}}})," ",r("code",{children:l.path})," — ",l.stack," ",r("small",{children:["(",l.confidence," confidence)"]})]})},l.path))}),r("div",{class:"ac-wizard__module-fields",children:[r("div",{class:"ac-field",children:[r("label",{class:"ac-field__label",for:"ac-modules-namespace",children:"Namespace template"}),r("input",{id:"ac-modules-namespace",class:"ac-input",type:"text",value:Pt.value,placeholder:"e.g. App\\\\Modules\\\\{ModuleName}\\\\App",onInput:l=>{Pt.value=l.currentTarget.value}}),r("span",{class:"ac-field__description",children:"How a module path maps to its namespace. Leave blank to skip namespacing."})]}),r("div",{class:"ac-field",children:[r("label",{class:"ac-field__label",for:"ac-modules-agent-folder",children:"Agent folder"}),r("input",{id:"ac-modules-agent-folder",class:"ac-input",type:"text",value:Mt.value,placeholder:"agents",onInput:l=>{Mt.value=l.currentTarget.value}}),r("span",{class:"ac-field__description",children:["Folder name that holds per-module agent docs (default ",r("code",{children:"agents"}),")."]})]})]})]})}function bs(){return Ae(()=>{_s()},[]),r("div",{class:"ac-page",children:[r("header",{class:"ac-page__header",children:[r("h1",{children:"Project settings"}),r("p",{class:"ac-section__description",children:["Configuration scoped to this repository — written to",r("code",{children:" .agent-project-settings.yml"}),", not the global tree."]})]}),un.value!==null?r("p",{class:`ac-banner ac-banner--${un.value.tone==="success"?"success":"error"}`,children:un.value.message}):null,r("section",{class:"ac-section",children:[r("h2",{class:"ac-section__title",children:"Modules"}),r(ys,{})]}),r("div",{class:"ac-form__actions ac-wizard__nav",children:r("button",{type:"button",class:"ac-button ac-button--primary",disabled:Ht.value||It.value,onClick:()=>{gs()},children:Ht.value?"Saving…":"Save project settings"})})]})}const gt=m([]),Fn=m([]),ur=m([]),dr=m([]),qt=m(null),io=m(!1),Tn=m(null),oe=m(null),Di=m("plain"),Wt=m({}),ro=m([]),Ml={"claude-code":"Claude Code",codex:"Codex",gemini:"Gemini"};function ks(){try{return globalThis.sessionStorage?.getItem("ac-workspace-host")??"claude-code"}catch{return"claude-code"}}const $r=m(ks());function ws(e){$r.value=e;try{globalThis.sessionStorage?.setItem("ac-workspace-host",e)}catch{}}const jn=m([]),me=m(null),ln=m({}),De=m(!1),Dn=m(null),$e=m(""),En=m(!1),li=m(!1),fr=m(null),Ue=m(null),Un=m([]),yt=m(new Set),lo="claude-code",Fl=2e3;async function Ss(){Tn.value=null;try{const[e,n,i,l,a,o]=await Promise.all([j("/api/v1/workspace/roles"),j("/api/v1/workspace/sessions?limit=20"),j("/api/v1/workspace/knowledge?limit=20"),j("/api/v1/workspace/documents?limit=20"),j("/api/v1/workspace/drive-health").catch(()=>({health:{}})),j("/api/v1/workspace/hosts").catch(()=>({hosts:[]}))]);gt.value=e.roles,Fn.value=n.sessions,ur.value=i.chunks,dr.value=l.documents,Wt.value=a.health??{},ro.value=o.hosts??[],io.value=!0}catch(e){e instanceof V?Tn.value=e.body?.error?.message??e.message:Tn.value=e instanceof Error?e.message:String(e)}}async function As(e,n){try{const i=await j(`/api/v1/workspace/roles/${e}/tasks`);jn.value=i.tasks}catch{jn.value=n}}async function Pr(e){Ue.value=e,yt.value=new Set;try{const n=await j(`/api/v1/workspace/sessions/${e}`);Un.value=Array.isArray(n.log)?n.log:[]}catch{Un.value=[]}}async function Cs(e){oe.value=null,li.value=!1,$e.value="",me.value=null,await Pr(e)}async function ao(e,n,i){oe.value=null,De.value=!0,$e.value="",li.value=!1,fr.value={role:e,task:n,inputs:i};try{const l=await j("/api/v1/workspace/launch",{method:"POST",body:{role:e,task:n,inputs:i,host:$r.value}});Dn.value=l,oe.value=oo(l),me.value=null,await Pr(l.id);const a=await j("/api/v1/workspace/sessions?limit=20");Fn.value=a.sessions,await Mr()}catch(l){Dn.value=null,l instanceof V?oe.value=l.body?.error?.message??l.message:oe.value=l instanceof Error?l.message:String(l)}finally{De.value=!1}}async function xs(e,n){if(!(n.trim()===""||En.value)){En.value=!0,oe.value=null;try{const i=await j(`/api/v1/workspace/sessions/${e}/continue`,{method:"POST",body:{prompt:n}});Dn.value=i,oe.value=oo(i),i.driven&&($e.value=""),await Pr(e);const l=await j("/api/v1/workspace/sessions?limit=20");Fn.value=l.sessions,await Mr()}catch(i){i instanceof V&&i.status===410?(li.value=!0,oe.value="Host session expired — start a new conversation."):i instanceof V?oe.value=i.body?.error?.message??i.message:oe.value=i instanceof Error?i.message:String(i)}finally{En.value=!1}}}async function Mr(){try{const e=await j("/api/v1/workspace/drive-health");Wt.value=e.health??{}}catch{}}async function Ts(e){try{await j(`/api/v1/workspace/drive-health/${e}/reset`,{method:"POST"}),await Mr()}catch{}}function oo(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 ${lo} 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 Es({role:e}){const n=qt.value===e.slug;return r("button",{type:"button",class:`ac-workspace__role${n?" ac-workspace__role--active":""}`,"aria-current":n?"true":void 0,"aria-label":`Pick role ${e.display_name}`,onClick:()=>{qt.value=e.slug,oe.value=null,Dn.value=null,me.value=null,ln.value={},jn.value=e.first_tasks,As(e.slug,e.first_tasks)},children:[r("span",{class:"ac-workspace__role-name",children:e.display_name}),r("span",{class:"ac-workspace__role-status","data-status":e.status,children:e.status}),r("span",{class:"ac-workspace__role-tagline",children:e.tagline})]})}function Os({role:e,task:n}){const i=n.inputs??[],l=ln.value,a=i.some(o=>o.required&&(l[o.name]??"").trim()==="");return r("form",{class:"ac-workspace__task-form",onSubmit:o=>{o.preventDefault(),!a&&!De.value&&ao(e,n.name,ln.value)},children:[i.length===0?r("p",{class:"ac-workspace__form-note",children:"No inputs — runs the prompt as-is."}):i.map(o=>r("label",{class:"ac-workspace__field",children:[r("span",{class:"ac-workspace__field-label",children:[o.name,o.required?r("span",{class:"ac-workspace__req","aria-hidden":"true",children:" *"}):null]}),r("textarea",{class:"ac-workspace__field-input",placeholder:o.shape,required:o.required,"aria-label":`${o.name}${o.required?" (required)":""}`,value:l[o.name]??"",onInput:s=>{ln.value={...ln.value,[o.name]:s.target.value}}})]},o.name)),r("div",{class:"ac-workspace__form-actions",children:[r("button",{type:"submit",class:"ac-button ac-button--primary",disabled:a||De.value,children:De.value?"Running…":"Run task"}),r("button",{type:"button",class:"ac-button",onClick:()=>{me.value=null},children:"Cancel"})]})]})}function Ns(e){const n=[];for(const i of e){const l=i.data??{};if(i.kind==="launcher.input")l.followup===!0?n.push({kind:"user",text:typeof l.prompt=="string"?l.prompt:""}):n.push({kind:"task",text:typeof l.task=="string"?l.task:""});else if(i.kind==="host.turn"){const a=l.usage,o=a!=null?`${typeof l.model=="string"?l.model:lo} · in ${a.input_tokens??0} / out ${a.output_tokens??0} tokens`:void 0;n.push({kind:"assistant",text:typeof l.text=="string"?l.text:"",meta:o})}else if(i.kind==="host.error"){const a=typeof l.error_kind=="string"?l.error_kind:"error";n.push({kind:"error",text:`${a}: ${typeof l.error=="string"?l.error:""}`})}}return n}function Is(){if(Ue.value===null)return null;const e=Ns(Un.value),n=Un.value.some(i=>i.kind==="host.turn");return r("section",{class:"ac-workspace__thread","aria-label":"Conversation thread",children:[r("h2",{class:"ac-workspace__heading",children:"Conversation"}),e.length===0?r("p",{class:"ac-workspace__empty",children:"No turns yet."}):r("ol",{class:"ac-workspace__thread-list",children:e.map((i,l)=>{const a=i.kind==="assistant"&&i.text.length>Fl,o=yt.value.has(l),s=a&&!o?`${i.text.slice(0,Fl)}…`:i.text;return r("li",{class:`ac-workspace__thread-block ac-workspace__thread-block--${i.kind}`,children:[r("span",{class:"ac-workspace__thread-role",children:i.kind==="task"?"Task":i.kind==="user"?"You":i.kind==="assistant"?"Host":"Error"}),r("pre",{class:"ac-workspace__thread-text",children:s}),a?r("button",{type:"button",class:"ac-button",onClick:()=>{const d=new Set(yt.value);d.has(l)?d.delete(l):d.add(l),yt.value=d},children:o?"Show less":"Show full"}):null,i.meta!=null?r("p",{class:"ac-workspace__turn-meta",children:i.meta}):null]},l)})}),li.value?r("div",{class:"ac-workspace__followup-gone",role:"status",children:[r("p",{children:"Host session expired."}),fr.value!==null?r("button",{type:"button",class:"ac-button ac-button--primary",disabled:De.value,onClick:()=>{const i=fr.value;i!==null&&ao(i.role,i.task,i.inputs)},children:De.value?"Starting…":"Start a new conversation"}):r("p",{children:"Pick a task above to start a new conversation."})]}):n?r("form",{class:"ac-workspace__followup",onSubmit:i=>{i.preventDefault(),Ue.value!==null&&xs(Ue.value,$e.value)},children:[r("label",{class:"ac-workspace__field",children:[r("span",{class:"ac-workspace__field-label",children:"Follow up"}),r("textarea",{class:"ac-workspace__field-input",placeholder:"Continue this conversation — e.g. make it shorter","aria-label":"Follow-up prompt",value:$e.value,onInput:i=>{$e.value=i.target.value}})]}),r("button",{type:"submit",class:"ac-button ac-button--primary",disabled:$e.value.trim()===""||En.value,children:En.value?"Continuing…":"Send follow-up"})]}):null]})}function Rs({role:e}){const n=jn.value.length>0?jn.value:e.first_tasks;return r("section",{class:"ac-workspace__tasks","aria-labelledby":"task-heading",children:[r("h2",{id:"task-heading",class:"ac-workspace__heading",children:["First tasks · ",e.display_name]}),n.length===0?r("p",{class:"ac-workspace__empty",children:"No tasks scaffolded yet for this role."}):r("ul",{class:"ac-workspace__task-list",children:n.map(i=>r("li",{class:"ac-workspace__task",children:[r("div",{class:"ac-workspace__task-head",children:[r("span",{class:"ac-workspace__task-name",children:i.name}),r("button",{type:"button",class:"ac-button ac-button--primary","aria-expanded":me.value===i.name,onClick:()=>{me.value=me.value===i.name?null:i.name,ln.value={},Dn.value=null,Ue.value=null,Un.value=[]},children:me.value===i.name?"Close":"Start session"})]}),r("p",{class:"ac-workspace__task-intent",children:i.intent}),i.prompt!==""?r("code",{class:"ac-workspace__task-prompt",children:["prompts/",i.prompt]}):null,me.value===i.name?r(Os,{role:e.slug,task:i}):null]},i.name))}),e.skills.length>0?r("details",{class:"ac-workspace__skills",children:[r("summary",{children:["Skill shortlist (",e.skills.length,")"]}),r("ul",{class:"ac-workspace__skill-list",children:[e.skills.slice(0,5).map(i=>r("li",{class:"ac-workspace__skill",children:[r("code",{children:i.id})," — ",i.why]},i.id)),e.skills.length>5?r("li",{class:"ac-workspace__skill-more",children:["+ ",e.skills.length-5," more"]}):null]})]}):null]})}function Ls(){return r("section",{class:"ac-workspace__sessions","aria-labelledby":"sessions-heading",children:[r("h2",{id:"sessions-heading",class:"ac-workspace__heading",children:"Recent sessions"}),Fn.value.length===0?r("p",{class:"ac-workspace__empty",children:"No sessions yet — pick a role and start one."}):r("ul",{class:"ac-workspace__session-list",children:Fn.value.map(e=>r("li",{class:"ac-workspace__session",children:r("button",{type:"button",class:`ac-workspace__session-open${Ue.value===e.id?" ac-workspace__session-open--active":""}`,"aria-label":`Open session ${e.task}`,"aria-current":Ue.value===e.id?"true":void 0,onClick:()=>{Cs(e.id)},children:[r("span",{class:"ac-workspace__session-id",children:e.id.slice(0,16)}),r("span",{class:"ac-workspace__session-role",children:e.role}),r("span",{class:"ac-workspace__session-task",children:e.task})]})},e.id))})]})}function $s(){return r("section",{class:"ac-workspace__knowledge","aria-labelledby":"knowledge-heading",children:[r("h2",{id:"knowledge-heading",class:"ac-workspace__heading",children:"Knowledge sources"}),ur.value.length===0?r("p",{class:"ac-workspace__empty",children:["No sources yet. Run ",r("code",{children:"/knowledge:ingest <path>"})," to add documents."]}):r("ol",{class:"ac-workspace__citation-list",children:ur.value.map((e,n)=>r("li",{class:"ac-workspace__citation",children:[r("span",{class:"ac-workspace__citation-marker","aria-label":`Citation ${n+1}`,children:["[",n+1,"]"]}),r("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?r("span",{class:"ac-workspace__citation-pin","aria-label":"pinned",children:"★"}):null,r("p",{class:"ac-workspace__citation-excerpt",children:[e.excerpt.slice(0,200),e.excerpt.length>200?"…":""]})]},e.id))})]})}function Ps(){return r("section",{class:"ac-workspace__recent","aria-labelledby":"recent-heading",children:[r("h2",{id:"recent-heading",class:"ac-workspace__heading",children:"Recent documents"}),dr.value.length===0?r("p",{class:"ac-workspace__empty",children:"No documents yet. Saved drafts land here."}):r("ul",{class:"ac-workspace__doc-list",children:dr.value.map(e=>r("li",{class:"ac-workspace__doc",children:[r("span",{class:"ac-workspace__doc-type","data-type":e.type,children:e.type}),r("span",{class:"ac-workspace__doc-title",children:e.title}),r("time",{class:"ac-workspace__doc-time",dateTime:e.updated_at,children:e.updated_at.slice(0,10)})]},`${e.type}/${e.slug}`))})]})}function Ms(){const n=Object.values(Wt.value).filter(i=>i.killed||i.consecutive_failures>0);return r("section",{class:"ac-workspace__drive-health","aria-labelledby":"drive-health-heading",children:[r("h2",{id:"drive-health-heading",class:"ac-workspace__heading",children:"Host health"}),n.length===0?r("p",{class:"ac-workspace__empty",children:"All hosts healthy."}):r("ul",{class:"ac-workspace__health-list",children:Object.entries(Wt.value).filter(([,i])=>i.killed||i.consecutive_failures>0).map(([i,l])=>{const a=l.killed?l.kill_reason==="manual"?"paused (manual)":"paused — auto-recovering":"degraded";return r("li",{class:"ac-workspace__health","data-killed":l.killed?"true":"false",children:[r("span",{class:"ac-workspace__health-host",children:i}),r("span",{class:"ac-workspace__health-state",children:a}),r("span",{class:"ac-workspace__health-meta",children:[l.consecutive_failures," fail streak",l.last_error_kind!=null?` · ${l.last_error_kind}`:""]}),l.killed?r("button",{type:"button",class:"ac-button ac-workspace__health-reset","aria-label":`Reset ${i}`,onClick:()=>{Ts(i)},children:"Reset"}):null]},i)})})]})}function Fs(){const e=Di.value;return r("fieldset",{class:"ac-workspace__explain",children:[r("legend",{class:"ac-workspace__heading",children:"Explanation style"}),r("label",{class:"ac-workspace__explain-option",children:[r("input",{type:"radio",name:"explain-mode",value:"plain",checked:e==="plain",onChange:()=>{Di.value="plain"},"aria-label":"Plain language"}),r("span",{children:"Plain language"})]}),r("label",{class:"ac-workspace__explain-option",children:[r("input",{type:"radio",name:"explain-mode",value:"technical",checked:e==="technical",onChange:()=>{Di.value="technical"},"aria-label":"Technical detail"}),r("span",{children:"Technical detail"})]}),r("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 js(){const e=ro.value,n=e.length>0?e.map(l=>l.id):Object.keys(Ml),i=new Map(e.map(l=>[l.id,l.cli_present]));return r("label",{class:"ac-workspace__host-picker",children:[r("span",{class:"ac-workspace__host-label",children:"Host"}),r("select",{class:"ac-workspace__host-select","aria-label":"Host agent",value:$r.value,onChange:l=>{ws(l.target.value)},children:n.map(l=>{const a=i.get(l)!==!1,o=Ml[l]??l;return r("option",{value:l,disabled:!a,children:[o," (",l,")",a?"":" — not installed"]},l)})})]})}function Ds(){if(Ae(()=>{Ss()},[]),Tn.value!==null)return r("div",{class:"ac-page ac-page--error",children:[r("h1",{children:"Workspace"}),r("p",{class:"ac-banner ac-banner--error",children:Tn.value})]});if(!io.value)return r("div",{class:"ac-page",children:[r("h1",{children:"Workspace"}),r("p",{children:"Loading…"})]});const e=qt.value!==null?gt.value.find(n=>n.slug===qt.value)??null:null;return r("div",{class:"ac-page ac-workspace",children:[r("header",{class:"ac-page__header",children:[r("h1",{children:"Workspace"}),r("p",{class:"ac-page__subtitle",children:"Pick a role, pick a first task, run it."}),r(js,{})]}),oe.value!==null?r("p",{class:"ac-banner",role:"status",children:oe.value}):null,r("div",{class:"ac-workspace__grid",children:[r("section",{class:"ac-workspace__roles","aria-labelledby":"roles-heading",children:[r("h2",{id:"roles-heading",class:"ac-workspace__heading",children:"Roles"}),gt.value.length===0?r("p",{class:"ac-workspace__empty",children:"No roles installed."}):r("div",{class:"ac-workspace__role-grid",children:gt.value.map(n=>r(Es,{role:n},n.slug))})]}),r("main",{class:"ac-workspace__main","aria-label":"Tasks and sessions",children:[e!==null?r(Rs,{role:e}):r("p",{class:"ac-workspace__empty",children:"Pick a role on the left to see its first tasks."}),r(Is,{}),r(Ls,{})]}),r("aside",{class:"ac-workspace__rail","aria-label":"Knowledge and documents",children:[r($s,{}),r(Ps,{}),r(Ms,{}),r(Fs,{})]})]})]})}const co="agent-config-theme";function Us(){return(typeof document<"u"?document.documentElement.getAttribute("data-theme"):null)==="dark"?"dark":"light"}const On=m(Us());function Bs(){try{const e=localStorage.getItem(co);return e==="light"||e==="dark"?e:null}catch{return null}}function Hs(){if(typeof window>"u")return null;try{const e=new URLSearchParams(window.location.search).get("theme");return e==="light"||e==="dark"?e:null}catch{return null}}function qs(){return Bs()===null&&Hs()===null}function so(e){On.value=e,document.documentElement.setAttribute("data-theme",e)}function Ws(){const e=On.value==="dark"?"light":"dark";try{localStorage.setItem(co,e)}catch{}so(e)}function Ys(){if(typeof window>"u"||typeof window.matchMedia!="function")return;const e=window.matchMedia("(prefers-color-scheme: dark)"),n=()=>{qs()&&so(e.matches?"dark":"light")};typeof e.addEventListener=="function"&&e.addEventListener("change",n)}function zs(){return typeof window>"u"?!1:new URLSearchParams(window.location.search).get("embed")==="1"}const Ks=zs(),uo=[{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 fo(e){for(const n of uo)for(const i of n.matches)if(e===i||e.startsWith(`${i}/`))return n.id;return null}function Gs(e){const n=Be.value,i=fo(e);return uo.filter(l=>l.id==="project"?n?.projectSurface===!0||i==="project":l.id==="workspace"?n?.devSurfaces===!0||i==="workspace":!0)}function Vs(){const e=Tt.value,n=fo(e);return r("header",{class:"ac-topnav",children:r("div",{class:"ac-topnav__inner",children:[r("div",{class:"ac-topnav__brand",children:[r("h1",{class:"ac-topnav__title",children:"@event4u/agent-config"}),r("p",{class:"ac-topnav__subtitle",children:"Browser Wizard"})]}),r("nav",{class:"ac-topnav__tabs","aria-label":"Surfaces",children:Gs(e).map(i=>r("button",{type:"button",class:`ac-topnav__tab${n===i.id?" ac-topnav__tab--active":""}`,"aria-current":n===i.id?"page":void 0,onClick:()=>Gt(i.hashPath),children:i.label},i.id))}),r("button",{type:"button",class:"ac-topnav__theme","aria-label":On.value==="dark"?"Switch to light theme":"Switch to dark theme",title:On.value==="dark"?"Switch to light theme":"Switch to dark theme",onClick:()=>{Ws()},children:On.value==="dark"?"☀":"☾"})]})})}function Js({path:e}){return r("div",{class:"ac-page ac-page--error",children:[r("h1",{children:"Page not found"}),r("p",{children:["Nothing routed to ",r("code",{children:e}),". Try ",r("a",{href:"#/setup",children:"Setup"}),"."]})]})}function Qs(){const e=Be.value;return e===null||e.dryRun!==!0?null:r("div",{class:"ac-dryrun-banner",role:"status","aria-live":"polite",children:[r("strong",{children:"DRY RUN"}),r("span",{children:" · no files will be written. Validation + rendering run normally; commits return a preview."})]})}function Zs(e){return e==="/"||e==="/setup"||e.startsWith("/setup/")?r(Rl,{path:e}):e.startsWith("/wizard")?r(Rl,{path:e}):e==="/settings/changes"?r(ls,{}):e==="/settings"||e.startsWith("/settings/")?r(vs,{}):e==="/project"||e.startsWith("/project/")?r(bs,{}):e==="/workspace"?r(Ds,{}):r(Js,{path:e})}function Xs(){return Ae(()=>{$o(),Tt.value==="/"&&Gt("/setup"),Fo()},[]),r(te,{children:[r(Qs,{}),Ks?null:r(Vs,{}),Zs(Tt.value)]})}const eu=3e4,nu=30*6e4;let st=null,jl=!1;function Dl(e){if(!jl&&(jl=!0,!(typeof navigator>"u"||typeof navigator.sendBeacon!="function")))try{navigator.sendBeacon(`/api/v1/shutdown?token=${encodeURIComponent(e)}`)}catch{}}function tu(e){if(typeof window>"u")return()=>{};let n=Date.now();const i=()=>{n=Date.now()},l=["pointerdown","keydown","wheel","touchstart"];for(const d of l)window.addEventListener(d,i,{passive:!0});const a=()=>{document.hidden||i()};document.addEventListener("visibilitychange",a);const o=()=>{st!==null&&clearInterval(st),st=null;for(const d of l)window.removeEventListener(d,i);document.removeEventListener("visibilitychange",a),window.removeEventListener("pagehide",s)};st=setInterval(()=>{if(!document.hidden){if(Date.now()-n>nu){Dl(e),o();return}j("/api/v1/ping").catch(()=>{})}},eu);function s(){Dl(e)}return window.addEventListener("pagehide",s),o}function iu(){if(typeof window>"u"||typeof window.history?.replaceState!="function")return;const e=new URLSearchParams(window.location.search);if(!e.has("token"))return;e.delete("token");const n=e.toString(),i=window.location.pathname+(n?`?${n}`:"")+window.location.hash;window.history.replaceState(window.history.state,"",i)}function ru(){return new URLSearchParams(window.location.search).get("token")}function lu(){const e=document.getElementById("app");if(e===null)return;const n=ru();if(n===null){e.textContent="agent-config UI · missing token — re-open via `agent-config ui:serve`.";return}Po(n),iu(),tu(n),Ys(),e.textContent="",bo(r(Xs,{}),e)}lu();
40
+ //# sourceMappingURL=index-BpSQt5vm.js.map