@artooi/ag-ui-web-component 0.39.0 → 0.41.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/CHANGELOG.md +208 -1
- package/README.md +116 -36
- package/dist/ag-ui-web-component.bundle.js +255 -101
- package/dist/ag-ui-web-component.bundle.js.map +4 -4
- package/dist/constants.d.ts +3 -2
- package/dist/constants.d.ts.map +1 -1
- package/dist/core/ag_ui_chat.d.ts +7 -3
- package/dist/core/ag_ui_chat.d.ts.map +1 -1
- package/dist/core/agui_client.d.ts +29 -8
- package/dist/core/agui_client.d.ts.map +1 -1
- package/dist/core/attachment.d.ts +11 -4
- package/dist/core/attachment.d.ts.map +1 -1
- package/dist/core/client_seed.d.ts +14 -2
- package/dist/core/client_seed.d.ts.map +1 -1
- package/dist/core/tool_outcome.d.ts +4 -3
- package/dist/core/tool_outcome.d.ts.map +1 -1
- package/dist/core/utils.d.ts +19 -0
- package/dist/core/utils.d.ts.map +1 -1
- package/dist/index.js +1078 -664
- package/dist/index.js.map +4 -4
- package/dist/tools/tool_catalog.d.ts.map +1 -1
- package/dist/ui/composer/composer_attachments.d.ts +6 -1
- package/dist/ui/composer/composer_attachments.d.ts.map +1 -1
- package/dist/ui/composer/composer_voice.d.ts +3 -0
- package/dist/ui/composer/composer_voice.d.ts.map +1 -1
- package/dist/ui/excerpts/transcript_quote_offer.d.ts +7 -2
- package/dist/ui/excerpts/transcript_quote_offer.d.ts.map +1 -1
- package/dist/ui/history/conversation_history.d.ts +30 -4
- package/dist/ui/history/conversation_history.d.ts.map +1 -1
- package/dist/ui/placement/launcher_drag.d.ts +6 -0
- package/dist/ui/placement/launcher_drag.d.ts.map +1 -1
- package/dist/ui/placement/panel_placement.d.ts +1 -1
- package/dist/ui/placement/panel_placement.d.ts.map +1 -1
- package/dist/ui/styles.d.ts +1 -1
- package/dist/ui/styles.d.ts.map +1 -1
- package/dist/ui/transcript/transcript.d.ts +3 -2
- package/dist/ui/transcript/transcript.d.ts.map +1 -1
- package/dist/ui/ui_strings.d.ts +2 -0
- package/dist/ui/ui_strings.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/constants.ts +3 -2
- package/src/core/ag_ui_chat.ts +217 -64
- package/src/core/agui_client.ts +155 -125
- package/src/core/attachment.ts +13 -5
- package/src/core/client_seed.ts +14 -2
- package/src/core/tool_outcome.ts +4 -3
- package/src/core/utils.ts +23 -0
- package/src/tools/tool_catalog.ts +63 -12
- package/src/ui/composer/composer_attachments.ts +64 -41
- package/src/ui/composer/composer_voice.ts +5 -0
- package/src/ui/excerpts/transcript_quote_offer.ts +26 -13
- package/src/ui/history/conversation_history.ts +149 -38
- package/src/ui/placement/launcher_drag.ts +104 -89
- package/src/ui/placement/panel_placement.ts +27 -3
- package/src/ui/styles.ts +137 -14
- package/src/ui/transcript/transcript.ts +10 -5
- package/src/ui/ui_strings.ts +3 -0
- package/src/version.ts +1 -1
package/dist/constants.d.ts
CHANGED
|
@@ -245,7 +245,8 @@ export declare const TOOL_CALL_STATUS: {
|
|
|
245
245
|
readonly INTERRUPTED: "interrupted";
|
|
246
246
|
};
|
|
247
247
|
/**
|
|
248
|
-
* How a tool call ended, as the server states it
|
|
248
|
+
* How a tool call ended, as the server states it under `outcome` in a
|
|
249
|
+
* `TOOL_CALL_RESULT`'s `metadata`.
|
|
249
250
|
*
|
|
250
251
|
* The vocabulary is pydantic-ai's own `ToolReturnPart.outcome`, carried whole
|
|
251
252
|
* rather than re-spelled, so the four repos that pass a refusal along agree on
|
|
@@ -254,7 +255,7 @@ export declare const TOOL_CALL_STATUS: {
|
|
|
254
255
|
* **Absent means {@link TOOL_OUTCOME.SUCCESS}, and that is load-bearing.** Every
|
|
255
256
|
* server written before the field existed omits it, so a missing field has to
|
|
256
257
|
* render exactly as a plain result did — which is why this is an optional
|
|
257
|
-
*
|
|
258
|
+
* key in the event's metadata and not a required field. `FAILED` is a call that ran
|
|
258
259
|
* and failed; `DENIED` is one a person or a guard refused, so it never ran at
|
|
259
260
|
* all. The two are worth distinguishing on screen because only the second is
|
|
260
261
|
* something the user did. `INTERRUPTED` is a call that produced no result because
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAGA,wEAAwE;AACxE,eAAO,MAAM,WAAW,eAAe,CAAC;AAExC,kEAAkE;AAClE,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAE3C;;;;GAIG;AACH,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAE3C;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,gBAAgB,CAAC;AAEzC;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,sBAAsB,CAAC;AAEpD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,kBAAkB,uBAAuB,CAAC;AAEvD;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,kBAAkB,iBAAiB,CAAC;AAEjD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AAEnD;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAE/C;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,gBAAgB,CAAC;AAEvD;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,qBAAqB,CAAC;AAEzD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,oBAAoB,mBAAmB,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,cAAc;aACzB,OAAO,EAAE,SAAS;aAClB,SAAS,EAAE,WAAW;aACtB,WAAW,EAAE,aAAa;aAC1B,QAAQ,EAAE,UAAU;aACpB,MAAM,EAAE,QAAQ;CACR,CAAC;AAEX,qCAAqC;AACrC,eAAO,MAAM,YA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,MAAqI,CAAC;AAE/J,eAAe;AACf,eAAO,MAAM,aAAa,EAAE,MAAmM,CAAC;AAEhO,4EAA4E;AAC5E,eAAO,MAAM,eAAe,EAAE,MAAiM,CAAC;AAEhO,eAAO,MAAM,SAAS,0KAAgK,CAAC;AAEvL,sEAAsE;AACtE,eAAO,MAAM,eAAe,kOAA0M,CAAC;AAEvO,sEAAsE;AACtE,eAAO,MAAM,aAAa,iQAA2O,CAAC;AAEtQ,gDAAgD;AAChD,eAAO,MAAM,cAAc,8MAAkM,CAAC;AAE9N;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,UAAU,CAAC;AAE3C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,WAAW,KAAK,CAAC;AAE9B;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAErC;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,aAAa,CAAC;AAEpD;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,OAAO,CAAC;AAEvC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,kBAAkB,IAAI,CAAC"}
|
|
@@ -105,6 +105,8 @@ export declare class AgUiChat extends HTMLElement {
|
|
|
105
105
|
* Optional full replacement for the `ask_user` question UI, resolving with
|
|
106
106
|
* the answer; the same seam as {@link approvalRenderer}, styled via `strings`
|
|
107
107
|
* and the `question*` `::part()`s when left unset. Requires {@link askUser}.
|
|
108
|
+
* A renderer that throws or rejects hands the question to the built-in card,
|
|
109
|
+
* as a failing {@link approvalRenderer} does, unless Stop already fired.
|
|
108
110
|
*/
|
|
109
111
|
askUserRenderer: QuestionRenderer | null;
|
|
110
112
|
/**
|
|
@@ -549,9 +551,11 @@ export declare class AgUiChat extends HTMLElement {
|
|
|
549
551
|
* `attachments` are durable {@link AttachmentRef}s — what {@link attachFile}
|
|
550
552
|
* resolves to and what {@link ATTACHMENT_EVENT} reports.
|
|
551
553
|
*
|
|
552
|
-
* No-ops on an empty message, and while a run
|
|
553
|
-
*
|
|
554
|
-
*
|
|
554
|
+
* No-ops on an empty message, and while a run or a picked checkpoint's
|
|
555
|
+
* continuation is in flight, since a second concurrent run would orphan the
|
|
556
|
+
* first. Unlike the built-in Send it does not queue: it returns, and the
|
|
557
|
+
* caller keeps what it tried to send. Nor does it consult the tray -- what
|
|
558
|
+
* you pass is what is sent.
|
|
555
559
|
*/
|
|
556
560
|
sendMessage(content: string, attachments?: readonly AttachmentRef[]): Promise<void>;
|
|
557
561
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ag_ui_chat.d.ts","sourceRoot":"","sources":["../../src/core/ag_ui_chat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"ag_ui_chat.d.ts","sourceRoot":"","sources":["../../src/core/ag_ui_chat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAoBjD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAGhD,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAEzF,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAEnE,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAwB,KAAK,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE1E,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AActD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAG5E,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAG1E,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAQ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,CAMxB;IAED;;;;;;;;;;;OAWG;IACH,OAAO,IAAI,IAAI,CAsBd;IA8DD;;;;;;;;;;;;;;;OAeG;IACG,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC,CAmBtC;IAED;;;;;;;;;OASG;IACH,aAAa,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,cAAc,CAEhE;IA+mBD;;;;;;;;;;;;;;;;OAgBG;IACG,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,GAAE,SAAS,aAAa,EAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CA6B5F;IAED;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAE9B;IAqID;;;;;;;;;;;;;;;;;OAiBG;IACH,YAAY,CAAC,MAAM,GAAE,SAAS,CAAC,MAAM,GAAG,UAAU,CAAC,EAAyB,GAAG,IAAI,CA0BlF;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,wBAAwB,CAAC,YAAY,EAAE,oBAAoB,GAAG,IAAI,CAEjE;IAED;;;;;;;;OAQG;IACH,IAAI,sBAAsB,IAAI,SAAS,MAAM,EAAE,CAE9C;CACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type AbstractAgent } from "@ag-ui/client";
|
|
2
|
-
import type
|
|
2
|
+
import { type Context, type Interrupt, type Message, type Tool } from "@ag-ui/core";
|
|
3
3
|
import type { AttachmentRef } from "./attachment.js";
|
|
4
4
|
import type { ToolOutcome } from "./tool_outcome.js";
|
|
5
5
|
/** A tool call surfaced to the host by {@link AgUiClient}. */
|
|
@@ -80,11 +80,17 @@ export interface AgUiClientHandlers {
|
|
|
80
80
|
* `TOOL_CALL_RESULT`). Frontend tools don't emit this — the client supplies
|
|
81
81
|
* their result itself — so this is the channel for server-executed output.
|
|
82
82
|
*
|
|
83
|
-
* `outcome` is the event's
|
|
84
|
-
* `unknown` rather than {@link ToolOutcome} because
|
|
85
|
-
*
|
|
86
|
-
* this signature honestly claim to. Read it with
|
|
87
|
-
* which treats `undefined` and anything unrecognised
|
|
83
|
+
* `outcome` is the `outcome` key of the event's `metadata`, forwarded raw.
|
|
84
|
+
* It is `unknown` rather than {@link ToolOutcome} because metadata is open by
|
|
85
|
+
* key: the protocol declares the object and validates nothing inside it, so
|
|
86
|
+
* neither can this signature honestly claim to. Read it with
|
|
87
|
+
* `toolStatusFromOutcome`, which treats `undefined` and anything unrecognised
|
|
88
|
+
* as a success.
|
|
89
|
+
*
|
|
90
|
+
* Only the metadata is read. A server written against `@ag-ui/client` 0.x
|
|
91
|
+
* states the outcome at the top level of the event, and 1.0 strips that key
|
|
92
|
+
* before any subscriber runs, so from such a server this is `undefined` and
|
|
93
|
+
* the card settles as done.
|
|
88
94
|
*
|
|
89
95
|
* Added as a third parameter rather than as a new callback, so an
|
|
90
96
|
* implementation written against the two-parameter form still satisfies this
|
|
@@ -287,8 +293,9 @@ export declare class AgUiClient {
|
|
|
287
293
|
* tools (bounded by {@link AgUiClientConfig.maxToolRounds}, which defaults to
|
|
288
294
|
* {@link MAX_TOOL_ROUNDS}).
|
|
289
295
|
*
|
|
290
|
-
* `attachments` ride
|
|
291
|
-
*
|
|
296
|
+
* `attachments` ride in the user message's `metadata`, under
|
|
297
|
+
* `attachments`, which is how the server learns which files the agent can
|
|
298
|
+
* read and how the default store round-trips them for history replay; see
|
|
292
299
|
* {@link messageAttachments}.
|
|
293
300
|
*/
|
|
294
301
|
send(content: string, attachments?: readonly AttachmentRef[]): Promise<void>;
|
|
@@ -328,5 +335,19 @@ export declare class AgUiClient {
|
|
|
328
335
|
* instead of `onError`, and `onSettled` still follows.
|
|
329
336
|
*/
|
|
330
337
|
cancel(): void;
|
|
338
|
+
/**
|
|
339
|
+
* The history in the form a save writes it, which is now {@link messages}
|
|
340
|
+
* itself.
|
|
341
|
+
*
|
|
342
|
+
* It differed while this client kept how each tool call ended in a side table
|
|
343
|
+
* and annotated a copy for the store, because `@ag-ui/client` 0.x kept nothing
|
|
344
|
+
* but five named fields of a result. 1.0 folds a result's `metadata` onto the
|
|
345
|
+
* message it appends, so the outcome is on the message and there is no copy
|
|
346
|
+
* left to make.
|
|
347
|
+
*
|
|
348
|
+
* @deprecated Read {@link messages}. Kept so a caller written against the
|
|
349
|
+
* getter keeps compiling and gets the same list.
|
|
350
|
+
*/
|
|
351
|
+
get annotatedMessages(): readonly Message[];
|
|
331
352
|
}
|
|
332
353
|
//# sourceMappingURL=agui_client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agui_client.d.ts","sourceRoot":"","sources":["../../src/core/agui_client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAKnB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"agui_client.d.ts","sourceRoot":"","sources":["../../src/core/agui_client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAKnB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,KAAK,OAAO,EAEZ,KAAK,SAAS,EACd,KAAK,OAAO,EAEZ,KAAK,IAAI,EACV,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD,8DAA8D;AAC9D,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACxC;AAED,mFAAmF;AACnF,MAAM,WAAW,aAAa;IAC5B,wDAAwD;IACxD,OAAO,EAAE,MAAM,CAAC;IAChB,6DAA6D;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;;;;;OAUG;IAC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,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAGvD;IAED;;;;;;OAMG;IACH,MAAM,IAAI,IAAI,CAGb;IA8ID;;;;;;;;;;;;OAYG;IACH,IAAI,iBAAiB,IAAI,SAAS,OAAO,EAAE,CAE1C;CA0RF"}
|
|
@@ -22,10 +22,17 @@ export interface AttachmentRef {
|
|
|
22
22
|
/**
|
|
23
23
|
* The attachment refs a user message carries.
|
|
24
24
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
25
|
+
* `AgUiClient.send` writes them into the message's `metadata`, under
|
|
26
|
+
* `attachments`. That is the one place they survive the trip: `@ag-ui/client`
|
|
27
|
+
* 1.0 strips every key its schemas do not declare from the outgoing input, so
|
|
28
|
+
* refs written at the top level of the message never reach the server, while
|
|
29
|
+
* `metadata` is declared open by key and sent as it is. The server reads them
|
|
30
|
+
* from there to tell the agent which files it can read, and the default store
|
|
31
|
+
* round-trips them, so a restored conversation re-renders its chips.
|
|
32
|
+
*
|
|
33
|
+
* A conversation stored by an earlier release has them at the top level, so
|
|
34
|
+
* that is read when the metadata has none. An older server reads only the top
|
|
35
|
+
* level, so against one the agent is never told about a file at all.
|
|
29
36
|
*
|
|
30
37
|
* Storage is untrusted — hand-edited, truncated, or corrupted — so malformed
|
|
31
38
|
* entries are dropped here; a shapeless one would throw in `iconFor` and abort
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachment.d.ts","sourceRoot":"","sources":["../../src/core/attachment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"attachment.d.ts","sourceRoot":"","sources":["../../src/core/attachment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAG3C;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B,qEAAqE;IACrE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,kDAAkD;IAClD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,oEAAoE;IACpE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,qBAAqB;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,uEAAuE;IACvE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,aAAa,EAAE,CAG7E"}
|
|
@@ -9,7 +9,19 @@ export interface ClientSeed {
|
|
|
9
9
|
readonly endpoint: string;
|
|
10
10
|
/** The history the agent starts from, and sends with its first run. */
|
|
11
11
|
readonly initialMessages: readonly Message[];
|
|
12
|
-
/**
|
|
13
|
-
|
|
12
|
+
/**
|
|
13
|
+
* The conversation this client's own history continues, which every save
|
|
14
|
+
* writes ahead of it.
|
|
15
|
+
*
|
|
16
|
+
* Empty for the conversation's own client, whose history is the whole
|
|
17
|
+
* conversation. A continuation's history is only the turn it adds and its
|
|
18
|
+
* answer -- the endpoint supplies the rest from its snapshot -- and a store
|
|
19
|
+
* keeps one list per thread, so a save of that history alone would replace
|
|
20
|
+
* the conversation with its last exchange, and not saving it lost the
|
|
21
|
+
* exchange on the next reload.
|
|
22
|
+
*/
|
|
23
|
+
readonly follows: readonly Message[];
|
|
24
|
+
/** Handed the whole conversation each time the client saves it, as written. */
|
|
25
|
+
readonly onSaved?: (conversation: readonly Message[]) => void;
|
|
14
26
|
}
|
|
15
27
|
//# sourceMappingURL=client_seed.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client_seed.d.ts","sourceRoot":"","sources":["../../src/core/client_seed.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,wCAAwC;IACxC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,uEAAuE;IACvE,QAAQ,CAAC,eAAe,EAAE,SAAS,OAAO,EAAE,CAAC;IAC7C,
|
|
1
|
+
{"version":3,"file":"client_seed.d.ts","sourceRoot":"","sources":["../../src/core/client_seed.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,wCAAwC;IACxC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,uEAAuE;IACvE,QAAQ,CAAC,eAAe,EAAE,SAAS,OAAO,EAAE,CAAC;IAC7C;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,OAAO,EAAE,SAAS,OAAO,EAAE,CAAC;IACrC,+EAA+E;IAC/E,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,YAAY,EAAE,SAAS,OAAO,EAAE,KAAK,IAAI,CAAC;CAC/D"}
|
|
@@ -11,9 +11,10 @@ export type ToolOutcome = (typeof TOOL_OUTCOME)[keyof typeof TOOL_OUTCOME];
|
|
|
11
11
|
* The card status a wire outcome settles into.
|
|
12
12
|
*
|
|
13
13
|
* Takes `unknown` rather than {@link ToolOutcome} on purpose: both callers read
|
|
14
|
-
* this off a boundary the type system does not police -- a
|
|
15
|
-
*
|
|
16
|
-
*
|
|
14
|
+
* this off a boundary the type system does not police -- a key in an AG-UI
|
|
15
|
+
* event's `metadata`, which the protocol declares open and does not validate,
|
|
16
|
+
* and a JSON blob out of the conversation store -- so the narrowing belongs
|
|
17
|
+
* here, once, instead of at each of them.
|
|
17
18
|
*
|
|
18
19
|
* **Everything unrecognised maps to `DONE`.** Not because unknown values are
|
|
19
20
|
* expected to be successes, but because the alternative is worse in the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool_outcome.d.ts","sourceRoot":"","sources":["../../src/core/tool_outcome.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEtE;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAE3E
|
|
1
|
+
{"version":3,"file":"tool_outcome.d.ts","sourceRoot":"","sources":["../../src/core/tool_outcome.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEtE;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAE3E;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,aAAa,CAWrE"}
|
package/dist/core/utils.d.ts
CHANGED
|
@@ -95,4 +95,23 @@ export declare function commaTokens(value: string): string[];
|
|
|
95
95
|
* server to answer".
|
|
96
96
|
*/
|
|
97
97
|
export declare function answerUnansweredCalls(messages: readonly Message[], answer: (toolCallId: string) => Message, except?: ReadonlySet<string>): readonly Message[];
|
|
98
|
+
/**
|
|
99
|
+
* A key a message carries in its `metadata`, or the same key at the message's
|
|
100
|
+
* top level when its metadata has none.
|
|
101
|
+
*
|
|
102
|
+
* Two keys are read this way, a tool message's `outcome` and a user message's
|
|
103
|
+
* `attachments`, and both for the same reason. `@ag-ui/client` 1.0 strips every
|
|
104
|
+
* key its schemas do not declare, off an inbound event and off the outgoing
|
|
105
|
+
* input, and `metadata` is the one place it declares open by key, so that is
|
|
106
|
+
* where this component writes them. A conversation stored by an earlier release
|
|
107
|
+
* has them at the top level instead, and a reload has to replay it as it
|
|
108
|
+
* settled.
|
|
109
|
+
*
|
|
110
|
+
* Metadata first, so a message carrying both says what the newer writer said.
|
|
111
|
+
* The result is `unknown` because it comes out of a store, which is not trusted
|
|
112
|
+
* to hold the shape anything here wrote; the caller narrows it. `Object()` boxes
|
|
113
|
+
* an absent, `null` or primitive `metadata` into an object with neither key,
|
|
114
|
+
* which reads as no metadata without a branch per shape.
|
|
115
|
+
*/
|
|
116
|
+
export declare function metadataOrTopLevel(message: Message, key: "outcome" | "attachments"): unknown;
|
|
98
117
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/core/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/core/utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAEvE;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,WAAW,GAAG,SAAS,EAC7B,WAAW,EAAE,kBAAkB,GAAG,SAAS,GAC1C,WAAW,GAAG,SAAS,CAEzB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,uBAAuB,GAAG,MAAM,CAOjE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,4BAA4B,CAC1C,GAAG,EAAE,MAAM,GAAG,GAAG,EACjB,eAAe,EAAE,SAAS,MAAM,EAAE,EAClC,cAAc,EAAE,SAAS,MAAM,EAAE,EACjC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,GAClB,IAAI,CAwBN;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAKnD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,SAAS,OAAO,EAAE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