@cotal-ai/seat 0.136.8 → 0.138.0

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/README.md CHANGED
@@ -19,6 +19,21 @@ against their own authorization policy; a PID is not a lifecycle or ownership fe
19
19
  throws for an unsupported transport or missing native helper, and for a socket without a
20
20
  file descriptor. No PTY or custodian is started by reading the peer identity.
21
21
 
22
+ The same helper also carries the host primitives the local `cotal daemon` endpoint uses, which,
23
+ unlike custody, are built for Linux, macOS and Windows (`src/host.ts`): `localPeerCredentials`
24
+ (Linux `SO_PEERCRED`; macOS `LOCAL_PEERCRED`, the uid `getpeereid(3)` reads, with
25
+ `LOCAL_PEERPID`), `lockExclusiveNb` (`flock(2)`; on Windows `LockFileEx` on one byte past any
26
+ content), `processStartTime` (macOS and Windows), `darwinUserCacheDir`, `darwinLaunchdJob` (a
27
+ read-only `SMJobCopyDictionary` lookup of a loaded job, resolved at run time because Apple
28
+ deprecated it with no replacement and documents its contents as unstable), and on Windows
29
+ `windowsUserSid`, `windowsDirSecurity`, `listenPipe` and `connectPipe`. The pipe functions create,
30
+ connect and authenticate a named pipe in native code, because Node's own pipe server creates it
31
+ with a default DACL that admits Everyone and Anonymous for reading and accepts remote clients:
32
+ every instance gets a protected DACL granting only the user's SID, `FILE_FLAG_FIRST_PIPE_INSTANCE`
33
+ on the first and `PIPE_REJECT_REMOTE_CLIENTS` on all, and each side reads the other's process
34
+ token user and creation time before a connection is handed to Node as a descriptor.
35
+ `native/peercred_win32.c` documents each flag.
36
+
22
37
  The custodian raises its child's `oom_score_adj` to 500 and writes one line to `custodian.log`
23
38
  when the kernel refuses. The manager's in-process `pty` runtime applies the same preference
24
39
  through the exported `preferSeatForOomKill`.
@@ -28,11 +43,16 @@ developer tree, not a publishable one: it prints a host-dev-build banner and wri
28
43
  `build/Release/linux-<arch>/peercred.node`. Pack and publish require both `linux-x64`
29
44
  (ELF e_machine 62) and `linux-arm64` (ELF e_machine 183), copied in by
30
45
  `scripts/seat-assemble-natives.mjs` from native builder jobs. `prepack` and
31
- `prepublishOnly` assert those two files, then compile TypeScript without rebuilding either
32
- native helper. The ARM load job installs the same packed tarball
46
+ `prepublishOnly` assert both Linux helpers and the macOS and Windows helpers for x64 and arm64,
47
+ including their container format and architecture, then compile TypeScript without rebuilding them. The ARM load job installs the same packed tarball
33
48
  with no rebuild. The compile uses the `include/node` directory next to the running
34
- Node binary, not a hardcoded `/usr/include/node`. Off Linux the compile script is a no-op, so
35
- Windows `pnpm build` does not need headers or a C compiler. There is no `binding.gyp`, so
49
+ Node binary, not a hardcoded `/usr/include/node`. Off Linux `pnpm build` skips the compile, so
50
+ a macOS or Windows `pnpm build` does not need headers or a C compiler. `pnpm build:native`
51
+ compiles for the host on all three: macOS with `cc`, targeting macOS 11 like the workspace binding, into
52
+ `build/Release/darwin-<arch>/`, Windows with `cl.exe` from the MSVC Developer Command Prompt against
53
+ the Node headers and import library the workspace binding pins in `native/node-sdk.json`, into
54
+ `build/Release/win32-<arch>/`. Until a macOS or Windows helper is built or shipped, the host
55
+ primitives throw that it is missing. There is no `binding.gyp` in the package, so
36
56
  `pnpm install` does not infer `node-gyp rebuild`. Customer `npm i` does not compile it. A host
