@artooi/ag-ui-web-component 0.22.0 → 0.23.1
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 +134 -36
- package/README.md +7 -7
- package/dist/ag-ui-web-component.bundle.js +145 -118
- package/dist/ag-ui-web-component.bundle.js.map +3 -3
- package/dist/constants.d.ts +65 -78
- package/dist/constants.d.ts.map +1 -1
- package/dist/core/ag_ui_chat.d.ts +93 -126
- package/dist/core/ag_ui_chat.d.ts.map +1 -1
- package/dist/core/agui_client.d.ts +24 -30
- package/dist/core/agui_client.d.ts.map +1 -1
- package/dist/core/attachment.d.ts +9 -14
- package/dist/core/attachment.d.ts.map +1 -1
- package/dist/core/conversation_store.d.ts +20 -27
- package/dist/core/conversation_store.d.ts.map +1 -1
- package/dist/core/create_http_agent.d.ts +13 -15
- package/dist/core/create_http_agent.d.ts.map +1 -1
- package/dist/core/remote_conversation_store.d.ts +8 -9
- package/dist/core/remote_conversation_store.d.ts.map +1 -1
- package/dist/core/run_index.d.ts +11 -20
- package/dist/core/run_index.d.ts.map +1 -1
- package/dist/core/transcribe_audio.d.ts +8 -8
- package/dist/core/transcribe_audio.d.ts.map +1 -1
- package/dist/core/upload_attachment.d.ts +15 -18
- package/dist/core/upload_attachment.d.ts.map +1 -1
- package/dist/core/utils.d.ts +4 -6
- package/dist/core/utils.d.ts.map +1 -1
- package/dist/dom/animations.d.ts +22 -30
- package/dist/dom/animations.d.ts.map +1 -1
- package/dist/dom/dom_driver.d.ts +7 -7
- package/dist/dom/native_setter.d.ts +2 -2
- package/dist/dom/native_setter.d.ts.map +1 -1
- package/dist/index.js +347 -401
- package/dist/index.js.map +2 -2
- package/dist/skills/fill_template.d.ts +4 -5
- package/dist/skills/fill_template.d.ts.map +1 -1
- package/dist/skills/parse_skills.d.ts.map +1 -1
- package/dist/skills/skill.d.ts +7 -8
- package/dist/skills/skill.d.ts.map +1 -1
- package/dist/tools/client_tool_registry.d.ts +2 -2
- package/dist/tools/page_action_tools.d.ts +7 -10
- package/dist/tools/page_action_tools.d.ts.map +1 -1
- package/dist/tools/page_state.d.ts +5 -8
- package/dist/tools/page_state.d.ts.map +1 -1
- package/dist/tools/route_map.d.ts +7 -10
- package/dist/tools/route_map.d.ts.map +1 -1
- package/dist/ui/approval_card.d.ts +15 -20
- package/dist/ui/approval_card.d.ts.map +1 -1
- package/dist/ui/attach_copy_buttons.d.ts +4 -10
- package/dist/ui/attach_copy_buttons.d.ts.map +1 -1
- package/dist/ui/attachment_chips.d.ts +13 -5
- package/dist/ui/attachment_chips.d.ts.map +1 -1
- package/dist/ui/attachment_tray.d.ts +6 -6
- package/dist/ui/attachment_tray.d.ts.map +1 -1
- package/dist/ui/checkpoint_menu.d.ts +7 -8
- package/dist/ui/checkpoint_menu.d.ts.map +1 -1
- package/dist/ui/confirmation_card.d.ts +10 -15
- package/dist/ui/confirmation_card.d.ts.map +1 -1
- package/dist/ui/question_card.d.ts +12 -15
- package/dist/ui/question_card.d.ts.map +1 -1
- package/dist/ui/relative_time.d.ts +5 -7
- package/dist/ui/relative_time.d.ts.map +1 -1
- package/dist/ui/render_markdown.d.ts +8 -8
- package/dist/ui/render_markdown.d.ts.map +1 -1
- package/dist/ui/resize_handle.d.ts +21 -34
- package/dist/ui/resize_handle.d.ts.map +1 -1
- package/dist/ui/run_notice.d.ts +5 -7
- package/dist/ui/run_notice.d.ts.map +1 -1
- package/dist/ui/skills_menu.d.ts +4 -5
- package/dist/ui/skills_menu.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/thoughts_block.d.ts +9 -11
- package/dist/ui/thoughts_block.d.ts.map +1 -1
- package/dist/ui/thread_drawer.d.ts +6 -5
- package/dist/ui/thread_drawer.d.ts.map +1 -1
- package/dist/ui/tool_call_card.d.ts +17 -25
- package/dist/ui/tool_call_card.d.ts.map +1 -1
- package/dist/ui/ui_strings.d.ts +6 -12
- package/dist/ui/ui_strings.d.ts.map +1 -1
- package/dist/ui/voice_input.d.ts +10 -11
- package/dist/ui/voice_input.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/constants.ts +71 -80
- package/src/core/ag_ui_chat.ts +242 -292
- package/src/core/agui_client.ts +60 -71
- package/src/core/attachment.ts +9 -14
- package/src/core/conversation_store.ts +25 -33
- package/src/core/create_http_agent.ts +18 -22
- package/src/core/remote_conversation_store.ts +14 -15
- package/src/core/run_index.ts +14 -23
- package/src/core/transcribe_audio.ts +9 -10
- package/src/core/upload_attachment.ts +18 -21
- package/src/core/utils.ts +4 -6
- package/src/dom/animations.ts +33 -43
- package/src/dom/dom_driver.ts +7 -7
- package/src/dom/native_setter.ts +11 -12
- package/src/skills/fill_template.ts +4 -5
- package/src/skills/parse_skills.ts +3 -4
- package/src/skills/skill.ts +7 -8
- package/src/tools/client_tool_registry.ts +2 -2
- package/src/tools/page_action_tools.ts +12 -15
- package/src/tools/page_state.ts +5 -8
- package/src/tools/route_map.ts +15 -19
- package/src/ui/approval_card.ts +15 -20
- package/src/ui/attach_copy_buttons.ts +9 -18
- package/src/ui/attachment_chips.ts +19 -10
- package/src/ui/attachment_tray.ts +8 -7
- package/src/ui/checkpoint_menu.ts +7 -8
- package/src/ui/confirmation_card.ts +10 -15
- package/src/ui/question_card.ts +12 -15
- package/src/ui/relative_time.ts +5 -7
- package/src/ui/render_markdown.ts +25 -51
- package/src/ui/resize_handle.ts +25 -38
- package/src/ui/run_notice.ts +9 -12
- package/src/ui/skills_menu.ts +4 -5
- package/src/ui/styles.ts +122 -93
- package/src/ui/thoughts_block.ts +11 -13
- package/src/ui/thread_drawer.ts +6 -5
- package/src/ui/tool_call_card.ts +22 -32
- package/src/ui/ui_strings.ts +6 -12
- package/src/ui/voice_input.ts +10 -11
- package/src/version.ts +1 -1
|
@@ -6,12 +6,11 @@ export interface TemplateResult {
|
|
|
6
6
|
readonly missing: readonly string[];
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
|
-
* Substitute `{name}` placeholders in
|
|
9
|
+
* Substitute `{name}` placeholders in `template` from `values`.
|
|
10
10
|
*
|
|
11
|
-
* A placeholder whose value is missing,
|
|
12
|
-
* verbatim and reported in
|
|
13
|
-
*
|
|
14
|
-
* half-filled prompt.
|
|
11
|
+
* A placeholder whose value is missing, `null`, or an empty string is left
|
|
12
|
+
* verbatim and reported in `missing`, so the caller can block the send rather
|
|
13
|
+
* than dispatch a half-filled prompt.
|
|
15
14
|
*/
|
|
16
15
|
export declare function fillTemplate(template: string, values: Record<string, unknown>): TemplateResult;
|
|
17
16
|
//# sourceMappingURL=fill_template.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fill_template.d.ts","sourceRoot":"","sources":["../../src/skills/fill_template.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,MAAM,WAAW,cAAc;IAC7B,6DAA6D;IAC7D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,gFAAgF;IAChF,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAID
|
|
1
|
+
{"version":3,"file":"fill_template.d.ts","sourceRoot":"","sources":["../../src/skills/fill_template.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,MAAM,WAAW,cAAc;IAC7B,6DAA6D;IAC7D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,gFAAgF;IAChF,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAID;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,cAAc,CAa9F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse_skills.d.ts","sourceRoot":"","sources":["../../src/skills/parse_skills.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"parse_skills.d.ts","sourceRoot":"","sources":["../../src/skills/parse_skills.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAoBxC;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,EAAE,CAKnD"}
|
package/dist/skills/skill.d.ts
CHANGED
|
@@ -15,17 +15,16 @@ export interface Skill {
|
|
|
15
15
|
* The prompt to send. May contain `{placeholder}`s filled from the host's
|
|
16
16
|
* skill context before send; an unfilled placeholder blocks send.
|
|
17
17
|
*
|
|
18
|
-
*
|
|
19
|
-
* `/name` token
|
|
20
|
-
*
|
|
21
|
-
*
|
|
18
|
+
* Omit it to keep the prompt server-side: the skill then sends the bare
|
|
19
|
+
* `/name` token for the agent to resolve, and the wording never reaches the
|
|
20
|
+
* browser. Prefer that for anything internal — a fetched catalog is a plain
|
|
21
|
+
* GET and an embedded one sits in the page source.
|
|
22
22
|
*/
|
|
23
23
|
readonly prompt?: string;
|
|
24
24
|
/**
|
|
25
|
-
* Set `false` to pre-fill the composer instead of sending on pick.
|
|
26
|
-
* meaningful for a skill
|
|
27
|
-
*
|
|
28
|
-
* anything is a two-step shortcut.
|
|
25
|
+
* Set `false` to pre-fill the composer instead of sending on pick. Defaults
|
|
26
|
+
* to sending, and is only meaningful for a skill carrying its own `prompt`;
|
|
27
|
+
* a server-resolved one always sends.
|
|
29
28
|
*/
|
|
30
29
|
readonly sendImmediately?: boolean;
|
|
31
30
|
/** Also surface this skill as a chip (default false; the palette shows all). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill.d.ts","sourceRoot":"","sources":["../../src/skills/skill.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,KAAK;IACpB,2DAA2D;IAC3D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,4CAA4C;IAC5C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,2CAA2C;IAC3C,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B;;;;;;;;OAQG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB
|
|
1
|
+
{"version":3,"file":"skill.d.ts","sourceRoot":"","sources":["../../src/skills/skill.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,KAAK;IACpB,2DAA2D;IAC3D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,4CAA4C;IAC5C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,2CAA2C;IAC3C,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B;;;;;;;;OAQG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IACnC,gFAAgF;IAChF,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;CACzB"}
|
|
@@ -24,8 +24,8 @@ export declare class ClientToolRegistry {
|
|
|
24
24
|
/**
|
|
25
25
|
* Register a tool, replacing any existing one with the same name.
|
|
26
26
|
*
|
|
27
|
-
* Idempotent on the name so re-fired host
|
|
28
|
-
* double-invoke
|
|
27
|
+
* Idempotent on the name so a re-fired host ref or React StrictMode's
|
|
28
|
+
* double-invoke replaces rather than throws.
|
|
29
29
|
*/
|
|
30
30
|
register(tool: ClientTool): void;
|
|
31
31
|
has(name: string): boolean;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import type { ClientTool } from "./client_tool_registry.js";
|
|
2
2
|
/**
|
|
3
3
|
* Resolve a page-action target string to a host-page element, or `null` when it
|
|
4
|
-
* matches nothing. The default
|
|
5
|
-
*
|
|
6
|
-
* the same way host packages wrap the DOM-driver primitives with environment-
|
|
7
|
-
* aware lookups.
|
|
4
|
+
* matches nothing. The default treats the string as a CSS selector; a host with
|
|
5
|
+
* a page map overrides it to map its own element ids.
|
|
8
6
|
*/
|
|
9
7
|
export type ResolvePageTarget = (target: string) => HTMLElement | null;
|
|
10
8
|
/** The built-in page-action tool tokens, opted in via `data-page-actions`. */
|
|
@@ -19,13 +17,12 @@ export declare const PAGE_ACTIONS: {
|
|
|
19
17
|
* - `scroll_to` — scroll a target (`top` / `bottom` / a resolver target) into
|
|
20
18
|
* view. Benign; no confirmation.
|
|
21
19
|
* - `drag_and_drop` — drag one element onto another, firing the standard HTML5
|
|
22
|
-
* drag sequence so the host page's own drop handler reacts.
|
|
23
|
-
* destructive: a drag rearranges transient state and the durable
|
|
24
|
-
* happens at the page's explicit commit. A host whose page persists
|
|
25
|
-
*
|
|
20
|
+
* drag sequence so the host page's own drop handler reacts. Deliberately not
|
|
21
|
+
* stamped destructive: a drag rearranges transient state, and the durable
|
|
22
|
+
* change happens at the page's explicit commit. A host whose page persists on
|
|
23
|
+
* drop must gate it with the element's `confirmPredicate`.
|
|
26
24
|
*
|
|
27
|
-
* Both report a
|
|
28
|
-
* rather than throwing an opaque crash.
|
|
25
|
+
* Both report a model-readable error when a target resolves to nothing.
|
|
29
26
|
*/
|
|
30
27
|
export declare function createPageActionTools(enabled: ReadonlySet<string>, resolveTarget: ResolvePageTarget): ClientTool[];
|
|
31
28
|
//# sourceMappingURL=page_action_tools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page_action_tools.d.ts","sourceRoot":"","sources":["../../src/tools/page_action_tools.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5D
|
|
1
|
+
{"version":3,"file":"page_action_tools.d.ts","sourceRoot":"","sources":["../../src/tools/page_action_tools.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5D;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,WAAW,GAAG,IAAI,CAAC;AAEvE,8EAA8E;AAC9E,eAAO,MAAM,YAAY;aACvB,MAAM,EAAE,QAAQ;aAChB,IAAI,EAAE,MAAM;CACJ,CAAC;AAEX;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,EAC5B,aAAa,EAAE,iBAAiB,GAC/B,UAAU,EAAE,CASd"}
|
|
@@ -5,11 +5,9 @@ import type { ClientTool } from "./client_tool_registry.js";
|
|
|
5
5
|
* Ergonomic sugar over `registerTool` for SPA state (Redux/Zustand/signals):
|
|
6
6
|
* generates a read tool and, when `write` is given, a destructive set tool.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* which is why this no longer carries the word "hook" — the old name read as
|
|
12
|
-
* protocol state sync, which this component does not implement.
|
|
8
|
+
* Not AG-UI shared state. `STATE_SNAPSHOT` / `STATE_DELTA` are protocol events
|
|
9
|
+
* carrying state between agent and client; these are ordinary client tools the
|
|
10
|
+
* agent calls like any other.
|
|
13
11
|
*/
|
|
14
12
|
export interface PageState {
|
|
15
13
|
/** Base name; tools become `read_<name>` and `set_<name>`. */
|
|
@@ -27,9 +25,8 @@ export interface PageState {
|
|
|
27
25
|
*/
|
|
28
26
|
export declare function createPageStateTools(binding: PageState): ClientTool[];
|
|
29
27
|
/**
|
|
30
|
-
* @deprecated Renamed to {@link PageState}
|
|
31
|
-
* shared-state sync
|
|
32
|
-
* does not implement. Will be removed in a future major.
|
|
28
|
+
* @deprecated Renamed to {@link PageState} — the old name read as AG-UI
|
|
29
|
+
* shared-state sync. Will be removed in a future major.
|
|
33
30
|
*/
|
|
34
31
|
export type StateHook = PageState;
|
|
35
32
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page_state.d.ts","sourceRoot":"","sources":["../../src/tools/page_state.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5D
|
|
1
|
+
{"version":3,"file":"page_state.d.ts","sourceRoot":"","sources":["../../src/tools/page_state.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5D;;;;;;;;;GASG;AACH,MAAM,WAAW,SAAS;IACxB,8DAA8D;IAC9D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,uCAAuC;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,OAAO,CAAC;IAC7B,0EAA0E;IAC1E,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC;IAC5D,uEAAuE;IACvE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC3C;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,SAAS,GAAG,UAAU,EAAE,CA4BrE;AAED;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,SAAS,CAAC;AAElC;;;GAGG;AACH,eAAO,MAAM,oBAAoB,6BAAuB,CAAC"}
|
|
@@ -5,9 +5,8 @@ export interface Route {
|
|
|
5
5
|
readonly id: string;
|
|
6
6
|
/**
|
|
7
7
|
* The URL path to navigate to. May contain `:name` placeholders for dynamic
|
|
8
|
-
* segments (e.g. `/admin/shop/book/:pk/change/`)
|
|
9
|
-
*
|
|
10
|
-
* parameterised — few pages have a truly static path.
|
|
8
|
+
* segments (e.g. `/admin/shop/book/:pk/change/`), which the agent fills via
|
|
9
|
+
* `navigate_to_route`'s `params` argument.
|
|
11
10
|
*/
|
|
12
11
|
readonly path: string;
|
|
13
12
|
/** Human label shown to the agent. */
|
|
@@ -28,13 +27,11 @@ export interface RouteWithParams extends Route {
|
|
|
28
27
|
* The built-in `route.*` tools, bound to live getters so a host can set
|
|
29
28
|
* `routeMap` / `navigate` before or after mount.
|
|
30
29
|
*
|
|
31
|
-
* `list_routes` is read-only and advertises each route's
|
|
32
|
-
*
|
|
33
|
-
* `x-navigates` so an MPA reload
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* routes client-side instead and the run loop simply continues — see
|
|
37
|
-
* `AgUiChat`'s execute path.
|
|
30
|
+
* `list_routes` is read-only and advertises each route's `pathParams` so the
|
|
31
|
+
* model knows what to supply. `navigate_to_route` fills those params, appends
|
|
32
|
+
* the rest as a query string, and is stamped `x-navigates` so an MPA reload
|
|
33
|
+
* checkpoints and resumes; with a host `navigate(path)` callback (an SPA) it
|
|
34
|
+
* routes client-side and the run loop continues instead.
|
|
38
35
|
*/
|
|
39
36
|
export declare function createRouteTools(getRouteMap: () => RouteMap, getNavigate: () => ((path: string) => void) | null): ClientTool[];
|
|
40
37
|
//# sourceMappingURL=route_map.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route_map.d.ts","sourceRoot":"","sources":["../../src/tools/route_map.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5D,gEAAgE;AAChE,MAAM,WAAW,KAAK;IACpB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB
|
|
1
|
+
{"version":3,"file":"route_map.d.ts","sourceRoot":"","sources":["../../src/tools/route_map.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5D,gEAAgE;AAChE,MAAM,WAAW,KAAK;IACpB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,sCAAsC;IACtC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,kDAAkD;IAClD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,4DAA4D;IAC5D,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,qDAAqD;AACrD,MAAM,MAAM,QAAQ,GAAG,SAAS,KAAK,EAAE,CAAC;AAExC,yEAAyE;AACzE,MAAM,WAAW,eAAgB,SAAQ,KAAK;IAC5C,8EAA8E;IAC9E,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;CACxC;AA+CD;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,MAAM,QAAQ,EAC3B,WAAW,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,IAAI,GACjD,UAAU,EAAE,CA6Cd"}
|
|
@@ -13,9 +13,8 @@ export interface ApprovalRequest {
|
|
|
13
13
|
/** Options for {@link requestApproval}. */
|
|
14
14
|
export interface ApprovalOptions {
|
|
15
15
|
/**
|
|
16
|
-
* Aborting this signal resolves the card as
|
|
17
|
-
* `data-resolved="denied"`
|
|
18
|
-
* pending approval when the user cancels the whole run.
|
|
16
|
+
* Aborting this signal resolves the card as denied, with buttons disabled and
|
|
17
|
+
* `data-resolved="denied"` — how a Stop control dismisses a pending approval.
|
|
19
18
|
*/
|
|
20
19
|
signal?: AbortSignal;
|
|
21
20
|
/** Localized strings; defaults to the English {@link DEFAULT_UI_STRINGS}. */
|
|
@@ -23,29 +22,25 @@ export interface ApprovalOptions {
|
|
|
23
22
|
}
|
|
24
23
|
/**
|
|
25
24
|
* A fully custom renderer for a server-side-tool approval, set via
|
|
26
|
-
* `AgUiChat.approvalRenderer`. Receives the {@link ApprovalRequest}
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* anything else. See the `strings` / `::part()` seams for styling the built-in
|
|
32
|
-
* card instead of replacing it.
|
|
25
|
+
* `AgUiChat.approvalRenderer`. Receives the {@link ApprovalRequest} and an
|
|
26
|
+
* `AbortSignal` that fires when the run is stopped, and resolves `true` to
|
|
27
|
+
* approve or `false` to deny. Replaces the built-in {@link requestApproval}
|
|
28
|
+
* card entirely, the host owning the DOM; to restyle the built-in card instead,
|
|
29
|
+
* use the `strings` and `::part()` seams.
|
|
33
30
|
*/
|
|
34
31
|
export type ApprovalRenderer = (request: ApprovalRequest, options: {
|
|
35
32
|
signal: AbortSignal;
|
|
36
33
|
}) => Promise<boolean>;
|
|
37
34
|
/**
|
|
38
|
-
* Append an inline
|
|
39
|
-
*
|
|
35
|
+
* Append an inline approval card to `host` and resolve `true` to run a gated
|
|
36
|
+
* server-side tool or `false` to deny it.
|
|
40
37
|
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
* transcript as a resolved record (buttons disabled, `data-resolved` set)
|
|
48
|
-
* rather than vanishing.
|
|
38
|
+
* Distinct from the client-tool confirmation card
|
|
39
|
+
* ({@link requestConfirmation}): a gated server tool defers instead of
|
|
40
|
+
* executing, so the run finishes on an AG-UI interrupt the client answers with
|
|
41
|
+
* `resume[]`, and this is the browser half of that loop. Unlike the
|
|
42
|
+
* confirmation card, this one stays in the transcript as a resolved record,
|
|
43
|
+
* buttons disabled and `data-resolved` set.
|
|
49
44
|
*/
|
|
50
45
|
export declare function requestApproval(host: Node & ParentNode, request: ApprovalRequest, options?: ApprovalOptions): Promise<boolean>;
|
|
51
46
|
//# sourceMappingURL=approval_card.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"approval_card.d.ts","sourceRoot":"","sources":["../../src/ui/approval_card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAErE,iFAAiF;AACjF,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAYD,2CAA2C;AAC3C,MAAM,WAAW,eAAe;IAC9B
|
|
1
|
+
{"version":3,"file":"approval_card.d.ts","sourceRoot":"","sources":["../../src/ui/approval_card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAErE,iFAAiF;AACjF,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAYD,2CAA2C;AAC3C,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAC7B,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE,KAC7B,OAAO,CAAC,OAAO,CAAC,CAAC;AAEtB;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,IAAI,GAAG,UAAU,EACvB,OAAO,EAAE,eAAe,EACxB,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,OAAO,CAAC,CAkDlB"}
|
|
@@ -2,17 +2,11 @@ import type { UiStrings } from "./ui_strings.js";
|
|
|
2
2
|
/**
|
|
3
3
|
* Give every fenced code block in `root` a copy button.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* made harder than the page around it.
|
|
5
|
+
* Call only on finished bubbles: the streaming bubble reassigns its `innerHTML`
|
|
6
|
+
* on every delta, so a button attached mid-stream is discarded and rebuilt for
|
|
7
|
+
* each one.
|
|
9
8
|
*
|
|
10
|
-
*
|
|
11
|
-
* `innerHTML` on every delta, so a button attached mid-stream would be
|
|
12
|
-
* discarded and rebuilt for each one; waiting until the turn ends costs
|
|
13
|
-
* nothing and does that work once.
|
|
14
|
-
*
|
|
15
|
-
* Idempotent: a bubble already processed is skipped, so a re-render or a second
|
|
9
|
+
* Idempotent — a bubble already processed is skipped, so a re-render or a second
|
|
16
10
|
* call cannot stack buttons.
|
|
17
11
|
*/
|
|
18
12
|
export declare function attachCopyButtons(root: ParentNode, strings: UiStrings): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attach_copy_buttons.d.ts","sourceRoot":"","sources":["../../src/ui/attach_copy_buttons.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAKjD
|
|
1
|
+
{"version":3,"file":"attach_copy_buttons.d.ts","sourceRoot":"","sources":["../../src/ui/attach_copy_buttons.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAKjD;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,GAAG,IAAI,CAS5E"}
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import type { AttachmentRef } from "../core/attachment.js";
|
|
2
2
|
/**
|
|
3
|
-
* Render the read-only attachment chips
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
3
|
+
* Render the read-only attachment chips on a sent user message bubble and on
|
|
4
|
+
* restored history — one chip per ref with a type icon, filename, and human
|
|
5
|
+
* size. Static: no progress and no remove, both of which live in the composer
|
|
6
|
+
* tray.
|
|
7
7
|
*/
|
|
8
8
|
export declare function renderAttachmentChips(refs: readonly AttachmentRef[]): HTMLDivElement;
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* A coarse type mark for a chip — image, PDF, text document, or generic file —
|
|
11
|
+
* as inline SVG markup rather than a character, so it matches the composer's
|
|
12
|
+
* SVG buttons in weight and takes the glyph size and `currentColor`, which
|
|
13
|
+
* emoji do not.
|
|
14
|
+
*
|
|
15
|
+
* The MIME string only selects among author-written constants and is never
|
|
16
|
+
* interpolated into one, so the result is safe to assign as markup.
|
|
17
|
+
*/
|
|
10
18
|
export declare function iconFor(mime: string): string;
|
|
11
19
|
/** A compact human-readable byte size (e.g. `1.2 MB`). */
|
|
12
20
|
export declare function formatBytes(bytes: number): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachment_chips.d.ts","sourceRoot":"","sources":["../../src/ui/attachment_chips.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"attachment_chips.d.ts","sourceRoot":"","sources":["../../src/ui/attachment_chips.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,SAAS,aAAa,EAAE,GAAG,cAAc,CAQpF;AA4BD;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAW5C;AAED,0DAA0D;AAC1D,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAajD"}
|
|
@@ -16,13 +16,13 @@ export interface AttachmentTrayConfig {
|
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
18
|
* The composer's pending-attachments tray: a chip per picked file with a
|
|
19
|
-
* progress bar while it uploads, settling to a ready chip
|
|
20
|
-
* ref
|
|
21
|
-
*
|
|
22
|
-
*
|
|
19
|
+
* progress bar while it uploads, settling to a ready chip holding the durable
|
|
20
|
+
* ref or an error chip with retry. A stateful view like {@link ThreadDrawer}:
|
|
21
|
+
* the host appends {@link element}, calls {@link add} on pick or drop, reads
|
|
22
|
+
* {@link readyRefs} on send, and clears it.
|
|
23
23
|
*
|
|
24
|
-
* Client-side size
|
|
25
|
-
* uploading
|
|
24
|
+
* Client-side size and type guards reject a bad file into an error chip without
|
|
25
|
+
* uploading, for instant feedback, but the server stays the authority.
|
|
26
26
|
*/
|
|
27
27
|
export declare class AttachmentTray {
|
|
28
28
|
#private;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachment_tray.d.ts","sourceRoot":"","sources":["../../src/ui/attachment_tray.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAElE,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAKrE,yDAAyD;AACzD,MAAM,WAAW,oBAAoB;IACnC,6EAA6E;IAC7E,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,oFAAoF;IACpF,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,qEAAqE;IACrE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,yEAAyE;IACzE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,6EAA6E;IAC7E,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC;CAC9B;AAcD;;;;;;;;;GASG;AACH,qBAAa,cAAc;;IACzB,qEAAqE;IACrE,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IAMjC,YAAY,MAAM,EAAE,oBAAoB,EAOvC;IAED,gFAAgF;IAChF,GAAG,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAsBpB;IAED,8DAA8D;IAC9D,SAAS,IAAI,SAAS,aAAa,EAAE,CAQpC;IAED,gFAAgF;IAChF,UAAU,IAAI,OAAO,CAEpB;IAED,+EAA+E;IAC/E,YAAY,IAAI,MAAM,CAErB;IAED,uCAAuC;IACvC,OAAO,IAAI,OAAO,CAEjB;IAED,2EAA2E;IAC3E,UAAU,IAAI,IAAI,CAGjB;IAED,2EAA2E;IAC3E,KAAK,IAAI,IAAI,CAMZ;IAED;;;;OAIG;IACH,OAAO,IAAI,IAAI,CAId;
|
|
1
|
+
{"version":3,"file":"attachment_tray.d.ts","sourceRoot":"","sources":["../../src/ui/attachment_tray.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAElE,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAKrE,yDAAyD;AACzD,MAAM,WAAW,oBAAoB;IACnC,6EAA6E;IAC7E,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,oFAAoF;IACpF,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,qEAAqE;IACrE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,yEAAyE;IACzE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,6EAA6E;IAC7E,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC;CAC9B;AAcD;;;;;;;;;GASG;AACH,qBAAa,cAAc;;IACzB,qEAAqE;IACrE,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IAMjC,YAAY,MAAM,EAAE,oBAAoB,EAOvC;IAED,gFAAgF;IAChF,GAAG,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAsBpB;IAED,8DAA8D;IAC9D,SAAS,IAAI,SAAS,aAAa,EAAE,CAQpC;IAED,gFAAgF;IAChF,UAAU,IAAI,OAAO,CAEpB;IAED,+EAA+E;IAC/E,YAAY,IAAI,MAAM,CAErB;IAED,uCAAuC;IACvC,OAAO,IAAI,OAAO,CAEjB;IAED,2EAA2E;IAC3E,UAAU,IAAI,IAAI,CAGjB;IAED,2EAA2E;IAC3E,KAAK,IAAI,IAAI,CAMZ;IAED;;;;OAIG;IACH,OAAO,IAAI,IAAI,CAId;CAqIF"}
|
|
@@ -5,16 +5,15 @@ export type CheckpointVerb = "resume" | "fork";
|
|
|
5
5
|
/**
|
|
6
6
|
* The checkpoint panel: continuable runs, each offering **resume** or **fork**.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* would make "resume" look like "open", which it isn't: resuming starts a new
|
|
8
|
+
* Deliberately separate from the thread drawer: a thread is a conversation you
|
|
9
|
+
* switch to, a checkpoint is a run you continue from, and one thread holds
|
|
10
|
+
* many. One list would make "resume" read as "open", when resuming starts a new
|
|
12
11
|
* run seeded from a snapshot.
|
|
13
12
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
13
|
+
* The host feeds only rows the server marked `continuable`, a run without a
|
|
14
|
+
* snapshot having nothing to resume from. Pure DOM, like {@link SkillsMenu}:
|
|
15
|
+
* append {@link element}, toggle it, feed {@link setRuns}, act on
|
|
16
|
+
* {@link onPick}.
|
|
18
17
|
*/
|
|
19
18
|
export declare class CheckpointMenu {
|
|
20
19
|
#private;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkpoint_menu.d.ts","sourceRoot":"","sources":["../../src/ui/checkpoint_menu.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAErE,2CAA2C;AAC3C,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE/C
|
|
1
|
+
{"version":3,"file":"checkpoint_menu.d.ts","sourceRoot":"","sources":["../../src/ui/checkpoint_menu.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAErE,2CAA2C;AAC3C,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE/C;;;;;;;;;;;;GAYG;AACH,qBAAa,cAAc;;IACzB,qEAAqE;IACrE,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IAUjC,YACE,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,KAAK,IAAI,EACrD,OAAO,GAAE,SAA8B,EA+BxC;IAED,iEAAiE;IACjE,OAAO,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAGrC;IAED,oEAAoE;IACpE,UAAU,CAAC,OAAO,EAAE,SAAS,GAAG,IAAI,CAKnC;IAED,IAAI,IAAI,IAAI,CAYX;IAED,KAAK,IAAI,IAAI,CAOZ;IAqCD,IAAI,KAAK,IAAI,OAAO,CAEnB;CA+DF"}
|
|
@@ -12,29 +12,24 @@ export interface ConfirmationRequest {
|
|
|
12
12
|
/** Options for {@link requestConfirmation}. */
|
|
13
13
|
export interface ConfirmationOptions {
|
|
14
14
|
/**
|
|
15
|
-
* Aborting this signal resolves the card as declined
|
|
16
|
-
* `data-resolved="declined"`
|
|
17
|
-
*
|
|
15
|
+
* Aborting this signal resolves the card as declined, with buttons disabled
|
|
16
|
+
* and `data-resolved="declined"` — how a Stop control dismisses a pending
|
|
17
|
+
* confirmation.
|
|
18
18
|
*/
|
|
19
19
|
signal?: AbortSignal;
|
|
20
20
|
/** Localized strings; defaults to the English {@link DEFAULT_UI_STRINGS}. */
|
|
21
21
|
strings?: UiStrings;
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
|
-
* Append an inline confirmation card to
|
|
25
|
-
* resolve
|
|
24
|
+
* Append an inline confirmation card to `host` (the chat message list) and
|
|
25
|
+
* resolve `true` on confirm, `false` on cancel.
|
|
26
26
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* steals focus from the page. Resolves ``true`` on confirm, ``false`` on
|
|
30
|
-
* cancel.
|
|
27
|
+
* The card lives in the transcript rather than in a modal overlay, so it reads
|
|
28
|
+
* after the assistant's explanation and never steals focus from the page.
|
|
31
29
|
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* everything else. The tool card this gates is that record — it settles to
|
|
36
|
-
* `done` or `declined` and carries the decision. Leaving the spent form in
|
|
37
|
-
* place made an answered question read as outstanding.
|
|
30
|
+
* Answering it removes it: the record of the decision belongs to the tool card
|
|
31
|
+
* this gates, which settles to `done` or `declined` and carries it. A spent
|
|
32
|
+
* form left in place reads as still outstanding.
|
|
38
33
|
*/
|
|
39
34
|
export declare function requestConfirmation(host: Node & ParentNode, request: ConfirmationRequest, options?: ConfirmationOptions): Promise<boolean>;
|
|
40
35
|
//# sourceMappingURL=confirmation_card.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confirmation_card.d.ts","sourceRoot":"","sources":["../../src/ui/confirmation_card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAErE,kDAAkD;AAClD,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAYD,+CAA+C;AAC/C,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB;AAED
|
|
1
|
+
{"version":3,"file":"confirmation_card.d.ts","sourceRoot":"","sources":["../../src/ui/confirmation_card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAErE,kDAAkD;AAClD,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAYD,+CAA+C;AAC/C,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,IAAI,GAAG,UAAU,EACvB,OAAO,EAAE,mBAAmB,EAC5B,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,OAAO,CAAC,CAyDlB"}
|
|
@@ -17,9 +17,8 @@ export interface QuestionRequest {
|
|
|
17
17
|
/** Options for {@link requestQuestion}. */
|
|
18
18
|
export interface QuestionOptions {
|
|
19
19
|
/**
|
|
20
|
-
* Aborting this signal resolves the card with an empty answer
|
|
21
|
-
*
|
|
22
|
-
* the user cancels the whole run.
|
|
20
|
+
* Aborting this signal resolves the card with an empty answer and disabled
|
|
21
|
+
* fields — how a Stop control dismisses an open question.
|
|
23
22
|
*/
|
|
24
23
|
signal?: AbortSignal;
|
|
25
24
|
/** Localized strings; defaults to the English {@link DEFAULT_UI_STRINGS}. */
|
|
@@ -29,24 +28,22 @@ export interface QuestionOptions {
|
|
|
29
28
|
* A fully custom renderer for the `ask_user` question, set via
|
|
30
29
|
* `AgUiChat.askUserRenderer`. Receives the parsed {@link QuestionRequest} and an
|
|
31
30
|
* `AbortSignal` that fires when the run is stopped, and resolves with the user's
|
|
32
|
-
* answer
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* else. See the `strings` / `::part()` seams for styling the built-in card
|
|
36
|
-
* instead of replacing it.
|
|
31
|
+
* answer; an empty string means no answer. Replaces the built-in
|
|
32
|
+
* {@link requestQuestion} card entirely — see {@link ApprovalRenderer} for the
|
|
33
|
+
* same seam on approvals.
|
|
37
34
|
*/
|
|
38
35
|
export type QuestionRenderer = (request: QuestionRequest, options: {
|
|
39
36
|
signal: AbortSignal;
|
|
40
37
|
}) => Promise<string>;
|
|
41
38
|
/**
|
|
42
|
-
* Append an inline
|
|
43
|
-
*
|
|
39
|
+
* Append an inline question card to `host` and resolve with the user's answer —
|
|
40
|
+
* the browser half of the built-in `ask_user` frontend tool.
|
|
44
41
|
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
42
|
+
* Collects a typed answer rather than the yes/no the confirmation and approval
|
|
43
|
+
* cards return: a radio pick from `options`, or free text when `allowCustom` is
|
|
44
|
+
* set or no `options` are given. Stays in the transcript as a resolved record,
|
|
45
|
+
* controls disabled and `data-resolved` set; a Stop while it is open resolves
|
|
46
|
+
* it with an empty string.
|
|
50
47
|
*/
|
|
51
48
|
export declare function requestQuestion(host: Node & ParentNode, request: QuestionRequest, options?: QuestionOptions): Promise<string>;
|
|
52
49
|
//# sourceMappingURL=question_card.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"question_card.d.ts","sourceRoot":"","sources":["../../src/ui/question_card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAErE,gFAAgF;AAChF,MAAM,WAAW,eAAe;IAC9B,sCAAsC;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,2CAA2C;AAC3C,MAAM,WAAW,eAAe;IAC9B
|
|
1
|
+
{"version":3,"file":"question_card.d.ts","sourceRoot":"","sources":["../../src/ui/question_card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAErE,gFAAgF;AAChF,MAAM,WAAW,eAAe;IAC9B,sCAAsC;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,2CAA2C;AAC3C,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAC7B,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE,KAC7B,OAAO,CAAC,MAAM,CAAC,CAAC;AAYrB;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,IAAI,GAAG,UAAU,EACvB,OAAO,EAAE,eAAe,EACxB,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,MAAM,CAAC,CAkJjB"}
|
|
@@ -3,13 +3,11 @@ import { type UiStrings } from "./ui_strings.js";
|
|
|
3
3
|
* A compact relative timestamp for a thread row — e.g. `"just now"`, `"5m ago"`,
|
|
4
4
|
* `"3h ago"`, `"2d ago"`, `"4w ago"`.
|
|
5
5
|
*
|
|
6
|
-
* `now` is injectable so callers
|
|
7
|
-
*
|
|
8
|
-
* `
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* {@link UiStrings} (the `{n}` token is filled in here) so a localized host
|
|
12
|
-
* translates them; the bucketing stays integer-rounded and locale-neutral.
|
|
6
|
+
* `now` is injectable so callers and tests can pin the reference point. A
|
|
7
|
+
* future timestamp (clock skew) and a non-finite one (an unparseable or missing
|
|
8
|
+
* `updated_at`, arriving as `NaN`) both read as `justNow`, rather than
|
|
9
|
+
* rendering a nonsense age. Unit words come from {@link UiStrings} with `{n}`
|
|
10
|
+
* filled in here; the bucketing stays integer-rounded and locale-neutral.
|
|
13
11
|
*/
|
|
14
12
|
export declare function relativeTime(timestamp: number, now?: number, strings?: UiStrings): string;
|
|
15
13
|
//# sourceMappingURL=relative_time.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relative_time.d.ts","sourceRoot":"","sources":["../../src/ui/relative_time.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAErE
|
|
1
|
+
{"version":3,"file":"relative_time.d.ts","sourceRoot":"","sources":["../../src/ui/relative_time.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAErE;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAC1B,SAAS,EAAE,MAAM,EACjB,GAAG,GAAE,MAAmB,EACxB,OAAO,GAAE,SAA8B,GACtC,MAAM,CAqBR"}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
/** Options for {@link renderMarkdown}. */
|
|
2
2
|
export interface RenderMarkdownOptions {
|
|
3
3
|
/**
|
|
4
|
-
* Permit `<img>` tags (and their `src`/`alt`/`width`/`height` attributes)
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Permit `<img>` tags (and their `src`/`alt`/`width`/`height` attributes) in
|
|
5
|
+
* the sanitised output. Off by default; see the exfiltration note on the
|
|
6
|
+
* allowlist above. Only enable for trusted content sources.
|
|
7
7
|
*/
|
|
8
8
|
readonly allowImages?: boolean;
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* Render markdown (and any embedded raw HTML) to a sanitised HTML string.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* {@link ALLOWED_ATTR}
|
|
16
|
-
*
|
|
13
|
+
* Markdown syntax and literal HTML share one path: `marked` emits HTML, then
|
|
14
|
+
* DOMPurify strips everything outside {@link ALLOWED_TAGS} /
|
|
15
|
+
* {@link ALLOWED_ATTR} — scripts, event handlers, `javascript:` URLs. Links are
|
|
16
|
+
* hardened with `target="_blank"` and `rel="noopener noreferrer"`.
|
|
17
17
|
*
|
|
18
18
|
* The result is trimmed so a single-paragraph message round-trips to clean
|
|
19
|
-
* `textContent
|
|
19
|
+
* `textContent`, without the wrapping paragraph's trailing newline.
|
|
20
20
|
*/
|
|
21
21
|
export declare function renderMarkdown(text: string, options?: RenderMarkdownOptions): string;
|
|
22
22
|
//# sourceMappingURL=render_markdown.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render_markdown.d.ts","sourceRoot":"","sources":["../../src/ui/render_markdown.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"render_markdown.d.ts","sourceRoot":"","sources":["../../src/ui/render_markdown.ts"],"names":[],"mappings":"AA8DA,0CAA0C;AAC1C,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;CAChC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,MAAM,CAcpF"}
|