agent-relay 12.4.1 → 13.0.1
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/cli/commands/core.d.ts +2 -0
- package/dist/cli/commands/core.d.ts.map +1 -1
- package/dist/cli/commands/core.js.map +1 -1
- package/dist/cli/commands/fleet.d.ts.map +1 -1
- package/dist/cli/commands/fleet.js +41 -24
- package/dist/cli/commands/fleet.js.map +1 -1
- package/dist/cli/commands/integration.d.ts.map +1 -1
- package/dist/cli/commands/integration.js +19 -4
- package/dist/cli/commands/integration.js.map +1 -1
- package/dist/cli/commands/product-surfaces.d.ts.map +1 -1
- package/dist/cli/commands/product-surfaces.js +6 -1
- package/dist/cli/commands/product-surfaces.js.map +1 -1
- package/dist/cli/lib/attach-fleet-node.d.ts.map +1 -1
- package/dist/cli/lib/attach-fleet-node.js +27 -0
- package/dist/cli/lib/attach-fleet-node.js.map +1 -1
- package/dist/cli/lib/broker-lifecycle.d.ts.map +1 -1
- package/dist/cli/lib/broker-lifecycle.js +1 -0
- package/dist/cli/lib/broker-lifecycle.js.map +1 -1
- package/dist/cli/lib/spawn-lifecycle.d.ts.map +1 -1
- package/dist/cli/lib/spawn-lifecycle.js +6 -3
- package/dist/cli/lib/spawn-lifecycle.js.map +1 -1
- package/dist/index.cjs +121 -37
- package/package.json +11 -11
|
@@ -24,9 +24,12 @@ export function spawnLifecycleState(value) {
|
|
|
24
24
|
const output = value.output !== null && typeof value.output === 'object'
|
|
25
25
|
? value.output
|
|
26
26
|
: value;
|
|
27
|
-
//
|
|
28
|
-
//
|
|
29
|
-
//
|
|
27
|
+
// Every caller of this receipt (MCP spawn, `fleet spawn --auto-place`)
|
|
28
|
+
// requires proven readiness. A terminal success without explicit launch and
|
|
29
|
+
// readiness proof is a failed spawn, not a live-but-uncertain one. Genuine
|
|
30
|
+
// uncertainty is reserved for non-terminal acknowledgements and confirmation
|
|
31
|
+
// timeouts. The unverified targeted path does not reach here: it keeps the
|
|
32
|
+
// SDK's own placement evidence (see `spawnInvocationWithMergedPlacement`).
|
|
30
33
|
return output.spawned === true && output.ready === true ? 'ready' : 'failed';
|
|
31
34
|
}
|
|
32
35
|
if (status && FAILURE.has(status))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spawn-lifecycle.js","sourceRoot":"","sources":["../../../src/cli/lib/spawn-lifecycle.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC;AAC/D,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AAChF,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,YAAY,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;AACjE,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;AAEtD,SAAS,IAAI,CAAC,KAAc;IAC1B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AACvE,CAAC;AAED,SAAS,gBAAgB,CAAC,KAA8B;IACtD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;IACjD,IACE,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC;QAC5B,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC;QAC9B,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC;QACzB,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC;QAC3B,CAAC,MAAM,KAAK,SAAS,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,OAAO,CAAC,GAAG,C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CAAC,EAAE,CAAC;YAC3E,GAAG,CAAC,OAAO,MAAM,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACtE,CAAC;IACJ,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,KAA8B;IAClE,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;IAC3E,MAAM,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;IACxF,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;IAC/E,OAAO;QACL,KAAK,EAAE,mBAAmB,CAAC,KAAK,CAAC;QACjC,aAAa,EAAE,gBAAgB,CAAC,KAAK,CAAC;QACtC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACzC,GAAG,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACjD,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC5C,CAAC;AACJ,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.
|
|
306
|
+
var SDK_VERSION = "8.16.0";
|
|
307
307
|
|
|
308
308
|
// ../../node_modules/zod/v4/classic/external.js
|
|
309
309
|
var external_exports = {};
|
|
@@ -20052,6 +20052,11 @@ var AgentStatusSchema = external_exports.enum(["online", "offline", "away"]);
|
|
|
20052
20052
|
var AgentSchema = external_exports.object({
|
|
20053
20053
|
id: external_exports.string(),
|
|
20054
20054
|
name: external_exports.string(),
|
|
20055
|
+
/**
|
|
20056
|
+
* `agent@machine` for `address` on POST /v1/dm; `machine` is `direct` for a
|
|
20057
|
+
* self-connected agent. Null when the agent is not hosted anywhere.
|
|
20058
|
+
*/
|
|
20059
|
+
address: external_exports.string().nullable().optional(),
|
|
20055
20060
|
type: AgentTypeSchema,
|
|
20056
20061
|
status: AgentStatusSchema,
|
|
20057
20062
|
persona: external_exports.string().nullable(),
|
|
@@ -20186,6 +20191,8 @@ var CoreMessagePayloadSchema = external_exports.object({
|
|
|
20186
20191
|
agent_id: external_exports.string(),
|
|
20187
20192
|
agent_name: external_exports.string(),
|
|
20188
20193
|
agent_type: AgentTypeSchema.optional(),
|
|
20194
|
+
/** Sender's `agent@machine` address at send time; present on direct messages. */
|
|
20195
|
+
agent_address: external_exports.string().optional(),
|
|
20189
20196
|
text: external_exports.string(),
|
|
20190
20197
|
injection_mode: MessageInjectionModeSchema.optional(),
|
|
20191
20198
|
attachments: external_exports.array(FileAttachmentSchema).optional(),
|
|
@@ -20346,8 +20353,53 @@ var WorkspaceSchema = external_exports.object({
|
|
|
20346
20353
|
classification_reason: external_exports.string().nullable().default(null),
|
|
20347
20354
|
classified_at: external_exports.string().nullable().default(null)
|
|
20348
20355
|
});
|
|
20356
|
+
var WORKSPACE_METADATA_MAX_BYTES = 16 * 1024;
|
|
20357
|
+
var WORKSPACE_METADATA_MAX_KEYS = 100;
|
|
20358
|
+
var WORKSPACE_METADATA_MAX_DEPTH = 8;
|
|
20359
|
+
var WORKSPACE_METADATA_MAX_KEY_LENGTH = 128;
|
|
20360
|
+
function metadataProblem(value, depth = 0) {
|
|
20361
|
+
if (value === null || typeof value === "string" || typeof value === "boolean")
|
|
20362
|
+
return;
|
|
20363
|
+
if (typeof value === "number" && Number.isFinite(value))
|
|
20364
|
+
return;
|
|
20365
|
+
if (depth > WORKSPACE_METADATA_MAX_DEPTH)
|
|
20366
|
+
return "metadata must contain at most 8 nested object/array levels below its root";
|
|
20367
|
+
if (Array.isArray(value)) {
|
|
20368
|
+
for (const item of value) {
|
|
20369
|
+
const problem = metadataProblem(item, depth + 1);
|
|
20370
|
+
if (problem)
|
|
20371
|
+
return problem;
|
|
20372
|
+
}
|
|
20373
|
+
return;
|
|
20374
|
+
}
|
|
20375
|
+
if (typeof value !== "object" || !value || Object.getPrototypeOf(value) !== Object.prototype) {
|
|
20376
|
+
return "metadata values must be JSON values";
|
|
20377
|
+
}
|
|
20378
|
+
for (const [key, item] of Object.entries(value)) {
|
|
20379
|
+
if ([...key].length > WORKSPACE_METADATA_MAX_KEY_LENGTH)
|
|
20380
|
+
return "metadata keys must be at most 128 Unicode code points";
|
|
20381
|
+
const normalized = key.replace(/([a-z0-9])([A-Z])/g, "$1_$2").toLowerCase();
|
|
20382
|
+
if (["__proto__", "prototype", "constructor"].includes(key) || /(?:^|[^a-z0-9])(?:tokens?|secrets?|passwords?|passwd|authorization|credentials?)(?:$|[^a-z0-9])/.test(normalized) || /(?:api|private|access|refresh)[^a-z0-9]*keys?/.test(normalized) || normalized.split(/[^a-z0-9]+/).some((part) => /^(?:(?:access|refresh|api|auth|bearer|session|client|id)tokens?|(?:client|app|shared|signing|webhook|consumer)secrets?|secretkeys?|password(?:hash|digest|salt))$/.test(part))) {
|
|
20383
|
+
return "metadata must not contain secret-like keys";
|
|
20384
|
+
}
|
|
20385
|
+
const problem = metadataProblem(item, depth + 1);
|
|
20386
|
+
if (problem)
|
|
20387
|
+
return problem;
|
|
20388
|
+
}
|
|
20389
|
+
}
|
|
20390
|
+
var WorkspaceMetadataSchema = external_exports.unknown().superRefine((metadata, ctx) => {
|
|
20391
|
+
const problem = metadata && typeof metadata === "object" && Object.keys(metadata).length > WORKSPACE_METADATA_MAX_KEYS ? "metadata must contain at most 100 top-level keys" : metadataProblem(metadata);
|
|
20392
|
+
if (problem) {
|
|
20393
|
+
ctx.addIssue({ code: "custom", message: problem });
|
|
20394
|
+
return;
|
|
20395
|
+
}
|
|
20396
|
+
if (new TextEncoder().encode(JSON.stringify(metadata)).byteLength > WORKSPACE_METADATA_MAX_BYTES) {
|
|
20397
|
+
ctx.addIssue({ code: "custom", message: "metadata must be at most 16384 UTF-8 bytes" });
|
|
20398
|
+
}
|
|
20399
|
+
}).pipe(external_exports.record(external_exports.string(), external_exports.unknown()));
|
|
20349
20400
|
var CreateWorkspaceRequestSchema = external_exports.object({
|
|
20350
20401
|
name: external_exports.string(),
|
|
20402
|
+
metadata: WorkspaceMetadataSchema.optional(),
|
|
20351
20403
|
expires_in_seconds: external_exports.number().int().min(60).max(30 * 24 * 60 * 60).optional(),
|
|
20352
20404
|
provenance: WorkspaceProvenanceInputSchema.optional()
|
|
20353
20405
|
});
|
|
@@ -20363,6 +20415,7 @@ var WorkspaceLookupSchema = external_exports.object({
|
|
|
20363
20415
|
created_at: external_exports.string()
|
|
20364
20416
|
});
|
|
20365
20417
|
var UpdateWorkspaceRequestSchema = external_exports.object({
|
|
20418
|
+
metadata: WorkspaceMetadataSchema.optional(),
|
|
20366
20419
|
name: external_exports.string().optional(),
|
|
20367
20420
|
system_prompt: external_exports.string().nullable().optional()
|
|
20368
20421
|
});
|
|
@@ -20531,6 +20584,8 @@ var DeliveryMessageSchema = external_exports.object({
|
|
|
20531
20584
|
channel_id: external_exports.string(),
|
|
20532
20585
|
agent_id: external_exports.string().nullable(),
|
|
20533
20586
|
agent_name: external_exports.string().nullable(),
|
|
20587
|
+
/** Sender's `agent@machine` at send time; present on direct messages. */
|
|
20588
|
+
agent_address: external_exports.string().optional(),
|
|
20534
20589
|
text: external_exports.string(),
|
|
20535
20590
|
thread_id: external_exports.string().nullable(),
|
|
20536
20591
|
created_at: external_exports.string()
|
|
@@ -20600,7 +20655,8 @@ var DmParticipantSchema = external_exports.object({
|
|
|
20600
20655
|
});
|
|
20601
20656
|
var DmInjectionModeSchema = MessageInjectionModeSchema;
|
|
20602
20657
|
var SendDmRequestSchema = external_exports.object({
|
|
20603
|
-
to: external_exports.string(),
|
|
20658
|
+
to: external_exports.string().optional(),
|
|
20659
|
+
address: external_exports.string().optional(),
|
|
20604
20660
|
text: external_exports.string(),
|
|
20605
20661
|
attachments: external_exports.array(external_exports.string()).optional(),
|
|
20606
20662
|
data: external_exports.record(external_exports.string(), external_exports.unknown()).nullable().optional(),
|
|
@@ -20686,6 +20742,7 @@ var ChannelMessagePayloadSchema = CoreMessagePayloadSchema.extend({
|
|
|
20686
20742
|
var MessageCreatedEventSchema = external_exports.object({
|
|
20687
20743
|
id: external_exports.string().uuid(),
|
|
20688
20744
|
type: external_exports.literal("message.created"),
|
|
20745
|
+
created_at: external_exports.string().optional(),
|
|
20689
20746
|
channel: external_exports.string(),
|
|
20690
20747
|
message: ChannelMessagePayloadSchema
|
|
20691
20748
|
});
|
|
@@ -21247,6 +21304,15 @@ var telemetryPropertiesSchema = external_exports.record(telemetryKeySchema, tele
|
|
|
21247
21304
|
});
|
|
21248
21305
|
}
|
|
21249
21306
|
});
|
|
21307
|
+
var TELEMETRY_CLOUD_ID_MAX_LENGTH = 128;
|
|
21308
|
+
var telemetryGroupsSchema = external_exports.object({
|
|
21309
|
+
organization: telemetryString(TELEMETRY_CLOUD_ID_MAX_LENGTH).optional(),
|
|
21310
|
+
workspace: telemetryString(TELEMETRY_CLOUD_ID_MAX_LENGTH).optional()
|
|
21311
|
+
}).strict();
|
|
21312
|
+
var telemetryPersonSetOnceSchema = external_exports.object({
|
|
21313
|
+
first_human_message_at: telemetryString(64).optional(),
|
|
21314
|
+
first_agent_message_at: telemetryString(64).optional()
|
|
21315
|
+
}).strict();
|
|
21250
21316
|
var telemetryEnvelopeBaseSchema = external_exports.object({
|
|
21251
21317
|
distinct_id: telemetryString(128),
|
|
21252
21318
|
properties: telemetryPropertiesSchema.default({})
|
|
@@ -21255,7 +21321,11 @@ var telemetryIngestionEventSchema = telemetryEnvelopeBaseSchema.extend({
|
|
|
21255
21321
|
event: clientTelemetryEventSchema
|
|
21256
21322
|
});
|
|
21257
21323
|
var internalTelemetryEventSchema = telemetryEnvelopeBaseSchema.extend({
|
|
21258
|
-
event: telemetryEventSchema
|
|
21324
|
+
event: telemetryEventSchema,
|
|
21325
|
+
groups: telemetryGroupsSchema.optional(),
|
|
21326
|
+
set_once: telemetryPersonSetOnceSchema.optional(),
|
|
21327
|
+
/** `false` for events whose distinct id is not a person (the workspace fallback). */
|
|
21328
|
+
process_person_profile: external_exports.boolean().optional()
|
|
21259
21329
|
}).merge(telemetryOriginSchema);
|
|
21260
21330
|
|
|
21261
21331
|
// ../../node_modules/@relaycast/types/dist/fleet-wire.js
|
|
@@ -21540,6 +21610,8 @@ var FleetActionInvokeMessageSchema = external_exports.object({
|
|
|
21540
21610
|
action: external_exports.string(),
|
|
21541
21611
|
agent_id: external_exports.string().optional(),
|
|
21542
21612
|
agent_name: external_exports.string().optional(),
|
|
21613
|
+
caller_id: external_exports.string().optional(),
|
|
21614
|
+
caller_name: external_exports.string().optional(),
|
|
21543
21615
|
input: FleetWireJsonValueSchema,
|
|
21544
21616
|
task_execution: FleetTaskExecutionSchema.optional()
|
|
21545
21617
|
}).strict();
|
|
@@ -22173,12 +22245,14 @@ var WsClient = class {
|
|
|
22173
22245
|
console.warn('[relaycast] Dropped node event: missing or invalid "type" field', transformed);
|
|
22174
22246
|
}
|
|
22175
22247
|
}
|
|
22248
|
+
/** Normalize a direct-node delivery into the public workspace event shape. */
|
|
22176
22249
|
transformServerLikeEvent(eventType, data) {
|
|
22177
22250
|
switch (eventType) {
|
|
22178
22251
|
case "message.created":
|
|
22179
22252
|
return {
|
|
22180
22253
|
id: stableRelaycastEventId(String(data.id ?? "")),
|
|
22181
22254
|
type: "message.created",
|
|
22255
|
+
...typeof data.created_at === "string" ? { created_at: data.created_at } : {},
|
|
22182
22256
|
channel: data.channel_name,
|
|
22183
22257
|
message: {
|
|
22184
22258
|
id: data.id,
|
|
@@ -22186,7 +22260,8 @@ var WsClient = class {
|
|
|
22186
22260
|
agent_name: data.from_name,
|
|
22187
22261
|
text: data.text,
|
|
22188
22262
|
attachments: Array.isArray(data.attachments) ? data.attachments : [],
|
|
22189
|
-
...typeof data.injection_mode === "string" ? { injection_mode: data.injection_mode } : {}
|
|
22263
|
+
...typeof data.injection_mode === "string" ? { injection_mode: data.injection_mode } : {},
|
|
22264
|
+
...isRecord(data.metadata) ? { metadata: data.metadata } : {}
|
|
22190
22265
|
}
|
|
22191
22266
|
};
|
|
22192
22267
|
case "thread.reply":
|
|
@@ -22742,6 +22817,17 @@ var AgentClient = class {
|
|
|
22742
22817
|
};
|
|
22743
22818
|
return this.client.post("/v1/dm", body, idempotencyHeaders(opts));
|
|
22744
22819
|
}
|
|
22820
|
+
/** DM an `agent@machine` address; fails if the agent is no longer on that machine. */
|
|
22821
|
+
async sendTo(address, text, opts) {
|
|
22822
|
+
const body = {
|
|
22823
|
+
address,
|
|
22824
|
+
text,
|
|
22825
|
+
...opts?.attachments ? { attachments: opts.attachments } : {},
|
|
22826
|
+
...opts?.data !== void 0 ? { data: opts.data } : {},
|
|
22827
|
+
mode: opts?.mode ?? "wait"
|
|
22828
|
+
};
|
|
22829
|
+
return this.client.post("/v1/dm", body, idempotencyHeaders(opts));
|
|
22830
|
+
}
|
|
22745
22831
|
dms = {
|
|
22746
22832
|
conversations: (opts) => {
|
|
22747
22833
|
const query = {};
|
|
@@ -23433,6 +23519,7 @@ var RelayCast = class _RelayCast {
|
|
|
23433
23519
|
body: JSON.stringify({
|
|
23434
23520
|
name,
|
|
23435
23521
|
...resolved.expiresInSeconds !== void 0 ? { expires_in_seconds: resolved.expiresInSeconds } : {},
|
|
23522
|
+
...resolved.metadata !== void 0 ? { metadata: resolved.metadata } : {},
|
|
23436
23523
|
provenance: toWorkspaceProvenanceInput(resolved.provenance)
|
|
23437
23524
|
})
|
|
23438
23525
|
});
|
|
@@ -25857,14 +25944,6 @@ function toRelayTrigger(raw) {
|
|
|
25857
25944
|
enabled: readBoolean(trigger, "enabled") ?? true
|
|
25858
25945
|
};
|
|
25859
25946
|
}
|
|
25860
|
-
function toRelayWorkspaceFleetNodesConfig(raw) {
|
|
25861
|
-
const record2 = asRecord(raw);
|
|
25862
|
-
return {
|
|
25863
|
-
enabled: readBoolean(record2, "enabled") ?? false,
|
|
25864
|
-
defaultEnabled: readBoolean(record2, "defaultEnabled", "default_enabled") ?? false,
|
|
25865
|
-
override: readBoolean(record2, "override") ?? null
|
|
25866
|
-
};
|
|
25867
|
-
}
|
|
25868
25947
|
function normalizeActionInvocationAck(raw) {
|
|
25869
25948
|
const record2 = asRecord(raw);
|
|
25870
25949
|
return {
|
|
@@ -26013,6 +26092,8 @@ function placementActionName(capability) {
|
|
|
26013
26092
|
function placementActionInput(input2, placement) {
|
|
26014
26093
|
const payload = { ...input2 ?? {} };
|
|
26015
26094
|
payload.capability = placement.capability;
|
|
26095
|
+
if (placement.verifyReady)
|
|
26096
|
+
payload.verify_ready = true;
|
|
26016
26097
|
if (placement.node) {
|
|
26017
26098
|
payload.node = placement.node;
|
|
26018
26099
|
payload.target_node = placement.node;
|
|
@@ -26044,9 +26125,21 @@ var DEFAULT_CONFIRM_POLL_MS = 500;
|
|
|
26044
26125
|
var MAX_CONFIRM_TIMEOUT_MS = 2147483647;
|
|
26045
26126
|
var CONFIRM_SUCCESS_STATUSES = /* @__PURE__ */ new Set(["completed", "succeeded", "success"]);
|
|
26046
26127
|
var CONFIRM_FAILURE_STATUSES = /* @__PURE__ */ new Set(["failed", "error", "denied", "cancelled", "canceled"]);
|
|
26047
|
-
function
|
|
26128
|
+
function hasSpawnReadinessProof(value) {
|
|
26048
26129
|
return value.output?.spawned === true && value.output?.ready === true;
|
|
26049
26130
|
}
|
|
26131
|
+
function hasSpawnLaunchProof(value) {
|
|
26132
|
+
return value.output?.spawned === true && typeof value.output?.ready === "boolean";
|
|
26133
|
+
}
|
|
26134
|
+
function hasSpawnProof(value, requireReadiness) {
|
|
26135
|
+
return requireReadiness ? hasSpawnReadinessProof(value) : hasSpawnLaunchProof(value);
|
|
26136
|
+
}
|
|
26137
|
+
function spawnProofError(node2, status, action, output2, requireReadiness) {
|
|
26138
|
+
if (output2?.spawned === true && typeof output2.ready !== "boolean") {
|
|
26139
|
+
return requireReadiness ? `node '${node2}' handler did not honour verify_ready: missing explicit spawned:true and ready:true proof; upgrade to a release containing Relay PR #1708` : `node '${node2}' reported ${status} for ${action} without an explicit ready boolean; upgrade to a release containing Relay PR #1708`;
|
|
26140
|
+
}
|
|
26141
|
+
return `node '${node2}' reported ${status} for ${action} without explicit ${requireReadiness ? "spawned:true and ready:true" : "spawned:true and a ready boolean"} proof`;
|
|
26142
|
+
}
|
|
26050
26143
|
var READ_TIMED_OUT = /* @__PURE__ */ Symbol("relay.confirm.readTimedOut");
|
|
26051
26144
|
function confirmDurationMs(value, fallback, max) {
|
|
26052
26145
|
return typeof value === "number" && Number.isFinite(value) && value > 0 ? Math.min(value, max) : fallback;
|
|
@@ -26450,7 +26543,10 @@ var RelaycastMessagingClient = class {
|
|
|
26450
26543
|
if (decision.node) {
|
|
26451
26544
|
const actionName = input2.actionName ?? placementActionName(capability);
|
|
26452
26545
|
const clientMustTarget = Boolean(targetNode || repo || sandboxOnly);
|
|
26546
|
+
const verifyReady = input2.verifyReady ?? (input2.confirm === true && capability.startsWith("spawn:") && capability !== "spawn:persona");
|
|
26547
|
+
const requireReadiness = verifyReady || capability === "spawn:persona";
|
|
26453
26548
|
const actionInput = placementActionInput(input2.input, {
|
|
26549
|
+
verifyReady,
|
|
26454
26550
|
capability,
|
|
26455
26551
|
...clientMustTarget ? { node: decision.node.name } : {},
|
|
26456
26552
|
repo,
|
|
@@ -26473,8 +26569,8 @@ var RelaycastMessagingClient = class {
|
|
|
26473
26569
|
});
|
|
26474
26570
|
}
|
|
26475
26571
|
const ackOutput = ack.output;
|
|
26476
|
-
if (!input2.confirm && capability.startsWith("spawn:") && ackStatus && CONFIRM_SUCCESS_STATUSES.has(ackStatus) && !
|
|
26477
|
-
throw new RelayPlacementError("spawn_failed",
|
|
26572
|
+
if (!input2.confirm && capability.startsWith("spawn:") && ackStatus && CONFIRM_SUCCESS_STATUSES.has(ackStatus) && !hasSpawnProof({ output: ackOutput }, requireReadiness)) {
|
|
26573
|
+
throw new RelayPlacementError("spawn_failed", spawnProofError(placedNodeLabel, ackStatus, actionName, ackOutput, requireReadiness), {
|
|
26478
26574
|
capability,
|
|
26479
26575
|
node: placedNodeLabel,
|
|
26480
26576
|
repo,
|
|
@@ -26490,6 +26586,9 @@ var RelaycastMessagingClient = class {
|
|
|
26490
26586
|
node: placedNodeLabel,
|
|
26491
26587
|
repo,
|
|
26492
26588
|
attempts,
|
|
26589
|
+
// The mode this request actually asked the broker for, so the
|
|
26590
|
+
// poll judges the same contract the invocation carried.
|
|
26591
|
+
requireReadiness,
|
|
26493
26592
|
// Defaults and validation live in confirmPlacementInvocation
|
|
26494
26593
|
// so a direct caller cannot bypass them.
|
|
26495
26594
|
timeoutMs: input2.confirmTimeoutMs,
|
|
@@ -26505,7 +26604,10 @@ var RelaycastMessagingClient = class {
|
|
|
26505
26604
|
attempts,
|
|
26506
26605
|
queued,
|
|
26507
26606
|
confirmed: Boolean(confirmation),
|
|
26508
|
-
|
|
26607
|
+
// `ready` means proven harness readiness. A confirmation that
|
|
26608
|
+
// only judged the launch contract (`verifyReady: false`) is
|
|
26609
|
+
// confirmed, not ready.
|
|
26610
|
+
state: confirmation && requireReadiness ? "ready" : "accepted"
|
|
26509
26611
|
},
|
|
26510
26612
|
...confirmation ? { confirmation } : {}
|
|
26511
26613
|
};
|
|
@@ -26587,7 +26689,7 @@ var RelaycastMessagingClient = class {
|
|
|
26587
26689
|
* pending success — it times out as `spawn_unconfirmed`.
|
|
26588
26690
|
*/
|
|
26589
26691
|
async confirmPlacementInvocation(actionName, ack, context) {
|
|
26590
|
-
const { timeoutMs, pollIntervalMs, ...errorContext } = context;
|
|
26692
|
+
const { timeoutMs, pollIntervalMs, requireReadiness, ...errorContext } = context;
|
|
26591
26693
|
const invocationId = ack.invocationId;
|
|
26592
26694
|
const dispatchState = resolveDispatchState(ack);
|
|
26593
26695
|
if (!invocationId) {
|
|
@@ -26616,8 +26718,8 @@ var RelaycastMessagingClient = class {
|
|
|
26616
26718
|
const invocation = outcome.value;
|
|
26617
26719
|
const status = invocation?.status?.toLowerCase();
|
|
26618
26720
|
if (status && CONFIRM_SUCCESS_STATUSES.has(status)) {
|
|
26619
|
-
if (errorContext.capability.startsWith("spawn:") && !
|
|
26620
|
-
throw new RelayPlacementError("spawn_failed",
|
|
26721
|
+
if (errorContext.capability.startsWith("spawn:") && !hasSpawnProof(invocation, requireReadiness)) {
|
|
26722
|
+
throw new RelayPlacementError("spawn_failed", spawnProofError(context.node, status, actionName, invocation.output, requireReadiness), {
|
|
26621
26723
|
...errorContext,
|
|
26622
26724
|
state: "failed",
|
|
26623
26725
|
invocationId,
|
|
@@ -26666,17 +26768,6 @@ var RelaycastMessagingClient = class {
|
|
|
26666
26768
|
throw new Error("RelaycastMessagingClient.workspace.info requires the relaycast workspace API.");
|
|
26667
26769
|
}
|
|
26668
26770
|
return await this.relaycast.workspace.info();
|
|
26669
|
-
},
|
|
26670
|
-
fleetNodes: {
|
|
26671
|
-
get: async () => {
|
|
26672
|
-
return toRelayWorkspaceFleetNodesConfig(await this.requireWorkspaceFleetNodes().get());
|
|
26673
|
-
},
|
|
26674
|
-
set: async (enabled) => {
|
|
26675
|
-
return toRelayWorkspaceFleetNodesConfig(await this.requireWorkspaceFleetNodes().set(enabled));
|
|
26676
|
-
},
|
|
26677
|
-
inherit: async () => {
|
|
26678
|
-
return toRelayWorkspaceFleetNodesConfig(await this.requireWorkspaceFleetNodes().inherit());
|
|
26679
|
-
}
|
|
26680
26771
|
}
|
|
26681
26772
|
};
|
|
26682
26773
|
resolvePlacementNode(node2, selfNodeName) {
|
|
@@ -26838,12 +26929,6 @@ var RelaycastMessagingClient = class {
|
|
|
26838
26929
|
}
|
|
26839
26930
|
return this.relaycast.triggers;
|
|
26840
26931
|
}
|
|
26841
|
-
requireWorkspaceFleetNodes() {
|
|
26842
|
-
if (!this.relaycast.workspace?.fleetNodes) {
|
|
26843
|
-
throw new Error("RelaycastMessagingClient.workspace.fleetNodes requires @relaycast/sdk with the workspace fleet nodes API.");
|
|
26844
|
-
}
|
|
26845
|
-
return this.relaycast.workspace.fleetNodes;
|
|
26846
|
-
}
|
|
26847
26932
|
requireAgentActions(operation) {
|
|
26848
26933
|
const actions = this.agentClient?.actions;
|
|
26849
26934
|
if (!actions) {
|
|
@@ -27709,7 +27794,6 @@ function createWorkspaceFacade(messaging, deps) {
|
|
|
27709
27794
|
};
|
|
27710
27795
|
return {
|
|
27711
27796
|
info: () => messaging.workspace.info(),
|
|
27712
|
-
fleetNodes: messaging.workspace.fleetNodes,
|
|
27713
27797
|
register,
|
|
27714
27798
|
release: async (input2) => {
|
|
27715
27799
|
if (!deps) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-relay",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "13.0.1",
|
|
4
4
|
"description": "Real-time agent-to-agent communication system",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -43,20 +43,20 @@
|
|
|
43
43
|
"pack:validate": "npm pack --dry-run"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@agent-relay/cli-surface": "
|
|
47
|
-
"@agent-relay/cloud": "
|
|
48
|
-
"@agent-relay/config": "
|
|
49
|
-
"@agent-relay/fleet": "
|
|
50
|
-
"@agent-relay/harness-driver": "
|
|
51
|
-
"@agent-relay/harnesses": "
|
|
52
|
-
"@agent-relay/sdk": "
|
|
53
|
-
"@agent-relay/session": "
|
|
54
|
-
"@agent-relay/utils": "
|
|
46
|
+
"@agent-relay/cli-surface": "13.0.1",
|
|
47
|
+
"@agent-relay/cloud": "13.0.1",
|
|
48
|
+
"@agent-relay/config": "13.0.1",
|
|
49
|
+
"@agent-relay/fleet": "13.0.1",
|
|
50
|
+
"@agent-relay/harness-driver": "13.0.1",
|
|
51
|
+
"@agent-relay/harnesses": "13.0.1",
|
|
52
|
+
"@agent-relay/sdk": "13.0.1",
|
|
53
|
+
"@agent-relay/session": "13.0.1",
|
|
54
|
+
"@agent-relay/utils": "13.0.1",
|
|
55
55
|
"@modelcontextprotocol/sdk": "^1.23.0",
|
|
56
56
|
"@relayfile/client": "^0.10.27",
|
|
57
57
|
"@relayfile/sdk": "^0.10.64",
|
|
58
58
|
"@relayflows/cli": "1.0.1",
|
|
59
|
-
"@relayflows/sdk": "
|
|
59
|
+
"@relayflows/sdk": "2.0.22",
|
|
60
60
|
"@xterm/headless": "^6.0.0",
|
|
61
61
|
"ai-hist": "^0.18.1",
|
|
62
62
|
"commander": "^12.1.0",
|