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
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""为 ui-design 技能生成 HTML 起始模板。"""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
import argparse
|
|
7
|
+
import html
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
MODES = ("webpage", "app-ui", "deck", "deck-browser", "deck-pptx", "canvas", "animation")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def normalize_mode(mode: str, pptx_export: bool) -> tuple[str, bool]:
|
|
15
|
+
"""把显式 deck 变体收敛到内部模式,保留旧参数兼容。"""
|
|
16
|
+
if mode == "deck-browser":
|
|
17
|
+
return "deck", False
|
|
18
|
+
if mode == "deck-pptx":
|
|
19
|
+
return "deck", True
|
|
20
|
+
return mode, pptx_export
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def css_for_mode(mode: str, pptx_export: bool = False) -> str:
|
|
24
|
+
fixed = ""
|
|
25
|
+
if mode in {"deck", "animation"}:
|
|
26
|
+
stage_shell = (
|
|
27
|
+
"min-height: 1080px;\n display: block;\n background: var(--surface);"
|
|
28
|
+
if pptx_export and mode == "deck"
|
|
29
|
+
else "min-height: 100vh;\n display: grid;\n place-items: center;\n background: #111;"
|
|
30
|
+
)
|
|
31
|
+
transform_origin = "transform-origin: top left;" if pptx_export and mode == "deck" else "transform-origin: center;"
|
|
32
|
+
fixed = """
|
|
33
|
+
.stage-shell {
|
|
34
|
+
STAGE_SHELL
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.scaled-stage {
|
|
39
|
+
width: 1920px;
|
|
40
|
+
height: 1080px;
|
|
41
|
+
TRANSFORM_ORIGIN
|
|
42
|
+
background: var(--surface);
|
|
43
|
+
color: var(--ink);
|
|
44
|
+
position: relative;
|
|
45
|
+
overflow: hidden;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.stage-controls {
|
|
49
|
+
position: fixed;
|
|
50
|
+
left: 24px;
|
|
51
|
+
bottom: 24px;
|
|
52
|
+
z-index: 30;
|
|
53
|
+
display: flex;
|
|
54
|
+
gap: 8px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
[hidden] {
|
|
58
|
+
display: none !important;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
html[data-export-mode="background"] [data-pptx-layer="foreground"],
|
|
62
|
+
html[data-export-mode="background"] [data-pptx-export="ignore"],
|
|
63
|
+
html[data-export-mode="full"] [data-pptx-export="ignore"] {
|
|
64
|
+
visibility: hidden !important;
|
|
65
|
+
}
|
|
66
|
+
""".replace("STAGE_SHELL", stage_shell).replace("TRANSFORM_ORIGIN", transform_origin)
|
|
67
|
+
|
|
68
|
+
return f"""
|
|
69
|
+
:root {{
|
|
70
|
+
--ink: #111827;
|
|
71
|
+
--muted: #5f6b7a;
|
|
72
|
+
--paper: #f7fbff;
|
|
73
|
+
--surface: #ffffff;
|
|
74
|
+
--accent: #2f80ed;
|
|
75
|
+
--line: rgba(21, 21, 21, 0.16);
|
|
76
|
+
--radius: 8px;
|
|
77
|
+
--space: 24px;
|
|
78
|
+
font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Aptos", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
79
|
+
}}
|
|
80
|
+
|
|
81
|
+
* {{
|
|
82
|
+
box-sizing: border-box;
|
|
83
|
+
}}
|
|
84
|
+
|
|
85
|
+
body {{
|
|
86
|
+
margin: 0;
|
|
87
|
+
min-height: 100vh;
|
|
88
|
+
background: var(--paper);
|
|
89
|
+
color: var(--ink);
|
|
90
|
+
}}
|
|
91
|
+
|
|
92
|
+
button,
|
|
93
|
+
input,
|
|
94
|
+
textarea,
|
|
95
|
+
select {{
|
|
96
|
+
font: inherit;
|
|
97
|
+
}}
|
|
98
|
+
|
|
99
|
+
button {{
|
|
100
|
+
min-height: 44px;
|
|
101
|
+
padding: 0 14px;
|
|
102
|
+
}}
|
|
103
|
+
|
|
104
|
+
.artifact-root {{
|
|
105
|
+
min-height: 100vh;
|
|
106
|
+
padding: clamp(20px, 4vw, 64px);
|
|
107
|
+
}}
|
|
108
|
+
|
|
109
|
+
.layout {{
|
|
110
|
+
width: min(1180px, 100%);
|
|
111
|
+
margin: 0 auto;
|
|
112
|
+
display: grid;
|
|
113
|
+
gap: var(--space);
|
|
114
|
+
}}
|
|
115
|
+
|
|
116
|
+
.panel {{
|
|
117
|
+
border: 1px solid var(--line);
|
|
118
|
+
border-radius: var(--radius);
|
|
119
|
+
background: color-mix(in oklch, var(--surface), white 12%);
|
|
120
|
+
padding: clamp(20px, 3vw, 40px);
|
|
121
|
+
}}
|
|
122
|
+
|
|
123
|
+
.eyebrow {{
|
|
124
|
+
margin: 0 0 12px;
|
|
125
|
+
color: var(--accent);
|
|
126
|
+
font-size: 13px;
|
|
127
|
+
font-weight: 700;
|
|
128
|
+
letter-spacing: 0.08em;
|
|
129
|
+
text-transform: uppercase;
|
|
130
|
+
}}
|
|
131
|
+
|
|
132
|
+
h1 {{
|
|
133
|
+
max-width: 860px;
|
|
134
|
+
margin: 0;
|
|
135
|
+
font-size: clamp(36px, 5.2vw, 72px);
|
|
136
|
+
line-height: 1.08;
|
|
137
|
+
letter-spacing: 0;
|
|
138
|
+
text-wrap: balance;
|
|
139
|
+
}}
|
|
140
|
+
|
|
141
|
+
p {{
|
|
142
|
+
max-width: 720px;
|
|
143
|
+
color: var(--muted);
|
|
144
|
+
font-size: 18px;
|
|
145
|
+
line-height: 1.55;
|
|
146
|
+
}}
|
|
147
|
+
|
|
148
|
+
.tweaks-panel {{
|
|
149
|
+
position: fixed;
|
|
150
|
+
right: 20px;
|
|
151
|
+
bottom: 20px;
|
|
152
|
+
z-index: 40;
|
|
153
|
+
width: min(320px, calc(100vw - 40px));
|
|
154
|
+
display: none;
|
|
155
|
+
gap: 12px;
|
|
156
|
+
padding: 16px;
|
|
157
|
+
border: 1px solid var(--line);
|
|
158
|
+
border-radius: var(--radius);
|
|
159
|
+
background: white;
|
|
160
|
+
box-shadow: 0 18px 50px rgba(0, 0, 0, 0.14);
|
|
161
|
+
}}
|
|
162
|
+
|
|
163
|
+
.tweaks-panel[data-open="true"] {{
|
|
164
|
+
display: grid;
|
|
165
|
+
}}
|
|
166
|
+
{fixed}
|
|
167
|
+
"""
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
def body_for_mode(mode: str, title: str, pptx_export: bool = False) -> str:
|
|
171
|
+
escaped_title = html.escape(title)
|
|
172
|
+
if mode == "deck":
|
|
173
|
+
controls = "" if pptx_export else """
|
|
174
|
+
<nav class="stage-controls" aria-label="幻灯片控制" data-pptx-export="ignore">
|
|
175
|
+
<button type="button" id="prev-slide">上一页</button>
|
|
176
|
+
<button type="button" id="next-slide">下一页</button>
|
|
177
|
+
</nav>
|
|
178
|
+
<!-- 仅当用户明确要求演讲备注时,添加 id="speaker-notes" JSON,并在切页时同步 slideIndexChanged。 -->
|
|
179
|
+
"""
|
|
180
|
+
return f"""
|
|
181
|
+
<div class="stage-shell">
|
|
182
|
+
<main class="scaled-stage" id="scaled-stage" data-pptx-layer="background">
|
|
183
|
+
<section class="slide" data-screen-label="01 标题" data-pptx-layer="slide">
|
|
184
|
+
<p class="eyebrow" data-pptx-layer="foreground" data-pptx-kind="text">HTML 演示</p>
|
|
185
|
+
<h1 data-pptx-layer="foreground" data-pptx-kind="text">{escaped_title}</h1>
|
|
186
|
+
<p data-pptx-layer="foreground" data-pptx-kind="text">将这一页作为第一张设计页。slide 标签从 1 开始编号。</p>
|
|
187
|
+
</section>
|
|
188
|
+
</main>
|
|
189
|
+
{controls}
|
|
190
|
+
</div>
|
|
191
|
+
"""
|
|
192
|
+
if mode == "canvas":
|
|
193
|
+
return f"""
|
|
194
|
+
<main class="artifact-root" data-screen-label="01 设计画布">
|
|
195
|
+
<div class="layout">
|
|
196
|
+
<section class="panel">
|
|
197
|
+
<p class="eyebrow">设计画布</p>
|
|
198
|
+
<h1>{escaped_title}</h1>
|
|
199
|
+
<p>在这个画布中比较视觉方向、组件处理、字体、配色或布局方案。</p>
|
|
200
|
+
</section>
|
|
201
|
+
</div>
|
|
202
|
+
</main>
|
|
203
|
+
"""
|
|
204
|
+
if mode == "animation":
|
|
205
|
+
return f"""
|
|
206
|
+
<div class="stage-shell">
|
|
207
|
+
<main class="scaled-stage" id="scaled-stage" data-screen-label="01 动画演示" data-pptx-layer="background">
|
|
208
|
+
<p class="eyebrow" data-pptx-layer="foreground" data-pptx-kind="text">动效演示</p>
|
|
209
|
+
<h1 data-pptx-layer="foreground" data-pptx-kind="text">{escaped_title}</h1>
|
|
210
|
+
<p data-pptx-layer="foreground" data-pptx-kind="text">在这个舞台中组织时间线场景、播放控件和持久化时间状态。</p>
|
|
211
|
+
</main>
|
|
212
|
+
<nav class="stage-controls" aria-label="播放控制" data-pptx-export="ignore">
|
|
213
|
+
<button type="button" id="play-toggle">播放</button>
|
|
214
|
+
</nav>
|
|
215
|
+
</div>
|
|
216
|
+
"""
|
|
217
|
+
label = "01 应用界面" if mode == "app-ui" else "01 网页"
|
|
218
|
+
eyebrow = "产品界面" if mode == "app-ui" else "网页体验"
|
|
219
|
+
return f"""
|
|
220
|
+
<main class="artifact-root" data-screen-label="{label}">
|
|
221
|
+
<div class="layout">
|
|
222
|
+
<section class="panel">
|
|
223
|
+
<p class="eyebrow">{eyebrow}</p>
|
|
224
|
+
<h1>{escaped_title}</h1>
|
|
225
|
+
<p>使用贴合用户产品语境和设计系统的具体内容。</p>
|
|
226
|
+
</section>
|
|
227
|
+
</div>
|
|
228
|
+
</main>
|
|
229
|
+
"""
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
def js_for_mode(mode: str, pptx_export: bool = False) -> str:
|
|
233
|
+
if pptx_export and mode == "deck":
|
|
234
|
+
return ""
|
|
235
|
+
scale_js = ""
|
|
236
|
+
deck_js = ""
|
|
237
|
+
if mode in {"deck", "animation"}:
|
|
238
|
+
scale_js = """
|
|
239
|
+
function fitStage() {
|
|
240
|
+
const stage = document.getElementById('scaled-stage');
|
|
241
|
+
if (!stage) return;
|
|
242
|
+
const scale = Math.min(window.innerWidth / 1920, window.innerHeight / 1080);
|
|
243
|
+
stage.style.transform = `scale(${scale})`;
|
|
244
|
+
}
|
|
245
|
+
window.addEventListener('resize', fitStage);
|
|
246
|
+
fitStage();
|
|
247
|
+
"""
|
|
248
|
+
if mode == "deck":
|
|
249
|
+
deck_js = """
|
|
250
|
+
let activeSlide = Number(localStorage.getItem('ui-design-active-slide') || 0);
|
|
251
|
+
function setActiveSlide(index) {
|
|
252
|
+
const slides = Array.from(document.querySelectorAll('.slide'));
|
|
253
|
+
if (!slides.length) return;
|
|
254
|
+
activeSlide = Math.max(0, Math.min(index, slides.length - 1));
|
|
255
|
+
slides.forEach((slide, i) => {
|
|
256
|
+
slide.hidden = i !== activeSlide;
|
|
257
|
+
});
|
|
258
|
+
localStorage.setItem('ui-design-active-slide', String(activeSlide));
|
|
259
|
+
window.parent.postMessage({ slideIndexChanged: activeSlide }, '*');
|
|
260
|
+
}
|
|
261
|
+
document.getElementById('prev-slide')?.addEventListener('click', () => setActiveSlide(activeSlide - 1));
|
|
262
|
+
document.getElementById('next-slide')?.addEventListener('click', () => setActiveSlide(activeSlide + 1));
|
|
263
|
+
setActiveSlide(activeSlide);
|
|
264
|
+
"""
|
|
265
|
+
if mode == "animation":
|
|
266
|
+
deck_js = """
|
|
267
|
+
let isPlaying = localStorage.getItem('ui-design-animation-playing') === 'true';
|
|
268
|
+
function setPlaying(next) {
|
|
269
|
+
isPlaying = next;
|
|
270
|
+
localStorage.setItem('ui-design-animation-playing', String(isPlaying));
|
|
271
|
+
document.getElementById('play-toggle').textContent = isPlaying ? '暂停' : '播放';
|
|
272
|
+
}
|
|
273
|
+
document.getElementById('play-toggle')?.addEventListener('click', () => setPlaying(!isPlaying));
|
|
274
|
+
setPlaying(isPlaying);
|
|
275
|
+
"""
|
|
276
|
+
return f"""
|
|
277
|
+
const UI_DESIGN_TWEAKS = /*EDITMODE-BEGIN*/{{
|
|
278
|
+
"primaryColor": "#2f80ed",
|
|
279
|
+
"density": "comfortable",
|
|
280
|
+
"variant": "A"
|
|
281
|
+
}}/*EDITMODE-END*/;
|
|
282
|
+
|
|
283
|
+
function applyTweaks(nextTweaks) {{
|
|
284
|
+
document.documentElement.style.setProperty('--accent', nextTweaks.primaryColor || '#2f80ed');
|
|
285
|
+
document.documentElement.dataset.variant = nextTweaks.variant || 'A';
|
|
286
|
+
}}
|
|
287
|
+
|
|
288
|
+
function persistTweakPatch(patch) {{
|
|
289
|
+
Object.assign(UI_DESIGN_TWEAKS, patch);
|
|
290
|
+
applyTweaks(UI_DESIGN_TWEAKS);
|
|
291
|
+
window.parent.postMessage({{ type: '__edit_mode_set_keys', edits: patch }}, '*');
|
|
292
|
+
}}
|
|
293
|
+
|
|
294
|
+
const tweaksPanel = document.querySelector('.tweaks-panel');
|
|
295
|
+
window.addEventListener('message', (event) => {{
|
|
296
|
+
if (event.data?.type === '__activate_edit_mode') {{
|
|
297
|
+
tweaksPanel?.setAttribute('data-open', 'true');
|
|
298
|
+
}}
|
|
299
|
+
if (event.data?.type === '__deactivate_edit_mode') {{
|
|
300
|
+
tweaksPanel?.setAttribute('data-open', 'false');
|
|
301
|
+
}}
|
|
302
|
+
if (event.data?.type === '__edit_mode_set_keys') {{
|
|
303
|
+
const patch = event.data.edits || event.data.keys || {{}};
|
|
304
|
+
Object.assign(UI_DESIGN_TWEAKS, patch);
|
|
305
|
+
applyTweaks(UI_DESIGN_TWEAKS);
|
|
306
|
+
}}
|
|
307
|
+
}});
|
|
308
|
+
window.parent.postMessage({{ type: '__edit_mode_available' }}, '*');
|
|
309
|
+
applyTweaks(UI_DESIGN_TWEAKS);
|
|
310
|
+
{scale_js}{deck_js}
|
|
311
|
+
document.querySelector('[data-tweak-primary]')?.addEventListener('input', (event) => {{
|
|
312
|
+
persistTweakPatch({{ primaryColor: event.target.value }});
|
|
313
|
+
}});
|
|
314
|
+
"""
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
def render_html(mode: str, title: str, pptx_export: bool = False) -> str:
|
|
318
|
+
tweaks = "" if pptx_export and mode == "deck" else """ <aside class="tweaks-panel" aria-label="调整">
|
|
319
|
+
<strong>调整</strong>
|
|
320
|
+
<label>
|
|
321
|
+
强调色
|
|
322
|
+
<input data-tweak-primary type="color" value="#c75f3a">
|
|
323
|
+
</label>
|
|
324
|
+
</aside>
|
|
325
|
+
"""
|
|
326
|
+
script = "" if pptx_export and mode == "deck" else f""" <script>
|
|
327
|
+
{js_for_mode(mode, pptx_export)}
|
|
328
|
+
</script>
|
|
329
|
+
"""
|
|
330
|
+
return f"""<!doctype html>
|
|
331
|
+
<html lang="zh-CN">
|
|
332
|
+
<head>
|
|
333
|
+
<meta charset="utf-8">
|
|
334
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
335
|
+
<title>{html.escape(title)}</title>
|
|
336
|
+
<style>
|
|
337
|
+
{css_for_mode(mode, pptx_export)}
|
|
338
|
+
</style>
|
|
339
|
+
</head>
|
|
340
|
+
<body>
|
|
341
|
+
{body_for_mode(mode, title, pptx_export)}
|
|
342
|
+
{tweaks}{script}
|
|
343
|
+
</body>
|
|
344
|
+
</html>
|
|
345
|
+
"""
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
def parse_args() -> argparse.Namespace:
|
|
349
|
+
parser = argparse.ArgumentParser(description=__doc__)
|
|
350
|
+
parser.add_argument(
|
|
351
|
+
"--mode",
|
|
352
|
+
choices=MODES,
|
|
353
|
+
default="webpage",
|
|
354
|
+
help="要生成的 artifact 类型。deck-browser 是浏览器演示 deck;deck-pptx 是静态 PPTX 导出 deck。旧 deck 默认浏览器模式。",
|
|
355
|
+
)
|
|
356
|
+
parser.add_argument("--title", default="未命名设计", help="HTML 标题和起始主标题。")
|
|
357
|
+
parser.add_argument("--output", required=True, help="目标 HTML 文件。")
|
|
358
|
+
parser.add_argument("--force", action="store_true", help="如果目标文件已存在,则覆盖。")
|
|
359
|
+
parser.add_argument("--pptx-export", action="store_true", help="兼容旧用法:deck 模式下生成静态 PPTX 导出模板,不包含 Tweaks/localStorage/JS 缩放/翻页控制。")
|
|
360
|
+
return parser.parse_args()
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
def main() -> int:
|
|
364
|
+
args = parse_args()
|
|
365
|
+
output = Path(args.output)
|
|
366
|
+
if output.exists() and not args.force:
|
|
367
|
+
raise SystemExit(f"拒绝覆盖已有文件:{output}。如需覆盖请传入 --force。")
|
|
368
|
+
mode, pptx_export = normalize_mode(args.mode, args.pptx_export)
|
|
369
|
+
output.parent.mkdir(parents=True, exist_ok=True)
|
|
370
|
+
output.write_text(render_html(mode, args.title, pptx_export), encoding="utf-8")
|
|
371
|
+
actual = "deck-pptx" if mode == "deck" and pptx_export else ("deck-browser" if args.mode == "deck-browser" else args.mode)
|
|
372
|
+
print(f"已写入 {actual} artifact 起始模板:{output}")
|
|
373
|
+
return 0
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
if __name__ == "__main__":
|
|
377
|
+
raise SystemExit(main())
|