gsd-pi 2.10.2 → 2.10.4

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 CHANGED
@@ -417,6 +417,8 @@ Anthropic, OpenAI, Google (Gemini), OpenRouter, GitHub Copilot, Amazon Bedrock,
417
417
 
418
418
  If you have a **Claude Max**, **Codex**, or **GitHub Copilot** subscription, you can use those directly — Pi handles the OAuth flow. No API key needed.
419
419
 
420
+ > **Note:** Using OAuth tokens from subscription plans (e.g. Claude Max) outside their native applications may not be explicitly permitted by the provider's Terms of Service. GSD supports API key authentication for all providers as an alternative. Use at your own discretion.
421
+
420
422
  ### OpenRouter
421
423
 
422
424
  [OpenRouter](https://openrouter.ai) gives you access to hundreds of models through a single API key. Use it to run GSD with Llama, DeepSeek, Qwen, or anything else OpenRouter supports.
package/dist/loader.js CHANGED
File without changes
@@ -2,7 +2,10 @@
2
2
  * Native addon loader.
3
3
  *
4
4
  * Locates and loads the compiled Rust N-API addon (`.node` file).
5
- * Tries platform-tagged release builds first, then falls back to dev builds.
5
+ * Resolution order:
6
+ * 1. @gsd-build/engine-{platform} npm optional dependency (production install)
7
+ * 2. native/addon/gsd_engine.{platform}.node (local release build)
8
+ * 3. native/addon/gsd_engine.dev.node (local debug build)
6
9
  */
7
10
  export declare const native: {
8
11
  search: (content: Buffer | Uint8Array, options: unknown) => unknown;
@@ -2,7 +2,10 @@
2
2
  * Native addon loader.
3
3
  *
4
4
  * Locates and loads the compiled Rust N-API addon (`.node` file).
5
- * Tries platform-tagged release builds first, then falls back to dev builds.
5
+ * Resolution order:
6
+ * 1. @gsd-build/engine-{platform} npm optional dependency (production install)
7
+ * 2. native/addon/gsd_engine.{platform}.node (local release build)
8
+ * 3. native/addon/gsd_engine.dev.node (local debug build)
6
9
  */
7
10
  import { createRequire } from "node:module";
8
11
  import * as path from "node:path";
@@ -11,24 +14,51 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
11
14
  const require = createRequire(import.meta.url);
12
15
  const addonDir = path.resolve(__dirname, "..", "..", "..", "native", "addon");
13
16
  const platformTag = `${process.platform}-${process.arch}`;
14
- const candidates = [
15
- path.join(addonDir, `gsd_engine.${platformTag}.node`),
16
- path.join(addonDir, "gsd_engine.dev.node"),
17
- ];
17
+ /** Map Node.js platform/arch to the npm package suffix */
18
+ const platformPackageMap = {
19
+ "darwin-arm64": "darwin-arm64",
20
+ "darwin-x64": "darwin-x64",
21
+ "linux-x64": "linux-x64-gnu",
22
+ "linux-arm64": "linux-arm64-gnu",
23
+ "win32-x64": "win32-x64-msvc",
24
+ };
18
25
  function loadNative() {
19
26
  const errors = [];
20
- for (const candidate of candidates) {
27
+ // 1. Try the platform-specific npm optional dependency
28
+ const packageSuffix = platformPackageMap[platformTag];
29
+ if (packageSuffix) {
21
30
  try {
22
- return require(candidate);
31
+ return require(`@gsd-build/engine-${packageSuffix}`);
23
32
  }
24
33
  catch (err) {
25
34
  const message = err instanceof Error ? err.message : String(err);
26
- errors.push(`${candidate}: ${message}`);
35
+ errors.push(`@gsd-build/engine-${packageSuffix}: ${message}`);
27
36
  }
28
37
  }
38
+ // 2. Try local release build (native/addon/gsd_engine.{platform}.node)
39
+ const releasePath = path.join(addonDir, `gsd_engine.${platformTag}.node`);
40
+ try {
41
+ return require(releasePath);
42
+ }
43
+ catch (err) {
44
+ const message = err instanceof Error ? err.message : String(err);
45
+ errors.push(`${releasePath}: ${message}`);
46
+ }
47
+ // 3. Try local dev build (native/addon/gsd_engine.dev.node)
48
+ const devPath = path.join(addonDir, "gsd_engine.dev.node");
49
+ try {
50
+ return require(devPath);
51
+ }
52
+ catch (err) {
53
+ const message = err instanceof Error ? err.message : String(err);
54
+ errors.push(`${devPath}: ${message}`);
55
+ }
29
56
  const details = errors.map((e) => ` - ${e}`).join("\n");
57
+ const supportedPlatforms = Object.keys(platformPackageMap);
30
58
  throw new Error(`Failed to load gsd_engine native addon for ${platformTag}.\n\n` +
31
59
  `Tried:\n${details}\n\n` +
32
- `Build with: npm run build:native -w @gsd/native`);
60
+ `Supported platforms: ${supportedPlatforms.join(", ")}\n` +
61
+ `If your platform is listed, try reinstalling: npm i -g gsd-pi\n` +
62
+ `Otherwise, please open an issue: https://github.com/gsd-build/gsd-2/issues`);
33
63
  }
34
64
  export const native = loadNative();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gsd-pi",
3
- "version": "2.10.2",
3
+ "version": "2.10.4",
4
4
  "description": "GSD — Get Shit Done coding agent",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -54,7 +54,8 @@
54
54
  "pi:install-global": "node scripts/install-pi-global.js",
55
55
  "pi:uninstall-global": "node scripts/uninstall-pi-global.js",
56
56
  "sync-pkg-version": "node scripts/sync-pkg-version.cjs",
57
- "prepublishOnly": "npm run sync-pkg-version && npm run build"
57
+ "sync-platform-versions": "node native/scripts/sync-platform-versions.cjs",
58
+ "prepublishOnly": "npm run sync-pkg-version && npm run sync-platform-versions && npm run build"
58
59
  },
59
60
  "dependencies": {
60
61
  "@clack/prompts": "^1.1.0",
@@ -81,6 +82,11 @@
81
82
  "typescript": "^5.4.0"
82
83
  },
83
84
  "optionalDependencies": {
85
+ "@gsd-build/engine-darwin-arm64": "2.10.2",
86
+ "@gsd-build/engine-darwin-x64": "2.10.2",
87
+ "@gsd-build/engine-linux-x64-gnu": "2.10.2",
88
+ "@gsd-build/engine-linux-arm64-gnu": "2.10.2",
89
+ "@gsd-build/engine-win32-x64-msvc": "2.10.2",
84
90
  "fsevents": "~2.3.3"
85
91
  },
86
92
  "overrides": {
@@ -2,7 +2,10 @@
2
2
  * Native addon loader.
3
3
  *
4
4
  * Locates and loads the compiled Rust N-API addon (`.node` file).
5
- * Tries platform-tagged release builds first, then falls back to dev builds.
5
+ * Resolution order:
6
+ * 1. @gsd-build/engine-{platform} npm optional dependency (production install)
7
+ * 2. native/addon/gsd_engine.{platform}.node (local release build)
8
+ * 3. native/addon/gsd_engine.dev.node (local debug build)
6
9
  */
7
10
  export declare const native: {
8
11
  search: (content: Buffer | Uint8Array, options: unknown) => unknown;
@@ -2,7 +2,10 @@
2
2
  * Native addon loader.
3
3
  *
4
4
  * Locates and loads the compiled Rust N-API addon (`.node` file).
5
- * Tries platform-tagged release builds first, then falls back to dev builds.
5
+ * Resolution order:
6
+ * 1. @gsd-build/engine-{platform} npm optional dependency (production install)
7
+ * 2. native/addon/gsd_engine.{platform}.node (local release build)
8
+ * 3. native/addon/gsd_engine.dev.node (local debug build)
6
9
  */
7
10
  import { createRequire } from "node:module";
8
11
  import * as path from "node:path";
@@ -11,24 +14,51 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
11
14
  const require = createRequire(import.meta.url);
12
15
  const addonDir = path.resolve(__dirname, "..", "..", "..", "native", "addon");
13
16
  const platformTag = `${process.platform}-${process.arch}`;
14
- const candidates = [
15
- path.join(addonDir, `gsd_engine.${platformTag}.node`),
16
- path.join(addonDir, "gsd_engine.dev.node"),
17
- ];
17
+ /** Map Node.js platform/arch to the npm package suffix */
18
+ const platformPackageMap = {
19
+ "darwin-arm64": "darwin-arm64",
20
+ "darwin-x64": "darwin-x64",
21
+ "linux-x64": "linux-x64-gnu",
22
+ "linux-arm64": "linux-arm64-gnu",
23
+ "win32-x64": "win32-x64-msvc",
24
+ };
18
25
  function loadNative() {
19
26
  const errors = [];
20
- for (const candidate of candidates) {
27
+ // 1. Try the platform-specific npm optional dependency
28
+ const packageSuffix = platformPackageMap[platformTag];
29
+ if (packageSuffix) {
21
30
  try {
22
- return require(candidate);
31
+ return require(`@gsd-build/engine-${packageSuffix}`);
23
32
  }
24
33
  catch (err) {
25
34
  const message = err instanceof Error ? err.message : String(err);
26
- errors.push(`${candidate}: ${message}`);
35
+ errors.push(`@gsd-build/engine-${packageSuffix}: ${message}`);
27
36
  }
28
37
  }
38
+ // 2. Try local release build (native/addon/gsd_engine.{platform}.node)
39
+ const releasePath = path.join(addonDir, `gsd_engine.${platformTag}.node`);
40
+ try {
41
+ return require(releasePath);
42
+ }
43
+ catch (err) {
44
+ const message = err instanceof Error ? err.message : String(err);
45
+ errors.push(`${releasePath}: ${message}`);
46
+ }
47
+ // 3. Try local dev build (native/addon/gsd_engine.dev.node)
48
+ const devPath = path.join(addonDir, "gsd_engine.dev.node");
49
+ try {
50
+ return require(devPath);
51
+ }
52
+ catch (err) {
53
+ const message = err instanceof Error ? err.message : String(err);
54
+ errors.push(`${devPath}: ${message}`);
55
+ }
29
56
  const details = errors.map((e) => ` - ${e}`).join("\n");
57
+ const supportedPlatforms = Object.keys(platformPackageMap);
30
58
  throw new Error(`Failed to load gsd_engine native addon for ${platformTag}.\n\n` +
31
59
  `Tried:\n${details}\n\n` +
32
- `Build with: npm run build:native -w @gsd/native`);
60
+ `Supported platforms: ${supportedPlatforms.join(", ")}\n` +
61
+ `If your platform is listed, try reinstalling: npm i -g gsd-pi\n` +
62
+ `Otherwise, please open an issue: https://github.com/gsd-build/gsd-2/issues`);
33
63
  }
34
64
  export const native = loadNative();
@@ -2,7 +2,10 @@
2
2
  * Native addon loader.
3
3
  *
4
4
  * Locates and loads the compiled Rust N-API addon (`.node` file).
5
- * Tries platform-tagged release builds first, then falls back to dev builds.
5
+ * Resolution order:
6
+ * 1. @gsd-build/engine-{platform} npm optional dependency (production install)
7
+ * 2. native/addon/gsd_engine.{platform}.node (local release build)
8
+ * 3. native/addon/gsd_engine.dev.node (local debug build)
6
9
  */
7
10
 
8
11
  import { createRequire } from "node:module";
@@ -15,28 +18,55 @@ const require = createRequire(import.meta.url);
15
18
  const addonDir = path.resolve(__dirname, "..", "..", "..", "native", "addon");
16
19
  const platformTag = `${process.platform}-${process.arch}`;
17
20
 
18
- const candidates = [
19
- path.join(addonDir, `gsd_engine.${platformTag}.node`),
20
- path.join(addonDir, "gsd_engine.dev.node"),
21
- ];
21
+ /** Map Node.js platform/arch to the npm package suffix */
22
+ const platformPackageMap: Record<string, string> = {
23
+ "darwin-arm64": "darwin-arm64",
24
+ "darwin-x64": "darwin-x64",
25
+ "linux-x64": "linux-x64-gnu",
26
+ "linux-arm64": "linux-arm64-gnu",
27
+ "win32-x64": "win32-x64-msvc",
28
+ };
22
29
 
23
30
  function loadNative(): Record<string, unknown> {
24
31
  const errors: string[] = [];
25
32
 
26
- for (const candidate of candidates) {
33
+ // 1. Try the platform-specific npm optional dependency
34
+ const packageSuffix = platformPackageMap[platformTag];
35
+ if (packageSuffix) {
27
36
  try {
28
- return require(candidate) as Record<string, unknown>;
37
+ return require(`@gsd-build/engine-${packageSuffix}`) as Record<string, unknown>;
29
38
  } catch (err) {
30
39
  const message = err instanceof Error ? err.message : String(err);
31
- errors.push(`${candidate}: ${message}`);
40
+ errors.push(`@gsd-build/engine-${packageSuffix}: ${message}`);
32
41
  }
33
42
  }
34
43
 
44
+ // 2. Try local release build (native/addon/gsd_engine.{platform}.node)
45
+ const releasePath = path.join(addonDir, `gsd_engine.${platformTag}.node`);
46
+ try {
47
+ return require(releasePath) as Record<string, unknown>;
48
+ } catch (err) {
49
+ const message = err instanceof Error ? err.message : String(err);
50
+ errors.push(`${releasePath}: ${message}`);
51
+ }
52
+
53
+ // 3. Try local dev build (native/addon/gsd_engine.dev.node)
54
+ const devPath = path.join(addonDir, "gsd_engine.dev.node");
55
+ try {
56
+ return require(devPath) as Record<string, unknown>;
57
+ } catch (err) {
58
+ const message = err instanceof Error ? err.message : String(err);
59
+ errors.push(`${devPath}: ${message}`);
60
+ }
61
+
35
62
  const details = errors.map((e) => ` - ${e}`).join("\n");
63
+ const supportedPlatforms = Object.keys(platformPackageMap);
36
64
  throw new Error(
37
65
  `Failed to load gsd_engine native addon for ${platformTag}.\n\n` +
38
66
  `Tried:\n${details}\n\n` +
39
- `Build with: npm run build:native -w @gsd/native`,
67
+ `Supported platforms: ${supportedPlatforms.join(", ")}\n` +
68
+ `If your platform is listed, try reinstalling: npm i -g gsd-pi\n` +
69
+ `Otherwise, please open an issue: https://github.com/gsd-build/gsd-2/issues`,
40
70
  );
41
71
  }
42
72
 
@@ -1,85 +0,0 @@
1
- {
2
- "$schema": "https://raw.githubusercontent.com/badlogic/pi-mono/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
3
- "name": "dark",
4
- "vars": {
5
- "cyan": "#00d7ff",
6
- "blue": "#5f87ff",
7
- "green": "#b5bd68",
8
- "red": "#cc6666",
9
- "yellow": "#ffff00",
10
- "gray": "#808080",
11
- "dimGray": "#666666",
12
- "darkGray": "#505050",
13
- "accent": "#8abeb7",
14
- "selectedBg": "#3a3a4a",
15
- "userMsgBg": "#343541",
16
- "toolPendingBg": "#282832",
17
- "toolSuccessBg": "#283228",
18
- "toolErrorBg": "#3c2828",
19
- "customMsgBg": "#2d2838"
20
- },
21
- "colors": {
22
- "accent": "accent",
23
- "border": "blue",
24
- "borderAccent": "cyan",
25
- "borderMuted": "darkGray",
26
- "success": "green",
27
- "error": "red",
28
- "warning": "yellow",
29
- "muted": "gray",
30
- "dim": "dimGray",
31
- "text": "",
32
- "thinkingText": "gray",
33
-
34
- "selectedBg": "selectedBg",
35
- "userMessageBg": "userMsgBg",
36
- "userMessageText": "",
37
- "customMessageBg": "customMsgBg",
38
- "customMessageText": "",
39
- "customMessageLabel": "#9575cd",
40
- "toolPendingBg": "toolPendingBg",
41
- "toolSuccessBg": "toolSuccessBg",
42
- "toolErrorBg": "toolErrorBg",
43
- "toolTitle": "",
44
- "toolOutput": "gray",
45
-
46
- "mdHeading": "#f0c674",
47
- "mdLink": "#81a2be",
48
- "mdLinkUrl": "dimGray",
49
- "mdCode": "accent",
50
- "mdCodeBlock": "green",
51
- "mdCodeBlockBorder": "gray",
52
- "mdQuote": "gray",
53
- "mdQuoteBorder": "gray",
54
- "mdHr": "gray",
55
- "mdListBullet": "accent",
56
-
57
- "toolDiffAdded": "green",
58
- "toolDiffRemoved": "red",
59
- "toolDiffContext": "gray",
60
-
61
- "syntaxComment": "#6A9955",
62
- "syntaxKeyword": "#569CD6",
63
- "syntaxFunction": "#DCDCAA",
64
- "syntaxVariable": "#9CDCFE",
65
- "syntaxString": "#CE9178",
66
- "syntaxNumber": "#B5CEA8",
67
- "syntaxType": "#4EC9B0",
68
- "syntaxOperator": "#D4D4D4",
69
- "syntaxPunctuation": "#D4D4D4",
70
-
71
- "thinkingOff": "darkGray",
72
- "thinkingMinimal": "#6e6e6e",
73
- "thinkingLow": "#5f87af",
74
- "thinkingMedium": "#81a2be",
75
- "thinkingHigh": "#b294bb",
76
- "thinkingXhigh": "#d183e8",
77
-
78
- "bashMode": "green"
79
- },
80
- "export": {
81
- "pageBg": "#18181e",
82
- "cardBg": "#1e1e24",
83
- "infoBg": "#3c3728"
84
- }
85
- }
@@ -1,84 +0,0 @@
1
- {
2
- "$schema": "https://raw.githubusercontent.com/badlogic/pi-mono/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
3
- "name": "light",
4
- "vars": {
5
- "teal": "#5a8080",
6
- "blue": "#547da7",
7
- "green": "#588458",
8
- "red": "#aa5555",
9
- "yellow": "#9a7326",
10
- "mediumGray": "#6c6c6c",
11
- "dimGray": "#767676",
12
- "lightGray": "#b0b0b0",
13
- "selectedBg": "#d0d0e0",
14
- "userMsgBg": "#e8e8e8",
15
- "toolPendingBg": "#e8e8f0",
16
- "toolSuccessBg": "#e8f0e8",
17
- "toolErrorBg": "#f0e8e8",
18
- "customMsgBg": "#ede7f6"
19
- },
20
- "colors": {
21
- "accent": "teal",
22
- "border": "blue",
23
- "borderAccent": "teal",
24
- "borderMuted": "lightGray",
25
- "success": "green",
26
- "error": "red",
27
- "warning": "yellow",
28
- "muted": "mediumGray",
29
- "dim": "dimGray",
30
- "text": "",
31
- "thinkingText": "mediumGray",
32
-
33
- "selectedBg": "selectedBg",
34
- "userMessageBg": "userMsgBg",
35
- "userMessageText": "",
36
- "customMessageBg": "customMsgBg",
37
- "customMessageText": "",
38
- "customMessageLabel": "#7e57c2",
39
- "toolPendingBg": "toolPendingBg",
40
- "toolSuccessBg": "toolSuccessBg",
41
- "toolErrorBg": "toolErrorBg",
42
- "toolTitle": "",
43
- "toolOutput": "mediumGray",
44
-
45
- "mdHeading": "yellow",
46
- "mdLink": "blue",
47
- "mdLinkUrl": "dimGray",
48
- "mdCode": "teal",
49
- "mdCodeBlock": "green",
50
- "mdCodeBlockBorder": "mediumGray",
51
- "mdQuote": "mediumGray",
52
- "mdQuoteBorder": "mediumGray",
53
- "mdHr": "mediumGray",
54
- "mdListBullet": "green",
55
-
56
- "toolDiffAdded": "green",
57
- "toolDiffRemoved": "red",
58
- "toolDiffContext": "mediumGray",
59
-
60
- "syntaxComment": "#008000",
61
- "syntaxKeyword": "#0000FF",
62
- "syntaxFunction": "#795E26",
63
- "syntaxVariable": "#001080",
64
- "syntaxString": "#A31515",
65
- "syntaxNumber": "#098658",
66
- "syntaxType": "#267F99",
67
- "syntaxOperator": "#000000",
68
- "syntaxPunctuation": "#000000",
69
-
70
- "thinkingOff": "lightGray",
71
- "thinkingMinimal": "#767676",
72
- "thinkingLow": "blue",
73
- "thinkingMedium": "teal",
74
- "thinkingHigh": "#875f87",
75
- "thinkingXhigh": "#8b008b",
76
-
77
- "bashMode": "green"
78
- },
79
- "export": {
80
- "pageBg": "#f8f8f8",
81
- "cardBg": "#ffffff",
82
- "infoBg": "#fffae6"
83
- }
84
- }