@bastani/atomic 0.9.74-alpha.1 → 0.9.75
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/CHANGELOG.md +162 -0
- package/dist/builtin/intercom/package.json +2 -2
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/CHANGELOG.md +21 -0
- package/dist/builtin/subagents/package.json +3 -3
- package/dist/builtin/subagents/skills/agent-browser/SKILL.md +8 -10
- package/dist/builtin/subagents/skills/agent-desktop/SKILL.md +9 -5
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +7 -1
- package/dist/builtin/web-access/package.json +2 -2
- package/dist/builtin/workflows/CHANGELOG.md +80 -0
- package/dist/builtin/workflows/README.md +5 -2
- package/dist/builtin/workflows/builtin/{chunk-m8eg152f.js → chunk-89we7r4p.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-a4fdm2cw.js → chunk-8yfssw01.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-774myqzs.js → chunk-v8mb0005.js} +366 -45
- package/dist/builtin/workflows/builtin/{chunk-d5cxskkp.js → chunk-wh2p4qjg.js} +2 -2
- package/dist/builtin/workflows/builtin/goal.js +2 -2
- package/dist/builtin/workflows/builtin/index.d.ts +10 -0
- package/dist/builtin/workflows/builtin/index.js +4 -4
- package/dist/builtin/workflows/builtin/open-claude-design.d.ts +12 -0
- package/dist/builtin/workflows/builtin/open-claude-design.js +1 -1
- package/dist/builtin/workflows/builtin/ralph.js +2 -2
- package/dist/builtin/workflows/package.json +2 -2
- package/dist/builtin/workflows/skills/impeccable/SKILL.md +4 -4
- package/dist/builtin/workflows/skills/impeccable/reference/android.md +1 -1
- package/dist/builtin/workflows/skills/impeccable/reference/audit.md +2 -2
- package/dist/builtin/workflows/skills/impeccable/reference/craft-floor.md +1 -1
- package/dist/builtin/workflows/skills/impeccable/reference/degraded/asset-producer.md +1 -1
- package/dist/builtin/workflows/skills/impeccable/reference/degraded/documenter.md +4 -4
- package/dist/builtin/workflows/skills/impeccable/reference/degraded/finish-reviewer.md +2 -2
- package/dist/builtin/workflows/skills/impeccable/reference/degraded/manual-edit-applier.md +3 -2
- package/dist/builtin/workflows/skills/impeccable/reference/distill.md +3 -3
- package/dist/builtin/workflows/skills/impeccable/reference/doctor.md +1 -1
- package/dist/builtin/workflows/skills/impeccable/reference/document.md +3 -3
- package/dist/builtin/workflows/skills/impeccable/reference/harden.md +19 -0
- package/dist/builtin/workflows/skills/impeccable/reference/hooks.md +15 -8
- package/dist/builtin/workflows/skills/impeccable/reference/init.md +2 -0
- package/dist/builtin/workflows/skills/impeccable/reference/live.md +8 -6
- package/dist/builtin/workflows/skills/impeccable/reference/new-work.md +4 -4
- package/dist/builtin/workflows/skills/impeccable/reference/optimize.md +0 -1
- package/dist/builtin/workflows/skills/impeccable/reference/visualize.md +1 -1
- package/dist/builtin/workflows/skills/impeccable/scripts/VERSION +1 -1
- package/dist/builtin/workflows/skills/impeccable/scripts/command-metadata.json +2 -2
- package/dist/builtin/workflows/skills/impeccable/scripts/engine-checksums.txt +9 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/impeccable +98 -44
- package/dist/builtin/workflows/skills/impeccable/scripts/impeccable.cmd +101 -34
- package/dist/builtin/workflows/skills/impeccable/scripts/live-browser-ignores.js +6 -2
- package/dist/builtin/workflows/skills/impeccable/scripts/live-browser-session.js +4 -1
- package/dist/builtin/workflows/skills/impeccable/scripts/live-browser.js +444 -144
- package/dist/builtin/workflows/skills/prompt-engineer/SKILL.md +3 -1
- package/dist/builtin/workflows/skills/prompt-engineer/references/advanced_patterns.md +2 -2
- package/dist/builtin/workflows/skills/prompt-engineer/references/claude_fable_5.md +13 -11
- package/dist/builtin/workflows/skills/prompt-engineer/references/claude_fable_5_1.md +10 -8
- package/dist/builtin/workflows/skills/prompt-engineer/references/claude_fable_5_2.md +143 -0
- package/dist/builtin/workflows/skills/prompt-engineer/references/claude_haiku_5_5.md +11 -7
- package/dist/builtin/workflows/skills/prompt-engineer/references/claude_opus_4_8.md +3 -3
- package/dist/builtin/workflows/skills/prompt-engineer/references/claude_opus_5.md +6 -2
- package/dist/builtin/workflows/skills/prompt-engineer/references/claude_opus_5_5.md +7 -7
- package/dist/builtin/workflows/skills/prompt-engineer/references/claude_sonnet_5.md +2 -2
- package/dist/builtin/workflows/skills/prompt-engineer/references/claude_sonnet_5_5.md +3 -3
- package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_5_5.md +2 -2
- package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_5_6.md +2 -2
- package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_6.md +6 -5
- package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_6_1_sol.md +4 -4
- package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_6_1_terra.md +2 -2
- package/dist/builtin/workflows/skills/prompt-engineer/references/quality_improvement.md +4 -3
- package/dist/builtin/workflows/skills/skill-creator/scripts/aggregate_benchmark.py +0 -0
- package/dist/builtin/workflows/skills/skill-creator/scripts/generate_report.py +0 -0
- package/dist/builtin/workflows/skills/skill-creator/scripts/improve_description.py +0 -0
- package/dist/builtin/workflows/skills/skill-creator/scripts/package_skill.py +0 -0
- package/dist/builtin/workflows/skills/skill-creator/scripts/quick_validate.py +0 -0
- package/dist/builtin/workflows/skills/skill-creator/scripts/run_eval.py +0 -0
- package/dist/builtin/workflows/skills/skill-creator/scripts/run_loop.py +0 -0
- package/dist/builtin/workflows/skills/unslop/SKILL.md +15 -34
- package/dist/builtin/workflows/src/durable/journal/memory-run-journal.d.ts +1 -0
- package/dist/builtin/workflows/src/durable/journal/values.d.ts +2 -0
- package/dist/builtin/workflows/src/extension/index.bundle.mjs +809 -410
- package/dist/builtin/workflows/src/extension/local-worker-entry.mjs +695 -305
- package/dist/builtin/workflows/src/index.js +685 -295
- package/dist/builtin/workflows/src/local-worker-entry.mjs +695 -305
- package/dist/builtin/workflows/src/shared/authoring-contract-stage.d.ts +6 -6
- package/dist/builtin/workflows/src/shared/authoring-contract-ui.d.ts +2 -2
- package/dist/builtin/workflows/src/shared/serializable-error-families.d.ts +2 -0
- package/dist/bun/app-host-modules.d.ts +1 -1
- package/dist/bun/app-host-modules.d.ts.map +1 -1
- package/dist/bun/app-host-modules.js.map +1 -1
- package/dist/bun/internal-workflow-worker.d.ts +2 -0
- package/dist/bun/internal-workflow-worker.d.ts.map +1 -1
- package/dist/bun/internal-workflow-worker.js +2 -1
- package/dist/bun/internal-workflow-worker.js.map +1 -1
- package/dist/codemode-worker.js +2 -0
- package/dist/config.d.ts +8 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +14 -0
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-bash.d.ts.map +1 -1
- package/dist/core/agent-session-bash.js +2 -1
- package/dist/core/agent-session-bash.js.map +1 -1
- package/dist/core/agent-session-blueprint-environment.d.ts +10 -0
- package/dist/core/agent-session-blueprint-environment.d.ts.map +1 -0
- package/dist/core/agent-session-blueprint-environment.js +28 -0
- package/dist/core/agent-session-blueprint-environment.js.map +1 -0
- package/dist/core/agent-session-events.d.ts.map +1 -1
- package/dist/core/agent-session-events.js +2 -0
- package/dist/core/agent-session-events.js.map +1 -1
- package/dist/core/agent-session-methods.d.ts +1 -0
- package/dist/core/agent-session-methods.d.ts.map +1 -1
- package/dist/core/agent-session-methods.js.map +1 -1
- package/dist/core/agent-session-retry.d.ts.map +1 -1
- package/dist/core/agent-session-retry.js +14 -4
- package/dist/core/agent-session-retry.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts +20 -0
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +55 -6
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session-tool-registry.d.ts.map +1 -1
- package/dist/core/agent-session-tool-registry.js +2 -1
- package/dist/core/agent-session-tool-registry.js.map +1 -1
- package/dist/core/agent-session.d.ts +2 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +2 -0
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/async-scope.d.ts +13 -0
- package/dist/core/async-scope.d.ts.map +1 -0
- package/dist/core/async-scope.js +20 -0
- package/dist/core/async-scope.js.map +1 -0
- package/dist/core/cache-warmer.d.ts +3 -14
- package/dist/core/cache-warmer.d.ts.map +1 -1
- package/dist/core/cache-warmer.js +8 -60
- package/dist/core/cache-warmer.js.map +1 -1
- package/dist/core/extensions/extension-work.js +2 -2
- package/dist/core/extensions/extension-work.js.map +1 -1
- package/dist/core/extensions/loader-host-modules.d.ts.map +1 -1
- package/dist/core/extensions/loader-host-modules.js +3 -1
- package/dist/core/extensions/loader-host-modules.js.map +1 -1
- package/dist/core/extensions/ui-types.d.ts +2 -1
- package/dist/core/extensions/ui-types.d.ts.map +1 -1
- package/dist/core/extensions/ui-types.js.map +1 -1
- package/dist/core/extensions/workflow-events.d.ts +1 -1
- package/dist/core/extensions/workflow-events.d.ts.map +1 -1
- package/dist/core/extensions/workflow-events.js.map +1 -1
- package/dist/core/extensions/workflow-run-control.d.ts +4 -2
- package/dist/core/extensions/workflow-run-control.d.ts.map +1 -1
- package/dist/core/extensions/workflow-run-control.js.map +1 -1
- package/dist/core/model-fallback-failures.d.ts +6 -0
- package/dist/core/model-fallback-failures.d.ts.map +1 -1
- package/dist/core/model-fallback-failures.js +10 -1
- package/dist/core/model-fallback-failures.js.map +1 -1
- package/dist/core/preferred-providers.d.ts +19 -0
- package/dist/core/preferred-providers.d.ts.map +1 -0
- package/dist/core/preferred-providers.js +25 -0
- package/dist/core/preferred-providers.js.map +1 -0
- package/dist/core/provider-alias.d.ts.map +1 -1
- package/dist/core/provider-alias.js +4 -0
- package/dist/core/provider-alias.js.map +1 -1
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js +1 -0
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.js +3 -0
- package/dist/core/remote-catalog-provider.js.map +1 -1
- package/dist/core/resume/blueprint/action-expressions.d.ts +32 -0
- package/dist/core/resume/blueprint/action-expressions.d.ts.map +1 -0
- package/dist/core/resume/blueprint/action-expressions.js +389 -0
- package/dist/core/resume/blueprint/action-expressions.js.map +1 -0
- package/dist/core/resume/blueprint/actions.d.ts +90 -0
- package/dist/core/resume/blueprint/actions.d.ts.map +1 -0
- package/dist/core/resume/blueprint/actions.js +818 -0
- package/dist/core/resume/blueprint/actions.js.map +1 -0
- package/dist/core/resume/blueprint/build.d.ts +102 -0
- package/dist/core/resume/blueprint/build.d.ts.map +1 -0
- package/dist/core/resume/blueprint/build.js +535 -0
- package/dist/core/resume/blueprint/build.js.map +1 -0
- package/dist/core/resume/blueprint/context.d.ts +11 -0
- package/dist/core/resume/blueprint/context.d.ts.map +1 -0
- package/dist/core/resume/blueprint/context.js +106 -0
- package/dist/core/resume/blueprint/context.js.map +1 -0
- package/dist/core/resume/blueprint/envrc.d.ts +19 -0
- package/dist/core/resume/blueprint/envrc.d.ts.map +1 -0
- package/dist/core/resume/blueprint/envrc.js +77 -0
- package/dist/core/resume/blueprint/envrc.js.map +1 -0
- package/dist/core/resume/blueprint/errors.d.ts +179 -0
- package/dist/core/resume/blueprint/errors.d.ts.map +1 -0
- package/dist/core/resume/blueprint/errors.js +169 -0
- package/dist/core/resume/blueprint/errors.js.map +1 -0
- package/dist/core/resume/blueprint/ledger.d.ts +51 -0
- package/dist/core/resume/blueprint/ledger.d.ts.map +1 -0
- package/dist/core/resume/blueprint/ledger.js +119 -0
- package/dist/core/resume/blueprint/ledger.js.map +1 -0
- package/dist/core/resume/blueprint/notices.d.ts +14 -0
- package/dist/core/resume/blueprint/notices.d.ts.map +1 -0
- package/dist/core/resume/blueprint/notices.js +44 -0
- package/dist/core/resume/blueprint/notices.js.map +1 -0
- package/dist/core/resume/blueprint/process.d.ts +44 -0
- package/dist/core/resume/blueprint/process.d.ts.map +1 -0
- package/dist/core/resume/blueprint/process.js +142 -0
- package/dist/core/resume/blueprint/process.js.map +1 -0
- package/dist/core/resume/blueprint/resume.d.ts +73 -0
- package/dist/core/resume/blueprint/resume.d.ts.map +1 -0
- package/dist/core/resume/blueprint/resume.js +206 -0
- package/dist/core/resume/blueprint/resume.js.map +1 -0
- package/dist/core/resume/blueprint/schema.d.ts +26 -0
- package/dist/core/resume/blueprint/schema.d.ts.map +1 -0
- package/dist/core/resume/blueprint/schema.js +243 -0
- package/dist/core/resume/blueprint/schema.js.map +1 -0
- package/dist/core/resume/blueprint/steps.d.ts +54 -0
- package/dist/core/resume/blueprint/steps.d.ts.map +1 -0
- package/dist/core/resume/blueprint/steps.js +155 -0
- package/dist/core/resume/blueprint/steps.js.map +1 -0
- package/dist/core/resume/blueprint/types.d.ts +63 -0
- package/dist/core/resume/blueprint/types.d.ts.map +1 -0
- package/dist/core/resume/blueprint/types.js +2 -0
- package/dist/core/resume/blueprint/types.js.map +1 -0
- package/dist/core/resume/errors.d.ts +7 -35
- package/dist/core/resume/errors.d.ts.map +1 -1
- package/dist/core/resume/errors.js +1 -21
- package/dist/core/resume/errors.js.map +1 -1
- package/dist/core/resume/index.d.ts +12 -4
- package/dist/core/resume/index.d.ts.map +1 -1
- package/dist/core/resume/index.js +11 -4
- package/dist/core/resume/index.js.map +1 -1
- package/dist/core/resume/run-setup.d.ts +36 -15
- package/dist/core/resume/run-setup.d.ts.map +1 -1
- package/dist/core/resume/run-setup.js +70 -54
- package/dist/core/resume/run-setup.js.map +1 -1
- package/dist/core/resume/session-resume.d.ts +34 -20
- package/dist/core/resume/session-resume.d.ts.map +1 -1
- package/dist/core/resume/session-resume.js +244 -106
- package/dist/core/resume/session-resume.js.map +1 -1
- package/dist/core/retry-policy.d.ts +19 -1
- package/dist/core/retry-policy.d.ts.map +1 -1
- package/dist/core/retry-policy.js +26 -1
- package/dist/core/retry-policy.js.map +1 -1
- package/dist/core/sdk.js +1 -1
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-cwd.d.ts +56 -1
- package/dist/core/session-cwd.d.ts.map +1 -1
- package/dist/core/session-cwd.js +94 -4
- package/dist/core/session-cwd.js.map +1 -1
- package/dist/core/session-manager-core.d.ts +1 -1
- package/dist/core/session-manager-core.d.ts.map +1 -1
- package/dist/core/session-manager-core.js +10 -5
- package/dist/core/session-manager-core.js.map +1 -1
- package/dist/core/session-worktree-snapshots.d.ts +11 -0
- package/dist/core/session-worktree-snapshots.d.ts.map +1 -1
- package/dist/core/session-worktree-snapshots.js +10 -4
- package/dist/core/session-worktree-snapshots.js.map +1 -1
- package/dist/core/settings-defaults.d.ts +1 -1
- package/dist/core/settings-defaults.d.ts.map +1 -1
- package/dist/core/settings-defaults.js +1 -1
- package/dist/core/settings-defaults.js.map +1 -1
- package/dist/core/settings-manager-basic-accessors.d.ts +3 -2
- package/dist/core/settings-manager-basic-accessors.d.ts.map +1 -1
- package/dist/core/settings-manager-basic-accessors.js.map +1 -1
- package/dist/core/settings-schema.d.ts.map +1 -1
- package/dist/core/settings-schema.js +2 -1
- package/dist/core/settings-schema.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +4 -0
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/storage/write-ahead-log.d.ts +2 -1
- package/dist/core/storage/write-ahead-log.d.ts.map +1 -1
- package/dist/core/storage/write-ahead-log.js +27 -6
- package/dist/core/storage/write-ahead-log.js.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +10 -0
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/file-tool-errors.d.ts +1 -1
- package/dist/core/tools/file-tool-errors.js +1 -1
- package/dist/core/tools/file-tool-errors.js.map +1 -1
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +52 -26
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts +2 -0
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/powershell.d.ts.map +1 -1
- package/dist/core/tools/powershell.js +10 -2
- package/dist/core/tools/powershell.js.map +1 -1
- package/dist/core/tools/tool-concurrency.d.ts.map +1 -1
- package/dist/core/tools/tool-concurrency.js +2 -2
- package/dist/core/tools/tool-concurrency.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/main-session.d.ts +12 -4
- package/dist/main-session.d.ts.map +1 -1
- package/dist/main-session.js +28 -4
- package/dist/main-session.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +6 -8
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host.d.ts +5 -1
- package/dist/modes/interactive/components/chat-session-host.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host.js +6 -1
- package/dist/modes/interactive/components/chat-session-host.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts +10 -3
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js +34 -13
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/components/provider-brand.d.ts +16 -0
- package/dist/modes/interactive/components/provider-brand.d.ts.map +1 -0
- package/dist/modes/interactive/components/provider-brand.js +67 -0
- package/dist/modes/interactive/components/provider-brand.js.map +1 -0
- package/dist/modes/interactive/interactive-auth-routing.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-auth-routing.js +8 -6
- package/dist/modes/interactive/interactive-auth-routing.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-dialogs.js +4 -3
- package/dist/modes/interactive/interactive-extension-dialogs.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-runtime.js +8 -3
- package/dist/modes/interactive/interactive-extension-runtime.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-deps.d.ts +1 -1
- package/dist/modes/interactive/interactive-mode-deps.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-deps.js +1 -1
- package/dist/modes/interactive/interactive-mode-deps.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.d.ts +12 -2
- package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
- package/dist/modes/interactive/interactive-session-routing.js +59 -21
- package/dist/modes/interactive/interactive-session-routing.js.map +1 -1
- package/dist/modes/interactive/interactive-slash-commands.js +23 -12
- package/dist/modes/interactive/interactive-slash-commands.js.map +1 -1
- package/dist/modes/interactive/login-provider-options.d.ts.map +1 -1
- package/dist/modes/interactive/login-provider-options.js +2 -1
- package/dist/modes/interactive/login-provider-options.js.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.d.ts +2 -0
- package/dist/modes/interactive-engine/isolated-runtime.d.ts.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.js +8 -3
- package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
- package/dist/modes/rpc/rpc-client-api.d.ts +2 -1
- package/dist/modes/rpc/rpc-client-api.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client-api.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +0 -1
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +2 -18
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-command-handler.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-command-handler.js +8 -2
- package/dist/modes/rpc/rpc-command-handler.js.map +1 -1
- package/dist/modes/rpc/rpc-error-decoding.d.ts +7 -0
- package/dist/modes/rpc/rpc-error-decoding.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-error-decoding.js +25 -0
- package/dist/modes/rpc/rpc-error-decoding.js.map +1 -0
- package/dist/modes/rpc/rpc-responses.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-responses.js +12 -0
- package/dist/modes/rpc/rpc-responses.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +11 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +12 -3
- package/dist/package-manager-cli.js.map +1 -1
- package/docs/background-tasks.md +1 -1
- package/docs/codemode.md +22 -0
- package/docs/extensions/api-reference.md +27 -1
- package/docs/extensions/authoring.md +1 -1
- package/docs/extensions/ui.md +1 -1
- package/docs/getting-started/first-session.md +1 -1
- package/docs/guides/resume-on-any-machine.md +72 -19
- package/docs/models/evals.md +85 -17
- package/docs/models/reference.md +1 -1
- package/docs/providers.md +38 -5
- package/docs/reference/cli.md +2 -0
- package/docs/rpc/protocol.md +11 -1
- package/docs/sdk/reference.md +36 -4
- package/docs/sdk.md +2 -2
- package/docs/sessions.md +11 -1
- package/docs/settings.md +7 -2
- package/docs/skills.md +3 -3
- package/docs/storage.md +1 -1
- package/docs/tools.md +3 -1
- package/docs/workflows/api-reference.md +14 -12
- package/docs/workflows/authoring.md +29 -1
- package/docs/workflows/builtins.md +9 -1
- package/docs/workflows/operations.md +8 -8
- package/docs/worktree-snapshots.md +3 -2
- package/npm-shrinkwrap.json +83 -67
- package/package.json +7 -7
- package/schemas/settings.schema.json +3 -2
- package/dist/core/resume/setup-hook.d.ts +0 -69
- package/dist/core/resume/setup-hook.d.ts.map +0 -1
- package/dist/core/resume/setup-hook.js +0 -261
- package/dist/core/resume/setup-hook.js.map +0 -1
|
@@ -4,14 +4,266 @@ import {
|
|
|
4
4
|
} from "./chunk-rqbmeg5x.js";
|
|
5
5
|
|
|
6
6
|
// dist/builtin/workflows/builtin/open-claude-design.ts
|
|
7
|
-
import { Type as
|
|
7
|
+
import { Type as Type3 } from "typebox";
|
|
8
|
+
|
|
9
|
+
// dist/builtin/workflows/builtin/open-claude-design-images.ts
|
|
10
|
+
import { existsSync } from "node:fs";
|
|
11
|
+
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
12
|
+
import { dirname, join } from "node:path";
|
|
13
|
+
import { AuthStorage } from "@bastani/atomic";
|
|
14
|
+
import { builtinModels } from "@bastani/pi-ai/providers/all";
|
|
15
|
+
import { Type } from "typebox";
|
|
16
|
+
var referenceImagesStatusSchema = Type.Object({
|
|
17
|
+
status: Type.Union([Type.Literal("skipped"), Type.Literal("generated"), Type.Literal("failed")]),
|
|
18
|
+
reason: Type.Optional(Type.String()),
|
|
19
|
+
model: Type.Optional(Type.String()),
|
|
20
|
+
paths: Type.Array(Type.String()),
|
|
21
|
+
retryable: Type.Optional(Type.Boolean())
|
|
22
|
+
}, {
|
|
23
|
+
additionalProperties: false,
|
|
24
|
+
description: "Outcome of the reference image step: status (skipped, generated, or failed), the reason, the model used, the image paths under <artifact_dir>/references/, and whether a failure is retryable."
|
|
25
|
+
});
|
|
26
|
+
var REFERENCE_IMAGES_DIRNAME = "references";
|
|
27
|
+
var REFERENCE_IMAGES_TOOL_TIMEOUT_MS = 15 * 60000;
|
|
28
|
+
var IMAGE_REQUEST_TIMEOUT_MS = 5 * 60000;
|
|
29
|
+
var IMAGE_REQUEST_MAX_RETRIES = 1;
|
|
30
|
+
var IMAGE_SIZE = "1536x1024";
|
|
31
|
+
var PRODUCT_EXCERPT_CHARS = 1000;
|
|
32
|
+
var DESIGN_EXCERPT_CHARS = 1500;
|
|
33
|
+
var REFERENCES_EXCERPT_CHARS = 1500;
|
|
34
|
+
var REFERENCE_IMAGE_DIRECTIONS = [
|
|
35
|
+
{
|
|
36
|
+
slug: "reference-led",
|
|
37
|
+
composition: "Reference-led. Stay closest to the curated references and the project's design system: lead with the composition the strongest reference uses and show the product concept it implies."
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
slug: "brand-forward",
|
|
41
|
+
composition: "Brand-forward. One dominant, memorable focal move at large scale carries the brand; generous space, and every other region holds still at real reading size."
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
slug: "information-dense",
|
|
45
|
+
composition: "Information-dense. Summary-led, with a compact structured grid and a tight hierarchy that shows more real content at real reading size."
|
|
46
|
+
}
|
|
47
|
+
];
|
|
48
|
+
var SURFACE_BY_OUTPUT_TYPE = {
|
|
49
|
+
prototype: "desktop web app screen",
|
|
50
|
+
wireframe: "high-fidelity desktop screen",
|
|
51
|
+
page: "desktop web page",
|
|
52
|
+
component: "desktop screen showing the component in two or three representative contexts",
|
|
53
|
+
theme: "representative product screen showing the theme applied across navigation, type, color and components",
|
|
54
|
+
tokens: "style-guide screen showing the color, type and spacing tokens applied to real components"
|
|
55
|
+
};
|
|
56
|
+
var GPT_IMAGE_ID = /^(?:[^/]+\/)?gpt-image-(?<version>\d+(?:\.\d+)*)(?:-(?<variant>.+))?$/;
|
|
57
|
+
var PREFERRED_VARIANTS = ["flare", "sunburst"];
|
|
58
|
+
var LOWER_TIER_VARIANTS = new Set(["mini", "nano"]);
|
|
59
|
+
var PREFERRED_FALLBACK_PROVIDER = "openrouter";
|
|
60
|
+
function parseGptImageId(id) {
|
|
61
|
+
const groups = GPT_IMAGE_ID.exec(id)?.groups;
|
|
62
|
+
if (groups?.version === undefined)
|
|
63
|
+
return;
|
|
64
|
+
return { version: groups.version.split(".").map(Number), variant: groups.variant };
|
|
65
|
+
}
|
|
66
|
+
function compareVersions(left, right) {
|
|
67
|
+
const differences = Array.from({ length: Math.max(left.length, right.length) }, (_, index) => (left[index] ?? 0) - (right[index] ?? 0));
|
|
68
|
+
return differences.find((difference) => difference !== 0) ?? 0;
|
|
69
|
+
}
|
|
70
|
+
function variantRank(variant) {
|
|
71
|
+
if (variant === undefined)
|
|
72
|
+
return 0;
|
|
73
|
+
if (LOWER_TIER_VARIANTS.has(variant))
|
|
74
|
+
return -1;
|
|
75
|
+
const preferred = PREFERRED_VARIANTS.indexOf(variant);
|
|
76
|
+
return preferred === -1 ? 1 : PREFERRED_VARIANTS.length - preferred + 1;
|
|
77
|
+
}
|
|
78
|
+
function compareText(left, right) {
|
|
79
|
+
return left.localeCompare(right, "en");
|
|
80
|
+
}
|
|
81
|
+
function fallbackProviderRank(model) {
|
|
82
|
+
return model.provider === PREFERRED_FALLBACK_PROVIDER ? 0 : 1;
|
|
83
|
+
}
|
|
84
|
+
function compareImageModels(left, right) {
|
|
85
|
+
const leftGpt = parseGptImageId(left.id);
|
|
86
|
+
const rightGpt = parseGptImageId(right.id);
|
|
87
|
+
if (leftGpt !== undefined && rightGpt !== undefined) {
|
|
88
|
+
return compareVersions(rightGpt.version, leftGpt.version) || variantRank(rightGpt.variant) - variantRank(leftGpt.variant) || compareText(left.provider, right.provider) || compareText(left.id, right.id);
|
|
89
|
+
}
|
|
90
|
+
if (leftGpt !== undefined)
|
|
91
|
+
return -1;
|
|
92
|
+
if (rightGpt !== undefined)
|
|
93
|
+
return 1;
|
|
94
|
+
return fallbackProviderRank(left) - fallbackProviderRank(right) || compareText(left.provider, right.provider) || compareText(right.id, left.id);
|
|
95
|
+
}
|
|
96
|
+
function selectReferenceImageModel(available, override) {
|
|
97
|
+
const requested = override?.trim() ?? "";
|
|
98
|
+
if (requested.length > 0)
|
|
99
|
+
return available.find((model) => `${model.provider}/${model.id}` === requested);
|
|
100
|
+
return [...available].sort(compareImageModels)[0];
|
|
101
|
+
}
|
|
102
|
+
function excerpt(label, text, limit) {
|
|
103
|
+
const trimmed = text?.trim() ?? "";
|
|
104
|
+
if (trimmed.length === 0)
|
|
105
|
+
return;
|
|
106
|
+
return `${label}:
|
|
107
|
+
${trimmed.slice(0, limit).trimEnd()}`;
|
|
108
|
+
}
|
|
109
|
+
function buildReferenceImagePrompt(context, direction) {
|
|
110
|
+
return [
|
|
111
|
+
`A finished ${SURFACE_BY_OUTPUT_TYPE[context.outputType]} for: ${context.brief.trim()}`,
|
|
112
|
+
"Render the surface edge to edge with crisp, readable text and real, brief-specific content. No browser window, device, desk or poster framing, and no lorem ipsum.",
|
|
113
|
+
`Direction: ${direction.composition}`,
|
|
114
|
+
excerpt("Curated references (inspiration to adapt into this product; do not copy their layout or content)", context.curatedReferences, REFERENCES_EXCERPT_CHARS),
|
|
115
|
+
excerpt("Design system (DESIGN.md)", context.designContext, DESIGN_EXCERPT_CHARS),
|
|
116
|
+
excerpt("Product context (PRODUCT.md)", context.productContext, PRODUCT_EXCERPT_CHARS),
|
|
117
|
+
"Keep the palette, typography and component character the context describes; the direction changes only composition and emphasis."
|
|
118
|
+
].filter((section) => section !== undefined).join(`
|
|
119
|
+
|
|
120
|
+
`);
|
|
121
|
+
}
|
|
122
|
+
async function readOptionalText(path) {
|
|
123
|
+
try {
|
|
124
|
+
return await readFile(path, "utf8");
|
|
125
|
+
} catch (error) {
|
|
126
|
+
const code = error.code;
|
|
127
|
+
if (code === "ENOENT" || code === "ENOTDIR")
|
|
128
|
+
return;
|
|
129
|
+
throw error;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
var IMAGE_EXTENSIONS = new Map([
|
|
133
|
+
["image/png", "png"],
|
|
134
|
+
["image/jpeg", "jpg"],
|
|
135
|
+
["image/webp", "webp"]
|
|
136
|
+
]);
|
|
137
|
+
function firstWritableImage(output) {
|
|
138
|
+
for (const block of output) {
|
|
139
|
+
if (block.type !== "image" || block.data.length === 0)
|
|
140
|
+
continue;
|
|
141
|
+
const extension = IMAGE_EXTENSIONS.get(block.mimeType);
|
|
142
|
+
if (extension !== undefined)
|
|
143
|
+
return { data: block.data, extension };
|
|
144
|
+
}
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
async function renderDirection(input) {
|
|
148
|
+
const { provider, model, prompt, outputBase, signal } = input;
|
|
149
|
+
let result;
|
|
150
|
+
try {
|
|
151
|
+
result = await provider.generateImages(model, { input: [{ type: "text", text: prompt }] }, {
|
|
152
|
+
signal,
|
|
153
|
+
quality: "high",
|
|
154
|
+
size: IMAGE_SIZE,
|
|
155
|
+
n: 1,
|
|
156
|
+
timeoutMs: IMAGE_REQUEST_TIMEOUT_MS,
|
|
157
|
+
maxRetries: IMAGE_REQUEST_MAX_RETRIES
|
|
158
|
+
});
|
|
159
|
+
} catch {
|
|
160
|
+
signal.throwIfAborted();
|
|
161
|
+
return { failure: { reason: "unexpected-error" } };
|
|
162
|
+
}
|
|
163
|
+
signal.throwIfAborted();
|
|
164
|
+
if (result.stopReason !== "stop") {
|
|
165
|
+
return {
|
|
166
|
+
failure: {
|
|
167
|
+
reason: result.error?.code ?? "unclassified",
|
|
168
|
+
...result.error === undefined ? {} : { retryable: result.error.retryable }
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
const image = firstWritableImage(result.output);
|
|
173
|
+
if (image === undefined)
|
|
174
|
+
return {};
|
|
175
|
+
const path = `${outputBase}.${image.extension}`;
|
|
176
|
+
try {
|
|
177
|
+
await mkdir(dirname(path), { recursive: true });
|
|
178
|
+
await writeFile(path, Buffer.from(image.data, "base64"));
|
|
179
|
+
} catch {
|
|
180
|
+
return { failure: { reason: "write-failed" } };
|
|
181
|
+
}
|
|
182
|
+
return { path };
|
|
183
|
+
}
|
|
184
|
+
async function loadPromptContext(request) {
|
|
185
|
+
const [productContext, designContext] = await Promise.all([
|
|
186
|
+
readOptionalText(join(request.workflowCwd, "PRODUCT.md")),
|
|
187
|
+
readOptionalText(join(request.workflowCwd, "DESIGN.md"))
|
|
188
|
+
]);
|
|
189
|
+
return {
|
|
190
|
+
brief: request.brief,
|
|
191
|
+
outputType: request.outputType,
|
|
192
|
+
curatedReferences: request.curatedReferences,
|
|
193
|
+
productContext,
|
|
194
|
+
designContext
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
function directionOutputBase(artifactDir, index, direction) {
|
|
198
|
+
return join(artifactDir, REFERENCE_IMAGES_DIRNAME, `${String(index + 1).padStart(2, "0")}-${direction.slug}`);
|
|
199
|
+
}
|
|
200
|
+
async function renderReferenceImages(request, provider, model, signal) {
|
|
201
|
+
const promptContext = await loadPromptContext(request);
|
|
202
|
+
const outcomes = await Promise.all(REFERENCE_IMAGE_DIRECTIONS.map((direction, index) => renderDirection({
|
|
203
|
+
provider,
|
|
204
|
+
model,
|
|
205
|
+
prompt: buildReferenceImagePrompt(promptContext, direction),
|
|
206
|
+
outputBase: directionOutputBase(request.artifactDir, index, direction),
|
|
207
|
+
signal
|
|
208
|
+
})));
|
|
209
|
+
const modelId = `${model.provider}/${model.id}`;
|
|
210
|
+
const paths = outcomes.flatMap(({ path }) => path === undefined ? [] : [path]);
|
|
211
|
+
if (paths.length > 0)
|
|
212
|
+
return { status: "generated", model: modelId, paths };
|
|
213
|
+
const failure = outcomes.find((outcome) => outcome.failure !== undefined)?.failure;
|
|
214
|
+
return {
|
|
215
|
+
status: "failed",
|
|
216
|
+
reason: failure?.reason ?? "no-images-written",
|
|
217
|
+
model: modelId,
|
|
218
|
+
paths: [],
|
|
219
|
+
...failure?.retryable === undefined ? {} : { retryable: failure.retryable }
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
function skipped(reason) {
|
|
223
|
+
return { status: "skipped", reason, paths: [] };
|
|
224
|
+
}
|
|
225
|
+
async function generateReferenceImages(request, createProvider, signal) {
|
|
226
|
+
try {
|
|
227
|
+
const provider = await createProvider();
|
|
228
|
+
const available = await provider.availableImageModels(signal);
|
|
229
|
+
if (available.length === 0)
|
|
230
|
+
return skipped("no-image-model");
|
|
231
|
+
const model = selectReferenceImageModel(available, request.imageModel);
|
|
232
|
+
if (model === undefined)
|
|
233
|
+
return skipped("image-model-unavailable");
|
|
234
|
+
return await renderReferenceImages(request, provider, model, signal);
|
|
235
|
+
} catch {
|
|
236
|
+
signal.throwIfAborted();
|
|
237
|
+
return { status: "failed", reason: "unexpected-error", paths: [] };
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
async function createBuiltinReferenceImageProvider(credentials = AuthStorage.create()) {
|
|
241
|
+
const models = builtinModels({ credentials });
|
|
242
|
+
return {
|
|
243
|
+
availableImageModels: (signal) => models.getAvailableOfType("image", undefined, { signal }),
|
|
244
|
+
generateImages: (model, context, options) => models.generateImages(model, context, options)
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
async function runReferenceImagesStep(tool, request, deps = {}) {
|
|
248
|
+
const createProvider = deps.createImageProvider ?? createBuiltinReferenceImageProvider;
|
|
249
|
+
const outcome = await tool("reference-images", {
|
|
250
|
+
brief: request.brief,
|
|
251
|
+
outputType: request.outputType,
|
|
252
|
+
artifactDir: request.artifactDir,
|
|
253
|
+
...request.imageModel === undefined ? {} : { imageModel: request.imageModel }
|
|
254
|
+
}, ({ signal }) => generateReferenceImages(request, createProvider, signal), { timeoutMs: REFERENCE_IMAGES_TOOL_TIMEOUT_MS, failureMode: "return" });
|
|
255
|
+
return outcome.ok ? outcome.value : { status: "failed", reason: "tool-failed", paths: [] };
|
|
256
|
+
}
|
|
257
|
+
function existingReferenceImagePaths(status) {
|
|
258
|
+
return status.status === "generated" ? status.paths.filter((path) => existsSync(path)) : [];
|
|
259
|
+
}
|
|
8
260
|
|
|
9
261
|
// dist/builtin/workflows/builtin/open-claude-design-utils.ts
|
|
10
262
|
import { spawnSync } from "node:child_process";
|
|
11
263
|
import { mkdirSync } from "node:fs";
|
|
12
264
|
import { tmpdir, userInfo } from "node:os";
|
|
13
|
-
import { join } from "node:path";
|
|
14
|
-
import { Type } from "typebox";
|
|
265
|
+
import { dirname as dirname2, join as join2, relative, sep } from "node:path";
|
|
266
|
+
import { Type as Type2 } from "typebox";
|
|
15
267
|
import { createChildProcessEnvironment } from "@bastani/atomic";
|
|
16
268
|
var OUTPUT_TYPES = [
|
|
17
269
|
"prototype",
|
|
@@ -38,10 +290,10 @@ function normalizeOutputType(value) {
|
|
|
38
290
|
function shouldEarlyExitForBrowser(browserAvailable, nodeEnv) {
|
|
39
291
|
return !browserAvailable && nodeEnv !== "test";
|
|
40
292
|
}
|
|
41
|
-
var discoveryDecisionSchema =
|
|
42
|
-
brief:
|
|
43
|
-
output_type:
|
|
44
|
-
references:
|
|
293
|
+
var discoveryDecisionSchema = Type2.Object({
|
|
294
|
+
brief: Type2.String(),
|
|
295
|
+
output_type: Type2.Union([...OUTPUT_TYPES].map((value) => Type2.Literal(value))),
|
|
296
|
+
references: Type2.Array(Type2.String())
|
|
45
297
|
}, { additionalProperties: false });
|
|
46
298
|
function discoveryDecisionFromResult(result, fallbackBrief) {
|
|
47
299
|
const decision = result.structured;
|
|
@@ -53,6 +305,12 @@ function discoveryDecisionFromResult(result, fallbackBrief) {
|
|
|
53
305
|
references
|
|
54
306
|
};
|
|
55
307
|
}
|
|
308
|
+
function referenceImageFileUrl(path) {
|
|
309
|
+
return `file://${path}`;
|
|
310
|
+
}
|
|
311
|
+
function referenceImageRelativeSrc(specPath, imagePath) {
|
|
312
|
+
return relative(dirname2(specPath), imagePath).split(sep).join("/");
|
|
313
|
+
}
|
|
56
314
|
function joinResults(results) {
|
|
57
315
|
return results.map((result) => `### ${result.name}
|
|
58
316
|
|
|
@@ -67,32 +325,32 @@ function tmpArtifactBase() {
|
|
|
67
325
|
try {
|
|
68
326
|
user = userInfo().username.replace(/[^A-Za-z0-9._-]/g, "_") || "default";
|
|
69
327
|
} catch {}
|
|
70
|
-
return
|
|
328
|
+
return join2(tmpdir(), `open-claude-design-${user}`);
|
|
71
329
|
}
|
|
72
330
|
function prepareArtifactDir(cwd = process.cwd()) {
|
|
73
331
|
const runId = `${new Date().toISOString().replace(/[:.]/g, "-")}-${Math.random().toString(36).slice(2, 8)}`;
|
|
74
332
|
const tmpCandidates = [
|
|
75
|
-
|
|
76
|
-
|
|
333
|
+
join2(tmpArtifactBase(), runId),
|
|
334
|
+
join2(tmpdir(), "open-claude-design", runId)
|
|
77
335
|
];
|
|
78
|
-
const candidates = process.env.NODE_ENV === "test" ? tmpCandidates : [
|
|
336
|
+
const candidates = process.env.NODE_ENV === "test" ? tmpCandidates : [join2(cwd, "specs", "design", runId), ...tmpCandidates];
|
|
79
337
|
for (const candidate of candidates) {
|
|
80
338
|
try {
|
|
81
339
|
mkdirSync(candidate, { recursive: true });
|
|
82
340
|
return {
|
|
83
341
|
runId,
|
|
84
342
|
artifactDir: candidate,
|
|
85
|
-
previewPath:
|
|
86
|
-
specPath:
|
|
343
|
+
previewPath: join2(candidate, "preview.html"),
|
|
344
|
+
specPath: join2(candidate, "spec.html")
|
|
87
345
|
};
|
|
88
346
|
} catch {}
|
|
89
347
|
}
|
|
90
|
-
const fallback =
|
|
348
|
+
const fallback = join2(tmpArtifactBase(), runId);
|
|
91
349
|
return {
|
|
92
350
|
runId,
|
|
93
351
|
artifactDir: fallback,
|
|
94
|
-
previewPath:
|
|
95
|
-
specPath:
|
|
352
|
+
previewPath: join2(fallback, "preview.html"),
|
|
353
|
+
specPath: join2(fallback, "spec.html")
|
|
96
354
|
};
|
|
97
355
|
}
|
|
98
356
|
var HTML_PREVIEW_RULES = [
|
|
@@ -382,9 +640,18 @@ ${input.event.raw}
|
|
|
382
640
|
`);
|
|
383
641
|
}
|
|
384
642
|
function buildLiveSessionStartPrompt(input) {
|
|
643
|
+
const referenceImagePaths = input.referenceImagePaths ?? [];
|
|
385
644
|
return [
|
|
386
645
|
`<preview_path>${input.previewPath}</preview_path>`,
|
|
387
646
|
`<preview_file_url>${input.previewFileUrl}</preview_file_url>`,
|
|
647
|
+
...referenceImagePaths.length > 0 ? [
|
|
648
|
+
[
|
|
649
|
+
"<reference_images>",
|
|
650
|
+
...referenceImagePaths.map((path) => `${path} (${referenceImageFileUrl(path)})`),
|
|
651
|
+
"</reference_images>"
|
|
652
|
+
].join(`
|
|
653
|
+
`)
|
|
654
|
+
] : [],
|
|
388
655
|
`<browser_use_guidelines>${input.browserBootstrapRules}</browser_use_guidelines>`,
|
|
389
656
|
"<role>You are an opinionated staff design engineer opening an impeccable `live` review session.</role>",
|
|
390
657
|
[
|
|
@@ -399,6 +666,9 @@ function buildLiveSessionStartPrompt(input) {
|
|
|
399
666
|
"2. Print the live `http://` review URL in plain text, plus the preview file URL as the manual fallback, so anyone attaching to this run can find the review.",
|
|
400
667
|
"3. Directly under the URL, print how the user ends the review, in plain text: click exit in the Impeccable overlay, close the browser tab, or say `exit live`. State that the review waits indefinitely until they do, and that ending it exports the design as it then stands, with no further round.",
|
|
401
668
|
"4. Do NOT start a poll loop. The workflow owns polling and will call you back for each event that needs you. Ending your turn does not end the review.",
|
|
669
|
+
...referenceImagePaths.length > 0 ? [
|
|
670
|
+
"5. Under the review URL, also print each <reference_images> path and file URL in plain text, labelled as the AI-generated design directions the preview was built from, so the user can open them beside the preview. Leave the live review tab on the preview."
|
|
671
|
+
] : [],
|
|
402
672
|
"</instructions>"
|
|
403
673
|
].join(`
|
|
404
674
|
`),
|
|
@@ -410,7 +680,7 @@ function buildLiveSessionStartPrompt(input) {
|
|
|
410
680
|
|
|
411
681
|
// dist/builtin/workflows/builtin/open-claude-design-setup.ts
|
|
412
682
|
import { mkdirSync as mkdirSync2, writeFileSync } from "node:fs";
|
|
413
|
-
import { join as
|
|
683
|
+
import { join as join3 } from "node:path";
|
|
414
684
|
var GROUNDED_REPORTING = "Before reporting progress, audit each claim against a tool result from this session. Report only work you can point to evidence for; say so explicitly when something is unverified.";
|
|
415
685
|
function renderDiscoveryContext(discovery) {
|
|
416
686
|
return [
|
|
@@ -486,10 +756,10 @@ var NO_REFERENCES_BRIEF = "Reference discovery was skipped. Generate from the pr
|
|
|
486
756
|
var DESIGN_CONTEXT_FILENAME = "design-context.md";
|
|
487
757
|
var REFERENCES_BRIEF_FILENAME = "references.md";
|
|
488
758
|
function designContextPath(artifactDir) {
|
|
489
|
-
return
|
|
759
|
+
return join3(artifactDir, DESIGN_CONTEXT_FILENAME);
|
|
490
760
|
}
|
|
491
761
|
function referencesBriefPath(artifactDir) {
|
|
492
|
-
return
|
|
762
|
+
return join3(artifactDir, REFERENCES_BRIEF_FILENAME);
|
|
493
763
|
}
|
|
494
764
|
function buildReferenceDiscoveryPrompt(args) {
|
|
495
765
|
const siteList = REFERENCE_DESIGN_SITES.map((site, index) => `${index + 1}. ${site.name} — ${site.url}`).join(`
|
|
@@ -515,8 +785,8 @@ function buildReferenceDiscoveryPrompt(args) {
|
|
|
515
785
|
[
|
|
516
786
|
"Use the agent-browser skill to open each gallery; if `agent-browser` reports a missing browser executable, follow the bootstrap rules and retry once.",
|
|
517
787
|
"From each gallery, choose 1-3 fitting designs and CLICK INTO each actual live or project-detail page; do not capture only the grid or thumbnail.",
|
|
518
|
-
`Capture motion across the entire page: start \`agent-browser record start ${
|
|
519
|
-
`Also run \`agent-browser screenshot ${
|
|
788
|
+
`Capture motion across the entire page: start \`agent-browser record start ${join3(args.artifactDir, "ref-<site>-<n>.webm")}\`, scroll smoothly in small increments with waits (using repeated \`agent-browser scroll down 600\` or \`agent-browser mouse wheel 600\`) so animations fire and lazy content loads, then run \`agent-browser record stop\`.`,
|
|
789
|
+
`Also run \`agent-browser screenshot ${join3(args.artifactDir, "ref-<site>-<n>.png")} --full\`; this still is the minimum when video is unavailable.`,
|
|
520
790
|
"Record the actual destination URL, title, and author. For each reference, cite observed layout, typography, color, spacing, and motion traits rather than inferred traits.",
|
|
521
791
|
"Assess fit against DESIGN.md, PRODUCT.md, and the ds-* discovery evidence in the design-context file; prefer on-brand references and flag departures.",
|
|
522
792
|
"Use ask_user_question to ask which reference direction they prefer, offering 2-4 strongest options plus `None of these fit`. If none fit, ask them to provide a reference image, screenshot, URL, or local file path and record the answer.",
|
|
@@ -560,11 +830,17 @@ var LIVE_REVIEW_GATE_OPTIONS = [
|
|
|
560
830
|
"Skip remaining review rounds and export as-is"
|
|
561
831
|
];
|
|
562
832
|
function buildLiveReviewGateMessage(args) {
|
|
833
|
+
const referenceImagePaths = args.referenceImagePaths ?? [];
|
|
563
834
|
return [
|
|
564
835
|
`Design review session ${args.round} is ready for your browser review.`,
|
|
565
836
|
"",
|
|
566
837
|
`Preview file: ${args.previewPath}`,
|
|
567
838
|
`Preview URL: ${args.previewFileUrl}`,
|
|
839
|
+
...referenceImagePaths.length > 0 ? [
|
|
840
|
+
"",
|
|
841
|
+
"Reference images (AI-generated design directions the preview was built from):",
|
|
842
|
+
...referenceImagePaths.map((path) => `- ${path} (${referenceImageFileUrl(path)})`)
|
|
843
|
+
] : [],
|
|
568
844
|
"",
|
|
569
845
|
`"${LIVE_REVIEW_GATE_OPTIONS[0]}" opens an interactive browser session; the session-start stage prints the live http:// review URL as soon as its server is up (attach with /workflow connect to see it, or open the preview URL above directly).`,
|
|
570
846
|
"The session is unbounded: pick elements, accept variants, and steer for as long as you like, and everything you accept lands in the preview as you go.",
|
|
@@ -586,7 +862,7 @@ function forkContinuationOptions(sessionId) {
|
|
|
586
862
|
return sessionId === undefined ? {} : { context: "fork", forkFromSessionId: sessionId };
|
|
587
863
|
}
|
|
588
864
|
async function refineOpenClaudeDesign(options) {
|
|
589
|
-
const { designContext, prompt, outputType, previewPath, previewFileUrl, browserBootstrapRules, designContextFile, referencesFile, designModelConfig, workflowCwd } = options;
|
|
865
|
+
const { designContext, prompt, outputType, previewPath, previewFileUrl, browserBootstrapRules, designContextFile, referencesFile, referenceImagePaths, designModelConfig, workflowCwd } = options;
|
|
590
866
|
const importContext = options.importContext ?? "";
|
|
591
867
|
const generated = await designContext.task("generate-1", {
|
|
592
868
|
prompt: buildInitialGeneratePrompt({
|
|
@@ -595,12 +871,14 @@ async function refineOpenClaudeDesign(options) {
|
|
|
595
871
|
previewPath,
|
|
596
872
|
designContextFile,
|
|
597
873
|
referencesFile,
|
|
874
|
+
referenceImagePaths,
|
|
598
875
|
importContext
|
|
599
876
|
}),
|
|
600
|
-
reads: [designContextFile, referencesFile],
|
|
877
|
+
reads: [designContextFile, referencesFile, ...referenceImagePaths],
|
|
878
|
+
...referenceImagePaths.length > 0 ? { taskNeeds: { needsImages: true } } : {},
|
|
601
879
|
...designModelConfig
|
|
602
880
|
});
|
|
603
|
-
const gateChoice = await options.ui.select(buildLiveReviewGateMessage({ round: 1, previewPath, previewFileUrl }), LIVE_REVIEW_GATE_OPTIONS).catch((error) => {
|
|
881
|
+
const gateChoice = await options.ui.select(buildLiveReviewGateMessage({ round: 1, previewPath, previewFileUrl, referenceImagePaths }), LIVE_REVIEW_GATE_OPTIONS).catch((error) => {
|
|
604
882
|
if (isUiUnavailableRejection(error))
|
|
605
883
|
return LIVE_REVIEW_GATE_OPTIONS[0];
|
|
606
884
|
throw error;
|
|
@@ -612,6 +890,7 @@ async function refineOpenClaudeDesign(options) {
|
|
|
612
890
|
reviewStageName: "user-feedback-1",
|
|
613
891
|
previewPath,
|
|
614
892
|
previewFileUrl,
|
|
893
|
+
referenceImagePaths,
|
|
615
894
|
browserBootstrapRules,
|
|
616
895
|
designModelConfig,
|
|
617
896
|
workflowCwd
|
|
@@ -620,10 +899,10 @@ async function refineOpenClaudeDesign(options) {
|
|
|
620
899
|
return { latestDesign: generated.text };
|
|
621
900
|
}
|
|
622
901
|
async function runLiveReviewSession(options) {
|
|
623
|
-
const { designContext, round, reviewStageName, previewPath, previewFileUrl, browserBootstrapRules, designModelConfig, workflowCwd } = options;
|
|
902
|
+
const { designContext, round, reviewStageName, previewPath, previewFileUrl, referenceImagePaths, browserBootstrapRules, designModelConfig, workflowCwd } = options;
|
|
624
903
|
let sessionId;
|
|
625
904
|
const start = await designContext.task(`${reviewStageName}-start`, {
|
|
626
|
-
prompt: buildLiveSessionStartPrompt({ previewPath, previewFileUrl, browserBootstrapRules, round }),
|
|
905
|
+
prompt: buildLiveSessionStartPrompt({ previewPath, previewFileUrl, referenceImagePaths, browserBootstrapRules, round }),
|
|
627
906
|
...designModelConfig
|
|
628
907
|
});
|
|
629
908
|
sessionId = start.sessionId;
|
|
@@ -647,6 +926,7 @@ async function runLiveReviewSession(options) {
|
|
|
647
926
|
}
|
|
648
927
|
}
|
|
649
928
|
function buildInitialGeneratePrompt(args) {
|
|
929
|
+
const hasReferenceImages = args.referenceImagePaths.length > 0;
|
|
650
930
|
return taggedPrompt([
|
|
651
931
|
["design_brief", args.prompt],
|
|
652
932
|
[
|
|
@@ -658,6 +938,7 @@ function buildInitialGeneratePrompt(args) {
|
|
|
658
938
|
"reference_inspiration_file",
|
|
659
939
|
`Read the file at ${args.referencesFile} for the curated reference inspiration to heavily emulate.`
|
|
660
940
|
],
|
|
941
|
+
...hasReferenceImages ? [["reference_images", renderReferenceImagesForGeneration(args.referenceImagePaths)]] : [],
|
|
661
942
|
["reference_precedence", REFERENCE_PRECEDENCE],
|
|
662
943
|
["preview_artifact_path", args.previewPath],
|
|
663
944
|
["html_rules", HTML_PREVIEW_RULES],
|
|
@@ -673,6 +954,7 @@ function buildInitialGeneratePrompt(args) {
|
|
|
673
954
|
`First read the design-context and reference-inspiration files named above; they are the design system and reference authority for every decision. If a file is missing, say so and proceed from the brief.`,
|
|
674
955
|
`Create the HTML artifact exactly at ${args.previewPath}.`,
|
|
675
956
|
"Follow <reference_precedence>; heavily reference the reference-inspiration file without copying wholesale or inventing traits.",
|
|
957
|
+
...hasReferenceImages ? [REFERENCE_IMAGE_GENERATION_RULE] : [],
|
|
676
958
|
`Build the requested output_type (${args.outputType}): render full realistic layouts for prototypes/pages, or the component in at least three representative contexts.`,
|
|
677
959
|
"Include structure, states, accessibility, responsive behavior, and integration notes as HTML comments so the preview stays clean.",
|
|
678
960
|
"Use project language rather than generic placeholders when conventions exist. Add no features or abstractions beyond this design brief."
|
|
@@ -695,9 +977,30 @@ function buildInitialGeneratePrompt(args) {
|
|
|
695
977
|
]
|
|
696
978
|
]);
|
|
697
979
|
}
|
|
980
|
+
var REFERENCE_IMAGE_GENERATION_RULE = "Open every file listed in <reference_images> with the read tool before designing. They are illustrations of distinct visual directions for this brief. Choose the direction that best serves the brief and the references, say which one in your overview, and match its composition, palette, type character, density, and imagery stance in the HTML; borrow from the other directions only where they agree. Do not copy text from the images or invent content from them: <reference_precedence> still wins on any conflict. If an image cannot be read, say so and continue from the other context.";
|
|
981
|
+
var REFERENCE_IMAGE_EXPORT_RULE = 'Add a "Design References" section after the Live Preview that shows every file listed in <reference_images> as `<img src="..." alt="...">` using the relative src given for it, with a caption naming its direction and a note that these are AI-generated illustrations rather than specifications. This is the one exception to the self-contained rule: link the image files by relative path and never inline their data into the HTML.';
|
|
982
|
+
function renderReferenceImageList(paths) {
|
|
983
|
+
return paths.map((path) => `- ${path}`).join(`
|
|
984
|
+
`);
|
|
985
|
+
}
|
|
986
|
+
function renderReferenceImagesForGeneration(paths) {
|
|
987
|
+
return [
|
|
988
|
+
"AI-generated design reference images for this brief, one per visual direction (named by file). They were rendered from the brief, PRODUCT.md/DESIGN.md, and the curated references.",
|
|
989
|
+
renderReferenceImageList(paths)
|
|
990
|
+
].join(`
|
|
991
|
+
`);
|
|
992
|
+
}
|
|
993
|
+
function renderReferenceImagesForExport(specPath, paths) {
|
|
994
|
+
return [
|
|
995
|
+
"AI-generated design reference images, one per visual direction (named by file), stored next to the spec. They are illustrations, not specifications.",
|
|
996
|
+
...paths.map((path) => `- ${path} (src="${referenceImageRelativeSrc(specPath, path)}")`)
|
|
997
|
+
].join(`
|
|
998
|
+
`);
|
|
999
|
+
}
|
|
698
1000
|
async function exportOpenClaudeDesign(options) {
|
|
699
|
-
const { designContext, prompt, outputType, previewPath, previewFileUrl, specPath, specFileUrl, browserBootstrapRules, designContextFile, referencesFile, designModelConfig } = options;
|
|
1001
|
+
const { designContext, prompt, outputType, previewPath, previewFileUrl, specPath, specFileUrl, browserBootstrapRules, designContextFile, referencesFile, referenceImagePaths, designModelConfig } = options;
|
|
700
1002
|
const latestDesign = options.latestDesign;
|
|
1003
|
+
const hasReferenceImages = referenceImagePaths.length > 0;
|
|
701
1004
|
const handoff = await designContext.task("exporter", {
|
|
702
1005
|
reads: [designContextFile, referencesFile],
|
|
703
1006
|
prompt: taggedPrompt([
|
|
@@ -711,6 +1014,7 @@ async function exportOpenClaudeDesign(options) {
|
|
|
711
1014
|
],
|
|
712
1015
|
["preview_artifact_path", previewPath],
|
|
713
1016
|
["spec_artifact_path", specPath],
|
|
1017
|
+
...hasReferenceImages ? [["reference_images", renderReferenceImagesForExport(specPath, referenceImagePaths)]] : [],
|
|
714
1018
|
["final_design_summary", "{previous}"],
|
|
715
1019
|
["html_rules", HTML_PREVIEW_RULES],
|
|
716
1020
|
["anti_design_slop_rules", ANTI_SLOP_RULES],
|
|
@@ -725,7 +1029,8 @@ async function exportOpenClaudeDesign(options) {
|
|
|
725
1029
|
"First read the design-context file named above, then read preview_artifact_path as the canonical final design, and use the Write tool to create one self-contained HTML5 file at spec_artifact_path.",
|
|
726
1030
|
'In order, include: sticky header with title/status/run id; Executive Summary; Live Preview embedding the full preview via `<iframe srcdoc="...">` or a side-by-side rendered copy in `<article class="preview-frame">`; the six DESIGN.md sections (Overview, Colors, Typography, Elevation, Components, Do\'s and Don\'ts) rendered with swatches, tables, and code blocks; Implementation handoff (Recommended files + components, Implementation steps, Usage example, Accessibility & responsive checklist, Validation commands, Known limitations); and an appendix linking the raw preview path.',
|
|
727
1031
|
"Use dense legible typography, generous whitespace, monospaced code, rendered hex/oklch swatches, and copy-to-clipboard hints in HTML comments.",
|
|
728
|
-
`Show the absolute preview path (${previewPath}) and file URL (${previewFileUrl}) prominently. Preserve assumptions and limitations; introduce no requirement absent from the final design or DESIGN.md
|
|
1032
|
+
`Show the absolute preview path (${previewPath}) and file URL (${previewFileUrl}) prominently. Preserve assumptions and limitations; introduce no requirement absent from the final design or DESIGN.md.`,
|
|
1033
|
+
...hasReferenceImages ? [REFERENCE_IMAGE_EXPORT_RULE] : []
|
|
729
1034
|
].join(`
|
|
730
1035
|
`)
|
|
731
1036
|
],
|
|
@@ -789,7 +1094,7 @@ async function exportOpenClaudeDesign(options) {
|
|
|
789
1094
|
// dist/builtin/workflows/builtin/open-claude-design-runner.ts
|
|
790
1095
|
var GROUNDED_REPORTING3 = "Before reporting progress, audit each claim against a tool result from this session. Report only work you can point to evidence for; say so explicitly when something is unverified.";
|
|
791
1096
|
var DELEGATION_RULE = "Delegate further only work genuinely independent and too large for a handful of tool calls; do not delegate self-verification, and prefer one subagent over several.";
|
|
792
|
-
async function runOpenClaudeDesignWorkflow(ctx) {
|
|
1097
|
+
async function runOpenClaudeDesignWorkflow(ctx, deps = {}) {
|
|
793
1098
|
const designContext = ctx;
|
|
794
1099
|
const agentBrowser = ensureAgentBrowser();
|
|
795
1100
|
const browserBootstrapRules = buildAgentBrowserBootstrapRules(agentBrowser);
|
|
@@ -978,6 +1283,15 @@ async function runOpenClaudeDesignWorkflow(ctx) {
|
|
|
978
1283
|
"Full design-system and reference evidence: read the design-context file."
|
|
979
1284
|
].join(`
|
|
980
1285
|
`) : "No user reference was provided; infer the design direction from the brief, project design context, research, and curated reference inspiration.";
|
|
1286
|
+
const referenceImages = await runReferenceImagesStep(designContext.tool, {
|
|
1287
|
+
brief: designBrief,
|
|
1288
|
+
outputType,
|
|
1289
|
+
artifactDir,
|
|
1290
|
+
workflowCwd,
|
|
1291
|
+
curatedReferences: referencesBriefRaw,
|
|
1292
|
+
imageModel: inputs.image_model
|
|
1293
|
+
}, deps);
|
|
1294
|
+
const referenceImagePaths = existingReferenceImagePaths(referenceImages);
|
|
981
1295
|
const refinement = await refineOpenClaudeDesign({
|
|
982
1296
|
designContext,
|
|
983
1297
|
prompt: designBrief,
|
|
@@ -987,6 +1301,7 @@ async function runOpenClaudeDesignWorkflow(ctx) {
|
|
|
987
1301
|
browserBootstrapRules,
|
|
988
1302
|
designContextFile,
|
|
989
1303
|
referencesFile,
|
|
1304
|
+
referenceImagePaths,
|
|
990
1305
|
designModelConfig,
|
|
991
1306
|
workflowCwd,
|
|
992
1307
|
importContext,
|
|
@@ -1004,6 +1319,7 @@ async function runOpenClaudeDesignWorkflow(ctx) {
|
|
|
1004
1319
|
browserBootstrapRules,
|
|
1005
1320
|
designContextFile,
|
|
1006
1321
|
referencesFile,
|
|
1322
|
+
referenceImagePaths,
|
|
1007
1323
|
latestDesign,
|
|
1008
1324
|
designModelConfig
|
|
1009
1325
|
});
|
|
@@ -1020,7 +1336,8 @@ async function runOpenClaudeDesignWorkflow(ctx) {
|
|
|
1020
1336
|
preview_file_url: previewFileUrl,
|
|
1021
1337
|
spec_path: specPath,
|
|
1022
1338
|
spec_file_url: specFileUrl,
|
|
1023
|
-
agent_browser_status: agentBrowser.summary
|
|
1339
|
+
agent_browser_status: agentBrowser.summary,
|
|
1340
|
+
reference_images_status: referenceImages
|
|
1024
1341
|
};
|
|
1025
1342
|
}
|
|
1026
1343
|
|
|
@@ -1030,27 +1347,31 @@ var open_claude_design_default = workflow({
|
|
|
1030
1347
|
description: "AI-powered design workflow: combined discovery/init → design-system/reference research → curated reference discovery → HTML generation → one live review session → rich HTML handoff. The discovery stage asks what to build, the output type, and which references to emulate, then runs impeccable init for PRODUCT.md/DESIGN.md (references take precedence over project context). The user reviews the generated HTML in one live session.",
|
|
1031
1348
|
heartbeatIntervalMinutes: 0,
|
|
1032
1349
|
inputs: {
|
|
1033
|
-
prompt:
|
|
1350
|
+
prompt: Type3.String({
|
|
1034
1351
|
description: "What to design (for example, a dashboard, page, component, or prototype). The discovery stage refines this into a confirmed brief and asks for the output type and references."
|
|
1035
1352
|
}),
|
|
1036
|
-
discover_references:
|
|
1353
|
+
discover_references: Type3.Boolean({
|
|
1037
1354
|
default: true,
|
|
1038
1355
|
description: "Discover beautiful, current reference designs from notable design websites (Awwwards, recent.design, Dribbble, Monet, Motionsites) and feed them to generation. Set false to skip the network/browser reference pass."
|
|
1039
|
-
})
|
|
1356
|
+
}),
|
|
1357
|
+
image_model: Type3.Optional(Type3.String({
|
|
1358
|
+
description: "Image model for design reference images, as provider/id (for example openai-images/gpt-image-2.6-flare). Defaults to the newest available GPT Image model, then other image providers such as OpenRouter. Reference images are skipped when no image model is available."
|
|
1359
|
+
}))
|
|
1040
1360
|
},
|
|
1041
1361
|
outputs: {
|
|
1042
|
-
output_type:
|
|
1043
|
-
design_system:
|
|
1044
|
-
artifact:
|
|
1045
|
-
handoff:
|
|
1046
|
-
import_context:
|
|
1047
|
-
run_id:
|
|
1048
|
-
artifact_dir:
|
|
1049
|
-
preview_path:
|
|
1050
|
-
preview_file_url:
|
|
1051
|
-
spec_path:
|
|
1052
|
-
spec_file_url:
|
|
1053
|
-
agent_browser_status:
|
|
1362
|
+
output_type: Type3.Optional(Type3.String({ description: "Kind of design artifact produced." })),
|
|
1363
|
+
design_system: Type3.Optional(Type3.String({ description: "Design system source used for generation: the project-derived design system." })),
|
|
1364
|
+
artifact: Type3.Optional(Type3.String({ description: "Latest final design summary from the final preview artifact." })),
|
|
1365
|
+
handoff: Type3.Optional(Type3.String({ description: "Final rich HTML spec and implementation handoff summary." })),
|
|
1366
|
+
import_context: Type3.Optional(Type3.String({ description: "Reference-import context used during generation." })),
|
|
1367
|
+
run_id: Type3.Optional(Type3.String({ description: "Per-run design workflow artifact identifier." })),
|
|
1368
|
+
artifact_dir: Type3.Optional(Type3.String({ description: "Directory containing preview and spec artifacts." })),
|
|
1369
|
+
preview_path: Type3.Optional(Type3.String({ description: "Absolute path to the generated preview.html file." })),
|
|
1370
|
+
preview_file_url: Type3.Optional(Type3.String({ description: "file:// URL for the generated preview.html file." })),
|
|
1371
|
+
spec_path: Type3.Optional(Type3.String({ description: "Absolute path to the generated spec.html file." })),
|
|
1372
|
+
spec_file_url: Type3.Optional(Type3.String({ description: "file:// URL for the generated spec.html file." })),
|
|
1373
|
+
agent_browser_status: Type3.Optional(Type3.String({ description: "Outcome of the initial deterministic step that ensures the agent-browser skill's `agent-browser` command is installed." })),
|
|
1374
|
+
reference_images_status: Type3.Optional(referenceImagesStatusSchema)
|
|
1054
1375
|
},
|
|
1055
1376
|
run: async (ctx) => await runOpenClaudeDesignWorkflow(withBuiltinContext(ctx))
|
|
1056
1377
|
});
|