@agent-relay/core-bridge 17.2.1 → 18.0.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/dist/auth.d.ts +147 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +385 -0
- package/dist/auth.js.map +1 -0
- package/dist/client.d.ts +88 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +338 -0
- package/dist/client.js.map +1 -0
- package/dist/errors.d.ts +107 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +142 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/paths.d.ts +25 -0
- package/dist/paths.d.ts.map +1 -0
- package/dist/paths.js +42 -0
- package/dist/paths.js.map +1 -0
- package/dist/spawn.d.ts +160 -0
- package/dist/spawn.d.ts.map +1 -0
- package/dist/spawn.js +232 -0
- package/dist/spawn.js.map +1 -0
- package/dist/trust.d.ts +20 -0
- package/dist/trust.d.ts.map +1 -0
- package/dist/trust.js +40 -0
- package/dist/trust.js.map +1 -0
- package/package.json +1 -1
package/dist/client.js
ADDED
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import net from 'node:net';
|
|
3
|
+
import { BridgeVersionMismatchError, CoreBridgeError, CoreClosedError, CoreNotRunningError, CoreReplyTooLargeError, CoreRequestTooLargeError, CoreRpcError, CoreTimeoutError, NotACoreError, } from './errors.js';
|
|
4
|
+
import { BRIDGE_VERSION, MAX_REPLY_BYTES, MAX_REQUEST_BYTES, coreSocketPath, pipeName } from './paths.js';
|
|
5
|
+
import { trustedSocketDirectory, trustedSocketFile } from './trust.js';
|
|
6
|
+
/** Every event topic the core publishes (`protocol.rs` `Topic`). */
|
|
7
|
+
export const TOPICS = ['status', 'activity', 'shutdown', 'invalidated', 'notify', 'sign_in'];
|
|
8
|
+
const DEFAULT_TIMEOUT_MS = 15_000;
|
|
9
|
+
const NEWLINE = 0x0a;
|
|
10
|
+
function rpcErrorOf(error) {
|
|
11
|
+
const raw = (typeof error === 'object' && error !== null ? error : {});
|
|
12
|
+
const data = typeof raw.data === 'object' && raw.data !== null ? raw.data : {};
|
|
13
|
+
return new CoreRpcError(String(raw.message ?? 'The core refused the request.'), {
|
|
14
|
+
rpcCode: typeof raw.code === 'number' ? raw.code : undefined,
|
|
15
|
+
kind: typeof data.kind === 'string' ? data.kind : undefined,
|
|
16
|
+
retryable: data.retryable === true,
|
|
17
|
+
planLimit: typeof data.plan_limit === 'object' && data.plan_limit !== null
|
|
18
|
+
? data.plan_limit
|
|
19
|
+
: undefined,
|
|
20
|
+
reason: typeof data.reason === 'string' ? data.reason : undefined,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
class BridgeConnection {
|
|
24
|
+
socket;
|
|
25
|
+
hello;
|
|
26
|
+
#stream;
|
|
27
|
+
#callTimeoutMs;
|
|
28
|
+
#nextId = 1;
|
|
29
|
+
#parts = [];
|
|
30
|
+
#partBytes = 0;
|
|
31
|
+
#closed = false;
|
|
32
|
+
#closeError;
|
|
33
|
+
#closeFired = false;
|
|
34
|
+
#pending = new Map();
|
|
35
|
+
#eventListeners = new Set();
|
|
36
|
+
#closeListeners = new Set();
|
|
37
|
+
#closedPromise;
|
|
38
|
+
constructor(stream, socket, callTimeoutMs) {
|
|
39
|
+
this.#stream = stream;
|
|
40
|
+
this.socket = socket;
|
|
41
|
+
this.#callTimeoutMs = callTimeoutMs;
|
|
42
|
+
let markClosed;
|
|
43
|
+
this.#closedPromise = new Promise((resolve) => (markClosed = resolve));
|
|
44
|
+
stream.on('data', (chunk) => this.#receive(chunk));
|
|
45
|
+
stream.on('error', (error) => {
|
|
46
|
+
const closing = new CoreClosedError(error.message, { cause: error });
|
|
47
|
+
this.#closeError ??= closing;
|
|
48
|
+
this.#failAll(closing);
|
|
49
|
+
});
|
|
50
|
+
stream.on('close', () => {
|
|
51
|
+
this.#failAll(new CoreClosedError());
|
|
52
|
+
this.#closeFired = true;
|
|
53
|
+
for (const listener of [...this.#closeListeners]) {
|
|
54
|
+
try {
|
|
55
|
+
listener(this.#closeError);
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
// A listener's failure is its own.
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
this.#closeListeners.clear();
|
|
62
|
+
this.#eventListeners.clear();
|
|
63
|
+
markClosed();
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
get closed() {
|
|
67
|
+
return this.#closed;
|
|
68
|
+
}
|
|
69
|
+
#failAll(error) {
|
|
70
|
+
this.#closed = true;
|
|
71
|
+
for (const waiter of this.#pending.values())
|
|
72
|
+
waiter.reject(error);
|
|
73
|
+
this.#pending.clear();
|
|
74
|
+
}
|
|
75
|
+
/** Close the connection because the core broke the protocol. */
|
|
76
|
+
#fail(error) {
|
|
77
|
+
this.#closeError ??= error;
|
|
78
|
+
this.#parts = [];
|
|
79
|
+
this.#partBytes = 0;
|
|
80
|
+
this.#failAll(error);
|
|
81
|
+
this.#stream.destroy();
|
|
82
|
+
}
|
|
83
|
+
#receive(chunk) {
|
|
84
|
+
let start = 0;
|
|
85
|
+
while (!this.#closed) {
|
|
86
|
+
const newline = chunk.indexOf(NEWLINE, start);
|
|
87
|
+
if (newline < 0) {
|
|
88
|
+
const rest = chunk.subarray(start);
|
|
89
|
+
if (rest.length > 0) {
|
|
90
|
+
this.#parts.push(rest);
|
|
91
|
+
this.#partBytes += rest.length;
|
|
92
|
+
}
|
|
93
|
+
// A line already past the cap can never become a valid reply.
|
|
94
|
+
if (this.#partBytes > MAX_REPLY_BYTES)
|
|
95
|
+
this.#fail(new CoreReplyTooLargeError());
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const piece = chunk.subarray(start, newline);
|
|
99
|
+
start = newline + 1;
|
|
100
|
+
const bytes = this.#partBytes + piece.length;
|
|
101
|
+
let line = piece;
|
|
102
|
+
if (this.#parts.length > 0) {
|
|
103
|
+
this.#parts.push(piece);
|
|
104
|
+
line = Buffer.concat(this.#parts, bytes);
|
|
105
|
+
this.#parts = [];
|
|
106
|
+
this.#partBytes = 0;
|
|
107
|
+
}
|
|
108
|
+
if (bytes > MAX_REPLY_BYTES) {
|
|
109
|
+
this.#fail(new CoreReplyTooLargeError());
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
this.#line(line.toString('utf8'));
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
#line(text) {
|
|
116
|
+
let message;
|
|
117
|
+
try {
|
|
118
|
+
message = JSON.parse(text);
|
|
119
|
+
}
|
|
120
|
+
catch {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
if (typeof message !== 'object' || message === null)
|
|
124
|
+
return;
|
|
125
|
+
if (!('id' in message)) {
|
|
126
|
+
// Notifications: only events are known; anything newer is ignored.
|
|
127
|
+
if (message.method === 'event' && typeof message.params === 'object' && message.params !== null) {
|
|
128
|
+
this.#emit(message.params);
|
|
129
|
+
}
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
if (typeof message.id !== 'number')
|
|
133
|
+
return;
|
|
134
|
+
const waiter = this.#pending.get(message.id);
|
|
135
|
+
if (!waiter)
|
|
136
|
+
return;
|
|
137
|
+
this.#pending.delete(message.id);
|
|
138
|
+
if (message.error)
|
|
139
|
+
waiter.reject(rpcErrorOf(message.error));
|
|
140
|
+
else
|
|
141
|
+
waiter.resolve(message.result ?? null);
|
|
142
|
+
}
|
|
143
|
+
#emit(event) {
|
|
144
|
+
for (const listener of [...this.#eventListeners]) {
|
|
145
|
+
try {
|
|
146
|
+
listener(event);
|
|
147
|
+
}
|
|
148
|
+
catch {
|
|
149
|
+
// A listener that throws must not break the read loop.
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
call(method, params = {}, opts = {}) {
|
|
154
|
+
if (this.#closed)
|
|
155
|
+
return Promise.reject(new CoreClosedError());
|
|
156
|
+
const { signal } = opts;
|
|
157
|
+
if (signal?.aborted)
|
|
158
|
+
return Promise.reject(signal.reason);
|
|
159
|
+
const id = this.#nextId++;
|
|
160
|
+
const line = JSON.stringify({ jsonrpc: '2.0', id, method, params });
|
|
161
|
+
const bytes = Buffer.byteLength(line, 'utf8');
|
|
162
|
+
if (bytes > MAX_REQUEST_BYTES) {
|
|
163
|
+
return Promise.reject(new CoreRequestTooLargeError(method, bytes, MAX_REQUEST_BYTES));
|
|
164
|
+
}
|
|
165
|
+
const timeoutMs = opts.timeoutMs ?? this.#callTimeoutMs;
|
|
166
|
+
return new Promise((resolve, reject) => {
|
|
167
|
+
const onAbort = () => {
|
|
168
|
+
this.#pending.delete(id);
|
|
169
|
+
settle();
|
|
170
|
+
reject(signal.reason);
|
|
171
|
+
};
|
|
172
|
+
const settle = () => {
|
|
173
|
+
clearTimeout(timer);
|
|
174
|
+
signal?.removeEventListener('abort', onAbort);
|
|
175
|
+
};
|
|
176
|
+
const timer = setTimeout(() => {
|
|
177
|
+
this.#pending.delete(id);
|
|
178
|
+
settle();
|
|
179
|
+
reject(new CoreTimeoutError(method));
|
|
180
|
+
}, timeoutMs);
|
|
181
|
+
signal?.addEventListener('abort', onAbort, { once: true });
|
|
182
|
+
this.#pending.set(id, {
|
|
183
|
+
resolve: (value) => {
|
|
184
|
+
settle();
|
|
185
|
+
resolve(value);
|
|
186
|
+
},
|
|
187
|
+
reject: (error) => {
|
|
188
|
+
settle();
|
|
189
|
+
reject(error);
|
|
190
|
+
},
|
|
191
|
+
});
|
|
192
|
+
this.#stream.write(`${line}\n`);
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
subscribe(topics) {
|
|
196
|
+
return this.call('subscribe', { topics });
|
|
197
|
+
}
|
|
198
|
+
unsubscribe(topics) {
|
|
199
|
+
return this.call('unsubscribe', { topics });
|
|
200
|
+
}
|
|
201
|
+
onEvent(listener) {
|
|
202
|
+
if (this.#closeFired)
|
|
203
|
+
return () => { };
|
|
204
|
+
this.#eventListeners.add(listener);
|
|
205
|
+
return () => {
|
|
206
|
+
this.#eventListeners.delete(listener);
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
onClose(listener) {
|
|
210
|
+
if (this.#closeFired) {
|
|
211
|
+
const error = this.#closeError;
|
|
212
|
+
queueMicrotask(() => listener(error));
|
|
213
|
+
return () => { };
|
|
214
|
+
}
|
|
215
|
+
this.#closeListeners.add(listener);
|
|
216
|
+
return () => {
|
|
217
|
+
this.#closeListeners.delete(listener);
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
close() {
|
|
221
|
+
this.#closed = true;
|
|
222
|
+
this.#stream.destroy();
|
|
223
|
+
}
|
|
224
|
+
async [Symbol.asyncDispose]() {
|
|
225
|
+
this.close();
|
|
226
|
+
await this.#closedPromise;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
function open(address, socket, timeoutMs, signal) {
|
|
230
|
+
return new Promise((resolve, reject) => {
|
|
231
|
+
const stream = net.createConnection(address);
|
|
232
|
+
const onAbort = () => {
|
|
233
|
+
clearTimeout(timer);
|
|
234
|
+
stream.destroy();
|
|
235
|
+
reject(signal.reason);
|
|
236
|
+
};
|
|
237
|
+
const timer = setTimeout(() => {
|
|
238
|
+
signal?.removeEventListener('abort', onAbort);
|
|
239
|
+
stream.destroy();
|
|
240
|
+
reject(new CoreNotRunningError(socket, `No Agent Relay core answered at ${socket} in time.`));
|
|
241
|
+
}, timeoutMs);
|
|
242
|
+
signal?.addEventListener('abort', onAbort, { once: true });
|
|
243
|
+
stream.once('connect', () => {
|
|
244
|
+
clearTimeout(timer);
|
|
245
|
+
signal?.removeEventListener('abort', onAbort);
|
|
246
|
+
resolve(stream);
|
|
247
|
+
});
|
|
248
|
+
// Stays attached once connected, so an error before the client's own
|
|
249
|
+
// handler is attached is never unhandled; a settled promise ignores it.
|
|
250
|
+
stream.once('error', (error) => {
|
|
251
|
+
clearTimeout(timer);
|
|
252
|
+
signal?.removeEventListener('abort', onAbort);
|
|
253
|
+
reject(new CoreNotRunningError(socket, `No Agent Relay core is listening at ${socket}.`, { cause: error }));
|
|
254
|
+
});
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Connect to the core and greet it.
|
|
259
|
+
*
|
|
260
|
+
* Order: socket file exists (else not running), its directory and the socket
|
|
261
|
+
* file pass the ownership and mode checks, connect, `hello`, and the greeting
|
|
262
|
+
* has the core's shape. Only "nothing answers" is {@link CoreNotRunningError};
|
|
263
|
+
* every other failure is its own error, so a caller never takes a refused or
|
|
264
|
+
* foreign socket for an absent core and starts a second one.
|
|
265
|
+
* @param opts - Where the core is and how long to wait
|
|
266
|
+
* @returns A greeted client
|
|
267
|
+
* @throws CoreNotRunningError, CoreUntrustedError, NotACoreError, BridgeVersionMismatchError, CoreBridgeError
|
|
268
|
+
*/
|
|
269
|
+
export async function connectCore(opts = {}) {
|
|
270
|
+
const socket = opts.socket ?? coreSocketPath(opts.env, opts.home);
|
|
271
|
+
const connectTimeoutMs = opts.connectTimeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
272
|
+
const callTimeoutMs = opts.callTimeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
273
|
+
const { signal } = opts;
|
|
274
|
+
signal?.throwIfAborted();
|
|
275
|
+
if (process.platform !== 'win32') {
|
|
276
|
+
if (!fs.existsSync(socket)) {
|
|
277
|
+
throw new CoreNotRunningError(socket, `No Agent Relay core is listening at ${socket}.`);
|
|
278
|
+
}
|
|
279
|
+
trustedSocketDirectory(socket);
|
|
280
|
+
trustedSocketFile(socket);
|
|
281
|
+
}
|
|
282
|
+
const address = process.platform === 'win32' ? pipeName(socket) : socket;
|
|
283
|
+
const stream = await open(address, socket, connectTimeoutMs, signal);
|
|
284
|
+
const client = new BridgeConnection(stream, socket, callTimeoutMs);
|
|
285
|
+
let greeting;
|
|
286
|
+
try {
|
|
287
|
+
greeting = await client.call('hello', { bridge_version: BRIDGE_VERSION }, { signal });
|
|
288
|
+
}
|
|
289
|
+
catch (error) {
|
|
290
|
+
client.close();
|
|
291
|
+
if (signal?.aborted && error === signal.reason)
|
|
292
|
+
throw error;
|
|
293
|
+
const message = `A core answers at ${socket} but refused this client (${error.message}). ` +
|
|
294
|
+
'Update the Agent Relay desktop app or the relay CLI so both speak the same bridge.';
|
|
295
|
+
if (error instanceof CoreRpcError && error.kind === 'bridge_version_mismatch') {
|
|
296
|
+
throw new BridgeVersionMismatchError(BRIDGE_VERSION, error.message, message, { cause: error });
|
|
297
|
+
}
|
|
298
|
+
throw new CoreBridgeError('handshake_failed', message, { cause: error });
|
|
299
|
+
}
|
|
300
|
+
// The core's greeting names its bridge and pid; anything else is not the
|
|
301
|
+
// core. A real core refuses another version rather than greeting with it.
|
|
302
|
+
if (typeof greeting?.bridge_version !== 'number' ||
|
|
303
|
+
typeof greeting.pid !== 'number' ||
|
|
304
|
+
greeting.bridge_version !== BRIDGE_VERSION) {
|
|
305
|
+
client.close();
|
|
306
|
+
throw new NotACoreError(`What answers at ${socket} is not an Agent Relay core; refusing to speak to it.`);
|
|
307
|
+
}
|
|
308
|
+
client.hello = Object.freeze({
|
|
309
|
+
bridge_version: greeting.bridge_version,
|
|
310
|
+
daemon_version: typeof greeting.daemon_version === 'string' ? greeting.daemon_version : '',
|
|
311
|
+
pid: greeting.pid,
|
|
312
|
+
methods: Array.isArray(greeting.methods) ? [...greeting.methods] : [],
|
|
313
|
+
topics: Array.isArray(greeting.topics) ? [...greeting.topics] : [],
|
|
314
|
+
});
|
|
315
|
+
if (signal) {
|
|
316
|
+
const onAbort = () => client.close();
|
|
317
|
+
signal.addEventListener('abort', onAbort, { once: true });
|
|
318
|
+
client.onClose(() => signal.removeEventListener('abort', onAbort));
|
|
319
|
+
}
|
|
320
|
+
return client;
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* {@link connectCore}, but resolves undefined when no core is running
|
|
324
|
+
* ({@link CoreNotRunningError}); every other failure still throws.
|
|
325
|
+
* @param opts - Where the core is and how long to wait
|
|
326
|
+
* @returns A greeted client, or undefined when nothing answers
|
|
327
|
+
*/
|
|
328
|
+
export async function tryConnectCore(opts = {}) {
|
|
329
|
+
try {
|
|
330
|
+
return await connectCore(opts);
|
|
331
|
+
}
|
|
332
|
+
catch (error) {
|
|
333
|
+
if (error instanceof CoreNotRunningError)
|
|
334
|
+
return undefined;
|
|
335
|
+
throw error;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,GAAG,MAAM,UAAU,CAAC;AAE3B,OAAO,EACL,0BAA0B,EAC1B,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,sBAAsB,EACtB,wBAAwB,EACxB,YAAY,EACZ,gBAAgB,EAChB,aAAa,GAId,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,iBAAiB,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC1G,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEvE,oEAAoE;AACpE,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,CAAU,CAAC;AAmEtG,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAClC,MAAM,OAAO,GAAG,IAAI,CAAC;AAOrB,SAAS,UAAU,CAAC,KAAc;IAChC,MAAM,GAAG,GAAG,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAIpE,CAAC;IACF,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the core can return in `error.data.kind`
|
|
3
|
+
* (`crates/relay-node/src/relay/protocol.rs` `ErrorKind`). A kind may be
|
|
4
|
+
* added without a bridge version bump, so {@link ErrorKind} also admits any
|
|
5
|
+
* other string.
|
|
6
|
+
*/
|
|
7
|
+
export declare const ERROR_KINDS: readonly ["parse_error", "invalid_request", "method_not_found", "invalid_params", "handshake_required", "bridge_version_mismatch", "not_signed_in", "refused", "relaycast_unreachable", "relaycast_refused", "unauthorized", "plan_limit_exceeded", "rate_limited", "not_found", "conflict", "shutting_down", "busy", "store_failed", "cloud_failed", "cloud_refused", "fleet_unavailable", "internal"];
|
|
8
|
+
/** A machine-readable error kind from the core; branch on this, not on the message. */
|
|
9
|
+
export type ErrorKind = (typeof ERROR_KINDS)[number] | (string & {});
|
|
10
|
+
/** With `plan_limit_exceeded`: which cap was reached and how full it is (`contract/plan.rs`). */
|
|
11
|
+
export interface PlanLimit {
|
|
12
|
+
limit: 'devices' | 'agents' | 'humans' | 'other' | (string & {});
|
|
13
|
+
max: number;
|
|
14
|
+
current: number;
|
|
15
|
+
plan: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Every typed reason the core gives with a `refused` error in
|
|
19
|
+
* `error.data.reason` (`protocol.rs` `RefusalReason`). None is retryable.
|
|
20
|
+
*/
|
|
21
|
+
export declare const REFUSAL_REASONS: readonly ["service_unknown", "service_disabled", "service_expired", "workspace_mismatch", "not_owner", "outside_scope", "management_peer"];
|
|
22
|
+
/**
|
|
23
|
+
* Why the core refused a call. A reason may be added without a bridge version
|
|
24
|
+
* bump, so this also admits any other string.
|
|
25
|
+
*/
|
|
26
|
+
export type RefusalReason = (typeof REFUSAL_REASONS)[number] | (string & {});
|
|
27
|
+
/** The base of every error this package throws; `code` names the class of failure. */
|
|
28
|
+
export declare class CoreBridgeError extends Error {
|
|
29
|
+
readonly code: string;
|
|
30
|
+
constructor(code: string, message: string, options?: {
|
|
31
|
+
cause?: unknown;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
/** Nothing answers at the socket: the file is missing, the connection failed, or connecting timed out. */
|
|
35
|
+
export declare class CoreNotRunningError extends CoreBridgeError {
|
|
36
|
+
readonly socket: string;
|
|
37
|
+
constructor(socket: string, message: string, options?: {
|
|
38
|
+
cause?: unknown;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/** The socket or its directory could have been planted by someone else; the client refused to connect. */
|
|
42
|
+
export declare class CoreUntrustedError extends CoreBridgeError {
|
|
43
|
+
readonly reason: 'directory' | 'socket';
|
|
44
|
+
constructor(reason: 'directory' | 'socket', message: string);
|
|
45
|
+
}
|
|
46
|
+
/** What answered at the socket did not greet like the Agent Relay core. */
|
|
47
|
+
export declare class NotACoreError extends CoreBridgeError {
|
|
48
|
+
constructor(message: string);
|
|
49
|
+
}
|
|
50
|
+
/** The core speaks a different bridge version and refused this client. */
|
|
51
|
+
export declare class BridgeVersionMismatchError extends CoreBridgeError {
|
|
52
|
+
/** The bridge version this client sent. */
|
|
53
|
+
readonly clientVersion: number;
|
|
54
|
+
/** The core's own message, safe to show a person. */
|
|
55
|
+
readonly coreMessage: string;
|
|
56
|
+
constructor(clientVersion: number, coreMessage: string, message: string, options?: {
|
|
57
|
+
cause?: unknown;
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
/** The core answered a call with a JSON-RPC error. */
|
|
61
|
+
export declare class CoreRpcError extends CoreBridgeError {
|
|
62
|
+
/** The JSON-RPC numeric code. */
|
|
63
|
+
readonly rpcCode: number | undefined;
|
|
64
|
+
/** The stable machine-readable kind from `error.data.kind`. */
|
|
65
|
+
readonly kind: ErrorKind | undefined;
|
|
66
|
+
/** Whether repeating the same request later can succeed. */
|
|
67
|
+
readonly retryable: boolean;
|
|
68
|
+
/** With `plan_limit_exceeded`, the counters when the core had them. */
|
|
69
|
+
readonly planLimit: PlanLimit | undefined;
|
|
70
|
+
/** With `refused`, the typed reason from `error.data.reason` when the core gave one. */
|
|
71
|
+
readonly reason: RefusalReason | undefined;
|
|
72
|
+
constructor(message: string, details?: {
|
|
73
|
+
rpcCode?: number;
|
|
74
|
+
kind?: ErrorKind;
|
|
75
|
+
retryable?: boolean;
|
|
76
|
+
planLimit?: PlanLimit;
|
|
77
|
+
reason?: RefusalReason;
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* @deprecated Use {@link CoreRpcError}; this alias is removed in the next release.
|
|
82
|
+
*/
|
|
83
|
+
export declare const CoreCallError: typeof CoreRpcError;
|
|
84
|
+
/** @deprecated Use {@link CoreRpcError}. */
|
|
85
|
+
export type CoreCallError = CoreRpcError;
|
|
86
|
+
/** The core did not answer a call in time. */
|
|
87
|
+
export declare class CoreTimeoutError extends CoreBridgeError {
|
|
88
|
+
readonly method: string;
|
|
89
|
+
constructor(method: string);
|
|
90
|
+
}
|
|
91
|
+
/** The core sent a line longer than `MAX_REPLY_BYTES`; the connection was closed. */
|
|
92
|
+
export declare class CoreReplyTooLargeError extends CoreBridgeError {
|
|
93
|
+
constructor();
|
|
94
|
+
}
|
|
95
|
+
/** A request line would exceed `MAX_REQUEST_BYTES`; it was not sent and the connection stays open. */
|
|
96
|
+
export declare class CoreRequestTooLargeError extends CoreBridgeError {
|
|
97
|
+
readonly method: string;
|
|
98
|
+
readonly bytes: number;
|
|
99
|
+
constructor(method: string, bytes: number, limit: number);
|
|
100
|
+
}
|
|
101
|
+
/** The connection is closed: a call after close, or the connection ended while calls were pending. */
|
|
102
|
+
export declare class CoreClosedError extends CoreBridgeError {
|
|
103
|
+
constructor(message?: string, options?: {
|
|
104
|
+
cause?: unknown;
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,WAAW,yYAuBd,CAAC;AAEX,uFAAuF;A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BAAa,wBAAyB,SAAQ,eAAe;IAC3D,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;gBACX,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;CAQzD;AAED,sGAAsG;AACtG,qBAAa,eAAgB,SAAQ,eAAe;gBACtC,OAAO,SAAgD,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAGnG"}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every error kind the core can return in `error.data.kind`
|
|
3
|
+
* (`crates/relay-node/src/relay/protocol.rs` `ErrorKind`). A kind may be
|
|
4
|
+
* added without a bridge version bump, so {@link ErrorKind} also admits any
|
|
5
|
+
* other string.
|
|
6
|
+
*/
|
|
7
|
+
export const ERROR_KINDS = [
|
|
8
|
+
'parse_error',
|
|
9
|
+
'invalid_request',
|
|
10
|
+
'method_not_found',
|
|
11
|
+
'invalid_params',
|
|
12
|
+
'handshake_required',
|
|
13
|
+
'bridge_version_mismatch',
|
|
14
|
+
'not_signed_in',
|
|
15
|
+
'refused',
|
|
16
|
+
'relaycast_unreachable',
|
|
17
|
+
'relaycast_refused',
|
|
18
|
+
'unauthorized',
|
|
19
|
+
'plan_limit_exceeded',
|
|
20
|
+
'rate_limited',
|
|
21
|
+
'not_found',
|
|
22
|
+
'conflict',
|
|
23
|
+
'shutting_down',
|
|
24
|
+
'busy',
|
|
25
|
+
'store_failed',
|
|
26
|
+
'cloud_failed',
|
|
27
|
+
'cloud_refused',
|
|
28
|
+
'fleet_unavailable',
|
|
29
|
+
'internal',
|
|
30
|
+
];
|
|
31
|
+
/**
|
|
32
|
+
* Every typed reason the core gives with a `refused` error in
|
|
33
|
+
* `error.data.reason` (`protocol.rs` `RefusalReason`). None is retryable.
|
|
34
|
+
*/
|
|
35
|
+
export const REFUSAL_REASONS = [
|
|
36
|
+
'service_unknown',
|
|
37
|
+
'service_disabled',
|
|
38
|
+
'service_expired',
|
|
39
|
+
'workspace_mismatch',
|
|
40
|
+
'not_owner',
|
|
41
|
+
'outside_scope',
|
|
42
|
+
'management_peer',
|
|
43
|
+
];
|
|
44
|
+
/** The base of every error this package throws; `code` names the class of failure. */
|
|
45
|
+
export class CoreBridgeError extends Error {
|
|
46
|
+
code;
|
|
47
|
+
constructor(code, message, options) {
|
|
48
|
+
super(message, options);
|
|
49
|
+
this.name = new.target.name;
|
|
50
|
+
this.code = code;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/** Nothing answers at the socket: the file is missing, the connection failed, or connecting timed out. */
|
|
54
|
+
export class CoreNotRunningError extends CoreBridgeError {
|
|
55
|
+
socket;
|
|
56
|
+
constructor(socket, message, options) {
|
|
57
|
+
super('core_not_running', message, options);
|
|
58
|
+
this.socket = socket;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/** The socket or its directory could have been planted by someone else; the client refused to connect. */
|
|
62
|
+
export class CoreUntrustedError extends CoreBridgeError {
|
|
63
|
+
reason;
|
|
64
|
+
constructor(reason, message) {
|
|
65
|
+
super('core_untrusted', message);
|
|
66
|
+
this.reason = reason;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
/** What answered at the socket did not greet like the Agent Relay core. */
|
|
70
|
+
export class NotACoreError extends CoreBridgeError {
|
|
71
|
+
constructor(message) {
|
|
72
|
+
super('not_a_core', message);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/** The core speaks a different bridge version and refused this client. */
|
|
76
|
+
export class BridgeVersionMismatchError extends CoreBridgeError {
|
|
77
|
+
/** The bridge version this client sent. */
|
|
78
|
+
clientVersion;
|
|
79
|
+
/** The core's own message, safe to show a person. */
|
|
80
|
+
coreMessage;
|
|
81
|
+
constructor(clientVersion, coreMessage, message, options) {
|
|
82
|
+
super('bridge_version_mismatch', message, options);
|
|
83
|
+
this.clientVersion = clientVersion;
|
|
84
|
+
this.coreMessage = coreMessage;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/** The core answered a call with a JSON-RPC error. */
|
|
88
|
+
export class CoreRpcError extends CoreBridgeError {
|
|
89
|
+
/** The JSON-RPC numeric code. */
|
|
90
|
+
rpcCode;
|
|
91
|
+
/** The stable machine-readable kind from `error.data.kind`. */
|
|
92
|
+
kind;
|
|
93
|
+
/** Whether repeating the same request later can succeed. */
|
|
94
|
+
retryable;
|
|
95
|
+
/** With `plan_limit_exceeded`, the counters when the core had them. */
|
|
96
|
+
planLimit;
|
|
97
|
+
/** With `refused`, the typed reason from `error.data.reason` when the core gave one. */
|
|
98
|
+
reason;
|
|
99
|
+
constructor(message, details = {}) {
|
|
100
|
+
super('rpc_error', message);
|
|
101
|
+
this.rpcCode = details.rpcCode;
|
|
102
|
+
this.kind = details.kind;
|
|
103
|
+
this.retryable = details.retryable ?? false;
|
|
104
|
+
this.planLimit = details.planLimit;
|
|
105
|
+
this.reason = details.reason;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* @deprecated Use {@link CoreRpcError}; this alias is removed in the next release.
|
|
110
|
+
*/
|
|
111
|
+
export const CoreCallError = CoreRpcError;
|
|
112
|
+
/** The core did not answer a call in time. */
|
|
113
|
+
export class CoreTimeoutError extends CoreBridgeError {
|
|
114
|
+
method;
|
|
115
|
+
constructor(method) {
|
|
116
|
+
super('timeout', `The Agent Relay core did not answer ${method} in time.`);
|
|
117
|
+
this.method = method;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
/** The core sent a line longer than `MAX_REPLY_BYTES`; the connection was closed. */
|
|
121
|
+
export class CoreReplyTooLargeError extends CoreBridgeError {
|
|
122
|
+
constructor() {
|
|
123
|
+
super('reply_too_large', 'The Agent Relay core sent an oversized reply.');
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
/** A request line would exceed `MAX_REQUEST_BYTES`; it was not sent and the connection stays open. */
|
|
127
|
+
export class CoreRequestTooLargeError extends CoreBridgeError {
|
|
128
|
+
method;
|
|
129
|
+
bytes;
|
|
130
|
+
constructor(method, bytes, limit) {
|
|
131
|
+
super('request_too_large', `The ${method} request is ${bytes} bytes; the Agent Relay core reads at most ${limit}.`);
|
|
132
|
+
this.method = method;
|
|
133
|
+
this.bytes = bytes;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
/** The connection is closed: a call after close, or the connection ended while calls were pending. */
|
|
137
|
+
export class CoreClosedError extends CoreBridgeError {
|
|
138
|
+
constructor(message = 'The Agent Relay core closed the connection.', options) {
|
|
139
|
+
super('closed', message, options);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,aAAa;IACb,iBAAiB;IACjB,kBAAkB;IAClB,gBAAgB;IAChB,oBAAoB;IACpB,yBAAyB;IACzB,eAAe;IACf,SAAS;IACT,uBAAuB;IACvB,mBAAmB;IACnB,cAAc;IACd,qBAAqB;IACrB,cAAc;IACd,WAAW;IACX,UAAU;IACV,eAAe;IACf,MAAM;IACN,cAAc;IACd,cAAc;IACd,eAAe;IACf,mBAAmB;IACnB,UAAU;CACF,CAAC;AAaX;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,iBAAiB;IACjB,kBAAkB;IAClB,iBAAiB;IACjB,oBAAoB;IACpB,WAAW;IACX,eAAe;IACf,iBAAiB;CACT,CAAC;AAQX,sFAAsF;AACtF,MAAM,OAAO,eAAgB,SAAQ,KAAK;IAC/B,IAAI,CAAS;IACtB,YAAY,IAAY,EAAE,OAAe,EAAE,OAA6B;QACtE,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,C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OAAO,GAAG,6CAA6C,EAAE,OAA6B;QAChG,KAAK,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACpC,CAAC;CACF"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { BRIDGE_VERSION, CORE_SOCKET_ENV, MAX_REPLY_BYTES, MAX_REQUEST_BYTES, coreSocketPath, pipeName, } from './paths.js';
|
|
2
|
+
export { connectCore, tryConnectCore, type CallOptions, type ConnectOptions, type CoreClient, type CoreEvent, type HelloResult, type Topic, } from './client.js';
|
|
3
|
+
export { BridgeVersionMismatchError, CoreBridgeError, CoreCallError, CoreClosedError, CoreNotRunningError, CoreReplyTooLargeError, CoreRequestTooLargeError, CoreRpcError, CoreTimeoutError, CoreUntrustedError, NotACoreError, type ErrorKind, type PlanLimit, type RefusalReason, } from './errors.js';
|
|
4
|
+
export { CALLER_AUTH_SCHEME, CALLER_CHALLENGE_TTL_MS, CALLER_FILE_SCHEMAS, CALLER_TRANSCRIPT_DOMAIN, CALLER_TRANSCRIPT_VERSION, CallerCredential, MAX_CALLER_FILE_BYTES, authenticate, callerTranscript, readCallerCredential, type CallerAuthenticateParams, type CallerBound, type CallerChallenge, type CallerChallengeParams, type CallerTranscriptInput, } from './auth.js';
|
|
5
|
+
export { DEFAULT_SPAWN_ACTION_TIMEOUT_MS, isReleaseConfirmed, newIdempotencyKey, spawnInvoke, spawnRelease, spawnStatus, spawnTargets, type SpawnActionOptions, type SpawnControlAction, type SpawnControlInvocation, type SpawnControlTarget, type SpawnErrorCode, type SpawnInvokeParams, type SpawnReleaseParams, type SpawnStatus, type SpawnStatusParams, type SpawnTargets, } from './spawn.js';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,QAAQ,GACT,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,WAAW,EACX,cAAc,EACd,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,KAAK,GACX,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,0BAA0B,EAC1B,eAAe,EACf,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,sBAAsB,EACtB,wBAAwB,EACxB,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,EACb,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,aAAa,GACnB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,EACzB,gBAAgB,EAChB,qBAAqB,EACrB,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACpB,KAAK,wBAAwB,EAC7B,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,GAC3B,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,+BAA+B,EAC/B,kBAAkB,EAClB,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,YAAY,GAClB,MAAM,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { BRIDGE_VERSION, CORE_SOCKET_ENV, MAX_REPLY_BYTES, MAX_REQUEST_BYTES, coreSocketPath, pipeName, } from './paths.js';
|
|
2
|
+
export { connectCore, tryConnectCore, } from './client.js';
|
|
3
|
+
export { BridgeVersionMismatchError, CoreBridgeError, CoreCallError, CoreClosedError, CoreNotRunningError, CoreReplyTooLargeError, CoreRequestTooLargeError, CoreRpcError, CoreTimeoutError, CoreUntrustedError, NotACoreError, } from './errors.js';
|
|
4
|
+
export { CALLER_AUTH_SCHEME, CALLER_CHALLENGE_TTL_MS, CALLER_FILE_SCHEMAS, CALLER_TRANSCRIPT_DOMAIN, CALLER_TRANSCRIPT_VERSION, CallerCredential, MAX_CALLER_FILE_BYTES, authenticate, callerTranscript, readCallerCredential, } from './auth.js';
|
|
5
|
+
export { DEFAULT_SPAWN_ACTION_TIMEOUT_MS, isReleaseConfirmed, newIdempotencyKey, spawnInvoke, spawnRelease, spawnStatus, spawnTargets, } from './spawn.js';
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,QAAQ,GACT,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,WAAW,EACX,cAAc,GAOf,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,0BAA0B,EAC1B,eAAe,EACf,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,sBAAsB,EACtB,wBAAwB,EACxB,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,GAId,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,EACzB,gBAAgB,EAChB,qBAAqB,EACrB,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,GAMrB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,+BAA+B,EAC/B,kBAAkB,EAClB,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,WAAW,EACX,YAAY,GAWb,MAAM,YAAY,CAAC"}
|