@tinyweb_dev/agent-framework-chat-ui 0.1.1 → 0.3.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.
Files changed (101) hide show
  1. package/dist/components/Composer.d.ts +38 -0
  2. package/dist/components/Composer.d.ts.map +1 -0
  3. package/dist/components/Header.d.ts +7 -0
  4. package/dist/components/Header.d.ts.map +1 -0
  5. package/dist/components/Hero.d.ts +6 -0
  6. package/dist/components/Hero.d.ts.map +1 -0
  7. package/dist/components/RealtimeCallOverlay.d.ts +68 -0
  8. package/dist/components/RealtimeCallOverlay.d.ts.map +1 -0
  9. package/dist/components/RealtimeOrb.d.ts +21 -0
  10. package/dist/components/RealtimeOrb.d.ts.map +1 -0
  11. package/{src/components/Sidebar.tsx → dist/components/Sidebar.d.ts} +5 -9
  12. package/dist/components/Sidebar.d.ts.map +1 -0
  13. package/dist/components/TinywebChat.d.ts +3 -0
  14. package/dist/components/TinywebChat.d.ts.map +1 -0
  15. package/dist/components/Transcript.d.ts +20 -0
  16. package/dist/components/Transcript.d.ts.map +1 -0
  17. package/dist/components/WireOrbEffect.d.ts +17 -0
  18. package/dist/components/WireOrbEffect.d.ts.map +1 -0
  19. package/dist/components/condense/CondensePill.d.ts +11 -0
  20. package/dist/components/condense/CondensePill.d.ts.map +1 -0
  21. package/dist/components/messages/AssistantMessage.d.ts +10 -0
  22. package/dist/components/messages/AssistantMessage.d.ts.map +1 -0
  23. package/dist/components/messages/ErrorMessage.d.ts +7 -0
  24. package/dist/components/messages/ErrorMessage.d.ts.map +1 -0
  25. package/dist/components/messages/ToolMessage.d.ts +17 -0
  26. package/dist/components/messages/ToolMessage.d.ts.map +1 -0
  27. package/dist/components/messages/UserMessage.d.ts +7 -0
  28. package/dist/components/messages/UserMessage.d.ts.map +1 -0
  29. package/dist/components/tool/ExecRenderer.d.ts +14 -0
  30. package/dist/components/tool/ExecRenderer.d.ts.map +1 -0
  31. package/dist/components/tool/ImageRenderer.d.ts +16 -0
  32. package/dist/components/tool/ImageRenderer.d.ts.map +1 -0
  33. package/dist/components/tool/JsonRenderer.d.ts +11 -0
  34. package/dist/components/tool/JsonRenderer.d.ts.map +1 -0
  35. package/dist/components/tool/ToolCard.d.ts +29 -0
  36. package/dist/components/tool/ToolCard.d.ts.map +1 -0
  37. package/dist/components/tool/builtinRenderers.d.ts +9 -0
  38. package/dist/components/tool/builtinRenderers.d.ts.map +1 -0
  39. package/dist/hooks/useAgentChat.d.ts +46 -0
  40. package/dist/hooks/useAgentChat.d.ts.map +1 -0
  41. package/dist/hooks/useAnchorLatestUser.d.ts +15 -0
  42. package/dist/hooks/useAnchorLatestUser.d.ts.map +1 -0
  43. package/dist/hooks/useInitialScrollToEnd.d.ts +15 -0
  44. package/dist/hooks/useInitialScrollToEnd.d.ts.map +1 -0
  45. package/dist/hooks/useNdjsonStream.d.ts +11 -0
  46. package/dist/hooks/useNdjsonStream.d.ts.map +1 -0
  47. package/dist/hooks/useRealtimeCall.d.ts +112 -0
  48. package/dist/hooks/useRealtimeCall.d.ts.map +1 -0
  49. package/dist/index.cjs +3160 -0
  50. package/dist/index.cjs.map +1 -0
  51. package/dist/index.d.ts +20 -0
  52. package/dist/index.d.ts.map +1 -0
  53. package/dist/index.js +3126 -0
  54. package/dist/index.js.map +1 -0
  55. package/dist/markdown/render.d.ts +2 -0
  56. package/dist/markdown/render.d.ts.map +1 -0
  57. package/dist/types.d.ts +257 -0
  58. package/dist/types.d.ts.map +1 -0
  59. package/dist/util/attachments.d.ts +28 -0
  60. package/dist/util/attachments.d.ts.map +1 -0
  61. package/dist/util/escape.d.ts +2 -0
  62. package/dist/util/escape.d.ts.map +1 -0
  63. package/dist/util/theme.d.ts +13 -0
  64. package/dist/util/theme.d.ts.map +1 -0
  65. package/dist/util/tool-detect.d.ts +26 -0
  66. package/dist/util/tool-detect.d.ts.map +1 -0
  67. package/dist/util/tool-labels.d.ts +11 -0
  68. package/dist/util/tool-labels.d.ts.map +1 -0
  69. package/package.json +14 -14
  70. package/src/components/Composer.tsx +0 -267
  71. package/src/components/Header.tsx +0 -16
  72. package/src/components/Hero.tsx +0 -16
  73. package/src/components/RealtimeCallOverlay.tsx +0 -894
  74. package/src/components/RealtimeOrb.tsx +0 -388
  75. package/src/components/TinywebChat.tsx +0 -95
  76. package/src/components/Transcript.tsx +0 -146
  77. package/src/components/WireOrbEffect.tsx +0 -556
  78. package/src/components/condense/CondensePill.tsx +0 -77
  79. package/src/components/messages/AssistantMessage.tsx +0 -15
  80. package/src/components/messages/ErrorMessage.tsx +0 -12
  81. package/src/components/messages/ToolMessage.tsx +0 -49
  82. package/src/components/messages/UserMessage.tsx +0 -37
  83. package/src/components/tool/ExecRenderer.tsx +0 -71
  84. package/src/components/tool/ImageRenderer.tsx +0 -47
  85. package/src/components/tool/JsonRenderer.tsx +0 -24
  86. package/src/components/tool/ToolCard.tsx +0 -65
  87. package/src/components/tool/builtinRenderers.tsx +0 -456
  88. package/src/hooks/useAgentChat.ts +0 -454
  89. package/src/hooks/useAnchorLatestUser.ts +0 -99
  90. package/src/hooks/useInitialScrollToEnd.ts +0 -41
  91. package/src/hooks/useNdjsonStream.ts +0 -71
  92. package/src/hooks/useRealtimeCall.ts +0 -452
  93. package/src/index.ts +0 -45
  94. package/src/markdown/render.ts +0 -121
  95. package/src/types.ts +0 -241
  96. package/src/util/attachments.ts +0 -87
  97. package/src/util/escape.ts +0 -16
  98. package/src/util/theme.ts +0 -40
  99. package/src/util/tool-detect.ts +0 -65
  100. package/src/util/tool-labels.ts +0 -34
  101. /package/{src → dist}/styles.css +0 -0
