@agimon-ai/po-native-dashboard 0.0.0-alpha.68 → 0.0.0-alpha.69

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.
@@ -1 +1 @@
1
- {"version":3,"file":"CompletionSheet.d.mts","names":[],"sources":["../../src/components/CompletionSheet.tsx"],"mappings":";;;iBA4DiB;EACf,mBAAmB;EACnB,cAAc,kBAAkB;;EAEhC,cAAc;IAA6B;IAAc;;;EAEzD,0BAA0B;;;wBAiCZ,mBACd,QAAQ,8BACR,MAAM,uBACN,gBACC;;wBA4Ba,iBACd,OACA;EAEA,gBAAgB;EAChB,SAAS,MAAM;oBAChB,IAAA;iBA2BgB;EACf;EACA,eAAe;EACf,QAAQ;EACR,SAAS,MAAM,gBAAgB,MAAM;;EAErC,cAAc;EACd;;EAEA;;EAEA,YAAY;;EAEZ,mBAAmB;;iBAGJ;EACf;EACA;EACA;EACA;EACA;;;wBAIc,kBACd,MACA,cACA,QACA,QACA,aACA,cACA,aACA,WACA,WACC,uCAAoB,IAAA;;wBA6HP,mBAAmB;EAAa;oBAAqB,IAAA"}
1
+ {"version":3,"file":"CompletionSheet.d.mts","names":[],"sources":["../../src/components/CompletionSheet.tsx"],"mappings":";;;iBA4DiB;EACf,mBAAmB;EACnB,cAAc,kBAAkB;;EAEhC,cAAc;IAA6B;IAAc;;;EAEzD,0BAA0B;;;wBAoCZ,mBACd,QAAQ,8BACR,MAAM,uBACN,gBACC;;wBA4Ba,iBACd,OACA;EAEA,gBAAgB;EAChB,SAAS,MAAM;oBAChB,IAAA;iBA2BgB;EACf;EACA,eAAe;EACf,QAAQ;EACR,SAAS,MAAM,gBAAgB,MAAM;;EAErC,cAAc;EACd;;EAEA;;EAEA,YAAY;;EAEZ,mBAAmB;;iBAGJ;EACf;EACA;EACA;EACA;EACA;;;wBAIc,kBACd,MACA,cACA,QACA,QACA,aACA,cACA,aACA,WACA,WACC,uCAAoB,IAAA;;wBA6HP,mBAAmB;EAAa;oBAAqB,IAAA"}
@@ -47,11 +47,13 @@ function textField(data, key) {
47
47
  * menu row itself; a sheet has room for a page, so here `data.title` (with
48
48
  * optional `hint` and `glyph`) is the row and the component is the page.
49
49
  */
50
- function insertPages(sessionId) {
50
+ function insertPages(sessionId, t) {
51
51
  return slotFills(HOST_SLOTS.composerMenu, sessionId).flatMap(({ pluginId, id, data, component }) => {
52
- const title = textField(data, "title");
52
+ const translateCopy = typeof data === "object" && data !== null ? Reflect.get(data, "translateCopy") : void 0;
53
+ const copy = typeof translateCopy === "function" ? translateCopy(t) : data;
54
+ const title = textField(copy, "title");
53
55
  if (!component || title === void 0) return [];
54
- const hint = textField(data, "hint") ?? "";
56
+ const hint = textField(copy, "hint") ?? "";
55
57
  const glyph = textField(data, "glyph") ?? title.charAt(0);
56
58
  return [{
57
59
  key: `${pluginId}:${id}`,
@@ -132,7 +134,7 @@ function CompletionSheet({ open, onOpenChange, source, onPick, defaultKind, defa
132
134
  const [query, setQuery] = useState(defaultQuery);
133
135
  const items = useCompletionItems(source, kind, query);
134
136
  const page = kinds.find((entry) => entry.kind === kind);
135
- const pages = slotProps ? insertPages(slotProps.sessionId) : [];
137
+ const pages = slotProps ? insertPages(slotProps.sessionId, t) : [];
136
138
  const plugin = pages.find((entry) => entry.key === pageKey);
137
139
  const choose = (next) => {
138
140
  setKind(next);
@@ -1 +1 @@
1
- {"version":3,"file":"CompletionSheet.mjs","names":["useT","WebPluginSlotProps","ChevronRightIcon","fontOf","Input","Sheet","SheetContent","SparklesIcon","Spinner","CommandInfo","CompletionItem","CompletionKind","commandCompletions","fileCompletions","HOST_SLOTS","MentionableSession","sessionCompletions","slotFills","TRIGGER_CHARS","ComponentType","useEffect","useEffectEvent","useState","StyleSheet","Translate","key","fallback","completionKinds","t","kind","title","hint","search","none","FILE_SEARCH_DEBOUNCE_MS","CompletionSource","commands","searchFiles","query","Promise","references","path","detail","sessions","InsertPage","glyph","component","textField","data","undefined","value","Reflect","get","insertPages","sessionId","composerMenu","flatMap","pluginId","id","charAt","useCompletionItems","source","files","setFiles","items","searchable","text","resolve","current","timer","setTimeout","then","found","clearTimeout","length","CompletionRows","onPick","item","styles","list","map","index","insert","label","pressed","divider","flex","itemLabel","meta","CompletionSheetProps","open","onOpenChange","defaultKind","defaultQuery","defaultPage","slotProps","actions","InsertAction","onPress","CompletionSheet","kinds","setKind","pageKey","setPageKey","setQuery","page","find","entry","pages","plugin","choose","next","close","rows","head","back","hidden","flip","appendComposerDraft","body","glyphText","kindLabel","waiting","CompletionButton","magic","magicPressed","create","theme","sans","fontFamily","mono","size","color","fontSize","lineHeight","minWidth","opacity","transform","rotate","flexDirection","alignItems","paddingHorizontal","spacing","paddingBottom","uni__dependencies","width","height","justifyContent","colors","hi","fontWeight","semibold","textAlign","gap","borderRadius","lg","borderWidth","borderColor","backgroundColor","bg","overflow","minHeight","paddingVertical","borderTopWidth","hairlineWidth","borderTopColor","green","medium","dim"],"sources":["../../src/components/CompletionSheet.tsx"],"sourcesContent":["import { useT } from '@agimon-ai/po-core/native';\nimport type { WebPluginSlotProps } from '@agimon-ai/po-core/web';\nimport {\n ChevronRightIcon,\n fontOf,\n Input,\n Sheet,\n SheetContent,\n SparklesIcon,\n Spinner,\n} from '@agimon-ai/po-native-components';\nimport {\n type CommandInfo,\n type CompletionItem,\n type CompletionKind,\n commandCompletions,\n fileCompletions,\n HOST_SLOTS,\n type MentionableSession,\n sessionCompletions,\n slotFills,\n TRIGGER_CHARS,\n} from '@agimon-ai/po-web-dashboard/core';\nimport { type ComponentType, useEffect, useEffectEvent, useState } from 'react';\nimport { Pressable, Text, View } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\ntype Translate = (key: string, fallback: string) => string;\n\n/** The phone's way into `@`, `$` and `/`: what each kind is called and what it is for. */\nfunction completionKinds(\n t: Translate,\n): readonly { kind: CompletionKind; title: string; hint: string; search: string; none: string }[] {\n return [\n {\n kind: 'file',\n title: t('nativeDashboard.completion.filesTitle', 'Files and sessions'),\n hint: t('nativeDashboard.completion.filesHint', 'Point Po at a file in this folder or another session'),\n search: t('nativeDashboard.completion.filesSearch', 'Search files and sessions'),\n none: t('nativeDashboard.completion.filesNone', 'No files or sessions match'),\n },\n {\n kind: 'skill',\n title: t('nativeDashboard.completion.skillsTitle', 'Skills'),\n hint: t('nativeDashboard.completion.skillsHint', 'Use one of your skills'),\n search: t('nativeDashboard.completion.skillsSearch', 'Search skills'),\n none: t('nativeDashboard.completion.skillsNone', 'No skills match'),\n },\n {\n kind: 'command',\n title: t('nativeDashboard.completion.commandsTitle', 'Slash commands'),\n hint: t('nativeDashboard.completion.commandsHint', 'Run a session command'),\n search: t('nativeDashboard.completion.commandsSearch', 'Search commands'),\n none: t('nativeDashboard.completion.commandsNone', 'No commands match'),\n },\n ];\n}\n/** The hub is a tunnel away, so wait for a pause in typing before asking it. */\nconst FILE_SEARCH_DEBOUNCE_MS = 150;\n\nexport interface CompletionSource {\n commands: readonly CommandInfo[];\n searchFiles: (query: string) => Promise<string[]>;\n /** References plugins offer before workspace files. */\n references?: (query: string) => readonly { path: string; detail?: string }[];\n /** Sessions `@` may name, offered before files. */\n sessions?: () => readonly MentionableSession[];\n}\n\n/** A row a plugin adds after the three kinds, and the page it opens in this sheet. */\ninterface InsertPage {\n key: string;\n title: string;\n hint: string;\n glyph: string;\n component: ComponentType<WebPluginSlotProps>;\n}\n\nfunction textField(data: unknown, key: string): string | undefined {\n if (typeof data !== 'object' || data === null) return undefined;\n const value: unknown = Reflect.get(data, key);\n return typeof value === 'string' ? value : undefined;\n}\n\n/**\n * The phone's `composer-menu` fills. The cockpit draws a fill's component as the\n * menu row itself; a sheet has room for a page, so here `data.title` (with\n * optional `hint` and `glyph`) is the row and the component is the page.\n */\nfunction insertPages(sessionId: string | null): InsertPage[] {\n return slotFills(HOST_SLOTS.composerMenu, sessionId).flatMap(({ pluginId, id, data, component }) => {\n const title = textField(data, 'title');\n if (!component || title === undefined) return [];\n const hint = textField(data, 'hint') ?? '';\n const glyph = textField(data, 'glyph') ?? title.charAt(0);\n return [{ key: `${pluginId}:${id}`, title, hint, glyph, component }];\n });\n}\n/** The items one kind offers for a query; files come from the hub, the rest from the session's commands. */\nexport function useCompletionItems(\n source: CompletionSource | undefined,\n kind: CompletionKind | null,\n query: string,\n): CompletionItem[] | undefined {\n const [files, setFiles] = useState<{ query: string; items: string[] }>();\n const searchable = source?.searchFiles !== undefined;\n // Hosts rebuild searchFiles every render; an effect event keeps a streaming session from restarting the debounce forever.\n const searchFiles = useEffectEvent((text: string) => source?.searchFiles(text) ?? Promise.resolve([]));\n useEffect(() => {\n if (kind !== 'file' || !searchable) return;\n let current = true;\n const timer = setTimeout(() => {\n void searchFiles(query).then((found) => {\n if (current) setFiles({ query, items: found });\n });\n }, FILE_SEARCH_DEBOUNCE_MS);\n return () => {\n current = false;\n clearTimeout(timer);\n };\n }, [kind, query, searchable]);\n if (source === undefined || kind === null) return [];\n if (kind !== 'file') return commandCompletions(source.commands, kind, query);\n // Sessions come from memory, so they show at once; files join them when the hub answers.\n const sessions = sessionCompletions(source.sessions?.() ?? [], query);\n const references = source.references?.(query) ?? [];\n const items = [...sessions, ...fileCompletions(files?.query === query ? files.items : [], references)];\n return files?.query === query || items.length > 0 ? items : undefined;\n}\n\n/** Completion items as tappable rows: the name in mono, what it does beneath. */\nexport function CompletionRows({\n items,\n onPick,\n}: {\n items: readonly CompletionItem[];\n onPick: (item: CompletionItem) => void;\n}) {\n return (\n <View style={styles.list}>\n {items.map((item, index) => (\n <Pressable\n key={item.insert}\n accessibilityRole=\"button\"\n accessibilityLabel={item.detail ? `${item.label}, ${item.detail}` : item.label}\n onPress={() => onPick(item)}\n style={({ pressed }) => [styles.item, index > 0 && styles.divider, pressed && styles.pressed]}\n >\n <View style={styles.flex}>\n <Text style={styles.itemLabel} numberOfLines={1} ellipsizeMode=\"middle\">\n {item.label}\n </Text>\n {item.detail ? (\n <Text style={styles.meta} numberOfLines={1}>\n {item.detail}\n </Text>\n ) : null}\n </View>\n </Pressable>\n ))}\n </View>\n );\n}\n\nexport interface CompletionSheetProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n source: CompletionSource;\n onPick: (kind: CompletionKind, item: CompletionItem) => void;\n /** Opens on one kind's search rather than the choice of kinds. */\n defaultKind?: CompletionKind;\n defaultQuery?: string;\n /** Opens on a plugin page, keyed `<pluginId>:<fillId>`. */\n defaultPage?: string;\n /** The session's plugin props; with them, its `composer-menu` fills join the list. */\n slotProps?: WebPluginSlotProps;\n /** Rows after the pages that close the sheet and run, such as attaching a photo or file. */\n actions?: readonly InsertAction[];\n}\n\nexport interface InsertAction {\n key: string;\n glyph: string;\n title: string;\n hint: string;\n onPress: () => void;\n}\n\n/** The magic button's sheet: choose Files, Skills, Slash commands, a plugin page or an attachment, then pick one. */\nexport function CompletionSheet({\n open,\n onOpenChange,\n source,\n onPick,\n defaultKind,\n defaultQuery = '',\n defaultPage,\n slotProps,\n actions = [],\n}: CompletionSheetProps) {\n const t = useT();\n const kinds = completionKinds(t);\n const [kind, setKind] = useState<CompletionKind | null>(defaultKind ?? null);\n const [pageKey, setPageKey] = useState<string | null>(defaultPage ?? null);\n const [query, setQuery] = useState(defaultQuery);\n const items = useCompletionItems(source, kind, query);\n const page = kinds.find((entry) => entry.kind === kind);\n const pages = slotProps ? insertPages(slotProps.sessionId) : [];\n const plugin = pages.find((entry) => entry.key === pageKey);\n\n const choose = (next: CompletionKind | null) => {\n setKind(next);\n setPageKey(null);\n setQuery('');\n };\n const close = (next: boolean) => {\n if (!next) choose(null);\n onOpenChange(next);\n };\n const rows = [\n ...kinds.map((entry) => ({\n key: entry.kind,\n glyph: TRIGGER_CHARS[entry.kind],\n title: entry.title,\n hint: entry.hint,\n onPress: () => choose(entry.kind),\n })),\n ...pages.map((entry) => ({ ...entry, onPress: () => setPageKey(entry.key) })),\n ...actions.map((entry) => ({\n ...entry,\n onPress: () => {\n close(false);\n entry.onPress();\n },\n })),\n ];\n\n return (\n <Sheet open={open} onOpenChange={close}>\n <SheetContent>\n <View style={styles.head}>\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel={t('nativeDashboard.completion.back', 'Back to insert')}\n onPress={() => choose(null)}\n disabled={page === undefined && plugin === undefined}\n style={[styles.back, page === undefined && plugin === undefined && styles.hidden]}\n >\n <View style={styles.flip}>\n <ChevronRightIcon size={18} color=\"hi\" />\n </View>\n </Pressable>\n <Text style={styles.title} accessibilityRole=\"header\">\n {page?.title ?? plugin?.title ?? t('nativeDashboard.completion.title', 'Insert')}\n </Text>\n <View style={[styles.back, styles.hidden]} />\n </View>\n {plugin && slotProps ? (\n <plugin.component\n {...slotProps}\n appendComposerDraft={(text) => {\n slotProps.appendComposerDraft(text);\n close(false);\n }}\n />\n ) : (\n <View style={styles.body}>\n {page === undefined ? (\n <View style={styles.list}>\n {rows.map((entry, index) => (\n <Pressable\n key={entry.key}\n accessibilityRole=\"button\"\n accessibilityLabel={entry.hint ? `${entry.title}, ${entry.hint}` : entry.title}\n onPress={entry.onPress}\n style={({ pressed }) => [styles.item, index > 0 && styles.divider, pressed && styles.pressed]}\n >\n <View style={styles.glyph}>\n <Text style={styles.glyphText}>{entry.glyph}</Text>\n </View>\n <View style={styles.flex}>\n <Text style={styles.kindLabel}>{entry.title}</Text>\n {entry.hint ? <Text style={styles.meta}>{entry.hint}</Text> : null}\n </View>\n <ChevronRightIcon size={16} color=\"faint\" />\n </Pressable>\n ))}\n </View>\n ) : (\n <>\n <Input\n value={query}\n onChangeText={setQuery}\n placeholder={page.search}\n accessibilityLabel={page.search}\n autoFocus\n autoCapitalize=\"none\"\n autoCorrect={false}\n />\n {items === undefined ? (\n <View style={styles.waiting}>\n <Spinner size=\"small\" color=\"dim\" label={t('nativeDashboard.completion.searching', 'Searching')} />\n </View>\n ) : items.length === 0 ? (\n <Text style={styles.none}>{page.none}</Text>\n ) : (\n <CompletionRows\n items={items}\n onPick={(item) => {\n onPick(page.kind, item);\n close(false);\n }}\n />\n )}\n </>\n )}\n </View>\n )}\n </SheetContent>\n </Sheet>\n );\n}\n\n/** The composer's round button that opens the sheet. */\nexport function CompletionButton({ onPress }: { onPress: () => void }) {\n const t = useT();\n return (\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel={t('nativeDashboard.completion.open', 'Insert or attach')}\n onPress={onPress}\n hitSlop={6}\n style={({ pressed }) => [styles.magic, pressed && styles.magicPressed]}\n >\n <SparklesIcon size={16} color=\"green\" />\n </Pressable>\n );\n}\n\nconst styles = StyleSheet.create((theme) => {\n const sans = fontOf(theme.fontFamily.sans);\n const mono = fontOf(theme.fontFamily.mono);\n const text = (size: 'sm' | 'base' | 'lg', color: string) => ({\n fontFamily: sans,\n fontSize: theme.fontSize[size],\n lineHeight: theme.lineHeight[size],\n color,\n });\n return {\n flex: { flex: 1, minWidth: 0 },\n hidden: { opacity: 0 },\n flip: { transform: [{ rotate: '180deg' }] },\n head: {\n flexDirection: 'row',\n alignItems: 'center',\n paddingHorizontal: theme.spacing(3),\n paddingBottom: theme.spacing(2),\n },\n back: { width: 36, height: 36, alignItems: 'center', justifyContent: 'center' },\n title: { ...text('lg', theme.colors.hi), fontWeight: theme.fontWeight.semibold, flex: 1, textAlign: 'center' },\n body: { gap: theme.spacing(3), paddingHorizontal: theme.spacing(4), paddingBottom: theme.spacing(4) },\n list: {\n borderRadius: theme.borderRadius.lg,\n borderWidth: 1,\n borderColor: theme.colors['border-soft'],\n backgroundColor: theme.colors.bg,\n overflow: 'hidden',\n },\n item: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: theme.spacing(3),\n minHeight: 48,\n paddingHorizontal: theme.spacing(4),\n paddingVertical: theme.spacing(2.5),\n },\n divider: { borderTopWidth: StyleSheet.hairlineWidth, borderTopColor: theme.colors['border-soft'] },\n pressed: { backgroundColor: theme.colors['tint-green'] },\n glyph: {\n width: 32,\n height: 32,\n borderRadius: 16,\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: theme.colors['tint-green'],\n },\n glyphText: { ...text('lg', theme.colors.green), fontFamily: mono, fontWeight: theme.fontWeight.semibold },\n kindLabel: { ...text('base', theme.colors.hi), fontWeight: theme.fontWeight.medium },\n itemLabel: { ...text('base', theme.colors.hi), fontFamily: mono },\n meta: text('sm', theme.colors.dim),\n none: { ...text('base', theme.colors.dim), textAlign: 'center', paddingVertical: theme.spacing(4) },\n waiting: { alignItems: 'center', paddingVertical: theme.spacing(6) },\n magic: {\n width: 32,\n height: 32,\n borderRadius: 16,\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: theme.colors['tint-green'],\n },\n magicPressed: { opacity: 0.7 },\n };\n});\n"],"mappings":";;;;;;;;;;;;AA8BA,SAAS2B,gBACPC,GACgG;CAChG,OAAO;EACL;GACEC,MAAM;GACNC,OAAOF,EAAE,yCAAyC,oBAAoB;GACtEG,MAAMH,EAAE,wCAAwC,sDAAsD;GACtGI,QAAQJ,EAAE,0CAA0C,2BAA2B;GAC/EK,MAAML,EAAE,wCAAwC,4BAA4B;EAC9E;EACA;GACEC,MAAM;GACNC,OAAOF,EAAE,0CAA0C,QAAQ;GAC3DG,MAAMH,EAAE,yCAAyC,wBAAwB;GACzEI,QAAQJ,EAAE,2CAA2C,eAAe;GACpEK,MAAML,EAAE,yCAAyC,iBAAiB;EACpE;EACA;GACEC,MAAM;GACNC,OAAOF,EAAE,4CAA4C,gBAAgB;GACrEG,MAAMH,EAAE,2CAA2C,uBAAuB;GAC1EI,QAAQJ,EAAE,6CAA6C,iBAAiB;GACxEK,MAAML,EAAE,2CAA2C,mBAAmB;EACxE;CAAC;AAEL;;AAEA,MAAMM,0BAA0B;AAoBhC,SAASa,UAAUC,MAAevB,KAAiC;CACjE,IAAI,OAAOuB,SAAS,YAAYA,SAAS,MAAM,OAAOC;CACtD,MAAMC,QAAiBC,QAAQC,IAAIJ,MAAMvB,GAAG;CAC5C,OAAO,OAAOyB,UAAU,WAAWA,QAAQD;AAC7C;;;;;;AAOA,SAASI,YAAYC,WAAwC;CAC3D,OAAOrC,UAAUH,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GAAGrC,YAAYC;GAAMoB,YAAYvB,MAAMuB,WAAWC;GAAQP,mBAAA,CAAA,CAAA;EAAC;EACxGvB,WAAW;GAAE,GAAGvD,KAAK,QAAQ6D,MAAMqB,OAAOC,EAAE;GAAGC,YAAYvB,MAAMuB,WAAWiB;GAAMvB,mBAAA,CAAA,CAAA;EAAC;EACnFzD,WAAW;GAAE,GAAGrB,KAAK,QAAQ6D,MAAMqB,OAAOC,EAAE;GAAGpB,YAAYC;GAAIc,mBAAA,CAAA,CAAA;EAAC;EAChExD,MAAMtB,KAAK,MAAM6D,MAAMqB,OAAOoB,GAAG;EACjCvI,MAAM;GAAE,GAAGiC,KAAK,QAAQ6D,MAAMqB,OAAOoB,GAAG;GAAGhB,WAAW;GAAUU,iBAAiBnC,MAAMe,QAAQ,CAAC;GAACE,mBAAA,CAAA,CAAA;EAAC;EAClGtB,SAAS;GAAEkB,YAAY;GAAUsB,iBAAiBnC,MAAMe,QAAQ,CAAC;GAACE,mBAAA,CAAA,CAAA;EAAC;EACnEpB,OAAO;GACLqB,OAAO;GACPC,QAAQ;GACRQ,cAAc;GACdd,YAAY;GACZO,gBAAgB;GAChBW,iBAAiB/B,MAAMqB,OAAO;GAAaJ,mBAAA,CAAA,CAAA;EAC7C;EACAnB,cAAc,EAAEW,SAAS,GAAI;CAC/B;AACF,CAAC"}
1
+ {"version":3,"file":"CompletionSheet.mjs","names":["useT","WebPluginSlotProps","ChevronRightIcon","fontOf","Input","Sheet","SheetContent","SparklesIcon","Spinner","CommandInfo","CompletionItem","CompletionKind","commandCompletions","fileCompletions","HOST_SLOTS","MentionableSession","sessionCompletions","slotFills","TRIGGER_CHARS","ComponentType","useEffect","useEffectEvent","useState","StyleSheet","Translate","key","fallback","completionKinds","t","kind","title","hint","search","none","FILE_SEARCH_DEBOUNCE_MS","CompletionSource","commands","searchFiles","query","Promise","references","path","detail","sessions","InsertPage","glyph","component","textField","data","undefined","value","Reflect","get","insertPages","sessionId","ReturnType","composerMenu","flatMap","pluginId","id","translateCopy","copy","charAt","useCompletionItems","source","files","setFiles","items","searchable","text","resolve","current","timer","setTimeout","then","found","clearTimeout","length","CompletionRows","onPick","item","styles","list","map","index","insert","label","pressed","divider","flex","itemLabel","meta","CompletionSheetProps","open","onOpenChange","defaultKind","defaultQuery","defaultPage","slotProps","actions","InsertAction","onPress","CompletionSheet","kinds","setKind","pageKey","setPageKey","setQuery","page","find","entry","pages","plugin","choose","next","close","rows","head","back","hidden","flip","appendComposerDraft","body","glyphText","kindLabel","waiting","CompletionButton","magic","magicPressed","create","theme","sans","fontFamily","mono","size","color","fontSize","lineHeight","minWidth","opacity","transform","rotate","flexDirection","alignItems","paddingHorizontal","spacing","paddingBottom","uni__dependencies","width","height","justifyContent","colors","hi","fontWeight","semibold","textAlign","gap","borderRadius","lg","borderWidth","borderColor","backgroundColor","bg","overflow","minHeight","paddingVertical","borderTopWidth","hairlineWidth","borderTopColor","green","medium","dim"],"sources":["../../src/components/CompletionSheet.tsx"],"sourcesContent":["import { useT } from '@agimon-ai/po-core/native';\nimport type { WebPluginSlotProps } from '@agimon-ai/po-core/web';\nimport {\n ChevronRightIcon,\n fontOf,\n Input,\n Sheet,\n SheetContent,\n SparklesIcon,\n Spinner,\n} from '@agimon-ai/po-native-components';\nimport {\n type CommandInfo,\n type CompletionItem,\n type CompletionKind,\n commandCompletions,\n fileCompletions,\n HOST_SLOTS,\n type MentionableSession,\n sessionCompletions,\n slotFills,\n TRIGGER_CHARS,\n} from '@agimon-ai/po-web-dashboard/core';\nimport { type ComponentType, useEffect, useEffectEvent, useState } from 'react';\nimport { Pressable, Text, View } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\ntype Translate = (key: string, fallback: string) => string;\n\n/** The phone's way into `@`, `$` and `/`: what each kind is called and what it is for. */\nfunction completionKinds(\n t: Translate,\n): readonly { kind: CompletionKind; title: string; hint: string; search: string; none: string }[] {\n return [\n {\n kind: 'file',\n title: t('nativeDashboard.completion.filesTitle', 'Files and sessions'),\n hint: t('nativeDashboard.completion.filesHint', 'Point Po at a file in this folder or another session'),\n search: t('nativeDashboard.completion.filesSearch', 'Search files and sessions'),\n none: t('nativeDashboard.completion.filesNone', 'No files or sessions match'),\n },\n {\n kind: 'skill',\n title: t('nativeDashboard.completion.skillsTitle', 'Skills'),\n hint: t('nativeDashboard.completion.skillsHint', 'Use one of your skills'),\n search: t('nativeDashboard.completion.skillsSearch', 'Search skills'),\n none: t('nativeDashboard.completion.skillsNone', 'No skills match'),\n },\n {\n kind: 'command',\n title: t('nativeDashboard.completion.commandsTitle', 'Slash commands'),\n hint: t('nativeDashboard.completion.commandsHint', 'Run a session command'),\n search: t('nativeDashboard.completion.commandsSearch', 'Search commands'),\n none: t('nativeDashboard.completion.commandsNone', 'No commands match'),\n },\n ];\n}\n/** The hub is a tunnel away, so wait for a pause in typing before asking it. */\nconst FILE_SEARCH_DEBOUNCE_MS = 150;\n\nexport interface CompletionSource {\n commands: readonly CommandInfo[];\n searchFiles: (query: string) => Promise<string[]>;\n /** References plugins offer before workspace files. */\n references?: (query: string) => readonly { path: string; detail?: string }[];\n /** Sessions `@` may name, offered before files. */\n sessions?: () => readonly MentionableSession[];\n}\n\n/** A row a plugin adds after the three kinds, and the page it opens in this sheet. */\ninterface InsertPage {\n key: string;\n title: string;\n hint: string;\n glyph: string;\n component: ComponentType<WebPluginSlotProps>;\n}\n\nfunction textField(data: unknown, key: string): string | undefined {\n if (typeof data !== 'object' || data === null) return undefined;\n const value: unknown = Reflect.get(data, key);\n return typeof value === 'string' ? value : undefined;\n}\n\n/**\n * The phone's `composer-menu` fills. The cockpit draws a fill's component as the\n * menu row itself; a sheet has room for a page, so here `data.title` (with\n * optional `hint` and `glyph`) is the row and the component is the page.\n */\nfunction insertPages(sessionId: string | null, t: ReturnType<typeof useT>): InsertPage[] {\n return slotFills(HOST_SLOTS.composerMenu, sessionId).flatMap(({ pluginId, id, data, component }) => {\n const translateCopy: unknown =\n typeof data === 'object' && data !== null ? Reflect.get(data, 'translateCopy') : undefined;\n const copy: unknown = typeof translateCopy === 'function' ? translateCopy(t) : data;\n const title = textField(copy, 'title');\n if (!component || title === undefined) return [];\n const hint = textField(copy, 'hint') ?? '';\n const glyph = textField(data, 'glyph') ?? title.charAt(0);\n return [{ key: `${pluginId}:${id}`, title, hint, glyph, component }];\n });\n}\n/** The items one kind offers for a query; files come from the hub, the rest from the session's commands. */\nexport function useCompletionItems(\n source: CompletionSource | undefined,\n kind: CompletionKind | null,\n query: string,\n): CompletionItem[] | undefined {\n const [files, setFiles] = useState<{ query: string; items: string[] }>();\n const searchable = source?.searchFiles !== undefined;\n // Hosts rebuild searchFiles every render; an effect event keeps a streaming session from restarting the debounce forever.\n const searchFiles = useEffectEvent((text: string) => source?.searchFiles(text) ?? Promise.resolve([]));\n useEffect(() => {\n if (kind !== 'file' || !searchable) return;\n let current = true;\n const timer = setTimeout(() => {\n void searchFiles(query).then((found) => {\n if (current) setFiles({ query, items: found });\n });\n }, FILE_SEARCH_DEBOUNCE_MS);\n return () => {\n current = false;\n clearTimeout(timer);\n };\n }, [kind, query, searchable]);\n if (source === undefined || kind === null) return [];\n if (kind !== 'file') return commandCompletions(source.commands, kind, query);\n // Sessions come from memory, so they show at once; files join them when the hub answers.\n const sessions = sessionCompletions(source.sessions?.() ?? [], query);\n const references = source.references?.(query) ?? [];\n const items = [...sessions, ...fileCompletions(files?.query === query ? files.items : [], references)];\n return files?.query === query || items.length > 0 ? items : undefined;\n}\n\n/** Completion items as tappable rows: the name in mono, what it does beneath. */\nexport function CompletionRows({\n items,\n onPick,\n}: {\n items: readonly CompletionItem[];\n onPick: (item: CompletionItem) => void;\n}) {\n return (\n <View style={styles.list}>\n {items.map((item, index) => (\n <Pressable\n key={item.insert}\n accessibilityRole=\"button\"\n accessibilityLabel={item.detail ? `${item.label}, ${item.detail}` : item.label}\n onPress={() => onPick(item)}\n style={({ pressed }) => [styles.item, index > 0 && styles.divider, pressed && styles.pressed]}\n >\n <View style={styles.flex}>\n <Text style={styles.itemLabel} numberOfLines={1} ellipsizeMode=\"middle\">\n {item.label}\n </Text>\n {item.detail ? (\n <Text style={styles.meta} numberOfLines={1}>\n {item.detail}\n </Text>\n ) : null}\n </View>\n </Pressable>\n ))}\n </View>\n );\n}\n\nexport interface CompletionSheetProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n source: CompletionSource;\n onPick: (kind: CompletionKind, item: CompletionItem) => void;\n /** Opens on one kind's search rather than the choice of kinds. */\n defaultKind?: CompletionKind;\n defaultQuery?: string;\n /** Opens on a plugin page, keyed `<pluginId>:<fillId>`. */\n defaultPage?: string;\n /** The session's plugin props; with them, its `composer-menu` fills join the list. */\n slotProps?: WebPluginSlotProps;\n /** Rows after the pages that close the sheet and run, such as attaching a photo or file. */\n actions?: readonly InsertAction[];\n}\n\nexport interface InsertAction {\n key: string;\n glyph: string;\n title: string;\n hint: string;\n onPress: () => void;\n}\n\n/** The magic button's sheet: choose Files, Skills, Slash commands, a plugin page or an attachment, then pick one. */\nexport function CompletionSheet({\n open,\n onOpenChange,\n source,\n onPick,\n defaultKind,\n defaultQuery = '',\n defaultPage,\n slotProps,\n actions = [],\n}: CompletionSheetProps) {\n const t = useT();\n const kinds = completionKinds(t);\n const [kind, setKind] = useState<CompletionKind | null>(defaultKind ?? null);\n const [pageKey, setPageKey] = useState<string | null>(defaultPage ?? null);\n const [query, setQuery] = useState(defaultQuery);\n const items = useCompletionItems(source, kind, query);\n const page = kinds.find((entry) => entry.kind === kind);\n const pages = slotProps ? insertPages(slotProps.sessionId, t) : [];\n const plugin = pages.find((entry) => entry.key === pageKey);\n\n const choose = (next: CompletionKind | null) => {\n setKind(next);\n setPageKey(null);\n setQuery('');\n };\n const close = (next: boolean) => {\n if (!next) choose(null);\n onOpenChange(next);\n };\n const rows = [\n ...kinds.map((entry) => ({\n key: entry.kind,\n glyph: TRIGGER_CHARS[entry.kind],\n title: entry.title,\n hint: entry.hint,\n onPress: () => choose(entry.kind),\n })),\n ...pages.map((entry) => ({ ...entry, onPress: () => setPageKey(entry.key) })),\n ...actions.map((entry) => ({\n ...entry,\n onPress: () => {\n close(false);\n entry.onPress();\n },\n })),\n ];\n\n return (\n <Sheet open={open} onOpenChange={close}>\n <SheetContent>\n <View style={styles.head}>\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel={t('nativeDashboard.completion.back', 'Back to insert')}\n onPress={() => choose(null)}\n disabled={page === undefined && plugin === undefined}\n style={[styles.back, page === undefined && plugin === undefined && styles.hidden]}\n >\n <View style={styles.flip}>\n <ChevronRightIcon size={18} color=\"hi\" />\n </View>\n </Pressable>\n <Text style={styles.title} accessibilityRole=\"header\">\n {page?.title ?? plugin?.title ?? t('nativeDashboard.completion.title', 'Insert')}\n </Text>\n <View style={[styles.back, styles.hidden]} />\n </View>\n {plugin && slotProps ? (\n <plugin.component\n {...slotProps}\n appendComposerDraft={(text) => {\n slotProps.appendComposerDraft(text);\n close(false);\n }}\n />\n ) : (\n <View style={styles.body}>\n {page === undefined ? (\n <View style={styles.list}>\n {rows.map((entry, index) => (\n <Pressable\n key={entry.key}\n accessibilityRole=\"button\"\n accessibilityLabel={entry.hint ? `${entry.title}, ${entry.hint}` : entry.title}\n onPress={entry.onPress}\n style={({ pressed }) => [styles.item, index > 0 && styles.divider, pressed && styles.pressed]}\n >\n <View style={styles.glyph}>\n <Text style={styles.glyphText}>{entry.glyph}</Text>\n </View>\n <View style={styles.flex}>\n <Text style={styles.kindLabel}>{entry.title}</Text>\n {entry.hint ? <Text style={styles.meta}>{entry.hint}</Text> : null}\n </View>\n <ChevronRightIcon size={16} color=\"faint\" />\n </Pressable>\n ))}\n </View>\n ) : (\n <>\n <Input\n value={query}\n onChangeText={setQuery}\n placeholder={page.search}\n accessibilityLabel={page.search}\n autoFocus\n autoCapitalize=\"none\"\n autoCorrect={false}\n />\n {items === undefined ? (\n <View style={styles.waiting}>\n <Spinner size=\"small\" color=\"dim\" label={t('nativeDashboard.completion.searching', 'Searching')} />\n </View>\n ) : items.length === 0 ? (\n <Text style={styles.none}>{page.none}</Text>\n ) : (\n <CompletionRows\n items={items}\n onPick={(item) => {\n onPick(page.kind, item);\n close(false);\n }}\n />\n )}\n </>\n )}\n </View>\n )}\n </SheetContent>\n </Sheet>\n );\n}\n\n/** The composer's round button that opens the sheet. */\nexport function CompletionButton({ onPress }: { onPress: () => void }) {\n const t = useT();\n return (\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel={t('nativeDashboard.completion.open', 'Insert or attach')}\n onPress={onPress}\n hitSlop={6}\n style={({ pressed }) => [styles.magic, pressed && styles.magicPressed]}\n >\n <SparklesIcon size={16} color=\"green\" />\n </Pressable>\n );\n}\n\nconst styles = StyleSheet.create((theme) => {\n const sans = fontOf(theme.fontFamily.sans);\n const mono = fontOf(theme.fontFamily.mono);\n const text = (size: 'sm' | 'base' | 'lg', color: string) => ({\n fontFamily: sans,\n fontSize: theme.fontSize[size],\n lineHeight: theme.lineHeight[size],\n color,\n });\n return {\n flex: { flex: 1, minWidth: 0 },\n hidden: { opacity: 0 },\n flip: { transform: [{ rotate: '180deg' }] },\n head: {\n flexDirection: 'row',\n alignItems: 'center',\n paddingHorizontal: theme.spacing(3),\n paddingBottom: theme.spacing(2),\n },\n back: { width: 36, height: 36, alignItems: 'center', justifyContent: 'center' },\n title: { ...text('lg', theme.colors.hi), fontWeight: theme.fontWeight.semibold, flex: 1, textAlign: 'center' },\n body: { gap: theme.spacing(3), paddingHorizontal: theme.spacing(4), paddingBottom: theme.spacing(4) },\n list: {\n borderRadius: theme.borderRadius.lg,\n borderWidth: 1,\n borderColor: theme.colors['border-soft'],\n backgroundColor: theme.colors.bg,\n overflow: 'hidden',\n },\n item: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: theme.spacing(3),\n minHeight: 48,\n paddingHorizontal: theme.spacing(4),\n paddingVertical: theme.spacing(2.5),\n },\n divider: { borderTopWidth: StyleSheet.hairlineWidth, borderTopColor: theme.colors['border-soft'] },\n pressed: { backgroundColor: theme.colors['tint-green'] },\n glyph: {\n width: 32,\n height: 32,\n borderRadius: 16,\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: theme.colors['tint-green'],\n },\n glyphText: { ...text('lg', theme.colors.green), fontFamily: mono, fontWeight: theme.fontWeight.semibold },\n kindLabel: { ...text('base', theme.colors.hi), fontWeight: theme.fontWeight.medium },\n itemLabel: { ...text('base', theme.colors.hi), fontFamily: mono },\n meta: text('sm', theme.colors.dim),\n none: { ...text('base', theme.colors.dim), textAlign: 'center', paddingVertical: theme.spacing(4) },\n waiting: { alignItems: 'center', paddingVertical: theme.spacing(6) },\n magic: {\n width: 32,\n height: 32,\n borderRadius: 16,\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: theme.colors['tint-green'],\n },\n magicPressed: { opacity: 0.7 },\n };\n});\n"],"mappings":";;;;;;;;;;;;AA8BA,SAAS2B,gBACPC,GACgG;CAChG,OAAO;EACL;GACEC,MAAM;GACNC,OAAOF,EAAE,yCAAyC,oBAAoB;GACtEG,MAAMH,EAAE,wCAAwC,sDAAsD;GACtGI,QAAQJ,EAAE,0CAA0C,2BAA2B;GAC/EK,MAAML,EAAE,wCAAwC,4BAA4B;EAC9E;EACA;GACEC,MAAM;GACNC,OAAOF,EAAE,0CAA0C,QAAQ;GAC3DG,MAAMH,EAAE,yCAAyC,wBAAwB;GACzEI,QAAQJ,EAAE,2CAA2C,eAAe;GACpEK,MAAML,EAAE,yCAAyC,iBAAiB;EACpE;EACA;GACEC,MAAM;GACNC,OAAOF,EAAE,4CAA4C,gBAAgB;GACrEG,MAAMH,EAAE,2CAA2C,uBAAuB;GAC1EI,QAAQJ,EAAE,6CAA6C,iBAAiB;GACxEK,MAAML,EAAE,2CAA2C,mBAAmB;EACxE;CAAC;AAEL;;AAEA,MAAMM,0BAA0B;AAoBhC,SAASa,UAAUC,MAAevB,KAAiC;CACjE,IAAI,OAAOuB,SAAS,YAAYA,SAAS,MAAM,OAAOC;CACtD,MAAMC,QAAiBC,QAAQC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MAGE_SOURCE,
105
105
  id: `paste-${Date.now()}`,
106
- label: "Pasted image",
106
+ label: t("nativeDashboard.composer.pastedImage", "Pasted image"),
107
107
  content: "An image pasted from the clipboard."
108
108
  }
109
109
  });
@@ -131,7 +131,7 @@ function Composer({ onSend, disabled = false, initialText = "", value, onChangeT
131
131
  kind: "image",
132
132
  source: PICKED_IMAGE_SOURCE,
133
133
  id: `photo-${Date.now()}-${index}`,
134
- label: "Photo",
134
+ label: t("nativeDashboard.composer.photo", "Photo"),
135
135
  content: "An image attached from the photo library."
136
136
  }
137
137
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Composer.mjs","names":["useT","ComposerCapture","WebPluginSlotProps","Button","ChevronDownIcon","fontOf","PlusIcon","SendIcon","StopIcon","Textarea","CompletionItem","CompletionKind","HOST_SLOTS","renderRegion","slotFills","triggerTokenAt","sessionStoreFor","parseSelection","useRenderTrace","useStore","Store","addClipboardListener","ContentType","GetImageOptions","getImageAsync","hasImageAsync","getDocumentAsync","File","launchImageLibraryAsync","useEffect","useMemo","useState","Alert","StyleSheet","CaptureTray","CompletionButton","CompletionRows","CompletionSheet","CompletionSource","useCompletionItems","PASTED_IMAGE_SOURCE","PICKED_IMAGE_SOURCE","uploadedFileContext","PASTED_IMAGE_OPTIONS","format","jpegQuality","MAX_CAPTURES","MAX_UPLOAD_BYTES","NO_CAPTURES","EMPTY_DRAFT_STORE","Record","ComposerProps","onSend","text","disabled","initialText","value","onChangeText","draftStore","sessionId","live","searchFiles","query","Promise","references","mentionSessions","uploadAttachment","file","name","mimeType","bytes","Uint8Array","ArrayBuffer","path","size","running","onAbort","preset","onOpenOptions","completion","slotProps","captures","onRemoveCapture","capture","quiet","autoFocus","withCompletion","caret","kind","item","rest","replace","insert","length","before","slice","space","test","Composer","suppliedRunning","suppliedPreset","suppliedCompletion","t","localText","setLocalText","storedText","state","setText","next","setState","store","liveRunning","streaming","livePreset","statuses","undefined","commands","sessions","selection","setSelection","sheetOpen","setSheetOpen","focused","setFocused","clipboardImage","setClipboardImage","attachError","setAttachError","attaching","setAttaching","attachCapture","attachComposerCapture","attachContext","attachComposerContext","canPaste","then","has","subscription","contentTypes","includes","IMAGE","remove","pasteImage","image","data","indexOf","context","source","id","Date","now","label","content","error","Error","message","pickPhotos","result","mediaTypes","allowsMultipleSelection","selectionLimit","base64","quality","canceled","assets","forEach","asset","index","pickFile","copyToCacheDirectory","uri","stored","runAttach","pick","catch","finally","canAttach","Boolean","canAttachPhoto","attachActions","key","glyph","title","hint","onPress","chooseAttachment","alert","style","const","Math","min","trigger","suggestions","accept","start","canSend","trim","send","dock","styles","box","plain","quietInput","input","event","nativeEvent","end","row","busy","pressed","attach","options","optionsText","flex","composerActions","map","pluginId","component","Action","sendText","composerRegion","create","theme","rt","sans","fontFamily","gap","spacing","paddingHorizontal","paddingTop","paddingBottom","insets","ime","bottom","backgroundColor","colors","bg","uni__dependencies","minHeight","maxHeight","paddingVertical","borderRadius","borderWidth","borderColor","border","color","fontSize","lg","lineHeight","flexGrow","flexDirection","alignItems","height","maxWidth","flexShrink","opacity","width","justifyContent","base","fontWeight","semibold","green","sm","red"],"sources":["../../src/components/Composer.tsx"],"sourcesContent":["import { useT } from '@agimon-ai/po-core/native';\nimport type { ComposerCapture, WebPluginSlotProps } from '@agimon-ai/po-core/web';\nimport {\n Button,\n ChevronDownIcon,\n fontOf,\n PlusIcon,\n SendIcon,\n StopIcon,\n Textarea,\n} from '@agimon-ai/po-native-components';\nimport {\n type CompletionItem,\n type CompletionKind,\n HOST_SLOTS,\n renderRegion,\n slotFills,\n triggerTokenAt,\n sessionStoreFor,\n parseSelection,\n useRenderTrace,\n} from '@agimon-ai/po-web-dashboard/core';\nimport { useStore } from '@tanstack/react-store';\nimport { Store } from '@tanstack/store';\nimport { addClipboardListener, ContentType, type GetImageOptions, getImageAsync, hasImageAsync } from 'expo-clipboard';\nimport { getDocumentAsync } from 'expo-document-picker';\nimport { File } from 'expo-file-system';\nimport { launchImageLibraryAsync } from 'expo-image-picker';\nimport { useEffect, useMemo, useState } from 'react';\nimport { Alert, Pressable, ScrollView, Text, View } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport { CaptureTray } from './CaptureTray';\nimport {\n CompletionButton,\n CompletionRows,\n CompletionSheet,\n type CompletionSource,\n useCompletionItems,\n} from './CompletionSheet';\nimport { PASTED_IMAGE_SOURCE, PICKED_IMAGE_SOURCE, uploadedFileContext } from './slotProps';\n\n// JPEG keeps a pasted photo well under the 10 MB image limit; screenshots stay readable.\nconst PASTED_IMAGE_OPTIONS: GetImageOptions = { format: 'jpeg', jpegQuality: 0.8 };\n// ponytail: the attachment budget (stageNativeCapture) fits four images with no other context; the error covers less.\nconst MAX_CAPTURES = 4;\n// The host's upload limit; checked before reading so a huge file never loads into memory.\nconst MAX_UPLOAD_BYTES = 8 * 1024 * 1024;\nconst NO_CAPTURES: readonly ComposerCapture[] = [];\nconst EMPTY_DRAFT_STORE = new Store<Record<string, string>>({});\nexport interface ComposerProps {\n /** Returning false means it was not sent, so the draft stays. */\n onSend: (text: string) => boolean | void;\n disabled?: boolean;\n initialText?: string;\n /** A session host may retain the draft while a prompt temporarily replaces this composer. */\n value?: string;\n onChangeText?: (text: string) => void;\n draftStore?: Store<Record<string, string>>;\n sessionId?: string;\n /** Runtime controls subscribe here, outside the navigator and transcript. */\n live?: boolean;\n searchFiles?: (query: string) => Promise<string[]>;\n /** References plugins offer before workspace files. */\n references?: CompletionSource['references'];\n /** Sessions `@` may name, offered before files. */\n mentionSessions?: CompletionSource['sessions'];\n /** Stores a picked file on the host and returns its path; without it the File option reports it is unavailable. */\n uploadAttachment?: (\n sessionId: string,\n file: { name: string; mimeType: string; bytes: Uint8Array<ArrayBuffer> },\n ) => Promise<{ path: string; mimeType: string; size: number }>;\n /** A run is in progress: Send steers it and Abort stops it. */\n running?: boolean;\n onAbort?: () => void;\n /** The current preset, shown on the options button. */\n preset?: string;\n onOpenOptions?: () => void;\n /** Offers `@` files, `$` skills and `/` commands while typing and from the insert button. */\n completion?: CompletionSource;\n /** The session's plugin props, so plugin pages can join the insert sheet. */\n slotProps?: WebPluginSlotProps;\n /** Images staged for the next message, shown as thumbnails above the text box. */\n captures?: readonly ComposerCapture[];\n onRemoveCapture?: (capture: ComposerCapture) => void;\n /** One outlined box holding the text and its controls, with an icon Send; absent keeps the default layout. */\n quiet?: boolean;\n /** Focuses the text box on mount, such as when a conversation sheet opens to be typed in. */\n autoFocus?: boolean;\n}\n\n/** The draft with a picked item in place: commands and skills lead the message, files go where the caret is. */\nfunction withCompletion(text: string, caret: number, kind: CompletionKind, item: CompletionItem) {\n if (kind !== 'file') {\n const rest = text.replace(/^[/$]\\S*\\s*/u, '');\n return { text: `${item.insert}${rest}`, caret: item.insert.length };\n }\n const before = text.slice(0, caret);\n const space = before === '' || /\\s$/u.test(before) ? '' : ' ';\n return {\n text: `${before}${space}${item.insert}${text.slice(caret)}`,\n caret: before.length + space.length + item.insert.length,\n };\n}\n\n/** The text box, then the options button and Send in one row outside it. Context and cost sit in the options sheet. */\nexport function Composer({\n onSend,\n disabled = false,\n initialText = '',\n value,\n onChangeText,\n running: suppliedRunning = false,\n onAbort,\n preset: suppliedPreset,\n onOpenOptions,\n completion: suppliedCompletion,\n draftStore,\n sessionId = '',\n live = false,\n searchFiles,\n mentionSessions,\n references,\n uploadAttachment,\n slotProps,\n captures = NO_CAPTURES,\n onRemoveCapture,\n quiet,\n autoFocus,\n}: ComposerProps) {\n useRenderTrace('Composer');\n const t = useT();\n const [localText, setLocalText] = useState(initialText);\n const storedText = useStore(draftStore ?? EMPTY_DRAFT_STORE, (state) => state[sessionId] ?? initialText);\n const text = draftStore ? storedText : (value ?? localText);\n const setText = draftStore\n ? (next: string) =>\n draftStore.setState((state) => (state[sessionId] === next ? state : { ...state, [sessionId]: next }))\n : (onChangeText ?? setLocalText);\n const store = sessionStoreFor(sessionId);\n const liveRunning = useStore(store, (state) => live && state.streaming);\n const livePreset = useStore(store, (state) =>\n live ? parseSelection(state.statuses['po-preset'] ?? '').preset : undefined,\n );\n const commands = useStore(store, (state) => (live ? state.commands : undefined));\n const completion = useMemo(\n () =>\n commands && searchFiles ? { commands, searchFiles, sessions: mentionSessions, references } : suppliedCompletion,\n [commands, searchFiles, mentionSessions, references, suppliedCompletion],\n );\n const running = live ? liveRunning : suppliedRunning;\n const preset = live ? livePreset : suppliedPreset;\n const [selection, setSelection] = useState<number>();\n const [sheetOpen, setSheetOpen] = useState(false);\n const [focused, setFocused] = useState(false);\n const [clipboardImage, setClipboardImage] = useState(false);\n const [attachError, setAttachError] = useState<string>();\n const [attaching, setAttaching] = useState(false);\n const attachCapture = slotProps?.attachComposerCapture;\n const attachContext = slotProps?.attachComposerContext;\n const canPaste = focused && attachCapture !== undefined;\n // The Paste tile shows only while typing, and only when the clipboard holds an image.\n useEffect(() => {\n if (!canPaste) return;\n let live = true;\n hasImageAsync().then(\n (has) => live && setClipboardImage(has),\n // An unreadable clipboard offers nothing to paste, so hide the chip.\n () => live && setClipboardImage(false),\n );\n const subscription = addClipboardListener(({ contentTypes }) =>\n setClipboardImage(contentTypes.includes(ContentType.IMAGE)),\n );\n return () => {\n live = false;\n subscription.remove();\n };\n }, [canPaste]);\n const pasteImage = (image: { data: string } | null) => {\n if (!attachCapture) return;\n // iOS silently refuses an old copy (or a declined prompt); a fresh copy reads fine.\n if (!image)\n return setAttachError(\n t('nativeDashboard.composer.pasteUnreadable', 'Could not read the image. Copy it again, then paste.'),\n );\n try {\n attachCapture({\n data: image.data.slice(image.data.indexOf(',') + 1),\n mimeType: 'image/jpeg',\n context: {\n kind: 'image',\n source: PASTED_IMAGE_SOURCE,\n id: `paste-${Date.now()}`,\n label: 'Pasted image',\n content: 'An image pasted from the clipboard.',\n },\n });\n setAttachError(undefined);\n } catch (error) {\n setAttachError(\n error instanceof Error\n ? error.message\n : t('nativeDashboard.composer.attachImageFailed', 'Could not attach the image.'),\n );\n }\n };\n // Photos ride along as images; base64 always comes back as JPEG, even for HEIC originals.\n const pickPhotos = async () => {\n if (!attachCapture) return;\n const result = await launchImageLibraryAsync({\n mediaTypes: ['images'],\n allowsMultipleSelection: true,\n selectionLimit: MAX_CAPTURES - captures.length,\n base64: true,\n quality: 0.8,\n });\n if (result.canceled) return;\n result.assets.forEach((asset, index) => {\n if (!asset.base64) throw new Error(t('nativeDashboard.composer.photoUnreadable', 'Could not read the photo.'));\n attachCapture({\n data: asset.base64,\n mimeType: 'image/jpeg',\n context: {\n kind: 'image',\n source: PICKED_IMAGE_SOURCE,\n id: `photo-${Date.now()}-${index}`,\n label: 'Photo',\n content: 'An image attached from the photo library.',\n },\n });\n });\n };\n // Other files are stored on the host, as on web, and the message carries their path.\n const pickFile = async () => {\n if (!attachContext) return;\n if (!uploadAttachment)\n throw new Error(t('nativeDashboard.composer.attachUnavailable', 'Attaching files is not available here.'));\n const result = await getDocumentAsync({ copyToCacheDirectory: true });\n if (result.canceled) return;\n const [asset] = result.assets;\n const file = new File(asset.uri);\n if ((asset.size ?? file.size) > MAX_UPLOAD_BYTES)\n throw new Error(t('nativeDashboard.composer.fileTooLarge', 'The file is over the 8 MB upload limit.'));\n const stored = await uploadAttachment(sessionId, {\n name: asset.name,\n mimeType: asset.mimeType || 'application/octet-stream',\n bytes: await file.bytes(),\n });\n attachContext(uploadedFileContext(asset.name, stored));\n };\n const runAttach = (pick: () => Promise<void>) => {\n setAttaching(true);\n setAttachError(undefined);\n pick()\n .catch((error: unknown) =>\n setAttachError(\n error instanceof Error ? error.message : t('nativeDashboard.composer.attachFailed', 'Could not attach.'),\n ),\n )\n .finally(() => setAttaching(false));\n };\n const canAttach = Boolean(attachContext && sessionId && !disabled && !attaching);\n const canAttachPhoto = Boolean(attachCapture && captures.length < MAX_CAPTURES);\n // The Insert sheet carries these rows; the alert is the fallback when a session offers no completions.\n const attachActions = canAttach\n ? [\n ...(canAttachPhoto\n ? [\n {\n key: 'attach-photo',\n glyph: '+',\n title: t('nativeDashboard.composer.photo', 'Photo'),\n hint: t('nativeDashboard.composer.photoHint', 'Attach one from your library'),\n onPress: () => runAttach(pickPhotos),\n },\n ]\n : []),\n {\n key: 'attach-file',\n glyph: '+',\n title: t('nativeDashboard.composer.uploadFile', 'Upload a file'),\n hint: t('nativeDashboard.composer.uploadFileHint', 'Send a file from this phone'),\n onPress: () => runAttach(pickFile),\n },\n ]\n : [];\n const chooseAttachment = () =>\n Alert.alert(t('nativeDashboard.composer.attachTitle', 'Attach'), undefined, [\n ...(canAttachPhoto\n ? [{ text: t('nativeDashboard.composer.photo', 'Photo'), onPress: () => runAttach(pickPhotos) }]\n : []),\n { text: t('nativeDashboard.composer.file', 'File'), onPress: () => runAttach(pickFile) },\n { text: t('nativeDashboard.composer.cancel', 'Cancel'), style: 'cancel' as const },\n ]);\n const caret = Math.min(selection ?? text.length, text.length);\n const trigger = completion ? triggerTokenAt(text, caret) : null;\n const suggestions = useCompletionItems(completion, trigger?.kind ?? null, trigger?.query ?? '');\n const accept = (item: CompletionItem) => {\n if (!trigger) return;\n const next = `${text.slice(0, trigger.start)}${item.insert}${text.slice(caret)}`;\n setText(next);\n setSelection(trigger.start + item.insert.length);\n };\n const insert = (kind: CompletionKind, item: CompletionItem) => {\n const next = withCompletion(text, caret, kind, item);\n setText(next.text);\n setSelection(next.caret);\n };\n const canSend = !disabled && text.trim().length > 0;\n const send = () => {\n if (!canSend) return;\n if (onSend(text.trim()) === false) return;\n setText('');\n };\n const dock = (\n <View style={styles.dock}>\n {trigger && suggestions && suggestions.length > 0 ? (\n <ScrollView style={styles.suggestions} keyboardShouldPersistTaps=\"handled\">\n <CompletionRows items={suggestions} onPick={accept} />\n </ScrollView>\n ) : null}\n {/* ponytail: iOS asks \"Allow Paste\" on each tap. expo-clipboard's ClipboardPasteButton (UIPasteControl)\n skips the prompt but rendered blank on the iOS 26.5 simulator; try it again on a device. */}\n <CaptureTray\n captures={captures}\n onPaste={\n canPaste && clipboardImage && captures.length < MAX_CAPTURES\n ? () =>\n getImageAsync(PASTED_IMAGE_OPTIONS).then(pasteImage, () =>\n setAttachError(t('nativeDashboard.composer.clipboardUnreadable', 'Could not read the clipboard.')),\n )\n : undefined\n }\n onRemove={(capture) => onRemoveCapture?.(capture)}\n />\n {attachError ? <Text style={styles.attachError}>{attachError}</Text> : null}\n <View style={quiet ? styles.box : styles.plain}>\n <Textarea\n style={quiet ? styles.quietInput : styles.input}\n value={text}\n onChangeText={setText}\n onSelectionChange={(event) => setSelection(event.nativeEvent.selection.end)}\n onFocus={() => setFocused(true)}\n onBlur={() => {\n setFocused(false);\n setAttachError(undefined);\n }}\n placeholder={\n quiet\n ? running\n ? t('nativeDashboard.composer.placeholderInterrupt', 'Interrupt the run and respond…')\n : t('nativeDashboard.composer.placeholderQuiet', 'Ask anything…')\n : running\n ? t('nativeDashboard.composer.placeholderSteer', 'Steer the run, or queue a reply...')\n : t('nativeDashboard.composer.placeholder', 'Ask anything · / commands · $ skills · @ files')\n }\n accessibilityLabel={t('nativeDashboard.composer.message', 'Message')}\n disabled={disabled}\n autoFocus={autoFocus}\n />\n <View style={styles.row}>\n {!completion && attachContext && sessionId && !disabled ? (\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel={\n attaching\n ? t('nativeDashboard.composer.attaching', 'Attaching')\n : t('nativeDashboard.composer.attach', 'Attach a photo or file')\n }\n accessibilityState={{ busy: attaching, disabled: attaching }}\n disabled={attaching}\n onPress={chooseAttachment}\n hitSlop={6}\n style={({ pressed }) => [styles.attach, (pressed || attaching) && styles.pressed]}\n >\n <PlusIcon size={16} color=\"green\" />\n </Pressable>\n ) : null}\n {completion ? <CompletionButton onPress={() => setSheetOpen(true)} /> : null}\n {onOpenOptions ? (\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel={t('nativeDashboard.composer.options', 'Session options, {preset}', {\n preset: preset ?? t('nativeDashboard.composer.presetFallback', 'preset'),\n })}\n onPress={onOpenOptions}\n style={({ pressed }) => [styles.options, pressed && styles.pressed]}\n >\n <Text style={styles.optionsText} numberOfLines={1}>\n {preset || t('nativeDashboard.composer.optionsShort', 'Options')}\n </Text>\n <ChevronDownIcon size={12} color=\"green\" />\n </Pressable>\n ) : null}\n <View style={styles.flex} />\n {/* Plugin actions, such as voice dictation, sit beside Send. */}\n {slotProps\n ? slotFills(HOST_SLOTS.composerActions, slotProps.sessionId).map(({ pluginId, id, component: Action }) =>\n Action ? <Action key={`${pluginId}:${id}`} {...slotProps} /> : null,\n )\n : null}\n {/* An icon, so Abort and Steer both fit beside the meter and dictation on a phone. */}\n {running && onAbort ? (\n <Button\n variant=\"danger-outline\"\n size=\"icon-md\"\n onPress={onAbort}\n accessibilityLabel={t('nativeDashboard.composer.abort', 'Abort the run')}\n >\n <StopIcon size={16} color=\"red\" />\n </Button>\n ) : null}\n {quiet ? (\n <Button\n variant=\"primary\"\n size=\"icon-md\"\n onPress={send}\n disabled={!canSend}\n accessibilityLabel={\n running ? t('nativeDashboard.composer.steer', 'Steer') : t('nativeDashboard.composer.send', 'Send')\n }\n >\n <SendIcon size={16} color=\"on-selected\" />\n </Button>\n ) : (\n <Button\n variant=\"primary\"\n size=\"md\"\n onPress={send}\n disabled={!canSend}\n accessibilityLabel={\n running ? t('nativeDashboard.composer.steer', 'Steer') : t('nativeDashboard.composer.send', 'Send')\n }\n >\n <View style={styles.send}>\n <SendIcon size={14} color=\"on-selected\" />\n <Text style={styles.sendText}>\n {running ? t('nativeDashboard.composer.steer', 'Steer') : t('nativeDashboard.composer.send', 'Send')}\n </Text>\n </View>\n </Button>\n )}\n </View>\n </View>\n {completion ? (\n <CompletionSheet\n open={sheetOpen}\n onOpenChange={setSheetOpen}\n source={completion}\n onPick={insert}\n slotProps={slotProps}\n actions={attachActions}\n />\n ) : null}\n </View>\n );\n // A person's own package may wrap the composer on the phone as in the cockpit.\n return slotProps ? renderRegion(HOST_SLOTS.composerRegion, dock, slotProps, slotProps.sessionId) : dock;\n}\n\nconst styles = StyleSheet.create((theme, rt) => {\n const sans = fontOf(theme.fontFamily.sans);\n return {\n flex: { flex: 1 },\n dock: {\n gap: theme.spacing(2),\n paddingHorizontal: theme.spacing(3),\n paddingTop: theme.spacing(2),\n // Clears the home indicator; the keyboard covers that edge while it is open.\n paddingBottom: theme.spacing(2) + (rt.insets.ime > 0 ? 0 : rt.insets.bottom),\n backgroundColor: theme.colors.bg,\n },\n input: {\n minHeight: 48,\n maxHeight: theme.spacing(32),\n paddingHorizontal: theme.spacing(4),\n paddingVertical: theme.spacing(3),\n // Like the cockpit composer: an outline, no fill.\n borderRadius: 22,\n borderWidth: 1,\n borderColor: theme.colors.border,\n backgroundColor: 'transparent',\n color: theme.colors.text,\n fontSize: theme.fontSize.lg,\n lineHeight: theme.lineHeight.lg,\n },\n plain: { gap: theme.spacing(2) },\n box: {\n gap: theme.spacing(1),\n paddingHorizontal: theme.spacing(3),\n paddingTop: theme.spacing(1),\n paddingBottom: theme.spacing(2),\n borderRadius: 22,\n borderWidth: 1,\n borderColor: theme.colors.border,\n },\n quietInput: {\n minHeight: 44,\n maxHeight: theme.spacing(32),\n paddingHorizontal: theme.spacing(1),\n paddingVertical: theme.spacing(2),\n borderWidth: 0,\n backgroundColor: 'transparent',\n color: theme.colors.text,\n fontSize: theme.fontSize.lg,\n lineHeight: theme.lineHeight.lg,\n },\n suggestions: { maxHeight: 4 * 56, flexGrow: 0 },\n row: { flexDirection: 'row', alignItems: 'center', gap: theme.spacing(2) },\n options: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: theme.spacing(1.5),\n height: 32,\n maxWidth: 170,\n flexShrink: 1,\n paddingHorizontal: theme.spacing(3),\n borderRadius: 16,\n backgroundColor: theme.colors['tint-green'],\n },\n pressed: { opacity: 0.7 },\n attach: {\n width: 32,\n height: 32,\n borderRadius: 16,\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: theme.colors['tint-green'],\n },\n optionsText: {\n fontFamily: sans,\n fontSize: theme.fontSize.base,\n lineHeight: theme.lineHeight.base,\n fontWeight: theme.fontWeight.semibold,\n color: theme.colors.green,\n flexShrink: 1,\n },\n attachError: {\n fontFamily: sans,\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeight.sm,\n color: theme.colors.red,\n },\n send: { flexDirection: 'row', alignItems: 'center', gap: theme.spacing(1.5) },\n sendText: {\n fontFamily: sans,\n fontSize: theme.fontSize.base,\n lineHeight: theme.lineHeight.base,\n fontWeight: theme.fontWeight.semibold,\n color: theme.colors['on-selected'],\n },\n };\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA2CA,MAAM2C,uBAAwC;CAAEC,QAAQ;CAAQC,aAAa;AAAI;AAEjF,MAAMC,eAAe;AAErB,MAAMC,mBAAmB;AACzB,MAAMC,cAA0C,CAAA;AAChD,MAAMC,oBAAoB,IAAI7B,MAA8B,CAAC,CAAC;;AA2C9D,SAASkE,eAAejC,MAAckC,OAAeC,MAAsBC,MAAsB;CAC/F,IAAID,SAAS,QAAQ;EACnB,MAAME,OAAOrC,KAAKsC,QAAQ,gBAAgB,EAAE;EAC5C,OAAO;GAAEtC,MAAM,GAAGoC,KAAKG,SAASF;GAAQH,OAAOE,KAAKG,OAAOC;EAAO;CACpE;CACA,MAAMC,SAASzC,KAAK0C,MAAM,GAAGR,KAAK;CAClC,MAAMS,QAAQF,WAAW,MAAM,OAAOG,KAAKH,MAAM,IAAI,KAAK;CAC1D,OAAO;EACLzC,MAAM,GAAGyC,SAASE,QAAQP,KAAKG,SAASvC,KAAK0C,MAAMR,KAAK;EACxDA,OAAOO,OAAOD,SAASG,MAAMH,SAASJ,KAAKG,OAAOC;CACpD;AACF;;AAGA,SAAgBK,SAAS,EACvB9C,QACAE,WAAW,OACXC,cAAc,IACdC,OACAC,cACAkB,SAASwB,kBAAkB,OAC3BvB,SACAC,QAAQuB,gBACRtB,eACAC,YAAYsB,oBACZ3C,YACAC,YAAY,IACZC,OAAO,OACPC,aACAI,iBACAD,YACAE,kBACAc,WACAC,WAAWjC,aACXkC,iBACAE,OACAC,aACgB;CAChBnE,eAAe,UAAU;CACzB,MAAM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,CAAA;EAAC;EACzE1B,SAAS;GACPuC,eAAe;GACfC,YAAY;GACZzB,KAAKJ,MAAMK,QAAQ,GAAG;GACtByB,QAAQ;GACRC,UAAU;GACVC,YAAY;GACZ1B,mBAAmBN,MAAMK,QAAQ,CAAC;GAClCc,cAAc;GACdP,iBAAiBZ,MAAMa,OAAO;GAAaE,mBAAA,CAAA,CAAA;EAC7C;EACA5B,SAAS,EAAE8C,SAAS,GAAI;EACxB7C,QAAQ;GACN8C,OAAO;GACPJ,QAAQ;GACRX,cAAc;GACdU,YAAY;GACZM,gBAAgB;GAChBvB,iBAAiBZ,MAAMa,OAAO;GAAaE,mBAAA,CAAA,CAAA;EAC7C;EACAzB,aAAa;GACXa,YAAYD;GACZsB,UAAUxB,MAAMwB,SAASY;GACzBV,YAAY1B,MAAM0B,WAAWU;GAC7BC,YAAYrC,MAAMqC,WAAWC;GAC7Bf,OAAOvB,MAAMa,OAAO0B;GACpBP,YAAY;GAACjB,mBAAA,CAAA,CAAA;EACf;EACA/G,aAAa;GACXmG,YAAYD;GACZsB,UAAUxB,MAAMwB,SAASgB;GACzBd,YAAY1B,MAAM0B,WAAWc;GAC7BjB,OAAOvB,MAAMa,OAAO4B;GAAG1B,mBAAA,CAAA,CAAA;EACzB;EACAxC,MAAM;GAAEqD,eAAe;GAAOC,YAAY;GAAUzB,KAAKJ,MAAMK,QAAQ,GAAG;GAACU,mBAAA,CAAA,CAAA;EAAC;EAC5ElB,UAAU;GACRM,YAAYD;GACZsB,UAAUxB,MAAMwB,SAASY;GACzBV,YAAY1B,MAAM0B,WAAWU;GAC7BC,YAAYrC,MAAMqC,WAAWC;GAC7Bf,OAAOvB,MAAMa,OAAO;GAAcE,mBAAA,CAAA,CAAA;EACpC;CACF;AACF,CAAC"}
1
+ {"version":3,"file":"Composer.mjs","names":["useT","ComposerCapture","WebPluginSlotProps","Button","ChevronDownIcon","fontOf","PlusIcon","SendIcon","StopIcon","Textarea","CompletionItem","CompletionKind","HOST_SLOTS","renderRegion","slotFills","triggerTokenAt","sessionStoreFor","parseSelection","useRenderTrace","useStore","Store","addClipboardListener","ContentType","GetImageOptions","getImageAsync","hasImageAsync","getDocumentAsync","File","launchImageLibraryAsync","useEffect","useMemo","useState","Alert","StyleSheet","CaptureTray","CompletionButton","CompletionRows","CompletionSheet","CompletionSource","useCompletionItems","PASTED_IMAGE_SOURCE","PICKED_IMAGE_SOURCE","uploadedFileContext","PASTED_IMAGE_OPTIONS","format","jpegQuality","MAX_CAPTURES","MAX_UPLOAD_BYTES","NO_CAPTURES","EMPTY_DRAFT_STORE","Record","ComposerProps","onSend","text","disabled","initialText","value","onChangeText","draftStore","sessionId","live","searchFiles","query","Promise","references","mentionSessions","uploadAttachment","file","name","mimeType","bytes","Uint8Array","ArrayBuffer","path","size","running","onAbort","preset","onOpenOptions","completion","slotProps","captures","onRemoveCapture","capture","quiet","autoFocus","withCompletion","caret","kind","item","rest","replace","insert","length","before","slice","space","test","Composer","suppliedRunning","suppliedPreset","suppliedCompletion","t","localText","setLocalText","storedText","state","setText","next","setState","store","liveRunning","streaming","livePreset","statuses","undefined","commands","sessions","selection","setSelection","sheetOpen","setSheetOpen","focused","setFocused","clipboardImage","setClipboardImage","attachError","setAttachError","attaching","setAttaching","attachCapture","attachComposerCapture","attachContext","attachComposerContext","canPaste","then","has","subscription","contentTypes","includes","IMAGE","remove","pasteImage","image","data","indexOf","context","source","id","Date","now","label","content","error","Error","message","pickPhotos","result","mediaTypes","allowsMultipleSelection","selectionLimit","base64","quality","canceled","assets","forEach","asset","index","pickFile","copyToCacheDirectory","uri","stored","runAttach","pick","catch","finally","canAttach","Boolean","canAttachPhoto","attachActions","key","glyph","title","hint","onPress","chooseAttachment","alert","style","const","Math","min","trigger","suggestions","accept","start","canSend","trim","send","dock","styles","box","plain","quietInput","input","event","nativeEvent","end","row","busy","pressed","attach","options","optionsText","flex","composerActions","map","pluginId","component","Action","sendText","composerRegion","create","theme","rt","sans","fontFamily","gap","spacing","paddingHorizontal","paddingTop","paddingBottom","insets","ime","bottom","backgroundColor","colors","bg","uni__dependencies","minHeight","maxHeight","paddingVertical","borderRadius","borderWidth","borderColor","border","color","fontSize","lg","lineHeight","flexGrow","flexDirection","alignItems","height","maxWidth","flexShrink","opacity","width","justifyContent","base","fontWeight","semibold","green","sm","red"],"sources":["../../src/components/Composer.tsx"],"sourcesContent":["import { useT } from '@agimon-ai/po-core/native';\nimport type { ComposerCapture, WebPluginSlotProps } from '@agimon-ai/po-core/web';\nimport {\n Button,\n ChevronDownIcon,\n fontOf,\n PlusIcon,\n SendIcon,\n StopIcon,\n Textarea,\n} from '@agimon-ai/po-native-components';\nimport {\n type CompletionItem,\n type CompletionKind,\n HOST_SLOTS,\n renderRegion,\n slotFills,\n triggerTokenAt,\n sessionStoreFor,\n parseSelection,\n useRenderTrace,\n} from '@agimon-ai/po-web-dashboard/core';\nimport { useStore } from '@tanstack/react-store';\nimport { Store } from '@tanstack/store';\nimport { addClipboardListener, ContentType, type GetImageOptions, getImageAsync, hasImageAsync } from 'expo-clipboard';\nimport { getDocumentAsync } from 'expo-document-picker';\nimport { File } from 'expo-file-system';\nimport { launchImageLibraryAsync } from 'expo-image-picker';\nimport { useEffect, useMemo, useState } from 'react';\nimport { Alert, Pressable, ScrollView, Text, View } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport { CaptureTray } from './CaptureTray';\nimport {\n CompletionButton,\n CompletionRows,\n CompletionSheet,\n type CompletionSource,\n useCompletionItems,\n} from './CompletionSheet';\nimport { PASTED_IMAGE_SOURCE, PICKED_IMAGE_SOURCE, uploadedFileContext } from './slotProps';\n\n// JPEG keeps a pasted photo well under the 10 MB image limit; screenshots stay readable.\nconst PASTED_IMAGE_OPTIONS: GetImageOptions = { format: 'jpeg', jpegQuality: 0.8 };\n// ponytail: the attachment budget (stageNativeCapture) fits four images with no other context; the error covers less.\nconst MAX_CAPTURES = 4;\n// The host's upload limit; checked before reading so a huge file never loads into memory.\nconst MAX_UPLOAD_BYTES = 8 * 1024 * 1024;\nconst NO_CAPTURES: readonly ComposerCapture[] = [];\nconst EMPTY_DRAFT_STORE = new Store<Record<string, string>>({});\nexport interface ComposerProps {\n /** Returning false means it was not sent, so the draft stays. */\n onSend: (text: string) => boolean | void;\n disabled?: boolean;\n initialText?: string;\n /** A session host may retain the draft while a prompt temporarily replaces this composer. */\n value?: string;\n onChangeText?: (text: string) => void;\n draftStore?: Store<Record<string, string>>;\n sessionId?: string;\n /** Runtime controls subscribe here, outside the navigator and transcript. */\n live?: boolean;\n searchFiles?: (query: string) => Promise<string[]>;\n /** References plugins offer before workspace files. */\n references?: CompletionSource['references'];\n /** Sessions `@` may name, offered before files. */\n mentionSessions?: CompletionSource['sessions'];\n /** Stores a picked file on the host and returns its path; without it the File option reports it is unavailable. */\n uploadAttachment?: (\n sessionId: string,\n file: { name: string; mimeType: string; bytes: Uint8Array<ArrayBuffer> },\n ) => Promise<{ path: string; mimeType: string; size: number }>;\n /** A run is in progress: Send steers it and Abort stops it. */\n running?: boolean;\n onAbort?: () => void;\n /** The current preset, shown on the options button. */\n preset?: string;\n onOpenOptions?: () => void;\n /** Offers `@` files, `$` skills and `/` commands while typing and from the insert button. */\n completion?: CompletionSource;\n /** The session's plugin props, so plugin pages can join the insert sheet. */\n slotProps?: WebPluginSlotProps;\n /** Images staged for the next message, shown as thumbnails above the text box. */\n captures?: readonly ComposerCapture[];\n onRemoveCapture?: (capture: ComposerCapture) => void;\n /** One outlined box holding the text and its controls, with an icon Send; absent keeps the default layout. */\n quiet?: boolean;\n /** Focuses the text box on mount, such as when a conversation sheet opens to be typed in. */\n autoFocus?: boolean;\n}\n\n/** The draft with a picked item in place: commands and skills lead the message, files go where the caret is. */\nfunction withCompletion(text: string, caret: number, kind: CompletionKind, item: CompletionItem) {\n if (kind !== 'file') {\n const rest = text.replace(/^[/$]\\S*\\s*/u, '');\n return { text: `${item.insert}${rest}`, caret: item.insert.length };\n }\n const before = text.slice(0, caret);\n const space = before === '' || /\\s$/u.test(before) ? '' : ' ';\n return {\n text: `${before}${space}${item.insert}${text.slice(caret)}`,\n caret: before.length + space.length + item.insert.length,\n };\n}\n\n/** The text box, then the options button and Send in one row outside it. Context and cost sit in the options sheet. */\nexport function Composer({\n onSend,\n disabled = false,\n initialText = '',\n value,\n onChangeText,\n running: suppliedRunning = false,\n onAbort,\n preset: suppliedPreset,\n onOpenOptions,\n completion: suppliedCompletion,\n draftStore,\n sessionId = '',\n live = false,\n searchFiles,\n mentionSessions,\n references,\n uploadAttachment,\n slotProps,\n captures = NO_CAPTURES,\n onRemoveCapture,\n quiet,\n autoFocus,\n}: ComposerProps) {\n useRenderTrace('Composer');\n const t = useT();\n const [localText, setLocalText] = useState(initialText);\n const storedText = useStore(draftStore ?? EMPTY_DRAFT_STORE, (state) => state[sessionId] ?? initialText);\n const text = draftStore ? storedText : (value ?? localText);\n const setText = draftStore\n ? (next: string) =>\n draftStore.setState((state) => (state[sessionId] === next ? state : { ...state, [sessionId]: next }))\n : (onChangeText ?? setLocalText);\n const store = sessionStoreFor(sessionId);\n const liveRunning = useStore(store, (state) => live && state.streaming);\n const livePreset = useStore(store, (state) =>\n live ? parseSelection(state.statuses['po-preset'] ?? '').preset : undefined,\n );\n const commands = useStore(store, (state) => (live ? state.commands : undefined));\n const completion = useMemo(\n () =>\n commands && searchFiles ? { commands, searchFiles, sessions: mentionSessions, references } : suppliedCompletion,\n [commands, searchFiles, mentionSessions, references, suppliedCompletion],\n );\n const running = live ? liveRunning : suppliedRunning;\n const preset = live ? livePreset : suppliedPreset;\n const [selection, setSelection] = useState<number>();\n const [sheetOpen, setSheetOpen] = useState(false);\n const [focused, setFocused] = useState(false);\n const [clipboardImage, setClipboardImage] = useState(false);\n const [attachError, setAttachError] = useState<string>();\n const [attaching, setAttaching] = useState(false);\n const attachCapture = slotProps?.attachComposerCapture;\n const attachContext = slotProps?.attachComposerContext;\n const canPaste = focused && attachCapture !== undefined;\n // The Paste tile shows only while typing, and only when the clipboard holds an image.\n useEffect(() => {\n if (!canPaste) return;\n let live = true;\n hasImageAsync().then(\n (has) => live && setClipboardImage(has),\n // An unreadable clipboard offers nothing to paste, so hide the chip.\n () => live && setClipboardImage(false),\n );\n const subscription = addClipboardListener(({ contentTypes }) =>\n setClipboardImage(contentTypes.includes(ContentType.IMAGE)),\n );\n return () => {\n live = false;\n subscription.remove();\n };\n }, [canPaste]);\n const pasteImage = (image: { data: string } | null) => {\n if (!attachCapture) return;\n // iOS silently refuses an old copy (or a declined prompt); a fresh copy reads fine.\n if (!image)\n return setAttachError(\n t('nativeDashboard.composer.pasteUnreadable', 'Could not read the image. Copy it again, then paste.'),\n );\n try {\n attachCapture({\n data: image.data.slice(image.data.indexOf(',') + 1),\n mimeType: 'image/jpeg',\n context: {\n kind: 'image',\n source: PASTED_IMAGE_SOURCE,\n id: `paste-${Date.now()}`,\n label: t('nativeDashboard.composer.pastedImage', 'Pasted image'),\n content: 'An image pasted from the clipboard.',\n },\n });\n setAttachError(undefined);\n } catch (error) {\n setAttachError(\n error instanceof Error\n ? error.message\n : t('nativeDashboard.composer.attachImageFailed', 'Could not attach the image.'),\n );\n }\n };\n // Photos ride along as images; base64 always comes back as JPEG, even for HEIC originals.\n const pickPhotos = async () => {\n if (!attachCapture) return;\n const result = await launchImageLibraryAsync({\n mediaTypes: ['images'],\n allowsMultipleSelection: true,\n selectionLimit: MAX_CAPTURES - captures.length,\n base64: true,\n quality: 0.8,\n });\n if (result.canceled) return;\n result.assets.forEach((asset, index) => {\n if (!asset.base64) throw new Error(t('nativeDashboard.composer.photoUnreadable', 'Could not read the photo.'));\n attachCapture({\n data: asset.base64,\n mimeType: 'image/jpeg',\n context: {\n kind: 'image',\n source: PICKED_IMAGE_SOURCE,\n id: `photo-${Date.now()}-${index}`,\n label: t('nativeDashboard.composer.photo', 'Photo'),\n content: 'An image attached from the photo library.',\n },\n });\n });\n };\n // Other files are stored on the host, as on web, and the message carries their path.\n const pickFile = async () => {\n if (!attachContext) return;\n if (!uploadAttachment)\n throw new Error(t('nativeDashboard.composer.attachUnavailable', 'Attaching files is not available here.'));\n const result = await getDocumentAsync({ copyToCacheDirectory: true });\n if (result.canceled) return;\n const [asset] = result.assets;\n const file = new File(asset.uri);\n if ((asset.size ?? file.size) > MAX_UPLOAD_BYTES)\n throw new Error(t('nativeDashboard.composer.fileTooLarge', 'The file is over the 8 MB upload limit.'));\n const stored = await uploadAttachment(sessionId, {\n name: asset.name,\n mimeType: asset.mimeType || 'application/octet-stream',\n bytes: await file.bytes(),\n });\n attachContext(uploadedFileContext(asset.name, stored));\n };\n const runAttach = (pick: () => Promise<void>) => {\n setAttaching(true);\n setAttachError(undefined);\n pick()\n .catch((error: unknown) =>\n setAttachError(\n error instanceof Error ? error.message : t('nativeDashboard.composer.attachFailed', 'Could not attach.'),\n ),\n )\n .finally(() => setAttaching(false));\n };\n const canAttach = Boolean(attachContext && sessionId && !disabled && !attaching);\n const canAttachPhoto = Boolean(attachCapture && captures.length < MAX_CAPTURES);\n // The Insert sheet carries these rows; the alert is the fallback when a session offers no completions.\n const attachActions = canAttach\n ? [\n ...(canAttachPhoto\n ? [\n {\n key: 'attach-photo',\n glyph: '+',\n title: t('nativeDashboard.composer.photo', 'Photo'),\n hint: t('nativeDashboard.composer.photoHint', 'Attach one from your library'),\n onPress: () => runAttach(pickPhotos),\n },\n ]\n : []),\n {\n key: 'attach-file',\n glyph: '+',\n title: t('nativeDashboard.composer.uploadFile', 'Upload a file'),\n hint: t('nativeDashboard.composer.uploadFileHint', 'Send a file from this phone'),\n onPress: () => runAttach(pickFile),\n },\n ]\n : [];\n const chooseAttachment = () =>\n Alert.alert(t('nativeDashboard.composer.attachTitle', 'Attach'), undefined, [\n ...(canAttachPhoto\n ? [{ text: t('nativeDashboard.composer.photo', 'Photo'), onPress: () => runAttach(pickPhotos) }]\n : []),\n { text: t('nativeDashboard.composer.file', 'File'), onPress: () => runAttach(pickFile) },\n { text: t('nativeDashboard.composer.cancel', 'Cancel'), style: 'cancel' as const },\n ]);\n const caret = Math.min(selection ?? text.length, text.length);\n const trigger = completion ? triggerTokenAt(text, caret) : null;\n const suggestions = useCompletionItems(completion, trigger?.kind ?? null, trigger?.query ?? '');\n const accept = (item: CompletionItem) => {\n if (!trigger) return;\n const next = `${text.slice(0, trigger.start)}${item.insert}${text.slice(caret)}`;\n setText(next);\n setSelection(trigger.start + item.insert.length);\n };\n const insert = (kind: CompletionKind, item: CompletionItem) => {\n const next = withCompletion(text, caret, kind, item);\n setText(next.text);\n setSelection(next.caret);\n };\n const canSend = !disabled && text.trim().length > 0;\n const send = () => {\n if (!canSend) return;\n if (onSend(text.trim()) === false) return;\n setText('');\n };\n const dock = (\n <View style={styles.dock}>\n {trigger && suggestions && suggestions.length > 0 ? (\n <ScrollView style={styles.suggestions} keyboardShouldPersistTaps=\"handled\">\n <CompletionRows items={suggestions} onPick={accept} />\n </ScrollView>\n ) : null}\n {/* ponytail: iOS asks \"Allow Paste\" on each tap. expo-clipboard's ClipboardPasteButton (UIPasteControl)\n skips the prompt but rendered blank on the iOS 26.5 simulator; try it again on a device. */}\n <CaptureTray\n captures={captures}\n onPaste={\n canPaste && clipboardImage && captures.length < MAX_CAPTURES\n ? () =>\n getImageAsync(PASTED_IMAGE_OPTIONS).then(pasteImage, () =>\n setAttachError(t('nativeDashboard.composer.clipboardUnreadable', 'Could not read the clipboard.')),\n )\n : undefined\n }\n onRemove={(capture) => onRemoveCapture?.(capture)}\n />\n {attachError ? <Text style={styles.attachError}>{attachError}</Text> : null}\n <View style={quiet ? styles.box : styles.plain}>\n <Textarea\n style={quiet ? styles.quietInput : styles.input}\n value={text}\n onChangeText={setText}\n onSelectionChange={(event) => setSelection(event.nativeEvent.selection.end)}\n onFocus={() => setFocused(true)}\n onBlur={() => {\n setFocused(false);\n setAttachError(undefined);\n }}\n placeholder={\n quiet\n ? running\n ? t('nativeDashboard.composer.placeholderInterrupt', 'Interrupt the run and respond…')\n : t('nativeDashboard.composer.placeholderQuiet', 'Ask anything…')\n : running\n ? t('nativeDashboard.composer.placeholderSteer', 'Steer the run, or queue a reply...')\n : t('nativeDashboard.composer.placeholder', 'Ask anything · / commands · $ skills · @ files')\n }\n accessibilityLabel={t('nativeDashboard.composer.message', 'Message')}\n disabled={disabled}\n autoFocus={autoFocus}\n />\n <View style={styles.row}>\n {!completion && attachContext && sessionId && !disabled ? (\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel={\n attaching\n ? t('nativeDashboard.composer.attaching', 'Attaching')\n : t('nativeDashboard.composer.attach', 'Attach a photo or file')\n }\n accessibilityState={{ busy: attaching, disabled: attaching }}\n disabled={attaching}\n onPress={chooseAttachment}\n hitSlop={6}\n style={({ pressed }) => [styles.attach, (pressed || attaching) && styles.pressed]}\n >\n <PlusIcon size={16} color=\"green\" />\n </Pressable>\n ) : null}\n {completion ? <CompletionButton onPress={() => setSheetOpen(true)} /> : null}\n {onOpenOptions ? (\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel={t('nativeDashboard.composer.options', 'Session options, {preset}', {\n preset: preset ?? t('nativeDashboard.composer.presetFallback', 'preset'),\n })}\n onPress={onOpenOptions}\n style={({ pressed }) => [styles.options, pressed && styles.pressed]}\n >\n <Text style={styles.optionsText} numberOfLines={1}>\n {preset || t('nativeDashboard.composer.optionsShort', 'Options')}\n </Text>\n <ChevronDownIcon size={12} color=\"green\" />\n </Pressable>\n ) : null}\n <View style={styles.flex} />\n {/* Plugin actions, such as voice dictation, sit beside Send. */}\n {slotProps\n ? slotFills(HOST_SLOTS.composerActions, slotProps.sessionId).map(({ pluginId, id, component: Action }) =>\n Action ? <Action key={`${pluginId}:${id}`} {...slotProps} /> : null,\n )\n : null}\n {/* An icon, so Abort and Steer both fit beside the meter and dictation on a phone. */}\n {running && onAbort ? (\n <Button\n variant=\"danger-outline\"\n size=\"icon-md\"\n onPress={onAbort}\n accessibilityLabel={t('nativeDashboard.composer.abort', 'Abort the run')}\n >\n <StopIcon size={16} color=\"red\" />\n </Button>\n ) : null}\n {quiet ? (\n <Button\n variant=\"primary\"\n size=\"icon-md\"\n onPress={send}\n disabled={!canSend}\n accessibilityLabel={\n running ? t('nativeDashboard.composer.steer', 'Steer') : t('nativeDashboard.composer.send', 'Send')\n }\n >\n <SendIcon size={16} color=\"on-selected\" />\n </Button>\n ) : (\n <Button\n variant=\"primary\"\n size=\"md\"\n onPress={send}\n disabled={!canSend}\n accessibilityLabel={\n running ? t('nativeDashboard.composer.steer', 'Steer') : t('nativeDashboard.composer.send', 'Send')\n }\n >\n <View style={styles.send}>\n <SendIcon size={14} color=\"on-selected\" />\n <Text style={styles.sendText}>\n {running ? t('nativeDashboard.composer.steer', 'Steer') : t('nativeDashboard.composer.send', 'Send')}\n </Text>\n </View>\n </Button>\n )}\n </View>\n </View>\n {completion ? (\n <CompletionSheet\n open={sheetOpen}\n onOpenChange={setSheetOpen}\n source={completion}\n onPick={insert}\n slotProps={slotProps}\n actions={attachActions}\n />\n ) : null}\n </View>\n );\n // A person's own package may wrap the composer on the phone as in the cockpit.\n return slotProps ? renderRegion(HOST_SLOTS.composerRegion, dock, slotProps, slotProps.sessionId) : dock;\n}\n\nconst styles = StyleSheet.create((theme, rt) => {\n const sans = fontOf(theme.fontFamily.sans);\n return {\n flex: { flex: 1 },\n dock: {\n gap: theme.spacing(2),\n paddingHorizontal: theme.spacing(3),\n paddingTop: theme.spacing(2),\n // Clears the home indicator; the keyboard covers that edge while it is open.\n paddingBottom: theme.spacing(2) + (rt.insets.ime > 0 ? 0 : rt.insets.bottom),\n backgroundColor: theme.colors.bg,\n },\n input: {\n minHeight: 48,\n maxHeight: theme.spacing(32),\n paddingHorizontal: theme.spacing(4),\n paddingVertical: theme.spacing(3),\n // Like the cockpit composer: an outline, no fill.\n borderRadius: 22,\n borderWidth: 1,\n borderColor: theme.colors.border,\n backgroundColor: 'transparent',\n color: theme.colors.text,\n fontSize: theme.fontSize.lg,\n lineHeight: theme.lineHeight.lg,\n },\n plain: { gap: theme.spacing(2) },\n box: {\n gap: theme.spacing(1),\n paddingHorizontal: theme.spacing(3),\n paddingTop: theme.spacing(1),\n paddingBottom: theme.spacing(2),\n borderRadius: 22,\n borderWidth: 1,\n borderColor: theme.colors.border,\n },\n quietInput: {\n minHeight: 44,\n maxHeight: theme.spacing(32),\n paddingHorizontal: theme.spacing(1),\n paddingVertical: theme.spacing(2),\n borderWidth: 0,\n backgroundColor: 'transparent',\n color: theme.colors.text,\n fontSize: theme.fontSize.lg,\n lineHeight: theme.lineHeight.lg,\n },\n suggestions: { maxHeight: 4 * 56, flexGrow: 0 },\n row: { flexDirection: 'row', alignItems: 'center', gap: theme.spacing(2) },\n options: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: theme.spacing(1.5),\n height: 32,\n maxWidth: 170,\n flexShrink: 1,\n paddingHorizontal: theme.spacing(3),\n borderRadius: 16,\n backgroundColor: theme.colors['tint-green'],\n },\n pressed: { opacity: 0.7 },\n attach: {\n width: 32,\n height: 32,\n borderRadius: 16,\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: theme.colors['tint-green'],\n },\n optionsText: {\n fontFamily: sans,\n fontSize: theme.fontSize.base,\n lineHeight: theme.lineHeight.base,\n fontWeight: theme.fontWeight.semibold,\n color: theme.colors.green,\n flexShrink: 1,\n },\n attachError: {\n fontFamily: sans,\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeight.sm,\n color: theme.colors.red,\n },\n send: { flexDirection: 'row', alignItems: 'center', gap: theme.spacing(1.5) },\n sendText: {\n fontFamily: sans,\n fontSize: theme.fontSize.base,\n lineHeight: theme.lineHeight.base,\n fontWeight: theme.fontWeight.semibold,\n color: theme.colors['on-selected'],\n },\n };\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA2CA,MAAM2C,uBAAwC;CAAEC,QAAQ;CAAQC,aAAa;AAAI;AAEjF,MAAMC,eAAe;AAErB,MAAMC,mBAAmB;AACzB,MAAMC,cAA0C,CAAA;AAChD,MAAMC,oBAAoB,IAAI7B,MAA8B,C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,CAAA;EAC7C;EACAzB,aAAa;GACXa,YAAYD;GACZsB,UAAUxB,MAAMwB,SAASY;GACzBV,YAAY1B,MAAM0B,WAAWU;GAC7BC,YAAYrC,MAAMqC,WAAWC;GAC7Bf,OAAOvB,MAAMa,OAAO0B;GACpBP,YAAY;GAACjB,mBAAA,CAAA,CAAA;EACf;EACA/G,aAAa;GACXmG,YAAYD;GACZsB,UAAUxB,MAAMwB,SAASgB;GACzBd,YAAY1B,MAAM0B,WAAWc;GAC7BjB,OAAOvB,MAAMa,OAAO4B;GAAG1B,mBAAA,CAAA,CAAA;EACzB;EACAxC,MAAM;GAAEqD,eAAe;GAAOC,YAAY;GAAUzB,KAAKJ,MAAMK,QAAQ,GAAG;GAACU,mBAAA,CAAA,CAAA;EAAC;EAC5ElB,UAAU;GACRM,YAAYD;GACZsB,UAAUxB,MAAMwB,SAASY;GACzBV,YAAY1B,MAAM0B,WAAWU;GAC7BC,YAAYrC,MAAMqC,WAAWC;GAC7Bf,OAAOvB,MAAMa,OAAO;GAAcE,mBAAA,CAAA,CAAA;EACpC;CACF;AACF,CAAC"}
@@ -36,8 +36,8 @@ export interface TimelineItemProps {
36
36
  renderTool?: (entry: TimelineEntry$1) => ReactNode | null;
37
37
  /** Opens the actions for one of the person's own messages; absent leaves them plain text. */
38
38
  onMessageActions?: (entry: TimelineEntry$1) => void;
39
- /** Loads the images a reply names and opens the files it links. */
40
- markdown?: Pick<MarkdownProps, 'loadImage' | 'onFileLink'>;
39
+ /** Loads the images a reply names, opens the files it links and draws its references. */
40
+ markdown?: Pick<MarkdownProps, 'loadImage' | 'onFileLink' | 'renderReference'>;
41
41
  }
42
42
  /** One transcript entry in the cockpit's layout, sized for a phone. */
43
43
  export declare function TimelineItem({ entry, renderTool, onMessageActions, markdown, loadParticipantAvatar }: TimelineItemProps): import("react").JSX.Element;
@@ -136,7 +136,8 @@ function TimelineItem({ entry, renderTool, onMessageActions, markdown, loadParti
136
136
  })
137
137
  }), /* @__PURE__ */ jsx(LinkText, {
138
138
  text: entry.text,
139
- style: styles.noticeText(error)
139
+ style: styles.noticeText(error),
140
+ renderReference: markdown?.renderReference
140
141
  })]
141
142
  });
142
143
  }
@@ -175,7 +176,8 @@ function TimelineItem({ entry, renderTool, onMessageActions, markdown, loadParti
175
176
  entry.text ? /* @__PURE__ */ jsx(LinkText, {
176
177
  text: entry.text,
177
178
  style: styles.prose,
178
- onLongPress: actions ? () => actions(entry) : void 0
179
+ onLongPress: actions ? () => actions(entry) : void 0,
180
+ renderReference: markdown?.renderReference
179
181
  }) : null,
180
182
  /* @__PURE__ */ jsx(Time, { timestamp: entry.timestamp })
181
183
  ]
@@ -1 +1 @@
1
- {"version":3,"file":"TimelineItem.mjs","names":["currentLocale","useT","AlertIcon","CheckIcon","CodeBlock","fontOf","LinkText","Markdown","MarkdownProps","MessageItem","MessageItemBody","MessageItemGroup","MessageItemHeader","StatusTone","useImageRefs","UserImage","useRenderTrace","memo","ReactNode","useEffect","useState","StyleSheet","TimelineEntry","id","role","text","timestamp","author","name","initials","icon","senderProfileId","pending","tone","tools","toolName","payload","images","calls","TimelineItemProps","entry","loadParticipantAvatar","profileId","Promise","renderTool","onMessageActions","markdown","Pick","Time","undefined","styles","time","Date","toLocaleTimeString","hour","minute","COLLAPSIBLE_TOOLS","Set","callTone","run","running","isError","groupTone","last","at","Attachments","t","map","image","index","data","String","ref","entryId","slice","uri","mimeType","attachment","ToolCall","custom","collapsible","has","expanded","TimelineItem","failedIcon","setFailedIcon","picture","setPicture","loader","live","then","row","names","call","join","count","length","settled","rule","settledText","error","notice","noticeMark","noticeText","actions","userRow","label","agentHead","agentName","avatar","humanAvatar","avatarImage","humanInitials","bubble","prose","agent","create","theme","sans","fontFamily","size","color","fontSize","lineHeight","paddingHorizontal","spacing","paddingVertical","uni__dependencies","alignItems","gap","backgroundColor","colors","panel","dim","fontWeight","semibold","maxWidth","borderRadius","borderBottomRightRadius","md","rail","lineHeightRelaxed","lg","width","height","alignSelf","flexDirection","justifyContent","full","green","hi","flex","hairlineWidth","border","red"],"sources":["../../src/components/TimelineItem.tsx"],"sourcesContent":["import { currentLocale, useT } from '@agimon-ai/po-core/native';\nimport {\n AlertIcon,\n CheckIcon,\n CodeBlock,\n fontOf,\n LinkText,\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, useEffect, 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 recorded sender snapshot, or the persona that wrote an assistant message. */\n author?: { name: string; initials: string; icon?: string };\n /** Display identity only, never proof of participation. The server authorizes the picture read. */\n senderProfileId?: string;\n /** A steer the server holds but the agent has not read yet: shown, but no message actions until it lands. */\n pending?: true;\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 /** Session-bound authenticated loader. Returns a local/data URI, never a raw remote URL. */\n loadParticipantAvatar?: (profileId: string) => Promise<string | undefined>;\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(currentLocale(), { 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 const t = useT();\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={t('nativeDashboard.timeline.attachment', 'Attachment {index}', { index: 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 t = useT();\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={\n entry.toolName === undefined\n ? t('nativeDashboard.timeline.toolCall', 'Tool call')\n : t('nativeDashboard.timeline.toolNamed', 'Tool {name}', { name: entry.toolName })\n }\n >\n {({ expanded }) => (\n <>\n <MessageItemHeader title={entry.toolName ?? t('nativeDashboard.timeline.tool', '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({\n entry,\n renderTool,\n onMessageActions,\n markdown,\n loadParticipantAvatar,\n}: TimelineItemProps) {\n useRenderTrace('TimelineItem');\n const t = useT();\n const [failedIcon, setFailedIcon] = useState<string>();\n const [picture, setPicture] = useState<{ id: string; loader: typeof loadParticipantAvatar; uri: string }>();\n const profileId = entry.senderProfileId;\n useEffect(() => {\n if (!profileId || !loadParticipantAvatar) return;\n let live = true;\n void loadParticipantAvatar(profileId).then(\n (uri) => {\n if (live && uri) setPicture({ id: profileId, loader: loadParticipantAvatar, uri });\n },\n () => {\n /* Refused or unavailable pictures keep the recorded initials. */\n },\n );\n return () => {\n live = false;\n };\n }, [profileId, loadParticipantAvatar]);\n const icon =\n profileId && picture && picture.id === profileId && picture.loader === loadParticipantAvatar\n ? picture.uri\n : 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 ?? t('nativeDashboard.timeline.tool', 'tool')))].join(\n ', ',\n );\n return (\n <View style={styles.row}>\n <MessageItemGroup\n tone={groupTone(calls)}\n title={t('nativeDashboard.timeline.toolCalls', '{count} tool calls', { count: calls.length })}\n summary={names}\n >\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 {t('nativeDashboard.timeline.settled', 'Agent settled')}\n {entry.tools\n ? entry.tools === 1\n ? t('nativeDashboard.timeline.settledOneTool', ' · {count} tool', { count: entry.tools })\n : t('nativeDashboard.timeline.settledTools', ' · {count} tools', { count: entry.tools })\n : ''}\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 <LinkText text={entry.text} style={styles.noticeText(error)} />\n </View>\n );\n }\n case 'user': {\n const actions = entry.pending ? undefined : onMessageActions;\n return (\n <Pressable\n style={[styles.row, styles.userRow]}\n accessibilityLabel={\n entry.author\n ? t('nativeDashboard.timeline.said', '{name} said', { name: entry.author.name })\n : t('nativeDashboard.timeline.youSaid', 'You said')\n }\n onLongPress={actions ? () => actions(entry) : undefined}\n accessibilityActions={\n actions\n ? [{ name: 'longpress', label: t('nativeDashboard.timeline.messageActions', 'Message actions') }]\n : undefined\n }\n onAccessibilityAction={() => actions?.(entry)}\n >\n {entry.author ? (\n <View style={styles.agentHead}>\n <Text style={styles.agentName} numberOfLines={1}>\n {entry.author.name}\n </Text>\n <View style={[styles.avatar, styles.humanAvatar]}>\n {icon && icon !== failedIcon ? (\n <Image source={{ uri: icon }} style={styles.avatarImage} onError={() => setFailedIcon(icon)} />\n ) : (\n <Text style={styles.humanInitials}>{entry.author.initials}</Text>\n )}\n </View>\n </View>\n ) : null}\n <View style={styles.bubble}>\n {entry.images?.length ? <Attachments images={entry.images} /> : null}\n {entry.text ? (\n <LinkText\n text={entry.text}\n style={styles.prose}\n onLongPress={actions ? () => actions(entry) : undefined}\n />\n ) : null}\n <Time timestamp={entry.timestamp} />\n </View>\n </Pressable>\n );\n }\n case 'assistant':\n return (\n <View\n style={[styles.row, styles.agent]}\n accessibilityLabel={t('nativeDashboard.timeline.said', '{name} said', { name: entry.author?.name ?? 'Po' })}\n >\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 // no-untranslated-jsx: ignore - Po brand initials\n <Text style={styles.initials}>{entry.author?.initials ?? 'PO'}</Text>\n )}\n </View>\n <Text style={styles.agentName} numberOfLines={1}>\n {/* no-untranslated-jsx: ignore - Po brand name */}\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', gap: theme.spacing(1) },\n humanAvatar: { backgroundColor: theme.colors.panel },\n humanInitials: { ...text('xs', theme.colors.dim), fontWeight: theme.fontWeight.semibold },\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":";;;;;;;;;;;;AAsDA,SAASgD,KAAK,EAAEtB,aAAgD;CAC9D,IAAIA,cAAcuB,QAAW,OAAO;CACpC,OACE,oBAAC,MAAD;EAAM,OAAOC,OAAOC;YACjB,IAAIC,KAAK1B,SAAS,CAAC,CAAC2B,mBAAmBrD,cAAc,GAAG;GAAEsD,MAAM;GAAWC,QAAQ;EAAU,CAAC;CAC3F;AAEV;AAEA,MAAMC,oCAAoB,IAAIC,IAAI;CAAC;CAAQ;CAAQ;CAAS;CAAQ;CAAM;CAAQ;AAAM,CAAC;;AAGzF,SAASC,SAASlB,OAAkC;CAClD,MAAMmB,MAAMnB,MAAMJ;CAClB,OAAOuB,QAAQV,SAAY,YAAYU,IAAIC,UAAU,YAAYD,IAAIE,UAAU,UAAU;AAC3F;;AAGA,SAASC,UAAUxB,OAA6C;CAC9D,MAAMyB,OAAOzB,MAAM0B,GAAG,EAAE;CACxB,OAAOD,SAASd,SAAY,YAAYS,SAASK,IAAI;AACvD;;AAGA,SAASE,YAAY,EAAE5B,UAA4C;CACjE,MAAM6B,IAAIjE,KAAK;CACf,OAAOa,aAAauB,MAAM,CAAC,CAAC8B,KAAKC,OAAOC,UACtCD,MAAME,SAASrB,SAAY,OACzB,oBAAC,OAAD;EAEE,QAAQ,EAAE0B,KAAK,QAA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EAAC;EAC9EzB,aAAaF,WAAoB;GAC/B2C,OAAO;GACPC,QAAQ;GACRP,cAAc;GACdT,YAAY;GACZmB,gBAAgB;GAChBjB,iBAAiB9B,QAAQiB,MAAMc,OAAO,cAAcd,MAAMc,OAAOkB;GAAKtB,mBAAA,CAAA,CAAA;EACxE;EACAxB,aAAaH,WAAoB;GAAE,GAAG3E,KAAK,MAAM2E,QAAQiB,MAAMc,OAAOuB,MAAMrC,MAAMc,OAAOE,GAAG;GAAGkB,MAAM;GAACxB,mBAAA,CAAA,CAAA;EAAC;CACzG;AACF,CAAC"}
1
+ {"version":3,"file":"TimelineItem.mjs","names":["currentLocale","useT","AlertIcon","CheckIcon","CodeBlock","fontOf","LinkText","Markdown","MarkdownProps","MessageItem","MessageItemBody","MessageItemGroup","MessageItemHeader","StatusTone","useImageRefs","UserImage","useRenderTrace","memo","ReactNode","useEffect","useState","StyleSheet","TimelineEntry","id","role","text","timestamp","author","name","initials","icon","senderProfileId","pending","tone","tools","toolName","payload","images","calls","TimelineItemProps","entry","loadParticipantAvatar","profileId","Promise","renderTool","onMessageActions","markdown","Pick","Time","undefined","styles","time","Date","toLocaleTimeString","hour","minute","COLLAPSIBLE_TOOLS","Set","callTone","run","running","isError","groupTone","last","at","Attachments","t","map","image","index","data","String","ref","entryId","slice","uri","mimeType","attachment","ToolCall","custom","collapsible","has","expanded","TimelineItem","failedIcon","setFailedIcon","picture","setPicture","loader","live","then","row","names","call","join","count","length","settled","rule","settledText","error","notice","noticeMark","noticeText","renderReference","actions","userRow","label","agentHead","agentName","avatar","humanAvatar","avatarImage","humanInitials","bubble","prose","agent","create","theme","sans","fontFamily","size","color","fontSize","lineHeight","paddingHorizontal","spacing","paddingVertical","uni__dependencies","alignItems","gap","backgroundColor","colors","panel","dim","fontWeight","semibold","maxWidth","borderRadius","borderBottomRightRadius","md","rail","lineHeightRelaxed","lg","width","height","alignSelf","flexDirection","justifyContent","full","green","hi","flex","hairlineWidth","border","red"],"sources":["../../src/components/TimelineItem.tsx"],"sourcesContent":["import { currentLocale, useT } from '@agimon-ai/po-core/native';\nimport {\n AlertIcon,\n CheckIcon,\n CodeBlock,\n fontOf,\n LinkText,\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, useEffect, 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 recorded sender snapshot, or the persona that wrote an assistant message. */\n author?: { name: string; initials: string; icon?: string };\n /** Display identity only, never proof of participation. The server authorizes the picture read. */\n senderProfileId?: string;\n /** A steer the server holds but the agent has not read yet: shown, but no message actions until it lands. */\n pending?: true;\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 /** Session-bound authenticated loader. Returns a local/data URI, never a raw remote URL. */\n loadParticipantAvatar?: (profileId: string) => Promise<string | undefined>;\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, opens the files it links and draws its references. */\n markdown?: Pick<MarkdownProps, 'loadImage' | 'onFileLink' | 'renderReference'>;\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(currentLocale(), { 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 const t = useT();\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={t('nativeDashboard.timeline.attachment', 'Attachment {index}', { index: 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 t = useT();\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={\n entry.toolName === undefined\n ? t('nativeDashboard.timeline.toolCall', 'Tool call')\n : t('nativeDashboard.timeline.toolNamed', 'Tool {name}', { name: entry.toolName })\n }\n >\n {({ expanded }) => (\n <>\n <MessageItemHeader title={entry.toolName ?? t('nativeDashboard.timeline.tool', '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({\n entry,\n renderTool,\n onMessageActions,\n markdown,\n loadParticipantAvatar,\n}: TimelineItemProps) {\n useRenderTrace('TimelineItem');\n const t = useT();\n const [failedIcon, setFailedIcon] = useState<string>();\n const [picture, setPicture] = useState<{ id: string; loader: typeof loadParticipantAvatar; uri: string }>();\n const profileId = entry.senderProfileId;\n useEffect(() => {\n if (!profileId || !loadParticipantAvatar) return;\n let live = true;\n void loadParticipantAvatar(profileId).then(\n (uri) => {\n if (live && uri) setPicture({ id: profileId, loader: loadParticipantAvatar, uri });\n },\n () => {\n /* Refused or unavailable pictures keep the recorded initials. */\n },\n );\n return () => {\n live = false;\n };\n }, [profileId, loadParticipantAvatar]);\n const icon =\n profileId && picture && picture.id === profileId && picture.loader === loadParticipantAvatar\n ? picture.uri\n : 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 ?? t('nativeDashboard.timeline.tool', 'tool')))].join(\n ', ',\n );\n return (\n <View style={styles.row}>\n <MessageItemGroup\n tone={groupTone(calls)}\n title={t('nativeDashboard.timeline.toolCalls', '{count} tool calls', { count: calls.length })}\n summary={names}\n >\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 {t('nativeDashboard.timeline.settled', 'Agent settled')}\n {entry.tools\n ? entry.tools === 1\n ? t('nativeDashboard.timeline.settledOneTool', ' · {count} tool', { count: entry.tools })\n : t('nativeDashboard.timeline.settledTools', ' · {count} tools', { count: entry.tools })\n : ''}\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 <LinkText text={entry.text} style={styles.noticeText(error)} renderReference={markdown?.renderReference} />\n </View>\n );\n }\n case 'user': {\n const actions = entry.pending ? undefined : onMessageActions;\n return (\n <Pressable\n style={[styles.row, styles.userRow]}\n accessibilityLabel={\n entry.author\n ? t('nativeDashboard.timeline.said', '{name} said', { name: entry.author.name })\n : t('nativeDashboard.timeline.youSaid', 'You said')\n }\n onLongPress={actions ? () => actions(entry) : undefined}\n accessibilityActions={\n actions\n ? [{ name: 'longpress', label: t('nativeDashboard.timeline.messageActions', 'Message actions') }]\n : undefined\n }\n onAccessibilityAction={() => actions?.(entry)}\n >\n {entry.author ? (\n <View style={styles.agentHead}>\n <Text style={styles.agentName} numberOfLines={1}>\n {entry.author.name}\n </Text>\n <View style={[styles.avatar, styles.humanAvatar]}>\n {icon && icon !== failedIcon ? (\n <Image source={{ uri: icon }} style={styles.avatarImage} onError={() => setFailedIcon(icon)} />\n ) : (\n <Text style={styles.humanInitials}>{entry.author.initials}</Text>\n )}\n </View>\n </View>\n ) : null}\n <View style={styles.bubble}>\n {entry.images?.length ? <Attachments images={entry.images} /> : null}\n {entry.text ? (\n <LinkText\n text={entry.text}\n style={styles.prose}\n onLongPress={actions ? () => actions(entry) : undefined}\n renderReference={markdown?.renderReference}\n />\n ) : null}\n <Time timestamp={entry.timestamp} />\n </View>\n </Pressable>\n );\n }\n case 'assistant':\n return (\n <View\n style={[styles.row, styles.agent]}\n accessibilityLabel={t('nativeDashboard.timeline.said', '{name} said', { name: entry.author?.name ?? 'Po' })}\n >\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 // no-untranslated-jsx: ignore - Po brand initials\n <Text style={styles.initials}>{entry.author?.initials ?? 'PO'}</Text>\n )}\n </View>\n <Text style={styles.agentName} numberOfLines={1}>\n {/* no-untranslated-jsx: ignore - Po brand name */}\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', gap: theme.spacing(1) },\n humanAvatar: { backgroundColor: theme.colors.panel },\n humanInitials: { ...text('xs', theme.colors.dim), fontWeight: theme.fontWeight.semibold },\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":";;;;;;;;;;;;AAsDA,SAASgD,KAAK,EAAEtB,aAAgD;CAC9D,IAAIA,cAAcuB,QAAW,OAAO;CACpC,OACE,oBAAC,MAAD;EAAM,OAAOC,OAAOC;YACjB,IAAIC,KAAK1B,SAAS,CAAC,CAAC2B,mBAAmBrD,cAAc,GAAG;GAAEsD,MAAM;GAAWC,QAAQ;EAAU,CAAC;CAC3F;AAEV;AAEA,MAAMC,oCAAoB,IAAIC,IAAI;CAAC;CAAQ;CAAQ;CAAS;CAAQ;CAAM;CAAQ;AAAM,CAAC;;AAGzF,SAASC,SAASlB,OAAkC;CAClD,MAAMmB,MAAMnB,MAAMJ;CAClB,OAAOuB,QAAQV,SAAY,YAAYU,IAAIC,UAAU,YAAYD,IAAIE,UAAU,UAAU;AAC3F;;AAGA,SAASC,UAAUxB,OAA6C;CAC9D,MAAMyB,OAAOzB,MAAM0B,GAAG,EAAE;CACxB,OAAOD,SAASd,SAAY,YAAYS,SAASK,IAAI;AACvD;;AAGA,SAASE,YAAY,EAAE5B,UAA4C;CACjE,MAAM6B,IAAIjE,KAAK;CACf,OAAOa,aAAauB,MAAM,CAAC,CAAC8B,KAAKC,OAAOC,UACtCD,MAAME,SAASrB,SAAY,OACzB,oBAAC,OAAD;EAEE,QAAQ,EAAE0B,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;GAAUC,KAAKZ,MAAMQ,QAAQ,GAAG;GAACE,mBAAA,CAAA,CAAA;EAAC;EAC9E1B,aAAaF,WAAoB;GAC/B4C,OAAO;GACPC,QAAQ;GACRP,cAAc;GACdT,YAAY;GACZmB,gBAAgB;GAChBjB,iBAAiB/B,QAAQkB,MAAMc,OAAO,cAAcd,MAAMc,OAAOkB;GAAKtB,mBAAA,CAAA,CAAA;EACxE;EACAzB,aAAaH,WAAoB;GAAE,GAAG3E,KAAK,MAAM2E,QAAQkB,MAAMc,OAAOuB,MAAMrC,MAAMc,OAAOE,GAAG;GAAGkB,MAAM;GAACxB,mBAAA,CAAA,CAAA;EAAC;CACzG;AACF,CAAC"}
@@ -71,7 +71,7 @@ export declare function NativeTranscript({ sessionId, threadId, options, markdow
71
71
  sessionId: string;
72
72
  threadId?: string;
73
73
  options?: ThreadViewOptions;
74
- markdown?: Pick<MarkdownProps, 'loadImage' | 'onFileLink'>;
74
+ markdown?: Pick<MarkdownProps, 'loadImage' | 'onFileLink' | 'renderReference'>;
75
75
  }): import("react").JSX.Element;
76
76
  //#endregion
77
77
  //# sourceMappingURL=SessionScreen.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SessionScreen.mjs","names":["NativeTemplateSessionProps","useT","ToolMessageRenderProps","ToolResultView","ThreadViewOptions","WebPluginSlotProps","Button","EmptyState","fontOf","List","LoadingState","MessageIcon","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","streamedSessions","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","loadParticipantAvatar","profileId","Promise","composer","Omit","transcript","SessionTranscript","composerAside","conversationOpen","onConversationOpenChange","open","asideLabel","empty","createGrouper","activityOf","renderItem","builtIn","slotProps","showsWork","useRegistryVersion","version","bump","value","SessionScreen","props","t","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","liveEmpty","state","length","liveLoaded","has","emptyRegion","liveTranscript","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","markdown","offlineText","restoring","onRestore","stoppedTitle","stoppedText","folder","stoppedError","waking","onWake","overlay","Overlay","PluginToolMessage","message","Message","P","TemplateItem","render","LiveActivity","mapEntry","createNativeEntryMapper","working","streaming","flatMap","SessionTimeline","live","onMessageActions","raw","steers","hasNewerHistory","pendingSteers","registryVersion","role","toolName","payload","tool","renderer","details","toolActivity","call","nested","content","block","type","join","groupTools","createToolGrouper","data","renderTool","NonNullable","Nested","nestedFailed","cache","WeakMap","mapped","get","nativeEntry","set","previous","Map","next","out","run","flush","first","push","old","same","calls","every","index","group","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","sender","author","initials","senderProfileId","images","pending","const","identity","profile","icon","tone","tools","argSummary","NativeTranscript","threadId","options","Pick","key","limit","visible","slice"],"sources":["../../src/screens/SessionScreen.tsx"],"sourcesContent":["import { type NativeTemplateSessionProps, useT } 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 EmptyState,\n fontOf,\n List,\n LoadingState,\n MessageIcon,\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 streamedSessions,\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 /** Session-bound authenticated participant picture read. Omitted until the host supplies its transport. */\n loadParticipantAvatar?: (profileId: string) => Promise<string | undefined>;\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 * Shown in place of the conversation while given, such as the first session's welcome; the app stops\n * giving it once the conversation has a message. A person's own package may still wrap or replace it.\n */\n empty?: ReactNode;\n}\n\nexport interface SessionTranscript {\n /** The returned grouper can keep unchanged groups by identity between renders. */\n createGrouper: (\n activityOf: (entry: TimelineEntry) => readonly string[],\n ) => (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 t = useT();\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 = [\n { id: CONVERSATION_TAB, label: t('nativeDashboard.session.conversation', 'Conversation') },\n ...pluginTabs.map(({ id, label }) => ({ id, label })),\n ];\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(\n t('nativeDashboard.session.asking', 'Po is asking: {title}', {\n title: askingTitle ?? t('nativeDashboard.session.aQuestion', 'a question'),\n }),\n );\n }, [askingId, askingTitle, t]);\n // An empty conversation shows the app's own card unless the app gives one; a person's package may still wrap or replace it.\n // A live screen passes no `entries`; its transcript is the session store, so emptiness is read there,\n // and until the first history page lands it is loading rather than empty.\n const liveEmpty = useStore(sessionStoreFor(sessionId), (state) => state.entries.length === 0);\n const liveLoaded = useStore(streamedSessions, (state) => state.has(sessionId));\n const emptyRegion =\n props.empty === undefined && props.liveTranscript && liveEmpty && !liveLoaded ? (\n <LoadingState size=\"page\" label={t('nativeDashboard.session.loading', 'Loading conversation')} />\n ) : props.empty !== undefined || (props.liveTranscript ? liveEmpty : entries.length === 0) ? (\n renderRegion(\n HOST_SLOTS.emptyStateRegion,\n props.empty ?? (\n <EmptyState\n size=\"page\"\n icon={<MessageIcon size={24} />}\n title={t('nativeDashboard.session.emptyTitle', 'No messages yet')}\n description={\n props.readOnly\n ? t('nativeDashboard.session.emptyReadOnly', 'Messages show here once the session has some.')\n : t('nativeDashboard.session.emptyHint', 'Send a message to start working with Po.')\n }\n />\n ),\n slotProps,\n sessionId,\n )\n ) : 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={t('nativeDashboard.session.removeContext', 'Remove {label}', { label: 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 {t('nativeDashboard.session.about', 'About {label}', { label: 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 loadParticipantAvatar={props.loadParticipantAvatar}\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}>\n {t('nativeDashboard.session.offline', 'Po on your computer is not connected. Your message is kept.')}\n </Text>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n loading={offline.restoring ?? false}\n loadingLabel={t('nativeDashboard.session.restoring', 'Restoring the connection')}\n onPress={offline.onRestore}\n >\n {t('nativeDashboard.session.restore', '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}>{t('nativeDashboard.session.stoppedTitle', 'Session stopped')}</Text>\n <Text style={styles.stoppedText}>\n {t('nativeDashboard.session.stoppedText', 'Review the conversation above, then wake to continue.')}\n {stopped.folder\n ? t('nativeDashboard.session.stoppedFolder', ' History is on disk in {folder}.', {\n folder: stopped.folder,\n })\n : t('nativeDashboard.session.stoppedSaved', ' 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\n variant=\"primary\"\n size=\"md\"\n loading={stopped.waking}\n loadingLabel={t('nativeDashboard.session.waking', 'Waking')}\n onPress={stopped.onWake}\n >\n {t('nativeDashboard.session.wake', '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={t('nativeDashboard.session.closeConversation', 'Close the conversation')}>\n <SheetTitle>{t('nativeDashboard.session.conversation', '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 loadParticipantAvatar={props.loadParticipantAvatar}\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 t = useT();\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 (\n <ActivityPanel status={working ? t('nativeDashboard.session.working', 'Working...') : undefined} error={error} />\n );\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 loadParticipantAvatar,\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 loadParticipantAvatar?: SessionScreenProps['loadParticipantAvatar'];\n}) {\n const raw = useStore(sessionStoreFor(sessionId), (state) => (live ? state.entries : undefined));\n const t = useT();\n // In-flight steers sit at the live tail, after everything the journal already holds.\n const steers = useStore(sessionStoreFor(sessionId), (state) =>\n live && !state.hasNewerHistory ? state.pendingSteers : undefined,\n );\n const mapEntry = useMemo(createNativeEntryMapper, []);\n const registryVersion = useRegistryVersion();\n const activityOf = useCallback(\n (entry: TimelineEntry): readonly string[] => {\n if (entry.role !== 'tool' || !entry.toolName || !entry.payload) return [];\n const tool = entry.payload as ToolPayload;\n try {\n const renderer = sessionToolRenderer?.(sessionId, entry.toolName, statuses, tool.result?.details);\n return (\n renderer?.activity?.({\n ...slotProps,\n ...tool,\n statuses,\n toolName: entry.toolName,\n toolActivity: (call) => {\n try {\n const nested = sessionToolRenderer?.(sessionId, call.toolName, statuses, call.result?.details);\n return (\n nested?.activity?.({\n ...slotProps,\n ...call,\n statuses,\n toolCallId: `${tool.toolCallId}:${call.toolName}`,\n output: (call.result?.content ?? [])\n .flatMap((item) => {\n const block = item as { type?: unknown; text?: unknown } | null;\n return block?.type === 'text' && typeof block.text === 'string' ? [block.text] : [];\n })\n .join('\\n'),\n running: false,\n }) ?? []\n );\n } catch {\n return [];\n }\n },\n }) ?? []\n );\n } catch {\n return [];\n }\n },\n [sessionId, statuses, slotProps, sessionToolRenderer, registryVersion],\n );\n const groupTools = useMemo(\n () => (transcript ? transcript.createGrouper(activityOf) : createToolGrouper()),\n [transcript, activityOf],\n );\n const data = useMemo(\n () =>\n groupTools(\n raw === undefined ? entries : steers?.length ? [...raw, ...steers].flatMap(mapEntry) : raw.flatMap(mapEntry),\n ),\n [raw, steers, entries, mapEntry, groupTools],\n );\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 loadParticipantAvatar={loadParticipantAvatar}\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, loadParticipantAvatar],\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={t('nativeDashboard.session.transcript', '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.kind === 'user' && entry.sender\n ? {\n author: { name: entry.sender.name, initials: personaInitials(entry.sender.name) },\n ...(entry.sender.kind === 'human' && entry.sender.id ? { senderProfileId: entry.sender.id } : {}),\n }\n : {}),\n ...(entry.images?.length ? { images: entry.images } : {}),\n ...(entry.kind === 'user' && entry.pending ? { pending: true as const } : {}),\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 const t = useT();\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={t('nativeDashboard.session.transcript', 'Transcript')}\n />\n </ImageRefScope>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAoEA,MAAM6D,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;;AA0DhC,SAAS6B,qBAA6B;CACpC,MAAM,CAACC,SAASC,QAAQpD,YAAYqD,UAAkBA,QAAQ,GAAG,CAAC;CAClEvD,gBAAgB3B,2BAA2BiF,IAAI,GAAG,CAAA,CAAE;CACpD,OAAOD;AACT;AAEA,SAAgBG,cAAcC,OAA2B;CACvDhE,eAAe,eAAe;CAC9B,MAAMiE,IAAIzG,KAAK;CACf,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AO,CAAA;CACX;AACF;;AAGA,SAAgBoP,iBAAiB,EAC/BvN,WACAwN,UACAC,SACAnI,YAMC;CACDxJ,eAAe,kBAAkB;CACjC,MAAMiE,IAAIzG,KAAK;CACf+C,gBAAgB;EACd,IAAImR,aAAaxK,QAAW;GAC1BnI,gBAAgBmF,WAAWwN,QAAQ;GACnC,aAAa1S,kBAAkBkF,WAAWwN,QAAQ;EACpD;EAEA,OAAOxS,oBAAoBgF,SAAS;CACtC,GAAG,CAACA,WAAWwN,QAAQ,CAAC;CACxB,MAAMG,MAAMH,aAAaxK,SAAYhD,YAAYjF,eAAeiF,WAAWwN,QAAQ;CACnF,MAAMvG,MAAMlL,SAASnB,gBAAgB+S,GAAG,IAAItK,UAAUA,MAAMhF,OAAO;CACnE,MAAMoI,WAAWnK,QAAQoK,yBAAyB,CAAA,CAAE;CACpD,MAAMrI,UAAU/B,cAAc2K,IAAIJ,QAAQJ,QAAQ,GAAG,CAACQ,KAAKR,QAAQ,CAAC;CACpE,MAAMmH,QAAQH,SAASG;CACvB,MAAMC,UAAUvR,cACPsR,UAAU5K,SAAY3E,UAAUuP,SAAS,IAAI,CAAA,IAAKvP,QAAQyP,MAAM,CAACF,KAAK,GAC7E,CAACvP,SAASuP,KAAK,CACjB;CACA,MAAMvO,aAAajD,aAChBqB,UAAyB,oBAAC,kBAAD;EAAyBA;EAAiB6H;CAAS,IAC7E,CAACA,QAAQ,CACX;CACA,OACE,oBAAC,eAAD;EAAe,OAAOqI;YACpB,oBAAC,MAAD;GACE,MAAME;GACN,cAAcrQ;GACF6B;GACZ,YAAY;GACZ,oBAAoBU,EAAE,sCAAsC,YAAY;EAAE;CAE/D;AAEnB"}
1
+ {"version":3,"file":"SessionScreen.mjs","names":["NativeTemplateSessionProps","useT","ToolMessageRenderProps","ToolResultView","ThreadViewOptions","WebPluginSlotProps","Button","EmptyState","fontOf","List","LoadingState","MessageIcon","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","streamedSessions","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","loadParticipantAvatar","profileId","Promise","composer","Omit","transcript","SessionTranscript","composerAside","conversationOpen","onConversationOpenChange","open","asideLabel","empty","createGrouper","activityOf","renderItem","builtIn","slotProps","showsWork","useRegistryVersion","version","bump","value","SessionScreen","props","t","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","liveEmpty","state","length","liveLoaded","has","emptyRegion","liveTranscript","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","markdown","offlineText","restoring","onRestore","stoppedTitle","stoppedText","folder","stoppedError","waking","onWake","overlay","Overlay","PluginToolMessage","message","Message","P","TemplateItem","render","LiveActivity","mapEntry","createNativeEntryMapper","working","streaming","flatMap","SessionTimeline","live","onMessageActions","raw","steers","hasNewerHistory","pendingSteers","registryVersion","role","toolName","payload","tool","renderer","details","toolActivity","call","nested","content","block","type","join","groupTools","createToolGrouper","data","renderTool","NonNullable","Nested","nestedFailed","cache","WeakMap","mapped","get","nativeEntry","set","previous","Map","next","out","run","flush","first","push","old","same","calls","every","index","group","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","sender","author","initials","senderProfileId","images","pending","const","identity","profile","icon","tone","tools","argSummary","NativeTranscript","threadId","options","Pick","key","limit","visible","slice"],"sources":["../../src/screens/SessionScreen.tsx"],"sourcesContent":["import { type NativeTemplateSessionProps, useT } 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 EmptyState,\n fontOf,\n List,\n LoadingState,\n MessageIcon,\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 streamedSessions,\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 /** Session-bound authenticated participant picture read. Omitted until the host supplies its transport. */\n loadParticipantAvatar?: (profileId: string) => Promise<string | undefined>;\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 * Shown in place of the conversation while given, such as the first session's welcome; the app stops\n * giving it once the conversation has a message. A person's own package may still wrap or replace it.\n */\n empty?: ReactNode;\n}\n\nexport interface SessionTranscript {\n /** The returned grouper can keep unchanged groups by identity between renders. */\n createGrouper: (\n activityOf: (entry: TimelineEntry) => readonly string[],\n ) => (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 t = useT();\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 = [\n { id: CONVERSATION_TAB, label: t('nativeDashboard.session.conversation', 'Conversation') },\n ...pluginTabs.map(({ id, label }) => ({ id, label })),\n ];\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(\n t('nativeDashboard.session.asking', 'Po is asking: {title}', {\n title: askingTitle ?? t('nativeDashboard.session.aQuestion', 'a question'),\n }),\n );\n }, [askingId, askingTitle, t]);\n // An empty conversation shows the app's own card unless the app gives one; a person's package may still wrap or replace it.\n // A live screen passes no `entries`; its transcript is the session store, so emptiness is read there,\n // and until the first history page lands it is loading rather than empty.\n const liveEmpty = useStore(sessionStoreFor(sessionId), (state) => state.entries.length === 0);\n const liveLoaded = useStore(streamedSessions, (state) => state.has(sessionId));\n const emptyRegion =\n props.empty === undefined && props.liveTranscript && liveEmpty && !liveLoaded ? (\n <LoadingState size=\"page\" label={t('nativeDashboard.session.loading', 'Loading conversation')} />\n ) : props.empty !== undefined || (props.liveTranscript ? liveEmpty : entries.length === 0) ? (\n renderRegion(\n HOST_SLOTS.emptyStateRegion,\n props.empty ?? (\n <EmptyState\n size=\"page\"\n icon={<MessageIcon size={24} />}\n title={t('nativeDashboard.session.emptyTitle', 'No messages yet')}\n description={\n props.readOnly\n ? t('nativeDashboard.session.emptyReadOnly', 'Messages show here once the session has some.')\n : t('nativeDashboard.session.emptyHint', 'Send a message to start working with Po.')\n }\n />\n ),\n slotProps,\n sessionId,\n )\n ) : 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={t('nativeDashboard.session.removeContext', 'Remove {label}', { label: 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 {t('nativeDashboard.session.about', 'About {label}', { label: 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 loadParticipantAvatar={props.loadParticipantAvatar}\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}>\n {t('nativeDashboard.session.offline', 'Po on your computer is not connected. Your message is kept.')}\n </Text>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n loading={offline.restoring ?? false}\n loadingLabel={t('nativeDashboard.session.restoring', 'Restoring the connection')}\n onPress={offline.onRestore}\n >\n {t('nativeDashboard.session.restore', '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}>{t('nativeDashboard.session.stoppedTitle', 'Session stopped')}</Text>\n <Text style={styles.stoppedText}>\n {t('nativeDashboard.session.stoppedText', 'Review the conversation above, then wake to continue.')}\n {stopped.folder\n ? t('nativeDashboard.session.stoppedFolder', ' History is on disk in {folder}.', {\n folder: stopped.folder,\n })\n : t('nativeDashboard.session.stoppedSaved', ' 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\n variant=\"primary\"\n size=\"md\"\n loading={stopped.waking}\n loadingLabel={t('nativeDashboard.session.waking', 'Waking')}\n onPress={stopped.onWake}\n >\n {t('nativeDashboard.session.wake', '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={t('nativeDashboard.session.closeConversation', 'Close the conversation')}>\n <SheetTitle>{t('nativeDashboard.session.conversation', '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 loadParticipantAvatar={props.loadParticipantAvatar}\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 t = useT();\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 (\n <ActivityPanel status={working ? t('nativeDashboard.session.working', 'Working...') : undefined} error={error} />\n );\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 loadParticipantAvatar,\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 loadParticipantAvatar?: SessionScreenProps['loadParticipantAvatar'];\n}) {\n const raw = useStore(sessionStoreFor(sessionId), (state) => (live ? state.entries : undefined));\n const t = useT();\n // In-flight steers sit at the live tail, after everything the journal already holds.\n const steers = useStore(sessionStoreFor(sessionId), (state) =>\n live && !state.hasNewerHistory ? state.pendingSteers : undefined,\n );\n const mapEntry = useMemo(createNativeEntryMapper, []);\n const registryVersion = useRegistryVersion();\n const activityOf = useCallback(\n (entry: TimelineEntry): readonly string[] => {\n if (entry.role !== 'tool' || !entry.toolName || !entry.payload) return [];\n const tool = entry.payload as ToolPayload;\n try {\n const renderer = sessionToolRenderer?.(sessionId, entry.toolName, statuses, tool.result?.details);\n return (\n renderer?.activity?.({\n ...slotProps,\n ...tool,\n statuses,\n toolName: entry.toolName,\n toolActivity: (call) => {\n try {\n const nested = sessionToolRenderer?.(sessionId, call.toolName, statuses, call.result?.details);\n return (\n nested?.activity?.({\n ...slotProps,\n ...call,\n statuses,\n toolCallId: `${tool.toolCallId}:${call.toolName}`,\n output: (call.result?.content ?? [])\n .flatMap((item) => {\n const block = item as { type?: unknown; text?: unknown } | null;\n return block?.type === 'text' && typeof block.text === 'string' ? [block.text] : [];\n })\n .join('\\n'),\n running: false,\n }) ?? []\n );\n } catch {\n return [];\n }\n },\n }) ?? []\n );\n } catch {\n return [];\n }\n },\n [sessionId, statuses, slotProps, sessionToolRenderer, registryVersion],\n );\n const groupTools = useMemo(\n () => (transcript ? transcript.createGrouper(activityOf) : createToolGrouper()),\n [transcript, activityOf],\n );\n const data = useMemo(\n () =>\n groupTools(\n raw === undefined ? entries : steers?.length ? [...raw, ...steers].flatMap(mapEntry) : raw.flatMap(mapEntry),\n ),\n [raw, steers, entries, mapEntry, groupTools],\n );\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 loadParticipantAvatar={loadParticipantAvatar}\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, loadParticipantAvatar],\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={t('nativeDashboard.session.transcript', '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.kind === 'user' && entry.sender\n ? {\n author: { name: entry.sender.name, initials: personaInitials(entry.sender.name) },\n ...(entry.sender.kind === 'human' && entry.sender.id ? { senderProfileId: entry.sender.id } : {}),\n }\n : {}),\n ...(entry.images?.length ? { images: entry.images } : {}),\n ...(entry.kind === 'user' && entry.pending ? { pending: true as const } : {}),\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' | 'renderReference'>;\n}) {\n useRenderTrace('NativeTranscript');\n const t = useT();\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={t('nativeDashboard.session.transcript', 'Transcript')}\n />\n </ImageRefScope>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAoEA,MAAM6D,mBAAmB;AACzB,MAAMC,gBAA0C,CAAA;AAChD,MAAMC,iBAAmD,CAAC;AAC1D,MAAMG,mBAAmBtB,KAAKgB,YAAY;AAC1C,MAAMO,YAAYC,U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EAAe,OAAOqI;YACpB,oBAAC,MAAD;GACE,MAAME;GACN,cAAcrQ;GACF6B;GACZ,YAAY;GACZ,oBAAoBU,EAAE,sCAAsC,YAAY;EAAE;CAE/D;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.68",
3
+ "version": "0.0.0-alpha.69",
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.196",
47
- "@agimon-ai/po-native-components": "0.0.0-alpha.196",
48
- "@agimon-ai/po-web-dashboard": "0.0.0-alpha.196"
46
+ "@agimon-ai/po-core": "0.0.0-alpha.197",
47
+ "@agimon-ai/po-native-components": "0.0.0-alpha.197",
48
+ "@agimon-ai/po-web-dashboard": "0.0.0-alpha.197"
49
49
  },
50
50
  "devDependencies": {
51
- "@agimon-ai/po-build": "0.0.0-alpha.196",
52
- "@agimon-ai/po-web-components": "0.0.0-alpha.196",
53
- "@agimon-ai/vibe-lint-plugin-po-core": "0.0.0-alpha.196",
51
+ "@agimon-ai/po-build": "0.0.0-alpha.197",
52
+ "@agimon-ai/po-web-components": "0.0.0-alpha.197",
53
+ "@agimon-ai/vibe-lint-plugin-po-core": "0.0.0-alpha.197",
54
54
  "@tanstack/react-store": "0.11.2",
55
55
  "@tanstack/store": "0.11.2",
56
56
  "@types/node": "26.6.5",