@alwith/module-chat 0.5.0 → 0.5.2

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 (208) hide show
  1. package/README.md +23 -10
  2. package/dist/activity-host.d.ts +1 -0
  3. package/dist/activity-host.js +1 -1
  4. package/dist/approval/choice-elicitation-form.js +1 -1
  5. package/dist/approval/choice-schema.js +1 -1
  6. package/dist/approval/permission-options.js +1 -1
  7. package/dist/approval/permission-view.js +1 -1
  8. package/dist/approval/schema-elicitation-form.js +1 -1
  9. package/dist/approval/url-elicitation-card.js +1 -1
  10. package/dist/chunk-15nwm04a.js +2 -0
  11. package/dist/chunk-16y5rmm5.js +2 -0
  12. package/dist/chunk-1d4c9j8w.js +2 -0
  13. package/dist/chunk-20zcgxa5.js +4 -0
  14. package/dist/{chunk-kaeqvcew.js → chunk-2epnn4sq.js} +1 -1
  15. package/dist/chunk-2f19pcpn.js +2 -0
  16. package/dist/chunk-3vt71emt.js +2 -0
  17. package/dist/{chunk-1yy2jsnh.js → chunk-42zr8zpv.js} +2 -2
  18. package/dist/{chunk-k7s0drzk.js → chunk-4svwa5p8.js} +3 -3
  19. package/dist/chunk-4tkxmh52.js +2 -0
  20. package/dist/chunk-5grywgpq.js +4 -0
  21. package/dist/chunk-5h13saah.js +2 -0
  22. package/dist/chunk-5j3wnans.js +2 -0
  23. package/dist/{chunk-yw4e2tcz.js → chunk-6p5hgnpq.js} +1 -1
  24. package/dist/{chunk-kget6qfz.js → chunk-6qa5dt1k.js} +1 -1
  25. package/dist/{chunk-341yykkp.js → chunk-6qn5srgg.js} +1 -1
  26. package/dist/{chunk-1cy1j8gj.js → chunk-6vky4fcv.js} +2 -2
  27. package/dist/{chunk-p9wpghey.js → chunk-7kcdf82d.js} +2 -2
  28. package/dist/{chunk-1hy64ewz.js → chunk-7q7c0mds.js} +1 -1
  29. package/dist/{chunk-wjejhpgw.js → chunk-801v0awm.js} +1 -1
  30. package/dist/{chunk-evcrrxfp.js → chunk-8e7xf2tb.js} +1 -1
  31. package/dist/chunk-8k7wzkna.js +2 -0
  32. package/dist/chunk-8vvn71rf.js +2 -0
  33. package/dist/{chunk-0e1pdbec.js → chunk-9ab18v07.js} +2 -2
  34. package/dist/{chunk-ph7bk34y.js → chunk-9dsa5vm7.js} +2 -2
  35. package/dist/chunk-9pdj44jr.js +2 -0
  36. package/dist/{chunk-m5pbe513.js → chunk-9s1cgt7s.js} +1 -1
  37. package/dist/chunk-aqj0v5a9.js +7 -0
  38. package/dist/chunk-azmqtycn.js +2 -0
  39. package/dist/{chunk-3eg720sa.js → chunk-b5mkvr4d.js} +2 -2
  40. package/dist/chunk-bfe7xk9m.js +3 -0
  41. package/dist/{chunk-k1pd257q.js → chunk-bkbemt8g.js} +2 -2
  42. package/dist/{chunk-d0ptk8x8.js → chunk-c4621n0b.js} +1 -1
  43. package/dist/chunk-cw9tg2sz.js +1 -0
  44. package/dist/{chunk-25na55ve.js → chunk-d675nr2b.js} +2 -2
  45. package/dist/{chunk-y2xbq7rb.js → chunk-d8gwsw6j.js} +3 -3
  46. package/dist/{chunk-1twg3evk.js → chunk-dgp9q950.js} +1 -1
  47. package/dist/chunk-dm31xvh3.js +2 -0
  48. package/dist/chunk-dr6z453e.js +2 -0
  49. package/dist/{chunk-4gayxp21.js → chunk-ea7zsd2s.js} +2 -2
  50. package/dist/chunk-fgsd4fsd.js +2 -0
  51. package/dist/chunk-fvnb8ds4.js +2 -0
  52. package/dist/{chunk-qj8r5xvx.js → chunk-h0dq9ztv.js} +2 -2
  53. package/dist/{chunk-66headm4.js → chunk-h38yw8y3.js} +1 -1
  54. package/dist/{chunk-hnt4tt1n.js → chunk-h6df4xfd.js} +2 -2
  55. package/dist/chunk-h87xp1gv.js +2 -0
  56. package/dist/{chunk-bwzjm3g8.js → chunk-hx6wfscz.js} +1 -1
  57. package/dist/chunk-j2mcvb68.js +7 -0
  58. package/dist/chunk-jeyvacx6.js +5 -0
  59. package/dist/chunk-jh8jske0.js +2 -0
  60. package/dist/chunk-jn2pj92h.js +2 -0
  61. package/dist/{chunk-r5d37dc0.js → chunk-jrrvpnf3.js} +1 -1
  62. package/dist/chunk-jsb0zged.js +2 -0
  63. package/dist/chunk-k2y4cpra.js +2 -0
  64. package/dist/{chunk-zt7a6b1m.js → chunk-k7zzrns3.js} +1 -1
  65. package/dist/chunk-m2myfd89.js +2 -0
  66. package/dist/chunk-m2wxz0sj.js +2 -0
  67. package/dist/chunk-nxarfyj2.js +2 -0
  68. package/dist/chunk-p1pd1twf.js +2 -0
  69. package/dist/chunk-p6558tbk.js +2 -0
  70. package/dist/{chunk-e9zndx26.js → chunk-phe3an96.js} +2 -2
  71. package/dist/{chunk-ftka421d.js → chunk-q7e2bdav.js} +2 -2
  72. package/dist/chunk-qh5fhcrh.js +3 -0
  73. package/dist/chunk-sky795ex.js +1 -0
  74. package/dist/chunk-t3vgbc9s.js +2 -0
  75. package/dist/{chunk-90rwhxdf.js → chunk-t5nstx0k.js} +2 -2
  76. package/dist/chunk-trgq8rq1.js +2 -0
  77. package/dist/{chunk-bf5fh35b.js → chunk-v0zn87k5.js} +2 -2
  78. package/dist/chunk-v72t4sf9.js +2 -0
  79. package/dist/chunk-vhat5rbz.js +2 -0
  80. package/dist/chunk-vw2hv2sq.js +2 -0
  81. package/dist/{chunk-3496tgga.js → chunk-w3yddw6n.js} +2 -2
  82. package/dist/chunk-x9pramem.js +2 -0
  83. package/dist/{chunk-arge74eh.js → chunk-xjen1yt6.js} +2 -2
  84. package/dist/{chunk-g20b01rn.js → chunk-ypvjzkfb.js} +2 -2
  85. package/dist/codex/activity-group.js +1 -1
  86. package/dist/codex/assistant-message.js +1 -2
  87. package/dist/codex/async-question-card.js +1 -3
  88. package/dist/codex/disclosure-state.js +1 -1
  89. package/dist/codex/edited-files-card.js +1 -1
  90. package/dist/codex/image-view-activity.js +1 -1
  91. package/dist/codex/markdown-renderer.js +1 -6
  92. package/dist/codex/navigation-audio.d.ts +5 -5
  93. package/dist/codex/navigation-audio.js +1 -1
  94. package/dist/codex/navigation-preview.js +1 -1
  95. package/dist/codex/navigation-rail.js +1 -1
  96. package/dist/codex/plan.js +1 -1
  97. package/dist/codex/styles.css +176 -0
  98. package/dist/codex/timeline-virtualizer.js +1 -1
  99. package/dist/codex/user-message.js +1 -1
  100. package/dist/codex/virtualized-turn-list.js +1 -1
  101. package/dist/composer/completion-filter.js +1 -1
  102. package/dist/composer/completion-menu.js +2 -2
  103. package/dist/composer/completion-trigger.js +1 -1
  104. package/dist/composer/effort-slider.js +1 -1
  105. package/dist/composer/menu-radio.js +1 -1
  106. package/dist/composer/model-select.js +1 -1
  107. package/dist/composer/permission-mode-select.js +1 -1
  108. package/dist/composer/prompt-input-attachments.js +1 -1
  109. package/dist/composer/prompt-input-clipboard.js +1 -1
  110. package/dist/composer/prompt-input-context.js +1 -1
  111. package/dist/composer/prompt-input-textarea.js +3 -3
  112. package/dist/composer/prompt-input.js +1 -1
  113. package/dist/image-lightbox.js +1 -1
  114. package/dist/image-preview-dialog.js +1 -1
  115. package/dist/lib/code-highlighter.js +1 -1
  116. package/dist/lib/fuzzy.js +1 -1
  117. package/dist/lib/group-blocks.js +1 -1
  118. package/dist/lib/image-encode.js +1 -1
  119. package/dist/lib/limits.js +1 -1
  120. package/dist/lib/markdown-parser.js +1 -1
  121. package/dist/lib/markdown-rules.js +1 -1
  122. package/dist/lib/model-name.js +1 -1
  123. package/dist/lib/pointer-centered-zoom.js +1 -1
  124. package/dist/lib/prepare-prompt-files.js +1 -1
  125. package/dist/lib/stream-style.js +1 -1
  126. package/dist/lib/streaming-markdown.js +1 -1
  127. package/dist/locales.d.ts +312 -0
  128. package/dist/locales.js +1 -1
  129. package/dist/search/chat-search.js +1 -1
  130. package/dist/search/dom-matches.js +1 -1
  131. package/dist/search/find-bar.js +1 -1
  132. package/dist/search/literal-matches.js +1 -1
  133. package/dist/session-timeline/activity-group.d.ts +7 -0
  134. package/dist/session-timeline/activity-group.js +1 -0
  135. package/dist/session-timeline/activity-projection.d.ts +3 -0
  136. package/dist/session-timeline/activity-projection.js +1 -0
  137. package/dist/session-timeline/assistant-content.d.ts +7 -0
  138. package/dist/session-timeline/assistant-content.js +1 -0
  139. package/dist/session-timeline/assistant-turn.d.ts +28 -0
  140. package/dist/session-timeline/assistant-turn.js +1 -0
  141. package/dist/session-timeline/async-questions.d.ts +5 -0
  142. package/dist/session-timeline/async-questions.js +1 -0
  143. package/dist/session-timeline/edited-files-card.d.ts +18 -0
  144. package/dist/session-timeline/edited-files-card.js +1 -0
  145. package/dist/session-timeline/history-timeline.d.ts +12 -0
  146. package/dist/session-timeline/history-timeline.js +1 -0
  147. package/dist/session-timeline/host.d.ts +14 -0
  148. package/dist/session-timeline/host.js +1 -0
  149. package/dist/session-timeline/navigation-rail.d.ts +10 -0
  150. package/dist/session-timeline/navigation-rail.js +1 -0
  151. package/dist/session-timeline/plan.d.ts +4 -0
  152. package/dist/session-timeline/plan.js +1 -0
  153. package/dist/session-timeline/question-reply.d.ts +8 -0
  154. package/dist/session-timeline/question-reply.js +1 -0
  155. package/dist/session-timeline/resource-content.d.ts +7 -0
  156. package/dist/session-timeline/resource-content.js +1 -0
  157. package/dist/session-timeline/session-timeline.d.ts +40 -0
  158. package/dist/session-timeline/session-timeline.js +1 -0
  159. package/dist/session-timeline/timeline-registry.d.ts +12 -0
  160. package/dist/session-timeline/timeline-registry.js +1 -0
  161. package/dist/session-timeline/turn-error.d.ts +14 -0
  162. package/dist/session-timeline/turn-error.js +1 -0
  163. package/dist/session-timeline/turn-retry.d.ts +2 -0
  164. package/dist/session-timeline/turn-retry.js +1 -0
  165. package/dist/session-timeline/turn-time.d.ts +5 -0
  166. package/dist/session-timeline/turn-time.js +1 -0
  167. package/dist/session-timeline/turns.d.ts +51 -0
  168. package/dist/session-timeline/turns.js +1 -0
  169. package/dist/session-timeline/types.d.ts +31 -0
  170. package/dist/session-timeline/types.js +0 -0
  171. package/dist/session-timeline/use-timeline-scroll.d.ts +12 -0
  172. package/dist/session-timeline/use-timeline-scroll.js +1 -0
  173. package/dist/session-timeline/user-message.d.ts +8 -0
  174. package/dist/session-timeline/user-message.js +1 -0
  175. package/dist/ui/badge.js +1 -1
  176. package/dist/ui/button.js +1 -1
  177. package/dist/ui/card.js +1 -1
  178. package/dist/ui/checkbox.js +1 -1
  179. package/dist/ui/dialog.js +1 -1
  180. package/dist/ui/dropdown-menu.js +1 -1
  181. package/dist/ui/field.js +1 -1
  182. package/dist/ui/hover-card.js +1 -1
  183. package/dist/ui/input-group-textarea.js +1 -1
  184. package/dist/ui/input-group.js +1 -1
  185. package/dist/ui/input.js +1 -1
  186. package/dist/ui/label.js +1 -1
  187. package/dist/ui/radio-group.js +1 -1
  188. package/dist/ui/separator.js +1 -1
  189. package/dist/ui/switch.js +1 -1
  190. package/dist/ui/textarea.js +1 -1
  191. package/dist/ui/tooltip.js +1 -1
  192. package/package.json +32 -4
  193. package/dist/chunk-2q9rzxbj.js +0 -2
  194. package/dist/chunk-36h9z1mt.js +0 -1
  195. package/dist/chunk-7tj0a2na.js +0 -2
  196. package/dist/chunk-8z8va1ws.js +0 -2
  197. package/dist/chunk-91nk8n6w.js +0 -2
  198. package/dist/chunk-c4cqqqqh.js +0 -2
  199. package/dist/chunk-cp20nzhv.js +0 -2
  200. package/dist/chunk-gfj69sqc.js +0 -2
  201. package/dist/chunk-mbrd76nh.js +0 -2
  202. package/dist/chunk-pc1yzf1x.js +0 -1
  203. package/dist/chunk-pqgtv07g.js +0 -2
  204. package/dist/chunk-reqrpvyy.js +0 -2
  205. package/dist/chunk-rgy601b7.js +0 -2
  206. package/dist/chunk-svmc952q.js +0 -7
  207. package/dist/chunk-tzdd96d0.js +0 -2
  208. package/dist/chunk-yvj5y06y.js +0 -2
