@adonis-agora/agent 0.56.0 → 0.57.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.
@@ -1,202 +0,0 @@
1
- /**
2
- * The slice of AG-UI 1.0 (https://docs.ag-ui.com/spec/1.0) this producer writes and reads. Typed by
3
- * hand rather than imported: the agent package takes no dependency on an AG-UI SDK, and the wire
4
- * shape is pinned by the protocol's own JSON Schema, which the tests validate every emitted event
5
- * against (`test/fixtures/ag-ui/schema-1.0.json`).
6
- *
7
- * Optional members are OMITTED when there is nothing to say, never `null` — the protocol's
8
- * "absent means absent" rule.
9
- */
10
- /** The protocol version this producer declares on `RUN_STARTED`. */
11
- export declare const AG_UI_PROTOCOL_VERSION = "1.0";
12
- export type AgUiMetadata = Record<string, unknown>;
13
- /** One provider-and-model's token usage, in the protocol's single accounting. */
14
- export interface AgUiTokenUsage {
15
- provider?: string;
16
- model?: string;
17
- /** Every prompt token, cached or not. */
18
- inputTokens?: number;
19
- /** Every generated token, reasoning included. */
20
- outputTokens?: number;
21
- totalTokens?: number;
22
- /** Part of `outputTokens`. */
23
- reasoningTokens?: number;
24
- /** Cache reads — part of `inputTokens`. */
25
- cachedInputTokens?: number;
26
- /** Cache writes — part of `inputTokens`, disjoint from the reads. */
27
- cacheWriteInputTokens?: number;
28
- }
29
- /** What an interrupted run is waiting for; a resume entry answers it by `id`. */
30
- export interface AgUiInterrupt {
31
- id: string;
32
- /** Open string. This producer writes `tool_approval` and `input_required`. */
33
- reason: string;
34
- message?: string;
35
- toolCallId?: string;
36
- responseSchema?: Record<string, unknown>;
37
- expiresAt?: string;
38
- metadata?: AgUiMetadata;
39
- }
40
- export type AgUiRunOutcome = {
41
- type: 'success';
42
- pendingToolCallIds?: string[];
43
- } | {
44
- type: 'interrupt';
45
- interrupts: AgUiInterrupt[];
46
- } | {
47
- type: 'cancelled';
48
- };
49
- interface Base {
50
- metadata?: AgUiMetadata;
51
- }
52
- export type AgUiEvent = (Base & {
53
- type: 'RUN_STARTED';
54
- threadId: string;
55
- runId: string;
56
- protocolVersion?: string;
57
- }) | (Base & {
58
- type: 'RUN_FINISHED';
59
- threadId: string;
60
- runId: string;
61
- outcome?: AgUiRunOutcome;
62
- usage?: AgUiTokenUsage[];
63
- }) | (Base & {
64
- type: 'RUN_ERROR';
65
- message: string;
66
- code?: string;
67
- usage?: AgUiTokenUsage[];
68
- }) | (Base & {
69
- type: 'STEP_STARTED';
70
- stepName: string;
71
- }) | (Base & {
72
- type: 'STEP_FINISHED';
73
- stepName: string;
74
- }) | (Base & {
75
- type: 'TEXT_MESSAGE_START';
76
- messageId: string;
77
- role: 'assistant';
78
- }) | (Base & {
79
- type: 'TEXT_MESSAGE_CONTENT';
80
- messageId: string;
81
- delta: string;
82
- }) | (Base & {
83
- type: 'TEXT_MESSAGE_END';
84
- messageId: string;
85
- }) | (Base & {
86
- type: 'REASONING_START';
87
- messageId: string;
88
- }) | (Base & {
89
- type: 'REASONING_MESSAGE_START';
90
- messageId: string;
91
- role: 'reasoning';
92
- }) | (Base & {
93
- type: 'REASONING_MESSAGE_CONTENT';
94
- messageId: string;
95
- delta: string;
96
- }) | (Base & {
97
- type: 'REASONING_MESSAGE_END';
98
- messageId: string;
99
- }) | (Base & {
100
- type: 'REASONING_END';
101
- messageId: string;
102
- }) | (Base & {
103
- type: 'TOOL_CALL_START';
104
- toolCallId: string;
105
- toolCallName: string;
106
- parentMessageId?: string;
107
- }) | (Base & {
108
- type: 'TOOL_CALL_ARGS';
109
- toolCallId: string;
110
- delta: string;
111
- }) | (Base & {
112
- type: 'TOOL_CALL_END';
113
- toolCallId: string;
114
- }) | (Base & {
115
- type: 'TOOL_CALL_RESULT';
116
- messageId: string;
117
- toolCallId: string;
118
- content: string;
119
- role: 'tool';
120
- }) | (Base & {
121
- type: 'CUSTOM';
122
- name: string;
123
- value: unknown;
124
- });
125
- /** Where a media part's bytes are. Closed set: an unknown `type` is malformed input. */
126
- export type AgUiPartSource = {
127
- type: 'data';
128
- value: string;
129
- mimeType: string;
130
- } | {
131
- type: 'url';
132
- value: string;
133
- mimeType?: string;
134
- } | {
135
- type: 'file';
136
- value: string;
137
- provider?: string;
138
- mimeType?: string;
139
- };
140
- export type AgUiContentPart = {
141
- type: 'text';
142
- text: string;
143
- id?: string;
144
- metadata?: unknown;
145
- } | {
146
- type: 'image' | 'audio' | 'video' | 'document';
147
- source: AgUiPartSource;
148
- id?: string;
149
- metadata?: unknown;
150
- };
151
- export interface AgUiMessage {
152
- id: string;
153
- role: string;
154
- content?: string | AgUiContentPart[];
155
- [key: string]: unknown;
156
- }
157
- export interface AgUiResumeEntry {
158
- interruptId: string;
159
- status: 'resolved' | 'cancelled';
160
- payload?: unknown;
161
- metadata?: AgUiMetadata;
162
- }
163
- export interface AgUiContext {
164
- description: string;
165
- value: string;
166
- }
167
- /** `RunAgentInput`: the one message that travels from the application to the agent. */
168
- export interface AgUiRunInput {
169
- threadId: string;
170
- runId: string;
171
- protocolVersion?: string;
172
- parentRunId?: string;
173
- state?: unknown;
174
- messages: AgUiMessage[];
175
- tools?: unknown[];
176
- context?: AgUiContext[];
177
- forwardedProps?: unknown;
178
- resume?: AgUiResumeEntry[];
179
- }
180
- /**
181
- * The names of the `CUSTOM` events this producer writes for what AG-UI does not model. Prefixed, as
182
- * the protocol asks of invented names; a consumer that does not know one ignores it.
183
- */
184
- export declare const AG_UI_CUSTOM: {
185
- /** `{ runId, threadId }` — the library's own ids for the run behind this stream (cancel, re-attach). */
186
- readonly run: 'agora.run';
187
- /** A generative-UI component (`AgentUiComponent`); a repeat `id` replaces. */
188
- readonly ui: 'agora.ui';
189
- readonly title: 'agora.title';
190
- readonly queue: 'agora.queue';
191
- /** The approval request as the native protocol carries it, for a consumer that renders it live. */
192
- readonly approvalRequested: 'agora.approval-requested';
193
- readonly approvalSettled: 'agora.approval-settled';
194
- /** The whole question set of an elicitation (`ElicitationRequest`). */
195
- readonly elicitation: 'agora.elicitation';
196
- /** `{ usage, costUsd, reasoningMs }` of one model step. */
197
- readonly stepUsage: 'agora.step-usage';
198
- /** `{ message }` — input material this producer could not use and dropped. */
199
- readonly warning: 'agora.warning';
200
- };
201
- export {};
202
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/ag-ui/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,oEAAoE;AACpE,eAAO,MAAM,sBAAsB,QAAQ,CAAC;AAE5C,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEnD,iFAAiF;AACjF,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yCAAyC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iDAAiD;IACjD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8BAA8B;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,2CAA2C;IAC3C,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,qEAAqE;IACrE,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,iFAAiF;AACjF,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,8EAA8E;IAC9E,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,YAAY,CAAC;CACzB;AAED,MAAM,MAAM,cAAc,GACtB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAA;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AC;CACzB;AAED,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,uFAAuF;AACvF,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,WAAW,EAAE,CAAC;IACxB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,MAAM,CAAC,EAAE,eAAe,EAAE,CAAC;CAC5B;AAED;;;GAGG;AACH,eAAO,MAAM,YAAY;IACvB,wGAAwG;aACxG,GAAG,EAAE,WAAW;IAChB,8EAA8E;aAC9E,EAAE,EAAE,UAAU;aACd,KAAK,EAAE,aAAa;aACpB,KAAK,EAAE,aAAa;IACpB,mGAAmG;aACnG,iBAAiB,EAAE,0BAA0B;aAC7C,eAAe,EAAE,wBAAwB;IACzC,uEAAuE;aACvE,WAAW,EAAE,mBAAmB;IAChC,2DAA2D;aAC3D,SAAS,EAAE,kBAAkB;IAC7B,8EAA8E;aAC9E,OAAO,EAAE,eAAe;CAChB,CAAC"}
@@ -1,33 +0,0 @@
1
- /**
2
- * The slice of AG-UI 1.0 (https://docs.ag-ui.com/spec/1.0) this producer writes and reads. Typed by
3
- * hand rather than imported: the agent package takes no dependency on an AG-UI SDK, and the wire
4
- * shape is pinned by the protocol's own JSON Schema, which the tests validate every emitted event
5
- * against (`test/fixtures/ag-ui/schema-1.0.json`).
6
- *
7
- * Optional members are OMITTED when there is nothing to say, never `null` — the protocol's
8
- * "absent means absent" rule.
9
- */
10
- /** The protocol version this producer declares on `RUN_STARTED`. */
11
- export const AG_UI_PROTOCOL_VERSION = '1.0';
12
- /**
13
- * The names of the `CUSTOM` events this producer writes for what AG-UI does not model. Prefixed, as
14
- * the protocol asks of invented names; a consumer that does not know one ignores it.
15
- */
16
- export const AG_UI_CUSTOM = {
17
- /** `{ runId, threadId }` — the library's own ids for the run behind this stream (cancel, re-attach). */
18
- run: 'agora.run',
19
- /** A generative-UI component (`AgentUiComponent`); a repeat `id` replaces. */
20
- ui: 'agora.ui',
21
- title: 'agora.title',
22
- queue: 'agora.queue',
23
- /** The approval request as the native protocol carries it, for a consumer that renders it live. */
24
- approvalRequested: 'agora.approval-requested',
25
- approvalSettled: 'agora.approval-settled',
26
- /** The whole question set of an elicitation (`ElicitationRequest`). */
27
- elicitation: 'agora.elicitation',
28
- /** `{ usage, costUsd, reasoningMs }` of one model step. */
29
- stepUsage: 'agora.step-usage',
30
- /** `{ message }` — input material this producer could not use and dropped. */
31
- warning: 'agora.warning',
32
- };
33
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/ag-ui/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,oEAAoE;AACpE,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,CAAC;AA+H5C;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,wGAAwG;IACxG,GAAG,EAAE,WAAW;IAChB,8EAA8E;IAC9E,EAAE,EAAE,UAAU;IACd,KAAK,EAAE,aAAa;IACpB,KAAK,EAAE,aAAa;IACpB,mGAAmG;IACnG,iBAAiB,EAAE,0BAA0B;IAC7C,eAAe,EAAE,wBAAwB;IACzC,uEAAuE;IACvE,WAAW,EAAE,mBAAmB;IAChC,2DAA2D;IAC3D,SAAS,EAAE,kBAAkB;IAC7B,8EAA8E;IAC9E,OAAO,EAAE,eAAe;CAChB,CAAC"}