packet28 0.2.0 → 0.2.2

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.
@@ -4,7 +4,7 @@
4
4
  // { "command": "packet28-mcp", "args": ["--root", "."] }
5
5
 
6
6
  import { spawn } from "node:child_process";
7
- import { existsSync } from "node:fs";
7
+ import { chmodSync, existsSync, statSync } from "node:fs";
8
8
  import { createRequire } from "node:module";
9
9
  import path from "node:path";
10
10
  import { fileURLToPath } from "node:url";
@@ -50,6 +50,16 @@ function findBinary(name) {
50
50
 
51
51
  const binaryPath = findBinary("Packet28");
52
52
 
53
+ // npm strips execute permissions from tarballs — fix on first run
54
+ try {
55
+ const mode = statSync(binaryPath).mode;
56
+ if (!(mode & 0o111)) {
57
+ chmodSync(binaryPath, mode | 0o755);
58
+ }
59
+ } catch {
60
+ // ignore
61
+ }
62
+
53
63
  // Prepend "mcp serve" to the user's args
54
64
  const child = spawn(binaryPath, ["mcp", "serve", ...process.argv.slice(2)], {
55
65
  stdio: "inherit",
package/bin/packet28.js CHANGED
@@ -3,7 +3,7 @@
3
3
  // Resolves the correct platform-specific binary and spawns it.
4
4
 
5
5
  import { execSync, spawn } from "node:child_process";
6
- import { existsSync } from "node:fs";
6
+ import { chmodSync, existsSync, statSync } from "node:fs";
7
7
  import { createRequire } from "node:module";
8
8
  import path from "node:path";
9
9
  import { fileURLToPath } from "node:url";
@@ -80,6 +80,21 @@ function findBinary(name) {
80
80
 
81
81
  const binaryPath = findBinary("Packet28");
82
82
 
83
+ // npm strips execute permissions from tarballs — fix on first run
84
+ try {
85
+ const mode = statSync(binaryPath).mode;
86
+ if (!(mode & 0o111)) {
87
+ chmodSync(binaryPath, mode | 0o755);
88
+ // Also fix packet28d (daemon) in the same directory
89
+ const daemonPath = path.join(path.dirname(binaryPath), "packet28d");
90
+ if (existsSync(daemonPath)) {
91
+ chmodSync(daemonPath, 0o755);
92
+ }
93
+ }
94
+ } catch {
95
+ // ignore — will fail at spawn if truly broken
96
+ }
97
+
83
98
  const child = spawn(binaryPath, process.argv.slice(2), {
84
99
  stdio: "inherit",
85
100
  env: { ...process.env, PACKET28_MANAGED_BY_NPM: "1" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "packet28",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
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": {
@@ -21,10 +21,10 @@
21
21
  "vendor"
22
22
  ],
23
23
  "optionalDependencies": {
24
- "@packet28/darwin-arm64": "0.2.0",
25
- "@packet28/darwin-x64": "0.2.0",
26
- "@packet28/linux-x64": "0.2.0",
27
- "@packet28/linux-arm64": "0.2.0"
24
+ "@packet28/darwin-arm64": "0.2.2",
25
+ "@packet28/darwin-x64": "0.2.2",
26
+ "@packet28/linux-x64": "0.2.2",
27
+ "@packet28/linux-arm64": "0.2.2"
28
28
  },
29
29
  "keywords": [
30
30
  "ai",