@bastani/atomic 0.9.13 → 0.9.14-alpha.2
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 +58 -0
- package/README.md +3 -3
- package/dist/builtin/intercom/package.json +2 -2
- package/dist/builtin/mcp/package.json +3 -3
- package/dist/builtin/subagents/CHANGELOG.md +14 -0
- package/dist/builtin/subagents/README.md +6 -4
- package/dist/builtin/subagents/agents/code-simplifier.md +1 -1
- package/dist/builtin/subagents/agents/codebase-analyzer.md +1 -1
- package/dist/builtin/subagents/agents/codebase-locator.md +1 -1
- package/dist/builtin/subagents/agents/codebase-online-researcher.md +1 -1
- package/dist/builtin/subagents/agents/codebase-pattern-finder.md +1 -1
- package/dist/builtin/subagents/agents/codebase-research-analyzer.md +1 -1
- package/dist/builtin/subagents/agents/codebase-research-locator.md +1 -1
- package/dist/builtin/subagents/agents/debugger.md +1 -1
- package/dist/builtin/subagents/agents/worker.md +1 -1
- package/dist/builtin/subagents/package.json +6 -5
- package/dist/builtin/subagents/src/agents/agent-discovery.ts +17 -11
- package/dist/builtin/subagents/src/agents/agent-loaders.ts +115 -43
- package/dist/builtin/subagents/src/agents/agent-management-helpers.ts +10 -8
- package/dist/builtin/subagents/src/agents/agent-management.ts +8 -7
- package/dist/builtin/subagents/src/agents/agent-overrides.ts +2 -2
- package/dist/builtin/subagents/src/agents/agent-scope.ts +1 -1
- package/dist/builtin/subagents/src/agents/agent-selection.ts +1 -1
- package/dist/builtin/subagents/src/agents/agent-serializer.ts +24 -3
- package/dist/builtin/subagents/src/agents/agent-types.ts +3 -1
- package/dist/builtin/subagents/src/agents/agents.ts +7 -5
- package/dist/builtin/subagents/src/agents/frontmatter.ts +67 -22
- package/dist/builtin/subagents/src/agents/identity.ts +1 -1
- package/dist/builtin/subagents/src/agents/skills-paths.ts +1 -1
- package/dist/builtin/subagents/src/agents/skills.ts +64 -6
- package/dist/builtin/subagents/src/extension/config.ts +1 -1
- package/dist/builtin/subagents/src/extension/control-notices.ts +2 -2
- package/dist/builtin/subagents/src/extension/doctor.ts +15 -5
- package/dist/builtin/subagents/src/extension/fanout-child.ts +12 -12
- package/dist/builtin/subagents/src/extension/index.ts +23 -23
- package/dist/builtin/subagents/src/extension/notification-content.ts +1 -1
- package/dist/builtin/subagents/src/extension/schemas.ts +1 -1
- package/dist/builtin/subagents/src/extension/startup-maintenance.ts +3 -3
- package/dist/builtin/subagents/src/intercom/intercom-bridge.ts +3 -3
- package/dist/builtin/subagents/src/intercom/result-intercom.ts +1 -1
- package/dist/builtin/subagents/src/intercom/supervisor-authorization.ts +1 -1
- package/dist/builtin/subagents/src/runs/foreground/completion-notification.ts +2 -2
- package/dist/builtin/subagents/src/runs/foreground/execution-detach-reservations.ts +1 -1
- package/dist/builtin/subagents/src/runs/foreground/execution-intercom-detach.ts +3 -3
- package/dist/builtin/subagents/src/runs/foreground/execution-run-sync.ts +1 -1
- package/dist/builtin/subagents/src/runs/foreground/execution-updates.ts +2 -2
- package/dist/builtin/subagents/src/runs/foreground/execution-utils.ts +1 -1
- package/dist/builtin/subagents/src/runs/foreground/execution.ts +2 -2
- package/dist/builtin/subagents/src/runs/foreground/inprocess-run-sync.ts +27 -11
- package/dist/builtin/subagents/src/runs/foreground/notify.ts +3 -3
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-context.ts +11 -11
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-input.ts +3 -3
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-parallel-task.ts +15 -14
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-parallel.ts +19 -19
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-runtime.ts +2 -2
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-single.ts +14 -13
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-status.ts +9 -9
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-types.ts +7 -7
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-worktree.ts +6 -6
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor.ts +24 -23
- package/dist/builtin/subagents/src/runs/inprocess/control-registry.ts +1 -1
- package/dist/builtin/subagents/src/runs/inprocess/control-status.ts +3 -3
- package/dist/builtin/subagents/src/runs/inprocess/index.ts +3 -3
- package/dist/builtin/subagents/src/runs/inprocess/prompt-behavior.ts +17 -8
- package/dist/builtin/subagents/src/runs/inprocess/runner.ts +60 -12
- package/dist/builtin/subagents/src/runs/inprocess/runtime-support/nested-api.ts +8 -8
- package/dist/builtin/subagents/src/runs/inprocess/runtime-support/nested-control.ts +3 -3
- package/dist/builtin/subagents/src/runs/inprocess/runtime-support/nested-core.ts +4 -4
- package/dist/builtin/subagents/src/runs/inprocess/runtime-support/nested-projection.ts +4 -4
- package/dist/builtin/subagents/src/runs/inprocess/runtime-support/nested-registry.ts +5 -5
- package/dist/builtin/subagents/src/runs/inprocess/runtime-support/nested-rendering.ts +3 -3
- package/dist/builtin/subagents/src/runs/inprocess/runtime-support/nested-sanitize.ts +3 -3
- package/dist/builtin/subagents/src/runs/inprocess.ts +1 -1
- package/dist/builtin/subagents/src/runs/shared/long-running-guard.ts +1 -1
- package/dist/builtin/subagents/src/runs/shared/mcp-direct-tool-allowlist.ts +1 -1
- package/dist/builtin/subagents/src/runs/shared/model-candidate-filter.ts +3 -3
- package/dist/builtin/subagents/src/runs/shared/model-fallback.ts +2 -2
- package/dist/builtin/subagents/src/runs/shared/parallel-utils.ts +1 -1
- package/dist/builtin/subagents/src/runs/shared/single-output.ts +1 -1
- package/dist/builtin/subagents/src/runs/shared/subagent-control.ts +1 -1
- package/dist/builtin/subagents/src/shared/artifacts.ts +2 -2
- package/dist/builtin/subagents/src/shared/event-jsonl-writer.ts +1 -1
- package/dist/builtin/subagents/src/shared/fast-mode.ts +1 -1
- package/dist/builtin/subagents/src/shared/formatters.ts +2 -2
- package/dist/builtin/subagents/src/shared/jsonl-writer.ts +1 -1
- package/dist/builtin/subagents/src/shared/model-resolution.ts +1 -1
- package/dist/builtin/subagents/src/shared/session-tokens.ts +1 -1
- package/dist/builtin/subagents/src/shared/settings.ts +4 -4
- package/dist/builtin/subagents/src/shared/status-format.ts +1 -1
- package/dist/builtin/subagents/src/shared/types-config.ts +16 -4
- package/dist/builtin/subagents/src/shared/types-depth.ts +1 -1
- package/dist/builtin/subagents/src/shared/types-nested.ts +1 -1
- package/dist/builtin/subagents/src/shared/types-output.ts +1 -1
- package/dist/builtin/subagents/src/shared/types-results.ts +1 -1
- package/dist/builtin/subagents/src/shared/types-runtime.ts +1 -1
- package/dist/builtin/subagents/src/shared/types.ts +6 -6
- package/dist/builtin/subagents/src/shared/utils.ts +3 -3
- package/dist/builtin/subagents/src/slash/prompt-template-bridge.ts +1 -1
- package/dist/builtin/subagents/src/slash/slash-bridge.ts +3 -3
- package/dist/builtin/subagents/src/slash/slash-commands.ts +6 -6
- package/dist/builtin/subagents/src/slash/slash-live-state.ts +3 -3
- package/dist/builtin/subagents/src/tui/render-event-formatting.ts +2 -2
- package/dist/builtin/subagents/src/tui/render-layout.ts +1 -1
- package/dist/builtin/subagents/src/tui/render-progress.ts +2 -2
- package/dist/builtin/subagents/src/tui/render-result-compact.ts +7 -7
- package/dist/builtin/subagents/src/tui/render-result.ts +10 -10
- package/dist/builtin/subagents/src/tui/render-stable-output.ts +1 -1
- package/dist/builtin/subagents/src/tui/render-status-progress.ts +5 -5
- package/dist/builtin/subagents/src/tui/render.ts +4 -4
- package/dist/builtin/web-access/package.json +2 -2
- package/dist/builtin/workflows/CHANGELOG.md +57 -0
- package/dist/builtin/workflows/README.md +39 -8
- package/dist/builtin/workflows/builtin/adversarial-verification-runner.ts +16 -5
- package/dist/builtin/workflows/builtin/adversarial-verification.ts +4 -0
- package/dist/builtin/workflows/builtin/classify-and-act.ts +4 -0
- package/dist/builtin/workflows/builtin/fan-out-and-synthesize.ts +4 -0
- package/dist/builtin/workflows/builtin/generate-and-filter-runner.ts +12 -4
- package/dist/builtin/workflows/builtin/generate-and-filter.ts +4 -0
- package/dist/builtin/workflows/builtin/goal-models.ts +8 -10
- package/dist/builtin/workflows/builtin/goal.ts +4 -0
- package/dist/builtin/workflows/builtin/index.d.ts +0 -4
- package/dist/builtin/workflows/builtin/loop-until-done-runner.ts +4 -2
- package/dist/builtin/workflows/builtin/loop-until-done.ts +4 -0
- package/dist/builtin/workflows/builtin/open-claude-design-live-protocol.ts +305 -0
- package/dist/builtin/workflows/builtin/open-claude-design-phases.ts +115 -171
- package/dist/builtin/workflows/builtin/open-claude-design-runner.ts +9 -25
- package/dist/builtin/workflows/builtin/open-claude-design-setup.ts +19 -86
- package/dist/builtin/workflows/builtin/open-claude-design-utils.ts +0 -6
- package/dist/builtin/workflows/builtin/open-claude-design.d.ts +0 -5
- package/dist/builtin/workflows/builtin/open-claude-design.ts +11 -15
- package/dist/builtin/workflows/builtin/ralph-models.ts +24 -29
- package/dist/builtin/workflows/builtin/ralph.ts +4 -0
- package/dist/builtin/workflows/builtin/tournament-runner.ts +6 -3
- package/dist/builtin/workflows/builtin/tournament.ts +4 -0
- package/dist/builtin/workflows/package.json +2 -2
- package/dist/builtin/workflows/skills/impeccable/SKILL.md +3 -3
- package/dist/builtin/workflows/skills/impeccable/agents/impeccable_asset_producer.toml +25 -31
- package/dist/builtin/workflows/skills/impeccable/agents/impeccable_documenter.toml +1 -0
- package/dist/builtin/workflows/skills/impeccable/agents/impeccable_finish_reviewer.toml +16 -10
- package/dist/builtin/workflows/skills/impeccable/agents/impeccable_manual_edit_applier.toml +2 -2
- package/dist/builtin/workflows/skills/impeccable/reference/android.md +6 -0
- package/dist/builtin/workflows/skills/impeccable/reference/animate.md +3 -0
- package/dist/builtin/workflows/skills/impeccable/reference/bolder.md +3 -1
- package/dist/builtin/workflows/skills/impeccable/reference/craft-floor.md +6 -1
- package/dist/builtin/workflows/skills/impeccable/reference/critique.md +18 -2
- package/dist/builtin/workflows/skills/impeccable/reference/degraded/asset-producer.md +24 -30
- package/dist/builtin/workflows/skills/impeccable/reference/degraded/documenter.md +1 -0
- package/dist/builtin/workflows/skills/impeccable/reference/degraded/finish-reviewer.md +16 -10
- package/dist/builtin/workflows/skills/impeccable/reference/degraded/manual-edit-applier.md +2 -2
- package/dist/builtin/workflows/skills/impeccable/reference/distill.md +1 -1
- package/dist/builtin/workflows/skills/impeccable/reference/doctor.md +1 -0
- package/dist/builtin/workflows/skills/impeccable/reference/document.md +1 -1
- package/dist/builtin/workflows/skills/impeccable/reference/extract.md +1 -1
- package/dist/builtin/workflows/skills/impeccable/reference/hooks.md +12 -6
- package/dist/builtin/workflows/skills/impeccable/reference/init.md +12 -3
- package/dist/builtin/workflows/skills/impeccable/reference/ios.md +6 -0
- package/dist/builtin/workflows/skills/impeccable/reference/live-setup.md +102 -0
- package/dist/builtin/workflows/skills/impeccable/reference/live.md +113 -521
- package/dist/builtin/workflows/skills/impeccable/reference/new-work.md +39 -26
- package/dist/builtin/workflows/skills/impeccable/reference/overdrive.md +1 -1
- package/dist/builtin/workflows/skills/impeccable/reference/polish.md +3 -3
- package/dist/builtin/workflows/skills/impeccable/reference/quieter.md +1 -1
- package/dist/builtin/workflows/skills/impeccable/reference/visualize.md +25 -11
- package/dist/builtin/workflows/skills/impeccable/scripts/concept-seed.mjs +332 -221
- package/dist/builtin/workflows/skills/impeccable/scripts/context-signals.mjs +10 -19
- package/dist/builtin/workflows/skills/impeccable/scripts/context.mjs +91 -38
- package/dist/builtin/workflows/skills/impeccable/scripts/critique-storage.mjs +19 -10
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/browser/injected/index.mjs +56 -6
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/cli/main.mjs +10 -16
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/design-system.mjs +140 -2
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/detect-antipatterns-browser.js +1174 -694
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/detect-antipatterns.mjs +1 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/engines/browser/detect-url.mjs +5 -1
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/engines/regex/detect-text.mjs +431 -45
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/engines/static-html/css-cascade.mjs +10 -1
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/engines/static-html/detect-html.mjs +47 -6
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/node/file-system.mjs +23 -22
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/registry/antipatterns.mjs +0 -10
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/rules/checks.mjs +384 -384
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/shared/color.mjs +466 -2
- package/dist/builtin/workflows/skills/impeccable/scripts/doctor.mjs +2 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/embed-prompt.mjs +270 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/generate-image.mjs +51 -6
- package/dist/builtin/workflows/skills/impeccable/scripts/hook-admin.mjs +70 -10
- package/dist/builtin/workflows/skills/impeccable/scripts/hook-lib.mjs +336 -90
- package/dist/builtin/workflows/skills/impeccable/scripts/lib/composition-catalog.mjs +38 -3
- package/dist/builtin/workflows/skills/impeccable/scripts/lib/concept-catalog.mjs +77 -11
- package/dist/builtin/workflows/skills/impeccable/scripts/lib/design-parser.mjs +102 -19
- package/dist/builtin/workflows/skills/impeccable/scripts/lib/impeccable-config.mjs +44 -59
- package/dist/builtin/workflows/skills/impeccable/scripts/lib/is-generated.mjs +3 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/lib/open-system-browser.mjs +57 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/lib/roll-selection.mjs +369 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/lib/staleness-deep.mjs +31 -3
- package/dist/builtin/workflows/skills/impeccable/scripts/lib/staleness.mjs +73 -2
- package/dist/builtin/workflows/skills/impeccable/scripts/live/accept-css.mjs +617 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/live/accept-verify.mjs +71 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/live/browser-script-parts.mjs +29 -2
- package/dist/builtin/workflows/skills/impeccable/scripts/live/event-validation.mjs +54 -7
- package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/astro.mjs +47 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/detect-utils.mjs +157 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/index.mjs +143 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/journal.mjs +205 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/nextjs.mjs +49 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/nuxt.mjs +170 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/script-src.mjs +26 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/static-html.mjs +26 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/sveltekit.mjs +71 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/tag-strategy.mjs +247 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/tanstack-start.mjs +70 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/vite-generic.mjs +42 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/live/instructions.mjs +169 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/live/roots.mjs +670 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/live/session-store.mjs +232 -35
- package/dist/builtin/workflows/skills/impeccable/scripts/live/svelte-ast.mjs +969 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/live/svelte-component.mjs +621 -74
- package/dist/builtin/workflows/skills/impeccable/scripts/live/sveltekit-adapter.mjs +66 -28
- package/dist/builtin/workflows/skills/impeccable/scripts/live/tanstack-adapter.mjs +12 -12
- package/dist/builtin/workflows/skills/impeccable/scripts/live/ui-surfaces.mjs +75 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/live/vocabulary.mjs +135 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/live-accept.mjs +23 -37
- package/dist/builtin/workflows/skills/impeccable/scripts/live-browser.js +945 -115
- package/dist/builtin/workflows/skills/impeccable/scripts/live-complete.mjs +33 -1
- package/dist/builtin/workflows/skills/impeccable/scripts/live-copy-edit-agent.mjs +132 -15
- package/dist/builtin/workflows/skills/impeccable/scripts/live-inject.mjs +173 -425
- package/dist/builtin/workflows/skills/impeccable/scripts/live-insert.mjs +2 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/live-poll.mjs +16 -3
- package/dist/builtin/workflows/skills/impeccable/scripts/live-resume.mjs +39 -10
- package/dist/builtin/workflows/skills/impeccable/scripts/live-server.mjs +194 -27
- package/dist/builtin/workflows/skills/impeccable/scripts/live-status.mjs +10 -4
- package/dist/builtin/workflows/skills/impeccable/scripts/live-wrap.mjs +50 -31
- package/dist/builtin/workflows/skills/impeccable/scripts/live.mjs +91 -28
- package/dist/builtin/workflows/skills/impeccable/scripts/pin.mjs +8 -5
- package/dist/builtin/workflows/skills/impeccable/scripts/serve-question.mjs +759 -109
- package/dist/builtin/workflows/src/authoring/workflow.ts +9 -0
- package/dist/builtin/workflows/src/authoring.d.ts +3 -0
- package/dist/builtin/workflows/src/durable/completed-catalog.ts +23 -2
- package/dist/builtin/workflows/src/durable/dbos-backend.ts +30 -17
- package/dist/builtin/workflows/src/durable/dbos-envelope.ts +14 -0
- package/dist/builtin/workflows/src/durable/dbos-lifecycle.ts +60 -57
- package/dist/builtin/workflows/src/durable/dbos-process-owner.ts +87 -0
- package/dist/builtin/workflows/src/durable/dbos-registration-diagnostics.ts +113 -0
- package/dist/builtin/workflows/src/durable/factory.ts +11 -8
- package/dist/builtin/workflows/src/durable/tool-failure-checkpoint.ts +5 -0
- package/dist/builtin/workflows/src/durable/tool-primitive.ts +186 -20
- package/dist/builtin/workflows/src/durable/types.ts +4 -0
- package/dist/builtin/workflows/src/durable/workflow-heartbeat-anchor.ts +153 -0
- package/dist/builtin/workflows/src/engine/run-durable-stage-session.ts +28 -0
- package/dist/builtin/workflows/src/engine/run-tool-control-registry.ts +9 -1
- package/dist/builtin/workflows/src/engine/run.ts +1 -0
- package/dist/builtin/workflows/src/extension/adopt-session-run-state.ts +20 -0
- package/dist/builtin/workflows/src/extension/background-ui-adapter.ts +9 -30
- package/dist/builtin/workflows/src/extension/extension-factory.ts +3 -0
- package/dist/builtin/workflows/src/extension/extension-lifecycle.ts +28 -10
- package/dist/builtin/workflows/src/extension/extension-runtime-state.ts +138 -0
- package/dist/builtin/workflows/src/extension/index.bundle.mjs +3365 -1341
- package/dist/builtin/workflows/src/extension/workflow-heartbeat-delivery.ts +197 -0
- package/dist/builtin/workflows/src/extension/workflow-heartbeat-notice.ts +115 -0
- package/dist/builtin/workflows/src/extension/workflow-heartbeat-scheduler.ts +962 -0
- package/dist/builtin/workflows/src/extension/workflow-prompts.ts +4 -1
- package/dist/builtin/workflows/src/extension/workflow-schema.ts +29 -5
- package/dist/builtin/workflows/src/extension/workflow-tool-send.ts +32 -1
- package/dist/builtin/workflows/src/runs/background/cancellation-registry.ts +10 -1
- package/dist/builtin/workflows/src/runs/background/job-tracker.ts +10 -1
- package/dist/builtin/workflows/src/runs/foreground/executor-prompt-nodes.ts +16 -11
- package/dist/builtin/workflows/src/runs/foreground/stage-control-registry.ts +31 -1
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-context.ts +41 -10
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-messages.ts +48 -0
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-output.ts +4 -1
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-structured-output.ts +45 -12
- package/dist/builtin/workflows/src/sdk-surface.ts +9 -0
- package/dist/builtin/workflows/src/shared/authoring-contract-ui.d.ts +10 -0
- package/dist/builtin/workflows/src/shared/authoring-contract-ui.ts +10 -0
- package/dist/builtin/workflows/src/shared/graph-store-snapshot.ts +14 -2
- package/dist/builtin/workflows/src/shared/persistence-restore.ts +12 -0
- package/dist/builtin/workflows/src/shared/prompt-answer.ts +130 -0
- package/dist/builtin/workflows/src/shared/session-scoped-singleton.ts +98 -0
- package/dist/builtin/workflows/src/shared/stage-ui-broker.ts +9 -1
- package/dist/builtin/workflows/src/shared/store-factory.ts +9 -1
- package/dist/builtin/workflows/src/shared/store-public-types.ts +2 -1
- package/dist/builtin/workflows/src/shared/store-tool-node-methods.ts +7 -0
- package/dist/builtin/workflows/src/shared/store-types.ts +18 -1
- package/dist/builtin/workflows/src/shared/tool-payload-bounds.ts +576 -0
- package/dist/builtin/workflows/src/shared/workflow-authoring-types.d.ts +1 -0
- package/dist/builtin/workflows/src/shared/workflow-authoring-types.ts +1 -0
- package/dist/builtin/workflows/src/shared/workflow-heartbeat-contract.d.ts +21 -0
- package/dist/builtin/workflows/src/shared/workflow-heartbeat-contract.ts +25 -0
- package/dist/builtin/workflows/src/tui/graph-theme.ts +8 -1
- package/dist/builtin/workflows/src/tui/graph-view-constants.ts +11 -0
- package/dist/builtin/workflows/src/tui/graph-view-input.ts +100 -5
- package/dist/builtin/workflows/src/tui/graph-view-layout.ts +42 -11
- package/dist/builtin/workflows/src/tui/graph-view-render-helpers.ts +55 -6
- package/dist/builtin/workflows/src/tui/graph-view-render.ts +71 -6
- package/dist/builtin/workflows/src/tui/graph-view-state.ts +43 -0
- package/dist/builtin/workflows/src/tui/keybindings-adapter.ts +2 -0
- package/dist/builtin/workflows/src/tui/node-card.ts +5 -1
- package/dist/builtin/workflows/src/tui/stage-chat-view-archive-history.ts +11 -2
- package/dist/builtin/workflows/src/tui/stage-chat-view.ts +36 -10
- package/dist/builtin/workflows/src/tui/switcher.ts +11 -4
- package/dist/builtin/workflows/src/tui/tool-detail.ts +348 -0
- package/dist/builtin/workflows/src/tui/workflow-status.ts +5 -2
- package/dist/cli/args.d.ts +1 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +11 -0
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/auth-check.d.ts +1 -1
- package/dist/cli/auth-check.js.map +1 -1
- package/dist/cli/credential-print.d.ts +1 -1
- package/dist/cli/credential-print.js.map +1 -1
- package/dist/cli/list-models.d.ts +1 -1
- package/dist/cli/list-models.js.map +1 -1
- package/dist/cli/startup-ui.d.ts +9 -0
- package/dist/cli/startup-ui.d.ts.map +1 -1
- package/dist/cli/startup-ui.js +7 -1
- package/dist/cli/startup-ui.js.map +1 -1
- package/dist/core/agent-session-custom-message-commit.js +2 -2
- package/dist/core/agent-session-custom-message-commit.js.map +1 -1
- package/dist/core/agent-session-export.d.ts +6 -1
- package/dist/core/agent-session-export.d.ts.map +1 -1
- package/dist/core/agent-session-export.js +6 -3
- package/dist/core/agent-session-export.js.map +1 -1
- package/dist/core/agent-session-extension-bindings.d.ts.map +1 -1
- package/dist/core/agent-session-extension-bindings.js +6 -4
- package/dist/core/agent-session-extension-bindings.js.map +1 -1
- package/dist/core/agent-session-methods.d.ts +5 -2
- 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-prompt.d.ts +12 -1
- package/dist/core/agent-session-prompt.d.ts.map +1 -1
- package/dist/core/agent-session-prompt.js +31 -10
- package/dist/core/agent-session-prompt.js.map +1 -1
- package/dist/core/agent-session-runtime-auth.js.map +1 -1
- package/dist/core/agent-session-services.d.ts +1 -1
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session-skill-block.d.ts +1 -0
- package/dist/core/agent-session-skill-block.d.ts.map +1 -1
- package/dist/core/agent-session-skill-block.js +18 -2
- package/dist/core/agent-session-skill-block.js.map +1 -1
- package/dist/core/agent-session-state.d.ts.map +1 -1
- package/dist/core/agent-session-state.js +2 -1
- package/dist/core/agent-session-state.js.map +1 -1
- package/dist/core/agent-session-types.d.ts +2 -1
- package/dist/core/agent-session-types.d.ts.map +1 -1
- package/dist/core/agent-session-types.js.map +1 -1
- package/dist/core/agent-session.d.ts +1 -1
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/atomic-guide-command.js +2 -2
- package/dist/core/atomic-guide-command.js.map +1 -1
- package/dist/core/builtin-packages.d.ts.map +1 -1
- package/dist/core/builtin-packages.js +0 -6
- package/dist/core/builtin-packages.js.map +1 -1
- package/dist/core/cloudflare-gateway-binding.d.ts +11 -0
- package/dist/core/cloudflare-gateway-binding.d.ts.map +1 -0
- package/dist/core/cloudflare-gateway-binding.js +11 -0
- package/dist/core/cloudflare-gateway-binding.js.map +1 -0
- package/dist/core/codex-fast-mode-transport.d.ts +12 -0
- package/dist/core/codex-fast-mode-transport.d.ts.map +1 -0
- package/dist/core/codex-fast-mode-transport.js +130 -0
- package/dist/core/codex-fast-mode-transport.js.map +1 -0
- package/dist/core/codex-fast-mode.d.ts +20 -6
- package/dist/core/codex-fast-mode.d.ts.map +1 -1
- package/dist/core/codex-fast-mode.js +111 -3
- package/dist/core/codex-fast-mode.js.map +1 -1
- package/dist/core/diagnostics.d.ts +4 -0
- package/dist/core/diagnostics.d.ts.map +1 -1
- package/dist/core/diagnostics.js.map +1 -1
- package/dist/core/event-bus.d.ts +12 -0
- package/dist/core/event-bus.d.ts.map +1 -1
- package/dist/core/event-bus.js +22 -0
- package/dist/core/event-bus.js.map +1 -1
- package/dist/core/experimental.d.ts +25 -0
- package/dist/core/experimental.d.ts.map +1 -1
- package/dist/core/experimental.js +24 -0
- package/dist/core/experimental.js.map +1 -1
- package/dist/core/export-html/template-js/tree-filter-render.js +4 -3
- package/dist/core/export-html/template.js +4 -3
- package/dist/core/extension-session-state.d.ts +28 -0
- package/dist/core/extension-session-state.d.ts.map +1 -0
- package/dist/core/extension-session-state.js +55 -0
- package/dist/core/extension-session-state.js.map +1 -0
- package/dist/core/extensions/api-types.d.ts +6 -0
- package/dist/core/extensions/api-types.d.ts.map +1 -1
- package/dist/core/extensions/api-types.js.map +1 -1
- package/dist/core/extensions/context-types.d.ts +4 -0
- package/dist/core/extensions/context-types.d.ts.map +1 -1
- package/dist/core/extensions/context-types.js.map +1 -1
- package/dist/core/extensions/index.d.ts +1 -0
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js +1 -0
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader-api.d.ts +1 -1
- package/dist/core/extensions/loader-api.d.ts.map +1 -1
- package/dist/core/extensions/loader-api.js +16 -10
- package/dist/core/extensions/loader-api.js.map +1 -1
- package/dist/core/extensions/loader-virtual-modules.d.ts.map +1 -1
- package/dist/core/extensions/loader-virtual-modules.js +12 -1
- package/dist/core/extensions/loader-virtual-modules.js.map +1 -1
- package/dist/core/extensions/runner-context.d.ts +2 -0
- package/dist/core/extensions/runner-context.d.ts.map +1 -1
- package/dist/core/extensions/runner-context.js +8 -0
- package/dist/core/extensions/runner-context.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +1 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +3 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/runtime-types.d.ts +3 -0
- package/dist/core/extensions/runtime-types.d.ts.map +1 -1
- package/dist/core/extensions/runtime-types.js.map +1 -1
- package/dist/core/extensions/ui-types.d.ts +26 -0
- package/dist/core/extensions/ui-types.d.ts.map +1 -1
- package/dist/core/extensions/ui-types.js +17 -1
- package/dist/core/extensions/ui-types.js.map +1 -1
- package/dist/core/http-dispatcher.d.ts.map +1 -1
- package/dist/core/http-dispatcher.js +5 -0
- package/dist/core/http-dispatcher.js.map +1 -1
- package/dist/core/keybindings.d.ts +24 -0
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +6 -0
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/model-config.d.ts +5 -0
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +1 -0
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/model-registry.d.ts +1 -1
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver-cli.d.ts +1 -1
- package/dist/core/model-resolver-cli.js.map +1 -1
- package/dist/core/model-resolver-defaults.js +3 -3
- package/dist/core/model-resolver-defaults.js.map +1 -1
- package/dist/core/model-resolver-initial.d.ts +1 -1
- package/dist/core/model-resolver-initial.js.map +1 -1
- package/dist/core/model-resolver-scope.d.ts +1 -1
- package/dist/core/model-resolver-scope.js.map +1 -1
- package/dist/core/model-runtime.d.ts +54 -0
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +96 -13
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/oauth-login.js.map +1 -1
- package/dist/core/project-trust.d.ts +10 -0
- package/dist/core/project-trust.d.ts.map +1 -1
- package/dist/core/project-trust.js +12 -0
- package/dist/core/project-trust.js.map +1 -1
- package/dist/core/resource-loader-assets.d.ts.map +1 -1
- package/dist/core/resource-loader-assets.js +14 -5
- package/dist/core/resource-loader-assets.js.map +1 -1
- package/dist/core/resource-loader-core.d.ts +3 -0
- package/dist/core/resource-loader-core.d.ts.map +1 -1
- package/dist/core/resource-loader-core.js +5 -0
- package/dist/core/resource-loader-core.js.map +1 -1
- package/dist/core/resource-loader-internals.d.ts +2 -0
- package/dist/core/resource-loader-internals.d.ts.map +1 -1
- package/dist/core/resource-loader-internals.js.map +1 -1
- package/dist/core/resource-loader-reload.d.ts.map +1 -1
- package/dist/core/resource-loader-reload.js +2 -0
- package/dist/core/resource-loader-reload.js.map +1 -1
- package/dist/core/resource-loader-types.d.ts +2 -0
- package/dist/core/resource-loader-types.d.ts.map +1 -1
- package/dist/core/resource-loader-types.js.map +1 -1
- package/dist/core/resource-loader.d.ts +2 -0
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +1 -0
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/sdk-types.d.ts +7 -6
- package/dist/core/sdk-types.d.ts.map +1 -1
- package/dist/core/sdk-types.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +17 -6
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager-core.d.ts +7 -1
- package/dist/core/session-manager-core.d.ts.map +1 -1
- package/dist/core/session-manager-core.js +11 -2
- package/dist/core/session-manager-core.js.map +1 -1
- package/dist/core/session-manager-entries.d.ts +2 -2
- package/dist/core/session-manager-entries.d.ts.map +1 -1
- package/dist/core/session-manager-entries.js +6 -4
- package/dist/core/session-manager-entries.js.map +1 -1
- package/dist/core/session-manager-list.d.ts.map +1 -1
- package/dist/core/session-manager-list.js +5 -1
- package/dist/core/session-manager-list.js.map +1 -1
- package/dist/core/session-manager-types.d.ts +25 -2
- package/dist/core/session-manager-types.d.ts.map +1 -1
- package/dist/core/session-manager-types.js.map +1 -1
- package/dist/core/session-manager.d.ts +1 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager-basic-accessors.d.ts +1 -0
- package/dist/core/settings-manager-basic-accessors.d.ts.map +1 -1
- package/dist/core/settings-manager-basic-accessors.js +8 -0
- package/dist/core/settings-manager-basic-accessors.js.map +1 -1
- package/dist/core/settings-manager-ui-accessors.d.ts +3 -1
- package/dist/core/settings-manager-ui-accessors.d.ts.map +1 -1
- package/dist/core/settings-manager-ui-accessors.js +9 -0
- package/dist/core/settings-manager-ui-accessors.js.map +1 -1
- package/dist/core/settings-manager.d.ts +1 -1
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/settings-types.d.ts +4 -0
- package/dist/core/settings-types.d.ts.map +1 -1
- package/dist/core/settings-types.js.map +1 -1
- package/dist/core/skill-catalog.d.ts +35 -0
- package/dist/core/skill-catalog.d.ts.map +1 -0
- package/dist/core/skill-catalog.js +264 -0
- package/dist/core/skill-catalog.js.map +1 -0
- package/dist/core/skills-async.d.ts.map +1 -1
- package/dist/core/skills-async.js +12 -6
- package/dist/core/skills-async.js.map +1 -1
- package/dist/core/skills.d.ts +2 -0
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +8 -5
- package/dist/core/skills.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +1 -5
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/system-prompt.js +2 -2
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/ask-user-question/ask-user-question.d.ts +25 -2
- package/dist/core/tools/ask-user-question/ask-user-question.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/ask-user-question.js +47 -18
- package/dist/core/tools/ask-user-question/ask-user-question.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/multi-select-view.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/multi-select-view.js +5 -2
- package/dist/core/tools/ask-user-question/view/components/multi-select-view.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/submit-picker.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/submit-picker.js +3 -1
- package/dist/core/tools/ask-user-question/view/components/submit-picker.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/wrapping-select.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/wrapping-select.js +8 -1
- package/dist/core/tools/ask-user-question/view/components/wrapping-select.js.map +1 -1
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +2 -0
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +2 -0
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +3 -1
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.js +1 -1
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/hashline-engine/format.d.ts +2 -0
- package/dist/core/tools/hashline-engine/format.d.ts.map +1 -1
- package/dist/core/tools/hashline-engine/format.js +4 -2
- package/dist/core/tools/hashline-engine/format.js.map +1 -1
- package/dist/core/tools/hashline-engine/messages.d.ts +2 -0
- package/dist/core/tools/hashline-engine/messages.d.ts.map +1 -1
- package/dist/core/tools/hashline-engine/messages.js +4 -2
- package/dist/core/tools/hashline-engine/messages.js.map +1 -1
- package/dist/core/tools/hashline-engine/parser.d.ts.map +1 -1
- package/dist/core/tools/hashline-engine/parser.js +16 -4
- package/dist/core/tools/hashline-engine/parser.js.map +1 -1
- package/dist/core/tools/hashline-engine/tokenizer.d.ts.map +1 -1
- package/dist/core/tools/hashline-engine/tokenizer.js +37 -27
- package/dist/core/tools/hashline-engine/tokenizer.js.map +1 -1
- package/dist/core/tools/hashline.d.ts.map +1 -1
- package/dist/core/tools/hashline.js +8 -2
- package/dist/core/tools/hashline.js.map +1 -1
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js +2 -0
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +8 -1
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/search.d.ts.map +1 -1
- package/dist/core/tools/search.js +2 -0
- package/dist/core/tools/search.js.map +1 -1
- package/dist/core/tools/todos.d.ts +3 -12
- package/dist/core/tools/todos.d.ts.map +1 -1
- package/dist/core/tools/todos.js +19 -4
- package/dist/core/tools/todos.js.map +1 -1
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +2 -0
- package/dist/core/tools/write.js.map +1 -1
- package/dist/index-extensions.d.ts +1 -1
- package/dist/index-extensions.d.ts.map +1 -1
- package/dist/index-extensions.js +1 -1
- package/dist/index-extensions.js.map +1 -1
- package/dist/index.d.ts +8 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/main-runtime-api-key.d.ts +1 -1
- package/dist/main-runtime-api-key.js.map +1 -1
- package/dist/main-session-options.d.ts +1 -1
- package/dist/main-session-options.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +10 -2
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-rendering.js +1 -1
- package/dist/modes/interactive/components/chat-session-host-rendering.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-state.d.ts +8 -0
- package/dist/modes/interactive/components/chat-session-host-state.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-state.js +8 -0
- package/dist/modes/interactive/components/chat-session-host-state.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host.d.ts +26 -0
- package/dist/modes/interactive/components/chat-session-host.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host.js +38 -0
- package/dist/modes/interactive/components/chat-session-host.js.map +1 -1
- package/dist/modes/interactive/components/chat-transcript.d.ts +37 -0
- package/dist/modes/interactive/components/chat-transcript.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-transcript.js +54 -1
- package/dist/modes/interactive/components/chat-transcript.js.map +1 -1
- package/dist/modes/interactive/components/fast-mode-selector.js +1 -1
- package/dist/modes/interactive/components/fast-mode-selector.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +2 -1
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts +1 -1
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/components/reserved-bottom-overlay.d.ts +95 -0
- package/dist/modes/interactive/components/reserved-bottom-overlay.d.ts.map +1 -0
- package/dist/modes/interactive/components/reserved-bottom-overlay.js +234 -0
- package/dist/modes/interactive/components/reserved-bottom-overlay.js.map +1 -0
- package/dist/modes/interactive/components/session-selector-search.d.ts +4 -0
- package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector-search.js +4 -0
- package/dist/modes/interactive/components/session-selector-search.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector-handlers.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector-handlers.js +3 -0
- package/dist/modes/interactive/components/settings-selector-handlers.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector-items.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector-items.js +7 -0
- package/dist/modes/interactive/components/settings-selector-items.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector-types.d.ts +3 -1
- package/dist/modes/interactive/components/settings-selector-types.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector-types.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +12 -1
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/interactive-auth-login.js.map +1 -1
- package/dist/modes/interactive/interactive-auth-routing.js.map +1 -1
- package/dist/modes/interactive/interactive-autocomplete.js +5 -4
- package/dist/modes/interactive/interactive-autocomplete.js.map +1 -1
- package/dist/modes/interactive/interactive-bash-compact.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-bash-compact.js +2 -2
- package/dist/modes/interactive/interactive-bash-compact.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-custom-ui.js +94 -6
- package/dist/modes/interactive/interactive-extension-custom-ui.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.d.ts +41 -3
- package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.js +80 -11
- package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.d.ts +9 -1
- 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-mode-types.d.ts +2 -0
- package/dist/modes/interactive/interactive-mode-types.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-types.js.map +1 -1
- package/dist/modes/interactive/interactive-model-catalog-startup.d.ts +8 -1
- package/dist/modes/interactive/interactive-model-catalog-startup.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-model-catalog-startup.js +13 -3
- package/dist/modes/interactive/interactive-model-catalog-startup.js.map +1 -1
- package/dist/modes/interactive/interactive-model-routing.js +3 -4
- package/dist/modes/interactive/interactive-model-routing.js.map +1 -1
- package/dist/modes/interactive/interactive-render-chat.js +6 -0
- package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
- package/dist/modes/interactive/interactive-resource-disclosure.js +2 -2
- package/dist/modes/interactive/interactive-resource-disclosure.js.map +1 -1
- package/dist/modes/interactive/interactive-selectors.js +7 -3
- package/dist/modes/interactive/interactive-selectors.js.map +1 -1
- package/dist/modes/interactive/interactive-session-runtime.js +7 -1
- package/dist/modes/interactive/interactive-session-runtime.js.map +1 -1
- package/dist/modes/interactive/interactive-slash-commands.js +2 -2
- package/dist/modes/interactive/interactive-slash-commands.js.map +1 -1
- package/dist/modes/interactive/interactive-startup.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-startup.js +34 -9
- package/dist/modes/interactive/interactive-startup.js.map +1 -1
- package/dist/modes/interactive/interactive-tui.d.ts +21 -1
- package/dist/modes/interactive/interactive-tui.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-tui.js +140 -38
- package/dist/modes/interactive/interactive-tui.js.map +1 -1
- package/dist/modes/interactive/model-catalog-refresh.d.ts +17 -0
- package/dist/modes/interactive/model-catalog-refresh.d.ts.map +1 -0
- package/dist/modes/interactive/model-catalog-refresh.js +84 -0
- package/dist/modes/interactive/model-catalog-refresh.js.map +1 -0
- package/dist/modes/interactive/theme/dark.json +2 -0
- package/dist/modes/interactive/theme/light.json +2 -0
- package/dist/modes/interactive/theme/theme-class.d.ts +12 -3
- package/dist/modes/interactive/theme/theme-class.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-class.js +6 -1
- package/dist/modes/interactive/theme/theme-class.js.map +1 -1
- package/dist/modes/interactive/theme/theme-controller.d.ts +10 -2
- package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-controller.js +23 -10
- package/dist/modes/interactive/theme/theme-controller.js.map +1 -1
- package/dist/modes/interactive/theme/theme-loading.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-loading.js +1 -0
- package/dist/modes/interactive/theme/theme-loading.js.map +1 -1
- package/dist/modes/interactive/theme/theme-schema.d.ts +8 -0
- package/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-schema.js +3 -1
- package/dist/modes/interactive/theme/theme-schema.js.map +1 -1
- package/dist/modes/interactive/theme/theme-schema.json +9 -1
- package/dist/modes/interactive-engine/engine-custom-ui.d.ts +2 -0
- package/dist/modes/interactive-engine/engine-custom-ui.d.ts.map +1 -1
- package/dist/modes/interactive-engine/engine-custom-ui.js +1 -0
- package/dist/modes/interactive-engine/engine-custom-ui.js.map +1 -1
- package/dist/modes/interactive-engine/protocol.d.ts +1 -0
- package/dist/modes/interactive-engine/protocol.d.ts.map +1 -1
- package/dist/modes/interactive-engine/protocol.js +1 -0
- package/dist/modes/interactive-engine/protocol.js.map +1 -1
- package/dist/modes/interactive-engine/remote-component.d.ts +3 -1
- package/dist/modes/interactive-engine/remote-component.d.ts.map +1 -1
- package/dist/modes/interactive-engine/remote-component.js +3 -2
- package/dist/modes/interactive-engine/remote-component.js.map +1 -1
- package/dist/modes/json-event.d.ts +6 -1
- package/dist/modes/json-event.d.ts.map +1 -1
- package/dist/modes/json-event.js +17 -2
- package/dist/modes/json-event.js.map +1 -1
- 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 +5 -4
- package/dist/modes/rpc/rpc-command-handler.js.map +1 -1
- package/dist/modes/rpc/rpc-provider-auth.js.map +1 -1
- package/dist/modes/rpc/rpc-responses.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/server/create-harness.d.ts.map +1 -1
- package/dist/server/create-harness.js +11 -0
- package/dist/server/create-harness.js.map +1 -1
- package/dist/utils/abort.d.ts +9 -0
- package/dist/utils/abort.d.ts.map +1 -0
- package/dist/utils/abort.js +19 -0
- package/dist/utils/abort.js.map +1 -0
- package/dist/utils/tools-manager.d.ts +16 -1
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/tools-manager.js +19 -19
- package/dist/utils/tools-manager.js.map +1 -1
- package/docs/custom-provider.md +9 -8
- package/docs/development.md +0 -1
- package/docs/docs.json +0 -1
- package/docs/environment-variables.md +3 -0
- package/docs/extensions.md +100 -2
- package/docs/json.md +3 -1
- package/docs/keybindings.md +8 -3
- package/docs/models/artificial-analysis-index.md +2 -2
- package/docs/models/model-selection.md +32 -23
- package/docs/models/pareto-efficiency.md +25 -24
- package/docs/providers.md +95 -2
- package/docs/quickstart.md +4 -2
- package/docs/rpc.md +21 -7
- package/docs/sdk.md +26 -1
- package/docs/session-format.md +5 -2
- package/docs/settings.md +34 -3
- package/docs/skills.md +16 -1
- package/docs/terminal-setup.md +15 -2
- package/docs/themes.md +22 -4
- package/docs/tools.md +3 -1
- package/docs/tui.md +2 -0
- package/docs/usage.md +5 -4
- package/docs/workflows.md +96 -19
- package/npm-shrinkwrap.json +211 -232
- package/package.json +8 -8
- package/dist/builtin/i-have-adhd/CHANGELOG.md +0 -30
- package/dist/builtin/i-have-adhd/LICENSE +0 -21
- package/dist/builtin/i-have-adhd/README.md +0 -18
- package/dist/builtin/i-have-adhd/index.ts +0 -238
- package/dist/builtin/i-have-adhd/package.json +0 -56
- package/dist/builtin/i-have-adhd/skills/i-have-adhd/SKILL.md +0 -140
- package/dist/builtin/workflows/builtin/open-claude-design-feedback.ts +0 -359
- package/dist/builtin/workflows/skills/impeccable/scripts/live/ui-core.mjs +0 -180
- package/docs/i-have-adhd.md +0 -36
|
@@ -71,11 +71,43 @@ function contrastRatio(c1, c2) {
|
|
|
71
71
|
return (Math.max(l1, l2) + 0.05) / (Math.min(l1, l2) + 0.05);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
+
// The CSS color functions worth pulling out of a longer declaration. The set
|
|
75
|
+
// is deliberately closed: `linear-gradient(` and `url(` also look like
|
|
76
|
+
// `name(` and must not be read as colors.
|
|
77
|
+
const COLOR_FUNCTION_NAMES = new Set([
|
|
78
|
+
'rgb', 'rgba', 'hsl', 'hsla', 'hwb', 'oklch', 'oklab', 'lch', 'lab', 'color', 'color-mix',
|
|
79
|
+
]);
|
|
80
|
+
|
|
81
|
+
// Pull every color-function token out of a value, with balanced-paren capture
|
|
82
|
+
// so nested forms (`color-mix(in oklab, oklch(...) 20%, transparent)`) survive
|
|
83
|
+
// whole. Returns the raw substrings in source order.
|
|
84
|
+
function extractColorFunctionTokens(value) {
|
|
85
|
+
const str = String(value || '');
|
|
86
|
+
const tokens = [];
|
|
87
|
+
const re = /([a-z][a-z-]*)\(/gi;
|
|
88
|
+
let m;
|
|
89
|
+
while ((m = re.exec(str)) !== null) {
|
|
90
|
+
if (!COLOR_FUNCTION_NAMES.has(m[1].toLowerCase())) continue;
|
|
91
|
+
let depth = 0, end = -1;
|
|
92
|
+
for (let i = m.index + m[0].length - 1; i < str.length; i++) {
|
|
93
|
+
if (str[i] === '(') depth++;
|
|
94
|
+
else if (str[i] === ')') { depth--; if (depth === 0) { end = i; break; } }
|
|
95
|
+
}
|
|
96
|
+
if (end < 0) break;
|
|
97
|
+
tokens.push(str.slice(m.index, end + 1));
|
|
98
|
+
re.lastIndex = end + 1;
|
|
99
|
+
}
|
|
100
|
+
return tokens;
|
|
101
|
+
}
|
|
102
|
+
|
|
74
103
|
function parseGradientColors(bgImage) {
|
|
75
104
|
if (!bgImage || !bgImage.includes('gradient')) return [];
|
|
76
105
|
const colors = [];
|
|
77
|
-
|
|
78
|
-
|
|
106
|
+
// Stops arrive in whatever syntax the author wrote and the browser kept.
|
|
107
|
+
// A dark ground painted as `linear-gradient(oklch(...), oklch(...))` used
|
|
108
|
+
// to read as a gradient with no stops at all.
|
|
109
|
+
for (const token of extractColorFunctionTokens(bgImage)) {
|
|
110
|
+
const c = parseAnyColor(token);
|
|
79
111
|
if (c) colors.push(c);
|
|
80
112
|
}
|
|
81
113
|
for (const m of bgImage.matchAll(/#([0-9a-f]{6}|[0-9a-f]{3})\b/gi)) {
|
|
@@ -112,13 +144,445 @@ function colorToHex(c) {
|
|
|
112
144
|
return '#' + [c.r, c.g, c.b].map(v => v.toString(16).padStart(2, '0')).join('');
|
|
113
145
|
}
|
|
114
146
|
|
|
147
|
+
// ─── Color-space conversions ────────────────────────────────────────────────
|
|
148
|
+
//
|
|
149
|
+
// Every function here lands on 8-bit sRGB, clamped to gamut. Chrome, Safari,
|
|
150
|
+
// and Firefox all keep the authored color space in getComputedStyle output
|
|
151
|
+
// (`oklch(0.84 0.19 80.46)`, `lch(20 5 60)`, `color(srgb 1.04 0.72 -0.21)`),
|
|
152
|
+
// so a detector that only reads rgb() is blind on any modern palette. The
|
|
153
|
+
// expected outputs are pinned in tests/detect-antipatterns.test.js against
|
|
154
|
+
// what Chrome itself paints for the same strings.
|
|
155
|
+
|
|
156
|
+
function clamp01(x) {
|
|
157
|
+
return Number.isFinite(x) ? Math.max(0, Math.min(1, x)) : 0;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// Linear-light sRGB channel to the encoded 0-255 value.
|
|
161
|
+
function encodeSrgbChannel(x) {
|
|
162
|
+
const c = clamp01(x);
|
|
163
|
+
return Math.round((c <= 0.0031308 ? 12.92 * c : 1.055 * Math.pow(c, 1 / 2.4) - 0.055) * 255);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
function decodeSrgbChannel(x) {
|
|
167
|
+
const c = Number.isFinite(x) ? x : 0;
|
|
168
|
+
const sign = c < 0 ? -1 : 1;
|
|
169
|
+
const abs = Math.abs(c);
|
|
170
|
+
return sign * (abs <= 0.04045 ? abs / 12.92 : Math.pow((abs + 0.055) / 1.055, 2.4));
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
function linearSrgbToColor(r, g, b, a = 1) {
|
|
174
|
+
return { r: encodeSrgbChannel(r), g: encodeSrgbChannel(g), b: encodeSrgbChannel(b), a };
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// OKLab to sRGB (Björn Ottosson's matrices). L in 0..1, a/b are signed axes.
|
|
178
|
+
function oklabToRgb(L, a, b) {
|
|
179
|
+
const l_ = L + 0.3963377774 * a + 0.2158037573 * b;
|
|
180
|
+
const m_ = L - 0.1055613458 * a - 0.0638541728 * b;
|
|
181
|
+
const s_ = L - 0.0894841775 * a - 1.2914855480 * b;
|
|
182
|
+
const lc = l_ * l_ * l_, mc = m_ * m_ * m_, sc = s_ * s_ * s_;
|
|
183
|
+
return linearSrgbToColor(
|
|
184
|
+
4.0767416621 * lc - 3.3077115913 * mc + 0.2309699292 * sc,
|
|
185
|
+
-1.2684380046 * lc + 2.6097574011 * mc - 0.3413193965 * sc,
|
|
186
|
+
-0.0041960863 * lc - 0.7034186147 * mc + 1.7076147010 * sc,
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// OKLCH to sRGB. L in 0..1, C in 0..~0.4 typical, H in degrees. Chroma past
|
|
191
|
+
// the sRGB gamut clamps per channel rather than producing NaN.
|
|
192
|
+
function oklchToRgb(L, C, H) {
|
|
193
|
+
const hRad = (H * Math.PI) / 180;
|
|
194
|
+
return oklabToRgb(L, C * Math.cos(hRad), C * Math.sin(hRad));
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// CIE Lab to sRGB. CSS lab()/lch() use the D50 white point; the matrix below
|
|
198
|
+
// is the Bradford-adapted XYZ-D50 to linear-sRGB transform from CSS Color 4.
|
|
199
|
+
function labToRgb(L, a, b) {
|
|
200
|
+
const kappa = 24389 / 27, epsilon = 216 / 24389;
|
|
201
|
+
const fy = (L + 16) / 116, fx = fy + a / 500, fz = fy - b / 200;
|
|
202
|
+
const invert = (t) => (t * t * t > epsilon ? t * t * t : (116 * t - 16) / kappa);
|
|
203
|
+
const yr = L > kappa * epsilon ? Math.pow((L + 16) / 116, 3) : L / kappa;
|
|
204
|
+
const Xn = 0.3457 / 0.3585, Zn = (1 - 0.3457 - 0.3585) / 0.3585;
|
|
205
|
+
const x = invert(fx) * Xn, y = yr, z = invert(fz) * Zn;
|
|
206
|
+
return linearSrgbToColor(
|
|
207
|
+
3.1341359569958707 * x - 1.6173863321612538 * y - 0.4906619460083532 * z,
|
|
208
|
+
-0.9787955029120890 * x + 1.9162545672595240 * y + 0.0334427311613195 * z,
|
|
209
|
+
0.0719553798841168 * x - 0.2289768264158322 * y + 1.4053860583241250 * z,
|
|
210
|
+
);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
function lchToRgb(L, C, H) {
|
|
214
|
+
const hRad = (H * Math.PI) / 180;
|
|
215
|
+
return labToRgb(L, C * Math.cos(hRad), C * Math.sin(hRad));
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// color(<space> c1 c2 c3) for the spaces that turn up in real stylesheets.
|
|
219
|
+
// `srgb` is what Chrome serializes most color-mix() results into, routinely
|
|
220
|
+
// with channels outside 0..1. Spaces we do not model return null so callers
|
|
221
|
+
// abstain instead of measuring against a color we invented.
|
|
222
|
+
function colorFunctionToRgb(space, c1, c2, c3) {
|
|
223
|
+
switch (space) {
|
|
224
|
+
case 'srgb':
|
|
225
|
+
return { r: Math.round(clamp01(c1) * 255), g: Math.round(clamp01(c2) * 255), b: Math.round(clamp01(c3) * 255), a: 1 };
|
|
226
|
+
case 'srgb-linear':
|
|
227
|
+
return linearSrgbToColor(c1, c2, c3);
|
|
228
|
+
case 'display-p3': {
|
|
229
|
+
const [R, G, B] = [decodeSrgbChannel(c1), decodeSrgbChannel(c2), decodeSrgbChannel(c3)];
|
|
230
|
+
return linearSrgbToColor(
|
|
231
|
+
1.2249401762805587 * R - 0.2249404646817506 * G + 0.0000002884022551 * B,
|
|
232
|
+
-0.0420569547096138 * R + 1.0420571661298634 * G - 0.0000002113202247 * B,
|
|
233
|
+
-0.0196375587040044 * R - 0.0786360772174755 * G + 1.0982736359214800 * B,
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
default:
|
|
237
|
+
return null;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
function hslToRgb(h, s, l) {
|
|
242
|
+
h = ((h % 360) + 360) % 360;
|
|
243
|
+
const c = (1 - Math.abs(2 * l - 1)) * s;
|
|
244
|
+
const x = c * (1 - Math.abs(((h / 60) % 2) - 1));
|
|
245
|
+
const m0 = l - c / 2;
|
|
246
|
+
const [r, g, b] =
|
|
247
|
+
h < 60 ? [c, x, 0] :
|
|
248
|
+
h < 120 ? [x, c, 0] :
|
|
249
|
+
h < 180 ? [0, c, x] :
|
|
250
|
+
h < 240 ? [0, x, c] :
|
|
251
|
+
h < 300 ? [x, 0, c] : [c, 0, x];
|
|
252
|
+
return {
|
|
253
|
+
r: Math.round((r + m0) * 255),
|
|
254
|
+
g: Math.round((g + m0) * 255),
|
|
255
|
+
b: Math.round((b + m0) * 255),
|
|
256
|
+
a: 1,
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
function hwbToRgb(h, w, bl) {
|
|
261
|
+
if (w + bl >= 1) {
|
|
262
|
+
const g = Math.round((w / (w + bl)) * 255);
|
|
263
|
+
return { r: g, g, b: g, a: 1 };
|
|
264
|
+
}
|
|
265
|
+
const base = hslToRgb(h, 1, 0.5);
|
|
266
|
+
const mix = (c) => Math.round(((c / 255) * (1 - w - bl) + w) * 255);
|
|
267
|
+
return { r: mix(base.r), g: mix(base.g), b: mix(base.b), a: 1 };
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// Common CSS named colors — the handful that actually show up in generated
|
|
271
|
+
// UIs, not the full 148-name spec list. Includes the achromatic names so a
|
|
272
|
+
// named gray parses (and correctly reads as no-chroma) instead of being
|
|
273
|
+
// treated as an unknown color.
|
|
274
|
+
const CSS_NAMED_COLORS = {
|
|
275
|
+
black: { r: 0, g: 0, b: 0 },
|
|
276
|
+
white: { r: 255, g: 255, b: 255 },
|
|
277
|
+
gray: { r: 128, g: 128, b: 128 },
|
|
278
|
+
grey: { r: 128, g: 128, b: 128 },
|
|
279
|
+
silver: { r: 192, g: 192, b: 192 },
|
|
280
|
+
dimgray: { r: 105, g: 105, b: 105 },
|
|
281
|
+
darkgray: { r: 169, g: 169, b: 169 },
|
|
282
|
+
lightgray: { r: 211, g: 211, b: 211 },
|
|
283
|
+
gainsboro: { r: 220, g: 220, b: 220 },
|
|
284
|
+
whitesmoke: { r: 245, g: 245, b: 245 },
|
|
285
|
+
red: { r: 255, g: 0, b: 0 },
|
|
286
|
+
crimson: { r: 220, g: 20, b: 60 },
|
|
287
|
+
tomato: { r: 255, g: 99, b: 71 },
|
|
288
|
+
coral: { r: 255, g: 127, b: 80 },
|
|
289
|
+
salmon: { r: 250, g: 128, b: 114 },
|
|
290
|
+
orange: { r: 255, g: 165, b: 0 },
|
|
291
|
+
gold: { r: 255, g: 215, b: 0 },
|
|
292
|
+
yellow: { r: 255, g: 255, b: 0 },
|
|
293
|
+
olive: { r: 128, g: 128, b: 0 },
|
|
294
|
+
lime: { r: 0, g: 255, b: 0 },
|
|
295
|
+
green: { r: 0, g: 128, b: 0 },
|
|
296
|
+
teal: { r: 0, g: 128, b: 128 },
|
|
297
|
+
turquoise: { r: 64, g: 224, b: 208 },
|
|
298
|
+
cyan: { r: 0, g: 255, b: 255 },
|
|
299
|
+
aqua: { r: 0, g: 255, b: 255 },
|
|
300
|
+
skyblue: { r: 135, g: 206, b: 235 },
|
|
301
|
+
dodgerblue: { r: 30, g: 144, b: 255 },
|
|
302
|
+
blue: { r: 0, g: 0, b: 255 },
|
|
303
|
+
navy: { r: 0, g: 0, b: 128 },
|
|
304
|
+
indigo: { r: 75, g: 0, b: 130 },
|
|
305
|
+
rebeccapurple: { r: 102, g: 51, b: 153 },
|
|
306
|
+
purple: { r: 128, g: 0, b: 128 },
|
|
307
|
+
violet: { r: 238, g: 130, b: 238 },
|
|
308
|
+
orchid: { r: 218, g: 112, b: 214 },
|
|
309
|
+
magenta: { r: 255, g: 0, b: 255 },
|
|
310
|
+
fuchsia: { r: 255, g: 0, b: 255 },
|
|
311
|
+
hotpink: { r: 255, g: 105, b: 180 },
|
|
312
|
+
pink: { r: 255, g: 192, b: 203 },
|
|
313
|
+
maroon: { r: 128, g: 0, b: 0 },
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
// Split a string on top-level commas (ignoring commas nested in parens).
|
|
317
|
+
function splitTopLevelCommas(str) {
|
|
318
|
+
const parts = [];
|
|
319
|
+
let depth = 0, start = 0;
|
|
320
|
+
for (let i = 0; i < str.length; i++) {
|
|
321
|
+
const ch = str[i];
|
|
322
|
+
if (ch === '(') depth++;
|
|
323
|
+
else if (ch === ')') depth = Math.max(0, depth - 1);
|
|
324
|
+
else if (ch === ',' && depth === 0) {
|
|
325
|
+
parts.push(str.slice(start, i).trim());
|
|
326
|
+
start = i + 1;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
const tail = str.slice(start).trim();
|
|
330
|
+
if (tail) parts.push(tail);
|
|
331
|
+
return parts;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
// Evaluate a CSS color-mix() expression to {r,g,b,a}. Returns null when
|
|
335
|
+
// the expression can't be resolved (unresolved var(), unknown colors).
|
|
336
|
+
//
|
|
337
|
+
// Mixing is done with premultiplied alpha in sRGB regardless of the
|
|
338
|
+
// declared interpolation space. That is exact for the dominant generated-UI
|
|
339
|
+
// pattern — `color-mix(in oklab, <color> N%, transparent)` — where the
|
|
340
|
+
// result is simply <color> at alpha N% in ANY rectangular space, and a
|
|
341
|
+
// close-enough approximation for opaque-opaque mixes (the detector only
|
|
342
|
+
// consumes these values for contrast/chroma thresholds, not for display).
|
|
343
|
+
function parseColorMix(str) {
|
|
344
|
+
const m = String(str).trim().match(/^color-mix\(/i);
|
|
345
|
+
if (!m) return null;
|
|
346
|
+
// Balanced-paren capture of the arguments.
|
|
347
|
+
let depth = 0, end = -1;
|
|
348
|
+
const open = str.indexOf('(');
|
|
349
|
+
for (let i = open; i < str.length; i++) {
|
|
350
|
+
if (str[i] === '(') depth++;
|
|
351
|
+
else if (str[i] === ')') { depth--; if (depth === 0) { end = i; break; } }
|
|
352
|
+
}
|
|
353
|
+
if (end < 0) return null;
|
|
354
|
+
const args = splitTopLevelCommas(str.slice(open + 1, end));
|
|
355
|
+
if (args.length !== 3 || !/^in\s/i.test(args[0])) return null;
|
|
356
|
+
|
|
357
|
+
const parseComponent = (component) => {
|
|
358
|
+
// Percentage may lead or trail the color per spec.
|
|
359
|
+
let pct = null;
|
|
360
|
+
let colorStr = component;
|
|
361
|
+
const trail = component.match(/\s+([\d.]+)%$/);
|
|
362
|
+
const lead = component.match(/^([\d.]+)%\s+/);
|
|
363
|
+
if (trail) { pct = parseFloat(trail[1]); colorStr = component.slice(0, trail.index).trim(); }
|
|
364
|
+
else if (lead) { pct = parseFloat(lead[1]); colorStr = component.slice(lead[0].length).trim(); }
|
|
365
|
+
let color;
|
|
366
|
+
if (/^transparent$/i.test(colorStr)) color = { r: 0, g: 0, b: 0, a: 0 };
|
|
367
|
+
else color = parseAnyColor(colorStr);
|
|
368
|
+
if (!color) return null;
|
|
369
|
+
return { color, pct };
|
|
370
|
+
};
|
|
371
|
+
|
|
372
|
+
const c1 = parseComponent(args[1]);
|
|
373
|
+
const c2 = parseComponent(args[2]);
|
|
374
|
+
if (!c1 || !c2) return null;
|
|
375
|
+
let p1 = c1.pct, p2 = c2.pct;
|
|
376
|
+
if (p1 == null && p2 == null) { p1 = 50; p2 = 50; }
|
|
377
|
+
else if (p1 == null) p1 = 100 - p2;
|
|
378
|
+
else if (p2 == null) p2 = 100 - p1;
|
|
379
|
+
const sum = p1 + p2;
|
|
380
|
+
if (sum <= 0) return null;
|
|
381
|
+
// Per spec: weights normalize to sum; when sum < 100 the result alpha is
|
|
382
|
+
// additionally scaled by sum/100.
|
|
383
|
+
const w1 = p1 / sum, w2 = p2 / sum;
|
|
384
|
+
const alphaScale = sum < 100 ? sum / 100 : 1;
|
|
385
|
+
const a1 = c1.color.a ?? 1, a2 = c2.color.a ?? 1;
|
|
386
|
+
const a = (a1 * w1 + a2 * w2) * alphaScale;
|
|
387
|
+
if (a <= 0) return { r: 0, g: 0, b: 0, a: 0 };
|
|
388
|
+
const mix = (ch) => Math.round((c1.color[ch] * a1 * w1 + c2.color[ch] * a2 * w2) / (a1 * w1 + a2 * w2));
|
|
389
|
+
return { r: mix('r'), g: mix('g'), b: mix('b'), a: Math.min(1, a) };
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
// Composite a translucent color over an opaque(ish) base (simple
|
|
393
|
+
// source-over in sRGB). Returns an opaque {r,g,b,a:1}.
|
|
394
|
+
function compositeColorOver(top, base) {
|
|
395
|
+
const a = top.a ?? 1;
|
|
396
|
+
return {
|
|
397
|
+
r: Math.round(top.r * a + base.r * (1 - a)),
|
|
398
|
+
g: Math.round(top.g * a + base.g * (1 - a)),
|
|
399
|
+
b: Math.round(top.b * a + base.b * (1 - a)),
|
|
400
|
+
a: 1,
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
// A color() / lab() / lch() component: a bare number, a percentage against
|
|
405
|
+
// `scale`, or the `none` keyword (which resolves to zero for our purposes).
|
|
406
|
+
function parseColorComponent(token, scale = 1) {
|
|
407
|
+
if (token == null) return null;
|
|
408
|
+
const t = String(token).trim();
|
|
409
|
+
if (/^none$/i.test(t)) return 0;
|
|
410
|
+
const num = parseFloat(t);
|
|
411
|
+
if (!Number.isFinite(num)) return null;
|
|
412
|
+
return t.endsWith('%') ? (num / 100) * scale : num;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
function parseAlphaToken(token) {
|
|
416
|
+
if (token == null) return 1;
|
|
417
|
+
const t = String(token).trim();
|
|
418
|
+
if (/^none$/i.test(t)) return 1;
|
|
419
|
+
const num = parseFloat(t);
|
|
420
|
+
if (!Number.isFinite(num)) return 1;
|
|
421
|
+
return t.endsWith('%') ? num / 100 : num;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
// Extended color parser: rgb/rgba/hex/oklch/oklab/lch/lab/hsl/hwb/color()/
|
|
425
|
+
// color-mix/common named colors. Returns null on no match. Use this when the
|
|
426
|
+
// input might be any CSS color form; use plain parseRgb when you only expect
|
|
427
|
+
// computed rgb() values from real browsers.
|
|
428
|
+
function parseAnyColor(s) {
|
|
429
|
+
if (!s || typeof s !== 'string') return null;
|
|
430
|
+
const str = s.trim();
|
|
431
|
+
if (str === 'transparent' || str === 'currentcolor' || str === 'inherit') return null;
|
|
432
|
+
if (/^color-mix\(/i.test(str)) return parseColorMix(str);
|
|
433
|
+
let m;
|
|
434
|
+
m = str.match(/rgba?\(\s*(\d+(?:\.\d+)?)\s*,?\s*(\d+(?:\.\d+)?)\s*,?\s*(\d+(?:\.\d+)?)(?:\s*[,/]\s*([\d.]+)(%)?)?\s*\)/);
|
|
435
|
+
if (m) {
|
|
436
|
+
const c = { r: Math.round(+m[1]), g: Math.round(+m[2]), b: Math.round(+m[3]), a: 1 };
|
|
437
|
+
if (m[4] !== undefined) c.a = m[5] === '%' ? parseFloat(m[4]) / 100 : +m[4];
|
|
438
|
+
return c;
|
|
439
|
+
}
|
|
440
|
+
m = str.match(/^#([0-9a-f]{3,8})$/i);
|
|
441
|
+
if (m) {
|
|
442
|
+
const h = m[1];
|
|
443
|
+
if (h.length === 3 || h.length === 4) {
|
|
444
|
+
return {
|
|
445
|
+
r: parseInt(h[0] + h[0], 16),
|
|
446
|
+
g: parseInt(h[1] + h[1], 16),
|
|
447
|
+
b: parseInt(h[2] + h[2], 16),
|
|
448
|
+
a: h.length === 4 ? parseInt(h[3] + h[3], 16) / 255 : 1,
|
|
449
|
+
};
|
|
450
|
+
}
|
|
451
|
+
if (h.length === 6 || h.length === 8) {
|
|
452
|
+
return {
|
|
453
|
+
r: parseInt(h.slice(0, 2), 16),
|
|
454
|
+
g: parseInt(h.slice(2, 4), 16),
|
|
455
|
+
b: parseInt(h.slice(4, 6), 16),
|
|
456
|
+
a: h.length === 8 ? parseInt(h.slice(6, 8), 16) / 255 : 1,
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
// OKLCH parser. Tailwind v4's CSS minifier squishes the space after
|
|
461
|
+
// `%` ("21.5%.02 50"), so the separator between L and C may be absent.
|
|
462
|
+
// Match L (with optional %), then C and H separated permissively.
|
|
463
|
+
m = str.match(/oklch\(\s*([\d.]+)(%?)\s*[\s,]*\s*([\d.]+)\s*[\s,]+\s*([-\d.]+)(?:deg)?(?:\s*\/\s*([\d.]+)(%)?)?\s*\)/i);
|
|
464
|
+
if (m) {
|
|
465
|
+
const Lnum = parseFloat(m[1]);
|
|
466
|
+
const L = m[2] === '%' ? Lnum / 100 : Lnum;
|
|
467
|
+
const rgb = oklchToRgb(L, parseFloat(m[3]), parseFloat(m[4]));
|
|
468
|
+
if (m[5] !== undefined) {
|
|
469
|
+
const alpha = parseFloat(m[5]);
|
|
470
|
+
rgb.a = m[6] === '%' ? alpha / 100 : alpha;
|
|
471
|
+
}
|
|
472
|
+
return rgb;
|
|
473
|
+
}
|
|
474
|
+
// OKLAB — a/b are signed axes; percentages map 100% → 0.4.
|
|
475
|
+
m = str.match(/oklab\(\s*([\d.]+)(%?)\s+(-?[\d.]+)(%?)\s+(-?[\d.]+)(%?)(?:\s*\/\s*([\d.]+)(%)?)?\s*\)/i);
|
|
476
|
+
if (m) {
|
|
477
|
+
const L = m[2] === '%' ? parseFloat(m[1]) / 100 : parseFloat(m[1]);
|
|
478
|
+
const a = m[4] === '%' ? parseFloat(m[3]) * 0.004 : parseFloat(m[3]);
|
|
479
|
+
const b = m[6] === '%' ? parseFloat(m[5]) * 0.004 : parseFloat(m[5]);
|
|
480
|
+
const rgb = oklabToRgb(L, a, b);
|
|
481
|
+
if (m[7] !== undefined) {
|
|
482
|
+
const alpha = parseFloat(m[7]);
|
|
483
|
+
rgb.a = m[8] === '%' ? alpha / 100 : alpha;
|
|
484
|
+
}
|
|
485
|
+
return rgb;
|
|
486
|
+
}
|
|
487
|
+
// LCH / LAB — CIE, D50 white point. Chrome serializes lch(20% 5 60) as
|
|
488
|
+
// `lch(20 5 60)`, so L arrives with or without its percent sign. In both
|
|
489
|
+
// spaces L runs 0..100 and 100% means 100.
|
|
490
|
+
m = str.match(/^lch\(\s*([\d.]+%?|none)\s+([\d.]+%?|none)\s+(-?[\d.]+)(?:deg)?(?:\s*\/\s*([\d.]+%?|none))?\s*\)$/i);
|
|
491
|
+
if (m) {
|
|
492
|
+
const L = parseColorComponent(m[1], 100);
|
|
493
|
+
const C = parseColorComponent(m[2], 150);
|
|
494
|
+
const H = parseFloat(m[3]);
|
|
495
|
+
if (L == null || C == null || !Number.isFinite(H)) return null;
|
|
496
|
+
const rgb = lchToRgb(L, C, H);
|
|
497
|
+
rgb.a = parseAlphaToken(m[4]);
|
|
498
|
+
return rgb;
|
|
499
|
+
}
|
|
500
|
+
m = str.match(/^lab\(\s*([\d.]+%?|none)\s+(-?[\d.]+%?|none)\s+(-?[\d.]+%?|none)(?:\s*\/\s*([\d.]+%?|none))?\s*\)$/i);
|
|
501
|
+
if (m) {
|
|
502
|
+
const L = parseColorComponent(m[1], 100);
|
|
503
|
+
const a = parseColorComponent(m[2], 125);
|
|
504
|
+
const b = parseColorComponent(m[3], 125);
|
|
505
|
+
if (L == null || a == null || b == null) return null;
|
|
506
|
+
const rgb = labToRgb(L, a, b);
|
|
507
|
+
rgb.a = parseAlphaToken(m[4]);
|
|
508
|
+
return rgb;
|
|
509
|
+
}
|
|
510
|
+
// color(<space> c1 c2 c3 [/ alpha]) — what Chrome hands back for most
|
|
511
|
+
// color-mix() results and for any wide-gamut color an author wrote.
|
|
512
|
+
m = str.match(/^color\(\s*([a-z0-9-]+)\s+(-?[\d.eE+-]+%?|none)\s+(-?[\d.eE+-]+%?|none)\s+(-?[\d.eE+-]+%?|none)(?:\s*\/\s*([\d.]+%?|none))?\s*\)$/i);
|
|
513
|
+
if (m) {
|
|
514
|
+
const c1 = parseColorComponent(m[2]);
|
|
515
|
+
const c2 = parseColorComponent(m[3]);
|
|
516
|
+
const c3 = parseColorComponent(m[4]);
|
|
517
|
+
if (c1 == null || c2 == null || c3 == null) return null;
|
|
518
|
+
const rgb = colorFunctionToRgb(m[1].toLowerCase(), c1, c2, c3);
|
|
519
|
+
if (!rgb) return null;
|
|
520
|
+
rgb.a = parseAlphaToken(m[5]);
|
|
521
|
+
return rgb;
|
|
522
|
+
}
|
|
523
|
+
// HSL/HSLA — comma or space syntax, optional deg on hue.
|
|
524
|
+
m = str.match(/hsla?\(\s*(-?[\d.]+)(?:deg)?\s*[,\s]\s*([\d.]+)%\s*[,\s]\s*([\d.]+)%(?:\s*[,/]\s*([\d.]+)(%)?)?\s*\)/i);
|
|
525
|
+
if (m) {
|
|
526
|
+
const rgb = hslToRgb(parseFloat(m[1]), parseFloat(m[2]) / 100, parseFloat(m[3]) / 100);
|
|
527
|
+
if (m[4] !== undefined) {
|
|
528
|
+
const alpha = parseFloat(m[4]);
|
|
529
|
+
rgb.a = m[5] === '%' ? alpha / 100 : alpha;
|
|
530
|
+
}
|
|
531
|
+
return rgb;
|
|
532
|
+
}
|
|
533
|
+
// HWB — hue whiteness% blackness%.
|
|
534
|
+
m = str.match(/hwb\(\s*(-?[\d.]+)(?:deg)?\s+([\d.]+)%\s+([\d.]+)%(?:\s*\/\s*([\d.]+)(%)?)?\s*\)/i);
|
|
535
|
+
if (m) {
|
|
536
|
+
const rgb = hwbToRgb(parseFloat(m[1]), parseFloat(m[2]) / 100, parseFloat(m[3]) / 100);
|
|
537
|
+
if (m[4] !== undefined) {
|
|
538
|
+
const alpha = parseFloat(m[4]);
|
|
539
|
+
rgb.a = m[5] === '%' ? alpha / 100 : alpha;
|
|
540
|
+
}
|
|
541
|
+
return rgb;
|
|
542
|
+
}
|
|
543
|
+
const named = CSS_NAMED_COLORS[str.toLowerCase()];
|
|
544
|
+
if (named) return { ...named, a: 1 };
|
|
545
|
+
return null;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
// True when a computed background-color string names no paint at all. Used to
|
|
549
|
+
// tell "this layer is see-through" (walk on to the ancestor) apart from "this
|
|
550
|
+
// layer has a color we could not read" (stop and abstain).
|
|
551
|
+
//
|
|
552
|
+
// `inherit` belongs here even though it is not literally see-through: it means
|
|
553
|
+
// "paint with the parent's background-color", and walking on to the parent IS
|
|
554
|
+
// that resolution. Real browsers resolve the keyword before getComputedStyle
|
|
555
|
+
// output; only jsdom's partial cascade hands it through verbatim, and treating
|
|
556
|
+
// it as unreadable would make the walk abstain on a surface it can know.
|
|
557
|
+
// (`currentcolor` is NOT here — it is real paint in the element's own text
|
|
558
|
+
// color; resolveBackgroundInfo substitutes the computed color for it.)
|
|
559
|
+
function isNoPaintColorValue(value) {
|
|
560
|
+
const v = String(value || '').trim().toLowerCase();
|
|
561
|
+
if (!v) return true;
|
|
562
|
+
return v === 'transparent' || v === 'none' || v === 'initial' || v === 'inherit' || v === 'unset' || v === 'revert' || v === 'revert-layer';
|
|
563
|
+
}
|
|
564
|
+
|
|
115
565
|
export {
|
|
116
566
|
isNeutralColor,
|
|
117
567
|
parseRgb,
|
|
118
568
|
relativeLuminance,
|
|
119
569
|
contrastRatio,
|
|
120
570
|
parseGradientColors,
|
|
571
|
+
extractColorFunctionTokens,
|
|
121
572
|
hasChroma,
|
|
122
573
|
getHue,
|
|
123
574
|
colorToHex,
|
|
575
|
+
oklabToRgb,
|
|
576
|
+
oklchToRgb,
|
|
577
|
+
labToRgb,
|
|
578
|
+
lchToRgb,
|
|
579
|
+
colorFunctionToRgb,
|
|
580
|
+
hslToRgb,
|
|
581
|
+
hwbToRgb,
|
|
582
|
+
CSS_NAMED_COLORS,
|
|
583
|
+
splitTopLevelCommas,
|
|
584
|
+
parseColorMix,
|
|
585
|
+
parseAnyColor,
|
|
586
|
+
compositeColorOver,
|
|
587
|
+
isNoPaintColorValue,
|
|
124
588
|
};
|
|
@@ -33,6 +33,7 @@ import {
|
|
|
33
33
|
stampProductSchema,
|
|
34
34
|
} from './lib/artifact-schema.mjs';
|
|
35
35
|
import {
|
|
36
|
+
checkBuildPathUnset,
|
|
36
37
|
checkConfig,
|
|
37
38
|
checkDesignSidecar,
|
|
38
39
|
checkNativePlatformEvidence,
|
|
@@ -120,6 +121,7 @@ async function collect(cwd, targetOptions) {
|
|
|
120
121
|
...checkDesignDrift({ designPath: absDesignPath, projectRoot }),
|
|
121
122
|
...checkDesignCoverage({ design: ctx.design, designPath: ctx.designPath, parseDesignMd }),
|
|
122
123
|
...checkConfig({ projectRoot, repoRoot: ctx.repoRoot }),
|
|
124
|
+
...checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }),
|
|
123
125
|
...checkDetectorIgnores({ projectRoot, knownRuleIds }),
|
|
124
126
|
...checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }),
|
|
125
127
|
...checkHookInstallation({
|