@event4u/agent-config 14.12.0 → 14.14.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 +1 -1
- package/CHANGELOG.md +118 -155
- package/CONTRIBUTING.md +38 -0
- package/CREDITS.md +135 -0
- package/NOTICE +13 -0
- package/README.md +8 -6
- package/dist/agent-src/commands/analyze/inbox.md +145 -2
- package/dist/agent-src/commands/feature/dev.md +7 -2
- package/dist/agent-src/commands/ghostwriter/write.md +5 -1
- package/dist/agent-src/commands/implement-ticket.md +1 -1
- package/dist/agent-src/commands/mission/upgrade.md +1 -1
- package/dist/agent-src/commands/orchestrate.md +2 -2
- package/dist/agent-src/commands/post-as/me.md +5 -1
- package/dist/agent-src/commands/pr/merge.md +19 -6
- package/dist/agent-src/commands/roadmap/process-full.md +19 -5
- package/dist/agent-src/commands/tdd/red.md +12 -2
- package/dist/agent-src/commands/work.md +1 -1
- package/dist/agent-src/contexts/communication/rules-auto/token-efficiency-mechanics.md +40 -0
- package/dist/agent-src/contexts/execution/auto-dispatch-classification.md +5 -2
- package/dist/agent-src/contexts/execution/autonomy-mechanics.md +21 -0
- package/dist/agent-src/contexts/execution/orchestration-telemetry.md +1 -0
- package/dist/agent-src/contexts/execution/subagent-response-contract.md +40 -0
- package/dist/agent-src/contexts/execution/subagent-steering.md +13 -1
- package/dist/agent-src/contexts/execution/terminal-states.md +96 -0
- package/dist/agent-src/rules/artifact-drafting-protocol.md +1 -1
- package/dist/agent-src/rules/broken-access-control.md +4 -0
- package/dist/agent-src/rules/code-comment-discipline.md +6 -0
- package/dist/agent-src/rules/code-provenance.md +4 -0
- package/dist/agent-src/rules/design-fidelity.md +1 -1
- package/dist/agent-src/rules/domain-safety-pii.md +4 -0
- package/dist/agent-src/rules/domain-safety-retention.md +4 -0
- package/dist/agent-src/rules/engineering-safety-floor.md +2 -0
- package/dist/agent-src/rules/external-code-graph-interop.md +14 -12
- package/dist/agent-src/rules/improve-before-implement.md +6 -8
- package/dist/agent-src/rules/laravel-routing.md +1 -1
- package/dist/agent-src/rules/lethal-trifecta-guard.md +4 -0
- package/dist/agent-src/rules/secret-vcs-guard.md +2 -0
- package/dist/agent-src/rules/security-sensitive-stop.md +2 -0
- package/dist/agent-src/rules/source-confidentiality.md +12 -34
- package/dist/agent-src/rules/symfony-routing.md +1 -1
- package/dist/agent-src/rules/token-efficiency.md +14 -0
- package/dist/agent-src/rules/tool-safety.md +4 -0
- package/dist/agent-src/rules/untrusted-input-defense.md +4 -0
- package/dist/agent-src/scripts/archive_completed_roadmaps.ts +252 -8
- package/dist/agent-src/scripts/guarded_baseline.ts +343 -0
- package/dist/agent-src/scripts/roadmap_set_step.ts +253 -0
- package/dist/agent-src/scripts/stub_queue.ts +82 -0
- package/dist/agent-src/scripts/stubs_due.ts +516 -0
- package/dist/agent-src/scripts/ticket_bundles.ts +84 -0
- package/dist/agent-src/scripts/update_roadmap_progress.ts +16 -12
- package/dist/agent-src/skills/brand-asset-generation/SKILL.md +17 -4
- package/dist/agent-src/skills/brand-audit/SKILL.md +33 -0
- package/dist/agent-src/skills/code-intelligence/SKILL.md +57 -0
- package/dist/agent-src/skills/database/SKILL.md +8 -0
- package/dist/agent-src/skills/dependency-upgrade/SKILL.md +27 -0
- package/dist/agent-src/skills/design-review/SKILL.md +1 -1
- package/dist/agent-src/skills/doc-coauthoring/SKILL.md +1 -1
- package/dist/agent-src/skills/existing-ui-audit/SKILL.md +17 -1
- package/dist/agent-src/skills/feature-planning/SKILL.md +9 -2
- package/dist/agent-src/skills/frontend-render-security/SKILL.md +44 -0
- package/dist/agent-src/skills/git-workflow/SKILL.md +1 -1
- package/dist/agent-src/skills/js-library-packaging/scripts/check_package_surface.ts +38 -4
- package/dist/agent-src/skills/judge-artifact-completeness/rubrics/ticket-quality-score.json +2 -2
- package/dist/agent-src/skills/laravel/SKILL.md +35 -0
- package/dist/agent-src/skills/laravel-migration/SKILL.md +57 -3
- package/dist/agent-src/skills/monorepo-workspace/SKILL.md +26 -0
- package/dist/agent-src/skills/playbook-authoring/SKILL.md +28 -1
- package/dist/agent-src/skills/react-shadcn-ui/SKILL.md +1 -1
- package/dist/agent-src/skills/skill-writing/references/procedure.md +5 -5
- package/dist/agent-src/skills/sql-writing/SKILL.md +7 -1
- package/dist/agent-src/skills/standards-from-config/SKILL.md +27 -4
- package/dist/agent-src/skills/supply-chain-intake/SKILL.md +11 -4
- package/dist/agent-src/skills/symfony-workflow/SKILL.md +35 -0
- package/dist/agent-src/skills/test-case-discovery/SKILL.md +85 -0
- package/dist/agent-src/skills/test-driven-development/SKILL.md +33 -9
- package/dist/agent-src/skills/testing-anti-patterns/SKILL.md +1 -1
- package/dist/agent-src/skills/testing-anti-patterns/process-anti-patterns.md +37 -0
- package/dist/agent-src/skills/ui-component-architect/SKILL.md +45 -2
- package/dist/agent-src/skills/upstream-contribute/SKILL.md +38 -1
- package/dist/agent-src/skills/verify-repair-loop/SKILL.md +9 -4
- package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
- package/dist/agent-src/templates/roadmaps.md +97 -3
- package/dist/agent-src/templates/scripts/check_memory.ts +258 -17
- package/dist/agent-src/templates/scripts/check_memory_proposal.ts +9 -3
- package/dist/agent-src/templates/scripts/memory_lookup.ts +86 -0
- package/dist/agent-src/templates/scripts/memory_signal.ts +44 -0
- package/dist/agent-src/templates/scripts/work_engine/directives/backend/implement.ts +90 -0
- package/dist/agent-src/templates/scripts/work_engine/directives/backend/index.ts +11 -0
- package/dist/agent-src/templates/scripts/work_engine/directives/backend/test.ts +23 -1
- package/dist/agent-src/templates/scripts/work_engine/directives/backend/verify.ts +10 -1
- package/dist/agent-src/templates/scripts/work_engine/directives/mixed/stitch.ts +5 -1
- package/dist/agent-src/templates/scripts/work_engine/stack/runner.ts +102 -14
- package/dist/cli/commands/uiAudit.js +124 -5
- package/dist/cli/registry.js +2 -0
- package/dist/cli-delegate/{chunk-HYWSRNUX.js → chunk-2DK2VJWG.js} +3 -3
- package/dist/cli-delegate/{chunk-JCW7ZLHK.js → chunk-4FS4WRXP.js} +5 -0
- package/dist/cli-delegate/{chunk-OMIVVCG2.js → chunk-A4QJ6ENT.js} +24 -0
- package/dist/cli-delegate/{chunk-JJA2QEWA.js → chunk-AKJGUQNO.js} +466 -285
- package/dist/cli-delegate/{chunk-E46KPN6K.js → chunk-BTWUYDGN.js} +424 -363
- package/dist/cli-delegate/{chunk-K4FFODTS.js → chunk-ILMUPLGW.js} +1227 -316
- package/dist/cli-delegate/{chunk-FF7WAFMR.js → chunk-KPBWFOPZ.js} +5 -1
- package/dist/cli-delegate/cmd_adr_effective.js +102 -0
- package/dist/cli-delegate/cmd_conformance.js +80 -11
- package/dist/cli-delegate/cmd_doctor.js +3 -3
- package/dist/cli-delegate/cmd_export.js +3 -2
- package/dist/cli-delegate/cmd_fleet.js +2 -2
- package/dist/cli-delegate/cmd_handoff.js +1 -1
- package/dist/cli-delegate/cmd_preflight.js +2 -2
- package/dist/cli-delegate/cmd_prune.js +3 -2
- package/dist/cli-delegate/cmd_settings_get.js +1 -1
- package/dist/cli-delegate/cmd_settings_migrate.js +3 -2
- package/dist/cli-delegate/cmd_settings_set.js +2 -2
- package/dist/cli-delegate/cmd_sync.js +3 -2
- package/dist/cli-delegate/cmd_uninstall.js +3 -2
- package/dist/cli-delegate/cmd_validate.js +3 -2
- package/dist/discovery/deprecation-report.md +1 -1
- package/dist/discovery/discovery-manifest.json +58 -58
- package/dist/discovery/discovery-manifest.json.sha256 +1 -1
- package/dist/discovery/discovery-manifest.summary.md +1 -1
- package/dist/discovery/dormancy-report.md +1 -1
- package/dist/discovery/orphan-report.md +1 -1
- package/dist/discovery/packs.json +2 -2
- package/dist/discovery/trust-report.md +1 -1
- package/dist/discovery/workspaces.json +2 -2
- package/dist/hooks/dispatch.js +2900 -1049
- package/dist/install/claudeRuleRewrite.js +254 -0
- package/dist/install/detect.js +29 -16
- package/dist/install/detect_php_shape.js +159 -0
- package/dist/install/install.mjs +634 -428
- package/dist/mcp/awesome-mcp-servers.row.md +1 -1
- package/dist/mcp/mcp-cloudflare-catalogue.json +1 -1
- package/dist/mcp/registry-manifest.json +3 -3
- package/dist/mcp/server.json +3 -3
- package/dist/mcp/server.mjs +4895 -2627
- package/dist/server/schemas/settings.js +3 -0
- package/dist/ui/assets/index-D0jaCRPM.js +29 -0
- package/dist/ui/index.html +1 -1
- package/docs/MIGRATION.md +1 -1
- package/docs/THIRD-PARTY-NOTICES.md +25 -0
- package/docs/contracts/provider-lifecycle.md +1 -1
- package/docs/contracts/settings-classes.md +10 -4
- package/docs/guidelines/agent-infra/5w2h-analysis.md +3 -3
- package/docs/guidelines/agent-infra/agent-interaction-and-decision-quality.md +1 -0
- package/docs/guidelines/agent-infra/artifact-drafting-protocol-mechanics.md +58 -3
- package/docs/guidelines/agent-infra/ask-when-uncertain-demos.md +2 -2
- package/docs/guidelines/agent-infra/asking-and-brevity-examples.md +3 -3
- package/docs/guidelines/agent-infra/break-glass-usage.md +7 -7
- package/docs/guidelines/agent-infra/carve-out-predicates.md +3 -3
- package/docs/guidelines/agent-infra/comparison-matrix.md +1 -1
- package/docs/guidelines/agent-infra/critical-thinking.md +4 -4
- package/docs/guidelines/agent-infra/direct-answers-demos.md +2 -2
- package/docs/guidelines/agent-infra/domain-eval-anti-pattern.md +1 -1
- package/docs/guidelines/agent-infra/engineering-memory-data-format.md +3 -3
- package/docs/guidelines/agent-infra/existence-question-verdicts.md +80 -0
- package/docs/guidelines/agent-infra/first-principles.md +2 -2
- package/docs/guidelines/agent-infra/framework-neutrality-patterns.md +2 -2
- package/docs/guidelines/agent-infra/guarded-baseline.md +39 -0
- package/docs/guidelines/agent-infra/inversion-thinking.md +5 -5
- package/docs/guidelines/agent-infra/language-and-tone-examples.md +1 -1
- package/docs/guidelines/agent-infra/layered-settings.md +10 -10
- package/docs/guidelines/agent-infra/memory-access.md +1 -1
- package/docs/guidelines/agent-infra/mental-models.md +3 -3
- package/docs/guidelines/agent-infra/reuse-verdict-mechanics.md +71 -0
- package/docs/guidelines/agent-infra/review-routing-data-format.md +7 -7
- package/docs/guidelines/agent-infra/roadmap-progress-mechanics.md +13 -7
- package/docs/guidelines/agent-infra/role-contracts.md +2 -2
- package/docs/guidelines/agent-infra/role-mode-router.md +3 -3
- package/docs/guidelines/agent-infra/rule-type-governance.md +2 -2
- package/docs/guidelines/agent-infra/scqa-framework.md +5 -5
- package/docs/guidelines/agent-infra/self-improvement-pipeline.md +6 -6
- package/docs/guidelines/agent-infra/simplicity-and-goal-demos.md +2 -2
- package/docs/guidelines/agent-infra/six-hats.md +3 -3
- package/docs/guidelines/agent-infra/skill-quality-checklist.md +6 -6
- package/docs/guidelines/agent-infra/source-confidentiality-mechanics.md +109 -0
- package/docs/guidelines/agent-infra/systems-thinking.md +1 -1
- package/docs/guidelines/agent-infra/verify-before-complete-demos.md +2 -2
- package/docs/guidelines/augment-portability-patterns.md +6 -4
- package/docs/guidelines/code-clarity.md +18 -0
- package/docs/guidelines/component-oriented-and-oop-development.md +3 -2
- package/docs/guidelines/cross-role-handoff.md +2 -2
- package/docs/guidelines/design-fidelity-mechanics.md +1 -1
- package/docs/guidelines/docs/readme-size-and-splitting.md +3 -3
- package/docs/guidelines/php/database.md +90 -7
- package/docs/guidelines/prompt-templates.md +7 -7
- package/llms.txt +2 -2
- package/package.json +5 -2
- package/src/agent-src/scripts/archive_completed_roadmaps.ts +252 -8
- package/src/agent-src/scripts/guarded_baseline.ts +343 -0
- package/src/agent-src/scripts/roadmap_set_step.ts +253 -0
- package/src/agent-src/scripts/stub_queue.ts +82 -0
- package/src/agent-src/scripts/stubs_due.ts +516 -0
- package/src/agent-src/scripts/ticket_bundles.ts +84 -0
- package/src/agent-src/scripts/update_roadmap_progress.ts +16 -12
- package/src/agent-src/templates/scripts/check_memory.ts +258 -17
- package/src/agent-src/templates/scripts/check_memory_proposal.ts +9 -3
- package/src/agent-src/templates/scripts/memory_lookup.ts +86 -0
- package/src/agent-src/templates/scripts/memory_signal.ts +44 -0
- package/src/agent-src/templates/scripts/work_engine/directives/backend/implement.ts +90 -0
- package/src/agent-src/templates/scripts/work_engine/directives/backend/index.ts +11 -0
- package/src/agent-src/templates/scripts/work_engine/directives/backend/test.ts +23 -1
- package/src/agent-src/templates/scripts/work_engine/directives/backend/verify.ts +10 -1
- package/src/agent-src/templates/scripts/work_engine/directives/mixed/stitch.ts +5 -1
- package/src/agent-src/templates/scripts/work_engine/stack/runner.ts +102 -14
- package/src/config/agent-settings.template.yml +32 -3
- package/src/config/assurance-capability-registry.json +21 -9
- package/src/config/canonical-terms.yml +119 -0
- package/src/config/capability-native-outcome-bars.json +81 -0
- package/src/config/ci-local-parity.yml +80 -0
- package/src/config/drafting-channels.yml +43 -0
- package/src/config/estate-count-budget.json +57 -36
- package/src/config/evaluator-budgets.json +14 -14
- package/src/config/gate-coverage.yml +729 -63
- package/src/config/gate-reachability-exemptions.json +21 -0
- package/src/config/gate-violation-baselines.json +42 -19
- package/src/config/harness-evolution-budget.json +25 -0
- package/src/config/lapsed-beta-baseline.json +96 -0
- package/src/config/memory-twin-verdicts.yml +129 -0
- package/src/config/metric-registry.yml +124 -0
- package/src/config/pack-size-budget.json +16 -15
- package/src/config/preamble-payload-budget.json +12 -4
- package/src/config/profiles/balanced.ini +27 -0
- package/src/config/profiles/full.ini +27 -0
- package/src/config/profiles/minimal.ini +27 -0
- package/src/config/publish-surface.json +9 -2
- package/src/config/routing-coverage-seed.json +16 -2
- package/src/config/rule-stub-ceilings.json +133 -112
- package/src/config/turnaround-budget.json +66 -0
- package/src/install/claudeRuleRewrite.ts +288 -0
- package/src/install/detect.ts +60 -17
- package/src/install/detect_php_shape.ts +191 -0
- package/src/scripts/_cli/cmd_doctor.ts +27 -112
- package/src/scripts/_dispatch.bash +23 -0
- package/src/scripts/_lib/activation_ladder.ts +255 -0
- package/src/scripts/_lib/activation_receipt_producer.ts +341 -0
- package/src/scripts/_lib/activation_states.ts +88 -0
- package/src/scripts/_lib/adherence_detectors.ts +143 -0
- package/src/scripts/_lib/adr_frontmatter.ts +26 -0
- package/src/scripts/_lib/arith_claims.ts +181 -0
- package/src/scripts/_lib/arm_ranking.ts +62 -0
- package/src/scripts/_lib/asset_delivery_ledger.ts +303 -0
- package/src/scripts/_lib/audit_field_provenance.ts +54 -0
- package/src/scripts/_lib/auto_dispatch.ts +32 -3
- package/src/scripts/_lib/bench_ab_size_claim.ts +98 -4
- package/src/scripts/_lib/benchmark_cache_fields.ts +158 -0
- package/src/scripts/_lib/candidate_pair_delta.ts +349 -0
- package/src/scripts/_lib/candidate_proposer.ts +402 -0
- package/src/scripts/_lib/candidate_record.ts +601 -0
- package/src/scripts/_lib/capture_rate.ts +319 -0
- package/src/scripts/_lib/carrier_status.ts +118 -0
- package/src/scripts/_lib/cascade_stage_enumeration.ts +92 -0
- package/src/scripts/_lib/collector_denominator.ts +771 -0
- package/src/scripts/_lib/collector_record.ts +340 -0
- package/src/scripts/_lib/collector_store.ts +664 -0
- package/src/scripts/_lib/collector_supervision.ts +827 -0
- package/src/scripts/_lib/concern_estate.ts +77 -0
- package/src/scripts/_lib/config_chain.ts +477 -0
- package/src/scripts/_lib/config_cost.ts +209 -0
- package/src/scripts/_lib/corpus_manifest.ts +726 -0
- package/src/scripts/_lib/council_settings_block.ts +6 -0
- package/src/scripts/_lib/curator_ops.ts +172 -0
- package/src/scripts/_lib/delivery_arm_experiment.ts +282 -0
- package/src/scripts/_lib/delivery_criticality.ts +126 -0
- package/src/scripts/_lib/doctor_runtime_checks.ts +70 -0
- package/src/scripts/_lib/empty_cycles.ts +88 -0
- package/src/scripts/_lib/estate_carrier_cases.ts +72 -0
- package/src/scripts/_lib/eval_publication.ts +354 -0
- package/src/scripts/_lib/evaluation_cascade.ts +452 -0
- package/src/scripts/_lib/evaluation_vector.ts +283 -0
- package/src/scripts/_lib/evaluator_promotion.ts +225 -0
- package/src/scripts/_lib/evidence_basis.ts +118 -0
- package/src/scripts/_lib/evolution_roi.ts +562 -0
- package/src/scripts/_lib/exec_evidence.ts +8 -0
- package/src/scripts/_lib/experience_card.ts +272 -0
- package/src/scripts/_lib/experience_report.ts +151 -0
- package/src/scripts/_lib/experiment_freeze.ts +112 -0
- package/src/scripts/_lib/generated_by.ts +66 -0
- package/src/scripts/_lib/harness_evolution_guards.ts +239 -0
- package/src/scripts/_lib/hook_effect_probe.ts +141 -0
- package/src/scripts/_lib/host_denominator.ts +687 -0
- package/src/scripts/_lib/host_projection_reach.ts +157 -0
- package/src/scripts/_lib/ignored_blocker.ts +148 -0
- package/src/scripts/_lib/install_reach_checks.ts +495 -0
- package/src/scripts/_lib/json_duplicate_keys.ts +150 -0
- package/src/scripts/_lib/judge_hygiene.ts +228 -0
- package/src/scripts/_lib/legacy_boundary_map.ts +228 -0
- package/src/scripts/_lib/lexical_shortlist.ts +215 -0
- package/src/scripts/_lib/llm_candidate_proposer.ts +461 -0
- package/src/scripts/_lib/llm_proposer_transport.ts +153 -0
- package/src/scripts/_lib/loop_guards.ts +299 -0
- package/src/scripts/_lib/loss_class.ts +129 -0
- package/src/scripts/_lib/machine_wake.ts +51 -0
- package/src/scripts/_lib/md_prose_lines.ts +177 -0
- package/src/scripts/_lib/minimality_tiebreak.ts +168 -0
- package/src/scripts/_lib/one_resolver_invariant.ts +449 -0
- package/src/scripts/_lib/orchestration_record.ts +253 -5
- package/src/scripts/_lib/outcome_envelope.ts +227 -0
- package/src/scripts/_lib/outcome_vocabularies.ts +125 -0
- package/src/scripts/_lib/paired_stats.ts +245 -0
- package/src/scripts/_lib/paired_verdict.ts +226 -0
- package/src/scripts/_lib/pathology_archive.ts +393 -0
- package/src/scripts/_lib/prefix_stable_surfaces.ts +123 -0
- package/src/scripts/_lib/privacy_class.ts +47 -0
- package/src/scripts/_lib/promotion_capability.ts +315 -0
- package/src/scripts/_lib/promotion_evidence.ts +414 -0
- package/src/scripts/_lib/promotion_review.ts +294 -0
- package/src/scripts/_lib/prompt_shape.ts +92 -0
- package/src/scripts/_lib/regression_neighbourhood.ts +259 -0
- package/src/scripts/_lib/release_highlights.ts +70 -1
- package/src/scripts/_lib/release_material.ts +125 -2
- package/src/scripts/_lib/repeated_failure.ts +105 -0
- package/src/scripts/_lib/repo_root.ts +111 -0
- package/src/scripts/_lib/review_skipped_record.ts +37 -0
- package/src/scripts/_lib/role_split.ts +338 -0
- package/src/scripts/_lib/routing_corpus.ts +307 -0
- package/src/scripts/_lib/routing_index_input.ts +104 -0
- package/src/scripts/_lib/rule_injection.ts +22 -1
- package/src/scripts/_lib/runtime_journal.ts +1499 -0
- package/src/scripts/_lib/runtime_wiring_checks.ts +430 -0
- package/src/scripts/_lib/semantic_noop.ts +167 -0
- package/src/scripts/_lib/skill_catalogue.ts +11 -1
- package/src/scripts/_lib/source_digest.ts +200 -0
- package/src/scripts/_lib/source_redact.ts +260 -0
- package/src/scripts/_lib/source_shape.ts +502 -0
- package/src/scripts/_lib/source_snapshot_dedup.ts +199 -0
- package/src/scripts/_lib/strip_comments.d.mts +8 -0
- package/src/scripts/_lib/strip_comments.mjs +65 -0
- package/src/scripts/_lib/test_red_state.ts +154 -0
- package/src/scripts/_lib/trigger_shift.ts +144 -0
- package/src/scripts/_lib/untrusted_content.ts +82 -7
- package/src/scripts/activation_receipt.ts +258 -0
- package/src/scripts/adoption_report.ts +1 -1
- package/src/scripts/adr/evidence_census.ts +1 -1
- package/src/scripts/adr/regenerate_index.ts +26 -2
- package/src/scripts/adr_cite_check.ts +164 -1
- package/src/scripts/ai_council/blind_review.ts +11 -1
- package/src/scripts/ai_council/clients.ts +4 -0
- package/src/scripts/ai_council/config.ts +3 -0
- package/src/scripts/ai_council/consensus.ts +28 -8
- package/src/scripts/ai_council/consensus_round.ts +226 -0
- package/src/scripts/ai_council/cross_exam.ts +128 -0
- package/src/scripts/ai_council/disagreement_signal.ts +338 -0
- package/src/scripts/ai_council/explain_route.ts +157 -0
- package/src/scripts/ai_council/information_gain.ts +293 -0
- package/src/scripts/ai_council/inline_findings.ts +340 -0
- package/src/scripts/ai_council/judge_position_bias.ts +197 -0
- package/src/scripts/ai_council/leakage_corpus.ts +385 -0
- package/src/scripts/ai_council/leakage_patterns.ts +453 -0
- package/src/scripts/ai_council/minority_retention.ts +171 -0
- package/src/scripts/ai_council/orchestrator.ts +16 -203
- package/src/scripts/ai_council/orchestrator_results.ts +23 -3
- package/src/scripts/ai_council/pricing.ts +106 -0
- package/src/scripts/ai_council/prompts.ts +74 -7
- package/src/scripts/ai_council/provider_leakage_bench.ts +327 -0
- package/src/scripts/ai_council/py_format.ts +14 -3
- package/src/scripts/ai_council/recouncil_guard.ts +293 -0
- package/src/scripts/ai_council/recouncil_savings.ts +299 -0
- package/src/scripts/ai_council/replay_route.ts +223 -0
- package/src/scripts/ai_council/response_record.ts +50 -0
- package/src/scripts/ai_council/reviewer_assignment.ts +279 -0
- package/src/scripts/ai_council/routing_training_row.ts +197 -0
- package/src/scripts/ai_council/synthesis_strategy.ts +159 -0
- package/src/scripts/ai_council/topology_bench_manifest.ts +860 -0
- package/src/scripts/ai_council/topology_vocabulary.ts +175 -0
- package/src/scripts/asset_delivery_ledger.ts +157 -0
- package/src/scripts/attest_artifact.ts +193 -0
- package/src/scripts/audit_auto_rules.ts +2 -1
- package/src/scripts/audit_command_surface.ts +1 -1
- package/src/scripts/audit_mcp_tools.ts +2 -2
- package/src/scripts/audit_skill_overlap_allowlist.json +6 -1
- package/src/scripts/audit_user_type_axis.ts +2 -1
- package/src/scripts/bench_ab_clone.ts +215 -10
- package/src/scripts/bench_ab_integrity.ts +119 -5
- package/src/scripts/bench_ab_v2_stats.ts +40 -213
- package/src/scripts/build_archive_index.ts +1 -1
- package/src/scripts/build_linear_digest.ts +1 -1
- package/src/scripts/build_proof.ts +11 -4
- package/src/scripts/build_rule_trigger_matrix.ts +1 -1
- package/src/scripts/build_source_digests.ts +157 -0
- package/src/scripts/cache_realization_report.ts +103 -0
- package/src/scripts/check_adr_frontmatter.ts +131 -10
- package/src/scripts/check_benchmark_report_fields.ts +207 -0
- package/src/scripts/check_beta_review_markers.ts +235 -6
- package/src/scripts/check_bundle_path_leakage.ts +34 -1
- package/src/scripts/check_claims.ts +576 -6
- package/src/scripts/check_composite_arming.ts +35 -0
- package/src/scripts/check_concern_admissions.ts +365 -0
- package/src/scripts/check_enforcement_coverage.ts +28 -0
- package/src/scripts/check_estate_count.ts +347 -25
- package/src/scripts/check_gate_reachability.ts +383 -0
- package/src/scripts/check_host_loadability.ts +104 -0
- package/src/scripts/check_loss_class_declared.ts +308 -0
- package/src/scripts/check_md_language.ts +15 -98
- package/src/scripts/check_memory_proposal.ts +18 -11
- package/src/scripts/check_no_currency_in_cost_surfaces.ts +225 -0
- package/src/scripts/check_no_external_sources.ts +281 -6
- package/src/scripts/check_pack_conformance_fixture.ts +11 -1
- package/src/scripts/check_pack_size.ts +59 -2
- package/src/scripts/check_preamble_payload_budget.ts +114 -3
- package/src/scripts/check_prefix_stable_mutation.ts +372 -0
- package/src/scripts/check_publish_surface.ts +10 -1
- package/src/scripts/check_references.ts +24 -1
- package/src/scripts/check_release_highlights.ts +96 -13
- package/src/scripts/check_roadmap_trackable.ts +17 -2
- package/src/scripts/check_rule_evidence_declaration.ts +316 -0
- package/src/scripts/check_rule_projection_integrity.ts +14 -4
- package/src/scripts/check_score_contract.ts +26 -3
- package/src/scripts/check_static_parity.ts +285 -0
- package/src/scripts/check_supervision_claim_atomicity.ts +498 -0
- package/src/scripts/check_suppression_hygiene.ts +15 -0
- package/src/scripts/ci_settle.ts +39 -2
- package/src/scripts/code_graph/build.ts +60 -3
- package/src/scripts/code_graph/extract.ts +44 -0
- package/src/scripts/code_graph/types.ts +24 -0
- package/src/scripts/collector_daemon.ts +714 -0
- package/src/scripts/config_cost_report.ts +302 -0
- package/src/scripts/consumer_matrix.ts +74 -1
- package/src/scripts/corpus_manifest.ts +235 -0
- package/src/scripts/cost/budget.mjs +10 -3
- package/src/scripts/cost/track.mjs +10 -3
- package/src/scripts/council_cli.ts +37 -54
- package/src/scripts/dispatch_r2_reviewer.ts +46 -5
- package/src/scripts/evolution_lab.ts +1153 -0
- package/src/scripts/external_sources_denylist.json +5 -18
- package/src/scripts/extract_audit_patterns.ts +21 -0
- package/src/scripts/fold_intake.ts +12 -1
- package/src/scripts/gen_discovery_baseline.ts +1 -1
- package/src/scripts/generate_capabilities_index.ts +12 -5
- package/src/scripts/generate_capability_matrix.ts +3 -3
- package/src/scripts/generate_command_flows.ts +2 -2
- package/src/scripts/generate_cookbook.ts +2 -2
- package/src/scripts/generate_index.ts +8 -1
- package/src/scripts/generate_knowledge_index.ts +2 -1
- package/src/scripts/generate_ownership_matrix.ts +2 -1
- package/src/scripts/generate_pack_manifests.ts +10 -2
- package/src/scripts/generate_role_experiences_catalog.ts +2 -2
- package/src/scripts/generate_settings_reference.ts +1 -1
- package/src/scripts/git_authorization_hook.ts +22 -1
- package/src/scripts/grade_target_readiness.ts +48 -5
- package/src/scripts/hook_effect_doctor.ts +261 -0
- package/src/scripts/hook_manifest.json +1 -1
- package/src/scripts/hook_manifest.yaml +125 -16
- package/src/scripts/hooks/block_speaking_inbox_dir.ts +271 -0
- package/src/scripts/hooks/block_unauthorized_git.ts +18 -0
- package/src/scripts/hooks/comment_discipline_hook.ts +146 -0
- package/src/scripts/hooks/concern_registry.ts +6 -0
- package/src/scripts/hooks/dispatch_hook.ts +32 -0
- package/src/scripts/hooks/journal_record_hook.ts +345 -0
- package/src/scripts/hooks/prepush_metadata_sources.sh +110 -0
- package/src/scripts/hooks/run_continuation_hook.ts +44 -9
- package/src/scripts/hooks/shims/install.sh +61 -0
- package/src/scripts/hooks/shims/php +101 -0
- package/src/scripts/hooks/suggestion_capture_hook.ts +10 -0
- package/src/scripts/hooks/turn_end_gate_hook.ts +9 -1
- package/src/scripts/hot_context_hook.ts +16 -0
- package/src/scripts/install-hooks.sh +20 -5
- package/src/scripts/install.ts +17 -35
- package/src/scripts/inventory_frontmatter.ts +2 -1
- package/src/scripts/language_mirror_hook.ts +14 -2
- package/src/scripts/lint_adr_sweep_routing.ts +12 -0
- package/src/scripts/lint_canonical_terms.ts +604 -0
- package/src/scripts/lint_carrier_integrity.ts +820 -0
- package/src/scripts/lint_code_comments.ts +643 -0
- package/src/scripts/lint_composition_review.ts +619 -0
- package/src/scripts/lint_consolidation_lineage.ts +666 -0
- package/src/scripts/lint_eval_specs.ts +593 -0
- package/src/scripts/lint_hook_manifest.ts +19 -0
- package/src/scripts/lint_host_portability.ts +373 -0
- package/src/scripts/lint_judge_prompt_expectation.ts +27 -1
- package/src/scripts/lint_memory_twin_parity.ts +335 -0
- package/src/scripts/lint_metric_consumers.ts +355 -0
- package/src/scripts/lint_plan_risk_register.ts +39 -19
- package/src/scripts/lint_promotion_paths.ts +779 -0
- package/src/scripts/lint_skill_descriptions.ts +18 -1
- package/src/scripts/lint_skill_frontmatter_safety.ts +58 -0
- package/src/scripts/lint_skill_link_reach.ts +252 -0
- package/src/scripts/lint_skill_trigger_corpus.ts +426 -23
- package/src/scripts/lint_ticket_buildable.ts +17 -1
- package/src/scripts/llm_propose.ts +256 -0
- package/src/scripts/mcp_server/consumer_tool_catalog.json +1 -1
- package/src/scripts/mcp_server/tool_catalog_source.ts +1 -1
- package/src/scripts/measure_delivery_sets.ts +361 -0
- package/src/scripts/measure_docs_dead_links.ts +348 -0
- package/src/scripts/measure_host_capture.ts +461 -0
- package/src/scripts/measure_routing_signal.ts +307 -0
- package/src/scripts/migration_status.ts +3 -3
- package/src/scripts/model_rule_injection.ts +76 -0
- package/src/scripts/orchestration_record.ts +14 -0
- package/src/scripts/preamble_byte_census.ts +139 -10
- package/src/scripts/prepack-check.mjs +4 -1
- package/src/scripts/probe_council_retention.ts +495 -0
- package/src/scripts/probe_turnaround.ts +384 -0
- package/src/scripts/probe_unblocked_ask.ts +279 -0
- package/src/scripts/release.ts +21 -37
- package/src/scripts/release_drill.ts +143 -0
- package/src/scripts/release_env.ts +35 -0
- package/src/scripts/release_publication.ts +84 -0
- package/src/scripts/render_benchmark_md.ts +1 -1
- package/src/scripts/rule_activation_census.ts +70 -9
- package/src/scripts/rule_backlinks.ts +1 -1
- package/src/scripts/run_lifecycle_suite.ts +208 -0
- package/src/scripts/run_skill_evals.ts +40 -0
- package/src/scripts/schemas/delivery-manifest.schema.json +43 -0
- package/src/scripts/schemas/drafting-channels.schema.json +43 -0
- package/src/scripts/schemas/evals.schema.json +24 -1
- package/src/scripts/schemas/rule.schema.json +52 -1
- package/src/scripts/schemas/skill.schema.json +17 -2
- package/src/scripts/skill_overlap.ts +7 -1
- package/src/scripts/skill_tools/run_block_d_eval.ts +8 -1
- package/src/scripts/skill_tools/score_skill_relevance.ts +84 -3
- package/src/scripts/skill_tools/suggest_skill_for_task.ts +8 -1
- package/src/scripts/skill_usage_report.ts +2 -1
- package/src/scripts/stubs_due.ts +211 -0
- package/src/scripts/sweep_source_surfaces.ts +678 -0
- package/src/scripts/sync_pr_branch.ts +3 -3
- package/src/scripts/trigger_eval_grandfather.json +202 -222
- package/src/scripts/utilization_report.ts +22 -2
- package/src/server/schemas/settings.ts +5 -0
- package/src/templates/marketing-copy.yml +1 -1
- package/dist/ui/assets/index-Cxgy63kz.js +0 -26
|
@@ -260,6 +260,9 @@ export const settingsSchema = z.object({
|
|
|
260
260
|
injection_scan: z.object({
|
|
261
261
|
enabled: z.boolean().default(false).describe('PostToolUse prompt-injection scanner (road-to-security-pillar.md P3.2). Default off. When on, scans tool output (file reads, web fetches, MCP responses) for injection signatures and WARNS in context (never blocks). Runtime backstop on top of the always-on untrusted-input-defense rule; detection is probabilistic.'),
|
|
262
262
|
}).default({}),
|
|
263
|
+
runtime_journal: z.object({
|
|
264
|
+
enabled: z.boolean().default(false).describe('Runtime event journal (road-to-runtime-event-journal Phase 1). Default off. When on, one durable, episode-keyed record per dispatched hook event is appended to <git-common-dir>/agent-journal/journal.sqlite — a Class-A write that opens, writes and exits. It emits nothing to the model, never warns and never blocks: a locked database, a missing node:sqlite, a malformed envelope or a full disk all degrade to silence. Off rather than on because it CREATES a storage surface (a SQLite database under your .git/) rather than appending to a directory that already exists. The record type has no field able to hold free-form content — ids, an event name, a bounded capability identifier, repo-relative locators and two 12-hex digests; no prompt, no file body, no absolute path. Retention: a 30-day TTL anchored on episode close, plus explicit, time-bounded, human-only holds that themselves expire.'),
|
|
265
|
+
}).default({}),
|
|
263
266
|
rtk_wrap: z.object({
|
|
264
267
|
enabled: z.boolean().default(false).describe('PreToolUse RTK-wrap nudge (token-saving Phase 3). Default off. When on AND the binary on PATH is verified as Rust Token Killer (a live two-stage identity probe — not a self-reported flag, and never a colliding same-name binary), warns (never blocks) "re-run wrapped with rtk" before a single verbose CLI command (git/npm/cargo/docker/…) — upstream reports 60–90% output-token savings (their estimate). Skips completeness-critical / piped / compound commands and git diff. No-op when rtk is absent, unverified, or a different tool.'),
|
|
265
268
|
}).default({}),
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))i(a);new MutationObserver(a=>{for(const l of a)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(a){const l={};return a.integrity&&(l.integrity=a.integrity),a.referrerPolicy&&(l.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?l.credentials="include":a.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(a){if(a.ep)return;a.ep=!0;const l=t(a);fetch(a.href,l)}})();var gt,A,Yr,qr,le,nr,Vr,Gr,Mt,Ln,tn,Qr,Ai,Vt,Gt,Wn={},zn=[],ml=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,_t=Array.isArray;function J(e,n){for(var t in n)e[t]=n[t];return e}function Ei(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function yl(e,n,t){var i,a,l,o={};for(l in n)l=="key"?i=n[l]:l=="ref"?a=n[l]:o[l]=n[l];if(arguments.length>2&&(o.children=arguments.length>3?gt.call(arguments,2):t),typeof e=="function"&&e.defaultProps!=null)for(l in e.defaultProps)o[l]===void 0&&(o[l]=e.defaultProps[l]);return $n(e,o,i,a,null)}function $n(e,n,t,i,a){var l={type:e,props:n,key:t,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:a??++Yr,__i:-1,__u:0};return a==null&&A.vnode!=null&&A.vnode(l),l}function F(e){return e.children}function rn(e,n){this.props=e,this.context=n}function ye(e,n){if(n==null)return e.__?ye(e.__,e.__i+1):null;for(var t;n<e.__k.length;n++)if((t=e.__k[n])!=null&&t.__e!=null)return t.__e;return typeof e.type=="function"?ye(e):null}function bl(e){if(e.__P&&e.__d){var n=e.__v,t=n.__e,i=[],a=[],l=J({},n);l.__v=n.__v+1,A.vnode&&A.vnode(l),Ni(e.__P,l,n,e.__n,e.__P.namespaceURI,32&n.__u?[t]:null,i,t??ye(n),!!(32&n.__u),a),l.__v=n.__v,l.__.__k[l.__i]=l,na(i,l,a),n.__e=n.__=null,l.__e!=t&&Jr(l)}}function Jr(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(n){if(n!=null&&n.__e!=null)return e.__e=e.__c.base=n.__e}),Jr(e)}function tr(e){(!e.__d&&(e.__d=!0)&&le.push(e)&&!Kn.__r++||nr!=A.debounceRendering)&&((nr=A.debounceRendering)||Vr)(Kn)}function Kn(){try{for(var e,n=1;le.length;)le.length>n&&le.sort(Gr),e=le.shift(),n=le.length,bl(e)}finally{le.length=Kn.__r=0}}function Xr(e,n,t,i,a,l,o,s,u,c,d){var g,f,p,v,_,k,w=i&&i.__k||zn,b=n.length;for(u=kl(t,n,w,u,b),g=0;g<b;g++)(p=t.__k[g])!=null&&(f=p.__i!=-1&&w[p.__i]||Wn,p.__i=g,k=Ni(e,p,f,a,l,o,s,u,c,d),v=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&xi(f.ref,null,p),d.push(p.ref,p.__c||v,p)),_==null&&v!=null&&(_=v),4&p.__u?(u=Zr(p,u,e),f.__e&&(f.__e=null)):typeof p.type=="function"&&k!==void 0?u=k:v&&(u=v.nextSibling),p.__u&=-7);return t.__e=_,u}function kl(e,n,t,i,a){var l,o,s,u,c,d=t.length,g=d,f=0;for(e.__k=new Array(a),l=0;l<a;l++)(o=n[l])!=null&&typeof o!="boolean"&&typeof o!="function"?(typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?o=e.__k[l]=$n(null,o,null,null,null):_t(o)?o=e.__k[l]=$n(F,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=e.__k[l]=$n(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[l]=o,u=l+f,o.__=e,o.__b=e.__b+1,s=null,(c=o.__i=wl(o,t,u,g))!=-1&&(g--,(s=t[c])&&(s.__u|=2)),s==null||s.__v==null?(c==-1&&(a>d?f--:a<d&&f++),typeof o.type!="function"&&(o.__u|=4)):c!=u&&(c==u-1?f--:c==u+1?f++:(c>u?f--:f++,o.__u|=4))):e.__k[l]=null;if(g)for(l=0;l<d;l++)(s=t[l])!=null&&!(2&s.__u)&&(s.__e==i&&(i=ye(s)),ia(s,s));return i}function Zr(e,n,t){var i,a;if(typeof e.type=="function"){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,n=Zr(i[a],n,t));return n}e.__e!=n&&(n&&e.type&&!n.parentNode&&(n=ye(e)),n=t.insertBefore(e.__e,n||null));do n=n&&n.nextSibling;while(n!=null&&n.nodeType==8);return n}function wl(e,n,t,i){var a,l,o,s=e.key,u=e.type,c=n[t],d=c!=null&&(2&c.__u)==0;if(c===null&&s==null||d&&s==c.key&&u==c.type)return t;if(i>(d?1:0)){for(a=t-1,l=t+1;a>=0||l<n.length;)if((c=n[o=a>=0?a--:l++])!=null&&!(2&c.__u)&&s==c.key&&u==c.type)return o}return-1}function ir(e,n,t){n[0]=="-"?e.setProperty(n,t??""):e[n]=t==null?"":typeof t!="number"||ml.test(n)?t:t+"px"}function Nn(e,n,t,i,a){var l,o;e:if(n=="style")if(typeof t=="string")e.style.cssText=t;else{if(typeof i=="string"&&(e.style.cssText=i=""),i)for(n in i)t&&n in t||ir(e.style,n,"");if(t)for(n in t)i&&t[n]==i[n]||ir(e.style,n,t[n])}else if(n[0]=="o"&&n[1]=="n")l=n!=(n=n.replace(Qr,"$1")),o=n.toLowerCase(),n=o in e||n=="onFocusOut"||n=="onFocusIn"?o.slice(2):n.slice(2),e.l||(e.l={}),e.l[n+l]=t,t?i?t[tn]=i[tn]:(t[tn]=Ai,e.addEventListener(n,l?Gt:Vt,l)):e.removeEventListener(n,l?Gt:Vt,l);else{if(a=="http://www.w3.org/2000/svg")n=n.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(n!="width"&&n!="height"&&n!="href"&&n!="list"&&n!="form"&&n!="tabIndex"&&n!="download"&&n!="rowSpan"&&n!="colSpan"&&n!="role"&&n!="popover"&&n in e)try{e[n]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&n[4]!="-"?e.removeAttribute(n):e.setAttribute(n,n=="popover"&&t==1?"":t))}}function rr(e){return function(n){if(this.l){var t=this.l[n.type+e];if(n[Ln]==null)n[Ln]=Ai++;else if(n[Ln]<t[tn])return;return t(A.event?A.event(n):n)}}}function Ni(e,n,t,i,a,l,o,s,u,c){var d,g,f,p,v,_,k,w,b,z,Ze,ce,en,er,En,Ft,q=n.type;if(n.constructor!==void 0)return null;128&t.__u&&(u=!!(32&t.__u),l=[s=n.__e=t.__e]),(d=A.__b)&&d(n);e:if(typeof q=="function"){g=o.length;try{if(b=n.props,z=q.prototype&&q.prototype.render,Ze=(d=q.contextType)&&i[d.__c],ce=d?Ze?Ze.props.value:d.__:i,t.__c?w=(f=n.__c=t.__c).__=f.__E:(z?n.__c=f=new q(b,ce):(n.__c=f=new rn(b,ce),f.constructor=q,f.render=Tl),Ze&&Ze.sub(f),f.state||(f.state={}),f.__n=i,p=f.__d=!0,f.__h=[],f._sb=[]),z&&f.__s==null&&(f.__s=f.state),z&&q.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=J({},f.__s)),J(f.__s,q.getDerivedStateFromProps(b,f.__s))),v=f.props,_=f.state,f.__v=n,p)z&&q.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),z&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(z&&q.getDerivedStateFromProps==null&&b!==v&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(b,ce),n.__v==t.__v||!f.__e&&f.shouldComponentUpdate!=null&&f.shouldComponentUpdate(b,f.__s,ce)===!1){n.__v!=t.__v&&(f.props=b,f.state=f.__s,f.__d=!1),n.__e=t.__e,n.__k=t.__k,n.__k.some(function(Ie){Ie&&(Ie.__=n)}),zn.push.apply(f.__h,f._sb),f._sb=[],f.__h.length&&o.push(f),s=ye(t);break e}f.componentWillUpdate!=null&&f.componentWillUpdate(b,f.__s,ce),z&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(v,_,k)})}if(f.context=ce,f.props=b,f.__P=e,f.__e=!1,en=A.__r,er=0,z)f.state=f.__s,f.__d=!1,en&&en(n),d=f.render(f.props,f.state,f.context),zn.push.apply(f.__h,f._sb),f._sb=[];else do f.__d=!1,en&&en(n),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(f.__d&&++er<25);f.state=f.__s,f.getChildContext!=null&&(i=J(J({},i),f.getChildContext())),z&&!p&&f.getSnapshotBeforeUpdate!=null&&(k=f.getSnapshotBeforeUpdate(v,_)),En=d!=null&&d.type===F&&d.key==null?ta(d.props.children):d,s=Xr(e,_t(En)?En:[En],n,t,i,a,l,o,s,u,c),f.base=n.__e,n.__u&=-161,f.__h.length&&o.push(f),w&&(f.__E=f.__=null)}catch(Ie){if(o.length=g,n.__v=null,u||l!=null){if(Ie.then){for(n.__u|=u?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;l!=null&&(l[l.indexOf(s)]=null),n.__e=s}else if(l!=null)for(Ft=l.length;Ft--;)Ei(l[Ft])}else n.__e=t.__e;n.__k==null&&(n.__k=t.__k||[]),Ie.then||ea(n),A.__e(Ie,n,t)}}else l==null&&n.__v==t.__v?(n.__k=t.__k,n.__e=t.__e):s=n.__e=Sl(t.__e,n,t,i,a,l,o,u,c);return(d=A.diffed)&&d(n),128&n.__u?void 0:s}function ea(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(ea))}function na(e,n,t){for(var i=0;i<t.length;i++)xi(t[i],t[++i],t[++i]);A.__c&&A.__c(n,e),e.some(function(a){try{e=a.__h,a.__h=[],e.some(function(l){l.call(a)})}catch(l){A.__e(l,a.__v)}})}function ta(e){return typeof e!="object"||e==null||e.__b>0?e:_t(e)?e.map(ta):e.constructor!==void 0?null:J({},e)}function Sl(e,n,t,i,a,l,o,s,u){var c,d,g,f,p,v,_,k=t.props||Wn,w=n.props,b=n.type;if(b=="svg"?a="http://www.w3.org/2000/svg":b=="math"?a="http://www.w3.org/1998/Math/MathML":a||(a="http://www.w3.org/1999/xhtml"),l!=null){for(c=0;c<l.length;c++)if((p=l[c])&&"setAttribute"in p==!!b&&(b?p.localName==b:p.nodeType==3)){e=p,l[c]=null;break}}if(e==null){if(b==null)return document.createTextNode(w);e=document.createElementNS(a,b,w.is&&w),s&&(A.__m&&A.__m(n,l),s=!1),l=null}if(b==null)k===w||s&&e.data==w||(e.data=w);else{if(l=b=="textarea"&&w.defaultValue!=null?null:l&>.call(e.childNodes),!s&&l!=null)for(k={},c=0;c<e.attributes.length;c++)k[(p=e.attributes[c]).name]=p.value;for(c in k)p=k[c],c=="dangerouslySetInnerHTML"?g=p:c=="children"||c in w||c=="value"&&"defaultValue"in w||c=="checked"&&"defaultChecked"in w||Nn(e,c,null,p,a);for(c in w)p=w[c],c=="children"?f=p:c=="dangerouslySetInnerHTML"?d=p:c=="value"?v=p:c=="checked"?_=p:s&&typeof p!="function"||k[c]===p||Nn(e,c,p,k[c],a);if(d)s||g&&(d.__html==g.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),n.__k=[];else if(g&&(e.innerHTML=""),Xr(n.type=="template"?e.content:e,_t(f)?f:[f],n,t,i,b=="foreignObject"?"http://www.w3.org/1999/xhtml":a,l,o,l?l[0]:t.__k&&ye(t,0),s,u),l!=null)for(c=l.length;c--;)Ei(l[c]);s&&b!="textarea"||(c="value",b=="progress"&&v==null?e.removeAttribute("value"):v!=null&&(v!==e[c]||b=="progress"&&!v||b=="option"&&v!=k[c])&&Nn(e,c,v,k[c],a),c="checked",_!=null&&_!=e[c]&&Nn(e,c,_,k[c],a))}return e}function xi(e,n,t){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(a){A.__e(a,t)}}function ia(e,n,t){var i,a;if(A.unmount&&A.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||xi(i,null,n)),(i=e.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(l){A.__e(l,n)}i.base=i.__P=i.__n=null}if(i=e.__k)for(a=0;a<i.length;a++)i[a]&&ia(i[a],n,t||typeof e.type!="function");t||Ei(e.__e),e.__c=e.__=e.__e=void 0}function Tl(e,n,t){return this.constructor(e,t)}function Cl(e,n,t){var i,a,l,o;n==document&&(n=document.documentElement),A.__&&A.__(e,n),a=(i=!1)?null:n.__k,l=[],o=[],Ni(n,e=n.__k=yl(F,null,[e]),a||Wn,Wn,n.namespaceURI,a?null:n.firstChild?gt.call(n.childNodes):null,l,a?a.__e:n.firstChild,i,o),na(l,e,o),e.props.children=null}gt=zn.slice,A={__e:function(e,n,t,i){for(var a,l,o;n=n.__;)if((a=n.__c)&&!a.__)try{if((l=a.constructor)&&l.getDerivedStateFromError!=null&&(a.setState(l.getDerivedStateFromError(e)),o=a.__d),a.componentDidCatch!=null&&(a.componentDidCatch(e,i||{}),o=a.__d),o)return a.__E=a}catch(s){e=s}throw e}},Yr=0,qr=function(e){return e!=null&&e.constructor===void 0},rn.prototype.setState=function(e,n){var t;t=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=J({},this.state),typeof e=="function"&&(e=e(J({},t),this.props)),e&&J(t,e),e!=null&&this.__v&&(n&&this._sb.push(n),tr(this))},rn.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),tr(this))},rn.prototype.render=F,le=[],Vr=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Gr=function(e,n){return e.__v.__b-n.__v.__b},Kn.__r=0,Mt=Math.random().toString(8),Ln="__d"+Mt,tn="__a"+Mt,Qr=/(PointerCapture)$|Capture$/i,Ai=0,Vt=rr(!1),Gt=rr(!0);var Al=0;function r(e,n,t,i,a,l){n||(n={});var o,s,u=n;if("ref"in u)for(s in u={},n)s=="ref"?o=n[s]:u[s]=n[s];var c={type:e,props:u,key:t,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Al,__i:-1,__u:0,__source:a,__self:l};if(typeof e=="function"&&(o=e.defaultProps))for(s in o)u[s]===void 0&&(u[s]=o[s]);return A.vnode&&A.vnode(c),c}var fn,x,Dt,ar,Qt=0,ra=[],O=A,lr=O.__b,or=O.__r,sr=O.diffed,cr=O.__c,ur=O.unmount,dr=O.__;function Ii(e,n){O.__h&&O.__h(x,e,Qt||n),Qt=0;var t=x.__H||(x.__H={__:[],__h:[]});return e>=t.__.length&&t.__.push({}),t.__[e]}function Oi(e){return Qt=1,El(oa,e)}function El(e,n,t){var i=Ii(fn++,2);if(i.t=e,!i.__c&&(i.__=[oa(void 0,n),function(s){var u=i.__N?i.__N[0]:i.__[0],c=i.t(u,s);u!==c&&(i.__N=[c,i.__[1]],i.__c.setState({}))}],i.__c=x,!x.__f)){var a=function(s,u,c){if(!i.__c.__H)return!0;var d=!1,g=i.__c.props!==s;if(i.__c.__H.__.some(function(p){if(p.__N){d=!0;var v=p.__[0];p.__=p.__N,p.__N=void 0,v!==p.__[0]&&(g=!0)}}),l){var f=l.call(this,s,u,c);return d?f||g:f}return!d||g};x.__f=!0;var l=x.shouldComponentUpdate,o=x.componentWillUpdate;x.componentWillUpdate=function(s,u,c){if(this.__e){var d=l;l=void 0,a(s,u,c),l=d}o&&o.call(this,s,u,c)},x.shouldComponentUpdate=a}return i.__N||i.__}function re(e,n){var t=Ii(fn++,3);!O.__s&&la(t.__H,n)&&(t.__=e,t.u=n,x.__H.__h.push(t))}function aa(e,n){var t=Ii(fn++,7);return la(t.__H,n)&&(t.__=e(),t.__H=n,t.__h=e),t.__}function Nl(){for(var e;e=ra.shift();){var n=e.__H;if(e.__P&&n)try{n.__h.some(Pn),n.__h.some(Jt),n.__h=[]}catch(t){n.__h=[],O.__e(t,e.__v)}}}O.__b=function(e){x=null,lr&&lr(e)},O.__=function(e,n){e&&n.__k&&n.__k.__m&&(e.__m=n.__k.__m),dr&&dr(e,n)},O.__r=function(e){or&&or(e),fn=0;var n=(x=e.__c).__H;n&&(Dt===x?(n.__h=[],x.__h=[],n.__.some(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(n.__h.some(Pn),n.__h.some(Jt),n.__h=[],fn=0)),Dt=x},O.diffed=function(e){sr&&sr(e);var n=e.__c;n&&n.__H&&(n.__H.__h.length&&(ra.push(n)!==1&&ar===O.requestAnimationFrame||((ar=O.requestAnimationFrame)||xl)(Nl)),n.__H.__.some(function(t){t.u&&(t.__H=t.u,t.u=void 0)})),Dt=x=null},O.__c=function(e,n){n.some(function(t){try{t.__h.some(Pn),t.__h=t.__h.filter(function(i){return!i.__||Jt(i)})}catch(i){n.some(function(a){a.__h&&(a.__h=[])}),n=[],O.__e(i,t.__v)}}),cr&&cr(e,n)},O.unmount=function(e){ur&&ur(e);var n,t=e.__c;t&&t.__H&&(t.__H.__.some(function(i){try{Pn(i)}catch(a){n=a}}),t.__H=void 0,n&&O.__e(n,t.__v))};var fr=typeof requestAnimationFrame=="function";function xl(e){var n,t=function(){clearTimeout(i),fr&&cancelAnimationFrame(n),setTimeout(e)},i=setTimeout(t,35);fr&&(n=requestAnimationFrame(t))}function Pn(e){var n=x,t=e.__c;typeof t=="function"&&(e.__c=void 0,t()),x=n}function Jt(e){var n=x;e.__c=e.__(),x=n}function la(e,n){return!e||e.length!==n.length||n.some(function(t,i){return t!==e[i]})}function oa(e,n){return typeof n=="function"?n(e):n}var Il=Symbol.for("preact-signals");function mt(){if(ee>1)ee--;else{var e,n=!1;for(function(){var a=Yn;for(Yn=void 0;a!==void 0;){var l=a.S;if(l.v===a.v)for(var o=l.t;o!==void 0;o=o.x)o.i===a.i&&(o.i=l.i);a=a.o}}();ln!==void 0;){var t=ln;for(ln=void 0,Hn++;t!==void 0;){var i=t.u;if(t.u=void 0,t.f&=-3,!(8&t.f)&&ca(t))try{t.c()}catch(a){n||(e=a,n=!0)}t=i}}if(Hn=0,ee--,n)throw e}}function Ol(e){if(ee>0)return e();Xt=++Ll,ee++;try{return e()}finally{mt()}}var an,E=void 0;function yt(e){var n=E,t=an;E=void 0,an=void 0;try{return e()}finally{E=n,an=t}}var ln=void 0,ee=0,Hn=0,Ll=0,Xt=0,Yn=void 0,qn=0;function sa(e){if(E!==void 0){var n=e.n;if(n===void 0||n.t!==E)return n={i:0,S:e,p:E.s,n:void 0,t:E,e:void 0,x:void 0,r:n},E.s!==void 0&&(E.s.n=n),E.s=n,e.n=n,32&E.f&&e.S(n),n;if(n.i===-1)return n.i=0,n.n!==void 0&&(n.n.p=n.p,n.p!==void 0&&(n.p.n=n.n),n.p=E.s,n.n=void 0,E.s.n=n,E.s=n),n}}function R(e,n){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=n?.watched,this.Z=n?.unwatched,this.name=n?.name}R.prototype.brand=Il;R.prototype.h=function(){return!0};R.prototype.S=function(e){var n=this,t=this.t;t!==e&&e.e===void 0&&(e.x=t,this.t=e,t!==void 0?t.e=e:yt(function(){var i;(i=n.W)==null||i.call(n)}))};R.prototype.U=function(e){var n=this;if(this.t!==void 0){var t=e.e,i=e.x;t!==void 0&&(t.x=i,e.e=void 0),i!==void 0&&(i.e=t,e.x=void 0),e===this.t&&(this.t=i,i===void 0&&yt(function(){var a;(a=n.Z)==null||a.call(n)}))}};R.prototype.subscribe=function(e){var n=this;return Sn(function(){var t=n.value;yt(function(){return e(t)})},{name:"sub"})};R.prototype.valueOf=function(){return this.value};R.prototype.toString=function(){return this.value+""};R.prototype.toJSON=function(){return this.value};R.prototype.peek=function(){var e=this;return yt(function(){return e.value})};Object.defineProperty(R.prototype,"value",{get:function(){var e=sa(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Hn>100)throw new Error("Cycle detected");(function(t){ee!==0&&Hn===0&&t.l!==Xt&&(t.l=Xt,Yn={S:t,v:t.v,i:t.i,o:Yn})})(this),this.v=e,this.i++,qn++,ee++;try{for(var n=this.t;n!==void 0;n=n.x)n.t.N()}finally{mt()}}}});function h(e,n){return new R(e,n)}function ca(e){for(var n=e.s;n!==void 0;n=n.n)if(n.S.i!==n.i||!n.S.h()||n.S.i!==n.i)return!0;return!1}function ua(e){for(var n=e.s;n!==void 0;n=n.n){var t=n.S.n;if(t!==void 0&&(n.r=t),n.S.n=n,n.i=-1,n.n===void 0){e.s=n;break}}}function da(e){for(var n=e.s,t=void 0;n!==void 0;){var i=n.p;n.i===-1?(n.S.U(n),i!==void 0&&(i.n=n.n),n.n!==void 0&&(n.n.p=i)):t=n,n.S.n=n.r,n.r!==void 0&&(n.r=void 0),n=i}e.s=t}function Ne(e,n){R.call(this,void 0,n),this.x=e,this.s=void 0,this.g=qn-1,this.f=4}Ne.prototype=new R;Ne.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===qn))return!0;if(this.g=qn,this.f|=1,this.i>0&&!ca(this))return this.f&=-2,!0;var e=E;try{ua(this),E=this;var n=this.x();(16&this.f||this.v!==n||this.i===0)&&(this.v=n,this.f&=-17,this.i++)}catch(t){this.v=t,this.f|=16,this.i++}return E=e,da(this),this.f&=-2,!0};Ne.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var n=this.s;n!==void 0;n=n.n)n.S.S(n)}R.prototype.S.call(this,e)};Ne.prototype.U=function(e){if(this.t!==void 0&&(R.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var n=this.s;n!==void 0;n=n.n)n.S.U(n)}};Ne.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}};Object.defineProperty(Ne.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=sa(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function hr(e,n){return new Ne(e,n)}function fa(e){var n=e.m;if(e.m=void 0,typeof n=="function"){ee++;var t=E;E=void 0;try{n()}catch(i){throw e.f&=-2,e.f|=8,Li(e),i}finally{E=t,mt()}}}function Li(e){for(var n=e.s;n!==void 0;n=n.n)n.S.U(n);e.x=void 0,e.s=void 0,fa(e)}function $l(e){if(E!==this)throw new Error("Out-of-order effect");da(this),E=e,this.f&=-2,8&this.f&&Li(this),mt()}function Qe(e,n){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=n?.name,an&&an.push(this)}Qe.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var n=this.x();typeof n=="function"&&(this.m=n)}finally{e()}};Qe.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,fa(this),ua(this),ee++;var e=E;return E=this,$l.bind(this,e)};Qe.prototype.N=function(){2&this.f||(this.f|=2,this.u=ln,ln=this)};Qe.prototype.d=function(){this.f|=8,1&this.f||Li(this)};Qe.prototype.dispose=function(){this.d()};function Sn(e,n){var t=new Qe(e,n);try{t.c()}catch(a){throw t.d(),a}var i=t.d.bind(t);return i[Symbol.dispose]=i,i}var ha,xn,Pl=typeof window<"u"&&!!window.__PREACT_SIGNALS_DEVTOOLS__,pa=[];Sn(function(){ha=this.N})();function Je(e,n){A[e]=n.bind(null,A[e]||function(){})}function Vn(e){if(xn){var n=xn;xn=void 0,n()}xn=e&&e.S()}function va(e){var n=this,t=e.data,i=Fl(t);i.name="ReactiveDom",i.value=t;var a=aa(function(){for(var s=n,u=n.__v;u=u.__;)if(u.__c){u.__c.__$f|=4;break}var c=hr(function(){var p=i.value.value;return p===0?0:p===!0?"":p||""}),d=hr(function(){return!Array.isArray(c.value)&&!qr(c.value)}),g=Sn(function(){if(this.N=ga,d.value){var p=c.value;s.__v&&s.__v.__e&&s.__v.__e.nodeType===3&&(s.__v.__e.data=p)}}),f=n.__$u.d;return n.__$u.d=function(){g(),f.call(this)},[d,c]},[]),l=a[0],o=a[1];return l.value?o.peek():o.value}va.displayName="ReactiveTextNode";Object.defineProperties(R.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:va},props:{configurable:!0,get:function(){var e=this;return{data:{get value(){return e.value}}}}},__b:{configurable:!0,value:1}});Je("__b",function(e,n){if(typeof n.type=="string"){var t,i=n.props;for(var a in i)if(a!=="children"){var l=i[a];l instanceof R&&(t||(n.__np=t={}),t[a]=l,i[a]=l.peek())}}e(n)});Je("__r",function(e,n){if(e(n),n.type!==F){Vn();var t,i=n.__c;i&&(i.__$f&=-2,(t=i.__$u)===void 0&&(i.__$u=t=function(a,l){var o;return Sn(function(){o=this},{name:l}),o.c=a,o}(function(a){return function(){var l;Pl&&((l=this.y)==null||l.call(this)),a.__$f|=1,a.setState({})}}(i),typeof n.type=="function"?n.type.displayName||n.type.name:""))),Vn(t)}});Je("__e",function(e,n,t,i){Vn(),e(n,t,i)});Je("diffed",function(e,n){Vn();var t;if(typeof n.type=="string"&&(t=n.__e)){var i=n.__np,a=n.props,l=t.U;if(l)for(var o in l){var s=l[o];s===void 0||i&&o in i||(s.d(),l[o]=void 0)}if(i){l||(l={},t.U=l);for(var u in i){var c=l[u],d=i[u];c===void 0?(c=Rl(t,u,d,a),l[u]=c):c.o(d,a)}}}e(n)});function Rl(e,n,t,i){var a=n in e&&e.ownerSVGElement===void 0,l=h(t);return{o:function(o,s){l.value=o,i=s},d:Sn(function(){this.N=ga;var o=l.value.value;i[n]!==o&&(i[n]=o,a?e[n]=o:o!=null&&(o!==!1||n[4]==="-")?e.setAttribute(n,o):e.removeAttribute(n))})}}Je("unmount",function(e,n){if(typeof n.type=="string"){var t=n.__e;if(t){var i=t.U;if(i){t.U=void 0;for(var a in i){var l=i[a];l&&l.d()}}}var o=n.__np;if(o){var s=n.props;for(var u in o)s[u]=o[u]}n.__np=void 0}else{var c=n.__c;if(c){var d=c.__$u;d&&(c.__$u=void 0,d.d())}}e(n)});Je("__h",function(e,n,t,i){i<3&&(n.__$f|=2),e(n,t,i)});rn.prototype.shouldComponentUpdate=function(e,n){if(this.__R)return!0;var t=this.__$u,i=t&&t.s!==void 0;for(var a in n)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var l=2&this.__$f;if(!(i||l||4&this.__$f)||1&this.__$f)return!0}else if(!(i||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 Fl(e,n){return aa(function(){return h(e,n)},[])}var Ml=function(e){queueMicrotask(function(){queueMicrotask(e)})};function Dl(){Ol(function(){for(var e;e=pa.shift();)ha.call(e)})}function ga(){pa.push(this)===1&&(A.requestAnimationFrame||Ml)(Dl)}function _a(){const e=window.location.hash;return e===""||e==="#"?"/":e.startsWith("#")?e.slice(1):e}const Gn=h(_a());function bt(e){const n=e.startsWith("/")?e:`/${e}`;`#${n}`!==window.location.hash&&(window.location.hash=n)}let pr=!1;function Ul(){pr||(pr=!0,window.addEventListener("hashchange",()=>{Gn.value=_a()}))}let hn=null;function jl(e){hn=e}class I extends Error{status;body;constructor(n,t,i){super(i),this.status=n,this.body=t}}async function y(e,n={}){const t={Accept:"application/json",...n.headers??{}};hn!==null&&(t.Authorization=`Bearer ${hn}`);const{body:i,...a}=n,l={...a,headers:t};i!==void 0&&(l.body=JSON.stringify(i),t["Content-Type"]="application/json");const o=await fetch(e,l),s=await o.text(),u=s===""?{}:JSON.parse(s);if(!o.ok){const c=u.error?.message??`request failed (${o.status})`;throw new I(o.status,u,c)}return u}async function Bl(e,n,t,i={}){const a={Accept:"text/event-stream","Content-Type":"application/json",...i.headers??{}};hn!==null&&(a.Authorization=`Bearer ${hn}`);const l=await fetch(e,{...i,method:"POST",headers:a,body:JSON.stringify(n)});if(!l.ok||l.body===null){const d=await l.text().catch(()=>"");let g={};try{g=d===""?{}:JSON.parse(d)}catch{}throw new I(l.status,g,g.error?.message??`stream failed (${l.status})`)}const o=l.body.getReader(),s=new TextDecoder;let u="";const c=d=>{for(const g of d.split(`
|
|
2
|
+
`)){if(!g.startsWith("data:"))continue;const f=g.slice(5).trim();if(f!=="")try{t(JSON.parse(f))}catch{}}};for(;;){const{done:d,value:g}=await o.read();if(d)break;u+=s.decode(g,{stream:!0});let f=u.indexOf(`
|
|
3
|
+
|
|
4
|
+
`);for(;f!==-1;)c(u.slice(0,f)),u=u.slice(f+2),f=u.indexOf(`
|
|
5
|
+
|
|
6
|
+
`)}u.trim()!==""&&c(u)}const be=h(null);async function Wl(){try{const e=await y("/api/v1/ping");be.value={...e,projectScopeAvailable:e.projectScopeAvailable===!0,projectSurface:e.projectSurface===!0,devSurfaces:e.devSurfaces===!0}}catch{be.value=null}}function K(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 zl(e){return/expected (boolean|string|number)/i.test(e)?e.replace(/^expected/i,"Expected"):e}function kt(e){const n={};for(const t of e.fields??[])n[t.path]=zl(t.message);return n}function Kl({id:e,children:n}){return r("p",{class:"ac-field__description",id:e,children:n})}function Hl({id:e,children:n}){return r("p",{class:"ac-field__error",id:e,role:"alert","aria-live":"polite",children:n})}function xe({id:e,label:n,description:t,error:i,children:a}){const l=t!==void 0?`${e}-desc`:void 0,o=i!==void 0?`${e}-err`:void 0;return r("div",{class:"ac-field","data-invalid":i!==void 0?"true":void 0,children:[r("label",{class:"ac-field__label",for:e,children:n}),t!==void 0?r(Kl,{id:l,children:t}):null,r("div",{class:"ac-field__control","aria-describedby":l,"aria-errormessage":o,children:a}),i!==void 0?r(Hl,{id:o,children:i}):null]})}function ma(e){return r(xe,{id:e.id,label:e.label,description:e.description,error:e.error,children:r("input",{class:"ac-input",type:"text",id:e.id,name:e.name,value:e.value,placeholder:e.placeholder,"aria-invalid":e.error!==void 0?"true":void 0,onInput:n=>e.onChange(n.currentTarget.value)})})}function Yl(e){const n=e.step??(e.integer===!0?1:"any");return r(xe,{id:e.id,label:e.label,description:e.description,error:e.error,children:r("input",{class:"ac-input",type:"number",id:e.id,name:e.name,value:Number.isFinite(e.value)?String(e.value):"0",min:e.min,max:e.max,step:n,"aria-invalid":e.error!==void 0?"true":void 0,onInput:t=>{const i=t.currentTarget.value,a=i===""?0:Number(i);e.onChange(Number.isFinite(a)?a:0)}})})}function ql(e){return r(xe,{id:e.id,label:e.label,description:e.description,error:e.error,children:r("label",{class:"ac-toggle",children:[r("input",{type:"checkbox",id:e.id,name:e.name,checked:e.value,"aria-invalid":e.error!==void 0?"true":void 0,onChange:n=>e.onChange(n.currentTarget.checked)}),r("span",{class:"ac-toggle__track","aria-hidden":"true"}),r("span",{class:"ac-toggle__state",children:e.value?"On":"Off"})]})})}function ya(e){const n=e.options.length>3;return r(xe,{id:e.id,label:e.label,description:e.description,error:e.error,children:n?r("select",{class:"ac-input",id:e.id,name:e.name,value:e.value,"aria-invalid":e.error!==void 0?"true":void 0,onChange:t=>e.onChange(t.currentTarget.value),children:e.options.map(t=>r("option",{value:t.value,children:t.label??(t.value===""?"(none)":t.value)},t.value))}):r("div",{class:"ac-radio-group",role:"radiogroup","aria-labelledby":`${e.id}-label`,children:e.options.map(t=>{const i=`${e.id}-${t.value||"none"}`;return r("label",{class:"ac-radio",for:i,children:[r("input",{type:"radio",id:i,name:e.name,value:t.value,checked:t.value===e.value,onChange:()=>e.onChange(t.value)}),r("span",{children:t.label??(t.value===""?"(none)":t.value)})]},t.value)})})})}function Qn(e){return r(xe,{id:e.id,label:e.label,description:e.description,error:e.error,children:r("textarea",{class:"ac-textarea",id:e.id,name:e.name,rows:e.rows??6,placeholder:e.placeholder,"aria-invalid":e.error!==void 0?"true":void 0,onInput:n=>e.onChange(n.currentTarget.value),children:e.value})})}function ba(e){return e.replace(/_/g," ").replace(/\./g," › ").replace(/\b\w/g,n=>n.toUpperCase())}function Vl(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 Ut(e,n){const t=Vl(n);return{path:e,kind:t,label:ba(e[e.length-1]??""),description:n.description,options:n.enum,min:n.minimum,max:n.maximum,defaultValue:n.default}}function ka(e){const n=[],t=e.properties??{};for(const[i,a]of Object.entries(t))if(a.type==="object"&&a.properties!==void 0){const l=[];for(const[o,s]of Object.entries(a.properties))if(s.type==="object"&&s.properties!==void 0)for(const[u,c]of Object.entries(s.properties))l.push(Ut([i,o,u],c));else l.push(Ut([i,o],s));n.push({path:[i],label:ba(i),description:a.description,fields:l})}else{const l=n.find(s=>s.path[0]==="__general"),o=Ut([i],a);l===void 0?n.unshift({path:["__general"],label:"General",fields:[o]}):l.fields.push(o)}return n}function Tn(e,n){let t=e;for(const i of n){if(t===null||typeof t!="object"||Array.isArray(t))return;t=t[i]}return t}function pn(e,n,t){if(n.length===0)return e;const[i,...a]=n;if(i===void 0)return e;const l={...e};if(a.length===0)return l[i]=t,l;const o=l[i],s=o!==null&&typeof o=="object"&&!Array.isArray(o)?o:{};return l[i]=pn(s,a,t),l}function Me(e){return e.join(".")}function vr(e,n,t,i){const a=Me(e.path),l=a,o=Tn(n,e.path),s=t[a],u=c=>{i(pn(n,e.path,c))};switch(e.kind){case"string":{const c=typeof o=="string"?o:"";return c.length>80?r(Qn,{id:a,name:l,label:e.label,description:e.description,error:s,value:c,onChange:u}):r(ma,{id:a,name:l,label:e.label,description:e.description,error:s,value:c,onChange:u})}case"enum":{const c=typeof o=="string"||typeof o=="number"?String(o):"",d=(e.options??[]).map(g=>({value:String(g)}));return r(ya,{id:a,name:l,label:e.label,description:e.description,error:s,value:c,options:d,onChange:u})}case"number":case"integer":{const c=typeof o=="number"?o:0;return r(Yl,{id:a,name:l,label:e.label,description:e.description,error:s,value:c,integer:e.kind==="integer",min:e.min,max:e.max,onChange:u})}case"boolean":{const c=typeof o=="boolean"?o:!1;return r(ql,{id:a,name:l,label:e.label,description:e.description,error:s,value:c,onChange:u})}case"array-of-strings":{const d=(Array.isArray(o)?o.filter(g=>typeof g=="string"):[]).join(`
|
|
7
|
+
`);return r(Qn,{id:a,name:l,label:e.label,description:`${e.description??""} (one entry per line)`.trim(),error:s,value:d,onChange:g=>{const f=g.split(`
|
|
8
|
+
`).map(p=>p.trim()).filter(p=>p!=="");u(f)}})}default:return null}}function Gl({field:e,values:n,errors:t,onChange:i,decorate:a}){const l=Me(e.path),o=a?.(l,e);return o===void 0?r("div",{children:vr(e,n,t,i)},l):r("div",{class:`ac-field-row${o.modified?" ac-field-row--modified":""}`,children:[r("div",{class:"ac-field-row__body",children:vr(e,n,t,i)}),r("div",{class:"ac-field-row__meta",children:[o.sourceLabel!==void 0?r("span",{class:"ac-badge ac-badge--source",title:`Value set in the ${o.sourceLabel} layer`,children:o.sourceLabel}):null,o.modified&&o.onReset!==void 0?r("button",{type:"button",class:"ac-field-row__reset",title:"Reset to default",onClick:o.onReset,children:"Reset"}):null]})]})}function wa({section:e,values:n,errors:t,onChange:i,decorate:a,footer:l}){return r("section",{class:"ac-section","aria-labelledby":`section-${Me(e.path)}`,children:[r("h2",{class:"ac-section__title",id:`section-${Me(e.path)}`,children:e.label}),e.description!==void 0?r("p",{class:"ac-section__description",children:e.description}):null,r("div",{class:"ac-section__fields",children:e.fields.map(o=>r(Gl,{field:o,values:n,errors:t,onChange:i,decorate:a},Me(o.path)))}),l]})}function Ql(e){const n=ka(e.schema),t=e.errors??{};return r("form",{class:"ac-form",onSubmit:i=>i.preventDefault(),children:[n.map(i=>r(wa,{section:i,values:e.values,errors:t,onChange:e.onChange,decorate:e.decorate},Me(i.path))),e.actions!==void 0?r("div",{class:"ac-form__actions",children:e.actions}):null]})}function Jl(e){const[n]=Oi(()=>`${e.id}-list`);return r(xe,{id:e.id,label:e.label,description:e.description,error:e.error,children:[r("input",{class:"ac-input",type:"text",id:e.id,name:e.name,value:e.value,placeholder:e.placeholder,list:n,"aria-invalid":e.error!==void 0?"true":void 0,onInput:t=>e.onChange(t.currentTarget.value)}),r("datalist",{id:n,children:e.suggestions.map(t=>r("option",{value:t},t))})]})}const Xl=["developer","reviewer","designer","product-manager","ops","qa","maintainer"],Zl=["de","en","en-US","en-GB","fr","es","it","nl","pt","pt-BR"];function gr(){return new Date().toISOString().slice(0,10)}function Oe(e,n){return e?.[n]}function eo({value:e,onChange:n,errors:t,hideRole:i,hideIdentityBasics:a}){const[l,o]=Oi(""),s="umd-role-suggestions";function u(v){n({...e,...v,last_updated:gr()})}const c=e.role.filter(v=>v.trim()!=="");function d(v){const _=v.trim();if(_===""||c.includes(_)){o("");return}u({role:[...c,_]}),o("")}function g(v){c.length<=1||u({role:c.filter(_=>_!==v)})}function f(v){const _={...e,last_updated:gr()};v===""?delete _.notes:_.notes=v,n(_)}const p=Xl.filter(v=>!c.includes(v));return r("div",{class:"ac-user-md-form",children:[a?null:r(ma,{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:Oe(t,"identity.name"),onChange:v=>u({identity:{...e.identity,name:v}})}),a?null:r(Jl,{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:Zl,error:Oe(t,"language"),onChange:v=>u({language:v})}),i?null:r(xe,{id:"umd-role-input",label:"Roles",description:"One or more roles. Seeded suggestions are non-binding — type anything and press Enter.",error:Oe(t,"role"),children:[r("ul",{class:"ac-chip-list","data-testid":"umd-role-list",children:c.map(v=>r("li",{class:"ac-chip",children:[r("span",{children:v}),r("button",{type:"button",class:"ac-chip__remove","aria-label":`Remove ${v}`,disabled:c.length<=1,onClick:()=>g(v),children:"×"})]},v))}),r("div",{class:"ac-role-add",children:[r("input",{class:"ac-input",type:"text",id:"umd-role-input",name:"role-add",list:s,placeholder:"Add a role and press Enter",value:l,onInput:v=>o(v.currentTarget.value),onKeyDown:v=>{(v.key==="Enter"||v.key===",")&&(v.preventDefault(),d(l))}}),r("datalist",{id:s,children:p.map(v=>r("option",{value:v},v))}),r("button",{type:"button",class:"ac-button",onClick:()=>d(l),children:"Add role"})]})]}),r(ya,{id:"umd-pace",name:"style.pace",label:"Pace",value:e.style.pace,error:Oe(t,"style.pace"),options:[{value:"pragmatic",label:"Pragmatic"},{value:"thorough",label:"Thorough"},{value:"rapid",label:"Rapid"}],onChange:v=>u({style:{...e.style,pace:v}})}),r(Qn,{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:Oe(t,"voice_sample"),onChange:v=>u({voice_sample:v})}),r(Qn,{id:"umd-notes",name:"notes",label:"Notes",description:"Optional free-form prose the agent remembers across sessions.",rows:6,value:e.notes??"",error:Oe(t,"notes"),onChange:f})]})}function Sa(){return{version:1,identity:{name:""},language:"en",role:[],style:{pace:"pragmatic"},voice_sample:"",last_updated:"1970-01-01"}}function _r(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function In(e,n){return typeof e=="string"?e:n}function no(e){return e==="thorough"||e==="rapid"?e:"pragmatic"}function to(e){return Array.isArray(e)?e.filter(n=>typeof n=="string"&&n.trim()!==""):[]}function io(e){if(typeof e=="string")return e===""?void 0:e}function mr(e){const n=Sa(),t=_r(e.identity)?e.identity:{},i=_r(e.style)?e.style:{},a=io(e.notes),l={version:1,identity:{name:In(t.name,n.identity.name)},language:In(e.language,n.language),role:to(e.role),style:{pace:no(i.pace)},voice_sample:In(e.voice_sample,n.voice_sample),last_updated:In(e.last_updated,n.last_updated)};return a!==void 0&&(l.notes=a),l}/*! js-yaml 5.4.1 https://github.com/nodeca/js-yaml @license MIT */var S=Symbol("NOT_RESOLVED");function U(e,n){return{tagName:e,nodeKind:"scalar",implicit:n.implicit??!1,matchByTagPrefix:n.matchByTagPrefix??!1,implicitFirstChars:n.implicitFirstChars??null,resolve:n.resolve,identify:n.identify,represent:n.represent??(t=>String(t)),representTagName:n.representTagName??(()=>e)}}function $i(e,n){const t=n.finalize===void 0;return{tagName:e,nodeKind:"sequence",implicit:!1,matchByTagPrefix:n.matchByTagPrefix??!1,create:n.create,addItem:n.addItem,finalize:n.finalize??(i=>i),carrierIsResult:t,identify:n.identify,represent:n.represent??(i=>i),representTagName:n.representTagName??(()=>e)}}function wt(e,n){const t=n.finalize===void 0;return{tagName:e,nodeKind:"mapping",implicit:!1,matchByTagPrefix:n.matchByTagPrefix??!1,create:n.create,addPair:n.addPair,has:n.has,keys:n.keys,get:n.get,finalize:n.finalize??(i=>i),carrierIsResult:t,identify:n.identify,represent:n.represent??(i=>i),representTagName:n.representTagName??(()=>e)}}var ro=U("tag:yaml.org,2002:str",{resolve:e=>e,identify:e=>typeof e=="string"}),ao=["","~","null","Null","NULL"],lo=U("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:e=>ao.indexOf(e)!==-1?null:S,identify:e=>e===null,represent:()=>"null"}),oo=U("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["n"],resolve:(e,n)=>e==="null"||n&&e===""?null:S,identify:e=>e===null,represent:()=>"null"}),so=["","~","null","Null","NULL"],co=U("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:e=>so.indexOf(e)!==-1?null:S,identify:e=>e===null,represent:()=>"null"}),uo=["true","True","TRUE"],fo=["false","False","FALSE"],ho=U("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","T","f","F"],resolve:e=>uo.indexOf(e)!==-1?!0:fo.indexOf(e)!==-1?!1:S,identify:e=>Object.prototype.toString.call(e)==="[object Boolean]",represent:e=>e?"true":"false"}),po=["true"],vo=["false"],go=U("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","f"],resolve:e=>po.indexOf(e)!==-1?!0:vo.indexOf(e)!==-1?!1:S,identify:e=>Object.prototype.toString.call(e)==="[object Boolean]",represent:e=>e?"true":"false"}),_o=["true","True","TRUE","y","Y","yes","Yes","YES","on","On","ON"],mo=["false","False","FALSE","n","N","no","No","NO","off","Off","OFF"],yo=U("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["y","Y","n","N","t","T","f","F","o","O"],resolve:e=>_o.indexOf(e)!==-1?!0:mo.indexOf(e)!==-1?!1:S,identify:e=>Object.prototype.toString.call(e)==="[object Boolean]",represent:e=>e?"true":"false"}),bo=new RegExp("^(?:0o[0-7]+|0x[0-9a-fA-F]+|[-+]?[0-9]+)$"),ko=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");function wo(e){let n=e,t=1;return(n[0]==="-"||n[0]==="+")&&(n[0]==="-"&&(t=-1),n=n.slice(1)),n.startsWith("0b")?t*parseInt(n.slice(2),2):n.startsWith("0o")?t*parseInt(n.slice(2),8):n.startsWith("0x")?t*parseInt(n.slice(2),16):t*parseInt(n,10)}function So(e,n){if(n){if(!ko.test(e))return S}else if(!bo.test(e))return S;const t=wo(e);return Number.isFinite(t)?t:S}var Ta=U("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:So,identify:e=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf("e")<0,represent:e=>e.toString(10)}),To=new RegExp("^-?(?:0|[1-9][0-9]*)$"),Co=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");function Ao(e){let n=e,t=1;return(n[0]==="-"||n[0]==="+")&&(n[0]==="-"&&(t=-1),n=n.slice(1)),n.startsWith("0b")?t*parseInt(n.slice(2),2):n.startsWith("0o")?t*parseInt(n.slice(2),8):n.startsWith("0x")?t*parseInt(n.slice(2),16):t*parseInt(n,10)}function Eo(e,n){if(n){if(!Co.test(e))return S}else if(!To.test(e))return S;const t=Ao(e);return Number.isFinite(t)?t:S}var No=U("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:Eo,identify:e=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf("e")<0,represent:e=>e.toString(10)}),xo=new 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 Io(e){let n=e.replace(/_/g,""),t=1;if((n[0]==="-"||n[0]==="+")&&(n[0]==="-"&&(t=-1),n=n.slice(1)),n.startsWith("0b"))return t*parseInt(n.slice(2),2);if(n.startsWith("0x"))return t*parseInt(n.slice(2),16);if(n.includes(":")){let i=0;for(const a of n.split(":"))i=i*60+Number(a);return t*i}return n!=="0"&&n[0]==="0"?t*parseInt(n,8):t*parseInt(n,10)}function Oo(e){if(!xo.test(e))return S;const n=Io(e);return Number.isFinite(n)?n:S}var Zt=U("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:Oo,identify:e=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf("e")<0,represent:e=>e.toString(10)}),Lo=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),$o=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Po(e){if(!Lo.test(e))return S;let n=e.toLowerCase();const t=n[0]==="-"?-1:1;if("+-".includes(n[0])&&(n=n.slice(1)),n===".inf")return t===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(n===".nan")return NaN;const i=t*parseFloat(n);return Number.isFinite(i)||$o.test(e)?i:S}function Ro(e){if(isNaN(e))return".nan";if(e===Number.POSITIVE_INFINITY)return".inf";if(e===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(e,-0))return"-0.0";const n=e.toString(10);return/^[-+]?[0-9]+e/.test(n)?n.replace("e",".e"):n}var Ca=U("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-","+",".",..."0123456789"],resolve:Po,identify:e=>typeof e=="number"&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf("e")>=0),represent:Ro}),Fo=new RegExp("^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$"),Mo=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Do(e,n){if(n){if(!Mo.test(e))return S;let i=e.toLowerCase();const a=i[0]==="-"?-1:1;if("+-".includes(i[0])&&(i=i.slice(1)),i===".inf")return a===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(i===".nan")return NaN;const l=a*parseFloat(i);return Number.isFinite(l)?l:S}if(!Fo.test(e))return S;const t=Number(e);return Number.isFinite(t)?t:S}function Uo(e){if(isNaN(e))return".nan";if(e===Number.POSITIVE_INFINITY)return".inf";if(e===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(e,-0))return"-0.0";const n=e.toString(10);return/^[-+]?[0-9]+e/.test(n)?n.replace("e",".e"):n}var jo=U("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:Do,identify:e=>typeof e=="number"&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf("e")>=0),represent:Uo}),Bo=new 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))$"),Wo=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function zo(e){if(!Bo.test(e))return S;let n=e.toLowerCase().replace(/_/g,"");const t=n[0]==="-"?-1:1;if("+-".includes(n[0])&&(n=n.slice(1)),n===".inf")return t===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(n===".nan")return NaN;let i=0;if(n.includes(":")){for(const a of n.split(":"))i=i*60+Number(a);i*=t}else i=t*parseFloat(n);return Number.isFinite(i)||Wo.test(e)?i:S}function Ko(e){if(isNaN(e))return".nan";if(e===Number.POSITIVE_INFINITY)return".inf";if(e===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(e,-0))return"-0.0";const n=e.toString(10);return/^[-+]?[0-9]+e/.test(n)?n.replace("e",".e"):n}var ei=U("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-","+",".",..."0123456789"],resolve:zo,identify:e=>typeof e=="number"&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf("e")>=0),represent:Ko}),Ho=U("tag:yaml.org,2002:merge",{implicit:!0,implicitFirstChars:["<"],resolve:(e,n)=>e==="<<"||n&&e===""?"<<":S,identify:()=>!1}),Yo=/^[A-Za-z0-9+/]*={0,2}$/;function qo(e){const n=e.replace(/\s/g,"");if(n.length%4!==0||!Yo.test(n))return S;const t=atob(n),i=new Uint8Array(t.length);for(let a=0;a<t.length;a++)i[a]=t.charCodeAt(a);return i}function Vo(e){let n="";for(let t=0;t<e.length;t++)n+=String.fromCharCode(e[t]);return btoa(n)}var Go=U("tag:yaml.org,2002:binary",{resolve:qo,identify:e=>Object.prototype.toString.call(e)==="[object Uint8Array]",represent:Vo}),Qo=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Jo=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function yr(e,n,t,i=0,a=0,l=0,o=0){const s=new Date(Date.UTC(e,n,t,i,a,l,o));return s.setUTCFullYear(e,n,t),s}function Xo(e){let n=Qo.exec(e);if(n===null&&(n=Jo.exec(e)),n===null)return S;const t=+n[1],i=+n[2]-1,a=+n[3];if(!n[4]){const d=yr(t,i,a);return d.getUTCFullYear()!==t||d.getUTCMonth()!==i||d.getUTCDate()!==a?S:d}const l=+n[4],o=+n[5],s=+n[6];let u=0;if(l>23||o>59||s>59)return S;if(n[7]){let d=n[7].slice(0,3);for(;d.length<3;)d+="0";u=+d}const c=yr(t,i,a,l,o,s,u);if(c.getUTCFullYear()!==t||c.getUTCMonth()!==i||c.getUTCDate()!==a)return S;if(n[9]){const d=+n[10],g=+(n[11]||0);if(d>23||g>59)return S;const f=(d*60+g)*6e4;c.setTime(c.getTime()-(n[9]==="-"?-f:f))}return c}var Zo=U("tag:yaml.org,2002:timestamp",{implicit:!0,implicitFirstChars:[..."0123456789"],resolve:Xo,identify:e=>e instanceof Date,represent:e=>e.toISOString()}),es=$i("tag:yaml.org,2002:seq",{create:()=>[],addItem:(e,n)=>{e.push(n)},identify:Array.isArray});function St(e){if(e===null||typeof e!="object"||Array.isArray(e))return!1;const n=Object.getPrototypeOf(e);return n===null||n===Object.prototype}function br(e,n){const t={};for(const i of n)e[i]!==void 0&&(t[i]=e[i]);return t}var ns=$i("tag:yaml.org,2002:omap",{create:()=>({list:[],seen:new Set}),addItem:(e,n)=>{let t;if(n instanceof Map){if(n.size!==1)return"cannot resolve an ordered map item";t=n.keys().next().value}else if(St(n)){const i=Object.keys(n);if(i.length!==1)return"cannot resolve an ordered map item";t=i[0]}else return"cannot resolve an ordered map item";return e.seen.has(t)?"duplicate key in ordered map":(e.seen.add(t),e.list.push(n),"")},finalize:e=>e.list,identify:()=>!1}),ts=$i("tag:yaml.org,2002:pairs",{create:()=>[],addItem:(e,n)=>{if(n instanceof Map)return n.size!==1?"cannot resolve a pairs item":(e.push(n.entries().next().value),"");if(Object.prototype.toString.call(n)!=="[object Object]")return"cannot resolve a pairs item";const t=n,i=Object.keys(t);return i.length!==1?"cannot resolve a pairs item":(e.push([i[0],t[i[0]]]),"")},identify:()=>!1}),is=wt("tag:yaml.org,2002:map",{create:()=>({}),identify:St,represent:e=>{const n=new Map;for(const t of Object.keys(e))n.set(t,e[t]);return n},addPair:(e,n,t)=>{if(n!==null&&typeof n=="object")return"object-based map does not support complex keys";const i=String(n);return i==="__proto__"?Object.defineProperty(e,i,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[i]=t,""},has:(e,n)=>n!==null&&typeof n=="object"?!1:Object.prototype.hasOwnProperty.call(e,String(n)),keys:e=>Object.keys(e),get:(e,n)=>{const t=String(n);return Object.prototype.hasOwnProperty.call(e,t)?e[t]:null}}),rs=wt("tag:yaml.org,2002:set",{create:()=>new Set,identify:e=>e instanceof Set,represent:e=>{const n=new Map;for(const t of e)n.set(t,null);return n},addPair:(e,n,t)=>t!==null?"cannot resolve a set item":(e.add(n),""),has:(e,n)=>e.has(n),keys:e=>e.keys(),get:()=>null});function as(){return{scalar:Object.create(null),sequence:Object.create(null),mapping:Object.create(null)}}function ls(){return{scalar:[],sequence:[],mapping:[]}}function os(e){const n=[];for(const t of e){let i=n.length;for(let a=0;a<n.length;a++){const l=n[a];if(l.nodeKind===t.nodeKind&&l.tagName===t.tagName&&l.matchByTagPrefix===t.matchByTagPrefix){i=a;break}}n[i]=t}return n}var Tt=class Aa{tags;implicitScalarTags;implicitScalarByFirstChar;implicitScalarAnyFirstChar;defaultScalarTag;defaultSequenceTag;defaultMappingTag;exact;prefix;constructor(n){const t=os(n),i=[],a=as(),l=ls();for(const d of t){if(d.nodeKind==="scalar"&&d.implicit){if(d.matchByTagPrefix)throw new Error("Implicit scalar tags cannot match by tag prefix");i.push(d)}switch(d.nodeKind){case"scalar":d.matchByTagPrefix?l.scalar.push(d):a.scalar[d.tagName]=d;break;case"sequence":d.matchByTagPrefix?l.sequence.push(d):a.sequence[d.tagName]=d;break;case"mapping":d.matchByTagPrefix?l.mapping.push(d):a.mapping[d.tagName]=d;break}}const o=i.filter(d=>d.implicitFirstChars===null),s=new Set;for(const d of i)if(d.implicitFirstChars!==null)for(const g of d.implicitFirstChars)s.add(g);const u=new Map;for(const d of s)u.set(d,i.filter(g=>g.implicitFirstChars===null||g.implicitFirstChars.indexOf(d)!==-1));const c=a.scalar["tag:yaml.org,2002:str"];if(!c)throw new Error("schema does not define the default scalar tag (tag:yaml.org,2002:str)");this.tags=t,this.implicitScalarTags=i,this.implicitScalarByFirstChar=u,this.implicitScalarAnyFirstChar=o,this.defaultScalarTag=c,this.defaultSequenceTag=a.sequence["tag:yaml.org,2002:seq"],this.defaultMappingTag=a.mapping["tag:yaml.org,2002:map"],this.exact=a,this.prefix=l}lookupScalarTag(n){const t=this.exact.scalar[n];if(t)return t;for(const i of this.prefix.scalar)if(n.startsWith(i.tagName))return i}lookupSequenceTag(n){const t=this.exact.sequence[n];if(t)return t;for(const i of this.prefix.sequence)if(n.startsWith(i.tagName))return i}lookupMappingTag(n){const t=this.exact.mapping[n];if(t)return t;for(const i of this.prefix.mapping)if(n.startsWith(i.tagName))return i}resolveImplicitScalarTag(n){const t=this.implicitScalarByFirstChar.get(n.charAt(0))??this.implicitScalarAnyFirstChar;for(const a of t){const l=a.resolve(n,!1,a.tagName);if(l!==S)return{value:l,tag:a}}const i=this.defaultScalarTag;return{value:i.resolve(n,!1,i.tagName),tag:i}}withTags(...n){let t=[];for(const i of n)t=t.concat(i);return new Aa([...this.tags,...t])}},Pi=new Tt([ro,es,is]);new Tt([...Pi.tags,oo,go,No,jo]);var ss=new Tt([...Pi.tags,lo,ho,Ta,Ca]),cs=new Tt([...Pi.tags,co,yo,Zt,ei,Zo,Ho,Go,ns,ts,rs]);cs.withTags({...Zt,resolve:(e,n,t)=>{const i=Zt.resolve(e,n,t);return i===S?Ta.resolve(e,n,t):i}},{...ei,resolve:(e,n,t)=>{const i=ei.resolve(e,n,t);return i===S?Ca.resolve(e,n,t):i}});wt("tag:yaml.org,2002:map",{create:()=>new Map,addPair:(e,n,t)=>(e.set(n,t),""),has:(e,n)=>e.has(n),keys:e=>e.keys(),get:(e,n)=>e.get(n),identify:e=>e instanceof Map||St(e),represent:e=>{if(e instanceof Map)return e;const n=new Map,t=e;for(const i of Object.keys(t))n.set(i,t[i]);return n}});function kr(e){if(Array.isArray(e)){const n=Array.prototype.slice.call(e);for(let t=0;t<n.length;t++){if(Array.isArray(n[t]))return null;typeof n[t]=="object"&&Object.prototype.toString.call(n[t])==="[object Object]"&&(n[t]="[object Object]")}return String(n)}return typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"?"[object Object]":String(e)}wt("tag:yaml.org,2002:map",{create:()=>({}),identify:St,represent:e=>{const n=new Map;for(const t of Object.keys(e))n.set(t,e[t]);return n},addPair:(e,n,t)=>{const i=kr(n);return i===null?"nested arrays are not supported inside keys":(i==="__proto__"?Object.defineProperty(e,i,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[i]=t,"")},has:(e,n)=>{const t=kr(n);return t!==null&&Object.prototype.hasOwnProperty.call(e,t)},keys:e=>Object.keys(e),get:(e,n)=>{const t=String(n);return Object.prototype.hasOwnProperty.call(e,t)?e[t]:null}});var us={maxLength:79,indent:1,linesBefore:3,linesAfter:2};function jt(e,n,t,i,a){let l="",o="";const s=Math.floor(a/2)-1;return i-n>s&&(l=" ... ",n=i-s+l.length),t-i>s&&(o=" ...",t=i+s-o.length),{str:l+e.slice(n,t).replace(/\t/g,"→")+o,pos:i-n+l.length}}function Bt(e,n){return" ".repeat(Math.max(n-e.length,0))+e}function ds(e,n){if(!e.buffer)return null;const t={...us,...n},i=/\r?\n|\r|\0/g,a=[0],l=[];let o,s=-1;for(;o=i.exec(e.buffer);)l.push(o.index),a.push(o.index+o[0].length),e.position<=o.index&&s<0&&(s=a.length-2);s<0&&(s=a.length-1);let u="";const c=Math.min(e.line+t.linesAfter,l.length).toString().length,d=t.maxLength-(t.indent+c+3);for(let f=1;f<=t.linesBefore&&!(s-f<0);f++){const p=jt(e.buffer,a[s-f],l[s-f],e.position-(a[s]-a[s-f]),d);u=`${" ".repeat(t.indent)}${Bt((e.line-f+1).toString(),c)} | ${p.str}
|
|
9
|
+
${u}`}const g=jt(e.buffer,a[s],l[s],e.position,d);u+=`${" ".repeat(t.indent)}${Bt((e.line+1).toString(),c)} | ${g.str}
|
|
10
|
+
`,u+=`${"-".repeat(t.indent+c+3+g.pos)}^
|
|
11
|
+
`;for(let f=1;f<=t.linesAfter&&!(s+f>=l.length);f++){const p=jt(e.buffer,a[s+f],l[s+f],e.position-(a[s]-a[s+f]),d);u+=`${" ".repeat(t.indent)}${Bt((e.line+f+1).toString(),c)} | ${p.str}
|
|
12
|
+
`}return u.replace(/\n$/,"")}function wr(e,n){let t="";return e.mark?(e.mark.name&&(t+=`in "${e.mark.name}" `),t+=`(${e.mark.line+1}:${e.mark.column+1})`,!n&&e.mark.snippet&&(t+=`
|
|
13
|
+
|
|
14
|
+
${e.mark.snippet}`),`${e.reason} ${t}`):e.reason}var ke=class Ea extends Error{reason;mark;constructor(n,t){super(),this.name="YAMLException",this.reason=n,this.mark=t,this.message=wr(this,!1),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}toString(n){return`${this.name}: ${wr(this,n)}`}static throwAt(n,t,i,a=""){let l=0,o=0;for(let u=0;u<t;u++){const c=n.charCodeAt(u);c===10?(l++,o=u+1):c===13&&(l++,n.charCodeAt(u+1)===10&&u++,o=u+1)}const s={name:a,buffer:n,position:t,line:l,column:t-o};throw s.snippet=ds(s),new Ea(i,s)}},M={DOCUMENT:1,SEQUENCE:2,MAPPING:3,SCALAR:4,ALIAS:5,POP:6},C={PLAIN:1,SINGLE_QUOTED:2,DOUBLE_QUOTED:3,LITERAL_BLOCK:4,FOLDED_BLOCK:5},He={BLOCK:1,FLOW:2},V={CLIP:1,STRIP:2,KEEP:3},fs=-1;function Sr(e){switch(e){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
|
|
15
|
+
`;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"
";case 95:return" ";case 76:return"\u2028";case 80:return"\u2029";default:return""}}var Na=new Array(256),xa=new Array(256);for(let e=0;e<256;e++)Na[e]=Sr(e)?1:0,xa[e]=Sr(e);function hs(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function ps(e){return e>=48&&e<=57?e-48:(e|32)-97+10}function vs(e){return e===120?2:e===117?4:8}function Jn(e,n,t){let i=0;for(;n<t;){const a=e.charCodeAt(n);if(a===10)i++,n++;else if(a===13)i++,n++,e.charCodeAt(n)===10&&n++;else if(a===32||a===9)n++;else break}return{position:n,breaks:i}}function Ri(e){return e===1?" ":`
|
|
16
|
+
`.repeat(e-1)}function gs(e,n,t){let i="",a=n,l=n,o=n;for(;a<t;){const s=e.charCodeAt(a);if(s===10||s===13){i+=e.slice(l,o);const u=Jn(e,a,t);i+=Ri(u.breaks),a=l=o=u.position}else a++,s!==32&&s!==9&&(o=a)}return i+e.slice(l,o)}function _s(e,n,t){let i="",a=n,l=n,o=n;for(;a<t;){const s=e.charCodeAt(a);if(s===39)i+=e.slice(l,a)+"'",a+=2,l=o=a;else if(s===10||s===13){i+=e.slice(l,o);const u=Jn(e,a,t);i+=Ri(u.breaks),a=l=o=u.position}else a++,s!==32&&s!==9&&(o=a)}return i+e.slice(l,t)}function ms(e,n,t){let i="",a=n,l=n,o=n;for(;a<t;){const s=e.charCodeAt(a);if(s===92){i+=e.slice(l,a),a++;const u=e.charCodeAt(a);if(u===10||u===13)a=Jn(e,a,t).position;else if(u<256&&Na[u])i+=xa[u],a++;else{let c=vs(u),d=0;for(;c>0;c--){a++;const g=ps(e.charCodeAt(a));d=(d<<4)+g}i+=hs(d),a++}l=o=a}else if(s===10||s===13){i+=e.slice(l,o);const u=Jn(e,a,t);i+=Ri(u.breaks),a=l=o=u.position}else a++,s!==32&&s!==9&&(o=a)}return i+e.slice(l,t)}function Tr(e,n,t,i,a,l){const o=i<0?0:i,s=e.slice(n,t).replace(/\r\n?/g,`
|
|
17
|
+
`),u=s===""?[]:(s.endsWith(`
|
|
18
|
+
`)?s.slice(0,-1):s).split(`
|
|
19
|
+
`);let c="",d=!1,g=0,f=!1;for(const p of u){let v=0;for(;v<o&&p.charCodeAt(v)===32;)v++;if(i<0||v>=p.length){g++;continue}const _=p.slice(o),k=_.charCodeAt(0);l?k===32||k===9?(f=!0,c+=`
|
|
20
|
+
`.repeat(d?1+g:g)):f?(f=!1,c+=`
|
|
21
|
+
`.repeat(g+1)):g===0?d&&(c+=" "):c+=`
|
|
22
|
+
`.repeat(g):c+=`
|
|
23
|
+
`.repeat(d?1+g:g),c+=_,d=!0,g=0}return a===V.KEEP?c+=`
|
|
24
|
+
`.repeat(d?1+g:g):a!==V.STRIP&&d&&(c+=`
|
|
25
|
+
`),c}function ys(e,n){if(n.valueStart===fs)return"";const{valueStart:t,valueEnd:i}=n;if(n.fast)return e.slice(t,i);switch(n.style){case C.SINGLE_QUOTED:return _s(e,t,i);case C.DOUBLE_QUOTED:return ms(e,t,i);case C.LITERAL_BLOCK:return Tr(e,t,i,n.indent,n.chomping,!1);case C.FOLDED_BLOCK:return Tr(e,t,i,n.indent,n.chomping,!0);default:return gs(e,t,i)}}var bs=Object.assign(Object.create(null),{"!":"!","!!":"tag:yaml.org,2002:"});function Ia(e,n){if(e.startsWith("!<")&&e.endsWith(">"))return decodeURIComponent(e.slice(2,-1));const t=e.indexOf("!",1),i=t===-1?"!":e.slice(0,t+1),a=n?.[i]??bs[i]??i;return decodeURIComponent(a)+decodeURIComponent(e.slice(i.length))}var De=-1,ks="tag:yaml.org,2002:merge",Fi={filename:"",schema:ss,json:!1,maxTotalMergeKeys:1e4,maxAliases:-1};function ws(e){return"tagStart"in e&&e.tagStart!==De?e.tagStart:"anchorStart"in e&&e.anchorStart!==De?e.anchorStart:"valueStart"in e&&e.valueStart!==De?e.valueStart:"start"in e?e.start:0}function P(e,n){ke.throwAt(e.source,e.position,n,e.filename)}function Oa(e,n,t,i){try{return t.finalize(i)}catch(a){if(a instanceof ke)throw a;ke.throwAt(e.source,n,a instanceof Error?a.message:String(a),e.filename)}}function Ss(e,n){const t=ys(e.source,n),i=n.tagStart===De?"":e.source.slice(n.tagStart,n.tagEnd),a=e.schema.defaultScalarTag;if(i!==""){if(i==="!")return{value:t,tag:a};const l=Ia(i,e.tagHandlers),o=e.schema.lookupScalarTag(l);if(o){const u=o.resolve(t,!0,l);return u===S&&P(e,`cannot resolve a node with !<${l}> explicit tag`),{value:u,tag:o}}const s=e.schema.lookupMappingTag(l)??e.schema.lookupSequenceTag(l);if(s){t!==""&&P(e,`cannot resolve a node with !<${l}> explicit tag`);const u=s.create(l);return{value:s.carrierIsResult?u:Oa(e,e.position,s,u),tag:s}}P(e,`unknown scalar tag !<${l}>`)}return n.style===C.PLAIN?e.schema.resolveImplicitScalarTag(t):{value:a.resolve(t,!1,a.tagName),tag:a}}function Cr(e,n,t){const i=n.tagStart===De?"":e.source.slice(n.tagStart,n.tagEnd);return i===""||i==="!"?t:Ia(i,e.tagHandlers)}function La(e){return e.nodeKind==="mapping"}function Ar(e){e.totalMergeKeys++,e.maxTotalMergeKeys!==-1&&e.totalMergeKeys>e.maxTotalMergeKeys&&P(e,`merge keys exceeded maxTotalMergeKeys (${e.maxTotalMergeKeys})`)}function Er(e,n,t,i){Ar(e);for(const a of i.keys(t)){if(Ar(e),n.tag.has(n.value,a))continue;const l=n.tag.addPair(n.value,a,i.get(t,a));l&&P(e,l),n.overridable??=new Set,n.overridable.add(a)}}function Ts(e,n,t,i){if(e.position=n.keyPosition,La(i))Er(e,n,t,i);else if(i.nodeKind==="sequence"&&Array.isArray(t)){t.length>100&&P(e,"abnormal merge sequence size");for(const a of t){const l=e.nodeTags.get(a);l||P(e,"cannot merge mappings; the provided source object is unacceptable"),Er(e,n,a,l)}}else P(e,"cannot merge mappings; the provided source object is unacceptable")}function Cs(e,n,t,i,a){if(e.position=n.keyPosition,n.keyIsMerge){Ts(e,n,i,a);return}!e.json&&n.tag.has(n.value,t)&&!n.overridable?.has(t)&&P(e,"duplicated mapping key");const l=n.tag.addPair(n.value,t,i);l&&P(e,l),n.overridable?.delete(t)}function Wt(e,n,t){const i=e.frames[e.frames.length-1];if(i.kind==="document")i.value=n,i.hasValue=!0;else if(i.kind==="sequence"){La(t)&&e.nodeTags.set(n,t);const a=i.tag.addItem(i.value,n,i.index++);a&&P(e,a)}else if(i.hasKey){const a=i.key;i.key=void 0,i.hasKey=!1,Cs(e,i,a,n,t)}else i.key=n,i.keyPosition=e.position,i.hasKey=!0,i.keyIsMerge=t.tagName===ks}function zt(e,n,t,i,a){if(n.anchorStart!==De){const l={value:t,tag:i,isValueFinal:a};return e.anchors.set(e.source.slice(n.anchorStart,n.anchorEnd),l),l}return null}function As(e,n){const t={...Fi,...n,events:e,documents:[],eventIndex:0,position:0,frames:[],anchors:new Map,nodeTags:new Map,tagHandlers:Object.create(null),totalMergeKeys:0,aliasCount:0};for(;t.eventIndex<t.events.length;){const i=t.events[t.eventIndex++];switch(t.position=ws(i),i.type){case M.DOCUMENT:t.anchors=new Map,t.nodeTags=new Map,t.aliasCount=0,t.tagHandlers=Object.create(null);for(const a of i.directives)a.kind==="tag"&&(t.tagHandlers[a.handle]=a.prefix);t.frames.push({kind:"document",position:t.position,value:void 0,hasValue:!1});break;case M.SCALAR:{const{value:a,tag:l}=Ss(t,i);zt(t,i,a,l,!0),Wt(t,a,l);break}case M.SEQUENCE:{const a=Cr(t,i,"tag:yaml.org,2002:seq"),l=t.schema.lookupSequenceTag(a);l||P(t,`unknown sequence tag !<${a}>`);const o=l.create(a),s=zt(t,i,o,l,l.carrierIsResult);t.frames.push({kind:"sequence",position:t.position,value:o,tag:l,anchor:s,index:0});break}case M.MAPPING:{const a=Cr(t,i,"tag:yaml.org,2002:map"),l=t.schema.lookupMappingTag(a);l||P(t,`unknown mapping tag !<${a}>`);const o=l.create(a),s=zt(t,i,o,l,l.carrierIsResult);t.frames.push({kind:"mapping",position:t.position,value:o,tag:l,anchor:s,key:void 0,keyPosition:t.position,hasKey:!1,keyIsMerge:!1,overridable:null});break}case M.ALIAS:{t.maxAliases!==-1&&++t.aliasCount>t.maxAliases&&P(t,`aliases exceeded maxAliases (${t.maxAliases})`);const a=t.source.slice(i.anchorStart,i.anchorEnd),l=t.anchors.get(a);l||P(t,`unidentified alias "${a}"`),l.isValueFinal||P(t,`recursive alias "${a}" is not supported for tag ${l.tag.tagName} because it uses finalize()`),Wt(t,l.value,l.tag);break}case M.POP:{const a=t.frames.pop();if(a.kind==="mapping"&&a.hasKey&&(t.position=a.keyPosition,P(t,"incomplete mapping pair in event stream")),a.kind==="document")t.documents.push(a.value);else{const l=a.tag.carrierIsResult?a.value:Oa(t,a.position,a.tag,a.value);a.anchor&&(a.anchor.value=l,a.anchor.isValueFinal=!0),Wt(t,l,a.tag)}break}}}return t.documents}var T=-1,$a=Object.prototype.hasOwnProperty,Ye=1,ni=2,Pa=3,Xn=4,Es=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Ns=/[,\[\]{}]/,Ra=/^(?:!|!!|![0-9A-Za-z-]+!)$/,ti=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]])`,Fa=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$.~*'()_])`,xs=new RegExp(`^(?:${ti})*$`),Is=new RegExp(`^(?:${Fa})+$`),Os=new RegExp(`^(?:!(?:${ti})*|${Fa}(?:${ti})*)$`),Mi={filename:"",maxDepth:100};function Ls(e,n,t){e.events.push({type:M.DOCUMENT,explicitStart:n,explicitEnd:t,directives:e.directives})}function Ma(e,n,t,i,a,l,o){e.events.push({type:M.SEQUENCE,start:n,anchorStart:t,anchorEnd:i,tagStart:a,tagEnd:l,style:o})}function ii(e,n,t,i,a,l,o){e.events.push({type:M.MAPPING,start:n,anchorStart:t,anchorEnd:i,tagStart:a,tagEnd:l,style:o})}function Nr(e,n){e.events.splice(n.eventsLength,0,{type:M.MAPPING,start:n.position,anchorStart:T,anchorEnd:T,tagStart:T,tagEnd:T,style:He.FLOW})}function Xe(e,n,t,i,a,l,o,s,u=V.CLIP,c=-1,d=!1){e.events.push({type:M.SCALAR,valueStart:n,valueEnd:t,anchorStart:i,anchorEnd:a,tagStart:l,tagEnd:o,style:s,chomping:u,indent:c,fast:d})}function $s(e,n,t){e.events.push({type:M.ALIAS,anchorStart:n,anchorEnd:t})}function Ue(e){e.events.push({type:M.POP})}function j(e){Xe(e,T,T,T,T,T,T,C.PLAIN)}function xr(){return{anchorStart:T,anchorEnd:T,tagStart:T,tagEnd:T}}function je(e){return{position:e.position,line:e.line,lineStart:e.lineStart,lineIndent:e.lineIndent,firstTabInLine:e.firstTabInLine,eventsLength:e.events.length}}function de(e,n){e.position=n.position,e.line=n.line,e.lineStart=n.lineStart,e.lineIndent=n.lineIndent,e.firstTabInLine=n.firstTabInLine,e.events.length=n.eventsLength}function m(e,n){ke.throwAt(e.input.slice(0,e.length),e.position,n,e.filename)}function $(e){return e===10||e===13}function we(e){return e===9||e===32}function Y(e){return we(e)||$(e)}function X(e){return e===0||Y(e)}function Se(e){return e===44||e===91||e===93||e===123||e===125}function Ps(e){return e>=48&&e<=57?e-48:-1}function Rs(e){if(e>=48&&e<=57)return e-48;const n=e|32;return n>=97&&n<=102?n-97+10:-1}function Fs(e){return e===120?2:e===117?4:e===85?8:0}function Ms(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 Zn(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 D(e,n){let t=0,i=e.input.charCodeAt(e.position),a=e.position===e.lineStart||Y(e.input.charCodeAt(e.position-1));for(;i!==0;){for(;we(i);)a=!0,i===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(n&&a&&i===35)do i=e.input.charCodeAt(++e.position);while(!$(i)&&i!==0);if(!$(i))break;for(Zn(e),t++,a=!0,i=e.input.charCodeAt(e.position);i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position)}return t}function qe(e,n=e.position){const t=e.input.charCodeAt(n);if((t===45||t===46)&&t===e.input.charCodeAt(n+1)&&t===e.input.charCodeAt(n+2)){const i=e.input.charCodeAt(n+3);return i===0||Y(i)}return!1}function Da(e){e.position===e.lineStart&&e.input.charCodeAt(e.position)===65279&&(e.position++,e.lineStart=e.position)}function Di(e){if(e.position!==e.lineStart)return!1;if(qe(e))return!0;if(e.input.charCodeAt(e.position)!==65279)return!1;const n=je(e);Da(e),D(e,!0);const t=e.input.charCodeAt(e.position),i=e.position===e.lineStart&&(t===37||t===45&&qe(e));return de(e,n),i}function Ir(e){let n=e.input.charCodeAt(e.position);for(;n!==0&&!$(n);)n=e.input.charCodeAt(++e.position)}function Ua(e,n,t){Es.test(e.input.slice(n,t))&&m(e,"the stream contains non-printable characters")}function Ds(e,n,t){if(e.input.charCodeAt(e.position)!==33)return!1;n.tagStart!==T&&m(e,"duplication of a tag property");const i=e.position;let a=!1,l=!1,o="!",s=e.input.charCodeAt(++e.position);s===60?(a=!0,s=e.input.charCodeAt(++e.position)):s===33&&(l=!0,o="!!",s=e.input.charCodeAt(++e.position));let u=e.position,c;if(a){for(;s!==0&&s!==62;)s=e.input.charCodeAt(++e.position);s!==62&&m(e,"unexpected end of the stream within a verbatim tag"),c=e.input.slice(u,e.position),e.position++}else{for(;s!==0&&!Y(s)&&!(t&&Se(s));)s===33&&(l?m(e,"tag suffix cannot contain exclamation marks"):(o=e.input.slice(u-1,e.position+1),Ra.test(o)||m(e,"named tag handle cannot contain such characters"),l=!0,u=e.position+1)),s=e.input.charCodeAt(++e.position);c=e.input.slice(u,e.position),Ns.test(c)&&m(e,"tag suffix cannot contain flow indicator characters")}return c&&!(a?xs.test(c):Is.test(c))&&m(e,`tag name cannot contain such characters: ${c}`),!a&&o!=="!"&&o!=="!!"&&!$a.call(e.tagHandlers,o)&&m(e,`undeclared tag handle "${o}"`),n.tagStart=i,n.tagEnd=e.position,!0}function Us(e,n){if(e.input.charCodeAt(e.position)!==38)return!1;n.anchorStart!==T&&m(e,"duplication of an anchor property"),e.position++;const t=e.position;for(;e.input.charCodeAt(e.position)!==0&&!Y(e.input.charCodeAt(e.position))&&!Se(e.input.charCodeAt(e.position));)e.position++;return e.position===t&&m(e,"name of an anchor node must contain at least one character"),n.anchorStart=t,n.anchorEnd=e.position,!0}function js(e,n){if(e.input.charCodeAt(e.position)!==42)return!1;(n.anchorStart!==T||n.tagStart!==T)&&m(e,"alias node should not have any properties"),e.position++;const t=e.position;for(;e.input.charCodeAt(e.position)!==0&&!Y(e.input.charCodeAt(e.position))&&!Se(e.input.charCodeAt(e.position));)e.position++;return e.position===t&&m(e,"name of an alias node must contain at least one character"),$s(e,t,e.position),!0}function ri(e,n){D(e,!1),e.lineIndent<n&&m(e,"deficient indentation")}function Bs(e,n,t){if(e.input.charCodeAt(e.position)!==39)return!1;e.position++;const i=e.position;let a=!0;for(;e.input.charCodeAt(e.position)!==0;){const l=e.input.charCodeAt(e.position);if(l===39){if(e.input.charCodeAt(e.position+1)===39){a=!1,e.position+=2;continue}const o=e.position;return e.position++,Xe(e,i,o,t.anchorStart,t.anchorEnd,t.tagStart,t.tagEnd,C.SINGLE_QUOTED,V.CLIP,-1,a),!0}$(l)?(a=!1,ri(e,n)):e.position===e.lineStart&&qe(e)?m(e,"unexpected end of the document within a single quoted scalar"):l!==9&&l<32?m(e,"expected valid JSON character"):e.position++}m(e,"unexpected end of the stream within a single quoted scalar")}function Ws(e,n,t){if(e.input.charCodeAt(e.position)!==34)return!1;e.position++;const i=e.position;let a=!0;for(;e.input.charCodeAt(e.position)!==0;){const l=e.input.charCodeAt(e.position);if(l===34){const o=e.position;return e.position++,Xe(e,i,o,t.anchorStart,t.anchorEnd,t.tagStart,t.tagEnd,C.DOUBLE_QUOTED,V.CLIP,-1,a),!0}if(l===92){a=!1;const o=e.input.charCodeAt(++e.position);if($(o))ri(e,n);else if(Ms(o))e.position++;else{let s=Fs(o);for(s===0&&m(e,"unknown escape sequence");s-- >0;)e.position++,Rs(e.input.charCodeAt(e.position))<0&&m(e,"expected hexadecimal character");e.position++}}else $(l)?(a=!1,ri(e,n)):e.position===e.lineStart&&qe(e)?m(e,"unexpected end of the document within a double quoted scalar"):l!==9&&l<32?m(e,"expected valid JSON character"):e.position++}m(e,"unexpected end of the stream within a double quoted scalar")}function zs(e,n,t){const i=e.input.charCodeAt(e.position);let a=V.CLIP,l=-1,o=!1;if(i!==124&&i!==62)return!1;const s=i===124?C.LITERAL_BLOCK:C.FOLDED_BLOCK;for(e.position++;e.input.charCodeAt(e.position)!==0;){const p=e.input.charCodeAt(e.position),v=Ps(p);if(p===43||p===45)a!==V.CLIP&&m(e,"repeat of a chomping mode identifier"),a=p===43?V.KEEP:V.STRIP,e.position++;else if(v>=0)v===0&&m(e,"bad explicit indentation width of a block scalar; it cannot be less than one"),o&&m(e,"repeat of an indentation width identifier"),l=n+v-1,o=!0,e.position++;else break}let u=!1;for(;we(e.input.charCodeAt(e.position));)u=!0,e.position++;u&&e.input.charCodeAt(e.position)===35&&Ir(e),$(e.input.charCodeAt(e.position))?Zn(e):e.input.charCodeAt(e.position)!==0&&m(e,"a line break is expected");let c=o?l:-1,d=0;const g=e.position;let f=e.position;for(;e.input.charCodeAt(e.position)!==0;){const p=e.position;let v=0;for(;e.input.charCodeAt(p+v)===32;)v++;const _=e.input.charCodeAt(p+v);if(_===0){c>=0?v>c&&(f=p+v):v>0&&(f=p+v);break}if(Di(e))break;if(!o&&c===-1&&$(_)&&(d=Math.max(d,v)),!o&&c===-1&&!$(_)&&(_===9&&v<n&&(e.position=p+v,m(e,"tab characters must not be used in indentation")),v<d&&(e.position=p+v,m(e,"bad indentation of a mapping entry"))),c===-1&&_!==0&&!$(_)&&v<n){e.lineIndent=v,e.position=p+v;break}!o&&_!==0&&!$(_)&&c===-1&&(c=v);const k=c===-1?n+1:c;if(_!==0&&!$(_)&&v<k){e.lineIndent=v,e.position=p+v;break}Ir(e),f=e.position,$(e.input.charCodeAt(e.position))&&(Zn(e),f=e.position)}return Ua(e,g,f),Xe(e,g,f,t.anchorStart,t.anchorEnd,t.tagStart,t.tagEnd,s,a,c),!0}function Ks(e,n){const t=e.input.charCodeAt(e.position),i=n===Ye;if(t===0||Y(t)||t===35||t===38||t===42||t===33||t===124||t===62||t===39||t===34||t===37||t===64||t===96||i&&Se(t))return!1;if(t===63||t===45){const a=e.input.charCodeAt(e.position+1);if(X(a)||i&&Se(a))return!1}return!0}function Hs(e,n,t,i){if(!Ks(e,t))return!1;const a=e.position;let l=e.position,o=e.input.charCodeAt(e.position);const s=t===Ye;let u=!1;for(;o!==0&&!Di(e);){if(o===58){const c=e.input.charCodeAt(e.position+1);if(X(c)||s&&Se(c))break}else if(o===35){if(Y(e.input.charCodeAt(e.position-1)))break}else{if(s&&Se(o))break;if($(o)){const c=e.position,d=e.line,g=e.lineStart,f=e.lineIndent;if(D(e,!1),e.lineIndent>=n){u=!0,o=e.input.charCodeAt(e.position);continue}e.position=c,e.line=d,e.lineStart=g,e.lineIndent=f;break}}we(o)||(l=e.position+1),o=e.input.charCodeAt(++e.position)}return l===a?!1:(Ua(e,a,l),Xe(e,a,l,i.anchorStart,i.anchorEnd,i.tagStart,i.tagEnd,C.PLAIN,V.CLIP,-1,!u),!0)}function nn(e,n){const t=e.line;D(e,!0),(e.line>t&&e.lineIndent<n||e.firstTabInLine!==-1&&e.lineIndent<n)&&m(e,"deficient indentation")}function Ys(e,n,t){const i=e.input.charCodeAt(e.position),a=i===123,l=e.position;let o=!0;if(i!==91&&i!==123)return!1;const s=a?125:93;for(a?ii(e,l,t.anchorStart,t.anchorEnd,t.tagStart,t.tagEnd,He.FLOW):Ma(e,l,t.anchorStart,t.anchorEnd,t.tagStart,t.tagEnd,He.FLOW),e.position++;e.input.charCodeAt(e.position)!==0;){nn(e,n);let u=e.input.charCodeAt(e.position);if(u===s)return e.position++,Ue(e),!0;o?u===44&&m(e,"expected the node content, but found ','"):m(e,"missed comma between flow collection entries");let c=!1,d=!1;u===63&&Y(e.input.charCodeAt(e.position+1))&&(c=d=!0,e.position+=1,nn(e,n));const g=e.line,f=je(e),p=fe(e,n,Ye,!1,!0);nn(e,n),u=e.input.charCodeAt(e.position),(a||d||e.line===g)&&u===58?(c=!0,e.position++,nn(e,n),a||Nr(e,f),p||j(e),fe(e,n,Ye,!1,!0)||j(e),nn(e,n),a||Ue(e)):a&&c?(p||j(e),j(e)):a?j(e):c&&(Nr(e,f),p||j(e),j(e),Ue(e)),u=e.input.charCodeAt(e.position),u===44?(o=!0,e.position++):o=!1}m(e,"unexpected end of the stream within a flow collection")}function Or(e,n,t){if(e.firstTabInLine!==-1||e.input.charCodeAt(e.position)!==45||!X(e.input.charCodeAt(e.position+1)))return!1;for(Ma(e,e.position,t.anchorStart,t.anchorEnd,t.tagStart,t.tagEnd,He.BLOCK);e.input.charCodeAt(e.position)===45&&X(e.input.charCodeAt(e.position+1));){e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,m(e,"tab characters must not be used in indentation"));const i=e.line;e.position++;const a=D(e,!0)>0;if(e.firstTabInLine!==-1&&e.input.charCodeAt(e.position)===45&&X(e.input.charCodeAt(e.position+1))&&m(e,"bad indentation of a sequence entry"),a&&e.lineIndent<=n?j(e):fe(e,n,Pa,!1,!0),D(e,!0),e.lineIndent<n||e.position>=e.length)break;e.lineIndent>n&&m(e,"bad indentation of a sequence entry"),e.line===i&&e.input.charCodeAt(e.position)===45&&X(e.input.charCodeAt(e.position+1))&&m(e,"bad indentation of a sequence entry")}return Ue(e),!0}function Kt(e,n,t,i){let a=!1,l=!1,o=!1,s=!1;if(e.firstTabInLine!==-1)return!1;let u=e.input.charCodeAt(e.position);for(;u!==0;){!a&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,m(e,"tab characters must not be used in indentation"));const c=e.input.charCodeAt(e.position+1),d=e.line;if((u===63||u===58)&&X(c))o||(ii(e,e.position,i.anchorStart,i.anchorEnd,i.tagStart,i.tagEnd,He.BLOCK),o=!0),u===63?(a&&j(e),l=!0,a=!0):(a||(j(e),l=!0),a=!1),e.position+=1,s=!0;else{a&&(j(e),a=!1);const g=je(e);if(!fe(e,t,ni,!1,!0))break;if(e.line===d){for(u=e.input.charCodeAt(e.position);we(u);)u=e.input.charCodeAt(++e.position);if(u===58){if(u=e.input.charCodeAt(++e.position),X(u)||m(e,"a whitespace character is expected after the key-value separator within a block mapping"),!o){for(de(e,g),ii(e,g.position,i.anchorStart,i.anchorEnd,i.tagStart,i.tagEnd,He.BLOCK),o=!0,fe(e,t,ni,!1,!0),u=e.input.charCodeAt(e.position);we(u);)u=e.input.charCodeAt(++e.position);e.position++}l=!0,a=!1,s=!1}else if(l)m(e,"expected ':' after a mapping key");else return i.anchorStart!==T||i.tagStart!==T?(de(e,g),!1):!0}else if(l)m(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return i.anchorStart!==T||i.tagStart!==T?(de(e,g),!1):!0}if(fe(e,n,Xn,!0,s)&&(s=!1),a||s&&(j(e),s=!1),D(e,!0),u=e.input.charCodeAt(e.position),(e.line===d||e.lineIndent>n)&&u!==0)m(e,"bad indentation of a mapping entry");else if(e.lineIndent<n)break}return l?(a&&j(e),o&&Ue(e),!0):!1}function fe(e,n,t,i,a,l=!0){e.depth>=e.maxDepth&&m(e,`nesting exceeded maxDepth (${e.maxDepth})`),e.depth++;let o=1,s=!1,u=!1,c=null;const d=xr();let g=t===Xn||t===Pa,f=g;const p=g;if(i&&D(e,!0)&&(s=!0,e.lineIndent>n?o=1:e.lineIndent===n?o=0:o=-1),o===1)for(;;){const v=e.input.charCodeAt(e.position),_=je(e);if(s&&o!==1&&(v===33||v===38))break;if(s&&p&&(d.tagStart!==T||d.anchorStart!==T)&&(v===33||v===38)){const k=je(e),w=n+1;if(Kt(e,e.position-e.lineStart,w,d)&&e.events[k.eventsLength]?.type===M.MAPPING)return e.depth--,!0;de(e,k)}if(s&&(v===33&&d.tagStart!==T||v===38&&d.anchorStart!==T)||!Ds(e,d,t===Ye)&&!Us(e,d))break;c===null&&(c=_),D(e,!0)?(s=!0,f=p,e.lineIndent>n?o=1:e.lineIndent===n?o=0:o=-1):f=!1}if(f&&(f=s||a),o===1||t===Xn){const v=t===Ye||t===ni?n:n+1,_=e.position-e.lineStart;if(o===1)if(f&&(Or(e,_,d)||Kt(e,_,v,d))||Ys(e,v,d))u=!0;else{const k=e.input.charCodeAt(e.position);if(c!==null&&l&&p&&!f&&k!==124&&k!==62){const w=je(e),b=c.position-c.lineStart;de(e,c),Kt(e,b,v,xr())&&e.events[w.eventsLength]?.type===M.MAPPING?u=!0:de(e,w)}!u&&(g&&zs(e,v,d)||Bs(e,v,d)||Ws(e,v,d)||js(e,d)||Hs(e,v,t,d))&&(u=!0)}else o===0&&(u=f&&Or(e,_,d))}return g=g&&!u,!u&&(d.anchorStart!==T||d.tagStart!==T||g)&&(Xe(e,T,T,d.anchorStart,d.anchorEnd,d.tagStart,d.tagEnd,C.PLAIN),u=!0),e.depth--,u||d.anchorStart!==T||d.tagStart!==T}function qs(e){if(e.lineIndent>0||e.input.charCodeAt(e.position)!==37)return!1;e.position++;const n=e.position;for(;e.input.charCodeAt(e.position)!==0&&!Y(e.input.charCodeAt(e.position));)e.position++;const t=e.input.slice(n,e.position),i=[];for(t.length===0&&m(e,"directive name must not be less than one character in length");e.input.charCodeAt(e.position)!==0&&!$(e.input.charCodeAt(e.position));){for(;we(e.input.charCodeAt(e.position));)e.position++;if(e.input.charCodeAt(e.position)===35||$(e.input.charCodeAt(e.position))||e.input.charCodeAt(e.position)===0)break;const a=e.position;for(;e.input.charCodeAt(e.position)!==0&&!Y(e.input.charCodeAt(e.position));)e.position++;i.push(e.input.slice(a,e.position))}if($(e.input.charCodeAt(e.position))&&Zn(e),t==="YAML"){e.directives.some(l=>l.kind==="yaml")&&m(e,"duplication of %YAML directive"),i.length!==1&&m(e,"YAML directive accepts exactly one argument");const a=/^([0-9]+)\.([0-9]+)$/.exec(i[0]);a===null&&m(e,"ill-formed argument of the YAML directive"),parseInt(a[1],10)!==1&&m(e,"unacceptable YAML version of the document"),e.directives.push({kind:"yaml",version:i[0]})}else if(t==="TAG"){i.length!==2&&m(e,"TAG directive accepts exactly two arguments");const[a,l]=i;Ra.test(a)||m(e,"ill-formed tag handle (first argument) of the TAG directive"),$a.call(e.tagHandlers,a)&&m(e,`there is a previously declared suffix for "${a}" tag handle`),Os.test(l)||m(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagHandlers[a]=l,e.directives.push({kind:"tag",handle:a,prefix:l})}return!0}function Vs(e){e.directives=[],e.tagHandlers=Object.create(null);let n=!1;for(D(e,!0);qs(e);)n=!0,D(e,!0);let t=!1,i=!1,a=!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&&X(e.input.charCodeAt(e.position+3))){t=!0;const s=e.line;e.position+=3,D(e,!0),a=e.line>s}else n&&m(e,"directives end mark is expected");const l=e.events.length;if(!t&&e.position===e.lineStart&&e.input.charCodeAt(e.position)===46&&qe(e)){e.position+=3,D(e,!0);return}if(Ls(e,t,!1),fe(e,e.lineIndent-1,Xn,!1,a,a)||j(e),D(e,!0),e.position===e.lineStart&&qe(e)&&(i=e.input.charCodeAt(e.position)===46,i)){const s=e.line;e.position+=3,D(e,!0),e.line===s&&e.position<e.length&&m(e,"end of the stream or a document separator is expected")}const o=e.events[l];o?.type===M.DOCUMENT&&(o.explicitEnd=i),Ue(e),!i&&e.position<e.length&&!Di(e)&&m(e,"end of the stream or a document separator is expected")}function Gs(e,n){const t=e.length,i={...Mi,...n,input:`${e}\0`,length:t,position:0,line:0,lineStart:0,lineIndent:0,firstTabInLine:-1,depth:0,directives:[],tagHandlers:Object.create(null),events:[]},a=e.indexOf("\0");for(a!==-1&&ke.throwAt(e,a,"null byte is not allowed in input",i.filename);i.position<i.length&&(Da(i),D(i,!0),!(i.position>=i.length));){const l=i.position;Vs(i),i.position===l&&m(i,"can not read a document")}return i.events}var Qs={...Mi,...Fi};function Js(e,n={}){const t={...Qs,...n},i=String(e),a=Object.keys(Mi),l=Object.keys(Fi);return As(Gs(i,br(t,a)),{...br(t,l),source:i})}function Xs(e,n){const t=Js(e,n);if(t.length===0)throw new ke("expected a document, but the input is empty");if(t.length===1)return t[0];throw new ke("expected a single document in the stream, but found more")}function Ct(e,n){return(e&1<<n)!==0}var Lr={applyQuoteFlowKeysOption:Zs,doubleQuoteForInvisibles:ec,doubleQuoteWhitespaceOnly:nc,applyForceQuotesOption:tc,tryLongOrMultilineAsBlock:ic,quoteInvalidPlain:rc,fallbackToDoubleQuoted:ac};function ja(e){return e.presenterOptions.quoteStyle==="single"&&Ct(e.allowedStylesMask,C.SINGLE_QUOTED)?C.SINGLE_QUOTED:C.DOUBLE_QUOTED}function Zs(e){e.presenterOptions.quoteFlowKeys&&(!e.isKey||!e.flowOnly||e.style!==C.PLAIN||(e.style=C.DOUBLE_QUOTED))}function ec(e){e.style===C.PLAIN&&/[\t\x7F-\xA0\u2028\u2029\uFEFF\uFFFE\uFFFF]/.test(e.node.value)&&(e.style=C.DOUBLE_QUOTED)}function nc(e){e.style===C.PLAIN&&/^\s+$/.test(e.node.value)&&(e.style=C.DOUBLE_QUOTED)}function tc(e){e.presenterOptions.forceQuotes&&(e.isKey||e.style!==C.PLAIN||(e.style=e.node.value.includes(`
|
|
26
|
+
`)?C.DOUBLE_QUOTED:ja(e)))}function ic(e){if(e.style!==C.PLAIN||e.isKey)return;const n=e.node.value,t=n.indexOf(`
|
|
27
|
+
`)!==-1;if(!Ct(e.allowedStylesMask,C.LITERAL_BLOCK)){t&&(e.style=C.DOUBLE_QUOTED);return}const i=e.presenterOptions.lineWidth;if(i===-1){t&&(e.style=C.LITERAL_BLOCK);return}const a=Math.max(Math.min(i,40),i-e.shiftOfContent);let l=0,o=!1;for(;l<=n.length;){let s=n.length;const u=n.indexOf(`
|
|
28
|
+
`,l);u!==-1&&(s=u);const c=n.slice(l,s);if(c.length>a&&c[0]!==" "&&/ [^ \t]/.test(c)&&(o=!0),u===-1)break;l=u+1}o?e.style=C.FOLDED_BLOCK:t&&(e.style=C.LITERAL_BLOCK)}function rc(e){e.style===C.PLAIN&&!Ct(e.allowedStylesMask,C.PLAIN)&&(e.style=ja(e))}function ac(e){Ct(e.allowedStylesMask,e.style)||(e.style=C.DOUBLE_QUOTED)}Object.keys(Lr).map(e=>Reflect.get(Lr,e));function lc(e){if(e.trim()==="")return{};const t=Xs(e);if(t==null)return{};if(typeof t!="object"||Array.isArray(t))throw new Error(".agent-user.yml must parse to an object");return t}const $r={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"},Pr={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"]},oc=[{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"]}],Rr=[{id:"identity",title:"Editor & behaviour",navLabel:"Preferences",subtitle:"Your IDE plus how the agent behaves: autonomy, output verbosity, PR-comment style. rtk presence is auto-detected (see the rtk row). Your name lives in .agent-user.yml (later step).",kind:"form",paths:["personal.ide","personal.open_edited_files","personal.autonomy","personal.minimal_output","personal.play_by_play","personal.pr_comment_bot_icon"]},{id:"cost",title:"Budgets, rules & cadence",navLabel:"Budgets & cadence",subtitle:"Independent levers: rule_loading_tier (how many behavioural rules load — token footprint), cost.budgets (optional USD ceilings), model.auto_switch (per-skill model tier), plus quality/roadmap cadence and memory thresholds.",kind:"form",paths:["rule_loading_tier","cost.budgets.daily","cost.budgets.weekly","cost.budgets.monthly","cost.enforcement","model.auto_switch","tokens.rich_skills","roadmap.quality_cadence","roadmap.dashboard_regen_cadence","quality.local_auto_run","memory.review_threshold","memory.redact_patterns"]},{id:"user-md",title:"Your .agent-user.yml",navLabel:"User profile",subtitle:"Identity, voice, preferences. Stored at agents/settings/.agent-user.yml. Skip to leave empty.",kind:"userMd"},{id:"review",title:"Review & finish",navLabel:"Review",subtitle:"These keys will change. Confirm to write .agent-settings.yml and .agent-user.yml atomically.",kind:"review"}];function Ba(e={}){return e.extended===!0?[$r,Pr,...oc,...Rr]:[$r,Pr,...Rr]}function At(e,n={}){const t=Ba(n),i=Math.max(0,Math.min(t.length-1,e));return t[i]}function sc(e){const n={},t=i=>{n[i]=!0;const a=e.clusterOf.get(i);a!==void 0&&(n[a]=!0)};for(const i of e.installed)t(i);for(const i of e.roleDefaults)t(i);for(const i of e.detected)t(i);return n}function cc(e,n){const t=new Set(n);return e.filter(i=>i!=="engineering-base"&&!t.has(i)).sort()}function uc(e,n){const t={type:"object",properties:{},...e.description!==void 0?{description:e.description}:{}},i=t.properties,a=e.properties??{};for(const l of n){const o=l.split(".").filter(z=>z.length>0);if(o.length===0)continue;const[s,u,c]=o;if(s===void 0)continue;const d=a[s];if(d===void 0)continue;if(u===void 0){i[s]=d;continue}const g=d.properties?.[u];if(g===void 0)continue;const p=i[s]??{type:"object",properties:{},...d.description!==void 0?{description:d.description}:{}},v=p.properties??={};if(c===void 0){v[u]=g,i[s]=p;continue}const _=g.properties?.[c];if(_===void 0)continue;const w=v[u]??{type:"object",properties:{},...g.description!==void 0?{description:g.description}:{}},b=w.properties??={};b[c]=_,v[u]=w,i[s]=p}return t}function dc({current:e,total:n}){const t=Math.max(1,n),i=Math.max(0,Math.min(t-1,e)),a=Array.from({length:t},(o,s)=>s<=i),l=Math.round((i+1)/t*100);return r("div",{class:"ac-wizard__progress",role:"progressbar","aria-valuenow":i+1,"aria-valuemin":1,"aria-valuemax":t,"aria-valuetext":`Step ${i+1} of ${t} (${l}%)`,children:a.map((o,s)=>r("span",{class:`ac-wizard__progress-segment${o?" ac-wizard__progress-segment--filled":""}`,"aria-hidden":"true"},s))})}function fc({step:e,index:n,total:t}){return r("header",{class:"ac-page__header ac-wizard__header",children:[r("p",{class:"ac-wizard__step-count",children:["Step ",n+1," of ",t]}),r("div",{class:"ac-wizard__header-text",children:[r("h1",{children:e.title}),r("p",{class:"ac-wizard__subtitle",children:e.subtitle})]}),r(dc,{current:n,total:t})]})}function hc(e){const n=e.canFinish??!0,t=e.completed??!1;return r("div",{class:"ac-form__actions ac-wizard__nav",children:[r("button",{type:"button",class:"ac-button",disabled:!e.canGoPrev||e.busy,onClick:e.onPrev,children:"Back"}),e.canSkip&&e.onSkip!==void 0?r("button",{type:"button",class:"ac-button ac-wizard__skip",disabled:e.busy,onClick:e.onSkip,children:e.skipLabel??"Skip"}):null,e.isLast?t?null:r("button",{type:"button",class:"ac-button ac-button--primary",disabled:e.busy||!n,onClick:e.onFinish,children:e.busy?"Saving…":"Finish & save"}):r("button",{type:"button",class:"ac-button ac-button--primary",disabled:!e.canGoNext||e.busy,onClick:e.onNext,children:e.nextLabel??"Next"})]})}function Wa(e,n){return e.kind!=="form"||e.paths===void 0?!1:!!(e.paths.includes(n)||e.id==="cost"&&(n.startsWith("telegraph.")||n.startsWith("verbosity.")))}function pc(e,n){return e.kind==="userMd"?n==="body"||n.startsWith("body."):Wa(e,n)}function vc(e,n){for(const t of Object.keys(n.errors))if(pc(e,t))return!0;return!1}function gc(e,n){if(vc(e,n))return{label:"needs attention",tone:"error"};if(e.kind==="userMd")return n.userMdChanged?{label:n.userMdAction==="create"?"will create":"will replace",tone:"changed"}:{label:"",tone:"idle"};if(e.kind==="form"){const t=n.changes.filter(i=>Wa(e,i.path)).length;return t===0?{label:"",tone:"idle"}:{label:`${t} change${t===1?"":"s"}`,tone:"changed"}}if(e.kind==="aiTools"){const t=n.selectedToolsCount??0;return t===0?{label:"",tone:"idle"}:{label:`${t} tool${t===1?"":"s"}`,tone:"changed"}}if(e.kind==="packs"){const t=n.selectedPacksCount??0;return t===0?{label:"",tone:"idle"}:{label:`${t} pack${t===1?"":"s"}`,tone:"changed"}}return{label:"",tone:"idle"}}function _c(e){const n=e.steps.filter((s,u)=>u!==e.currentIndex),t=e.packRemovals??[],i=e.selectedToolIds??[],a=e.packAdditions??[],l=e.changes.length,o=i.length>0||a.length>0||l>0||e.userMdChanged;return r(F,{children:[o?r("section",{class:"ac-review-summary","aria-label":"What happens on Finish",children:[r("h2",{class:"ac-review-summary__title",children:"What happens on Finish"}),r("ul",{class:"ac-review-summary__list",children:[l>0?r("li",{children:[r("strong",{children:l})," setting",l===1?"":"s"," will change"," ","in ",r("code",{children:".agent-settings.yml"}),"."]}):r("li",{children:"No settings change."}),e.userMdChanged?r("li",{children:[r("code",{children:".agent-user.yml"})," will be"," ",e.userMdAction==="create"?"created":"updated","."]}):null,i.length>0?r("li",{children:["Config is installed for ",i.length," tool",i.length===1?"":"s",":",r("span",{class:"ac-review-summary__chips",children:i.map(s=>r("code",{class:"ac-review-summary__chip",children:s},s))})]}):null,a.length>0?r("li",{children:["New pack",a.length===1?"":"s",":",r("span",{class:"ac-review-summary__chips",children:a.map(s=>r("code",{class:"ac-review-summary__chip",children:s},s))})]}):null]})]}):null,t.length>0?r("div",{class:"ac-review-removals",role:"alert",children:[r("p",{class:"ac-review-removals__title",children:["⚠️ ",t.length===1?"1 installed pack will be removed":`${t.length} installed packs will be removed`]}),r("ul",{class:"ac-review-removals__list",children:t.map(s=>r("li",{children:r("code",{children:s})},s))}),r("label",{class:"ac-review-removals__confirm",children:[r("input",{type:"checkbox",checked:e.removalsConfirmed??!1,onChange:s=>{e.onConfirmRemovals?.(s.currentTarget.checked)}}),r("span",{children:"I understand these packs will no longer be installed. Re-check them on the packs step to keep them."})]})]}):null,r("nav",{class:"ac-wizard__review-nav","aria-label":"Jump back to a step",children:[r("p",{class:"ac-wizard__review-nav-label",children:"Jump back to a step:"}),r("ul",{class:"ac-wizard__review-nav-list",children:n.map(s=>{const u=e.steps.indexOf(s),c=gc(s,e),d=c.tone==="error"?"ac-wizard__review-nav-button ac-wizard__review-nav-button--error":"ac-wizard__review-nav-button";return r("li",{children:r("button",{type:"button",class:d,onClick:()=>{e.onJump(u)},children:[r("span",{class:"ac-wizard__review-nav-index",children:u+1}),r("span",{class:"ac-wizard__review-nav-text",children:s.navLabel}),c.label!==""?r("span",{class:`ac-wizard__review-nav-status ac-wizard__review-nav-status--${c.tone}`,children:c.label}):null]})},s.id)})})]})]})}function mc(e){const n=e.abortedAt??"unknown time",t=e.abortNote??"no further detail recorded",i=e.writesSinceRollback;return r("aside",{class:"ac-banner ac-banner--recovery",role:"alert",children:[r("strong",{children:"Previous install was interrupted."}),r("p",{children:["Aborted at ",r("code",{children:n})," — ",t,". ",i," write",i===1?"":"s"," landed before the abort marker."]}),r("p",{children:"Pick how to recover before continuing. Resume reopens the wizard fresh, Rollback discards the abort state, Ignore hides this banner without touching the log."}),r("div",{class:"ac-banner__actions",children:[r("button",{type:"button",disabled:e.busy,onClick:()=>e.onResume(),children:"Resume install"}),r("button",{type:"button",disabled:e.busy,onClick:()=>e.onRollback(),children:"Rollback"}),r("button",{type:"button",disabled:e.busy,onClick:()=>e.onIgnore(),children:"Ignore"})]})]})}function yc(){return r("section",{class:"ac-continue-screen","aria-labelledby":"ac-continue-title",children:[r("h2",{id:"ac-continue-title",children:"Install complete — continue with setup?"}),r("p",{children:"Your install selections (AI tools, roles, capability packs) are captured. Use the footer to continue:"}),r("ul",{children:[r("li",{children:[r("strong",{children:"Next"})," — go through the remaining personalisation steps: editor + tooling, personality, cost profile, roadmap & quality, memory, your",r("code",{children:" .agent-user.yml"}),", and finally the project module roots."]}),r("li",{children:[r("strong",{children:"Finish install here"})," — skip the rest and write ",r("code",{children:".agent-settings.yml"})," with the install-only selections. You can re-run ",r("code",{children:"agent-config setup"}),"later to pick up the personalisation steps."]})]})]})}function bc(e){const n=e.version??"unknown";return r("section",{class:"ac-backup-screen","aria-labelledby":"ac-backup-title",children:[r("h2",{id:"ac-backup-title",children:"Existing v3 install detected"}),r("p",{children:["Found a v3.x install at ",r("code",{children:e.sourcePath})," ","(VERSION: ",r("code",{children:n}),"). v4 is a hard-cut release with no auto-migration — settings, identity, and history layouts changed. The wizard can back up the v3 tree before writing the v4 layout so you can roll back manually if needed."]}),e.error!==null?r("p",{class:"ac-banner ac-banner--error",children:["Backup failed: ",e.error]}):null,r("ul",{children:[r("li",{children:[r("strong",{children:"Backup v3 and proceed"})," — copies the tree to ",r("code",{children:e.backupTarget}),", then runs the v4 install. Restore later with",r("code",{children:[" mv ",e.backupTarget," ",e.sourcePath]}),"."]}),r("li",{children:[r("strong",{children:"Abort, uninstall v3 first"})," — closes the wizard. You decide what to keep."]})]}),r("div",{class:"ac-backup-screen__actions",children:[r("button",{type:"button",class:"ac-button ac-button--primary",disabled:e.busy,onClick:()=>e.onBackupAndProceed(),children:e.busy?"Backing up…":"Backup v3 and proceed"}),r("button",{type:"button",class:"ac-button",disabled:e.busy,onClick:()=>e.onAbort(),children:"Abort, uninstall v3 first"})]})]})}const kc=[{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 wc({text:e}){const[n,t]=Oi(!1);return r("button",{type:"button",class:"ac-button ac-checklist__copy",onClick:()=>{navigator.clipboard?.writeText(e).then(()=>{t(!0),setTimeout(()=>{t(!1)},1500)})},children:n?"Copied ✓":"Copy"})}function Sc({message:e}){return r("div",{class:"ac-checklist",children:[r("div",{class:"ac-checklist__hero",children:[r("h2",{class:"ac-checklist__headline",children:"Setup complete"}),e!==null?r("p",{class:"ac-checklist__message",children:e}):null]}),r("ol",{class:"ac-checklist__items",children:kc.map(n=>r("li",{class:"ac-checklist__item",children:[r("div",{class:"ac-checklist__text",children:[r("span",{class:"ac-checklist__item-title",children:n.title}),r("span",{class:"ac-checklist__item-detail",children:n.detail})]}),n.command!==void 0?r("div",{class:"ac-checklist__cmd-row",children:[r("code",{class:"ac-checklist__cmd",children:n.command}),r(wc,{text:n.command})]}):null]},n.title))}),r("p",{class:"ac-checklist__close-hint",children:"You can close this browser window — the local server shuts down on its own."})]})}const za=h(!1),on=h(null),N=h(null),et=h(!1),nt=h(!1),Te=h(0),Ui=h(null),H=h({}),Ka=h({}),Ha=h(0),Be=h({}),L=h(null),he=h(null),ji=h(!1),ai=h(!1),Et=h(!1),Ya=h({}),Nt=h([]);h("global");const Pe=h(!1),B=h(!1),Tc=h(!1),tt=h(!1),it=h(null),Bi=h([]),rt=h({}),at=h(!0),lt=h(""),ot=h("agents");h(!1);const qa=h(null),Cc=[{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"}],li=h(!1),We=h(!1),pe=h(null),xt=h([]),It=h([]),Ce=h([]),oi=h(!1),Cn=h([]),ne=h({}),Va=h(!1),si=h(!1),Rn=h(!1),Wi=h({}),Fr=h(!1),Ga=h(null),Qa=h(null),Ja=h(null),Xa=h(null),ci=h(null),Za=h(null),ui=h("https://github.com/rtk-ai/rtk"),di=h(!1),el=h(null),Ac=h(null),fi=h(null),nl=h("event4u-app/agent-switch"),zi=h(!1);h(!1);h(null);h([]);h({});h({});const ie=h({}),oe=h({}),hi=h(!1),Mr=h(!1);h({});h(null);h(null);h(!1);h(null);const st=h(null),tl=h(!1),pi=h(null),vi=h(!1),gi=h(!1),_i=h(null),ze=h(null),Fn=h(!1),Ki=h(!1);function il(){return Ba({extended:B.value})}function Ve(){return il().length}function Ec(e){return e??new Date().toISOString()}function Hi(e){return Math.max(0,Math.min(Ve()-1,e))}function Nc(e){if("$ref"in e&&e.$ref!==void 0&&"definitions"in e&&e.definitions!==void 0){const n=e.$ref.replace("#/definitions/",""),t=e.definitions[n];if(t!==void 0)return t}return e}async function xc(){try{return await y("/api/v1/settings")}catch(e){if(e instanceof I&&e.status===404&&e.body.error?.code==="NOT_FOUND"){const n=e.body;if(n.defaults!==void 0&&n.schema!==void 0)return{values:n.defaults,lastModified:n.lastModified??0,path:n.path??".agent-settings.yml",schema:n.schema};const t=await y("/api/v1/schema");return{values:{},lastModified:0,path:".agent-settings.yml",schema:t.settings}}throw e}}async function Ic(){try{const e=await y("/api/v1/install/recovery");st.value=e.incomplete?e:null}catch{st.value=null}}async function Oc(){try{const e=await y("/api/v1/install/legacy-v3");pi.value=e.present?e:null}catch{pi.value=null}}async function Lc(){gi.value=!0,_i.value=null;try{await y("/api/v1/install/backup-v3",{method:"POST"}),vi.value=!0}catch(e){_i.value=e instanceof I?K(e.body.error??{code:"UNKNOWN",message:e.message}):e instanceof Error?e.message:String(e)}finally{gi.value=!1}}async function Ht(e){try{await y("/api/v1/install/recovery/dismiss",{method:"POST",body:{reason:e}})}catch(n){N.value={message:n instanceof Error?n.message:String(n),tone:"error"};return}st.value=null,tl.value=!0}async function $c(){on.value=null;try{Ic(),Oc();const[e,n]=await Promise.all([y("/api/v1/wizard/state"),xc()]);Ui.value=Nc(n.schema),Ha.value=n.lastModified,Ka.value=n.values,Ya.value=n.legacyHints??{},B.value=e.extendedSteps===!0,ze.value=e.wizardMode??null;const t=Object.keys(e.partial??{});H.value=t.length>0?{...n.values,...e.partial}:n.values,Te.value=Hi(e.step),Pe.value=!1,za.value=!0;const i=At(Te.value,{extended:B.value});(i.kind==="welcome"||i.kind==="userMd"||i.kind==="review")&&Yi(),(i.kind==="roles"||i.kind==="aiTools"||i.kind==="packs")&&An(),i.kind==="roles"&&qi(),i.kind==="aiTools"&&Ot(),i.id==="identity"&&(rl(),al()),i.kind==="review"&&ll()}catch(e){e instanceof I?on.value=K(e.body.error??{code:"UNKNOWN",message:e.message}):on.value=e instanceof Error?e.message:String(e)}}function Pc(e,n){return e.identity.name.trim()!==""?e:{...e,identity:{...e.identity,name:n}}}async function Yi(){if(!ai.value)try{const e=await y("/api/v1/user-md");if(ji.value=e.exists,e.exists&&e.identity!==null){const n=mr(e.identity);he.value=n,L.value=n}else{let n;try{const i=await y("/api/v1/user-md/template");n=mr(lc(i.body))}catch{n=Sa()}const t=Ya.value.user_name;typeof t=="string"&&t.trim()!==""&&(n=Pc(n,t)),he.value=n,L.value=n}}catch(e){N.value={message:e instanceof Error?e.message:String(e),tone:"error"}}finally{ai.value=!0}}const Rc=new Set(["python"]);async function An(){if(!(li.value||We.value)){We.value=!0,pe.value=null;try{const[e,n]=await Promise.all([y("/api/v1/wizard/manifest"),y("/api/v1/wizard/auto-detect")]),t=(e.packs??[]).map(l=>({id:l.id,label:l.label??l.id,description:l.description??"",requires_hint:l.requires_hint,cluster:l.cluster??void 0,workspaces:l.workspaces}));xt.value=t,Cn.value=(e.workspaces??[]).filter(l=>l.id!=="agent-config-maintainer").map(l=>({id:l.id,label:l.label??l.id,description:l.description??"",default_packs:l.default_packs??[],optional_packs:l.optional_packs??[],...l.example_roles!==void 0?{example_roles:l.example_roles}:{}}));const i=new Set(t.map(l=>l.id)),a=n.signals.map(l=>l.id.startsWith("pack-")?l.id.slice(5):l.id).filter(l=>i.has(l)).filter(l=>!Rc.has(l));It.value=a,Ce.value=(e.installedPacks??[]).filter(l=>i.has(l))}catch(e){e instanceof I?pe.value=K(e.body.error??{code:"UNKNOWN",message:e.message}):pe.value=e instanceof Error?e.message:String(e)}finally{We.value=!1,li.value=!0}}}async function Ot(){if(!(si.value||Rn.value)){Rn.value=!0;try{const e=await y("/api/v1/wizard/detect-tools"),n=e.tools??{},t=e.configured??[];if(Wi.value=n,Object.keys(ie.value).length===0){const i={};if(t.length>0)for(const a of t)i[a]=!0;else for(const[a,l]of Object.entries(n))l&&(i[a]=!0);ie.value=i}}catch{}finally{Rn.value=!1,si.value=!0}}}async function rl(){if(!Fr.value){Fr.value=!0;try{const e=await y("/api/v1/wizard/detect-rtk"),n=e.installed===!0;Ga.value=n,Qa.value=e.present===!0,Ja.value=e.identity??null,Xa.value=e.version??null,ci.value=e.installCommand??null,Za.value=e.installCommands??null,typeof e.repo=="string"&&(ui.value=e.repo);const t=H.value.personal??{};H.value={...H.value,personal:{...t,rtk_installed:n}}}catch{}}}async function al(){if(!di.value){di.value=!0;try{const e=await y("/api/v1/wizard/detect-agent-switch");el.value=e.installed===!0,Ac.value=e.version??null,fi.value=e.installCommand??null,typeof e.repo=="string"&&(nl.value=e.repo),zi.value=e.dismissed===!0}catch{}}}async function Fc(e,n){try{await y("/api/v1/wizard/state",{method:"POST",body:{step:e,totalSteps:Ve(),partial:n,startedAt:Ec(null)}})}catch(t){N.value={message:t instanceof Error?t.message:String(t),tone:"error"}}}async function ll(){nt.value=!0;try{const e=await y("/api/v1/settings/diff",{method:"POST",body:{values:H.value,ifUnmodifiedSince:Ha.value}});Nt.value=e.changes,Be.value={}}catch(e){e instanceof I?(Be.value=kt(e.body.error??{message:e.message}),N.value={message:K(e.body.error??{code:"UNKNOWN",message:e.message}),tone:"error"}):N.value={message:e instanceof Error?e.message:String(e),tone:"error"}}finally{nt.value=!1}}function ct(){return Et.value?!1:L.value===null||he.value===null?L.value!==he.value:JSON.stringify(L.value)!==JSON.stringify(he.value)}async function Re(e){const n=Hi(e);await Fc(n,H.value),Te.value=n,N.value=null;const t=At(n,{extended:B.value});(t.kind==="welcome"||t.kind==="userMd")&&Yi(),(t.kind==="roles"||t.kind==="aiTools"||t.kind==="packs")&&An(),t.kind==="roles"&&qi(),t.kind==="packs"&&$t(),t.kind==="aiTools"&&Ot(),t.id==="identity"&&(rl(),al()),t.kind==="review"&&ll()}function Lt(){const e=oe.value,n=new Map(xt.value.map(l=>[l.id,l])),t=Object.entries(e).filter(([,l])=>l===!0).map(([l])=>l).filter(l=>{const o=n.get(l)?.cluster;return o===void 0||e[o]===!0}),i=new Set,a=l=>{if(!i.has(l)){i.add(l);for(const o of n.get(l)?.requires_hint??[])a(o)}};for(const l of t)a(l);return[...i].sort()}async function qi(){if(await Promise.all([An(),Yi()]),Va.value||Object.values(ne.value).some(Boolean))return;const e=L.value?.role??[];if(e.length===0)return;const n=new Set(Cn.value.map(i=>i.id)),t={};for(const i of e)n.has(i)&&(t[i]=!0);Object.keys(t).length!==0&&(ne.value=t,$t())}function $t(){if(hi.value)return;const e=Object.entries(ne.value).filter(([,a])=>a===!0).map(([a])=>a),n=new Map(Cn.value.map(a=>[a.id,a])),t=[];for(const a of e)for(const l of n.get(a)?.default_packs??[])t.push(l);const i=new Map;for(const a of xt.value)a.cluster!==void 0&&i.set(a.id,a.cluster);oe.value=sc({installed:Ce.value,roleDefaults:t,detected:It.value,clusterOf:i})}function Mc(){const e=Object.entries(ie.value).filter(([,i])=>i===!0).map(([i])=>i);if(e.length===0)return null;const n=Lt(),t={schema_version:"wizard-v2",tools:e,packs:n,settings:H.value};return be.value?.dryRun===!0&&(t.dry_run=!0),t}async function Dc(){et.value=!0,N.value=null;try{const e={settings:H.value},n=Object.entries(ne.value).filter(([,u])=>u===!0).map(([u])=>u),t=L.value!==null&&typeof L.value.identity?.name=="string"&&L.value.identity.name.trim().length>0;L.value!==null&&t&&(ct()||n.length>0)&&(e.identity=n.length>0?{...L.value,role:n}:L.value);const i=await y("/api/v1/wizard/finish",{method:"POST",body:e}),a="You can close this browser window now.",l=i.dryRun===!0?"Dry-run complete — no files written. Settings would be saved.":Array.isArray(i.writtenPaths)?`Saved (${i.writtenPaths.join(", ")}). Wizard complete.`:"Wizard complete.",o=B.value?Mc():null;let s="";if(o!==null&&o.dry_run===!0)try{await y("/api/v1/wizard/apply",{method:"POST",body:o}),s=" Installer preview OK (dry-run) — no files written."}catch(u){s=` Installer preview failed: ${u instanceof I?K(u.body.error??{code:"UNKNOWN",message:u.message}):u instanceof Error?u.message:String(u)}.`}else if(o!==null)try{let u=null;await Bl("/api/v1/wizard/apply",o,g=>{g.type==="error"&&(u=typeof g.message=="string"?g.message:"install failed")});const c=o.tools.length,d=o.packs.length;s=u!==null?` Installer failed: ${u}. Settings were saved; re-run the wizard to retry.`:` Installer applied ${c} tool${c===1?"":"s"}`+(d>0?` and ${d} pack${d===1?"":"s"}.`:".")}catch(u){s=` Installer bridge failed: ${u instanceof I?K(u.body.error??{code:"UNKNOWN",message:u.message}):u instanceof Error?u.message:String(u)}. Settings were saved; re-run the wizard to retry the install plan.`}N.value={message:`${l}${s} ${a}`,tone:"success"},Te.value=Hi(Ve()-1),Ka.value=H.value,he.value=ct()?L.value:he.value,Nt.value=[],Pe.value=!0}catch(e){e instanceof I?(Be.value=kt(e.body.error??{message:e.message}),N.value={message:K(e.body.error??{code:"UNKNOWN",message:e.message}),tone:"error"}):N.value={message:e instanceof Error?e.message:String(e),tone:"error"}}finally{et.value=!1}}async function Uc(){Ki.value=!0,await Promise.all([An(),Ot()]),await qi(),$t(),await Re(Ve()-1)}function jc(){re(()=>{An(),Ot()},[]);const e=We.value||Rn.value||!li.value||!si.value,n=Object.values(Wi.value).filter(Boolean).length,t=Ce.value.length,i=It.value.filter(a=>!Ce.value.includes(a)).length;return r("div",{class:"ac-start",children:[r("section",{class:"ac-start__card ac-start__card--primary",children:[r("h2",{class:"ac-start__title",children:"Recommended setup"}),r("p",{class:"ac-start__desc",children:"The fastest path — we pre-select everything we can detect and you confirm one review screen before anything is written."}),r("ul",{class:"ac-start__facts",children:[r("li",{children:e?"Detecting your AI tools…":n===0?"No AI tools detected — pick them on the review screen.":`${n} AI tool${n===1?"":"s"} detected and pre-selected.`}),r("li",{children:e?"Detecting capability packs…":t>0?`${t} installed pack${t===1?"":"s"} kept${i>0?`, ${i} more auto-detected`:""}.`:i>0?`${i} capability pack${i===1?"":"s"} auto-detected.`:"No packs pre-selected — add them any time later."}),r("li",{children:"Settings keep their current values (or safe defaults on a first run)."}),r("li",{children:"Nothing is written until you confirm the review screen."})]}),r("button",{type:"button",class:"ac-button ac-button--primary ac-start__cta",disabled:e,onClick:()=>{Uc()},children:e?"Detecting…":"Use recommended setup"})]}),r("section",{class:"ac-start__card",children:[r("h2",{class:"ac-start__title",children:"Customize"}),r("p",{class:"ac-start__desc",children:"Walk through every step — tools, roles, packs, behaviour, budgets — and tune each choice yourself."}),r("button",{type:"button",class:"ac-button ac-start__cta",onClick:()=>{Ki.value=!0},children:"Customize step by step"})]})]})}const Bc=["de","en","en-US","en-GB","fr","es","it","nl","pt","pt-BR"];function Wc(){if(Mr.value)return;const e=L.value;if(e===null)return;Mr.value=!0;let n=e;if(e.identity.name.trim()===""){const t=be.value?.systemUser;t!==void 0&&t.trim()!==""&&(n={...n,identity:{...n.identity,name:t}})}if(!ji.value&&typeof navigator<"u"){const t=(navigator.language||"").split("-")[0];t.length>=2&&(n={...n,language:t})}n!==e&&(L.value=n)}function zc(){const e=L.value;if(re(()=>{Wc()},[e]),e===null)return r("p",{children:"Loading…"});const n=t=>{L.value={...t,last_updated:new Date().toISOString().slice(0,10)},Et.value=!1};return r("div",{class:"ac-wizard-step-stub ac-wizard__module-fields",children:[r("p",{children:["Tell the agent who you are. We pre-filled what we could detect — adjust freely. Stored in ",r("code",{children:".agent-user.yml"}),"."]}),r("div",{class:"ac-field",children:[r("label",{class:"ac-field__label",for:"welcome-name",children:"Name"}),r("input",{class:"ac-input",id:"welcome-name",type:"text",placeholder:"How should the agent address you?",value:e.identity.name,onInput:t=>n({...e,identity:{...e.identity,name:t.currentTarget.value}})})]}),r("div",{class:"ac-field",children:[r("label",{class:"ac-field__label",for:"welcome-lang",children:"Language"}),r("input",{class:"ac-input",id:"welcome-lang",type:"text",list:"welcome-lang-list",placeholder:"BCP-47 code, e.g. de, en, en-US",value:e.language,onInput:t=>n({...e,language:t.currentTarget.value})}),r("datalist",{id:"welcome-lang-list",children:Bc.map(t=>r("option",{value:t},t))})]})]})}function Kc(){const e=ie.value,n=Wi.value;return r("div",{class:"ac-wizard-step-stub",children:[r("p",{children:"Pick the AI tools you use. Tools detected on this machine are pre-selected on first run. The installer wires each selected tool's surface (skills, rules, commands) on apply; you can change this list later by re-running the wizard."}),r("ul",{class:"ac-wizard__tool-list",children:Cc.map(t=>{const i=n[t.id]===!0;return r("li",{class:"ac-wizard__tool-row",children:[r("label",{class:"ac-wizard__tool-label",children:[r("input",{type:"checkbox",checked:e[t.id]??!1,onChange:a=>{const l=a.currentTarget.checked;ie.value={...e,[t.id]:l}}})," ",t.label]}),r("span",{class:`ac-badge ${i?"ac-badge--installed":"ac-badge--missing"}`,title:i?"Detected on this machine":"Not detected on this machine",children:i?"installed":"not installed"})]},t.id)})})]})}function Hc(){if(We.value)return r("p",{children:"Loading roles…"});if(pe.value!==null)return r("div",{class:"ac-wizard-step-stub",children:r("p",{class:"ac-banner ac-banner--error",children:["Discovery failed: ",pe.value]})});const e=ne.value,n=Cn.value,t=(i,a)=>{Va.value=!0,ne.value={...ne.value,[i]:a},$t()};return r("div",{class:"ac-wizard-step-stub",children:[r("p",{children:["Pick the areas you work in. We use them to recommend capability packs on the next step, and they become your roles in",r("code",{children:" .agent-user.yml"}),"."]}),n.length===0?r("p",{children:r("em",{children:"No roles available in the manifest."})}):r("div",{class:"ac-wizard__pack-grid",children:n.map(i=>r("section",{class:"ac-pack-tile",children:[r("label",{class:"ac-pack-tile__head",children:[r("input",{type:"checkbox",checked:e[i.id]??!1,onChange:a=>{t(i.id,a.currentTarget.checked)}}),r("span",{class:"ac-pack-tile__title",children:i.label})]}),(i.example_roles??[]).length>0?r("p",{class:"ac-pack-tile__role",children:["e.g. ",(i.example_roles??[]).join(", ")]}):null,i.description!==""?r("p",{class:"ac-pack-tile__desc",children:i.description}):null]},i.id))})]})}function Yc(){if(We.value)return r("p",{children:"Loading discovery manifest…"});if(pe.value!==null)return r("div",{class:"ac-wizard-step-stub",children:[r("p",{class:"ac-banner ac-banner--error",children:["Discovery failed: ",pe.value]}),r("p",{children:"The manifest endpoint is gated on extended-mode. Re-run the server with extended steps enabled to populate this list."})]});const e=oe.value,n=new Set(It.value),t=new Set(Ce.value),i=p=>t.has(p)?r("span",{class:"ac-badge ac-badge--installed",children:"installed"}):n.has(p)?r("span",{class:"ac-badge ac-badge--detected",children:"auto-detected"}):null,a=new Map(Cn.value.map(p=>[p.id,p.label])),l=ne.value,o=p=>{const v=(p??[]).filter(_=>_!=="agent-config-maintainer");return v.length===0?null:r("span",{class:"ac-pack-tile__ws",children:v.map(_=>r("span",{class:`ac-badge ac-badge--ws${l[_]===!0?" ac-badge--ws-active":""}`,title:l[_]===!0?"Matches a role you picked":"Workspace / area",children:a.get(_)??_},_))})},s=xt.value.filter(p=>p.id!=="engineering-base"),u=new Map;for(const p of s)if(p.cluster!==void 0){const v=u.get(p.cluster)??[];v.push(p),u.set(p.cluster,v)}const c=new Set(s.filter(p=>p.cluster!==void 0).map(p=>p.id)),d=s.filter(p=>!c.has(p.id)),g=(p,v)=>{hi.value=!0,oe.value={...oe.value,[p]:v}},f=(p,v)=>{hi.value=!0;const _={...oe.value,[p]:v};if(v)for(const k of u.get(p)??[])_[k.id]===void 0&&(_[k.id]=!0);oe.value=_};return r("div",{class:"ac-wizard-step-stub",children:[r("p",{children:"Pick the capability packs to install. Auto-detected packs are pre-selected; engineering hygiene is included automatically when a pack needs it. A language tile expands to its frameworks — turn the language off to skip them all."}),d.length===0?r("p",{children:r("em",{children:"No packs available in the manifest."})}):r("div",{class:"ac-wizard__pack-grid",children:d.map(p=>{const v=u.get(p.id)??[],_=v.length>0,k=e[p.id]??!1;return r("section",{class:"ac-pack-tile",children:[r("label",{class:"ac-pack-tile__head",children:[r("input",{type:"checkbox",checked:k,onChange:w=>{const b=w.currentTarget.checked;_?f(p.id,b):g(p.id,b)}}),r("span",{class:"ac-pack-tile__title",children:p.label}),i(p.id)]}),o(p.workspaces),p.description!==""?r("p",{class:"ac-pack-tile__desc",children:p.description}):null,_?r("fieldset",{class:"ac-pack-tile__children",disabled:!k,children:v.map(w=>r("label",{class:"ac-pack-tile__child",children:[r("input",{type:"checkbox",checked:e[w.id]??!1,disabled:!k,onChange:b=>{g(w.id,b.currentTarget.checked)}}),r("span",{children:w.label}),i(w.id)]},w.id))}):null]},p.id)})})]})}function qc(){const e=Ga.value,n=Qa.value,t=Ja.value,i=Xa.value,a=Za.value,l=e===null?r("span",{class:"ac-badge ac-badge--missing",children:"detecting…"}):e?r("span",{class:"ac-badge ac-badge--installed",children:["installed",i!==null?` (v${i})`:""]}):n===!0?r("span",{class:"ac-badge ac-badge--missing",children:t==="unknown-rtk"?"different tool":"unverified"}):r("span",{class:"ac-badge ac-badge--missing",children:"not installed"});return r("div",{class:"ac-rtk-row",children:[r("div",{class:"ac-rtk-row__head",children:[r("span",{class:"ac-rtk-row__label",children:["rtk ",r("small",{children:"(Rust Token Killer — third-party, Apache-2.0)"})]}),l]}),n===!0&&t==="unknown-rtk"?r("div",{class:"ac-rtk-row__install",children:[r("p",{class:"ac-field__description",children:["A binary named ",r("code",{children:"rtk"})," is on PATH, but it is not Rust Token Killer — two unrelated projects share the name (the other is Rust Type Kit). The token-saving integration stays off. See the upstream name-collision guidance:"]}),r("a",{class:"ac-button",href:`${ui.value}/blob/master/INSTALL.md`,target:"_blank",rel:"noreferrer noopener",children:"Open rtk install guide"})]}):null,n===!0&&t==="unverified"?r("p",{class:"ac-field__description",children:["rtk found but the identity check failed — verify manually with ",r("code",{children:"rtk gain"})," (Rust Token Killer renders a token-savings dashboard; the colliding Rust Type Kit does not)."]}):null,n===!1?r("div",{class:"ac-rtk-row__install",children:[r("p",{class:"ac-field__description",children:"rtk wraps verbose CLI output — upstream reports 60–90% token savings (their estimate). Install it, then re-open the wizard to pick up detection:"}),a!==null?r(F,{children:[a.recommendedLabel!==void 0?r("p",{class:"ac-field__description",children:[a.recommendedLabel,":"]}):null,r("code",{class:"ac-rtk-row__cmd",children:a.recommended}),a.manual!==void 0?r(F,{children:[r("p",{class:"ac-field__description",children:[a.manualLabel??"Manual",":"]}),r("code",{class:"ac-rtk-row__cmd",children:a.manual})]}):null,a.note!==void 0?r("p",{class:"ac-field__description",children:a.note}):null]}):ci.value!==null?r("code",{class:"ac-rtk-row__cmd",children:ci.value}):null,r("a",{class:"ac-button",href:ui.value,target:"_blank",rel:"noreferrer noopener",children:"Open rtk repo"})]}):null]})}async function Vc(){try{await y("/api/v1/wizard/dismiss-recommendation",{method:"POST",body:{id:"agent-switch"}})}catch(e){N.value={message:e instanceof Error?e.message:String(e),tone:"error"};return}zi.value=!0}function Gc(){return!di.value||el.value!==!1||zi.value?null:r("div",{class:"ac-rtk-row",children:[r("div",{class:"ac-rtk-row__head",children:[r("span",{class:"ac-rtk-row__label",children:["agent-switch ",r("small",{children:"(third-party, MIT)"})]}),r("span",{class:"ac-badge ac-badge--missing",children:"not installed"})]}),r("div",{class:"ac-rtk-row__install",children:[r("p",{class:"ac-field__description",children:["agent-switch isolates multiple agent accounts into per-account profiles (",r("code",{children:"CLAUDE_CONFIG_DIR"}),") so switching accounts never requires a re-login. Free and MIT-licensed."]}),fi.value!==null?r("code",{class:"ac-rtk-row__cmd",children:fi.value}):null,r("a",{class:"ac-button",href:`https://github.com/${nl.value}`,target:"_blank",rel:"noreferrer noopener",children:"Open agent-switch repo"}),r("button",{type:"button",class:"ac-button ac-button--small",onClick:()=>{Vc()},children:"Don't show again"})]})]})}function Qc(){const e=At(Te.value,{extended:B.value});if(B.value&&ze.value==="install"&&e.id==="identity"&&!Fn.value)return r(yc,{});if(e.kind==="form"){const t=uc(Ui.value,e.paths??[]);return r(F,{children:[e.id==="identity"?r(qc,{}):null,e.id==="identity"?r(Gc,{}):null,r(Ql,{schema:t,values:H.value,errors:Be.value,onChange:i=>{H.value=i}})]})}return e.kind==="userMd"?!ai.value||L.value===null?r("p",{children:"Loading .agent-user.yml…"}):r(eo,{value:L.value,errors:Be.value,hideRole:B.value&&ze.value==="install",hideIdentityBasics:B.value&&ze.value==="install",onChange:t=>{L.value=t,Et.value=!1}}):e.kind==="welcome"?r(zc,{}):e.kind==="aiTools"?r(Kc,{}):e.kind==="roles"?r(Hc,{}):e.kind==="packs"?r(Yc,{}):r(_c,{steps:il(),currentIndex:Te.value,changes:Nt.value,errors:Be.value,userMdChanged:ct(),userMdAction:ji.value?"replace":"create",loading:nt.value,onJump:t=>{Re(t)},selectedToolsCount:Object.values(ie.value).filter(Boolean).length,selectedPacksCount:Object.values(oe.value).filter(Boolean).length,packRemovals:mi(),removalsConfirmed:oi.value,onConfirmRemovals:t=>{oi.value=t},selectedToolIds:Object.entries(ie.value).filter(([,t])=>t).map(([t])=>t),packAdditions:B.value?Lt().filter(t=>t!=="engineering-base"&&!Ce.value.includes(t)):[]})}function mi(){return B.value?cc(Ce.value,Lt()):[]}function Dr({path:e}){if(re(()=>{$c()},[]),!za.value||Ui.value===null)return r("div",{class:"ac-page",children:[r("h1",{children:"Setup wizard"}),on.value!==null?r("p",{class:"ac-banner ac-banner--error",children:on.value}):r("p",{children:"Loading…"})]});const n=Te.value,t=Ve(),i=At(n,{extended:B.value}),a=n===t-1,l=i.kind==="aiTools"&&Object.values(ie.value).filter(Boolean).length===0||i.kind==="roles"&&Object.values(ne.value).filter(Boolean).length===0||i.kind==="packs"&&Lt().length===0,o=B.value&&ze.value==="install"&&i.id==="identity"&&!Fn.value,s=st.value,u=s!==null&&!tl.value,c=pi.value,d=c!==null&&c.present&&!vi.value,g=B.value&&ze.value==="install"&&n===0&&!Ki.value&&!Pe.value;return d?r("div",{class:"ac-page",children:r(bc,{sourcePath:c.path,backupTarget:c.backupTarget,version:c.version,busy:gi.value,error:_i.value,onBackupAndProceed:()=>{Lc()},onAbort:()=>{N.value={tone:"info",message:"Aborted. Uninstall v3 manually, then re-run `agent-config install`."},vi.value=!0}})}):g?r("div",{class:"ac-page",children:[r("header",{class:"ac-page__header",children:r("h1",{children:"Set up agent-config"})}),N.value!==null?r("p",{class:`ac-banner${N.value.tone==="error"?" ac-banner--error":""}`,children:N.value.message}):null,r(jc,{})]}):r("div",{class:"ac-page",children:[r(fc,{step:i,index:n,total:t}),u?r(mc,{abortedAt:s.abortedAt,abortNote:s.abortNote,writesSinceRollback:s.writesSinceRollback,busy:et.value,onResume:()=>{Ht("resume")},onRollback:()=>{Ht("rollback")},onIgnore:()=>{Ht("ignore")}}):null,N.value!==null&&!(Pe.value&&a&&N.value.tone==="success")?r("p",{class:`ac-banner${N.value.tone==="error"?" ac-banner--error":""}`,children:N.value.message}):null,r("div",{class:"ac-wizard__step",children:Pe.value&&a?r(Sc,{message:N.value?.tone==="success"?N.value.message:null}):r(Qc,{})}),l?r("p",{class:"ac-wizard__hint",children:i.kind==="aiTools"?"Select at least one AI tool to continue.":i.kind==="roles"?"Select at least one role to continue.":"Select at least one capability pack to continue."}):null,r(hc,{canGoPrev:n>0,canGoNext:!a&&!l,canSkip:o||i.kind==="userMd",skipLabel:o?"Finish install here":"Skip",isLast:a,busy:et.value||nt.value,canFinish:(Nt.value.length>0||ct()||mi().length>0||B.value&&Object.values(ie.value).some(Boolean))&&(mi().length===0||oi.value),completed:Pe.value,onPrev:()=>{Re(n-1)},onNext:()=>{if(o){Fn.value=!0;return}Re(n+1)},onSkip:()=>{if(o){Fn.value=!0,Re(Ve()-1);return}Et.value=!0,Re(n+1)},onFinish:()=>{Dc()}})]})}const Jc=new Set(["profile.id","rule_loading_tier","discipline_profile","personal.ide","personal.open_edited_files","personal.autonomy","personal.minimal_output","personal.play_by_play","personal.pr_comment_bot_icon","personal.pr_progress_comments","cost.budgets.daily","cost.budgets.weekly","cost.budgets.monthly","cost.enforcement","model.auto_switch","tokens.rich_skills","roadmap.quality_cadence","roadmap.dashboard_regen_cadence","quality.local_auto_run","memory.review_threshold","memory.redact_patterns","memory.cadence","chat_history.enabled","update_check.enabled","legal_review_prep.acknowledged"]);function Ur(e){return Jc.has(e)}function Xc(e,n){return JSON.stringify(e??null)===JSON.stringify(n??null)}function ol(e,n){if(e.kind==="enum_removed"){const t=new Set(e.values??[]);return n!==void 0&&t.has(n)?"must_fix":"info"}return e.kind==="type_changed"?"must_fix":e.kind==="default_changed"?n===void 0||Xc(n,e.old?.default)?"adopt":"review":e.kind==="added"&&e.new?.default===void 0?"must_fix":"info"}const yi=h(!0),ut=h(null),bi=h(!1),Pt=h(null),Ge=h({}),ki=h(0),Ae=h({}),se=h(null),te=h(!1),vn=h(!1);function ve(e){return`${e.key}:${e.kind}`}async function Zc(){yi.value=!0,ut.value=null,bi.value=!1,vn.value=!1;try{const e=await y("/api/v1/settings/changes"),n=await y("/api/v1/settings");Pt.value=e.delta,Ge.value=n.values,ki.value=n.lastModified,eu(e.delta,n.values)}catch(e){e instanceof I&&e.status===404?bi.value=!0:ut.value=e instanceof Error?e.message:String(e)}finally{yi.value=!1}}function eu(e,n){const t={};for(const i of e.changes){const a=ol(i,Tn(n,i.key.split(".")));a==="adopt"?t[ve(i)]={mode:"adopt"}:a==="review"?t[ve(i)]={mode:"keep"}:a==="must_fix"&&(t[ve(i)]={mode:null})}Ae.value=t}function Vi(e){return ol(e,Tn(Ge.value,e.key.split(".")))}function sn(e,n){Ae.value={...Ae.value,[e]:n}}function Gi(){const e=Pt.value;return e===null?[]:e.changes.filter(n=>{if(Vi(n)!=="must_fix")return!1;const t=Ae.value[ve(n)];return t===void 0||t.mode===null||t.mode==="custom"&&(t.value===void 0||t.value==="")})}function nu(){const e=Pt.value;let n=Ge.value;if(e===null)return n;for(const t of e.changes){const i=Ae.value[ve(t)];if(i===void 0||i.mode===null||i.mode==="keep")continue;const a=t.key.split(".");i.mode==="adopt"&&t.new?.default!==void 0?n=pn(n,a,t.new.default):i.mode==="custom"&&i.value!==void 0&&(n=pn(n,a,i.value))}return n}async function tu(){if(te.value)return;const e=Gi();if(e.length>0){se.value=`Resolve the ${e.length} “Must fix” item${e.length===1?"":"s"} first.`;return}te.value=!0,se.value=null;try{const n=nu();if(JSON.stringify(n)!==JSON.stringify(Ge.value)){const t=await y("/api/v1/settings",{method:"PUT",headers:{"If-Unmodified-Since":String(ki.value)},body:{values:n}});Ge.value=n,ki.value=t.lastModified}await y("/api/v1/settings/changes/ack",{method:"POST"}),vn.value=!0}catch(n){n instanceof I?se.value=K(n.body.error??{code:"UNKNOWN",message:n.message}):se.value=n instanceof Error?n.message:String(n)}finally{te.value=!1}}async function iu(){if(te.value)return;if(Gi().length>0){se.value="Cannot dismiss — “Must fix” items would leave invalid values in place.";return}te.value=!0;try{await y("/api/v1/settings/changes/ack",{method:"POST"}),vn.value=!0}catch(n){se.value=n instanceof Error?n.message:String(n)}finally{te.value=!1}}function ae(e){return e===void 0?"—":typeof e=="string"?e:JSON.stringify(e)}function Yt({change:e,id:n}){const t=e.new,a=Ae.value[n]?.value;return t?.enum!==void 0?r("select",{class:"ac-input","aria-label":`New value for ${e.key}`,value:a===void 0?"":String(a),onChange:l=>{const o=l.currentTarget.value;sn(n,{mode:"custom",value:o})},children:[r("option",{value:"",disabled:!0,children:"Choose a value…"}),t.enum.map(l=>r("option",{value:String(l),children:String(l)},String(l)))]}):t?.type==="boolean"?r("select",{class:"ac-input","aria-label":`New value for ${e.key}`,value:a===void 0?"":String(a),onChange:l=>{sn(n,{mode:"custom",value:l.currentTarget.value==="true"})},children:[r("option",{value:"",disabled:!0,children:"Choose…"}),r("option",{value:"true",children:"true"}),r("option",{value:"false",children:"false"})]}):r("input",{class:"ac-input",type:t?.type==="number"||t?.type==="integer"?"number":"text","aria-label":`New value for ${e.key}`,value:a===void 0?"":String(a),onInput:l=>{const o=l.currentTarget.value,s=t?.type==="number"||t?.type==="integer"?Number(o):o;sn(n,{mode:"custom",value:s})}})}function ru({change:e}){const n=Vi(e),t=ve(e),i=Ae.value[t],a=Tn(Ge.value,e.key.split("."));return r("li",{class:`ac-change-card ac-change-card--${n}`,"data-key":e.key,"data-kind":e.kind,children:[r("div",{class:"ac-change-card__head",children:[r("code",{class:"ac-change-card__key",children:e.key}),r("span",{class:`ac-change-card__badge ac-change-card__badge--${n}`,children:n==="must_fix"?"Must fix":n==="adopt"?"New default":n==="review"?"Review":"Info"})]}),e.new?.description!==void 0?r("p",{class:"ac-change-card__desc",children:e.new.description}):null,e.kind==="default_changed"?r(F,{children:[r("p",{class:"ac-change-card__detail",children:["Default changed: ",r("code",{children:ae(e.old?.default)})," → ",r("code",{children:ae(e.new?.default)}),n==="review"?r(F,{children:[" · your value: ",r("code",{children:ae(a)})]}):null]}),r("div",{class:"ac-change-card__choices",role:"radiogroup","aria-label":`Resolution for ${e.key}`,children:[r("label",{class:"ac-change-card__choice",children:[r("input",{type:"radio",name:t,checked:i?.mode==="adopt",onChange:()=>{sn(t,{mode:"adopt"})}}),r("span",{children:["Adopt new default (",r("code",{children:ae(e.new?.default)}),")"]})]}),r("label",{class:"ac-change-card__choice",children:[r("input",{type:"radio",name:t,checked:i?.mode==="keep",onChange:()=>{sn(t,{mode:"keep"})}}),r("span",{children:["Keep current (",r("code",{children:ae(a??e.old?.default)}),")"]})]})]})]}):null,e.kind==="enum_removed"?n==="must_fix"?r(F,{children:[r("p",{class:"ac-change-card__detail",children:["Your value ",r("code",{children:ae(a)})," is no longer valid — removed option",(e.values?.length??0)===1?"":"s",": ",r("code",{children:(e.values??[]).join(", ")}),". Pick a replacement:"]}),r(Yt,{change:e,id:t})]}):r("p",{class:"ac-change-card__detail",children:["Removed option",(e.values?.length??0)===1?"":"s",": ",r("code",{children:(e.values??[]).join(", ")})," — your value ",r("code",{children:ae(a??e.new?.default)})," is unaffected."]}):null,e.kind==="enum_added"?r("p",{class:"ac-change-card__detail",children:["New option",(e.values?.length??0)===1?"":"s"," available: ",r("code",{children:(e.values??[]).join(", ")})]}):null,e.kind==="added"?n==="must_fix"?r(F,{children:[r("p",{class:"ac-change-card__detail",children:"New setting without a shipped default — define a value:"}),r(Yt,{change:e,id:t})]}):r("p",{class:"ac-change-card__detail",children:["New setting · default: ",r("code",{children:ae(e.new?.default)}),e.new?.enum!==void 0?r(F,{children:[" · options: ",r("code",{children:e.new.enum.join(", ")})]}):null]}):null,e.kind==="removed"?r("p",{class:"ac-change-card__detail",children:"This setting no longer exists. Your stored value is kept in place and ignored (nothing is deleted)."}):null,e.kind==="type_changed"?r(F,{children:[r("p",{class:"ac-change-card__detail",children:["Type changed: ",r("code",{children:e.old?.type})," → ",r("code",{children:e.new?.type}),". Define a new value:"]}),r(Yt,{change:e,id:t})]}):null]})}function au(e){const n=new Map;for(const c of e.changes){const d=Vi(c);n.set(d,[...n.get(d)??[],c])}const t=[],i=n.get("must_fix")??[];i.length>0&&t.push({title:"Must fix",hint:"These stored values are invalid after the upgrade — saving is blocked until each has a valid value.",changes:i});const a=[...n.get("adopt")??[],...n.get("review")??[]];a.length>0&&t.push({title:"Changed defaults",hint:"Values you never customized are preselected to adopt the new default; customized values are kept unless you choose otherwise.",changes:a});const l=n.get("info")??[],o=l.filter(c=>c.kind==="added"),s=l.filter(c=>c.kind==="enum_added"),u=l.filter(c=>c.kind!=="added"&&c.kind!=="enum_added");return o.length>0&&t.push({title:"New settings",changes:o}),s.length>0&&t.push({title:"New options",changes:s}),u.length>0&&t.push({title:"Removed / other",changes:u}),t}function lu(){if(re(()=>{Zc()},[]),yi.value)return r("div",{class:"ac-page",children:[r("h1",{children:"Settings changes"}),r("p",{children:"Loading…"})]});if(ut.value!==null)return r("div",{class:"ac-page",children:[r("h1",{children:"Settings changes"}),r("p",{class:"ac-banner ac-banner--error",children:ut.value})]});if(vn.value||bi.value)return r("div",{class:"ac-page ac-settings-changes",children:[r("h1",{children:"Settings changes"}),r("p",{class:"ac-banner",children:vn.value?"Review complete — all changes resolved.":"Nothing to review — your settings are up to date."}),r("button",{type:"button",class:"ac-button",onClick:()=>bt("/settings"),children:"Back to Settings"})]});const e=Pt.value;if(e===null)return r("div",{class:"ac-page",children:r("h1",{children:"Settings changes"})});const n=au(e),t=Gi().length;return r("div",{class:"ac-page ac-settings-changes",children:[r("header",{class:"ac-page__header",children:[r("h1",{children:"Settings changes"}),r("p",{class:"ac-page__lede",children:["The upgrade ",r("code",{children:e.oldVersion})," → ",r("code",{children:e.newVersion})," changed the available settings. Review below — nothing was changed automatically."]})]}),se.value!==null?r("p",{class:"ac-banner ac-banner--error",role:"alert",children:se.value}):null,n.map(i=>r("section",{class:"ac-settings-changes__group",children:[r("h2",{children:[i.title," ",r("span",{class:"ac-settings-changes__count",children:["(",i.changes.length,")"]})]}),i.hint!==void 0?r("p",{class:"ac-settings-changes__hint",children:i.hint}):null,r("ul",{class:"ac-settings-changes__list",children:i.changes.map(a=>r(ru,{change:a},ve(a)))})]},i.title)),r("div",{class:"ac-form__actions",children:[r("button",{type:"button",class:"ac-button",disabled:te.value,onClick:()=>{iu()},children:"Dismiss (keep everything)"}),r("button",{type:"button",class:"ac-button ac-button--primary",disabled:te.value||t>0,title:t>0?`${t} “Must fix” item${t===1?"":"s"} unresolved`:void 0,onClick:()=>{tu()},children:te.value?"Saving…":"Apply & finish review"})]})]})}const Le=h(null);function ou(){return re(()=>{(async()=>{try{const e=await y("/api/v1/settings/changes");Le.value=e.delta.changes.length}catch{Le.value=null}})()},[]),Le.value===null||Le.value===0?null:r("div",{class:"ac-banner ac-banner--pending",role:"status",children:[r("span",{children:["An upgrade changed ",Le.value," setting",Le.value===1?"":"s"," — review recommended."]}),r("button",{type:"button",class:"ac-button ac-button--small",onClick:()=>bt("/settings/changes"),children:"Review changes"})]})}const wi=h(!1),dt=h(null),G=h({}),ft=h(null),gn=h(0),_n=h({}),Z=h(null),Ee=h(!1),ge=h(null),mn=h(null),Mn=h(""),$e=h(!1),Dn=h({}),Un=h({global:new Set,project:new Set});function jr(e){if("$ref"in e&&e.$ref!==void 0&&"definitions"in e&&e.definitions!==void 0){const n=e.$ref.replace("#/definitions/",""),t=e.definitions[n];if(t!==void 0)return t}return e}async function Br(){dt.value=null;try{const e=await y("/api/v1/settings");G.value=e.values,ft.value=jr(e.schema),gn.value=e.lastModified,Un.value={global:new Set(e.sources?.global??[]),project:new Set(e.sources?.project??[])},wi.value=!0}catch(e){if(e instanceof I&&e.status===404&&e.body.error?.code==="NOT_FOUND"){const n=e.body;if(n.defaults!==void 0&&n.schema!==void 0){G.value=n.defaults,ft.value=jr(n.schema),gn.value=n.lastModified??0,wi.value=!0;return}}dt.value=e instanceof Error?e.message:String(e)}}async function su(){if(!Ee.value){Z.value=null,_n.value={};try{const e=await y("/api/v1/settings/diff",{method:"POST",body:{values:G.value,ifUnmodifiedSince:gn.value}});if(e.changes.length===0){Z.value="No changes to save.";return}ge.value=e.changes}catch(e){e instanceof I?(_n.value=kt(e.body.error??{message:e.message}),Z.value=K(e.body.error??{code:"UNKNOWN",message:e.message})):Z.value=e instanceof Error?e.message:String(e)}}}async function sl(e=!1){Ee.value=!0;try{const n=await y("/api/v1/settings",{method:"PUT",headers:{"If-Unmodified-Since":String(gn.value)},body:e?{values:G.value,confirmSharedWrite:!0}:{values:G.value}});gn.value=n.lastModified,ge.value=null,mn.value=null,Z.value=`Saved (${n.writtenPaths.join(", ")}).`}catch(n){if(n instanceof I){const t=n.body;if(n.status===409&&t.error==="shared-write"){ge.value=null,mn.value={sharedPath:typeof t.sharedPath=="string"?t.sharedPath:"",message:typeof t.message=="string"?t.message:"This write affects a shared agent-switch profile."};return}const i=n.body.error??{code:"UNKNOWN",message:n.message};_n.value=kt(i),Z.value=K(i),ge.value=null;const a=Object.keys(_n.value)[0];a!==void 0&&queueMicrotask(()=>{const l=document.getElementById(a);l!==null&&l.focus()})}else Z.value=n instanceof Error?n.message:String(n)}finally{Ee.value=!1}}function Qi(e){if(e.defaultValue===void 0)return!1;const n=Tn(G.value,e.path);return n===void 0?!1:JSON.stringify(n)!==JSON.stringify(e.defaultValue)}function cu(e,n){const t=Qi(n),i=Un.value.project.has(e)?"project":Un.value.global.has(e)&&Un.value.project.size>0?"global":void 0;return{modified:t,onReset:t&&n.defaultValue!==void 0?()=>{G.value=pn(G.value,n.path,n.defaultValue)}:void 0,sourceLabel:i}}function uu(e,n){const t=n.toLowerCase();return e.path.join(".").toLowerCase().includes(t)||e.label.toLowerCase().includes(t)||(e.description??"").toLowerCase().includes(t)}function du(e){const n=Mn.value.trim(),t=$e.value,i=e.path.join("."),a=Dn.value[i]===!0;let l=e.fields.filter(c=>c.kind!=="unsupported");if(n!==""&&(l=l.filter(c=>uu(c,n))),t&&(l=l.filter(c=>Qi(c))),n!==""||t)return l.length===0?null:{section:e,visible:l,hiddenAdvancedCount:0,expanded:a};const o=l.filter(c=>Ur(c.path.join("."))),s=l.filter(c=>!Ur(c.path.join("."))),u=a?[...o,...s]:o;return u.length===0&&s.length===0?null:{section:e,visible:u,hiddenAdvancedCount:a?0:s.length,expanded:a}}function fu(e){Dn.value={...Dn.value,[e]:Dn.value[e]!==!0}}function hu(){const e=be.value?.agentSwitchProfile;if(e===void 0||e.active!==!0)return null;const n=e.provider!==null&&e.profile!==null?`${e.provider}/${e.profile}`:"an unidentified profile";return r("div",{class:"ac-banner",role:"status",children:r("span",{children:["Running under agent-switch profile ",r("code",{children:n})," — settings shown and saved here are profile-scoped. Switching profiles shows that profile's own settings; nothing is lost."]})})}function pu({block:e}){return r("div",{class:"ac-modal",role:"dialog","aria-modal":"true","aria-labelledby":"shared-write-title",children:r("div",{class:"ac-modal__panel",children:[r("h2",{id:"shared-write-title",children:"Shared write — affects all profiles"}),r("p",{children:e.message}),r("p",{children:r("code",{children:e.sharedPath})}),r("div",{class:"ac-modal__actions",children:[r("button",{type:"button",class:"ac-button",onClick:()=>{mn.value=null},children:"Cancel"}),r("button",{type:"button",class:"ac-button ac-button--primary",disabled:Ee.value,onClick:()=>{sl(!0)},children:Ee.value?"Writing…":"Write (affects all profiles)"})]})]})})}function vu({changes:e}){return r("div",{class:"ac-modal",role:"dialog","aria-modal":"true","aria-labelledby":"diff-title",children:r("div",{class:"ac-modal__panel",children:[r("h2",{id:"diff-title",children:"Confirm changes"}),r("ul",{class:"ac-diff",children:e.map(n=>r("li",{children:[r("code",{children:n.path}),r("span",{class:"ac-diff__before",children:JSON.stringify(n.from)}),r("span",{class:"ac-diff__arrow",children:"→"}),r("span",{class:"ac-diff__after",children:JSON.stringify(n.to)})]},n.path))}),r("div",{class:"ac-modal__actions",children:[r("button",{type:"button",class:"ac-button",onClick:()=>{ge.value=null},children:"Cancel"}),r("button",{type:"button",class:"ac-button ac-button--primary",disabled:Ee.value,onClick:()=>{sl()},children:Ee.value?"Saving…":"Save"})]})]})})}function gu(){if(re(()=>{Br()},[]),!wi.value||ft.value===null)return r("div",{class:"ac-page",children:[r("h1",{children:"Settings"}),dt.value!==null?r("p",{class:"ac-banner ac-banner--error",children:dt.value}):r("p",{children:"Loading…"})]});const e=ka(ft.value),n=e.map(du).filter(a=>a!==null),t=e.flatMap(a=>a.fields).filter(a=>Qi(a)).length,i=Mn.value.trim()!==""||$e.value;return r("div",{class:"ac-page ac-settings-hub",children:[r("header",{class:"ac-page__header",children:[r("h1",{children:"Settings"}),r("nav",{class:"ac-page__nav",children:r("a",{href:"#/settings/user",children:"Edit .agent-user.yml →"})})]}),r(ou,{}),r(hu,{}),r("div",{class:"ac-settings-hub__toolbar",role:"search",children:[r("input",{class:"ac-input ac-settings-hub__search",type:"search",placeholder:"Search all settings (basic and advanced)…",value:Mn.value,onInput:a=>{Mn.value=a.currentTarget.value}}),r("button",{type:"button",class:`ac-chip-toggle${$e.value?" ac-chip-toggle--active":""}`,"aria-pressed":$e.value,onClick:()=>{$e.value=!$e.value},children:["@modified",t>0?` (${t})`:""]})]}),Z.value!==null?r("p",{class:"ac-banner",children:Z.value}):null,r("form",{class:"ac-form",onSubmit:a=>a.preventDefault(),children:[n.length===0?r("p",{class:"ac-settings-hub__empty",children:"No settings match."}):n.map(a=>{const l=a.section.path.join(".");return r(wa,{section:{...a.section,fields:a.visible},values:G.value,errors:_n.value,onChange:o=>{G.value=o},decorate:cu,footer:!i&&(a.hiddenAdvancedCount>0||a.expanded)?r("button",{type:"button",class:"ac-settings-hub__disclosure","aria-expanded":a.expanded,onClick:()=>{fu(l)},children:a.expanded?"Hide advanced settings":`Show ${a.hiddenAdvancedCount} advanced setting${a.hiddenAdvancedCount===1?"":"s"}`}):void 0},l)}),r("div",{class:"ac-form__actions",children:[r("button",{type:"button",class:"ac-button",onClick:()=>{Br()},children:"Reload"}),r("button",{type:"button",class:"ac-button ac-button--primary",onClick:()=>{su()},children:"Preview & Save"})]})]}),ge.value!==null?r(vu,{changes:ge.value}):null,mn.value!==null?r(pu,{block:mn.value}):null]})}const ht=h(!1),Ke=h(null);async function _u(){tt.value=!0,it.value=null;try{const e=await y("/api/v1/modules/detect");Bi.value=e.candidates,qa.value=e.project_root;const n={};for(const t of e.candidates)n[t.path]=!0;rt.value=n,at.value=e.proposed_block.enabled,lt.value=e.proposed_block.namespace_template??"",ot.value=e.proposed_block.agent_folder??"agents"}catch(e){it.value=e instanceof I?K(e.body.error??{code:"UNKNOWN",message:e.message}):e instanceof Error?e.message:String(e)}finally{tt.value=!1,Tc.value=!0}}function mu(){const e=new Set(Bi.value.map(i=>i.path)),n=rt.value,t=Object.keys(n).filter(i=>n[i]===!0&&e.has(i));return{enabled:at.value,root_paths:t,namespace_template:lt.value,agent_folder:ot.value||"agents"}}async function yu(){ht.value=!0,Ke.value=null;try{const e=await y("/api/v1/modules/apply",{method:"POST",body:mu()});Ke.value={message:e.appliedTo!==null?`Saved project settings to ${e.appliedTo}.`:`Saved project settings to ${e.projectRoot}.`,tone:"success"}}catch(e){const n=e instanceof I?K(e.body.error??{code:"UNKNOWN",message:e.message}):e instanceof Error?e.message:String(e);Ke.value={message:`Could not save project settings: ${n}`,tone:"error"}}finally{ht.value=!1}}function bu(){if(tt.value)return r("p",{children:"Detecting module roots…"});if(it.value!==null)return r("p",{class:"ac-banner ac-banner--error",children:["Module detection failed: ",it.value]});const e=Bi.value,n=rt.value,t=qa.value;return r("div",{class:"ac-section",children:[t!==null?r("p",{class:"ac-section__description",children:["Scanning ",r("code",{children:t}),". Pick which detected roots the agent should treat as modules. These write to",r("code",{children:" .agent-project-settings.yml"})," in this repo only."]}):null,r("label",{children:[r("input",{type:"checkbox",checked:at.value,onChange:i=>{at.value=i.currentTarget.checked}})," ","Enable module discovery (writes ",r("code",{children:"modules.enabled"}),")"]}),e.length===0?r("p",{children:[r("em",{children:"No module roots detected."})," The scan found no common module layouts (Laravel ",r("code",{children:"app/Modules/"}),", Symfony",r("code",{children:" src/Module/"}),", Node ",r("code",{children:"packages/"}),", Python",r("code",{children:" src/"}),", Go ",r("code",{children:"internal/"}),")."]}):r("ul",{style:"list-style: none; padding-left: 0;",children:e.map(i=>r("li",{children:r("label",{children:[r("input",{type:"checkbox",checked:n[i.path]??!1,onChange:a=>{const l=a.currentTarget.checked;rt.value={...n,[i.path]:l}}})," ",r("code",{children:i.path})," — ",i.stack," ",r("small",{children:["(",i.confidence," confidence)"]})]})},i.path))}),r("div",{class:"ac-wizard__module-fields",children:[r("div",{class:"ac-field",children:[r("label",{class:"ac-field__label",for:"ac-modules-namespace",children:"Namespace template"}),r("input",{id:"ac-modules-namespace",class:"ac-input",type:"text",value:lt.value,placeholder:"e.g. App\\\\Modules\\\\{ModuleName}\\\\App",onInput:i=>{lt.value=i.currentTarget.value}}),r("span",{class:"ac-field__description",children:"How a module path maps to its namespace. Leave blank to skip namespacing."})]}),r("div",{class:"ac-field",children:[r("label",{class:"ac-field__label",for:"ac-modules-agent-folder",children:"Agent folder"}),r("input",{id:"ac-modules-agent-folder",class:"ac-input",type:"text",value:ot.value,placeholder:"agents",onInput:i=>{ot.value=i.currentTarget.value}}),r("span",{class:"ac-field__description",children:["Folder name that holds per-module agent docs (default ",r("code",{children:"agents"}),")."]})]})]})]})}function ku(){return re(()=>{_u()},[]),r("div",{class:"ac-page",children:[r("header",{class:"ac-page__header",children:[r("h1",{children:"Project settings"}),r("p",{class:"ac-section__description",children:["Configuration scoped to this repository — written to",r("code",{children:" .agent-project-settings.yml"}),", not the global tree."]})]}),Ke.value!==null?r("p",{class:`ac-banner ac-banner--${Ke.value.tone==="success"?"success":"error"}`,children:Ke.value.message}):null,r("section",{class:"ac-section",children:[r("h2",{class:"ac-section__title",children:"Modules"}),r(bu,{})]}),r("div",{class:"ac-form__actions ac-wizard__nav",children:r("button",{type:"button",class:"ac-button ac-button--primary",disabled:ht.value||tt.value,onClick:()=>{yu()},children:ht.value?"Saving…":"Save project settings"})})]})}const jn=h([]),yn=h([]),Si=h([]),Ti=h([]),pt=h(null),cl=h(!1),cn=h(null),W=h(null),qt=h("plain"),vt=h({}),ul=h([]),Wr={"claude-code":"Claude Code",codex:"Codex",gemini:"Gemini"};function wu(){try{return globalThis.sessionStorage?.getItem("ac-workspace-host")??"claude-code"}catch{return"claude-code"}}const Ji=h(wu());function Su(e){Ji.value=e;try{globalThis.sessionStorage?.setItem("ac-workspace-host",e)}catch{}}const bn=h([]),Q=h(null),Fe=h({}),_e=h(!1),kn=h(null),ue=h(""),un=h(!1),Rt=h(!1),Ci=h(null),me=h(null),wn=h([]),Bn=h(new Set),dl="claude-code",zr=2e3;async function Tu(){cn.value=null;try{const[e,n,t,i,a,l]=await Promise.all([y("/api/v1/workspace/roles"),y("/api/v1/workspace/sessions?limit=20"),y("/api/v1/workspace/knowledge?limit=20"),y("/api/v1/workspace/documents?limit=20"),y("/api/v1/workspace/drive-health").catch(()=>({health:{}})),y("/api/v1/workspace/hosts").catch(()=>({hosts:[]}))]);jn.value=e.roles,yn.value=n.sessions,Si.value=t.chunks,Ti.value=i.documents,vt.value=a.health??{},ul.value=l.hosts??[],cl.value=!0}catch(e){e instanceof I?cn.value=e.body?.error?.message??e.message:cn.value=e instanceof Error?e.message:String(e)}}async function Cu(e,n){try{const t=await y(`/api/v1/workspace/roles/${e}/tasks`);bn.value=t.tasks}catch{bn.value=n}}async function Xi(e){me.value=e,Bn.value=new Set;try{const n=await y(`/api/v1/workspace/sessions/${e}`);wn.value=Array.isArray(n.log)?n.log:[]}catch{wn.value=[]}}async function Au(e){W.value=null,Rt.value=!1,ue.value="",Q.value=null,await Xi(e)}async function fl(e,n,t){W.value=null,_e.value=!0,ue.value="",Rt.value=!1,Ci.value={role:e,task:n,inputs:t};try{const i=await y("/api/v1/workspace/launch",{method:"POST",body:{role:e,task:n,inputs:t,host:Ji.value}});kn.value=i,W.value=hl(i),Q.value=null,await Xi(i.id);const a=await y("/api/v1/workspace/sessions?limit=20");yn.value=a.sessions,await Zi()}catch(i){kn.value=null,i instanceof I?W.value=i.body?.error?.message??i.message:W.value=i instanceof Error?i.message:String(i)}finally{_e.value=!1}}async function Eu(e,n){if(!(n.trim()===""||un.value)){un.value=!0,W.value=null;try{const t=await y(`/api/v1/workspace/sessions/${e}/continue`,{method:"POST",body:{prompt:n}});kn.value=t,W.value=hl(t),t.driven&&(ue.value=""),await Xi(e);const i=await y("/api/v1/workspace/sessions?limit=20");yn.value=i.sessions,await Zi()}catch(t){t instanceof I&&t.status===410?(Rt.value=!0,W.value="Host session expired — start a new conversation."):t instanceof I?W.value=t.body?.error?.message??t.message:W.value=t instanceof Error?t.message:String(t)}finally{un.value=!1}}}async function Zi(){try{const e=await y("/api/v1/workspace/drive-health");vt.value=e.health??{}}catch{}}async function Nu(e){try{await y(`/api/v1/workspace/drive-health/${e}/reset`,{method:"POST"}),await Zi()}catch{}}function hl(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 ${dl} 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 xu({role:e}){const n=pt.value===e.slug;return r("button",{type:"button",class:`ac-workspace__role${n?" ac-workspace__role--active":""}`,"aria-current":n?"true":void 0,"aria-label":`Pick role ${e.display_name}`,onClick:()=>{pt.value=e.slug,W.value=null,kn.value=null,Q.value=null,Fe.value={},bn.value=e.first_tasks,Cu(e.slug,e.first_tasks)},children:[r("span",{class:"ac-workspace__role-name",children:e.display_name}),r("span",{class:"ac-workspace__role-status","data-status":e.status,children:e.status}),r("span",{class:"ac-workspace__role-tagline",children:e.tagline})]})}function Iu({role:e,task:n}){const t=n.inputs??[],i=Fe.value,a=t.some(l=>l.required&&(i[l.name]??"").trim()==="");return r("form",{class:"ac-workspace__task-form",onSubmit:l=>{l.preventDefault(),!a&&!_e.value&&fl(e,n.name,Fe.value)},children:[t.length===0?r("p",{class:"ac-workspace__form-note",children:"No inputs — runs the prompt as-is."}):t.map(l=>r("label",{class:"ac-workspace__field",children:[r("span",{class:"ac-workspace__field-label",children:[l.name,l.required?r("span",{class:"ac-workspace__req","aria-hidden":"true",children:" *"}):null]}),r("textarea",{class:"ac-workspace__field-input",placeholder:l.shape,required:l.required,"aria-label":`${l.name}${l.required?" (required)":""}`,value:i[l.name]??"",onInput:o=>{Fe.value={...Fe.value,[l.name]:o.target.value}}})]},l.name)),r("div",{class:"ac-workspace__form-actions",children:[r("button",{type:"submit",class:"ac-button ac-button--primary",disabled:a||_e.value,children:_e.value?"Running…":"Run task"}),r("button",{type:"button",class:"ac-button",onClick:()=>{Q.value=null},children:"Cancel"})]})]})}function Ou(e){const n=[];for(const t of e){const i=t.data??{};if(t.kind==="launcher.input")i.followup===!0?n.push({kind:"user",text:typeof i.prompt=="string"?i.prompt:""}):n.push({kind:"task",text:typeof i.task=="string"?i.task:""});else if(t.kind==="host.turn"){const a=i.usage,l=a!=null?`${typeof i.model=="string"?i.model:dl} · in ${a.input_tokens??0} / out ${a.output_tokens??0} tokens`:void 0;n.push({kind:"assistant",text:typeof i.text=="string"?i.text:"",meta:l})}else if(t.kind==="host.error"){const a=typeof i.error_kind=="string"?i.error_kind:"error";n.push({kind:"error",text:`${a}: ${typeof i.error=="string"?i.error:""}`})}}return n}function Lu(){if(me.value===null)return null;const e=Ou(wn.value),n=wn.value.some(t=>t.kind==="host.turn");return r("section",{class:"ac-workspace__thread","aria-label":"Conversation thread",children:[r("h2",{class:"ac-workspace__heading",children:"Conversation"}),e.length===0?r("p",{class:"ac-workspace__empty",children:"No turns yet."}):r("ol",{class:"ac-workspace__thread-list",children:e.map((t,i)=>{const a=t.kind==="assistant"&&t.text.length>zr,l=Bn.value.has(i),o=a&&!l?`${t.text.slice(0,zr)}…`:t.text;return r("li",{class:`ac-workspace__thread-block ac-workspace__thread-block--${t.kind}`,children:[r("span",{class:"ac-workspace__thread-role",children:t.kind==="task"?"Task":t.kind==="user"?"You":t.kind==="assistant"?"Host":"Error"}),r("pre",{class:"ac-workspace__thread-text",children:o}),a?r("button",{type:"button",class:"ac-button",onClick:()=>{const s=new Set(Bn.value);s.has(i)?s.delete(i):s.add(i),Bn.value=s},children:l?"Show less":"Show full"}):null,t.meta!=null?r("p",{class:"ac-workspace__turn-meta",children:t.meta}):null]},i)})}),Rt.value?r("div",{class:"ac-workspace__followup-gone",role:"status",children:[r("p",{children:"Host session expired."}),Ci.value!==null?r("button",{type:"button",class:"ac-button ac-button--primary",disabled:_e.value,onClick:()=>{const t=Ci.value;t!==null&&fl(t.role,t.task,t.inputs)},children:_e.value?"Starting…":"Start a new conversation"}):r("p",{children:"Pick a task above to start a new conversation."})]}):n?r("form",{class:"ac-workspace__followup",onSubmit:t=>{t.preventDefault(),me.value!==null&&Eu(me.value,ue.value)},children:[r("label",{class:"ac-workspace__field",children:[r("span",{class:"ac-workspace__field-label",children:"Follow up"}),r("textarea",{class:"ac-workspace__field-input",placeholder:"Continue this conversation — e.g. make it shorter","aria-label":"Follow-up prompt",value:ue.value,onInput:t=>{ue.value=t.target.value}})]}),r("button",{type:"submit",class:"ac-button ac-button--primary",disabled:ue.value.trim()===""||un.value,children:un.value?"Continuing…":"Send follow-up"})]}):null]})}function $u({role:e}){const n=bn.value.length>0?bn.value:e.first_tasks;return r("section",{class:"ac-workspace__tasks","aria-labelledby":"task-heading",children:[r("h2",{id:"task-heading",class:"ac-workspace__heading",children:["First tasks · ",e.display_name]}),n.length===0?r("p",{class:"ac-workspace__empty",children:"No tasks scaffolded yet for this role."}):r("ul",{class:"ac-workspace__task-list",children:n.map(t=>r("li",{class:"ac-workspace__task",children:[r("div",{class:"ac-workspace__task-head",children:[r("span",{class:"ac-workspace__task-name",children:t.name}),r("button",{type:"button",class:"ac-button ac-button--primary","aria-expanded":Q.value===t.name,onClick:()=>{Q.value=Q.value===t.name?null:t.name,Fe.value={},kn.value=null,me.value=null,wn.value=[]},children:Q.value===t.name?"Close":"Start session"})]}),r("p",{class:"ac-workspace__task-intent",children:t.intent}),t.prompt!==""?r("code",{class:"ac-workspace__task-prompt",children:["prompts/",t.prompt]}):null,Q.value===t.name?r(Iu,{role:e.slug,task:t}):null]},t.name))}),e.skills.length>0?r("details",{class:"ac-workspace__skills",children:[r("summary",{children:["Skill shortlist (",e.skills.length,")"]}),r("ul",{class:"ac-workspace__skill-list",children:[e.skills.slice(0,5).map(t=>r("li",{class:"ac-workspace__skill",children:[r("code",{children:t.id})," — ",t.why]},t.id)),e.skills.length>5?r("li",{class:"ac-workspace__skill-more",children:["+ ",e.skills.length-5," more"]}):null]})]}):null]})}function Pu(){return r("section",{class:"ac-workspace__sessions","aria-labelledby":"sessions-heading",children:[r("h2",{id:"sessions-heading",class:"ac-workspace__heading",children:"Recent sessions"}),yn.value.length===0?r("p",{class:"ac-workspace__empty",children:"No sessions yet — pick a role and start one."}):r("ul",{class:"ac-workspace__session-list",children:yn.value.map(e=>r("li",{class:"ac-workspace__session",children:r("button",{type:"button",class:`ac-workspace__session-open${me.value===e.id?" ac-workspace__session-open--active":""}`,"aria-label":`Open session ${e.task}`,"aria-current":me.value===e.id?"true":void 0,onClick:()=>{Au(e.id)},children:[r("span",{class:"ac-workspace__session-id",children:e.id.slice(0,16)}),r("span",{class:"ac-workspace__session-role",children:e.role}),r("span",{class:"ac-workspace__session-task",children:e.task})]})},e.id))})]})}function Ru(){return r("section",{class:"ac-workspace__knowledge","aria-labelledby":"knowledge-heading",children:[r("h2",{id:"knowledge-heading",class:"ac-workspace__heading",children:"Knowledge sources"}),Si.value.length===0?r("p",{class:"ac-workspace__empty",children:["No sources yet. Run ",r("code",{children:"/knowledge:ingest <path>"})," to add documents."]}):r("ol",{class:"ac-workspace__citation-list",children:Si.value.map((e,n)=>r("li",{class:"ac-workspace__citation",children:[r("span",{class:"ac-workspace__citation-marker","aria-label":`Citation ${n+1}`,children:["[",n+1,"]"]}),r("a",{href:`file://${e.source}`,class:"ac-workspace__citation-source",title:"Open source in OS default app",children:e.source.split("/").pop()??e.source}),e.pinned?r("span",{class:"ac-workspace__citation-pin","aria-label":"pinned",children:"★"}):null,r("p",{class:"ac-workspace__citation-excerpt",children:[e.excerpt.slice(0,200),e.excerpt.length>200?"…":""]})]},e.id))})]})}function Fu(){return r("section",{class:"ac-workspace__recent","aria-labelledby":"recent-heading",children:[r("h2",{id:"recent-heading",class:"ac-workspace__heading",children:"Recent documents"}),Ti.value.length===0?r("p",{class:"ac-workspace__empty",children:"No documents yet. Saved drafts land here."}):r("ul",{class:"ac-workspace__doc-list",children:Ti.value.map(e=>r("li",{class:"ac-workspace__doc",children:[r("span",{class:"ac-workspace__doc-type","data-type":e.type,children:e.type}),r("span",{class:"ac-workspace__doc-title",children:e.title}),r("time",{class:"ac-workspace__doc-time",dateTime:e.updated_at,children:e.updated_at.slice(0,10)})]},`${e.type}/${e.slug}`))})]})}function Mu(){const n=Object.values(vt.value).filter(t=>t.killed||t.consecutive_failures>0);return r("section",{class:"ac-workspace__drive-health","aria-labelledby":"drive-health-heading",children:[r("h2",{id:"drive-health-heading",class:"ac-workspace__heading",children:"Host health"}),n.length===0?r("p",{class:"ac-workspace__empty",children:"All hosts healthy."}):r("ul",{class:"ac-workspace__health-list",children:Object.entries(vt.value).filter(([,t])=>t.killed||t.consecutive_failures>0).map(([t,i])=>{const a=i.killed?i.kill_reason==="manual"?"paused (manual)":"paused — auto-recovering":"degraded";return r("li",{class:"ac-workspace__health","data-killed":i.killed?"true":"false",children:[r("span",{class:"ac-workspace__health-host",children:t}),r("span",{class:"ac-workspace__health-state",children:a}),r("span",{class:"ac-workspace__health-meta",children:[i.consecutive_failures," fail streak",i.last_error_kind!=null?` · ${i.last_error_kind}`:""]}),i.killed?r("button",{type:"button",class:"ac-button ac-workspace__health-reset","aria-label":`Reset ${t}`,onClick:()=>{Nu(t)},children:"Reset"}):null]},t)})})]})}function Du(){const e=qt.value;return r("fieldset",{class:"ac-workspace__explain",children:[r("legend",{class:"ac-workspace__heading",children:"Explanation style"}),r("label",{class:"ac-workspace__explain-option",children:[r("input",{type:"radio",name:"explain-mode",value:"plain",checked:e==="plain",onChange:()=>{qt.value="plain"},"aria-label":"Plain language"}),r("span",{children:"Plain language"})]}),r("label",{class:"ac-workspace__explain-option",children:[r("input",{type:"radio",name:"explain-mode",value:"technical",checked:e==="technical",onChange:()=>{qt.value="technical"},"aria-label":"Technical detail"}),r("span",{children:"Technical detail"})]}),r("p",{class:"ac-workspace__explain-hint",children:e==="plain"?"Replies use everyday words. Toggle to see the technical view.":"Replies keep the technical vocabulary. Toggle for the plain view."})]})}function Uu(){const e=ul.value,n=e.length>0?e.map(i=>i.id):Object.keys(Wr),t=new Map(e.map(i=>[i.id,i.cli_present]));return r("label",{class:"ac-workspace__host-picker",children:[r("span",{class:"ac-workspace__host-label",children:"Host"}),r("select",{class:"ac-workspace__host-select","aria-label":"Host agent",value:Ji.value,onChange:i=>{Su(i.target.value)},children:n.map(i=>{const a=t.get(i)!==!1,l=Wr[i]??i;return r("option",{value:i,disabled:!a,children:[l," (",i,")",a?"":" — not installed"]},i)})})]})}function ju(){if(re(()=>{Tu()},[]),cn.value!==null)return r("div",{class:"ac-page ac-page--error",children:[r("h1",{children:"Workspace"}),r("p",{class:"ac-banner ac-banner--error",children:cn.value})]});if(!cl.value)return r("div",{class:"ac-page",children:[r("h1",{children:"Workspace"}),r("p",{children:"Loading…"})]});const e=pt.value!==null?jn.value.find(n=>n.slug===pt.value)??null:null;return r("div",{class:"ac-page ac-workspace",children:[r("header",{class:"ac-page__header",children:[r("h1",{children:"Workspace"}),r("p",{class:"ac-page__subtitle",children:"Pick a role, pick a first task, run it."}),r(Uu,{})]}),W.value!==null?r("p",{class:"ac-banner",role:"status",children:W.value}):null,r("div",{class:"ac-workspace__grid",children:[r("section",{class:"ac-workspace__roles","aria-labelledby":"roles-heading",children:[r("h2",{id:"roles-heading",class:"ac-workspace__heading",children:"Roles"}),jn.value.length===0?r("p",{class:"ac-workspace__empty",children:"No roles installed."}):r("div",{class:"ac-workspace__role-grid",children:jn.value.map(n=>r(xu,{role:n},n.slug))})]}),r("main",{class:"ac-workspace__main","aria-label":"Tasks and sessions",children:[e!==null?r($u,{role:e}):r("p",{class:"ac-workspace__empty",children:"Pick a role on the left to see its first tasks."}),r(Lu,{}),r(Pu,{})]}),r("aside",{class:"ac-workspace__rail","aria-label":"Knowledge and documents",children:[r(Ru,{}),r(Fu,{}),r(Mu,{}),r(Du,{})]})]})]})}const pl="agent-config-theme";function Bu(){return(typeof document<"u"?document.documentElement.getAttribute("data-theme"):null)==="dark"?"dark":"light"}const dn=h(Bu());function Wu(){try{const e=localStorage.getItem(pl);return e==="light"||e==="dark"?e:null}catch{return null}}function zu(){if(typeof window>"u")return null;try{const e=new URLSearchParams(window.location.search).get("theme");return e==="light"||e==="dark"?e:null}catch{return null}}function Ku(){return Wu()===null&&zu()===null}function vl(e){dn.value=e,document.documentElement.setAttribute("data-theme",e)}function Hu(){const e=dn.value==="dark"?"light":"dark";try{localStorage.setItem(pl,e)}catch{}vl(e)}function Yu(){if(typeof window>"u"||typeof window.matchMedia!="function")return;const e=window.matchMedia("(prefers-color-scheme: dark)"),n=()=>{Ku()&&vl(e.matches?"dark":"light")};typeof e.addEventListener=="function"&&e.addEventListener("change",n)}function qu(){return typeof window>"u"?!1:new URLSearchParams(window.location.search).get("embed")==="1"}const Vu=qu(),gl=[{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 _l(e){for(const n of gl)for(const t of n.matches)if(e===t||e.startsWith(`${t}/`))return n.id;return null}function Gu(e){const n=be.value,t=_l(e);return gl.filter(i=>i.id==="project"?n?.projectSurface===!0||t==="project":i.id==="workspace"?n?.devSurfaces===!0||t==="workspace":!0)}function Qu(){const e=Gn.value,n=_l(e);return r("header",{class:"ac-topnav",children:r("div",{class:"ac-topnav__inner",children:[r("div",{class:"ac-topnav__brand",children:[r("h1",{class:"ac-topnav__title",children:"@event4u/agent-config"}),r("p",{class:"ac-topnav__subtitle",children:"Browser Wizard"})]}),r("nav",{class:"ac-topnav__tabs","aria-label":"Surfaces",children:Gu(e).map(t=>r("button",{type:"button",class:`ac-topnav__tab${n===t.id?" ac-topnav__tab--active":""}`,"aria-current":n===t.id?"page":void 0,onClick:()=>bt(t.hashPath),children:t.label},t.id))}),r("button",{type:"button",class:"ac-topnav__theme","aria-label":dn.value==="dark"?"Switch to light theme":"Switch to dark theme",title:dn.value==="dark"?"Switch to light theme":"Switch to dark theme",onClick:()=>{Hu()},children:dn.value==="dark"?"☀":"☾"})]})})}function Ju({path:e}){return r("div",{class:"ac-page ac-page--error",children:[r("h1",{children:"Page not found"}),r("p",{children:["Nothing routed to ",r("code",{children:e}),". Try ",r("a",{href:"#/setup",children:"Setup"}),"."]})]})}function Xu(){const e=be.value;return e===null||e.dryRun!==!0?null:r("div",{class:"ac-dryrun-banner",role:"status","aria-live":"polite",children:[r("strong",{children:"DRY RUN"}),r("span",{children:" · no files will be written. Validation + rendering run normally; commits return a preview."})]})}function Zu(e){return e==="/"||e==="/setup"||e.startsWith("/setup/")?r(Dr,{path:e}):e.startsWith("/wizard")?r(Dr,{path:e}):e==="/settings/changes"?r(lu,{}):e==="/settings"||e.startsWith("/settings/")?r(gu,{}):e==="/project"||e.startsWith("/project/")?r(ku,{}):e==="/workspace"?r(ju,{}):r(Ju,{path:e})}function ed(){return re(()=>{Ul(),Gn.value==="/"&&bt("/setup"),Wl()},[]),r(F,{children:[r(Xu,{}),Vu?null:r(Qu,{}),Zu(Gn.value)]})}const nd=3e4,td=30*6e4;let On=null,Kr=!1;function Hr(e){if(!Kr&&(Kr=!0,!(typeof navigator>"u"||typeof navigator.sendBeacon!="function")))try{navigator.sendBeacon(`/api/v1/shutdown?token=${encodeURIComponent(e)}`)}catch{}}function id(e){if(typeof window>"u")return()=>{};let n=Date.now();const t=()=>{n=Date.now()},i=["pointerdown","keydown","wheel","touchstart"];for(const s of i)window.addEventListener(s,t,{passive:!0});const a=()=>{document.hidden||t()};document.addEventListener("visibilitychange",a);const l=()=>{On!==null&&clearInterval(On),On=null;for(const s of i)window.removeEventListener(s,t);document.removeEventListener("visibilitychange",a),window.removeEventListener("pagehide",o)};On=setInterval(()=>{if(!document.hidden){if(Date.now()-n>td){Hr(e),l();return}y("/api/v1/ping").catch(()=>{})}},nd);function o(){Hr(e)}return window.addEventListener("pagehide",o),l}function rd(){if(typeof window>"u"||typeof window.history?.replaceState!="function")return;const e=new URLSearchParams(window.location.search);if(!e.has("token"))return;e.delete("token");const n=e.toString(),t=window.location.pathname+(n?`?${n}`:"")+window.location.hash;window.history.replaceState(window.history.state,"",t)}function ad(){return new URLSearchParams(window.location.search).get("token")}function ld(){const e=document.getElementById("app");if(e===null)return;const n=ad();if(n===null){e.textContent="agent-config UI · missing token — re-open via `agent-config ui:serve`.";return}jl(n),rd(),id(n),Yu(),e.textContent="",Cl(r(ed,{}),e)}ld();
|
|
29
|
+
//# sourceMappingURL=index-D0jaCRPM.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-D0jaCRPM.js"></script>
|
|
31
31
|
<link rel="stylesheet" crossorigin href="/assets/index-jSfMW8_t.css">
|
|
32
32
|
</head>
|
|
33
33
|
<body>
|
package/docs/MIGRATION.md
CHANGED
|
@@ -17,7 +17,7 @@ releaser here on every `release:major`.
|
|
|
17
17
|
| Surface | Committed | Deprecation notice due | Removal due | Reversal condition |
|
|
18
18
|
|---|---|---|---|---|
|
|
19
19
|
| Free-text `compatibility` skill-frontmatter field (`src/scripts/schemas/skill.schema.json`) | 2026-08-14 | shipped 2026-08-14 — `deprecated: true` + superseded-by note in the schema; `harness_compat` lands beside it, additively | next major after the notice — **not pinned here** (removal date is maintainer-owned, same stance as the manifest `tier` entry, whose `sunset` shipped `null`) | The public Agent-Skills spec makes `compatibility` load-bearing for cross-host portability, or an external consumer is found reading it. `harness_compat` is package-local; `compatibility` mirrors the public spec, so keeping the mirror stays cheaply reversible. Superseded by `harness_compat` (class) + `runtime_requires` (probeable detail); both users (`docx-authoring`, `pdf-tools`) already carry both fields, so nothing breaks on removal day. |
|
|
20
|
-
| `code_graph` native code-graph engine (`code_graph.enabled`, the `code-intelligence` skill's native arm, `code_graph_nudge_hook`) | 2026-07-28 | next major after 9.x | **REVISED 2026-08-15 — no removal date; see below** | A consumer case the graph answers and disciplined grep cannot. Measured null: recall 0.365 vs grep 0.797 (`docs/CLAIMS.md` `code-graph-retrieval-null`). `enabled: false` stays permanent. **Revision (ADR-232 track, maintainer decision 2026-08-15).** The original row committed removal to 11.0; the tree reached 12.0.0 with the runtime paths still registered, i.e. the commitment was missed. Rather than quietly re-dating it, the commitment is withdrawn with its reason recorded, because the measurement changed what removal is worth: **the payload this deprecation existed for has already shipped** — the parser pair (`web-tree-sitter@0.24.7` / `tree-sitter-wasms@0.1.13`, ~51 MB unpacked) moved from `dependencies` to `devDependencies` ahead of schedule, so no consumer installs it. What source removal would still free is ~112 K against a 27 M tree (0.4 %). Against that it costs a breaking change across four consumer-visible surfaces (CLI verb, `code-intelligence` skill, `external-code-graph-interop` rule, `hooks.code_graph.enabled`) plus one surface that is re-plumbing rather than deletion: `_lib/auto_dispatch.ts` routes the `definition` / `references` lookup classes to `primitive: 'code-graph-query'`, and `_lib/judgment_ladder.ts` calls that live at Rung 0. There is also no cheap middle — `code_graph/detect.ts` handles the `consumer` / `scip` / `native` source kinds in one type union, so stripping only the native engine while keeping consumer-index interop is a redesign. **New commitment:** the surfaces stay registered and disabled; removal happens when a concrete reason appears (a maintenance cost that bites, a conflicting redesign, or a consumer asking), not on a date. This row stays in the table so the decision is visible rather than forgotten — a withdrawn commitment recorded is not the folklore this table exists to prevent; an unrecorded one would be. |
|
|
20
|
+
| `code_graph` native code-graph engine (`code_graph.enabled`, the `code-intelligence` skill's native arm, `code_graph_nudge_hook`) | 2026-07-28 | next major after 9.x | **REVISED 2026-08-15 — no removal date; see below** | A consumer case the graph answers and disciplined grep cannot. Measured null: recall 0.365 vs grep 0.797 (`docs/CLAIMS.md` `code-graph-retrieval-null`), measured 2026-07-28 against a build predating the 2026-08-22 extractor repair. `enabled: false` stays the DEFAULT — "permanent" is retracted here on 2026-08-26, because this row's own revision below withdraws the removal commitment and a withdrawn schedule cannot leave a permanence behind it. **Revision (ADR-232 track, maintainer decision 2026-08-15).** The original row committed removal to 11.0; the tree reached 12.0.0 with the runtime paths still registered, i.e. the commitment was missed. Rather than quietly re-dating it, the commitment is withdrawn with its reason recorded, because the measurement changed what removal is worth: **the payload this deprecation existed for has already shipped** — the parser pair (`web-tree-sitter@0.24.7` / `tree-sitter-wasms@0.1.13`, ~51 MB unpacked) moved from `dependencies` to `devDependencies` ahead of schedule, so no consumer installs it. What source removal would still free is ~112 K against a 27 M tree (0.4 %). Against that it costs a breaking change across four consumer-visible surfaces (CLI verb, `code-intelligence` skill, `external-code-graph-interop` rule, `hooks.code_graph.enabled`) plus one surface that is re-plumbing rather than deletion: `_lib/auto_dispatch.ts` routes the `definition` / `references` lookup classes to `primitive: 'code-graph-query'`, and `_lib/judgment_ladder.ts` calls that live at Rung 0. There is also no cheap middle — `code_graph/detect.ts` handles the `consumer` / `scip` / `native` source kinds in one type union, so stripping only the native engine while keeping consumer-index interop is a redesign. **New commitment:** the surfaces stay registered and disabled; removal happens when a concrete reason appears (a maintenance cost that bites, a conflicting redesign, or a consumer asking), not on a date. This row stays in the table so the decision is visible rather than forgotten — a withdrawn commitment recorded is not the folklore this table exists to prevent; an unrecorded one would be. |
|
|
21
21
|
| `telegraph-speak` condenser (`telegraph.speak`, `src/rules/telegraph-speak.md`, `src/scripts/_lib/compile_time_toggles.ts`, `src/scripts/validate_telegraph_carveouts.ts`) | 2026-07-29 | shipped 2026-07-29 — dormant by default, `speak` defaults `false` | **not pinned here** — removal is authorized in principle and deliberately not executed (ADR `telegraph/0002` § Decision part 3), pending a `prose_only` bench (~$0.80). The date is maintainer-owned, same stance as the `compatibility` row above | An output-side bench clears the kill-criterion bar, at which point `telegraph.speak: true` restores the feature intact. Measured basis for dormancy: median vs_terse **−9.27 %** (API) / −5.47 % (exact `cl100k_base`) — the condenser emits MORE than a plain "be terse". Tracked as a row rather than left dormant-and-unlisted: dormancy without a row is untracked in *both* directions, neither scheduled nor recorded as a keep. Deliberately NOT a due version (that would invent a commitment ADR 0002 declined to make) and NOT a permanent keep (that would contradict its authorized removal). |
|
|
22
22
|
|
|
23
23
|
### Row status — what is currently late, and who owns it
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Third-Party Notices
|
|
2
|
+
|
|
3
|
+
> **Generated** by `lint_provenance.ts --regenerate-notices` — do NOT
|
|
4
|
+
> hand-edit. Source of truth: `provenance/borrows.jsonl`. Drift-checked in
|
|
5
|
+
> CI (`task lint-provenance`); run
|
|
6
|
+
> `./scripts-run src/scripts/lint_provenance --regenerate-notices` after
|
|
7
|
+
> any ledger change.
|
|
8
|
+
|
|
9
|
+
## https://github.com/nextlevelbuilder/ui-ux-pro-max-skill
|
|
10
|
+
|
|
11
|
+
- **License:** MIT
|
|
12
|
+
- **Source SHA:** 97eb2a20
|
|
13
|
+
- **Borrowed:** 2026-08-13
|
|
14
|
+
- **Files:** `src/skills/corpus-grounding/scripts/decision_engine.ts`, `src/skills/corpus-grounding/scripts/ground.ts`
|
|
15
|
+
- **Transformation:** Adopted the three design dials as a tier TABLE and re-derived the plumbing against this engine's own shape. Upstream threads variance/motion/density through a generate() and a set of render functions that do not exist here; this tree has ground(), so the dials enter as an optional fourth parameter and leave as an additive output block that is omitted entirely when no dial is passed, keeping the no-flag result byte-identical. Variance biases SELECTION and never RETRIEVAL: the rule's own corpus-grounded keywords alone augment the query, so the rows that come back are unchanged by the dial, and a separate selection list carries the dial in front only for choosing among those rows — and when that choice differs from the one the rule's keywords would have made, the run reports the divergence in evidence_gap rather than leaving it invisible. Motion resolves through this repo's search_domain against a 'gsap' manifest domain added in the same change, filtering by Intensity Tier BEFORE ranking (retrieve-then-filter drops tier rows that lost the global cut) and taking its row count from the manifest rather than a literal; a missing domain or an empty tier emits an evidence_gap and no motion block at all. Range clamping moved out of the caller into the resolver, the CLI rejects a non-numeric dial rather than reading it as unset, and all three dials render in the text output and the persisted MASTER.md, not only under --json.
|
|
16
|
+
- **Cleared by:** human
|
|
17
|
+
|
|
18
|
+
## https://github.com/ruvnet/ruflo
|
|
19
|
+
|
|
20
|
+
- **License:** MIT
|
|
21
|
+
- **Source SHA:** d33ef4bf8ab27a8f9ef08352c9c293b53312a861
|
|
22
|
+
- **Borrowed:** 2026-08-30
|
|
23
|
+
- **Files:** `src/scripts/cost/budget.mjs`, `src/scripts/cost/track.mjs`
|
|
24
|
+
- **Transformation:** Forked from the upstream cost-tracker plugin's budget.mjs and track.mjs, then re-derived against a store this repository already had. The upstream persists through an MCP memory tool (`mcp__claude-flow__memory_store`); that dependency is removed entirely and replaced with a local append-only JSONL at agents/cost-tracking/sessions.jsonl plus a budget.json beside it, so the scripts run under bare `node` with no MCP server present — which is what lets them ship to consumers as plain .mjs (the /cost:report command doc states why tsx is not available on that path). track.mjs additionally gained dedup and a main/subagent split whose logic is MIRRORED, not imported, from src/scripts/_lib/cc_transcript.ts, and pricing constants are kept in sync with REFERENCE.md rather than carried from upstream. The borrow is recorded here rather than as an in-file source name because MIT requires the copyright and permission notice to travel with copies, not to sit inside each source file: docs/THIRD-PARTY-NOTICES.md is generated from this ledger and is shipped in package.json's files list in the same change, which is what actually discharges the obligation for a consumer who receives src/scripts/ from npm.
|
|
25
|
+
- **Cleared by:** human
|
|
@@ -76,7 +76,7 @@ When the agent picks a provider for a `/video:*` / `/image:*` /
|
|
|
76
76
|
2. **Refuse-and-surface** if the operator's resolved default is a
|
|
77
77
|
non-`stable` tier — name the tier and the path to this contract
|
|
78
78
|
document, then emit one clarifying question (per
|
|
79
|
-
[`ask-when-uncertain`](
|
|
79
|
+
[`ask-when-uncertain`](../../src/rules/ask-when-uncertain.md)):
|
|
80
80
|
either pick a `stable` provider, or confirm the non-stable run.
|
|
81
81
|
No silent default. No "I'll just try it".
|
|
82
82
|
3. **Record** in the run summary which tier the chosen adapter
|