@agimon-ai/po-native-dashboard 0.0.0-alpha.39 → 0.0.0-alpha.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/TimelineItem.d.mts +1 -0
- package/dist/components/TimelineItem.d.mts.map +1 -1
- package/dist/components/TimelineItem.mjs +14 -2
- package/dist/components/TimelineItem.mjs.map +1 -1
- package/dist/screens/SessionScreen.d.mts.map +1 -1
- package/dist/screens/SessionScreen.mjs +2 -1
- package/dist/screens/SessionScreen.mjs.map +1 -1
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimelineItem.d.mts","names":["TimelineEntry"],"sources":["../../src/components/TimelineItem.tsx"],"mappings":";;;;UAiBiBA;EACf;EACA;EACA;;EAEA;;EAEA;IAAW;IAAc;;
|
|
1
|
+
{"version":3,"file":"TimelineItem.d.mts","names":["TimelineEntry"],"sources":["../../src/components/TimelineItem.tsx"],"mappings":";;;;UAiBiBA;EACf;EACA;EACA;;EAEA;;EAEA;IAAW;IAAc;IAAkB;;EAC3C;;EAEA;EACA;EACA;;EAEA,kBAAkB;;EAElB,iBAAiBA;;iBAGF;EACf,OAAOA;;EAEP,cAAc,OAAOA,oBAAkB;;EAEvC,oBAAoB,OAAOA;;EAE3B,WAAW,KAAK;;;wBAmEF,eAAe,OAAO,YAAY,kBAAkB,YAAY,oCAAiB,IAAA"}
|
|
@@ -6,7 +6,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
6
6
|
import { Pressable } from "react-native-unistyles/components/native/Pressable";
|
|
7
7
|
import { Image } from "react-native-unistyles/components/native/Image";
|
|
8
8
|
import { useImageRefs, useRenderTrace } from "@agimon-ai/po-web-dashboard/core";
|
|
9
|
-
import { memo } from "react";
|
|
9
|
+
import { memo, useState } from "react";
|
|
10
10
|
|
|
11
11
|
//#region src/components/TimelineItem.tsx
|
|
12
12
|
function Time({ timestamp }) {
|
|
@@ -62,6 +62,8 @@ const ToolCall = memo(function ToolCall({ entry, renderTool }) {
|
|
|
62
62
|
/** One transcript entry in the cockpit's layout, sized for a phone. */
|
|
63
63
|
function TimelineItem({ entry, renderTool, onMessageActions, markdown }) {
|
|
64
64
|
useRenderTrace("TimelineItem");
|
|
65
|
+
const [failedIcon, setFailedIcon] = useState();
|
|
66
|
+
const icon = entry.author?.icon;
|
|
65
67
|
switch (entry.role) {
|
|
66
68
|
case "tool": return /* @__PURE__ */ jsx(View, {
|
|
67
69
|
style: styles.row,
|
|
@@ -147,7 +149,11 @@ function TimelineItem({ entry, renderTool, onMessageActions, markdown }) {
|
|
|
147
149
|
children: [
|
|
148
150
|
/* @__PURE__ */ jsx(View, {
|
|
149
151
|
style: styles.avatar,
|
|
150
|
-
children: /* @__PURE__ */ jsx(
|
|
152
|
+
children: icon && icon !== failedIcon ? /* @__PURE__ */ jsx(Image, {
|
|
153
|
+
source: { uri: icon },
|
|
154
|
+
style: styles.avatarImage,
|
|
155
|
+
onError: () => setFailedIcon(icon)
|
|
156
|
+
}) : /* @__PURE__ */ jsx(Text, {
|
|
151
157
|
style: styles.initials,
|
|
152
158
|
children: entry.author?.initials ?? "PO"
|
|
153
159
|
})
|
|
@@ -226,6 +232,12 @@ const styles = StyleSheet.create((theme) => {
|
|
|
226
232
|
backgroundColor: theme.colors["tint-green"],
|
|
227
233
|
uni__dependencies: [0]
|
|
228
234
|
},
|
|
235
|
+
avatarImage: {
|
|
236
|
+
width: "100%",
|
|
237
|
+
height: "100%",
|
|
238
|
+
borderRadius: theme.borderRadius.full,
|
|
239
|
+
uni__dependencies: [0]
|
|
240
|
+
},
|
|
229
241
|
initials: {
|
|
230
242
|
...text("xs", theme.colors.green),
|
|
231
243
|
fontWeight: theme.fontWeight.semibold,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimelineItem.mjs","names":["AlertIcon","CheckIcon","CodeBlock","fontOf","Markdown","MarkdownProps","MessageItem","MessageItemBody","MessageItemGroup","MessageItemHeader","StatusTone","useImageRefs","UserImage","useRenderTrace","memo","ReactNode","StyleSheet","TimelineEntry","id","role","text","timestamp","author","name","initials","tone","tools","toolName","payload","images","calls","TimelineItemProps","entry","renderTool","onMessageActions","markdown","Pick","Time","undefined","styles","time","Date","toLocaleTimeString","hour","minute","COLLAPSIBLE_TOOLS","Set","callTone","run","running","isError","groupTone","last","at","Attachments","map","image","index","data","String","ref","entryId","slice","uri","mimeType","attachment","ToolCall","custom","collapsible","has","expanded","TimelineItem","row","names","call","join","length","settled","rule","settledText","error","notice","noticeMark","noticeText","userRow","label","bubble","prose","agent","agentHead","avatar","agentName","create","theme","sans","fontFamily","size","color","fontSize","lineHeight","paddingHorizontal","spacing","paddingVertical","uni__dependencies","alignItems","maxWidth","gap","borderRadius","borderBottomRightRadius","md","backgroundColor","colors","rail","lineHeightRelaxed","lg","width","height","dim","alignSelf","flexDirection","justifyContent","green","fontWeight","semibold","hi","flex","hairlineWidth","border","red"],"sources":["../../src/components/TimelineItem.tsx"],"sourcesContent":["import {\n AlertIcon,\n CheckIcon,\n CodeBlock,\n fontOf,\n Markdown,\n type MarkdownProps,\n MessageItem,\n MessageItemBody,\n MessageItemGroup,\n MessageItemHeader,\n type StatusTone,\n} from '@agimon-ai/po-native-components';\nimport { useImageRefs, type UserImage, useRenderTrace } from '@agimon-ai/po-web-dashboard/core';\nimport { memo, type ReactNode } from 'react';\nimport { Image, Pressable, Text, View } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\nexport interface TimelineEntry {\n id: string;\n role: 'user' | 'assistant' | 'tool' | 'tools' | 'notice' | 'settled';\n text: string;\n /** Epoch milliseconds, when the journal recorded one. */\n timestamp?: number;\n /** The persona that wrote an assistant message. */\n author?: { name: string; initials: string };\n tone?: 'info' | 'error';\n /** Tool calls in the run a `settled` entry closes. */\n tools?: number;\n toolName?: string;\n payload?: unknown;\n /** Images the person attached to their message, such as a clipboard paste. */\n images?: readonly UserImage[];\n /** The consecutive tool calls a `tools` entry groups. */\n calls?: readonly TimelineEntry[];\n}\n\nexport interface TimelineItemProps {\n entry: TimelineEntry;\n /** Renders a tool entry with its plugin renderer; null falls back to the generic card. */\n renderTool?: (entry: TimelineEntry) => ReactNode | null;\n /** Opens the actions for one of the person's own messages; absent leaves them plain text. */\n onMessageActions?: (entry: TimelineEntry) => void;\n /** Loads the images a reply names and opens the files it links. */\n markdown?: Pick<MarkdownProps, 'loadImage' | 'onFileLink'>;\n}\n\nfunction Time({ timestamp }: { timestamp: number | undefined }) {\n if (timestamp === undefined) return null;\n return (\n <Text style={styles.time}>\n {new Date(timestamp).toLocaleTimeString([], { hour: 'numeric', minute: '2-digit' })}\n </Text>\n );\n}\n\nconst COLLAPSIBLE_TOOLS = new Set(['read', 'edit', 'write', 'find', 'ls', 'grep', 'bash']);\n\n/** A call's outcome like the cockpit's: Running, Completed or Failed; neutral before any payload. */\nfunction callTone(entry: TimelineEntry): StatusTone {\n const run = entry.payload as { running?: boolean; isError?: boolean } | undefined;\n return run === undefined ? 'neutral' : run.running ? 'running' : run.isError ? 'error' : 'ok';\n}\n\n/** The group's status follows its final call; earlier failures stay on their own rows. */\nfunction groupTone(calls: readonly TimelineEntry[]): StatusTone {\n const last = calls.at(-1);\n return last === undefined ? 'neutral' : callTone(last);\n}\n\n/** The person's attachments. One the transcript sent by reference appears once its saved entry is read. */\nfunction Attachments({ images }: { images: readonly UserImage[] }) {\n return useImageRefs(images).map((image, index) =>\n image.data === undefined ? null : (\n <Image\n key={`${String(index)}:${image.ref?.entryId ?? image.data.slice(0, 24)}`}\n source={{ uri: `data:${image.mimeType};base64,${image.data}` }}\n style={styles.attachment}\n resizeMode=\"cover\"\n accessibilityLabel={`Attachment ${String(index + 1)}`}\n />\n ),\n );\n}\n\n/** One tool call: its plugin renderer, else the generic card. Inside a group either becomes a row. */\nconst ToolCall = memo(function ToolCall({ entry, renderTool }: Pick<TimelineItemProps, 'entry' | 'renderTool'>) {\n const custom = renderTool?.(entry) ?? null;\n if (custom !== null) return custom;\n const collapsible = COLLAPSIBLE_TOOLS.has(entry.toolName ?? '');\n return (\n <MessageItem\n tone={callTone(entry)}\n expandable={collapsible}\n accessibilityLabel={`Tool ${entry.toolName ?? 'call'}`}\n >\n {({ expanded }) => (\n <>\n <MessageItemHeader title={entry.toolName ?? 'tool'} />\n {entry.text && (!collapsible || expanded) ? (\n <MessageItemBody>\n <CodeBlock text={entry.text} />\n </MessageItemBody>\n ) : null}\n </>\n )}\n </MessageItem>\n );\n});\n\n/** One transcript entry in the cockpit's layout, sized for a phone. */\nexport function TimelineItem({ entry, renderTool, onMessageActions, markdown }: TimelineItemProps) {\n useRenderTrace('TimelineItem');\n switch (entry.role) {\n case 'tool':\n return (\n <View style={styles.row}>\n <ToolCall entry={entry} renderTool={renderTool} />\n </View>\n );\n case 'tools': {\n const calls = entry.calls ?? [];\n const names = [...new Set(calls.map((call) => call.toolName ?? 'tool'))].join(', ');\n return (\n <View style={styles.row}>\n <MessageItemGroup tone={groupTone(calls)} title={`${String(calls.length)} tool calls`} summary={names}>\n {calls.map((call) => (\n <ToolCall key={call.id} entry={call} renderTool={renderTool} />\n ))}\n </MessageItemGroup>\n </View>\n );\n }\n case 'settled':\n return (\n <View style={[styles.row, styles.settled]} accessibilityRole=\"text\">\n <View style={styles.rule} />\n <Text style={styles.settledText}>\n Agent settled\n {entry.tools ? ` · ${String(entry.tools)} tool${entry.tools === 1 ? '' : 's'}` : ''}\n </Text>\n <View style={styles.rule} />\n </View>\n );\n case 'notice': {\n const error = entry.tone === 'error';\n return (\n <View style={[styles.row, styles.notice]} accessibilityRole={error ? 'alert' : 'text'}>\n <View style={styles.noticeMark(error)}>\n {error ? <AlertIcon size={14} color=\"red\" /> : <CheckIcon size={12} color=\"on-selected\" />}\n </View>\n <Text style={styles.noticeText(error)}>{entry.text}</Text>\n </View>\n );\n }\n case 'user':\n return (\n <Pressable\n style={[styles.row, styles.userRow]}\n accessibilityLabel=\"You said\"\n onLongPress={onMessageActions ? () => onMessageActions(entry) : undefined}\n accessibilityActions={onMessageActions ? [{ name: 'longpress', label: 'Message actions' }] : undefined}\n onAccessibilityAction={() => onMessageActions?.(entry)}\n >\n <View style={styles.bubble}>\n {entry.images?.length ? <Attachments images={entry.images} /> : null}\n <Text style={styles.prose}>{entry.text}</Text>\n <Time timestamp={entry.timestamp} />\n </View>\n </Pressable>\n );\n case 'assistant':\n return (\n <View style={[styles.row, styles.agent]} accessibilityLabel={`${entry.author?.name ?? 'Po'} said`}>\n <View style={styles.agentHead}>\n <View style={styles.avatar}>\n <Text style={styles.initials}>{entry.author?.initials ?? 'PO'}</Text>\n </View>\n <Text style={styles.agentName} numberOfLines={1}>\n {entry.author?.name ?? 'Po'}\n </Text>\n <Time timestamp={entry.timestamp} />\n </View>\n <Markdown text={entry.text} {...markdown} />\n </View>\n );\n }\n}\n\nconst styles = StyleSheet.create((theme) => {\n const sans = fontOf(theme.fontFamily.sans);\n const text = (size: 'xs' | 'sm' | 'lg', color: string) => ({\n fontFamily: sans,\n fontSize: theme.fontSize[size],\n lineHeight: theme.lineHeight[size],\n color,\n });\n return {\n row: { paddingHorizontal: theme.spacing(4), paddingVertical: theme.spacing(2.5) },\n userRow: { alignItems: 'flex-end' },\n bubble: {\n maxWidth: '82%',\n gap: theme.spacing(1),\n paddingHorizontal: theme.spacing(4),\n paddingVertical: theme.spacing(2.5),\n borderRadius: 18,\n borderBottomRightRadius: theme.borderRadius.md,\n backgroundColor: theme.colors.rail,\n },\n prose: { ...text('lg', theme.colors.text), lineHeight: theme.lineHeightRelaxed.lg },\n attachment: { width: 200, height: 200, borderRadius: theme.borderRadius.md },\n time: { ...text('xs', theme.colors.dim), alignSelf: 'flex-end' },\n agent: { gap: theme.spacing(2) },\n agentHead: { flexDirection: 'row', alignItems: 'center', gap: theme.spacing(2) },\n avatar: {\n width: 26,\n height: 26,\n borderRadius: 13,\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: theme.colors['tint-green'],\n },\n initials: { ...text('xs', theme.colors.green), fontWeight: theme.fontWeight.semibold },\n agentName: { ...text('sm', theme.colors.hi), fontWeight: theme.fontWeight.semibold, flex: 1 },\n settled: { flexDirection: 'row', alignItems: 'center', gap: theme.spacing(3) },\n rule: { flex: 1, height: StyleSheet.hairlineWidth, backgroundColor: theme.colors.border },\n settledText: text('sm', theme.colors.dim),\n notice: { flexDirection: 'row', alignItems: 'center', gap: theme.spacing(2.5) },\n noticeMark: (error: boolean) => ({\n width: 20,\n height: 20,\n borderRadius: 10,\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: error ? theme.colors['tint-red'] : theme.colors.green,\n }),\n noticeText: (error: boolean) => ({ ...text('sm', error ? theme.colors.red : theme.colors.dim), flex: 1 }),\n };\n});\n"],"mappings":";;;;;;;;;;;AA8CA,SAASqC,KAAK,EAAEhB,aAAgD;CAC9D,IAAIA,cAAciB,QAAW,OAAO;CACpC,OACE,oBAAC,MAAD;EAAM,OAAOC,OAAOC;YACjB,IAAIC,KAAKpB,SAAS,CAAC,CAACqB,mBAAmB,CAAA,GAAI;GAAEC,MAAM;GAAWC,QAAQ;EAAU,CAAC;CAC9E;AAEV;AAEA,MAAMC,oCAAoB,IAAIC,IAAI;CAAC;CAAQ;CAAQ;CAAS;CAAQ;CAAM;CAAQ;AAAM,CAAC;;AAGzF,SAASC,SAASf,OAAkC;CAClD,MAAMgB,MAAMhB,MAAMJ;CAClB,OAAOoB,QAAQV,SAAY,YAAYU,IAAIC,UAAU,YAAYD,IAAIE,UAAU,UAAU;AAC3F;;AAGA,SAASC,UAAUrB,OAA6C;CAC9D,MAAMsB,OAAOtB,MAAMuB,GAAG,EAAE;CACxB,OAAOD,SAASd,SAAY,YAAYS,SAASK,IAAI;AACvD;;AAGA,SAASE,YAAY,EAAEzB,UAA4C;CACjE,OAAOlB,aAAakB,MAAM,CAAC,CAAC0B,KAAKC,OAAOC,UACtCD,MAAME,SAASpB,SAAY,OACzB,oBAAC,OAAD;EAEE,QAAQ,EAAEyB,K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AMQ,QAAQ,CAAC;GAACE,mBAAA,CAAA,CAAA;EAAC;EAC7EzB,MAAM;GAAE+C,MAAM;GAAGT,QAAQpG,WAAW8G;GAAehB,iBAAiBjB,MAAMkB,OAAOgB;GAAMxB,mBAAA,CAAA,CAAA;EAAC;EACxFxB,aAAa3D,KAAK,MAAMyE,MAAMkB,OAAOM,GAAG;EACxCpC,QAAQ;GAAEsC,eAAe;GAAOf,YAAY;GAAUE,KAAKb,MAAMQ,QAAQ,GAAG;GAACE,mBAAA,CAAA,CAAA;EAAC;EAC9ErB,aAAaF,WAAoB;GAC/BmC,OAAO;GACPC,QAAQ;GACRT,cAAc;GACdH,YAAY;GACZgB,gBAAgB;GAChBV,iBAAiB9B,QAAQa,MAAMkB,OAAO,cAAclB,MAAMkB,OAAOU;GAAKlB,mBAAA,CAAA,CAAA;EACxE;EACApB,aAAaH,WAAoB;GAAE,GAAG5D,KAAK,MAAM4D,QAAQa,MAAMkB,OAAOiB,MAAMnC,MAAMkB,OAAOM,GAAG;GAAGQ,MAAM;GAACtB,mBAAA,CAAA,CAAA;EAAC;CACzG;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"TimelineItem.mjs","names":["AlertIcon","CheckIcon","CodeBlock","fontOf","Markdown","MarkdownProps","MessageItem","MessageItemBody","MessageItemGroup","MessageItemHeader","StatusTone","useImageRefs","UserImage","useRenderTrace","memo","ReactNode","useState","StyleSheet","TimelineEntry","id","role","text","timestamp","author","name","initials","icon","tone","tools","toolName","payload","images","calls","TimelineItemProps","entry","renderTool","onMessageActions","markdown","Pick","Time","undefined","styles","time","Date","toLocaleTimeString","hour","minute","COLLAPSIBLE_TOOLS","Set","callTone","run","running","isError","groupTone","last","at","Attachments","map","image","index","data","String","ref","entryId","slice","uri","mimeType","attachment","ToolCall","custom","collapsible","has","expanded","TimelineItem","failedIcon","setFailedIcon","row","names","call","join","length","settled","rule","settledText","error","notice","noticeMark","noticeText","userRow","label","bubble","prose","agent","agentHead","avatar","avatarImage","agentName","create","theme","sans","fontFamily","size","color","fontSize","lineHeight","paddingHorizontal","spacing","paddingVertical","uni__dependencies","alignItems","maxWidth","gap","borderRadius","borderBottomRightRadius","md","backgroundColor","colors","rail","lineHeightRelaxed","lg","width","height","dim","alignSelf","flexDirection","justifyContent","full","green","fontWeight","semibold","hi","flex","hairlineWidth","border","red"],"sources":["../../src/components/TimelineItem.tsx"],"sourcesContent":["import {\n AlertIcon,\n CheckIcon,\n CodeBlock,\n fontOf,\n Markdown,\n type MarkdownProps,\n MessageItem,\n MessageItemBody,\n MessageItemGroup,\n MessageItemHeader,\n type StatusTone,\n} from '@agimon-ai/po-native-components';\nimport { useImageRefs, type UserImage, useRenderTrace } from '@agimon-ai/po-web-dashboard/core';\nimport { memo, type ReactNode, useState } from 'react';\nimport { Image, Pressable, Text, View } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\nexport interface TimelineEntry {\n id: string;\n role: 'user' | 'assistant' | 'tool' | 'tools' | 'notice' | 'settled';\n text: string;\n /** Epoch milliseconds, when the journal recorded one. */\n timestamp?: number;\n /** The persona that wrote an assistant message. */\n author?: { name: string; initials: string; icon?: string };\n tone?: 'info' | 'error';\n /** Tool calls in the run a `settled` entry closes. */\n tools?: number;\n toolName?: string;\n payload?: unknown;\n /** Images the person attached to their message, such as a clipboard paste. */\n images?: readonly UserImage[];\n /** The consecutive tool calls a `tools` entry groups. */\n calls?: readonly TimelineEntry[];\n}\n\nexport interface TimelineItemProps {\n entry: TimelineEntry;\n /** Renders a tool entry with its plugin renderer; null falls back to the generic card. */\n renderTool?: (entry: TimelineEntry) => ReactNode | null;\n /** Opens the actions for one of the person's own messages; absent leaves them plain text. */\n onMessageActions?: (entry: TimelineEntry) => void;\n /** Loads the images a reply names and opens the files it links. */\n markdown?: Pick<MarkdownProps, 'loadImage' | 'onFileLink'>;\n}\n\nfunction Time({ timestamp }: { timestamp: number | undefined }) {\n if (timestamp === undefined) return null;\n return (\n <Text style={styles.time}>\n {new Date(timestamp).toLocaleTimeString([], { hour: 'numeric', minute: '2-digit' })}\n </Text>\n );\n}\n\nconst COLLAPSIBLE_TOOLS = new Set(['read', 'edit', 'write', 'find', 'ls', 'grep', 'bash']);\n\n/** A call's outcome like the cockpit's: Running, Completed or Failed; neutral before any payload. */\nfunction callTone(entry: TimelineEntry): StatusTone {\n const run = entry.payload as { running?: boolean; isError?: boolean } | undefined;\n return run === undefined ? 'neutral' : run.running ? 'running' : run.isError ? 'error' : 'ok';\n}\n\n/** The group's status follows its final call; earlier failures stay on their own rows. */\nfunction groupTone(calls: readonly TimelineEntry[]): StatusTone {\n const last = calls.at(-1);\n return last === undefined ? 'neutral' : callTone(last);\n}\n\n/** The person's attachments. One the transcript sent by reference appears once its saved entry is read. */\nfunction Attachments({ images }: { images: readonly UserImage[] }) {\n return useImageRefs(images).map((image, index) =>\n image.data === undefined ? null : (\n <Image\n key={`${String(index)}:${image.ref?.entryId ?? image.data.slice(0, 24)}`}\n source={{ uri: `data:${image.mimeType};base64,${image.data}` }}\n style={styles.attachment}\n resizeMode=\"cover\"\n accessibilityLabel={`Attachment ${String(index + 1)}`}\n />\n ),\n );\n}\n\n/** One tool call: its plugin renderer, else the generic card. Inside a group either becomes a row. */\nconst ToolCall = memo(function ToolCall({ entry, renderTool }: Pick<TimelineItemProps, 'entry' | 'renderTool'>) {\n const custom = renderTool?.(entry) ?? null;\n if (custom !== null) return custom;\n const collapsible = COLLAPSIBLE_TOOLS.has(entry.toolName ?? '');\n return (\n <MessageItem\n tone={callTone(entry)}\n expandable={collapsible}\n accessibilityLabel={`Tool ${entry.toolName ?? 'call'}`}\n >\n {({ expanded }) => (\n <>\n <MessageItemHeader title={entry.toolName ?? 'tool'} />\n {entry.text && (!collapsible || expanded) ? (\n <MessageItemBody>\n <CodeBlock text={entry.text} />\n </MessageItemBody>\n ) : null}\n </>\n )}\n </MessageItem>\n );\n});\n\n/** One transcript entry in the cockpit's layout, sized for a phone. */\nexport function TimelineItem({ entry, renderTool, onMessageActions, markdown }: TimelineItemProps) {\n useRenderTrace('TimelineItem');\n const [failedIcon, setFailedIcon] = useState<string>();\n const icon = entry.author?.icon;\n switch (entry.role) {\n case 'tool':\n return (\n <View style={styles.row}>\n <ToolCall entry={entry} renderTool={renderTool} />\n </View>\n );\n case 'tools': {\n const calls = entry.calls ?? [];\n const names = [...new Set(calls.map((call) => call.toolName ?? 'tool'))].join(', ');\n return (\n <View style={styles.row}>\n <MessageItemGroup tone={groupTone(calls)} title={`${String(calls.length)} tool calls`} summary={names}>\n {calls.map((call) => (\n <ToolCall key={call.id} entry={call} renderTool={renderTool} />\n ))}\n </MessageItemGroup>\n </View>\n );\n }\n case 'settled':\n return (\n <View style={[styles.row, styles.settled]} accessibilityRole=\"text\">\n <View style={styles.rule} />\n <Text style={styles.settledText}>\n Agent settled\n {entry.tools ? ` · ${String(entry.tools)} tool${entry.tools === 1 ? '' : 's'}` : ''}\n </Text>\n <View style={styles.rule} />\n </View>\n );\n case 'notice': {\n const error = entry.tone === 'error';\n return (\n <View style={[styles.row, styles.notice]} accessibilityRole={error ? 'alert' : 'text'}>\n <View style={styles.noticeMark(error)}>\n {error ? <AlertIcon size={14} color=\"red\" /> : <CheckIcon size={12} color=\"on-selected\" />}\n </View>\n <Text style={styles.noticeText(error)}>{entry.text}</Text>\n </View>\n );\n }\n case 'user':\n return (\n <Pressable\n style={[styles.row, styles.userRow]}\n accessibilityLabel=\"You said\"\n onLongPress={onMessageActions ? () => onMessageActions(entry) : undefined}\n accessibilityActions={onMessageActions ? [{ name: 'longpress', label: 'Message actions' }] : undefined}\n onAccessibilityAction={() => onMessageActions?.(entry)}\n >\n <View style={styles.bubble}>\n {entry.images?.length ? <Attachments images={entry.images} /> : null}\n <Text style={styles.prose}>{entry.text}</Text>\n <Time timestamp={entry.timestamp} />\n </View>\n </Pressable>\n );\n case 'assistant':\n return (\n <View style={[styles.row, styles.agent]} accessibilityLabel={`${entry.author?.name ?? 'Po'} said`}>\n <View style={styles.agentHead}>\n <View style={styles.avatar}>\n {icon && icon !== failedIcon ? (\n <Image source={{ uri: icon }} style={styles.avatarImage} onError={() => setFailedIcon(icon)} />\n ) : (\n <Text style={styles.initials}>{entry.author?.initials ?? 'PO'}</Text>\n )}\n </View>\n <Text style={styles.agentName} numberOfLines={1}>\n {entry.author?.name ?? 'Po'}\n </Text>\n <Time timestamp={entry.timestamp} />\n </View>\n <Markdown text={entry.text} {...markdown} />\n </View>\n );\n }\n}\n\nconst styles = StyleSheet.create((theme) => {\n const sans = fontOf(theme.fontFamily.sans);\n const text = (size: 'xs' | 'sm' | 'lg', color: string) => ({\n fontFamily: sans,\n fontSize: theme.fontSize[size],\n lineHeight: theme.lineHeight[size],\n color,\n });\n return {\n row: { paddingHorizontal: theme.spacing(4), paddingVertical: theme.spacing(2.5) },\n userRow: { alignItems: 'flex-end' },\n bubble: {\n maxWidth: '82%',\n gap: theme.spacing(1),\n paddingHorizontal: theme.spacing(4),\n paddingVertical: theme.spacing(2.5),\n borderRadius: 18,\n borderBottomRightRadius: theme.borderRadius.md,\n backgroundColor: theme.colors.rail,\n },\n prose: { ...text('lg', theme.colors.text), lineHeight: theme.lineHeightRelaxed.lg },\n attachment: { width: 200, height: 200, borderRadius: theme.borderRadius.md },\n time: { ...text('xs', theme.colors.dim), alignSelf: 'flex-end' },\n agent: { gap: theme.spacing(2) },\n agentHead: { flexDirection: 'row', alignItems: 'center', gap: theme.spacing(2) },\n avatar: {\n width: 26,\n height: 26,\n borderRadius: 13,\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: theme.colors['tint-green'],\n },\n avatarImage: { width: '100%', height: '100%', borderRadius: theme.borderRadius.full },\n initials: { ...text('xs', theme.colors.green), fontWeight: theme.fontWeight.semibold },\n agentName: { ...text('sm', theme.colors.hi), fontWeight: theme.fontWeight.semibold, flex: 1 },\n settled: { flexDirection: 'row', alignItems: 'center', gap: theme.spacing(3) },\n rule: { flex: 1, height: StyleSheet.hairlineWidth, backgroundColor: theme.colors.border },\n settledText: text('sm', theme.colors.dim),\n notice: { flexDirection: 'row', alignItems: 'center', gap: theme.spacing(2.5) },\n noticeMark: (error: boolean) => ({\n width: 20,\n height: 20,\n borderRadius: 10,\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: error ? theme.colors['tint-red'] : theme.colors.green,\n }),\n noticeText: (error: boolean) => ({ ...text('sm', error ? theme.colors.red : theme.colors.dim), flex: 1 }),\n };\n});\n"],"mappings":";;;;;;;;;;;AA8CA,SAASuC,KAAK,EAAEjB,aAAgD;CAC9D,IAAIA,cAAckB,QAAW,OAAO;CACpC,OACE,oBAAC,MAAD;EAAM,OAAOC,OAAOC;YACjB,IAAIC,KAAKrB,SAAS,CAAC,CAACsB,mBAAmB,CAAA,GAAI;GAAEC,MAAM;GAAWC,QAAQ;EAAU,CAAC;CAC9E;AAEV;AAEA,MAAMC,oCAAoB,IAAIC,IAAI;CAAC;CAAQ;CAAQ;CAAS;CAAQ;CAAM;CAAQ;AAAM,CAAC;;AAGzF,SAASC,SAASf,OAAkC;CAClD,MAAMgB,MAAMhB,MAAMJ;CAClB,OAAOoB,QAAQV,SAAY,YAAYU,IAAIC,UAAU,YAAYD,IAAIE,UAAU,UAAU;AAC3F;;AAGA,SAASC,UAAUrB,OAA6C;CAC9D,MAAMsB,OAAOtB,MAAMuB,GAAG,EAAE;CACxB,OAAOD,SAASd,SAAY,YAAYS,SAASK,IAAI;AACvD;;AAGA,SAASE,YAAY,EAAEzB,UAA4C;CACjE,OAAOpB,aAAaoB,MAAM,CAAC,CAAC0B,KAAKC,OAAOC,UACtCD,MAAME,SAASpB,SAAY,OACzB,oBAAC,OAAD;EAEE,QAAQ,EAAEyB,KAAK,QAAQP,MAAMQ,SAAQ,UAAWR,MAAME,OAAO;EAC7D,OAAOnB,OAAO0B;EACd,YAAW;EACX,oBAAoB,cAAcN,OAAOF,QAAQ,CAAC;CAAI,GAJjD,GAAGE,OAAOF,KAAK,EAAC,GAAID,MAAMI,KAAKC,WAAWL,MAAME,KAAKI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AAkBA;;wBAUjB,cAAc,OAAO,qCAAkB,IAAA;;wBAqbvC,4BAA4B,OAAOC,kBAAmBD;;;;;;;;wBAmBtD,sBAAsB,kBAAkBA,sBAAoBA;;wBA2G5D,YAAY,OAAOC,gBAAiBD;;
|
|
1
|
+
{"version":3,"file":"SessionScreen.d.mts","names":["TimelineEntry","DashboardEntry"],"sources":["../../src/screens/SessionScreen.tsx"],"mappings":";;;;;;;;;iBA2EiB;EACf;EACA,MAAM;EACN,QAAQ;EACR;EACA;EACA;;;;;;iBAOe,2BAA2B;EAC1C,mBAAmBA;;EAEnB,WAAW,KAAK;;EAEhB,aAAa;;EAEb;;EAEA;EACA,4BAA4B;;EAE5B;;iBAGe;;EAEf,sBAAsB,kBAAkBA,sBAAoBA;;;;;EAK5D,aACE,OAAOA,iBACP,UAAU,OAAOA,oBAAkB;;EAEnC,WAAW,uBACR;;EAEL,aAAa,kBAAkBA;;wBAUjB,cAAc,OAAO,qCAAkB,IAAA;;wBAqbvC,4BAA4B,OAAOC,kBAAmBD;;;;;;;;wBAmBtD,sBAAsB,kBAAkBA,sBAAoBA;;wBA2G5D,YAAY,OAAOC,gBAAiBD;;wBAoEpC,mBACd,WACA,UACA,SACA;EAEA;EACA;EACA,UAAU;EACV,WAAW,KAAK;oBACjB,IAAA"}
|
|
@@ -534,7 +534,8 @@ function nativeEntry(entry) {
|
|
|
534
534
|
const name = entry.identity?.name ?? entry.identity?.profile;
|
|
535
535
|
const author = name === void 0 ? {} : { author: {
|
|
536
536
|
name,
|
|
537
|
-
initials: personaInitials(name)
|
|
537
|
+
initials: personaInitials(name),
|
|
538
|
+
...entry.identity?.icon ? { icon: entry.identity.icon } : {}
|
|
538
539
|
} };
|
|
539
540
|
return [{
|
|
540
541
|
id: entry.id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionScreen.mjs","names":["NativeTemplateSessionProps","ToolMessageRenderProps","ToolResultView","ThreadViewOptions","WebPluginSlotProps","Button","fontOf","List","MarkdownProps","Sheet","SheetContent","SheetHeader","SheetTitle","Tabs","TabsList","TabsTrigger","ImageRefScope","subscribeWebPluginRegistry","personaInitials","sessionStoreFor","subscribeThread","unsubscribeThread","threadStoreKey","holdSessionChannels","HOST_SLOTS","pluginUserMessageActions","renderRegion","slotFills","TimelineEntry","DashboardEntry","toolMessageProps","toolPromptClaim","ToolPromptInput","ToolRendererBoundary","useImageRefs","webTabs","useRenderTrace","useStore","ComponentType","memo","ReactElement","ReactNode","useCallback","useEffect","useMemo","useReducer","useState","AccessibilityInfo","StyleSheet","ActivityPanel","Composer","ComposerProps","DialogSheet","MessageActionsSheet","nativeSlotProps","TimelineItem","CONVERSATION_TAB","EMPTY_ENTRIES","EMPTY_STATUSES","Readonly","Record","MemoTimelineItem","entryKey","entry","id","TOOL_GROUP_LIMIT","ASIDE_SNAP_POINTS","ToolPayload","toolCallId","args","result","output","running","isError","SessionScreenProps","entries","composer","Omit","transcript","SessionTranscript","composerAside","conversationOpen","onConversationOpenChange","open","asideLabel","createGrouper","renderItem","builtIn","slotProps","showsWork","useRegistryVersion","version","bump","value","SessionScreen","props","sessionId","onSend","sessionToolRenderer","ask","onAnswer","onCancel","activity","error","stopped","offline","statuses","activeTab","setActiveTab","drafts","setDrafts","actionTarget","setActionTarget","messageActions","updateDraft","onDraftChange","text","current","tabId","addition","trim","draft","initialText","separator","test","pluginTabs","tabs","label","map","ActivePanel","find","tab","panel","prompt","readOnly","promptInput","fallbackAsk","dialogValue","onDialogValueChange","asking","dialog","name","failed","askingId","undefined","askingTitle","title","announceForAccessibility","emptyRegion","length","emptyStateRegion","aside","composerShown","retainComposer","composerProps","disabled","Boolean","draftStore","onChangeText","promptDock","inset","styles","promptInset","promptError","contextChips","contextItems","item","source","onRemoveContext","asideFooter","about","screen","conversationStrip","pluginId","component","Strip","list","liveTranscript","markdown","offlineText","restoring","onRestore","stoppedTitle","stoppedText","folder","stoppedError","waking","onWake","overlay","Overlay","PluginToolMessage","message","Message","P","TemplateItem","render","LiveActivity","mapEntry","createNativeEntryMapper","working","state","streaming","flatMap","SessionTimeline","live","onMessageActions","raw","groupTools","createToolGrouper","data","registryVersion","renderTool","toolName","tool","payload","details","nested","NonNullable","call","Nested","content","block","type","join","nestedFailed","cache","WeakMap","mapped","get","nativeEntry","set","previous","Map","next","out","run","flush","first","push","old","same","calls","every","index","group","role","create","theme","rt","maxHeight","paddingBottom","insets","ime","bottom","uni__dependencies","paddingHorizontal","spacing","fontFamily","sans","fontSize","sm","lineHeight","color","colors","red","gap","dim","flexDirection","flexWrap","flex","backgroundColor","bg","paddingVertical","margin","padding","borderRadius","lg","borderWidth","borderColor","base","fontWeight","semibold","hi","lineHeightRelaxed","alignItems","paddingLeft","paddingRight","at","timestamp","kind","images","identity","profile","author","initials","tone","tools","argSummary","NativeTranscript","threadId","options","Pick","key","limit","visible","slice"],"sources":["../../src/screens/SessionScreen.tsx"],"sourcesContent":["import type { NativeTemplateSessionProps } from '@agimon-ai/po-core/native';\nimport type {\n ToolMessageRenderProps,\n ToolResultView,\n ThreadViewOptions,\n WebPluginSlotProps,\n} from '@agimon-ai/po-core/web';\nimport {\n Button,\n fontOf,\n List,\n type MarkdownProps,\n Sheet,\n SheetContent,\n SheetHeader,\n SheetTitle,\n Tabs,\n TabsList,\n TabsTrigger,\n} from '@agimon-ai/po-native-components';\nimport {\n ImageRefScope,\n subscribeWebPluginRegistry,\n personaInitials,\n sessionStoreFor,\n subscribeThread,\n unsubscribeThread,\n threadStoreKey,\n holdSessionChannels,\n HOST_SLOTS,\n pluginUserMessageActions,\n renderRegion,\n slotFills,\n type TimelineEntry as DashboardEntry,\n toolMessageProps,\n toolPromptClaim,\n type ToolPromptInput,\n ToolRendererBoundary,\n useImageRefs,\n webTabs,\n useRenderTrace,\n} from '@agimon-ai/po-web-dashboard/core';\nimport { useStore } from '@tanstack/react-store';\nimport {\n type ComponentType,\n memo,\n type ReactElement,\n type ReactNode,\n useCallback,\n useEffect,\n useMemo,\n useReducer,\n useState,\n} from 'react';\nimport { AccessibilityInfo, Text, View } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport { ActivityPanel } from '../components/ActivityPanel';\nimport { Composer, type ComposerProps } from '../components/Composer';\nimport { DialogSheet } from '../components/DialogSheet';\nimport { MessageActionsSheet } from '../components/MessageActionsSheet';\nimport { nativeSlotProps } from '../components/slotProps';\nimport { type TimelineEntry, TimelineItem } from '../components/TimelineItem';\n\nconst CONVERSATION_TAB = 'conversation';\nconst EMPTY_ENTRIES: readonly TimelineEntry[] = [];\nconst EMPTY_STATUSES: Readonly<Record<string, string>> = {};\nconst MemoTimelineItem = memo(TimelineItem);\nconst entryKey = (entry: TimelineEntry) => entry.id;\n/** The most tool calls one transcript cell holds; a longer run splits into several groups. */\nconst TOOL_GROUP_LIMIT = 20;\n/** The conversation sheet's one detent, leaving the panel above it in view. */\nconst ASIDE_SNAP_POINTS = ['58%'];\n\n/** The tool entry fields a plugin renderer reads, carried as TimelineEntry.payload. */\nexport interface ToolPayload {\n toolCallId: string;\n args: Record<string, unknown>;\n result: ToolResultView | null;\n output: string;\n running: boolean;\n isError: boolean;\n}\n\n/**\n * The app's session contract plus the presentation hooks a template may add. Every addition is\n * optional, so a template screen typed with these props still accepts what the app hands it.\n */\nexport interface SessionScreenProps extends NativeTemplateSessionProps {\n entries?: readonly TimelineEntry[];\n /** Options and run controls for the composer row. */\n composer?: Omit<ComposerProps, 'onSend' | 'disabled' | 'value' | 'onChangeText'>;\n /** Lets a template regroup and redraw transcript rows; absent keeps the built-in tool groups and rows. */\n transcript?: SessionTranscript;\n /** With a retained-composer panel, the prompt lives in a conversation sheet over the panel instead of below it. */\n composerAside?: boolean;\n /** Whether that conversation sheet is open; the app owns it so the panel can open it too. */\n conversationOpen?: boolean;\n onConversationOpenChange?: (open: boolean) => void;\n /** What the panel shows, named in the sheet's About line; absent leaves the line out. */\n asideLabel?: string;\n}\n\nexport interface SessionTranscript {\n /** Called once per transcript, so the grouper can keep unchanged groups by identity between renders. */\n createGrouper: () => (entries: readonly TimelineEntry[]) => TimelineEntry[];\n /**\n * `entry` arrives with images the transcript sent by reference filled in once read.\n * `builtIn` draws one entry the default way, with plugin tool cards, for rows the template keeps.\n */\n renderItem: (\n entry: TimelineEntry,\n builtIn: (entry: TimelineEntry) => ReactElement,\n /** The session's slot props, for a row that opens plugin surfaces such as Author. */\n slotProps: WebPluginSlotProps,\n ) => ReactElement | null;\n /** True when a row already shows the turn at work, so the screen leaves out its own Working line. */\n showsWork?: (entries: readonly TimelineEntry[]) => boolean;\n}\n\n/** Re-renders when plugin installs change what the registry resolves. */\nfunction useRegistryVersion(): number {\n const [version, bump] = useReducer((value: number) => value + 1, 0);\n useEffect(() => subscribeWebPluginRegistry(bump), []);\n return version;\n}\n\nexport function SessionScreen(props: SessionScreenProps) {\n useRenderTrace('SessionScreen');\n const {\n sessionId,\n entries = EMPTY_ENTRIES,\n onSend,\n sessionToolRenderer,\n ask,\n onAnswer,\n onCancel,\n activity,\n error,\n composer,\n stopped,\n offline,\n } = props;\n const statuses = props.statuses ?? EMPTY_STATUSES;\n const [activeTab, setActiveTab] = useState(CONVERSATION_TAB);\n const [drafts, setDrafts] = useState<Record<string, string>>({});\n const [actionTarget, setActionTarget] = useState<TimelineEntry>();\n const messageActions = pluginUserMessageActions();\n const updateDraft =\n props.onDraftChange ?? ((text: string) => setDrafts((current) => ({ ...current, [sessionId]: text })));\n useRegistryVersion();\n const slotProps =\n props.slotProps ??\n nativeSlotProps(\n sessionId,\n statuses,\n (tabId) => setActiveTab(tabId ?? CONVERSATION_TAB),\n (text) => {\n const addition = text.trim();\n if (!addition) return;\n setDrafts((current) => {\n const draft = current[sessionId] ?? composer?.initialText ?? '';\n const separator = draft === '' || /\\s$/.test(draft) ? '' : ' ';\n return { ...current, [sessionId]: `${draft}${separator}${addition}` };\n });\n },\n );\n const pluginTabs = webTabs(sessionId);\n const tabs = [{ id: CONVERSATION_TAB, label: 'Conversation' }, ...pluginTabs.map(({ id, label }) => ({ id, label }))];\n const ActivePanel = pluginTabs.find((tab) => tab.id === activeTab)?.panel;\n const prompt =\n !props.readOnly && props.promptInput && onAnswer && onCancel\n ? // The app builds it from the dashboard's own session state, so the contract's wide shape narrows back.\n toolPromptClaim(props.promptInput as ToolPromptInput, null, sessionId)\n : null;\n const fallbackAsk =\n !props.readOnly && ask && onAnswer ? (\n <DialogSheet\n ask={ask}\n onAnswer={onAnswer}\n onCancel={onCancel}\n value={props.dialogValue}\n onChangeValue={props.onDialogValueChange}\n />\n ) : null;\n const asking =\n prompt && onAnswer && onCancel ? (\n <ToolRendererBoundary key={`${sessionId}:${prompt.dialog.id}`} toolName={prompt.entry?.name ?? 'dialog'}>\n {(failed) =>\n failed ? (\n fallbackAsk\n ) : prompt.entry ? (\n <prompt.prompt.component\n {...toolMessageProps(slotProps, prompt.entry, statuses)}\n dialog={prompt.dialog}\n answer={(value) => onAnswer(prompt.dialog.id, value)}\n cancel={() => onCancel(prompt.dialog.id)}\n />\n ) : (\n <prompt.prompt.component\n {...slotProps}\n dialog={prompt.dialog}\n answer={(value) => onAnswer(prompt.dialog.id, value)}\n cancel={() => onCancel(prompt.dialog.id)}\n />\n )\n }\n </ToolRendererBoundary>\n ) : (\n fallbackAsk\n );\n const askingId = asking === null ? undefined : (prompt?.dialog.id ?? ask?.id);\n const askingTitle = prompt?.dialog.title ?? ask?.title;\n // Screen readers hear a question once when it arrives, not on every re-render.\n useEffect(() => {\n if (askingId !== undefined)\n AccessibilityInfo.announceForAccessibility(`Po is asking: ${askingTitle ?? 'a question'}`);\n }, [askingId, askingTitle]);\n // An empty conversation a person's own package may fill on the phone; with no fill the list shows as before.\n const emptyRegion =\n entries.length === 0 ? renderRegion(HOST_SLOTS.emptyStateRegion, null, slotProps, sessionId) : null;\n const aside = props.composerAside === true && props.panel !== undefined;\n const conversationOpen = aside && props.conversationOpen === true;\n const composerShown =\n !aside && !props.readOnly && !stopped && !prompt && (props.panel === undefined || props.retainComposer === true);\n const composerProps: ComposerProps = {\n ...composer,\n onSend,\n disabled: Boolean(ask),\n value: props.draftStore ? undefined : (props.draft ?? drafts[sessionId] ?? composer?.initialText ?? ''),\n onChangeText: props.draftStore ? undefined : updateDraft,\n draftStore: props.draftStore,\n sessionId,\n slotProps,\n };\n const promptDock = (inset: boolean) => (\n // ponytail: a fixed share of the screen keeps the transcript visible; the prompt scrolls inside it.\n <View style={[styles.promptDock, inset && styles.promptInset]}>\n {props.promptError ? (\n <Text style={styles.promptError} accessibilityRole=\"alert\">\n {props.promptError}\n </Text>\n ) : null}\n {asking}\n </View>\n );\n const contextChips = props.contextItems?.length ? (\n <View style={styles.contextItems}>\n {props.contextItems.map((item) => (\n <Button\n key={`${item.source}:${item.id}`}\n variant=\"ghost\"\n size=\"sm\"\n accessibilityLabel={`Remove ${item.label}`}\n onPress={() => props.onRemoveContext?.(item.source, item.id)}\n >\n {item.label} ×\n </Button>\n ))}\n </View>\n ) : null;\n // The footer stays given so the sheet keeps its footer slot; its content mounts only while open, so the\n // composer's autoFocus lands after present() has dismissed the keyboard of the field behind.\n const asideFooter = aside ? (\n <View style={styles.asideFooter}>\n {conversationOpen ? (\n <>\n {contextChips}\n {props.asideLabel ? (\n <Text style={styles.about} numberOfLines={1}>\n About {props.asideLabel}\n </Text>\n ) : null}\n {asking ? (\n promptDock(false)\n ) : !props.readOnly && !stopped ? (\n <Composer {...composerProps} quiet autoFocus />\n ) : null}\n </>\n ) : null}\n </View>\n ) : undefined;\n return (\n <View style={styles.screen}>\n {!props.slotProps && tabs.length > 1 ? (\n <Tabs value={activeTab} onValueChange={setActiveTab}>\n <TabsList>\n {tabs.map((tab) => (\n <TabsTrigger key={tab.id} value={tab.id}>\n {tab.label}\n </TabsTrigger>\n ))}\n </TabsList>\n </Tabs>\n ) : null}\n {/* A plugin's line about this session, such as the run a workflow step belongs to; each fill pads itself. */}\n {slotFills(HOST_SLOTS.conversationStrip, sessionId).map(({ pluginId, id, component: Strip }) =>\n Strip ? <Strip key={`${pluginId}:${id}`} {...slotProps} /> : null,\n )}\n {props.panel !== undefined ? (\n <View style={styles.list}>{props.panel}</View>\n ) : ActivePanel ? (\n <View style={styles.list}>\n <ActivePanel {...slotProps} />\n </View>\n ) : emptyRegion ? (\n <View style={styles.list}>{emptyRegion}</View>\n ) : (\n <SessionTimeline\n sessionId={sessionId}\n entries={entries}\n live={props.liveTranscript}\n slotProps={slotProps}\n statuses={statuses}\n sessionToolRenderer={sessionToolRenderer}\n onMessageActions={!props.readOnly && messageActions.length ? setActionTarget : undefined}\n markdown={props.markdown}\n transcript={props.transcript}\n />\n )}\n {/* A document panel carries its own progress in the host header; only failures still show here. */}\n {props.panel !== undefined ? (\n <ActivityPanel error={error} />\n ) : props.liveTranscript ? (\n <LiveActivity sessionId={sessionId} error={error} showsWork={props.transcript?.showsWork} />\n ) : (\n <ActivityPanel status={props.transcript?.showsWork?.(entries) ? undefined : activity} error={error} />\n )}\n {offline && !props.readOnly && !stopped ? (\n <View style={styles.offline} accessibilityLiveRegion=\"polite\">\n <Text style={styles.offlineText}>Po on your computer is not connected. Your message is kept.</Text>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n loading={offline.restoring ?? false}\n loadingLabel=\"Restoring the connection\"\n onPress={offline.onRestore}\n >\n Restore\n </Button>\n </View>\n ) : null}\n {/* A question stays in view below the panel while the sheet is closed; the open sheet carries it. */}\n {asking && !conversationOpen ? promptDock(!composerShown) : null}\n {!aside && (props.panel === undefined || props.retainComposer) ? contextChips : null}\n {!props.readOnly && stopped ? (\n <View style={styles.stopped}>\n <Text style={styles.stoppedTitle}>Session stopped</Text>\n <Text style={styles.stoppedText}>\n Review the conversation above, then wake to continue.\n {stopped.folder ? ` History is on disk in ${stopped.folder}.` : ' Your history is saved.'}\n </Text>\n {stopped.error ? (\n <Text style={styles.stoppedError} accessibilityRole=\"alert\">\n {stopped.error}\n </Text>\n ) : null}\n <Button variant=\"primary\" size=\"md\" loading={stopped.waking} loadingLabel=\"Waking\" onPress={stopped.onWake}>\n Wake session\n </Button>\n </View>\n ) : composerShown ? (\n <Composer {...composerProps} />\n ) : null}\n {aside ? (\n // No backdrop: the panel above stays visible and usable while the conversation is open.\n <Sheet open={conversationOpen} onOpenChange={props.onConversationOpenChange}>\n <SheetContent\n snapPoints={ASIDE_SNAP_POINTS}\n backdrop={false}\n keep\n background=\"bg\"\n scrollable={false}\n footer={asideFooter}\n >\n <SheetHeader closeLabel=\"Close the conversation\">\n <SheetTitle>Conversation</SheetTitle>\n </SheetHeader>\n <SessionTimeline\n sessionId={sessionId}\n entries={entries}\n live={props.liveTranscript}\n slotProps={slotProps}\n statuses={statuses}\n sessionToolRenderer={sessionToolRenderer}\n onMessageActions={!props.readOnly && messageActions.length ? setActionTarget : undefined}\n markdown={props.markdown}\n transcript={props.transcript}\n />\n </SheetContent>\n </Sheet>\n ) : null}\n <MessageActionsSheet\n sessionId={sessionId}\n message={props.readOnly ? undefined : actionTarget}\n actions={messageActions}\n onClose={() => setActionTarget(undefined)}\n />\n {!props.readOnly &&\n slotFills(HOST_SLOTS.overlay, sessionId).map(({ pluginId, id, component: Overlay }) =>\n Overlay ? <Overlay key={`${pluginId}:${id}`} {...slotProps} /> : null,\n )}\n </View>\n );\n}\n\n/** A plugin renderer reads result images inline, so one the transcript sent by reference is filled in once read. */\nfunction PluginToolMessage<P extends { result: ToolResultView | null }>({\n message: Message,\n props,\n}: {\n message: ComponentType<P>;\n props: P;\n}) {\n const result = useImageRefs(props.result);\n return <Message {...props} result={result} />;\n}\n/** A template row reads images inline too, so it gets the entry with referenced images filled in. */\nfunction TemplateItem({\n entry,\n render,\n}: {\n entry: TimelineEntry;\n render: (entry: TimelineEntry) => ReactElement | null;\n}) {\n return render(useImageRefs(entry));\n}\nfunction LiveActivity({\n sessionId,\n error,\n showsWork,\n}: {\n sessionId: string;\n error?: string;\n showsWork?: SessionTranscript['showsWork'];\n}) {\n const mapEntry = useMemo(createNativeEntryMapper, []);\n // Entries are mapped only for a template that asks; the default screen reads the flag alone.\n const working = useStore(\n sessionStoreFor(sessionId),\n (state) => state.streaming && !showsWork?.(state.entries.flatMap(mapEntry)),\n );\n return <ActivityPanel status={working ? 'Working...' : undefined} error={error} />;\n}\n\nconst SessionTimeline = memo(function SessionTimeline({\n sessionId,\n entries,\n live,\n slotProps,\n statuses,\n sessionToolRenderer,\n onMessageActions,\n markdown,\n transcript,\n}: {\n sessionId: string;\n entries: readonly TimelineEntry[];\n live?: boolean;\n slotProps: WebPluginSlotProps;\n statuses: Readonly<Record<string, string>>;\n sessionToolRenderer?: SessionScreenProps['sessionToolRenderer'];\n onMessageActions?: (entry: TimelineEntry) => void;\n markdown?: SessionScreenProps['markdown'];\n transcript?: SessionTranscript;\n}) {\n const raw = useStore(sessionStoreFor(sessionId), (state) => (live ? state.entries : undefined));\n const mapEntry = useMemo(createNativeEntryMapper, []);\n const groupTools = useMemo(() => (transcript?.createGrouper ?? createToolGrouper)(), [transcript]);\n const data = useMemo(\n () => groupTools(raw === undefined ? entries : raw.flatMap(mapEntry)),\n [raw, entries, mapEntry, groupTools],\n );\n const registryVersion = useRegistryVersion();\n const renderTool = useCallback(\n (entry: TimelineEntry): ReactNode | null => {\n const toolName = entry.toolName;\n const tool = entry.payload as ToolPayload | undefined;\n if (!toolName || !tool) return null;\n const Message = sessionToolRenderer?.(sessionId, toolName, statuses, tool.result?.details)?.message;\n if (!Message) return null;\n // Another tool's own card for a call made on this one's behalf, as the web's nestedToolCard. Null when no\n // plugin claims the tool; the nested card gets no renderTool, so nesting stops at one level.\n const nested: NonNullable<ToolMessageRenderProps['renderTool']> = (call) => {\n const Nested = sessionToolRenderer?.(sessionId, call.toolName, statuses, call.result?.details)?.message;\n if (!Nested) return null;\n const output = (call.result?.content ?? [])\n .flatMap((item) => {\n const block = item as { type?: unknown; text?: unknown };\n return block.type === 'text' && typeof block.text === 'string' ? [block.text] : [];\n })\n .join('\\n');\n return (\n <ToolRendererBoundary toolName={call.toolName}>\n {(nestedFailed) =>\n nestedFailed ? (\n <Text selectable>{output}</Text>\n ) : (\n <PluginToolMessage\n message={Nested}\n props={{\n ...slotProps,\n toolCallId: `${tool.toolCallId}:${call.toolName}`,\n toolName: call.toolName,\n args: call.args,\n result: call.result,\n output,\n running: false,\n isError: call.isError,\n }}\n />\n )\n }\n </ToolRendererBoundary>\n );\n };\n return (\n <ToolRendererBoundary key={entry.id} toolName={toolName}>\n {(failed) =>\n failed ? (\n <TimelineItem entry={entry} />\n ) : (\n <PluginToolMessage message={Message} props={{ ...slotProps, toolName, ...tool, renderTool: nested }} />\n )\n }\n </ToolRendererBoundary>\n );\n },\n [sessionId, statuses, slotProps, sessionToolRenderer, registryVersion],\n );\n const renderItem = useCallback(\n (entry: TimelineEntry) => {\n const builtIn = (item: TimelineEntry) => (\n <MemoTimelineItem\n entry={item}\n renderTool={renderTool}\n onMessageActions={onMessageActions}\n markdown={markdown}\n />\n );\n return transcript ? (\n <TemplateItem entry={entry} render={(item) => transcript.renderItem(item, builtIn, slotProps)} />\n ) : (\n builtIn(entry)\n );\n },\n [renderTool, onMessageActions, markdown, transcript, slotProps],\n );\n return (\n <ImageRefScope value={sessionId}>\n <List\n style={styles.list}\n startAtBottom\n separators={false}\n data={data}\n keyExtractor={entryKey}\n renderItem={renderItem}\n accessibilityLabel=\"Transcript\"\n />\n </ImageRefScope>\n );\n});\n\n/** Each transcript owns its cache; removed dashboard entries are only weakly referenced. */\nexport function createNativeEntryMapper(): (entry: DashboardEntry) => TimelineEntry[] {\n const cache = new WeakMap<DashboardEntry, TimelineEntry[]>();\n return (entry) => {\n let mapped = cache.get(entry);\n if (mapped === undefined) {\n mapped = nativeEntry(entry);\n cache.set(entry, mapped);\n }\n return mapped;\n };\n}\n\n/**\n * Folds each run of two or more consecutive tool calls into `tools` entries of\n * at most TOOL_GROUP_LIMIT calls, so one list cell never mounts a whole long\n * run. Chunks count from the run's start, so keys stay put as the run grows.\n * A group whose calls are unchanged keeps its object, so the memoised row and\n * the calls in it do not re-render while another entry streams.\n */\nexport function createToolGrouper(): (entries: readonly TimelineEntry[]) => TimelineEntry[] {\n let previous = new Map<string, TimelineEntry>();\n return (entries) => {\n const next = new Map<string, TimelineEntry>();\n const out: TimelineEntry[] = [];\n let run: TimelineEntry[] = [];\n const flush = () => {\n const first = run[0];\n if (first === undefined || run.length < 2) {\n out.push(...run);\n } else {\n const id = `tools:${first.id}`;\n const old = previous.get(id);\n const same = old?.calls?.length === run.length && run.every((call, index) => old.calls?.[index] === call);\n const group: TimelineEntry = same && old !== undefined ? old : { id, role: 'tools', text: '', calls: run };\n next.set(id, group);\n out.push(group);\n }\n run = [];\n };\n for (const entry of entries) {\n if (entry.role === 'tool') {\n run.push(entry);\n if (run.length === TOOL_GROUP_LIMIT) flush();\n } else {\n flush();\n out.push(entry);\n }\n }\n flush();\n previous = next;\n return out;\n };\n}\n\nconst styles = StyleSheet.create((theme, rt) => ({\n promptDock: { maxHeight: '70%' },\n // Clears the home indicator when no composer sits below; the keyboard covers that edge while it is open.\n promptInset: { paddingBottom: rt.insets.ime > 0 ? 0 : rt.insets.bottom },\n promptError: {\n paddingHorizontal: theme.spacing(4),\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeight.sm,\n color: theme.colors.red,\n },\n asideFooter: { gap: theme.spacing(1) },\n about: {\n paddingHorizontal: theme.spacing(4),\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeight.sm,\n color: theme.colors.dim,\n },\n contextItems: { flexDirection: 'row', flexWrap: 'wrap', paddingHorizontal: theme.spacing(3), gap: theme.spacing(2) },\n screen: {\n flex: 1,\n backgroundColor: theme.colors.bg,\n },\n list: {\n flex: 1,\n paddingVertical: theme.spacing(2),\n },\n stopped: {\n gap: theme.spacing(2),\n margin: theme.spacing(3),\n padding: theme.spacing(4),\n borderRadius: theme.borderRadius.lg,\n borderWidth: 1,\n borderColor: theme.colors['border-soft'],\n },\n stoppedTitle: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.base,\n lineHeight: theme.lineHeight.base,\n fontWeight: theme.fontWeight.semibold,\n color: theme.colors.hi,\n },\n stoppedText: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeightRelaxed.sm,\n color: theme.colors.dim,\n },\n stoppedError: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeightRelaxed.sm,\n color: theme.colors.red,\n },\n offline: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: theme.spacing(2),\n paddingLeft: theme.spacing(4),\n paddingRight: theme.spacing(2),\n },\n offlineText: {\n flex: 1,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeight.sm,\n color: theme.colors.dim,\n },\n}));\n\n/** Maps dashboard transcript entries onto the native timeline; tool payload feeds plugin renderers. */\nexport function nativeEntry(entry: DashboardEntry): TimelineEntry[] {\n const at = entry.timestamp === undefined ? {} : { timestamp: entry.timestamp };\n switch (entry.kind) {\n case 'user':\n case 'queued':\n return [\n {\n id: entry.id,\n role: 'user',\n text: entry.text,\n ...(entry.images?.length ? { images: entry.images } : {}),\n ...at,\n },\n ];\n case 'assistant': {\n if (!entry.text) return [];\n const name = entry.identity?.name ?? entry.identity?.profile;\n const author = name === undefined ? {} : { author: { name, initials: personaInitials(name) } };\n return [{ id: entry.id, role: 'assistant', text: entry.text, ...author, ...at }];\n }\n case 'intercom':\n return [\n {\n id: entry.id,\n role: 'assistant',\n text: entry.text,\n author: { name: entry.name, initials: personaInitials(entry.name) },\n ...at,\n },\n ];\n case 'notice':\n return [{ id: entry.id, role: 'notice', text: entry.text, tone: entry.tone, ...at }];\n case 'settled':\n return [{ id: entry.id, role: 'settled', text: '', tools: entry.tools, ...at }];\n case 'tool':\n return [\n {\n id: entry.id,\n role: 'tool',\n toolName: entry.name,\n text: entry.output || entry.argSummary,\n ...at,\n payload: {\n toolCallId: entry.toolCallId,\n args: entry.args,\n argSummary: entry.argSummary,\n result: entry.result,\n output: entry.output,\n running: entry.running,\n isError: entry.isError,\n },\n },\n ];\n default:\n return [];\n }\n}\n\n/** Host-owned native transcript adapters, using the same session/thread folds as the conversation. */\nexport function NativeTranscript({\n sessionId,\n threadId,\n options,\n markdown,\n}: {\n sessionId: string;\n threadId?: string;\n options?: ThreadViewOptions;\n markdown?: Pick<MarkdownProps, 'loadImage' | 'onFileLink'>;\n}) {\n useRenderTrace('NativeTranscript');\n useEffect(() => {\n if (threadId !== undefined) {\n subscribeThread(sessionId, threadId);\n return () => unsubscribeThread(sessionId, threadId);\n }\n // A transcript shown outside focus keeps its session's extension channels.\n return holdSessionChannels(sessionId);\n }, [sessionId, threadId]);\n const key = threadId === undefined ? sessionId : threadStoreKey(sessionId, threadId);\n const raw = useStore(sessionStoreFor(key), (state) => state.entries);\n const mapEntry = useMemo(createNativeEntryMapper, []);\n const entries = useMemo(() => raw.flatMap(mapEntry), [raw, mapEntry]);\n const limit = options?.limit;\n const visible = useMemo(\n () => (limit === undefined ? entries : limit <= 0 ? [] : entries.slice(-limit)),\n [entries, limit],\n );\n const renderItem = useCallback(\n (entry: TimelineEntry) => <MemoTimelineItem entry={entry} markdown={markdown} />,\n [markdown],\n );\n return (\n <ImageRefScope value={key}>\n <List\n data={visible}\n keyExtractor={entryKey}\n renderItem={renderItem}\n separators={false}\n accessibilityLabel=\"Transcript\"\n />\n </ImageRefScope>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAgEA,MAAMwD,mBAAmB;AACzB,MAAMC,gBAA0C,CAAA;AAChD,MAAMC,iBAAmD,CAAC;AAC1D,MAAMG,mBAAmBtB,KAAKgB,YAAY;AAC1C,MAAMO,YAAYC,UAAyBA,MAAMC;;AAEjD,MAAMC,mBAAmB;;AAEzB,MAAMC,oBAAoB,CAAC,KAAK;;AAiDhC,SAASwB,qBAA6B;CACpC,MAAM,CAACC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W2M,QAAQ;EACpD;EAEA,OAAOpR,oBAAoByE,SAAS;CACtC,GAAG,CAACA,WAAW2M,QAAQ,CAAC;CACxB,MAAMG,MAAMH,aAAa3J,SAAYhD,YAAY1E,eAAe0E,WAAW2M,QAAQ;CACnF,MAAM7F,MAAMzK,SAASlB,gBAAgB2R,GAAG,IAAItG,UAAUA,MAAM7H,OAAO;CACnE,MAAM0H,WAAWzJ,QAAQ0J,yBAAyB,CAAA,CAAE;CACpD,MAAM3H,UAAU/B,cAAckK,IAAIJ,QAAQL,QAAQ,GAAG,CAACS,KAAKT,QAAQ,CAAC;CACpE,MAAM0G,QAAQH,SAASG;CACvB,MAAMC,UAAUpQ,cACPmQ,UAAU/J,SAAYrE,UAAUoO,SAAS,IAAI,CAAA,IAAKpO,QAAQsO,MAAM,CAACF,KAAK,GAC7E,CAACpO,SAASoO,KAAK,CACjB;CACA,MAAMzN,aAAa5C,aAChBqB,UAAyB,oBAAC,kBAAD;EAAyBA;EAAiBmH;CAAS,IAC7E,CAACA,QAAQ,CACX;CACA,OACE,oBAAC,eAAD;EAAe,OAAO4H;YACpB,oBAAC,MAAD;GACE,MAAME;GACN,cAAclP;GACFwB;GACZ,YAAY;GACZ,oBAAmB;EAAY;CAEpB;AAEnB"}
|
|
1
|
+
{"version":3,"file":"SessionScreen.mjs","names":["NativeTemplateSessionProps","ToolMessageRenderProps","ToolResultView","ThreadViewOptions","WebPluginSlotProps","Button","fontOf","List","MarkdownProps","Sheet","SheetContent","SheetHeader","SheetTitle","Tabs","TabsList","TabsTrigger","ImageRefScope","subscribeWebPluginRegistry","personaInitials","sessionStoreFor","subscribeThread","unsubscribeThread","threadStoreKey","holdSessionChannels","HOST_SLOTS","pluginUserMessageActions","renderRegion","slotFills","TimelineEntry","DashboardEntry","toolMessageProps","toolPromptClaim","ToolPromptInput","ToolRendererBoundary","useImageRefs","webTabs","useRenderTrace","useStore","ComponentType","memo","ReactElement","ReactNode","useCallback","useEffect","useMemo","useReducer","useState","AccessibilityInfo","StyleSheet","ActivityPanel","Composer","ComposerProps","DialogSheet","MessageActionsSheet","nativeSlotProps","TimelineItem","CONVERSATION_TAB","EMPTY_ENTRIES","EMPTY_STATUSES","Readonly","Record","MemoTimelineItem","entryKey","entry","id","TOOL_GROUP_LIMIT","ASIDE_SNAP_POINTS","ToolPayload","toolCallId","args","result","output","running","isError","SessionScreenProps","entries","composer","Omit","transcript","SessionTranscript","composerAside","conversationOpen","onConversationOpenChange","open","asideLabel","createGrouper","renderItem","builtIn","slotProps","showsWork","useRegistryVersion","version","bump","value","SessionScreen","props","sessionId","onSend","sessionToolRenderer","ask","onAnswer","onCancel","activity","error","stopped","offline","statuses","activeTab","setActiveTab","drafts","setDrafts","actionTarget","setActionTarget","messageActions","updateDraft","onDraftChange","text","current","tabId","addition","trim","draft","initialText","separator","test","pluginTabs","tabs","label","map","ActivePanel","find","tab","panel","prompt","readOnly","promptInput","fallbackAsk","dialogValue","onDialogValueChange","asking","dialog","name","failed","askingId","undefined","askingTitle","title","announceForAccessibility","emptyRegion","length","emptyStateRegion","aside","composerShown","retainComposer","composerProps","disabled","Boolean","draftStore","onChangeText","promptDock","inset","styles","promptInset","promptError","contextChips","contextItems","item","source","onRemoveContext","asideFooter","about","screen","conversationStrip","pluginId","component","Strip","list","liveTranscript","markdown","offlineText","restoring","onRestore","stoppedTitle","stoppedText","folder","stoppedError","waking","onWake","overlay","Overlay","PluginToolMessage","message","Message","P","TemplateItem","render","LiveActivity","mapEntry","createNativeEntryMapper","working","state","streaming","flatMap","SessionTimeline","live","onMessageActions","raw","groupTools","createToolGrouper","data","registryVersion","renderTool","toolName","tool","payload","details","nested","NonNullable","call","Nested","content","block","type","join","nestedFailed","cache","WeakMap","mapped","get","nativeEntry","set","previous","Map","next","out","run","flush","first","push","old","same","calls","every","index","group","role","create","theme","rt","maxHeight","paddingBottom","insets","ime","bottom","uni__dependencies","paddingHorizontal","spacing","fontFamily","sans","fontSize","sm","lineHeight","color","colors","red","gap","dim","flexDirection","flexWrap","flex","backgroundColor","bg","paddingVertical","margin","padding","borderRadius","lg","borderWidth","borderColor","base","fontWeight","semibold","hi","lineHeightRelaxed","alignItems","paddingLeft","paddingRight","at","timestamp","kind","images","identity","profile","author","initials","icon","tone","tools","argSummary","NativeTranscript","threadId","options","Pick","key","limit","visible","slice"],"sources":["../../src/screens/SessionScreen.tsx"],"sourcesContent":["import type { NativeTemplateSessionProps } from '@agimon-ai/po-core/native';\nimport type {\n ToolMessageRenderProps,\n ToolResultView,\n ThreadViewOptions,\n WebPluginSlotProps,\n} from '@agimon-ai/po-core/web';\nimport {\n Button,\n fontOf,\n List,\n type MarkdownProps,\n Sheet,\n SheetContent,\n SheetHeader,\n SheetTitle,\n Tabs,\n TabsList,\n TabsTrigger,\n} from '@agimon-ai/po-native-components';\nimport {\n ImageRefScope,\n subscribeWebPluginRegistry,\n personaInitials,\n sessionStoreFor,\n subscribeThread,\n unsubscribeThread,\n threadStoreKey,\n holdSessionChannels,\n HOST_SLOTS,\n pluginUserMessageActions,\n renderRegion,\n slotFills,\n type TimelineEntry as DashboardEntry,\n toolMessageProps,\n toolPromptClaim,\n type ToolPromptInput,\n ToolRendererBoundary,\n useImageRefs,\n webTabs,\n useRenderTrace,\n} from '@agimon-ai/po-web-dashboard/core';\nimport { useStore } from '@tanstack/react-store';\nimport {\n type ComponentType,\n memo,\n type ReactElement,\n type ReactNode,\n useCallback,\n useEffect,\n useMemo,\n useReducer,\n useState,\n} from 'react';\nimport { AccessibilityInfo, Text, View } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport { ActivityPanel } from '../components/ActivityPanel';\nimport { Composer, type ComposerProps } from '../components/Composer';\nimport { DialogSheet } from '../components/DialogSheet';\nimport { MessageActionsSheet } from '../components/MessageActionsSheet';\nimport { nativeSlotProps } from '../components/slotProps';\nimport { type TimelineEntry, TimelineItem } from '../components/TimelineItem';\n\nconst CONVERSATION_TAB = 'conversation';\nconst EMPTY_ENTRIES: readonly TimelineEntry[] = [];\nconst EMPTY_STATUSES: Readonly<Record<string, string>> = {};\nconst MemoTimelineItem = memo(TimelineItem);\nconst entryKey = (entry: TimelineEntry) => entry.id;\n/** The most tool calls one transcript cell holds; a longer run splits into several groups. */\nconst TOOL_GROUP_LIMIT = 20;\n/** The conversation sheet's one detent, leaving the panel above it in view. */\nconst ASIDE_SNAP_POINTS = ['58%'];\n\n/** The tool entry fields a plugin renderer reads, carried as TimelineEntry.payload. */\nexport interface ToolPayload {\n toolCallId: string;\n args: Record<string, unknown>;\n result: ToolResultView | null;\n output: string;\n running: boolean;\n isError: boolean;\n}\n\n/**\n * The app's session contract plus the presentation hooks a template may add. Every addition is\n * optional, so a template screen typed with these props still accepts what the app hands it.\n */\nexport interface SessionScreenProps extends NativeTemplateSessionProps {\n entries?: readonly TimelineEntry[];\n /** Options and run controls for the composer row. */\n composer?: Omit<ComposerProps, 'onSend' | 'disabled' | 'value' | 'onChangeText'>;\n /** Lets a template regroup and redraw transcript rows; absent keeps the built-in tool groups and rows. */\n transcript?: SessionTranscript;\n /** With a retained-composer panel, the prompt lives in a conversation sheet over the panel instead of below it. */\n composerAside?: boolean;\n /** Whether that conversation sheet is open; the app owns it so the panel can open it too. */\n conversationOpen?: boolean;\n onConversationOpenChange?: (open: boolean) => void;\n /** What the panel shows, named in the sheet's About line; absent leaves the line out. */\n asideLabel?: string;\n}\n\nexport interface SessionTranscript {\n /** Called once per transcript, so the grouper can keep unchanged groups by identity between renders. */\n createGrouper: () => (entries: readonly TimelineEntry[]) => TimelineEntry[];\n /**\n * `entry` arrives with images the transcript sent by reference filled in once read.\n * `builtIn` draws one entry the default way, with plugin tool cards, for rows the template keeps.\n */\n renderItem: (\n entry: TimelineEntry,\n builtIn: (entry: TimelineEntry) => ReactElement,\n /** The session's slot props, for a row that opens plugin surfaces such as Author. */\n slotProps: WebPluginSlotProps,\n ) => ReactElement | null;\n /** True when a row already shows the turn at work, so the screen leaves out its own Working line. */\n showsWork?: (entries: readonly TimelineEntry[]) => boolean;\n}\n\n/** Re-renders when plugin installs change what the registry resolves. */\nfunction useRegistryVersion(): number {\n const [version, bump] = useReducer((value: number) => value + 1, 0);\n useEffect(() => subscribeWebPluginRegistry(bump), []);\n return version;\n}\n\nexport function SessionScreen(props: SessionScreenProps) {\n useRenderTrace('SessionScreen');\n const {\n sessionId,\n entries = EMPTY_ENTRIES,\n onSend,\n sessionToolRenderer,\n ask,\n onAnswer,\n onCancel,\n activity,\n error,\n composer,\n stopped,\n offline,\n } = props;\n const statuses = props.statuses ?? EMPTY_STATUSES;\n const [activeTab, setActiveTab] = useState(CONVERSATION_TAB);\n const [drafts, setDrafts] = useState<Record<string, string>>({});\n const [actionTarget, setActionTarget] = useState<TimelineEntry>();\n const messageActions = pluginUserMessageActions();\n const updateDraft =\n props.onDraftChange ?? ((text: string) => setDrafts((current) => ({ ...current, [sessionId]: text })));\n useRegistryVersion();\n const slotProps =\n props.slotProps ??\n nativeSlotProps(\n sessionId,\n statuses,\n (tabId) => setActiveTab(tabId ?? CONVERSATION_TAB),\n (text) => {\n const addition = text.trim();\n if (!addition) return;\n setDrafts((current) => {\n const draft = current[sessionId] ?? composer?.initialText ?? '';\n const separator = draft === '' || /\\s$/.test(draft) ? '' : ' ';\n return { ...current, [sessionId]: `${draft}${separator}${addition}` };\n });\n },\n );\n const pluginTabs = webTabs(sessionId);\n const tabs = [{ id: CONVERSATION_TAB, label: 'Conversation' }, ...pluginTabs.map(({ id, label }) => ({ id, label }))];\n const ActivePanel = pluginTabs.find((tab) => tab.id === activeTab)?.panel;\n const prompt =\n !props.readOnly && props.promptInput && onAnswer && onCancel\n ? // The app builds it from the dashboard's own session state, so the contract's wide shape narrows back.\n toolPromptClaim(props.promptInput as ToolPromptInput, null, sessionId)\n : null;\n const fallbackAsk =\n !props.readOnly && ask && onAnswer ? (\n <DialogSheet\n ask={ask}\n onAnswer={onAnswer}\n onCancel={onCancel}\n value={props.dialogValue}\n onChangeValue={props.onDialogValueChange}\n />\n ) : null;\n const asking =\n prompt && onAnswer && onCancel ? (\n <ToolRendererBoundary key={`${sessionId}:${prompt.dialog.id}`} toolName={prompt.entry?.name ?? 'dialog'}>\n {(failed) =>\n failed ? (\n fallbackAsk\n ) : prompt.entry ? (\n <prompt.prompt.component\n {...toolMessageProps(slotProps, prompt.entry, statuses)}\n dialog={prompt.dialog}\n answer={(value) => onAnswer(prompt.dialog.id, value)}\n cancel={() => onCancel(prompt.dialog.id)}\n />\n ) : (\n <prompt.prompt.component\n {...slotProps}\n dialog={prompt.dialog}\n answer={(value) => onAnswer(prompt.dialog.id, value)}\n cancel={() => onCancel(prompt.dialog.id)}\n />\n )\n }\n </ToolRendererBoundary>\n ) : (\n fallbackAsk\n );\n const askingId = asking === null ? undefined : (prompt?.dialog.id ?? ask?.id);\n const askingTitle = prompt?.dialog.title ?? ask?.title;\n // Screen readers hear a question once when it arrives, not on every re-render.\n useEffect(() => {\n if (askingId !== undefined)\n AccessibilityInfo.announceForAccessibility(`Po is asking: ${askingTitle ?? 'a question'}`);\n }, [askingId, askingTitle]);\n // An empty conversation a person's own package may fill on the phone; with no fill the list shows as before.\n const emptyRegion =\n entries.length === 0 ? renderRegion(HOST_SLOTS.emptyStateRegion, null, slotProps, sessionId) : null;\n const aside = props.composerAside === true && props.panel !== undefined;\n const conversationOpen = aside && props.conversationOpen === true;\n const composerShown =\n !aside && !props.readOnly && !stopped && !prompt && (props.panel === undefined || props.retainComposer === true);\n const composerProps: ComposerProps = {\n ...composer,\n onSend,\n disabled: Boolean(ask),\n value: props.draftStore ? undefined : (props.draft ?? drafts[sessionId] ?? composer?.initialText ?? ''),\n onChangeText: props.draftStore ? undefined : updateDraft,\n draftStore: props.draftStore,\n sessionId,\n slotProps,\n };\n const promptDock = (inset: boolean) => (\n // ponytail: a fixed share of the screen keeps the transcript visible; the prompt scrolls inside it.\n <View style={[styles.promptDock, inset && styles.promptInset]}>\n {props.promptError ? (\n <Text style={styles.promptError} accessibilityRole=\"alert\">\n {props.promptError}\n </Text>\n ) : null}\n {asking}\n </View>\n );\n const contextChips = props.contextItems?.length ? (\n <View style={styles.contextItems}>\n {props.contextItems.map((item) => (\n <Button\n key={`${item.source}:${item.id}`}\n variant=\"ghost\"\n size=\"sm\"\n accessibilityLabel={`Remove ${item.label}`}\n onPress={() => props.onRemoveContext?.(item.source, item.id)}\n >\n {item.label} ×\n </Button>\n ))}\n </View>\n ) : null;\n // The footer stays given so the sheet keeps its footer slot; its content mounts only while open, so the\n // composer's autoFocus lands after present() has dismissed the keyboard of the field behind.\n const asideFooter = aside ? (\n <View style={styles.asideFooter}>\n {conversationOpen ? (\n <>\n {contextChips}\n {props.asideLabel ? (\n <Text style={styles.about} numberOfLines={1}>\n About {props.asideLabel}\n </Text>\n ) : null}\n {asking ? (\n promptDock(false)\n ) : !props.readOnly && !stopped ? (\n <Composer {...composerProps} quiet autoFocus />\n ) : null}\n </>\n ) : null}\n </View>\n ) : undefined;\n return (\n <View style={styles.screen}>\n {!props.slotProps && tabs.length > 1 ? (\n <Tabs value={activeTab} onValueChange={setActiveTab}>\n <TabsList>\n {tabs.map((tab) => (\n <TabsTrigger key={tab.id} value={tab.id}>\n {tab.label}\n </TabsTrigger>\n ))}\n </TabsList>\n </Tabs>\n ) : null}\n {/* A plugin's line about this session, such as the run a workflow step belongs to; each fill pads itself. */}\n {slotFills(HOST_SLOTS.conversationStrip, sessionId).map(({ pluginId, id, component: Strip }) =>\n Strip ? <Strip key={`${pluginId}:${id}`} {...slotProps} /> : null,\n )}\n {props.panel !== undefined ? (\n <View style={styles.list}>{props.panel}</View>\n ) : ActivePanel ? (\n <View style={styles.list}>\n <ActivePanel {...slotProps} />\n </View>\n ) : emptyRegion ? (\n <View style={styles.list}>{emptyRegion}</View>\n ) : (\n <SessionTimeline\n sessionId={sessionId}\n entries={entries}\n live={props.liveTranscript}\n slotProps={slotProps}\n statuses={statuses}\n sessionToolRenderer={sessionToolRenderer}\n onMessageActions={!props.readOnly && messageActions.length ? setActionTarget : undefined}\n markdown={props.markdown}\n transcript={props.transcript}\n />\n )}\n {/* A document panel carries its own progress in the host header; only failures still show here. */}\n {props.panel !== undefined ? (\n <ActivityPanel error={error} />\n ) : props.liveTranscript ? (\n <LiveActivity sessionId={sessionId} error={error} showsWork={props.transcript?.showsWork} />\n ) : (\n <ActivityPanel status={props.transcript?.showsWork?.(entries) ? undefined : activity} error={error} />\n )}\n {offline && !props.readOnly && !stopped ? (\n <View style={styles.offline} accessibilityLiveRegion=\"polite\">\n <Text style={styles.offlineText}>Po on your computer is not connected. Your message is kept.</Text>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n loading={offline.restoring ?? false}\n loadingLabel=\"Restoring the connection\"\n onPress={offline.onRestore}\n >\n Restore\n </Button>\n </View>\n ) : null}\n {/* A question stays in view below the panel while the sheet is closed; the open sheet carries it. */}\n {asking && !conversationOpen ? promptDock(!composerShown) : null}\n {!aside && (props.panel === undefined || props.retainComposer) ? contextChips : null}\n {!props.readOnly && stopped ? (\n <View style={styles.stopped}>\n <Text style={styles.stoppedTitle}>Session stopped</Text>\n <Text style={styles.stoppedText}>\n Review the conversation above, then wake to continue.\n {stopped.folder ? ` History is on disk in ${stopped.folder}.` : ' Your history is saved.'}\n </Text>\n {stopped.error ? (\n <Text style={styles.stoppedError} accessibilityRole=\"alert\">\n {stopped.error}\n </Text>\n ) : null}\n <Button variant=\"primary\" size=\"md\" loading={stopped.waking} loadingLabel=\"Waking\" onPress={stopped.onWake}>\n Wake session\n </Button>\n </View>\n ) : composerShown ? (\n <Composer {...composerProps} />\n ) : null}\n {aside ? (\n // No backdrop: the panel above stays visible and usable while the conversation is open.\n <Sheet open={conversationOpen} onOpenChange={props.onConversationOpenChange}>\n <SheetContent\n snapPoints={ASIDE_SNAP_POINTS}\n backdrop={false}\n keep\n background=\"bg\"\n scrollable={false}\n footer={asideFooter}\n >\n <SheetHeader closeLabel=\"Close the conversation\">\n <SheetTitle>Conversation</SheetTitle>\n </SheetHeader>\n <SessionTimeline\n sessionId={sessionId}\n entries={entries}\n live={props.liveTranscript}\n slotProps={slotProps}\n statuses={statuses}\n sessionToolRenderer={sessionToolRenderer}\n onMessageActions={!props.readOnly && messageActions.length ? setActionTarget : undefined}\n markdown={props.markdown}\n transcript={props.transcript}\n />\n </SheetContent>\n </Sheet>\n ) : null}\n <MessageActionsSheet\n sessionId={sessionId}\n message={props.readOnly ? undefined : actionTarget}\n actions={messageActions}\n onClose={() => setActionTarget(undefined)}\n />\n {!props.readOnly &&\n slotFills(HOST_SLOTS.overlay, sessionId).map(({ pluginId, id, component: Overlay }) =>\n Overlay ? <Overlay key={`${pluginId}:${id}`} {...slotProps} /> : null,\n )}\n </View>\n );\n}\n\n/** A plugin renderer reads result images inline, so one the transcript sent by reference is filled in once read. */\nfunction PluginToolMessage<P extends { result: ToolResultView | null }>({\n message: Message,\n props,\n}: {\n message: ComponentType<P>;\n props: P;\n}) {\n const result = useImageRefs(props.result);\n return <Message {...props} result={result} />;\n}\n/** A template row reads images inline too, so it gets the entry with referenced images filled in. */\nfunction TemplateItem({\n entry,\n render,\n}: {\n entry: TimelineEntry;\n render: (entry: TimelineEntry) => ReactElement | null;\n}) {\n return render(useImageRefs(entry));\n}\nfunction LiveActivity({\n sessionId,\n error,\n showsWork,\n}: {\n sessionId: string;\n error?: string;\n showsWork?: SessionTranscript['showsWork'];\n}) {\n const mapEntry = useMemo(createNativeEntryMapper, []);\n // Entries are mapped only for a template that asks; the default screen reads the flag alone.\n const working = useStore(\n sessionStoreFor(sessionId),\n (state) => state.streaming && !showsWork?.(state.entries.flatMap(mapEntry)),\n );\n return <ActivityPanel status={working ? 'Working...' : undefined} error={error} />;\n}\n\nconst SessionTimeline = memo(function SessionTimeline({\n sessionId,\n entries,\n live,\n slotProps,\n statuses,\n sessionToolRenderer,\n onMessageActions,\n markdown,\n transcript,\n}: {\n sessionId: string;\n entries: readonly TimelineEntry[];\n live?: boolean;\n slotProps: WebPluginSlotProps;\n statuses: Readonly<Record<string, string>>;\n sessionToolRenderer?: SessionScreenProps['sessionToolRenderer'];\n onMessageActions?: (entry: TimelineEntry) => void;\n markdown?: SessionScreenProps['markdown'];\n transcript?: SessionTranscript;\n}) {\n const raw = useStore(sessionStoreFor(sessionId), (state) => (live ? state.entries : undefined));\n const mapEntry = useMemo(createNativeEntryMapper, []);\n const groupTools = useMemo(() => (transcript?.createGrouper ?? createToolGrouper)(), [transcript]);\n const data = useMemo(\n () => groupTools(raw === undefined ? entries : raw.flatMap(mapEntry)),\n [raw, entries, mapEntry, groupTools],\n );\n const registryVersion = useRegistryVersion();\n const renderTool = useCallback(\n (entry: TimelineEntry): ReactNode | null => {\n const toolName = entry.toolName;\n const tool = entry.payload as ToolPayload | undefined;\n if (!toolName || !tool) return null;\n const Message = sessionToolRenderer?.(sessionId, toolName, statuses, tool.result?.details)?.message;\n if (!Message) return null;\n // Another tool's own card for a call made on this one's behalf, as the web's nestedToolCard. Null when no\n // plugin claims the tool; the nested card gets no renderTool, so nesting stops at one level.\n const nested: NonNullable<ToolMessageRenderProps['renderTool']> = (call) => {\n const Nested = sessionToolRenderer?.(sessionId, call.toolName, statuses, call.result?.details)?.message;\n if (!Nested) return null;\n const output = (call.result?.content ?? [])\n .flatMap((item) => {\n const block = item as { type?: unknown; text?: unknown };\n return block.type === 'text' && typeof block.text === 'string' ? [block.text] : [];\n })\n .join('\\n');\n return (\n <ToolRendererBoundary toolName={call.toolName}>\n {(nestedFailed) =>\n nestedFailed ? (\n <Text selectable>{output}</Text>\n ) : (\n <PluginToolMessage\n message={Nested}\n props={{\n ...slotProps,\n toolCallId: `${tool.toolCallId}:${call.toolName}`,\n toolName: call.toolName,\n args: call.args,\n result: call.result,\n output,\n running: false,\n isError: call.isError,\n }}\n />\n )\n }\n </ToolRendererBoundary>\n );\n };\n return (\n <ToolRendererBoundary key={entry.id} toolName={toolName}>\n {(failed) =>\n failed ? (\n <TimelineItem entry={entry} />\n ) : (\n <PluginToolMessage message={Message} props={{ ...slotProps, toolName, ...tool, renderTool: nested }} />\n )\n }\n </ToolRendererBoundary>\n );\n },\n [sessionId, statuses, slotProps, sessionToolRenderer, registryVersion],\n );\n const renderItem = useCallback(\n (entry: TimelineEntry) => {\n const builtIn = (item: TimelineEntry) => (\n <MemoTimelineItem\n entry={item}\n renderTool={renderTool}\n onMessageActions={onMessageActions}\n markdown={markdown}\n />\n );\n return transcript ? (\n <TemplateItem entry={entry} render={(item) => transcript.renderItem(item, builtIn, slotProps)} />\n ) : (\n builtIn(entry)\n );\n },\n [renderTool, onMessageActions, markdown, transcript, slotProps],\n );\n return (\n <ImageRefScope value={sessionId}>\n <List\n style={styles.list}\n startAtBottom\n separators={false}\n data={data}\n keyExtractor={entryKey}\n renderItem={renderItem}\n accessibilityLabel=\"Transcript\"\n />\n </ImageRefScope>\n );\n});\n\n/** Each transcript owns its cache; removed dashboard entries are only weakly referenced. */\nexport function createNativeEntryMapper(): (entry: DashboardEntry) => TimelineEntry[] {\n const cache = new WeakMap<DashboardEntry, TimelineEntry[]>();\n return (entry) => {\n let mapped = cache.get(entry);\n if (mapped === undefined) {\n mapped = nativeEntry(entry);\n cache.set(entry, mapped);\n }\n return mapped;\n };\n}\n\n/**\n * Folds each run of two or more consecutive tool calls into `tools` entries of\n * at most TOOL_GROUP_LIMIT calls, so one list cell never mounts a whole long\n * run. Chunks count from the run's start, so keys stay put as the run grows.\n * A group whose calls are unchanged keeps its object, so the memoised row and\n * the calls in it do not re-render while another entry streams.\n */\nexport function createToolGrouper(): (entries: readonly TimelineEntry[]) => TimelineEntry[] {\n let previous = new Map<string, TimelineEntry>();\n return (entries) => {\n const next = new Map<string, TimelineEntry>();\n const out: TimelineEntry[] = [];\n let run: TimelineEntry[] = [];\n const flush = () => {\n const first = run[0];\n if (first === undefined || run.length < 2) {\n out.push(...run);\n } else {\n const id = `tools:${first.id}`;\n const old = previous.get(id);\n const same = old?.calls?.length === run.length && run.every((call, index) => old.calls?.[index] === call);\n const group: TimelineEntry = same && old !== undefined ? old : { id, role: 'tools', text: '', calls: run };\n next.set(id, group);\n out.push(group);\n }\n run = [];\n };\n for (const entry of entries) {\n if (entry.role === 'tool') {\n run.push(entry);\n if (run.length === TOOL_GROUP_LIMIT) flush();\n } else {\n flush();\n out.push(entry);\n }\n }\n flush();\n previous = next;\n return out;\n };\n}\n\nconst styles = StyleSheet.create((theme, rt) => ({\n promptDock: { maxHeight: '70%' },\n // Clears the home indicator when no composer sits below; the keyboard covers that edge while it is open.\n promptInset: { paddingBottom: rt.insets.ime > 0 ? 0 : rt.insets.bottom },\n promptError: {\n paddingHorizontal: theme.spacing(4),\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeight.sm,\n color: theme.colors.red,\n },\n asideFooter: { gap: theme.spacing(1) },\n about: {\n paddingHorizontal: theme.spacing(4),\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeight.sm,\n color: theme.colors.dim,\n },\n contextItems: { flexDirection: 'row', flexWrap: 'wrap', paddingHorizontal: theme.spacing(3), gap: theme.spacing(2) },\n screen: {\n flex: 1,\n backgroundColor: theme.colors.bg,\n },\n list: {\n flex: 1,\n paddingVertical: theme.spacing(2),\n },\n stopped: {\n gap: theme.spacing(2),\n margin: theme.spacing(3),\n padding: theme.spacing(4),\n borderRadius: theme.borderRadius.lg,\n borderWidth: 1,\n borderColor: theme.colors['border-soft'],\n },\n stoppedTitle: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.base,\n lineHeight: theme.lineHeight.base,\n fontWeight: theme.fontWeight.semibold,\n color: theme.colors.hi,\n },\n stoppedText: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeightRelaxed.sm,\n color: theme.colors.dim,\n },\n stoppedError: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeightRelaxed.sm,\n color: theme.colors.red,\n },\n offline: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: theme.spacing(2),\n paddingLeft: theme.spacing(4),\n paddingRight: theme.spacing(2),\n },\n offlineText: {\n flex: 1,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeight.sm,\n color: theme.colors.dim,\n },\n}));\n\n/** Maps dashboard transcript entries onto the native timeline; tool payload feeds plugin renderers. */\nexport function nativeEntry(entry: DashboardEntry): TimelineEntry[] {\n const at = entry.timestamp === undefined ? {} : { timestamp: entry.timestamp };\n switch (entry.kind) {\n case 'user':\n case 'queued':\n return [\n {\n id: entry.id,\n role: 'user',\n text: entry.text,\n ...(entry.images?.length ? { images: entry.images } : {}),\n ...at,\n },\n ];\n case 'assistant': {\n if (!entry.text) return [];\n const name = entry.identity?.name ?? entry.identity?.profile;\n const author =\n name === undefined\n ? {}\n : {\n author: {\n name,\n initials: personaInitials(name),\n ...(entry.identity?.icon ? { icon: entry.identity.icon } : {}),\n },\n };\n return [{ id: entry.id, role: 'assistant', text: entry.text, ...author, ...at }];\n }\n case 'intercom':\n return [\n {\n id: entry.id,\n role: 'assistant',\n text: entry.text,\n author: { name: entry.name, initials: personaInitials(entry.name) },\n ...at,\n },\n ];\n case 'notice':\n return [{ id: entry.id, role: 'notice', text: entry.text, tone: entry.tone, ...at }];\n case 'settled':\n return [{ id: entry.id, role: 'settled', text: '', tools: entry.tools, ...at }];\n case 'tool':\n return [\n {\n id: entry.id,\n role: 'tool',\n toolName: entry.name,\n text: entry.output || entry.argSummary,\n ...at,\n payload: {\n toolCallId: entry.toolCallId,\n args: entry.args,\n argSummary: entry.argSummary,\n result: entry.result,\n output: entry.output,\n running: entry.running,\n isError: entry.isError,\n },\n },\n ];\n default:\n return [];\n }\n}\n\n/** Host-owned native transcript adapters, using the same session/thread folds as the conversation. */\nexport function NativeTranscript({\n sessionId,\n threadId,\n options,\n markdown,\n}: {\n sessionId: string;\n threadId?: string;\n options?: ThreadViewOptions;\n markdown?: Pick<MarkdownProps, 'loadImage' | 'onFileLink'>;\n}) {\n useRenderTrace('NativeTranscript');\n useEffect(() => {\n if (threadId !== undefined) {\n subscribeThread(sessionId, threadId);\n return () => unsubscribeThread(sessionId, threadId);\n }\n // A transcript shown outside focus keeps its session's extension channels.\n return holdSessionChannels(sessionId);\n }, [sessionId, threadId]);\n const key = threadId === undefined ? sessionId : threadStoreKey(sessionId, threadId);\n const raw = useStore(sessionStoreFor(key), (state) => state.entries);\n const mapEntry = useMemo(createNativeEntryMapper, []);\n const entries = useMemo(() => raw.flatMap(mapEntry), [raw, mapEntry]);\n const limit = options?.limit;\n const visible = useMemo(\n () => (limit === undefined ? entries : limit <= 0 ? [] : entries.slice(-limit)),\n [entries, limit],\n );\n const renderItem = useCallback(\n (entry: TimelineEntry) => <MemoTimelineItem entry={entry} markdown={markdown} />,\n [markdown],\n );\n return (\n <ImageRefScope value={key}>\n <List\n data={visible}\n keyExtractor={entryKey}\n renderItem={renderItem}\n separators={false}\n accessibilityLabel=\"Transcript\"\n />\n </ImageRefScope>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAgEA,MAAMwD,mBAAmB;AACzB,MAAMC,gBAA0C,CAAA;AAChD,MAAMC,iBAAmD,CAAC;AAC1D,MAAMG,mBAAmBtB,KAAKgB,YAAY;AAC1C,MAAMO,YAAYC,UAAyBA,MAAMC;;AAEjD,MAAMC,mBAAmB;;AAEzB,MAAMC,oBAAoB,CAAC,KAAK;;AAiDhC,SAASwB,qBAA6B;CACpC,MAAM,CAACC,SAASC,QAAQ/C,YAAYgD,UAAkBA,QAAQ,GAAG,CAAC;CAClElD,gBAAgB1B,2BAA2B2E,IAAI,GAAG,CAAA,CAAE;CACpD,OAAOD;AACT;AAEA,SAAgBG,cAAcC,OAA2B;CACvD3D,eAAe,eAAe;CAC9B,MAAM,EACJ4D,WACArB,UAAUlB,eACVwC,QACAC,qBACAC,KACAC,UACAC,UACAC,UACAC,OACA3B,UACA4B,SACAC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4R,GAAG,IAAIvG,UAAUA,MAAM7H,OAAO;CACnE,MAAM0H,WAAWzJ,QAAQ0J,yBAAyB,CAAA,CAAE;CACpD,MAAM3H,UAAU/B,cAAckK,IAAIJ,QAAQL,QAAQ,GAAG,CAACS,KAAKT,QAAQ,CAAC;CACpE,MAAM2G,QAAQH,SAASG;CACvB,MAAMC,UAAUrQ,cACPoQ,UAAUhK,SAAYrE,UAAUqO,SAAS,IAAI,CAAA,IAAKrO,QAAQuO,MAAM,CAACF,KAAK,GAC7E,CAACrO,SAASqO,KAAK,CACjB;CACA,MAAM1N,aAAa5C,aAChBqB,UAAyB,oBAAC,kBAAD;EAAyBA;EAAiBmH;CAAS,IAC7E,CAACA,QAAQ,CACX;CACA,OACE,oBAAC,eAAD;EAAe,OAAO6H;YACpB,oBAAC,MAAD;GACE,MAAME;GACN,cAAcnP;GACFwB;GACZ,YAAY;GACZ,oBAAmB;EAAY;CAEpB;AAEnB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agimon-ai/po-native-dashboard",
|
|
3
|
-
"version": "0.0.0-alpha.
|
|
3
|
+
"version": "0.0.0-alpha.40",
|
|
4
4
|
"description": "Shared React Native session views for Po native templates: transcript, composer and session sheets.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -43,14 +43,14 @@
|
|
|
43
43
|
"access": "public"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@agimon-ai/po-core": "0.0.0-alpha.
|
|
47
|
-
"@agimon-ai/po-native-components": "0.0.0-alpha.
|
|
48
|
-
"@agimon-ai/po-web-dashboard": "0.0.0-alpha.
|
|
46
|
+
"@agimon-ai/po-core": "0.0.0-alpha.168",
|
|
47
|
+
"@agimon-ai/po-native-components": "0.0.0-alpha.168",
|
|
48
|
+
"@agimon-ai/po-web-dashboard": "0.0.0-alpha.168"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@agimon-ai/po-build": "0.0.0-alpha.
|
|
52
|
-
"@agimon-ai/po-web-components": "0.0.0-alpha.
|
|
53
|
-
"@agimon-ai/vibe-lint-plugin-po-core": "0.0.0-alpha.
|
|
51
|
+
"@agimon-ai/po-build": "0.0.0-alpha.168",
|
|
52
|
+
"@agimon-ai/po-web-components": "0.0.0-alpha.168",
|
|
53
|
+
"@agimon-ai/vibe-lint-plugin-po-core": "0.0.0-alpha.168",
|
|
54
54
|
"@tanstack/react-store": "0.11.2",
|
|
55
55
|
"@tanstack/store": "0.11.2",
|
|
56
56
|
"@types/node": "26.6.5",
|