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
|
@@ -1,60 +1,40 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ============================================================
|
|
3
|
-
* plugins/workflow-runner/src/agentCommon.ts —— workflow 内「有界 agent
|
|
3
|
+
* plugins/workflow-runner/src/agentCommon.ts —— workflow 内「有界 agent」的共享工具
|
|
4
4
|
* ------------------------------------------------------------
|
|
5
|
-
* 工作流里有两处会临时起一个 agent
|
|
5
|
+
* 工作流里有两处会临时起一个 agent(runQuery 执行后的验证闸门):
|
|
6
6
|
* - onError:'recover'(recovery.ts)—— 节点失败后救火
|
|
7
7
|
* - agent: 节点(stepExecutors/agent.ts)—— 作者显式声明的开放任务
|
|
8
8
|
* 二者本质同构:受工作流目标/上下文指导、用工具随机应变、产出经验证后回灌 capture。
|
|
9
9
|
* 为避免「同一个脑子写两份提示词、行为漂移」,这里收敛它们的**共享件**:
|
|
10
|
-
* 1.
|
|
11
|
-
* 两处只在前面各加一句**角色开场白**(recover=救火 / agent=自主完成一步),
|
|
12
|
-
* 后面追加共享纪律块。
|
|
13
|
-
* 2. 统一验证闸门(interpretMiniReActResult)—— miniReAct 跑完后,判定「真交付」还是
|
|
10
|
+
* 1. 统一验证闸门(interpretMiniReActResult)—— runQuery 执行完后,判定「真交付」还是
|
|
14
11
|
* 「放弃/不可信」,**永不把没验证过的产出当成功**。这是 Phase 2 验证闸门的提取。
|
|
12
|
+
*
|
|
13
|
+
* ⚠️ GIVEUP 标记设计原则(v0.9.3 修复 LLM 误触发问题):
|
|
14
|
+
* 旧标记 __AGENT_GIVEUP__ 使用 __XXX__ 格式,MiniMax/GPT 等模型容易在输出中
|
|
15
|
+
* 幻觉出类似标记(如 "__AGENT_GIVEUP__: since I did the work..."),导致已完成的工作
|
|
16
|
+
* 被误判为"放弃"而 halt。新标记采用三重防误触发设计:
|
|
17
|
+
* ① 非标准格式(非 __XXX__,LLM 训练数据中几乎不存在)
|
|
18
|
+
* ② 含明确的 "DO-NOT-GENERATE" 警告文本
|
|
19
|
+
* ③ 检测逻辑增加内容长度启发式(reason > 80 字符视为误报)
|
|
15
20
|
* ============================================================
|
|
16
21
|
*/
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
export const GIVEUP_MARKER = '__AGENT_GIVEUP__';
|
|
20
|
-
/** agent 步骤的角色开场白(与 recovery 的 RECOVER_OPENING 对称) */
|
|
21
|
-
export const AGENT_OPENING = '你是一名资深工程师,被一个确定性工作流临时调来「自主完成一步开放任务」。';
|
|
22
|
-
/** 共享纪律块:所有 workflow 内 agent 的通用行为约束(角色开场白由各调用方拼在前面)。 */
|
|
23
|
-
const DISCIPLINE = `按这个纪律干活:
|
|
24
|
-
1. 先想清楚「这一步要产出什么」,必要时用只读工具(Read / Grep / Glob)做最小探查,别凭空猜、别凭空编。
|
|
25
|
-
2. 用工具**实际去做**(读文件、执行命令、写文件…),不要只描述计划。
|
|
26
|
-
3. **收尾前必须自我验证**:用工具确认产出确实存在且满足意图(写了文件就 Read 回来核对、跑了命令就检查退出码与输出)。没验证过不算完成。
|
|
27
|
-
|
|
28
|
-
安全护栏(你握有包括 Bash 在内的全部工具,务必克制):
|
|
29
|
-
- 只做达成意图所必需的最小动作,优先可逆操作。
|
|
30
|
-
- 严禁破坏性行为:不 rm -rf、不删除/覆盖与本步无关的用户数据、不碰工作目录以外的东西。
|
|
31
|
-
- **绝不靠伪造、占位、或编造一段「看起来对」的文本来假装成功**——你的产出会被工作流绑给后续步骤,假结果比诚实失败更糟。
|
|
32
|
-
|
|
33
|
-
收尾(二选一,硬约束):
|
|
34
|
-
- 真的达成了 → 最终消息**只输出这一步要的结果本身**,不要寒暄、不要复述要求、不要解释推理过程。若要求结构化输出,严格按 JSON Schema、**不要**用 markdown 代码块包裹。
|
|
35
|
-
- 确实做不成 → 最终消息**只输出一行**:\`${GIVEUP_MARKER}: <一句话说明为什么>\`,让工作流诚实地停下。绝不要为了「交差」而编一个假结果。`;
|
|
22
|
+
import { runQuery, stripThinkBlocks, } from '../../../src/plugin-sdk.js';
|
|
23
|
+
import { normalizeCapture, } from './types.js';
|
|
36
24
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
* 角色开场白 + 基础内核(含 skill/plugin/工具完整列表) + 共享纪律
|
|
25
|
+
* agent 显式放弃的唯一标记;recover 与 agent 节点共用。
|
|
40
26
|
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
27
|
+
* 设计约束(纯 ASCII,避免 Unicode 编码匹配问题):
|
|
28
|
+
* - 不使用 __XXX__ 格式(LLM 容易幻觉模仿)
|
|
29
|
+
* - 含 "wf-internal" 前缀 + "do-not-generate" 明确警告
|
|
30
|
+
* - 使用 [bracket] 格式而非 ⟨angle⟩(避免 Unicode 字符在 Bun indexOf 中行为不一致)
|
|
43
31
|
*/
|
|
44
|
-
export
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
includeProjectInstructions: false, // workflow 子步骤不需要项目指令
|
|
49
|
-
includePlugins: true, // 插件列表对 agent 也有参考价值
|
|
50
|
-
});
|
|
51
|
-
return `${opening}\n\n${baseKernel}\n\n${DISCIPLINE}`;
|
|
52
|
-
}
|
|
53
|
-
/** 把 step.capture 翻成「下游会把你的结果存成哪些变量」,让 agent 产出对得上形状。 */
|
|
32
|
+
export const GIVEUP_MARKER = '[wf-internal-abort-do-not-generate]';
|
|
33
|
+
/** 把 step.capture 翻成「下游会把你的结果存成哪些变量」,让 agent 产出对得上形状。
|
|
34
|
+
* 经 normalizeCapture:裸字符串 capture(capture: design_doc)不再被拆成单字符
|
|
35
|
+
* 【d、e、s…】,而是正确显示为【design_doc】。 */
|
|
54
36
|
export function describeCaptureContract(step) {
|
|
55
|
-
|
|
56
|
-
return '';
|
|
57
|
-
const names = Object.values(step.capture);
|
|
37
|
+
const names = Object.values(normalizeCapture(step.capture));
|
|
58
38
|
if (names.length === 0)
|
|
59
39
|
return '';
|
|
60
40
|
return `\n\n下游契约:工作流会把你的结果保存为变量【${names.join('、')}】供后续步骤引用,请确保你的产出能填好这些变量。`;
|
|
@@ -62,28 +42,224 @@ export function describeCaptureContract(step) {
|
|
|
62
42
|
export function truncate(s, n) {
|
|
63
43
|
return s.length > n ? `${s.slice(0, n)}…` : s;
|
|
64
44
|
}
|
|
45
|
+
// stripThinkBlocks 已上移内核 src/utils/stripThink.ts(Agent 子任务工具同样需要,
|
|
46
|
+
// 内核不能 import 插件)——顶部 import 供本模块使用,此处 re-export 保持插件内
|
|
47
|
+
// 既有 import 路径不变。
|
|
48
|
+
export { stripThinkBlocks };
|
|
49
|
+
/**
|
|
50
|
+
* 组合「原始目标锚 + 累积的用户补充要求」为本步实际注入的锚定文本。
|
|
51
|
+
* agent / llm / skill / recovery 四个执行器统一经此取锚——补充要求
|
|
52
|
+
* (pause 审批反馈 / goal_supplement 步产出 / 仲裁延续的新指令)与原始目标
|
|
53
|
+
* 同等贯穿每一步,不再只活在被修订的文件或某个变量里。
|
|
54
|
+
* 返回空串 = 无锚(执行器跳过注入,行为同旧 ctx.goalAnchor 为空)。
|
|
55
|
+
*/
|
|
56
|
+
export function effectiveGoalAnchor(ctx) {
|
|
57
|
+
const base = ctx.goalAnchor ?? '';
|
|
58
|
+
const supps = (ctx.goalSupplements ?? []).filter((s) => s.trim());
|
|
59
|
+
if (supps.length === 0)
|
|
60
|
+
return base;
|
|
61
|
+
const lines = supps.map((s) => `> 📌 用户补充要求:${s}`).join('\n');
|
|
62
|
+
return base ? `${base}\n${lines}` : `${lines}\n> ⚠️ 以上补充要求与原始目标同等约束所有操作。`;
|
|
63
|
+
}
|
|
64
|
+
/** 把 llm_error 细节拼进可重试失败的抛错文案(无细节时退化为原样文案)。 */
|
|
65
|
+
export function describeLlmFailure(stepId, detail) {
|
|
66
|
+
const base = `step ${stepId}: LLM 调用失败且无产出(触发重试)`;
|
|
67
|
+
return detail ? `${base}—— ${truncate(detail, 300)}` : base;
|
|
68
|
+
}
|
|
69
|
+
function cloneMessage(msg) {
|
|
70
|
+
if (msg.role === 'user' && Array.isArray(msg.content)) {
|
|
71
|
+
return { ...msg, content: msg.content.map((part) => ({ ...part })) };
|
|
72
|
+
}
|
|
73
|
+
return { ...msg };
|
|
74
|
+
}
|
|
75
|
+
function createStepHistory(step, ctx) {
|
|
76
|
+
if (step.history_mode !== 'isolated')
|
|
77
|
+
return ctx.history;
|
|
78
|
+
return ctx.history.filter((msg) => msg.role === 'system').map(cloneMessage);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* agent / llm / skill 三个执行器共享的 runQuery 消费层。
|
|
82
|
+
*
|
|
83
|
+
* 为什么不能各自 `yield*` 直透(曾经的三份拷贝、agent.ts 漏同步酿成误报):
|
|
84
|
+
* runQuery 遇 LLM 超时/网络错是 yield error 后 return(不 throw),直透会让
|
|
85
|
+
* 执行器拿到空 history → 静默返回空文本 → runner 的 in-run retry 不触发
|
|
86
|
+
* (只对抛异常的 step 重试)。这里统一显式消费、侦测终结错误,把
|
|
87
|
+
* 「拿产出 + 记旗标」收敛成一份;**空产出 + sawLlmError 时抛不抛错的语义
|
|
88
|
+
* 差异保留在各执行器**(agent 还要过验证闸门,llm/skill 不过)。
|
|
89
|
+
*
|
|
90
|
+
* 事件透传逐字节等价于重构前:
|
|
91
|
+
* - error / interrupted 照常冒泡(红字照常显示,retry 交给 runner)
|
|
92
|
+
* - 'compact_failed' 非致命,不计为失败
|
|
93
|
+
* - suppressTurnDone(仅 skill 传 true):turn_done 是 runQuery 单次调用的
|
|
94
|
+
* 终结标记,不是 workflow 终结,外泄会让 gateway broker / -p json 误判
|
|
95
|
+
*/
|
|
96
|
+
export async function* runStepQuery(prompt, step, ctx, opts) {
|
|
97
|
+
const activeHistory = createStepHistory(step, ctx);
|
|
98
|
+
// 记录 runQuery 开始前的 history 长度,用于之后提取本步的 assistant 输出
|
|
99
|
+
const historyLenBefore = activeHistory.length;
|
|
100
|
+
let aborted = false;
|
|
101
|
+
let sawLlmError = false;
|
|
102
|
+
let sawMaxTurns = false;
|
|
103
|
+
let llmErrorDetail = '';
|
|
104
|
+
let sawToolCall = false;
|
|
105
|
+
let toolOkCount = 0;
|
|
106
|
+
let toolFailCount = 0;
|
|
107
|
+
const toolNames = [];
|
|
108
|
+
for await (const ev of runQuery(prompt, {
|
|
109
|
+
provider: ctx.provider,
|
|
110
|
+
history: activeHistory,
|
|
111
|
+
signal: ctx.signal,
|
|
112
|
+
maxTurns: opts.maxTurns,
|
|
113
|
+
allowedTools: step.allowed_tools,
|
|
114
|
+
chat: ctx.chat,
|
|
115
|
+
executeTool: ctx.executeTool,
|
|
116
|
+
sessionState: ctx.sessionState,
|
|
117
|
+
imageInputs: opts.imageInputs,
|
|
118
|
+
parseInlineImages: opts.parseInlineImages,
|
|
119
|
+
imageDetail: opts.imageDetail,
|
|
120
|
+
imageMaxLongSidePixel: opts.imageMaxLongSidePixel,
|
|
121
|
+
})) {
|
|
122
|
+
if (ev.type === 'error') {
|
|
123
|
+
if (ev.code === 'aborted') {
|
|
124
|
+
aborted = true;
|
|
125
|
+
}
|
|
126
|
+
else if (ev.code === 'llm_error') {
|
|
127
|
+
sawLlmError = true;
|
|
128
|
+
llmErrorDetail = ev.error; // 留住 provider 真实报错,供执行器抛错时附带
|
|
129
|
+
// 🚫 不原样把这条 raw error 事件漏给顶层消费者(2026-07-04 真机事故:-p 模式
|
|
130
|
+
// 收到任意 type:'error' 就 handleEvent→exitCode:1→process.exit(),把整个 -p 进程
|
|
131
|
+
// 杀死在这里——比 runner.ts 的 in-run retry(max_retries/onError:continue)先一步
|
|
132
|
+
// 判定「终结」,等于跳过了整套设计好的重试/降级机制。这条信号已被上面两行转成
|
|
133
|
+
// sawLlmError/llmErrorDetail,稍后由本函数调用方(agent.ts 等)转成规范的可重试
|
|
134
|
+
// Error 抛出,交给 runner.ts 的 catch 块按 max_retries/onError 决定真正要不要终结、
|
|
135
|
+
// 要终结时也是由 runner.ts 在恰当时机重新 yield 一条 warning/error,不需要这条 raw 事件。
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
else if (ev.code === 'max_turns') {
|
|
139
|
+
sawMaxTurns = true;
|
|
140
|
+
// 同上:max_turns 截断本是「可续跑」信号(isMaxTurnsCutoff),必须留给 runner.ts
|
|
141
|
+
// 的 in-run retry 先处理,不能原样漏给顶层当成终结。
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
else if (ev.type === 'warning' &&
|
|
146
|
+
ev.message.includes('finish_reason=length')) {
|
|
147
|
+
sawMaxTurns = true;
|
|
148
|
+
}
|
|
149
|
+
else if (ev.type === 'tool_start') {
|
|
150
|
+
sawToolCall = true;
|
|
151
|
+
if (!toolNames.includes(ev.toolName))
|
|
152
|
+
toolNames.push(ev.toolName);
|
|
153
|
+
}
|
|
154
|
+
else if (ev.type === 'tool_end') {
|
|
155
|
+
sawToolCall = true;
|
|
156
|
+
if (!toolNames.includes(ev.toolName))
|
|
157
|
+
toolNames.push(ev.toolName);
|
|
158
|
+
if (ev.ok)
|
|
159
|
+
toolOkCount++;
|
|
160
|
+
else
|
|
161
|
+
toolFailCount++;
|
|
162
|
+
}
|
|
163
|
+
if (opts.suppressTurnDone && ev.type === 'turn_done')
|
|
164
|
+
continue;
|
|
165
|
+
yield ev;
|
|
166
|
+
}
|
|
167
|
+
// 从 history 提取本步产生的最后一条非空 assistant 消息。
|
|
168
|
+
// 经 stripThinkBlocks 净化:最后一条若是纯 <think> 块(模型收尾只剩思考),
|
|
169
|
+
// 继续向前回退到真正有内容的消息——capture/补充要求拿到的必须是交付文本。
|
|
170
|
+
let rawText = '';
|
|
171
|
+
for (let i = activeHistory.length - 1; i >= historyLenBefore; i--) {
|
|
172
|
+
const msg = activeHistory[i];
|
|
173
|
+
if (msg.role === 'assistant' && typeof msg.content === 'string') {
|
|
174
|
+
const cleaned = stripThinkBlocks(msg.content);
|
|
175
|
+
if (cleaned) {
|
|
176
|
+
rawText = cleaned;
|
|
177
|
+
break;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return {
|
|
182
|
+
rawText,
|
|
183
|
+
sawToolCall,
|
|
184
|
+
toolNames,
|
|
185
|
+
toolOkCount,
|
|
186
|
+
toolFailCount,
|
|
187
|
+
aborted,
|
|
188
|
+
sawLlmError,
|
|
189
|
+
sawMaxTurns,
|
|
190
|
+
llmErrorDetail,
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
/** maxTurns 截断失败文案的稳定标记(producer/detector 同源,防 runner 侧 delay 判定漂移)。 */
|
|
194
|
+
export const MAX_TURNS_CUTOFF_MARKER = '达到最大轮数';
|
|
195
|
+
/** maxTurns 截断的可重试失败文案(重试 = 在共享 history 上续作,再给一份轮数预算)。 */
|
|
196
|
+
export function describeMaxTurnsCutoff(stepId, maxTurns) {
|
|
197
|
+
return `step ${stepId}: ${MAX_TURNS_CUTOFF_MARKER} ${maxTurns} 被截断(可续跑)`;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* 该错误是否是 maxTurns 截断(续作语义)。runner 的 in-run retry 用它区分延时:
|
|
201
|
+
* maxTurns 截断默认立即续作,不套用普通 retry_delay_ms;长文档/PPT 类工作流
|
|
202
|
+
* 可显式配置 max_turns_retry_delay_ms 给截断续作增加等待窗口。
|
|
203
|
+
*/
|
|
204
|
+
export function isMaxTurnsCutoff(errMsg) {
|
|
205
|
+
return errMsg.includes(MAX_TURNS_CUTOFF_MARKER) && errMsg.includes('被截断');
|
|
206
|
+
}
|
|
65
207
|
/**
|
|
66
208
|
* 解析非 schema 模式下 agent 最终文本里的放弃标记。
|
|
67
|
-
* - 命中
|
|
209
|
+
* - 命中 GIVEUP_MARKER → 返回原因字符串(可能为空串)
|
|
68
210
|
* - 未命中 → null(视为给出了真实结果)
|
|
211
|
+
*
|
|
212
|
+
* 注意:旧标记 __AGENT_GIVEUP__ 也兼容检测(向后兼容已存在的 checkpoint/状态数据),
|
|
213
|
+
* 但新代码只使用新标记格式。
|
|
69
214
|
*/
|
|
215
|
+
const LEGACY_GIVEUP_MARKER = '__AGENT_GIVEUP__';
|
|
70
216
|
export function parseGiveup(text) {
|
|
71
|
-
|
|
217
|
+
// 优先检测新标记
|
|
218
|
+
const newIdx = text.indexOf(GIVEUP_MARKER);
|
|
219
|
+
const legacyIdx = text.indexOf(LEGACY_GIVEUP_MARKER);
|
|
220
|
+
// 取先出现的那一个
|
|
221
|
+
let idx = -1;
|
|
222
|
+
let markerLen = 0;
|
|
223
|
+
if (newIdx !== -1 && (legacyIdx === -1 || newIdx < legacyIdx)) {
|
|
224
|
+
idx = newIdx;
|
|
225
|
+
markerLen = GIVEUP_MARKER.length;
|
|
226
|
+
}
|
|
227
|
+
else if (legacyIdx !== -1) {
|
|
228
|
+
idx = legacyIdx;
|
|
229
|
+
markerLen = LEGACY_GIVEUP_MARKER.length;
|
|
230
|
+
}
|
|
72
231
|
if (idx === -1)
|
|
73
232
|
return null;
|
|
74
233
|
return text
|
|
75
|
-
.slice(idx +
|
|
76
|
-
.replace(/^[::\s]+/, '')
|
|
234
|
+
.slice(idx + markerLen)
|
|
235
|
+
.replace(/^[::\s\]]+/, '') // 兼容新旧标记后的分隔符(: / : / ])
|
|
77
236
|
.trim();
|
|
78
237
|
}
|
|
238
|
+
/** 判断一个 giveup reason 是否看起来像"误报"(实际是 LLM 在正常输出中碰巧触发了标记)。
|
|
239
|
+
*
|
|
240
|
+
* 启发式规则:
|
|
241
|
+
* - reason 长度 > 80 字符 → 几乎可以确定是误报(真正的放弃原因通常简短)
|
|
242
|
+
* - reason 包含结构化内容(如 ## 标题、### 章节、列表项等)→ 误报
|
|
243
|
+
*/
|
|
244
|
+
function isLikelyFalsePositive(reason) {
|
|
245
|
+
if (reason.length > 80)
|
|
246
|
+
return true;
|
|
247
|
+
// 如果 reason 看起来像 markdown 正文(标题/章节),也是误报
|
|
248
|
+
if (/^#{1,6}\s/m.test(reason) || /^[-*+]\s/m.test(reason) || /^\d+\.\s/m.test(reason)) {
|
|
249
|
+
return true;
|
|
250
|
+
}
|
|
251
|
+
return false;
|
|
252
|
+
}
|
|
79
253
|
/**
|
|
80
|
-
* 验证闸门:把
|
|
81
|
-
* - schema 模式:
|
|
254
|
+
* 验证闸门:把 StepResult 判定为「真交付」或「放弃/不可信」。
|
|
255
|
+
* - schema 模式:extractJsonPayload 已严格解析(解析失败会抛、落不到这里),能拿到结果即 ok;
|
|
82
256
|
* 补 content 别名不覆盖具名字段。
|
|
83
257
|
* - 非 schema 模式:空产出 / 命中 GIVEUP 标记 → ok:false;否则 ok:true,raw 补 text/result/content
|
|
84
258
|
* 三键别名,兼容 capture:{content:x}/{result:x}/{text:x}。
|
|
85
|
-
*
|
|
86
|
-
*
|
|
259
|
+
*
|
|
260
|
+
* v0.9.3 增强:GIVEUP 检测增加误报过滤(isLikelyFalsePositive)。
|
|
261
|
+
* 当标记后的内容看起来像是实质性的工作产出而非简短放弃理由时,
|
|
262
|
+
* 视为 LLM 误触发标记 → 仍然当作成功交付处理。
|
|
87
263
|
*/
|
|
88
264
|
export function interpretMiniReActResult(result, hasSchema) {
|
|
89
265
|
if (hasSchema) {
|
|
@@ -100,6 +276,28 @@ export function interpretMiniReActResult(result, hasSchema) {
|
|
|
100
276
|
}
|
|
101
277
|
const giveup = parseGiveup(trimmed);
|
|
102
278
|
if (giveup !== null) {
|
|
279
|
+
// v0.9.3: 误报过滤 —— 如果 "放弃原因" 太长或太结构化,
|
|
280
|
+
// 说明 LLM 是在正常输出中碰巧触发了标记,不应判为放弃
|
|
281
|
+
if (isLikelyFalsePositive(giveup)) {
|
|
282
|
+
// 降级为成功交付:去掉误触发的标记部分(replaceAll:标记可能被 LLM
|
|
283
|
+
// 误触发多次,replace 只删首个会让残留标记流进 capture 污染下游)
|
|
284
|
+
const cleanText = trimmed
|
|
285
|
+
.replaceAll(GIVEUP_MARKER, '')
|
|
286
|
+
.replaceAll(LEGACY_GIVEUP_MARKER, '')
|
|
287
|
+
.trim();
|
|
288
|
+
const raw = {
|
|
289
|
+
text: cleanText,
|
|
290
|
+
result: cleanText,
|
|
291
|
+
content: cleanText,
|
|
292
|
+
};
|
|
293
|
+
return {
|
|
294
|
+
ok: true,
|
|
295
|
+
value: {
|
|
296
|
+
raw,
|
|
297
|
+
preview: cleanText.length > 200 ? `${cleanText.slice(0, 200)}…` : cleanText,
|
|
298
|
+
},
|
|
299
|
+
};
|
|
300
|
+
}
|
|
103
301
|
return { ok: false, reason: giveup || '显式放弃(未给原因)' };
|
|
104
302
|
}
|
|
105
303
|
const raw = {
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { ACTION_KINDS, CONTROL_FLOW_TYPES, ON_ERROR_VALUES, VALID_STEP_TYPES } from './loader.js';
|
|
2
|
+
const llmAgentOnly = ['llm', 'agent'];
|
|
3
|
+
const llmAgentSkillOnly = ['llm', 'agent', 'skill'];
|
|
4
|
+
export const WORKFLOW_DSL_MANIFEST = {
|
|
5
|
+
version: '1.0.0',
|
|
6
|
+
actionKinds: [...ACTION_KINDS],
|
|
7
|
+
controlFlowTypes: [...CONTROL_FLOW_TYPES],
|
|
8
|
+
validStepTypes: [...VALID_STEP_TYPES],
|
|
9
|
+
onErrorValues: [...ON_ERROR_VALUES],
|
|
10
|
+
exclusiveActionFields: [...ACTION_KINDS, 'type'],
|
|
11
|
+
stepKinds: [
|
|
12
|
+
{ kind: 'tool', group: 'action', label: 'Tool', description: 'Call one deterministic tool.', primaryFields: ['tool', 'args'] },
|
|
13
|
+
{ kind: 'llm', group: 'action', label: 'LLM', description: 'Single LLM step.', primaryFields: ['llm', 'output_schema', 'context_files', 'allowed_tools'] },
|
|
14
|
+
{ kind: 'skill', group: 'action', label: 'Skill', description: 'Run one SKILL.md workflow agent.', primaryFields: ['skill', 'input', 'maxTurns'] },
|
|
15
|
+
{ kind: 'agent', group: 'action', label: 'Agent', description: 'Run an inline bounded TAOR agent.', primaryFields: ['agent', 'maxTurns', 'done_when', 'output_schema', 'context_files', 'allowed_tools'] },
|
|
16
|
+
{ kind: 'assert', group: 'quality', label: 'Assert', description: 'Halt when a condition is false.', primaryFields: ['condition', 'onFail'] },
|
|
17
|
+
{ kind: 'verify', group: 'quality', label: 'Verify', description: 'Run deterministic checks before continuing.', primaryFields: ['checks', 'onFail'] },
|
|
18
|
+
{ kind: 'set', group: 'control', label: 'Set', description: 'Set workflow variables deterministically.', primaryFields: ['set'] },
|
|
19
|
+
{ kind: 'branch', group: 'control', label: 'Branch', description: 'Route into then/else child steps.', primaryFields: ['condition'], childCollections: ['then', 'else'] },
|
|
20
|
+
{ kind: 'loop', group: 'control', label: 'Loop', description: 'For-each or bounded while loop.', primaryFields: ['over', 'as', 'max_iterations', 'fresh_context'], childCollections: ['do'] },
|
|
21
|
+
{ kind: 'break', group: 'control', label: 'Break', description: 'Exit the nearest (or target) loop.', primaryFields: ['when', 'target'] },
|
|
22
|
+
{ kind: 'continue', group: 'control', label: 'Continue', description: 'Skip to the next iteration of the nearest (or target) loop.', primaryFields: ['when', 'target'] },
|
|
23
|
+
{ kind: 'echo', group: 'control', label: 'Echo', description: 'Deterministically print an interpolated message (no LLM).', primaryFields: ['message'] },
|
|
24
|
+
{ kind: 'pause', group: 'control', label: 'Pause', description: 'Human approval gate.', primaryFields: ['prompt', 'free_text'] },
|
|
25
|
+
],
|
|
26
|
+
commonStepFields: [
|
|
27
|
+
{ name: 'id', type: 'string', ui: 'text', required: true, label: 'id' },
|
|
28
|
+
{ name: 'title', type: 'string', ui: 'text', label: 'title', description: 'Human-readable progress label (supports ${} interpolation); when set, the status line shows it instead of block-relative step numbers.' },
|
|
29
|
+
{ name: 'when', type: 'string', ui: 'text', label: 'when', description: 'Optional execution condition.' },
|
|
30
|
+
{ name: 'onError', type: 'enum', ui: 'select', enum: [...ON_ERROR_VALUES], label: 'onError' },
|
|
31
|
+
{ name: 'recover_hint', type: 'string', ui: 'text', label: 'recover_hint', description: 'Hint for onError=recover.' },
|
|
32
|
+
],
|
|
33
|
+
stepFields: [
|
|
34
|
+
{ name: 'tool', type: 'string', ui: 'text', appliesTo: ['tool'] },
|
|
35
|
+
{ name: 'args', type: 'object', ui: 'json', appliesTo: ['tool'] },
|
|
36
|
+
{ name: 'llm', type: 'string', ui: 'textarea', appliesTo: ['llm'] },
|
|
37
|
+
{ name: 'skill', type: 'string', ui: 'text', appliesTo: ['skill'] },
|
|
38
|
+
{ name: 'agent', type: 'string', ui: 'textarea', appliesTo: ['agent'] },
|
|
39
|
+
{ name: 'input', type: 'string', ui: 'textarea', appliesTo: ['skill'] },
|
|
40
|
+
{ name: 'capture', type: 'object', ui: 'json' },
|
|
41
|
+
{ name: 'maxTurns', type: 'number', ui: 'number', appliesTo: ['llm', 'skill', 'agent'] },
|
|
42
|
+
{ name: 'max_retries', type: 'number', ui: 'number' },
|
|
43
|
+
{ name: 'artifacts', type: 'string[]', ui: 'string[]' },
|
|
44
|
+
{ name: 'condition', type: 'string', ui: 'text', appliesTo: ['assert', 'branch'] },
|
|
45
|
+
{ name: 'onFail', type: 'string', ui: 'textarea', appliesTo: ['assert', 'verify'] },
|
|
46
|
+
{ name: 'set', type: 'object', ui: 'json', required: true, appliesTo: ['set'] },
|
|
47
|
+
{ name: 'checks', type: 'string[]', ui: 'string[]', required: true, appliesTo: ['verify'] },
|
|
48
|
+
{ name: 'over', type: 'string', ui: 'text', appliesTo: ['loop'] },
|
|
49
|
+
{ name: 'as', type: 'string', ui: 'text', appliesTo: ['loop'] },
|
|
50
|
+
{ name: 'max_iterations', type: 'number', ui: 'number', appliesTo: ['loop'] },
|
|
51
|
+
{ name: 'fresh_context', type: 'boolean', ui: 'boolean', appliesTo: ['loop'] },
|
|
52
|
+
{ name: 'prompt', type: 'string', ui: 'textarea', appliesTo: ['pause'] },
|
|
53
|
+
{ name: 'free_text', type: 'enum', ui: 'select', enum: ['halt', 'approve'], appliesTo: ['pause'] },
|
|
54
|
+
{ name: 'target', type: 'string', ui: 'text', appliesTo: ['break', 'continue'], description: 'Target loop id (label semantics; default = nearest loop).' },
|
|
55
|
+
{ name: 'message', type: 'string', ui: 'textarea', required: true, appliesTo: ['echo'] },
|
|
56
|
+
{ name: 'goal_supplement', type: 'boolean', ui: 'boolean', appliesTo: ['tool', 'skill', 'agent', 'llm', 'pause'], description: 'Append this step output to the goal anchor as a user supplement.' },
|
|
57
|
+
{ name: 'done_when', type: 'string', ui: 'text', appliesTo: ['agent'], description: 'Deterministic completion condition (whitelist expression, e.g. fileExists(...)); engine nudges the agent to keep working until it holds.' },
|
|
58
|
+
{ name: 'output_schema', type: 'object', ui: 'json', appliesTo: llmAgentOnly },
|
|
59
|
+
{ name: 'context_files', type: 'object[]', ui: 'object[]', appliesTo: llmAgentOnly },
|
|
60
|
+
{ name: 'allowed_tools', type: 'string[]', ui: 'string[]', appliesTo: llmAgentOnly },
|
|
61
|
+
{ name: 'history_mode', type: 'enum', ui: 'select', enum: ['shared', 'isolated'], appliesTo: llmAgentSkillOnly, description: 'Use shared workflow history or run this llm/agent/skill step in an isolated history (system prompt + current step only).' },
|
|
62
|
+
// 多模态(视觉):仅 llm/agent 生效。images 喂图给模型识图/打分(如 illustrate 配图工作流)。
|
|
63
|
+
{ name: 'images', type: 'array', ui: 'json', appliesTo: llmAgentOnly, description: 'Multimodal image inputs (paths/URLs, supports ${} interpolation). Array of strings or { source, detail, max_long_side_pixel }.' },
|
|
64
|
+
{ name: 'image_detail', type: 'enum', ui: 'select', enum: ['low', 'high', 'auto'], appliesTo: llmAgentOnly, description: 'Default vision detail for this step (per-image override allowed inside images[]).' },
|
|
65
|
+
{ name: 'image_max_long_side_pixel', type: 'number', ui: 'number', appliesTo: llmAgentOnly, description: 'Default max long-side pixels for downscaling images before sending.' },
|
|
66
|
+
{ name: 'parse_inline_images', type: 'boolean', ui: 'boolean', appliesTo: llmAgentOnly, description: 'Parse @./img.png or image URLs found in the prompt text.' },
|
|
67
|
+
],
|
|
68
|
+
workflowFields: [
|
|
69
|
+
{ name: 'artifacts', type: 'string[]', ui: 'string[]', label: 'workflow artifacts' },
|
|
70
|
+
{ name: 'self_heal', type: 'object', ui: 'json', label: 'self_heal' },
|
|
71
|
+
],
|
|
72
|
+
};
|