@animalabs/agent-framework 0.6.10 → 0.7.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/src/agent.d.ts +2 -0
- package/dist/src/agent.d.ts.map +1 -1
- package/dist/src/agent.js +3 -0
- package/dist/src/agent.js.map +1 -1
- package/dist/src/framework.d.ts +115 -15
- package/dist/src/framework.d.ts.map +1 -1
- package/dist/src/framework.js +820 -104
- package/dist/src/framework.js.map +1 -1
- package/dist/src/mcpl/channel-registry.d.ts +87 -7
- package/dist/src/mcpl/channel-registry.d.ts.map +1 -1
- package/dist/src/mcpl/channel-registry.js +329 -49
- package/dist/src/mcpl/channel-registry.js.map +1 -1
- package/dist/src/modules/workspace/index.d.ts.map +1 -1
- package/dist/src/modules/workspace/index.js +13 -4
- package/dist/src/modules/workspace/index.js.map +1 -1
- package/dist/src/types/agent.d.ts +17 -0
- package/dist/src/types/agent.d.ts.map +1 -1
- package/dist/src/types/trace.d.ts +32 -0
- package/dist/src/types/trace.d.ts.map +1 -1
- package/dist/test/channel-registry-routing.test.js +186 -10
- package/dist/test/channel-registry-routing.test.js.map +1 -1
- package/dist/test/explicit-prose-routing.test.d.ts +11 -0
- package/dist/test/explicit-prose-routing.test.d.ts.map +1 -0
- package/dist/test/explicit-prose-routing.test.js +247 -0
- package/dist/test/explicit-prose-routing.test.js.map +1 -0
- package/dist/test/present-while-acting.test.js +85 -8
- package/dist/test/present-while-acting.test.js.map +1 -1
- package/dist/test/trunk-channel-routing.test.js +2 -2
- package/dist/test/trunk-channel-routing.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/agent.ts +3 -0
- package/src/framework.ts +881 -107
- package/src/mcpl/channel-registry.ts +401 -54
- package/src/modules/workspace/index.ts +13 -4
- package/src/types/agent.ts +18 -0
- package/src/types/trace.ts +47 -1
package/src/types/trace.ts
CHANGED
|
@@ -37,7 +37,18 @@ export type TraceEvent =
|
|
|
37
37
|
})
|
|
38
38
|
|
|
39
39
|
// Inference lifecycle
|
|
40
|
-
| (TraceEventBase & {
|
|
40
|
+
| (TraceEventBase & {
|
|
41
|
+
type: 'inference:started';
|
|
42
|
+
agentName: string;
|
|
43
|
+
/**
|
|
44
|
+
* The turn-frozen outbound locus (see turnLocusPins) — the channel this
|
|
45
|
+
* turn's plain prose will be routed to. Omitted for turns with no locus
|
|
46
|
+
* (heartbeats with no default channel). Observability only, like every
|
|
47
|
+
* trace field; lets external taps (e.g. a TTS relay) tag the whole
|
|
48
|
+
* activation with its channel without re-deriving routing.
|
|
49
|
+
*/
|
|
50
|
+
channelId?: string;
|
|
51
|
+
})
|
|
41
52
|
| (TraceEventBase & {
|
|
42
53
|
type: 'inference:completed';
|
|
43
54
|
agentName: string;
|
|
@@ -82,6 +93,8 @@ export type TraceEvent =
|
|
|
82
93
|
blockType: 'text' | 'thinking' | 'tool_call' | 'tool_result';
|
|
83
94
|
/** 0-indexed block position in the current assistant turn. */
|
|
84
95
|
blockIndex: number;
|
|
96
|
+
/** Turn-frozen outbound locus for this turn (see inference:started). */
|
|
97
|
+
channelId?: string;
|
|
85
98
|
})
|
|
86
99
|
| (TraceEventBase & {
|
|
87
100
|
/**
|
|
@@ -95,6 +108,8 @@ export type TraceEvent =
|
|
|
95
108
|
phase: 'block_start' | 'block_complete';
|
|
96
109
|
blockType: 'text' | 'thinking' | 'tool_call' | 'tool_result';
|
|
97
110
|
blockIndex: number;
|
|
111
|
+
/** Turn-frozen outbound locus for this turn (see inference:started). */
|
|
112
|
+
channelId?: string;
|
|
98
113
|
})
|
|
99
114
|
| (TraceEventBase & {
|
|
100
115
|
type: 'inference:tool_calls_yielded';
|
|
@@ -281,6 +296,37 @@ export type TraceEvent =
|
|
|
281
296
|
channelId?: string;
|
|
282
297
|
})
|
|
283
298
|
|
|
299
|
+
// Host-owned speech routing (ChannelRegistry.routeSpeech). One trace per
|
|
300
|
+
// delivered prose segment. `text` is the segment verbatim — the same content
|
|
301
|
+
// already on the bus chunk-by-chunk via inference:tokens, and mcpl:* traces
|
|
302
|
+
// are 'ops'-scoped on the webui wire — and `messageId` is the surface's id
|
|
303
|
+
// for the posted message (when the MCPL server reports one). Together they
|
|
304
|
+
// give external taps the (channelId, messageId, text) tuple needed to edit
|
|
305
|
+
// a just-posted message, e.g. a TTS interruption truncating a reply to the
|
|
306
|
+
// words actually voiced.
|
|
307
|
+
| (TraceEventBase & {
|
|
308
|
+
type: 'mcpl:speech-routed';
|
|
309
|
+
/** Agent / conversation whose speech was routed. */
|
|
310
|
+
conversationId: string;
|
|
311
|
+
serverId: string;
|
|
312
|
+
channelId: string;
|
|
313
|
+
delivered: boolean;
|
|
314
|
+
textLen: number;
|
|
315
|
+
/** The routed prose segment, verbatim. */
|
|
316
|
+
text: string;
|
|
317
|
+
/** Surface message id (e.g. Discord message id), when reported. */
|
|
318
|
+
messageId?: string;
|
|
319
|
+
})
|
|
320
|
+
| (TraceEventBase & {
|
|
321
|
+
type: 'mcpl:speech-route-failed';
|
|
322
|
+
/** Agent / conversation whose speech failed to route. */
|
|
323
|
+
conversationId: string;
|
|
324
|
+
/** Empty string when the failure was "no locus at all". */
|
|
325
|
+
channelId: string;
|
|
326
|
+
reason: string;
|
|
327
|
+
textLen: number;
|
|
328
|
+
})
|
|
329
|
+
|
|
284
330
|
// MCPL server connection lifecycle (spawn / handshake / reconnect health).
|
|
285
331
|
// Previously these outcomes were visible only on the host process's own
|
|
286
332
|
// stderr, so a server that lost the boot handshake race just went missing.
|