@sentropic/h2a 0.97.11 → 0.98.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/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/dist/bin.js +5 -1
- package/dist/bin.js.map +1 -1
- package/dist/cli-command-map.d.ts.map +1 -1
- package/dist/cli-command-map.js +2 -1
- package/dist/cli-command-map.js.map +1 -1
- package/dist/cli-contract.js +1 -1
- package/dist/cli-contract.js.map +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +35 -10
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/runtime/cluster-mesh-messaging.d.ts +21 -0
- package/dist/runtime/cluster-mesh-messaging.d.ts.map +1 -0
- package/dist/runtime/cluster-mesh-messaging.js +129 -0
- package/dist/runtime/cluster-mesh-messaging.js.map +1 -0
- package/dist/runtime/identity/readers.d.ts.map +1 -1
- package/dist/runtime/identity/readers.js +25 -2
- package/dist/runtime/identity/readers.js.map +1 -1
- package/dist/runtime/local-files/succession-lock.d.ts +105 -17
- package/dist/runtime/local-files/succession-lock.d.ts.map +1 -1
- package/dist/runtime/local-files/succession-lock.js +320 -108
- package/dist/runtime/local-files/succession-lock.js.map +1 -1
- package/dist/runtime/mcp/agent-launch.d.ts +6 -3
- package/dist/runtime/mcp/agent-launch.d.ts.map +1 -1
- package/dist/runtime/mcp/agent-launch.js +146 -4
- package/dist/runtime/mcp/agent-launch.js.map +1 -1
- package/dist/runtime/mcp/handlers.d.ts +7 -2
- package/dist/runtime/mcp/handlers.d.ts.map +1 -1
- package/dist/runtime/mcp/handlers.js +9 -4
- package/dist/runtime/mcp/handlers.js.map +1 -1
- package/dist/runtime/mcp/identity-state.d.ts +5 -4
- package/dist/runtime/mcp/identity-state.d.ts.map +1 -1
- package/dist/runtime/mcp/identity-state.js +43 -4
- package/dist/runtime/mcp/identity-state.js.map +1 -1
- package/dist/runtime/mcp/server.d.ts +6 -2
- package/dist/runtime/mcp/server.d.ts.map +1 -1
- package/dist/runtime/mcp/server.js +6 -4
- package/dist/runtime/mcp/server.js.map +1 -1
- package/dist/runtime/mcp/stdio.d.ts +5 -1
- package/dist/runtime/mcp/stdio.d.ts.map +1 -1
- package/dist/runtime/mcp/stdio.js +117 -24
- package/dist/runtime/mcp/stdio.js.map +1 -1
- package/dist/runtime/mcp/tools.d.ts.map +1 -1
- package/dist/runtime/mcp/tools.js +4 -3
- package/dist/runtime/mcp/tools.js.map +1 -1
- package/dist/runtime/mcp-central.js +2 -2
- package/dist/runtime/mcp-central.js.map +1 -1
- package/dist/runtime/mcp-http/hosted-mcp-server.d.ts.map +1 -1
- package/dist/runtime/mcp-http/hosted-mcp-server.js +3 -0
- package/dist/runtime/mcp-http/hosted-mcp-server.js.map +1 -1
- package/dist/runtime/send.d.ts +11 -5
- package/dist/runtime/send.d.ts.map +1 -1
- package/dist/runtime/send.js +30 -4
- package/dist/runtime/send.js.map +1 -1
- package/dist/runtime/upgrade/index.d.ts +5 -5
- package/dist/runtime/upgrade/index.d.ts.map +1 -1
- package/dist/runtime/upgrade/index.js +16 -13
- package/dist/runtime/upgrade/index.js.map +1 -1
- package/focus-app/client/_app/immutable/chunks/zL3j6erO.js +2 -0
- package/focus-app/client/_app/immutable/chunks/zL3j6erO.js.br +0 -0
- package/focus-app/client/_app/immutable/chunks/zL3j6erO.js.gz +0 -0
- package/focus-app/client/_app/immutable/entry/{app.D_yfk55R.js → app.Dfo3Ymae.js} +2 -2
- package/focus-app/client/_app/immutable/entry/app.Dfo3Ymae.js.br +0 -0
- package/focus-app/client/_app/immutable/entry/app.Dfo3Ymae.js.gz +0 -0
- package/focus-app/client/_app/immutable/entry/start.BSQLtKUn.js +1 -0
- package/focus-app/client/_app/immutable/entry/start.BSQLtKUn.js.br +0 -0
- package/focus-app/client/_app/immutable/entry/start.BSQLtKUn.js.gz +0 -0
- package/focus-app/client/_app/immutable/nodes/{1.Jo1uWTw0.js → 1.B83XRsuv.js} +1 -1
- package/focus-app/client/_app/immutable/nodes/1.B83XRsuv.js.br +0 -0
- package/focus-app/client/_app/immutable/nodes/1.B83XRsuv.js.gz +0 -0
- package/focus-app/client/_app/version.json +1 -1
- package/focus-app/client/_app/version.json.br +1 -1
- package/focus-app/client/_app/version.json.gz +0 -0
- package/focus-app/h2a-focus.json +61 -61
- package/focus-app/handler.js +8 -8
- package/focus-app/index.js +8 -8
- package/focus-app/server/chunks/chunks/{AppShell.js-BoWxjmfr.js → AppShell.js-DT15_EBV.js} +2 -2
- package/focus-app/server/chunks/chunks/{AppShell.js-BoWxjmfr.js.map → AppShell.js-DT15_EBV.js.map} +1 -1
- package/focus-app/server/chunks/chunks/{exports.js-D45A8dcc.js → exports.js-BrfiJlPR.js} +3 -3
- package/focus-app/server/chunks/chunks/{exports.js-D45A8dcc.js.map → exports.js-BrfiJlPR.js.map} +1 -1
- package/focus-app/server/chunks/chunks/{index.js-e3L5MwfB.js → index.js-BY6_68Zf.js} +2 -2
- package/focus-app/server/chunks/chunks/{index.js-e3L5MwfB.js.map → index.js-BY6_68Zf.js.map} +1 -1
- package/focus-app/server/chunks/chunks/{internal.js-DAV-A6NO.js → internal.js-BDHE9Kn1.js} +3 -3
- package/focus-app/server/chunks/chunks/{internal.js-DAV-A6NO.js.map → internal.js-BDHE9Kn1.js.map} +1 -1
- package/focus-app/server/chunks/chunks/{root.js-CEypm32A.js → root.js-CZyc7gzj.js} +2 -2
- package/focus-app/server/chunks/chunks/{root.js-CEypm32A.js.map → root.js-CZyc7gzj.js.map} +1 -1
- package/focus-app/server/chunks/chunks/{utils.js-Bzpr6vQU.js → utils.js-DBwpgn00.js} +178 -51
- package/focus-app/server/chunks/chunks/utils.js-DBwpgn00.js.map +1 -0
- package/focus-app/server/chunks/entries/endpoints/api/actions/launch/{_server.ts.js-Cah_Ivgw.js → _server.ts.js-H2iyKDJx.js} +2 -2
- package/focus-app/server/chunks/entries/endpoints/api/actions/launch/{_server.ts.js-Cah_Ivgw.js.map → _server.ts.js-H2iyKDJx.js.map} +1 -1
- package/focus-app/server/chunks/entries/endpoints/api/decisions/inject/{_server.ts.js-DW5wvcgH.js → _server.ts.js-BuR515Qd.js} +2 -2
- package/focus-app/server/chunks/entries/endpoints/api/decisions/inject/{_server.ts.js-DW5wvcgH.js.map → _server.ts.js-BuR515Qd.js.map} +1 -1
- package/focus-app/server/chunks/entries/endpoints/api/dossiers/agent-memory/include/{_server.ts.js-C2jIx8Jr.js → _server.ts.js-Cs32vOYa.js} +2 -2
- package/focus-app/server/chunks/entries/endpoints/api/dossiers/agent-memory/include/{_server.ts.js-C2jIx8Jr.js.map → _server.ts.js-Cs32vOYa.js.map} +1 -1
- package/focus-app/server/chunks/entries/endpoints/api/h2a/targets/{_server.ts.js-BkAMLcHu.js → _server.ts.js-DbEqL92p.js} +2 -2
- package/focus-app/server/chunks/entries/endpoints/api/h2a/targets/{_server.ts.js-BkAMLcHu.js.map → _server.ts.js-DbEqL92p.js.map} +1 -1
- package/focus-app/server/chunks/entries/fallbacks/{error.svelte.js-BWuS92Wk.js → error.svelte.js-BzO57FOz.js} +5 -5
- package/focus-app/server/chunks/entries/fallbacks/{error.svelte.js-BWuS92Wk.js.map → error.svelte.js-BzO57FOz.js.map} +1 -1
- package/focus-app/server/chunks/entries/pages/{_layout.svelte.js-CKspI0Bw.js → _layout.svelte.js-BHXu1zZ0.js} +3 -3
- package/focus-app/server/chunks/entries/pages/{_layout.svelte.js-CKspI0Bw.js.map → _layout.svelte.js-BHXu1zZ0.js.map} +1 -1
- package/focus-app/server/chunks/entries/pages/{_page.svelte.js-B8EWZmZj.js → _page.svelte.js-DgcoCR_G.js} +4 -4
- package/focus-app/server/chunks/entries/pages/{_page.svelte.js-B8EWZmZj.js.map → _page.svelte.js-DgcoCR_G.js.map} +1 -1
- package/focus-app/server/chunks/entries/pages/dossier/agent-memory/{_page.svelte.js-BZvcKeya.js → _page.svelte.js-D8qUTYi2.js} +4 -4
- package/focus-app/server/chunks/entries/pages/dossier/agent-memory/{_page.svelte.js-BZvcKeya.js.map → _page.svelte.js-D8qUTYi2.js.map} +1 -1
- package/focus-app/server/chunks/{handler-BCBpURX0.js → handler-BidpBSFZ.js} +4 -4
- package/focus-app/server/chunks/{handler-BCBpURX0.js.map → handler-BidpBSFZ.js.map} +1 -1
- package/focus-app/server/chunks/{index.js-CZWB6FqQ.js → index.js-BNQ-AMZE.js} +5 -5
- package/focus-app/server/chunks/{index.js-CZWB6FqQ.js.map → index.js-BNQ-AMZE.js.map} +1 -1
- package/focus-app/server/chunks/{manifest.js-C2CyTiUe.js → manifest.js-CAtvBIjA.js} +10 -10
- package/focus-app/server/chunks/{manifest.js-C2CyTiUe.js.map → manifest.js-CAtvBIjA.js.map} +1 -1
- package/focus-app/server/chunks/nodes/{0.js-Cp9RMJ1x.js → 0.js-DyONiS9Y.js} +2 -2
- package/focus-app/server/chunks/nodes/{0.js-Cp9RMJ1x.js.map → 0.js-DyONiS9Y.js.map} +1 -1
- package/focus-app/server/chunks/nodes/1.js-C16cgDY2.js +9 -0
- package/focus-app/server/chunks/nodes/{1.js-DMWmTj0d.js.map → 1.js-C16cgDY2.js.map} +1 -1
- package/focus-app/server/chunks/nodes/{2.js-Dv8Q6LQc.js → 2.js-C16ONuI7.js} +2 -2
- package/focus-app/server/chunks/nodes/{2.js-Dv8Q6LQc.js.map → 2.js-C16ONuI7.js.map} +1 -1
- package/focus-app/server/chunks/nodes/{3.js-DJH-zOae.js → 3.js-DIZzznQP.js} +2 -2
- package/focus-app/server/chunks/nodes/{3.js-DJH-zOae.js.map → 3.js-DIZzznQP.js.map} +1 -1
- package/package.json +4 -4
- package/focus-app/client/_app/immutable/chunks/BgBtu3IQ.js +0 -2
- package/focus-app/client/_app/immutable/chunks/BgBtu3IQ.js.br +0 -0
- package/focus-app/client/_app/immutable/chunks/BgBtu3IQ.js.gz +0 -0
- package/focus-app/client/_app/immutable/entry/app.D_yfk55R.js.br +0 -0
- package/focus-app/client/_app/immutable/entry/app.D_yfk55R.js.gz +0 -0
- package/focus-app/client/_app/immutable/entry/start.CoQWYNTs.js +0 -1
- package/focus-app/client/_app/immutable/entry/start.CoQWYNTs.js.br +0 -2
- package/focus-app/client/_app/immutable/entry/start.CoQWYNTs.js.gz +0 -0
- package/focus-app/client/_app/immutable/nodes/1.Jo1uWTw0.js.br +0 -4
- package/focus-app/client/_app/immutable/nodes/1.Jo1uWTw0.js.gz +0 -0
- package/focus-app/server/chunks/chunks/utils.js-Bzpr6vQU.js.map +0 -1
- package/focus-app/server/chunks/nodes/1.js-DMWmTj0d.js +0 -9
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* Succession lock (v4) — single-machine succession protocol.
|
|
3
3
|
*
|
|
4
4
|
* Extracted from `runtime/upgrade/index.ts` (Lot 4, step 1: neutral
|
|
5
|
-
* intra-package move
|
|
5
|
+
* intra-package move). Lot 4 §2 adds fail-closed host and boot provenance before
|
|
6
|
+
* any death proof. This is the shared lock primitive
|
|
6
7
|
* used by the auto-upgrade prefix lock today, and (later lots) by the identity
|
|
7
8
|
* binding lock. It is a LEAF: it imports only `node:fs/os/crypto/child_process`
|
|
8
9
|
* and nothing from the store, so `upgrade/index.ts` and `local-files/locks.ts`
|
|
@@ -11,6 +12,7 @@
|
|
|
11
12
|
* The full protocol proof-sketch (I1–I7, Lemmas A–C) lives with the code below,
|
|
12
13
|
* moved unchanged from its original location.
|
|
13
14
|
*/
|
|
15
|
+
import { spawnSync } from "node:child_process";
|
|
14
16
|
/**
|
|
15
17
|
* R2 staleness-alert threshold. An upgrade held under the lock completes in seconds to
|
|
16
18
|
* a few minutes (bounded tarball fetch + stage + atomic swap), so a lock far older than
|
|
@@ -32,13 +34,15 @@ export type PrefixLockReason = "busy" | "dead-undecidable" | `error:${string}`;
|
|
|
32
34
|
/** Lease on the global prefix. `token` is present only when acquired. */
|
|
33
35
|
export interface PrefixLockLease {
|
|
34
36
|
readonly acquired: boolean;
|
|
37
|
+
/** Fresh token check; false after release or any uncertain read. */
|
|
38
|
+
stillHeld(): boolean;
|
|
35
39
|
release(): void;
|
|
36
40
|
readonly reason?: PrefixLockReason;
|
|
37
41
|
/** Winning token; present only when acquired. Never republished (I2). */
|
|
38
42
|
readonly token?: string;
|
|
39
43
|
}
|
|
40
|
-
/**
|
|
41
|
-
export
|
|
44
|
+
/** @deprecated Compatibility type only; production never invokes test hooks. */
|
|
45
|
+
export type PrefixLockHookContext = {
|
|
42
46
|
readonly prefix: string;
|
|
43
47
|
readonly lockPath: string;
|
|
44
48
|
/** File the window is about: LOCK for publish/unlink, SUCC(t) after election. */
|
|
@@ -49,14 +53,10 @@ export interface PrefixLockHookContext {
|
|
|
49
53
|
readonly target?: string;
|
|
50
54
|
readonly round: number;
|
|
51
55
|
readonly depth: number;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
* via environment or configuration (there is no env/config reader for them),
|
|
57
|
-
* and production calls without hooks so every hook is a no-op at zero cost.
|
|
58
|
-
*/
|
|
59
|
-
export interface PrefixLockHooks {
|
|
56
|
+
};
|
|
57
|
+
/** @deprecated Compatibility type only; the legacy argument is ignored at runtime. */
|
|
58
|
+
export type PrefixLockHooks = {
|
|
59
|
+
readonly afterReadFirst?: (ctx: PrefixLockHookContext) => void;
|
|
60
60
|
/** Just BEFORE the initial publish(LOCK) (round 0) — initial race window. */
|
|
61
61
|
readonly beforePublishLock?: (ctx: PrefixLockHookContext) => void;
|
|
62
62
|
/** Just AFTER a publish(SUCC(t)) success, BEFORE retire — unique successor elected. */
|
|
@@ -64,9 +64,15 @@ export interface PrefixLockHooks {
|
|
|
64
64
|
/** In retire(), around the targeted unlink(LOCK) (removal-to-republish window). */
|
|
65
65
|
readonly beforeRetireUnlink?: (ctx: PrefixLockHookContext) => void;
|
|
66
66
|
readonly afterRetireUnlink?: (ctx: PrefixLockHookContext) => void;
|
|
67
|
+
};
|
|
68
|
+
/** Advisory acquisition control. No identity injection or hooks in production. */
|
|
69
|
+
export interface AcquirePrefixLockOptions {
|
|
70
|
+
readonly readFirst?: boolean;
|
|
67
71
|
}
|
|
68
72
|
interface LockIdent {
|
|
69
73
|
readonly host: string;
|
|
74
|
+
/** Missing only on records written before host provenance was recorded. */
|
|
75
|
+
readonly hostKind?: HostKind;
|
|
70
76
|
readonly boot: string | null;
|
|
71
77
|
readonly ns: string | null;
|
|
72
78
|
/** Reader's time namespace; gates proc-sourced start comparisons (B2). */
|
|
@@ -75,14 +81,64 @@ interface LockIdent {
|
|
|
75
81
|
readonly start: string | null;
|
|
76
82
|
}
|
|
77
83
|
interface LockRec extends LockIdent {
|
|
84
|
+
/** v4 records never carry a discriminator; legacy views use `kind: "legacy"`. */
|
|
85
|
+
readonly kind?: never;
|
|
78
86
|
readonly token: string;
|
|
79
87
|
readonly target?: string;
|
|
88
|
+
/** Explicit operator assertion; the succession target remains unchanged. */
|
|
89
|
+
readonly operator?: true;
|
|
80
90
|
/** Diagnostic only, never decides (I7). */
|
|
81
91
|
readonly at: number;
|
|
82
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* Read-only view of the pre-v4 lock written by `local-files/locks.ts`. Its
|
|
95
|
+
* optional metadata is used by identity binding, but it remains deliberately
|
|
96
|
+
* distinct from a v4 `LockRec`: legacy data lacks the machine, boot, namespace,
|
|
97
|
+
* and process-start proof needed to decide death. Its token fingerprints the
|
|
98
|
+
* exact bytes read so a later operator-only break can fence the observed record
|
|
99
|
+
* without rewriting it.
|
|
100
|
+
*/
|
|
101
|
+
export interface LegacyLockHolder {
|
|
102
|
+
readonly kind: "legacy";
|
|
103
|
+
readonly token: string;
|
|
104
|
+
readonly pid: number;
|
|
105
|
+
readonly hostname: string;
|
|
106
|
+
readonly startedAt: string;
|
|
107
|
+
readonly protocol?: string;
|
|
108
|
+
readonly fenceEpoch?: string;
|
|
109
|
+
}
|
|
110
|
+
/** A readable v4 record or the separate, always-undecidable legacy view. */
|
|
111
|
+
export type LockHolder = LockRec | LegacyLockHolder;
|
|
83
112
|
export declare function lockPathFor(prefix: string): string;
|
|
84
113
|
export declare function errnoOf(e: unknown): string;
|
|
85
114
|
export declare function safeAtIso(at: number): string;
|
|
115
|
+
export type HostKind = "machine-id" | "weak";
|
|
116
|
+
interface HostIdentity {
|
|
117
|
+
readonly host: string;
|
|
118
|
+
readonly hostKind: HostKind;
|
|
119
|
+
}
|
|
120
|
+
interface HostIdentityDeps {
|
|
121
|
+
readonly platform?: NodeJS.Platform;
|
|
122
|
+
readonly readFile?: (path: string) => string;
|
|
123
|
+
readonly hostname?: () => string;
|
|
124
|
+
readonly ioreg?: () => {
|
|
125
|
+
readonly status: number | null;
|
|
126
|
+
readonly stdout: string | null;
|
|
127
|
+
};
|
|
128
|
+
readonly spawn?: typeof spawnSync;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Reads a machine-scoped host identity. The injected readers make source selection
|
|
132
|
+
* deterministic in tests without consulting process environment variables.
|
|
133
|
+
*/
|
|
134
|
+
export declare function readHostId(deps?: HostIdentityDeps): HostIdentity;
|
|
135
|
+
interface BootIdentityDeps {
|
|
136
|
+
readonly platform?: NodeJS.Platform;
|
|
137
|
+
readonly readFile?: (path: string) => string;
|
|
138
|
+
readonly spawn?: typeof spawnSync;
|
|
139
|
+
}
|
|
140
|
+
/** Reads the current boot identity; readers are injectable for platform simulations. */
|
|
141
|
+
export declare function readBootId(deps?: BootIdentityDeps): string | null;
|
|
86
142
|
export declare function readPidNs(platform?: NodeJS.Platform, readLink?: (p: string) => string): string | null;
|
|
87
143
|
export declare function readTimeNs(platform?: NodeJS.Platform, readLink?: (p: string) => string): string | null;
|
|
88
144
|
/**
|
|
@@ -91,18 +147,25 @@ export declare function readTimeNs(platform?: NodeJS.Platform, readLink?: (p: st
|
|
|
91
147
|
* so a reader using a different source never concludes "dead" from a
|
|
92
148
|
* format/TZ-fragile comparison (C1).
|
|
93
149
|
*/
|
|
94
|
-
export declare function procStartInfo(pid: number, platform?: NodeJS.Platform, mapsToSelf?: () => boolean): {
|
|
150
|
+
export declare function procStartInfo(pid: number, platform?: NodeJS.Platform, mapsToSelf?: () => boolean, spawn?: typeof spawnSync): {
|
|
95
151
|
state?: string;
|
|
96
152
|
start?: string;
|
|
97
153
|
} | undefined;
|
|
98
154
|
interface SelfIdent extends LockIdent {
|
|
155
|
+
readonly hostKind: HostKind;
|
|
99
156
|
readonly pid: number;
|
|
100
157
|
}
|
|
101
158
|
/** This process's identity, computed once and memoized. */
|
|
102
159
|
export declare function me(): SelfIdent;
|
|
103
160
|
export declare function makeLockRec(token: string, target?: string): LockRec;
|
|
104
161
|
export declare function parseLockRec(raw: unknown): LockRec;
|
|
105
|
-
/**
|
|
162
|
+
/** Legacy tokens fingerprint the exact raw bytes; read errors remain corrupt. */
|
|
163
|
+
export declare function readLockHolder(path: string): LockHolder | "absent" | "corrupt";
|
|
164
|
+
/**
|
|
165
|
+
* v4-only reader retained for existing protocol callers. A readable legacy holder
|
|
166
|
+
* remains `corrupt` here so a caller that was not explicitly upgraded to the
|
|
167
|
+
* distinct legacy view continues to fail closed.
|
|
168
|
+
*/
|
|
106
169
|
export declare function readLockRecord(path: string): LockRec | "absent" | "corrupt";
|
|
107
170
|
type PublishStatus = {
|
|
108
171
|
status: "ok";
|
|
@@ -150,12 +213,37 @@ interface LivenessInfo {
|
|
|
150
213
|
* comparison: a source mismatch or an unknown/differing time namespace both yield a
|
|
151
214
|
* safe "live" (undatable), and a corrupt "legacy" start yields "undecidable" (C1).
|
|
152
215
|
*/
|
|
153
|
-
export declare function classifyLiveness(r:
|
|
154
|
-
export declare function livenessOf(r:
|
|
216
|
+
export declare function classifyLiveness(r: LockHolder, self: SelfIdent, deps?: LivenessDeps): LivenessInfo;
|
|
217
|
+
export declare function livenessOf(r: LockHolder, self: SelfIdent, deps?: LivenessDeps): Liveness;
|
|
155
218
|
/** No false positive: true implies certainly dead; any doubt is alive (I3). */
|
|
156
219
|
export declare function isCertainlyDead(r: LockRec): boolean;
|
|
157
|
-
|
|
158
|
-
|
|
220
|
+
export interface BreakLockAsOperatorOptions {
|
|
221
|
+
readonly expectToken: string;
|
|
222
|
+
/** Explicit assertion for an undecidable holder; never authorizes a live one. */
|
|
223
|
+
readonly assertDead?: boolean;
|
|
224
|
+
}
|
|
225
|
+
export type OperatorBreakReason = "invalid-token" | "absent" | "corrupt" | "token-mismatch" | "live" | "assert-dead-required" | "busy" | "dead-undecidable" | `error:${string}`;
|
|
226
|
+
export interface OperatorBreakResult {
|
|
227
|
+
readonly broken: boolean;
|
|
228
|
+
readonly reason?: OperatorBreakReason;
|
|
229
|
+
readonly token?: string;
|
|
230
|
+
readonly pid?: number;
|
|
231
|
+
/** Number of legacy records encountered in this operation. */
|
|
232
|
+
readonly legacyRecords: 0 | 1;
|
|
233
|
+
readonly diagnostic?: {
|
|
234
|
+
readonly code: "legacy-record";
|
|
235
|
+
readonly command: string;
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Token-fenced escape hatch, using the same one-shot SUCC election as acquisition.
|
|
240
|
+
* It never owns or republishes LOCK and never sends a destructive process signal.
|
|
241
|
+
* An automatic successor already elected for g excludes the operator. After g is
|
|
242
|
+
* removed, a pending automatic retire sees absence and may publish a fresh LOCK.
|
|
243
|
+
*/
|
|
244
|
+
export declare function breakLockAsOperator(lockPath: string, options: BreakLockAsOperatorOptions): OperatorBreakResult;
|
|
245
|
+
/** Production acquisition. Extra JavaScript arguments cannot inject dependencies. */
|
|
246
|
+
export declare function acquirePrefixLock(prefix: string, options?: AcquirePrefixLockOptions): PrefixLockLease;
|
|
159
247
|
/** True when the path is older than the threshold; false when unstated. */
|
|
160
248
|
export declare function isOlderThan(path: string, now: number, maxAgeMs: number): boolean;
|
|
161
249
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"succession-lock.d.ts","sourceRoot":"","sources":["../../../src/runtime/local-files/succession-lock.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"succession-lock.d.ts","sourceRoot":"","sources":["../../../src/runtime/local-files/succession-lock.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AA+C/C;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,QAAiB,CAAC;AAClD,6EAA6E;AAC7E,eAAO,MAAM,sBAAsB,IAAI,CAAC;AACxC,sEAAsE;AACtE,eAAO,MAAM,qBAAqB,IAAI,CAAC;AACvC,6EAA6E;AAC7E,eAAO,MAAM,iCAAiC,QAAiB,CAAC;AAChE,0EAA0E;AAC1E,eAAO,MAAM,0BAA0B,QAAsB,CAAC;AAE9D,8EAA8E;AAC9E,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,kBAAkB,GAAG,SAAS,MAAM,EAAE,CAAC;AAE/E,yEAAyE;AACzE,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,oEAAoE;IACpE,SAAS,IAAI,OAAO,CAAC;IACrB,OAAO,IAAI,IAAI,CAAC;IAChB,QAAQ,CAAC,MAAM,CAAC,EAAE,gBAAgB,CAAC;IACnC,yEAAyE;IACzE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,gFAAgF;AAChF,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,iFAAiF;IACjF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,iDAAiD;IACjD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,+DAA+D;IAC/D,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,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