packet28 0.2.51 → 0.2.52
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/bin/packet28.js +16 -9
- package/package.json +5 -5
package/bin/packet28.js
CHANGED
|
@@ -35,6 +35,12 @@ function getPlatformKey() {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
function findBinary(name) {
|
|
38
|
+
if (process.env.PACKET28_BINARY) {
|
|
39
|
+
const override = process.env.PACKET28_BINARY;
|
|
40
|
+
if (existsSync(override)) return override;
|
|
41
|
+
throw new Error(`PACKET28_BINARY does not exist: ${override}`);
|
|
42
|
+
}
|
|
43
|
+
|
|
38
44
|
const platformKey = getPlatformKey();
|
|
39
45
|
if (!platformKey) {
|
|
40
46
|
throw new Error(
|
|
@@ -55,7 +61,16 @@ function findBinary(name) {
|
|
|
55
61
|
// optional dep not installed — fall through
|
|
56
62
|
}
|
|
57
63
|
|
|
58
|
-
// Try 2:
|
|
64
|
+
// Try 2: PATH override. This keeps local development and smoke tests honest
|
|
65
|
+
// when an older unpacked vendor binary is present beside this wrapper.
|
|
66
|
+
try {
|
|
67
|
+
const which = execSync(`which ${name}`, { encoding: "utf-8" }).trim();
|
|
68
|
+
if (which && existsSync(which)) return which;
|
|
69
|
+
} catch {
|
|
70
|
+
// not on PATH
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Try 3: local vendor directory (for development / cargo-built binaries)
|
|
59
74
|
const localBinary = path.join(
|
|
60
75
|
__dirname,
|
|
61
76
|
"..",
|
|
@@ -65,14 +80,6 @@ function findBinary(name) {
|
|
|
65
80
|
);
|
|
66
81
|
if (existsSync(localBinary)) return localBinary;
|
|
67
82
|
|
|
68
|
-
// Try 3: check if the binary is already on PATH
|
|
69
|
-
try {
|
|
70
|
-
const which = execSync(`which ${name}`, { encoding: "utf-8" }).trim();
|
|
71
|
-
if (which && existsSync(which)) return which;
|
|
72
|
-
} catch {
|
|
73
|
-
// not on PATH
|
|
74
|
-
}
|
|
75
|
-
|
|
76
83
|
throw new Error(
|
|
77
84
|
`Could not find ${name} binary. Reinstall: npm install -g packet28@latest`,
|
|
78
85
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "packet28",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.52",
|
|
4
4
|
"description": "Context broker for AI coding agents — manages your agent's context window so it conserves tokens",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
"vendor"
|
|
23
23
|
],
|
|
24
24
|
"optionalDependencies": {
|
|
25
|
-
"@packet28/darwin-arm64": "0.2.
|
|
26
|
-
"@packet28/darwin-x64": "0.2.
|
|
27
|
-
"@packet28/linux-x64": "0.2.
|
|
28
|
-
"@packet28/linux-arm64": "0.2.
|
|
25
|
+
"@packet28/darwin-arm64": "0.2.52",
|
|
26
|
+
"@packet28/darwin-x64": "0.2.52",
|
|
27
|
+
"@packet28/linux-x64": "0.2.52",
|
|
28
|
+
"@packet28/linux-arm64": "0.2.52"
|
|
29
29
|
},
|
|
30
30
|
"keywords": [
|
|
31
31
|
"ai",
|