gsd-pi 2.80.0-dev.8b3a59f5c → 2.80.0-dev.a947d025c
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -59
- package/dist/claude-cli-check.d.ts +30 -0
- package/dist/claude-cli-check.js +18 -7
- package/dist/cli.js +0 -19
- package/dist/headless-query.d.ts +10 -0
- package/dist/headless-query.js +6 -4
- package/dist/loader-entrypoint.d.ts +8 -0
- package/dist/loader-entrypoint.js +27 -0
- package/dist/loader.js +2 -11
- package/dist/mcp-server.d.ts +1 -0
- package/dist/mcp-server.js +6 -3
- package/dist/resources/.managed-resources-content-hash +1 -1
- package/dist/resources/GSD-WORKFLOW.md +2 -2
- package/dist/resources/extensions/claude-code-cli/readiness.js +18 -7
- package/dist/resources/extensions/claude-code-cli/stream-adapter.js +40 -3
- package/dist/resources/extensions/github-sync/sync.js +4 -1
- package/dist/resources/extensions/gsd/auto/contracts.js +2 -0
- package/dist/resources/extensions/gsd/auto/loop.js +103 -9
- package/dist/resources/extensions/gsd/auto/orchestrator.js +48 -4
- package/dist/resources/extensions/gsd/auto/phases.js +311 -154
- package/dist/resources/extensions/gsd/auto/resolve.js +29 -0
- package/dist/resources/extensions/gsd/auto/run-unit.js +22 -30
- package/dist/resources/extensions/gsd/auto/session.js +9 -1
- package/dist/resources/extensions/gsd/auto/unit-runner-events.js +7 -0
- package/dist/resources/extensions/gsd/auto/workflow-dispatch-claim.js +33 -1
- package/dist/resources/extensions/gsd/auto/workflow-worker-heartbeat.js +9 -1
- package/dist/resources/extensions/gsd/auto-dashboard.js +18 -0
- package/dist/resources/extensions/gsd/auto-direct-dispatch.js +5 -32
- package/dist/resources/extensions/gsd/auto-dispatch.js +26 -0
- package/dist/resources/extensions/gsd/auto-post-unit.js +122 -88
- package/dist/resources/extensions/gsd/auto-prompts.js +214 -17
- package/dist/resources/extensions/gsd/auto-recovery.js +43 -1
- package/dist/resources/extensions/gsd/auto-start.js +254 -17
- package/dist/resources/extensions/gsd/auto-supervisor.js +8 -1
- package/dist/resources/extensions/gsd/auto-timeout-recovery.js +2 -2
- package/dist/resources/extensions/gsd/auto-worktree.js +229 -336
- package/dist/resources/extensions/gsd/auto.js +273 -87
- package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +122 -11
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +44 -37
- package/dist/resources/extensions/gsd/bootstrap/dynamic-tools.js +37 -10
- package/dist/resources/extensions/gsd/bootstrap/exec-tools.js +30 -20
- package/dist/resources/extensions/gsd/bootstrap/journal-tools.js +4 -1
- package/dist/resources/extensions/gsd/bootstrap/memory-tools.js +6 -4
- package/dist/resources/extensions/gsd/bootstrap/query-tools.js +5 -3
- package/dist/resources/extensions/gsd/bootstrap/register-extension.js +1 -1
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +330 -54
- package/dist/resources/extensions/gsd/bootstrap/sanitize-complete-milestone.js +4 -0
- package/dist/resources/extensions/gsd/bootstrap/system-context.js +82 -23
- package/dist/resources/extensions/gsd/bootstrap/write-gate.js +19 -2
- package/dist/resources/extensions/gsd/clean-root-preflight.js +65 -9
- package/dist/resources/extensions/gsd/commands/dispatcher.js +5 -0
- package/dist/resources/extensions/gsd/commands/handlers/ops.js +2 -2
- package/dist/resources/extensions/gsd/commands-config.js +1 -1
- package/dist/resources/extensions/gsd/commands-eval-review.js +2 -2
- package/dist/resources/extensions/gsd/commands-handlers.js +23 -9
- package/dist/resources/extensions/gsd/context-budget.js +37 -2
- package/dist/resources/extensions/gsd/crash-recovery.js +56 -10
- package/dist/resources/extensions/gsd/dashboard-overlay.js +1 -1
- package/dist/resources/extensions/gsd/db/unit-dispatches.js +92 -0
- package/dist/resources/extensions/gsd/db-base-schema.js +4 -2
- package/dist/resources/extensions/gsd/db-migration-steps.js +6 -0
- package/dist/resources/extensions/gsd/detection.js +106 -0
- package/dist/resources/extensions/gsd/ecosystem/gsd-extension-api.js +2 -0
- package/dist/resources/extensions/gsd/git-service.js +73 -5
- package/dist/resources/extensions/gsd/gsd-db.js +46 -13
- package/dist/resources/extensions/gsd/guided-flow.js +149 -48
- package/dist/resources/extensions/gsd/health-widget.js +3 -0
- package/dist/resources/extensions/gsd/init-wizard.js +4 -1
- package/dist/resources/extensions/gsd/memory-store.js +69 -12
- package/dist/resources/extensions/gsd/migrate/command.js +40 -1
- package/dist/resources/extensions/gsd/migration-auto-check.js +87 -0
- package/dist/resources/extensions/gsd/native-git-bridge.js +32 -8
- package/dist/resources/extensions/gsd/orphan-stash-audit.js +101 -0
- package/dist/resources/extensions/gsd/parallel-orchestrator.js +13 -3
- package/dist/resources/extensions/gsd/planning-path-scope.js +26 -0
- package/dist/resources/extensions/gsd/pre-execution-checks.js +22 -0
- package/dist/resources/extensions/gsd/prompt-loader.js +28 -2
- package/dist/resources/extensions/gsd/prompts/complete-milestone.md +27 -23
- package/dist/resources/extensions/gsd/prompts/complete-slice.md +1 -1
- package/dist/resources/extensions/gsd/prompts/execute-task.md +4 -2
- package/dist/resources/extensions/gsd/prompts/parallel-research-slices.md +1 -1
- package/dist/resources/extensions/gsd/prompts/plan-milestone.md +3 -1
- package/dist/resources/extensions/gsd/prompts/plan-slice.md +1 -1
- package/dist/resources/extensions/gsd/prompts/quick-task.md +1 -5
- package/dist/resources/extensions/gsd/prompts/replan-slice.md +2 -2
- package/dist/resources/extensions/gsd/prompts/validate-milestone.md +2 -2
- package/dist/resources/extensions/gsd/quick.js +34 -2
- package/dist/resources/extensions/gsd/recovery-classification.js +94 -0
- package/dist/resources/extensions/gsd/safety/evidence-collector.js +10 -2
- package/dist/resources/extensions/gsd/slice-cadence.js +45 -2
- package/dist/resources/extensions/gsd/slice-parallel-orchestrator.js +15 -9
- package/dist/resources/extensions/gsd/state-reconciliation.js +27 -0
- package/dist/resources/extensions/gsd/tool-contract.js +50 -0
- package/dist/resources/extensions/gsd/tools/complete-milestone.js +6 -7
- package/dist/resources/extensions/gsd/tools/complete-task.js +1 -1
- package/dist/resources/extensions/gsd/tools/context-mode-tool-result.js +15 -0
- package/dist/resources/extensions/gsd/tools/exec-search-tool.js +5 -0
- package/dist/resources/extensions/gsd/tools/exec-tool.js +3 -15
- package/dist/resources/extensions/gsd/tools/memory-tools.js +1 -0
- package/dist/resources/extensions/gsd/tools/plan-slice.js +9 -0
- package/dist/resources/extensions/gsd/tools/plan-task.js +9 -0
- package/dist/resources/extensions/gsd/tools/resume-tool.js +5 -0
- package/dist/resources/extensions/gsd/tools/workflow-tool-executors.js +1 -1
- package/dist/resources/extensions/gsd/unit-context-composer.js +12 -3
- package/dist/resources/extensions/gsd/unit-runtime.js +22 -0
- package/dist/resources/extensions/gsd/workflow-protocol.js +131 -0
- package/dist/resources/extensions/gsd/worktree-lifecycle.js +958 -0
- package/dist/resources/extensions/gsd/worktree-manager.js +16 -14
- package/dist/resources/extensions/gsd/worktree-safety.js +119 -0
- package/dist/resources/extensions/gsd/worktree-state-projection.js +317 -0
- package/dist/resources/skills/web-quality-audit/scripts/analyze.sh +0 -0
- package/dist/tsconfig.extensions.tsbuildinfo +1 -1
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +16 -16
- package/dist/web/standalone/.next/build-manifest.json +3 -3
- package/dist/web/standalone/.next/prerender-manifest.json +3 -3
- package/dist/web/standalone/.next/react-loadable-manifest.json +2 -2
- package/dist/web/standalone/.next/required-server-files.json +1 -1
- package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.html +1 -1
- package/dist/web/standalone/.next/server/app/index.rsc +2 -2
- package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +2 -2
- package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app-paths-manifest.json +16 -16
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware.js +3 -3
- package/dist/web/standalone/.next/server/pages/404.html +1 -1
- package/dist/web/standalone/.next/server/pages/500.html +1 -1
- package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
- package/dist/web/standalone/.next/static/chunks/8359.e059d86b255fce1c.js +10 -0
- package/dist/web/standalone/.next/static/chunks/app/{page-fab3ebb85b006001.js → page-752f1e2ebdaa3e45.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/{webpack-0481f1221120a7c6.js → webpack-de742b64187e13fe.js} +1 -1
- package/dist/web/standalone/server.js +1 -1
- package/dist/welcome-screen.d.ts +2 -0
- package/dist/welcome-screen.js +9 -7
- package/package.json +6 -4
- package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.js +22 -17
- package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
- package/packages/mcp-server/src/workflow-tools.test.ts +75 -2
- package/packages/mcp-server/src/workflow-tools.ts +30 -16
- package/packages/mcp-server/tsconfig.tsbuildinfo +1 -1
- package/packages/native/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/agent-loop.js +4 -1
- package/packages/pi-agent-core/dist/agent-loop.js.map +1 -1
- package/packages/pi-agent-core/dist/agent.d.ts +9 -2
- package/packages/pi-agent-core/dist/agent.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/agent.js +43 -11
- package/packages/pi-agent-core/dist/agent.js.map +1 -1
- package/packages/pi-agent-core/dist/index.d.ts +1 -0
- package/packages/pi-agent-core/dist/index.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/index.js +2 -0
- package/packages/pi-agent-core/dist/index.js.map +1 -1
- package/packages/pi-agent-core/dist/token-audit.d.ts +47 -0
- package/packages/pi-agent-core/dist/token-audit.d.ts.map +1 -0
- package/packages/pi-agent-core/dist/token-audit.js +221 -0
- package/packages/pi-agent-core/dist/token-audit.js.map +1 -0
- package/packages/pi-agent-core/dist/types.d.ts +31 -0
- package/packages/pi-agent-core/dist/types.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/types.js.map +1 -1
- package/packages/pi-agent-core/src/agent-loop.test.ts +128 -0
- package/packages/pi-agent-core/src/agent-loop.ts +4 -1
- package/packages/pi-agent-core/src/agent.ts +52 -11
- package/packages/pi-agent-core/src/index.ts +2 -0
- package/packages/pi-agent-core/src/token-audit.test.ts +189 -0
- package/packages/pi-agent-core/src/token-audit.ts +287 -0
- package/packages/pi-agent-core/src/types.ts +26 -10
- package/packages/pi-agent-core/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-ai/dist/providers/anthropic-auth.test.js +35 -13
- package/packages/pi-ai/dist/providers/anthropic-auth.test.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-bearer-auth.test.js +21 -11
- package/packages/pi-ai/dist/providers/anthropic-bearer-auth.test.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.d.ts +7 -0
- package/packages/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.js +9 -7
- package/packages/pi-ai/dist/providers/anthropic.js.map +1 -1
- package/packages/pi-ai/dist/providers/minimax-tool-name.test.js +23 -14
- package/packages/pi-ai/dist/providers/minimax-tool-name.test.js.map +1 -1
- package/packages/pi-ai/dist/types.d.ts +2 -0
- package/packages/pi-ai/dist/types.d.ts.map +1 -1
- package/packages/pi-ai/dist/types.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/github-copilot.test.js +48 -21
- package/packages/pi-ai/dist/utils/oauth/github-copilot.test.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.test.js +22 -21
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.test.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.test.js +22 -21
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.test.js.map +1 -1
- package/packages/pi-ai/src/providers/anthropic-auth.test.ts +39 -25
- package/packages/pi-ai/src/providers/anthropic-bearer-auth.test.ts +26 -22
- package/packages/pi-ai/src/providers/anthropic.ts +22 -9
- package/packages/pi-ai/src/providers/minimax-tool-name.test.ts +34 -21
- package/packages/pi-ai/src/types.ts +3 -0
- package/packages/pi-ai/src/utils/oauth/github-copilot.test.ts +56 -22
- package/packages/pi-ai/src/utils/oauth/google-antigravity.test.ts +24 -28
- package/packages/pi-ai/src/utils/oauth/google-gemini-cli.test.ts +24 -28
- package/packages/pi-ai/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.js +36 -1
- package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session-tool-refresh.test.js +30 -1
- package/packages/pi-coding-agent/dist/core/agent-session-tool-refresh.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts +21 -2
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session.js +94 -16
- package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js +35 -1
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts +11 -0
- package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/compaction.js +9 -0
- package/packages/pi-coding-agent/dist/core/compaction/compaction.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction-threshold.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/compaction-threshold.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/compaction-threshold.test.js +103 -0
- package/packages/pi-coding-agent/dist/core/compaction-threshold.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.d.ts +15 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.js +66 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.test.js +24 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/loader.js +8 -0
- package/packages/pi-coding-agent/dist/core/extensions/loader.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts +5 -0
- package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.js +20 -7
- package/packages/pi-coding-agent/dist/core/extensions/runner.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.test.js +102 -3
- package/packages/pi-coding-agent/dist/core/extensions/runner.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/types.d.ts +60 -4
- package/packages/pi-coding-agent/dist/core/extensions/types.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/types.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/hooks-runner.test.js +2 -0
- package/packages/pi-coding-agent/dist/core/hooks-runner.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk-tool-filter.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/sdk-tool-filter.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/sdk-tool-filter.test.js +46 -0
- package/packages/pi-coding-agent/dist/core/sdk-tool-filter.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/sdk.d.ts +10 -2
- package/packages/pi-coding-agent/dist/core/sdk.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.js +81 -4
- package/packages/pi-coding-agent/dist/core/sdk.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts +20 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.js +25 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/skill-tool.test.js +22 -0
- package/packages/pi-coding-agent/dist/core/skill-tool.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/system-prompt.d.ts +6 -7
- package/packages/pi-coding-agent/dist/core/system-prompt.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/system-prompt.js +2 -3
- package/packages/pi-coding-agent/dist/core/system-prompt.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/bash-spawn-windows.test.js +22 -56
- package/packages/pi-coding-agent/dist/core/tools/bash-spawn-windows.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/bash.d.ts +1 -0
- package/packages/pi-coding-agent/dist/core/tools/bash.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/bash.js +3 -1
- package/packages/pi-coding-agent/dist/core/tools/bash.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/edit.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/tools/edit.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/edit.js +12 -1
- package/packages/pi-coding-agent/dist/core/tools/edit.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/find.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/tools/find.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/find.js +14 -6
- package/packages/pi-coding-agent/dist/core/tools/find.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/grep.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/tools/grep.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/grep.js +12 -3
- package/packages/pi-coding-agent/dist/core/tools/grep.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/hashline-read.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/tools/hashline-read.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/hashline-read.js +3 -1
- package/packages/pi-coding-agent/dist/core/tools/hashline-read.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/index.d.ts +2 -1
- package/packages/pi-coding-agent/dist/core/tools/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/index.js +1 -0
- package/packages/pi-coding-agent/dist/core/tools/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/ls.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/tools/ls.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/ls.js +10 -3
- package/packages/pi-coding-agent/dist/core/tools/ls.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/read.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/tools/read.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/read.js +3 -1
- package/packages/pi-coding-agent/dist/core/tools/read.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/spawn-shell-windows.test.js +7 -62
- package/packages/pi-coding-agent/dist/core/tools/spawn-shell-windows.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/tool-target-metadata.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/tools/tool-target-metadata.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/tool-target-metadata.test.js +115 -0
- package/packages/pi-coding-agent/dist/core/tools/tool-target-metadata.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/tool-target.d.ts +19 -0
- package/packages/pi-coding-agent/dist/core/tools/tool-target.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/tool-target.js +20 -0
- package/packages/pi-coding-agent/dist/core/tools/tool-target.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/write.d.ts +4 -0
- package/packages/pi-coding-agent/dist/core/tools/write.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/write.js +9 -1
- package/packages/pi-coding-agent/dist/core/tools/write.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/chat-frame-compaction-tone.test.js +6 -4
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/chat-frame-compaction-tone.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js +114 -22
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.js +2 -2
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.js +2 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.js +32 -7
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts +6 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +177 -19
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js +33 -6
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.test.js +71 -0
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +25 -3
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js +36 -27
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.test.js +21 -0
- package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-mode.js +1 -1
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage-safety-guard.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage-safety-guard.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage-safety-guard.test.js +28 -0
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage-safety-guard.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage.js +3 -2
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage.js.map +1 -1
- package/packages/pi-coding-agent/src/core/agent-session-abort-order.test.ts +40 -1
- package/packages/pi-coding-agent/src/core/agent-session-tool-refresh.test.ts +40 -1
- package/packages/pi-coding-agent/src/core/agent-session.ts +102 -16
- package/packages/pi-coding-agent/src/core/chat-controller-ordering.test.ts +41 -1
- package/packages/pi-coding-agent/src/core/compaction/compaction.ts +18 -0
- package/packages/pi-coding-agent/src/core/compaction-threshold.test.ts +121 -0
- package/packages/pi-coding-agent/src/core/db-snapshot.test.ts +32 -0
- package/packages/pi-coding-agent/src/core/db-snapshot.ts +66 -0
- package/packages/pi-coding-agent/src/core/extensions/loader.ts +10 -0
- package/packages/pi-coding-agent/src/core/extensions/runner.test.ts +113 -3
- package/packages/pi-coding-agent/src/core/extensions/runner.ts +24 -6
- package/packages/pi-coding-agent/src/core/extensions/types.ts +63 -2
- package/packages/pi-coding-agent/src/core/hooks-runner.test.ts +2 -0
- package/packages/pi-coding-agent/src/core/sdk-tool-filter.test.ts +60 -0
- package/packages/pi-coding-agent/src/core/sdk.ts +92 -4
- package/packages/pi-coding-agent/src/core/settings-manager.ts +39 -1
- package/packages/pi-coding-agent/src/core/skill-tool.test.ts +28 -0
- package/packages/pi-coding-agent/src/core/system-prompt.ts +8 -10
- package/packages/pi-coding-agent/src/core/tools/bash-spawn-windows.test.ts +22 -66
- package/packages/pi-coding-agent/src/core/tools/bash.ts +4 -1
- package/packages/pi-coding-agent/src/core/tools/edit.ts +13 -1
- package/packages/pi-coding-agent/src/core/tools/find.ts +15 -6
- package/packages/pi-coding-agent/src/core/tools/grep.ts +13 -3
- package/packages/pi-coding-agent/src/core/tools/hashline-read.ts +4 -1
- package/packages/pi-coding-agent/src/core/tools/index.ts +8 -0
- package/packages/pi-coding-agent/src/core/tools/ls.ts +11 -3
- package/packages/pi-coding-agent/src/core/tools/read.ts +4 -1
- package/packages/pi-coding-agent/src/core/tools/spawn-shell-windows.test.ts +11 -72
- package/packages/pi-coding-agent/src/core/tools/tool-target-metadata.test.ts +127 -0
- package/packages/pi-coding-agent/src/core/tools/tool-target.ts +48 -0
- package/packages/pi-coding-agent/src/core/tools/write.ts +14 -2
- package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/chat-frame-compaction-tone.test.ts +7 -5
- package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/tool-execution.test.ts +144 -22
- package/packages/pi-coding-agent/src/modes/interactive/components/adaptive-layout.ts +2 -2
- package/packages/pi-coding-agent/src/modes/interactive/components/assistant-message.ts +1 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/chat-frame.ts +2 -1
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.ts +41 -10
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +208 -19
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.test.ts +75 -0
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +41 -8
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +27 -3
- package/packages/pi-coding-agent/src/modes/interactive/theme/themes.ts +36 -27
- package/packages/pi-coding-agent/src/modes/interactive/tui-mode.test.ts +25 -0
- package/packages/pi-coding-agent/src/modes/rpc/rpc-mode.ts +1 -1
- package/packages/pi-coding-agent/src/resources/extensions/memory/storage-safety-guard.test.ts +31 -0
- package/packages/pi-coding-agent/src/resources/extensions/memory/storage.ts +3 -2
- package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-tui/dist/tui.d.ts.map +1 -1
- package/packages/pi-tui/dist/tui.js +18 -8
- package/packages/pi-tui/dist/tui.js.map +1 -1
- package/packages/pi-tui/src/tui.ts +20 -8
- package/packages/pi-tui/tsconfig.tsbuildinfo +1 -1
- package/packages/rpc-client/README.md +7 -0
- package/pkg/dist/modes/interactive/theme/themes.d.ts.map +1 -1
- package/pkg/dist/modes/interactive/theme/themes.js +36 -27
- package/pkg/dist/modes/interactive/theme/themes.js.map +1 -1
- package/src/resources/GSD-WORKFLOW.md +2 -2
- package/src/resources/extensions/claude-code-cli/readiness.ts +25 -7
- package/src/resources/extensions/claude-code-cli/stream-adapter.ts +42 -3
- package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +67 -0
- package/src/resources/extensions/github-sync/sync.ts +8 -1
- package/src/resources/extensions/github-sync/tests/sync-source.test.ts +6 -18
- package/src/resources/extensions/gsd/auto/contracts.ts +19 -2
- package/src/resources/extensions/gsd/auto/loop-deps.ts +11 -11
- package/src/resources/extensions/gsd/auto/loop.ts +134 -16
- package/src/resources/extensions/gsd/auto/orchestrator.ts +52 -4
- package/src/resources/extensions/gsd/auto/phases.ts +427 -220
- package/src/resources/extensions/gsd/auto/resolve.ts +42 -1
- package/src/resources/extensions/gsd/auto/run-unit.ts +28 -30
- package/src/resources/extensions/gsd/auto/session.ts +9 -1
- package/src/resources/extensions/gsd/auto/types.ts +3 -0
- package/src/resources/extensions/gsd/auto/unit-runner-events.ts +15 -0
- package/src/resources/extensions/gsd/auto/workflow-dispatch-claim.ts +63 -1
- package/src/resources/extensions/gsd/auto/workflow-worker-heartbeat.ts +14 -1
- package/src/resources/extensions/gsd/auto-dashboard.ts +20 -0
- package/src/resources/extensions/gsd/auto-direct-dispatch.ts +8 -34
- package/src/resources/extensions/gsd/auto-dispatch.ts +33 -0
- package/src/resources/extensions/gsd/auto-post-unit.ts +134 -90
- package/src/resources/extensions/gsd/auto-prompts.ts +228 -16
- package/src/resources/extensions/gsd/auto-recovery.ts +54 -0
- package/src/resources/extensions/gsd/auto-start.ts +326 -25
- package/src/resources/extensions/gsd/auto-supervisor.ts +7 -0
- package/src/resources/extensions/gsd/auto-timeout-recovery.ts +2 -2
- package/src/resources/extensions/gsd/auto-worktree.ts +259 -360
- package/src/resources/extensions/gsd/auto.ts +336 -89
- package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +147 -11
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +45 -37
- package/src/resources/extensions/gsd/bootstrap/dynamic-tools.ts +36 -10
- package/src/resources/extensions/gsd/bootstrap/exec-tools.ts +32 -19
- package/src/resources/extensions/gsd/bootstrap/journal-tools.ts +5 -1
- package/src/resources/extensions/gsd/bootstrap/memory-tools.ts +7 -4
- package/src/resources/extensions/gsd/bootstrap/query-tools.ts +6 -3
- package/src/resources/extensions/gsd/bootstrap/register-extension.ts +1 -1
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +379 -54
- package/src/resources/extensions/gsd/bootstrap/sanitize-complete-milestone.ts +4 -0
- package/src/resources/extensions/gsd/bootstrap/system-context.ts +90 -22
- package/src/resources/extensions/gsd/bootstrap/write-gate.ts +19 -2
- package/src/resources/extensions/gsd/clean-root-preflight.ts +72 -9
- package/src/resources/extensions/gsd/commands/dispatcher.ts +6 -0
- package/src/resources/extensions/gsd/commands/handlers/ops.ts +4 -2
- package/src/resources/extensions/gsd/commands-config.ts +1 -1
- package/src/resources/extensions/gsd/commands-eval-review.ts +2 -2
- package/src/resources/extensions/gsd/commands-handlers.ts +34 -15
- package/src/resources/extensions/gsd/context-budget.ts +44 -2
- package/src/resources/extensions/gsd/crash-recovery.ts +67 -10
- package/src/resources/extensions/gsd/dashboard-overlay.ts +1 -1
- package/src/resources/extensions/gsd/db/unit-dispatches.ts +107 -0
- package/src/resources/extensions/gsd/db-base-schema.ts +4 -2
- package/src/resources/extensions/gsd/db-migration-steps.ts +8 -0
- package/src/resources/extensions/gsd/detection.ts +128 -0
- package/src/resources/extensions/gsd/ecosystem/gsd-extension-api.ts +3 -0
- package/src/resources/extensions/gsd/git-service.ts +87 -10
- package/src/resources/extensions/gsd/gsd-db.ts +50 -13
- package/src/resources/extensions/gsd/guided-flow.ts +175 -55
- package/src/resources/extensions/gsd/health-widget.ts +3 -0
- package/src/resources/extensions/gsd/init-wizard.ts +5 -1
- package/src/resources/extensions/gsd/memory-store.ts +77 -12
- package/src/resources/extensions/gsd/migrate/command.ts +47 -1
- package/src/resources/extensions/gsd/migration-auto-check.ts +129 -0
- package/src/resources/extensions/gsd/native-git-bridge.ts +39 -6
- package/src/resources/extensions/gsd/orphan-stash-audit.ts +117 -0
- package/src/resources/extensions/gsd/parallel-orchestrator.ts +13 -3
- package/src/resources/extensions/gsd/planning-path-scope.ts +35 -0
- package/src/resources/extensions/gsd/pre-execution-checks.ts +23 -0
- package/src/resources/extensions/gsd/preferences-types.ts +1 -1
- package/src/resources/extensions/gsd/prompt-loader.ts +27 -2
- package/src/resources/extensions/gsd/prompts/complete-milestone.md +27 -23
- package/src/resources/extensions/gsd/prompts/complete-slice.md +1 -1
- package/src/resources/extensions/gsd/prompts/execute-task.md +4 -2
- package/src/resources/extensions/gsd/prompts/parallel-research-slices.md +1 -1
- package/src/resources/extensions/gsd/prompts/plan-milestone.md +3 -1
- package/src/resources/extensions/gsd/prompts/plan-slice.md +1 -1
- package/src/resources/extensions/gsd/prompts/quick-task.md +1 -5
- package/src/resources/extensions/gsd/prompts/replan-slice.md +2 -2
- package/src/resources/extensions/gsd/prompts/validate-milestone.md +2 -2
- package/src/resources/extensions/gsd/quick.ts +37 -2
- package/src/resources/extensions/gsd/recovery-classification.ts +122 -0
- package/src/resources/extensions/gsd/safety/evidence-collector.ts +11 -2
- package/src/resources/extensions/gsd/slice-cadence.ts +49 -2
- package/src/resources/extensions/gsd/slice-parallel-orchestrator.ts +23 -9
- package/src/resources/extensions/gsd/state-reconciliation.ts +57 -0
- package/src/resources/extensions/gsd/tests/agent-end-retry.test.ts +59 -89
- package/src/resources/extensions/gsd/tests/artifact-retry-cap.test.ts +47 -172
- package/src/resources/extensions/gsd/tests/artifacts-table-preserved-on-cache-invalidate.test.ts +0 -35
- package/src/resources/extensions/gsd/tests/auto-dashboard.test.ts +35 -9
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +544 -41
- package/src/resources/extensions/gsd/tests/auto-model-selection.test.ts +80 -59
- package/src/resources/extensions/gsd/tests/auto-orchestrator.test.ts +119 -2
- package/src/resources/extensions/gsd/tests/auto-paused-session-validation.test.ts +3 -47
- package/src/resources/extensions/gsd/tests/auto-paused-ui-cleanup.test.ts +76 -18
- package/src/resources/extensions/gsd/tests/auto-phases-lifecycle.test.ts +175 -11
- package/src/resources/extensions/gsd/tests/auto-pr-bugs.test.ts +54 -95
- package/src/resources/extensions/gsd/tests/auto-project-root-env.test.ts +67 -26
- package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +14 -1
- package/src/resources/extensions/gsd/tests/auto-remediate-slice-status.test.ts +32 -30
- package/src/resources/extensions/gsd/tests/auto-start-bootstrap-await-3420.test.ts +32 -128
- package/src/resources/extensions/gsd/tests/auto-start-clean-runtime-db-gated.test.ts +20 -54
- package/src/resources/extensions/gsd/tests/auto-start-cold-db-bootstrap.test.ts +20 -30
- package/src/resources/extensions/gsd/tests/auto-start-index-lock.test.ts +17 -29
- package/src/resources/extensions/gsd/tests/auto-start-orphan-bootstrap.test.ts +142 -0
- package/src/resources/extensions/gsd/tests/auto-start-time-persistence.test.ts +21 -39
- package/src/resources/extensions/gsd/tests/auto-start-worktree-db-path.test.ts +15 -24
- package/src/resources/extensions/gsd/tests/auto-thinking-restore.test.ts +44 -29
- package/src/resources/extensions/gsd/tests/auto-warning-noise-regression.test.ts +39 -51
- package/src/resources/extensions/gsd/tests/auto-wrapup-inflight-guard.test.ts +159 -213
- package/src/resources/extensions/gsd/tests/bootstrap-derive-state-db-open.test.ts +15 -32
- package/src/resources/extensions/gsd/tests/browser-teardown.test.ts +0 -41
- package/src/resources/extensions/gsd/tests/clean-root-preflight.test.ts +97 -2
- package/src/resources/extensions/gsd/tests/clear-stale-autostart.test.ts +34 -27
- package/src/resources/extensions/gsd/tests/cmux.test.ts +51 -53
- package/src/resources/extensions/gsd/tests/cold-resume-db-reopen.test.ts +39 -61
- package/src/resources/extensions/gsd/tests/commands-config.test.ts +26 -19
- package/src/resources/extensions/gsd/tests/compaction-snapshot.test.ts +14 -1
- package/src/resources/extensions/gsd/tests/complete-milestone-excerpt.test.ts +31 -0
- package/src/resources/extensions/gsd/tests/complete-milestone.test.ts +140 -0
- package/src/resources/extensions/gsd/tests/complete-slice-composer.test.ts +3 -2
- package/src/resources/extensions/gsd/tests/complete-task-normalize-lists.test.ts +29 -33
- package/src/resources/extensions/gsd/tests/completed-units-metrics-sync.test.ts +45 -108
- package/src/resources/extensions/gsd/tests/context-budget.test.ts +10 -1
- package/src/resources/extensions/gsd/tests/context-store.test.ts +7 -1
- package/src/resources/extensions/gsd/tests/crash-handler-secondary.test.ts +90 -31
- package/src/resources/extensions/gsd/tests/crash-recovery-via-db.test.ts +22 -0
- package/src/resources/extensions/gsd/tests/custom-engine-loop-integration.test.ts +18 -10
- package/src/resources/extensions/gsd/tests/cwd-fallback-hardening.test.ts +138 -0
- package/src/resources/extensions/gsd/tests/dashboard-custom-engine.test.ts +4 -68
- package/src/resources/extensions/gsd/tests/deep-project-auto-loop.test.ts +6 -11
- package/src/resources/extensions/gsd/tests/deferred-milestone-dir-4996.test.ts +14 -65
- package/src/resources/extensions/gsd/tests/detection.test.ts +140 -0
- package/src/resources/extensions/gsd/tests/discuss-tool-scoping.test.ts +44 -37
- package/src/resources/extensions/gsd/tests/dispatch-complete-milestone-guard.test.ts +58 -40
- package/src/resources/extensions/gsd/tests/dispatch-guard-closed-status.test.ts +25 -15
- package/src/resources/extensions/gsd/tests/dispatch-rule-coverage.test.ts +313 -0
- package/src/resources/extensions/gsd/tests/dispatcher-stuck-planning.test.ts +35 -17
- package/src/resources/extensions/gsd/tests/error-success-mask.test.ts +16 -21
- package/src/resources/extensions/gsd/tests/est-annotation-timeout.test.ts +15 -82
- package/src/resources/extensions/gsd/tests/exec-history.test.ts +15 -0
- package/src/resources/extensions/gsd/tests/exec-sandbox.test.ts +65 -0
- package/src/resources/extensions/gsd/tests/execute-task-rendering.test.ts +5 -2
- package/src/resources/extensions/gsd/tests/fast-forward-reused-milestone-branch.test.ts +219 -0
- package/src/resources/extensions/gsd/tests/finalize-survivor-branch.test.ts +151 -0
- package/src/resources/extensions/gsd/tests/flat-rate-routing-guard.test.ts +2 -20
- package/src/resources/extensions/gsd/tests/frontmatter-parse-noise.test.ts +18 -26
- package/src/resources/extensions/gsd/tests/has-pending-deep-stage.test.ts +33 -1
- package/src/resources/extensions/gsd/tests/init-skip-git.test.ts +9 -12
- package/src/resources/extensions/gsd/tests/integration/auto-worktree-milestone-merge.test.ts +40 -0
- package/src/resources/extensions/gsd/tests/integration/commands-eval-review.integration.test.ts +4 -2
- package/src/resources/extensions/gsd/tests/integration/git-locale.test.ts +31 -20
- package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +66 -0
- package/src/resources/extensions/gsd/tests/integration/milestone-transition-worktree.test.ts +0 -47
- package/src/resources/extensions/gsd/tests/interactive-routing-bypass.test.ts +60 -202
- package/src/resources/extensions/gsd/tests/isolation-none-branch-guard.test.ts +13 -56
- package/src/resources/extensions/gsd/tests/journal-integration.test.ts +248 -10
- package/src/resources/extensions/gsd/tests/journal-query-tool.test.ts +32 -0
- package/src/resources/extensions/gsd/tests/knowledge.test.ts +47 -0
- package/src/resources/extensions/gsd/tests/lazy-pi-tui-import.test.ts +44 -6
- package/src/resources/extensions/gsd/tests/memory-decay-factor.test.ts +90 -0
- package/src/resources/extensions/gsd/tests/memory-pressure-stuck-state.test.ts +21 -35
- package/src/resources/extensions/gsd/tests/merge-conflict-stops-loop.test.ts +37 -7
- package/src/resources/extensions/gsd/tests/migrate-writer-integration.test.ts +48 -0
- package/src/resources/extensions/gsd/tests/migration-auto-check.test.ts +127 -0
- package/src/resources/extensions/gsd/tests/milestone-merge-stash-restore.test.ts +267 -0
- package/src/resources/extensions/gsd/tests/milestone-transition-state-rebuild.test.ts +88 -98
- package/src/resources/extensions/gsd/tests/model-unittype-mapping.test.ts +70 -278
- package/src/resources/extensions/gsd/tests/native-git-bridge-exec-fallback.test.ts +34 -2
- package/src/resources/extensions/gsd/tests/needs-remediation-revalidation.test.ts +37 -30
- package/src/resources/extensions/gsd/tests/note-captures-executed.test.ts +32 -28
- package/src/resources/extensions/gsd/tests/originalbase-path-comparison.test.ts +44 -9
- package/src/resources/extensions/gsd/tests/orphan-merge-bootstrap.test.ts +144 -0
- package/src/resources/extensions/gsd/tests/orphan-stash-audit.test.ts +201 -0
- package/src/resources/extensions/gsd/tests/parallel-orchestrator-fast-forward.test.ts +113 -0
- package/src/resources/extensions/gsd/tests/phantom-ghost-detection.test.ts +24 -37
- package/src/resources/extensions/gsd/tests/phantom-milestone-default-queued.test.ts +9 -24
- package/src/resources/extensions/gsd/tests/phases-merge-error-stops-auto.test.ts +95 -75
- package/src/resources/extensions/gsd/tests/plan-slice.test.ts +50 -0
- package/src/resources/extensions/gsd/tests/plan-task.test.ts +21 -0
- package/src/resources/extensions/gsd/tests/post-unit-state-rebuild.test.ts +36 -22
- package/src/resources/extensions/gsd/tests/pre-exec-backtick-strip.test.ts +36 -30
- package/src/resources/extensions/gsd/tests/pre-execution-checks.test.ts +45 -5
- package/src/resources/extensions/gsd/tests/pre-execution-pause-wiring.test.ts +74 -4
- package/src/resources/extensions/gsd/tests/preferences-worktree-sync.test.ts +20 -22
- package/src/resources/extensions/gsd/tests/prefs-wizard-coverage.test.ts +130 -32
- package/src/resources/extensions/gsd/tests/project-root-cwd-crash.test.ts +18 -36
- package/src/resources/extensions/gsd/tests/projection-no-plan-overwrite.test.ts +35 -73
- package/src/resources/extensions/gsd/tests/prompt-budget-enforcement.test.ts +76 -138
- package/src/resources/extensions/gsd/tests/prompt-duplication-cuts.test.ts +230 -0
- package/src/resources/extensions/gsd/tests/prompt-path-audit.test.ts +40 -0
- package/src/resources/extensions/gsd/tests/prompt-step-ordering.test.ts +70 -106
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +59 -161
- package/src/resources/extensions/gsd/tests/query-tools-db-open.test.ts +33 -29
- package/src/resources/extensions/gsd/tests/queue-auto-guard.test.ts +22 -196
- package/src/resources/extensions/gsd/tests/quick-auto-guard.test.ts +23 -93
- package/src/resources/extensions/gsd/tests/quick-external-gsd.test.ts +40 -0
- package/src/resources/extensions/gsd/tests/quick-turn-end-cleanup.test.ts +50 -79
- package/src/resources/extensions/gsd/tests/reassess-default-optin.test.ts +27 -13
- package/src/resources/extensions/gsd/tests/remote-questions.test.ts +151 -251
- package/src/resources/extensions/gsd/tests/resource-loader-import-path.test.ts +41 -29
- package/src/resources/extensions/gsd/tests/restore-tools-after-discuss.test.ts +58 -69
- package/src/resources/extensions/gsd/tests/resume-dispatch-worktree.test.ts +32 -164
- package/src/resources/extensions/gsd/tests/right-sized-workflow-prompts.test.ts +192 -0
- package/src/resources/extensions/gsd/tests/run-uat-replay-cap.test.ts +57 -41
- package/src/resources/extensions/gsd/tests/runtime-invariant-modules.test.ts +91 -0
- package/src/resources/extensions/gsd/tests/safety-harness-false-positives.test.ts +29 -0
- package/src/resources/extensions/gsd/tests/schema-v27-v28-sequence.test.ts +156 -0
- package/src/resources/extensions/gsd/tests/select-resumable-milestone.test.ts +96 -0
- package/src/resources/extensions/gsd/tests/session-model-override.test.ts +14 -9
- package/src/resources/extensions/gsd/tests/session-start-footer.test.ts +77 -0
- package/src/resources/extensions/gsd/tests/session-switch-abort-misclassification.test.ts +222 -0
- package/src/resources/extensions/gsd/tests/show-config-command.test.ts +44 -42
- package/src/resources/extensions/gsd/tests/signal-handlers.test.ts +27 -0
- package/src/resources/extensions/gsd/tests/skip-slice-state-rebuild.test.ts +56 -24
- package/src/resources/extensions/gsd/tests/skipped-validation-db-atomicity.test.ts +51 -11
- package/src/resources/extensions/gsd/tests/slice-cadence.test.ts +23 -0
- package/src/resources/extensions/gsd/tests/slice-context-injection.test.ts +66 -50
- package/src/resources/extensions/gsd/tests/slice-parallel-orchestrator.test.ts +68 -107
- package/src/resources/extensions/gsd/tests/slice-sequence-insert.test.ts +115 -42
- package/src/resources/extensions/gsd/tests/smart-entry-complete.test.ts +21 -59
- package/src/resources/extensions/gsd/tests/smart-entry-draft.test.ts +25 -116
- package/src/resources/extensions/gsd/tests/sqlite-unavailable-gate.test.ts +21 -57
- package/src/resources/extensions/gsd/tests/stale-dirlistcache-4648.test.ts +29 -76
- package/src/resources/extensions/gsd/tests/stale-lockfile-recovery.test.ts +33 -24
- package/src/resources/extensions/gsd/tests/stale-slice-rows.test.ts +39 -30
- package/src/resources/extensions/gsd/tests/stalled-tool-recovery.test.ts +49 -1
- package/src/resources/extensions/gsd/tests/start-auto-detached.test.ts +101 -2
- package/src/resources/extensions/gsd/tests/state-corruption-2945.test.ts +6 -4
- package/src/resources/extensions/gsd/tests/status-db-open.test.ts +35 -40
- package/src/resources/extensions/gsd/tests/stop-auto-merge-back.test.ts +48 -46
- package/src/resources/extensions/gsd/tests/stop-auto-race-null-unit.test.ts +14 -102
- package/src/resources/extensions/gsd/tests/subagent-model-dispatch.test.ts +78 -232
- package/src/resources/extensions/gsd/tests/sync-worktree-skip-current.test.ts +32 -35
- package/src/resources/extensions/gsd/tests/system-context-memory.test.ts +112 -0
- package/src/resources/extensions/gsd/tests/system-context-message-routing.test.ts +7 -9
- package/src/resources/extensions/gsd/tests/token-profile.test.ts +84 -309
- package/src/resources/extensions/gsd/tests/token-tool-gating.test.ts +291 -0
- package/src/resources/extensions/gsd/tests/triage-dispatch.test.ts +134 -341
- package/src/resources/extensions/gsd/tests/tui-header-lifecycle.test.ts +210 -0
- package/src/resources/extensions/gsd/tests/unit-context-composer.test.ts +136 -4
- package/src/resources/extensions/gsd/tests/unit-context-manifest.test.ts +8 -25
- package/src/resources/extensions/gsd/tests/unit-dispatches.test.ts +80 -1
- package/src/resources/extensions/gsd/tests/unit-runtime.test.ts +37 -0
- package/src/resources/extensions/gsd/tests/unstructured-continue-context-injection.test.ts +5 -99
- package/src/resources/extensions/gsd/tests/uok-plan-v2-wiring.test.ts +43 -36
- package/src/resources/extensions/gsd/tests/visualizer-data.test.ts +84 -444
- package/src/resources/extensions/gsd/tests/workflow-dispatch-claim.test.ts +142 -0
- package/src/resources/extensions/gsd/tests/workflow-logger-wiring.test.ts +44 -189
- package/src/resources/extensions/gsd/tests/workflow-mcp.test.ts +2 -57
- package/src/resources/extensions/gsd/tests/workflow-protocol-excerpt.test.ts +99 -0
- package/src/resources/extensions/gsd/tests/workflow-tool-executors.test.ts +3 -0
- package/src/resources/extensions/gsd/tests/workflow-worker-heartbeat.test.ts +32 -1
- package/src/resources/extensions/gsd/tests/worktree-db-same-file.test.ts +21 -44
- package/src/resources/extensions/gsd/tests/worktree-expected-warnings.test.ts +27 -26
- package/src/resources/extensions/gsd/tests/worktree-health-dispatch.test.ts +38 -6
- package/src/resources/extensions/gsd/tests/worktree-journal-events.test.ts +50 -31
- package/src/resources/extensions/gsd/tests/worktree-lifecycle.test.ts +434 -0
- package/src/resources/extensions/gsd/tests/worktree-main-branch.test.ts +20 -18
- package/src/resources/extensions/gsd/tests/worktree-manager.test.ts +7 -0
- package/src/resources/extensions/gsd/tests/worktree-nested-git-safety.test.ts +9 -2
- package/src/resources/extensions/gsd/tests/worktree-path-injection.test.ts +22 -19
- package/src/resources/extensions/gsd/tests/worktree-project-root-degrade.test.ts +66 -0
- package/src/resources/extensions/gsd/tests/worktree-resolver.test.ts +373 -76
- package/src/resources/extensions/gsd/tests/worktree-safety.test.ts +327 -0
- package/src/resources/extensions/gsd/tests/worktree-state-projection.test.ts +120 -0
- package/src/resources/extensions/gsd/tests/write-gate.test.ts +40 -1
- package/src/resources/extensions/gsd/tests/zero-slice-roadmap-guided.test.ts +19 -13
- package/src/resources/extensions/gsd/tool-contract.ts +82 -0
- package/src/resources/extensions/gsd/tools/complete-milestone.ts +14 -15
- package/src/resources/extensions/gsd/tools/complete-task.ts +1 -1
- package/src/resources/extensions/gsd/tools/context-mode-tool-result.ts +25 -0
- package/src/resources/extensions/gsd/tools/exec-search-tool.ts +7 -7
- package/src/resources/extensions/gsd/tools/exec-tool.ts +4 -23
- package/src/resources/extensions/gsd/tools/memory-tools.ts +1 -0
- package/src/resources/extensions/gsd/tools/plan-slice.ts +13 -0
- package/src/resources/extensions/gsd/tools/plan-task.ts +10 -0
- package/src/resources/extensions/gsd/tools/resume-tool.ts +7 -7
- package/src/resources/extensions/gsd/tools/workflow-tool-executors.ts +1 -1
- package/src/resources/extensions/gsd/unit-context-composer.ts +19 -4
- package/src/resources/extensions/gsd/unit-runtime.ts +25 -0
- package/src/resources/extensions/gsd/workflow-protocol.ts +160 -0
- package/src/resources/extensions/gsd/worktree-lifecycle.ts +1255 -0
- package/src/resources/extensions/gsd/worktree-manager.ts +15 -4
- package/src/resources/extensions/gsd/worktree-safety.ts +282 -0
- package/src/resources/extensions/gsd/worktree-state-projection.ts +404 -0
- package/src/resources/skills/create-gsd-extension/templates/templates.test.ts +86 -40
- package/src/resources/skills/web-quality-audit/scripts/analyze.sh +0 -0
- package/dist/resources/extensions/gsd/worktree-resolver.js +0 -733
- package/dist/web/standalone/.next/static/chunks/8336.631939fb583761fa.js +0 -10
- package/src/resources/extensions/gsd/tests/sync-layer-scope.test.ts +0 -434
- package/src/resources/extensions/gsd/worktree-resolver.ts +0 -909
- /package/dist/web/standalone/.next/static/{k-MDjzPMF62Rg1-FR437h → 8G7Lc96dfT0V6VXh6O6Ka}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{k-MDjzPMF62Rg1-FR437h → 8G7Lc96dfT0V6VXh6O6Ka}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-card-cleanup-and-success-runtime.test.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,0EAA0E;AAC1E,4EAA4E;AAC5E,sBAAsB;AACtB,EAAE;AACF,0EAA0E;AAC1E,4EAA4E;AAC5E,wEAAwE;AACxE,0EAA0E;AAC1E,4EAA4E;AAC5E,sBAAsB;AAEtB,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEjD,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,2BAA2B,EAAE,iCAAiC,EAAE,MAAM,wBAAwB,CAAC;AACxG,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,yEAAyE;AACzE,mEAAmE;AACnE,MAAM,CAAC,GAAG,EAAE;IACX,SAAS,CAAC,MAAM,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AS,CAAC,GAAG,CAAC,EACtB,iEAAiE;YAChE,gEAAgE,CACjE,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yEAAyE,EAAE,GAAG,EAAE;QAClF,qEAAqE;QACrE,qEAAqE;QACrE,kEAAkE;QAClE,0BAA0B;QAC1B,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,uBAAuB,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QACvE,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC/B,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/C,MAAM,CAAC,EAAE,CACR,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EACrB,iEAAiE,CACjE,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["// Runtime regression tests for the post-compaction tool-card cleanup and the\n// green-bordered success-notification rendering. Replaces the source-grep\n// `src/tests/tui-running-and-success-box.test.ts` that was deleted in #4875\n// (tracked as #4872).\n//\n// The previous tests asserted on identifier presence and method signature\n// shape via regex. A regression that routed `success` notifications through\n// `showStatus` (dim text) by accident would not have failed because the\n// `showSuccess` method would still exist and still match the regex. These\n// tests instead drive the components through the actual scenario and assert\n// on rendered output.\n\nimport assert from \"node:assert/strict\";\nimport { describe, it, before } from \"node:test\";\n\nimport { Container, Text } from \"@gsd/pi-tui\";\nimport stripAnsi from \"strip-ansi\";\n\nimport { initTheme, theme } from \"../theme/theme.js\";\nimport { renderExtensionNotifyInChat, shouldRenderExtensionNotifyInChat } from \"../interactive-mode.js\";\nimport { DynamicBorder } from \"./dynamic-border.js\";\nimport { ToolExecutionComponent } from \"./tool-execution.js\";\n\n// Theme is a globalThis-shared singleton that throws if not initialized.\n// Initialize once before any test that exercises themed rendering.\nbefore(() => {\n\tinitTheme(\"dark\");\n});\n\ndescribe(\"Extension warning notifications\", () => {\n\tit(\"do not render into chat output\", () => {\n\t\tassert.equal(shouldRenderExtensionNotifyInChat(\"warning\"), false);\n\t\tassert.equal(shouldRenderExtensionNotifyInChat(\"error\"), true);\n\t\tassert.equal(shouldRenderExtensionNotifyInChat(\"success\"), true);\n\t\tassert.equal(shouldRenderExtensionNotifyInChat(\"info\"), true);\n\t\tassert.equal(shouldRenderExtensionNotifyInChat(undefined), true);\n\n\t\tconst warningChat = new Container();\n\t\tconst warningResult = renderExtensionNotifyInChat(warningChat, \"extension warning\", \"warning\");\n\t\tassert.equal(warningResult.rendered, false);\n\t\tassert.equal(\n\t\t\twarningChat.render(80).map(stripAnsi).join(\"\\n\"),\n\t\t\t\"\",\n\t\t\t\"warning notifications must not add chat output\",\n\t\t);\n\n\t\tfor (const type of [\"error\", \"success\", \"info\"] as const) {\n\t\t\tconst chat = new Container();\n\t\t\tconst result = renderExtensionNotifyInChat(chat, `${type} notification`, type);\n\t\t\tassert.equal(result.rendered, true, `${type} notification should render`);\n\t\t\tassert.match(\n\t\t\t\tchat.render(80).map(stripAnsi).join(\"\\n\"),\n\t\t\t\tnew RegExp(`${type} notification`),\n\t\t\t\t`${type} notification text should appear in chat output`,\n\t\t\t);\n\t\t}\n\t});\n});\n\ninterface MockTui {\n\trenderCount: number;\n\trequestRender(): void;\n}\n\nfunction makeMockTUI(): MockTui {\n\treturn {\n\t\trenderCount: 0,\n\t\trequestRender() {\n\t\t\tthis.renderCount++;\n\t\t},\n\t};\n}\n\n// ─── Bug 1: tool cards stuck in \"Running\" after compaction ──────────────\n\ndescribe(\"ToolExecutionComponent post-compaction cleanup\", () => {\n\tit(\"renders 'Running' status while the tool call has no result\", () => {\n\t\t// Baseline: a freshly-constructed component (mid-stream) must show\n\t\t// the running badge — this is the state we need to flip OUT of when\n\t\t// compaction removes the result message.\n\t\tconst ui = makeMockTUI();\n\t\tconst c = new ToolExecutionComponent(\n\t\t\t\"read_file\",\n\t\t\t{ path: \"/tmp/x.txt\" },\n\t\t\t{},\n\t\t\tundefined,\n\t\t\tui as never,\n\t\t);\n\t\tconst rendered = c.render(60).map(stripAnsi).join(\"\\n\");\n\t\tassert.ok(\n\t\t\trendered.includes(\"Running\"),\n\t\t\t\"freshly constructed component should render 'Running' badge\",\n\t\t);\n\t});\n\n\tit(\"markHistoricalNoResult flips a stuck tool card OUT of 'Running'\", () => {\n\t\t// Real bug: after session-history replay (post-compaction or session\n\t\t// switch), tool calls without matching tool_result messages stay in\n\t\t// isPartial = true forever. markHistoricalNoResult must produce a\n\t\t// rendered output that no longer reads \"Running\".\n\t\tconst ui = makeMockTUI();\n\t\tconst c = new ToolExecutionComponent(\n\t\t\t\"read_file\",\n\t\t\t{ path: \"/tmp/x.txt\" },\n\t\t\t{},\n\t\t\tundefined,\n\t\t\tui as never,\n\t\t);\n\n\t\tc.markHistoricalNoResult();\n\n\t\tconst rendered = c.render(60).map(stripAnsi).join(\"\\n\");\n\t\tassert.ok(\n\t\t\t!rendered.includes(\"Running\"),\n\t\t\t\"after markHistoricalNoResult, the tool card must NOT render 'Running' — got:\\n\" +\n\t\t\t\trendered,\n\t\t);\n\t\tassert.ok(\n\t\t\trendered.includes(\"Done\"),\n\t\t\t\"flipped card should render 'Done' status (no-result success)\",\n\t\t);\n\t});\n\n\tit(\"markHistoricalNoResult is idempotent when a real result already exists\", () => {\n\t\t// Late-arriving stream events must not clobber legitimate results.\n\t\t// We observe the no-clobber via behaviour: a card that completed\n\t\t// with a real result keeps its \"Done\" badge and content even if\n\t\t// markHistoricalNoResult fires again afterwards.\n\t\tconst ui = makeMockTUI();\n\t\tconst c = new ToolExecutionComponent(\n\t\t\t\"read_file\",\n\t\t\t{ path: \"/tmp/x.txt\" },\n\t\t\t{},\n\t\t\tundefined,\n\t\t\tui as never,\n\t\t);\n\n\t\t// Use the public completion path the runtime calls.\n\t\tc.updateResult(\n\t\t\t{\n\t\t\t\tcontent: [{ type: \"text\", text: \"real-result-payload\" }],\n\t\t\t\tisError: false,\n\t\t\t},\n\t\t\tfalse, // isPartial = false → \"Done\"\n\t\t);\n\n\t\tconst before = c.render(60).map(stripAnsi).join(\"\\n\");\n\t\tassert.ok(before.includes(\"Done\"), \"after complete(), card shows 'Done'\");\n\n\t\tc.markHistoricalNoResult(); // must early-return\n\t\tconst after = c.render(60).map(stripAnsi).join(\"\\n\");\n\t\tassert.equal(\n\t\t\tafter,\n\t\t\tbefore,\n\t\t\t\"markHistoricalNoResult must NOT mutate state when a real result is already present\",\n\t\t);\n\t});\n});\n\n// ─── Bug 2: success notifications render as a green bordered box ────────\n\ndescribe(\"Success-notification rendering — DynamicBorder + success theme\", () => {\n\t// We drive the same component composition that interactive-mode.showSuccess\n\t// builds (DynamicBorder + Text + DynamicBorder, all themed with\n\t// theme.fg(\"success\", …)) and assert on the rendered output, rather than\n\t// trying to instantiate the full InteractiveMode (which requires a real\n\t// session, bridge, and TUI runtime).\n\tfunction buildSuccessNotification(message: string): Container {\n\t\tconst c = new Container();\n\t\tconst successColor = (text: string) => theme.fg(\"success\", text);\n\t\tc.addChild(new DynamicBorder(successColor));\n\t\tc.addChild(new Text(theme.fg(\"success\", message), 1, 0));\n\t\tc.addChild(new DynamicBorder(successColor));\n\t\treturn c;\n\t}\n\n\tit(\"renders a top and bottom horizontal border framing the message\", () => {\n\t\tconst c = buildSuccessNotification(\"Milestone M042 ready.\");\n\t\tconst lines = c.render(40);\n\n\t\t// First and last lines should be horizontal-rule borders\n\t\t// (DynamicBorder renders a row of \"─\" characters).\n\t\tconst firstStripped = stripAnsi(lines[0]);\n\t\tconst lastStripped = stripAnsi(lines[lines.length - 1]);\n\n\t\tassert.ok(\n\t\t\tfirstStripped.includes(\"─\"),\n\t\t\t`first line should be a border (got: ${JSON.stringify(firstStripped)})`,\n\t\t);\n\t\tassert.ok(\n\t\t\tlastStripped.includes(\"─\"),\n\t\t\t`last line should be a border (got: ${JSON.stringify(lastStripped)})`,\n\t\t);\n\t\tassert.ok(\n\t\t\tlines.length >= 3,\n\t\t\t`success notification must have at least 3 lines (top border, message, bottom border) — got ${lines.length}`,\n\t\t);\n\t});\n\n\tit(\"the message text appears between the two borders\", () => {\n\t\tconst c = buildSuccessNotification(\"Milestone M042 ready.\");\n\t\tconst lines = c.render(40);\n\n\t\tconst messageRow = lines.findIndex((l) => stripAnsi(l).includes(\"Milestone M042 ready.\"));\n\t\tassert.ok(messageRow > 0, \"message must appear after the top border\");\n\t\tassert.ok(\n\t\t\tmessageRow < lines.length - 1,\n\t\t\t\"message must appear before the bottom border\",\n\t\t);\n\t});\n\n\tit(\"borders carry ANSI styling (not plain dim text like showStatus)\", () => {\n\t\t// Goodhart-resistant: if a regression routed success through\n\t\t// showStatus, the borders would be missing AND the rendered text\n\t\t// would be plain (or only dim-styled, not success-colored). We\n\t\t// observe the border lines carry ANSI escape codes — the literal\n\t\t// foreground color depends on the theme (which is system-dependent\n\t\t// in CI), so we don't pin a specific code but DO require styling\n\t\t// to be present.\n\t\tconst c = buildSuccessNotification(\"ok\");\n\t\tconst lines = c.render(40);\n\t\tconst top = lines[0];\n\t\tassert.ok(\n\t\t\ttop !== stripAnsi(top),\n\t\t\t\"top border must contain ANSI styling — a plain unstyled border \" +\n\t\t\t\t\"would indicate the rendering bypassed theme.fg('success', ...)\",\n\t\t);\n\t});\n\n\tit(\"plain Text status (the showStatus path) does NOT produce a bordered box\", () => {\n\t\t// Counter-test: this is what the bug looked like — a single dim Text\n\t\t// with no surrounding border. If anyone ever \"fixes\" the showSuccess\n\t\t// regression by also adding borders to showStatus, this test will\n\t\t// surface the conflation.\n\t\tconst plain = new Text(theme.fg(\"dim\", \"Milestone M042 ready.\"), 1, 0);\n\t\tconst lines = plain.render(40);\n\t\tconst joined = lines.map(stripAnsi).join(\"\\n\");\n\t\tassert.ok(\n\t\t\t!joined.includes(\"─\"),\n\t\t\t\"plain Text (showStatus path) must NOT contain border characters\",\n\t\t);\n\t});\n});\n"]}
|
|
1
|
+
{"version":3,"file":"tool-card-cleanup-and-success-runtime.test.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.ts"],"names":[],"mappings":"AAAA,qBAAqB;AACrB,8FAA8F;AAC9F,8FAA8F;AAC9F,6EAA6E;AAC7E,0EAA0E;AAC1E,4EAA4E;AAC5E,sBAAsB;AACtB,EAAE;AACF,0EAA0E;AAC1E,4EAA4E;AAC5E,wEAAwE;AACxE,0EAA0E;AAC1E,4EAA4E;AAC5E,sBAAsB;AAEtB,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEjD,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,yBAAyB,EAAE,2BAA2B,EAAE,iCAAiC,EAAE,MAAM,wBAAwB,CAAC;AACnI,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,yEAAyE;AACzE,mEAAmE;AACnE,MAAM,CAAC,GAAG,EAAE;IACX,SAAS,CAAC,MAAM,CAAC,CAAC;AACnB,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,iCAAiC,EAAE,GAAG,EAAE;IAChD,EAAE,CAAC,gCAAgC,EAAE,GAAG,EAAE;QACzC,MAAM,CAAC,KAAK,CAAC,iCAAiC,CAAC,SAAS,CAAC,EAAE,KAAK,CAAC,CAAC;QAClE,MAAM,CAAC,KAAK,CAAC,iCAAiC,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC;QAC/D,MAAM,CAAC,KAAK,CAAC,iCAAiC,CAAC,SAAS,CAAC,EAAE,IAAI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MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/C,MAAM,CAAC,EAAE,CACR,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EACrB,iEAAiE,CACjE,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["// Project/App: GSD-2\n// File Purpose: Runtime tests for TUI tool cards, success notifications, and blocking errors.\n// GSD2 TUI Tests - Runtime coverage for tool-card cleanup and success notification rendering.\n// Runtime regression tests for the post-compaction tool-card cleanup and the\n// green-bordered success-notification rendering. Replaces the source-grep\n// `src/tests/tui-running-and-success-box.test.ts` that was deleted in #4875\n// (tracked as #4872).\n//\n// The previous tests asserted on identifier presence and method signature\n// shape via regex. A regression that routed `success` notifications through\n// `showStatus` (dim text) by accident would not have failed because the\n// `showSuccess` method would still exist and still match the regex. These\n// tests instead drive the components through the actual scenario and assert\n// on rendered output.\n\nimport assert from \"node:assert/strict\";\nimport { describe, it, before } from \"node:test\";\n\nimport { Container, Text } from \"@gsd/pi-tui\";\nimport stripAnsi from \"strip-ansi\";\n\nimport { initTheme, theme } from \"../theme/theme.js\";\nimport { renderBlockingErrorBanner, renderExtensionNotifyInChat, shouldRenderExtensionNotifyInChat } from \"../interactive-mode.js\";\nimport { DynamicBorder } from \"./dynamic-border.js\";\nimport { ToolExecutionComponent } from \"./tool-execution.js\";\n\n// Theme is a globalThis-shared singleton that throws if not initialized.\n// Initialize once before any test that exercises themed rendering.\nbefore(() => {\n\tinitTheme(\"dark\");\n});\n\ndescribe(\"Extension warning notifications\", () => {\n\tit(\"do not render into chat output\", () => {\n\t\tassert.equal(shouldRenderExtensionNotifyInChat(\"warning\"), false);\n\t\tassert.equal(shouldRenderExtensionNotifyInChat(\"error\"), true);\n\t\tassert.equal(shouldRenderExtensionNotifyInChat(\"success\"), true);\n\t\tassert.equal(shouldRenderExtensionNotifyInChat(\"info\"), true);\n\t\tassert.equal(shouldRenderExtensionNotifyInChat(undefined), true);\n\n\t\tconst warningChat = new Container();\n\t\tconst warningResult = renderExtensionNotifyInChat(warningChat, \"extension warning\", \"warning\");\n\t\tassert.equal(warningResult.rendered, false);\n\t\tassert.equal(\n\t\t\twarningChat.render(80).map(stripAnsi).join(\"\\n\"),\n\t\t\t\"\",\n\t\t\t\"warning notifications must not add chat output\",\n\t\t);\n\n\t\tfor (const type of [\"error\", \"success\", \"info\"] as const) {\n\t\t\tconst chat = new Container();\n\t\t\tconst result = renderExtensionNotifyInChat(chat, `${type} notification`, type);\n\t\t\tassert.equal(result.rendered, true, `${type} notification should render`);\n\t\t\tassert.match(\n\t\t\t\tchat.render(80).map(stripAnsi).join(\"\\n\"),\n\t\t\t\tnew RegExp(`${type} notification`),\n\t\t\t\t`${type} notification text should appear in chat output`,\n\t\t\t);\n\t\t}\n\t});\n});\n\ndescribe(\"Blocking error banner\", () => {\n\tit(\"keeps full error notifications renderable outside chat history\", () => {\n\t\tconst banner = new Container();\n\t\tconst message = [\n\t\t\t\"Pre-execution checks failed: 3 blocking issues found\",\n\t\t\t\" - [file] lib/types.ts: Task T01 references 'lib/types.ts'\",\n\t\t\t\"See .gsd/milestones/M001/slices/S02/S02-PRE-EXEC-VERIFY.json for full details.\",\n\t\t].join(\"\\n\");\n\n\t\trenderBlockingErrorBanner(banner, message);\n\n\t\tconst rendered = banner.render(140).map(stripAnsi).join(\"\\n\");\n\t\tassert.match(rendered, /Error: Pre-execution checks failed: 3 blocking issues found/);\n\t\tassert.match(rendered, /Task T01 references 'lib\\/types\\.ts'/);\n\t\tassert.match(rendered, /S02-PRE-EXEC-VERIFY\\.json/);\n\t});\n\n\tit(\"clears the sticky banner when the blocking error is cleared\", () => {\n\t\tconst banner = new Container();\n\n\t\trenderBlockingErrorBanner(banner, \"Provider failed\");\n\t\tassert.match(banner.render(80).map(stripAnsi).join(\"\\n\"), /Provider failed/);\n\n\t\trenderBlockingErrorBanner(banner, undefined);\n\t\tassert.equal(banner.render(80).map(stripAnsi).join(\"\\n\"), \"\");\n\t});\n});\n\ninterface MockTui {\n\trenderCount: number;\n\trequestRender(): void;\n}\n\nfunction makeMockTUI(): MockTui {\n\treturn {\n\t\trenderCount: 0,\n\t\trequestRender() {\n\t\t\tthis.renderCount++;\n\t\t},\n\t};\n}\n\n// ─── Bug 1: tool cards stuck in \"Running\" after compaction ──────────────\n\ndescribe(\"ToolExecutionComponent post-compaction cleanup\", () => {\n\tit(\"renders 'running' status while the tool call has no result\", () => {\n\t\t// Baseline: a freshly-constructed component (mid-stream) must show\n\t\t// the running badge — this is the state we need to flip OUT of when\n\t\t// compaction removes the result message.\n\t\tconst ui = makeMockTUI();\n\t\tconst c = new ToolExecutionComponent(\n\t\t\t\"read_file\",\n\t\t\t{ path: \"/tmp/x.txt\" },\n\t\t\t{},\n\t\t\tundefined,\n\t\t\tui as never,\n\t\t);\n\t\tconst rendered = c.render(60).map(stripAnsi).join(\"\\n\");\n\t\tassert.ok(\n\t\t\trendered.includes(\"running\"),\n\t\t\t\"freshly constructed component should render 'running' badge\",\n\t\t);\n\t});\n\n\tit(\"markHistoricalNoResult flips a stuck tool card OUT of 'running'\", () => {\n\t\t// Real bug: after session-history replay (post-compaction or session\n\t\t// switch), tool calls without matching tool_result messages stay in\n\t\t// isPartial = true forever. markHistoricalNoResult must produce a\n\t\t// rendered output that no longer reads \"Running\".\n\t\tconst ui = makeMockTUI();\n\t\tconst c = new ToolExecutionComponent(\n\t\t\t\"read_file\",\n\t\t\t{ path: \"/tmp/x.txt\" },\n\t\t\t{},\n\t\t\tundefined,\n\t\t\tui as never,\n\t\t);\n\n\t\tc.markHistoricalNoResult();\n\n\t\tconst rendered = c.render(60).map(stripAnsi).join(\"\\n\");\n\t\tassert.ok(\n\t\t\t!rendered.includes(\"running\"),\n\t\t\t\"after markHistoricalNoResult, the tool card must NOT render 'running' -- got:\\n\" +\n\t\t\t\trendered,\n\t\t);\n\t\tassert.ok(\n\t\t\trendered.includes(\"success\"),\n\t\t\t\"flipped card should render 'success' status (no-result success)\",\n\t\t);\n\t});\n\n\tit(\"markHistoricalNoResult is idempotent when a real result already exists\", () => {\n\t\t// Late-arriving stream events must not clobber legitimate results.\n\t\t// We observe the no-clobber via behaviour: a card that completed\n\t\t// with a real result keeps its \"Done\" badge and content even if\n\t\t// markHistoricalNoResult fires again afterwards.\n\t\tconst ui = makeMockTUI();\n\t\tconst c = new ToolExecutionComponent(\n\t\t\t\"read_file\",\n\t\t\t{ path: \"/tmp/x.txt\" },\n\t\t\t{},\n\t\t\tundefined,\n\t\t\tui as never,\n\t\t);\n\n\t\t// Use the public completion path the runtime calls.\n\t\tc.updateResult(\n\t\t\t{\n\t\t\t\tcontent: [{ type: \"text\", text: \"real-result-payload\" }],\n\t\t\t\tisError: false,\n\t\t\t},\n\t\t\tfalse, // isPartial = false → \"Done\"\n\t\t);\n\n\t\tconst before = c.render(60).map(stripAnsi).join(\"\\n\");\n\t\tassert.ok(before.includes(\"success\"), \"after complete(), card shows 'success'\");\n\n\t\tc.markHistoricalNoResult(); // must early-return\n\t\tconst after = c.render(60).map(stripAnsi).join(\"\\n\");\n\t\tassert.equal(\n\t\t\tafter,\n\t\t\tbefore,\n\t\t\t\"markHistoricalNoResult must NOT mutate state when a real result is already present\",\n\t\t);\n\t});\n});\n\n// ─── Bug 2: success notifications render as a green bordered box ────────\n\ndescribe(\"Success-notification rendering — DynamicBorder + success theme\", () => {\n\t// We drive the same component composition that interactive-mode.showSuccess\n\t// builds (DynamicBorder + Text + DynamicBorder, all themed with\n\t// theme.fg(\"success\", …)) and assert on the rendered output, rather than\n\t// trying to instantiate the full InteractiveMode (which requires a real\n\t// session, bridge, and TUI runtime).\n\tfunction buildSuccessNotification(message: string): Container {\n\t\tconst c = new Container();\n\t\tconst successColor = (text: string) => theme.fg(\"success\", text);\n\t\tc.addChild(new DynamicBorder(successColor));\n\t\tc.addChild(new Text(theme.fg(\"success\", message), 1, 0));\n\t\tc.addChild(new DynamicBorder(successColor));\n\t\treturn c;\n\t}\n\n\tit(\"renders a top and bottom horizontal border framing the message\", () => {\n\t\tconst c = buildSuccessNotification(\"Milestone M042 ready.\");\n\t\tconst lines = c.render(40);\n\n\t\t// First and last lines should be horizontal-rule borders\n\t\t// (DynamicBorder renders a row of \"─\" characters).\n\t\tconst firstStripped = stripAnsi(lines[0]);\n\t\tconst lastStripped = stripAnsi(lines[lines.length - 1]);\n\n\t\tassert.ok(\n\t\t\tfirstStripped.includes(\"─\"),\n\t\t\t`first line should be a border (got: ${JSON.stringify(firstStripped)})`,\n\t\t);\n\t\tassert.ok(\n\t\t\tlastStripped.includes(\"─\"),\n\t\t\t`last line should be a border (got: ${JSON.stringify(lastStripped)})`,\n\t\t);\n\t\tassert.ok(\n\t\t\tlines.length >= 3,\n\t\t\t`success notification must have at least 3 lines (top border, message, bottom border) — got ${lines.length}`,\n\t\t);\n\t});\n\n\tit(\"the message text appears between the two borders\", () => {\n\t\tconst c = buildSuccessNotification(\"Milestone M042 ready.\");\n\t\tconst lines = c.render(40);\n\n\t\tconst messageRow = lines.findIndex((l) => stripAnsi(l).includes(\"Milestone M042 ready.\"));\n\t\tassert.ok(messageRow > 0, \"message must appear after the top border\");\n\t\tassert.ok(\n\t\t\tmessageRow < lines.length - 1,\n\t\t\t\"message must appear before the bottom border\",\n\t\t);\n\t});\n\n\tit(\"borders carry ANSI styling (not plain dim text like showStatus)\", () => {\n\t\t// Goodhart-resistant: if a regression routed success through\n\t\t// showStatus, the borders would be missing AND the rendered text\n\t\t// would be plain (or only dim-styled, not success-colored). We\n\t\t// observe the border lines carry ANSI escape codes — the literal\n\t\t// foreground color depends on the theme (which is system-dependent\n\t\t// in CI), so we don't pin a specific code but DO require styling\n\t\t// to be present.\n\t\tconst c = buildSuccessNotification(\"ok\");\n\t\tconst lines = c.render(40);\n\t\tconst top = lines[0];\n\t\tassert.ok(\n\t\t\ttop !== stripAnsi(top),\n\t\t\t\"top border must contain ANSI styling — a plain unstyled border \" +\n\t\t\t\t\"would indicate the rendering bypassed theme.fg('success', ...)\",\n\t\t);\n\t});\n\n\tit(\"plain Text status (the showStatus path) does NOT produce a bordered box\", () => {\n\t\t// Counter-test: this is what the bug looked like — a single dim Text\n\t\t// with no surrounding border. If anyone ever \"fixes\" the showSuccess\n\t\t// regression by also adding borders to showStatus, this test will\n\t\t// surface the conflation.\n\t\tconst plain = new Text(theme.fg(\"dim\", \"Milestone M042 ready.\"), 1, 0);\n\t\tconst lines = plain.render(40);\n\t\tconst joined = lines.map(stripAnsi).join(\"\\n\");\n\t\tassert.ok(\n\t\t\t!joined.includes(\"─\"),\n\t\t\t\"plain Text (showStatus path) must NOT contain border characters\",\n\t\t);\n\t});\n});\n"]}
|
|
@@ -4,6 +4,8 @@ export type ToolExecutionPhase = {
|
|
|
4
4
|
label: string;
|
|
5
5
|
count: number;
|
|
6
6
|
durationMs: number;
|
|
7
|
+
targets?: string[];
|
|
8
|
+
actionLabel?: string;
|
|
7
9
|
};
|
|
8
10
|
export interface ToolExecutionOptions {
|
|
9
11
|
showImages?: boolean;
|
|
@@ -92,6 +94,9 @@ export declare class ToolExecutionComponent extends Container {
|
|
|
92
94
|
getRollupPhase(): ToolExecutionPhase | null;
|
|
93
95
|
private getPhaseLabel;
|
|
94
96
|
private getCompactSummary;
|
|
97
|
+
private getCompactAction;
|
|
98
|
+
private getTargetMetadata;
|
|
99
|
+
private getCompactTarget;
|
|
95
100
|
private updateDisplay;
|
|
96
101
|
/**
|
|
97
102
|
* Render bash content using visual line truncation (like bash-execution.ts)
|
|
@@ -103,6 +108,7 @@ export declare class ToolExecutionComponent extends Container {
|
|
|
103
108
|
export declare class ToolPhaseSummaryComponent extends Container {
|
|
104
109
|
private readonly phases;
|
|
105
110
|
constructor(phases: ToolExecutionPhase[]);
|
|
111
|
+
getPhases(): ToolExecutionPhase[];
|
|
106
112
|
render(width: number): string[];
|
|
107
113
|
}
|
|
108
114
|
//# sourceMappingURL=tool-execution.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-execution.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/tool-execution.ts"],"names":[],"mappings":"AACA,OAAO,EAEN,SAAS,EAQT,KAAK,GAAG,EAGR,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"tool-execution.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/tool-execution.ts"],"names":[],"mappings":"AACA,OAAO,EAEN,SAAS,EAQT,KAAK,GAAG,EAGR,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AA4IxE,MAAM,MAAM,kBAAkB,GAAG;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AA+JF,MAAM,WAAW,oBAAoB;IACpC,UAAU,CAAC,EAAE,OAAO,CAAC;CACrB;AAUD;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,SAAS;IACpD,OAAO,CAAC,UAAU,CAAM;IACxB,OAAO,CAAC,WAAW,CAAO;IAC1B,OAAO,CAAC,eAAe,CAAe;IACtC,OAAO,CAAC,YAAY,CAAgB;IACpC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,IAAI,CAAM;IAClB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,UAAU,CAAU;IAC5B,OAAO,CAAC,SAAS,CAAQ;IACzB,OAAO,CAAC,cAAc,CAAC,CAAiB;IACxC,OAAO,CAAC,EAAE,CAAM;IAChB,OAAO,CAAC,GAAG,CAAS;IACpB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAc;IACxC,OAAO,CAAC,OAAO,CAAqB;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;IA2BlC,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI;IAKpC,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI;IAKzB,UAAU,IAAI,IAAI;IAKlB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE;IA0BxC,OAAO,CAAC,0BAA0B;IAMlC,cAAc,IAAI,kBAAkB,GAAG,IAAI;IAc3C,OAAO,CAAC,aAAa;IAgBrB,OAAO,CAAC,iBAAiB;IASzB,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,iBAAiB;IAKzB,OAAO,CAAC,gBAAgB;IA6BxB,OAAO,CAAC,aAAa;IAoKrB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAmFzB,OAAO,CAAC,aAAa;IA0BrB,OAAO,CAAC,mBAAmB;CAsX3B;AAED,qBAAa,yBAA0B,SAAQ,SAAS;IAC3C,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,kBAAkB,EAAE;IAIzD,SAAS,IAAI,kBAAkB,EAAE;IAIxB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE;CAgBxC"}
|
|
@@ -82,24 +82,40 @@ function renderToolFrame(contentLines, width, opts) {
|
|
|
82
82
|
const contentWidth = Math.max(1, outerWidth - 2); // "│ " + content
|
|
83
83
|
const borderColor = opts.tone === "error" ? "toolError" : opts.tone === "pending" ? "toolRunning" : "toolSuccess";
|
|
84
84
|
const topColor = borderColor;
|
|
85
|
-
const labelColor = opts.tone === "error" ? "toolError" : "
|
|
85
|
+
const labelColor = opts.tone === "error" ? "toolError" : opts.tone === "pending" ? "toolRunning" : "toolSuccess";
|
|
86
86
|
const statusColor = opts.tone === "error" ? "toolError" : opts.tone === "pending" ? "toolRunning" : "toolSuccess";
|
|
87
|
-
const leftStyled = theme.fg(labelColor, theme.bold(
|
|
87
|
+
const leftStyled = theme.fg(labelColor, theme.bold(opts.label));
|
|
88
88
|
const rightStyled = theme.fg(statusColor, opts.status);
|
|
89
|
-
const
|
|
89
|
+
const titleWidth = Math.max(1, outerWidth - 4);
|
|
90
|
+
const gap = Math.max(1, titleWidth - visibleWidth(leftStyled) - visibleWidth(rightStyled));
|
|
90
91
|
const headerRow = `${leftStyled}${" ".repeat(gap)}${rightStyled}`;
|
|
91
|
-
const headerPad = Math.max(0,
|
|
92
|
+
const headerPad = Math.max(0, titleWidth - visibleWidth(headerRow));
|
|
92
93
|
const sourceLines = trimOuterBlankLines(contentLines);
|
|
93
94
|
const bodyLines = (sourceLines.length > 0 ? sourceLines : [""]).map((line) => {
|
|
94
95
|
const clipped = truncateToWidth(line, contentWidth, "");
|
|
95
96
|
return clipped;
|
|
96
97
|
});
|
|
97
98
|
return style()
|
|
98
|
-
.border("
|
|
99
|
+
.border("rounded")
|
|
99
100
|
.borderColor((line) => theme.fg(line.startsWith("─") ? topColor : borderColor, line))
|
|
100
101
|
.title(headerRow + " ".repeat(headerPad))
|
|
101
102
|
.render(bodyLines, outerWidth);
|
|
102
103
|
}
|
|
104
|
+
function renderCollapsedToolRow(label, status, width, tone) {
|
|
105
|
+
const outerWidth = Math.max(20, width);
|
|
106
|
+
const contentWidth = Math.max(1, outerWidth - 2);
|
|
107
|
+
const statusColor = tone === "success" ? "toolSuccess" : "toolMuted";
|
|
108
|
+
const labelStyled = theme.fg(statusColor, label);
|
|
109
|
+
const statusStyled = theme.fg(statusColor, status);
|
|
110
|
+
const labelWidth = Math.max(1, contentWidth - visibleWidth(statusStyled) - 1);
|
|
111
|
+
const clippedLabel = truncateToWidth(labelStyled, labelWidth, "");
|
|
112
|
+
const gap = Math.max(1, contentWidth - visibleWidth(clippedLabel) - visibleWidth(statusStyled));
|
|
113
|
+
const line = `${clippedLabel}${" ".repeat(gap)}${statusStyled}`;
|
|
114
|
+
return style()
|
|
115
|
+
.border("minimal")
|
|
116
|
+
.borderColor((text) => theme.fg(statusColor, text))
|
|
117
|
+
.render([line], outerWidth);
|
|
118
|
+
}
|
|
103
119
|
const COMPACT_ARG_VALUE_LIMIT = 60;
|
|
104
120
|
const GENERIC_OUTPUT_PREVIEW_LINES = 10;
|
|
105
121
|
const GENERIC_ARGS_JSON_PREVIEW_LINES = 10;
|
|
@@ -108,6 +124,97 @@ function formatElapsed(ms) {
|
|
|
108
124
|
return `${ms}ms`;
|
|
109
125
|
return `${Math.max(1, Math.round(ms / 1000))}s`;
|
|
110
126
|
}
|
|
127
|
+
function formatCommandPreview(command) {
|
|
128
|
+
return truncateToWidth(command.replace(/\s+/g, " ").trim(), 64, "");
|
|
129
|
+
}
|
|
130
|
+
function appendLineOrRange(displayPath, target) {
|
|
131
|
+
if (!displayPath)
|
|
132
|
+
return undefined;
|
|
133
|
+
if (typeof target.line === "number" && Number.isFinite(target.line)) {
|
|
134
|
+
return `${displayPath}:${target.line}`;
|
|
135
|
+
}
|
|
136
|
+
const start = target.range?.start;
|
|
137
|
+
if (typeof start === "number" && Number.isFinite(start)) {
|
|
138
|
+
const end = target.range?.end;
|
|
139
|
+
const suffix = typeof end === "number" && Number.isFinite(end) && end !== start
|
|
140
|
+
? `${start}-${end}`
|
|
141
|
+
: `${start}`;
|
|
142
|
+
return `${displayPath}:${suffix}`;
|
|
143
|
+
}
|
|
144
|
+
return displayPath;
|
|
145
|
+
}
|
|
146
|
+
function formatToolTarget(target) {
|
|
147
|
+
const path = target.resolvedPath || target.inputPath;
|
|
148
|
+
const displayPath = path ? shortenPath(path) : undefined;
|
|
149
|
+
if (target.kind === "search") {
|
|
150
|
+
const searchTarget = displayPath ?? target.inputPath ?? ".";
|
|
151
|
+
const label = target.pattern ? `${target.pattern} in ${searchTarget}` : searchTarget;
|
|
152
|
+
return target.glob ? `${label} (${target.glob})` : label;
|
|
153
|
+
}
|
|
154
|
+
return appendLineOrRange(displayPath, target);
|
|
155
|
+
}
|
|
156
|
+
function formatArgsPathTarget(path, args) {
|
|
157
|
+
if (!path)
|
|
158
|
+
return undefined;
|
|
159
|
+
const start = typeof args.offset === "number" ? args.offset : undefined;
|
|
160
|
+
const limit = typeof args.limit === "number" ? args.limit : undefined;
|
|
161
|
+
const range = start !== undefined || limit !== undefined
|
|
162
|
+
? {
|
|
163
|
+
start: start ?? 1,
|
|
164
|
+
end: limit !== undefined ? (start ?? 1) + Math.max(0, limit - 1) : undefined,
|
|
165
|
+
}
|
|
166
|
+
: undefined;
|
|
167
|
+
return appendLineOrRange(shortenPath(path), { range });
|
|
168
|
+
}
|
|
169
|
+
function stripLineSuffix(target) {
|
|
170
|
+
return target.replace(/:\d+(?:-\d+)?$/, "");
|
|
171
|
+
}
|
|
172
|
+
function uniqueTargets(targets) {
|
|
173
|
+
const seen = new Set();
|
|
174
|
+
const unique = [];
|
|
175
|
+
for (const target of targets ?? []) {
|
|
176
|
+
if (!target || seen.has(target))
|
|
177
|
+
continue;
|
|
178
|
+
seen.add(target);
|
|
179
|
+
unique.push(target);
|
|
180
|
+
}
|
|
181
|
+
return unique;
|
|
182
|
+
}
|
|
183
|
+
function summarizePhaseLabel(phase) {
|
|
184
|
+
const phaseTargets = uniqueTargets(phase.targets);
|
|
185
|
+
const baseTargets = uniqueTargets(phaseTargets.map(stripLineSuffix));
|
|
186
|
+
if (phase.label === "File changes" && baseTargets.length > 0) {
|
|
187
|
+
const fileWord = baseTargets.length === 1 ? "file" : "files";
|
|
188
|
+
const actionWord = phase.actionLabel === "write"
|
|
189
|
+
? phase.count === 1
|
|
190
|
+
? "write"
|
|
191
|
+
: "writes"
|
|
192
|
+
: phase.actionLabel === undefined
|
|
193
|
+
? phase.count === 1
|
|
194
|
+
? "action"
|
|
195
|
+
: "actions"
|
|
196
|
+
: phase.count === 1
|
|
197
|
+
? "edit"
|
|
198
|
+
: "edits";
|
|
199
|
+
return `${phase.label} · ${baseTargets.length} ${fileWord}, ${phase.count} ${actionWord}`;
|
|
200
|
+
}
|
|
201
|
+
if (phase.label === "Context reads" && baseTargets.length > 0) {
|
|
202
|
+
const fileWord = baseTargets.length === 1 ? "file" : "files";
|
|
203
|
+
return `${phase.label} · ${baseTargets.length} ${fileWord}`;
|
|
204
|
+
}
|
|
205
|
+
if (phase.label === "Setup / shell" && phaseTargets.length > 0) {
|
|
206
|
+
return `${phase.label} · ${phase.count} ${phase.count === 1 ? "command" : "commands"}`;
|
|
207
|
+
}
|
|
208
|
+
return `${phase.label} ${phase.count} ${phase.count === 1 ? "action" : "actions"}`;
|
|
209
|
+
}
|
|
210
|
+
function summarizePhaseTargets(phase, width) {
|
|
211
|
+
const phaseTargets = uniqueTargets(phase.targets);
|
|
212
|
+
if (phaseTargets.length === 0)
|
|
213
|
+
return undefined;
|
|
214
|
+
const shown = phaseTargets.slice(0, 3);
|
|
215
|
+
const suffix = phaseTargets.length > shown.length ? ` +${phaseTargets.length - shown.length} more` : "";
|
|
216
|
+
return truncateToWidth(shown.join(" · ") + suffix, width, "");
|
|
217
|
+
}
|
|
111
218
|
/**
|
|
112
219
|
* Format tool args for the generic-renderer fallback. Produces a one-line
|
|
113
220
|
* `k=v, k=v` summary when every value is a primitive that fits inline; falls
|
|
@@ -445,18 +552,13 @@ export class ToolExecutionComponent extends Container {
|
|
|
445
552
|
const contentWidth = Math.max(1, frameWidth - 4);
|
|
446
553
|
const frameTone = this.result?.isError ? "error" : this.isPartial || !this.result ? "pending" : "success";
|
|
447
554
|
const elapsed = formatElapsed((this.endedAt ?? Date.now()) - this.startedAt);
|
|
448
|
-
const frameStatus = `${this.isPartial || !this.result ? "
|
|
555
|
+
const frameStatus = `${this.isPartial || !this.result ? "running" : this.result.isError ? "failed" : "success"} · ${elapsed}`;
|
|
449
556
|
const parsed = parseMcpToolName(this.toolName);
|
|
450
557
|
const frameLabel = parsed
|
|
451
|
-
?
|
|
452
|
-
:
|
|
558
|
+
? `${parsed.server}·${parsed.tool}`
|
|
559
|
+
: prettifyToolName(this.toolName, this.toolDefinition?.label) || "unknown";
|
|
453
560
|
if (this.shouldRenderCompactSuccess()) {
|
|
454
|
-
|
|
455
|
-
const summaryWidth = Math.max(1, availableWidth - visibleWidth(frameStatus) - 1);
|
|
456
|
-
const summary = truncateToWidth(this.getCompactSummary(frameLabel), summaryWidth, "");
|
|
457
|
-
const gap = Math.max(1, availableWidth - visibleWidth(summary) - visibleWidth(frameStatus));
|
|
458
|
-
const line = `${theme.fg("toolSuccess", summary)}${" ".repeat(gap)}${theme.fg("toolSuccess", frameStatus)}`;
|
|
459
|
-
return ["", ...style().border("minimal").borderColor((text) => theme.fg("toolSuccess", text)).render([line], frameWidth)];
|
|
561
|
+
return ["", ...renderCollapsedToolRow(this.getCompactSummary(frameLabel), frameStatus, frameWidth, "success")];
|
|
460
562
|
}
|
|
461
563
|
const lines = super.render(contentWidth);
|
|
462
564
|
const framed = renderToolFrame(lines, frameWidth, {
|
|
@@ -470,17 +572,20 @@ export class ToolExecutionComponent extends Container {
|
|
|
470
572
|
if (this.expanded || this.isPartial || !this.result || this.result.isError)
|
|
471
573
|
return false;
|
|
472
574
|
const hasImages = this.result.content?.some((block) => block.type === "image") ?? false;
|
|
473
|
-
return !hasImages
|
|
575
|
+
return !hasImages;
|
|
474
576
|
}
|
|
475
577
|
getRollupPhase() {
|
|
476
578
|
if (!this.shouldRenderCompactSuccess())
|
|
477
579
|
return null;
|
|
478
580
|
const label = this.getPhaseLabel();
|
|
479
581
|
const endedAt = this.endedAt ?? Date.now();
|
|
582
|
+
const target = this.getCompactTarget();
|
|
480
583
|
return {
|
|
481
584
|
label,
|
|
482
585
|
count: 1,
|
|
483
586
|
durationMs: Math.max(0, endedAt - this.startedAt),
|
|
587
|
+
targets: target ? [target] : undefined,
|
|
588
|
+
actionLabel: this.getCompactAction(),
|
|
484
589
|
};
|
|
485
590
|
}
|
|
486
591
|
getPhaseLabel() {
|
|
@@ -504,7 +609,51 @@ export class ToolExecutionComponent extends Container {
|
|
|
504
609
|
return "Other tool actions";
|
|
505
610
|
}
|
|
506
611
|
getCompactSummary(frameLabel) {
|
|
507
|
-
|
|
612
|
+
if (this.normalizedToolName === "bash") {
|
|
613
|
+
const command = str(this.args?.command);
|
|
614
|
+
return command ? `bash ${formatCommandPreview(command)}` : frameLabel;
|
|
615
|
+
}
|
|
616
|
+
const target = this.getCompactTarget();
|
|
617
|
+
return target ? `${this.getCompactAction()} ${target}` : frameLabel;
|
|
618
|
+
}
|
|
619
|
+
getCompactAction() {
|
|
620
|
+
const target = this.getTargetMetadata();
|
|
621
|
+
if (target?.action)
|
|
622
|
+
return target.action === "list" ? "ls" : target.action;
|
|
623
|
+
return this.normalizedToolName;
|
|
624
|
+
}
|
|
625
|
+
getTargetMetadata() {
|
|
626
|
+
const target = this.result?.details?.target;
|
|
627
|
+
return target && typeof target === "object" ? target : undefined;
|
|
628
|
+
}
|
|
629
|
+
getCompactTarget() {
|
|
630
|
+
const metadata = this.getTargetMetadata();
|
|
631
|
+
const metadataTarget = metadata ? formatToolTarget(metadata) : undefined;
|
|
632
|
+
if (metadataTarget)
|
|
633
|
+
return metadataTarget;
|
|
634
|
+
const path = str(this.args?.file_path ?? this.args?.path);
|
|
635
|
+
if (path === null)
|
|
636
|
+
return undefined;
|
|
637
|
+
if (this.normalizedToolName === "read" || this.normalizedToolName === "hashline_read") {
|
|
638
|
+
return formatArgsPathTarget(path, this.args);
|
|
639
|
+
}
|
|
640
|
+
if (this.normalizedToolName === "write" || this.normalizedToolName === "edit") {
|
|
641
|
+
return path ? shortenPath(path) : undefined;
|
|
642
|
+
}
|
|
643
|
+
if (this.normalizedToolName === "ls") {
|
|
644
|
+
return shortenPath(path || ".");
|
|
645
|
+
}
|
|
646
|
+
if (this.normalizedToolName === "find") {
|
|
647
|
+
const pattern = str(this.args?.pattern);
|
|
648
|
+
return pattern ? `${pattern} in ${shortenPath(path || ".")}` : shortenPath(path || ".");
|
|
649
|
+
}
|
|
650
|
+
if (this.normalizedToolName === "grep") {
|
|
651
|
+
const pattern = str(this.args?.pattern);
|
|
652
|
+
const glob = str(this.args?.glob);
|
|
653
|
+
const label = pattern ? `${pattern} in ${shortenPath(path || ".")}` : shortenPath(path || ".");
|
|
654
|
+
return glob ? `${label} (${glob})` : label;
|
|
655
|
+
}
|
|
656
|
+
return undefined;
|
|
508
657
|
}
|
|
509
658
|
updateDisplay() {
|
|
510
659
|
// Tool body now uses transparent background; status is conveyed in the frame header.
|
|
@@ -693,6 +842,10 @@ export class ToolExecutionComponent extends Container {
|
|
|
693
842
|
// Truncation warnings
|
|
694
843
|
const truncation = this.result.details?.truncation;
|
|
695
844
|
const fullOutputPath = this.result.details?.fullOutputPath;
|
|
845
|
+
const cwd = this.result.details?.cwd;
|
|
846
|
+
if (this.expanded && typeof cwd === "string" && cwd.length > 0) {
|
|
847
|
+
this.contentBox.addChild(new Text(`\n${theme.fg("muted", `cwd ${shortenPath(cwd)}`)}`, 0, 0));
|
|
848
|
+
}
|
|
696
849
|
if (truncation?.truncated || fullOutputPath) {
|
|
697
850
|
const warnings = [];
|
|
698
851
|
if (fullOutputPath) {
|
|
@@ -1082,16 +1235,21 @@ export class ToolPhaseSummaryComponent extends Container {
|
|
|
1082
1235
|
super();
|
|
1083
1236
|
this.phases = phases;
|
|
1084
1237
|
}
|
|
1238
|
+
getPhases() {
|
|
1239
|
+
return this.phases.map((phase) => ({ ...phase, targets: phase.targets ? [...phase.targets] : undefined }));
|
|
1240
|
+
}
|
|
1085
1241
|
render(width) {
|
|
1086
1242
|
const frameWidth = Math.max(20, width);
|
|
1087
|
-
const rows = this.phases.
|
|
1088
|
-
const left =
|
|
1243
|
+
const rows = this.phases.flatMap((phase) => {
|
|
1244
|
+
const left = summarizePhaseLabel(phase);
|
|
1089
1245
|
const right = `success · ${formatElapsed(phase.durationMs)}`;
|
|
1090
1246
|
const contentWidth = Math.max(1, frameWidth - 2);
|
|
1091
1247
|
const leftWidth = Math.max(1, contentWidth - visibleWidth(right) - 1);
|
|
1092
1248
|
const leftText = truncateToWidth(left, leftWidth, "");
|
|
1093
1249
|
const gap = Math.max(1, contentWidth - visibleWidth(leftText) - visibleWidth(right));
|
|
1094
|
-
|
|
1250
|
+
const summaryRow = `${theme.fg("toolSuccess", leftText)}${" ".repeat(gap)}${theme.fg("toolSuccess", right)}`;
|
|
1251
|
+
const targetRow = summarizePhaseTargets(phase, contentWidth);
|
|
1252
|
+
return targetRow ? [summaryRow, theme.fg("muted", targetRow)] : [summaryRow];
|
|
1095
1253
|
});
|
|
1096
1254
|
return ["", ...style().border("minimal").borderColor((text) => theme.fg("toolSuccess", text)).render(rows, frameWidth)];
|
|
1097
1255
|
}
|