@@ -0,0 +1,28 @@
1
+ import { type Terminal, type TurnError } from "@alwith/api";
2
+ import { type ReactNode } from "react";
3
+ import { type TurnRetry } from "./turn-error";
4
+ import { type Turn } from "./turns";
5
+ export interface AssistantTurnProps {
6
+ sessionId: string;
7
+ turn: Turn;
8
+ terminals: Record<string, Terminal>;
9
+ active: boolean;
10
+ blocked?: boolean;
11
+ continued?: boolean;
12
+ edits?: Turn["edits"];
13
+ activityItems?: Turn["items"];
14
+ workStartedAt?: number;
15
+ isLast: boolean;
16
+ error: TurnError | null;
17
+ interrupted: boolean;
18
+ retry?: TurnRetry;
19
+ retrying?: {
20
+ message: string;
21
+ capacity: boolean;
22
+ };
23
+ answerActions?: ReactNode;
24
+ footer?: ReactNode;
25
+ }
26
+ declare function AssistantTurnImpl({ sessionId, turn, terminals, active, blocked, continued, edits, activityItems, workStartedAt, isLast, error, interrupted, retry, retrying, answerActions, footer }: AssistantTurnProps): import("react").JSX.Element;
27
+ export declare const AssistantTurn: import("react").MemoExoticComponent<typeof AssistantTurnImpl>;
28
+ export {};
@@ -0,0 +1 @@
1
+ import{ft}from"../chunk-qh5fhcrh.js";import"../chunk-bfe7xk9m.js";import"../chunk-t5nstx0k.js";import"../chunk-3vt71emt.js";import"../chunk-h87xp1gv.js";import"../chunk-jeyvacx6.js";import"../chunk-4svwa5p8.js";import"../chunk-w3yddw6n.js";import"../chunk-q7e2bdav.js";import"../chunk-k2y4cpra.js";import"../chunk-aqj0v5a9.js";import"../chunk-m2wxz0sj.js";import"../chunk-trgq8rq1.js";import"../chunk-d8gwsw6j.js";import"../chunk-p6558tbk.js";import"../chunk-7kcdf82d.js";import"../chunk-fgsd4fsd.js";import"../chunk-4tkxmh52.js";import"../chunk-v0zn87k5.js";import"../chunk-p1pd1twf.js";import"../chunk-8k7wzkna.js";import"../chunk-fvnb8ds4.js";import"../chunk-5grywgpq.js";import"../chunk-k7zzrns3.js";import"../chunk-hx6wfscz.js";import"../chunk-c4621n0b.js";import"../chunk-vw2hv2sq.js";import"../chunk-801v0awm.js";import"../chunk-azmqtycn.js";export{ft as AssistantTurn};
@@ -0,0 +1,5 @@
1
+ import { type MessageItem } from "@alwith/api";
2
+ export declare function AsyncQuestions({ sessionId, item }: {
3
+ sessionId: string;
4
+ item: MessageItem;
5
+ }): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ import{vt}from"../chunk-3vt71emt.js";import"../chunk-5grywgpq.js";import"../chunk-k7zzrns3.js";import"../chunk-hx6wfscz.js";import"../chunk-c4621n0b.js";import"../chunk-vw2hv2sq.js";import"../chunk-801v0awm.js";import"../chunk-azmqtycn.js";export{vt as AsyncQuestions};
@@ -0,0 +1,18 @@
1
+ import type { ToolItem } from "@alwith/api";
2
+ type FileChange = {
3
+ path: string;
4
+ patch: string;
5
+ additions: number;
6
+ deletions: number;
7
+ };
8
+ type Stats = {
9
+ additions: number;
10
+ deletions: number;
11
+ };
12
+ export declare function filePatch(patch: string, path: string): string;
13
+ export declare function patchStatsByFile(patch: string): Map<string, Stats>;
14
+ export declare function fileChanges(items: ToolItem[]): FileChange[];
15
+ export declare function EditedFilesCard({ items }: {
16
+ items: ToolItem[];
17
+ }): import("react").JSX.Element;
18
+ export {};
@@ -0,0 +1 @@
1
+ import{fn,hn,vn,bt}from"../chunk-jeyvacx6.js";import"../chunk-4svwa5p8.js";import"../chunk-vw2hv2sq.js";import"../chunk-azmqtycn.js";export{bt as EditedFilesCard,vn as fileChanges,fn as filePatch,hn as patchStatsByFile};
@@ -0,0 +1,12 @@
1
+ import type { HistoryNavigationState } from "@nyssance/codex-acp-v2/client";
2
+ import type { Turn } from "./turns";
3
+ export type HistoryTimelineEntry = {
4
+ turnKey: string;
5
+ aliases?: string[];
6
+ estimatedHeightPx?: number;
7
+ placeholder?: boolean;
8
+ deferUntilReady?: boolean;
9
+ turn?: Turn;
10
+ nativeTurnId?: string;
11
+ };
12
+ export declare function historyTimeline(turns: Turn[], navigation?: HistoryNavigationState): HistoryTimelineEntry[];
@@ -0,0 +1 @@
1
+ import{xt}from"../chunk-1d4c9j8w.js";export{xt as historyTimeline};
@@ -0,0 +1,14 @@
1
+ import type { Store } from "@alwith/api/client";
2
+ import type { CodexClientState } from "@nyssance/codex-acp-v2/client";
3
+ import { type ReactNode } from "react";
4
+ import type { SessionTimelineClient, SessionTimelineHost } from "./types";
5
+ export declare function TimelineProvider({ host, client, children }: {
6
+ host: SessionTimelineHost;
7
+ client: SessionTimelineClient;
8
+ children: ReactNode;
9
+ }): import("react").JSX.Element;
10
+ export declare function useTimelineHost(): SessionTimelineHost;
11
+ export declare function useTimelineClient(): SessionTimelineClient;
12
+ export declare function useStoreState<T extends object, R>(store: Store<T>, selector: (state: T) => R): R;
13
+ export declare function useClientState<R>(selector: (state: CodexClientState) => R): R;
14
+ export declare function reportError(host: SessionTimelineHost, error: unknown): void;
@@ -0,0 +1 @@
1
+ import{Me,t,b,Se,g,V}from"../chunk-vw2hv2sq.js";import"../chunk-azmqtycn.js";export{Me as TimelineProvider,V as reportError,g as useClientState,Se as useStoreState,b as useTimelineClient,t as useTimelineHost};
@@ -0,0 +1,10 @@
1
+ import type * as acp from "@agentclientprotocol/sdk/experimental/v2/unstable";
2
+ import type { HistoryNavigationState } from "@nyssance/codex-acp-v2/client";
3
+ import { type ComponentProps } from "react";
4
+ import type { NavigationInstrument, NavigationSoundMode } from "../codex/navigation-instruments";
5
+ import { type NavigationRailAudio, type TimelineUserMessageNavigationItem, TimelineUserMessageNavigationRail as SharedRail } from "../codex/navigation-rail";
6
+ import { type Turn } from "./turns";
7
+ export type NavigationRailItem = TimelineUserMessageNavigationItem;
8
+ export declare function navigationAudio(instrument: NavigationInstrument, soundMode: NavigationSoundMode): NavigationRailAudio;
9
+ export declare function toNavigationRailItems(turns: Turn[], turnUsage?: Record<string, acp.Usage>, navigation?: HistoryNavigationState): NavigationRailItem[];
10
+ export declare function TimelineNavigationRail(props: Omit<ComponentProps<typeof SharedRail>, "renderPreview">): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ import{sn,_t,Ht}from"../chunk-vhat5rbz.js";import"../chunk-2f19pcpn.js";import"../chunk-j2mcvb68.js";import"../chunk-jn2pj92h.js";import"../chunk-9dsa5vm7.js";import"../chunk-d675nr2b.js";import"../chunk-bkbemt8g.js";import"../chunk-ypvjzkfb.js";import"../chunk-fvnb8ds4.js";import"../chunk-5grywgpq.js";import"../chunk-k7zzrns3.js";import"../chunk-hx6wfscz.js";import"../chunk-c4621n0b.js";import"../chunk-vw2hv2sq.js";import"../chunk-801v0awm.js";import"../chunk-azmqtycn.js";export{Ht as TimelineNavigationRail,sn as navigationAudio,_t as toNavigationRailItems};
@@ -0,0 +1,4 @@
1
+ import type * as acp from "@agentclientprotocol/sdk/experimental/v2/unstable";
2
+ export declare function TurnPlan({ plan }: {
3
+ plan: acp.PlanUpdateContent;
4
+ }): import("react").JSX.Element | null;
@@ -0,0 +1 @@
1
+ import{Et}from"../chunk-4tkxmh52.js";import"../chunk-v0zn87k5.js";import"../chunk-azmqtycn.js";export{Et as TurnPlan};
@@ -0,0 +1,8 @@
1
+ export declare function questionReply(meta: unknown): {
2
+ question: string;
3
+ answer: string;
4
+ } | null;
5
+ export declare function questionReplyParts(meta: unknown): Array<{
6
+ text: string;
7
+ question?: string;
8
+ }> | null;
@@ -0,0 +1 @@
1
+ import{Rt,Lt}from"../chunk-15nwm04a.js";export{Rt as questionReply,Lt as questionReplyParts};
@@ -0,0 +1,7 @@
1
+ import type { ContentBlock } from "@agentclientprotocol/sdk/experimental/v2/unstable";
2
+ import { type ReactElement } from "react";
3
+ export declare function chatFileName(uri: string): string;
4
+ export declare function ResourceContent({ block, generated }: {
5
+ block: ContentBlock;
6
+ generated?: boolean;
7
+ }): ReactElement | null;
@@ -0,0 +1 @@
1
+ import{an,p}from"../chunk-fgsd4fsd.js";import"../chunk-vw2hv2sq.js";import"../chunk-801v0awm.js";import"../chunk-azmqtycn.js";export{p as ResourceContent,an as chatFileName};
@@ -0,0 +1,40 @@
1
+ import type { MessageItem, Session } from "@alwith/api";
2
+ import { type ComponentType, type HTMLAttributes, type ReactNode } from "react";
3
+ import type { NavigationRailAudio } from "../codex/navigation-rail";
4
+ import { type Turn } from "./turns";
5
+ import type { SessionTimelineClient, SessionTimelineHost } from "./types";
6
+ export type { SessionTimelineClient, SessionTimelineHost } from "./types";
7
+ export { TimelineProvider } from "./host";
8
+ export type { Turn, WorkEntry } from "./turns";
9
+ export { navigationAudio } from "./navigation-rail";
10
+ export type { NavigationRailAudio } from "../codex/navigation-rail";
11
+ export interface TimelineViewportProps {
12
+ viewportRef: (element: HTMLElement | null) => void;
13
+ viewportProps: HTMLAttributes<HTMLDivElement> & {
14
+ [key: `data-${string}`]: string;
15
+ };
16
+ children: ReactNode;
17
+ }
18
+ export interface SessionTimelineProps {
19
+ session: Session;
20
+ client: SessionTimelineClient;
21
+ host: SessionTimelineHost;
22
+ leading?: ReactNode;
23
+ afterTurn?: (turn: Turn) => ReactNode;
24
+ answerActions?: (turn: Turn) => ReactNode;
25
+ turnFooter?: (turn: Turn) => ReactNode;
26
+ renderUserMessage?: (item: MessageItem, messageTime: {
27
+ short: string;
28
+ full: string;
29
+ } | null) => ReactNode;
30
+ insert?: {
31
+ afterItemId: string | null;
32
+ node: ReactNode;
33
+ };
34
+ navigation?: {
35
+ audio: NavigationRailAudio;
36
+ };
37
+ anchorNewTurn?: boolean;
38
+ Viewport?: ComponentType<TimelineViewportProps>;
39
+ }
40
+ export declare function SessionTimeline(props: SessionTimelineProps): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ import"../chunk-nxarfyj2.js";import{ct}from"../chunk-jsb0zged.js";import{e}from"../chunk-801v0awm.js";import"../chunk-azmqtycn.js";import"../chunk-d8gwsw6j.js";import"../chunk-t5nstx0k.js";import"../chunk-7kcdf82d.js";import"../chunk-trgq8rq1.js";import"../chunk-m2wxz0sj.js";import"../chunk-v0zn87k5.js";import"../chunk-aqj0v5a9.js";import"../chunk-4svwa5p8.js";import"../chunk-q7e2bdav.js";import"../chunk-w3yddw6n.js";import"../chunk-bfe7xk9m.js";import"../chunk-hx6wfscz.js";import"../chunk-k7zzrns3.js";import"../chunk-c4621n0b.js";import"../chunk-5grywgpq.js";import"../chunk-p6558tbk.js";import{Me,t,b,g,V}from"../chunk-vw2hv2sq.js";import"../chunk-fgsd4fsd.js";import"../chunk-k2y4cpra.js";import"../chunk-h87xp1gv.js";import"../chunk-3vt71emt.js";import"../chunk-jeyvacx6.js";import"../chunk-4tkxmh52.js";import"../chunk-8k7wzkna.js";import{z}from"../chunk-p1pd1twf.js";import{Gt,U,Te,Qt,Xt}from"../chunk-fvnb8ds4.js";import{ft}from"../chunk-qh5fhcrh.js";import{xt}from"../chunk-1d4c9j8w.js";import"../chunk-d675nr2b.js";import"../chunk-ypvjzkfb.js";import"../chunk-bkbemt8g.js";import"../chunk-j2mcvb68.js";import"../chunk-2f19pcpn.js";import"../chunk-9dsa5vm7.js";import"../chunk-jn2pj92h.js";import{sn,_t,Ht}from"../chunk-vhat5rbz.js";import{tn,nn}from"../chunk-x9pramem.js";import{Tt}from"../chunk-5j3wnans.js";import{At}from"../chunk-8vvn71rf.js";import"../chunk-15nwm04a.js";import{wt}from"../chunk-20zcgxa5.js";import{codexExtensionCapabilities as Ve,codexMessageError as Be,codexRetryNotice as qe,codexTurnError as Oe,nativeTurnId as fe}from"@nyssance/codex-acp-v2/client";import{ArrowDownIcon as Fe}from"lucide-react";import{useCallback as O,useEffect as L,useLayoutEffect as ge,useMemo as ve,useRef as w,useState as X}from"react";import{flushSync as ye}from"react-dom";import{jsx as o,jsxs as C}from"react/jsx-runtime";var xe=24;function Ue(n){let d=Math.max(0,n.turnTopPx-xe),v=Math.max(0,n.scrollHeightPx-n.viewportHeightPx),c=d-v;return{scrollTopPx:d,spacerPx:c>0?n.spacerPx+c:n.spacerPx}}function Ke({viewportRef:n,viewportProps:d,children:v}){return o("div",{ref:n,...d,className:"min-h-0 min-w-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain outline-none",children:v})}function _e({sessionId:n,turnId:d,root:v,error:c,connected:P}){let M=w(null),R=b(),{t:k}=t(),S=O(()=>{R.loadHistoryTurn(n,d).catch(()=>{})},[R,n,d]);return L(()=>{if(!v||!M.current||!P||c)return;let F=new IntersectionObserver((T)=>{if(T.some((I)=>I.isIntersecting))F.disconnect(),S()},{root:v,rootMargin:"800px 0px"});return F.observe(M.current),()=>F.disconnect()},[v,P,c,S]),o("div",{ref:M,className:"flex min-h-80 flex-col justify-center gap-3 py-8","data-history-turn":d,"data-markdown-pending":!0,children:c?C("div",{className:"flex flex-col items-center gap-2",children:[o("p",{role:"alert",className:"text-destructive text-xs",children:c}),o(e,{variant:"outline",size:"sm",onClick:S,disabled:!P,children:k("timeline.navigationRetry")})]}):C("div",{role:"status","aria-label":k("timeline.navigationLoading"),className:"space-y-3",children:[o("div",{className:"bg-muted ml-auto h-5 w-1/3 rounded"}),o("div",{className:"bg-muted h-3 w-4/5 rounded"}),o("div",{className:"bg-muted h-3 w-3/5 rounded"})]})})}function $e(n,d){let v=w([]),c=w(null);if(c.current?.items!==n.items||c.current.ended!==n.turnEndedAt||c.current.usage!==n.turnUsage||c.current.historyOrder!==d)c.current={items:n.items,ended:n.turnEndedAt,usage:n.turnUsage,historyOrder:d,turns:Gt(n,v.current,d)};let P=c.current.turns;return v.current=P,P}function ut(n){return o(Me,{host:n.host,client:n.client,children:o(De,{...n})})}function De({session:n,leading:d,afterTurn:v,answerActions:c,turnFooter:P,renderUserMessage:M,insert:R,navigation:k,anchorNewTurn:S=!1,Viewport:F=Ke}){let T=b(),I=t(),y=g((r)=>r.historyNavigation[n.id]),s=$e(n,y?.turns),B=s.at(-1)?.key,he=Qt(n,s),x=n.state!=="idle",we=ve(()=>xt(s,y),[s,y]),be=ve(()=>k===void 0?[]:_t(s,n.turnUsage,y),[k,s,n.turnUsage,y]),ee=R&&R.afterItemId!==null?s.findIndex((r)=>r.items.some((a)=>a.id===R.afterItemId)):-1,G=w(s);G.current=s;let[l,Re]=X(null),h=g((r)=>r.historyPages[n.id]),H=g((r)=>r.connection==="ready"),Se=g((r)=>Ve(r.agent).sessionRetry),te=h!==void 0;L(()=>{if(H&&te&&!n.restoring)T.loadHistoryNavigation(n.id).catch(()=>{})},[T,H,te,n.id,n.restoring]);let[Pe,Ie]=X(!1),D=w(null),[He,ne]=X(!1),re=w(0),J=w({key:B,running:x});J.current={key:B,running:x};let[ie,j]=X(0),E=w(0),A=w(null);E.current=ie;let Ne=O(()=>{if(A.current!==null)A.current.keepTop=!1},[]),{isFollowing:q,scrollToBottom:Q,stopFollowing:K,schedulePin:oe,contentResized:le,beginLocate:ae,cancelLocation:ue}=At(l,x,Ne),se=O(()=>{if(l===null||!x)return;let r=s.at(-1)?.key;if(r===void 0)return;let a=ae(!0),u=()=>a.isCurrent()&&J.current.running&&J.current.key===r,i=()=>requestAnimationFrame(()=>requestAnimationFrame(()=>{if(!u())return;let f=l.querySelector(`[data-codex-turn="${CSS.escape(r)}"]`);if(f===null)return;let m=l.scrollTop+f.getBoundingClientRect().top-l.getBoundingClientRect().top,N=Ue({turnTopPx:m,scrollHeightPx:l.scrollHeight,viewportHeightPx:l.clientHeight,spacerPx:E.current});A.current=N.spacerPx>0?{element:f,heightPx:f.getBoundingClientRect().height+N.spacerPx,keepTop:!0}:null,ye(()=>j(N.spacerPx)),requestAnimationFrame(()=>{if(u())a.finish(N.scrollTopPx)})})),p=D.current;if(p===null)return;p.scrollToKey(r,void 0,{align:"top"}).then(()=>{if(u())i()})},[ae,x,l,s]);ge(()=>{if(!S||x)return;ue(),A.current=null,E.current=0,j(0)},[S,ue,x]);let Y=O(()=>{K(),T.loadOlderHistory(n.id).catch(()=>{})},[T,n.id,K]);L(()=>{if(l===null)return;let r=()=>{let a=l.scrollTop<600;if(Ie(a),a&&!y?.complete&&H&&!n.restoring&&!q&&h?.cursor&&!h.loading&&!h.error)Y()};return r(),l.addEventListener("scroll",r,{passive:!0}),()=>l.removeEventListener("scroll",r)},[H,h,q,Y,l,n.restoring,y?.complete]),L(()=>{tn({sessionId:n.id,turns:s,api:D.current,beforeReveal:K})},[n.id,s,K]),L(()=>()=>nn(n.id),[n.id]);let ke=O(async(r,a)=>{let u=++re.current;ne(!0);try{if(r.isLoaded===!1&&r.nativeTurnId!==void 0)await T.loadHistoryTurn(n.id,r.nativeTurnId),await new Promise((m)=>requestAnimationFrame(()=>m()));if(!a())return null;let i=G.current.find((m)=>m.user?.id===(r.messageId??r.id))??G.current.find((m)=>m.user!==null&&r.nativeTurnId!==void 0&&m.items.some((N)=>fe(N)===r.nativeTurnId));if(!i?.user)return null;let p=i.user.id,f=D.current;if(f===null)throw Error("Virtual timeline is not mounted");return await f.scrollToKey(i.key,(m)=>m.querySelector(`[data-content-search-unit-key="${CSS.escape(p)}"]`),{align:"top"}),document.querySelector(`[data-chat-scroll] [data-content-search-unit-key="${CSS.escape(p)}"]`)}finally{if(re.current===u)ne(!1)}},[T,n.id]),Ee=O(async(r)=>{if(r.nativeTurnId!==void 0)await T.previewHistoryTurn(n.id,r.nativeTurnId)},[T,n.id]);L(()=>{if(l===null)return;let r=l.querySelector("[data-codex-timeline]");if(r===null)throw Error("Timeline content element is missing");let a=new ResizeObserver(()=>{let u=A.current,i=null;if(u!==null){let p=Math.max(0,u.heightPx-u.element.getBoundingClientRect().height);if(p!==E.current&&(p<E.current||u.keepTop)){if(E.current=p,ye(()=>j(p)),p===0)A.current=null}if(p>0&&u.keepTop)i=l.scrollTop+u.element.getBoundingClientRect().top-l.getBoundingClientRect().top-xe}le(i)});if(a.observe(r),a.observe(l),B!==void 0){let u=l.querySelector(`[data-codex-turn="${CSS.escape(B)}"]`);if(u===null)throw Error("Latest turn is not mounted");a.observe(u)}return()=>a.disconnect()},[le,B,l]),L(()=>{if(n.items.length===0)return;oe()},[oe,n.items]);let ce=w(null);ge(()=>{if(l===null)return;let r=s.at(-1),a=ce.current;if(ce.current=r===void 0?null:{key:r.key,running:x},r===void 0||a===null||r.user===null||r.replayed)return;if(S){if(x&&n.turnEndedAt[r.user.id]===void 0&&(r.key!==a.key||!a.running))A.current=null,E.current=0,j(0),se()}else if(r.key!==a.key)Q()},[se,S,x,Q,l,n.turnEndedAt,s]);let Ae=(r,a)=>{let u=r,i=u.turn;if(i===void 0){if(u.nativeTurnId===void 0)throw Error(`Turn is missing at index ${a}`);return o(_e,{sessionId:n.id,turnId:u.nativeTurnId,root:l,error:y?.turnErrors[u.nativeTurnId],connected:H&&!q&&!He})}let p=s.indexOf(i),f=i.key===he,m=Xt(n,s,p),N=!f&&m.continued,W=i.key===B,_=i.errors.at(-1),de=_===void 0?null:Be(_),Z=_===void 0?null:fe(_),Le=W&&!f&&H&&Se&&n.attached&&!n.readOnly&&!n.restoring&&_===n.items.at(-1)&&de!==null&&Oe(de).category==="overloaded"&&Z!==null&&n.lastStopReason!=="end_turn"&&n.lastStopReason!=="cancelled",me=P?.(i)??null,Ce=i.work.length>0||i.final.length>0||i.errors.length>0||f||me!==null||U(i)||Te(i)||W&&(n.error!==null||n.lastStopReason==="cancelled"),pe=i.user===null?null:z(i);return C("div",{"data-virtualized-turn-content":!0,"data-codex-turn":i.key,className:"flex flex-col gap-1.5",children:[i.user!==null&&(M===void 0?o(wt,{item:i.user,messageTime:pe}):M(i.user,pe)),Ce&&o(ft,{sessionId:n.id,turn:i,terminals:n.terminals,active:f,blocked:n.state==="requires_action",continued:N,edits:m.edits,activityItems:m.items,workStartedAt:m.startedAt,isLast:W,error:n.error,retrying:f?qe(n._meta)??void 0:void 0,retry:Le?{turnId:Z,delaySeconds:Tt(s),run:(ze)=>T.retrySession(n.id,Z,ze)}:void 0,interrupted:Te(i)||!f&&W&&n.lastStopReason==="cancelled",answerActions:c?.(i),footer:me}),a===ee&&R?.node,v?.(i)]})};return C("div",{className:"relative flex min-h-0 flex-1 flex-col","data-stream-style":"codexUI",children:[o(F,{viewportRef:Re,viewportProps:{"data-chat-scroll":"",style:{overflowAnchor:"none"},tabIndex:0,role:"log","aria-label":I.t("timeline.label")},children:o("div",{className:"codex-timeline-content flex min-h-full w-full flex-col",children:C("div",{"data-timeline-user-message-navigation-content":!0,className:"mx-auto flex w-full max-w-3xl shrink-0 flex-col",children:[R&&ee===-1&&R.node,o(ct,{ref:D,entries:we,renderTurn:Ae,scrollElement:l,sessionKey:n.id,preserveViewport:!q,leadingInsetPx:12,leadingContent:d===void 0?void 0:o("div",{className:"pt-3",children:d})}),S&&o("div",{"aria-hidden":"true","data-turn-anchor-spacer":!0,className:"shrink-0",style:{height:ie}}),o("div",{"aria-hidden":"true",className:"h-6 shrink-0"})]})})}),o("div",{"aria-hidden":"true",className:"codex-timeline-bottom-fade"}),y?.error&&o("div",{className:"absolute inset-x-0 top-2 z-10 flex justify-center",children:o(e,{variant:"outline",size:"sm",disabled:!H,title:y.error,onClick:()=>{T.loadHistoryNavigation(n.id).catch(()=>{})},children:I.t("timeline.navigationRetry")})}),Pe&&h?.cursor&&!y?.complete&&C("div",{className:"absolute inset-x-0 top-2 z-10 flex flex-col items-center gap-1","data-history-loader":!0,children:[o(e,{variant:"outline",size:"sm",disabled:!H||n.restoring||h.loading,onClick:Y,children:h.loading?I.t("timeline.loadingEarlier"):I.t("timeline.loadEarlier")}),h.error&&o("p",{role:"alert",className:"bg-background text-destructive max-w-md rounded px-2 py-1 text-xs",children:h.error})]}),k!==void 0&&o(Ht,{items:be,audio:k.audio,scrollRoot:l,beforeReveal:K,ensureItemMounted:ke,onPreviewItem:Ee,onRevealError:(r)=>V(I,r),targetTopMarginPx:16},n.id),o("button",{type:"button",className:q?"codex-scroll-to-bottom codex-scroll-to-bottom-hidden":"codex-scroll-to-bottom",tabIndex:q?-1:void 0,onClick:Q,"aria-label":I.t("timeline.scrollToBottom"),children:x?C("span",{className:"codex-scroll-to-bottom-dots","aria-hidden":"true",children:[o("span",{className:"codex-wave-dot"}),o("span",{className:"codex-wave-dot"}),o("span",{className:"codex-wave-dot"})]}):o(Fe,{})})]})}export{ut as SessionTimeline,Me as TimelineProvider,sn as navigationAudio};
@@ -0,0 +1,12 @@
1
+ import type { VirtualizedTurnListApi } from "../codex/virtualized-turn-list";
2
+ import type { Turn } from "./turns";
3
+ export type TimelineRegistry = {
4
+ sessionId: string | null;
5
+ turns: Turn[];
6
+ api: VirtualizedTurnListApi | null;
7
+ beforeReveal: (() => void) | null;
8
+ };
9
+ export declare const timelineRegistry: import("@alwith/api/client").Store<TimelineRegistry>;
10
+ export declare function publishTimeline(entry: TimelineRegistry): void;
11
+ export declare function clearTimeline(sessionId: string): void;
12
+ export declare function revealTimelineTurn(sessionId: string | null, key: string, signal: AbortSignal): Promise<void>;
@@ -0,0 +1 @@
1
+ import{Ee,tn,nn,tr}from"../chunk-x9pramem.js";export{nn as clearTimeline,tn as publishTimeline,tr as revealTimelineTurn,Ee as timelineRegistry};
@@ -0,0 +1,14 @@
1
+ import type { TurnError } from "@alwith/api";
2
+ import { type ReactNode } from "react";
3
+ export type TurnRetry = {
4
+ turnId: string;
5
+ delaySeconds: number | null;
6
+ run: (trigger: "manual" | "automatic") => Promise<void>;
7
+ };
8
+ export declare function ErrorCard({ children }: {
9
+ children: ReactNode;
10
+ }): import("react").JSX.Element;
11
+ export declare function TurnErrorView({ error, retry }: {
12
+ error: TurnError;
13
+ retry?: TurnRetry;
14
+ }): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ import{ye,we}from"../chunk-8k7wzkna.js";import"../chunk-vw2hv2sq.js";import"../chunk-801v0awm.js";import"../chunk-azmqtycn.js";export{ye as ErrorCard,we as TurnErrorView};
@@ -0,0 +1,2 @@
1
+ import type { Turn } from "./turns";
2
+ export declare function capacityRetryDelay(turns: readonly Turn[]): number | null;
@@ -0,0 +1 @@
1
+ import{Tt}from"../chunk-5j3wnans.js";export{Tt as capacityRetryDelay};
@@ -0,0 +1,5 @@
1
+ import type { Turn } from "./turns";
2
+ export declare function formatTurnTime(turn: Turn, role?: "user" | "assistant"): {
3
+ short: string;
4
+ full: string;
5
+ } | null;
@@ -0,0 +1 @@
1
+ import{z}from"../chunk-p1pd1twf.js";export{z as formatTurnTime};
@@ -0,0 +1,51 @@
1
+ import type { CompactionItem, MessageItem, PlanItem, ToolItem } from "@alwith/api";
2
+ import { type Item, type Session } from "@alwith/api";
3
+ import { type HistoryTurnSummary } from "@nyssance/codex-acp-v2/client";
4
+ export type WorkEntry = {
5
+ kind: "activity";
6
+ key: string;
7
+ items: Array<MessageItem | ToolItem>;
8
+ } | {
9
+ kind: "text";
10
+ key: string;
11
+ item: MessageItem;
12
+ } | {
13
+ kind: "plan";
14
+ key: string;
15
+ item: PlanItem;
16
+ } | {
17
+ kind: "compaction";
18
+ key: string;
19
+ item: CompactionItem;
20
+ };
21
+ export type Turn = {
22
+ key: string;
23
+ user: MessageItem | null;
24
+ work: WorkEntry[];
25
+ final: MessageItem[];
26
+ errors: MessageItem[];
27
+ edits: ToolItem[];
28
+ startedAt: number;
29
+ endedAt: number;
30
+ replayed: boolean;
31
+ items: Item[];
32
+ };
33
+ export declare function isMcpStartup(item: Item): item is ToolItem;
34
+ export declare function isSessionStatus(turn: Turn): boolean;
35
+ export declare function groupTurns(session: Session, previous?: Turn[], historyOrder?: HistoryTurnSummary[]): Turn[];
36
+ export declare function messageText(item: MessageItem): string;
37
+ export declare function isHistoryInterrupted(turn: Turn): boolean;
38
+ export declare function isTurnInterrupted(turn: Turn): boolean;
39
+ export declare function turnTiming(turn: Turn): {
40
+ durationMs?: number;
41
+ durationKind: "work" | "total";
42
+ startedAt?: number;
43
+ };
44
+ export declare function continuesTurn(session: Session, turn: Turn, next: Turn | undefined): boolean;
45
+ export declare function activeTurnKey(session: Session, turns: Turn[]): string | undefined;
46
+ export declare function turnPresentation(session: Session, turns: Turn[], index: number): {
47
+ continued: boolean;
48
+ items: Item[];
49
+ edits: ToolItem[];
50
+ startedAt: number;
51
+ };
@@ -0,0 +1 @@
1
+ import{Cn,Kt,Gt,h,U,Te,Wt,jt,Qt,Xt}from"../chunk-fvnb8ds4.js";import"../chunk-5grywgpq.js";import"../chunk-k7zzrns3.js";import"../chunk-hx6wfscz.js";import"../chunk-c4621n0b.js";import"../chunk-801v0awm.js";export{Qt as activeTurnKey,jt as continuesTurn,Gt as groupTurns,U as isHistoryInterrupted,Cn as isMcpStartup,Kt as isSessionStatus,Te as isTurnInterrupted,h as messageText,Xt as turnPresentation,Wt as turnTiming};
@@ -0,0 +1,31 @@
1
+ import type * as acp from "@agentclientprotocol/sdk/experimental/v2/unstable";
2
+ import type { ToolItem } from "@alwith/api";
3
+ import type { Store } from "@alwith/api/client";
4
+ import type { CodexClientState } from "@nyssance/codex-acp-v2/client";
5
+ import type { ComponentType } from "react";
6
+ import type { ActivityHost } from "../activity-host";
7
+ import type { ToolUseBlock } from "../lib/group-blocks";
8
+ export interface SessionTimelineHost extends ActivityHost {
9
+ theme: "dark" | "light";
10
+ toolBlock?: (block: ToolUseBlock, item: ToolItem) => ToolUseBlock;
11
+ saveFile?: (name: string, data: string) => Promise<void>;
12
+ openDiff?: (file: {
13
+ path: string;
14
+ patch: string;
15
+ }) => void;
16
+ FileIcon?: ComponentType<{
17
+ path: string;
18
+ className?: string;
19
+ }>;
20
+ reportError?: (error: unknown) => void;
21
+ }
22
+ export interface SessionTimelineClient {
23
+ readonly store: Store<CodexClientState>;
24
+ readonly state: CodexClientState;
25
+ prompt(id: string, prompt: acp.ContentBlock[]): Promise<string>;
26
+ loadHistoryTurn(id: string, turnId: string): Promise<void>;
27
+ previewHistoryTurn(id: string, turnId: string): Promise<void>;
28
+ loadHistoryNavigation(id: string): Promise<void>;
29
+ loadOlderHistory(id: string): Promise<void>;
30
+ retrySession(id: string, turnId: string, trigger: "manual" | "automatic"): Promise<void>;
31
+ }
File without changes
@@ -0,0 +1,12 @@
1
+ export declare function useTimelineScroll(root: HTMLElement | null, running: boolean, releaseTurnAnchor?: () => void): {
2
+ isFollowing: boolean;
3
+ scrollToBottom: () => void;
4
+ stopFollowing: () => void;
5
+ schedulePin: () => void;
6
+ contentResized: (anchorTop?: number | null) => void;
7
+ beginLocate: (followAfter: boolean) => {
8
+ isCurrent: () => boolean;
9
+ finish: (top: number) => void;
10
+ };
11
+ cancelLocation: () => void;
12
+ };
@@ -0,0 +1 @@
1
+ import{At}from"../chunk-8vvn71rf.js";export{At as useTimelineScroll};
@@ -0,0 +1,8 @@
1
+ import { type MessageItem } from "@alwith/api";
2
+ export declare const UserMessage: import("react").MemoExoticComponent<({ item, messageTime }: {
3
+ item: MessageItem;
4
+ messageTime: {
5
+ short: string;
6
+ full: string;
7
+ } | null;
8
+ }) => import("react").JSX.Element | null>;
@@ -0,0 +1 @@
1
+ import{wt}from"../chunk-20zcgxa5.js";import"../chunk-w3yddw6n.js";import"../chunk-q7e2bdav.js";import"../chunk-fgsd4fsd.js";import"../chunk-15nwm04a.js";import"../chunk-fvnb8ds4.js";import"../chunk-5grywgpq.js";import"../chunk-k7zzrns3.js";import"../chunk-hx6wfscz.js";import"../chunk-c4621n0b.js";import"../chunk-vw2hv2sq.js";import"../chunk-801v0awm.js";import"../chunk-azmqtycn.js";export{wt as UserMessage};
package/dist/ui/badge.js CHANGED
@@ -1 +1 @@
1
- import{lt,Ae}from"../chunk-341yykkp.js";export{Ae as Badge,lt as badgeVariants};
1
+ import{mn,Ye}from"../chunk-6qn5srgg.js";export{Ye as Badge,mn as badgeVariants};
package/dist/ui/button.js CHANGED
@@ -1 +1 @@
1
- import{ut,e}from"../chunk-wjejhpgw.js";export{e as Button,ut as buttonVariants};
1
+ import{Tn,e}from"../chunk-801v0awm.js";export{e as Button,Tn as buttonVariants};
package/dist/ui/card.js CHANGED
@@ -1 +1 @@
1
- import{Pe,Ie,Me,Ne,Tt,Se,Ee}from"../chunk-kget6qfz.js";export{Pe as Card,Tt as CardAction,Se as CardContent,Ne as CardDescription,Ee as CardFooter,Ie as CardHeader,Me as CardTitle};
1
+ import{Ue,Ve,qe,Ke,On,Ge,We}from"../chunk-6qa5dt1k.js";export{Ue as Card,On as CardAction,Ge as CardContent,Ke as CardDescription,We as CardFooter,Ve as CardHeader,qe as CardTitle};
@@ -1 +1 @@
1
- import{v}from"../chunk-r5d37dc0.js";export{v as Checkbox};
1
+ import{P}from"../chunk-jrrvpnf3.js";export{P as Checkbox};
package/dist/ui/dialog.js CHANGED
@@ -1 +1 @@
1
- import{M,Rt,dt,Ve,ct,N,Ke,We,S,qe}from"../chunk-yw4e2tcz.js";import"../chunk-wjejhpgw.js";export{M as Dialog,Ve as DialogClose,N as DialogContent,qe as DialogDescription,We as DialogFooter,Ke as DialogHeader,ct as DialogOverlay,dt as DialogPortal,S as DialogTitle,Rt as DialogTrigger};
1
+ import{L,zn,pn,et,gn,A,tt,nt,_,rt}from"../chunk-6p5hgnpq.js";import"../chunk-801v0awm.js";export{L as Dialog,et as DialogClose,A as DialogContent,rt as DialogDescription,nt as DialogFooter,tt as DialogHeader,gn as DialogOverlay,pn as DialogPortal,_ as DialogTitle,zn as DialogTrigger};
@@ -1 +1 @@
1
- import{x,Lt,b,m,y,H,w,E,R,L,re,Ge,je,s,_t}from"../chunk-kaeqvcew.js";export{x as DropdownMenu,re as DropdownMenuCheckboxItem,m as DropdownMenuContent,y as DropdownMenuGroup,w as DropdownMenuItem,H as DropdownMenuLabel,Lt as DropdownMenuPortal,Ge as DropdownMenuRadioGroup,je as DropdownMenuRadioItem,s as DropdownMenuSeparator,_t as DropdownMenuShortcut,E as DropdownMenuSub,L as DropdownMenuSubContent,R as DropdownMenuSubTrigger,b as DropdownMenuTrigger};
1
+ import{k,$n,C,x,T,j,I,H,F,D,ue,ot,it,l,Un}from"../chunk-2epnn4sq.js";export{k as DropdownMenu,ue as DropdownMenuCheckboxItem,x as DropdownMenuContent,T as DropdownMenuGroup,I as DropdownMenuItem,j as DropdownMenuLabel,$n as DropdownMenuPortal,ot as DropdownMenuRadioGroup,it as DropdownMenuRadioItem,l as DropdownMenuSeparator,Un as DropdownMenuShortcut,H as DropdownMenuSub,D as DropdownMenuSubContent,F as DropdownMenuSubTrigger,C as DropdownMenuTrigger};
package/dist/ui/field.js CHANGED
@@ -1 +1 @@
1
- import{j,Q,Fe,De,Pt,He,It,D,Mt,Nt}from"../chunk-36h9z1mt.js";import"../chunk-66headm4.js";import"../chunk-bwzjm3g8.js";export{De as Field,Pt as FieldContent,D as FieldDescription,Nt as FieldError,Fe as FieldGroup,He as FieldLabel,Q as FieldLegend,Mt as FieldSeparator,j as FieldSet,It as FieldTitle};
1
+ import{ne,re,Fe,De,Rn,Be,Ln,G,An,_n}from"../chunk-sky795ex.js";import"../chunk-h38yw8y3.js";import"../chunk-hx6wfscz.js";export{De as Field,Rn as FieldContent,G as FieldDescription,_n as FieldError,Fe as FieldGroup,Be as FieldLabel,re as FieldLegend,An as FieldSeparator,ne as FieldSet,Ln as FieldTitle};
@@ -1 +1 @@
1
- import{Re,Le,_e}from"../chunk-1twg3evk.js";export{Re as HoverCard,_e as HoverCardContent,Le as HoverCardTrigger};
1
+ import{je,Qe,Xe}from"../chunk-dgp9q950.js";export{je as HoverCard,Xe as HoverCardContent,Qe as HoverCardTrigger};
@@ -1 +1 @@
1
- import{te}from"../chunk-cp20nzhv.js";import"../chunk-d0ptk8x8.js";export{te as InputGroupTextarea};
1
+ import{ce}from"../chunk-16y5rmm5.js";import"../chunk-c4621n0b.js";export{ce as InputGroupTextarea};
@@ -1 +1 @@
1
- import{Oe,J,ee,Et}from"../chunk-evcrrxfp.js";import{te}from"../chunk-cp20nzhv.js";import"../chunk-d0ptk8x8.js";import"../chunk-wjejhpgw.js";export{Oe as InputGroup,J as InputGroupAddon,ee as InputGroupButton,Et as InputGroupText,te as InputGroupTextarea};
1
+ import{$e,le,de,Bn}from"../chunk-8e7xf2tb.js";import{ce}from"../chunk-16y5rmm5.js";import"../chunk-c4621n0b.js";import"../chunk-801v0awm.js";export{$e as InputGroup,le as InputGroupAddon,de as InputGroupButton,Bn as InputGroupText,ce as InputGroupTextarea};
package/dist/ui/input.js CHANGED
@@ -1 +1 @@
1
- import{l}from"../chunk-1hy64ewz.js";export{l as Input};
1
+ import{u}from"../chunk-7q7c0mds.js";export{u as Input};
package/dist/ui/label.js CHANGED
@@ -1 +1 @@
1
- import{r}from"../chunk-bwzjm3g8.js";export{r as Label};
1
+ import{o}from"../chunk-hx6wfscz.js";export{o as Label};
@@ -1 +1 @@
1
- import{c,a}from"../chunk-zt7a6b1m.js";export{c as RadioGroup,a as RadioGroupItem};
1
+ import{v,c}from"../chunk-k7zzrns3.js";export{v as RadioGroup,c as RadioGroupItem};
@@ -1 +1 @@
1
- import{P}from"../chunk-66headm4.js";export{P as Separator};
1
+ import{B}from"../chunk-h38yw8y3.js";export{B as Separator};
package/dist/ui/switch.js CHANGED
@@ -1 +1 @@
1
- import{I}from"../chunk-m5pbe513.js";export{I as Switch};
1
+ import{R}from"../chunk-9s1cgt7s.js";export{R as Switch};
@@ -1 +1 @@
1
- import{o}from"../chunk-d0ptk8x8.js";export{o as Textarea};
1
+ import{s}from"../chunk-c4621n0b.js";export{s as Textarea};
@@ -1 +1 @@
1
- import{St,X,Z,Y}from"../chunk-pc1yzf1x.js";export{X as Tooltip,Y as TooltipContent,St as TooltipProvider,Z as TooltipTrigger};
1
+ import{Hn,oe,ie,ae}from"../chunk-cw9tg2sz.js";export{oe as Tooltip,ae as TooltipContent,Hn as TooltipProvider,ie as TooltipTrigger};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alwith/module-chat",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {
@@ -271,13 +271,39 @@
271
271
  "types": "./dist/codex/timeline-virtualizer.d.ts",
