agent-relay 10.6.7 → 11.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/README.md +8 -0
- package/dist/cli/bootstrap.d.ts.map +1 -1
- package/dist/cli/bootstrap.js +2 -0
- package/dist/cli/bootstrap.js.map +1 -1
- package/dist/cli/commands/local-agent.d.ts +3 -10
- package/dist/cli/commands/local-agent.d.ts.map +1 -1
- package/dist/cli/commands/local-agent.js +104 -35
- package/dist/cli/commands/local-agent.js.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +3 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/lib/attach-native.d.ts +27 -0
- package/dist/cli/lib/attach-native.d.ts.map +1 -0
- package/dist/cli/lib/attach-native.js +266 -0
- package/dist/cli/lib/attach-native.js.map +1 -0
- package/dist/cli/lib/attach-view.d.ts +18 -0
- package/dist/cli/lib/attach-view.d.ts.map +1 -1
- package/dist/cli/lib/attach-view.js +52 -0
- package/dist/cli/lib/attach-view.js.map +1 -1
- package/dist/cli/lib/client-factory.d.ts +9 -0
- package/dist/cli/lib/client-factory.d.ts.map +1 -1
- package/dist/cli/lib/client-factory.js +35 -1
- package/dist/cli/lib/client-factory.js.map +1 -1
- package/dist/cli/lib/ensure-websocket.d.ts +3 -6
- package/dist/cli/lib/ensure-websocket.d.ts.map +1 -1
- package/dist/cli/lib/ensure-websocket.js +3 -6
- package/dist/cli/lib/ensure-websocket.js.map +1 -1
- package/dist/cli/lib/node-version.d.ts +4 -0
- package/dist/cli/lib/node-version.d.ts.map +1 -0
- package/dist/cli/lib/node-version.js +9 -0
- package/dist/cli/lib/node-version.js.map +1 -0
- package/dist/index.cjs +340 -2
- package/package.json +9 -8
package/dist/index.cjs
CHANGED
|
@@ -159,14 +159,20 @@ var require_umd = __commonJS({
|
|
|
159
159
|
// dist/index.js
|
|
160
160
|
var index_exports = {};
|
|
161
161
|
__export(index_exports, {
|
|
162
|
+
AGENT_ACTIVITIES: () => AGENT_ACTIVITIES,
|
|
163
|
+
AGENT_EVENT_FAMILIES: () => AGENT_EVENT_FAMILIES,
|
|
162
164
|
ActionNotFoundError: () => ActionNotFoundError,
|
|
163
165
|
ActionPredicate: () => ActionPredicate,
|
|
164
166
|
ActionRegistrationError: () => ActionRegistrationError,
|
|
165
167
|
ActionRegistry: () => ActionRegistry,
|
|
166
168
|
ActionValidationError: () => ActionValidationError,
|
|
169
|
+
ActivityPredicate: () => ActivityPredicate,
|
|
167
170
|
AgentRelay: () => AgentRelay,
|
|
168
171
|
DeliveryRunner: () => DeliveryRunner,
|
|
169
172
|
ERROR_SEARCH_HINT: () => ERROR_SEARCH_HINT,
|
|
173
|
+
EXACT_AND_INFERRED_OBSERVABILITY: () => EXACT_AND_INFERRED_OBSERVABILITY,
|
|
174
|
+
EXACT_OBSERVABILITY: () => EXACT_OBSERVABILITY,
|
|
175
|
+
INFERRED_OBSERVABILITY: () => INFERRED_OBSERVABILITY,
|
|
170
176
|
INVALID_AGENT_TOKEN_CODE: () => INVALID_AGENT_TOKEN_CODE,
|
|
171
177
|
INVALID_AGENT_TOKEN_MESSAGE: () => INVALID_AGENT_TOKEN_MESSAGE,
|
|
172
178
|
InMemoryAgentRelayActions: () => InMemoryAgentRelayActions,
|
|
@@ -174,6 +180,7 @@ __export(index_exports, {
|
|
|
174
180
|
MessageCreatedPredicate: () => MessageCreatedPredicate,
|
|
175
181
|
MessageReactedPredicate: () => MessageReactedPredicate,
|
|
176
182
|
MessageReadPredicate: () => MessageReadPredicate,
|
|
183
|
+
OBSERVABILITY_UNAVAILABLE: () => OBSERVABILITY_UNAVAILABLE,
|
|
177
184
|
RELAYCAST_SDK_VERSION: () => RELAYCAST_SDK_VERSION,
|
|
178
185
|
RelayCapabilityError: () => RelayCapabilityError,
|
|
179
186
|
RelayError: () => RelayError,
|
|
@@ -195,8 +202,10 @@ __export(index_exports, {
|
|
|
195
202
|
checkForUpdatesInBackground: () => checkForUpdatesInBackground,
|
|
196
203
|
commandExists: () => commandExists,
|
|
197
204
|
connectionLog: () => connectionLog,
|
|
205
|
+
createAgentActivityState: () => createAgentActivityState,
|
|
198
206
|
createAgentClient: () => createAgentClient,
|
|
199
207
|
createAgentHandle: () => createAgentHandle,
|
|
208
|
+
createAgentObservabilityCapabilities: () => createAgentObservabilityCapabilities,
|
|
200
209
|
createEnrichedEvents: () => createEnrichedEvents,
|
|
201
210
|
createEnrichedMessages: () => createEnrichedMessages,
|
|
202
211
|
createEventFanIn: () => createEventFanIn,
|
|
@@ -264,6 +273,7 @@ __export(index_exports, {
|
|
|
264
273
|
normalizeThread: () => normalizeThread,
|
|
265
274
|
parseGitRemoteUrl: () => parseGitRemoteUrl,
|
|
266
275
|
printUpdateNotification: () => printUpdateNotification,
|
|
276
|
+
reduceAgentActivity: () => reduceAgentActivity,
|
|
267
277
|
registerFacadeAction: () => registerFacadeAction,
|
|
268
278
|
resetPatternMetrics: () => resetPatternMetrics,
|
|
269
279
|
resolveAgentName: () => resolveAgentName,
|
|
@@ -48768,7 +48778,7 @@ function createRawObserverStream(baseUrl, token, report, webSocketImpl) {
|
|
|
48768
48778
|
return;
|
|
48769
48779
|
const WebSocketImpl = webSocketImpl ?? globalThis.WebSocket;
|
|
48770
48780
|
if (!WebSocketImpl) {
|
|
48771
|
-
report(new Error("No WebSocket implementation available for the observer stream. Node exposes a global `WebSocket
|
|
48781
|
+
report(new Error("No WebSocket implementation available for the observer stream. Node 22+ exposes a global `WebSocket`; otherwise install one as `globalThis.WebSocket` (e.g. the `ws` package) or pass `webSocketImpl`/`createLiveStream` to observer mode."));
|
|
48772
48782
|
return;
|
|
48773
48783
|
}
|
|
48774
48784
|
let ws;
|
|
@@ -49398,6 +49408,21 @@ var RelaycastMessagingClient = class {
|
|
|
49398
49408
|
return presence.map(normalizeAgentPresence);
|
|
49399
49409
|
}
|
|
49400
49410
|
};
|
|
49411
|
+
sessionEvents = {
|
|
49412
|
+
emit: async (agentName, event) => {
|
|
49413
|
+
const events = this.relaycast.agents.events;
|
|
49414
|
+
if (!events)
|
|
49415
|
+
throw new Error("Relaycast agent session events API is unavailable.");
|
|
49416
|
+
const { type, ...payload } = event;
|
|
49417
|
+
return events.emit(agentName, { type, payload });
|
|
49418
|
+
},
|
|
49419
|
+
list: async (agentName, options) => {
|
|
49420
|
+
const events = this.relaycast.agents.events;
|
|
49421
|
+
if (!events)
|
|
49422
|
+
throw new Error("Relaycast agent session events API is unavailable.");
|
|
49423
|
+
return events.list(agentName, options);
|
|
49424
|
+
}
|
|
49425
|
+
};
|
|
49401
49426
|
channels = {
|
|
49402
49427
|
list: async (options) => {
|
|
49403
49428
|
const channels = await this.relaycast.channels.list(definedOptions({ includeArchived: options?.includeArchived }));
|
|
@@ -50336,6 +50361,27 @@ var StatusPredicate = class {
|
|
|
50336
50361
|
});
|
|
50337
50362
|
}
|
|
50338
50363
|
};
|
|
50364
|
+
var ActivityPredicate = class {
|
|
50365
|
+
agentId;
|
|
50366
|
+
activity;
|
|
50367
|
+
constructor(agentId, activity) {
|
|
50368
|
+
this.agentId = agentId;
|
|
50369
|
+
this.activity = activity;
|
|
50370
|
+
}
|
|
50371
|
+
subscribe(context, handler) {
|
|
50372
|
+
const report = makeReporter(context, {
|
|
50373
|
+
source: "listener",
|
|
50374
|
+
selector: `agent.activity.${this.activity}`
|
|
50375
|
+
});
|
|
50376
|
+
return context.onSessionEvent(({ agentId, event }) => {
|
|
50377
|
+
if (agentId !== this.agentId)
|
|
50378
|
+
return;
|
|
50379
|
+
if (event.type !== "activity.changed" || event.activity !== this.activity)
|
|
50380
|
+
return;
|
|
50381
|
+
runHandler(handler, event, report);
|
|
50382
|
+
});
|
|
50383
|
+
}
|
|
50384
|
+
};
|
|
50339
50385
|
var ToolCalledPredicate = class {
|
|
50340
50386
|
agentId;
|
|
50341
50387
|
tool;
|
|
@@ -50423,6 +50469,23 @@ function toPublicSessionEvent(agentId, event) {
|
|
|
50423
50469
|
..."reason" in event && event.reason ? { reason: event.reason } : {}
|
|
50424
50470
|
};
|
|
50425
50471
|
}
|
|
50472
|
+
if (event.type === "activity.changed") {
|
|
50473
|
+
const { observability } = event;
|
|
50474
|
+
return {
|
|
50475
|
+
type: "agent.activity.changed",
|
|
50476
|
+
agentId,
|
|
50477
|
+
activity: event.activity,
|
|
50478
|
+
previousActivity: event.previousActivity,
|
|
50479
|
+
reason: event.reason,
|
|
50480
|
+
...observability.turnId ? { turnId: observability.turnId } : {},
|
|
50481
|
+
sequence: observability.sequence,
|
|
50482
|
+
timestamp: observability.timestamp,
|
|
50483
|
+
source: observability.source,
|
|
50484
|
+
fidelity: observability.fidelity,
|
|
50485
|
+
...event.tool ? { tool: event.tool } : {},
|
|
50486
|
+
...event.approval ? { approval: event.approval } : {}
|
|
50487
|
+
};
|
|
50488
|
+
}
|
|
50426
50489
|
return { type: event.type, agentId, event };
|
|
50427
50490
|
}
|
|
50428
50491
|
function matchesSelector(selector, type) {
|
|
@@ -50523,6 +50586,9 @@ function createAgentHandle(input) {
|
|
|
50523
50586
|
status: {
|
|
50524
50587
|
becomes: (status) => new StatusPredicate(input.id, status)
|
|
50525
50588
|
},
|
|
50589
|
+
activity: {
|
|
50590
|
+
becomes: (activity) => new ActivityPredicate(input.id, activity)
|
|
50591
|
+
},
|
|
50526
50592
|
tools: {
|
|
50527
50593
|
called: (tool) => new ToolCalledPredicate(input.id, tool)
|
|
50528
50594
|
}
|
|
@@ -50976,6 +51042,18 @@ var AgentRelay = class _AgentRelay {
|
|
|
50976
51042
|
emitSessionEvent(agentId, event) {
|
|
50977
51043
|
this.listenerHub.emitSessionEvent(agentId, event);
|
|
50978
51044
|
}
|
|
51045
|
+
async publishSessionEvent(agentId, event) {
|
|
51046
|
+
this.listenerHub.emitSessionEvent(agentId, event);
|
|
51047
|
+
try {
|
|
51048
|
+
await this.messaging.sessionEvents?.emit(agentId, event);
|
|
51049
|
+
} catch (error151) {
|
|
51050
|
+
this.reportError(error151, {
|
|
51051
|
+
source: "listener",
|
|
51052
|
+
selector: event.type,
|
|
51053
|
+
operation: "publish_session_event"
|
|
51054
|
+
});
|
|
51055
|
+
}
|
|
51056
|
+
}
|
|
50979
51057
|
messagingForToken(token) {
|
|
50980
51058
|
let client = this.clientsByToken.get(token);
|
|
50981
51059
|
if (!client) {
|
|
@@ -51023,7 +51101,11 @@ function agentRelayAgent(messaging, actions, handlerAgent, options) {
|
|
|
51023
51101
|
once: ((selector, handler) => hub.once(selector, handler)),
|
|
51024
51102
|
action: (name) => hub.action(name),
|
|
51025
51103
|
agent: (input) => hub.agent(input),
|
|
51026
|
-
emitSessionEvent: (agentId, event) => hub.emitSessionEvent(agentId, event)
|
|
51104
|
+
emitSessionEvent: (agentId, event) => hub.emitSessionEvent(agentId, event),
|
|
51105
|
+
publishSessionEvent: async (agentId, event) => {
|
|
51106
|
+
hub.emitSessionEvent(agentId, event);
|
|
51107
|
+
await messaging.sessionEvents?.emit(agentId, event);
|
|
51108
|
+
}
|
|
51027
51109
|
};
|
|
51028
51110
|
}
|
|
51029
51111
|
function assembleAgentClient(messaging, actions, identity, options) {
|
|
@@ -51224,6 +51306,52 @@ function dateToString(input) {
|
|
|
51224
51306
|
}
|
|
51225
51307
|
|
|
51226
51308
|
// ../sdk/dist/session/types.js
|
|
51309
|
+
var OBSERVABILITY_UNAVAILABLE = { available: false };
|
|
51310
|
+
var EXACT_OBSERVABILITY = {
|
|
51311
|
+
available: true,
|
|
51312
|
+
fidelities: ["exact"]
|
|
51313
|
+
};
|
|
51314
|
+
var INFERRED_OBSERVABILITY = {
|
|
51315
|
+
available: true,
|
|
51316
|
+
fidelities: ["inferred"]
|
|
51317
|
+
};
|
|
51318
|
+
var EXACT_AND_INFERRED_OBSERVABILITY = {
|
|
51319
|
+
available: true,
|
|
51320
|
+
fidelities: ["exact", "inferred"]
|
|
51321
|
+
};
|
|
51322
|
+
var AGENT_ACTIVITIES = [
|
|
51323
|
+
"starting",
|
|
51324
|
+
"thinking",
|
|
51325
|
+
"typing",
|
|
51326
|
+
"using_tool",
|
|
51327
|
+
"waiting",
|
|
51328
|
+
"idle",
|
|
51329
|
+
"error"
|
|
51330
|
+
];
|
|
51331
|
+
var AGENT_EVENT_FAMILIES = [
|
|
51332
|
+
"lifecycle",
|
|
51333
|
+
"turns",
|
|
51334
|
+
"text",
|
|
51335
|
+
"reasoning",
|
|
51336
|
+
"tools",
|
|
51337
|
+
"tool_approvals",
|
|
51338
|
+
"files",
|
|
51339
|
+
"compaction",
|
|
51340
|
+
"model",
|
|
51341
|
+
"warnings",
|
|
51342
|
+
"usage",
|
|
51343
|
+
"diagnostics",
|
|
51344
|
+
"errors"
|
|
51345
|
+
];
|
|
51346
|
+
function createAgentObservabilityCapabilities(input) {
|
|
51347
|
+
return {
|
|
51348
|
+
activities: Object.fromEntries(AGENT_ACTIVITIES.map((activity) => [
|
|
51349
|
+
activity,
|
|
51350
|
+
input.activities?.[activity] ?? OBSERVABILITY_UNAVAILABLE
|
|
51351
|
+
])),
|
|
51352
|
+
events: Object.fromEntries(AGENT_EVENT_FAMILIES.map((family) => [family, input.events?.[family] ?? OBSERVABILITY_UNAVAILABLE]))
|
|
51353
|
+
};
|
|
51354
|
+
}
|
|
51227
51355
|
var MINIMAL_AGENT_SESSION_CAPABILITIES = {
|
|
51228
51356
|
messaging: { receive: true },
|
|
51229
51357
|
delivery: { modes: ["immediate"] },
|
|
@@ -51231,6 +51359,206 @@ var MINIMAL_AGENT_SESSION_CAPABILITIES = {
|
|
|
51231
51359
|
lifecycle: { release: true }
|
|
51232
51360
|
};
|
|
51233
51361
|
|
|
51362
|
+
// ../sdk/dist/session/activity-reducer.js
|
|
51363
|
+
function createAgentActivityState(activity = "idle") {
|
|
51364
|
+
return {
|
|
51365
|
+
activity,
|
|
51366
|
+
starting: false,
|
|
51367
|
+
turnActive: false,
|
|
51368
|
+
turnFinished: false,
|
|
51369
|
+
failed: activity === "error",
|
|
51370
|
+
lastSequence: -1,
|
|
51371
|
+
activeTextBlocks: /* @__PURE__ */ new Set(),
|
|
51372
|
+
activeReasoningBlocks: /* @__PURE__ */ new Set(),
|
|
51373
|
+
activeTools: /* @__PURE__ */ new Map(),
|
|
51374
|
+
pendingApprovals: /* @__PURE__ */ new Map()
|
|
51375
|
+
};
|
|
51376
|
+
}
|
|
51377
|
+
function cloneState(state) {
|
|
51378
|
+
return {
|
|
51379
|
+
activity: state.activity,
|
|
51380
|
+
starting: state.starting,
|
|
51381
|
+
...state.turnId ? { turnId: state.turnId } : {},
|
|
51382
|
+
turnActive: state.turnActive,
|
|
51383
|
+
turnFinished: state.turnFinished,
|
|
51384
|
+
failed: state.failed,
|
|
51385
|
+
...state.errorReason ? { errorReason: state.errorReason } : {},
|
|
51386
|
+
...state.waitingReason ? { waitingReason: state.waitingReason } : {},
|
|
51387
|
+
lastSequence: state.lastSequence,
|
|
51388
|
+
activeTextBlocks: new Set(state.activeTextBlocks),
|
|
51389
|
+
activeReasoningBlocks: new Set(state.activeReasoningBlocks),
|
|
51390
|
+
activeTools: new Map(state.activeTools),
|
|
51391
|
+
pendingApprovals: new Map(state.pendingApprovals)
|
|
51392
|
+
};
|
|
51393
|
+
}
|
|
51394
|
+
function clearTurnWork(state) {
|
|
51395
|
+
state.activeTextBlocks.clear();
|
|
51396
|
+
state.activeReasoningBlocks.clear();
|
|
51397
|
+
state.activeTools.clear();
|
|
51398
|
+
state.pendingApprovals.clear();
|
|
51399
|
+
}
|
|
51400
|
+
function toolKey(event) {
|
|
51401
|
+
return event.callId ?? event.run ?? event.tool;
|
|
51402
|
+
}
|
|
51403
|
+
function completedToolKey(event) {
|
|
51404
|
+
return event.callId ?? event.run ?? event.tool;
|
|
51405
|
+
}
|
|
51406
|
+
function newestValue(values) {
|
|
51407
|
+
let newest;
|
|
51408
|
+
for (const value of values.values())
|
|
51409
|
+
newest = value;
|
|
51410
|
+
return newest;
|
|
51411
|
+
}
|
|
51412
|
+
function deriveActivity(state) {
|
|
51413
|
+
if (state.failed)
|
|
51414
|
+
return { activity: "error", reason: state.errorReason ?? "runtime_error" };
|
|
51415
|
+
const approval = newestValue(state.pendingApprovals);
|
|
51416
|
+
if (approval)
|
|
51417
|
+
return { activity: "waiting", reason: "tool_approval", approval };
|
|
51418
|
+
if (state.waitingReason)
|
|
51419
|
+
return { activity: "waiting", reason: state.waitingReason };
|
|
51420
|
+
const tool = newestValue(state.activeTools);
|
|
51421
|
+
if (tool)
|
|
51422
|
+
return { activity: "using_tool", reason: "tool_call", tool };
|
|
51423
|
+
if (state.activeTextBlocks.size > 0)
|
|
51424
|
+
return { activity: "typing", reason: "text_output" };
|
|
51425
|
+
if (state.activeReasoningBlocks.size > 0)
|
|
51426
|
+
return { activity: "thinking", reason: "reasoning" };
|
|
51427
|
+
if (state.starting)
|
|
51428
|
+
return { activity: "starting", reason: "session_starting" };
|
|
51429
|
+
if (state.turnActive) {
|
|
51430
|
+
return { activity: "thinking", reason: "turn_processing", fidelity: "inferred" };
|
|
51431
|
+
}
|
|
51432
|
+
return { activity: "idle", reason: "settled" };
|
|
51433
|
+
}
|
|
51434
|
+
function observed(event) {
|
|
51435
|
+
return event.observability;
|
|
51436
|
+
}
|
|
51437
|
+
function reduceAgentActivity(previous, event) {
|
|
51438
|
+
const observation = observed(event);
|
|
51439
|
+
if (!observation || event.type === "activity.changed")
|
|
51440
|
+
return { state: previous };
|
|
51441
|
+
if (observation.sequence <= previous.lastSequence)
|
|
51442
|
+
return { state: previous };
|
|
51443
|
+
const state = cloneState(previous);
|
|
51444
|
+
state.lastSequence = observation.sequence;
|
|
51445
|
+
switch (event.type) {
|
|
51446
|
+
case "session.starting":
|
|
51447
|
+
state.starting = true;
|
|
51448
|
+
state.turnActive = false;
|
|
51449
|
+
state.turnFinished = false;
|
|
51450
|
+
state.failed = false;
|
|
51451
|
+
state.errorReason = void 0;
|
|
51452
|
+
state.waitingReason = void 0;
|
|
51453
|
+
clearTurnWork(state);
|
|
51454
|
+
break;
|
|
51455
|
+
case "session.started":
|
|
51456
|
+
case "session.resumed":
|
|
51457
|
+
state.starting = false;
|
|
51458
|
+
state.failed = false;
|
|
51459
|
+
state.errorReason = void 0;
|
|
51460
|
+
state.waitingReason = void 0;
|
|
51461
|
+
break;
|
|
51462
|
+
case "session.suspended":
|
|
51463
|
+
state.starting = false;
|
|
51464
|
+
state.waitingReason = event.reason;
|
|
51465
|
+
break;
|
|
51466
|
+
case "session.detached":
|
|
51467
|
+
case "session.stopped":
|
|
51468
|
+
case "session.destroyed":
|
|
51469
|
+
case "session.released":
|
|
51470
|
+
state.starting = false;
|
|
51471
|
+
state.turnActive = false;
|
|
51472
|
+
state.turnFinished = true;
|
|
51473
|
+
state.waitingReason = void 0;
|
|
51474
|
+
clearTurnWork(state);
|
|
51475
|
+
break;
|
|
51476
|
+
case "session.failed":
|
|
51477
|
+
state.starting = false;
|
|
51478
|
+
state.failed = true;
|
|
51479
|
+
state.errorReason = event.code ?? event.error;
|
|
51480
|
+
state.waitingReason = void 0;
|
|
51481
|
+
break;
|
|
51482
|
+
case "error":
|
|
51483
|
+
state.starting = false;
|
|
51484
|
+
state.failed = true;
|
|
51485
|
+
state.errorReason = event.code ?? event.error;
|
|
51486
|
+
state.waitingReason = void 0;
|
|
51487
|
+
break;
|
|
51488
|
+
case "turn.started":
|
|
51489
|
+
state.turnId = event.turnId;
|
|
51490
|
+
state.turnActive = true;
|
|
51491
|
+
state.turnFinished = false;
|
|
51492
|
+
state.failed = false;
|
|
51493
|
+
state.errorReason = void 0;
|
|
51494
|
+
state.waitingReason = void 0;
|
|
51495
|
+
clearTurnWork(state);
|
|
51496
|
+
break;
|
|
51497
|
+
case "text.started":
|
|
51498
|
+
case "text.delta":
|
|
51499
|
+
state.activeTextBlocks.add(event.blockId);
|
|
51500
|
+
break;
|
|
51501
|
+
case "text.finished":
|
|
51502
|
+
state.activeTextBlocks.delete(event.blockId);
|
|
51503
|
+
break;
|
|
51504
|
+
case "reasoning.started":
|
|
51505
|
+
case "reasoning.delta":
|
|
51506
|
+
state.activeReasoningBlocks.add(event.blockId);
|
|
51507
|
+
break;
|
|
51508
|
+
case "reasoning.finished":
|
|
51509
|
+
state.activeReasoningBlocks.delete(event.blockId);
|
|
51510
|
+
break;
|
|
51511
|
+
case "tool.called": {
|
|
51512
|
+
const callId = toolKey(event);
|
|
51513
|
+
state.activeTools.set(callId, { callId, name: event.tool });
|
|
51514
|
+
break;
|
|
51515
|
+
}
|
|
51516
|
+
case "tool.completed":
|
|
51517
|
+
case "tool.failed":
|
|
51518
|
+
state.activeTools.delete(completedToolKey(event));
|
|
51519
|
+
break;
|
|
51520
|
+
case "tool.approval.requested":
|
|
51521
|
+
state.pendingApprovals.set(event.approvalId, {
|
|
51522
|
+
approvalId: event.approvalId,
|
|
51523
|
+
...event.callId ? { callId: event.callId } : {}
|
|
51524
|
+
});
|
|
51525
|
+
break;
|
|
51526
|
+
case "tool.approval.resolved":
|
|
51527
|
+
state.pendingApprovals.delete(event.approvalId);
|
|
51528
|
+
break;
|
|
51529
|
+
case "turn.finished":
|
|
51530
|
+
state.turnFinished = true;
|
|
51531
|
+
clearTurnWork(state);
|
|
51532
|
+
break;
|
|
51533
|
+
case "turn.settled":
|
|
51534
|
+
state.turnFinished = true;
|
|
51535
|
+
state.turnActive = false;
|
|
51536
|
+
state.waitingReason = void 0;
|
|
51537
|
+
clearTurnWork(state);
|
|
51538
|
+
break;
|
|
51539
|
+
default:
|
|
51540
|
+
break;
|
|
51541
|
+
}
|
|
51542
|
+
const derived = deriveActivity(state);
|
|
51543
|
+
if (derived.activity === previous.activity)
|
|
51544
|
+
return { state };
|
|
51545
|
+
state.activity = derived.activity;
|
|
51546
|
+
const fidelity = derived.fidelity ?? observation.fidelity;
|
|
51547
|
+
return {
|
|
51548
|
+
state,
|
|
51549
|
+
transition: {
|
|
51550
|
+
type: "activity.changed",
|
|
51551
|
+
activity: derived.activity,
|
|
51552
|
+
previousActivity: previous.activity,
|
|
51553
|
+
reason: derived.reason,
|
|
51554
|
+
...derived.tool ? { tool: derived.tool } : {},
|
|
51555
|
+
...derived.approval ? { approval: derived.approval } : {},
|
|
51556
|
+
at: observation.timestamp,
|
|
51557
|
+
observability: { ...observation, fidelity }
|
|
51558
|
+
}
|
|
51559
|
+
};
|
|
51560
|
+
}
|
|
51561
|
+
|
|
51234
51562
|
// ../sdk/dist/session/index.js
|
|
51235
51563
|
var counters = /* @__PURE__ */ new Map();
|
|
51236
51564
|
function nextHarnessName(base, explicit) {
|
|
@@ -52431,14 +52759,20 @@ function generateRequestId(prefix = "") {
|
|
|
52431
52759
|
}
|
|
52432
52760
|
// Annotate the CommonJS export names for ESM import in node:
|
|
52433
52761
|
0 && (module.exports = {
|
|
52762
|
+
AGENT_ACTIVITIES,
|
|
52763
|
+
AGENT_EVENT_FAMILIES,
|
|
52434
52764
|
ActionNotFoundError,
|
|
52435
52765
|
ActionPredicate,
|
|
52436
52766
|
ActionRegistrationError,
|
|
52437
52767
|
ActionRegistry,
|
|
52438
52768
|
ActionValidationError,
|
|
52769
|
+
ActivityPredicate,
|
|
52439
52770
|
AgentRelay,
|
|
52440
52771
|
DeliveryRunner,
|
|
52441
52772
|
ERROR_SEARCH_HINT,
|
|
52773
|
+
EXACT_AND_INFERRED_OBSERVABILITY,
|
|
52774
|
+
EXACT_OBSERVABILITY,
|
|
52775
|
+
INFERRED_OBSERVABILITY,
|
|
52442
52776
|
INVALID_AGENT_TOKEN_CODE,
|
|
52443
52777
|
INVALID_AGENT_TOKEN_MESSAGE,
|
|
52444
52778
|
InMemoryAgentRelayActions,
|
|
@@ -52446,6 +52780,7 @@ function generateRequestId(prefix = "") {
|
|
|
52446
52780
|
MessageCreatedPredicate,
|
|
52447
52781
|
MessageReactedPredicate,
|
|
52448
52782
|
MessageReadPredicate,
|
|
52783
|
+
OBSERVABILITY_UNAVAILABLE,
|
|
52449
52784
|
RELAYCAST_SDK_VERSION,
|
|
52450
52785
|
RelayCapabilityError,
|
|
52451
52786
|
RelayError,
|
|
@@ -52467,8 +52802,10 @@ function generateRequestId(prefix = "") {
|
|
|
52467
52802
|
checkForUpdatesInBackground,
|
|
52468
52803
|
commandExists,
|
|
52469
52804
|
connectionLog,
|
|
52805
|
+
createAgentActivityState,
|
|
52470
52806
|
createAgentClient,
|
|
52471
52807
|
createAgentHandle,
|
|
52808
|
+
createAgentObservabilityCapabilities,
|
|
52472
52809
|
createEnrichedEvents,
|
|
52473
52810
|
createEnrichedMessages,
|
|
52474
52811
|
createEventFanIn,
|
|
@@ -52536,6 +52873,7 @@ function generateRequestId(prefix = "") {
|
|
|
52536
52873
|
normalizeThread,
|
|
52537
52874
|
parseGitRemoteUrl,
|
|
52538
52875
|
printUpdateNotification,
|
|
52876
|
+
reduceAgentActivity,
|
|
52539
52877
|
registerFacadeAction,
|
|
52540
52878
|
resetPatternMetrics,
|
|
52541
52879
|
resolveAgentName,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-relay",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.1",
|
|
4
4
|
"description": "Real-time agent-to-agent communication system",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -43,12 +43,13 @@
|
|
|
43
43
|
"pack:validate": "npm pack --dry-run"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@agent-relay/cloud": "
|
|
47
|
-
"@agent-relay/config": "
|
|
48
|
-
"@agent-relay/fleet": "
|
|
49
|
-
"@agent-relay/harness-driver": "
|
|
50
|
-
"@agent-relay/
|
|
51
|
-
"@agent-relay/
|
|
46
|
+
"@agent-relay/cloud": "11.0.1",
|
|
47
|
+
"@agent-relay/config": "11.0.1",
|
|
48
|
+
"@agent-relay/fleet": "11.0.1",
|
|
49
|
+
"@agent-relay/harness-driver": "11.0.1",
|
|
50
|
+
"@agent-relay/harnesses": "11.0.1",
|
|
51
|
+
"@agent-relay/sdk": "11.0.1",
|
|
52
|
+
"@agent-relay/utils": "11.0.1",
|
|
52
53
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
53
54
|
"@relayfile/client": "^0.10.27",
|
|
54
55
|
"@relayflows/cli": "^1.0.1",
|
|
@@ -67,7 +68,7 @@
|
|
|
67
68
|
"esbuild": "^0.27.2"
|
|
68
69
|
},
|
|
69
70
|
"engines": {
|
|
70
|
-
"node": ">=
|
|
71
|
+
"node": ">=22.0.0"
|
|
71
72
|
},
|
|
72
73
|
"keywords": [
|
|
73
74
|
"agent",
|