gsd-pi 2.81.0 → 2.82.0-dev.ed17d078d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +60 -30
- package/dist/resources/.managed-resources-content-hash +1 -1
- package/dist/resources/extensions/browser-tools/tools/screenshot.js +1 -0
- package/dist/resources/extensions/browser-tools/tools/zoom.js +1 -0
- package/dist/resources/extensions/gsd/auto/loop.js +111 -8
- package/dist/resources/extensions/gsd/auto/orchestrator.js +113 -6
- package/dist/resources/extensions/gsd/auto/phases.js +199 -97
- package/dist/resources/extensions/gsd/auto/run-unit.js +66 -3
- package/dist/resources/extensions/gsd/auto/session.js +9 -0
- package/dist/resources/extensions/gsd/auto/verification-retry-policy.js +43 -0
- package/dist/resources/extensions/gsd/auto-dashboard.js +182 -178
- package/dist/resources/extensions/gsd/auto-dispatch.js +14 -11
- package/dist/resources/extensions/gsd/auto-post-unit.js +7 -1
- package/dist/resources/extensions/gsd/auto-prompts.js +11 -3
- package/dist/resources/extensions/gsd/auto-recovery.js +6 -181
- package/dist/resources/extensions/gsd/auto-runtime-state.js +5 -0
- package/dist/resources/extensions/gsd/auto-start.js +20 -23
- package/dist/resources/extensions/gsd/auto-unit-closeout.js +33 -5
- package/dist/resources/extensions/gsd/auto-verification.js +12 -6
- package/dist/resources/extensions/gsd/auto-worktree.js +8 -0
- package/dist/resources/extensions/gsd/auto.js +386 -106
- package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +13 -6
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +13 -2
- package/dist/resources/extensions/gsd/bootstrap/register-shortcuts.js +4 -8
- package/dist/resources/extensions/gsd/bootstrap/system-context.js +55 -12
- package/dist/resources/extensions/gsd/commands/handlers/core.js +1 -1
- package/dist/resources/extensions/gsd/commands/handlers/notifications-handler.js +4 -10
- package/dist/resources/extensions/gsd/commands/handlers/parallel.js +9 -0
- package/dist/resources/extensions/gsd/commands-handlers.js +15 -2
- package/dist/resources/extensions/gsd/context-store.js +112 -0
- package/dist/resources/extensions/gsd/db-writer.js +150 -84
- package/dist/resources/extensions/gsd/docs/preferences-reference.md +1 -1
- package/dist/resources/extensions/gsd/doctor-git-checks.js +41 -6
- package/dist/resources/extensions/gsd/git-service.js +2 -1
- package/dist/resources/extensions/gsd/gsd-db.js +7 -23
- package/dist/resources/extensions/gsd/health-widget-core.js +1 -1
- package/dist/resources/extensions/gsd/health-widget.js +4 -10
- package/dist/resources/extensions/gsd/knowledge-backfill.js +144 -0
- package/dist/resources/extensions/gsd/knowledge-capture.js +136 -0
- package/dist/resources/extensions/gsd/knowledge-parser.js +154 -0
- package/dist/resources/extensions/gsd/knowledge-projection.js +210 -0
- package/dist/resources/extensions/gsd/markdown-renderer.js +6 -96
- package/dist/resources/extensions/gsd/md-importer.js +1 -1
- package/dist/resources/extensions/gsd/memory-backfill.js +73 -17
- package/dist/resources/extensions/gsd/memory-consolidation-scanner.js +222 -0
- package/dist/resources/extensions/gsd/migrate/command.js +5 -0
- package/dist/resources/extensions/gsd/migrate/preview.js +9 -0
- package/dist/resources/extensions/gsd/migrate/transformer.js +51 -4
- package/dist/resources/extensions/gsd/migrate/writer.js +11 -1
- package/dist/resources/extensions/gsd/native-git-bridge.js +14 -14
- package/dist/resources/extensions/gsd/notification-overlay.js +35 -40
- package/dist/resources/extensions/gsd/parallel-merge.js +53 -30
- package/dist/resources/extensions/gsd/parallel-monitor-overlay.js +25 -33
- package/dist/resources/extensions/gsd/prompts/complete-slice.md +14 -12
- package/dist/resources/extensions/gsd/prompts/discuss-headless.md +20 -2
- package/dist/resources/extensions/gsd/prompts/discuss.md +20 -2
- package/dist/resources/extensions/gsd/prompts/system.md +2 -2
- package/dist/resources/extensions/gsd/provider-switch-observer.js +146 -0
- package/dist/resources/extensions/gsd/recovery-classification.js +15 -1
- package/dist/resources/extensions/gsd/session-lock.js +40 -0
- package/dist/resources/extensions/gsd/state-reconciliation/drift/completion.js +131 -0
- package/dist/resources/extensions/gsd/state-reconciliation/drift/merge-state.js +247 -0
- package/dist/resources/extensions/gsd/state-reconciliation/drift/project-md.js +50 -0
- package/dist/resources/extensions/gsd/state-reconciliation/drift/roadmap.js +87 -0
- package/dist/resources/extensions/gsd/state-reconciliation/drift/sketch-flag.js +50 -0
- package/dist/resources/extensions/gsd/state-reconciliation/drift/stale-render.js +124 -0
- package/dist/resources/extensions/gsd/state-reconciliation/drift/stale-worker.js +32 -0
- package/dist/resources/extensions/gsd/state-reconciliation/errors.js +41 -0
- package/dist/resources/extensions/gsd/state-reconciliation/index.js +99 -0
- package/dist/resources/extensions/gsd/state-reconciliation/registry.js +24 -0
- package/dist/resources/extensions/gsd/state-reconciliation/spawn-gate.js +43 -0
- package/dist/resources/extensions/gsd/state-reconciliation/types.js +3 -0
- package/dist/resources/extensions/gsd/state-reconciliation.js +5 -26
- package/dist/resources/extensions/gsd/templates/knowledge.md +2 -2
- package/dist/resources/extensions/gsd/tui/render-kit.js +74 -0
- package/dist/resources/extensions/gsd/watch/header-renderer.js +92 -69
- package/dist/resources/extensions/gsd/watch/splash-palette.js +10 -0
- package/dist/resources/extensions/gsd/workflow-mcp.js +2 -2
- package/dist/resources/extensions/gsd/worktree-lifecycle.js +722 -316
- package/dist/resources/extensions/gsd/worktree-telemetry.js +3 -1
- 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 +6 -6
- 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/required-server-files.json +3 -3
- package/dist/web/standalone/.next/server/app/_global-error/page.js +3 -3
- package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found/page.js +2 -2
- package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.rsc +3 -3
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- 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 +3 -3
- 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_client-reference-manifest.js +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_client-reference-manifest.js +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_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/browse-directories/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/browse-directories/route_client-reference-manifest.js +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_client-reference-manifest.js +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_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/dev-mode/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/dev-mode/route_client-reference-manifest.js +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_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/experimental/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/experimental/route_client-reference-manifest.js +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_client-reference-manifest.js +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_client-reference-manifest.js +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_client-reference-manifest.js +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_client-reference-manifest.js +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_client-reference-manifest.js +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_client-reference-manifest.js +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_client-reference-manifest.js +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_client-reference-manifest.js +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_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/notifications/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/notifications/route_client-reference-manifest.js +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_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/preferences/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/preferences/route_client-reference-manifest.js +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_client-reference-manifest.js +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_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/remote-questions/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/remote-questions/route_client-reference-manifest.js +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_client-reference-manifest.js +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_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/events/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/session/events/route_client-reference-manifest.js +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_client-reference-manifest.js +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_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/shutdown/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/shutdown/route_client-reference-manifest.js +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_client-reference-manifest.js +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_client-reference-manifest.js +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_client-reference-manifest.js +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/input/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/resize/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/terminal/resize/route_client-reference-manifest.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_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/terminal/stream/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/upload/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/upload/route_client-reference-manifest.js +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_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/update/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/update/route_client-reference-manifest.js +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_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/index.html +1 -1
- package/dist/web/standalone/.next/server/app/index.rsc +4 -4
- package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +4 -4
- 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 +3 -3
- package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/page.js +2 -2
- package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app-paths-manifest.json +6 -6
- package/dist/web/standalone/.next/server/chunks/63.js +3 -3
- package/dist/web/standalone/.next/server/chunks/6897.js +1 -1
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware.js +2 -2
- package/dist/web/standalone/.next/server/next-font-manifest.js +1 -1
- package/dist/web/standalone/.next/server/next-font-manifest.json +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/app/_not-found/{page-2f24283c162b6ab3.js → page-f2a7482d42a5614b.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/app/{layout-9ecfd95f343793f0.js → layout-a16c7a7ecdf0c2cf.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/app/page-752f1e2ebdaa3e45.js +1 -0
- package/dist/web/standalone/.next/static/chunks/main-app-fdab67f7802d7832.js +1 -0
- package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-459824ffb8c323dd.js +1 -0
- package/dist/web/standalone/node_modules/node-pty/build/Makefile +2 -2
- package/dist/web/standalone/node_modules/node-pty/build/Release/pty.node +0 -0
- package/dist/web/standalone/node_modules/node-pty/build/pty.target.mk +14 -14
- package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api.target.mk +14 -14
- package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_except.target.mk +14 -14
- package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_maybe.target.mk +14 -14
- package/dist/web/standalone/server.js +1 -1
- package/dist/welcome-screen.d.ts +0 -7
- package/dist/welcome-screen.js +60 -69
- package/package.json +3 -2
- package/packages/daemon/package.json +2 -2
- package/packages/mcp-server/README.md +2 -0
- package/packages/mcp-server/package.json +2 -2
- package/packages/mcp-server/src/workflow-tools-parity.test.ts +244 -0
- package/packages/native/package.json +1 -1
- package/packages/pi-agent-core/package.json +1 -1
- package/packages/pi-agent-core/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-ai/dist/index.d.ts +2 -2
- package/packages/pi-ai/dist/index.d.ts.map +1 -1
- package/packages/pi-ai/dist/index.js +1 -1
- package/packages/pi-ai/dist/index.js.map +1 -1
- package/packages/pi-ai/dist/providers/transform-messages.d.ts +11 -0
- package/packages/pi-ai/dist/providers/transform-messages.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/transform-messages.js +20 -0
- package/packages/pi-ai/dist/providers/transform-messages.js.map +1 -1
- package/packages/pi-ai/package.json +1 -1
- package/packages/pi-ai/src/index.ts +7 -2
- package/packages/pi-ai/src/providers/transform-messages.ts +24 -0
- package/packages/pi-ai/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-coding-agent/dist/core/system-prompt.js +4 -4
- package/packages/pi-coding-agent/dist/core/system-prompt.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/assistant-message-design.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/assistant-message-design.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/assistant-message-design.test.js +47 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/assistant-message-design.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js +76 -9
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/user-message-design.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/user-message-design.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/user-message-design.test.js +40 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/user-message-design.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.d.ts +0 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.js +30 -29
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.test.js +10 -3
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.js +13 -13
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.d.ts +1 -3
- package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.js +58 -3
- package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/diff.d.ts +2 -2
- package/packages/pi-coding-agent/dist/modes/interactive/components/diff.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/diff.js +12 -6
- package/packages/pi-coding-agent/dist/modes/interactive/components/diff.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 -41
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts +0 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +86 -82
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/transcript-design.d.ts +35 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/transcript-design.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/transcript-design.js +152 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/transcript-design.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tui-style-kit.d.ts +16 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tui-style-kit.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tui-style-kit.js +73 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tui-style-kit.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.d.ts +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.js +12 -8
- package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-highlight.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-highlight.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-highlight.test.js +17 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-highlight.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js +105 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js +27 -26
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.test.js +9 -6
- package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/tests/system-prompt-file-safety.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/tests/system-prompt-file-safety.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/tests/system-prompt-file-safety.test.js +17 -0
- package/packages/pi-coding-agent/dist/tests/system-prompt-file-safety.test.js.map +1 -0
- package/packages/pi-coding-agent/package.json +1 -1
- package/packages/pi-coding-agent/src/core/system-prompt.ts +4 -4
- package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/assistant-message-design.test.ts +56 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/tool-execution.test.ts +113 -9
- package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/user-message-design.test.ts +48 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/adaptive-layout.test.ts +10 -3
- package/packages/pi-coding-agent/src/modes/interactive/components/adaptive-layout.ts +43 -42
- package/packages/pi-coding-agent/src/modes/interactive/components/assistant-message.ts +14 -14
- package/packages/pi-coding-agent/src/modes/interactive/components/bash-execution.ts +64 -3
- package/packages/pi-coding-agent/src/modes/interactive/components/diff.ts +13 -7
- package/packages/pi-coding-agent/src/modes/interactive/components/footer.ts +15 -42
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +84 -104
- package/packages/pi-coding-agent/src/modes/interactive/components/transcript-design.ts +196 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/tui-style-kit.ts +94 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/user-message.ts +14 -9
- package/packages/pi-coding-agent/src/modes/interactive/theme/theme-highlight.test.ts +23 -0
- package/packages/pi-coding-agent/src/modes/interactive/theme/theme.ts +106 -1
- package/packages/pi-coding-agent/src/modes/interactive/theme/themes.ts +27 -26
- package/packages/pi-coding-agent/src/modes/interactive/tui-mode.test.ts +9 -6
- package/packages/pi-coding-agent/src/tests/system-prompt-file-safety.test.ts +22 -0
- package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-tui/dist/__tests__/overlay-layout.test.js +14 -1
- package/packages/pi-tui/dist/__tests__/overlay-layout.test.js.map +1 -1
- package/packages/pi-tui/dist/overlay-layout.d.ts.map +1 -1
- package/packages/pi-tui/dist/overlay-layout.js +9 -6
- package/packages/pi-tui/dist/overlay-layout.js.map +1 -1
- package/packages/pi-tui/dist/tui.d.ts.map +1 -1
- package/packages/pi-tui/dist/tui.js +5 -0
- package/packages/pi-tui/dist/tui.js.map +1 -1
- package/packages/pi-tui/package.json +1 -1
- package/packages/pi-tui/src/__tests__/overlay-layout.test.ts +20 -1
- package/packages/pi-tui/src/overlay-layout.ts +10 -7
- package/packages/pi-tui/src/tui.ts +6 -0
- package/packages/pi-tui/tsconfig.tsbuildinfo +1 -1
- package/packages/rpc-client/package.json +1 -1
- package/pkg/dist/modes/interactive/theme/theme-highlight.test.d.ts +2 -0
- package/pkg/dist/modes/interactive/theme/theme-highlight.test.d.ts.map +1 -0
- package/pkg/dist/modes/interactive/theme/theme-highlight.test.js +17 -0
- package/pkg/dist/modes/interactive/theme/theme-highlight.test.js.map +1 -0
- package/pkg/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/pkg/dist/modes/interactive/theme/theme.js +105 -1
- package/pkg/dist/modes/interactive/theme/theme.js.map +1 -1
- package/pkg/dist/modes/interactive/theme/themes.d.ts.map +1 -1
- package/pkg/dist/modes/interactive/theme/themes.js +27 -26
- package/pkg/dist/modes/interactive/theme/themes.js.map +1 -1
- package/pkg/package.json +1 -1
- package/src/resources/extensions/browser-tools/tools/screenshot.ts +1 -0
- package/src/resources/extensions/browser-tools/tools/zoom.ts +1 -0
- package/src/resources/extensions/gsd/auto/contracts.ts +46 -11
- package/src/resources/extensions/gsd/auto/loop-deps.ts +9 -5
- package/src/resources/extensions/gsd/auto/loop.ts +113 -9
- package/src/resources/extensions/gsd/auto/orchestrator.ts +118 -6
- package/src/resources/extensions/gsd/auto/phases.ts +158 -19
- package/src/resources/extensions/gsd/auto/run-unit.ts +69 -4
- package/src/resources/extensions/gsd/auto/session.ts +10 -0
- package/src/resources/extensions/gsd/auto/verification-retry-policy.ts +82 -0
- package/src/resources/extensions/gsd/auto-dashboard.ts +230 -183
- package/src/resources/extensions/gsd/auto-dispatch.ts +15 -1
- package/src/resources/extensions/gsd/auto-post-unit.ts +7 -1
- package/src/resources/extensions/gsd/auto-prompts.ts +11 -3
- package/src/resources/extensions/gsd/auto-recovery.ts +7 -209
- package/src/resources/extensions/gsd/auto-runtime-state.ts +5 -0
- package/src/resources/extensions/gsd/auto-start.ts +22 -22
- package/src/resources/extensions/gsd/auto-unit-closeout.ts +51 -0
- package/src/resources/extensions/gsd/auto-verification.ts +12 -6
- package/src/resources/extensions/gsd/auto-worktree.ts +8 -0
- package/src/resources/extensions/gsd/auto.ts +424 -106
- package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +21 -6
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +12 -2
- package/src/resources/extensions/gsd/bootstrap/register-shortcuts.ts +5 -8
- package/src/resources/extensions/gsd/bootstrap/system-context.ts +58 -15
- package/src/resources/extensions/gsd/commands/handlers/core.ts +1 -1
- package/src/resources/extensions/gsd/commands/handlers/notifications-handler.ts +4 -10
- package/src/resources/extensions/gsd/commands/handlers/parallel.ts +12 -0
- package/src/resources/extensions/gsd/commands-handlers.ts +19 -2
- package/src/resources/extensions/gsd/context-store.ts +120 -1
- package/src/resources/extensions/gsd/db-writer.ts +167 -84
- package/src/resources/extensions/gsd/docs/preferences-reference.md +1 -1
- package/src/resources/extensions/gsd/doctor-git-checks.ts +44 -6
- package/src/resources/extensions/gsd/doctor-types.ts +2 -0
- package/src/resources/extensions/gsd/git-service.ts +2 -0
- package/src/resources/extensions/gsd/gsd-db.ts +7 -23
- package/src/resources/extensions/gsd/health-widget-core.ts +1 -1
- package/src/resources/extensions/gsd/health-widget.ts +6 -10
- package/src/resources/extensions/gsd/journal.ts +2 -0
- package/src/resources/extensions/gsd/knowledge-backfill.ts +164 -0
- package/src/resources/extensions/gsd/knowledge-capture.ts +160 -0
- package/src/resources/extensions/gsd/knowledge-parser.ts +174 -0
- package/src/resources/extensions/gsd/knowledge-projection.ts +241 -0
- package/src/resources/extensions/gsd/markdown-renderer.ts +10 -96
- package/src/resources/extensions/gsd/md-importer.ts +1 -1
- package/src/resources/extensions/gsd/memory-backfill.ts +89 -17
- package/src/resources/extensions/gsd/memory-consolidation-scanner.ts +277 -0
- package/src/resources/extensions/gsd/migrate/command.ts +5 -0
- package/src/resources/extensions/gsd/migrate/preview.ts +10 -0
- package/src/resources/extensions/gsd/migrate/transformer.ts +58 -4
- package/src/resources/extensions/gsd/migrate/writer.ts +14 -1
- package/src/resources/extensions/gsd/native-git-bridge.ts +14 -13
- package/src/resources/extensions/gsd/notification-overlay.ts +50 -46
- package/src/resources/extensions/gsd/parallel-merge.ts +61 -34
- package/src/resources/extensions/gsd/parallel-monitor-overlay.ts +33 -35
- package/src/resources/extensions/gsd/prompts/complete-slice.md +14 -12
- package/src/resources/extensions/gsd/prompts/discuss-headless.md +20 -2
- package/src/resources/extensions/gsd/prompts/discuss.md +20 -2
- package/src/resources/extensions/gsd/prompts/system.md +2 -2
- package/src/resources/extensions/gsd/provider-switch-observer.ts +185 -0
- package/src/resources/extensions/gsd/recovery-classification.ts +18 -1
- package/src/resources/extensions/gsd/session-lock.ts +41 -0
- package/src/resources/extensions/gsd/state-reconciliation/drift/completion.ts +172 -0
- package/src/resources/extensions/gsd/state-reconciliation/drift/merge-state.ts +337 -0
- package/src/resources/extensions/gsd/state-reconciliation/drift/project-md.ts +69 -0
- package/src/resources/extensions/gsd/state-reconciliation/drift/roadmap.ts +109 -0
- package/src/resources/extensions/gsd/state-reconciliation/drift/sketch-flag.ts +68 -0
- package/src/resources/extensions/gsd/state-reconciliation/drift/stale-render.ts +185 -0
- package/src/resources/extensions/gsd/state-reconciliation/drift/stale-worker.ts +46 -0
- package/src/resources/extensions/gsd/state-reconciliation/errors.ts +67 -0
- package/src/resources/extensions/gsd/state-reconciliation/index.ts +142 -0
- package/src/resources/extensions/gsd/state-reconciliation/registry.ts +27 -0
- package/src/resources/extensions/gsd/state-reconciliation/spawn-gate.ts +60 -0
- package/src/resources/extensions/gsd/state-reconciliation/types.ts +83 -0
- package/src/resources/extensions/gsd/state-reconciliation.ts +21 -53
- package/src/resources/extensions/gsd/templates/knowledge.md +2 -2
- package/src/resources/extensions/gsd/tests/artifact-retry-cap.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/auto-dashboard.test.ts +99 -0
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +729 -176
- package/src/resources/extensions/gsd/tests/auto-orchestrator.test.ts +408 -4
- package/src/resources/extensions/gsd/tests/auto-paused-ui-cleanup.test.ts +291 -4
- package/src/resources/extensions/gsd/tests/auto-runtime-state.test.ts +20 -5
- package/src/resources/extensions/gsd/tests/auto-start-orphan-bootstrap.test.ts +18 -0
- package/src/resources/extensions/gsd/tests/auto-unit-closeout.test.ts +68 -0
- package/src/resources/extensions/gsd/tests/browser-tools-compatibility-declarations.test.ts +62 -0
- package/src/resources/extensions/gsd/tests/context-store-decisions-from-memories.test.ts +312 -0
- package/src/resources/extensions/gsd/tests/custom-engine-loop-integration.test.ts +28 -1
- package/src/resources/extensions/gsd/tests/db-writer.test.ts +13 -8
- package/src/resources/extensions/gsd/tests/decisions-projection-from-memories.test.ts +453 -0
- package/src/resources/extensions/gsd/tests/decisions-stop-table-writes.test.ts +348 -0
- package/src/resources/extensions/gsd/tests/deep-project-auto-loop.test.ts +20 -2
- package/src/resources/extensions/gsd/tests/dispatch-complete-milestone-guard.test.ts +44 -0
- package/src/resources/extensions/gsd/tests/freeform-decisions.test.ts +8 -4
- package/src/resources/extensions/gsd/tests/gsd-tools.test.ts +11 -7
- package/src/resources/extensions/gsd/tests/header-renderer.test.ts +40 -0
- package/src/resources/extensions/gsd/tests/headless-milestone-parity.test.ts +10 -0
- package/src/resources/extensions/gsd/tests/health-widget.test.ts +14 -4
- package/src/resources/extensions/gsd/tests/integration/doctor-git.test.ts +44 -0
- package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +26 -0
- package/src/resources/extensions/gsd/tests/integration/integration-lifecycle.test.ts +13 -5
- package/src/resources/extensions/gsd/tests/integration/integration-proof.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/integration/migrate-command.test.ts +48 -3
- package/src/resources/extensions/gsd/tests/integration/parallel-merge.test.ts +116 -24
- package/src/resources/extensions/gsd/tests/journal-integration.test.ts +0 -1
- package/src/resources/extensions/gsd/tests/knowledge-backfill-projection.test.ts +323 -0
- package/src/resources/extensions/gsd/tests/knowledge-capture.test.ts +242 -0
- package/src/resources/extensions/gsd/tests/knowledge.test.ts +47 -2
- package/src/resources/extensions/gsd/tests/load-knowledge-block-rules-only.test.ts +209 -0
- package/src/resources/extensions/gsd/tests/markdown-renderer.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/memory-consolidation-scanner.test.ts +316 -0
- package/src/resources/extensions/gsd/tests/merge-conflict-stops-loop.test.ts +46 -11
- package/src/resources/extensions/gsd/tests/migrate-transformer.test.ts +5 -1
- package/src/resources/extensions/gsd/tests/migrate-writer-integration.test.ts +6 -1
- package/src/resources/extensions/gsd/tests/notification-overlay.test.ts +78 -41
- package/src/resources/extensions/gsd/tests/notifications-handler.test.ts +44 -0
- package/src/resources/extensions/gsd/tests/originalbase-path-comparison.test.ts +12 -217
- package/src/resources/extensions/gsd/tests/parallel-monitor-overlay.test.ts +38 -6
- package/src/resources/extensions/gsd/tests/plan-milestone-sketch-render.test.ts +157 -0
- package/src/resources/extensions/gsd/tests/post-exec-retry-bypass.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/progressive-planning.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/prompt-contracts.test.ts +32 -1
- package/src/resources/extensions/gsd/tests/provider-switch-observer.test.ts +252 -0
- package/src/resources/extensions/gsd/tests/resume-dispatch-worktree.test.ts +7 -3
- package/src/resources/extensions/gsd/tests/runtime-invariant-modules.test.ts +6 -3
- package/src/resources/extensions/gsd/tests/session-start-footer.test.ts +16 -4
- package/src/resources/extensions/gsd/tests/session-switch-abort-misclassification.test.ts +24 -0
- package/src/resources/extensions/gsd/tests/state-corruption-2945.test.ts +65 -58
- package/src/resources/extensions/gsd/tests/state-reconciliation-drift.test.ts +952 -0
- package/src/resources/extensions/gsd/tests/token-tool-gating.test.ts +4 -0
- package/src/resources/extensions/gsd/tests/tui-header-lifecycle.test.ts +121 -1
- package/src/resources/extensions/gsd/tests/tui-render-kit.test.ts +66 -0
- package/src/resources/extensions/gsd/tests/verification-retry-policy.test.ts +83 -0
- package/src/resources/extensions/gsd/tests/workflow-mcp.test.ts +6 -0
- package/src/resources/extensions/gsd/tests/worktree-journal-events.test.ts +158 -58
- package/src/resources/extensions/gsd/tests/worktree-lifecycle.test.ts +572 -118
- package/src/resources/extensions/gsd/tests/worktree-telemetry.test.ts +59 -2
- package/src/resources/extensions/gsd/tests/write-gate-planning-unit.test.ts +18 -0
- package/src/resources/extensions/gsd/tui/render-kit.ts +109 -0
- package/src/resources/extensions/gsd/watch/header-renderer.ts +121 -79
- package/src/resources/extensions/gsd/watch/splash-palette.ts +11 -0
- package/src/resources/extensions/gsd/workflow-logger.ts +4 -0
- package/src/resources/extensions/gsd/workflow-mcp.ts +2 -2
- package/src/resources/extensions/gsd/worktree-lifecycle.ts +1151 -524
- package/src/resources/extensions/gsd/worktree-telemetry.ts +7 -2
- package/dist/web/standalone/.next/static/chunks/app/page-200592a7f3baf579.js +0 -1
- package/dist/web/standalone/.next/static/chunks/main-app-d3d4c336195465f9.js +0 -1
- package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-ab5a8926e07ec673.js +0 -1
- package/src/resources/extensions/gsd/tests/worktree-resolver.test.ts +0 -1544
- /package/dist/web/standalone/.next/static/{drLMkgfHQ8lzS229_HWYR → YEvjuT-fsFfYQhDSWtueS}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{drLMkgfHQ8lzS229_HWYR → YEvjuT-fsFfYQhDSWtueS}/_ssgManifest.js +0 -0
|
@@ -14,7 +14,7 @@ import { parseSummary } from '../files.ts';
|
|
|
14
14
|
import { deriveState } from '../state.ts';
|
|
15
15
|
import { invalidateAllCaches } from '../cache.ts';
|
|
16
16
|
import { ensureDbOpen } from '../bootstrap/dynamic-tools.ts';
|
|
17
|
-
import { closeDatabase, getAllMilestones } from '../gsd-db.ts';
|
|
17
|
+
import { closeDatabase, getAllMilestones, getArtifact } from '../gsd-db.ts';
|
|
18
18
|
import { importWrittenMigrationToDb } from '../migrate/command.ts';
|
|
19
19
|
import type {
|
|
20
20
|
GSDProject,
|
|
@@ -336,7 +336,12 @@ test('Scenario 2: Fully complete project — deriveState phase', async () => {
|
|
|
336
336
|
assert.deepStrictEqual(preview.taskCompletionPct, 100, 'complete: preview taskCompletionPct');
|
|
337
337
|
assert.deepStrictEqual(preview.requirements.total, 0, 'complete: preview requirements total');
|
|
338
338
|
|
|
339
|
+
const imported = await importWrittenMigrationToDb(base, preview);
|
|
340
|
+
assert.ok(imported.artifacts >= 6, 'complete: imports generated milestone artifacts');
|
|
341
|
+
assert.ok(getArtifact('milestones/M001/M001-VALIDATION.md') !== null, 'complete: M001-VALIDATION.md imported as artifact');
|
|
342
|
+
assert.ok(getArtifact('milestones/M001/M001-SUMMARY.md') !== null, 'complete: M001-SUMMARY.md imported as artifact');
|
|
339
343
|
} finally {
|
|
344
|
+
closeDatabase();
|
|
340
345
|
rmSync(base, { recursive: true, force: true });
|
|
341
346
|
}
|
|
342
347
|
});
|
|
@@ -1,55 +1,53 @@
|
|
|
1
|
-
// GSD
|
|
2
|
-
//
|
|
3
|
-
// Mirrors the private wrapText from notification-overlay.ts so its contract
|
|
4
|
-
// can be exercised without exporting internals.
|
|
1
|
+
// Project/App: GSD-2
|
|
2
|
+
// File Purpose: Regression tests for notification overlay wrapping and width-safe rendering.
|
|
5
3
|
|
|
6
4
|
import { describe, test } from "node:test";
|
|
7
5
|
import assert from "node:assert/strict";
|
|
6
|
+
import { mkdtempSync, rmSync } from "node:fs";
|
|
7
|
+
import { tmpdir } from "node:os";
|
|
8
|
+
import { join } from "node:path";
|
|
8
9
|
|
|
9
|
-
import {
|
|
10
|
+
import { visibleWidth } from "@gsd/pi-tui";
|
|
11
|
+
import { appendNotification, initNotificationStore, _resetNotificationStore } from "../notification-store.ts";
|
|
12
|
+
import { GSDNotificationOverlay, notificationOverlayOptions } from "../notification-overlay.ts";
|
|
13
|
+
import { wrapVisibleText } from "../tui/render-kit.ts";
|
|
10
14
|
|
|
11
|
-
|
|
15
|
+
const fakeTheme = {
|
|
16
|
+
fg: (_color: string, text: string) => text,
|
|
17
|
+
bold: (text: string) => text,
|
|
18
|
+
};
|
|
12
19
|
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
function assertLinesFit(lines: string[], width: number): void {
|
|
21
|
+
for (const line of lines) {
|
|
22
|
+
assert.ok(
|
|
23
|
+
visibleWidth(line) <= width,
|
|
24
|
+
`line exceeds maxWidth: visibleWidth=${visibleWidth(line)} max=${width}: "${line}"`,
|
|
25
|
+
);
|
|
26
|
+
}
|
|
19
27
|
}
|
|
20
28
|
|
|
21
29
|
describe("notification overlay — wrapText", () => {
|
|
22
30
|
test("short text returns single line", () => {
|
|
23
|
-
const result =
|
|
31
|
+
const result = wrapVisibleText("hello world", 80);
|
|
24
32
|
assert.deepStrictEqual(result, ["hello world"]);
|
|
25
33
|
});
|
|
26
34
|
|
|
27
35
|
test("long text wraps at word boundaries without exceeding maxWidth", () => {
|
|
28
36
|
const text = "This is a long notification message that should wrap across multiple lines";
|
|
29
|
-
const result =
|
|
37
|
+
const result = wrapVisibleText(text, 40);
|
|
30
38
|
assert.ok(result.length > 1, `expected multiple lines, got ${result.length}`);
|
|
31
|
-
|
|
32
|
-
assert.ok(
|
|
33
|
-
visibleWidth(line) <= 40,
|
|
34
|
-
`line exceeds maxWidth: "${line}" (${visibleWidth(line)})`,
|
|
35
|
-
);
|
|
36
|
-
}
|
|
39
|
+
assertLinesFit(result, 40);
|
|
37
40
|
});
|
|
38
41
|
|
|
39
42
|
test("single word exceeding maxWidth is broken to fit column budget", () => {
|
|
40
|
-
const result =
|
|
41
|
-
|
|
42
|
-
assert.ok(
|
|
43
|
-
visibleWidth(line) <= 10,
|
|
44
|
-
`line exceeds maxWidth: "${line}" (${visibleWidth(line)})`,
|
|
45
|
-
);
|
|
46
|
-
}
|
|
43
|
+
const result = wrapVisibleText("superlongwordthatexceedsmaxwidth", 10);
|
|
44
|
+
assertLinesFit(result, 10);
|
|
47
45
|
});
|
|
48
46
|
|
|
49
47
|
test("preserves all words across wrapped lines", () => {
|
|
50
48
|
const words = ["alpha", "bravo", "charlie", "delta", "echo", "foxtrot"];
|
|
51
49
|
const text = words.join(" ");
|
|
52
|
-
const result =
|
|
50
|
+
const result = wrapVisibleText(text, 15);
|
|
53
51
|
const rejoined = result.join(" ");
|
|
54
52
|
for (const w of words) {
|
|
55
53
|
assert.ok(rejoined.includes(w), `missing word: ${w}`);
|
|
@@ -70,23 +68,62 @@ describe("notification overlay — wrapText", () => {
|
|
|
70
68
|
"(expired — will auto-refresh) ✗ google — not configured " +
|
|
71
69
|
"(aistudio.google.com/apikey) ✗ groq — not configured";
|
|
72
70
|
const maxWidth = 118;
|
|
73
|
-
const result =
|
|
74
|
-
|
|
75
|
-
assert.ok(
|
|
76
|
-
visibleWidth(line) <= maxWidth,
|
|
77
|
-
`line exceeds column budget: visibleWidth=${visibleWidth(line)} max=${maxWidth}: "${line}"`,
|
|
78
|
-
);
|
|
79
|
-
}
|
|
71
|
+
const result = wrapVisibleText(msg, maxWidth);
|
|
72
|
+
assertLinesFit(result, maxWidth);
|
|
80
73
|
});
|
|
81
74
|
|
|
82
75
|
test("unbreakable long token (URL) is clamped to maxWidth", () => {
|
|
83
76
|
const url = "https://example.com/" + "a".repeat(200);
|
|
84
|
-
const result =
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
77
|
+
const result = wrapVisibleText(url, 40);
|
|
78
|
+
assertLinesFit(result, 40);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
test("real overlay render fits common terminal widths", (t) => {
|
|
82
|
+
const dir = mkdtempSync(join(tmpdir(), "gsd-notification-overlay-"));
|
|
83
|
+
t.after(() => {
|
|
84
|
+
_resetNotificationStore();
|
|
85
|
+
rmSync(dir, { recursive: true, force: true });
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
initNotificationStore(dir);
|
|
89
|
+
appendNotification("A long notification with " + "x".repeat(180), "warning");
|
|
90
|
+
|
|
91
|
+
const overlay = new GSDNotificationOverlay({ requestRender() {} }, fakeTheme as any, () => {});
|
|
92
|
+
t.after(() => overlay.dispose());
|
|
93
|
+
|
|
94
|
+
for (const width of [40, 80, 120]) {
|
|
95
|
+
assertLinesFit(overlay.render(width), width);
|
|
96
|
+
overlay.invalidate();
|
|
90
97
|
}
|
|
91
98
|
});
|
|
99
|
+
|
|
100
|
+
test("rendered height stays within the configured overlay max height", (t) => {
|
|
101
|
+
const dir = mkdtempSync(join(tmpdir(), "gsd-notification-overlay-height-"));
|
|
102
|
+
const originalRowsDescriptor = Object.getOwnPropertyDescriptor(process.stdout, "rows");
|
|
103
|
+
Object.defineProperty(process.stdout, "rows", { value: 40, configurable: true });
|
|
104
|
+
|
|
105
|
+
t.after(() => {
|
|
106
|
+
if (originalRowsDescriptor) {
|
|
107
|
+
Object.defineProperty(process.stdout, "rows", originalRowsDescriptor);
|
|
108
|
+
} else {
|
|
109
|
+
delete (process.stdout as { rows?: number }).rows;
|
|
110
|
+
}
|
|
111
|
+
_resetNotificationStore();
|
|
112
|
+
rmSync(dir, { recursive: true, force: true });
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
initNotificationStore(dir);
|
|
116
|
+
for (let i = 0; i < 80; i++) {
|
|
117
|
+
appendNotification(`notification-${i + 1} with enough text to exercise clipping`, "warning");
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const overlay = new GSDNotificationOverlay({ requestRender() {} }, fakeTheme as any, () => {});
|
|
121
|
+
t.after(() => overlay.dispose());
|
|
122
|
+
|
|
123
|
+
const rendered = overlay.render(100);
|
|
124
|
+
const maxHeight = Math.floor((40 * 52) / 100);
|
|
125
|
+
assert.ok(rendered.length <= maxHeight, `expected ${rendered.length} lines to fit maxHeight ${maxHeight}`);
|
|
126
|
+
assert.ok(rendered.at(-1)?.includes("╯"), "bottom border should remain visible");
|
|
127
|
+
assert.equal(notificationOverlayOptions().maxHeight, "52%");
|
|
128
|
+
});
|
|
92
129
|
});
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// Project/App: GSD-2
|
|
2
|
+
// File Purpose: Tests for /gsd notifications command handling and overlay launch behavior.
|
|
3
|
+
|
|
1
4
|
import test from "node:test";
|
|
2
5
|
import assert from "node:assert/strict";
|
|
3
6
|
import { join } from "node:path";
|
|
@@ -58,6 +61,47 @@ test("notifications command falls back to text output when overlay returns undef
|
|
|
58
61
|
assert.match(notices[0].message, /Recent notifications:/);
|
|
59
62
|
});
|
|
60
63
|
|
|
64
|
+
test("notifications command opens a compact bounded overlay", async (t) => {
|
|
65
|
+
const base = makeTempDir("overlay-options");
|
|
66
|
+
initNotificationStore(base);
|
|
67
|
+
appendNotification("Build complete", "success");
|
|
68
|
+
|
|
69
|
+
t.after(() => {
|
|
70
|
+
_resetNotificationStore();
|
|
71
|
+
cleanup(base);
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
const notices: Array<{ message: string; level?: string }> = [];
|
|
75
|
+
let capturedOptions: any;
|
|
76
|
+
await handleNotificationsCommand(
|
|
77
|
+
"",
|
|
78
|
+
{
|
|
79
|
+
hasUI: true,
|
|
80
|
+
ui: {
|
|
81
|
+
custom: async (_factory: any, options: any) => {
|
|
82
|
+
capturedOptions = options;
|
|
83
|
+
return true;
|
|
84
|
+
},
|
|
85
|
+
notify: (message: string, level?: string) => {
|
|
86
|
+
notices.push({ message, level });
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
} as any,
|
|
90
|
+
{} as any,
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
assert.deepEqual(capturedOptions?.overlayOptions, {
|
|
94
|
+
width: "58%",
|
|
95
|
+
minWidth: 68,
|
|
96
|
+
maxHeight: "52%",
|
|
97
|
+
anchor: "top-center",
|
|
98
|
+
row: "24%",
|
|
99
|
+
margin: { top: 2, right: 2, bottom: 6, left: 2 },
|
|
100
|
+
backdrop: true,
|
|
101
|
+
});
|
|
102
|
+
assert.equal(notices.length, 0, "successful overlay should not emit text fallback");
|
|
103
|
+
});
|
|
104
|
+
|
|
61
105
|
test("notifications tail caps inline output and hints to open overlay", async (t) => {
|
|
62
106
|
const base = makeTempDir("tail-cap");
|
|
63
107
|
initNotificationStore(base);
|
|
@@ -33,43 +33,6 @@ import {
|
|
|
33
33
|
teardownAutoWorktree,
|
|
34
34
|
} from "../auto-worktree.ts";
|
|
35
35
|
import { normalizeWorktreePathForCompare } from "../worktree-root.ts";
|
|
36
|
-
import {
|
|
37
|
-
WorktreeLifecycle,
|
|
38
|
-
type WorktreeLifecycleDeps,
|
|
39
|
-
type NotifyCtx,
|
|
40
|
-
} from "../worktree-lifecycle.ts";
|
|
41
|
-
import { WorktreeStateProjection } from "../worktree-state-projection.ts";
|
|
42
|
-
import { resolveWorktreeProjectRoot } from "../worktree-root.ts";
|
|
43
|
-
import { AutoSession } from "../auto/session.ts";
|
|
44
|
-
|
|
45
|
-
// Test-local: LegacyTestDeps had three fields Lifecycle does not need
|
|
46
|
-
// (shouldUseWorktreeIsolation, syncWorktreeStateBack, captureIntegrationBranch).
|
|
47
|
-
// Permit them in test fixtures so existing override patterns keep working —
|
|
48
|
-
// Lifecycle ignores the extras via structural typing.
|
|
49
|
-
type LegacyTestDeps = WorktreeLifecycleDeps & {
|
|
50
|
-
shouldUseWorktreeIsolation?: () => boolean;
|
|
51
|
-
syncWorktreeStateBack?: (
|
|
52
|
-
mainBasePath: string,
|
|
53
|
-
worktreePath: string,
|
|
54
|
-
milestoneId: string,
|
|
55
|
-
) => { synced: string[] };
|
|
56
|
-
captureIntegrationBranch?: (basePath: string, mid: string | undefined) => void;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
/** Shim factory preserving the legacy WorktreeResolver throw shape for tests. */
|
|
60
|
-
function makeResolver(s: AutoSession, deps: LegacyTestDeps) {
|
|
61
|
-
const lifecycle = new WorktreeLifecycle(s, deps);
|
|
62
|
-
return {
|
|
63
|
-
get workPath(): string { return s.basePath; },
|
|
64
|
-
get projectRoot(): string {
|
|
65
|
-
return resolveWorktreeProjectRoot(s.basePath, s.originalBasePath);
|
|
66
|
-
},
|
|
67
|
-
mergeAndExit: (mid: string, ctx: NotifyCtx) => {
|
|
68
|
-
const r = lifecycle.exitMilestone(mid, { merge: true }, ctx);
|
|
69
|
-
if (!r.ok && r.cause instanceof Error) throw r.cause;
|
|
70
|
-
},
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
36
|
|
|
74
37
|
// ─── Helpers ──────────────────────────────────────────────────────────────────
|
|
75
38
|
|
|
@@ -91,97 +54,6 @@ function createTempRepo(t: { after: (fn: () => void) => void }): string {
|
|
|
91
54
|
return dir;
|
|
92
55
|
}
|
|
93
56
|
|
|
94
|
-
function makeSession(overrides?: Partial<{ basePath: string; originalBasePath: string }>): AutoSession {
|
|
95
|
-
const s = new AutoSession();
|
|
96
|
-
s.basePath = overrides?.basePath ?? "/project";
|
|
97
|
-
s.originalBasePath = overrides?.originalBasePath ?? "/project";
|
|
98
|
-
return s;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
interface CallLog { fn: string; args: unknown[] }
|
|
102
|
-
|
|
103
|
-
function makeDeps(overrides?: Partial<LegacyTestDeps>): LegacyTestDeps & { calls: CallLog[] } {
|
|
104
|
-
const calls: CallLog[] = [];
|
|
105
|
-
|
|
106
|
-
const deps: LegacyTestDeps & { calls: CallLog[] } = {
|
|
107
|
-
calls,
|
|
108
|
-
isInAutoWorktree: (basePath: string) => {
|
|
109
|
-
calls.push({ fn: "isInAutoWorktree", args: [basePath] });
|
|
110
|
-
return basePath.includes("worktrees");
|
|
111
|
-
},
|
|
112
|
-
shouldUseWorktreeIsolation: () => true,
|
|
113
|
-
getIsolationMode: () => "worktree",
|
|
114
|
-
mergeMilestoneToMain: (basePath: string, milestoneId: string, roadmapContent: string) => {
|
|
115
|
-
calls.push({ fn: "mergeMilestoneToMain", args: [basePath, milestoneId, roadmapContent] });
|
|
116
|
-
return { pushed: false, codeFilesChanged: true };
|
|
117
|
-
},
|
|
118
|
-
syncWorktreeStateBack: (mainBasePath: string, worktreePath: string, milestoneId: string) => {
|
|
119
|
-
calls.push({ fn: "syncWorktreeStateBack", args: [mainBasePath, worktreePath, milestoneId] });
|
|
120
|
-
return { synced: [] };
|
|
121
|
-
},
|
|
122
|
-
teardownAutoWorktree: (basePath: string, milestoneId: string, opts?: { preserveBranch?: boolean }) => {
|
|
123
|
-
calls.push({ fn: "teardownAutoWorktree", args: [basePath, milestoneId, opts] });
|
|
124
|
-
},
|
|
125
|
-
createAutoWorktree: (basePath: string, milestoneId: string) => {
|
|
126
|
-
calls.push({ fn: "createAutoWorktree", args: [basePath, milestoneId] });
|
|
127
|
-
return `${basePath}/.gsd/worktrees/${milestoneId}`;
|
|
128
|
-
},
|
|
129
|
-
enterAutoWorktree: (basePath: string, milestoneId: string) => {
|
|
130
|
-
calls.push({ fn: "enterAutoWorktree", args: [basePath, milestoneId] });
|
|
131
|
-
return `${basePath}/.gsd/worktrees/${milestoneId}`;
|
|
132
|
-
},
|
|
133
|
-
getAutoWorktreePath: (basePath: string, milestoneId: string) => {
|
|
134
|
-
calls.push({ fn: "getAutoWorktreePath", args: [basePath, milestoneId] });
|
|
135
|
-
return null;
|
|
136
|
-
},
|
|
137
|
-
autoCommitCurrentBranch: (basePath: string, reason: string, milestoneId: string) => {
|
|
138
|
-
calls.push({ fn: "autoCommitCurrentBranch", args: [basePath, reason, milestoneId] });
|
|
139
|
-
},
|
|
140
|
-
getCurrentBranch: (basePath: string) => {
|
|
141
|
-
calls.push({ fn: "getCurrentBranch", args: [basePath] });
|
|
142
|
-
return "main";
|
|
143
|
-
},
|
|
144
|
-
checkoutBranch: (basePath: string, branch: string) => {
|
|
145
|
-
calls.push({ fn: "checkoutBranch", args: [basePath, branch] });
|
|
146
|
-
},
|
|
147
|
-
autoWorktreeBranch: (milestoneId: string) => `milestone/${milestoneId}`,
|
|
148
|
-
resolveMilestoneFile: (basePath: string, milestoneId: string, fileType: string) => {
|
|
149
|
-
calls.push({ fn: "resolveMilestoneFile", args: [basePath, milestoneId, fileType] });
|
|
150
|
-
return null;
|
|
151
|
-
},
|
|
152
|
-
readFileSync: (path: string, _enc: string) => {
|
|
153
|
-
calls.push({ fn: "readFileSync", args: [path] });
|
|
154
|
-
return "# Roadmap\n";
|
|
155
|
-
},
|
|
156
|
-
GitServiceImpl: class {
|
|
157
|
-
constructor(_basePath: string, _gitConfig: unknown) {}
|
|
158
|
-
} as unknown as LegacyTestDeps["GitServiceImpl"],
|
|
159
|
-
loadEffectiveGSDPreferences: () => ({ preferences: { git: {} } }),
|
|
160
|
-
invalidateAllCaches: () => { calls.push({ fn: "invalidateAllCaches", args: [] }); },
|
|
161
|
-
captureIntegrationBranch: (_basePath: string, _mid: string | undefined) => {},
|
|
162
|
-
enterBranchModeForMilestone: (_basePath: string, _milestoneId: string) => {},
|
|
163
|
-
worktreeProjection: new WorktreeStateProjection(),
|
|
164
|
-
...overrides,
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
if (overrides) {
|
|
168
|
-
for (const [key, val] of Object.entries(overrides)) {
|
|
169
|
-
if (key !== "calls") (deps as unknown as Record<string, unknown>)[key] = val;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
return deps;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
function makeNotifyCtx(): NotifyCtx & { messages: Array<{ msg: string; level?: string }> } {
|
|
176
|
-
const messages: Array<{ msg: string; level?: string }> = [];
|
|
177
|
-
return {
|
|
178
|
-
messages,
|
|
179
|
-
notify: (msg: string, level?: "info" | "warning" | "error" | "success") => {
|
|
180
|
-
messages.push({ msg, level });
|
|
181
|
-
},
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
|
|
185
57
|
// ─── Suite 1: getAutoWorktreeOriginalBase() returns realpath-canonical path ──
|
|
186
58
|
|
|
187
59
|
describe("getAutoWorktreeOriginalBase() is realpath-normalised", () => {
|
|
@@ -273,92 +145,15 @@ describe("normalizeWorktreePathForCompare equalises canonical vs non-canonical f
|
|
|
273
145
|
// resolveMilestoneFile call against the "worktree" path that is actually the
|
|
274
146
|
// same directory). The new code correctly skips the fallback.
|
|
275
147
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
const calls: CallLog[] = [];
|
|
289
|
-
const deps = makeDeps({
|
|
290
|
-
// isInAutoWorktree: basePath has trailing slash but is NOT a worktree
|
|
291
|
-
isInAutoWorktree: (basePath: string) => {
|
|
292
|
-
calls.push({ fn: "isInAutoWorktree", args: [basePath] });
|
|
293
|
-
return false;
|
|
294
|
-
},
|
|
295
|
-
// resolveMilestoneFile always returns null (no roadmap found)
|
|
296
|
-
resolveMilestoneFile: (basePath: string, milestoneId: string, fileType: string) => {
|
|
297
|
-
calls.push({ fn: "resolveMilestoneFile", args: [basePath, milestoneId, fileType] });
|
|
298
|
-
return null;
|
|
299
|
-
},
|
|
300
|
-
teardownAutoWorktree: (basePath: string, milestoneId: string, opts?: { preserveBranch?: boolean }) => {
|
|
301
|
-
calls.push({ fn: "teardownAutoWorktree", args: [basePath, milestoneId, opts] });
|
|
302
|
-
},
|
|
303
|
-
});
|
|
304
|
-
|
|
305
|
-
// Override calls ref so we can inspect it directly
|
|
306
|
-
(deps as unknown as { calls: CallLog[] }).calls = calls;
|
|
307
|
-
|
|
308
|
-
const resolver = makeResolver(s, deps);
|
|
309
|
-
const ctx = makeNotifyCtx();
|
|
310
|
-
|
|
311
|
-
// mergeAndExit → _mergeWorktreeMode
|
|
312
|
-
// originalBase = s.originalBasePath = canonicalBase
|
|
313
|
-
// s.basePath = trailingSlashBase — physically same as canonicalBase
|
|
314
|
-
// Post-fix: isSamePath(trailingSlashBase, canonicalBase) is true
|
|
315
|
-
// → roadmap fallback branch is skipped (resolveMilestoneFile called once)
|
|
316
|
-
// Pre-fix (bug): trailingSlashBase !== canonicalBase → fallback entered
|
|
317
|
-
// → resolveMilestoneFile called twice
|
|
318
|
-
|
|
319
|
-
resolver.mergeAndExit("M001", ctx);
|
|
320
|
-
|
|
321
|
-
const rmfCalls = calls.filter(c => c.fn === "resolveMilestoneFile");
|
|
322
|
-
assert.strictEqual(rmfCalls.length, 1,
|
|
323
|
-
"resolveMilestoneFile must be called exactly once — fallback should be skipped when " +
|
|
324
|
-
"s.basePath is the same physical path as originalBase (isSamePath fix)");
|
|
325
|
-
});
|
|
326
|
-
|
|
327
|
-
test("with genuinely different basePath (inside worktree): resolveMilestoneFile called twice", () => {
|
|
328
|
-
// originalBase is the project root
|
|
329
|
-
const projectRoot = "/tmp/m5-test-project";
|
|
330
|
-
// s.basePath is inside a worktree — a physically different path
|
|
331
|
-
const worktreePath = projectRoot + "/.gsd/worktrees/M002";
|
|
332
|
-
|
|
333
|
-
const s = makeSession({
|
|
334
|
-
basePath: worktreePath,
|
|
335
|
-
originalBasePath: projectRoot,
|
|
336
|
-
});
|
|
337
|
-
|
|
338
|
-
const calls: CallLog[] = [];
|
|
339
|
-
const deps = makeDeps({
|
|
340
|
-
isInAutoWorktree: (basePath: string) => {
|
|
341
|
-
calls.push({ fn: "isInAutoWorktree", args: [basePath] });
|
|
342
|
-
return basePath.includes("worktrees");
|
|
343
|
-
},
|
|
344
|
-
resolveMilestoneFile: (basePath: string, milestoneId: string, fileType: string) => {
|
|
345
|
-
calls.push({ fn: "resolveMilestoneFile", args: [basePath, milestoneId, fileType] });
|
|
346
|
-
return null; // no roadmap in either location
|
|
347
|
-
},
|
|
348
|
-
teardownAutoWorktree: (basePath: string, milestoneId: string, opts?: { preserveBranch?: boolean }) => {
|
|
349
|
-
calls.push({ fn: "teardownAutoWorktree", args: [basePath, milestoneId, opts] });
|
|
350
|
-
},
|
|
351
|
-
});
|
|
352
|
-
(deps as unknown as { calls: CallLog[] }).calls = calls;
|
|
353
|
-
|
|
354
|
-
const resolver = makeResolver(s, deps);
|
|
355
|
-
const ctx = makeNotifyCtx();
|
|
356
|
-
|
|
357
|
-
resolver.mergeAndExit("M002", ctx);
|
|
358
|
-
|
|
359
|
-
const rmfCalls = calls.filter(c => c.fn === "resolveMilestoneFile");
|
|
360
|
-
assert.strictEqual(rmfCalls.length, 2,
|
|
361
|
-
"resolveMilestoneFile must be called twice when basePath is a genuine worktree path " +
|
|
362
|
-
"(fallback should run for different physical paths)");
|
|
363
|
-
});
|
|
364
|
-
});
|
|
148
|
+
// ADR-016 phase 2 / C2 + C3 (#5625, #5626): the prior two tests in this
|
|
149
|
+
// suite asserted call counts on `deps.resolveMilestoneFile` /
|
|
150
|
+
// `deps.isInAutoWorktree` / `deps.teardownAutoWorktree` to verify that the
|
|
151
|
+
// roadmap-fallback branch was skipped when basePath was a non-canonical
|
|
152
|
+
// form of originalBase (trailing slash). After C2/C3 those fields are
|
|
153
|
+
// inlined into worktree-lifecycle.ts as direct imports — the mocks no
|
|
154
|
+
// longer fire and the call-count assertions test nothing meaningful. The
|
|
155
|
+
// underlying invariant (isSamePathPhysical normalises trailing slashes,
|
|
156
|
+
// canonical/non-canonical pairs, and case differences) is preserved
|
|
157
|
+
// inside worktree-lifecycle.ts and covered indirectly by the merge-area
|
|
158
|
+
// integration tests, which exercise real worktree merges where the
|
|
159
|
+
// fallback choice matters.
|
|
@@ -1,11 +1,19 @@
|
|
|
1
|
+
// Project/App: GSD-2
|
|
2
|
+
// File Purpose: Regression tests for parallel monitor overlay rendering and input handling.
|
|
3
|
+
|
|
1
4
|
import { describe, it } from "node:test";
|
|
2
|
-
import assert from "node:assert";
|
|
5
|
+
import assert from "node:assert/strict";
|
|
6
|
+
|
|
7
|
+
import { visibleWidth } from "@gsd/pi-tui";
|
|
3
8
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
function assertLinesFit(lines: string[], width: number): void {
|
|
10
|
+
for (const line of lines) {
|
|
11
|
+
assert.ok(
|
|
12
|
+
visibleWidth(line) <= width,
|
|
13
|
+
`line exceeds width ${width}: ${visibleWidth(line)} "${line}"`,
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
9
17
|
|
|
10
18
|
describe("parallel-monitor-overlay", () => {
|
|
11
19
|
it("progressBar generates correct width", async () => {
|
|
@@ -37,6 +45,7 @@ describe("parallel-monitor-overlay", () => {
|
|
|
37
45
|
const lines = overlay.render(80);
|
|
38
46
|
assert.ok(Array.isArray(lines), "render should return an array");
|
|
39
47
|
assert.ok(lines.length > 0, "render should return at least one line");
|
|
48
|
+
assertLinesFit(lines, 80);
|
|
40
49
|
|
|
41
50
|
// Should contain header text
|
|
42
51
|
const joined = lines.join("\n");
|
|
@@ -79,4 +88,27 @@ describe("parallel-monitor-overlay", () => {
|
|
|
79
88
|
assert.equal((overlay as any).scrollOffset, 0, "empty overlays clamp scroll to zero");
|
|
80
89
|
overlay.dispose();
|
|
81
90
|
});
|
|
91
|
+
|
|
92
|
+
it("ParallelMonitorOverlay empty state fits narrow and wide widths", async () => {
|
|
93
|
+
const mod = await import("../parallel-monitor-overlay.js");
|
|
94
|
+
|
|
95
|
+
const mockTui = { requestRender: () => {} };
|
|
96
|
+
const mockTheme = {
|
|
97
|
+
fg: (_color: string, text: string) => text,
|
|
98
|
+
bold: (text: string) => text,
|
|
99
|
+
};
|
|
100
|
+
const overlay = new mod.ParallelMonitorOverlay(
|
|
101
|
+
mockTui,
|
|
102
|
+
mockTheme as any,
|
|
103
|
+
() => {},
|
|
104
|
+
"/nonexistent/path",
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
for (const width of [40, 80, 120]) {
|
|
108
|
+
assertLinesFit(overlay.render(width), width);
|
|
109
|
+
overlay.invalidate();
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
overlay.dispose();
|
|
113
|
+
});
|
|
82
114
|
});
|