@bovinphang/frontend-craft 2.9.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +3 -3
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +403 -378
- package/CHANGELOG.zh-CN.md +402 -377
- package/CONTRIBUTING.md +381 -371
- package/CONTRIBUTING.zh-CN.md +383 -371
- package/README.md +605 -545
- package/README.openclaw.md +395 -359
- package/README.openclaw.zh-CN.md +395 -359
- package/README.zh-CN.md +605 -545
- package/agents/fec-typescript-reviewer.md +1 -1
- package/common-content.lock.json +3795 -0
- package/dist/bin/frontend-craft.js +353 -174
- package/docs/common-migration.md +61 -0
- package/docs/example-prompts.md +157 -157
- package/docs/ja-JP/README.md +588 -534
- package/docs/ko-KR/README.md +588 -534
- package/docs/project-structure.md +166 -151
- package/docs/review-and-diagram-workflows.md +5 -5
- package/docs/runtimes/antigravity.md +18 -18
- package/docs/runtimes/augment.md +18 -18
- package/docs/runtimes/claude.md +193 -191
- package/docs/runtimes/claude.zh-CN.md +191 -189
- package/docs/runtimes/cline.md +18 -18
- package/docs/runtimes/codebuddy.md +18 -18
- package/docs/runtimes/codex.md +18 -18
- package/docs/runtimes/compatibility.md +42 -27
- package/docs/runtimes/copilot.md +18 -18
- package/docs/runtimes/cursor.md +18 -18
- package/docs/runtimes/gemini.md +18 -18
- package/docs/runtimes/kilo.md +18 -18
- package/docs/runtimes/openclaw.md +18 -18
- package/docs/runtimes/opencode.md +18 -18
- package/docs/runtimes/qoder.md +18 -18
- package/docs/runtimes/trae.md +18 -18
- package/docs/runtimes/windsurf.md +18 -18
- package/docs/zh-CN/common-migration.md +57 -0
- package/docs/zh-CN/example-prompts.md +157 -157
- package/docs/zh-CN/project-structure.md +166 -148
- package/docs/zh-CN/review-and-diagram-workflows.md +5 -5
- package/docs/zh-TW/README.md +588 -534
- package/localized/zh-CN/agents/fec-typescript-reviewer.md +1 -1
- package/localized/zh-CN/skills/cc-c-project-standard/SKILL.md +25 -0
- package/localized/zh-CN/skills/cc-c-project-standard/examples/engineering/README.md +7 -0
- package/localized/zh-CN/skills/cc-c-project-standard/examples/engineering/boundary.c +26 -0
- package/localized/zh-CN/skills/cc-c-project-standard/examples/engineering/boundary.h +15 -0
- package/localized/zh-CN/skills/cc-c-project-standard/examples/engineering/boundary_test.c +73 -0
- package/localized/zh-CN/skills/cc-c-project-standard/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/cc-c-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/cc-c-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-c-project-standard/references/engineering-practices.md +106 -0
- package/localized/zh-CN/skills/cc-c-project-standard/references/practice.md +37 -0
- package/localized/zh-CN/skills/cc-cpp-project-standard/SKILL.md +25 -0
- package/localized/zh-CN/skills/cc-cpp-project-standard/examples/engineering/README.md +7 -0
- package/localized/zh-CN/skills/cc-cpp-project-standard/examples/engineering/boundary.cpp +26 -0
- package/localized/zh-CN/skills/cc-cpp-project-standard/examples/engineering/boundary.hpp +12 -0
- package/localized/zh-CN/skills/cc-cpp-project-standard/examples/engineering/boundary_test.cpp +38 -0
- package/localized/zh-CN/skills/cc-cpp-project-standard/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/cc-cpp-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/cc-cpp-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-cpp-project-standard/references/engineering-practices.md +106 -0
- package/localized/zh-CN/skills/cc-cpp-project-standard/references/practice.md +37 -0
- package/localized/zh-CN/skills/cc-debug-methodology/SKILL.md +8 -0
- package/localized/zh-CN/skills/cc-debug-methodology/references/method.md +13 -0
- package/localized/zh-CN/skills/cc-doc-sync-core/SKILL.md +8 -0
- package/localized/zh-CN/skills/cc-doc-sync-core/references/method.md +12 -0
- package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/SKILL.md +5 -5
- package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/references/flowchart-quality.md +1 -1
- package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/references/layout-and-export.md +9 -9
- package/localized/zh-CN/skills/cc-electron-project-standard/SKILL.md +21 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/examples/engineering/README.md +7 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/examples/engineering/ipc-lifecycle.cjs +44 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/examples/engineering/ipc-lifecycle.test.cjs +44 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/examples/engineering/package.json +8 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/examples/minimal/README.md +9 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/examples/minimal/boundary.cjs +19 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/examples/minimal/boundary.test.cjs +7 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/examples/minimal/index.html +1 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/examples/minimal/main.cjs +20 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/examples/minimal/package.json +9 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/examples/minimal/preload.cjs +2 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/examples/minimal/renderer.js +4 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/references/engineering-practices.md +73 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/references/practice.md +19 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/references/verification.md +17 -0
- package/localized/zh-CN/skills/cc-go-concurrency/SKILL.md +25 -0
- package/localized/zh-CN/skills/cc-go-concurrency/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/cc-go-concurrency/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/cc-go-concurrency/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-go-concurrency/references/engineering-practices.md +73 -0
- package/localized/zh-CN/skills/cc-go-concurrency/references/practice.md +37 -0
- package/localized/zh-CN/skills/cc-go-project-standard/SKILL.md +25 -0
- package/localized/zh-CN/skills/cc-go-project-standard/examples/engineering/README.md +7 -0
- package/localized/zh-CN/skills/cc-go-project-standard/examples/engineering/go.mod +3 -0
- package/localized/zh-CN/skills/cc-go-project-standard/examples/engineering/lifecycle.go +71 -0
- package/localized/zh-CN/skills/cc-go-project-standard/examples/engineering/lifecycle_test.go +22 -0
- package/localized/zh-CN/skills/cc-go-project-standard/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/cc-go-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/cc-go-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-go-project-standard/references/engineering-practices.md +106 -0
- package/localized/zh-CN/skills/cc-go-project-standard/references/practice.md +37 -0
- package/localized/zh-CN/skills/cc-java-project-standard/SKILL.md +25 -0
- package/localized/zh-CN/skills/cc-java-project-standard/examples/engineering/README.md +5 -0
- package/localized/zh-CN/skills/cc-java-project-standard/examples/engineering/ResourceBoundary.java +26 -0
- package/localized/zh-CN/skills/cc-java-project-standard/examples/engineering/ResourceBoundaryTest.java +41 -0
- package/localized/zh-CN/skills/cc-java-project-standard/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/cc-java-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/cc-java-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-java-project-standard/references/engineering-practices.md +106 -0
- package/localized/zh-CN/skills/cc-java-project-standard/references/practice.md +37 -0
- package/localized/zh-CN/skills/cc-java-runtime/SKILL.md +25 -0
- package/localized/zh-CN/skills/cc-java-runtime/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/cc-java-runtime/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/cc-java-runtime/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-java-runtime/references/engineering-practices.md +73 -0
- package/localized/zh-CN/skills/cc-java-runtime/references/practice.md +37 -0
- package/localized/zh-CN/skills/cc-native-memory-safety/SKILL.md +25 -0
- package/localized/zh-CN/skills/cc-native-memory-safety/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/cc-native-memory-safety/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/cc-native-memory-safety/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-native-memory-safety/references/engineering-practices.md +73 -0
- package/localized/zh-CN/skills/cc-native-memory-safety/references/practice.md +37 -0
- package/localized/zh-CN/skills/cc-python-async/SKILL.md +25 -0
- package/localized/zh-CN/skills/cc-python-async/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/cc-python-async/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/cc-python-async/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-python-async/references/engineering-practices.md +73 -0
- package/localized/zh-CN/skills/cc-python-async/references/practice.md +37 -0
- package/localized/zh-CN/skills/cc-python-project-standard/SKILL.md +25 -0
- package/localized/zh-CN/skills/cc-python-project-standard/examples/engineering/README.md +7 -0
- package/localized/zh-CN/skills/cc-python-project-standard/examples/engineering/resource_boundary.py +37 -0
- package/localized/zh-CN/skills/cc-python-project-standard/examples/engineering/test_resource_boundary.py +49 -0
- package/localized/zh-CN/skills/cc-python-project-standard/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/cc-python-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/cc-python-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-python-project-standard/references/engineering-practices.md +106 -0
- package/localized/zh-CN/skills/cc-python-project-standard/references/practice.md +37 -0
- package/localized/zh-CN/skills/cc-refactoring-core/SKILL.md +8 -0
- package/localized/zh-CN/skills/cc-refactoring-core/references/method.md +16 -0
- package/localized/zh-CN/skills/cc-rust-async/SKILL.md +25 -0
- package/localized/zh-CN/skills/cc-rust-async/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/cc-rust-async/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/cc-rust-async/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-rust-async/references/engineering-practices.md +73 -0
- package/localized/zh-CN/skills/cc-rust-async/references/practice.md +37 -0
- package/localized/zh-CN/skills/cc-rust-project-standard/SKILL.md +25 -0
- package/localized/zh-CN/skills/cc-rust-project-standard/examples/engineering/Cargo.lock +7 -0
- package/localized/zh-CN/skills/cc-rust-project-standard/examples/engineering/Cargo.toml +8 -0
- package/localized/zh-CN/skills/cc-rust-project-standard/examples/engineering/README.md +5 -0
- package/localized/zh-CN/skills/cc-rust-project-standard/examples/engineering/src/lib.rs +43 -0
- package/localized/zh-CN/skills/cc-rust-project-standard/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/cc-rust-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/cc-rust-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-rust-project-standard/references/engineering-practices.md +106 -0
- package/localized/zh-CN/skills/cc-rust-project-standard/references/practice.md +37 -0
- package/localized/zh-CN/skills/cc-source-driven-development/SKILL.md +8 -0
- package/localized/zh-CN/skills/cc-source-driven-development/references/method.md +19 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/SKILL.md +21 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/README.md +9 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/core/Cargo.lock +5 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/core/Cargo.toml +9 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/core/src/lib.rs +46 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/src-tauri/Cargo.toml +12 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/src-tauri/build.rs +5 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/src-tauri/capabilities/main.json +6 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/src-tauri/permissions/documents.toml +4 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/src-tauri/src/main.rs +22 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/src-tauri/tauri.conf.json +13 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/ui/app.js +5 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/ui/index.html +1 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/references/engineering-practices.md +73 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/references/practice.md +20 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/references/verification.md +18 -0
- package/localized/zh-CN/skills/cc-tdd-methodology/SKILL.md +8 -0
- package/localized/zh-CN/skills/cc-tdd-methodology/references/method.md +13 -0
- package/localized/zh-CN/skills/cc-technical-diagrams/SKILL.md +34 -0
- package/localized/zh-CN/skills/{fec-image-generation → cc-technical-diagrams}/assets/interactive-diagram.html +371 -371
- package/localized/zh-CN/skills/cc-technical-diagrams/assets/quality-examples/README.md +14 -0
- package/localized/zh-CN/skills/{fec-image-generation → cc-technical-diagrams}/assets/quality-examples/sequence.mmd +21 -21
- package/localized/zh-CN/skills/{fec-image-generation → cc-technical-diagrams}/assets/quality-examples/workflow.mmd +7 -7
- package/localized/zh-CN/skills/{fec-image-generation → cc-technical-diagrams}/references/diagram-workflows.md +3 -3
- package/localized/zh-CN/skills/{fec-image-generation → cc-technical-diagrams}/references/html-technical-diagrams.md +7 -7
- package/localized/zh-CN/skills/cc-technical-diagrams/references/png-qa-autofix.md +37 -0
- package/{skills/fec-image-generation → localized/zh-CN/skills/cc-technical-diagrams}/scripts/diagram-browser.mjs +77 -14
- package/localized/zh-CN/skills/cc-technical-diagrams/scripts/diagram-layout.mjs +176 -0
- package/localized/zh-CN/skills/cc-technical-diagrams/scripts/png-qa.mjs +462 -0
- package/localized/zh-CN/skills/{fec-typescript-project-standard → cc-typescript-project-standard}/SKILL.md +10 -4
- package/localized/zh-CN/skills/cc-typescript-project-standard/examples/engineering/README.md +7 -0
- package/localized/zh-CN/skills/cc-typescript-project-standard/examples/engineering/boundary.test.ts +16 -0
- package/localized/zh-CN/skills/cc-typescript-project-standard/examples/engineering/input.ts +12 -0
- package/localized/zh-CN/skills/cc-typescript-project-standard/examples/engineering/package.json +12 -0
- package/localized/zh-CN/skills/cc-typescript-project-standard/examples/engineering/pnpm-lock.yaml +39 -0
- package/localized/zh-CN/skills/cc-typescript-project-standard/examples/engineering/pnpm-workspace.yaml +1 -0
- package/localized/zh-CN/skills/cc-typescript-project-standard/examples/engineering/tsconfig.json +8 -0
- package/localized/zh-CN/skills/cc-typescript-project-standard/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/cc-typescript-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/cc-typescript-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-typescript-project-standard/references/engineering-practices.md +106 -0
- package/localized/zh-CN/skills/{fec-typescript-project-standard → cc-typescript-project-standard}/references/type-safety-patterns.md +5 -34
- package/localized/zh-CN/skills/{fec-typescript-project-standard → cc-typescript-project-standard}/references/type-safety.md +6 -0
- package/localized/zh-CN/skills/eval_queries.json +741 -319
- package/localized/zh-CN/skills/fec-api-integration/SKILL.md +5 -1
- package/localized/zh-CN/skills/fec-api-integration/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/fec-api-integration/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/fec-api-integration/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/fec-api-integration/references/engineering-practices.md +73 -0
- package/localized/zh-CN/skills/fec-code-review/SKILL.md +4 -0
- package/localized/zh-CN/skills/fec-code-review/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/fec-code-review/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/fec-code-review/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/fec-code-review/references/engineering-practices.md +73 -0
- package/localized/zh-CN/skills/fec-data-fetching/SKILL.md +4 -0
- package/localized/zh-CN/skills/fec-data-fetching/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/fec-data-fetching/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/fec-data-fetching/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/fec-data-fetching/references/engineering-practices.md +73 -0
- package/localized/zh-CN/skills/fec-debug-framework/SKILL.md +1 -50
- package/localized/zh-CN/skills/fec-debug-framework/references/common/debug.md +13 -0
- package/localized/zh-CN/skills/fec-dependency-upgrade/SKILL.md +4 -0
- package/localized/zh-CN/skills/fec-dependency-upgrade/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/fec-dependency-upgrade/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/fec-dependency-upgrade/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/fec-dependency-upgrade/references/engineering-practices.md +73 -0
- package/localized/zh-CN/skills/fec-doc-sync/SKILL.md +7 -28
- package/localized/zh-CN/skills/fec-doc-sync/references/common/doc-sync.md +12 -0
- package/localized/zh-CN/skills/fec-image-generation/SKILL.md +7 -101
- package/localized/zh-CN/skills/fec-image-generation/references/png-qa-autofix.md +1 -1
- package/localized/zh-CN/skills/fec-image-generation/scripts/png-qa.mjs +1 -1
- package/localized/zh-CN/skills/fec-react-project-standard/SKILL.md +6 -0
- package/localized/zh-CN/skills/fec-react-project-standard/examples/engineering/README.md +7 -0
- package/localized/zh-CN/skills/fec-react-project-standard/examples/engineering/package.json +15 -0
- package/localized/zh-CN/skills/fec-react-project-standard/examples/engineering/pnpm-lock.yaml +662 -0
- package/localized/zh-CN/skills/fec-react-project-standard/examples/engineering/pnpm-workspace.yaml +1 -0
- package/localized/zh-CN/skills/fec-react-project-standard/examples/engineering/request-view.mjs +24 -0
- package/localized/zh-CN/skills/fec-react-project-standard/examples/engineering/request-view.test.mjs +33 -0
- package/localized/zh-CN/skills/fec-react-project-standard/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/fec-react-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/fec-react-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/fec-react-project-standard/references/engineering-practices.md +73 -0
- package/localized/zh-CN/skills/fec-react-project-standard/references/generic-component-types.md +37 -0
- package/localized/zh-CN/skills/fec-react-project-standard/references/react-quality-patterns.md +3 -3
- package/localized/zh-CN/skills/fec-react-project-standard/references/react-runtime-patterns.md +1 -1
- package/localized/zh-CN/skills/fec-refactoring/SKILL.md +12 -70
- package/localized/zh-CN/skills/fec-refactoring/references/common/refactoring.md +16 -0
- package/localized/zh-CN/skills/fec-refactoring/references/principles.md +9 -39
- package/localized/zh-CN/skills/fec-refactoring/references/workflow.md +4 -56
- package/localized/zh-CN/skills/fec-security-review/SKILL.md +4 -0
- package/localized/zh-CN/skills/fec-security-review/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/fec-security-review/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/fec-security-review/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/fec-security-review/references/engineering-practices.md +73 -0
- package/localized/zh-CN/skills/fec-tdd-workflow/SKILL.md +12 -43
- package/localized/zh-CN/skills/fec-tdd-workflow/references/common/tdd.md +13 -0
- package/localized/zh-CN/skills/fec-testing-strategy/SKILL.md +4 -0
- package/localized/zh-CN/skills/fec-testing-strategy/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/fec-testing-strategy/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/fec-testing-strategy/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/fec-testing-strategy/references/engineering-practices.md +73 -0
- package/localized/zh-CN/skills/fec-vue3-project-standard/SKILL.md +4 -0
- package/localized/zh-CN/skills/fec-vue3-project-standard/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/fec-vue3-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/fec-vue3-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/fec-vue3-project-standard/references/engineering-practices.md +73 -0
- package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-project-structure.md +2 -2
- package/localized/zh-CN/skills/metadata.json +2246 -1008
- package/localized/zh-CN/skills/relations.json +501 -372
- package/localized/zh-CN/templates/shared/rules/fec-source-driven-development.md +3 -29
- package/localized/zh-CN/templates/shared/rules/fec-typescript.md +4 -4
- package/localized/zh-CN/templates/shared/rules/references/common/source-driven-development.md +19 -0
- package/openclaw.plugin.json +1 -1
- package/package.json +11 -4
- package/skills/cc-c-project-standard/SKILL.md +25 -0
- package/skills/cc-c-project-standard/examples/engineering/README.md +7 -0
- package/skills/cc-c-project-standard/examples/engineering/boundary.c +26 -0
- package/skills/cc-c-project-standard/examples/engineering/boundary.h +15 -0
- package/skills/cc-c-project-standard/examples/engineering/boundary_test.c +73 -0
- package/skills/cc-c-project-standard/references/common/engineering-practices.md +237 -0
- package/skills/cc-c-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/skills/cc-c-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/skills/cc-c-project-standard/references/engineering-practices.md +106 -0
- package/skills/cc-c-project-standard/references/practice.md +37 -0
- package/skills/cc-cpp-project-standard/SKILL.md +25 -0
- package/skills/cc-cpp-project-standard/examples/engineering/README.md +7 -0
- package/skills/cc-cpp-project-standard/examples/engineering/boundary.cpp +26 -0
- package/skills/cc-cpp-project-standard/examples/engineering/boundary.hpp +12 -0
- package/skills/cc-cpp-project-standard/examples/engineering/boundary_test.cpp +38 -0
- package/skills/cc-cpp-project-standard/references/common/engineering-practices.md +237 -0
- package/skills/cc-cpp-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/skills/cc-cpp-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/skills/cc-cpp-project-standard/references/engineering-practices.md +106 -0
- package/skills/cc-cpp-project-standard/references/practice.md +37 -0
- package/skills/cc-debug-methodology/SKILL.md +8 -0
- package/skills/cc-debug-methodology/references/method.md +13 -0
- package/skills/cc-doc-sync-core/SKILL.md +8 -0
- package/skills/cc-doc-sync-core/references/method.md +12 -0
- package/skills/{fec-drawio-studio → cc-drawio-studio}/SKILL.md +5 -5
- package/skills/{fec-drawio-studio → cc-drawio-studio}/references/flowchart-quality.md +1 -1
- package/skills/{fec-drawio-studio → cc-drawio-studio}/references/layout-and-export.md +9 -9
- package/skills/cc-electron-project-standard/SKILL.md +21 -0
- package/skills/cc-electron-project-standard/examples/engineering/README.md +7 -0
- package/skills/cc-electron-project-standard/examples/engineering/ipc-lifecycle.cjs +44 -0
- package/skills/cc-electron-project-standard/examples/engineering/ipc-lifecycle.test.cjs +44 -0
- package/skills/cc-electron-project-standard/examples/engineering/package.json +8 -0
- package/skills/cc-electron-project-standard/examples/minimal/README.md +9 -0
- package/skills/cc-electron-project-standard/examples/minimal/boundary.cjs +19 -0
- package/skills/cc-electron-project-standard/examples/minimal/boundary.test.cjs +7 -0
- package/skills/cc-electron-project-standard/examples/minimal/index.html +1 -0
- package/skills/cc-electron-project-standard/examples/minimal/main.cjs +20 -0
- package/skills/cc-electron-project-standard/examples/minimal/package.json +9 -0
- package/skills/cc-electron-project-standard/examples/minimal/preload.cjs +2 -0
- package/skills/cc-electron-project-standard/examples/minimal/renderer.js +4 -0
- package/skills/cc-electron-project-standard/references/common/engineering-practices.md +237 -0
- package/skills/cc-electron-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/skills/cc-electron-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/skills/cc-electron-project-standard/references/engineering-practices.md +73 -0
- package/skills/cc-electron-project-standard/references/practice.md +19 -0
- package/skills/cc-electron-project-standard/references/verification.md +17 -0
- package/skills/cc-go-concurrency/SKILL.md +25 -0
- package/skills/cc-go-concurrency/references/common/engineering-practices.md +237 -0
- package/skills/cc-go-concurrency/references/common/engineering-practices.rules.json +121 -0
- package/skills/cc-go-concurrency/references/common/engineering-practices.sources.json +377 -0
- package/skills/cc-go-concurrency/references/engineering-practices.md +73 -0
- package/skills/cc-go-concurrency/references/practice.md +37 -0
- package/skills/cc-go-project-standard/SKILL.md +25 -0
- package/skills/cc-go-project-standard/examples/engineering/README.md +7 -0
- package/skills/cc-go-project-standard/examples/engineering/go.mod +3 -0
- package/skills/cc-go-project-standard/examples/engineering/lifecycle.go +71 -0
- package/skills/cc-go-project-standard/examples/engineering/lifecycle_test.go +22 -0
- package/skills/cc-go-project-standard/references/common/engineering-practices.md +237 -0
- package/skills/cc-go-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/skills/cc-go-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/skills/cc-go-project-standard/references/engineering-practices.md +106 -0
- package/skills/cc-go-project-standard/references/practice.md +37 -0
- package/skills/cc-java-project-standard/SKILL.md +25 -0
- package/skills/cc-java-project-standard/examples/engineering/README.md +7 -0
- package/skills/cc-java-project-standard/examples/engineering/ResourceBoundary.java +26 -0
- package/skills/cc-java-project-standard/examples/engineering/ResourceBoundaryTest.java +41 -0
- package/skills/cc-java-project-standard/references/common/engineering-practices.md +237 -0
- package/skills/cc-java-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/skills/cc-java-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/skills/cc-java-project-standard/references/engineering-practices.md +106 -0
- package/skills/cc-java-project-standard/references/practice.md +35 -0
- package/skills/cc-java-runtime/SKILL.md +25 -0
- package/skills/cc-java-runtime/references/common/engineering-practices.md +237 -0
- package/skills/cc-java-runtime/references/common/engineering-practices.rules.json +121 -0
- package/skills/cc-java-runtime/references/common/engineering-practices.sources.json +377 -0
- package/skills/cc-java-runtime/references/engineering-practices.md +73 -0
- package/skills/cc-java-runtime/references/practice.md +37 -0
- package/skills/cc-native-memory-safety/SKILL.md +25 -0
- package/skills/cc-native-memory-safety/references/common/engineering-practices.md +237 -0
- package/skills/cc-native-memory-safety/references/common/engineering-practices.rules.json +121 -0
- package/skills/cc-native-memory-safety/references/common/engineering-practices.sources.json +377 -0
- package/skills/cc-native-memory-safety/references/engineering-practices.md +73 -0
- package/skills/cc-native-memory-safety/references/practice.md +37 -0
- package/skills/cc-python-async/SKILL.md +25 -0
- package/skills/cc-python-async/references/common/engineering-practices.md +237 -0
- package/skills/cc-python-async/references/common/engineering-practices.rules.json +121 -0
- package/skills/cc-python-async/references/common/engineering-practices.sources.json +377 -0
- package/skills/cc-python-async/references/engineering-practices.md +73 -0
- package/skills/cc-python-async/references/practice.md +37 -0
- package/skills/cc-python-project-standard/SKILL.md +25 -0
- package/skills/cc-python-project-standard/examples/engineering/README.md +7 -0
- package/skills/cc-python-project-standard/examples/engineering/resource_boundary.py +37 -0
- package/skills/cc-python-project-standard/examples/engineering/test_resource_boundary.py +49 -0
- package/skills/cc-python-project-standard/references/common/engineering-practices.md +237 -0
- package/skills/cc-python-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/skills/cc-python-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/skills/cc-python-project-standard/references/engineering-practices.md +106 -0
- package/skills/cc-python-project-standard/references/practice.md +37 -0
- package/skills/cc-refactoring-core/SKILL.md +8 -0
- package/skills/cc-refactoring-core/references/method.md +16 -0
- package/skills/cc-rust-async/SKILL.md +25 -0
- package/skills/cc-rust-async/references/common/engineering-practices.md +237 -0
- package/skills/cc-rust-async/references/common/engineering-practices.rules.json +121 -0
- package/skills/cc-rust-async/references/common/engineering-practices.sources.json +377 -0
- package/skills/cc-rust-async/references/engineering-practices.md +73 -0
- package/skills/cc-rust-async/references/practice.md +37 -0
- package/skills/cc-rust-project-standard/SKILL.md +25 -0
- package/skills/cc-rust-project-standard/examples/engineering/Cargo.lock +7 -0
- package/skills/cc-rust-project-standard/examples/engineering/Cargo.toml +8 -0
- package/skills/cc-rust-project-standard/examples/engineering/README.md +5 -0
- package/skills/cc-rust-project-standard/examples/engineering/src/lib.rs +43 -0
- package/skills/cc-rust-project-standard/references/common/engineering-practices.md +237 -0
- package/skills/cc-rust-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/skills/cc-rust-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/skills/cc-rust-project-standard/references/engineering-practices.md +106 -0
- package/skills/cc-rust-project-standard/references/practice.md +37 -0
- package/skills/cc-source-driven-development/SKILL.md +8 -0
- package/skills/cc-source-driven-development/references/method.md +19 -0
- package/skills/cc-tauri-project-standard/SKILL.md +21 -0
- package/skills/cc-tauri-project-standard/examples/minimal/README.md +9 -0
- package/skills/cc-tauri-project-standard/examples/minimal/core/Cargo.lock +5 -0
- package/skills/cc-tauri-project-standard/examples/minimal/core/Cargo.toml +9 -0
- package/skills/cc-tauri-project-standard/examples/minimal/core/src/lib.rs +46 -0
- package/skills/cc-tauri-project-standard/examples/minimal/src-tauri/Cargo.toml +12 -0
- package/skills/cc-tauri-project-standard/examples/minimal/src-tauri/build.rs +5 -0
- package/skills/cc-tauri-project-standard/examples/minimal/src-tauri/capabilities/main.json +6 -0
- package/skills/cc-tauri-project-standard/examples/minimal/src-tauri/permissions/documents.toml +4 -0
- package/skills/cc-tauri-project-standard/examples/minimal/src-tauri/src/main.rs +22 -0
- package/skills/cc-tauri-project-standard/examples/minimal/src-tauri/tauri.conf.json +13 -0
- package/skills/cc-tauri-project-standard/examples/minimal/ui/app.js +5 -0
- package/skills/cc-tauri-project-standard/examples/minimal/ui/index.html +1 -0
- package/skills/cc-tauri-project-standard/references/common/engineering-practices.md +237 -0
- package/skills/cc-tauri-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/skills/cc-tauri-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/skills/cc-tauri-project-standard/references/engineering-practices.md +73 -0
- package/skills/cc-tauri-project-standard/references/practice.md +20 -0
- package/skills/cc-tauri-project-standard/references/verification.md +18 -0
- package/skills/cc-tdd-methodology/SKILL.md +8 -0
- package/skills/cc-tdd-methodology/references/method.md +13 -0
- package/skills/cc-technical-diagrams/SKILL.md +34 -0
- package/skills/{fec-image-generation → cc-technical-diagrams}/assets/interactive-diagram.html +371 -371
- package/skills/{fec-image-generation → cc-technical-diagrams}/assets/quality-examples/README.md +5 -5
- package/skills/{fec-image-generation → cc-technical-diagrams}/assets/quality-examples/sequence.mmd +21 -21
- package/skills/{fec-image-generation → cc-technical-diagrams}/assets/quality-examples/workflow.mmd +7 -7
- package/skills/{fec-image-generation → cc-technical-diagrams}/references/diagram-workflows.md +3 -3
- package/skills/{fec-image-generation → cc-technical-diagrams}/references/html-technical-diagrams.md +7 -7
- package/skills/cc-technical-diagrams/references/png-qa-autofix.md +37 -0
- package/{localized/zh-CN/skills/fec-image-generation → skills/cc-technical-diagrams}/scripts/diagram-browser.mjs +77 -14
- package/skills/cc-technical-diagrams/scripts/diagram-layout.mjs +176 -0
- package/skills/cc-technical-diagrams/scripts/png-qa.mjs +462 -0
- package/skills/{fec-typescript-project-standard → cc-typescript-project-standard}/SKILL.md +10 -4
- package/skills/cc-typescript-project-standard/examples/engineering/README.md +9 -0
- package/skills/cc-typescript-project-standard/examples/engineering/boundary.test.ts +16 -0
- package/skills/cc-typescript-project-standard/examples/engineering/input.ts +12 -0
- package/skills/cc-typescript-project-standard/examples/engineering/package.json +12 -0
- package/skills/cc-typescript-project-standard/examples/engineering/pnpm-lock.yaml +39 -0
- package/skills/cc-typescript-project-standard/examples/engineering/pnpm-workspace.yaml +1 -0
- package/skills/cc-typescript-project-standard/examples/engineering/tsconfig.json +8 -0
- package/skills/cc-typescript-project-standard/references/common/engineering-practices.md +237 -0
- package/skills/cc-typescript-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/skills/cc-typescript-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/skills/cc-typescript-project-standard/references/engineering-practices.md +106 -0
- package/skills/{fec-typescript-project-standard → cc-typescript-project-standard}/references/type-safety-patterns.md +6 -35
- package/skills/{fec-typescript-project-standard → cc-typescript-project-standard}/references/type-safety.md +7 -1
- package/skills/eval_queries.json +741 -319
- package/skills/fec-api-integration/SKILL.md +5 -1
- package/skills/fec-api-integration/references/common/engineering-practices.md +237 -0
- package/skills/fec-api-integration/references/common/engineering-practices.rules.json +121 -0
- package/skills/fec-api-integration/references/common/engineering-practices.sources.json +377 -0
- package/skills/fec-api-integration/references/engineering-practices.md +73 -0
- package/skills/fec-code-review/SKILL.md +4 -0
- package/skills/fec-code-review/references/common/engineering-practices.md +237 -0
- package/skills/fec-code-review/references/common/engineering-practices.rules.json +121 -0
- package/skills/fec-code-review/references/common/engineering-practices.sources.json +377 -0
- package/skills/fec-code-review/references/engineering-practices.md +73 -0
- package/skills/fec-data-fetching/SKILL.md +4 -0
- package/skills/fec-data-fetching/references/common/engineering-practices.md +237 -0
- package/skills/fec-data-fetching/references/common/engineering-practices.rules.json +121 -0
- package/skills/fec-data-fetching/references/common/engineering-practices.sources.json +377 -0
- package/skills/fec-data-fetching/references/engineering-practices.md +73 -0
- package/skills/fec-debug-framework/SKILL.md +2 -51
- package/skills/fec-debug-framework/references/common/debug.md +13 -0
- package/skills/fec-dependency-upgrade/SKILL.md +4 -0
- package/skills/fec-dependency-upgrade/references/common/engineering-practices.md +237 -0
- package/skills/fec-dependency-upgrade/references/common/engineering-practices.rules.json +121 -0
- package/skills/fec-dependency-upgrade/references/common/engineering-practices.sources.json +377 -0
- package/skills/fec-dependency-upgrade/references/engineering-practices.md +73 -0
- package/skills/fec-doc-sync/SKILL.md +7 -28
- package/skills/fec-doc-sync/references/common/doc-sync.md +12 -0
- package/skills/fec-image-generation/SKILL.md +7 -102
- package/skills/fec-image-generation/references/png-qa-autofix.md +1 -1
- package/skills/fec-image-generation/scripts/png-qa.mjs +1 -1
- package/skills/fec-react-project-standard/SKILL.md +6 -0
- package/skills/fec-react-project-standard/examples/engineering/README.md +7 -0
- package/skills/fec-react-project-standard/examples/engineering/package.json +15 -0
- package/skills/fec-react-project-standard/examples/engineering/pnpm-lock.yaml +662 -0
- package/skills/fec-react-project-standard/examples/engineering/pnpm-workspace.yaml +1 -0
- package/skills/fec-react-project-standard/examples/engineering/request-view.mjs +24 -0
- package/skills/fec-react-project-standard/examples/engineering/request-view.test.mjs +33 -0
- package/skills/fec-react-project-standard/references/common/engineering-practices.md +237 -0
- package/skills/fec-react-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/skills/fec-react-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/skills/fec-react-project-standard/references/engineering-practices.md +73 -0
- package/skills/fec-react-project-standard/references/generic-component-types.md +37 -0
- package/skills/fec-react-project-standard/references/react-quality-patterns.md +3 -3
- package/skills/fec-react-project-standard/references/react-runtime-patterns.md +1 -1
- package/skills/fec-refactoring/SKILL.md +12 -70
- package/skills/fec-refactoring/references/common/refactoring.md +16 -0
- package/skills/fec-refactoring/references/principles.md +9 -56
- package/skills/fec-refactoring/references/workflow.md +4 -87
- package/skills/fec-security-review/SKILL.md +4 -0
- package/skills/fec-security-review/references/common/engineering-practices.md +237 -0
- package/skills/fec-security-review/references/common/engineering-practices.rules.json +121 -0
- package/skills/fec-security-review/references/common/engineering-practices.sources.json +377 -0
- package/skills/fec-security-review/references/engineering-practices.md +73 -0
- package/skills/fec-tdd-workflow/SKILL.md +13 -45
- package/skills/fec-tdd-workflow/references/common/tdd.md +13 -0
- package/skills/fec-testing-strategy/SKILL.md +4 -0
- package/skills/fec-testing-strategy/references/common/engineering-practices.md +237 -0
- package/skills/fec-testing-strategy/references/common/engineering-practices.rules.json +121 -0
- package/skills/fec-testing-strategy/references/common/engineering-practices.sources.json +377 -0
- package/skills/fec-testing-strategy/references/engineering-practices.md +73 -0
- package/skills/fec-vue3-project-standard/SKILL.md +4 -0
- package/skills/fec-vue3-project-standard/references/common/engineering-practices.md +237 -0
- package/skills/fec-vue3-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/skills/fec-vue3-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/skills/fec-vue3-project-standard/references/engineering-practices.md +73 -0
- package/skills/fec-vue3-project-standard/references/vue3-project-structure.md +2 -2
- package/skills/metadata.json +2246 -1008
- package/skills/relations.json +501 -372
- package/templates/shared/rules/fec-source-driven-development.md +3 -29
- package/templates/shared/rules/fec-typescript.md +4 -4
- package/templates/shared/rules/references/common/source-driven-development.md +19 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/README.md +0 -14
- package/localized/zh-CN/skills/fec-source-driven-development/SKILL.md +0 -87
- package/skills/fec-source-driven-development/SKILL.md +0 -87
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/data/THIRD_PARTY_NOTICES.md +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/data/brand-icons.json +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/data/shape-index.json +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/references/data-residency.md +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/references/diagram-patterns.md +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/references/troubleshooting.md +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/references/xml-and-mermaid.md +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/brand-symbols.mjs +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/diagram-lint.mjs +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/diagram-url.mjs +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/drawio-export.mjs +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/layout-graph.mjs +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/png-embed-fix.mjs +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/scan-go-packages.mjs +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/scan-js-modules.mjs +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/scan-python-classes.mjs +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/scan-python-modules.mjs +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/scan-rust-modules.mjs +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/scan-ts-modules.mjs +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/shape-query.mjs +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/studio-core.mjs +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/styles/built-in/corporate.json +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/styles/built-in/default.json +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/styles/built-in/handdrawn.json +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/styles/schema.json +0 -0
- /package/localized/zh-CN/skills/{fec-image-generation → cc-technical-diagrams}/assets/quality-examples/architecture.json +0 -0
- /package/localized/zh-CN/skills/{fec-image-generation → cc-technical-diagrams}/assets/quality-examples/invalid-explicit.json +0 -0
- /package/localized/zh-CN/skills/{fec-image-generation → cc-technical-diagrams}/assets/quality-examples/sequence.json +0 -0
- /package/localized/zh-CN/skills/{fec-image-generation → cc-technical-diagrams}/assets/quality-examples/workflow.json +0 -0
- /package/localized/zh-CN/skills/{fec-image-generation → cc-technical-diagrams}/scripts/export-diagram.mjs +0 -0
- /package/localized/zh-CN/skills/{fec-image-generation → cc-technical-diagrams}/scripts/interactive-diagram-server.mjs +0 -0
- /package/localized/zh-CN/skills/{fec-image-generation → cc-technical-diagrams}/scripts/mermaid-render.mjs +0 -0
- /package/localized/zh-CN/skills/{fec-image-generation → cc-technical-diagrams}/scripts/tech-diagram-render.mjs +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/data/THIRD_PARTY_NOTICES.md +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/data/brand-icons.json +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/data/shape-index.json +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/references/data-residency.md +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/references/diagram-patterns.md +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/references/troubleshooting.md +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/references/xml-and-mermaid.md +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/brand-symbols.mjs +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/diagram-lint.mjs +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/diagram-url.mjs +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/drawio-export.mjs +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/layout-graph.mjs +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/png-embed-fix.mjs +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/scan-go-packages.mjs +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/scan-js-modules.mjs +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/scan-python-classes.mjs +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/scan-python-modules.mjs +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/scan-rust-modules.mjs +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/scan-ts-modules.mjs +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/shape-query.mjs +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/studio-core.mjs +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/styles/built-in/corporate.json +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/styles/built-in/default.json +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/styles/built-in/handdrawn.json +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/styles/schema.json +0 -0
- /package/skills/{fec-image-generation → cc-technical-diagrams}/assets/quality-examples/architecture.json +0 -0
- /package/skills/{fec-image-generation → cc-technical-diagrams}/assets/quality-examples/invalid-explicit.json +0 -0
- /package/skills/{fec-image-generation → cc-technical-diagrams}/assets/quality-examples/sequence.json +0 -0
- /package/skills/{fec-image-generation → cc-technical-diagrams}/assets/quality-examples/workflow.json +0 -0
- /package/skills/{fec-image-generation → cc-technical-diagrams}/scripts/export-diagram.mjs +0 -0
- /package/skills/{fec-image-generation → cc-technical-diagrams}/scripts/interactive-diagram-server.mjs +0 -0
- /package/skills/{fec-image-generation → cc-technical-diagrams}/scripts/mermaid-render.mjs +0 -0
- /package/skills/{fec-image-generation → cc-technical-diagrams}/scripts/tech-diagram-render.mjs +0 -0
|
@@ -1,216 +1,390 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __fecCreateRequire } from "node:module"; const require = __fecCreateRequire(import.meta.url);
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
`)
|
|
3
|
+
var nh=Object.create;var ll=Object.defineProperty;var sh=Object.getOwnPropertyDescriptor;var rh=Object.getOwnPropertyNames;var ih=Object.getPrototypeOf,oh=Object.prototype.hasOwnProperty;var Es=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var K=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(s){throw n=[s],s}};var j=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var ah=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of rh(t))!oh.call(e,r)&&r!==n&&ll(e,r,{get:()=>t[r],enumerable:!(s=sh(t,r))||s.enumerable});return e};var cl=(e,t,n)=>(n=e!=null?nh(ih(e)):{},ah(t||!e||!e.__esModule?ll(n,"default",{value:e,enumerable:!0}):n,e));import{createRequire as lh}from"node:module";import $h from"node:path";import ki from"node:path";import Ce from"node:fs";import $ from"node:path";import{createHash as im}from"node:crypto";import am from"node:fs";import x from"node:path";import zt from"node:fs";import Et from"node:path";import{createHash as lm}from"node:crypto";import Cn from"node:fs";import Ns from"node:path";import{createHash as fm}from"node:crypto";import Ve from"node:path";import Zt from"node:fs";import We from"node:path";import{createHash as ym}from"node:crypto";import jn from"node:fs";import Os from"node:path";import Y from"node:fs";import W from"node:path";import Sl from"node:os";import{randomUUID as wm}from"node:crypto";import Ni from"node:fs";import Dn from"node:path";import Le from"node:fs";import Sc from"node:os";import kt from"node:path";import{randomUUID as Em,createHash as Cm}from"node:crypto";import fe from"node:fs";import qe from"node:path";import{randomUUID as Nm}from"node:crypto";import _s from"node:path";function ul(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Cs(e,t,n){if(!Array.isArray(e)||!e.length||e.some(s=>typeof s!="string"||!/^[a-z][a-z0-9-]*$/.test(s)||n&&!n.includes(s))||new Set(e).size!==e.length)throw new Error(`Invalid capability applicability: ${t}`);return[...e]}function nc(e,t){if(!Array.isArray(e))throw new Error("Capability metadata must be an array");let n=new Set;return e.map(s=>{if(!ul(s)||typeof s.id!="string"||!s.id||n.has(s.id))throw new Error("Invalid or duplicate capability ID");if(n.add(s.id),!Object.hasOwn(t,s.id)||typeof t[s.id]!="string"||!t[s.id])throw new Error(`Missing verified capability source: ${s.id}`);let r={id:s.id,sourcePackage:t[s.id]};if(s.applicability===void 0)return r;if(!ul(s.applicability))throw new Error("Invalid capability applicability");let i=s.applicability,o={};return i.languages!==void 0&&(o.languages=Cs(i.languages,"languages")),i.frameworks!==void 0&&(o.frameworks=Cs(i.frameworks,"frameworks")),i.roles!==void 0&&(o.roles=Cs(i.roles,"roles",tc)),i.taskKinds!==void 0&&(o.taskKinds=Cs(i.taskKinds,"taskKinds",Zs)),{...r,applicability:o}})}function Mh(e,t){let n=e.slice(0,t).split(/\r?\n/);return[n.length,n.pop().length+1]}function qh(e,t,n){let s=e.split(/\r?\n/),r="",i=(Math.log10(t+1)|0)+1;for(let o=t-1;o<=t+1;o++){let l=s[o-1];l&&(r+=o.toString().padEnd(i," "),r+=": ",r+=l,r+=`
|
|
4
|
+
`,o===t&&(r+=" ".repeat(i+n+2),r+=`^
|
|
5
|
+
`))}return r}function rc(e){let t=e.p,n=e.s.charCodeAt(e.p++),s=n,r=n===39,i=n===e.s.charCodeAt(e.p)&&n===e.s.charCodeAt(e.p+1);i&&((n=e.s.charCodeAt(e.p+=2))===10?e.p++:n===13&&e.s.charCodeAt(e.p+1)===10&&(e.p+=2));let o="",l=e.p,c=0;for(;e.p<e.s.length;e.p++)if(n=e.s.charCodeAt(e.p),i&&(n===10||n===13&&e.s.charCodeAt(e.p+1)===10))c=c&&3;else if(n<32&&n!==9||n===127)F.x("control characters are not allowed in strings",e);else if((!c||c===3)&&n===s&&(!i||e.s.charCodeAt(e.p+1)===s&&e.s.charCodeAt(e.p+2)===s)){if(i&&(e.s.charCodeAt(e.p+3)===s&&e.p++,e.s.charCodeAt(e.p+3)===s&&e.p++),!c){let a=e.s.slice(l,e.p);o=o?o+a:a}return e.p+=i?3:1,o}else if(!c)!r&&n===92&&(o+=e.s.slice(l,l=e.p),c=1);else if(c===1)if(n===120||n===117||n===85){let a=e.p++-1,p=0,f=n===120?2:n===117?4:8;for(let u=0;u<f;u++,e.p++){let d=e.s.charCodeAt(e.p),m=d>=48&&d<=57?d-48:d>=65&&d<=70?d-65+10:d>=97&&d<=102?d-97+10:-1;m<0&&F.x("invalid non-hex character in unicode escape",e),p=p<<4|m}(p<0||p>1114111||p>=55296&&p<=57343)&&F.x("invalid unicode escape",e,a),o+=String.fromCodePoint(p),l=e.p--,c=0}else i&&(n===32||n===9)?c=2:(n===98?o+="\b":n===116?o+=" ":n===110?o+=`
|
|
6
|
+
`:n===102?o+="\f":n===114?o+="\r":n===101?o+="\x1B":n===34?o+='"':n===92?o+="\\":F.x("unrecognised escape sequence",e),l=e.p+1,c=0);else n!==32&&n!==9&&(c===2&&F.x("invalid escape: only line-ending whitespace may be escaped",e,l),c=!r&&n===92?1:0,l=e.p);F.x("unfinished string",e,t)}function be(e,t=10){return t===16?e>47&&e<58||e>64&&e<71||e>96&&e<103:e>47&&e<48+t}function Ci(e,t){return e===32||e===9||e===10||e===13||t&&(e===t||e===44)||e===35}function Mi(e,t){let n=e.p,s=e.s.charCodeAt(e.p);if(s===91||s===123){e.d--||F.x("document contains excessively nested structures. aborting.",e);let r=s===91?Vh(e):Yh(e);return e.d++,r}return s===34||s===39?rc(e):s===116?((e.s.charCodeAt(++e.p)!==114||e.s.charCodeAt(++e.p)!==117||e.s.charCodeAt(++e.p)!==101)&&F.x("invalid value",e,n),e.p++,!0):s===102?((e.s.charCodeAt(++e.p)!==97||e.s.charCodeAt(++e.p)!==108||e.s.charCodeAt(++e.p)!==115||e.s.charCodeAt(++e.p)!==101)&&F.x("invalid value",e,n),e.p++,!1):s===43||s===45?Ps(e,e.p,e.s.charCodeAt(++e.p),44-s,t):e.s.charCodeAt(e.p+4)===45&&e.s.charCodeAt(e.p+7)===45?Kh(e,s,t):e.s.charCodeAt(e.p+2)===58?Uh(e,s,t):Ps(e,e.p,s,0,t)}function Ps(e,t,n,s,r){let i=n,o=0,l=!1;if(i===105)return(e.s.charCodeAt(++e.p)!==110||e.s.charCodeAt(++e.p)!==102)&&F.x("invalid value",e,t),e.p++,(s||1)/0;if(i===110)return(e.s.charCodeAt(++e.p)!==97||e.s.charCodeAt(++e.p)!==110)&&F.x("invalid value",e,t),e.p++,NaN;if(i===48){if(++e.p>=e.s.length||Ci(i=e.s.charCodeAt(e.p),r))return e.bi===!0?0n:0;if(!s){if(i===120)return vi(e,t,16,r);if(i===98)return vi(e,t,2,r);if(i===111)return vi(e,t,8,r)}i===46?o=2:i===101||i===69?o=4:F.x("illegal leading zero",e,t)}else be(i)||F.x("invalid value",e,t);for(;++e.p<e.s.length&&(i=e.s.charCodeAt(e.p),!Ci(i,r));)o||(o=1),i===95?(o&1||F.x("illegal underscore",e),o+=11,l=!0):o===1&&i===46?o=2:(o===1||o===3)&&(i===101||i===69)?o=4:o===4&&(i===43||i===45)?o=6:be(i)?o>9?o-=11:o&1||o++:F.x("illegal character in numeric literal",e);if(!o){let a=(n-48)*(s||1);return e.bi===!0?BigInt(a):a}o&1||F.x("unfinished numeric value",e,t);let c=e.s.slice(t,e.p);return l&&(c=c.replaceAll("_","")),o>1?parseFloat(c):ic(e,c,10,t)}function vi(e,t,n,s){let r,i=1;for(;++e.p<e.s.length&&(r=e.s.charCodeAt(e.p),!Ci(r,s));)r===95?(i&1&&F.x("illegal underscore",e),i=3):be(r,n)?i&1&&i--:F.x("illegal character in numeric literal",e);i&1&&F.x("unfinished numeric value",e);let o=e.s.slice(t+2,e.p);return i&&(o=o.replaceAll("_","")),ic(e,o,n,t)}function ic(e,t,n,s){if(e.bi!==!0)e:{let r=parseInt(t,n);if(!Number.isSafeInteger(r)){if(e.bi)break e;F.x("integer value cannot be represented losslessly",e,s)}return r}return BigInt(n===10?t:(n===2?"0b":n===8?"0o":"0x")+t)}function Kh(e,t,n){let s=e.p++,r;if(!be(t)||!be(e.s.charCodeAt(e.p++))||!be(e.s.charCodeAt(e.p++))||!be(e.s.charCodeAt(e.p++)))return Ps(e,e.p=s,t,0,n);if(e.p+=5,be(e.s.charCodeAt(e.p++))||F.x("invalid date-time: date part is malformed",e,s),e.p>=e.s.length||((t=e.s.charCodeAt(e.p))!==32||(r=!0,!be(e.s.charCodeAt(e.p+1))))&&t!==84&&t!==116){let o=e.s.slice(s,e.p);return On(e,o,3,!1,s)}if(e.s.charCodeAt(e.p+=3)!==58&&F.x("invalid date-time: time part is malformed",e,s),e.s.charCodeAt(e.p+=3)===58&&(e.p+=3),e.s.charCodeAt(e.p)===46)for(;be(e.s.charCodeAt(++e.p)););if(t=e.s.charCodeAt(e.p)){if(t===90||t===122){let o=e.s.slice(s,++e.p);return On(e,o,1,r,s,"[+00:00]")}if(t===43||t===45){let o=e.s.slice(s,e.p+=6);return On(e,o,1,r,s,!e.ld&&"["+e.s.slice(e.p-6,e.p)+"]")}}let i=e.s.slice(s,e.p);return On(e,i,2,r,s)}function Uh(e,t,n){let s=e.p;if(!be(t)||!be(e.s.charCodeAt(++e.p)))return Ps(e,--e.p,t,0,n);if(e.s.charCodeAt(e.p+=4)===58&&(e.p+=3),e.s.charCodeAt(e.p)===46)for(;be(e.s.charCodeAt(++e.p)););let r=e.s.slice(s,e.p);return On(e,r,4,!1,s)}function On(e,t,n,s,r,i){if(e.ld){let o=new Rh(t,n,s);return o.isValid()||F.x("invalid date",e,r),o}try{switch(i&&(t+=i),n){case 1:return Temporal.ZonedDateTime.from(t);case 2:return Temporal.PlainDateTime.from(t);case 3:return Temporal.PlainDate.from(t);case 4:return Temporal.PlainTime.from(t)}}catch(o){F.x(o instanceof Error?o.message:""+o,e,r)}}function Jh(e){for(;e.p<e.s.length;e.p++){let t=e.s.charCodeAt(e.p);if(t===10)break;if(t===13&&e.s.charCodeAt(e.p+1)===10){e.p++;break}(t<32&&t!==9||t===127)&&F.x("control characters are not allowed in comments",e)}}function He(e,t,n){let s;for(;e.p<e.s.length;){for(;e.p<e.s.length&&((s=e.s.charCodeAt(e.p))===32||s===9||!t&&(s===10||s===13&&e.s.charCodeAt(e.p+1)===10));)e.p++;if(n||s!==35)break;Jh(e)}}function Ai(e,t=61){let n,s=0,r=[],i,o=e.s.charCodeAt(n=e.p);do{if(o===t)return s||F.x("unexpected end of key",e),s===1&&r.push(e.s.slice(i,e.p)),e.p++,r;o===46?(s||F.x("illegal empty bare key",e),s===1&&r.push(e.s.slice(i,e.p)),s=0):!s&&(o===34||o===39)?(o===e.s.charCodeAt(e.p+1)&&o===e.s.charCodeAt(e.p+2)&&F.x("illegal quoted key: multiline strings are not allowed",e),r.push(rc(e)),s=2,e.p--):o===32||o===9?s===1&&(r.push(e.s.slice(i,e.p)),s=2):s===2||o<48&&o!==45||o>57&&o<65||o>90&&o<97&&o!==95||o>122?F.x("illegal character in key",e):s||(s=1,i=e.p)}while(o=e.s.charCodeAt(++e.p));F.x("incomplete key-value: cannot find end of key",e,n)}function Yh(e){let t=e.p++,n=Object.create(null),s=new Set,r;for(;e.p<e.s.length;){if(He(e),(r=e.s.charCodeAt(e.p))===125)return e.p++,n;let i,o=n,l=!1,c=e.p,a=Ai(e);for(let f=0;f<a.length;f++){f&&(o=l?o[i]:o[i]=Object.create(null)),i=a[f],(l=Object.hasOwn(o,i))&&(typeof o[i]!="object"||s.has(o[i]))&&F.x("trying to redefine an already defined value",e,c);let u=i==="__proto__";if(e.uk&&(u||i==="constructor")){o=e.uk!==1&&F.x("document contains an unsafe property",e,c);break}!l&&u&&Object.defineProperty(o,i,{enumerable:!0,configurable:!0,writable:!0})}l&&F.x("trying to redefine an already defined value",e,c),He(e,!0,!0);let p=Mi(e,125);if(o&&typeof(o[i]=p)=="object"&&s.add(p),He(e),(r=e.s.charCodeAt(e.p++))===125)return n;r!==44&&F.x("expected comma or end of structure",e,e.p-1)}F.x("unfinished table",e,t)}function Vh(e){let t=e.p++,n=[],s;for(;e.p<e.s.length;){if(He(e),(s=e.s.charCodeAt(e.p))===93)return e.p++,n;if(n.push(Mi(e,93)),He(e),(s=e.s.charCodeAt(e.p++))===93)return n;s!==44&&F.x("expected comma or end of structure",e,e.p-1)}F.x("unfinished array",e,t)}function fl(e,t,n,s,r){let i=n,o=s,l,c=!1,a;for(let p=0;p<t.length;p++){if(p){if(i=c?i[l]:i[l]=Object.create(null),o=(a=o[l]).c,r===0&&(a.t===1||a.t===2))return null;if(a.t===2){let f=i.length-1;i=i[f],o=o[f].c}}if(l=t[p],(c=Object.hasOwn(i,l))&&o[l]?.t===0&&o[l]?.d)return null;if(!c){let f=l==="__proto__";if(e.uk&&(f||l==="constructor"))return!1;f&&(Object.defineProperty(i,l,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(o,l,{enumerable:!0,configurable:!0,writable:!0})),o[l]={t:p<t.length-1&&r===2?3:r,d:!1,i:0,c:Object.create(null)}}}if(a=o[l],a.t!==r&&!(r===1&&a.t===3)||(r===2&&(a.d||(a.d=!0,i[l]=[]),i[l].push(i=Object.create(null)),a.c[a.i++]=a={t:1,d:!1,i:0,c:Object.create(null)}),a.d))return null;if(a.d=!0,r===1)i=c?i[l]:i[l]=Object.create(null);else if(r===0&&c)return null;return[l,i,a.c]}function dl(e,t,n){(t===null||e.uk===2)&&F.x(t===null?"trying to redefine an already defined table or value":"document contains an unsafe property",e,n)}function qi(e,t={}){let n={s:e,p:0,d:t.maxDepth??1e3,bi:t.integersAsBigInt??!1,ld:t.useLegacyDate??!0,uk:t.unsafeKeyBehaviour==="throw"?2:t.unsafeKeyBehaviour==="drop"?1:0},s=Object.create(null),r=Object.create(null),i,o=!1,l=s,c=r;for(e.charCodeAt(0)===65279&&n.p++,He(n);n.p<e.length;){if(e.charCodeAt(n.p)===91){let a=e.charCodeAt(++n.p)===91;i=n.p+=+a,o=!1;let p=Ai(n,93);a&&(e.charCodeAt(n.p)!==93&&F.x("expected end of table array declaration",n),n.p++);let f=fl(n,p,s,r,a?2:1);f?(c=f[2],l=f[1]):(dl(n,f,i),o=!0)}else{i=n.p;let a=Ai(n),p=fl(n,a,l,c,0);!p&&!o&&dl(n,p,i),He(n,!0,!0);let f=Mi(n,void 0);p&&!o&&(p[1][p[0]]=f)}He(n,!0),n.p<e.length&&(i=e.charCodeAt(n.p))!==10&&(i!==13||e.charCodeAt(n.p+1)!==10)&&F.x("each key-value declaration must be followed by an end-of-line",n),He(n)}return s}function $n(e){let t=typeof e;if(t==="object"){if(Array.isArray(e))return"array";if(typeof e.getUTCDate=="function"&&e instanceof Date)return"date";if(globalThis.Temporal){if(e.until){if(e instanceof Temporal.ZonedDateTime)return"temporal/tz+uc";if(e instanceof Temporal.PlainDateTime||e instanceof Temporal.PlainDate)return"temporal/uc";if(e instanceof Temporal.PlainTime||e instanceof Temporal.Instant)return"temporal";if(e instanceof Temporal.PlainYearMonth)return"temporal/x"}else if(e.toPlainDate&&e instanceof Temporal.PlainMonthDay||e.negated&&e instanceof Temporal.Duration)return"temporal/x"}}return t}function Wh(e){for(let t=0;t<e.length;t++)if($n(e[t])!=="object")return!1;return e.length!=0}function ac(e){return JSON.stringify(e).replaceAll("","\\u007f")}function Gh(e){return ac(oc?e.toWellFormed():e)}function lc(e){if(xh.test(e))return e;if(oc&&!e.isWellFormed())throw new RangeError("key contains illegal lone surrogates");return ac(e)}function Bi(e,t,n,s,r){if(n===0)throw new Error("Could not stringify the object: maximum object depth exceeded");switch(t){case"number":if(isNaN(e))return"nan";if(e===1/0)return"inf";if(e===-1/0)return"-inf";if(Number.isInteger(e)&&(s||!Number.isSafeInteger(e)))return e.toFixed(1);case"bigint":case"boolean":case"temporal":return e.toString();case"string":return Gh(e);case"date":if(isNaN(e.getTime()))throw new TypeError("cannot serialize invalid date");return e.toISOString();case"object":return Hh(e,n,s,r);case"array":return zh(e,n,s,r);case"temporal/tz+uc":if(r){let i=e.timeZoneId,o=i.charCodeAt(0);if(o!==43&&o!==45&&(o!==85&&o!==71&&o!==90&&o!==69||i!=="UTC"&&i!=="UCT"&&i!=="Universal"&&i!=="Zulu"&&!i.startsWith("GMT")&&i!=="Greenwich"&&!i.startsWith("Etc/")))throw new TypeError("Temporal objects with an IANA timezone are not allowed in Temporal strict mode")}case"temporal/uc":if(r&&e.calendarId!=="iso8601")throw new TypeError("Temporal objects with a non-default calendar are not allowed in Temporal strict mode");return e.toString({calendarName:"never",timeZoneName:"never"});case"temporal/x":throw new TypeError("Unsupported "+e[Symbol.toStringTag])}}function Hh(e,t,n,s){let r=Object.keys(e);if(r.length===0)return"{}";let i="{ ";for(let o=0;o<r.length;o++){let l=r[o];o&&(i+=", "),i+=lc(l)+" = "+Bi(e[l],$n(e[l]),t-1,n,s)}return i+" }"}function zh(e,t,n,s){if(e.length===0)return"[]";let r="[ ";for(let i=0;i<e.length;i++){if(i&&(r+=", "),e[i]===null||e[i]===void 0)throw new TypeError("arrays cannot contain null or undefined values");r+=Bi(e[i],$n(e[i]),t-1,n,s)}return r+" ]"}function Qh(e,t,n,s,r){if(n===0)throw new Error("Could not stringify the object: maximum object depth exceeded");let i="";for(let o=0;o<e.length;o++)i+=`${i&&`
|
|
7
|
+
`}[[${t}]]
|
|
8
|
+
`,i+=Ri(0,e[o],t,n,s,r);return i}function Ri(e,t,n,s,r,i){if(s===0)throw new Error("Could not stringify the object: maximum object depth exceeded");let o="",l="",c=Object.keys(t);for(let a=0;a<c.length;a++){let p=c[a];if(t[p]!==null&&t[p]!==void 0){let f=$n(t[p]);if(f==="symbol"||f==="function")throw new TypeError(`cannot serialize values of type '${f}'`);let u=lc(p);if(f==="array"&&Wh(t[p]))l+=(l&&`
|
|
9
|
+
`)+Qh(t[p],n?`${n}.${u}`:u,s-1,r,i);else if(f==="object"){let d=n?`${n}.${u}`:u;l+=(l&&`
|
|
10
|
+
`)+Ri(d,t[p],d,s-1,r,i)}else o+=u,o+=" = ",o+=Bi(t[p],f,s,r,i),o+=`
|
|
11
|
+
`}}return e&&(o||!l)&&(o=o?`[${e}]
|
|
12
|
+
${o}`:`[${e}]`),o&&l?`${o}
|
|
13
|
+
${l}`:o||l}function Xh(e,{maxDepth:t=1e3,numbersAsFloat:n=!1,strictTemporal:s=!1}={}){if($n(e)!=="object")throw new TypeError("stringify can only be called with an object");let r=Ri(0,e,"",t,n,s);return r[r.length-1]!==`
|
|
14
|
+
`?r+`
|
|
15
|
+
`:r}function tm(e){let t=new Set;for(let n of fc(e)){if(!["project","enable_language"].includes(n.name))continue;let s=/\bLANGUAGES\b/i.test(n.args)?n.args.split(/\bLANGUAGES\b/i)[1]:n.name==="enable_language"?n.args:"";/\bC\b/.test(s)&&t.add("c"),/\bCXX\b/.test(s)&&t.add("cpp")}return[...t].sort()}function X(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{}}function Ht(e){let t=JSON.parse(e);if((0,cc.parseDocument)(e,{uniqueKeys:!0}).errors.length||!t||typeof t!="object"||Array.isArray(t))throw new Error("Invalid JSON manifest");return X(t)}function In(e){return X(qi(e))}function hl(e){let t=(0,cc.parseDocument)(e,{uniqueKeys:!0,strict:!0});if(t.errors.length)throw new Error("Invalid YAML manifest");return X(t.toJS({maxAliasCount:10}))}function Ki(e){if(typeof e!="string")return;let t=e.trim();return t.length<=128&&/^(?:[~^<>=!]*\s*v?\d[0-9A-Za-z.*+~<>=!,|\s-]*|\*)$/.test(t)?t:void 0}function uc(e){let t=Ht(e);return["dependencies","devDependencies","peerDependencies","optionalDependencies"].flatMap(n=>{if(t[n]!==void 0&&(!t[n]||typeof t[n]!="object"||Array.isArray(t[n])))throw new Error("Invalid npm dependency table");return Object.entries(X(t[n])).map(([s,r])=>{if(typeof r!="string")throw new Error("Invalid npm dependency value");return{name:s,version:Ki(r)}})})}function ml(e){let t=In(e);return[X(t.dependencies),X(t["build-dependencies"]),...Object.values(X(t.target)).flatMap(s=>[X(X(s).dependencies),X(X(s)["build-dependencies"])])].flatMap(s=>Object.entries(s).map(([r,i])=>({name:typeof X(i).package=="string"?X(i).package:r,version:Ki(typeof i=="string"?i:X(i).version)})))}function fc(e){let t=[],n=0,s=()=>/^\[(=*)\[/.exec(e.slice(n))?.[1],r=l=>{let c=e.indexOf("]"+l+"]",n+l.length+2);if(c<0)throw new Error("Unclosed CMake bracket");n=c+l.length+2},i=()=>{if(e[n]!=="#")return!1;n++;let l=s();if(l!==void 0)r(l);else{let c=e.indexOf(`
|
|
16
|
+
`,n);n=c<0?e.length:c+1}return!0},o=()=>{let l=n++;for(;n<e.length;){if(e[n]==="\\"){n+=2;continue}if(e[n++]==='"')return e.slice(l,n)}throw new Error("Unclosed CMake string")};for(;n<e.length;){if(/\s/.test(e[n])){n++;continue}if(i())continue;if(e[n]==='"'){o();continue}let l=s();if(l!==void 0){r(l);continue}let c=/^[A-Za-z_][A-Za-z0-9_]*/.exec(e.slice(n));if(!c){n++;continue}for(n+=c[0].length;n<e.length&&/\s/.test(e[n]);)n++;if(e[n]!=="(")continue;n++;let a=1,p="";for(;n<e.length&&a;){if(i()){p+=" ";continue}if(e[n]==='"'){p+=o();continue}let f=s();if(f!==void 0){r(f),p+=" ";continue}let u=e[n++];u==="("&&a++,u===")"&&a--,a&&(p+=u)}if(a)throw new Error("Unclosed CMake command");t.push({name:c[0].toLowerCase(),args:p})}return t}function jt(e,t,n){return{id:e,detect(s){let r=s.readManifest("package.json");if(!r)return;let i=uc(r).find(o=>t.includes(o.name));if(i)return{evidence:{id:e,version:i.version,paths:["package.json"]},roles:[...n],relatedRoots:[]}}}}function dc(e){let t=e.maxDepth??12,n=e.maxEntries??1e4;if(!Number.isInteger(t)||t<0||t>64||!Number.isInteger(n)||n<1||n>1e6)throw new Error("扫描参数非法");let s=$.resolve(e.workspace),r=Ce.realpathSync(s);if(!Ce.statSync(r).isDirectory())throw new Error("工作区必须是目录");let i;if(e.taskPath){let b=$.resolve(s,e.taskPath);if(!it(s,b))throw new Error("任务路径越过工作区边界");i=$.resolve(r,$.relative(s,b));let E=i;for(;gl(E)!==gl(r);){try{if(Ce.lstatSync(E).isSymbolicLink())throw new Error("任务路径包含链接,无法确认边界")}catch(A){if(!["ENOENT","ENOTDIR"].includes(A.code??""))throw A}let C=$.dirname(E);if(C===E)throw new Error("任务路径越界");E=C}}let o={schemaVersion:1,workspace:r,units:[],warnings:[],truncated:!1},l=[],c=0,a=(b,E=!1)=>{o.warnings.push(b),E&&(o.truncated=!0)};function p(b,E){if(c>=n){a("达到扫描数量上限,结果不完整",!0);return}if(E>t){a("达到扫描深度上限:"+$.relative(r,b),!0);return}let C;try{C=Ce.opendirSync(b)}catch{a("无法读取目录:"+$.relative(r,b),!0);return}try{let A;for(;(A=C.readSync())!==null;){if(++c>n){a("达到扫描数量上限,结果不完整",!0);break}let N=$.join(b,A.name);A.isSymbolicLink()||(A.isDirectory()?!em.has(A.name)&&!A.name.startsWith(".ssh")&&p(N,E+1):A.isFile()&&!pl(A.name)&&(Object.hasOwn(Si,A.name)||As(A.name))&&l.push(N))}}finally{C.closeSync()}}p(r,0),l.sort();let f=new Set(l),u=new Map,d=new Set,m=new Map,h=b=>$.relative(r,b).split($.sep).join("/");function g(b){let E=u.get(b);return E||(E={root:b,languages:[],frameworks:[],roles:[],evidence:[],buildFiles:[],relatedRoots:[],ambiguous:!1},u.set(b,E)),E}function y(b){if(m.has(b))return m.get(b);if(m.set(b,void 0),!(!f.has(b)||!Object.hasOwn(Si,$.basename(b))||$.basename(b)==="setup.py"))try{let E=Ce.lstatSync(b);if(!E.isFile()||E.isSymbolicLink()||!it(r,Ce.realpathSync(b)))throw new Error("Unsafe manifest");if(E.size>262144){a("清单过大,未读取:"+h(b)),d.add(b);return}let C=Ce.openSync(b,Ce.constants.O_RDONLY|(Ce.constants.O_NOFOLLOW??0)),A;try{if(!Ce.fstatSync(C).isFile())throw new Error("Unsafe manifest");let N=Buffer.alloc(262145),O=Ce.readSync(C,N,0,N.length,0);if(O>262144)throw new Error("Manifest grew");if(A=N.subarray(0,O).toString("utf8"),A.includes("\0"))throw new Error("Binary manifest")}finally{Ce.closeSync(C)}return b.endsWith(".json")?Ht(A):b.endsWith(".toml")?In(A):b.endsWith(".yaml")&&hl(A),m.set(b,A),A}catch{a("清单无法读取或解析:"+h(b)),d.add(b);return}}let w=(b,E)=>{b.languages.includes(E)||b.languages.push(E)};for(let b of l){let E=Si[$.basename(b)];if(!E)continue;let C=g($.dirname(b));C.buildFiles.push(h(b)),C.evidence.push(h(b));for(let N of E)w(C,N);let A=y(b);try{if(A&&$.basename(b)==="CMakeLists.txt")for(let N of tm(A))w(C,N);if(A&&$.basename(b)==="package.json"){let N=Ht(A);(X(N.dependencies).typescript||X(N.devDependencies).typescript)&&w(C,"typescript"),typeof N.main=="string"&&As(N.main)&&w(C,As(N.main))}}catch{d.add(b),a("清单语言证据无法解析:"+h(b))}}for(let b of l){let E=As(b);if(!E)continue;let C=[...u.keys()].filter(N=>it(N,b)).sort((N,O)=>O.length-N.length)[0]??r,A=g(C);w(A,E),A.evidence.push(h(b))}let v=new Map;for(let b of u.values()){let E=l.filter(O=>it(b.root,O)).map(O=>$.relative(b.root,O).split($.sep).join("/")),C=O=>{if(!(!O||$.isAbsolute(O)||O.includes("\\")||O.split("/").some(I=>!I||I==="."||I==="..")||pl($.basename(O))))return y($.join(b.root,O))},A=[...rm,...e.detectors??[]],N=new Set;for(let O of A)if(!N.has(O.id)){N.add(O.id);try{let I=O.detect({root:b.root,files:E,readManifest:C});if(!I)continue;if(I.evidence.id!==O.id||!/^[a-z][a-z0-9-]*$/.test(O.id)||!Array.isArray(I.roles)||I.roles.some(_=>!tc.includes(_))||!Array.isArray(I.relatedRoots))throw new Error("Invalid detector result");let L=I.evidence.paths.map(_=>$.resolve(b.root,_));if(!L.length||L.some(_=>!f.has(_)||!it(b.root,_)||!m.get(_)))throw new Error("Unverified framework evidence");let G=Ki(I.evidence.version);b.frameworks.push({id:O.id,version:G,paths:L.map(h)});for(let _ of I.roles)b.roles.includes(_)||b.roles.push(_);for(let _ of I.relatedRoots){let ne=$.resolve(b.root,_);if(it(r,ne)&&u.has(ne)){let Q=v.get(b.root)??new Set;Q.add(ne),v.set(b.root,Q)}}G||a("框架版本约束不明:"+O.id+"("+h(b.root)+")")}catch{a("框架证据无法解析:"+O.id+"("+h(b.root)+")")}}try{let O=C("package.json");if(O){let _=Ht(O);(typeof _.bin=="string"||Object.keys(X(_.bin)).length)&&!b.roles.includes("cli")&&b.roles.push("cli")}let I=C("pyproject.toml");I&&Object.keys(X(X(In(I).project).scripts)).length&&!b.roles.includes("cli")&&b.roles.push("cli");let L=C("Cargo.toml");L&&!b.roles.length&&(Object.keys(X(In(L).lib)).length||E.includes("src/lib.rs"))&&b.roles.push("native-library");let G=C("CMakeLists.txt");G&&!b.roles.length&&fc(G).some(_=>_.name==="add_library")&&b.roles.push("native-library")}catch{a("应用角色证据无法解析:"+h(b.root))}}let S=(b,E)=>{if(b===E)return;let C=u.get(b),A=u.get(E);!C||!A||(C.relatedRoots.includes(E)||C.relatedRoots.push(E),A.relatedRoots.includes(b)||A.relatedRoots.push(b))};for(let[b,E]of v)for(let C of E){let A=u.get(b),N=u.get(C);A.frameworks.some(O=>O.id==="tauri")&&N.frameworks.some(O=>O.id==="tauri")&&($.dirname(b)===C||$.dirname(C)===b)&&S(b,C)}function k(b,E,C){if(Array.isArray(E))for(let A of E){if(typeof A!="string"||!A||A.startsWith("!")||$.isAbsolute(A)||A.split(/[\\/]/).some(I=>I===".."||I===".")){a("工作区成员模式无法确认:"+h(b.root));continue}let N=A.split("/").map(I=>I==="**"?".*":I.split("*").map(L=>L.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("[^/]*")).join("/"),O=new RegExp("^"+N+"$");for(let I of u.values()){let L=$.relative(b.root,I.root).split($.sep).join("/");it(b.root,I.root)&&O.test(L)&&f.has($.join(I.root,C))&&S(b.root,I.root)}}}for(let b of u.values())try{let E=y($.join(b.root,"package.json"));if(E){let N=Ht(E),O=Array.isArray(N.workspaces)?N.workspaces:X(N.workspaces).packages;k(b,O,"package.json")}let C=y($.join(b.root,"Cargo.toml"));C&&k(b,X(In(C).workspace).members,"Cargo.toml");let A=y($.join(b.root,"pnpm-workspace.yaml"));A&&k(b,hl(A).packages,"package.json")}catch{a("工作区成员清单无法解析:"+h(b.root))}return o.units=[...u.values()].map(b=>({...b,languages:b.languages.sort(),frameworks:b.frameworks.sort((E,C)=>E.id.localeCompare(C.id)),roles:b.roles.length?b.roles.sort():["unknown"],evidence:[...new Set(b.evidence)].sort(),buildFiles:b.buildFiles.sort(),relatedRoots:b.relatedRoots.sort(),ambiguous:!b.languages.length||!b.buildFiles.length||b.buildFiles.some(E=>d.has($.join(r,E)))})).sort((b,E)=>b.root.localeCompare(E.root,"en")),i&&!o.units.some(b=>it(b.root,i))&&a("任务路径没有可确认的项目根"),o.warnings=[...new Set(o.warnings)],o}function $s(e,t){return`
|
|
17
|
+
<!-- `+t+`:start -->
|
|
18
|
+
`+e+`
|
|
19
|
+
<!-- `+t+`:end -->
|
|
20
|
+
`}function om(e,t,n,s,r=t.id){let i="<!-- "+r+":start -->",o="<!-- "+r+":end -->",l=e.split(i).length-1,c=e.split(o).length-1;if(l===0&&c===0)return n==="remove"?e:e+$s(t.value,r);if(l!==1||c!==1||!s||s.kind!=="text-marker")return;let a=e.indexOf(i)-1,p=e.indexOf(o)+o.length+1;if(a<0||p<=a)return;let f=e.slice(a,p);if(Ct(Buffer.from(f))!==s.hash)return;let u=e.slice(0,a)+(n==="upsert"?$s(t.value,r):"")+e.slice(p);return n==="remove"&&t.createdFile&&u===""?null:u}function Ln(e){if(Array.isArray(e))return"["+e.map(Ln).join(",")+"]";if(e&&typeof e=="object")return"{"+Object.keys(e).sort().map(n=>JSON.stringify(n)+":"+Ln(e[n])).join(",")+"}";let t=JSON.stringify(e);if(t===void 0)throw new Error("Configuration value must be JSON serializable");return t}function Te(e,t){if(e.kind!=="text-marker")return Ct(Buffer.from(Ln(e.value)));let n=t?.markerId??e.id;if(!n||!/^[a-z][a-z0-9-]*$/.test(n)||typeof e.value!="string")throw new Error("Text entry hashing requires a valid owner marker and string value");return Ct(Buffer.from($s(e.value,n)))}function Ne(e){let t=Et.resolve(e),n=[];for(;!zt.existsSync(t);){let s=Et.dirname(t);if(s===t)throw new Error(`无法解析真实路径:${e}`);n.unshift(Et.basename(t)),t=s}return Et.join(zt.realpathSync.native(t),...n)}function ot(e){let t=Ne(e),n=Et.join(Et.dirname(t),"craft-manifests");if(zt.existsSync(n)&&zt.lstatSync(n).isSymbolicLink())throw new Error("公共账本目录不允许符号链接");let s=lm("sha256").update(process.platform==="win32"?t.toLowerCase():t).digest("hex"),r=Et.join(n,s);if(zt.existsSync(r)&&zt.lstatSync(r).isSymbolicLink())throw new Error("公共账本目录不允许符号链接");return{target:t,ledgerDir:r}}function cm(e){if(!Object.hasOwn(Ms,e))throw new Error(`Unknown runtime: ${e}`);return Ms[e]}function Dt(e){let t=cm(e.runtime),{runtime:n,env:s,compatibility:r,scope:i}=e;if(i!=="local"&&i!=="global")throw new Error("Invalid scope");if(r!=="frontend"&&r!=="backend")throw new Error("Invalid compatibility profile");let o=x.resolve(e.cwd),l=x.resolve(e.home),c=w=>r==="frontend"?w==="~"||w.startsWith("~/")?x.join(l,w.slice(1)):w:w.replace(/^~(?=[\\/]|$)/,l),a=w=>r==="frontend"?!!w:w!==void 0,p=n==="codex"?"CODEX_HOME":n==="openclaw"?"OPENCLAW_STATE_DIR":`${n.toUpperCase()}_CONFIG_DIR`,f=a(s[p])?s[p]:n==="openclaw"&&a(s.OPENCLAW_CONFIG_DIR)?s.OPENCLAW_CONFIG_DIR:void 0,u=r==="frontend"?s.XDG_CONFIG_HOME?c(s.XDG_CONFIG_HOME):x.join(l,".config"):s.XDG_CONFIG_HOME??x.join(l,".config"),d={windsurf:x.join(l,".codeium","windsurf"),opencode:x.join(u,"opencode"),kilo:x.join(u,"kilo"),antigravity:x.join(l,".gemini","config"),cline:x.join(l,"Documents","Cline")},m=f===void 0?d[n]??x.join(l,`.${n}`):c(f),h=i==="local"?x.join(o,t.localDirectory):r==="backend"?x.resolve(m):m,g=e.baseDir??h,y=t.skills?n==="codex"?x.join(i==="global"?l:o,".agents","skills"):n==="openclaw"?x.join(i==="global"?g:o,"skills"):x.join(g,"skills"):void 0;return{baseDir:g,...y?{skillsDir:y}:{},resourceRoots:[...new Set([g,...y?[y]:[],...i==="local"?[o]:[]].map(w=>x.resolve(w)))]}}function V(e){let t=x.resolve(e);return process.platform==="win32"?t.toLowerCase():t}function um(e,t){let n=x.relative(e,t);return!x.isAbsolute(n)&&n!==".."&&!n.startsWith(`..${x.sep}`)}function oe(e,t){let n=x.resolve(e),s=t.flatMap(r=>{let i=Ne(r);return[{boundary:x.resolve(r),real:i},{boundary:i,real:i}]}).sort((r,i)=>i.boundary.length-r.boundary.length);for(let{boundary:r,real:i}of s){if(V(n)===V(r)||!um(r,n))continue;let o=n;for(;V(o)!==V(r);){try{if(am.lstatSync(o).isSymbolicLink())throw new Error(`Product path contains an internal link: ${o}`)}catch(c){if(!["ENOENT","ENOTDIR"].includes(c.code??""))throw c}let l=x.dirname(o);if(l===o)throw new Error("Product path did not reach its declared boundary");o=l}return x.resolve(i,x.relative(r,n))}throw new Error(`Product path exceeds its allowed boundary: ${e}`)}function pc(e,t,n=[]){let s=Ve.resolve(e),r=[...n].sort((o,l)=>l.length-o.length).find(o=>{let l=Ve.relative(o,s);return l&&!Ve.isAbsolute(l)&&l!==".."&&!l.startsWith(".."+Ve.sep)}),i=(r?Ve.relative(r,s):s).split(Ve.sep);if(r&&js.has(Ve.basename(r).toLowerCase())&&i.unshift(Ve.basename(r)),i.some(o=>["craft-manifests",t.stateDirectoryName.toLowerCase()].includes(o.toLowerCase()))||Ve.basename(e).toLowerCase()===t.manifestName.toLowerCase()||i.some(o=>o.toLowerCase()===".claude-plugin")&&!(t.nativeMetadata===!0&&i.at(-2)?.toLowerCase()===".claude-plugin"&&["plugin.json","marketplace.json"].includes(i.at(-1).toLowerCase())))throw new Error(`Product write targets reserved ownership state: ${e}`);for(let o=0;o<i.length;o++){let l=i[o].toLowerCase();if(l.startsWith("cc-")&&(o===i.length-1||js.has(i[o-1]?.toLowerCase())))throw new Error(`Product cannot claim a common namespace: ${e}`);if(js.has(l)&&i[o+1]){let c=i[o+1].toLowerCase();if(/^[a-z][a-z0-9]*-/.test(c)&&!c.startsWith(t.resourcePrefix.toLowerCase())&&!c.startsWith(t.markerId.toLowerCase())&&!(t.resourceEntries?.[l]??[]).some(a=>a.toLowerCase()===c)&&!i.slice(0,o).some(a=>a.toLowerCase()===t.markerId.toLowerCase()))throw new Error(`Product cannot claim another resource namespace: ${e}`)}if(o===i.length-1&&l.endsWith(".manifest.json")&&l!==t.manifestName.toLowerCase())throw new Error(`Product cannot claim another ownership manifest: ${e}`)}}function Ui(e){if(!e.packageName||!e.consumerProduct||!/^[a-z][a-z0-9-]*-$/.test(e.resourcePrefix)||e.resourcePrefix==="cc-"||!/^[a-z][a-z0-9-]*$/.test(e.markerId)||!/^[a-z0-9][a-z0-9.-]*\.manifest\.json$/.test(e.manifestName)||!/^\.?[a-z0-9][a-z0-9.-]*$/.test(e.stateDirectoryName)||e.retainUnrequestedFiles!==void 0&&typeof e.retainUnrequestedFiles!="boolean"||e.nativeMetadata!==void 0&&typeof e.nativeMetadata!="boolean"||e.resourceEntries!==void 0&&Object.entries(e.resourceEntries).some(([t,n])=>!js.has(t)||!Array.isArray(n)||n.some(s=>typeof s!="string"||!s||/[\\/]/.test(s)||s==="."||s==="..")))throw new Error("Invalid product ownership definition")}function qs(e){if(!e.length||e.some(t=>!t||["__proto__","prototype","constructor"].includes(t)))throw new Error("共享配置路径无效")}function Xt(e,t){let n=e;for(let s of t){if(!n||typeof n!="object"||Array.isArray(n)||!Object.hasOwn(n,s))return;n=n[s]}return n}function hc(e){let t;try{if(t=e.trim()?JSON.parse(e):{},(0,dm.parseDocument)(e||"{}",{uniqueKeys:!0}).errors.length)throw new Error("重复键");if(!t||typeof t!="object"||Array.isArray(t))throw new Error("非对象")}catch{throw new Error("共享 JSON 配置损坏或包含重复键")}return t}function pm(e,t,n,s){let r=hc(e),i=t.kind==="json-hook"?["hooks",t.event]:t.path;qs(i);let o=r;for(let c of i.slice(0,-1)){if(!Object.hasOwn(o,c)){if(n==="remove")return e;o[c]={}}let a=o[c];if(!a||typeof a!="object"||Array.isArray(a))return;o=a}let l=i.at(-1);if(t.kind==="json-hook"){let c=o[l]===void 0?[]:o[l];if(!Array.isArray(c))return;let a=c.flatMap((p,f)=>Ln(p)===Ln(s?.value??t.value)?[f]:[]);if(a.length>1)return;if(a.length===1){if(!s||s.kind!=="json-hook"||Te(s)!==s.hash)return;c.splice(a[0],1,...n==="upsert"?[t.value]:[])}else if(n==="upsert"){if(s)return;c.push(t.value)}c.length?o[l]=c:delete o[l]}else{let c=Object.hasOwn(o,l);if(c&&(!s||Te({kind:"json-path",value:o[l]})!==s.hash))return;n==="upsert"?o[l]=t.value:c&&delete o[l]}for(let c=i.length-1;c>0;c--){let a=i.slice(0,c),p=Xt(r,a);if(p&&typeof p=="object"&&!Array.isArray(p)&&!Object.keys(p).length){let f=c===1?r:Xt(r,a.slice(0,-1));delete f[a.at(-1)]}}return n==="remove"&&t.createdFile&&!Object.keys(r).length?null:JSON.stringify(r,null,2)+`
|
|
21
|
+
`}function yl(e){try{return qi(e)}catch{throw new Error("共享 TOML 配置损坏或无法无损整合")}}function Ds(e){let t=e.value;for(let n of[...e.path].reverse())t={[n]:t};return`
|
|
22
|
+
# `+e.id+`:start
|
|
23
|
+
`+Xh(t)+"# "+e.id+`:end
|
|
24
|
+
`}function hm(e,t,n,s){qs(t.path);let r=yl(e),i="# "+t.id+":start",o="# "+t.id+":end",l=e.split(i).length-1,c=e.split(o).length-1,a;if(l===0&&c===0){if(n==="remove")return e;if(Xt(r,t.path)!==void 0)return;a=e+Ds(t)}else{if(l!==1||c!==1||!s||s.kind!=="toml-key"||Te({kind:"toml-key",value:Xt(r,t.path)})!==s.hash)return;let p=Ds(s);if(!e.includes(p))return;a=e.replace(p,n==="upsert"?Ds(t):"")}return yl(a),n==="remove"&&t.createdFile&&a===""?null:a}function Bs(e,t){if(Ui(t),!e||!["text-marker","json-hook","json-path","toml-key"].includes(e.kind)||typeof e.id!="string"||e.id!==t.markerId&&!e.id.startsWith(t.markerId+"-")||typeof e.createdFile!="boolean"||!/^[a-f0-9]{64}$/.test(e.hash)||Te(e,t)!==e.hash)throw new Error("Invalid shared configuration ownership or digest");if((e.kind==="json-path"||e.kind==="toml-key")&&qs(e.path),e.kind==="json-hook"&&(qs(["hooks",e.event]),!e.value||typeof e.value!="object"||Array.isArray(e.value)))throw new Error("Invalid hook configuration value")}function mm(e,t,n){if(Bs(n,t),e===null)return"missing";let s=e.toString("utf8");try{if(n.kind==="text-marker"){let o=`<!-- ${t.markerId}:start -->`,l=`<!-- ${t.markerId}:end -->`;return!s.includes(o)&&!s.includes(l)?"missing":s.split(o).length===2&&s.split(l).length===2&&s.includes($s(n.value,t.markerId))?"healthy":"modified"}let r=n.kind==="toml-key"?qi(s):hc(s);if(n.kind==="json-hook"){let o=Xt(r,["hooks",n.event]);if(o===void 0)return"missing";if(!Array.isArray(o))return"modified";let l=o.filter(c=>Te({kind:"json-hook",value:c})===n.hash).length;return l===1?"healthy":l===0&&o.length===0?"missing":"modified"}let i=Xt(r,n.path);return i===void 0?"missing":Te({kind:n.kind,value:i})!==n.hash||n.kind==="toml-key"&&!s.includes(Ds(n))?"modified":"healthy"}catch{return"modified"}}function wl(e){let{before:t,owner:n,entry:s,previous:r,action:i}=e;if(Bs(s,n),i!=="upsert"&&i!=="remove")throw new Error("Invalid configuration action");if(r&&(Bs(r,n),r.id!==s.id||r.kind!==s.kind))throw new Error("Configuration identity changed");if(i==="remove"&&t===null)return{after:null,status:"unchanged"};if(i==="remove"&&r){let a=mm(t,n,r);if(a==="modified")return{after:t,status:"preserved"};if(a==="missing")return{after:t,status:"unchanged"}}let o=t?.toString("utf8")??"",l=s.kind==="text-marker"?om(o,s,i,r,n.markerId):s.kind==="toml-key"?hm(o,s,i,r):pm(o,s,i,r);if(l===void 0)return{after:t,status:"preserved"};let c=l===null?null:Buffer.from(l);return{after:c,status:c===null?t===null?"unchanged":"changed":t?.equals(c)?"unchanged":"changed"}}function gm(e){let t=structuredClone(e.definition);Ui(t);let n={...e.context,allowedRoots:[...e.context.allowedRoots]},s=e.previous?structuredClone(e.previous):void 0,r=n.allowedRoots.map(Ne);if(s&&(s.product!==t.packageName||s.runtime!==n.runtime||s.scope!==n.scope))throw new Error("Product manifest identity mismatch");if(s?.common&&(!e.common||V(s.common.target)!==V(e.common.target)||V(s.common.ledgerDir)!==V(e.common.ledgerDir)))throw new Error("Product common target identity mismatch");let i=new Map,o=new Map,l=new Set,c=new Set,a=new Map,p=new Set,f=!1,u=()=>{if(f)throw new Error("Installation session is closed")},d=v=>{let S=oe(v,n.allowedRoots);return pc(S,t,r),S};for(let v of s?.files??[]){let S=d(v.path),k=V(S);if(!/^[a-f0-9]{64}$/.test(v.hash))throw new Error("Invalid owned file hash");if(o.has(k))throw new Error("Duplicate owned path in manifest");o.set(k,{path:S,hash:v.hash})}for(let v of s?.sharedEntries??[]){let S=d(v.path),k=V(S)+":"+v.entry.id;if(Bs(v.entry,t),a.has(k))throw new Error("Duplicate shared entry in manifest");a.set(k,{path:S,entry:v.entry})}let m=v=>{try{let S=Cn.lstatSync(v);if(!S.isFile()||S.isSymbolicLink())throw new Error(`Product target is not a regular file: ${v}`);return Cn.readFileSync(v)}catch(S){if(["ENOENT","ENOTDIR"].includes(S.code??""))return null;throw S}},h=v=>{let S=i.get(V(v));return S?S.after:m(v)},g=(v,S)=>{u();let k=d(v),b=V(k),E=i.get(b),C=E?void 0:m(k);i.set(b,{path:k,beforeHash:E?E.beforeHash:C===null?null:Wt(C),after:S===null?null:Buffer.from(S)})},y=(v,S)=>{let k=h(S.path);if(k!==null&&Wt(k)!==S.hash&&!(e.action==="uninstall"&&e.forceOwnedRemoval)){c.add(S.path);return}g(S.path,null),o.delete(v)},w=new Set;for(let v of e.initialMutations??[]){let S=V(d(v.path));if(w.has(S))throw new Error("Duplicate initial product mutation");if(w.add(S),g(v.path,v.after),i.get(S).beforeHash!==v.beforeHash)throw new Error("Initial product mutation changed before planning")}return{read(v){u();let S=d(v),k=h(S);if(k===null)throw Object.assign(new Error(`Planned file does not exist: ${v}`),{code:"ENOENT"});return Buffer.from(k)},exists(v){return u(),h(d(v))!==null},stage:g,editShared(v,S){u();let k=d(v),b=V(k)+":"+S.id,E=a.get(b),C=structuredClone({...S,createdFile:E?.entry.createdFile??S.createdFile}),A=wl({before:h(k),owner:t,entry:C,previous:E?.entry,action:"upsert"});if(p.add(b),A.status==="preserved"){c.add(k);return}g(k,A.after),a.set(b,{path:k,entry:C})},writeManaged(v,S){u();let k=d(v),b=V(k),E=o.get(b),C=h(k);if(l.add(b),C!==null&&(!E||Wt(C)!==E.hash)){c.add(k);return}g(k,S),o.set(b,{path:k,hash:Wt(S)})},retireTree(v,S={}){u();let k=d(v),b=[],E=C=>{if(!Cn.existsSync(C))return;let A=Cn.lstatSync(C);if(A.isSymbolicLink())throw new Error(`Retired tree contains a link: ${C}`);if(A.isDirectory())for(let N of Cn.readdirSync(C))E(Ns.join(C,N));else if(A.isFile())b.push(d(C));else throw new Error(`Unknown retired tree node: ${C}`)};if(E(k),S.rejectUnknown)for(let C of b){let A=o.get(V(C));if(!A||Wt(m(C))!==A.hash)throw new Error(`Retired resource is unknown, modified or unowned: ${C}`)}for(let[C,A]of[...o]){let N=Ns.relative(k,A.path);!Ns.isAbsolute(N)&&N!==".."&&!N.startsWith(`..${Ns.sep}`)&&(l.add(C),y(C,A))}},finish(){u();for(let[S,k]of[...o])!l.has(S)&&(e.action==="uninstall"||!t.retainUnrequestedFiles)&&y(S,k);for(let[S,k]of[...a]){if(p.has(S))continue;let b=wl({before:h(k.path),owner:t,entry:k.entry,previous:k.entry,action:"remove"});if(b.status==="preserved"){c.add(k.path);continue}g(k.path,b.after),a.delete(S)}f=!0;let v={product:t.packageName,packageVersion:n.packageVersion,runtime:n.runtime,scope:n.scope,language:n.language,installedAt:s?.installedAt??new Date().toISOString(),files:[...o.values()].sort((S,k)=>S.path.localeCompare(k.path,"en")),sharedEntries:[...a.values()].sort((S,k)=>(S.path+":"+S.entry.id).localeCompare(k.path+":"+k.entry.id,"en")),...e.common?{common:structuredClone(e.common)}:{}};return{mutations:[...i.values()].filter(S=>S.after===null?S.beforeHash!==null:Wt(S.after)!==S.beforeHash),manifest:v,preserved:[...c],conflicts:[]}}}}function bl(e){if(!e.product||!["local","global"].includes(e.scope)||!We.isAbsolute(e.manifestPath))throw new Error("公共依赖消费者身份无效");let t=Ne(e.manifestPath);return Ge(JSON.stringify([e.product,process.platform==="win32"?t.toLowerCase():t,e.scope]))}function ie(e,t){if(!t||t.includes("\\")||We.isAbsolute(t)||t.split("/").some(o=>!o||o==="."||o===".."))throw new Error(`公共资源路径越界:${t}`);let n=We.resolve(e,t),s=We.relative(We.resolve(e),n);if(!s||s.startsWith(`..${We.sep}`)||s===".."||We.isAbsolute(s))throw new Error(`公共资源越过边界:${t}`);let r=n,i=We.resolve(e);for(;;){if(Zt.existsSync(r)&&Zt.lstatSync(r).isSymbolicLink())throw new Error(`托管路径不允许符号链接:${r}`);if(r===i)break;r=We.dirname(r)}return n}function Ae(e){try{let t=Zt.lstatSync(e);if(!t.isFile()||t.isSymbolicLink())throw new Error(`托管路径不是普通文件:${e}`);return Ge(Zt.readFileSync(e))}catch(t){if(["ENOENT","ENOTDIR"].includes(t.code??""))return null;throw t}}function vl(e){if(Ae(e)!==null)try{return JSON.parse(Zt.readFileSync(e,"utf8"))}catch{throw new Error(`公共账本 JSON 损坏:${e}`)}}function An(e){return Buffer.from(`${JSON.stringify(e,null,2)}
|
|
25
|
+
`)}function Qt(e){if(!["install","update","uninstall"].includes(e.action))throw new Error("未知公共安装操作");let{target:t,ledgerDir:n}=ot(e.skillsDir),s=bl(e.consumer),r=e.catalog;if(e.action!=="uninstall"&&!r)throw new Error("公共安装缺少内容目录");let i=new Map;if(r&&e.action!=="uninstall"){if(r.schemaVersion!==1||r.packageName!=="@bovinphang/craft-common"||!["en","zh-CN"].includes(r.language))throw new Error("公共内容目录无效");for(let g of r.skills){if(!/^cc-[a-z0-9]+(?:-[a-z0-9]+)*$/.test(g.id))throw new Error(`公共技能路径无效:${g.id}`);for(let y of g.files){let w=`${g.id}/${y.relativePath}`;ie(t,w);let v=ie(r.root,`skills/${w}`),S=Zt.readFileSync(v);if(Ge(S)!==y.hash)throw new Error(`公共内容来源摘要不匹配:${w}`);if(i.has(w))throw new Error(`重复公共资源路径:${w}`);i.set(w,S)}}}let o=ie(n,"craft-common.json"),l=ie(n,"dependencies.lock.json"),c=vl(o),a=vl(l);if(!!c!=!!a)throw new Error("公共账本不完整,保留资源等待修复");let p,f={schemaVersion:1,target:t,consumers:{}};if(c!==void 0){if(!Gt(c)||c.schemaVersion!==1||c.target!==t||typeof c.packageVersion!="string"||!["en","zh-CN"].includes(String(c.language))||typeof c.sourceDigest!="string"||!Gt(c.files)||typeof c.residual!="boolean"||!Gt(a)||a.schemaVersion!==1||a.target!==t||!Gt(a.consumers))throw new Error("公共账本结构或目标身份无效");for(let[g,y]of Object.entries(c.files))if(ie(t,g),!g.startsWith("cc-")||typeof y!="string"||!/^[a-f0-9]{64}$/.test(y))throw new Error("公共账本文件所有权无效");for(let[g,y]of Object.entries(a.consumers)){if(!Gt(y)||!Gt(y.consumer)||typeof y.requiredVersion!="string"||typeof y.digest!="string"||!["en","zh-CN"].includes(String(y.language)))throw new Error("公共消费者账本无效");let w=y.consumer;if(bl(w)!==g)throw new Error("公共消费者标识不匹配");if(y.requiredVersion!==c.packageVersion||y.language!==c.language||y.digest!==c.sourceDigest)throw new Error("公共依赖声明与内容账本不一致")}p=c,f=a}let u={schemaVersion:1,target:t,stateDigest:Ge(JSON.stringify([c??null,a??null])),mutations:[],conflicts:[]};if(r&&e.action!=="uninstall"){let{root:g,digest:y,...w}=r;if(Ge(JSON.stringify(w))!==y)return u.conflicts.push("公共内容目录摘要无效,拒绝覆盖相同版本"),u}let d=(g,y)=>{let w=Ae(g);(y===null?w!==null:w!==Ge(y))&&u.mutations.push({path:g,beforeHash:w,after:y})};if(e.action==="uninstall"){if(!p||!f.consumers[s]||e.retainConsumer)return u;if(delete f.consumers[s],Object.keys(f.consumers).length)return d(l,An(f)),u;let g={};for(let[y,w]of Object.entries(p.files)){let v=ie(t,y),S=Ae(v);S!==null&&(S===w?d(v,null):g[y]=w)}return Object.keys(g).length?(d(o,An({...p,files:g,residual:!0})),d(l,An(f))):(d(o,null),d(l,null)),u}if(!r)throw new Error("公共安装缺少来源");let m=Object.entries(f.consumers).filter(([g])=>g!==s);p&&(p.packageVersion!==r.packageVersion||p.language!==r.language||p.sourceDigest!==r.digest)&&(m.length||e.action!=="update")&&u.conflicts.push("公共版本、语言或源摘要冲突,请协调消费者后更新");for(let[g,y]of Object.entries(p?.files??{})){let w=Ae(ie(t,g));w!==null&&w!==y&&u.conflicts.push(`公共托管文件已修改:${g}`)}for(let[g]of i)Ae(ie(t,g))!==null&&!p?.files[g]&&u.conflicts.push(`未知来源同名公共文件:${g}`);if(u.conflicts.length)return u;for(let[g,y]of i)d(ie(t,g),y);for(let g of Object.keys(p?.files??{}))i.has(g)||d(ie(t,g),null);f.consumers[s]={consumer:{...e.consumer,manifestPath:Ne(e.consumer.manifestPath)},requiredVersion:r.packageVersion,language:r.language,digest:r.digest};let h={schemaVersion:1,target:t,packageVersion:r.packageVersion,language:r.language,sourceDigest:r.digest,files:Object.fromEntries([...i].map(([g,y])=>[g,Ge(y)])),residual:!1};return d(o,An(h)),d(l,An(f)),u}function Oi(e,t){let n=Dn.relative(e,t);return!!n&&!Dn.isAbsolute(n)&&n!==".."&&!n.startsWith(".."+Dn.sep)}function mc(e,t){return e.before!==null&&e.after===null&&t.some(n=>n.after!==null&&Oi(e.path,n.path))}function Rs(e,t){if(mc(e,t))try{let n=Ni.lstatSync(e.path);if(n.isDirectory()&&!n.isSymbolicLink())return null}catch(n){if(!["ENOENT","ENOTDIR"].includes(n.code??""))throw n}return Ae(e.path)}function gc(e,t){if(!mc(e,t))return;let n;try{n=Ni.lstatSync(e.path)}catch(r){if(r.code==="ENOENT")return;throw r}if(!n.isDirectory()||n.isSymbolicLink())return;let s=new Set([e.path]);for(let r of t){if(!Oi(e.path,r.path))continue;let i=Dn.dirname(r.path);for(;Oi(e.path,i);)s.add(i),i=Dn.dirname(i)}for(let r of[...s].sort((i,o)=>o.length-i.length))try{Ni.rmdirSync(r)}catch(i){if(i.code!=="ENOENT")throw i}}function Ts(e,t,n){Y.mkdirSync(W.dirname(e),{recursive:!0});let s=`${e}.${n}.tmp`;try{let r=Y.existsSync(e)?Y.statSync(e).mode&511:384;Y.writeFileSync(s,t,{flag:"wx",mode:r}),Y.renameSync(s,e)}catch(r){try{Y.unlinkSync(s)}catch(i){if(i.code!=="ENOENT")throw new AggregateError([r,i],"原子写入及临时文件清理失败")}throw r}}function yc(e,t){if(!Y.existsSync(e))return;if(JSON.parse(Y.readFileSync(e,"utf8")).token!==t.token)throw new Error("公共安装锁归属改变,保留现场");Y.unlinkSync(e)}function wc(e){let t=ie(e,"install.lock");Y.mkdirSync(e,{recursive:!0,mode:448});let n={pid:process.pid,host:Sl.hostname(),token:wm()};for(let s=0;s<2;s++)try{return Y.writeFileSync(t,JSON.stringify(n),{flag:"wx",mode:384}),{lockFile:t,lease:n}}catch(r){if(r.code!=="EEXIST")throw r;let i;try{i=JSON.parse(Y.readFileSync(t,"utf8"))}catch{throw new Error("无法确认公共安装锁身份,请检查保留现场")}if(i.host!==Sl.hostname()||!Number.isSafeInteger(i.pid)||i.pid<=0||typeof i.token!="string")throw new Error("无法确认公共安装锁所属进程");try{process.kill(i.pid,0)}catch(o){if(o.code!=="ESRCH")throw new Error("无法确认公共安装锁是否失效");let l=ie(e,"reclaim.lock");try{Y.writeFileSync(l,JSON.stringify(n),{flag:"wx",mode:384})}catch{throw new Error("公共安装锁正在恢复或恢复锁需人工检查")}try{if(Y.readFileSync(t,"utf8")!==JSON.stringify(i))throw new Error("公共安装锁发生并发变化");Y.unlinkSync(t)}finally{Y.unlinkSync(l)}continue}throw new Error(`公共安装正在执行,锁进程 ${i.pid}`)}throw new Error("无法取得公共安装锁")}function Fs(e,t,n,s){let r=W.resolve(e),i=W.relative(t,r).split(W.sep).join("/");if(i.startsWith("cc-")&&!i.startsWith("../")){ie(t,i);return}if(["craft-common.json","dependencies.lock.json"].some(o=>r===W.join(n,o))){ie(n,W.basename(r));return}for(let o of s){let l=W.relative(o,r).split(W.sep).join("/");if(l&&l!==".."&&!l.startsWith("../")&&!W.isAbsolute(l)){ie(o,l);return}}throw new Error(`事务写入越过允许边界:${e}`)}function bm(e,t,n,s){let r=e;if(!r||r.schemaVersion!==1||r.target!==t||!["prepared","committed"].includes(r.phase)||!/^[a-f0-9-]{36}$/.test(r.token)||!Array.isArray(r.entries))throw new Error("公共事务记录无效,保留现场");let i=new Set;for(let o of r.entries){if(!o||typeof o.path!="string"||!W.isAbsolute(o.path)||i.has(o.path))throw new Error("公共事务路径无效");i.add(o.path),Fs(o.path,t,n,s);for(let l of["before","after"]){let c=o[l],a=o[`${l}Hash`];if(c===null?a!==null:typeof c!="string"||Buffer.from(c,"base64").toString("base64")!==c||Ge(Buffer.from(c,"base64"))!==a)throw new Error("公共事务内容摘要无效")}}return r}function bc(e,t){for(let n of[...e.entries].reverse()){let s=Rs(n,e.entries);if(s!==n.beforeHash&&s!==n.afterHash)throw new Error(`事务期间文件被修改,保留恢复记录:${n.path}`);s!==n.beforeHash&&(n.before===null?Y.unlinkSync(n.path):(gc(n,e.entries),Ts(n.path,Buffer.from(n.before,"base64"),t)))}}function vc(e,t,n,s){let r=ie(t,Ls);if(!Y.existsSync(r))return"clean";let i=bm(JSON.parse(Y.readFileSync(r,"utf8")),e,t,s);if(i.phase==="prepared")bc(i,n);else for(let o of i.entries)if(Rs(o,i.entries)!==o.afterHash)throw new Error(`已提交事务存在外部修改,保留恢复记录:${o.path}`);return Y.unlinkSync(r),"recovered"}async function vm(e,t=[]){let{target:n,ledgerDir:s}=ot(e);if(!Y.existsSync(s))return"clean";let{lockFile:r,lease:i}=wc(s);try{return vc(n,s,i.token,t.map(Ne))}finally{yc(r,i)}}function Sm(e,t){let n=W.resolve(e),s=t.flatMap(r=>{let i=Ne(r);return[{boundary:W.resolve(r),real:i},{boundary:i,real:i}]}).sort((r,i)=>i.boundary.length-r.boundary.length);for(let{boundary:r,real:i}of s){let o=W.relative(r,n);if(!o||o===".."||o.startsWith(`..${W.sep}`)||W.isAbsolute(o))continue;let l=n;for(;(process.platform==="win32"?l.toLowerCase():l)!==(process.platform==="win32"?r.toLowerCase():r);){try{if(Y.lstatSync(l).isSymbolicLink())throw new Error(`产品托管路径不允许符号链接:${l}`)}catch(a){if(!["ENOENT","ENOTDIR"].includes(a.code??""))throw a}let c=W.dirname(l);if(c===l)throw new Error("产品路径未到达声明边界");l=c}return ie(i,o.split(W.sep).join("/"))}throw new Error(`产品写入越过允许边界:${e}`)}async function km(e,t){let{target:n,ledgerDir:s}=ot(e.skillsDir),r=(t.allowedProductRoots??[]).map(Ne),i=(t.productMutations??[]).map(p=>({...p,path:Sm(p.path,t.allowedProductRoots??[])}));for(let p of i){let f=p.path,u=W.relative(n,f).split(W.sep).join("/"),d=W.relative(s,f).split(W.sep).join("/");if(u.toLowerCase().startsWith("cc-")&&!u.startsWith("../")||!d||d!==".."&&!d.startsWith("../")&&!W.isAbsolute(d))throw new Error(`产品不能认领公共资源或账本:${f}`);Fs(f,n,s,r)}if(t.dryRun){if(Y.existsSync(W.join(s,Ls)))throw new Error("存在待恢复公共事务,dry-run 不执行恢复");let p=Qt(e);if(p.conflicts.length)throw new Error(p.conflicts.join(`
|
|
26
|
+
`));for(let f of i)if(Fs(f.path,n,s,r),Ae(f.path)!==f.beforeHash)throw new Error(`产品文件在规划后已修改:${f.path}`);return p}if(!Y.existsSync(W.join(s,Ls))){let p=Qt(e);if(p.conflicts.length)throw new Error(p.conflicts.join(`
|
|
27
|
+
`))}let{lockFile:o,lease:l}=wc(s),c=ie(s,Ls),a;try{vc(n,s,l.token,r);let p=Qt(e);if(p.conflicts.length)throw new Error(p.conflicts.join(`
|
|
28
|
+
`));let f=[...p.mutations,...i],u=new Set,d=f.map(m=>{let h=W.resolve(m.path);if(Fs(h,n,s,r),u.has(h))throw new Error(`公共与产品写入重复认领:${h}`);if(u.add(h),Ae(h)!==m.beforeHash)throw new Error(`产品或公共文件在规划后已修改:${h}`);return{path:h,before:m.beforeHash===null?null:Y.readFileSync(h).toString("base64"),after:m.after?.toString("base64")??null,beforeHash:m.beforeHash,afterHash:m.after===null?null:Ge(m.after)}});if(!d.length)return p;a={schemaVersion:1,target:n,phase:"prepared",token:l.token,entries:d},Ts(c,Buffer.from(JSON.stringify(a)),l.token);for(let m of d){if(Ae(m.path)!==m.beforeHash)throw new Error(`事务执行前文件已修改:${m.path}`);m.after===null?Y.unlinkSync(m.path):Ts(m.path,Buffer.from(m.after,"base64"),l.token)}return a.phase="committed",Ts(c,Buffer.from(JSON.stringify(a)),l.token),Y.unlinkSync(c),p}catch(p){if(a?.phase==="prepared")try{bc(a,l.token),Y.unlinkSync(c)}catch(f){throw new AggregateError([p,f],"公共安装失败且需保留事务记录继续恢复")}throw p}finally{yc(o,l)}}function Ei(e){let t=Le.lstatSync(e);if(!t.isFile()||t.isSymbolicLink()||t.size>8192)throw new Error("Invalid installation lock file");let n=JSON.parse(Le.readFileSync(e,"utf8"));if(!n||n.host!==Sc.hostname()||!Number.isSafeInteger(n.pid)||n.pid<=0||typeof n.token!="string")throw new Error("Cannot confirm installation lock identity");return n}function kc(e){let t={pid:process.pid,host:Sc.hostname(),token:Em()},n=JSON.stringify(t);for(let s=0;s<2;s++)try{return Le.writeFileSync(e,n,{flag:"wx",mode:384}),()=>{if(Ei(e).token!==t.token)throw new Error("Installation lock ownership changed");Le.unlinkSync(e)}}catch(r){if(r.code!=="EEXIST")throw r;let i=Ei(e),o=!1;try{process.kill(i.pid,0)}catch(a){o=a.code==="ESRCH"}if(!o)throw new Error(`Installation lock is held by running process ${i.pid}`);let l=`${e}.reclaim`,c=Le.openSync(l,"wx",384);try{if(Ei(e).token!==i.token)throw new Error("Installation lock changed during recovery");Le.unlinkSync(e)}finally{Le.closeSync(c),Le.unlinkSync(l)}}throw new Error("Could not acquire installation lock")}async function Am(e,t){let n=[...new Set(e.map(c=>V(oe(c,[kt.dirname(kt.resolve(c))]))))].sort(),s=[],r=new Set,i,o;try{for(let c of n){let a=kt.join(kt.dirname(c),".craft-install-locks"),p=Cm("sha256").update(c).digest("hex"),f=oe(kt.join(a,p+".lock"),[kt.dirname(c)]),u=a;for(;;){try{Le.lstatSync(u);break}catch(m){if(m.code!=="ENOENT")throw m}r.add(u);let d=kt.dirname(u);if(d===u)break;u=d}Le.mkdirSync(a,{recursive:!0,mode:448}),s.push(kc(f))}o=await t()}catch(c){i=c}let l=[];for(let c of s.reverse())try{c()}catch(a){l.push(a)}for(let c of[...r].sort((a,p)=>p.length-a.length))try{Le.rmdirSync(c)}catch(a){["ENOTEMPTY","EEXIST","ENOENT"].includes(a.code??"")||l.push(a)}if(l.length)throw new AggregateError([...i?[i]:[],...l],"Installation lock cleanup failed");if(i)throw i;return o}function en(e){let t=oe(qe.join(e.baseDir,e.definition.stateDirectoryName+"/journal.json"),Ks(e));return{journal:t,state:qe.dirname(t),identity:JSON.stringify([qe.dirname(qe.dirname(t)),e.runtime,e.scope==="global"])}}function Ec(e,t){let n=oe(t,Ks(e));if(V(n)!==V(oe(qe.join(e.baseDir,e.definition.manifestName),Ks(e)))&&pc(n,e.definition,e.allowedRoots.map(Ne)),n.split(qe.sep).includes(e.definition.stateDirectoryName))throw new Error("不能修改产品事务状态");return n}function Ji(e,t,n=384){if(t===null){fe.rmSync(e,{force:!0});return}fe.mkdirSync(qe.dirname(e),{recursive:!0});let s=qe.join(qe.dirname(e),"."+Om+"-"+Nm()+".tmp");try{fe.writeFileSync(s,t,{flag:"wx",mode:n}),fe.renameSync(s,e)}finally{fe.rmSync(s,{force:!0})}}function Cc(e){return e===null?null:Buffer.from(e,"base64")}function Is(e){return e===null?null:Ct(Buffer.from(e,"base64"))}function kl(e,t){Ji(e,Buffer.from(JSON.stringify(t)))}function Im(e){let t=en(e);if(!fe.existsSync(t.journal))return;if(fe.statSync(t.journal).size>64*1024*1024)throw new Error("事务日志过大");let n;try{n=JSON.parse(fe.readFileSync(t.journal,"utf8"))}catch{throw new Error("产品事务日志损坏")}if(!n||n.schemaVersion!==1||n.identity!==t.identity||!["prepared","committed"].includes(n.phase)||!Array.isArray(n.entries))throw new Error("产品事务身份或结构无效");let s=new Set;for(let r of n.entries){if(!r||typeof r.path!="string"||![r.before,r.after].every(o=>o===null||typeof o=="string"&&Buffer.from(o,"base64").toString("base64")===o)||!Number.isInteger(r.mode))throw new Error("产品事务条目损坏");let i=Ec(e,r.path);if(V(i)!==V(r.path)||s.has(V(i)))throw new Error("产品事务路径无效");s.add(V(i))}return n}function Ii(e){let t=Im(e);if(!t)return"clean";for(let n of t.entries){let s=Rs(n,t.entries);if(s!==Is(n.before)&&s!==Is(n.after))throw new Error("恢复冲突:事务后文件被外部修改,保留日志");if(t.phase==="committed"&&s!==Is(n.after))throw new Error("已提交事务内容发生冲突")}if(t.phase==="prepared")for(let n of[...t.entries].reverse())Rs(n,t.entries)!==Is(n.before)&&(gc(n,t.entries),Ji(n.path,Cc(n.before),n.mode));return fe.unlinkSync(en(e).journal),"recovered"}function Ac(e){let{state:t}=en(e);return fe.mkdirSync(t,{recursive:!0,mode:448}),kc(oe(qe.join(t,"lease.json"),Ks(e)))}async function jm(e){let t={...e.context,definition:e.definition},n=en(t);if(!fe.existsSync(n.journal))return"clean";let s=Ac(t);try{return Ii(t)}finally{s()}}async function Dm(e,t,n={}){let s={...e.context,definition:e.definition};if((n.dryRun||s.dryRun)&&fe.existsSync(en(s).journal))throw new Error("Pending product transaction recovery; dry-run does not recover");let r=new Set,i=t.map(c=>{if(!c||typeof c.path!="string"||!(c.beforeHash===null||typeof c.beforeHash=="string"&&/^[a-f0-9]{64}$/.test(c.beforeHash))||!(c.after===null||Buffer.isBuffer(c.after)))throw new Error("产品变更结构无效");let a=Ec(s,c.path);if(r.has(V(a)))throw new Error("产品变更路径重复");return r.add(V(a)),{...c,path:a}}),o=()=>{for(let c of i)if(Ae(c.path)!==c.beforeHash)throw new Error("产品变更冲突:规划后文件被修改")};if(o(),n.dryRun||s.dryRun||!i.length)return;let l=Ac(s);try{Ii(s),o();let c=en(s),a={schemaVersion:1,identity:c.identity,phase:"prepared",entries:i.map(p=>({path:p.path,before:p.beforeHash===null?null:fe.readFileSync(p.path).toString("base64"),after:p.after?.toString("base64")??null,mode:p.beforeHash===null?384:fe.statSync(p.path).mode&511}))};kl(c.journal,a);try{for(let p of a.entries)Ji(p.path,Cc(p.after),p.mode);a.phase="committed",kl(c.journal,a)}catch(p){throw Ii(s),p}fe.unlinkSync(c.journal)}finally{l()}}function El(e){try{let t=jn.lstatSync(e);if(!t.isFile()||t.isSymbolicLink())throw new Error("Manifest is not a regular file");return jn.readFileSync(e)}catch(t){if(t.code==="ENOENT")return null;throw t}}async function Mn(e){let{definition:t,context:n,action:s}=e;if(Ui(t),!["install","update","uninstall"].includes(s))throw new Error("Invalid product action");let r=oe(Os.join(n.baseDir,t.manifestName),n.allowedRoots),i=oe(Os.join(n.baseDir,t.stateDirectoryName,"journal.json"),n.allowedRoots),o=e.common?{...e.common,action:s}:void 0,l;if(o){if(o.consumer.product!==t.consumerProduct||o.consumer.scope!==n.scope||V(Ne(o.consumer.manifestPath))!==V(r))throw new Error("Common consumer identity mismatch");let u=ot(o.skillsDir);oe(Os.join(u.target,".boundary"),n.allowedRoots);let d=o.catalog;if(s!=="uninstall"&&!d)throw new Error("Common content catalog is required");d&&(l={...u,packageVersion:d.packageVersion,language:d.language,digest:d.digest});let m=Os.join(u.ledgerDir,"transaction.json");if(n.dryRun&&jn.existsSync(m))throw new Error("Pending common transaction recovery; dry-run does not recover");if(!jn.existsSync(m)){let h=Qt(o);if(h.conflicts.length)throw new Error(h.conflicts.join(`
|
|
29
|
+
`))}}if(n.dryRun&&jn.existsSync(i))throw new Error("Pending product transaction recovery; dry-run does not recover");let c=()=>({changed:[],preserved:[],conflicts:[],common:"none",status:n.dryRun?"planned":"complete"});if(s==="uninstall"&&El(r)===null)return c();let a={definition:t,context:n},p=async()=>{n.dryRun||(o&&await vm(o.skillsDir,n.allowedRoots),await jm(a));let u=El(r);if(u!==null&&e.seed)throw new Error("Cannot seed an existing installation manifest");let d=u===null?e.seed?.manifest:e.codec.decode(u,n);if(s==="uninstall"&&d===void 0)return c();let m=gm({definition:t,context:n,previous:d,action:s,common:l??(o?d?.common:void 0),forceOwnedRemoval:e.forceOwnedRemoval,initialMutations:e.seed?.mutations});s!=="uninstall"&&await e.adapter.plan(n,m);let h=m.finish();if(h.conflicts.length)throw new Error(h.conflicts.join(`
|
|
30
|
+
`));let g=h.manifest.files.length>0||h.manifest.sharedEntries.length>0,y=s==="uninstall"&&!g?null:e.codec.encode(h.manifest,n),w={path:r,beforeHash:u===null?null:Ct(u),after:y},v=[...h.mutations];(y===null?u!==null:!u?.equals(y))&&v.push(w);let S=v.map(k=>k.path);if(o){let k=await km({...o,...s==="uninstall"?{retainConsumer:g}:{}},{dryRun:n.dryRun,productMutations:v,allowedProductRoots:n.allowedRoots});S=[...new Set([...S,...k.mutations.map(b=>b.path)])]}else await Dm(a,v,{dryRun:n.dryRun});return{changed:S,preserved:h.preserved,conflicts:[],common:o?s==="uninstall"&&g?"retained":"shared":"none",status:n.dryRun?"planned":h.preserved.length?"partial":"complete"}};if(n.dryRun)return p();let f=e.adapter.configurationFiles(n).map(u=>oe(u,n.allowedRoots));return Am([...f,r],p)}function Nc(e){let{inspection:t,catalog:n,task:s}=e;if(s?.kind&&!Zs.includes(s.kind))throw new Error("未知任务类型");let r=t.units;if(s?.path){let i=_s.resolve(t.workspace,s.path);if(!Cl(t.workspace,i))throw new Error("任务路径越过工作区边界");let o=r.filter(l=>Cl(l.root,i)).sort((l,c)=>c.root.length-l.root.length)[0];if(r=o?[o]:[],o&&s.kind==="ipc"&&o.roles.some(l=>l==="ui"||l==="desktop-core")){let l=new Map([[o.root,o]]);for(let c of l.values())for(let a of c.relatedRoots){let p=t.units.find(f=>f.root===a);p&&p.roles.some(f=>f==="ui"||f==="desktop-core")&&c.frameworks.some(f=>["tauri","electron"].includes(f.id)&&p.frameworks.some(u=>u.id===f.id))&&l.set(p.root,p)}r=[...l.values()]}}return n.flatMap(i=>{let o=i.applicability;if(!o||!Object.values(o).some(p=>p?.length))return[];if(s?.kind&&o.taskKinds&&!o.taskKinds.includes(s.kind))return[];let l=p=>(!o.languages||o.languages.some(f=>p.languages.includes(f)))&&(!o.frameworks||o.frameworks.some(f=>p.frameworks.some(u=>u.id===f)))&&(!o.roles||o.roles.some(f=>p.roles.includes(f))),c=r.filter(l);if(!c.length)return[];let a=[...o.languages?["language: "+o.languages.filter(p=>c.some(f=>f.languages.includes(p))).join(", ")]:[],...o.frameworks?["framework: "+o.frameworks.filter(p=>c.some(f=>f.frameworks.some(u=>u.id===p))).join(", ")]:[],...o.roles?["role: "+o.roles.filter(p=>c.some(f=>f.roles.includes(p))).join(", ")]:[],...s?.kind&&o.taskKinds?["task: "+s.kind]:[]];return[{id:i.id,sourcePackage:i.sourcePackage,projectRoots:c.map(p=>p.root).sort(),reasons:a.length?a:["project candidate; task intent unspecified"]}]}).sort((i,o)=>i.id.localeCompare(o.id,"en"))}var xt,ch,Al,uh,Nl,fh,dh,Us,D,ph,Ol,B,Js,Il,ji,jl,At,Di,Ys,se,Vs,Li,xs,hh,Ws,Gs,mh,Dl,Ti,Ll,Nt,Fl,Ot,Tn,It,Fn,Hs,Fi,_l,_n,Pl,$l,gh,yh,Ml,_i,ql,wh,bh,vh,Rl,Ul,Sh,kh,Jl,Eh,zs,Qs,Xs,Pi,xl,Wl,Ch,Ah,Pn,Nh,Oh,Gl,Hl,Ih,jh,Dh,Lh,zl,Th,Fh,_h,$i,Ql,Xl,Zl,Ph,ec,tc,Zs,F,Bh,Rh,xh,oc,cc,Si,Zh,em,pl,As,nm,sm,rm,it,gl,Ct,Ms,js,dm,Wt,Ge,Gt,Ls,Ks,Om,Cl,ve=K(()=>{xt=lh(import.meta.url),ch=Object.create,Al=Object.defineProperty,uh=Object.getOwnPropertyDescriptor,Nl=Object.getOwnPropertyNames,fh=Object.getPrototypeOf,dh=Object.prototype.hasOwnProperty,Us=(e=>typeof xt<"u"?xt:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof xt<"u"?xt:t)[n]}):e)(function(e){if(typeof xt<"u")return xt.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),D=(e,t)=>function(){try{return t||(0,e[Nl(e)[0]])((t={exports:{}}).exports,t),t.exports}catch(s){throw t=0,s}},ph=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Nl(t))!dh.call(e,r)&&r!==n&&Al(e,r,{get:()=>t[r],enumerable:!(s=uh(t,r))||s.enumerable});return e},Ol=(e,t,n)=>(n=e!=null?ch(fh(e)):{},ph(t||!e||!e.__esModule?Al(n,"default",{value:e,enumerable:!0}):n,e)),B=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/identity.js"(e){"use strict";var t=Symbol.for("yaml.alias"),n=Symbol.for("yaml.document"),s=Symbol.for("yaml.map"),r=Symbol.for("yaml.pair"),i=Symbol.for("yaml.scalar"),o=Symbol.for("yaml.seq"),l=Symbol.for("yaml.node.type"),c=y=>!!y&&typeof y=="object"&&y[l]===t,a=y=>!!y&&typeof y=="object"&&y[l]===n,p=y=>!!y&&typeof y=="object"&&y[l]===s,f=y=>!!y&&typeof y=="object"&&y[l]===r,u=y=>!!y&&typeof y=="object"&&y[l]===i,d=y=>!!y&&typeof y=="object"&&y[l]===o;function m(y){if(y&&typeof y=="object")switch(y[l]){case s:case o:return!0}return!1}function h(y){if(y&&typeof y=="object")switch(y[l]){case t:case s:case i:case o:return!0}return!1}var g=y=>(u(y)||m(y))&&!!y.anchor;e.ALIAS=t,e.DOC=n,e.MAP=s,e.NODE_TYPE=l,e.PAIR=r,e.SCALAR=i,e.SEQ=o,e.hasAnchor=g,e.isAlias=c,e.isCollection=m,e.isDocument=a,e.isMap=p,e.isNode=h,e.isPair=f,e.isScalar=u,e.isSeq=d}}),Js=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/visit.js"(e){"use strict";var t=B(),n=Symbol("break visit"),s=Symbol("skip children"),r=Symbol("remove node");function i(u,d){let m=a(d);t.isDocument(u)?o(null,u.contents,m,Object.freeze([u]))===r&&(u.contents=null):o(null,u,m,Object.freeze([]))}i.BREAK=n,i.SKIP=s,i.REMOVE=r;function o(u,d,m,h){let g=p(u,d,m,h);if(t.isNode(g)||t.isPair(g))return f(u,h,g),o(u,g,m,h);if(typeof g!="symbol"){if(t.isCollection(d)){h=Object.freeze(h.concat(d));for(let y=0;y<d.items.length;++y){let w=o(y,d.items[y],m,h);if(typeof w=="number")y=w-1;else{if(w===n)return n;w===r&&(d.items.splice(y,1),y-=1)}}}else if(t.isPair(d)){h=Object.freeze(h.concat(d));let y=o("key",d.key,m,h);if(y===n)return n;y===r&&(d.key=null);let w=o("value",d.value,m,h);if(w===n)return n;w===r&&(d.value=null)}}return g}async function l(u,d){let m=a(d);t.isDocument(u)?await c(null,u.contents,m,Object.freeze([u]))===r&&(u.contents=null):await c(null,u,m,Object.freeze([]))}l.BREAK=n,l.SKIP=s,l.REMOVE=r;async function c(u,d,m,h){let g=await p(u,d,m,h);if(t.isNode(g)||t.isPair(g))return f(u,h,g),c(u,g,m,h);if(typeof g!="symbol"){if(t.isCollection(d)){h=Object.freeze(h.concat(d));for(let y=0;y<d.items.length;++y){let w=await c(y,d.items[y],m,h);if(typeof w=="number")y=w-1;else{if(w===n)return n;w===r&&(d.items.splice(y,1),y-=1)}}}else if(t.isPair(d)){h=Object.freeze(h.concat(d));let y=await c("key",d.key,m,h);if(y===n)return n;y===r&&(d.key=null);let w=await c("value",d.value,m,h);if(w===n)return n;w===r&&(d.value=null)}}return g}function a(u){return typeof u=="object"&&(u.Collection||u.Node||u.Value)?Object.assign({Alias:u.Node,Map:u.Node,Scalar:u.Node,Seq:u.Node},u.Value&&{Map:u.Value,Scalar:u.Value,Seq:u.Value},u.Collection&&{Map:u.Collection,Seq:u.Collection},u):u}function p(u,d,m,h){if(typeof m=="function")return m(u,d,h);if(t.isMap(d))return m.Map?.(u,d,h);if(t.isSeq(d))return m.Seq?.(u,d,h);if(t.isPair(d))return m.Pair?.(u,d,h);if(t.isScalar(d))return m.Scalar?.(u,d,h);if(t.isAlias(d))return m.Alias?.(u,d,h)}function f(u,d,m){let h=d[d.length-1];if(t.isCollection(h))h.items[u]=m;else if(t.isPair(h))u==="key"?h.key=m:h.value=m;else if(t.isDocument(h))h.contents=m;else{let g=t.isAlias(h)?"alias":"scalar";throw new Error(`Cannot replace node with ${g} parent`)}}e.visit=i,e.visitAsync=l}}),Il=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/doc/directives.js"(e){"use strict";var t=B(),n=Js(),s={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},r=o=>o.replace(/[!,[\]{}]/g,l=>s[l]),i=class xe{constructor(l,c){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},xe.defaultYaml,l),this.tags=Object.assign({},xe.defaultTags,c)}clone(){let l=new xe(this.yaml,this.tags);return l.docStart=this.docStart,l}atDocument(){let l=new xe(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:xe.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},xe.defaultTags);break}return l}add(l,c){this.atNextDocument&&(this.yaml={explicit:xe.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},xe.defaultTags),this.atNextDocument=!1);let a=l.trim().split(/[ \t]+/),p=a.shift();switch(p){case"%TAG":{if(a.length!==2&&(c(0,"%TAG directive should contain exactly two parts"),a.length<2))return!1;let[f,u]=a;return this.tags[f]=u,!0}case"%YAML":{if(this.yaml.explicit=!0,a.length!==1)return c(0,"%YAML directive should contain exactly one part"),!1;let[f]=a;if(f==="1.1"||f==="1.2")return this.yaml.version=f,!0;{let u=/^\d+\.\d+$/.test(f);return c(6,`Unsupported YAML version ${f}`,u),!1}}default:return c(0,`Unknown directive ${p}`,!0),!1}}tagName(l,c){if(l==="!")return"!";if(l[0]!=="!")return c(`Not a valid tag: ${l}`),null;if(l[1]==="<"){let u=l.slice(2,-1);return u==="!"||u==="!!"?(c(`Verbatim tags aren't resolved, so ${l} is invalid.`),null):(l[l.length-1]!==">"&&c("Verbatim tags must end with a >"),u)}let[,a,p]=l.match(/^(.*!)([^!]*)$/s);p||c(`The ${l} tag has no suffix`);let f=this.tags[a];if(f)try{return f+decodeURIComponent(p)}catch(u){return c(String(u)),null}return a==="!"?l:(c(`Could not resolve tag: ${l}`),null)}tagString(l){for(let[c,a]of Object.entries(this.tags))if(l.startsWith(a))return c+r(l.substring(a.length));return l[0]==="!"?l:`!<${l}>`}toString(l){let c=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],a=Object.entries(this.tags),p;if(l&&a.length>0&&t.isNode(l.contents)){let f={};n.visit(l.contents,(u,d)=>{t.isNode(d)&&d.tag&&(f[d.tag]=!0)}),p=Object.keys(f)}else p=[];for(let[f,u]of a)f==="!!"&&u==="tag:yaml.org,2002:"||(!l||p.some(d=>d.startsWith(u)))&&c.push(`%TAG ${f} ${u}`);return c.join(`
|
|
31
|
+
`)}};i.defaultYaml={explicit:!1,version:"1.2"},i.defaultTags={"!!":"tag:yaml.org,2002:"},e.Directives=i}}),ji=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/doc/anchors.js"(e){"use strict";var t=B(),n=Js();function s(l){if(/[\x00-\x19\s,[\]{}]/.test(l)){let a=`Anchor must not contain whitespace or control characters: ${JSON.stringify(l)}`;throw new Error(a)}return!0}function r(l){let c=new Set;return n.visit(l,{Value(a,p){p.anchor&&c.add(p.anchor)}}),c}function i(l,c){for(let a=1;;++a){let p=`${l}${a}`;if(!c.has(p))return p}}function o(l,c){let a=[],p=new Map,f=null;return{onAnchor:u=>{a.push(u),f??(f=r(l));let d=i(c,f);return f.add(d),d},setAnchors:()=>{for(let u of a){let d=p.get(u);if(typeof d=="object"&&d.anchor&&(t.isScalar(d.node)||t.isCollection(d.node)))d.node.anchor=d.anchor;else{let m=new Error("Failed to resolve repeated object (this should not happen)");throw m.source=u,m}}},sourceObjects:p}}e.anchorIsValid=s,e.anchorNames=r,e.createNodeAnchors=o,e.findNewAnchor=i}}),jl=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/doc/applyReviver.js"(e){"use strict";function t(n,s,r,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let o=0,l=i.length;o<l;++o){let c=i[o],a=t(n,i,String(o),c);a===void 0?delete i[o]:a!==c&&(i[o]=a)}else if(i instanceof Map)for(let o of Array.from(i.keys())){let l=i.get(o),c=t(n,i,o,l);c===void 0?i.delete(o):c!==l&&i.set(o,c)}else if(i instanceof Set)for(let o of Array.from(i)){let l=t(n,i,o,o);l===void 0?i.delete(o):l!==o&&(i.delete(o),i.add(l))}else for(let[o,l]of Object.entries(i)){let c=t(n,i,o,l);c===void 0?delete i[o]:c!==l&&(i[o]=c)}return n.call(s,r,i)}e.applyReviver=t}}),At=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/toJS.js"(e){"use strict";var t=B();function n(s,r,i){if(Array.isArray(s))return s.map((o,l)=>n(o,String(l),i));if(s&&typeof s.toJSON=="function"){if(!i||!t.hasAnchor(s))return s.toJSON(r,i);let o={aliasCount:0,count:1,res:void 0};i.anchors.set(s,o),i.onCreate=c=>{o.res=c,delete i.onCreate};let l=s.toJSON(r,i);return i.onCreate&&i.onCreate(l),l}return typeof s=="bigint"&&!i?.keep?Number(s):s}e.toJS=n}}),Di=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/Node.js"(e){"use strict";var t=jl(),n=B(),s=At(),r=class{constructor(i){Object.defineProperty(this,n.NODE_TYPE,{value:i})}clone(){let i=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(i.range=this.range.slice()),i}toJS(i,{mapAsMap:o,maxAliasCount:l,onAnchor:c,reviver:a}={}){if(!n.isDocument(i))throw new TypeError("A document argument is required");let p={anchors:new Map,doc:i,keep:!0,mapAsMap:o===!0,mapKeyWarned:!1,maxAliasCount:typeof l=="number"?l:100},f=s.toJS(this,"",p);if(typeof c=="function")for(let{count:u,res:d}of p.anchors.values())c(d,u);return typeof a=="function"?t.applyReviver(a,{"":f},"",f):f}};e.NodeBase=r}}),Ys=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/Alias.js"(e){"use strict";var t=ji(),n=Js(),s=B(),r=Di(),i=At(),o=class extends r.NodeBase{constructor(c){super(s.ALIAS),this.source=c,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(c,a){if(a?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let p;a?.aliasResolveCache?p=a.aliasResolveCache:(p=[],n.visit(c,{Node:(u,d)=>{(s.isAlias(d)||s.hasAnchor(d))&&p.push(d)}}),a&&(a.aliasResolveCache=p));let f;for(let u of p){if(u===this)break;u.anchor===this.source&&(f=u)}return f}toJSON(c,a){if(!a)return{source:this.source};let{anchors:p,doc:f,maxAliasCount:u}=a,d=this.resolve(f,a);if(!d){let h=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(h)}let m=p.get(d);if(m||(i.toJS(d,null,a),m=p.get(d)),m?.res===void 0){let h="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(h)}if(u>=0&&(m.count+=1,m.aliasCount===0&&(m.aliasCount=l(f,d,p)),m.count*m.aliasCount>u)){let h="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(h)}return m.res}toString(c,a,p){let f=`*${this.source}`;if(c){if(t.anchorIsValid(this.source),c.options.verifyAliasOrder&&!c.anchors.has(this.source)){let u=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(u)}if(c.implicitKey)return`${f} `}return f}};function l(c,a,p){if(s.isAlias(a)){let f=a.resolve(c),u=p&&f&&p.get(f);return u?u.count*u.aliasCount:0}else if(s.isCollection(a)){let f=0;for(let u of a.items){let d=l(c,u,p);d>f&&(f=d)}return f}else if(s.isPair(a)){let f=l(c,a.key,p),u=l(c,a.value,p);return Math.max(f,u)}return 1}e.Alias=o}}),se=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/Scalar.js"(e){"use strict";var t=B(),n=Di(),s=At(),r=o=>!o||typeof o!="function"&&typeof o!="object",i=class extends n.NodeBase{constructor(o){super(t.SCALAR),this.value=o}toJSON(o,l){return l?.keep?this.value:s.toJS(this.value,o,l)}toString(){return String(this.value)}};i.BLOCK_FOLDED="BLOCK_FOLDED",i.BLOCK_LITERAL="BLOCK_LITERAL",i.PLAIN="PLAIN",i.QUOTE_DOUBLE="QUOTE_DOUBLE",i.QUOTE_SINGLE="QUOTE_SINGLE",e.Scalar=i,e.isScalarValue=r}}),Vs=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/doc/createNode.js"(e){"use strict";var t=Ys(),n=B(),s=se(),r="tag:yaml.org,2002:";function i(l,c,a){if(c){let p=a.filter(u=>u.tag===c),f=p.find(u=>!u.format)??p[0];if(!f)throw new Error(`Tag ${c} not found`);return f}return a.find(p=>p.identify?.(l)&&!p.format)}function o(l,c,a){if(n.isDocument(l)&&(l=l.contents),n.isNode(l))return l;if(n.isPair(l)){let w=a.schema[n.MAP].createNode?.(a.schema,null,a);return w.items.push(l),w}(l instanceof String||l instanceof Number||l instanceof Boolean||typeof BigInt<"u"&&l instanceof BigInt)&&(l=l.valueOf());let{aliasDuplicateObjects:p,onAnchor:f,onTagObj:u,schema:d,sourceObjects:m}=a,h;if(p&&l&&typeof l=="object"){if(h=m.get(l),h)return h.anchor??(h.anchor=f(l)),new t.Alias(h.anchor);h={anchor:null,node:null},m.set(l,h)}c?.startsWith("!!")&&(c=r+c.slice(2));let g=i(l,c,d.tags);if(!g){if(l&&typeof l.toJSON=="function"&&(l=l.toJSON()),!l||typeof l!="object"){let w=new s.Scalar(l);return h&&(h.node=w),w}g=l instanceof Map?d[n.MAP]:Symbol.iterator in Object(l)?d[n.SEQ]:d[n.MAP]}u&&(u(g),delete a.onTagObj);let y=g?.createNode?g.createNode(a.schema,l,a):typeof g?.nodeClass?.from=="function"?g.nodeClass.from(a.schema,l,a):new s.Scalar(l);return c?y.tag=c:g.default||(y.tag=g.tag),h&&(h.node=y),y}e.createNode=o}}),Li=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/Collection.js"(e){"use strict";var t=Vs(),n=B(),s=Di();function r(l,c,a){let p=a;for(let f=c.length-1;f>=0;--f){let u=c[f];if(typeof u=="number"&&Number.isInteger(u)&&u>=0){let d=[];d[u]=p,p=d}else p=new Map([[u,p]])}return t.createNode(p,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:l,sourceObjects:new Map})}var i=l=>l==null||typeof l=="object"&&!!l[Symbol.iterator]().next().done,o=class extends s.NodeBase{constructor(l,c){super(l),Object.defineProperty(this,"schema",{value:c,configurable:!0,enumerable:!1,writable:!0})}clone(l){let c=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return l&&(c.schema=l),c.items=c.items.map(a=>n.isNode(a)||n.isPair(a)?a.clone(l):a),this.range&&(c.range=this.range.slice()),c}addIn(l,c){if(i(l))this.add(c);else{let[a,...p]=l,f=this.get(a,!0);if(n.isCollection(f))f.addIn(p,c);else if(f===void 0&&this.schema)this.set(a,r(this.schema,p,c));else throw new Error(`Expected YAML collection at ${a}. Remaining path: ${p}`)}}deleteIn(l){let[c,...a]=l;if(a.length===0)return this.delete(c);let p=this.get(c,!0);if(n.isCollection(p))return p.deleteIn(a);throw new Error(`Expected YAML collection at ${c}. Remaining path: ${a}`)}getIn(l,c){let[a,...p]=l,f=this.get(a,!0);return p.length===0?!c&&n.isScalar(f)?f.value:f:n.isCollection(f)?f.getIn(p,c):void 0}hasAllNullValues(l){return this.items.every(c=>{if(!n.isPair(c))return!1;let a=c.value;return a==null||l&&n.isScalar(a)&&a.value==null&&!a.commentBefore&&!a.comment&&!a.tag})}hasIn(l){let[c,...a]=l;if(a.length===0)return this.has(c);let p=this.get(c,!0);return n.isCollection(p)?p.hasIn(a):!1}setIn(l,c){let[a,...p]=l;if(p.length===0)this.set(a,c);else{let f=this.get(a,!0);if(n.isCollection(f))f.setIn(p,c);else if(f===void 0&&this.schema)this.set(a,r(this.schema,p,c));else throw new Error(`Expected YAML collection at ${a}. Remaining path: ${p}`)}}};e.Collection=o,e.collectionFromPath=r,e.isEmptyPath=i}}),xs=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyComment.js"(e){"use strict";var t=r=>r.replace(/^(?!$)(?: $)?/gm,"#");function n(r,i){return/^\n+$/.test(r)?r.substring(1):i?r.replace(/^(?! *$)/gm,i):r}var s=(r,i,o)=>r.endsWith(`
|
|
32
|
+
`)?n(o,i):o.includes(`
|
|
6
33
|
`)?`
|
|
7
|
-
`+
|
|
8
|
-
`)
|
|
9
|
-
`&&
|
|
10
|
-
`&&
|
|
11
|
-
${
|
|
12
|
-
${
|
|
13
|
-
`);
|
|
14
|
-
`){if(
|
|
15
|
-
|
|
16
|
-
`;
|
|
17
|
-
`,
|
|
18
|
-
`)||/[ \t]\n|\n[ \t]/.test(
|
|
19
|
-
${
|
|
34
|
+
`+n(o,i):(r.endsWith(" ")?"":" ")+o;e.indentComment=n,e.lineComment=s,e.stringifyComment=t}}),hh=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/foldFlowLines.js"(e){"use strict";var t="flow",n="block",s="quoted";function r(o,l,c="flow",{indentAtStart:a,lineWidth:p=80,minContentWidth:f=20,onFold:u,onOverflow:d}={}){if(!p||p<0)return o;p<f&&(f=0);let m=Math.max(1+f,1+p-l.length);if(o.length<=m)return o;let h=[],g={},y=p-l.length;typeof a=="number"&&(a>p-Math.max(2,f)?h.push(0):y=p-a);let w,v,S=!1,k=-1,b=-1,E=-1;c===n&&(k=i(o,k,l.length),k!==-1&&(y=k+m));for(let A;A=o[k+=1];){if(c===s&&A==="\\"){switch(b=k,o[k+1]){case"x":k+=3;break;case"u":k+=5;break;case"U":k+=9;break;default:k+=1}E=k}if(A===`
|
|
35
|
+
`)c===n&&(k=i(o,k,l.length)),y=k+l.length+m,w=void 0;else{if(A===" "&&v&&v!==" "&&v!==`
|
|
36
|
+
`&&v!==" "){let N=o[k+1];N&&N!==" "&&N!==`
|
|
37
|
+
`&&N!==" "&&(w=k)}if(k>=y)if(w)h.push(w),y=w+m,w=void 0;else if(c===s){for(;v===" "||v===" ";)v=A,A=o[k+=1],S=!0;let N=k>E+1?k-2:b-1;if(g[N])return o;h.push(N),g[N]=!0,y=N+m,w=void 0}else S=!0}v=A}if(S&&d&&d(),h.length===0)return o;u&&u();let C=o.slice(0,h[0]);for(let A=0;A<h.length;++A){let N=h[A],O=h[A+1]||o.length;N===0?C=`
|
|
38
|
+
${l}${o.slice(0,O)}`:(c===s&&g[N]&&(C+=`${o[N]}\\`),C+=`
|
|
39
|
+
${l}${o.slice(N+1,O)}`)}return C}function i(o,l,c){let a=l,p=l+1,f=o[p];for(;f===" "||f===" ";)if(l<p+c)f=o[++l];else{do f=o[++l];while(f&&f!==`
|
|
40
|
+
`);a=l,p=l+1,f=o[p]}return a}e.FOLD_BLOCK=n,e.FOLD_FLOW=t,e.FOLD_QUOTED=s,e.foldFlowLines=r}}),Ws=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyString.js"(e){"use strict";var t=se(),n=hh(),s=(d,m)=>({indentAtStart:m?d.indent.length:d.indentAtStart,lineWidth:d.options.lineWidth,minContentWidth:d.options.minContentWidth}),r=d=>/^(%|---|\.\.\.)/m.test(d);function i(d,m,h){if(!m||m<0)return!1;let g=m-h,y=d.length;if(y<=g)return!1;for(let w=0,v=0;w<y;++w)if(d[w]===`
|
|
41
|
+
`){if(w-v>g)return!0;if(v=w+1,y-v<=g)return!1}return!0}function o(d,m){let h=JSON.stringify(d);if(m.options.doubleQuotedAsJSON)return h;let{implicitKey:g}=m,y=m.options.doubleQuotedMinMultiLineLength,w=m.indent||(r(d)?" ":""),v="",S=0;for(let k=0,b=h[k];b;b=h[++k])if(b===" "&&h[k+1]==="\\"&&h[k+2]==="n"&&(v+=h.slice(S,k)+"\\ ",k+=1,S=k,b="\\"),b==="\\")switch(h[k+1]){case"u":{v+=h.slice(S,k);let E=h.substr(k+2,4);switch(E){case"0000":v+="\\0";break;case"0007":v+="\\a";break;case"000b":v+="\\v";break;case"001b":v+="\\e";break;case"0085":v+="\\N";break;case"00a0":v+="\\_";break;case"2028":v+="\\L";break;case"2029":v+="\\P";break;default:E.substr(0,2)==="00"?v+="\\x"+E.substr(2):v+=h.substr(k,6)}k+=5,S=k+1}break;case"n":if(g||h[k+2]==='"'||h.length<y)k+=1;else{for(v+=h.slice(S,k)+`
|
|
42
|
+
|
|
43
|
+
`;h[k+2]==="\\"&&h[k+3]==="n"&&h[k+4]!=='"';)v+=`
|
|
44
|
+
`,k+=2;v+=w,h[k+2]===" "&&(v+="\\"),k+=1,S=k+1}break;default:k+=1}return v=S?v+h.slice(S):h,g?v:n.foldFlowLines(v,w,n.FOLD_QUOTED,s(m,!1))}function l(d,m){if(m.options.singleQuote===!1||m.implicitKey&&d.includes(`
|
|
45
|
+
`)||/[ \t]\n|\n[ \t]/.test(d))return o(d,m);let h=m.indent||(r(d)?" ":""),g="'"+d.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
46
|
+
${h}`)+"'";return m.implicitKey?g:n.foldFlowLines(g,h,n.FOLD_FLOW,s(m,!1))}function c(d,m){let{singleQuote:h}=m.options,g;if(h===!1)g=o;else{let y=d.includes('"'),w=d.includes("'");y&&!w?g=l:w&&!y?g=o:g=h?l:o}return g(d,m)}var a;try{a=new RegExp(`(^|(?<!
|
|
20
47
|
))
|
|
21
48
|
+(?!
|
|
22
|
-
|$)`,"g")}catch{
|
|
49
|
+
|$)`,"g")}catch{a=/\n+(?!\n|$)/g}function p({comment:d,type:m,value:h},g,y,w){let{blockQuote:v,commentString:S,lineWidth:k}=g.options;if(!v||/\n[\t ]+$/.test(h))return c(h,g);let b=g.indent||(g.forceBlockIndent||r(h)?" ":""),E=v==="literal"?!0:v==="folded"||m===t.Scalar.BLOCK_FOLDED?!1:m===t.Scalar.BLOCK_LITERAL?!0:!i(h,k,b.length);if(!h)return E?`|
|
|
23
50
|
`:`>
|
|
24
|
-
`;let
|
|
25
|
-
`&&
|
|
26
|
-
`);
|
|
27
|
-
`&&(
|
|
28
|
-
`)
|
|
29
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${
|
|
30
|
-
${
|
|
31
|
-
${
|
|
32
|
-
`)||
|
|
33
|
-
`)?
|
|
34
|
-
`))return
|
|
35
|
-
${
|
|
36
|
-
${
|
|
37
|
-
${
|
|
38
|
-
`:"",
|
|
39
|
-
${
|
|
40
|
-
`&&
|
|
41
|
-
|
|
42
|
-
`):
|
|
43
|
-
${
|
|
44
|
-
`),
|
|
45
|
-
${
|
|
46
|
-
`)&&(
|
|
47
|
-
${
|
|
48
|
-
`}}return
|
|
49
|
-
`+
|
|
50
|
-
`)),
|
|
51
|
-
${
|
|
52
|
-
`;return`${
|
|
53
|
-
${i}${h}`}else return`${d}${o}${f.join(" ")}${o}${h}`}function mn({indent:n,options:{commentString:e}},t,s,i){if(s&&i&&(s=s.replace(/^\n+/,"")),s){let r=hn.indentComment(e(s),n);t.push(r.trimStart())}}ro.stringifyCollection=Iu});var Ce=y(qs=>{"use strict";var Eu=Ts(),Lu=Ls(),ju=en(),ke=L(),gn=ve(),Tu=R();function wt(n,e){let t=ke.isScalar(e)?e.value:e;for(let s of n)if(ke.isPair(s)&&(s.key===e||s.key===t||ke.isScalar(s.key)&&s.key.value===t))return s}var $s=class extends ju.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(ke.MAP,e),this.items=[]}static from(e,t,s){let{keepUndefined:i,replacer:r}=s,o=new this(e),a=(l,c)=>{if(typeof r=="function")c=r.call(t,l,c);else if(Array.isArray(r)&&!r.includes(l))return;(c!==void 0||i)&&o.items.push(gn.createPair(l,c,s))};if(t instanceof Map)for(let[l,c]of t)a(l,c);else if(t&&typeof t=="object")for(let l of Object.keys(t))a(l,t[l]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,t){let s;ke.isPair(e)?s=e:!e||typeof e!="object"||!("key"in e)?s=new gn.Pair(e,e?.value):s=new gn.Pair(e.key,e.value);let i=wt(this.items,s.key),r=this.schema?.sortMapEntries;if(i){if(!t)throw new Error(`Key ${s.key} already set`);ke.isScalar(i.value)&&Tu.isScalarValue(s.value)?i.value.value=s.value:i.value=s.value}else if(r){let o=this.items.findIndex(a=>r(s,a)<0);o===-1?this.items.push(s):this.items.splice(o,0,s)}else this.items.push(s)}delete(e){let t=wt(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let i=wt(this.items,e)?.value;return(!t&&ke.isScalar(i)?i.value:i)??void 0}has(e){return!!wt(this.items,e)}set(e,t){this.add(new gn.Pair(e,t),!0)}toJSON(e,t,s){let i=s?new s:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(i);for(let r of this.items)Lu.addPairToJSMap(t,i,r);return i}toString(e,t,s){if(!e)return JSON.stringify(this);for(let i of this.items)if(!ke.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Eu.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:s,onComment:t})}};qs.YAMLMap=$s;qs.findPair=wt});var Je=y(ao=>{"use strict";var $u=L(),oo=Ce(),qu={collection:"map",default:!0,nodeClass:oo.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(n,e){return $u.isMap(n)||e("Expected a mapping for this tag"),n},createNode:(n,e,t)=>oo.YAMLMap.from(n,e,t)};ao.map=qu});var Ne=y(lo=>{"use strict";var Mu=pt(),Du=Ts(),Pu=en(),bn=L(),_u=R(),xu=ye(),Ms=class extends Pu.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(bn.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=yn(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){let s=yn(e);if(typeof s!="number")return;let i=this.items[s];return!t&&bn.isScalar(i)?i.value:i}has(e){let t=yn(e);return typeof t=="number"&&t<this.items.length}set(e,t){let s=yn(e);if(typeof s!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[s];bn.isScalar(i)&&_u.isScalarValue(t)?i.value=t:this.items[s]=t}toJSON(e,t){let s=[];t?.onCreate&&t.onCreate(s);let i=0;for(let r of this.items)s.push(xu.toJS(r,String(i++),t));return s}toString(e,t,s){return e?Du.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:s,onComment:t}):JSON.stringify(this)}static from(e,t,s){let{replacer:i}=s,r=new this(e);if(t&&Symbol.iterator in Object(t)){let o=0;for(let a of t){if(typeof i=="function"){let l=t instanceof Set?a:String(o++);a=i.call(t,l,a)}r.items.push(Mu.createNode(a,void 0,s))}}return r}};function yn(n){let e=bn.isScalar(n)?n.value:n;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}lo.YAMLSeq=Ms});var Ve=y(uo=>{"use strict";var Ru=L(),co=Ne(),Fu={collection:"seq",default:!0,nodeClass:co.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(n,e){return Ru.isSeq(n)||e("Expected a sequence for this tag"),n},createNode:(n,e,t)=>co.YAMLSeq.from(n,e,t)};uo.seq=Fu});var vt=y(fo=>{"use strict";var Bu=yt(),Uu={identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify(n,e,t,s){return e=Object.assign({actualString:!0},e),Bu.stringifyString(n,e,t,s)}};fo.string=Uu});var Sn=y(mo=>{"use strict";var po=R(),ho={identify:n=>n==null,createNode:()=>new po.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new po.Scalar(null),stringify:({source:n},e)=>typeof n=="string"&&ho.test.test(n)?n:e.options.nullStr};mo.nullTag=ho});var Ds=y(yo=>{"use strict";var Ku=R(),go={identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:n=>new Ku.Scalar(n[0]==="t"||n[0]==="T"),stringify({source:n,value:e},t){if(n&&go.test.test(n)){let s=n[0]==="t"||n[0]==="T";if(e===s)return n}return e?t.options.trueStr:t.options.falseStr}};yo.boolTag=go});var We=y(bo=>{"use strict";function Gu({format:n,minFractionDigits:e,tag:t,value:s}){if(typeof s=="bigint")return String(s);let i=typeof s=="number"?s:Number(s);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=Object.is(s,-0)?"-0":JSON.stringify(s);if(!n&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^-?\d/.test(r)&&!r.includes("e")){let o=r.indexOf(".");o<0&&(o=r.length,r+=".");let a=e-(r.length-o-1);for(;a-- >0;)r+="0"}return r}bo.stringifyNumber=Gu});var _s=y(wn=>{"use strict";var Yu=R(),Ps=We(),Ju={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Ps.stringifyNumber},Vu={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n),stringify(n){let e=Number(n.value);return isFinite(e)?e.toExponential():Ps.stringifyNumber(n)}},Wu={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(n){let e=new Yu.Scalar(parseFloat(n)),t=n.indexOf(".");return t!==-1&&n[n.length-1]==="0"&&(e.minFractionDigits=n.length-t-1),e},stringify:Ps.stringifyNumber};wn.float=Wu;wn.floatExp=Vu;wn.floatNaN=Ju});var Rs=y(kn=>{"use strict";var So=We(),vn=n=>typeof n=="bigint"||Number.isInteger(n),xs=(n,e,t,{intAsBigInt:s})=>s?BigInt(n):parseInt(n.substring(e),t);function wo(n,e,t){let{value:s}=n;return vn(s)&&s>=0?t+s.toString(e):So.stringifyNumber(n)}var Hu={identify:n=>vn(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(n,e,t)=>xs(n,2,8,t),stringify:n=>wo(n,8,"0o")},zu={identify:vn,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(n,e,t)=>xs(n,0,10,t),stringify:So.stringifyNumber},Qu={identify:n=>vn(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(n,e,t)=>xs(n,2,16,t),stringify:n=>wo(n,16,"0x")};kn.int=zu;kn.intHex=Qu;kn.intOct=Hu});var ko=y(vo=>{"use strict";var Xu=Je(),Zu=Sn(),ef=Ve(),tf=vt(),nf=Ds(),Fs=_s(),Bs=Rs(),sf=[Xu.map,ef.seq,tf.string,Zu.nullTag,nf.boolTag,Bs.intOct,Bs.int,Bs.intHex,Fs.floatNaN,Fs.floatExp,Fs.float];vo.schema=sf});var Io=y(No=>{"use strict";var rf=R(),of=Je(),af=Ve();function Co(n){return typeof n=="bigint"||Number.isInteger(n)}var Cn=({value:n})=>JSON.stringify(n),lf=[{identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify:Cn},{identify:n=>n==null,createNode:()=>new rf.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Cn},{identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:n=>n==="true",stringify:Cn},{identify:Co,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(n,e,{intAsBigInt:t})=>t?BigInt(n):parseInt(n,10),stringify:({value:n})=>Co(n)?n.toString():JSON.stringify(n)},{identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:n=>parseFloat(n),stringify:Cn}],cf={default:!0,tag:"",test:/^/,resolve(n,e){return e(`Unresolved plain scalar ${JSON.stringify(n)}`),n}},uf=[of.map,af.seq].concat(lf,cf);No.schema=uf});var Ks=y(Ao=>{"use strict";var kt=Ut("buffer"),Us=R(),ff=yt(),df={identify:n=>n instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(n,e){if(typeof kt.Buffer=="function")return kt.Buffer.from(n,"base64");if(typeof atob=="function"){let t=atob(n.replace(/[\n\r]/g,"")),s=new Uint8Array(t.length);for(let i=0;i<t.length;++i)s[i]=t.charCodeAt(i);return s}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),n},stringify({comment:n,type:e,value:t},s,i,r){if(!t)return"";let o=t,a;if(typeof kt.Buffer=="function")a=o instanceof kt.Buffer?o.toString("base64"):kt.Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let l="";for(let c=0;c<o.length;++c)l+=String.fromCharCode(o[c]);a=btoa(l)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=Us.Scalar.BLOCK_LITERAL),e!==Us.Scalar.QUOTE_DOUBLE){let l=Math.max(s.options.lineWidth-s.indent.length,s.options.minContentWidth),c=Math.ceil(a.length/l),u=new Array(c);for(let f=0,d=0;f<c;++f,d+=l)u[f]=a.substr(d,l);a=u.join(e===Us.Scalar.BLOCK_LITERAL?`
|
|
54
|
-
`:" ")}return
|
|
55
|
-
${
|
|
56
|
-
${r.comment}`:s.comment}s=i}n.items[t]=Nn.isPair(s)?s:new Gs.Pair(s)}}else e("Expected a sequence for this tag");return n}function Eo(n,e,t){let{replacer:s}=t,i=new hf.YAMLSeq(n);i.tag="tag:yaml.org,2002:pairs";let r=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof s=="function"&&(o=s.call(e,String(r++),o));let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let c=Object.keys(o);if(c.length===1)a=c[0],l=o[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=o;i.items.push(Gs.createPair(a,l,t))}return i}var mf={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Oo,createNode:Eo};In.createPairs=Eo;In.pairs=mf;In.resolvePairs=Oo});var Vs=y(Js=>{"use strict";var Lo=L(),Ys=ye(),Ct=Ce(),gf=Ne(),jo=An(),Me=class n extends gf.YAMLSeq{constructor(){super(),this.add=Ct.YAMLMap.prototype.add.bind(this),this.delete=Ct.YAMLMap.prototype.delete.bind(this),this.get=Ct.YAMLMap.prototype.get.bind(this),this.has=Ct.YAMLMap.prototype.has.bind(this),this.set=Ct.YAMLMap.prototype.set.bind(this),this.tag=n.tag}toJSON(e,t){if(!t)return super.toJSON(e);let s=new Map;t?.onCreate&&t.onCreate(s);for(let i of this.items){let r,o;if(Lo.isPair(i)?(r=Ys.toJS(i.key,"",t),o=Ys.toJS(i.value,r,t)):r=Ys.toJS(i,"",t),s.has(r))throw new Error("Ordered maps must not include duplicate keys");s.set(r,o)}return s}static from(e,t,s){let i=jo.createPairs(e,t,s),r=new this;return r.items=i.items,r}};Me.tag="tag:yaml.org,2002:omap";var yf={collection:"seq",identify:n=>n instanceof Map,nodeClass:Me,default:!1,tag:"tag:yaml.org,2002:omap",resolve(n,e){let t=jo.resolvePairs(n,e),s=[];for(let{key:i}of t.items)Lo.isScalar(i)&&(s.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):s.push(i.value));return Object.assign(new Me,t)},createNode:(n,e,t)=>Me.from(n,e,t)};Js.YAMLOMap=Me;Js.omap=yf});var Do=y(Ws=>{"use strict";var To=R();function $o({value:n,source:e},t){return e&&(n?qo:Mo).test.test(e)?e:n?t.options.trueStr:t.options.falseStr}var qo={identify:n=>n===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new To.Scalar(!0),stringify:$o},Mo={identify:n=>n===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new To.Scalar(!1),stringify:$o};Ws.falseTag=Mo;Ws.trueTag=qo});var Po=y(On=>{"use strict";var bf=R(),Hs=We(),Sf={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Hs.stringifyNumber},wf={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n.replace(/_/g,"")),stringify(n){let e=Number(n.value);return isFinite(e)?e.toExponential():Hs.stringifyNumber(n)}},vf={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(n){let e=new bf.Scalar(parseFloat(n.replace(/_/g,""))),t=n.indexOf(".");if(t!==-1){let s=n.substring(t+1).replace(/_/g,"");s[s.length-1]==="0"&&(e.minFractionDigits=s.length)}return e},stringify:Hs.stringifyNumber};On.float=vf;On.floatExp=wf;On.floatNaN=Sf});var xo=y(It=>{"use strict";var _o=We(),Nt=n=>typeof n=="bigint"||Number.isInteger(n);function En(n,e,t,{intAsBigInt:s}){let i=n[0];if((i==="-"||i==="+")&&(e+=1),n=n.substring(e).replace(/_/g,""),s){switch(t){case 2:n=`0b${n}`;break;case 8:n=`0o${n}`;break;case 16:n=`0x${n}`;break}let o=BigInt(n);return i==="-"?BigInt(-1)*o:o}let r=parseInt(n,t);return i==="-"?-1*r:r}function zs(n,e,t){let{value:s}=n;if(Nt(s)){let i=s.toString(e);return s<0?"-"+t+i.substr(1):t+i}return _o.stringifyNumber(n)}var kf={identify:Nt,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(n,e,t)=>En(n,2,2,t),stringify:n=>zs(n,2,"0b")},Cf={identify:Nt,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(n,e,t)=>En(n,1,8,t),stringify:n=>zs(n,8,"0")},Nf={identify:Nt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(n,e,t)=>En(n,0,10,t),stringify:_o.stringifyNumber},If={identify:Nt,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(n,e,t)=>En(n,2,16,t),stringify:n=>zs(n,16,"0x")};It.int=Nf;It.intBin=kf;It.intHex=If;It.intOct=Cf});var Xs=y(Qs=>{"use strict";var Tn=L(),Ln=ve(),jn=Ce(),De=class n extends jn.YAMLMap{constructor(e){super(e),this.tag=n.tag}add(e){let t;Tn.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new Ln.Pair(e.key,null):t=new Ln.Pair(e,null),jn.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let s=jn.findPair(this.items,e);return!t&&Tn.isPair(s)?Tn.isScalar(s.key)?s.key.value:s.key:s}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let s=jn.findPair(this.items,e);s&&!t?this.items.splice(this.items.indexOf(s),1):!s&&t&&this.items.push(new Ln.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,s){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,s);throw new Error("Set items must all have null values")}static from(e,t,s){let{replacer:i}=s,r=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t)typeof i=="function"&&(o=i.call(t,o,o)),r.items.push(Ln.createPair(o,null,s));return r}};De.tag="tag:yaml.org,2002:set";var Af={collection:"map",identify:n=>n instanceof Set,nodeClass:De,default:!1,tag:"tag:yaml.org,2002:set",createNode:(n,e,t)=>De.from(n,e,t),resolve(n,e){if(Tn.isMap(n)){if(n.hasAllNullValues(!0))return Object.assign(new De,n);e("Set items must all have null values")}else e("Expected a mapping for this tag");return n}};Qs.YAMLSet=De;Qs.set=Af});var ei=y($n=>{"use strict";var Of=We();function Zs(n,e){let t=n[0],s=t==="-"||t==="+"?n.substring(1):n,i=o=>e?BigInt(o):Number(o),r=s.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return t==="-"?i(-1)*r:r}function Ro(n){let{value:e}=n,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return Of.stringifyNumber(n);let s="";e<0&&(s="-",e*=t(-1));let i=t(60),r=[e%i];return e<60?r.unshift(0):(e=(e-r[0])/i,r.unshift(e%i),e>=60&&(e=(e-r[0])/i,r.unshift(e))),s+r.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Ef={identify:n=>typeof n=="bigint"||Number.isInteger(n),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(n,e,{intAsBigInt:t})=>Zs(n,t),stringify:Ro},Lf={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:n=>Zs(n,!1),stringify:Ro},Fo={identify:n=>n instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(n){let e=n.match(Fo.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,s,i,r,o,a]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(t,s-1,i,r||0,o||0,a||0,l),u=e[8];if(u&&u!=="Z"){let f=Zs(u,!1);Math.abs(f)<30&&(f*=60),c-=6e4*f}return new Date(c)},stringify:({value:n})=>n?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};$n.floatTime=Lf;$n.intTime=Ef;$n.timestamp=Fo});var Ko=y(Uo=>{"use strict";var jf=Je(),Tf=Sn(),$f=Ve(),qf=vt(),Mf=Ks(),Bo=Do(),ti=Po(),qn=xo(),Df=fn(),Pf=Vs(),_f=An(),xf=Xs(),ni=ei(),Rf=[jf.map,$f.seq,qf.string,Tf.nullTag,Bo.trueTag,Bo.falseTag,qn.intBin,qn.intOct,qn.int,qn.intHex,ti.floatNaN,ti.floatExp,ti.float,Mf.binary,Df.merge,Pf.omap,_f.pairs,xf.set,ni.intTime,ni.floatTime,ni.timestamp];Uo.schema=Rf});var Zo=y(ri=>{"use strict";var Vo=Je(),Ff=Sn(),Wo=Ve(),Bf=vt(),Uf=Ds(),si=_s(),ii=Rs(),Kf=ko(),Gf=Io(),Ho=Ks(),At=fn(),zo=Vs(),Qo=An(),Go=Ko(),Xo=Xs(),Mn=ei(),Yo=new Map([["core",Kf.schema],["failsafe",[Vo.map,Wo.seq,Bf.string]],["json",Gf.schema],["yaml11",Go.schema],["yaml-1.1",Go.schema]]),Jo={binary:Ho.binary,bool:Uf.boolTag,float:si.float,floatExp:si.floatExp,floatNaN:si.floatNaN,floatTime:Mn.floatTime,int:ii.int,intHex:ii.intHex,intOct:ii.intOct,intTime:Mn.intTime,map:Vo.map,merge:At.merge,null:Ff.nullTag,omap:zo.omap,pairs:Qo.pairs,seq:Wo.seq,set:Xo.set,timestamp:Mn.timestamp},Yf={"tag:yaml.org,2002:binary":Ho.binary,"tag:yaml.org,2002:merge":At.merge,"tag:yaml.org,2002:omap":zo.omap,"tag:yaml.org,2002:pairs":Qo.pairs,"tag:yaml.org,2002:set":Xo.set,"tag:yaml.org,2002:timestamp":Mn.timestamp};function Jf(n,e,t){let s=Yo.get(e);if(s&&!n)return t&&!s.includes(At.merge)?s.concat(At.merge):s.slice();let i=s;if(!i)if(Array.isArray(n))i=[];else{let r=Array.from(Yo.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${r} or define customTags array`)}if(Array.isArray(n))for(let r of n)i=i.concat(r);else typeof n=="function"&&(i=n(i.slice()));return t&&(i=i.concat(At.merge)),i.reduce((r,o)=>{let a=typeof o=="string"?Jo[o]:o;if(!a){let l=JSON.stringify(o),c=Object.keys(Jo).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return r.includes(a)||r.push(a),r},[])}ri.coreKnownTags=Yf;ri.getTags=Jf});var li=y(ea=>{"use strict";var oi=L(),Vf=Je(),Wf=Ve(),Hf=vt(),Dn=Zo(),zf=(n,e)=>n.key<e.key?-1:n.key>e.key?1:0,ai=class n{constructor({compat:e,customTags:t,merge:s,resolveKnownTags:i,schema:r,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?Dn.getTags(e,"compat"):e?Dn.getTags(null,e):null,this.name=typeof r=="string"&&r||"core",this.knownTags=i?Dn.coreKnownTags:{},this.tags=Dn.getTags(t,this.name,s),this.toStringOptions=a??null,Object.defineProperty(this,oi.MAP,{value:Vf.map}),Object.defineProperty(this,oi.SCALAR,{value:Hf.string}),Object.defineProperty(this,oi.SEQ,{value:Wf.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?zf:null}clone(){let e=Object.create(n.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};ea.Schema=ai});var na=y(ta=>{"use strict";var Qf=L(),ci=bt(),Ot=ht();function Xf(n,e){let t=[],s=e.directives===!0;if(e.directives!==!1&&n.directives){let l=n.directives.toString(n);l?(t.push(l),s=!0):n.directives.docStart&&(s=!0)}s&&t.push("---");let i=ci.createStringifyContext(n,e),{commentString:r}=i.options;if(n.commentBefore){t.length!==1&&t.unshift("");let l=r(n.commentBefore);t.unshift(Ot.indentComment(l,""))}let o=!1,a=null;if(n.contents){if(Qf.isNode(n.contents)){if(n.contents.spaceBefore&&s&&t.push(""),n.contents.commentBefore){let u=r(n.contents.commentBefore);t.push(Ot.indentComment(u,""))}i.forceBlockIndent=!!n.comment,a=n.contents.comment}let l=a?void 0:()=>o=!0,c=ci.stringify(n.contents,i,()=>a=null,l);a&&(c+=Ot.lineComment(c,"",r(a))),(c[0]==="|"||c[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${c}`:t.push(c)}else t.push(ci.stringify(n.contents,i));if(n.directives?.docEnd)if(n.comment){let l=r(n.comment);l.includes(`
|
|
57
|
-
`)?(
|
|
51
|
+
`;let C,A;for(A=h.length;A>0;--A){let T=h[A-1];if(T!==`
|
|
52
|
+
`&&T!==" "&&T!==" ")break}let N=h.substring(A),O=N.indexOf(`
|
|
53
|
+
`);O===-1?C="-":h===N||O!==N.length-1?(C="+",w&&w()):C="",N&&(h=h.slice(0,-N.length),N[N.length-1]===`
|
|
54
|
+
`&&(N=N.slice(0,-1)),N=N.replace(a,`$&${b}`));let I=!1,L,G=-1;for(L=0;L<h.length;++L){let T=h[L];if(T===" ")I=!0;else if(T===`
|
|
55
|
+
`)G=L;else break}let _=h.substring(0,G<L?G+1:L);_&&(h=h.substring(_.length),_=_.replace(/\n+/g,`$&${b}`));let Q=(I?b?"2":"1":"")+C;if(d&&(Q+=" "+S(d.replace(/ ?[\r\n]+/g," ")),y&&y()),!E){let T=h.replace(/\n+/g,`
|
|
56
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${b}`),ce=!1,z=s(g,!0);v!=="folded"&&m!==t.Scalar.BLOCK_FOLDED&&(z.onOverflow=()=>{ce=!0});let ue=n.foldFlowLines(`${_}${T}${N}`,b,n.FOLD_BLOCK,z);if(!ce)return`>${Q}
|
|
57
|
+
${b}${ue}`}return h=h.replace(/\n+/g,`$&${b}`),`|${Q}
|
|
58
|
+
${b}${_}${h}${N}`}function f(d,m,h,g){let{type:y,value:w}=d,{actualString:v,implicitKey:S,indent:k,indentStep:b,inFlow:E}=m;if(S&&w.includes(`
|
|
59
|
+
`)||E&&/[[\]{},]/.test(w))return c(w,m);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(w))return S||E||!w.includes(`
|
|
60
|
+
`)?c(w,m):p(d,m,h,g);if(!S&&!E&&y!==t.Scalar.PLAIN&&w.includes(`
|
|
61
|
+
`))return p(d,m,h,g);if(r(w)){if(k==="")return m.forceBlockIndent=!0,p(d,m,h,g);if(S&&k===b)return c(w,m)}let C=w.replace(/\n+/g,`$&
|
|
62
|
+
${k}`);if(v){let A=I=>I.default&&I.tag!=="tag:yaml.org,2002:str"&&I.test?.test(C),{compat:N,tags:O}=m.doc.schema;if(O.some(A)||N?.some(A))return c(w,m)}return S?C:n.foldFlowLines(C,k,n.FOLD_FLOW,s(m,!1))}function u(d,m,h,g){let{implicitKey:y,inFlow:w}=m,v=typeof d.value=="string"?d:Object.assign({},d,{value:String(d.value)}),{type:S}=d;S!==t.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(v.value)&&(S=t.Scalar.QUOTE_DOUBLE);let k=E=>{switch(E){case t.Scalar.BLOCK_FOLDED:case t.Scalar.BLOCK_LITERAL:return y||w?c(v.value,m):p(v,m,h,g);case t.Scalar.QUOTE_DOUBLE:return o(v.value,m);case t.Scalar.QUOTE_SINGLE:return l(v.value,m);case t.Scalar.PLAIN:return f(v,m,h,g);default:return null}},b=k(S);if(b===null){let{defaultKeyType:E,defaultStringType:C}=m.options,A=y&&E||C;if(b=k(A),b===null)throw new Error(`Unsupported default string type ${A}`)}return b}e.stringifyString=u}}),Gs=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/stringify.js"(e){"use strict";var t=ji(),n=B(),s=xs(),r=Ws();function i(a,p){let f=Object.assign({blockQuote:!0,commentString:s.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},a.schema.toStringOptions,p),u;switch(f.collectionStyle){case"block":u=!1;break;case"flow":u=!0;break;default:u=null}return{anchors:new Set,doc:a,flowCollectionPadding:f.flowCollectionPadding?" ":"",indent:"",indentStep:typeof f.indent=="number"?" ".repeat(f.indent):" ",inFlow:u,options:f}}function o(a,p){if(p.tag){let d=a.filter(m=>m.tag===p.tag);if(d.length>0)return d.find(m=>m.format===p.format)??d[0]}let f,u;if(n.isScalar(p)){u=p.value;let d=a.filter(m=>m.identify?.(u));if(d.length>1){let m=d.filter(h=>h.test);m.length>0&&(d=m)}f=d.find(m=>m.format===p.format)??d.find(m=>!m.format)}else u=p,f=a.find(d=>d.nodeClass&&u instanceof d.nodeClass);if(!f){let d=u?.constructor?.name??(u===null?"null":typeof u);throw new Error(`Tag not resolved for ${d} value`)}return f}function l(a,p,{anchors:f,doc:u}){if(!u.directives)return"";let d=[],m=(n.isScalar(a)||n.isCollection(a))&&a.anchor;m&&t.anchorIsValid(m)&&(f.add(m),d.push(`&${m}`));let h=a.tag??(p.default?null:p.tag);return h&&d.push(u.directives.tagString(h)),d.join(" ")}function c(a,p,f,u){if(n.isPair(a))return a.toString(p,f,u);if(n.isAlias(a)){if(p.doc.directives)return a.toString(p);if(p.resolvedAliases?.has(a))throw new TypeError("Cannot stringify circular structure without alias nodes");p.resolvedAliases?p.resolvedAliases.add(a):p.resolvedAliases=new Set([a]),a=a.resolve(p.doc)}let d,m=n.isNode(a)?a:p.doc.createNode(a,{onTagObj:y=>d=y});d??(d=o(p.doc.schema.tags,m));let h=l(m,d,p);h.length>0&&(p.indentAtStart=(p.indentAtStart??0)+h.length+1);let g=typeof d.stringify=="function"?d.stringify(m,p,f,u):n.isScalar(m)?r.stringifyString(m,p,f,u):m.toString(p,f,u);return h?n.isScalar(m)||g[0]==="{"||g[0]==="["?`${h} ${g}`:`${h}
|
|
63
|
+
${p.indent}${g}`:g}e.createStringifyContext=i,e.stringify=c}}),mh=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyPair.js"(e){"use strict";var t=B(),n=se(),s=Gs(),r=xs();function i({key:o,value:l},c,a,p){let{allNullValues:f,doc:u,indent:d,indentStep:m,options:{commentString:h,indentSeq:g,simpleKeys:y}}=c,w=t.isNode(o)&&o.comment||null;if(y){if(w)throw new Error("With simple keys, key nodes cannot have comments");if(t.isCollection(o)||!t.isNode(o)&&typeof o=="object"){let L="With simple keys, collection cannot be used as a key value";throw new Error(L)}}let v=!y&&(!o||w&&l==null&&!c.inFlow||t.isCollection(o)||(t.isScalar(o)?o.type===n.Scalar.BLOCK_FOLDED||o.type===n.Scalar.BLOCK_LITERAL:typeof o=="object"));c=Object.assign({},c,{allNullValues:!1,implicitKey:!v&&(y||!f),indent:d+m});let S=!1,k=!1,b=s.stringify(o,c,()=>S=!0,()=>k=!0);if(!v&&!c.inFlow&&b.length>1024){if(y)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");v=!0}if(c.inFlow){if(f||l==null)return S&&a&&a(),b===""?"?":v?`? ${b}`:b}else if(f&&!y||l==null&&v)return b=`? ${b}`,w&&!S?b+=r.lineComment(b,c.indent,h(w)):k&&p&&p(),b;S&&(w=null),v?(w&&(b+=r.lineComment(b,c.indent,h(w))),b=`? ${b}
|
|
64
|
+
${d}:`):(b=`${b}:`,w&&(b+=r.lineComment(b,c.indent,h(w))));let E,C,A;t.isNode(l)?(E=!!l.spaceBefore,C=l.commentBefore,A=l.comment):(E=!1,C=null,A=null,l&&typeof l=="object"&&(l=u.createNode(l))),c.implicitKey=!1,!v&&!w&&t.isScalar(l)&&(c.indentAtStart=b.length+1),k=!1,!g&&m.length>=2&&!c.inFlow&&!v&&t.isSeq(l)&&!l.flow&&!l.tag&&!l.anchor&&(c.indent=c.indent.substring(2));let N=!1,O=s.stringify(l,c,()=>N=!0,()=>k=!0),I=" ";if(w||E||C){if(I=E?`
|
|
65
|
+
`:"",C){let L=h(C);I+=`
|
|
66
|
+
${r.indentComment(L,c.indent)}`}O===""&&!c.inFlow?I===`
|
|
67
|
+
`&&A&&(I=`
|
|
68
|
+
|
|
69
|
+
`):I+=`
|
|
70
|
+
${c.indent}`}else if(!v&&t.isCollection(l)){let L=O[0],G=O.indexOf(`
|
|
71
|
+
`),_=G!==-1,ne=c.inFlow??l.flow??l.items.length===0;if(_||!ne){let Q=!1;if(_&&(L==="&"||L==="!")){let T=O.indexOf(" ");L==="&"&&T!==-1&&T<G&&O[T+1]==="!"&&(T=O.indexOf(" ",T+1)),(T===-1||G<T)&&(Q=!0)}Q||(I=`
|
|
72
|
+
${c.indent}`)}}else(O===""||O[0]===`
|
|
73
|
+
`)&&(I="");return b+=I+O,c.inFlow?N&&a&&a():A&&!N?b+=r.lineComment(b,c.indent,h(A)):k&&p&&p(),b}e.stringifyPair=i}}),Dl=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/log.js"(e){"use strict";var t=Us("process");function n(r,...i){r==="debug"&&console.log(...i)}function s(r,i){(r==="debug"||r==="warn")&&(typeof t.emitWarning=="function"?t.emitWarning(i):console.warn(i))}e.debug=n,e.warn=s}}),Ti=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/merge.js"(e){"use strict";var t=B(),n=se(),s="<<",r={identify:a=>a===s||typeof a=="symbol"&&a.description===s,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new n.Scalar(Symbol(s)),{addToJSMap:o}),stringify:()=>s},i=(a,p)=>(r.identify(p)||t.isScalar(p)&&(!p.type||p.type===n.Scalar.PLAIN)&&r.identify(p.value))&&a?.doc.schema.tags.some(f=>f.tag===r.tag&&f.default);function o(a,p,f){let u=c(a,f);if(t.isSeq(u))for(let d of u.items)l(a,p,d);else if(Array.isArray(u))for(let d of u)l(a,p,d);else l(a,p,u)}function l(a,p,f){let u=c(a,f);if(!t.isMap(u))throw new Error("Merge sources must be maps or map aliases");let d=u.toJSON(null,a,Map);for(let[m,h]of d)p instanceof Map?p.has(m)||p.set(m,h):p instanceof Set?p.add(m):Object.prototype.hasOwnProperty.call(p,m)||Object.defineProperty(p,m,{value:h,writable:!0,enumerable:!0,configurable:!0});return p}function c(a,p){return a&&t.isAlias(p)?p.resolve(a.doc,a):p}e.addMergeToJSMap=o,e.isMergeKey=i,e.merge=r}}),Ll=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/addPairToJSMap.js"(e){"use strict";var t=Dl(),n=Ti(),s=Gs(),r=B(),i=At();function o(c,a,{key:p,value:f}){if(r.isNode(p)&&p.addToJSMap)p.addToJSMap(c,a,f);else if(n.isMergeKey(c,p))n.addMergeToJSMap(c,a,f);else{let u=i.toJS(p,"",c);if(a instanceof Map)a.set(u,i.toJS(f,u,c));else if(a instanceof Set)a.add(u);else{let d=l(p,u,c),m=i.toJS(f,d,c);d in a?Object.defineProperty(a,d,{value:m,writable:!0,enumerable:!0,configurable:!0}):a[d]=m}}return a}function l(c,a,p){if(a===null)return"";if(typeof a!="object")return String(a);if(r.isNode(c)&&p?.doc){let f=s.createStringifyContext(p.doc,{});f.anchors=new Set;for(let d of p.anchors.keys())f.anchors.add(d.anchor);f.inFlow=!0,f.inStringifyKey=!0;let u=c.toString(f);if(!p.mapKeyWarned){let d=JSON.stringify(u);d.length>40&&(d=d.substring(0,36)+'..."'),t.warn(p.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${d}. Set mapAsMap: true to use object keys.`),p.mapKeyWarned=!0}return u}return JSON.stringify(a)}e.addPairToJSMap=o}}),Nt=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/Pair.js"(e){"use strict";var t=Vs(),n=mh(),s=Ll(),r=B();function i(l,c,a){let p=t.createNode(l,void 0,a),f=t.createNode(c,void 0,a);return new o(p,f)}var o=class Tl{constructor(c,a=null){Object.defineProperty(this,r.NODE_TYPE,{value:r.PAIR}),this.key=c,this.value=a}clone(c){let{key:a,value:p}=this;return r.isNode(a)&&(a=a.clone(c)),r.isNode(p)&&(p=p.clone(c)),new Tl(a,p)}toJSON(c,a){let p=a?.mapAsMap?new Map:{};return s.addPairToJSMap(a,p,this)}toString(c,a,p){return c?.doc?n.stringifyPair(this,c,a,p):JSON.stringify(this)}};e.Pair=o,e.createPair=i}}),Fl=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyCollection.js"(e){"use strict";var t=B(),n=Gs(),s=xs();function r(c,a,p){return(a.inFlow??c.flow?o:i)(c,a,p)}function i({comment:c,items:a},p,{blockItemPrefix:f,flowChars:u,itemIndent:d,onChompKeep:m,onComment:h}){let{indent:g,options:{commentString:y}}=p,w=Object.assign({},p,{indent:d,type:null}),v=!1,S=[];for(let b=0;b<a.length;++b){let E=a[b],C=null;if(t.isNode(E))!v&&E.spaceBefore&&S.push(""),l(p,S,E.commentBefore,v),E.comment&&(C=E.comment);else if(t.isPair(E)){let N=t.isNode(E.key)?E.key:null;N&&(!v&&N.spaceBefore&&S.push(""),l(p,S,N.commentBefore,v))}v=!1;let A=n.stringify(E,w,()=>C=null,()=>v=!0);C&&(A+=s.lineComment(A,d,y(C))),v&&C&&(v=!1),S.push(f+A)}let k;if(S.length===0)k=u.start+u.end;else{k=S[0];for(let b=1;b<S.length;++b){let E=S[b];k+=E?`
|
|
74
|
+
${g}${E}`:`
|
|
75
|
+
`}}return c?(k+=`
|
|
76
|
+
`+s.indentComment(y(c),g),h&&h()):v&&m&&m(),k}function o({items:c},a,{flowChars:p,itemIndent:f}){let{indent:u,indentStep:d,flowCollectionPadding:m,options:{commentString:h}}=a;f+=d;let g=Object.assign({},a,{indent:f,inFlow:!0,type:null}),y=!1,w=0,v=[];for(let b=0;b<c.length;++b){let E=c[b],C=null;if(t.isNode(E))E.spaceBefore&&v.push(""),l(a,v,E.commentBefore,!1),E.comment&&(C=E.comment);else if(t.isPair(E)){let N=t.isNode(E.key)?E.key:null;N&&(N.spaceBefore&&v.push(""),l(a,v,N.commentBefore,!1),N.comment&&(y=!0));let O=t.isNode(E.value)?E.value:null;O?(O.comment&&(C=O.comment),O.commentBefore&&(y=!0)):E.value==null&&N?.comment&&(C=N.comment)}C&&(y=!0);let A=n.stringify(E,g,()=>C=null);y||(y=v.length>w||A.includes(`
|
|
77
|
+
`)),b<c.length-1?A+=",":a.options.trailingComma&&(a.options.lineWidth>0&&(y||(y=v.reduce((N,O)=>N+O.length+2,2)+(A.length+2)>a.options.lineWidth)),y&&(A+=",")),C&&(A+=s.lineComment(A,f,h(C))),v.push(A),w=v.length}let{start:S,end:k}=p;if(v.length===0)return S+k;if(!y){let b=v.reduce((E,C)=>E+C.length+2,2);y=a.options.lineWidth>0&&b>a.options.lineWidth}if(y){let b=S;for(let E of v)b+=E?`
|
|
78
|
+
${d}${u}${E}`:`
|
|
79
|
+
`;return`${b}
|
|
80
|
+
${u}${k}`}else return`${S}${m}${v.join(" ")}${m}${k}`}function l({indent:c,options:{commentString:a}},p,f,u){if(f&&u&&(f=f.replace(/^\n+/,"")),f){let d=s.indentComment(a(f),c);p.push(d.trimStart())}}e.stringifyCollection=r}}),Ot=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/YAMLMap.js"(e){"use strict";var t=Fl(),n=Ll(),s=Li(),r=B(),i=Nt(),o=se();function l(a,p){let f=r.isScalar(p)?p.value:p;for(let u of a)if(r.isPair(u)&&(u.key===p||u.key===f||r.isScalar(u.key)&&u.key.value===f))return u}var c=class extends s.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(a){super(r.MAP,a),this.items=[]}static from(a,p,f){let{keepUndefined:u,replacer:d}=f,m=new this(a),h=(g,y)=>{if(typeof d=="function")y=d.call(p,g,y);else if(Array.isArray(d)&&!d.includes(g))return;(y!==void 0||u)&&m.items.push(i.createPair(g,y,f))};if(p instanceof Map)for(let[g,y]of p)h(g,y);else if(p&&typeof p=="object")for(let g of Object.keys(p))h(g,p[g]);return typeof a.sortMapEntries=="function"&&m.items.sort(a.sortMapEntries),m}add(a,p){let f;r.isPair(a)?f=a:!a||typeof a!="object"||!("key"in a)?f=new i.Pair(a,a?.value):f=new i.Pair(a.key,a.value);let u=l(this.items,f.key),d=this.schema?.sortMapEntries;if(u){if(!p)throw new Error(`Key ${f.key} already set`);r.isScalar(u.value)&&o.isScalarValue(f.value)?u.value.value=f.value:u.value=f.value}else if(d){let m=this.items.findIndex(h=>d(f,h)<0);m===-1?this.items.push(f):this.items.splice(m,0,f)}else this.items.push(f)}delete(a){let p=l(this.items,a);return p?this.items.splice(this.items.indexOf(p),1).length>0:!1}get(a,p){let u=l(this.items,a)?.value;return(!p&&r.isScalar(u)?u.value:u)??void 0}has(a){return!!l(this.items,a)}set(a,p){this.add(new i.Pair(a,p),!0)}toJSON(a,p,f){let u=f?new f:p?.mapAsMap?new Map:{};p?.onCreate&&p.onCreate(u);for(let d of this.items)n.addPairToJSMap(p,u,d);return u}toString(a,p,f){if(!a)return JSON.stringify(this);for(let u of this.items)if(!r.isPair(u))throw new Error(`Map items must all be pairs; found ${JSON.stringify(u)} instead`);return!a.allNullValues&&this.hasAllNullValues(!1)&&(a=Object.assign({},a,{allNullValues:!0})),t.stringifyCollection(this,a,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:a.indent||"",onChompKeep:f,onComment:p})}};e.YAMLMap=c,e.findPair=l}}),Tn=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/common/map.js"(e){"use strict";var t=B(),n=Ot(),s={collection:"map",default:!0,nodeClass:n.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(r,i){return t.isMap(r)||i("Expected a mapping for this tag"),r},createNode:(r,i,o)=>n.YAMLMap.from(r,i,o)};e.map=s}}),It=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/YAMLSeq.js"(e){"use strict";var t=Vs(),n=Fl(),s=Li(),r=B(),i=se(),o=At(),l=class extends s.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(a){super(r.SEQ,a),this.items=[]}add(a){this.items.push(a)}delete(a){let p=c(a);return typeof p!="number"?!1:this.items.splice(p,1).length>0}get(a,p){let f=c(a);if(typeof f!="number")return;let u=this.items[f];return!p&&r.isScalar(u)?u.value:u}has(a){let p=c(a);return typeof p=="number"&&p<this.items.length}set(a,p){let f=c(a);if(typeof f!="number")throw new Error(`Expected a valid index, not ${a}.`);let u=this.items[f];r.isScalar(u)&&i.isScalarValue(p)?u.value=p:this.items[f]=p}toJSON(a,p){let f=[];p?.onCreate&&p.onCreate(f);let u=0;for(let d of this.items)f.push(o.toJS(d,String(u++),p));return f}toString(a,p,f){return a?n.stringifyCollection(this,a,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(a.indent||"")+" ",onChompKeep:f,onComment:p}):JSON.stringify(this)}static from(a,p,f){let{replacer:u}=f,d=new this(a);if(p&&Symbol.iterator in Object(p)){let m=0;for(let h of p){if(typeof u=="function"){let g=p instanceof Set?h:String(m++);h=u.call(p,g,h)}d.items.push(t.createNode(h,void 0,f))}}return d}};function c(a){let p=r.isScalar(a)?a.value:a;return p&&typeof p=="string"&&(p=Number(p)),typeof p=="number"&&Number.isInteger(p)&&p>=0?p:null}e.YAMLSeq=l}}),Fn=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/common/seq.js"(e){"use strict";var t=B(),n=It(),s={collection:"seq",default:!0,nodeClass:n.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(r,i){return t.isSeq(r)||i("Expected a sequence for this tag"),r},createNode:(r,i,o)=>n.YAMLSeq.from(r,i,o)};e.seq=s}}),Hs=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/common/string.js"(e){"use strict";var t=Ws(),n={identify:s=>typeof s=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:s=>s,stringify(s,r,i,o){return r=Object.assign({actualString:!0},r),t.stringifyString(s,r,i,o)}};e.string=n}}),Fi=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/common/null.js"(e){"use strict";var t=se(),n={identify:s=>s==null,createNode:()=>new t.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new t.Scalar(null),stringify:({source:s},r)=>typeof s=="string"&&n.test.test(s)?s:r.options.nullStr};e.nullTag=n}}),_l=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/core/bool.js"(e){"use strict";var t=se(),n={identify:s=>typeof s=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:s=>new t.Scalar(s[0]==="t"||s[0]==="T"),stringify({source:s,value:r},i){if(s&&n.test.test(s)){let o=s[0]==="t"||s[0]==="T";if(r===o)return s}return r?i.options.trueStr:i.options.falseStr}};e.boolTag=n}}),_n=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyNumber.js"(e){"use strict";function t({format:n,minFractionDigits:s,tag:r,value:i}){if(typeof i=="bigint")return String(i);let o=typeof i=="number"?i:Number(i);if(!isFinite(o))return isNaN(o)?".nan":o<0?"-.inf":".inf";let l=Object.is(i,-0)?"-0":JSON.stringify(i);if(!n&&s&&(!r||r==="tag:yaml.org,2002:float")&&/^-?\d/.test(l)&&!l.includes("e")){let c=l.indexOf(".");c<0&&(c=l.length,l+=".");let a=s-(l.length-c-1);for(;a-- >0;)l+="0"}return l}e.stringifyNumber=t}}),Pl=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/core/float.js"(e){"use strict";var t=se(),n=_n(),s={identify:o=>typeof o=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:o=>o.slice(-3).toLowerCase()==="nan"?NaN:o[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:n.stringifyNumber},r={identify:o=>typeof o=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:o=>parseFloat(o),stringify(o){let l=Number(o.value);return isFinite(l)?l.toExponential():n.stringifyNumber(o)}},i={identify:o=>typeof o=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(o){let l=new t.Scalar(parseFloat(o)),c=o.indexOf(".");return c!==-1&&o[o.length-1]==="0"&&(l.minFractionDigits=o.length-c-1),l},stringify:n.stringifyNumber};e.float=i,e.floatExp=r,e.floatNaN=s}}),$l=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/core/int.js"(e){"use strict";var t=_n(),n=c=>typeof c=="bigint"||Number.isInteger(c),s=(c,a,p,{intAsBigInt:f})=>f?BigInt(c):parseInt(c.substring(a),p);function r(c,a,p){let{value:f}=c;return n(f)&&f>=0?p+f.toString(a):t.stringifyNumber(c)}var i={identify:c=>n(c)&&c>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(c,a,p)=>s(c,2,8,p),stringify:c=>r(c,8,"0o")},o={identify:n,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(c,a,p)=>s(c,0,10,p),stringify:t.stringifyNumber},l={identify:c=>n(c)&&c>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(c,a,p)=>s(c,2,16,p),stringify:c=>r(c,16,"0x")};e.int=o,e.intHex=l,e.intOct=i}}),gh=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/core/schema.js"(e){"use strict";var t=Tn(),n=Fi(),s=Fn(),r=Hs(),i=_l(),o=Pl(),l=$l(),c=[t.map,s.seq,r.string,n.nullTag,i.boolTag,l.intOct,l.int,l.intHex,o.floatNaN,o.floatExp,o.float];e.schema=c}}),yh=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/json/schema.js"(e){"use strict";var t=se(),n=Tn(),s=Fn();function r(a){return typeof a=="bigint"||Number.isInteger(a)}var i=({value:a})=>JSON.stringify(a),o=[{identify:a=>typeof a=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:a=>a,stringify:i},{identify:a=>a==null,createNode:()=>new t.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:i},{identify:a=>typeof a=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:a=>a==="true",stringify:i},{identify:r,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(a,p,{intAsBigInt:f})=>f?BigInt(a):parseInt(a,10),stringify:({value:a})=>r(a)?a.toString():JSON.stringify(a)},{identify:a=>typeof a=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:a=>parseFloat(a),stringify:i}],l={default:!0,tag:"",test:/^/,resolve(a,p){return p(`Unresolved plain scalar ${JSON.stringify(a)}`),a}},c=[n.map,s.seq].concat(o,l);e.schema=c}}),Ml=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/binary.js"(e){"use strict";var t=Us("buffer"),n=se(),s=Ws(),r={identify:i=>i instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(i,o){if(typeof t.Buffer=="function")return t.Buffer.from(i,"base64");if(typeof atob=="function"){let l=atob(i.replace(/[\n\r]/g,"")),c=new Uint8Array(l.length);for(let a=0;a<l.length;++a)c[a]=l.charCodeAt(a);return c}else return o("This environment does not support reading binary tags; either Buffer or atob is required"),i},stringify({comment:i,type:o,value:l},c,a,p){if(!l)return"";let f=l,u;if(typeof t.Buffer=="function")u=f instanceof t.Buffer?f.toString("base64"):t.Buffer.from(f.buffer).toString("base64");else if(typeof btoa=="function"){let d="";for(let m=0;m<f.length;++m)d+=String.fromCharCode(f[m]);u=btoa(d)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(o??(o=n.Scalar.BLOCK_LITERAL),o!==n.Scalar.QUOTE_DOUBLE){let d=Math.max(c.options.lineWidth-c.indent.length,c.options.minContentWidth),m=Math.ceil(u.length/d),h=new Array(m);for(let g=0,y=0;g<m;++g,y+=d)h[g]=u.substr(y,d);u=h.join(o===n.Scalar.BLOCK_LITERAL?`
|
|
81
|
+
`:" ")}return s.stringifyString({comment:i,type:o,value:u},c,a,p)}};e.binary=r}}),_i=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/pairs.js"(e){"use strict";var t=B(),n=Nt(),s=se(),r=It();function i(c,a){if(t.isSeq(c))for(let p=0;p<c.items.length;++p){let f=c.items[p];if(!t.isPair(f)){if(t.isMap(f)){f.items.length>1&&a("Each pair must have its own sequence indicator");let u=f.items[0]||new n.Pair(new s.Scalar(null));if(f.commentBefore&&(u.key.commentBefore=u.key.commentBefore?`${f.commentBefore}
|
|
82
|
+
${u.key.commentBefore}`:f.commentBefore),f.comment){let d=u.value??u.key;d.comment=d.comment?`${f.comment}
|
|
83
|
+
${d.comment}`:f.comment}f=u}c.items[p]=t.isPair(f)?f:new n.Pair(f)}}else a("Expected a sequence for this tag");return c}function o(c,a,p){let{replacer:f}=p,u=new r.YAMLSeq(c);u.tag="tag:yaml.org,2002:pairs";let d=0;if(a&&Symbol.iterator in Object(a))for(let m of a){typeof f=="function"&&(m=f.call(a,String(d++),m));let h,g;if(Array.isArray(m))if(m.length===2)h=m[0],g=m[1];else throw new TypeError(`Expected [key, value] tuple: ${m}`);else if(m&&m instanceof Object){let y=Object.keys(m);if(y.length===1)h=y[0],g=m[h];else throw new TypeError(`Expected tuple with one key, not ${y.length} keys`)}else h=m;u.items.push(n.createPair(h,g,p))}return u}var l={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:i,createNode:o};e.createPairs=o,e.pairs=l,e.resolvePairs=i}}),ql=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/omap.js"(e){"use strict";var t=B(),n=At(),s=Ot(),r=It(),i=_i(),o=class Bl extends r.YAMLSeq{constructor(){super(),this.add=s.YAMLMap.prototype.add.bind(this),this.delete=s.YAMLMap.prototype.delete.bind(this),this.get=s.YAMLMap.prototype.get.bind(this),this.has=s.YAMLMap.prototype.has.bind(this),this.set=s.YAMLMap.prototype.set.bind(this),this.tag=Bl.tag}toJSON(a,p){if(!p)return super.toJSON(a);let f=new Map;p?.onCreate&&p.onCreate(f);for(let u of this.items){let d,m;if(t.isPair(u)?(d=n.toJS(u.key,"",p),m=n.toJS(u.value,d,p)):d=n.toJS(u,"",p),f.has(d))throw new Error("Ordered maps must not include duplicate keys");f.set(d,m)}return f}static from(a,p,f){let u=i.createPairs(a,p,f),d=new this;return d.items=u.items,d}};o.tag="tag:yaml.org,2002:omap";var l={collection:"seq",identify:c=>c instanceof Map,nodeClass:o,default:!1,tag:"tag:yaml.org,2002:omap",resolve(c,a){let p=i.resolvePairs(c,a),f=[];for(let{key:u}of p.items)t.isScalar(u)&&(f.includes(u.value)?a(`Ordered maps must not include duplicate keys: ${u.value}`):f.push(u.value));return Object.assign(new o,p)},createNode:(c,a,p)=>o.from(c,a,p)};e.YAMLOMap=o,e.omap=l}}),wh=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/bool.js"(e){"use strict";var t=se();function n({value:i,source:o},l){return o&&(i?s:r).test.test(o)?o:i?l.options.trueStr:l.options.falseStr}var s={identify:i=>i===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new t.Scalar(!0),stringify:n},r={identify:i=>i===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new t.Scalar(!1),stringify:n};e.falseTag=r,e.trueTag=s}}),bh=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/float.js"(e){"use strict";var t=se(),n=_n(),s={identify:o=>typeof o=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:o=>o.slice(-3).toLowerCase()==="nan"?NaN:o[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:n.stringifyNumber},r={identify:o=>typeof o=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:o=>parseFloat(o.replace(/_/g,"")),stringify(o){let l=Number(o.value);return isFinite(l)?l.toExponential():n.stringifyNumber(o)}},i={identify:o=>typeof o=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(o){let l=new t.Scalar(parseFloat(o.replace(/_/g,""))),c=o.indexOf(".");if(c!==-1){let a=o.substring(c+1).replace(/_/g,"");a[a.length-1]==="0"&&(l.minFractionDigits=a.length)}return l},stringify:n.stringifyNumber};e.float=i,e.floatExp=r,e.floatNaN=s}}),vh=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/int.js"(e){"use strict";var t=_n(),n=a=>typeof a=="bigint"||Number.isInteger(a);function s(a,p,f,{intAsBigInt:u}){let d=a[0];if((d==="-"||d==="+")&&(p+=1),a=a.substring(p).replace(/_/g,""),u){switch(f){case 2:a=`0b${a}`;break;case 8:a=`0o${a}`;break;case 16:a=`0x${a}`;break}let h=BigInt(a);return d==="-"?BigInt(-1)*h:h}let m=parseInt(a,f);return d==="-"?-1*m:m}function r(a,p,f){let{value:u}=a;if(n(u)){let d=u.toString(p);return u<0?"-"+f+d.substr(1):f+d}return t.stringifyNumber(a)}var i={identify:n,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(a,p,f)=>s(a,2,2,f),stringify:a=>r(a,2,"0b")},o={identify:n,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(a,p,f)=>s(a,1,8,f),stringify:a=>r(a,8,"0")},l={identify:n,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(a,p,f)=>s(a,0,10,f),stringify:t.stringifyNumber},c={identify:n,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(a,p,f)=>s(a,2,16,f),stringify:a=>r(a,16,"0x")};e.int=l,e.intBin=i,e.intHex=c,e.intOct=o}}),Rl=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/set.js"(e){"use strict";var t=B(),n=Nt(),s=Ot(),r=class Kl extends s.YAMLMap{constructor(l){super(l),this.tag=Kl.tag}add(l){let c;t.isPair(l)?c=l:l&&typeof l=="object"&&"key"in l&&"value"in l&&l.value===null?c=new n.Pair(l.key,null):c=new n.Pair(l,null),s.findPair(this.items,c.key)||this.items.push(c)}get(l,c){let a=s.findPair(this.items,l);return!c&&t.isPair(a)?t.isScalar(a.key)?a.key.value:a.key:a}set(l,c){if(typeof c!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof c}`);let a=s.findPair(this.items,l);a&&!c?this.items.splice(this.items.indexOf(a),1):!a&&c&&this.items.push(new n.Pair(l))}toJSON(l,c){return super.toJSON(l,c,Set)}toString(l,c,a){if(!l)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},l,{allNullValues:!0}),c,a);throw new Error("Set items must all have null values")}static from(l,c,a){let{replacer:p}=a,f=new this(l);if(c&&Symbol.iterator in Object(c))for(let u of c)typeof p=="function"&&(u=p.call(c,u,u)),f.items.push(n.createPair(u,null,a));return f}};r.tag="tag:yaml.org,2002:set";var i={collection:"map",identify:o=>o instanceof Set,nodeClass:r,default:!1,tag:"tag:yaml.org,2002:set",createNode:(o,l,c)=>r.from(o,l,c),resolve(o,l){if(t.isMap(o)){if(o.hasAllNullValues(!0))return Object.assign(new r,o);l("Set items must all have null values")}else l("Expected a mapping for this tag");return o}};e.YAMLSet=r,e.set=i}}),Ul=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js"(e){"use strict";var t=_n();function n(l,c){let a=l[0],p=a==="-"||a==="+"?l.substring(1):l,f=d=>c?BigInt(d):Number(d),u=p.replace(/_/g,"").split(":").reduce((d,m)=>d*f(60)+f(m),f(0));return a==="-"?f(-1)*u:u}function s(l){let{value:c}=l,a=d=>d;if(typeof c=="bigint")a=d=>BigInt(d);else if(isNaN(c)||!isFinite(c))return t.stringifyNumber(l);let p="";c<0&&(p="-",c*=a(-1));let f=a(60),u=[c%f];return c<60?u.unshift(0):(c=(c-u[0])/f,u.unshift(c%f),c>=60&&(c=(c-u[0])/f,u.unshift(c))),p+u.map(d=>String(d).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var r={identify:l=>typeof l=="bigint"||Number.isInteger(l),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(l,c,{intAsBigInt:a})=>n(l,a),stringify:s},i={identify:l=>typeof l=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:l=>n(l,!1),stringify:s},o={identify:l=>l instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(l){let c=l.match(o.test);if(!c)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,a,p,f,u,d,m]=c.map(Number),h=c[7]?Number((c[7]+"00").substr(1,3)):0,g=Date.UTC(a,p-1,f,u||0,d||0,m||0,h),y=c[8];if(y&&y!=="Z"){let w=n(y,!1);Math.abs(w)<30&&(w*=60),g-=6e4*w}return new Date(g)},stringify:({value:l})=>l?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};e.floatTime=i,e.intTime=r,e.timestamp=o}}),Sh=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/schema.js"(e){"use strict";var t=Tn(),n=Fi(),s=Fn(),r=Hs(),i=Ml(),o=wh(),l=bh(),c=vh(),a=Ti(),p=ql(),f=_i(),u=Rl(),d=Ul(),m=[t.map,s.seq,r.string,n.nullTag,o.trueTag,o.falseTag,c.intBin,c.intOct,c.int,c.intHex,l.floatNaN,l.floatExp,l.float,i.binary,a.merge,p.omap,f.pairs,u.set,d.intTime,d.floatTime,d.timestamp];e.schema=m}}),kh=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/tags.js"(e){"use strict";var t=Tn(),n=Fi(),s=Fn(),r=Hs(),i=_l(),o=Pl(),l=$l(),c=gh(),a=yh(),p=Ml(),f=Ti(),u=ql(),d=_i(),m=Sh(),h=Rl(),g=Ul(),y=new Map([["core",c.schema],["failsafe",[t.map,s.seq,r.string]],["json",a.schema],["yaml11",m.schema],["yaml-1.1",m.schema]]),w={binary:p.binary,bool:i.boolTag,float:o.float,floatExp:o.floatExp,floatNaN:o.floatNaN,floatTime:g.floatTime,int:l.int,intHex:l.intHex,intOct:l.intOct,intTime:g.intTime,map:t.map,merge:f.merge,null:n.nullTag,omap:u.omap,pairs:d.pairs,seq:s.seq,set:h.set,timestamp:g.timestamp},v={"tag:yaml.org,2002:binary":p.binary,"tag:yaml.org,2002:merge":f.merge,"tag:yaml.org,2002:omap":u.omap,"tag:yaml.org,2002:pairs":d.pairs,"tag:yaml.org,2002:set":h.set,"tag:yaml.org,2002:timestamp":g.timestamp};function S(k,b,E){let C=y.get(b);if(C&&!k)return E&&!C.includes(f.merge)?C.concat(f.merge):C.slice();let A=C;if(!A)if(Array.isArray(k))A=[];else{let N=Array.from(y.keys()).filter(O=>O!=="yaml11").map(O=>JSON.stringify(O)).join(", ");throw new Error(`Unknown schema "${b}"; use one of ${N} or define customTags array`)}if(Array.isArray(k))for(let N of k)A=A.concat(N);else typeof k=="function"&&(A=k(A.slice()));return E&&(A=A.concat(f.merge)),A.reduce((N,O)=>{let I=typeof O=="string"?w[O]:O;if(!I){let L=JSON.stringify(O),G=Object.keys(w).map(_=>JSON.stringify(_)).join(", ");throw new Error(`Unknown custom tag ${L}; use one of ${G}`)}return N.includes(I)||N.push(I),N},[])}e.coreKnownTags=v,e.getTags=S}}),Jl=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/Schema.js"(e){"use strict";var t=B(),n=Tn(),s=Fn(),r=Hs(),i=kh(),o=(c,a)=>c.key<a.key?-1:c.key>a.key?1:0,l=class Yl{constructor({compat:a,customTags:p,merge:f,resolveKnownTags:u,schema:d,sortMapEntries:m,toStringDefaults:h}){this.compat=Array.isArray(a)?i.getTags(a,"compat"):a?i.getTags(null,a):null,this.name=typeof d=="string"&&d||"core",this.knownTags=u?i.coreKnownTags:{},this.tags=i.getTags(p,this.name,f),this.toStringOptions=h??null,Object.defineProperty(this,t.MAP,{value:n.map}),Object.defineProperty(this,t.SCALAR,{value:r.string}),Object.defineProperty(this,t.SEQ,{value:s.seq}),this.sortMapEntries=typeof m=="function"?m:m===!0?o:null}clone(){let a=Object.create(Yl.prototype,Object.getOwnPropertyDescriptors(this));return a.tags=this.tags.slice(),a}};e.Schema=l}}),Eh=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyDocument.js"(e){"use strict";var t=B(),n=Gs(),s=xs();function r(i,o){let l=[],c=o.directives===!0;if(o.directives!==!1&&i.directives){let d=i.directives.toString(i);d?(l.push(d),c=!0):i.directives.docStart&&(c=!0)}c&&l.push("---");let a=n.createStringifyContext(i,o),{commentString:p}=a.options;if(i.commentBefore){l.length!==1&&l.unshift("");let d=p(i.commentBefore);l.unshift(s.indentComment(d,""))}let f=!1,u=null;if(i.contents){if(t.isNode(i.contents)){if(i.contents.spaceBefore&&c&&l.push(""),i.contents.commentBefore){let h=p(i.contents.commentBefore);l.push(s.indentComment(h,""))}a.forceBlockIndent=!!i.comment,u=i.contents.comment}let d=u?void 0:()=>f=!0,m=n.stringify(i.contents,a,()=>u=null,d);u&&(m+=s.lineComment(m,"",p(u))),(m[0]==="|"||m[0]===">")&&l[l.length-1]==="---"?l[l.length-1]=`--- ${m}`:l.push(m)}else l.push(n.stringify(i.contents,a));if(i.directives?.docEnd)if(i.comment){let d=p(i.comment);d.includes(`
|
|
84
|
+
`)?(l.push("..."),l.push(s.indentComment(d,""))):l.push(`... ${d}`)}else l.push("...");else{let d=i.comment;d&&f&&(d=d.replace(/^\n+/,"")),d&&((!f||u)&&l[l.length-1]!==""&&l.push(""),l.push(s.indentComment(p(d),"")))}return l.join(`
|
|
58
85
|
`)+`
|
|
59
|
-
`}
|
|
60
|
-
`),
|
|
86
|
+
`}e.stringifyDocument=r}}),zs=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/doc/Document.js"(e){"use strict";var t=Ys(),n=Li(),s=B(),r=Nt(),i=At(),o=Jl(),l=Eh(),c=ji(),a=jl(),p=Vs(),f=Il(),u=class Vl{constructor(h,g,y){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,s.NODE_TYPE,{value:s.DOC});let w=null;typeof g=="function"||Array.isArray(g)?w=g:y===void 0&&g&&(y=g,g=void 0);let v=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},y);this.options=v;let{version:S}=v;y?._directives?(this.directives=y._directives.atDocument(),this.directives.yaml.explicit&&(S=this.directives.yaml.version)):this.directives=new f.Directives({version:S}),this.setSchema(S,y),this.contents=h===void 0?null:this.createNode(h,w,y)}clone(){let h=Object.create(Vl.prototype,{[s.NODE_TYPE]:{value:s.DOC}});return h.commentBefore=this.commentBefore,h.comment=this.comment,h.errors=this.errors.slice(),h.warnings=this.warnings.slice(),h.options=Object.assign({},this.options),this.directives&&(h.directives=this.directives.clone()),h.schema=this.schema.clone(),h.contents=s.isNode(this.contents)?this.contents.clone(h.schema):this.contents,this.range&&(h.range=this.range.slice()),h}add(h){d(this.contents)&&this.contents.add(h)}addIn(h,g){d(this.contents)&&this.contents.addIn(h,g)}createAlias(h,g){if(!h.anchor){let y=c.anchorNames(this);h.anchor=!g||y.has(g)?c.findNewAnchor(g||"a",y):g}return new t.Alias(h.anchor)}createNode(h,g,y){let w;if(typeof g=="function")h=g.call({"":h},"",h),w=g;else if(Array.isArray(g)){let G=ne=>typeof ne=="number"||ne instanceof String||ne instanceof Number,_=g.filter(G).map(String);_.length>0&&(g=g.concat(_)),w=g}else y===void 0&&g&&(y=g,g=void 0);let{aliasDuplicateObjects:v,anchorPrefix:S,flow:k,keepUndefined:b,onTagObj:E,tag:C}=y??{},{onAnchor:A,setAnchors:N,sourceObjects:O}=c.createNodeAnchors(this,S||"a"),I={aliasDuplicateObjects:v??!0,keepUndefined:b??!1,onAnchor:A,onTagObj:E,replacer:w,schema:this.schema,sourceObjects:O},L=p.createNode(h,C,I);return k&&s.isCollection(L)&&(L.flow=!0),N(),L}createPair(h,g,y={}){let w=this.createNode(h,null,y),v=this.createNode(g,null,y);return new r.Pair(w,v)}delete(h){return d(this.contents)?this.contents.delete(h):!1}deleteIn(h){return n.isEmptyPath(h)?this.contents==null?!1:(this.contents=null,!0):d(this.contents)?this.contents.deleteIn(h):!1}get(h,g){return s.isCollection(this.contents)?this.contents.get(h,g):void 0}getIn(h,g){return n.isEmptyPath(h)?!g&&s.isScalar(this.contents)?this.contents.value:this.contents:s.isCollection(this.contents)?this.contents.getIn(h,g):void 0}has(h){return s.isCollection(this.contents)?this.contents.has(h):!1}hasIn(h){return n.isEmptyPath(h)?this.contents!==void 0:s.isCollection(this.contents)?this.contents.hasIn(h):!1}set(h,g){this.contents==null?this.contents=n.collectionFromPath(this.schema,[h],g):d(this.contents)&&this.contents.set(h,g)}setIn(h,g){n.isEmptyPath(h)?this.contents=g:this.contents==null?this.contents=n.collectionFromPath(this.schema,Array.from(h),g):d(this.contents)&&this.contents.setIn(h,g)}setSchema(h,g={}){typeof h=="number"&&(h=String(h));let y;switch(h){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new f.Directives({version:"1.1"}),y={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=h:this.directives=new f.Directives({version:h}),y={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,y=null;break;default:{let w=JSON.stringify(h);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${w}`)}}if(g.schema instanceof Object)this.schema=g.schema;else if(y)this.schema=new o.Schema(Object.assign(y,g));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:h,jsonArg:g,mapAsMap:y,maxAliasCount:w,onAnchor:v,reviver:S}={}){let k={anchors:new Map,doc:this,keep:!h,mapAsMap:y===!0,mapKeyWarned:!1,maxAliasCount:typeof w=="number"?w:100},b=i.toJS(this.contents,g??"",k);if(typeof v=="function")for(let{count:E,res:C}of k.anchors.values())v(C,E);return typeof S=="function"?a.applyReviver(S,{"":b},"",b):b}toJSON(h,g){return this.toJS({json:!0,jsonArg:h,mapAsMap:!1,onAnchor:g})}toString(h={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in h&&(!Number.isInteger(h.indent)||Number(h.indent)<=0)){let g=JSON.stringify(h.indent);throw new Error(`"indent" option must be a positive integer, not ${g}`)}return l.stringifyDocument(this,h)}};function d(m){if(s.isCollection(m))return!0;throw new Error("Expected a YAML collection as document contents")}e.Document=u}}),Qs=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/errors.js"(e){"use strict";var t=class extends Error{constructor(i,o,l,c){super(),this.name=i,this.code=l,this.message=c,this.pos=o}},n=class extends t{constructor(i,o,l){super("YAMLParseError",i,o,l)}},s=class extends t{constructor(i,o,l){super("YAMLWarning",i,o,l)}},r=(i,o)=>l=>{if(l.pos[0]===-1)return;l.linePos=l.pos.map(u=>o.linePos(u));let{line:c,col:a}=l.linePos[0];l.message+=` at line ${c}, column ${a}`;let p=a-1,f=i.substring(o.lineStarts[c-1],o.lineStarts[c]).replace(/[\n\r]+$/,"");if(p>=60&&f.length>80){let u=Math.min(p-39,f.length-79);f="…"+f.substring(u),p-=u-1}if(f.length>80&&(f=f.substring(0,79)+"…"),c>1&&/^ *$/.test(f.substring(0,p))){let u=i.substring(o.lineStarts[c-2],o.lineStarts[c-1]);u.length>80&&(u=u.substring(0,79)+`…
|
|
87
|
+
`),f=u+f}if(/[^ ]/.test(f)){let u=1,d=l.linePos[1];d?.line===c&&d.col>a&&(u=Math.max(1,Math.min(d.col-a,80-p)));let m=" ".repeat(p)+"^".repeat(u);l.message+=`:
|
|
88
|
+
|
|
89
|
+
${f}
|
|
90
|
+
${m}
|
|
91
|
+
`}};e.YAMLError=t,e.YAMLParseError=n,e.YAMLWarning=s,e.prettifyError=r}}),Xs=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-props.js"(e){"use strict";function t(n,{flow:s,indicator:r,next:i,offset:o,onError:l,parentIndent:c,startOnNewline:a}){let p=!1,f=a,u=a,d="",m="",h=!1,g=!1,y=null,w=null,v=null,S=null,k=null,b=null,E=null;for(let N of n)switch(g&&(N.type!=="space"&&N.type!=="newline"&&N.type!=="comma"&&l(N.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g=!1),y&&(f&&N.type!=="comment"&&N.type!=="newline"&&l(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),y=null),N.type){case"space":!s&&(r!=="doc-start"||i?.type!=="flow-collection")&&N.source.includes(" ")&&(y=N),u=!0;break;case"comment":{u||l(N,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let O=N.source.substring(1)||" ";d?d+=m+O:d=O,m="",f=!1;break}case"newline":f?d?d+=N.source:(!b||r!=="seq-item-ind")&&(p=!0):m+=N.source,f=!0,h=!0,(w||v)&&(S=N),u=!0;break;case"anchor":w&&l(N,"MULTIPLE_ANCHORS","A node can have at most one anchor"),N.source.endsWith(":")&&l(N.offset+N.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),w=N,E??(E=N.offset),f=!1,u=!1,g=!0;break;case"tag":{v&&l(N,"MULTIPLE_TAGS","A node can have at most one tag"),v=N,E??(E=N.offset),f=!1,u=!1,g=!0;break}case r:(w||v)&&l(N,"BAD_PROP_ORDER",`Anchors and tags must be after the ${N.source} indicator`),b&&l(N,"UNEXPECTED_TOKEN",`Unexpected ${N.source} in ${s??"collection"}`),b=N,f=r==="seq-item-ind"||r==="explicit-key-ind",u=!1;break;case"comma":if(s){k&&l(N,"UNEXPECTED_TOKEN",`Unexpected , in ${s}`),k=N,f=!1,u=!1;break}default:l(N,"UNEXPECTED_TOKEN",`Unexpected ${N.type} token`),f=!1,u=!1}let C=n[n.length-1],A=C?C.offset+C.source.length:o;return g&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&l(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y&&(f&&y.indent<=c||i?.type==="block-map"||i?.type==="block-seq")&&l(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:b,spaceBefore:p,comment:d,hasNewline:h,anchor:w,tag:v,newlineAfterProp:S,end:A,start:E??A}}e.resolveProps=t}}),Pi=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/util-contains-newline.js"(e){"use strict";function t(n){if(!n)return null;switch(n.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(n.source.includes(`
|
|
92
|
+
`))return!0;if(n.end){for(let s of n.end)if(s.type==="newline")return!0}return!1;case"flow-collection":for(let s of n.items){for(let r of s.start)if(r.type==="newline")return!0;if(s.sep){for(let r of s.sep)if(r.type==="newline")return!0}if(t(s.key)||t(s.value))return!0}return!1;default:return!0}}e.containsNewline=t}}),xl=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/util-flow-indent-check.js"(e){"use strict";var t=Pi();function n(s,r,i){if(r?.type==="flow-collection"){let o=r.end[0];o.indent===s&&(o.source==="]"||o.source==="}")&&t.containsNewline(r)&&i(o,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}e.flowIndentCheck=n}}),Wl=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/util-map-includes.js"(e){"use strict";var t=B();function n(s,r,i){let{uniqueKeys:o}=s.options;if(o===!1)return!1;let l=typeof o=="function"?o:(c,a)=>c===a||t.isScalar(c)&&t.isScalar(a)&&c.value===a.value;return r.some(c=>l(c.key,i))}e.mapIncludes=n}}),Ch=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-block-map.js"(e){"use strict";var t=Nt(),n=Ot(),s=Xs(),r=Pi(),i=xl(),o=Wl(),l="All mapping items must start at the same column";function c({composeNode:a,composeEmptyNode:p},f,u,d,m){let h=m?.nodeClass??n.YAMLMap,g=new h(f.schema);f.atRoot&&(f.atRoot=!1);let y=u.offset,w=null;for(let v of u.items){let{start:S,key:k,sep:b,value:E}=v,C=s.resolveProps(S,{indicator:"explicit-key-ind",next:k??b?.[0],offset:y,onError:d,parentIndent:u.indent,startOnNewline:!0}),A=!C.found;if(A){if(k&&(k.type==="block-seq"?d(y,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in k&&k.indent!==u.indent&&d(y,"BAD_INDENT",l)),!C.anchor&&!C.tag&&!b){w=C.end,C.comment&&(g.comment?g.comment+=`
|
|
93
|
+
`+C.comment:g.comment=C.comment);continue}(C.newlineAfterProp||r.containsNewline(k))&&d(k??S[S.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else C.found?.indent!==u.indent&&d(y,"BAD_INDENT",l);f.atKey=!0;let N=C.end,O=k?a(f,k,C,d):p(f,N,S,null,C,d);f.schema.compat&&i.flowIndentCheck(u.indent,k,d),f.atKey=!1,o.mapIncludes(f,g.items,O)&&d(N,"DUPLICATE_KEY","Map keys must be unique");let I=s.resolveProps(b??[],{indicator:"map-value-ind",next:E,offset:O.range[2],onError:d,parentIndent:u.indent,startOnNewline:!k||k.type==="block-scalar"});if(y=I.end,I.found){A&&(E?.type==="block-map"&&!I.hasNewline&&d(y,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),f.options.strict&&C.start<I.found.offset-1024&&d(O.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let L=E?a(f,E,I,d):p(f,y,b,null,I,d);f.schema.compat&&i.flowIndentCheck(u.indent,E,d),y=L.range[2];let G=new t.Pair(O,L);f.options.keepSourceTokens&&(G.srcToken=v),g.items.push(G)}else{A&&d(O.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),I.comment&&(O.comment?O.comment+=`
|
|
94
|
+
`+I.comment:O.comment=I.comment);let L=new t.Pair(O);f.options.keepSourceTokens&&(L.srcToken=v),g.items.push(L)}}return w&&w<y&&d(w,"IMPOSSIBLE","Map comment with trailing content"),g.range=[u.offset,y,w??y],g}e.resolveBlockMap=c}}),Ah=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-block-seq.js"(e){"use strict";var t=It(),n=Xs(),s=xl();function r({composeNode:i,composeEmptyNode:o},l,c,a,p){let f=p?.nodeClass??t.YAMLSeq,u=new f(l.schema);l.atRoot&&(l.atRoot=!1),l.atKey&&(l.atKey=!1);let d=c.offset,m=null;for(let{start:h,value:g}of c.items){let y=n.resolveProps(h,{indicator:"seq-item-ind",next:g,offset:d,onError:a,parentIndent:c.indent,startOnNewline:!0});if(!y.found)if(y.anchor||y.tag||g)g?.type==="block-seq"?a(y.end,"BAD_INDENT","All sequence items must start at the same column"):a(d,"MISSING_CHAR","Sequence item without - indicator");else{m=y.end,y.comment&&(u.comment=y.comment);continue}let w=g?i(l,g,y,a):o(l,y.end,h,null,y,a);l.schema.compat&&s.flowIndentCheck(c.indent,g,a),d=w.range[2],u.items.push(w)}return u.range=[c.offset,d,m??d],u}e.resolveBlockSeq=r}}),Pn=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-end.js"(e){"use strict";function t(n,s,r,i){let o="";if(n){let l=!1,c="";for(let a of n){let{source:p,type:f}=a;switch(f){case"space":l=!0;break;case"comment":{r&&!l&&i(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=p.substring(1)||" ";o?o+=c+u:o=u,c="";break}case"newline":o&&(c+=p),l=!0;break;default:i(a,"UNEXPECTED_TOKEN",`Unexpected ${f} at node end`)}s+=p.length}}return{comment:o,offset:s}}e.resolveEnd=t}}),Nh=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-flow-collection.js"(e){"use strict";var t=B(),n=Nt(),s=Ot(),r=It(),i=Pn(),o=Xs(),l=Pi(),c=Wl(),a="Block collections are not allowed within flow collections",p=u=>u&&(u.type==="block-map"||u.type==="block-seq");function f({composeNode:u,composeEmptyNode:d},m,h,g,y){let w=h.start.source==="{",v=w?"flow map":"flow sequence",S=y?.nodeClass??(w?s.YAMLMap:r.YAMLSeq),k=new S(m.schema);k.flow=!0;let b=m.atRoot;b&&(m.atRoot=!1),m.atKey&&(m.atKey=!1);let E=h.offset+h.start.source.length;for(let I=0;I<h.items.length;++I){let L=h.items[I],{start:G,key:_,sep:ne,value:Q}=L,T=o.resolveProps(G,{flow:v,indicator:"explicit-key-ind",next:_??ne?.[0],offset:E,onError:g,parentIndent:h.indent,startOnNewline:!1});if(!T.found){if(!T.anchor&&!T.tag&&!ne&&!Q){I===0&&T.comma?g(T.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${v}`):I<h.items.length-1&&g(T.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${v}`),T.comment&&(k.comment?k.comment+=`
|
|
95
|
+
`+T.comment:k.comment=T.comment),E=T.end;continue}!w&&m.options.strict&&l.containsNewline(_)&&g(_,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(I===0)T.comma&&g(T.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${v}`);else if(T.comma||g(T.start,"MISSING_CHAR",`Missing , between ${v} items`),T.comment){let ce="";e:for(let z of G)switch(z.type){case"comma":case"space":break;case"comment":ce=z.source.substring(1);break e;default:break e}if(ce){let z=k.items[k.items.length-1];t.isPair(z)&&(z=z.value??z.key),z.comment?z.comment+=`
|
|
96
|
+
`+ce:z.comment=ce,T.comment=T.comment.substring(ce.length+1)}}if(!w&&!ne&&!T.found){let ce=Q?u(m,Q,T,g):d(m,T.end,ne,null,T,g);k.items.push(ce),E=ce.range[2],p(Q)&&g(ce.range,"BLOCK_IN_FLOW",a)}else{m.atKey=!0;let ce=T.end,z=_?u(m,_,T,g):d(m,ce,G,null,T,g);p(_)&&g(z.range,"BLOCK_IN_FLOW",a),m.atKey=!1;let ue=o.resolveProps(ne??[],{flow:v,indicator:"map-value-ind",next:Q,offset:z.range[2],onError:g,parentIndent:h.indent,startOnNewline:!1});if(ue.found){if(!w&&!T.found&&m.options.strict){if(ne)for(let De of ne){if(De===ue.found)break;if(De.type==="newline"){g(De,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}T.start<ue.found.offset-1024&&g(ue.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else Q&&("source"in Q&&Q.source?.[0]===":"?g(Q,"MISSING_CHAR",`Missing space after : in ${v}`):g(ue.start,"MISSING_CHAR",`Missing , or : between ${v} items`));let Vt=Q?u(m,Q,ue,g):ue.found?d(m,ue.end,ne,null,ue,g):null;Vt?p(Q)&&g(Vt.range,"BLOCK_IN_FLOW",a):ue.comment&&(z.comment?z.comment+=`
|
|
97
|
+
`+ue.comment:z.comment=ue.comment);let bi=new n.Pair(z,Vt);if(m.options.keepSourceTokens&&(bi.srcToken=L),w){let De=k;c.mapIncludes(m,De.items,z)&&g(ce,"DUPLICATE_KEY","Map keys must be unique"),De.items.push(bi)}else{let De=new s.YAMLMap(m.schema);De.flow=!0,De.items.push(bi);let al=(Vt??z).range;De.range=[z.range[0],al[1],al[2]],k.items.push(De)}E=Vt?Vt.range[2]:ue.end}}let C=w?"}":"]",[A,...N]=h.end,O=E;if(A?.source===C)O=A.offset+A.source.length;else{let I=v[0].toUpperCase()+v.substring(1),L=b?`${I} must end with a ${C}`:`${I} in block collection must be sufficiently indented and end with a ${C}`;g(E,b?"MISSING_CHAR":"BAD_INDENT",L),A&&A.source.length!==1&&N.unshift(A)}if(N.length>0){let I=i.resolveEnd(N,O,m.options.strict,g);I.comment&&(k.comment?k.comment+=`
|
|
98
|
+
`+I.comment:k.comment=I.comment),k.range=[h.offset,O,I.offset]}else k.range=[h.offset,O,O];return k}e.resolveFlowCollection=f}}),Oh=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/compose-collection.js"(e){"use strict";var t=B(),n=se(),s=Ot(),r=It(),i=Ch(),o=Ah(),l=Nh();function c(p,f,u,d,m,h){let g=u.type==="block-map"?i.resolveBlockMap(p,f,u,d,h):u.type==="block-seq"?o.resolveBlockSeq(p,f,u,d,h):l.resolveFlowCollection(p,f,u,d,h),y=g.constructor;return m==="!"||m===y.tagName?(g.tag=y.tagName,g):(m&&(g.tag=m),g)}function a(p,f,u,d,m){let h=d.tag,g=h?f.directives.tagName(h.source,b=>m(h,"TAG_RESOLVE_FAILED",b)):null;if(u.type==="block-seq"){let{anchor:b,newlineAfterProp:E}=d,C=b&&h?b.offset>h.offset?b:h:b??h;C&&(!E||E.offset<C.offset)&&m(C,"MISSING_CHAR","Missing newline after block sequence props")}let y=u.type==="block-map"?"map":u.type==="block-seq"?"seq":u.start.source==="{"?"map":"seq";if(!h||!g||g==="!"||g===s.YAMLMap.tagName&&y==="map"||g===r.YAMLSeq.tagName&&y==="seq")return c(p,f,u,m,g);let w=f.schema.tags.find(b=>b.tag===g&&b.collection===y);if(!w){let b=f.schema.knownTags[g];if(b?.collection===y)f.schema.tags.push(Object.assign({},b,{default:!1})),w=b;else return b?m(h,"BAD_COLLECTION_TYPE",`${b.tag} used for ${y} collection, but expects ${b.collection??"scalar"}`,!0):m(h,"TAG_RESOLVE_FAILED",`Unresolved tag: ${g}`,!0),c(p,f,u,m,g)}let v=c(p,f,u,m,g,w),S=w.resolve?.(v,b=>m(h,"TAG_RESOLVE_FAILED",b),f.options)??v,k=t.isNode(S)?S:new n.Scalar(S);return k.range=v.range,k.tag=g,w?.format&&(k.format=w.format),k}e.composeCollection=a}}),Gl=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-block-scalar.js"(e){"use strict";var t=se();function n(i,o,l){let c=o.offset,a=s(o,i.options.strict,l);if(!a)return{value:"",type:null,comment:"",range:[c,c,c]};let p=a.mode===">"?t.Scalar.BLOCK_FOLDED:t.Scalar.BLOCK_LITERAL,f=o.source?r(o.source):[],u=f.length;for(let S=f.length-1;S>=0;--S){let k=f[S][1];if(k===""||k==="\r")u=S;else break}if(u===0){let S=a.chomp==="+"&&f.length>0?`
|
|
99
|
+
`.repeat(Math.max(1,f.length-1)):"",k=c+a.length;return o.source&&(k+=o.source.length),{value:S,type:p,comment:a.comment,range:[c,k,k]}}let d=o.indent+a.indent,m=o.offset+a.length,h=0;for(let S=0;S<u;++S){let[k,b]=f[S];if(b===""||b==="\r")a.indent===0&&k.length>d&&(d=k.length);else{k.length<d&&l(m+k.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),a.indent===0&&(d=k.length),h=S,d===0&&!i.atRoot&&l(m,"BAD_INDENT","Block scalar values in collections must be indented");break}m+=k.length+b.length+1}for(let S=f.length-1;S>=u;--S)f[S][0].length>d&&(u=S+1);let g="",y="",w=!1;for(let S=0;S<h;++S)g+=f[S][0].slice(d)+`
|
|
100
|
+
`;for(let S=h;S<u;++S){let[k,b]=f[S];m+=k.length+b.length+1;let E=b[b.length-1]==="\r";if(E&&(b=b.slice(0,-1)),b&&k.length<d){let A=`Block scalar lines must not be less indented than their ${a.indent?"explicit indentation indicator":"first line"}`;l(m-b.length-(E?2:1),"BAD_INDENT",A),k=""}p===t.Scalar.BLOCK_LITERAL?(g+=y+k.slice(d)+b,y=`
|
|
101
|
+
`):k.length>d||b[0]===" "?(y===" "?y=`
|
|
102
|
+
`:!w&&y===`
|
|
103
|
+
`&&(y=`
|
|
104
|
+
|
|
105
|
+
`),g+=y+k.slice(d)+b,y=`
|
|
106
|
+
`,w=!0):b===""?y===`
|
|
107
|
+
`?g+=`
|
|
108
|
+
`:y=`
|
|
109
|
+
`:(g+=y+b,y=" ",w=!1)}switch(a.chomp){case"-":break;case"+":for(let S=u;S<f.length;++S)g+=`
|
|
110
|
+
`+f[S][0].slice(d);g[g.length-1]!==`
|
|
111
|
+
`&&(g+=`
|
|
112
|
+
`);break;default:g+=`
|
|
113
|
+
`}let v=c+a.length+o.source.length;return{value:g,type:p,comment:a.comment,range:[c,v,v]}}function s({offset:i,props:o},l,c){if(o[0].type!=="block-scalar-header")return c(o[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:a}=o[0],p=a[0],f=0,u="",d=-1;for(let y=1;y<a.length;++y){let w=a[y];if(!u&&(w==="-"||w==="+"))u=w;else{let v=Number(w);!f&&v?f=v:d===-1&&(d=i+y)}}d!==-1&&c(d,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${a}`);let m=!1,h="",g=a.length;for(let y=1;y<o.length;++y){let w=o[y];switch(w.type){case"space":m=!0;case"newline":g+=w.source.length;break;case"comment":l&&!m&&c(w,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),g+=w.source.length,h=w.source.substring(1);break;case"error":c(w,"UNEXPECTED_TOKEN",w.message),g+=w.source.length;break;default:{let v=`Unexpected token in block scalar header: ${w.type}`;c(w,"UNEXPECTED_TOKEN",v);let S=w.source;S&&typeof S=="string"&&(g+=S.length)}}}return{mode:p,indent:f,chomp:u,comment:h,length:g}}function r(i){let o=i.split(/\n( *)/),l=o[0],c=l.match(/^( *)/),p=[c?.[1]?[c[1],l.slice(c[1].length)]:["",l]];for(let f=1;f<o.length;f+=2)p.push([o[f],o[f+1]]);return p}e.resolveBlockScalar=n}}),Hl=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-flow-scalar.js"(e){"use strict";var t=se(),n=Pn();function s(f,u,d){let{offset:m,type:h,source:g,end:y}=f,w,v,S=(E,C,A)=>d(m+E,C,A);switch(h){case"scalar":w=t.Scalar.PLAIN,v=r(g,S);break;case"single-quoted-scalar":w=t.Scalar.QUOTE_SINGLE,v=i(g,S);break;case"double-quoted-scalar":w=t.Scalar.QUOTE_DOUBLE,v=l(g,S);break;default:return d(f,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${h}`),{value:"",type:null,comment:"",range:[m,m+g.length,m+g.length]}}let k=m+g.length,b=n.resolveEnd(y,k,u,d);return{value:v,type:w,comment:b.comment,range:[m,k,b.offset]}}function r(f,u){let d="";switch(f[0]){case" ":d="a tab character";break;case",":d="flow indicator character ,";break;case"%":d="directive indicator character %";break;case"|":case">":{d=`block scalar indicator ${f[0]}`;break}case"@":case"`":{d=`reserved character ${f[0]}`;break}}return d&&u(0,"BAD_SCALAR_START",`Plain value cannot start with ${d}`),o(f)}function i(f,u){return(f[f.length-1]!=="'"||f.length===1)&&u(f.length,"MISSING_CHAR","Missing closing 'quote"),o(f.slice(1,-1)).replace(/''/g,"'")}function o(f){let u,d;try{u=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
114
|
+
`,"sy"),d=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
115
|
+
`,"sy")}catch{u=/(.*?)[ \t]*\r?\n/sy,d=/[ \t]*(.*?)[ \t]*\r?\n/sy}let m=u.exec(f);if(!m)return f;let h=m[1],g=" ",y=u.lastIndex;for(d.lastIndex=y;m=d.exec(f);)m[1]===""?g===`
|
|
116
|
+
`?h+=g:g=`
|
|
117
|
+
`:(h+=g+m[1],g=" "),y=d.lastIndex;let w=/[ \t]*(.*)/sy;return w.lastIndex=y,m=w.exec(f),h+g+(m?.[1]??"")}function l(f,u){let d="";for(let m=1;m<f.length-1;++m){let h=f[m];if(!(h==="\r"&&f[m+1]===`
|
|
118
|
+
`))if(h===`
|
|
119
|
+
`){let{fold:g,offset:y}=c(f,m);d+=g,m=y}else if(h==="\\"){let g=f[++m],y=a[g];if(y)d+=y;else if(g===`
|
|
120
|
+
`)for(g=f[m+1];g===" "||g===" ";)g=f[++m+1];else if(g==="\r"&&f[m+1]===`
|
|
121
|
+
`)for(g=f[++m+1];g===" "||g===" ";)g=f[++m+1];else if(g==="x"||g==="u"||g==="U"){let w=g==="x"?2:g==="u"?4:8;d+=p(f,m+1,w,u),m+=w}else{let w=f.substr(m-1,2);u(m-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${w}`),d+=w}}else if(h===" "||h===" "){let g=m,y=f[m+1];for(;y===" "||y===" ";)y=f[++m+1];y!==`
|
|
122
|
+
`&&!(y==="\r"&&f[m+2]===`
|
|
123
|
+
`)&&(d+=m>g?f.slice(g,m+1):h)}else d+=h}return(f[f.length-1]!=='"'||f.length===1)&&u(f.length,"MISSING_CHAR",'Missing closing "quote'),d}function c(f,u){let d="",m=f[u+1];for(;(m===" "||m===" "||m===`
|
|
124
|
+
`||m==="\r")&&!(m==="\r"&&f[u+2]!==`
|
|
125
|
+
`);)m===`
|
|
126
|
+
`&&(d+=`
|
|
127
|
+
`),u+=1,m=f[u+1];return d||(d=" "),{fold:d,offset:u}}var a={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
128
|
+
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function p(f,u,d,m){let h=f.substr(u,d),y=h.length===d&&/^[0-9a-fA-F]+$/.test(h)?parseInt(h,16):NaN;try{return String.fromCodePoint(y)}catch{let w=f.substr(u-2,d+2);return m(u-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${w}`),w}}e.resolveFlowScalar=s}}),Ih=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/compose-scalar.js"(e){"use strict";var t=B(),n=se(),s=Gl(),r=Hl();function i(c,a,p,f){let{value:u,type:d,comment:m,range:h}=a.type==="block-scalar"?s.resolveBlockScalar(c,a,f):r.resolveFlowScalar(a,c.options.strict,f),g=p?c.directives.tagName(p.source,v=>f(p,"TAG_RESOLVE_FAILED",v)):null,y;c.options.stringKeys&&c.atKey?y=c.schema[t.SCALAR]:g?y=o(c.schema,u,g,p,f):a.type==="scalar"?y=l(c,u,a,f):y=c.schema[t.SCALAR];let w;try{let v=y.resolve(u,S=>f(p??a,"TAG_RESOLVE_FAILED",S),c.options);w=t.isScalar(v)?v:new n.Scalar(v)}catch(v){let S=v instanceof Error?v.message:String(v);f(p??a,"TAG_RESOLVE_FAILED",S),w=new n.Scalar(u)}return w.range=h,w.source=u,d&&(w.type=d),g&&(w.tag=g),y.format&&(w.format=y.format),m&&(w.comment=m),w}function o(c,a,p,f,u){if(p==="!")return c[t.SCALAR];let d=[];for(let h of c.tags)if(!h.collection&&h.tag===p)if(h.default&&h.test)d.push(h);else return h;for(let h of d)if(h.test?.test(a))return h;let m=c.knownTags[p];return m&&!m.collection?(c.tags.push(Object.assign({},m,{default:!1,test:void 0})),m):(u(f,"TAG_RESOLVE_FAILED",`Unresolved tag: ${p}`,p!=="tag:yaml.org,2002:str"),c[t.SCALAR])}function l({atKey:c,directives:a,schema:p},f,u,d){let m=p.tags.find(h=>(h.default===!0||c&&h.default==="key")&&h.test?.test(f))||p[t.SCALAR];if(p.compat){let h=p.compat.find(g=>g.default&&g.test?.test(f))??p[t.SCALAR];if(m.tag!==h.tag){let g=a.tagString(m.tag),y=a.tagString(h.tag),w=`Value may be parsed as either ${g} or ${y}`;d(u,"TAG_RESOLVE_FAILED",w,!0)}}return m}e.composeScalar=i}}),jh=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/util-empty-scalar-position.js"(e){"use strict";function t(n,s,r){if(s){r??(r=s.length);for(let i=r-1;i>=0;--i){let o=s[i];switch(o.type){case"space":case"comment":case"newline":n-=o.source.length;continue}for(o=s[++i];o?.type==="space";)n+=o.source.length,o=s[++i];break}}return n}e.emptyScalarPosition=t}}),Dh=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/compose-node.js"(e){"use strict";var t=Ys(),n=B(),s=Oh(),r=Ih(),i=Pn(),o=jh(),l={composeNode:c,composeEmptyNode:a};function c(f,u,d,m){let h=f.atKey,{spaceBefore:g,comment:y,anchor:w,tag:v}=d,S,k=!0;switch(u.type){case"alias":S=p(f,u,m),(w||v)&&m(u,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":S=r.composeScalar(f,u,v,m),w&&(S.anchor=w.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{S=s.composeCollection(l,f,u,d,m),w&&(S.anchor=w.source.substring(1))}catch(b){let E=b instanceof Error?b.message:String(b);m(u,"RESOURCE_EXHAUSTION",E)}break;default:{let b=u.type==="error"?u.message:`Unsupported token (type: ${u.type})`;m(u,"UNEXPECTED_TOKEN",b),k=!1}}return S??(S=a(f,u.offset,void 0,null,d,m)),w&&S.anchor===""&&m(w,"BAD_ALIAS","Anchor cannot be an empty string"),h&&f.options.stringKeys&&(!n.isScalar(S)||typeof S.value!="string"||S.tag&&S.tag!=="tag:yaml.org,2002:str")&&m(v??u,"NON_STRING_KEY","With stringKeys, all keys must be strings"),g&&(S.spaceBefore=!0),y&&(u.type==="scalar"&&u.source===""?S.comment=y:S.commentBefore=y),f.options.keepSourceTokens&&k&&(S.srcToken=u),S}function a(f,u,d,m,{spaceBefore:h,comment:g,anchor:y,tag:w,end:v},S){let k={type:"scalar",offset:o.emptyScalarPosition(u,d,m),indent:-1,source:""},b=r.composeScalar(f,k,w,S);return y&&(b.anchor=y.source.substring(1),b.anchor===""&&S(y,"BAD_ALIAS","Anchor cannot be an empty string")),h&&(b.spaceBefore=!0),g&&(b.comment=g,b.range[2]=v),b}function p({options:f},{offset:u,source:d,end:m},h){let g=new t.Alias(d.substring(1));g.source===""&&h(u,"BAD_ALIAS","Alias cannot be an empty string"),g.source.endsWith(":")&&h(u+d.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let y=u+d.length,w=i.resolveEnd(m,y,f.strict,h);return g.range=[u,y,w.offset],w.comment&&(g.comment=w.comment),g}e.composeEmptyNode=a,e.composeNode=c}}),Lh=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/compose-doc.js"(e){"use strict";var t=zs(),n=Dh(),s=Pn(),r=Xs();function i(o,l,{offset:c,start:a,value:p,end:f},u){let d=Object.assign({_directives:l},o),m=new t.Document(void 0,d),h={atKey:!1,atRoot:!0,directives:m.directives,options:m.options,schema:m.schema},g=r.resolveProps(a,{indicator:"doc-start",next:p??f?.[0],offset:c,onError:u,parentIndent:0,startOnNewline:!0});g.found&&(m.directives.docStart=!0,p&&(p.type==="block-map"||p.type==="block-seq")&&!g.hasNewline&&u(g.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),m.contents=p?n.composeNode(h,p,g,u):n.composeEmptyNode(h,g.end,a,null,g,u);let y=m.contents.range[2],w=s.resolveEnd(f,y,!1,u);return w.comment&&(m.comment=w.comment),m.range=[c,y,w.offset],m}e.composeDoc=i}}),zl=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/composer.js"(e){"use strict";var t=Us("process"),n=Il(),s=zs(),r=Qs(),i=B(),o=Lh(),l=Pn();function c(f){if(typeof f=="number")return[f,f+1];if(Array.isArray(f))return f.length===2?f:[f[0],f[1]];let{offset:u,source:d}=f;return[u,u+(typeof d=="string"?d.length:1)]}function a(f){let u="",d=!1,m=!1;for(let h=0;h<f.length;++h){let g=f[h];switch(g[0]){case"#":u+=(u===""?"":m?`
|
|
129
|
+
|
|
130
|
+
`:`
|
|
131
|
+
`)+(g.substring(1)||" "),d=!0,m=!1;break;case"%":f[h+1]?.[0]!=="#"&&(h+=1),d=!1;break;default:d||(m=!0),d=!1}}return{comment:u,afterEmptyLine:m}}var p=class{constructor(f={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(u,d,m,h)=>{let g=c(u);h?this.warnings.push(new r.YAMLWarning(g,d,m)):this.errors.push(new r.YAMLParseError(g,d,m))},this.directives=new n.Directives({version:f.version||"1.2"}),this.options=f}decorate(f,u){let{comment:d,afterEmptyLine:m}=a(this.prelude);if(d){let h=f.contents;if(u)f.comment=f.comment?`${f.comment}
|
|
132
|
+
${d}`:d;else if(m||f.directives.docStart||!h)f.commentBefore=d;else if(i.isCollection(h)&&!h.flow&&h.items.length>0){let g=h.items[0];i.isPair(g)&&(g=g.key);let y=g.commentBefore;g.commentBefore=y?`${d}
|
|
133
|
+
${y}`:d}else{let g=h.commentBefore;h.commentBefore=g?`${d}
|
|
134
|
+
${g}`:d}}if(u){for(let h=0;h<this.errors.length;++h)f.errors.push(this.errors[h]);for(let h=0;h<this.warnings.length;++h)f.warnings.push(this.warnings[h])}else f.errors=this.errors,f.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:a(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(f,u=!1,d=-1){for(let m of f)yield*this.next(m);yield*this.end(u,d)}*next(f){switch(t.env.LOG_STREAM&&console.dir(f,{depth:null}),f.type){case"directive":this.directives.add(f.source,(u,d,m)=>{let h=c(f);h[0]+=u,this.onError(h,"BAD_DIRECTIVE",d,m)}),this.prelude.push(f.source),this.atDirectives=!0;break;case"document":{let u=o.composeDoc(this.options,this.directives,f,this.onError);this.atDirectives&&!u.directives.docStart&&this.onError(f,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(u,!1),this.doc&&(yield this.doc),this.doc=u,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(f.source);break;case"error":{let u=f.source?`${f.message}: ${JSON.stringify(f.source)}`:f.message,d=new r.YAMLParseError(c(f),"UNEXPECTED_TOKEN",u);this.atDirectives||!this.doc?this.errors.push(d):this.doc.errors.push(d);break}case"doc-end":{if(!this.doc){let d="Unexpected doc-end without preceding document";this.errors.push(new r.YAMLParseError(c(f),"UNEXPECTED_TOKEN",d));break}this.doc.directives.docEnd=!0;let u=l.resolveEnd(f.end,f.offset+f.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),u.comment){let d=this.doc.comment;this.doc.comment=d?`${d}
|
|
135
|
+
${u.comment}`:u.comment}this.doc.range[2]=u.offset;break}default:this.errors.push(new r.YAMLParseError(c(f),"UNEXPECTED_TOKEN",`Unsupported token ${f.type}`))}}*end(f=!1,u=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(f){let d=Object.assign({_directives:this.directives},this.options),m=new s.Document(void 0,d);this.atDirectives&&this.onError(u,"MISSING_CHAR","Missing directives-end indicator line"),m.range=[0,u,u],this.decorate(m,!1),yield m}}};e.Composer=p}}),Th=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/parse/cst-scalar.js"(e){"use strict";var t=Gl(),n=Hl(),s=Qs(),r=Ws();function i(f,u=!0,d){if(f){let m=(h,g,y)=>{let w=typeof h=="number"?h:Array.isArray(h)?h[0]:h.offset;if(d)d(w,g,y);else throw new s.YAMLParseError([w,w+1],g,y)};switch(f.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return n.resolveFlowScalar(f,u,m);case"block-scalar":return t.resolveBlockScalar({options:{strict:u}},f,m)}}return null}function o(f,u){let{implicitKey:d=!1,indent:m,inFlow:h=!1,offset:g=-1,type:y="PLAIN"}=u,w=r.stringifyString({type:y,value:f},{implicitKey:d,indent:m>0?" ".repeat(m):"",inFlow:h,options:{blockQuote:!0,lineWidth:-1}}),v=u.end??[{type:"newline",offset:-1,indent:m,source:`
|
|
136
|
+
`}];switch(w[0]){case"|":case">":{let S=w.indexOf(`
|
|
137
|
+
`),k=w.substring(0,S),b=w.substring(S+1)+`
|
|
138
|
+
`,E=[{type:"block-scalar-header",offset:g,indent:m,source:k}];return a(E,v)||E.push({type:"newline",offset:-1,indent:m,source:`
|
|
139
|
+
`}),{type:"block-scalar",offset:g,indent:m,props:E,source:b}}case'"':return{type:"double-quoted-scalar",offset:g,indent:m,source:w,end:v};case"'":return{type:"single-quoted-scalar",offset:g,indent:m,source:w,end:v};default:return{type:"scalar",offset:g,indent:m,source:w,end:v}}}function l(f,u,d={}){let{afterKey:m=!1,implicitKey:h=!1,inFlow:g=!1,type:y}=d,w="indent"in f?f.indent:null;if(m&&typeof w=="number"&&(w+=2),!y)switch(f.type){case"single-quoted-scalar":y="QUOTE_SINGLE";break;case"double-quoted-scalar":y="QUOTE_DOUBLE";break;case"block-scalar":{let S=f.props[0];if(S.type!=="block-scalar-header")throw new Error("Invalid block scalar header");y=S.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:y="PLAIN"}let v=r.stringifyString({type:y,value:u},{implicitKey:h||w===null,indent:w!==null&&w>0?" ".repeat(w):"",inFlow:g,options:{blockQuote:!0,lineWidth:-1}});switch(v[0]){case"|":case">":c(f,v);break;case'"':p(f,v,"double-quoted-scalar");break;case"'":p(f,v,"single-quoted-scalar");break;default:p(f,v,"scalar")}}function c(f,u){let d=u.indexOf(`
|
|
140
|
+
`),m=u.substring(0,d),h=u.substring(d+1)+`
|
|
141
|
+
`;if(f.type==="block-scalar"){let g=f.props[0];if(g.type!=="block-scalar-header")throw new Error("Invalid block scalar header");g.source=m,f.source=h}else{let{offset:g}=f,y="indent"in f?f.indent:-1,w=[{type:"block-scalar-header",offset:g,indent:y,source:m}];a(w,"end"in f?f.end:void 0)||w.push({type:"newline",offset:-1,indent:y,source:`
|
|
142
|
+
`});for(let v of Object.keys(f))v!=="type"&&v!=="offset"&&delete f[v];Object.assign(f,{type:"block-scalar",indent:y,props:w,source:h})}}function a(f,u){if(u)for(let d of u)switch(d.type){case"space":case"comment":f.push(d);break;case"newline":return f.push(d),!0}return!1}function p(f,u,d){switch(f.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":f.type=d,f.source=u;break;case"block-scalar":{let m=f.props.slice(1),h=u.length;f.props[0].type==="block-scalar-header"&&(h-=f.props[0].source.length);for(let g of m)g.offset+=h;delete f.props,Object.assign(f,{type:d,source:u,end:m});break}case"block-map":case"block-seq":{let h={type:"newline",offset:f.offset+u.length,indent:f.indent,source:`
|
|
143
|
+
`};delete f.items,Object.assign(f,{type:d,source:u,end:[h]});break}default:{let m="indent"in f?f.indent:-1,h="end"in f&&Array.isArray(f.end)?f.end.filter(g=>g.type==="space"||g.type==="comment"||g.type==="newline"):[];for(let g of Object.keys(f))g!=="type"&&g!=="offset"&&delete f[g];Object.assign(f,{type:d,indent:m,source:u,end:h})}}}e.createScalarToken=o,e.resolveAsScalar=i,e.setScalarValue=l}}),Fh=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/parse/cst-stringify.js"(e){"use strict";var t=r=>"type"in r?n(r):s(r);function n(r){switch(r.type){case"block-scalar":{let i="";for(let o of r.props)i+=n(o);return i+r.source}case"block-map":case"block-seq":{let i="";for(let o of r.items)i+=s(o);return i}case"flow-collection":{let i=r.start.source;for(let o of r.items)i+=s(o);for(let o of r.end)i+=o.source;return i}case"document":{let i=s(r);if(r.end)for(let o of r.end)i+=o.source;return i}default:{let i=r.source;if("end"in r&&r.end)for(let o of r.end)i+=o.source;return i}}}function s({start:r,key:i,sep:o,value:l}){let c="";for(let a of r)c+=a.source;if(i&&(c+=n(i)),o)for(let a of o)c+=a.source;return l&&(c+=n(l)),c}e.stringify=t}}),_h=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/parse/cst-visit.js"(e){"use strict";var t=Symbol("break visit"),n=Symbol("skip children"),s=Symbol("remove item");function r(o,l){"type"in o&&o.type==="document"&&(o={start:o.start,value:o.value}),i(Object.freeze([]),o,l)}r.BREAK=t,r.SKIP=n,r.REMOVE=s,r.itemAtPath=(o,l)=>{let c=o;for(let[a,p]of l){let f=c?.[a];if(f&&"items"in f)c=f.items[p];else return}return c},r.parentCollection=(o,l)=>{let c=r.itemAtPath(o,l.slice(0,-1)),a=l[l.length-1][0],p=c?.[a];if(p&&"items"in p)return p;throw new Error("Parent collection not found")};function i(o,l,c){let a=c(l,o);if(typeof a=="symbol")return a;for(let p of["key","value"]){let f=l[p];if(f&&"items"in f){for(let u=0;u<f.items.length;++u){let d=i(Object.freeze(o.concat([[p,u]])),f.items[u],c);if(typeof d=="number")u=d-1;else{if(d===t)return t;d===s&&(f.items.splice(u,1),u-=1)}}typeof a=="function"&&p==="key"&&(a=a(l,o))}}return typeof a=="function"?a(l,o):a}e.visit=r}}),$i=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/parse/cst.js"(e){"use strict";var t=Th(),n=Fh(),s=_h(),r="\uFEFF",i="",o="",l="",c=u=>!!u&&"items"in u,a=u=>!!u&&(u.type==="scalar"||u.type==="single-quoted-scalar"||u.type==="double-quoted-scalar"||u.type==="block-scalar");function p(u){switch(u){case r:return"<BOM>";case i:return"<DOC>";case o:return"<FLOW_END>";case l:return"<SCALAR>";default:return JSON.stringify(u)}}function f(u){switch(u){case r:return"byte-order-mark";case i:return"doc-mode";case o:return"flow-error-end";case l:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
144
|
+
`:case`\r
|
|
145
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(u[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}e.createScalarToken=t.createScalarToken,e.resolveAsScalar=t.resolveAsScalar,e.setScalarValue=t.setScalarValue,e.stringify=n.stringify,e.visit=s.visit,e.BOM=r,e.DOCUMENT=i,e.FLOW_END=o,e.SCALAR=l,e.isCollection=c,e.isScalar=a,e.prettyToken=p,e.tokenType=f}}),Ql=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/parse/lexer.js"(e){"use strict";var t=$i();function n(a){switch(a){case void 0:case" ":case`
|
|
146
|
+
`:case"\r":case" ":return!0;default:return!1}}var s=new Set("0123456789ABCDEFabcdef"),r=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),i=new Set(",[]{}"),o=new Set(` ,[]{}
|
|
147
|
+
\r `),l=a=>!a||o.has(a),c=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(a,p=!1){if(a){if(typeof a!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+a:a,this.lineEndPos=null}this.atEnd=!p;let f=this.next??"stream";for(;f&&(p||this.hasChars(1));)f=yield*this.parseNext(f)}atLineEnd(){let a=this.pos,p=this.buffer[a];for(;p===" "||p===" ";)p=this.buffer[++a];return!p||p==="#"||p===`
|
|
148
|
+
`?!0:p==="\r"?this.buffer[a+1]===`
|
|
149
|
+
`:!1}charAt(a){return this.buffer[this.pos+a]}continueScalar(a){let p=this.buffer[a];if(this.indentNext>0){let f=0;for(;p===" ";)p=this.buffer[++f+a];if(p==="\r"){let u=this.buffer[f+a+1];if(u===`
|
|
150
|
+
`||!u&&!this.atEnd)return a+f+1}return p===`
|
|
151
|
+
`||f>=this.indentNext||!p&&!this.atEnd?a+f:-1}if(p==="-"||p==="."){let f=this.buffer.substr(a,3);if((f==="---"||f==="...")&&n(this.buffer[a+3]))return-1}return a}getLine(){let a=this.lineEndPos;return(typeof a!="number"||a!==-1&&a<this.pos)&&(a=this.buffer.indexOf(`
|
|
152
|
+
`,this.pos),this.lineEndPos=a),a===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[a-1]==="\r"&&(a-=1),this.buffer.substring(this.pos,a))}hasChars(a){return this.pos+a<=this.buffer.length}setNext(a){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=a,null}peek(a){return this.buffer.substr(this.pos,a)}*parseNext(a){switch(a){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let a=this.getLine();if(a===null)return this.setNext("stream");if(a[0]===t.BOM&&(yield*this.pushCount(1),a=a.substring(1)),a[0]==="%"){let p=a.length,f=a.indexOf("#");for(;f!==-1;){let d=a[f-1];if(d===" "||d===" "){p=f-1;break}else f=a.indexOf("#",f+1)}for(;;){let d=a[p-1];if(d===" "||d===" ")p-=1;else break}let u=(yield*this.pushCount(p))+(yield*this.pushSpaces(!0));return yield*this.pushCount(a.length-u),this.pushNewline(),"stream"}if(this.atLineEnd()){let p=yield*this.pushSpaces(!0);return yield*this.pushCount(a.length-p),yield*this.pushNewline(),"stream"}return yield t.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let a=this.charAt(0);if(!a&&!this.atEnd)return this.setNext("line-start");if(a==="-"||a==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let p=this.peek(3);if((p==="---"||p==="...")&&n(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,p==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!n(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[a,p]=this.peek(2);if(!p&&!this.atEnd)return this.setNext("block-start");if((a==="-"||a==="?"||a===":")&&n(p)){let f=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=f,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let a=this.getLine();if(a===null)return this.setNext("doc");let p=yield*this.pushIndicators();switch(a[p]){case"#":yield*this.pushCount(a.length-p);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(l),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return p+=yield*this.parseBlockScalarHeader(),p+=yield*this.pushSpaces(!0),yield*this.pushCount(a.length-p),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let a,p,f=-1;do a=yield*this.pushNewline(),a>0?(p=yield*this.pushSpaces(!1),this.indentValue=f=p):p=0,p+=yield*this.pushSpaces(!0);while(a+p>0);let u=this.getLine();if(u===null)return this.setNext("flow");if((f!==-1&&f<this.indentNext&&u[0]!=="#"||f===0&&(u.startsWith("---")||u.startsWith("..."))&&n(u[3]))&&!(f===this.indentNext-1&&this.flowLevel===1&&(u[0]==="]"||u[0]==="}")))return this.flowLevel=0,yield t.FLOW_END,yield*this.parseLineStart();let d=0;for(;u[d]===",";)d+=yield*this.pushCount(1),d+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(d+=yield*this.pushIndicators(),u[d]){case void 0:return"flow";case"#":return yield*this.pushCount(u.length-d),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(l),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let m=this.charAt(1);if(this.flowKey||n(m)||m===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let a=this.charAt(0),p=this.buffer.indexOf(a,this.pos+1);if(a==="'")for(;p!==-1&&this.buffer[p+1]==="'";)p=this.buffer.indexOf("'",p+2);else for(;p!==-1;){let d=0;for(;this.buffer[p-1-d]==="\\";)d+=1;if(d%2===0)break;p=this.buffer.indexOf('"',p+1)}let f=this.buffer.substring(0,p),u=f.indexOf(`
|
|
153
|
+
`,this.pos);if(u!==-1){for(;u!==-1;){let d=this.continueScalar(u+1);if(d===-1)break;u=f.indexOf(`
|
|
154
|
+
`,d)}u!==-1&&(p=u-(f[u-1]==="\r"?2:1))}if(p===-1){if(!this.atEnd)return this.setNext("quoted-scalar");p=this.buffer.length}return yield*this.pushToIndex(p+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let a=this.pos;for(;;){let p=this.buffer[++a];if(p==="+")this.blockScalarKeep=!0;else if(p>"0"&&p<="9")this.blockScalarIndent=Number(p)-1;else if(p!=="-")break}return yield*this.pushUntil(p=>n(p)||p==="#")}*parseBlockScalar(){let a=this.pos-1,p=0,f;e:for(let d=this.pos;f=this.buffer[d];++d)switch(f){case" ":p+=1;break;case`
|
|
155
|
+
`:a=d,p=0;break;case"\r":{let m=this.buffer[d+1];if(!m&&!this.atEnd)return this.setNext("block-scalar");if(m===`
|
|
156
|
+
`)break}default:break e}if(!f&&!this.atEnd)return this.setNext("block-scalar");if(p>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=p:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let d=this.continueScalar(a+1);if(d===-1)break;a=this.buffer.indexOf(`
|
|
157
|
+
`,d)}while(a!==-1);if(a===-1){if(!this.atEnd)return this.setNext("block-scalar");a=this.buffer.length}}let u=a+1;for(f=this.buffer[u];f===" ";)f=this.buffer[++u];if(f===" "){for(;f===" "||f===" "||f==="\r"||f===`
|
|
158
|
+
`;)f=this.buffer[++u];a=u-1}else if(!this.blockScalarKeep)do{let d=a-1,m=this.buffer[d];m==="\r"&&(m=this.buffer[--d]);let h=d;for(;m===" ";)m=this.buffer[--d];if(m===`
|
|
159
|
+
`&&d>=this.pos&&d+1+p>h)a=d;else break}while(!0);return yield t.SCALAR,yield*this.pushToIndex(a+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let a=this.flowLevel>0,p=this.pos-1,f=this.pos-1,u;for(;u=this.buffer[++f];)if(u===":"){let d=this.buffer[f+1];if(n(d)||a&&i.has(d))break;p=f}else if(n(u)){let d=this.buffer[f+1];if(u==="\r"&&(d===`
|
|
160
|
+
`?(f+=1,u=`
|
|
161
|
+
`,d=this.buffer[f+1]):p=f),d==="#"||a&&i.has(d))break;if(u===`
|
|
162
|
+
`){let m=this.continueScalar(f+1);if(m===-1)break;f=Math.max(f,m-2)}}else{if(a&&i.has(u))break;p=f}return!u&&!this.atEnd?this.setNext("plain-scalar"):(yield t.SCALAR,yield*this.pushToIndex(p+1,!0),a?"flow":"doc")}*pushCount(a){return a>0?(yield this.buffer.substr(this.pos,a),this.pos+=a,a):0}*pushToIndex(a,p){let f=this.buffer.slice(this.pos,a);return f?(yield f,this.pos+=f.length,f.length):(p&&(yield""),0)}*pushIndicators(){let a=0;e:for(;;){switch(this.charAt(0)){case"!":a+=yield*this.pushTag(),a+=yield*this.pushSpaces(!0);continue e;case"&":a+=yield*this.pushUntil(l),a+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let p=this.flowLevel>0,f=this.charAt(1);if(n(f)||p&&i.has(f)){p?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,a+=yield*this.pushCount(1),a+=yield*this.pushSpaces(!0);continue e}}}break e}return a}*pushTag(){if(this.charAt(1)==="<"){let a=this.pos+2,p=this.buffer[a];for(;!n(p)&&p!==">";)p=this.buffer[++a];return yield*this.pushToIndex(p===">"?a+1:a,!1)}else{let a=this.pos+1,p=this.buffer[a];for(;p;)if(r.has(p))p=this.buffer[++a];else if(p==="%"&&s.has(this.buffer[a+1])&&s.has(this.buffer[a+2]))p=this.buffer[a+=3];else break;return yield*this.pushToIndex(a,!1)}}*pushNewline(){let a=this.buffer[this.pos];return a===`
|
|
163
|
+
`?yield*this.pushCount(1):a==="\r"&&this.charAt(1)===`
|
|
164
|
+
`?yield*this.pushCount(2):0}*pushSpaces(a){let p=this.pos-1,f;do f=this.buffer[++p];while(f===" "||a&&f===" ");let u=p-this.pos;return u>0&&(yield this.buffer.substr(this.pos,u),this.pos=p),u}*pushUntil(a){let p=this.pos,f=this.buffer[p];for(;!a(f);)f=this.buffer[++p];return yield*this.pushToIndex(p,!1)}};e.Lexer=c}}),Xl=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/parse/line-counter.js"(e){"use strict";var t=class{constructor(){this.lineStarts=[],this.addNewLine=n=>this.lineStarts.push(n),this.linePos=n=>{let s=0,r=this.lineStarts.length;for(;s<r;){let o=s+r>>1;this.lineStarts[o]<n?s=o+1:r=o}if(this.lineStarts[s]===n)return{line:s+1,col:1};if(s===0)return{line:0,col:n};let i=this.lineStarts[s-1];return{line:s,col:n-i+1}}}};e.LineCounter=t}}),Zl=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/parse/parser.js"(e){"use strict";var t=Us("process"),n=$i(),s=Ql();function r(u,d){for(let m=0;m<u.length;++m)if(u[m].type===d)return!0;return!1}function i(u){for(let d=0;d<u.length;++d)switch(u[d].type){case"space":case"comment":case"newline":break;default:return d}return-1}function o(u){switch(u?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function l(u){switch(u.type){case"document":return u.start;case"block-map":{let d=u.items[u.items.length-1];return d.sep??d.start}case"block-seq":return u.items[u.items.length-1].start;default:return[]}}function c(u){if(u.length===0)return[];let d=u.length;e:for(;--d>=0;)switch(u[d].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;u[++d]?.type==="space";);return u.splice(d,u.length)}function a(u,d){if(d.length<1e5)Array.prototype.push.apply(u,d);else for(let m=0;m<d.length;++m)u.push(d[m])}function p(u){if(u.start.type==="flow-seq-start")for(let d of u.items)d.sep&&!d.value&&!r(d.start,"explicit-key-ind")&&!r(d.sep,"map-value-ind")&&(d.key&&(d.value=d.key),delete d.key,o(d.value)?d.value.end?a(d.value.end,d.sep):d.value.end=d.sep:a(d.start,d.sep),delete d.sep)}var f=class{constructor(u){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new s.Lexer,this.onNewLine=u}*parse(u,d=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let m of this.lexer.lex(u,d))yield*this.next(m);d||(yield*this.end())}*next(u){if(this.source=u,t.env.LOG_TOKENS&&console.log("|",n.prettyToken(u)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=u.length;return}let d=n.tokenType(u);if(d)if(d==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=d,yield*this.step(),d){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+u.length);break;case"space":this.atNewLine&&u[0]===" "&&(this.indent+=u.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=u.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=u.length}else{let m=`Not a YAML token: ${u}`;yield*this.pop({type:"error",offset:this.offset,message:m,source:u}),this.offset+=u.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let u=this.peek(1);if(this.type==="doc-end"&&u?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!u)return yield*this.stream();switch(u.type){case"document":return yield*this.document(u);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(u);case"block-scalar":return yield*this.blockScalar(u);case"block-map":return yield*this.blockMap(u);case"block-seq":return yield*this.blockSequence(u);case"flow-collection":return yield*this.flowCollection(u);case"doc-end":return yield*this.documentEnd(u)}yield*this.pop()}peek(u){return this.stack[this.stack.length-u]}*pop(u){let d=u??this.stack.pop();if(!d)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield d;else{let m=this.peek(1);switch(d.type==="block-scalar"?d.indent="indent"in m?m.indent:0:d.type==="flow-collection"&&m.type==="document"&&(d.indent=0),d.type==="flow-collection"&&p(d),m.type){case"document":m.value=d;break;case"block-scalar":m.props.push(d);break;case"block-map":{let h=m.items[m.items.length-1];if(h.value){m.items.push({start:[],key:d,sep:[]}),this.onKeyLine=!0;return}else if(h.sep)h.value=d;else{Object.assign(h,{key:d,sep:[]}),this.onKeyLine=!h.explicitKey;return}break}case"block-seq":{let h=m.items[m.items.length-1];h.value?m.items.push({start:[],value:d}):h.value=d;break}case"flow-collection":{let h=m.items[m.items.length-1];!h||h.value?m.items.push({start:[],key:d,sep:[]}):h.sep?h.value=d:Object.assign(h,{key:d,sep:[]});return}default:yield*this.pop(),yield*this.pop(d)}if((m.type==="document"||m.type==="block-map"||m.type==="block-seq")&&(d.type==="block-map"||d.type==="block-seq")){let h=d.items[d.items.length-1];h&&!h.sep&&!h.value&&h.start.length>0&&i(h.start)===-1&&(d.indent===0||h.start.every(g=>g.type!=="comment"||g.indent<d.indent))&&(m.type==="document"?m.end=h.start:m.items.push({start:h.start}),d.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let u={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&u.start.push(this.sourceToken),this.stack.push(u);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(u){if(u.value)return yield*this.lineEnd(u);switch(this.type){case"doc-start":{i(u.start)!==-1?(yield*this.pop(),yield*this.step()):u.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":u.start.push(this.sourceToken);return}let d=this.startBlockValue(u);d?this.stack.push(d):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(u){if(this.type==="map-value-ind"){let d=l(this.peek(2)),m=c(d),h;u.end?(h=u.end,h.push(this.sourceToken),delete u.end):h=[this.sourceToken];let g={type:"block-map",offset:u.offset,indent:u.indent,items:[{start:m,key:u,sep:h}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=g}else yield*this.lineEnd(u)}*blockScalar(u){switch(this.type){case"space":case"comment":case"newline":u.props.push(this.sourceToken);return;case"scalar":if(u.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let d=this.source.indexOf(`
|
|
165
|
+
`)+1;for(;d!==0;)this.onNewLine(this.offset+d),d=this.source.indexOf(`
|
|
166
|
+
`,d)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(u){let d=u.items[u.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,d.value){let m="end"in d.value?d.value.end:void 0;(Array.isArray(m)?m[m.length-1]:void 0)?.type==="comment"?m?.push(this.sourceToken):u.items.push({start:[this.sourceToken]})}else d.sep?d.sep.push(this.sourceToken):d.start.push(this.sourceToken);return;case"space":case"comment":if(d.value)u.items.push({start:[this.sourceToken]});else if(d.sep)d.sep.push(this.sourceToken);else{if(this.atIndentedComment(d.start,u.indent)){let h=u.items[u.items.length-2]?.value?.end;if(Array.isArray(h)){a(h,d.start),h.push(this.sourceToken),u.items.pop();return}}d.start.push(this.sourceToken)}return}if(this.indent>=u.indent){let m=!this.onKeyLine&&this.indent===u.indent,h=m&&(d.sep||d.explicitKey)&&this.type!=="seq-item-ind",g=[];if(h&&d.sep&&!d.value){let y=[];for(let w=0;w<d.sep.length;++w){let v=d.sep[w];switch(v.type){case"newline":y.push(w);break;case"space":break;case"comment":v.indent>u.indent&&(y.length=0);break;default:y.length=0}}y.length>=2&&(g=d.sep.splice(y[1]))}switch(this.type){case"anchor":case"tag":h||d.value?(g.push(this.sourceToken),u.items.push({start:g}),this.onKeyLine=!0):d.sep?d.sep.push(this.sourceToken):d.start.push(this.sourceToken);return;case"explicit-key-ind":!d.sep&&!d.explicitKey?(d.start.push(this.sourceToken),d.explicitKey=!0):h||d.value?(g.push(this.sourceToken),u.items.push({start:g,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(d.explicitKey)if(d.sep)if(d.value)u.items.push({start:[],key:null,sep:[this.sourceToken]});else if(r(d.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:g,key:null,sep:[this.sourceToken]}]});else if(o(d.key)&&!r(d.sep,"newline")){let y=c(d.start),w=d.key,v=d.sep;v.push(this.sourceToken),delete d.key,delete d.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:y,key:w,sep:v}]})}else g.length>0?d.sep=d.sep.concat(g,this.sourceToken):d.sep.push(this.sourceToken);else if(r(d.start,"newline"))Object.assign(d,{key:null,sep:[this.sourceToken]});else{let y=c(d.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:y,key:null,sep:[this.sourceToken]}]})}else d.sep?d.value||h?u.items.push({start:g,key:null,sep:[this.sourceToken]}):r(d.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):d.sep.push(this.sourceToken):Object.assign(d,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let y=this.flowScalar(this.type);h||d.value?(u.items.push({start:g,key:y,sep:[]}),this.onKeyLine=!0):d.sep?this.stack.push(y):(Object.assign(d,{key:y,sep:[]}),this.onKeyLine=!0);return}default:{let y=this.startBlockValue(u);if(y){if(y.type==="block-seq"){if(!d.explicitKey&&d.sep&&!r(d.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else m&&u.items.push({start:g});this.stack.push(y);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(u){let d=u.items[u.items.length-1];switch(this.type){case"newline":if(d.value){let m="end"in d.value?d.value.end:void 0;(Array.isArray(m)?m[m.length-1]:void 0)?.type==="comment"?m?.push(this.sourceToken):u.items.push({start:[this.sourceToken]})}else d.start.push(this.sourceToken);return;case"space":case"comment":if(d.value)u.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(d.start,u.indent)){let h=u.items[u.items.length-2]?.value?.end;if(Array.isArray(h)){a(h,d.start),h.push(this.sourceToken),u.items.pop();return}}d.start.push(this.sourceToken)}return;case"anchor":case"tag":if(d.value||this.indent<=u.indent)break;d.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==u.indent)break;d.value||r(d.start,"seq-item-ind")?u.items.push({start:[this.sourceToken]}):d.start.push(this.sourceToken);return}if(this.indent>u.indent){let m=this.startBlockValue(u);if(m){this.stack.push(m);return}}yield*this.pop(),yield*this.step()}*flowCollection(u){let d=u.items[u.items.length-1];if(this.type==="flow-error-end"){let m;do yield*this.pop(),m=this.peek(1);while(m?.type==="flow-collection")}else if(u.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!d||d.sep?u.items.push({start:[this.sourceToken]}):d.start.push(this.sourceToken);return;case"map-value-ind":!d||d.value?u.items.push({start:[],key:null,sep:[this.sourceToken]}):d.sep?d.sep.push(this.sourceToken):Object.assign(d,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!d||d.value?u.items.push({start:[this.sourceToken]}):d.sep?d.sep.push(this.sourceToken):d.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let h=this.flowScalar(this.type);!d||d.value?u.items.push({start:[],key:h,sep:[]}):d.sep?this.stack.push(h):Object.assign(d,{key:h,sep:[]});return}case"flow-map-end":case"flow-seq-end":u.end.push(this.sourceToken);return}let m=this.startBlockValue(u);m?this.stack.push(m):(yield*this.pop(),yield*this.step())}else{let m=this.peek(2);if(m.type==="block-map"&&(this.type==="map-value-ind"&&m.indent===u.indent||this.type==="newline"&&!m.items[m.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&m.type!=="flow-collection"){let h=l(m),g=c(h);p(u);let y=u.end.splice(1,u.end.length);y.push(this.sourceToken);let w={type:"block-map",offset:u.offset,indent:u.indent,items:[{start:g,key:u,sep:y}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=w}else yield*this.lineEnd(u)}}flowScalar(u){if(this.onNewLine){let d=this.source.indexOf(`
|
|
167
|
+
`)+1;for(;d!==0;)this.onNewLine(this.offset+d),d=this.source.indexOf(`
|
|
168
|
+
`,d)+1}return{type:u,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(u){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let d=l(u),m=c(d);return m.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:m,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let d=l(u),m=c(d);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:m,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(u,d){return this.type!=="comment"||this.indent<=d?!1:u.every(m=>m.type==="newline"||m.type==="space")}*documentEnd(u){this.type!=="doc-mode"&&(u.end?u.end.push(this.sourceToken):u.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(u){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:u.end?u.end.push(this.sourceToken):u.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};e.Parser=f}}),Ph=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/public-api.js"(e){"use strict";var t=zl(),n=zs(),s=Qs(),r=Dl(),i=B(),o=Xl(),l=Zl();function c(d){let m=d.prettyErrors!==!1;return{lineCounter:d.lineCounter||m&&new o.LineCounter||null,prettyErrors:m}}function a(d,m={}){let{lineCounter:h,prettyErrors:g}=c(m),y=new l.Parser(h?.addNewLine),w=new t.Composer(m),v=Array.from(w.compose(y.parse(d)));if(g&&h)for(let S of v)S.errors.forEach(s.prettifyError(d,h)),S.warnings.forEach(s.prettifyError(d,h));return v.length>0?v:Object.assign([],{empty:!0},w.streamInfo())}function p(d,m={}){let{lineCounter:h,prettyErrors:g}=c(m),y=new l.Parser(h?.addNewLine),w=new t.Composer(m),v=null;for(let S of w.compose(y.parse(d),!0,d.length))if(!v)v=S;else if(v.options.logLevel!=="silent"){v.errors.push(new s.YAMLParseError(S.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return g&&h&&(v.errors.forEach(s.prettifyError(d,h)),v.warnings.forEach(s.prettifyError(d,h))),v}function f(d,m,h){let g;typeof m=="function"?g=m:h===void 0&&m&&typeof m=="object"&&(h=m);let y=p(d,h);if(!y)return null;if(y.warnings.forEach(w=>r.warn(y.options.logLevel,w)),y.errors.length>0){if(y.options.logLevel!=="silent")throw y.errors[0];y.errors=[]}return y.toJS(Object.assign({reviver:g},h))}function u(d,m,h){let g=null;if(typeof m=="function"||Array.isArray(m)?g=m:h===void 0&&m&&(h=m),typeof h=="string"&&(h=h.length),typeof h=="number"){let y=Math.round(h);h=y<1?void 0:y>8?{indent:8}:{indent:y}}if(d===void 0){let{keepUndefined:y}=h??m??{};if(!y)return}return i.isDocument(d)&&!g?d.toString(h):new n.Document(d,g,h).toString(h)}e.parse=f,e.parseAllDocuments=a,e.parseDocument=p,e.stringify=u}}),ec=D({"node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/index.js"(e){"use strict";var t=zl(),n=zs(),s=Jl(),r=Qs(),i=Ys(),o=B(),l=Nt(),c=se(),a=Ot(),p=It(),f=$i(),u=Ql(),d=Xl(),m=Zl(),h=Ph(),g=Js();e.Composer=t.Composer,e.Document=n.Document,e.Schema=s.Schema,e.YAMLError=r.YAMLError,e.YAMLParseError=r.YAMLParseError,e.YAMLWarning=r.YAMLWarning,e.Alias=i.Alias,e.isAlias=o.isAlias,e.isCollection=o.isCollection,e.isDocument=o.isDocument,e.isMap=o.isMap,e.isNode=o.isNode,e.isPair=o.isPair,e.isScalar=o.isScalar,e.isSeq=o.isSeq,e.Pair=l.Pair,e.Scalar=c.Scalar,e.YAMLMap=a.YAMLMap,e.YAMLSeq=p.YAMLSeq,e.CST=f,e.Lexer=u.Lexer,e.LineCounter=d.LineCounter,e.Parser=m.Parser,e.parse=h.parse,e.parseAllDocuments=h.parseAllDocuments,e.parseDocument=h.parseDocument,e.stringify=h.stringify,e.visit=g.visit,e.visitAsync=g.visitAsync}}),tc=["ui","desktop-core","native-library","service","cli","unknown"],Zs=["ui","ipc","native-memory","api","data","build","review"];F=class sc extends Error{line;column;codeblock;constructor(t,n){let[s,r]=Mh(n.toml,n.ptr),i=qh(n.toml,s,r);super(`Invalid TOML document: ${t}
|
|
169
|
+
|
|
170
|
+
${i}`,n),this.line=s,this.column=r,this.codeblock=i}static x(t,n,s){throw new sc(t,{toml:n.s,ptr:s??n.p})}};Bh=/^(\d{4}-\d{2}-\d{2})?[Tt ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|z|[-+]\d{2}:\d{2})?$/i,Rh=class Nn extends Date{#t=!1;#n=!1;#e=null;constructor(t,n,s){let r=!0,i=!0,o="Z",l;if(typeof t=="string")if(n)e:{if(n<3){if(+t.slice(11,13)>23){t="";break e}n===2?(o=null,t+="Z"):(l=t.charCodeAt(t.length-1))!==90&&l!==122&&(o=t.slice(t.length-6)),s&&(t=t.slice(0,10)+"T"+t.slice(11))}else n===4&&(t=+t.slice(0,2)>23?"":`0000-01-01T${t}Z`);r=n!==4,i=n!==3}else{let c=t.match(Bh);c?(c[1]||(r=!1,t=`0000-01-01T${t}`),i=!!c[2],i&&t[10]===" "&&(t=t.replace(" ","T")),c[2]&&+c[2]>23?t="":(o=c[3]||null,!o&&i&&(t+="Z"))):t=""}super(t),isNaN(this.getTime())||(this.#t=r,this.#n=i,this.#e=o)}isDateTime(){return this.#t&&this.#n}isLocal(){return!this.#t||!this.#n||!this.#e}isDate(){return this.#t&&!this.#n}isTime(){return this.#n&&!this.#t}isValid(){return this.#t||this.#n}toISOString(){let t=super.toISOString();if(this.isDate())return t.slice(0,10);if(this.isTime())return t.slice(11,23);if(this.#e===null)return t.slice(0,-1);if(this.#e==="Z"||this.#e==="z")return t;let n=+this.#e.slice(1,3)*60+ +this.#e.slice(4,6);return n=this.#e[0]==="-"?n:-n,new Date(this.getTime()-n*6e4).toISOString().slice(0,-1)+this.#e}static wrapAsOffsetDateTime(t,n="Z"){let s=new Nn(t);return s.#e=n,s}static wrapAsLocalDateTime(t){let n=new Nn(t);return n.#e=null,n}static wrapAsLocalDate(t){let n=new Nn(t);return n.#n=!1,n.#e=null,n}static wrapAsLocalTime(t){let n=new Nn(t);return n.#t=!1,n.#e=null,n}};xh=/^[a-z0-9-_]+$/i,oc=!!"".isWellFormed;cc=Ol(ec(),1),Si={"Cargo.toml":["rust"],"go.mod":["go"],"go.work":["go"],"pom.xml":["java"],"build.gradle":["java"],"build.gradle.kts":["java"],"settings.gradle":["java"],"settings.gradle.kts":["java"],"pyproject.toml":["python"],"setup.py":["python"],"setup.cfg":["python"],"requirements.txt":["python"],"CMakeLists.txt":[],"CMakePresets.json":[],"meson.build":[],Makefile:[],makefile:[],"package.json":[],"pnpm-workspace.yaml":[],"tauri.conf.json":[],"Tauri.toml":[]},Zh={".rs":"rust",".go":"go",".java":"java",".py":"python",".c":"c",".cc":"cpp",".cpp":"cpp",".cxx":"cpp",".c++":"cpp",".hpp":"cpp",".hxx":"cpp",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".ts":"typescript",".tsx":"typescript",".mts":"typescript",".cts":"typescript",".vue":"javascript"},em=new Set([".git","node_modules","target",".venv","venv","build","dist",".idea",".gradle","__pycache__",".mypy_cache",".pytest_cache","vendor",".ssh",".aws",".azure",".kube"]),pl=e=>/^\.env(?:\.|$)|\.(?:pem|key|p12|pfx)$|^(?:id_rsa|id_ed25519|credentials|auth\.json)$/i.test(e),As=e=>Zh[$h.extname(e).toLowerCase()];nm={id:"electron",detect(e){let t=e.readManifest("package.json");if(!t)return;let n=uc(t).find(r=>r.name==="electron");if(!n)return;let s=Ht(t);return{evidence:{id:"electron",version:n.version,paths:["package.json"]},roles:typeof s.main=="string"?["desktop-core"]:[],relatedRoots:[]}}},sm={id:"tauri",detect(e){let t=e.readManifest("Cargo.toml"),n=e.readManifest("src-tauri/Cargo.toml"),s=e.readManifest("tauri.conf.json")??e.readManifest("Tauri.toml"),r=e.readManifest("src-tauri/tauri.conf.json")??e.readManifest("src-tauri/Tauri.toml");if(t){let i=ml(t).find(o=>o.name==="tauri");if(i)return{evidence:{id:"tauri",version:i.version,paths:["Cargo.toml",...s?[e.files.includes("tauri.conf.json")?"tauri.conf.json":"Tauri.toml"]:[]]},roles:s?["desktop-core"]:[],relatedRoots:s&&ki.basename(e.root)==="src-tauri"?[ki.dirname(e.root)]:[]}}if(n&&r&&e.readManifest("package.json")){let i=ml(n).find(o=>o.name==="tauri");if(i)return{evidence:{id:"tauri",version:i.version,paths:["package.json","src-tauri/Cargo.toml",e.files.includes("src-tauri/tauri.conf.json")?"src-tauri/tauri.conf.json":"src-tauri/Tauri.toml"]},roles:["ui"],relatedRoots:[ki.join(e.root,"src-tauri")]}}}},rm=[sm,nm],it=(e,t)=>{let n=$.relative(e,t);return!$.isAbsolute(n)&&n!==".."&&!n.startsWith(".."+$.sep)},gl=e=>process.platform==="win32"?$.resolve(e).toLowerCase():$.resolve(e);Ct=e=>im("sha256").update(e).digest("hex");Ms=Object.freeze({claude:{localDirectory:".claude",skills:!0},codex:{localDirectory:".codex",skills:!0},cursor:{localDirectory:".cursor",skills:!0},windsurf:{localDirectory:".windsurf",skills:!0},opencode:{localDirectory:".opencode",skills:!0},kilo:{localDirectory:".kilo",skills:!0},gemini:{localDirectory:".gemini",skills:!0},copilot:{localDirectory:".github",skills:!1},antigravity:{localDirectory:".agent",skills:!0},augment:{localDirectory:".augment",skills:!0},trae:{localDirectory:".trae",skills:!1},codebuddy:{localDirectory:".codebuddy",skills:!0},cline:{localDirectory:"",skills:!1},openclaw:{localDirectory:".openclaw",skills:!0},qoder:{localDirectory:".qoder",skills:!0}});js=new Set(["skills","agents","commands","rules","workflows","global_workflows","prompts","instructions","hooks"]);dm=Ol(ec(),1);Wt=e=>fm("sha256").update(e).digest("hex");Ge=e=>ym("sha256").update(e).digest("hex");Gt=e=>!!e&&typeof e=="object"&&!Array.isArray(e);Ls="transaction.json";Ks=e=>e.allowedRoots;Om="craft-product";Cl=(e,t)=>{let n=_s.relative(e,t);return!_s.isAbsolute(n)&&n!==".."&&!n.startsWith(".."+_s.sep)};});import Se from"node:fs";import Fe from"node:path";function de(e){return Fe.join(e,"frontend-craft.manifest.json")}function Yi(e){try{let t=JSON.parse(e.toString("utf8"));return!t||typeof t!="object"||Array.isArray(t)||typeof t.packageVersion!="string"||!t.packageVersion||typeof t.runtime!="string"||!["local","global"].includes(t.scope)||typeof t.installedAt!="string"||t.language!==void 0&&!["en","zh-CN"].includes(t.language)||!Array.isArray(t.files)||t.files.some(n=>!n||typeof n.path!="string"||!n.path||typeof n.hash!="string"||!/^[a-f0-9]{64}$/.test(n.hash)||n.root!==void 0&&!["baseDir","cwd","home"].includes(n.root))||t.settingsHooks!==void 0&&(!Array.isArray(t.settingsHooks)||t.settingsHooks.some(n=>!n||typeof n.path!="string"||!n.path||n.root!==void 0&&!["baseDir","cwd","home"].includes(n.root)||!n.hooks||typeof n.hooks!="object"||Array.isArray(n.hooks)||Object.values(n.hooks).some(s=>!Array.isArray(s))))||t.common&&(!Fe.isAbsolute(t.common.target)||!Fe.isAbsolute(t.common.ledgerDir)||typeof t.common.packageVersion!="string"||!["en","zh-CN"].includes(t.common.language)||!/^[a-f0-9]{64}$/.test(t.common.digest))?void 0:{...t,files:t.files.map(n=>({...n,path:n.path.split(Fe.sep).join("/")}))}}catch{return}}function Be(e){try{let t=Se.lstatSync(e);return!t.isFile()||t.isSymbolicLink()?void 0:Yi(Se.readFileSync(e))}catch{return}}function qn(e){return Ct(Buffer.from(e))}function Ic(e){return qn(Se.readFileSync(e))}function Lm(e){if(!Se.existsSync(e))Se.mkdirSync(e,{recursive:!0});else if(!Se.statSync(e).isDirectory())throw new Error(`Expected directory: ${e}`)}function ze(e){return Se.readFileSync(e,"utf8")}function Vi(e,t){Lm(Fe.dirname(e)),Se.writeFileSync(e,t)}function J(e){let t=e.session;if(!t)throw new Error("Installer requires an explicit planning session");let n=(r,i)=>{e.runtime==="claude"&&Fe.resolve(r)===Fe.resolve(e.baseDir,"settings.json")?t.stage(r,i):t.writeManaged(r,i)},s={ensureDir(r){},readUtf8:ze,writeUtf8(r,i){n(r,Buffer.from(i))},writeSharedUtf8(r,i){t.stage(r,Buffer.from(i))},copyFile(r,i){if(Se.lstatSync(r).isSymbolicLink())throw new Error("Source resources cannot contain links");n(i,Se.readFileSync(r))},copyDir(r,i,o={}){if(Se.existsSync(r))for(let l of Se.readdirSync(r,{withFileTypes:!0})){if(o.filter&&!o.filter(l.name))continue;if(l.isSymbolicLink())throw new Error("Source resources cannot contain links");let c=Fe.join(r,l.name),a=Fe.join(i,l.name);l.isDirectory()?s.copyDir(c,a,o):s.copyFile(c,a)}},copyProductSkills(r,i){for(let o of Se.readdirSync(r,{withFileTypes:!0}))o.isDirectory()&&o.name.startsWith("fec-")&&s.copyDir(Fe.join(r,o.name),Fe.join(i,o.name))},retireManagedFile(r){t.retireTree(r)},retireManagedTree(r){t.retireTree(r)},forgetManagedFile(r){t.retireTree(r)}};return s}var Z=K(()=>{"use strict";ve()});import Bn from"node:fs";import Qe from"node:path";function tn(e,t){let n=JSON.parse(Bn.readFileSync(Qe.join(e,"common-content.lock.json"),"utf8"));if(n.schemaVersion!==1||n.packageName!=="@bovinphang/craft-common"||!Array.isArray(n.files)||!n.catalogs?.[t])throw new Error("公共内容锁结构无效");for(let s of n.files){let r=Qe.resolve(e,s.relativePath),i=Qe.relative(Qe.resolve(e),r);if(!i||i===".."||i.startsWith(`..${Qe.sep}`)||Qe.isAbsolute(i))throw new Error("公共内容路径越界");let o=r;for(;o!==Qe.resolve(e);){if(Bn.existsSync(o)&&Bn.lstatSync(o).isSymbolicLink())throw new Error(`公共快照不能使用符号链接:${o}`);o=Qe.dirname(o)}if(!Bn.existsSync(r)||qn(Bn.readFileSync(r))!==s.hash)throw new Error(`公共内容哈希不一致或被修改:${s.relativePath}`)}return{...n.catalogs[t],root:t==="en"?e:Qe.join(e,"localized",t)}}var er=K(()=>{"use strict";Z()});import Dc from"node:fs";import Fm from"node:os";import _m from"node:path";function Ze(e){let t=e.home??Fm.homedir(),n=Dt({runtime:e.runtime,cwd:e.cwd,home:t,baseDir:e.baseDir,scope:e.isGlobal?"global":"local",env:{},compatibility:"frontend"}),s="3.0.0",r=_m.join(e.pluginRoot,"package.json");return Dc.existsSync(r)&&(s=String(JSON.parse(Dc.readFileSync(r,"utf8")).version??s)),{packageVersion:s,runtime:e.runtime,scope:e.isGlobal?"global":"local",language:e.language,cwd:e.cwd,home:t,baseDir:e.baseDir,allowedRoots:n.resourceRoots,dryRun:e.dryRun}}var Xe,Lc,Lt=K(()=>{"use strict";ve();Xe=Object.freeze({packageName:"@bovinphang/frontend-craft",consumerProduct:"frontend-craft",resourcePrefix:"fec-",manifestName:"frontend-craft.manifest.json",stateDirectoryName:".frontend-craft-state",markerId:"frontend-craft",retainUnrequestedFiles:!0,nativeMetadata:!0,resourceEntries:{rules:["references"]}});Lc={"fec-drawio-studio":"cc-drawio-studio","fec-source-driven-development":"cc-source-driven-development","fec-typescript-project-standard":"cc-typescript-project-standard"}});import nn from"node:path";function sn(e,t,n){if(!n||nn.isAbsolute(n)||n.split(/[\\/]/).some(s=>!s||s==="."||s===".."))throw new Error("Invalid ownership manifest path; existing files were preserved");return oe(nn.join(e[t],n),e.allowedRoots)}function Tc(e,t){let n=oe(t,e.allowedRoots);for(let s of["baseDir","cwd","home"]){let r=Ne(e[s]),i=nn.relative(r,n);if(i&&!nn.isAbsolute(i)&&i!==".."&&!i.startsWith(".."+nn.sep))return{path:i.split(nn.sep).join("/"),...s==="baseDir"?{}:{root:s}}}throw new Error("Cannot represent ownership path within declared roots")}function Wi(e,t,n,s=!1){if(!n||typeof n!="object"||Array.isArray(n))throw new Error("Invalid settings Hook entry");return{kind:"json-hook",id:`frontend-craft-hook-${e.replace(/[^a-z0-9]/gi,"-").toLowerCase()}-${t}`,event:e,value:n,createdFile:s,hash:Te({kind:"json-hook",value:n})}}var Re,rn=K(()=>{"use strict";ve();Z();Lt();Re={decode(e,t){let n=Yi(e);if(!n)throw new Error("Cannot read ownership manifest; existing files were preserved");if(n.runtime!==t.runtime||n.scope!==t.scope)throw new Error("Installation manifest identity mismatch: runtime/scope");let s=(n.settingsHooks??[]).flatMap(i=>Object.entries(i.hooks).flatMap(([o,l])=>{if(!Array.isArray(l))throw new Error("Invalid settings Hook ownership");return l.map((c,a)=>({path:sn(t,i.root??"baseDir",i.path),entry:Wi(o,a,c)}))})),r=new Set(s.map(i=>i.path));return{product:Xe.packageName,packageVersion:n.packageVersion,runtime:n.runtime,scope:n.scope,language:n.language??t.language,installedAt:n.installedAt,files:n.files.map(i=>({path:sn(t,i.root??"baseDir",i.path),hash:i.hash})).filter(i=>!r.has(i.path)),sharedEntries:s,...n.common?{common:n.common}:{}}},encode(e,t){let n=new Map;for(let r of e.sharedEntries){if(r.entry.kind!=="json-hook")throw new Error("Unsupported frontend shared-entry schema");let i=n.get(r.path);i||(i={...Tc(t,r.path),hooks:{}},n.set(r.path,i)),(i.hooks[r.entry.event]??=[]).push(r.entry.value)}let s={packageVersion:e.packageVersion,runtime:e.runtime,scope:e.scope,language:e.language,installedAt:e.installedAt,files:e.files.map(r=>({...Tc(t,r.path),hash:r.hash})),...n.size?{settingsHooks:[...n.values()]}:{},...e.common?{common:e.common}:{}};return Buffer.from(JSON.stringify(s,null,2)+`
|
|
171
|
+
`)}}});function Fc(e){let t=["Runtime","Tier","Skills","Agents","Commands","Hooks","Rules","Templates","MCP","Reports","Init"],n=e.map(i=>{let o=on[i];if(!o)throw new Error(`Missing capability declaration for runtime: ${i}`);return[i,o.tier,at(o.skills),at(o.agents),at(o.commands),at(o.hooks),at(o.rules),at(o.templates),at(o.mcp),at(o.reports),o.init]}),s=t.map((i,o)=>Math.max(i.length,...n.map(l=>l[o].length))),r=i=>i.map((o,l)=>o.padEnd(s[l])).join(" ").trimEnd();return[r(t),...n.map(r)].join(`
|
|
172
|
+
`)}function at(e){return e?"yes":"no"}var on,Gi=K(()=>{"use strict";on={claude:{tier:"full",skills:!0,agents:!0,commands:!0,hooks:!0,rules:!0,templates:!0,mcp:!0,reports:!0,init:"native"},codex:{tier:"full",skills:!0,agents:!0,commands:!1,hooks:!1,rules:!0,templates:!0,mcp:!1,reports:!0,init:"native"},openclaw:{tier:"full",skills:!0,agents:!1,commands:!0,hooks:!1,rules:!1,templates:!0,mcp:!1,reports:!0,init:"native"},qoder:{tier:"full",skills:!0,agents:!0,commands:!0,hooks:!0,rules:!0,templates:!0,mcp:!1,reports:!0,init:"native"},opencode:{tier:"medium",skills:!0,agents:!1,commands:!0,hooks:!1,rules:!1,templates:!0,mcp:!1,reports:!0,init:"rules"},kilo:{tier:"medium",skills:!0,agents:!1,commands:!0,hooks:!1,rules:!1,templates:!1,mcp:!1,reports:!0,init:"rules"},cursor:{tier:"medium",skills:!0,agents:!1,commands:!1,hooks:!1,rules:!0,templates:!1,mcp:!1,reports:!0,init:"rules"},windsurf:{tier:"medium",skills:!0,agents:!1,commands:!0,hooks:!1,rules:!0,templates:!1,mcp:!1,reports:!0,init:"rules"},gemini:{tier:"medium",skills:!0,agents:!1,commands:!1,hooks:!1,rules:!1,templates:!0,mcp:!1,reports:!0,init:"rules"},copilot:{tier:"medium",skills:!1,agents:!1,commands:!0,hooks:!1,rules:!0,templates:!1,mcp:!1,reports:!0,init:"rules"},antigravity:{tier:"skills-rules-only",skills:!0,agents:!1,commands:!1,hooks:!1,rules:!1,templates:!1,mcp:!1,reports:!0,init:"none"},augment:{tier:"skills-rules-only",skills:!0,agents:!1,commands:!1,hooks:!1,rules:!1,templates:!1,mcp:!1,reports:!0,init:"none"},trae:{tier:"skills-rules-only",skills:!1,agents:!1,commands:!1,hooks:!1,rules:!0,templates:!1,mcp:!1,reports:!0,init:"none"},codebuddy:{tier:"skills-rules-only",skills:!0,agents:!1,commands:!1,hooks:!1,rules:!1,templates:!1,mcp:!1,reports:!0,init:"none"},cline:{tier:"skills-rules-only",skills:!1,agents:!1,commands:!1,hooks:!1,rules:!0,templates:!1,mcp:!1,reports:!0,init:"none"}}});import Pm from"node:os";function Rn(e){if((e.capabilities??on[e.runtime])?.skills)return Dt({runtime:e.runtime,cwd:e.cwd,home:e.home??Pm.homedir(),baseDir:e.baseDir,scope:e.isGlobal?"global":"local",env:{},compatibility:"frontend"}).skillsDir}var Hi=K(()=>{"use strict";ve();Gi()});import _c from"node:path";import $m from"node:fs";function lt(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{}}function Pc(e,t){if(!(t?t.exists(e):$m.existsSync(e)))return{};try{let n=JSON.parse(t?t.read(e).toString("utf8"):ze(e));if(n===null||typeof n!="object"||Array.isArray(n))throw new Error("Expected an object");return n}catch{throw new Error(`Cannot read settings JSON: ${e}. Existing settings were preserved; repair the file before installing.`)}}function nr(e,t){if(e.hooks!==void 0&&(e.hooks===null||typeof e.hooks!="object"||Array.isArray(e.hooks)))throw new Error("Invalid existing settings hooks; expected an object.");let n={...lt(e.hooks)};for(let[s,r]of Object.entries(t)){if(!Array.isArray(r))throw new Error(`Invalid hook entries: ${s}`);if(n[s]!==void 0&&!Array.isArray(n[s]))throw new Error(`Invalid existing settings hooks: ${s}`);let i=[...n[s]??[]];for(let o of r){let l=lt(o),c=zi(l),a=i.findIndex(p=>zi(lt(p))===c);if(a<0)i.push(o);else{i[a]=o;for(let p=i.length-1;p>a;p--)zi(lt(i[p]))===c&&i.splice(p,1)}}n[s]=i}return{...e,hooks:n}}function Qi(e,t){if(e.hooks!==void 0&&(e.hooks===null||typeof e.hooks!="object"||Array.isArray(e.hooks)))throw new Error("Invalid existing settings hooks; expected an object.");let n={...lt(e.hooks)};for(let[s,r]of Object.entries(t)){if(!Array.isArray(r)||!Array.isArray(n[s]))continue;let i=new Set(r.map(o=>JSON.stringify(o)));n[s]=n[s].filter(o=>!i.has(JSON.stringify(o)))}return{...e,hooks:n}}function zi(e){return JSON.stringify([e.matcher??"",Array.isArray(e.hooks)?e.hooks.map(t=>lt(t).command):e.hooks])}function sr(e,t={}){let n=e.session;if(!n)throw new Error("Settings writes require an explicit installation session");return{readSettings:s=>Pc(s,n),writeSettings(s,r,i={}){let l=Be(de(e.baseDir))?.settingsHooks?.filter(c=>(c.root??"baseDir")==="baseDir"&&c.path===_c.relative(e.baseDir,s).split(_c.sep).join("/"))??[];for(let[c,a]of Object.entries(t)){if(!Array.isArray(a))throw new Error("Invalid legacy Hook declarations");let p=new Set(l.flatMap(u=>(u.hooks[c]??[]).map(d=>Te({kind:"json-hook",value:d})))),f=a.filter(u=>!p.has(Te({kind:"json-hook",value:u})));if(f.length&&n.exists(s)){let u=Pc(s,n),d=Qi(u,{[c]:f});JSON.stringify(d)!==JSON.stringify(u)&&n.stage(s,Buffer.from(JSON.stringify(d,null,2)+`
|
|
173
|
+
`))}}for(let[c,a]of Object.entries(i)){if(!Array.isArray(a))throw new Error("Invalid owned Hook entries");a.forEach((p,f)=>n.editShared(s,Wi(c,f,p)))}}}}var Xi=K(()=>{"use strict";Z();ve();rn()});import H from"node:path";import Tt from"node:fs";function Mm(e,t){let n=H.resolve(e).split(H.sep).join("/");return t.replaceAll("${CLAUDE_PLUGIN_ROOT}",n).replaceAll("${FRONTEND_CRAFT_ROOT}",n)}function qm(e){let t=H.join(e,"hooks","hooks.json"),n=ze(t);return JSON.stringify(JSON.parse(n),(s,r)=>typeof r=="string"?Mm(e,r):r,2)}async function $c(e){let{pluginRoot:t,contentRoot:n,baseDir:s,dryRun:r,cwd:i,isGlobal:o}=e;if(r&&!e.session){console.log(`[dry-run] would install Claude Code files into ${s}`);return}let{ensureDir:l,copyProductSkills:c,copyDir:a,copyFile:p,retireManagedFile:f}=J(e),u=H.join(s,"settings.json"),{readSettings:d,writeSettings:m}=sr(e);d(u),l(s),c(H.join(n,"skills"),H.join(s,"skills")),a(H.join(n,"agents"),H.join(s,"agents")),a(H.join(n,"commands"),H.join(s,"commands")),o||a(H.join(n,"templates","shared","rules"),H.join(s,"rules"));let h=H.join(n,"templates","claude");if(Tt.existsSync(h))for(let w of Tt.readdirSync(h)){let v=H.join(s,w);Tt.existsSync(v)||p(H.join(h,w),v)}let g=lt(JSON.parse(qm(t)).hooks);if(m(u,nr(d(u),g),g),f(H.join(s,"hooks.json")),!o&&Tt.existsSync(H.join(t,".mcp.json"))){let w=H.join(i,".mcp.json");Tt.existsSync(w)||p(H.join(t,".mcp.json"),w)}let y=H.join(t,".claude-plugin","plugin.json");if(!o&&Tt.existsSync(y)){l(H.join(i,".claude-plugin")),p(y,H.join(i,".claude-plugin","plugin.json"));let w=H.join(t,".claude-plugin","marketplace.json");Tt.existsSync(w)&&p(w,H.join(i,".claude-plugin","marketplace.json"))}}var Mc=K(()=>{"use strict";Z();Xi()});var q=j(ae=>{"use strict";var Zi=Symbol.for("yaml.alias"),qc=Symbol.for("yaml.document"),rr=Symbol.for("yaml.map"),Bc=Symbol.for("yaml.pair"),eo=Symbol.for("yaml.scalar"),ir=Symbol.for("yaml.seq"),et=Symbol.for("yaml.node.type"),Bm=e=>!!e&&typeof e=="object"&&e[et]===Zi,Rm=e=>!!e&&typeof e=="object"&&e[et]===qc,Km=e=>!!e&&typeof e=="object"&&e[et]===rr,Um=e=>!!e&&typeof e=="object"&&e[et]===Bc,Rc=e=>!!e&&typeof e=="object"&&e[et]===eo,Jm=e=>!!e&&typeof e=="object"&&e[et]===ir;function Kc(e){if(e&&typeof e=="object")switch(e[et]){case rr:case ir:return!0}return!1}function Ym(e){if(e&&typeof e=="object")switch(e[et]){case Zi:case rr:case eo:case ir:return!0}return!1}var Vm=e=>(Rc(e)||Kc(e))&&!!e.anchor;ae.ALIAS=Zi;ae.DOC=qc;ae.MAP=rr;ae.NODE_TYPE=et;ae.PAIR=Bc;ae.SCALAR=eo;ae.SEQ=ir;ae.hasAnchor=Vm;ae.isAlias=Bm;ae.isCollection=Kc;ae.isDocument=Rm;ae.isMap=Km;ae.isNode=Ym;ae.isPair=Um;ae.isScalar=Rc;ae.isSeq=Jm});var Kn=j(to=>{"use strict";var re=q(),ge=Symbol("break visit"),Uc=Symbol("skip children"),Ke=Symbol("remove node");function or(e,t){let n=Jc(t);re.isDocument(e)?an(null,e.contents,n,Object.freeze([e]))===Ke&&(e.contents=null):an(null,e,n,Object.freeze([]))}or.BREAK=ge;or.SKIP=Uc;or.REMOVE=Ke;function an(e,t,n,s){let r=Yc(e,t,n,s);if(re.isNode(r)||re.isPair(r))return Vc(e,s,r),an(e,r,n,s);if(typeof r!="symbol"){if(re.isCollection(t)){s=Object.freeze(s.concat(t));for(let i=0;i<t.items.length;++i){let o=an(i,t.items[i],n,s);if(typeof o=="number")i=o-1;else{if(o===ge)return ge;o===Ke&&(t.items.splice(i,1),i-=1)}}}else if(re.isPair(t)){s=Object.freeze(s.concat(t));let i=an("key",t.key,n,s);if(i===ge)return ge;i===Ke&&(t.key=null);let o=an("value",t.value,n,s);if(o===ge)return ge;o===Ke&&(t.value=null)}}return r}async function ar(e,t){let n=Jc(t);re.isDocument(e)?await ln(null,e.contents,n,Object.freeze([e]))===Ke&&(e.contents=null):await ln(null,e,n,Object.freeze([]))}ar.BREAK=ge;ar.SKIP=Uc;ar.REMOVE=Ke;async function ln(e,t,n,s){let r=await Yc(e,t,n,s);if(re.isNode(r)||re.isPair(r))return Vc(e,s,r),ln(e,r,n,s);if(typeof r!="symbol"){if(re.isCollection(t)){s=Object.freeze(s.concat(t));for(let i=0;i<t.items.length;++i){let o=await ln(i,t.items[i],n,s);if(typeof o=="number")i=o-1;else{if(o===ge)return ge;o===Ke&&(t.items.splice(i,1),i-=1)}}}else if(re.isPair(t)){s=Object.freeze(s.concat(t));let i=await ln("key",t.key,n,s);if(i===ge)return ge;i===Ke&&(t.key=null);let o=await ln("value",t.value,n,s);if(o===ge)return ge;o===Ke&&(t.value=null)}}return r}function Jc(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function Yc(e,t,n,s){if(typeof n=="function")return n(e,t,s);if(re.isMap(t))return n.Map?.(e,t,s);if(re.isSeq(t))return n.Seq?.(e,t,s);if(re.isPair(t))return n.Pair?.(e,t,s);if(re.isScalar(t))return n.Scalar?.(e,t,s);if(re.isAlias(t))return n.Alias?.(e,t,s)}function Vc(e,t,n){let s=t[t.length-1];if(re.isCollection(s))s.items[e]=n;else if(re.isPair(s))e==="key"?s.key=n:s.value=n;else if(re.isDocument(s))s.contents=n;else{let r=re.isAlias(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}to.visit=or;to.visitAsync=ar});var no=j(Wc=>{"use strict";var xc=q(),xm=Kn(),Wm={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Gm=e=>e.replace(/[!,[\]{}]/g,t=>Wm[t]),Un=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:e.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},e.defaultTags),this.atNextDocument=!1);let s=t.trim().split(/[ \t]+/),r=s.shift();switch(r){case"%TAG":{if(s.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;let[i,o]=s;return this.tags[i]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[i]=s;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;{let o=/^\d+\.\d+$/.test(i);return n(6,`Unsupported YAML version ${i}`,o),!1}}default:return n(0,`Unknown directive ${r}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){let o=t.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}let[,s,r]=t.match(/^(.*!)([^!]*)$/s);r||n(`The ${t} tag has no suffix`);let i=this.tags[s];if(i)try{return i+decodeURIComponent(r)}catch(o){return n(String(o)),null}return s==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(let[n,s]of Object.entries(this.tags))if(t.startsWith(s))return n+Gm(t.substring(s.length));return t[0]==="!"?t:`!<${t}>`}toString(t){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags),r;if(t&&s.length>0&&xc.isNode(t.contents)){let i={};xm.visit(t.contents,(o,l)=>{xc.isNode(l)&&l.tag&&(i[l.tag]=!0)}),r=Object.keys(i)}else r=[];for(let[i,o]of s)i==="!!"&&o==="tag:yaml.org,2002:"||(!t||r.some(l=>l.startsWith(o)))&&n.push(`%TAG ${i} ${o}`);return n.join(`
|
|
174
|
+
`)}};Un.defaultYaml={explicit:!1,version:"1.2"};Un.defaultTags={"!!":"tag:yaml.org,2002:"};Wc.Directives=Un});var lr=j(Jn=>{"use strict";var Gc=q(),Hm=Kn();function zm(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function Hc(e){let t=new Set;return Hm.visit(e,{Value(n,s){s.anchor&&t.add(s.anchor)}}),t}function zc(e,t){for(let n=1;;++n){let s=`${e}${n}`;if(!t.has(s))return s}}function Qm(e,t){let n=[],s=new Map,r=null;return{onAnchor:i=>{n.push(i),r??(r=Hc(e));let o=zc(t,r);return r.add(o),o},setAnchors:()=>{for(let i of n){let o=s.get(i);if(typeof o=="object"&&o.anchor&&(Gc.isScalar(o.node)||Gc.isCollection(o.node)))o.node.anchor=o.anchor;else{let l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=i,l}}},sourceObjects:s}}Jn.anchorIsValid=zm;Jn.anchorNames=Hc;Jn.createNodeAnchors=Qm;Jn.findNewAnchor=zc});var so=j(Qc=>{"use strict";function Yn(e,t,n,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let r=0,i=s.length;r<i;++r){let o=s[r],l=Yn(e,s,String(r),o);l===void 0?delete s[r]:l!==o&&(s[r]=l)}else if(s instanceof Map)for(let r of Array.from(s.keys())){let i=s.get(r),o=Yn(e,s,r,i);o===void 0?s.delete(r):o!==i&&s.set(r,o)}else if(s instanceof Set)for(let r of Array.from(s)){let i=Yn(e,s,r,r);i===void 0?s.delete(r):i!==r&&(s.delete(r),s.add(i))}else for(let[r,i]of Object.entries(s)){let o=Yn(e,s,r,i);o===void 0?delete s[r]:o!==i&&(s[r]=o)}return e.call(t,n,s)}Qc.applyReviver=Yn});var ct=j(Zc=>{"use strict";var Xm=q();function Xc(e,t,n){if(Array.isArray(e))return e.map((s,r)=>Xc(s,String(r),n));if(e&&typeof e.toJSON=="function"){if(!n||!Xm.hasAnchor(e))return e.toJSON(t,n);let s={aliasCount:0,count:1,res:void 0};n.anchors.set(e,s),n.onCreate=i=>{s.res=i,delete n.onCreate};let r=e.toJSON(t,n);return n.onCreate&&n.onCreate(r),r}return typeof e=="bigint"&&!n?.keep?Number(e):e}Zc.toJS=Xc});var cr=j(tu=>{"use strict";var Zm=so(),eu=q(),eg=ct(),ro=class{constructor(t){Object.defineProperty(this,eu.NODE_TYPE,{value:t})}clone(){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:s,onAnchor:r,reviver:i}={}){if(!eu.isDocument(t))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},l=eg.toJS(this,"",o);if(typeof r=="function")for(let{count:c,res:a}of o.anchors.values())r(a,c);return typeof i=="function"?Zm.applyReviver(i,{"":l},"",l):l}};tu.NodeBase=ro});var Vn=j(nu=>{"use strict";var tg=lr(),ng=Kn(),cn=q(),sg=cr(),rg=ct(),io=class extends sg.NodeBase{constructor(t){super(cn.ALIAS),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let s;n?.aliasResolveCache?s=n.aliasResolveCache:(s=[],ng.visit(t,{Node:(i,o)=>{(cn.isAlias(o)||cn.hasAnchor(o))&&s.push(o)}}),n&&(n.aliasResolveCache=s));let r;for(let i of s){if(i===this)break;i.anchor===this.source&&(r=i)}return r}toJSON(t,n){if(!n)return{source:this.source};let{anchors:s,doc:r,maxAliasCount:i}=n,o=this.resolve(r,n);if(!o){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let l=s.get(o);if(l||(rg.toJS(o,null,n),l=s.get(o)),l?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(i>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=ur(r,o,s)),l.count*l.aliasCount>i)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return l.res}toString(t,n,s){let r=`*${this.source}`;if(t){if(tg.anchorIsValid(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){let i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(i)}if(t.implicitKey)return`${r} `}return r}};function ur(e,t,n){if(cn.isAlias(t)){let s=t.resolve(e),r=n&&s&&n.get(s);return r?r.count*r.aliasCount:0}else if(cn.isCollection(t)){let s=0;for(let r of t.items){let i=ur(e,r,n);i>s&&(s=i)}return s}else if(cn.isPair(t)){let s=ur(e,t.key,n),r=ur(e,t.value,n);return Math.max(s,r)}return 1}nu.Alias=io});var te=j(oo=>{"use strict";var ig=q(),og=cr(),ag=ct(),lg=e=>!e||typeof e!="function"&&typeof e!="object",ut=class extends og.NodeBase{constructor(t){super(ig.SCALAR),this.value=t}toJSON(t,n){return n?.keep?this.value:ag.toJS(this.value,t,n)}toString(){return String(this.value)}};ut.BLOCK_FOLDED="BLOCK_FOLDED";ut.BLOCK_LITERAL="BLOCK_LITERAL";ut.PLAIN="PLAIN";ut.QUOTE_DOUBLE="QUOTE_DOUBLE";ut.QUOTE_SINGLE="QUOTE_SINGLE";oo.Scalar=ut;oo.isScalarValue=lg});var xn=j(ru=>{"use strict";var cg=Vn(),Ft=q(),su=te(),ug="tag:yaml.org,2002:";function fg(e,t,n){if(t){let s=n.filter(i=>i.tag===t),r=s.find(i=>!i.format)??s[0];if(!r)throw new Error(`Tag ${t} not found`);return r}return n.find(s=>s.identify?.(e)&&!s.format)}function dg(e,t,n){if(Ft.isDocument(e)&&(e=e.contents),Ft.isNode(e))return e;if(Ft.isPair(e)){let f=n.schema[Ft.MAP].createNode?.(n.schema,null,n);return f.items.push(e),f}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:s,onAnchor:r,onTagObj:i,schema:o,sourceObjects:l}=n,c;if(s&&e&&typeof e=="object"){if(c=l.get(e),c)return c.anchor??(c.anchor=r(e)),new cg.Alias(c.anchor);c={anchor:null,node:null},l.set(e,c)}t?.startsWith("!!")&&(t=ug+t.slice(2));let a=fg(e,t,o.tags);if(!a){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){let f=new su.Scalar(e);return c&&(c.node=f),f}a=e instanceof Map?o[Ft.MAP]:Symbol.iterator in Object(e)?o[Ft.SEQ]:o[Ft.MAP]}i&&(i(a),delete n.onTagObj);let p=a?.createNode?a.createNode(n.schema,e,n):typeof a?.nodeClass?.from=="function"?a.nodeClass.from(n.schema,e,n):new su.Scalar(e);return t?p.tag=t:a.default||(p.tag=a.tag),c&&(c.node=p),p}ru.createNode=dg});var dr=j(fr=>{"use strict";var pg=xn(),Ue=q(),hg=cr();function ao(e,t,n){let s=n;for(let r=t.length-1;r>=0;--r){let i=t[r];if(typeof i=="number"&&Number.isInteger(i)&&i>=0){let o=[];o[i]=s,s=o}else s=new Map([[i,s]])}return pg.createNode(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}var iu=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done,lo=class extends hg.NodeBase{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(s=>Ue.isNode(s)||Ue.isPair(s)?s.clone(t):s),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(iu(t))this.add(n);else{let[s,...r]=t,i=this.get(s,!0);if(Ue.isCollection(i))i.addIn(r,n);else if(i===void 0&&this.schema)this.set(s,ao(this.schema,r,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${r}`)}}deleteIn(t){let[n,...s]=t;if(s.length===0)return this.delete(n);let r=this.get(n,!0);if(Ue.isCollection(r))return r.deleteIn(s);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${s}`)}getIn(t,n){let[s,...r]=t,i=this.get(s,!0);return r.length===0?!n&&Ue.isScalar(i)?i.value:i:Ue.isCollection(i)?i.getIn(r,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!Ue.isPair(n))return!1;let s=n.value;return s==null||t&&Ue.isScalar(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(t){let[n,...s]=t;if(s.length===0)return this.has(n);let r=this.get(n,!0);return Ue.isCollection(r)?r.hasIn(s):!1}setIn(t,n){let[s,...r]=t;if(r.length===0)this.set(s,n);else{let i=this.get(s,!0);if(Ue.isCollection(i))i.setIn(r,n);else if(i===void 0&&this.schema)this.set(s,ao(this.schema,r,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${r}`)}}};fr.Collection=lo;fr.collectionFromPath=ao;fr.isEmptyPath=iu});var Wn=j(pr=>{"use strict";var mg=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function co(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var gg=(e,t,n)=>e.endsWith(`
|
|
175
|
+
`)?co(n,t):n.includes(`
|
|
176
|
+
`)?`
|
|
177
|
+
`+co(n,t):(e.endsWith(" ")?"":" ")+n;pr.indentComment=co;pr.lineComment=gg;pr.stringifyComment=mg});var au=j(Gn=>{"use strict";var yg="flow",uo="block",hr="quoted";function wg(e,t,n="flow",{indentAtStart:s,lineWidth:r=80,minContentWidth:i=20,onFold:o,onOverflow:l}={}){if(!r||r<0)return e;r<i&&(i=0);let c=Math.max(1+i,1+r-t.length);if(e.length<=c)return e;let a=[],p={},f=r-t.length;typeof s=="number"&&(s>r-Math.max(2,i)?a.push(0):f=r-s);let u,d,m=!1,h=-1,g=-1,y=-1;n===uo&&(h=ou(e,h,t.length),h!==-1&&(f=h+c));for(let v;v=e[h+=1];){if(n===hr&&v==="\\"){switch(g=h,e[h+1]){case"x":h+=3;break;case"u":h+=5;break;case"U":h+=9;break;default:h+=1}y=h}if(v===`
|
|
178
|
+
`)n===uo&&(h=ou(e,h,t.length)),f=h+t.length+c,u=void 0;else{if(v===" "&&d&&d!==" "&&d!==`
|
|
179
|
+
`&&d!==" "){let S=e[h+1];S&&S!==" "&&S!==`
|
|
180
|
+
`&&S!==" "&&(u=h)}if(h>=f)if(u)a.push(u),f=u+c,u=void 0;else if(n===hr){for(;d===" "||d===" ";)d=v,v=e[h+=1],m=!0;let S=h>y+1?h-2:g-1;if(p[S])return e;a.push(S),p[S]=!0,f=S+c,u=void 0}else m=!0}d=v}if(m&&l&&l(),a.length===0)return e;o&&o();let w=e.slice(0,a[0]);for(let v=0;v<a.length;++v){let S=a[v],k=a[v+1]||e.length;S===0?w=`
|
|
181
|
+
${t}${e.slice(0,k)}`:(n===hr&&p[S]&&(w+=`${e[S]}\\`),w+=`
|
|
182
|
+
${t}${e.slice(S+1,k)}`)}return w}function ou(e,t,n){let s=t,r=t+1,i=e[r];for(;i===" "||i===" ";)if(t<r+n)i=e[++t];else{do i=e[++t];while(i&&i!==`
|
|
183
|
+
`);s=t,r=t+1,i=e[r]}return s}Gn.FOLD_BLOCK=uo;Gn.FOLD_FLOW=yg;Gn.FOLD_QUOTED=hr;Gn.foldFlowLines=wg});var zn=j(lu=>{"use strict";var _e=te(),ft=au(),gr=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),yr=e=>/^(%|---|\.\.\.)/m.test(e);function bg(e,t,n){if(!t||t<0)return!1;let s=t-n,r=e.length;if(r<=s)return!1;for(let i=0,o=0;i<r;++i)if(e[i]===`
|
|
184
|
+
`){if(i-o>s)return!0;if(o=i+1,r-o<=s)return!1}return!0}function Hn(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:s}=t,r=t.options.doubleQuotedMinMultiLineLength,i=t.indent||(yr(e)?" ":""),o="",l=0;for(let c=0,a=n[c];a;a=n[++c])if(a===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(o+=n.slice(l,c)+"\\ ",c+=1,l=c,a="\\"),a==="\\")switch(n[c+1]){case"u":{o+=n.slice(l,c);let p=n.substr(c+2,4);switch(p){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:p.substr(0,2)==="00"?o+="\\x"+p.substr(2):o+=n.substr(c,6)}c+=5,l=c+1}break;case"n":if(s||n[c+2]==='"'||n.length<r)c+=1;else{for(o+=n.slice(l,c)+`
|
|
185
|
+
|
|
186
|
+
`;n[c+2]==="\\"&&n[c+3]==="n"&&n[c+4]!=='"';)o+=`
|
|
187
|
+
`,c+=2;o+=i,n[c+2]===" "&&(o+="\\"),c+=1,l=c+1}break;default:c+=1}return o=l?o+n.slice(l):n,s?o:ft.foldFlowLines(o,i,ft.FOLD_QUOTED,gr(t,!1))}function fo(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
188
|
+
`)||/[ \t]\n|\n[ \t]/.test(e))return Hn(e,t);let n=t.indent||(yr(e)?" ":""),s="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
189
|
+
${n}`)+"'";return t.implicitKey?s:ft.foldFlowLines(s,n,ft.FOLD_FLOW,gr(t,!1))}function un(e,t){let{singleQuote:n}=t.options,s;if(n===!1)s=Hn;else{let r=e.includes('"'),i=e.includes("'");r&&!i?s=fo:i&&!r?s=Hn:s=n?fo:Hn}return s(e,t)}var po;try{po=new RegExp(`(^|(?<!
|
|
190
|
+
))
|
|
191
|
+
+(?!
|
|
192
|
+
|$)`,"g")}catch{po=/\n+(?!\n|$)/g}function mr({comment:e,type:t,value:n},s,r,i){let{blockQuote:o,commentString:l,lineWidth:c}=s.options;if(!o||/\n[\t ]+$/.test(n))return un(n,s);let a=s.indent||(s.forceBlockIndent||yr(n)?" ":""),p=o==="literal"?!0:o==="folded"||t===_e.Scalar.BLOCK_FOLDED?!1:t===_e.Scalar.BLOCK_LITERAL?!0:!bg(n,c,a.length);if(!n)return p?`|
|
|
193
|
+
`:`>
|
|
194
|
+
`;let f,u;for(u=n.length;u>0;--u){let k=n[u-1];if(k!==`
|
|
195
|
+
`&&k!==" "&&k!==" ")break}let d=n.substring(u),m=d.indexOf(`
|
|
196
|
+
`);m===-1?f="-":n===d||m!==d.length-1?(f="+",i&&i()):f="",d&&(n=n.slice(0,-d.length),d[d.length-1]===`
|
|
197
|
+
`&&(d=d.slice(0,-1)),d=d.replace(po,`$&${a}`));let h=!1,g,y=-1;for(g=0;g<n.length;++g){let k=n[g];if(k===" ")h=!0;else if(k===`
|
|
198
|
+
`)y=g;else break}let w=n.substring(0,y<g?y+1:g);w&&(n=n.substring(w.length),w=w.replace(/\n+/g,`$&${a}`));let S=(h?a?"2":"1":"")+f;if(e&&(S+=" "+l(e.replace(/ ?[\r\n]+/g," ")),r&&r()),!p){let k=n.replace(/\n+/g,`
|
|
199
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${a}`),b=!1,E=gr(s,!0);o!=="folded"&&t!==_e.Scalar.BLOCK_FOLDED&&(E.onOverflow=()=>{b=!0});let C=ft.foldFlowLines(`${w}${k}${d}`,a,ft.FOLD_BLOCK,E);if(!b)return`>${S}
|
|
200
|
+
${a}${C}`}return n=n.replace(/\n+/g,`$&${a}`),`|${S}
|
|
201
|
+
${a}${w}${n}${d}`}function vg(e,t,n,s){let{type:r,value:i}=e,{actualString:o,implicitKey:l,indent:c,indentStep:a,inFlow:p}=t;if(l&&i.includes(`
|
|
202
|
+
`)||p&&/[[\]{},]/.test(i))return un(i,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return l||p||!i.includes(`
|
|
203
|
+
`)?un(i,t):mr(e,t,n,s);if(!l&&!p&&r!==_e.Scalar.PLAIN&&i.includes(`
|
|
204
|
+
`))return mr(e,t,n,s);if(yr(i)){if(c==="")return t.forceBlockIndent=!0,mr(e,t,n,s);if(l&&c===a)return un(i,t)}let f=i.replace(/\n+/g,`$&
|
|
205
|
+
${c}`);if(o){let u=h=>h.default&&h.tag!=="tag:yaml.org,2002:str"&&h.test?.test(f),{compat:d,tags:m}=t.doc.schema;if(m.some(u)||d?.some(u))return un(i,t)}return l?f:ft.foldFlowLines(f,c,ft.FOLD_FLOW,gr(t,!1))}function Sg(e,t,n,s){let{implicitKey:r,inFlow:i}=t,o=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)}),{type:l}=e;l!==_e.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(l=_e.Scalar.QUOTE_DOUBLE);let c=p=>{switch(p){case _e.Scalar.BLOCK_FOLDED:case _e.Scalar.BLOCK_LITERAL:return r||i?un(o.value,t):mr(o,t,n,s);case _e.Scalar.QUOTE_DOUBLE:return Hn(o.value,t);case _e.Scalar.QUOTE_SINGLE:return fo(o.value,t);case _e.Scalar.PLAIN:return vg(o,t,n,s);default:return null}},a=c(l);if(a===null){let{defaultKeyType:p,defaultStringType:f}=t.options,u=r&&p||f;if(a=c(u),a===null)throw new Error(`Unsupported default string type ${u}`)}return a}lu.stringifyString=Sg});var Qn=j(ho=>{"use strict";var kg=lr(),dt=q(),Eg=Wn(),Cg=zn();function Ag(e,t){let n=Object.assign({blockQuote:!0,commentString:Eg.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t),s;switch(n.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:s,options:n}}function Ng(e,t){if(t.tag){let r=e.filter(i=>i.tag===t.tag);if(r.length>0)return r.find(i=>i.format===t.format)??r[0]}let n,s;if(dt.isScalar(t)){s=t.value;let r=e.filter(i=>i.identify?.(s));if(r.length>1){let i=r.filter(o=>o.test);i.length>0&&(r=i)}n=r.find(i=>i.format===t.format)??r.find(i=>!i.format)}else s=t,n=e.find(r=>r.nodeClass&&s instanceof r.nodeClass);if(!n){let r=s?.constructor?.name??(s===null?"null":typeof s);throw new Error(`Tag not resolved for ${r} value`)}return n}function Og(e,t,{anchors:n,doc:s}){if(!s.directives)return"";let r=[],i=(dt.isScalar(e)||dt.isCollection(e))&&e.anchor;i&&kg.anchorIsValid(i)&&(n.add(i),r.push(`&${i}`));let o=e.tag??(t.default?null:t.tag);return o&&r.push(s.directives.tagString(o)),r.join(" ")}function Ig(e,t,n,s){if(dt.isPair(e))return e.toString(t,n,s);if(dt.isAlias(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let r,i=dt.isNode(e)?e:t.doc.createNode(e,{onTagObj:c=>r=c});r??(r=Ng(t.doc.schema.tags,i));let o=Og(i,r,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let l=typeof r.stringify=="function"?r.stringify(i,t,n,s):dt.isScalar(i)?Cg.stringifyString(i,t,n,s):i.toString(t,n,s);return o?dt.isScalar(i)||l[0]==="{"||l[0]==="["?`${o} ${l}`:`${o}
|
|
206
|
+
${t.indent}${l}`:l}ho.createStringifyContext=Ag;ho.stringify=Ig});var du=j(fu=>{"use strict";var tt=q(),cu=te(),uu=Qn(),Xn=Wn();function jg({key:e,value:t},n,s,r){let{allNullValues:i,doc:o,indent:l,indentStep:c,options:{commentString:a,indentSeq:p,simpleKeys:f}}=n,u=tt.isNode(e)&&e.comment||null;if(f){if(u)throw new Error("With simple keys, key nodes cannot have comments");if(tt.isCollection(e)||!tt.isNode(e)&&typeof e=="object"){let E="With simple keys, collection cannot be used as a key value";throw new Error(E)}}let d=!f&&(!e||u&&t==null&&!n.inFlow||tt.isCollection(e)||(tt.isScalar(e)?e.type===cu.Scalar.BLOCK_FOLDED||e.type===cu.Scalar.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!d&&(f||!i),indent:l+c});let m=!1,h=!1,g=uu.stringify(e,n,()=>m=!0,()=>h=!0);if(!d&&!n.inFlow&&g.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");d=!0}if(n.inFlow){if(i||t==null)return m&&s&&s(),g===""?"?":d?`? ${g}`:g}else if(i&&!f||t==null&&d)return g=`? ${g}`,u&&!m?g+=Xn.lineComment(g,n.indent,a(u)):h&&r&&r(),g;m&&(u=null),d?(u&&(g+=Xn.lineComment(g,n.indent,a(u))),g=`? ${g}
|
|
207
|
+
${l}:`):(g=`${g}:`,u&&(g+=Xn.lineComment(g,n.indent,a(u))));let y,w,v;tt.isNode(t)?(y=!!t.spaceBefore,w=t.commentBefore,v=t.comment):(y=!1,w=null,v=null,t&&typeof t=="object"&&(t=o.createNode(t))),n.implicitKey=!1,!d&&!u&&tt.isScalar(t)&&(n.indentAtStart=g.length+1),h=!1,!p&&c.length>=2&&!n.inFlow&&!d&&tt.isSeq(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let S=!1,k=uu.stringify(t,n,()=>S=!0,()=>h=!0),b=" ";if(u||y||w){if(b=y?`
|
|
208
|
+
`:"",w){let E=a(w);b+=`
|
|
209
|
+
${Xn.indentComment(E,n.indent)}`}k===""&&!n.inFlow?b===`
|
|
210
|
+
`&&v&&(b=`
|
|
211
|
+
|
|
212
|
+
`):b+=`
|
|
213
|
+
${n.indent}`}else if(!d&&tt.isCollection(t)){let E=k[0],C=k.indexOf(`
|
|
214
|
+
`),A=C!==-1,N=n.inFlow??t.flow??t.items.length===0;if(A||!N){let O=!1;if(A&&(E==="&"||E==="!")){let I=k.indexOf(" ");E==="&"&&I!==-1&&I<C&&k[I+1]==="!"&&(I=k.indexOf(" ",I+1)),(I===-1||C<I)&&(O=!0)}O||(b=`
|
|
215
|
+
${n.indent}`)}}else(k===""||k[0]===`
|
|
216
|
+
`)&&(b="");return g+=b+k,n.inFlow?S&&s&&s():v&&!S?g+=Xn.lineComment(g,n.indent,a(v)):h&&r&&r(),g}fu.stringifyPair=jg});var go=j(mo=>{"use strict";var pu=Es("process");function Dg(e,...t){e==="debug"&&console.log(...t)}function Lg(e,t){(e==="debug"||e==="warn")&&(typeof pu.emitWarning=="function"?pu.emitWarning(t):console.warn(t))}mo.debug=Dg;mo.warn=Lg});var kr=j(Sr=>{"use strict";var vr=q(),hu=te(),wr="<<",br={identify:e=>e===wr||typeof e=="symbol"&&e.description===wr,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new hu.Scalar(Symbol(wr)),{addToJSMap:mu}),stringify:()=>wr},Tg=(e,t)=>(br.identify(t)||vr.isScalar(t)&&(!t.type||t.type===hu.Scalar.PLAIN)&&br.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===br.tag&&n.default);function mu(e,t,n){let s=gu(e,n);if(vr.isSeq(s))for(let r of s.items)yo(e,t,r);else if(Array.isArray(s))for(let r of s)yo(e,t,r);else yo(e,t,s)}function yo(e,t,n){let s=gu(e,n);if(!vr.isMap(s))throw new Error("Merge sources must be maps or map aliases");let r=s.toJSON(null,e,Map);for(let[i,o]of r)t instanceof Map?t.has(i)||t.set(i,o):t instanceof Set?t.add(i):Object.prototype.hasOwnProperty.call(t,i)||Object.defineProperty(t,i,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function gu(e,t){return e&&vr.isAlias(t)?t.resolve(e.doc,e):t}Sr.addMergeToJSMap=mu;Sr.isMergeKey=Tg;Sr.merge=br});var bo=j(bu=>{"use strict";var Fg=go(),yu=kr(),_g=Qn(),wu=q(),wo=ct();function Pg(e,t,{key:n,value:s}){if(wu.isNode(n)&&n.addToJSMap)n.addToJSMap(e,t,s);else if(yu.isMergeKey(e,n))yu.addMergeToJSMap(e,t,s);else{let r=wo.toJS(n,"",e);if(t instanceof Map)t.set(r,wo.toJS(s,r,e));else if(t instanceof Set)t.add(r);else{let i=$g(n,r,e),o=wo.toJS(s,i,e);i in t?Object.defineProperty(t,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[i]=o}}return t}function $g(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(wu.isNode(e)&&n?.doc){let s=_g.createStringifyContext(n.doc,{});s.anchors=new Set;for(let i of n.anchors.keys())s.anchors.add(i.anchor);s.inFlow=!0,s.inStringifyKey=!0;let r=e.toString(s);if(!n.mapKeyWarned){let i=JSON.stringify(r);i.length>40&&(i=i.substring(0,36)+'..."'),Fg.warn(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${i}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}bu.addPairToJSMap=Pg});var pt=j(vo=>{"use strict";var vu=xn(),Mg=du(),qg=bo(),Er=q();function Bg(e,t,n){let s=vu.createNode(e,void 0,n),r=vu.createNode(t,void 0,n);return new Cr(s,r)}var Cr=class e{constructor(t,n=null){Object.defineProperty(this,Er.NODE_TYPE,{value:Er.PAIR}),this.key=t,this.value=n}clone(t){let{key:n,value:s}=this;return Er.isNode(n)&&(n=n.clone(t)),Er.isNode(s)&&(s=s.clone(t)),new e(n,s)}toJSON(t,n){let s=n?.mapAsMap?new Map:{};return qg.addPairToJSMap(n,s,this)}toString(t,n,s){return t?.doc?Mg.stringifyPair(this,t,n,s):JSON.stringify(this)}};vo.Pair=Cr;vo.createPair=Bg});var So=j(ku=>{"use strict";var _t=q(),Su=Qn(),Ar=Wn();function Rg(e,t,n){return(t.inFlow??e.flow?Ug:Kg)(e,t,n)}function Kg({comment:e,items:t},n,{blockItemPrefix:s,flowChars:r,itemIndent:i,onChompKeep:o,onComment:l}){let{indent:c,options:{commentString:a}}=n,p=Object.assign({},n,{indent:i,type:null}),f=!1,u=[];for(let m=0;m<t.length;++m){let h=t[m],g=null;if(_t.isNode(h))!f&&h.spaceBefore&&u.push(""),Nr(n,u,h.commentBefore,f),h.comment&&(g=h.comment);else if(_t.isPair(h)){let w=_t.isNode(h.key)?h.key:null;w&&(!f&&w.spaceBefore&&u.push(""),Nr(n,u,w.commentBefore,f))}f=!1;let y=Su.stringify(h,p,()=>g=null,()=>f=!0);g&&(y+=Ar.lineComment(y,i,a(g))),f&&g&&(f=!1),u.push(s+y)}let d;if(u.length===0)d=r.start+r.end;else{d=u[0];for(let m=1;m<u.length;++m){let h=u[m];d+=h?`
|
|
217
|
+
${c}${h}`:`
|
|
218
|
+
`}}return e?(d+=`
|
|
219
|
+
`+Ar.indentComment(a(e),c),l&&l()):f&&o&&o(),d}function Ug({items:e},t,{flowChars:n,itemIndent:s}){let{indent:r,indentStep:i,flowCollectionPadding:o,options:{commentString:l}}=t;s+=i;let c=Object.assign({},t,{indent:s,inFlow:!0,type:null}),a=!1,p=0,f=[];for(let m=0;m<e.length;++m){let h=e[m],g=null;if(_t.isNode(h))h.spaceBefore&&f.push(""),Nr(t,f,h.commentBefore,!1),h.comment&&(g=h.comment);else if(_t.isPair(h)){let w=_t.isNode(h.key)?h.key:null;w&&(w.spaceBefore&&f.push(""),Nr(t,f,w.commentBefore,!1),w.comment&&(a=!0));let v=_t.isNode(h.value)?h.value:null;v?(v.comment&&(g=v.comment),v.commentBefore&&(a=!0)):h.value==null&&w?.comment&&(g=w.comment)}g&&(a=!0);let y=Su.stringify(h,c,()=>g=null);a||(a=f.length>p||y.includes(`
|
|
220
|
+
`)),m<e.length-1?y+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(a||(a=f.reduce((w,v)=>w+v.length+2,2)+(y.length+2)>t.options.lineWidth)),a&&(y+=",")),g&&(y+=Ar.lineComment(y,s,l(g))),f.push(y),p=f.length}let{start:u,end:d}=n;if(f.length===0)return u+d;if(!a){let m=f.reduce((h,g)=>h+g.length+2,2);a=t.options.lineWidth>0&&m>t.options.lineWidth}if(a){let m=u;for(let h of f)m+=h?`
|
|
221
|
+
${i}${r}${h}`:`
|
|
222
|
+
`;return`${m}
|
|
223
|
+
${r}${d}`}else return`${u}${o}${f.join(" ")}${o}${d}`}function Nr({indent:e,options:{commentString:t}},n,s,r){if(s&&r&&(s=s.replace(/^\n+/,"")),s){let i=Ar.indentComment(t(s),e);n.push(i.trimStart())}}ku.stringifyCollection=Rg});var mt=j(Eo=>{"use strict";var Jg=So(),Yg=bo(),Vg=dr(),ht=q(),Or=pt(),xg=te();function Zn(e,t){let n=ht.isScalar(t)?t.value:t;for(let s of e)if(ht.isPair(s)&&(s.key===t||s.key===n||ht.isScalar(s.key)&&s.key.value===n))return s}var ko=class extends Vg.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(ht.MAP,t),this.items=[]}static from(t,n,s){let{keepUndefined:r,replacer:i}=s,o=new this(t),l=(c,a)=>{if(typeof i=="function")a=i.call(n,c,a);else if(Array.isArray(i)&&!i.includes(c))return;(a!==void 0||r)&&o.items.push(Or.createPair(c,a,s))};if(n instanceof Map)for(let[c,a]of n)l(c,a);else if(n&&typeof n=="object")for(let c of Object.keys(n))l(c,n[c]);return typeof t.sortMapEntries=="function"&&o.items.sort(t.sortMapEntries),o}add(t,n){let s;ht.isPair(t)?s=t:!t||typeof t!="object"||!("key"in t)?s=new Or.Pair(t,t?.value):s=new Or.Pair(t.key,t.value);let r=Zn(this.items,s.key),i=this.schema?.sortMapEntries;if(r){if(!n)throw new Error(`Key ${s.key} already set`);ht.isScalar(r.value)&&xg.isScalarValue(s.value)?r.value.value=s.value:r.value=s.value}else if(i){let o=this.items.findIndex(l=>i(s,l)<0);o===-1?this.items.push(s):this.items.splice(o,0,s)}else this.items.push(s)}delete(t){let n=Zn(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){let r=Zn(this.items,t)?.value;return(!n&&ht.isScalar(r)?r.value:r)??void 0}has(t){return!!Zn(this.items,t)}set(t,n){this.add(new Or.Pair(t,n),!0)}toJSON(t,n,s){let r=s?new s:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(r);for(let i of this.items)Yg.addPairToJSMap(n,r,i);return r}toString(t,n,s){if(!t)return JSON.stringify(this);for(let r of this.items)if(!ht.isPair(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),Jg.stringifyCollection(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:s,onComment:n})}};Eo.YAMLMap=ko;Eo.findPair=Zn});var fn=j(Cu=>{"use strict";var Wg=q(),Eu=mt(),Gg={collection:"map",default:!0,nodeClass:Eu.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(e,t){return Wg.isMap(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Eu.YAMLMap.from(e,t,n)};Cu.map=Gg});var gt=j(Au=>{"use strict";var Hg=xn(),zg=So(),Qg=dr(),jr=q(),Xg=te(),Zg=ct(),Co=class extends Qg.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(jr.SEQ,t),this.items=[]}add(t){this.items.push(t)}delete(t){let n=Ir(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){let s=Ir(t);if(typeof s!="number")return;let r=this.items[s];return!n&&jr.isScalar(r)?r.value:r}has(t){let n=Ir(t);return typeof n=="number"&&n<this.items.length}set(t,n){let s=Ir(t);if(typeof s!="number")throw new Error(`Expected a valid index, not ${t}.`);let r=this.items[s];jr.isScalar(r)&&Xg.isScalarValue(n)?r.value=n:this.items[s]=n}toJSON(t,n){let s=[];n?.onCreate&&n.onCreate(s);let r=0;for(let i of this.items)s.push(Zg.toJS(i,String(r++),n));return s}toString(t,n,s){return t?zg.stringifyCollection(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:s,onComment:n}):JSON.stringify(this)}static from(t,n,s){let{replacer:r}=s,i=new this(t);if(n&&Symbol.iterator in Object(n)){let o=0;for(let l of n){if(typeof r=="function"){let c=n instanceof Set?l:String(o++);l=r.call(n,c,l)}i.items.push(Hg.createNode(l,void 0,s))}}return i}};function Ir(e){let t=jr.isScalar(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}Au.YAMLSeq=Co});var dn=j(Ou=>{"use strict";var ey=q(),Nu=gt(),ty={collection:"seq",default:!0,nodeClass:Nu.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(e,t){return ey.isSeq(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Nu.YAMLSeq.from(e,t,n)};Ou.seq=ty});var es=j(Iu=>{"use strict";var ny=zn(),sy={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,s){return t=Object.assign({actualString:!0},t),ny.stringifyString(e,t,n,s)}};Iu.string=sy});var Dr=j(Lu=>{"use strict";var ju=te(),Du={identify:e=>e==null,createNode:()=>new ju.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new ju.Scalar(null),stringify:({source:e},t)=>typeof e=="string"&&Du.test.test(e)?e:t.options.nullStr};Lu.nullTag=Du});var Ao=j(Fu=>{"use strict";var ry=te(),Tu={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new ry.Scalar(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&Tu.test.test(e)){let s=e[0]==="t"||e[0]==="T";if(t===s)return e}return t?n.options.trueStr:n.options.falseStr}};Fu.boolTag=Tu});var pn=j(_u=>{"use strict";function iy({format:e,minFractionDigits:t,tag:n,value:s}){if(typeof s=="bigint")return String(s);let r=typeof s=="number"?s:Number(s);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let i=Object.is(s,-0)?"-0":JSON.stringify(s);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(i)&&!i.includes("e")){let o=i.indexOf(".");o<0&&(o=i.length,i+=".");let l=t-(i.length-o-1);for(;l-- >0;)i+="0"}return i}_u.stringifyNumber=iy});var Oo=j(Lr=>{"use strict";var oy=te(),No=pn(),ay={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:No.stringifyNumber},ly={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():No.stringifyNumber(e)}},cy={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new oy.Scalar(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:No.stringifyNumber};Lr.float=cy;Lr.floatExp=ly;Lr.floatNaN=ay});var jo=j(Fr=>{"use strict";var Pu=pn(),Tr=e=>typeof e=="bigint"||Number.isInteger(e),Io=(e,t,n,{intAsBigInt:s})=>s?BigInt(e):parseInt(e.substring(t),n);function $u(e,t,n){let{value:s}=e;return Tr(s)&&s>=0?n+s.toString(t):Pu.stringifyNumber(e)}var uy={identify:e=>Tr(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Io(e,2,8,n),stringify:e=>$u(e,8,"0o")},fy={identify:Tr,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Io(e,0,10,n),stringify:Pu.stringifyNumber},dy={identify:e=>Tr(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Io(e,2,16,n),stringify:e=>$u(e,16,"0x")};Fr.int=fy;Fr.intHex=dy;Fr.intOct=uy});var qu=j(Mu=>{"use strict";var py=fn(),hy=Dr(),my=dn(),gy=es(),yy=Ao(),Do=Oo(),Lo=jo(),wy=[py.map,my.seq,gy.string,hy.nullTag,yy.boolTag,Lo.intOct,Lo.int,Lo.intHex,Do.floatNaN,Do.floatExp,Do.float];Mu.schema=wy});var Ku=j(Ru=>{"use strict";var by=te(),vy=fn(),Sy=dn();function Bu(e){return typeof e=="bigint"||Number.isInteger(e)}var _r=({value:e})=>JSON.stringify(e),ky=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:_r},{identify:e=>e==null,createNode:()=>new by.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:_r},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:_r},{identify:Bu,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Bu(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:_r}],Ey={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},Cy=[vy.map,Sy.seq].concat(ky,Ey);Ru.schema=Cy});var Fo=j(Uu=>{"use strict";var ts=Es("buffer"),To=te(),Ay=zn(),Ny={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof ts.Buffer=="function")return ts.Buffer.from(e,"base64");if(typeof atob=="function"){let n=atob(e.replace(/[\n\r]/g,"")),s=new Uint8Array(n.length);for(let r=0;r<n.length;++r)s[r]=n.charCodeAt(r);return s}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},s,r,i){if(!n)return"";let o=n,l;if(typeof ts.Buffer=="function")l=o instanceof ts.Buffer?o.toString("base64"):ts.Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let c="";for(let a=0;a<o.length;++a)c+=String.fromCharCode(o[a]);l=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=To.Scalar.BLOCK_LITERAL),t!==To.Scalar.QUOTE_DOUBLE){let c=Math.max(s.options.lineWidth-s.indent.length,s.options.minContentWidth),a=Math.ceil(l.length/c),p=new Array(a);for(let f=0,u=0;f<a;++f,u+=c)p[f]=l.substr(u,c);l=p.join(t===To.Scalar.BLOCK_LITERAL?`
|
|
224
|
+
`:" ")}return Ay.stringifyString({comment:e,type:t,value:l},s,r,i)}};Uu.binary=Ny});var Mr=j($r=>{"use strict";var Pr=q(),_o=pt(),Oy=te(),Iy=gt();function Ju(e,t){if(Pr.isSeq(e))for(let n=0;n<e.items.length;++n){let s=e.items[n];if(!Pr.isPair(s)){if(Pr.isMap(s)){s.items.length>1&&t("Each pair must have its own sequence indicator");let r=s.items[0]||new _o.Pair(new Oy.Scalar(null));if(s.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${s.commentBefore}
|
|
225
|
+
${r.key.commentBefore}`:s.commentBefore),s.comment){let i=r.value??r.key;i.comment=i.comment?`${s.comment}
|
|
226
|
+
${i.comment}`:s.comment}s=r}e.items[n]=Pr.isPair(s)?s:new _o.Pair(s)}}else t("Expected a sequence for this tag");return e}function Yu(e,t,n){let{replacer:s}=n,r=new Iy.YAMLSeq(e);r.tag="tag:yaml.org,2002:pairs";let i=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof s=="function"&&(o=s.call(t,String(i++),o));let l,c;if(Array.isArray(o))if(o.length===2)l=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let a=Object.keys(o);if(a.length===1)l=a[0],c=o[l];else throw new TypeError(`Expected tuple with one key, not ${a.length} keys`)}else l=o;r.items.push(_o.createPair(l,c,n))}return r}var jy={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Ju,createNode:Yu};$r.createPairs=Yu;$r.pairs=jy;$r.resolvePairs=Ju});var Mo=j($o=>{"use strict";var Vu=q(),Po=ct(),ns=mt(),Dy=gt(),xu=Mr(),Pt=class e extends Dy.YAMLSeq{constructor(){super(),this.add=ns.YAMLMap.prototype.add.bind(this),this.delete=ns.YAMLMap.prototype.delete.bind(this),this.get=ns.YAMLMap.prototype.get.bind(this),this.has=ns.YAMLMap.prototype.has.bind(this),this.set=ns.YAMLMap.prototype.set.bind(this),this.tag=e.tag}toJSON(t,n){if(!n)return super.toJSON(t);let s=new Map;n?.onCreate&&n.onCreate(s);for(let r of this.items){let i,o;if(Vu.isPair(r)?(i=Po.toJS(r.key,"",n),o=Po.toJS(r.value,i,n)):i=Po.toJS(r,"",n),s.has(i))throw new Error("Ordered maps must not include duplicate keys");s.set(i,o)}return s}static from(t,n,s){let r=xu.createPairs(t,n,s),i=new this;return i.items=r.items,i}};Pt.tag="tag:yaml.org,2002:omap";var Ly={collection:"seq",identify:e=>e instanceof Map,nodeClass:Pt,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let n=xu.resolvePairs(e,t),s=[];for(let{key:r}of n.items)Vu.isScalar(r)&&(s.includes(r.value)?t(`Ordered maps must not include duplicate keys: ${r.value}`):s.push(r.value));return Object.assign(new Pt,n)},createNode:(e,t,n)=>Pt.from(e,t,n)};$o.YAMLOMap=Pt;$o.omap=Ly});var Qu=j(qo=>{"use strict";var Wu=te();function Gu({value:e,source:t},n){return t&&(e?Hu:zu).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var Hu={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Wu.Scalar(!0),stringify:Gu},zu={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Wu.Scalar(!1),stringify:Gu};qo.falseTag=zu;qo.trueTag=Hu});var Xu=j(qr=>{"use strict";var Ty=te(),Bo=pn(),Fy={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Bo.stringifyNumber},_y={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():Bo.stringifyNumber(e)}},Py={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new Ty.Scalar(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){let s=e.substring(n+1).replace(/_/g,"");s[s.length-1]==="0"&&(t.minFractionDigits=s.length)}return t},stringify:Bo.stringifyNumber};qr.float=Py;qr.floatExp=_y;qr.floatNaN=Fy});var ef=j(rs=>{"use strict";var Zu=pn(),ss=e=>typeof e=="bigint"||Number.isInteger(e);function Br(e,t,n,{intAsBigInt:s}){let r=e[0];if((r==="-"||r==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),s){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let o=BigInt(e);return r==="-"?BigInt(-1)*o:o}let i=parseInt(e,n);return r==="-"?-1*i:i}function Ro(e,t,n){let{value:s}=e;if(ss(s)){let r=s.toString(t);return s<0?"-"+n+r.substr(1):n+r}return Zu.stringifyNumber(e)}var $y={identify:ss,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Br(e,2,2,n),stringify:e=>Ro(e,2,"0b")},My={identify:ss,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Br(e,1,8,n),stringify:e=>Ro(e,8,"0")},qy={identify:ss,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Br(e,0,10,n),stringify:Zu.stringifyNumber},By={identify:ss,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Br(e,2,16,n),stringify:e=>Ro(e,16,"0x")};rs.int=qy;rs.intBin=$y;rs.intHex=By;rs.intOct=My});var Uo=j(Ko=>{"use strict";var Ur=q(),Rr=pt(),Kr=mt(),$t=class e extends Kr.YAMLMap{constructor(t){super(t),this.tag=e.tag}add(t){let n;Ur.isPair(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Rr.Pair(t.key,null):n=new Rr.Pair(t,null),Kr.findPair(this.items,n.key)||this.items.push(n)}get(t,n){let s=Kr.findPair(this.items,t);return!n&&Ur.isPair(s)?Ur.isScalar(s.key)?s.key.value:s.key:s}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let s=Kr.findPair(this.items,t);s&&!n?this.items.splice(this.items.indexOf(s),1):!s&&n&&this.items.push(new Rr.Pair(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,s){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,s);throw new Error("Set items must all have null values")}static from(t,n,s){let{replacer:r}=s,i=new this(t);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof r=="function"&&(o=r.call(n,o,o)),i.items.push(Rr.createPair(o,null,s));return i}};$t.tag="tag:yaml.org,2002:set";var Ry={collection:"map",identify:e=>e instanceof Set,nodeClass:$t,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>$t.from(e,t,n),resolve(e,t){if(Ur.isMap(e)){if(e.hasAllNullValues(!0))return Object.assign(new $t,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};Ko.YAMLSet=$t;Ko.set=Ry});var Yo=j(Jr=>{"use strict";var Ky=pn();function Jo(e,t){let n=e[0],s=n==="-"||n==="+"?e.substring(1):e,r=o=>t?BigInt(o):Number(o),i=s.replace(/_/g,"").split(":").reduce((o,l)=>o*r(60)+r(l),r(0));return n==="-"?r(-1)*i:i}function tf(e){let{value:t}=e,n=o=>o;if(typeof t=="bigint")n=o=>BigInt(o);else if(isNaN(t)||!isFinite(t))return Ky.stringifyNumber(e);let s="";t<0&&(s="-",t*=n(-1));let r=n(60),i=[t%r];return t<60?i.unshift(0):(t=(t-i[0])/r,i.unshift(t%r),t>=60&&(t=(t-i[0])/r,i.unshift(t))),s+i.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Uy={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>Jo(e,n),stringify:tf},Jy={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>Jo(e,!1),stringify:tf},nf={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){let t=e.match(nf.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,s,r,i,o,l]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0,a=Date.UTC(n,s-1,r,i||0,o||0,l||0,c),p=t[8];if(p&&p!=="Z"){let f=Jo(p,!1);Math.abs(f)<30&&(f*=60),a-=6e4*f}return new Date(a)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Jr.floatTime=Jy;Jr.intTime=Uy;Jr.timestamp=nf});var of=j(rf=>{"use strict";var Yy=fn(),Vy=Dr(),xy=dn(),Wy=es(),Gy=Fo(),sf=Qu(),Vo=Xu(),Yr=ef(),Hy=kr(),zy=Mo(),Qy=Mr(),Xy=Uo(),xo=Yo(),Zy=[Yy.map,xy.seq,Wy.string,Vy.nullTag,sf.trueTag,sf.falseTag,Yr.intBin,Yr.intOct,Yr.int,Yr.intHex,Vo.floatNaN,Vo.floatExp,Vo.float,Gy.binary,Hy.merge,zy.omap,Qy.pairs,Xy.set,xo.intTime,xo.floatTime,xo.timestamp];rf.schema=Zy});var gf=j(Ho=>{"use strict";var uf=fn(),ew=Dr(),ff=dn(),tw=es(),nw=Ao(),Wo=Oo(),Go=jo(),sw=qu(),rw=Ku(),df=Fo(),is=kr(),pf=Mo(),hf=Mr(),af=of(),mf=Uo(),Vr=Yo(),lf=new Map([["core",sw.schema],["failsafe",[uf.map,ff.seq,tw.string]],["json",rw.schema],["yaml11",af.schema],["yaml-1.1",af.schema]]),cf={binary:df.binary,bool:nw.boolTag,float:Wo.float,floatExp:Wo.floatExp,floatNaN:Wo.floatNaN,floatTime:Vr.floatTime,int:Go.int,intHex:Go.intHex,intOct:Go.intOct,intTime:Vr.intTime,map:uf.map,merge:is.merge,null:ew.nullTag,omap:pf.omap,pairs:hf.pairs,seq:ff.seq,set:mf.set,timestamp:Vr.timestamp},iw={"tag:yaml.org,2002:binary":df.binary,"tag:yaml.org,2002:merge":is.merge,"tag:yaml.org,2002:omap":pf.omap,"tag:yaml.org,2002:pairs":hf.pairs,"tag:yaml.org,2002:set":mf.set,"tag:yaml.org,2002:timestamp":Vr.timestamp};function ow(e,t,n){let s=lf.get(t);if(s&&!e)return n&&!s.includes(is.merge)?s.concat(is.merge):s.slice();let r=s;if(!r)if(Array.isArray(e))r=[];else{let i=Array.from(lf.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${i} or define customTags array`)}if(Array.isArray(e))for(let i of e)r=r.concat(i);else typeof e=="function"&&(r=e(r.slice()));return n&&(r=r.concat(is.merge)),r.reduce((i,o)=>{let l=typeof o=="string"?cf[o]:o;if(!l){let c=JSON.stringify(o),a=Object.keys(cf).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${a}`)}return i.includes(l)||i.push(l),i},[])}Ho.coreKnownTags=iw;Ho.getTags=ow});var Xo=j(yf=>{"use strict";var zo=q(),aw=fn(),lw=dn(),cw=es(),xr=gf(),uw=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0,Qo=class e{constructor({compat:t,customTags:n,merge:s,resolveKnownTags:r,schema:i,sortMapEntries:o,toStringDefaults:l}){this.compat=Array.isArray(t)?xr.getTags(t,"compat"):t?xr.getTags(null,t):null,this.name=typeof i=="string"&&i||"core",this.knownTags=r?xr.coreKnownTags:{},this.tags=xr.getTags(n,this.name,s),this.toStringOptions=l??null,Object.defineProperty(this,zo.MAP,{value:aw.map}),Object.defineProperty(this,zo.SCALAR,{value:cw.string}),Object.defineProperty(this,zo.SEQ,{value:lw.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?uw:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};yf.Schema=Qo});var bf=j(wf=>{"use strict";var fw=q(),Zo=Qn(),os=Wn();function dw(e,t){let n=[],s=t.directives===!0;if(t.directives!==!1&&e.directives){let c=e.directives.toString(e);c?(n.push(c),s=!0):e.directives.docStart&&(s=!0)}s&&n.push("---");let r=Zo.createStringifyContext(e,t),{commentString:i}=r.options;if(e.commentBefore){n.length!==1&&n.unshift("");let c=i(e.commentBefore);n.unshift(os.indentComment(c,""))}let o=!1,l=null;if(e.contents){if(fw.isNode(e.contents)){if(e.contents.spaceBefore&&s&&n.push(""),e.contents.commentBefore){let p=i(e.contents.commentBefore);n.push(os.indentComment(p,""))}r.forceBlockIndent=!!e.comment,l=e.contents.comment}let c=l?void 0:()=>o=!0,a=Zo.stringify(e.contents,r,()=>l=null,c);l&&(a+=os.lineComment(a,"",i(l))),(a[0]==="|"||a[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${a}`:n.push(a)}else n.push(Zo.stringify(e.contents,r));if(e.directives?.docEnd)if(e.comment){let c=i(e.comment);c.includes(`
|
|
227
|
+
`)?(n.push("..."),n.push(os.indentComment(c,""))):n.push(`... ${c}`)}else n.push("...");else{let c=e.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||l)&&n[n.length-1]!==""&&n.push(""),n.push(os.indentComment(i(c),"")))}return n.join(`
|
|
228
|
+
`)+`
|
|
229
|
+
`}wf.stringifyDocument=dw});var as=j(vf=>{"use strict";var pw=Vn(),hn=dr(),Oe=q(),hw=pt(),mw=ct(),gw=Xo(),yw=bf(),ea=lr(),ww=so(),bw=xn(),ta=no(),na=class e{constructor(t,n,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Oe.NODE_TYPE,{value:Oe.DOC});let r=null;typeof n=="function"||Array.isArray(n)?r=n:s===void 0&&n&&(s=n,n=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},s);this.options=i;let{version:o}=i;s?._directives?(this.directives=s._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new ta.Directives({version:o}),this.setSchema(o,s),this.contents=t===void 0?null:this.createNode(t,r,s)}clone(){let t=Object.create(e.prototype,{[Oe.NODE_TYPE]:{value:Oe.DOC}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=Oe.isNode(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){mn(this.contents)&&this.contents.add(t)}addIn(t,n){mn(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){let s=ea.anchorNames(this);t.anchor=!n||s.has(n)?ea.findNewAnchor(n||"a",s):n}return new pw.Alias(t.anchor)}createNode(t,n,s){let r;if(typeof n=="function")t=n.call({"":t},"",t),r=n;else if(Array.isArray(n)){let g=w=>typeof w=="number"||w instanceof String||w instanceof Number,y=n.filter(g).map(String);y.length>0&&(n=n.concat(y)),r=n}else s===void 0&&n&&(s=n,n=void 0);let{aliasDuplicateObjects:i,anchorPrefix:o,flow:l,keepUndefined:c,onTagObj:a,tag:p}=s??{},{onAnchor:f,setAnchors:u,sourceObjects:d}=ea.createNodeAnchors(this,o||"a"),m={aliasDuplicateObjects:i??!0,keepUndefined:c??!1,onAnchor:f,onTagObj:a,replacer:r,schema:this.schema,sourceObjects:d},h=bw.createNode(t,p,m);return l&&Oe.isCollection(h)&&(h.flow=!0),u(),h}createPair(t,n,s={}){let r=this.createNode(t,null,s),i=this.createNode(n,null,s);return new hw.Pair(r,i)}delete(t){return mn(this.contents)?this.contents.delete(t):!1}deleteIn(t){return hn.isEmptyPath(t)?this.contents==null?!1:(this.contents=null,!0):mn(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return Oe.isCollection(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return hn.isEmptyPath(t)?!n&&Oe.isScalar(this.contents)?this.contents.value:this.contents:Oe.isCollection(this.contents)?this.contents.getIn(t,n):void 0}has(t){return Oe.isCollection(this.contents)?this.contents.has(t):!1}hasIn(t){return hn.isEmptyPath(t)?this.contents!==void 0:Oe.isCollection(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=hn.collectionFromPath(this.schema,[t],n):mn(this.contents)&&this.contents.set(t,n)}setIn(t,n){hn.isEmptyPath(t)?this.contents=n:this.contents==null?this.contents=hn.collectionFromPath(this.schema,Array.from(t),n):mn(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let s;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new ta.Directives({version:"1.1"}),s={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new ta.Directives({version:t}),s={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,s=null;break;default:{let r=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(s)this.schema=new gw.Schema(Object.assign(s,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:s,maxAliasCount:r,onAnchor:i,reviver:o}={}){let l={anchors:new Map,doc:this,keep:!t,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=mw.toJS(this.contents,n??"",l);if(typeof i=="function")for(let{count:a,res:p}of l.anchors.values())i(p,a);return typeof o=="function"?ww.applyReviver(o,{"":c},"",c):c}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){let n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return yw.stringifyDocument(this,t)}};function mn(e){if(Oe.isCollection(e))return!0;throw new Error("Expected a YAML collection as document contents")}vf.Document=na});var us=j(cs=>{"use strict";var ls=class extends Error{constructor(t,n,s,r){super(),this.name=t,this.code=s,this.message=r,this.pos=n}},sa=class extends ls{constructor(t,n,s){super("YAMLParseError",t,n,s)}},ra=class extends ls{constructor(t,n,s){super("YAMLWarning",t,n,s)}},vw=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(l=>t.linePos(l));let{line:s,col:r}=n.linePos[0];n.message+=` at line ${s}, column ${r}`;let i=r-1,o=e.substring(t.lineStarts[s-1],t.lineStarts[s]).replace(/[\n\r]+$/,"");if(i>=60&&o.length>80){let l=Math.min(i-39,o.length-79);o="…"+o.substring(l),i-=l-1}if(o.length>80&&(o=o.substring(0,79)+"…"),s>1&&/^ *$/.test(o.substring(0,i))){let l=e.substring(t.lineStarts[s-2],t.lineStarts[s-1]);l.length>80&&(l=l.substring(0,79)+`…
|
|
230
|
+
`),o=l+o}if(/[^ ]/.test(o)){let l=1,c=n.linePos[1];c?.line===s&&c.col>r&&(l=Math.max(1,Math.min(c.col-r,80-i)));let a=" ".repeat(i)+"^".repeat(l);n.message+=`:
|
|
61
231
|
|
|
62
232
|
${o}
|
|
63
|
-
${
|
|
64
|
-
`}};
|
|
65
|
-
`))return!0;if(
|
|
66
|
-
`+
|
|
67
|
-
`+
|
|
68
|
-
`+
|
|
69
|
-
`+
|
|
70
|
-
`+
|
|
71
|
-
`+
|
|
72
|
-
`.repeat(Math.max(1,o.length-1)):"",
|
|
73
|
-
`;for(let p
|
|
74
|
-
`):
|
|
75
|
-
`:!
|
|
76
|
-
`&&(
|
|
77
|
-
|
|
78
|
-
`),f+=
|
|
79
|
-
`,
|
|
233
|
+
${a}
|
|
234
|
+
`}};cs.YAMLError=ls;cs.YAMLParseError=sa;cs.YAMLWarning=ra;cs.prettifyError=vw});var fs=j(Sf=>{"use strict";function Sw(e,{flow:t,indicator:n,next:s,offset:r,onError:i,parentIndent:o,startOnNewline:l}){let c=!1,a=l,p=l,f="",u="",d=!1,m=!1,h=null,g=null,y=null,w=null,v=null,S=null,k=null;for(let C of e)switch(m&&(C.type!=="space"&&C.type!=="newline"&&C.type!=="comma"&&i(C.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),h&&(a&&C.type!=="comment"&&C.type!=="newline"&&i(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),h=null),C.type){case"space":!t&&(n!=="doc-start"||s?.type!=="flow-collection")&&C.source.includes(" ")&&(h=C),p=!0;break;case"comment":{p||i(C,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let A=C.source.substring(1)||" ";f?f+=u+A:f=A,u="",a=!1;break}case"newline":a?f?f+=C.source:(!S||n!=="seq-item-ind")&&(c=!0):u+=C.source,a=!0,d=!0,(g||y)&&(w=C),p=!0;break;case"anchor":g&&i(C,"MULTIPLE_ANCHORS","A node can have at most one anchor"),C.source.endsWith(":")&&i(C.offset+C.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=C,k??(k=C.offset),a=!1,p=!1,m=!0;break;case"tag":{y&&i(C,"MULTIPLE_TAGS","A node can have at most one tag"),y=C,k??(k=C.offset),a=!1,p=!1,m=!0;break}case n:(g||y)&&i(C,"BAD_PROP_ORDER",`Anchors and tags must be after the ${C.source} indicator`),S&&i(C,"UNEXPECTED_TOKEN",`Unexpected ${C.source} in ${t??"collection"}`),S=C,a=n==="seq-item-ind"||n==="explicit-key-ind",p=!1;break;case"comma":if(t){v&&i(C,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),v=C,a=!1,p=!1;break}default:i(C,"UNEXPECTED_TOKEN",`Unexpected ${C.type} token`),a=!1,p=!1}let b=e[e.length-1],E=b?b.offset+b.source.length:r;return m&&s&&s.type!=="space"&&s.type!=="newline"&&s.type!=="comma"&&(s.type!=="scalar"||s.source!=="")&&i(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h&&(a&&h.indent<=o||s?.type==="block-map"||s?.type==="block-seq")&&i(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:v,found:S,spaceBefore:c,comment:f,hasNewline:d,anchor:g,tag:y,newlineAfterProp:w,end:E,start:k??E}}Sf.resolveProps=Sw});var Wr=j(kf=>{"use strict";function ia(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
|
|
235
|
+
`))return!0;if(e.end){for(let t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(let t of e.items){for(let n of t.start)if(n.type==="newline")return!0;if(t.sep){for(let n of t.sep)if(n.type==="newline")return!0}if(ia(t.key)||ia(t.value))return!0}return!1;default:return!0}}kf.containsNewline=ia});var oa=j(Ef=>{"use strict";var kw=Wr();function Ew(e,t,n){if(t?.type==="flow-collection"){let s=t.end[0];s.indent===e&&(s.source==="]"||s.source==="}")&&kw.containsNewline(t)&&n(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Ef.flowIndentCheck=Ew});var aa=j(Af=>{"use strict";var Cf=q();function Cw(e,t,n){let{uniqueKeys:s}=e.options;if(s===!1)return!1;let r=typeof s=="function"?s:(i,o)=>i===o||Cf.isScalar(i)&&Cf.isScalar(o)&&i.value===o.value;return t.some(i=>r(i.key,n))}Af.mapIncludes=Cw});var Lf=j(Df=>{"use strict";var Nf=pt(),Aw=mt(),Of=fs(),Nw=Wr(),If=oa(),Ow=aa(),jf="All mapping items must start at the same column";function Iw({composeNode:e,composeEmptyNode:t},n,s,r,i){let o=i?.nodeClass??Aw.YAMLMap,l=new o(n.schema);n.atRoot&&(n.atRoot=!1);let c=s.offset,a=null;for(let p of s.items){let{start:f,key:u,sep:d,value:m}=p,h=Of.resolveProps(f,{indicator:"explicit-key-ind",next:u??d?.[0],offset:c,onError:r,parentIndent:s.indent,startOnNewline:!0}),g=!h.found;if(g){if(u&&(u.type==="block-seq"?r(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in u&&u.indent!==s.indent&&r(c,"BAD_INDENT",jf)),!h.anchor&&!h.tag&&!d){a=h.end,h.comment&&(l.comment?l.comment+=`
|
|
236
|
+
`+h.comment:l.comment=h.comment);continue}(h.newlineAfterProp||Nw.containsNewline(u))&&r(u??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else h.found?.indent!==s.indent&&r(c,"BAD_INDENT",jf);n.atKey=!0;let y=h.end,w=u?e(n,u,h,r):t(n,y,f,null,h,r);n.schema.compat&&If.flowIndentCheck(s.indent,u,r),n.atKey=!1,Ow.mapIncludes(n,l.items,w)&&r(y,"DUPLICATE_KEY","Map keys must be unique");let v=Of.resolveProps(d??[],{indicator:"map-value-ind",next:m,offset:w.range[2],onError:r,parentIndent:s.indent,startOnNewline:!u||u.type==="block-scalar"});if(c=v.end,v.found){g&&(m?.type==="block-map"&&!v.hasNewline&&r(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&h.start<v.found.offset-1024&&r(w.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let S=m?e(n,m,v,r):t(n,c,d,null,v,r);n.schema.compat&&If.flowIndentCheck(s.indent,m,r),c=S.range[2];let k=new Nf.Pair(w,S);n.options.keepSourceTokens&&(k.srcToken=p),l.items.push(k)}else{g&&r(w.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),v.comment&&(w.comment?w.comment+=`
|
|
237
|
+
`+v.comment:w.comment=v.comment);let S=new Nf.Pair(w);n.options.keepSourceTokens&&(S.srcToken=p),l.items.push(S)}}return a&&a<c&&r(a,"IMPOSSIBLE","Map comment with trailing content"),l.range=[s.offset,c,a??c],l}Df.resolveBlockMap=Iw});var Ff=j(Tf=>{"use strict";var jw=gt(),Dw=fs(),Lw=oa();function Tw({composeNode:e,composeEmptyNode:t},n,s,r,i){let o=i?.nodeClass??jw.YAMLSeq,l=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let c=s.offset,a=null;for(let{start:p,value:f}of s.items){let u=Dw.resolveProps(p,{indicator:"seq-item-ind",next:f,offset:c,onError:r,parentIndent:s.indent,startOnNewline:!0});if(!u.found)if(u.anchor||u.tag||f)f?.type==="block-seq"?r(u.end,"BAD_INDENT","All sequence items must start at the same column"):r(c,"MISSING_CHAR","Sequence item without - indicator");else{a=u.end,u.comment&&(l.comment=u.comment);continue}let d=f?e(n,f,u,r):t(n,u.end,p,null,u,r);n.schema.compat&&Lw.flowIndentCheck(s.indent,f,r),c=d.range[2],l.items.push(d)}return l.range=[s.offset,c,a??c],l}Tf.resolveBlockSeq=Tw});var gn=j(_f=>{"use strict";function Fw(e,t,n,s){let r="";if(e){let i=!1,o="";for(let l of e){let{source:c,type:a}=l;switch(a){case"space":i=!0;break;case"comment":{n&&!i&&s(l,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let p=c.substring(1)||" ";r?r+=o+p:r=p,o="";break}case"newline":r&&(o+=c),i=!0;break;default:s(l,"UNEXPECTED_TOKEN",`Unexpected ${a} at node end`)}t+=c.length}}return{comment:r,offset:t}}_f.resolveEnd=Fw});var qf=j(Mf=>{"use strict";var _w=q(),Pw=pt(),Pf=mt(),$w=gt(),Mw=gn(),$f=fs(),qw=Wr(),Bw=aa(),la="Block collections are not allowed within flow collections",ca=e=>e&&(e.type==="block-map"||e.type==="block-seq");function Rw({composeNode:e,composeEmptyNode:t},n,s,r,i){let o=s.start.source==="{",l=o?"flow map":"flow sequence",c=i?.nodeClass??(o?Pf.YAMLMap:$w.YAMLSeq),a=new c(n.schema);a.flow=!0;let p=n.atRoot;p&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=s.offset+s.start.source.length;for(let g=0;g<s.items.length;++g){let y=s.items[g],{start:w,key:v,sep:S,value:k}=y,b=$f.resolveProps(w,{flow:l,indicator:"explicit-key-ind",next:v??S?.[0],offset:f,onError:r,parentIndent:s.indent,startOnNewline:!1});if(!b.found){if(!b.anchor&&!b.tag&&!S&&!k){g===0&&b.comma?r(b.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`):g<s.items.length-1&&r(b.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${l}`),b.comment&&(a.comment?a.comment+=`
|
|
238
|
+
`+b.comment:a.comment=b.comment),f=b.end;continue}!o&&n.options.strict&&qw.containsNewline(v)&&r(v,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(g===0)b.comma&&r(b.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`);else if(b.comma||r(b.start,"MISSING_CHAR",`Missing , between ${l} items`),b.comment){let E="";e:for(let C of w)switch(C.type){case"comma":case"space":break;case"comment":E=C.source.substring(1);break e;default:break e}if(E){let C=a.items[a.items.length-1];_w.isPair(C)&&(C=C.value??C.key),C.comment?C.comment+=`
|
|
239
|
+
`+E:C.comment=E,b.comment=b.comment.substring(E.length+1)}}if(!o&&!S&&!b.found){let E=k?e(n,k,b,r):t(n,b.end,S,null,b,r);a.items.push(E),f=E.range[2],ca(k)&&r(E.range,"BLOCK_IN_FLOW",la)}else{n.atKey=!0;let E=b.end,C=v?e(n,v,b,r):t(n,E,w,null,b,r);ca(v)&&r(C.range,"BLOCK_IN_FLOW",la),n.atKey=!1;let A=$f.resolveProps(S??[],{flow:l,indicator:"map-value-ind",next:k,offset:C.range[2],onError:r,parentIndent:s.indent,startOnNewline:!1});if(A.found){if(!o&&!b.found&&n.options.strict){if(S)for(let I of S){if(I===A.found)break;if(I.type==="newline"){r(I,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}b.start<A.found.offset-1024&&r(A.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else k&&("source"in k&&k.source?.[0]===":"?r(k,"MISSING_CHAR",`Missing space after : in ${l}`):r(A.start,"MISSING_CHAR",`Missing , or : between ${l} items`));let N=k?e(n,k,A,r):A.found?t(n,A.end,S,null,A,r):null;N?ca(k)&&r(N.range,"BLOCK_IN_FLOW",la):A.comment&&(C.comment?C.comment+=`
|
|
240
|
+
`+A.comment:C.comment=A.comment);let O=new Pw.Pair(C,N);if(n.options.keepSourceTokens&&(O.srcToken=y),o){let I=a;Bw.mapIncludes(n,I.items,C)&&r(E,"DUPLICATE_KEY","Map keys must be unique"),I.items.push(O)}else{let I=new Pf.YAMLMap(n.schema);I.flow=!0,I.items.push(O);let L=(N??C).range;I.range=[C.range[0],L[1],L[2]],a.items.push(I)}f=N?N.range[2]:A.end}}let u=o?"}":"]",[d,...m]=s.end,h=f;if(d?.source===u)h=d.offset+d.source.length;else{let g=l[0].toUpperCase()+l.substring(1),y=p?`${g} must end with a ${u}`:`${g} in block collection must be sufficiently indented and end with a ${u}`;r(f,p?"MISSING_CHAR":"BAD_INDENT",y),d&&d.source.length!==1&&m.unshift(d)}if(m.length>0){let g=Mw.resolveEnd(m,h,n.options.strict,r);g.comment&&(a.comment?a.comment+=`
|
|
241
|
+
`+g.comment:a.comment=g.comment),a.range=[s.offset,h,g.offset]}else a.range=[s.offset,h,h];return a}Mf.resolveFlowCollection=Rw});var Rf=j(Bf=>{"use strict";var Kw=q(),Uw=te(),Jw=mt(),Yw=gt(),Vw=Lf(),xw=Ff(),Ww=qf();function ua(e,t,n,s,r,i){let o=n.type==="block-map"?Vw.resolveBlockMap(e,t,n,s,i):n.type==="block-seq"?xw.resolveBlockSeq(e,t,n,s,i):Ww.resolveFlowCollection(e,t,n,s,i),l=o.constructor;return r==="!"||r===l.tagName?(o.tag=l.tagName,o):(r&&(o.tag=r),o)}function Gw(e,t,n,s,r){let i=s.tag,o=i?t.directives.tagName(i.source,u=>r(i,"TAG_RESOLVE_FAILED",u)):null;if(n.type==="block-seq"){let{anchor:u,newlineAfterProp:d}=s,m=u&&i?u.offset>i.offset?u:i:u??i;m&&(!d||d.offset<m.offset)&&r(m,"MISSING_CHAR","Missing newline after block sequence props")}let l=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!i||!o||o==="!"||o===Jw.YAMLMap.tagName&&l==="map"||o===Yw.YAMLSeq.tagName&&l==="seq")return ua(e,t,n,r,o);let c=t.schema.tags.find(u=>u.tag===o&&u.collection===l);if(!c){let u=t.schema.knownTags[o];if(u?.collection===l)t.schema.tags.push(Object.assign({},u,{default:!1})),c=u;else return u?r(i,"BAD_COLLECTION_TYPE",`${u.tag} used for ${l} collection, but expects ${u.collection??"scalar"}`,!0):r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),ua(e,t,n,r,o)}let a=ua(e,t,n,r,o,c),p=c.resolve?.(a,u=>r(i,"TAG_RESOLVE_FAILED",u),t.options)??a,f=Kw.isNode(p)?p:new Uw.Scalar(p);return f.range=a.range,f.tag=o,c?.format&&(f.format=c.format),f}Bf.composeCollection=Gw});var da=j(Kf=>{"use strict";var fa=te();function Hw(e,t,n){let s=t.offset,r=zw(t,e.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[s,s,s]};let i=r.mode===">"?fa.Scalar.BLOCK_FOLDED:fa.Scalar.BLOCK_LITERAL,o=t.source?Qw(t.source):[],l=o.length;for(let h=o.length-1;h>=0;--h){let g=o[h][1];if(g===""||g==="\r")l=h;else break}if(l===0){let h=r.chomp==="+"&&o.length>0?`
|
|
242
|
+
`.repeat(Math.max(1,o.length-1)):"",g=s+r.length;return t.source&&(g+=t.source.length),{value:h,type:i,comment:r.comment,range:[s,g,g]}}let c=t.indent+r.indent,a=t.offset+r.length,p=0;for(let h=0;h<l;++h){let[g,y]=o[h];if(y===""||y==="\r")r.indent===0&&g.length>c&&(c=g.length);else{g.length<c&&n(a+g.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(c=g.length),p=h,c===0&&!e.atRoot&&n(a,"BAD_INDENT","Block scalar values in collections must be indented");break}a+=g.length+y.length+1}for(let h=o.length-1;h>=l;--h)o[h][0].length>c&&(l=h+1);let f="",u="",d=!1;for(let h=0;h<p;++h)f+=o[h][0].slice(c)+`
|
|
243
|
+
`;for(let h=p;h<l;++h){let[g,y]=o[h];a+=g.length+y.length+1;let w=y[y.length-1]==="\r";if(w&&(y=y.slice(0,-1)),y&&g.length<c){let S=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;n(a-y.length-(w?2:1),"BAD_INDENT",S),g=""}i===fa.Scalar.BLOCK_LITERAL?(f+=u+g.slice(c)+y,u=`
|
|
244
|
+
`):g.length>c||y[0]===" "?(u===" "?u=`
|
|
245
|
+
`:!d&&u===`
|
|
246
|
+
`&&(u=`
|
|
247
|
+
|
|
248
|
+
`),f+=u+g.slice(c)+y,u=`
|
|
249
|
+
`,d=!0):y===""?u===`
|
|
80
250
|
`?f+=`
|
|
81
|
-
`:
|
|
82
|
-
`:(f+=
|
|
83
|
-
`+o[
|
|
251
|
+
`:u=`
|
|
252
|
+
`:(f+=u+y,u=" ",d=!1)}switch(r.chomp){case"-":break;case"+":for(let h=l;h<o.length;++h)f+=`
|
|
253
|
+
`+o[h][0].slice(c);f[f.length-1]!==`
|
|
84
254
|
`&&(f+=`
|
|
85
255
|
`);break;default:f+=`
|
|
86
|
-
`}let
|
|
87
|
-
`,"sy"),
|
|
88
|
-
`,"sy")}catch{
|
|
89
|
-
`?i
|
|
90
|
-
`:(i
|
|
91
|
-
`))if(
|
|
92
|
-
`){let{fold:
|
|
93
|
-
`)for(
|
|
94
|
-
`)for(
|
|
95
|
-
`&&!(o==="\r"&&
|
|
96
|
-
`)&&(
|
|
97
|
-
`||s==="\r")&&!(s==="\r"&&
|
|
256
|
+
`}let m=s+r.length+t.source.length;return{value:f,type:i,comment:r.comment,range:[s,m,m]}}function zw({offset:e,props:t},n,s){if(t[0].type!=="block-scalar-header")return s(t[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:r}=t[0],i=r[0],o=0,l="",c=-1;for(let u=1;u<r.length;++u){let d=r[u];if(!l&&(d==="-"||d==="+"))l=d;else{let m=Number(d);!o&&m?o=m:c===-1&&(c=e+u)}}c!==-1&&s(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let a=!1,p="",f=r.length;for(let u=1;u<t.length;++u){let d=t[u];switch(d.type){case"space":a=!0;case"newline":f+=d.source.length;break;case"comment":n&&!a&&s(d,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=d.source.length,p=d.source.substring(1);break;case"error":s(d,"UNEXPECTED_TOKEN",d.message),f+=d.source.length;break;default:{let m=`Unexpected token in block scalar header: ${d.type}`;s(d,"UNEXPECTED_TOKEN",m);let h=d.source;h&&typeof h=="string"&&(f+=h.length)}}}return{mode:i,indent:o,chomp:l,comment:p,length:f}}function Qw(e){let t=e.split(/\n( *)/),n=t[0],s=n.match(/^( *)/),i=[s?.[1]?[s[1],n.slice(s[1].length)]:["",n]];for(let o=1;o<t.length;o+=2)i.push([t[o],t[o+1]]);return i}Kf.resolveBlockScalar=Hw});var ha=j(Jf=>{"use strict";var pa=te(),Xw=gn();function Zw(e,t,n){let{offset:s,type:r,source:i,end:o}=e,l,c,a=(u,d,m)=>n(s+u,d,m);switch(r){case"scalar":l=pa.Scalar.PLAIN,c=eb(i,a);break;case"single-quoted-scalar":l=pa.Scalar.QUOTE_SINGLE,c=tb(i,a);break;case"double-quoted-scalar":l=pa.Scalar.QUOTE_DOUBLE,c=nb(i,a);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[s,s+i.length,s+i.length]}}let p=s+i.length,f=Xw.resolveEnd(o,p,t,n);return{value:c,type:l,comment:f.comment,range:[s,p,f.offset]}}function eb(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),Uf(e)}function tb(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),Uf(e.slice(1,-1)).replace(/''/g,"'")}function Uf(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
257
|
+
`,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
258
|
+
`,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let s=t.exec(e);if(!s)return e;let r=s[1],i=" ",o=t.lastIndex;for(n.lastIndex=o;s=n.exec(e);)s[1]===""?i===`
|
|
259
|
+
`?r+=i:i=`
|
|
260
|
+
`:(r+=i+s[1],i=" "),o=n.lastIndex;let l=/[ \t]*(.*)/sy;return l.lastIndex=o,s=l.exec(e),r+i+(s?.[1]??"")}function nb(e,t){let n="";for(let s=1;s<e.length-1;++s){let r=e[s];if(!(r==="\r"&&e[s+1]===`
|
|
261
|
+
`))if(r===`
|
|
262
|
+
`){let{fold:i,offset:o}=sb(e,s);n+=i,s=o}else if(r==="\\"){let i=e[++s],o=rb[i];if(o)n+=o;else if(i===`
|
|
263
|
+
`)for(i=e[s+1];i===" "||i===" ";)i=e[++s+1];else if(i==="\r"&&e[s+1]===`
|
|
264
|
+
`)for(i=e[++s+1];i===" "||i===" ";)i=e[++s+1];else if(i==="x"||i==="u"||i==="U"){let l=i==="x"?2:i==="u"?4:8;n+=ib(e,s+1,l,t),s+=l}else{let l=e.substr(s-1,2);t(s-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),n+=l}}else if(r===" "||r===" "){let i=s,o=e[s+1];for(;o===" "||o===" ";)o=e[++s+1];o!==`
|
|
265
|
+
`&&!(o==="\r"&&e[s+2]===`
|
|
266
|
+
`)&&(n+=s>i?e.slice(i,s+1):r)}else n+=r}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function sb(e,t){let n="",s=e[t+1];for(;(s===" "||s===" "||s===`
|
|
267
|
+
`||s==="\r")&&!(s==="\r"&&e[t+2]!==`
|
|
98
268
|
`);)s===`
|
|
99
|
-
`&&(
|
|
100
|
-
`),
|
|
101
|
-
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function
|
|
269
|
+
`&&(n+=`
|
|
270
|
+
`),t+=1,s=e[t+1];return n||(n=" "),{fold:n,offset:t}}var rb={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
271
|
+
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function ib(e,t,n,s){let r=e.substr(t,n),o=r.length===n&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(o)}catch{let l=e.substr(t-2,n+2);return s(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}}Jf.resolveFlowScalar=Zw});var xf=j(Vf=>{"use strict";var Mt=q(),Yf=te(),ob=da(),ab=ha();function lb(e,t,n,s){let{value:r,type:i,comment:o,range:l}=t.type==="block-scalar"?ob.resolveBlockScalar(e,t,s):ab.resolveFlowScalar(t,e.options.strict,s),c=n?e.directives.tagName(n.source,f=>s(n,"TAG_RESOLVE_FAILED",f)):null,a;e.options.stringKeys&&e.atKey?a=e.schema[Mt.SCALAR]:c?a=cb(e.schema,r,c,n,s):t.type==="scalar"?a=ub(e,r,t,s):a=e.schema[Mt.SCALAR];let p;try{let f=a.resolve(r,u=>s(n??t,"TAG_RESOLVE_FAILED",u),e.options);p=Mt.isScalar(f)?f:new Yf.Scalar(f)}catch(f){let u=f instanceof Error?f.message:String(f);s(n??t,"TAG_RESOLVE_FAILED",u),p=new Yf.Scalar(r)}return p.range=l,p.source=r,i&&(p.type=i),c&&(p.tag=c),a.format&&(p.format=a.format),o&&(p.comment=o),p}function cb(e,t,n,s,r){if(n==="!")return e[Mt.SCALAR];let i=[];for(let l of e.tags)if(!l.collection&&l.tag===n)if(l.default&&l.test)i.push(l);else return l;for(let l of i)if(l.test?.test(t))return l;let o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[Mt.SCALAR])}function ub({atKey:e,directives:t,schema:n},s,r,i){let o=n.tags.find(l=>(l.default===!0||e&&l.default==="key")&&l.test?.test(s))||n[Mt.SCALAR];if(n.compat){let l=n.compat.find(c=>c.default&&c.test?.test(s))??n[Mt.SCALAR];if(o.tag!==l.tag){let c=t.tagString(o.tag),a=t.tagString(l.tag),p=`Value may be parsed as either ${c} or ${a}`;i(r,"TAG_RESOLVE_FAILED",p,!0)}}return o}Vf.composeScalar=lb});var Gf=j(Wf=>{"use strict";function fb(e,t,n){if(t){n??(n=t.length);for(let s=n-1;s>=0;--s){let r=t[s];switch(r.type){case"space":case"comment":case"newline":e-=r.source.length;continue}for(r=t[++s];r?.type==="space";)e+=r.source.length,r=t[++s];break}}return e}Wf.emptyScalarPosition=fb});var Qf=j(ga=>{"use strict";var db=Vn(),pb=q(),hb=Rf(),Hf=xf(),mb=gn(),gb=Gf(),yb={composeNode:zf,composeEmptyNode:ma};function zf(e,t,n,s){let r=e.atKey,{spaceBefore:i,comment:o,anchor:l,tag:c}=n,a,p=!0;switch(t.type){case"alias":a=wb(e,t,s),(l||c)&&s(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":a=Hf.composeScalar(e,t,c,s),l&&(a.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{a=hb.composeCollection(yb,e,t,n,s),l&&(a.anchor=l.source.substring(1))}catch(f){let u=f instanceof Error?f.message:String(f);s(t,"RESOURCE_EXHAUSTION",u)}break;default:{let f=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;s(t,"UNEXPECTED_TOKEN",f),p=!1}}return a??(a=ma(e,t.offset,void 0,null,n,s)),l&&a.anchor===""&&s(l,"BAD_ALIAS","Anchor cannot be an empty string"),r&&e.options.stringKeys&&(!pb.isScalar(a)||typeof a.value!="string"||a.tag&&a.tag!=="tag:yaml.org,2002:str")&&s(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),i&&(a.spaceBefore=!0),o&&(t.type==="scalar"&&t.source===""?a.comment=o:a.commentBefore=o),e.options.keepSourceTokens&&p&&(a.srcToken=t),a}function ma(e,t,n,s,{spaceBefore:r,comment:i,anchor:o,tag:l,end:c},a){let p={type:"scalar",offset:gb.emptyScalarPosition(t,n,s),indent:-1,source:""},f=Hf.composeScalar(e,p,l,a);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&a(o,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(f.spaceBefore=!0),i&&(f.comment=i,f.range[2]=c),f}function wb({options:e},{offset:t,source:n,end:s},r){let i=new db.Alias(n.substring(1));i.source===""&&r(t,"BAD_ALIAS","Alias cannot be an empty string"),i.source.endsWith(":")&&r(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=t+n.length,l=mb.resolveEnd(s,o,e.strict,r);return i.range=[t,o,l.offset],l.comment&&(i.comment=l.comment),i}ga.composeEmptyNode=ma;ga.composeNode=zf});var ed=j(Zf=>{"use strict";var bb=as(),Xf=Qf(),vb=gn(),Sb=fs();function kb(e,t,{offset:n,start:s,value:r,end:i},o){let l=Object.assign({_directives:t},e),c=new bb.Document(void 0,l),a={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},p=Sb.resolveProps(s,{indicator:"doc-start",next:r??i?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});p.found&&(c.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!p.hasNewline&&o(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=r?Xf.composeNode(a,r,p,o):Xf.composeEmptyNode(a,p.end,s,null,p,o);let f=c.contents.range[2],u=vb.resolveEnd(i,f,!1,o);return u.comment&&(c.comment=u.comment),c.range=[n,f,u.offset],c}Zf.composeDoc=kb});var wa=j(sd=>{"use strict";var Eb=Es("process"),Cb=no(),Ab=as(),ds=us(),td=q(),Nb=ed(),Ob=gn();function ps(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function nd(e){let t="",n=!1,s=!1;for(let r=0;r<e.length;++r){let i=e[r];switch(i[0]){case"#":t+=(t===""?"":s?`
|
|
102
272
|
|
|
103
273
|
`:`
|
|
104
|
-
`)+(
|
|
105
|
-
${s}`:s;else if(
|
|
106
|
-
${
|
|
107
|
-
${o}`:s}}if(
|
|
108
|
-
${
|
|
109
|
-
`}];switch(
|
|
110
|
-
`),
|
|
111
|
-
`,
|
|
112
|
-
`}),{type:"block-scalar",offset:
|
|
113
|
-
`),s=
|
|
114
|
-
`;if(
|
|
115
|
-
`});for(let
|
|
116
|
-
`};delete
|
|
274
|
+
`)+(i.substring(1)||" "),n=!0,s=!1;break;case"%":e[r+1]?.[0]!=="#"&&(r+=1),n=!1;break;default:n||(s=!0),n=!1}}return{comment:t,afterEmptyLine:s}}var ya=class{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,s,r,i)=>{let o=ps(n);i?this.warnings.push(new ds.YAMLWarning(o,s,r)):this.errors.push(new ds.YAMLParseError(o,s,r))},this.directives=new Cb.Directives({version:t.version||"1.2"}),this.options=t}decorate(t,n){let{comment:s,afterEmptyLine:r}=nd(this.prelude);if(s){let i=t.contents;if(n)t.comment=t.comment?`${t.comment}
|
|
275
|
+
${s}`:s;else if(r||t.directives.docStart||!i)t.commentBefore=s;else if(td.isCollection(i)&&!i.flow&&i.items.length>0){let o=i.items[0];td.isPair(o)&&(o=o.key);let l=o.commentBefore;o.commentBefore=l?`${s}
|
|
276
|
+
${l}`:s}else{let o=i.commentBefore;i.commentBefore=o?`${s}
|
|
277
|
+
${o}`:s}}if(n){for(let i=0;i<this.errors.length;++i)t.errors.push(this.errors[i]);for(let i=0;i<this.warnings.length;++i)t.warnings.push(this.warnings[i])}else t.errors=this.errors,t.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:nd(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,s=-1){for(let r of t)yield*this.next(r);yield*this.end(n,s)}*next(t){switch(Eb.env.LOG_STREAM&&console.dir(t,{depth:null}),t.type){case"directive":this.directives.add(t.source,(n,s,r)=>{let i=ps(t);i[0]+=n,this.onError(i,"BAD_DIRECTIVE",s,r)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{let n=Nb.composeDoc(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{let n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,s=new ds.YAMLParseError(ps(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(s):this.doc.errors.push(s);break}case"doc-end":{if(!this.doc){let s="Unexpected doc-end without preceding document";this.errors.push(new ds.YAMLParseError(ps(t),"UNEXPECTED_TOKEN",s));break}this.doc.directives.docEnd=!0;let n=Ob.resolveEnd(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){let s=this.doc.comment;this.doc.comment=s?`${s}
|
|
278
|
+
${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new ds.YAMLParseError(ps(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){let s=Object.assign({_directives:this.directives},this.options),r=new Ab.Document(void 0,s);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,n,n],this.decorate(r,!1),yield r}}};sd.Composer=ya});var od=j(Gr=>{"use strict";var Ib=da(),jb=ha(),Db=us(),rd=zn();function Lb(e,t=!0,n){if(e){let s=(r,i,o)=>{let l=typeof r=="number"?r:Array.isArray(r)?r[0]:r.offset;if(n)n(l,i,o);else throw new Db.YAMLParseError([l,l+1],i,o)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return jb.resolveFlowScalar(e,t,s);case"block-scalar":return Ib.resolveBlockScalar({options:{strict:t}},e,s)}}return null}function Tb(e,t){let{implicitKey:n=!1,indent:s,inFlow:r=!1,offset:i=-1,type:o="PLAIN"}=t,l=rd.stringifyString({type:o,value:e},{implicitKey:n,indent:s>0?" ".repeat(s):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}}),c=t.end??[{type:"newline",offset:-1,indent:s,source:`
|
|
279
|
+
`}];switch(l[0]){case"|":case">":{let a=l.indexOf(`
|
|
280
|
+
`),p=l.substring(0,a),f=l.substring(a+1)+`
|
|
281
|
+
`,u=[{type:"block-scalar-header",offset:i,indent:s,source:p}];return id(u,c)||u.push({type:"newline",offset:-1,indent:s,source:`
|
|
282
|
+
`}),{type:"block-scalar",offset:i,indent:s,props:u,source:f}}case'"':return{type:"double-quoted-scalar",offset:i,indent:s,source:l,end:c};case"'":return{type:"single-quoted-scalar",offset:i,indent:s,source:l,end:c};default:return{type:"scalar",offset:i,indent:s,source:l,end:c}}}function Fb(e,t,n={}){let{afterKey:s=!1,implicitKey:r=!1,inFlow:i=!1,type:o}=n,l="indent"in e?e.indent:null;if(s&&typeof l=="number"&&(l+=2),!o)switch(e.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let a=e.props[0];if(a.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=a.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let c=rd.stringifyString({type:o,value:t},{implicitKey:r||l===null,indent:l!==null&&l>0?" ".repeat(l):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":_b(e,c);break;case'"':ba(e,c,"double-quoted-scalar");break;case"'":ba(e,c,"single-quoted-scalar");break;default:ba(e,c,"scalar")}}function _b(e,t){let n=t.indexOf(`
|
|
283
|
+
`),s=t.substring(0,n),r=t.substring(n+1)+`
|
|
284
|
+
`;if(e.type==="block-scalar"){let i=e.props[0];if(i.type!=="block-scalar-header")throw new Error("Invalid block scalar header");i.source=s,e.source=r}else{let{offset:i}=e,o="indent"in e?e.indent:-1,l=[{type:"block-scalar-header",offset:i,indent:o,source:s}];id(l,"end"in e?e.end:void 0)||l.push({type:"newline",offset:-1,indent:o,source:`
|
|
285
|
+
`});for(let c of Object.keys(e))c!=="type"&&c!=="offset"&&delete e[c];Object.assign(e,{type:"block-scalar",indent:o,props:l,source:r})}}function id(e,t){if(t)for(let n of t)switch(n.type){case"space":case"comment":e.push(n);break;case"newline":return e.push(n),!0}return!1}function ba(e,t,n){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=n,e.source=t;break;case"block-scalar":{let s=e.props.slice(1),r=t.length;e.props[0].type==="block-scalar-header"&&(r-=e.props[0].source.length);for(let i of s)i.offset+=r;delete e.props,Object.assign(e,{type:n,source:t,end:s});break}case"block-map":case"block-seq":{let r={type:"newline",offset:e.offset+t.length,indent:e.indent,source:`
|
|
286
|
+
`};delete e.items,Object.assign(e,{type:n,source:t,end:[r]});break}default:{let s="indent"in e?e.indent:-1,r="end"in e&&Array.isArray(e.end)?e.end.filter(i=>i.type==="space"||i.type==="comment"||i.type==="newline"):[];for(let i of Object.keys(e))i!=="type"&&i!=="offset"&&delete e[i];Object.assign(e,{type:n,indent:s,source:t,end:r})}}}Gr.createScalarToken=Tb;Gr.resolveAsScalar=Lb;Gr.setScalarValue=Fb});var ld=j(ad=>{"use strict";var Pb=e=>"type"in e?zr(e):Hr(e);function zr(e){switch(e.type){case"block-scalar":{let t="";for(let n of e.props)t+=zr(n);return t+e.source}case"block-map":case"block-seq":{let t="";for(let n of e.items)t+=Hr(n);return t}case"flow-collection":{let t=e.start.source;for(let n of e.items)t+=Hr(n);for(let n of e.end)t+=n.source;return t}case"document":{let t=Hr(e);if(e.end)for(let n of e.end)t+=n.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(let n of e.end)t+=n.source;return t}}}function Hr({start:e,key:t,sep:n,value:s}){let r="";for(let i of e)r+=i.source;if(t&&(r+=zr(t)),n)for(let i of n)r+=i.source;return s&&(r+=zr(s)),r}ad.stringify=Pb});var dd=j(fd=>{"use strict";var va=Symbol("break visit"),$b=Symbol("skip children"),cd=Symbol("remove item");function qt(e,t){"type"in e&&e.type==="document"&&(e={start:e.start,value:e.value}),ud(Object.freeze([]),e,t)}qt.BREAK=va;qt.SKIP=$b;qt.REMOVE=cd;qt.itemAtPath=(e,t)=>{let n=e;for(let[s,r]of t){let i=n?.[s];if(i&&"items"in i)n=i.items[r];else return}return n};qt.parentCollection=(e,t)=>{let n=qt.itemAtPath(e,t.slice(0,-1)),s=t[t.length-1][0],r=n?.[s];if(r&&"items"in r)return r;throw new Error("Parent collection not found")};function ud(e,t,n){let s=n(t,e);if(typeof s=="symbol")return s;for(let r of["key","value"]){let i=t[r];if(i&&"items"in i){for(let o=0;o<i.items.length;++o){let l=ud(Object.freeze(e.concat([[r,o]])),i.items[o],n);if(typeof l=="number")o=l-1;else{if(l===va)return va;l===cd&&(i.items.splice(o,1),o-=1)}}typeof s=="function"&&r==="key"&&(s=s(t,e))}}return typeof s=="function"?s(t,e):s}fd.visit=qt});var Qr=j(ye=>{"use strict";var Sa=od(),Mb=ld(),qb=dd(),ka="\uFEFF",Ea="",Ca="",Aa="",Bb=e=>!!e&&"items"in e,Rb=e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function Kb(e){switch(e){case ka:return"<BOM>";case Ea:return"<DOC>";case Ca:return"<FLOW_END>";case Aa:return"<SCALAR>";default:return JSON.stringify(e)}}function Ub(e){switch(e){case ka:return"byte-order-mark";case Ea:return"doc-mode";case Ca:return"flow-error-end";case Aa:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
117
287
|
`:case`\r
|
|
118
|
-
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(
|
|
119
|
-
`:case"\r":case" ":return!0;default:return!1}}var
|
|
120
|
-
\r `),
|
|
121
|
-
`?!0:
|
|
122
|
-
`:!1}charAt(
|
|
123
|
-
`||!
|
|
124
|
-
`||s>=this.indentNext||!
|
|
125
|
-
`,this.pos),this.lineEndPos=
|
|
126
|
-
`,this.pos);if(
|
|
127
|
-
`,
|
|
128
|
-
`:
|
|
129
|
-
`)break}default:break e}if(!s&&!this.atEnd)return this.setNext("block-scalar");if(
|
|
130
|
-
`,
|
|
131
|
-
`;)s=this.buffer[++
|
|
132
|
-
`&&
|
|
133
|
-
`?(s+=1,
|
|
134
|
-
`,
|
|
135
|
-
`){let o=this.continueScalar(s+1);if(o===-1)break;s=Math.max(s,o-2)}}else{if(
|
|
136
|
-
`?yield*this.pushCount(1):
|
|
137
|
-
`?yield*this.pushCount(2):0}*pushSpaces(
|
|
138
|
-
`)+1;for(;
|
|
139
|
-
`,
|
|
140
|
-
`)+1;for(;
|
|
141
|
-
`,
|
|
142
|
-
|
|
143
|
-
`),yr(n,Object.fromEntries(Object.entries(t).filter(s=>Array.isArray(s[1]))))}function kc(n,e){let t=M.resolve(n).split(M.sep).join("/");return e.replaceAll("${CLAUDE_PLUGIN_ROOT}",t).replaceAll("${FRONTEND_CRAFT_ROOT}",t)}function Cc(n){let e=M.join(n,"hooks","hooks.json"),t=q(e);return JSON.stringify(JSON.parse(t),(s,i)=>typeof i=="string"?kc(n,i):i,2)}async function wr(n){let{pluginRoot:e,contentRoot:t,baseDir:s,dryRun:i,cwd:r,isGlobal:o}=n;if(i){console.log(`[dry-run] would install Claude Code files into ${s}`);return}let a=M.join(s,"settings.json");ge(a),A(s),$(M.join(t,"skills"),M.join(s,"skills")),$(M.join(t,"agents"),M.join(s,"agents")),$(M.join(t,"commands"),M.join(s,"commands")),o||$(M.join(t,"templates","shared","rules"),M.join(s,"rules"));let l=M.join(t,"templates","claude");if(Te.existsSync(l))for(let f of Te.readdirSync(l)){let d=M.join(s,f);Te.existsSync(d)||X(M.join(l,f),d)}let c=le(JSON.parse(Cc(e)).hooks);if(Yt(a,Gt(ge(a),c),c),de(M.join(s,"hooks.json")),!o&&Te.existsSync(M.join(e,".mcp.json"))){let f=M.join(r,".mcp.json");Te.existsSync(f)||X(M.join(e,".mcp.json"),f)}let u=M.join(e,".claude-plugin","plugin.json");if(!o&&Te.existsSync(u)){A(M.join(r,".claude-plugin")),X(u,M.join(r,".claude-plugin","plugin.json"));let f=M.join(e,".claude-plugin","marketplace.json");Te.existsSync(f)&&X(f,M.join(r,".claude-plugin","marketplace.json"))}}import Z from"node:path";import et from"node:fs";import Zp from"node:os";import Xp from"node:path";var Ze=yc(ul(),1);function fl(n,e){let t=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)([\s\S]*)$/.exec(n);if(!t)throw new Error(`${e}: missing frontmatter`);let s=new Ze.LineCounter,i=(0,Ze.parseDocument)(t[1],{lineCounter:s,uniqueKeys:!0,strict:!0});if(i.errors.length){let o=i.errors[0],a=s.linePos(o.pos[0]);throw new Error(`${e}: ${o.code} at line ${a.line+1}, column ${a.col}: ${o.message}`)}if(!(0,Ze.isMap)(i.contents))throw new Error(`${e}: frontmatter must be a mapping`);let r=i.toJS({maxAliasCount:10});if(!r||typeof r!="object"||Array.isArray(r))throw new Error(`${e}: frontmatter must be a mapping`);return{fields:r,body:t[2]}}function Yn(n,e,t){let s=n[e];if(typeof s!="string"||!s.trim())throw new Error(`${t}: ${e} must be a nonempty string`);return s}function dl(n,e,t){let s=Yn(n,"name",e);if(!/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(s)||t!==void 0&&s!==t)throw new Error(`${e}: invalid or mismatched name ${s}`);return{name:s,description:Yn(n,"description",e)}}function pl(n,e,t){for(let s of Object.keys(n))if(!e.includes(s))throw new Error(`${t}: unknown field ${s}`)}function hl(n,e,t){let{fields:s,body:i}=fl(n,e);pl(s,["name","description","argument-hint"],e);let r=dl(s,e,t);return s["argument-hint"]!==void 0&&(r["argument-hint"]=Yn(s,"argument-hint",e)),{metadata:r,body:i}}function ml(n,e,t){let{fields:s,body:i}=fl(n,e);pl(s,["name","description","tools","model","permissionMode","maxTurns","skills","mcpServers"],e);let r=dl(s,e,t);for(let o of["tools","model"])s[o]!==void 0&&(r[o]=Yn(s,o,e));if(s.permissionMode!==void 0){if(s.permissionMode!=="default"&&s.permissionMode!=="acceptEdits")throw new Error(`${e}: invalid permissionMode`);r.permissionMode=s.permissionMode}if(s.maxTurns!==void 0){if(typeof s.maxTurns!="number"||!Number.isInteger(s.maxTurns)||s.maxTurns<1)throw new Error(`${e}: maxTurns must be a positive integer`);r.maxTurns=s.maxTurns}for(let o of["skills","mcpServers"]){let a=s[o];if(a!==void 0){if(!Array.isArray(a)||!a.length||!a.every(l=>typeof l=="string"&&l.trim().length>0)||new Set(a).size!==a.length)throw new Error(`${e}: ${o} must be a nonempty, unique string array`);r[o]=a}}return{metadata:r,body:i}}function gl(n,e){let t=ml(n,e,Xp.basename(e,".md")),s=t.body.trim().replace(/\.claude\/rules/g,".codex/rules").replace(/\bCLAUDE\.md\b/g,"AGENTS.md"),{name:i,description:r}=t.metadata,o=a=>JSON.stringify(a).replace(/[\u007f]/g,"\\u007f");return`name = ${o(i)}
|
|
144
|
-
description = ${o(r)}
|
|
288
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}ye.createScalarToken=Sa.createScalarToken;ye.resolveAsScalar=Sa.resolveAsScalar;ye.setScalarValue=Sa.setScalarValue;ye.stringify=Mb.stringify;ye.visit=qb.visit;ye.BOM=ka;ye.DOCUMENT=Ea;ye.FLOW_END=Ca;ye.SCALAR=Aa;ye.isCollection=Bb;ye.isScalar=Rb;ye.prettyToken=Kb;ye.tokenType=Ub});var Ia=j(hd=>{"use strict";var hs=Qr();function Pe(e){switch(e){case void 0:case" ":case`
|
|
289
|
+
`:case"\r":case" ":return!0;default:return!1}}var pd=new Set("0123456789ABCDEFabcdef"),Jb=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Xr=new Set(",[]{}"),Yb=new Set(` ,[]{}
|
|
290
|
+
\r `),Na=e=>!e||Yb.has(e),Oa=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let s=this.next??"stream";for(;s&&(n||this.hasChars(1));)s=yield*this.parseNext(s)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===`
|
|
291
|
+
`?!0:n==="\r"?this.buffer[t+1]===`
|
|
292
|
+
`:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let s=0;for(;n===" ";)n=this.buffer[++s+t];if(n==="\r"){let r=this.buffer[s+t+1];if(r===`
|
|
293
|
+
`||!r&&!this.atEnd)return t+s+1}return n===`
|
|
294
|
+
`||s>=this.indentNext||!n&&!this.atEnd?t+s:-1}if(n==="-"||n==="."){let s=this.buffer.substr(t,3);if((s==="---"||s==="...")&&Pe(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&t<this.pos)&&(t=this.buffer.indexOf(`
|
|
295
|
+
`,this.pos),this.lineEndPos=t),t===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[t-1]==="\r"&&(t-=1),this.buffer.substring(this.pos,t))}hasChars(t){return this.pos+t<=this.buffer.length}setNext(t){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=t,null}peek(t){return this.buffer.substr(this.pos,t)}*parseNext(t){switch(t){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let t=this.getLine();if(t===null)return this.setNext("stream");if(t[0]===hs.BOM&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let n=t.length,s=t.indexOf("#");for(;s!==-1;){let i=t[s-1];if(i===" "||i===" "){n=s-1;break}else s=t.indexOf("#",s+1)}for(;;){let i=t[n-1];if(i===" "||i===" ")n-=1;else break}let r=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){let n=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-n),yield*this.pushNewline(),"stream"}return yield hs.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let t=this.charAt(0);if(!t&&!this.atEnd)return this.setNext("line-start");if(t==="-"||t==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let n=this.peek(3);if((n==="---"||n==="...")&&Pe(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Pe(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&Pe(n)){let s=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=s,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Na),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,s=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=s=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);let r=this.getLine();if(r===null)return this.setNext("flow");if((s!==-1&&s<this.indentNext&&r[0]!=="#"||s===0&&(r.startsWith("---")||r.startsWith("..."))&&Pe(r[3]))&&!(s===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield hs.FLOW_END,yield*this.parseLineStart();let i=0;for(;r[i]===",";)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),r[i]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-i),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Na),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||Pe(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let t=this.charAt(0),n=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let i=0;for(;this.buffer[n-1-i]==="\\";)i+=1;if(i%2===0)break;n=this.buffer.indexOf('"',n+1)}let s=this.buffer.substring(0,n),r=s.indexOf(`
|
|
296
|
+
`,this.pos);if(r!==-1){for(;r!==-1;){let i=this.continueScalar(r+1);if(i===-1)break;r=s.indexOf(`
|
|
297
|
+
`,i)}r!==-1&&(n=r-(s[r-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){let n=this.buffer[++t];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>Pe(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,s;e:for(let i=this.pos;s=this.buffer[i];++i)switch(s){case" ":n+=1;break;case`
|
|
298
|
+
`:t=i,n=0;break;case"\r":{let o=this.buffer[i+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
|
|
299
|
+
`)break}default:break e}if(!s&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let i=this.continueScalar(t+1);if(i===-1)break;t=this.buffer.indexOf(`
|
|
300
|
+
`,i)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let r=t+1;for(s=this.buffer[r];s===" ";)s=this.buffer[++r];if(s===" "){for(;s===" "||s===" "||s==="\r"||s===`
|
|
301
|
+
`;)s=this.buffer[++r];t=r-1}else if(!this.blockScalarKeep)do{let i=t-1,o=this.buffer[i];o==="\r"&&(o=this.buffer[--i]);let l=i;for(;o===" ";)o=this.buffer[--i];if(o===`
|
|
302
|
+
`&&i>=this.pos&&i+1+n>l)t=i;else break}while(!0);return yield hs.SCALAR,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let t=this.flowLevel>0,n=this.pos-1,s=this.pos-1,r;for(;r=this.buffer[++s];)if(r===":"){let i=this.buffer[s+1];if(Pe(i)||t&&Xr.has(i))break;n=s}else if(Pe(r)){let i=this.buffer[s+1];if(r==="\r"&&(i===`
|
|
303
|
+
`?(s+=1,r=`
|
|
304
|
+
`,i=this.buffer[s+1]):n=s),i==="#"||t&&Xr.has(i))break;if(r===`
|
|
305
|
+
`){let o=this.continueScalar(s+1);if(o===-1)break;s=Math.max(s,o-2)}}else{if(t&&Xr.has(r))break;n=s}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield hs.SCALAR,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){let s=this.buffer.slice(this.pos,t);return s?(yield s,this.pos+=s.length,s.length):(n&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil(Na),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let n=this.flowLevel>0,s=this.charAt(1);if(Pe(s)||n&&Xr.has(s)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!Pe(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(Jb.has(n))n=this.buffer[++t];else if(n==="%"&&pd.has(this.buffer[t+1])&&pd.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){let t=this.buffer[this.pos];return t===`
|
|
306
|
+
`?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
|
|
307
|
+
`?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,s;do s=this.buffer[++n];while(s===" "||t&&s===" ");let r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(t){let n=this.pos,s=this.buffer[n];for(;!t(s);)s=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};hd.Lexer=Oa});var Da=j(md=>{"use strict";var ja=class{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,s=this.lineStarts.length;for(;n<s;){let i=n+s>>1;this.lineStarts[i]<t?n=i+1:s=i}if(this.lineStarts[n]===t)return{line:n+1,col:1};if(n===0)return{line:0,col:t};let r=this.lineStarts[n-1];return{line:n,col:t-r+1}}}};md.LineCounter=ja});var Ta=j(vd=>{"use strict";var Vb=Es("process"),gd=Qr(),xb=Ia();function yt(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function yd(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function bd(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Zr(e){switch(e.type){case"document":return e.start;case"block-map":{let t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function yn(e){if(e.length===0)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++t]?.type==="space";);return e.splice(t,e.length)}function ei(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function wd(e){if(e.start.type==="flow-seq-start")for(let t of e.items)t.sep&&!t.value&&!yt(t.start,"explicit-key-ind")&&!yt(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,bd(t.value)?t.value.end?ei(t.value.end,t.sep):t.value.end=t.sep:ei(t.start,t.sep),delete t.sep)}var La=class{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new xb.Lexer,this.onNewLine=t}*parse(t,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let s of this.lexer.lex(t,n))yield*this.next(s);n||(yield*this.end())}*next(t){if(this.source=t,Vb.env.LOG_TOKENS&&console.log("|",gd.prettyToken(t)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}let n=gd.tokenType(t);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&t[0]===" "&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{let s=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:s,source:t}),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let t=this.peek(1);if(this.type==="doc-end"&&t?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){let n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{let s=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in s?s.indent:0:n.type==="flow-collection"&&s.type==="document"&&(n.indent=0),n.type==="flow-collection"&&wd(n),s.type){case"document":s.value=n;break;case"block-scalar":s.props.push(n);break;case"block-map":{let r=s.items[s.items.length-1];if(r.value){s.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=n;else{Object.assign(r,{key:n,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{let r=s.items[s.items.length-1];r.value?s.items.push({start:[],value:n}):r.value=n;break}case"flow-collection":{let r=s.items[s.items.length-1];!r||r.value?s.items.push({start:[],key:n,sep:[]}):r.sep?r.value=n:Object.assign(r,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((s.type==="document"||s.type==="block-map"||s.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){let r=n.items[n.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&yd(r.start)===-1&&(n.indent===0||r.start.every(i=>i.type!=="comment"||i.indent<n.indent))&&(s.type==="document"?s.end=r.start:s.items.push({start:r.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{yd(t.start)!==-1?(yield*this.pop(),yield*this.step()):t.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":t.start.push(this.sourceToken);return}let n=this.startBlockValue(t);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(t){if(this.type==="map-value-ind"){let n=Zr(this.peek(2)),s=yn(n),r;t.end?(r=t.end,r.push(this.sourceToken),delete t.end):r=[this.sourceToken];let i={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:s,key:t,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
|
|
308
|
+
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
309
|
+
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){let n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){let s="end"in n.value?n.value.end:void 0;(Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment"?s?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){let r=t.items[t.items.length-2]?.value?.end;if(Array.isArray(r)){ei(r,n.start),r.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){let s=!this.onKeyLine&&this.indent===t.indent,r=s&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",i=[];if(r&&n.sep&&!n.value){let o=[];for(let l=0;l<n.sep.length;++l){let c=n.sep[l];switch(c.type){case"newline":o.push(l);break;case"space":break;case"comment":c.indent>t.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(i=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":r||n.value?(i.push(this.sourceToken),t.items.push({start:i}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):r||n.value?(i.push(this.sourceToken),t.items.push({start:i,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(yt(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(bd(n.key)&&!yt(n.sep,"newline")){let o=yn(n.start),l=n.key,c=n.sep;c.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:l,sep:c}]})}else i.length>0?n.sep=n.sep.concat(i,this.sourceToken):n.sep.push(this.sourceToken);else if(yt(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let o=yn(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||r?t.items.push({start:i,key:null,sep:[this.sourceToken]}):yt(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);r||n.value?(t.items.push({start:i,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(t);if(o){if(o.type==="block-seq"){if(!n.explicitKey&&n.sep&&!yt(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else s&&t.items.push({start:i});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){let n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){let s="end"in n.value?n.value.end:void 0;(Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment"?s?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){let r=t.items[t.items.length-2]?.value?.end;if(Array.isArray(r)){ei(r,n.start),r.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||yt(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){let s=this.startBlockValue(t);if(s){this.stack.push(s);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){let n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let s;do yield*this.pop(),s=this.peek(1);while(s?.type==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let r=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:r,sep:[]}):n.sep?this.stack.push(r):Object.assign(n,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}let s=this.startBlockValue(t);s?this.stack.push(s):(yield*this.pop(),yield*this.step())}else{let s=this.peek(2);if(s.type==="block-map"&&(this.type==="map-value-ind"&&s.indent===t.indent||this.type==="newline"&&!s.items[s.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&s.type!=="flow-collection"){let r=Zr(s),i=yn(r);wd(t);let o=t.end.splice(1,t.end.length);o.push(this.sourceToken);let l={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:i,key:t,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
|
|
310
|
+
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
311
|
+
`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let n=Zr(t),s=yn(n);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=Zr(t),s=yn(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(s=>s.type==="newline"||s.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};vd.Parser=La});var Ad=j(gs=>{"use strict";var Sd=wa(),Wb=as(),ms=us(),Gb=go(),Hb=q(),zb=Da(),kd=Ta();function Ed(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new zb.LineCounter||null,prettyErrors:t}}function Qb(e,t={}){let{lineCounter:n,prettyErrors:s}=Ed(t),r=new kd.Parser(n?.addNewLine),i=new Sd.Composer(t),o=Array.from(i.compose(r.parse(e)));if(s&&n)for(let l of o)l.errors.forEach(ms.prettifyError(e,n)),l.warnings.forEach(ms.prettifyError(e,n));return o.length>0?o:Object.assign([],{empty:!0},i.streamInfo())}function Cd(e,t={}){let{lineCounter:n,prettyErrors:s}=Ed(t),r=new kd.Parser(n?.addNewLine),i=new Sd.Composer(t),o=null;for(let l of i.compose(r.parse(e),!0,e.length))if(!o)o=l;else if(o.options.logLevel!=="silent"){o.errors.push(new ms.YAMLParseError(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&n&&(o.errors.forEach(ms.prettifyError(e,n)),o.warnings.forEach(ms.prettifyError(e,n))),o}function Xb(e,t,n){let s;typeof t=="function"?s=t:n===void 0&&t&&typeof t=="object"&&(n=t);let r=Cd(e,n);if(!r)return null;if(r.warnings.forEach(i=>Gb.warn(r.options.logLevel,i)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:s},n))}function Zb(e,t,n){let s=null;if(typeof t=="function"||Array.isArray(t)?s=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){let r=Math.round(n);n=r<1?void 0:r>8?{indent:8}:{indent:r}}if(e===void 0){let{keepUndefined:r}=n??t??{};if(!r)return}return Hb.isDocument(e)&&!s?e.toString(n):new Wb.Document(e,s,n).toString(n)}gs.parse=Xb;gs.parseAllDocuments=Qb;gs.parseDocument=Cd;gs.stringify=Zb});var _a=j(U=>{"use strict";var ev=wa(),tv=as(),nv=Xo(),Fa=us(),sv=Vn(),wt=q(),rv=pt(),iv=te(),ov=mt(),av=gt(),lv=Qr(),cv=Ia(),uv=Da(),fv=Ta(),ti=Ad(),Nd=Kn();U.Composer=ev.Composer;U.Document=tv.Document;U.Schema=nv.Schema;U.YAMLError=Fa.YAMLError;U.YAMLParseError=Fa.YAMLParseError;U.YAMLWarning=Fa.YAMLWarning;U.Alias=sv.Alias;U.isAlias=wt.isAlias;U.isCollection=wt.isCollection;U.isDocument=wt.isDocument;U.isMap=wt.isMap;U.isNode=wt.isNode;U.isPair=wt.isPair;U.isScalar=wt.isScalar;U.isSeq=wt.isSeq;U.Pair=rv.Pair;U.Scalar=iv.Scalar;U.YAMLMap=ov.YAMLMap;U.YAMLSeq=av.YAMLSeq;U.CST=lv;U.Lexer=cv.Lexer;U.LineCounter=uv.LineCounter;U.Parser=fv.Parser;U.parse=ti.parse;U.parseAllDocuments=ti.parseAllDocuments;U.parseDocument=ti.parseDocument;U.stringify=ti.stringify;U.visit=Nd.visit;U.visitAsync=Nd.visitAsync});function Od(e,t){let n=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)([\s\S]*)$/.exec(e);if(!n)throw new Error(`${t}: missing frontmatter`);let s=new wn.LineCounter,r=(0,wn.parseDocument)(n[1],{lineCounter:s,uniqueKeys:!0,strict:!0});if(r.errors.length){let o=r.errors[0],l=s.linePos(o.pos[0]);throw new Error(`${t}: ${o.code} at line ${l.line+1}, column ${l.col}: ${o.message}`)}if(!(0,wn.isMap)(r.contents))throw new Error(`${t}: frontmatter must be a mapping`);let i=r.toJS({maxAliasCount:10});if(!i||typeof i!="object"||Array.isArray(i))throw new Error(`${t}: frontmatter must be a mapping`);return{fields:i,body:n[2]}}function ni(e,t,n){let s=e[t];if(typeof s!="string"||!s.trim())throw new Error(`${n}: ${t} must be a nonempty string`);return s}function Id(e,t,n){let s=ni(e,"name",t);if(!/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(s)||n!==void 0&&s!==n)throw new Error(`${t}: invalid or mismatched name ${s}`);return{name:s,description:ni(e,"description",t)}}function jd(e,t,n){for(let s of Object.keys(e))if(!t.includes(s))throw new Error(`${n}: unknown field ${s}`)}function Dd(e,t,n){let{fields:s,body:r}=Od(e,t);jd(s,["name","description","argument-hint"],t);let i=Id(s,t,n);return s["argument-hint"]!==void 0&&(i["argument-hint"]=ni(s,"argument-hint",t)),{metadata:i,body:r}}function Ld(e,t,n){let{fields:s,body:r}=Od(e,t);jd(s,["name","description","tools","model","permissionMode","maxTurns","skills","mcpServers"],t);let i=Id(s,t,n);for(let o of["tools","model"])s[o]!==void 0&&(i[o]=ni(s,o,t));if(s.permissionMode!==void 0){if(s.permissionMode!=="default"&&s.permissionMode!=="acceptEdits")throw new Error(`${t}: invalid permissionMode`);i.permissionMode=s.permissionMode}if(s.maxTurns!==void 0){if(typeof s.maxTurns!="number"||!Number.isInteger(s.maxTurns)||s.maxTurns<1)throw new Error(`${t}: maxTurns must be a positive integer`);i.maxTurns=s.maxTurns}for(let o of["skills","mcpServers"]){let l=s[o];if(l!==void 0){if(!Array.isArray(l)||!l.length||!l.every(c=>typeof c=="string"&&c.trim().length>0)||new Set(l).size!==l.length)throw new Error(`${t}: ${o} must be a nonempty, unique string array`);i[o]=l}}return{metadata:i,body:r}}var wn,Pa=K(()=>{"use strict";wn=cl(_a(),1)});import dv from"node:path";function Td(e,t){let n=Ld(e,t,dv.basename(t,".md")),s=n.body.trim().replace(/\.claude\/rules/g,".codex/rules").replace(/\bCLAUDE\.md\b/g,"AGENTS.md"),{name:r,description:i}=n.metadata,o=l=>JSON.stringify(l).replace(/[\u007f]/g,"\\u007f");return`name = ${o(r)}
|
|
312
|
+
description = ${o(i)}
|
|
145
313
|
|
|
146
314
|
developer_instructions = ${o(s)}
|
|
147
|
-
`}async function
|
|
148
|
-
description: Frontend Craft - ${
|
|
315
|
+
`}var Fd=K(()=>{"use strict";Pa()});import ke from"node:path";import bn from"node:fs";import pv from"node:os";async function _d(e){let{contentRoot:t,baseDir:n,cwd:s,dryRun:r,isGlobal:i}=e,o=ke.join(t,"agents"),l=ke.join(n,"agents"),c=ke.join(n,"rules"),a=i?ke.join(pv.homedir(),".agents","skills"):ke.join(s,".agents","skills");if(r&&!e.session){console.log(`[dry-run] codex: ${n}, agents -> ${l}, skills -> ${a}`);return}let{ensureDir:p,readUtf8:f,writeUtf8:u,copyProductSkills:d,copyDir:m,copyFile:h}=J(e);p(l),p(a);for(let S of bn.readdirSync(o)){if(!S.endsWith(".md"))continue;let k=f(ke.join(o,S)),b=Td(k,S);u(ke.join(l,S.replace(/\.md$/,".toml")),b)}d(ke.join(t,"skills"),a);let g=ke.join(t,"templates","shared","rules");!i&&bn.existsSync(g)&&m(g,c);let y=ke.join(t,"templates","codex","AGENTS.md"),w=ke.join(t,"templates","codex","config.toml");if(!i&&bn.existsSync(y)){let S=ke.join(s,"AGENTS.md");bn.existsSync(S)||h(y,S)}let v=ke.join(n,"config.toml");bn.existsSync(w)&&!bn.existsSync(v)&&h(w,v)}var Pd=K(()=>{"use strict";Z();Fd()});import vn from"node:path";import $d from"node:fs";async function Md(e){let{contentRoot:t,baseDir:n,dryRun:s,isGlobal:r}=e;if(s&&!e.session){console.log(`[dry-run] cursor -> ${n}`);return}let{ensureDir:i,copyProductSkills:o,readUtf8:l,writeUtf8:c}=J(e);i(n);let a=vn.join(n,"skills");o(vn.join(t,"skills"),a);let p=vn.join(t,"templates","shared","rules"),f=vn.join(n,"rules");if(!r&&$d.existsSync(p)){i(f);for(let u of $d.readdirSync(p)){if(!u.endsWith(".md"))continue;let d=l(vn.join(p,u)),m=u.replace(/\.md$/,""),h=`---
|
|
316
|
+
description: Frontend Craft - ${m}
|
|
149
317
|
globs: "**/*.{ts,tsx,vue,js,jsx,css,scss,less,html}"
|
|
150
318
|
---
|
|
151
319
|
|
|
152
|
-
`+
|
|
153
|
-
`;
|
|
320
|
+
`+d+`
|
|
321
|
+
`;c(vn.join(f,`${m}.mdc`),h)}}}var qd=K(()=>{"use strict";Z()});import $e from"node:path";import $a from"node:fs";async function Bd(e){let{contentRoot:t,baseDir:n,dryRun:s,isGlobal:r}=e;if(s&&!e.session){console.log(`[dry-run] windsurf -> ${n}`);return}let{ensureDir:i,readUtf8:o,writeUtf8:l,retireManagedFile:c,copyProductSkills:a}=J(e);i(n);let p=$e.join(n,r?"global_workflows":"workflows"),f=$e.join(n,"rules");i(p);let u=$e.join(t,"commands");for(let m of $a.readdirSync(u)){if(!m.endsWith(".md"))continue;let h=o($e.join(u,m));l($e.join(p,m),h),r&&c($e.join(n,"workflows",m))}let d=$e.join(t,"templates","shared","rules");if(!r&&$a.existsSync(d)){i(f);for(let m of $a.readdirSync(d)){if(!m.endsWith(".md"))continue;let h=o($e.join(d,m));l($e.join(f,m),h)}}a($e.join(t,"skills"),$e.join(n,"skills"))}var Rd=K(()=>{"use strict";Z()});import bt from"node:path";import Kd from"node:fs";async function si(e){let{contentRoot:t,baseDir:n,dryRun:s}=e,r=bt.join(n,"commands");if(s&&!e.session){console.log(`[dry-run] opencode/kilo commands -> ${r}`);return}let{ensureDir:i,readUtf8:o,writeUtf8:l,retireManagedFile:c,copyProductSkills:a}=J(e);i(r);let p=bt.join(t,"commands");for(let m of Kd.readdirSync(p)){if(!m.endsWith(".md"))continue;let h=o(bt.join(p,m));l(bt.join(r,m),h),c(bt.join(n,"command",m))}let f=bt.join(n,"skills");i(f),a(bt.join(t,"skills"),f);let u=bt.join(n,"opencode.jsonc"),d=hv(u);if(e.runtime==="opencode"&&(!Kd.existsSync(u)||d)){let m=`{
|
|
154
322
|
"$schema": "https://opencode.ai/config.json",
|
|
155
323
|
"permission": { "bash": "allow" }
|
|
156
324
|
}
|
|
157
|
-
|
|
325
|
+
`;d?e.session.stage(u,Buffer.from(m)):l(u,m)}}function hv(e){try{let t=JSON.parse(ze(e));return t.$schema==="https://opencode.ai/config.json"&&Object.keys(t).length===2&&JSON.stringify(t.permissions)==='{"bash":"allow"}'}catch{return!1}}var Ma=K(()=>{"use strict";Z()});async function Ud(e){return si(e)}var Jd=K(()=>{"use strict";Ma()});async function Yd(e){return si(e)}var Vd=K(()=>{"use strict";Ma()});import Bt from"node:path";import xd from"node:fs";async function Wd(e){let{contentRoot:t,baseDir:n,cwd:s,dryRun:r,isGlobal:i}=e;if(r&&!e.session){console.log(`[dry-run] gemini -> ${n}`);return}let{ensureDir:o,retireManagedTree:l,copyProductSkills:c,copyDir:a,readUtf8:p,writeUtf8:f}=J(e);o(n),l(Bt.join(n,"extensions","frontend-craft","skills")),c(Bt.join(t,"skills"),Bt.join(n,"skills")),a(Bt.join(t,"templates","shared","rules"),Bt.join(n,"rules"));let u=Bt.join(t,"templates","claude","CLAUDE.md"),d=Bt.join(i?n:s,"GEMINI.md");if(!xd.existsSync(d)&&xd.existsSync(u)){let m=i?"./rules/":"./.gemini/rules/",h=p(u).replaceAll(".claude/",".gemini/").replaceAll("CLAUDE.md","GEMINI.md").replaceAll("@./rules/",`@${m}`);f(d,h)}}var Gd=K(()=>{"use strict";Z()});import Je from"node:path";import ri from"node:fs";async function Hd(e){let{contentRoot:t,baseDir:n,dryRun:s,isGlobal:r}=e;if(s&&!e.session){console.log(`[dry-run] copilot -> ${n}`);return}let{ensureDir:i,readUtf8:o,writeUtf8:l,retireManagedFile:c}=J(e);i(n);let a=Je.join(n,"instructions"),p=Je.join(n,"prompts");{i(a);let u=Je.join(t,"templates","shared","rules"),d=[r?`# Frontend Craft - Copilot instructions
|
|
158
326
|
`:`---
|
|
159
327
|
applyTo: "**"
|
|
160
328
|
---
|
|
161
329
|
|
|
162
330
|
# Frontend Craft - Copilot instructions
|
|
163
|
-
`];if(
|
|
164
|
-
## ${
|
|
331
|
+
`];if(ri.existsSync(u))for(let h of ri.readdirSync(u))h.endsWith(".md")&&d.push(`
|
|
332
|
+
## ${h}
|
|
165
333
|
|
|
166
|
-
`,
|
|
334
|
+
`,o(Je.join(u,h)));let m=r?Je.join(n,"copilot-instructions.md"):Je.join(a,"frontend-craft.instructions.md");(!r||!ri.existsSync(m))&&l(m,d.join(""))}if(r){console.log("Copilot global: installed CLI instructions; IDE prompt files require a local install.");return}i(p);let f=Je.join(t,"commands");for(let u of ri.readdirSync(f))u.endsWith(".md")&&(l(Je.join(p,u.replace(/\.md$/,".prompt.md")),o(Je.join(f,u))),c(Je.join(p,u)))}var zd=K(()=>{"use strict";Z()});import Sn from"node:path";async function Qd(e){let{contentRoot:t,baseDir:n,dryRun:s}=e;if(s&&!e.session)return console.log(`[dry-run] antigravity -> ${n}`);let{ensureDir:r,copyProductSkills:i}=J(e);r(n),i(Sn.join(t,"skills"),Sn.join(n,"skills"))}async function Xd(e){let{contentRoot:t,baseDir:n,dryRun:s}=e;if(s&&!e.session)return console.log(`[dry-run] augment -> ${n}`);let{ensureDir:r,copyProductSkills:i}=J(e);r(n),i(Sn.join(t,"skills"),Sn.join(n,"skills"))}async function Zd(e){let{contentRoot:t,baseDir:n,dryRun:s}=e;if(s&&!e.session)return console.log(`[dry-run] codebuddy -> ${n}`);let{ensureDir:r,copyProductSkills:i}=J(e);r(n),i(Sn.join(t,"skills"),Sn.join(n,"skills"))}var ep=K(()=>{"use strict";Z()});import ii from"node:path";import tp from"node:fs";async function np(e){let{contentRoot:t,baseDir:n,dryRun:s,isGlobal:r}=e;if(s&&!e.session)return console.log(`[dry-run] trae -> ${n}`);let{ensureDir:i,readUtf8:o,writeUtf8:l}=J(e),c=ii.join(n,r?"user_rules":"rules");i(c);let a=ii.join(t,"templates","shared","rules"),p=[`---
|
|
167
335
|
alwaysApply: true
|
|
168
336
|
---
|
|
169
337
|
|
|
170
338
|
# Frontend Craft - Trae rules bundle
|
|
171
|
-
`];if(
|
|
172
|
-
## ${
|
|
339
|
+
`];if(tp.existsSync(a))for(let f of tp.readdirSync(a))f.endsWith(".md")&&p.push(`
|
|
340
|
+
## ${f}
|
|
173
341
|
|
|
174
|
-
`,
|
|
175
|
-
`];if(
|
|
176
|
-
## ${
|
|
342
|
+
`,o(ii.join(a,f)));l(ii.join(c,"frontend-craft.md"),p.join(""))}var sp=K(()=>{"use strict";Z()});import Rt from"node:path";import ys from"node:fs";async function rp(e){let{contentRoot:t,baseDir:n,dryRun:s,isGlobal:r}=e;if(s&&!e.session)return console.log(`[dry-run] cline -> ${Rt.join(n,".clinerules")}`);let{readUtf8:i,forgetManagedFile:o,writeUtf8:l}=J(e),c=Rt.join(t,"templates","shared","rules"),a=[`# Frontend Craft - Cline rules
|
|
343
|
+
`];if(ys.existsSync(c))for(let f of ys.readdirSync(c))f.endsWith(".md")&&a.push(`
|
|
344
|
+
## ${f}
|
|
177
345
|
|
|
178
|
-
`,
|
|
179
|
-
name: ${
|
|
180
|
-
description: ${JSON.stringify(
|
|
346
|
+
`,i(Rt.join(c,f)));let p=Rt.join(n,r?"Rules":".clinerules");if(ys.existsSync(p)&&!ys.statSync(p).isDirectory()){let f=`${p}.frontend-craft-backup`;if(ys.existsSync(f))throw new Error(`Cline legacy backup already exists: ${f}. Resolve it before retrying; the original rules were not changed.`);let u=e.session.read(p);e.session.stage(f,u),e.session.stage(p,null),e.session.stage(Rt.join(p,"legacy.md"),u),o(p),console.log(`Cline: migrated legacy rules to ${Rt.join(p,"legacy.md")}; original retained at ${f}.`)}l(Rt.join(p,"frontend-craft.md"),a.join(""))}var ip=K(()=>{"use strict";Z()});import qa from"node:fs";import oi from"node:path";function op(e,t,n){let s=n?J(n).writeUtf8:Vi;if(qa.existsSync(e))for(let r of qa.readdirSync(e)){if(!r.endsWith(".md"))continue;let i=r.slice(0,-3);if(qa.existsSync(oi.join(e,"..","skills",i,"SKILL.md")))continue;let o=ze(oi.join(e,r)),{metadata:{description:l},body:c}=Dd(o,oi.join(e,r),i);s(oi.join(t,i,"SKILL.md"),`---
|
|
347
|
+
name: ${i}
|
|
348
|
+
description: ${JSON.stringify(l)}
|
|
181
349
|
user-invocable: true
|
|
182
350
|
---
|
|
183
351
|
|
|
184
|
-
${
|
|
185
|
-
`)}}async function ql(n){let{contentRoot:e,baseDir:t,cwd:s,dryRun:i,isGlobal:r}=n;if(i)return console.log(`[dry-run] openclaw -> ${t}`);A(t);let o=Oe.join(r?t:s,"skills");if($(Oe.join(e,"skills"),o),$l(Oe.join(e,"commands"),o),at(Oe.join(t,"commands")),r)return;at(Oe.join(t,"skills"));let a=Oe.join(e,"templates","openclaw");if(Ji.existsSync(a))for(let l of Ji.readdirSync(a)){if(!l.endsWith(".md"))continue;let c=Oe.join(s,l);Ji.existsSync(c)||X(Oe.join(a,l),c)}}import W from"node:path";import th from"node:fs";var nh=["fec-security-check.js","fec-format-changed-file.js","fec-run-tests.js","fec-notify.js"];async function Dl(n){let{pluginRoot:e,contentRoot:t,baseDir:s,dryRun:i,isGlobal:r}=n;if(i){console.log(`[dry-run] qoder -> ${s}`);return}ge(W.join(s,"settings.json")),A(s),$(W.join(t,"skills"),W.join(s,"skills")),$(W.join(t,"commands"),W.join(s,"commands")),$(W.join(t,"agents"),W.join(s,"agents")),r||$(W.join(t,"templates","shared","rules"),W.join(s,"rules")),sh(e,W.join(s,"hooks"));let o=Ml(s,r),a=ge(W.join(s,"settings.json"));Yt(W.join(s,"settings.json"),Gt(r?Sr(a,Ml(s,!1)):a,o),o)}function sh(n,e){A(e);for(let t of nh){let s=W.join(n,"dist","hooks",t);if(!th.existsSync(s))throw new Error(`Missing built hook script: ${s}. Run "npm run build" before installing.`);X(s,W.join(e,t))}}function Ml(n,e){let t=s=>e?W.resolve(n,"hooks",s).split(W.sep).join("/"):`.qoder/hooks/${s}`;return{PreToolUse:[zn("Bash|Shell",t("fec-security-check.js"),"Checking command safety...")],PostToolUse:[zn("Write|Edit|MultiEdit",t("fec-format-changed-file.js"),"Running formatter...")],Stop:[zn(".*",t("fec-run-tests.js"),"Running final validation...")],Notification:[zn(".*",t("fec-notify.js"))]}}function zn(n,e,t){return{matcher:n,hooks:[{type:"command",command:`node "${e}"`,...t?{statusMessage:t}:{}}]}}var ne=["claude","codex","cursor","windsurf","opencode","kilo","gemini","copilot","antigravity","augment","trae","codebuddy","cline","openclaw","qoder"],Qn={claude:wr,codex:yl,cursor:Sl,windsurf:wl,opencode:vl,kilo:kl,gemini:Nl,copilot:Il,antigravity:Al,augment:Ol,trae:jl,codebuddy:El,cline:Tl,openclaw:ql,qoder:Dl};import ih from"node:fs";import rh from"node:os";import oh from"node:path";import es from"node:readline";import Xn from"node:os";import _ from"node:path";function U(n){return n&&(n.startsWith("~/")||n==="~"?_.join(Xn.homedir(),n.slice(1)):n)}function Zn(n){let e=Xn.homedir(),t=process.env;switch(n){case"claude":return t.CLAUDE_CONFIG_DIR?U(t.CLAUDE_CONFIG_DIR):_.join(e,".claude");case"cursor":return t.CURSOR_CONFIG_DIR?U(t.CURSOR_CONFIG_DIR):_.join(e,".cursor");case"gemini":return t.GEMINI_CONFIG_DIR?U(t.GEMINI_CONFIG_DIR):_.join(e,".gemini");case"codex":return t.CODEX_HOME?U(t.CODEX_HOME):_.join(e,".codex");case"copilot":return t.COPILOT_CONFIG_DIR?U(t.COPILOT_CONFIG_DIR):_.join(e,".copilot");case"antigravity":return t.ANTIGRAVITY_CONFIG_DIR?U(t.ANTIGRAVITY_CONFIG_DIR):_.join(e,".gemini","config");case"windsurf":return t.WINDSURF_CONFIG_DIR?U(t.WINDSURF_CONFIG_DIR):_.join(e,".codeium","windsurf");case"augment":return t.AUGMENT_CONFIG_DIR?U(t.AUGMENT_CONFIG_DIR):_.join(e,".augment");case"trae":return t.TRAE_CONFIG_DIR?U(t.TRAE_CONFIG_DIR):_.join(e,".trae");case"codebuddy":return t.CODEBUDDY_CONFIG_DIR?U(t.CODEBUDDY_CONFIG_DIR):_.join(e,".codebuddy");case"cline":return t.CLINE_CONFIG_DIR?U(t.CLINE_CONFIG_DIR):_.join(e,"Documents","Cline");case"opencode":return t.OPENCODE_CONFIG_DIR?U(t.OPENCODE_CONFIG_DIR):t.XDG_CONFIG_HOME?_.join(U(t.XDG_CONFIG_HOME),"opencode"):_.join(e,".config","opencode");case"kilo":return t.KILO_CONFIG_DIR?U(t.KILO_CONFIG_DIR):t.XDG_CONFIG_HOME?_.join(U(t.XDG_CONFIG_HOME),"kilo"):_.join(e,".config","kilo");case"openclaw":return t.OPENCLAW_STATE_DIR?U(t.OPENCLAW_STATE_DIR):t.OPENCLAW_CONFIG_DIR?U(t.OPENCLAW_CONFIG_DIR):_.join(e,".openclaw");case"qoder":return t.QODER_CONFIG_DIR?U(t.QODER_CONFIG_DIR):_.join(e,".qoder");default:return t.CLAUDE_CONFIG_DIR?U(t.CLAUDE_CONFIG_DIR):_.join(e,".claude")}}var Vi={claude:".claude",codex:".codex",cursor:".cursor",windsurf:".windsurf",opencode:".opencode",kilo:".kilo",gemini:".gemini",copilot:".github",antigravity:".agent",augment:".augment",trae:".trae",codebuddy:".codebuddy",cline:"",openclaw:".openclaw",qoder:".qoder"};function Ee({runtime:n,isGlobal:e,cwd:t}){if(e)return Zn(n);if(n==="cline")return t;let s=Vi[n]??".claude";return _.join(t,s)}function Pl(n){return n==="antigravity"&&!process.env.ANTIGRAVITY_CONFIG_DIR?[_.join(Xn.homedir(),".gemini","antigravity")]:n==="cline"&&!process.env.CLINE_CONFIG_DIR?[_.join(Xn.homedir(),".cline")]:[]}var ah={claude:"Claude Code",codex:"Codex",cursor:"Cursor",windsurf:"Windsurf",opencode:"OpenCode",kilo:"Kilo",gemini:"Gemini",copilot:"Copilot",antigravity:"Antigravity",augment:"Augment",trae:"Trae",codebuddy:"CodeBuddy",cline:"Cline",openclaw:"OpenClaw",qoder:"Qoder"};function xl(n){let e=rh.homedir();return n===e?"~":n.startsWith(`${e}${oh.sep}`)?`~${n.slice(e.length)}`:n}function lh(n){let e=Vi[n];return e?`./${e}`:"./"}var ts=ne.map((n,e)=>({choice:String(e+1),runtime:n,label:ah[n]??n})),ch=String(ts.length+1);function _l(n){return n.filter((e,t)=>n.indexOf(e)===t)}function uh(n,e,t){return Math.max(e,Math.min(t,n))}function fh(n){return!n||n.ctrl||n.meta?"":typeof n.sequence=="string"&&n.sequence.length===1&&n.sequence>=" "?n.sequence:typeof n.name=="string"&&n.name.length===1?n.name:""}function dh(){return ts.map(n=>{let e=xl(Zn(n.runtime));return{value:n.runtime,label:n.label,description:e,selectedSuffix:"selected"}})}function ph(n){let e=_l(n.map(s=>xl(Zn(s)))).join(", "),t=_l(n.map(s=>lh(s))).join(", ");return[{value:"global",label:"Global",description:`${e} - available in all projects`,selectedSuffix:"selected"},{value:"local",label:"Local",description:`${t} - this project only`,selectedSuffix:"selected"}]}function hh(){return[{value:"en",label:"English",description:"canonical default content",selectedSuffix:"selected"},{value:"zh-CN",label:"简体中文",description:"localized AI-facing content",selectedSuffix:"已选择"}]}function Hi({message:n,options:e,selected:t=[],multiple:s=!0,pageSize:i=15,validate:r=a=>a.length>0,transform:o=(a=>a)}){return{message:n,options:e,selected:t.filter((l,c)=>t.indexOf(l)===c),multiple:s,pageSize:i,search:"",cursor:0,error:"",visibleOptions(){let l=this.search.trim().toLowerCase();return l?this.options.filter(c=>c.label.toLowerCase().includes(l)||c.value.toLowerCase().includes(l)):this.options},move(l){let c=this.visibleOptions();this.cursor=uh(this.cursor+l,0,Math.max(0,c.length-1)),this.error=""},toggle(){let l=this.visibleOptions()[this.cursor];l&&(this.multiple?this.selected.includes(l.value)?this.selected=this.selected.filter(c=>c!==l.value):this.selected=[...this.selected,l.value]:this.selected=[l.value],this.error="")},backspace(){this.search.length>0?(this.search=this.search.slice(0,-1),this.cursor=0):this.selected.length>0&&(this.selected=this.selected.slice(0,-1)),this.error=""},type(l){this.search+=l,this.cursor=0,this.error=""},confirm(){let l=r(this.selected);if(l!==!0){this.error=typeof l=="string"?l:"Select at least one option";return}return o(this.selected)}}}function Rl(n={}){return Hi({message:`Which runtime(s) would you like to install for? (${ts.length} available)`,options:dh(),selected:["claude"],multiple:!0,pageSize:n.pageSize??15,transform:e=>e})}function Fl(n,e={}){return Hi({message:"Where would you like to install?",options:ph(n),selected:["global"],multiple:!1,pageSize:e.pageSize??15,transform:t=>t[0]!=="local"})}function Bl(n={}){return Hi({message:"Which language should frontend-craft install?",options:hh(),selected:["en"],multiple:!1,pageSize:n.pageSize??15,transform:e=>e[0]==="zh-CN"?"zh-CN":"en"})}function Rt(n){let e=n.visibleOptions(),t=new Set(n.selected),s=new Map(n.options.map(o=>[o.value,o])),i=n.selected.length?n.selected.map(o=>s.get(o)?.label??o).join(", "):"(none selected)",r=[`? ${n.message}`,` Selected: ${i}`,` Search: [${n.search||"type to filter"}]`," Up/Down navigate - Space toggle - Backspace remove - Enter confirm"];if(e.length===0)r.push(" No matches");else{let o=Math.max(0,Math.min(n.cursor-Math.floor(n.pageSize/2),e.length-n.pageSize)),a=Math.min(o+n.pageSize,e.length),l=e.slice(o,a);for(let c=0;c<l.length;c++){let u=l[c],d=o+c===n.cursor,h=t.has(u.value),g=d?">":" ",p=h?"[x]":"[ ]",m=u.description?` (${u.description})`:"",S=h?` (${u.selectedSuffix??"selected"})`:m;r.push(` ${g} ${p} ${u.label}${S}`)}if(e.length>n.pageSize){let c=Math.floor(n.cursor/n.pageSize)+1,u=Math.ceil(e.length/n.pageSize);r.push(` (${c}/${u})`)}}return n.error&&r.push(` ${n.error}`),r.join(`
|
|
186
|
-
`)}function mh(){return Rt(Rl())}function gh(n){let t=((n==null?"":String(n)).trim()||"1").split(/[\s,]+/).filter(Boolean);if(t.includes(ch))return ne.slice();let s=[],i=new Set,r=new Map(ts.map(o=>[o.choice,o.runtime]));for(let o of t){let a=r.get(o);!a||i.has(a)||(i.add(a),s.push(a))}return s.length?s:["claude"]}function yh(n){return Rt(Fl(n))}function bh(n){return((n==null?"":String(n)).trim()||"1")!=="2"}function Sh(){return Rt(Bl())}function wh(n){let e=(n==null?"":String(n)).trim()||"1";return e==="2"||e==="zh-CN"?"zh-CN":"en"}var Wi;function Ul(n){return process.stdout.write(n),Wi||(Wi=ih.readFileSync(0,"utf8").split(/\r?\n/)),Wi.shift()??""}function zi(n){return process.env.FRONTEND_CRAFT_FORCE_INTERACTIVE==="1"&&!process.stdin.isTTY?Promise.resolve(Ul(n)):new Promise(e=>{let t=es.createInterface({input:process.stdin,output:process.stdout});t.question(n,s=>{t.close(),e(s)}),t.on("close",()=>e(""))})}async function Qi(n){return process.env.FRONTEND_CRAFT_FORCE_INTERACTIVE==="1"&&!process.stdin.isTTY?Ul(`${Rt(n)}
|
|
187
|
-
|
|
188
|
-
`),r=c.
|
|
189
|
-
|
|
190
|
-
`),
|
|
191
|
-
`)
|
|
192
|
-
`)
|
|
193
|
-
`),
|
|
194
|
-
`)}function
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
`)
|
|
198
|
-
`)}
|
|
199
|
-
`);for(let
|
|
200
|
-
`)}function
|
|
201
|
-
`)
|
|
352
|
+
${c.trim()}
|
|
353
|
+
`)}}var ap=K(()=>{"use strict";Z();Z();Pa()});import vt from"node:path";import Ba from"node:fs";async function lp(e){let{contentRoot:t,baseDir:n,cwd:s,dryRun:r,isGlobal:i}=e;if(r&&!e.session)return console.log(`[dry-run] openclaw -> ${n}`);let{ensureDir:o,copyProductSkills:l,retireManagedTree:c,copyFile:a}=J(e);o(n);let p=vt.join(i?n:s,"skills");if(l(vt.join(t,"skills"),p),op(vt.join(t,"commands"),p,e),c(vt.join(n,"commands")),i)return;c(vt.join(n,"skills"));let f=vt.join(t,"templates","openclaw");if(Ba.existsSync(f))for(let u of Ba.readdirSync(f)){if(!u.endsWith(".md"))continue;let d=vt.join(s,u);Ba.existsSync(d)||a(vt.join(f,u),d)}}var cp=K(()=>{"use strict";Z();ap()});import le from"node:path";import mv from"node:fs";async function up(e){let{pluginRoot:t,contentRoot:n,baseDir:s,dryRun:r,isGlobal:i}=e;if(r&&!e.session){console.log(`[dry-run] qoder -> ${s}`);return}let{ensureDir:o,copyProductSkills:l,copyDir:c}=J(e),{readSettings:a,writeSettings:p}=sr(e,i?Ra(s,!1):{});a(le.join(s,"settings.json")),o(s),l(le.join(n,"skills"),le.join(s,"skills")),c(le.join(n,"commands"),le.join(s,"commands")),c(le.join(n,"agents"),le.join(s,"agents")),i||c(le.join(n,"templates","shared","rules"),le.join(s,"rules")),yv(e,t,le.join(s,"hooks"));let f=Ra(s,i),u=a(le.join(s,"settings.json"));p(le.join(s,"settings.json"),nr(i?Qi(u,Ra(s,!1)):u,f),f)}function yv(e,t,n){let{ensureDir:s,copyFile:r}=J(e);s(n);for(let i of gv){let o=le.join(t,"dist","hooks",i);if(!mv.existsSync(o))throw new Error(`Missing built hook script: ${o}. Run "npm run build" before installing.`);r(o,le.join(n,i))}}function Ra(e,t){let n=s=>t?le.resolve(e,"hooks",s).split(le.sep).join("/"):`.qoder/hooks/${s}`;return{PreToolUse:[ai("Bash|Shell",n("fec-security-check.js"),"Checking command safety...")],PostToolUse:[ai("Write|Edit|MultiEdit",n("fec-format-changed-file.js"),"Running formatter...")],Stop:[ai(".*",n("fec-run-tests.js"),"Running final validation...")],Notification:[ai(".*",n("fec-notify.js"))]}}function ai(e,t,n){return{matcher:e,hooks:[{type:"command",command:`node "${t}"`,...n?{statusMessage:n}:{}}]}}var gv,fp=K(()=>{"use strict";Z();Xi();gv=["fec-security-check.js","fec-format-changed-file.js","fec-run-tests.js","fec-notify.js"]});import Ka from"node:path";var pe,wv,li,ws=K(()=>{"use strict";Mc();Pd();qd();Rd();Jd();Vd();Gd();zd();ep();sp();ip();cp();fp();ve();Lt();rn();pe=["claude","codex","cursor","windsurf","opencode","kilo","gemini","copilot","antigravity","augment","trae","codebuddy","cline","openclaw","qoder"],wv={claude:$c,codex:_d,cursor:Md,windsurf:Bd,opencode:Ud,kilo:Yd,gemini:Wd,copilot:Hd,antigravity:Qd,augment:Xd,trae:np,codebuddy:Zd,cline:rp,openclaw:lp,qoder:up},li=Object.fromEntries(Object.entries(wv).map(([e,t])=>[e,async n=>{if(n.session)return t(n);let s=Ze(n);await Mn({action:n.mode,definition:Xe,context:s,codec:Re,adapter:{configurationFiles:()=>[Ka.join(n.baseDir,"settings.json"),Ka.join(n.isGlobal?n.baseDir:n.cwd,"AGENTS.md"),Ka.join(n.isGlobal?n.baseDir:n.cwd,"GEMINI.md")],async plan(r,i){await t({...n,session:i})}}})}]))});import ci from"node:os";import dp from"node:path";function Ua(e){return Dt({runtime:e,cwd:process.cwd(),home:ci.homedir(),scope:"global",env:process.env,compatibility:"frontend"}).baseDir}function Ye({runtime:e,isGlobal:t,cwd:n}){return Dt({runtime:e,cwd:n,home:ci.homedir(),scope:t?"global":"local",env:process.env,compatibility:"frontend"}).baseDir}function hp(e){return e==="antigravity"&&!process.env.ANTIGRAVITY_CONFIG_DIR?[dp.join(ci.homedir(),".gemini","antigravity")]:e==="cline"&&!process.env.CLINE_CONFIG_DIR?[dp.join(ci.homedir(),".cline")]:[]}var pp,bs=K(()=>{"use strict";ve();pp=Object.fromEntries(Object.entries(Ms).map(([e,t])=>[e,t.localDirectory]))});import nt from"node:fs";import bv from"node:os";import Ie from"node:path";function Kt({cwd:e,runtimes:t=pe,scopes:n=["local","global"],onError:s}){let r=[],i=new Set;for(let o of t)for(let l of n){let c=[Ye({runtime:o,isGlobal:l==="global",cwd:e}),...l==="global"?hp(o):[]];for(let a of c){let p=de(a),f=Ie.resolve(p);if(i.has(f))continue;if(i.add(f),s)try{nt.lstatSync(p)}catch(d){d.code!=="ENOENT"&&s(new Error(`Cannot inspect ownership manifest: ${p}`,{cause:d}));continue}let u=Be(p);if(s&&(!u||u.runtime!==o||u.scope!==l||typeof u.packageVersion!="string"||!u.packageVersion)){s(new Error(`Cannot read ownership manifest: ${p}. Invalid JSON, structure, ownership, or unreadable file; existing files were preserved.`));continue}u&&(u.runtime!==o||u.scope!==l||r.push({runtime:o,scope:l,baseDir:a,manifestPath:p,manifest:u}))}}return r}function mp(e,t,n){if(nt.existsSync(de(t)))return;let s=e.manifest.files.filter(l=>!l.root||l.root==="baseDir"),r=[];for(let l of s){let c=oe(Ie.join(e.baseDir,l.path),[e.baseDir]),a=oe(Ie.join(t,l.path),[t]);if(nt.existsSync(c)){if(!nt.lstatSync(c).isFile())throw new Error("Legacy migration source is not a regular file");if(nt.existsSync(a))throw new Error("Legacy migration target already contains unknown files; existing files were preserved");r.push({path:a,beforeHash:null,after:nt.readFileSync(c)})}}let i={...e.manifest,files:s},o={pluginRoot:"",contentRoot:"",cwd:t,baseDir:t,runtime:e.runtime,isGlobal:e.scope==="global",dryRun:n,mode:"update",language:e.manifest.language??"en"};return console.log(`${n?"[dry-run] ":""}Planning migration ${e.baseDir} -> ${t}; original files remain unchanged.`),{manifest:Re.decode(Buffer.from(JSON.stringify(i)),Ze(o)),mutations:r,legacyManifest:i}}function gp({filePath:e,root:t,baseDir:n,cwd:s}){let r=t==="baseDir"?n:t==="cwd"?s:bv.homedir(),i=Ie.resolve(r),o=Ie.resolve(i,e),l=Ie.relative(i,o);if(!(l.startsWith("..")||Ie.isAbsolute(l)))return o}function yp(e,t){let n=t.map(s=>Ie.resolve(s));for(let s of e.sort((r,i)=>i.length-r.length)){let r=Ie.resolve(s);for(;vv(r,n)&&!n.includes(r)&&!(!nt.existsSync(r)||nt.readdirSync(r).length>0);)nt.rmdirSync(r),r=Ie.dirname(r)}}function vv(e,t){return t.some(n=>{let s=Ie.relative(n,e);return s!==""&&!s.startsWith("..")&&!Ie.isAbsolute(s)})}var ui=K(()=>{"use strict";ws();bs();Z();ve();rn();Lt()});import st from"node:fs";import rt from"node:path";function wp({cwd:e,runtime:t,scope:n}){let s={findings:[],errors:[],exitCode:0};if(t&&!pe.includes(t)||!["local","global"].includes(n))return{findings:[],errors:["Runtime 或安装范围无效"],exitCode:2};let r=new Set,i=0;function o(l,c=0){if(++i>1e4||c>12)throw new Error("迁移引用扫描达到上限,结果不完整");if(r.has(l)||Ev.test(rt.basename(l)))return;r.add(l);let a=st.lstatSync(l);if(a.isSymbolicLink())return;if(a.isDirectory()){if(!kv.has(rt.basename(l)))for(let u of st.readdirSync(l).sort())o(rt.join(l,u),c+1);return}if(!a.isFile()||!Cv.test(l)||a.size>262144)return;let p=st.readFileSync(l);if(p.includes(0))return;let f=p.toString("utf8").split(/\r?\n/);for(let u=0;u<f.length;u++)for(let d of f[u].matchAll(/(?<![a-z0-9-])(fec-(?:typescript-project-standard|drawio-studio|source-driven-development|image-generation|doc-sync|debug-framework|refactoring|tdd-workflow))(?![a-z0-9-])/g)){let m=d[1];Ja[m]?s.findings.push({file:l,line:u+1,id:m,kind:"rename",replacement:Ja[m],message:"旧公共 Skill 入口已改名;同名领域规则文件和历史记录请人工甄别"}):/common|backend|通用|后端|architecture|technical diagram|sequence|data.flow|架构|流程图|序列图|数据流/i.test(f[u])&&s.findings.push({file:l,line:u+1,id:m,kind:"split",replacement:Sv[m],message:"通用任务已拆入公共入口,前端专属任务仍可使用原入口"})}}try{n==="local"&&o(rt.resolve(e));for(let l of t?[t]:pe){let c=Ye({runtime:l,isGlobal:n==="global",cwd:e}),a=de(c),p=Be(a);if(st.existsSync(a)&&!p)throw new Error(`无法读取安装清单:${a}`);if(n==="global"&&p){let u=Ze({pluginRoot:"",contentRoot:"",cwd:e,baseDir:c,runtime:l,isGlobal:!0,dryRun:!0,mode:"install",language:p.language??"en"}),d=Re.decode(Buffer.from(JSON.stringify(p)),u);for(let m of[...d.files,...d.sharedEntries])st.existsSync(m.path)&&o(m.path)}let f=Rn({pluginRoot:"",contentRoot:"",cwd:e,baseDir:c,runtime:l,isGlobal:n==="global",dryRun:!0,mode:"install",language:"en"});f&&s.findings.push(...Ya({cwd:e,baseDir:c,skillsDir:f}).findings)}}catch(l){s.errors.push(l instanceof Error?l.message:String(l))}return s.exitCode=s.errors.length||s.findings.some(l=>l.kind==="conflict")?2:s.findings.length?1:0,s}function Ya({cwd:e,baseDir:t,skillsDir:n,manifest:s,pending:r=[]}){let i=de(t),o=s??Be(i);if(st.existsSync(i)&&!o)throw new Error(`无法读取旧安装清单 manifest:${i}`);let l=new Map;for(let p of o?.files??[]){let f=gp({filePath:p.path,root:p.root??"baseDir",baseDir:t,cwd:e});if(!f)throw new Error(`旧安装清单路径越界:${p.path}`);l.set(f,p.hash)}let c=[],a=[];for(let[p,f]of Object.entries(Ja)){let u=rt.join(n,p),d=new Set,m=!1,h=y=>{let w=st.lstatSync(y);if(w.isSymbolicLink()){m=!0;return}if(w.isDirectory())for(let v of st.readdirSync(y).sort())h(rt.join(y,v));else w.isFile()?d.add(y):m=!0},g=!1;try{st.lstatSync(u),g=!0}catch(y){if(y.code!=="ENOENT")throw y}g&&h(u);for(let y of r){let w=rt.relative(u,y.path);w&&w!==".."&&!w.startsWith(`..${rt.sep}`)&&!rt.isAbsolute(w)&&(y.after===null?d.delete(y.path):d.add(y.path))}!m&&!d.size||(!o||m||[...d].some(y=>{let w=r.find(v=>v.path===y);return l.get(y)!==(w?.after?qn(w.after):Ic(y))})?c.push({file:u,id:p,replacement:f,kind:"conflict",message:"旧公共 Skill 包含用户修改、未知文件或不可确认的所有权,请先处理;安装未改动这些文件"}):(c.push({file:u,id:p,replacement:f,kind:"legacy-install",message:"旧公共 Skill 全部由本产品托管且未修改,可随安装事务退役"}),a.push(...d)))}return{findings:c,retiredFiles:a}}var Ja,Sv,kv,Ev,Cv,Va=K(()=>{"use strict";rn();Lt();Lt();ws();bs();Hi();Z();ui();Ja=Lc,Sv={"fec-image-generation":"cc-technical-diagrams","fec-doc-sync":"cc-doc-sync-core","fec-debug-framework":"cc-debug-methodology","fec-refactoring":"cc-refactoring-core","fec-tdd-workflow":"cc-tdd-methodology"},kv=new Set([".git","node_modules","dist","build","coverage","skill-packages","npm-packages",".superpowers",".worktrees","sessions","history","logs","cache"]),Ev=/^(?:\.env(?:\.|$)|id_rsa|id_ed25519|auth\.json$)|(?:credential|secret|password|private[-_]key)|\.(?:pem|key|p12|pfx)$/i,Cv=/\.(?:md|mdx|txt|json|ya?ml|toml|[cm]?[jt]sx?|sh|ps1|bat|cmd)$/i});import je from"node:path";function xa(e){let t=Rn(e);if(t)return{action:e.mode,skillsDir:t,consumer:{product:Xe.consumerProduct,manifestPath:de(e.baseDir),scope:e.isGlobal?"global":"local"},catalog:tn(e.pluginRoot,e.language)}}function bp(e){return e.runtime==="qoder"?[je.join(e.baseDir,"settings.json")]:e.runtime==="claude"?[je.join(e.baseDir,"settings.json"),je.join(e.baseDir,"CLAUDE.md")]:e.runtime==="codex"?[je.join(e.baseDir,"config.toml"),je.join(e.isGlobal?e.baseDir:e.cwd,"AGENTS.md")]:e.runtime==="gemini"?[je.join(e.isGlobal?e.baseDir:e.cwd,"GEMINI.md")]:e.runtime==="copilot"&&e.isGlobal?[je.join(e.baseDir,"copilot-instructions.md")]:e.runtime==="opencode"?[je.join(e.baseDir,"opencode.jsonc")]:[]}async function vp(e,t,n){let s=n?.(e.dryRun)||void 0,r=xa(e),i=()=>{let l=r?Ya({cwd:e.cwd,baseDir:e.baseDir,skillsDir:r.skillsDir,manifest:s?.legacyManifest,pending:s?.mutations}):{findings:[],retiredFiles:[]},c=l.findings.filter(a=>a.kind==="conflict");if(c.length)throw new Error(c.map(a=>a.file+": "+a.message).join(`
|
|
354
|
+
`));return l};i();let o=await Mn({action:e.mode,definition:Xe,context:Ze(e),codec:Re,...r?{common:r}:{},...s?{seed:s}:{},adapter:{configurationFiles:()=>bp(e),plan:async(l,c)=>{let a=i();for(let p of a.retiredFiles)c.retireTree(p);await t({...e,session:c})}}});e.dryRun&&console.log(`[dry-run] ${e.runtime}: ${e.baseDir}, ${o.changed.length} planned file changes`);for(let l of o.preserved)console.log("Skipped modified file: "+je.relative(e.baseDir,l))}async function Wa(e){let{install:t,cwd:n,dryRun:s,force:r}=e,i={pluginRoot:"",contentRoot:"",cwd:n,baseDir:t.baseDir,runtime:t.runtime,isGlobal:t.scope==="global",dryRun:s,mode:"update",language:t.manifest.language??"en"},o=Ze(i),l=Re.decode(Buffer.from(JSON.stringify(t.manifest)),o),c=t.manifest.common?Rn(i):void 0;if(t.manifest.common){if(!c)throw new Error("安装清单声明了当前 Runtime 不支持的公共 Skill 依赖");let d=ot(c);if(d.target!==t.manifest.common.target||d.ledgerDir!==t.manifest.common.ledgerDir)throw new Error("公共依赖指针不匹配当前 Runtime 的真实目标,保留安装")}let a=[],p=[],f=[];for(let d of t.manifest.files){let m=sn(o,d.root??"baseDir",d.path);if(!l.files.some(g=>g.path===m))continue;let h=Ae(m);h===null?a.push(d.path):h!==d.hash&&!r?f.push(d.path):p.push({path:d.path,modified:h!==d.hash})}let u=await Mn({action:"uninstall",definition:Xe,context:o,codec:Re,forceOwnedRemoval:r,...c?{common:{action:"uninstall",skillsDir:c,consumer:{product:Xe.consumerProduct,manifestPath:t.manifestPath,scope:t.scope}}}:{},adapter:{configurationFiles:()=>bp(i),async plan(){}}});for(let d of u.preserved)f.some(m=>sn(o,t.manifest.files.find(h=>h.path===m)?.root??"baseDir",m)===d)||f.push(je.relative(i.baseDir,d).split(je.sep).join("/"));return s||yp(p.map(d=>je.dirname(sn(o,t.manifest.files.find(m=>m.path===d.path)?.root??"baseDir",d.path))),o.allowedRoots),s&&console.log(`[dry-run] ${i.runtime}: ${u.changed.length} planned file changes`),{removed:p,skipped:f,missing:a}}var Sp=K(()=>{"use strict";ve();Lt();rn();Hi();er();Z();Va();ui()});ve();import xi from"node:fs";import tr from"node:path";ve();var Oc=[jt("react",["react"],["ui"]),jt("vue",["vue"],["ui"]),jt("next",["next"],["ui"]),jt("nuxt",["nuxt"],["ui"]),jt("vite",["vite"],["ui"]),jt("angular",["@angular/core"],["ui"])];er();function Tm(e){let t=tn(e.productRoot,"en"),n=Object.fromEntries(t.skills.map(o=>[o.id,o.sourcePackage]));for(let o of xi.readdirSync(tr.join(e.productRoot,"skills"),{withFileTypes:!0}))o.isDirectory()&&o.name.startsWith("fec-")&&xi.existsSync(tr.join(e.productRoot,"skills",o.name,"SKILL.md"))&&(n[o.name]="@bovinphang/frontend-craft");let s=JSON.parse(xi.readFileSync(tr.join(e.productRoot,"skills/metadata.json"),"utf8")),r=nc(s,n),i=dc({workspace:e.workspace,taskPath:e.taskPath,detectors:Oc});return{...i,recommendations:Nc({inspection:i,catalog:r,task:{path:e.taskPath,kind:e.taskKind}})}}function jc(e,t,n){let s,r,i;for(let o=0;o<e.length;o++){let l=e[o];if(l!=="--json")if(l==="--task-path"||l==="--task-kind"){let c=e[++o];if(!c||c.startsWith("-")||c.includes("\0"))throw new Error("Missing or invalid "+l);if(l==="--task-path")r=c;else{if(!Zs.includes(c))throw new Error("Unknown task kind: "+c);i=c}}else{if(l.startsWith("-"))throw new Error("Unknown option: "+l);if(s!==void 0)throw new Error("inspect accepts one workspace");s=l}}return Tm({workspace:tr.resolve(n,s??"."),productRoot:t,taskPath:r,taskKind:i})}Sp();ve();ws();er();Va();import R from"node:fs";import M from"node:path";import lS from"node:os";import cS from"node:readline";import pi from"node:fs";import hi from"node:path";import Lv from"node:readline/promises";var Ep=cl(_a(),1);import me from"node:fs";import P from"node:path";import Av from"node:os";import{spawn as Nv}from"node:child_process";var ee="@bovinphang/frontend-craft",Cp=(e,t,n)=>new Promise((s,r)=>{let i=Nv(e,t,{...n,shell:!1,windowsHide:!0,stdio:n.stdio==="inherit"?"inherit":["ignore","pipe","pipe"]}),o="";i.stdout?.on("data",l=>{o+=String(l)}),i.stderr?.resume(),i.on("error",r),i.on("close",l=>{s({code:l??1,stdout:o})})});function Ov(e,t,n=process.platform){if(n!=="win32"||!/\.(?:cmd|bat)$/i.test(e))return{name:t,file:e};let s=P.dirname(e),i=[...me.readFileSync(e,"utf8").matchAll(/"([^"\r\n]+\.(?:cjs|mjs|js))"/gi)].map(o=>o[1].replace(/^[A-Z_][A-Z_0-9]*=/i,"").replace(/%~dp0%?/gi,s+P.sep).replace(/%dp0%/gi,s+P.sep).replace(/[\\/]/g,P.sep));for(let o of i)if(!(o.includes("%")||!me.existsSync(o))&&!(t==="npm"&&!/[\\/]npm-cli\.js$/i.test(o))&&!(t==="pnpm"&&!/[\\/]pnpm\.(?:cjs|mjs|js)$/i.test(o)))return{name:t,file:process.execPath,args:[me.realpathSync(o)]};return null}function Ap(e=process.env){let t=[],n=new Set;for(let s of(e.PATH??e.Path??"").split(P.delimiter))for(let r of["npm","pnpm"])for(let i of process.platform==="win32"?[".cmd",".exe"]:[""]){let o=P.resolve(s.replace(/^"|"$/g,""),r+i);if(!(!me.existsSync(o)||n.has(o))){n.add(o);try{let l=Ov(o,r);l&&t.push(l)}catch{}}}return t}async function Me(e,t,n){let s=await n.runner(e.file,[...e.args??[],...t],{cwd:n.cwd??process.cwd(),env:n.env??process.env,stdio:"pipe"});if(s.code!==0)throw new Error(`${e.name} 查询失败:${t[0]??"未知命令"}`);return s.stdout.trim()}function fi(e,t){try{return me.realpathSync(e)===me.realpathSync(t)}catch{return!1}}function di(e){return JSON.parse(me.readFileSync(e,"utf8"))}function he(e){return e&&typeof e=="object"?e:{}}function St(e){return typeof e=="string"&&/^https?:\/\//.test(e)}function Iv(e){return typeof e=="string"&&/^(?:[~^]?\d|\*|latest$)/.test(e)&&!/(?:file:|link:|workspace:|git|https?:)/.test(e)}function Ga(e){if(!St(e))return null;try{let t=new URL(e),n=decodeURIComponent(t.pathname),s=`/${ee}/-/frontend-craft-`,r=n.lastIndexOf(s);return r<0||!n.endsWith(".tgz")?null:t.origin+n.slice(0,r+1)}catch{return null}}function kn(e){let t=new URL(e);return t.origin+t.pathname.replace(/\/?$/,"/")}async function kp(e,t){try{let n=await Me(e,["config","get","@bovinphang:registry"],t);if(St(n))return n}catch{}return Me(e,["config","get","registry"],t)}function jv(e,t){if(t.link||t.resolved&&!St(t.resolved))return null;if(t.resolved)return Ga(t.resolved);try{let n=di(P.join(e,".package-lock.json")),s=he(he(n.packages)[`node_modules/${ee}`]);return s.link?null:Ga(s.resolved)}catch{return null}}function Dv(e){let t=P.dirname(P.dirname(e));if(P.basename(t)!=="node_modules")return null;let n=P.dirname(t),s=P.basename(n)==="lib"?P.dirname(n):n;try{let r=di(P.join(e,"package.json")),i=typeof r.bin=="string"?r.bin:he(r.bin).fec;if(typeof i!="string")return null;let o=P.resolve(e,i);if(fi(P.join(s,"bin","fec"),o))return s;let l=me.readFileSync(P.join(s,"fec.cmd"),"utf8");for(let c of l.matchAll(/"([^"\r\n]+\.(?:cjs|mjs|js))"/gi)){let a=c[1].replace(/^[A-Z_][A-Z_0-9]*=/i,"").replace(/%~dp0%?/gi,s+P.sep).replace(/%dp0%/gi,s+P.sep).replace(/[\\/]/g,P.sep);if(fi(a,o))return s}}catch{}return null}async function Ha(e,t){let n=me.realpathSync(e),s=new Map,r=!1;for(let l of t.managers)try{let c=await kp(l,t);if(!St(c))continue;if(l.name==="npm"){let p=await Me(l,["prefix","--global"],t),f=Dv(e),u=new Set([p,...f?[f]:[]]);for(let d of u){let m=await Me(l,["root","--global","--prefix",d],t);if(!fi(P.join(m,ee),n))continue;let h=JSON.parse(await Me(l,["ls","--global","--depth=0","--json","--long","--prefix",d],t)),g=he(he(h.dependencies)[ee]),y=jv(m,g);if(y){if(kn(y)!==kn(c)){r=!0;continue}s.set(`npm:${me.realpathSync(d)}`,{kind:"global",manager:l,prefix:d,registry:c,packageRoot:n,shared:!1})}}continue}let a=JSON.parse(await Me(l,["list","--global","--depth=0","--json"],t));for(let p of Array.isArray(a)?a:[a]){let f=he(p);if(typeof f.path!="string")continue;let u=he(he(f.dependencies)[ee]),d=P.join(f.path,"node_modules",ee);if(!fi(d,n))continue;let m=di(P.join(f.path,"package.json")),h=he(m.dependencies);if(!Iv(h[ee]))continue;let g=me.readFileSync(P.join(f.path,"pnpm-lock.yaml"),"utf8");if(/(?:file:|link:|workspace:)/.test(g)||!g.includes(`${ee}@`)||!g.includes("integrity:")||u.resolved&&!St(u.resolved))continue;let y=he((0,Ep.parse)(me.readFileSync(P.join(f.path,"node_modules",".modules.yaml"),"utf8"))),w=he(y.registries),v=w["@bovinphang"]??w.default;if(!St(v))continue;if(kn(v)!==kn(c)){r=!0;continue}let S=P.dirname(f.path),k=/^v\d+$/.test(P.basename(S))?P.dirname(S):P.dirname(f.path);s.set(`pnpm:${me.realpathSync(f.path)}`,{kind:"global",manager:l,prefix:f.path,globalDir:k,registry:c,packageRoot:n,shared:Object.keys(h).some(b=>b!==ee)})}}catch{}if(s.size>1)throw new Error("CLI 安装来源归属不唯一,已拒绝自动操作。");if(s.size===1)return[...s.values()][0];if(r)throw new Error("当前有效 registry 与安装记录的注册表来源不一致,请恢复原 registry(含 @bovinphang:registry)配置后重试。");let i=t.env??process.env,o=[i.npm_config_cache,P.join(Av.homedir(),".npm"),i.LOCALAPPDATA&&P.join(i.LOCALAPPDATA,"npm-cache")].filter(l=>!!l);for(let l of t.managers.filter(c=>c.name==="npm"))try{let c=await Me(l,["config","get","cache"],t);P.isAbsolute(c)&&o.push(c)}catch{}for(let l of o){let c=P.relative(P.resolve(l,"_npx"),n);if(c.startsWith("..")||P.isAbsolute(c))continue;let a=c.split(P.sep);if(!(a.length!==4||a[1]!=="node_modules"||a.slice(2).join("/")!==ee))try{let p=di(P.join(l,"_npx",a[0],"package-lock.json")),f=he(he(p.packages)[`node_modules/${ee}`]);if(!St(f.resolved)||f.link)continue;let u=t.managers.find(h=>h.name==="npm");if(!u)continue;let d=await kp(u,t),m=Ga(f.resolved);if(m&&St(d)&&kn(m)===kn(d))return{kind:"temporary",manager:u,registry:d,packageRoot:n}}catch{}}throw new Error("无法验证 CLI 的注册表全局安装来源;源码链接、项目依赖和未知来源不支持自身管理。请使用原安装方式管理 CLI。")}async function Np(e,t){if(e.manager.name==="npm"){let r=await Me(e.manager,["root","--global","--prefix",e.prefix],t);return me.realpathSync(P.join(r,ee))}let n=JSON.parse(await Me(e.manager,["list","--global","--depth=0","--json",...e.globalDir?["--global-dir",e.globalDir]:[]],t)),s=[];for(let r of Array.isArray(n)?n:[n]){let i=he(r);typeof i.path=="string"&&he(i.dependencies)[ee]&&s.push(me.realpathSync(P.join(i.path,"node_modules",ee)))}if(s.length!==1)throw new Error("无法唯一定位更新后的 pnpm CLI 包。");return s[0]}function Op(e){let t=JSON.parse(pi.readFileSync(hi.join(e,"package.json"),"utf8"));if(t.name!==ee||!t.version)throw new Error("CLI 包名称或版本无效。");let n=typeof t.bin=="string"?t.bin:t.bin?.fec;if(!n)throw new Error("CLI 包缺少 fec 入口。");let s=pi.realpathSync(hi.resolve(e,n));if(!pi.statSync(s).isFile())throw new Error("CLI 入口不是文件。");let r=hi.relative(pi.realpathSync(e),s);if(r.startsWith("..")||hi.isAbsolute(r))throw new Error("CLI 入口超出安装目录。");return{version:t.version,entry:s}}function Tv(e,t){let n=e==="update"?["--dry-run"]:["--dry-run","--yes","-y","--purge"];if(t.some(s=>!n.includes(s))){let s=t.filter(r=>!["--purge","--yes","-y"].includes(r));throw new Error(`顶层 ${e} 仅管理 CLI,不接受 runtime 或旧资源参数。资源操作请使用:fec runtime ${e}${s.length?" "+s.join(" "):""}`)}return{dryRun:t.includes("--dry-run"),yes:t.includes("--yes")||t.includes("-y"),purge:t.includes("--purge")}}async function Fv(){let e=Lv.createInterface({input:process.stdin,output:process.stdout});try{return/^(?:y|yes)$/i.test((await e.question("确认卸载 fec CLI?[y/N] ")).trim())}finally{e.close()}}function _v(e={}){return async(t,n,s)=>{let r=e.log??console.log,i=e.fail??(()=>{process.exitCode=1}),o=e.env??process.env,l={runner:e.runner??Cp,managers:e.managers??Ap(o),cwd:s.cwd,env:o};try{let c=Tv(t,n),a=await Ha(s.pluginRoot,l);if(a.kind==="temporary"&&t==="uninstall")throw new Error("npm exec/npx 临时运行不支持卸载 CLI(包括 --purge);请使用 fec runtime uninstall 清理资源。");if(a.kind==="global"&&a.shared)throw new Error("pnpm 共享安装组包含其他包,自动更新或卸载可能删除整组;请先用原 pnpm 将 fec 单独安装后重试。未清理任何资源。");let p=t==="update"||c.purge?s.describeResources():[];if(t==="update"){let d=Op(a.packageRoot),m=await Me(a.manager,["view",`${ee}@latest`,"version","--json","--registry",a.registry],l),h=JSON.parse(m);if(typeof h!="string"||!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(h))throw new Error("registry latest 返回无效版本。");if(r(`CLI ${d.version} → ${h};来源 ${a.manager.name}`),a.kind==="temporary"&&d.version!==h)throw new Error(`当前 npm exec 缓存不是最新版。请运行:npx ${ee}@latest runtime update`);if(r(`资源范围:当前项目与用户全局的托管安装
|
|
355
|
+
${p.length?p.join(`
|
|
356
|
+
`):"未发现托管资源"}`),c.dryRun){r("[dry-run] 仅查询与预览,不安装、不启动资源更新。");return}let g=a.packageRoot;if(a.kind==="global"&&d.version!==h){let v=a.manager.name==="npm"?["install","--global",`${ee}@${h}`,"--prefix",a.prefix,"--registry",a.registry]:["add","--global",`${ee}@${h}`,"--global-dir",a.globalDir,"--registry",a.registry];if((await l.runner(a.manager.file,[...a.manager.args??[],...v],{cwd:s.cwd,env:o,stdio:"inherit"})).code!==0)throw new Error("CLI 更新失败,已停止资源更新。");g=await Np(a,l);let k=await Ha(g,{...l,managers:[a.manager]});if(k.kind!=="global"||k.shared)throw new Error("更新后的 CLI 安装来源验证失败。")}let y=Op(g);if(y.version!==h)throw new Error(`更新后的 CLI 版本验证失败:预期 ${h},实际 ${y.version}。请用原包管理器检查安装。`);if((await l.runner(process.execPath,[y.entry,"runtime","update"],{cwd:s.cwd,env:o,stdio:"inherit"})).code!==0)throw new Error("CLI 已就绪,但资源更新失败;请重试 fec runtime update。CLI 不回滚。");r("CLI 与托管资源更新完成。");return}if(a.kind!=="global")return;if(r(`卸载范围:${a.manager.name} 全局 CLI(${a.packageRoot})`),c.purge&&r(`资源清理范围:
|
|
357
|
+
${p.length?p.join(`
|
|
358
|
+
`):"未发现托管资源"}`),c.dryRun){if(c.purge&&!await s.purgeResources(!0))throw new Error("资源清理预览失败。");r("[dry-run] 不删除资源或卸载 CLI。");return}if(!c.yes){if(!(e.isTTY??!!(process.stdin.isTTY&&process.stdout.isTTY)))throw new Error("非交互环境卸载 CLI 必须显式传入 --yes。");if(!await(e.confirm??Fv)()){r("已取消卸载。");return}}if(c.purge&&!await s.purgeResources(!1))throw new Error("资源清理出现错误,保留 CLI 以便重试。请运行 fec runtime uninstall。");let f=a.manager.name==="npm"?["uninstall","--global",ee,"--prefix",a.prefix,"--registry",a.registry]:["remove","--global",ee,"--global-dir",a.globalDir,"--registry",a.registry];if((await l.runner(a.manager.file,[...a.manager.args??[],...f],{cwd:s.cwd,env:o,stdio:"inherit"})).code!==0)throw new Error("CLI 卸载失败,请使用原包管理器重试。");r(c.purge?"CLI 卸载完成;用户修改导致跳过的资源(如有)予以保留。":"CLI 卸载完成,托管资源予以保留。可用 npx @bovinphang/frontend-craft@latest runtime uninstall 清理。")}catch(c){r(c instanceof Error?c.message:String(c)),i()}}}var Ip=_v();ws();bs();import Pv from"node:fs";import $v from"node:os";import Mv from"node:path";import mi from"node:readline";var qv={claude:"Claude Code",codex:"Codex",cursor:"Cursor",windsurf:"Windsurf",opencode:"OpenCode",kilo:"Kilo",gemini:"Gemini",copilot:"Copilot",antigravity:"Antigravity",augment:"Augment",trae:"Trae",codebuddy:"CodeBuddy",cline:"Cline",openclaw:"OpenClaw",qoder:"Qoder"};function Dp(e){let t=$v.homedir();return e===t?"~":e.startsWith(`${t}${Mv.sep}`)?`~${e.slice(t.length)}`:e}function Bv(e){let t=pp[e];return t?`./${t}`:"./"}var gi=pe.map((e,t)=>({choice:String(t+1),runtime:e,label:qv[e]??e})),Rv=String(gi.length+1);function jp(e){return e.filter((t,n)=>e.indexOf(t)===n)}function Kv(e,t,n){return Math.max(t,Math.min(n,e))}function Uv(e){return!e||e.ctrl||e.meta?"":typeof e.sequence=="string"&&e.sequence.length===1&&e.sequence>=" "?e.sequence:typeof e.name=="string"&&e.name.length===1?e.name:""}function Jv(){return gi.map(e=>{let t=Dp(Ua(e.runtime));return{value:e.runtime,label:e.label,description:t,selectedSuffix:"selected"}})}function Yv(e){let t=jp(e.map(s=>Dp(Ua(s)))).join(", "),n=jp(e.map(s=>Bv(s))).join(", ");return[{value:"global",label:"Global",description:`${t} - available in all projects`,selectedSuffix:"selected"},{value:"local",label:"Local",description:`${n} - this project only`,selectedSuffix:"selected"}]}function Vv(){return[{value:"en",label:"English",description:"canonical default content",selectedSuffix:"selected"},{value:"zh-CN",label:"简体中文",description:"localized AI-facing content",selectedSuffix:"已选择"}]}function Qa({message:e,options:t,selected:n=[],multiple:s=!0,pageSize:r=15,validate:i=l=>l.length>0,transform:o=l=>l}){return{message:e,options:t,selected:n.filter((c,a)=>n.indexOf(c)===a),multiple:s,pageSize:r,search:"",cursor:0,error:"",visibleOptions(){let c=this.search.trim().toLowerCase();return c?this.options.filter(a=>a.label.toLowerCase().includes(c)||a.value.toLowerCase().includes(c)):this.options},move(c){let a=this.visibleOptions();this.cursor=Kv(this.cursor+c,0,Math.max(0,a.length-1)),this.error=""},toggle(){let c=this.visibleOptions()[this.cursor];c&&(this.multiple?this.selected.includes(c.value)?this.selected=this.selected.filter(a=>a!==c.value):this.selected=[...this.selected,c.value]:this.selected=[c.value],this.error="")},backspace(){this.search.length>0?(this.search=this.search.slice(0,-1),this.cursor=0):this.selected.length>0&&(this.selected=this.selected.slice(0,-1)),this.error=""},type(c){this.search+=c,this.cursor=0,this.error=""},confirm(){let c=i(this.selected);if(c!==!0){this.error=typeof c=="string"?c:"Select at least one option";return}return o(this.selected)}}}function Lp(e={}){return Qa({message:`Which runtime(s) would you like to install for? (${gi.length} available)`,options:Jv(),selected:["claude"],multiple:!0,pageSize:e.pageSize??15,transform:t=>t})}function Tp(e,t={}){return Qa({message:"Where would you like to install?",options:Yv(e),selected:["global"],multiple:!1,pageSize:t.pageSize??15,transform:n=>n[0]!=="local"})}function Fp(e={}){return Qa({message:"Which language should frontend-craft install?",options:Vv(),selected:["en"],multiple:!1,pageSize:e.pageSize??15,transform:t=>t[0]==="zh-CN"?"zh-CN":"en"})}function vs(e){let t=e.visibleOptions(),n=new Set(e.selected),s=new Map(e.options.map(o=>[o.value,o])),r=e.selected.length?e.selected.map(o=>s.get(o)?.label??o).join(", "):"(none selected)",i=[`? ${e.message}`,` Selected: ${r}`,` Search: [${e.search||"type to filter"}]`," Up/Down navigate - Space toggle - Backspace remove - Enter confirm"];if(t.length===0)i.push(" No matches");else{let o=Math.max(0,Math.min(e.cursor-Math.floor(e.pageSize/2),t.length-e.pageSize)),l=Math.min(o+e.pageSize,t.length),c=t.slice(o,l);for(let a=0;a<c.length;a++){let p=c[a],u=o+a===e.cursor,d=n.has(p.value),m=u?">":" ",h=d?"[x]":"[ ]",g=p.description?` (${p.description})`:"",y=d?` (${p.selectedSuffix??"selected"})`:g;i.push(` ${m} ${h} ${p.label}${y}`)}if(t.length>e.pageSize){let a=Math.floor(e.cursor/e.pageSize)+1,p=Math.ceil(t.length/e.pageSize);i.push(` (${a}/${p})`)}}return e.error&&i.push(` ${e.error}`),i.join(`
|
|
359
|
+
`)}function xv(){return vs(Lp())}function Wv(e){let n=((e==null?"":String(e)).trim()||"1").split(/[\s,]+/).filter(Boolean);if(n.includes(Rv))return pe.slice();let s=[],r=new Set,i=new Map(gi.map(o=>[o.choice,o.runtime]));for(let o of n){let l=i.get(o);!l||r.has(l)||(r.add(l),s.push(l))}return s.length?s:["claude"]}function Gv(e){return vs(Tp(e))}function Hv(e){return((e==null?"":String(e)).trim()||"1")!=="2"}function zv(){return vs(Fp())}function Qv(e){let t=(e==null?"":String(e)).trim()||"1";return t==="2"||t==="zh-CN"?"zh-CN":"en"}var za;function _p(e){return process.stdout.write(e),za||(za=Pv.readFileSync(0,"utf8").split(/\r?\n/)),za.shift()??""}function Xa(e){return process.env.FRONTEND_CRAFT_FORCE_INTERACTIVE==="1"&&!process.stdin.isTTY?Promise.resolve(_p(e)):new Promise(t=>{let n=mi.createInterface({input:process.stdin,output:process.stdout});n.question(e,s=>{n.close(),t(s)}),n.on("close",()=>t(""))})}async function Za(e){return process.env.FRONTEND_CRAFT_FORCE_INTERACTIVE==="1"&&!process.stdin.isTTY?_p(`${vs(e)}
|
|
360
|
+
`):new Promise(t=>{let n=process.stdin,s=process.stdout,r=n.isRaw,i=0;function o(){i>0&&(mi.moveCursor(s,0,-i),mi.clearScreenDown(s));let a=vs(e);s.write(a),s.write(`
|
|
361
|
+
`),i=a.split(`
|
|
362
|
+
`).length}function l(){n.off("keypress",c),n.isTTY&&n.setRawMode(!!r),n.pause()}function c(a,p){if(p?.ctrl&&p.name==="c"){l(),s.write(`
|
|
363
|
+
`),process.exitCode=130,t(void 0);return}if(p?.name==="return"||p?.name==="enter"){let f=e.confirm();o(),f!==void 0&&(l(),t(f));return}if(p?.name==="up")e.move(-1);else if(p?.name==="down")e.move(1);else if(p?.name==="space")e.toggle();else if(p?.name==="backspace")e.backspace();else{let f=Uv(p);f&&e.type(f)}o()}mi.emitKeypressEvents(n),n.isTTY&&n.setRawMode(!0),n.resume(),n.on("keypress",c),o()})}async function Pp(){if(process.stdin.isTTY){let e=await Za(Lp());return Array.isArray(e)?e:["claude"]}return console.log(`${xv()}
|
|
364
|
+
`),Wv(await Xa("Choice [1]: "))}async function $p(e){if(process.stdin.isTTY){let t=await Za(Tp(e));return typeof t=="boolean"?t:!0}return console.log(`${Gv(e)}
|
|
365
|
+
`),Hv(await Xa("Choice [1]: "))}async function Mp(){return process.stdin.isTTY?await Za(Fp())==="zh-CN"?"zh-CN":"en":(console.log(`${zv()}
|
|
366
|
+
`),Qv(await Xa("Choice [1]: ")))}import Xv from"node:fs";import Zv from"node:path";var Ut="en",yi=["en","zh-CN"];function el(e){return yi.includes(e)}function eS(e){if(e!=null)return el(e)?e:void 0}function qp(e){return eS(e)??Ut}function tl(e,t){if(t===Ut)return e;let n=Zv.join(e,"localized",t);if(!Xv.existsSync(n))throw new Error(`Missing localized content pack for language "${t}": ${n}`);return n}bs();Gi();import Bp from"node:fs";import En from"node:path";import{fileURLToPath as Rp}from"node:url";function Kp(e=import.meta.url){let t=En.dirname(Rp(e));for(;;){if(Bp.existsSync(En.join(t,"package.json"))&&Bp.existsSync(En.join(t,"skills")))return t;let n=En.dirname(t);if(n===t)return En.resolve(En.dirname(Rp(e)),"../..");t=n}}Z();ui();import Ee from"node:fs";import nl from"node:os";import we from"node:path";function sl({claudeConfigDir:e=il(),currentVersion:t}){let n=we.join(e,"plugins","cache","frontend-craft","frontend-craft"),s=nS(e),r=tS({cacheDir:n,currentInstallPaths:s.paths,currentVersion:t}),i=s.warning,o=!i&&s.paths.length>0;return{claudeConfigDir:e,cacheDir:n,currentInstallPaths:s.paths,entries:r.map(l=>({...l,shouldDelete:o&&l.shouldDelete,reasons:o?l.reasons:["metadata unavailable"]})),canDelete:o,warning:i}}function Vp({claudeConfigDir:e=il(),currentVersion:t,dryRun:n=!1}){let s=sl({claudeConfigDir:e,currentVersion:t}),r=[];if(s.canDelete)for(let i of s.entries)i.shouldDelete&&(n||Ee.rmSync(i.path,{recursive:!0,force:!0}),n||r.push(i));return{...s,deleted:r}}function rl({claudeConfigDir:e=il(),cwd:t=process.cwd()}={}){let n=sS(e),s=[Up(we.join(t,".claude","frontend-craft.manifest.json"),"local"),Up(we.join(e,"frontend-craft.manifest.json"),"global")].filter(r=>r!==void 0);return{native:n,cli:s,hasMultipleActiveSources:n.length+s.length>1}}function Ss(e){let t=["install sources:"];if(e.native.length===0&&e.cli.length===0)return t.push(" none detected"),t.join(`
|
|
367
|
+
`);for(let n of e.native){let s=[n.version,n.scope].filter(Boolean).join(", ");t.push(` native plugin: ${s||"installed"}${n.installPath?` (${n.installPath})`:""}`)}for(let n of e.cli)t.push(` ${n.scope} CLI: ${n.packageVersion??"unknown"} (${n.manifestPath})`);return e.hasMultipleActiveSources&&t.push(" warning: multiple active sources detected; keep one Claude loader as the source of truth"),t.join(`
|
|
368
|
+
`)}function wi(e,t="report"){let n=["native cache:"];if(n.push(` current installs: ${e.currentInstallPaths.length?e.currentInstallPaths.join(", "):"unknown"}`),e.warning&&n.push(` warning: ${e.warning}`),e.entries.length===0)return n.push(" entries: none"),n.join(`
|
|
369
|
+
`);for(let s of e.entries){let r=s.isCurrent?"current install":s.reasons.length?s.reasons.join(", "):"healthy",i=t==="dry-run"&&s.shouldDelete?"would delete":t==="fix"&&s.shouldDelete?"delete":"keep";n.push(` ${i} ${s.version}: ${r}`)}return n.join(`
|
|
370
|
+
`)}function xp(e,t){if(t)return wi(e,"dry-run");let n=[wi(e,"fix")];for(let s of e.deleted)n.push(` deleted ${s.version}: ${s.path}`);return e.deleted.length===0&&n.push(" deleted: none"),n.join(`
|
|
371
|
+
`)}function il(){return aS(process.env.CLAUDE_CONFIG_DIR??we.join(nl.homedir(),".claude"))}function tS({cacheDir:e,currentInstallPaths:t,currentVersion:n}){if(!Ee.existsSync(e))return[];let s=new Set(t.map(Yp));return Ee.readdirSync(e,{withFileTypes:!0}).filter(r=>r.isDirectory()).map(r=>{let i=we.join(e,r.name),o=iS(i),l=Ee.existsSync(we.join(i,"dist")),c=Ee.existsSync(we.join(i,".orphaned_at")),a=s.has(Yp(i)),p=[];return c&&p.push("orphaned"),l||p.push("missing dist"),o&&oS(o,n)<0&&p.push(`package ${o} < ${n}`),{version:r.name,path:i,isCurrent:a,hasDist:l,orphaned:c,packageVersion:o,reasons:p,shouldDelete:!a&&p.length>0}}).sort((r,i)=>r.version.localeCompare(i.version,void 0,{numeric:!0}))}function nS(e){let t=we.join(e,"plugins","installed_plugins.json");if(!Ee.existsSync(t))return{paths:[],warning:`missing ${t}; refusing to delete cache entries`};try{let n=JSON.parse(Ee.readFileSync(t,"utf8")),s=(n.plugins?.["frontend-craft@bovinphang/frontend-craft"]??n.plugins?.["frontend-craft@frontend-craft"]??[]).map(r=>r.installPath).filter(r=>typeof r=="string"&&r.length>0).map(r=>we.resolve(r));return s.length===0?{paths:s,warning:`missing frontend-craft plugin entry in ${t}; refusing to delete cache entries`}:{paths:s}}catch{return{paths:[],warning:`invalid ${t}; refusing to delete cache entries`}}}function sS(e){let t=we.join(e,"plugins","installed_plugins.json");if(!Ee.existsSync(t))return[];try{let n=JSON.parse(Ee.readFileSync(t,"utf8"));return Object.entries(n.plugins??{}).flatMap(([s,r])=>rS(s)?r.map(i=>({key:s,installPath:typeof i.installPath=="string"?we.resolve(i.installPath):void 0,scope:typeof i.scope=="string"?i.scope:void 0,version:typeof i.version=="string"?i.version:void 0})):[])}catch{return[]}}function rS(e){return e==="frontend-craft@bovinphang/frontend-craft"||e==="frontend-craft@frontend-craft"||e.startsWith("frontend-craft@")}function Up(e,t){if(Ee.existsSync(e))try{let n=JSON.parse(Ee.readFileSync(e,"utf8"));return n.runtime!=="claude"?void 0:{scope:t,manifestPath:e,packageVersion:typeof n.packageVersion=="string"?n.packageVersion:void 0}}catch{return{scope:t,manifestPath:e}}}function iS(e){let t=we.join(e,"package.json");if(Ee.existsSync(t))try{let n=JSON.parse(Ee.readFileSync(t,"utf8"));return typeof n.version=="string"?n.version:void 0}catch{return}}function oS(e,t){let n=Jp(e),s=Jp(t);for(let r=0;r<3;r+=1)if(n[r]!==s[r])return n[r]-s[r];return 0}function Jp(e){let t=e.match(/^(\d+)\.(\d+)\.(\d+)/);return t?[Number(t[1]),Number(t[2]),Number(t[3])]:[0,0,0]}function aS(e){return e==="~"?nl.homedir():e.startsWith("~/")||e.startsWith("~\\")?we.join(nl.homedir(),e.slice(2)):e}function Yp(e){let t=we.resolve(e);return process.platform==="win32"?t.toLowerCase():t}function Xp(e){try{let t=M.join(e,"package.json");return JSON.parse(R.readFileSync(t,"utf8")).version??"0.0.0"}catch{return"0.0.0"}}function uS(e){let t=null,n=!1,s=!1,r=!1,i=!1,o=!1,l,c=[];for(let a=0;a<e.length;a++){let p=e[a];if(p==="--global"||p==="-g")n=!0,t="global";else if(p==="--local"||p==="-l")s=!0,t="local";else if(p==="--dry-run")r=!0;else if(p==="--force")i=!0;else if(p==="--all")o=!0;else if(p==="--lang")l=e[++a]??"";else if(p.startsWith("--lang="))l=p.slice(7);else if(!p.startsWith("-"))c.push(p);else throw new Error(`Unknown option: ${p}`)}if(c.length>1)throw new Error(`Unexpected argument: ${c[1]}`);return{runtime:c[0],installLocation:t,dryRun:r,force:i,all:o,hasGlobal:n,hasLocal:s,language:l}}function ks(){console.log(`frontend-craft - universal installer
|
|
202
372
|
|
|
203
373
|
Usage:
|
|
204
|
-
|
|
205
|
-
frontend-craft
|
|
206
|
-
frontend-craft
|
|
374
|
+
fec project inspect [path] [--task-path relative] [--task-kind kind] [--json]
|
|
375
|
+
frontend-craft update|upgrade [--dry-run]
|
|
376
|
+
frontend-craft uninstall|remove [--purge] [--yes] [--dry-run]
|
|
377
|
+
frontend-craft runtime install <runtime> [options]
|
|
378
|
+
frontend-craft runtime install --all [options]
|
|
379
|
+
frontend-craft runtime install
|
|
380
|
+
frontend-craft install [runtime] [options] (deprecated alias)
|
|
207
381
|
frontend-craft setup [runtime] [options]
|
|
208
382
|
frontend-craft setup all [options]
|
|
209
383
|
fec setup [runtime] [options]
|
|
210
384
|
fec setup all [options]
|
|
211
|
-
frontend-craft update [runtime] [options]
|
|
212
|
-
frontend-craft
|
|
213
|
-
frontend-craft
|
|
385
|
+
frontend-craft runtime update|upgrade [runtime] [options]
|
|
386
|
+
frontend-craft runtime uninstall|remove [runtime] [options]
|
|
387
|
+
frontend-craft runtime check-migration [runtime] [--local|--global] [--json]
|
|
214
388
|
frontend-craft list
|
|
215
389
|
frontend-craft matrix
|
|
216
390
|
frontend-craft doctor <runtime>
|
|
@@ -219,9 +393,11 @@ Usage:
|
|
|
219
393
|
frontend-craft version
|
|
220
394
|
|
|
221
395
|
Options:
|
|
396
|
+
--purge CLI uninstall: clean managed resources before removing CLI
|
|
397
|
+
--yes, -y CLI uninstall: confirm without prompting (required for non-TTY)
|
|
222
398
|
--global, -g Install to tool global config directory
|
|
223
399
|
--local, -l Install to this project only
|
|
224
|
-
--lang <lang> Install content language: ${
|
|
400
|
+
--lang <lang> Install content language: ${yi.join(", ")} (default: ${Ut})
|
|
225
401
|
--dry-run Show actions without writing files
|
|
226
402
|
--force Uninstall: remove modified managed files (does not override Claude Marketplace)
|
|
227
403
|
--all Install for every supported runtime
|
|
@@ -229,11 +405,14 @@ Options:
|
|
|
229
405
|
Notes:
|
|
230
406
|
setup connects frontend-craft to the current project. Omit runtime in an interactive terminal to choose runtimes.
|
|
231
407
|
setup <runtime> and setup all install locally by default unless --global is explicitly provided.
|
|
232
|
-
update
|
|
233
|
-
uninstall/remove
|
|
408
|
+
update upgrades the CLI and refreshes current-project and global resources with the new CLI.
|
|
409
|
+
uninstall/remove removes only the CLI unless --purge is provided.
|
|
410
|
+
runtime update uses this package's content without downloading a new CLI.
|
|
411
|
+
runtime update without a runtime refreshes discovered frontend-craft manifests.
|
|
412
|
+
runtime uninstall/remove deletes manifest-managed files and skips modified files unless --force is provided.
|
|
234
413
|
/fec-init is the in-assistant slash command; fec setup is the terminal CLI command.
|
|
235
414
|
|
|
236
415
|
Runtimes:
|
|
237
|
-
${
|
|
238
|
-
`)}function rc(n){let e=n[0];return e==null||["--dry-run","--all","--global","-g","--local","-l","--lang"].includes(e)||e.startsWith("--lang=")}async function uc(n){let e=rc(n)?"install":n[0],t=rc(n)?n:n.slice(1),s=e==="setup",i=Ql(import.meta.url);if(e==="version"||e==="-v"||e==="--version"){console.log(or(i));return}if(e==="list"){ne.forEach(w=>console.log(w));return}if(e==="matrix"){console.log(Wl(ne));return}if(e==="doctor"){let w=t[0]??"claude",I=t.includes("--global")||t.includes("-g"),b=t.includes("--fix-cache"),E=t.includes("--dry-run"),F=process.cwd(),K=Ee({runtime:w,isGlobal:I,cwd:F}),D=ss[w];if(!D){console.error(`Unknown runtime: ${w}`),process.exitCode=1;return}console.log(Bh({runtime:w,baseDir:K,cwd:F,cap:D,pluginRoot:i,fixCache:b,dryRun:E,isGlobal:I}));return}if(e==="sync-metadata"){let w=t.includes("--check"),I=Vh(i);if(I.length>0){for(let b of I)console.error(b);process.exitCode=1;return}console.log(w?"metadata is synchronized":"metadata is synchronized; no changes needed");return}if(e==="help"||e==="-h"||e==="--help"){ir();return}let r=e==="update"||e==="upgrade"?"update":"install";if(e!=="install"&&e!=="setup"&&e!=="update"&&e!=="upgrade"&&e!=="uninstall"&&e!=="remove"){console.error(`Unknown command: ${e}`),ir(),process.exitCode=1;return}if(t.some(w=>w==="help"||w==="--help"||w==="-h")){ir();return}let o=Dh(t),a=o.runtime,l=o.all,{installLocation:c,dryRun:u,force:f,hasGlobal:d,hasLocal:h}=o,g=o.language;if(g!==void 0&&!Xi(g)){console.error(`Unsupported language: ${g||"(missing)"}. Supported languages: ${ns.join(", ")}`),process.exitCode=1;return}let p=g;s&&a==="all"&&(a=void 0,l=!0);let m=c??(s?"local":null);if(d&&h){console.error("--global and --local cannot be used together."),process.exitCode=1;return}let S=process.cwd();if(e==="uninstall"||e==="remove"){let w=lc(h,d),b=Ft({cwd:S,runtimes:a?[a]:l?ne:void 0,scopes:w});if(a&&!Qn[a]){console.error(`Unknown runtime: ${a}`),process.exitCode=1;return}if(b.length===0){console.log(cc("uninstall",a,w));return}for(let E of b){console.log(`Uninstalling frontend-craft for "${E.runtime}" -> ${E.baseDir}${E.scope==="global"?" (global)":""}`);let F=Zi({install:E,cwd:S,dryRun:u,force:f});for(let K of F.removed)console.log(`${u?"[dry-run] would remove":"Removed"}${K.modified?" modified file":" file"}: ${K.path}`);for(let K of F.skipped)console.log(`Skipped modified file: ${K}`);for(let K of F.missing)console.log(`Missing file: ${K}`);u&&F.skipped.length===0&&console.log(`[dry-run] would remove manifest: ${E.manifestPath}`)}return}let v=!!process.stdin.isTTY||process.env.FRONTEND_CRAFT_FORCE_INTERACTIVE==="1";if(r==="update"&&!a){let w=lc(h,d),I=Ft({cwd:S,runtimes:l?ne:void 0,scopes:w});if(I.length===0){console.log(cc("update",void 0,w));return}let b=new Set;for(let E of I){let F=`${E.runtime}:${E.scope}`;if(b.has(F))continue;b.add(F);let K=p??E.manifest.language??Fe;await oc({rt:E.runtime,mode:r,isGlobal:E.scope==="global",baseDir:Ee({runtime:E.runtime,isGlobal:E.scope==="global",cwd:S}),pluginRoot:i,cwd:S,dryRun:u,language:K})}return}let k=l?ne:a?[a]:[];k.length||(v?k=await Kl():(console.log("Non-interactive terminal detected, defaulting to claude runtime."),k=["claude"]));let C=p;!C&&r==="install"&&(v?C=await Yl():C=Fe);let N;if(m==="global"?N=!0:m==="local"?N=!1:v?N=await Gl(k):(console.log("Non-interactive terminal detected, defaulting to global install."),N=!0),!C&&r==="update"&&a){let w=Ee({runtime:a,isGlobal:N,cwd:S});C=rt(je(w))?.language??Fe}C??=Jl(p);for(let w of k){if(!Qn[w]){console.error(`Unknown runtime: ${w}`),process.exitCode=1;continue}let I=Ee({runtime:w,isGlobal:N,cwd:S});await oc({rt:w,mode:r,isGlobal:N,baseDir:I,pluginRoot:i,cwd:S,dryRun:u,force:f,canPrompt:v,language:C})}}async function oc({rt:n,mode:e,isGlobal:t,baseDir:s,pluginRoot:i,cwd:r,dryRun:o,force:a,canPrompt:l,language:c}){let u=await Ph({rt:n,mode:e,isGlobal:t,cwd:r,dryRun:o,force:!!a,canPrompt:!!l});if(!u)return;if(u.redirect&&(t=u.redirect.isGlobal,s=u.redirect.baseDir,e="update"),t&&!j.existsSync(je(s))){let d=Ft({cwd:r,runtimes:[n],scopes:["global"]}).find(h=>O.resolve(h.baseDir)!==O.resolve(s));d&&(Zl(d,s,o),e="update")}let f={pluginRoot:i,contentRoot:Vl(i,c),cwd:r,runtime:n,isGlobal:t,baseDir:s,dryRun:o,mode:e,language:c,capabilities:ss[n]};e==="install"?(console.log(`Installing frontend-craft for "${n}" -> ${s}${t?" (global)":""}`),!o&&j.existsSync(je(s))&&console.log(`Existing frontend-craft manifest found; use "frontend-craft update ${n}" to refresh managed files.`)):console.log(`Updating frontend-craft for "${n}" -> ${s}${t?" (global)":""}`),o||cr({baseDir:s,cwd:r,mode:e,packageVersion:or(i),runtime:n,isGlobal:t,language:c});try{await Qn[n](f),o||ur()}catch(d){throw o||fr(),d}}async function Ph({rt:n,isGlobal:e,cwd:t,dryRun:s,force:i,canPrompt:r}){if(n!=="claude")return{};let o=nr({cwd:t});if(o.native.length>0){console.log("Claude Code Marketplace install detected for frontend-craft."),console.log(Bt(o)),console.log("Update frontend-craft through Claude Code Marketplace. CLI install/update is disabled while Marketplace is active."),process.exitCode=1;return}let a=e?"cli-global":"cli-local",l=o.cli.filter(h=>rr(h)!==a);if(l.length===0)return o.hasMultipleActiveSources&&console.log(Bt(o)),{};let c=l[0],u=rr(c);if(console.log(`${Be(u)} install detected for frontend-craft.`),console.log(Bt(o)),s){console.log(`[dry-run] resolve the existing ${Be(u)} source before using ${Be(a)}.`),process.exitCode=1;return}if(!r){xh(u,a),process.exitCode=1;return}if(await Rh(u,a)==="switch"){if(!_h({installs:l,cwd:t,dryRun:s,force:i})){process.exitCode=1;return}return{}}let d=u==="cli-global";return{redirect:{isGlobal:d,baseDir:Ee({runtime:"claude",isGlobal:d,cwd:t})}}}function _h({installs:n,cwd:e,dryRun:t,force:s}){for(let i of n){let r=Ft({cwd:e,runtimes:["claude"],scopes:[i.scope]})[0];if(!r)continue;console.log(`Uninstalling existing ${Be(rr(i))} install before switching source.`);let o=Zi({install:r,cwd:e,dryRun:t,force:s});for(let a of o.removed)console.log(`${t?"[dry-run] would remove":"Removed"}${a.modified?" modified file":" file"}: ${a.path}`);for(let a of o.skipped)console.log(`Skipped modified file: ${a}`);for(let a of o.missing)console.log(`Missing file: ${a}`);if(o.skipped.length>0)return console.log("Resolve skipped modified files or rerun with --force before switching Claude CLI install source."),!1}return!0}function xh(n,e){let t=ac(n),s=ac(e);console.log(`Keep the existing source updated with: frontend-craft update claude ${t}`),console.log(`Or switch sources with: frontend-craft uninstall claude ${t} && frontend-craft install claude ${s}`)}async function Rh(n,e){return console.log("Choose how to resolve the Claude CLI install source conflict:"),console.log(` 1. Keep ${Be(n)} and update it`),console.log(` 2. Uninstall ${Be(n)} and install ${Be(e)}`),(await Fh("Choice [1]: ")).trim()==="2"?"switch":"keep"}function Fh(n){return process.env.FRONTEND_CRAFT_FORCE_INTERACTIVE==="1"&&!process.stdin.isTTY?(process.stdout.write(n),Promise.resolve(j.readFileSync(0,"utf8").split(/\r?\n/)[0]??"")):new Promise(e=>{let t=Mh.createInterface({input:process.stdin,output:process.stdout});t.question(n,s=>{t.close(),e(s)}),t.on("close",()=>e(""))})}function rr(n){return n.scope==="global"?"cli-global":"cli-local"}function Be(n){return n==="marketplace"?"Claude Code Marketplace":n==="cli-global"?"Claude CLI global":"Claude CLI local"}function ac(n){return n==="cli-global"?"--global":"--local"}function lc(n,e){return n?["local"]:e?["global"]:["local","global"]}function cc(n,e,t){return`No frontend-craft installs found${e?` for "${e}"`:""} to ${n} (${t.join(", ")}).`}function Bh({runtime:n,baseDir:e,cwd:t,cap:s,pluginRoot:i,fixCache:r,dryRun:o,isGlobal:a}){let l=[`frontend-craft doctor: ${n}`,`baseDir: ${e}`,`tier: ${s.tier}`];if(l.push(`skills: ${it(Uh(n,e,t,a),s.skills)}`),l.push(`agents: ${it(j.existsSync(O.join(e,"agents")),s.agents)}`),l.push(`commands: ${it(Kh(n,e,t,a),s.commands&&!(n==="copilot"&&a))}`),l.push(`hooks: ${it(Gh(n,e),s.hooks)}`),l.push(`rules: ${it(Yh(n,e,a),s.rules&&(!a||["copilot","cline","trae"].includes(n)))}`),l.push(`templates: ${it(Jh(n,e,t,a),s.templates&&!(n==="openclaw"&&a))}`),n==="claude"){let c=or(i);l.push(Bt(nr({cwd:t}))),r?l.push(ic(sc({currentVersion:c,dryRun:o}),o)):l.push(rs(tr({currentVersion:c})))}return l.join(`
|
|
239
|
-
`)}function
|
|
416
|
+
${pe.join(", ")}
|
|
417
|
+
`)}function Wp(e){let t=e[0];return t==null||["--dry-run","--all","--global","-g","--local","-l","--lang"].includes(t)||t.startsWith("--lang=")}async function Zp(e){let t=Wp(e)?"install":e[0],n=Wp(e)?e:e.slice(1);if(e.some(E=>E==="help"||E==="--help"||E==="-h")){ks();return}let s=t==="runtime";if(s&&(t=n[0],n=n.slice(1),!["install","update","upgrade","uninstall","remove","check-migration"].includes(t??""))){console.error(`Unknown runtime command: ${t??"(missing)"}`),ks(),process.exitCode=1;return}let r=t==="setup",i=Kp(import.meta.url),o=process.cwd();if(t==="project"){try{if(n[0]!=="inspect")throw new Error("Unknown project command");console.log(JSON.stringify(jc(n.slice(1),i,o),null,2))}catch(E){console.error(E instanceof Error?E.message:"Inspection failed"),process.exitCode=2}return}if(s&&t==="check-migration"){let E=new Set(["--json","--global","--local","-g","-l"]),C=n.filter(L=>L.startsWith("-")&&!E.has(L)),A=n.filter(L=>!L.startsWith("-")),N=n.includes("--global")||n.includes("-g"),O=n.includes("--local")||n.includes("-l"),I=C.length||A.length>1||N&&O?{findings:[],errors:["迁移检查参数无效;使用 [runtime] [--local|--global] [--json]"],exitCode:2}:wp({cwd:o,runtime:A[0],scope:N?"global":"local"});if(n.includes("--json"))console.log(JSON.stringify(I,null,2));else{for(let L of I.findings)console.log(`${L.file}${L.line?`:${L.line}`:""} [${L.kind}] ${L.id}${L.replacement?` -> ${L.replacement}`:""}: ${L.message}`);for(let L of I.errors)console.log(L);!I.findings.length&&!I.errors.length&&console.log("未发现待迁移的公共 Skill 引用或旧安装")}process.exitCode=I.exitCode;return}if(!s&&["update","upgrade","uninstall","remove"].includes(t??"")){await Ip(t==="update"||t==="upgrade"?"update":"uninstall",n,{pluginRoot:i,cwd:o,purgeResources:E=>Gp({cwd:o,dryRun:E}),describeResources:()=>fS(o)});return}if(t==="version"||t==="-v"||t==="--version"){console.log(Xp(i));return}if(t==="list"){pe.forEach(E=>console.log(E));return}if(t==="matrix"){console.log(Fc(pe));return}if(t==="doctor"){let E=n[0]??"claude",C=n.includes("--global")||n.includes("-g"),A=n.includes("--fix-cache"),N=n.includes("--dry-run"),O=process.cwd(),I=Ye({runtime:E,isGlobal:C,cwd:O}),L=on[E];if(!L){console.error(`Unknown runtime: ${E}`),process.exitCode=1;return}console.log(wS({runtime:E,baseDir:I,cwd:O,cap:L,pluginRoot:i,fixCache:A,dryRun:N,isGlobal:C}));return}if(t==="sync-metadata"){let E=n.includes("--check"),C=CS(i);if(C.length>0){for(let A of C)console.error(A);process.exitCode=1;return}console.log(E?"metadata is synchronized":"metadata is synchronized; no changes needed");return}if(t==="help"||t==="-h"||t==="--help"){ks();return}let l=t==="update"||t==="upgrade"?"update":"install";if(t!=="install"&&t!=="setup"&&t!=="update"&&t!=="upgrade"&&t!=="uninstall"&&t!=="remove"){console.error(`Unknown command: ${t}`),ks(),process.exitCode=1;return}if(n.some(E=>E==="help"||E==="--help"||E==="-h")){ks();return}t==="install"&&!s&&e[0]==="install"&&console.log('Deprecated: use "frontend-craft runtime install" instead of "frontend-craft install".');let c;try{c=uS(n)}catch(E){console.error(E instanceof Error?E.message:String(E)),process.exitCode=1;return}let a=c.runtime,p=c.all,{installLocation:f,dryRun:u,force:d,hasGlobal:m,hasLocal:h}=c,g=c.language;if(g!==void 0&&!el(g)){console.error(`Unsupported language: ${g||"(missing)"}. Supported languages: ${yi.join(", ")}`),process.exitCode=1;return}let y=g;r&&a==="all"&&(a=void 0,p=!0);let w=f??(r?"local":null);if(m&&h){console.error("--global and --local cannot be used together."),process.exitCode=1;return}if(t==="uninstall"||t==="remove"){let E=Qp(h,m),C=a?[a]:p?pe:void 0;if(a&&!li[a]){console.error(`Unknown runtime: ${a}`),process.exitCode=1;return}await Gp({cwd:o,dryRun:u,force:d,runtimes:C,scopes:E})||(process.exitCode=1);return}let v=!!process.stdin.isTTY||process.env.FRONTEND_CRAFT_FORCE_INTERACTIVE==="1";if(l==="update"&&!a){let E=Qp(h,m),C=!1,A=Kt({cwd:o,runtimes:p?pe:void 0,scopes:E,onError:O=>{C=!0,console.error(O.message),process.exitCode=1}});if(A.length===0){C||console.log(th("update",void 0,E));return}let N=new Set;for(let O of A){let I=`${O.runtime}:${O.scope}`;if(N.has(I))continue;N.add(I);let L=y??O.manifest.language??Ut;await Hp({rt:O.runtime,mode:l,isGlobal:O.scope==="global",baseDir:Ye({runtime:O.runtime,isGlobal:O.scope==="global",cwd:o}),pluginRoot:i,cwd:o,dryRun:u,language:L})}return}let S=p?pe:a?[a]:[];S.length||(v?S=await Pp():(console.log("Non-interactive terminal detected, defaulting to claude runtime."),S=["claude"]));let k=y;!k&&l==="install"&&(v?k=await Mp():k=Ut);let b;if(w==="global"?b=!0:w==="local"?b=!1:v?b=await $p(S):(console.log("Non-interactive terminal detected, defaulting to global install."),b=!0),!k&&l==="update"&&a){let E=Ye({runtime:a,isGlobal:b,cwd:o});k=Be(de(E))?.language??Ut}k??=qp(y);for(let E of S){if(!li[E]){console.error(`Unknown runtime: ${E}`),process.exitCode=1;continue}let C=Ye({runtime:E,isGlobal:b,cwd:o});await Hp({rt:E,mode:l,isGlobal:b,baseDir:C,pluginRoot:i,cwd:o,dryRun:u,force:d,canPrompt:v,language:k})}}function fS(e){let t=[];return[...Kt({cwd:e,onError:s=>t.push(s.message)}).map(s=>`${s.runtime} (${s.scope}): ${s.baseDir}`),...t]}async function Gp({cwd:e,dryRun:t,force:n=!1,runtimes:s,scopes:r=["local","global"]}){let i=!0,o=Kt({cwd:e,runtimes:s,scopes:r,onError:l=>{i=!1,console.error(l.message)}});o.length===0&&i&&console.log(th("uninstall",s?.length===1?s[0]:void 0,r));for(let l of o)try{console.log(`Uninstalling frontend-craft for "${l.runtime}" -> ${l.baseDir}${l.scope==="global"?" (global)":""}`);let c=await Wa({install:l,cwd:e,dryRun:t,force:n});for(let a of c.removed)console.log(`${t?"[dry-run] would remove":"Removed"}${a.modified?" modified file":" file"}: ${a.path}`);for(let a of c.skipped)console.log(`Skipped modified file: ${a}`);for(let a of c.missing)console.log(`Missing file: ${a}`);c.skipped.length>0?(console.log(`Preserved manifest for modified files: ${l.manifestPath}`),console.log(`Recover with: npx @bovinphang/frontend-craft@latest runtime uninstall ${l.runtime} --${l.scope}`)):t&&console.log(`[dry-run] would remove manifest: ${l.manifestPath}`)}catch(c){i=!1,eh("uninstall",l.runtime,l.scope==="global",c)}return i}function eh(e,t,n,s){console.error(`Failed ${e} for ${t} (${n?"global":"local"}): ${s instanceof Error?s.message:String(s)}`),console.error(`Retry: frontend-craft runtime ${e} ${t} --${n?"global":"local"}`)}async function Hp(e){try{e.mode==="update"&&Kt({cwd:e.cwd,runtimes:[e.rt],scopes:[e.isGlobal?"global":"local"],onError:t=>{throw t}}),await dS(e)}catch(t){eh(e.mode,e.rt,e.isGlobal,t),process.exitCode=1}}async function dS({rt:e,mode:t,isGlobal:n,baseDir:s,pluginRoot:r,cwd:i,dryRun:o,force:l,canPrompt:c,language:a}){let p=await pS({rt:e,mode:t,isGlobal:n,cwd:i,dryRun:o,force:!!l,canPrompt:!!c});if(!p)return;p.redirect&&(n=p.redirect.isGlobal,s=p.redirect.baseDir,t="update");let f;if(n&&!R.existsSync(de(s))){let d=Kt({cwd:i,runtimes:[e],scopes:["global"]}).find(m=>M.resolve(m.baseDir)!==M.resolve(s));d&&(f=(m=o)=>mp(d,s,m),t="update")}let u={pluginRoot:r,contentRoot:tl(r,a),cwd:i,runtime:e,isGlobal:n,baseDir:s,dryRun:o,mode:t,language:a,capabilities:on[e]};t==="install"?(console.log(`Installing frontend-craft for "${e}" -> ${s}${n?" (global)":""}`),!o&&R.existsSync(de(s))&&console.log(`Existing frontend-craft manifest found; use "frontend-craft runtime update ${e}" to refresh managed files.`)):console.log(`Updating frontend-craft for "${e}" -> ${s}${n?" (global)":""}`),await vp(u,d=>li[e](d),f)}async function pS({rt:e,isGlobal:t,cwd:n,dryRun:s,force:r,canPrompt:i}){if(e!=="claude")return{};let o=rl({cwd:n});if(o.native.length>0){console.log("Claude Code Marketplace install detected for frontend-craft."),console.log(Ss(o)),console.log("Update frontend-craft through Claude Code Marketplace. CLI install/update is disabled while Marketplace is active."),process.exitCode=1;return}let l=t?"cli-global":"cli-local",c=o.cli.filter(d=>ol(d)!==l);if(c.length===0)return o.hasMultipleActiveSources&&console.log(Ss(o)),{};let a=c[0],p=ol(a);if(console.log(`${Yt(p)} install detected for frontend-craft.`),console.log(Ss(o)),s){console.log(`[dry-run] resolve the existing ${Yt(p)} source before using ${Yt(l)}.`),process.exitCode=1;return}if(!i){mS(p,l),process.exitCode=1;return}if(await gS(p,l)==="switch"){if(!await hS({installs:c,cwd:n,dryRun:s,force:r})){process.exitCode=1;return}return{}}let u=p==="cli-global";return{redirect:{isGlobal:u,baseDir:Ye({runtime:"claude",isGlobal:u,cwd:n})}}}async function hS({installs:e,cwd:t,dryRun:n,force:s}){for(let r of e){let i=Kt({cwd:t,runtimes:["claude"],scopes:[r.scope]})[0];if(!i)continue;console.log(`Uninstalling existing ${Yt(ol(r))} install before switching source.`);let o=await Wa({install:i,cwd:t,dryRun:n,force:s});for(let l of o.removed)console.log(`${n?"[dry-run] would remove":"Removed"}${l.modified?" modified file":" file"}: ${l.path}`);for(let l of o.skipped)console.log(`Skipped modified file: ${l}`);for(let l of o.missing)console.log(`Missing file: ${l}`);if(o.skipped.length>0)return console.log("Resolve skipped modified files or rerun with --force before switching Claude CLI install source."),!1}return!0}function mS(e,t){let n=zp(e),s=zp(t);console.log(`Keep the existing source updated with: frontend-craft runtime update claude ${n}`),console.log(`Or switch sources with: frontend-craft runtime uninstall claude ${n} && frontend-craft runtime install claude ${s}`)}async function gS(e,t){return console.log("Choose how to resolve the Claude CLI install source conflict:"),console.log(` 1. Keep ${Yt(e)} and update it`),console.log(` 2. Uninstall ${Yt(e)} and install ${Yt(t)}`),(await yS("Choice [1]: ")).trim()==="2"?"switch":"keep"}function yS(e){return process.env.FRONTEND_CRAFT_FORCE_INTERACTIVE==="1"&&!process.stdin.isTTY?(process.stdout.write(e),Promise.resolve(R.readFileSync(0,"utf8").split(/\r?\n/)[0]??"")):new Promise(t=>{let n=cS.createInterface({input:process.stdin,output:process.stdout});n.question(e,s=>{n.close(),t(s)}),n.on("close",()=>t(""))})}function ol(e){return e.scope==="global"?"cli-global":"cli-local"}function Yt(e){return e==="marketplace"?"Claude Code Marketplace":e==="cli-global"?"Claude CLI global":"Claude CLI local"}function zp(e){return e==="cli-global"?"--global":"--local"}function Qp(e,t){return e?["local"]:t?["global"]:["local","global"]}function th(e,t,n){return`No frontend-craft installs found${t?` for "${t}"`:""} to ${e} (${n.join(", ")}).`}function wS({runtime:e,baseDir:t,cwd:n,cap:s,pluginRoot:r,fixCache:i,dryRun:o,isGlobal:l}){let c=[`frontend-craft doctor: ${e}`,`baseDir: ${t}`,`tier: ${s.tier}`];c.push(`skills: ${Jt(bS(e,t,n,l),s.skills)}`);let a=!1;if(s.skills)try{let p=Be(de(t)),f=xa({pluginRoot:r,contentRoot:tl(r,p?.language??"en"),cwd:n,baseDir:t,runtime:e,isGlobal:l,dryRun:!0,mode:"install",language:p?.language??"en"});if(p?.common&&f){let u=ot(f.skillsDir),d=Qt(f);a=p.common.target===u.target&&p.common.ledgerDir===u.ledgerDir&&d.conflicts.length===0&&d.mutations.length===0}}catch{a=!1}if(c.push(`common: ${Jt(a,s.skills)}`),c.push(`agents: ${Jt(R.existsSync(M.join(t,"agents")),s.agents)}`),c.push(`commands: ${Jt(vS(e,t,n,l),s.commands&&!(e==="copilot"&&l))}`),c.push(`hooks: ${Jt(SS(e,t),s.hooks)}`),c.push(`rules: ${Jt(kS(e,t,l),s.rules&&(!l||["copilot","cline","trae"].includes(e)))}`),c.push(`templates: ${Jt(ES(e,t,n,l),s.templates&&!(e==="openclaw"&&l))}`),e==="claude"){let p=Xp(r);c.push(Ss(rl({cwd:n}))),i?c.push(xp(Vp({currentVersion:p,dryRun:o}),o)):c.push(wi(sl({currentVersion:p})))}return c.join(`
|
|
418
|
+
`)}function Jt(e,t){return t?e?"ok":"missing":"not expected"}function bS(e,t,n,s){return e==="codex"?R.existsSync(M.join(s?lS.homedir():n,".agents","skills","fec-react-project-standard","SKILL.md")):R.existsSync(M.join(e==="openclaw"&&!s?n:t,"skills","fec-react-project-standard","SKILL.md"))}function vS(e,t,n,s){if(e==="openclaw")return R.existsSync(M.join(s?t:n,"skills","fec-init","SKILL.md"));let r=e==="windsurf"?M.join(t,s?"global_workflows":"workflows"):e==="opencode"||e==="kilo"?M.join(t,"commands"):e==="copilot"?M.join(t,"prompts"):M.join(t,"commands");return R.existsSync(M.join(r,e==="copilot"?"fec-init.prompt.md":"fec-init.md"))}function SS(e,t){if(e==="claude")try{let n=JSON.parse(R.readFileSync(M.join(t,"settings.json"),"utf8"));return Array.isArray(n.hooks?.Stop)&&n.hooks.Stop.some(s=>JSON.stringify(s).includes("fec-run-tests.js"))}catch{return!1}return e==="qoder"?R.existsSync(M.join(t,"settings.json"))&&R.existsSync(M.join(t,"hooks","fec-security-check.js")):R.existsSync(M.join(t,"hooks.json"))}function kS(e,t,n){return e==="copilot"?R.existsSync(n?M.join(t,"copilot-instructions.md"):M.join(t,"instructions","frontend-craft.instructions.md")):e==="cline"?R.existsSync(M.join(t,n?"Rules":".clinerules","frontend-craft.md")):e==="trae"&&n?R.existsSync(M.join(t,"user_rules","frontend-craft.md")):R.existsSync(M.join(t,"rules"))}function ES(e,t,n,s){return e==="claude"?s?R.existsSync(M.join(t,"CLAUDE.md")):R.existsSync(M.join(n,".claude-plugin","plugin.json")):e==="codex"?R.existsSync(M.join(n,"AGENTS.md"))||R.existsSync(M.join(t,"config.toml")):e==="gemini"?R.existsSync(M.join(s?t:n,"GEMINI.md")):e==="openclaw"?R.existsSync(M.join(n,"AGENTS.md")):e==="qoder"?R.existsSync(M.join(t,"settings.json")):e==="opencode"?R.existsSync(M.join(t,"opencode.jsonc")):!1}function CS(e){let t=[],n=JSON.parse(R.readFileSync(M.join(e,"package.json"),"utf8")),s=[[".claude-plugin/plugin.json","version"],[".claude-plugin/marketplace.json","plugins.0.version"],["openclaw.plugin.json","version"]];for(let[a,p]of s){let f=M.join(e,a),u=JSON.parse(R.readFileSync(f,"utf8")),d=p.split(".").reduce((m,h)=>m?.[Number.isNaN(Number(h))?h:Number(h)],u);d!==n.version&&t.push(`${a} ${p} is ${d}, expected ${n.version}`)}let r=JSON.parse(R.readFileSync(M.join(e,"skills","metadata.json"),"utf8"));for(let a of r){let p=a.id.startsWith("cc-")?tn(e,"en").packageVersion:n.version;a.version!==p&&t.push(`skills/metadata.json ${a.id}.version is ${a.version}, expected ${p}`)}let i=R.readdirSync(M.join(e,"commands")).filter(a=>a.endsWith(".md")).length,o=R.readdirSync(M.join(e,"skills"),{withFileTypes:!0}).filter(a=>a.isDirectory()).length,l=R.readdirSync(M.join(e,"agents")).filter(a=>a.endsWith(".md")).length,c=R.readFileSync(M.join(e,".claude-plugin","marketplace.json"),"utf8");return c.includes(`${l} agents`)||t.push(`marketplace description must mention ${l} agents`),c.includes(`${o} skills`)||t.push(`marketplace description must mention ${o} skills`),c.includes(`${i} commands`)||t.push(`marketplace description must mention ${i} commands`),t}Zp(process.argv.slice(2)).catch(e=>{console.error(e),process.exit(1)});
|