@event4u/agent-config 3.3.0 → 4.2.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 (561) hide show
  1. package/.agent-src/README.md +2 -2
  2. package/.agent-src/commands/agent-handoff.md +31 -2
  3. package/.agent-src/commands/agent-status.md +5 -5
  4. package/.agent-src/commands/agents/audit.md +8 -8
  5. package/.agent-src/commands/agents/init.md +25 -1
  6. package/.agent-src/commands/agents/optimize.md +3 -3
  7. package/.agent-src/commands/agents/user.md +1 -1
  8. package/.agent-src/commands/agents.md +1 -1
  9. package/.agent-src/commands/analyze-reference-repo.md +1 -1
  10. package/.agent-src/commands/check-current-md.md +8 -8
  11. package/.agent-src/commands/{compress.md → condense.md} +55 -55
  12. package/.agent-src/commands/context/create.md +7 -4
  13. package/.agent-src/commands/context/refactor.md +3 -1
  14. package/.agent-src/commands/feature/dev.md +1 -1
  15. package/.agent-src/commands/feature/explore.md +1 -1
  16. package/.agent-src/commands/feature/plan.md +10 -8
  17. package/.agent-src/commands/feature/refactor.md +3 -1
  18. package/.agent-src/commands/feature/roadmap.md +7 -4
  19. package/.agent-src/commands/fix/portability.md +3 -3
  20. package/.agent-src/commands/fix/refs.md +4 -4
  21. package/.agent-src/commands/ghostwriter.md +2 -2
  22. package/.agent-src/commands/memory/learn-low-impact.md +3 -3
  23. package/.agent-src/commands/module/explore.md +34 -8
  24. package/.agent-src/commands/optimize/agents-dir.md +9 -7
  25. package/.agent-src/commands/optimize/augmentignore.md +2 -2
  26. package/.agent-src/commands/optimize/skills.md +9 -9
  27. package/.agent-src/commands/post-as.md +1 -1
  28. package/.agent-src/commands/project-analyze.md +2 -2
  29. package/.agent-src/commands/project-health.md +3 -2
  30. package/.agent-src/commands/research/deep.md +1 -1
  31. package/.agent-src/commands/research/report.md +1 -1
  32. package/.agent-src/commands/research.md +1 -1
  33. package/.agent-src/commands/roadmap/ai-council.md +1 -1
  34. package/.agent-src/commands/roadmap/create.md +9 -4
  35. package/.agent-src/commands/rule-compliance-audit.md +1 -1
  36. package/.agent-src/commands/upstream-contribute.md +14 -14
  37. package/.agent-src/commands/video/from-script.md +1 -1
  38. package/.agent-src/commands/video/scene.md +1 -1
  39. package/.agent-src/commands/video/stitch.md +1 -1
  40. package/.agent-src/commands/video/storyboard.md +1 -1
  41. package/.agent-src/commands/video.md +1 -1
  42. package/.agent-src/contexts/augment-infrastructure.md +1 -1
  43. package/.agent-src/contexts/authority/commit-mechanics.md +15 -0
  44. package/.agent-src/contexts/authority/kernel-rule-edits.md +3 -3
  45. package/.agent-src/contexts/authority/scope-mechanics.md +1 -1
  46. package/.agent-src/contexts/communication/rules-auto/augment-source-of-truth-mechanics.md +28 -28
  47. package/.agent-src/contexts/communication/rules-auto/skill-quality-mechanics.md +4 -4
  48. package/.agent-src/contexts/communication/rules-auto/think-before-action-mechanics.md +2 -2
  49. package/.agent-src/contexts/contracts/artifact-engagement-flow.md +6 -6
  50. package/.agent-src/contexts/contracts/command-suggestion-flow.md +3 -3
  51. package/.agent-src/contexts/contracts/emergency-triage-block.md +4 -4
  52. package/.agent-src/contexts/contracts/frugality-charter.md +3 -3
  53. package/.agent-src/contexts/documentation-hierarchy.md +14 -7
  54. package/.agent-src/contexts/execution/autonomy-examples.md +1 -1
  55. package/.agent-src/contexts/execution/cheap-question-mechanics.md +39 -2
  56. package/.agent-src/contexts/execution/roadmap-process-loop.md +28 -5
  57. package/.agent-src/contexts/override-system.md +5 -5
  58. package/.agent-src/ghostwriter/fictional-fixture-v1.md +1 -1
  59. package/.agent-src/personas/advisors/first-principles.md +1 -1
  60. package/.agent-src/personas/hollywood-director.md +1 -1
  61. package/.agent-src/rules/architecture.md +5 -1
  62. package/.agent-src/rules/augment-edit-discipline.md +5 -5
  63. package/.agent-src/rules/augment-source-of-truth.md +15 -15
  64. package/.agent-src/rules/commit-conventions.md +1 -1
  65. package/.agent-src/rules/commit-policy.md +10 -0
  66. package/.agent-src/rules/domain-adoption-policy.md +3 -3
  67. package/.agent-src/rules/fast-path-marker-visibility.md +3 -3
  68. package/.agent-src/rules/finance-safety-floor.md +1 -1
  69. package/.agent-src/rules/framework-neutrality-in-generic-skills.md +8 -8
  70. package/.agent-src/rules/git-history-discipline.md +1 -1
  71. package/.agent-src/rules/improve-before-implement.md +2 -2
  72. package/.agent-src/rules/language-and-tone.md +2 -2
  73. package/.agent-src/rules/media-governance-routing.md +5 -5
  74. package/.agent-src/rules/no-attribution-footers.md +1 -0
  75. package/.agent-src/rules/no-cheap-questions.md +3 -0
  76. package/.agent-src/rules/no-decorative-emojis-in-git-surfaces.md +111 -0
  77. package/.agent-src/rules/no-pr-progress-comments.md +118 -0
  78. package/.agent-src/rules/no-roadmap-references.md +3 -3
  79. package/.agent-src/rules/non-destructive-by-default.md +1 -1
  80. package/.agent-src/rules/persona-governance.md +3 -3
  81. package/.agent-src/rules/preservation-guard.md +15 -15
  82. package/.agent-src/rules/roadmap-ci-steps-policy.md +7 -3
  83. package/.agent-src/rules/rule-type-governance.md +1 -1
  84. package/.agent-src/rules/skill-quality.md +1 -1
  85. package/.agent-src/rules/{caveman-speak.md → telegraph-speak.md} +15 -15
  86. package/.agent-src/rules/token-optimizer-maintenance.md +6 -6
  87. package/.agent-src/skills/agent-docs-writing/SKILL.md +17 -11
  88. package/.agent-src/skills/agents-md-thin-root/SKILL.md +9 -9
  89. package/.agent-src/skills/check-refs/SKILL.md +2 -2
  90. package/.agent-src/skills/code-refactoring/SKILL.md +2 -2
  91. package/.agent-src/skills/command-writing/SKILL.md +19 -19
  92. package/.agent-src/skills/comp-banding/SKILL.md +1 -1
  93. package/.agent-src/skills/condense-memory/SKILL.md +131 -0
  94. package/.agent-src/skills/context-authoring/SKILL.md +2 -2
  95. package/.agent-src/skills/context-document/SKILL.md +5 -3
  96. package/.agent-src/skills/copilot-agents-optimization/SKILL.md +3 -3
  97. package/.agent-src/skills/description-assist/SKILL.md +2 -2
  98. package/.agent-src/skills/git-workflow/SKILL.md +1 -1
  99. package/.agent-src/skills/guideline-writing/SKILL.md +5 -5
  100. package/.agent-src/skills/learning-to-rule-or-skill/SKILL.md +4 -4
  101. package/.agent-src/skills/lint-skills/SKILL.md +3 -3
  102. package/.agent-src/skills/md-language-check/SKILL.md +2 -2
  103. package/.agent-src/skills/module-detect-on-the-fly/SKILL.md +138 -0
  104. package/.agent-src/skills/module-management/SKILL.md +166 -94
  105. package/.agent-src/skills/override-management/SKILL.md +1 -1
  106. package/.agent-src/skills/persona-writing/SKILL.md +5 -5
  107. package/.agent-src/skills/positioning-strategy/SKILL.md +1 -1
  108. package/.agent-src/skills/project-docs/SKILL.md +6 -4
  109. package/.agent-src/skills/readme-reviewer/SKILL.md +2 -2
  110. package/.agent-src/skills/roadmap-management/SKILL.md +13 -1
  111. package/.agent-src/skills/roadmap-writing/SKILL.md +4 -2
  112. package/.agent-src/skills/rule-refactor/SKILL.md +5 -5
  113. package/.agent-src/skills/rule-writing/SKILL.md +18 -18
  114. package/.agent-src/skills/script-writing/SKILL.md +1 -1
  115. package/.agent-src/skills/skill-improvement-pipeline/SKILL.md +6 -6
  116. package/.agent-src/skills/skill-management/SKILL.md +21 -21
  117. package/.agent-src/skills/skill-reviewer/SKILL.md +2 -2
  118. package/.agent-src/skills/skill-writing/SKILL.md +8 -8
  119. package/.agent-src/skills/skill-writing/evals/triggers.json +1 -1
  120. package/.agent-src/skills/token-optimizer/SKILL.md +4 -4
  121. package/.agent-src/skills/unit-economics-modeling/SKILL.md +1 -1
  122. package/.agent-src/skills/upstream-contribute/SKILL.md +17 -17
  123. package/.agent-src/templates/AGENTS.md +1 -0
  124. package/.agent-src/templates/agent-settings.md +24 -13
  125. package/.agent-src/templates/agents/agent-project-settings.example.yml +61 -2
  126. package/.agent-src/templates/command.md +5 -5
  127. package/.agent-src/templates/contexts.md +1 -1
  128. package/.agent-src/templates/copilot-instructions.md +8 -8
  129. package/.agent-src/templates/features.md +1 -1
  130. package/.agent-src/templates/hooks/pre-commit-frontmatter +2 -2
  131. package/.agent-src/templates/hooks/pre-commit-roadmap-progress +3 -3
  132. package/.agent-src/templates/persona.md +2 -2
  133. package/.agent-src/templates/roadmaps.md +1 -1
  134. package/.agent-src/templates/rule.md +13 -13
  135. package/.agent-src/templates/scripts/memory_lookup.py +1 -1
  136. package/.agent-src/templates/scripts/memory_status.py +2 -2
  137. package/.agent-src/templates/scripts/work_engine/_lib/agent_settings.py +195 -1
  138. package/.agent-src/templates/scripts/work_engine/orchestration.py +1 -1
  139. package/.agent-src/templates/skill-archive-note.md +5 -5
  140. package/.agent-src/templates/skill.md +1 -1
  141. package/.claude-plugin/marketplace.json +4 -4
  142. package/AGENTS.md +16 -17
  143. package/CHANGELOG.md +216 -3
  144. package/CONTRIBUTING.md +31 -12
  145. package/README.md +21 -12
  146. package/config/agent-settings.template.yml +22 -2
  147. package/config/discovery/unassigned-artefacts.yml +24 -24
  148. package/config/profiles/full.ini +1 -1
  149. package/dist/cli/agent-config.js +52 -3
  150. package/dist/cli/agent-config.js.map +1 -1
  151. package/dist/cli/commands/uiServe.js +9 -0
  152. package/dist/cli/commands/uiServe.js.map +1 -1
  153. package/dist/cli/registry.js +2 -1
  154. package/dist/cli/registry.js.map +1 -1
  155. package/dist/discovery/deprecation-report.md +1 -1
  156. package/dist/discovery/discovery-manifest.json +649 -606
  157. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  158. package/dist/discovery/discovery-manifest.summary.md +4 -4
  159. package/dist/discovery/orphan-report.md +1 -1
  160. package/dist/discovery/packs.json +439 -437
  161. package/dist/discovery/trust-report.md +5 -5
  162. package/dist/discovery/workspaces.json +450 -448
  163. package/dist/install/atomic.js +92 -0
  164. package/dist/install/atomic.js.map +1 -0
  165. package/dist/install/conflict.js +196 -0
  166. package/dist/install/conflict.js.map +1 -0
  167. package/dist/install/detect.js +218 -0
  168. package/dist/install/detect.js.map +1 -0
  169. package/dist/install/paths.js +82 -0
  170. package/dist/install/paths.js.map +1 -0
  171. package/dist/install/plan.js +157 -0
  172. package/dist/install/plan.js.map +1 -0
  173. package/dist/install/txlog.js +140 -0
  174. package/dist/install/txlog.js.map +1 -0
  175. package/dist/install/types.js +19 -0
  176. package/dist/install/types.js.map +1 -0
  177. package/dist/install/wizard-plan.js +184 -0
  178. package/dist/install/wizard-plan.js.map +1 -0
  179. package/dist/mcp/registry-manifest.json +4 -4
  180. package/dist/router.json +67 -19
  181. package/dist/server/app.js +6 -0
  182. package/dist/server/app.js.map +1 -1
  183. package/dist/server/routes/install.js +358 -0
  184. package/dist/server/routes/install.js.map +1 -0
  185. package/dist/server/routes/wizard.js +468 -32
  186. package/dist/server/routes/wizard.js.map +1 -1
  187. package/dist/server/routes/workspace.js +396 -0
  188. package/dist/server/routes/workspace.js.map +1 -0
  189. package/dist/server/schemas/settings.js +5 -3
  190. package/dist/server/schemas/settings.js.map +1 -1
  191. package/dist/ui/assets/index-BDAhhpDV.js +40 -0
  192. package/dist/ui/assets/index-BDAhhpDV.js.map +1 -0
  193. package/dist/ui/assets/index-BXZILUxe.css +1 -0
  194. package/dist/ui/index.html +2 -2
  195. package/docs/MIGRATION.md +1 -1
  196. package/docs/adrs/cost/0001-hard-stop-hook.md +1 -1
  197. package/docs/adrs/router/0001-three-tier-routing.md +4 -4
  198. package/docs/adrs/schema/0001-json-schema-frontmatter.md +1 -1
  199. package/docs/adrs/smoke/0001-per-tier-smoke-scripts.md +4 -4
  200. package/docs/adrs/{caveman → telegraph}/0001-default-off-until-bench.md +9 -9
  201. package/docs/adrs/telegraph/README.md +9 -0
  202. package/docs/architecture/augment-projection.md +4 -4
  203. package/docs/architecture/claude-bundle.md +1 -1
  204. package/docs/architecture/current-onboard-baseline.md +3 -3
  205. package/docs/architecture/multi-tool-projection.md +10 -10
  206. package/docs/architecture/source-projection.md +27 -27
  207. package/docs/architecture.md +19 -15
  208. package/docs/archive/CHANGELOG-pre-2.11.0.md +2 -2
  209. package/docs/archive/CHANGELOG-pre-2.15.0.md +3 -3
  210. package/docs/archive/CHANGELOG-pre-2.16.0.md +1 -1
  211. package/docs/archive/CHANGELOG-pre-2.2.0.md +70 -70
  212. package/docs/archive/CHANGELOG-pre-2.20.0.md +2 -2
  213. package/docs/archive/CHANGELOG-pre-2.25.0.md +15 -15
  214. package/docs/archive/CHANGELOG-pre-3.0.0.md +4 -4
  215. package/docs/archive/CHANGELOG-pre-3.1.0.md +2 -2
  216. package/docs/archive/CHANGELOG-pre-3.2.0.md +3 -3
  217. package/docs/benchmark.md +65 -0
  218. package/docs/benchmarks.md +16 -16
  219. package/docs/catalog.md +17 -15
  220. package/docs/contracts/CHANGELOG-conventions.md +1 -1
  221. package/docs/contracts/STABILITY.md +2 -2
  222. package/docs/contracts/adoption-signal-floor.md +110 -0
  223. package/docs/contracts/adr-chat-history-split.md +4 -4
  224. package/docs/contracts/adr-command-suggestion.md +4 -4
  225. package/docs/contracts/adr-gtm-context-spine.md +1 -1
  226. package/docs/contracts/adr-implement-ticket-runtime.md +4 -4
  227. package/docs/contracts/adr-install-user-type-axis.md +1 -1
  228. package/docs/contracts/adr-layout.md +2 -2
  229. package/docs/contracts/adr-product-ui-track.md +10 -10
  230. package/docs/contracts/adr-user-types-axis.md +3 -3
  231. package/docs/contracts/adr-wing4-context-spine.md +1 -1
  232. package/docs/contracts/agent-memory-contract.md +3 -3
  233. package/docs/contracts/agents-md-tech-stack.md +2 -2
  234. package/docs/contracts/ai-council-config.md +2 -2
  235. package/docs/contracts/at-rest-encryption.md +4 -0
  236. package/docs/contracts/audit-log-v1.md +1 -1
  237. package/docs/contracts/benchmark-ab-contract.md +101 -0
  238. package/docs/contracts/benchmark-corpus-spec.md +1 -1
  239. package/docs/contracts/branch-protection-policy.md +98 -0
  240. package/docs/contracts/ci-cost-budget.md +106 -0
  241. package/docs/contracts/ci-green-floor.md +141 -0
  242. package/docs/contracts/command-clusters.md +6 -6
  243. package/docs/contracts/command-surface-tiers.md +2 -2
  244. package/docs/contracts/command-taxonomy.md +2 -2
  245. package/docs/contracts/{compression-default-kill-criterion.md → condensation-default-kill-criterion.md} +29 -29
  246. package/docs/contracts/config-presets.md +1 -1
  247. package/docs/contracts/context-paths.md +3 -3
  248. package/docs/contracts/context-spine.md +1 -1
  249. package/docs/contracts/cost-summary-schema.md +12 -12
  250. package/docs/contracts/cross-wing-handoff.md +4 -4
  251. package/docs/contracts/daily-workspace.md +4 -0
  252. package/docs/contracts/decision-trace-v1.md +2 -2
  253. package/docs/contracts/discovery-manifest.md +4 -4
  254. package/docs/contracts/explain-modes.md +4 -0
  255. package/docs/contracts/file-ownership-matrix.json +3493 -3318
  256. package/docs/contracts/file-ownership-matrix.md +3 -3
  257. package/docs/contracts/frontmatter-contract.md +4 -4
  258. package/docs/contracts/ghostwriter-schema.md +3 -3
  259. package/docs/contracts/gui-wizard.md +110 -97
  260. package/docs/contracts/harness-expectations.md +123 -0
  261. package/docs/contracts/host-agent-protocol.md +4 -0
  262. package/docs/contracts/implement-ticket-flow.md +9 -9
  263. package/docs/contracts/install-scopes.md +77 -0
  264. package/docs/contracts/iron-law-overrides.txt +1 -1
  265. package/docs/contracts/kernel-membership.md +26 -26
  266. package/docs/contracts/linear-ai-rules-inclusion.md +1 -1
  267. package/docs/contracts/linter-structural-model.md +2 -2
  268. package/docs/contracts/load-context-budget-model.md +4 -4
  269. package/docs/contracts/load-context-schema.md +13 -13
  270. package/docs/contracts/local-analytics.md +4 -0
  271. package/docs/contracts/local-knowledge-ingestion.md +1 -1
  272. package/docs/contracts/mcp-cloud-scope.md +2 -2
  273. package/docs/contracts/mcp-phase-1-scope.md +3 -3
  274. package/docs/contracts/measurement-baseline.md +5 -5
  275. package/docs/contracts/mental-models.md +30 -30
  276. package/docs/contracts/multi-tool-projection-fidelity.md +4 -4
  277. package/docs/contracts/namespace.md +4 -4
  278. package/docs/contracts/orchestration-dsl-v1.md +7 -7
  279. package/docs/contracts/package-self-orientation.md +12 -12
  280. package/docs/contracts/persona-schema.md +6 -6
  281. package/docs/contracts/pilot/language-and-tone.md +1 -1
  282. package/docs/contracts/plain-language-surface.md +117 -0
  283. package/docs/contracts/profile-system.md +3 -3
  284. package/docs/contracts/release-pr-gating.md +103 -0
  285. package/docs/contracts/role-experience.md +3 -3
  286. package/docs/contracts/rule-classification.md +13 -13
  287. package/docs/contracts/rule-interactions.md +4 -4
  288. package/docs/contracts/rule-interactions.yml +30 -30
  289. package/docs/contracts/rule-priority-hierarchy.md +13 -13
  290. package/docs/contracts/rule-router.md +2 -2
  291. package/docs/contracts/safety-model.md +1 -1
  292. package/docs/contracts/skill-distribution-channels.md +61 -0
  293. package/docs/contracts/skill-domains.md +2 -2
  294. package/docs/contracts/smoke-contracts.md +5 -5
  295. package/docs/contracts/telegraph-telemetry.md +83 -0
  296. package/docs/contracts/trust-and-safety.md +5 -5
  297. package/docs/contracts/ui-stack-extension.md +7 -7
  298. package/docs/contracts/ui-track-flow.md +9 -9
  299. package/docs/contracts/user-type-schema.md +4 -4
  300. package/docs/contracts/workflow-packs.md +4 -4
  301. package/docs/contracts/workspace-documents.md +4 -0
  302. package/docs/customization.md +28 -8
  303. package/docs/decisions/ADR-001-kernel-swap-deferred.md +6 -6
  304. package/docs/decisions/ADR-002-kernel-bucket-overrides.md +11 -11
  305. package/docs/decisions/ADR-003-flat-cluster-subs-and-colon-syntax.md +2 -2
  306. package/docs/decisions/ADR-004-rule-governance-pruning.md +4 -4
  307. package/docs/decisions/ADR-005-subagent-worktrees.md +7 -7
  308. package/docs/decisions/ADR-011-domain-pack-readiness.md +6 -6
  309. package/docs/decisions/ADR-013-discovery-frontmatter-contract.md +3 -3
  310. package/docs/decisions/ADR-015-discovery-manifest-contract.md +3 -3
  311. package/docs/decisions/ADR-017-monorepo-physical-layout.md +10 -10
  312. package/docs/decisions/ADR-018-trust-and-safety-layer.md +6 -6
  313. package/docs/decisions/ADR-019-router-json-dist-location.md +2 -2
  314. package/docs/decisions/ADR-020-global-only-consumer-scope.md +2 -2
  315. package/docs/decisions/ADR-021-deployment-shape.md +3 -3
  316. package/docs/decisions/ADR-022-daily-workspace-decomposition.md +1 -1
  317. package/docs/decisions/ADR-027-changelog-machine-vs-manual.md +2 -2
  318. package/docs/decisions/ADR-028-root-layout.md +7 -7
  319. package/docs/decisions/ADR-029-multi-workspace-deferred.md +2 -2
  320. package/docs/decisions/ADR-rule-kernel-and-router.md +5 -5
  321. package/docs/deploy/connector-setup.md +2 -2
  322. package/docs/deploy/policy-cookbook.md +2 -2
  323. package/docs/deploy/team-deployment-posture.md +20 -0
  324. package/docs/development.md +17 -17
  325. package/docs/distribution/registries.md +32 -0
  326. package/docs/distribution/registry-submissions.md +85 -0
  327. package/docs/distribution/telemetry-schema.md +1 -1
  328. package/docs/getting-started-by-role.md +45 -3
  329. package/docs/getting-started.md +2 -2
  330. package/docs/guidelines/agent-infra/5w2h-analysis.md +3 -3
  331. package/docs/guidelines/agent-infra/ask-when-uncertain-demos.md +1 -1
  332. package/docs/guidelines/agent-infra/asking-and-brevity-examples.md +3 -3
  333. package/docs/guidelines/agent-infra/carve-out-predicates.md +3 -3
  334. package/docs/guidelines/agent-infra/critical-thinking.md +4 -4
  335. package/docs/guidelines/agent-infra/direct-answers-demos.md +1 -1
  336. package/docs/guidelines/agent-infra/first-principles.md +2 -2
  337. package/docs/guidelines/agent-infra/inversion-thinking.md +5 -5
  338. package/docs/guidelines/agent-infra/layered-settings.md +56 -2
  339. package/docs/guidelines/agent-infra/mental-models.md +3 -3
  340. package/docs/guidelines/agent-infra/roadmap-progress-mechanics.md +2 -2
  341. package/docs/guidelines/agent-infra/rule-type-governance.md +1 -1
  342. package/docs/guidelines/agent-infra/scqa-framework.md +5 -5
  343. package/docs/guidelines/agent-infra/self-improvement-pipeline.md +2 -2
  344. package/docs/guidelines/agent-infra/six-hats.md +3 -3
  345. package/docs/guidelines/agent-infra/skill-quality-checklist.md +5 -5
  346. package/docs/guidelines/agent-infra/systems-thinking.md +1 -1
  347. package/docs/guidelines/agent-infra/verify-before-complete-demos.md +1 -1
  348. package/docs/guidelines/augment-portability-patterns.md +4 -4
  349. package/docs/guidelines/cross-role-handoff.md +2 -2
  350. package/docs/guidelines/php/php-coding-patterns.md +1 -1
  351. package/docs/guidelines/prompt-templates.md +6 -6
  352. package/docs/maintainers/dev-mode.md +1 -1
  353. package/docs/mcp.md +1 -1
  354. package/docs/parity/bench.json +3 -3
  355. package/docs/parity/ruflo.md +2 -2
  356. package/docs/profiles.md +11 -11
  357. package/docs/quality.md +11 -11
  358. package/docs/safety.md +3 -3
  359. package/docs/setup/mcp-client-config.md +1 -1
  360. package/docs/setup/mcp-r2-bootstrap.md +1 -1
  361. package/docs/setup/mcp-server-docker.md +3 -3
  362. package/docs/setup/per-ide/windsurf.md +1 -1
  363. package/docs/skills-catalog.md +8 -7
  364. package/docs/troubleshooting.md +1 -1
  365. package/docs/walkthroughs/daily-workspace-a11y.md +87 -0
  366. package/llms.txt +7 -6
  367. package/package.json +1 -1
  368. package/scripts/__pycache__/validate_frontmatter.cpython-312.pyc +0 -0
  369. package/scripts/_archive/README.md +2 -2
  370. package/scripts/_archive/_backfill_skill_domains.py +3 -3
  371. package/scripts/_archive/_bootstrap_tier_frontmatter.py +3 -3
  372. package/scripts/_archive/_p43_bodies.py +10 -10
  373. package/scripts/_archive/{_p43_compress.py → _p43_condense.py} +5 -5
  374. package/scripts/_archive/_p4_migrate.py +7 -7
  375. package/scripts/_archive/_phase2_shim_helper.py +1 -1
  376. package/scripts/_archive/_pilot_council_question.py +5 -5
  377. package/scripts/_cli/explain_last/inputs.py +1 -1
  378. package/scripts/_lib/__pycache__/__init__.cpython-312.pyc +0 -0
  379. package/scripts/_lib/__pycache__/agent_src.cpython-312.pyc +0 -0
  380. package/scripts/_lib/agent_settings.py +195 -1
  381. package/scripts/_lib/agent_src.py +19 -19
  382. package/scripts/_lib/bench_ab_cache.py +162 -0
  383. package/scripts/_lib/bench_ab_scoring.py +209 -0
  384. package/scripts/_lib/{bench_caveman.py → bench_telegraph.py} +21 -21
  385. package/scripts/_lib/{bench_caveman_report.py → bench_telegraph_report.py} +21 -21
  386. package/scripts/_lib/claude_desktop_bundler.py +5 -5
  387. package/scripts/_lib/module_detection.py +223 -0
  388. package/scripts/_lib/scope_guard.sh +162 -0
  389. package/scripts/_phase4_bucket.py +3 -3
  390. package/scripts/_pilot_measure.py +4 -4
  391. package/scripts/_tmp_scan_framework_leakage.py +1 -1
  392. package/scripts/adoption_report.py +195 -0
  393. package/scripts/adoption_snapshot.py +219 -0
  394. package/scripts/adoption_status.py +166 -0
  395. package/scripts/ai-video/lib/parse-blueprint.sh +1 -1
  396. package/scripts/ai_council/advisors.py +5 -5
  397. package/scripts/ai_council/compile_corpus.py +1 -1
  398. package/scripts/ai_council/one_off_archive/2026-05/_one_off_budget_v2_audit.py +3 -3
  399. package/scripts/ai_council/one_off_archive/2026-05/_one_off_context_layer_v1_review.py +2 -2
  400. package/scripts/ai_council/one_off_archive/2026-05/_one_off_inject_quiet_flag.py +1 -1
  401. package/scripts/ai_council/one_off_archive/2026-05/_one_off_measure_v2.sh +1 -1
  402. package/scripts/ai_council/one_off_archive/2026-05/_one_off_measure_verbosity.sh +1 -1
  403. package/scripts/ai_council/one_off_archive/2026-05/_one_off_nondestructive_inline_audit.py +3 -3
  404. package/scripts/ai_council/one_off_archive/2026-05/_one_off_per_task.sh +1 -1
  405. package/scripts/ai_council/one_off_archive/2026-05/_one_off_phase6_trigger_jaccard.py +1 -1
  406. package/scripts/ai_council/one_off_archive/2026-05/_one_off_phase_2a_budget_rebalance.py +6 -6
  407. package/scripts/ai_council/one_off_archive/2026-05/_one_off_rebalancing_audit.py +1 -1
  408. package/scripts/ai_council/one_off_archive/2026-05/_one_off_tier_retrofit.py +6 -6
  409. package/scripts/annotate_discovery.py +13 -13
  410. package/scripts/apply_modules_config.py +290 -0
  411. package/scripts/audit_adr_coverage.py +2 -2
  412. package/scripts/audit_auto_rules.py +2 -2
  413. package/scripts/audit_cloud_compatibility.py +3 -3
  414. package/scripts/audit_command_surface.py +9 -9
  415. package/scripts/audit_likelihood.py +2 -2
  416. package/scripts/audit_user_type_axis.py +2 -2
  417. package/scripts/bench_ab_cache_dispatch.py +68 -0
  418. package/scripts/bench_ab_clone.py +170 -0
  419. package/scripts/bench_ab_diff.py +227 -0
  420. package/scripts/bench_ab_integrity.py +143 -0
  421. package/scripts/bench_ab_run.py +235 -0
  422. package/scripts/bench_ab_task_runner.py +369 -0
  423. package/scripts/bench_ab_tracka_run.py +202 -0
  424. package/scripts/{bench_compress_memory.py → bench_condense_memory.py} +16 -16
  425. package/scripts/bench_run.py +33 -33
  426. package/scripts/bench_runner.py +2 -2
  427. package/scripts/bootstrap.sh +99 -0
  428. package/scripts/build_cloud_bundle.py +6 -6
  429. package/scripts/build_discovery_manifest.py +7 -7
  430. package/scripts/build_linear_digest.py +3 -3
  431. package/scripts/build_rule_trigger_matrix.py +8 -8
  432. package/scripts/chat_history.py +5 -5
  433. package/scripts/check_always_budget.py +11 -5
  434. package/scripts/check_augment_description_cap.py +3 -3
  435. package/scripts/check_cluster_patterns.py +2 -2
  436. package/scripts/check_command_count_messaging.py +3 -3
  437. package/scripts/{check_compression.py → check_condensation.py} +34 -34
  438. package/scripts/{check_compressed_paths.py → check_condensed_paths.py} +8 -8
  439. package/scripts/check_context_paths.py +7 -7
  440. package/scripts/check_council_layout.py +2 -2
  441. package/scripts/check_council_references.py +9 -9
  442. package/scripts/check_iron_law_prominence.py +2 -2
  443. package/scripts/check_kernel_rule_bundle.py +2 -2
  444. package/scripts/check_module_management_neutral.py +149 -0
  445. package/scripts/check_no_roadmap_refs.py +9 -9
  446. package/scripts/check_portability.py +3 -3
  447. package/scripts/check_public_catalog_links.py +4 -4
  448. package/scripts/check_references.py +7 -6
  449. package/scripts/check_release_pr_shape.py +112 -0
  450. package/scripts/check_reply_consistency.py +3 -3
  451. package/scripts/check_safety_floor_untouched.py +1 -1
  452. package/scripts/check_template_pin_drift.py +5 -5
  453. package/scripts/check_token_optimizer_freshness.py +3 -3
  454. package/scripts/ci_status.py +301 -0
  455. package/scripts/ci_time_ratio.py +1 -1
  456. package/scripts/cleanup_other_scope.sh +146 -0
  457. package/scripts/compile_router.py +10 -10
  458. package/scripts/{compress.py → condense.py} +64 -64
  459. package/scripts/condense.sh +18 -0
  460. package/scripts/{compress_memory.py → condense_memory.py} +33 -33
  461. package/scripts/config/presets.py +2 -2
  462. package/scripts/config/profiles.py +1 -1
  463. package/scripts/cost_by_conversation.py +3 -3
  464. package/scripts/cost_summary.py +7 -7
  465. package/scripts/count_token_optimizer_usage.sh +1 -1
  466. package/scripts/gen_discovery_baseline.py +5 -5
  467. package/scripts/generate_index.py +6 -6
  468. package/scripts/generate_ownership_matrix.py +10 -10
  469. package/scripts/generate_pack_manifests.py +1 -1
  470. package/scripts/ghostwriter_fixture_allowlist.txt +1 -1
  471. package/scripts/install +3 -3
  472. package/scripts/install-hooks.sh +6 -6
  473. package/scripts/install.py +273 -45
  474. package/scripts/install.sh +187 -1
  475. package/scripts/inventory_frontmatter.py +2 -2
  476. package/scripts/iron_law_sha.py +3 -3
  477. package/scripts/lint_agents_layout.py +14 -7
  478. package/scripts/lint_agents_md.py +4 -4
  479. package/scripts/lint_archived_skills.py +3 -3
  480. package/scripts/lint_artefact_frontmatter.py +2 -2
  481. package/scripts/lint_bench_ab.py +172 -0
  482. package/scripts/lint_bench_corpus.py +1 -1
  483. package/scripts/lint_command_tiers.py +5 -5
  484. package/scripts/lint_context_spine_usage.py +1 -1
  485. package/scripts/lint_framework_leakage.py +7 -7
  486. package/scripts/lint_framework_leakage_allowlist.json +152 -84
  487. package/scripts/lint_ghostwriter_source.py +3 -3
  488. package/scripts/lint_handoffs.py +1 -1
  489. package/scripts/lint_load_context.py +11 -11
  490. package/scripts/lint_media_policy_linkage.py +5 -5
  491. package/scripts/lint_namespace.py +1 -1
  492. package/scripts/lint_no_new_atomic_commands.py +2 -2
  493. package/scripts/lint_orchestration_dsl.py +1 -1
  494. package/scripts/lint_pack_boundaries.py +2 -2
  495. package/scripts/lint_persona_governance.py +4 -4
  496. package/scripts/lint_role_experiences.py +237 -0
  497. package/scripts/lint_rule_interactions.py +2 -2
  498. package/scripts/lint_rule_tiers.py +1 -1
  499. package/scripts/lint_trust_coherence.py +2 -2
  500. package/scripts/mcp_registry_submit.sh +187 -0
  501. package/scripts/mcp_server/tools.py +1 -1
  502. package/scripts/measure_frugality_savings.py +10 -10
  503. package/scripts/measure_patterns.py +1 -1
  504. package/scripts/measure_projection_bytes.py +5 -5
  505. package/scripts/measure_rule_budget.py +3 -3
  506. package/scripts/measure_skill_reduction.py +1 -1
  507. package/scripts/memory_lookup.py +1 -1
  508. package/scripts/memory_status.py +2 -2
  509. package/scripts/migrate_command_suggestions.py +3 -3
  510. package/scripts/mine_session.py +1 -1
  511. package/scripts/move_artefact.py +3 -3
  512. package/scripts/new_skill.py +2 -2
  513. package/scripts/pack_mcp_content.py +9 -9
  514. package/scripts/plan_physical_move.py +6 -6
  515. package/scripts/print_required_checks.py +196 -0
  516. package/scripts/probe_skill_registration.py +413 -0
  517. package/scripts/propose_modules_config.py +145 -0
  518. package/scripts/prototype_lint_contradictions.py +1 -1
  519. package/scripts/recruit_preflight.sh +152 -0
  520. package/scripts/refine_ticket_detect.py +3 -3
  521. package/scripts/release.py +20 -0
  522. package/scripts/render_benchmark_md.py +308 -0
  523. package/scripts/roadmap_progress_hook.py +1 -1
  524. package/scripts/run_skill_evals.py +2 -2
  525. package/scripts/runtime_registry.py +4 -4
  526. package/scripts/schemas/command.schema.json +4 -4
  527. package/scripts/schemas/rule.schema.json +5 -5
  528. package/scripts/schemas/skill.schema.json +3 -3
  529. package/scripts/schemas/user-type.schema.json +1 -1
  530. package/scripts/score_skill_selection.py +1 -1
  531. package/scripts/skill_collision_clusters.py +2 -2
  532. package/scripts/skill_linter.py +81 -81
  533. package/scripts/skill_overlap.py +5 -5
  534. package/scripts/skill_tools/audit_persona_coverage.py +2 -2
  535. package/scripts/skill_tools/audit_user_type_coverage.py +2 -2
  536. package/scripts/skill_tools/run_block_d_eval.py +1 -1
  537. package/scripts/skill_tools/score_skill_relevance.py +1 -1
  538. package/scripts/skill_tools/suggest_skill_for_task.py +1 -1
  539. package/scripts/skill_trigger_eval.py +3 -3
  540. package/scripts/smoke/kernel.sh +7 -1
  541. package/scripts/smoke/router.sh +5 -5
  542. package/scripts/smoke/skills.sh +1 -1
  543. package/scripts/smoke_quickstart.py +1 -1
  544. package/scripts/snapshot_agent_outputs.py +3 -3
  545. package/scripts/spotcheck_thin_root.py +1 -1
  546. package/scripts/{caveman_stats.py → telegraph_stats.py} +18 -18
  547. package/scripts/update_counts.py +1 -1
  548. package/scripts/validate_decision_engine.py +1 -1
  549. package/scripts/validate_frontmatter.py +1 -1
  550. package/scripts/validate_safe_paths.py +3 -3
  551. package/scripts/{validate_caveman_carveouts.py → validate_telegraph_carveouts.py} +7 -7
  552. package/scripts/verify_roadmap_closure.py +6 -6
  553. package/templates/consumer-settings/ONBOARDING.md +41 -0
  554. package/.agent-src/commands/install-via-agent.md +0 -129
  555. package/.agent-src/skills/compress-memory/SKILL.md +0 -131
  556. package/dist/ui/assets/index-D-DY1ywI.js +0 -35
  557. package/dist/ui/assets/index-D-DY1ywI.js.map +0 -1
  558. package/dist/ui/assets/index-Dqfhmg-d.css +0 -1
  559. package/docs/adrs/caveman/README.md +0 -9
  560. package/docs/contracts/caveman-telemetry.md +0 -83
  561. package/scripts/compress.sh +0 -18