@@ -0,0 +1,38 @@
1
+ import type { AttachmentLimits, ImageAttachment } from "../types";
2
+ export type ComposerProps = {
3
+ onSend: (prompt: string, options?: {
4
+ images?: ReadonlyArray<ImageAttachment>;
5
+ }) => void;
6
+ disabled?: boolean;
7
+ placeholder?: string;
8
+ attachmentLimits?: AttachmentLimits;
9
+ /**
10
+ * When true the send button morphs into a stop button. Used while an
11
+ * agent turn is streaming so the user can force-abort a runaway tool
12
+ * loop. Clicking the stop button invokes [`onStop`](Composer.tsx:1)
13
+ * instead of [`onSend`](Composer.tsx:1).
14
+ */
15
+ busy?: boolean;
16
+ /** Force-stops the in-flight agent turn. Required when `busy === true`. */
17
+ onStop?: () => void;
18
+ /**
19
+ * Optional click handler for the realtime Call button. When set the
20
+ * Composer renders a phone icon to the left of the textarea so the
21
+ * user can launch a voice call. When undefined the button is hidden.
22
+ * Wired by `<TinywebChat />` only when its `realtime` prop is set —
23
+ * see plan 0014 §9.
24
+ */
25
+ onStartCall?: () => void;
26
+ };
27
+ /**
28
+ * Composer textarea + send button + image attachment strip.
29
+ *
30
+ * Image entry points:
31
+ * - paperclip button → hidden `<input type="file" accept="image/*" multiple>`
32
+ * - paste (Ctrl/⌘+V) of image blobs from clipboard
33
+ * - drag-and-drop image files onto the composer
34
+ *
35
+ * Enter sends; Shift+Enter inserts a newline.
36
+ */
37
+ export declare const Composer: (props: ComposerProps) => import("react/jsx-runtime").JSX.Element;
38
+ //# sourceMappingURL=Composer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Composer.d.ts","sourceRoot":"","sources":["../../src/components/Composer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAGjE,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,aAAa,CAAC,eAAe,CAAC,CAAA;KAAE,KAAK,IAAI,CAAA;IACvF,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,gBAAgB,CAAC,EAAE,gBAAgB,CAAA;IACnC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,2EAA2E;IAC3E,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;IACnB;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,MAAM,IAAI,CAAA;CACzB,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,QAAQ,GAAI,OAAO,aAAa,4CAoO5C,CAAA"}
@@ -0,0 +1,7 @@
1
+ import type { ReactNode } from "react";
2
+ export type HeaderProps = {
3
+ title: string;
4
+ right?: ReactNode;
5
+ };
6
+ export declare const Header: (props: HeaderProps) => import("react/jsx-runtime").JSX.Element;
7
+ //# sourceMappingURL=Header.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../src/components/Header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,SAAS,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,MAAM,GAAI,OAAO,WAAW,4CAQxC,CAAA"}
@@ -0,0 +1,6 @@
1
+ export type HeroProps = {
2
+ title?: string;
3
+ subtitle?: string;
4
+ };
5
+ export declare const Hero: (props: HeroProps) => import("react/jsx-runtime").JSX.Element;
6
+ //# sourceMappingURL=Hero.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Hero.d.ts","sourceRoot":"","sources":["../../src/components/Hero.tsx"],"names":[],"mappings":"AAEA,MAAM,MAAM,SAAS,GAAG;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,IAAI,GAAI,OAAO,SAAS,4CAQpC,CAAA"}
@@ -0,0 +1,68 @@
1
+ import { type CallStatus, type ToolHandlerMap } from "../hooks/useRealtimeCall";
2
+ import type { UseAgentChatReturn } from "../hooks/useAgentChat";
3
+ import type { ToolRenderer } from "../types";
4
+ /**
5
+ * Status-pill label override keys. Beyond the lifecycle `CallStatus`
6
+ * values, the `"active"` bucket has three rendered sub-states
7
+ * (listening / speaking / muted). Consumers can override either the
8
+ * whole `"active"` bucket or each sub-state individually.
9
+ */
10
+ export type RealtimeStatusLabelKey = CallStatus | "active-listening" | "active-speaking" | "active-muted";
11
+ export type RealtimeCallOverlayProps = {
12
+ readonly tokenEndpoint: string;
13
+ readonly tokenHeaders?: HeadersInit;
14
+ readonly tokenBody?: Record<string, unknown> | (() => Record<string, unknown>);
15
+ readonly toolHandlers?: ToolHandlerMap;
16
+ /** Server tool-proxy base (see RealtimeProp.toolProxyPath). */
17
+ readonly toolProxyPath?: string;
18
+ readonly toolProxyHeaders?: HeadersInit;
19
+ readonly idleTimeoutMs?: number;
20
+ /** Close handler invoked on hangup or explicit dismiss. */
21
+ readonly onClose: () => void;
22
+ /**
23
+ * Friendly call label shown at the top (e.g. agent name). Optional.
24
+ * Kept for backwards-compatibility; no longer rendered by default,
25
+ * but consumers can read it via props if they re-skin.
26
+ */
27
+ readonly title?: string;
28
+ /**
29
+ * Greeting line under the orb. Defaults to a short helpful prompt.
30
+ * Pass an empty string to hide.
31
+ */
32
+ readonly hero?: string;
33
+ /**
34
+ * Override the top status-pill text for i18n / branding.
35
+ *
36
+ * Keys map to `CallStatus` values, plus three richer sub-state keys
37
+ * for the `"active"` bucket (`active-listening`, `active-speaking`,
38
+ * `active-muted`). When a richer key is missing, the resolver falls
39
+ * back to the bare `"active"` override, then to the built-in English
40
+ * default.
41
+ */
42
+ readonly statusLabels?: Partial<Record<RealtimeStatusLabelKey, string>>;
43
+ /**
44
+ * Chat handle from the host's `useAgentChat`. When provided the
45
+ * overlay mirrors realtime events into the chat transcript so the
46
+ * unified history covers both text and voice modes, and a developer
47
+ * debug sidebar can render the live nodes on the right.
48
+ */
49
+ readonly chat?: UseAgentChatReturn;
50
+ /** Custom tool renderers reused inside the debug sidebar. */
51
+ readonly toolRenderers?: ToolRenderer[];
52
+ /**
53
+ * Fired when the user's voice turn finishes transcribing. Hosts wire
54
+ * this to their server-side persistence so a page reload reconstructs
55
+ * the voice history. Skipped on empty / whitespace-only text. Errors
56
+ * are caught and ignored — host is responsible for retry policy.
57
+ */
58
+ readonly onUserTurn?: (text: string) => void | Promise<void>;
59
+ /**
60
+ * Fired when the agent's voice turn ends (`turn-complete` or
61
+ * `agent-transcript-final`). The accumulated transcript for the turn
62
+ * is passed verbatim. Skipped on empty turns. Errors are caught and
63
+ * ignored — host is responsible for retry policy.
64
+ */
65
+ readonly onAssistantTurn?: (text: string) => void | Promise<void>;
66
+ };
67
+ export declare const RealtimeCallOverlay: (props: RealtimeCallOverlayProps) => import("react/jsx-runtime").JSX.Element;
68
+ //# sourceMappingURL=RealtimeCallOverlay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RealtimeCallOverlay.d.ts","sourceRoot":"","sources":["../../src/components/RealtimeCallOverlay.tsx"],"names":[],"mappings":"AA0BA,OAAO,EAAmB,KAAK,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAGhG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAkB,MAAM,UAAU,CAAA;AAE5D;;;;;GAKG;AACH,MAAM,MAAM,sBAAsB,GAC9B,UAAU,GACV,kBAAkB,GAClB,iBAAiB,GACjB,cAAc,CAAA;AAElB,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,YAAY,CAAC,EAAE,WAAW,CAAA;IACnC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;IAC9E,QAAQ,CAAC,YAAY,CAAC,EAAE,cAAc,CAAA;IACtC,+DAA+D;IAC/D,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,WAAW,CAAA;IACvC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAA;IAC/B,2DAA2D;IAC3D,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAA;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB;;;OAGG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB;;;;;;;;OAQG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,sBAAsB,EAAE,MAAM,CAAC,CAAC,CAAA;IACvE;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,kBAAkB,CAAA;IAClC,6DAA6D;IAC7D,QAAQ,CAAC,aAAa,CAAC,EAAE,YAAY,EAAE,CAAA;IACvC;;;;;OAKG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC5D;;;;;OAKG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAClE,CAAA;AA4YD,eAAO,MAAM,mBAAmB,GAAI,OAAO,wBAAwB,4CA8YlE,CAAA"}
@@ -0,0 +1,21 @@
1
+ export type RealtimeOrbState = "idle" | "listening" | "speaking" | "connecting";
2
+ export type RealtimeOrbSpeaker = "idle" | "user" | "agent";
3
+ export type RealtimeOrbProps = {
4
+ /** Mutable ref to a 0..1 audio level. Used as fallback when analysers are absent. */
5
+ readonly levelRef?: {
6
+ readonly current: number;
7
+ };
8
+ /** Visual mood (lifecycle phase). */
9
+ readonly state?: RealtimeOrbState;
10
+ /** Live analyser on the mic input. Drives `data-speaker="user"`. */
11
+ readonly inputAnalyser?: AnalyserNode | null;
12
+ /** Live analyser on the agent TTS output. Drives `data-speaker="agent"`. */
13
+ readonly outputAnalyser?: AnalyserNode | null;
14
+ /** Force speaker tint (overrides analyser-derived value). Useful for tests/preview. */
15
+ readonly speaker?: RealtimeOrbSpeaker;
16
+ /** Optional override size (CSS px or any CSS length). Default 240px. */
17
+ readonly size?: number | string;
18
+ };
19
+ export declare const RealtimeOrb: (props: RealtimeOrbProps) => import("react/jsx-runtime").JSX.Element;
20
+ export default RealtimeOrb;
21
+ //# sourceMappingURL=RealtimeOrb.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RealtimeOrb.d.ts","sourceRoot":"","sources":["../../src/components/RealtimeOrb.tsx"],"names":[],"mappings":"AAwBA,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,WAAW,GAAG,UAAU,GAAG,YAAY,CAAA;AAC/E,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAA;AAE1D,MAAM,MAAM,gBAAgB,GAAG;IAC7B,qFAAqF;IACrF,QAAQ,CAAC,QAAQ,CAAC,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAA;IAChD,qCAAqC;IACrC,QAAQ,CAAC,KAAK,CAAC,EAAE,gBAAgB,CAAA;IACjC,oEAAoE;IACpE,QAAQ,CAAC,aAAa,CAAC,EAAE,YAAY,GAAG,IAAI,CAAA;IAC5C,4EAA4E;IAC5E,QAAQ,CAAC,cAAc,CAAC,EAAE,YAAY,GAAG,IAAI,CAAA;IAC7C,uFAAuF;IACvF,QAAQ,CAAC,OAAO,CAAC,EAAE,kBAAkB,CAAA;IACrC,wEAAwE;IACxE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAChC,CAAA;AAkLD,eAAO,MAAM,WAAW,GAAI,OAAO,gBAAgB,4CAuKlD,CAAA;AAED,eAAe,WAAW,CAAA"}
@@ -1,15 +1,11 @@
1
- import type { ReactNode } from "react"
2
-
1
+ import type { ReactNode } from "react";
3
2
  export type SidebarProps = {
4
- children?: ReactNode
5
- }
6
-
3
+ children?: ReactNode;
4
+ };
7
5
  /**
8
6
  * Passthrough container for the left sidebar. When `children` is falsy the
9
7
  * component renders nothing — the parent grid uses `no-sidebar` class to
10
8
  * collapse to a single column.
11
9
  */
