@artooi/ag-ui-web-component 0.26.0 → 0.27.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 +95 -1
- package/README.md +29 -6
- package/dist/ag-ui-web-component.bundle.js +18 -18
- package/dist/ag-ui-web-component.bundle.js.map +3 -3
- package/dist/core/ag_ui_chat.d.ts +6 -2
- package/dist/core/ag_ui_chat.d.ts.map +1 -1
- package/dist/core/agui_client.d.ts.map +1 -1
- package/dist/core/conversation_store.d.ts +15 -2
- package/dist/core/conversation_store.d.ts.map +1 -1
- package/dist/core/remote_conversation_store.d.ts +6 -0
- package/dist/core/remote_conversation_store.d.ts.map +1 -1
- package/dist/core/utils.d.ts +14 -0
- package/dist/core/utils.d.ts.map +1 -1
- package/dist/index.js +75 -33
- package/dist/index.js.map +3 -3
- package/dist/tools/client_tool_registry.d.ts +10 -1
- package/dist/tools/client_tool_registry.d.ts.map +1 -1
- package/dist/ui/chart_block.d.ts.map +1 -1
- package/dist/ui/chart_spec_from.d.ts.map +1 -1
- package/dist/ui/chart_tool.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/core/ag_ui_chat.ts +48 -19
- package/src/core/agui_client.ts +25 -1
- package/src/core/conversation_store.ts +19 -8
- package/src/core/remote_conversation_store.ts +10 -1
- package/src/core/utils.ts +25 -1
- package/src/tools/client_tool_registry.ts +11 -1
- package/src/ui/chart_block.ts +6 -1
- package/src/ui/chart_spec_from.ts +21 -2
- package/src/ui/chart_tool.ts +13 -5
- package/src/version.ts +1 -1
|
@@ -352,8 +352,12 @@ export declare class AgUiChat extends HTMLElement {
|
|
|
352
352
|
*/
|
|
353
353
|
toggleCheckpoints(): void;
|
|
354
354
|
/**
|
|
355
|
-
* Start a fresh conversation:
|
|
356
|
-
*
|
|
355
|
+
* Start a fresh conversation: drop the in-memory run state, clear the
|
|
356
|
+
* transcript, and mint a new thread id.
|
|
357
|
+
*
|
|
358
|
+
* The conversation being left is kept, and stays in the history drawer to
|
|
359
|
+
* return to. Deleting one is the drawer row's own action; a button that
|
|
360
|
+
* starts something new must not be the button that destroys what was there.
|
|
357
361
|
*/
|
|
358
362
|
newChat(): void;
|
|
359
363
|
/**
|
|
@@ -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,EAAsB,IAAI,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EAUL,YAAY,EAWb,MAAM,iBAAiB,CAAC;AAGzB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"ag_ui_chat.d.ts","sourceRoot":"","sources":["../../src/core/ag_ui_chat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAsB,IAAI,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EAUL,YAAY,EAWb,MAAM,iBAAiB,CAAC;AAGzB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,KAAK,UAAU,EAAsB,MAAM,kCAAkC,CAAC;AAGvF,OAAO,EAAyB,KAAK,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAC9F,OAAO,EAAwB,KAAK,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAwB,KAAK,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAE9E,OAAO,EAAoB,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACxE,OAAO,EACL,KAAK,gBAAgB,EAGtB,MAAM,wBAAwB,CAAC;AAUhC,OAAO,EACL,KAAK,gBAAgB,EAGtB,MAAM,wBAAwB,CAAC;AAchC,OAAO,EAAgB,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC7E,OAAO,EAAsC,KAAK,SAAS,EAAE,MAAM,qBAAqB,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MAAM,GAAG,IAAI,CAGvD;IAED;;;;;;OAMG;IACH,MAAM,IAAI,IAAI,CAGb;CAiPF"}
|
|
@@ -32,12 +32,24 @@ export interface ThreadMeta {
|
|
|
32
32
|
* is a small local hint a server store can derive from history and no-op.
|
|
33
33
|
*
|
|
34
34
|
* Thread enumeration backs the chat-history drawer; deleting a thread reuses
|
|
35
|
-
* {@link clear} and "new chat"
|
|
36
|
-
*
|
|
35
|
+
* {@link clear}, and "new chat" is {@link newThread} — which leaves the
|
|
36
|
+
* conversation it moves off of intact, for the drawer to offer back.
|
|
37
37
|
*/
|
|
38
38
|
export interface ClientConversationStore {
|
|
39
39
|
/** The active conversation id, generated and persisted on first read. */
|
|
40
40
|
threadId(): string;
|
|
41
|
+
/**
|
|
42
|
+
* Start a fresh conversation, make it active, and return its id.
|
|
43
|
+
*
|
|
44
|
+
* Existing threads are left where they are: "new chat" adds one, and
|
|
45
|
+
* {@link clear} is the only method that takes one away.
|
|
46
|
+
*
|
|
47
|
+
* Optional, so a store written before this method existed still works. The
|
|
48
|
+
* caller then mints the id itself and hands it to {@link setActiveThread},
|
|
49
|
+
* which loses only the store's own record that the thread is new (see
|
|
50
|
+
* {@link isUnsent}).
|
|
51
|
+
*/
|
|
52
|
+
newThread?(): string;
|
|
41
53
|
/** Load the persisted message history, or `null` when none exists. */
|
|
42
54
|
loadMessages(threadId: string): Promise<readonly Message[] | null>;
|
|
43
55
|
/** Persist the message history (and refresh the thread's drawer metadata). */
|
|
@@ -89,6 +101,7 @@ export declare class SessionStorageStore implements ClientConversationStore {
|
|
|
89
101
|
#private;
|
|
90
102
|
constructor(namespace?: string);
|
|
91
103
|
threadId(): string;
|
|
104
|
+
newThread(): string;
|
|
92
105
|
isUnsent(threadId: string): boolean;
|
|
93
106
|
loadMessages(threadId: string): Promise<readonly Message[] | null>;
|
|
94
107
|
saveMessages(threadId: string, messages: readonly Message[]): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_store.d.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MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CASlD;CAuFF"}
|
|
@@ -29,6 +29,12 @@ export declare class RemoteConversationStore implements ClientConversationStore
|
|
|
29
29
|
constructor(url: string, headers?: HeadersProvider, local?: ClientConversationStore, credentials?: CredentialsProvider);
|
|
30
30
|
threadId(): string;
|
|
31
31
|
setActiveThread(threadId: string): void;
|
|
32
|
+
/**
|
|
33
|
+
* Delegated to the local store, which owns the active id — and deliberately
|
|
34
|
+
* silent on the wire: the server learns of a thread when its first message is
|
|
35
|
+
* persisted, so an abandoned new chat costs no round-trip and leaves no row.
|
|
36
|
+
*/
|
|
37
|
+
newThread(): string;
|
|
32
38
|
/** Delegated, so wrapping a store does not lose what it knows about its own ids. */
|
|
33
39
|
isUnsent(threadId: string): boolean;
|
|
34
40
|
saveMessages(threadId: string, messages: readonly Message[]): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote_conversation_store.d.ts","sourceRoot":"","sources":["../../src/core/remote_conversation_store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EAEzB,KAAK,UAAU,EAChB,MAAM,yBAAyB,CAAC;AAWjC,sFAAsF;AACtF,KAAK,eAAe,GAAG,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEpD;;;;GAIG;AACH,KAAK,mBAAmB,GAAG,MAAM,kBAAkB,GAAG,SAAS,CAAC;AAEhE;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,uBAAwB,YAAW,uBAAuB;;IAQrE,YACE,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,eAA4B,EACrC,KAAK,GAAE,uBAAmD,EAC1D,WAAW,GAAE,mBAAqC,EAMnD;IAED,QAAQ,IAAI,MAAM,CAEjB;IAED,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAE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AAQ,IAAI,MAAM,CAEjB;IAED,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAEtC;IAED;;;;OAIG;IACH,SAAS,IAAI,MAAM,CAElB;IAED,oFAAoF;IACpF,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAElC;IAED,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,OAAO,EAAE,GAAG,IAAI,CAGjE;IAED,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,oBAAoB,GAAG,IAAI,CAE5D;IAED,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,oBAAoB,GAAG,IAAI,GAAG,IAAI,CAE9E;IAED,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAIlD;IAED,KAAK,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAI5B;IAEK,WAAW,IAAI,OAAO,CAAC,SAAS,UAAU,EAAE,CAAC,CAMlD;IAEK,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,OAAO,EAAE,GAAG,IAAI,CAAC,CAsBvE;CAoEF"}
|
package/dist/core/utils.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ClientConversationStore } from "./conversation_store.js";
|
|
1
2
|
/**
|
|
2
3
|
* Overlay a `credentials` mode onto a fetch `init`, or hand the `init` back
|
|
3
4
|
* untouched when none is configured.
|
|
@@ -7,4 +8,17 @@
|
|
|
7
8
|
* where the point is to leave the browser's own default in place.
|
|
8
9
|
*/
|
|
9
10
|
export declare function withCredentials(init: RequestInit | undefined, credentials: RequestCredentials | undefined): RequestInit | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Start a new conversation in `store` and return its id.
|
|
13
|
+
*
|
|
14
|
+
* `newThread` is optional on the interface, so a store that predates it is
|
|
15
|
+
* driven the only other way the interface allows: mint an id here and make it
|
|
16
|
+
* active. That path loses the store's own note that the thread is new, so a
|
|
17
|
+
* remote store would go on to ask the server for a conversation that cannot
|
|
18
|
+
* exist yet — which is why every store in this package implements the method.
|
|
19
|
+
*
|
|
20
|
+
* What neither path does is clear the thread being left behind. Starting a
|
|
21
|
+
* conversation is not a reason to destroy the previous one.
|
|
22
|
+
*/
|
|
23
|
+
export declare function mintThread(store: ClientConversationStore): string;
|
|
10
24
|
//# 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":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/core/utils.ts"],"names":[],"mappings":"AAGA,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"}
|
package/dist/index.js
CHANGED
|
@@ -1097,7 +1097,7 @@ function drawStacked(svg2, spec, min, max) {
|
|
|
1097
1097
|
const running = spec.labels.map(() => 0);
|
|
1098
1098
|
spec.series.forEach((series, s) => {
|
|
1099
1099
|
series.points.forEach((value, i) => {
|
|
1100
|
-
const from = running[i];
|
|
1100
|
+
const from = running[i] ?? 0;
|
|
1101
1101
|
const to = from + value;
|
|
1102
1102
|
running[i] = to;
|
|
1103
1103
|
const y2 = scaleY(to, min, max);
|
|
@@ -1241,6 +1241,7 @@ function renderChart(spec) {
|
|
|
1241
1241
|
// src/ui/chart_spec_from.ts
|
|
1242
1242
|
var KINDS = ["bar", "line", "pie", "scatter", "stacked"];
|
|
1243
1243
|
var MAX_POINTS = 2e4;
|
|
1244
|
+
var MAX_LABELS = 2e3;
|
|
1244
1245
|
var MAX_MAGNITUDE = 1e15;
|
|
1245
1246
|
function asKind(value) {
|
|
1246
1247
|
return KINDS.includes(value) ? value : "bar";
|
|
@@ -1262,9 +1263,14 @@ function asNumbers(value) {
|
|
|
1262
1263
|
return out;
|
|
1263
1264
|
}
|
|
1264
1265
|
function asStrings(value) {
|
|
1265
|
-
if (!Array.isArray(value)
|
|
1266
|
+
if (!Array.isArray(value)) {
|
|
1266
1267
|
return null;
|
|
1267
1268
|
}
|
|
1269
|
+
for (let i = 0; i < value.length; i += 1) {
|
|
1270
|
+
if (typeof value[i] !== "string") {
|
|
1271
|
+
return null;
|
|
1272
|
+
}
|
|
1273
|
+
}
|
|
1268
1274
|
return value;
|
|
1269
1275
|
}
|
|
1270
1276
|
function chartSpecFrom(value) {
|
|
@@ -1291,7 +1297,7 @@ function chartSpecFrom(value) {
|
|
|
1291
1297
|
if (series.length === 0) {
|
|
1292
1298
|
return null;
|
|
1293
1299
|
}
|
|
1294
|
-
if (series.length * labels.length > MAX_POINTS) {
|
|
1300
|
+
if (series.length * labels.length > MAX_POINTS || labels.length > MAX_LABELS) {
|
|
1295
1301
|
return null;
|
|
1296
1302
|
}
|
|
1297
1303
|
const kind = asKind(raw["kind"]);
|
|
@@ -1305,6 +1311,10 @@ function draw(args) {
|
|
|
1305
1311
|
const spec = chartSpecFrom(args);
|
|
1306
1312
|
return spec === null ? null : renderChart(spec);
|
|
1307
1313
|
}
|
|
1314
|
+
function drawable(args) {
|
|
1315
|
+
const spec = chartSpecFrom(args);
|
|
1316
|
+
return spec !== null && spec.labels.length > 0 && spec.series.length > 0;
|
|
1317
|
+
}
|
|
1308
1318
|
var REJECTED = "chart not rendered: expected labels (strings) and series, each with one finite number per label";
|
|
1309
1319
|
function createChartTool() {
|
|
1310
1320
|
return {
|
|
@@ -1334,11 +1344,13 @@ function createChartTool() {
|
|
|
1334
1344
|
// Says what happened and nothing else; the drawing is `render`'s job. Told
|
|
1335
1345
|
// plainly when the arguments are unusable, because the model can fix that
|
|
1336
1346
|
// and retry — a silent no-op would leave it believing the chart is on screen.
|
|
1337
|
-
// Answers on what
|
|
1338
|
-
// pass validation and still have nothing to show
|
|
1339
|
-
//
|
|
1340
|
-
// chart is
|
|
1341
|
-
|
|
1347
|
+
// Answers on what will actually be drawn, not on what validated: a spec can
|
|
1348
|
+
// pass validation and still have nothing to show, and reporting success
|
|
1349
|
+
// then would leave the model believing a chart is on screen. Asks the
|
|
1350
|
+
// question without building the chart, because `render` is about to build
|
|
1351
|
+
// the same one a moment later and drawing it twice is pure waste on a spec
|
|
1352
|
+
// large enough to matter.
|
|
1353
|
+
handler: (args) => drawable(args) ? "chart rendered" : REJECTED,
|
|
1342
1354
|
render: draw
|
|
1343
1355
|
};
|
|
1344
1356
|
}
|
|
@@ -8017,6 +8029,7 @@ var AgUiClient = class {
|
|
|
8017
8029
|
#buildSubscriber(pending, runState) {
|
|
8018
8030
|
const h = this.#handlers;
|
|
8019
8031
|
const closed = this.#closedMessageIds;
|
|
8032
|
+
const cancelled = () => this.#cancelled;
|
|
8020
8033
|
const pendingDeltas = /* @__PURE__ */ new Set();
|
|
8021
8034
|
return {
|
|
8022
8035
|
onRunInitialized() {
|
|
@@ -8103,6 +8116,9 @@ var AgUiClient = class {
|
|
|
8103
8116
|
onRunErrorEvent({ event }) {
|
|
8104
8117
|
runState.terminal = true;
|
|
8105
8118
|
runState.errored = true;
|
|
8119
|
+
if (cancelled()) {
|
|
8120
|
+
return;
|
|
8121
|
+
}
|
|
8106
8122
|
h.onError(event.message);
|
|
8107
8123
|
},
|
|
8108
8124
|
onRunFinalized() {
|
|
@@ -8113,7 +8129,10 @@ var AgUiClient = class {
|
|
|
8113
8129
|
}
|
|
8114
8130
|
};
|
|
8115
8131
|
function isAbortError(error) {
|
|
8116
|
-
|
|
8132
|
+
if (!(error instanceof Error)) {
|
|
8133
|
+
return false;
|
|
8134
|
+
}
|
|
8135
|
+
return error.name === "AbortError" || error instanceof TypeError && /abort/i.test(error.message);
|
|
8117
8136
|
}
|
|
8118
8137
|
|
|
8119
8138
|
// src/core/attachment.ts
|
|
@@ -8149,13 +8168,11 @@ var SessionStorageStore = class {
|
|
|
8149
8168
|
}
|
|
8150
8169
|
}
|
|
8151
8170
|
threadId() {
|
|
8152
|
-
|
|
8153
|
-
|
|
8154
|
-
|
|
8155
|
-
return existing;
|
|
8156
|
-
}
|
|
8171
|
+
return sessionStorage.getItem(this.#key(THREAD_SUFFIX)) ?? this.newThread();
|
|
8172
|
+
}
|
|
8173
|
+
newThread() {
|
|
8157
8174
|
const id = randomUUID3();
|
|
8158
|
-
sessionStorage.setItem(key, id);
|
|
8175
|
+
sessionStorage.setItem(this.#key(THREAD_SUFFIX), id);
|
|
8159
8176
|
sessionStorage.setItem(this.#key(MINTED_SUFFIX + id), "1");
|
|
8160
8177
|
return id;
|
|
8161
8178
|
}
|
|
@@ -8320,9 +8337,18 @@ function truncate(text3, limit) {
|
|
|
8320
8337
|
import { HttpAgent } from "@ag-ui/client";
|
|
8321
8338
|
|
|
8322
8339
|
// src/core/utils.ts
|
|
8340
|
+
import { randomUUID as randomUUID4 } from "@ag-ui/client";
|
|
8323
8341
|
function withCredentials(init, credentials) {
|
|
8324
8342
|
return credentials === void 0 ? init : { ...init, credentials };
|
|
8325
8343
|
}
|
|
8344
|
+
function mintThread(store) {
|
|
8345
|
+
if (store.newThread !== void 0) {
|
|
8346
|
+
return store.newThread();
|
|
8347
|
+
}
|
|
8348
|
+
const id = randomUUID4();
|
|
8349
|
+
store.setActiveThread(id);
|
|
8350
|
+
return id;
|
|
8351
|
+
}
|
|
8326
8352
|
|
|
8327
8353
|
// src/core/create_http_agent.ts
|
|
8328
8354
|
function createHttpAgent(options) {
|
|
@@ -8373,6 +8399,14 @@ var RemoteConversationStore = class {
|
|
|
8373
8399
|
setActiveThread(threadId) {
|
|
8374
8400
|
this.#local.setActiveThread(threadId);
|
|
8375
8401
|
}
|
|
8402
|
+
/**
|
|
8403
|
+
* Delegated to the local store, which owns the active id — and deliberately
|
|
8404
|
+
* silent on the wire: the server learns of a thread when its first message is
|
|
8405
|
+
* persisted, so an abandoned new chat costs no round-trip and leaves no row.
|
|
8406
|
+
*/
|
|
8407
|
+
newThread() {
|
|
8408
|
+
return mintThread(this.#local);
|
|
8409
|
+
}
|
|
8376
8410
|
/** Delegated, so wrapping a store does not lose what it knows about its own ids. */
|
|
8377
8411
|
isUnsent(threadId) {
|
|
8378
8412
|
return this.#local.isUnsent?.(threadId) === true;
|
|
@@ -9909,14 +9943,20 @@ var AgUiChat = class extends HTMLElement {
|
|
|
9909
9943
|
this.openCheckpoints();
|
|
9910
9944
|
}
|
|
9911
9945
|
/**
|
|
9912
|
-
* Start a fresh conversation:
|
|
9913
|
-
*
|
|
9946
|
+
* Start a fresh conversation: drop the in-memory run state, clear the
|
|
9947
|
+
* transcript, and mint a new thread id.
|
|
9948
|
+
*
|
|
9949
|
+
* The conversation being left is kept, and stays in the history drawer to
|
|
9950
|
+
* return to. Deleting one is the drawer row's own action; a button that
|
|
9951
|
+
* starts something new must not be the button that destroys what was there.
|
|
9914
9952
|
*/
|
|
9915
9953
|
newChat() {
|
|
9916
9954
|
this.#cancelRun();
|
|
9917
|
-
this.conversationStore.
|
|
9955
|
+
if (this.conversationStore.isUnsent?.(this.#threadId) === true) {
|
|
9956
|
+
this.conversationStore.clear(this.#threadId);
|
|
9957
|
+
}
|
|
9918
9958
|
this.#resetState();
|
|
9919
|
-
this.#threadId = this.conversationStore
|
|
9959
|
+
this.#threadId = mintThread(this.conversationStore);
|
|
9920
9960
|
this.#setRunning(false);
|
|
9921
9961
|
this.#setUnread(0);
|
|
9922
9962
|
}
|
|
@@ -10067,9 +10107,9 @@ var AgUiChat = class extends HTMLElement {
|
|
|
10067
10107
|
continue;
|
|
10068
10108
|
}
|
|
10069
10109
|
this.#cardElements.set(restored.id, this.#cardFor(restored).element);
|
|
10070
|
-
const
|
|
10071
|
-
if (
|
|
10072
|
-
this.#renderToolOutput(
|
|
10110
|
+
const render = this.#resolveTool(restored.name)?.render;
|
|
10111
|
+
if (render !== void 0) {
|
|
10112
|
+
this.#renderToolOutput(render, restored);
|
|
10073
10113
|
}
|
|
10074
10114
|
}
|
|
10075
10115
|
return;
|
|
@@ -10693,7 +10733,9 @@ var AgUiChat = class extends HTMLElement {
|
|
|
10693
10733
|
}
|
|
10694
10734
|
try {
|
|
10695
10735
|
const result = await tool.handler(call.args, call.id);
|
|
10696
|
-
|
|
10736
|
+
if (tool.render !== void 0) {
|
|
10737
|
+
this.#renderToolOutput(tool.render, call);
|
|
10738
|
+
}
|
|
10697
10739
|
if (navigates) {
|
|
10698
10740
|
card.settle(TOOL_CALL_STATUS.DONE, this.#strings.navigating);
|
|
10699
10741
|
return { content: "", halt: true };
|
|
@@ -11017,12 +11059,16 @@ var AgUiChat = class extends HTMLElement {
|
|
|
11017
11059
|
* arrives is not something to switch on for everybody.
|
|
11018
11060
|
*/
|
|
11019
11061
|
enableCharts(routes = ["tool", "activity"]) {
|
|
11062
|
+
const first = !this.#chartActivity && !this.#toolRegistry.has(CHART_TOOL_NAME);
|
|
11020
11063
|
if (routes.includes("activity")) {
|
|
11021
11064
|
this.#chartActivity = true;
|
|
11022
11065
|
}
|
|
11023
11066
|
if (routes.includes("tool")) {
|
|
11024
11067
|
this.registerTool(createChartTool());
|
|
11025
11068
|
}
|
|
11069
|
+
if (first && this.isConnected) {
|
|
11070
|
+
this.reload();
|
|
11071
|
+
}
|
|
11026
11072
|
}
|
|
11027
11073
|
/**
|
|
11028
11074
|
* Place a tool's rendered node against its own card.
|
|
@@ -11034,13 +11080,10 @@ var AgUiChat = class extends HTMLElement {
|
|
|
11034
11080
|
* created inline, in the right place, so anchoring makes *when* the handler
|
|
11035
11081
|
* runs stop mattering.
|
|
11036
11082
|
*/
|
|
11037
|
-
#renderToolOutput(
|
|
11038
|
-
if (tool.render === void 0) {
|
|
11039
|
-
return;
|
|
11040
|
-
}
|
|
11083
|
+
#renderToolOutput(render, call) {
|
|
11041
11084
|
let node;
|
|
11042
11085
|
try {
|
|
11043
|
-
node =
|
|
11086
|
+
node = render(call.args);
|
|
11044
11087
|
} catch (error) {
|
|
11045
11088
|
console.warn(`ag-ui-chat: render failed for tool ${call.name}`, error);
|
|
11046
11089
|
return;
|
|
@@ -11054,11 +11097,10 @@ var AgUiChat = class extends HTMLElement {
|
|
|
11054
11097
|
/** Draw, or redraw in place, the chart for one activity message. */
|
|
11055
11098
|
#drawActivityChart(messageId, content) {
|
|
11056
11099
|
const spec = chartSpecFrom(content);
|
|
11057
|
-
|
|
11058
|
-
return;
|
|
11059
|
-
}
|
|
11060
|
-
const block = renderChart(spec);
|
|
11100
|
+
const block = spec === null ? null : renderChart(spec);
|
|
11061
11101
|
if (block === null) {
|
|
11102
|
+
this.#activityBlocks.get(messageId)?.remove();
|
|
11103
|
+
this.#activityBlocks.delete(messageId);
|
|
11062
11104
|
return;
|
|
11063
11105
|
}
|
|
11064
11106
|
const existing = this.#activityBlocks.get(messageId);
|
|
@@ -11155,7 +11197,7 @@ function setControlValue(el2, value) {
|
|
|
11155
11197
|
}
|
|
11156
11198
|
|
|
11157
11199
|
// src/version.ts
|
|
11158
|
-
var VERSION = "0.
|
|
11200
|
+
var VERSION = "0.27.0";
|
|
11159
11201
|
export {
|
|
11160
11202
|
ATTACHMENT_EVENT,
|
|
11161
11203
|
AgUiChat,
|