37
57
  without a C compiler installs the prebuilt helpers; a missing helper, an unsupported
38
58
  `linux-<arch>`, or a load failure throws rather than compiling in place.
package/dist/host.d.ts ADDED
@@ -0,0 +1,95 @@
1
+ /**
2
+ * Host primitives for an authenticated same-user local endpoint on Linux, macOS and Windows, from
3
+ * the same native helper as {@link peerCredentials}. Seat custody stays Linux only; these do not.
4
+ * Each throws when this platform or arch has no helper, or when the call does not apply to it.
5
+ */
6
+ import type { Socket } from "node:net";
7
+ import { type PeerCredentials } from "./peercred.js";
8
+ /** A pipe connection the native side authenticated: a libuv descriptor for `net.Socket({ fd })`,
9
+ * and the peer process's pid, token user SID and creation time, read through one process handle. */
10
+ export interface PipePeer {
11
+ readonly fd: number;
12
+ readonly pid: number;
13
+ readonly user: string;
14
+ readonly birth: string;
15
+ }
16
+ /** A connection the native side closed unread because its peer's identity could not be read. */
17
+ export interface PipeRefused {
18
+ readonly refused: string;
19
+ readonly pid: number;
20
+ }
21
+ export interface PipeListener {
22
+ /** The next client: authenticated, or refused unread. Rejects with code `ECANCELED` once closed. */
23
+ accept(): Promise<PipePeer | PipeRefused>;
24
+ /** Stop accepting and close every instance not yet handed off. Idempotent. */
25
+ close(): void;
26
+ }
27
+ /** One ACE of a Windows DACL. `sid` is null for ACE types other than allow (0) and deny (1). */
28
+ export interface WindowsAce {
29
+ readonly type: number;
30
+ readonly flags: number;
31
+ readonly mask: number;
32
+ readonly sid: string | null;
33
+ }
34
+ /** A Windows directory as read through a handle that does not follow reparse points. `aces` is null
35
+ * for a NULL DACL, which grants everyone everything. */
36
+ export interface WindowsDirSecurity {
37
+ readonly directory: boolean;
38
+ readonly reparse: boolean;
39
+ readonly owner: string | null;
40
+ readonly aces: readonly WindowsAce[] | null;
41
+ }
42
+ /** A loaded launchd job as `SMJobCopyDictionary` reports it, each field present only when the
43
+ * dictionary carries it readably. Apple documents those contents as not wholly representative of
44
+ * the on-disk plist and not stable between releases, so an absent field proves nothing. */
45
+ export interface DarwinLaunchdJob {
46
+ readonly label?: string;
47
+ readonly program?: string;
48
+ readonly programArguments?: readonly string[];
49
+ readonly workingDirectory?: string;
50
+ }
51
+ /** What a launchd lookup established: the job as loaded, that no job has the label, or that the
52
+ * lookup itself could not be made (not macOS, no helper, or the deprecated API is gone). */
53
+ export type DarwinLaunchdLookup = {
54
+ readonly state: "loaded";
55
+ readonly job: DarwinLaunchdJob;
56
+ } | {
57
+ readonly state: "absent";
58
+ } | {
59
+ readonly state: "unavailable";
60
+ readonly reason: string;
61
+ };
62
+ /** The kernel's credentials for the peer of a connected unix socket: `SO_PEERCRED` on Linux,
63
+ * `LOCAL_PEERCRED` (the uid getpeereid(3) reads) and `LOCAL_PEERPID` on macOS. */
64
+ export declare function localPeerCredentials(sock: Socket): PeerCredentials;
65
+ /**
66
+ * Take an exclusive kernel lock on the open file `fd` without blocking. True when this process now
67
+ * holds it, false when another open file does. `flock(2)` on Linux and macOS; on Windows
68
+ * `LockFileEx` on one byte at 1 GiB, past any content, so readers of the file are never blocked.
69
+ * Either way the system releases it when the holder's last handle closes, including at its death.
70
+ */
71
+ export declare function lockExclusiveNb(fd: number): boolean;
72
+ /** The kernel's start time of process `pid` (macOS and Windows), or undefined when it does not
73
+ * exist. A reused pid has a different value. Linux reads `/proc/<pid>/stat` instead. */
74
+ export declare function processStartTime(pid: number): string | undefined;
75
+ /** macOS: `confstr(_CS_DARWIN_USER_CACHE_DIR)`, this user's 0700 cache directory, which no
76
+ * environment variable changes and the system never cleans. */
77
+ export declare function darwinUserCacheDir(): string;
78
+ /**
79
+ * macOS: the job launchd has loaded under `label` in this process's per-user domain
80
+ * (`kSMDomainUserLaunchd`), read with `SMJobCopyDictionary` and changing nothing. That domain is
81
+ * the caller's own session: a process in the desktop session reads its GUI domain. Never throws
82
+ * for an unavailable lookup; it reports one.
83
+ */
84
+ export declare function darwinLaunchdJob(label: string): DarwinLaunchdLookup;
85
+ /** Windows: this process's token user SID, as `S-1-...`. */
86
+ export declare function windowsUserSid(): string;
87
+ /** Windows: the owner and DACL of `path`, read without following a reparse point. */
88
+ export declare function windowsDirSecurity(path: string): WindowsDirSecurity;
89
+ /** Windows: serve pipe `name` to this user only. Throws code `EADDRINUSE` when anything already
90
+ * serves the name. See native/peercred_win32.c for every flag. */
91
+ export declare function listenPipe(name: string): PipeListener;
92
+ /** Windows: open pipe `name`, authenticate its server process, and write nothing. Rejects with code
93
+ * `ENOENT` when nothing serves it and `ETIMEDOUT` when every instance stayed busy. */
94
+ export declare function connectPipe(name: string, timeoutMs: number): Promise<PipePeer>;
95
+ //# sourceMappingURL=host.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,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const fn = loadNativeHelper()[name];
4
+ if (typeof fn !== "function")
5
+ throw new Error(`@cotal-ai/seat: ${name} is not available on ${process.platform}`);
6
+ return fn;
7
+ }
8
+ /** The kernel's credentials for the peer of a connected unix socket: `SO_PEERCRED` on Linux,
9
+ * `LOCAL_PEERCRED` (the uid getpeereid(3) reads) and `LOCAL_PEERPID` on macOS. */
10
+ export function localPeerCredentials(sock) {
11
+ return native("peercred")(socketFd(sock));
12
+ }
13
+ /**
14
+ * Take an exclusive kernel lock on the open file `fd` without blocking. True when this process now
15
+ * holds it, false when another open file does. `flock(2)` on Linux and macOS; on Windows
16
+ * `LockFileEx` on one byte at 1 GiB, past any content, so readers of the file are never blocked.
17
+ * Either way the system releases it when the holder's last handle closes, including at its death.
18
+ */
19
+ export function lockExclusiveNb(fd) {
20
+ return process.platform === "win32" ? native("lockExclusiveNb")(fd) : native("flockExclusiveNb")(fd);
21
+ }
22
+ /** The kernel's start time of process `pid` (macOS and Windows), or undefined when it does not
23
+ * exist. A reused pid has a different value. Linux reads `/proc/<pid>/stat` instead. */
24
+ export function processStartTime(pid) {
25
+ return native("processStartTime")(pid);
26
+ }
27
+ /** macOS: `confstr(_CS_DARWIN_USER_CACHE_DIR)`, this user's 0700 cache directory, which no
28
+ * environment variable changes and the system never cleans. */
29
+ export function darwinUserCacheDir() {
30
+ return native("userCacheDir")();
31
+ }
32
+ /**
33
+ * macOS: the job launchd has loaded under `label` in this process's per-user domain
34
+ * (`kSMDomainUserLaunchd`), read with `SMJobCopyDictionary` and changing nothing. That domain is
35
+ * the caller's own session: a process in the desktop session reads its GUI domain. Never throws
36
+ * for an unavailable lookup; it reports one.
37
+ */
38
+ export function darwinLaunchdJob(label) {
39
+ if (process.platform !== "darwin")
40
+ return { state: "unavailable", reason: `launchd exists only on macOS (this is ${process.platform})` };
41
+ let lookup;
42
+ try {
43
+ lookup = native("launchdJob");
44
+ }
45
+ catch (e) {
46
+ return { state: "unavailable", reason: e.message };
47
+ }
48
+ const found = lookup(label);
49
+ if (found === null)
50
+ return { state: "absent" };
51
+ if ("unavailable" in found)
52
+ return { state: "unavailable", reason: found.unavailable };
53
+ return { state: "loaded", job: found };
54
+ }
55
+ /** Windows: this process's token user SID, as `S-1-...`. */
56
+ export function windowsUserSid() {
57
+ return native("currentUserSid")();
58
+ }
59
+ /** Windows: the owner and DACL of `path`, read without following a reparse point. */
60
+ export function windowsDirSecurity(path) {
61
+ return native("inspectDir")(path);
62
+ }
63
+ /** Windows: serve pipe `name` to this user only. Throws code `EADDRINUSE` when anything already
64
+ * serves the name. See native/peercred_win32.c for every flag. */
65
+ export function listenPipe(name) {
66
+ const handle = native("pipeListen")(name);
67
+ const accept = native("pipeAccept");
68
+ const close = native("pipeClose");
69
+ return { accept: () => accept(handle), close: () => close(handle) };
70
+ }
71
+ /** Windows: open pipe `name`, authenticate its server process, and write nothing. Rejects with code
72
+ * `ENOENT` when nothing serves it and `ETIMEDOUT` when every instance stayed busy. */
73
+ export function connectPipe(name, timeoutMs) {
74
+ return native("pipeConnect")(name, timeoutMs);
75
+ }
76
+ //# sourceMappingURL=host.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host.js","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAwB,MAAM,eAAe,CAAC;AAyEjF,SAAS,MAAM,CAA6B,IAAO;IACjD,MAAM,EAAE,GAAG,gBAAgB,EAAc,CAAC,IAAI,CAAC,CAAC;IAChD,IAAI,OAAO,EAAE,KAAK,UAAU;QAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,IAAI,wBAAwB,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IACjH,OAAO,EAAgC,CAAC;AAC1C,CAAC;AAED;mFACmF;AACnF,MAAM,UAAU,oBAAoB,CAAC,IAAY;IAC/C,OAAO,MAAM,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AAC5C,CAAC;A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D;AAC5D,MAAM,UAAU,cAAc;IAC5B,OAAO,MAAM,CAAC,gBAAgB,CAAC,EAAE,CAAC;AACpC,CAAC;AAED,qFAAqF;AACrF,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC7C,OAAO,MAAM,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC;AACpC,CAAC;AAED;mEACmE;AACnE,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,MAAM,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC;IAC1C,MAAM,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;IACpC,MAAM,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;IAClC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;AACtE,CAAC;AAED;uFACuF;AACvF,MAAM,UAAU,WAAW,CAAC,IAAY,EAAE,SAAiB;IACzD,OAAO,MAAM,CAAC,aAAa,CAAC,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AAChD,CAAC"}
package/dist/index.d.ts CHANGED
@@ -5,6 +5,7 @@ export { assertSeatId, bootToken, processStartToken, processStatFields, readReco
5
5
  export { censusCustodians, drainSeats, identityVerdict, reapSeat, type CustodianSighting, type SeatInventoryEntry, type SeatReapEvidence } from "./reap.js";
6
6
  export { SeatClient } from "./client.js";
7
7
  export { flockExclusiveNb, peerCredentials, type PeerCredentials } from "./peercred.js";
8
+ export { connectPipe, darwinLaunchdJob, darwinUserCacheDir, listenPipe, localPeerCredentials, lockExclusiveNb, processStartTime, windowsDirSecurity, windowsUserSid, type DarwinLaunchdJob, type DarwinLaunchdLookup, type PipeListener, type PipePeer, type PipeRefused, type WindowsAce, type WindowsDirSecurity } from "./host.js";
8
9
  export { runCustodian, type CustodianLaunch } from "./custodian.js";
9
10
  export { SEAT_OOM_SCORE_ADJ, preferSeatForOomKill, type OomPreference } from "./oom.js";
10
11
  export { ConnectorDiagnosticReader } from "./diagnostic.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,aAAa,EAAE,oBAAoB,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAC3I,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,eAAe,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AACxI,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,KAAK,UAAU,EAAE,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChG,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AACzJ,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,eAAe,EAAE,QAAQ,EAAE,KAAK,iBAAiB,EAAE,KAAK,kBAAkB,EAAE,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC5J,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AACxF,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,KAAK,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AkB,EAAE,MAAM,WAAW,CAAC;AACtU,OAAO,EAAE,YAAY,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AACxF,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,KAAK,mBAAmB,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC"}
