agent-relay 12.2.4 → 12.2.6

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.
@@ -0,0 +1,404 @@
1
+ /**
2
+ * On-demand package tree for the mounted product SDKs.
3
+ *
4
+ * The npm distribution needs none of this: `@relayfile/sdk`, `@relayflows/sdk`
5
+ * and `ai-hist` are ordinary dependencies of `agent-relay`, so
6
+ * `import('@relayfile/sdk/relay-cli')` resolves and nothing here ever runs.
7
+ *
8
+ * The compiled standalone binary is the problem (#1795). It is one file with no
9
+ * node_modules, so every mounted group failed with MODULE_NOT_FOUND — reported
10
+ * as "not installed", in a distribution where installing cannot help. Bundling
11
+ * the SDKs does not fix it, and was tried:
12
+ *
13
+ * - `@relayfile/sdk/relay-cli` locates and spawns a Go binary; exec needs a
14
+ * real path on disk, not a bundled module
15
+ * - `ai-hist` dlopens a native addon through a *variable* specifier, which no
16
+ * bundler can see
17
+ * - all three read data files relative to `import.meta.url`, which relocates
18
+ * into Bun's `/$bunfs/root` once compiled
19
+ *
20
+ * So instead of pulling the packages into the binary, the binary puts them back
21
+ * on disk: a real `npm install` of the version pinned in
22
+ * `packages/cli/package.json`, under `~/.agentworkforce/relay/surfaces`, and the
23
+ * surface is imported from there. Real files satisfy dlopen, exec,
24
+ * `import.meta.url` and variable specifiers at once.
25
+ */
26
+ import { execFile, spawn } from 'node:child_process';
27
+ import { createHash, randomBytes } from 'node:crypto';
28
+ import fs from 'node:fs';
29
+ import os from 'node:os';
30
+ import path from 'node:path';
31
+ import { promisify } from 'node:util';
32
+ import { redactCredentialValues } from '@agent-relay/cloud/redact';
33
+ import { describeError } from './describe-error.js';
34
+ import { isBundledBunEntrypointPath } from './agent-relay-mcp-command.js';
35
+ import { isBunRuntime } from './node-definition-loader.js';
36
+ const execFileAsync = promisify(execFile);
37
+ /** How long a single provisioning install may take before it is abandoned. */
38
+ export const INSTALL_TIMEOUT_MS = 10 * 60 * 1000;
39
+ /** Largest npm output we will buffer while waiting for the install. */
40
+ const INSTALL_MAX_BUFFER = 16 * 1024 * 1024;
41
+ /**
42
+ * Name of the generated module that performs the import.
43
+ *
44
+ * It has to live *inside* the provisioned directory. A bare specifier resolves
45
+ * against the `node_modules` directories above the importing module, so an
46
+ * `import()` written in the CLI's own source could never see this tree no
47
+ * matter where it is; one written next to it sees nothing else.
48
+ */
49
+ const RUNNER_FILENAME = 'run-surface.mjs';
50
+ const RUNNER_SOURCE = `// Generated by agent-relay. Do not edit.
51
+ //
52
+ // Entry point for a child process that runs one mounted product surface out
53
+ // of the node_modules beside this file.
54
+ //
55
+ // Why a child process rather than importing into the CLI: inside the compiled
56
+ // standalone binary, Bun cannot resolve bare specifiers from a tree it loaded
57
+ // by absolute path. Resolving the surface entry point by hand gets as far as
58
+ // the entry point; its own imports then fail the same way, and there is no
59
+ // bottom to that. NODE_PATH does not change it. Running under the node that
60
+ // performed the install sidesteps module resolution entirely, and costs one
61
+ // process per invocation.
62
+ //
63
+ // Two modes, because the host renders help from the declared command tree and
64
+ // must not forward it — help has to say agent-relay, not the product's name:
65
+ //
66
+ // describe [--options-for=surface] specifier
67
+ // run [--options-for=surface] specifier [argv...]
68
+ import process from 'node:process';
69
+
70
+ const rawArgs = process.argv.slice(2);
71
+ let optionsFor = undefined;
72
+ let argIndex = 0;
73
+
74
+ // Parse --options-for flag
75
+ if (rawArgs[0]?.startsWith('--options-for=')) {
76
+ optionsFor = rawArgs[0].slice('--options-for='.length);
77
+ argIndex = 1;
78
+ }
79
+
80
+ const [mode, specifier, ...argv] = rawArgs.slice(argIndex);
81
+
82
+ const module = await import(specifier);
83
+ if (typeof module.createRelayCliSurface !== 'function') {
84
+ process.stderr.write(specifier + ' does not export createRelayCliSurface()\\n');
85
+ process.exit(1);
86
+ }
87
+
88
+ // Resolve options from environment if the parent provided them.
89
+ // The parent passes cloud client configuration through environment variables so the
90
+ // child can create the client without importing from the parent's module tree.
91
+ let options = undefined;
92
+ if (optionsFor === 'sessions') {
93
+ const baseUrl = process.env['RELAY_RELAYHISTORY_BASE_URL'];
94
+ const token = process.env['RELAY_RELAYHISTORY_TOKEN'];
95
+ if (baseUrl && token) {
96
+ try {
97
+ const cloudClientModule = await import('@relayhistory/cloud-client');
98
+ options = {
99
+ cloud: cloudClientModule.createRelayhistoryCloudClient({ baseUrl, token })
100
+ };
101
+ } catch {
102
+ // Cloud client is optional; local session commands still work without it
103
+ }
104
+ }
105
+ }
106
+
107
+ const surface = await module.createRelayCliSurface(options);
108
+
109
+ if (mode === 'describe') {
110
+ // Write JSON description and let streams flush before exiting.
111
+ // process.exit does not wait for pipe buffers, so output can be truncated.
112
+ const json = JSON.stringify({
113
+ id: surface.id,
114
+ version: surface.version,
115
+ contract: surface.contract,
116
+ commands: surface.commands,
117
+ });
118
+ process.stdout.write(json, () => process.exit(0));
119
+ } else {
120
+ // stdout and stderr are written straight through: the host pipes them into
121
+ // its own io sink, and chunks stay bytes so a binary payload survives.
122
+ const code = await surface.run(argv, {
123
+ stdout: (chunk) => process.stdout.write(chunk),
124
+ stderr: (chunk) => process.stderr.write(chunk),
125
+ });
126
+ // Exit only after all writes have been flushed.
127
+ process.stdout.write('', () => process.exit(typeof code === 'number' ? code : 0));
128
+ }
129
+ `;
130
+ /** Error code carried by every failure this module reports to the mount. */
131
+ export const PROVISION_ERROR_CODE = 'ERR_RELAY_SURFACE_PROVISION';
132
+ /**
133
+ * A provisioning failure with an operator-facing message.
134
+ *
135
+ * Tagged with a code so `describeLoadFailure` can print {@link Error.message}
136
+ * verbatim. The message already names the package, the directory and the fix;
137
+ * wrapping it in "Could not load … :" or letting a stack through would bury
138
+ * that.
139
+ */
140
+ export class SurfaceProvisionError extends Error {
141
+ code = PROVISION_ERROR_CODE;
142
+ constructor(message, options) {
143
+ super(message, options);
144
+ this.name = 'SurfaceProvisionError';
145
+ }
146
+ }
147
+ /** `~/.agentworkforce/relay/surfaces`, or the configured data directory. */
148
+ export function defaultSurfaceStoreRoot() {
149
+ const dataDir = process.env['AGENT_RELAY_DATA_DIR'] || path.join(os.homedir(), '.agentworkforce/relay');
150
+ return path.join(dataDir, 'surfaces');
151
+ }
152
+ /**
153
+ * Whether this process is the compiled standalone binary.
154
+ *
155
+ * Both halves matter. `isBunRuntime` alone is true for anyone running the CLI
156
+ * under `bun`, where node_modules exists and provisioning would be pure waste;
157
+ * the `/$bunfs/root` entrypoint is what distinguishes `bun build --compile`
158
+ * output, which has no node_modules at all.
159
+ */
160
+ export function isCompiledStandalone(argv = process.argv) {
161
+ return isBunRuntime() && isBundledBunEntrypointPath(argv[1] ?? '');
162
+ }
163
+ /**
164
+ * Where `pkg` is provisioned under `root`.
165
+ *
166
+ * Keyed by name *and* range, so upgrading the pin provisions a fresh tree
167
+ * rather than reusing a stale one. The readable prefix is for whoever opens the
168
+ * directory; the digest is what actually separates `^0.10.64` from `~0.10.64`,
169
+ * which sanitizing alone collapses onto the same name.
170
+ */
171
+ export function surfaceInstallPath(root, pkg) {
172
+ const digest = createHash('sha256').update(`${pkg.name}@${pkg.range}`).digest('hex').slice(0, 8);
173
+ // `-` is deliberately not in the kept set: leaving it in makes `sdk-^0.10.64`
174
+ // read as `sdk--0.10.64`, since the separator and the range operator are adjacent.
175
+ const readable = `${pkg.name}-${pkg.range}`.replace(/[^A-Za-z0-9.]+/g, '-').replace(/^-+|-+$/g, '');
176
+ return path.join(root, `${readable}-${digest}`);
177
+ }
178
+ /**
179
+ * Provisioning runs already in flight, keyed by their destination.
180
+ *
181
+ * Two groups invoked in one process, or one group whose loader is retried,
182
+ * must not start two npm installs of the same package. Cross-process races are
183
+ * handled separately, by the atomic rename in {@link provisionOnce}.
184
+ */
185
+ const inFlight = new Map();
186
+ function defaults(overrides) {
187
+ return {
188
+ root: overrides.root ?? defaultSurfaceStoreRoot(),
189
+ install: overrides.install ?? npmInstall,
190
+ notify: overrides.notify ?? ((line) => process.stderr.write(`${line}\n`)),
191
+ };
192
+ }
193
+ /**
194
+ * Ensure `pkg` is installed in the store and return the directory holding it.
195
+ *
196
+ * @param pkg - Package name and the range pinned by the CLI manifest.
197
+ * @param overrides - Test seams for the store root, installer, and notices.
198
+ * @returns Absolute path to a directory with `node_modules` and the loader.
199
+ * @throws {SurfaceProvisionError} When the install cannot be completed, with a
200
+ * message naming the fix rather than a stack.
201
+ */
202
+ export async function provisionSurfacePackage(pkg, overrides = {}) {
203
+ const deps = defaults(overrides);
204
+ const target = surfaceInstallPath(deps.root, pkg);
205
+ if (fs.existsSync(path.join(target, RUNNER_FILENAME)))
206
+ return target;
207
+ const existing = inFlight.get(target);
208
+ if (existing)
209
+ return existing;
210
+ const run = provisionOnce(pkg, target, deps).finally(() => {
211
+ inFlight.delete(target);
212
+ });
213
+ inFlight.set(target, run);
214
+ return run;
215
+ }
216
+ /**
217
+ * Install into a private staging directory, then publish it with one rename.
218
+ *
219
+ * The rename is what makes a concurrent second process safe: the destination
220
+ * either does not exist or is a finished tree, never a half-written one, so a
221
+ * reader can never import from an install that is still running. The loser of
222
+ * the race discards its own work and adopts the winner's — both trees hold the
223
+ * same pinned version, so there is nothing to reconcile.
224
+ */
225
+ async function provisionOnce(pkg, target, deps) {
226
+ const spec = `${pkg.name}@${pkg.range}`;
227
+ fs.mkdirSync(deps.root, { recursive: true });
228
+ // Unique per attempt, so two processes never write into the same staging
229
+ // tree and npm never sees another install's partial node_modules.
230
+ const staging = `${target}.staging-${process.pid}-${randomBytes(4).toString('hex')}`;
231
+ fs.mkdirSync(staging, { recursive: true });
232
+ try {
233
+ // npm walks up from its cwd looking for a manifest; without this it would
234
+ // find the user's project (or this repo) and install into that instead.
235
+ fs.writeFileSync(path.join(staging, 'package.json'), `${JSON.stringify({
236
+ name: 'agent-relay-surface',
237
+ version: '0.0.0',
238
+ private: true,
239
+ dependencies: { [pkg.name]: pkg.range },
240
+ }, null, 2)}\n`);
241
+ fs.writeFileSync(path.join(staging, RUNNER_FILENAME), RUNNER_SOURCE);
242
+ // A silent multi-second npm install is indistinguishable from a hang, and
243
+ // this one is minutes on a cold cache.
244
+ deps.notify(`agent-relay: ${spec} is not bundled into the standalone binary; installing it now.\n` +
245
+ ` -> ${target}\n` +
246
+ ` This runs once per version. Later runs reuse it.`);
247
+ const started = Date.now();
248
+ try {
249
+ await deps.install(pkg, staging);
250
+ }
251
+ catch (error) {
252
+ throw new SurfaceProvisionError(`${spec} could not be installed into ${deps.root}.\n` +
253
+ `${describeError(error)}\n` +
254
+ `The standalone agent-relay binary installs the product SDKs on first use, ` +
255
+ `so this needs \`npm\` on PATH and network access to the npm registry.\n` +
256
+ `Retry when online, or install agent-relay from npm (\`npm i -g agent-relay\`), ` +
257
+ `which ships ${pkg.name} directly.`, { cause: error });
258
+ }
259
+ try {
260
+ fs.renameSync(staging, target);
261
+ }
262
+ catch (error) {
263
+ // Another process published the same version between our existence check
264
+ // and this rename. Its tree is the same install, so use it.
265
+ if (!fs.existsSync(path.join(target, RUNNER_FILENAME)))
266
+ throw error;
267
+ }
268
+ deps.notify(`agent-relay: ${spec} ready (${Math.round((Date.now() - started) / 1000)}s).`);
269
+ return target;
270
+ }
271
+ finally {
272
+ // A no-op after a successful rename; on any failure it is what keeps a
273
+ // dead staging tree from accumulating in the store.
274
+ fs.rmSync(staging, { recursive: true, force: true });
275
+ }
276
+ }
277
+ /**
278
+ * Run the surface runner in a child process and collect its result.
279
+ *
280
+ * `node` is the interpreter because `node` is what performed the install: a
281
+ * provisioned tree exists only if npm ran, and npm implies node. The compiled
282
+ * binary cannot run these itself — see RUNNER_SOURCE.
283
+ */
284
+ function runnerProcess(installRoot, args, io, optionsFor, relayhistoryConfig) {
285
+ const runner = path.join(installRoot, RUNNER_FILENAME);
286
+ const runnerArgs = optionsFor ? [`--options-for=${optionsFor}`, ...args] : args;
287
+ // Pass cloud client config through environment if configured.
288
+ const env = { ...process.env };
289
+ if (relayhistoryConfig) {
290
+ env['RELAY_RELAYHISTORY_BASE_URL'] = relayhistoryConfig.baseUrl;
291
+ env['RELAY_RELAYHISTORY_TOKEN'] = relayhistoryConfig.token;
292
+ }
293
+ return new Promise((resolve, reject) => {
294
+ const child = spawn(process.execPath.endsWith('node') ? process.execPath : 'node', [runner, ...runnerArgs], {
295
+ // Do not change cwd: product commands may read relative paths (e.g., mount roots,
296
+ // output files), and those should be relative to where the user invoked the CLI.
297
+ cwd: process.cwd(),
298
+ // stdin inherited so an interactive product prompt still works.
299
+ stdio: ['inherit', 'pipe', 'pipe'],
300
+ env,
301
+ });
302
+ let stdout = '';
303
+ let stderr = '';
304
+ child.stdout?.on('data', (chunk) => {
305
+ if (io)
306
+ io.stdout(chunk);
307
+ else
308
+ stdout += chunk.toString('utf8');
309
+ });
310
+ child.stderr?.on('data', (chunk) => {
311
+ const text = typeof chunk === 'string' ? chunk : chunk.toString('utf8');
312
+ stderr += text;
313
+ if (io) {
314
+ // Redact credentials in stderr before passing to io, since the child's
315
+ // stderr may contain argv that the npm path masks.
316
+ io.stderr(redactCredentialValues(text));
317
+ }
318
+ });
319
+ child.on('error', reject);
320
+ child.on('close', (code) => {
321
+ // Let all pending writes flush before resolving.
322
+ setImmediate(() => resolve({ code: code ?? 1, stdout, stderr }));
323
+ });
324
+ });
325
+ }
326
+ /**
327
+ * The surface's declared command tree, read out of a provisioned tree.
328
+ *
329
+ * Only the declaration crosses the process boundary — `run` cannot, so the
330
+ * returned surface's `run` delegates to another child process.
331
+ *
332
+ * @param installRoot - Directory holding the provisioned package.
333
+ * @param specifier - Package subpath exporting `createRelayCliSurface`.
334
+ * @param optionsFor - Optional product name for which to create options (e.g., 'sessions').
335
+ * @param relayhistoryConfig - Optional Relayhistory cloud client config for sessions.
336
+ */
337
+ export async function loadSurfaceFromStore(installRoot, specifier, optionsFor, relayhistoryConfig) {
338
+ const described = await runnerProcess(installRoot, ['describe', specifier], undefined, optionsFor, relayhistoryConfig);
339
+ if (described.code !== 0) {
340
+ // If describe failed, show the child's stderr so the operator sees the real error
341
+ // (missing Go binary, native addon not compiled, factory threw, etc.) instead of
342
+ // just being told to reinstall. Only suggest reinstall if stderr is empty.
343
+ const detail = described.stderr.trim();
344
+ throw new SurfaceProvisionError(detail
345
+ ? `The provisioned package tree at ${installRoot} could not describe ${specifier}:\n${detail}`
346
+ : `The provisioned package tree at ${installRoot} could not describe ${specifier}.\n` +
347
+ 'Delete that directory and retry; it will be reinstalled.');
348
+ }
349
+ const declaration = JSON.parse(described.stdout);
350
+ return {
351
+ ...declaration,
352
+ run: async (argv, io) => {
353
+ const result = await runnerProcess(installRoot, ['run', specifier, ...argv], io, optionsFor, relayhistoryConfig);
354
+ return result.code;
355
+ },
356
+ };
357
+ }
358
+ /**
359
+ * Turn a failed `npm install` into one actionable line.
360
+ *
361
+ * npm's own output is dozens of lines ending in a path to a debug log the user
362
+ * of a standalone binary has no reason to read. What decides their next move is
363
+ * the first error npm reported — `ENOTFOUND`, `E403`, `ETARGET` — so that is
364
+ * what gets lifted out.
365
+ */
366
+ export function describeInstallFailure(command, error) {
367
+ const code = error?.code;
368
+ if (code === 'ENOENT') {
369
+ return `\`${command}\` is not on PATH.`;
370
+ }
371
+ if (error?.killed === true) {
372
+ return `\`${command} install\` timed out after ${Math.round(INSTALL_TIMEOUT_MS / 60_000)} minutes.`;
373
+ }
374
+ const lines = String(error?.stderr ?? '')
375
+ .split('\n')
376
+ .map((line) => line.trim())
377
+ .filter((line) => line !== '')
378
+ .slice(0, 3);
379
+ return lines.length > 0 ? redactCredentialValues(lines.join('\n')) : describeError(error);
380
+ }
381
+ /** The real installer: one `npm install` scoped to the staging directory. */
382
+ async function npmInstall(pkg, directory) {
383
+ const command = process.platform === 'win32' ? 'npm.cmd' : 'npm';
384
+ try {
385
+ await execFileAsync(command, [
386
+ 'install',
387
+ `${pkg.name}@${pkg.range}`,
388
+ ...(pkg.companions ?? []).map((companion) => `${companion.name}@${companion.range}`),
389
+ '--no-audit',
390
+ '--no-fund',
391
+ '--loglevel=error',
392
+ ], {
393
+ cwd: directory,
394
+ timeout: INSTALL_TIMEOUT_MS,
395
+ maxBuffer: INSTALL_MAX_BUFFER,
396
+ // The update notifier writes to stderr and can outlive the install.
397
+ env: { ...process.env, npm_config_update_notifier: 'false' },
398
+ });
399
+ }
400
+ catch (error) {
401
+ throw new Error(describeInstallFailure(command, error), { cause: error });
402
+ }
403
+ }
404
+ //# sourceMappingURL=product-surface-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"product-surface-store.js","sourceRoot":"","sources":["../../../src/cli/lib/product-surface-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAItC,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAE1C,8EAA8E;AAC9E,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEjD,uEAAuE;AACvE,MAAM,kBAAkB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAE5C;;;;;;;GAOG;AAEH,MAAM,eAAe,GAAG,iBAAiB,CAAC;AAE1C,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+ErB,CAAC;AA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OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC;IACjE,IAAI,CAAC;QACH,MAAM,aAAa,CACjB,OAAO,EACP;YACE,SAAS;YACT,GAAG,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,KAAK,EAAE;YAC1B,GAAG,CAAC,GAAG,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,GAAG,SAAS,CAAC,IAAI,IAAI,SAAS,CAAC,KAAK,EAAE,CAAC;YACpF,YAAY;YACZ,WAAW;YACX,kBAAkB;SACnB,EACD;YACE,GAAG,EAAE,SAAS;YACd,OAAO,EAAE,kBAAkB;YAC3B,SAAS,EAAE,kBAAkB;YAC7B,oEAAoE;YACpE,GAAG,EAAE,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,0BAA0B,EAAE,OAAO,EAAE;SAC7D,CACF,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IAC5E,CAAC;AACH,CAAC"}
package/dist/index.cjs CHANGED
@@ -303,7 +303,7 @@ __export(index_exports, {
303
303
  module.exports = __toCommonJS(index_exports);
304
304
 
305
305
  // ../../node_modules/@relaycast/sdk/dist/version.js
306
- var SDK_VERSION = "8.11.1";
306
+ var SDK_VERSION = "8.11.3";
307
307
 
308
308
  // ../../node_modules/zod/v4/classic/external.js
309
309
  var external_exports = {};
@@ -21338,6 +21338,9 @@ var FleetNodeRegisterMessageSchema = external_exports.object({
21338
21338
  capabilities: external_exports.array(FleetCapabilitySchema),
21339
21339
  // Provider-level capacity; the node figure is the aggregate across providers.
21340
21340
  max_agents: external_exports.number().int().nonnegative(),
21341
+ // `cloud:*` is reserved for control-plane lifecycle tags set at enrollment.
21342
+ // The engine ignores (and logs) any `cloud:*` entry here and keeps the
21343
+ // node's enrolled `cloud:*` tags instead.
21341
21344
  tags: external_exports.array(FleetNodeTagSchema),
21342
21345
  // Placement-safe repository identities. The engine persists these as
21343
21346
  // `repo:<owner/name>` tags so existing node roster readers can consume them.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-relay",
3
- "version": "12.2.4",
3
+ "version": "12.2.6",
4
4
  "description": "Real-time agent-to-agent communication system",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -43,22 +43,22 @@
43
43
  "pack:validate": "npm pack --dry-run"
44
44
  },
45
45
  "dependencies": {
46
- "@agent-relay/cli-surface": "12.2.4",
47
- "@agent-relay/cloud": "12.2.4",
48
- "@agent-relay/config": "12.2.4",
49
- "@agent-relay/fleet": "12.2.4",
50
- "@agent-relay/harness-driver": "12.2.4",
51
- "@agent-relay/harnesses": "12.2.4",
52
- "@agent-relay/sdk": "12.2.4",
53
- "@agent-relay/session": "12.2.4",
54
- "@agent-relay/utils": "12.2.4",
46
+ "@agent-relay/cli-surface": "12.2.6",
47
+ "@agent-relay/cloud": "12.2.6",
48
+ "@agent-relay/config": "12.2.6",
49
+ "@agent-relay/fleet": "12.2.6",
50
+ "@agent-relay/harness-driver": "12.2.6",
51
+ "@agent-relay/harnesses": "12.2.6",
52
+ "@agent-relay/sdk": "12.2.6",
53
+ "@agent-relay/session": "12.2.6",
54
+ "@agent-relay/utils": "12.2.6",
55
55
  "@modelcontextprotocol/sdk": "^1.23.0",
56
56
  "@relayfile/client": "^0.10.27",
57
- "@relayfile/sdk": "^0.10.63",
57
+ "@relayfile/sdk": "^0.10.64",
58
58
  "@relayflows/cli": "1.0.1",
59
- "@relayflows/sdk": "^2.0.16",
59
+ "@relayflows/sdk": "^2.0.19",
60
60
  "@xterm/headless": "^6.0.0",
61
- "ai-hist": "^0.18.0",
61
+ "ai-hist": "^0.18.1",
62
62
  "commander": "^12.1.0",
63
63
  "dotenv": "^17.2.3",
64
64
  "jiti": "^2.6.1",