minimal-agent 0.8.2 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -12
- package/package.json +34 -1
- package/plugins/cron-runner/.claude-plugin/plugin.json +5 -0
- package/plugins/cron-runner/commands/cron.md +26 -0
- package/plugins/cron-runner/commands/crons.md +7 -0
- package/plugins/cron-runner/plugin.js +34 -0
- package/plugins/cron-runner/src/commands.js +348 -0
- package/plugins/cron-runner/src/cronTime.js +148 -0
- package/plugins/cron-runner/src/lock.js +68 -0
- package/plugins/cron-runner/src/runs.js +89 -0
- package/plugins/cron-runner/src/scheduleEngine.js +72 -0
- package/plugins/cron-runner/src/scheduler.js +355 -0
- package/plugins/cron-runner/src/schema.js +140 -0
- package/plugins/cron-runner/src/service.js +167 -0
- package/plugins/cron-runner/src/store.js +298 -0
- package/plugins/cron-runner/src/types.js +1 -0
- package/plugins/workflow-runner/commands/workflow.md +4 -4
- package/plugins/workflow-runner/commands/workflows.md +1 -1
- package/plugins/workflow-runner/plugin.js +3 -1
- package/plugins/workflow-runner/src/agentCommon.js +249 -51
- package/plugins/workflow-runner/src/dslManifest.js +72 -0
- package/plugins/workflow-runner/src/expressions.js +198 -15
- package/plugins/workflow-runner/src/index.js +40 -8
- package/plugins/workflow-runner/src/jsonPayload.js +1 -1
- package/plugins/workflow-runner/src/loader.js +286 -72
- package/plugins/workflow-runner/src/multimodal.js +37 -0
- package/plugins/workflow-runner/src/recovery.js +49 -39
- package/plugins/workflow-runner/src/runner.js +802 -287
- package/plugins/workflow-runner/src/stepExecutors/agent.js +157 -39
- package/plugins/workflow-runner/src/stepExecutors/assert.js +16 -3
- package/plugins/workflow-runner/src/stepExecutors/llm.js +60 -111
- package/plugins/workflow-runner/src/stepExecutors/skill.js +47 -47
- package/plugins/workflow-runner/src/stepExecutors/tool.js +76 -10
- package/plugins/workflow-runner/src/stepExecutors/verify.js +27 -10
- package/plugins/workflow-runner/src/taskIdentity.js +296 -0
- package/plugins/workflow-runner/src/types.js +19 -9
- package/plugins/workflow-runner/src/workflowState.js +516 -33
- package/skills/adversarial-review/SKILL.md +0 -1
- package/skills/ai-image/SKILL.md +89 -0
- package/skills/ai-image/scripts/generate.mjs +497 -0
- package/skills/ai-image/scripts/generate_from_plan.mjs +469 -0
- package/skills/ai-image/scripts/generate_from_plan_test.mjs +223 -0
- package/skills/ai-image/scripts/generate_test.mjs +74 -0
- package/skills/browser-automation/SKILL.md +47 -0
- package/skills/docx/SKILL.md +25 -3
- package/skills/docx/scripts/office/helpers/__pycache__/__init__.cpython-314.pyc +0 -0
- package/skills/docx/scripts/office/helpers/__pycache__/merge_runs.cpython-314.pyc +0 -0
- package/skills/docx/scripts/office/helpers/__pycache__/simplify_redlines.cpython-314.pyc +0 -0
- package/skills/docx/scripts/office/validators/__pycache__/__init__.cpython-314.pyc +0 -0
- package/skills/docx/scripts/office/validators/__pycache__/base.cpython-314.pyc +0 -0
- package/skills/docx/scripts/office/validators/__pycache__/docx.cpython-314.pyc +0 -0
- package/skills/docx/scripts/office/validators/__pycache__/pptx.cpython-314.pyc +0 -0
- package/skills/docx/scripts/office/validators/__pycache__/redlining.cpython-314.pyc +0 -0
- package/skills/docx/scripts/opc_check.py +253 -0
- package/skills/image-gen-openrouter/SKILL.md +10 -2
- package/skills/image-stats/SKILL.md +65 -0
- package/skills/image-stats/scripts/__pycache__/image_stats.cpython-314.pyc +0 -0
- package/skills/image-stats/scripts/__pycache__/image_stats_test.cpython-314.pyc +0 -0
- package/skills/image-stats/scripts/image_stats.py +368 -0
- package/skills/image-stats/scripts/image_stats_test.py +181 -0
- package/skills/pptx/SKILL.md +123 -95
- package/skills/pptx/design.md +82 -0
- package/skills/pptx/examples/README.md +29 -0
- package/skills/pptx/examples/hybrid_example.mjs +107 -0
- package/skills/pptx/examples/hybrid_example.pptx +0 -0
- package/skills/pptx/pptxgenjs.md +41 -0
- package/skills/pptx/scripts/deck_helpers.mjs +224 -0
- package/skills/pptx/scripts/layout_lint.py +293 -0
- package/skills/pptx/scripts/layout_lint_test.py +160 -0
- package/skills/pptx/scripts/opc_check.py +339 -0
- package/skills/pptx/scripts/svg_fallback.mjs +145 -0
- package/skills/pptx/svg.md +67 -0
- package/skills/tts-zh/SKILL.md +19 -2
- package/skills/ui-design/SKILL.md +158 -0
- package/skills/ui-design/claude_design.md +309 -0
- package/skills/ui-design/evals/evals.json +254 -0
- package/skills/ui-design/references/aesthetic-direction.md +83 -0
- package/skills/ui-design/references/claude-design-protocol.md +36 -0
- package/skills/ui-design/references/design-context.md +53 -0
- package/skills/ui-design/references/design-execution-playbook.md +82 -0
- package/skills/ui-design/references/export-pptx.md +124 -0
- package/skills/ui-design/references/layout-composition.md +654 -0
- package/skills/ui-design/references/preview-feedback.md +37 -0
- package/skills/ui-design/references/source-image-layout.md +189 -0
- package/skills/ui-design/references/starter-components.md +78 -0
- package/skills/ui-design/references/vi-aegis-vector.md +144 -0
- package/skills/ui-design/references/vi-amber-prism.md +133 -0
- package/skills/ui-design/references/vi-aqua-glass.md +200 -0
- package/skills/ui-design/references/vi-comfort-vision.md +147 -0
- package/skills/ui-design/references/vi-ember-prism.md +140 -0
- package/skills/ui-design/references/vi-nebula-console.md +151 -0
- package/skills/ui-design/references/vi-obsidian-optics.md +139 -0
- package/skills/ui-design/references/vi-obsidian-xui.md +143 -0
- package/skills/ui-design/references/vi-precision-horizon-dark.md +117 -0
- package/skills/ui-design/references/vi-precision-horizon.md +215 -0
- package/skills/ui-design/references/vi-solar-relay.md +130 -0
- package/skills/ui-design/references/vi-template-workflow.md +48 -0
- package/skills/ui-design/references/vi-verdant-grid.md +141 -0
- package/skills/ui-design/references/vi-violet-meridian.md +172 -0
- package/skills/ui-design/scripts/__pycache__/assemble_material.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/assemble_material_test.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/chart_sanity_check.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/check_language_policy.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/check_ui_artifact.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/check_ui_artifact_pptx_test.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/deck_pages_check.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/deck_pages_check_test.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/deck_visual_style_check.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/deck_visual_style_check_test.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/design_budget_check.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/design_budget_check_test.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/design_repair_hints.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/design_repair_hints_test.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/design_style_check.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/design_style_check_test.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/draft_coverage_check.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/extract_source_assets.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/extract_source_assets_test.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/generated_image_review_collect.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/generated_image_review_collect_test.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/image_plan_lint.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/image_plan_lint_test.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/image_prompt_rewrite.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/image_prompt_rewrite_test.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/layout_balance.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/layout_balance_test.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/normalize_design_json.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/normalize_design_json_test.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/plan_source_layout.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/plan_source_layout_test.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/resolve_source_hint.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/resolve_source_hint_test.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/resolve_source_input.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/resolve_source_input_test.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/scaffold_ui_artifact.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/source_usage_check.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/source_usage_check_test.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/text_readability_pixel.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/visual_quality_gate.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/visual_quality_gate_test.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/assemble_material.py +217 -0
- package/skills/ui-design/scripts/assemble_material_test.py +149 -0
- package/skills/ui-design/scripts/browser_check_ui_artifact.mjs +221 -0
- package/skills/ui-design/scripts/chart_sanity_check.py +261 -0
- package/skills/ui-design/scripts/chart_sanity_check_test.py +165 -0
- package/skills/ui-design/scripts/check_language_policy.py +351 -0
- package/skills/ui-design/scripts/check_ui_artifact.py +435 -0
- package/skills/ui-design/scripts/check_ui_artifact_pptx_test.py +251 -0
- package/skills/ui-design/scripts/deck_pages_check.py +158 -0
- package/skills/ui-design/scripts/deck_pages_check_test.py +134 -0
- package/skills/ui-design/scripts/deck_visual_style_check.py +767 -0
- package/skills/ui-design/scripts/deck_visual_style_check_test.py +713 -0
- package/skills/ui-design/scripts/design_budget_check.py +271 -0
- package/skills/ui-design/scripts/design_budget_check_test.py +183 -0
- package/skills/ui-design/scripts/design_repair_hints.py +162 -0
- package/skills/ui-design/scripts/design_repair_hints_test.py +54 -0
- package/skills/ui-design/scripts/design_style_check.py +397 -0
- package/skills/ui-design/scripts/design_style_check_test.py +233 -0
- package/skills/ui-design/scripts/draft_coverage_check.py +184 -0
- package/skills/ui-design/scripts/draft_coverage_check_test.py +131 -0
- package/skills/ui-design/scripts/export_pptx_from_html.mjs +2367 -0
- package/skills/ui-design/scripts/extract_source_assets.py +607 -0
- package/skills/ui-design/scripts/extract_source_assets_test.py +256 -0
- package/skills/ui-design/scripts/generated_image_review_collect.py +206 -0
- package/skills/ui-design/scripts/generated_image_review_collect_test.py +91 -0
- package/skills/ui-design/scripts/image_plan_lint.py +571 -0
- package/skills/ui-design/scripts/image_plan_lint_test.py +515 -0
- package/skills/ui-design/scripts/image_prompt_rewrite.py +713 -0
- package/skills/ui-design/scripts/image_prompt_rewrite_test.py +966 -0
- package/skills/ui-design/scripts/layout_balance.py +881 -0
- package/skills/ui-design/scripts/layout_balance_test.py +927 -0
- package/skills/ui-design/scripts/normalize_design_json.py +272 -0
- package/skills/ui-design/scripts/normalize_design_json_test.py +119 -0
- package/skills/ui-design/scripts/plan_source_layout.py +1450 -0
- package/skills/ui-design/scripts/plan_source_layout_test.py +1136 -0
- package/skills/ui-design/scripts/resolve_source_input.py +270 -0
- package/skills/ui-design/scripts/resolve_source_input_test.py +98 -0
- package/skills/ui-design/scripts/scaffold_ui_artifact.py +377 -0
- package/skills/ui-design/scripts/source_usage_check.py +581 -0
- package/skills/ui-design/scripts/source_usage_check_test.py +427 -0
- package/skills/ui-design/scripts/text_readability_pixel.py +340 -0
- package/skills/ui-design/scripts/text_readability_pixel_test.py +219 -0
- package/skills/ui-design/scripts/visual_quality_gate.py +301 -0
- package/skills/ui-design/scripts/visual_quality_gate_test.py +233 -0
- package/skills/ui-design/tests/e2e/prompts/deck.md +19 -0
- package/skills/ui-design/tests/e2e/prompts/webpage.md +17 -0
- package/skills/ui-design/tests/e2e/render_check.mjs +101 -0
- package/skills/ui-design/tests/e2e/rubric.json +54 -0
- package/skills/ui-design/tests/e2e/runs/aegis-vector-preview-1/checks/browser-check.json +49 -0
- package/skills/ui-design/tests/e2e/runs/aegis-vector-preview-1/checks/language-check.txt +12 -0
- package/skills/ui-design/tests/e2e/runs/aegis-vector-preview-1/checks/static-check.txt +15 -0
- package/skills/ui-design/tests/e2e/runs/aegis-vector-preview-1/outputs/index.html +837 -0
- package/skills/ui-design/tests/e2e/runs/aegis-vector-preview-1/prompt.md +12 -0
- package/skills/ui-design/tests/e2e/runs/aegis-vector-preview-1/review.md +21 -0
- package/skills/ui-design/tests/e2e/runs/aegis-vector-preview-1/screenshots/desktop.png +0 -0
- package/skills/ui-design/tests/e2e/runs/aegis-vector-preview-1/screenshots/mobile.png +0 -0
- package/skills/ui-design/tests/e2e/runs/amber-prism-screenshot-check-1/outputs/homepage.html +373 -0
- package/skills/ui-design/tests/e2e/runs/amber-prism-screenshot-check-1/outputs/platform.html +378 -0
- package/skills/ui-design/tests/e2e/runs/amber-prism-screenshot-check-1/prompt.md +13 -0
- package/skills/ui-design/tests/e2e/runs/amber-prism-screenshot-check-1/review.md +26 -0
- package/skills/ui-design/tests/e2e/runs/amber-prism-screenshot-check-1/screenshots/homepage/browser-check.json +49 -0
- package/skills/ui-design/tests/e2e/runs/amber-prism-screenshot-check-1/screenshots/homepage/desktop.png +0 -0
- package/skills/ui-design/tests/e2e/runs/amber-prism-screenshot-check-1/screenshots/homepage/mobile.png +0 -0
- package/skills/ui-design/tests/e2e/runs/amber-prism-screenshot-check-1/screenshots/platform/browser-check.json +49 -0
- package/skills/ui-design/tests/e2e/runs/amber-prism-screenshot-check-1/screenshots/platform/desktop.png +0 -0
- package/skills/ui-design/tests/e2e/runs/amber-prism-screenshot-check-1/screenshots/platform/mobile.png +0 -0
- package/skills/ui-design/tests/e2e/runs/aqua-glass-iteration-1/checks/static-check.txt +2 -0
- package/skills/ui-design/tests/e2e/runs/aqua-glass-iteration-1/outputs/index.html +656 -0
- package/skills/ui-design/tests/e2e/runs/aqua-glass-iteration-1/prompt.md +12 -0
- package/skills/ui-design/tests/e2e/runs/aqua-glass-iteration-1/render_check.mjs +67 -0
- package/skills/ui-design/tests/e2e/runs/aqua-glass-iteration-2/checks/static-check.txt +2 -0
- package/skills/ui-design/tests/e2e/runs/aqua-glass-iteration-2/outputs/index.html +587 -0
- package/skills/ui-design/tests/e2e/runs/aqua-glass-iteration-2/prompt.md +12 -0
- package/skills/ui-design/tests/e2e/runs/aqua-glass-iteration-2/review.md +36 -0
- package/skills/ui-design/tests/e2e/runs/aqua-glass-volcano-refresh-1/checks/browser-check.json +49 -0
- package/skills/ui-design/tests/e2e/runs/aqua-glass-volcano-refresh-1/checks/language-check.txt +8 -0
- package/skills/ui-design/tests/e2e/runs/aqua-glass-volcano-refresh-1/checks/static-check.txt +16 -0
- package/skills/ui-design/tests/e2e/runs/aqua-glass-volcano-refresh-1/outputs/index.html +739 -0
- package/skills/ui-design/tests/e2e/runs/aqua-glass-volcano-refresh-1/prompt.md +11 -0
- package/skills/ui-design/tests/e2e/runs/aqua-glass-volcano-refresh-1/review.md +22 -0
- package/skills/ui-design/tests/e2e/runs/aqua-glass-volcano-refresh-1/screenshots/desktop.png +0 -0
- package/skills/ui-design/tests/e2e/runs/aqua-glass-volcano-refresh-1/screenshots/mobile.png +0 -0
- package/skills/ui-design/tests/e2e/runs/comfort-vision-preview-1/checks/browser-check.json +52 -0
- package/skills/ui-design/tests/e2e/runs/comfort-vision-preview-1/outputs/index.html +641 -0
- package/skills/ui-design/tests/e2e/runs/comfort-vision-preview-1/screenshots/desktop.png +0 -0
- package/skills/ui-design/tests/e2e/runs/comfort-vision-preview-1/screenshots/mobile.png +0 -0
- package/skills/ui-design/tests/e2e/runs/ember-prism-red-preview-1/outputs/index.html +467 -0
- package/skills/ui-design/tests/e2e/runs/ember-prism-red-preview-1/screenshots/browser-check.json +49 -0
- package/skills/ui-design/tests/e2e/runs/ember-prism-red-preview-1/screenshots/desktop.png +0 -0
- package/skills/ui-design/tests/e2e/runs/ember-prism-red-preview-1/screenshots/mobile.png +0 -0
- package/skills/ui-design/tests/e2e/runs/ember-prism-screenshot-check-1/outputs/homepage.html +373 -0
- package/skills/ui-design/tests/e2e/runs/ember-prism-screenshot-check-1/outputs/platform.html +378 -0
- package/skills/ui-design/tests/e2e/runs/ember-prism-screenshot-check-1/prompt.md +13 -0
- package/skills/ui-design/tests/e2e/runs/ember-prism-screenshot-check-1/review.md +26 -0
- package/skills/ui-design/tests/e2e/runs/ember-prism-screenshot-check-1/screenshots/homepage/browser-check.json +49 -0
- package/skills/ui-design/tests/e2e/runs/ember-prism-screenshot-check-1/screenshots/homepage/desktop.png +0 -0
- package/skills/ui-design/tests/e2e/runs/ember-prism-screenshot-check-1/screenshots/homepage/mobile.png +0 -0
- package/skills/ui-design/tests/e2e/runs/ember-prism-screenshot-check-1/screenshots/platform/browser-check.json +49 -0
- package/skills/ui-design/tests/e2e/runs/ember-prism-screenshot-check-1/screenshots/platform/desktop.png +0 -0
- package/skills/ui-design/tests/e2e/runs/ember-prism-screenshot-check-1/screenshots/platform/mobile.png +0 -0
- package/skills/ui-design/tests/e2e/runs/empty-agent-protocol-check/checks/browser-check.json +49 -0
- package/skills/ui-design/tests/e2e/runs/empty-agent-protocol-check/checks/language-check.txt +4 -0
- package/skills/ui-design/tests/e2e/runs/empty-agent-protocol-check/checks/static-check.txt +2 -0
- package/skills/ui-design/tests/e2e/runs/empty-agent-protocol-check/execution_notes.md +10 -0
- package/skills/ui-design/tests/e2e/runs/empty-agent-protocol-check/outputs/index.html +587 -0
- package/skills/ui-design/tests/e2e/runs/empty-agent-protocol-check/prompt.md +14 -0
- package/skills/ui-design/tests/e2e/runs/empty-agent-protocol-check/review.md +13 -0
- package/skills/ui-design/tests/e2e/runs/empty-agent-protocol-check/screenshots/desktop.png +0 -0
- package/skills/ui-design/tests/e2e/runs/empty-agent-protocol-check/screenshots/mobile.png +0 -0
- package/skills/ui-design/tests/e2e/runs/iteration-1/deck/checks/browser-check.json +24 -0
- package/skills/ui-design/tests/e2e/runs/iteration-1/deck/checks/static-check.txt +2 -0
- package/skills/ui-design/tests/e2e/runs/iteration-1/deck/execution_notes.md +21 -0
- package/skills/ui-design/tests/e2e/runs/iteration-1/deck/outputs/deck.html +451 -0
- package/skills/ui-design/tests/e2e/runs/iteration-1/deck/screenshots/slide-01.png +0 -0
- package/skills/ui-design/tests/e2e/runs/iteration-1/deck/screenshots/slide-02.png +0 -0
- package/skills/ui-design/tests/e2e/runs/iteration-1/review.md +79 -0
- package/skills/ui-design/tests/e2e/runs/iteration-1/webpage/checks/browser-check.json +26 -0
- package/skills/ui-design/tests/e2e/runs/iteration-1/webpage/checks/static-check.txt +2 -0
- package/skills/ui-design/tests/e2e/runs/iteration-1/webpage/execution_notes.md +20 -0
- package/skills/ui-design/tests/e2e/runs/iteration-1/webpage/outputs/index.html +534 -0
- package/skills/ui-design/tests/e2e/runs/iteration-1/webpage/screenshots/desktop.png +0 -0
- package/skills/ui-design/tests/e2e/runs/iteration-1/webpage/screenshots/mobile.png +0 -0
- package/skills/ui-design/tests/e2e/runs/nebula-console-iteration-1/checks/browser-check.json +64 -0
- package/skills/ui-design/tests/e2e/runs/nebula-console-iteration-1/checks/language-check.txt +7 -0
- package/skills/ui-design/tests/e2e/runs/nebula-console-iteration-1/checks/quick-validate.txt +1 -0
- package/skills/ui-design/tests/e2e/runs/nebula-console-iteration-1/checks/static-console.txt +2 -0
- package/skills/ui-design/tests/e2e/runs/nebula-console-iteration-1/checks/static-homepage.txt +2 -0
- package/skills/ui-design/tests/e2e/runs/nebula-console-iteration-1/outputs/console.html +600 -0
- package/skills/ui-design/tests/e2e/runs/nebula-console-iteration-1/outputs/homepage.html +556 -0
- package/skills/ui-design/tests/e2e/runs/nebula-console-iteration-1/prompt.md +29 -0
- package/skills/ui-design/tests/e2e/runs/nebula-console-iteration-1/review.md +57 -0
- package/skills/ui-design/tests/e2e/runs/nebula-console-iteration-1/screenshots/console-desktop.png +0 -0
- package/skills/ui-design/tests/e2e/runs/nebula-console-iteration-1/screenshots/console-mobile.png +0 -0
- package/skills/ui-design/tests/e2e/runs/nebula-console-iteration-1/screenshots/homepage-desktop.png +0 -0
- package/skills/ui-design/tests/e2e/runs/nebula-console-iteration-1/screenshots/homepage-mobile.png +0 -0
- package/skills/ui-design/tests/e2e/runs/obsidian-optics-iteration-1/checks/browser-check.json +33 -0
- package/skills/ui-design/tests/e2e/runs/obsidian-optics-iteration-1/checks/language-check.txt +6 -0
- package/skills/ui-design/tests/e2e/runs/obsidian-optics-iteration-1/checks/quick-validate.txt +1 -0
- package/skills/ui-design/tests/e2e/runs/obsidian-optics-iteration-1/checks/static-check.txt +2 -0
- package/skills/ui-design/tests/e2e/runs/obsidian-optics-iteration-1/outputs/index.html +682 -0
- package/skills/ui-design/tests/e2e/runs/obsidian-optics-iteration-1/prompt.md +13 -0
- package/skills/ui-design/tests/e2e/runs/obsidian-optics-iteration-1/review.md +59 -0
- package/skills/ui-design/tests/e2e/runs/obsidian-optics-iteration-1/screenshots/desktop.png +0 -0
- package/skills/ui-design/tests/e2e/runs/obsidian-optics-iteration-1/screenshots/mobile.png +0 -0
- package/skills/ui-design/tests/e2e/runs/obsidian-xui-screenshot-check-1/outputs/page-01.html +466 -0
- package/skills/ui-design/tests/e2e/runs/obsidian-xui-screenshot-check-1/outputs/page-02.html +433 -0
- package/skills/ui-design/tests/e2e/runs/obsidian-xui-screenshot-check-1/prompt.md +13 -0
- package/skills/ui-design/tests/e2e/runs/obsidian-xui-screenshot-check-1/screenshots/page-01/browser-check.json +49 -0
- package/skills/ui-design/tests/e2e/runs/obsidian-xui-screenshot-check-1/screenshots/page-01/desktop.png +0 -0
- package/skills/ui-design/tests/e2e/runs/obsidian-xui-screenshot-check-1/screenshots/page-01/mobile.png +0 -0
- package/skills/ui-design/tests/e2e/runs/obsidian-xui-screenshot-check-1/screenshots/page-02/browser-check.json +49 -0
- package/skills/ui-design/tests/e2e/runs/obsidian-xui-screenshot-check-1/screenshots/page-02/desktop.png +0 -0
- package/skills/ui-design/tests/e2e/runs/obsidian-xui-screenshot-check-1/screenshots/page-02/mobile.png +0 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-1/checks/browser-check.json +49 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-1/checks/language-check.txt +3 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-1/checks/static-check.txt +2 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-1/execution_notes.md +24 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-1/outputs/index.html +723 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-1/prompt.md +15 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-1/review.md +26 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-1/screenshots/desktop.png +0 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-1/screenshots/mobile.png +0 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-2/checks/browser-dark.json +49 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-2/checks/browser-light.json +49 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-2/checks/language-check.txt +11 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-2/checks/static-dark.txt +2 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-2/checks/static-light.txt +3 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-2/execution_notes.md +23 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-2/outputs/dark.html +392 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-2/outputs/light.html +476 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-2/prompt.md +23 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-2/review.md +41 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-2/screenshots/dark/desktop.png +0 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-2/screenshots/dark/mobile.png +0 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-2/screenshots/light/desktop.png +0 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-2/screenshots/light/mobile.png +0 -0
- package/skills/ui-design/tests/e2e/runs/solar-relay-iteration-1/checks/browser-check.json +54 -0
- package/skills/ui-design/tests/e2e/runs/solar-relay-iteration-1/checks/language-check.txt +5 -0
- package/skills/ui-design/tests/e2e/runs/solar-relay-iteration-1/checks/quick-validate.txt +1 -0
- package/skills/ui-design/tests/e2e/runs/solar-relay-iteration-1/checks/static-check.txt +2 -0
- package/skills/ui-design/tests/e2e/runs/solar-relay-iteration-1/outputs/index.html +765 -0
- package/skills/ui-design/tests/e2e/runs/solar-relay-iteration-1/prompt.md +15 -0
- package/skills/ui-design/tests/e2e/runs/solar-relay-iteration-1/review.md +59 -0
- package/skills/ui-design/tests/e2e/runs/solar-relay-iteration-1/screenshots/desktop.png +0 -0
- package/skills/ui-design/tests/e2e/runs/solar-relay-iteration-1/screenshots/mobile.png +0 -0
- package/skills/ui-design/tests/e2e/runs/verdant-grid-preview-1/outputs/index.html +508 -0
- package/skills/ui-design/tests/e2e/runs/verdant-grid-preview-1/screenshots/browser-check.json +49 -0
- package/skills/ui-design/tests/e2e/runs/verdant-grid-preview-1/screenshots/desktop.png +0 -0
- package/skills/ui-design/tests/e2e/runs/verdant-grid-preview-1/screenshots/mobile.png +0 -0
- package/skills/ui-design/tests/e2e/runs/violet-meridian-iteration-1/checks/browser-check.json +54 -0
- package/skills/ui-design/tests/e2e/runs/violet-meridian-iteration-1/checks/language-check.txt +6 -0
- package/skills/ui-design/tests/e2e/runs/violet-meridian-iteration-1/checks/quick-validate.txt +1 -0
- package/skills/ui-design/tests/e2e/runs/violet-meridian-iteration-1/checks/static-check.txt +2 -0
- package/skills/ui-design/tests/e2e/runs/violet-meridian-iteration-1/outputs/index.html +788 -0
- package/skills/ui-design/tests/e2e/runs/violet-meridian-iteration-1/prompt.md +14 -0
- package/skills/ui-design/tests/e2e/runs/violet-meridian-iteration-1/review.md +60 -0
- package/skills/ui-design/tests/e2e/runs/violet-meridian-iteration-1/screenshots/desktop.png +0 -0
- package/skills/ui-design/tests/e2e/runs/violet-meridian-iteration-1/screenshots/mobile.png +0 -0
- package/skills/video-compose/SKILL.md +8 -1
- package/skills/web-crawler/SKILL.md +70 -0
- package/skills/web-crawler/scripts/crawl.mjs +538 -0
- package/skills/web-crawler/scripts/crawl.test.mjs +204 -0
- package/skills/xlsx/SKILL.md +12 -0
- package/skills/xlsx/scripts/opc_check.py +253 -0
- package/src/advisorState.js +22 -0
- package/src/askBridge.js +97 -3
- package/src/bootstrap/workingDir.js +12 -1
- package/src/cli/args.js +17 -1
- package/src/cli/configMenu.js +236 -0
- package/src/cli/configWizard.js +7 -5
- package/src/cli/print.js +37 -4
- package/src/cli/streamJson.js +77 -24
- package/src/cli/wizards/advisorWizard.js +147 -0
- package/src/cli/wizards/fieldForm.js +149 -0
- package/src/cli/wizards/imageWizard.js +60 -0
- package/src/cli/wizards/openRouterWizard.js +23 -0
- package/src/cli/wizards/providerPresets.js +95 -0
- package/src/cli/wizards/providerWizard.js +219 -0
- package/src/cli/wizards/searchWizard.js +23 -0
- package/src/cli/wizards/ttsWizard.js +34 -0
- package/src/config/configFile.js +441 -83
- package/src/config/configService.js +446 -0
- package/src/config.js +24 -64
- package/src/context/agentHome.js +9 -0
- package/src/context/archive.js +7 -2
- package/src/context/compact.js +8 -5
- package/src/context/contextLock.js +81 -0
- package/src/context/persistContext.js +30 -11
- package/src/context/reactiveCompact.js +4 -2
- package/src/context/recentDirs.js +21 -61
- package/src/context/sessionPath.js +97 -23
- package/src/context/sessionRegistry.js +303 -24
- package/src/context/tokenCounter.js +18 -0
- package/src/context/workspaceIndex.js +731 -0
- package/src/infra/verification.js +28 -15
- package/src/llm/client.js +394 -159
- package/src/llm/providers/anthropicFormat.js +241 -0
- package/src/llm/providers/openaiFormat.js +190 -0
- package/src/loop.js +219 -32
- package/src/main.js +61 -11
- package/src/messageQueue.js +97 -0
- package/src/multimodal.js +203 -0
- package/src/plugin-sdk.js +15 -0
- package/src/plugins/commandRouter.js +3 -0
- package/src/plugins/hookEngine.js +5 -1
- package/src/plugins/pluginLifecycle.js +28 -0
- package/src/plugins/pluginLoader.js +2 -1
- package/src/plugins/pluginRunner.js +49 -21
- package/src/plugins/transcript.js +4 -3
- package/src/prompts/pluginList.js +5 -5
- package/src/prompts/projectInstructions.js +3 -3
- package/src/prompts/promptAssembly.js +133 -144
- package/src/prompts/skillList.js +12 -22
- package/src/prompts/system.js +0 -1
- package/src/session/runAgentTurn.js +70 -0
- package/src/session/runTurn.js +41 -6
- package/src/toolGate.js +17 -0
- package/src/tools/advisor/advisor.js +379 -0
- package/src/tools/agent/agent.js +555 -0
- package/src/tools/agent/agentTypes.js +59 -0
- package/src/tools/agent/coordinator.js +93 -0
- package/src/tools/agent/worktree.js +270 -0
- package/src/tools/ask/ask.js +7 -2
- package/src/tools/bash/bash.js +112 -18
- package/src/tools/download/download.js +144 -0
- package/src/tools/edit/edit.js +1 -0
- package/src/tools/edit/multi-edit.js +1 -0
- package/src/tools/genimage/genimage.js +242 -0
- package/src/tools/genspeech/genspeech.js +67 -0
- package/src/tools/glob/glob.js +1 -0
- package/src/tools/grep/grep.js +3 -0
- package/src/tools/grep/rgPath.js +2 -0
- package/src/tools/index.js +25 -2
- package/src/tools/read/read.js +1 -0
- package/src/tools/shared/killTree.js +52 -0
- package/src/tools/toolProgressBridge.js +48 -0
- package/src/tools/webbrowser/agentBrowserPath.js +258 -0
- package/src/tools/webbrowser/browser.js +59 -42
- package/src/tools/webbrowser/browserControl.js +118 -0
- package/src/tools/webbrowser/browserDaemon.js +97 -0
- package/src/tools/webbrowser/browserService.js +27 -0
- package/src/tools/webbrowser/browserStream.js +119 -0
- package/src/tools/webbrowser/webbrowser.js +699 -130
- package/src/tools/webfetch/webfetch.js +1 -0
- package/src/tools/websearch/websearch.js +134 -51
- package/src/tools/write/write.js +1 -0
- package/src/ui/App.js +249 -22
- package/src/ui/AskQuestion.js +29 -10
- package/src/ui/InputBox.js +104 -12
- package/src/ui/LiveArea.js +112 -19
- package/src/ui/MessageList.js +100 -14
- package/src/ui/ModelPicker.js +56 -0
- package/src/ui/QueuedMessagesBanner.js +14 -0
- package/src/ui/Root.js +18 -10
- package/src/ui/SessionPicker.js +102 -0
- package/src/ui/StatusLine.js +13 -4
- package/src/ui/WorkspacePicker.js +55 -0
- package/src/ui/figures.js +44 -0
- package/src/ui/hooks/askSlot.js +82 -0
- package/src/ui/hooks/useChat.js +358 -64
- package/src/ui/hooks/usePasteHandler.js +11 -1
- package/src/ui/hooks/useTextBuffer.js +1 -3
- package/src/ui/liveViewport.js +5 -1
- package/src/ui/markdown.js +206 -0
- package/src/ui/textBuffer.js +0 -7
- package/src/ui/theme.js +32 -0
- package/src/utils/debugLog.js +0 -4
- package/src/utils/resourcePaths.js +2 -2
- package/src/utils/stripThink.js +50 -0
- package/src/web/browserBridge.js +447 -0
- package/src/web/protocol.js +19 -0
- package/workflows/adaptive-research.yaml +13 -5
- package/workflows/book-review-short.yaml +36 -10
- package/workflows/e2e-write-greet.yaml +6 -2
- package/workflows/illustrate.yaml +227 -0
- package/workflows/plan.yaml +460 -179
- package/workflows/ppt.yaml +1659 -0
- package/workflows/ralph-loop.yaml +199 -0
- package/workflows/schema.json +81 -23
- package/workflows/webppt.yaml +496 -0
- package/workflows/word.yaml +710 -0
- package/workflows/youtube-shorts.yaml +46 -15
- package/MINIMAL-TRACE.md +0 -77
- package/plugins/HOW-TO-WRITE-A-PLUGIN.md +0 -186
- package/plugins/ralph-wiggum/.claude-plugin/plugin.json +0 -9
- package/plugins/ralph-wiggum/README.md +0 -197
- package/plugins/ralph-wiggum/commands/cancel-ralph.md +0 -18
- package/plugins/ralph-wiggum/commands/help.md +0 -137
- package/plugins/ralph-wiggum/commands/ralph-loop.md +0 -85
- package/plugins/ralph-wiggum/hooks/hooks.json +0 -15
- package/plugins/ralph-wiggum/hooks/stop-hook.sh +0 -191
- package/plugins/ralph-wiggum/plugin.js +0 -280
- package/plugins/ralph-wiggum/src/goalState.js +0 -258
- package/plugins/ralph-wiggum/src/sentinels.js +0 -76
- package/plugins/ralph-wiggum/src/stopHookRunner.js +0 -104
- package/plugins/ralph-wiggum/src/verificationGate.js +0 -202
- package/plugins/workflow-runner/src/miniReAct.js +0 -223
- package/plugins/workflow-runner/src/voteHelpers.js +0 -110
- package/skills/config/SKILL.md +0 -123
- package/skills/frontend-design/LICENSE.txt +0 -177
- package/skills/frontend-design/SKILL.md +0 -42
- package/src/ui/ProgressPanel.js +0 -54
- package/src/ui/StreamingBlock.js +0 -11
- package/src/ui/ToolStatus.js +0 -11
package/src/config/configFile.js
CHANGED
|
@@ -1,112 +1,470 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* src/config/configFile.ts —— 模式 B 向导写的 provider 配置
|
|
4
|
-
* ------------------------------------------------------------
|
|
5
|
-
* 与 src/config.ts 的关系:
|
|
6
|
-
* - config.ts 负责"读取 process.env 拼装 Provider"(模式 A)
|
|
7
|
-
* - 本文件负责"读写 ~/.minimal-agent/config.json"(模式 B)
|
|
8
|
-
* - 上层(loadProviderLayered)先看 env、再看本文件
|
|
9
|
-
*
|
|
10
|
-
* 与 src/context/persistContext.ts 的关系:
|
|
11
|
-
* - 复用同一个目录 ~/.minimal-agent/
|
|
12
|
-
* - 同样"解析失败返回 null、写失败静默"模式
|
|
13
|
-
*
|
|
14
|
-
* 为什么用 JSON 而非 .env 格式:
|
|
15
|
-
* - 解析无歧义(dotenv 各家行为略有差异)
|
|
16
|
-
* - 显式区分"向导写的" vs "用户写的 .env",避免互相覆盖
|
|
17
|
-
* - JSON 还可以放结构化扩展(如 savedAt 用于排查)
|
|
18
|
-
* ============================================================
|
|
19
|
-
*/
|
|
20
|
-
import { chmod, mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { chmod, copyFile, mkdir, readFile, rename, rm, stat, unlink, writeFile } from 'node:fs/promises';
|
|
21
3
|
import { homedir } from 'node:os';
|
|
22
4
|
import { dirname, join } from 'node:path';
|
|
23
5
|
import { execSiblingDir } from '../utils/greenRoot.js';
|
|
6
|
+
export const DEFAULT_SUBAGENTS_CONFIG = {
|
|
7
|
+
enabled: true,
|
|
8
|
+
maxCallsPerTurn: 6,
|
|
9
|
+
maxConcurrent: 3,
|
|
10
|
+
defaultWriteIsolation: 'none',
|
|
11
|
+
timeoutMs: 1_800_000,
|
|
12
|
+
exploreMaxTurns: 50,
|
|
13
|
+
generalMaxTurns: 100,
|
|
14
|
+
};
|
|
15
|
+
export const DEFAULT_BROWSER_CONFIG = {
|
|
16
|
+
enabled: true,
|
|
17
|
+
profileId: 'default',
|
|
18
|
+
developerMode: false,
|
|
19
|
+
allowedCdpOrigins: [],
|
|
20
|
+
};
|
|
21
|
+
const DEFAULT_CONTEXT_WINDOW = 128_000;
|
|
22
|
+
const LOCK_STALE_MS = 120_000;
|
|
23
|
+
const LOCK_WAIT_MS = 15_000;
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
25
|
+
* 建议的单次输出 token 上限:min(32768, max(4096, contextWindow×0.25))。
|
|
26
|
+
* 上限 32768(非更保守的 16384)呼应 .env.example 的实测教训——16384 偏紧,写大 JSON
|
|
27
|
+
* 输出时会被截断;maxTokens 是上限不是预订额度,设大不额外花钱。
|
|
28
28
|
*/
|
|
29
|
+
export function defaultMaxTokens(contextWindow) {
|
|
30
|
+
return Math.min(32_768, Math.max(4_096, Math.round(contextWindow * 0.25)));
|
|
31
|
+
}
|
|
32
|
+
function homeConfigPath() {
|
|
33
|
+
return join(process.env.MINIMAL_AGENT_HOME ?? homedir(), '.minimal-agent', 'config.json');
|
|
34
|
+
}
|
|
29
35
|
export function getConfigFilePath() {
|
|
30
36
|
return process.env.MINIMAL_AGENT_CONFIG_FILE ?? homeConfigPath();
|
|
31
37
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
38
|
+
function positiveNumber(value) {
|
|
39
|
+
return typeof value === 'number' && Number.isFinite(value) && value > 0 ? value : undefined;
|
|
40
|
+
}
|
|
41
|
+
function boundedNumber(value, fallback, min, max) {
|
|
42
|
+
return Math.min(max, Math.max(min, positiveNumber(value) ?? fallback));
|
|
43
|
+
}
|
|
44
|
+
function nonEmpty(value) {
|
|
45
|
+
return typeof value === 'string' && value.trim() ? value.trim() : undefined;
|
|
46
|
+
}
|
|
47
|
+
// ---------------- v4(当前)解析 ----------------
|
|
48
|
+
function parseModel(value) {
|
|
49
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
50
|
+
return null;
|
|
51
|
+
const raw = value;
|
|
52
|
+
const id = nonEmpty(raw.id);
|
|
53
|
+
const baseURL = nonEmpty(raw.baseURL);
|
|
54
|
+
const model = nonEmpty(raw.model);
|
|
55
|
+
if (!id || !baseURL || !model)
|
|
56
|
+
return null;
|
|
57
|
+
const apiKey = typeof raw.apiKey === 'string' ? raw.apiKey.trim() : '';
|
|
58
|
+
const displayName = nonEmpty(raw.displayName);
|
|
59
|
+
const now = Date.now();
|
|
60
|
+
return {
|
|
61
|
+
id,
|
|
62
|
+
apiFormat: raw.apiFormat === 'anthropic' ? 'anthropic' : 'openai',
|
|
63
|
+
...(displayName ? { displayName } : {}),
|
|
64
|
+
baseURL,
|
|
65
|
+
apiKey,
|
|
66
|
+
model,
|
|
67
|
+
contextWindow: positiveNumber(raw.contextWindow) ?? DEFAULT_CONTEXT_WINDOW,
|
|
68
|
+
...(positiveNumber(raw.maxTokens) !== undefined ? { maxTokens: positiveNumber(raw.maxTokens) } : {}),
|
|
69
|
+
supportsVision: raw.supportsVision !== false,
|
|
70
|
+
enabled: raw.enabled !== false,
|
|
71
|
+
createdAt: positiveNumber(raw.createdAt) ?? now,
|
|
72
|
+
updatedAt: positiveNumber(raw.updatedAt) ?? now,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function parseModels(value) {
|
|
76
|
+
if (!Array.isArray(value))
|
|
77
|
+
return [];
|
|
78
|
+
const out = [];
|
|
79
|
+
for (const item of value) {
|
|
80
|
+
const model = parseModel(item);
|
|
81
|
+
if (model)
|
|
82
|
+
out.push(model);
|
|
83
|
+
}
|
|
84
|
+
return out;
|
|
85
|
+
}
|
|
86
|
+
function parseTools(value) {
|
|
87
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
88
|
+
return {};
|
|
89
|
+
const raw = value;
|
|
90
|
+
const out = {};
|
|
91
|
+
const search = raw.webSearch;
|
|
92
|
+
const searchKey = nonEmpty(search?.apiKey);
|
|
93
|
+
if (searchKey)
|
|
94
|
+
out.webSearch = { provider: 'tavily', apiKey: searchKey };
|
|
95
|
+
const image = raw.imageGeneration;
|
|
96
|
+
const imageBaseURL = nonEmpty(image?.baseURL);
|
|
97
|
+
const imageApiKey = nonEmpty(image?.apiKey);
|
|
98
|
+
const imageModel = nonEmpty(image?.model);
|
|
99
|
+
if (imageBaseURL && imageApiKey && imageModel) {
|
|
100
|
+
const protocol = image?.protocol === 'chat' || image?.protocol === 'images' ? image.protocol : 'auto';
|
|
101
|
+
out.imageGeneration = {
|
|
102
|
+
provider: nonEmpty(image?.provider) ?? 'openai',
|
|
103
|
+
baseURL: imageBaseURL,
|
|
104
|
+
apiKey: imageApiKey,
|
|
105
|
+
model: imageModel,
|
|
106
|
+
protocol,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
const openRouterKey = nonEmpty(raw.openRouter?.apiKey);
|
|
110
|
+
if (openRouterKey)
|
|
111
|
+
out.openRouter = { apiKey: openRouterKey };
|
|
112
|
+
const speech = raw.textToSpeech;
|
|
113
|
+
const speechKey = nonEmpty(speech?.apiKey);
|
|
114
|
+
const groupId = nonEmpty(speech?.groupId);
|
|
115
|
+
if (speechKey && groupId)
|
|
116
|
+
out.textToSpeech = { provider: 'minimax', apiKey: speechKey, groupId };
|
|
117
|
+
return out;
|
|
118
|
+
}
|
|
119
|
+
function parseAdvisor(value) {
|
|
120
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
121
|
+
return undefined;
|
|
122
|
+
const raw = value;
|
|
123
|
+
return {
|
|
124
|
+
enabled: raw.enabled !== false,
|
|
125
|
+
mode: raw.mode === 'manual' ? 'manual' : 'auto',
|
|
126
|
+
modelId: nonEmpty(raw.modelId) ?? null,
|
|
127
|
+
contextPolicy: 'full-relevant',
|
|
128
|
+
shareSensitive: raw.shareSensitive === true,
|
|
129
|
+
inputTokenBudget: boundedNumber(raw.inputTokenBudget, 128_000, 8_000, 128_000),
|
|
130
|
+
timeoutMs: boundedNumber(raw.timeoutMs, 180_000, 15_000, 300_000),
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
function parseSubagents(value) {
|
|
134
|
+
const raw = value && typeof value === 'object' && !Array.isArray(value) ? value : {};
|
|
135
|
+
return {
|
|
136
|
+
enabled: raw.enabled !== false,
|
|
137
|
+
maxCallsPerTurn: boundedNumber(raw.maxCallsPerTurn, 6, 1, 12),
|
|
138
|
+
maxConcurrent: boundedNumber(raw.maxConcurrent, 3, 1, 6),
|
|
139
|
+
defaultWriteIsolation: raw.defaultWriteIsolation === 'worktree' ? 'worktree' : 'none',
|
|
140
|
+
timeoutMs: boundedNumber(raw.timeoutMs, 1_800_000, 60_000, 3_600_000),
|
|
141
|
+
exploreMaxTurns: boundedNumber(raw.exploreMaxTurns, 50, 5, 100),
|
|
142
|
+
generalMaxTurns: boundedNumber(raw.generalMaxTurns, 100, 10, 200),
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
function parseBrowser(value) {
|
|
146
|
+
const raw = value && typeof value === 'object' && !Array.isArray(value) ? value : {};
|
|
147
|
+
return {
|
|
148
|
+
enabled: raw.enabled !== false,
|
|
149
|
+
profileId: 'default',
|
|
150
|
+
developerMode: raw.developerMode === true,
|
|
151
|
+
allowedCdpOrigins: Array.isArray(raw.allowedCdpOrigins)
|
|
152
|
+
? raw.allowedCdpOrigins.filter((item) => typeof item === 'string' && /^https?:\/\//i.test(item)).slice(0, 100)
|
|
153
|
+
: [],
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
function parseCurrent(data) {
|
|
157
|
+
if (data.version !== 4)
|
|
158
|
+
return null;
|
|
159
|
+
const advisor = parseAdvisor(data.advisor);
|
|
160
|
+
const compactRatio = typeof data.compactRatio === 'number' && data.compactRatio > 0 && data.compactRatio <= 1
|
|
161
|
+
? data.compactRatio
|
|
162
|
+
: undefined;
|
|
163
|
+
return {
|
|
164
|
+
version: 4,
|
|
165
|
+
models: parseModels(data.models),
|
|
166
|
+
baseModelId: nonEmpty(data.baseModelId) ?? null,
|
|
167
|
+
...(compactRatio !== undefined ? { compactRatio } : {}),
|
|
168
|
+
...(advisor ? { advisor } : {}),
|
|
169
|
+
subagents: parseSubagents(data.subagents),
|
|
170
|
+
browser: parseBrowser(data.browser),
|
|
171
|
+
tools: parseTools(data.tools),
|
|
172
|
+
...(data.drafts && typeof data.drafts === 'object' && !Array.isArray(data.drafts)
|
|
173
|
+
? { drafts: structuredClone(data.drafts) }
|
|
174
|
+
: {}),
|
|
175
|
+
savedAt: typeof data.savedAt === 'number' ? data.savedAt : 0,
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
function parseLegacyProviderConfig(value) {
|
|
179
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
180
|
+
return null;
|
|
181
|
+
const raw = value;
|
|
182
|
+
const baseURL = nonEmpty(raw.baseURL);
|
|
183
|
+
const apiKey = typeof raw.apiKey === 'string' ? raw.apiKey.trim() : undefined;
|
|
184
|
+
const model = nonEmpty(raw.model);
|
|
185
|
+
if (!baseURL || apiKey === undefined || !model)
|
|
186
|
+
return null;
|
|
187
|
+
const compactRatio = typeof raw.compactRatio === 'number' && raw.compactRatio > 0 && raw.compactRatio <= 1
|
|
188
|
+
? raw.compactRatio
|
|
189
|
+
: undefined;
|
|
190
|
+
return {
|
|
191
|
+
name: nonEmpty(raw.name) ?? 'env',
|
|
192
|
+
baseURL,
|
|
193
|
+
apiKey,
|
|
194
|
+
model,
|
|
195
|
+
contextWindow: positiveNumber(raw.contextWindow) ?? DEFAULT_CONTEXT_WINDOW,
|
|
196
|
+
...(compactRatio !== undefined ? { compactRatio } : {}),
|
|
197
|
+
...(positiveNumber(raw.maxTokens) !== undefined ? { maxTokens: positiveNumber(raw.maxTokens) } : {}),
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
function parseLegacyAdvisorConfig(value) {
|
|
201
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
202
|
+
return undefined;
|
|
203
|
+
const raw = value;
|
|
204
|
+
const provider = parseLegacyProviderConfig(raw.provider);
|
|
205
|
+
if (!provider)
|
|
206
|
+
return undefined;
|
|
207
|
+
return {
|
|
208
|
+
enabled: raw.enabled !== false,
|
|
209
|
+
mode: raw.mode === 'manual' ? 'manual' : 'auto',
|
|
210
|
+
provider,
|
|
211
|
+
supportsVision: raw.supportsVision === true,
|
|
212
|
+
shareSensitive: raw.shareSensitive === true,
|
|
213
|
+
inputTokenBudget: boundedNumber(raw.inputTokenBudget, 128_000, 8_000, 128_000),
|
|
214
|
+
timeoutMs: boundedNumber(raw.timeoutMs, 180_000, 15_000, 300_000),
|
|
215
|
+
};
|
|
35
216
|
}
|
|
36
217
|
/**
|
|
37
|
-
*
|
|
218
|
+
* 把「单一基座 provider + 可选单一顾问 provider」的旧形状构造成 v4 的模型列表形状。
|
|
219
|
+
* v1(无 version 字段的扁平文件)与 v2/v3(provider/advisor 单对象)迁移路径共用这一个函数。
|
|
38
220
|
*/
|
|
221
|
+
function buildV4FromLegacy(legacyProvider, legacyAdvisor, subagents, tools, savedAt) {
|
|
222
|
+
const now = Date.now();
|
|
223
|
+
const baseModel = {
|
|
224
|
+
id: 'migrated-base',
|
|
225
|
+
apiFormat: 'openai',
|
|
226
|
+
...(legacyProvider.name !== 'env' ? { displayName: legacyProvider.name } : {}),
|
|
227
|
+
baseURL: legacyProvider.baseURL,
|
|
228
|
+
apiKey: legacyProvider.apiKey,
|
|
229
|
+
model: legacyProvider.model,
|
|
230
|
+
contextWindow: legacyProvider.contextWindow,
|
|
231
|
+
...(legacyProvider.maxTokens !== undefined ? { maxTokens: legacyProvider.maxTokens } : {}),
|
|
232
|
+
enabled: true,
|
|
233
|
+
createdAt: now,
|
|
234
|
+
updatedAt: now,
|
|
235
|
+
};
|
|
236
|
+
const models = [baseModel];
|
|
237
|
+
let advisor;
|
|
238
|
+
if (legacyAdvisor) {
|
|
239
|
+
const sameAsBase = legacyAdvisor.provider.baseURL === baseModel.baseURL
|
|
240
|
+
&& legacyAdvisor.provider.apiKey === baseModel.apiKey
|
|
241
|
+
&& legacyAdvisor.provider.model === baseModel.model;
|
|
242
|
+
let advisorModelId;
|
|
243
|
+
if (sameAsBase) {
|
|
244
|
+
if (legacyAdvisor.supportsVision)
|
|
245
|
+
baseModel.supportsVision = true;
|
|
246
|
+
advisorModelId = baseModel.id;
|
|
247
|
+
}
|
|
248
|
+
else {
|
|
249
|
+
const advisorModel = {
|
|
250
|
+
id: 'migrated-advisor',
|
|
251
|
+
apiFormat: 'openai',
|
|
252
|
+
...(legacyAdvisor.provider.name !== 'advisor' ? { displayName: legacyAdvisor.provider.name } : {}),
|
|
253
|
+
baseURL: legacyAdvisor.provider.baseURL,
|
|
254
|
+
apiKey: legacyAdvisor.provider.apiKey,
|
|
255
|
+
model: legacyAdvisor.provider.model,
|
|
256
|
+
contextWindow: legacyAdvisor.provider.contextWindow,
|
|
257
|
+
...(legacyAdvisor.provider.maxTokens !== undefined ? { maxTokens: legacyAdvisor.provider.maxTokens } : {}),
|
|
258
|
+
...(legacyAdvisor.supportsVision ? { supportsVision: true } : {}),
|
|
259
|
+
enabled: true,
|
|
260
|
+
createdAt: now,
|
|
261
|
+
updatedAt: now,
|
|
262
|
+
};
|
|
263
|
+
models.push(advisorModel);
|
|
264
|
+
advisorModelId = advisorModel.id;
|
|
265
|
+
}
|
|
266
|
+
advisor = {
|
|
267
|
+
enabled: legacyAdvisor.enabled,
|
|
268
|
+
mode: legacyAdvisor.mode,
|
|
269
|
+
modelId: advisorModelId,
|
|
270
|
+
contextPolicy: 'full-relevant',
|
|
271
|
+
shareSensitive: legacyAdvisor.shareSensitive,
|
|
272
|
+
inputTokenBudget: legacyAdvisor.inputTokenBudget,
|
|
273
|
+
timeoutMs: legacyAdvisor.timeoutMs,
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
return {
|
|
277
|
+
version: 4,
|
|
278
|
+
models,
|
|
279
|
+
baseModelId: baseModel.id,
|
|
280
|
+
...(legacyProvider.compactRatio !== undefined ? { compactRatio: legacyProvider.compactRatio } : {}),
|
|
281
|
+
...(advisor ? { advisor } : {}),
|
|
282
|
+
subagents,
|
|
283
|
+
browser: DEFAULT_BROWSER_CONFIG,
|
|
284
|
+
tools,
|
|
285
|
+
savedAt,
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
function migrateV1(data) {
|
|
289
|
+
const provider = parseLegacyProviderConfig({
|
|
290
|
+
name: data.provider,
|
|
291
|
+
baseURL: data.baseURL,
|
|
292
|
+
apiKey: data.apiKey,
|
|
293
|
+
model: data.model,
|
|
294
|
+
contextWindow: data.contextWindow,
|
|
295
|
+
compactRatio: data.compactRatio,
|
|
296
|
+
maxTokens: data.maxTokens,
|
|
297
|
+
});
|
|
298
|
+
if (!provider)
|
|
299
|
+
return null;
|
|
300
|
+
const tools = {};
|
|
301
|
+
const tavilyApiKey = nonEmpty(data.tavilyApiKey);
|
|
302
|
+
if (tavilyApiKey)
|
|
303
|
+
tools.webSearch = { provider: 'tavily', apiKey: tavilyApiKey };
|
|
304
|
+
return buildV4FromLegacy(provider, undefined, DEFAULT_SUBAGENTS_CONFIG, tools, typeof data.savedAt === 'number' ? data.savedAt : 0);
|
|
305
|
+
}
|
|
306
|
+
function migrateV3(data) {
|
|
307
|
+
const provider = parseLegacyProviderConfig(data.provider);
|
|
308
|
+
if (!provider)
|
|
309
|
+
return null;
|
|
310
|
+
const advisor = parseLegacyAdvisorConfig(data.advisor);
|
|
311
|
+
return buildV4FromLegacy(provider, advisor, parseSubagents(data.subagents), parseTools(data.tools), typeof data.savedAt === 'number' ? data.savedAt : 0);
|
|
312
|
+
}
|
|
39
313
|
async function parseConfigFile(file) {
|
|
40
314
|
try {
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
if (typeof data.baseURL !== 'string' ||
|
|
44
|
-
typeof data.apiKey !== 'string' ||
|
|
45
|
-
typeof data.model !== 'string' ||
|
|
46
|
-
data.baseURL.length === 0 ||
|
|
47
|
-
data.apiKey.length === 0 ||
|
|
48
|
-
data.model.length === 0) {
|
|
315
|
+
const data = JSON.parse(await readFile(file, 'utf8'));
|
|
316
|
+
if (!data || typeof data !== 'object' || Array.isArray(data))
|
|
49
317
|
return null;
|
|
318
|
+
const object = data;
|
|
319
|
+
const current = parseCurrent(object);
|
|
320
|
+
if (current)
|
|
321
|
+
return { config: current, migrated: object.version !== 4, fromVersion: 4 };
|
|
322
|
+
if (object.version === 2 || object.version === 3) {
|
|
323
|
+
const migrated = migrateV3(object);
|
|
324
|
+
if (migrated)
|
|
325
|
+
return { config: migrated, migrated: true, fromVersion: object.version };
|
|
50
326
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
apiKey: data.apiKey,
|
|
54
|
-
model: data.model,
|
|
55
|
-
provider: typeof data.provider === 'string' ? data.provider : undefined,
|
|
56
|
-
contextWindow: typeof data.contextWindow === 'number' && data.contextWindow > 0
|
|
57
|
-
? data.contextWindow
|
|
58
|
-
: undefined,
|
|
59
|
-
compactRatio: typeof data.compactRatio === 'number' &&
|
|
60
|
-
data.compactRatio > 0 &&
|
|
61
|
-
data.compactRatio <= 1
|
|
62
|
-
? data.compactRatio
|
|
63
|
-
: undefined,
|
|
64
|
-
tavilyApiKey: typeof data.tavilyApiKey === 'string' && data.tavilyApiKey.length > 0
|
|
65
|
-
? data.tavilyApiKey
|
|
66
|
-
: undefined,
|
|
67
|
-
savedAt: typeof data.savedAt === 'number' ? data.savedAt : 0,
|
|
68
|
-
};
|
|
327
|
+
const migrated = migrateV1(object);
|
|
328
|
+
return migrated ? { config: migrated, migrated: true, fromVersion: 1 } : null;
|
|
69
329
|
}
|
|
70
330
|
catch {
|
|
71
331
|
return null;
|
|
72
332
|
}
|
|
73
333
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
334
|
+
function processIsAlive(pid) {
|
|
335
|
+
try {
|
|
336
|
+
process.kill(pid, 0);
|
|
337
|
+
return true;
|
|
338
|
+
}
|
|
339
|
+
catch (error) {
|
|
340
|
+
return error.code === 'EPERM';
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
async function acquireConfigLock(file) {
|
|
344
|
+
const lockDir = `${file}.lock`;
|
|
345
|
+
const ownerFile = join(lockDir, 'owner.json');
|
|
346
|
+
const startedAt = Date.now();
|
|
347
|
+
await mkdir(dirname(file), { recursive: true, mode: 0o700 });
|
|
348
|
+
while (true) {
|
|
349
|
+
try {
|
|
350
|
+
await mkdir(lockDir, { mode: 0o700 });
|
|
351
|
+
await writeFile(ownerFile, JSON.stringify({ pid: process.pid, createdAt: Date.now() }), { mode: 0o600 });
|
|
352
|
+
return async () => { await rm(lockDir, { recursive: true, force: true }); };
|
|
353
|
+
}
|
|
354
|
+
catch (error) {
|
|
355
|
+
if (error.code !== 'EEXIST')
|
|
356
|
+
throw error;
|
|
357
|
+
let stale = false;
|
|
358
|
+
try {
|
|
359
|
+
const [ownerRaw, info] = await Promise.all([readFile(ownerFile, 'utf8'), stat(lockDir)]);
|
|
360
|
+
const owner = JSON.parse(ownerRaw);
|
|
361
|
+
stale = typeof owner.pid === 'number' ? !processIsAlive(owner.pid) : Date.now() - info.mtimeMs > LOCK_STALE_MS;
|
|
362
|
+
}
|
|
363
|
+
catch {
|
|
364
|
+
try {
|
|
365
|
+
const info = await stat(lockDir);
|
|
366
|
+
stale = Date.now() - info.mtimeMs > LOCK_STALE_MS;
|
|
367
|
+
}
|
|
368
|
+
catch {
|
|
369
|
+
stale = false;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
if (stale) {
|
|
373
|
+
await rm(lockDir, { recursive: true, force: true });
|
|
374
|
+
continue;
|
|
375
|
+
}
|
|
376
|
+
if (Date.now() - startedAt > LOCK_WAIT_MS)
|
|
377
|
+
throw new Error('等待配置文件锁超时');
|
|
378
|
+
await new Promise((resolve) => setTimeout(resolve, 40));
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
async function writeConfigFile(file, config) {
|
|
383
|
+
const release = await acquireConfigLock(file);
|
|
384
|
+
try {
|
|
385
|
+
await writeConfigFileUnlocked(file, config);
|
|
386
|
+
}
|
|
387
|
+
finally {
|
|
388
|
+
await release();
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
async function writeConfigFileUnlocked(file, config) {
|
|
392
|
+
const tmp = `${file}.${process.pid}.${randomUUID()}.tmp`;
|
|
393
|
+
try {
|
|
394
|
+
await mkdir(dirname(file), { recursive: true, mode: 0o700 });
|
|
395
|
+
await writeFile(tmp, JSON.stringify(config, null, 2), { encoding: 'utf8', mode: 0o600 });
|
|
396
|
+
await rename(tmp, file);
|
|
397
|
+
await chmod(file, 0o600).catch(() => { });
|
|
398
|
+
}
|
|
399
|
+
finally {
|
|
400
|
+
await unlink(tmp).catch(() => { });
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
function configCandidates() {
|
|
88
404
|
const override = process.env.MINIMAL_AGENT_CONFIG_FILE;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
405
|
+
return override ? [override] : [homeConfigPath(), join(execSiblingDir(), 'config.json')];
|
|
406
|
+
}
|
|
407
|
+
export async function readMinimalAgentConfig(options = {}) {
|
|
408
|
+
for (const file of configCandidates()) {
|
|
409
|
+
const parsed = await parseConfigFile(file);
|
|
410
|
+
if (!parsed)
|
|
411
|
+
continue;
|
|
412
|
+
if (options.migrate !== false && (parsed.migrated || file !== getConfigFilePath())) {
|
|
413
|
+
// 备份只在「原地迁移会覆盖源文件」时才有意义(file == 权威写入位)。
|
|
414
|
+
// exe 同级(U 盘预置)源文件永不被覆盖,且「绝不写 U 盘」是产品红线——
|
|
415
|
+
// 曾在此给 U 盘目录写出 config.json.v1.backup(绿色版冒烟实测抓到)。
|
|
416
|
+
// 备份文件名按来源版本号命名(而非固定 .v1.backup):一台机器可能先后经历
|
|
417
|
+
// v1→v3、又 v3→v4 两次迁移,固定文件名会让第二次覆盖第一次的备份。
|
|
418
|
+
if (parsed.migrated && file === getConfigFilePath()) {
|
|
419
|
+
await copyFile(file, `${file}.v${parsed.fromVersion}.backup`).catch(() => { });
|
|
420
|
+
}
|
|
421
|
+
// A schema-only migration must not invalidate a revision already returned to
|
|
422
|
+
// another process during startup.
|
|
423
|
+
await writeConfigFile(getConfigFilePath(), parsed.config);
|
|
424
|
+
}
|
|
425
|
+
return parsed.config;
|
|
95
426
|
}
|
|
96
427
|
return null;
|
|
97
428
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
429
|
+
export async function saveMinimalAgentConfig(config) {
|
|
430
|
+
const next = {
|
|
431
|
+
version: 4,
|
|
432
|
+
models: config.models,
|
|
433
|
+
baseModelId: config.baseModelId,
|
|
434
|
+
...(config.compactRatio !== undefined ? { compactRatio: config.compactRatio } : {}),
|
|
435
|
+
advisor: config.advisor,
|
|
436
|
+
subagents: config.subagents ?? DEFAULT_SUBAGENTS_CONFIG,
|
|
437
|
+
browser: config.browser ?? DEFAULT_BROWSER_CONFIG,
|
|
438
|
+
tools: config.tools,
|
|
439
|
+
drafts: config.drafts,
|
|
440
|
+
savedAt: Date.now(),
|
|
441
|
+
};
|
|
442
|
+
await writeConfigFile(getConfigFilePath(), next);
|
|
443
|
+
return next;
|
|
444
|
+
}
|
|
445
|
+
/** Cross-process read-modify-write. The mutator never sees a partially written file. */
|
|
446
|
+
export async function updateMinimalAgentConfig(mutate) {
|
|
103
447
|
const file = getConfigFilePath();
|
|
104
|
-
await
|
|
105
|
-
const data = { ...cfg, savedAt: Date.now() };
|
|
106
|
-
await writeFile(file, JSON.stringify(data, null, 2), 'utf8');
|
|
448
|
+
const release = await acquireConfigLock(file);
|
|
107
449
|
try {
|
|
108
|
-
await
|
|
450
|
+
const current = (await parseConfigFile(file))?.config ?? null;
|
|
451
|
+
const value = mutate(current);
|
|
452
|
+
const next = {
|
|
453
|
+
version: 4,
|
|
454
|
+
models: value.models,
|
|
455
|
+
baseModelId: value.baseModelId,
|
|
456
|
+
...(value.compactRatio !== undefined ? { compactRatio: value.compactRatio } : {}),
|
|
457
|
+
advisor: value.advisor,
|
|
458
|
+
subagents: value.subagents ?? current?.subagents ?? DEFAULT_SUBAGENTS_CONFIG,
|
|
459
|
+
browser: value.browser ?? current?.browser ?? DEFAULT_BROWSER_CONFIG,
|
|
460
|
+
tools: value.tools,
|
|
461
|
+
drafts: value.drafts,
|
|
462
|
+
savedAt: Math.max(Date.now(), (current?.savedAt ?? 0) + 1),
|
|
463
|
+
};
|
|
464
|
+
await writeConfigFileUnlocked(file, next);
|
|
465
|
+
return next;
|
|
109
466
|
}
|
|
110
|
-
|
|
467
|
+
finally {
|
|
468
|
+
await release();
|
|
111
469
|
}
|
|
112
470
|
}
|