@surething/cockpit 1.0.283 → 1.0.284

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 (34) hide show
  1. package/.next-prod/BUILD_ID +1 -1
  2. package/.next-prod/app-path-routes-manifest.json +2 -2
  3. package/.next-prod/build-manifest.json +2 -2
  4. package/.next-prod/cockpit-build.json +1 -1
  5. package/.next-prod/prerender-manifest.json +3 -3
  6. package/.next-prod/server/app/_global-error.html +1 -1
  7. package/.next-prod/server/app/_global-error.rsc +1 -1
  8. package/.next-prod/server/app/_global-error.segments/_full.segment.rsc +1 -1
  9. package/.next-prod/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  10. package/.next-prod/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  11. package/.next-prod/server/app/_not-found.html +1 -1
  12. package/.next-prod/server/app/_not-found.rsc +1 -1
  13. package/.next-prod/server/app/_not-found.segments/_full.segment.rsc +1 -1
  14. package/.next-prod/server/app/_not-found.segments/_index.segment.rsc +1 -1
  15. package/.next-prod/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  16. package/.next-prod/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  17. package/.next-prod/server/app-paths-manifest.json +2 -2
  18. package/.next-prod/server/chunks/6495.js +1 -1
  19. package/.next-prod/server/middleware-build-manifest.js +1 -1
  20. package/.next-prod/server/pages/404.html +1 -1
  21. package/.next-prod/server/pages/500.html +1 -1
  22. package/.next-prod/server/server-reference-manifest.json +1 -1
  23. package/.next-prod/trace +14 -14
  24. package/.next-prod/trace-build +1 -1
  25. package/bin/instanceLock.mjs +23 -1
  26. package/dist/auth.mjs +7 -2
  27. package/dist/{chunk-TOVSUPTJ.mjs → chunk-2KRJ7JEJ.mjs} +1 -1
  28. package/dist/{chunk-BE235BMW.mjs → chunk-FP25USWW.mjs} +17 -3
  29. package/dist/httpApi.mjs +2 -2
  30. package/dist/scheduledTasks.mjs +1 -1
  31. package/dist/wsServer.mjs +2 -2
  32. package/package.json +1 -1
  33. /package/.next-prod/static/{UM1QtmCsp6wKOKw_z_UEq → qXlYDVAyeD8v5tCOCGbXD}/_buildManifest.js +0 -0
  34. /package/.next-prod/static/{UM1QtmCsp6wKOKw_z_UEq → qXlYDVAyeD8v5tCOCGbXD}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- [{"name":"run-webpack","duration":16307887,"timestamp":244657357,"id":14,"parentId":1,"tags":{},"startTime":1791724161039,"traceId":"f436ebbec7d8f5bc"},{"name":"run-typescript","duration":5544261,"timestamp":260969441,"id":1445,"parentId":1,"tags":{},"startTime":1791724177351,"traceId":"f436ebbec7d8f5bc"},{"name":"static-check","duration":1396614,"timestamp":266552731,"id":1448,"parentId":1,"tags":{},"startTime":1791724182935,"traceId":"f436ebbec7d8f5bc"},{"name":"static-generation","duration":5801222,"timestamp":268096401,"id":1760,"parentId":1,"tags":{},"startTime":1791724184478,"traceId":"f436ebbec7d8f5bc"},{"name":"collect-build-traces","duration":26388764,"timestamp":267950026,"id":1757,"parentId":1,"tags":{},"startTime":1791724184332,"traceId":"f436ebbec7d8f5bc"},{"name":"telemetry-flush","duration":51,"timestamp":294342728,"id":1769,"parentId":1,"tags":{},"startTime":1791724210725,"traceId":"f436ebbec7d8f5bc"},{"name":"next-build","duration":49956617,"timestamp":244386174,"id":1,"tags":{"buildMode":"default","version":"16.3.0","bundler":"webpack","has-custom-webpack-config":"true","use-build-worker":"false"},"startTime":1791724160768,"traceId":"f436ebbec7d8f5bc"}]