@@ -1,131 +0,0 @@
1
- ---
2
- name: compress-memory
3
- description: "Use when shrinking always-loaded memory files (AGENTS.md, CLAUDE.md, .cursorrules) via caveman grammar — refuses sensitive paths, round-trips via .original.md backup."
4
- source: package
5
- domain: process
6
- execution:
7
- type: assisted
8
- handler: internal
9
- allowed_tools: [Bash]
10
- workspaces:
11
- - agent-config-maintainer
12
- packs:
13
- - meta
14
- lifecycle: active
15
- trust:
16
- level: core
17
- confidence: high
18
- human_review_required: false
19
- install:
20
- default: true
21
- removable: false
22
- ---
23
-
24
- # compress-memory
25
-
26
- > **Experimental.** Output-side caveman dialect did not meet kill-criterion in [`internal/bench/reports/caveman-v1.md`](../../../bench/reports/caveman-v1.md) (`vs_terse` median −9.27 %). Input-side memory compression is orthogonal use case: savings target always-loaded memory budget, not reply stream. Treat ship-criterion as **per-target measurement**, not v1 verdict.
27
-
28
- ## When to use
29
-
30
- Use when:
31
-
32
- - Always-loaded memory file (`AGENTS.md`, `CLAUDE.md`, `.cursorrules`, `GEMINI.md`, `.windsurfrules`) close to or above host tool's char budget and maintainer wants to recover input-token headroom.
33
- - Consumer-shipped `templates/AGENTS.md` failing `agents-md-thin-root` cap and pointer-extraction options exhausted.
34
- - Maintainer asks to "compress this memory file" or "shrink AGENTS.md" or names input-side caveman.
35
-
36
- ## Do NOT
37
-
38
- - Compress reply, commit message, PR body, ticket summary, or any deliverable written *for* human reader — those are carve-outs in [`caveman-speak § Carve-outs`](../../rules/caveman-speak.md) and stay verbatim.
39
- - Compress path matching sensitive-file denylist (`.env*`, `.netrc`, `credentials*`, `secrets*`, `id_rsa*`, `*.pem|key|p12|pfx|crt|cer|jks`, `.ssh/*`) — script refuses with `SensitivePathError` and so should you.
40
- - Compress generated file (`.agent-src/`, `.augment/`, `.claude/`, `.cursor/`, `.clinerules/`, `.windsurfrules`) — edit source in `.agent-src.uncompressed/` and regenerate via package's sync + generate-tools scripts (`scripts/compress.sh --sync` + `scripts/compress.py --generate-tools`).
41
- - Hand-edit compressed memory file in place — run `--decompress` first; next compress pass refuses on body-hash drift (`CompressionRefused`).
42
- - Commit compressed file without committing matching `.original.md` backup — round-trip breaks otherwise.
43
-
44
- ## Procedure
45
-
46
- 1. **Analyse target first.** Before any write, **inspect** target with `view` or `wc -l` to confirm it is always-loaded memory file (`AGENTS.md`, `CLAUDE.md`, `.cursorrules`, `GEMINI.md`, `.windsurfrules`), not generated, and has prose paragraphs to compress (pointer-only Thin-Root file may net near-zero). Skip rest of procedure if any check fails.
47
- 2. **Check denylist gate.** Run `python3 scripts/compress_memory.py <path> --check` — exit 0 = safe; exit 2 = denylist hit, stop and surface refusal.
48
- 3. **Record baseline.** `wc -c <path>` — capture pre-compression char count for commit message.
49
- 4. **Compress.** `python3 scripts/compress_memory.py <path>`. Script writes `<path>.original.md` (verbatim backup) and rewrites `<path>` with `original_sha256:` + `compressed_at:` frontmatter.
50
- 5. **Inspect diff.** Eyeball every Iron-Law fence, numbered-options block, code fence, backtick span, `❌`/`⚠️`/`✅` line, and frontmatter pair — all must be byte-identical. Body prose may have lost articles (`the`/`a`/`an`) and auxiliaries (`is`/`are`/`was`/`be`/`that`/`which`).
51
- 6. **Validate idempotency.** Re-run `python3 scripts/compress_memory.py <path>` — clean re-run is no-op (body hash matches). Non-zero exit = stop, escalate.
52
- 7. **Commit both files together.** `<path>` and `<path>.original.md` ship as pair. Backup is rollback path; never commit one without other.
53
- 8. **Rollback path.** If readability fails review at step 5: `python3 scripts/compress_memory.py <path> --decompress` restores backup and deletes `.original.md`.
54
-
55
- ## Output format
56
-
57
- Maintainer-facing report after invoking script MUST contain, in this order:
58
-
59
- 1. **Diff line** — pre/post `wc -c` as single line (`AGENTS.md: 2,891 → 2,453 chars (−15.1 %)`).
60
- 2. **Backup path** — full path of `.original.md` backup so maintainer can verify it landed on disk.
61
- 3. **Carve-out check** — one line confirming seven carve-out classes round-tripped (`carve-outs: 7 classes preserved · idempotent re-run: clean`).
62
- 4. **Exit-code surface** — on failure, surface verbatim exit code and exception name (`SensitivePathError → exit 2`, `CompressionRefused → exit 3`, `FileNotFoundError → exit 4`); do not paraphrase.
63
-
64
- Do **not** narrate algorithm, grammar rules, or carve-out theory — rule and this skill document contract; output reports result.
65
-
66
- ## Carve-outs — byte-for-byte preserved
67
-
68
- Mirrors seven carve-out classes in [`caveman-speak`](../../rules/caveman-speak.md). Compression engine in [`scripts/compress_memory.py`](../../../scripts/compress_memory.py) preserves:
69
-
70
- 1. **Triple-backtick fences** — any language, any depth.
71
- 2. **Numbered-options lines** — `^>?\s*\d+\.\s` plus `**Recommendation:**` / `**Empfehlung:**` label.
72
- 3. **Backtick spans** — file paths, command names, identifiers inside body prose.
73
- 4. **Status / error markers** — lines starting with `❌`, `⚠️`, `✅`.
74
- 5. **Iron-Law ALL-CAPS lines** — `^[A-Z][A-Z0-9 ,.\-_/']{3,}$`.
75
- 6. **Frontmatter blocks** — `---` fence pairs at head of file.
76
- 7. **Mode markers** per [`role-mode-adherence`](../../rules/role-mode-adherence.md).
77
-
78
- Mangling any of these breaks Iron-Law surface host tool reads. Unit tests in `tests/test_compress_memory.py` lock each carve-out class as regression case.
79
-
80
- ## Idempotency contract — Step 9 guard
81
-
82
- Script is **idempotent on clean re-runs**: running it twice on same target is no-op because body hash matches recompressed hash. Script **refuses** on **body drift**:
83
-
84
- | State | Outcome |
85
- |---|---|
86
- | No frontmatter SHA marker | Compress + write backup + inject SHA. |
87
- | SHA marker present, body re-compresses to same hash | No-op (return target unchanged). |
88
- | SHA marker present, body hash diverged | **Refuse** with `CompressionRefused` exit 3. |
89
-
90
- If you need to edit compressed memory file, run `--decompress` first, edit restored `.original.md` content, then re-run compressor. Never hand-edit compressed body — next CI run will either silently corrupt your edit (if it happens to re-compress to same shape) or hard-fail next compress pass.
91
-
92
- ## Sensitive-path gate
93
-
94
- Every read path passes through [`scripts/validate_safe_paths.py`](../../../scripts/validate_safe_paths.py) `assert_safe()` before bytes leave disk. Gate is security floor for Phase 2 (input-side compression) per `step-16-caveman-substance.md` Phase 0; rollback of gate is rollback of this skill.
95
-
96
- CLI exit codes:
97
-
98
- - `0` — compress / decompress / check succeeded.
99
- - `2` — `SensitivePathError` (path matched denylist).
100
- - `3` — `CompressionRefused` (body hash diverged from frontmatter SHA).
101
- - `4` — `FileNotFoundError` (no `.original.md` backup to restore).
102
-
103
- ## Gotchas
104
-
105
- - **Body-hash drift after manual edit** — hand-editing compressed body breaks `original_sha256:` invariant. Next compress pass refuses with `CompressionRefused` (exit 3). Recovery: `--decompress`, edit restored body, re-compress.
106
- - **`.original.md` backup missing on `--decompress`** — exit 4 (`FileNotFoundError`). Either someone deleted backup or `--decompress` already ran. Restore from git history; never regenerate backup by hand (regenerated content would not be byte-identical).
107
- - **Denylist false positive** — sensitive-looking filename outside denylist surface (project-specific naming) will still pass `assert_safe()`. Denylist necessary but not sufficient; maintainer responsible for never feeding secrets to compressor.
108
- - **Frontmatter ordering with existing keys** — if target already has frontmatter, compressor preserves existing keys, drops any prior `original_sha256:` / `compressed_at:` entries, and appends new pair. Other agents reading file should treat SHA + timestamp pair as canonical compression marker, not file size.
109
- - **Negative savings on pointer-heavy files** — `templates/AGENTS.md` already following Thin-Root (≥ 40 % pointers, ≥ 60-char *why*-clauses) has little prose left to drop; compression may net near-zero or even add bytes via frontmatter. Run [`agents-md-thin-root`](../agents-md-thin-root/SKILL.md) first to maximise pointer share, then measure whether this skill still pays.
110
- - **Generated-tree drift** — compressing `.agent-src.uncompressed/templates/AGENTS.md` does NOT propagate to `.augment/`, `.claude/`, etc. until package's sync + generate-tools scripts run (`scripts/compress.sh --sync` + `scripts/compress.py --generate-tools`). Always regenerate after compressing templated file.
111
-
112
- ## Measurement — when to compress
113
-
114
- No published `caveman-v2` baseline for input-side savings yet (Step 11 of `step-16-caveman-substance.md` ships that). Until then, maintainer judges per-target whether compression pays its readability cost. Suggested workflow:
115
-
116
- 1. `wc -c <path>` before — record baseline char count.
117
- 2. `python3 scripts/compress_memory.py <path>` — compress + back up.
118
- 3. `wc -c <path>` after — record post-compression char count.
119
- 4. Eyeball diff: does prose stay legible? Are all Iron-Law fences intact?
120
- 5. If yes → commit both `<path>` and `<path>.original.md`. If no → `--decompress`.
121
-
122
- Future `caveman-v2.md` will tabulate realised input-token saving against `agents-md-thin-root` 40 % pointer-ratio constraint so maintainer has numerical floor.
123
-
124
- ## Cross-references
125
-
126
- - [`caveman-speak`](../../rules/caveman-speak.md) — runtime rule script mirrors for input-side targets; `caveman.speak_scope` does **not** gate this script (input-side runs regardless).
127
- - [`scripts/validate_safe_paths.py`](../../../scripts/validate_safe_paths.py) — Phase 0 gate; ported from upstream Caveman `63a91ec`.
128
- - [`scripts/compress_memory.py`](../../../scripts/compress_memory.py) — implementation.
129
- - [`tests/test_compress_memory.py`](../../../tests/test_compress_memory.py) — regression locks for each carve-out + idempotency + denylist.
130
- - [`docs/contracts/compression-default-kill-criterion.md`](../../../docs/contracts/compression-default-kill-criterion.md) — v1 verdict (output-side; informs but does not gate this skill).
131
- - [`agents-md-thin-root`](../agents-md-thin-root/SKILL.md) — caps consumer-shipped `templates/AGENTS.md`; this skill is one tool to land under cap.
@@ -1,35 +0,0 @@
1
- (function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const t of document.querySelectorAll('link[rel="modulepreload"]'))r(t);new MutationObserver(t=>{for(const o of t)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function i(t){const o={};return t.integrity&&(o.integrity=t.integrity),t.referrerPolicy&&(o.referrerPolicy=t.referrerPolicy),t.crossOrigin==="use-credentials"?o.credentials="include":t.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(t){if(t.ep)return;t.ep=!0;const o=i(t);fetch(t.href,o)}})();var fn,w,Wi,zi,W,fi,qi,Ki,xn,Ue,ye,Gi,Kn,En,Tn,We={},ze=[],At=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,dn=Array.isArray;function U(e,n){for(var i in n)e[i]=n[i];return e}function Gn(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function St(e,n,i){var r,t,o,l={};for(o in n)o=="key"?r=n[o]:o=="ref"?t=n[o]:l[o]=n[o];if(arguments.length>2&&(l.children=arguments.length>3?fn.call(arguments,2):i),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)l[o]===void 0&&(l[o]=e.defaultProps[o]);return je(e,l,r,t,null)}function je(e,n,i,r,t){var o={type:e,props:n,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:t??++Wi,__i:-1,__u:0};return t==null&&w.vnode!=null&&w.vnode(o),o}function K(e){return e.children}function be(e,n){this.props=e,this.context=n}function se(e,n){if(n==null)return e.__?se(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"?se(e):null}function Ct(e){if(e.__P&&e.__d){var n=e.__v,i=n.__e,r=[],t=[],o=U({},n);o.__v=n.__v+1,w.vnode&&w.vnode(o),Vn(e.__P,o,n,e.__n,e.__P.namespaceURI,32&n.__u?[i]:null,r,i??se(n),!!(32&n.__u),t),o.__v=n.__v,o.__.__k[o.__i]=o,Zi(r,o,t),n.__e=n.__=null,o.__e!=i&&Vi(o)}}function Vi(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}),Vi(e)}function di(e){(!e.__d&&(e.__d=!0)&&W.push(e)&&!qe.__r++||fi!=w.debounceRendering)&&((fi=w.debounceRendering)||qi)(qe)}function qe(){try{for(var e,n=1;W.length;)W.length>n&&W.sort(Ki),e=W.shift(),n=W.length,Ct(e)}finally{W.length=qe.__r=0}}function Ji(e,n,i,r,t,o,l,a,u,s,h){var c,d,p,m,b,x,g,_=r&&r.__k||ze,R=n.length;for(u=kt(i,n,_,u,R),c=0;c<R;c++)(p=i.__k[c])!=null&&(d=p.__i!=-1&&_[p.__i]||We,p.__i=c,x=Vn(e,p,d,t,o,l,a,u,s,h),m=p.__e,p.ref&&d.ref!=p.ref&&(d.ref&&Jn(d.ref,null,p),h.push(p.ref,p.__c||m,p)),b==null&&m!=null&&(b=m),(g=!!(4&p.__u))||d.__k===p.__k?(u=Qi(p,u,e,g),g&&d.__e&&(d.__e=null)):typeof p.type=="function"&&x!==void 0?u=x:m&&(u=m.nextSibling),p.__u&=-7);return i.__e=b,u}function kt(e,n,i,r,t){var o,l,a,u,s,h=i.length,c=h,d=0;for(e.__k=new Array(t),o=0;o<t;o++)(l=n[o])!=null&&typeof l!="boolean"&&typeof l!="function"?(typeof l=="string"||typeof l=="number"||typeof l=="bigint"||l.constructor==String?l=e.__k[o]=je(null,l,null,null,null):dn(l)?l=e.__k[o]=je(K,{children:l},null,null,null):l.constructor===void 0&&l.__b>0?l=e.__k[o]=je(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):e.__k[o]=l,u=o+d,l.__=e,l.__b=e.__b+1,a=null,(s=l.__i=Et(l,i,u,c))!=-1&&(c--,(a=i[s])&&(a.__u|=2)),a==null||a.__v==null?(s==-1&&(t>h?d--:t<h&&d++),typeof l.type!="function"&&(l.__u|=4)):s!=u&&(s==u-1?d--:s==u+1?d++:(s>u?d--:d++,l.__u|=4))):e.__k[o]=null;if(c)for(o=0;o<h;o++)(a=i[o])!=null&&!(2&a.__u)&&(a.__e==r&&(r=se(a)),er(a,a));return r}function Qi(e,n,i,r){var t,o;if(typeof e.type=="function"){for(t=e.__k,o=0;t&&o<t.length;o++)t[o]&&(t[o].__=e,n=Qi(t[o],n,i,r));return n}e.__e!=n&&(r&&(n&&e.type&&!n.parentNode&&(n=se(e)),i.insertBefore(e.__e,n||null)),n=e.__e);do n=n&&n.nextSibling;while(n!=null&&n.nodeType==8);return n}function Et(e,n,i,r){var t,o,l,a=e.key,u=e.type,s=n[i],h=s!=null&&(2&s.__u)==0;if(s===null&&a==null||h&&a==s.key&&u==s.type)return i;if(r>(h?1:0)){for(t=i-1,o=i+1;t>=0||o<n.length;)if((s=n[l=t>=0?t--:o++])!=null&&!(2&s.__u)&&a==s.key&&u==s.type)return l}return-1}function pi(e,n,i){n[0]=="-"?e.setProperty(n,i??""):e[n]=i==null?"":typeof i!="number"||At.test(n)?i:i+"px"}function Re(e,n,i,r,t){var o,l;e:if(n=="style")if(typeof i=="string")e.style.cssText=i;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(n in r)i&&n in i||pi(e.style,n,"");if(i)for(n in i)r&&i[n]==r[n]||pi(e.style,n,i[n])}else if(n[0]=="o"&&n[1]=="n")o=n!=(n=n.replace(Gi,"$1")),l=n.toLowerCase(),n=l in e||n=="onFocusOut"||n=="onFocusIn"?l.slice(2):n.slice(2),e.l||(e.l={}),e.l[n+o]=i,i?r?i[ye]=r[ye]:(i[ye]=Kn,e.addEventListener(n,o?Tn:En,o)):e.removeEventListener(n,o?Tn:En,o);else{if(t=="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 hi(e){return function(n){if(this.l){var i=this.l[n.type+e];if(n[Ue]==null)n[Ue]=Kn++;else if(n[Ue]<i[ye])return;return i(w.event?w.event(n):n)}}}function Vn(e,n,i,r,t,o,l,a,u,s){var h,c,d,p,m,b,x,g,_,R,V,me,si,Me,bn,P=n.type;if(n.constructor!==void 0)return null;128&i.__u&&(u=!!(32&i.__u),o=[a=n.__e=i.__e]),(h=w.__b)&&h(n);e:if(typeof P=="function")try{if(g=n.props,_=P.prototype&&P.prototype.render,R=(h=P.contextType)&&r[h.__c],V=h?R?R.props.value:h.__:r,i.__c?x=(c=n.__c=i.__c).__=c.__E:(_?n.__c=c=new P(g,V):(n.__c=c=new be(g,V),c.constructor=P,c.render=Nt),R&&R.sub(c),c.state||(c.state={}),c.__n=r,d=c.__d=!0,c.__h=[],c._sb=[]),_&&c.__s==null&&(c.__s=c.state),_&&P.getDerivedStateFromProps!=null&&(c.__s==c.state&&(c.__s=U({},c.__s)),U(c.__s,P.getDerivedStateFromProps(g,c.__s))),p=c.props,m=c.state,c.__v=n,d)_&&P.getDerivedStateFromProps==null&&c.componentWillMount!=null&&c.componentWillMount(),_&&c.componentDidMount!=null&&c.__h.push(c.componentDidMount);else{if(_&&P.getDerivedStateFromProps==null&&g!==p&&c.componentWillReceiveProps!=null&&c.componentWillReceiveProps(g,V),n.__v==i.__v||!c.__e&&c.shouldComponentUpdate!=null&&c.shouldComponentUpdate(g,c.__s,V)===!1){n.__v!=i.__v&&(c.props=g,c.state=c.__s,c.__d=!1),n.__e=i.__e,n.__k=i.__k,n.__k.some(function(re){re&&(re.__=n)}),ze.push.apply(c.__h,c._sb),c._sb=[],c.__h.length&&l.push(c);break e}c.componentWillUpdate!=null&&c.componentWillUpdate(g,c.__s,V),_&&c.componentDidUpdate!=null&&c.__h.push(function(){c.componentDidUpdate(p,m,b)})}if(c.context=V,c.props=g,c.__P=e,c.__e=!1,me=w.__r,si=0,_)c.state=c.__s,c.__d=!1,me&&me(n),h=c.render(c.props,c.state,c.context),ze.push.apply(c.__h,c._sb),c._sb=[];else do c.__d=!1,me&&me(n),h=c.render(c.props,c.state,c.context),c.state=c.__s;while(c.__d&&++si<25);c.state=c.__s,c.getChildContext!=null&&(r=U(U({},r),c.getChildContext())),_&&!d&&c.getSnapshotBeforeUpdate!=null&&(b=c.getSnapshotBeforeUpdate(p,m)),Me=h!=null&&h.type===K&&h.key==null?Xi(h.props.children):h,a=Ji(e,dn(Me)?Me:[Me],n,i,r,t,o,l,a,u,s),c.base=n.__e,n.__u&=-161,c.__h.length&&l.push(c),x&&(c.__E=c.__=null)}catch(re){if(n.__v=null,u||o!=null)if(re.then){for(n.__u|=u?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;o[o.indexOf(a)]=null,n.__e=a}else{for(bn=o.length;bn--;)Gn(o[bn]);Nn(n)}else n.__e=i.__e,n.__k=i.__k,re.then||Nn(n);w.__e(re,n,i)}else o==null&&n.__v==i.__v?(n.__k=i.__k,n.__e=i.__e):a=n.__e=Tt(i.__e,n,i,r,t,o,l,u,s);return(h=w.diffed)&&h(n),128&n.__u?void 0:a}function Nn(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Nn))}function Zi(e,n,i){for(var r=0;r<i.length;r++)Jn(i[r],i[++r],i[++r]);w.__c&&w.__c(n,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(o){o.call(t)})}catch(o){w.__e(o,t.__v)}})}function Xi(e){return typeof e!="object"||e==null||e.__b>0?e:dn(e)?e.map(Xi):e.constructor!==void 0?null:U({},e)}function Tt(e,n,i,r,t,o,l,a,u){var s,h,c,d,p,m,b,x=i.props||We,g=n.props,_=n.type;if(_=="svg"?t="http://www.w3.org/2000/svg":_=="math"?t="http://www.w3.org/1998/Math/MathML":t||(t="http://www.w3.org/1999/xhtml"),o!=null){for(s=0;s<o.length;s++)if((p=o[s])&&"setAttribute"in p==!!_&&(_?p.localName==_:p.nodeType==3)){e=p,o[s]=null;break}}if(e==null){if(_==null)return document.createTextNode(g);e=document.createElementNS(t,_,g.is&&g),a&&(w.__m&&w.__m(n,o),a=!1),o=null}if(_==null)x===g||a&&e.data==g||(e.data=g);else{if(o=_=="textarea"&&g.defaultValue!=null?null:o&&fn.call(e.childNodes),!a&&o!=null)for(x={},s=0;s<e.attributes.length;s++)x[(p=e.attributes[s]).name]=p.value;for(s in x)p=x[s],s=="dangerouslySetInnerHTML"?c=p:s=="children"||s in g||s=="value"&&"defaultValue"in g||s=="checked"&&"defaultChecked"in g||Re(e,s,null,p,t);for(s in g)p=g[s],s=="children"?d=p:s=="dangerouslySetInnerHTML"?h=p:s=="value"?m=p:s=="checked"?b=p:a&&typeof p!="function"||x[s]===p||Re(e,s,p,x[s],t);if(h)a||c&&(h.__html==c.__html||h.__html==e.innerHTML)||(e.innerHTML=h.__html),n.__k=[];else if(c&&(e.innerHTML=""),Ji(n.type=="template"?e.content:e,dn(d)?d:[d],n,i,r,_=="foreignObject"?"http://www.w3.org/1999/xhtml":t,o,l,o?o[0]:i.__k&&se(i,0),a,u),o!=null)for(s=o.length;s--;)Gn(o[s]);a&&_!="textarea"||(s="value",_=="progress"&&m==null?e.removeAttribute("value"):m!=null&&(m!==e[s]||_=="progress"&&!m||_=="option"&&m!=x[s])&&Re(e,s,m,x[s],t),s="checked",b!=null&&b!=e[s]&&Re(e,s,b,x[s],t))}return e}function Jn(e,n,i){try{if(typeof e=="function"){var r=typeof e.__u=="function";r&&e.__u(),r&&n==null||(e.__u=e(n))}else e.current=n}catch(t){w.__e(t,i)}}function er(e,n,i){var r,t;if(w.unmount&&w.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||Jn(r,null,n)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){w.__e(o,n)}r.base=r.__P=null}if(r=e.__k)for(t=0;t<r.length;t++)r[t]&&er(r[t],n,i||typeof e.type!="function");i||Gn(e.__e),e.__c=e.__=e.__e=void 0}function Nt(e,n,i){return this.constructor(e,i)}function Ot(e,n,i){var r,t,o,l;n==document&&(n=document.documentElement),w.__&&w.__(e,n),t=(r=!1)?null:n.__k,o=[],l=[],Vn(n,e=n.__k=St(K,null,[e]),t||We,We,n.namespaceURI,t?null:n.firstChild?fn.call(n.childNodes):null,o,t?t.__e:n.firstChild,r,l),Zi(o,e,l)}fn=ze.slice,w={__e:function(e,n,i,r){for(var t,o,l;n=n.__;)if((t=n.__c)&&!t.__)try{if((o=t.constructor)&&o.getDerivedStateFromError!=null&&(t.setState(o.getDerivedStateFromError(e)),l=t.__d),t.componentDidCatch!=null&&(t.componentDidCatch(e,r||{}),l=t.__d),l)return t.__E=t}catch(a){e=a}throw e}},Wi=0,zi=function(e){return e!=null&&e.constructor===void 0},be.prototype.setState=function(e,n){var i;i=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=U({},this.state),typeof e=="function"&&(e=e(U({},i),this.props)),e&&U(i,e),e!=null&&this.__v&&(n&&this._sb.push(n),di(this))},be.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),di(this))},be.prototype.render=K,W=[],qi=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ki=function(e,n){return e.__v.__b-n.__v.__b},qe.__r=0,xn=Math.random().toString(8),Ue="__d"+xn,ye="__a"+xn,Gi=/(PointerCapture)$|Capture$/i,Kn=0,En=hi(!1),Tn=hi(!0);var Ft=0;function f(e,n,i,r,t,o){n||(n={});var l,a,u=n;if("ref"in u)for(a in u={},n)a=="ref"?l=n[a]:u[a]=n[a];var s={type:e,props:u,key:i,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Ft,__i:-1,__u:0,__source:t,__self:o};if(typeof e=="function"&&(l=e.defaultProps))for(a in l)u[a]===void 0&&(u[a]=l[a]);return w.vnode&&w.vnode(s),s}var Se,S,wn,_i,On=0,nr=[],C=w,vi=C.__b,mi=C.__r,gi=C.diffed,yi=C.__c,bi=C.unmount,xi=C.__;function Qn(e,n){C.__h&&C.__h(S,e,On||n),On=0;var i=S.__H||(S.__H={__:[],__h:[]});return e>=i.__.length&&i.__.push({}),i.__[e]}function ir(e){return On=1,It(or,e)}function It(e,n,i){var r=Qn(Se++,2);if(r.t=e,!r.__c&&(r.__=[or(void 0,n),function(a){var u=r.__N?r.__N[0]:r.__[0],s=r.t(u,a);u!==s&&(r.__N=[s,r.__[1]],r.__c.setState({}))}],r.__c=S,!S.__f)){var t=function(a,u,s){if(!r.__c.__H)return!0;var h=r.__c.__H.__.filter(function(d){return d.__c});if(h.every(function(d){return!d.__N}))return!o||o.call(this,a,u,s);var c=r.__c.props!==a;return h.some(function(d){if(d.__N){var p=d.__[0];d.__=d.__N,d.__N=void 0,p!==d.__[0]&&(c=!0)}}),o&&o.call(this,a,u,s)||c};S.__f=!0;var o=S.shouldComponentUpdate,l=S.componentWillUpdate;S.componentWillUpdate=function(a,u,s){if(this.__e){var h=o;o=void 0,t(a,u,s),o=h}l&&l.call(this,a,u,s)},S.shouldComponentUpdate=t}return r.__N||r.__}function pn(e,n){var i=Qn(Se++,3);!C.__s&&tr(i.__H,n)&&(i.__=e,i.u=n,S.__H.__h.push(i))}function rr(e,n){var i=Qn(Se++,7);return tr(i.__H,n)&&(i.__=e(),i.__H=n,i.__h=e),i.__}function Lt(){for(var e;e=nr.shift();){var n=e.__H;if(e.__P&&n)try{n.__h.some(He),n.__h.some(Fn),n.__h=[]}catch(i){n.__h=[],C.__e(i,e.__v)}}}C.__b=function(e){S=null,vi&&vi(e)},C.__=function(e,n){e&&n.__k&&n.__k.__m&&(e.__m=n.__k.__m),xi&&xi(e,n)},C.__r=function(e){mi&&mi(e),Se=0;var n=(S=e.__c).__H;n&&(wn===S?(n.__h=[],S.__h=[],n.__.some(function(i){i.__N&&(i.__=i.__N),i.u=i.__N=void 0})):(n.__h.some(He),n.__h.some(Fn),n.__h=[],Se=0)),wn=S},C.diffed=function(e){gi&&gi(e);var n=e.__c;n&&n.__H&&(n.__H.__h.length&&(nr.push(n)!==1&&_i===C.requestAnimationFrame||((_i=C.requestAnimationFrame)||$t)(Lt)),n.__H.__.some(function(i){i.u&&(i.__H=i.u),i.u=void 0})),wn=S=null},C.__c=function(e,n){n.some(function(i){try{i.__h.some(He),i.__h=i.__h.filter(function(r){return!r.__||Fn(r)})}catch(r){n.some(function(t){t.__h&&(t.__h=[])}),n=[],C.__e(r,i.__v)}}),yi&&yi(e,n)},C.unmount=function(e){bi&&bi(e);var n,i=e.__c;i&&i.__H&&(i.__H.__.some(function(r){try{He(r)}catch(t){n=t}}),i.__H=void 0,n&&C.__e(n,i.__v))};var wi=typeof requestAnimationFrame=="function";function $t(e){var n,i=function(){clearTimeout(r),wi&&cancelAnimationFrame(n),setTimeout(e)},r=setTimeout(i,35);wi&&(n=requestAnimationFrame(i))}function He(e){var n=S,i=e.__c;typeof i=="function"&&(e.__c=void 0,i()),S=n}function Fn(e){var n=S;e.__c=e.__(),S=n}function tr(e,n){return!e||e.length!==n.length||n.some(function(i,r){return i!==e[r]})}function or(e,n){return typeof n=="function"?n(e):n}var Mt=Symbol.for("preact-signals");function hn(){if(B>1)B--;else{var e,n=!1;for(function(){var t=Ge;for(Ge=void 0;t!==void 0;)t.S.v===t.v&&(t.S.i=t.i),t=t.o}();xe!==void 0;){var i=xe;for(xe=void 0,Ke++;i!==void 0;){var r=i.u;if(i.u=void 0,i.f&=-3,!(8&i.f)&&ar(i))try{i.c()}catch(t){n||(e=t,n=!0)}i=r}}if(Ke=0,B--,n)throw e}}function Rt(e){if(B>0)return e();In=++Pt,B++;try{return e()}finally{hn()}}var A=void 0;function Zn(e){var n=A;A=void 0;try{return e()}finally{A=n}}var xe=void 0,B=0,Ke=0,Pt=0,In=0,Ge=void 0,Ve=0;function lr(e){if(A!==void 0){var n=e.n;if(n===void 0||n.t!==A)return n={i:0,S:e,p:A.s,n:void 0,t:A,e:void 0,x:void 0,r:n},A.s!==void 0&&(A.s.n=n),A.s=n,e.n=n,32&A.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=A.s,n.n=void 0,A.s.n=n,A.s=n),n}}function N(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}N.prototype.brand=Mt;N.prototype.h=function(){return!0};N.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:Zn(function(){var r;(r=n.W)==null||r.call(n)}))};N.prototype.U=function(e){var n=this;if(this.t!==void 0){var i=e.e,r=e.x;i!==void 0&&(i.x=r,e.e=void 0),r!==void 0&&(r.e=i,e.x=void 0),e===this.t&&(this.t=r,r===void 0&&Zn(function(){var t;(t=n.Z)==null||t.call(n)}))}};N.prototype.subscribe=function(e){var n=this;return Le(function(){var i=n.value,r=A;A=void 0;try{e(i)}finally{A=r}},{name:"sub"})};N.prototype.valueOf=function(){return this.value};N.prototype.toString=function(){return this.value+""};N.prototype.toJSON=function(){return this.value};N.prototype.peek=function(){var e=this;return Zn(function(){return e.value})};Object.defineProperty(N.prototype,"value",{get:function(){var e=lr(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Ke>100)throw new Error("Cycle detected");(function(i){B!==0&&Ke===0&&i.l!==In&&(i.l=In,Ge={S:i,v:i.v,i:i.i,o:Ge})})(this),this.v=e,this.i++,Ve++,B++;try{for(var n=this.t;n!==void 0;n=n.x)n.t.N()}finally{hn()}}}});function y(e,n){return new N(e,n)}function ar(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 ur(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 cr(e){for(var n=e.s,i=void 0;n!==void 0;){var r=n.p;n.i===-1?(n.S.U(n),r!==void 0&&(r.n=n.n),n.n!==void 0&&(n.n.p=r)):i=n,n.S.n=n.r,n.r!==void 0&&(n.r=void 0),n=r}e.s=i}function ne(e,n){N.call(this,void 0),this.x=e,this.s=void 0,this.g=Ve-1,this.f=4,this.W=n?.watched,this.Z=n?.unwatched,this.name=n?.name}ne.prototype=new N;ne.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Ve))return!0;if(this.g=Ve,this.f|=1,this.i>0&&!ar(this))return this.f&=-2,!0;var e=A;try{ur(this),A=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 A=e,cr(this),this.f&=-2,!0};ne.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)}N.prototype.S.call(this,e)};ne.prototype.U=function(e){if(this.t!==void 0&&(N.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)}};ne.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(ne.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=lr(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function Ai(e,n){return new ne(e,n)}function sr(e){var n=e.m;if(e.m=void 0,typeof n=="function"){B++;var i=A;A=void 0;try{n()}catch(r){throw e.f&=-2,e.f|=8,Xn(e),r}finally{A=i,hn()}}}function Xn(e){for(var n=e.s;n!==void 0;n=n.n)n.S.U(n);e.x=void 0,e.s=void 0,sr(e)}function Dt(e){if(A!==this)throw new Error("Out-of-order effect");cr(this),A=e,this.f&=-2,8&this.f&&Xn(this),hn()}function he(e,n){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=n?.name}he.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()}};he.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,sr(this),ur(this),B++;var e=A;return A=this,Dt.bind(this,e)};he.prototype.N=function(){2&this.f||(this.f|=2,this.u=xe,xe=this)};he.prototype.d=function(){this.f|=8,1&this.f||Xn(this)};he.prototype.dispose=function(){this.d()};function Le(e,n){var i=new he(e,n);try{i.c()}catch(t){throw i.d(),t}var r=i.d.bind(i);return r[Symbol.dispose]=r,r}var fr,Pe,Ut=typeof window<"u"&&!!window.__PREACT_SIGNALS_DEVTOOLS__,dr=[];Le(function(){fr=this.N})();function _e(e,n){w[e]=n.bind(null,w[e]||function(){})}function Je(e){if(Pe){var n=Pe;Pe=void 0,n()}Pe=e&&e.S()}function pr(e){var n=this,i=e.data,r=Ht(i);r.value=i;var t=rr(function(){for(var a=n,u=n.__v;u=u.__;)if(u.__c){u.__c.__$f|=4;break}var s=Ai(function(){var p=r.value.value;return p===0?0:p===!0?"":p||""}),h=Ai(function(){return!Array.isArray(s.value)&&!zi(s.value)}),c=Le(function(){if(this.N=hr,h.value){var p=s.value;a.__v&&a.__v.__e&&a.__v.__e.nodeType===3&&(a.__v.__e.data=p)}}),d=n.__$u.d;return n.__$u.d=function(){c(),d.call(this)},[h,s]},[]),o=t[0],l=t[1];return o.value?l.peek():l.value}pr.displayName="ReactiveTextNode";Object.defineProperties(N.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:pr},props:{configurable:!0,get:function(){var e=this;return{data:{get value(){return e.value}}}}},__b:{configurable:!0,value:1}});_e("__b",function(e,n){if(typeof n.type=="string"){var i,r=n.props;for(var t in r)if(t!=="children"){var o=r[t];o instanceof N&&(i||(n.__np=i={}),i[t]=o,r[t]=o.peek())}}e(n)});_e("__r",function(e,n){if(e(n),n.type!==K){Je();var i,r=n.__c;r&&(r.__$f&=-2,(i=r.__$u)===void 0&&(r.__$u=i=function(t,o){var l;return Le(function(){l=this},{name:o}),l.c=t,l}(function(){var t;Ut&&((t=i.y)==null||t.call(i)),r.__$f|=1,r.setState({})},typeof n.type=="function"?n.type.displayName||n.type.name:""))),Je(i)}});_e("__e",function(e,n,i,r){Je(),e(n,i,r)});_e("diffed",function(e,n){Je();var i;if(typeof n.type=="string"&&(i=n.__e)){var r=n.__np,t=n.props;if(r){var o=i.U;if(o)for(var l in o){var a=o[l];a!==void 0&&!(l in r)&&(a.d(),o[l]=void 0)}else o={},i.U=o;for(var u in r){var s=o[u],h=r[u];s===void 0?(s=jt(i,u,h),o[u]=s):s.o(h,t)}for(var c in r)t[c]=r[c]}}e(n)});function jt(e,n,i,r){var t=n in e&&e.ownerSVGElement===void 0,o=y(i),l=i.peek();return{o:function(a,u){o.value=a,l=a.peek()},d:Le(function(){this.N=hr;var a=o.value.value;l!==a?(l=void 0,t?e[n]=a:a!=null&&(a!==!1||n[4]==="-")?e.setAttribute(n,a):e.removeAttribute(n)):l=void 0})}}_e("unmount",function(e,n){if(typeof n.type=="string"){var i=n.__e;if(i){var r=i.U;if(r){i.U=void 0;for(var t in r){var o=r[t];o&&o.d()}}}n.__np=void 0}else{var l=n.__c;if(l){var a=l.__$u;a&&(l.__$u=void 0,a.d())}}e(n)});_e("__h",function(e,n,i,r){(r<3||r===9)&&(n.__$f|=2),e(n,i,r)});be.prototype.shouldComponentUpdate=function(e,n){if(this.__R)return!0;var i=this.__$u,r=i&&i.s!==void 0;for(var t in n)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var o=2&this.__$f;if(!(r||o||4&this.__$f)||1&this.__$f)return!0}else if(!(r||4&this.__$f)||3&this.__$f)return!0;for(var l in e)if(l!=="__source"&&e[l]!==this.props[l])return!0;for(var a in this.props)if(!(a in e))return!0;return!1};function Ht(e,n){return rr(function(){return y(e,n)},[])}var Bt=function(e){queueMicrotask(function(){queueMicrotask(e)})};function Yt(){Rt(function(){for(var e;e=dr.shift();)fr.call(e)})}function hr(){dr.push(this)===1&&(w.requestAnimationFrame||Bt)(Yt)}function _r(){const e=window.location.hash;return e===""||e==="#"?"/":e.startsWith("#")?e.slice(1):e}const Ln=y(_r());function Wt(e){const n=e.startsWith("/")?e:`/${e}`;`#${n}`!==window.location.hash&&(window.location.hash=n)}let Si=!1;function zt(){Si||(Si=!0,window.addEventListener("hashchange",()=>{Ln.value=_r()}))}let $n=null;function qt(e){$n=e}class G extends Error{status;body;constructor(n,i,r){super(r),this.status=n,this.body=i}}async function I(e,n={}){const i={Accept:"application/json",...n.headers??{}};$n!==null&&(i.Authorization=`Bearer ${$n}`);const{body:r,...t}=n,o={...t,headers:i};r!==void 0&&(o.body=JSON.stringify(r),i["Content-Type"]="application/json");const l=await fetch(e,o),a=await l.text(),u=a===""?{}:JSON.parse(a);if(!l.ok){const s=u.error?.message??`request failed (${l.status})`;throw new G(l.status,u,s)}return u}function Kt({id:e,children:n}){return f("p",{class:"ac-field__description",id:e,children:n})}function Gt({id:e,children:n}){return f("p",{class:"ac-field__error",id:e,role:"alert","aria-live":"polite",children:n})}function ie({id:e,label:n,description:i,error:r,children:t}){const o=i!==void 0?`${e}-desc`:void 0,l=r!==void 0?`${e}-err`:void 0;return f("div",{class:"ac-field","data-invalid":r!==void 0?"true":void 0,children:[f("label",{class:"ac-field__label",for:e,children:n}),i!==void 0?f(Kt,{id:o,children:i}):null,f("div",{class:"ac-field__control","aria-describedby":o,"aria-errormessage":l,children:t}),r!==void 0?f(Gt,{id:l,children:r}):null]})}function vr(e){return f(ie,{id:e.id,label:e.label,description:e.description,error:e.error,children:f("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 Vt(e){const n=e.step??(e.integer===!0?1:"any");return f(ie,{id:e.id,label:e.label,description:e.description,error:e.error,children:f("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 r=i.currentTarget.value,t=r===""?0:Number(r);e.onChange(Number.isFinite(t)?t:0)}})})}function Jt(e){return f(ie,{id:e.id,label:e.label,description:e.description,error:e.error,children:f("label",{class:"ac-toggle",children:[f("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)}),f("span",{class:"ac-toggle__track","aria-hidden":"true"}),f("span",{class:"ac-toggle__state",children:e.value?"On":"Off"})]})})}function Mn(e){const n=e.options.length>3;return f(ie,{id:e.id,label:e.label,description:e.description,error:e.error,children:n?f("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=>f("option",{value:i.value,children:i.label??(i.value===""?"(none)":i.value)},i.value))}):f("div",{class:"ac-radio-group",role:"radiogroup","aria-labelledby":`${e.id}-label`,children:e.options.map(i=>{const r=`${e.id}-${i.value||"none"}`;return f("label",{class:"ac-radio",for:r,children:[f("input",{type:"radio",id:r,name:e.name,value:i.value,checked:i.value===e.value,onChange:()=>e.onChange(i.value)}),f("span",{children:i.label??(i.value===""?"(none)":i.value)})]},i.value)})})})}function Qe(e){return f(ie,{id:e.id,label:e.label,description:e.description,error:e.error,children:f("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 mr(e){return e.replace(/_/g," ").replace(/\./g," › ").replace(/\b\w/g,n=>n.toUpperCase())}function Qt(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 An(e,n){const i=Qt(n);return{path:e,kind:i,label:mr(e[e.length-1]??""),description:n.description,options:n.enum,min:n.minimum,max:n.maximum}}function Zt(e){const n=[],i=e.properties??{};for(const[r,t]of Object.entries(i))if(t.type==="object"&&t.properties!==void 0){const o=[];for(const[l,a]of Object.entries(t.properties))if(a.type==="object"&&a.properties!==void 0)for(const[u,s]of Object.entries(a.properties))o.push(An([r,l,u],s));else o.push(An([r,l],a));n.push({path:[r],label:mr(r),description:t.description,fields:o})}else{const o=n.find(a=>a.path[0]==="__general"),l=An([r],t);o===void 0?n.unshift({path:["__general"],label:"General",fields:[l]}):o.fields.push(l)}return n}function Xt(e,n){let i=e;for(const r of n){if(i===null||typeof i!="object"||Array.isArray(i))return;i=i[r]}return i}function gr(e,n,i){if(n.length===0)return e;const[r,...t]=n;if(r===void 0)return e;const o={...e};if(t.length===0)return o[r]=i,o;const l=o[r],a=l!==null&&typeof l=="object"&&!Array.isArray(l)?l:{};return o[r]=gr(a,t,i),o}function we(e){return e.join(".")}function eo(e,n,i,r){const t=we(e.path),o=t,l=Xt(n,e.path),a=i[t],u=s=>{r(gr(n,e.path,s))};switch(e.kind){case"string":{const s=typeof l=="string"?l:"";return s.length>80?f(Qe,{id:t,name:o,label:e.label,description:e.description,error:a,value:s,onChange:u}):f(vr,{id:t,name:o,label:e.label,description:e.description,error:a,value:s,onChange:u})}case"enum":{const s=typeof l=="string"||typeof l=="number"?String(l):"",h=(e.options??[]).map(c=>({value:String(c)}));return f(Mn,{id:t,name:o,label:e.label,description:e.description,error:a,value:s,options:h,onChange:u})}case"number":case"integer":{const s=typeof l=="number"?l:0;return f(Vt,{id:t,name:o,label:e.label,description:e.description,error:a,value:s,integer:e.kind==="integer",min:e.min,max:e.max,onChange:u})}case"boolean":{const s=typeof l=="boolean"?l:!1;return f(Jt,{id:t,name:o,label:e.label,description:e.description,error:a,value:s,onChange:u})}case"array-of-strings":{const h=(Array.isArray(l)?l.filter(c=>typeof c=="string"):[]).join(`
2
- `);return f(Qe,{id:t,name:o,label:e.label,description:`${e.description??""} (one entry per line)`.trim(),error:a,value:h,onChange:c=>{const d=c.split(`
3
- `).map(p=>p.trim()).filter(p=>p!=="");u(d)}})}default:return null}}function no({section:e,values:n,errors:i,onChange:r}){return f("section",{class:"ac-section","aria-labelledby":`section-${we(e.path)}`,children:[f("h2",{class:"ac-section__title",id:`section-${we(e.path)}`,children:e.label}),e.description!==void 0?f("p",{class:"ac-section__description",children:e.description}):null,f("div",{class:"ac-section__fields",children:e.fields.map(t=>f("div",{children:eo(t,n,i,r)},we(t.path)))})]})}function yr(e){const n=Zt(e.schema),i=e.errors??{};return f("form",{class:"ac-form",onSubmit:r=>r.preventDefault(),children:[n.map(r=>f(no,{section:r,values:e.values,errors:i,onChange:e.onChange},we(r.path))),e.actions!==void 0?f("div",{class:"ac-form__actions",children:e.actions}):null]})}function ve(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 io(e){return/expected (boolean|string|number)/i.test(e)?e.replace(/^expected/i,"Expected"):e}function $e(e){const n={};for(const i of e.fields??[])n[i.path]=io(i.message);return n}const br=y(!1),Ze=y(null),Ce=y({}),xr=y(null),Xe=y(0),ke=y({}),j=y(null),Ee=y(!1),fe=y(null);function ro(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 Ci(){Ze.value=null;try{const e=await I("/api/v1/settings");Ce.value=e.values,xr.value=ro(e.schema),Xe.value=e.lastModified,br.value=!0}catch(e){Ze.value=e instanceof Error?e.message:String(e)}}async function to(){if(!Ee.value){j.value=null,ke.value={};try{const e=await I("/api/v1/settings/diff",{method:"POST",body:{values:Ce.value,ifUnmodifiedSince:Xe.value}});if(e.changes.length===0){j.value="No changes to save.";return}fe.value=e.changes}catch(e){e instanceof G?(ke.value=$e(e.body.error??{message:e.message}),j.value=ve(e.body.error??{code:"UNKNOWN",message:e.message})):j.value=e instanceof Error?e.message:String(e)}}}async function oo(){Ee.value=!0;try{const e=await I("/api/v1/settings",{method:"PUT",headers:{"If-Unmodified-Since":String(Xe.value)},body:{values:Ce.value}});Xe.value=e.lastModified,fe.value=null,j.value=`Saved (${e.writtenPaths.join(", ")}).`}catch(e){if(e instanceof G){const n=e.body.error??{code:"UNKNOWN",message:e.message};ke.value=$e(n),j.value=ve(n),fe.value=null;const i=Object.keys(ke.value)[0];i!==void 0&&queueMicrotask(()=>{const r=document.getElementById(i);r!==null&&r.focus()})}else j.value=e instanceof Error?e.message:String(e)}finally{Ee.value=!1}}function lo({changes:e}){return f("div",{class:"ac-modal",role:"dialog","aria-modal":"true","aria-labelledby":"diff-title",children:f("div",{class:"ac-modal__panel",children:[f("h2",{id:"diff-title",children:"Confirm changes"}),f("ul",{class:"ac-diff",children:e.map(n=>f("li",{children:[f("code",{children:n.path}),f("span",{class:"ac-diff__before",children:JSON.stringify(n.from)}),f("span",{class:"ac-diff__arrow",children:"→"}),f("span",{class:"ac-diff__after",children:JSON.stringify(n.to)})]},n.path))}),f("div",{class:"ac-modal__actions",children:[f("button",{type:"button",class:"ac-button",onClick:()=>{fe.value=null},children:"Cancel"}),f("button",{type:"button",class:"ac-button ac-button--primary",disabled:Ee.value,onClick:()=>{oo()},children:Ee.value?"Saving…":"Save"})]})]})})}function ao(){return pn(()=>{Ci()},[]),br.value?f("div",{class:"ac-page",children:[f("header",{class:"ac-page__header",children:[f("h1",{children:"Settings"}),f("nav",{class:"ac-page__nav",children:f("a",{href:"#/settings/user",children:"Edit .agent-user.yml →"})})]}),j.value!==null?f("p",{class:"ac-banner",children:j.value}):null,f(yr,{schema:xr.value,values:Ce.value,errors:ke.value,onChange:e=>{Ce.value=e},actions:f(K,{children:[f("button",{type:"button",class:"ac-button",onClick:()=>{Ci()},children:"Reload"}),f("button",{type:"button",class:"ac-button ac-button--primary",onClick:()=>{to()},children:"Preview & Save"})]})}),fe.value!==null?f(lo,{changes:fe.value}):null]}):f("div",{class:"ac-page",children:[f("h1",{children:"Settings"}),Ze.value!==null?f("p",{class:"ac-banner ac-banner--error",children:Ze.value}):f("p",{children:"Loading…"})]})}function uo(e){const[n]=ir(()=>`${e.id}-list`);return f(ie,{id:e.id,label:e.label,description:e.description,error:e.error,children:[f("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)}),f("datalist",{id:n,children:e.suggestions.map(i=>f("option",{value:i},i))})]})}const co=["developer","reviewer","designer","product-manager","ops","qa","maintainer"],so=["de","en","en-US","en-GB","fr","es","it","nl","pt","pt-BR"];function ki(){return new Date().toISOString().slice(0,10)}function J(e,n){return e?.[n]}function wr({value:e,onChange:n,errors:i}){const[r,t]=ir(""),o="umd-role-suggestions";function l(d){n({...e,...d,last_updated:ki()})}const a=e.role.filter(d=>d.trim()!=="");function u(d){const p=d.trim();if(p===""||a.includes(p)){t("");return}l({role:[...a,p]}),t("")}function s(d){a.length<=1||l({role:a.filter(p=>p!==d)})}function h(d){const p={...e,last_updated:ki()};d===""?delete p.notes:p.notes=d,n(p)}const c=co.filter(d=>!a.includes(d));return f("div",{class:"ac-user-md-form",children:[f(vr,{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:J(i,"identity.name"),onChange:d=>l({identity:{...e.identity,name:d}})}),f(uo,{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:so,error:J(i,"language"),onChange:d=>l({language:d})}),f(ie,{id:"umd-role-input",label:"Roles",description:"One or more roles. Seeded suggestions are non-binding — type anything and press Enter.",error:J(i,"role"),children:[f("ul",{class:"ac-chip-list","data-testid":"umd-role-list",children:a.map(d=>f("li",{class:"ac-chip",children:[f("span",{children:d}),f("button",{type:"button",class:"ac-chip__remove","aria-label":`Remove ${d}`,disabled:a.length<=1,onClick:()=>s(d),children:"×"})]},d))}),f("div",{class:"ac-role-add",children:[f("input",{class:"ac-input",type:"text",id:"umd-role-input",name:"role-add",list:o,placeholder:"Add a role and press Enter",value:r,onInput:d=>t(d.currentTarget.value),onKeyDown:d=>{(d.key==="Enter"||d.key===",")&&(d.preventDefault(),u(r))}}),f("datalist",{id:o,children:c.map(d=>f("option",{value:d},d))}),f("button",{type:"button",class:"ac-button",onClick:()=>u(r),children:"Add role"})]})]}),f(Mn,{id:"umd-formality",name:"style.formality",label:"Formality",value:e.style.formality,error:J(i,"style.formality"),options:[{value:"informal",label:"Informal (Du / first-name)"},{value:"formal",label:"Formal (Sie / surname)"}],onChange:d=>l({style:{...e.style,formality:d}})}),f(Mn,{id:"umd-pace",name:"style.pace",label:"Pace",value:e.style.pace,error:J(i,"style.pace"),options:[{value:"pragmatic",label:"Pragmatic"},{value:"thorough",label:"Thorough"},{value:"rapid",label:"Rapid"}],onChange:d=>l({style:{...e.style,pace:d}})}),f(Qe,{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:J(i,"voice_sample"),onChange:d=>l({voice_sample:d})}),f(Qe,{id:"umd-notes",name:"notes",label:"Notes",description:"Optional free-form prose the agent remembers across sessions.",rows:6,value:e.notes??"",error:J(i,"notes"),onChange:h})]})}function _n(){return{version:1,identity:{name:""},language:"en",role:[""],style:{formality:"informal",pace:"pragmatic"},voice_sample:"",last_updated:"1970-01-01"}}function Ei(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function De(e,n){return typeof e=="string"?e:n}function fo(e){return e==="formal"?"formal":"informal"}function po(e){return e==="thorough"||e==="rapid"?e:"pragmatic"}function ho(e){if(!Array.isArray(e))return[""];const n=e.filter(i=>typeof i=="string");return n.length===0?[""]:n}function _o(e){if(typeof e=="string")return e===""?void 0:e}function en(e){const n=_n(),i=Ei(e.identity)?e.identity:{},r=Ei(e.style)?e.style:{},t=_o(e.notes),o={version:1,identity:{name:De(i.name,n.identity.name)},language:De(e.language,n.language),role:ho(e.role),style:{formality:fo(r.formality),pace:po(r.pace)},voice_sample:De(e.voice_sample,n.voice_sample),last_updated:De(e.last_updated,n.last_updated)};return t!==void 0&&(o.notes=t),o}/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */function Ar(e){return typeof e>"u"||e===null}function vo(e){return typeof e=="object"&&e!==null}function mo(e){return Array.isArray(e)?e:Ar(e)?[]:[e]}function go(e,n){var i,r,t,o;if(n)for(o=Object.keys(n),i=0,r=o.length;i<r;i+=1)t=o[i],e[t]=n[t];return e}function yo(e,n){var i="",r;for(r=0;r<n;r+=1)i+=e;return i}function bo(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var xo=Ar,wo=vo,Ao=mo,So=yo,Co=bo,ko=go,E={isNothing:xo,isObject:wo,toArray:Ao,repeat:So,isNegativeZero:Co,extend:ko};function Sr(e,n){var i="",r=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(i+='in "'+e.mark.name+'" '),i+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!n&&e.mark.snippet&&(i+=`
4
-
5
- `+e.mark.snippet),r+" "+i):r}function Te(e,n){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=n,this.message=Sr(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Te.prototype=Object.create(Error.prototype);Te.prototype.constructor=Te;Te.prototype.toString=function(n){return this.name+": "+Sr(this,n)};var F=Te;function Sn(e,n,i,r,t){var o="",l="",a=Math.floor(t/2)-1;return r-n>a&&(o=" ... ",n=r-a+o.length),i-r>a&&(l=" ...",i=r+a-l.length),{str:o+e.slice(n,i).replace(/\t/g,"→")+l,pos:r-n+o.length}}function Cn(e,n){return E.repeat(" ",n-e.length)+e}function Eo(e,n){if(n=Object.create(n||null),!e.buffer)return null;n.maxLength||(n.maxLength=79),typeof n.indent!="number"&&(n.indent=1),typeof n.linesBefore!="number"&&(n.linesBefore=3),typeof n.linesAfter!="number"&&(n.linesAfter=2);for(var i=/\r?\n|\r|\0/g,r=[0],t=[],o,l=-1;o=i.exec(e.buffer);)t.push(o.index),r.push(o.index+o[0].length),e.position<=o.index&&l<0&&(l=r.length-2);l<0&&(l=r.length-1);var a="",u,s,h=Math.min(e.line+n.linesAfter,t.length).toString().length,c=n.maxLength-(n.indent+h+3);for(u=1;u<=n.linesBefore&&!(l-u<0);u++)s=Sn(e.buffer,r[l-u],t[l-u],e.position-(r[l]-r[l-u]),c),a=E.repeat(" ",n.indent)+Cn((e.line-u+1).toString(),h)+" | "+s.str+`
6
- `+a;for(s=Sn(e.buffer,r[l],t[l],e.position,c),a+=E.repeat(" ",n.indent)+Cn((e.line+1).toString(),h)+" | "+s.str+`
7
- `,a+=E.repeat("-",n.indent+h+3+s.pos)+`^
8
- `,u=1;u<=n.linesAfter&&!(l+u>=t.length);u++)s=Sn(e.buffer,r[l+u],t[l+u],e.position-(r[l]-r[l+u]),c),a+=E.repeat(" ",n.indent)+Cn((e.line+u+1).toString(),h)+" | "+s.str+`
9
- `;return a.replace(/\n$/,"")}var To=Eo,No=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Oo=["scalar","sequence","mapping"];function Fo(e){var n={};return e!==null&&Object.keys(e).forEach(function(i){e[i].forEach(function(r){n[String(r)]=i})}),n}function Io(e,n){if(n=n||{},Object.keys(n).forEach(function(i){if(No.indexOf(i)===-1)throw new F('Unknown option "'+i+'" is met in definition of "'+e+'" YAML type.')}),this.options=n,this.tag=e,this.kind=n.kind||null,this.resolve=n.resolve||function(){return!0},this.construct=n.construct||function(i){return i},this.instanceOf=n.instanceOf||null,this.predicate=n.predicate||null,this.represent=n.represent||null,this.representName=n.representName||null,this.defaultStyle=n.defaultStyle||null,this.multi=n.multi||!1,this.styleAliases=Fo(n.styleAliases||null),Oo.indexOf(this.kind)===-1)throw new F('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var T=Io;function Ti(e,n){var i=[];return e[n].forEach(function(r){var t=i.length;i.forEach(function(o,l){o.tag===r.tag&&o.kind===r.kind&&o.multi===r.multi&&(t=l)}),i[t]=r}),i}function Lo(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},n,i;function r(t){t.multi?(e.multi[t.kind].push(t),e.multi.fallback.push(t)):e[t.kind][t.tag]=e.fallback[t.tag]=t}for(n=0,i=arguments.length;n<i;n+=1)arguments[n].forEach(r);return e}function Rn(e){return this.extend(e)}Rn.prototype.extend=function(n){var i=[],r=[];if(n instanceof T)r.push(n);else if(Array.isArray(n))r=r.concat(n);else if(n&&(Array.isArray(n.implicit)||Array.isArray(n.explicit)))n.implicit&&(i=i.concat(n.implicit)),n.explicit&&(r=r.concat(n.explicit));else throw new F("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");i.forEach(function(o){if(!(o instanceof T))throw new F("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(o.loadKind&&o.loadKind!=="scalar")throw new F("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(o.multi)throw new F("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),r.forEach(function(o){if(!(o instanceof T))throw new F("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var t=Object.create(Rn.prototype);return t.implicit=(this.implicit||[]).concat(i),t.explicit=(this.explicit||[]).concat(r),t.compiledImplicit=Ti(t,"implicit"),t.compiledExplicit=Ti(t,"explicit"),t.compiledTypeMap=Lo(t.compiledImplicit,t.compiledExplicit),t};var Cr=Rn,kr=new T("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Er=new T("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Tr=new T("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Nr=new Cr({explicit:[kr,Er,Tr]});function $o(e){if(e===null)return!0;var n=e.length;return n===1&&e==="~"||n===4&&(e==="null"||e==="Null"||e==="NULL")}function Mo(){return null}function Ro(e){return e===null}var Or=new T("tag:yaml.org,2002:null",{kind:"scalar",resolve:$o,construct:Mo,predicate:Ro,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Po(e){if(e===null)return!1;var n=e.length;return n===4&&(e==="true"||e==="True"||e==="TRUE")||n===5&&(e==="false"||e==="False"||e==="FALSE")}function Do(e){return e==="true"||e==="True"||e==="TRUE"}function Uo(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Fr=new T("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Po,construct:Do,predicate:Uo,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function jo(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Ho(e){return 48<=e&&e<=55}function Bo(e){return 48<=e&&e<=57}function Yo(e){if(e===null)return!1;var n=e.length,i=0,r=!1,t;if(!n)return!1;if(t=e[i],(t==="-"||t==="+")&&(t=e[++i]),t==="0"){if(i+1===n)return!0;if(t=e[++i],t==="b"){for(i++;i<n;i++)if(t=e[i],t!=="_"){if(t!=="0"&&t!=="1")return!1;r=!0}return r&&t!=="_"}if(t==="x"){for(i++;i<n;i++)if(t=e[i],t!=="_"){if(!jo(e.charCodeAt(i)))return!1;r=!0}return r&&t!=="_"}if(t==="o"){for(i++;i<n;i++)if(t=e[i],t!=="_"){if(!Ho(e.charCodeAt(i)))return!1;r=!0}return r&&t!=="_"}}if(t==="_")return!1;for(;i<n;i++)if(t=e[i],t!=="_"){if(!Bo(e.charCodeAt(i)))return!1;r=!0}return!(!r||t==="_")}function Wo(e){var n=e,i=1,r;if(n.indexOf("_")!==-1&&(n=n.replace(/_/g,"")),r=n[0],(r==="-"||r==="+")&&(r==="-"&&(i=-1),n=n.slice(1),r=n[0]),n==="0")return 0;if(r==="0"){if(n[1]==="b")return i*parseInt(n.slice(2),2);if(n[1]==="x")return i*parseInt(n.slice(2),16);if(n[1]==="o")return i*parseInt(n.slice(2),8)}return i*parseInt(n,10)}function zo(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!E.isNegativeZero(e)}var Ir=new T("tag:yaml.org,2002:int",{kind:"scalar",resolve:Yo,construct:Wo,predicate:zo,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),qo=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Ko(e){return!(e===null||!qo.test(e)||e[e.length-1]==="_")}function Go(e){var n,i;return n=e.replace(/_/g,"").toLowerCase(),i=n[0]==="-"?-1:1,"+-".indexOf(n[0])>=0&&(n=n.slice(1)),n===".inf"?i===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:n===".nan"?NaN:i*parseFloat(n,10)}var Vo=/^[-+]?[0-9]+e/;function Jo(e,n){var i;if(isNaN(e))switch(n){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(n){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(n){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(E.isNegativeZero(e))return"-0.0";return i=e.toString(10),Vo.test(i)?i.replace("e",".e"):i}function Qo(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||E.isNegativeZero(e))}var Lr=new T("tag:yaml.org,2002:float",{kind:"scalar",resolve:Ko,construct:Go,predicate:Qo,represent:Jo,defaultStyle:"lowercase"}),$r=Nr.extend({implicit:[Or,Fr,Ir,Lr]}),Mr=$r,Rr=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Pr=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 Zo(e){return e===null?!1:Rr.exec(e)!==null||Pr.exec(e)!==null}function Xo(e){var n,i,r,t,o,l,a,u=0,s=null,h,c,d;if(n=Rr.exec(e),n===null&&(n=Pr.exec(e)),n===null)throw new Error("Date resolve error");if(i=+n[1],r=+n[2]-1,t=+n[3],!n[4])return new Date(Date.UTC(i,r,t));if(o=+n[4],l=+n[5],a=+n[6],n[7]){for(u=n[7].slice(0,3);u.length<3;)u+="0";u=+u}return n[9]&&(h=+n[10],c=+(n[11]||0),s=(h*60+c)*6e4,n[9]==="-"&&(s=-s)),d=new Date(Date.UTC(i,r,t,o,l,a,u)),s&&d.setTime(d.getTime()-s),d}function el(e){return e.toISOString()}var Dr=new T("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Zo,construct:Xo,instanceOf:Date,represent:el});function nl(e){return e==="<<"||e===null}var Ur=new T("tag:yaml.org,2002:merge",{kind:"scalar",resolve:nl}),ei=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
10
- \r`;function il(e){if(e===null)return!1;var n,i,r=0,t=e.length,o=ei;for(i=0;i<t;i++)if(n=o.indexOf(e.charAt(i)),!(n>64)){if(n<0)return!1;r+=6}return r%8===0}function rl(e){var n,i,r=e.replace(/[\r\n=]/g,""),t=r.length,o=ei,l=0,a=[];for(n=0;n<t;n++)n%4===0&&n&&(a.push(l>>16&255),a.push(l>>8&255),a.push(l&255)),l=l<<6|o.indexOf(r.charAt(n));return i=t%4*6,i===0?(a.push(l>>16&255),a.push(l>>8&255),a.push(l&255)):i===18?(a.push(l>>10&255),a.push(l>>2&255)):i===12&&a.push(l>>4&255),new Uint8Array(a)}function tl(e){var n="",i=0,r,t,o=e.length,l=ei;for(r=0;r<o;r++)r%3===0&&r&&(n+=l[i>>18&63],n+=l[i>>12&63],n+=l[i>>6&63],n+=l[i&63]),i=(i<<8)+e[r];return t=o%3,t===0?(n+=l[i>>18&63],n+=l[i>>12&63],n+=l[i>>6&63],n+=l[i&63]):t===2?(n+=l[i>>10&63],n+=l[i>>4&63],n+=l[i<<2&63],n+=l[64]):t===1&&(n+=l[i>>2&63],n+=l[i<<4&63],n+=l[64],n+=l[64]),n}function ol(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var jr=new T("tag:yaml.org,2002:binary",{kind:"scalar",resolve:il,construct:rl,predicate:ol,represent:tl}),ll=Object.prototype.hasOwnProperty,al=Object.prototype.toString;function ul(e){if(e===null)return!0;var n=[],i,r,t,o,l,a=e;for(i=0,r=a.length;i<r;i+=1){if(t=a[i],l=!1,al.call(t)!=="[object Object]")return!1;for(o in t)if(ll.call(t,o))if(!l)l=!0;else return!1;if(!l)return!1;if(n.indexOf(o)===-1)n.push(o);else return!1}return!0}function cl(e){return e!==null?e:[]}var Hr=new T("tag:yaml.org,2002:omap",{kind:"sequence",resolve:ul,construct:cl}),sl=Object.prototype.toString;function fl(e){if(e===null)return!0;var n,i,r,t,o,l=e;for(o=new Array(l.length),n=0,i=l.length;n<i;n+=1){if(r=l[n],sl.call(r)!=="[object Object]"||(t=Object.keys(r),t.length!==1))return!1;o[n]=[t[0],r[t[0]]]}return!0}function dl(e){if(e===null)return[];var n,i,r,t,o,l=e;for(o=new Array(l.length),n=0,i=l.length;n<i;n+=1)r=l[n],t=Object.keys(r),o[n]=[t[0],r[t[0]]];return o}var Br=new T("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:fl,construct:dl}),pl=Object.prototype.hasOwnProperty;function hl(e){if(e===null)return!0;var n,i=e;for(n in i)if(pl.call(i,n)&&i[n]!==null)return!1;return!0}function _l(e){return e!==null?e:{}}var Yr=new T("tag:yaml.org,2002:set",{kind:"mapping",resolve:hl,construct:_l}),ni=Mr.extend({implicit:[Dr,Ur],explicit:[jr,Hr,Br,Yr]}),q=Object.prototype.hasOwnProperty,nn=1,Wr=2,zr=3,rn=4,kn=1,vl=2,Ni=3,ml=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,gl=/[\x85\u2028\u2029]/,yl=/[,\[\]\{\}]/,qr=/^(?:!|!!|![a-z\-]+!)$/i,Kr=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Oi(e){return Object.prototype.toString.call(e)}function D(e){return e===10||e===13}function Q(e){return e===9||e===32}function $(e){return e===9||e===32||e===10||e===13}function le(e){return e===44||e===91||e===93||e===123||e===125}function bl(e){var n;return 48<=e&&e<=57?e-48:(n=e|32,97<=n&&n<=102?n-97+10:-1)}function xl(e){return e===120?2:e===117?4:e===85?8:0}function wl(e){return 48<=e&&e<=57?e-48:-1}function Fi(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
11
- `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"…":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function Al(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function Gr(e,n,i){n==="__proto__"?Object.defineProperty(e,n,{configurable:!0,enumerable:!0,writable:!0,value:i}):e[n]=i}var Vr=new Array(256),Jr=new Array(256);for(var te=0;te<256;te++)Vr[te]=Fi(te)?1:0,Jr[te]=Fi(te);function Sl(e,n){this.input=e,this.filename=n.filename||null,this.schema=n.schema||ni,this.onWarning=n.onWarning||null,this.legacy=n.legacy||!1,this.json=n.json||!1,this.listener=n.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Qr(e,n){var i={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return i.snippet=To(i),new F(n,i)}function v(e,n){throw Qr(e,n)}function tn(e,n){e.onWarning&&e.onWarning.call(null,Qr(e,n))}var Ii={YAML:function(n,i,r){var t,o,l;n.version!==null&&v(n,"duplication of %YAML directive"),r.length!==1&&v(n,"YAML directive accepts exactly one argument"),t=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),t===null&&v(n,"ill-formed argument of the YAML directive"),o=parseInt(t[1],10),l=parseInt(t[2],10),o!==1&&v(n,"unacceptable YAML version of the document"),n.version=r[0],n.checkLineBreaks=l<2,l!==1&&l!==2&&tn(n,"unsupported YAML version of the document")},TAG:function(n,i,r){var t,o;r.length!==2&&v(n,"TAG directive accepts exactly two arguments"),t=r[0],o=r[1],qr.test(t)||v(n,"ill-formed tag handle (first argument) of the TAG directive"),q.call(n.tagMap,t)&&v(n,'there is a previously declared suffix for "'+t+'" tag handle'),Kr.test(o)||v(n,"ill-formed tag prefix (second argument) of the TAG directive");try{o=decodeURIComponent(o)}catch{v(n,"tag prefix is malformed: "+o)}n.tagMap[t]=o}};function z(e,n,i,r){var t,o,l,a;if(n<i){if(a=e.input.slice(n,i),r)for(t=0,o=a.length;t<o;t+=1)l=a.charCodeAt(t),l===9||32<=l&&l<=1114111||v(e,"expected valid JSON character");else ml.test(a)&&v(e,"the stream contains non-printable characters");e.result+=a}}function Li(e,n,i,r){var t,o,l,a;for(E.isObject(i)||v(e,"cannot merge mappings; the provided source object is unacceptable"),t=Object.keys(i),l=0,a=t.length;l<a;l+=1)o=t[l],q.call(n,o)||(Gr(n,o,i[o]),r[o]=!0)}function ae(e,n,i,r,t,o,l,a,u){var s,h;if(Array.isArray(t))for(t=Array.prototype.slice.call(t),s=0,h=t.length;s<h;s+=1)Array.isArray(t[s])&&v(e,"nested arrays are not supported inside keys"),typeof t=="object"&&Oi(t[s])==="[object Object]"&&(t[s]="[object Object]");if(typeof t=="object"&&Oi(t)==="[object Object]"&&(t="[object Object]"),t=String(t),n===null&&(n={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(o))for(s=0,h=o.length;s<h;s+=1)Li(e,n,o[s],i);else Li(e,n,o,i);else!e.json&&!q.call(i,t)&&q.call(n,t)&&(e.line=l||e.line,e.lineStart=a||e.lineStart,e.position=u||e.position,v(e,"duplicated mapping key")),Gr(n,t,o),delete i[t];return n}function ii(e){var n;n=e.input.charCodeAt(e.position),n===10?e.position++:n===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):v(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function k(e,n,i){for(var r=0,t=e.input.charCodeAt(e.position);t!==0;){for(;Q(t);)t===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),t=e.input.charCodeAt(++e.position);if(n&&t===35)do t=e.input.charCodeAt(++e.position);while(t!==10&&t!==13&&t!==0);if(D(t))for(ii(e),t=e.input.charCodeAt(e.position),r++,e.lineIndent=0;t===32;)e.lineIndent++,t=e.input.charCodeAt(++e.position);else break}return i!==-1&&r!==0&&e.lineIndent<i&&tn(e,"deficient indentation"),r}function vn(e){var n=e.position,i;return i=e.input.charCodeAt(n),!!((i===45||i===46)&&i===e.input.charCodeAt(n+1)&&i===e.input.charCodeAt(n+2)&&(n+=3,i=e.input.charCodeAt(n),i===0||$(i)))}function ri(e,n){n===1?e.result+=" ":n>1&&(e.result+=E.repeat(`
12
- `,n-1))}function Cl(e,n,i){var r,t,o,l,a,u,s,h,c=e.kind,d=e.result,p;if(p=e.input.charCodeAt(e.position),$(p)||le(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(t=e.input.charCodeAt(e.position+1),$(t)||i&&le(t)))return!1;for(e.kind="scalar",e.result="",o=l=e.position,a=!1;p!==0;){if(p===58){if(t=e.input.charCodeAt(e.position+1),$(t)||i&&le(t))break}else if(p===35){if(r=e.input.charCodeAt(e.position-1),$(r))break}else{if(e.position===e.lineStart&&vn(e)||i&&le(p))break;if(D(p))if(u=e.line,s=e.lineStart,h=e.lineIndent,k(e,!1,-1),e.lineIndent>=n){a=!0,p=e.input.charCodeAt(e.position);continue}else{e.position=l,e.line=u,e.lineStart=s,e.lineIndent=h;break}}a&&(z(e,o,l,!1),ri(e,e.line-u),o=l=e.position,a=!1),Q(p)||(l=e.position+1),p=e.input.charCodeAt(++e.position)}return z(e,o,l,!1),e.result?!0:(e.kind=c,e.result=d,!1)}function kl(e,n){var i,r,t;if(i=e.input.charCodeAt(e.position),i!==39)return!1;for(e.kind="scalar",e.result="",e.position++,r=t=e.position;(i=e.input.charCodeAt(e.position))!==0;)if(i===39)if(z(e,r,e.position,!0),i=e.input.charCodeAt(++e.position),i===39)r=e.position,e.position++,t=e.position;else return!0;else D(i)?(z(e,r,t,!0),ri(e,k(e,!1,n)),r=t=e.position):e.position===e.lineStart&&vn(e)?v(e,"unexpected end of the document within a single quoted scalar"):(e.position++,t=e.position);v(e,"unexpected end of the stream within a single quoted scalar")}function El(e,n){var i,r,t,o,l,a;if(a=e.input.charCodeAt(e.position),a!==34)return!1;for(e.kind="scalar",e.result="",e.position++,i=r=e.position;(a=e.input.charCodeAt(e.position))!==0;){if(a===34)return z(e,i,e.position,!0),e.position++,!0;if(a===92){if(z(e,i,e.position,!0),a=e.input.charCodeAt(++e.position),D(a))k(e,!1,n);else if(a<256&&Vr[a])e.result+=Jr[a],e.position++;else if((l=xl(a))>0){for(t=l,o=0;t>0;t--)a=e.input.charCodeAt(++e.position),(l=bl(a))>=0?o=(o<<4)+l:v(e,"expected hexadecimal character");e.result+=Al(o),e.position++}else v(e,"unknown escape sequence");i=r=e.position}else D(a)?(z(e,i,r,!0),ri(e,k(e,!1,n)),i=r=e.position):e.position===e.lineStart&&vn(e)?v(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}v(e,"unexpected end of the stream within a double quoted scalar")}function Tl(e,n){var i=!0,r,t,o,l=e.tag,a,u=e.anchor,s,h,c,d,p,m=Object.create(null),b,x,g,_;if(_=e.input.charCodeAt(e.position),_===91)h=93,p=!1,a=[];else if(_===123)h=125,p=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),_=e.input.charCodeAt(++e.position);_!==0;){if(k(e,!0,n),_=e.input.charCodeAt(e.position),_===h)return e.position++,e.tag=l,e.anchor=u,e.kind=p?"mapping":"sequence",e.result=a,!0;i?_===44&&v(e,"expected the node content, but found ','"):v(e,"missed comma between flow collection entries"),x=b=g=null,c=d=!1,_===63&&(s=e.input.charCodeAt(e.position+1),$(s)&&(c=d=!0,e.position++,k(e,!0,n))),r=e.line,t=e.lineStart,o=e.position,de(e,n,nn,!1,!0),x=e.tag,b=e.result,k(e,!0,n),_=e.input.charCodeAt(e.position),(d||e.line===r)&&_===58&&(c=!0,_=e.input.charCodeAt(++e.position),k(e,!0,n),de(e,n,nn,!1,!0),g=e.result),p?ae(e,a,m,x,b,g,r,t,o):c?a.push(ae(e,null,m,x,b,g,r,t,o)):a.push(b),k(e,!0,n),_=e.input.charCodeAt(e.position),_===44?(i=!0,_=e.input.charCodeAt(++e.position)):i=!1}v(e,"unexpected end of the stream within a flow collection")}function Nl(e,n){var i,r,t=kn,o=!1,l=!1,a=n,u=0,s=!1,h,c;if(c=e.input.charCodeAt(e.position),c===124)r=!1;else if(c===62)r=!0;else return!1;for(e.kind="scalar",e.result="";c!==0;)if(c=e.input.charCodeAt(++e.position),c===43||c===45)kn===t?t=c===43?Ni:vl:v(e,"repeat of a chomping mode identifier");else if((h=wl(c))>=0)h===0?v(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?v(e,"repeat of an indentation width identifier"):(a=n+h-1,l=!0);else break;if(Q(c)){do c=e.input.charCodeAt(++e.position);while(Q(c));if(c===35)do c=e.input.charCodeAt(++e.position);while(!D(c)&&c!==0)}for(;c!==0;){for(ii(e),e.lineIndent=0,c=e.input.charCodeAt(e.position);(!l||e.lineIndent<a)&&c===32;)e.lineIndent++,c=e.input.charCodeAt(++e.position);if(!l&&e.lineIndent>a&&(a=e.lineIndent),D(c)){u++;continue}if(e.lineIndent<a){t===Ni?e.result+=E.repeat(`
13
- `,o?1+u:u):t===kn&&o&&(e.result+=`
14
- `);break}for(r?Q(c)?(s=!0,e.result+=E.repeat(`
15
- `,o?1+u:u)):s?(s=!1,e.result+=E.repeat(`
16
- `,u+1)):u===0?o&&(e.result+=" "):e.result+=E.repeat(`
17
- `,u):e.result+=E.repeat(`
18
- `,o?1+u:u),o=!0,l=!0,u=0,i=e.position;!D(c)&&c!==0;)c=e.input.charCodeAt(++e.position);z(e,i,e.position,!1)}return!0}function $i(e,n){var i,r=e.tag,t=e.anchor,o=[],l,a=!1,u;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=o),u=e.input.charCodeAt(e.position);u!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,v(e,"tab characters must not be used in indentation")),!(u!==45||(l=e.input.charCodeAt(e.position+1),!$(l))));){if(a=!0,e.position++,k(e,!0,-1)&&e.lineIndent<=n){o.push(null),u=e.input.charCodeAt(e.position);continue}if(i=e.line,de(e,n,zr,!1,!0),o.push(e.result),k(e,!0,-1),u=e.input.charCodeAt(e.position),(e.line===i||e.lineIndent>n)&&u!==0)v(e,"bad indentation of a sequence entry");else if(e.lineIndent<n)break}return a?(e.tag=r,e.anchor=t,e.kind="sequence",e.result=o,!0):!1}function Ol(e,n,i){var r,t,o,l,a,u,s=e.tag,h=e.anchor,c={},d=Object.create(null),p=null,m=null,b=null,x=!1,g=!1,_;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=c),_=e.input.charCodeAt(e.position);_!==0;){if(!x&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,v(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),o=e.line,(_===63||_===58)&&$(r))_===63?(x&&(ae(e,c,d,p,m,null,l,a,u),p=m=b=null),g=!0,x=!0,t=!0):x?(x=!1,t=!0):v(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,_=r;else{if(l=e.line,a=e.lineStart,u=e.position,!de(e,i,Wr,!1,!0))break;if(e.line===o){for(_=e.input.charCodeAt(e.position);Q(_);)_=e.input.charCodeAt(++e.position);if(_===58)_=e.input.charCodeAt(++e.position),$(_)||v(e,"a whitespace character is expected after the key-value separator within a block mapping"),x&&(ae(e,c,d,p,m,null,l,a,u),p=m=b=null),g=!0,x=!1,t=!1,p=e.tag,m=e.result;else if(g)v(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=s,e.anchor=h,!0}else if(g)v(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=s,e.anchor=h,!0}if((e.line===o||e.lineIndent>n)&&(x&&(l=e.line,a=e.lineStart,u=e.position),de(e,n,rn,!0,t)&&(x?m=e.result:b=e.result),x||(ae(e,c,d,p,m,b,l,a,u),p=m=b=null),k(e,!0,-1),_=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>n)&&_!==0)v(e,"bad indentation of a mapping entry");else if(e.lineIndent<n)break}return x&&ae(e,c,d,p,m,null,l,a,u),g&&(e.tag=s,e.anchor=h,e.kind="mapping",e.result=c),g}function Fl(e){var n,i=!1,r=!1,t,o,l;if(l=e.input.charCodeAt(e.position),l!==33)return!1;if(e.tag!==null&&v(e,"duplication of a tag property"),l=e.input.charCodeAt(++e.position),l===60?(i=!0,l=e.input.charCodeAt(++e.position)):l===33?(r=!0,t="!!",l=e.input.charCodeAt(++e.position)):t="!",n=e.position,i){do l=e.input.charCodeAt(++e.position);while(l!==0&&l!==62);e.position<e.length?(o=e.input.slice(n,e.position),l=e.input.charCodeAt(++e.position)):v(e,"unexpected end of the stream within a verbatim tag")}else{for(;l!==0&&!$(l);)l===33&&(r?v(e,"tag suffix cannot contain exclamation marks"):(t=e.input.slice(n-1,e.position+1),qr.test(t)||v(e,"named tag handle cannot contain such characters"),r=!0,n=e.position+1)),l=e.input.charCodeAt(++e.position);o=e.input.slice(n,e.position),yl.test(o)&&v(e,"tag suffix cannot contain flow indicator characters")}o&&!Kr.test(o)&&v(e,"tag name cannot contain such characters: "+o);try{o=decodeURIComponent(o)}catch{v(e,"tag name is malformed: "+o)}return i?e.tag=o:q.call(e.tagMap,t)?e.tag=e.tagMap[t]+o:t==="!"?e.tag="!"+o:t==="!!"?e.tag="tag:yaml.org,2002:"+o:v(e,'undeclared tag handle "'+t+'"'),!0}function Il(e){var n,i;if(i=e.input.charCodeAt(e.position),i!==38)return!1;for(e.anchor!==null&&v(e,"duplication of an anchor property"),i=e.input.charCodeAt(++e.position),n=e.position;i!==0&&!$(i)&&!le(i);)i=e.input.charCodeAt(++e.position);return e.position===n&&v(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(n,e.position),!0}function Ll(e){var n,i,r;if(r=e.input.charCodeAt(e.position),r!==42)return!1;for(r=e.input.charCodeAt(++e.position),n=e.position;r!==0&&!$(r)&&!le(r);)r=e.input.charCodeAt(++e.position);return e.position===n&&v(e,"name of an alias node must contain at least one character"),i=e.input.slice(n,e.position),q.call(e.anchorMap,i)||v(e,'unidentified alias "'+i+'"'),e.result=e.anchorMap[i],k(e,!0,-1),!0}function de(e,n,i,r,t){var o,l,a,u=1,s=!1,h=!1,c,d,p,m,b,x;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,o=l=a=rn===i||zr===i,r&&k(e,!0,-1)&&(s=!0,e.lineIndent>n?u=1:e.lineIndent===n?u=0:e.lineIndent<n&&(u=-1)),u===1)for(;Fl(e)||Il(e);)k(e,!0,-1)?(s=!0,a=o,e.lineIndent>n?u=1:e.lineIndent===n?u=0:e.lineIndent<n&&(u=-1)):a=!1;if(a&&(a=s||t),(u===1||rn===i)&&(nn===i||Wr===i?b=n:b=n+1,x=e.position-e.lineStart,u===1?a&&($i(e,x)||Ol(e,x,b))||Tl(e,b)?h=!0:(l&&Nl(e,b)||kl(e,b)||El(e,b)?h=!0:Ll(e)?(h=!0,(e.tag!==null||e.anchor!==null)&&v(e,"alias node should not have any properties")):Cl(e,b,nn===i)&&(h=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):u===0&&(h=a&&$i(e,x))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&v(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),c=0,d=e.implicitTypes.length;c<d;c+=1)if(m=e.implicitTypes[c],m.resolve(e.result)){e.result=m.construct(e.result),e.tag=m.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(q.call(e.typeMap[e.kind||"fallback"],e.tag))m=e.typeMap[e.kind||"fallback"][e.tag];else for(m=null,p=e.typeMap.multi[e.kind||"fallback"],c=0,d=p.length;c<d;c+=1)if(e.tag.slice(0,p[c].tag.length)===p[c].tag){m=p[c];break}m||v(e,"unknown tag !<"+e.tag+">"),e.result!==null&&m.kind!==e.kind&&v(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+m.kind+'", not "'+e.kind+'"'),m.resolve(e.result,e.tag)?(e.result=m.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):v(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||h}function $l(e){var n=e.position,i,r,t,o=!1,l;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(l=e.input.charCodeAt(e.position))!==0&&(k(e,!0,-1),l=e.input.charCodeAt(e.position),!(e.lineIndent>0||l!==37));){for(o=!0,l=e.input.charCodeAt(++e.position),i=e.position;l!==0&&!$(l);)l=e.input.charCodeAt(++e.position);for(r=e.input.slice(i,e.position),t=[],r.length<1&&v(e,"directive name must not be less than one character in length");l!==0;){for(;Q(l);)l=e.input.charCodeAt(++e.position);if(l===35){do l=e.input.charCodeAt(++e.position);while(l!==0&&!D(l));break}if(D(l))break;for(i=e.position;l!==0&&!$(l);)l=e.input.charCodeAt(++e.position);t.push(e.input.slice(i,e.position))}l!==0&&ii(e),q.call(Ii,r)?Ii[r](e,r,t):tn(e,'unknown document directive "'+r+'"')}if(k(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,k(e,!0,-1)):o&&v(e,"directives end mark is expected"),de(e,e.lineIndent-1,rn,!1,!0),k(e,!0,-1),e.checkLineBreaks&&gl.test(e.input.slice(n,e.position))&&tn(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&vn(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,k(e,!0,-1));return}if(e.position<e.length-1)v(e,"end of the stream or a document separator is expected");else return}function Zr(e,n){e=String(e),n=n||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
19
- `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var i=new Sl(e,n),r=e.indexOf("\0");for(r!==-1&&(i.position=r,v(i,"null byte is not allowed in input")),i.input+="\0";i.input.charCodeAt(i.position)===32;)i.lineIndent+=1,i.position+=1;for(;i.position<i.length-1;)$l(i);return i.documents}function Ml(e,n,i){n!==null&&typeof n=="object"&&typeof i>"u"&&(i=n,n=null);var r=Zr(e,i);if(typeof n!="function")return r;for(var t=0,o=r.length;t<o;t+=1)n(r[t])}function Rl(e,n){var i=Zr(e,n);if(i.length!==0){if(i.length===1)return i[0];throw new F("expected a single document in the stream, but found more")}}var Pl=Ml,Dl=Rl,Xr={loadAll:Pl,load:Dl},et=Object.prototype.toString,nt=Object.prototype.hasOwnProperty,ti=65279,Ul=9,Ne=10,jl=13,Hl=32,Bl=33,Yl=34,Pn=35,Wl=37,zl=38,ql=39,Kl=42,it=44,Gl=45,on=58,Vl=61,Jl=62,Ql=63,Zl=64,rt=91,tt=93,Xl=96,ot=123,ea=124,lt=125,O={};O[0]="\\0";O[7]="\\a";O[8]="\\b";O[9]="\\t";O[10]="\\n";O[11]="\\v";O[12]="\\f";O[13]="\\r";O[27]="\\e";O[34]='\\"';O[92]="\\\\";O[133]="\\N";O[160]="\\_";O[8232]="\\L";O[8233]="\\P";var na=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],ia=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function ra(e,n){var i,r,t,o,l,a,u;if(n===null)return{};for(i={},r=Object.keys(n),t=0,o=r.length;t<o;t+=1)l=r[t],a=String(n[l]),l.slice(0,2)==="!!"&&(l="tag:yaml.org,2002:"+l.slice(2)),u=e.compiledTypeMap.fallback[l],u&&nt.call(u.styleAliases,a)&&(a=u.styleAliases[a]),i[l]=a;return i}function ta(e){var n,i,r;if(n=e.toString(16).toUpperCase(),e<=255)i="x",r=2;else if(e<=65535)i="u",r=4;else if(e<=4294967295)i="U",r=8;else throw new F("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+i+E.repeat("0",r-n.length)+n}var oa=1,Oe=2;function la(e){this.schema=e.schema||ni,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=E.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=ra(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?Oe:oa,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Mi(e,n){for(var i=E.repeat(" ",n),r=0,t=-1,o="",l,a=e.length;r<a;)t=e.indexOf(`
20
- `,r),t===-1?(l=e.slice(r),r=a):(l=e.slice(r,t+1),r=t+1),l.length&&l!==`
21
- `&&(o+=i),o+=l;return o}function Dn(e,n){return`
22
- `+E.repeat(" ",e.indent*n)}function aa(e,n){var i,r,t;for(i=0,r=e.implicitTypes.length;i<r;i+=1)if(t=e.implicitTypes[i],t.resolve(n))return!0;return!1}function ln(e){return e===Hl||e===Ul}function Fe(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==ti||65536<=e&&e<=1114111}function Ri(e){return Fe(e)&&e!==ti&&e!==jl&&e!==Ne}function Pi(e,n,i){var r=Ri(e),t=r&&!ln(e);return(i?r:r&&e!==it&&e!==rt&&e!==tt&&e!==ot&&e!==lt)&&e!==Pn&&!(n===on&&!t)||Ri(n)&&!ln(n)&&e===Pn||n===on&&t}function ua(e){return Fe(e)&&e!==ti&&!ln(e)&&e!==Gl&&e!==Ql&&e!==on&&e!==it&&e!==rt&&e!==tt&&e!==ot&&e!==lt&&e!==Pn&&e!==zl&&e!==Kl&&e!==Bl&&e!==ea&&e!==Vl&&e!==Jl&&e!==ql&&e!==Yl&&e!==Wl&&e!==Zl&&e!==Xl}function ca(e){return!ln(e)&&e!==on}function ge(e,n){var i=e.charCodeAt(n),r;return i>=55296&&i<=56319&&n+1<e.length&&(r=e.charCodeAt(n+1),r>=56320&&r<=57343)?(i-55296)*1024+r-56320+65536:i}function at(e){var n=/^\n* /;return n.test(e)}var ut=1,Un=2,ct=3,st=4,oe=5;function sa(e,n,i,r,t,o,l,a){var u,s=0,h=null,c=!1,d=!1,p=r!==-1,m=-1,b=ua(ge(e,0))&&ca(ge(e,e.length-1));if(n||l)for(u=0;u<e.length;s>=65536?u+=2:u++){if(s=ge(e,u),!Fe(s))return oe;b=b&&Pi(s,h,a),h=s}else{for(u=0;u<e.length;s>=65536?u+=2:u++){if(s=ge(e,u),s===Ne)c=!0,p&&(d=d||u-m-1>r&&e[m+1]!==" ",m=u);else if(!Fe(s))return oe;b=b&&Pi(s,h,a),h=s}d=d||p&&u-m-1>r&&e[m+1]!==" "}return!c&&!d?b&&!l&&!t(e)?ut:o===Oe?oe:Un:i>9&&at(e)?oe:l?o===Oe?oe:Un:d?st:ct}function fa(e,n,i,r,t){e.dump=function(){if(n.length===0)return e.quotingType===Oe?'""':"''";if(!e.noCompatMode&&(na.indexOf(n)!==-1||ia.test(n)))return e.quotingType===Oe?'"'+n+'"':"'"+n+"'";var o=e.indent*Math.max(1,i),l=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-o),a=r||e.flowLevel>-1&&i>=e.flowLevel;function u(s){return aa(e,s)}switch(sa(n,a,e.indent,l,u,e.quotingType,e.forceQuotes&&!r,t)){case ut:return n;case Un:return"'"+n.replace(/'/g,"''")+"'";case ct:return"|"+Di(n,e.indent)+Ui(Mi(n,o));case st:return">"+Di(n,e.indent)+Ui(Mi(da(n,l),o));case oe:return'"'+pa(n)+'"';default:throw new F("impossible error: invalid scalar style")}}()}function Di(e,n){var i=at(e)?String(n):"",r=e[e.length-1]===`
23
- `,t=r&&(e[e.length-2]===`
24
- `||e===`
25
- `),o=t?"+":r?"":"-";return i+o+`
26
- `}function Ui(e){return e[e.length-1]===`
27
- `?e.slice(0,-1):e}function da(e,n){for(var i=/(\n+)([^\n]*)/g,r=function(){var s=e.indexOf(`
28
- `);return s=s!==-1?s:e.length,i.lastIndex=s,ji(e.slice(0,s),n)}(),t=e[0]===`
29
- `||e[0]===" ",o,l;l=i.exec(e);){var a=l[1],u=l[2];o=u[0]===" ",r+=a+(!t&&!o&&u!==""?`
30
- `:"")+ji(u,n),t=o}return r}function ji(e,n){if(e===""||e[0]===" ")return e;for(var i=/ [^ ]/g,r,t=0,o,l=0,a=0,u="";r=i.exec(e);)a=r.index,a-t>n&&(o=l>t?l:a,u+=`
31
- `+e.slice(t,o),t=o+1),l=a;return u+=`
32
- `,e.length-t>n&&l>t?u+=e.slice(t,l)+`
33
- `+e.slice(l+1):u+=e.slice(t),u.slice(1)}function pa(e){for(var n="",i=0,r,t=0;t<e.length;i>=65536?t+=2:t++)i=ge(e,t),r=O[i],!r&&Fe(i)?(n+=e[t],i>=65536&&(n+=e[t+1])):n+=r||ta(i);return n}function ha(e,n,i){var r="",t=e.tag,o,l,a;for(o=0,l=i.length;o<l;o+=1)a=i[o],e.replacer&&(a=e.replacer.call(i,String(o),a)),(Y(e,n,a,!1,!1)||typeof a>"u"&&Y(e,n,null,!1,!1))&&(r!==""&&(r+=","+(e.condenseFlow?"":" ")),r+=e.dump);e.tag=t,e.dump="["+r+"]"}function Hi(e,n,i,r){var t="",o=e.tag,l,a,u;for(l=0,a=i.length;l<a;l+=1)u=i[l],e.replacer&&(u=e.replacer.call(i,String(l),u)),(Y(e,n+1,u,!0,!0,!1,!0)||typeof u>"u"&&Y(e,n+1,null,!0,!0,!1,!0))&&((!r||t!=="")&&(t+=Dn(e,n)),e.dump&&Ne===e.dump.charCodeAt(0)?t+="-":t+="- ",t+=e.dump);e.tag=o,e.dump=t||"[]"}function _a(e,n,i){var r="",t=e.tag,o=Object.keys(i),l,a,u,s,h;for(l=0,a=o.length;l<a;l+=1)h="",r!==""&&(h+=", "),e.condenseFlow&&(h+='"'),u=o[l],s=i[u],e.replacer&&(s=e.replacer.call(i,u,s)),Y(e,n,u,!1,!1)&&(e.dump.length>1024&&(h+="? "),h+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Y(e,n,s,!1,!1)&&(h+=e.dump,r+=h));e.tag=t,e.dump="{"+r+"}"}function va(e,n,i,r){var t="",o=e.tag,l=Object.keys(i),a,u,s,h,c,d;if(e.sortKeys===!0)l.sort();else if(typeof e.sortKeys=="function")l.sort(e.sortKeys);else if(e.sortKeys)throw new F("sortKeys must be a boolean or a function");for(a=0,u=l.length;a<u;a+=1)d="",(!r||t!=="")&&(d+=Dn(e,n)),s=l[a],h=i[s],e.replacer&&(h=e.replacer.call(i,s,h)),Y(e,n+1,s,!0,!0,!0)&&(c=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,c&&(e.dump&&Ne===e.dump.charCodeAt(0)?d+="?":d+="? "),d+=e.dump,c&&(d+=Dn(e,n)),Y(e,n+1,h,!0,c)&&(e.dump&&Ne===e.dump.charCodeAt(0)?d+=":":d+=": ",d+=e.dump,t+=d));e.tag=o,e.dump=t||"{}"}function Bi(e,n,i){var r,t,o,l,a,u;for(t=i?e.explicitTypes:e.implicitTypes,o=0,l=t.length;o<l;o+=1)if(a=t[o],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof n=="object"&&n instanceof a.instanceOf)&&(!a.predicate||a.predicate(n))){if(i?a.multi&&a.representName?e.tag=a.representName(n):e.tag=a.tag:e.tag="?",a.represent){if(u=e.styleMap[a.tag]||a.defaultStyle,et.call(a.represent)==="[object Function]")r=a.represent(n,u);else if(nt.call(a.represent,u))r=a.represent[u](n,u);else throw new F("!<"+a.tag+'> tag resolver accepts not "'+u+'" style');e.dump=r}return!0}return!1}function Y(e,n,i,r,t,o,l){e.tag=null,e.dump=i,Bi(e,i,!1)||Bi(e,i,!0);var a=et.call(e.dump),u=r,s;r&&(r=e.flowLevel<0||e.flowLevel>n);var h=a==="[object Object]"||a==="[object Array]",c,d;if(h&&(c=e.duplicates.indexOf(i),d=c!==-1),(e.tag!==null&&e.tag!=="?"||d||e.indent!==2&&n>0)&&(t=!1),d&&e.usedDuplicates[c])e.dump="*ref_"+c;else{if(h&&d&&!e.usedDuplicates[c]&&(e.usedDuplicates[c]=!0),a==="[object Object]")r&&Object.keys(e.dump).length!==0?(va(e,n,e.dump,t),d&&(e.dump="&ref_"+c+e.dump)):(_a(e,n,e.dump),d&&(e.dump="&ref_"+c+" "+e.dump));else if(a==="[object Array]")r&&e.dump.length!==0?(e.noArrayIndent&&!l&&n>0?Hi(e,n-1,e.dump,t):Hi(e,n,e.dump,t),d&&(e.dump="&ref_"+c+e.dump)):(ha(e,n,e.dump),d&&(e.dump="&ref_"+c+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&fa(e,e.dump,n,o,u);else{if(a==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new F("unacceptable kind of an object to dump "+a)}e.tag!==null&&e.tag!=="?"&&(s=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?s="!"+s:s.slice(0,18)==="tag:yaml.org,2002:"?s="!!"+s.slice(18):s="!<"+s+">",e.dump=s+" "+e.dump)}return!0}function ma(e,n){var i=[],r=[],t,o;for(jn(e,i,r),t=0,o=r.length;t<o;t+=1)n.duplicates.push(i[r[t]]);n.usedDuplicates=new Array(o)}function jn(e,n,i){var r,t,o;if(e!==null&&typeof e=="object")if(t=n.indexOf(e),t!==-1)i.indexOf(t)===-1&&i.push(t);else if(n.push(e),Array.isArray(e))for(t=0,o=e.length;t<o;t+=1)jn(e[t],n,i);else for(r=Object.keys(e),t=0,o=r.length;t<o;t+=1)jn(e[r[t]],n,i)}function ga(e,n){n=n||{};var i=new la(n);i.noRefs||ma(e,i);var r=e;return i.replacer&&(r=i.replacer.call({"":r},"",r)),Y(i,0,r,!0,!0)?i.dump+`
34
- `:""}var ya=ga,ba={dump:ya};function oi(e,n){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+n+" instead, which is now safe by default.")}}var xa=T,wa=Cr,Aa=Nr,Sa=$r,Ca=Mr,ka=ni,Ea=Xr.load,Ta=Xr.loadAll,Na=ba.dump,Oa=F,Fa={binary:jr,float:Lr,map:Tr,null:Or,pairs:Br,set:Yr,timestamp:Dr,bool:Fr,int:Ir,merge:Ur,omap:Hr,seq:Er,str:kr},Ia=oi("safeLoad","load"),La=oi("safeLoadAll","loadAll"),$a=oi("safeDump","dump"),Ma={Type:xa,Schema:wa,FAILSAFE_SCHEMA:Aa,JSON_SCHEMA:Sa,CORE_SCHEMA:Ca,DEFAULT_SCHEMA:ka,load:Ea,loadAll:Ta,dump:Na,YAMLException:Oa,types:Fa,safeLoad:Ia,safeLoadAll:La,safeDump:$a};function ft(e){if(e.trim()==="")return{};const i=Ma.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 dt=y(!1),an=y(null),ue=y(_n()),Hn=y(!1),Be=y(null),H=y(null),un=y(!1),Bn=y({});async function Yi(){an.value=null;try{const e=await I("/api/v1/user-md");if(Hn.value=e.exists,Be.value=e.lastModified,e.exists&&e.identity!==null)ue.value=en(e.identity),H.value=null;else try{const n=await I("/api/v1/user-md/template");ue.value=en(ft(n.body)),H.value="File does not exist yet — loaded shipped template. Save to create it."}catch{ue.value=_n(),H.value="File does not exist yet — fill the form and save."}dt.value=!0}catch(e){an.value=e instanceof Error?e.message:String(e)}}async function Ra(){un.value=!0,H.value=null,Bn.value={};try{const e={};Hn.value&&Be.value!==null&&(e["If-Unmodified-Since"]=String(Be.value));const n=await I("/api/v1/user-md",{method:"PUT",headers:e,body:{identity:ue.value}});Be.value=n.lastModified,Hn.value=!0,H.value=`Saved (${n.writtenPaths.join(", ")}).`}catch(e){if(e instanceof G){const n=e.body.error??{code:"UNKNOWN",message:e.message};Bn.value=$e(n),H.value=ve(n)}else H.value=e instanceof Error?e.message:String(e)}finally{un.value=!1}}function Pa(){return pn(()=>{Yi()},[]),dt.value?f("div",{class:"ac-page",children:[f("header",{class:"ac-page__header",children:[f("h1",{children:".agent-user.yml"}),f("nav",{class:"ac-page__nav",children:f("a",{href:"#/settings",children:"← Back to Settings"})})]}),H.value!==null?f("p",{class:"ac-banner",children:H.value}):null,f(wr,{value:ue.value,errors:Bn.value,onChange:e=>{ue.value=e}}),f("div",{class:"ac-form__actions",children:[f("button",{type:"button",class:"ac-button",onClick:()=>{Yi()},children:"Reload"}),f("button",{type:"button",class:"ac-button ac-button--primary",disabled:un.value,onClick:()=>{Ra()},children:un.value?"Saving…":"Save"})]})]}):f("div",{class:"ac-page",children:[f("h1",{children:".agent-user.yml"}),an.value!==null?f("p",{class:"ac-banner ac-banner--error",children:an.value}):f("p",{children:"Loading…"})]})}const Ie=y(null);async function Da(){try{const e=await I("/api/v1/ping");Ie.value={...e,projectScopeAvailable:e.projectScopeAvailable===!0}}catch{Ie.value=null}}const Ua=[{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:"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"}],Yn=[{id:"identity",title:"Editor and tooling",navLabel:"Editor",subtitle:"IDE and rtk go into .agent-settings.yml so the agent opens files in the right tool. Your name lives in .agent-user.yml (later step).",kind:"form",paths:["personal.ide","personal.open_edited_files","personal.rtk_installed"]},{id:"personality",title:"How should the agent behave?",navLabel:"Personality",subtitle:"Autonomy, output verbosity, and PR-comment style.",kind:"form",paths:["personal.autonomy","personal.minimal_output","personal.play_by_play","personal.pr_comment_bot_icon"]},{id:"cost",title:"Cost profile and budgets",navLabel:"Cost",subtitle:"Master switch for which rule tiers load, plus optional spending ceilings.",kind:"form",paths:["cost_profile","cost.budgets.daily","cost.budgets.weekly","cost.budgets.monthly","cost.enforcement"]},{id:"roadmap-quality",title:"Roadmap & quality cadence",navLabel:"Roadmap & quality",subtitle:"When the agent runs quality tools and refreshes roadmap dashboards.",kind:"form",paths:["roadmap.quality_cadence","roadmap.dashboard_regen_cadence","quality.local_auto_run","quality.wait_for_remote_ci"]},{id:"memory",title:"Memory & redaction",navLabel:"Memory",subtitle:"Inline-review threshold and transcript-redaction regexes.",kind:"form",paths:["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"}],ja=Yn;ja.length;function pt(e={}){return e.extended===!0?[...Ua,...Yn]:Yn}function mn(e,n={}){const i=pt(n),r=Math.max(0,Math.min(i.length-1,e));return i[r]}function Ha(e,n){const i={type:"object",properties:{},...e.description!==void 0?{description:e.description}:{}},r=i.properties,t=e.properties??{};for(const o of n){const l=o.split(".").filter(R=>R.length>0);if(l.length===0)continue;const[a,u,s]=l;if(a===void 0)continue;const h=t[a];if(h===void 0)continue;if(u===void 0){r[a]=h;continue}const c=h.properties?.[u];if(c===void 0)continue;const p=r[a]??{type:"object",properties:{},...h.description!==void 0?{description:h.description}:{}},m=p.properties??={};if(s===void 0){m[u]=c,r[a]=p;continue}const b=c.properties?.[s];if(b===void 0)continue;const g=m[u]??{type:"object",properties:{},...c.description!==void 0?{description:c.description}:{}},_=g.properties??={};_[s]=b,m[u]=g,r[a]=p}return i}function Ba({current:e,total:n}){const i=Math.max(1,n),r=Math.max(0,Math.min(i-1,e)),t=Array.from({length:i},(l,a)=>a<=r),o=Math.round((r+1)/i*100);return f("div",{class:"ac-wizard__progress",role:"progressbar","aria-valuenow":r+1,"aria-valuemin":1,"aria-valuemax":i,"aria-valuetext":`Step ${r+1} of ${i} (${o}%)`,children:t.map((l,a)=>f("span",{class:`ac-wizard__progress-segment${l?" ac-wizard__progress-segment--filled":""}`,"aria-hidden":"true"},a))})}function Ya({step:e,index:n,total:i}){return f("header",{class:"ac-page__header ac-wizard__header",children:[f("p",{class:"ac-wizard__step-count",children:["Step ",n+1," of ",i]}),f("div",{class:"ac-wizard__header-text",children:[f("h1",{children:e.title}),f("p",{class:"ac-wizard__subtitle",children:e.subtitle})]}),f(Ba,{current:n,total:i})]})}function Wa(e){const n=e.canFinish??!0,i=e.completed??!1;return f("div",{class:"ac-form__actions ac-wizard__nav",children:[f("button",{type:"button",class:"ac-button",disabled:!e.canGoPrev||e.busy,onClick:e.onPrev,children:"Back"}),e.canSkip&&e.onSkip!==void 0?f("button",{type:"button",class:"ac-button ac-wizard__skip",disabled:e.busy,onClick:e.onSkip,children:"Skip"}):null,e.isLast?i?null:f("button",{type:"button",class:"ac-button ac-button--primary",disabled:e.busy||!n,onClick:e.onFinish,children:e.busy?"Saving…":"Finish & save"}):f("button",{type:"button",class:"ac-button ac-button--primary",disabled:!e.canGoNext||e.busy,onClick:e.onNext,children:e.nextLabel??"Next"})]})}function ht(e,n){return e.kind!=="form"||e.paths===void 0?!1:!!(e.paths.includes(n)||e.id==="cost"&&(n.startsWith("caveman.")||n.startsWith("verbosity.")))}function za(e,n){return e.kind==="userMd"?n==="body"||n.startsWith("body."):ht(e,n)}function qa(e,n){for(const i of Object.keys(n.errors))if(za(e,i))return!0;return!1}function Ka(e,n){if(qa(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(r=>ht(e,r.path)).length;return i===0?{label:"",tone:"idle"}:{label:`${i} change${i===1?"":"s"}`,tone:"changed"}}return{label:"",tone:"idle"}}function Ga(e){const n=e.steps.filter((i,r)=>r!==e.currentIndex);return f(K,{children:[f("nav",{class:"ac-wizard__review-nav","aria-label":"Jump back to a step",children:[f("p",{class:"ac-wizard__review-nav-label",children:"Jump back to a step:"}),f("ul",{class:"ac-wizard__review-nav-list",children:n.map(i=>{const r=e.steps.indexOf(i),t=Ka(i,e),o=t.tone==="error"?"ac-wizard__review-nav-button ac-wizard__review-nav-button--error":"ac-wizard__review-nav-button";return f("li",{children:f("button",{type:"button",class:o,onClick:()=>{e.onJump(r)},children:[f("span",{class:"ac-wizard__review-nav-index",children:r+1}),f("span",{class:"ac-wizard__review-nav-text",children:i.navLabel}),t.label!==""?f("span",{class:`ac-wizard__review-nav-status ac-wizard__review-nav-status--${t.tone}`,children:t.label}):null]})},i.id)})})]}),e.scopeAvailable?f("fieldset",{class:"ac-wizard__scope",children:[f("legend",{class:"ac-wizard__scope-legend",children:"Where should these settings be written?"}),f("label",{class:"ac-wizard__scope-option",children:[f("input",{type:"radio",name:"ac-wizard-scope",value:"global",checked:e.scope==="global",onChange:()=>{e.onScopeChange("global")}}),f("span",{class:"ac-wizard__scope-option-text",children:[f("strong",{children:"Global"})," — write to ",f("code",{children:"~/.event4u/agent-config/"})," so every project picks them up."]})]}),f("label",{class:"ac-wizard__scope-option",children:[f("input",{type:"radio",name:"ac-wizard-scope",value:"project",checked:e.scope==="project",onChange:()=>{e.onScopeChange("project")}}),f("span",{class:"ac-wizard__scope-option-text",children:[f("strong",{children:"This project only"})," — write to ",f("code",{children:"settings/"})," under the current repo (overrides the global layer)."]})]})]}):null]})}const _t=y(!1),Ae=y(null),L=y(null),Wn=y(!1),cn=y(!1),X=y(0),li=y(null),ee=y({}),vt=y({}),mt=y(0),ce=y({}),M=y(null),Z=y(null),gt=y(!1),zn=y(!1),ai=y(!1),yt=y({}),gn=y([]),qn=y("global"),ui=y(!1),pe=y(!1);function bt(){return pt({extended:pe.value})}function yn(){return bt().length}function Va(e){return e??new Date().toISOString()}function ci(e){return Math.max(0,Math.min(yn()-1,e))}function Ja(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 Qa(){try{return await I("/api/v1/settings")}catch(e){if(e instanceof G&&e.status===404&&e.body.error?.code==="NOT_FOUND"){const n=await I("/api/v1/schema");return{values:{},lastModified:0,path:".agent-settings.yml",schema:n.settings}}throw e}}async function Za(){Ae.value=null;try{const[e,n]=await Promise.all([I("/api/v1/wizard/state"),Qa()]);li.value=Ja(n.schema),mt.value=n.lastModified,vt.value=n.values,yt.value=n.legacyHints??{},pe.value=e.extendedSteps===!0;const i=Object.keys(e.partial??{});ee.value=i.length>0?{...n.values,...e.partial}:n.values,X.value=ci(e.step),ui.value=!1,_t.value=!0;const r=mn(X.value,{extended:pe.value});(r.kind==="userMd"||r.kind==="review")&&xt(),r.kind==="review"&&wt()}catch(e){e instanceof G?Ae.value=ve(e.body.error??{code:"UNKNOWN",message:e.message}):Ae.value=e instanceof Error?e.message:String(e)}}function Xa(e,n){return e.identity.name.trim()!==""?e:{...e,identity:{...e.identity,name:n}}}async function xt(){if(!zn.value)try{const e=await I("/api/v1/user-md");if(gt.value=e.exists,e.exists&&e.identity!==null){const n=en(e.identity);Z.value=n,M.value=n}else{let n;try{const r=await I("/api/v1/user-md/template");n=en(ft(r.body))}catch{n=_n()}const i=yt.value.user_name;typeof i=="string"&&i.trim()!==""&&(n=Xa(n,i)),Z.value=n,M.value=n}}catch(e){L.value={message:e instanceof Error?e.message:String(e),tone:"error"}}finally{zn.value=!0}}async function eu(e,n){try{await I("/api/v1/wizard/state",{method:"POST",body:{step:e,totalSteps:yn(),partial:n,startedAt:Va(null)}})}catch(i){L.value={message:i instanceof Error?i.message:String(i),tone:"error"}}}async function wt(){cn.value=!0;try{const e=await I("/api/v1/settings/diff",{method:"POST",body:{values:ee.value,ifUnmodifiedSince:mt.value}});gn.value=e.changes,ce.value={}}catch(e){e instanceof G?(ce.value=$e(e.body.error??{message:e.message}),L.value={message:ve(e.body.error??{code:"UNKNOWN",message:e.message}),tone:"error"}):L.value={message:e instanceof Error?e.message:String(e),tone:"error"}}finally{cn.value=!1}}function sn(){return ai.value?!1:M.value===null||Z.value===null?M.value!==Z.value:JSON.stringify(M.value)!==JSON.stringify(Z.value)}async function Ye(e){const n=ci(e);await eu(n,ee.value),X.value=n,L.value=null;const i=mn(n,{extended:pe.value});i.kind==="userMd"&&xt(),i.kind==="review"&&wt()}async function nu(){Wn.value=!0,L.value=null;try{const e={settings:ee.value};sn()&&M.value!==null&&(e.identity=M.value),Ie.value?.projectScopeAvailable===!0&&(e.scope=qn.value);const n=await I("/api/v1/wizard/finish",{method:"POST",body:e}),i="You can close this browser window now.";n.dryRun===!0?L.value={message:`Dry-run complete — no files written. Settings would be saved. ${i}`,tone:"success"}:Array.isArray(n.writtenPaths)?L.value={message:`Saved (${n.writtenPaths.join(", ")}). Wizard complete. ${i}`,tone:"success"}:L.value={message:`Wizard complete. ${i}`,tone:"success"},X.value=ci(yn()-1),vt.value=ee.value,Z.value=sn()?M.value:Z.value,gn.value=[],ui.value=!0}catch(e){e instanceof G?(ce.value=$e(e.body.error??{message:e.message}),L.value={message:ve(e.body.error??{code:"UNKNOWN",message:e.message}),tone:"error"}):L.value={message:e instanceof Error?e.message:String(e),tone:"error"}}finally{Wn.value=!1}}function iu(){const e=mn(X.value,{extended:pe.value});if(e.kind==="form"){const n=Ha(li.value,e.paths??[]);return f(yr,{schema:n,values:ee.value,errors:ce.value,onChange:i=>{ee.value=i}})}return e.kind==="userMd"?!zn.value||M.value===null?f("p",{children:"Loading .agent-user.yml…"}):f(wr,{value:M.value,errors:ce.value,onChange:n=>{M.value=n,ai.value=!1}}):e.kind==="aiTools"?f("div",{class:"ac-wizard-step-stub",children:f("p",{children:["Auto-detected AI tools will appear here. The wizard reads",f("code",{children:" /api/v1/wizard/auto-detect"})," and lets you toggle each discovered tool on or off. Pick-list UI lands in the follow-up extended-mode phase; the endpoint is already live so you can inspect raw output via ",f("code",{children:"curl"})," in the meantime."]})}):e.kind==="packs"?f("div",{class:"ac-wizard-step-stub",children:f("p",{children:["Capability packs (founder-strategy, finance-basic, gtm-sales, ops-people, ai-video) will appear here. The wizard reads",f("code",{children:" /api/v1/wizard/manifest"})," and lets you toggle each pack on or off. Selection UI lands in the follow-up phase."]})}):f(Ga,{steps:bt(),currentIndex:X.value,changes:gn.value,errors:ce.value,userMdChanged:sn(),userMdAction:gt.value?"replace":"create",loading:cn.value,onJump:n=>{Ye(n)},scope:qn.value,scopeAvailable:Ie.value?.projectScopeAvailable===!0,onScopeChange:n=>{qn.value=n}})}function ru({path:e}){if(pn(()=>{Za()},[]),!_t.value||li.value===null)return f("div",{class:"ac-page",children:[f("h1",{children:"Setup wizard"}),Ae.value!==null?f("p",{class:"ac-banner ac-banner--error",children:Ae.value}):f("p",{children:"Loading…"})]});const n=X.value,i=yn(),r=mn(n,{extended:pe.value}),t=n===i-1;return f("div",{class:"ac-page",children:[f(Ya,{step:r,index:n,total:i}),L.value!==null?f("p",{class:`ac-banner${L.value.tone==="error"?" ac-banner--error":""}`,children:L.value.message}):null,f("div",{class:"ac-wizard__step",children:f(iu,{})}),f(Wa,{canGoPrev:n>0,canGoNext:!t,canSkip:r.kind==="userMd",isLast:t,busy:Wn.value||cn.value,canFinish:gn.value.length>0||sn(),completed:ui.value,onPrev:()=>{Ye(n-1)},onNext:()=>{Ye(n+1)},onSkip:()=>{ai.value=!0,Ye(n+1)},onFinish:()=>{nu()}})]})}function tu({path:e}){return f("div",{class:"ac-page ac-page--error",children:[f("h1",{children:"Page not found"}),f("p",{children:["Nothing routed to ",f("code",{children:e}),". Try ",f("a",{href:"#/settings",children:"Settings"}),"."]})]})}function ou(){const e=Ie.value;return e===null||e.dryRun!==!0?null:f("div",{class:"ac-dryrun-banner",role:"status","aria-live":"polite",children:[f("strong",{children:"DRY RUN"}),f("span",{children:" · no files will be written. Validation + rendering run normally; commits return a preview."})]})}function lu(){pn(()=>{zt(),Ln.value==="/"&&Wt("/settings"),Da()},[]);const e=Ln.value;let n;return e==="/"||e==="/settings"?n=f(ao,{}):e==="/settings/user"?n=f(Pa,{}):e.startsWith("/wizard")?n=f(ru,{path:e}):n=f(tu,{path:e}),f(K,{children:[f(ou,{}),n]})}function au(){return new URLSearchParams(window.location.search).get("token")}function uu(){const e=document.getElementById("app");if(e===null)return;const n=au();if(n===null){e.textContent="agent-config UI · missing token — re-open via `agent-config ui:serve`.";return}qt(n),e.textContent="",Ot(f(lu,{}),e)}uu();
35
- //# sourceMappingURL=index-D-DY1ywI.js.map