12
- export const Sidebar = (props: SidebarProps) => {
13
- if (!props.children) return null
14
- return <aside className="sidebar">{props.children}</aside>
15
- }
10
+ export declare const Sidebar: (props: SidebarProps) => import("react/jsx-runtime").JSX.Element | null;
11
+ //# sourceMappingURL=Sidebar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Sidebar.d.ts","sourceRoot":"","sources":["../../src/components/Sidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,OAAO,GAAI,OAAO,YAAY,mDAG1C,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { TinywebChatProps } from "../types";
2
+ export declare const TinywebChat: (props: TinywebChatProps) => import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=TinywebChat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TinywebChat.d.ts","sourceRoot":"","sources":["../../src/components/TinywebChat.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAGhD,eAAO,MAAM,WAAW,GAAI,OAAO,gBAAgB,4CA2ElD,CAAA"}
@@ -0,0 +1,20 @@
1
+ import type { ChatStatus } from "../hooks/useAgentChat";
2
+ import type { ToolRenderer, TranscriptNode } from "../types";
3
+ export type TranscriptProps = {
4
+ nodes: TranscriptNode[];
5
+ hero?: {
6
+ title?: string;
7
+ subtitle?: string;
8
+ } | null;
9
+ toolRenderers?: ToolRenderer[];
10
+ /**
11
+ * Optional streaming state from `useAgentChat`. When provided, the
12
+ * transcript renders a "Đang suy nghĩ…" pill while the assistant is
13
+ * preparing the next message but hasn't emitted any visible event yet
14
+ * (covers latency between `send()` and first `text-delta` / `tool-call`,
15
+ * and the gap between `tool-result` and the next `text-delta`).
16
+ */
17
+ status?: ChatStatus;
18
+ };
19
+ export declare const Transcript: (props: TranscriptProps) => import("react/jsx-runtime").JSX.Element;
20
+ //# sourceMappingURL=Transcript.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Transcript.d.ts","sourceRoot":"","sources":["../../src/components/Transcript.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAW5D,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,cAAc,EAAE,CAAA;IACvB,IAAI,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;IACnD,aAAa,CAAC,EAAE,YAAY,EAAE,CAAA;IAC9B;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,UAAU,CAAA;CACpB,CAAA;AAqFD,eAAO,MAAM,UAAU,GAAI,OAAO,eAAe,4CAmChD,CAAA"}
@@ -0,0 +1,17 @@
1
+ export type WireOrbState = "idle" | "listening" | "thinking" | "speaking" | "connecting";
2
+ export type WireOrbEffectProps = {
3
+ readonly state: WireOrbState;
4
+ /** Audio level ref (0..1). Boosts speak/listen amplitude when present. */
5
+ readonly levelRef?: {
6
+ readonly current: number;
7
+ };
8
+ /** Accepted for API parity with `RealtimeOrb`. Not yet consumed. */
9
+ readonly inputAnalyser?: AnalyserNode | null;
10
+ /** Accepted for API parity with `RealtimeOrb`. Not yet consumed. */
11
+ readonly outputAnalyser?: AnalyserNode | null;
12
+ /** Enable mouse-driven distortion (off in the call overlay by default). */
13
+ readonly mouseEnabled?: boolean;
14
+ };
15
+ export declare const WireOrbEffect: (props: WireOrbEffectProps) => import("react/jsx-runtime").JSX.Element;
16
+ export default WireOrbEffect;
17
+ //# sourceMappingURL=WireOrbEffect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WireOrbEffect.d.ts","sourceRoot":"","sources":["../../src/components/WireOrbEffect.tsx"],"names":[],"mappings":"AAkCA,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,WAAW,GAAG,UAAU,GAAG,UAAU,GAAG,YAAY,CAAA;AAExF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAA;IAC5B,0EAA0E;IAC1E,QAAQ,CAAC,QAAQ,CAAC,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAA;IAChD,oEAAoE;IACpE,QAAQ,CAAC,aAAa,CAAC,EAAE,YAAY,GAAG,IAAI,CAAA;IAC5C,oEAAoE;IACpE,QAAQ,CAAC,cAAc,CAAC,EAAE,YAAY,GAAG,IAAI,CAAA;IAC7C,2EAA2E;IAC3E,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAA;CAChC,CAAA;AA0OD,eAAO,MAAM,aAAa,GAAI,OAAO,kBAAkB,4CAiRtD,CAAA;AAED,eAAe,aAAa,CAAA"}
@@ -0,0 +1,11 @@
1
+ import type { CondenseState } from "../../types";
2
+ export type CondensePillProps = {
3
+ state: CondenseState;
4
+ };
5
+ /**
6
+ * Single pill that morphs through start → success | error states for one
7
+ * condense trigger. Ported from [`app.js`](../../../../examples/device-pilot/public/app.js:343)
8
+ * `renderCondenseStart` / `Success` / `Error`.
9
+ */
10
+ export declare const CondensePill: (props: CondensePillProps) => import("react/jsx-runtime").JSX.Element;
11
+ //# sourceMappingURL=CondensePill.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CondensePill.d.ts","sourceRoot":"","sources":["../../../src/components/condense/CondensePill.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAEhD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,aAAa,CAAA;CACrB,CAAA;AAmDD;;;;GAIG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,iBAAiB,4CAepD,CAAA"}
@@ -0,0 +1,10 @@
1
+ export type AssistantMessageProps = {
2
+ content: string;
3
+ };
4
+ /**
5
+ * Renders accumulated assistant text as markdown. The function escapes all
6
+ * source before reintroducing safe markup, so `dangerouslySetInnerHTML`
7
+ * here is safe by construction (see [`renderMarkdown`](../../markdown/render.ts)).
8
+ */
9
+ export declare const AssistantMessage: (props: AssistantMessageProps) => import("react/jsx-runtime").JSX.Element;
10
+ //# sourceMappingURL=AssistantMessage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AssistantMessage.d.ts","sourceRoot":"","sources":["../../../src/components/messages/AssistantMessage.tsx"],"names":[],"mappings":"AAEA,MAAM,MAAM,qBAAqB,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAA;AAEvD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAAI,OAAO,qBAAqB,4CAK5D,CAAA"}
@@ -0,0 +1,7 @@
1
+ export type ErrorMessageProps = {
2
+ message: string;
3
+ /** Label override — e.g. "tool-error". Defaults to "error". */
4
+ label?: string;
5
+ };
6
+ export declare const ErrorMessage: (props: ErrorMessageProps) => import("react/jsx-runtime").JSX.Element;
7
+ //# sourceMappingURL=ErrorMessage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ErrorMessage.d.ts","sourceRoot":"","sources":["../../../src/components/messages/ErrorMessage.tsx"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,MAAM,CAAA;IACf,+DAA+D;IAC/D,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,eAAO,MAAM,YAAY,GAAI,OAAO,iBAAiB,4CAKpD,CAAA"}
@@ -0,0 +1,17 @@
1
+ import type { ToolRenderer } from "../../types";
2
+ export type ToolMessageProps = {
3
+ toolName: string;
4
+ result: unknown;
5
+ raw: unknown;
6
+ /** User-supplied renderers — first non-null wins. */
7
+ toolRenderers?: ToolRenderer[];
8
+ };
9
+ /**
10
+ * Dispatches a `tool-result` row to:
11
+ * 1. user-supplied `toolRenderers` (so apps can override anything)
12
+ * 2. built-in friendly renderers for the catalogue in
13
+ * [`@tinyweb_dev/agent-framework-tool`](../../../../tool/src/builtins.ts)
14
+ * 3. structural fallbacks: image → exec → JSON dump.
15
+ */
16
+ export declare const ToolMessage: (props: ToolMessageProps) => import("react/jsx-runtime").JSX.Element;
17
+ //# sourceMappingURL=ToolMessage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToolMessage.d.ts","sourceRoot":"","sources":["../../../src/components/messages/ToolMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAO/C,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,OAAO,CAAA;IACf,GAAG,EAAE,OAAO,CAAA;IACZ,qDAAqD;IACrD,aAAa,CAAC,EAAE,YAAY,EAAE,CAAA;CAC/B,CAAA;AAUD;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,GAAI,OAAO,gBAAgB,4CAkBlD,CAAA"}
@@ -0,0 +1,7 @@
1
+ import type { ImageAttachment } from "../../types";
2
+ export type UserMessageProps = {
3
+ content: string;
4
+ images?: ReadonlyArray<ImageAttachment>;
5
+ };
6
+ export declare const UserMessage: (props: UserMessageProps) => import("react/jsx-runtime").JSX.Element;
7
+ //# sourceMappingURL=UserMessage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserMessage.d.ts","sourceRoot":"","sources":["../../../src/components/messages/UserMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAElD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,aAAa,CAAC,eAAe,CAAC,CAAA;CACxC,CAAA;AASD,eAAO,MAAM,WAAW,GAAI,OAAO,gBAAgB,4CAsBlD,CAAA"}
@@ -0,0 +1,14 @@
1
+ import type { ExecPayload } from "../../util/tool-detect";
2
+ export type ExecRendererProps = {
3
+ toolName: string;
4
+ exec: ExecPayload;
5
+ jsonText: string;
6
+ };
7
+ /**
8
+ * Renders `computer.exec`-style results. Ported from
9
+ * [`app.js`](../../../../examples/device-pilot/public/app.js:501) `renderExecResult`:
10
+ * exit-code chip + stdout/stderr blocks with a per-block collapse toggle
11
+ * and a separate "View JSON" affordance for the raw payload.
12
+ */
13
+ export declare const ExecRenderer: (props: ExecRendererProps) => import("react/jsx-runtime").JSX.Element;
14
+ //# sourceMappingURL=ExecRenderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExecRenderer.d.ts","sourceRoot":"","sources":["../../../src/components/tool/ExecRenderer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAEzD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,WAAW,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AA2BD;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,iBAAiB,4CA8BpD,CAAA"}
@@ -0,0 +1,16 @@
1
+ import type { ImagePayload } from "../../util/tool-detect";
2
+ export type ImageRendererProps = {
3
+ toolName: string;
4
+ image: ImagePayload;
5
+ /** Pretty-printed JSON of the original tool-result payload. */
6
+ jsonText: string;
7
+ };
8
+ /**
9
+ * Image preview with a "View JSON" toggle. Ported from
10
+ * [`app.js`](../../../../examples/device-pilot/public/app.js:619).
11
+ *
12
+ * The JSON view is base64-truncated so the dump stays readable when the
13
+ * payload is a multi-MB screenshot.
14
+ */
15
+ export declare const ImageRenderer: (props: ImageRendererProps) => import("react/jsx-runtime").JSX.Element;
16
+ //# sourceMappingURL=ImageRenderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ImageRenderer.d.ts","sourceRoot":"","sources":["../../../src/components/tool/ImageRenderer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAG1D,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,YAAY,CAAA;IACnB,+DAA+D;IAC/D,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,GAAI,OAAO,kBAAkB,4CA4BtD,CAAA"}
@@ -0,0 +1,11 @@
1
+ export type JsonRendererProps = {
2
+ toolName: string;
3
+ jsonText: string;
4
+ };
5
+ /**
6
+ * Fallback renderer — pretty-printed JSON capped at 1000 chars so a huge
7
+ * payload doesn't blow up the layout. Mirrors the `else` branch at
8
+ * [`app.js`](../../../../examples/device-pilot/public/app.js:651).
9
+ */
10
+ export declare const JsonRenderer: (props: JsonRendererProps) => import("react/jsx-runtime").JSX.Element;
11
+ //# sourceMappingURL=JsonRenderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JsonRenderer.d.ts","sourceRoot":"","sources":["../../../src/components/tool/JsonRenderer.tsx"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAID;;;;GAIG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,iBAAiB,4CAWpD,CAAA"}
@@ -0,0 +1,29 @@
1
+ import type { ReactNode } from "react";
2
+ export type ToolCardProps = {
3
+ /** Emoji or short symbol shown left of the title (e.g. "⛅", "🕒", "🪙"). */
4
+ icon: string;
5
+ /** Friendly, end-user-facing title in Vietnamese (e.g. "Thời tiết hiện tại"). */
6
+ title: string;
7
+ /** Optional one-line subtitle below the title (e.g. location, source). */
8
+ subtitle?: string;
9
+ /** Optional source label / chip rendered top-right (e.g. "Binance"). */
10
+ source?: string;
11
+ /** Optional warning chips rendered in the header (one chip per string). */
12
+ warnings?: string[];
13
+ /** Main body — rendered inside the card. */
14
+ children: ReactNode;
15
+ /** Optional pretty-printed raw JSON for the "tech" collapsed section. */
16
+ jsonText?: string;
17
+ /** Customise the toggle label (default: "Dữ liệu thô"). */
18
+ jsonLabel?: string;
19
+ };
20
+ /**
21
+ * Shared friendly card layout used by all built-in tool renderers.
22
+ *
23
+ * Non-tech default: icon + Vietnamese title + summary content. Power users
24
+ * can click "Dữ liệu thô" to inspect the underlying JSON payload — same
25
+ * affordance as the legacy `tool-json-toggle` so the dev workflow doesn't
26
+ * regress.
27
+ */
28
+ export declare const ToolCard: (props: ToolCardProps) => import("react/jsx-runtime").JSX.Element;
29
+ //# sourceMappingURL=ToolCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToolCard.d.ts","sourceRoot":"","sources":["../../../src/components/tool/ToolCard.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,MAAM,MAAM,aAAa,GAAG;IAC1B,4EAA4E;IAC5E,IAAI,EAAE,MAAM,CAAA;IACZ,iFAAiF;IACjF,KAAK,EAAE,MAAM,CAAA;IACb,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,wEAAwE;IACxE,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IACnB,4CAA4C;IAC5C,QAAQ,EAAE,SAAS,CAAA;IACnB,yEAAyE;IACzE,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,GAAI,OAAO,aAAa,4CAkC5C,CAAA"}
@@ -0,0 +1,9 @@
1
+ import type { ToolRenderer } from "../../types";
2
+ /**
3
+ * Default friendly renderers for the built-in tool catalog. Imported and
4
+ * applied automatically by [`TinywebChat`](../TinywebChat.tsx) — user-supplied
5
+ * `toolRenderers` are tried *first* so apps can override any of these by
6
+ * matching on the same tool name.
7
+ */
8
+ export declare const defaultToolRenderers: ToolRenderer[];
9
+ //# sourceMappingURL=builtinRenderers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builtinRenderers.d.ts","sourceRoot":"","sources":["../../../src/components/tool/builtinRenderers.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAuB,MAAM,aAAa,CAAA;AA8apE;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,EAAE,YAAY,EAU9C,CAAA"}
@@ -0,0 +1,46 @@
1
+ import type { AgentEvent, FinishEvent } from "@tinyweb_dev/agent-framework-protocol";
2
+ import type { ChatMessage, ImageAttachment, TranscriptNode } from "../types";
3
+ export type SendOptions = {
4
+ readonly images?: ReadonlyArray<ImageAttachment>;
5
+ };
6
+ export type ChatStatus = "idle" | "requesting" | "streaming" | "finished" | "error";
7
+ export type UseAgentChatOptions = {
8
+ endpoint: string;
9
+ extraBody?: Record<string, unknown> | (() => Record<string, unknown>);
10
+ headers?: HeadersInit | (() => HeadersInit);
11
+ initialMessages?: ChatMessage[];
12
+ onEvent?: (event: AgentEvent) => void;
13
+ onFinish?: (event: FinishEvent) => void;
14
+ };
15
+ export type UseAgentChatReturn = {
16
+ nodes: TranscriptNode[];
17
+ status: ChatStatus;
18
+ errorMessage: string | undefined;
19
+ send: (prompt: string, options?: SendOptions) => void;
20
+ abort: () => void;
21
+ reset: () => void;
22
+ /**
23
+ * Inject an `AgentEvent` into the transcript as if it had streamed
24
+ * from the chat endpoint. Used by the realtime call overlay to push
25
+ * voice turns + tool calls into the same history the text chat sees,
26
+ * so the right-side debug sidebar can render them with the standard
27
+ * tool renderers. The event runs through the exact same state machine
28
+ * `send()` uses, including the `openAssistantRef` cursor.
29
+ */
30
+ applyEvent: (event: AgentEvent) => void;
31
+ /**
32
+ * Push a user-authored message directly into the transcript without
33
+ * dispatching a fetch. Used by the realtime overlay to record voice
34
+ * turns (transcribed by the LLM) into the same nodes array as text
35
+ * messages, so the chat history stays unified across modalities.
36
+ *
37
+ * If an assistant node is currently streaming (open cursor), the new
38
+ * user node is spliced in BEFORE it — this matters for realtime voice
39
+ * where the agent may begin replying (and emitting `text-delta`)
40
+ * before the user's `inputTranscription` finishes streaming. Without
41
+ * this, the user bubble would render AFTER the agent's reply.
42
+ */
43
+ appendUserMessage: (content: string, images?: ReadonlyArray<ImageAttachment>) => void;
44
+ };
45
+ export declare const useAgentChat: (opts: UseAgentChatOptions) => UseAgentChatReturn;
46
+ //# sourceMappingURL=useAgentChat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAgentChat.d.ts","sourceRoot":"","sources":["../../src/hooks/useAgentChat.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAA;AAChF,OAAO,KAAK,EAAE,WAAW,EAAiB,eAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAG3F,MAAM,MAAM,WAAW,GAAG;IAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC,eAAe,CAAC,CAAA;CAAE,CAAA;AAU9E,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,YAAY,GAAG,WAAW,GAAG,UAAU,GAAG,OAAO,CAAA;AAEnF,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;IACrE,OAAO,CAAC,EAAE,WAAW,GAAG,CAAC,MAAM,WAAW,CAAC,CAAA;IAC3C,eAAe,CAAC,EAAE,WAAW,EAAE,CAAA;IAC/B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAA;IACrC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAA;CACxC,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,cAAc,EAAE,CAAA;IACvB,MAAM,EAAE,UAAU,CAAA;IAClB,YAAY,EAAE,MAAM,GAAG,SAAS,CAAA;IAChC,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,KAAK,IAAI,CAAA;IACrD,KAAK,EAAE,MAAM,IAAI,CAAA;IACjB,KAAK,EAAE,MAAM,IAAI,CAAA;IACjB;;;;;;;OAOG;IACH,UAAU,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAA;IACvC;;;;;;;;;;;OAWG;IACH,iBAAiB,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,aAAa,CAAC,eAAe,CAAC,KAAK,IAAI,CAAA;CACtF,CAAA;AA4BD,eAAO,MAAM,YAAY,GAAI,MAAM,mBAAmB,KAAG,kBA+UxD,CAAA"}
@@ -0,0 +1,15 @@
1
+ import { type RefObject } from "react";
2
+ /**
3
+ * Scroll `containerRef`'s element so the most recently added user message is
4
+ * pinned to the top whenever a new user message arrives.
5
+ *
6
+ * @param containerRef Ref to the scroll container (typically `.messages`).
7
+ * @param spacerRef Ref to a sentinel element rendered at the end of the
8
+ * transcript; its `min-height` is kept in sync with the container so the
9
+ * user bubble can always reach the top.
10
+ * @param latestUserId The id of the latest user message in the transcript,
11
+ * or `null` when the tail isn't a user message. Changing this id is what
12
+ * triggers a re-anchor.
13
+ */
14
+ export declare const useAnchorLatestUser: (containerRef: RefObject<HTMLElement | null>, spacerRef: RefObject<HTMLElement | null>, latestUserId: string | null) => void;
15
+ //# sourceMappingURL=useAnchorLatestUser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAnchorLatestUser.d.ts","sourceRoot":"","sources":["../../src/hooks/useAnchorLatestUser.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAsC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAI1E;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,GAC9B,cAAc,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,EAC3C,WAAW,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,EACxC,cAAc,MAAM,GAAG,IAAI,KAC1B,IAsDF,CAAA"}
@@ -0,0 +1,15 @@
1
+ import { type RefObject } from "react";
2
+ /**
3
+ * Scroll `containerRef`'s element to the very bottom on first mount,
4
+ * without animation. Re-runs only if the container hadn't produced any
5
+ * scrollable height on the first commit (e.g. content hydrated later);
6
+ * once we successfully scroll once, the hook becomes a no-op for the
7
+ * lifetime of the component.
8
+ *
9
+ * @param containerRef Ref to the scroll container (typically `.messages`).
10
+ * @param ready Optional signal — when provided, the initial scroll only
11
+ * fires once `ready` is truthy. Useful when the transcript starts empty
12
+ * and the hook must wait for `initialMessages` to be applied.
13
+ */
14
+ export declare const useInitialScrollToEnd: (containerRef: RefObject<HTMLElement | null>, ready: unknown) => void;
15
+ //# sourceMappingURL=useInitialScrollToEnd.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useInitialScrollToEnd.d.ts","sourceRoot":"","sources":["../../src/hooks/useInitialScrollToEnd.ts"],"names":[],"mappings":"AAUA,OAAO,EAA2B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAE/D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,qBAAqB,GAChC,cAAc,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,EAC3C,OAAO,OAAO,KACb,IAaF,CAAA"}
@@ -0,0 +1,11 @@
1
+ import { type AgentEvent } from "@tinyweb_dev/agent-framework-protocol";
2
+ /**
3
+ * Parses an NDJSON `ReadableStream<Uint8Array>` into validated `AgentEvent`
4
+ * values. Invalid JSON lines, keepalive comments, and events that don't
5
+ * match the protocol schema are silently dropped.
6
+ *
7
+ * Caller is responsible for cancelling the stream (e.g. via the `AbortSignal`
8
+ * passed to the originating `fetch`).
9
+ */
10
+ export declare function parseNdjsonStream(stream: ReadableStream<Uint8Array>): AsyncGenerator<AgentEvent, void, void>;
11
+ //# sourceMappingURL=useNdjsonStream.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useNdjsonStream.d.ts","sourceRoot":"","sources":["../../src/hooks/useNdjsonStream.ts"],"names":[],"mappings":"AAaA,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAEjF;;;;;;;GAOG;AACH,wBAAuB,iBAAiB,CACtC,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,GACjC,cAAc,CAAC,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,CAqCxC"}