1
+ [{"name":"run-webpack","duration":13516309,"timestamp":269565055,"id":14,"parentId":1,"tags":{},"startTime":1791735491429,"traceId":"df0be3604223f322"},{"name":"run-typescript","duration":4477628,"timestamp":283085589,"id":1445,"parentId":1,"tags":{},"startTime":1791735504949,"traceId":"df0be3604223f322"},{"name":"static-check","duration":1037414,"timestamp":287596356,"id":1448,"parentId":1,"tags":{},"startTime":1791735509460,"traceId":"df0be3604223f322"},{"name":"static-generation","duration":4903171,"timestamp":288718815,"id":1760,"parentId":1,"tags":{},"startTime":1791735510582,"traceId":"df0be3604223f322"},{"name":"collect-build-traces","duration":20127880,"timestamp":288634360,"id":1757,"parentId":1,"tags":{},"startTime":1791735510498,"traceId":"df0be3604223f322"},{"name":"telemetry-flush","duration":49,"timestamp":308765388,"id":1769,"parentId":1,"tags":{},"startTime":1791735530629,"traceId":"df0be3604223f322"},{"name":"next-build","duration":39472199,"timestamp":269293247,"id":1,"tags":{"buildMode":"default","version":"16.3.0","bundler":"webpack","has-custom-webpack-config":"true","use-build-worker":"false"},"startTime":1791735491157,"traceId":"df0be3604223f322"}]
@@ -38,6 +38,23 @@ function isStale(rec) {
38
38
  return !pidAlive(rec.pid);
39
39
  }
40
40
 
41
+ /**
42
+ * renameSync that rides out Windows sharing violations: a contender reading the lock at
43
+ * that instant makes the rename fail with EPERM / EACCES / EBUSY. The read is brief, so
44
+ * retry with a short (synchronous — this runs before anything else boots) backoff.
45
+ */
46
+ function renameOver(from, to) {
47
+ for (let attempt = 0; ; attempt++) {
48
+ try {
49
+ return renameSync(from, to);
50
+ } catch (e) {
51
+ const blocked = e.code === 'EPERM' || e.code === 'EACCES' || e.code === 'EBUSY';
52
+ if (!blocked || attempt >= 20) throw e;
53
+ Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, 10);
54
+ }
55
+ }
56
+ }
57
+
41
58
  /**
42
59
  * Create `path` holding `body`, failing if it exists. The content is written to a temp
43
60
  * file first and published with link() — which, like O_EXCL, refuses an existing target —
@@ -95,7 +112,12 @@ export function acquireInstanceLock(home) {
95
112
  if (readText(path) !== seen) continue;
96
113
  const tmp = `${path}.${process.pid}.${randomUUID()}.tmp`;
97
114
  writeFileSync(tmp, body, { mode: 0o600 });
98
- renameSync(tmp, path);
115
+ try {
116
+ renameOver(tmp, path);
117
+ } catch (e) {
118
+ try { unlinkSync(tmp); } catch { /* gone */ }
119
+ throw e;
120
+ }
99
121
  return won();
100
122
  } finally {
101
123
  try { unlinkSync(claim); } catch { /* gone */ }
package/dist/auth.mjs CHANGED
@@ -129,12 +129,17 @@ function checkOriginGate(input) {
129
129
  if (mutating && input.origin !== void 0) {
130
130
  if (!input.host) return { action: "deny", reason: "missing host" };
131
131
  let originHost;
132
+ let defaultPort;
132
133
  try {
133
- originHost = new URL(input.origin).host;
134
+ const o = new URL(input.origin);
135
+ originHost = o.host;
136
+ defaultPort = o.protocol === "https:" ? ":443" : o.protocol === "http:" ? ":80" : "";
134
137
  } catch {
135
138
  return { action: "deny", reason: "unparseable origin" };
136
139
  }
137
- if (!originHost || originHost.toLowerCase() !== input.host.trim().toLowerCase()) {
140
+ let selfHost = input.host.trim().toLowerCase();
141
+ if (defaultPort && selfHost.endsWith(defaultPort)) selfHost = selfHost.slice(0, -defaultPort.length);
142
+ if (!originHost || originHost.toLowerCase() !== selfHost) {
138
143
  return { action: "deny", reason: "cross-origin" };
139
144
  }
140
145
  }
@@ -17,7 +17,7 @@ import {
17
17
  readJsonFile,
18
18
  withFileLock,
19
19
  writeJsonFile
20
- } from "./chunk-BE235BMW.mjs";
20
+ } from "./chunk-FP25USWW.mjs";
21
21
 
22
22
  // packages/feature/console/src/server/plugins/browser/BrowserBridge.ts
23
23
  import { WebSocket } from "ws";
@@ -28977,6 +28977,21 @@ async function readJsonFileForUpdate(filePath, defaultValue) {
28977
28977
  );
28978
28978
  }
28979
28979
  }
