@wrongstack/core 0.296.3 → 0.296.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.
@@ -1,5 +1,24 @@
1
1
  export declare const CHRONICLE_PROJECT_SERVER_METADATA_FILE = "server.json";
2
2
  export declare function chronicleProjectServerKey(projectDir: string): string;
3
+ /**
4
+ * Deterministic per-project chronicle IPC endpoint.
5
+ *
6
+ * The Unix subdirectory is the short `wsch-v<V>/` (was
7
+ * `wrongstack-chronicle-v<V>/`, which left a single byte of macOS `sun_path`
8
+ * headroom under the ~48-byte per-user TMPDIR — see the codebase-index macOS
9
+ * incident and `@wrongstack/persistence` socket-path helpers). ~86 bytes
10
+ * worst-case macOS now.
11
+ *
12
+ * Migration: the protocol version stays embedded in the path, so this rename
13
+ * behaves exactly like a protocol bump — old daemons keep listening on the old
14
+ * `wrongstack-chronicle-v<V>/` path, are never contacted again, and exit on
15
+ * their idle timeout. No coexistence window: a client build always talks only
16
+ * to the endpoint scheme it derives. Bump
17
+ * `CHRONICLE_PROJECT_SERVER_PROTOCOL_VERSION` for wire changes as before; the
18
+ * prefix itself must not grow without re-checking the byte budget.
19
+ * The Windows pipe name keeps the long prefix — named pipes have no
20
+ * `sun_path` limit.
21
+ */
3
22
  export declare function chronicleProjectServerEndpoint(projectDir: string): string;
4
23
  export declare function chronicleProjectServerMetadataPath(projectDir: string): string;
5
24
  export declare function ensureChronicleProjectServerSocketDirectory(endpoint: string): void;
@@ -1 +1 @@
1
- {"version":3,"file":"project-server-endpoint.d.ts","sourceRoot":"","sources":["../../src/chronicle/project-server-endpoint.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,sCAAsC,gBAAgB,CAAC;AAOpE,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAKpE;AAED,wBAAgB,8BAA8B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAUzE;AAED,wBAAgB,kCAAkC,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE7E;AAED,wBAAgB,2CAA2C,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAIlF"}
1
+ {"version":3,"file":"project-server-endpoint.d.ts","sourceRoot":"","sources":["../../src/chronicle/project-server-endpoint.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,sCAAsC,gBAAgB,CAAC;AAOpE,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAKpE;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,8BAA8B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAUzE;AAED,wBAAgB,kCAAkC,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE7E;AAED,wBAAgB,2CAA2C,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAQlF"}
@@ -2876,6 +2876,13 @@ import * as fs7 from "node:fs";
2876
2876
  import * as os2 from "node:os";
2877
2877
  import * as path10 from "node:path";
2878
2878
 
2879
+ // src/utils/socket-path.ts
2880
+ import {
2881
+ assertUnixSocketPathWithinLimit,
2882
+ checkUnixSocketPath,
2883
+ unixSocketPathLimit
2884
+ } from "@wrongstack/persistence";
2885
+
2879
2886
  // src/chronicle/project-server-protocol.ts
2880
2887
  var CHRONICLE_PROJECT_SERVER_PROTOCOL_VERSION = 2;
2881
2888
  var CHRONICLE_PROJECT_SERVER_MAX_FRAME_CHARS = 64 * 1024 * 1024;
@@ -2900,7 +2907,7 @@ function chronicleProjectServerEndpoint(projectDir) {
2900
2907
  }
2901
2908
  return path10.join(
2902
2909
  os2.tmpdir(),
2903
- `wrongstack-chronicle-v${CHRONICLE_PROJECT_SERVER_PROTOCOL_VERSION}`,
2910
+ `wsch-v${CHRONICLE_PROJECT_SERVER_PROTOCOL_VERSION}`,
2904
2911
  `${key}.sock`
2905
2912
  );
2906
2913
  }
@@ -2909,6 +2916,7 @@ function chronicleProjectServerMetadataPath(projectDir) {
2909
2916
  }
2910
2917
  function ensureChronicleProjectServerSocketDirectory(endpoint2) {
2911
2918
  if (process.platform !== "win32") {
2919
+ assertUnixSocketPathWithinLimit(endpoint2, "chronicle");
2912
2920
  fs7.mkdirSync(path10.dirname(endpoint2), { recursive: true, mode: 448 });
2913
2921
  }
2914
2922
  }