package/dist/index.js CHANGED
@@ -5,6 +5,7 @@ export { assertSeatId, bootToken, processStartToken, processStatFields, readReco
5
5
  export { censusCustodians, drainSeats, identityVerdict, reapSeat } from "./reap.js";
6
6
  export { SeatClient } from "./client.js";
7
7
  export { flockExclusiveNb, peerCredentials } from "./peercred.js";
8
+ export { connectPipe, darwinLaunchdJob, darwinUserCacheDir, listenPipe, localPeerCredentials, lockExclusiveNb, processStartTime, windowsDirSecurity, windowsUserSid } from "./host.js";
8
9
  export { runCustodian } from "./custodian.js";
9
10
  export { SEAT_OOM_SCORE_ADJ, preferSeatForOomKill } from "./oom.js";
10
11
  export { ConnectorDiagnosticReader } from "./diagnostic.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,aAAa,EAAE,oBAAoB,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAC3I,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,eAAe,EAAE,SAAS,EAAE,WAAW,EAA4C,MAAM,eAAe,CAAC;AACxI,OAAO,EAAE,SAAS,EAAE,aAAa,EAA2C,MAAM,aAAa,CAAC;AAChG,OAAO,EAAE,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OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAwB,MAAM,eAAe,CAAC;AACxF,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,UAAU,EAAE,oBAAoB,EAAE,eAAe,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,cAAc,EAAiJ,MAAM,WAAW,CAAC;AACtU,OAAO,EAAE,YAAY,EAAwB,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAsB,MAAM,UAAU,CAAC;AACxF,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,sBAAsB,EAAyF,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC"}
