@opengsd/gsd-pi 1.1.1-dev.154fd443 → 1.1.1-dev.1854a79a

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.
Files changed (169) hide show
  1. package/dist/project-sessions.js +4 -2
  2. package/dist/resources/.managed-resources-content-hash +1 -1
  3. package/dist/resources/extensions/browser-tools/index.js +39 -22
  4. package/dist/resources/extensions/browser-tools/state.js +12 -0
  5. package/dist/resources/extensions/browser-tools/tools/session.js +3 -2
  6. package/dist/resources/extensions/browser-tools/utils.js +3 -3
  7. package/dist/resources/extensions/claude-code-cli/stream-adapter.js +17 -9
  8. package/dist/resources/extensions/gsd/auto/contracts.js +8 -1
  9. package/dist/resources/extensions/gsd/auto/orchestrator.js +659 -57
  10. package/dist/resources/extensions/gsd/auto-prompts.js +14 -1
  11. package/dist/resources/extensions/gsd/auto-runtime-state.js +3 -0
  12. package/dist/resources/extensions/gsd/auto-tool-tracking.js +5 -0
  13. package/dist/resources/extensions/gsd/auto-unit-tool-scope.js +29 -0
  14. package/dist/resources/extensions/gsd/auto.js +62 -464
  15. package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +2 -1
  16. package/dist/resources/extensions/gsd/debug-logger.js +10 -0
  17. package/dist/resources/extensions/gsd/doctor-proactive.js +7 -2
  18. package/dist/resources/extensions/gsd/markdown-renderer.js +31 -32
  19. package/dist/resources/extensions/gsd/mcp-filter.js +6 -0
  20. package/dist/resources/extensions/gsd/native-git-bridge.js +9 -0
  21. package/dist/resources/extensions/gsd/prompts/plan-slice.md +1 -1
  22. package/dist/resources/extensions/gsd/schemas/parsers.js +6 -1
  23. package/dist/resources/extensions/gsd/state-reconciliation/drift/artifact-db.js +21 -1
  24. package/dist/resources/extensions/gsd/tools/workflow-tool-executors.js +169 -20
  25. package/dist/web/standalone/.next/BUILD_ID +1 -1
  26. package/dist/web/standalone/.next/app-path-routes-manifest.json +6 -6
  27. package/dist/web/standalone/.next/build-manifest.json +2 -2
  28. package/dist/web/standalone/.next/prerender-manifest.json +3 -3
  29. package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
  30. package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
  31. package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  32. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  33. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  34. package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  35. package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  36. package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  37. package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
  38. package/dist/web/standalone/.next/server/app/_not-found.rsc +1 -1
  39. package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  40. package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  41. package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  42. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  43. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  44. package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  45. package/dist/web/standalone/.next/server/app/api/boot/route.js.nft.json +1 -1
  46. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js.nft.json +1 -1
  47. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js.nft.json +1 -1
  48. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js.nft.json +1 -1
  49. package/dist/web/standalone/.next/server/app/api/captures/route.js.nft.json +1 -1
  50. package/dist/web/standalone/.next/server/app/api/cleanup/route.js.nft.json +1 -1
  51. package/dist/web/standalone/.next/server/app/api/doctor/route.js.nft.json +1 -1
  52. package/dist/web/standalone/.next/server/app/api/export-data/route.js.nft.json +1 -1
  53. package/dist/web/standalone/.next/server/app/api/files/route.js.nft.json +1 -1
  54. package/dist/web/standalone/.next/server/app/api/forensics/route.js.nft.json +1 -1
  55. package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
  56. package/dist/web/standalone/.next/server/app/api/git/route.js.nft.json +1 -1
  57. package/dist/web/standalone/.next/server/app/api/history/route.js.nft.json +1 -1
  58. package/dist/web/standalone/.next/server/app/api/hooks/route.js.nft.json +1 -1
  59. package/dist/web/standalone/.next/server/app/api/inspect/route.js.nft.json +1 -1
  60. package/dist/web/standalone/.next/server/app/api/knowledge/route.js.nft.json +1 -1
  61. package/dist/web/standalone/.next/server/app/api/live-state/route.js.nft.json +1 -1
  62. package/dist/web/standalone/.next/server/app/api/mcp-connections/route.js.nft.json +1 -1
  63. package/dist/web/standalone/.next/server/app/api/notifications/route.js.nft.json +1 -1
  64. package/dist/web/standalone/.next/server/app/api/onboarding/route.js.nft.json +1 -1
  65. package/dist/web/standalone/.next/server/app/api/projects/route.js.nft.json +1 -1
  66. package/dist/web/standalone/.next/server/app/api/recovery/route.js.nft.json +1 -1
  67. package/dist/web/standalone/.next/server/app/api/session/browser/route.js.nft.json +1 -1
  68. package/dist/web/standalone/.next/server/app/api/session/command/route.js.nft.json +1 -1
  69. package/dist/web/standalone/.next/server/app/api/session/events/route.js.nft.json +1 -1
  70. package/dist/web/standalone/.next/server/app/api/session/manage/route.js.nft.json +1 -1
  71. package/dist/web/standalone/.next/server/app/api/settings-data/route.js.nft.json +1 -1
  72. package/dist/web/standalone/.next/server/app/api/shutdown/route.js.nft.json +1 -1
  73. package/dist/web/standalone/.next/server/app/api/skill-health/route.js.nft.json +1 -1
  74. package/dist/web/standalone/.next/server/app/api/steer/route.js.nft.json +1 -1
  75. package/dist/web/standalone/.next/server/app/api/switch-root/route.js.nft.json +1 -1
  76. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js.nft.json +1 -1
  77. package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js.nft.json +1 -1
  78. package/dist/web/standalone/.next/server/app/api/undo/route.js.nft.json +1 -1
  79. package/dist/web/standalone/.next/server/app/api/visualizer/route.js.nft.json +1 -1
  80. package/dist/web/standalone/.next/server/app/index.html +1 -1
  81. package/dist/web/standalone/.next/server/app/index.rsc +1 -1
  82. package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  83. package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +1 -1
  84. package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  85. package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +1 -1
  86. package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  87. package/dist/web/standalone/.next/server/app-paths-manifest.json +6 -6
  88. package/dist/web/standalone/.next/server/chunks/5047.js +2 -0
  89. package/dist/web/standalone/.next/server/chunks/5124.js +1 -0
  90. package/dist/web/standalone/.next/server/chunks/8357.js +2 -2
  91. package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
  92. package/dist/web/standalone/.next/server/pages/404.html +1 -1
  93. package/dist/web/standalone/.next/server/pages/500.html +1 -1
  94. package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
  95. package/dist/web/standalone/node_modules/node-pty/build/Makefile +1 -1
  96. package/package.json +6 -4
  97. package/packages/cloud-mcp-gateway/package.json +2 -2
  98. package/packages/contracts/package.json +1 -1
  99. package/packages/daemon/package.json +4 -4
  100. package/packages/gsd-agent-core/package.json +5 -5
  101. package/packages/gsd-agent-modes/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  102. package/packages/gsd-agent-modes/dist/modes/interactive/components/assistant-message.js +21 -23
  103. package/packages/gsd-agent-modes/dist/modes/interactive/components/assistant-message.js.map +1 -1
  104. package/packages/gsd-agent-modes/dist/modes/interactive/components/transcript-design.js +1 -1
  105. package/packages/gsd-agent-modes/dist/modes/interactive/components/transcript-design.js.map +1 -1
  106. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
  107. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.js +18 -11
  108. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
  109. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-chat-render.d.ts.map +1 -1
  110. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-chat-render.js +16 -0
  111. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-chat-render.js.map +1 -1
  112. package/packages/gsd-agent-modes/package.json +7 -7
  113. package/packages/mcp-server/package.json +3 -3
  114. package/packages/native/package.json +1 -1
  115. package/packages/pi-agent-core/package.json +1 -1
  116. package/packages/pi-ai/dist/models.generated.d.ts +0 -34
  117. package/packages/pi-ai/dist/models.generated.d.ts.map +1 -1
  118. package/packages/pi-ai/dist/models.generated.js +0 -34
  119. package/packages/pi-ai/dist/models.generated.js.map +1 -1
  120. package/packages/pi-ai/package.json +1 -1
  121. package/packages/pi-coding-agent/dist/core/auth-storage.d.ts.map +1 -1
  122. package/packages/pi-coding-agent/dist/core/auth-storage.js +11 -3
  123. package/packages/pi-coding-agent/dist/core/auth-storage.js.map +1 -1
  124. package/packages/pi-coding-agent/dist/core/settings-manager.js +1 -1
  125. package/packages/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
  126. package/packages/pi-coding-agent/package.json +7 -7
  127. package/packages/pi-tui/package.json +2 -2
  128. package/packages/rpc-client/package.json +2 -2
  129. package/pkg/package.json +1 -1
  130. package/src/resources/extensions/browser-tools/index.ts +39 -22
  131. package/src/resources/extensions/browser-tools/state.ts +13 -0
  132. package/src/resources/extensions/browser-tools/tests/browser-tools-unit.test.cjs +57 -0
  133. package/src/resources/extensions/browser-tools/tools/session.ts +4 -2
  134. package/src/resources/extensions/browser-tools/utils.ts +3 -3
  135. package/src/resources/extensions/claude-code-cli/stream-adapter.ts +18 -8
  136. package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +2 -2
  137. package/src/resources/extensions/gsd/auto/contracts.ts +8 -119
  138. package/src/resources/extensions/gsd/auto/orchestrator.ts +794 -58
  139. package/src/resources/extensions/gsd/auto-prompts.ts +21 -1
  140. package/src/resources/extensions/gsd/auto-runtime-state.ts +4 -0
  141. package/src/resources/extensions/gsd/auto-tool-tracking.ts +5 -0
  142. package/src/resources/extensions/gsd/auto-unit-tool-scope.ts +33 -0
  143. package/src/resources/extensions/gsd/auto.ts +81 -500
  144. package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +2 -0
  145. package/src/resources/extensions/gsd/debug-logger.ts +11 -0
  146. package/src/resources/extensions/gsd/doctor-proactive.ts +8 -2
  147. package/src/resources/extensions/gsd/markdown-renderer.ts +38 -19
  148. package/src/resources/extensions/gsd/mcp-filter.ts +7 -0
  149. package/src/resources/extensions/gsd/native-git-bridge.ts +9 -0
  150. package/src/resources/extensions/gsd/prompts/plan-slice.md +1 -1
  151. package/src/resources/extensions/gsd/schemas/parsers.ts +6 -1
  152. package/src/resources/extensions/gsd/state-reconciliation/drift/artifact-db.ts +31 -10
  153. package/src/resources/extensions/gsd/tests/artifact-db-drift-memo.test.ts +66 -0
  154. package/src/resources/extensions/gsd/tests/auto-dispatch-baseline-harness.test.ts +53 -0
  155. package/src/resources/extensions/gsd/tests/auto-orchestrator.test.ts +590 -855
  156. package/src/resources/extensions/gsd/tests/auto-paused-ui-cleanup.test.ts +38 -10
  157. package/src/resources/extensions/gsd/tests/debug-logger.test.ts +15 -0
  158. package/src/resources/extensions/gsd/tests/execute-summary-save-empty-project.test.ts +64 -1
  159. package/src/resources/extensions/gsd/tests/markdown-renderer-parse-cache.test.ts +75 -0
  160. package/src/resources/extensions/gsd/tests/orchestrator-legacy-parity.test.ts +127 -0
  161. package/src/resources/extensions/gsd/tests/parse-project-milestone-bridge.test.ts +77 -0
  162. package/src/resources/extensions/gsd/tests/plan-slice-prompt.test.ts +4 -2
  163. package/src/resources/extensions/gsd/tests/start-auto-detached.test.ts +19 -5
  164. package/src/resources/extensions/gsd/tests/worktree-safety.test.ts +24 -0
  165. package/src/resources/extensions/gsd/tests/write-gate-planning-unit.test.ts +15 -3
  166. package/src/resources/extensions/gsd/tools/workflow-tool-executors.ts +183 -21
  167. package/dist/web/standalone/.next/server/chunks/678.js +0 -2
  168. /package/dist/web/standalone/.next/static/{vAecbJ3K9eO213bAxU8Mi → h38jfi0dnRY0y3hbyBszg}/_buildManifest.js +0 -0
  169. /package/dist/web/standalone/.next/static/{vAecbJ3K9eO213bAxU8Mi → h38jfi0dnRY0y3hbyBszg}/_ssgManifest.js +0 -0
