@event4u/agent-config 16.4.0 → 17.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.augment-plugin/marketplace.json +3 -3
- package/.augment-plugin/plugin.json +1 -1
- package/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/skills/install-agent-config/SKILL.md +4 -4
- package/CHANGELOG.md +483 -669
- package/CONTRIBUTING.md +47 -0
- package/README.md +25 -25
- package/dist/agent-src/commands/{design.md → agent-design.md} +11 -7
- package/dist/agent-src/commands/agents/init.md +66 -3
- package/dist/agent-src/commands/agents/user/init.md +3 -0
- package/dist/agent-src/commands/{optimize/deep.md → analyze/and-optimize.md} +72 -33
- package/dist/agent-src/commands/analyze/inbox.md +168 -37
- package/dist/agent-src/commands/analyze/pr.md +144 -0
- package/dist/agent-src/commands/analyze/{repo.md → reference.md} +85 -14
- package/dist/agent-src/commands/analyze/roadmap-repos.md +19 -10
- package/dist/agent-src/commands/analyze.md +28 -12
- package/dist/agent-src/commands/audit.md +115 -0
- package/dist/agent-src/commands/brand/review.md +13 -2
- package/dist/agent-src/commands/brand/tokens.md +3 -3
- package/dist/agent-src/commands/brand/voice.md +8 -5
- package/dist/agent-src/commands/brand.md +2 -2
- package/dist/agent-src/commands/challenge-me/closure.md +25 -0
- package/dist/agent-src/commands/design-system/import.md +8 -3
- package/dist/agent-src/commands/design-system/sync.md +98 -0
- package/dist/agent-src/commands/design-system.md +6 -1
- package/dist/agent-src/commands/evals/analyze.json +44 -0
- package/dist/agent-src/commands/evals/audit.json +12 -0
- package/dist/agent-src/commands/evals/retro.json +12 -0
- package/dist/agent-src/commands/fix/ci.md +10 -8
- package/dist/agent-src/commands/ghostwriter/write.md +22 -0
- package/dist/agent-src/commands/memory/learn-low-impact.md +70 -83
- package/dist/agent-src/commands/memory/propose.md +12 -0
- package/dist/agent-src/commands/memory.md +1 -1
- package/dist/agent-src/commands/optimize.md +4 -3
- package/dist/agent-src/commands/post-as/me.md +18 -0
- package/dist/agent-src/commands/pr/create.md +17 -342
- package/dist/agent-src/commands/pr/merge.md +129 -368
- package/dist/agent-src/commands/retro.md +121 -0
- package/dist/agent-src/commands/review/routing.md +1 -1
- package/dist/agent-src/commands/roadmap/next.md +4 -1
- package/dist/agent-src/commands/roadmap/process-full.md +46 -333
- package/dist/agent-src/commands/roadmap/triage-parked.md +6 -2
- package/dist/agent-src/commands/team-knowledge/consolidate.md +2 -2
- package/dist/agent-src/commands/team-knowledge.md +1 -1
- package/dist/agent-src/commands/threat-model.md +1 -1
- package/dist/agent-src/commands/upstream-contribute.md +91 -101
- package/dist/agent-src/commands/worktree/cleanup.md +18 -11
- package/dist/agent-src/contexts/contracts/consumer-agents-md-guide.md +54 -0
- package/dist/agent-src/contexts/execution/analysis-loop.md +137 -0
- package/dist/agent-src/contexts/execution/auto-dispatch-classification.md +3 -3
- package/dist/agent-src/contexts/execution/decision-closure-execution.md +1 -1
- package/dist/agent-src/contexts/execution/host-capability-manifest.md +6 -0
- package/dist/agent-src/contexts/execution/orchestration-telemetry.md +11 -4
- package/dist/agent-src/contexts/execution/pr-create-branches-content.md +250 -0
- package/dist/agent-src/contexts/execution/pr-create-branches-freshness.md +150 -0
- package/dist/agent-src/contexts/execution/pr-merge-queue.md +287 -0
- package/dist/agent-src/contexts/execution/pr-merge-sync.md +276 -0
- package/dist/agent-src/contexts/execution/pr-merge-trust-boundary.md +69 -0
- package/dist/agent-src/contexts/execution/process-full-all.md +233 -0
- package/dist/agent-src/contexts/execution/process-full-delivery.md +231 -0
- package/dist/agent-src/contexts/execution/roadmap-execution-contract-branches.md +42 -0
- package/dist/agent-src/contexts/execution/roadmap-execution-contract.md +1 -35
- package/dist/agent-src/contexts/execution/roadmap-process-loop-close.md +235 -0
- package/dist/agent-src/contexts/execution/roadmap-process-loop-prescan.md +216 -0
- package/dist/agent-src/contexts/execution/roadmap-process-loop-run.md +253 -0
- package/dist/agent-src/contexts/execution/roadmap-process-loop-set.md +212 -0
- package/dist/agent-src/contexts/execution/roadmap-process-loop.md +25 -864
- package/dist/agent-src/contexts/execution/subagent-spawn-contract.md +14 -2
- package/dist/agent-src/contexts/execution/subagent-steering.md +65 -8
- package/dist/agent-src/contexts/model-recommendations.md +5 -5
- package/dist/agent-src/contexts/subagent-configuration.md +1 -1
- package/dist/agent-src/guidelines/agent-infra/api-cost-levers.md +4 -3
- package/dist/agent-src/guidelines/agent-infra/model-recommendation.md +11 -5
- package/dist/agent-src/guidelines/agent-infra/rule-body-migration-inventory.md +1 -1
- package/dist/agent-src/guidelines/agent-infra/self-improvement-pipeline.md +47 -24
- package/dist/agent-src/guidelines/design-antipatterns.md +6 -1
- package/dist/agent-src/guidelines/design-asset-discipline.md +17 -0
- package/dist/agent-src/guidelines/design-fidelity-routing.md +1 -0
- package/dist/agent-src/guidelines/php/api-design.md +10 -1
- package/dist/agent-src/rules/brand-source-of-truth.md +7 -6
- package/dist/agent-src/rules/code-provenance.md +1 -1
- package/dist/agent-src/rules/context-hygiene.md +0 -1
- package/dist/agent-src/rules/design-fidelity.md +12 -13
- package/dist/agent-src/rules/external-reference-deep-dive.md +2 -2
- package/dist/agent-src/rules/fix-what-you-see.md +1 -1
- package/dist/agent-src/rules/low-impact-corpus-privacy-floor.md +14 -15
- package/dist/agent-src/rules/missing-skill-recovery.md +12 -11
- package/dist/agent-src/rules/neighbour-precedence.md +1 -1
- package/dist/agent-src/rules/recurring-criticism.md +1 -1
- package/dist/agent-src/rules/roadmap-ci-steps-policy.md +0 -2
- package/dist/agent-src/rules/self-repair-loop.md +2 -2
- package/dist/agent-src/rules/token-budget-discipline.md +2 -2
- package/dist/agent-src/scripts/dashboard_mode.ts +4 -1
- package/dist/agent-src/scripts/roadmap_age.ts +175 -0
- package/dist/agent-src/scripts/update_roadmap_progress.ts +10 -2
- package/dist/agent-src/skills/accessibility-auditor/SKILL.md +3 -3
- package/dist/agent-src/skills/accessibility-auditor/data/aria-patterns.csv +2 -0
- package/dist/agent-src/skills/accessibility-auditor/data/manifest.json +3 -3
- package/dist/agent-src/skills/agent-security-review/SKILL.md +2 -2
- package/dist/agent-src/skills/agents-md-thin-root/SKILL.md +12 -4
- package/dist/agent-src/skills/ai-code-blindspots/SKILL.md +7 -0
- package/dist/agent-src/skills/ai-council/references/advanced-modes.md +11 -1
- package/dist/agent-src/skills/ai-council/references/cost-and-redaction.md +7 -0
- package/dist/agent-src/skills/ai-council/references/execution-modes.md +7 -0
- package/dist/agent-src/skills/ai-council/references/output-and-synthesis.md +19 -0
- package/dist/agent-src/skills/ai-council/references/procedure.md +7 -0
- package/dist/agent-src/skills/api-design/SKILL.md +2 -2
- package/dist/agent-src/skills/api-endpoint/SKILL.md +2 -2
- package/dist/agent-src/skills/authz-review/SKILL.md +5 -3
- package/dist/agent-src/skills/blade-ui/SKILL.md +2 -2
- package/dist/agent-src/skills/brand/SKILL.md +7 -3
- package/dist/agent-src/skills/brand-asset-generation/SKILL.md +13 -6
- package/dist/agent-src/skills/brand-audit/SKILL.md +2 -1
- package/dist/agent-src/skills/brand-identity/SKILL.md +5 -4
- package/dist/agent-src/skills/brand-strategy/SKILL.md +5 -4
- package/dist/agent-src/skills/brand-to-tokens/SKILL.md +18 -39
- package/dist/agent-src/skills/brand-to-tokens/templates/marp-brand-deck.md.example +2 -2
- package/dist/agent-src/skills/brand-to-tokens/templates/reveal-brand-deck.yaml +2 -2
- package/dist/agent-src/skills/canvas-design/SKILL.md +16 -4
- package/dist/agent-src/skills/competitive-positioning/SKILL.md +2 -2
- package/dist/agent-src/skills/composer-packages/SKILL.md +18 -0
- package/dist/agent-src/skills/condense-memory/SKILL.md +1 -1
- package/dist/agent-src/skills/content-funnel-design/SKILL.md +8 -1
- package/dist/agent-src/skills/context-authoring/SKILL.md +1 -1
- package/dist/agent-src/skills/context-document/SKILL.md +2 -2
- package/dist/agent-src/skills/corpus-grounding/SKILL.md +6 -6
- package/dist/agent-src/skills/corpus-grounding/scripts/decision_engine.ts +13 -11
- package/dist/agent-src/skills/corpus-grounding/scripts/ground.mjs +1706 -0
- package/dist/agent-src/skills/corpus-grounding/scripts/schema_validator.ts +7 -1
- package/dist/agent-src/skills/dashboard-design/SKILL.md +1 -1
- package/dist/agent-src/skills/data-flow-mapper/SKILL.md +5 -2
- package/dist/agent-src/skills/database/SKILL.md +5 -4
- package/dist/agent-src/skills/decision-record/references/weighted-matrix.md +12 -0
- package/dist/agent-src/skills/deep-reading-analyst/SKILL.md +1 -1
- package/dist/agent-src/skills/dependency-upgrade/SKILL.md +61 -11
- package/dist/agent-src/skills/description-assist/SKILL.md +1 -1
- package/dist/agent-src/skills/design-intelligence/SKILL.md +1 -1
- package/dist/agent-src/skills/design-intelligence/data/landing.csv +1 -1
- package/dist/agent-src/skills/design-intelligence/references/context-and-registers.md +10 -2
- package/dist/agent-src/skills/design-intelligence/references/design-languages.md +1 -1
- package/dist/agent-src/skills/design-intelligence/references/design-rules-checklist.md +4 -3
- package/dist/agent-src/skills/design-intelligence/references/integration-mapping.md +25 -22
- package/dist/agent-src/skills/{wireframe → design-review}/references/story-beat-ledger.schema.json +1 -1
- package/dist/agent-src/skills/design-review/references/verification-automation.md +11 -3
- package/dist/agent-src/skills/design-system-capture/SKILL.md +15 -10
- package/dist/agent-src/skills/design-system-capture/references/design-system-json.md +20 -5
- package/dist/agent-src/skills/design-system-capture/references/import-procedure.md +2 -2
- package/dist/agent-src/skills/design-tokens/SKILL.md +23 -23
- package/dist/agent-src/skills/design-tokens/scripts/tokens.mjs +1037 -0
- package/dist/agent-src/skills/design-tokens/scripts/tokens.ts +336 -13
- package/dist/agent-src/skills/design-tokens/templates/design-tokens-starter.json +52 -53
- package/dist/agent-src/skills/docker/SKILL.md +1 -1
- package/dist/agent-src/skills/estimate-ticket/SKILL.md +1 -1
- package/dist/agent-src/skills/existing-ui-audit/SKILL.md +14 -276
- package/dist/agent-src/skills/existing-ui-audit/procedure.yaml +44 -0
- package/dist/agent-src/skills/existing-ui-audit/references/anti-slop-cross-reference.md +1 -1
- package/dist/agent-src/skills/existing-ui-audit/references/steps/00-inspect-stack-and-input.md +4 -0
- package/dist/agent-src/skills/existing-ui-audit/references/steps/01-enumerate-components.md +26 -0
- package/dist/agent-src/skills/existing-ui-audit/references/steps/01b-detect-component-taxonomy.md +7 -0
- package/dist/agent-src/skills/existing-ui-audit/references/steps/02-identify-design-system.md +12 -0
- package/dist/agent-src/skills/existing-ui-audit/references/steps/03-detect-design-tokens.md +35 -0
- package/dist/agent-src/skills/existing-ui-audit/references/steps/04-detect-shadcn-inventory.md +13 -0
- package/dist/agent-src/skills/existing-ui-audit/references/steps/04b-live-storybook-read.md +26 -0
- package/dist/agent-src/skills/existing-ui-audit/references/steps/05-list-reusable-patterns.md +14 -0
- package/dist/agent-src/skills/existing-ui-audit/references/steps/06-match-candidates.md +52 -0
- package/dist/agent-src/skills/existing-ui-audit/references/steps/07-greenfield-branch.md +29 -0
- package/dist/agent-src/skills/existing-ui-audit/references/steps/08-a11y-baseline.md +40 -0
- package/dist/agent-src/skills/existing-ui-audit/references/steps/09-validate-and-write.md +5 -0
- package/dist/agent-src/skills/experiment-loop/SKILL.md +1 -1
- package/dist/agent-src/skills/fe-design/references/design-patterns.md +65 -4
- package/dist/agent-src/skills/fe-design/references/design-read-and-memory.md +1 -1
- package/dist/agent-src/skills/fe-design/references/source-led-port.md +1 -1
- package/dist/agent-src/skills/finishing-a-development-branch/SKILL.md +6 -6
- package/dist/agent-src/skills/flux/SKILL.md +1 -1
- package/dist/agent-src/skills/form-handler/SKILL.md +15 -2
- package/dist/agent-src/skills/frontend-render-security/SKILL.md +9 -0
- package/dist/agent-src/skills/git-workflow/SKILL.md +2 -2
- package/dist/agent-src/skills/git-workflow/references/branch-update.md +7 -0
- package/dist/agent-src/skills/git-workflow/references/commit-subject.md +12 -0
- package/dist/agent-src/skills/git-workflow/references/push-closes-its-loop.md +10 -0
- package/dist/agent-src/skills/gtm-launch/SKILL.md +8 -1
- package/dist/agent-src/skills/html-deck/SKILL.md +7 -2
- package/dist/agent-src/skills/humanizer/SKILL.md +16 -3
- package/dist/agent-src/skills/humanizer/references/anti-aiisms.md +13 -1
- package/dist/agent-src/skills/humanizer/references/fixtures.md +8 -0
- package/dist/agent-src/skills/iconography/SKILL.md +4 -2
- package/dist/agent-src/skills/image-provider-routing/SKILL.md +16 -5
- package/dist/agent-src/skills/js-library-packaging/SKILL.md +5 -4
- package/dist/agent-src/skills/js-library-packaging/scripts/check_package_surface.mjs +197 -0
- package/dist/agent-src/skills/judge-artifact-completeness/SKILL.md +1 -1
- package/dist/agent-src/skills/judge-security-auditor/SKILL.md +2 -2
- package/dist/agent-src/skills/launch-readiness/SKILL.md +18 -22
- package/dist/agent-src/skills/learning-to-rule-or-skill/SKILL.md +5 -5
- package/dist/agent-src/skills/livewire/SKILL.md +1 -1
- package/dist/agent-src/skills/llm-provider-knowledge/SKILL.md +18 -0
- package/dist/agent-src/skills/logo-generation/SKILL.md +21 -11
- package/dist/agent-src/skills/market-entry-analysis/SKILL.md +6 -1
- package/dist/agent-src/skills/markitdown/SKILL.md +1 -1
- package/dist/agent-src/skills/memory-consolidation/SKILL.md +2 -2
- package/dist/agent-src/skills/messaging-architecture/SKILL.md +8 -1
- package/dist/agent-src/skills/motion-choreographer/SKILL.md +2 -2
- package/dist/agent-src/skills/playwright-testing/SKILL.md +2 -0
- package/dist/agent-src/skills/positioning-strategy/SKILL.md +10 -2
- package/dist/agent-src/skills/prediction-pool-optimizer/references/ev-fixtures.md +13 -0
- package/dist/agent-src/skills/prediction-pool-optimizer/references/odds-and-bonus.md +7 -0
- package/dist/agent-src/skills/project-analysis-core/SKILL.md +1 -1
- package/dist/agent-src/skills/project-analysis-hypothesis-driven/SKILL.md +1 -1
- package/dist/agent-src/skills/project-analyzer/SKILL.md +14 -75
- package/dist/agent-src/skills/project-analyzer/procedure.yaml +39 -0
- package/dist/agent-src/skills/project-analyzer/references/steps/01-project-overview.md +9 -0
- package/dist/agent-src/skills/project-analyzer/references/steps/02-architecture.md +7 -0
- package/dist/agent-src/skills/project-analyzer/references/steps/03-data-layer.md +6 -0
- package/dist/agent-src/skills/project-analyzer/references/steps/04-business-domains.md +7 -0
- package/dist/agent-src/skills/project-analyzer/references/steps/05-api-surface.md +6 -0
- package/dist/agent-src/skills/project-analyzer/references/steps/06-service-map.md +6 -0
- package/dist/agent-src/skills/project-analyzer/references/steps/07-module-inventory.md +6 -0
- package/dist/agent-src/skills/project-analyzer/references/steps/08-infrastructure-and-testing.md +5 -0
- package/dist/agent-src/skills/project-analyzer/references/steps/09-agent-docs-audit.md +6 -0
- package/dist/agent-src/skills/project-analyzer/references/steps/10-gap-analysis.md +6 -0
- package/dist/agent-src/skills/quality-tools/references/js-ts-tools.md +10 -0
- package/dist/agent-src/skills/quality-tools/references/php-tools.md +13 -0
- package/dist/agent-src/skills/quality-tools/references/python-tools.md +11 -0
- package/dist/agent-src/skills/react-native-setup/SKILL.md +7 -2
- package/dist/agent-src/skills/react-shadcn-ui/SKILL.md +5 -1
- package/dist/agent-src/skills/react-shadcn-ui/references/registry.md +13 -0
- package/dist/agent-src/skills/react-shadcn-ui/scripts/shadcn_add.mjs +315 -0
- package/dist/agent-src/skills/react-shadcn-ui/scripts/shadcn_add.ts +6 -6
- package/dist/agent-src/skills/receiving-code-review/SKILL.md +1 -1
- package/dist/agent-src/skills/refine-ticket/SKILL.md +2 -2
- package/dist/agent-src/skills/release-comms/SKILL.md +2 -1
- package/dist/agent-src/skills/repomix-packer/SKILL.md +2 -2
- package/dist/agent-src/skills/requesting-code-review/SKILL.md +3 -3
- package/dist/agent-src/skills/roadmap-management/references/archival.md +3 -3
- package/dist/agent-src/skills/roadmap-management/references/authoring.md +9 -2
- package/dist/agent-src/skills/roadmap-management/references/dashboard.md +3 -3
- package/dist/agent-src/skills/roadmap-management/references/lifecycle.md +3 -3
- package/dist/agent-src/skills/roadmap-writing/SKILL.md +4 -4
- package/dist/agent-src/skills/rtk-output-filtering/SKILL.md +1 -1
- package/dist/agent-src/skills/rule-writing/SKILL.md +1 -2
- package/dist/agent-src/skills/security/SKILL.md +41 -5
- package/dist/agent-src/skills/skill-improvement-pipeline/SKILL.md +5 -3
- package/dist/agent-src/skills/skill-reviewer/SKILL.md +1 -1
- package/dist/agent-src/skills/skill-writing/SKILL.md +23 -8
- package/dist/agent-src/skills/skill-writing/references/section-patterns.md +19 -1
- package/dist/agent-src/skills/source-discovery/SKILL.md +3 -3
- package/dist/agent-src/skills/sql-writing/SKILL.md +2 -2
- package/dist/agent-src/skills/standards-from-config/SKILL.md +2 -2
- package/dist/agent-src/skills/storybook-workshop/SKILL.md +5 -0
- package/dist/agent-src/skills/storybook-workshop/scripts/story_contrast_floor.mjs +99 -0
- package/dist/agent-src/skills/subagent-orchestration/SKILL.md +13 -13
- package/dist/agent-src/skills/subagent-orchestration/prompts/README.md +4 -3
- package/dist/agent-src/skills/svg-authoring/SKILL.md +324 -0
- package/dist/agent-src/skills/systematic-debugging/SKILL.md +2 -2
- package/dist/agent-src/skills/tailwind-engineer/SKILL.md +8 -3
- package/dist/agent-src/skills/tailwind-engineer/scripts/tailwind_config_gen.mjs +482 -0
- package/dist/agent-src/skills/test-case-discovery/SKILL.md +1 -1
- package/dist/agent-src/skills/threat-modeling/SKILL.md +8 -1
- package/dist/agent-src/skills/threat-modeling/data/manifest.json +5 -2
- package/dist/agent-src/skills/threat-modeling/data/reasoning.csv +10 -10
- package/dist/agent-src/skills/threat-modeling/data/surfaces.csv +11 -10
- package/dist/agent-src/skills/threat-modeling/data/threats.csv +34 -20
- package/dist/agent-src/skills/type-design/SKILL.md +196 -0
- package/dist/agent-src/skills/type-design/references/font-spec.md +90 -0
- package/dist/agent-src/skills/type-design/references/gates.md +113 -0
- package/dist/agent-src/skills/type-design/references/toolchain.md +66 -0
- package/dist/agent-src/skills/typography-system/SKILL.md +21 -11
- package/dist/agent-src/skills/typography-system/references/worked-scales.md +85 -0
- package/dist/agent-src/skills/ui-apply-generic/SKILL.md +1 -1
- package/dist/agent-src/skills/universal-project-analysis/SKILL.md +1 -1
- package/dist/agent-src/skills/upstream-contribute/SKILL.md +120 -125
- package/dist/agent-src/skills/using-git-worktrees/SKILL.md +1 -0
- package/dist/agent-src/skills/verify-repair-loop/SKILL.md +1 -1
- package/dist/agent-src/skills/voice-and-tone-design/SKILL.md +71 -2
- package/dist/agent-src/skills/wireframe/SKILL.md +5 -2
- package/dist/agent-src/skills/worktree-lifecycle/SKILL.md +16 -14
- package/dist/agent-src/templates/AGENTS.md +1 -1
- package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
- package/dist/agent-src/templates/agents/proposal.example.md +1 -1
- package/dist/agent-src/templates/github-workflows/advisories-daily.yml +85 -0
- package/dist/agent-src/templates/roadmaps.md +39 -1
- package/dist/agent-src/templates/scripts/check_memory.ts +2 -2
- package/dist/agent-src/templates/scripts/historical-bug-patterns.example.yml +13 -1
- package/dist/agent-src/templates/scripts/work_engine/cli.ts +17 -0
- package/dist/agent-src/templates/scripts/work_engine/cli_args.ts +10 -0
- package/dist/agent-src/templates/scripts/work_engine/directives/ui/scaffold.ts +22 -13
- package/dist/agent-src/templates/scripts/work_engine/dispatcher.ts +18 -4
- package/dist/agent-src/templates/scripts/work_engine/procedure/checks.ts +283 -0
- package/dist/agent-src/templates/scripts/work_engine/procedure/run.ts +432 -0
- package/dist/agent-src/templates/scripts/work_engine/procedure/sidecar.ts +185 -0
- package/dist/agent-src/templates/scripts/work_engine/state.ts +3 -0
- package/dist/cli/commands/uiRender.js +265 -13
- package/dist/cli/commands/uiRenderAsset.js +1316 -0
- package/dist/cli/commands/uiRenderAssetCompare.js +752 -0
- package/dist/cli/commands/uiRenderAssetFonts.js +158 -0
- package/dist/cli/commands/uiRenderAssetGrid.js +265 -0
- package/dist/cli/commands/uiRenderAssetGrounds.js +323 -0
- package/dist/cli/commands/uiRenderAssetIsolation.js +85 -0
- package/dist/cli/commands/uiRenderAssetTypes.js +133 -0
- package/dist/cli/initRouting.js +1 -1
- package/dist/cli/main.js +47 -1
- package/dist/cli/mcp/dispatch.js +31 -9
- package/dist/cli/python/knowledge_ingest.js +7 -39
- package/dist/cli/python/workspace_secrets.js +4 -177
- package/dist/cli/registry.js +5 -2
- package/dist/cli-delegate/archive_completed_roadmaps.js +3 -2
- package/dist/cli-delegate/check_update_banner.js +635 -266
- package/dist/cli-delegate/{chunk-AED2VQGM.js → chunk-2CX7NWRB.js} +233 -437
- package/dist/cli-delegate/{chunk-F3QDG2GT.js → chunk-2SFOOFJJ.js} +259 -159
- package/dist/cli-delegate/chunk-2Y5AMLMY.js +136 -0
- package/dist/cli-delegate/{chunk-OKJUIAPS.js → chunk-4E2W63DA.js} +1 -62
- package/dist/cli-delegate/{chunk-6SRJTYJS.js → chunk-4SHNERBL.js} +37 -16
- package/dist/cli-delegate/chunk-5VO3RTMV.js +208 -0
- package/dist/cli-delegate/chunk-6E2LDY4F.js +27 -0
- package/dist/cli-delegate/{chunk-XQTPXKFA.js → chunk-6ZD2QZMN.js} +8 -17
- package/dist/cli-delegate/{chunk-6V5FMA3P.js → chunk-7CEI2YPS.js} +1 -1
- package/dist/cli-delegate/{chunk-DMSZHXZS.js → chunk-7DRWULEQ.js} +80 -7
- package/dist/cli-delegate/chunk-7NXCZSDL.js +54 -0
- package/dist/cli-delegate/chunk-AX3U3UWJ.js +328 -0
- package/dist/cli-delegate/{chunk-WOKWX5PL.js → chunk-BKALSTBZ.js} +18 -3
- package/dist/cli-delegate/chunk-BMGUGSY6.js +103 -0
- package/dist/cli-delegate/chunk-BYV46VRM.js +3309 -0
- package/dist/cli-delegate/{chunk-5GPULQBE.js → chunk-CAL76ADI.js} +4215 -682
- package/dist/cli-delegate/chunk-DSY6LLCQ.js +127 -0
- package/dist/cli-delegate/chunk-E6XNBVE4.js +581 -0
- package/dist/cli-delegate/{chunk-ZUZKZYCN.js → chunk-ESUNQ5XR.js} +46 -10
- package/dist/cli-delegate/{chunk-G5VVIZRC.js → chunk-F7HLSW6P.js} +1 -1
- package/dist/cli-delegate/chunk-FIEEOH5C.js +133 -0
- package/dist/cli-delegate/chunk-FKYZOWVD.js +719 -0
- package/dist/cli-delegate/chunk-GOMILC3O.js +918 -0
- package/dist/cli-delegate/chunk-I4KJYVPB.js +69 -0
- package/dist/cli-delegate/{chunk-JQOM7TTM.js → chunk-IDAOTDPE.js} +1 -100
- package/dist/cli-delegate/chunk-IROAQ77A.js +137 -0
- package/dist/cli-delegate/chunk-J2SJZICO.js +698 -0
- package/dist/cli-delegate/{chunk-6YQC2HLF.js → chunk-JHMMWNJ2.js} +54 -40
- package/dist/cli-delegate/{chunk-WQWXGIWB.js → chunk-M6CRG5O6.js} +165 -15
- package/dist/cli-delegate/{chunk-PHD7OOLE.js → chunk-MQ2UDEGV.js} +14 -3
- package/dist/cli-delegate/chunk-NTM7G2V4.js +220 -0
- package/dist/cli-delegate/chunk-PV7S5DPJ.js +175 -0
- package/dist/cli-delegate/{chunk-F7DQWYR5.js → chunk-RAXQOETZ.js} +6 -2
- package/dist/cli-delegate/{chunk-T7XSJSUQ.js → chunk-SIOMDAKL.js} +980 -784
- package/dist/cli-delegate/{chunk-KR6EM23A.js → chunk-TULVDQ4L.js} +3 -48
- package/dist/cli-delegate/chunk-UUYEKXKR.js +20 -0
- package/dist/cli-delegate/{chunk-7XGD2OEU.js → chunk-UXWHY6CQ.js} +2 -1
- package/dist/cli-delegate/{chunk-PWX7CKMD.js → chunk-VC3ECUEK.js} +1 -1
- package/dist/cli-delegate/{chunk-KXXWJTDO.js → chunk-WMNYVIYX.js} +1 -1
- package/dist/cli-delegate/chunk-XCY5KKUC.js +181 -0
- package/dist/cli-delegate/{chunk-H76PHZBI.js → chunk-XLY5G3CM.js} +14 -19
- package/dist/cli-delegate/cmd_adr_effective.js +41 -2
- package/dist/cli-delegate/cmd_analyze_session.js +7 -7
- package/dist/cli-delegate/cmd_brand_status.js +1287 -10
- package/dist/cli-delegate/cmd_ci_settle.js +330 -0
- package/dist/cli-delegate/cmd_conformance.js +669 -822
- package/dist/cli-delegate/cmd_doctor.js +26 -16
- package/dist/cli-delegate/cmd_doctor_neighbours.js +10 -7
- package/dist/cli-delegate/cmd_explain.js +9 -24
- package/dist/cli-delegate/cmd_export.js +14 -11
- package/dist/cli-delegate/cmd_fleet.js +5 -3
- package/dist/cli-delegate/cmd_git_convention.js +8 -4
- package/dist/cli-delegate/cmd_handoff.js +79 -242
- package/dist/cli-delegate/cmd_mcp_available.js +1 -1
- package/dist/cli-delegate/cmd_memory_get.js +4 -2
- package/dist/cli-delegate/cmd_migrate.js +2 -2
- package/dist/cli-delegate/cmd_packs_active.js +2 -2
- package/dist/cli-delegate/cmd_preflight.js +7 -5
- package/dist/cli-delegate/cmd_prune.js +16 -13
- package/dist/cli-delegate/cmd_route_audit.js +11 -8
- package/dist/cli-delegate/cmd_route_explain.js +649 -16
- package/dist/cli-delegate/cmd_session_recycle.js +15 -6
- package/dist/cli-delegate/cmd_settings_check.js +2 -2
- package/dist/cli-delegate/cmd_settings_get.js +1 -1
- package/dist/cli-delegate/cmd_settings_migrate.js +14 -11
- package/dist/cli-delegate/cmd_settings_set.js +1 -1
- package/dist/cli-delegate/cmd_sync.js +16 -13
- package/dist/cli-delegate/cmd_uninstall.js +185 -31
- package/dist/cli-delegate/cmd_update.js +67 -3
- package/dist/cli-delegate/cmd_upgrade.js +38 -7
- package/dist/cli-delegate/cmd_validate.js +16 -13
- package/dist/cli-delegate/cmd_versions.js +1 -1
- package/dist/cli-delegate/dashboard_mode.js +1 -1
- package/dist/cli-delegate/gate_execute.js +4 -3
- package/dist/cli-delegate/roadmap_age.js +22 -0
- package/dist/cli-delegate/roadmap_gates.js +4 -3
- package/dist/cli-delegate/update_roadmap_progress.js +3 -2
- package/dist/cli-delegate/upgrade_unattended-VVL6JLSX.js +541 -0
- package/dist/discovery/deprecation-report.md +1 -1
- package/dist/discovery/discovery-manifest.json +409 -201
- package/dist/discovery/discovery-manifest.json.sha256 +1 -1
- package/dist/discovery/discovery-manifest.summary.md +8 -8
- package/dist/discovery/dormancy-report.md +1 -1
- package/dist/discovery/orphan-report.md +1 -1
- package/dist/discovery/packs.json +36 -27
- package/dist/discovery/trust-report.md +3 -3
- package/dist/discovery/workspaces.json +25 -16
- package/dist/hooks/chat_history.chunk.cjs +6852 -0
- package/dist/hooks/chat_history.chunk.cjs.sha256 +1 -0
- package/dist/hooks/dispatch.js +17706 -18627
- package/dist/hooks/dispatch.sha256 +1 -1
- package/dist/hooks/egress_engine.chunk.cjs +915 -0
- package/dist/hooks/egress_engine.chunk.cjs.sha256 +1 -0
- package/dist/hooks/svg_rules.chunk.cjs +1858 -0
- package/dist/hooks/svg_rules.chunk.cjs.sha256 +1 -0
- package/dist/install/conflict.js +36 -6
- package/dist/install/conflictTracker.js +81 -7
- package/dist/install/detect.js +3 -3
- package/dist/install/hostPermissionsAdapter.js +106 -0
- package/dist/install/install.mjs +3117 -1949
- package/dist/install/installThinLayer.js +1 -1
- package/dist/install/manifestFiles.js +21 -0
- package/dist/install/noGoDenyRows.js +300 -0
- package/dist/install/noGoRules.js +368 -0
- package/dist/install/ownershipLedger.js +133 -0
- package/dist/install/plan.js +1 -1
- package/dist/install/preflight.js +39 -8
- package/dist/install/preserve.js +74 -12
- package/dist/install/recordedOwnership.js +88 -5
- package/dist/install/rule_scope.js +20 -3
- package/dist/install/stagedRuntime.js +455 -0
- package/dist/install/toolsArg.js +19 -0
- package/dist/install/userPin.js +47 -0
- package/dist/install/wizard-plan.js +26 -4
- package/dist/mcp/awesome-mcp-servers.row.md +1 -1
- package/dist/mcp/mcp-cloudflare-catalogue.json +3 -2
- package/dist/mcp/registry-manifest.json +6 -5
- package/dist/mcp/server.json +3 -3
- package/dist/mcp/server.mjs +9814 -5333
- package/dist/router.json +1 -1
- package/dist/scripts/_lib/agent_settings.js +7 -12
- package/dist/scripts/_lib/asset_render_record.js +219 -0
- package/dist/scripts/_lib/claude_builtin_names.js +9 -4
- package/dist/scripts/_lib/claude_settings_hooks.js +102 -34
- package/dist/scripts/_lib/egress_rules.js +766 -0
- package/dist/scripts/_lib/environment_detector.js +24 -33
- package/dist/scripts/_lib/global_deploy_inventory.js +146 -9
- package/dist/scripts/_lib/guidelines_lane.js +10 -1
- package/dist/scripts/_lib/identifier_redaction.js +24 -0
- package/dist/scripts/_lib/installed_layer.js +17 -0
- package/dist/scripts/_lib/installed_layer_normalise.js +72 -0
- package/dist/scripts/_lib/lean_projection_mode.js +34 -152
- package/dist/scripts/_lib/project_tree_form.js +118 -0
- package/dist/scripts/_lib/scan_scope.js +105 -0
- package/dist/scripts/_lib/scoped_projection.js +133 -3
- package/dist/scripts/_lib/settings_removed_keys.js +29 -0
- package/dist/scripts/_lib/settings_renamed_keys.js +17 -5
- package/dist/scripts/_lib/subagent_native_fields.js +35 -0
- package/dist/scripts/_lib/svg_dom.js +284 -0
- package/dist/scripts/_lib/svg_filled_counter.js +285 -0
- package/dist/scripts/_lib/svg_geometry.js +477 -0
- package/dist/scripts/_lib/svg_motion.js +179 -0
- package/dist/scripts/_lib/svg_rules.js +1339 -0
- package/dist/scripts/_lib/svg_urls.js +67 -0
- package/dist/scripts/_lib/ui_surface.js +19 -0
- package/dist/scripts/_lib/verification_command.js +364 -0
- package/dist/scripts/_lib/workspace_secrets.js +229 -0
- package/dist/scripts/ai_council/seat_policy.js +27 -0
- package/dist/scripts/ai_council/transport_resolver.js +9 -10
- package/dist/scripts/condense.js +25 -29
- package/dist/scripts/lint_svg_asset.js +324 -0
- package/dist/server/io/substituteTemplate.js +2 -2
- package/dist/server/io/yamlIO.js +2 -2
- package/dist/server/routes/install.js +5 -1
- package/dist/server/routes/settings.js +2 -2
- package/dist/server/routes/wizard.js +1 -1
- package/dist/server/schemas/settings.js +22 -16
- package/dist/server/serverInfo.js +1 -1
- package/dist/shared/brandTokenDocument.js +47 -0
- package/dist/shared/brandTokenPaths.js +43 -0
- package/dist/shared/settingsCarveOut.js +0 -7
- package/dist/shared/skillRanking.js +103 -5
- package/dist/shared/userMd/formAdapter.js +16 -0
- package/dist/shared/userMd/schema.js +17 -0
- package/dist/ui/assets/index-w70Ado09.js +23 -0
- package/dist/ui/index.html +1 -1
- package/docs/MIGRATION.md +89 -2
- package/docs/THIRD-PARTY-NOTICES.md +27 -0
- package/docs/contracts/settings-classes.md +27 -9
- package/docs/guidelines/agent-infra/api-cost-levers.md +4 -3
- package/docs/guidelines/agent-infra/model-recommendation.md +11 -5
- package/docs/guidelines/agent-infra/rule-body-migration-inventory.md +1 -1
- package/docs/guidelines/agent-infra/self-improvement-pipeline.md +47 -24
- package/docs/guidelines/design-antipatterns.md +6 -1
- package/docs/guidelines/design-asset-discipline.md +17 -0
- package/docs/guidelines/design-fidelity-routing.md +1 -0
- package/docs/guidelines/php/api-design.md +10 -1
- package/llms.txt +12 -10
- package/package.json +15 -5
- package/src/agent-src/scripts/dashboard_mode.ts +4 -1
- package/src/agent-src/scripts/roadmap_age.ts +175 -0
- package/src/agent-src/scripts/update_roadmap_progress.ts +10 -2
- package/src/agent-src/templates/AGENTS.md +1 -1
- package/src/agent-src/templates/scripts/check_memory.ts +2 -2
- package/src/agent-src/templates/scripts/historical-bug-patterns.example.yml +13 -1
- package/src/agent-src/templates/scripts/work_engine/cli.ts +17 -0
- package/src/agent-src/templates/scripts/work_engine/cli_args.ts +10 -0
- package/src/agent-src/templates/scripts/work_engine/directives/ui/scaffold.ts +22 -13
- package/src/agent-src/templates/scripts/work_engine/dispatcher.ts +18 -4
- package/src/agent-src/templates/scripts/work_engine/procedure/checks.ts +283 -0
- package/src/agent-src/templates/scripts/work_engine/procedure/run.ts +432 -0
- package/src/agent-src/templates/scripts/work_engine/procedure/sidecar.ts +185 -0
- package/src/agent-src/templates/scripts/work_engine/state.ts +3 -0
- package/src/config/agent-settings.template.yml +120 -57
- package/src/config/agents-paths.yml +13 -7
- package/src/config/ci-local-parity.yml +44 -0
- package/src/config/continuity-surface.json +51 -2
- package/src/config/depth-audit-samples.json +5 -0
- package/src/config/discovery/command-verbs.yml +1 -0
- package/src/config/dispatch-economy-metrics.json +1 -0
- package/src/config/egress-mutations/class-precedence-swapped.json +7 -0
- package/src/config/egress-mutations/credential-token-restores.json +7 -0
- package/src/config/egress-mutations/iban-checksum-disabled.json +7 -0
- package/src/config/egress-mutations/raw-value-in-the-count-record.json +7 -0
- package/src/config/evaluator-budgets.json +4 -4
- package/src/config/gate-coverage.yml +149 -3
- package/src/config/gate-reachability-exemptions.json +3 -5
- package/src/config/gate-violation-baselines.json +29 -25
- package/src/config/gitignore-block.txt +6 -3
- package/src/config/hook-bundle-budget.json +34 -3
- package/src/config/hook-carrier-probes.json +30 -0
- package/src/config/hook-latency-budget.json +4 -2
- package/src/config/host-injection-effect.json +8 -1
- package/src/config/host-skill-frontmatter-keys.json +56 -0
- package/src/config/layer-form-brakes.json +4 -0
- package/src/config/layer-form-comparison-corpus.json +42 -0
- package/src/config/loop-surfaces.yaml +28 -47
- package/src/config/memory-twin-verdicts.yml +9 -1
- package/src/config/metric-registry.yml +40 -3
- package/src/config/pack-size-budget.json +15 -0
- package/src/config/procedure-core-budget.json +21 -0
- package/src/config/profiles/minimal.ini +1 -1
- package/src/config/project-tree-form.json +24 -0
- package/src/config/reach-channels.yml +3 -3
- package/src/config/reach-prescriptions-intake.yml +1 -1
- package/src/config/roadmap-step-size-baseline.json +118 -0
- package/src/config/routing-coverage-seed.json +100 -2
- package/src/config/skill-body-budget.json +686 -0
- package/src/config/skill-fork-pilot.json +17 -0
- package/src/config/skill-lifecycle-probes-codex.json +57 -0
- package/src/config/skill-lifecycle-probes.json +57 -0
- package/src/config/skill-output-shape.json +316 -0
- package/src/config/step-depth-table.json +58 -0
- package/src/config/turnaround-budget.json +90 -0
- package/src/install/conflict.ts +38 -6
- package/src/install/conflictTracker.ts +126 -8
- package/src/install/detect.ts +3 -3
- package/src/install/hostPermissionsAdapter.ts +136 -0
- package/src/install/installThinLayer.ts +6 -1
- package/src/install/manifestFiles.ts +24 -0
- package/src/install/noGoDenyRows.ts +368 -0
- package/src/install/noGoRules.ts +438 -0
- package/src/install/ownershipLedger.ts +180 -0
- package/src/install/plan.ts +1 -1
- package/src/install/preflight.ts +42 -10
- package/src/install/preserve.ts +94 -12
- package/src/install/recordedOwnership.ts +121 -3
- package/src/install/rule_scope.ts +20 -3
- package/src/install/stagedRuntime.ts +528 -0
- package/src/install/toolsArg.ts +16 -0
- package/src/install/types.ts +23 -2
- package/src/install/userPin.ts +54 -0
- package/src/install/wizard-plan.ts +25 -4
- package/src/scripts/_cli/_doctor_emit.ts +24 -0
- package/src/scripts/_cli/cmd_brand_status.ts +223 -12
- package/src/scripts/_cli/cmd_ci_settle.ts +32 -0
- package/src/scripts/_cli/cmd_doctor.ts +23 -44
- package/src/scripts/_cli/cmd_route_explain.ts +176 -2
- package/src/scripts/_cli/cmd_uninstall.ts +270 -26
- package/src/scripts/_cli/cmd_update.ts +34 -1
- package/src/scripts/_cli/cmd_upgrade.ts +38 -2
- package/src/scripts/_cli/detection_report.ts +7 -0
- package/src/scripts/_cli/doctor_execution.ts +1 -2
- package/src/scripts/_cli/doctor_install_mode.ts +39 -0
- package/src/scripts/_cli/doctor_network_posture.ts +3 -3
- package/src/scripts/_cli/doctor_ownership_ledger.ts +126 -0
- package/src/scripts/_cli/doctor_update_verdict.ts +104 -0
- package/src/scripts/_cli/explain_last/scrubber.ts +9 -21
- package/src/scripts/_cli/upgrade_unattended.ts +548 -0
- package/src/scripts/_dispatch.bash +42 -9
- package/src/scripts/_lib/activation_ladder.ts +1 -1
- package/src/scripts/_lib/advisory_inventory.ts +405 -0
- package/src/scripts/_lib/advisory_notice.ts +270 -0
- package/src/scripts/_lib/advisory_sources.ts +752 -0
- package/src/scripts/_lib/advisory_verdicts.ts +363 -0
- package/src/scripts/_lib/agent_artifact_location.ts +177 -0
- package/src/scripts/_lib/agent_settings.ts +7 -12
- package/src/scripts/_lib/arrival_record.ts +217 -0
- package/src/scripts/_lib/asset_render_record.ts +247 -0
- package/src/scripts/_lib/billing_grant.ts +4 -2
- package/src/scripts/_lib/brand_voice_slot.ts +258 -0
- package/src/scripts/_lib/canary_status.ts +24 -0
- package/src/scripts/_lib/cc_transcript.ts +276 -0
- package/src/scripts/_lib/changelog_eras.ts +83 -0
- package/src/scripts/_lib/claim_phrases.ts +71 -0
- package/src/scripts/_lib/classify_update.ts +171 -0
- package/src/scripts/_lib/claude_builtin_names.ts +9 -4
- package/src/scripts/_lib/claude_hook_scope.ts +195 -0
- package/src/scripts/_lib/claude_settings_hooks.ts +118 -34
- package/src/scripts/_lib/codex_resident_set.ts +460 -0
- package/src/scripts/_lib/codex_skill_finder.ts +225 -0
- package/src/scripts/_lib/confusables.ts +19 -0
- package/src/scripts/_lib/consumer_impact.ts +199 -0
- package/src/scripts/_lib/content_class.ts +127 -0
- package/src/scripts/_lib/counted_probe.ts +68 -1
- package/src/scripts/_lib/credential_deny_rows.ts +151 -0
- package/src/scripts/_lib/credential_files.ts +367 -0
- package/src/scripts/_lib/delivery_arm_experiment.ts +2 -2
- package/src/scripts/_lib/depth_flip.ts +141 -0
- package/src/scripts/_lib/design_lock.ts +117 -0
- package/src/scripts/_lib/design_sync_ledger.ts +142 -0
- package/src/scripts/_lib/design_sync_plan.ts +177 -0
- package/src/scripts/_lib/design_sync_reconcile.ts +159 -0
- package/src/scripts/_lib/design_sync_verify.ts +99 -0
- package/src/scripts/_lib/design_system_claude_design.ts +323 -0
- package/src/scripts/_lib/design_system_import.ts +84 -6
- package/src/scripts/_lib/dispatch_import_closure.ts +42 -11
- package/src/scripts/_lib/egress_credential_env.ts +35 -0
- package/src/scripts/_lib/egress_engine.ts +22 -0
- package/src/scripts/_lib/egress_known_values.ts +223 -0
- package/src/scripts/_lib/egress_normalize.ts +67 -0
- package/src/scripts/_lib/egress_prefixes.ts +42 -0
- package/src/scripts/_lib/egress_rules.ts +896 -0
- package/src/scripts/_lib/egress_rules_linearity.ts +56 -0
- package/src/scripts/_lib/egress_sender_scan.ts +290 -0
- package/src/scripts/_lib/egress_session_table.ts +510 -0
- package/src/scripts/_lib/egress_text.ts +63 -0
- package/src/scripts/_lib/egress_token.ts +252 -0
- package/src/scripts/_lib/empty_cycles.ts +1 -1
- package/src/scripts/_lib/environment_detector.ts +45 -30
- package/src/scripts/_lib/exemption_shape.ts +75 -1
- package/src/scripts/_lib/floor_posture.ts +185 -0
- package/src/scripts/_lib/forge_protection.ts +140 -2
- package/src/scripts/_lib/global_deploy_inventory.ts +159 -6
- package/src/scripts/_lib/guidelines_lane.ts +12 -1
- package/src/scripts/_lib/hand_kinds.ts +65 -0
- package/src/scripts/_lib/headless_invocation.ts +3 -3
- package/src/scripts/_lib/host_capability.ts +34 -2
- package/src/scripts/_lib/host_env_write.ts +39 -18
- package/src/scripts/_lib/host_listing_model.ts +14 -7
- package/src/scripts/_lib/identifier_redaction.ts +26 -0
- package/src/scripts/_lib/impact_bump.ts +70 -0
- package/src/scripts/_lib/install_reach_checks.ts +53 -1
- package/src/scripts/_lib/installed_layer.ts +31 -0
- package/src/scripts/_lib/installed_layer_normalise.ts +75 -0
- package/src/scripts/_lib/instructions_loaded_classify.ts +75 -0
- package/src/scripts/_lib/instructions_loaded_event.ts +53 -0
- package/src/scripts/_lib/knowledge_global_redaction.ts +2 -2
- package/src/scripts/_lib/layer_form_corpus.ts +165 -0
- package/src/scripts/_lib/layer_form_decision.ts +248 -0
- package/src/scripts/_lib/layer_form_evidence.ts +112 -0
- package/src/scripts/_lib/lean_projection_mode.ts +32 -161
- package/src/scripts/_lib/llm_proposer_transport.ts +1 -0
- package/src/scripts/_lib/loop_guards.ts +8 -120
- package/src/scripts/_lib/major_surface.ts +207 -0
- package/src/scripts/_lib/mcp_bridge.ts +30 -69
- package/src/scripts/_lib/merge_clearance_record.ts +384 -0
- package/src/scripts/_lib/neighbour_census.ts +18 -1
- package/src/scripts/_lib/orchestration_record.ts +61 -0
- package/src/scripts/_lib/outcome_vocabularies.ts +15 -23
- package/src/scripts/_lib/pin_advice.ts +49 -0
- package/src/scripts/_lib/platform_anchor.ts +222 -0
- package/src/scripts/_lib/procedure_checks.ts +5 -0
- package/src/scripts/_lib/project_tree_form.ts +134 -0
- package/src/scripts/_lib/projection_key_migration.ts +122 -0
- package/src/scripts/_lib/prompt_shape.ts +13 -2
- package/src/scripts/_lib/provenance_verify.ts +272 -0
- package/src/scripts/_lib/quota_parked.ts +27 -1
- package/src/scripts/_lib/ratification_artifact.ts +64 -1
- package/src/scripts/_lib/ratification_subject.ts +508 -46
- package/src/scripts/_lib/release_findings_ingest.ts +52 -5
- package/src/scripts/_lib/release_highlights.ts +72 -2
- package/src/scripts/_lib/release_settings_surface.ts +392 -0
- package/src/scripts/_lib/review_round.ts +134 -0
- package/src/scripts/_lib/roadmap_checkboxes.ts +1 -1
- package/src/scripts/_lib/roadmap_slug_lock.ts +254 -0
- package/src/scripts/_lib/roadmap_step_size.ts +75 -0
- package/src/scripts/_lib/run_checkpoint.ts +60 -3
- package/src/scripts/_lib/runtime_wiring_checks.ts +15 -1
- package/src/scripts/_lib/scope_guard.sh +64 -5
- package/src/scripts/_lib/scoped_projection.ts +136 -3
- package/src/scripts/_lib/secret_detector.ts +24 -103
- package/src/scripts/_lib/security_fix.ts +429 -0
- package/src/scripts/_lib/security_fix_context.ts +133 -0
- package/src/scripts/_lib/self_repair.ts +69 -39
- package/src/scripts/_lib/self_repair_outgoing.ts +209 -0
- package/src/scripts/_lib/self_repair_payload.ts +86 -0
- package/src/scripts/_lib/session_eol.ts +3 -0
- package/src/scripts/_lib/session_pr_watch.ts +207 -0
- package/src/scripts/_lib/session_register.ts +51 -1
- package/src/scripts/_lib/session_tag.ts +51 -0
- package/src/scripts/_lib/settings_removed_keys.ts +30 -0
- package/src/scripts/_lib/settings_renamed_keys.ts +19 -5
- package/src/scripts/_lib/skill_catalogue.ts +66 -25
- package/src/scripts/_lib/skill_fork_pilot.ts +121 -0
- package/src/scripts/_lib/skill_leases.ts +203 -0
- package/src/scripts/_lib/skill_listing_overrides.ts +294 -0
- package/src/scripts/_lib/skill_materialisation.ts +388 -0
- package/src/scripts/_lib/skill_materialisation_gate.ts +210 -0
- package/src/scripts/_lib/skill_materialisation_lock.ts +149 -0
- package/src/scripts/_lib/skill_materialisation_triggers.ts +96 -0
- package/src/scripts/_lib/skill_origin.ts +21 -1
- package/src/scripts/_lib/skill_reach.ts +342 -0
- package/src/scripts/_lib/source_shape.ts +7 -2
- package/src/scripts/_lib/sqlite_guard.ts +1 -1
- package/src/scripts/_lib/step_anatomy.ts +330 -0
- package/src/scripts/_lib/subagent_capsule.ts +8 -2
- package/src/scripts/_lib/subagent_native_fields.ts +30 -0
- package/src/scripts/_lib/subagent_spawn.ts +36 -0
- package/src/scripts/_lib/subagent_steering.ts +367 -0
- package/src/scripts/_lib/svg_dom.ts +318 -0
- package/src/scripts/_lib/svg_filled_counter.ts +287 -0
- package/src/scripts/_lib/svg_geometry.ts +480 -0
- package/src/scripts/_lib/svg_motion.ts +208 -0
- package/src/scripts/_lib/svg_rules.ts +1455 -0
- package/src/scripts/_lib/svg_urls.ts +72 -0
- package/src/scripts/_lib/test_delta.ts +89 -6
- package/src/scripts/_lib/tier_downshift_verdict.ts +222 -0
- package/src/scripts/_lib/tool_result_census.ts +62 -0
- package/src/scripts/_lib/trigger_routers.ts +1 -0
- package/src/scripts/_lib/turnaround_throughput.ts +378 -0
- package/src/scripts/_lib/ui_surface.ts +22 -0
- package/src/scripts/_lib/unattended_gates.ts +100 -0
- package/src/scripts/_lib/undeployed_fixes.ts +34 -0
- package/src/scripts/_lib/update_check.ts +143 -12
- package/src/scripts/_lib/update_invite.ts +116 -0
- package/src/scripts/_lib/update_notice.ts +259 -0
- package/src/scripts/_lib/verification_command.ts +59 -0
- package/src/scripts/_lib/verify_clause.ts +31 -19
- package/src/scripts/_lib/version_order.ts +146 -0
- package/src/scripts/_lib/worker_reuse.ts +191 -0
- package/src/scripts/_lib/workspace_secrets.ts +273 -0
- package/src/scripts/_lib/worktree_git.ts +67 -0
- package/src/scripts/_lib/worktree_ignored.ts +116 -0
- package/src/scripts/adoption_status.ts +330 -3
- package/src/scripts/adr_cite_check.ts +93 -0
- package/src/scripts/advisories.ts +803 -0
- package/src/scripts/ai-image/adapters/flux.sh +1 -0
- package/src/scripts/ai-image/adapters/gemini-image.sh +1 -0
- package/src/scripts/ai-image/adapters/ideogram.sh +1 -0
- package/src/scripts/ai-image/adapters/recraft.sh +1 -0
- package/src/scripts/ai-video/adapters/comfyui.sh +1 -0
- package/src/scripts/ai-video/adapters/fal.sh +1 -0
- package/src/scripts/ai-video/adapters/gemini-veo.sh +1 -0
- package/src/scripts/ai-video/adapters/higgsfield.sh +1 -0
- package/src/scripts/ai-video/adapters/kling.sh +1 -0
- package/src/scripts/ai-video/adapters/musetalk.sh +1 -0
- package/src/scripts/ai-video/adapters/openai-images.sh +1 -0
- package/src/scripts/ai-video/adapters/replicate.sh +1 -0
- package/src/scripts/ai-video/adapters/sora.sh +1 -0
- package/src/scripts/ai-video/adapters/syncso.sh +1 -0
- package/src/scripts/ai-video/stitch.sh +115 -2
- package/src/scripts/ai_council/airgap.ts +1 -0
- package/src/scripts/ai_council/api_transport.ts +27 -4
- package/src/scripts/ai_council/budget_guard.ts +300 -11
- package/src/scripts/ai_council/bundler.ts +20 -29
- package/src/scripts/ai_council/chairman.ts +17 -2
- package/src/scripts/ai_council/cli_agency_bounds.ts +158 -0
- package/src/scripts/ai_council/cli_launch_env.ts +54 -0
- package/src/scripts/ai_council/cli_least_agency_canary.ts +18 -2
- package/src/scripts/ai_council/clients.ts +55 -73
- package/src/scripts/ai_council/config.ts +16 -22
- package/src/scripts/ai_council/council_egress.ts +167 -0
- package/src/scripts/ai_council/exposure_ledger.ts +117 -0
- package/src/scripts/ai_council/free_hand_shadow.ts +276 -0
- package/src/scripts/ai_council/free_route.ts +216 -0
- package/src/scripts/ai_council/free_route_catalog.ts +173 -0
- package/src/scripts/ai_council/free_route_client.ts +95 -0
- package/src/scripts/ai_council/free_rung.ts +61 -0
- package/src/scripts/ai_council/hand_payload.ts +230 -0
- package/src/scripts/ai_council/hand_schemas.ts +123 -0
- package/src/scripts/ai_council/jury_aggregate.ts +155 -1
- package/src/scripts/ai_council/kind_flip.ts +221 -0
- package/src/scripts/ai_council/kind_flip_state.ts +19 -0
- package/src/scripts/ai_council/learn_low_impact_preview.ts +50 -22
- package/src/scripts/ai_council/modification_review.ts +98 -5
- package/src/scripts/ai_council/necessity.ts +7 -0
- package/src/scripts/ai_council/orchestrator.ts +16 -16
- package/src/scripts/ai_council/pricing.ts +10 -0
- package/src/scripts/ai_council/redact_low_impact_entry.ts +5 -2
- package/src/scripts/ai_council/response_render.ts +27 -4
- package/src/scripts/ai_council/round_reservations.ts +119 -0
- package/src/scripts/ai_council/route_chooser.ts +161 -0
- package/src/scripts/ai_council/route_liveness.ts +152 -0
- package/src/scripts/ai_council/route_member.ts +52 -0
- package/src/scripts/ai_council/seat_policy.ts +40 -0
- package/src/scripts/ai_council/seat_resume.ts +40 -0
- package/src/scripts/ai_council/shadow_dispatch.ts +13 -3
- package/src/scripts/ai_council/spend_gate.ts +18 -2
- package/src/scripts/ai_council/status_surface.ts +37 -0
- package/src/scripts/ai_council/transport_resolver.ts +15 -18
- package/src/scripts/analysis_analysts.ts +226 -0
- package/src/scripts/analysis_anchors.ts +140 -0
- package/src/scripts/analysis_and_optimize.ts +44 -0
- package/src/scripts/analysis_emit.ts +150 -0
- package/src/scripts/analysis_exchange.ts +186 -0
- package/src/scripts/analysis_gate.ts +158 -0
- package/src/scripts/analysis_inbox_final.ts +173 -0
- package/src/scripts/analysis_ledger.ts +119 -0
- package/src/scripts/analysis_pr_optimize.ts +219 -0
- package/src/scripts/analysis_pr_review.ts +240 -0
- package/src/scripts/analysis_pr_target.ts +121 -0
- package/src/scripts/analysis_prompts.ts +130 -0
- package/src/scripts/analysis_publish.ts +358 -0
- package/src/scripts/analysis_questions.ts +78 -0
- package/src/scripts/analysis_run.ts +248 -0
- package/src/scripts/analysis_run_record.ts +210 -0
- package/src/scripts/analysis_target.ts +343 -0
- package/src/scripts/analysis_validate.ts +161 -0
- package/src/scripts/anchor_eval_falsify.ts +1 -1
- package/src/scripts/arrival_report.ts +115 -0
- package/src/scripts/ask_transport.ts +284 -35
- package/src/scripts/backfill_model_tier.ts +4 -5
- package/src/scripts/before_complete_hook.ts +48 -2
- package/src/scripts/bench_hook_latency.ts +3 -3
- package/src/scripts/bench_procedure_cursor.ts +440 -0
- package/src/scripts/bootstrap.sh +3 -3
- package/src/scripts/build_exit_code_register.ts +440 -0
- package/src/scripts/build_proof.ts +23 -1
- package/src/scripts/cache_realization_report.ts +155 -14
- package/src/scripts/canary_liveness.ts +117 -0
- package/src/scripts/chat_history.ts +12 -15
- package/src/scripts/check_account_surface.ts +318 -0
- package/src/scripts/check_agent_artifact_location.ts +17 -160
- package/src/scripts/check_bundle_path_leakage.ts +6 -0
- package/src/scripts/check_ci_local_parity.ts +21 -13
- package/src/scripts/check_claims.ts +77 -2
- package/src/scripts/check_completion_review.ts +34 -1
- package/src/scripts/check_concern_admissions.ts +41 -5
- package/src/scripts/check_consumer_scope_flip.ts +1 -1
- package/src/scripts/check_context_paths.ts +2 -0
- package/src/scripts/check_council_layout.ts +9 -0
- package/src/scripts/check_credential_spelling.ts +267 -0
- package/src/scripts/check_egress_mutations.ts +239 -0
- package/src/scripts/check_enforcement_coverage.ts +16 -3
- package/src/scripts/check_estate_count.ts +16 -1
- package/src/scripts/check_finding_dispositions.ts +147 -0
- package/src/scripts/check_gate_coverage.ts +123 -21
- package/src/scripts/check_gate_reachability.ts +16 -2
- package/src/scripts/check_generator_sync.ts +46 -0
- package/src/scripts/check_hook_bundle_composition.ts +139 -1
- package/src/scripts/check_host_docs_digest.ts +142 -5
- package/src/scripts/check_kernel_edit_ratified.ts +301 -76
- package/src/scripts/check_kernel_rule_bundle.ts +14 -10
- package/src/scripts/check_knowledge_cards.ts +83 -3
- package/src/scripts/check_memory.ts +13 -3
- package/src/scripts/check_pack_size.ts +1 -1
- package/src/scripts/check_permission_deny_syntax.ts +247 -0
- package/src/scripts/check_platform_anchor.ts +243 -0
- package/src/scripts/check_proposal.ts +183 -1
- package/src/scripts/check_reach_channels.ts +5 -3
- package/src/scripts/check_references.ts +5 -2
- package/src/scripts/check_release_manifest_content.ts +33 -0
- package/src/scripts/check_release_pr_shape.ts +5 -0
- package/src/scripts/check_rule_invariants.ts +9 -1
- package/src/scripts/check_skill_body_budget.ts +343 -0
- package/src/scripts/check_skill_requires.ts +137 -1
- package/src/scripts/check_step_receipts.ts +246 -0
- package/src/scripts/check_structural_breaking.ts +7 -1
- package/src/scripts/check_suppression_hygiene.ts +8 -0
- package/src/scripts/check_test_weakening.ts +14 -0
- package/src/scripts/check_token_quality_golden.ts +5 -1
- package/src/scripts/check_update_banner.ts +50 -3
- package/src/scripts/check_verify_expectation_delta.ts +2 -1
- package/src/scripts/check_voice_lexicon.ts +531 -0
- package/src/scripts/ci_os_attribution.ts +327 -0
- package/src/scripts/ci_platform_scope.ts +69 -0
- package/src/scripts/ci_settle.ts +4 -1
- package/src/scripts/ci_status.ts +0 -1
- package/src/scripts/ci_time_to_green.ts +748 -0
- package/src/scripts/classify_merge_risk.ts +407 -19
- package/src/scripts/code_graph/sqlite_store.ts +1 -1
- package/src/scripts/compile_trigger_evals.ts +353 -0
- package/src/scripts/condense.ts +25 -31
- package/src/scripts/consumer_matrix.ts +61 -3
- package/src/scripts/council_availability_hook.ts +12 -4
- package/src/scripts/council_cli.ts +48 -38
- package/src/scripts/cross_repo_retrieve.ts +9 -72
- package/src/scripts/design_lock.ts +106 -0
- package/src/scripts/design_slop_rules.ts +30 -0
- package/src/scripts/design_sync.ts +264 -0
- package/src/scripts/design_system_import.ts +30 -13
- package/src/scripts/dispatch_economy_report.ts +46 -1
- package/src/scripts/dispatch_r2_reviewer.ts +41 -5
- package/src/scripts/egress_canary.ts +166 -0
- package/src/scripts/egress_sender_census.ts +101 -0
- package/src/scripts/external_sources_denylist.json +94 -12
- package/src/scripts/generate_catalog.ts +6 -2
- package/src/scripts/generate_owned_digest.ts +163 -0
- package/src/scripts/generate_reference_toc.ts +143 -0
- package/src/scripts/generate_subagent_floor.ts +11 -1
- package/src/scripts/handoff_context_hook.ts +34 -0
- package/src/scripts/hook_carrier_census.ts +263 -0
- package/src/scripts/hook_chunks.d.mts +12 -0
- package/src/scripts/hook_chunks.mjs +114 -0
- package/src/scripts/hook_manifest.json +1 -1
- package/src/scripts/hook_manifest.yaml +65 -42
- package/src/scripts/hooks/block_config_weakening.ts +127 -3
- package/src/scripts/hooks/block_credential_reads.ts +165 -0
- package/src/scripts/hooks/block_no_verify.ts +47 -23
- package/src/scripts/hooks/block_speaking_inbox_dir.ts +54 -8
- package/src/scripts/hooks/category_a.ts +202 -25
- package/src/scripts/hooks/concern_failure_policy.ts +6 -6
- package/src/scripts/hooks/concern_registry.ts +31 -6
- package/src/scripts/hooks/concern_registry_types.ts +11 -0
- package/src/scripts/hooks/delegation_nudge_hook.ts +105 -15
- package/src/scripts/hooks/design_pass_hook.ts +199 -13
- package/src/scripts/hooks/dispatch_hook.ts +13 -12
- package/src/scripts/hooks/egress_engine_loader.ts +125 -0
- package/src/scripts/hooks/egress_stage.ts +440 -0
- package/src/scripts/hooks/hook_stdin.ts +29 -4
- package/src/scripts/hooks/host_docs_pages.ts +194 -0
- package/src/scripts/hooks/host_docs_pages.yaml +75 -0
- package/src/scripts/hooks/host_lowering.json +1 -1
- package/src/scripts/hooks/host_lowering.yaml +22 -21
- package/src/scripts/hooks/host_rate_marker_hook.ts +73 -0
- package/src/scripts/hooks/instructions_observer_hook.ts +170 -0
- package/src/scripts/hooks/interruption_ledger_hook.ts +1 -1
- package/src/scripts/hooks/lazy_concern.ts +148 -0
- package/src/scripts/hooks/orchestration_record_hook.ts +80 -2
- package/src/scripts/hooks/payload_stub.ts +16 -6
- package/src/scripts/hooks/permission_gate.ts +7 -7
- package/src/scripts/hooks/push_settle_hook.ts +32 -3
- package/src/scripts/hooks/replay_hook.ts +43 -0
- package/src/scripts/hooks/reread_guard_hook.ts +87 -10
- package/src/scripts/hooks/rtk_wrap_hook.ts +4 -3
- package/src/scripts/hooks/rule_inject_hook.ts +8 -1
- package/src/scripts/hooks/session_eol_hook.ts +48 -1
- package/src/scripts/hooks/source_first_gate_hook.ts +6 -8
- package/src/scripts/hooks/spawn_guard_shadow_hook.ts +203 -10
- package/src/scripts/hooks/state_io.ts +2 -2
- package/src/scripts/hooks/svg_obligation.ts +553 -0
- package/src/scripts/hooks/svg_rules_loader.ts +133 -0
- package/src/scripts/hooks/tool_result_bytes_hook.ts +14 -5
- package/src/scripts/hooks/turn_end_gate_hook.ts +5 -3
- package/src/scripts/hooks/ui_route_nudge_hook.ts +2 -12
- package/src/scripts/hooks_doctor.ts +31 -0
- package/src/scripts/hooks_status.ts +58 -3
- package/src/scripts/inbox_source_census.ts +74 -13
- package/src/scripts/install +25 -3
- package/src/scripts/install.ts +60 -91
- package/src/scripts/interruption_report.ts +11 -1
- package/src/scripts/layer_baseline_report.ts +267 -0
- package/src/scripts/learning_sidecar.ts +1 -1
- package/src/scripts/lint_agents_layout.ts +3 -0
- package/src/scripts/lint_blocker_citations.ts +104 -0
- package/src/scripts/lint_breaking_changes_index.ts +40 -7
- package/src/scripts/lint_consolidation_lineage.ts +150 -19
- package/src/scripts/lint_consumer_internal_refs.ts +90 -42
- package/src/scripts/lint_context_spine_usage.ts +21 -0
- package/src/scripts/lint_design_antipattern_parity.ts +39 -7
- package/src/scripts/lint_design_quality.ts +60 -12
- package/src/scripts/lint_evidence_artifacts.ts +31 -0
- package/src/scripts/lint_example_fences.ts +11 -2
- package/src/scripts/lint_ghostwriter_source.ts +42 -10
- package/src/scripts/lint_hook_manifest.ts +94 -0
- package/src/scripts/lint_marketplace_install_completeness.ts +4 -0
- package/src/scripts/lint_mcp_config_security.ts +9 -11
- package/src/scripts/lint_motion_authority_drift.ts +27 -0
- package/src/scripts/lint_plan_risk_register.ts +28 -1
- package/src/scripts/lint_positioning.ts +4 -4
- package/src/scripts/lint_provenance.ts +1 -0
- package/src/scripts/lint_roadmap_blockers.ts +65 -4
- package/src/scripts/lint_roadmap_complexity.ts +98 -0
- package/src/scripts/lint_skill_link_reach.ts +251 -9
- package/src/scripts/lint_skill_procedures.ts +252 -0
- package/src/scripts/lint_skill_scripts_readonly.ts +12 -1
- package/src/scripts/lint_subagent_determinism.ts +14 -1
- package/src/scripts/lint_svg_asset.ts +365 -0
- package/src/scripts/lint_ticked_unmet_criteria.ts +300 -21
- package/src/scripts/mcp_registry_submit.sh +2 -2
- package/src/scripts/mcp_server/consumer_tool_catalog.json +4 -4
- package/src/scripts/mcp_server/suggest_skill.ts +89 -4
- package/src/scripts/mcp_server/tools.ts +2 -33
- package/src/scripts/measure_skill_ranker_baseline.ts +203 -5
- package/src/scripts/measure_turn_end_gate.ts +61 -1
- package/src/scripts/merge_clearance.ts +225 -0
- package/src/scripts/migrate_command_suggestions.ts +1 -1
- package/src/scripts/network_sources.ts +236 -0
- package/src/scripts/no_go_deny_rows.ts +225 -0
- package/src/scripts/orchestration_record.ts +15 -2
- package/src/scripts/plan_test_shards.ts +103 -0
- package/src/scripts/pr_url_reminder_hook.ts +10 -0
- package/src/scripts/print_required_checks.ts +5 -5
- package/src/scripts/probe_depth_shadow.ts +406 -0
- package/src/scripts/probe_turnaround.ts +342 -10
- package/src/scripts/ratification_subject.ts +176 -0
- package/src/scripts/rdp_gate_classify.ts +1 -0
- package/src/scripts/rdp_quality_eval.ts +1 -0
- package/src/scripts/release.ts +26 -55
- package/src/scripts/release_drill.ts +52 -23
- package/src/scripts/release_env.ts +37 -0
- package/src/scripts/release_publication.ts +11 -1
- package/src/scripts/report_consumer_gate_reach.ts +233 -0
- package/src/scripts/report_merge_gate_load.ts +295 -0
- package/src/scripts/report_project_contract.ts +123 -0
- package/src/scripts/report_reducible_classes.ts +342 -0
- package/src/scripts/report_required_checks_drift.ts +5 -3
- package/src/scripts/report_skill_host_census.ts +199 -0
- package/src/scripts/report_standing_payload_by_host.ts +7 -7
- package/src/scripts/retro.ts +758 -0
- package/src/scripts/retro_facts.ts +575 -0
- package/src/scripts/retro_queue.ts +739 -0
- package/src/scripts/retro_session_facts.ts +218 -0
- package/src/scripts/retro_sweep.ts +493 -0
- package/src/scripts/retro_triage.ts +126 -0
- package/src/scripts/roadmap_context.ts +2 -2
- package/src/scripts/roadmap_drain_queue.ts +601 -0
- package/src/scripts/run_supervise.ts +24 -2
- package/src/scripts/schemas/agent-settings.schema.json +0 -16
- package/src/scripts/schemas/command.schema.json +3 -3
- package/src/scripts/schemas/review-findings.schema.json +8 -0
- package/src/scripts/schemas/skill.schema.json +7 -6
- package/src/scripts/schemas/subagent.schema.json +33 -2
- package/src/scripts/score_skill_selection.ts +5 -2
- package/src/scripts/second_brain_retrieval.ts +1 -0
- package/src/scripts/second_brain_run.ts +1 -0
- package/src/scripts/self_repair_cli.ts +563 -87
- package/src/scripts/self_review_gate.ts +59 -4
- package/src/scripts/session_register_hook.ts +91 -4
- package/src/scripts/sessions_cli.ts +100 -5
- package/src/scripts/skill_collision_clusters.ts +1 -1
- package/src/scripts/skill_tools/score_skill_relevance.ts +31 -2
- package/src/scripts/skill_trigger_eval.ts +4 -2
- package/src/scripts/source_adapters.ts +183 -0
- package/src/scripts/step_receipt.ts +100 -0
- package/src/scripts/sync_pr_branch.ts +4 -0
- package/src/scripts/test_council_qualification.ts +1 -1
- package/src/scripts/trigger_eval_grandfather.json +3 -49
- package/src/scripts/trigger_eval_rotation.ts +31 -3
- package/src/scripts/ui_conformance_probe.ts +405 -1
- package/src/scripts/update_counts.ts +230 -11
- package/src/scripts/update_invite_hook.ts +245 -0
- package/src/scripts/update_notice_hook.ts +298 -0
- package/src/scripts/validate_frontmatter.ts +85 -0
- package/src/scripts/worker_reuse_shadow_report.ts +121 -0
- package/src/scripts/worktree_cleanup_check.ts +915 -121
- package/src/server/io/yamlIO.ts +2 -2
- package/src/server/schemas/settings.ts +37 -23
- package/src/shared/brandTokenDocument.ts +46 -0
- package/src/shared/brandTokenPaths.ts +43 -0
- package/src/shared/settingsCarveOut.ts +0 -8
- package/src/shared/skillRanking.ts +106 -5
- package/src/shared/userMd/formAdapter.ts +15 -1
- package/src/shared/userMd/schema.ts +22 -0
- package/src/templates/agent-user.md +4 -0
- package/src/templates/agent-user.yml +4 -0
- package/dist/cli-delegate/chunk-523HCFYO.js +0 -90
- package/dist/cli-delegate/chunk-AL3RZ22D.js +0 -74
- package/dist/cli-delegate/chunk-KB5FZ655.js +0 -208
- package/dist/cli-delegate/chunk-MDPPKQCQ.js +0 -875
- package/dist/cli-delegate/chunk-MSUL5NYP.js +0 -1123
- package/dist/cli-delegate/chunk-OAFSJBHH.js +0 -272
- package/dist/ui/assets/index-C3djEJah.js +0 -23
- package/src/scripts/_lib/continuation_ladder.ts +0 -335
- package/src/scripts/hooks/run_continuation_hook.ts +0 -1524
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,ee={},h=[],g=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,te=Array.isArray;function _(e,t){for(var n in t)e[n]=t[n];return e}function ne(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function v(t,n,r){var i,a,o,s={};for(o in n)o==`key`?i=n[o]:o==`ref`?a=n[o]:s[o]=n[o];if(arguments.length>2&&(s.children=arguments.length>3?e.call(arguments,2):r),typeof t==`function`&&t.defaultProps!=null)for(o in t.defaultProps)s[o]===void 0&&(s[o]=t.defaultProps[o]);return y(t,s,i,a,null)}function y(e,r,i,a,o){var s={type:e,props:r,key:i,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++n,__i:-1,__u:0};return o==null&&t.vnode!=null&&t.vnode(s),s}function b(e){return e.children}function re(e,t){this.props=e,this.context=t}function ie(e,t){if(t==null)return e.__?ie(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?ie(e):null}function ae(e){if(e.__P&&e.__d){var n=e.__v,r=n.__e,i=[],a=[],o=_({},n);o.__v=n.__v+1,t.vnode&&t.vnode(o),he(e.__P,o,n,e.__n,e.__P.namespaceURI,32&n.__u?[r]:null,i,r??ie(n),!!(32&n.__u),a),o.__v=n.__v,o.__.__k[o.__i]=o,_e(i,o,a),n.__e=n.__=null,o.__e!=r&&oe(o)}}function oe(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),oe(e)}function se(e){(!e.__d&&(e.__d=!0)&&i.push(e)&&!ce.__r++||a!=t.debounceRendering)&&((a=t.debounceRendering)||o)(ce)}function ce(){try{for(var e,t=1;i.length;)i.length>t&&i.sort(s),e=i.shift(),t=i.length,ae(e)}finally{i.length=ce.__r=0}}function le(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,g,te,_=r&&r.__k||h,ne=t.length;for(c=ue(n,t,_,c,ne),d=0;d<ne;d++)(p=n.__k[d])!=null&&(f=p.__i!=-1&&_[p.__i]||ee,p.__i=d,te=he(e,p,f,i,a,o,s,c,l,u),m=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&be(f.ref,null,p),u.push(p.ref,p.__c||m,p)),g==null&&m!=null&&(g=m),4&p.__u?(c=de(p,c,e),f.__e&&(f.__e=null)):typeof p.type==`function`&&te!==void 0?c=te:m&&(c=m.nextSibling),p.__u&=-7);return n.__e=g,c}function ue(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?o=e.__k[a]=y(null,o,null,null,null):te(o)?o=e.__k[a]=y(b,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=e.__k[a]=y(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[a]=o,c=a+f,o.__=e,o.__b=e.__b+1,s=null,(l=o.__i=fe(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=ie(s)),xe(s,s));return r}function de(e,t,n){var r,i;if(typeof e.type==`function`){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=de(r[i],t,n));return t}e.__e!=t&&(t&&e.type&&!t.parentNode&&(t=ie(e)),t=n.insertBefore(e.__e,t||null));do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function fe(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&!(2&l.__u);if(l===null&&s==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function pe(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n==null?``:typeof n!=`number`||g.test(t)?n:n+`px`}function x(e,t,n,r,i){var a,o;n:if(t==`style`){if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||pe(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||pe(e.style,t,n[t])}}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(d,`$1`)),o=t.toLowerCase(),t=o in e||t==`onFocusOut`||t==`onFocusIn`?o.slice(2):t.slice(2),e.l||={},e.l[t+a]=n,n?r?n[u]=r[u]:(n[u]=f,e.addEventListener(t,a?m:p,a)):e.removeEventListener(t,a?m:p,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function me(e){return function(n){if(this.l){var r=this.l[n.type+e];if(n[l]==null)n[l]=f++;else if(n[l]<r[u])return;return r(t.event?t.event(n):n)}}}function he(e,n,r,i,a,o,s,c,l,u){var d,f,p,m,ee,g,v,y,ae,oe,se,ce,ue,de,fe,pe,x=n.type;if(n.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),o=[c=n.__e=r.__e]),(d=t.__b)&&d(n);n:if(typeof x==`function`){f=s.length;try{if(ae=n.props,oe=x.prototype&&x.prototype.render,se=(d=x.contextType)&&i[d.__c],ce=d?se?se.props.value:d.__:i,r.__c?y=(p=n.__c=r.__c).__=p.__E:(oe?n.__c=p=new x(ae,ce):(n.__c=p=new re(ae,ce),p.constructor=x,p.render=Se),se&&se.sub(p),p.state||(p.state={}),p.__n=i,m=p.__d=!0,p.__h=[],p._sb=[]),oe&&p.__s==null&&(p.__s=p.state),oe&&x.getDerivedStateFromProps!=null&&(p.__s==p.state&&(p.__s=_({},p.__s)),_(p.__s,x.getDerivedStateFromProps(ae,p.__s))),ee=p.props,g=p.state,p.__v=n,m)oe&&x.getDerivedStateFromProps==null&&p.componentWillMount!=null&&p.componentWillMount(),oe&&p.componentDidMount!=null&&p.__h.push(p.componentDidMount);else{if(oe&&x.getDerivedStateFromProps==null&&ae!==ee&&p.componentWillReceiveProps!=null&&p.componentWillReceiveProps(ae,ce),n.__v==r.__v||!p.__e&&p.shouldComponentUpdate!=null&&!1===p.shouldComponentUpdate(ae,p.__s,ce)){n.__v!=r.__v&&(p.props=ae,p.state=p.__s,p.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.some(function(e){e&&(e.__=n)}),h.push.apply(p.__h,p._sb),p._sb=[],p.__h.length&&s.push(p),c=ie(r);break n}p.componentWillUpdate!=null&&p.componentWillUpdate(ae,p.__s,ce),oe&&p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(ee,g,v)})}if(p.context=ce,p.props=ae,p.__P=e,p.__e=!1,ue=t.__r,de=0,oe)p.state=p.__s,p.__d=!1,ue&&ue(n),d=p.render(p.props,p.state,p.context),h.push.apply(p.__h,p._sb),p._sb=[];else do p.__d=!1,ue&&ue(n),d=p.render(p.props,p.state,p.context),p.state=p.__s;while(p.__d&&++de<25);p.state=p.__s,p.getChildContext!=null&&(i=_(_({},i),p.getChildContext())),oe&&!m&&p.getSnapshotBeforeUpdate!=null&&(v=p.getSnapshotBeforeUpdate(ee,g)),fe=d!=null&&d.type===b&&d.key==null?ve(d.props.children):d,c=le(e,te(fe)?fe:[fe],n,r,i,a,o,s,c,l,u),p.base=n.__e,n.__u&=-161,p.__h.length&&s.push(p),y&&(p.__E=p.__=null)}catch(e){if(s.length=f,n.__v=null,l||o!=null){if(e.then){for(n.__u|=l?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;o!=null&&(o[o.indexOf(c)]=null),n.__e=c}else if(o!=null)for(pe=o.length;pe--;)ne(o[pe])}else n.__e=r.__e;n.__k??=r.__k||[],e.then||ge(n),t.__e(e,n,r)}}else o==null&&n.__v==r.__v?(n.__k=r.__k,n.__e=r.__e):c=n.__e=ye(r.__e,n,r,i,a,o,s,l,u);return(d=t.diffed)&&d(n),128&n.__u?void 0:c}function ge(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(ge))}function _e(e,n,r){for(var i=0;i<r.length;i++)be(r[i],r[++i],r[++i]);t.__c&&t.__c(n,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(e){e.call(n)})}catch(e){t.__e(e,n.__v)}})}function ve(e){return typeof e!=`object`||!e||e.__b>0?e:te(e)?e.map(ve):e.constructor===void 0?_({},e):null}function ye(n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_,v=i.props||ee,y=r.props,b=r.type;if(b==`svg`?o=`http://www.w3.org/2000/svg`:b==`math`?o=`http://www.w3.org/1998/Math/MathML`:o||=`http://www.w3.org/1999/xhtml`,s!=null){for(d=0;d<s.length;d++)if((h=s[d])&&`setAttribute`in h==!!b&&(b?h.localName==b:h.nodeType==3)){n=h,s[d]=null;break}}if(n==null){if(b==null)return document.createTextNode(y);n=document.createElementNS(o,b,y.is&&y),l&&=(t.__m&&t.__m(r,s),!1),s=null}if(b==null)v===y||l&&n.data==y||(n.data=y);else{if(s=b==`textarea`&&y.defaultValue!=null?null:s&&e.call(n.childNodes),!l&&s!=null)for(v={},d=0;d<n.attributes.length;d++)v[(h=n.attributes[d]).name]=h.value;for(d in v)h=v[d],d==`dangerouslySetInnerHTML`?p=h:d==`children`||d in y||d==`value`&&`defaultValue`in y||d==`checked`&&`defaultChecked`in y||x(n,d,null,h,o);for(d in y)h=y[d],d==`children`?m=h:d==`dangerouslySetInnerHTML`?f=h:d==`value`?g=h:d==`checked`?_=h:l&&typeof h!=`function`||v[d]===h||x(n,d,h,v[d],o);if(f)l||p&&(f.__html==p.__html||f.__html==n.innerHTML)||(n.innerHTML=f.__html),r.__k=[];else if(p&&(n.innerHTML=``),le(r.type==`template`?n.content:n,te(m)?m:[m],r,i,a,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:o,s,c,s?s[0]:i.__k&&ie(i,0),l,u),s!=null)for(d=s.length;d--;)ne(s[d]);l&&b!=`textarea`||(d=`value`,b==`progress`&&g==null?n.removeAttribute(`value`):g!=null&&(g!==n[d]||b==`progress`&&!g||b==`option`&&g!=v[d])&&x(n,d,g,v[d],o),d=`checked`,_!=null&&_!=n[d]&&x(n,d,_,v[d],o))}return n}function be(e,n,r){try{if(typeof e==`function`){var i=typeof e.__u==`function`;i&&e.__u(),i&&n==null||(e.__u=e(n))}else e.current=n}catch(e){t.__e(e,r)}}function xe(e,n,r){var i,a;if(t.unmount&&t.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||be(i,null,n)),(i=e.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){t.__e(e,n)}i.base=i.__P=i.__n=null}if(i=e.__k)for(a=0;a<i.length;a++)i[a]&&xe(i[a],n,r||typeof e.type!=`function`);r||ne(e.__e),e.__c=e.__=e.__e=void 0}function Se(e,t,n){return this.constructor(e,n)}function Ce(n,r,i){var a,o,s,c;r==document&&(r=document.documentElement),t.__&&t.__(n,r),o=(a=typeof i==`function`)?null:i&&i.__k||r.__k,s=[],c=[],he(r,n=(!a&&i||r).__k=v(b,null,[n]),o||ee,ee,r.namespaceURI,!a&&i?[i]:o?null:r.firstChild?e.call(r.childNodes):null,s,!a&&i?i:o?o.__e:r.firstChild,a,c),_e(s,n,c),n.props.children=null}e=h.slice,t={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},n=0,r=function(e){return e!=null&&e.constructor===void 0},re.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=_({},this.state);typeof e==`function`&&(e=e(_({},n),this.props)),e&&_(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),se(this))},re.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),se(this))},re.prototype.render=b,i=[],o=typeof Promise==`function`?Promise.prototype.then.bind(Promise.resolve()):setTimeout,s=function(e,t){return e.__v.__b-t.__v.__b},ce.__r=0,c=Math.random().toString(8),l=`__d`+c,u=`__a`+c,d=/(PointerCapture)$|Capture$/i,f=0,p=me(!1),m=me(!0);var we,S,Te,Ee,De=0,Oe=[],C=t,ke=C.__b,Ae=C.__r,je=C.diffed,Me=C.__c,Ne=C.unmount,Pe=C.__;function Fe(e,t){C.__h&&C.__h(S,e,De||t),De=0;var n=S.__H||(S.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function Ie(e){return De=1,Le(Ke,e)}function Le(e,t,n){var r=Fe(we++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Ke(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=S,!S.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=!1,o=r.__c.props!==e;if(r.__c.__H.__.some(function(e){if(e.__N){i=!0;var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),a){var s=a.call(this,e,t,n);return i?s||o:s}return!i||o};S.__f=!0;var a=S.shouldComponentUpdate,o=S.componentWillUpdate;S.componentWillUpdate=function(e,t,n){if(this.__e){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},S.shouldComponentUpdate=i}return r.__N||r.__}function Re(e,t){var n=Fe(we++,3);!C.__s&&Ge(n.__H,t)&&(n.__=e,n.u=t,S.__H.__h.push(n))}function ze(e,t){var n=Fe(we++,7);return Ge(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Be(){for(var e;e=Oe.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Ue),t.__h.some(We),t.__h=[]}catch(n){t.__h=[],C.__e(n,e.__v)}}}C.__b=function(e){S=null,ke&&ke(e)},C.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Pe&&Pe(e,t)},C.__r=function(e){Ae&&Ae(e),we=0;var t=(S=e.__c).__H;t&&(Te===S?(t.__h=[],S.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(Ue),t.__h.some(We),t.__h=[],we=0)),Te=S},C.diffed=function(e){je&&je(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Oe.push(t)!==1&&Ee===C.requestAnimationFrame||((Ee=C.requestAnimationFrame)||He)(Be)),t.__H.__.some(function(e){e.u&&=(e.__H=e.u,void 0)})),Te=S=null},C.__c=function(e,t){t.some(function(e){try{e.__h.some(Ue),e.__h=e.__h.filter(function(e){return!e.__||We(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],C.__e(n,e.__v)}}),Me&&Me(e,t)},C.unmount=function(e){Ne&&Ne(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{Ue(e)}catch(e){t=e}}),n.__H=void 0,t&&C.__e(t,n.__v))};var Ve=typeof requestAnimationFrame==`function`;function He(e){var t,n=function(){clearTimeout(r),Ve&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Ve&&(t=requestAnimationFrame(n))}function Ue(e){var t=S,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),S=t}function We(e){var t=S;e.__c=e.__(),S=t}function Ge(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function Ke(e,t){return typeof t==`function`?t(e):t}var qe=Symbol.for(`preact-signals`);function Je(){if($e>1)$e--;else{var e,t=!1;for((function(){var e=rt;for(rt=void 0;e!==void 0;){var t=e.S;if(t.v===e.v)for(var n=t.t;n!==void 0;n=n.x)n.i===e.i&&(n.i=t.i);e=e.o}})();Qe!==void 0;){var n=Qe;for(Qe=void 0,et++;n!==void 0;){var r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&ot(n))try{n.c()}catch(n){t||=(e=n,!0)}n=r}}if(et=0,$e--,t)throw e}}function Ye(e){if($e>0)return e();nt=++tt,$e++;try{return e()}finally{Je()}}var Xe,w=void 0;function Ze(e){var t=w,n=Xe;w=void 0,Xe=void 0;try{return e()}finally{w=t,Xe=n}}var Qe=void 0,$e=0,et=0,tt=0,nt=0,rt=void 0,it=0;function at(e){if(w!==void 0){var t=e.n;if(t===void 0||t.t!==w)return t={i:0,S:e,p:w.s,n:void 0,t:w,e:void 0,x:void 0,r:t},w.s!==void 0&&(w.s.n=t),w.s=t,e.n=t,32&w.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=w.s,t.n=void 0,w.s.n=t,w.s=t),t}}function T(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}T.prototype.brand=qe,T.prototype.h=function(){return!0},T.prototype.S=function(e){var t=this,n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n===void 0?Ze(function(){var e;(e=t.W)==null||e.call(t)}):n.e=e)},T.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,r=e.x;n!==void 0&&(n.x=r,e.e=void 0),r!==void 0&&(r.e=n,e.x=void 0),e===this.t&&(this.t=r,r===void 0&&Ze(function(){var e;(e=t.Z)==null||e.call(t)}))}},T.prototype.subscribe=function(e){var t=this;return ht(function(){var n=t.value;Ze(function(){return e(n)})},{name:`sub`})},T.prototype.valueOf=function(){return this.value},T.prototype.toString=function(){return this.value+``},T.prototype.toJSON=function(){return this.value},T.prototype.peek=function(){var e=this;return Ze(function(){return e.value})},Object.defineProperty(T.prototype,"value",{get:function(){var e=at(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(et>100)throw Error(`Cycle detected`);(function(e){$e!==0&&et===0&&e.l!==nt&&(e.l=nt,rt={S:e,v:e.v,i:e.i,o:rt})})(this),this.v=e,this.i++,it++,$e++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Je()}}}});function E(e,t){return new T(e,t)}function ot(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function st(e){for(var t=e.s;t!==void 0;t=t.n){var n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function ct(e){for(var t=e.s,n=void 0;t!==void 0;){var r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}e.s=n}function lt(e,t){T.call(this,void 0,t),this.x=e,this.s=void 0,this.g=it-1,this.f=4}lt.prototype=new T,lt.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===it))return!0;if(this.g=it,this.f|=1,this.i>0&&!ot(this))return this.f&=-2,!0;var e=w;try{st(this),w=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return w=e,ct(this),this.f&=-2,!0},lt.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}T.prototype.S.call(this,e)},lt.prototype.U=function(e){if(this.t!==void 0&&(T.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}},lt.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(lt.prototype,"value",{get:function(){if(1&this.f)throw Error(`Cycle detected`);var e=at(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function ut(e,t){return new lt(e,t)}function dt(e){var t=e.m;if(e.m=void 0,typeof t==`function`){$e++;var n=w;w=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,ft(e),t}finally{w=n,Je()}}}function ft(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,dt(e)}function pt(e){if(w!==this)throw Error(`Out-of-order effect`);ct(this),w=e,this.f&=-2,8&this.f&&ft(this),Je()}function mt(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,Xe&&Xe.push(this)}mt.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t==`function`&&(this.m=t)}finally{e()}},mt.prototype.S=function(){if(1&this.f)throw Error(`Cycle detected`);this.f|=1,this.f&=-9,dt(this),st(this),$e++;var e=w;return w=this,pt.bind(this,e)},mt.prototype.N=function(){2&this.f||(this.f|=2,this.u=Qe,Qe=this)},mt.prototype.d=function(){this.f|=8,1&this.f||ft(this)},mt.prototype.dispose=function(){this.d()};function ht(e,t){var n=new mt(e,t);try{n.c()}catch(e){throw n.d(),e}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}var gt,_t,vt=typeof window<`u`&&!!window.__PREACT_SIGNALS_DEVTOOLS__,yt=[];ht(function(){gt=this.N})();function bt(e,n){t[e]=n.bind(null,t[e]||function(){})}function xt(e){if(_t){var t=_t;_t=void 0,t()}_t=e&&e.S()}function St(e){var t=this,n=e.data,i=wt(n);i.name=`ReactiveDom`,i.value=n;var a=ze(function(){for(var e=t,n=t.__v;n=n.__;)if(n.__c){n.__c.__$f|=4;break}var a=ut(function(){var e=i.value.value;return e===0?0:!0===e?``:e||``}),o=ut(function(){return!Array.isArray(a.value)&&!r(a.value)}),s=ht(function(){if(this.N=Dt,o.value){var t=a.value;e.__v&&e.__v.__e&&e.__v.__e.nodeType===3&&(e.__v.__e.data=t)}}),c=t.__$u.d;return t.__$u.d=function(){s(),c.call(this)},[o,a]},[]),o=a[0],s=a[1];return o.value?s.peek():s.value}St.displayName=`ReactiveTextNode`,Object.defineProperties(T.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:St},props:{configurable:!0,get:function(){var e=this;return{data:{get value(){return e.value}}}}},__b:{configurable:!0,value:1}}),bt(`__b`,function(e,t){if(typeof t.type==`string`){var n,r=t.props;for(var i in r)if(i!==`children`){var a=r[i];a instanceof T&&(n||(t.__np=n={}),n[i]=a,r[i]=a.peek())}}e(t)}),bt(`__r`,function(e,t){if(e(t),t.type!==b){xt();var n,r=t.__c;r&&(r.__$f&=-2,(n=r.__$u)===void 0&&(r.__$u=n=function(e,t){var n;return ht(function(){n=this},{name:t}),n.c=e,n}(function(e){return function(){var t;vt&&((t=this.y)==null||t.call(this)),e.__$f|=1,e.setState({})}}(r),typeof t.type==`function`?t.type.displayName||t.type.name:``))),xt(n)}}),bt(`__e`,function(e,t,n,r){xt(),e(t,n,r)}),bt(`diffed`,function(e,t){xt();var n;if(typeof t.type==`string`&&(n=t.__e)){var r=t.__np,i=t.props,a=n.U;if(a)for(var o in a){var s=a[o];s===void 0||r&&o in r||(s.d(),a[o]=void 0)}if(r)for(var c in a||(a={},n.U=a),r){var l=a[c],u=r[c];l===void 0?(l=Ct(n,c,u,i),a[c]=l):l.o(u,i)}}e(t)});function Ct(e,t,n,r){var i=t in e&&e.ownerSVGElement===void 0,a=E(n);return{o:function(e,t){a.value=e,r=t},d:ht(function(){this.N=Dt;var n=a.value.value;r[t]!==n&&(r[t]=n,i?e[t]=n:n!=null&&(!1!==n||t[4]===`-`)?e.setAttribute(t,n):e.removeAttribute(t))})}}bt(`unmount`,function(e,t){if(typeof t.type==`string`){var n=t.__e;if(n){var r=n.U;if(r)for(var i in n.U=void 0,r){var a=r[i];a&&a.d()}}var o=t.__np;if(o){var s=t.props;for(var c in o)s[c]=o[c]}t.__np=void 0}else{var l=t.__c;if(l){var u=l.__$u;u&&(l.__$u=void 0,u.d())}}e(t)}),bt(`__h`,function(e,t,n,r){r<3&&(t.__$f|=2),e(t,n,r)}),re.prototype.shouldComponentUpdate=function(e,t){if(this.__R)return!0;var n=this.__$u,r=n&&n.s!==void 0;for(var i in t)return!0;if(this.__f||typeof this.u==`boolean`&&!0===this.u){var a=2&this.__$f;if(!(r||a||4&this.__$f)||1&this.__$f)return!0}else if(!(r||4&this.__$f)||3&this.__$f)return!0;for(var o in e)if(o!==`__source`&&e[o]!==this.props[o])return!0;for(var s in this.props)if(!(s in e))return!0;return!1};function wt(e,t){return ze(function(){return E(e,t)},[])}var Tt=function(e){queueMicrotask(function(){queueMicrotask(e)})};function Et(){Ye(function(){for(var e;e=yt.shift();)gt.call(e)})}function Dt(){yt.push(this)===1&&(t.requestAnimationFrame||Tt)(Et)}function Ot(){let e=window.location.hash;return e===``||e===`#`?`/`:e.startsWith(`#`)?e.slice(1):e}var kt=E(Ot());function At(e){let t=e.startsWith(`/`)?e:`/${e}`;`#${t}`!==window.location.hash&&(window.location.hash=t)}var jt=!1;function Mt(){jt||(jt=!0,window.addEventListener(`hashchange`,()=>{kt.value=Ot()}))}var Nt=null;function Pt(e){Nt=e}var D=class extends Error{status;body;constructor(e,t,n){super(n),this.status=e,this.body=t}};async function O(e,t={}){let n={Accept:`application/json`,...t.headers??{}};Nt!==null&&(n.Authorization=`Bearer ${Nt}`);let{body:r,...i}=t,a={...i,headers:n};r!==void 0&&(a.body=JSON.stringify(r),n[`Content-Type`]=`application/json`);let o=await fetch(e,a),s=await o.text(),c=s===``?{}:JSON.parse(s);if(!o.ok){let e=c.error?.message??`request failed (${o.status})`;throw new D(o.status,c,e)}return c}async function Ft(e,t,n,r={}){let i={Accept:`text/event-stream`,"Content-Type":`application/json`,...r.headers??{}};Nt!==null&&(i.Authorization=`Bearer ${Nt}`);let a=await fetch(e,{...r,method:`POST`,headers:i,body:JSON.stringify(t)});if(!a.ok||a.body===null){let e=await a.text().catch(()=>``),t={};try{t=e===``?{}:JSON.parse(e)}catch{}throw new D(a.status,t,t.error?.message??`stream failed (${a.status})`)}let o=a.body.getReader(),s=new TextDecoder,c=``,l=e=>{for(let t of e.split(`
|
|
2
|
+
`)){if(!t.startsWith(`data:`))continue;let e=t.slice(5).trim();if(e!==``)try{n(JSON.parse(e))}catch{}}};for(;;){let{done:e,value:t}=await o.read();if(e)break;c+=s.decode(t,{stream:!0});let n=c.indexOf(`
|
|
3
|
+
|
|
4
|
+
`);for(;n!==-1;)l(c.slice(0,n)),c=c.slice(n+2),n=c.indexOf(`
|
|
5
|
+
|
|
6
|
+
`)}c.trim()!==``&&l(c)}var It=E(null);async function Lt(){try{let e=await O(`/api/v1/ping`);It.value={...e,projectScopeAvailable:e.projectScopeAvailable===!0,projectSurface:e.projectSurface===!0,devSurfaces:e.devSurfaces===!0}}catch{It.value=null}}function Rt(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 zt(e){return/expected (boolean|string|number)/i.test(e)?e.replace(/^expected/i,`Expected`):e}function Bt(e){let t={};for(let n of e.fields??[])t[n.path]=zt(n.message);return t}var Vt=0;Array.isArray;function k(e,n,r,i,a,o){n||={};var s,c,l=n;if(`ref`in l)for(c in l={},n)c==`ref`?s=n[c]:l[c]=n[c];var u={type:e,props:l,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Vt,__i:-1,__u:0,__source:a,__self:o};if(typeof e==`function`&&(s=e.defaultProps))for(c in s)l[c]===void 0&&(l[c]=s[c]);return t.vnode&&t.vnode(u),u}function Ht({id:e,children:t}){return k(`p`,{class:`ac-field__description`,id:e,children:t})}function Ut({id:e,children:t}){return k(`p`,{class:`ac-field__error`,id:e,role:`alert`,"aria-live":`polite`,children:t})}function Wt({id:e,label:t,description:n,error:r,children:i}){let a=n===void 0?void 0:`${e}-desc`,o=r===void 0?void 0:`${e}-err`;return k(`div`,{class:`ac-field`,"data-invalid":r===void 0?void 0:`true`,children:[k(`label`,{class:`ac-field__label`,for:e,children:t}),n===void 0?null:k(Ht,{id:a,children:n}),k(`div`,{class:`ac-field__control`,"aria-describedby":a,"aria-errormessage":o,children:i}),r===void 0?null:k(Ut,{id:o,children:r})]})}function Gt(e){return k(Wt,{id:e.id,label:e.label,description:e.description,error:e.error,children:k(`input`,{class:`ac-input`,type:`text`,id:e.id,name:e.name,value:e.value,placeholder:e.placeholder,"aria-invalid":e.error===void 0?void 0:`true`,onInput:t=>e.onChange(t.currentTarget.value)})})}function Kt(e){let t=e.step??(e.integer===!0?1:`any`);return k(Wt,{id:e.id,label:e.label,description:e.description,error:e.error,children:k(`input`,{class:`ac-input`,type:`number`,id:e.id,name:e.name,value:Number.isFinite(e.value)?String(e.value):`0`,min:e.min,max:e.max,step:t,"aria-invalid":e.error===void 0?void 0:`true`,onInput:t=>{let n=t.currentTarget.value,r=n===``?0:Number(n);e.onChange(Number.isFinite(r)?r:0)}})})}function qt(e){return k(Wt,{id:e.id,label:e.label,description:e.description,error:e.error,children:k(`label`,{class:`ac-toggle`,children:[k(`input`,{type:`checkbox`,id:e.id,name:e.name,checked:e.value,"aria-invalid":e.error===void 0?void 0:`true`,onChange:t=>e.onChange(t.currentTarget.checked)}),k(`span`,{class:`ac-toggle__track`,"aria-hidden":`true`}),k(`span`,{class:`ac-toggle__state`,children:e.value?`On`:`Off`})]})})}function Jt(e){let t=e.options.length>3;return k(Wt,{id:e.id,label:e.label,description:e.description,error:e.error,children:t?k(`select`,{class:`ac-input`,id:e.id,name:e.name,value:e.value,"aria-invalid":e.error===void 0?void 0:`true`,onChange:t=>e.onChange(t.currentTarget.value),children:e.options.map(e=>k(`option`,{value:e.value,children:e.label??(e.value===``?`(none)`:e.value)},e.value))}):k(`div`,{class:`ac-radio-group`,role:`radiogroup`,"aria-labelledby":`${e.id}-label`,children:e.options.map(t=>{let n=`${e.id}-${t.value||`none`}`;return k(`label`,{class:`ac-radio`,for:n,children:[k(`input`,{type:`radio`,id:n,name:e.name,value:t.value,checked:t.value===e.value,onChange:()=>e.onChange(t.value)}),k(`span`,{children:t.label??(t.value===``?`(none)`:t.value)})]},t.value)})})})}function Yt(e){return k(Wt,{id:e.id,label:e.label,description:e.description,error:e.error,children:k(`textarea`,{class:`ac-textarea`,id:e.id,name:e.name,rows:e.rows??6,placeholder:e.placeholder,"aria-invalid":e.error===void 0?void 0:`true`,onInput:t=>e.onChange(t.currentTarget.value),children:e.value})})}function Xt(e){return e.replace(/_/g,` `).replace(/\./g,` › `).replace(/\b\w/g,e=>e.toUpperCase())}function Zt(e){return e.enum!==void 0&&e.enum.length>0?`enum`:e.type===`integer`?`integer`:e.type===`number`?`number`:e.type===`boolean`?`boolean`:e.type===`string`?`string`:e.type===`array`&&e.items?.type===`string`?`array-of-strings`:`unsupported`}function Qt(e,t){return{path:e,kind:Zt(t),label:Xt(e[e.length-1]??``),description:t.description,options:t.enum,min:t.minimum,max:t.maximum,defaultValue:t.default}}function $t(e){let t=[],n=e.properties??{};for(let[e,r]of Object.entries(n))if(r.type===`object`&&r.properties!==void 0){let n=[];for(let[t,i]of Object.entries(r.properties))if(i.type===`object`&&i.properties!==void 0)for(let[r,a]of Object.entries(i.properties))n.push(Qt([e,t,r],a));else n.push(Qt([e,t],i));t.push({path:[e],label:Xt(e),description:r.description,fields:n})}else{let n=t.find(e=>e.path[0]===`__general`),i=Qt([e],r);n===void 0?t.unshift({path:[`__general`],label:`General`,fields:[i]}):n.fields.push(i)}return t}function en(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n||Array.isArray(n))return;n=n[e]}return n}function tn(e,t,n){if(t.length===0)return e;let[r,...i]=t;if(r===void 0)return e;let a={...e};if(i.length===0)return a[r]=n,a;let o=a[r];return a[r]=tn(typeof o==`object`&&o&&!Array.isArray(o)?o:{},i,n),a}function nn(e){return e.join(`.`)}function rn(e,t,n,r){let i=nn(e.path),a=i,o=en(t,e.path),s=n[i],c=n=>{r(tn(t,e.path,n))};switch(e.kind){case`string`:{let t=typeof o==`string`?o:``;return t.length>80?k(Yt,{id:i,name:a,label:e.label,description:e.description,error:s,value:t,onChange:c}):k(Gt,{id:i,name:a,label:e.label,description:e.description,error:s,value:t,onChange:c})}case`enum`:{let t=typeof o==`string`||typeof o==`number`?String(o):``,n=(e.options??[]).map(e=>({value:String(e)}));return k(Jt,{id:i,name:a,label:e.label,description:e.description,error:s,value:t,options:n,onChange:c})}case`number`:case`integer`:{let t=typeof o==`number`?o:0;return k(Kt,{id:i,name:a,label:e.label,description:e.description,error:s,value:t,integer:e.kind===`integer`,min:e.min,max:e.max,onChange:c})}case`boolean`:{let t=typeof o==`boolean`&&o;return k(qt,{id:i,name:a,label:e.label,description:e.description,error:s,value:t,onChange:c})}case`array-of-strings`:{let t=(Array.isArray(o)?o.filter(e=>typeof e==`string`):[]).join(`
|
|
7
|
+
`);return k(Yt,{id:i,name:a,label:e.label,description:`${e.description??``} (one entry per line)`.trim(),error:s,value:t,onChange:e=>{let t=e.split(`
|
|
8
|
+
`).map(e=>e.trim()).filter(e=>e!==``);c(t)}})}default:return null}}function an({field:e,values:t,errors:n,onChange:r,decorate:i}){let a=nn(e.path),o=i?.(a,e);return o===void 0?k(`div`,{children:rn(e,t,n,r)},a):k(`div`,{class:`ac-field-row${o.modified?` ac-field-row--modified`:``}`,children:[k(`div`,{class:`ac-field-row__body`,children:rn(e,t,n,r)}),k(`div`,{class:`ac-field-row__meta`,children:[o.sourceLabel===void 0?null:k(`span`,{class:`ac-badge ac-badge--source`,title:`Value set in the ${o.sourceLabel} layer`,children:o.sourceLabel}),o.modified&&o.onReset!==void 0?k(`button`,{type:`button`,class:`ac-field-row__reset`,title:`Reset to default`,onClick:o.onReset,children:`Reset`}):null]})]})}function on({section:e,values:t,errors:n,onChange:r,decorate:i,footer:a}){return k(`section`,{class:`ac-section`,"aria-labelledby":`section-${nn(e.path)}`,children:[k(`h2`,{class:`ac-section__title`,id:`section-${nn(e.path)}`,children:e.label}),e.description===void 0?null:k(`p`,{class:`ac-section__description`,children:e.description}),k(`div`,{class:`ac-section__fields`,children:e.fields.map(e=>k(an,{field:e,values:t,errors:n,onChange:r,decorate:i},nn(e.path)))}),a]})}function sn(e){let t=$t(e.schema),n=e.errors??{};return k(`form`,{class:`ac-form`,onSubmit:e=>e.preventDefault(),children:[t.map(t=>k(on,{section:t,values:e.values,errors:n,onChange:e.onChange,decorate:e.decorate},nn(t.path))),e.actions===void 0?null:k(`div`,{class:`ac-form__actions`,children:e.actions})]})}function cn(e){let[t]=Ie(()=>`${e.id}-list`);return k(Wt,{id:e.id,label:e.label,description:e.description,error:e.error,children:[k(`input`,{class:`ac-input`,type:`text`,id:e.id,name:e.name,value:e.value,placeholder:e.placeholder,list:t,"aria-invalid":e.error===void 0?void 0:`true`,onInput:t=>e.onChange(t.currentTarget.value)}),k(`datalist`,{id:t,children:e.suggestions.map(e=>k(`option`,{value:e},e))})]})}var ln=[`developer`,`reviewer`,`designer`,`product-manager`,`ops`,`qa`,`maintainer`],un=[`de`,`en`,`en-US`,`en-GB`,`fr`,`es`,`it`,`nl`,`pt`,`pt-BR`];function dn(){return new Date().toISOString().slice(0,10)}function fn(e,t){return e?.[t]}function pn({value:e,onChange:t,errors:n,hideRole:r,hideIdentityBasics:i}){let[a,o]=Ie(``),s=`umd-role-suggestions`;function c(n){t({...e,...n,last_updated:dn()})}let l=e.role.filter(e=>e.trim()!==``);function u(e){let t=e.trim();t===``||l.includes(t)||c({role:[...l,t]}),o(``)}function d(e){l.length<=1||c({role:l.filter(t=>t!==e)})}function f(n){let r={...e,last_updated:dn()};n===``?delete r.notes:r.notes=n,t(r)}let p=ln.filter(e=>!l.includes(e));return k(`div`,{class:`ac-user-md-form`,children:[i?null:k(Gt,{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:fn(n,`identity.name`),onChange:t=>c({identity:{...e.identity,name:t}})}),i?null:k(cn,{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:un,error:fn(n,`language`),onChange:e=>c({language:e})}),r?null:k(Wt,{id:`umd-role-input`,label:`Roles`,description:`One or more roles. Seeded suggestions are non-binding — type anything and press Enter.`,error:fn(n,`role`),children:[k(`ul`,{class:`ac-chip-list`,"data-testid":`umd-role-list`,children:l.map(e=>k(`li`,{class:`ac-chip`,children:[k(`span`,{children:e}),k(`button`,{type:`button`,class:`ac-chip__remove`,"aria-label":`Remove ${e}`,disabled:l.length<=1,onClick:()=>d(e),children:`×`})]},e))}),k(`div`,{class:`ac-role-add`,children:[k(`input`,{class:`ac-input`,type:`text`,id:`umd-role-input`,name:`role-add`,list:s,placeholder:`Add a role and press Enter`,value:a,onInput:e=>o(e.currentTarget.value),onKeyDown:e=>{(e.key===`Enter`||e.key===`,`)&&(e.preventDefault(),u(a))}}),k(`datalist`,{id:s,children:p.map(e=>k(`option`,{value:e},e))}),k(`button`,{type:`button`,class:`ac-button`,onClick:()=>u(a),children:`Add role`})]})]}),k(Jt,{id:`umd-pace`,name:`style.pace`,label:`Pace`,value:e.style.pace,error:fn(n,`style.pace`),options:[{value:`pragmatic`,label:`Pragmatic`},{value:`thorough`,label:`Thorough`},{value:`rapid`,label:`Rapid`}],onChange:t=>c({style:{...e.style,pace:t}})}),k(Yt,{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:fn(n,`voice_sample`),onChange:e=>c({voice_sample:e})}),k(Yt,{id:`umd-notes`,name:`notes`,label:`Notes`,description:`Optional free-form prose the agent remembers across sessions.`,rows:6,value:e.notes??``,error:fn(n,`notes`),onChange:f})]})}var A;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(A||={});var mn;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(mn||={});var j=A.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),hn=e=>{switch(typeof e){case`undefined`:return j.undefined;case`string`:return j.string;case`number`:return Number.isNaN(e)?j.nan:j.number;case`boolean`:return j.boolean;case`function`:return j.function;case`bigint`:return j.bigint;case`symbol`:return j.symbol;case`object`:return Array.isArray(e)?j.array:e===null?j.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?j.promise:typeof Map<`u`&&e instanceof Map?j.map:typeof Set<`u`&&e instanceof Set?j.set:typeof Date<`u`&&e instanceof Date?j.date:j.object;default:return j.unknown}},M=A.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]),gn=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,A.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=e=>e.message){let t={},n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};gn.create=e=>new gn(e);var _n=(e,t)=>{let n;switch(e.code){case M.invalid_type:n=e.received===j.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case M.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,A.jsonStringifyReplacer)}`;break;case M.unrecognized_keys:n=`Unrecognized key(s) in object: ${A.joinValues(e.keys,`, `)}`;break;case M.invalid_union:n=`Invalid input`;break;case M.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${A.joinValues(e.options)}`;break;case M.invalid_enum_value:n=`Invalid enum value. Expected ${A.joinValues(e.options)}, received '${e.received}'`;break;case M.invalid_arguments:n=`Invalid function arguments`;break;case M.invalid_return_type:n=`Invalid function return type`;break;case M.invalid_date:n=`Invalid date`;break;case M.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:A.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case M.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`||e.type===`bigint`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case M.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case M.custom:n=`Invalid input`;break;case M.invalid_intersection_types:n=`Intersection results could not be merged`;break;case M.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case M.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,A.assertNever(e)}return{message:n}},vn=_n;function yn(){return vn}var bn=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function N(e,t){let n=yn(),r=bn({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===_n?void 0:_n].filter(e=>!!e)});e.common.issues.push(r)}var xn=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return P;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return P;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}},P=Object.freeze({status:`aborted`}),Sn=e=>({status:`dirty`,value:e}),F=e=>({status:`valid`,value:e}),Cn=e=>e.status===`aborted`,wn=e=>e.status===`dirty`,Tn=e=>e.status===`valid`,En=e=>typeof Promise<`u`&&e instanceof Promise,I;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(I||={});var Dn=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},On=(e,t)=>{if(Tn(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){if(this._error)return this._error;let t=new gn(e.common.issues);return this._error=t,this._error}}};function L(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var R=class{get description(){return this._def.description}_getType(e){return hn(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:hn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new xn,ctx:{common:e.parent.common,data:e.data,parsedType:hn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(En(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:hn(e)};return On(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:hn(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return Tn(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>Tn(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:hn(e)},r=this._parse({data:e,path:n.path,parent:n});return On(n,await(En(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:M.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new jr({schema:this,typeName:z.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:e=>this[`~validate`](e)}}optional(){return Mr.create(this,this._def)}nullable(){return Nr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return fr.create(this)}promise(){return Ar.create(this,this._def)}or(e){return hr.create([this,e],this._def)}and(e){return yr.create(this,e,this._def)}transform(e){return new jr({...L(this._def),schema:this,typeName:z.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new Pr({...L(this._def),innerType:this,defaultValue:t,typeName:z.ZodDefault})}brand(){return new Lr({typeName:z.ZodBranded,type:this,...L(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new Fr({...L(this._def),innerType:this,catchValue:t,typeName:z.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Rr.create(this,e)}readonly(){return zr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},kn=/^c[^\s-]{8,}$/i,An=/^[0-9a-z]+$/,jn=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Mn=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Nn=/^[a-z0-9_-]{21}$/i,Pn=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Fn=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,In=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Ln=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,Rn,zn=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Bn=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Vn=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Hn=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Un=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Wn=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Gn=`((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`,Kn=RegExp(`^${Gn}$`);function qn(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function Jn(e){return RegExp(`^${qn(e)}$`)}function Yn(e){let t=`${Gn}T${qn(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function Xn(e,t){return!((t!==`v4`&&t||!zn.test(e))&&(t!==`v6`&&t||!Vn.test(e)))}function Zn(e,t){if(!Pn.test(e))return!1;try{let[n]=e.split(`.`);if(!n)return!1;let r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function Qn(e,t){return!((t!==`v4`&&t||!Bn.test(e))&&(t!==`v6`&&t||!Hn.test(e)))}var $n=class e extends R{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==j.string){let t=this._getOrReturnCtx(e);return N(t,{code:M.invalid_type,expected:j.string,received:t.parsedType}),P}let t=new xn,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),N(n,{code:M.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`max`)e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),N(n,{code:M.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.length<r.value;(i||a)&&(n=this._getOrReturnCtx(e,n),i?N(n,{code:M.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}):a&&N(n,{code:M.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if(r.kind===`email`)In.test(e.data)||(n=this._getOrReturnCtx(e,n),N(n,{validation:`email`,code:M.invalid_string,message:r.message}),t.dirty());else if(r.kind===`emoji`)Rn||=new RegExp(Ln,`u`),Rn.test(e.data)||(n=this._getOrReturnCtx(e,n),N(n,{validation:`emoji`,code:M.invalid_string,message:r.message}),t.dirty());else if(r.kind===`uuid`)Mn.test(e.data)||(n=this._getOrReturnCtx(e,n),N(n,{validation:`uuid`,code:M.invalid_string,message:r.message}),t.dirty());else if(r.kind===`nanoid`)Nn.test(e.data)||(n=this._getOrReturnCtx(e,n),N(n,{validation:`nanoid`,code:M.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid`)kn.test(e.data)||(n=this._getOrReturnCtx(e,n),N(n,{validation:`cuid`,code:M.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid2`)An.test(e.data)||(n=this._getOrReturnCtx(e,n),N(n,{validation:`cuid2`,code:M.invalid_string,message:r.message}),t.dirty());else if(r.kind===`ulid`)jn.test(e.data)||(n=this._getOrReturnCtx(e,n),N(n,{validation:`ulid`,code:M.invalid_string,message:r.message}),t.dirty());else if(r.kind===`url`)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),N(n,{validation:`url`,code:M.invalid_string,message:r.message}),t.dirty()}else r.kind===`regex`?(r.regex.lastIndex=0,r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),N(n,{validation:`regex`,code:M.invalid_string,message:r.message}),t.dirty())):r.kind===`trim`?e.data=e.data.trim():r.kind===`includes`?e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),N(n,{code:M.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty()):r.kind===`toLowerCase`?e.data=e.data.toLowerCase():r.kind===`toUpperCase`?e.data=e.data.toUpperCase():r.kind===`startsWith`?e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),N(n,{code:M.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):r.kind===`endsWith`?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),N(n,{code:M.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):r.kind===`datetime`?Yn(r).test(e.data)||(n=this._getOrReturnCtx(e,n),N(n,{code:M.invalid_string,validation:`datetime`,message:r.message}),t.dirty()):r.kind===`date`?Kn.test(e.data)||(n=this._getOrReturnCtx(e,n),N(n,{code:M.invalid_string,validation:`date`,message:r.message}),t.dirty()):r.kind===`time`?Jn(r).test(e.data)||(n=this._getOrReturnCtx(e,n),N(n,{code:M.invalid_string,validation:`time`,message:r.message}),t.dirty()):r.kind===`duration`?Fn.test(e.data)||(n=this._getOrReturnCtx(e,n),N(n,{validation:`duration`,code:M.invalid_string,message:r.message}),t.dirty()):r.kind===`ip`?Xn(e.data,r.version)||(n=this._getOrReturnCtx(e,n),N(n,{validation:`ip`,code:M.invalid_string,message:r.message}),t.dirty()):r.kind===`jwt`?Zn(e.data,r.alg)||(n=this._getOrReturnCtx(e,n),N(n,{validation:`jwt`,code:M.invalid_string,message:r.message}),t.dirty()):r.kind===`cidr`?Qn(e.data,r.version)||(n=this._getOrReturnCtx(e,n),N(n,{validation:`cidr`,code:M.invalid_string,message:r.message}),t.dirty()):r.kind===`base64`?Un.test(e.data)||(n=this._getOrReturnCtx(e,n),N(n,{validation:`base64`,code:M.invalid_string,message:r.message}),t.dirty()):r.kind===`base64url`?Wn.test(e.data)||(n=this._getOrReturnCtx(e,n),N(n,{validation:`base64url`,code:M.invalid_string,message:r.message}),t.dirty()):A.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:M.invalid_string,...I.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...I.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...I.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...I.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...I.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...I.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...I.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...I.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...I.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...I.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...I.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...I.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...I.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...I.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...I.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,...I.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...I.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...I.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...I.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...I.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...I.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...I.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...I.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...I.errToObj(t)})}nonempty(e){return this.min(1,I.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};$n.create=e=>new $n({checks:[],typeName:z.ZodString,coerce:e?.coerce??!1,...L(e)});function er(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var tr=class e extends R{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==j.number){let t=this._getOrReturnCtx(e);return N(t,{code:M.invalid_type,expected:j.number,received:t.parsedType}),P}let t,n=new xn;for(let r of this._def.checks)r.kind===`int`?A.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),N(t,{code:M.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),N(t,{code:M.too_small,minimum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),N(t,{code:M.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?er(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),N(t,{code:M.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),N(t,{code:M.not_finite,message:r.message}),n.dirty()):A.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,I.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,I.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,I.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,I.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:I.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:I.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:I.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:I.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:I.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:I.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:I.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:I.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:I.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:I.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind===`int`||e.kind===`multipleOf`&&A.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.value<e)&&(e=n.value);return Number.isFinite(t)&&Number.isFinite(e)}};tr.create=e=>new tr({checks:[],typeName:z.ZodNumber,coerce:e?.coerce||!1,...L(e)});var nr=class e extends R{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==j.bigint)return this._getInvalidInput(e);let t,n=new xn;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),N(t,{code:M.too_small,type:`bigint`,minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),N(t,{code:M.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),N(t,{code:M.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):A.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return N(t,{code:M.invalid_type,expected:j.bigint,received:t.parsedType}),P}gte(e,t){return this.setLimit(`min`,e,!0,I.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,I.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,I.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,I.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:I.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:I.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:I.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:I.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:I.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:I.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};nr.create=e=>new nr({checks:[],typeName:z.ZodBigInt,coerce:e?.coerce??!1,...L(e)});var rr=class extends R{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==j.boolean){let t=this._getOrReturnCtx(e);return N(t,{code:M.invalid_type,expected:j.boolean,received:t.parsedType}),P}return F(e.data)}};rr.create=e=>new rr({typeName:z.ZodBoolean,coerce:e?.coerce||!1,...L(e)});var ir=class e extends R{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==j.date){let t=this._getOrReturnCtx(e);return N(t,{code:M.invalid_type,expected:j.date,received:t.parsedType}),P}if(Number.isNaN(e.data.getTime()))return N(this._getOrReturnCtx(e),{code:M.invalid_date}),P;let t=new xn,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),N(n,{code:M.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:`date`}),t.dirty()):r.kind===`max`?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),N(n,{code:M.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):A.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:I.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:I.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e==null?null:new Date(e)}};ir.create=e=>new ir({checks:[],coerce:e?.coerce||!1,typeName:z.ZodDate,...L(e)});var ar=class extends R{_parse(e){if(this._getType(e)!==j.symbol){let t=this._getOrReturnCtx(e);return N(t,{code:M.invalid_type,expected:j.symbol,received:t.parsedType}),P}return F(e.data)}};ar.create=e=>new ar({typeName:z.ZodSymbol,...L(e)});var or=class extends R{_parse(e){if(this._getType(e)!==j.undefined){let t=this._getOrReturnCtx(e);return N(t,{code:M.invalid_type,expected:j.undefined,received:t.parsedType}),P}return F(e.data)}};or.create=e=>new or({typeName:z.ZodUndefined,...L(e)});var sr=class extends R{_parse(e){if(this._getType(e)!==j.null){let t=this._getOrReturnCtx(e);return N(t,{code:M.invalid_type,expected:j.null,received:t.parsedType}),P}return F(e.data)}};sr.create=e=>new sr({typeName:z.ZodNull,...L(e)});var cr=class extends R{constructor(){super(...arguments),this._any=!0}_parse(e){return F(e.data)}};cr.create=e=>new cr({typeName:z.ZodAny,...L(e)});var lr=class extends R{constructor(){super(...arguments),this._unknown=!0}_parse(e){return F(e.data)}};lr.create=e=>new lr({typeName:z.ZodUnknown,...L(e)});var ur=class extends R{_parse(e){let t=this._getOrReturnCtx(e);return N(t,{code:M.invalid_type,expected:j.never,received:t.parsedType}),P}};ur.create=e=>new ur({typeName:z.ZodNever,...L(e)});var dr=class extends R{_parse(e){if(this._getType(e)!==j.undefined){let t=this._getOrReturnCtx(e);return N(t,{code:M.invalid_type,expected:j.void,received:t.parsedType}),P}return F(e.data)}};dr.create=e=>new dr({typeName:z.ZodVoid,...L(e)});var fr=class e extends R{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==j.array)return N(t,{code:M.invalid_type,expected:j.array,received:t.parsedType}),P;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(N(t,{code:e?M.too_big:M.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:`array`,inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(N(t,{code:M.too_small,minimum:r.minLength.value,type:`array`,inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(N(t,{code:M.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new Dn(t,e,t.path,n)))).then(e=>xn.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new Dn(t,e,t.path,n)));return xn.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:I.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:I.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:I.toString(n)}})}nonempty(e){return this.min(1,e)}};fr.create=(e,t)=>new fr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:z.ZodArray,...L(t)});function pr(e){if(e instanceof mr){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=Mr.create(pr(r))}return new mr({...e._def,shape:()=>t})}return e instanceof fr?new fr({...e._def,type:pr(e.element)}):e instanceof Mr?Mr.create(pr(e.unwrap())):e instanceof Nr?Nr.create(pr(e.unwrap())):e instanceof br?br.create(e.items.map(e=>pr(e))):e}var mr=class e extends R{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=A.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==j.object){let t=this._getOrReturnCtx(e);return N(t,{code:M.invalid_type,expected:j.object,received:t.parsedType}),P}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof ur&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=r[e],i=n.data[e];o.push({key:{status:`valid`,value:e},value:t._parse(new Dn(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof ur){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)o.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&(N(n,{code:M.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];o.push({key:{status:`valid`,value:t},value:e._parse(new Dn(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>xn.mergeObjectSync(t,e)):xn.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return I.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let r=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:I.errToObj(t).message??r}:{message:r}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:z.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of A.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of A.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return pr(this)}partial(t){let n={};for(let e of A.objectKeys(this.shape)){let r=this.shape[e];n[e]=t&&!t[e]?r:r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of A.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof Mr;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return Dr(A.objectKeys(this.shape))}};mr.create=(e,t)=>new mr({shape:()=>e,unknownKeys:`strip`,catchall:ur.create(),typeName:z.ZodObject,...L(t)}),mr.strictCreate=(e,t)=>new mr({shape:()=>e,unknownKeys:`strict`,catchall:ur.create(),typeName:z.ZodObject,...L(t)}),mr.lazycreate=(e,t)=>new mr({shape:e,unknownKeys:`strip`,catchall:ur.create(),typeName:z.ZodObject,...L(t)});var hr=class extends R{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new gn(e.ctx.common.issues));return N(t,{code:M.invalid_union,unionErrors:n}),P}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new gn(e));return N(t,{code:M.invalid_union,unionErrors:i}),P}}get options(){return this._def.options}};hr.create=(e,t)=>new hr({options:e,typeName:z.ZodUnion,...L(t)});var gr=e=>e instanceof Tr?gr(e.schema):e instanceof jr?gr(e.innerType()):e instanceof Er?[e.value]:e instanceof Or?e.options:e instanceof kr?A.objectValues(e.enum):e instanceof Pr?gr(e._def.innerType):e instanceof or?[void 0]:e instanceof sr?[null]:e instanceof Mr?[void 0,...gr(e.unwrap())]:e instanceof Nr?[null,...gr(e.unwrap())]:e instanceof Lr||e instanceof zr?gr(e.unwrap()):e instanceof Fr?gr(e._def.innerType):[],_r=class e extends R{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==j.object)return N(t,{code:M.invalid_type,expected:j.object,received:t.parsedType}),P;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(N(t,{code:M.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),P)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=gr(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:z.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...L(r)})}};function vr(e,t){let n=hn(e),r=hn(t);if(e===t)return{valid:!0,data:e};if(n===j.object&&r===j.object){let n=A.objectKeys(t),r=A.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=vr(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===j.array&&r===j.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=vr(i,a);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}return n===j.date&&r===j.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var yr=class extends R{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(Cn(e)||Cn(r))return P;let i=vr(e.value,r.value);return i.valid?((wn(e)||wn(r))&&t.dirty(),{status:t.value,value:i.data}):(N(n,{code:M.invalid_intersection_types}),P)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};yr.create=(e,t,n)=>new yr({left:e,right:t,typeName:z.ZodIntersection,...L(n)});var br=class e extends R{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==j.array)return N(n,{code:M.invalid_type,expected:j.array,received:n.parsedType}),P;if(n.data.length<this._def.items.length)return N(n,{code:M.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),P;!this._def.rest&&n.data.length>this._def.items.length&&(N(n,{code:M.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new Dn(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>xn.mergeArray(t,e)):xn.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};br.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new br({items:e,typeName:z.ZodTuple,rest:null,...L(t)})};var xr=class e extends R{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==j.object)return N(n,{code:M.invalid_type,expected:j.object,received:n.parsedType}),P;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new Dn(n,e,n.path,e)),value:a._parse(new Dn(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?xn.mergeObjectAsync(t,r):xn.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof R?new e({keyType:t,valueType:n,typeName:z.ZodRecord,...L(r)}):new e({keyType:$n.create(),valueType:t,typeName:z.ZodRecord,...L(n)})}},Sr=class extends R{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==j.map)return N(n,{code:M.invalid_type,expected:j.map,received:n.parsedType}),P;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new Dn(n,e,n.path,[a,`key`])),value:i._parse(new Dn(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return P;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}{let e=new Map;for(let n of a){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return P;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};Sr.create=(e,t,n)=>new Sr({valueType:t,keyType:e,typeName:z.ZodMap,...L(n)});var Cr=class e extends R{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==j.set)return N(n,{code:M.invalid_type,expected:j.set,received:n.parsedType}),P;let r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(N(n,{code:M.too_small,minimum:r.minSize.value,type:`set`,inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(N(n,{code:M.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return P;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let o=[...n.data.values()].map((e,t)=>i._parse(new Dn(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(t,n){return new e({...this._def,minSize:{value:t,message:I.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:I.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};Cr.create=(e,t)=>new Cr({valueType:e,minSize:null,maxSize:null,typeName:z.ZodSet,...L(t)});var wr=class e extends R{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==j.function)return N(t,{code:M.invalid_type,expected:j.function,received:t.parsedType}),P;function n(e,n){return bn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,yn(),_n].filter(e=>!!e),issueData:{code:M.invalid_arguments,argumentsError:n}})}function r(e,n){return bn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,yn(),_n].filter(e=>!!e),issueData:{code:M.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof Ar){let e=this;return F(async function(...t){let o=new gn([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(n(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw o.addIssue(r(c,e)),o})})}{let e=this;return F(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new gn([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new gn([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:br.create(t).rest(lr.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||br.create([]).rest(lr.create()),returns:n||lr.create(),typeName:z.ZodFunction,...L(r)})}},Tr=class extends R{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};Tr.create=(e,t)=>new Tr({getter:e,typeName:z.ZodLazy,...L(t)});var Er=class extends R{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return N(t,{received:t.data,code:M.invalid_literal,expected:this._def.value}),P}return{status:`valid`,value:e.data}}get value(){return this._def.value}};Er.create=(e,t)=>new Er({value:e,typeName:z.ZodLiteral,...L(t)});function Dr(e,t){return new Or({values:e,typeName:z.ZodEnum,...L(t)})}var Or=class e extends R{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return N(t,{expected:A.joinValues(n),received:t.parsedType,code:M.invalid_type}),P}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return N(t,{received:t.data,code:M.invalid_enum_value,options:n}),P}return F(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};Or.create=Dr;var kr=class extends R{_parse(e){let t=A.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==j.string&&n.parsedType!==j.number){let e=A.objectValues(t);return N(n,{expected:A.joinValues(e),received:n.parsedType,code:M.invalid_type}),P}if(this._cache||=new Set(A.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){let e=A.objectValues(t);return N(n,{received:n.data,code:M.invalid_enum_value,options:e}),P}return F(e.data)}get enum(){return this._def.values}};kr.create=(e,t)=>new kr({values:e,typeName:z.ZodNativeEnum,...L(t)});var Ar=class extends R{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==j.promise&&t.common.async===!1?(N(t,{code:M.invalid_type,expected:j.promise,received:t.parsedType}),P):F((t.parsedType===j.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Ar.create=(e,t)=>new Ar({type:e,typeName:z.ZodPromise,...L(t)});var jr=class extends R{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===z.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{N(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type===`preprocess`){let e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return P;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?P:r.status===`dirty`||t.value===`dirty`?Sn(r.value):r});{if(t.value===`aborted`)return P;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?P:r.status===`dirty`||t.value===`dirty`?Sn(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?P:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?P:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(r.type===`transform`){if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Tn(e))return P;let a=r.transform(e.value,i);if(a instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:a}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>Tn(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):P)}A.assertNever(r)}};jr.create=(e,t,n)=>new jr({schema:e,typeName:z.ZodEffects,effect:t,...L(n)}),jr.createWithPreprocess=(e,t,n)=>new jr({schema:t,effect:{type:`preprocess`,transform:e},typeName:z.ZodEffects,...L(n)});var Mr=class extends R{_parse(e){return this._getType(e)===j.undefined?F(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Mr.create=(e,t)=>new Mr({innerType:e,typeName:z.ZodOptional,...L(t)});var Nr=class extends R{_parse(e){return this._getType(e)===j.null?F(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Nr.create=(e,t)=>new Nr({innerType:e,typeName:z.ZodNullable,...L(t)});var Pr=class extends R{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===j.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Pr.create=(e,t)=>new Pr({innerType:e,typeName:z.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...L(t)});var Fr=class extends R{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return En(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new gn(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new gn(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Fr.create=(e,t)=>new Fr({innerType:e,typeName:z.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...L(t)});var Ir=class extends R{_parse(e){if(this._getType(e)!==j.nan){let t=this._getOrReturnCtx(e);return N(t,{code:M.invalid_type,expected:j.nan,received:t.parsedType}),P}return{status:`valid`,value:e.data}}};Ir.create=e=>new Ir({typeName:z.ZodNaN,...L(e)});var Lr=class extends R{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},Rr=class e extends R{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?P:e.status===`dirty`?(t.dirty(),Sn(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?P:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:z.ZodPipeline})}},zr=class extends R{_parse(e){let t=this._def.innerType._parse(e),n=e=>(Tn(e)&&(e.value=Object.freeze(e.value)),e);return En(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};zr.create=(e,t)=>new zr({innerType:e,typeName:z.ZodReadonly,...L(t)}),mr.lazycreate;var z;(function(e){e.ZodString=`ZodString`,e.ZodNumber=`ZodNumber`,e.ZodNaN=`ZodNaN`,e.ZodBigInt=`ZodBigInt`,e.ZodBoolean=`ZodBoolean`,e.ZodDate=`ZodDate`,e.ZodSymbol=`ZodSymbol`,e.ZodUndefined=`ZodUndefined`,e.ZodNull=`ZodNull`,e.ZodAny=`ZodAny`,e.ZodUnknown=`ZodUnknown`,e.ZodNever=`ZodNever`,e.ZodVoid=`ZodVoid`,e.ZodArray=`ZodArray`,e.ZodObject=`ZodObject`,e.ZodUnion=`ZodUnion`,e.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,e.ZodIntersection=`ZodIntersection`,e.ZodTuple=`ZodTuple`,e.ZodRecord=`ZodRecord`,e.ZodMap=`ZodMap`,e.ZodSet=`ZodSet`,e.ZodFunction=`ZodFunction`,e.ZodLazy=`ZodLazy`,e.ZodLiteral=`ZodLiteral`,e.ZodEnum=`ZodEnum`,e.ZodEffects=`ZodEffects`,e.ZodNativeEnum=`ZodNativeEnum`,e.ZodOptional=`ZodOptional`,e.ZodNullable=`ZodNullable`,e.ZodDefault=`ZodDefault`,e.ZodCatch=`ZodCatch`,e.ZodPromise=`ZodPromise`,e.ZodBranded=`ZodBranded`,e.ZodPipeline=`ZodPipeline`,e.ZodReadonly=`ZodReadonly`})(z||={});var Br=$n.create;tr.create,Ir.create,nr.create,rr.create,ir.create,ar.create,or.create,sr.create,cr.create,lr.create,ur.create,dr.create;var Vr=fr.create,Hr=mr.create;mr.strictCreate,hr.create,_r.create,yr.create,br.create,xr.create,Sr.create,Cr.create,wr.create,Tr.create;var Ur=Er.create,Wr=Or.create;kr.create,Ar.create,jr.create,Mr.create,Nr.create,jr.createWithPreprocess,Rr.create;var Gr=8e3,Kr=2e3,qr=Hr({pattern:Br().trim().min(1,`style.avoid pattern is required`).max(64,`style.avoid pattern exceeds 64 chars`),match:Wr([`word`,`substring`]),note:Br().trim().min(1).optional()}),Jr=Vr(qr).max(32,`style.avoid exceeds 32 entries`),Yr=Br().regex(/^\d{4}-\d{2}-\d{2}$/,`last_updated must be ISO-8601 date (YYYY-MM-DD)`);Hr({version:Ur(1),identity:Hr({name:Br().trim().min(1,`identity.name is required`)}),language:Br().trim().min(2,`language must be a non-empty code`),role:Vr(Br().trim().min(1,`role entries must be non-empty`)).default([]),style:Hr({pace:Wr([`rapid`,`pragmatic`,`thorough`]),avoid:Jr.optional()}),voice_sample:Br().trim().max(Kr,`voice_sample exceeds hard cap`).default(``),last_updated:Yr,notes:Br().max(Gr,`notes exceeds hard cap`).optional()});function Xr(){return{version:1,identity:{name:``},language:`en`,role:[],style:{pace:`pragmatic`},voice_sample:``,last_updated:`1970-01-01`}}function Zr(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Qr(e,t){return typeof e==`string`?e:t}function $r(e){return e===`thorough`||e===`rapid`?e:`pragmatic`}function ei(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`&&e.trim()!==``):[]}function ti(e){if(!Array.isArray(e))return;let t=e.flatMap(e=>{let t=qr.safeParse(e);return t.success?[t.data]:[]});return t.length===0?void 0:t}function ni(e){if(typeof e==`string`)return e===``?void 0:e}function ri(e){let t=Xr(),n=Zr(e.identity)?e.identity:{},r=Zr(e.style)?e.style:{},i=ni(e.notes),a={version:1,identity:{name:Qr(n.name,t.identity.name)},language:Qr(e.language,t.language),role:ei(e.role),style:{pace:$r(r.pace)},voice_sample:Qr(e.voice_sample,t.voice_sample),last_updated:Qr(e.last_updated,t.last_updated)},o=ti(r.avoid);return o!==void 0&&(a.style.avoid=o),i!==void 0&&(a.notes=i),a}var B=Symbol(`NOT_RESOLVED`);function V(e,t){return{tagName:e,nodeKind:`scalar`,implicit:t.implicit??!1,matchByTagPrefix:t.matchByTagPrefix??!1,implicitFirstChars:t.implicitFirstChars??null,resolve:t.resolve,identify:t.identify,represent:t.represent??(e=>String(e)),representTagName:t.representTagName??(()=>e)}}function ii(e,t){let n=t.finalize===void 0;return{tagName:e,nodeKind:`sequence`,implicit:!1,matchByTagPrefix:t.matchByTagPrefix??!1,create:t.create,addItem:t.addItem,finalize:t.finalize??(e=>e),carrierIsResult:n,identify:t.identify,represent:t.represent??(e=>e),representTagName:t.representTagName??(()=>e)}}function ai(e,t){let n=t.finalize===void 0;return{tagName:e,nodeKind:`mapping`,implicit:!1,matchByTagPrefix:t.matchByTagPrefix??!1,create:t.create,addPair:t.addPair,has:t.has,keys:t.keys,get:t.get,finalize:t.finalize??(e=>e),carrierIsResult:n,identify:t.identify,represent:t.represent??(e=>e),representTagName:t.representTagName??(()=>e)}}var oi=V(`tag:yaml.org,2002:str`,{resolve:e=>e,identify:e=>typeof e==`string`}),si=[``,`~`,`null`,`Null`,`NULL`],ci=V(`tag:yaml.org,2002:null`,{implicit:!0,implicitFirstChars:[``,`~`,`n`,`N`],resolve:e=>si.indexOf(e)===-1?B:null,identify:e=>e===null,represent:()=>`null`}),li=V(`tag:yaml.org,2002:null`,{implicit:!0,implicitFirstChars:[`n`],resolve:(e,t)=>e===`null`||t&&e===``?null:B,identify:e=>e===null,represent:()=>`null`}),ui=[``,`~`,`null`,`Null`,`NULL`],di=V(`tag:yaml.org,2002:null`,{implicit:!0,implicitFirstChars:[``,`~`,`n`,`N`],resolve:e=>ui.indexOf(e)===-1?B:null,identify:e=>e===null,represent:()=>`null`}),fi=[`true`,`True`,`TRUE`],pi=[`false`,`False`,`FALSE`],mi=V(`tag:yaml.org,2002:bool`,{implicit:!0,implicitFirstChars:[`t`,`T`,`f`,`F`],resolve:e=>fi.indexOf(e)!==-1||pi.indexOf(e)===-1&&B,identify:e=>Object.prototype.toString.call(e)===`[object Boolean]`,represent:e=>e?`true`:`false`}),hi=[`true`],gi=[`false`],_i=V(`tag:yaml.org,2002:bool`,{implicit:!0,implicitFirstChars:[`t`,`f`],resolve:e=>hi.indexOf(e)!==-1||gi.indexOf(e)===-1&&B,identify:e=>Object.prototype.toString.call(e)===`[object Boolean]`,represent:e=>e?`true`:`false`}),vi=[`true`,`True`,`TRUE`,`y`,`Y`,`yes`,`Yes`,`YES`,`on`,`On`,`ON`],yi=[`false`,`False`,`FALSE`,`n`,`N`,`no`,`No`,`NO`,`off`,`Off`,`OFF`],bi=V(`tag:yaml.org,2002:bool`,{implicit:!0,implicitFirstChars:[`y`,`Y`,`n`,`N`,`t`,`T`,`f`,`F`,`o`,`O`],resolve:e=>vi.indexOf(e)!==-1||yi.indexOf(e)===-1&&B,identify:e=>Object.prototype.toString.call(e)===`[object Boolean]`,represent:e=>e?`true`:`false`}),xi=RegExp(`^(?:0o[0-7]+|0x[0-9a-fA-F]+|[-+]?[0-9]+)$`),Si=RegExp(`^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$`);function Ci(e){let t=e,n=1;return(t[0]===`-`||t[0]===`+`)&&(t[0]===`-`&&(n=-1),t=t.slice(1)),t.startsWith(`0b`)?n*parseInt(t.slice(2),2):t.startsWith(`0o`)?n*parseInt(t.slice(2),8):t.startsWith(`0x`)?n*parseInt(t.slice(2),16):n*parseInt(t,10)}function wi(e,t){if(t){if(!Si.test(e))return B}else if(!xi.test(e))return B;let n=Ci(e);return Number.isFinite(n)?n:B}var Ti=V(`tag:yaml.org,2002:int`,{implicit:!0,implicitFirstChars:[`-`,`+`,...`0123456789`],resolve:wi,identify:e=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf(`e`)<0,represent:e=>e.toString(10)}),Ei=RegExp(`^-?(?:0|[1-9][0-9]*)$`),Di=RegExp(`^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$`);function Oi(e){let t=e,n=1;return(t[0]===`-`||t[0]===`+`)&&(t[0]===`-`&&(n=-1),t=t.slice(1)),t.startsWith(`0b`)?n*parseInt(t.slice(2),2):t.startsWith(`0o`)?n*parseInt(t.slice(2),8):t.startsWith(`0x`)?n*parseInt(t.slice(2),16):n*parseInt(t,10)}function ki(e,t){if(t){if(!Di.test(e))return B}else if(!Ei.test(e))return B;let n=Oi(e);return Number.isFinite(n)?n:B}var Ai=V(`tag:yaml.org,2002:int`,{implicit:!0,implicitFirstChars:[`-`,...`0123456789`],resolve:ki,identify:e=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf(`e`)<0,represent:e=>e.toString(10)}),ji=RegExp(`^(?:[-+]?0b[0-1_]+|[-+]?0[0-7_]+|[-+]?0x[0-9a-fA-F_]+|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+|[-+]?(?:0|[1-9][0-9_]*))$`);function Mi(e){let t=e.replace(/_/g,``),n=1;if((t[0]===`-`||t[0]===`+`)&&(t[0]===`-`&&(n=-1),t=t.slice(1)),t.startsWith(`0b`))return n*parseInt(t.slice(2),2);if(t.startsWith(`0x`))return n*parseInt(t.slice(2),16);if(t.includes(`:`)){let e=0;for(let n of t.split(`:`))e=e*60+Number(n);return n*e}return t!==`0`&&t[0]===`0`?n*parseInt(t,8):n*parseInt(t,10)}function Ni(e){if(!ji.test(e))return B;let t=Mi(e);return Number.isFinite(t)?t:B}var Pi=V(`tag:yaml.org,2002:int`,{implicit:!0,implicitFirstChars:[`-`,`+`,...`0123456789`],resolve:Ni,identify:e=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf(`e`)<0,represent:e=>e.toString(10)}),Fi=RegExp(`^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`),Ii=RegExp(`^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`);function Li(e){if(!Fi.test(e))return B;let t=e.toLowerCase(),n=t[0]===`-`?-1:1;if(`+-`.includes(t[0])&&(t=t.slice(1)),t===`.inf`)return n===1?1/0:-1/0;if(t===`.nan`)return NaN;let r=n*parseFloat(t);return Number.isFinite(r)||Ii.test(e)?r:B}function Ri(e){if(isNaN(e))return`.nan`;if(e===1/0)return`.inf`;if(e===-1/0)return`-.inf`;if(Object.is(e,-0))return`-0.0`;let t=e.toString(10);return/^[-+]?[0-9]+e/.test(t)?t.replace(`e`,`.e`):t}var zi=V(`tag:yaml.org,2002:float`,{implicit:!0,implicitFirstChars:[`-`,`+`,`.`,...`0123456789`],resolve:Li,identify:e=>typeof e==`number`&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf(`e`)>=0),represent:Ri}),Bi=RegExp(`^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$`),Vi=RegExp(`^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`);function Hi(e,t){if(t){if(!Vi.test(e))return B;let t=e.toLowerCase(),n=t[0]===`-`?-1:1;if(`+-`.includes(t[0])&&(t=t.slice(1)),t===`.inf`)return n===1?1/0:-1/0;if(t===`.nan`)return NaN;let r=n*parseFloat(t);return Number.isFinite(r)?r:B}if(!Bi.test(e))return B;let n=Number(e);return Number.isFinite(n)?n:B}function Ui(e){if(isNaN(e))return`.nan`;if(e===1/0)return`.inf`;if(e===-1/0)return`-.inf`;if(Object.is(e,-0))return`-0.0`;let t=e.toString(10);return/^[-+]?[0-9]+e/.test(t)?t.replace(`e`,`.e`):t}var Wi=V(`tag:yaml.org,2002:float`,{implicit:!0,implicitFirstChars:[`-`,...`0123456789`],resolve:Hi,identify:e=>typeof e==`number`&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf(`e`)>=0),represent:Ui}),Gi=RegExp(`^(?:[-+]?(?:(?:[0-9][0-9_]*)?\\.[0-9_]*)(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`),Ki=RegExp(`^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`);function qi(e){if(!Gi.test(e))return B;let t=e.toLowerCase().replace(/_/g,``),n=t[0]===`-`?-1:1;if(`+-`.includes(t[0])&&(t=t.slice(1)),t===`.inf`)return n===1?1/0:-1/0;if(t===`.nan`)return NaN;let r=0;if(t.includes(`:`)){for(let e of t.split(`:`))r=r*60+Number(e);r*=n}else r=n*parseFloat(t);return Number.isFinite(r)||Ki.test(e)?r:B}function Ji(e){if(isNaN(e))return`.nan`;if(e===1/0)return`.inf`;if(e===-1/0)return`-.inf`;if(Object.is(e,-0))return`-0.0`;let t=e.toString(10);return/^[-+]?[0-9]+e/.test(t)?t.replace(`e`,`.e`):t}var Yi=V(`tag:yaml.org,2002:float`,{implicit:!0,implicitFirstChars:[`-`,`+`,`.`,...`0123456789`],resolve:qi,identify:e=>typeof e==`number`&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf(`e`)>=0),represent:Ji}),Xi=V(`tag:yaml.org,2002:merge`,{implicit:!0,implicitFirstChars:[`<`],resolve:(e,t)=>e===`<<`||t&&e===``?`<<`:B,identify:()=>!1}),Zi=/^[A-Za-z0-9+/]*={0,2}$/;function Qi(e){let t=e.replace(/\s/g,``);if(t.length%4!=0||!Zi.test(t))return B;let n=atob(t),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r}function $i(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}var ea=V(`tag:yaml.org,2002:binary`,{resolve:Qi,identify:e=>Object.prototype.toString.call(e)===`[object Uint8Array]`,represent:$i}),ta=RegExp(`^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$`),na=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 ra(e,t,n,r=0,i=0,a=0,o=0){let s=new Date(Date.UTC(e,t,n,r,i,a,o));return s.setUTCFullYear(e,t,n),s}function ia(e){let t=ta.exec(e);if(t===null&&(t=na.exec(e)),t===null)return B;let n=+t[1],r=t[2]-1,i=+t[3];if(!t[4]){let e=ra(n,r,i);return e.getUTCFullYear()!==n||e.getUTCMonth()!==r||e.getUTCDate()!==i?B:e}let a=+t[4],o=+t[5],s=+t[6],c=0;if(a>23||o>59||s>59)return B;if(t[7]){let e=t[7].slice(0,3);for(;e.length<3;)e+=`0`;c=+e}let l=ra(n,r,i,a,o,s,c);if(l.getUTCFullYear()!==n||l.getUTCMonth()!==r||l.getUTCDate()!==i)return B;if(t[9]){let e=+t[10],n=+(t[11]||0);if(e>23||n>59)return B;let r=(e*60+n)*6e4;l.setTime(l.getTime()-(t[9]===`-`?-r:r))}return l}var aa=V(`tag:yaml.org,2002:timestamp`,{implicit:!0,implicitFirstChars:[...`0123456789`],resolve:ia,identify:e=>e instanceof Date,represent:e=>e.toISOString()}),oa=ii(`tag:yaml.org,2002:seq`,{create:()=>[],addItem:(e,t)=>{e.push(t)},identify:Array.isArray});function sa(e){if(typeof e!=`object`||!e||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function ca(e,t){let n={};for(let r of t)e[r]!==void 0&&(n[r]=e[r]);return n}var la=ii(`tag:yaml.org,2002:omap`,{create:()=>({list:[],seen:new Set}),addItem:(e,t)=>{let n;if(t instanceof Map){if(t.size!==1)return`cannot resolve an ordered map item`;n=t.keys().next().value}else if(sa(t)){let e=Object.keys(t);if(e.length!==1)return`cannot resolve an ordered map item`;n=e[0]}else return`cannot resolve an ordered map item`;return e.seen.has(n)?`duplicate key in ordered map`:(e.seen.add(n),e.list.push(t),``)},finalize:e=>e.list,identify:()=>!1}),ua=ii(`tag:yaml.org,2002:pairs`,{create:()=>[],addItem:(e,t)=>{if(t instanceof Map)return t.size===1?(e.push(t.entries().next().value),``):`cannot resolve a pairs item`;if(Object.prototype.toString.call(t)!==`[object Object]`)return`cannot resolve a pairs item`;let n=t,r=Object.keys(n);return r.length===1?(e.push([r[0],n[r[0]]]),``):`cannot resolve a pairs item`},identify:()=>!1}),da=ai(`tag:yaml.org,2002:map`,{create:()=>({}),identify:sa,represent:e=>{let t=new Map;for(let n of Object.keys(e))t.set(n,e[n]);return t},addPair:(e,t,n)=>{if(typeof t==`object`&&t)return`object-based map does not support complex keys`;let r=String(t);return r===`__proto__`?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,``},has:(e,t)=>typeof t==`object`&&t?!1:Object.prototype.hasOwnProperty.call(e,String(t)),keys:e=>Object.keys(e),get:(e,t)=>{let n=String(t);return Object.prototype.hasOwnProperty.call(e,n)?e[n]:null}}),fa=ai(`tag:yaml.org,2002:set`,{create:()=>new Set,identify:e=>e instanceof Set,represent:e=>{let t=new Map;for(let n of e)t.set(n,null);return t},addPair:(e,t,n)=>n===null?(e.add(t),``):`cannot resolve a set item`,has:(e,t)=>e.has(t),keys:e=>e.keys(),get:()=>null});function pa(){return{scalar:Object.create(null),sequence:Object.create(null),mapping:Object.create(null)}}function ma(){return{scalar:[],sequence:[],mapping:[]}}function ha(e){let t=[];for(let n of e){let e=t.length;for(let r=0;r<t.length;r++){let i=t[r];if(i.nodeKind===n.nodeKind&&i.tagName===n.tagName&&i.matchByTagPrefix===n.matchByTagPrefix){e=r;break}}t[e]=n}return t}var ga=class e{tags;implicitScalarTags;implicitScalarByFirstChar;implicitScalarAnyFirstChar;defaultScalarTag;defaultSequenceTag;defaultMappingTag;exact;prefix;constructor(e){let t=ha(e),n=[],r=pa(),i=ma();for(let e of t){if(e.nodeKind===`scalar`&&e.implicit){if(e.matchByTagPrefix)throw Error(`Implicit scalar tags cannot match by tag prefix`);n.push(e)}switch(e.nodeKind){case`scalar`:e.matchByTagPrefix?i.scalar.push(e):r.scalar[e.tagName]=e;break;case`sequence`:e.matchByTagPrefix?i.sequence.push(e):r.sequence[e.tagName]=e;break;case`mapping`:e.matchByTagPrefix?i.mapping.push(e):r.mapping[e.tagName]=e}}let a=n.filter(e=>e.implicitFirstChars===null),o=new Set;for(let e of n)if(e.implicitFirstChars!==null)for(let t of e.implicitFirstChars)o.add(t);let s=new Map;for(let e of o)s.set(e,n.filter(t=>t.implicitFirstChars===null||t.implicitFirstChars.indexOf(e)!==-1));let c=r.scalar[`tag:yaml.org,2002:str`];if(!c)throw Error(`schema does not define the default scalar tag (tag:yaml.org,2002:str)`);this.tags=t,this.implicitScalarTags=n,this.implicitScalarByFirstChar=s,this.implicitScalarAnyFirstChar=a,this.defaultScalarTag=c,this.defaultSequenceTag=r.sequence[`tag:yaml.org,2002:seq`],this.defaultMappingTag=r.mapping[`tag:yaml.org,2002:map`],this.exact=r,this.prefix=i}lookupScalarTag(e){let t=this.exact.scalar[e];if(t)return t;for(let t of this.prefix.scalar)if(e.startsWith(t.tagName))return t}lookupSequenceTag(e){let t=this.exact.sequence[e];if(t)return t;for(let t of this.prefix.sequence)if(e.startsWith(t.tagName))return t}lookupMappingTag(e){let t=this.exact.mapping[e];if(t)return t;for(let t of this.prefix.mapping)if(e.startsWith(t.tagName))return t}resolveImplicitScalarTag(e){let t=this.implicitScalarByFirstChar.get(e.charAt(0))??this.implicitScalarAnyFirstChar;for(let n of t){let t=n.resolve(e,!1,n.tagName);if(t!==B)return{value:t,tag:n}}let n=this.defaultScalarTag;return{value:n.resolve(e,!1,n.tagName),tag:n}}withTags(...t){let n=[];for(let e of t)n=n.concat(e);return new e([...this.tags,...n])}},_a=new ga([oi,oa,da]);new ga([..._a.tags,li,_i,Ai,Wi]);var va=new ga([..._a.tags,ci,mi,Ti,zi]);new ga([..._a.tags,di,bi,Pi,Yi,aa,Xi,ea,la,ua,fa]).withTags({...Pi,resolve:(e,t,n)=>{let r=Pi.resolve(e,t,n);return r===B?Ti.resolve(e,t,n):r}},{...Yi,resolve:(e,t,n)=>{let r=Yi.resolve(e,t,n);return r===B?zi.resolve(e,t,n):r}}),ai(`tag:yaml.org,2002:map`,{create:()=>new Map,addPair:(e,t,n)=>(e.set(t,n),``),has:(e,t)=>e.has(t),keys:e=>e.keys(),get:(e,t)=>e.get(t),identify:e=>e instanceof Map||sa(e),represent:e=>{if(e instanceof Map)return e;let t=new Map,n=e;for(let e of Object.keys(n))t.set(e,n[e]);return t}});function ya(e){if(Array.isArray(e)){let t=Array.prototype.slice.call(e);for(let e=0;e<t.length;e++){if(Array.isArray(t[e]))return null;typeof t[e]==`object`&&Object.prototype.toString.call(t[e])===`[object Object]`&&(t[e]=`[object Object]`)}return String(t)}return typeof e==`object`&&Object.prototype.toString.call(e)===`[object Object]`?`[object Object]`:String(e)}ai(`tag:yaml.org,2002:map`,{create:()=>({}),identify:sa,represent:e=>{let t=new Map;for(let n of Object.keys(e))t.set(n,e[n]);return t},addPair:(e,t,n)=>{let r=ya(t);return r===null?`nested arrays are not supported inside keys`:(r===`__proto__`?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,``)},has:(e,t)=>{let n=ya(t);return n!==null&&Object.prototype.hasOwnProperty.call(e,n)},keys:e=>Object.keys(e),get:(e,t)=>{let n=String(t);return Object.prototype.hasOwnProperty.call(e,n)?e[n]:null}});var ba={maxLength:79,indent:1,linesBefore:3,linesAfter:2};function xa(e,t,n,r,i){let a=``,o=``,s=Math.floor(i/2)-1;return r-t>s&&(a=` ... `,t=r-s+a.length),n-r>s&&(o=` ...`,n=r+s-o.length),{str:a+e.slice(t,n).replace(/\t/g,`→`)+o,pos:r-t+a.length}}function Sa(e,t){return` `.repeat(Math.max(t-e.length,0))+e}function Ca(e,t){if(!e.buffer)return null;let n={...ba,...t},r=/\r?\n|\r|\0/g,i=[0],a=[],o,s=-1;for(;o=r.exec(e.buffer);)a.push(o.index),i.push(o.index+o[0].length),e.position<=o.index&&s<0&&(s=i.length-2);s<0&&(s=i.length-1);let c=``,l=Math.min(e.line+n.linesAfter,a.length).toString().length,u=n.maxLength-(n.indent+l+3);for(let t=1;t<=n.linesBefore&&!(s-t<0);t++){let r=xa(e.buffer,i[s-t],a[s-t],e.position-(i[s]-i[s-t]),u);c=`${` `.repeat(n.indent)}${Sa((e.line-t+1).toString(),l)} | ${r.str}\n${c}`}let d=xa(e.buffer,i[s],a[s],e.position,u);c+=`${` `.repeat(n.indent)}${Sa((e.line+1).toString(),l)} | ${d.str}\n`,c+=`${`-`.repeat(n.indent+l+3+d.pos)}^\n`;for(let t=1;t<=n.linesAfter&&!(s+t>=a.length);t++){let r=xa(e.buffer,i[s+t],a[s+t],e.position-(i[s]-i[s+t]),u);c+=`${` `.repeat(n.indent)}${Sa((e.line+t+1).toString(),l)} | ${r.str}\n`}return c.replace(/\n$/,``)}function wa(e,t){let n=``;return e.mark?(e.mark.name&&(n+=`in "${e.mark.name}" `),n+=`(${e.mark.line+1}:${e.mark.column+1})`,!t&&e.mark.snippet&&(n+=`\n\n${e.mark.snippet}`),`${e.reason} ${n}`):e.reason}var Ta=class e extends Error{reason;mark;constructor(e,t){super(),this.name=`YAMLException`,this.reason=e,this.mark=t,this.message=wa(this,!1),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}toString(e){return`${this.name}: ${wa(this,e)}`}static throwAt(t,n,r,i=``){let a=0,o=0;for(let e=0;e<n;e++){let n=t.charCodeAt(e);n===10?(a++,o=e+1):n===13&&(a++,t.charCodeAt(e+1)===10&&e++,o=e+1)}let s={name:i,buffer:t,position:n,line:a,column:n-o};throw s.snippet=Ca(s),new e(r,s)}},H={DOCUMENT:1,SEQUENCE:2,MAPPING:3,SCALAR:4,ALIAS:5,POP:6},U={PLAIN:1,SINGLE_QUOTED:2,DOUBLE_QUOTED:3,LITERAL_BLOCK:4,FOLDED_BLOCK:5},Ea={BLOCK:1,FLOW:2},W={CLIP:1,STRIP:2,KEEP:3},Da=-1;function Oa(e){switch(e){case 48:return`\0`;case 97:return`\x07`;case 98:return`\b`;case 116:return` `;case 9:return` `;case 110:return`
|
|
9
|
+
`;case 118:return`\v`;case 102:return`\f`;case 114:return`\r`;case 101:return`\x1B`;case 32:return` `;case 34:return`"`;case 47:return`/`;case 92:return`\\`;case 78:return`
`;case 95:return`\xA0`;case 76:return`\u2028`;case 80:return`\u2029`;default:return``}}var ka=Array(256),Aa=Array(256);for(let e=0;e<256;e++)ka[e]=+!!Oa(e),Aa[e]=Oa(e);function ja(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function Ma(e){return e>=48&&e<=57?e-48:(e|32)-97+10}function Na(e){return e===120?2:e===117?4:8}function Pa(e,t,n){let r=0;for(;t<n;){let n=e.charCodeAt(t);if(n===10)r++,t++;else if(n===13)r++,t++,e.charCodeAt(t)===10&&t++;else if(n===32||n===9)t++;else break}return{position:t,breaks:r}}function Fa(e){return e===1?` `:`
|
|
10
|
+
`.repeat(e-1)}function Ia(e,t,n){let r=``,i=t,a=t,o=t;for(;i<n;){let t=e.charCodeAt(i);if(t===10||t===13){r+=e.slice(a,o);let t=Pa(e,i,n);r+=Fa(t.breaks),i=a=o=t.position}else i++,t!==32&&t!==9&&(o=i)}return r+e.slice(a,o)}function La(e,t,n){let r=``,i=t,a=t,o=t;for(;i<n;){let t=e.charCodeAt(i);if(t===39)r+=e.slice(a,i)+`'`,i+=2,a=o=i;else if(t===10||t===13){r+=e.slice(a,o);let t=Pa(e,i,n);r+=Fa(t.breaks),i=a=o=t.position}else i++,t!==32&&t!==9&&(o=i)}return r+e.slice(a,n)}function Ra(e,t,n){let r=``,i=t,a=t,o=t;for(;i<n;){let t=e.charCodeAt(i);if(t===92){r+=e.slice(a,i),i++;let t=e.charCodeAt(i);if(t===10||t===13)i=Pa(e,i,n).position;else if(t<256&&ka[t])r+=Aa[t],i++;else{let n=Na(t),a=0;for(;n>0;n--){i++;let t=Ma(e.charCodeAt(i));a=(a<<4)+t}r+=ja(a),i++}a=o=i}else if(t===10||t===13){r+=e.slice(a,o);let t=Pa(e,i,n);r+=Fa(t.breaks),i=a=o=t.position}else i++,t!==32&&t!==9&&(o=i)}return r+e.slice(a,n)}function za(e,t,n,r,i,a){let o=r<0?0:r,s=e.slice(t,n).replace(/\r\n?/g,`
|
|
11
|
+
`),c=s===``?[]:(s.endsWith(`
|
|
12
|
+
`)?s.slice(0,-1):s).split(`
|
|
13
|
+
`),l=``,u=!1,d=0,f=!1;for(let e of c){let t=0;for(;t<o&&e.charCodeAt(t)===32;)t++;if(r<0||t>=e.length){d++;continue}let n=e.slice(o),i=n.charCodeAt(0);a?i===32||i===9?(f=!0,l+=`
|
|
14
|
+
`.repeat(u?1+d:d)):f?(f=!1,l+=`
|
|
15
|
+
`.repeat(d+1)):d===0?u&&(l+=` `):l+=`
|
|
16
|
+
`.repeat(d):l+=`
|
|
17
|
+
`.repeat(u?1+d:d),l+=n,u=!0,d=0}return i===W.KEEP?l+=`
|
|
18
|
+
`.repeat(u?1+d:d):i!==W.STRIP&&u&&(l+=`
|
|
19
|
+
`),l}function Ba(e,t){if(t.valueStart===Da)return``;let{valueStart:n,valueEnd:r}=t;if(t.fast)return e.slice(n,r);switch(t.style){case U.SINGLE_QUOTED:return La(e,n,r);case U.DOUBLE_QUOTED:return Ra(e,n,r);case U.LITERAL_BLOCK:return za(e,n,r,t.indent,t.chomping,!1);case U.FOLDED_BLOCK:return za(e,n,r,t.indent,t.chomping,!0);default:return Ia(e,n,r)}}var Va=Object.assign(Object.create(null),{"!":`!`,"!!":`tag:yaml.org,2002:`});function Ha(e,t){if(e.startsWith(`!<`)&&e.endsWith(`>`))return decodeURIComponent(e.slice(2,-1));let n=e.indexOf(`!`,1),r=n===-1?`!`:e.slice(0,n+1),i=t?.[r]??Va[r]??r;return decodeURIComponent(i)+decodeURIComponent(e.slice(r.length))}var Ua=-1,Wa=`tag:yaml.org,2002:merge`,Ga={filename:``,schema:va,json:!1,maxTotalMergeKeys:1e4,maxAliases:-1};function Ka(e){return`tagStart`in e&&e.tagStart!==Ua?e.tagStart:`anchorStart`in e&&e.anchorStart!==Ua?e.anchorStart:`valueStart`in e&&e.valueStart!==Ua?e.valueStart:`start`in e?e.start:0}function G(e,t){Ta.throwAt(e.source,e.position,t,e.filename)}function qa(e,t,n,r){try{return n.finalize(r)}catch(n){if(n instanceof Ta)throw n;Ta.throwAt(e.source,t,n instanceof Error?n.message:String(n),e.filename)}}function Ja(e,t){let n=Ba(e.source,t),r=t.tagStart===Ua?``:e.source.slice(t.tagStart,t.tagEnd),i=e.schema.defaultScalarTag;if(r!==``){if(r===`!`)return{value:n,tag:i};let t=Ha(r,e.tagHandlers),a=e.schema.lookupScalarTag(t);if(a){let r=a.resolve(n,!0,t);return r===B&&G(e,`cannot resolve a node with !<${t}> explicit tag`),{value:r,tag:a}}let o=e.schema.lookupMappingTag(t)??e.schema.lookupSequenceTag(t);if(o){n!==``&&G(e,`cannot resolve a node with !<${t}> explicit tag`);let r=o.create(t);return{value:o.carrierIsResult?r:qa(e,e.position,o,r),tag:o}}G(e,`unknown scalar tag !<${t}>`)}return t.style===U.PLAIN?e.schema.resolveImplicitScalarTag(n):{value:i.resolve(n,!1,i.tagName),tag:i}}function Ya(e,t,n){let r=t.tagStart===Ua?``:e.source.slice(t.tagStart,t.tagEnd);return r===``||r===`!`?n:Ha(r,e.tagHandlers)}function Xa(e){return e.nodeKind===`mapping`}function Za(e){e.totalMergeKeys++,e.maxTotalMergeKeys!==-1&&e.totalMergeKeys>e.maxTotalMergeKeys&&G(e,`merge keys exceeded maxTotalMergeKeys (${e.maxTotalMergeKeys})`)}function Qa(e,t,n,r){Za(e);for(let i of r.keys(n)){if(Za(e),t.tag.has(t.value,i))continue;let a=t.tag.addPair(t.value,i,r.get(n,i));a&&G(e,a),t.overridable??=new Set,t.overridable.add(i)}}function $a(e,t,n,r){if(e.position=t.keyPosition,Xa(r))Qa(e,t,n,r);else if(r.nodeKind===`sequence`&&Array.isArray(n)){n.length>100&&G(e,`abnormal merge sequence size`);for(let r of n){let n=e.nodeTags.get(r);n||G(e,`cannot merge mappings; the provided source object is unacceptable`),Qa(e,t,r,n)}}else G(e,`cannot merge mappings; the provided source object is unacceptable`)}function eo(e,t,n,r,i){if(e.position=t.keyPosition,t.keyIsMerge){$a(e,t,r,i);return}!e.json&&t.tag.has(t.value,n)&&!t.overridable?.has(n)&&G(e,`duplicated mapping key`);let a=t.tag.addPair(t.value,n,r);a&&G(e,a),t.overridable?.delete(n)}function to(e,t,n){let r=e.frames[e.frames.length-1];if(r.kind===`document`)r.value=t,r.hasValue=!0;else if(r.kind===`sequence`){Xa(n)&&e.nodeTags.set(t,n);let i=r.tag.addItem(r.value,t,r.index++);i&&G(e,i)}else if(r.hasKey){let i=r.key;r.key=void 0,r.hasKey=!1,eo(e,r,i,t,n)}else r.key=t,r.keyPosition=e.position,r.hasKey=!0,r.keyIsMerge=n.tagName===Wa}function no(e,t,n,r,i){if(t.anchorStart!==Ua){let a={value:n,tag:r,isValueFinal:i};return e.anchors.set(e.source.slice(t.anchorStart,t.anchorEnd),a),a}return null}function ro(e,t){let n={...Ga,...t,events:e,documents:[],eventIndex:0,position:0,frames:[],anchors:new Map,nodeTags:new Map,tagHandlers:Object.create(null),totalMergeKeys:0,aliasCount:0};for(;n.eventIndex<n.events.length;){let e=n.events[n.eventIndex++];switch(n.position=Ka(e),e.type){case H.DOCUMENT:n.anchors=new Map,n.nodeTags=new Map,n.aliasCount=0,n.tagHandlers=Object.create(null);for(let t of e.directives)t.kind===`tag`&&(n.tagHandlers[t.handle]=t.prefix);n.frames.push({kind:`document`,position:n.position,value:void 0,hasValue:!1});break;case H.SCALAR:{let{value:t,tag:r}=Ja(n,e);no(n,e,t,r,!0),to(n,t,r);break}case H.SEQUENCE:{let t=Ya(n,e,`tag:yaml.org,2002:seq`),r=n.schema.lookupSequenceTag(t);r||G(n,`unknown sequence tag !<${t}>`);let i=r.create(t),a=no(n,e,i,r,r.carrierIsResult);n.frames.push({kind:`sequence`,position:n.position,value:i,tag:r,anchor:a,index:0});break}case H.MAPPING:{let t=Ya(n,e,`tag:yaml.org,2002:map`),r=n.schema.lookupMappingTag(t);r||G(n,`unknown mapping tag !<${t}>`);let i=r.create(t),a=no(n,e,i,r,r.carrierIsResult);n.frames.push({kind:`mapping`,position:n.position,value:i,tag:r,anchor:a,key:void 0,keyPosition:n.position,hasKey:!1,keyIsMerge:!1,overridable:null});break}case H.ALIAS:{n.maxAliases!==-1&&++n.aliasCount>n.maxAliases&&G(n,`aliases exceeded maxAliases (${n.maxAliases})`);let t=n.source.slice(e.anchorStart,e.anchorEnd),r=n.anchors.get(t);r||G(n,`unidentified alias "${t}"`),r.isValueFinal||G(n,`recursive alias "${t}" is not supported for tag ${r.tag.tagName} because it uses finalize()`),to(n,r.value,r.tag);break}case H.POP:{let e=n.frames.pop();if(e.kind===`mapping`&&e.hasKey&&(n.position=e.keyPosition,G(n,`incomplete mapping pair in event stream`)),e.kind===`document`)n.documents.push(e.value);else{let t=e.tag.carrierIsResult?e.value:qa(n,e.position,e.tag,e.value);e.anchor&&(e.anchor.value=t,e.anchor.isValueFinal=!0),to(n,t,e.tag)}break}}}return n.documents}var K=-1,io=Object.prototype.hasOwnProperty,ao=1,oo=2,so=3,co=4,lo=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,uo=/[,\[\]{}]/,fo=/^(?:!|!!|![0-9A-Za-z-]+!)$/,po=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]])`,mo=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$.~*'()_])`,ho=RegExp(`^(?:${po})*$`),go=RegExp(`^(?:${mo})+$`),_o=RegExp(`^(?:!(?:${po})*|${mo}(?:${po})*)$`),vo={filename:``,maxDepth:100};function yo(e,t,n){e.events.push({type:H.DOCUMENT,explicitStart:t,explicitEnd:n,directives:e.directives})}function bo(e,t,n,r,i,a,o){e.events.push({type:H.SEQUENCE,start:t,anchorStart:n,anchorEnd:r,tagStart:i,tagEnd:a,style:o})}function xo(e,t,n,r,i,a,o){e.events.push({type:H.MAPPING,start:t,anchorStart:n,anchorEnd:r,tagStart:i,tagEnd:a,style:o})}function So(e,t){e.events.splice(t.eventsLength,0,{type:H.MAPPING,start:t.position,anchorStart:K,anchorEnd:K,tagStart:K,tagEnd:K,style:Ea.FLOW})}function Co(e,t,n,r,i,a,o,s,c=W.CLIP,l=-1,u=!1){e.events.push({type:H.SCALAR,valueStart:t,valueEnd:n,anchorStart:r,anchorEnd:i,tagStart:a,tagEnd:o,style:s,chomping:c,indent:l,fast:u})}function wo(e,t,n){e.events.push({type:H.ALIAS,anchorStart:t,anchorEnd:n})}function To(e){e.events.push({type:H.POP})}function q(e){Co(e,K,K,K,K,K,K,U.PLAIN)}function Eo(){return{anchorStart:K,anchorEnd:K,tagStart:K,tagEnd:K}}function Do(e){return{position:e.position,line:e.line,lineStart:e.lineStart,lineIndent:e.lineIndent,firstTabInLine:e.firstTabInLine,eventsLength:e.events.length}}function Oo(e,t){e.position=t.position,e.line=t.line,e.lineStart=t.lineStart,e.lineIndent=t.lineIndent,e.firstTabInLine=t.firstTabInLine,e.events.length=t.eventsLength}function J(e,t){Ta.throwAt(e.input.slice(0,e.length),e.position,t,e.filename)}function Y(e){return e===10||e===13}function ko(e){return e===9||e===32}function Ao(e){return ko(e)||Y(e)}function jo(e){return e===0||Ao(e)}function Mo(e){return e===44||e===91||e===93||e===123||e===125}function No(e){return e>=48&&e<=57?e-48:-1}function Po(e){if(e>=48&&e<=57)return e-48;let t=e|32;return t>=97&&t<=102?t-97+10:-1}function Fo(e){return e===120?2:e===117?4:e===85?8:0}function Io(e){return e===48||e===97||e===98||e===116||e===9||e===110||e===118||e===102||e===114||e===101||e===32||e===34||e===47||e===92||e===78||e===95||e===76||e===80}function Lo(e){e.input.charCodeAt(e.position)===10?e.position++:(e.position++,e.input.charCodeAt(e.position)===10&&e.position++),e.line++,e.lineStart=e.position,e.lineIndent=0,e.firstTabInLine=-1}function X(e,t){let n=0,r=e.input.charCodeAt(e.position),i=e.position===e.lineStart||Ao(e.input.charCodeAt(e.position-1));for(;r!==0;){for(;ko(r);)i=!0,r===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),r=e.input.charCodeAt(++e.position);if(t&&i&&r===35)do r=e.input.charCodeAt(++e.position);while(!Y(r)&&r!==0);if(!Y(r))break;for(Lo(e),n++,i=!0,r=e.input.charCodeAt(e.position);r===32;)e.lineIndent++,r=e.input.charCodeAt(++e.position)}return n}function Ro(e,t=e.position){let n=e.input.charCodeAt(t);if((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)){let n=e.input.charCodeAt(t+3);return n===0||Ao(n)}return!1}function zo(e){e.position===e.lineStart&&e.input.charCodeAt(e.position)===65279&&(e.position++,e.lineStart=e.position)}function Bo(e){if(e.position!==e.lineStart)return!1;if(Ro(e))return!0;if(e.input.charCodeAt(e.position)!==65279)return!1;let t=Do(e);zo(e),X(e,!0);let n=e.input.charCodeAt(e.position),r=e.position===e.lineStart&&(n===37||n===45&&Ro(e));return Oo(e,t),r}function Vo(e){let t=e.input.charCodeAt(e.position);for(;t!==0&&!Y(t);)t=e.input.charCodeAt(++e.position)}function Ho(e,t,n){lo.test(e.input.slice(t,n))&&J(e,`the stream contains non-printable characters`)}function Uo(e,t,n){if(e.input.charCodeAt(e.position)!==33)return!1;t.tagStart!==K&&J(e,`duplication of a tag property`);let r=e.position,i=!1,a=!1,o=`!`,s=e.input.charCodeAt(++e.position);s===60?(i=!0,s=e.input.charCodeAt(++e.position)):s===33&&(a=!0,o=`!!`,s=e.input.charCodeAt(++e.position));let c=e.position,l;if(i){for(;s!==0&&s!==62;)s=e.input.charCodeAt(++e.position);s!==62&&J(e,`unexpected end of the stream within a verbatim tag`),l=e.input.slice(c,e.position),e.position++}else{for(;s!==0&&!Ao(s)&&!(n&&Mo(s));)s===33&&(a?J(e,`tag suffix cannot contain exclamation marks`):(o=e.input.slice(c-1,e.position+1),fo.test(o)||J(e,`named tag handle cannot contain such characters`),a=!0,c=e.position+1)),s=e.input.charCodeAt(++e.position);l=e.input.slice(c,e.position),uo.test(l)&&J(e,`tag suffix cannot contain flow indicator characters`)}return l&&!(i?ho.test(l):go.test(l))&&J(e,`tag name cannot contain such characters: ${l}`),!i&&o!==`!`&&o!==`!!`&&!io.call(e.tagHandlers,o)&&J(e,`undeclared tag handle "${o}"`),t.tagStart=r,t.tagEnd=e.position,!0}function Wo(e,t){if(e.input.charCodeAt(e.position)!==38)return!1;t.anchorStart!==K&&J(e,`duplication of an anchor property`),e.position++;let n=e.position;for(;e.input.charCodeAt(e.position)!==0&&!Ao(e.input.charCodeAt(e.position))&&!Mo(e.input.charCodeAt(e.position));)e.position++;return e.position===n&&J(e,`name of an anchor node must contain at least one character`),t.anchorStart=n,t.anchorEnd=e.position,!0}function Go(e,t){if(e.input.charCodeAt(e.position)!==42)return!1;(t.anchorStart!==K||t.tagStart!==K)&&J(e,`alias node should not have any properties`),e.position++;let n=e.position;for(;e.input.charCodeAt(e.position)!==0&&!Ao(e.input.charCodeAt(e.position))&&!Mo(e.input.charCodeAt(e.position));)e.position++;return e.position===n&&J(e,`name of an alias node must contain at least one character`),wo(e,n,e.position),!0}function Ko(e,t){X(e,!1),e.lineIndent<t&&J(e,`deficient indentation`)}function qo(e,t,n){if(e.input.charCodeAt(e.position)!==39)return!1;e.position++;let r=e.position,i=!0;for(;e.input.charCodeAt(e.position)!==0;){let a=e.input.charCodeAt(e.position);if(a===39){if(e.input.charCodeAt(e.position+1)===39){i=!1,e.position+=2;continue}let t=e.position;return e.position++,Co(e,r,t,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,U.SINGLE_QUOTED,W.CLIP,-1,i),!0}Y(a)?(i=!1,Ko(e,t)):e.position===e.lineStart&&Ro(e)?J(e,`unexpected end of the document within a single quoted scalar`):a!==9&&a<32?J(e,`expected valid JSON character`):e.position++}J(e,`unexpected end of the stream within a single quoted scalar`)}function Jo(e,t,n){if(e.input.charCodeAt(e.position)!==34)return!1;e.position++;let r=e.position,i=!0;for(;e.input.charCodeAt(e.position)!==0;){let a=e.input.charCodeAt(e.position);if(a===34){let t=e.position;return e.position++,Co(e,r,t,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,U.DOUBLE_QUOTED,W.CLIP,-1,i),!0}if(a===92){i=!1;let n=e.input.charCodeAt(++e.position);if(Y(n))Ko(e,t);else if(Io(n))e.position++;else{let t=Fo(n);for(t===0&&J(e,`unknown escape sequence`);t-->0;)e.position++,Po(e.input.charCodeAt(e.position))<0&&J(e,`expected hexadecimal character`);e.position++}}else Y(a)?(i=!1,Ko(e,t)):e.position===e.lineStart&&Ro(e)?J(e,`unexpected end of the document within a double quoted scalar`):a!==9&&a<32?J(e,`expected valid JSON character`):e.position++}J(e,`unexpected end of the stream within a double quoted scalar`)}function Yo(e,t,n){let r=e.input.charCodeAt(e.position),i=W.CLIP,a=-1,o=!1;if(r!==124&&r!==62)return!1;let s=r===124?U.LITERAL_BLOCK:U.FOLDED_BLOCK;for(e.position++;e.input.charCodeAt(e.position)!==0;){let n=e.input.charCodeAt(e.position),r=No(n);if(n===43||n===45)i!==W.CLIP&&J(e,`repeat of a chomping mode identifier`),i=n===43?W.KEEP:W.STRIP,e.position++;else if(r>=0)r===0&&J(e,`bad explicit indentation width of a block scalar; it cannot be less than one`),o&&J(e,`repeat of an indentation width identifier`),a=t+r-1,o=!0,e.position++;else break}let c=!1;for(;ko(e.input.charCodeAt(e.position));)c=!0,e.position++;c&&e.input.charCodeAt(e.position)===35&&Vo(e),Y(e.input.charCodeAt(e.position))?Lo(e):e.input.charCodeAt(e.position)!==0&&J(e,`a line break is expected`);let l=o?a:-1,u=0,d=e.position,f=e.position;for(;e.input.charCodeAt(e.position)!==0;){let n=e.position,r=0;for(;e.input.charCodeAt(n+r)===32;)r++;let i=e.input.charCodeAt(n+r);if(i===0){l>=0?r>l&&(f=n+r):r>0&&(f=n+r);break}if(Bo(e))break;if(!o&&l===-1&&Y(i)&&(u=Math.max(u,r)),!o&&l===-1&&!Y(i)&&(i===9&&r<t&&(e.position=n+r,J(e,`tab characters must not be used in indentation`)),r<u&&(e.position=n+r,J(e,`bad indentation of a mapping entry`))),l===-1&&i!==0&&!Y(i)&&r<t){e.lineIndent=r,e.position=n+r;break}!o&&i!==0&&!Y(i)&&l===-1&&(l=r);let a=l===-1?t+1:l;if(i!==0&&!Y(i)&&r<a){e.lineIndent=r,e.position=n+r;break}Vo(e),f=e.position,Y(e.input.charCodeAt(e.position))&&(Lo(e),f=e.position)}return Ho(e,d,f),Co(e,d,f,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,s,i,l),!0}function Xo(e,t){let n=e.input.charCodeAt(e.position),r=t===ao;if(n===0||Ao(n)||n===35||n===38||n===42||n===33||n===124||n===62||n===39||n===34||n===37||n===64||n===96||r&&Mo(n))return!1;if(n===63||n===45){let t=e.input.charCodeAt(e.position+1);if(jo(t)||r&&Mo(t))return!1}return!0}function Zo(e,t,n,r){if(!Xo(e,n))return!1;let i=e.position,a=e.position,o=e.input.charCodeAt(e.position),s=n===ao,c=!1;for(;o!==0&&!Bo(e);){if(o===58){let t=e.input.charCodeAt(e.position+1);if(jo(t)||s&&Mo(t))break}else if(o===35){if(Ao(e.input.charCodeAt(e.position-1)))break}else if(s&&Mo(o))break;else if(Y(o)){let n=e.position,r=e.line,i=e.lineStart,a=e.lineIndent;if(X(e,!1),e.lineIndent>=t){c=!0,o=e.input.charCodeAt(e.position);continue}e.position=n,e.line=r,e.lineStart=i,e.lineIndent=a;break}ko(o)||(a=e.position+1),o=e.input.charCodeAt(++e.position)}return a!==i&&(Ho(e,i,a),Co(e,i,a,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,U.PLAIN,W.CLIP,-1,!c),!0)}function Qo(e,t){let n=e.line;X(e,!0),(e.line>n&&e.lineIndent<t||e.firstTabInLine!==-1&&e.lineIndent<t)&&J(e,`deficient indentation`)}function $o(e,t,n){let r=e.input.charCodeAt(e.position),i=r===123,a=e.position,o=!0;if(r!==91&&r!==123)return!1;let s=i?125:93;for(i?xo(e,a,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,Ea.FLOW):bo(e,a,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,Ea.FLOW),e.position++;e.input.charCodeAt(e.position)!==0;){Qo(e,t);let n=e.input.charCodeAt(e.position);if(n===s)return e.position++,To(e),!0;o?n===44&&J(e,`expected the node content, but found ','`):J(e,`missed comma between flow collection entries`);let r=!1,a=!1;n===63&&Ao(e.input.charCodeAt(e.position+1))&&(r=a=!0,e.position+=1,Qo(e,t));let c=e.line,l=Do(e),u=ns(e,t,ao,!1,!0);Qo(e,t),n=e.input.charCodeAt(e.position),(i||a||e.line===c)&&n===58?(r=!0,e.position++,Qo(e,t),i||So(e,l),u||q(e),ns(e,t,ao,!1,!0)||q(e),Qo(e,t),i||To(e)):i&&r?(u||q(e),q(e)):i?q(e):r&&(So(e,l),u||q(e),q(e),To(e)),n=e.input.charCodeAt(e.position),n===44?(o=!0,e.position++):o=!1}J(e,`unexpected end of the stream within a flow collection`)}function es(e,t,n){if(e.firstTabInLine!==-1||e.input.charCodeAt(e.position)!==45||!jo(e.input.charCodeAt(e.position+1)))return!1;for(bo(e,e.position,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,Ea.BLOCK);e.input.charCodeAt(e.position)===45&&jo(e.input.charCodeAt(e.position+1));){e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,J(e,`tab characters must not be used in indentation`));let n=e.line;e.position++;let r=X(e,!0)>0;if(e.firstTabInLine!==-1&&e.input.charCodeAt(e.position)===45&&jo(e.input.charCodeAt(e.position+1))&&J(e,`bad indentation of a sequence entry`),r&&e.lineIndent<=t?q(e):ns(e,t,so,!1,!0),X(e,!0),e.lineIndent<t||e.position>=e.length)break;e.lineIndent>t&&J(e,`bad indentation of a sequence entry`),e.line===n&&e.input.charCodeAt(e.position)===45&&jo(e.input.charCodeAt(e.position+1))&&J(e,`bad indentation of a sequence entry`)}return To(e),!0}function ts(e,t,n,r){let i=!1,a=!1,o=!1,s=!1;if(e.firstTabInLine!==-1)return!1;let c=e.input.charCodeAt(e.position);for(;c!==0;){!i&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,J(e,`tab characters must not be used in indentation`));let l=e.input.charCodeAt(e.position+1),u=e.line;if((c===63||c===58)&&jo(l))o||=(xo(e,e.position,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,Ea.BLOCK),!0),c===63?(i&&q(e),a=!0,i=!0):(i||(q(e),a=!0),i=!1),e.position+=1,s=!0;else{i&&=(q(e),!1);let t=Do(e);if(!ns(e,n,oo,!1,!0))break;if(e.line===u){for(c=e.input.charCodeAt(e.position);ko(c);)c=e.input.charCodeAt(++e.position);if(c===58){if(c=e.input.charCodeAt(++e.position),jo(c)||J(e,`a whitespace character is expected after the key-value separator within a block mapping`),!o){for(Oo(e,t),xo(e,t.position,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,Ea.BLOCK),o=!0,ns(e,n,oo,!1,!0),c=e.input.charCodeAt(e.position);ko(c);)c=e.input.charCodeAt(++e.position);e.position++}a=!0,i=!1,s=!1}else if(a)J(e,`expected ':' after a mapping key`);else return r.anchorStart!==K||r.tagStart!==K?(Oo(e,t),!1):!0}else if(a)J(e,`can not read a block mapping entry; a multiline key may not be an implicit key`);else return r.anchorStart!==K||r.tagStart!==K?(Oo(e,t),!1):!0}if(ns(e,t,co,!0,s)&&(s=!1),i||(s&&=(q(e),!1)),X(e,!0),c=e.input.charCodeAt(e.position),(e.line===u||e.lineIndent>t)&&c!==0)J(e,`bad indentation of a mapping entry`);else if(e.lineIndent<t)break}return a?(i&&q(e),o&&To(e),!0):!1}function ns(e,t,n,r,i,a=!0){e.depth>=e.maxDepth&&J(e,`nesting exceeded maxDepth (${e.maxDepth})`),e.depth++;let o=1,s=!1,c=!1,l=null,u=Eo(),d=n===co||n===so,f=d,p=d;if(r&&X(e,!0)&&(s=!0,o=e.lineIndent>t?1:e.lineIndent===t?0:-1),o===1)for(;;){let r=e.input.charCodeAt(e.position),i=Do(e);if(s&&o!==1&&(r===33||r===38))break;if(s&&p&&(u.tagStart!==K||u.anchorStart!==K)&&(r===33||r===38)){let n=Do(e),r=t+1;if(ts(e,e.position-e.lineStart,r,u)&&e.events[n.eventsLength]?.type===H.MAPPING)return e.depth--,!0;Oo(e,n)}if(s&&(r===33&&u.tagStart!==K||r===38&&u.anchorStart!==K)||!Uo(e,u,n===ao)&&!Wo(e,u))break;l===null&&(l=i),X(e,!0)?(s=!0,f=p,o=e.lineIndent>t?1:e.lineIndent===t?0:-1):f=!1}if(f&&=s||i,o===1||n===co){let r=n===ao||n===oo?t:t+1,i=e.position-e.lineStart;if(o===1){if(f&&(es(e,i,u)||ts(e,i,r,u))||$o(e,r,u))c=!0;else{let t=e.input.charCodeAt(e.position);if(l!==null&&a&&p&&!f&&t!==124&&t!==62){let t=Do(e),n=l.position-l.lineStart;Oo(e,l),ts(e,n,r,Eo())&&e.events[t.eventsLength]?.type===H.MAPPING?c=!0:Oo(e,t)}!c&&(d&&Yo(e,r,u)||qo(e,r,u)||Jo(e,r,u)||Go(e,u)||Zo(e,r,n,u))&&(c=!0)}}else o===0&&(c=f&&es(e,i,u))}return d&&=!c,!c&&(u.anchorStart!==K||u.tagStart!==K||d)&&(Co(e,K,K,u.anchorStart,u.anchorEnd,u.tagStart,u.tagEnd,U.PLAIN),c=!0),e.depth--,c||u.anchorStart!==K||u.tagStart!==K}function rs(e){if(e.lineIndent>0||e.input.charCodeAt(e.position)!==37)return!1;e.position++;let t=e.position;for(;e.input.charCodeAt(e.position)!==0&&!Ao(e.input.charCodeAt(e.position));)e.position++;let n=e.input.slice(t,e.position),r=[];for(n.length===0&&J(e,`directive name must not be less than one character in length`);e.input.charCodeAt(e.position)!==0&&!Y(e.input.charCodeAt(e.position));){for(;ko(e.input.charCodeAt(e.position));)e.position++;if(e.input.charCodeAt(e.position)===35||Y(e.input.charCodeAt(e.position))||e.input.charCodeAt(e.position)===0)break;let t=e.position;for(;e.input.charCodeAt(e.position)!==0&&!Ao(e.input.charCodeAt(e.position));)e.position++;r.push(e.input.slice(t,e.position))}if(Y(e.input.charCodeAt(e.position))&&Lo(e),n===`YAML`){e.directives.some(e=>e.kind===`yaml`)&&J(e,`duplication of %YAML directive`),r.length!==1&&J(e,`YAML directive accepts exactly one argument`);let t=/^([0-9]+)\.([0-9]+)$/.exec(r[0]);t===null&&J(e,`ill-formed argument of the YAML directive`),parseInt(t[1],10)!==1&&J(e,`unacceptable YAML version of the document`),e.directives.push({kind:`yaml`,version:r[0]})}else if(n===`TAG`){r.length!==2&&J(e,`TAG directive accepts exactly two arguments`);let[t,n]=r;fo.test(t)||J(e,`ill-formed tag handle (first argument) of the TAG directive`),io.call(e.tagHandlers,t)&&J(e,`there is a previously declared suffix for "${t}" tag handle`),_o.test(n)||J(e,`ill-formed tag prefix (second argument) of the TAG directive`),e.tagHandlers[t]=n,e.directives.push({kind:`tag`,handle:t,prefix:n})}return!0}function is(e){e.directives=[],e.tagHandlers=Object.create(null);let t=!1;for(X(e,!0);rs(e);)t=!0,X(e,!0);let n=!1,r=!1,i=!0;if(e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45&&jo(e.input.charCodeAt(e.position+3))){n=!0;let t=e.line;e.position+=3,X(e,!0),i=e.line>t}else t&&J(e,`directives end mark is expected`);let a=e.events.length;if(!n&&e.position===e.lineStart&&e.input.charCodeAt(e.position)===46&&Ro(e)){e.position+=3,X(e,!0);return}if(yo(e,n,!1),ns(e,e.lineIndent-1,co,!1,i,i)||q(e),X(e,!0),e.position===e.lineStart&&Ro(e)&&(r=e.input.charCodeAt(e.position)===46,r)){let t=e.line;e.position+=3,X(e,!0),e.line===t&&e.position<e.length&&J(e,`end of the stream or a document separator is expected`)}let o=e.events[a];o?.type===H.DOCUMENT&&(o.explicitEnd=r),To(e),!r&&e.position<e.length&&!Bo(e)&&J(e,`end of the stream or a document separator is expected`)}function as(e,t){let n=e.length,r={...vo,...t,input:`${e}\0`,length:n,position:0,line:0,lineStart:0,lineIndent:0,firstTabInLine:-1,depth:0,directives:[],tagHandlers:Object.create(null),events:[]},i=e.indexOf(`\0`);for(i!==-1&&Ta.throwAt(e,i,`null byte is not allowed in input`,r.filename);r.position<r.length&&(zo(r),X(r,!0),!(r.position>=r.length));){let e=r.position;is(r),r.position===e&&J(r,`can not read a document`)}return r.events}var os={...vo,...Ga};function ss(e,t={}){let n={...os,...t},r=String(e),i=Object.keys(vo),a=Object.keys(Ga);return ro(as(r,ca(n,i)),{...ca(n,a),source:r})}function cs(e,t){let n=ss(e,t);if(n.length===0)throw new Ta(`expected a document, but the input is empty`);if(n.length===1)return n[0];throw new Ta(`expected a single document in the stream, but found more`)}function ls(e,t){return!!(e&1<<t)}var us={applyQuoteFlowKeysOption:fs,doubleQuoteForInvisibles:ps,doubleQuoteWhitespaceOnly:ms,applyForceQuotesOption:hs,tryLongOrMultilineAsBlock:gs,quoteInvalidPlain:_s,fallbackToDoubleQuoted:vs};function ds(e){return e.presenterOptions.quoteStyle===`single`&&ls(e.allowedStylesMask,U.SINGLE_QUOTED)?U.SINGLE_QUOTED:U.DOUBLE_QUOTED}function fs(e){e.presenterOptions.quoteFlowKeys&&e.isKey&&e.flowOnly&&e.style===U.PLAIN&&(e.style=U.DOUBLE_QUOTED)}function ps(e){e.style===U.PLAIN&&/[\t\x7F-\xA0\u2028\u2029\uFEFF\uFFFE\uFFFF]/.test(e.node.value)&&(e.style=U.DOUBLE_QUOTED)}function ms(e){e.style===U.PLAIN&&/^\s+$/.test(e.node.value)&&(e.style=U.DOUBLE_QUOTED)}function hs(e){e.presenterOptions.forceQuotes&&(e.isKey||e.style!==U.PLAIN||(e.style=e.node.value.includes(`
|
|
20
|
+
`)?U.DOUBLE_QUOTED:ds(e)))}function gs(e){if(e.style!==U.PLAIN||e.isKey)return;let t=e.node.value,n=t.indexOf(`
|
|
21
|
+
`)!==-1;if(!ls(e.allowedStylesMask,U.LITERAL_BLOCK)){n&&(e.style=U.DOUBLE_QUOTED);return}let r=e.presenterOptions.lineWidth;if(r===-1){n&&(e.style=U.LITERAL_BLOCK);return}let i=Math.max(Math.min(r,40),r-e.shiftOfContent),a=0,o=!1;for(;a<=t.length;){let e=t.length,n=t.indexOf(`
|
|
22
|
+
`,a);n!==-1&&(e=n);let r=t.slice(a,e);if(r.length>i&&r[0]!==` `&&/ [^ \t]/.test(r)&&(o=!0),n===-1)break;a=n+1}o?e.style=U.FOLDED_BLOCK:n&&(e.style=U.LITERAL_BLOCK)}function _s(e){e.style===U.PLAIN&&!ls(e.allowedStylesMask,U.PLAIN)&&(e.style=ds(e))}function vs(e){ls(e.allowedStylesMask,e.style)||(e.style=U.DOUBLE_QUOTED)}var ys=`[\\x09\\x0A\\x0D\\x20-\\x7E\\x85\\xA0-\\uD7FF\\uE000-\\uFFFD\\u{10000}-\\u{10FFFF}]`,bs=`[\\n\\r]`,xs=`\\uFEFF`,Ss=`[ \\t]`,Cs=`(?:(?!(?:${bs}|${xs}))${ys})`,ws=`(?:(?!${Ss})${Cs})`,Ts=`[\\x09\\x20-\\uD7FF\\uE000-\\uFFFF\\u{10000}-\\u{10FFFF}]`,Es=`[-?:,\\[\\]{}#&*!|>'"%@\`]`,Ds=`[,\\[\\]{}]`,Os=ws,ks=`(?:(?!${Ds})${ws})`,As=`(?:(?:(?!${Es})${ws})|[?:-](?=${Os}))`,js=`(?:(?:(?!${Es})${ws})|[?:-](?=${ks}))`,Ms=`(?:(?:(?![:#])${Os})|:(?=${Os}))#*`,Ns=`(?:(?:(?![:#])${ks})|:(?=${ks}))#*`,Ps=`(?:${Ss}*${Ms})*`,Fs=`(?:${Ss}*${Ns})*`,Is=`${As}#*${Ps}`,Ls=`${js}#*${Fs}`,Rs=Is,zs=Ls,Bs=`\\n+${Ms}${Ps}`,Vs=`\\n+${Ns}${Fs}`,Hs=`${Is}(?:${Bs})*`,Us=`${Ls}(?:${Vs})*`;RegExp(`^(?:${Hs})$`,`u`),RegExp(`^(?:${Us})$`,`u`),RegExp(`^(?:${Rs})$`,`u`),RegExp(`^(?:${zs})$`,`u`),RegExp(`^(?:${Ts})*$`,`u`),RegExp(`^(?:${Ts}|\\n)*$`,`u`),RegExp(`^(?:${Cs}|\\n)*$`,`u`),Object.keys(us).map(e=>Reflect.get(us,e)),H.DOCUMENT,H.SEQUENCE,H.MAPPING,H.SCALAR,H.ALIAS,H.POP,U.PLAIN,U.SINGLE_QUOTED,U.DOUBLE_QUOTED,U.LITERAL_BLOCK,U.FOLDED_BLOCK,Ea.BLOCK,Ea.FLOW,W.CLIP,W.STRIP,W.KEEP;function Ws(e){if(e.trim()===``)return{};let t=cs(e);if(t==null)return{};if(typeof t!=`object`||Array.isArray(t))throw Error(`.agent-user.yml must parse to an object`);return t}var Gs={id:`welcome`,title:`Welcome — who are you?`,navLabel:`You`,subtitle:`Your name and language. Stored in .agent-user.yml; we pre-fill what we can detect.`,kind:`welcome`},Ks={id:`profile`,title:`Which experience?`,navLabel:`Experience`,subtitle:"Pick the experience that fits you — developer · content · founder · agency · finance · ops. It selects your default command/skill surface and persona pre-selection. Cost tier is a secondary knob on a later step. You can switch later with `agent-config use --profile=<id>`.",kind:`form`,paths:[`profile.id`]},qs=[{id:`ai-tools`,title:`Which AI tools do you use?`,navLabel:`AI tools`,subtitle:`Pick the editors and CLIs that should pick up this config. Auto-detect runs first; you can override.`,kind:`aiTools`},{id:`roles`,title:`What do you work on?`,navLabel:`Roles`,subtitle:`Pick the areas you work in. We use them to recommend capability packs on the next step, and they become your roles in .agent-user.yml.`,kind:`roles`},{id:`packs`,title:`Which capability packs do you want?`,navLabel:`Packs`,subtitle:`Founder-strategy, finance-basic, gtm-sales, ops-people, ai-video — pick zero or more. You can change this later.`,kind:`packs`},{id:`legal-consent`,title:`Legal review-prep — not legal advice`,navLabel:`Legal consent`,subtitle:`Only relevant if you picked the legal-review-prep pack. It provides templates and general information, never legal advice — check the box to acknowledge before it activates. Leave unchecked otherwise; the pack stays inactive.`,kind:`form`,paths:[`legal_review_prep.acknowledged`]}],Js=[{id:`identity`,title:`Editor & behaviour`,navLabel:`Preferences`,subtitle:`Your IDE plus how autonomously the agent works. rtk presence is auto-detected (see the rtk row). Your name lives in .agent-user.yml (later step).`,kind:`form`,paths:[`personal.ide`,`personal.open_edited_files`,`personal.autonomy`]},{id:`cost`,title:`Budgets, rules & cadence`,navLabel:`Budgets & cadence`,subtitle:`Independent levers: rule_loading_tier (how many behavioural rules load — token footprint), cost.budgets (optional USD ceilings), model.auto_switch (per-skill model tier), plus quality/roadmap cadence and memory redaction patterns.`,kind:`form`,paths:[`rule_loading_tier`,`cost.budgets.daily`,`cost.budgets.weekly`,`cost.budgets.monthly`,`cost.enforcement`,`model.auto_switch`,`roadmap.quality_cadence`,`quality.local_auto_run`,`memory.redact_patterns`]},{id:`user-md`,title:`Your .agent-user.yml`,navLabel:`User profile`,subtitle:`Identity, voice, preferences. Stored at agents/settings/.agent-user.yml. Skip to leave empty.`,kind:`userMd`},{id:`review`,title:`Review & finish`,navLabel:`Review`,subtitle:`These keys will change. Confirm to write .agent-settings.yml and .agent-user.yml atomically.`,kind:`review`}];Js.length+2;function Ys(e={}){return e.extended===!0?[Gs,Ks,...qs,...Js]:[Gs,Ks,...Js]}function Xs(e,t={}){let n=Ys(t);return n[Math.max(0,Math.min(n.length-1,e))]}function Zs(e){let t={},n=n=>{t[n]=!0;let r=e.clusterOf.get(n);r!==void 0&&(t[r]=!0)};for(let t of e.installed)n(t);for(let t of e.roleDefaults)n(t);for(let t of e.detected)n(t);return t}function Qs(e,t){let n=new Set(t);return e.filter(e=>e!==`engineering-base`&&!n.has(e)).sort()}function $s(e,t){let n={type:`object`,properties:{},...e.description===void 0?{}:{description:e.description}},r=n.properties,i=e.properties??{};for(let e of t){let t=e.split(`.`).filter(e=>e.length>0);if(t.length===0)continue;let[n,a,o]=t;if(n===void 0)continue;let s=i[n];if(s===void 0)continue;if(a===void 0){r[n]=s;continue}let c=s.properties?.[a];if(c===void 0)continue;let l=r[n]??{type:`object`,properties:{},...s.description===void 0?{}:{description:s.description}},u=l.properties??={};if(o===void 0){u[a]=c,r[n]=l;continue}let d=c.properties?.[o];if(d===void 0)continue;let f=u[a]??{type:`object`,properties:{},...c.description===void 0?{}:{description:c.description}},p=f.properties??={};p[o]=d,u[a]=f,r[n]=l}return n}function ec({current:e,total:t}){let n=Math.max(1,t),r=Math.max(0,Math.min(n-1,e)),i=Array.from({length:n},(e,t)=>t<=r),a=Math.round((r+1)/n*100);return k(`div`,{class:`ac-wizard__progress`,role:`progressbar`,"aria-valuenow":r+1,"aria-valuemin":1,"aria-valuemax":n,"aria-valuetext":`Step ${r+1} of ${n} (${a}%)`,children:i.map((e,t)=>k(`span`,{class:`ac-wizard__progress-segment${e?` ac-wizard__progress-segment--filled`:``}`,"aria-hidden":`true`},t))})}function tc({step:e,index:t,total:n}){return k(`header`,{class:`ac-page__header ac-wizard__header`,children:[k(`p`,{class:`ac-wizard__step-count`,children:[`Step `,t+1,` of `,n]}),k(`div`,{class:`ac-wizard__header-text`,children:[k(`h1`,{children:e.title}),k(`p`,{class:`ac-wizard__subtitle`,children:e.subtitle})]}),k(ec,{current:t,total:n})]})}function nc(e){let t=e.canFinish??!0,n=e.completed??!1;return k(`div`,{class:`ac-form__actions ac-wizard__nav`,children:[k(`button`,{type:`button`,class:`ac-button`,disabled:!e.canGoPrev||e.busy,onClick:e.onPrev,children:`Back`}),e.canSkip&&e.onSkip!==void 0?k(`button`,{type:`button`,class:`ac-button ac-wizard__skip`,disabled:e.busy,onClick:e.onSkip,children:e.skipLabel??`Skip`}):null,e.isLast?n?null:k(`button`,{type:`button`,class:`ac-button ac-button--primary`,disabled:e.busy||!t,onClick:e.onFinish,children:e.busy?`Saving…`:`Finish & save`}):k(`button`,{type:`button`,class:`ac-button ac-button--primary`,disabled:!e.canGoNext||e.busy,onClick:e.onNext,children:e.nextLabel??`Next`})]})}function rc(e,t){return e.kind!==`form`||e.paths===void 0?!1:!!(e.paths.includes(t)||e.id===`cost`&&(t.startsWith(`telegraph.`)||t.startsWith(`verbosity.`)))}function ic(e,t){return e.kind===`userMd`?t===`body`||t.startsWith(`body.`):rc(e,t)}function ac(e,t){for(let n of Object.keys(t.errors))if(ic(e,n))return!0;return!1}function oc(e,t){if(ac(e,t))return{label:`needs attention`,tone:`error`};if(e.kind===`userMd`)return t.userMdChanged?{label:t.userMdAction===`create`?`will create`:`will replace`,tone:`changed`}:{label:``,tone:`idle`};if(e.kind===`form`){let n=t.changes.filter(t=>rc(e,t.path)).length;return n===0?{label:``,tone:`idle`}:{label:`${n} change${n===1?``:`s`}`,tone:`changed`}}if(e.kind===`aiTools`){let e=t.selectedToolsCount??0;return e===0?{label:``,tone:`idle`}:{label:`${e} tool${e===1?``:`s`}`,tone:`changed`}}if(e.kind===`packs`){let e=t.selectedPacksCount??0;return e===0?{label:``,tone:`idle`}:{label:`${e} pack${e===1?``:`s`}`,tone:`changed`}}return{label:``,tone:`idle`}}function sc(e){let t=e.steps.filter((t,n)=>n!==e.currentIndex),n=e.packRemovals??[],r=e.selectedToolIds??[],i=e.packAdditions??[],a=e.changes.length;return k(b,{children:[r.length>0||i.length>0||a>0||e.userMdChanged?k(`section`,{class:`ac-review-summary`,"aria-label":`What happens on Finish`,children:[k(`h2`,{class:`ac-review-summary__title`,children:`What happens on Finish`}),k(`ul`,{class:`ac-review-summary__list`,children:[a>0?k(`li`,{children:[k(`strong`,{children:a}),` setting`,a===1?``:`s`,` will change`,` `,`in `,k(`code`,{children:`.agent-settings.yml`}),`.`]}):k(`li`,{children:`No settings change.`}),e.userMdChanged?k(`li`,{children:[k(`code`,{children:`.agent-user.yml`}),` will be`,` `,e.userMdAction===`create`?`created`:`updated`,`.`]}):null,r.length>0?k(`li`,{children:[`Config is installed for `,r.length,` tool`,r.length===1?``:`s`,`:`,k(`span`,{class:`ac-review-summary__chips`,children:r.map(e=>k(`code`,{class:`ac-review-summary__chip`,children:e},e))})]}):null,i.length>0?k(`li`,{children:[`New pack`,i.length===1?``:`s`,`:`,k(`span`,{class:`ac-review-summary__chips`,children:i.map(e=>k(`code`,{class:`ac-review-summary__chip`,children:e},e))})]}):null]})]}):null,n.length>0?k(`div`,{class:`ac-review-removals`,role:`alert`,children:[k(`p`,{class:`ac-review-removals__title`,children:[`⚠️ `,n.length===1?`1 installed pack will be removed`:`${n.length} installed packs will be removed`]}),k(`ul`,{class:`ac-review-removals__list`,children:n.map(e=>k(`li`,{children:k(`code`,{children:e})},e))}),k(`label`,{class:`ac-review-removals__confirm`,children:[k(`input`,{type:`checkbox`,checked:e.removalsConfirmed??!1,onChange:t=>{e.onConfirmRemovals?.(t.currentTarget.checked)}}),k(`span`,{children:`I understand these packs will no longer be installed. Re-check them on the packs step to keep them.`})]})]}):null,k(`nav`,{class:`ac-wizard__review-nav`,"aria-label":`Jump back to a step`,children:[k(`p`,{class:`ac-wizard__review-nav-label`,children:`Jump back to a step:`}),k(`ul`,{class:`ac-wizard__review-nav-list`,children:t.map(t=>{let n=e.steps.indexOf(t),r=oc(t,e);return k(`li`,{children:k(`button`,{type:`button`,class:r.tone===`error`?`ac-wizard__review-nav-button ac-wizard__review-nav-button--error`:`ac-wizard__review-nav-button`,onClick:()=>{e.onJump(n)},children:[k(`span`,{class:`ac-wizard__review-nav-index`,children:n+1}),k(`span`,{class:`ac-wizard__review-nav-text`,children:t.navLabel}),r.label===``?null:k(`span`,{class:`ac-wizard__review-nav-status ac-wizard__review-nav-status--${r.tone}`,children:r.label})]})},t.id)})})]})]})}function cc(e){let t=e.abortedAt??`unknown time`,n=e.abortNote??`no further detail recorded`,r=e.writesSinceRollback;return k(`aside`,{class:`ac-banner ac-banner--recovery`,role:`alert`,children:[k(`strong`,{children:`Previous install was interrupted.`}),k(`p`,{children:[`Aborted at `,k(`code`,{children:t}),` — `,n,`. `,r,` write`,r===1?``:`s`,` landed before the abort marker.`]}),k(`p`,{children:`Pick how to recover before continuing. Resume reopens the wizard fresh, Rollback discards the abort state, Ignore hides this banner without touching the log.`}),k(`div`,{class:`ac-banner__actions`,children:[k(`button`,{type:`button`,disabled:e.busy,onClick:()=>e.onResume(),children:`Resume install`}),k(`button`,{type:`button`,disabled:e.busy,onClick:()=>e.onRollback(),children:`Rollback`}),k(`button`,{type:`button`,disabled:e.busy,onClick:()=>e.onIgnore(),children:`Ignore`})]})]})}function lc(){return k(`section`,{class:`ac-continue-screen`,"aria-labelledby":`ac-continue-title`,children:[k(`h2`,{id:`ac-continue-title`,children:`Install complete — continue with setup?`}),k(`p`,{children:`Your install selections (AI tools, roles, capability packs) are captured. Use the footer to continue:`}),k(`ul`,{children:[k(`li`,{children:[k(`strong`,{children:`Next`}),` — go through the remaining personalisation steps: editor + tooling, personality, cost profile, roadmap & quality, memory, your`,k(`code`,{children:` .agent-user.yml`}),`, and finally the project module roots.`]}),k(`li`,{children:[k(`strong`,{children:`Finish install here`}),` — skip the rest and write `,k(`code`,{children:`.agent-settings.yml`}),` with the install-only selections. You can re-run `,k(`code`,{children:`agent-config setup`}),`later to pick up the personalisation steps.`]})]})]})}function uc(e){let t=e.version??`unknown`;return k(`section`,{class:`ac-backup-screen`,"aria-labelledby":`ac-backup-title`,children:[k(`h2`,{id:`ac-backup-title`,children:`Existing v3 install detected`}),k(`p`,{children:[`Found a v3.x install at `,k(`code`,{children:e.sourcePath}),` `,`(VERSION: `,k(`code`,{children:t}),`). v4 is a hard-cut release with no auto-migration — settings, identity, and history layouts changed. The wizard can back up the v3 tree before writing the v4 layout so you can roll back manually if needed.`]}),e.error===null?null:k(`p`,{class:`ac-banner ac-banner--error`,children:[`Backup failed: `,e.error]}),k(`ul`,{children:[k(`li`,{children:[k(`strong`,{children:`Backup v3 and proceed`}),` — copies the tree to `,k(`code`,{children:e.backupTarget}),`, then runs the v4 install. Restore later with`,k(`code`,{children:[` mv `,e.backupTarget,` `,e.sourcePath]}),`.`]}),k(`li`,{children:[k(`strong`,{children:`Abort, uninstall v3 first`}),` — closes the wizard. You decide what to keep.`]})]}),k(`div`,{class:`ac-backup-screen__actions`,children:[k(`button`,{type:`button`,class:`ac-button ac-button--primary`,disabled:e.busy,onClick:()=>e.onBackupAndProceed(),children:e.busy?`Backing up…`:`Backup v3 and proceed`}),k(`button`,{type:`button`,class:`ac-button`,disabled:e.busy,onClick:()=>e.onAbort(),children:`Abort, uninstall v3 first`})]})]})}var dc=[{title:`Restart your AI tools`,detail:`Editors and CLIs pick up the new skills, rules, and commands on their next start.`},{title:`Verify the installation`,detail:`A read-only health report — scope, deployed files, drift.`,command:`agent-config doctor`},{title:`Tune your settings any time`,detail:`Opens the configuration GUI (global settings; --project for a project).`,command:`agent-config config`},{title:`Initialize a project`,detail:`Adds the minimal agents/ bridge + .gitignore block to a repository.`,command:`agent-config init --project`},{title:`Stay up to date`,detail:`Upgrades the global install and additively syncs your settings.`,command:`agent-config upgrade`}];function fc({text:e}){let[t,n]=Ie(!1);return k(`button`,{type:`button`,class:`ac-button ac-checklist__copy`,onClick:()=>{navigator.clipboard?.writeText(e).then(()=>{n(!0),setTimeout(()=>{n(!1)},1500)})},children:t?`Copied ✓`:`Copy`})}function pc({message:e}){return k(`div`,{class:`ac-checklist`,children:[k(`div`,{class:`ac-checklist__hero`,children:[k(`h2`,{class:`ac-checklist__headline`,children:`Setup complete`}),e===null?null:k(`p`,{class:`ac-checklist__message`,children:e})]}),k(`ol`,{class:`ac-checklist__items`,children:dc.map(e=>k(`li`,{class:`ac-checklist__item`,children:[k(`div`,{class:`ac-checklist__text`,children:[k(`span`,{class:`ac-checklist__item-title`,children:e.title}),k(`span`,{class:`ac-checklist__item-detail`,children:e.detail})]}),e.command===void 0?null:k(`div`,{class:`ac-checklist__cmd-row`,children:[k(`code`,{class:`ac-checklist__cmd`,children:e.command}),k(fc,{text:e.command})]})]},e.title))}),k(`p`,{class:`ac-checklist__close-hint`,children:`You can close this browser window — the local server shuts down on its own.`})]})}var mc=E(!1),hc=E(null),Z=E(null),gc=E(!1),_c=E(!1),vc=E(0),yc=E(null),bc=E({}),xc=E({}),Sc=E(0),Cc=E({}),Q=E(null),wc=E(null),Tc=E(!1),Ec=E(!1),Dc=E(!1),Oc=E({}),kc=E([]);E(`global`);var Ac=E(!1),$=E(!1),jc=E(!1),Mc=E(!1),Nc=E(null),Pc=E([]),Fc=E({}),Ic=E(!0),Lc=E(``),Rc=E(`agents`);E(!1);var zc=E(null),Bc=[{id:`claude-code`,label:`Claude Code`},{id:`claude-desktop`,label:`Claude Desktop`},{id:`cursor`,label:`Cursor`},{id:`windsurf`,label:`Windsurf`},{id:`cline`,label:`Cline`},{id:`gemini-cli`,label:`Gemini CLI`},{id:`copilot`,label:`GitHub Copilot`},{id:`augment`,label:`Augment`},{id:`aider`,label:`Aider`},{id:`codex`,label:`Codex`},{id:`roocode`,label:`Roo Code`},{id:`continue`,label:`Continue`},{id:`kilocode`,label:`Kilo Code`},{id:`zed`,label:`Zed`},{id:`jetbrains`,label:`JetBrains`},{id:`kiro`,label:`Kiro`},{id:`qoder`,label:`Qoder`},{id:`opencode`,label:`OpenCode`},{id:`trae`,label:`Trae`},{id:`antigravity`,label:`Antigravity`},{id:`codebuddy`,label:`CodeBuddy`},{id:`droid`,label:`Droid`},{id:`warp`,label:`Warp`}],Vc=E(!1),Hc=E(!1),Uc=E(null),Wc=E([]),Gc=E([]),Kc=E([]),qc=E(!1),Jc=E([]),Yc=E({}),Xc=E(!1),Zc=E(!1),Qc=E(!1),$c=E({}),el=E(!1),tl=E(null),nl=E(null),rl=E(null),il=E(null),al=E(null),ol=E(null),sl=E(`https://github.com/rtk-ai/rtk`),cl=E(!1),ll=E(null),ul=E(null),dl=E(null),fl=E(`event4u-app/agent-switch`),pl=E(!1);E(!1),E(null),E([]),E({}),E({});var ml=E({}),hl=E({}),gl=E(!1),_l=E(!1);E({}),E(null),E(null),E(!1),E(null);var vl=E(null),yl=E(!1),bl=E(null),xl=E(!1),Sl=E(!1),Cl=E(null),wl=E(null),Tl=E(!1),El=E(!1);function Dl(){return Ys({extended:$.value})}function Ol(){return Dl().length}function kl(e){return e??new Date().toISOString()}function Al(e){return Math.max(0,Math.min(Ol()-1,e))}function jl(e){if(`$ref`in e&&e.$ref!==void 0&&`definitions`in e&&e.definitions!==void 0){let t=e.$ref.replace(`#/definitions/`,``),n=e.definitions[t];if(n!==void 0)return n}return e}async function Ml(){try{return await O(`/api/v1/settings`)}catch(e){if(e instanceof D&&e.status===404&&e.body.error?.code===`NOT_FOUND`){let t=e.body;return t.defaults!==void 0&&t.schema!==void 0?{values:t.defaults,lastModified:t.lastModified??0,path:t.path??`.agent-settings.yml`,schema:t.schema}:{values:{},lastModified:0,path:`.agent-settings.yml`,schema:(await O(`/api/v1/schema`)).settings}}throw e}}async function Nl(){try{let e=await O(`/api/v1/install/recovery`);vl.value=e.incomplete?e:null}catch{vl.value=null}}async function Pl(){try{let e=await O(`/api/v1/install/legacy-v3`);bl.value=e.present?e:null}catch{bl.value=null}}async function Fl(){Sl.value=!0,Cl.value=null;try{await O(`/api/v1/install/backup-v3`,{method:`POST`}),xl.value=!0}catch(e){Cl.value=e instanceof D?Rt(e.body.error??{code:`UNKNOWN`,message:e.message}):e instanceof Error?e.message:String(e)}finally{Sl.value=!1}}async function Il(e){try{await O(`/api/v1/install/recovery/dismiss`,{method:`POST`,body:{reason:e}})}catch(e){Z.value={message:e instanceof Error?e.message:String(e),tone:`error`};return}vl.value=null,yl.value=!0}async function Ll(){hc.value=null;try{Nl(),Pl();let[e,t]=await Promise.all([O(`/api/v1/wizard/state`),Ml()]);yc.value=jl(t.schema),Sc.value=t.lastModified,xc.value=t.values,Oc.value=t.legacyHints??{},$.value=e.extendedSteps===!0,wl.value=e.wizardMode??null,bc.value=Object.keys(e.partial??{}).length>0?{...t.values,...e.partial}:t.values,vc.value=Al(e.step),Ac.value=!1,mc.value=!0;let n=Xs(vc.value,{extended:$.value});(n.kind===`welcome`||n.kind===`userMd`||n.kind===`review`)&&zl(),(n.kind===`roles`||n.kind===`aiTools`||n.kind===`packs`)&&Vl(),n.kind===`roles`&&Xl(),n.kind===`aiTools`&&Hl(),n.id===`identity`&&(Ul(),Wl()),n.kind===`review`&&Kl()}catch(e){hc.value=e instanceof D?Rt(e.body.error??{code:`UNKNOWN`,message:e.message}):e instanceof Error?e.message:String(e)}}function Rl(e,t){return e.identity.name.trim()===``?{...e,identity:{...e.identity,name:t}}:e}async function zl(){if(!Ec.value)try{let e=await O(`/api/v1/user-md`);if(Tc.value=e.exists,e.exists&&e.identity!==null){let t=ri(e.identity);wc.value=t,Q.value=t}else{let e;try{e=ri(Ws((await O(`/api/v1/user-md/template`)).body))}catch{e=Xr()}let t=Oc.value.user_name;typeof t==`string`&&t.trim()!==``&&(e=Rl(e,t)),wc.value=e,Q.value=e}}catch(e){Z.value={message:e instanceof Error?e.message:String(e),tone:`error`}}finally{Ec.value=!0}}var Bl=new Set([`python`]);async function Vl(){if(!(Vc.value||Hc.value)){Hc.value=!0,Uc.value=null;try{let[e,t]=await Promise.all([O(`/api/v1/wizard/manifest`),O(`/api/v1/wizard/auto-detect`)]),n=(e.packs??[]).map(e=>({id:e.id,label:e.label??e.id,description:e.description??``,requires_hint:e.requires_hint,cluster:e.cluster??void 0,workspaces:e.workspaces}));Wc.value=n,Jc.value=(e.workspaces??[]).filter(e=>e.id!==`agent-config-maintainer`).map(e=>({id:e.id,label:e.label??e.id,description:e.description??``,default_packs:e.default_packs??[],optional_packs:e.optional_packs??[],...e.example_roles===void 0?{}:{example_roles:e.example_roles}}));let r=new Set(n.map(e=>e.id));Gc.value=t.signals.map(e=>e.id.startsWith(`pack-`)?e.id.slice(5):e.id).filter(e=>r.has(e)).filter(e=>!Bl.has(e)),Kc.value=(e.installedPacks??[]).filter(e=>r.has(e))}catch(e){Uc.value=e instanceof D?Rt(e.body.error??{code:`UNKNOWN`,message:e.message}):e instanceof Error?e.message:String(e)}finally{Hc.value=!1,Vc.value=!0}}}async function Hl(){if(!(Zc.value||Qc.value)){Qc.value=!0;try{let e=await O(`/api/v1/wizard/detect-tools`),t=e.tools??{},n=e.configured??[];if($c.value=t,Object.keys(ml.value).length===0){let e={};if(n.length>0)for(let t of n)e[t]=!0;else for(let[n,r]of Object.entries(t))r&&(e[n]=!0);ml.value=e}}catch{}finally{Qc.value=!1,Zc.value=!0}}}async function Ul(){if(!el.value){el.value=!0;try{let e=await O(`/api/v1/wizard/detect-rtk`),t=e.installed===!0;tl.value=t,nl.value=e.present===!0,rl.value=e.identity??null,il.value=e.version??null,al.value=e.installCommand??null,ol.value=e.installCommands??null,typeof e.repo==`string`&&(sl.value=e.repo);let n=bc.value.personal??{};bc.value={...bc.value,personal:{...n,rtk_installed:t}}}catch{}}}async function Wl(){if(!cl.value){cl.value=!0;try{let e=await O(`/api/v1/wizard/detect-agent-switch`);ll.value=e.installed===!0,ul.value=e.version??null,dl.value=e.installCommand??null,typeof e.repo==`string`&&(fl.value=e.repo),pl.value=e.dismissed===!0}catch{}}}async function Gl(e,t){try{await O(`/api/v1/wizard/state`,{method:`POST`,body:{step:e,totalSteps:Ol(),partial:t,startedAt:kl(null)}})}catch(e){Z.value={message:e instanceof Error?e.message:String(e),tone:`error`}}}async function Kl(){_c.value=!0;try{kc.value=(await O(`/api/v1/settings/diff`,{method:`POST`,body:{values:bc.value,ifUnmodifiedSince:Sc.value}})).changes,Cc.value={}}catch(e){e instanceof D?(Cc.value=Bt(e.body.error??{code:`UNKNOWN`,message:e.message}),Z.value={message:Rt(e.body.error??{code:`UNKNOWN`,message:e.message}),tone:`error`}):Z.value={message:e instanceof Error?e.message:String(e),tone:`error`}}finally{_c.value=!1}}function ql(){return Dc.value?!1:Q.value===null||wc.value===null?Q.value!==wc.value:JSON.stringify(Q.value)!==JSON.stringify(wc.value)}async function Jl(e){let t=Al(e);await Gl(t,bc.value),vc.value=t,Z.value=null;let n=Xs(t,{extended:$.value});(n.kind===`welcome`||n.kind===`userMd`)&&zl(),(n.kind===`roles`||n.kind===`aiTools`||n.kind===`packs`)&&Vl(),n.kind===`roles`&&Xl(),n.kind===`packs`&&Zl(),n.kind===`aiTools`&&Hl(),n.id===`identity`&&(Ul(),Wl()),n.kind===`review`&&Kl()}function Yl(){let e=hl.value,t=new Map(Wc.value.map(e=>[e.id,e])),n=Object.entries(e).filter(([,e])=>e===!0).map(([e])=>e).filter(n=>{let r=t.get(n)?.cluster;return r===void 0||e[r]===!0}),r=new Set,i=e=>{if(!r.has(e)){r.add(e);for(let n of t.get(e)?.requires_hint??[])i(n)}};for(let e of n)i(e);return[...r].sort()}async function Xl(){if(await Promise.all([Vl(),zl()]),Xc.value||Object.values(Yc.value).some(Boolean))return;let e=Q.value?.role??[];if(e.length===0)return;let t=new Set(Jc.value.map(e=>e.id)),n={};for(let r of e)t.has(r)&&(n[r]=!0);Object.keys(n).length!==0&&(Yc.value=n,Zl())}function Zl(){if(gl.value)return;let e=Object.entries(Yc.value).filter(([,e])=>e===!0).map(([e])=>e),t=new Map(Jc.value.map(e=>[e.id,e])),n=[];for(let r of e)for(let e of t.get(r)?.default_packs??[])n.push(e);let r=new Map;for(let e of Wc.value)e.cluster!==void 0&&r.set(e.id,e.cluster);hl.value=Zs({installed:Kc.value,roleDefaults:n,detected:Gc.value,clusterOf:r})}function Ql(){let e=Object.entries(ml.value).filter(([,e])=>e===!0).map(([e])=>e);if(e.length===0)return null;let t={schema_version:`wizard-v2`,tools:e,packs:Yl(),settings:bc.value};return It.value?.dryRun===!0&&(t.dry_run=!0),t}async function $l(){gc.value=!0,Z.value=null;try{let e={settings:bc.value},t=Object.entries(Yc.value).filter(([,e])=>e===!0).map(([e])=>e),n=Q.value!==null&&typeof Q.value.identity?.name==`string`&&Q.value.identity.name.trim().length>0;Q.value!==null&&n&&(ql()||t.length>0)&&(e.identity=t.length>0?{...Q.value,role:t}:Q.value);let r=await O(`/api/v1/wizard/finish`,{method:`POST`,body:e}),i=r.dryRun===!0?`Dry-run complete — no files written. Settings would be saved.`:Array.isArray(r.writtenPaths)?`Saved (${r.writtenPaths.join(`, `)}). Wizard complete.`:`Wizard complete.`,a=$.value?Ql():null,o=``;if(a!==null&&a.dry_run===!0)try{await O(`/api/v1/wizard/apply`,{method:`POST`,body:a}),o=` Installer preview OK (dry-run) — no files written.`}catch(e){o=` Installer preview failed: ${e instanceof D?Rt(e.body.error??{code:`UNKNOWN`,message:e.message}):e instanceof Error?e.message:String(e)}.`}else if(a!==null)try{let e=null,t=0;await Ft(`/api/v1/wizard/apply`,a,n=>{if(n.type===`error`)e=typeof n.message==`string`?n.message:`install failed`;else if(n.type===`done`){let e=n.summary;t=typeof e?.conflicts==`number`?e.conflicts:0}});let n=a.tools.length,r=a.packs.length;o=e===null?` Installer applied ${n} tool${n===1?``:`s`}`+(r>0?` and ${r} pack${r===1?``:`s`}.`:`.`)+(t>0?` ${t} file${t===1?``:`s`} you had edited ${t===1?`was`:`were`} kept; the new package content is staged alongside as *.agent-config.new. This installation is not current until you merge it.`:``):` Installer failed: ${e}. Settings were saved; re-run the wizard to retry.`}catch(e){o=` Installer bridge failed: ${e instanceof D?Rt(e.body.error??{code:`UNKNOWN`,message:e.message}):e instanceof Error?e.message:String(e)}. Settings were saved; re-run the wizard to retry the install plan.`}Z.value={message:`${i}${o} You can close this browser window now.`,tone:`success`},vc.value=Al(Ol()-1),xc.value=bc.value,wc.value=ql()?Q.value:wc.value,kc.value=[],Ac.value=!0}catch(e){e instanceof D?(Cc.value=Bt(e.body.error??{code:`UNKNOWN`,message:e.message}),Z.value={message:Rt(e.body.error??{code:`UNKNOWN`,message:e.message}),tone:`error`}):Z.value={message:e instanceof Error?e.message:String(e),tone:`error`}}finally{gc.value=!1}}async function eu(){El.value=!0,await Promise.all([Vl(),Hl()]),await Xl(),Zl(),await Jl(Ol()-1)}function tu(){Re(()=>{Vl(),Hl()},[]);let e=Hc.value||Qc.value||!Vc.value||!Zc.value,t=Object.values($c.value).filter(Boolean).length,n=Kc.value.length,r=Gc.value.filter(e=>!Kc.value.includes(e)).length;return k(`div`,{class:`ac-start`,children:[k(`section`,{class:`ac-start__card ac-start__card--primary`,children:[k(`h2`,{class:`ac-start__title`,children:`Recommended setup`}),k(`p`,{class:`ac-start__desc`,children:`The fastest path — we pre-select everything we can detect and you confirm one review screen before anything is written.`}),k(`ul`,{class:`ac-start__facts`,children:[k(`li`,{children:e?`Detecting your AI tools…`:t===0?`No AI tools detected — pick them on the review screen.`:`${t} AI tool${t===1?``:`s`} detected and pre-selected.`}),k(`li`,{children:e?`Detecting capability packs…`:n>0?`${n} installed pack${n===1?``:`s`} kept${r>0?`, ${r} more auto-detected`:``}.`:r>0?`${r} capability pack${r===1?``:`s`} auto-detected.`:`No packs pre-selected — add them any time later.`}),k(`li`,{children:`Settings keep their current values (or safe defaults on a first run).`}),k(`li`,{children:`Nothing is written until you confirm the review screen.`})]}),k(`button`,{type:`button`,class:`ac-button ac-button--primary ac-start__cta`,disabled:e,onClick:()=>{eu()},children:e?`Detecting…`:`Use recommended setup`})]}),k(`section`,{class:`ac-start__card`,children:[k(`h2`,{class:`ac-start__title`,children:`Customize`}),k(`p`,{class:`ac-start__desc`,children:`Walk through every step — tools, roles, packs, behaviour, budgets — and tune each choice yourself.`}),k(`button`,{type:`button`,class:`ac-button ac-start__cta`,onClick:()=>{El.value=!0},children:`Customize step by step`})]})]})}var nu=[`de`,`en`,`en-US`,`en-GB`,`fr`,`es`,`it`,`nl`,`pt`,`pt-BR`];function ru(){if(_l.value)return;let e=Q.value;if(e===null)return;_l.value=!0;let t=e;if(e.identity.name.trim()===``){let e=It.value?.systemUser;e!==void 0&&e.trim()!==``&&(t={...t,identity:{...t.identity,name:e}})}if(!Tc.value&&typeof navigator<`u`){let e=(navigator.language||``).split(`-`)[0];e.length>=2&&(t={...t,language:e})}t!==e&&(Q.value=t)}function iu(){let e=Q.value;if(Re(()=>{ru()},[e]),e===null)return k(`p`,{children:`Loading…`});let t=e=>{Q.value={...e,last_updated:new Date().toISOString().slice(0,10)},Dc.value=!1};return k(`div`,{class:`ac-wizard-step-stub ac-wizard__module-fields`,children:[k(`p`,{children:[`Tell the agent who you are. We pre-filled what we could detect — adjust freely. Stored in `,k(`code`,{children:`.agent-user.yml`}),`.`]}),k(`div`,{class:`ac-field`,children:[k(`label`,{class:`ac-field__label`,for:`welcome-name`,children:`Name`}),k(`input`,{class:`ac-input`,id:`welcome-name`,type:`text`,placeholder:`How should the agent address you?`,value:e.identity.name,onInput:n=>t({...e,identity:{...e.identity,name:n.currentTarget.value}})})]}),k(`div`,{class:`ac-field`,children:[k(`label`,{class:`ac-field__label`,for:`welcome-lang`,children:`Language`}),k(`input`,{class:`ac-input`,id:`welcome-lang`,type:`text`,list:`welcome-lang-list`,placeholder:`BCP-47 code, e.g. de, en, en-US`,value:e.language,onInput:n=>t({...e,language:n.currentTarget.value})}),k(`datalist`,{id:`welcome-lang-list`,children:nu.map(e=>k(`option`,{value:e},e))})]})]})}function au(){let e=ml.value,t=$c.value;return k(`div`,{class:`ac-wizard-step-stub`,children:[k(`p`,{children:`Pick the AI tools you use. Tools detected on this machine are pre-selected on first run. The installer wires each selected tool's surface (skills, rules, commands) on apply; you can change this list later by re-running the wizard.`}),k(`ul`,{class:`ac-wizard__tool-list`,children:Bc.map(n=>{let r=t[n.id]===!0;return k(`li`,{class:`ac-wizard__tool-row`,children:[k(`label`,{class:`ac-wizard__tool-label`,children:[k(`input`,{type:`checkbox`,checked:e[n.id]??!1,onChange:t=>{let r=t.currentTarget.checked;ml.value={...e,[n.id]:r}}}),` `,n.label]}),k(`span`,{class:`ac-badge ${r?`ac-badge--installed`:`ac-badge--missing`}`,title:r?`Detected on this machine`:`Not detected on this machine`,children:r?`installed`:`not installed`})]},n.id)})})]})}function ou(){if(Hc.value)return k(`p`,{children:`Loading roles…`});if(Uc.value!==null)return k(`div`,{class:`ac-wizard-step-stub`,children:k(`p`,{class:`ac-banner ac-banner--error`,children:[`Discovery failed: `,Uc.value]})});let e=Yc.value,t=Jc.value,n=(e,t)=>{Xc.value=!0,Yc.value={...Yc.value,[e]:t},Zl()};return k(`div`,{class:`ac-wizard-step-stub`,children:[k(`p`,{children:[`Pick the areas you work in. We use them to recommend capability packs on the next step, and they become your roles in`,k(`code`,{children:` .agent-user.yml`}),`.`]}),t.length===0?k(`p`,{children:k(`em`,{children:`No roles available in the manifest.`})}):k(`div`,{class:`ac-wizard__pack-grid`,children:t.map(t=>k(`section`,{class:`ac-pack-tile`,children:[k(`label`,{class:`ac-pack-tile__head`,children:[k(`input`,{type:`checkbox`,checked:e[t.id]??!1,onChange:e=>{n(t.id,e.currentTarget.checked)}}),k(`span`,{class:`ac-pack-tile__title`,children:t.label})]}),(t.example_roles??[]).length>0?k(`p`,{class:`ac-pack-tile__role`,children:[`e.g. `,(t.example_roles??[]).join(`, `)]}):null,t.description===``?null:k(`p`,{class:`ac-pack-tile__desc`,children:t.description})]},t.id))})]})}function su(){if(Hc.value)return k(`p`,{children:`Loading discovery manifest…`});if(Uc.value!==null)return k(`div`,{class:`ac-wizard-step-stub`,children:[k(`p`,{class:`ac-banner ac-banner--error`,children:[`Discovery failed: `,Uc.value]}),k(`p`,{children:`The manifest endpoint is gated on extended-mode. Re-run the server with extended steps enabled to populate this list.`})]});let e=hl.value,t=new Set(Gc.value),n=new Set(Kc.value),r=e=>n.has(e)?k(`span`,{class:`ac-badge ac-badge--installed`,children:`installed`}):t.has(e)?k(`span`,{class:`ac-badge ac-badge--detected`,children:`auto-detected`}):null,i=new Map(Jc.value.map(e=>[e.id,e.label])),a=Yc.value,o=e=>{let t=(e??[]).filter(e=>e!==`agent-config-maintainer`);return t.length===0?null:k(`span`,{class:`ac-pack-tile__ws`,children:t.map(e=>k(`span`,{class:`ac-badge ac-badge--ws${a[e]===!0?` ac-badge--ws-active`:``}`,title:a[e]===!0?`Matches a role you picked`:`Workspace / area`,children:i.get(e)??e},e))})},s=Wc.value.filter(e=>e.id!==`engineering-base`),c=new Map;for(let e of s)if(e.cluster!==void 0){let t=c.get(e.cluster)??[];t.push(e),c.set(e.cluster,t)}let l=new Set(s.filter(e=>e.cluster!==void 0).map(e=>e.id)),u=s.filter(e=>!l.has(e.id)),d=(e,t)=>{gl.value=!0,hl.value={...hl.value,[e]:t}},f=(e,t)=>{gl.value=!0;let n={...hl.value,[e]:t};if(t)for(let t of c.get(e)??[])n[t.id]===void 0&&(n[t.id]=!0);hl.value=n};return k(`div`,{class:`ac-wizard-step-stub`,children:[k(`p`,{children:`Pick the capability packs to install. Auto-detected packs are pre-selected; engineering hygiene is included automatically when a pack needs it. A language tile expands to its frameworks — turn the language off to skip them all.`}),u.length===0?k(`p`,{children:k(`em`,{children:`No packs available in the manifest.`})}):k(`div`,{class:`ac-wizard__pack-grid`,children:u.map(t=>{let n=c.get(t.id)??[],i=n.length>0,a=e[t.id]??!1;return k(`section`,{class:`ac-pack-tile`,children:[k(`label`,{class:`ac-pack-tile__head`,children:[k(`input`,{type:`checkbox`,checked:a,onChange:e=>{let n=e.currentTarget.checked;i?f(t.id,n):d(t.id,n)}}),k(`span`,{class:`ac-pack-tile__title`,children:t.label}),r(t.id)]}),o(t.workspaces),t.description===``?null:k(`p`,{class:`ac-pack-tile__desc`,children:t.description}),i?k(`fieldset`,{class:`ac-pack-tile__children`,disabled:!a,children:n.map(t=>k(`label`,{class:`ac-pack-tile__child`,children:[k(`input`,{type:`checkbox`,checked:e[t.id]??!1,disabled:!a,onChange:e=>{d(t.id,e.currentTarget.checked)}}),k(`span`,{children:t.label}),r(t.id)]},t.id))}):null]},t.id)})})]})}function cu(){let e=tl.value,t=nl.value,n=rl.value,r=il.value,i=ol.value,a=e===null?k(`span`,{class:`ac-badge ac-badge--missing`,children:`detecting…`}):e?k(`span`,{class:`ac-badge ac-badge--installed`,children:[`installed`,r===null?``:` (v${r})`]}):t===!0?k(`span`,{class:`ac-badge ac-badge--missing`,children:n===`unknown-rtk`?`different tool`:`unverified`}):k(`span`,{class:`ac-badge ac-badge--missing`,children:`not installed`});return k(`div`,{class:`ac-rtk-row`,children:[k(`div`,{class:`ac-rtk-row__head`,children:[k(`span`,{class:`ac-rtk-row__label`,children:[`rtk `,k(`small`,{children:`(Rust Token Killer — third-party, Apache-2.0)`})]}),a]}),t===!0&&n===`unknown-rtk`?k(`div`,{class:`ac-rtk-row__install`,children:[k(`p`,{class:`ac-field__description`,children:[`A binary named `,k(`code`,{children:`rtk`}),` is on PATH, but it is not Rust Token Killer — two unrelated projects share the name (the other is Rust Type Kit). The token-saving integration stays off. See the upstream name-collision guidance:`]}),k(`a`,{class:`ac-button`,href:`${sl.value}/blob/master/INSTALL.md`,target:`_blank`,rel:`noreferrer noopener`,children:`Open rtk install guide`})]}):null,t===!0&&n===`unverified`?k(`p`,{class:`ac-field__description`,children:[`rtk found but the identity check failed — verify manually with `,k(`code`,{children:`rtk gain`}),` (Rust Token Killer renders a token-savings dashboard; the colliding Rust Type Kit does not).`]}):null,t===!1?k(`div`,{class:`ac-rtk-row__install`,children:[k(`p`,{class:`ac-field__description`,children:`rtk wraps verbose CLI output — upstream reports 60–90% token savings (their estimate). Install it, then re-open the wizard to pick up detection:`}),i===null?al.value===null?null:k(`code`,{class:`ac-rtk-row__cmd`,children:al.value}):k(b,{children:[i.recommendedLabel===void 0?null:k(`p`,{class:`ac-field__description`,children:[i.recommendedLabel,`:`]}),k(`code`,{class:`ac-rtk-row__cmd`,children:i.recommended}),i.manual===void 0?null:k(b,{children:[k(`p`,{class:`ac-field__description`,children:[i.manualLabel??`Manual`,`:`]}),k(`code`,{class:`ac-rtk-row__cmd`,children:i.manual})]}),i.note===void 0?null:k(`p`,{class:`ac-field__description`,children:i.note})]}),k(`a`,{class:`ac-button`,href:sl.value,target:`_blank`,rel:`noreferrer noopener`,children:`Open rtk repo`})]}):null]})}async function lu(){try{await O(`/api/v1/wizard/dismiss-recommendation`,{method:`POST`,body:{id:`agent-switch`}})}catch(e){Z.value={message:e instanceof Error?e.message:String(e),tone:`error`};return}pl.value=!0}function uu(){return!cl.value||ll.value!==!1||pl.value?null:k(`div`,{class:`ac-rtk-row`,children:[k(`div`,{class:`ac-rtk-row__head`,children:[k(`span`,{class:`ac-rtk-row__label`,children:[`agent-switch `,k(`small`,{children:`(third-party, MIT)`})]}),k(`span`,{class:`ac-badge ac-badge--missing`,children:`not installed`})]}),k(`div`,{class:`ac-rtk-row__install`,children:[k(`p`,{class:`ac-field__description`,children:[`agent-switch isolates multiple agent accounts into per-account profiles (`,k(`code`,{children:`CLAUDE_CONFIG_DIR`}),`) so switching accounts never requires a re-login. Free and MIT-licensed.`]}),dl.value===null?null:k(`code`,{class:`ac-rtk-row__cmd`,children:dl.value}),k(`a`,{class:`ac-button`,href:`https://github.com/${fl.value}`,target:`_blank`,rel:`noreferrer noopener`,children:`Open agent-switch repo`}),k(`button`,{type:`button`,class:`ac-button ac-button--small`,onClick:()=>{lu()},children:`Don't show again`})]})]})}function du(){let e=Xs(vc.value,{extended:$.value});if($.value&&wl.value===`install`&&e.id===`identity`&&!Tl.value)return k(lc,{});if(e.kind===`form`){let t=$s(yc.value,e.paths??[]);return k(b,{children:[e.id===`identity`?k(cu,{}):null,e.id===`identity`?k(uu,{}):null,k(sn,{schema:t,values:bc.value,errors:Cc.value,onChange:e=>{bc.value=e}})]})}return e.kind===`userMd`?!Ec.value||Q.value===null?k(`p`,{children:`Loading .agent-user.yml…`}):k(pn,{value:Q.value,errors:Cc.value,hideRole:$.value&&wl.value===`install`,hideIdentityBasics:$.value&&wl.value===`install`,onChange:e=>{Q.value=e,Dc.value=!1}}):e.kind===`welcome`?k(iu,{}):e.kind===`aiTools`?k(au,{}):e.kind===`roles`?k(ou,{}):e.kind===`packs`?k(su,{}):k(sc,{steps:Dl(),currentIndex:vc.value,changes:kc.value,errors:Cc.value,userMdChanged:ql(),userMdAction:Tc.value?`replace`:`create`,loading:_c.value,onJump:e=>{Jl(e)},selectedToolsCount:Object.values(ml.value).filter(Boolean).length,selectedPacksCount:Object.values(hl.value).filter(Boolean).length,packRemovals:fu(),removalsConfirmed:qc.value,onConfirmRemovals:e=>{qc.value=e},selectedToolIds:Object.entries(ml.value).filter(([,e])=>e).map(([e])=>e),packAdditions:$.value?Yl().filter(e=>e!==`engineering-base`&&!Kc.value.includes(e)):[]})}function fu(){return $.value?Qs(Kc.value,Yl()):[]}function pu({path:e}){if(Re(()=>{Ll()},[]),!mc.value||yc.value===null)return k(`div`,{class:`ac-page`,children:[k(`h1`,{children:`Setup wizard`}),hc.value===null?k(`p`,{children:`Loading…`}):k(`p`,{class:`ac-banner ac-banner--error`,children:hc.value})]});let t=vc.value,n=Ol(),r=Xs(t,{extended:$.value}),i=t===n-1,a=r.kind===`aiTools`&&Object.values(ml.value).filter(Boolean).length===0||r.kind===`roles`&&Object.values(Yc.value).filter(Boolean).length===0||r.kind===`packs`&&Yl().length===0,o=$.value&&wl.value===`install`&&r.id===`identity`&&!Tl.value,s=vl.value,c=s!==null&&!yl.value,l=bl.value,u=l!==null&&l.present&&!xl.value,d=$.value&&wl.value===`install`&&t===0&&!El.value&&!Ac.value;return u?k(`div`,{class:`ac-page`,children:k(uc,{sourcePath:l.path,backupTarget:l.backupTarget,version:l.version,busy:Sl.value,error:Cl.value,onBackupAndProceed:()=>{Fl()},onAbort:()=>{Z.value={tone:`info`,message:"Aborted. Uninstall v3 manually, then re-run `agent-config install`."},xl.value=!0}})}):d?k(`div`,{class:`ac-page`,children:[k(`header`,{class:`ac-page__header`,children:k(`h1`,{children:`Set up agent-config`})}),Z.value===null?null:k(`p`,{class:`ac-banner${Z.value.tone===`error`?` ac-banner--error`:``}`,children:Z.value.message}),k(tu,{})]}):k(`div`,{class:`ac-page`,children:[k(tc,{step:r,index:t,total:n}),c?k(cc,{abortedAt:s.abortedAt,abortNote:s.abortNote,writesSinceRollback:s.writesSinceRollback,busy:gc.value,onResume:()=>{Il(`resume`)},onRollback:()=>{Il(`rollback`)},onIgnore:()=>{Il(`ignore`)}}):null,Z.value!==null&&!(Ac.value&&i&&Z.value.tone===`success`)?k(`p`,{class:`ac-banner${Z.value.tone===`error`?` ac-banner--error`:``}`,children:Z.value.message}):null,k(`div`,{class:`ac-wizard__step`,children:Ac.value&&i?k(pc,{message:Z.value?.tone===`success`?Z.value.message:null}):k(du,{})}),a?k(`p`,{class:`ac-wizard__hint`,children:r.kind===`aiTools`?`Select at least one AI tool to continue.`:r.kind===`roles`?`Select at least one role to continue.`:`Select at least one capability pack to continue.`}):null,k(nc,{canGoPrev:t>0,canGoNext:!i&&!a,canSkip:o||r.kind===`userMd`,skipLabel:o?`Finish install here`:`Skip`,isLast:i,busy:gc.value||_c.value,canFinish:(kc.value.length>0||ql()||fu().length>0||$.value&&Object.values(ml.value).some(Boolean))&&(fu().length===0||qc.value),completed:Ac.value,onPrev:()=>{Jl(t-1)},onNext:()=>{o?Tl.value=!0:Jl(t+1)},onSkip:()=>{o?(Tl.value=!0,Jl(Ol()-1)):(Dc.value=!0,Jl(t+1))},onFinish:()=>{$l()}})]})}var mu=new Set([`profile.id`,`rule_loading_tier`,`discipline_profile`,`personal.ide`,`personal.open_edited_files`,`personal.autonomy`,`personal.pr_progress_comments`,`cost.budgets.daily`,`cost.budgets.weekly`,`cost.budgets.monthly`,`cost.enforcement`,`model.auto_switch`,`roadmap.quality_cadence`,`quality.local_auto_run`,`memory.redact_patterns`,`chat_history.enabled`,`update_check.enabled`,`legal_review_prep.acknowledged`]);function hu(e){return mu.has(e)}function gu(e,t){return JSON.stringify(e??null)===JSON.stringify(t??null)}function _u(e,t){if(e.kind===`enum_removed`){let n=new Set(e.values??[]);return t!==void 0&&n.has(t)?`must_fix`:`info`}return e.kind===`type_changed`?`must_fix`:e.kind===`default_changed`?t===void 0||gu(t,e.old?.default)?`adopt`:`review`:e.kind===`added`&&e.new?.default===void 0?`must_fix`:`info`}var vu=E(!0),yu=E(null),bu=E(!1),xu=E(null),Su=E({}),Cu=E(0),wu=E({}),Tu=E(null),Eu=E(!1),Du=E(!1);function Ou(e){return`${e.key}:${e.kind}`}async function ku(){vu.value=!0,yu.value=null,bu.value=!1,Du.value=!1;try{let e=await O(`/api/v1/settings/changes`),t=await O(`/api/v1/settings`);xu.value=e.delta,Su.value=t.values,Cu.value=t.lastModified,Au(e.delta,t.values)}catch(e){e instanceof D&&e.status===404?bu.value=!0:yu.value=e instanceof Error?e.message:String(e)}finally{vu.value=!1}}function Au(e,t){let n={};for(let r of e.changes){let e=_u(r,en(t,r.key.split(`.`)));e===`adopt`?n[Ou(r)]={mode:`adopt`}:e===`review`?n[Ou(r)]={mode:`keep`}:e===`must_fix`&&(n[Ou(r)]={mode:null})}wu.value=n}function ju(e){return _u(e,en(Su.value,e.key.split(`.`)))}function Mu(e,t){wu.value={...wu.value,[e]:t}}function Nu(){let e=xu.value;return e===null?[]:e.changes.filter(e=>{if(ju(e)!==`must_fix`)return!1;let t=wu.value[Ou(e)];return t===void 0||t.mode===null||t.mode===`custom`&&(t.value===void 0||t.value===``)})}function Pu(){let e=xu.value,t=Su.value;if(e===null)return t;for(let n of e.changes){let e=wu.value[Ou(n)];if(e===void 0||e.mode===null||e.mode===`keep`)continue;let r=n.key.split(`.`);e.mode===`adopt`&&n.new?.default!==void 0?t=tn(t,r,n.new.default):e.mode===`custom`&&e.value!==void 0&&(t=tn(t,r,e.value))}return t}async function Fu(){if(Eu.value)return;let e=Nu();if(e.length>0)Tu.value=`Resolve the ${e.length} “Must fix” item${e.length===1?``:`s`} first.`;else{Eu.value=!0,Tu.value=null;try{let e=Pu();if(JSON.stringify(e)!==JSON.stringify(Su.value)){let t=await O(`/api/v1/settings`,{method:`PUT`,headers:{"If-Unmodified-Since":String(Cu.value)},body:{values:e}});Su.value=e,Cu.value=t.lastModified}await O(`/api/v1/settings/changes/ack`,{method:`POST`}),Du.value=!0}catch(e){Tu.value=e instanceof D?Rt(e.body.error??{code:`UNKNOWN`,message:e.message}):e instanceof Error?e.message:String(e)}finally{Eu.value=!1}}}async function Iu(){if(!Eu.value){if(Nu().length>0)Tu.value=`Cannot dismiss — “Must fix” items would leave invalid values in place.`;else{Eu.value=!0;try{await O(`/api/v1/settings/changes/ack`,{method:`POST`}),Du.value=!0}catch(e){Tu.value=e instanceof Error?e.message:String(e)}finally{Eu.value=!1}}}}function Lu(e){return e===void 0?`—`:typeof e==`string`?e:JSON.stringify(e)}function Ru({change:e,id:t}){let n=e.new,r=wu.value[t]?.value;return n?.enum===void 0?n?.type===`boolean`?k(`select`,{class:`ac-input`,"aria-label":`New value for ${e.key}`,value:r===void 0?``:String(r),onChange:e=>{Mu(t,{mode:`custom`,value:e.currentTarget.value===`true`})},children:[k(`option`,{value:``,disabled:!0,children:`Choose…`}),k(`option`,{value:`true`,children:`true`}),k(`option`,{value:`false`,children:`false`})]}):k(`input`,{class:`ac-input`,type:n?.type===`number`||n?.type===`integer`?`number`:`text`,"aria-label":`New value for ${e.key}`,value:r===void 0?``:String(r),onInput:e=>{let r=e.currentTarget.value;Mu(t,{mode:`custom`,value:n?.type===`number`||n?.type===`integer`?Number(r):r})}}):k(`select`,{class:`ac-input`,"aria-label":`New value for ${e.key}`,value:r===void 0?``:String(r),onChange:e=>{let n=e.currentTarget.value;Mu(t,{mode:`custom`,value:n})},children:[k(`option`,{value:``,disabled:!0,children:`Choose a value…`}),n.enum.map(e=>k(`option`,{value:String(e),children:String(e)},String(e)))]})}function zu({change:e}){let t=ju(e),n=Ou(e),r=wu.value[n],i=en(Su.value,e.key.split(`.`));return k(`li`,{class:`ac-change-card ac-change-card--${t}`,"data-key":e.key,"data-kind":e.kind,children:[k(`div`,{class:`ac-change-card__head`,children:[k(`code`,{class:`ac-change-card__key`,children:e.key}),k(`span`,{class:`ac-change-card__badge ac-change-card__badge--${t}`,children:t===`must_fix`?`Must fix`:t===`adopt`?`New default`:t===`review`?`Review`:`Info`})]}),e.new?.description===void 0?null:k(`p`,{class:`ac-change-card__desc`,children:e.new.description}),e.kind===`default_changed`?k(b,{children:[k(`p`,{class:`ac-change-card__detail`,children:[`Default changed: `,k(`code`,{children:Lu(e.old?.default)}),` → `,k(`code`,{children:Lu(e.new?.default)}),t===`review`?k(b,{children:[` · your value: `,k(`code`,{children:Lu(i)})]}):null]}),k(`div`,{class:`ac-change-card__choices`,role:`radiogroup`,"aria-label":`Resolution for ${e.key}`,children:[k(`label`,{class:`ac-change-card__choice`,children:[k(`input`,{type:`radio`,name:n,checked:r?.mode===`adopt`,onChange:()=>{Mu(n,{mode:`adopt`})}}),k(`span`,{children:[`Adopt new default (`,k(`code`,{children:Lu(e.new?.default)}),`)`]})]}),k(`label`,{class:`ac-change-card__choice`,children:[k(`input`,{type:`radio`,name:n,checked:r?.mode===`keep`,onChange:()=>{Mu(n,{mode:`keep`})}}),k(`span`,{children:[`Keep current (`,k(`code`,{children:Lu(i??e.old?.default)}),`)`]})]})]})]}):null,e.kind===`enum_removed`?t===`must_fix`?k(b,{children:[k(`p`,{class:`ac-change-card__detail`,children:[`Your value `,k(`code`,{children:Lu(i)}),` is no longer valid — removed option`,(e.values?.length??0)===1?``:`s`,`: `,k(`code`,{children:(e.values??[]).join(`, `)}),`. Pick a replacement:`]}),k(Ru,{change:e,id:n})]}):k(`p`,{class:`ac-change-card__detail`,children:[`Removed option`,(e.values?.length??0)===1?``:`s`,`: `,k(`code`,{children:(e.values??[]).join(`, `)}),` — your value `,k(`code`,{children:Lu(i??e.new?.default)}),` is unaffected.`]}):null,e.kind===`enum_added`?k(`p`,{class:`ac-change-card__detail`,children:[`New option`,(e.values?.length??0)===1?``:`s`,` available: `,k(`code`,{children:(e.values??[]).join(`, `)})]}):null,e.kind===`added`?t===`must_fix`?k(b,{children:[k(`p`,{class:`ac-change-card__detail`,children:`New setting without a shipped default — define a value:`}),k(Ru,{change:e,id:n})]}):k(`p`,{class:`ac-change-card__detail`,children:[`New setting · default: `,k(`code`,{children:Lu(e.new?.default)}),e.new?.enum===void 0?null:k(b,{children:[` · options: `,k(`code`,{children:e.new.enum.join(`, `)})]})]}):null,e.kind===`removed`?k(`p`,{class:`ac-change-card__detail`,children:`This setting no longer exists. Your stored value is kept in place and ignored (nothing is deleted).`}):null,e.kind===`type_changed`?k(b,{children:[k(`p`,{class:`ac-change-card__detail`,children:[`Type changed: `,k(`code`,{children:e.old?.type}),` → `,k(`code`,{children:e.new?.type}),`. Define a new value:`]}),k(Ru,{change:e,id:n})]}):null]})}function Bu(e){let t=new Map;for(let n of e.changes){let e=ju(n);t.set(e,[...t.get(e)??[],n])}let n=[],r=t.get(`must_fix`)??[];r.length>0&&n.push({title:`Must fix`,hint:`These stored values are invalid after the upgrade — saving is blocked until each has a valid value.`,changes:r});let i=[...t.get(`adopt`)??[],...t.get(`review`)??[]];i.length>0&&n.push({title:`Changed defaults`,hint:`Values you never customized are preselected to adopt the new default; customized values are kept unless you choose otherwise.`,changes:i});let a=t.get(`info`)??[],o=a.filter(e=>e.kind===`added`),s=a.filter(e=>e.kind===`enum_added`),c=a.filter(e=>e.kind!==`added`&&e.kind!==`enum_added`);return o.length>0&&n.push({title:`New settings`,changes:o}),s.length>0&&n.push({title:`New options`,changes:s}),c.length>0&&n.push({title:`Removed / other`,changes:c}),n}function Vu(){if(Re(()=>{ku()},[]),vu.value)return k(`div`,{class:`ac-page`,children:[k(`h1`,{children:`Settings changes`}),k(`p`,{children:`Loading…`})]});if(yu.value!==null)return k(`div`,{class:`ac-page`,children:[k(`h1`,{children:`Settings changes`}),k(`p`,{class:`ac-banner ac-banner--error`,children:yu.value})]});if(Du.value||bu.value)return k(`div`,{class:`ac-page ac-settings-changes`,children:[k(`h1`,{children:`Settings changes`}),k(`p`,{class:`ac-banner`,children:Du.value?`Review complete — all changes resolved.`:`Nothing to review — your settings are up to date.`}),k(`button`,{type:`button`,class:`ac-button`,onClick:()=>At(`/settings`),children:`Back to Settings`})]});let e=xu.value;if(e===null)return k(`div`,{class:`ac-page`,children:k(`h1`,{children:`Settings changes`})});let t=Bu(e),n=Nu().length;return k(`div`,{class:`ac-page ac-settings-changes`,children:[k(`header`,{class:`ac-page__header`,children:[k(`h1`,{children:`Settings changes`}),k(`p`,{class:`ac-page__lede`,children:[`The upgrade `,k(`code`,{children:e.oldVersion}),` → `,k(`code`,{children:e.newVersion}),` changed the available settings. Review below — nothing was changed automatically.`]})]}),Tu.value===null?null:k(`p`,{class:`ac-banner ac-banner--error`,role:`alert`,children:Tu.value}),t.map(e=>k(`section`,{class:`ac-settings-changes__group`,children:[k(`h2`,{children:[e.title,` `,k(`span`,{class:`ac-settings-changes__count`,children:[`(`,e.changes.length,`)`]})]}),e.hint===void 0?null:k(`p`,{class:`ac-settings-changes__hint`,children:e.hint}),k(`ul`,{class:`ac-settings-changes__list`,children:e.changes.map(e=>k(zu,{change:e},Ou(e)))})]},e.title)),k(`div`,{class:`ac-form__actions`,children:[k(`button`,{type:`button`,class:`ac-button`,disabled:Eu.value,onClick:()=>{Iu()},children:`Dismiss (keep everything)`}),k(`button`,{type:`button`,class:`ac-button ac-button--primary`,disabled:Eu.value||n>0,title:n>0?`${n} “Must fix” item${n===1?``:`s`} unresolved`:void 0,onClick:()=>{Fu()},children:Eu.value?`Saving…`:`Apply & finish review`})]})]})}var Hu=E(null);function Uu(){return Re(()=>{(async()=>{try{Hu.value=(await O(`/api/v1/settings/changes`)).delta.changes.length}catch{Hu.value=null}})()},[]),Hu.value===null||Hu.value===0?null:k(`div`,{class:`ac-banner ac-banner--pending`,role:`status`,children:[k(`span`,{children:[`An upgrade changed `,Hu.value,` setting`,Hu.value===1?``:`s`,` — review recommended.`]}),k(`button`,{type:`button`,class:`ac-button ac-button--small`,onClick:()=>At(`/settings/changes`),children:`Review changes`})]})}var Wu=E(!1),Gu=E(null),Ku=E({}),qu=E(null),Ju=E(0),Yu=E({}),Xu=E(null),Zu=E(!1),Qu=E(null),$u=E(null),ed=E(``),td=E(!1),nd=E({}),rd=E({global:new Set,project:new Set});function id(e){if(`$ref`in e&&e.$ref!==void 0&&`definitions`in e&&e.definitions!==void 0){let t=e.$ref.replace(`#/definitions/`,``),n=e.definitions[t];if(n!==void 0)return n}return e}async function ad(){Gu.value=null;try{let e=await O(`/api/v1/settings`);Ku.value=e.values,qu.value=id(e.schema),Ju.value=e.lastModified,rd.value={global:new Set(e.sources?.global??[]),project:new Set(e.sources?.project??[])},Wu.value=!0}catch(e){if(e instanceof D&&e.status===404&&e.body.error?.code===`NOT_FOUND`){let t=e.body;if(t.defaults!==void 0&&t.schema!==void 0){Ku.value=t.defaults,qu.value=id(t.schema),Ju.value=t.lastModified??0,Wu.value=!0;return}}Gu.value=e instanceof Error?e.message:String(e)}}async function od(){if(!Zu.value){Xu.value=null,Yu.value={};try{let e=await O(`/api/v1/settings/diff`,{method:`POST`,body:{values:Ku.value,ifUnmodifiedSince:Ju.value}});if(e.changes.length===0){Xu.value=`No changes to save.`;return}Qu.value=e.changes}catch(e){e instanceof D?(Yu.value=Bt(e.body.error??{code:`UNKNOWN`,message:e.message}),Xu.value=Rt(e.body.error??{code:`UNKNOWN`,message:e.message})):Xu.value=e instanceof Error?e.message:String(e)}}}async function sd(e=!1){Zu.value=!0;try{let t=await O(`/api/v1/settings`,{method:`PUT`,headers:{"If-Unmodified-Since":String(Ju.value)},body:e?{values:Ku.value,confirmSharedWrite:!0}:{values:Ku.value}});Ju.value=t.lastModified,Qu.value=null,$u.value=null,Xu.value=`Saved (${t.writtenPaths.join(`, `)}).`}catch(e){if(e instanceof D){let t=e.body;if(e.status===409&&t.error===`shared-write`){Qu.value=null,$u.value={sharedPath:typeof t.sharedPath==`string`?t.sharedPath:``,message:typeof t.message==`string`?t.message:`This write affects a shared agent-switch profile.`};return}let n=e.body.error??{code:`UNKNOWN`,message:e.message};Yu.value=Bt(n),Xu.value=Rt(n),Qu.value=null;let r=Object.keys(Yu.value)[0];r!==void 0&&queueMicrotask(()=>{let e=document.getElementById(r);e!==null&&e.focus()})}else Xu.value=e instanceof Error?e.message:String(e)}finally{Zu.value=!1}}function cd(e){if(e.defaultValue===void 0)return!1;let t=en(Ku.value,e.path);return t!==void 0&&JSON.stringify(t)!==JSON.stringify(e.defaultValue)}function ld(e,t){let n=cd(t),r=rd.value.project.has(e)?`project`:rd.value.global.has(e)&&rd.value.project.size>0?`global`:void 0;return{modified:n,onReset:n&&t.defaultValue!==void 0?()=>{Ku.value=tn(Ku.value,t.path,t.defaultValue)}:void 0,sourceLabel:r}}function ud(e,t){let n=t.toLowerCase();return e.path.join(`.`).toLowerCase().includes(n)||e.label.toLowerCase().includes(n)||(e.description??``).toLowerCase().includes(n)}function dd(e){let t=ed.value.trim(),n=td.value,r=e.path.join(`.`),i=nd.value[r]===!0,a=e.fields.filter(e=>e.kind!==`unsupported`);if(t!==``&&(a=a.filter(e=>ud(e,t))),n&&(a=a.filter(e=>cd(e))),t!==``||n)return a.length===0?null:{section:e,visible:a,hiddenAdvancedCount:0,expanded:i};let o=a.filter(e=>hu(e.path.join(`.`))),s=a.filter(e=>!hu(e.path.join(`.`))),c=i?[...o,...s]:o;return c.length===0&&s.length===0?null:{section:e,visible:c,hiddenAdvancedCount:i?0:s.length,expanded:i}}function fd(e){nd.value={...nd.value,[e]:nd.value[e]!==!0}}function pd(){let e=It.value?.agentSwitchProfile;return e===void 0||e.active!==!0?null:k(`div`,{class:`ac-banner`,role:`status`,children:k(`span`,{children:[`Running under agent-switch profile `,k(`code`,{children:e.provider!==null&&e.profile!==null?`${e.provider}/${e.profile}`:`an unidentified profile`}),` — settings shown and saved here are profile-scoped. Switching profiles shows that profile's own settings; nothing is lost.`]})})}function md({block:e}){return k(`div`,{class:`ac-modal`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`shared-write-title`,children:k(`div`,{class:`ac-modal__panel`,children:[k(`h2`,{id:`shared-write-title`,children:`Shared write — affects all profiles`}),k(`p`,{children:e.message}),k(`p`,{children:k(`code`,{children:e.sharedPath})}),k(`div`,{class:`ac-modal__actions`,children:[k(`button`,{type:`button`,class:`ac-button`,onClick:()=>{$u.value=null},children:`Cancel`}),k(`button`,{type:`button`,class:`ac-button ac-button--primary`,disabled:Zu.value,onClick:()=>{sd(!0)},children:Zu.value?`Writing…`:`Write (affects all profiles)`})]})]})})}function hd({changes:e}){return k(`div`,{class:`ac-modal`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`diff-title`,children:k(`div`,{class:`ac-modal__panel`,children:[k(`h2`,{id:`diff-title`,children:`Confirm changes`}),k(`ul`,{class:`ac-diff`,children:e.map(e=>k(`li`,{children:[k(`code`,{children:e.path}),k(`span`,{class:`ac-diff__before`,children:JSON.stringify(e.from)}),k(`span`,{class:`ac-diff__arrow`,children:`→`}),k(`span`,{class:`ac-diff__after`,children:JSON.stringify(e.to)})]},e.path))}),k(`div`,{class:`ac-modal__actions`,children:[k(`button`,{type:`button`,class:`ac-button`,onClick:()=>{Qu.value=null},children:`Cancel`}),k(`button`,{type:`button`,class:`ac-button ac-button--primary`,disabled:Zu.value,onClick:()=>{sd()},children:Zu.value?`Saving…`:`Save`})]})]})})}function gd(){if(Re(()=>{ad()},[]),!Wu.value||qu.value===null)return k(`div`,{class:`ac-page`,children:[k(`h1`,{children:`Settings`}),Gu.value===null?k(`p`,{children:`Loading…`}):k(`p`,{class:`ac-banner ac-banner--error`,children:Gu.value})]});let e=$t(qu.value),t=e.map(dd).filter(e=>e!==null),n=e.flatMap(e=>e.fields).filter(e=>cd(e)).length,r=ed.value.trim()!==``||td.value;return k(`div`,{class:`ac-page ac-settings-hub`,children:[k(`header`,{class:`ac-page__header`,children:[k(`h1`,{children:`Settings`}),k(`nav`,{class:`ac-page__nav`,children:k(`a`,{href:`#/settings/user`,children:`Edit .agent-user.yml →`})})]}),k(Uu,{}),k(pd,{}),k(`div`,{class:`ac-settings-hub__toolbar`,role:`search`,children:[k(`input`,{class:`ac-input ac-settings-hub__search`,type:`search`,placeholder:`Search all settings (basic and advanced)…`,value:ed.value,onInput:e=>{ed.value=e.currentTarget.value}}),k(`button`,{type:`button`,class:`ac-chip-toggle${td.value?` ac-chip-toggle--active`:``}`,"aria-pressed":td.value,onClick:()=>{td.value=!td.value},children:[`@modified`,n>0?` (${n})`:``]})]}),Xu.value===null?null:k(`p`,{class:`ac-banner`,children:Xu.value}),k(`form`,{class:`ac-form`,onSubmit:e=>e.preventDefault(),children:[t.length===0?k(`p`,{class:`ac-settings-hub__empty`,children:`No settings match.`}):t.map(e=>{let t=e.section.path.join(`.`);return k(on,{section:{...e.section,fields:e.visible},values:Ku.value,errors:Yu.value,onChange:e=>{Ku.value=e},decorate:ld,footer:!r&&(e.hiddenAdvancedCount>0||e.expanded)?k(`button`,{type:`button`,class:`ac-settings-hub__disclosure`,"aria-expanded":e.expanded,onClick:()=>{fd(t)},children:e.expanded?`Hide advanced settings`:`Show ${e.hiddenAdvancedCount} advanced setting${e.hiddenAdvancedCount===1?``:`s`}`}):void 0},t)}),k(`div`,{class:`ac-form__actions`,children:[k(`button`,{type:`button`,class:`ac-button`,onClick:()=>{ad()},children:`Reload`}),k(`button`,{type:`button`,class:`ac-button ac-button--primary`,onClick:()=>{od()},children:`Preview & Save`})]})]}),Qu.value===null?null:k(hd,{changes:Qu.value}),$u.value===null?null:k(md,{block:$u.value})]})}var _d=E(!1),vd=E(null);async function yd(){Mc.value=!0,Nc.value=null;try{let e=await O(`/api/v1/modules/detect`);Pc.value=e.candidates,zc.value=e.project_root;let t={};for(let n of e.candidates)t[n.path]=!0;Fc.value=t,Ic.value=e.proposed_block.enabled,Lc.value=e.proposed_block.namespace_template??``,Rc.value=e.proposed_block.agent_folder??`agents`}catch(e){Nc.value=e instanceof D?Rt(e.body.error??{code:`UNKNOWN`,message:e.message}):e instanceof Error?e.message:String(e)}finally{Mc.value=!1,jc.value=!0}}function bd(){let e=new Set(Pc.value.map(e=>e.path)),t=Fc.value,n=Object.keys(t).filter(n=>t[n]===!0&&e.has(n));return{enabled:Ic.value,root_paths:n,namespace_template:Lc.value,agent_folder:Rc.value||`agents`}}async function xd(){_d.value=!0,vd.value=null;try{let e=await O(`/api/v1/modules/apply`,{method:`POST`,body:bd()});vd.value={message:e.appliedTo===null?`Saved project settings to ${e.projectRoot}.`:`Saved project settings to ${e.appliedTo}.`,tone:`success`}}catch(e){vd.value={message:`Could not save project settings: ${e instanceof D?Rt(e.body.error??{code:`UNKNOWN`,message:e.message}):e instanceof Error?e.message:String(e)}`,tone:`error`}}finally{_d.value=!1}}function Sd(){if(Mc.value)return k(`p`,{children:`Detecting module roots…`});if(Nc.value!==null)return k(`p`,{class:`ac-banner ac-banner--error`,children:[`Module detection failed: `,Nc.value]});let e=Pc.value,t=Fc.value,n=zc.value;return k(`div`,{class:`ac-section`,children:[n===null?null:k(`p`,{class:`ac-section__description`,children:[`Scanning `,k(`code`,{children:n}),`. Pick which detected roots the agent should treat as modules. These write to`,k(`code`,{children:` .agent-project-settings.yml`}),` in this repo only.`]}),k(`label`,{children:[k(`input`,{type:`checkbox`,checked:Ic.value,onChange:e=>{Ic.value=e.currentTarget.checked}}),` `,`Enable module discovery (writes `,k(`code`,{children:`modules.enabled`}),`)`]}),e.length===0?k(`p`,{children:[k(`em`,{children:`No module roots detected.`}),` The scan found no common module layouts (Laravel `,k(`code`,{children:`app/Modules/`}),`, Symfony`,k(`code`,{children:` src/Module/`}),`, Node `,k(`code`,{children:`packages/`}),`, Python`,k(`code`,{children:` src/`}),`, Go `,k(`code`,{children:`internal/`}),`).`]}):k(`ul`,{style:`list-style: none; padding-left: 0;`,children:e.map(e=>k(`li`,{children:k(`label`,{children:[k(`input`,{type:`checkbox`,checked:t[e.path]??!1,onChange:n=>{let r=n.currentTarget.checked;Fc.value={...t,[e.path]:r}}}),` `,k(`code`,{children:e.path}),` — `,e.stack,` `,k(`small`,{children:[`(`,e.confidence,` confidence)`]})]})},e.path))}),k(`div`,{class:`ac-wizard__module-fields`,children:[k(`div`,{class:`ac-field`,children:[k(`label`,{class:`ac-field__label`,for:`ac-modules-namespace`,children:`Namespace template`}),k(`input`,{id:`ac-modules-namespace`,class:`ac-input`,type:`text`,value:Lc.value,placeholder:`e.g. App\\\\Modules\\\\{ModuleName}\\\\App`,onInput:e=>{Lc.value=e.currentTarget.value}}),k(`span`,{class:`ac-field__description`,children:`How a module path maps to its namespace. Leave blank to skip namespacing.`})]}),k(`div`,{class:`ac-field`,children:[k(`label`,{class:`ac-field__label`,for:`ac-modules-agent-folder`,children:`Agent folder`}),k(`input`,{id:`ac-modules-agent-folder`,class:`ac-input`,type:`text`,value:Rc.value,placeholder:`agents`,onInput:e=>{Rc.value=e.currentTarget.value}}),k(`span`,{class:`ac-field__description`,children:[`Folder name that holds per-module agent docs (default `,k(`code`,{children:`agents`}),`).`]})]})]})]})}function Cd(){return Re(()=>{yd()},[]),k(`div`,{class:`ac-page`,children:[k(`header`,{class:`ac-page__header`,children:[k(`h1`,{children:`Project settings`}),k(`p`,{class:`ac-section__description`,children:[`Configuration scoped to this repository — written to`,k(`code`,{children:` .agent-project-settings.yml`}),`, not the global tree.`]})]}),vd.value===null?null:k(`p`,{class:`ac-banner ac-banner--${vd.value.tone===`success`?`success`:`error`}`,children:vd.value.message}),k(`section`,{class:`ac-section`,children:[k(`h2`,{class:`ac-section__title`,children:`Modules`}),k(Sd,{})]}),k(`div`,{class:`ac-form__actions ac-wizard__nav`,children:k(`button`,{type:`button`,class:`ac-button ac-button--primary`,disabled:_d.value||Mc.value,onClick:()=>{xd()},children:_d.value?`Saving…`:`Save project settings`})})]})}var wd=E([]),Td=E([]),Ed=E([]),Dd=E([]),Od=E(null),kd=E(!1),Ad=E(null),jd=E(null),Md=E(`plain`),Nd=E({}),Pd=E([]),Fd={"claude-code":`Claude Code`,codex:`Codex`,gemini:`Gemini`};function Id(){try{return globalThis.sessionStorage?.getItem(`ac-workspace-host`)??`claude-code`}catch{return`claude-code`}}var Ld=E(Id());function Rd(e){Ld.value=e;try{globalThis.sessionStorage?.setItem(`ac-workspace-host`,e)}catch{}}var zd=E([]),Bd=E(null),Vd=E({}),Hd=E(!1),Ud=E(null),Wd=E(``),Gd=E(!1),Kd=E(!1),qd=E(null),Jd=E(null),Yd=E([]),Xd=E(new Set),Zd=`claude-code`,Qd=2e3;async function $d(){Ad.value=null;try{let[e,t,n,r,i,a]=await Promise.all([O(`/api/v1/workspace/roles`),O(`/api/v1/workspace/sessions?limit=20`),O(`/api/v1/workspace/knowledge?limit=20`),O(`/api/v1/workspace/documents?limit=20`),O(`/api/v1/workspace/drive-health`).catch(()=>({health:{}})),O(`/api/v1/workspace/hosts`).catch(()=>({hosts:[]}))]);wd.value=e.roles,Td.value=t.sessions,Ed.value=n.chunks,Dd.value=r.documents,Nd.value=i.health??{},Pd.value=a.hosts??[],kd.value=!0}catch(e){Ad.value=e instanceof D?e.body?.error?.message??e.message:e instanceof Error?e.message:String(e)}}async function ef(e,t){try{zd.value=(await O(`/api/v1/workspace/roles/${e}/tasks`)).tasks}catch{zd.value=t}}async function tf(e){Jd.value=e,Xd.value=new Set;try{let t=await O(`/api/v1/workspace/sessions/${e}`);Yd.value=Array.isArray(t.log)?t.log:[]}catch{Yd.value=[]}}async function nf(e){jd.value=null,Kd.value=!1,Wd.value=``,Bd.value=null,await tf(e)}async function rf(e,t,n){jd.value=null,Hd.value=!0,Wd.value=``,Kd.value=!1,qd.value={role:e,task:t,inputs:n};try{let r=await O(`/api/v1/workspace/launch`,{method:`POST`,body:{role:e,task:t,inputs:n,host:Ld.value}});Ud.value=r,jd.value=cf(r),Bd.value=null,await tf(r.id),Td.value=(await O(`/api/v1/workspace/sessions?limit=20`)).sessions,await of()}catch(e){Ud.value=null,jd.value=e instanceof D?e.body?.error?.message??e.message:e instanceof Error?e.message:String(e)}finally{Hd.value=!1}}async function af(e,t){if(!(t.trim()===``||Gd.value)){Gd.value=!0,jd.value=null;try{let n=await O(`/api/v1/workspace/sessions/${e}/continue`,{method:`POST`,body:{prompt:t}});Ud.value=n,jd.value=cf(n),n.driven&&(Wd.value=``),await tf(e),Td.value=(await O(`/api/v1/workspace/sessions?limit=20`)).sessions,await of()}catch(e){e instanceof D&&e.status===410?(Kd.value=!0,jd.value=`Host session expired — start a new conversation.`):jd.value=e instanceof D?e.body?.error?.message??e.message:e instanceof Error?e.message:String(e)}finally{Gd.value=!1}}}async function of(){try{Nd.value=(await O(`/api/v1/workspace/drive-health`)).health??{}}catch{}}async function sf(e){try{await O(`/api/v1/workspace/drive-health/${e}/reset`,{method:`POST`}),await of()}catch{}}function cf(e){return e.driven?e.recovered===!0?`Host recovered — drove the turn for ${e.role} · ${e.task}.`:`Drove the turn for ${e.role} · ${e.task}.`:e.host_killed===!0?`Host ${Zd} is paused after repeated failures — handed off to the inbox.`:e.error_kind===`render-error`?`Couldn't fill the prompt: ${e.error??`missing input`}.`:e.reason===`no-prompt-for-task`?`Recorded the session — this task has no runnable prompt yet.`:typeof e.handoff==`string`?`Prepared a hand-off — open ${e.handoff} and paste it into your host.`:`Recorded the session ${e.id} (${e.role} · ${e.task}).`}function lf({role:e}){let t=Od.value===e.slug;return k(`button`,{type:`button`,class:`ac-workspace__role${t?` ac-workspace__role--active`:``}`,"aria-current":t?`true`:void 0,"aria-label":`Pick role ${e.display_name}`,onClick:()=>{Od.value=e.slug,jd.value=null,Ud.value=null,Bd.value=null,Vd.value={},zd.value=e.first_tasks,ef(e.slug,e.first_tasks)},children:[k(`span`,{class:`ac-workspace__role-name`,children:e.display_name}),k(`span`,{class:`ac-workspace__role-status`,"data-status":e.status,children:e.status}),k(`span`,{class:`ac-workspace__role-tagline`,children:e.tagline})]})}function uf({role:e,task:t}){let n=t.inputs??[],r=Vd.value,i=n.some(e=>e.required&&(r[e.name]??``).trim()===``);return k(`form`,{class:`ac-workspace__task-form`,onSubmit:n=>{n.preventDefault(),!i&&!Hd.value&&rf(e,t.name,Vd.value)},children:[n.length===0?k(`p`,{class:`ac-workspace__form-note`,children:`No inputs — runs the prompt as-is.`}):n.map(e=>k(`label`,{class:`ac-workspace__field`,children:[k(`span`,{class:`ac-workspace__field-label`,children:[e.name,e.required?k(`span`,{class:`ac-workspace__req`,"aria-hidden":`true`,children:` *`}):null]}),k(`textarea`,{class:`ac-workspace__field-input`,placeholder:e.shape,required:e.required,"aria-label":`${e.name}${e.required?` (required)`:``}`,value:r[e.name]??``,onInput:t=>{Vd.value={...Vd.value,[e.name]:t.target.value}}})]},e.name)),k(`div`,{class:`ac-workspace__form-actions`,children:[k(`button`,{type:`submit`,class:`ac-button ac-button--primary`,disabled:i||Hd.value,children:Hd.value?`Running…`:`Run task`}),k(`button`,{type:`button`,class:`ac-button`,onClick:()=>{Bd.value=null},children:`Cancel`})]})]})}function df(e){let t=[];for(let n of e){let e=n.data??{};if(n.kind===`launcher.input`)e.followup===!0?t.push({kind:`user`,text:typeof e.prompt==`string`?e.prompt:``}):t.push({kind:`task`,text:typeof e.task==`string`?e.task:``});else if(n.kind===`host.turn`){let n=e.usage,r=n==null?void 0:`${typeof e.model==`string`?e.model:Zd} · in ${n.input_tokens??0} / out ${n.output_tokens??0} tokens`;t.push({kind:`assistant`,text:typeof e.text==`string`?e.text:``,meta:r})}else if(n.kind===`host.error`){let n=typeof e.error_kind==`string`?e.error_kind:`error`;t.push({kind:`error`,text:`${n}: ${typeof e.error==`string`?e.error:``}`})}}return t}function ff(){if(Jd.value===null)return null;let e=df(Yd.value),t=Yd.value.some(e=>e.kind===`host.turn`);return k(`section`,{class:`ac-workspace__thread`,"aria-label":`Conversation thread`,children:[k(`h2`,{class:`ac-workspace__heading`,children:`Conversation`}),e.length===0?k(`p`,{class:`ac-workspace__empty`,children:`No turns yet.`}):k(`ol`,{class:`ac-workspace__thread-list`,children:e.map((e,t)=>{let n=e.kind===`assistant`&&e.text.length>Qd,r=Xd.value.has(t),i=n&&!r?`${e.text.slice(0,Qd)}…`:e.text;return k(`li`,{class:`ac-workspace__thread-block ac-workspace__thread-block--${e.kind}`,children:[k(`span`,{class:`ac-workspace__thread-role`,children:e.kind===`task`?`Task`:e.kind===`user`?`You`:e.kind===`assistant`?`Host`:`Error`}),k(`pre`,{class:`ac-workspace__thread-text`,children:i}),n?k(`button`,{type:`button`,class:`ac-button`,onClick:()=>{let e=new Set(Xd.value);e.has(t)?e.delete(t):e.add(t),Xd.value=e},children:r?`Show less`:`Show full`}):null,e.meta==null?null:k(`p`,{class:`ac-workspace__turn-meta`,children:e.meta})]},t)})}),Kd.value?k(`div`,{class:`ac-workspace__followup-gone`,role:`status`,children:[k(`p`,{children:`Host session expired.`}),qd.value===null?k(`p`,{children:`Pick a task above to start a new conversation.`}):k(`button`,{type:`button`,class:`ac-button ac-button--primary`,disabled:Hd.value,onClick:()=>{let e=qd.value;e!==null&&rf(e.role,e.task,e.inputs)},children:Hd.value?`Starting…`:`Start a new conversation`})]}):t?k(`form`,{class:`ac-workspace__followup`,onSubmit:e=>{e.preventDefault(),Jd.value!==null&&af(Jd.value,Wd.value)},children:[k(`label`,{class:`ac-workspace__field`,children:[k(`span`,{class:`ac-workspace__field-label`,children:`Follow up`}),k(`textarea`,{class:`ac-workspace__field-input`,placeholder:`Continue this conversation — e.g. make it shorter`,"aria-label":`Follow-up prompt`,value:Wd.value,onInput:e=>{Wd.value=e.target.value}})]}),k(`button`,{type:`submit`,class:`ac-button ac-button--primary`,disabled:Wd.value.trim()===``||Gd.value,children:Gd.value?`Continuing…`:`Send follow-up`})]}):null]})}function pf({role:e}){let t=zd.value.length>0?zd.value:e.first_tasks;return k(`section`,{class:`ac-workspace__tasks`,"aria-labelledby":`task-heading`,children:[k(`h2`,{id:`task-heading`,class:`ac-workspace__heading`,children:[`First tasks · `,e.display_name]}),t.length===0?k(`p`,{class:`ac-workspace__empty`,children:`No tasks scaffolded yet for this role.`}):k(`ul`,{class:`ac-workspace__task-list`,children:t.map(t=>k(`li`,{class:`ac-workspace__task`,children:[k(`div`,{class:`ac-workspace__task-head`,children:[k(`span`,{class:`ac-workspace__task-name`,children:t.name}),k(`button`,{type:`button`,class:`ac-button ac-button--primary`,"aria-expanded":Bd.value===t.name,onClick:()=>{Bd.value=Bd.value===t.name?null:t.name,Vd.value={},Ud.value=null,Jd.value=null,Yd.value=[]},children:Bd.value===t.name?`Close`:`Start session`})]}),k(`p`,{class:`ac-workspace__task-intent`,children:t.intent}),t.prompt===``?null:k(`code`,{class:`ac-workspace__task-prompt`,children:[`prompts/`,t.prompt]}),Bd.value===t.name?k(uf,{role:e.slug,task:t}):null]},t.name))}),e.skills.length>0?k(`details`,{class:`ac-workspace__skills`,children:[k(`summary`,{children:[`Skill shortlist (`,e.skills.length,`)`]}),k(`ul`,{class:`ac-workspace__skill-list`,children:[e.skills.slice(0,5).map(e=>k(`li`,{class:`ac-workspace__skill`,children:[k(`code`,{children:e.id}),` — `,e.why]},e.id)),e.skills.length>5?k(`li`,{class:`ac-workspace__skill-more`,children:[`+ `,e.skills.length-5,` more`]}):null]})]}):null]})}function mf(){return k(`section`,{class:`ac-workspace__sessions`,"aria-labelledby":`sessions-heading`,children:[k(`h2`,{id:`sessions-heading`,class:`ac-workspace__heading`,children:`Recent sessions`}),Td.value.length===0?k(`p`,{class:`ac-workspace__empty`,children:`No sessions yet — pick a role and start one.`}):k(`ul`,{class:`ac-workspace__session-list`,children:Td.value.map(e=>k(`li`,{class:`ac-workspace__session`,children:k(`button`,{type:`button`,class:`ac-workspace__session-open${Jd.value===e.id?` ac-workspace__session-open--active`:``}`,"aria-label":`Open session ${e.task}`,"aria-current":Jd.value===e.id?`true`:void 0,onClick:()=>{nf(e.id)},children:[k(`span`,{class:`ac-workspace__session-id`,children:e.id.slice(0,16)}),k(`span`,{class:`ac-workspace__session-role`,children:e.role}),k(`span`,{class:`ac-workspace__session-task`,children:e.task})]})},e.id))})]})}function hf(){return k(`section`,{class:`ac-workspace__knowledge`,"aria-labelledby":`knowledge-heading`,children:[k(`h2`,{id:`knowledge-heading`,class:`ac-workspace__heading`,children:`Knowledge sources`}),Ed.value.length===0?k(`p`,{class:`ac-workspace__empty`,children:[`No sources yet. Run `,k(`code`,{children:`/knowledge:ingest <path>`}),` to add documents.`]}):k(`ol`,{class:`ac-workspace__citation-list`,children:Ed.value.map((e,t)=>k(`li`,{class:`ac-workspace__citation`,children:[k(`span`,{class:`ac-workspace__citation-marker`,"aria-label":`Citation ${t+1}`,children:[`[`,t+1,`]`]}),k(`a`,{href:`file://${e.source}`,class:`ac-workspace__citation-source`,title:`Open source in OS default app`,children:e.source.split(`/`).pop()??e.source}),e.pinned?k(`span`,{class:`ac-workspace__citation-pin`,"aria-label":`pinned`,children:`★`}):null,k(`p`,{class:`ac-workspace__citation-excerpt`,children:[e.excerpt.slice(0,200),e.excerpt.length>200?`…`:``]})]},e.id))})]})}function gf(){return k(`section`,{class:`ac-workspace__recent`,"aria-labelledby":`recent-heading`,children:[k(`h2`,{id:`recent-heading`,class:`ac-workspace__heading`,children:`Recent documents`}),Dd.value.length===0?k(`p`,{class:`ac-workspace__empty`,children:`No documents yet. Saved drafts land here.`}):k(`ul`,{class:`ac-workspace__doc-list`,children:Dd.value.map(e=>k(`li`,{class:`ac-workspace__doc`,children:[k(`span`,{class:`ac-workspace__doc-type`,"data-type":e.type,children:e.type}),k(`span`,{class:`ac-workspace__doc-title`,children:e.title}),k(`time`,{class:`ac-workspace__doc-time`,dateTime:e.updated_at,children:e.updated_at.slice(0,10)})]},`${e.type}/${e.slug}`))})]})}function _f(){let e=Object.values(Nd.value).filter(e=>e.killed||e.consecutive_failures>0);return k(`section`,{class:`ac-workspace__drive-health`,"aria-labelledby":`drive-health-heading`,children:[k(`h2`,{id:`drive-health-heading`,class:`ac-workspace__heading`,children:`Host health`}),e.length===0?k(`p`,{class:`ac-workspace__empty`,children:`All hosts healthy.`}):k(`ul`,{class:`ac-workspace__health-list`,children:Object.entries(Nd.value).filter(([,e])=>e.killed||e.consecutive_failures>0).map(([e,t])=>{let n=t.killed?t.kill_reason===`manual`?`paused (manual)`:`paused — auto-recovering`:`degraded`;return k(`li`,{class:`ac-workspace__health`,"data-killed":t.killed?`true`:`false`,children:[k(`span`,{class:`ac-workspace__health-host`,children:e}),k(`span`,{class:`ac-workspace__health-state`,children:n}),k(`span`,{class:`ac-workspace__health-meta`,children:[t.consecutive_failures,` fail streak`,t.last_error_kind==null?``:` · ${t.last_error_kind}`]}),t.killed?k(`button`,{type:`button`,class:`ac-button ac-workspace__health-reset`,"aria-label":`Reset ${e}`,onClick:()=>{sf(e)},children:`Reset`}):null]},e)})})]})}function vf(){let e=Md.value;return k(`fieldset`,{class:`ac-workspace__explain`,children:[k(`legend`,{class:`ac-workspace__heading`,children:`Explanation style`}),k(`label`,{class:`ac-workspace__explain-option`,children:[k(`input`,{type:`radio`,name:`explain-mode`,value:`plain`,checked:e===`plain`,onChange:()=>{Md.value=`plain`},"aria-label":`Plain language`}),k(`span`,{children:`Plain language`})]}),k(`label`,{class:`ac-workspace__explain-option`,children:[k(`input`,{type:`radio`,name:`explain-mode`,value:`technical`,checked:e===`technical`,onChange:()=>{Md.value=`technical`},"aria-label":`Technical detail`}),k(`span`,{children:`Technical detail`})]}),k(`p`,{class:`ac-workspace__explain-hint`,children:e===`plain`?`Replies use everyday words. Toggle to see the technical view.`:`Replies keep the technical vocabulary. Toggle for the plain view.`})]})}function yf(){let e=Pd.value,t=e.length>0?e.map(e=>e.id):Object.keys(Fd),n=new Map(e.map(e=>[e.id,e.cli_present]));return k(`label`,{class:`ac-workspace__host-picker`,children:[k(`span`,{class:`ac-workspace__host-label`,children:`Host`}),k(`select`,{class:`ac-workspace__host-select`,"aria-label":`Host agent`,value:Ld.value,onChange:e=>{Rd(e.target.value)},children:t.map(e=>{let t=n.get(e)!==!1,r=Fd[e]??e;return k(`option`,{value:e,disabled:!t,children:[r,` (`,e,`)`,t?``:` — not installed`]},e)})})]})}function bf(){if(Re(()=>{$d()},[]),Ad.value!==null)return k(`div`,{class:`ac-page ac-page--error`,children:[k(`h1`,{children:`Workspace`}),k(`p`,{class:`ac-banner ac-banner--error`,children:Ad.value})]});if(!kd.value)return k(`div`,{class:`ac-page`,children:[k(`h1`,{children:`Workspace`}),k(`p`,{children:`Loading…`})]});let e=Od.value===null?null:wd.value.find(e=>e.slug===Od.value)??null;return k(`div`,{class:`ac-page ac-workspace`,children:[k(`header`,{class:`ac-page__header`,children:[k(`h1`,{children:`Workspace`}),k(`p`,{class:`ac-page__subtitle`,children:`Pick a role, pick a first task, run it.`}),k(yf,{})]}),jd.value===null?null:k(`p`,{class:`ac-banner`,role:`status`,children:jd.value}),k(`div`,{class:`ac-workspace__grid`,children:[k(`section`,{class:`ac-workspace__roles`,"aria-labelledby":`roles-heading`,children:[k(`h2`,{id:`roles-heading`,class:`ac-workspace__heading`,children:`Roles`}),wd.value.length===0?k(`p`,{class:`ac-workspace__empty`,children:`No roles installed.`}):k(`div`,{class:`ac-workspace__role-grid`,children:wd.value.map(e=>k(lf,{role:e},e.slug))})]}),k(`main`,{class:`ac-workspace__main`,"aria-label":`Tasks and sessions`,children:[e===null?k(`p`,{class:`ac-workspace__empty`,children:`Pick a role on the left to see its first tasks.`}):k(pf,{role:e}),k(ff,{}),k(mf,{})]}),k(`aside`,{class:`ac-workspace__rail`,"aria-label":`Knowledge and documents`,children:[k(hf,{}),k(gf,{}),k(_f,{}),k(vf,{})]})]})]})}var xf=`agent-config-theme`;function Sf(){return(typeof document<`u`?document.documentElement.getAttribute(`data-theme`):null)===`dark`?`dark`:`light`}var Cf=E(Sf());function wf(){try{let e=localStorage.getItem(xf);return e===`light`||e===`dark`?e:null}catch{return null}}function Tf(){if(typeof window>`u`)return null;try{let e=new URLSearchParams(window.location.search).get(`theme`);return e===`light`||e===`dark`?e:null}catch{return null}}function Ef(){return wf()===null&&Tf()===null}function Df(e){Cf.value=e,document.documentElement.setAttribute(`data-theme`,e)}function Of(){let e=Cf.value===`dark`?`light`:`dark`;try{localStorage.setItem(xf,e)}catch{}Df(e)}function kf(){if(typeof window>`u`||typeof window.matchMedia!=`function`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);typeof e.addEventListener==`function`&&e.addEventListener(`change`,()=>{Ef()&&Df(e.matches?`dark`:`light`)})}function Af(){return typeof window>`u`?!1:new URLSearchParams(window.location.search).get(`embed`)===`1`}var jf=Af(),Mf=[{id:`setup`,label:`Setup`,hashPath:`/setup`,matches:[`/setup`,`/wizard`]},{id:`settings`,label:`Settings`,hashPath:`/settings`,matches:[`/settings`]},{id:`project`,label:`Project`,hashPath:`/project`,matches:[`/project`]},{id:`workspace`,label:`Workspace`,hashPath:`/workspace`,matches:[`/workspace`]}];function Nf(e){for(let t of Mf)for(let n of t.matches)if(e===n||e.startsWith(`${n}/`))return t.id;return null}function Pf(e){let t=It.value,n=Nf(e);return Mf.filter(e=>e.id===`project`?t?.projectSurface===!0||n===`project`:e.id!==`workspace`||t?.devSurfaces===!0||n===`workspace`)}function Ff(){let e=kt.value,t=Nf(e);return k(`header`,{class:`ac-topnav`,children:k(`div`,{class:`ac-topnav__inner`,children:[k(`div`,{class:`ac-topnav__brand`,children:[k(`h1`,{class:`ac-topnav__title`,children:`@event4u/agent-config`}),k(`p`,{class:`ac-topnav__subtitle`,children:`Browser Wizard`})]}),k(`nav`,{class:`ac-topnav__tabs`,"aria-label":`Surfaces`,children:Pf(e).map(e=>k(`button`,{type:`button`,class:`ac-topnav__tab${t===e.id?` ac-topnav__tab--active`:``}`,"aria-current":t===e.id?`page`:void 0,onClick:()=>At(e.hashPath),children:e.label},e.id))}),k(`button`,{type:`button`,class:`ac-topnav__theme`,"aria-label":Cf.value===`dark`?`Switch to light theme`:`Switch to dark theme`,title:Cf.value===`dark`?`Switch to light theme`:`Switch to dark theme`,onClick:()=>{Of()},children:Cf.value===`dark`?`☀`:`☾`})]})})}function If({path:e}){return k(`div`,{class:`ac-page ac-page--error`,children:[k(`h1`,{children:`Page not found`}),k(`p`,{children:[`Nothing routed to `,k(`code`,{children:e}),`. Try `,k(`a`,{href:`#/setup`,children:`Setup`}),`.`]})]})}function Lf(){let e=It.value;return e===null||e.dryRun!==!0?null:k(`div`,{class:`ac-dryrun-banner`,role:`status`,"aria-live":`polite`,children:[k(`strong`,{children:`DRY RUN`}),k(`span`,{children:` · no files will be written. Validation + rendering run normally; commits return a preview.`})]})}function Rf(e){return e===`/`||e===`/setup`||e.startsWith(`/setup/`)||e.startsWith(`/wizard`)?k(pu,{path:e}):e===`/settings/changes`?k(Vu,{}):e===`/settings`||e.startsWith(`/settings/`)?k(gd,{}):e===`/project`||e.startsWith(`/project/`)?k(Cd,{}):e===`/workspace`?k(bf,{}):k(If,{path:e})}function zf(){return Re(()=>{Mt(),kt.value===`/`&&At(`/setup`),Lt()},[]),k(b,{children:[k(Lf,{}),jf?null:k(Ff,{}),Rf(kt.value)]})}var Bf=3e4,Vf=18e5,Hf=null,Uf=!1;function Wf(e){if(!Uf&&(Uf=!0,typeof navigator<`u`&&typeof navigator.sendBeacon==`function`))try{navigator.sendBeacon(`/api/v1/shutdown?token=${encodeURIComponent(e)}`)}catch{}}function Gf(e){if(typeof window>`u`)return()=>{};let t=Date.now(),n=()=>{t=Date.now()},r=[`pointerdown`,`keydown`,`wheel`,`touchstart`];for(let e of r)window.addEventListener(e,n,{passive:!0});let i=()=>{document.hidden||n()};document.addEventListener(`visibilitychange`,i);let a=()=>{Hf!==null&&clearInterval(Hf),Hf=null;for(let e of r)window.removeEventListener(e,n);document.removeEventListener(`visibilitychange`,i),window.removeEventListener(`pagehide`,o)};Hf=setInterval(()=>{document.hidden||(Date.now()-t>Vf?(Wf(e),a()):O(`/api/v1/ping`).catch(()=>{}))},Bf);function o(){Wf(e)}return window.addEventListener(`pagehide`,o),a}function Kf(){if(typeof window>`u`||typeof window.history?.replaceState!=`function`)return;let e=new URLSearchParams(window.location.search);if(!e.has(`token`))return;e.delete(`token`);let t=e.toString(),n=window.location.pathname+(t?`?${t}`:``)+window.location.hash;window.history.replaceState(window.history.state,``,n)}function qf(){return new URLSearchParams(window.location.search).get(`token`)}function Jf(){let e=document.getElementById(`app`);if(e===null)return;let t=qf();t===null?e.textContent="agent-config UI · missing token — re-open via `agent-config ui:serve`.":(Pt(t),Kf(),Gf(t),kf(),e.textContent=``,Ce(k(zf,{}),e))}Jf();
|
|
23
|
+
//# sourceMappingURL=index-w70Ado09.js.map
|
package/dist/ui/index.html
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
document.documentElement.setAttribute('data-theme', theme);
|
|
28
28
|
})();
|
|
29
29
|
</script>
|
|
30
|
-
<script type="module" crossorigin src="/assets/index-
|
|
30
|
+
<script type="module" crossorigin src="/assets/index-w70Ado09.js"></script>
|
|
31
31
|
<link rel="stylesheet" crossorigin href="/assets/index-Cyjy8bWO.css">
|
|
32
32
|
</head>
|
|
33
33
|
<body>
|