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/ui/liveViewport.js
CHANGED
|
@@ -63,7 +63,11 @@ export function charWidth(cp) {
|
|
|
63
63
|
return 2;
|
|
64
64
|
}
|
|
65
65
|
// Emoji / 符号 / dingbat:终端普遍全角渲染(含 💭 与 spinner ✶✷✸✹✺)。上界=2,算宽无害。
|
|
66
|
-
|
|
66
|
+
// 0x2300/0x2500 两段是蜂群树引入的 ⎿ ├ └ │ ─(figures.ts)——ambiguous-width,
|
|
67
|
+
// CJK 终端可能按全角渲染,按「宁宽不窄」哲学一并按 2 计(INV-1 记账依赖此上界)。
|
|
68
|
+
if ((cp >= 0x2300 && cp <= 0x23ff) || // Misc Technical(含 ⎿ U+23BF)
|
|
69
|
+
(cp >= 0x2500 && cp <= 0x25ff) || // Box Drawing / Block Elements / Geometric(├ └ │ ─ ▾ ▶)
|
|
70
|
+
(cp >= 0x2600 && cp <= 0x27bf) || // Misc Symbols + Dingbats(含 ✶✷✸✹✺)
|
|
67
71
|
(cp >= 0x2b00 && cp <= 0x2bff) || // Misc Symbols and Arrows
|
|
68
72
|
(cp >= 0xfe00 && cp <= 0xfe0f) || // Variation Selectors(VS16 强制全角)
|
|
69
73
|
(cp >= 0x1f000 && cp <= 0x1faff) // Emoji 主区(含 💭)
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ============================================================
|
|
3
|
+
* src/ui/markdown.ts —— assistant 最终答案的 markdown → 终端展示行
|
|
4
|
+
* ------------------------------------------------------------
|
|
5
|
+
* 借鉴 Claude Code 的管线(marked lexer 分词 + 自研 token→ANSI 格式化),
|
|
6
|
+
* 按 minimal-agent 减法原则收敛。核心裁决:
|
|
7
|
+
*
|
|
8
|
+
* ★ 代码块「零装饰」(复制即用的全部保障):
|
|
9
|
+
* `code` token 的每一行 = 原文逐字节输出——无边框、无背景、无缩进、无前缀、
|
|
10
|
+
* 不按宽度重排;渲染层配 wrap='end'(Ink 原样输出,不注入换行),超宽交给
|
|
11
|
+
* 终端软换行(现代终端复制时还原为整行)。任何"美化"都会污染复制。
|
|
12
|
+
*
|
|
13
|
+
* ★ 删除线主动禁用:模型常用 ~xxx~ 表示"约等于",渲染成删除线是灾难
|
|
14
|
+
* (捐赠方同款裁决),del token 原样输出 raw。
|
|
15
|
+
*
|
|
16
|
+
* ★ 只在 <Static> commit 时调用(write-once,每条消息一生解析一次,
|
|
17
|
+
* <1ms 无重解析压力);live 流式区不跑 markdown。
|
|
18
|
+
*
|
|
19
|
+
* 已知取舍:
|
|
20
|
+
* - dim 与 bold 的 SGR 关闭码同为 22,嵌套会提前关闭外层——本文件不在
|
|
21
|
+
* bold 内嵌 dim(捐赠方同样接受此约束)。
|
|
22
|
+
* - 超过终端宽度的 code 行交终端软换行显示(视觉上折行、复制仍是整行);
|
|
23
|
+
* TODO:后续可为超宽 code 提供 /show 式展开。
|
|
24
|
+
* - 表格第一期不做 flexbox 对齐,token.raw 原样透传(终端裸文本可读);
|
|
25
|
+
* TODO:需要时参照捐赠方 MarkdownTable 组件。
|
|
26
|
+
* ============================================================
|
|
27
|
+
*/
|
|
28
|
+
import { lexer } from 'marked';
|
|
29
|
+
import { figures } from './figures.js';
|
|
30
|
+
// ---------------- ANSI 内联样式(手写 SGR,不引 chalk) ----------------
|
|
31
|
+
// Ink 的 Text 渲染管线(wrap-ansi / cli-truncate)是 ANSI-aware 的,
|
|
32
|
+
// 字符串内嵌 SGR 与 wrap='end' 兼容(捐赠方同款做法)。
|
|
33
|
+
const sgr = (open, close) => (s) => `\x1b[${open}m${s}\x1b[${close}m`;
|
|
34
|
+
const bold = sgr(1, 22);
|
|
35
|
+
const italic = sgr(3, 23);
|
|
36
|
+
const underline = sgr(4, 24);
|
|
37
|
+
const dim = sgr(2, 22);
|
|
38
|
+
const cyan = sgr(36, 39);
|
|
39
|
+
/**
|
|
40
|
+
* 快判:文本里没有任何 markdown 语法特征 → 跳过 lexer,直接按 \n 切 prose
|
|
41
|
+
* (旧行为快路径;也避免纯中文叙述被 lexer 意外重排)。
|
|
42
|
+
*/
|
|
43
|
+
export function looksLikeMarkdown(text) {
|
|
44
|
+
return (/(^|\n)\s{0,3}(#{1,6}\s|```|>\s|[-*+]\s|\d+\.\s|(-{3,}|\*{3,})\s*(\n|$))/.test(text) || // 块级:标题/围栏/引用/列表/hr
|
|
45
|
+
/`[^`\n]+`|\*\*[^*\n]+\*\*|\[[^\]\n]+\]\([^)\n]+\)/.test(text) // 行内:codespan/加粗/链接
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* marked tokenizer 对 codespan/escape/text 做 HTML 实体转义
|
|
50
|
+
* (`a && b` → 'a && b')——终端不是 HTML,必须还原。
|
|
51
|
+
* 注意 & 最后替换(否则 &lt; 会被二次解码)。
|
|
52
|
+
*/
|
|
53
|
+
export function unescapeEntities(text) {
|
|
54
|
+
return text
|
|
55
|
+
.replace(/</g, '<')
|
|
56
|
+
.replace(/>/g, '>')
|
|
57
|
+
.replace(/"/g, '"')
|
|
58
|
+
.replace(/'/g, "'")
|
|
59
|
+
.replace(/&/g, '&');
|
|
60
|
+
}
|
|
61
|
+
/** 行内 tokens → 单条含 ANSI 的字符串。 */
|
|
62
|
+
export function formatInlineTokens(tokens) {
|
|
63
|
+
let out = '';
|
|
64
|
+
for (const token of tokens) {
|
|
65
|
+
switch (token.type) {
|
|
66
|
+
case 'strong':
|
|
67
|
+
out += bold(formatInlineTokens(token.tokens));
|
|
68
|
+
break;
|
|
69
|
+
case 'em':
|
|
70
|
+
out += italic(formatInlineTokens(token.tokens));
|
|
71
|
+
break;
|
|
72
|
+
case 'codespan':
|
|
73
|
+
out += cyan(unescapeEntities(token.text));
|
|
74
|
+
break;
|
|
75
|
+
case 'del':
|
|
76
|
+
// 删除线禁用:~xxx~ 常是"约等于",原样输出
|
|
77
|
+
out += token.raw;
|
|
78
|
+
break;
|
|
79
|
+
case 'link': {
|
|
80
|
+
const link = token;
|
|
81
|
+
const label = link.tokens ? formatInlineTokens(link.tokens) : link.text;
|
|
82
|
+
out += label === link.href ? label : `${label} ${dim(`(${link.href})`)}`;
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
case 'image':
|
|
86
|
+
out += `[图: ${token.text}]`;
|
|
87
|
+
break;
|
|
88
|
+
case 'br':
|
|
89
|
+
out += '\n';
|
|
90
|
+
break;
|
|
91
|
+
case 'escape':
|
|
92
|
+
out += unescapeEntities(token.text);
|
|
93
|
+
break;
|
|
94
|
+
case 'text': {
|
|
95
|
+
const t = token;
|
|
96
|
+
out += t.tokens ? formatInlineTokens(t.tokens) : unescapeEntities(t.text);
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
default:
|
|
100
|
+
out += 'raw' in token ? token.raw : '';
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return out;
|
|
105
|
+
}
|
|
106
|
+
/** 把(可能含 ANSI 的)多行字符串切成 prose 行。 */
|
|
107
|
+
function proseLines(text) {
|
|
108
|
+
return text.split('\n').map((line) => ({ text: line, kind: 'prose' }));
|
|
109
|
+
}
|
|
110
|
+
/** 单个块级 token → 展示行(导出供单测逐 token 断言)。 */
|
|
111
|
+
export function formatBlockToken(token) {
|
|
112
|
+
switch (token.type) {
|
|
113
|
+
case 'code': {
|
|
114
|
+
// ★ 复制安全核心路径:代码行 = token.text 逐字节,围栏行单独标 kind
|
|
115
|
+
const code = token;
|
|
116
|
+
return [
|
|
117
|
+
{ text: `\`\`\`${code.lang ?? ''}`, kind: 'fence' },
|
|
118
|
+
...code.text.split('\n').map((line) => ({ text: line, kind: 'code' })),
|
|
119
|
+
{ text: '```', kind: 'fence' },
|
|
120
|
+
];
|
|
121
|
+
}
|
|
122
|
+
case 'heading': {
|
|
123
|
+
const heading = token;
|
|
124
|
+
const inner = formatInlineTokens(heading.tokens);
|
|
125
|
+
return [{ text: heading.depth === 1 ? bold(underline(inner)) : bold(inner), kind: 'prose' }];
|
|
126
|
+
}
|
|
127
|
+
case 'paragraph':
|
|
128
|
+
return proseLines(formatInlineTokens(token.tokens));
|
|
129
|
+
case 'list': {
|
|
130
|
+
const list = token;
|
|
131
|
+
const lines = [];
|
|
132
|
+
const start = typeof list.start === 'number' ? list.start : 1;
|
|
133
|
+
list.items.forEach((item, i) => {
|
|
134
|
+
const bullet = list.ordered ? `${start + i}. ` : '- ';
|
|
135
|
+
const pad = ' '.repeat(bullet.length);
|
|
136
|
+
let firstLineDone = false;
|
|
137
|
+
for (const sub of item.tokens) {
|
|
138
|
+
if (sub.type === 'code') {
|
|
139
|
+
// 列表内代码块:零装饰优先于列表对齐(不缩进,保住复制安全)
|
|
140
|
+
lines.push(...formatBlockToken(sub));
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
if (sub.type === 'list') {
|
|
144
|
+
// 嵌套列表:整体缩进对齐父 bullet(不走 firstLine 逻辑,避免双重缩进)
|
|
145
|
+
lines.push(...formatBlockToken(sub).map((l) => l.kind === 'prose' ? { ...l, text: `${pad}${l.text}` } : l));
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
const subLines = proseLines(sub.type === 'text' || sub.type === 'paragraph'
|
|
149
|
+
? formatInlineTokens(sub.tokens ?? [sub])
|
|
150
|
+
: 'raw' in sub
|
|
151
|
+
? sub.raw
|
|
152
|
+
: '');
|
|
153
|
+
for (const l of subLines) {
|
|
154
|
+
if (l.kind !== 'prose') {
|
|
155
|
+
lines.push(l);
|
|
156
|
+
}
|
|
157
|
+
else if (!firstLineDone) {
|
|
158
|
+
lines.push({ text: `${bullet}${l.text}`, kind: 'prose' });
|
|
159
|
+
firstLineDone = true;
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
lines.push({ text: `${pad}${l.text}`, kind: 'prose' });
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
if (!firstLineDone)
|
|
167
|
+
lines.push({ text: bullet.trimEnd(), kind: 'prose' });
|
|
168
|
+
});
|
|
169
|
+
return lines;
|
|
170
|
+
}
|
|
171
|
+
case 'blockquote': {
|
|
172
|
+
const quote = token;
|
|
173
|
+
const inner = quote.tokens.flatMap(formatBlockToken);
|
|
174
|
+
// 引用竖条只加在 prose 行;引用内代码块保持零装饰
|
|
175
|
+
return inner.map((l) => l.kind === 'prose' ? { ...l, text: `${dim(`${figures.quote} `)}${l.text}` } : l);
|
|
176
|
+
}
|
|
177
|
+
case 'space':
|
|
178
|
+
return [{ text: '', kind: 'prose' }];
|
|
179
|
+
case 'hr':
|
|
180
|
+
return [{ text: dim(figures.hr.repeat(20)), kind: 'prose' }];
|
|
181
|
+
case 'table':
|
|
182
|
+
// TODO:flexbox 对齐表格(捐赠方 MarkdownTable 模式);第一期原样透传
|
|
183
|
+
return proseLines(token.raw.trimEnd());
|
|
184
|
+
default:
|
|
185
|
+
return 'raw' in token
|
|
186
|
+
? proseLines(token.raw.replace(/\n+$/, ''))
|
|
187
|
+
: [];
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* 主入口:assistant 正文 → 展示行。
|
|
192
|
+
* 纯文本走快路径(与旧渲染逐行一致);lexer 意外抛错时兜底回退原文
|
|
193
|
+
* (模型输出任意性防御——格式化是锦上添花,绝不能让渲染崩掉消息)。
|
|
194
|
+
*/
|
|
195
|
+
export function renderMarkdownLines(src) {
|
|
196
|
+
if (src.length === 0)
|
|
197
|
+
return [];
|
|
198
|
+
if (!looksLikeMarkdown(src))
|
|
199
|
+
return proseLines(src);
|
|
200
|
+
try {
|
|
201
|
+
return lexer(src).flatMap(formatBlockToken);
|
|
202
|
+
}
|
|
203
|
+
catch {
|
|
204
|
+
return proseLines(src);
|
|
205
|
+
}
|
|
206
|
+
}
|
package/src/ui/textBuffer.js
CHANGED
|
@@ -79,13 +79,6 @@ export function bufDeleteBefore(s) {
|
|
|
79
79
|
cps.splice(s.cursor - 1, 1);
|
|
80
80
|
return { text: fromCps(cps), cursor: s.cursor - 1 };
|
|
81
81
|
}
|
|
82
|
-
export function bufDeleteAt(s) {
|
|
83
|
-
const cps = toCps(s.text);
|
|
84
|
-
if (s.cursor >= cps.length)
|
|
85
|
-
return s;
|
|
86
|
-
cps.splice(s.cursor, 1);
|
|
87
|
-
return { text: fromCps(cps), cursor: s.cursor };
|
|
88
|
-
}
|
|
89
82
|
/**
|
|
90
83
|
* Ctrl+W / M-DEL:先吃光标左侧的非词字符(空格 / 标点),再吃前一个词。
|
|
91
84
|
* 例:光标贴在 "world" 后 → 删 'world',留 "hello "。
|
package/src/ui/theme.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ============================================================
|
|
3
|
+
* src/ui/theme.ts —— TUI 语义色板(单一出处)
|
|
4
|
+
* ------------------------------------------------------------
|
|
5
|
+
* 借鉴 Claude Code 的语义化主题键思想(utils/theme.ts),按 minimal-agent
|
|
6
|
+
* 减法原则收敛为 7 个键:组件里写"这段文字是什么角色"(theme.subtle),
|
|
7
|
+
* 不写"这段文字是什么颜色"('gray')——改配色只动这一个文件。
|
|
8
|
+
*
|
|
9
|
+
* 值是 Ink <Text color=...> 的合法取值;undefined = 终端默认前景色。
|
|
10
|
+
* 事实调色板(与重构前完全一致,机械替换零行为变化):
|
|
11
|
+
* - 层次靠三级区分:subtle+dimColor(次要:思维链/工具/进度)
|
|
12
|
+
* ↔ answer 默认亮色(主角:最终答案)↔ user/plugin bold(状态行)。
|
|
13
|
+
* ============================================================
|
|
14
|
+
*/
|
|
15
|
+
export const theme = {
|
|
16
|
+
/** 用户输入 / banner / 状态行 spinner / 输入框边框 */
|
|
17
|
+
user: 'cyan',
|
|
18
|
+
/** 最终答案正文 —— undefined = 终端默认亮色(答案是主角,不染色) */
|
|
19
|
+
answer: undefined,
|
|
20
|
+
/** ⏺ 答案锚点(配 bold) */
|
|
21
|
+
anchor: 'green',
|
|
22
|
+
/** 次要信息:思维链 / 工具结果 / turn 横线 / live 过程区(配 dimColor) */
|
|
23
|
+
subtle: 'gray',
|
|
24
|
+
/** 暂态提示 / tool_calls 摘要 / 中断提示 */
|
|
25
|
+
warning: 'yellow',
|
|
26
|
+
/** 永久错误 */
|
|
27
|
+
error: 'red',
|
|
28
|
+
/** 健康/正常状态(StatusLine 用量比率等) */
|
|
29
|
+
ok: 'green',
|
|
30
|
+
/** compacting 状态 / 插件进度 / reverse-search */
|
|
31
|
+
plugin: 'magenta',
|
|
32
|
+
};
|
package/src/utils/debugLog.js
CHANGED
|
@@ -18,10 +18,6 @@
|
|
|
18
18
|
*/
|
|
19
19
|
import { appendFileSync } from 'node:fs';
|
|
20
20
|
const LOG_PATH = process.env.MINIMAL_AGENT_DEBUG_LOG;
|
|
21
|
-
/** 调试日志是否开启(供调用方决定要不要算开销较大的 data)。 */
|
|
22
|
-
export function isDebugLogOn() {
|
|
23
|
-
return !!LOG_PATH;
|
|
24
|
-
}
|
|
25
21
|
/**
|
|
26
22
|
* 追加一行调试日志:`<ISO 时间> [tag] msg {data}`。
|
|
27
23
|
* 未开启(无 MINIMAL_AGENT_DEBUG_LOG)时立即返回。
|
|
@@ -30,9 +30,9 @@ import { findPackageRoot } from './packageRoot.js';
|
|
|
30
30
|
* @param metaUrl 调用方 import.meta.url(用于定位 packageRoot)
|
|
31
31
|
* @returns 存在的搜索路径数组;都不存在则返回空数组
|
|
32
32
|
*/
|
|
33
|
-
export function getResourceSearchPaths(name, metaUrl) {
|
|
33
|
+
export function getResourceSearchPaths(name, metaUrl, workingDir = getWorkingDir()) {
|
|
34
34
|
const paths = [];
|
|
35
|
-
const cwdPath = resolve(join(
|
|
35
|
+
const cwdPath = resolve(join(workingDir, name));
|
|
36
36
|
if (existsSync(cwdPath)) {
|
|
37
37
|
paths.push(cwdPath);
|
|
38
38
|
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ============================================================
|
|
3
|
+
* src/utils/stripThink.ts —— 剥离模型直出的 <think> 思维链块
|
|
4
|
+
* ------------------------------------------------------------
|
|
5
|
+
* 自 plugins/workflow-runner/src/agentCommon.ts 迁入内核:Agent 子任务工具
|
|
6
|
+
* (src/tools/agent/)提取子 agent 报告时同样需要净化,而内核不能 import
|
|
7
|
+
* 插件(三层解耦红线),故共享件上移、插件侧改经 plugin-sdk re-export。
|
|
8
|
+
* ============================================================
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* 展示层切分:把 content 里模型直出的 <think> 段与正文分离。
|
|
12
|
+
* MessageList 用它把内联思维链并入 💭 块(gray dim 折叠展示),正文只显示
|
|
13
|
+
* 净化后的部分——**纯函数不 mutate 入参,history 字节零改动**(KV 缓存约束:
|
|
14
|
+
* 内核有意在 client.ts 保留内联 think 进 content,展示层各取所需)。
|
|
15
|
+
* - 闭合块(可多个、跨行、大小写不敏感)→ 依序拼进 thought
|
|
16
|
+
* - 剥完仍以未闭合 <think> 开头 → 余下全部视为 thought,answer=''
|
|
17
|
+
* - 无 <think> → { thought: '', answer: text }(answer 与原文逐字节相同,
|
|
18
|
+
* 快路径:调用方可据此走旧渲染逻辑)
|
|
19
|
+
*/
|
|
20
|
+
export function splitThinkBlocks(text) {
|
|
21
|
+
if (!/<think>/i.test(text))
|
|
22
|
+
return { thought: '', answer: text };
|
|
23
|
+
const thoughts = [];
|
|
24
|
+
const answer = text.replace(/<think>([\s\S]*?)<\/think>/gi, (_m, inner) => {
|
|
25
|
+
const t = inner.trim();
|
|
26
|
+
if (t)
|
|
27
|
+
thoughts.push(t);
|
|
28
|
+
return '';
|
|
29
|
+
});
|
|
30
|
+
// 剥完闭合块后仍以未闭合 <think> 开头 → 余下整段都是思考
|
|
31
|
+
const unclosed = /^\s*<think>/i.exec(answer);
|
|
32
|
+
if (unclosed) {
|
|
33
|
+
const rest = answer.replace(/^\s*<think>/i, '').trim();
|
|
34
|
+
if (rest)
|
|
35
|
+
thoughts.push(rest);
|
|
36
|
+
return { thought: thoughts.join('\n'), answer: '' };
|
|
37
|
+
}
|
|
38
|
+
return { thought: thoughts.join('\n'), answer };
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* 剥离模型直出的思维链标签块(MiniMax 等把 <think>…</think> 写进 content,
|
|
42
|
+
* 不走 reasoning_content 通道)。不剥离的话 capture 变量 / goal_supplement
|
|
43
|
+
* 补充要求 / preview / 子 agent 报告全带思考噪音——曾真实发生:
|
|
44
|
+
* supplements.json 首条是 240 字符英文 think 片段,随目标锚注入了后续每一步。
|
|
45
|
+
* 现为 splitThinkBlocks 的薄封装(单一事实来源),语义与旧实现逐 case 等价:
|
|
46
|
+
* 删除闭合块、未闭合开头整段判思考返回空串、结果 trim。
|
|
47
|
+
*/
|
|
48
|
+
export function stripThinkBlocks(text) {
|
|
49
|
+
return splitThinkBlocks(text).answer.trim();
|
|
50
|
+
}
|