@artooi/ag-ui-web-component 0.37.0 → 0.38.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 +75 -1
- package/dist/ag-ui-web-component.bundle.js +81 -81
- package/dist/ag-ui-web-component.bundle.js.map +4 -4
- package/dist/core/activity_registration.d.ts +19 -0
- package/dist/core/activity_registration.d.ts.map +1 -0
- package/dist/core/activity_renderer.d.ts +20 -0
- package/dist/core/activity_renderer.d.ts.map +1 -0
- package/dist/core/ag_ui_chat.d.ts +6 -126
- package/dist/core/ag_ui_chat.d.ts.map +1 -1
- package/dist/core/events/attachments_detail.d.ts +9 -0
- package/dist/core/events/attachments_detail.d.ts.map +1 -0
- package/dist/core/events/custom_agent_detail.d.ts +8 -0
- package/dist/core/events/custom_agent_detail.d.ts.map +1 -0
- package/dist/core/events/feedback_detail.d.ts +7 -0
- package/dist/core/events/feedback_detail.d.ts.map +1 -0
- package/dist/core/events/invalidate_detail.d.ts +16 -0
- package/dist/core/events/invalidate_detail.d.ts.map +1 -0
- package/dist/core/events/run_finished_detail.d.ts +22 -0
- package/dist/core/events/run_finished_detail.d.ts.map +1 -0
- package/dist/core/events/state_detail.d.ts +5 -0
- package/dist/core/events/state_detail.d.ts.map +1 -0
- package/dist/core/events/submit_detail.d.ts +8 -0
- package/dist/core/events/submit_detail.d.ts.map +1 -0
- package/dist/core/events/toggle_detail.d.ts +5 -0
- package/dist/core/events/toggle_detail.d.ts.map +1 -0
- package/dist/core/events/tool_run.d.ts +11 -0
- package/dist/core/events/tool_run.d.ts.map +1 -0
- package/dist/core/events/unread_detail.d.ts +5 -0
- package/dist/core/events/unread_detail.d.ts.map +1 -0
- package/dist/core/message_role.d.ts +4 -0
- package/dist/core/message_role.d.ts.map +1 -0
- package/dist/core/tool_outcome.d.ts +1 -1
- package/dist/core/tool_outcome.d.ts.map +1 -1
- package/dist/index.d.ts +30 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8579 -8573
- package/dist/index.js.map +4 -4
- package/dist/ui/charts/chart_block.d.ts.map +1 -0
- package/dist/ui/charts/chart_spec_from.d.ts.map +1 -0
- package/dist/ui/{chart_tool.d.ts → charts/chart_tool.d.ts} +1 -1
- package/dist/ui/charts/chart_tool.d.ts.map +1 -0
- package/dist/ui/{attachment_tray.d.ts → composer/attachment_tray.d.ts} +3 -3
- package/dist/ui/composer/attachment_tray.d.ts.map +1 -0
- package/dist/ui/{skills_menu.d.ts → composer/skills_menu.d.ts} +1 -1
- package/dist/ui/composer/skills_menu.d.ts.map +1 -0
- package/dist/ui/{voice_input.d.ts → composer/voice_input.d.ts} +2 -2
- package/dist/ui/composer/voice_input.d.ts.map +1 -0
- package/dist/ui/{attach_copy_buttons.d.ts → excerpts/attach_copy_buttons.d.ts} +1 -1
- package/dist/ui/excerpts/attach_copy_buttons.d.ts.map +1 -0
- package/dist/ui/excerpts/copy_payload.d.ts.map +1 -0
- package/dist/ui/excerpts/page_quote_offer.d.ts.map +1 -0
- package/dist/ui/excerpts/quote_selection.d.ts.map +1 -0
- package/dist/ui/{checkpoint_menu.d.ts → history/checkpoint_menu.d.ts} +2 -2
- package/dist/ui/history/checkpoint_menu.d.ts.map +1 -0
- package/dist/ui/{relative_time.d.ts → history/relative_time.d.ts} +1 -1
- package/dist/ui/history/relative_time.d.ts.map +1 -0
- package/dist/ui/{thread_drawer.d.ts → history/thread_drawer.d.ts} +2 -2
- package/dist/ui/history/thread_drawer.d.ts.map +1 -0
- package/dist/ui/{approval_card.d.ts → interrupts/approval_card.d.ts} +1 -1
- package/dist/ui/interrupts/approval_card.d.ts.map +1 -0
- package/dist/ui/{confirmation_card.d.ts → interrupts/confirmation_card.d.ts} +1 -1
- package/dist/ui/interrupts/confirmation_card.d.ts.map +1 -0
- package/dist/ui/{question_card.d.ts → interrupts/question_card.d.ts} +1 -1
- package/dist/ui/interrupts/question_card.d.ts.map +1 -0
- package/dist/ui/placement/clamp_launcher.d.ts.map +1 -0
- package/dist/ui/placement/clamp_panel.d.ts.map +1 -0
- package/dist/ui/placement/launcher_drag.d.ts.map +1 -0
- package/dist/ui/placement/launcher_placement.d.ts.map +1 -0
- package/dist/ui/placement/panel_drag.d.ts.map +1 -0
- package/dist/ui/placement/place_widget.d.ts.map +1 -0
- package/dist/ui/placement/resize_handle.d.ts.map +1 -0
- package/dist/ui/progress/prettify_tool_name.d.ts.map +1 -0
- package/dist/ui/progress/run_notice.d.ts.map +1 -0
- package/dist/ui/{subagent_panel.d.ts → progress/subagent_panel.d.ts} +2 -2
- package/dist/ui/progress/subagent_panel.d.ts.map +1 -0
- package/dist/ui/progress/subagent_update.d.ts.map +1 -0
- package/dist/ui/{thoughts_block.d.ts → progress/thoughts_block.d.ts} +1 -1
- package/dist/ui/progress/thoughts_block.d.ts.map +1 -0
- package/dist/ui/{tool_call_card.d.ts → progress/tool_call_card.d.ts} +2 -2
- package/dist/ui/progress/tool_call_card.d.ts.map +1 -0
- package/dist/ui/{attachment_chips.d.ts → transcript/attachment_chips.d.ts} +1 -1
- package/dist/ui/transcript/attachment_chips.d.ts.map +1 -0
- package/dist/ui/{message_actions.d.ts → transcript/message_actions.d.ts} +1 -1
- package/dist/ui/transcript/message_actions.d.ts.map +1 -0
- package/dist/ui/transcript/render_markdown.d.ts.map +1 -0
- package/dist/ui/transcript/reveal_words.d.ts.map +1 -0
- package/dist/ui/transcript/stick_to_bottom.d.ts.map +1 -0
- package/dist/ui/{suggestion_chips.d.ts → transcript/suggestion_chips.d.ts} +1 -1
- package/dist/ui/transcript/suggestion_chips.d.ts.map +1 -0
- package/package.json +5 -5
- package/src/core/activity_registration.ts +19 -0
- package/src/core/activity_renderer.ts +19 -0
- package/src/core/ag_ui_chat.ts +84 -178
- package/src/core/events/attachments_detail.ts +9 -0
- package/src/core/events/custom_agent_detail.ts +7 -0
- package/src/core/events/feedback_detail.ts +6 -0
- package/src/core/events/invalidate_detail.ts +15 -0
- package/src/core/events/run_finished_detail.ts +22 -0
- package/src/core/events/state_detail.ts +4 -0
- package/src/core/events/submit_detail.ts +8 -0
- package/src/core/events/toggle_detail.ts +4 -0
- package/src/core/events/tool_run.ts +10 -0
- package/src/core/events/unread_detail.ts +4 -0
- package/src/core/message_role.ts +4 -0
- package/src/core/tool_outcome.ts +1 -1
- package/src/index.ts +52 -54
- package/src/ui/{chart_tool.ts → charts/chart_tool.ts} +1 -1
- package/src/ui/{attachment_tray.ts → composer/attachment_tray.ts} +5 -5
- package/src/ui/{skills_menu.ts → composer/skills_menu.ts} +1 -1
- package/src/ui/{voice_input.ts → composer/voice_input.ts} +3 -3
- package/src/ui/{attach_copy_buttons.ts → excerpts/attach_copy_buttons.ts} +1 -1
- package/src/ui/{checkpoint_menu.ts → history/checkpoint_menu.ts} +2 -2
- package/src/ui/{relative_time.ts → history/relative_time.ts} +1 -1
- package/src/ui/{thread_drawer.ts → history/thread_drawer.ts} +2 -2
- package/src/ui/{approval_card.ts → interrupts/approval_card.ts} +1 -1
- package/src/ui/{confirmation_card.ts → interrupts/confirmation_card.ts} +1 -1
- package/src/ui/{question_card.ts → interrupts/question_card.ts} +1 -1
- package/src/ui/{clamp_launcher.ts → placement/clamp_launcher.ts} +1 -1
- package/src/ui/{clamp_panel.ts → placement/clamp_panel.ts} +1 -1
- package/src/ui/{launcher_placement.ts → placement/launcher_placement.ts} +1 -1
- package/src/ui/{subagent_panel.ts → progress/subagent_panel.ts} +2 -2
- package/src/ui/{subagent_update.ts → progress/subagent_update.ts} +1 -1
- package/src/ui/{thoughts_block.ts → progress/thoughts_block.ts} +1 -1
- package/src/ui/{tool_call_card.ts → progress/tool_call_card.ts} +2 -2
- package/src/ui/{attachment_chips.ts → transcript/attachment_chips.ts} +2 -2
- package/src/ui/{message_actions.ts → transcript/message_actions.ts} +2 -2
- package/src/ui/{suggestion_chips.ts → transcript/suggestion_chips.ts} +1 -1
- package/src/version.ts +1 -1
- package/dist/ui/approval_card.d.ts.map +0 -1
- package/dist/ui/attach_copy_buttons.d.ts.map +0 -1
- package/dist/ui/attachment_chips.d.ts.map +0 -1
- package/dist/ui/attachment_tray.d.ts.map +0 -1
- package/dist/ui/chart_block.d.ts.map +0 -1
- package/dist/ui/chart_spec_from.d.ts.map +0 -1
- package/dist/ui/chart_tool.d.ts.map +0 -1
- package/dist/ui/checkpoint_menu.d.ts.map +0 -1
- package/dist/ui/clamp_launcher.d.ts.map +0 -1
- package/dist/ui/clamp_panel.d.ts.map +0 -1
- package/dist/ui/confirmation_card.d.ts.map +0 -1
- package/dist/ui/copy_payload.d.ts.map +0 -1
- package/dist/ui/launcher_drag.d.ts.map +0 -1
- package/dist/ui/launcher_placement.d.ts.map +0 -1
- package/dist/ui/message_actions.d.ts.map +0 -1
- package/dist/ui/page_quote_offer.d.ts.map +0 -1
- package/dist/ui/panel_drag.d.ts.map +0 -1
- package/dist/ui/place_widget.d.ts.map +0 -1
- package/dist/ui/prettify_tool_name.d.ts.map +0 -1
- package/dist/ui/question_card.d.ts.map +0 -1
- package/dist/ui/quote_selection.d.ts.map +0 -1
- package/dist/ui/relative_time.d.ts.map +0 -1
- package/dist/ui/render_markdown.d.ts.map +0 -1
- package/dist/ui/resize_handle.d.ts.map +0 -1
- package/dist/ui/reveal_words.d.ts.map +0 -1
- package/dist/ui/run_notice.d.ts.map +0 -1
- package/dist/ui/skills_menu.d.ts.map +0 -1
- package/dist/ui/stick_to_bottom.d.ts.map +0 -1
- package/dist/ui/subagent_panel.d.ts.map +0 -1
- package/dist/ui/subagent_update.d.ts.map +0 -1
- package/dist/ui/suggestion_chips.d.ts.map +0 -1
- package/dist/ui/thoughts_block.d.ts.map +0 -1
- package/dist/ui/thread_drawer.d.ts.map +0 -1
- package/dist/ui/tool_call_card.d.ts.map +0 -1
- package/dist/ui/voice_input.d.ts.map +0 -1
- /package/dist/ui/{chart_block.d.ts → charts/chart_block.d.ts} +0 -0
- /package/dist/ui/{chart_spec_from.d.ts → charts/chart_spec_from.d.ts} +0 -0
- /package/dist/ui/{copy_payload.d.ts → excerpts/copy_payload.d.ts} +0 -0
- /package/dist/ui/{page_quote_offer.d.ts → excerpts/page_quote_offer.d.ts} +0 -0
- /package/dist/ui/{quote_selection.d.ts → excerpts/quote_selection.d.ts} +0 -0
- /package/dist/ui/{clamp_launcher.d.ts → placement/clamp_launcher.d.ts} +0 -0
- /package/dist/ui/{clamp_panel.d.ts → placement/clamp_panel.d.ts} +0 -0
- /package/dist/ui/{launcher_drag.d.ts → placement/launcher_drag.d.ts} +0 -0
- /package/dist/ui/{launcher_placement.d.ts → placement/launcher_placement.d.ts} +0 -0
- /package/dist/ui/{panel_drag.d.ts → placement/panel_drag.d.ts} +0 -0
- /package/dist/ui/{place_widget.d.ts → placement/place_widget.d.ts} +0 -0
- /package/dist/ui/{resize_handle.d.ts → placement/resize_handle.d.ts} +0 -0
- /package/dist/ui/{prettify_tool_name.d.ts → progress/prettify_tool_name.d.ts} +0 -0
- /package/dist/ui/{run_notice.d.ts → progress/run_notice.d.ts} +0 -0
- /package/dist/ui/{subagent_update.d.ts → progress/subagent_update.d.ts} +0 -0
- /package/dist/ui/{render_markdown.d.ts → transcript/render_markdown.d.ts} +0 -0
- /package/dist/ui/{reveal_words.d.ts → transcript/reveal_words.d.ts} +0 -0
- /package/dist/ui/{stick_to_bottom.d.ts → transcript/stick_to_bottom.d.ts} +0 -0
- /package/src/ui/{chart_block.ts → charts/chart_block.ts} +0 -0
- /package/src/ui/{chart_spec_from.ts → charts/chart_spec_from.ts} +0 -0
- /package/src/ui/{copy_payload.ts → excerpts/copy_payload.ts} +0 -0
- /package/src/ui/{page_quote_offer.ts → excerpts/page_quote_offer.ts} +0 -0
- /package/src/ui/{quote_selection.ts → excerpts/quote_selection.ts} +0 -0
- /package/src/ui/{launcher_drag.ts → placement/launcher_drag.ts} +0 -0
- /package/src/ui/{panel_drag.ts → placement/panel_drag.ts} +0 -0
- /package/src/ui/{place_widget.ts → placement/place_widget.ts} +0 -0
- /package/src/ui/{resize_handle.ts → placement/resize_handle.ts} +0 -0
- /package/src/ui/{prettify_tool_name.ts → progress/prettify_tool_name.ts} +0 -0
- /package/src/ui/{run_notice.ts → progress/run_notice.ts} +0 -0
- /package/src/ui/{render_markdown.ts → transcript/render_markdown.ts} +0 -0
- /package/src/ui/{reveal_words.ts → transcript/reveal_words.ts} +0 -0
- /package/src/ui/{stick_to_bottom.ts → transcript/stick_to_bottom.ts} +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ActivityRenderer } from "./activity_renderer.js";
|
|
2
|
+
/** One `activity_type` a host can draw. See {@link AgUiChat.registerActivityRenderer}. */
|
|
3
|
+
export interface ActivityRegistration {
|
|
4
|
+
/**
|
|
5
|
+
* The AG-UI `activity_type` this draws, matched exactly.
|
|
6
|
+
*
|
|
7
|
+
* An open string the protocol does not enumerate -- which is the whole reason
|
|
8
|
+
* this is a registry rather than a branch.
|
|
9
|
+
*/
|
|
10
|
+
readonly type: string;
|
|
11
|
+
readonly render: ActivityRenderer;
|
|
12
|
+
/**
|
|
13
|
+
* Shown in the transcript when something already drawn under this type stops
|
|
14
|
+
* being renderable. Omit for an activity whose disappearance needs no
|
|
15
|
+
* explanation.
|
|
16
|
+
*/
|
|
17
|
+
readonly removedNotice?: string;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=activity_registration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activity_registration.d.ts","sourceRoot":"","sources":["../../src/core/activity_registration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,0FAA0F;AAC1F,MAAM,WAAW,oBAAoB;IACnC;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAClC;;;;OAIG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACjC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Draw one activity, from its content alone.
|
|
3
|
+
*
|
|
4
|
+
* The contract is {@link ClientTool.render}'s, and for the same reason rather
|
|
5
|
+
* than by analogy. An activity is materialised into a `role: "activity"`
|
|
6
|
+
* message, persisted with the transcript, and re-fired on every restore -- so a
|
|
7
|
+
* renderer that writes to the page instead of returning DOM fires again on
|
|
8
|
+
* every thread load, which is exactly the bug the tool registry's purity rule
|
|
9
|
+
* was written to make unmakeable.
|
|
10
|
+
*
|
|
11
|
+
* - a pure function of `content` -- no host state, no network, no clock;
|
|
12
|
+
* - deterministic, so a reload reproduces what was there before;
|
|
13
|
+
* - free of effects outside the node it returns, which the component places.
|
|
14
|
+
*
|
|
15
|
+
* Return `null` for content that says nothing worth drawing. Anything already
|
|
16
|
+
* drawn under that message id is then removed: live and reload should agree,
|
|
17
|
+
* and the stored content is the version that could not be drawn.
|
|
18
|
+
*/
|
|
19
|
+
export type ActivityRenderer = (content: unknown) => Node | null;
|
|
20
|
+
//# sourceMappingURL=activity_renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activity_renderer.d.ts","sourceRoot":"","sources":["../../src/core/activity_renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,GAAG,IAAI,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { Context, Tool } from "@ag-ui/core";
|
|
2
|
-
import { MESSAGE_ROLE } from "../constants.js";
|
|
3
2
|
import type { Skill } from "../skills/skill.js";
|
|
4
3
|
import { type ChatCorner, type ChatSurfaceReport } from "../tools/chat_surface_tools.js";
|
|
5
4
|
import { type ClientTool } from "../tools/client_tool_registry.js";
|
|
@@ -7,137 +6,18 @@ import { type ResolvePageTarget } from "../tools/page_action_tools.js";
|
|
|
7
6
|
import { type PageMap } from "../tools/page_map.js";
|
|
8
7
|
import { type PageState } from "../tools/page_state.js";
|
|
9
8
|
import { type RouteMap } from "../tools/route_map.js";
|
|
10
|
-
import {
|
|
11
|
-
import { type
|
|
12
|
-
import type
|
|
13
|
-
import { type ToolDisplayMode, type ToolPayloadFormatter } from "../ui/tool_call_card.js";
|
|
9
|
+
import type { RelativeTimeFormatter } from "../ui/history/relative_time.js";
|
|
10
|
+
import { type ApprovalRenderer } from "../ui/interrupts/approval_card.js";
|
|
11
|
+
import { type QuestionRenderer } from "../ui/interrupts/question_card.js";
|
|
12
|
+
import { type ToolDisplayMode, type ToolPayloadFormatter } from "../ui/progress/tool_call_card.js";
|
|
14
13
|
import { type UiStrings } from "../ui/ui_strings.js";
|
|
14
|
+
import type { ActivityRegistration } from "./activity_registration.js";
|
|
15
15
|
import { type AttachmentRef } from "./attachment.js";
|
|
16
16
|
import { type ClientConversationStore, type NavigationCheckpoint } from "./conversation_store.js";
|
|
17
17
|
import { type AgentFactory } from "./create_http_agent.js";
|
|
18
|
+
import type { MessageRole } from "./message_role.js";
|
|
18
19
|
import { type TranscribeHandler } from "./transcribe_audio.js";
|
|
19
20
|
import { type UploadHandler } from "./upload_attachment.js";
|
|
20
|
-
/** The role a rendered chat message takes. */
|
|
21
|
-
export type MessageRole = (typeof MESSAGE_ROLE)[keyof typeof MESSAGE_ROLE];
|
|
22
|
-
/** `detail` shape of the {@link SUBMIT_EVENT} CustomEvent. */
|
|
23
|
-
export interface SubmitDetail {
|
|
24
|
-
readonly content: string;
|
|
25
|
-
/** Durable refs for the files attached to this message (empty when none). */
|
|
26
|
-
readonly attachments: readonly AttachmentRef[];
|
|
27
|
-
}
|
|
28
|
-
/** `detail` shape of the {@link ATTACHMENT_EVENT} CustomEvent. */
|
|
29
|
-
export interface AttachmentsDetail {
|
|
30
|
-
/** Durable refs for every file that has finished uploading. */
|
|
31
|
-
readonly attachments: readonly AttachmentRef[];
|
|
32
|
-
/** How many files are still uploading; a send now would leave these behind. */
|
|
33
|
-
readonly pending: number;
|
|
34
|
-
}
|
|
35
|
-
/** `detail` shape of the {@link STATE_EVENT} CustomEvent. */
|
|
36
|
-
/** {@link FEEDBACK_EVENT} detail: what was rated, and how. */
|
|
37
|
-
export interface FeedbackDetail {
|
|
38
|
-
/** The rated message's text, as rendered. */
|
|
39
|
-
readonly content: string;
|
|
40
|
-
readonly rating: "up" | "down";
|
|
41
|
-
}
|
|
42
|
-
export interface StateDetail {
|
|
43
|
-
readonly state: Readonly<Record<string, unknown>>;
|
|
44
|
-
}
|
|
45
|
-
/** One tool that ran during an interaction, as {@link RunFinishedDetail} lists it. */
|
|
46
|
-
export interface ToolRun {
|
|
47
|
-
readonly name: string;
|
|
48
|
-
/**
|
|
49
|
-
* Where it executed. `"server"` is the one a data-rendering host cares about:
|
|
50
|
-
* a `"client"` tool ran in the host's own handler, so the host already knows
|
|
51
|
-
* whatever it did.
|
|
52
|
-
*/
|
|
53
|
-
readonly side: "server" | "client";
|
|
54
|
-
}
|
|
55
|
-
/** `detail` shape of the {@link RUN_FINISHED_EVENT} CustomEvent. */
|
|
56
|
-
export interface RunFinishedDetail {
|
|
57
|
-
/** In settle order. Empty when the interaction called no tools. */
|
|
58
|
-
readonly tools: readonly ToolRun[];
|
|
59
|
-
/**
|
|
60
|
-
* Every key announced during the interaction, de-duplicated, first-seen order.
|
|
61
|
-
*
|
|
62
|
-
* **This is the field that makes adoption one line** for a host already
|
|
63
|
-
* listening here, and the `else` is the whole compatibility story:
|
|
64
|
-
*
|
|
65
|
-
* ```js
|
|
66
|
-
* if (detail.invalidated.length > 0) refetchOnly(detail.invalidated);
|
|
67
|
-
* else if (detail.tools.some((t) => t.side === "server")) refetchEverything();
|
|
68
|
-
* ```
|
|
69
|
-
*
|
|
70
|
-
* Empty against a server that announces nothing, so an old server and a new
|
|
71
|
-
* client fall through to the coarse refetch that shipped before either.
|
|
72
|
-
*/
|
|
73
|
-
readonly invalidated: readonly string[];
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Draw one activity, from its content alone.
|
|
77
|
-
*
|
|
78
|
-
* The contract is {@link ClientTool.render}'s, and for the same reason rather
|
|
79
|
-
* than by analogy. An activity is materialised into a `role: "activity"`
|
|
80
|
-
* message, persisted with the transcript, and re-fired on every restore -- so a
|
|
81
|
-
* renderer that writes to the page instead of returning DOM fires again on
|
|
82
|
-
* every thread load, which is exactly the bug the tool registry's purity rule
|
|
83
|
-
* was written to make unmakeable.
|
|
84
|
-
*
|
|
85
|
-
* - a pure function of `content` -- no host state, no network, no clock;
|
|
86
|
-
* - deterministic, so a reload reproduces what was there before;
|
|
87
|
-
* - free of effects outside the node it returns, which the component places.
|
|
88
|
-
*
|
|
89
|
-
* Return `null` for content that says nothing worth drawing. Anything already
|
|
90
|
-
* drawn under that message id is then removed: live and reload should agree,
|
|
91
|
-
* and the stored content is the version that could not be drawn.
|
|
92
|
-
*/
|
|
93
|
-
export type ActivityRenderer = (content: unknown) => Node | null;
|
|
94
|
-
/** One `activity_type` a host can draw. See {@link AgUiChat.registerActivityRenderer}. */
|
|
95
|
-
export interface ActivityRegistration {
|
|
96
|
-
/**
|
|
97
|
-
* The AG-UI `activity_type` this draws, matched exactly.
|
|
98
|
-
*
|
|
99
|
-
* An open string the protocol does not enumerate -- which is the whole reason
|
|
100
|
-
* this is a registry rather than a branch.
|
|
101
|
-
*/
|
|
102
|
-
readonly type: string;
|
|
103
|
-
readonly render: ActivityRenderer;
|
|
104
|
-
/**
|
|
105
|
-
* Shown in the transcript when something already drawn under this type stops
|
|
106
|
-
* being renderable. Omit for an activity whose disappearance needs no
|
|
107
|
-
* explanation.
|
|
108
|
-
*/
|
|
109
|
-
readonly removedNotice?: string;
|
|
110
|
-
}
|
|
111
|
-
/** `detail` shape of the {@link CUSTOM_AGENT_EVENT} CustomEvent. */
|
|
112
|
-
export interface CustomAgentDetail {
|
|
113
|
-
/** The `CUSTOM` event's `name`, verbatim. An open string; never interpreted here. */
|
|
114
|
-
readonly name: string;
|
|
115
|
-
/** Its `value`, verbatim and unparsed. `unknown` because the protocol says nothing about it. */
|
|
116
|
-
readonly value: unknown;
|
|
117
|
-
}
|
|
118
|
-
/** `detail` shape of the {@link INVALIDATE_EVENT} CustomEvent. */
|
|
119
|
-
export interface InvalidateDetail {
|
|
120
|
-
/**
|
|
121
|
-
* The resources that moved, as the server named them.
|
|
122
|
-
*
|
|
123
|
-
* **Opaque strings, and matching is exact.** `orders/42` does not imply
|
|
124
|
-
* `orders` -- a prefix rule would be this component guessing at a scheme it
|
|
125
|
-
* does not own, and `orders/1` would match `orders/11`. A server that wants
|
|
126
|
-
* the collection refreshed names it. Your own matching may be hierarchical,
|
|
127
|
-
* because in your vocabulary the scheme is known.
|
|
128
|
-
*/
|
|
129
|
-
readonly keys: readonly string[];
|
|
130
|
-
/** What caused the write -- usually the tool's name. `null` when unstated. */
|
|
131
|
-
readonly reason: string | null;
|
|
132
|
-
}
|
|
133
|
-
/** `detail` shape of the {@link TOGGLE_EVENT} CustomEvent. */
|
|
134
|
-
export interface ToggleDetail {
|
|
135
|
-
readonly collapsed: boolean;
|
|
136
|
-
}
|
|
137
|
-
/** `detail` shape of the {@link UNREAD_EVENT} CustomEvent. */
|
|
138
|
-
export interface UnreadDetail {
|
|
139
|
-
readonly unread: number;
|
|
140
|
-
}
|
|
141
21
|
/**
|
|
142
22
|
* `<ag-ui-chat>` — a framework-free chat sidebar Web Component over AG-UI.
|
|
143
23
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ag_ui_chat.d.ts","sourceRoot":"","sources":["../../src/core/ag_ui_chat.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAsB,IAAI,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"ag_ui_chat.d.ts","sourceRoot":"","sources":["../../src/core/ag_ui_chat.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAsB,IAAI,EAAE,MAAM,aAAa,CAAC;AA2CrE,OAAO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AAsB,IAAI,SAAS,MAAM,EAAE,CAE9C;CAoHF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AttachmentRef } from "../attachment.js";
|
|
2
|
+
/** `detail` shape of the {@link ATTACHMENT_EVENT} CustomEvent. */
|
|
3
|
+
export interface AttachmentsDetail {
|
|
4
|
+
/** Durable refs for every file that has finished uploading. */
|
|
5
|
+
readonly attachments: readonly AttachmentRef[];
|
|
6
|
+
/** How many files are still uploading; a send now would leave these behind. */
|
|
7
|
+
readonly pending: number;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=attachments_detail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachments_detail.d.ts","sourceRoot":"","sources":["../../../src/core/events/attachments_detail.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,kEAAkE;AAClE,MAAM,WAAW,iBAAiB;IAChC,+DAA+D;IAC/D,QAAQ,CAAC,WAAW,EAAE,SAAS,aAAa,EAAE,CAAC;IAC/C,+EAA+E;IAC/E,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** `detail` shape of the {@link CUSTOM_AGENT_EVENT} CustomEvent. */
|
|
2
|
+
export interface CustomAgentDetail {
|
|
3
|
+
/** The `CUSTOM` event's `name`, verbatim. An open string; never interpreted here. */
|
|
4
|
+
readonly name: string;
|
|
5
|
+
/** Its `value`, verbatim and unparsed. `unknown` because the protocol says nothing about it. */
|
|
6
|
+
readonly value: unknown;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=custom_agent_detail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom_agent_detail.d.ts","sourceRoot":"","sources":["../../../src/core/events/custom_agent_detail.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,MAAM,WAAW,iBAAiB;IAChC,qFAAqF;IACrF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,gGAAgG;IAChG,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedback_detail.d.ts","sourceRoot":"","sources":["../../../src/core/events/feedback_detail.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,MAAM,WAAW,cAAc;IAC7B,6CAA6C;IAC7C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,IAAI,GAAG,MAAM,CAAC;CAChC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** `detail` shape of the {@link INVALIDATE_EVENT} CustomEvent. */
|
|
2
|
+
export interface InvalidateDetail {
|
|
3
|
+
/**
|
|
4
|
+
* The resources that moved, as the server named them.
|
|
5
|
+
*
|
|
6
|
+
* **Opaque strings, and matching is exact.** `orders/42` does not imply
|
|
7
|
+
* `orders` -- a prefix rule would be this component guessing at a scheme it
|
|
8
|
+
* does not own, and `orders/1` would match `orders/11`. A server that wants
|
|
9
|
+
* the collection refreshed names it. Your own matching may be hierarchical,
|
|
10
|
+
* because in your vocabulary the scheme is known.
|
|
11
|
+
*/
|
|
12
|
+
readonly keys: readonly string[];
|
|
13
|
+
/** What caused the write -- usually the tool's name. `null` when unstated. */
|
|
14
|
+
readonly reason: string | null;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=invalidate_detail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invalidate_detail.d.ts","sourceRoot":"","sources":["../../../src/core/events/invalidate_detail.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;;OAQG;IACH,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,8EAA8E;IAC9E,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ToolRun } from "./tool_run.js";
|
|
2
|
+
/** `detail` shape of the {@link RUN_FINISHED_EVENT} CustomEvent. */
|
|
3
|
+
export interface RunFinishedDetail {
|
|
4
|
+
/** In settle order. Empty when the interaction called no tools. */
|
|
5
|
+
readonly tools: readonly ToolRun[];
|
|
6
|
+
/**
|
|
7
|
+
* Every key announced during the interaction, de-duplicated, first-seen order.
|
|
8
|
+
*
|
|
9
|
+
* **This is the field that makes adoption one line** for a host already
|
|
10
|
+
* listening here, and the `else` is the whole compatibility story:
|
|
11
|
+
*
|
|
12
|
+
* ```js
|
|
13
|
+
* if (detail.invalidated.length > 0) refetchOnly(detail.invalidated);
|
|
14
|
+
* else if (detail.tools.some((t) => t.side === "server")) refetchEverything();
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* Empty against a server that announces nothing, so an old server and a new
|
|
18
|
+
* client fall through to the coarse refetch that shipped before either.
|
|
19
|
+
*/
|
|
20
|
+
readonly invalidated: readonly string[];
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=run_finished_detail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run_finished_detail.d.ts","sourceRoot":"","sources":["../../../src/core/events/run_finished_detail.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C,oEAAoE;AACpE,MAAM,WAAW,iBAAiB;IAChC,mEAAmE;IACnE,QAAQ,CAAC,KAAK,EAAE,SAAS,OAAO,EAAE,CAAC;IACnC;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;CACzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state_detail.d.ts","sourceRoot":"","sources":["../../../src/core/events/state_detail.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACnD"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AttachmentRef } from "../attachment.js";
|
|
2
|
+
/** `detail` shape of the {@link SUBMIT_EVENT} CustomEvent. */
|
|
3
|
+
export interface SubmitDetail {
|
|
4
|
+
readonly content: string;
|
|
5
|
+
/** Durable refs for the files attached to this message (empty when none). */
|
|
6
|
+
readonly attachments: readonly AttachmentRef[];
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=submit_detail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"submit_detail.d.ts","sourceRoot":"","sources":["../../../src/core/events/submit_detail.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,8DAA8D;AAC9D,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,6EAA6E;IAC7E,QAAQ,CAAC,WAAW,EAAE,SAAS,aAAa,EAAE,CAAC;CAChD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle_detail.d.ts","sourceRoot":"","sources":["../../../src/core/events/toggle_detail.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** One tool that ran during an interaction, as {@link RunFinishedDetail} lists it. */
|
|
2
|
+
export interface ToolRun {
|
|
3
|
+
readonly name: string;
|
|
4
|
+
/**
|
|
5
|
+
* Where it executed. `"server"` is the one a data-rendering host cares about:
|
|
6
|
+
* a `"client"` tool ran in the host's own handler, so the host already knows
|
|
7
|
+
* whatever it did.
|
|
8
|
+
*/
|
|
9
|
+
readonly side: "server" | "client";
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=tool_run.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool_run.d.ts","sourceRoot":"","sources":["../../../src/core/events/tool_run.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;CACpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unread_detail.d.ts","sourceRoot":"","sources":["../../../src/core/events/unread_detail.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message_role.d.ts","sourceRoot":"","sources":["../../src/core/message_role.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,8CAA8C;AAC9C,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TOOL_OUTCOME } from "../constants.js";
|
|
2
|
-
import type { SettledStatus } from "../ui/tool_call_card.js";
|
|
2
|
+
import type { SettledStatus } from "../ui/progress/tool_call_card.js";
|
|
3
3
|
/**
|
|
4
4
|
* How a tool call ended, in the wire's own words. See {@link TOOL_OUTCOME}.
|
|
5
5
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool_outcome.d.ts","sourceRoot":"","sources":["../../src/core/tool_outcome.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"tool_outcome.d.ts","sourceRoot":"","sources":["../../src/core/tool_outcome.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEtE;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAE3E;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,aAAa,CAQrE"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,23 @@
|
|
|
1
1
|
export { ATTACHMENT_EVENT, CHART_ACTIVITY_TYPE, COMPACTION_ACTIVITY_TYPE, CUSTOM_AGENT_EVENT, ELEMENT_TAG, FEEDBACK_EVENT, INVALIDATE_CUSTOM_NAME, INVALIDATE_EVENT, LOAD_CAPABILITY_TOOL, MAX_TOOL_ROUNDS, MESSAGE_ACTIONS, MESSAGE_ROLE, RUN_FINISHED_EVENT, STATE_EVENT, SUBMIT_EVENT, SUGGESTIONS_ACTIVITY_TYPE, TOGGLE_EVENT, TOOL_CALL_STATUS, TOOL_DISPLAY, TOOL_OUTCOME, UNREAD_EVENT, X_CONFIRM_KEY, X_DESTRUCTIVE_KEY, X_NAVIGATES_KEY, X_SUMMARY_KEY, } from "./constants.js";
|
|
2
|
-
export {
|
|
2
|
+
export type { ActivityRegistration } from "./core/activity_registration.js";
|
|
3
|
+
export type { ActivityRenderer } from "./core/activity_renderer.js";
|
|
4
|
+
export { AgUiChat } from "./core/ag_ui_chat.js";
|
|
3
5
|
export { AgUiClient, type AgUiClientConfig, type AgUiClientHandlers, type AgUiRunInputs, type AgUiToolCall, ConnectionLostError, type ExecuteTool, type InterruptResponse, type ResolveInterrupts, type ToolExecution, } from "./core/agui_client.js";
|
|
4
6
|
export { type AttachmentRef, messageAttachments } from "./core/attachment.js";
|
|
5
7
|
export { type ClientConversationStore, type NavigationCheckpoint, SessionStorageStore, type ThreadMeta, } from "./core/conversation_store.js";
|
|
6
8
|
export { type AgentFactory, createHttpAgent, type HttpAgentOptions, } from "./core/create_http_agent.js";
|
|
7
9
|
export { defineAgUiChat } from "./core/define_ag_ui_chat.js";
|
|
10
|
+
export type { AttachmentsDetail } from "./core/events/attachments_detail.js";
|
|
11
|
+
export type { CustomAgentDetail } from "./core/events/custom_agent_detail.js";
|
|
12
|
+
export type { FeedbackDetail } from "./core/events/feedback_detail.js";
|
|
13
|
+
export type { InvalidateDetail } from "./core/events/invalidate_detail.js";
|
|
14
|
+
export type { RunFinishedDetail } from "./core/events/run_finished_detail.js";
|
|
15
|
+
export type { StateDetail } from "./core/events/state_detail.js";
|
|
16
|
+
export type { SubmitDetail } from "./core/events/submit_detail.js";
|
|
17
|
+
export type { ToggleDetail } from "./core/events/toggle_detail.js";
|
|
18
|
+
export type { ToolRun } from "./core/events/tool_run.js";
|
|
19
|
+
export type { UnreadDetail } from "./core/events/unread_detail.js";
|
|
20
|
+
export type { MessageRole } from "./core/message_role.js";
|
|
8
21
|
export { RemoteConversationStore } from "./core/remote_conversation_store.js";
|
|
9
22
|
export { RunIndex, type RunRow } from "./core/run_index.js";
|
|
10
23
|
export { type ToolOutcome, toolStatusFromOutcome } from "./core/tool_outcome.js";
|
|
@@ -28,22 +41,22 @@ export { createPageMapContext, type PageMap } from "./tools/page_map.js";
|
|
|
28
41
|
export { createPageStateTools, createStateHookTools, type PageState, type StateHook, } from "./tools/page_state.js";
|
|
29
42
|
export { parseToolCatalog, type ToolCatalogEntry } from "./tools/parse_tool_catalog.js";
|
|
30
43
|
export { createRouteTools, type Route, type RouteMap, type RouteWithParams, } from "./tools/route_map.js";
|
|
31
|
-
export
|
|
32
|
-
export
|
|
33
|
-
export {
|
|
34
|
-
export {
|
|
35
|
-
export {
|
|
36
|
-
export {
|
|
37
|
-
export {
|
|
38
|
-
export {
|
|
39
|
-
export {
|
|
40
|
-
export {
|
|
41
|
-
export { type QuestionOptions, type QuestionRenderer, type QuestionRequest, requestQuestion, } from "./ui/question_card.js";
|
|
42
|
-
export {
|
|
43
|
-
export { type
|
|
44
|
-
export { type
|
|
45
|
-
export {
|
|
46
|
-
export {
|
|
44
|
+
export type { ChartKind, ChartSeries, ChartSpec } from "./ui/charts/chart_block.js";
|
|
45
|
+
export { renderChart } from "./ui/charts/chart_block.js";
|
|
46
|
+
export { chartSpecFrom } from "./ui/charts/chart_spec_from.js";
|
|
47
|
+
export { CHART_TOOL_NAME } from "./ui/charts/chart_tool.js";
|
|
48
|
+
export { attachQuoteOffer, type PageQuoteOffer, type PageQuoteOfferOptions, } from "./ui/excerpts/page_quote_offer.js";
|
|
49
|
+
export { asQuote, MAX_QUOTE_CHARS, type QuotableSelection, quotableSelection, } from "./ui/excerpts/quote_selection.js";
|
|
50
|
+
export { CheckpointMenu, type CheckpointVerb } from "./ui/history/checkpoint_menu.js";
|
|
51
|
+
export { type RelativeTimeFormatter, relativeTime, } from "./ui/history/relative_time.js";
|
|
52
|
+
export { type ApprovalOptions, type ApprovalRenderer, type ApprovalRequest, requestApproval, } from "./ui/interrupts/approval_card.js";
|
|
53
|
+
export { type ConfirmationOptions, type ConfirmationRequest, requestConfirmation, } from "./ui/interrupts/confirmation_card.js";
|
|
54
|
+
export { type QuestionOptions, type QuestionRenderer, type QuestionRequest, requestQuestion, } from "./ui/interrupts/question_card.js";
|
|
55
|
+
export { prettifyToolName } from "./ui/progress/prettify_tool_name.js";
|
|
56
|
+
export { type SettledStatus, ToolCallCard, type ToolCallCardOptions, type ToolCallStatus, type ToolDisplayMode, type ToolPayload, type ToolPayloadFormatter, } from "./ui/progress/tool_call_card.js";
|
|
57
|
+
export { attachMessageActions, type MessageActionsOptions, messageActionBar, } from "./ui/transcript/message_actions.js";
|
|
58
|
+
export { type RenderMarkdownOptions, renderMarkdown } from "./ui/transcript/render_markdown.js";
|
|
59
|
+
export { MAX_SUGGESTION_CHARS, MAX_SUGGESTIONS, renderSuggestionChips, suggestionPrompts, } from "./ui/transcript/suggestion_chips.js";
|
|
47
60
|
export { DEFAULT_UI_STRINGS, mergeUiStrings, type UiStrings } from "./ui/ui_strings.js";
|
|
48
61
|
export { VERSION } from "./version.js";
|
|
49
62
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,wBAAwB,EACxB,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,sBAAsB,EACtB,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,WAAW,EACX,YAAY,EACZ,yBAAyB,EACzB,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,aAAa,GACd,MAAM,gBAAgB,CAAC;AACxB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,wBAAwB,EACxB,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,sBAAsB,EACtB,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,WAAW,EACX,YAAY,EACZ,yBAAyB,EACzB,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,aAAa,GACd,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,oBAAoB,EAAE,MAAM,iCAAiC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