@tinycloud/courier 0.5.1-beta.3 → 0.5.1-beta.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.
- package/dist/commands.js +18 -3
- package/dist/commands.js.map +1 -1
- package/dist/file-lock.d.ts +86 -0
- package/dist/file-lock.js +331 -0
- package/dist/file-lock.js.map +1 -0
- package/dist/grant.js +2 -2
- package/dist/grant.js.map +1 -1
- package/dist/intake/queue.d.ts +1 -21
- package/dist/intake/queue.js +2 -172
- package/dist/intake/queue.js.map +1 -1
- package/dist/profile.d.ts +15 -0
- package/dist/profile.js +208 -4
- package/dist/profile.js.map +1 -1
- package/package.json +1 -1
package/dist/intake/queue.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import { randomBytes } from 'node:crypto';
|
|
4
3
|
import { CourierError } from '../errors.js';
|
|
5
4
|
import { isRecord } from '../a2a.js';
|
|
5
|
+
import { fsyncDir, writeTemp } from '../file-lock.js';
|
|
6
|
+
export { acquireLock, fsyncDir, writeNew } from '../file-lock.js';
|
|
6
7
|
/**
|
|
7
8
|
* Creates a directory and refuses anything that is not a real directory (a symlink in its place is refused). `mode`
|
|
8
9
|
* applies only to a directory this call creates; an existing directory keeps its mode, so a provisioned root (for
|
|
@@ -27,53 +28,6 @@ export function ensureRealDir(dir, mode) {
|
|
|
27
28
|
fs.chmodSync(dir, mode);
|
|
28
29
|
return !existed;
|
|
29
30
|
}
|
|
30
|
-
/** Makes a link or rename in `dir` durable: the directory entry is fsynced, not only the file contents. */
|
|
31
|
-
export function fsyncDir(dir) {
|
|
32
|
-
const fd = fs.openSync(dir, 'r');
|
|
33
|
-
try {
|
|
34
|
-
fs.fsyncSync(fd);
|
|
35
|
-
}
|
|
36
|
-
finally {
|
|
37
|
-
fs.closeSync(fd);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
/** Writes the full body to a same-directory temp file with the given mode, fsynced, and returns its path. */
|
|
41
|
-
function writeTemp(dir, name, body, mode) {
|
|
42
|
-
const temp = path.join(dir, `.${name}.${randomBytes(6).toString('hex')}.tmp`);
|
|
43
|
-
const fd = fs.openSync(temp, 'wx', mode);
|
|
44
|
-
try {
|
|
45
|
-
fs.writeFileSync(fd, body);
|
|
46
|
-
fs.fchmodSync(fd, mode);
|
|
47
|
-
fs.fsyncSync(fd);
|
|
48
|
-
}
|
|
49
|
-
catch (error) {
|
|
50
|
-
fs.closeSync(fd);
|
|
51
|
-
fs.rmSync(temp, { force: true });
|
|
52
|
-
throw error;
|
|
53
|
-
}
|
|
54
|
-
fs.closeSync(fd);
|
|
55
|
-
return temp;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Creates `dir/name` only if nothing is there yet (hard link of the temp file, which fails if the target exists, symlinks
|
|
59
|
-
* included). Returns false when the target already exists, so a queued message is never overwritten.
|
|
60
|
-
*/
|
|
61
|
-
export function writeNew(dir, name, body, mode) {
|
|
62
|
-
const temp = writeTemp(dir, name, body, mode);
|
|
63
|
-
try {
|
|
64
|
-
fs.linkSync(temp, path.join(dir, name));
|
|
65
|
-
fsyncDir(dir);
|
|
66
|
-
return true;
|
|
67
|
-
}
|
|
68
|
-
catch (error) {
|
|
69
|
-
if (error.code === 'EEXIST')
|
|
70
|
-
return false;
|
|
71
|
-
throw error;
|
|
72
|
-
}
|
|
73
|
-
finally {
|
|
74
|
-
fs.rmSync(temp, { force: true });
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
31
|
/** Replaces `dir/name` atomically (temp file plus rename). Refuses to replace anything that is not a regular file. */
|
|
78
32
|
export function writeReplace(dir, name, body, mode) {
|
|
79
33
|
const target = path.join(dir, name);
|
|
@@ -95,130 +49,6 @@ export function writeReplace(dir, name, body, mode) {
|
|
|
95
49
|
throw error;
|
|
96
50
|
}
|
|
97
51
|
}
|
|
98
|
-
/** Parses `{"pid":N,"nonce":"..."}`. A legacy `pid\n` lock parses with its own text as the nonce. */
|
|
99
|
-
function parseRecord(text) {
|
|
100
|
-
if (/^\d+\n?$/.test(text)) {
|
|
101
|
-
const pid = Number(text);
|
|
102
|
-
return Number.isInteger(pid) && pid > 0 ? { pid, nonce: text } : undefined;
|
|
103
|
-
}
|
|
104
|
-
try {
|
|
105
|
-
const value = JSON.parse(text);
|
|
106
|
-
if (typeof value !== 'object' || value === null)
|
|
107
|
-
return undefined;
|
|
108
|
-
const { pid, nonce } = value;
|
|
109
|
-
if (typeof pid !== 'number' || !Number.isInteger(pid) || pid <= 0)
|
|
110
|
-
return undefined;
|
|
111
|
-
if (typeof nonce !== 'string' || nonce.length === 0)
|
|
112
|
-
return undefined;
|
|
113
|
-
return { pid, nonce };
|
|
114
|
-
}
|
|
115
|
-
catch {
|
|
116
|
-
return undefined;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
function recordBody(record) {
|
|
120
|
-
return `${JSON.stringify({ pid: record.pid, nonce: record.nonce })}\n`;
|
|
121
|
-
}
|
|
122
|
-
function readRecordFile(file) {
|
|
123
|
-
try {
|
|
124
|
-
return parseRecord(fs.readFileSync(file, 'utf8'));
|
|
125
|
-
}
|
|
126
|
-
catch {
|
|
127
|
-
return undefined;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
/** Reads the lock. An unparseable lock is never broken: it refuses, as a live one would. */
|
|
131
|
-
function readLock(file) {
|
|
132
|
-
let text;
|
|
133
|
-
try {
|
|
134
|
-
text = fs.readFileSync(file, 'utf8');
|
|
135
|
-
}
|
|
136
|
-
catch (error) {
|
|
137
|
-
if (error.code === 'ENOENT')
|
|
138
|
-
return { kind: 'missing' };
|
|
139
|
-
throw error;
|
|
140
|
-
}
|
|
141
|
-
const record = parseRecord(text);
|
|
142
|
-
return record ? { kind: 'held', record } : { kind: 'corrupt' };
|
|
143
|
-
}
|
|
144
|
-
function pidAlive(pid) {
|
|
145
|
-
try {
|
|
146
|
-
process.kill(pid, 0);
|
|
147
|
-
return true;
|
|
148
|
-
}
|
|
149
|
-
catch (error) {
|
|
150
|
-
return error.code === 'EPERM';
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
/** Guard slots per dead lock. The bound stops a corrupt directory from looping forever. */
|
|
154
|
-
const MAX_BREAK_GUARDS = 8;
|
|
155
|
-
/**
|
|
156
|
-
* Takes the intake lock. A live holder always refuses, however old its files are; only a holder whose pid is dead is
|
|
157
|
-
* broken. The lock is created whole (never empty) and carries a nonce, so a release or a break removes only the lock
|
|
158
|
-
* it actually observed.
|
|
159
|
-
*/
|
|
160
|
-
export function acquireLock(file, opts = {}) {
|
|
161
|
-
const dir = path.dirname(file);
|
|
162
|
-
const name = path.basename(file);
|
|
163
|
-
const alive = opts.alive ?? pidAlive;
|
|
164
|
-
const self = { pid: opts.pid ?? process.pid, nonce: randomBytes(6).toString('hex') };
|
|
165
|
-
for (let attempt = 0; attempt < 3; attempt++) {
|
|
166
|
-
if (writeNew(dir, name, recordBody(self), 0o600)) {
|
|
167
|
-
return () => {
|
|
168
|
-
const current = readLock(file);
|
|
169
|
-
if (current.kind === 'held' && current.record.nonce === self.nonce)
|
|
170
|
-
fs.rmSync(file, { force: true });
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
const seen = readLock(file);
|
|
174
|
-
if (seen.kind === 'missing')
|
|
175
|
-
continue;
|
|
176
|
-
if (seen.kind === 'corrupt' || alive(seen.record.pid)) {
|
|
177
|
-
throw new CourierError('locked', 'another courier intake is running');
|
|
178
|
-
}
|
|
179
|
-
opts.afterObserve?.();
|
|
180
|
-
if (!breakDead(file, seen.record, self, alive)) {
|
|
181
|
-
throw new CourierError('locked', 'another courier intake is running');
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
throw new CourierError('locked', 'another courier intake is running');
|
|
185
|
-
}
|
|
186
|
-
/**
|
|
187
|
-
* Breaks the dead lock `stale`. Breakers serialize on numbered guard files `<lock>.break.<nonce>.<k>`: guard k is
|
|
188
|
-
* claimed exclusively; a guard whose holder is alive refuses the break, and one whose holder is dead is passed over.
|
|
189
|
-
* Under the guard the lock is re-read and unlinked only if it is still exactly `stale`. Returns false when a live
|
|
190
|
-
* contender holds the break, and true when the caller should retry creating its own lock.
|
|
191
|
-
*/
|
|
192
|
-
function breakDead(file, stale, self, alive) {
|
|
193
|
-
const dir = path.dirname(file);
|
|
194
|
-
const tag = `${path.basename(file)}.break.${stale.nonce.trim().replace(/[^A-Za-z0-9_-]/g, '_')}.`;
|
|
195
|
-
const body = recordBody(self);
|
|
196
|
-
let claimed = false;
|
|
197
|
-
for (let k = 1; k <= MAX_BREAK_GUARDS && !claimed; k++) {
|
|
198
|
-
const candidate = `${tag}${k}`;
|
|
199
|
-
if (writeNew(dir, candidate, body, 0o600)) {
|
|
200
|
-
claimed = true;
|
|
201
|
-
break;
|
|
202
|
-
}
|
|
203
|
-
const holder = readRecordFile(path.join(dir, candidate));
|
|
204
|
-
if (holder && alive(holder.pid))
|
|
205
|
-
return false;
|
|
206
|
-
}
|
|
207
|
-
if (!claimed)
|
|
208
|
-
return false;
|
|
209
|
-
try {
|
|
210
|
-
const now = readLock(file);
|
|
211
|
-
if (now.kind === 'held' && now.record.nonce === stale.nonce)
|
|
212
|
-
fs.rmSync(file, { force: true });
|
|
213
|
-
return true;
|
|
214
|
-
}
|
|
215
|
-
finally {
|
|
216
|
-
for (const entry of fs.readdirSync(dir)) {
|
|
217
|
-
if (entry.startsWith(tag))
|
|
218
|
-
fs.rmSync(path.join(dir, entry), { force: true });
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
52
|
export function emptyState() {
|
|
223
53
|
return { v: 1, peers: Object.create(null) };
|
|
224
54
|
}
|
package/dist/intake/queue.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue.js","sourceRoot":"","sources":["../../src/intake/queue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,I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,IAAI,CAAC;IACvB,CAAC;IACD,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC;AACzB,CAAC;AAED,0GAA0G;AAC1G,SAAS,WAAW,CAAC,GAAY,EAAE,KAAa;IAC9C,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,EAAE,EAAE,EAAE,UAAU,KAAK,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC;IACvE,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,OAAO,GAAG,CAAC,EAAE,KAAK,QAAQ,IAAI,OAAO,GAAG,CAAC,EAAE,KAAK,QAAQ;QAAE,OAAO,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC;IACjH,MAAM,IAAI,YAAY,CAAC,WAAW,EAAE,mCAAmC,CAAC,CAAC;AAC3E,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,GAAW,EAAE,IAAY,EAAE,KAAkB;IACtE,YAAY,CAAC,GAAG,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AAC9E,CAAC"}
|
package/dist/profile.d.ts
CHANGED
|
@@ -75,7 +75,22 @@ export declare function readRegularFile(file: string): string | undefined;
|
|
|
75
75
|
export declare function readSecure<T>(name: string, required: boolean, home?: string): T | undefined;
|
|
76
76
|
/** The fields `loadProfile` requires of a current (version 3) profile. */
|
|
77
77
|
export declare function hasProfileFields(profile: Partial<Profile> | null): profile is Profile;
|
|
78
|
+
/** A pairing that was started or half-completed and never finished is forgotten after this long (the peer delegation itself lives 7 days). */
|
|
79
|
+
export declare const PENDING_PAIRING_TTL_MS: number;
|
|
80
|
+
/** Expired pending pairings are not returned; they leave the file with the next save. */
|
|
78
81
|
export declare function loadProfile(home?: string): Profile;
|
|
82
|
+
/**
|
|
83
|
+
* Writes grant.json for a profile loaded earlier, under the profile lock and only while profile.json still holds the agent key that
|
|
84
|
+
* grant is for, so a command that outlived `init --rotate-key` never leaves the old key's grant beside the new profile.
|
|
85
|
+
*/
|
|
86
|
+
export declare function saveGrantIfCurrent(profile: Profile, grant: OwnerGrant): void;
|
|
87
|
+
/** Refuses a pairing start for `handle` when this copy or the file as it is now already has it paired. Reads, does not lock: it only avoids work that save would refuse. */
|
|
88
|
+
export declare function assertNotPaired(profile: Profile, handle: string): void;
|
|
89
|
+
/**
|
|
90
|
+
* Saves under a lock. A profile that came from `loadProfile` (or an earlier save) is merged with the file as it is NOW: only what
|
|
91
|
+
* this command changed is written, so a pairing, revocation or key rotation made by another command meanwhile is kept. `profile` is
|
|
92
|
+
* updated to the saved result. A profile built from scratch overwrites the file (first init, key rotation).
|
|
93
|
+
*/
|
|
79
94
|
export declare function saveProfile(profile: Profile): void;
|
|
80
95
|
/** The shape `loadKey` accepts: version 1, a JWK and a `did:key:` identifier. */
|
|
81
96
|
export declare function isAgentKey(value: unknown): value is AgentKey;
|
package/dist/profile.js
CHANGED
|
@@ -3,6 +3,8 @@ import path from 'node:path';
|
|
|
3
3
|
import { randomBytes } from 'node:crypto';
|
|
4
4
|
import { cmd } from './program.js';
|
|
5
5
|
import { CourierError } from './errors.js';
|
|
6
|
+
import { canonicalJson } from './canonical.js';
|
|
7
|
+
import { acquireLock } from './file-lock.js';
|
|
6
8
|
/**
|
|
7
9
|
* Courier home: `COURIER_HOME` when set, else `$HOME/.courier`. Refuses an unset or empty `HOME`
|
|
8
10
|
* rather than guessing a home directory.
|
|
@@ -120,10 +122,10 @@ export function readSecure(name, required, home = profileDir()) {
|
|
|
120
122
|
export function hasProfileFields(profile) {
|
|
121
123
|
return !!profile && typeof profile === 'object' && profile.version === 3 && !!profile.courierDid && !!profile.host && !!profile.openkeyHost;
|
|
122
124
|
}
|
|
123
|
-
|
|
125
|
+
function readProfile(home) {
|
|
124
126
|
const loaded = readSecure('profile.json', true, home);
|
|
125
127
|
if (!loaded || typeof loaded !== 'object' || !('version' in loaded)) {
|
|
126
|
-
throw new CourierError('bad-profile', `Corrupt profile at ${profilePath('profile.json')}`);
|
|
128
|
+
throw new CourierError('bad-profile', `Corrupt profile at ${profilePath('profile.json', home)}`);
|
|
127
129
|
}
|
|
128
130
|
if (loaded.version === 2) {
|
|
129
131
|
throw new CourierError('profile-outdated', `This profile stores Courier data in the applications space. Courier now uses your agents space: run \`${cmd('init --rotate-key')}\`, then re-pair peers.`);
|
|
@@ -132,12 +134,214 @@ export function loadProfile(home = profileDir()) {
|
|
|
132
134
|
throw new CourierError('bad-profile', `Unsupported profile version ${String(loaded.version)}; run \`${cmd('init --rotate-key')}\`.`);
|
|
133
135
|
const profile = loaded;
|
|
134
136
|
if (!hasProfileFields(profile))
|
|
135
|
-
throw new CourierError('bad-profile', `Corrupt profile at ${profilePath('profile.json')}`);
|
|
137
|
+
throw new CourierError('bad-profile', `Corrupt profile at ${profilePath('profile.json', home)}`);
|
|
136
138
|
profile.peers ??= {};
|
|
137
139
|
return profile;
|
|
138
140
|
}
|
|
141
|
+
/** A pairing that was started or half-completed and never finished is forgotten after this long (the peer delegation itself lives 7 days). */
|
|
142
|
+
export const PENDING_PAIRING_TTL_MS = 7 * 24 * 3600 * 1000;
|
|
143
|
+
function expiredPending(peer, now) {
|
|
144
|
+
if (peer.status === 'paired')
|
|
145
|
+
return false;
|
|
146
|
+
const started = Date.parse(peer.pairedAt);
|
|
147
|
+
return Number.isFinite(started) && now - started > PENDING_PAIRING_TTL_MS;
|
|
148
|
+
}
|
|
149
|
+
function dropExpiredPending(peers) {
|
|
150
|
+
const now = Date.now();
|
|
151
|
+
for (const [handle, peer] of Object.entries(peers))
|
|
152
|
+
if (expiredPending(peer, now))
|
|
153
|
+
delete peers[handle];
|
|
154
|
+
}
|
|
155
|
+
/** What each loaded or saved profile looked like on disk, so a later `saveProfile` can tell what THIS command changed. */
|
|
156
|
+
const baselines = new WeakMap();
|
|
157
|
+
function remember(profile) {
|
|
158
|
+
baselines.set(profile, JSON.parse(canonicalJson(profile)));
|
|
159
|
+
}
|
|
160
|
+
/** Expired pending pairings are not returned; they leave the file with the next save. */
|
|
161
|
+
export function loadProfile(home = profileDir()) {
|
|
162
|
+
const profile = readProfile(home);
|
|
163
|
+
dropExpiredPending(profile.peers);
|
|
164
|
+
remember(profile);
|
|
165
|
+
return profile;
|
|
166
|
+
}
|
|
167
|
+
const same = (a, b) => canonicalJson(a ?? null) === canonicalJson(b ?? null);
|
|
168
|
+
/** Three-way merge of one peer's fields: what this command changed wins, anything it left alone keeps the current file's value. */
|
|
169
|
+
function mergePeer(handle, base, mine, disk) {
|
|
170
|
+
if (same(mine, base))
|
|
171
|
+
return disk; // not touched by this command
|
|
172
|
+
if (!mine)
|
|
173
|
+
return undefined; // revoked here
|
|
174
|
+
if (!disk) {
|
|
175
|
+
if (!base)
|
|
176
|
+
return mine; // a new peer is added
|
|
177
|
+
throw new CourierError('peer-revoked', `${handle} was revoked while this command was running. Nothing was saved and nothing was published.`);
|
|
178
|
+
}
|
|
179
|
+
if (disk.status === 'paired' && mine.status !== 'paired') {
|
|
180
|
+
throw new CourierError('usage', `Already paired with ${handle}.`);
|
|
181
|
+
}
|
|
182
|
+
if (!base) {
|
|
183
|
+
// Another command added this handle meanwhile: replacing it would drop that command's delegations.
|
|
184
|
+
if (same(mine, disk))
|
|
185
|
+
return disk;
|
|
186
|
+
throw new CourierError('profile-changed', `Another command started a pairing with ${handle} while this one ran. Nothing was saved; run the command again.`);
|
|
187
|
+
}
|
|
188
|
+
const merged = {};
|
|
189
|
+
const m = mine;
|
|
190
|
+
const b = base;
|
|
191
|
+
const d = disk;
|
|
192
|
+
for (const key of new Set([...Object.keys(m), ...Object.keys(b), ...Object.keys(d)])) {
|
|
193
|
+
let value;
|
|
194
|
+
if (same(m[key], b[key]))
|
|
195
|
+
value = d[key];
|
|
196
|
+
else if (same(d[key], b[key]) || same(d[key], m[key]))
|
|
197
|
+
value = m[key];
|
|
198
|
+
else if (key === 'outbound') {
|
|
199
|
+
const byCid = new Map();
|
|
200
|
+
for (const entry of [...d.outbound, ...m.outbound])
|
|
201
|
+
byCid.set(entry.cid, entry);
|
|
202
|
+
value = [...byCid.values()].sort((x, y) => Date.parse(x.issuedAt) - Date.parse(y.issuedAt));
|
|
203
|
+
}
|
|
204
|
+
else if (key === 'inbound') {
|
|
205
|
+
// Two imports raced: the longer-lived delegation stays, never the one that happened to save last.
|
|
206
|
+
value = Date.parse(d.inbound.expiresAt) > Date.parse(m.inbound.expiresAt) ? d.inbound : m.inbound;
|
|
207
|
+
}
|
|
208
|
+
else if (key === 'status')
|
|
209
|
+
value = d.status === 'paired' ? 'paired' : m.status;
|
|
210
|
+
else
|
|
211
|
+
value = m[key];
|
|
212
|
+
if (value !== undefined)
|
|
213
|
+
merged[key] = value;
|
|
214
|
+
}
|
|
215
|
+
return merged;
|
|
216
|
+
}
|
|
217
|
+
function mergeProfile(base, mine, disk) {
|
|
218
|
+
assertSameAgent(base, disk);
|
|
219
|
+
const merged = {};
|
|
220
|
+
const m = mine;
|
|
221
|
+
const b = base;
|
|
222
|
+
const d = disk;
|
|
223
|
+
for (const key of new Set([...Object.keys(m), ...Object.keys(b), ...Object.keys(d)])) {
|
|
224
|
+
if (key === 'peers')
|
|
225
|
+
continue;
|
|
226
|
+
const value = same(m[key], b[key]) ? d[key] : m[key];
|
|
227
|
+
if (value !== undefined)
|
|
228
|
+
merged[key] = value;
|
|
229
|
+
}
|
|
230
|
+
const peers = {};
|
|
231
|
+
for (const handle of new Set([...Object.keys(mine.peers), ...Object.keys(base.peers), ...Object.keys(disk.peers)])) {
|
|
232
|
+
const peer = mergePeer(handle, base.peers[handle], mine.peers[handle], disk.peers[handle]);
|
|
233
|
+
if (peer)
|
|
234
|
+
peers[handle] = peer;
|
|
235
|
+
}
|
|
236
|
+
merged.peers = peers;
|
|
237
|
+
return merged;
|
|
238
|
+
}
|
|
239
|
+
/** Make `target` hold `source`'s values without replacing nested objects the caller still points at (for example a peer it just updated). */
|
|
240
|
+
function adopt(target, source) {
|
|
241
|
+
for (const key of Object.keys(target))
|
|
242
|
+
if (!(key in source))
|
|
243
|
+
delete target[key];
|
|
244
|
+
for (const [key, value] of Object.entries(source)) {
|
|
245
|
+
const current = target[key];
|
|
246
|
+
if (key === 'peers' && current && typeof current === 'object' && value && typeof value === 'object')
|
|
247
|
+
adoptPeers(current, value);
|
|
248
|
+
else
|
|
249
|
+
target[key] = value;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
function adoptPeers(target, source) {
|
|
253
|
+
for (const handle of Object.keys(target))
|
|
254
|
+
if (!(handle in source))
|
|
255
|
+
delete target[handle];
|
|
256
|
+
for (const [handle, peer] of Object.entries(source)) {
|
|
257
|
+
const current = target[handle];
|
|
258
|
+
if (current && typeof current === 'object')
|
|
259
|
+
adopt(current, peer);
|
|
260
|
+
else
|
|
261
|
+
target[handle] = peer;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
const LOCK_WAIT_MS = 10_000;
|
|
265
|
+
function sleepSync(ms) {
|
|
266
|
+
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms);
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Exclusive, held only while a save reads, merges and writes (milliseconds). The lock is intake's: created whole with a `{pid, nonce}` owner
|
|
270
|
+
* record, released only by its nonce, and broken only when its holder is established dead (a true boot-id change on the same host, or its pid is absent; on Linux the record and this process must name the same pid namespace).
|
|
271
|
+
* A live holder, or one whose liveness cannot be established, is waited for and then refused: age alone never breaks a lock.
|
|
272
|
+
*/
|
|
273
|
+
function withProfileLock(fn) {
|
|
274
|
+
ensureSecureDir();
|
|
275
|
+
const lock = `${profilePath('profile.json')}.lock`;
|
|
276
|
+
const deadline = performance.now() + LOCK_WAIT_MS;
|
|
277
|
+
let release;
|
|
278
|
+
for (;;) {
|
|
279
|
+
try {
|
|
280
|
+
release = acquireLock(lock);
|
|
281
|
+
break;
|
|
282
|
+
}
|
|
283
|
+
catch (error) {
|
|
284
|
+
if (!(error instanceof CourierError) || error.code !== 'locked')
|
|
285
|
+
throw error;
|
|
286
|
+
if (performance.now() >= deadline)
|
|
287
|
+
throw new CourierError('profile-locked', error.message);
|
|
288
|
+
}
|
|
289
|
+
sleepSync(10);
|
|
290
|
+
}
|
|
291
|
+
try {
|
|
292
|
+
return fn();
|
|
293
|
+
}
|
|
294
|
+
finally {
|
|
295
|
+
release?.();
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
function assertSameAgent(base, disk) {
|
|
299
|
+
if (disk.courierDid !== base.courierDid) {
|
|
300
|
+
throw new CourierError('profile-changed', 'The agent key changed while this command was running (`init --rotate-key`). Nothing was saved; run the command again.');
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Writes grant.json for a profile loaded earlier, under the profile lock and only while profile.json still holds the agent key that
|
|
305
|
+
* grant is for, so a command that outlived `init --rotate-key` never leaves the old key's grant beside the new profile.
|
|
306
|
+
*/
|
|
307
|
+
export function saveGrantIfCurrent(profile, grant) {
|
|
308
|
+
withProfileLock(() => {
|
|
309
|
+
const base = baselines.get(profile);
|
|
310
|
+
if (base && fs.existsSync(profilePath('profile.json')))
|
|
311
|
+
assertSameAgent(base, readProfile(profileDir()));
|
|
312
|
+
saveGrant(grant);
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
/** Refuses a pairing start for `handle` when this copy or the file as it is now already has it paired. Reads, does not lock: it only avoids work that save would refuse. */
|
|
316
|
+
export function assertNotPaired(profile, handle) {
|
|
317
|
+
const current = fs.existsSync(profilePath('profile.json')) ? readProfile(profileDir()) : undefined;
|
|
318
|
+
if (profile.peers[handle]?.status === 'paired' || current?.peers[handle]?.status === 'paired') {
|
|
319
|
+
throw new CourierError('usage', `Already paired with ${handle}.`);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Saves under a lock. A profile that came from `loadProfile` (or an earlier save) is merged with the file as it is NOW: only what
|
|
324
|
+
* this command changed is written, so a pairing, revocation or key rotation made by another command meanwhile is kept. `profile` is
|
|
325
|
+
* updated to the saved result. A profile built from scratch overwrites the file (first init, key rotation).
|
|
326
|
+
*/
|
|
139
327
|
export function saveProfile(profile) {
|
|
140
|
-
|
|
328
|
+
const file = profilePath('profile.json');
|
|
329
|
+
withProfileLock(() => {
|
|
330
|
+
const base = baselines.get(profile);
|
|
331
|
+
let result = profile;
|
|
332
|
+
if (base && fs.existsSync(file)) {
|
|
333
|
+
const disk = readProfile(profileDir());
|
|
334
|
+
dropExpiredPending(disk.peers); // an expired pairing is not another command's: it must not block starting that handle again
|
|
335
|
+
result = mergeProfile(base, profile, disk);
|
|
336
|
+
}
|
|
337
|
+
dropExpiredPending(result.peers);
|
|
338
|
+
writeSecure(file, result);
|
|
339
|
+
if (result !== profile)
|
|
340
|
+
adopt(profile, result);
|
|
341
|
+
else
|
|
342
|
+
dropExpiredPending(profile.peers);
|
|
343
|
+
remember(profile);
|
|
344
|
+
});
|
|
141
345
|
}
|
|
142
346
|
/** The shape `loadKey` accepts: version 1, a JWK and a `did:key:` identifier. */
|
|
143
347
|
export function isAgentKey(value) {
|
package/dist/profile.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile.js","sourceRoot":"","sources":["../src/profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAwD3C;;;GAGG;AACH,MAAM,UAAU,UAAU;IACxB,IAAI,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;IACnC,IAAI,CAAC,GAAG,EAAE,CAAC;QAC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