gsd-pi 2.76.0-dev.fe143342a → 2.77.0-dev.1d17f366c
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 +17 -35
- package/dist/claude-cli-check.js +32 -3
- package/dist/cli-web-branch.d.ts +1 -0
- package/dist/cli-web-branch.js +3 -0
- package/dist/cli.js +38 -2
- 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-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/loader.js +35 -7
- package/dist/onboarding.js +45 -0
- package/dist/provider-migrations.d.ts +18 -0
- package/dist/provider-migrations.js +14 -0
- package/dist/resources/extensions/claude-code-cli/readiness.js +4 -3
- package/dist/resources/extensions/claude-code-cli/stream-adapter.js +78 -59
- package/dist/resources/extensions/cmux/index.js +20 -0
- package/dist/resources/extensions/github-sync/templates.js +103 -0
- package/dist/resources/extensions/google-search/extension-manifest.json +5 -4
- package/dist/resources/extensions/google-search/index.js +3 -375
- package/dist/resources/extensions/gsd/abandon-detect.js +44 -0
- package/dist/resources/extensions/gsd/auto/loop.js +90 -2
- package/dist/resources/extensions/gsd/auto/phases.js +95 -21
- package/dist/resources/extensions/gsd/auto/resolve.js +24 -0
- package/dist/resources/extensions/gsd/auto/run-unit.js +48 -4
- package/dist/resources/extensions/gsd/auto/session.js +18 -1
- package/dist/resources/extensions/gsd/auto/turn-epoch.js +95 -0
- package/dist/resources/extensions/gsd/auto-dispatch.js +115 -17
- package/dist/resources/extensions/gsd/auto-loop.js +1 -1
- package/dist/resources/extensions/gsd/auto-model-selection.js +1 -1
- package/dist/resources/extensions/gsd/auto-post-unit.js +90 -2
- package/dist/resources/extensions/gsd/auto-prompts.js +14 -0
- package/dist/resources/extensions/gsd/auto-recovery.js +46 -1
- package/dist/resources/extensions/gsd/auto-start.js +45 -39
- 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 +109 -61
- package/dist/resources/extensions/gsd/auto.js +97 -31
- package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +27 -1
- 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/register-hooks.js +17 -6
- package/dist/resources/extensions/gsd/bootstrap/system-context.js +11 -6
- package/dist/resources/extensions/gsd/bootstrap/write-gate.js +34 -2
- package/dist/resources/extensions/gsd/clean-root-preflight.js +93 -0
- 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/commands-prefs-wizard.js +968 -23
- package/dist/resources/extensions/gsd/dispatch-guard.js +29 -3
- 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 +2 -0
- package/dist/resources/extensions/gsd/gsd-db.js +90 -30
- package/dist/resources/extensions/gsd/guided-flow-queue.js +4 -1
- package/dist/resources/extensions/gsd/guided-flow.js +212 -9
- package/dist/resources/extensions/gsd/health-widget.js +4 -1
- package/dist/resources/extensions/gsd/journal.js +17 -2
- package/dist/resources/extensions/gsd/key-manager.js +22 -0
- package/dist/resources/extensions/gsd/milestone-actions.js +15 -0
- package/dist/resources/extensions/gsd/milestone-summary-classifier.js +37 -0
- package/dist/resources/extensions/gsd/model-router.js +36 -3
- package/dist/resources/extensions/gsd/notifications.js +30 -16
- package/dist/resources/extensions/gsd/pre-execution-checks.js +31 -6
- package/dist/resources/extensions/gsd/prompts/discuss-headless.md +29 -2
- package/dist/resources/extensions/gsd/prompts/discuss.md +29 -2
- package/dist/resources/extensions/gsd/prompts/doctor-heal.md +5 -4
- package/dist/resources/extensions/gsd/prompts/parallel-research-slices.md +5 -2
- package/dist/resources/extensions/gsd/prompts/system.md +1 -0
- package/dist/resources/extensions/gsd/reports.js +5 -4
- package/dist/resources/extensions/gsd/safety/evidence-collector.js +96 -0
- package/dist/resources/extensions/gsd/safety/file-change-validator.js +12 -4
- package/dist/resources/extensions/gsd/safety/safety-harness.js +5 -1
- package/dist/resources/extensions/gsd/state-transition-matrix.js +118 -0
- package/dist/resources/extensions/gsd/state.js +25 -25
- package/dist/resources/extensions/gsd/token-counter.js +22 -5
- package/dist/resources/extensions/gsd/tools/complete-milestone.js +16 -10
- 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/uok/dispatch-envelope.js +33 -0
- package/dist/resources/extensions/gsd/uok/execution-graph.js +10 -0
- package/dist/resources/extensions/gsd/uok/gitops.js +2 -1
- package/dist/resources/extensions/gsd/uok/loop-adapter.js +37 -10
- package/dist/resources/extensions/gsd/uok/parity-report.js +58 -0
- package/dist/resources/extensions/gsd/uok/plan-v2.js +30 -7
- package/dist/resources/extensions/gsd/uok/writer.js +82 -0
- package/dist/resources/extensions/gsd/workflow-logger.js +10 -2
- package/dist/resources/extensions/gsd/worktree-manager.js +1 -0
- package/dist/resources/extensions/gsd/worktree-resolver.js +50 -10
- package/dist/resources/extensions/mcp-client/auth.js +10 -1
- package/dist/resources/extensions/mcp-client/index.js +118 -9
- package/dist/resources/extensions/shared/cmux-events.js +12 -0
- package/dist/resources/extensions/shared/rtk-session-stats.js +1 -2
- 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/resources/skills/verify-before-complete/SKILL.md +2 -1
- package/dist/resources/skills/write-docs/SKILL.md +2 -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 +9 -9
- 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/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 +9 -9
- 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-5fc74f13a25fa1bb.js → webpack-2e68521d7c82f7c2.js} +1 -1
- package/dist/welcome-screen.js +6 -1
- package/dist/wizard.js +2 -0
- package/package.json +16 -14
- package/packages/daemon/package.json +2 -2
- 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/remote-questions.d.ts +45 -0
- package/packages/mcp-server/dist/remote-questions.d.ts.map +1 -0
- package/packages/mcp-server/dist/remote-questions.js +732 -0
- package/packages/mcp-server/dist/remote-questions.js.map +1 -0
- package/packages/mcp-server/dist/server.d.ts +7 -0
- package/packages/mcp-server/dist/server.d.ts.map +1 -1
- package/packages/mcp-server/dist/server.js +95 -10
- package/packages/mcp-server/dist/server.js.map +1 -1
- package/packages/mcp-server/dist/session-manager.d.ts +14 -0
- package/packages/mcp-server/dist/session-manager.d.ts.map +1 -1
- package/packages/mcp-server/dist/session-manager.js +49 -1
- package/packages/mcp-server/dist/session-manager.js.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.js +15 -6
- package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
- package/packages/mcp-server/package.json +9 -3
- 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/mcp-server.test.ts +67 -0
- package/packages/mcp-server/src/readers/readers.test.ts +5 -1
- package/packages/mcp-server/src/remote-questions.test.ts +294 -0
- package/packages/mcp-server/src/remote-questions.ts +916 -0
- package/packages/mcp-server/src/server.ts +118 -16
- package/packages/mcp-server/src/session-manager.ts +43 -1
- package/packages/mcp-server/src/workflow-tools.test.ts +44 -0
- package/packages/mcp-server/src/workflow-tools.ts +19 -6
- package/packages/mcp-server/tsconfig.test.json +19 -0
- package/packages/mcp-server/tsconfig.tsbuildinfo +1 -1
- package/packages/native/package.json +6 -1
- package/packages/native/src/__tests__/clipboard.test.mjs +69 -23
- package/packages/native/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-agent-core/package.json +6 -1
- package/packages/pi-agent-core/src/agent-loop.test.ts +220 -15
- package/packages/pi-ai/dist/models/custom.d.ts +38 -0
- package/packages/pi-ai/dist/models/custom.d.ts.map +1 -1
- package/packages/pi-ai/dist/models/custom.js +41 -0
- package/packages/pi-ai/dist/models/custom.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-auth.test.js +1 -1
- package/packages/pi-ai/dist/providers/anthropic-auth.test.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.js +27 -4
- package/packages/pi-ai/dist/providers/anthropic-shared.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.js +8 -3
- package/packages/pi-ai/dist/providers/anthropic.js.map +1 -1
- package/packages/pi-ai/dist/providers/minimax-tool-name.test.d.ts +2 -0
- package/packages/pi-ai/dist/providers/minimax-tool-name.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/minimax-tool-name.test.js +80 -0
- package/packages/pi-ai/dist/providers/minimax-tool-name.test.js.map +1 -0
- package/packages/pi-ai/dist/providers/simple-options.d.ts +10 -0
- package/packages/pi-ai/dist/providers/simple-options.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/simple-options.js +16 -1
- package/packages/pi-ai/dist/providers/simple-options.js.map +1 -1
- package/packages/pi-ai/package.json +6 -1
- package/packages/pi-ai/src/models/custom.ts +42 -0
- package/packages/pi-ai/src/providers/anthropic-auth.test.ts +1 -1
- package/packages/pi-ai/src/providers/anthropic-shared.ts +26 -5
- package/packages/pi-ai/src/providers/anthropic.ts +9 -3
- package/packages/pi-ai/src/providers/minimax-tool-name.test.ts +98 -0
- package/packages/pi-ai/src/providers/simple-options.ts +17 -1
- package/packages/pi-ai/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.js +3 -2
- package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session.js +7 -0
- package/packages/pi-coding-agent/dist/core/agent-session.js.map +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/runner.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/types.d.ts +14 -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/model-registry-custom-caps.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/model-registry-custom-caps.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-registry-custom-caps.test.js +203 -0
- package/packages/pi-coding-agent/dist/core/model-registry-custom-caps.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-registry.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry.js +14 -0
- package/packages/pi-coding-agent/dist/core/model-registry.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/session-manager.js +1 -1
- package/packages/pi-coding-agent/dist/core/session-manager.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/session-manager.test.js +21 -1
- package/packages/pi-coding-agent/dist/core/session-manager.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/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +13 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/packages/pi-coding-agent/package.json +6 -1
- package/packages/pi-coding-agent/src/core/agent-session-abort-order.test.ts +3 -2
- package/packages/pi-coding-agent/src/core/agent-session.ts +11 -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/runner.ts +2 -0
- package/packages/pi-coding-agent/src/core/extensions/types.ts +15 -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/model-registry-custom-caps.test.ts +245 -0
- package/packages/pi-coding-agent/src/core/model-registry.ts +16 -0
- 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/session-manager.test.ts +30 -1
- package/packages/pi-coding-agent/src/core/session-manager.ts +1 -1
- 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/src/modes/interactive/interactive-mode.ts +13 -1
- 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 +21 -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 +6 -1
- package/packages/pi-tui/src/__tests__/autocomplete.test.ts +20 -5
- package/packages/pi-tui/src/__tests__/stdin-buffer.test.ts +27 -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 +6 -1
- package/pkg/package.json +1 -1
- package/scripts/install.js +512 -0
- package/scripts/lib/workspace-manifest.cjs +86 -0
- package/scripts/link-workspace-packages.cjs +5 -17
- package/scripts/postinstall.js +9 -178
- package/src/resources/extensions/claude-code-cli/readiness.ts +4 -3
- package/src/resources/extensions/claude-code-cli/stream-adapter.ts +91 -63
- package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +114 -12
- package/src/resources/extensions/cmux/index.ts +35 -10
- package/src/resources/extensions/github-sync/templates.ts +151 -0
- package/src/resources/extensions/github-sync/tests/templates.test.ts +59 -0
- package/src/resources/extensions/google-search/extension-manifest.json +5 -4
- package/src/resources/extensions/google-search/index.ts +9 -470
- package/src/resources/extensions/gsd/abandon-detect.ts +62 -0
- package/src/resources/extensions/gsd/auto/loop-deps.ts +14 -1
- package/src/resources/extensions/gsd/auto/loop.ts +104 -2
- package/src/resources/extensions/gsd/auto/phases.ts +123 -21
- package/src/resources/extensions/gsd/auto/resolve.ts +29 -0
- package/src/resources/extensions/gsd/auto/run-unit.ts +56 -4
- package/src/resources/extensions/gsd/auto/session.ts +28 -1
- 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 +117 -16
- package/src/resources/extensions/gsd/auto-loop.ts +1 -1
- package/src/resources/extensions/gsd/auto-model-selection.ts +1 -1
- package/src/resources/extensions/gsd/auto-post-unit.ts +92 -3
- package/src/resources/extensions/gsd/auto-prompts.ts +28 -1
- package/src/resources/extensions/gsd/auto-recovery.ts +40 -1
- package/src/resources/extensions/gsd/auto-start.ts +48 -52
- 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 +122 -68
- package/src/resources/extensions/gsd/auto.ts +105 -35
- package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +34 -1
- 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/register-hooks.ts +18 -6
- package/src/resources/extensions/gsd/bootstrap/system-context.ts +13 -9
- package/src/resources/extensions/gsd/bootstrap/write-gate.ts +35 -2
- package/src/resources/extensions/gsd/clean-root-preflight.ts +111 -0
- 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/commands-prefs-wizard.ts +898 -32
- package/src/resources/extensions/gsd/dispatch-guard.ts +26 -2
- 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 +2 -1
- package/src/resources/extensions/gsd/gsd-db.ts +92 -32
- package/src/resources/extensions/gsd/guided-flow-queue.ts +4 -1
- package/src/resources/extensions/gsd/guided-flow.ts +259 -10
- package/src/resources/extensions/gsd/health-widget.ts +3 -1
- package/src/resources/extensions/gsd/journal.ts +29 -3
- package/src/resources/extensions/gsd/key-manager.ts +22 -0
- package/src/resources/extensions/gsd/milestone-actions.ts +18 -0
- package/src/resources/extensions/gsd/milestone-summary-classifier.ts +42 -0
- package/src/resources/extensions/gsd/model-router.ts +42 -1
- package/src/resources/extensions/gsd/notifications.ts +27 -15
- package/src/resources/extensions/gsd/pre-execution-checks.ts +33 -7
- package/src/resources/extensions/gsd/preferences-types.ts +8 -0
- package/src/resources/extensions/gsd/prompts/discuss-headless.md +29 -2
- package/src/resources/extensions/gsd/prompts/discuss.md +29 -2
- package/src/resources/extensions/gsd/prompts/doctor-heal.md +5 -4
- package/src/resources/extensions/gsd/prompts/parallel-research-slices.md +5 -2
- package/src/resources/extensions/gsd/prompts/system.md +1 -0
- package/src/resources/extensions/gsd/reports.ts +5 -4
- package/src/resources/extensions/gsd/safety/evidence-collector.ts +119 -0
- package/src/resources/extensions/gsd/safety/file-change-validator.ts +16 -3
- package/src/resources/extensions/gsd/safety/safety-harness.ts +9 -0
- package/src/resources/extensions/gsd/state-transition-matrix.ts +152 -0
- package/src/resources/extensions/gsd/state.ts +35 -30
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +238 -4
- package/src/resources/extensions/gsd/tests/auto-mode-guards.test.ts +79 -0
- package/src/resources/extensions/gsd/tests/auto-paused-session-validation.test.ts +12 -0
- package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +122 -0
- package/src/resources/extensions/gsd/tests/auto-start-bootstrap-await-3420.test.ts +141 -0
- package/src/resources/extensions/gsd/tests/auto-start-clean-runtime-db-gated.test.ts +63 -0
- package/src/resources/extensions/gsd/tests/auto-wrapup-inflight-guard.test.ts +23 -0
- package/src/resources/extensions/gsd/tests/clean-root-preflight.test.ts +186 -0
- package/src/resources/extensions/gsd/tests/cmux.test.ts +5 -9
- package/src/resources/extensions/gsd/tests/complete-milestone-false-merge.test.ts +15 -0
- package/src/resources/extensions/gsd/tests/complete-milestone.test.ts +61 -1
- package/src/resources/extensions/gsd/tests/complete-slice.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/complete-task.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/custom-engine-loop-integration.test.ts +161 -0
- package/src/resources/extensions/gsd/tests/db-access-guardrails.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/derive-state.test.ts +1 -2
- package/src/resources/extensions/gsd/tests/dispatch-complete-milestone-guard.test.ts +14 -9
- package/src/resources/extensions/gsd/tests/dispatch-guard-summary-db-mismatch.test.ts +77 -0
- package/src/resources/extensions/gsd/tests/dispatch-guard.test.ts +25 -0
- package/src/resources/extensions/gsd/tests/dispatch-missing-task-plans.test.ts +14 -0
- package/src/resources/extensions/gsd/tests/doctor-providers.test.ts +31 -0
- package/src/resources/extensions/gsd/tests/double-merge-guard.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/ensure-db-open.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/escalation.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/exec-history.test.ts +113 -0
- package/src/resources/extensions/gsd/tests/execution-entry-missing-context-4671.test.ts +173 -0
- package/src/resources/extensions/gsd/tests/file-change-validator.test.ts +38 -0
- package/src/resources/extensions/gsd/tests/file-lock.test.ts +86 -12
- package/src/resources/extensions/gsd/tests/google-search-stub.test.ts +131 -0
- package/src/resources/extensions/gsd/tests/gsd-db.test.ts +296 -1
- package/src/resources/extensions/gsd/tests/headless-milestone-parity.test.ts +117 -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 +4 -2
- package/src/resources/extensions/gsd/tests/integration/gitignore-tracked-gsd.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/integration/idle-recovery.test.ts +30 -0
- package/src/resources/extensions/gsd/tests/integration/worktree-e2e.test.ts +11 -0
- package/src/resources/extensions/gsd/tests/issue-4540-regressions.test.ts +288 -0
- package/src/resources/extensions/gsd/tests/journal-integration.test.ts +66 -0
- package/src/resources/extensions/gsd/tests/key-manager.test.ts +2 -0
- package/src/resources/extensions/gsd/tests/mcp-client-security.test.ts +76 -0
- package/src/resources/extensions/gsd/tests/md-importer.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/memory-pressure-stuck-state.test.ts +12 -0
- package/src/resources/extensions/gsd/tests/memory-store.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/milestone-status-authoritative.test.ts +3 -3
- package/src/resources/extensions/gsd/tests/milestone-summary-classifier.test.ts +30 -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-research-dispatch.test.ts +19 -0
- package/src/resources/extensions/gsd/tests/parallel-skill-prompt-integration.test.ts +150 -0
- package/src/resources/extensions/gsd/tests/plan-gate-failed-doctor-heal-hint.test.ts +37 -0
- package/src/resources/extensions/gsd/tests/pre-exec-gate-loop.test.ts +272 -0
- package/src/resources/extensions/gsd/tests/pre-execution-checks.test.ts +337 -0
- package/src/resources/extensions/gsd/tests/prefs-wizard-coverage.test.ts +44 -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/ready-phrase-no-files-4573.test.ts +388 -0
- package/src/resources/extensions/gsd/tests/require-slice-discussion-dispatch.test.ts +170 -0
- package/src/resources/extensions/gsd/tests/restore-tools-after-discuss.test.ts +9 -3
- package/src/resources/extensions/gsd/tests/resume-dispatch-worktree.test.ts +230 -0
- package/src/resources/extensions/gsd/tests/rewrite-docs-abandon-detect.test.ts +195 -0
- package/src/resources/extensions/gsd/tests/safety-harness-false-positives.test.ts +205 -0
- package/src/resources/extensions/gsd/tests/schema-v21-sequence.test.ts +413 -0
- package/src/resources/extensions/gsd/tests/session-start-footer.test.ts +32 -40
- package/src/resources/extensions/gsd/tests/stale-dirlistcache-4648.test.ts +112 -0
- package/src/resources/extensions/gsd/tests/stash-queued-context-files.test.ts +56 -0
- package/src/resources/extensions/gsd/tests/state-machine-full-walkthrough.test.ts +24 -0
- package/src/resources/extensions/gsd/tests/state-transition-matrix.test.ts +44 -0
- package/src/resources/extensions/gsd/tests/stuck-detection-coverage.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/token-counter.test.ts +105 -1
- package/src/resources/extensions/gsd/tests/tool-compatibility.test.ts +107 -0
- 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/uok-contracts.test.ts +51 -0
- package/src/resources/extensions/gsd/tests/uok-execution-graph.test.ts +16 -0
- package/src/resources/extensions/gsd/tests/uok-loop-adapter-writer.test.ts +65 -0
- package/src/resources/extensions/gsd/tests/uok-parity-report.test.ts +42 -0
- package/src/resources/extensions/gsd/tests/uok-plan-v2-wiring.test.ts +42 -2
- package/src/resources/extensions/gsd/tests/uok-writer.test.ts +75 -0
- package/src/resources/extensions/gsd/tests/validate-extension-package.test.ts +168 -0
- package/src/resources/extensions/gsd/tests/validate-milestone.test.ts +138 -5
- package/src/resources/extensions/gsd/tests/workflow-mcp.test.ts +25 -2
- package/src/resources/extensions/gsd/tests/workflow-tool-executors.test.ts +65 -2
- package/src/resources/extensions/gsd/tests/worktree-db.test.ts +35 -0
- package/src/resources/extensions/gsd/tests/worktree-journal-events.test.ts +6 -1
- package/src/resources/extensions/gsd/tests/worktree-resolver.test.ts +78 -5
- package/src/resources/extensions/gsd/tests/write-gate.test.ts +64 -0
- package/src/resources/extensions/gsd/token-counter.ts +22 -5
- package/src/resources/extensions/gsd/tools/complete-milestone.ts +15 -9
- 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/uok/contracts.ts +65 -0
- package/src/resources/extensions/gsd/uok/dispatch-envelope.ts +56 -0
- package/src/resources/extensions/gsd/uok/execution-graph.ts +22 -0
- package/src/resources/extensions/gsd/uok/gitops.ts +6 -1
- package/src/resources/extensions/gsd/uok/loop-adapter.ts +45 -10
- package/src/resources/extensions/gsd/uok/parity-report.ts +84 -0
- package/src/resources/extensions/gsd/uok/plan-v2.ts +39 -8
- package/src/resources/extensions/gsd/uok/writer.ts +113 -0
- package/src/resources/extensions/gsd/workflow-logger.ts +23 -3
- package/src/resources/extensions/gsd/worktree-manager.ts +1 -0
- package/src/resources/extensions/gsd/worktree-resolver.ts +54 -9
- package/src/resources/extensions/mcp-client/auth.ts +12 -1
- package/src/resources/extensions/mcp-client/index.ts +129 -10
- package/src/resources/extensions/shared/cmux-events.ts +59 -0
- package/src/resources/extensions/shared/rtk-session-stats.ts +1 -2
- 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/src/resources/skills/verify-before-complete/SKILL.md +2 -1
- package/src/resources/skills/write-docs/SKILL.md +2 -1
- package/dist/web/standalone/.next/server/chunks/7461.js +0 -1
- package/dist/web/standalone/.next/static/chunks/2826.e59e8578e2e28639.js +0 -9
- /package/dist/web/standalone/.next/static/{n21VtX2hZlkpdEUO_nU4z → vidAVJkURvTJ0_V2-64ro}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{n21VtX2hZlkpdEUO_nU4z → vidAVJkURvTJ0_V2-64ro}/_ssgManifest.js +0 -0
|
@@ -61,7 +61,9 @@ import { restoreHookState, resetHookState } from "./post-unit-hooks.js";
|
|
|
61
61
|
import { resetProactiveHealing, setLevelChangeCallback } from "./doctor-proactive.js";
|
|
62
62
|
import { snapshotSkills } from "./skill-discovery.js";
|
|
63
63
|
import { isDbAvailable, getMilestone, openDatabase, getDbStatus } from "./gsd-db.js";
|
|
64
|
-
import {
|
|
64
|
+
import { isClosedStatus } from "./status-guards.js";
|
|
65
|
+
import { classifyMilestoneSummaryContent } from "./milestone-summary-classifier.js";
|
|
66
|
+
|
|
65
67
|
import {
|
|
66
68
|
debugLog,
|
|
67
69
|
enableDebug,
|
|
@@ -74,6 +76,7 @@ import type { AutoSession } from "./auto/session.js";
|
|
|
74
76
|
import {
|
|
75
77
|
existsSync,
|
|
76
78
|
mkdirSync,
|
|
79
|
+
readFileSync,
|
|
77
80
|
readdirSync,
|
|
78
81
|
rmSync,
|
|
79
82
|
statSync,
|
|
@@ -419,16 +422,35 @@ export async function bootstrapAutoSession(
|
|
|
419
422
|
// Invalidate caches before initial state derivation
|
|
420
423
|
invalidateAllCaches();
|
|
421
424
|
|
|
422
|
-
// Clean stale runtime unit files for completed milestones (#887)
|
|
423
|
-
cleanStaleRuntimeUnits(
|
|
424
|
-
gsdRoot(base),
|
|
425
|
-
(mid) => !!resolveMilestoneFile(base, mid, "SUMMARY"),
|
|
426
|
-
);
|
|
427
|
-
|
|
428
425
|
// Open the project-root DB before deriveState so DB-backed state
|
|
429
426
|
// derivation (queue-order, task status) works on a cold start (#2841).
|
|
427
|
+
// Must happen before cleanStaleRuntimeUnits so the cleanup predicate can
|
|
428
|
+
// consult DB status and avoid clearing runtime units for milestones that
|
|
429
|
+
// only have a failure-path SUMMARY on disk (#4663).
|
|
430
430
|
await openProjectDbIfPresent(base);
|
|
431
431
|
|
|
432
|
+
// Clean stale runtime unit files for completed milestones (#887).
|
|
433
|
+
// DB-authoritative: when DB is available, require DB status to be closed
|
|
434
|
+
// before clearing runtime units. A SUMMARY file alone is no longer
|
|
435
|
+
// trusted as proof of completion (#4663). Fall back to SUMMARY-file
|
|
436
|
+
// presence only when DB is unavailable (legacy/pre-migration).
|
|
437
|
+
cleanStaleRuntimeUnits(
|
|
438
|
+
gsdRoot(base),
|
|
439
|
+
(mid) => {
|
|
440
|
+
if (isDbAvailable()) {
|
|
441
|
+
const row = getMilestone(mid);
|
|
442
|
+
return !!row && isClosedStatus(row.status);
|
|
443
|
+
}
|
|
444
|
+
const summaryFile = resolveMilestoneFile(base, mid, "SUMMARY");
|
|
445
|
+
if (!summaryFile) return false;
|
|
446
|
+
try {
|
|
447
|
+
return classifyMilestoneSummaryContent(readFileSync(summaryFile, "utf-8")) !== "failure";
|
|
448
|
+
} catch {
|
|
449
|
+
return false;
|
|
450
|
+
}
|
|
451
|
+
},
|
|
452
|
+
);
|
|
453
|
+
|
|
432
454
|
// ── Orphaned milestone branch audit ──
|
|
433
455
|
// Catches completed milestones whose teardown (merge + branch delete)
|
|
434
456
|
// was lost due to session ending between completion and teardown.
|
|
@@ -553,37 +575,15 @@ export async function bootstrapAutoSession(
|
|
|
553
575
|
const { showSmartEntry } = await import("./guided-flow.js");
|
|
554
576
|
await showSmartEntry(ctx, pi, base, { step: requestedStepMode });
|
|
555
577
|
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
} else if (
|
|
566
|
-
postState.activeMilestone &&
|
|
567
|
-
postState.phase === "pre-planning"
|
|
568
|
-
) {
|
|
569
|
-
const contextFile = resolveMilestoneFile(
|
|
570
|
-
base,
|
|
571
|
-
postState.activeMilestone.id,
|
|
572
|
-
"CONTEXT",
|
|
573
|
-
);
|
|
574
|
-
const hasContext = !!(contextFile && (await loadFile(contextFile)));
|
|
575
|
-
if (hasContext) {
|
|
576
|
-
state = postState;
|
|
577
|
-
} else {
|
|
578
|
-
ctx.ui.notify(
|
|
579
|
-
"Discussion completed but no milestone context was written. Run /gsd to try the discussion again, or /gsd auto after creating the milestone manually.",
|
|
580
|
-
"warning",
|
|
581
|
-
);
|
|
582
|
-
return releaseLockAndReturn();
|
|
583
|
-
}
|
|
584
|
-
} else {
|
|
585
|
-
return releaseLockAndReturn();
|
|
586
|
-
}
|
|
578
|
+
// showSmartEntry dispatches via pi.sendMessage() which is fire-and-forget:
|
|
579
|
+
// it queues the message and returns immediately, before the LLM turn runs.
|
|
580
|
+
// Checking postState here would always see the pre-dispatch state, causing
|
|
581
|
+
// the premature "Discussion completed but..." warning (#3420).
|
|
582
|
+
//
|
|
583
|
+
// checkAutoStartAfterDiscuss (in guided-flow.ts) already handles re-entering
|
|
584
|
+
// auto-mode by calling startAutoDetached after the discussion completes.
|
|
585
|
+
// Release the lock and let the async dispatch proceed.
|
|
586
|
+
return releaseLockAndReturn();
|
|
587
587
|
}
|
|
588
588
|
|
|
589
589
|
// Active milestone exists but has no roadmap
|
|
@@ -595,17 +595,16 @@ export async function bootstrapAutoSession(
|
|
|
595
595
|
const { showSmartEntry } = await import("./guided-flow.js");
|
|
596
596
|
await showSmartEntry(ctx, pi, base, { step: requestedStepMode });
|
|
597
597
|
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
}
|
|
598
|
+
// showSmartEntry dispatches via pi.sendMessage() which is fire-and-forget:
|
|
599
|
+
// it queues the message and returns immediately, before the LLM turn runs.
|
|
600
|
+
// Checking postState here fires before the LLM has had a turn, so the
|
|
601
|
+
// pre-planning phase would still appear unchanged and a premature warning
|
|
602
|
+
// would be emitted (#3420).
|
|
603
|
+
//
|
|
604
|
+
// checkAutoStartAfterDiscuss (in guided-flow.ts) already handles re-entering
|
|
605
|
+
// auto-mode by calling startAutoDetached after the discussion completes.
|
|
606
|
+
// Release the lock and let the async dispatch proceed.
|
|
607
|
+
return releaseLockAndReturn();
|
|
609
608
|
}
|
|
610
609
|
}
|
|
611
610
|
|
|
@@ -824,9 +823,6 @@ export async function bootstrapAutoSession(
|
|
|
824
823
|
}
|
|
825
824
|
|
|
826
825
|
ctx.ui.setStatus("gsd-auto", s.stepMode ? "next" : "auto");
|
|
827
|
-
ctx.ui.setFooter(hideFooter);
|
|
828
|
-
// Hide gsd-health during AUTO — gsd-progress is the single source of truth
|
|
829
|
-
// for last-commit / cost / health signal while auto is running.
|
|
830
826
|
ctx.ui.setWidget("gsd-health", undefined);
|
|
831
827
|
const modeLabel = s.stepMode ? "Step-mode" : "Auto-mode";
|
|
832
828
|
const pendingCount = (state.registry ?? []).filter(
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
} from "./auto-recovery.js";
|
|
19
19
|
import { existsSync } from "node:fs";
|
|
20
20
|
|
|
21
|
-
import {
|
|
21
|
+
import { bumpAndResolveSynthetic } from "./auto/resolve.js";
|
|
22
22
|
|
|
23
23
|
export interface RecoveryContext {
|
|
24
24
|
basePath: string;
|
|
@@ -35,6 +35,13 @@ export async function recoverTimedOutUnit(
|
|
|
35
35
|
reason: "idle" | "hard",
|
|
36
36
|
rctx: RecoveryContext,
|
|
37
37
|
): Promise<"recovered" | "paused"> {
|
|
38
|
+
// Note on turn epoch: the bump is intentionally NOT unconditional at
|
|
39
|
+
// function entry. Two branches below (the "steering retry" paths) keep
|
|
40
|
+
// the same LLM turn alive and let it try again — they must NOT bump,
|
|
41
|
+
// otherwise the retry's legitimate writes get marked stale and drop.
|
|
42
|
+
// Each advance branch calls `bumpAndResolveSynthetic` to bump+resolve
|
|
43
|
+
// atomically. Search for that helper to find all supersede sites.
|
|
44
|
+
|
|
38
45
|
const { basePath, verbose, currentUnitStartedAt, unitRecoveryCount } = rctx;
|
|
39
46
|
|
|
40
47
|
const runtime = readUnitRuntimeRecord(basePath, unitType, unitId);
|
|
@@ -74,7 +81,7 @@ export async function recoverTimedOutUnit(
|
|
|
74
81
|
"info",
|
|
75
82
|
);
|
|
76
83
|
unitRecoveryCount.delete(recoveryKey);
|
|
77
|
-
|
|
84
|
+
bumpAndResolveSynthetic(`timeout-recovery:${reason}:${unitType}/${unitId}`);
|
|
78
85
|
return "recovered";
|
|
79
86
|
}
|
|
80
87
|
|
|
@@ -145,7 +152,7 @@ export async function recoverTimedOutUnit(
|
|
|
145
152
|
"warning",
|
|
146
153
|
);
|
|
147
154
|
unitRecoveryCount.delete(recoveryKey);
|
|
148
|
-
|
|
155
|
+
bumpAndResolveSynthetic(`timeout-recovery:${reason}:${unitType}/${unitId}`);
|
|
149
156
|
return "recovered";
|
|
150
157
|
}
|
|
151
158
|
|
|
@@ -179,7 +186,7 @@ export async function recoverTimedOutUnit(
|
|
|
179
186
|
"info",
|
|
180
187
|
);
|
|
181
188
|
unitRecoveryCount.delete(recoveryKey);
|
|
182
|
-
|
|
189
|
+
bumpAndResolveSynthetic(`timeout-recovery:${reason}:${unitType}/${unitId}`);
|
|
183
190
|
return "recovered";
|
|
184
191
|
}
|
|
185
192
|
|
|
@@ -265,7 +272,7 @@ export async function recoverTimedOutUnit(
|
|
|
265
272
|
"warning",
|
|
266
273
|
);
|
|
267
274
|
unitRecoveryCount.delete(recoveryKey);
|
|
268
|
-
|
|
275
|
+
bumpAndResolveSynthetic(`timeout-recovery:${reason}:${unitType}/${unitId}`);
|
|
269
276
|
return "recovered";
|
|
270
277
|
}
|
|
271
278
|
|
|
@@ -45,9 +45,20 @@ export async function closeoutUnit(
|
|
|
45
45
|
const { buildMemoryLLMCall, extractMemoriesFromUnit } = await import('./memory-extractor.js');
|
|
46
46
|
const llmCallFn = buildMemoryLLMCall(ctx);
|
|
47
47
|
if (llmCallFn) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
// Awaited: a fire-and-forget here lets memory-extractor writes land in
|
|
49
|
+
// .gsd/ after closeoutUnit returns but before the milestone merge
|
|
50
|
+
// runs, which made the working tree appear dirty to `git merge
|
|
51
|
+
// --squash` (root cause class of #4704). Completion latency is now
|
|
52
|
+
// bounded by the extractor's LLM call, which is the acceptable price
|
|
53
|
+
// for not racing the merge boundary.
|
|
54
|
+
try {
|
|
55
|
+
await extractMemoriesFromUnit(activityFile, unitType, unitId, llmCallFn);
|
|
56
|
+
} catch (err) {
|
|
57
|
+
logWarning(
|
|
58
|
+
"engine",
|
|
59
|
+
`memory extraction failed for ${unitType}/${unitId}: ${(err as Error).message}`,
|
|
60
|
+
);
|
|
61
|
+
}
|
|
51
62
|
}
|
|
52
63
|
} catch (err) { /* non-fatal */
|
|
53
64
|
logWarning("engine", `operation failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
@@ -26,6 +26,9 @@ import {
|
|
|
26
26
|
isDbAvailable,
|
|
27
27
|
getMilestone,
|
|
28
28
|
getMilestoneSlices,
|
|
29
|
+
closeDatabase,
|
|
30
|
+
openDatabase,
|
|
31
|
+
getDbPath,
|
|
29
32
|
} from "./gsd-db.js";
|
|
30
33
|
import { atomicWriteSync } from "./atomic-write.js";
|
|
31
34
|
import { execFileSync } from "node:child_process";
|
|
@@ -238,14 +241,6 @@ function clearProjectRootStateFiles(basePath: string, milestoneId: string): void
|
|
|
238
241
|
}
|
|
239
242
|
}
|
|
240
243
|
|
|
241
|
-
function isProjectGsdSymlink(basePath: string): boolean {
|
|
242
|
-
try {
|
|
243
|
-
return lstatSyncFn(join(basePath, ".gsd")).isSymbolicLink();
|
|
244
|
-
} catch {
|
|
245
|
-
return false;
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
|
|
249
244
|
// ─── Build Artifact Auto-Resolve ─────────────────────────────────────────────
|
|
250
245
|
|
|
251
246
|
/** Patterns for machine-generated build artifacts that can be safely
|
|
@@ -1664,73 +1659,63 @@ export function mergeMilestoneToMain(
|
|
|
1664
1659
|
}
|
|
1665
1660
|
}
|
|
1666
1661
|
|
|
1667
|
-
// 7.
|
|
1668
|
-
// blocked by unrelated local changes (#2151). clearProjectRootStateFiles
|
|
1669
|
-
// only removes untracked .gsd/ files; tracked dirty files elsewhere (e.g.
|
|
1670
|
-
// .planning/work-state.json with stash conflict markers) are invisible to
|
|
1671
|
-
// that cleanup but will cause `git merge --squash` to reject.
|
|
1672
|
-
let stashed = false;
|
|
1673
|
-
try {
|
|
1674
|
-
const status = execFileSync("git", ["status", "--porcelain"], {
|
|
1675
|
-
cwd: originalBasePath_,
|
|
1676
|
-
stdio: ["ignore", "pipe", "pipe"],
|
|
1677
|
-
encoding: "utf-8",
|
|
1678
|
-
}).trim();
|
|
1679
|
-
if (status) {
|
|
1680
|
-
// Use --include-untracked to stash untracked files that would block
|
|
1681
|
-
// the squash merge, but EXCLUDE .gsd/milestones/ (#2505).
|
|
1682
|
-
// --include-untracked without exclusion sweeps queued milestone
|
|
1683
|
-
// CONTEXT files into the stash. If stash pop later fails, those files
|
|
1684
|
-
// are permanently trapped in the stash entry and lost on the next
|
|
1685
|
-
// stash push or drop.
|
|
1686
|
-
//
|
|
1687
|
-
// When `.gsd` itself is a symlink, Git rejects pathspecs below it
|
|
1688
|
-
// ("beyond a symbolic link"). In that layout, exclude the whole symlink
|
|
1689
|
-
// and keep stashing real project files that could block the merge.
|
|
1690
|
-
const stashPathspecs = isProjectGsdSymlink(originalBasePath_)
|
|
1691
|
-
? [".", ":(exclude).gsd"]
|
|
1692
|
-
: [":(exclude).gsd/milestones"];
|
|
1693
|
-
execFileSync(
|
|
1694
|
-
"git",
|
|
1695
|
-
[
|
|
1696
|
-
"stash", "push", "--include-untracked",
|
|
1697
|
-
"-m", `gsd: pre-merge stash for ${milestoneId}`,
|
|
1698
|
-
"--", ...stashPathspecs,
|
|
1699
|
-
],
|
|
1700
|
-
{ cwd: originalBasePath_, stdio: ["ignore", "pipe", "pipe"], encoding: "utf-8" },
|
|
1701
|
-
);
|
|
1702
|
-
stashed = true;
|
|
1703
|
-
}
|
|
1704
|
-
} catch (err) {
|
|
1705
|
-
// Stash failure is non-fatal — proceed without stash and let the merge
|
|
1706
|
-
// report the dirty tree if it fails.
|
|
1707
|
-
logWarning("worktree", `git stash failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
1708
|
-
}
|
|
1709
|
-
|
|
1710
|
-
// 7a. Shelter queued milestone directories before the squash merge (#2505).
|
|
1662
|
+
// 7. Shelter queued milestone directories before the squash merge (#2505).
|
|
1711
1663
|
// The milestone branch may contain copies of queued milestone dirs (via
|
|
1712
1664
|
// copyPlanningArtifacts), so `git merge --squash` rejects when those same
|
|
1713
1665
|
// files exist as untracked in the working tree. Temporarily move them to
|
|
1714
1666
|
// a backup location, then restore after the merge+commit.
|
|
1667
|
+
//
|
|
1668
|
+
// MUST run BEFORE the pre-merge stash (step 7a) so `--include-untracked`
|
|
1669
|
+
// does not sweep queued CONTEXT files into the stash. If stash pop later
|
|
1670
|
+
// fails, files trapped inside the stash are permanently lost (#2505).
|
|
1715
1671
|
const milestonesDir = join(gsdRoot(originalBasePath_), "milestones");
|
|
1716
1672
|
const shelterDir = join(gsdRoot(originalBasePath_), ".milestone-shelter");
|
|
1717
1673
|
const shelteredDirs: string[] = [];
|
|
1674
|
+
let shelterRestored = false;
|
|
1718
1675
|
|
|
1719
1676
|
// Helper: restore sheltered milestone directories (#2505).
|
|
1720
1677
|
// Called on both success and error paths to ensure queued CONTEXT files
|
|
1721
|
-
// are never permanently lost.
|
|
1678
|
+
// are never permanently lost. Idempotent — the error path may fire after
|
|
1679
|
+
// the success path has already restored and removed the shelter dir; a
|
|
1680
|
+
// second call is a no-op instead of logging a misleading "shelter restore
|
|
1681
|
+
// failed: ENOENT" error for shelter sources that were cleaned up legitimately.
|
|
1722
1682
|
const restoreShelter = (): void => {
|
|
1683
|
+
if (shelterRestored) return;
|
|
1684
|
+
shelterRestored = true;
|
|
1723
1685
|
if (shelteredDirs.length === 0) return;
|
|
1686
|
+
let restoreFailed = false;
|
|
1724
1687
|
for (const dirName of shelteredDirs) {
|
|
1688
|
+
const src = join(shelterDir, dirName);
|
|
1689
|
+
// If the shelter source is missing the restore cannot proceed for this
|
|
1690
|
+
// entry. Distinguish "legitimately missing" (shelter dir removed by a
|
|
1691
|
+
// prior successful restore or never copied) from a surprising ENOENT
|
|
1692
|
+
// inside an otherwise-populated shelter.
|
|
1693
|
+
if (!existsSync(src)) {
|
|
1694
|
+
logWarning(
|
|
1695
|
+
"worktree",
|
|
1696
|
+
`shelter source missing for ${dirName}; skipping restore (shelter already cleaned or entry never staged)`,
|
|
1697
|
+
);
|
|
1698
|
+
continue;
|
|
1699
|
+
}
|
|
1725
1700
|
try {
|
|
1726
1701
|
mkdirSync(milestonesDir, { recursive: true });
|
|
1727
|
-
cpSync(
|
|
1702
|
+
cpSync(src, join(milestonesDir, dirName), { recursive: true, force: true });
|
|
1728
1703
|
} catch (err) { /* best-effort */
|
|
1729
|
-
|
|
1704
|
+
restoreFailed = true;
|
|
1705
|
+
logError("worktree", `shelter restore failed (${dirName}): ${err instanceof Error ? err.message : String(err)}`);
|
|
1730
1706
|
}
|
|
1731
1707
|
}
|
|
1732
|
-
|
|
1733
|
-
|
|
1708
|
+
// Preserve the shelter if any per-entry restore failed — it is the only
|
|
1709
|
+
// surviving copy of the queued milestone dirs (sources were deleted during
|
|
1710
|
+
// shelter). Deleting it here would permanently lose those files (#2505).
|
|
1711
|
+
if (restoreFailed) {
|
|
1712
|
+
logWarning("worktree", `shelter retained at ${shelterDir} — manual recovery required for unrestored entries`);
|
|
1713
|
+
return;
|
|
1714
|
+
}
|
|
1715
|
+
if (existsSync(shelterDir)) {
|
|
1716
|
+
try { rmSync(shelterDir, { recursive: true, force: true }); } catch (err) { /* best-effort */
|
|
1717
|
+
logWarning("worktree", `shelter cleanup failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
1718
|
+
}
|
|
1734
1719
|
}
|
|
1735
1720
|
};
|
|
1736
1721
|
|
|
@@ -1759,6 +1744,58 @@ export function mergeMilestoneToMain(
|
|
|
1759
1744
|
logWarning("worktree", `milestone shelter operation failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
1760
1745
|
}
|
|
1761
1746
|
|
|
1747
|
+
// 7a. Stash pre-existing dirty files so the squash merge is not blocked by
|
|
1748
|
+
// unrelated local changes (#2151). Includes untracked files to handle
|
|
1749
|
+
// locally-added files that conflict with tracked files on the milestone
|
|
1750
|
+
// branch. Passing NO pathspec lets git skip gitignored paths silently;
|
|
1751
|
+
// adding an explicit pathspec trips a `git add`-style fatal on ignored
|
|
1752
|
+
// entries (e.g. a gitignored `.gsd` symlink under ADR-002) (#4573).
|
|
1753
|
+
// Queued CONTEXT files under `.gsd/milestones/*` are already sheltered
|
|
1754
|
+
// in step 7 above, so they won't be swept into the stash.
|
|
1755
|
+
// On Windows, SQLite holds mandatory file locks on the gsd.db WAL/SHM
|
|
1756
|
+
// sidecars while the connection is open. `git stash --include-untracked`
|
|
1757
|
+
// walks those files and fails with EBUSY (#4704). Close the DB before
|
|
1758
|
+
// stashing so Windows releases the handles; reopen after. No-op on
|
|
1759
|
+
// POSIX, where advisory locks don't block git.
|
|
1760
|
+
const needsDbCycle = process.platform === "win32" && isDbAvailable();
|
|
1761
|
+
const dbPathToReopen = needsDbCycle ? getDbPath() : null;
|
|
1762
|
+
if (needsDbCycle) {
|
|
1763
|
+
try {
|
|
1764
|
+
closeDatabase();
|
|
1765
|
+
} catch (err) {
|
|
1766
|
+
logWarning("worktree", `pre-stash db close failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
1767
|
+
}
|
|
1768
|
+
}
|
|
1769
|
+
|
|
1770
|
+
let stashed = false;
|
|
1771
|
+
try {
|
|
1772
|
+
const status = execFileSync("git", ["status", "--porcelain"], {
|
|
1773
|
+
cwd: originalBasePath_,
|
|
1774
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
1775
|
+
encoding: "utf-8",
|
|
1776
|
+
}).trim();
|
|
1777
|
+
if (status) {
|
|
1778
|
+
execFileSync(
|
|
1779
|
+
"git",
|
|
1780
|
+
["stash", "push", "--include-untracked", "-m", `gsd: pre-merge stash for ${milestoneId}`],
|
|
1781
|
+
{ cwd: originalBasePath_, stdio: ["ignore", "pipe", "pipe"], encoding: "utf-8" },
|
|
1782
|
+
);
|
|
1783
|
+
stashed = true;
|
|
1784
|
+
}
|
|
1785
|
+
} catch (err) {
|
|
1786
|
+
// Stash failure is non-fatal — proceed without stash and let the merge
|
|
1787
|
+
// report the dirty tree if it fails.
|
|
1788
|
+
logWarning("worktree", `git stash failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
1789
|
+
}
|
|
1790
|
+
|
|
1791
|
+
if (needsDbCycle && dbPathToReopen) {
|
|
1792
|
+
try {
|
|
1793
|
+
openDatabase(dbPathToReopen);
|
|
1794
|
+
} catch (err) {
|
|
1795
|
+
logWarning("worktree", `post-stash db reopen failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
1796
|
+
}
|
|
1797
|
+
}
|
|
1798
|
+
|
|
1762
1799
|
// 7b. Clean up stale merge state before attempting squash merge (#2912).
|
|
1763
1800
|
// A leftover MERGE_HEAD (from a previous failed merge, libgit2 native path,
|
|
1764
1801
|
// or interrupted operation) causes `git merge --squash` to refuse with
|
|
@@ -2012,21 +2049,38 @@ export function mergeMilestoneToMain(
|
|
|
2012
2049
|
// When a milestone only produced .gsd/ metadata (summaries, roadmaps) but no
|
|
2013
2050
|
// real code, the user sees "milestone complete" but nothing changed in their
|
|
2014
2051
|
// codebase. Surface this so the caller can warn the user.
|
|
2052
|
+
//
|
|
2053
|
+
// Bug #4385 fix: use `git diff-tree --root` instead of `git diff HEAD~1 HEAD`.
|
|
2054
|
+
// `HEAD~1` does not exist on initial commits and is unreliable on shallow clones
|
|
2055
|
+
// and merge commits. `diff-tree --root` handles all three cases correctly.
|
|
2056
|
+
// The empty-tree hash (4b825dc…) is the universal fallback for refs that don't exist.
|
|
2057
|
+
const GIT_EMPTY_TREE = "4b825dc642cb6eb9a060e54bf8d69288fbee4904";
|
|
2015
2058
|
let codeFilesChanged = false;
|
|
2016
2059
|
if (!nothingToCommit) {
|
|
2017
2060
|
try {
|
|
2018
|
-
const
|
|
2019
|
-
|
|
2020
|
-
"HEAD
|
|
2021
|
-
"
|
|
2022
|
-
);
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
);
|
|
2061
|
+
const diffTreeOutput = execFileSync(
|
|
2062
|
+
"git",
|
|
2063
|
+
["diff-tree", "--root", "--no-commit-id", "-r", "--name-only", "HEAD"],
|
|
2064
|
+
{ cwd: originalBasePath_, stdio: ["ignore", "pipe", "pipe"], encoding: "utf-8" },
|
|
2065
|
+
).trim();
|
|
2066
|
+
const mergedFiles = diffTreeOutput ? diffTreeOutput.split("\n").filter(Boolean) : [];
|
|
2067
|
+
codeFilesChanged = mergedFiles.some((f) => !f.startsWith(".gsd/"));
|
|
2026
2068
|
} catch (e) {
|
|
2027
|
-
//
|
|
2028
|
-
|
|
2029
|
-
|
|
2069
|
+
// diff-tree failed (e.g. unborn HEAD in a brand-new repo) — fall back to
|
|
2070
|
+
// comparing against the empty tree so initial-commit repos still report changes.
|
|
2071
|
+
try {
|
|
2072
|
+
const fallbackOutput = execFileSync(
|
|
2073
|
+
"git",
|
|
2074
|
+
["diff", "--name-only", GIT_EMPTY_TREE, "HEAD"],
|
|
2075
|
+
{ cwd: originalBasePath_, stdio: ["ignore", "pipe", "pipe"], encoding: "utf-8" },
|
|
2076
|
+
).trim();
|
|
2077
|
+
const fallbackFiles = fallbackOutput ? fallbackOutput.split("\n").filter(Boolean) : [];
|
|
2078
|
+
codeFilesChanged = fallbackFiles.some((f) => !f.startsWith(".gsd/"));
|
|
2079
|
+
} catch {
|
|
2080
|
+
// Truly unable to determine — assume code was changed to avoid silent data loss
|
|
2081
|
+
logWarning("worktree", `diff-tree and empty-tree fallback both failed (assuming code changed): ${(e as Error).message}`);
|
|
2082
|
+
codeFilesChanged = true;
|
|
2083
|
+
}
|
|
2030
2084
|
}
|
|
2031
2085
|
}
|
|
2032
2086
|
|