cline 3.0.54 → 3.0.55

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 (2) hide show
  1. package/package.json +12 -12
  2. package/postinstall.mjs +37 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cline",
3
- "version": "3.0.54",
3
+ "version": "3.0.55",
4
4
  "description": "Autonomous coding agent CLI - capable of creating/editing files, running commands, using the browser, and more",
5
5
  "license": "Apache-2.0",
6
6
  "keywords": [
@@ -37,18 +37,18 @@
37
37
  "postinstall": "node ./postinstall.mjs || true"
38
38
  },
39
39
  "dependencies": {
40
- "@cline/sdk": "0.0.74",
41
- "@cline/core": "0.0.74",
42
- "@cline/agents": "0.0.74",
43
- "@cline/llms": "0.0.74",
44
- "@cline/shared": "0.0.74"
40
+ "@cline/sdk": "0.0.75",
41
+ "@cline/core": "0.0.75",
42
+ "@cline/agents": "0.0.75",
43
+ "@cline/llms": "0.0.75",
44
+ "@cline/shared": "0.0.75"
45
45
  },
46
46
  "optionalDependencies": {
47
- "@cline/cli-windows-x64": "3.0.54",
48
- "@cline/cli-darwin-arm64": "3.0.54",
49
- "@cline/cli-darwin-x64": "3.0.54",
50
- "@cline/cli-windows-arm64": "3.0.54",
51
- "@cline/cli-linux-arm64": "3.0.54",
52
- "@cline/cli-linux-x64": "3.0.54"
47
+ "@cline/cli-windows-x64": "3.0.55",
48
+ "@cline/cli-darwin-arm64": "3.0.55",
49
+ "@cline/cli-darwin-x64": "3.0.55",
50
+ "@cline/cli-windows-arm64": "3.0.55",
51
+ "@cline/cli-linux-arm64": "3.0.55",
52
+ "@cline/cli-linux-x64": "3.0.55"
53
53
  }
54
54
  }
package/postinstall.mjs CHANGED
@@ -17,6 +17,35 @@ import { fileURLToPath } from "node:url";
17
17
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
18
18
  const require = createRequire(import.meta.url);
19
19
 
20
+ // CLI versions <= 3.0.54 restart the hub daemon after a background
21
+ // auto-update even while it is serving live sessions, killing those sessions
22
+ // mid-turn — and their build-fingerprint check then rejects every replacement
23
+ // hub, bricking the running TUI. That restart code is the *old* version's, so
24
+ // it cannot be patched here; but it bails out harmlessly when no hub
25
+ // discovery record exists, and it runs only after this install (and this
26
+ // script) completes. Setting the record aside protects any attached clients:
27
+ // a running hub keeps serving its established connections, clients that share
28
+ // its build fingerprint rebuild the record from a port probe, and the next
29
+ // fresh launch retires stale hubs regardless of the record.
30
+ function shieldRunningHubDiscovery() {
31
+ const explicitPath = process.env.CLINE_HUB_DISCOVERY_PATH?.trim();
32
+ const dataDir =
33
+ process.env.CLINE_DATA_DIR?.trim() ||
34
+ path.join(
35
+ process.env.CLINE_DIR?.trim() || path.join(os.homedir(), ".cline"),
36
+ "data",
37
+ );
38
+ const recordPath =
39
+ explicitPath || path.join(dataDir, "locks", "hub", "production.json");
40
+ if (!fs.existsSync(recordPath)) {
41
+ return;
42
+ }
43
+ const asidePath = `${recordPath}.superseded`;
44
+ fs.rmSync(asidePath, { force: true });
45
+ fs.renameSync(recordPath, asidePath);
46
+ console.log("Set aside hub discovery record for the updated CLI");
47
+ }
48
+
20
49
  function main() {
21
50
  if (os.platform() === "win32") {
22
51
  // On Windows, npm creates .cmd shims from the bin field.
@@ -79,6 +108,14 @@ function main() {
79
108
  console.log(`Cached cline binary at ${target}`);
80
109
  }
81
110
 
111
+ try {
112
+ shieldRunningHubDiscovery();
113
+ } catch (error) {
114
+ // Best-effort: without the shield the worst case is the pre-3.0.55
115
+ // restart-while-busy behavior, never a broken install.
116
+ console.error(`postinstall: hub discovery shield skipped: ${error.message}`);
117
+ }
118
+
82
119
  try {
83
120
  main();
84
121
  } catch (error) {