@ouispec/agent-events 0.13.1 → 0.16.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/platform.d.ts +8 -0
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +27 -1
- package/dist/platform.js.map +1 -1
- package/package.json +2 -2
package/dist/platform.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ export declare const AGENT_TURN_EVENTS: {
|
|
|
8
8
|
readonly TURN_STARTED: "agent:turn_started";
|
|
9
9
|
readonly TOKEN: "agent:token";
|
|
10
10
|
readonly TOKEN_CLEAR: "agent:token_clear";
|
|
11
|
+
/** A round (one model step) of the turn ended, after all of its text: whether it called tools, and whether it is the turn's last. */
|
|
12
|
+
readonly ROUND_END: "agent:round_end";
|
|
11
13
|
readonly TOOL_CALL_STARTED: "agent:tool_call_started";
|
|
12
14
|
readonly TOOL_CALL_COMPLETE: "agent:tool_call_complete";
|
|
13
15
|
readonly TURN_COMPLETE: "agent:turn_complete";
|
|
@@ -15,6 +17,12 @@ export declare const AGENT_TURN_EVENTS: {
|
|
|
15
17
|
readonly ERROR: "agent:error";
|
|
16
18
|
/** The turn stopped at a call that needs the user's approval; the payload is agent-sdk-core's `ApprovalRequiredEvent`. */
|
|
17
19
|
readonly APPROVAL_REQUIRED: "agent:approval_required";
|
|
20
|
+
/** The model began thinking: until it ends, the turn is planning, not acting. */
|
|
21
|
+
readonly REASONING_STARTED: "agent:reasoning_started";
|
|
22
|
+
/** The summary of the model's thinking as it streams, where the host asked the model for one. */
|
|
23
|
+
readonly REASONING_DELTA: "agent:reasoning_delta";
|
|
24
|
+
/** The model stopped thinking: what follows is text or a call. */
|
|
25
|
+
readonly REASONING_ENDED: "agent:reasoning_ended";
|
|
18
26
|
};
|
|
19
27
|
export declare const PLATFORM_EVENTS: EventDeclarationDocument;
|
|
20
28
|
//# sourceMappingURL=platform.d.ts.map
|
package/dist/platform.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAUA,OAAO,EAAa,KAAK,wBAAwB,EAAmB,MAAM,YAAY,CAAC;AAEvF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAUA,OAAO,EAAa,KAAK,wBAAwB,EAAmB,MAAM,YAAY,CAAC;AAEvF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB;;;;IAI5B,qIAAqI;;;;;;;IAOrI,0HAA0H;;IAE1H,iFAAiF;;IAEjF,iGAAiG;;IAEjG,kEAAkE;;CAE1D,CAAC;AAkBX,eAAO,MAAM,eAAe,EAAE,wBAwI7B,CAAC"}
|
package/dist/platform.js
CHANGED
|
@@ -18,6 +18,8 @@ export const AGENT_TURN_EVENTS = {
|
|
|
18
18
|
TURN_STARTED: 'agent:turn_started',
|
|
19
19
|
TOKEN: 'agent:token',
|
|
20
20
|
TOKEN_CLEAR: 'agent:token_clear',
|
|
21
|
+
/** A round (one model step) of the turn ended, after all of its text: whether it called tools, and whether it is the turn's last. */
|
|
22
|
+
ROUND_END: 'agent:round_end',
|
|
21
23
|
TOOL_CALL_STARTED: 'agent:tool_call_started',
|
|
22
24
|
TOOL_CALL_COMPLETE: 'agent:tool_call_complete',
|
|
23
25
|
TURN_COMPLETE: 'agent:turn_complete',
|
|
@@ -25,9 +27,16 @@ export const AGENT_TURN_EVENTS = {
|
|
|
25
27
|
ERROR: 'agent:error',
|
|
26
28
|
/** The turn stopped at a call that needs the user's approval; the payload is agent-sdk-core's `ApprovalRequiredEvent`. */
|
|
27
29
|
APPROVAL_REQUIRED: 'agent:approval_required',
|
|
30
|
+
/** The model began thinking: until it ends, the turn is planning, not acting. */
|
|
31
|
+
REASONING_STARTED: 'agent:reasoning_started',
|
|
32
|
+
/** The summary of the model's thinking as it streams, where the host asked the model for one. */
|
|
33
|
+
REASONING_DELTA: 'agent:reasoning_delta',
|
|
34
|
+
/** The model stopped thinking: what follows is text or a call. */
|
|
35
|
+
REASONING_ENDED: 'agent:reasoning_ended',
|
|
28
36
|
};
|
|
29
37
|
const turnId = { type: 'string', minLength: 1, description: 'The turn the event belongs to.' };
|
|
30
38
|
const timestamp = { type: 'number', description: 'When it happened, epoch ms.' };
|
|
39
|
+
const step = { type: 'integer', minimum: 0, description: 'The round (model step) of the turn, from 0.' };
|
|
31
40
|
const turnEvent = (description, properties, required) => ({
|
|
32
41
|
description,
|
|
33
42
|
payload: {
|
|
@@ -45,7 +54,15 @@ export const PLATFORM_EVENTS = {
|
|
|
45
54
|
description: "The agent worker's turn events and UI action dispatches, emitted to the room of the turn they belong to.",
|
|
46
55
|
rooms: {},
|
|
47
56
|
events: {
|
|
48
|
-
[AGENT_TURN_EVENTS.TOKEN]: turnEvent('Reply text as it streams: the next piece, not the whole reply.', { text: { type: 'string' } }, ['text']),
|
|
57
|
+
[AGENT_TURN_EVENTS.TOKEN]: turnEvent('Reply text as it streams: the next piece, not the whole reply. Each piece belongs to one round, which `step` names.', { text: { type: 'string' }, step }, ['text']),
|
|
58
|
+
[AGENT_TURN_EVENTS.ROUND_END]: turnEvent("A round of the turn ended, and all of its text has been sent. A consumer that shows or speaks only the turn's last word holds each round's text until this, and keeps it when `final`.", {
|
|
59
|
+
step,
|
|
60
|
+
calledTools: { type: 'boolean', description: 'The round called tools.' },
|
|
61
|
+
final: {
|
|
62
|
+
type: 'boolean',
|
|
63
|
+
description: "No round follows it: its text is the turn's last word. A round that ended at an approval, a choice for the person or the hand-back for time is final though it called a tool.",
|
|
64
|
+
},
|
|
65
|
+
}, ['step', 'calledTools', 'final']),
|
|
49
66
|
[AGENT_TURN_EVENTS.TOOL_CALL_STARTED]: turnEvent('A tool call began.', {
|
|
50
67
|
toolUseId: { type: 'string', description: 'The call id, which its completion repeats.' },
|
|
51
68
|
name: { type: 'string', description: 'The tool.' },
|
|
@@ -66,7 +83,15 @@ export const PLATFORM_EVENTS = {
|
|
|
66
83
|
enum: ['user_stop', 'superseded', 'deadline'],
|
|
67
84
|
description: 'Set when the turn did not end by itself: the person stopped it, a newer message superseded it, or it ran out of time.',
|
|
68
85
|
},
|
|
86
|
+
endReason: {
|
|
87
|
+
type: 'string',
|
|
88
|
+
enum: ['complete', 'present_options', 'awaiting_approval', 'time_limit', 'output_limit', 'step_count'],
|
|
89
|
+
description: 'How a turn that ended by itself ended: it answered, it asked the person to choose or approve, it handed back for time, it was cut off at the output limit, or it used every step.',
|
|
90
|
+
},
|
|
69
91
|
}, []),
|
|
92
|
+
[AGENT_TURN_EVENTS.REASONING_STARTED]: turnEvent('The model began thinking. Its end, with the same id, follows before any text or call of that step.', { reasoningId: { type: 'string', minLength: 1, description: 'The thinking block, which its deltas and end repeat.' } }, ['reasoningId']),
|
|
93
|
+
[AGENT_TURN_EVENTS.REASONING_DELTA]: turnEvent("The summary of the model's thinking as it streams: the next piece, not the whole. Sent only when the model returns one.", { reasoningId: { type: 'string', minLength: 1 }, text: { type: 'string', minLength: 1 } }, ['reasoningId', 'text']),
|
|
94
|
+
[AGENT_TURN_EVENTS.REASONING_ENDED]: turnEvent('The model stopped thinking.', { reasoningId: { type: 'string', minLength: 1 } }, ['reasoningId']),
|
|
70
95
|
[AGENT_TURN_EVENTS.TURN_ERROR]: turnEvent('The turn failed.', {
|
|
71
96
|
error: {
|
|
72
97
|
type: 'object',
|
|
@@ -87,6 +112,7 @@ export const PLATFORM_EVENTS = {
|
|
|
87
112
|
consequence: { type: 'string' },
|
|
88
113
|
arguments: { type: 'array', items: { type: 'object' } },
|
|
89
114
|
readback: { type: 'string' },
|
|
115
|
+
spokenReadback: { type: 'string', description: 'The readback as a voice should say it, when the host wrote one.' },
|
|
90
116
|
},
|
|
91
117
|
required: ['title', 'arguments', 'readback'],
|
|
92
118
|
},
|
package/dist/platform.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.js","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,SAAS,EAAkD,MAAM,YAAY,CAAC;AAEvF;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,YAAY,EAAE,oBAAoB;IAClC,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,mBAAmB;IAChC,iBAAiB,EAAE,yBAAyB;IAC5C,kBAAkB,EAAE,0BAA0B;IAC9C,aAAa,EAAE,qBAAqB;IACpC,UAAU,EAAE,kBAAkB;IAC9B,KAAK,EAAE,aAAa;IACpB,0HAA0H;IAC1H,iBAAiB,EAAE,yBAAyB;
|
|
1
|
+
{"version":3,"file":"platform.js","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,SAAS,EAAkD,MAAM,YAAY,CAAC;AAEvF;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,YAAY,EAAE,oBAAoB;IAClC,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,mBAAmB;IAChC,qIAAqI;IACrI,SAAS,EAAE,iBAAiB;IAC5B,iBAAiB,EAAE,yBAAyB;IAC5C,kBAAkB,EAAE,0BAA0B;IAC9C,aAAa,EAAE,qBAAqB;IACpC,UAAU,EAAE,kBAAkB;IAC9B,KAAK,EAAE,aAAa;IACpB,0HAA0H;IAC1H,iBAAiB,EAAE,yBAAyB;IAC5C,iFAAiF;IACjF,iBAAiB,EAAE,yBAAyB;IAC5C,iGAAiG;IACjG,eAAe,EAAE,uBAAuB;IACxC,kEAAkE;IAClE,eAAe,EAAE,uBAAuB;CAChC,CAAC;AAEX,MAAM,MAAM,GAAe,EAAE,IAAI,EAAE,QAAQ,EAAE,SAA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,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBAC1B,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBAC7B,MAAM,EAAE;wBACN,IAAI,EAAE,QAAQ;wBACd,SAAS,EAAE,CAAC;wBACZ,WAAW,EAAE,kFAAkF;qBAChG;iBACF;gBACD,QAAQ,EAAE,CAAC,WAAW,EAAE,WAAW,EAAE,UAAU,CAAC;aACjD;YACD,KAAK,EAAE,CAAC,SAAS,CAAC;YAClB,WAAW,EAAE,CAAC,WAAW,CAAC;YAC1B,IAAI,EAAE,QAAQ;SACf;KACF;CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ouispec/agent-events",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "Event contracts the product declares: each event's payload schema, rooms, correlation and job role; the catalog the realtime server, the worker's async tools and the UI's job tracker follow; the platform's own turn events; payload validation and TypeScript generation",
|
|
5
5
|
"homepage": "https://github.com/wesreid/oui/tree/main/packages/agent-events#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"ajv": "^8.17.0",
|
|
46
46
|
"ajv-formats": "^3.0.1",
|
|
47
|
-
"@ouispec/contract": "^0.4.
|
|
47
|
+
"@ouispec/contract": "^0.4.8",
|
|
48
48
|
"oui-spec": "^0.11.1"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|