@sentropic/h2a-cli 0.1.1 → 0.1.7
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/dist/bin.js +30 -2
- package/dist/bin.js.map +1 -1
- package/dist/cli-contract.d.ts +62 -0
- package/dist/cli-contract.d.ts.map +1 -0
- package/dist/cli-contract.js +239 -0
- package/dist/cli-contract.js.map +1 -0
- package/dist/cli.d.ts +51 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +711 -2
- package/dist/cli.js.map +1 -1
- package/dist/hosts/claude.d.ts +11 -6
- package/dist/hosts/claude.d.ts.map +1 -1
- package/dist/hosts/claude.js +40 -1
- package/dist/hosts/claude.js.map +1 -1
- package/dist/hosts/codex.d.ts +64 -6
- package/dist/hosts/codex.d.ts.map +1 -1
- package/dist/hosts/codex.js +39 -1
- package/dist/hosts/codex.js.map +1 -1
- package/dist/hosts/gemini.d.ts +8 -6
- package/dist/hosts/gemini.d.ts.map +1 -1
- package/dist/hosts/gemini.js +9 -1
- package/dist/hosts/gemini.js.map +1 -1
- package/dist/index.d.ts +8 -34
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/runtime/local-files/index.d.ts +5 -0
- package/dist/runtime/local-files/index.d.ts.map +1 -0
- package/dist/runtime/local-files/index.js +5 -0
- package/dist/runtime/local-files/index.js.map +1 -0
- package/dist/runtime/local-files/locks.d.ts +43 -0
- package/dist/runtime/local-files/locks.d.ts.map +1 -0
- package/dist/runtime/local-files/locks.js +197 -0
- package/dist/runtime/local-files/locks.js.map +1 -0
- package/dist/runtime/local-files/paths.d.ts +18 -0
- package/dist/runtime/local-files/paths.d.ts.map +1 -0
- package/dist/runtime/local-files/paths.js +28 -0
- package/dist/runtime/local-files/paths.js.map +1 -0
- package/dist/runtime/local-files/schema.d.ts +47 -0
- package/dist/runtime/local-files/schema.d.ts.map +1 -0
- package/dist/runtime/local-files/schema.js +77 -0
- package/dist/runtime/local-files/schema.js.map +1 -0
- package/dist/runtime/local-files/store.d.ts +44 -0
- package/dist/runtime/local-files/store.d.ts.map +1 -0
- package/dist/runtime/local-files/store.js +407 -0
- package/dist/runtime/local-files/store.js.map +1 -0
- package/dist/runtime/mcp/handlers.d.ts +62 -0
- package/dist/runtime/mcp/handlers.d.ts.map +1 -0
- package/dist/runtime/mcp/handlers.js +261 -0
- package/dist/runtime/mcp/handlers.js.map +1 -0
- package/dist/runtime/mcp/index.d.ts +5 -0
- package/dist/runtime/mcp/index.d.ts.map +1 -0
- package/dist/runtime/mcp/index.js +5 -0
- package/dist/runtime/mcp/index.js.map +1 -0
- package/dist/runtime/mcp/server.d.ts +26 -0
- package/dist/runtime/mcp/server.d.ts.map +1 -0
- package/dist/runtime/mcp/server.js +45 -0
- package/dist/runtime/mcp/server.js.map +1 -0
- package/dist/runtime/mcp/stdio.d.ts +21 -0
- package/dist/runtime/mcp/stdio.d.ts.map +1 -0
- package/dist/runtime/mcp/stdio.js +103 -0
- package/dist/runtime/mcp/stdio.js.map +1 -0
- package/dist/runtime/mcp/tools.d.ts +19 -0
- package/dist/runtime/mcp/tools.d.ts.map +1 -0
- package/dist/runtime/mcp/tools.js +175 -0
- package/dist/runtime/mcp/tools.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Advisory file locking for the local-files store (DEC-036).
|
|
3
|
+
*
|
|
4
|
+
* The store layout (DEC-031) was originally written under the assumption that
|
|
5
|
+
* a single CLI/MCP process owned the `<root>/.h2a/` tree at any given time.
|
|
6
|
+
* In practice, multiple `h2a` invocations and an `h2a mcp-serve` process can
|
|
7
|
+
* race on the same root. Append-only JSONL files (`registry/instances.jsonl`,
|
|
8
|
+
* `negotiations/<id>/journal.jsonl`) survive this via the `PIPE_BUF`
|
|
9
|
+
* atomicity of `appendFileSync` for sub-4KB lines, but every read-then-write
|
|
10
|
+
* critical section (dup detection on `registerInstance`, hash-chain link on
|
|
11
|
+
* `appendNegotiationEvent`, the whole `stabilizeNegotiation` transaction)
|
|
12
|
+
* remains a race.
|
|
13
|
+
*
|
|
14
|
+
* This module implements **advisory** file locking via exclusive-create
|
|
15
|
+
* sentinel files (`O_CREAT | O_EXCL` semantics through `openSync(path, "wx")`).
|
|
16
|
+
* It is intentionally limited to **same-machine** coordination: a lock file
|
|
17
|
+
* holding a foreign-host PID would be treated as live (we cannot
|
|
18
|
+
* `process.kill(pid, 0)` across hosts). Cross-machine sharing of a store
|
|
19
|
+
* remains out of scope (V2).
|
|
20
|
+
*
|
|
21
|
+
* Stale-lock recovery: if the lock file already exists, we parse its JSON
|
|
22
|
+
* payload `{pid, hostname, startedAt}`. If `hostname` matches and the PID is
|
|
23
|
+
* gone (`process.kill(pid, 0)` throws `ESRCH`), we reclaim the lock by
|
|
24
|
+
* unlinking and retrying. Otherwise we poll up to `timeoutMs` and throw
|
|
25
|
+
* `LockTimeoutError`.
|
|
26
|
+
*/
|
|
27
|
+
import { closeSync, openSync, readFileSync, unlinkSync, writeFileSync } from "node:fs";
|
|
28
|
+
import { hostname } from "node:os";
|
|
29
|
+
export class LockTimeoutError extends Error {
|
|
30
|
+
lockPath;
|
|
31
|
+
lastSeenOwner;
|
|
32
|
+
constructor(lockPath, lastSeenOwner, timeoutMs) {
|
|
33
|
+
const ownerSuffix = lastSeenOwner
|
|
34
|
+
? ` held by ${JSON.stringify(lastSeenOwner)}`
|
|
35
|
+
: "";
|
|
36
|
+
super(`LockTimeoutError: could not acquire ${lockPath} within ${timeoutMs}ms${ownerSuffix}`);
|
|
37
|
+
this.name = "LockTimeoutError";
|
|
38
|
+
this.lockPath = lockPath;
|
|
39
|
+
this.lastSeenOwner = lastSeenOwner;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const DEFAULT_TIMEOUT_MS = 5000;
|
|
43
|
+
const DEFAULT_POLL_MS = 50;
|
|
44
|
+
function tryParseOwner(raw) {
|
|
45
|
+
try {
|
|
46
|
+
const parsed = JSON.parse(raw);
|
|
47
|
+
if (parsed &&
|
|
48
|
+
typeof parsed.pid === "number" &&
|
|
49
|
+
typeof parsed.hostname === "string" &&
|
|
50
|
+
typeof parsed.startedAt === "string") {
|
|
51
|
+
return { pid: parsed.pid, hostname: parsed.hostname, startedAt: parsed.startedAt };
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
/* malformed — fall through */
|
|
56
|
+
}
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
function pidIsAliveOnSameHost(owner, selfHostname) {
|
|
60
|
+
if (owner.hostname !== selfHostname) {
|
|
61
|
+
// Cross-host owner: we cannot probe its liveness. Treat as live to err on
|
|
62
|
+
// the side of safety (the caller will then time out, which is the
|
|
63
|
+
// expected behaviour — cross-machine store sharing is out of scope V1).
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
try {
|
|
67
|
+
process.kill(owner.pid, 0);
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
catch (err) {
|
|
71
|
+
const code = err.code;
|
|
72
|
+
if (code === "ESRCH")
|
|
73
|
+
return false;
|
|
74
|
+
// EPERM means the process exists but is owned by another user — still
|
|
75
|
+
// live for our purposes.
|
|
76
|
+
return true;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function acquire(lockPath, selfHostname) {
|
|
80
|
+
const ownerPayload = {
|
|
81
|
+
pid: process.pid,
|
|
82
|
+
hostname: selfHostname,
|
|
83
|
+
startedAt: new Date().toISOString()
|
|
84
|
+
};
|
|
85
|
+
try {
|
|
86
|
+
const fd = openSync(lockPath, "wx");
|
|
87
|
+
try {
|
|
88
|
+
writeFileSync(fd, JSON.stringify(ownerPayload));
|
|
89
|
+
}
|
|
90
|
+
finally {
|
|
91
|
+
closeSync(fd);
|
|
92
|
+
}
|
|
93
|
+
return { ok: true };
|
|
94
|
+
}
|
|
95
|
+
catch (err) {
|
|
96
|
+
const code = err.code;
|
|
97
|
+
if (code !== "EEXIST")
|
|
98
|
+
throw err;
|
|
99
|
+
}
|
|
100
|
+
// Lock exists — inspect the owner record for staleness.
|
|
101
|
+
let raw;
|
|
102
|
+
try {
|
|
103
|
+
raw = readFileSync(lockPath, "utf8");
|
|
104
|
+
}
|
|
105
|
+
catch {
|
|
106
|
+
// The lock was released between EEXIST and our read. Caller should retry.
|
|
107
|
+
return { ok: false };
|
|
108
|
+
}
|
|
109
|
+
const owner = tryParseOwner(raw);
|
|
110
|
+
if (owner && !pidIsAliveOnSameHost(owner, selfHostname)) {
|
|
111
|
+
// Stale: reclaim by unlinking. The next loop iteration retries the create.
|
|
112
|
+
try {
|
|
113
|
+
unlinkSync(lockPath);
|
|
114
|
+
}
|
|
115
|
+
catch {
|
|
116
|
+
/* concurrent reclaim — fine */
|
|
117
|
+
}
|
|
118
|
+
return { ok: false };
|
|
119
|
+
}
|
|
120
|
+
return { ok: false, lastSeen: owner };
|
|
121
|
+
}
|
|
122
|
+
function delay(ms) {
|
|
123
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
124
|
+
}
|
|
125
|
+
function busyWaitSync(ms) {
|
|
126
|
+
// Synchronous wait without blocking event-loop indefinitely. Used by
|
|
127
|
+
// `withLockSync` only — most store methods are sync today and we don't
|
|
128
|
+
// want to ripple `async` through them just for locking (DEC-036).
|
|
129
|
+
const end = Date.now() + ms;
|
|
130
|
+
// `Atomics.wait` on a private SharedArrayBuffer is the standard
|
|
131
|
+
// "sleep without spinning" primitive in modern Node.
|
|
132
|
+
const sab = new SharedArrayBuffer(4);
|
|
133
|
+
const view = new Int32Array(sab);
|
|
134
|
+
while (Date.now() < end) {
|
|
135
|
+
const remaining = end - Date.now();
|
|
136
|
+
if (remaining <= 0)
|
|
137
|
+
break;
|
|
138
|
+
Atomics.wait(view, 0, 0, Math.min(remaining, 25));
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
export async function withLock(lockPath, fn, options = {}) {
|
|
142
|
+
const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
143
|
+
const pollMs = options.pollMs ?? DEFAULT_POLL_MS;
|
|
144
|
+
const selfHostname = hostname();
|
|
145
|
+
const deadline = Date.now() + timeoutMs;
|
|
146
|
+
let lastSeen;
|
|
147
|
+
while (true) {
|
|
148
|
+
const attempt = acquire(lockPath, selfHostname);
|
|
149
|
+
if (attempt.ok)
|
|
150
|
+
break;
|
|
151
|
+
lastSeen = attempt.lastSeen ?? lastSeen;
|
|
152
|
+
if (Date.now() >= deadline) {
|
|
153
|
+
throw new LockTimeoutError(lockPath, lastSeen, timeoutMs);
|
|
154
|
+
}
|
|
155
|
+
await delay(pollMs);
|
|
156
|
+
}
|
|
157
|
+
try {
|
|
158
|
+
return await fn();
|
|
159
|
+
}
|
|
160
|
+
finally {
|
|
161
|
+
try {
|
|
162
|
+
unlinkSync(lockPath);
|
|
163
|
+
}
|
|
164
|
+
catch {
|
|
165
|
+
/* lock file already gone — fine */
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
export function withLockSync(lockPath, fn, options = {}) {
|
|
170
|
+
const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
171
|
+
const pollMs = options.pollMs ?? DEFAULT_POLL_MS;
|
|
172
|
+
const selfHostname = hostname();
|
|
173
|
+
const deadline = Date.now() + timeoutMs;
|
|
174
|
+
let lastSeen;
|
|
175
|
+
while (true) {
|
|
176
|
+
const attempt = acquire(lockPath, selfHostname);
|
|
177
|
+
if (attempt.ok)
|
|
178
|
+
break;
|
|
179
|
+
lastSeen = attempt.lastSeen ?? lastSeen;
|
|
180
|
+
if (Date.now() >= deadline) {
|
|
181
|
+
throw new LockTimeoutError(lockPath, lastSeen, timeoutMs);
|
|
182
|
+
}
|
|
183
|
+
busyWaitSync(pollMs);
|
|
184
|
+
}
|
|
185
|
+
try {
|
|
186
|
+
return fn();
|
|
187
|
+
}
|
|
188
|
+
finally {
|
|
189
|
+
try {
|
|
190
|
+
unlinkSync(lockPath);
|
|
191
|
+
}
|
|
192
|
+
catch {
|
|
193
|
+
/* lock file already gone — fine */
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
//# sourceMappingURL=locks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locks.js","sourceRoot":"","sources":["../../../src/runtime/local-files/locks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACvF,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAanC,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IAChC,QAAQ,CAAS;IACjB,aAAa,CAAa;IAEnC,YAAY,QAAgB,EAAE,aAAoC,EAAE,SAAiB;QACnF,MAAM,WAAW,GAAG,aAAa;YAC/B,CAAC,CAAC,YAAY,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,EAAE;YAC7C,CAAC,CAAC,EAAE,CAAC;QACP,KAAK,CACH,uCAAuC,QAAQ,WAAW,SAAS,KAAK,WAAW,EAAE,CACtF,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;QAC/B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACrC,CAAC;CACF;AAED,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAChC,MAAM,eAAe,GAAG,EAAE,CAAC;AAE3B,SAAS,aAAa,CAAC,GAAW;IAChC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAuB,CAAC;QACrD,IACE,MAAM;YACN,OAAO,MAAM,CAAC,GAAG,KAAK,QAAQ;YAC9B,OAAO,MAAM,CAAC,QAAQ,KAAK,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CAAC,QAAQ,CAAC,CAAC;QACvB,CAAC;QAAC,MAAM,CAAC;YACP,mCAAmC;QACrC,CAAC;IACH,CAAC;AACH,CAAC;AAED,MAAM,UAAU,YAAY,CAC1B,QAAgB,EAChB,EAAW,EACX,UAA2B,EAAE;IAE7B,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,kBAAkB,CAAC;IAC1D,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,eAAe,CAAC;IACjD,MAAM,YAAY,GAAG,QAAQ,EAAE,CAAC;IAEhC,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC;IACxC,IAAI,QAA+B,CAAC;IACpC,OAAO,IAAI,EAAE,CAAC;QACZ,MAAM,OAAO,GAAG,OAAO,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QAChD,IAAI,OAAO,CAAC,EAAE;YAAE,MAAM;QACtB,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,QAAQ,CAAC;QACxC,IAAI,IAAI,CAAC,GAAG,EAAE,IAAI,QAAQ,EAAE,CAAC;YAC3B,MAAM,IAAI,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;QAC5D,CAAC;QACD,YAAY,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IAED,IAAI,CAAC;QACH,OAAO,EAAE,EAAE,CAAC;IACd,CAAC;YAAS,CAAC;QACT,IAAI,CAAC;YACH,UAAU,CAAC,QAAQ,CAAC,CAAC;QACvB,CAAC;QAAC,MAAM,CAAC;YACP,mCAAmC;QACrC,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface LocalStorePaths {
|
|
2
|
+
root: string;
|
|
3
|
+
registry: string;
|
|
4
|
+
instances: string;
|
|
5
|
+
contracts: string;
|
|
6
|
+
policies: string;
|
|
7
|
+
engagements: string;
|
|
8
|
+
artifacts: string;
|
|
9
|
+
negotiations: string;
|
|
10
|
+
inbox: string;
|
|
11
|
+
outbox: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function localStorePaths(root: string): LocalStorePaths;
|
|
14
|
+
export declare function negotiationDir(paths: LocalStorePaths, negotiationId: string): string;
|
|
15
|
+
export declare function negotiationJournalFile(paths: LocalStorePaths, negotiationId: string): string;
|
|
16
|
+
export declare function inboxDir(paths: LocalStorePaths, actor: string): string;
|
|
17
|
+
export declare function outboxDir(paths: LocalStorePaths, actor: string): string;
|
|
18
|
+
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../src/runtime/local-files/paths.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CAa7D;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CAEpF;AAED,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,eAAe,EACtB,aAAa,EAAE,MAAM,GACpB,MAAM,CAER;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAEvE"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
export function localStorePaths(root) {
|
|
3
|
+
return {
|
|
4
|
+
root,
|
|
5
|
+
registry: join(root, "registry"),
|
|
6
|
+
instances: join(root, "registry", "instances.jsonl"),
|
|
7
|
+
contracts: join(root, "contracts"),
|
|
8
|
+
policies: join(root, "policies"),
|
|
9
|
+
engagements: join(root, "engagements"),
|
|
10
|
+
artifacts: join(root, "artifacts"),
|
|
11
|
+
negotiations: join(root, "negotiations"),
|
|
12
|
+
inbox: join(root, "inbox"),
|
|
13
|
+
outbox: join(root, "outbox")
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export function negotiationDir(paths, negotiationId) {
|
|
17
|
+
return join(paths.negotiations, negotiationId);
|
|
18
|
+
}
|
|
19
|
+
export function negotiationJournalFile(paths, negotiationId) {
|
|
20
|
+
return join(negotiationDir(paths, negotiationId), "journal.jsonl");
|
|
21
|
+
}
|
|
22
|
+
export function inboxDir(paths, actor) {
|
|
23
|
+
return join(paths.inbox, actor);
|
|
24
|
+
}
|
|
25
|
+
export function outboxDir(paths, actor) {
|
|
26
|
+
return join(paths.outbox, actor);
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../../src/runtime/local-files/paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAejC,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,OAAO;QACL,IAAI;QACJ,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC;QAChC,SAAS,EAAE,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,iBAAiB,CAAC;QACpD,SAAS,EAAE,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC;QAClC,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC;QAChC,WAAW,EAAE,IAAI,CAAC,IAAI,EAAE,aAAa,CAAC;QACtC,SAAS,EAAE,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC;QAClC,YAAY,EAAE,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC;QACxC,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC;QAC1B,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC;KAC7B,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,KAAsB,EAAE,aAAqB;IAC1E,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,sBAAsB,CACpC,KAAsB,EACtB,aAAqB;IAErB,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,aAAa,CAAC,EAAE,eAAe,CAAC,CAAC;AACrE,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,KAAsB,EAAE,KAAa;IAC5D,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,KAAsB,EAAE,KAAa;IAC7D,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local-files store schema versioning (DEC-036).
|
|
3
|
+
*
|
|
4
|
+
* Every initialized store carries a `<root>/.h2a-schema.json` sentinel:
|
|
5
|
+
*
|
|
6
|
+
* ```json
|
|
7
|
+
* {
|
|
8
|
+
* "version": "1",
|
|
9
|
+
* "createdAt": "2026-05-20T08:12:34.567Z",
|
|
10
|
+
* "createdBy": "@sentropic/h2a-cli@0.1.1"
|
|
11
|
+
* }
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* The version string is opaque and strictly compared against
|
|
15
|
+
* `H2A_STORE_SCHEMA_VERSION`. A future schema bump requires:
|
|
16
|
+
*
|
|
17
|
+
* - a new DEC documenting the layout change,
|
|
18
|
+
* - a migration ramp (`h2a store migrate --from <old> --to <new>`),
|
|
19
|
+
* - a `H2A_STORE_SCHEMA_VERSION` bump in this file.
|
|
20
|
+
*
|
|
21
|
+
* The escape hatch `createLocalStore({ allowVersionMismatch: true })` is
|
|
22
|
+
* intentionally narrow: it logs a stderr warning, skips the version check,
|
|
23
|
+
* and **never** rewrites the sentinel. It exists so a read-only inspection
|
|
24
|
+
* tool (e.g., a debugger) can open a store written by a newer CLI.
|
|
25
|
+
*/
|
|
26
|
+
export declare const H2A_STORE_SCHEMA_VERSION: "1";
|
|
27
|
+
export declare const H2A_STORE_SCHEMA_FILE: ".h2a-schema.json";
|
|
28
|
+
export interface H2AStoreSchemaSentinel {
|
|
29
|
+
readonly version: string;
|
|
30
|
+
readonly createdAt: string;
|
|
31
|
+
readonly createdBy: string;
|
|
32
|
+
}
|
|
33
|
+
export declare class StoreSchemaMismatchError extends Error {
|
|
34
|
+
readonly foundVersion: string;
|
|
35
|
+
readonly expectedVersion: string;
|
|
36
|
+
constructor(foundVersion: string, expectedVersion: string, root: string);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Best-effort lookup of `@sentropic/h2a-cli`'s own package version. We walk
|
|
40
|
+
* up from the current module file (`dist/runtime/local-files/schema.js` at
|
|
41
|
+
* runtime, or the TS source under tests) until we find a `package.json`
|
|
42
|
+
* whose `name` matches. Falls back to `0.0.0-unknown` if the search fails,
|
|
43
|
+
* which only affects the `createdBy` metadata field — it never aborts a
|
|
44
|
+
* store init.
|
|
45
|
+
*/
|
|
46
|
+
export declare function readCliPackageVersion(): string;
|
|
47
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/runtime/local-files/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAMH,eAAO,MAAM,wBAAwB,EAAG,GAAY,CAAC;AAErD,eAAO,MAAM,qBAAqB,EAAG,kBAA2B,CAAC;AAEjE,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,qBAAa,wBAAyB,SAAQ,KAAK;IACjD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;gBAErB,YAAY,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;CAQxE;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAwB9C"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local-files store schema versioning (DEC-036).
|
|
3
|
+
*
|
|
4
|
+
* Every initialized store carries a `<root>/.h2a-schema.json` sentinel:
|
|
5
|
+
*
|
|
6
|
+
* ```json
|
|
7
|
+
* {
|
|
8
|
+
* "version": "1",
|
|
9
|
+
* "createdAt": "2026-05-20T08:12:34.567Z",
|
|
10
|
+
* "createdBy": "@sentropic/h2a-cli@0.1.1"
|
|
11
|
+
* }
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* The version string is opaque and strictly compared against
|
|
15
|
+
* `H2A_STORE_SCHEMA_VERSION`. A future schema bump requires:
|
|
16
|
+
*
|
|
17
|
+
* - a new DEC documenting the layout change,
|
|
18
|
+
* - a migration ramp (`h2a store migrate --from <old> --to <new>`),
|
|
19
|
+
* - a `H2A_STORE_SCHEMA_VERSION` bump in this file.
|
|
20
|
+
*
|
|
21
|
+
* The escape hatch `createLocalStore({ allowVersionMismatch: true })` is
|
|
22
|
+
* intentionally narrow: it logs a stderr warning, skips the version check,
|
|
23
|
+
* and **never** rewrites the sentinel. It exists so a read-only inspection
|
|
24
|
+
* tool (e.g., a debugger) can open a store written by a newer CLI.
|
|
25
|
+
*/
|
|
26
|
+
import { readFileSync } from "node:fs";
|
|
27
|
+
import { dirname } from "node:path";
|
|
28
|
+
import { fileURLToPath } from "node:url";
|
|
29
|
+
export const H2A_STORE_SCHEMA_VERSION = "1";
|
|
30
|
+
export const H2A_STORE_SCHEMA_FILE = ".h2a-schema.json";
|
|
31
|
+
export class StoreSchemaMismatchError extends Error {
|
|
32
|
+
foundVersion;
|
|
33
|
+
expectedVersion;
|
|
34
|
+
constructor(foundVersion, expectedVersion, root) {
|
|
35
|
+
super(`StoreSchemaMismatchError: store at ${root} declares schema version "${foundVersion}" but this CLI expects "${expectedVersion}". Run \`h2a store migrate --from ${foundVersion} --to ${expectedVersion}\` or pass \`allowVersionMismatch: true\` for read-only inspection (DEC-036).`);
|
|
36
|
+
this.name = "StoreSchemaMismatchError";
|
|
37
|
+
this.foundVersion = foundVersion;
|
|
38
|
+
this.expectedVersion = expectedVersion;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Best-effort lookup of `@sentropic/h2a-cli`'s own package version. We walk
|
|
43
|
+
* up from the current module file (`dist/runtime/local-files/schema.js` at
|
|
44
|
+
* runtime, or the TS source under tests) until we find a `package.json`
|
|
45
|
+
* whose `name` matches. Falls back to `0.0.0-unknown` if the search fails,
|
|
46
|
+
* which only affects the `createdBy` metadata field — it never aborts a
|
|
47
|
+
* store init.
|
|
48
|
+
*/
|
|
49
|
+
export function readCliPackageVersion() {
|
|
50
|
+
try {
|
|
51
|
+
const here = fileURLToPath(import.meta.url);
|
|
52
|
+
let dir = dirname(here);
|
|
53
|
+
// Walk up at most 8 levels (dist/runtime/local-files → package root is
|
|
54
|
+
// typically 3, but allow some slack for the source-mode test runner).
|
|
55
|
+
for (let i = 0; i < 8; i++) {
|
|
56
|
+
try {
|
|
57
|
+
const raw = readFileSync(`${dir}/package.json`, "utf8");
|
|
58
|
+
const parsed = JSON.parse(raw);
|
|
59
|
+
if (parsed.name === "@sentropic/h2a-cli" && typeof parsed.version === "string") {
|
|
60
|
+
return `@sentropic/h2a-cli@${parsed.version}`;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
/* keep walking */
|
|
65
|
+
}
|
|
66
|
+
const next = dirname(dir);
|
|
67
|
+
if (next === dir)
|
|
68
|
+
break;
|
|
69
|
+
dir = next;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
/* fall through */
|
|
74
|
+
}
|
|
75
|
+
return "@sentropic/h2a-cli@0.0.0-unknown";
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/runtime/local-files/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAY,CAAC;AAErD,MAAM,CAAC,MAAM,qBAAqB,GAAG,kBAA2B,CAAC;AAQjE,MAAM,OAAO,wBAAyB,SAAQ,KAAK;IACxC,YAAY,CAAS;IACrB,eAAe,CAAS;IAEjC,YAAY,YAAoB,EAAE,eAAuB,EAAE,IAAY;QACrE,KAAK,CACH,sCAAsC,IAAI,6BAA6B,YAAY,2BAA2B,eAAe,qCAAqC,YAAY,SAAS,eAAe,+EAA+E,CACtR,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC;QACvC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;IACzC,CAAC;CACF;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,qBAAqB;IACnC,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC5C,IAAI,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QACxB,uEAAuE;QACvE,sEAAsE;QACtE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YAC3B,IAAI,CAAC;gBACH,MAAM,GAAG,GAAG,YAAY,CAAC,GAAG,GAAG,eAAe,EAAE,MAAM,CAAC,CAAC;gBACxD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAwC,CAAC;gBACtE,IAAI,MAAM,CAAC,IAAI,KAAK,oBAAoB,IAAI,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;oBAC/E,OAAO,sBAAsB,MAAM,CAAC,OAAO,EAAE,CAAC;gBAChD,CAAC;YACH,CAAC;YAAC,MAAM,CAAC;gBACP,kBAAkB;YACpB,CAAC;YACD,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;YAC1B,IAAI,IAAI,KAAK,GAAG;gBAAE,MAAM;YACxB,GAAG,GAAG,IAAI,CAAC;QACb,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,kBAAkB;IACpB,CAAC;IACD,OAAO,kCAAkC,CAAC;AAC5C,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type H2AActorRegistration, type H2AEnvelope, type H2AJournalEntry, type H2AJournalPayload, type H2ANegotiationRecord } from "@sentropic/h2a";
|
|
2
|
+
import { type LocalStorePaths } from "./paths.js";
|
|
3
|
+
export interface CreateLocalStoreOptions {
|
|
4
|
+
root: string;
|
|
5
|
+
/**
|
|
6
|
+
* Timeout (ms) for acquiring any per-store advisory file lock. Defaults to
|
|
7
|
+
* 5000. Tests use a much smaller value to exercise the timeout path
|
|
8
|
+
* without slowing the suite. DEC-036.
|
|
9
|
+
*/
|
|
10
|
+
lockTimeoutMs?: number;
|
|
11
|
+
/**
|
|
12
|
+
* Read-only escape hatch: if the on-disk `.h2a-schema.json` declares a
|
|
13
|
+
* version we don't recognize, proceed anyway with a stderr warning. Never
|
|
14
|
+
* rewrites the sentinel. Intended for inspection tooling. DEC-036.
|
|
15
|
+
*/
|
|
16
|
+
allowVersionMismatch?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface LocalStore {
|
|
19
|
+
paths: LocalStorePaths;
|
|
20
|
+
registerInstance(reg: H2AActorRegistration): void;
|
|
21
|
+
listInstances(): H2AActorRegistration[];
|
|
22
|
+
findInstance(id: string): H2AActorRegistration | undefined;
|
|
23
|
+
openNegotiation(record: H2ANegotiationRecord): H2ANegotiationRecord;
|
|
24
|
+
readNegotiation(id: string): H2ANegotiationRecord | undefined;
|
|
25
|
+
updateNegotiationStatus(id: string, status: H2ANegotiationRecord["status"]): H2ANegotiationRecord;
|
|
26
|
+
appendNegotiationEvent<TBody = unknown>(negotiationId: string, payload: H2AJournalPayload<TBody>): H2AJournalEntry<TBody>;
|
|
27
|
+
readNegotiationJournal(negotiationId: string): H2AJournalEntry<unknown>[];
|
|
28
|
+
stabilizeNegotiation(negotiationId: string, options?: {
|
|
29
|
+
eventId?: string;
|
|
30
|
+
}): {
|
|
31
|
+
record: H2ANegotiationRecord;
|
|
32
|
+
artifactHash: string;
|
|
33
|
+
signers: string[];
|
|
34
|
+
finalEvent: H2AJournalEntry<unknown>;
|
|
35
|
+
artifactPath: string;
|
|
36
|
+
};
|
|
37
|
+
putInboxMessage(actor: string, envelope: H2AEnvelope): void;
|
|
38
|
+
readInbox(actor: string): H2AEnvelope[];
|
|
39
|
+
popInboxMessage(actor: string, envelopeId: string): H2AEnvelope | undefined;
|
|
40
|
+
putOutboxMessage(actor: string, envelope: H2AEnvelope): void;
|
|
41
|
+
readOutbox(actor: string): H2AEnvelope[];
|
|
42
|
+
}
|
|
43
|
+
export declare function createLocalStore(options: CreateLocalStoreOptions): LocalStore;
|
|
44
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/runtime/local-files/store.ts"],"names":[],"mappings":"AAWA,OAAO,EAWL,KAAK,oBAAoB,EAEzB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EAG1B,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAML,KAAK,eAAe,EACrB,MAAM,YAAY,CAAC;AASpB,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,eAAe,CAAC;IACvB,gBAAgB,CAAC,GAAG,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAClD,aAAa,IAAI,oBAAoB,EAAE,CAAC;IACxC,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,oBAAoB,GAAG,SAAS,CAAC;IAC3D,eAAe,CAAC,MAAM,EAAE,oBAAoB,GAAG,oBAAoB,CAAC;IACpE,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,oBAAoB,GAAG,SAAS,CAAC;IAC9D,uBAAuB,CACrB,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,oBAAoB,CAAC,QAAQ,CAAC,GACrC,oBAAoB,CAAC;IACxB,sBAAsB,CAAC,KAAK,GAAG,OAAO,EACpC,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,iBAAiB,CAAC,KAAK,CAAC,GAChC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC1B,sBAAsB,CAAC,aAAa,EAAE,MAAM,GAAG,eAAe,CAAC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