@@ -3190,6 +3190,17 @@ opts) {
3190
3190
  // gate-registry.ts so that prompt builders, dispatch rules, state
3191
3191
  // derivation, and tool handlers all consult the same source of truth.
3192
3192
  // See gate-registry.ts for the full ownership map.
3193
+ /**
3194
+ * Adapt gate-registry guidance for section-close phases.
3195
+ *
3196
+ * Gate-registry text is shared with the gate-evaluate subagent, where
3197
+ * "Return verdict ..." is literal. Section-close units write artifact sections
3198
+ * instead, so translate that wording at render time without mutating the
3199
+ * canonical guidance.
3200
+ */
3201
+ function sectionModeGuidance(guidance) {
3202
+ return guidance.replace(/Return verdict '([^']+)'/g, (_match, verdict) => verdict === "omitted" ? "Leave the section empty" : `Record a \`${verdict}\``);
3203
+ }
3193
3204
  /**
3194
3205
  * Render a "Gates to Close" block for turns like `complete-slice` and
3195
3206
  * `validate-milestone` that own gates which are closed as a side-effect
@@ -3208,12 +3219,14 @@ function renderGatesToCloseBlock(gates, opts) {
3208
3219
  lines.push("");
3209
3220
  lines.push("These quality gates are still pending for this unit. You MUST address every one before calling the closing tool — the handler closes the DB row based on whether the corresponding artifact section is present.");
3210
3221
  lines.push("");
3222
+ lines.push("**Do NOT call `gsd_save_gate_result` (or any gate-result tool) for these gates** — that tool belongs to a different phase and the call will be blocked. You close each gate purely by writing its named section: a populated section records `pass`, an empty section records `omitted`, and the completion handler persists the verdict for you. Treat any \"return verdict\" wording in the guidance below as describing that section outcome, not as an instruction to call a tool.");
3223
+ lines.push("");
3211
3224
  for (const def of applicable) {
3212
3225
  lines.push(`### ${def.id} — ${def.promptSection}`);
3213
3226
  lines.push("");
3214
3227
  lines.push(`**Question:** ${def.question}`);
3215
3228
  lines.push("");
3216
- lines.push(def.guidance);
3229
+ lines.push(sectionModeGuidance(def.guidance));
3217
3230
  if (opts.allowOmit) {
3218
3231
  lines.push("");
3219
3232
  lines.push(`If this gate genuinely does not apply to this unit, leave the **${def.promptSection}** section empty and the handler will record it as \`omitted\`. Otherwise, fill the section with concrete evidence.`);
@@ -23,6 +23,9 @@ export function isAutoPaused() {
23
23
  export function isAutoCompletionStopInProgress() {
24
24
  return autoSession.completionStopInProgress;
25
25
  }
26
+ export function clearAutoCompletionStopInProgress() {
27
+ autoSession.completionStopInProgress = false;
28
+ }
26
29
  export function markToolStart(toolCallId, toolName) {
27
30
  markTrackedToolStart(toolCallId, autoSession.active, toolName);
28
31
  }
@@ -123,6 +123,11 @@ export const DETERMINISTIC_POLICY_ERROR_STRINGS = [
123
123
  // "Cannot write to milestone CONTEXT.md without depth verification." for direct
124
124
  // write tool calls to *-CONTEXT.md paths (different code path than gsd_summary_save).
125
125
  "CONTEXT.md without depth verification",
126
+ // Section-close gate units (execute-task, complete-slice, validate-milestone) that
127
+ // reach for gsd_save_gate_result get the calm redirect from softGateToolRedirect
128
+ // (auto-unit-tool-scope.ts) instead of a HARD BLOCK. Still deterministic — those
129
+ // phases never own that tool, so a retry hits the same redirect every time.
130
+ "closes its quality gates by writing summary sections",
126
131
  ];
127
132
  /**
128
133
  * Returns true if the error message indicates a deterministic policy gate
@@ -25,6 +25,16 @@ const EXECUTE_TASK_UNIT_TYPES = new Set([
25
25
  "execute-task-simple",
26
26
  "reactive-execute",
27
27
  ]);
28
+ // These units own quality gates, but their completion handlers persist verdicts
29
+ // from artifact sections. gsd_save_gate_result belongs to gate-evaluate, so keep
30
+ // blocking it here with a calm redirect to the section-write path.
31
+ const SECTION_CLOSE_GATE_UNIT_TYPES = new Set([
32
+ "execute-task",
33
+ "execute-task-simple",
34
+ "reactive-execute",
35
+ "complete-slice",
36
+ "validate-milestone",
37
+ ]);
28
38
  const EXTRA_SCOPED_GSD_LIFECYCLE_TOOLS = [
29
39
  "gsd_skip_slice",
30
40
  "gsd_slice_reopen",
@@ -38,6 +48,7 @@ const SCOPED_GSD_LIFECYCLE_TOOLS = new Set([
38
48
  .filter((tool) => tool.startsWith("gsd_"))
39
49
  .map(canonicalWorkflowToolName));
40
50
  export const GSD_PHASE_SCOPE_DISPLAY_REASON = "This GSD phase only allows its scoped workflow tools.";
51
+ export const GSD_SECTION_CLOSE_GATE_DISPLAY_REASON = "Gates here close by writing summary sections — gsd_save_gate_result isn't needed.";
41
52
  function stripMcpToolPrefix(toolName) {
42
53
  if (!toolName.startsWith("mcp__"))
43
54
  return toolName;
@@ -65,6 +76,21 @@ function hardBlock(unitType, what) {
65
76
  displayReason: GSD_PHASE_SCOPE_DISPLAY_REASON,
66
77
  };
67
78
  }
79
+ // This stable marker is registered in auto-tool-tracking.ts so auto-mode treats
80
+ // the redirect as deterministic policy, not a retryable execution failure.
81
+ function softGateToolRedirect(unitType) {
82
+ return {
83
+ block: true,
84
+ reason: [
85
+ `Skip this call — the "${unitType}" phase closes its quality gates by writing summary sections,`,
86
+ "not by calling gsd_save_gate_result (that tool belongs to the gate-evaluate phase).",
87
+ "Record each gate by filling its named section in your summary: a populated section records `pass`,",
88
+ "an empty one records `omitted`. Then call your completion tool and the handler persists every verdict.",
89
+ "This is expected, not an error — continue without gsd_save_gate_result.",
90
+ ].join(" "),
91
+ displayReason: GSD_SECTION_CLOSE_GATE_DISPLAY_REASON,
92
+ };
93
+ }
68
94
  function allowedGsdToolsForUnit(unitType) {
69
95
  return [...new Set((AUTO_UNIT_SCOPED_TOOLS[unitType] ?? [])
70
96
  .filter((tool) => tool.startsWith("gsd_"))
@@ -122,5 +148,8 @@ export function shouldBlockAutoUnitToolCall(unitType, toolName, input, unitId) {
122
148
  if (forbiddenReason) {
123
149
  return hardBlock(unitType, `GSD lifecycle tool "${canonicalTool}" is not permitted; ${forbiddenReason} Fix unit-tool-contracts.ts or the ${unitType} prompt.`);
124
150
  }
151
+ if (canonicalTool === "gsd_save_gate_result" && SECTION_CLOSE_GATE_UNIT_TYPES.has(unitType)) {
152
+ return softGateToolRedirect(unitType);
153
+ }
125
154
  return hardBlock(unitType, `GSD lifecycle tool "${canonicalTool}" is not permitted; allowed GSD tools: ${allowedTools.length > 0 ? allowedTools.join(", ") : "(none)"}`);
126
155
  }