@artooi/ag-ui-web-component 0.20.0 → 0.21.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 +135 -1
- package/README.md +286 -20
- package/dist/ag-ui-web-component.bundle.js +407 -382
- package/dist/ag-ui-web-component.bundle.js.map +4 -4
- package/dist/core/ag_ui_chat.d.ts +82 -1
- package/dist/core/ag_ui_chat.d.ts.map +1 -1
- package/dist/core/create_http_agent.d.ts +9 -0
- package/dist/core/create_http_agent.d.ts.map +1 -1
- package/dist/core/remote_conversation_store.d.ts +8 -1
- package/dist/core/remote_conversation_store.d.ts.map +1 -1
- package/dist/core/run_index.d.ts +8 -1
- package/dist/core/run_index.d.ts.map +1 -1
- package/dist/core/transcribe_audio.d.ts +7 -0
- package/dist/core/transcribe_audio.d.ts.map +1 -1
- package/dist/core/upload_attachment.d.ts +9 -0
- package/dist/core/upload_attachment.d.ts.map +1 -1
- package/dist/core/utils.d.ts +12 -0
- package/dist/core/utils.d.ts.map +1 -0
- package/dist/dom/animations.d.ts +51 -11
- package/dist/dom/animations.d.ts.map +1 -1
- package/dist/dom/dom_driver.d.ts +12 -7
- package/dist/dom/dom_driver.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +766 -430
- package/dist/index.js.map +3 -3
- package/dist/ui/styles.d.ts +1 -1
- package/dist/ui/styles.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/core/ag_ui_chat.ts +292 -31
- package/src/core/create_http_agent.ts +14 -3
- package/src/core/remote_conversation_store.ts +25 -6
- package/src/core/run_index.ts +27 -5
- package/src/core/transcribe_audio.ts +20 -5
- package/src/core/upload_attachment.ts +13 -0
- package/src/core/utils.ts +18 -0
- package/src/dom/animations.ts +175 -31
- package/src/dom/dom_driver.ts +18 -12
- package/src/index.ts +2 -0
- package/src/ui/styles.ts +377 -352
- package/src/version.ts +1 -1
|
@@ -54,8 +54,32 @@ export declare class AgUiChat extends HTMLElement {
|
|
|
54
54
|
#private;
|
|
55
55
|
/** Agent factory; override to inject a custom or fake agent (tests). */
|
|
56
56
|
agentFactory: AgentFactory;
|
|
57
|
-
/**
|
|
57
|
+
/**
|
|
58
|
+
* Static extra HTTP headers, sent with **every** request this element makes —
|
|
59
|
+
* the agent run, the thread index and its messages, the tool and skill
|
|
60
|
+
* catalogs, the run index, uploads and transcription.
|
|
61
|
+
*
|
|
62
|
+
* Right for values fixed for the element's lifetime. A credential that
|
|
63
|
+
* rotates (a short-lived JWT, a re-issued CSRF token) belongs in
|
|
64
|
+
* {@link getHeaders} instead: this is read at request time, but only a
|
|
65
|
+
* re-assignment updates it, so a token captured here is pinned until the host
|
|
66
|
+
* remembers to assign again.
|
|
67
|
+
*/
|
|
58
68
|
headers: Record<string, string>;
|
|
69
|
+
/**
|
|
70
|
+
* Live header source, consulted immediately before every request — the way to
|
|
71
|
+
* supply rotating credentials.
|
|
72
|
+
*
|
|
73
|
+
* Set it to a function and each request calls it afresh: a token refreshed by
|
|
74
|
+
* the host between two requests reaches the second one, with nothing to
|
|
75
|
+
* re-assign and nothing to keep in sync.
|
|
76
|
+
*
|
|
77
|
+
* Composes with {@link headers} rather than replacing it: the two are merged
|
|
78
|
+
* per key with `getHeaders()` winning, so a static `X-Client` and a rotating
|
|
79
|
+
* `Authorization` can be configured independently and neither silently drops
|
|
80
|
+
* the other.
|
|
81
|
+
*/
|
|
82
|
+
getHeaders: (() => Record<string, string>) | null;
|
|
59
83
|
/**
|
|
60
84
|
* Permit `<img>` in rendered assistant markdown. **Off by default**: a
|
|
61
85
|
* model-controlled image URL is fetched with no user interaction, which
|
|
@@ -221,6 +245,27 @@ export declare class AgUiChat extends HTMLElement {
|
|
|
221
245
|
/** The AG-UI endpoint URL, read from the `endpoint` attribute. */
|
|
222
246
|
get endpoint(): string;
|
|
223
247
|
set endpoint(value: string);
|
|
248
|
+
/**
|
|
249
|
+
* Cookie policy for **every** request this element makes, as `fetch`'s own
|
|
250
|
+
* `credentials` mode (`"omit"` / `"same-origin"` / `"include"`). Mirrored to
|
|
251
|
+
* the `credentials` attribute, so markup embeds can set it without script.
|
|
252
|
+
*
|
|
253
|
+
* `null` (the default) leaves the browser's default of `same-origin` in
|
|
254
|
+
* place. That default sends **no cookies at all** when the endpoints live on
|
|
255
|
+
* a different origin from the page — app.example.com calling
|
|
256
|
+
* api.example.com is cross-origin — and the request goes out anonymously
|
|
257
|
+
* rather than failing, so the symptom is a 401 from a server that looks
|
|
258
|
+
* correctly configured. A cookie-authenticated cross-origin deployment wants
|
|
259
|
+
* `"include"`, plus `Access-Control-Allow-Credentials: true` and a concrete
|
|
260
|
+
* (non-wildcard) `Access-Control-Allow-Origin` on the server.
|
|
261
|
+
*
|
|
262
|
+
* Read per request, so a late assignment applies to everything after it.
|
|
263
|
+
* `"omit"` cannot be honoured by the built-in **upload** transport, which is
|
|
264
|
+
* an `XMLHttpRequest` and only has a two-state cookie switch; every other
|
|
265
|
+
* endpoint honours all three modes.
|
|
266
|
+
*/
|
|
267
|
+
get credentials(): RequestCredentials | null;
|
|
268
|
+
set credentials(value: RequestCredentials | null);
|
|
224
269
|
/**
|
|
225
270
|
* How much detail tool-call cards show, from the `data-tool-display`
|
|
226
271
|
* attribute (`minimal` / `inline` / `compact` / `full`). Defaults to `full`.
|
|
@@ -232,6 +277,22 @@ export declare class AgUiChat extends HTMLElement {
|
|
|
232
277
|
get toolDisplay(): ToolDisplayMode;
|
|
233
278
|
set toolDisplay(value: ToolDisplayMode);
|
|
234
279
|
connectedCallback(): void;
|
|
280
|
+
/**
|
|
281
|
+
* Re-run everything the element loads on startup — the tool-label catalog,
|
|
282
|
+
* the backend skill catalog and the thread's history — with the transport
|
|
283
|
+
* configuration as it stands now.
|
|
284
|
+
*
|
|
285
|
+
* This is the answer for a host that can only configure the element after the
|
|
286
|
+
* fact (a token fetched in a passive effect, an async auth handshake): the
|
|
287
|
+
* startup requests already went out with whatever was set then, and this says
|
|
288
|
+
* "try again, properly authenticated" without removing and re-inserting the
|
|
289
|
+
* node.
|
|
290
|
+
*
|
|
291
|
+
* A reload, not a merge — the in-flight run is cancelled and the transcript
|
|
292
|
+
* is rebuilt from the persisted history, so anything streamed since is
|
|
293
|
+
* dropped. Call it once, when configuration lands; not between turns.
|
|
294
|
+
*/
|
|
295
|
+
reload(): Promise<void>;
|
|
235
296
|
/**
|
|
236
297
|
* Tear down live resources when the element leaves the DOM (a removed node, a
|
|
237
298
|
* client-side route swap): cancel the in-flight run so its SSE stream closes,
|
|
@@ -264,6 +325,26 @@ export declare class AgUiChat extends HTMLElement {
|
|
|
264
325
|
* `dark` first.
|
|
265
326
|
*/
|
|
266
327
|
toggleTheme(): void;
|
|
328
|
+
/**
|
|
329
|
+
* Open the thread-history drawer: the imperative route to the control that
|
|
330
|
+
* renders as `::part(history-button)`.
|
|
331
|
+
*
|
|
332
|
+
* A host that hides `::part(header)` to render its own title bar hides the
|
|
333
|
+
* history, new-chat and collapse buttons with it — and thread switching then
|
|
334
|
+
* has no route at all, because those controls live inside the header. Each of
|
|
335
|
+
* them has a method, so a host chrome can rebuild the set: this one,
|
|
336
|
+
* {@link openCheckpoints}, {@link newChat}, {@link toggleCollapsed} and
|
|
337
|
+
* {@link toggleTheme}.
|
|
338
|
+
*/
|
|
339
|
+
openThreads(): void;
|
|
340
|
+
/**
|
|
341
|
+
* Open the checkpoints panel (the `::part(checkpoints-button)` route).
|
|
342
|
+
*
|
|
343
|
+
* It lists the runs the `data-runs-url` server reports as continuable;
|
|
344
|
+
* without that attribute the built-in button is never rendered and this opens
|
|
345
|
+
* an empty panel.
|
|
346
|
+
*/
|
|
347
|
+
openCheckpoints(): void;
|
|
267
348
|
/**
|
|
268
349
|
* Start a fresh conversation: forget the persisted history, drop the
|
|
269
350
|
* in-memory run state, clear the transcript, and mint a new thread id.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ag_ui_chat.d.ts","sourceRoot":"","sources":["../../src/core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Aa,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,cAAc,CAkBhE;IAoWD;;;;;;;;;;;;;;;;;OAiBG;IACG,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,GAAE,SAAS,aAAa,EAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAkB5F;IAED;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAM9B;CAmeF"}
|
|
@@ -4,6 +4,15 @@ import type { Message } from "@ag-ui/core";
|
|
|
4
4
|
export interface HttpAgentOptions {
|
|
5
5
|
endpoint: string;
|
|
6
6
|
headers?: Record<string, string>;
|
|
7
|
+
/**
|
|
8
|
+
* Cookie policy for the run request, as `fetch`'s own `credentials` mode.
|
|
9
|
+
* Unset leaves the browser default (`same-origin`) alone — which sends **no**
|
|
10
|
+
* cookies when the agent endpoint is on a different origin (or a different
|
|
11
|
+
* subdomain) from the page. A cookie-authenticated cross-origin deployment
|
|
12
|
+
* needs `"include"` here, and a server that answers it with
|
|
13
|
+
* `Access-Control-Allow-Credentials: true` and a concrete origin.
|
|
14
|
+
*/
|
|
15
|
+
credentials?: RequestCredentials;
|
|
7
16
|
/**
|
|
8
17
|
* Live header source, re-read on **every** request. `HttpAgent` bakes the
|
|
9
18
|
* static `headers` into its constructor and the element caches the agent
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create_http_agent.d.ts","sourceRoot":"","sources":["../../src/core/create_http_agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAa,MAAM,eAAe,CAAC;AAC9D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"create_http_agent.d.ts","sourceRoot":"","sources":["../../src/core/create_http_agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAa,MAAM,eAAe,CAAC;AAC9D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAG3C,0CAA0C;AAC1C,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,kEAAkE;IAClE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wEAAwE;IACxE,eAAe,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IACrC;;;;OAIG;IACH,YAAY,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CAClD;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,aAAa,CA8BxE;AAED,2EAA2E;AAC3E,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,gBAAgB,KAAK,aAAa,CAAC"}
|
|
@@ -2,6 +2,13 @@ import type { Message } from "@ag-ui/core";
|
|
|
2
2
|
import { type ClientConversationStore, type NavigationCheckpoint, type ThreadMeta } from "./conversation_store.js";
|
|
3
3
|
/** Live header source, read per request so rotated tokens / CSRF reach the server. */
|
|
4
4
|
type HeadersProvider = () => Record<string, string>;
|
|
5
|
+
/**
|
|
6
|
+
* Live cookie policy, read per request. A provider rather than a value because
|
|
7
|
+
* the store is built once (on connect) and kept, while a host may configure the
|
|
8
|
+
* element after inserting it — a captured value would pin whatever was set
|
|
9
|
+
* during that first frame.
|
|
10
|
+
*/
|
|
11
|
+
type CredentialsProvider = () => RequestCredentials | undefined;
|
|
5
12
|
/**
|
|
6
13
|
* A {@link ClientConversationStore} backed by a server thread-index endpoint —
|
|
7
14
|
* django-ag-ui's owner-scoped `ThreadsView`, the URL passed to `<ag-ui-chat>`
|
|
@@ -20,7 +27,7 @@ type HeadersProvider = () => Record<string, string>;
|
|
|
20
27
|
*/
|
|
21
28
|
export declare class RemoteConversationStore implements ClientConversationStore {
|
|
22
29
|
#private;
|
|
23
|
-
constructor(url: string, headers?: HeadersProvider, local?: ClientConversationStore);
|
|
30
|
+
constructor(url: string, headers?: HeadersProvider, local?: ClientConversationStore, credentials?: CredentialsProvider);
|
|
24
31
|
threadId(): string;
|
|
25
32
|
setActiveThread(threadId: string): void;
|
|
26
33
|
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;
|
|
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;;;;;GAKG;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,CAEtC;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,CAavE;CAoEF"}
|
package/dist/core/run_index.d.ts
CHANGED
|
@@ -9,6 +9,13 @@ export interface RunRow {
|
|
|
9
9
|
}
|
|
10
10
|
/** Live header source, read per request so rotated tokens / CSRF reach the server. */
|
|
11
11
|
type HeadersProvider = () => Record<string, string>;
|
|
12
|
+
/**
|
|
13
|
+
* Live cookie policy, read per request. A provider rather than a value because
|
|
14
|
+
* the index is built once (on connect) and kept, while a host may configure the
|
|
15
|
+
* element after inserting it — a captured value would pin whatever was set
|
|
16
|
+
* during that first frame.
|
|
17
|
+
*/
|
|
18
|
+
type CredentialsProvider = () => RequestCredentials | undefined;
|
|
12
19
|
/**
|
|
13
20
|
* Reads the server's run index and derives the resume / fork URLs beside it.
|
|
14
21
|
*
|
|
@@ -31,7 +38,7 @@ type HeadersProvider = () => Record<string, string>;
|
|
|
31
38
|
*/
|
|
32
39
|
export declare class RunIndex {
|
|
33
40
|
#private;
|
|
34
|
-
constructor(url: string, headers?: HeadersProvider);
|
|
41
|
+
constructor(url: string, headers?: HeadersProvider, credentials?: CredentialsProvider);
|
|
35
42
|
/**
|
|
36
43
|
* The user's runs, or `[]` when the endpoint is unreachable or answers with
|
|
37
44
|
* an error. A history affordance that cannot load is empty, never broken:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run_index.d.ts","sourceRoot":"","sources":["../../src/core/run_index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"run_index.d.ts","sourceRoot":"","sources":["../../src/core/run_index.ts"],"names":[],"mappings":"AAEA,8EAA8E;AAC9E,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,0EAA0E;IAC1E,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;CAC/B;AAED,sFAAsF;AACtF,KAAK,eAAe,GAAG,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEpD;;;;;GAKG;AACH,KAAK,mBAAmB,GAAG,MAAM,kBAAkB,GAAG,SAAS,CAAC;AAEhE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,QAAQ;;IAKnB,YACE,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,eAA4B,EACrC,WAAW,GAAE,mBAAqC,EAKnD;IAED;;;;;OAKG;IACG,IAAI,IAAI,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAoBvC;IAED,+CAA+C;IACzC,WAAW,IAAI,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAE9C;IAED,wDAAwD;IACxD,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE/B;IAED,uFAAuF;IACvF,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE7B;CAaF"}
|
|
@@ -12,6 +12,13 @@ export interface TranscribeOptions {
|
|
|
12
12
|
readonly url: string;
|
|
13
13
|
/** Extra HTTP headers (CSRF / auth), read fresh per request. */
|
|
14
14
|
readonly headers?: Record<string, string>;
|
|
15
|
+
/**
|
|
16
|
+
* Cookie policy, as `fetch`'s own `credentials` mode. Unset leaves the
|
|
17
|
+
* browser default (`same-origin`), which sends no cookies to an endpoint on
|
|
18
|
+
* another origin; a cookie-authenticated cross-origin deployment needs
|
|
19
|
+
* `"include"`.
|
|
20
|
+
*/
|
|
21
|
+
readonly credentials?: RequestCredentials;
|
|
15
22
|
}
|
|
16
23
|
/**
|
|
17
24
|
* POST a recorded clip to the transcription endpoint and resolve to its text.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transcribe_audio.d.ts","sourceRoot":"","sources":["../../src/core/transcribe_audio.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"transcribe_audio.d.ts","sourceRoot":"","sources":["../../src/core/transcribe_audio.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,KAAK,EAAE,IAAI,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;AAEjE,2CAA2C;AAC3C,MAAM,WAAW,iBAAiB;IAChC,0DAA0D;IAC1D,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,gEAAgE;IAChE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,kBAAkB,CAAC;CAC3C;AAED;;;;;;;GAOG;AACH,wBAAsB,eAAe,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,CA6B9F"}
|
|
@@ -20,6 +20,15 @@ export interface UploadOptions {
|
|
|
20
20
|
readonly url: string;
|
|
21
21
|
/** Extra HTTP headers (CSRF / auth), read fresh per upload. */
|
|
22
22
|
readonly headers?: Record<string, string>;
|
|
23
|
+
/**
|
|
24
|
+
* Cookie policy, spelled as `fetch`'s `credentials` mode for consistency with
|
|
25
|
+
* the component's other endpoints — but carried by `XMLHttpRequest`, which
|
|
26
|
+
* only has the two-state `withCredentials`. `"include"` sets it; every other
|
|
27
|
+
* value leaves it off, which matches `"same-origin"`. `"omit"` therefore
|
|
28
|
+
* **cannot** be honoured for a same-origin upload (XHR always sends cookies
|
|
29
|
+
* there); use a custom {@link UploadHandler} if that matters.
|
|
30
|
+
*/
|
|
31
|
+
readonly credentials?: RequestCredentials;
|
|
23
32
|
/** Progress callback, `0..1`, fired as the body uploads. */
|
|
24
33
|
readonly onProgress?: (fraction: number) => void;
|
|
25
34
|
/** Abort signal to cancel the in-flight upload. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload_attachment.d.ts","sourceRoot":"","sources":["../../src/core/upload_attachment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,aAAa,GAAG,CAC1B,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,EACtC,MAAM,CAAC,EAAE,WAAW,KACjB,OAAO,CAAC,aAAa,CAAC,CAAC;AAE5B,4CAA4C;AAC5C,MAAM,WAAW,aAAa;IAC5B,yDAAyD;IACzD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,+DAA+D;IAC/D,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,4DAA4D;IAC5D,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,mDAAmD;IACnD,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;CAC3C;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,
|
|
1
|
+
{"version":3,"file":"upload_attachment.d.ts","sourceRoot":"","sources":["../../src/core/upload_attachment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,aAAa,GAAG,CAC1B,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,EACtC,MAAM,CAAC,EAAE,WAAW,KACjB,OAAO,CAAC,aAAa,CAAC,CAAC;AAE5B,4CAA4C;AAC5C,MAAM,WAAW,aAAa;IAC5B,yDAAyD;IACzD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,+DAA+D;IAC/D,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C;;;;;;;OAOG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,kBAAkB,CAAC;IAC1C,4DAA4D;IAC5D,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,mDAAmD;IACnD,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;CAC3C;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,CA6C3F"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Overlay a `credentials` mode onto a fetch `init`, or hand the `init` back
|
|
3
|
+
* untouched when the caller has none configured.
|
|
4
|
+
*
|
|
5
|
+
* Absent and `undefined` are not the same thing here. `exactOptionalPropertyTypes`
|
|
6
|
+
* rejects an explicit `credentials: undefined`, and writing one anyway would
|
|
7
|
+
* state a mode where the point is to leave the browser's own default in place.
|
|
8
|
+
* Every fetch this component makes has to make that choice, so it is made in one
|
|
9
|
+
* place rather than repeated (and eventually forgotten) at each call site.
|
|
10
|
+
*/
|
|
11
|
+
export declare function withCredentials(init: RequestInit | undefined, credentials: RequestCredentials | undefined): RequestInit | undefined;
|
|
12
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/core/utils.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,WAAW,GAAG,SAAS,EAC7B,WAAW,EAAE,kBAAkB,GAAG,SAAS,GAC1C,WAAW,GAAG,SAAS,CAEzB"}
|
package/dist/dom/animations.d.ts
CHANGED
|
@@ -5,6 +5,17 @@
|
|
|
5
5
|
* user watches the agent type, highlight, and click at human-readable speed.
|
|
6
6
|
* Each is configurable; pass small/zero durations in tests (or use fake timers).
|
|
7
7
|
*/
|
|
8
|
+
/**
|
|
9
|
+
* Whether the user has asked the OS/browser to minimise motion.
|
|
10
|
+
*
|
|
11
|
+
* Honoured by every primitive that *moves* something: the action animations
|
|
12
|
+
* skip their hold delays, `scrollIntoCenterView` jumps instead of gliding, and
|
|
13
|
+
* the focus flash drops its fade while still holding the ring long enough to be
|
|
14
|
+
* seen — reduced motion asks for no animation, not for no feedback. The
|
|
15
|
+
* character-typing and highlight primitives predate this and keep their
|
|
16
|
+
* explicit-duration contract.
|
|
17
|
+
*/
|
|
18
|
+
export declare function prefersReducedMotion(): boolean;
|
|
8
19
|
/** An element whose `value` can be typed into. */
|
|
9
20
|
export type TextLikeElement = HTMLInputElement | HTMLTextAreaElement;
|
|
10
21
|
export interface TypeOptions {
|
|
@@ -22,23 +33,52 @@ export interface HighlightClickOptions {
|
|
|
22
33
|
}
|
|
23
34
|
/** Outline ``el``, pause so the user sees it, then click and restore. */
|
|
24
35
|
export declare function highlightThenClick(el: HTMLElement, options?: HighlightClickOptions): Promise<void>;
|
|
25
|
-
|
|
26
|
-
|
|
36
|
+
export interface ScrollOptions {
|
|
37
|
+
/**
|
|
38
|
+
* How long to wait for a moving scroll to settle before giving up.
|
|
39
|
+
* Default 600.
|
|
40
|
+
*/
|
|
41
|
+
settleMs?: number;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Scroll ``el`` to the vertical centre of the viewport.
|
|
45
|
+
*
|
|
46
|
+
* The returned promise resolves once the scroll has settled, so a caller can
|
|
47
|
+
* hold its animation until the element has stopped moving — a ring drawn
|
|
48
|
+
* mid-glide lands somewhere the user is not looking yet. Awaiting is optional;
|
|
49
|
+
* the scroll itself is requested synchronously.
|
|
50
|
+
*/
|
|
51
|
+
export declare function scrollIntoCenterView(el: HTMLElement, options?: ScrollOptions): Promise<void>;
|
|
27
52
|
export interface FlashOptions {
|
|
28
|
-
/**
|
|
53
|
+
/**
|
|
54
|
+
* Total milliseconds the ring is on screen, hold plus fade. Default 1200 —
|
|
55
|
+
* long enough for someone who does not yet know where to look to find it.
|
|
56
|
+
*/
|
|
29
57
|
flashMs?: number;
|
|
58
|
+
/** Ring colour. Defaults to the target's `--ag-ui-accent`, else the package accent. */
|
|
59
|
+
color?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Move keyboard focus to the element as well. Defaults to false for
|
|
62
|
+
* {@link flash} and true for {@link focusWithFlash}.
|
|
63
|
+
*/
|
|
64
|
+
focus?: boolean;
|
|
30
65
|
}
|
|
31
|
-
/** Focus ``el`` and briefly flash a ring around it. */
|
|
32
|
-
export declare function focusWithFlash(el: HTMLElement, options?: FlashOptions): Promise<void>;
|
|
33
66
|
/**
|
|
34
|
-
*
|
|
67
|
+
* Flash a ring around ``el`` without touching focus.
|
|
35
68
|
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
* and keep their explicit-duration contract.
|
|
69
|
+
* Prefer this over {@link focusWithFlash} when the point is to *show* the user
|
|
70
|
+
* something: moving focus steals it from the composer, can fire blur validation
|
|
71
|
+
* on whatever they were mid-edit in, and can close an open menu.
|
|
40
72
|
*/
|
|
41
|
-
export declare function
|
|
73
|
+
export declare function flash(el: HTMLElement, options?: FlashOptions): Promise<void>;
|
|
74
|
+
/**
|
|
75
|
+
* Focus ``el`` and flash a ring around it.
|
|
76
|
+
*
|
|
77
|
+
* Focus moves unless ``options.focus`` says otherwise — that is the documented
|
|
78
|
+
* behaviour of this name. Use {@link flash} for a highlight that leaves focus
|
|
79
|
+
* where the user put it.
|
|
80
|
+
*/
|
|
81
|
+
export declare function focusWithFlash(el: HTMLElement, options?: FlashOptions): Promise<void>;
|
|
42
82
|
export interface PressOptions {
|
|
43
83
|
/** Milliseconds to hold the pressed state before clicking. Default 140. */
|
|
44
84
|
pressMs?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animations.d.ts","sourceRoot":"","sources":["../../src/dom/animations.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"animations.d.ts","sourceRoot":"","sources":["../../src/dom/animations.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAqBH;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAE9C;AA0BD,kDAAkD;AAClD,MAAM,MAAM,eAAe,GAAG,gBAAgB,GAAG,mBAAmB,CAAC;AAErE,MAAM,WAAW,WAAW;IAC1B,mDAAmD;IACnD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,wBAAsB,QAAQ,CAC5B,EAAE,EAAE,eAAe,EACnB,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,WAAgB,GACxB,OAAO,CAAC,IAAI,CAAC,CAYf;AAED,MAAM,WAAW,qBAAqB;IACpC,u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gBf;AAED,MAAM,WAAW,aAAa;IAC5B,mDAAmD;IACnD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,wBAAsB,aAAa,CACjC,EAAE,EAAE,gBAAgB,EACpB,OAAO,EAAE,OAAO,EAChB,OAAO,GAAE,aAAkB,GAC1B,OAAO,CAAC,IAAI,CAAC,CASf"}
|
package/dist/dom/dom_driver.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type HighlightClickOptions, type PressOptions, type SelectOptions, type TextLikeElement, type ToggleOptions, type TypeOptions } from "./animations.js";
|
|
1
|
+
import { type FlashOptions, type HighlightClickOptions, type PressOptions, type SelectOptions, type TextLikeElement, type ToggleOptions, type TypeOptions } from "./animations.js";
|
|
2
2
|
/**
|
|
3
3
|
* Generic, framework-free DOM-driving primitives.
|
|
4
4
|
*
|
|
@@ -6,12 +6,18 @@ import { type HighlightClickOptions, type PressOptions, type SelectOptions, type
|
|
|
6
6
|
* (e.g. `django-admin-agent`) wrap these with environment-aware lookups —
|
|
7
7
|
* `fill_field(name, value)` finds `#id_<name>` then calls {@link fillField}.
|
|
8
8
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
/**
|
|
10
|
+
* A field has to hold focus to be typed into, so ``focus`` is not on offer
|
|
11
|
+
* here — everything else the flash takes is.
|
|
12
|
+
*/
|
|
13
|
+
export interface FillFieldOptions extends TypeOptions, Omit<FlashOptions, "focus"> {
|
|
13
14
|
}
|
|
14
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* Scroll to, focus (with a flash), and type ``value`` into a text field.
|
|
17
|
+
*
|
|
18
|
+
* The scroll is awaited: typing into an element that is still gliding past
|
|
19
|
+
* shows the user nothing.
|
|
20
|
+
*/
|
|
15
21
|
export declare function fillField(el: TextLikeElement, value: string, options?: FillFieldOptions): Promise<void>;
|
|
16
22
|
/** Scroll to, highlight, and click an element. */
|
|
17
23
|
export declare function clickElement(el: HTMLElement, options?: HighlightClickOptions): Promise<void>;
|
|
@@ -26,5 +32,4 @@ export declare function toggleCheckbox(el: HTMLInputElement, checked: boolean, o
|
|
|
26
32
|
* ``input`` and ``change`` events frameworks listen for.
|
|
27
33
|
*/
|
|
28
34
|
export declare function setControlValue(el: HTMLInputElement | HTMLSelectElement, value: string | boolean): void;
|
|
29
|
-
export {};
|
|
30
35
|
//# sourceMappingURL=dom_driver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dom_driver.d.ts","sourceRoot":"","sources":["../../src/dom/dom_driver.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"dom_driver.d.ts","sourceRoot":"","sources":["../../src/dom/dom_driver.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EAEjB,KAAK,qBAAqB,EAE1B,KAAK,YAAY,EAEjB,KAAK,aAAa,EAGlB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,WAAW,EAGjB,MAAM,iBAAiB,CAAC;AAGzB;;;;;;GAMG;AAEH;;;GAGG;AACH,MAAM,WAAW,gBAAiB,SAAQ,WAAW,EAAE,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC;CAAG;AAErF;;;;;GAKG;AACH,wBAAsB,SAAS,CAC7B,EAAE,EAAE,eAAe,EACnB,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,IAAI,CAAC,CAIf;AAED,kDAAkD;AAClD,wBAAsB,YAAY,CAChC,EAAE,EAAE,WAAW,EACf,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAAC,IAAI,CAAC,CAGf;AAED,gFAAgF;AAChF,wBAAsB,WAAW,CAAC,EAAE,EAAE,WAAW,EAAE,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAG5F;AAED,qFAAqF;AACrF,wBAAsB,aAAa,CACjC,EAAE,EAAE,iBAAiB,EACrB,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,aAAkB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAGf;AAED,kFAAkF;AAClF,wBAAsB,cAAc,CAClC,EAAE,EAAE,gBAAgB,EACpB,OAAO,EAAE,OAAO,EAChB,OAAO,GAAE,aAAkB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAGf;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,EAAE,EAAE,gBAAgB,GAAG,iBAAiB,EACxC,KAAK,EAAE,MAAM,GAAG,OAAO,GACtB,IAAI,CAQN"}
|
package/dist/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export { RemoteConversationStore } from "./core/remote_conversation_store.js";
|
|
|
9
9
|
export { RunIndex, type RunRow } from "./core/run_index.js";
|
|
10
10
|
export { type TranscribeHandler, type TranscribeOptions, transcribeAudio, } from "./core/transcribe_audio.js";
|
|
11
11
|
export { type UploadHandler, type UploadOptions, uploadAttachment, } from "./core/upload_attachment.js";
|
|
12
|
-
export { type FlashOptions, focusWithFlash, type HighlightClickOptions, highlightThenClick, type PressOptions, prefersReducedMotion, pressThenClick, type SelectOptions, scrollIntoCenterView, selectOption, type TextLikeElement, type ToggleOptions, type TypeOptions, toggleControl, typeInto, } from "./dom/animations.js";
|
|
12
|
+
export { type FlashOptions, flash, focusWithFlash, type HighlightClickOptions, highlightThenClick, type PressOptions, prefersReducedMotion, pressThenClick, type ScrollOptions, type SelectOptions, scrollIntoCenterView, selectOption, type TextLikeElement, type ToggleOptions, type TypeOptions, toggleControl, typeInto, } from "./dom/animations.js";
|
|
13
13
|
export { clickElement, type FillFieldOptions, fillField, pressButton, selectControl, setControlValue, toggleCheckbox, } from "./dom/dom_driver.js";
|
|
14
14
|
export { setNativeChecked, setNativeValue } from "./dom/native_setter.js";
|
|
15
15
|
export type { Skill } from "./skills/skill.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","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