272
272
  "import": "./dist/codex/timeline-virtualizer.js",
273
273
  "default": "./dist/codex/timeline-virtualizer.js"
274
+ },
275
+ "./session-timeline": {
276
+ "types": "./dist/session-timeline/session-timeline.d.ts",
277
+ "import": "./dist/session-timeline/session-timeline.js",
278
+ "default": "./dist/session-timeline/session-timeline.js"
279
+ },
280
+ "./turns": {
281
+ "types": "./dist/session-timeline/turns.d.ts",
282
+ "import": "./dist/session-timeline/turns.js",
283
+ "default": "./dist/session-timeline/turns.js"
284
+ },
285
+ "./resource-content": {
286
+ "types": "./dist/session-timeline/resource-content.d.ts",
287
+ "import": "./dist/session-timeline/resource-content.js",
288
+ "default": "./dist/session-timeline/resource-content.js"
289
+ },
290
+ "./timeline-registry": {
291
+ "types": "./dist/session-timeline/timeline-registry.d.ts",
292
+ "import": "./dist/session-timeline/timeline-registry.js",
293
+ "default": "./dist/session-timeline/timeline-registry.js"
274
294
  }
275
295
  },
276
296
  "peerDependencies": {
277
297
  "@agentclientprotocol/sdk": "^2.0.2",
278
- "@alwith/api": "^0.4.22",
298
+ "@alwith/api": "^0.5.1",
279
299
  "react": "^19.3.1",
280
- "react-dom": "^19.3.1"
300
+ "react-dom": "^19.3.1",
301
+ "@nyssance/codex-acp-v2": "^0.7.39"
302
+ },
303
+ "peerDependenciesMeta": {
304
+ "@nyssance/codex-acp-v2": {
305
+ "optional": true
306
+ }
281
307
  },
