@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
|
@@ -22,6 +22,9 @@
|
|
|
22
22
|
* dedupeAgainstCache(findings, cache, sessionId, filePath)
|
|
23
23
|
* renderTemplate(findings, filePath, config, opts)
|
|
24
24
|
* renderCleanAck(filePath, opts) / renderPendingAck(filePath, known, opts)
|
|
25
|
+
* appendDesignSystemNote(text, scanOptions) / appendDesignSystemNoteOnce(text, scanOptions, cache, sessionId, config)
|
|
26
|
+
* designNoteReserve(scanOptions, cache, sessionId)
|
|
27
|
+
* footerModeForSession(cache, sessionId) / commitFooterShown(cache, sessionId, text)
|
|
25
28
|
* shouldEmitAckForFile(filePath, config?)
|
|
26
29
|
* writeAuditLog(env, entry)
|
|
27
30
|
* loadDetector() -> Promise<{ detectText, detectHtml }>
|
|
@@ -873,6 +876,9 @@ function extractFindingIgnoreValueRaw(finding, rule = normalizeIgnoreRule(findin
|
|
|
873
876
|
const primary = text.match(/Primary font:\s*([^()\n;]+)/i);
|
|
874
877
|
if (primary) return cleanIgnoreValueDisplay(primary[1]);
|
|
875
878
|
|
|
879
|
+
const googleLabel = text.match(/Google Fonts:\s*([^()\n;]+)/i);
|
|
880
|
+
if (googleLabel) return cleanIgnoreValueDisplay(googleLabel[1]);
|
|
881
|
+
|
|
876
882
|
const family = text.match(/font-family\s*:\s*["']?([^'",;\n]+)/i);
|
|
877
883
|
if (family) return cleanIgnoreValueDisplay(family[1]);
|
|
878
884
|
|
|
@@ -960,7 +966,13 @@ export function renderTemplate(findings, filePath, config, opts = {}) {
|
|
|
960
966
|
if (!Array.isArray(findings) || findings.length === 0) return '';
|
|
961
967
|
const limits = config?.limits || DEFAULT_CONFIG.limits;
|
|
962
968
|
const cap = Math.max(1, limits.maxFindings || DEFAULT_CONFIG.limits.maxFindings);
|
|
963
|
-
|
|
969
|
+
// reserveChars holds back room for a note the caller appends after render
|
|
970
|
+
// (the DESIGN.md staleness note), so the final payload stays inside the
|
|
971
|
+
// configured budget. It comes off after the 500-char floor, so at floor
|
|
972
|
+
// configs the note keeps guaranteed delivery room; the clamp budget can
|
|
973
|
+
// therefore sit below 500, which clampLastLine's footer-preserving
|
|
974
|
+
// fallback handles (Bugbot on PR #508).
|
|
975
|
+
const maxChars = Math.max(500, limits.maxChars || DEFAULT_CONFIG.limits.maxChars) - (opts.reserveChars || 0);
|
|
964
976
|
|
|
965
977
|
const cwd = opts.cwd || process.cwd();
|
|
966
978
|
const display = relativize(filePath, cwd);
|
|
@@ -969,11 +981,12 @@ export function renderTemplate(findings, filePath, config, opts = {}) {
|
|
|
969
981
|
const remaining = total - shown.length;
|
|
970
982
|
|
|
971
983
|
const header = `${ENVELOPE_PREFIX} Design hook findings requiring review in ${display} (${total} issue(s)):`;
|
|
972
|
-
const
|
|
984
|
+
const seenRules = new Set();
|
|
985
|
+
const lines = shown.map((f) => formatDedupedFindingLine(f, seenRules));
|
|
973
986
|
const more = remaining > 0
|
|
974
987
|
? `... and ${remaining} more (see ${IMPECCABLE_COMMAND} audit).`
|
|
975
988
|
: null;
|
|
976
|
-
const footer = directiveFooter(
|
|
989
|
+
const footer = directiveFooter({ mode: opts.footer });
|
|
977
990
|
|
|
978
991
|
const blocks = [header, ...lines];
|
|
979
992
|
if (more) blocks.push(more);
|
|
@@ -997,12 +1010,15 @@ function renderGroupedTemplate(groups, config, opts = {}) {
|
|
|
997
1010
|
|
|
998
1011
|
const limits = config?.limits || DEFAULT_CONFIG.limits;
|
|
999
1012
|
const cap = Math.max(1, limits.maxFindings || DEFAULT_CONFIG.limits.maxFindings);
|
|
1000
|
-
const maxChars = Math.max(500, limits.maxChars || DEFAULT_CONFIG.limits.maxChars);
|
|
1013
|
+
const maxChars = Math.max(500, limits.maxChars || DEFAULT_CONFIG.limits.maxChars) - (opts.reserveChars || 0);
|
|
1001
1014
|
const cwd = opts.cwd || process.cwd();
|
|
1002
1015
|
const total = realGroups.reduce((sum, group) => sum + group.findings.length, 0);
|
|
1003
1016
|
const header = `${ENVELOPE_PREFIX} Design hook findings requiring review across ${realGroups.length} files (${total} issue(s)):`;
|
|
1004
1017
|
const lines = [];
|
|
1005
1018
|
let shownCount = 0;
|
|
1019
|
+
// One seen-set across all groups: a rule already described under one file
|
|
1020
|
+
// is not re-described under the next.
|
|
1021
|
+
const seenRules = new Set();
|
|
1006
1022
|
|
|
1007
1023
|
for (const group of realGroups) {
|
|
1008
1024
|
const display = relativize(group.filePath, cwd);
|
|
@@ -1010,7 +1026,7 @@ function renderGroupedTemplate(groups, config, opts = {}) {
|
|
|
1010
1026
|
const remainingCap = Math.max(0, cap - shownCount);
|
|
1011
1027
|
const shown = group.findings.slice(0, remainingCap);
|
|
1012
1028
|
for (const finding of shown) {
|
|
1013
|
-
lines.push(
|
|
1029
|
+
lines.push(formatDedupedFindingLine(finding, seenRules));
|
|
1014
1030
|
}
|
|
1015
1031
|
shownCount += shown.length;
|
|
1016
1032
|
const hidden = group.findings.length - shown.length;
|
|
@@ -1019,7 +1035,7 @@ function renderGroupedTemplate(groups, config, opts = {}) {
|
|
|
1019
1035
|
}
|
|
1020
1036
|
}
|
|
1021
1037
|
|
|
1022
|
-
const footer = directiveFooter(
|
|
1038
|
+
const footer = directiveFooter({ mode: opts.footer });
|
|
1023
1039
|
let text = [header, ...lines, '', footer].join('\n');
|
|
1024
1040
|
if (text.length > maxChars) {
|
|
1025
1041
|
text = clampGroupedToBudget(header, lines, footer, maxChars);
|
|
@@ -1027,82 +1043,149 @@ function renderGroupedTemplate(groups, config, opts = {}) {
|
|
|
1027
1043
|
return text;
|
|
1028
1044
|
}
|
|
1029
1045
|
|
|
1046
|
+
// The clamp contract, shared by both budget functions: the footer is policy,
|
|
1047
|
+
// not detail, so it survives every clamp. Try the requested footer first;
|
|
1048
|
+
// when it cannot fit even after dropping finding lines, retry with the short
|
|
1049
|
+
// policy rather than sacrifice findings that fit beside it. A result that
|
|
1050
|
+
// dropped every finding line (a grouped render can fit a bare file header)
|
|
1051
|
+
// does not count as a fit: findings are why the emission exists.
|
|
1052
|
+
const isFindingLine = (line) => line.startsWith('- ');
|
|
1053
|
+
|
|
1054
|
+
function footerFallbacks(footer) {
|
|
1055
|
+
const short = directiveFooter({ mode: 'short' });
|
|
1056
|
+
return footer === short ? [footer] : [footer, short];
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1030
1059
|
function clampGroupedToBudget(header, lines, footer, maxChars) {
|
|
1031
|
-
const assemble = (linesArr, omitted) => [
|
|
1060
|
+
const assemble = (linesArr, omitted, footerText) => [
|
|
1032
1061
|
header,
|
|
1033
1062
|
...linesArr,
|
|
1034
1063
|
...(omitted ? [`... and more (see ${IMPECCABLE_COMMAND} audit).`] : []),
|
|
1035
1064
|
'',
|
|
1036
|
-
|
|
1065
|
+
footerText,
|
|
1037
1066
|
].join('\n');
|
|
1038
1067
|
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
working.
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1068
|
+
for (const footerText of footerFallbacks(footer)) {
|
|
1069
|
+
let working = lines.slice();
|
|
1070
|
+
let omitted = false;
|
|
1071
|
+
let assembled = assemble(working, omitted, footerText);
|
|
1072
|
+
while (assembled.length > maxChars && working.length > 1) {
|
|
1073
|
+
working.pop();
|
|
1074
|
+
omitted = true;
|
|
1075
|
+
assembled = assemble(working, omitted, footerText);
|
|
1076
|
+
}
|
|
1077
|
+
if (assembled.length <= maxChars && working.some(isFindingLine)) return assembled;
|
|
1049
1078
|
}
|
|
1050
|
-
return
|
|
1079
|
+
return clampLastLine((linesArr, footerText) => assemble(linesArr, true, footerText),
|
|
1080
|
+
lines.find(isFindingLine) || lines[0], maxChars);
|
|
1051
1081
|
}
|
|
1052
1082
|
|
|
1053
1083
|
function clampToBudget(header, lines, more, footer, maxChars) {
|
|
1054
|
-
const assemble = (linesArr, moreText) => {
|
|
1084
|
+
const assemble = (linesArr, moreText, footerText) => {
|
|
1055
1085
|
const blocks = [header, ...linesArr];
|
|
1056
1086
|
if (moreText) blocks.push(moreText);
|
|
1057
1087
|
blocks.push('');
|
|
1058
|
-
blocks.push(
|
|
1088
|
+
blocks.push(footerText);
|
|
1059
1089
|
return blocks.join('\n');
|
|
1060
1090
|
};
|
|
1061
1091
|
|
|
1062
|
-
let
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
working
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
}
|
|
1075
|
-
|
|
1076
|
-
|
|
1092
|
+
let lastMore = more;
|
|
1093
|
+
for (const footerText of footerFallbacks(footer)) {
|
|
1094
|
+
let working = lines.slice();
|
|
1095
|
+
let moreText = more;
|
|
1096
|
+
let assembled = assemble(working, moreText, footerText);
|
|
1097
|
+
while (assembled.length > maxChars && working.length > 1) {
|
|
1098
|
+
working.pop();
|
|
1099
|
+
moreText = `... and more (see ${IMPECCABLE_COMMAND} audit).`;
|
|
1100
|
+
assembled = assemble(working, moreText, footerText);
|
|
1101
|
+
}
|
|
1102
|
+
lastMore = moreText;
|
|
1103
|
+
if (assembled.length <= maxChars) return assembled;
|
|
1104
|
+
}
|
|
1105
|
+
return clampLastLine((linesArr, footerText) => assemble(linesArr, lastMore, footerText),
|
|
1106
|
+
lines.find(isFindingLine) || lines[0], maxChars);
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
// Last resort with one finding line left: the short policy gets the budget
|
|
1110
|
+
// first, the line is clipped to what remains. The pre-fix tail-slice cut
|
|
1111
|
+
// whatever happened to be last, which was always the footer.
|
|
1112
|
+
function clampLastLine(build, line, maxChars) {
|
|
1113
|
+
const footerText = directiveFooter({ mode: 'short' });
|
|
1114
|
+
const bare = build([], footerText);
|
|
1115
|
+
// +1 for the newline the line itself brings when it joins the blocks.
|
|
1116
|
+
const room = maxChars - bare.length - 1;
|
|
1117
|
+
if (room >= 24) {
|
|
1118
|
+
const clipped = line.length > room ? `${line.slice(0, room - 1)}…` : line;
|
|
1119
|
+
return build([clipped], footerText);
|
|
1120
|
+
}
|
|
1121
|
+
// No room for even a clipped finding line: the note reservation can pull
|
|
1122
|
+
// the budget below the 500-char floor, and a deep file path can push the
|
|
1123
|
+
// header past what remains beside the short policy (Bugbot on PR #508).
|
|
1124
|
+
// Drop the line, and if the bare header + policy still overflow, clip the
|
|
1125
|
+
// head. Never tail-slice: the footer sits at the end, so a tail slice is
|
|
1126
|
+
// exactly the footer cut this renderer exists to prevent.
|
|
1127
|
+
if (bare.length <= maxChars) return bare;
|
|
1128
|
+
const head = bare.slice(0, Math.max(0, maxChars - footerText.length - 4));
|
|
1129
|
+
return `${head}…\n\n${footerText}`;
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
// `compact` drops the registry description: within one emission the first
|
|
1133
|
+
// occurrence of a rule carries the full description and repeats keep only the
|
|
1134
|
+
// rule id, name, and their own ignore hint (values differ per line, so the
|
|
1135
|
+
// hint must survive the dedupe).
|
|
1136
|
+
function formatFindingLine(f, opts = {}) {
|
|
1077
1137
|
const prefix = f.line && f.line > 0 ? `- L${f.line}` : '-';
|
|
1078
|
-
const desc = (f.description || '').trim();
|
|
1138
|
+
const desc = opts.compact ? '' : (f.description || '').trim();
|
|
1079
1139
|
const name = (f.name || '').trim();
|
|
1080
1140
|
// Description from the registry already ends in punctuation; join with a
|
|
1081
1141
|
// single space. `name` may have a trailing period already, keep it clean.
|
|
1082
1142
|
const nameSegment = name ? `${name.replace(/\.+\s*$/, '')}.` : '';
|
|
1083
|
-
const
|
|
1084
|
-
const ignoreSegment =
|
|
1085
|
-
? ` If the user explicitly confirms this value is intentional: \`${ignoreCommand}\`.`
|
|
1086
|
-
: '';
|
|
1143
|
+
const ignoreHint = formatFindingIgnoreHint(f);
|
|
1144
|
+
const ignoreSegment = ignoreHint ? ` If intentional: \`${ignoreHint}\`.` : '';
|
|
1087
1145
|
return `${prefix} [${f.antipattern}] ${nameSegment} ${desc}${ignoreSegment}`.replace(/\s+/g, ' ').trim();
|
|
1088
1146
|
}
|
|
1089
1147
|
|
|
1090
|
-
|
|
1148
|
+
// Dedupe applied in shown-line order, so the first rendered occurrence of a
|
|
1149
|
+
// rule always carries the description. The budget clamps pop lines from the
|
|
1150
|
+
// end, which can never orphan a compact repeat before its described first
|
|
1151
|
+
// occurrence.
|
|
1152
|
+
function formatDedupedFindingLine(finding, seenRules) {
|
|
1153
|
+
const rule = normalizeIgnoreRule(finding?.antipattern);
|
|
1154
|
+
const compact = rule ? seenRules.has(rule) : false;
|
|
1155
|
+
if (rule) seenRules.add(rule);
|
|
1156
|
+
return formatFindingLine(finding, { compact });
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
// The rule/value pair the footer's `hook-admin.mjs ignore-value` command
|
|
1160
|
+
// takes. Deliberately just the args: the executable prefix, the --reason
|
|
1161
|
+
// contract, and the disclosure rule live in the directive footer, stated once
|
|
1162
|
+
// instead of per line.
|
|
1163
|
+
function formatFindingIgnoreHint(finding) {
|
|
1091
1164
|
if (!finding || typeof finding !== 'object') return '';
|
|
1092
1165
|
const rule = normalizeIgnoreRule(finding.antipattern);
|
|
1093
1166
|
if (!rule) return '';
|
|
1094
1167
|
const normalizedValue = extractFindingIgnoreValue(finding);
|
|
1095
1168
|
if (!normalizedValue) return '';
|
|
1096
|
-
const
|
|
1097
|
-
|
|
1098
|
-
const reason = quoteCommandArg(`User confirmed ${value} is intentional`);
|
|
1099
|
-
return `${IMPECCABLE_COMMAND} hooks ignore-value ${rule} ${valueArg} --shared --reason ${reason}`;
|
|
1169
|
+
const valueArg = quoteCommandArg(extractFindingIgnoreValueRaw(finding));
|
|
1170
|
+
return `ignore-value ${rule} ${valueArg}`;
|
|
1100
1171
|
}
|
|
1101
1172
|
|
|
1102
1173
|
function quoteCommandArg(value) {
|
|
1103
1174
|
const text = String(value || '').trim();
|
|
1104
1175
|
if (/^[A-Za-z0-9._:-]+$/.test(text)) return text;
|
|
1105
|
-
|
|
1176
|
+
// The suggestion is meant to be run on this same machine, so quote for its
|
|
1177
|
+
// shell. POSIX /bin/sh still expands $(...), backticks, and ${} inside
|
|
1178
|
+
// double quotes, and these values come from scanned file content (a
|
|
1179
|
+
// font-family name) or a file path, so untrusted input must be
|
|
1180
|
+
// single-quoted (issue #476). Windows cmd.exe performs no such command
|
|
1181
|
+
// substitution, but it treats a single quote as a literal character rather
|
|
1182
|
+
// than a grouping delimiter, so a value or path containing spaces has to
|
|
1183
|
+
// stay double-quoted there (Greptile #533). Keep the pre-existing
|
|
1184
|
+
// double-quote escaping on Windows so that path's behavior is unchanged.
|
|
1185
|
+
if (process.platform === 'win32') {
|
|
1186
|
+
return `"${text.replace(/\\/g, '\\\\').replace(/"/g, '\\"')}"`;
|
|
1187
|
+
}
|
|
1188
|
+
return `'${text.replace(/'/g, `'\\''`)}'`;
|
|
1106
1189
|
}
|
|
1107
1190
|
|
|
1108
1191
|
function relativize(filePath, cwd) {
|
|
@@ -1297,6 +1380,51 @@ function isInsideProject(filePath, projectCwd) {
|
|
|
1297
1380
|
}
|
|
1298
1381
|
}
|
|
1299
1382
|
|
|
1383
|
+
// Resolve a path to its canonical (symlink-free) form. When the path does
|
|
1384
|
+
// not exist yet — the before-edit hook gates proposed Writes — canonicalize
|
|
1385
|
+
// the nearest existing ancestor and re-append the remainder, so a new file
|
|
1386
|
+
// under a symlinked root still compares equal to its canonical project.
|
|
1387
|
+
// Memoized: the hook runs as a fresh process per tool event, so the cache
|
|
1388
|
+
// amounts to once-per-event work — the scan loops re-check the same project
|
|
1389
|
+
// root for every target file. The cap only matters to long-lived importers
|
|
1390
|
+
// like the test runner.
|
|
1391
|
+
const canonicalPathCache = new Map();
|
|
1392
|
+
const CANONICAL_PATH_CACHE_MAX = 1024;
|
|
1393
|
+
|
|
1394
|
+
function canonicalPath(p) {
|
|
1395
|
+
const resolved = path.resolve(p);
|
|
1396
|
+
if (canonicalPathCache.has(resolved)) return canonicalPathCache.get(resolved);
|
|
1397
|
+
let canonical = resolved;
|
|
1398
|
+
let dir = resolved;
|
|
1399
|
+
const tail = [];
|
|
1400
|
+
while (true) {
|
|
1401
|
+
try {
|
|
1402
|
+
canonical = tail.length ? path.join(fs.realpathSync(dir), ...tail) : fs.realpathSync(dir);
|
|
1403
|
+
break;
|
|
1404
|
+
} catch { /* keep climbing */ }
|
|
1405
|
+
const parent = path.dirname(dir);
|
|
1406
|
+
if (parent === dir) break;
|
|
1407
|
+
tail.unshift(path.basename(dir));
|
|
1408
|
+
dir = parent;
|
|
1409
|
+
}
|
|
1410
|
+
if (canonicalPathCache.size >= CANONICAL_PATH_CACHE_MAX) canonicalPathCache.clear();
|
|
1411
|
+
canonicalPathCache.set(resolved, canonical);
|
|
1412
|
+
return canonical;
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
// Containment gate shared by the before-edit hook and both scan passes. A
|
|
1416
|
+
// session routinely touches files that belong to no project or to a
|
|
1417
|
+
// different one — harness scratchpad dirs under the system temp root,
|
|
1418
|
+
// sibling checkouts, one-off throwaway HTML — and findings against those are
|
|
1419
|
+
// judged with THIS project's config and DESIGN.md palette, which is never
|
|
1420
|
+
// right. Skip them (audit reason: outside-project). Paths are canonicalized
|
|
1421
|
+
// first so a symlinked root (macOS /tmp -> /private/tmp) doesn't split the
|
|
1422
|
+
// comparison.
|
|
1423
|
+
export function isScanTargetInsideProject(filePath, projectCwd) {
|
|
1424
|
+
if (!filePath || !projectCwd) return false;
|
|
1425
|
+
return isInsideProject(canonicalPath(filePath), canonicalPath(projectCwd));
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1300
1428
|
export function parseStaticStyleImports(content, fromFile, projectCwd) {
|
|
1301
1429
|
if (!content || typeof content !== 'string') return [];
|
|
1302
1430
|
const dir = path.dirname(fromFile);
|
|
@@ -1511,36 +1639,105 @@ export function designSystemOptions(config, detector, projectCwd) {
|
|
|
1511
1639
|
}
|
|
1512
1640
|
}
|
|
1513
1641
|
|
|
1642
|
+
const DESIGN_STALE_NOTE = `${ENVELOPE_PREFIX} DESIGN.md is newer than .impeccable/design.json. Run ${IMPECCABLE_COMMAND} document to refresh the design-system sidecar.`;
|
|
1643
|
+
|
|
1514
1644
|
export function appendDesignSystemNote(text, scanOptions) {
|
|
1515
1645
|
if (!text || !scanOptions?.designSystem?.mdNewerThanJson) return text;
|
|
1516
|
-
return `${text}\n\n${
|
|
1646
|
+
return `${text}\n\n${DESIGN_STALE_NOTE}`;
|
|
1517
1647
|
}
|
|
1518
1648
|
|
|
1649
|
+
// Session-scoped once-only gate for repeat-prone message parts. Returns true
|
|
1650
|
+
// the first time a flag is consumed in a session and false after, mirroring
|
|
1651
|
+
// the `cleanAcked` mechanic: the mtime skew (and the policy footer) do not
|
|
1652
|
+
// change between edits, so re-stating them on every emission spends context
|
|
1653
|
+
// to say nothing new. Callers must persist the cache for the flag to stick.
|
|
1654
|
+
function consumeSessionNoticeFlag(cache, sessionId, flag) {
|
|
1655
|
+
const session = ensureSession(cache, sessionId);
|
|
1656
|
+
if (session[flag]) return false;
|
|
1657
|
+
session[flag] = true;
|
|
1658
|
+
session.updatedAt = Date.now();
|
|
1659
|
+
return true;
|
|
1660
|
+
}
|
|
1661
|
+
|
|
1662
|
+
// Once-per-session variant of appendDesignSystemNote for the emission paths
|
|
1663
|
+
// that have cache access. The staleness note names standing project state,
|
|
1664
|
+
// not new information, so one mention per session is enough. The note is
|
|
1665
|
+
// appended after the renderer has clamped to the configured budget: render
|
|
1666
|
+
// paths reserve room for it via designNoteReserve, and the size check here
|
|
1667
|
+
// is the safety net for the ack paths, deferring (without consuming the
|
|
1668
|
+
// flag) to a later emission rather than busting maxChars.
|
|
1669
|
+
export function appendDesignSystemNoteOnce(text, scanOptions, cache, sessionId, config) {
|
|
1670
|
+
if (!text || !scanOptions?.designSystem?.mdNewerThanJson) return text;
|
|
1671
|
+
const maxChars = Math.max(500, config?.limits?.maxChars || DEFAULT_CONFIG.limits.maxChars);
|
|
1672
|
+
if (text.length + DESIGN_STALE_NOTE.length + 2 > maxChars) return text;
|
|
1673
|
+
if (!consumeSessionNoticeFlag(cache, sessionId, 'designNoteShown')) return text;
|
|
1674
|
+
return appendDesignSystemNote(text, scanOptions);
|
|
1675
|
+
}
|
|
1676
|
+
|
|
1677
|
+
// Render-time reservation for the note above: how many characters the
|
|
1678
|
+
// renderer must hold back so a pending staleness note still fits inside the
|
|
1679
|
+
// configured budget. Zero once the session has seen the note. Without the
|
|
1680
|
+
// reservation, a session whose every emission fills the budget would defer
|
|
1681
|
+
// the note forever.
|
|
1682
|
+
export function designNoteReserve(scanOptions, cache, sessionId) {
|
|
1683
|
+
if (!scanOptions?.designSystem?.mdNewerThanJson) return 0;
|
|
1684
|
+
if (ensureSession(cache, sessionId).designNoteShown) return 0;
|
|
1685
|
+
return DESIGN_STALE_NOTE.length + 2;
|
|
1686
|
+
}
|
|
1687
|
+
|
|
1688
|
+
// Full directive footer once per session, the short reminder after. Fresh
|
|
1689
|
+
// emissions and denials share the session flag (`footerShown`), so a session
|
|
1690
|
+
// pays the full policy exactly once however it first fires. The mode
|
|
1691
|
+
// is a peek: the clamp can downgrade a requested full footer under a tight
|
|
1692
|
+
// budget, so the flag commits only when the complete full policy actually
|
|
1693
|
+
// reached the output. Matching the whole footer text (not a sentinel) keeps
|
|
1694
|
+
// the flag honest against any truncation that spares the opening words.
|
|
1695
|
+
export function footerModeForSession(cache, sessionId) {
|
|
1696
|
+
return ensureSession(cache, sessionId).footerShown ? 'short' : 'full';
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
export function commitFooterShown(cache, sessionId, text) {
|
|
1700
|
+
if (!text || !text.includes(directiveFooter())) return;
|
|
1701
|
+
const session = ensureSession(cache, sessionId);
|
|
1702
|
+
if (session.footerShown) return;
|
|
1703
|
+
session.footerShown = true;
|
|
1704
|
+
session.updatedAt = Date.now();
|
|
1705
|
+
}
|
|
1706
|
+
|
|
1707
|
+
const HOOK_ADMIN_COMMAND = `node ${quoteCommandArg(path.join(__dirname, 'hook-admin.mjs'))}`;
|
|
1708
|
+
|
|
1519
1709
|
// The directive footer is the part of the hook output that steers model
|
|
1520
|
-
// behavior.
|
|
1521
|
-
// 1. **Imperative, not advisory.** "
|
|
1522
|
-
// revising..." which the model treats as a soft suggestion
|
|
1523
|
-
//
|
|
1524
|
-
//
|
|
1525
|
-
//
|
|
1526
|
-
//
|
|
1527
|
-
//
|
|
1528
|
-
//
|
|
1529
|
-
//
|
|
1530
|
-
//
|
|
1531
|
-
//
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1710
|
+
// behavior. Intentional moves, in order:
|
|
1711
|
+
// 1. **Imperative, not advisory.** "Triage each finding..." beats
|
|
1712
|
+
// "Consider revising...", which the model treats as a soft suggestion.
|
|
1713
|
+
// 2. **Positive triage branches.** Fix / suppress-and-disclose / ask. The
|
|
1714
|
+
// suppress branch names the calibration examples (demo, fixture,
|
|
1715
|
+
// documented bad design, user-confirmed choice) because the agent now
|
|
1716
|
+
// acts on its own confidence and needs the bar stated.
|
|
1717
|
+
// 3. **Executable ignore path.** The old footer named only the slash
|
|
1718
|
+
// command, which an agent reacting to hook output cannot run; the
|
|
1719
|
+
// hook-admin.mjs invocation is runnable as-is and keeps agents out of
|
|
1720
|
+
// hand-editing config.json.
|
|
1721
|
+
// 4. **Honest provenance.** The --reason is the audit trail; "user
|
|
1722
|
+
// confirmed" appears only when the user actually did.
|
|
1723
|
+
// 5. **Acknowledgement instruction.** Hook output is injected as
|
|
1724
|
+
// developer-role context, so the reply is where the user sees the
|
|
1725
|
+
// resolution, including any ignore the agent persisted.
|
|
1726
|
+
// 6. **Once per session.** The full policy emits on the session's first
|
|
1727
|
+
// fire; later emissions carry the one-line short form (mode 'short').
|
|
1728
|
+
function directiveFooter(opts = {}) {
|
|
1729
|
+
if (opts.mode === 'short') {
|
|
1730
|
+
// No command path here: the session's first emission already gave the
|
|
1731
|
+
// runnable hook-admin.mjs invocation, and restating ~70 chars of absolute
|
|
1732
|
+
// path on every repeat is the duplication this mode exists to cut.
|
|
1733
|
+
return 'Triage per the session policy: fix real problems; persist confident false-positive or sanctioned-exception ignores via `hook-admin.mjs ignore-value` and disclose them in your reply; unsure, ask in one line.';
|
|
1734
|
+
}
|
|
1538
1735
|
return [
|
|
1539
|
-
'
|
|
1540
|
-
'',
|
|
1541
|
-
|
|
1542
|
-
'',
|
|
1543
|
-
`
|
|
1736
|
+
'Triage each finding, then state in your reply what you fixed, what you suppressed, and what you left standing:',
|
|
1737
|
+
'- Real design problem: fix it. Keep intentional design as designed.',
|
|
1738
|
+
`- Confident false positive or sanctioned exception (an intentional demo or fixture, documentation of bad design, literal or domain-appropriate motion, a choice the user confirmed): persist the narrowest ignore yourself and disclose it. Run \`${HOOK_ADMIN_COMMAND} ignore-value <rule> "<value>" --reason "<who decided: evidence>"\` with the pair shown on the finding line, or value "*" plus \`--file <path>\` when the line shows none. Write "user confirmed" in a reason only when the user did.`,
|
|
1739
|
+
'- Unsure: leave it as is and ask the user in one line.',
|
|
1740
|
+
`Self-serve ends at ignore-value: \`ignore-file\` and \`ignore-rule\` need the user's explicit approval, and never add an ignore to push a blocked write through. Full suppression ladder: ${IMPECCABLE_COMMAND} hooks.`,
|
|
1544
1741
|
].join('\n');
|
|
1545
1742
|
}
|
|
1546
1743
|
|
|
@@ -1655,6 +1852,10 @@ export async function runHook({ stdinJson, env = {}, cwd = process.cwd(), now =
|
|
|
1655
1852
|
lastSkip = 'file-missing';
|
|
1656
1853
|
continue;
|
|
1657
1854
|
}
|
|
1855
|
+
if (!isScanTargetInsideProject(filePath, projectCwd)) {
|
|
1856
|
+
lastSkip = 'outside-project';
|
|
1857
|
+
continue;
|
|
1858
|
+
}
|
|
1658
1859
|
|
|
1659
1860
|
const maxFileBytes = config.limits?.maxFileBytes ?? DEFAULT_CONFIG.limits.maxFileBytes;
|
|
1660
1861
|
if (maxFileBytes > 0) {
|
|
@@ -1758,20 +1959,23 @@ export async function runHook({ stdinJson, env = {}, cwd = process.cwd(), now =
|
|
|
1758
1959
|
}
|
|
1759
1960
|
}
|
|
1760
1961
|
|
|
1761
|
-
//
|
|
1762
|
-
//
|
|
1763
|
-
// too (the Stop deep pass needs the touched-file list to surface them),
|
|
1764
|
-
// and an already-present `.impeccable/` dir marks a project that opted
|
|
1765
|
-
// in. A non-UI edit, or a clean UI edit in a project with no Impeccable
|
|
1766
|
-
// footprint, must be a no-op on disk (issues #344, #305).
|
|
1767
|
-
if (freshGroups.length > 0 || deferredTotal > 0
|
|
1768
|
-
|| (cacheDirty && fs.existsSync(path.join(projectCwd, '.impeccable')))) {
|
|
1769
|
-
persistCache(projectCwd, cache);
|
|
1770
|
-
}
|
|
1771
|
-
|
|
1962
|
+
// The session notice flags mutate the cache, so they must settle before
|
|
1963
|
+
// the persist that makes them stick across events.
|
|
1772
1964
|
if (freshGroups.length > 0) {
|
|
1773
1965
|
const firstGroup = freshGroups[0];
|
|
1774
|
-
const
|
|
1966
|
+
const footerMode = footerModeForSession(cache, sessionId);
|
|
1967
|
+
const text = appendDesignSystemNoteOnce(
|
|
1968
|
+
renderGroupedTemplate(freshGroups, config, {
|
|
1969
|
+
cwd: projectCwd,
|
|
1970
|
+
footer: footerMode,
|
|
1971
|
+
reserveChars: designNoteReserve(scanOptions, cache, sessionId),
|
|
1972
|
+
}),
|
|
1973
|
+
scanOptions, cache, sessionId, config,
|
|
1974
|
+
);
|
|
1975
|
+
commitFooterShown(cache, sessionId, text);
|
|
1976
|
+
// Fresh findings always earn the cache write, including creating
|
|
1977
|
+
// `.impeccable/`: dedup, suppression, and the notice flags need it.
|
|
1978
|
+
persistCache(projectCwd, cache);
|
|
1775
1979
|
const allFindings = freshGroups.flatMap((group) => group.findings);
|
|
1776
1980
|
return {
|
|
1777
1981
|
exitCode: 0,
|
|
@@ -1794,6 +1998,33 @@ export async function runHook({ stdinJson, env = {}, cwd = process.cwd(), now =
|
|
|
1794
1998
|
};
|
|
1795
1999
|
}
|
|
1796
2000
|
|
|
2001
|
+
// Resolve the ack emission before the persist below: appendDesignSystem-
|
|
2002
|
+
// NoteOnce consumes a session flag, and the flag only sticks when the
|
|
2003
|
+
// write happens after it. Quiet mode emits nothing, so it consumes
|
|
2004
|
+
// nothing. The clean arm mirrors the branch order further down: pending
|
|
2005
|
+
// outranks suppression, suppression outranks clean.
|
|
2006
|
+
let ack = null;
|
|
2007
|
+
if (!quietMode && pendingWinner && shouldEmitAckForFile(pendingWinner.filePath, config)) {
|
|
2008
|
+
ack = {
|
|
2009
|
+
kind: 'pending',
|
|
2010
|
+
text: appendDesignSystemNoteOnce(renderPendingAck(pendingWinner.filePath, pendingWinner.known, { cwd: projectCwd }), scanOptions, cache, sessionId, config),
|
|
2011
|
+
};
|
|
2012
|
+
} else if (!quietMode && !suppressionWinner && cleanWinner && !cleanAckDeduped && shouldEmitAckForFile(cleanWinner.filePath, config)) {
|
|
2013
|
+
ack = {
|
|
2014
|
+
kind: 'clean',
|
|
2015
|
+
text: appendDesignSystemNoteOnce(renderCleanAck(cleanWinner.filePath, { cwd: projectCwd }), scanOptions, cache, sessionId, config),
|
|
2016
|
+
};
|
|
2017
|
+
}
|
|
2018
|
+
|
|
2019
|
+
// Persist only when the write is earned: deferred findings need the
|
|
2020
|
+
// touched-file list for the Stop deep pass, and an already-present
|
|
2021
|
+
// `.impeccable/` dir marks a project that opted in. A non-UI edit, or a
|
|
2022
|
+
// clean UI edit in a project with no Impeccable footprint, must be a
|
|
2023
|
+
// no-op on disk (issues #344, #305).
|
|
2024
|
+
if (deferredTotal > 0 || (cacheDirty && fs.existsSync(path.join(projectCwd, '.impeccable')))) {
|
|
2025
|
+
persistCache(projectCwd, cache);
|
|
2026
|
+
}
|
|
2027
|
+
|
|
1797
2028
|
if (detectorThrewAny && !pendingWinner && !cleanWinner) {
|
|
1798
2029
|
return result({ emitted: false, error: 'detector-threw', durationMs: Date.now() - started });
|
|
1799
2030
|
}
|
|
@@ -1802,8 +2033,8 @@ export async function runHook({ stdinJson, env = {}, cwd = process.cwd(), now =
|
|
|
1802
2033
|
return result({ emitted: false, quiet: true, durationMs: Date.now() - started });
|
|
1803
2034
|
}
|
|
1804
2035
|
|
|
1805
|
-
if (
|
|
1806
|
-
const text =
|
|
2036
|
+
if (ack?.kind === 'pending') {
|
|
2037
|
+
const text = ack.text;
|
|
1807
2038
|
return {
|
|
1808
2039
|
exitCode: 0,
|
|
1809
2040
|
stdout: payload(text, 'PostToolUse', harness),
|
|
@@ -1836,8 +2067,8 @@ export async function runHook({ stdinJson, env = {}, cwd = process.cwd(), now =
|
|
|
1836
2067
|
};
|
|
1837
2068
|
}
|
|
1838
2069
|
|
|
1839
|
-
if (
|
|
1840
|
-
const text =
|
|
2070
|
+
if (ack?.kind === 'clean') {
|
|
2071
|
+
const text = ack.text;
|
|
1841
2072
|
return {
|
|
1842
2073
|
exitCode: 0,
|
|
1843
2074
|
stdout: payload(text, 'PostToolUse', harness),
|
|
@@ -1985,6 +2216,10 @@ export async function runStopHook({ stdinJson, env = {}, cwd = process.cwd(), no
|
|
|
1985
2216
|
const relForMatch = relativize(filePath, projectCwd);
|
|
1986
2217
|
if (matchesAnyGlob(relForMatch, config.ignoreFiles) || matchesAnyGlob(filePath, config.ignoreFiles)) continue;
|
|
1987
2218
|
if (!fs.existsSync(filePath)) continue;
|
|
2219
|
+
// Caches written before this gate existed can still hold out-of-project
|
|
2220
|
+
// paths, so the Stop pass re-checks containment rather than trusting
|
|
2221
|
+
// the per-edit pass to have filtered them.
|
|
2222
|
+
if (!isScanTargetInsideProject(filePath, projectCwd)) continue;
|
|
1988
2223
|
|
|
1989
2224
|
scanned += 1;
|
|
1990
2225
|
let content = '';
|
|
@@ -2017,11 +2252,22 @@ export async function runStopHook({ stdinJson, env = {}, cwd = process.cwd(), no
|
|
|
2017
2252
|
return result({ emitted: false, skipped: 'stop-clean', durationMs: Date.now() - started });
|
|
2018
2253
|
}
|
|
2019
2254
|
|
|
2255
|
+
// A per-edit fire earlier in this session already consumed the footer
|
|
2256
|
+
// flag, so the Stop wall of text carries the one-line short footer.
|
|
2257
|
+
const footerMode = footerModeForSession(cache, sessionId);
|
|
2258
|
+
const text = appendDesignSystemNoteOnce(
|
|
2259
|
+
renderGroupedTemplate(freshGroups, config, {
|
|
2260
|
+
cwd: projectCwd,
|
|
2261
|
+
footer: footerMode,
|
|
2262
|
+
reserveChars: designNoteReserve(scanOptions, cache, sessionId),
|
|
2263
|
+
}),
|
|
2264
|
+
scanOptions, cache, sessionId, config,
|
|
2265
|
+
);
|
|
2266
|
+
commitFooterShown(cache, sessionId, text);
|
|
2267
|
+
|
|
2020
2268
|
// Fresh findings earn the cache write so the next Stop fire is silent
|
|
2021
|
-
// unless new issues appear.
|
|
2269
|
+
// unless new issues appear; the notice flags ride along.
|
|
2022
2270
|
persistCache(projectCwd, cache);
|
|
2023
|
-
|
|
2024
|
-
const text = appendDesignSystemNote(renderGroupedTemplate(freshGroups, config, { cwd: projectCwd }), scanOptions);
|
|
2025
2271
|
return {
|
|
2026
2272
|
exitCode: 0,
|
|
2027
2273
|
stdout: payload(text, 'Stop', harness),
|