gsd-pi 2.77.0-dev.538325aea → 2.77.0-dev.eaa4973bc
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/dist/cli-web-branch.d.ts +1 -0
- package/dist/cli-web-branch.js +3 -0
- package/dist/cli.js +59 -15
- package/dist/extension-discovery.d.ts +6 -0
- package/dist/extension-discovery.js +37 -0
- package/dist/extension-registry.d.ts +3 -0
- package/dist/extension-registry.js +1 -1
- package/dist/extension-sort.d.ts +18 -0
- package/dist/extension-sort.js +114 -0
- package/dist/extension-validator.d.ts +47 -0
- package/dist/extension-validator.js +127 -0
- package/dist/headless-ui.d.ts +1 -1
- package/dist/headless.js +4 -2
- package/dist/loader.js +36 -7
- package/dist/onboarding.js +5 -5
- package/dist/provider-migrations.d.ts +20 -2
- package/dist/provider-migrations.js +15 -2
- package/dist/remote-questions-config.js +1 -1
- package/dist/resources/extensions/async-jobs/async-bash-tool.js +1 -1
- package/dist/resources/extensions/aws-auth/index.js +1 -2
- package/dist/resources/extensions/bg-shell/bg-shell-lifecycle.js +9 -6
- package/dist/resources/extensions/bg-shell/process-manager.js +1 -2
- package/dist/resources/extensions/browser-tools/index.js +1 -0
- package/dist/resources/extensions/claude-code-cli/index.js +1 -1
- package/dist/resources/extensions/claude-code-cli/partial-builder.js +17 -106
- package/dist/resources/extensions/claude-code-cli/stream-adapter.js +71 -57
- package/dist/resources/extensions/cmux/index.js +20 -0
- package/dist/resources/extensions/google-search/extension-manifest.json +5 -4
- package/dist/resources/extensions/google-search/index.js +2 -375
- package/dist/resources/extensions/gsd/abandon-detect.js +44 -0
- package/dist/resources/extensions/gsd/auto/resolve.js +24 -0
- package/dist/resources/extensions/gsd/auto/run-unit.js +10 -2
- package/dist/resources/extensions/gsd/auto/turn-epoch.js +95 -0
- package/dist/resources/extensions/gsd/auto-dispatch.js +24 -0
- package/dist/resources/extensions/gsd/auto-loop.js +1 -1
- package/dist/resources/extensions/gsd/auto-post-unit.js +31 -0
- package/dist/resources/extensions/gsd/auto-timeout-recovery.js +11 -5
- package/dist/resources/extensions/gsd/auto-unit-closeout.js +11 -2
- package/dist/resources/extensions/gsd/auto-worktree.js +58 -8
- package/dist/resources/extensions/gsd/auto.js +31 -14
- package/dist/resources/extensions/gsd/bootstrap/provider-error-resume.js +4 -2
- package/dist/resources/extensions/gsd/bootstrap/register-extension.js +11 -0
- package/dist/resources/extensions/gsd/bootstrap/system-context.js +11 -6
- package/dist/resources/extensions/gsd/commands/handlers/workflow.js +31 -4
- package/dist/resources/extensions/gsd/commands-cmux.js +9 -6
- package/dist/resources/extensions/gsd/commands-extensions.js +634 -43
- package/dist/resources/extensions/gsd/file-lock.js +49 -9
- package/dist/resources/extensions/gsd/git-service.js +1 -0
- package/dist/resources/extensions/gsd/gitignore.js +1 -0
- package/dist/resources/extensions/gsd/guided-flow-queue.js +4 -1
- package/dist/resources/extensions/gsd/guided-flow.js +1 -1
- package/dist/resources/extensions/gsd/journal.js +17 -2
- package/dist/resources/extensions/gsd/milestone-actions.js +15 -0
- package/dist/resources/extensions/gsd/notifications.js +30 -16
- package/dist/resources/extensions/gsd/reports.js +5 -4
- package/dist/resources/extensions/gsd/tools/complete-slice.js +21 -0
- package/dist/resources/extensions/gsd/tools/complete-task.js +31 -0
- package/dist/resources/extensions/gsd/uok/audit.js +18 -2
- package/dist/resources/extensions/gsd/workflow-logger.js +10 -2
- package/dist/resources/extensions/gsd/worktree-manager.js +1 -0
- package/dist/resources/extensions/mcp-client/auth.js +10 -1
- package/dist/resources/extensions/mcp-client/index.js +119 -10
- package/dist/resources/extensions/ollama/index.js +2 -1
- package/dist/resources/extensions/ollama/ollama-chat-provider.js +15 -5
- package/dist/resources/extensions/remote-questions/config.js +1 -12
- package/dist/resources/extensions/shared/cmux-events.js +12 -0
- package/dist/resources/extensions/shared/rtk-session-stats.js +1 -2
- package/dist/resources/extensions/universal-config/index.js +1 -1
- package/dist/resources/skills/create-skill/SKILL.md +2 -2
- package/dist/resources/skills/create-skill/references/gsd-skill-ecosystem.md +4 -4
- package/dist/resources/skills/create-skill/workflows/audit-skill.md +4 -4
- package/dist/resources/skills/create-skill/workflows/create-new-skill.md +5 -5
- package/dist/security-overrides.d.ts +1 -4
- package/dist/security-overrides.js +3 -16
- 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 +11 -11
- 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 +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.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/api/boot/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/boot/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/captures/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/captures/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/cleanup/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/cleanup/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/doctor/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/doctor/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/export-data/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/export-data/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/files/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/files/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/forensics/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/forensics/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/git/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/history/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/history/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/hooks/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/hooks/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/inspect/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/inspect/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/knowledge/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/knowledge/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/live-state/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/live-state/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/notifications/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/notifications/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/onboarding/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/onboarding/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/projects/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/projects/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/recovery/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/recovery/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/session/browser/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/browser/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/session/command/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/command/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/session/events/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/events/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/session/manage/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/manage/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/settings-data/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/skill-health/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/skill-health/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/steer/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/steer/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/switch-root/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/switch-root/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/input/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/resize/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/undo/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/undo/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/visualizer/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/visualizer/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/index.html +1 -1
- package/dist/web/standalone/.next/server/app/index.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +1 -1
- 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-paths-manifest.json +11 -11
- package/dist/web/standalone/.next/server/chunks/1926.js +1 -0
- package/dist/web/standalone/.next/server/chunks/6897.js +2 -2
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware-manifest.json +5 -5
- package/dist/web/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
- 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/2826.e9f5195e91f9cad2.js +11 -0
- package/dist/web/standalone/.next/static/chunks/{webpack-1832629448831fdc.js → webpack-2e68521d7c82f7c2.js} +1 -1
- package/dist/web-mode.js +1 -1
- package/dist/welcome-screen.js +20 -19
- package/dist/wizard.js +5 -2
- package/package.json +16 -32
- package/packages/mcp-server/README.md +3 -3
- package/packages/mcp-server/dist/env-writer.d.ts +1 -0
- package/packages/mcp-server/dist/env-writer.d.ts.map +1 -1
- package/packages/mcp-server/dist/env-writer.js +74 -6
- package/packages/mcp-server/dist/env-writer.js.map +1 -1
- package/packages/mcp-server/dist/server.d.ts.map +1 -1
- package/packages/mcp-server/dist/server.js +36 -17
- package/packages/mcp-server/dist/server.js.map +1 -1
- package/packages/mcp-server/package.json +5 -0
- package/packages/mcp-server/src/env-writer.test.ts +79 -1
- package/packages/mcp-server/src/env-writer.ts +76 -6
- package/packages/mcp-server/src/readers/readers.test.ts +5 -1
- package/packages/mcp-server/src/server.ts +45 -19
- package/packages/mcp-server/tsconfig.tsbuildinfo +1 -1
- package/packages/native/package.json +5 -0
- package/packages/native/src/__tests__/clipboard.test.mjs +69 -23
- package/packages/native/tsconfig.json +1 -2
- package/packages/native/tsconfig.tsbuildinfo +1 -0
- package/packages/pi-agent-core/package.json +5 -0
- package/packages/pi-agent-core/src/agent-loop.test.ts +220 -15
- package/packages/pi-ai/package.json +5 -0
- package/packages/pi-ai/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts +25 -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 +105 -6
- package/packages/pi-coding-agent/dist/core/compaction/compaction.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/compaction.test.js +230 -28
- package/packages/pi-coding-agent/dist/core/compaction/compaction.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/utils.d.ts +30 -2
- package/packages/pi-coding-agent/dist/core/compaction/utils.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/utils.js +113 -12
- package/packages/pi-coding-agent/dist/core/compaction/utils.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction-orchestrator.d.ts +1 -0
- package/packages/pi-coding-agent/dist/core/compaction-orchestrator.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction-orchestrator.js +29 -18
- package/packages/pi-coding-agent/dist/core/compaction-orchestrator.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction-orchestrator.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/compaction-orchestrator.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/compaction-orchestrator.test.js +130 -0
- package/packages/pi-coding-agent/dist/core/compaction-orchestrator.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/compaction-utils.test.js +56 -1
- package/packages/pi-coding-agent/dist/core/compaction-utils.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/discovery-cache.test.js +8 -15
- package/packages/pi-coding-agent/dist/core/discovery-cache.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/extension-discovery.d.ts +25 -0
- package/packages/pi-coding-agent/dist/core/extensions/extension-discovery.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/extension-discovery.js +109 -0
- package/packages/pi-coding-agent/dist/core/extensions/extension-discovery.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/extension-registry.d.ts +67 -0
- package/packages/pi-coding-agent/dist/core/extensions/extension-registry.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/extension-registry.js +167 -0
- package/packages/pi-coding-agent/dist/core/extensions/extension-registry.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts +3 -2
- package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/loader.js +24 -8
- package/packages/pi-coding-agent/dist/core/extensions/loader.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/types.d.ts +7 -0
- 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/lsp/lsp-integration.test.js +11 -0
- package/packages/pi-coding-agent/dist/core/lsp/lsp-integration.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry-auth-mode.test.js +2 -2
- package/packages/pi-coding-agent/dist/core/model-registry-auth-mode.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/resource-loader.js +1 -1
- package/packages/pi-coding-agent/dist/core/resource-loader.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.d.ts +1 -0
- package/packages/pi-coding-agent/dist/core/sdk.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.js +4 -1
- package/packages/pi-coding-agent/dist/core/sdk.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.test.js +19 -1
- package/packages/pi-coding-agent/dist/core/sdk.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/system-prompt.js +3 -3
- package/packages/pi-coding-agent/dist/core/system-prompt.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/path-utils.test.js +2 -1
- package/packages/pi-coding-agent/dist/core/tools/path-utils.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/provider-display-name.test.js +15 -6
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/provider-display-name.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js +14 -5
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.d.ts +7 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.js +31 -9
- package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.test.js +14 -0
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.test.js.map +1 -1
- package/packages/pi-coding-agent/package.json +5 -0
- package/packages/pi-coding-agent/src/core/compaction/compaction.test.ts +368 -28
- package/packages/pi-coding-agent/src/core/compaction/compaction.ts +122 -6
- package/packages/pi-coding-agent/src/core/compaction/utils.ts +111 -13
- package/packages/pi-coding-agent/src/core/compaction-orchestrator.test.ts +154 -0
- package/packages/pi-coding-agent/src/core/compaction-orchestrator.ts +32 -18
- package/packages/pi-coding-agent/src/core/compaction-utils.test.ts +68 -1
- package/packages/pi-coding-agent/src/core/discovery-cache.test.ts +9 -18
- package/packages/pi-coding-agent/src/core/extensions/extension-discovery.ts +119 -0
- package/packages/pi-coding-agent/src/core/extensions/extension-registry.ts +222 -0
- package/packages/pi-coding-agent/src/core/extensions/loader.ts +24 -11
- package/packages/pi-coding-agent/src/core/extensions/types.ts +8 -0
- package/packages/pi-coding-agent/src/core/lsp/lsp-integration.test.ts +13 -0
- package/packages/pi-coding-agent/src/core/model-registry-auth-mode.test.ts +2 -2
- package/packages/pi-coding-agent/src/core/resource-loader.ts +1 -1
- package/packages/pi-coding-agent/src/core/sdk.test.ts +25 -1
- package/packages/pi-coding-agent/src/core/sdk.ts +10 -3
- package/packages/pi-coding-agent/src/core/system-prompt.ts +3 -3
- package/packages/pi-coding-agent/src/core/tools/path-utils.test.ts +2 -1
- package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/provider-display-name.test.ts +17 -7
- package/packages/pi-coding-agent/src/modes/interactive/components/footer.ts +14 -5
- package/packages/pi-coding-agent/src/modes/interactive/components/model-selector.ts +45 -11
- package/packages/pi-coding-agent/src/modes/interactive/controllers/input-controller.test.ts +14 -0
- package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-tui/dist/__tests__/autocomplete.test.js +12 -5
- package/packages/pi-tui/dist/__tests__/autocomplete.test.js.map +1 -1
- package/packages/pi-tui/dist/__tests__/stdin-buffer.test.js +19 -0
- package/packages/pi-tui/dist/__tests__/stdin-buffer.test.js.map +1 -1
- package/packages/pi-tui/dist/stdin-buffer.d.ts +7 -0
- package/packages/pi-tui/dist/stdin-buffer.d.ts.map +1 -1
- package/packages/pi-tui/dist/stdin-buffer.js +20 -0
- package/packages/pi-tui/dist/stdin-buffer.js.map +1 -1
- package/packages/pi-tui/package.json +5 -0
- package/packages/pi-tui/src/__tests__/autocomplete.test.ts +20 -5
- package/packages/pi-tui/src/__tests__/stdin-buffer.test.ts +25 -0
- package/packages/pi-tui/src/stdin-buffer.ts +26 -0
- package/packages/pi-tui/tsconfig.tsbuildinfo +1 -1
- package/packages/rpc-client/package.json +5 -0
- package/pkg/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
- package/pkg/dist/core/export-html/ansi-to-html.js +0 -1
- package/pkg/dist/core/export-html/ansi-to-html.js.map +1 -1
- package/pkg/dist/core/export-html/index.d.ts +1 -1
- package/pkg/dist/core/export-html/index.d.ts.map +1 -1
- package/pkg/dist/core/export-html/index.js +5 -39
- package/pkg/dist/core/export-html/index.js.map +1 -1
- package/pkg/dist/core/export-html/tool-renderer.d.ts +2 -2
- package/pkg/dist/core/export-html/tool-renderer.d.ts.map +1 -1
- package/pkg/dist/core/export-html/tool-renderer.js.map +1 -1
- package/scripts/ensure-workspace-builds.cjs +0 -2
- package/scripts/lib/workspace-manifest.cjs +86 -0
- package/scripts/link-workspace-packages.cjs +5 -19
- package/src/resources/extensions/async-jobs/async-bash-tool.ts +1 -1
- package/src/resources/extensions/aws-auth/index.ts +1 -2
- package/src/resources/extensions/bg-shell/bg-shell-lifecycle.ts +7 -4
- package/src/resources/extensions/bg-shell/index.ts +1 -2
- package/src/resources/extensions/bg-shell/process-manager.ts +1 -2
- package/src/resources/extensions/browser-tools/index.ts +1 -2
- package/src/resources/extensions/claude-code-cli/index.ts +1 -1
- package/src/resources/extensions/claude-code-cli/partial-builder.ts +23 -115
- package/src/resources/extensions/claude-code-cli/stream-adapter.ts +81 -61
- package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +91 -22
- package/src/resources/extensions/cmux/index.ts +35 -10
- package/src/resources/extensions/google-search/extension-manifest.json +5 -4
- package/src/resources/extensions/google-search/index.ts +8 -470
- package/src/resources/extensions/gsd/abandon-detect.ts +62 -0
- package/src/resources/extensions/gsd/auto/loop-deps.ts +1 -1
- package/src/resources/extensions/gsd/auto/resolve.ts +29 -0
- package/src/resources/extensions/gsd/auto/run-unit.ts +16 -2
- package/src/resources/extensions/gsd/auto/turn-epoch.ts +108 -0
- package/src/resources/extensions/gsd/auto/types.ts +1 -1
- package/src/resources/extensions/gsd/auto-dispatch.ts +20 -0
- package/src/resources/extensions/gsd/auto-loop.ts +1 -1
- package/src/resources/extensions/gsd/auto-post-unit.ts +30 -0
- package/src/resources/extensions/gsd/auto-timeout-recovery.ts +12 -5
- package/src/resources/extensions/gsd/auto-unit-closeout.ts +14 -3
- package/src/resources/extensions/gsd/auto-worktree.ts +60 -5
- package/src/resources/extensions/gsd/auto.ts +37 -18
- package/src/resources/extensions/gsd/bootstrap/provider-error-resume.ts +6 -2
- package/src/resources/extensions/gsd/bootstrap/register-extension.ts +11 -0
- package/src/resources/extensions/gsd/bootstrap/system-context.ts +13 -9
- package/src/resources/extensions/gsd/commands/handlers/workflow.ts +27 -8
- package/src/resources/extensions/gsd/commands-cmux.ts +10 -6
- package/src/resources/extensions/gsd/commands-extensions.ts +747 -41
- package/src/resources/extensions/gsd/file-lock.ts +84 -11
- package/src/resources/extensions/gsd/git-service.ts +1 -0
- package/src/resources/extensions/gsd/gitignore.ts +1 -0
- package/src/resources/extensions/gsd/guided-flow-queue.ts +4 -1
- package/src/resources/extensions/gsd/guided-flow.ts +1 -1
- package/src/resources/extensions/gsd/journal.ts +27 -2
- package/src/resources/extensions/gsd/milestone-actions.ts +18 -0
- package/src/resources/extensions/gsd/notifications.ts +27 -15
- package/src/resources/extensions/gsd/reports.ts +5 -4
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +11 -2
- package/src/resources/extensions/gsd/tests/auto-mode-guards.test.ts +79 -0
- package/src/resources/extensions/gsd/tests/cmux.test.ts +5 -9
- package/src/resources/extensions/gsd/tests/file-lock.test.ts +86 -12
- package/src/resources/extensions/gsd/tests/google-search-stub.test.ts +121 -0
- package/src/resources/extensions/gsd/tests/integration/auto-worktree-milestone-merge.test.ts +30 -0
- package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +3 -2
- package/src/resources/extensions/gsd/tests/mcp-client-security.test.ts +76 -0
- package/src/resources/extensions/gsd/tests/milestone-transition-state-rebuild.test.ts +4 -2
- package/src/resources/extensions/gsd/tests/parallel-commit-scope.test.ts +5 -0
- package/src/resources/extensions/gsd/tests/parallel-skill-prompt-integration.test.ts +150 -0
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +39 -25
- package/src/resources/extensions/gsd/tests/queue-auto-guard.test.ts +181 -0
- package/src/resources/extensions/gsd/tests/quick-auto-guard.test.ts +13 -7
- package/src/resources/extensions/gsd/tests/require-slice-discussion-dispatch.test.ts +170 -0
- package/src/resources/extensions/gsd/tests/rewrite-docs-abandon-detect.test.ts +195 -0
- package/src/resources/extensions/gsd/tests/stuck-detection-coverage.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/triage-resolution.test.ts +50 -2
- package/src/resources/extensions/gsd/tests/turn-epoch.test.ts +162 -0
- package/src/resources/extensions/gsd/tests/validate-extension-package.test.ts +168 -0
- package/src/resources/extensions/gsd/tests/workflow-mcp.test.ts +25 -2
- package/src/resources/extensions/gsd/tools/complete-slice.ts +38 -0
- package/src/resources/extensions/gsd/tools/complete-task.ts +49 -0
- package/src/resources/extensions/gsd/uok/audit.ts +20 -2
- package/src/resources/extensions/gsd/workflow-logger.ts +22 -3
- package/src/resources/extensions/gsd/worktree-manager.ts +1 -0
- package/src/resources/extensions/mcp-client/auth.ts +12 -1
- package/src/resources/extensions/mcp-client/index.ts +130 -11
- package/src/resources/extensions/ollama/index.ts +3 -3
- package/src/resources/extensions/ollama/ollama-chat-provider.ts +18 -6
- package/src/resources/extensions/remote-questions/config.ts +4 -15
- package/src/resources/extensions/search-the-web/index.ts +1 -2
- package/src/resources/extensions/shared/cmux-events.ts +59 -0
- package/src/resources/extensions/shared/rtk-session-stats.ts +1 -2
- package/src/resources/extensions/shared/tests/format-utils.test.ts +3 -5
- package/src/resources/extensions/universal-config/index.ts +1 -1
- package/src/resources/skills/create-skill/SKILL.md +2 -2
- package/src/resources/skills/create-skill/references/gsd-skill-ecosystem.md +4 -4
- package/src/resources/skills/create-skill/workflows/audit-skill.md +4 -4
- package/src/resources/skills/create-skill/workflows/create-new-skill.md +5 -5
- package/dist/web/standalone/.next/server/chunks/7461.js +0 -1
- package/dist/web/standalone/.next/static/chunks/2826.d445fb428ef41fa1.js +0 -9
- package/packages/gsd-agent-core/dist/agent-session.d.ts +0 -716
- package/packages/gsd-agent-core/dist/agent-session.d.ts.map +0 -1
- package/packages/gsd-agent-core/dist/agent-session.js +0 -2595
- package/packages/gsd-agent-core/dist/agent-session.js.map +0 -1
- package/packages/gsd-agent-core/dist/artifact-manager.d.ts +0 -52
- package/packages/gsd-agent-core/dist/artifact-manager.d.ts.map +0 -1
- package/packages/gsd-agent-core/dist/artifact-manager.js +0 -118
- package/packages/gsd-agent-core/dist/artifact-manager.js.map +0 -1
- package/packages/gsd-agent-core/dist/bash-executor.d.ts +0 -57
- package/packages/gsd-agent-core/dist/bash-executor.d.ts.map +0 -1
- package/packages/gsd-agent-core/dist/bash-executor.js +0 -282
- package/packages/gsd-agent-core/dist/bash-executor.js.map +0 -1
- package/packages/gsd-agent-core/dist/blob-store.d.ts +0 -39
- package/packages/gsd-agent-core/dist/blob-store.d.ts.map +0 -1
- package/packages/gsd-agent-core/dist/blob-store.js +0 -151
- package/packages/gsd-agent-core/dist/blob-store.js.map +0 -1
- package/packages/gsd-agent-core/dist/compaction/branch-summarization.d.ts +0 -90
- package/packages/gsd-agent-core/dist/compaction/branch-summarization.d.ts.map +0 -1
- package/packages/gsd-agent-core/dist/compaction/branch-summarization.js +0 -207
- package/packages/gsd-agent-core/dist/compaction/branch-summarization.js.map +0 -1
- package/packages/gsd-agent-core/dist/compaction/compaction.d.ts +0 -137
- package/packages/gsd-agent-core/dist/compaction/compaction.d.ts.map +0 -1
- package/packages/gsd-agent-core/dist/compaction/compaction.js +0 -621
- package/packages/gsd-agent-core/dist/compaction/compaction.js.map +0 -1
- package/packages/gsd-agent-core/dist/compaction/index.d.ts +0 -7
- package/packages/gsd-agent-core/dist/compaction/index.d.ts.map +0 -1
- package/packages/gsd-agent-core/dist/compaction/index.js +0 -7
- package/packages/gsd-agent-core/dist/compaction/index.js.map +0 -1
- package/packages/gsd-agent-core/dist/compaction/utils.d.ts +0 -78
- package/packages/gsd-agent-core/dist/compaction/utils.d.ts.map +0 -1
- package/packages/gsd-agent-core/dist/compaction/utils.js +0 -263
- package/packages/gsd-agent-core/dist/compaction/utils.js.map +0 -1
- package/packages/gsd-agent-core/dist/compaction-orchestrator.d.ts +0 -90
- package/packages/gsd-agent-core/dist/compaction-orchestrator.d.ts.map +0 -1
- package/packages/gsd-agent-core/dist/compaction-orchestrator.js +0 -338
- package/packages/gsd-agent-core/dist/compaction-orchestrator.js.map +0 -1
- package/packages/gsd-agent-core/dist/contextual-tips.d.ts +0 -43
- package/packages/gsd-agent-core/dist/contextual-tips.d.ts.map +0 -1
- package/packages/gsd-agent-core/dist/contextual-tips.js +0 -208
- package/packages/gsd-agent-core/dist/contextual-tips.js.map +0 -1
- package/packages/gsd-agent-core/dist/export-html/ansi-to-html.d.ts +0 -18
- package/packages/gsd-agent-core/dist/export-html/ansi-to-html.d.ts.map +0 -1
- package/packages/gsd-agent-core/dist/export-html/ansi-to-html.js +0 -250
- package/packages/gsd-agent-core/dist/export-html/ansi-to-html.js.map +0 -1
- package/packages/gsd-agent-core/dist/export-html/index.d.ts +0 -37
- package/packages/gsd-agent-core/dist/export-html/index.d.ts.map +0 -1
- package/packages/gsd-agent-core/dist/export-html/index.js +0 -257
- package/packages/gsd-agent-core/dist/export-html/index.js.map +0 -1
- package/packages/gsd-agent-core/dist/export-html/template.css +0 -971
- package/packages/gsd-agent-core/dist/export-html/template.html +0 -54
- package/packages/gsd-agent-core/dist/export-html/template.js +0 -1583
- package/packages/gsd-agent-core/dist/export-html/tool-renderer.d.ts +0 -38
- package/packages/gsd-agent-core/dist/export-html/tool-renderer.d.ts.map +0 -1
- package/packages/gsd-agent-core/dist/export-html/tool-renderer.js +0 -70
- package/packages/gsd-agent-core/dist/export-html/tool-renderer.js.map +0 -1
- package/packages/gsd-agent-core/dist/export-html/vendor/highlight.min.js +0 -1213
- package/packages/gsd-agent-core/dist/export-html/vendor/marked.min.js +0 -6
- package/packages/gsd-agent-core/dist/fallback-resolver.d.ts +0 -75
- package/packages/gsd-agent-core/dist/fallback-resolver.d.ts.map +0 -1
- package/packages/gsd-agent-core/dist/fallback-resolver.js +0 -118
- package/packages/gsd-agent-core/dist/fallback-resolver.js.map +0 -1
- package/packages/gsd-agent-core/dist/image-overflow-recovery.d.ts +0 -44
- package/packages/gsd-agent-core/dist/image-overflow-recovery.d.ts.map +0 -1
- package/packages/gsd-agent-core/dist/image-overflow-recovery.js +0 -99
- package/packages/gsd-agent-core/dist/image-overflow-recovery.js.map +0 -1
- package/packages/gsd-agent-core/dist/index.d.ts +0 -14
- package/packages/gsd-agent-core/dist/index.d.ts.map +0 -1
- package/packages/gsd-agent-core/dist/index.js +0 -19
- package/packages/gsd-agent-core/dist/index.js.map +0 -1
- package/packages/gsd-agent-core/dist/keybindings.d.ts +0 -47
- package/packages/gsd-agent-core/dist/keybindings.d.ts.map +0 -1
- package/packages/gsd-agent-core/dist/keybindings.js +0 -156
- package/packages/gsd-agent-core/dist/keybindings.js.map +0 -1
- package/packages/gsd-agent-core/dist/lifecycle-hooks.d.ts +0 -42
- package/packages/gsd-agent-core/dist/lifecycle-hooks.d.ts.map +0 -1
- package/packages/gsd-agent-core/dist/lifecycle-hooks.js +0 -204
- package/packages/gsd-agent-core/dist/lifecycle-hooks.js.map +0 -1
- package/packages/gsd-agent-core/dist/retry-handler.d.ts +0 -128
- package/packages/gsd-agent-core/dist/retry-handler.d.ts.map +0 -1
- package/packages/gsd-agent-core/dist/retry-handler.js +0 -518
- package/packages/gsd-agent-core/dist/retry-handler.js.map +0 -1
- package/packages/gsd-agent-core/dist/sdk.d.ts +0 -159
- package/packages/gsd-agent-core/dist/sdk.d.ts.map +0 -1
- package/packages/gsd-agent-core/dist/sdk.js +0 -375
- package/packages/gsd-agent-core/dist/sdk.js.map +0 -1
- package/packages/gsd-agent-core/dist/system-prompt.d.ts +0 -28
- package/packages/gsd-agent-core/dist/system-prompt.d.ts.map +0 -1
- package/packages/gsd-agent-core/dist/system-prompt.js +0 -201
- package/packages/gsd-agent-core/dist/system-prompt.js.map +0 -1
- package/packages/gsd-agent-core/package.json +0 -25
- package/packages/gsd-agent-core/scripts/copy-assets.cjs +0 -43
- package/packages/gsd-agent-core/src/agent-session.test.ts +0 -169
- package/packages/gsd-agent-core/src/agent-session.ts +0 -3358
- package/packages/gsd-agent-core/src/artifact-manager.ts +0 -126
- package/packages/gsd-agent-core/src/bash-executor.ts +0 -352
- package/packages/gsd-agent-core/src/blob-store.ts +0 -154
- package/packages/gsd-agent-core/src/compaction/branch-summarization.ts +0 -317
- package/packages/gsd-agent-core/src/compaction/compaction.ts +0 -855
- package/packages/gsd-agent-core/src/compaction/index.ts +0 -7
- package/packages/gsd-agent-core/src/compaction/utils.ts +0 -312
- package/packages/gsd-agent-core/src/compaction-orchestrator.ts +0 -449
- package/packages/gsd-agent-core/src/contextual-tips.ts +0 -232
- package/packages/gsd-agent-core/src/export-html/ansi-to-html.ts +0 -259
- package/packages/gsd-agent-core/src/export-html/index.ts +0 -345
- package/packages/gsd-agent-core/src/export-html/template.css +0 -971
- package/packages/gsd-agent-core/src/export-html/template.html +0 -54
- package/packages/gsd-agent-core/src/export-html/template.js +0 -1583
- package/packages/gsd-agent-core/src/export-html/tool-renderer.ts +0 -114
- package/packages/gsd-agent-core/src/export-html/vendor/highlight.min.js +0 -1213
- package/packages/gsd-agent-core/src/export-html/vendor/marked.min.js +0 -6
- package/packages/gsd-agent-core/src/fallback-resolver.ts +0 -193
- package/packages/gsd-agent-core/src/image-overflow-recovery.ts +0 -120
- package/packages/gsd-agent-core/src/index.ts +0 -68
- package/packages/gsd-agent-core/src/keybindings.ts +0 -220
- package/packages/gsd-agent-core/src/lifecycle-hooks.ts +0 -284
- package/packages/gsd-agent-core/src/retry-handler.ts +0 -620
- package/packages/gsd-agent-core/src/sdk.ts +0 -550
- package/packages/gsd-agent-core/src/system-prompt.ts +0 -270
- package/packages/gsd-agent-core/tsconfig.json +0 -28
- package/packages/gsd-agent-core/tsconfig.tsbuildinfo +0 -1
- package/packages/gsd-agent-modes/dist/cli/args.d.ts +0 -58
- package/packages/gsd-agent-modes/dist/cli/args.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/cli/args.js +0 -324
- package/packages/gsd-agent-modes/dist/cli/args.js.map +0 -1
- package/packages/gsd-agent-modes/dist/cli/config-selector.d.ts +0 -13
- package/packages/gsd-agent-modes/dist/cli/config-selector.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/cli/config-selector.js +0 -32
- package/packages/gsd-agent-modes/dist/cli/config-selector.js.map +0 -1
- package/packages/gsd-agent-modes/dist/cli/file-processor.d.ts +0 -15
- package/packages/gsd-agent-modes/dist/cli/file-processor.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/cli/file-processor.js +0 -86
- package/packages/gsd-agent-modes/dist/cli/file-processor.js.map +0 -1
- package/packages/gsd-agent-modes/dist/cli/list-models.d.ts +0 -21
- package/packages/gsd-agent-modes/dist/cli/list-models.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/cli/list-models.js +0 -114
- package/packages/gsd-agent-modes/dist/cli/list-models.js.map +0 -1
- package/packages/gsd-agent-modes/dist/cli/session-picker.d.ts +0 -10
- package/packages/gsd-agent-modes/dist/cli/session-picker.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/cli/session-picker.js +0 -37
- package/packages/gsd-agent-modes/dist/cli/session-picker.js.map +0 -1
- package/packages/gsd-agent-modes/dist/index.d.ts +0 -7
- package/packages/gsd-agent-modes/dist/index.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/index.js +0 -7
- package/packages/gsd-agent-modes/dist/index.js.map +0 -1
- package/packages/gsd-agent-modes/dist/main.d.ts +0 -8
- package/packages/gsd-agent-modes/dist/main.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/main.js +0 -491
- package/packages/gsd-agent-modes/dist/main.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/armin.d.ts +0 -34
- package/packages/gsd-agent-modes/dist/modes/interactive/components/armin.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/armin.js +0 -330
- package/packages/gsd-agent-modes/dist/modes/interactive/components/armin.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/assistant-message.d.ts +0 -29
- package/packages/gsd-agent-modes/dist/modes/interactive/components/assistant-message.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/assistant-message.js +0 -141
- package/packages/gsd-agent-modes/dist/modes/interactive/components/assistant-message.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/bash-execution.d.ts +0 -36
- package/packages/gsd-agent-modes/dist/modes/interactive/components/bash-execution.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/bash-execution.js +0 -157
- package/packages/gsd-agent-modes/dist/modes/interactive/components/bash-execution.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/bordered-loader.d.ts +0 -16
- package/packages/gsd-agent-modes/dist/modes/interactive/components/bordered-loader.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/bordered-loader.js +0 -48
- package/packages/gsd-agent-modes/dist/modes/interactive/components/bordered-loader.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/branch-summary-message.d.ts +0 -16
- package/packages/gsd-agent-modes/dist/modes/interactive/components/branch-summary-message.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/branch-summary-message.js +0 -43
- package/packages/gsd-agent-modes/dist/modes/interactive/components/branch-summary-message.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/chat-frame.d.ts +0 -11
- package/packages/gsd-agent-modes/dist/modes/interactive/components/chat-frame.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/chat-frame.js +0 -47
- package/packages/gsd-agent-modes/dist/modes/interactive/components/chat-frame.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/compaction-summary-message.d.ts +0 -16
- package/packages/gsd-agent-modes/dist/modes/interactive/components/compaction-summary-message.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/compaction-summary-message.js +0 -44
- package/packages/gsd-agent-modes/dist/modes/interactive/components/compaction-summary-message.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/config-selector.d.ts +0 -71
- package/packages/gsd-agent-modes/dist/modes/interactive/components/config-selector.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/config-selector.js +0 -474
- package/packages/gsd-agent-modes/dist/modes/interactive/components/config-selector.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/countdown-timer.d.ts +0 -15
- package/packages/gsd-agent-modes/dist/modes/interactive/components/countdown-timer.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/countdown-timer.js +0 -32
- package/packages/gsd-agent-modes/dist/modes/interactive/components/countdown-timer.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-editor.d.ts +0 -22
- package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-editor.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-editor.js +0 -70
- package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-editor.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-message.d.ts +0 -20
- package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-message.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-message.js +0 -75
- package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-message.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/daxnuts.d.ts +0 -23
- package/packages/gsd-agent-modes/dist/modes/interactive/components/daxnuts.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/daxnuts.js +0 -140
- package/packages/gsd-agent-modes/dist/modes/interactive/components/daxnuts.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/diff.d.ts +0 -12
- package/packages/gsd-agent-modes/dist/modes/interactive/components/diff.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/diff.js +0 -133
- package/packages/gsd-agent-modes/dist/modes/interactive/components/diff.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/dynamic-border.d.ts +0 -33
- package/packages/gsd-agent-modes/dist/modes/interactive/components/dynamic-border.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/dynamic-border.js +0 -82
- package/packages/gsd-agent-modes/dist/modes/interactive/components/dynamic-border.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-editor.d.ts +0 -20
- package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-editor.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-editor.js +0 -111
- package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-editor.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-input.d.ts +0 -24
- package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-input.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-input.js +0 -63
- package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-input.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-selector.d.ts +0 -33
- package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-selector.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-selector.js +0 -118
- package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-selector.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/footer.d.ts +0 -32
- package/packages/gsd-agent-modes/dist/modes/interactive/components/footer.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/footer.js +0 -230
- package/packages/gsd-agent-modes/dist/modes/interactive/components/footer.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/index.d.ts +0 -34
- package/packages/gsd-agent-modes/dist/modes/interactive/components/index.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/index.js +0 -36
- package/packages/gsd-agent-modes/dist/modes/interactive/components/index.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/keybinding-hints.d.ts +0 -48
- package/packages/gsd-agent-modes/dist/modes/interactive/components/keybinding-hints.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/keybinding-hints.js +0 -72
- package/packages/gsd-agent-modes/dist/modes/interactive/components/keybinding-hints.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/login-dialog.d.ts +0 -63
- package/packages/gsd-agent-modes/dist/modes/interactive/components/login-dialog.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/login-dialog.js +0 -213
- package/packages/gsd-agent-modes/dist/modes/interactive/components/login-dialog.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/model-selector.d.ts +0 -86
- package/packages/gsd-agent-modes/dist/modes/interactive/components/model-selector.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/model-selector.js +0 -536
- package/packages/gsd-agent-modes/dist/modes/interactive/components/model-selector.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/oauth-selector.d.ts +0 -19
- package/packages/gsd-agent-modes/dist/modes/interactive/components/oauth-selector.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/oauth-selector.js +0 -93
- package/packages/gsd-agent-modes/dist/modes/interactive/components/oauth-selector.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/provider-manager.d.ts +0 -30
- package/packages/gsd-agent-modes/dist/modes/interactive/components/provider-manager.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/provider-manager.js +0 -169
- package/packages/gsd-agent-modes/dist/modes/interactive/components/provider-manager.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/scoped-models-selector.d.ts +0 -49
- package/packages/gsd-agent-modes/dist/modes/interactive/components/scoped-models-selector.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/scoped-models-selector.js +0 -267
- package/packages/gsd-agent-modes/dist/modes/interactive/components/scoped-models-selector.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/session-selector-search.d.ts +0 -21
- package/packages/gsd-agent-modes/dist/modes/interactive/components/session-selector-search.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/session-selector-search.js +0 -155
- package/packages/gsd-agent-modes/dist/modes/interactive/components/session-selector-search.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/session-selector.d.ts +0 -97
- package/packages/gsd-agent-modes/dist/modes/interactive/components/session-selector.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/session-selector.js +0 -810
- package/packages/gsd-agent-modes/dist/modes/interactive/components/session-selector.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/settings-selector.d.ts +0 -71
- package/packages/gsd-agent-modes/dist/modes/interactive/components/settings-selector.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/settings-selector.js +0 -320
- package/packages/gsd-agent-modes/dist/modes/interactive/components/settings-selector.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/show-images-selector.d.ts +0 -10
- package/packages/gsd-agent-modes/dist/modes/interactive/components/show-images-selector.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/show-images-selector.js +0 -34
- package/packages/gsd-agent-modes/dist/modes/interactive/components/show-images-selector.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/skill-invocation-message.d.ts +0 -17
- package/packages/gsd-agent-modes/dist/modes/interactive/components/skill-invocation-message.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/skill-invocation-message.js +0 -46
- package/packages/gsd-agent-modes/dist/modes/interactive/components/skill-invocation-message.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/theme-selector.d.ts +0 -11
- package/packages/gsd-agent-modes/dist/modes/interactive/components/theme-selector.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/theme-selector.js +0 -45
- package/packages/gsd-agent-modes/dist/modes/interactive/components/theme-selector.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/thinking-selector.d.ts +0 -11
- package/packages/gsd-agent-modes/dist/modes/interactive/components/thinking-selector.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/thinking-selector.js +0 -46
- package/packages/gsd-agent-modes/dist/modes/interactive/components/thinking-selector.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/timestamp.d.ts +0 -15
- package/packages/gsd-agent-modes/dist/modes/interactive/components/timestamp.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/timestamp.js +0 -40
- package/packages/gsd-agent-modes/dist/modes/interactive/components/timestamp.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/tool-execution.d.ts +0 -111
- package/packages/gsd-agent-modes/dist/modes/interactive/components/tool-execution.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/tool-execution.js +0 -984
- package/packages/gsd-agent-modes/dist/modes/interactive/components/tool-execution.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/tree-render-utils.d.ts +0 -44
- package/packages/gsd-agent-modes/dist/modes/interactive/components/tree-render-utils.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/tree-render-utils.js +0 -61
- package/packages/gsd-agent-modes/dist/modes/interactive/components/tree-render-utils.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/tree-selector.d.ts +0 -109
- package/packages/gsd-agent-modes/dist/modes/interactive/components/tree-selector.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/tree-selector.js +0 -1035
- package/packages/gsd-agent-modes/dist/modes/interactive/components/tree-selector.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message-selector.d.ts +0 -30
- package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message-selector.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message-selector.js +0 -112
- package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message-selector.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message.d.ts +0 -12
- package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message.js +0 -38
- package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/visual-truncate.d.ts +0 -24
- package/packages/gsd-agent-modes/dist/modes/interactive/components/visual-truncate.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/visual-truncate.js +0 -33
- package/packages/gsd-agent-modes/dist/modes/interactive/components/visual-truncate.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.d.ts +0 -27
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.js +0 -793
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/extension-ui-controller.d.ts +0 -4
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/extension-ui-controller.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/extension-ui-controller.js +0 -62
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/extension-ui-controller.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/input-controller.d.ts +0 -22
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/input-controller.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/input-controller.js +0 -118
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/input-controller.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/model-controller.d.ts +0 -7
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/model-controller.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/model-controller.js +0 -68
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/model-controller.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-state.d.ts +0 -50
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-state.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-state.js +0 -2
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-state.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode.d.ts +0 -358
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode.js +0 -3409
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/slash-command-handlers.d.ts +0 -77
- package/packages/gsd-agent-modes/dist/modes/interactive/slash-command-handlers.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/slash-command-handlers.js +0 -529
- package/packages/gsd-agent-modes/dist/modes/interactive/slash-command-handlers.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/utils/shorten-path.d.ts +0 -6
- package/packages/gsd-agent-modes/dist/modes/interactive/utils/shorten-path.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/utils/shorten-path.js +0 -15
- package/packages/gsd-agent-modes/dist/modes/interactive/utils/shorten-path.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/print-mode.d.ts +0 -28
- package/packages/gsd-agent-modes/dist/modes/print-mode.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/print-mode.js +0 -84
- package/packages/gsd-agent-modes/dist/modes/print-mode.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/rpc/jsonl.d.ts +0 -17
- package/packages/gsd-agent-modes/dist/modes/rpc/jsonl.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/rpc/jsonl.js +0 -49
- package/packages/gsd-agent-modes/dist/modes/rpc/jsonl.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/rpc/remote-terminal.d.ts +0 -37
- package/packages/gsd-agent-modes/dist/modes/rpc/remote-terminal.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/rpc/remote-terminal.js +0 -84
- package/packages/gsd-agent-modes/dist/modes/rpc/remote-terminal.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/rpc/rpc-client.d.ts +0 -243
- package/packages/gsd-agent-modes/dist/modes/rpc/rpc-client.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/rpc/rpc-client.js +0 -464
- package/packages/gsd-agent-modes/dist/modes/rpc/rpc-client.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/rpc/rpc-mode.d.ts +0 -25
- package/packages/gsd-agent-modes/dist/modes/rpc/rpc-mode.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/rpc/rpc-mode.js +0 -750
- package/packages/gsd-agent-modes/dist/modes/rpc/rpc-mode.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/rpc/rpc-types.d.ts +0 -511
- package/packages/gsd-agent-modes/dist/modes/rpc/rpc-types.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/rpc/rpc-types.js +0 -8
- package/packages/gsd-agent-modes/dist/modes/rpc/rpc-types.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/shared/command-context-actions.d.ts +0 -19
- package/packages/gsd-agent-modes/dist/modes/shared/command-context-actions.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/shared/command-context-actions.js +0 -45
- package/packages/gsd-agent-modes/dist/modes/shared/command-context-actions.js.map +0 -1
- package/packages/gsd-agent-modes/dist/pi-coding-agent-compat.d.ts +0 -22
- package/packages/gsd-agent-modes/dist/pi-coding-agent-compat.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/pi-coding-agent-compat.js +0 -21
- package/packages/gsd-agent-modes/dist/pi-coding-agent-compat.js.map +0 -1
- package/packages/gsd-agent-modes/dist/pi-tui-compat.d.ts +0 -4
- package/packages/gsd-agent-modes/dist/pi-tui-compat.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/pi-tui-compat.js +0 -3
- package/packages/gsd-agent-modes/dist/pi-tui-compat.js.map +0 -1
- package/packages/gsd-agent-modes/dist/theme.d.ts +0 -15
- package/packages/gsd-agent-modes/dist/theme.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/theme.js +0 -23
- package/packages/gsd-agent-modes/dist/theme.js.map +0 -1
- package/packages/gsd-agent-modes/dist/utils/theme.d.ts +0 -16
- package/packages/gsd-agent-modes/dist/utils/theme.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/utils/theme.js +0 -11
- package/packages/gsd-agent-modes/dist/utils/theme.js.map +0 -1
- package/packages/gsd-agent-modes/package.json +0 -23
- package/packages/gsd-agent-modes/src/cli/args.ts +0 -350
- package/packages/gsd-agent-modes/src/cli/config-selector.ts +0 -54
- package/packages/gsd-agent-modes/src/cli/file-processor.ts +0 -107
- package/packages/gsd-agent-modes/src/cli/list-models.ts +0 -141
- package/packages/gsd-agent-modes/src/cli/session-picker.ts +0 -59
- package/packages/gsd-agent-modes/src/index.ts +0 -6
- package/packages/gsd-agent-modes/src/main.ts +0 -614
- package/packages/gsd-agent-modes/src/modes/interactive/components/__tests__/login-dialog.test.ts +0 -24
- package/packages/gsd-agent-modes/src/modes/interactive/components/__tests__/provider-display-name.test.ts +0 -18
- package/packages/gsd-agent-modes/src/modes/interactive/components/__tests__/timestamp.test.ts +0 -38
- package/packages/gsd-agent-modes/src/modes/interactive/components/__tests__/tool-execution.test.ts +0 -171
- package/packages/gsd-agent-modes/src/modes/interactive/components/armin.ts +0 -382
- package/packages/gsd-agent-modes/src/modes/interactive/components/assistant-message.ts +0 -178
- package/packages/gsd-agent-modes/src/modes/interactive/components/bash-execution.ts +0 -212
- package/packages/gsd-agent-modes/src/modes/interactive/components/bordered-loader.ts +0 -66
- package/packages/gsd-agent-modes/src/modes/interactive/components/branch-summary-message.ts +0 -59
- package/packages/gsd-agent-modes/src/modes/interactive/components/chat-frame.ts +0 -67
- package/packages/gsd-agent-modes/src/modes/interactive/components/compaction-summary-message.ts +0 -60
- package/packages/gsd-agent-modes/src/modes/interactive/components/config-selector.ts +0 -597
- package/packages/gsd-agent-modes/src/modes/interactive/components/countdown-timer.ts +0 -41
- package/packages/gsd-agent-modes/src/modes/interactive/components/custom-editor.ts +0 -88
- package/packages/gsd-agent-modes/src/modes/interactive/components/custom-message.ts +0 -100
- package/packages/gsd-agent-modes/src/modes/interactive/components/daxnuts.ts +0 -165
- package/packages/gsd-agent-modes/src/modes/interactive/components/diff.ts +0 -147
- package/packages/gsd-agent-modes/src/modes/interactive/components/dynamic-border.test.ts +0 -73
- package/packages/gsd-agent-modes/src/modes/interactive/components/dynamic-border.ts +0 -89
- package/packages/gsd-agent-modes/src/modes/interactive/components/extension-editor.ts +0 -151
- package/packages/gsd-agent-modes/src/modes/interactive/components/extension-input.ts +0 -100
- package/packages/gsd-agent-modes/src/modes/interactive/components/extension-selector.ts +0 -156
- package/packages/gsd-agent-modes/src/modes/interactive/components/footer.ts +0 -257
- package/packages/gsd-agent-modes/src/modes/interactive/components/index.ts +0 -35
- package/packages/gsd-agent-modes/src/modes/interactive/components/keybinding-hints.ts +0 -84
- package/packages/gsd-agent-modes/src/modes/interactive/components/login-dialog.ts +0 -257
- package/packages/gsd-agent-modes/src/modes/interactive/components/model-selector.ts +0 -656
- package/packages/gsd-agent-modes/src/modes/interactive/components/oauth-selector.ts +0 -122
- package/packages/gsd-agent-modes/src/modes/interactive/components/provider-manager.ts +0 -210
- package/packages/gsd-agent-modes/src/modes/interactive/components/scoped-models-selector.ts +0 -342
- package/packages/gsd-agent-modes/src/modes/interactive/components/session-selector-search.ts +0 -194
- package/packages/gsd-agent-modes/src/modes/interactive/components/session-selector.ts +0 -1011
- package/packages/gsd-agent-modes/src/modes/interactive/components/settings-selector.ts +0 -452
- package/packages/gsd-agent-modes/src/modes/interactive/components/show-images-selector.ts +0 -45
- package/packages/gsd-agent-modes/src/modes/interactive/components/skill-invocation-message.ts +0 -56
- package/packages/gsd-agent-modes/src/modes/interactive/components/theme-selector.ts +0 -63
- package/packages/gsd-agent-modes/src/modes/interactive/components/thinking-selector.ts +0 -64
- package/packages/gsd-agent-modes/src/modes/interactive/components/timestamp.ts +0 -48
- package/packages/gsd-agent-modes/src/modes/interactive/components/tool-execution.ts +0 -1157
- package/packages/gsd-agent-modes/src/modes/interactive/components/tree-render-utils.ts +0 -81
- package/packages/gsd-agent-modes/src/modes/interactive/components/tree-selector.ts +0 -1208
- package/packages/gsd-agent-modes/src/modes/interactive/components/user-message-selector.ts +0 -145
- package/packages/gsd-agent-modes/src/modes/interactive/components/user-message.ts +0 -44
- package/packages/gsd-agent-modes/src/modes/interactive/components/visual-truncate.ts +0 -50
- package/packages/gsd-agent-modes/src/modes/interactive/controllers/chat-controller-ordering.test.ts +0 -1430
- package/packages/gsd-agent-modes/src/modes/interactive/controllers/chat-controller.test.ts +0 -71
- package/packages/gsd-agent-modes/src/modes/interactive/controllers/chat-controller.ts +0 -957
- package/packages/gsd-agent-modes/src/modes/interactive/controllers/extension-ui-controller.ts +0 -63
- package/packages/gsd-agent-modes/src/modes/interactive/controllers/input-controller.test.ts +0 -183
- package/packages/gsd-agent-modes/src/modes/interactive/controllers/input-controller.ts +0 -140
- package/packages/gsd-agent-modes/src/modes/interactive/controllers/model-controller.ts +0 -77
- package/packages/gsd-agent-modes/src/modes/interactive/interactive-mode-ordering.test.ts +0 -44
- package/packages/gsd-agent-modes/src/modes/interactive/interactive-mode-state.ts +0 -49
- package/packages/gsd-agent-modes/src/modes/interactive/interactive-mode.ts +0 -4195
- package/packages/gsd-agent-modes/src/modes/interactive/slash-command-handlers.ts +0 -670
- package/packages/gsd-agent-modes/src/modes/interactive/utils/shorten-path.ts +0 -14
- package/packages/gsd-agent-modes/src/modes/print-mode.ts +0 -106
- package/packages/gsd-agent-modes/src/modes/rpc/jsonl.ts +0 -58
- package/packages/gsd-agent-modes/src/modes/rpc/remote-terminal.ts +0 -109
- package/packages/gsd-agent-modes/src/modes/rpc/rpc-client.ts +0 -572
- package/packages/gsd-agent-modes/src/modes/rpc/rpc-mode.ts +0 -902
- package/packages/gsd-agent-modes/src/modes/rpc/rpc-protocol-v2.test.ts +0 -971
- package/packages/gsd-agent-modes/src/modes/rpc/rpc-types.ts +0 -335
- package/packages/gsd-agent-modes/src/modes/shared/command-context-actions.ts +0 -53
- package/packages/gsd-agent-modes/src/pi-coding-agent-compat.ts +0 -42
- package/packages/gsd-agent-modes/src/pi-tui-compat.ts +0 -4
- package/packages/gsd-agent-modes/src/theme.ts +0 -25
- package/packages/gsd-agent-modes/src/utils/theme.ts +0 -24
- package/packages/gsd-agent-modes/tsconfig.json +0 -28
- package/packages/gsd-agent-modes/tsconfig.tsbuildinfo +0 -1
- package/packages/gsd-agent-types/dist/index.d.ts +0 -176
- package/packages/gsd-agent-types/dist/index.d.ts.map +0 -1
- package/packages/gsd-agent-types/dist/index.js +0 -24
- package/packages/gsd-agent-types/dist/index.js.map +0 -1
- package/packages/gsd-agent-types/package.json +0 -24
- package/packages/gsd-agent-types/src/index.ts +0 -206
- package/packages/gsd-agent-types/tsconfig.json +0 -25
- package/packages/gsd-agent-types/tsconfig.tsbuildinfo +0 -1
- package/packages/native/dist/tsconfig.tsbuildinfo +0 -1
- package/src/resources/extensions/claude-code-cli/tests/provider-registration.test.ts +0 -27
- /package/dist/web/standalone/.next/static/{gy6_foLMsEzdGBT19c3hr → 5wbu35_C2_MQ3Jj1lEVDx}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{gy6_foLMsEzdGBT19c3hr → 5wbu35_C2_MQ3Jj1lEVDx}/_ssgManifest.js +0 -0
package/packages/gsd-agent-modes/src/modes/interactive/controllers/chat-controller-ordering.test.ts
DELETED
|
@@ -1,1430 +0,0 @@
|
|
|
1
|
-
import assert from "node:assert/strict";
|
|
2
|
-
import { test } from "node:test";
|
|
3
|
-
|
|
4
|
-
import { handleAgentEvent } from "./chat-controller.js";
|
|
5
|
-
|
|
6
|
-
function makeUsage() {
|
|
7
|
-
return {
|
|
8
|
-
input: 0,
|
|
9
|
-
output: 0,
|
|
10
|
-
cacheRead: 0,
|
|
11
|
-
cacheWrite: 0,
|
|
12
|
-
totalTokens: 0,
|
|
13
|
-
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function makeAssistant(content: any[]) {
|
|
18
|
-
return {
|
|
19
|
-
role: "assistant",
|
|
20
|
-
content,
|
|
21
|
-
api: "anthropic-messages",
|
|
22
|
-
provider: "claude-code",
|
|
23
|
-
model: "claude-sonnet-4",
|
|
24
|
-
usage: makeUsage(),
|
|
25
|
-
stopReason: "stop",
|
|
26
|
-
timestamp: Date.now(),
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function createHost() {
|
|
31
|
-
const chatContainer = {
|
|
32
|
-
children: [] as any[],
|
|
33
|
-
addChild(component: any) {
|
|
34
|
-
this.children.push(component);
|
|
35
|
-
},
|
|
36
|
-
removeChild(component: any) {
|
|
37
|
-
const idx = this.children.indexOf(component);
|
|
38
|
-
if (idx !== -1) this.children.splice(idx, 1);
|
|
39
|
-
},
|
|
40
|
-
clear() {
|
|
41
|
-
this.children = [];
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
const pinnedMessageContainer = {
|
|
46
|
-
children: [] as any[],
|
|
47
|
-
addChild(component: any) {
|
|
48
|
-
this.children.push(component);
|
|
49
|
-
},
|
|
50
|
-
removeChild(component: any) {
|
|
51
|
-
const idx = this.children.indexOf(component);
|
|
52
|
-
if (idx !== -1) this.children.splice(idx, 1);
|
|
53
|
-
},
|
|
54
|
-
clear() {
|
|
55
|
-
this.children = [];
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
const host: any = {
|
|
60
|
-
isInitialized: true,
|
|
61
|
-
init: async () => {},
|
|
62
|
-
defaultEditor: { onEscape: undefined },
|
|
63
|
-
editor: {},
|
|
64
|
-
session: { retryAttempt: 0, abortCompaction: () => {}, abortRetry: () => {} },
|
|
65
|
-
// rows:1 keeps the pinned-zone off-screen-threshold at its floor (1) so
|
|
66
|
-
// any rendered segment after a pinnable text block triggers the pin.
|
|
67
|
-
// Real terminals are larger; see chat-controller rowsRenderedAfterContentIndex.
|
|
68
|
-
ui: { requestRender: () => {}, terminal: { rows: 1, columns: 80 } },
|
|
69
|
-
footer: { invalidate: () => {} },
|
|
70
|
-
keybindings: {},
|
|
71
|
-
statusContainer: { clear: () => {}, addChild: () => {} },
|
|
72
|
-
chatContainer,
|
|
73
|
-
settingsManager: { getTimestampFormat: () => "date-time-iso", getShowImages: () => false },
|
|
74
|
-
pendingTools: new Map(),
|
|
75
|
-
toolOutputExpanded: false,
|
|
76
|
-
hideThinkingBlock: false,
|
|
77
|
-
isBashMode: false,
|
|
78
|
-
defaultWorkingMessage: "Working...",
|
|
79
|
-
compactionQueuedMessages: [],
|
|
80
|
-
editorContainer: {},
|
|
81
|
-
pendingMessagesContainer: { clear: () => {} },
|
|
82
|
-
pinnedMessageContainer,
|
|
83
|
-
addMessageToChat: () => {},
|
|
84
|
-
getMarkdownThemeWithSettings: () => ({}),
|
|
85
|
-
formatWebSearchResult: () => "",
|
|
86
|
-
getRegisteredToolDefinition: () => undefined,
|
|
87
|
-
checkShutdownRequested: async () => {},
|
|
88
|
-
rebuildChatFromMessages: () => {},
|
|
89
|
-
flushCompactionQueue: async () => {},
|
|
90
|
-
showStatus: () => {},
|
|
91
|
-
showError: () => {},
|
|
92
|
-
updatePendingMessagesDisplay: () => {},
|
|
93
|
-
updateTerminalTitle: () => {},
|
|
94
|
-
updateEditorBorderColor: () => {},
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
return host;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
test("chat-controller renders content blocks in content[] index order (tool-first stream)", async () => {
|
|
101
|
-
// ToolExecutionComponent uses the global theme singleton.
|
|
102
|
-
// Install a minimal no-op theme implementation for this unit test.
|
|
103
|
-
(globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
|
|
104
|
-
fg: (_key: string, text: string) => text,
|
|
105
|
-
bg: (_key: string, text: string) => text,
|
|
106
|
-
bold: (text: string) => text,
|
|
107
|
-
italic: (text: string) => text,
|
|
108
|
-
truncate: (text: string) => text,
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
const host = createHost();
|
|
112
|
-
const toolId = "mcp-tool-1";
|
|
113
|
-
const toolCall = {
|
|
114
|
-
type: "toolCall",
|
|
115
|
-
id: toolId,
|
|
116
|
-
name: "exec_command",
|
|
117
|
-
arguments: { cmd: "echo hi" },
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
await handleAgentEvent(host, { type: "message_start", message: makeAssistant([]) } as any);
|
|
121
|
-
|
|
122
|
-
assert.equal(host.chatContainer.children.length, 0, "nothing should render before content arrives");
|
|
123
|
-
|
|
124
|
-
await handleAgentEvent(
|
|
125
|
-
host,
|
|
126
|
-
{
|
|
127
|
-
type: "message_update",
|
|
128
|
-
message: makeAssistant([toolCall]),
|
|
129
|
-
assistantMessageEvent: {
|
|
130
|
-
type: "toolcall_end",
|
|
131
|
-
contentIndex: 0,
|
|
132
|
-
toolCall: {
|
|
133
|
-
...toolCall,
|
|
134
|
-
externalResult: {
|
|
135
|
-
content: [{ type: "text", text: "tool output" }],
|
|
136
|
-
details: {},
|
|
137
|
-
isError: false,
|
|
138
|
-
},
|
|
139
|
-
},
|
|
140
|
-
partial: makeAssistant([toolCall]),
|
|
141
|
-
},
|
|
142
|
-
} as any,
|
|
143
|
-
);
|
|
144
|
-
|
|
145
|
-
// content[0] = toolCall → ToolExecutionComponent renders first
|
|
146
|
-
assert.equal(host.chatContainer.children.length, 1, "tool execution block should render immediately");
|
|
147
|
-
assert.equal(host.chatContainer.children[0]?.constructor?.name, "ToolExecutionComponent");
|
|
148
|
-
|
|
149
|
-
host.getMarkdownThemeWithSettings = () => ({});
|
|
150
|
-
|
|
151
|
-
await handleAgentEvent(
|
|
152
|
-
host,
|
|
153
|
-
{
|
|
154
|
-
type: "message_update",
|
|
155
|
-
message: makeAssistant([toolCall, { type: "text", text: "done" }]),
|
|
156
|
-
assistantMessageEvent: {
|
|
157
|
-
type: "text_delta",
|
|
158
|
-
contentIndex: 1,
|
|
159
|
-
delta: "done",
|
|
160
|
-
partial: makeAssistant([toolCall, { type: "text", text: "done" }]),
|
|
161
|
-
},
|
|
162
|
-
} as any,
|
|
163
|
-
);
|
|
164
|
-
|
|
165
|
-
// content[0]=toolCall, content[1]=text → order: tool, then text
|
|
166
|
-
assert.equal(host.chatContainer.children.length, 2, "text run should render after tool in content[] order");
|
|
167
|
-
assert.equal(host.chatContainer.children[0]?.constructor?.name, "ToolExecutionComponent");
|
|
168
|
-
assert.equal(host.chatContainer.children[1]?.constructor?.name, "AssistantMessageComponent");
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
test("chat-controller renders serverToolUse before trailing text matching content[] index order", async () => {
|
|
172
|
-
(globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
|
|
173
|
-
fg: (_key: string, text: string) => text,
|
|
174
|
-
bg: (_key: string, text: string) => text,
|
|
175
|
-
bold: (text: string) => text,
|
|
176
|
-
italic: (text: string) => text,
|
|
177
|
-
truncate: (text: string) => text,
|
|
178
|
-
};
|
|
179
|
-
|
|
180
|
-
const host = createHost();
|
|
181
|
-
const toolId = "mcp-secure-1";
|
|
182
|
-
const serverToolUse = {
|
|
183
|
-
type: "serverToolUse",
|
|
184
|
-
id: toolId,
|
|
185
|
-
name: "mcp__gsd-workflow__secure_env_collect",
|
|
186
|
-
input: { projectDir: "/tmp/project", keys: [{ key: "SECURE_PASSWORD" }], destination: "dotenv" },
|
|
187
|
-
};
|
|
188
|
-
|
|
189
|
-
await handleAgentEvent(host, { type: "message_start", message: makeAssistant([]) } as any);
|
|
190
|
-
|
|
191
|
-
await handleAgentEvent(
|
|
192
|
-
host,
|
|
193
|
-
{
|
|
194
|
-
type: "message_update",
|
|
195
|
-
message: makeAssistant([serverToolUse]),
|
|
196
|
-
assistantMessageEvent: {
|
|
197
|
-
type: "server_tool_use",
|
|
198
|
-
contentIndex: 0,
|
|
199
|
-
partial: makeAssistant([serverToolUse]),
|
|
200
|
-
},
|
|
201
|
-
} as any,
|
|
202
|
-
);
|
|
203
|
-
|
|
204
|
-
// content[0] = serverToolUse → ToolExecutionComponent renders first
|
|
205
|
-
assert.equal(host.chatContainer.children.length, 1, "server tool block should render immediately");
|
|
206
|
-
assert.equal(host.chatContainer.children[0]?.constructor?.name, "ToolExecutionComponent");
|
|
207
|
-
|
|
208
|
-
host.getMarkdownThemeWithSettings = () => ({});
|
|
209
|
-
const resultMessage = makeAssistant([
|
|
210
|
-
{
|
|
211
|
-
...serverToolUse,
|
|
212
|
-
externalResult: {
|
|
213
|
-
content: [{ type: "text", text: "secure_env_collect was cancelled by user." }],
|
|
214
|
-
details: {},
|
|
215
|
-
isError: true,
|
|
216
|
-
},
|
|
217
|
-
},
|
|
218
|
-
{ type: "text", text: "The secure password collection was cancelled." },
|
|
219
|
-
]);
|
|
220
|
-
|
|
221
|
-
await handleAgentEvent(
|
|
222
|
-
host,
|
|
223
|
-
{
|
|
224
|
-
type: "message_update",
|
|
225
|
-
message: resultMessage,
|
|
226
|
-
assistantMessageEvent: {
|
|
227
|
-
type: "server_tool_use",
|
|
228
|
-
contentIndex: 0,
|
|
229
|
-
partial: resultMessage,
|
|
230
|
-
},
|
|
231
|
-
} as any,
|
|
232
|
-
);
|
|
233
|
-
|
|
234
|
-
// content[0]=serverToolUse, content[1]=text → order: tool, then text
|
|
235
|
-
assert.equal(host.chatContainer.children.length, 2, "text run should render after server tool in content[] order");
|
|
236
|
-
assert.equal(host.chatContainer.children[0]?.constructor?.name, "ToolExecutionComponent");
|
|
237
|
-
assert.equal(host.chatContainer.children[1]?.constructor?.name, "AssistantMessageComponent");
|
|
238
|
-
});
|
|
239
|
-
|
|
240
|
-
test("chat-controller replays final message_end content when result adds unstreamed trailing text", async () => {
|
|
241
|
-
(globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
|
|
242
|
-
fg: (_key: string, text: string) => text,
|
|
243
|
-
bg: (_key: string, text: string) => text,
|
|
244
|
-
bold: (text: string) => text,
|
|
245
|
-
italic: (text: string) => text,
|
|
246
|
-
truncate: (text: string) => text,
|
|
247
|
-
};
|
|
248
|
-
|
|
249
|
-
const host = createHost();
|
|
250
|
-
host.getMarkdownThemeWithSettings = () => ({});
|
|
251
|
-
|
|
252
|
-
const tool = {
|
|
253
|
-
type: "toolCall",
|
|
254
|
-
id: "mcp-end-replay-1",
|
|
255
|
-
name: "read",
|
|
256
|
-
mcpServer: "filesystem",
|
|
257
|
-
arguments: { filePath: "/tmp/demo.txt" },
|
|
258
|
-
};
|
|
259
|
-
|
|
260
|
-
await handleAgentEvent(host, { type: "message_start", message: makeAssistant([]) } as any);
|
|
261
|
-
|
|
262
|
-
const streamedContent = [
|
|
263
|
-
tool,
|
|
264
|
-
{ type: "thinking", thinking: "I am analyzing tool output..." },
|
|
265
|
-
];
|
|
266
|
-
await handleAgentEvent(
|
|
267
|
-
host,
|
|
268
|
-
{
|
|
269
|
-
type: "message_update",
|
|
270
|
-
message: makeAssistant(streamedContent),
|
|
271
|
-
assistantMessageEvent: {
|
|
272
|
-
type: "thinking_delta",
|
|
273
|
-
contentIndex: 1,
|
|
274
|
-
delta: "I am analyzing tool output...",
|
|
275
|
-
partial: makeAssistant(streamedContent),
|
|
276
|
-
},
|
|
277
|
-
} as any,
|
|
278
|
-
);
|
|
279
|
-
|
|
280
|
-
assert.equal(host.chatContainer.children.length, 2, "streaming shows tool + thinking only");
|
|
281
|
-
assert.equal(host.chatContainer.children[0]?.constructor?.name, "ToolExecutionComponent");
|
|
282
|
-
assert.equal(host.chatContainer.children[1]?.constructor?.name, "AssistantMessageComponent");
|
|
283
|
-
|
|
284
|
-
// Final payload includes trailing text that never arrived as message_update.
|
|
285
|
-
const finalContent = [
|
|
286
|
-
tool,
|
|
287
|
-
{ type: "thinking", thinking: "I am analyzing tool output..." },
|
|
288
|
-
{ type: "text", text: "Correct anything important I missed?" },
|
|
289
|
-
];
|
|
290
|
-
await handleAgentEvent(host, { type: "message_end", message: makeAssistant(finalContent) } as any);
|
|
291
|
-
|
|
292
|
-
assert.equal(host.chatContainer.children.length, 3, "message_end should replay and include trailing text segment");
|
|
293
|
-
assert.equal(host.chatContainer.children[0]?.constructor?.name, "ToolExecutionComponent");
|
|
294
|
-
assert.equal(host.chatContainer.children[1]?.constructor?.name, "AssistantMessageComponent");
|
|
295
|
-
assert.equal(host.chatContainer.children[2]?.constructor?.name, "AssistantMessageComponent");
|
|
296
|
-
});
|
|
297
|
-
|
|
298
|
-
test("chat-controller keeps pre-tool prose visible until post-tool prose arrives, then prunes it", async () => {
|
|
299
|
-
(globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
|
|
300
|
-
fg: (_key: string, text: string) => text,
|
|
301
|
-
bg: (_key: string, text: string) => text,
|
|
302
|
-
bold: (text: string) => text,
|
|
303
|
-
italic: (text: string) => text,
|
|
304
|
-
truncate: (text: string) => text,
|
|
305
|
-
};
|
|
306
|
-
|
|
307
|
-
const host = createHost();
|
|
308
|
-
host.getMarkdownThemeWithSettings = () => ({});
|
|
309
|
-
|
|
310
|
-
const mcpTool = {
|
|
311
|
-
type: "toolCall",
|
|
312
|
-
id: "mcp-tool-1",
|
|
313
|
-
name: "read",
|
|
314
|
-
mcpServer: "filesystem",
|
|
315
|
-
arguments: { filePath: "/tmp/demo.txt" },
|
|
316
|
-
};
|
|
317
|
-
|
|
318
|
-
await handleAgentEvent(host, { type: "message_start", message: makeAssistant([]) } as any);
|
|
319
|
-
|
|
320
|
-
// Provisional assistant text arrives first.
|
|
321
|
-
await handleAgentEvent(
|
|
322
|
-
host,
|
|
323
|
-
{
|
|
324
|
-
type: "message_update",
|
|
325
|
-
message: makeAssistant([{ type: "text", text: "Let me inspect the workspace first." }]),
|
|
326
|
-
assistantMessageEvent: {
|
|
327
|
-
type: "text_delta",
|
|
328
|
-
contentIndex: 0,
|
|
329
|
-
delta: "Let me inspect the workspace first.",
|
|
330
|
-
partial: makeAssistant([{ type: "text", text: "Let me inspect the workspace first." }]),
|
|
331
|
-
},
|
|
332
|
-
} as any,
|
|
333
|
-
);
|
|
334
|
-
assert.equal(host.chatContainer.children.length, 1);
|
|
335
|
-
assert.equal(host.chatContainer.children[0]?.constructor?.name, "AssistantMessageComponent");
|
|
336
|
-
|
|
337
|
-
// MCP tool appears; provisional text should remain visible until post-tool prose exists.
|
|
338
|
-
await handleAgentEvent(
|
|
339
|
-
host,
|
|
340
|
-
{
|
|
341
|
-
type: "message_update",
|
|
342
|
-
message: makeAssistant([{ type: "text", text: "Let me inspect the workspace first." }, mcpTool]),
|
|
343
|
-
assistantMessageEvent: {
|
|
344
|
-
type: "toolcall_end",
|
|
345
|
-
contentIndex: 1,
|
|
346
|
-
toolCall: {
|
|
347
|
-
...mcpTool,
|
|
348
|
-
externalResult: {
|
|
349
|
-
content: [{ type: "text", text: "file preview" }],
|
|
350
|
-
details: {},
|
|
351
|
-
isError: false,
|
|
352
|
-
},
|
|
353
|
-
},
|
|
354
|
-
partial: makeAssistant([{ type: "text", text: "Let me inspect the workspace first." }, mcpTool]),
|
|
355
|
-
},
|
|
356
|
-
} as any,
|
|
357
|
-
);
|
|
358
|
-
assert.equal(host.chatContainer.children.length, 2, "pre-tool prose should remain during tool-only window");
|
|
359
|
-
assert.equal(host.chatContainer.children[0]?.constructor?.name, "AssistantMessageComponent");
|
|
360
|
-
assert.equal(host.chatContainer.children[1]?.constructor?.name, "ToolExecutionComponent");
|
|
361
|
-
|
|
362
|
-
// Post-tool prose arrives: pre-tool prose should now be pruned.
|
|
363
|
-
const finalContent = [
|
|
364
|
-
{ type: "text", text: "Let me inspect the workspace first." },
|
|
365
|
-
mcpTool,
|
|
366
|
-
{ type: "text", text: "Which missing feature matters most to you?" },
|
|
367
|
-
];
|
|
368
|
-
await handleAgentEvent(
|
|
369
|
-
host,
|
|
370
|
-
{
|
|
371
|
-
type: "message_update",
|
|
372
|
-
message: makeAssistant(finalContent),
|
|
373
|
-
assistantMessageEvent: {
|
|
374
|
-
type: "text_delta",
|
|
375
|
-
contentIndex: 2,
|
|
376
|
-
delta: "Which missing feature matters most to you?",
|
|
377
|
-
partial: makeAssistant(finalContent),
|
|
378
|
-
},
|
|
379
|
-
} as any,
|
|
380
|
-
);
|
|
381
|
-
assert.equal(host.chatContainer.children.length, 2);
|
|
382
|
-
assert.equal(host.chatContainer.children[0]?.constructor?.name, "ToolExecutionComponent");
|
|
383
|
-
assert.equal(host.chatContainer.children[1]?.constructor?.name, "AssistantMessageComponent");
|
|
384
|
-
|
|
385
|
-
// Finalize to tear down any pinned spinner state.
|
|
386
|
-
await handleAgentEvent(host, { type: "message_end", message: makeAssistant(finalContent) } as any);
|
|
387
|
-
});
|
|
388
|
-
|
|
389
|
-
test("chat-controller keeps pre-tool thinking visible for claude-code MCP turns without post-tool prose", async () => {
|
|
390
|
-
(globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
|
|
391
|
-
fg: (_key: string, text: string) => text,
|
|
392
|
-
bg: (_key: string, text: string) => text,
|
|
393
|
-
bold: (text: string) => text,
|
|
394
|
-
italic: (text: string) => text,
|
|
395
|
-
truncate: (text: string) => text,
|
|
396
|
-
};
|
|
397
|
-
|
|
398
|
-
const host = createHost();
|
|
399
|
-
host.getMarkdownThemeWithSettings = () => ({});
|
|
400
|
-
|
|
401
|
-
const mcpTool = {
|
|
402
|
-
type: "toolCall",
|
|
403
|
-
id: "mcp-tool-thinking-1",
|
|
404
|
-
name: "read",
|
|
405
|
-
mcpServer: "filesystem",
|
|
406
|
-
arguments: { filePath: "/tmp/demo.txt" },
|
|
407
|
-
};
|
|
408
|
-
|
|
409
|
-
await handleAgentEvent(host, { type: "message_start", message: makeAssistant([]) } as any);
|
|
410
|
-
|
|
411
|
-
const thinkingOnly = [{ type: "thinking", thinking: "I should inspect the workspace." }];
|
|
412
|
-
await handleAgentEvent(
|
|
413
|
-
host,
|
|
414
|
-
{
|
|
415
|
-
type: "message_update",
|
|
416
|
-
message: makeAssistant(thinkingOnly),
|
|
417
|
-
assistantMessageEvent: {
|
|
418
|
-
type: "thinking_delta",
|
|
419
|
-
contentIndex: 0,
|
|
420
|
-
delta: "I should inspect the workspace.",
|
|
421
|
-
partial: makeAssistant(thinkingOnly),
|
|
422
|
-
},
|
|
423
|
-
} as any,
|
|
424
|
-
);
|
|
425
|
-
assert.equal(host.chatContainer.children.length, 1);
|
|
426
|
-
assert.equal(host.chatContainer.children[0]?.constructor?.name, "AssistantMessageComponent");
|
|
427
|
-
|
|
428
|
-
await handleAgentEvent(
|
|
429
|
-
host,
|
|
430
|
-
{
|
|
431
|
-
type: "message_update",
|
|
432
|
-
message: makeAssistant([thinkingOnly[0], mcpTool]),
|
|
433
|
-
assistantMessageEvent: {
|
|
434
|
-
type: "toolcall_end",
|
|
435
|
-
contentIndex: 1,
|
|
436
|
-
toolCall: {
|
|
437
|
-
...mcpTool,
|
|
438
|
-
externalResult: {
|
|
439
|
-
content: [{ type: "text", text: "file preview" }],
|
|
440
|
-
details: {},
|
|
441
|
-
isError: false,
|
|
442
|
-
},
|
|
443
|
-
},
|
|
444
|
-
partial: makeAssistant([thinkingOnly[0], mcpTool]),
|
|
445
|
-
},
|
|
446
|
-
} as any,
|
|
447
|
-
);
|
|
448
|
-
|
|
449
|
-
assert.equal(host.chatContainer.children.length, 2, "thinking should remain visible while only tool output is present");
|
|
450
|
-
assert.equal(host.chatContainer.children[0]?.constructor?.name, "AssistantMessageComponent");
|
|
451
|
-
assert.equal(host.chatContainer.children[1]?.constructor?.name, "ToolExecutionComponent");
|
|
452
|
-
|
|
453
|
-
await handleAgentEvent(host, { type: "message_end", message: makeAssistant([thinkingOnly[0], mcpTool]) } as any);
|
|
454
|
-
});
|
|
455
|
-
|
|
456
|
-
test("chat-controller keeps pre-tool question text for claude-code MCP when post-tool prose exists", async () => {
|
|
457
|
-
(globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
|
|
458
|
-
fg: (_key: string, text: string) => text,
|
|
459
|
-
bg: (_key: string, text: string) => text,
|
|
460
|
-
bold: (text: string) => text,
|
|
461
|
-
italic: (text: string) => text,
|
|
462
|
-
truncate: (text: string) => text,
|
|
463
|
-
};
|
|
464
|
-
|
|
465
|
-
const host = createHost();
|
|
466
|
-
host.getMarkdownThemeWithSettings = () => ({});
|
|
467
|
-
|
|
468
|
-
const mcpTool = {
|
|
469
|
-
type: "toolCall",
|
|
470
|
-
id: "mcp-tool-question-1",
|
|
471
|
-
name: "glob",
|
|
472
|
-
mcpServer: "filesystem",
|
|
473
|
-
arguments: { pattern: "**/*" },
|
|
474
|
-
};
|
|
475
|
-
|
|
476
|
-
await handleAgentEvent(host, { type: "message_start", message: makeAssistant([]) } as any);
|
|
477
|
-
|
|
478
|
-
const questionText = { type: "text", text: "Which file should I inspect?" };
|
|
479
|
-
|
|
480
|
-
await handleAgentEvent(
|
|
481
|
-
host,
|
|
482
|
-
{
|
|
483
|
-
type: "message_update",
|
|
484
|
-
message: makeAssistant([questionText]),
|
|
485
|
-
assistantMessageEvent: {
|
|
486
|
-
type: "text_delta",
|
|
487
|
-
contentIndex: 0,
|
|
488
|
-
delta: questionText.text,
|
|
489
|
-
partial: makeAssistant([questionText]),
|
|
490
|
-
},
|
|
491
|
-
} as any,
|
|
492
|
-
);
|
|
493
|
-
|
|
494
|
-
await handleAgentEvent(
|
|
495
|
-
host,
|
|
496
|
-
{
|
|
497
|
-
type: "message_update",
|
|
498
|
-
message: makeAssistant([questionText, mcpTool]),
|
|
499
|
-
assistantMessageEvent: {
|
|
500
|
-
type: "toolcall_end",
|
|
501
|
-
contentIndex: 1,
|
|
502
|
-
toolCall: {
|
|
503
|
-
...mcpTool,
|
|
504
|
-
externalResult: {
|
|
505
|
-
content: [{ type: "text", text: "glob output" }],
|
|
506
|
-
details: {},
|
|
507
|
-
isError: false,
|
|
508
|
-
},
|
|
509
|
-
},
|
|
510
|
-
partial: makeAssistant([questionText, mcpTool]),
|
|
511
|
-
},
|
|
512
|
-
} as any,
|
|
513
|
-
);
|
|
514
|
-
|
|
515
|
-
const postTool = { type: "text", text: "I'll review that next." };
|
|
516
|
-
const finalContent = [questionText, mcpTool, postTool];
|
|
517
|
-
await handleAgentEvent(
|
|
518
|
-
host,
|
|
519
|
-
{
|
|
520
|
-
type: "message_update",
|
|
521
|
-
message: makeAssistant(finalContent),
|
|
522
|
-
assistantMessageEvent: {
|
|
523
|
-
type: "text_delta",
|
|
524
|
-
contentIndex: 2,
|
|
525
|
-
delta: postTool.text,
|
|
526
|
-
partial: makeAssistant(finalContent),
|
|
527
|
-
},
|
|
528
|
-
} as any,
|
|
529
|
-
);
|
|
530
|
-
|
|
531
|
-
assert.equal(host.chatContainer.children.length, 3, "question text should remain alongside MCP tool and post-tool prose");
|
|
532
|
-
assert.equal(host.chatContainer.children[0]?.constructor?.name, "AssistantMessageComponent", "pre-tool question stays visible");
|
|
533
|
-
assert.equal(host.chatContainer.children[1]?.constructor?.name, "ToolExecutionComponent", "tool renders in the middle");
|
|
534
|
-
assert.equal(host.chatContainer.children[2]?.constructor?.name, "AssistantMessageComponent", "post-tool prose renders last");
|
|
535
|
-
|
|
536
|
-
await handleAgentEvent(host, { type: "message_end", message: makeAssistant(finalContent) } as any);
|
|
537
|
-
});
|
|
538
|
-
|
|
539
|
-
test("chat-controller prunes orphaned provisional text after claude-code sub-turn shrink when MCP tools appear", async () => {
|
|
540
|
-
(globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
|
|
541
|
-
fg: (_key: string, text: string) => text,
|
|
542
|
-
bg: (_key: string, text: string) => text,
|
|
543
|
-
bold: (text: string) => text,
|
|
544
|
-
italic: (text: string) => text,
|
|
545
|
-
truncate: (text: string) => text,
|
|
546
|
-
};
|
|
547
|
-
|
|
548
|
-
const host = createHost();
|
|
549
|
-
host.getMarkdownThemeWithSettings = () => ({});
|
|
550
|
-
|
|
551
|
-
const mcpTool = {
|
|
552
|
-
type: "toolCall",
|
|
553
|
-
id: "mcp-tool-shrink-1",
|
|
554
|
-
name: "glob",
|
|
555
|
-
mcpServer: "filesystem",
|
|
556
|
-
arguments: { pattern: "**/*" },
|
|
557
|
-
};
|
|
558
|
-
|
|
559
|
-
await handleAgentEvent(host, { type: "message_start", message: makeAssistant([]) } as any);
|
|
560
|
-
|
|
561
|
-
// Sub-turn 1: generate longer provisional text content.
|
|
562
|
-
await handleAgentEvent(
|
|
563
|
-
host,
|
|
564
|
-
{
|
|
565
|
-
type: "message_update",
|
|
566
|
-
message: makeAssistant([{ type: "text", text: "Old provisional preface." }, { type: "text", text: "More old text." }]),
|
|
567
|
-
assistantMessageEvent: {
|
|
568
|
-
type: "text_delta",
|
|
569
|
-
contentIndex: 1,
|
|
570
|
-
delta: "More old text.",
|
|
571
|
-
partial: makeAssistant([{ type: "text", text: "Old provisional preface." }, { type: "text", text: "More old text." }]),
|
|
572
|
-
},
|
|
573
|
-
} as any,
|
|
574
|
-
);
|
|
575
|
-
assert.equal(host.chatContainer.children.length, 1, "first sub-turn text run should render");
|
|
576
|
-
|
|
577
|
-
// Sub-turn 2 starts (content shrink): old component is orphaned by design.
|
|
578
|
-
await handleAgentEvent(
|
|
579
|
-
host,
|
|
580
|
-
{
|
|
581
|
-
type: "message_update",
|
|
582
|
-
message: makeAssistant([{ type: "text", text: "New provisional text before tool." }]),
|
|
583
|
-
assistantMessageEvent: {
|
|
584
|
-
type: "text_delta",
|
|
585
|
-
contentIndex: 0,
|
|
586
|
-
delta: "New provisional text before tool.",
|
|
587
|
-
partial: makeAssistant([{ type: "text", text: "New provisional text before tool." }]),
|
|
588
|
-
},
|
|
589
|
-
} as any,
|
|
590
|
-
);
|
|
591
|
-
assert.equal(host.chatContainer.children.length, 2, "shrink keeps prior text until MCP tool context appears");
|
|
592
|
-
|
|
593
|
-
// MCP tool appears in sub-turn 2: tool-only windows keep provisional prose visible.
|
|
594
|
-
await handleAgentEvent(
|
|
595
|
-
host,
|
|
596
|
-
{
|
|
597
|
-
type: "message_update",
|
|
598
|
-
message: makeAssistant([{ type: "text", text: "New provisional text before tool." }, mcpTool]),
|
|
599
|
-
assistantMessageEvent: {
|
|
600
|
-
type: "toolcall_end",
|
|
601
|
-
contentIndex: 1,
|
|
602
|
-
toolCall: {
|
|
603
|
-
...mcpTool,
|
|
604
|
-
externalResult: {
|
|
605
|
-
content: [{ type: "text", text: "glob output" }],
|
|
606
|
-
details: {},
|
|
607
|
-
isError: false,
|
|
608
|
-
},
|
|
609
|
-
},
|
|
610
|
-
partial: makeAssistant([{ type: "text", text: "New provisional text before tool." }, mcpTool]),
|
|
611
|
-
},
|
|
612
|
-
} as any,
|
|
613
|
-
);
|
|
614
|
-
assert.equal(host.chatContainer.children.length, 3, "stale text runs are deferred until post-tool prose arrives");
|
|
615
|
-
assert.equal(host.chatContainer.children[0]?.constructor?.name, "AssistantMessageComponent");
|
|
616
|
-
assert.equal(host.chatContainer.children[1]?.constructor?.name, "AssistantMessageComponent");
|
|
617
|
-
assert.equal(host.chatContainer.children[2]?.constructor?.name, "ToolExecutionComponent");
|
|
618
|
-
|
|
619
|
-
const finalContent = [mcpTool, { type: "text", text: "Final visible question?" }];
|
|
620
|
-
await handleAgentEvent(
|
|
621
|
-
host,
|
|
622
|
-
{
|
|
623
|
-
type: "message_update",
|
|
624
|
-
message: makeAssistant(finalContent),
|
|
625
|
-
assistantMessageEvent: {
|
|
626
|
-
type: "text_delta",
|
|
627
|
-
contentIndex: 1,
|
|
628
|
-
delta: "Final visible question?",
|
|
629
|
-
partial: makeAssistant(finalContent),
|
|
630
|
-
},
|
|
631
|
-
} as any,
|
|
632
|
-
);
|
|
633
|
-
assert.equal(host.chatContainer.children.length, 2);
|
|
634
|
-
assert.equal(host.chatContainer.children[0]?.constructor?.name, "ToolExecutionComponent");
|
|
635
|
-
assert.equal(host.chatContainer.children[1]?.constructor?.name, "AssistantMessageComponent");
|
|
636
|
-
|
|
637
|
-
await handleAgentEvent(host, { type: "message_end", message: makeAssistant(finalContent) } as any);
|
|
638
|
-
});
|
|
639
|
-
|
|
640
|
-
test("chat-controller prunes orphans from multiple sub-turn shrinks before MCP post-tool prose", async () => {
|
|
641
|
-
(globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
|
|
642
|
-
fg: (_key: string, text: string) => text,
|
|
643
|
-
bg: (_key: string, text: string) => text,
|
|
644
|
-
bold: (text: string) => text,
|
|
645
|
-
italic: (text: string) => text,
|
|
646
|
-
truncate: (text: string) => text,
|
|
647
|
-
};
|
|
648
|
-
|
|
649
|
-
const host = createHost();
|
|
650
|
-
host.getMarkdownThemeWithSettings = () => ({});
|
|
651
|
-
|
|
652
|
-
const mcpTool = {
|
|
653
|
-
type: "toolCall",
|
|
654
|
-
id: "mcp-tool-multi-shrink-1",
|
|
655
|
-
name: "glob",
|
|
656
|
-
mcpServer: "filesystem",
|
|
657
|
-
arguments: { pattern: "**/*" },
|
|
658
|
-
};
|
|
659
|
-
|
|
660
|
-
await handleAgentEvent(host, { type: "message_start", message: makeAssistant([]) } as any);
|
|
661
|
-
|
|
662
|
-
// Sub-turn 1: 3 text blocks (merged into one text-run).
|
|
663
|
-
const subTurn1 = [
|
|
664
|
-
{ type: "text", text: "First provisional A." },
|
|
665
|
-
{ type: "text", text: "First provisional B." },
|
|
666
|
-
{ type: "text", text: "First provisional C." },
|
|
667
|
-
];
|
|
668
|
-
await handleAgentEvent(
|
|
669
|
-
host,
|
|
670
|
-
{
|
|
671
|
-
type: "message_update",
|
|
672
|
-
message: makeAssistant(subTurn1),
|
|
673
|
-
assistantMessageEvent: {
|
|
674
|
-
type: "text_delta",
|
|
675
|
-
contentIndex: 2,
|
|
676
|
-
delta: "First provisional C.",
|
|
677
|
-
partial: makeAssistant(subTurn1),
|
|
678
|
-
},
|
|
679
|
-
} as any,
|
|
680
|
-
);
|
|
681
|
-
assert.equal(host.chatContainer.children.length, 1, "first sub-turn renders 1 text-run");
|
|
682
|
-
|
|
683
|
-
// Sub-turn 2 (first shrink 3 → 2 blocks).
|
|
684
|
-
const subTurn2 = [
|
|
685
|
-
{ type: "text", text: "Second provisional A." },
|
|
686
|
-
{ type: "text", text: "Second provisional B." },
|
|
687
|
-
];
|
|
688
|
-
await handleAgentEvent(
|
|
689
|
-
host,
|
|
690
|
-
{
|
|
691
|
-
type: "message_update",
|
|
692
|
-
message: makeAssistant(subTurn2),
|
|
693
|
-
assistantMessageEvent: {
|
|
694
|
-
type: "text_delta",
|
|
695
|
-
contentIndex: 1,
|
|
696
|
-
delta: "Second provisional B.",
|
|
697
|
-
partial: makeAssistant(subTurn2),
|
|
698
|
-
},
|
|
699
|
-
} as any,
|
|
700
|
-
);
|
|
701
|
-
assert.equal(host.chatContainer.children.length, 2, "first shrink appends, keeps prior text as frozen history");
|
|
702
|
-
|
|
703
|
-
// Sub-turn 3 (second shrink 2 → 1 block). This is the critical step —
|
|
704
|
-
// without orphan accumulation, sub-turn 1's orphaned segment would be
|
|
705
|
-
// dropped from tracking here and later strand in the container.
|
|
706
|
-
const subTurn3 = [{ type: "text", text: "Third provisional." }];
|
|
707
|
-
await handleAgentEvent(
|
|
708
|
-
host,
|
|
709
|
-
{
|
|
710
|
-
type: "message_update",
|
|
711
|
-
message: makeAssistant(subTurn3),
|
|
712
|
-
assistantMessageEvent: {
|
|
713
|
-
type: "text_delta",
|
|
714
|
-
contentIndex: 0,
|
|
715
|
-
delta: "Third provisional.",
|
|
716
|
-
partial: makeAssistant(subTurn3),
|
|
717
|
-
},
|
|
718
|
-
} as any,
|
|
719
|
-
);
|
|
720
|
-
assert.equal(host.chatContainer.children.length, 3, "second shrink appends again, still no prune (no post-tool text)");
|
|
721
|
-
|
|
722
|
-
// MCP tool appears — tool-only window still keeps provisional prose visible.
|
|
723
|
-
await handleAgentEvent(
|
|
724
|
-
host,
|
|
725
|
-
{
|
|
726
|
-
type: "message_update",
|
|
727
|
-
message: makeAssistant([{ type: "text", text: "Third provisional." }, mcpTool]),
|
|
728
|
-
assistantMessageEvent: {
|
|
729
|
-
type: "toolcall_end",
|
|
730
|
-
contentIndex: 1,
|
|
731
|
-
toolCall: {
|
|
732
|
-
...mcpTool,
|
|
733
|
-
externalResult: {
|
|
734
|
-
content: [{ type: "text", text: "glob output" }],
|
|
735
|
-
details: {},
|
|
736
|
-
isError: false,
|
|
737
|
-
},
|
|
738
|
-
},
|
|
739
|
-
partial: makeAssistant([{ type: "text", text: "Third provisional." }, mcpTool]),
|
|
740
|
-
},
|
|
741
|
-
} as any,
|
|
742
|
-
);
|
|
743
|
-
assert.equal(host.chatContainer.children.length, 4, "tool-only window keeps all three provisional text-runs");
|
|
744
|
-
|
|
745
|
-
// Final post-tool text arrives — prune must drop ALL three pre-tool
|
|
746
|
-
// provisional text-runs across both shrinks, leaving only tool + final text.
|
|
747
|
-
const finalContent = [mcpTool, { type: "text", text: "Final answer." }];
|
|
748
|
-
await handleAgentEvent(
|
|
749
|
-
host,
|
|
750
|
-
{
|
|
751
|
-
type: "message_update",
|
|
752
|
-
message: makeAssistant(finalContent),
|
|
753
|
-
assistantMessageEvent: {
|
|
754
|
-
type: "text_delta",
|
|
755
|
-
contentIndex: 1,
|
|
756
|
-
delta: "Final answer.",
|
|
757
|
-
partial: makeAssistant(finalContent),
|
|
758
|
-
},
|
|
759
|
-
} as any,
|
|
760
|
-
);
|
|
761
|
-
assert.equal(
|
|
762
|
-
host.chatContainer.children.length,
|
|
763
|
-
2,
|
|
764
|
-
"all pre-tool provisional segments from every shrink must be pruned once post-tool prose arrives",
|
|
765
|
-
);
|
|
766
|
-
assert.equal(host.chatContainer.children[0]?.constructor?.name, "ToolExecutionComponent");
|
|
767
|
-
assert.equal(host.chatContainer.children[1]?.constructor?.name, "AssistantMessageComponent");
|
|
768
|
-
|
|
769
|
-
await handleAgentEvent(host, { type: "message_end", message: makeAssistant(finalContent) } as any);
|
|
770
|
-
});
|
|
771
|
-
|
|
772
|
-
test("chat-controller pins latest assistant text above editor when tool calls are present", async () => {
|
|
773
|
-
(globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
|
|
774
|
-
fg: (_key: string, text: string) => text,
|
|
775
|
-
bg: (_key: string, text: string) => text,
|
|
776
|
-
bold: (text: string) => text,
|
|
777
|
-
italic: (text: string) => text,
|
|
778
|
-
truncate: (text: string) => text,
|
|
779
|
-
};
|
|
780
|
-
|
|
781
|
-
const host = createHost();
|
|
782
|
-
const toolId = "tool-pin-1";
|
|
783
|
-
const toolCall = {
|
|
784
|
-
type: "toolCall",
|
|
785
|
-
id: toolId,
|
|
786
|
-
name: "exec_command",
|
|
787
|
-
arguments: { cmd: "echo hi" },
|
|
788
|
-
};
|
|
789
|
-
|
|
790
|
-
await handleAgentEvent(host, { type: "message_start", message: makeAssistant([]) } as any);
|
|
791
|
-
|
|
792
|
-
assert.equal(host.pinnedMessageContainer.children.length, 0, "pinned zone should be empty at message_start");
|
|
793
|
-
|
|
794
|
-
// Send a message with text followed by a tool call
|
|
795
|
-
host.getMarkdownThemeWithSettings = () => ({});
|
|
796
|
-
await handleAgentEvent(
|
|
797
|
-
host,
|
|
798
|
-
{
|
|
799
|
-
type: "message_update",
|
|
800
|
-
message: makeAssistant([
|
|
801
|
-
{ type: "text", text: "Looking at the files now." },
|
|
802
|
-
toolCall,
|
|
803
|
-
]),
|
|
804
|
-
assistantMessageEvent: {
|
|
805
|
-
type: "toolcall_end",
|
|
806
|
-
contentIndex: 1,
|
|
807
|
-
toolCall: {
|
|
808
|
-
...toolCall,
|
|
809
|
-
externalResult: {
|
|
810
|
-
content: [{ type: "text", text: "file contents" }],
|
|
811
|
-
details: {},
|
|
812
|
-
isError: false,
|
|
813
|
-
},
|
|
814
|
-
},
|
|
815
|
-
partial: makeAssistant([{ type: "text", text: "Looking at the files now." }, toolCall]),
|
|
816
|
-
},
|
|
817
|
-
} as any,
|
|
818
|
-
);
|
|
819
|
-
|
|
820
|
-
// Pinned zone should now have a DynamicBorder and a Markdown component
|
|
821
|
-
assert.equal(host.pinnedMessageContainer.children.length, 2, "pinned zone should have border + markdown");
|
|
822
|
-
assert.equal(host.pinnedMessageContainer.children[0]?.constructor?.name, "DynamicBorder");
|
|
823
|
-
assert.equal(host.pinnedMessageContainer.children[1]?.constructor?.name, "Markdown");
|
|
824
|
-
});
|
|
825
|
-
|
|
826
|
-
test("chat-controller clears pinned zone when a new assistant message starts", async () => {
|
|
827
|
-
(globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
|
|
828
|
-
fg: (_key: string, text: string) => text,
|
|
829
|
-
bg: (_key: string, text: string) => text,
|
|
830
|
-
bold: (text: string) => text,
|
|
831
|
-
italic: (text: string) => text,
|
|
832
|
-
truncate: (text: string) => text,
|
|
833
|
-
};
|
|
834
|
-
|
|
835
|
-
const host = createHost();
|
|
836
|
-
const toolCall = {
|
|
837
|
-
type: "toolCall",
|
|
838
|
-
id: "tool-clear-1",
|
|
839
|
-
name: "exec_command",
|
|
840
|
-
arguments: { cmd: "echo hi" },
|
|
841
|
-
};
|
|
842
|
-
|
|
843
|
-
await handleAgentEvent(host, { type: "message_start", message: makeAssistant([]) } as any);
|
|
844
|
-
|
|
845
|
-
// Populate the pinned zone
|
|
846
|
-
host.getMarkdownThemeWithSettings = () => ({});
|
|
847
|
-
await handleAgentEvent(
|
|
848
|
-
host,
|
|
849
|
-
{
|
|
850
|
-
type: "message_update",
|
|
851
|
-
message: makeAssistant([{ type: "text", text: "Working on it." }, toolCall]),
|
|
852
|
-
assistantMessageEvent: {
|
|
853
|
-
type: "toolcall_end",
|
|
854
|
-
contentIndex: 1,
|
|
855
|
-
toolCall: {
|
|
856
|
-
...toolCall,
|
|
857
|
-
externalResult: {
|
|
858
|
-
content: [{ type: "text", text: "ok" }],
|
|
859
|
-
details: {},
|
|
860
|
-
isError: false,
|
|
861
|
-
},
|
|
862
|
-
},
|
|
863
|
-
partial: makeAssistant([{ type: "text", text: "Working on it." }, toolCall]),
|
|
864
|
-
},
|
|
865
|
-
} as any,
|
|
866
|
-
);
|
|
867
|
-
|
|
868
|
-
assert.ok(host.pinnedMessageContainer.children.length > 0, "pinned zone should be populated");
|
|
869
|
-
|
|
870
|
-
// Start a new assistant message — pinned zone should clear
|
|
871
|
-
await handleAgentEvent(host, { type: "message_start", message: makeAssistant([]) } as any);
|
|
872
|
-
|
|
873
|
-
assert.equal(host.pinnedMessageContainer.children.length, 0, "pinned zone should clear on new assistant message");
|
|
874
|
-
});
|
|
875
|
-
|
|
876
|
-
test("chat-controller clears pinned zone when the agent turn ends", async () => {
|
|
877
|
-
(globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
|
|
878
|
-
fg: (_key: string, text: string) => text,
|
|
879
|
-
bg: (_key: string, text: string) => text,
|
|
880
|
-
bold: (text: string) => text,
|
|
881
|
-
italic: (text: string) => text,
|
|
882
|
-
truncate: (text: string) => text,
|
|
883
|
-
};
|
|
884
|
-
|
|
885
|
-
const host = createHost();
|
|
886
|
-
const toolCall = {
|
|
887
|
-
type: "toolCall",
|
|
888
|
-
id: "tool-clear-on-end-1",
|
|
889
|
-
name: "exec_command",
|
|
890
|
-
arguments: { cmd: "echo hi" },
|
|
891
|
-
};
|
|
892
|
-
|
|
893
|
-
await handleAgentEvent(host, { type: "message_start", message: makeAssistant([]) } as any);
|
|
894
|
-
|
|
895
|
-
host.getMarkdownThemeWithSettings = () => ({});
|
|
896
|
-
await handleAgentEvent(
|
|
897
|
-
host,
|
|
898
|
-
{
|
|
899
|
-
type: "message_update",
|
|
900
|
-
message: makeAssistant([{ type: "text", text: "Working on it." }, toolCall]),
|
|
901
|
-
assistantMessageEvent: {
|
|
902
|
-
type: "toolcall_end",
|
|
903
|
-
contentIndex: 1,
|
|
904
|
-
toolCall: {
|
|
905
|
-
...toolCall,
|
|
906
|
-
externalResult: {
|
|
907
|
-
content: [{ type: "text", text: "ok" }],
|
|
908
|
-
details: {},
|
|
909
|
-
isError: false,
|
|
910
|
-
},
|
|
911
|
-
},
|
|
912
|
-
partial: makeAssistant([{ type: "text", text: "Working on it." }, toolCall]),
|
|
913
|
-
},
|
|
914
|
-
} as any,
|
|
915
|
-
);
|
|
916
|
-
|
|
917
|
-
assert.ok(host.pinnedMessageContainer.children.length > 0, "pinned zone should be populated before agent_end");
|
|
918
|
-
|
|
919
|
-
await handleAgentEvent(host, { type: "agent_end" } as any);
|
|
920
|
-
|
|
921
|
-
assert.equal(host.pinnedMessageContainer.children.length, 0, "pinned zone should clear on agent_end");
|
|
922
|
-
});
|
|
923
|
-
|
|
924
|
-
test("chat-controller clears pinned zone when assistant message ends", async () => {
|
|
925
|
-
(globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
|
|
926
|
-
fg: (_key: string, text: string) => text,
|
|
927
|
-
bg: (_key: string, text: string) => text,
|
|
928
|
-
bold: (text: string) => text,
|
|
929
|
-
italic: (text: string) => text,
|
|
930
|
-
truncate: (text: string) => text,
|
|
931
|
-
};
|
|
932
|
-
|
|
933
|
-
const host = createHost();
|
|
934
|
-
const toolCall = {
|
|
935
|
-
type: "toolCall",
|
|
936
|
-
id: "tool-msg-end-1",
|
|
937
|
-
name: "exec_command",
|
|
938
|
-
arguments: { cmd: "echo hi" },
|
|
939
|
-
};
|
|
940
|
-
|
|
941
|
-
await handleAgentEvent(host, { type: "message_start", message: makeAssistant([]) } as any);
|
|
942
|
-
|
|
943
|
-
host.getMarkdownThemeWithSettings = () => ({});
|
|
944
|
-
const msgContent = [{ type: "text", text: "Summary after tools." }, toolCall];
|
|
945
|
-
await handleAgentEvent(
|
|
946
|
-
host,
|
|
947
|
-
{
|
|
948
|
-
type: "message_update",
|
|
949
|
-
message: makeAssistant(msgContent),
|
|
950
|
-
assistantMessageEvent: {
|
|
951
|
-
type: "toolcall_end",
|
|
952
|
-
contentIndex: 1,
|
|
953
|
-
toolCall: {
|
|
954
|
-
...toolCall,
|
|
955
|
-
externalResult: {
|
|
956
|
-
content: [{ type: "text", text: "ok" }],
|
|
957
|
-
details: {},
|
|
958
|
-
isError: false,
|
|
959
|
-
},
|
|
960
|
-
},
|
|
961
|
-
partial: makeAssistant(msgContent),
|
|
962
|
-
},
|
|
963
|
-
} as any,
|
|
964
|
-
);
|
|
965
|
-
|
|
966
|
-
assert.ok(host.pinnedMessageContainer.children.length > 0, "pinned zone should be populated during streaming");
|
|
967
|
-
|
|
968
|
-
// End the assistant message (e.g. before form elicitation) — pinned zone should clear
|
|
969
|
-
await handleAgentEvent(host, { type: "message_end", message: makeAssistant(msgContent) } as any);
|
|
970
|
-
|
|
971
|
-
assert.equal(host.pinnedMessageContainer.children.length, 0, "pinned zone should clear on message_end to prevent duplicate display");
|
|
972
|
-
});
|
|
973
|
-
|
|
974
|
-
test("chat-controller does not pin when there are no tool calls", async () => {
|
|
975
|
-
(globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
|
|
976
|
-
fg: (_key: string, text: string) => text,
|
|
977
|
-
bg: (_key: string, text: string) => text,
|
|
978
|
-
bold: (text: string) => text,
|
|
979
|
-
italic: (text: string) => text,
|
|
980
|
-
truncate: (text: string) => text,
|
|
981
|
-
};
|
|
982
|
-
|
|
983
|
-
const host = createHost();
|
|
984
|
-
|
|
985
|
-
await handleAgentEvent(host, { type: "message_start", message: makeAssistant([]) } as any);
|
|
986
|
-
|
|
987
|
-
host.getMarkdownThemeWithSettings = () => ({});
|
|
988
|
-
await handleAgentEvent(
|
|
989
|
-
host,
|
|
990
|
-
{
|
|
991
|
-
type: "message_update",
|
|
992
|
-
message: makeAssistant([{ type: "text", text: "Just some text, no tools." }]),
|
|
993
|
-
assistantMessageEvent: {
|
|
994
|
-
type: "text_delta",
|
|
995
|
-
contentIndex: 0,
|
|
996
|
-
delta: "Just some text, no tools.",
|
|
997
|
-
partial: makeAssistant([{ type: "text", text: "Just some text, no tools." }]),
|
|
998
|
-
},
|
|
999
|
-
} as any,
|
|
1000
|
-
);
|
|
1001
|
-
|
|
1002
|
-
assert.equal(host.pinnedMessageContainer.children.length, 0, "pinned zone should stay empty without tool calls");
|
|
1003
|
-
});
|
|
1004
|
-
|
|
1005
|
-
// Regression test for issue #4144: interleaved text/tool content must render in content[] index order.
|
|
1006
|
-
// Stream: [text "A", toolCall T1, text "B", toolCall T2, text "C"]
|
|
1007
|
-
// Expected chatContainer order: textRun(A), toolExec(T1), textRun(B), toolExec(T2), textRun(C)
|
|
1008
|
-
// Each AssistantMessageComponent must render ONLY its own text — no duplication after message_end.
|
|
1009
|
-
test("chat-controller renders interleaved text and tool blocks in content[] index order (#4144)", async () => {
|
|
1010
|
-
(globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
|
|
1011
|
-
fg: (_key: string, text: string) => text,
|
|
1012
|
-
bg: (_key: string, text: string) => text,
|
|
1013
|
-
bold: (text: string) => text,
|
|
1014
|
-
italic: (text: string) => text,
|
|
1015
|
-
truncate: (text: string) => text,
|
|
1016
|
-
};
|
|
1017
|
-
|
|
1018
|
-
const host = createHost();
|
|
1019
|
-
host.getMarkdownThemeWithSettings = () => ({});
|
|
1020
|
-
|
|
1021
|
-
const t1 = { type: "toolCall", id: "t1", name: "tool_one", arguments: {} };
|
|
1022
|
-
const t2 = { type: "toolCall", id: "t2", name: "tool_two", arguments: {} };
|
|
1023
|
-
|
|
1024
|
-
await handleAgentEvent(host, { type: "message_start", message: makeAssistant([]) } as any);
|
|
1025
|
-
|
|
1026
|
-
// Stream text "A" at index 0
|
|
1027
|
-
await handleAgentEvent(host, {
|
|
1028
|
-
type: "message_update",
|
|
1029
|
-
message: makeAssistant([{ type: "text", text: "A" }]),
|
|
1030
|
-
assistantMessageEvent: {
|
|
1031
|
-
type: "text_delta",
|
|
1032
|
-
contentIndex: 0,
|
|
1033
|
-
delta: "A",
|
|
1034
|
-
partial: makeAssistant([{ type: "text", text: "A" }]),
|
|
1035
|
-
},
|
|
1036
|
-
} as any);
|
|
1037
|
-
|
|
1038
|
-
// Stream toolCall T1 at index 1
|
|
1039
|
-
await handleAgentEvent(host, {
|
|
1040
|
-
type: "message_update",
|
|
1041
|
-
message: makeAssistant([{ type: "text", text: "A" }, t1]),
|
|
1042
|
-
assistantMessageEvent: {
|
|
1043
|
-
type: "toolcall_end",
|
|
1044
|
-
contentIndex: 1,
|
|
1045
|
-
toolCall: {
|
|
1046
|
-
...t1,
|
|
1047
|
-
externalResult: { content: [{ type: "text", text: "result1" }], details: {}, isError: false },
|
|
1048
|
-
},
|
|
1049
|
-
partial: makeAssistant([{ type: "text", text: "A" }, t1]),
|
|
1050
|
-
},
|
|
1051
|
-
} as any);
|
|
1052
|
-
|
|
1053
|
-
// Stream text "B" at index 2
|
|
1054
|
-
await handleAgentEvent(host, {
|
|
1055
|
-
type: "message_update",
|
|
1056
|
-
message: makeAssistant([{ type: "text", text: "A" }, t1, { type: "text", text: "B" }]),
|
|
1057
|
-
assistantMessageEvent: {
|
|
1058
|
-
type: "text_delta",
|
|
1059
|
-
contentIndex: 2,
|
|
1060
|
-
delta: "B",
|
|
1061
|
-
partial: makeAssistant([{ type: "text", text: "A" }, t1, { type: "text", text: "B" }]),
|
|
1062
|
-
},
|
|
1063
|
-
} as any);
|
|
1064
|
-
|
|
1065
|
-
// Stream toolCall T2 at index 3
|
|
1066
|
-
await handleAgentEvent(host, {
|
|
1067
|
-
type: "message_update",
|
|
1068
|
-
message: makeAssistant([{ type: "text", text: "A" }, t1, { type: "text", text: "B" }, t2]),
|
|
1069
|
-
assistantMessageEvent: {
|
|
1070
|
-
type: "toolcall_end",
|
|
1071
|
-
contentIndex: 3,
|
|
1072
|
-
toolCall: {
|
|
1073
|
-
...t2,
|
|
1074
|
-
externalResult: { content: [{ type: "text", text: "result2" }], details: {}, isError: false },
|
|
1075
|
-
},
|
|
1076
|
-
partial: makeAssistant([{ type: "text", text: "A" }, t1, { type: "text", text: "B" }, t2]),
|
|
1077
|
-
},
|
|
1078
|
-
} as any);
|
|
1079
|
-
|
|
1080
|
-
// Stream text "C" at index 4
|
|
1081
|
-
const finalContent = [
|
|
1082
|
-
{ type: "text", text: "A" }, t1, { type: "text", text: "B" }, t2, { type: "text", text: "C" },
|
|
1083
|
-
];
|
|
1084
|
-
await handleAgentEvent(host, {
|
|
1085
|
-
type: "message_update",
|
|
1086
|
-
message: makeAssistant(finalContent),
|
|
1087
|
-
assistantMessageEvent: {
|
|
1088
|
-
type: "text_delta",
|
|
1089
|
-
contentIndex: 4,
|
|
1090
|
-
delta: "C",
|
|
1091
|
-
partial: makeAssistant(finalContent),
|
|
1092
|
-
},
|
|
1093
|
-
} as any);
|
|
1094
|
-
|
|
1095
|
-
// Finalize — exercises the message_end path where a buggy setRange(undefined) would cause duplication
|
|
1096
|
-
await handleAgentEvent(host, { type: "message_end", message: makeAssistant(finalContent) } as any);
|
|
1097
|
-
|
|
1098
|
-
// Assert interleaved order: textRun(A), toolExec(T1), textRun(B), toolExec(T2), textRun(C)
|
|
1099
|
-
assert.equal(host.chatContainer.children.length, 5, "should have 5 children in interleaved order");
|
|
1100
|
-
assert.equal(host.chatContainer.children[0]?.constructor?.name, "AssistantMessageComponent", "index 0: text run A");
|
|
1101
|
-
assert.equal(host.chatContainer.children[1]?.constructor?.name, "ToolExecutionComponent", "index 1: tool T1");
|
|
1102
|
-
assert.equal(host.chatContainer.children[2]?.constructor?.name, "AssistantMessageComponent", "index 2: text run B");
|
|
1103
|
-
assert.equal(host.chatContainer.children[3]?.constructor?.name, "ToolExecutionComponent", "index 3: tool T2");
|
|
1104
|
-
assert.equal(host.chatContainer.children[4]?.constructor?.name, "AssistantMessageComponent", "index 4: text run C");
|
|
1105
|
-
|
|
1106
|
-
// Helper: collect the text of all Markdown children inside an AssistantMessageComponent.
|
|
1107
|
-
// Structure: AssistantMessageComponent (Container) -> contentContainer (children[0]) -> Markdown nodes.
|
|
1108
|
-
function getRenderedTexts(comp: any): string[] {
|
|
1109
|
-
const contentContainer = comp.children?.[0];
|
|
1110
|
-
if (!contentContainer) return [];
|
|
1111
|
-
return (contentContainer.children ?? [])
|
|
1112
|
-
.filter((c: any) => c.constructor?.name === "Markdown")
|
|
1113
|
-
.map((c: any) => (c as any).text as string);
|
|
1114
|
-
}
|
|
1115
|
-
|
|
1116
|
-
// Each text-run component must contain only its own text — no cross-contamination after message_end
|
|
1117
|
-
assert.deepEqual(getRenderedTexts(host.chatContainer.children[0]), ["A"], "text run A must contain only 'A'");
|
|
1118
|
-
assert.deepEqual(getRenderedTexts(host.chatContainer.children[2]), ["B"], "text run B must contain only 'B'");
|
|
1119
|
-
assert.deepEqual(getRenderedTexts(host.chatContainer.children[4]), ["C"], "text run C must contain only 'C'");
|
|
1120
|
-
});
|
|
1121
|
-
|
|
1122
|
-
test("chat-controller does not duplicate text when content is [text, tool, text] (interleaved stream)", async () => {
|
|
1123
|
-
(globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
|
|
1124
|
-
fg: (_key: string, text: string) => text,
|
|
1125
|
-
bg: (_key: string, text: string) => text,
|
|
1126
|
-
bold: (text: string) => text,
|
|
1127
|
-
italic: (text: string) => text,
|
|
1128
|
-
truncate: (text: string) => text,
|
|
1129
|
-
};
|
|
1130
|
-
|
|
1131
|
-
const host = createHost();
|
|
1132
|
-
host.getMarkdownThemeWithSettings = () => ({});
|
|
1133
|
-
|
|
1134
|
-
const t1 = { type: "toolCall", id: "t1", name: "tool_one", arguments: {} };
|
|
1135
|
-
|
|
1136
|
-
await handleAgentEvent(host, { type: "message_start", message: makeAssistant([]) } as any);
|
|
1137
|
-
|
|
1138
|
-
// Step 1: text "A" at index 0
|
|
1139
|
-
await handleAgentEvent(host, {
|
|
1140
|
-
type: "message_update",
|
|
1141
|
-
message: makeAssistant([{ type: "text", text: "A" }]),
|
|
1142
|
-
assistantMessageEvent: {
|
|
1143
|
-
type: "text_delta",
|
|
1144
|
-
contentIndex: 0,
|
|
1145
|
-
delta: "A",
|
|
1146
|
-
partial: makeAssistant([{ type: "text", text: "A" }]),
|
|
1147
|
-
},
|
|
1148
|
-
} as any);
|
|
1149
|
-
|
|
1150
|
-
// Step 2: toolCall at index 1
|
|
1151
|
-
await handleAgentEvent(host, {
|
|
1152
|
-
type: "message_update",
|
|
1153
|
-
message: makeAssistant([{ type: "text", text: "A" }, t1]),
|
|
1154
|
-
assistantMessageEvent: {
|
|
1155
|
-
type: "toolcall_end",
|
|
1156
|
-
contentIndex: 1,
|
|
1157
|
-
toolCall: {
|
|
1158
|
-
...t1,
|
|
1159
|
-
externalResult: { content: [{ type: "text", text: "result1" }], details: {}, isError: false },
|
|
1160
|
-
},
|
|
1161
|
-
partial: makeAssistant([{ type: "text", text: "A" }, t1]),
|
|
1162
|
-
},
|
|
1163
|
-
} as any);
|
|
1164
|
-
|
|
1165
|
-
// Step 3: text "B" at index 2
|
|
1166
|
-
const finalContent = [{ type: "text", text: "A" }, t1, { type: "text", text: "B" }];
|
|
1167
|
-
await handleAgentEvent(host, {
|
|
1168
|
-
type: "message_update",
|
|
1169
|
-
message: makeAssistant(finalContent),
|
|
1170
|
-
assistantMessageEvent: {
|
|
1171
|
-
type: "text_delta",
|
|
1172
|
-
contentIndex: 2,
|
|
1173
|
-
delta: "B",
|
|
1174
|
-
partial: makeAssistant(finalContent),
|
|
1175
|
-
},
|
|
1176
|
-
} as any);
|
|
1177
|
-
|
|
1178
|
-
assert.equal(host.chatContainer.children.length, 3);
|
|
1179
|
-
assert.equal(host.chatContainer.children[0]?.constructor?.name, "AssistantMessageComponent");
|
|
1180
|
-
assert.equal(host.chatContainer.children[1]?.constructor?.name, "ToolExecutionComponent");
|
|
1181
|
-
assert.equal(host.chatContainer.children[2]?.constructor?.name, "AssistantMessageComponent");
|
|
1182
|
-
|
|
1183
|
-
const firstText = host.chatContainer.children[0];
|
|
1184
|
-
const secondText = host.chatContainer.children[2];
|
|
1185
|
-
assert.notEqual(firstText, secondText, "text-before-tool and text-after-tool must be separate component instances");
|
|
1186
|
-
assert.deepEqual((firstText as any).range, { startIndex: 0, endIndex: 0 }, "first text-run covers only content[0]");
|
|
1187
|
-
assert.deepEqual((secondText as any).range, { startIndex: 2, endIndex: 2 }, "second text-run covers only content[2]");
|
|
1188
|
-
|
|
1189
|
-
// Finalize — regression guard: range must NOT be cleared on message_end (would cause duplication)
|
|
1190
|
-
await handleAgentEvent(host, { type: "message_end", message: makeAssistant(finalContent) } as any);
|
|
1191
|
-
|
|
1192
|
-
assert.deepEqual((secondText as any).range, { startIndex: 2, endIndex: 2 }, "range must not be cleared on message_end (would cause duplication)");
|
|
1193
|
-
});
|
|
1194
|
-
|
|
1195
|
-
// Regression for the claude-code sub-turn bug that followed #4144:
|
|
1196
|
-
// an adapter can reset content[] back to 0/1 mid-lifecycle when a new provider
|
|
1197
|
-
// sub-turn begins. The segment walker must NOT update prior-sub-turn text-run
|
|
1198
|
-
// components in place (which would destroy earlier history) and must NOT reuse
|
|
1199
|
-
// stale tool registrations for a new tool at the same contentIndex. Prior
|
|
1200
|
-
// sub-turn children must stay frozen; new sub-turn segments must append after
|
|
1201
|
-
// them, and the pinned "Latest Output" mirror must re-evaluate for the new sub-turn.
|
|
1202
|
-
test("chat-controller freezes prior sub-turn and appends new segments when content shrinks", async () => {
|
|
1203
|
-
(globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
|
|
1204
|
-
fg: (_key: string, text: string) => text,
|
|
1205
|
-
bg: (_key: string, text: string) => text,
|
|
1206
|
-
bold: (text: string) => text,
|
|
1207
|
-
italic: (text: string) => text,
|
|
1208
|
-
truncate: (text: string) => text,
|
|
1209
|
-
};
|
|
1210
|
-
|
|
1211
|
-
const host = createHost();
|
|
1212
|
-
host.getMarkdownThemeWithSettings = () => ({});
|
|
1213
|
-
|
|
1214
|
-
const t1 = { type: "toolCall", id: "t1", name: "tool_one", arguments: {} };
|
|
1215
|
-
const t2 = { type: "toolCall", id: "t2", name: "tool_two", arguments: {} };
|
|
1216
|
-
|
|
1217
|
-
await handleAgentEvent(host, { type: "message_start", message: makeAssistant([]) } as any);
|
|
1218
|
-
|
|
1219
|
-
// Sub-turn 1: grow to [A, T1, B]
|
|
1220
|
-
await handleAgentEvent(host, {
|
|
1221
|
-
type: "message_update",
|
|
1222
|
-
message: makeAssistant([{ type: "text", text: "A" }]),
|
|
1223
|
-
assistantMessageEvent: {
|
|
1224
|
-
type: "text_delta", contentIndex: 0, delta: "A",
|
|
1225
|
-
partial: makeAssistant([{ type: "text", text: "A" }]),
|
|
1226
|
-
},
|
|
1227
|
-
} as any);
|
|
1228
|
-
await handleAgentEvent(host, {
|
|
1229
|
-
type: "message_update",
|
|
1230
|
-
message: makeAssistant([{ type: "text", text: "A" }, t1]),
|
|
1231
|
-
assistantMessageEvent: {
|
|
1232
|
-
type: "toolcall_end", contentIndex: 1,
|
|
1233
|
-
toolCall: { ...t1, externalResult: { content: [{ type: "text", text: "r1" }], details: {}, isError: false } },
|
|
1234
|
-
partial: makeAssistant([{ type: "text", text: "A" }, t1]),
|
|
1235
|
-
},
|
|
1236
|
-
} as any);
|
|
1237
|
-
await handleAgentEvent(host, {
|
|
1238
|
-
type: "message_update",
|
|
1239
|
-
message: makeAssistant([{ type: "text", text: "A" }, t1, { type: "text", text: "B" }]),
|
|
1240
|
-
assistantMessageEvent: {
|
|
1241
|
-
type: "text_delta", contentIndex: 2, delta: "B",
|
|
1242
|
-
partial: makeAssistant([{ type: "text", text: "A" }, t1, { type: "text", text: "B" }]),
|
|
1243
|
-
},
|
|
1244
|
-
} as any);
|
|
1245
|
-
|
|
1246
|
-
assert.equal(host.chatContainer.children.length, 3, "sub-turn 1 renders 3 children");
|
|
1247
|
-
const priorA = host.chatContainer.children[0];
|
|
1248
|
-
const priorT1 = host.chatContainer.children[1];
|
|
1249
|
-
const priorB = host.chatContainer.children[2];
|
|
1250
|
-
|
|
1251
|
-
// Sub-turn boundary: adapter resets content[] to [C]
|
|
1252
|
-
await handleAgentEvent(host, {
|
|
1253
|
-
type: "message_update",
|
|
1254
|
-
message: makeAssistant([{ type: "text", text: "C" }]),
|
|
1255
|
-
assistantMessageEvent: {
|
|
1256
|
-
type: "text_delta", contentIndex: 0, delta: "C",
|
|
1257
|
-
partial: makeAssistant([{ type: "text", text: "C" }]),
|
|
1258
|
-
},
|
|
1259
|
-
} as any);
|
|
1260
|
-
|
|
1261
|
-
// Prior 3 children must still exist in DOM — and a NEW text-run for "C" appended after them.
|
|
1262
|
-
assert.equal(host.chatContainer.children.length, 4, "shrink must append new segment, not replace prior history");
|
|
1263
|
-
assert.equal(host.chatContainer.children[0], priorA, "prior A component stays at index 0");
|
|
1264
|
-
assert.equal(host.chatContainer.children[1], priorT1, "prior T1 component stays at index 1");
|
|
1265
|
-
assert.equal(host.chatContainer.children[2], priorB, "prior B component stays at index 2");
|
|
1266
|
-
assert.notEqual(host.chatContainer.children[3], priorA, "new C text-run must be a different component from prior A");
|
|
1267
|
-
assert.equal(host.chatContainer.children[3]?.constructor?.name, "AssistantMessageComponent");
|
|
1268
|
-
|
|
1269
|
-
// Prior A component must still render "A", not be overwritten with "C".
|
|
1270
|
-
function getRenderedTexts(comp: any): string[] {
|
|
1271
|
-
const contentContainer = comp.children?.[0];
|
|
1272
|
-
if (!contentContainer) return [];
|
|
1273
|
-
return (contentContainer.children ?? [])
|
|
1274
|
-
.filter((c: any) => c.constructor?.name === "Markdown")
|
|
1275
|
-
.map((c: any) => (c as any).text as string);
|
|
1276
|
-
}
|
|
1277
|
-
assert.deepEqual(getRenderedTexts(priorA), ["A"], "prior A text-run must still contain 'A' after shrink");
|
|
1278
|
-
assert.deepEqual(getRenderedTexts(priorB), ["B"], "prior B text-run must still contain 'B' after shrink");
|
|
1279
|
-
assert.deepEqual(getRenderedTexts(host.chatContainer.children[3]), ["C"], "new text-run must contain only 'C'");
|
|
1280
|
-
|
|
1281
|
-
// Sub-turn 2 grows with a new tool T2 at contentIndex=1.
|
|
1282
|
-
await handleAgentEvent(host, {
|
|
1283
|
-
type: "message_update",
|
|
1284
|
-
message: makeAssistant([{ type: "text", text: "C" }, t2]),
|
|
1285
|
-
assistantMessageEvent: {
|
|
1286
|
-
type: "toolcall_end", contentIndex: 1,
|
|
1287
|
-
toolCall: { ...t2, externalResult: { content: [{ type: "text", text: "r2" }], details: {}, isError: false } },
|
|
1288
|
-
partial: makeAssistant([{ type: "text", text: "C" }, t2]),
|
|
1289
|
-
},
|
|
1290
|
-
} as any);
|
|
1291
|
-
|
|
1292
|
-
// T2 must be appended after the new C text-run, not conflated with the stale T1 registration.
|
|
1293
|
-
assert.equal(host.chatContainer.children.length, 5, "new tool appends after new text-run");
|
|
1294
|
-
assert.equal(host.chatContainer.children[4]?.constructor?.name, "ToolExecutionComponent");
|
|
1295
|
-
assert.notEqual(host.chatContainer.children[4], priorT1, "new T2 must be a different component from prior T1");
|
|
1296
|
-
|
|
1297
|
-
// Finalize so the module-level pinned spinner (setInterval) is torn down and the test process can exit.
|
|
1298
|
-
await handleAgentEvent(host, { type: "message_end", message: makeAssistant([{ type: "text", text: "C" }, t2]) } as any);
|
|
1299
|
-
});
|
|
1300
|
-
|
|
1301
|
-
// Regression: after a sub-turn shrink, lastPinnedText must be cleared so the
|
|
1302
|
-
// pinned "Latest Output" mirror can display text from the new sub-turn instead
|
|
1303
|
-
// of staying frozen on a stale snapshot (the "bottom green stays" symptom).
|
|
1304
|
-
test("chat-controller updates pinned zone after sub-turn shrink", async () => {
|
|
1305
|
-
(globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
|
|
1306
|
-
fg: (_key: string, text: string) => text,
|
|
1307
|
-
bg: (_key: string, text: string) => text,
|
|
1308
|
-
bold: (text: string) => text,
|
|
1309
|
-
italic: (text: string) => text,
|
|
1310
|
-
truncate: (text: string) => text,
|
|
1311
|
-
};
|
|
1312
|
-
|
|
1313
|
-
const host = createHost();
|
|
1314
|
-
host.getMarkdownThemeWithSettings = () => ({});
|
|
1315
|
-
|
|
1316
|
-
const t1 = { type: "toolCall", id: "t1", name: "tool_one", arguments: {} };
|
|
1317
|
-
const t2 = { type: "toolCall", id: "t2", name: "tool_two", arguments: {} };
|
|
1318
|
-
|
|
1319
|
-
await handleAgentEvent(host, { type: "message_start", message: makeAssistant([]) } as any);
|
|
1320
|
-
|
|
1321
|
-
// Sub-turn 1 with pinnable text before a tool → populates pinned zone with "first".
|
|
1322
|
-
await handleAgentEvent(host, {
|
|
1323
|
-
type: "message_update",
|
|
1324
|
-
message: makeAssistant([{ type: "text", text: "first" }, t1]),
|
|
1325
|
-
assistantMessageEvent: {
|
|
1326
|
-
type: "toolcall_end", contentIndex: 1,
|
|
1327
|
-
toolCall: { ...t1, externalResult: { content: [{ type: "text", text: "r1" }], details: {}, isError: false } },
|
|
1328
|
-
partial: makeAssistant([{ type: "text", text: "first" }, t1]),
|
|
1329
|
-
},
|
|
1330
|
-
} as any);
|
|
1331
|
-
const pinnedMarkdown = host.pinnedMessageContainer.children[1];
|
|
1332
|
-
assert.equal((pinnedMarkdown as any)?.text, "first", "pinned zone seeded with sub-turn 1 text");
|
|
1333
|
-
|
|
1334
|
-
// Sub-turn boundary: content resets to [second, t2].
|
|
1335
|
-
await handleAgentEvent(host, {
|
|
1336
|
-
type: "message_update",
|
|
1337
|
-
message: makeAssistant([{ type: "text", text: "second" }, t2]),
|
|
1338
|
-
assistantMessageEvent: {
|
|
1339
|
-
type: "toolcall_end", contentIndex: 1,
|
|
1340
|
-
toolCall: { ...t2, externalResult: { content: [{ type: "text", text: "r2" }], details: {}, isError: false } },
|
|
1341
|
-
partial: makeAssistant([{ type: "text", text: "second" }, t2]),
|
|
1342
|
-
},
|
|
1343
|
-
} as any);
|
|
1344
|
-
|
|
1345
|
-
// Pinned markdown must now reflect the new sub-turn's text, not stay frozen on "first".
|
|
1346
|
-
assert.equal((pinnedMarkdown as any)?.text, "second", "pinned zone must update after sub-turn shrink (#4144 regression)");
|
|
1347
|
-
|
|
1348
|
-
// Finalize so the module-level pinned spinner (setInterval) is torn down and the test process can exit.
|
|
1349
|
-
await handleAgentEvent(host, { type: "message_end", message: makeAssistant([{ type: "text", text: "second" }, t2]) } as any);
|
|
1350
|
-
});
|
|
1351
|
-
|
|
1352
|
-
test("chat-controller: agent_end without message_end must not remove streaming component from DOM (regression #4197)", async () => {
|
|
1353
|
-
const host = createHost();
|
|
1354
|
-
|
|
1355
|
-
await handleAgentEvent(host, {
|
|
1356
|
-
type: "message_start",
|
|
1357
|
-
message: makeAssistant([]),
|
|
1358
|
-
} as any);
|
|
1359
|
-
|
|
1360
|
-
// Simulate partial streaming that creates an AssistantMessageComponent
|
|
1361
|
-
await handleAgentEvent(host, {
|
|
1362
|
-
type: "message_update",
|
|
1363
|
-
message: makeAssistant([{ type: "text", text: "partial answer" }]),
|
|
1364
|
-
assistantMessageEvent: {
|
|
1365
|
-
type: "text_delta",
|
|
1366
|
-
contentIndex: 0,
|
|
1367
|
-
delta: "partial answer",
|
|
1368
|
-
partial: makeAssistant([{ type: "text", text: "partial answer" }]),
|
|
1369
|
-
},
|
|
1370
|
-
} as any);
|
|
1371
|
-
|
|
1372
|
-
// Precondition: component is in DOM
|
|
1373
|
-
assert.equal(
|
|
1374
|
-
host.chatContainer.children.length,
|
|
1375
|
-
1,
|
|
1376
|
-
"streaming component must be in DOM after message_update",
|
|
1377
|
-
);
|
|
1378
|
-
const comp = host.chatContainer.children[0];
|
|
1379
|
-
|
|
1380
|
-
// Simulate abort: agent_end fires WITHOUT message_end
|
|
1381
|
-
await handleAgentEvent(host, { type: "agent_end" } as any);
|
|
1382
|
-
|
|
1383
|
-
assert.equal(
|
|
1384
|
-
host.chatContainer.children.length,
|
|
1385
|
-
1,
|
|
1386
|
-
"agent_end must NOT remove the streaming component from the DOM (issue #4197)",
|
|
1387
|
-
);
|
|
1388
|
-
assert.equal(
|
|
1389
|
-
host.chatContainer.children[0],
|
|
1390
|
-
comp,
|
|
1391
|
-
"the same component instance must remain in the DOM after agent_end",
|
|
1392
|
-
);
|
|
1393
|
-
});
|
|
1394
|
-
|
|
1395
|
-
test("chat-controller: agent_end after message_end must not alter DOM", async () => {
|
|
1396
|
-
const host = createHost();
|
|
1397
|
-
const content = [{ type: "text", text: "complete answer" }];
|
|
1398
|
-
|
|
1399
|
-
await handleAgentEvent(host, {
|
|
1400
|
-
type: "message_start",
|
|
1401
|
-
message: makeAssistant([]),
|
|
1402
|
-
} as any);
|
|
1403
|
-
|
|
1404
|
-
await handleAgentEvent(host, {
|
|
1405
|
-
type: "message_update",
|
|
1406
|
-
message: makeAssistant(content),
|
|
1407
|
-
assistantMessageEvent: {
|
|
1408
|
-
type: "text_delta",
|
|
1409
|
-
contentIndex: 0,
|
|
1410
|
-
delta: "complete answer",
|
|
1411
|
-
partial: makeAssistant(content),
|
|
1412
|
-
},
|
|
1413
|
-
} as any);
|
|
1414
|
-
|
|
1415
|
-
await handleAgentEvent(host, {
|
|
1416
|
-
type: "message_end",
|
|
1417
|
-
message: makeAssistant(content),
|
|
1418
|
-
} as any);
|
|
1419
|
-
|
|
1420
|
-
const countAfterMessageEnd = host.chatContainer.children.length;
|
|
1421
|
-
assert.ok(countAfterMessageEnd > 0, "component must be present after message_end");
|
|
1422
|
-
|
|
1423
|
-
await handleAgentEvent(host, { type: "agent_end" } as any);
|
|
1424
|
-
|
|
1425
|
-
assert.equal(
|
|
1426
|
-
host.chatContainer.children.length,
|
|
1427
|
-
countAfterMessageEnd,
|
|
1428
|
-
"agent_end after message_end must not add or remove DOM nodes",
|
|
1429
|
-
);
|
|
1430
|
-
});
|