282
308
  "files": [
283
309
  "dist",
@@ -299,9 +325,11 @@
299
325
  },
300
326
  "devDependencies": {
301
327
  "@agentclientprotocol/sdk": "^2.0.2",
302
- "@alwith/api": "^0.4.21",
328
+ "@alwith/api": "^0.5.1",
303
329
  "@happy-dom/global-registrator": "^21.0.4",
330
+ "@nyssance/codex-acp-v2": "^0.7.39",
304
331
  "@testing-library/dom": "^10.4.2",
332
+ "@testing-library/jest-dom": "^6.6.3",
305
333
  "@testing-library/react": "^16.3.3",
306
334
  "@types/react": "^19.3.0",
307
335
  "@types/react-dom": "^19.3.0",
@@ -1,2 +0,0 @@
1
- import{Ye}from"./chunk-qj8r5xvx.js";import{M,Ve,N,S}from"./chunk-yw4e2tcz.js";import{cn as v}from"cn";import{XIcon as L}from"lucide-react";import{useCallback as p,useEffect as z,useMemo as j,useRef as H,useState as b}from"react";import{jsx as i,jsxs as A}from"react/jsx-runtime";function Ue({open:l,onOpenChange:P,url:h,filename:O,scale:d,onScaleChange:f,containerRef:T,containerClassName:I,dialogContentClassName:R,imageClassName:W}){let g=p((e)=>Math.min(4,Math.max(0.25,e)),[]),[Z,x]=b(1),o=g(d??Z),k=H(null),s=T??k,C=H(null),[m,D]=b({width:0,height:0}),[y,E]=b({width:0,height:0}),w=p((e)=>{let n=g(e);if(typeof f==="function"){f(n);return}x(n)},[f,g]);z(()=>{if(!l)return;if(!h)return;if(typeof d==="number")return;x(1)},[l,h,d]),z(()=>{if(!l)return;let e=s.current;if(!e)return;let n=()=>{D({width:e.clientWidth,height:e.clientHeight})};n();let t=new ResizeObserver(n);return t.observe(e),()=>{t.disconnect()}},[s,l]);let X=p(()=>{w(1)},[w]),r=j(()=>{let{width:e,height:n}=y,{width:t,height:a}=m;if(e===0||n===0)return{width:0,height:0};if(t===0||a===0)return{width:0,height:0};let c=Math.min(t/e,a/n,1),u=e*c,_=n*c;return{width:u*o,height:_*o}},[o,y,m]);if(!h)return null;return i(M,{open:l,onOpenChange:P,children:A(N,{className:v("top-1/2 left-1/2 h-[90vh] max-h-[90vh] w-[90vw]! max-w-[90vw]! -translate-x-1/2 -translate-y-1/2 gap-0 rounded-none bg-transparent p-0 ring-0 sm:w-[90vw]! sm:max-w-[90vw]!",R),showCloseButton:!1,children:[i(S,{className:"sr-only",children:O||"Image preview"}),i(Ve,{"aria-label":"Close",className:"absolute top-3 right-3 z-10 flex size-10 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur-sm transition-colors hover:bg-black/75",children:i(L,{className:"size-5"})}),i("div",{ref:s,onWheel:(e)=>{if(!e.ctrlKey&&!e.metaKey)return;e.preventDefault();let n=e.deltaY>0?o-0.2:o+0.2,t=g(Number.parseFloat(n.toFixed(2)));if(t===o)return;let a=s.current,c=C.current,u=a&&c?Ye({container:a,target:c,clientX:e.clientX,clientY:e.clientY,currentScale:o,nextScale:t}):null;if(w(t),a&&u)requestAnimationFrame(()=>{a.scrollTo(u)})},className:v("h-full w-full scrollbar-thin overflow-auto",I),children:i("div",{className:"grid min-h-full min-w-full place-items-center",style:{width:Math.max(m.width,r.width),height:Math.max(m.height,r.height)},children:i("div",{className:"shrink-0",children:i("img",{alt:O||"image preview",className:v("block object-contain select-none",W),decoding:"async",draggable:!1,ref:C,onDoubleClick:X,onLoad:(e)=>{let n=e.currentTarget;E({width:n.naturalWidth,height:n.naturalHeight});let t=s.current;if(t&&(t.clientWidth||t.clientHeight))D({width:t.clientWidth,height:t.clientHeight})},style:{imageRendering:"auto",width:r.width||void 0,height:r.height||void 0,maxWidth:r.width?"none":"90vw",maxHeight:r.height?"none":"90vh"},src:h})})})})]})})}
2
- export{Ue};
@@ -1 +0,0 @@
1
- import{r}from"./chunk-bwzjm3g8.js";import{P}from"./chunk-66headm4.js";import{cva as p}from"class-variance-authority";import{cn as l}from"cn";import{useMemo as u}from"react";import{jsx as t,jsxs as m}from"react/jsx-runtime";function j({className:a,...e}){return t("fieldset",{"data-slot":"field-set",className:l("flex flex-col gap-6 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",a),...e})}function Q({className:a,variant:e="legend",...o}){return t("legend",{"data-slot":"field-legend","data-variant":e,className:l("mb-3 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base",a),...o})}function Fe({className:a,...e}){return t("div",{"data-slot":"field-group",className:l("group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4",a),...e})}var c=p("group/field data-[invalid=true]:text-destructive flex w-full gap-3",{variants:{orientation:{vertical:"flex-col *:w-full [&>.sr-only]:w-auto",horizontal:"flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",responsive:"flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"}},defaultVariants:{orientation:"vertical"}});function De({className:a,orientation:e="vertical",...o}){return t("div",{role:"group","data-slot":"field","data-orientation":e,className:l(c({orientation:e}),a),...o})}function Pt({className:a,...e}){return t("div",{"data-slot":"field-content",className:l("group/field-content flex flex-1 flex-col gap-1 leading-snug",a),...e})}function He({className:a,...e}){return t(r,{"data-slot":"field-label",className:l("group/field-label peer/field-label has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-muted/50 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10 flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border has-[>[data-slot=field]]:has-[:focus-visible]:ring-3 *:data-[slot=field]:p-3","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col",a),...e})}function It({className:a,...e}){return t("div",{"data-slot":"field-label",className:l("flex w-fit items-center gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50",a),...e})}function D({className:a,...e}){return t("p",{"data-slot":"field-description",className:l("text-muted-foreground text-left text-sm leading-normal font-normal group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5","last:mt-0 nth-last-2:-mt-1","[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",a),...e})}function Mt({children:a,className:e,...o}){return m("div",{"data-slot":"field-separator","data-content":!!a,className:l("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2",e),...o,children:[t(P,{className:"absolute inset-0 top-1/2"}),a&&t("span",{className:"bg-background text-muted-foreground relative mx-auto block w-fit px-2","data-slot":"field-separator-content",children:a})]})}function Nt({className:a,children:e,errors:o,...n}){let s=u(()=>{if(e)return e;if(!o?.length)return null;let i=[...new Map(o.map((d)=>[d?.message,d])).values()];if(i?.length==1)return i[0]?.message;return t("ul",{className:"ml-4 flex list-disc flex-col gap-1",children:i.map((d,f)=>d?.message&&t("li",{children:d.message},f))})},[e,o]);if(!s)return null;return t("div",{role:"alert","data-slot":"field-error",className:l("text-destructive text-sm font-normal",a),...n,children:s})}export{j,Q,Fe,De,Pt,He,It,D,Mt,Nt};
@@ -1,2 +0,0 @@
1
- function ot(t,e){if(t.type||!e.type)return t;let o=e.type.split("/")[1],i=o!==void 0&&o!==""?`pasted-${Date.now()}.${o==="jpeg"?"jpg":o}`:"";return new File([t],t.name||i||`pasted-${Date.now()}`,{type:e.type})}function le(t){let e=[],o=!1;for(let i of t){if(i.kind!=="file")continue;let n=i.getAsFile();if(!n)continue;if(!(n.type||i.type).startsWith("image/")){o=!0;continue}e.push(ot(n,i))}return{imageFiles:e,sawNonImageFile:o}}function de(t){return[...t].some((e)=>e.kind==="string")}function s(t){let e=t.codePointAt(0);return e<32&&e!==9&&e!==10&&e!==13||e===127}function it(t){return[...t].filter((e)=>!s(e)).join("")}function nt(t,e){let o=0;for(let i=0;i<e;i++){let n=t.charCodeAt(i);if(n>=0&&n<=8||n===11||n===12||n>=14&&n<=31||n===127)o++}return o}function _(t){let{value:e,selectionStart:o,selectionEnd:i}=t,n=it(e);if(n===e)return n;if(t.value=n,o!==null&&i!==null){let a=Math.max(0,o-nt(e,o)),r=Math.max(0,i-nt(e,i));requestAnimationFrame(()=>{t.setSelectionRange(a,r)})}return n}
2
- export{ot,le,de,it,nt,_};
@@ -1,2 +0,0 @@
1
- var rt={allow_once:0,allow_always:1,reject_once:2,reject_always:3};function Ce(e){return[...e].toSorted((o,n)=>(rt[o.kind]??99)-(rt[n.kind]??99))}function wt(e){return e==="allow_once"||e==="allow_always"}function kt(e){return e==="allow_always"||e==="reject_always"}
2
- export{rt,Ce,wt,kt};
@@ -1,2 +0,0 @@
1
- import{t}from"./chunk-pqgtv07g.js";import{i}from"./chunk-rgy601b7.js";import{isContentEntry as N,isImage as w,isResourceLink as C}from"@alwith/api";import{ChevronRightIcon as S,ImageIcon as A,LoaderCircleIcon as R,RefreshCwIcon as B}from"lucide-react";import{useEffect as T,useState as x}from"react";import{jsx as r,jsxs as h}from"react/jsx-runtime";function f(e){return e.type==="tool_use"&&e.name==="view_image"&&e.status==="completed"}function E(e){let c=[];for(let[l,u]of e.content.entries()){if(!N(u))continue;let s=u.content;if(w(s))c.push({key:`${e.id}:${l}`,src:`data:${s.mimeType};base64,${s.data}`,alt:e.title??""});if(C(s))c.push({key:`${e.id}:${l}`,path:s.uri,alt:s.name})}if(c.length)return c;let o=e.rawInput;if(o!==null&&typeof o==="object"&&"path"in o&&typeof o.path==="string")return[{key:e.id,path:o.path,alt:o.path.split(/[\\/]/).at(-1)??o.path}];throw Error(`Image view ${e.id} has no image source`)}function U({images:e}){let{loadImage:c,openImageGallery:o,openImage:l,t:u}=t(),[s,y]=x({}),[I,k]=x(0),v=JSON.stringify(e);T(()=>{let a=!0,d=JSON.parse(v);y({});for(let n of d)(n.src!==void 0?Promise.resolve(n.src):n.path!==void 0&&c?c(n.path):Promise.reject(Error("Image loading is unavailable"))).then((m)=>{if(a)y((g)=>({...g,[n.key]:{src:m}}))},()=>{if(a)y((m)=>({...m,[n.key]:{error:!0}}))});return()=>{a=!1}},[v,c,I]);let b=e.flatMap((a)=>{let d=s[a.key];return d&&"src"in d?[{src:d.src,alt:a.alt}]:[]});return r("div",{className:"codex-image-thumbnails",children:e.map((a,d)=>{let n=s[a.key];if(!n)return r("div",{className:"codex-image-thumbnail",role:"status","aria-label":u("stream.codex.imageLoading"),children:r(R,{className:"motion-safe:animate-spin","aria-hidden":"true"})},a.key);if("error"in n)return r("button",{type:"button",className:"codex-image-thumbnail",title:a.alt,"aria-label":u("stream.codex.imageFailed"),onClick:()=>k((p)=>p+1),children:r(B,{"aria-hidden":"true"})},a.key);return r("button",{type:"button",className:"codex-image-thumbnail",title:a.alt,onClick:()=>{let p=e.slice(0,d).filter((m)=>{let g=s[m.key];return g&&"src"in g}).length;if(o)o(b,p);else l?.(n.src)},children:r("img",{src:n.src,alt:a.alt,draggable:!1})},a.key)})})}function ye({blocks:e}){let{t:c}=t(),o=e.flatMap(E),[l,u]=i(`image-view:${e[0].id}`,!1);return h("div",{className:"codex-activity-item",children:[h("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-expanded":l,onClick:()=>u((s)=>!s),children:[h("span",{className:"codex-activity-label",children:[r(A,{className:"codex-activity-icon","aria-hidden":"true"}),r("span",{className:"codex-activity-leading",children:c("stream.codex.viewedImages",{count:o.length})})]}),r(S,{className:l?"codex-image-chevron codex-image-chevron-open":"codex-image-chevron","aria-hidden":"true"})]}),l&&r(U,{images:o})]})}
2
- export{f,ye};
@@ -1,2 +0,0 @@
1
- function ke(t){return Object.entries(t.properties??{}).map(([n,e])=>({key:n,property:e}))}function q(t){let{title:n,description:e}=t;return{title:n??void 0,description:e??void 0}}function h(t){return t.type==="array"}function A(t){return(h(t)?t.items?.oneOf??[]:t.oneOf??[]).map((e)=>{let i=e,r=i.const??i.title??"";return{value:r,label:i.title??r,...i.description?{description:i.description}:{},...i._meta?.alwith?.preview?{preview:i._meta.alwith.preview}:{}}})}
2
- export{ke,q,h,A};