gsd-pi 2.69.0 → 2.70.0-dev.7ebda5e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/loader.js +4 -0
- package/dist/resources/extensions/claude-code-cli/stream-adapter.js +150 -2
- package/dist/resources/extensions/gsd/auto-model-selection.js +33 -19
- package/dist/resources/extensions/gsd/auto-prompts.js +7 -3
- package/dist/resources/extensions/gsd/auto-start.js +25 -1
- package/dist/resources/extensions/gsd/auto.js +12 -8
- package/dist/resources/extensions/gsd/bootstrap/system-context.js +6 -2
- package/dist/resources/extensions/gsd/commands-cmux.js +30 -1
- package/dist/resources/extensions/gsd/commands-handlers.js +22 -8
- package/dist/resources/extensions/gsd/doctor-engine-checks.js +12 -0
- package/dist/resources/extensions/gsd/doctor-format.js +2 -0
- package/dist/resources/extensions/gsd/guided-flow.js +21 -10
- package/dist/resources/extensions/gsd/pre-execution-checks.js +5 -3
- package/dist/resources/extensions/gsd/validate-directory.js +30 -12
- package/dist/resources/extensions/gsd/workflow-mcp.js +64 -6
- package/dist/resources/extensions/slash-commands/audit.js +2 -1
- package/dist/resources/extensions/subagent/isolation.js +4 -2
- package/dist/update-check.d.ts +1 -0
- package/dist/update-check.js +30 -27
- package/dist/update-cmd.js +3 -11
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +12 -12
- 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 +4 -4
- 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 +12 -12
- package/dist/web/standalone/.next/server/chunks/63.js +3 -3
- package/dist/web/standalone/.next/server/chunks/6897.js +3 -3
- 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-f1e30ab6bb269149.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/web-mode.js +4 -0
- package/package.json +11 -11
- package/packages/daemon/src/orchestrator.ts +9 -84
- package/packages/mcp-server/README.md +25 -3
- package/packages/mcp-server/dist/cli.d.ts +0 -1
- package/packages/mcp-server/dist/cli.d.ts.map +1 -1
- package/packages/mcp-server/dist/cli.js +4 -2
- package/packages/mcp-server/dist/cli.js.map +1 -1
- package/packages/mcp-server/dist/server.d.ts +32 -1
- package/packages/mcp-server/dist/server.d.ts.map +1 -1
- package/packages/mcp-server/dist/server.js +118 -1
- package/packages/mcp-server/dist/server.js.map +1 -1
- package/packages/mcp-server/dist/tool-credentials.d.ts +6 -0
- package/packages/mcp-server/dist/tool-credentials.d.ts.map +1 -0
- package/packages/mcp-server/dist/tool-credentials.js +90 -0
- package/packages/mcp-server/dist/tool-credentials.js.map +1 -0
- package/packages/mcp-server/dist/workflow-tools.d.ts +3 -0
- package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.js +308 -4
- package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
- package/packages/mcp-server/src/cli.ts +5 -3
- package/packages/mcp-server/src/import-candidates.test.ts +48 -0
- package/packages/mcp-server/src/mcp-server.test.ts +85 -1
- package/packages/mcp-server/src/server.ts +188 -1
- package/packages/mcp-server/src/tool-credentials.test.ts +95 -0
- package/packages/mcp-server/src/tool-credentials.ts +97 -0
- package/packages/mcp-server/src/workflow-tools.test.ts +32 -25
- package/packages/mcp-server/src/workflow-tools.ts +398 -2
- package/packages/pi-agent-core/dist/agent.d.ts +8 -0
- package/packages/pi-agent-core/dist/agent.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/agent.js +3 -0
- package/packages/pi-agent-core/dist/agent.js.map +1 -1
- package/packages/pi-agent-core/src/agent.test.ts +82 -0
- package/packages/pi-agent-core/src/agent.ts +12 -0
- package/packages/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.js +1 -23
- package/packages/pi-ai/dist/providers/anthropic.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/index.d.ts +3 -2
- package/packages/pi-ai/dist/utils/oauth/index.d.ts.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/index.js +3 -5
- package/packages/pi-ai/dist/utils/oauth/index.js.map +1 -1
- package/packages/pi-ai/src/providers/anthropic.ts +1 -31
- package/packages/pi-ai/src/utils/oauth/index.ts +3 -5
- package/packages/pi-coding-agent/dist/core/lsp/config.d.ts +1 -0
- package/packages/pi-coding-agent/dist/core/lsp/config.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/config.js +38 -15
- package/packages/pi-coding-agent/dist/core/lsp/config.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.js +10 -0
- package/packages/pi-coding-agent/dist/core/sdk.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js +3 -1
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js.map +1 -1
- package/packages/pi-coding-agent/package.json +1 -1
- package/packages/pi-coding-agent/src/core/lsp/config.ts +43 -17
- package/packages/pi-coding-agent/src/core/sdk.ts +8 -0
- package/packages/pi-coding-agent/src/modes/interactive/slash-command-handlers.ts +7 -5
- package/pkg/package.json +1 -1
- package/src/resources/extensions/claude-code-cli/stream-adapter.ts +227 -2
- package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +172 -0
- package/src/resources/extensions/gsd/auto-model-selection.ts +39 -25
- package/src/resources/extensions/gsd/auto-prompts.ts +7 -3
- package/src/resources/extensions/gsd/auto-start.ts +34 -1
- package/src/resources/extensions/gsd/auto.ts +12 -8
- package/src/resources/extensions/gsd/bootstrap/system-context.ts +9 -5
- package/src/resources/extensions/gsd/commands-cmux.ts +32 -1
- package/src/resources/extensions/gsd/commands-handlers.ts +22 -7
- package/src/resources/extensions/gsd/doctor-engine-checks.ts +14 -0
- package/src/resources/extensions/gsd/doctor-format.ts +1 -0
- package/src/resources/extensions/gsd/doctor-types.ts +1 -0
- package/src/resources/extensions/gsd/guided-flow.ts +24 -8
- package/src/resources/extensions/gsd/pre-execution-checks.ts +6 -3
- package/src/resources/extensions/gsd/tests/cmux.test.ts +67 -1
- package/src/resources/extensions/gsd/tests/doctor-scope-db-unavailable.test.ts +43 -0
- package/src/resources/extensions/gsd/tests/interactive-routing-bypass.test.ts +207 -0
- package/src/resources/extensions/gsd/tests/mcp-project-config.test.ts +6 -2
- package/src/resources/extensions/gsd/tests/pre-exec-backtick-strip.test.ts +48 -1
- package/src/resources/extensions/gsd/tests/resource-loader-import-path.test.ts +8 -7
- package/src/resources/extensions/gsd/tests/validate-directory.test.ts +33 -1
- package/src/resources/extensions/gsd/tests/validate-milestone.test.ts +87 -1
- package/src/resources/extensions/gsd/tests/workflow-mcp.test.ts +48 -7
- package/src/resources/extensions/gsd/validate-directory.ts +33 -11
- package/src/resources/extensions/gsd/workflow-mcp.ts +74 -5
- package/src/resources/extensions/slash-commands/audit.ts +2 -1
- package/src/resources/extensions/subagent/isolation.ts +4 -3
- package/dist/web/standalone/.next/static/chunks/app/page-7115e62689b5fd84.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/packages/pi-ai/dist/utils/oauth/anthropic.d.ts +0 -17
- package/packages/pi-ai/dist/utils/oauth/anthropic.d.ts.map +0 -1
- package/packages/pi-ai/dist/utils/oauth/anthropic.js +0 -106
- package/packages/pi-ai/dist/utils/oauth/anthropic.js.map +0 -1
- package/packages/pi-ai/src/utils/oauth/anthropic.ts +0 -140
- /package/dist/web/standalone/.next/static/{DrWdzskk28E5Qz-Wjw1mj → yvFbuOJuph5517lR7HBt2}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{DrWdzskk28E5Qz-Wjw1mj → yvFbuOJuph5517lR7HBt2}/_ssgManifest.js +0 -0
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
import { existsSync } from "node:fs";
|
|
17
17
|
import { spawn } from "node:child_process";
|
|
18
18
|
import { resolve } from "node:path";
|
|
19
|
+
const NPM_COMMAND = process.platform === "win32" ? "npm.cmd" : "npm";
|
|
19
20
|
// ─── Package Existence Check ─────────────────────────────────────────────────
|
|
20
21
|
/**
|
|
21
22
|
* Extract npm package names from task descriptions.
|
|
@@ -98,9 +99,10 @@ function normalizePackageName(raw) {
|
|
|
98
99
|
*/
|
|
99
100
|
async function checkPackageOnNpm(packageName, timeoutMs = 5000) {
|
|
100
101
|
return new Promise((resolve) => {
|
|
101
|
-
const child = spawn(
|
|
102
|
+
const child = spawn(NPM_COMMAND, ["view", packageName, "name"], {
|
|
102
103
|
stdio: ["ignore", "pipe", "pipe"],
|
|
103
104
|
timeout: timeoutMs,
|
|
105
|
+
shell: process.platform === "win32",
|
|
104
106
|
});
|
|
105
107
|
let stdout = "";
|
|
106
108
|
let stderr = "";
|
|
@@ -216,9 +218,9 @@ function extractPathFromAnnotation(raw) {
|
|
|
216
218
|
const trimmed = raw.trim();
|
|
217
219
|
if (!trimmed)
|
|
218
220
|
return trimmed;
|
|
219
|
-
const backtickMatch = trimmed.match(
|
|
221
|
+
const backtickMatch = trimmed.match(/^(`+)([^`]+)\1(?:(?:\s+[—–-]\s+.+)|(?:\s+\([^()]+\)))?$/);
|
|
220
222
|
if (backtickMatch) {
|
|
221
|
-
return backtickMatch[
|
|
223
|
+
return backtickMatch[2].trim();
|
|
222
224
|
}
|
|
223
225
|
const annotatedMatch = trimmed.match(/^(.+?)\s+[—–-]\s+.+$/);
|
|
224
226
|
if (annotatedMatch) {
|
|
@@ -45,6 +45,30 @@ const WINDOWS_BLOCKED_PATHS = new Set([
|
|
|
45
45
|
"C:\\Program Files",
|
|
46
46
|
"C:\\Program Files (x86)",
|
|
47
47
|
]);
|
|
48
|
+
const WINDOWS_BLOCKED_SUFFIXES = new Set([
|
|
49
|
+
"\\",
|
|
50
|
+
"\\windows",
|
|
51
|
+
"\\windows\\system32",
|
|
52
|
+
"\\program files",
|
|
53
|
+
"\\program files (x86)",
|
|
54
|
+
]);
|
|
55
|
+
function normalizePathForComparison(dirPath) {
|
|
56
|
+
let normalized = dirPath.replace(/[/\\]+$/, "");
|
|
57
|
+
if (normalized === "") {
|
|
58
|
+
normalized = "/";
|
|
59
|
+
}
|
|
60
|
+
else if (/^[A-Za-z]:$/.test(normalized)) {
|
|
61
|
+
normalized += "\\";
|
|
62
|
+
}
|
|
63
|
+
return platform() === "win32" ? normalized.toLowerCase() : normalized;
|
|
64
|
+
}
|
|
65
|
+
function isBlockedWindowsPath(normalized) {
|
|
66
|
+
if (!/^[a-z]:\\/.test(normalized)) {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
const suffix = normalized.slice(2);
|
|
70
|
+
return WINDOWS_BLOCKED_SUFFIXES.has(suffix);
|
|
71
|
+
}
|
|
48
72
|
// ─── Core Validation ────────────────────────────────────────────────────────────
|
|
49
73
|
/**
|
|
50
74
|
* Validate whether a directory is safe for GSD to operate in.
|
|
@@ -67,16 +91,10 @@ export function validateDirectory(dirPath) {
|
|
|
67
91
|
}
|
|
68
92
|
// Normalize trailing slashes for consistent comparison.
|
|
69
93
|
// Special cases: "/" → "/" (not ""), "C:\" → "C:\" (not "C:")
|
|
70
|
-
|
|
71
|
-
if (normalized === "") {
|
|
72
|
-
normalized = "/";
|
|
73
|
-
}
|
|
74
|
-
else if (/^[A-Za-z]:$/.test(normalized)) {
|
|
75
|
-
normalized = normalized + "\\";
|
|
76
|
-
}
|
|
94
|
+
const normalized = normalizePathForComparison(resolved);
|
|
77
95
|
// ── Check 1: Blocked system paths ──────────────────────────────────────
|
|
78
96
|
const blockedPaths = platform() === "win32" ? WINDOWS_BLOCKED_PATHS : UNIX_BLOCKED_PATHS;
|
|
79
|
-
if (blockedPaths.has(normalized)) {
|
|
97
|
+
if (platform() === "win32" ? isBlockedWindowsPath(normalized) : blockedPaths.has(normalized)) {
|
|
80
98
|
return {
|
|
81
99
|
safe: false,
|
|
82
100
|
severity: "blocked",
|
|
@@ -86,10 +104,10 @@ export function validateDirectory(dirPath) {
|
|
|
86
104
|
// ── Check 2: Home directory itself (not subdirs) ───────────────────────
|
|
87
105
|
let resolvedHome;
|
|
88
106
|
try {
|
|
89
|
-
resolvedHome = realpathSync(resolve(homedir()))
|
|
107
|
+
resolvedHome = normalizePathForComparison(realpathSync(resolve(homedir())));
|
|
90
108
|
}
|
|
91
109
|
catch {
|
|
92
|
-
resolvedHome = resolve(homedir())
|
|
110
|
+
resolvedHome = normalizePathForComparison(resolve(homedir()));
|
|
93
111
|
}
|
|
94
112
|
if (normalized === resolvedHome) {
|
|
95
113
|
return {
|
|
@@ -101,10 +119,10 @@ export function validateDirectory(dirPath) {
|
|
|
101
119
|
// ── Check 3: Temp directory root ───────────────────────────────────────
|
|
102
120
|
let resolvedTmp;
|
|
103
121
|
try {
|
|
104
|
-
resolvedTmp = realpathSync(resolve(tmpdir()))
|
|
122
|
+
resolvedTmp = normalizePathForComparison(realpathSync(resolve(tmpdir())));
|
|
105
123
|
}
|
|
106
124
|
catch {
|
|
107
|
-
resolvedTmp = resolve(tmpdir())
|
|
125
|
+
resolvedTmp = normalizePathForComparison(resolve(tmpdir()));
|
|
108
126
|
}
|
|
109
127
|
if (normalized === resolvedTmp) {
|
|
110
128
|
return {
|
|
@@ -1,24 +1,37 @@
|
|
|
1
1
|
import { execSync } from "node:child_process";
|
|
2
2
|
import { existsSync } from "node:fs";
|
|
3
3
|
import { dirname, resolve } from "node:path";
|
|
4
|
-
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
5
5
|
const MCP_WORKFLOW_TOOL_SURFACE = new Set([
|
|
6
|
+
"ask_user_questions",
|
|
7
|
+
"gsd_decision_save",
|
|
6
8
|
"gsd_complete_milestone",
|
|
7
9
|
"gsd_complete_task",
|
|
8
10
|
"gsd_complete_slice",
|
|
11
|
+
"gsd_generate_milestone_id",
|
|
12
|
+
"gsd_journal_query",
|
|
9
13
|
"gsd_milestone_complete",
|
|
14
|
+
"gsd_milestone_generate_id",
|
|
10
15
|
"gsd_milestone_status",
|
|
11
16
|
"gsd_milestone_validate",
|
|
17
|
+
"gsd_plan_task",
|
|
12
18
|
"gsd_plan_milestone",
|
|
13
19
|
"gsd_plan_slice",
|
|
14
20
|
"gsd_replan_slice",
|
|
15
21
|
"gsd_reassess_roadmap",
|
|
22
|
+
"gsd_requirement_save",
|
|
23
|
+
"gsd_requirement_update",
|
|
16
24
|
"gsd_roadmap_reassess",
|
|
25
|
+
"gsd_save_decision",
|
|
17
26
|
"gsd_save_gate_result",
|
|
27
|
+
"gsd_save_requirement",
|
|
28
|
+
"gsd_skip_slice",
|
|
18
29
|
"gsd_slice_replan",
|
|
19
30
|
"gsd_slice_complete",
|
|
20
31
|
"gsd_summary_save",
|
|
32
|
+
"gsd_task_plan",
|
|
21
33
|
"gsd_task_complete",
|
|
34
|
+
"gsd_update_requirement",
|
|
22
35
|
"gsd_validate_milestone",
|
|
23
36
|
]);
|
|
24
37
|
function parseLookupOutput(output) {
|
|
@@ -73,6 +86,8 @@ function getBundledWorkflowMcpCliPath(env) {
|
|
|
73
86
|
return candidate;
|
|
74
87
|
}
|
|
75
88
|
const candidates = [
|
|
89
|
+
resolve(fileURLToPath(new URL("../../../../packages/mcp-server/src/cli.ts", import.meta.url))),
|
|
90
|
+
resolve(fileURLToPath(new URL("../../../../../packages/mcp-server/src/cli.ts", import.meta.url))),
|
|
76
91
|
resolve(fileURLToPath(new URL("../../../../packages/mcp-server/dist/cli.js", import.meta.url))),
|
|
77
92
|
resolve(fileURLToPath(new URL("../../../../../packages/mcp-server/dist/cli.js", import.meta.url))),
|
|
78
93
|
];
|
|
@@ -84,9 +99,9 @@ function getBundledWorkflowMcpCliPath(env) {
|
|
|
84
99
|
}
|
|
85
100
|
function getBundledWorkflowExecutorModulePath() {
|
|
86
101
|
const candidates = [
|
|
87
|
-
resolve(fileURLToPath(new URL("../../../../dist/resources/extensions/gsd/tools/workflow-tool-executors.js", import.meta.url))),
|
|
88
102
|
resolve(fileURLToPath(new URL("./tools/workflow-tool-executors.js", import.meta.url))),
|
|
89
103
|
resolve(fileURLToPath(new URL("./tools/workflow-tool-executors.ts", import.meta.url))),
|
|
104
|
+
resolve(fileURLToPath(new URL("../../../../dist/resources/extensions/gsd/tools/workflow-tool-executors.js", import.meta.url))),
|
|
90
105
|
];
|
|
91
106
|
for (const candidate of candidates) {
|
|
92
107
|
if (existsSync(candidate))
|
|
@@ -96,9 +111,9 @@ function getBundledWorkflowExecutorModulePath() {
|
|
|
96
111
|
}
|
|
97
112
|
function getBundledWorkflowWriteGateModulePath() {
|
|
98
113
|
const candidates = [
|
|
99
|
-
resolve(fileURLToPath(new URL("../../../../dist/resources/extensions/gsd/bootstrap/write-gate.js", import.meta.url))),
|
|
100
114
|
resolve(fileURLToPath(new URL("./bootstrap/write-gate.js", import.meta.url))),
|
|
101
115
|
resolve(fileURLToPath(new URL("./bootstrap/write-gate.ts", import.meta.url))),
|
|
116
|
+
resolve(fileURLToPath(new URL("../../../../dist/resources/extensions/gsd/bootstrap/write-gate.js", import.meta.url))),
|
|
102
117
|
];
|
|
103
118
|
for (const candidate of candidates) {
|
|
104
119
|
if (existsSync(candidate))
|
|
@@ -106,14 +121,46 @@ function getBundledWorkflowWriteGateModulePath() {
|
|
|
106
121
|
}
|
|
107
122
|
return null;
|
|
108
123
|
}
|
|
109
|
-
function
|
|
124
|
+
function getResolveTsHookPath() {
|
|
125
|
+
const candidates = [
|
|
126
|
+
resolve(fileURLToPath(new URL("./tests/resolve-ts.mjs", import.meta.url))),
|
|
127
|
+
resolve(fileURLToPath(new URL("../../../../src/resources/extensions/gsd/tests/resolve-ts.mjs", import.meta.url))),
|
|
128
|
+
];
|
|
129
|
+
for (const candidate of candidates) {
|
|
130
|
+
if (existsSync(candidate))
|
|
131
|
+
return candidate;
|
|
132
|
+
}
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
135
|
+
function mergeNodeOptions(existing, additions) {
|
|
136
|
+
const tokens = (existing ?? "").split(/\s+/).map((value) => value.trim()).filter(Boolean);
|
|
137
|
+
for (const addition of additions) {
|
|
138
|
+
if (!tokens.includes(addition)) {
|
|
139
|
+
tokens.push(addition);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return tokens.length > 0 ? tokens.join(" ") : undefined;
|
|
143
|
+
}
|
|
144
|
+
function buildWorkflowLaunchEnv(projectRoot, gsdCliPath, explicitEnv, workflowCliPath) {
|
|
110
145
|
const executorModulePath = getBundledWorkflowExecutorModulePath();
|
|
111
146
|
const writeGateModulePath = getBundledWorkflowWriteGateModulePath();
|
|
147
|
+
const resolveTsHookPath = getResolveTsHookPath();
|
|
148
|
+
const wantsSourceTs = Boolean(resolveTsHookPath) &&
|
|
149
|
+
((workflowCliPath?.endsWith(".ts") ?? false) ||
|
|
150
|
+
(executorModulePath?.endsWith(".ts") ?? false) ||
|
|
151
|
+
(writeGateModulePath?.endsWith(".ts") ?? false));
|
|
152
|
+
const nodeOptions = wantsSourceTs
|
|
153
|
+
? mergeNodeOptions(explicitEnv?.NODE_OPTIONS, [
|
|
154
|
+
"--experimental-strip-types",
|
|
155
|
+
`--import=${pathToFileURL(resolveTsHookPath).href}`,
|
|
156
|
+
])
|
|
157
|
+
: explicitEnv?.NODE_OPTIONS;
|
|
112
158
|
return {
|
|
113
159
|
...(explicitEnv ?? {}),
|
|
114
160
|
...(gsdCliPath ? { GSD_CLI_PATH: gsdCliPath } : {}),
|
|
115
161
|
...(executorModulePath ? { GSD_WORKFLOW_EXECUTORS_MODULE: executorModulePath } : {}),
|
|
116
162
|
...(writeGateModulePath ? { GSD_WORKFLOW_WRITE_GATE_MODULE: writeGateModulePath } : {}),
|
|
163
|
+
...(nodeOptions ? { NODE_OPTIONS: nodeOptions } : {}),
|
|
117
164
|
GSD_PERSIST_WRITE_GATE_STATE: "1",
|
|
118
165
|
GSD_WORKFLOW_PROJECT_ROOT: projectRoot,
|
|
119
166
|
};
|
|
@@ -148,7 +195,7 @@ export function detectWorkflowMcpLaunchConfig(projectRoot = process.cwd(), env =
|
|
|
148
195
|
command: process.execPath,
|
|
149
196
|
args: [distCli],
|
|
150
197
|
cwd: resolvedWorkflowProjectRoot,
|
|
151
|
-
env: buildWorkflowLaunchEnv(resolvedWorkflowProjectRoot, gsdCliPath),
|
|
198
|
+
env: buildWorkflowLaunchEnv(resolvedWorkflowProjectRoot, gsdCliPath, undefined, distCli),
|
|
152
199
|
};
|
|
153
200
|
}
|
|
154
201
|
const bundledCli = getBundledWorkflowMcpCliPath(env);
|
|
@@ -158,7 +205,7 @@ export function detectWorkflowMcpLaunchConfig(projectRoot = process.cwd(), env =
|
|
|
158
205
|
command: process.execPath,
|
|
159
206
|
args: [bundledCli],
|
|
160
207
|
cwd: resolvedWorkflowProjectRoot,
|
|
161
|
-
env: buildWorkflowLaunchEnv(resolvedWorkflowProjectRoot, gsdCliPath),
|
|
208
|
+
env: buildWorkflowLaunchEnv(resolvedWorkflowProjectRoot, gsdCliPath, undefined, bundledCli),
|
|
162
209
|
};
|
|
163
210
|
}
|
|
164
211
|
const binPath = lookupCommand("gsd-mcp-server");
|
|
@@ -240,6 +287,17 @@ export function getRequiredWorkflowToolsForAutoUnit(unitType) {
|
|
|
240
287
|
export function usesWorkflowMcpTransport(authMode, baseUrl) {
|
|
241
288
|
return authMode === "externalCli" && typeof baseUrl === "string" && baseUrl.startsWith("local://");
|
|
242
289
|
}
|
|
290
|
+
export function supportsStructuredQuestions(activeTools, options = {}) {
|
|
291
|
+
if (!activeTools.includes("ask_user_questions"))
|
|
292
|
+
return false;
|
|
293
|
+
// Workflow MCP currently exposes ask_user_questions via MCP form elicitation.
|
|
294
|
+
// Local external CLI transports such as Claude Code can invoke the tool, but
|
|
295
|
+
// do not reliably complete that elicitation round-trip yet, so guided discuss
|
|
296
|
+
// prompts must fall back to plain-text questioning.
|
|
297
|
+
if (usesWorkflowMcpTransport(options.authMode, options.baseUrl))
|
|
298
|
+
return false;
|
|
299
|
+
return true;
|
|
300
|
+
}
|
|
243
301
|
export function getWorkflowTransportSupportError(provider, requiredTools, options = {}) {
|
|
244
302
|
if (!provider || requiredTools.length === 0)
|
|
245
303
|
return null;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { mkdirSync } from "node:fs";
|
|
1
2
|
export default function auditCommand(pi) {
|
|
2
3
|
pi.registerCommand("audit", {
|
|
3
4
|
description: "Audit the current codebase against a specific goal and write a structured report to .gsd/audits/",
|
|
@@ -26,7 +27,7 @@ export default function auditCommand(pi) {
|
|
|
26
27
|
.slice(0, 40);
|
|
27
28
|
const outputPath = `.gsd/audits/${timestamp}-${slug}.md`;
|
|
28
29
|
// ── Step 3: Ensure the output directory exists ───────────────────────
|
|
29
|
-
|
|
30
|
+
mkdirSync(".gsd/audits", { recursive: true });
|
|
30
31
|
// ── Step 4: Send the audit prompt to the agent ───────────────────────
|
|
31
32
|
const prompt = `You are conducting a codebase audit. This is a **read-only recce** — you will explore the codebase deeply and produce a structured report. You must NOT edit any code or create any files other than the audit report itself.
|
|
32
33
|
|
|
@@ -14,8 +14,10 @@ const execFile = promisify(execFileCb);
|
|
|
14
14
|
// ============================================================================
|
|
15
15
|
// Directory helpers
|
|
16
16
|
// ============================================================================
|
|
17
|
-
function encodeCwd(cwd) {
|
|
18
|
-
|
|
17
|
+
export function encodeCwd(cwd) {
|
|
18
|
+
// Encode the entire cwd so Windows drive letters, separators, and UNC
|
|
19
|
+
// prefixes cannot leak into the isolation path.
|
|
20
|
+
return Buffer.from(cwd, "utf8").toString("base64url");
|
|
19
21
|
}
|
|
20
22
|
const gsdHome = process.env.GSD_HOME || path.join(os.homedir(), ".gsd");
|
|
21
23
|
function getIsolationBaseDir(cwd, taskId) {
|
package/dist/update-check.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ interface UpdateCheckCache {
|
|
|
8
8
|
export declare function compareSemver(a: string, b: string): number;
|
|
9
9
|
export declare function readUpdateCache(cachePath?: string): UpdateCheckCache | null;
|
|
10
10
|
export declare function writeUpdateCache(cache: UpdateCheckCache, cachePath?: string): void;
|
|
11
|
+
export declare function fetchLatestVersionFromRegistry(registryUrl?: string, fetchTimeoutMs?: number): Promise<string | null>;
|
|
11
12
|
export interface UpdateCheckOptions {
|
|
12
13
|
currentVersion?: string;
|
|
13
14
|
cachePath?: string;
|
package/dist/update-check.js
CHANGED
|
@@ -7,6 +7,7 @@ const CACHE_FILE = join(appRoot, '.update-check');
|
|
|
7
7
|
const NPM_PACKAGE_NAME = 'gsd-pi';
|
|
8
8
|
const CHECK_INTERVAL_MS = 24 * 60 * 60 * 1000; // 24 hours
|
|
9
9
|
const FETCH_TIMEOUT_MS = 5000;
|
|
10
|
+
const DEFAULT_REGISTRY_URL = `https://registry.npmjs.org/${NPM_PACKAGE_NAME}/latest`;
|
|
10
11
|
/**
|
|
11
12
|
* Compares two semver strings. Returns 1 if a > b, -1 if a < b, 0 if equal.
|
|
12
13
|
*/
|
|
@@ -42,6 +43,29 @@ export function writeUpdateCache(cache, cachePath = CACHE_FILE) {
|
|
|
42
43
|
// Non-fatal — don't block startup if cache write fails
|
|
43
44
|
}
|
|
44
45
|
}
|
|
46
|
+
function normalizeLatestVersion(version) {
|
|
47
|
+
if (typeof version !== 'string')
|
|
48
|
+
return null;
|
|
49
|
+
const trimmed = version.trim().replace(/^v/, '');
|
|
50
|
+
return trimmed.length > 0 ? trimmed : null;
|
|
51
|
+
}
|
|
52
|
+
export async function fetchLatestVersionFromRegistry(registryUrl = DEFAULT_REGISTRY_URL, fetchTimeoutMs = FETCH_TIMEOUT_MS) {
|
|
53
|
+
const controller = new AbortController();
|
|
54
|
+
const timeout = setTimeout(() => controller.abort(), fetchTimeoutMs);
|
|
55
|
+
try {
|
|
56
|
+
const res = await fetch(registryUrl, { signal: controller.signal });
|
|
57
|
+
if (!res.ok)
|
|
58
|
+
return null;
|
|
59
|
+
const data = (await res.json());
|
|
60
|
+
return normalizeLatestVersion(data.version);
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
finally {
|
|
66
|
+
clearTimeout(timeout);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
45
69
|
function printUpdateBanner(current, latest) {
|
|
46
70
|
process.stderr.write(` ${chalk.yellow('Update available:')} ${chalk.dim(`v${current}`)} → ${chalk.bold(`v${latest}`)}\n` +
|
|
47
71
|
` ${chalk.dim('Run')} npm update -g gsd-pi ${chalk.dim('or')} /gsd update ${chalk.dim('to upgrade')}\n\n`);
|
|
@@ -53,7 +77,7 @@ function printUpdateBanner(current, latest) {
|
|
|
53
77
|
export async function checkForUpdates(options = {}) {
|
|
54
78
|
const currentVersion = options.currentVersion || process.env.GSD_VERSION || '0.0.0';
|
|
55
79
|
const cachePath = options.cachePath || CACHE_FILE;
|
|
56
|
-
const registryUrl = options.registryUrl ||
|
|
80
|
+
const registryUrl = options.registryUrl || DEFAULT_REGISTRY_URL;
|
|
57
81
|
const checkIntervalMs = options.checkIntervalMs ?? CHECK_INTERVAL_MS;
|
|
58
82
|
const fetchTimeoutMs = options.fetchTimeoutMs ?? FETCH_TIMEOUT_MS;
|
|
59
83
|
const onUpdate = options.onUpdate || printUpdateBanner;
|
|
@@ -65,16 +89,8 @@ export async function checkForUpdates(options = {}) {
|
|
|
65
89
|
}
|
|
66
90
|
return;
|
|
67
91
|
}
|
|
68
|
-
// Fetch latest version from npm registry
|
|
69
|
-
const controller = new AbortController();
|
|
70
|
-
const timeout = setTimeout(() => controller.abort(), fetchTimeoutMs);
|
|
71
92
|
try {
|
|
72
|
-
const
|
|
73
|
-
clearTimeout(timeout);
|
|
74
|
-
if (!res.ok)
|
|
75
|
-
return;
|
|
76
|
-
const data = (await res.json());
|
|
77
|
-
const latestVersion = data.version;
|
|
93
|
+
const latestVersion = await fetchLatestVersionFromRegistry(registryUrl, fetchTimeoutMs);
|
|
78
94
|
if (!latestVersion)
|
|
79
95
|
return;
|
|
80
96
|
writeUpdateCache({ lastCheck: Date.now(), latestVersion }, cachePath);
|
|
@@ -85,9 +101,6 @@ export async function checkForUpdates(options = {}) {
|
|
|
85
101
|
catch {
|
|
86
102
|
// Network error or timeout — silently ignore, don't block startup
|
|
87
103
|
}
|
|
88
|
-
finally {
|
|
89
|
-
clearTimeout(timeout);
|
|
90
|
-
}
|
|
91
104
|
}
|
|
92
105
|
const PROMPT_TIMEOUT_MS = 30_000;
|
|
93
106
|
/**
|
|
@@ -101,7 +114,7 @@ const PROMPT_TIMEOUT_MS = 30_000;
|
|
|
101
114
|
export async function checkAndPromptForUpdates(options = {}) {
|
|
102
115
|
const currentVersion = options.currentVersion || process.env.GSD_VERSION || '0.0.0';
|
|
103
116
|
const cachePath = options.cachePath || CACHE_FILE;
|
|
104
|
-
const registryUrl = options.registryUrl ||
|
|
117
|
+
const registryUrl = options.registryUrl || DEFAULT_REGISTRY_URL;
|
|
105
118
|
const checkIntervalMs = options.checkIntervalMs ?? CHECK_INTERVAL_MS;
|
|
106
119
|
const fetchTimeoutMs = options.fetchTimeoutMs ?? FETCH_TIMEOUT_MS;
|
|
107
120
|
// Determine latest version (from cache or network)
|
|
@@ -111,25 +124,15 @@ export async function checkAndPromptForUpdates(options = {}) {
|
|
|
111
124
|
latestVersion = cache.latestVersion;
|
|
112
125
|
}
|
|
113
126
|
else {
|
|
114
|
-
const controller = new AbortController();
|
|
115
|
-
const timeout = setTimeout(() => controller.abort(), fetchTimeoutMs);
|
|
116
127
|
try {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
const data = (await res.json());
|
|
121
|
-
if (data.version) {
|
|
122
|
-
latestVersion = data.version;
|
|
123
|
-
writeUpdateCache({ lastCheck: Date.now(), latestVersion }, cachePath);
|
|
124
|
-
}
|
|
128
|
+
latestVersion = await fetchLatestVersionFromRegistry(registryUrl, fetchTimeoutMs);
|
|
129
|
+
if (latestVersion) {
|
|
130
|
+
writeUpdateCache({ lastCheck: Date.now(), latestVersion }, cachePath);
|
|
125
131
|
}
|
|
126
132
|
}
|
|
127
133
|
catch {
|
|
128
134
|
// Network unavailable — silently skip
|
|
129
135
|
}
|
|
130
|
-
finally {
|
|
131
|
-
clearTimeout(timeout);
|
|
132
|
-
}
|
|
133
136
|
}
|
|
134
137
|
if (!latestVersion || compareSemver(latestVersion, currentVersion) <= 0) {
|
|
135
138
|
return false;
|
package/dist/update-cmd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { execSync } from 'node:child_process';
|
|
2
|
-
import { compareSemver } from './update-check.js';
|
|
2
|
+
import { compareSemver, fetchLatestVersionFromRegistry } from './update-check.js';
|
|
3
3
|
const NPM_PACKAGE = 'gsd-pi';
|
|
4
4
|
export async function runUpdate() {
|
|
5
5
|
const current = process.env.GSD_VERSION || '0.0.0';
|
|
@@ -10,16 +10,8 @@ export async function runUpdate() {
|
|
|
10
10
|
const reset = '\x1b[0m';
|
|
11
11
|
process.stdout.write(`${dim}Current version:${reset} v${current}\n`);
|
|
12
12
|
process.stdout.write(`${dim}Checking npm registry...${reset}\n`);
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
try {
|
|
16
|
-
latest = execSync(`npm view ${NPM_PACKAGE} version --fetch-retry-mintimeout=3000`, {
|
|
17
|
-
encoding: 'utf-8',
|
|
18
|
-
stdio: ['ignore', 'pipe', 'ignore'],
|
|
19
|
-
env: { ...process.env, npm_config_cache: '' },
|
|
20
|
-
}).trim();
|
|
21
|
-
}
|
|
22
|
-
catch {
|
|
13
|
+
const latest = await fetchLatestVersionFromRegistry();
|
|
14
|
+
if (!latest) {
|
|
23
15
|
process.stderr.write(`${yellow}Failed to reach npm registry.${reset}\n`);
|
|
24
16
|
process.exit(1);
|
|
25
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
yvFbuOJuph5517lR7HBt2
|
|
@@ -1,47 +1,47 @@
|
|
|
1
1
|
{
|
|
2
2
|
"/_not-found/page": "/_not-found",
|
|
3
3
|
"/_global-error/page": "/_global-error",
|
|
4
|
-
"/api/bridge-terminal/input/route": "/api/bridge-terminal/input",
|
|
5
4
|
"/api/bridge-terminal/resize/route": "/api/bridge-terminal/resize",
|
|
5
|
+
"/api/bridge-terminal/input/route": "/api/bridge-terminal/input",
|
|
6
6
|
"/api/boot/route": "/api/boot",
|
|
7
|
-
"/api/bridge-terminal/stream/route": "/api/bridge-terminal/stream",
|
|
8
|
-
"/api/dev-mode/route": "/api/dev-mode",
|
|
9
7
|
"/api/cleanup/route": "/api/cleanup",
|
|
10
|
-
"/api/doctor/route": "/api/doctor",
|
|
11
|
-
"/api/export-data/route": "/api/export-data",
|
|
12
8
|
"/api/captures/route": "/api/captures",
|
|
9
|
+
"/api/dev-mode/route": "/api/dev-mode",
|
|
13
10
|
"/api/browse-directories/route": "/api/browse-directories",
|
|
11
|
+
"/api/doctor/route": "/api/doctor",
|
|
12
|
+
"/api/bridge-terminal/stream/route": "/api/bridge-terminal/stream",
|
|
13
|
+
"/api/export-data/route": "/api/export-data",
|
|
14
14
|
"/api/forensics/route": "/api/forensics",
|
|
15
|
+
"/api/experimental/route": "/api/experimental",
|
|
15
16
|
"/api/git/route": "/api/git",
|
|
16
17
|
"/api/history/route": "/api/history",
|
|
17
18
|
"/api/hooks/route": "/api/hooks",
|
|
18
19
|
"/api/inspect/route": "/api/inspect",
|
|
19
20
|
"/api/knowledge/route": "/api/knowledge",
|
|
20
|
-
"/api/experimental/route": "/api/experimental",
|
|
21
21
|
"/api/live-state/route": "/api/live-state",
|
|
22
22
|
"/api/notifications/route": "/api/notifications",
|
|
23
|
+
"/api/files/route": "/api/files",
|
|
23
24
|
"/api/preferences/route": "/api/preferences",
|
|
24
|
-
"/api/recovery/route": "/api/recovery",
|
|
25
25
|
"/api/onboarding/route": "/api/onboarding",
|
|
26
26
|
"/api/projects/route": "/api/projects",
|
|
27
|
+
"/api/recovery/route": "/api/recovery",
|
|
27
28
|
"/api/session/browser/route": "/api/session/browser",
|
|
28
29
|
"/api/session/command/route": "/api/session/command",
|
|
29
30
|
"/api/session/events/route": "/api/session/events",
|
|
30
|
-
"/api/settings-data/route": "/api/settings-data",
|
|
31
31
|
"/api/session/manage/route": "/api/session/manage",
|
|
32
|
+
"/api/remote-questions/route": "/api/remote-questions",
|
|
33
|
+
"/api/settings-data/route": "/api/settings-data",
|
|
32
34
|
"/api/shutdown/route": "/api/shutdown",
|
|
33
35
|
"/api/skill-health/route": "/api/skill-health",
|
|
34
36
|
"/api/steer/route": "/api/steer",
|
|
35
|
-
"/api/
|
|
37
|
+
"/api/switch-root/route": "/api/switch-root",
|
|
36
38
|
"/api/terminal/input/route": "/api/terminal/input",
|
|
37
39
|
"/api/terminal/resize/route": "/api/terminal/resize",
|
|
38
|
-
"/api/switch-root/route": "/api/switch-root",
|
|
39
40
|
"/api/terminal/sessions/route": "/api/terminal/sessions",
|
|
40
41
|
"/api/terminal/stream/route": "/api/terminal/stream",
|
|
41
42
|
"/api/terminal/upload/route": "/api/terminal/upload",
|
|
42
|
-
"/api/visualizer/route": "/api/visualizer",
|
|
43
43
|
"/api/undo/route": "/api/undo",
|
|
44
44
|
"/api/update/route": "/api/update",
|
|
45
|
-
"/api/
|
|
45
|
+
"/api/visualizer/route": "/api/visualizer",
|
|
46
46
|
"/page": "/"
|
|
47
47
|
}
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
],
|
|
5
5
|
"devFiles": [],
|
|
6
6
|
"lowPriorityFiles": [
|
|
7
|
-
"static/
|
|
8
|
-
"static/
|
|
7
|
+
"static/yvFbuOJuph5517lR7HBt2/_buildManifest.js",
|
|
8
|
+
"static/yvFbuOJuph5517lR7HBt2/_ssgManifest.js"
|
|
9
9
|
],
|
|
10
10
|
"rootMainFiles": [
|
|
11
11
|
"static/chunks/webpack-6e4d7e9a4f57bed4.js",
|
|
12
12
|
"static/chunks/4bd1b696-e356ca5ba0218e27.js",
|
|
13
13
|
"static/chunks/3794-42fdce068d44fa4f.js",
|
|
14
|
-
"static/chunks/main-app-
|
|
14
|
+
"static/chunks/main-app-fdab67f7802d7832.js"
|
|
15
15
|
],
|
|
16
16
|
"rootMainFilesTree": {},
|
|
17
17
|
"pages": {
|
|
@@ -78,8 +78,8 @@
|
|
|
78
78
|
"dynamicRoutes": {},
|
|
79
79
|
"notFoundRoutes": [],
|
|
80
80
|
"preview": {
|
|
81
|
-
"previewModeId": "
|
|
82
|
-
"previewModeSigningKey": "
|
|
83
|
-
"previewModeEncryptionKey": "
|
|
81
|
+
"previewModeId": "882060ec70c6d4efaa2fa4d08eb5e4a1",
|
|
82
|
+
"previewModeSigningKey": "261e56e129212651aa76856fc5f5780983cc541fcc15d3dfc192838d15eb7dd4",
|
|
83
|
+
"previewModeEncryptionKey": "b13cb1f8f1abf8990e4a897c5a318cbb08f86d10295b80e27190e8b0435adaac"
|
|
84
84
|
}
|
|
85
85
|
}
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
"transform": "lodash/{{member}}"
|
|
105
105
|
}
|
|
106
106
|
},
|
|
107
|
-
"outputFileTracingRoot": "/
|
|
107
|
+
"outputFileTracingRoot": "/__w/gsd-2/gsd-2",
|
|
108
108
|
"cacheComponents": false,
|
|
109
109
|
"cacheLife": {
|
|
110
110
|
"default": {
|
|
@@ -166,7 +166,7 @@
|
|
|
166
166
|
"proxyPrefetch": "flexible",
|
|
167
167
|
"optimisticClientCache": true,
|
|
168
168
|
"manualClientBasePath": false,
|
|
169
|
-
"cpus":
|
|
169
|
+
"cpus": 9,
|
|
170
170
|
"memoryBasedWorkersCount": false,
|
|
171
171
|
"imgOptConcurrency": null,
|
|
172
172
|
"imgOptTimeoutInSeconds": 7,
|
|
@@ -308,11 +308,11 @@
|
|
|
308
308
|
"node-pty"
|
|
309
309
|
],
|
|
310
310
|
"turbopack": {
|
|
311
|
-
"root": "/
|
|
311
|
+
"root": "/__w/gsd-2/gsd-2"
|
|
312
312
|
},
|
|
313
313
|
"distDirRoot": ".next"
|
|
314
314
|
},
|
|
315
|
-
"appDir": "/
|
|
315
|
+
"appDir": "/__w/gsd-2/gsd-2/web",
|
|
316
316
|
"relativeAppDir": "web",
|
|
317
317
|
"files": [
|
|
318
318
|
".next/routes-manifest.json",
|