28980
+ var isRenameBlocked = (err) => {
28981
+ const code = err?.code;
28982
+ return code === "EPERM" || code === "EACCES" || code === "EBUSY";
28983
+ };
28984
+ async function renameOver(from, to) {
28985
+ if (process.platform !== "win32") return rename(from, to);
28986
+ for (let attempt = 0; ; attempt++) {
28987
+ try {
28988
+ return renameSync(from, to);
28989
+ } catch (err) {
28990
+ if (attempt >= 12 || !isRenameBlocked(err)) throw err;
28991
+ await new Promise((r) => setTimeout(r, Math.min(10 * (attempt + 1), 150)));
28992
+ }
28993
+ }
28994
+ }
28980
28995
  async function writeJsonFile(filePath, data) {
28981
28996
  await ensureParentDir(filePath);
28982
28997
  const body = JSON.stringify(data, null, 2);
@@ -28985,12 +29000,11 @@ async function writeJsonFile(filePath, data) {
28985
29000
  try {
28986
29001
  await writeFile(tmp, body, secret3 ? { encoding: "utf-8", mode: OWNER_ONLY } : "utf-8");
28987
29002
  if (secret3) await chmod(tmp, OWNER_ONLY);
28988
- await rename(tmp, filePath);
29003
+ await renameOver(tmp, filePath);
28989
29004
  } catch (err) {
28990
29005
  await unlink(tmp).catch(() => {
28991
29006
  });
28992
- const code = err.code;
28993
- if (code !== "EPERM" && code !== "EACCES" && code !== "EBUSY") throw err;
29007
+ if (!isRenameBlocked(err)) throw err;
28994
29008
  await writeFile(filePath, body, secret3 ? { encoding: "utf-8", mode: OWNER_ONLY } : "utf-8");
28995
29009
  if (secret3) await chmod(filePath, OWNER_ONLY);
28996
29010
  }
package/dist/httpApi.mjs CHANGED
@@ -29,11 +29,11 @@ import {
29
29
  unregisterBrowser,
30
30
  unregisterTerminal,
31
31
  writeStdinToCommand
32
- } from "./chunk-TOVSUPTJ.mjs";
32
+ } from "./chunk-2KRJ7JEJ.mjs";
33
33
  import {
34
34
  getTerminalHistoryPath,
35
35
  tightenSecretFiles
36
- } from "./chunk-BE235BMW.mjs";
36
+ } from "./chunk-FP25USWW.mjs";
37
37
  import "./chunk-7P6ASYW6.mjs";
38
38
 
39
39
  // src/lib/httpApi.ts
@@ -22,7 +22,7 @@ import {
22
22
  updateGlobalState,
23
23
  withFileLock,
24
24
  writeJsonFile
25
- } from "./chunk-BE235BMW.mjs";
25
+ } from "./chunk-FP25USWW.mjs";
26
26
  import "./chunk-7P6ASYW6.mjs";
27
27
 
28
28
  // packages/feature/agent/src/server/scheduledTasks.ts
package/dist/wsServer.mjs CHANGED
@@ -21,7 +21,7 @@ import {
21
21
  spawnPtyInHost,
22
22
  unregisterBrowser,
23
23
  writeStdinToCommand
24
- } from "./chunk-TOVSUPTJ.mjs";
24
+ } from "./chunk-2KRJ7JEJ.mjs";
25
25
  import {
26
26
  Effect_exports,
27
27
  FSError,
@@ -39,7 +39,7 @@ import {
39
39
  recoverStashedCodexRollouts,
40
40
  recoverStashedTranscripts,
41
41
  sanitizedSpawnEnv
42
- } from "./chunk-BE235BMW.mjs";
42
+ } from "./chunk-FP25USWW.mjs";
43
43
  import {
44
44
  registerWatcherSubscriber,
45
45
  subscribeBuildProgress
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@surething/cockpit",
3
- "version": "1.0.283",
3
+ "version": "1.0.284",
4
4
  "description": "OpenCockpit — the open Claude Code GUI for any LLM (Claude, Codex, DeepSeek, GLM, Kimi, Ollama). Cockpit IDE: parallel projects, terminal, browser & DB bubbles, code review. Self-host, local-first, MIT.",
5
5
  "author": "Robert",
6
6
  "license": "MIT",