@@ -5,7 +5,16 @@ export interface PeerCredentials {
5
5
  gid: number;
6
6
  }
7
7
  export declare const LINUX_NATIVE_ARCHES: readonly ["x64", "arm64"];
8
- export declare function nativeHelperPath(arch?: string): string;
8
+ /** The platforms and arches the helper has a source build for. Seat custody uses only Linux; the
9
+ * host primitives in host.ts use all of them. */
10
+ export declare const NATIVE_TARGETS: {
11
+ readonly linux: readonly ["x64", "arm64"];
12
+ readonly darwin: readonly ["x64", "arm64"];
13
+ readonly win32: readonly ["x64", "arm64"];
14
+ };
15
+ export declare function nativeHelperPath(arch?: string, platform?: string): string;
16
+ /** Load the helper for this platform and arch, or throw naming what is missing. Never compiles. */
17
+ export declare function loadNativeHelper<T>(): T;
9
18
  export declare function unsupportedNativeArch(platform: string, arch: string): Error;
10
19
  export declare function socketFd(sock: Socket): number;
11
20
  export declare function peerCredentials(sock: Socket): PeerCredentials;
@@ -1 +1 @@
1
- {"version":3,"file":"peercred.d.ts","sourceRoot":"","sources":["../src/peercred.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGvC,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE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;GAQG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAEpD"}
package/dist/peercred.js CHANGED
@@ -4,10 +4,36 @@ import { dirname, join } from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
5
  import { unsupportedTransport } from "./protocol.js";
6
6
  export const LINUX_NATIVE_ARCHES = ["x64", "arm64"];
7
+ /** The platforms and arches the helper has a source build for. Seat custody uses only Linux; the
8
+ * host primitives in host.ts use all of them. */
9
+ export const NATIVE_TARGETS = { linux: LINUX_NATIVE_ARCHES, darwin: ["x64", "arm64"], win32: ["x64", "arm64"] };
7
10
  let loaded;
8
- export function nativeHelperPath(arch = process.arch) {
11
+ export function nativeHelperPath(arch = process.arch, platform = process.platform) {
9
12
  const here = dirname(fileURLToPath(import.meta.url));
10
- return join(here, "..", "build", "Release", `linux-${arch}`, "peercred.node");
13
+ return join(here, "..", "build", "Release", `${platform}-${arch}`, "peercred.node");
14
+ }
15
+ /** Load the helper for this platform and arch, or throw naming what is missing. Never compiles. */
16
+ export function loadNativeHelper() {
17
+ if (loaded)
18
+ return loaded;
19
+ const platformArch = `${process.platform}-${process.arch}`;
20
+ const arches = NATIVE_TARGETS[process.platform];
21
+ if (!arches?.includes(process.arch)) {
22
+ const supported = Object.entries(NATIVE_TARGETS).flatMap(([p, a]) => a.map((x) => `${p}-${x}`)).join(", ");
23
+ throw new Error(`@cotal-ai/seat: native helper unsupported on ${platformArch} (supported: ${supported})`);
24
+ }
25
+ const path = nativeHelperPath();
26
+ if (!existsSync(path))
27
+ throw new Error(`@cotal-ai/seat: native helper missing at ${path}`);
28
+ const require = createRequire(import.meta.url);
29
+ try {
30
+ loaded = require(path);
31
+ }
32
+ catch (err) {
33
+ const detail = err instanceof Error ? err.message : String(err);
34
+ throw new Error(`@cotal-ai/seat: native helper failed to load at ${path} for ${platformArch}: ${detail}`);
35
+ }
36
+ return loaded;
11
37
  }
12
38
  function isLinuxNativeArch(arch) {
13
39
  return LINUX_NATI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IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;IAC5F,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,OAAO,UAAU,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AAC/C,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,gBAAgB,CAAC,EAAU;IACzC,OAAO,UAAU,EAAE,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC;AAC3C,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cotal-ai/seat",
3
3
  "description": "Local PTY seat custody: one detached custodian process per seat, a one-shot launcher, and the authenticated local protocol a manager worker uses to adopt the handle. Depends on nothing else in the repo.",
4
- "version": "0.136.8",
4
+ "version": "0.138.0",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -36,7 +36,7 @@
36
36
  "typecheck": "tsc -p tsconfig.check.json",
37
37
  "build": "node scripts/build-native.mjs && tsc -p tsconfig.json",
38
38
  "build:ts": "tsc -p tsconfig.json",
39
- "build:native": "node scripts/build-native.mjs",
39
+ "build:native": "node scripts/build-native.mjs --host",
40
40
  "test": "pnpm run build && tsx smoke/platform.smoke.ts && tsx smoke/protocol.smoke.ts && tsx smoke/lifecycle.smoke.ts && tsx smoke/isolation.smoke.ts && tsx smoke/reap-group-identity.smoke.ts && tsx smoke/peer-credentials-public.smoke.ts"
41
41
  }
42
42
  }