@agimon-ai/po-native-dashboard 0.0.0-alpha.37 → 0.0.0-alpha.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Composer.d.mts +3 -1
- package/dist/components/Composer.d.mts.map +1 -1
- package/dist/components/Composer.mjs +3 -2
- package/dist/components/Composer.mjs.map +1 -1
- package/dist/screens/SessionScreen.d.mts +7 -0
- package/dist/screens/SessionScreen.d.mts.map +1 -1
- package/dist/screens/SessionScreen.mjs +91 -30
- package/dist/screens/SessionScreen.mjs.map +1 -1
- package/package.json +7 -7
|
@@ -44,8 +44,10 @@ export interface ComposerProps {
|
|
|
44
44
|
onRemoveCapture?: (capture: ComposerCapture) => void;
|
|
45
45
|
/** One outlined box holding the text and its controls, with an icon Send; absent keeps the default layout. */
|
|
46
46
|
quiet?: boolean;
|
|
47
|
+
/** Focuses the text box on mount, such as when a conversation sheet opens to be typed in. */
|
|
48
|
+
autoFocus?: boolean;
|
|
47
49
|
}
|
|
48
50
|
/** The text box, then the options button and Send in one row outside it. Context and cost sit in the options sheet. */
|
|
49
|
-
export declare function Composer({ onSend, disabled, initialText, value, onChangeText, running: suppliedRunning, onAbort, preset: suppliedPreset, onOpenOptions, completion: suppliedCompletion, draftStore, sessionId, live, searchFiles, mentionSessions, references, uploadAttachment, slotProps, captures, onRemoveCapture, quiet }: ComposerProps): string | number | bigint | boolean | import("react").JSX.Element | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | null | undefined;
|
|
51
|
+
export declare function Composer({ onSend, disabled, initialText, value, onChangeText, running: suppliedRunning, onAbort, preset: suppliedPreset, onOpenOptions, completion: suppliedCompletion, draftStore, sessionId, live, searchFiles, mentionSessions, references, uploadAttachment, slotProps, captures, onRemoveCapture, quiet, autoFocus }: ComposerProps): string | number | bigint | boolean | import("react").JSX.Element | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | null | undefined;
|
|
50
52
|
//#endregion
|
|
51
53
|
//# sourceMappingURL=Composer.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Composer.d.mts","names":[],"sources":["../../src/components/Composer.tsx"],"mappings":";;;;iBAiDiB;;EAEf,SAAS;EACT;EACA;;EAEA;EACA,gBAAgB;EAChB,aAAa,MAAM;EACnB;;EAEA;EACA,eAAe,kBAAkB;;EAEjC,aAAa;;EAEb,kBAAkB;;EAElB,oBACE,mBACA;IAAQ;IAAc;IAAkB,OAAO,WAAW;QACvD;IAAU;IAAc;IAAkB;;;EAE/C;EACA;;EAEA;EACA;;EAEA,aAAa;;EAEb,YAAY;;EAEZ,oBAAoB;EACpB,mBAAmB,SAAS;;EAE5B;;;wBAkBc,WACd,QACA,UACA,aACA,OACA,cACA,SAAS,iBACT,SACA,QAAQ,gBACR,eACA,YAAY,oBACZ,YACA,WACA,MACA,aACA,iBACA,YACA,kBACA,WACA,UACA,iBACA,
|
|
1
|
+
{"version":3,"file":"Composer.d.mts","names":[],"sources":["../../src/components/Composer.tsx"],"mappings":";;;;iBAiDiB;;EAEf,SAAS;EACT;EACA;;EAEA;EACA,gBAAgB;EAChB,aAAa,MAAM;EACnB;;EAEA;EACA,eAAe,kBAAkB;;EAEjC,aAAa;;EAEb,kBAAkB;;EAElB,oBACE,mBACA;IAAQ;IAAc;IAAkB,OAAO,WAAW;QACvD;IAAU;IAAc;IAAkB;;;EAE/C;EACA;;EAEA;EACA;;EAEA,aAAa;;EAEb,YAAY;;EAEZ,oBAAoB;EACpB,mBAAmB,SAAS;;EAE5B;;EAEA;;;wBAkBc,WACd,QACA,UACA,aACA,OACA,cACA,SAAS,iBACT,SACA,QAAQ,gBACR,eACA,YAAY,oBACZ,YACA,WACA,MACA,aACA,iBACA,YACA,kBACA,WACA,UACA,iBACA,OACA,aACC,qEAAa,IAAA,UAAA,yBAAA,aAAA,6DAAA,8BAAA,+CAAA,8BAAA,yBAAA"}
|
|
@@ -44,7 +44,7 @@ function withCompletion(text, caret, kind, item) {
|
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
46
|
/** The text box, then the options button and Send in one row outside it. Context and cost sit in the options sheet. */
|
|
47
|
-
function Composer({ onSend, disabled = false, initialText = "", value, onChangeText, running: suppliedRunning = false, onAbort, preset: suppliedPreset, onOpenOptions, completion: suppliedCompletion, draftStore, sessionId = "", live = false, searchFiles, mentionSessions, references, uploadAttachment, slotProps, captures = NO_CAPTURES, onRemoveCapture, quiet }) {
|
|
47
|
+
function Composer({ onSend, disabled = false, initialText = "", value, onChangeText, running: suppliedRunning = false, onAbort, preset: suppliedPreset, onOpenOptions, completion: suppliedCompletion, draftStore, sessionId = "", live = false, searchFiles, mentionSessions, references, uploadAttachment, slotProps, captures = NO_CAPTURES, onRemoveCapture, quiet, autoFocus }) {
|
|
48
48
|
useRenderTrace("Composer");
|
|
49
49
|
const [localText, setLocalText] = useState(initialText);
|
|
50
50
|
const storedText = useStore(draftStore ?? EMPTY_DRAFT_STORE, (state) => state[sessionId] ?? initialText);
|
|
@@ -238,7 +238,8 @@ function Composer({ onSend, disabled = false, initialText = "", value, onChangeT
|
|
|
238
238
|
},
|
|
239
239
|
placeholder: quiet ? running ? "Interrupt the run and respond…" : "Ask anything…" : running ? "Steer the run, or queue a reply..." : "Ask anything · / commands · $ skills · @ files",
|
|
240
240
|
accessibilityLabel: "Message",
|
|
241
|
-
disabled
|
|
241
|
+
disabled,
|
|
242
|
+
autoFocus
|
|
242
243
|
}), /* @__PURE__ */ jsxs(View, {
|
|
243
244
|
style: styles.row,
|
|
244
245
|
children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Composer.mjs","names":["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","withCompletion","caret","kind","item","rest","replace","insert","length","before","slice","space","test","Composer","suppliedRunning","suppliedPreset","suppliedCompletion","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 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}\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}: ComposerProps) {\n useRenderTrace('Composer');\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) return setAttachError('Could not read the image. Copy it again, then paste.');\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(error instanceof Error ? error.message : 'Could not attach the image.');\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('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) throw new Error('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) throw new Error('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) => setAttachError(error instanceof Error ? error.message : 'Could not attach.'))\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: 'Photo',\n hint: 'Attach one from your library',\n onPress: () => runAttach(pickPhotos),\n },\n ]\n : []),\n {\n key: 'attach-file',\n glyph: '+',\n title: 'Upload a file',\n hint: 'Send a file from this phone',\n onPress: () => runAttach(pickFile),\n },\n ]\n : [];\n const chooseAttachment = () =>\n Alert.alert('Attach', undefined, [\n ...(canAttachPhoto ? [{ text: 'Photo', onPress: () => runAttach(pickPhotos) }] : []),\n { text: 'File', onPress: () => runAttach(pickFile) },\n { text: '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('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 ? 'Interrupt the run and respond…'\n : 'Ask anything…'\n : running\n ? 'Steer the run, or queue a reply...'\n : 'Ask anything · / commands · $ skills · @ files'\n }\n accessibilityLabel=\"Message\"\n disabled={disabled}\n />\n <View style={styles.row}>\n {!completion && attachContext && sessionId && !disabled ? (\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel={attaching ? 'Attaching' : 'Attach a photo or file'}\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={`Session options, ${preset ?? 'preset'}`}\n onPress={onOpenOptions}\n style={({ pressed }) => [styles.options, pressed && styles.pressed]}\n >\n <Text style={styles.optionsText} numberOfLines={1}>\n {preset || '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 variant=\"danger-outline\" size=\"icon-md\" onPress={onAbort} accessibilityLabel=\"Abort the run\">\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={running ? 'Steer' : 'Send'}\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={running ? 'Steer' : 'Send'}\n >\n <View style={styles.send}>\n <SendIcon size={14} color=\"on-selected\" />\n <Text style={styles.sendText}>{running ? 'Steer' : 'Send'}</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":";;;;;;;;;;;;;;;;;;;;;AA0CA,MAAM0C,uBAAwC;CAAEC,QAAQ;CAAQC,aAAa;AAAI;AAEjF,MAAMC,eAAe;AAErB,MAAMC,mBAAmB;AACzB,MAAMC,cAA0C,CAAA;AAChD,MAAMC,oBAAoB,IAAI7B,MAA8B,CAAC,CAAC;;AAyC9D,SAASiE,eAAehC,MAAciC,OAAeC,MAAsBC,MAAsB;CAC/F,IAAID,SAAS,QAAQ;EACnB,MAAME,OAAOpC,KAAKqC,QAAQ,gBAAgB,EAAE;EAC5C,OAAO;GAAErC,MAAM,GAAGmC,KAAKG,SAASF;GAAQH,OAAOE,KAAKG,OAAOC;EAAO;CACpE;CACA,MAAMC,SAASxC,KAAKyC,MAAM,GAAGR,KAAK;CAClC,MAAMS,QAAQF,WAAW,MAAM,OAAOG,KAAKH,MAAM,IAAI,KAAK;CAC1D,OAAO;EACLxC,MAAM,GAAGwC,SAASE,QAAQP,KAAKG,SAAStC,KAAKyC,MAAMR,KAAK;EACxDA,OAAOO,OAAOD,SAASG,MAAMH,SAASJ,KAAKG,OAAOC;CACpD;AACF;;AAGA,SAAgBK,SAAS,EACvB7C,QACAE,WAAW,OACXC,cAAc,IACdC,OACAC,cACAkB,SAASuB,kBAAkB,OAC3BtB,SACAC,QAAQsB,gBACRrB,eACAC,YAAYqB,oBACZ1C,YACAC,YAAY,IACZC,OAAO,OACPC,aACAI,iBACAD,YACAE,kBACAc,WACAC,WAAWjC,aACXkC,iBACAE,SACgB;CAChBlE,eAAe,UAAU;CACzB,MAAM,CAACmF,WAAWC,gBAAgBvE,SAASwB,WAAW;CACtD,MAAMgD,aAAapF,SAASuC,cAAcT,oBAAoBuD,UAAUA,MAAM7C,cAAcJ,WAAW;CACvG,MAAMF,OAAOK,aAAa6C,aAAc/C,SAAS6C;CACjD,MAAMI,UAAU/C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AAM0B,WAAWU;GAC7BC,YAAYrC,MAAMqC,WAAWC;GAC7Bf,OAAOvB,MAAMa,OAAO;GAAcE,mBAAA,CAAA,CAAA;EACpC;CACF;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"Composer.mjs","names":["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","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 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 [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) return setAttachError('Could not read the image. Copy it again, then paste.');\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(error instanceof Error ? error.message : 'Could not attach the image.');\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('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) throw new Error('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) throw new Error('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) => setAttachError(error instanceof Error ? error.message : 'Could not attach.'))\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: 'Photo',\n hint: 'Attach one from your library',\n onPress: () => runAttach(pickPhotos),\n },\n ]\n : []),\n {\n key: 'attach-file',\n glyph: '+',\n title: 'Upload a file',\n hint: 'Send a file from this phone',\n onPress: () => runAttach(pickFile),\n },\n ]\n : [];\n const chooseAttachment = () =>\n Alert.alert('Attach', undefined, [\n ...(canAttachPhoto ? [{ text: 'Photo', onPress: () => runAttach(pickPhotos) }] : []),\n { text: 'File', onPress: () => runAttach(pickFile) },\n { text: '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('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 ? 'Interrupt the run and respond…'\n : 'Ask anything…'\n : running\n ? 'Steer the run, or queue a reply...'\n : 'Ask anything · / commands · $ skills · @ files'\n }\n accessibilityLabel=\"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={attaching ? 'Attaching' : 'Attach a photo or file'}\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={`Session options, ${preset ?? 'preset'}`}\n onPress={onOpenOptions}\n style={({ pressed }) => [styles.options, pressed && styles.pressed]}\n >\n <Text style={styles.optionsText} numberOfLines={1}>\n {preset || '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 variant=\"danger-outline\" size=\"icon-md\" onPress={onAbort} accessibilityLabel=\"Abort the run\">\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={running ? 'Steer' : 'Send'}\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={running ? 'Steer' : 'Send'}\n >\n <View style={styles.send}>\n <SendIcon size={14} color=\"on-selected\" />\n <Text style={styles.sendText}>{running ? 'Steer' : 'Send'}</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":";;;;;;;;;;;;;;;;;;;;;AA0CA,MAAM0C,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,YAC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ACZsB,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"}
|
|
@@ -25,6 +25,13 @@ export interface SessionScreenProps extends NativeTemplateSessionProps {
|
|
|
25
25
|
composer?: Omit<ComposerProps, 'onSend' | 'disabled' | 'value' | 'onChangeText'>;
|
|
26
26
|
/** Lets a template regroup and redraw transcript rows; absent keeps the built-in tool groups and rows. */
|
|
27
27
|
transcript?: SessionTranscript;
|
|
28
|
+
/** With a retained-composer panel, the prompt lives in a conversation sheet over the panel instead of below it. */
|
|
29
|
+
composerAside?: boolean;
|
|
30
|
+
/** Whether that conversation sheet is open; the app owns it so the panel can open it too. */
|
|
31
|
+
conversationOpen?: boolean;
|
|
32
|
+
onConversationOpenChange?: (open: boolean) => void;
|
|
33
|
+
/** What the panel shows, named in the sheet's About line; absent leaves the line out. */
|
|
34
|
+
asideLabel?: string;
|
|
28
35
|
}
|
|
29
36
|
export interface SessionTranscript {
|
|
30
37
|
/** Called once per transcript, so the grouper can keep unchanged groups by identity between renders. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionScreen.d.mts","names":["TimelineEntry","DashboardEntry"],"sources":["../../src/screens/SessionScreen.tsx"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"SessionScreen.d.mts","names":["TimelineEntry","DashboardEntry"],"sources":["../../src/screens/SessionScreen.tsx"],"mappings":";;;;;;;;;iBA2EiB;EACf;EACA,MAAM;EACN,QAAQ;EACR;EACA;EACA;;;;;;iBAOe,2BAA2B;EAC1C,mBAAmBA;;EAEnB,WAAW,KAAK;;EAEhB,aAAa;;EAEb;;EAEA;EACA,4BAA4B;;EAE5B;;iBAGe;;EAEf,sBAAsB,kBAAkBA,sBAAoBA;;;;;EAK5D,aACE,OAAOA,iBACP,UAAU,OAAOA,oBAAkB;;EAEnC,WAAW,uBACR;;EAEL,aAAa,kBAAkBA;;wBAUjB,cAAc,OAAO,qCAAkB,IAAA;;wBAqbvC,4BAA4B,OAAOC,kBAAmBD;;;;;;;;wBAmBtD,sBAAsB,kBAAkBA,sBAAoBA;;wBA2G5D,YAAY,OAAOC,gBAAiBD;;wBA2DpC,mBACd,WACA,UACA,SACA;EAEA;EACA;EACA,UAAU;EACV,WAAW,KAAK;oBACjB,IAAA"}
|
|
@@ -6,9 +6,9 @@ import { MessageActionsSheet } from "../components/MessageActionsSheet.mjs";
|
|
|
6
6
|
import { TimelineItem } from "../components/TimelineItem.mjs";
|
|
7
7
|
import { View } from "react-native-unistyles/components/native/View";
|
|
8
8
|
import { Text } from "react-native-unistyles/components/native/Text";
|
|
9
|
-
import { Button, List, Tabs, TabsList, TabsTrigger, fontOf } from "@agimon-ai/po-native-components";
|
|
9
|
+
import { Button, List, Sheet, SheetContent, SheetHeader, SheetTitle, Tabs, TabsList, TabsTrigger, fontOf } from "@agimon-ai/po-native-components";
|
|
10
10
|
import { StyleSheet } from "react-native-unistyles";
|
|
11
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
12
|
import { HOST_SLOTS, ImageRefScope, ToolRendererBoundary, holdSessionChannels, personaInitials, pluginUserMessageActions, renderRegion, sessionStoreFor, slotFills, subscribeThread, subscribeWebPluginRegistry, threadStoreKey, toolMessageProps, toolPromptClaim, unsubscribeThread, useImageRefs, useRenderTrace, webTabs } from "@agimon-ai/po-web-dashboard/core";
|
|
13
13
|
import { memo, useCallback, useEffect, useMemo, useReducer, useState } from "react";
|
|
14
14
|
import { useStore } from "@tanstack/react-store";
|
|
@@ -22,6 +22,8 @@ const MemoTimelineItem = memo(TimelineItem);
|
|
|
22
22
|
const entryKey = (entry) => entry.id;
|
|
23
23
|
/** The most tool calls one transcript cell holds; a longer run splits into several groups. */
|
|
24
24
|
const TOOL_GROUP_LIMIT = 20;
|
|
25
|
+
/** The conversation sheet's one detent, leaving the panel above it in view. */
|
|
26
|
+
const ASIDE_SNAP_POINTS = ["58%"];
|
|
25
27
|
/** Re-renders when plugin installs change what the registry resolves. */
|
|
26
28
|
function useRegistryVersion() {
|
|
27
29
|
const [version, bump] = useReducer((value) => value + 1, 0);
|
|
@@ -90,7 +92,53 @@ function SessionScreen(props) {
|
|
|
90
92
|
if (askingId !== void 0) AccessibilityInfo.announceForAccessibility(`Po is asking: ${askingTitle ?? "a question"}`);
|
|
91
93
|
}, [askingId, askingTitle]);
|
|
92
94
|
const emptyRegion = entries.length === 0 ? renderRegion(HOST_SLOTS.emptyStateRegion, null, slotProps, sessionId) : null;
|
|
93
|
-
const
|
|
95
|
+
const aside = props.composerAside === true && props.panel !== void 0;
|
|
96
|
+
const conversationOpen = aside && props.conversationOpen === true;
|
|
97
|
+
const composerShown = !aside && !props.readOnly && !stopped && !prompt && (props.panel === void 0 || props.retainComposer === true);
|
|
98
|
+
const composerProps = {
|
|
99
|
+
...composer,
|
|
100
|
+
onSend,
|
|
101
|
+
disabled: Boolean(ask),
|
|
102
|
+
value: props.draftStore ? void 0 : props.draft ?? drafts[sessionId] ?? composer?.initialText ?? "",
|
|
103
|
+
onChangeText: props.draftStore ? void 0 : updateDraft,
|
|
104
|
+
draftStore: props.draftStore,
|
|
105
|
+
sessionId,
|
|
106
|
+
slotProps
|
|
107
|
+
};
|
|
108
|
+
const promptDock = (inset) => /* @__PURE__ */ jsxs(View, {
|
|
109
|
+
style: [styles.promptDock, inset && styles.promptInset],
|
|
110
|
+
children: [props.promptError ? /* @__PURE__ */ jsx(Text, {
|
|
111
|
+
style: styles.promptError,
|
|
112
|
+
accessibilityRole: "alert",
|
|
113
|
+
children: props.promptError
|
|
114
|
+
}) : null, asking]
|
|
115
|
+
});
|
|
116
|
+
const contextChips = props.contextItems?.length ? /* @__PURE__ */ jsx(View, {
|
|
117
|
+
style: styles.contextItems,
|
|
118
|
+
children: props.contextItems.map((item) => /* @__PURE__ */ jsxs(Button, {
|
|
119
|
+
variant: "ghost",
|
|
120
|
+
size: "sm",
|
|
121
|
+
accessibilityLabel: `Remove ${item.label}`,
|
|
122
|
+
onPress: () => props.onRemoveContext?.(item.source, item.id),
|
|
123
|
+
children: [item.label, " ×"]
|
|
124
|
+
}, `${item.source}:${item.id}`))
|
|
125
|
+
}) : null;
|
|
126
|
+
const asideFooter = aside ? /* @__PURE__ */ jsx(View, {
|
|
127
|
+
style: styles.asideFooter,
|
|
128
|
+
children: conversationOpen ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
129
|
+
contextChips,
|
|
130
|
+
props.asideLabel ? /* @__PURE__ */ jsxs(Text, {
|
|
131
|
+
style: styles.about,
|
|
132
|
+
numberOfLines: 1,
|
|
133
|
+
children: ["About ", props.asideLabel]
|
|
134
|
+
}) : null,
|
|
135
|
+
asking ? promptDock(false) : !props.readOnly && !stopped ? /* @__PURE__ */ jsx(Composer, {
|
|
136
|
+
...composerProps,
|
|
137
|
+
quiet: true,
|
|
138
|
+
autoFocus: true
|
|
139
|
+
}) : null
|
|
140
|
+
] }) : null
|
|
141
|
+
}) : void 0;
|
|
94
142
|
return /* @__PURE__ */ jsxs(View, {
|
|
95
143
|
style: styles.screen,
|
|
96
144
|
children: [
|
|
@@ -146,24 +194,8 @@ function SessionScreen(props) {
|
|
|
146
194
|
children: "Restore"
|
|
147
195
|
})]
|
|
148
196
|
}) : null,
|
|
149
|
-
asking ?
|
|
150
|
-
|
|
151
|
-
children: [props.promptError ? /* @__PURE__ */ jsx(Text, {
|
|
152
|
-
style: styles.promptError,
|
|
153
|
-
accessibilityRole: "alert",
|
|
154
|
-
children: props.promptError
|
|
155
|
-
}) : null, asking]
|
|
156
|
-
}) : null,
|
|
157
|
-
props.contextItems?.length && (props.panel === void 0 || props.retainComposer) ? /* @__PURE__ */ jsx(View, {
|
|
158
|
-
style: styles.contextItems,
|
|
159
|
-
children: props.contextItems.map((item) => /* @__PURE__ */ jsxs(Button, {
|
|
160
|
-
variant: "ghost",
|
|
161
|
-
size: "sm",
|
|
162
|
-
accessibilityLabel: `Remove ${item.label}`,
|
|
163
|
-
onPress: () => props.onRemoveContext?.(item.source, item.id),
|
|
164
|
-
children: [item.label, " ×"]
|
|
165
|
-
}, `${item.source}:${item.id}`))
|
|
166
|
-
}) : null,
|
|
197
|
+
asking && !conversationOpen ? promptDock(!composerShown) : null,
|
|
198
|
+
!aside && (props.panel === void 0 || props.retainComposer) ? contextChips : null,
|
|
167
199
|
!props.readOnly && stopped ? /* @__PURE__ */ jsxs(View, {
|
|
168
200
|
style: styles.stopped,
|
|
169
201
|
children: [
|
|
@@ -189,15 +221,32 @@ function SessionScreen(props) {
|
|
|
189
221
|
children: "Wake session"
|
|
190
222
|
})
|
|
191
223
|
]
|
|
192
|
-
}) : composerShown ? /* @__PURE__ */ jsx(Composer, {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
224
|
+
}) : composerShown ? /* @__PURE__ */ jsx(Composer, { ...composerProps }) : null,
|
|
225
|
+
aside ? /* @__PURE__ */ jsx(Sheet, {
|
|
226
|
+
open: conversationOpen,
|
|
227
|
+
onOpenChange: props.onConversationOpenChange,
|
|
228
|
+
children: /* @__PURE__ */ jsxs(SheetContent, {
|
|
229
|
+
snapPoints: ASIDE_SNAP_POINTS,
|
|
230
|
+
backdrop: false,
|
|
231
|
+
keep: true,
|
|
232
|
+
background: "bg",
|
|
233
|
+
scrollable: false,
|
|
234
|
+
footer: asideFooter,
|
|
235
|
+
children: [/* @__PURE__ */ jsx(SheetHeader, {
|
|
236
|
+
closeLabel: "Close the conversation",
|
|
237
|
+
children: /* @__PURE__ */ jsx(SheetTitle, { children: "Conversation" })
|
|
238
|
+
}), /* @__PURE__ */ jsx(SessionTimeline, {
|
|
239
|
+
sessionId,
|
|
240
|
+
entries,
|
|
241
|
+
live: props.liveTranscript,
|
|
242
|
+
slotProps,
|
|
243
|
+
statuses,
|
|
244
|
+
sessionToolRenderer,
|
|
245
|
+
onMessageActions: !props.readOnly && messageActions.length ? setActionTarget : void 0,
|
|
246
|
+
markdown: props.markdown,
|
|
247
|
+
transcript: props.transcript
|
|
248
|
+
})]
|
|
249
|
+
})
|
|
201
250
|
}) : null,
|
|
202
251
|
/* @__PURE__ */ jsx(MessageActionsSheet, {
|
|
203
252
|
sessionId,
|
|
@@ -391,6 +440,18 @@ const styles = StyleSheet.create((theme, rt) => ({
|
|
|
391
440
|
color: theme.colors.red,
|
|
392
441
|
uni__dependencies: [0]
|
|
393
442
|
},
|
|
443
|
+
asideFooter: {
|
|
444
|
+
gap: theme.spacing(1),
|
|
445
|
+
uni__dependencies: [0]
|
|
446
|
+
},
|
|
447
|
+
about: {
|
|
448
|
+
paddingHorizontal: theme.spacing(4),
|
|
449
|
+
fontFamily: fontOf(theme.fontFamily.sans),
|
|
450
|
+
fontSize: theme.fontSize.sm,
|
|
451
|
+
lineHeight: theme.lineHeight.sm,
|
|
452
|
+
color: theme.colors.dim,
|
|
453
|
+
uni__dependencies: [0]
|
|
454
|
+
},
|
|
394
455
|
contextItems: {
|
|
395
456
|
flexDirection: "row",
|
|
396
457
|
flexWrap: "wrap",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionScreen.mjs","names":["NativeTemplateSessionProps","ToolMessageRenderProps","ToolResultView","ThreadViewOptions","WebPluginSlotProps","Button","fontOf","List","MarkdownProps","Tabs","TabsList","TabsTrigger","ImageRefScope","subscribeWebPluginRegistry","personaInitials","sessionStoreFor","subscribeThread","unsubscribeThread","threadStoreKey","holdSessionChannels","HOST_SLOTS","pluginUserMessageActions","renderRegion","slotFills","TimelineEntry","DashboardEntry","toolMessageProps","toolPromptClaim","ToolPromptInput","ToolRendererBoundary","useImageRefs","webTabs","useRenderTrace","useStore","ComponentType","memo","ReactElement","ReactNode","useCallback","useEffect","useMemo","useReducer","useState","AccessibilityInfo","StyleSheet","ActivityPanel","Composer","ComposerProps","DialogSheet","MessageActionsSheet","nativeSlotProps","TimelineItem","CONVERSATION_TAB","EMPTY_ENTRIES","EMPTY_STATUSES","Readonly","Record","MemoTimelineItem","entryKey","entry","id","TOOL_GROUP_LIMIT","ToolPayload","toolCallId","args","result","output","running","isError","SessionScreenProps","entries","composer","Omit","transcript","SessionTranscript","createGrouper","renderItem","builtIn","slotProps","showsWork","useRegistryVersion","version","bump","value","SessionScreen","props","sessionId","onSend","sessionToolRenderer","ask","onAnswer","onCancel","activity","error","stopped","offline","statuses","activeTab","setActiveTab","drafts","setDrafts","actionTarget","setActionTarget","messageActions","updateDraft","onDraftChange","text","current","tabId","addition","trim","draft","initialText","separator","test","pluginTabs","tabs","label","map","ActivePanel","find","tab","panel","prompt","readOnly","promptInput","fallbackAsk","dialogValue","onDialogValueChange","asking","dialog","name","failed","askingId","undefined","askingTitle","title","announceForAccessibility","emptyRegion","length","emptyStateRegion","composerShown","retainComposer","styles","screen","conversationStrip","pluginId","component","Strip","list","liveTranscript","markdown","offlineText","restoring","onRestore","promptDock","promptInset","promptError","contextItems","item","source","onRemoveContext","stoppedTitle","stoppedText","folder","stoppedError","waking","onWake","Boolean","draftStore","overlay","Overlay","PluginToolMessage","message","Message","P","TemplateItem","render","LiveActivity","mapEntry","createNativeEntryMapper","working","state","streaming","flatMap","SessionTimeline","live","onMessageActions","raw","groupTools","createToolGrouper","data","registryVersion","renderTool","toolName","tool","payload","details","nested","NonNullable","call","Nested","content","block","type","join","nestedFailed","cache","WeakMap","mapped","get","nativeEntry","set","previous","Map","next","out","run","flush","first","push","old","same","calls","every","index","group","role","create","theme","rt","maxHeight","paddingBottom","insets","ime","bottom","uni__dependencies","paddingHorizontal","spacing","fontFamily","sans","fontSize","sm","lineHeight","color","colors","red","flexDirection","flexWrap","gap","flex","backgroundColor","bg","paddingVertical","margin","padding","borderRadius","lg","borderWidth","borderColor","base","fontWeight","semibold","hi","lineHeightRelaxed","dim","alignItems","paddingLeft","paddingRight","at","timestamp","kind","images","identity","profile","author","initials","tone","tools","argSummary","NativeTranscript","threadId","options","Pick","key","limit","visible","slice"],"sources":["../../src/screens/SessionScreen.tsx"],"sourcesContent":["import type { NativeTemplateSessionProps } from '@agimon-ai/po-core/native';\nimport type {\n ToolMessageRenderProps,\n ToolResultView,\n ThreadViewOptions,\n WebPluginSlotProps,\n} from '@agimon-ai/po-core/web';\nimport { Button, fontOf, List, type MarkdownProps, Tabs, TabsList, TabsTrigger } from '@agimon-ai/po-native-components';\nimport {\n ImageRefScope,\n subscribeWebPluginRegistry,\n personaInitials,\n sessionStoreFor,\n subscribeThread,\n unsubscribeThread,\n threadStoreKey,\n holdSessionChannels,\n HOST_SLOTS,\n pluginUserMessageActions,\n renderRegion,\n slotFills,\n type TimelineEntry as DashboardEntry,\n toolMessageProps,\n toolPromptClaim,\n type ToolPromptInput,\n ToolRendererBoundary,\n useImageRefs,\n webTabs,\n useRenderTrace,\n} from '@agimon-ai/po-web-dashboard/core';\nimport { useStore } from '@tanstack/react-store';\nimport {\n type ComponentType,\n memo,\n type ReactElement,\n type ReactNode,\n useCallback,\n useEffect,\n useMemo,\n useReducer,\n useState,\n} from 'react';\nimport { AccessibilityInfo, Text, View } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport { ActivityPanel } from '../components/ActivityPanel';\nimport { Composer, type ComposerProps } from '../components/Composer';\nimport { DialogSheet } from '../components/DialogSheet';\nimport { MessageActionsSheet } from '../components/MessageActionsSheet';\nimport { nativeSlotProps } from '../components/slotProps';\nimport { type TimelineEntry, TimelineItem } from '../components/TimelineItem';\n\nconst CONVERSATION_TAB = 'conversation';\nconst EMPTY_ENTRIES: readonly TimelineEntry[] = [];\nconst EMPTY_STATUSES: Readonly<Record<string, string>> = {};\nconst MemoTimelineItem = memo(TimelineItem);\nconst entryKey = (entry: TimelineEntry) => entry.id;\n/** The most tool calls one transcript cell holds; a longer run splits into several groups. */\nconst TOOL_GROUP_LIMIT = 20;\n\n/** The tool entry fields a plugin renderer reads, carried as TimelineEntry.payload. */\nexport interface ToolPayload {\n toolCallId: string;\n args: Record<string, unknown>;\n result: ToolResultView | null;\n output: string;\n running: boolean;\n isError: boolean;\n}\n\n/**\n * The app's session contract plus the presentation hooks a template may add. Every addition is\n * optional, so a template screen typed with these props still accepts what the app hands it.\n */\nexport interface SessionScreenProps extends NativeTemplateSessionProps {\n entries?: readonly TimelineEntry[];\n /** Options and run controls for the composer row. */\n composer?: Omit<ComposerProps, 'onSend' | 'disabled' | 'value' | 'onChangeText'>;\n /** Lets a template regroup and redraw transcript rows; absent keeps the built-in tool groups and rows. */\n transcript?: SessionTranscript;\n}\n\nexport interface SessionTranscript {\n /** Called once per transcript, so the grouper can keep unchanged groups by identity between renders. */\n createGrouper: () => (entries: readonly TimelineEntry[]) => TimelineEntry[];\n /**\n * `entry` arrives with images the transcript sent by reference filled in once read.\n * `builtIn` draws one entry the default way, with plugin tool cards, for rows the template keeps.\n */\n renderItem: (\n entry: TimelineEntry,\n builtIn: (entry: TimelineEntry) => ReactElement,\n /** The session's slot props, for a row that opens plugin surfaces such as Author. */\n slotProps: WebPluginSlotProps,\n ) => ReactElement | null;\n /** True when a row already shows the turn at work, so the screen leaves out its own Working line. */\n showsWork?: (entries: readonly TimelineEntry[]) => boolean;\n}\n\n/** Re-renders when plugin installs change what the registry resolves. */\nfunction useRegistryVersion(): number {\n const [version, bump] = useReducer((value: number) => value + 1, 0);\n useEffect(() => subscribeWebPluginRegistry(bump), []);\n return version;\n}\n\nexport function SessionScreen(props: SessionScreenProps) {\n useRenderTrace('SessionScreen');\n const {\n sessionId,\n entries = EMPTY_ENTRIES,\n onSend,\n sessionToolRenderer,\n ask,\n onAnswer,\n onCancel,\n activity,\n error,\n composer,\n stopped,\n offline,\n } = props;\n const statuses = props.statuses ?? EMPTY_STATUSES;\n const [activeTab, setActiveTab] = useState(CONVERSATION_TAB);\n const [drafts, setDrafts] = useState<Record<string, string>>({});\n const [actionTarget, setActionTarget] = useState<TimelineEntry>();\n const messageActions = pluginUserMessageActions();\n const updateDraft =\n props.onDraftChange ?? ((text: string) => setDrafts((current) => ({ ...current, [sessionId]: text })));\n useRegistryVersion();\n const slotProps =\n props.slotProps ??\n nativeSlotProps(\n sessionId,\n statuses,\n (tabId) => setActiveTab(tabId ?? CONVERSATION_TAB),\n (text) => {\n const addition = text.trim();\n if (!addition) return;\n setDrafts((current) => {\n const draft = current[sessionId] ?? composer?.initialText ?? '';\n const separator = draft === '' || /\\s$/.test(draft) ? '' : ' ';\n return { ...current, [sessionId]: `${draft}${separator}${addition}` };\n });\n },\n );\n const pluginTabs = webTabs(sessionId);\n const tabs = [{ id: CONVERSATION_TAB, label: 'Conversation' }, ...pluginTabs.map(({ id, label }) => ({ id, label }))];\n const ActivePanel = pluginTabs.find((tab) => tab.id === activeTab)?.panel;\n const prompt =\n !props.readOnly && props.promptInput && onAnswer && onCancel\n ? // The app builds it from the dashboard's own session state, so the contract's wide shape narrows back.\n toolPromptClaim(props.promptInput as ToolPromptInput, null, sessionId)\n : null;\n const fallbackAsk =\n !props.readOnly && ask && onAnswer ? (\n <DialogSheet\n ask={ask}\n onAnswer={onAnswer}\n onCancel={onCancel}\n value={props.dialogValue}\n onChangeValue={props.onDialogValueChange}\n />\n ) : null;\n const asking =\n prompt && onAnswer && onCancel ? (\n <ToolRendererBoundary key={`${sessionId}:${prompt.dialog.id}`} toolName={prompt.entry?.name ?? 'dialog'}>\n {(failed) =>\n failed ? (\n fallbackAsk\n ) : prompt.entry ? (\n <prompt.prompt.component\n {...toolMessageProps(slotProps, prompt.entry, statuses)}\n dialog={prompt.dialog}\n answer={(value) => onAnswer(prompt.dialog.id, value)}\n cancel={() => onCancel(prompt.dialog.id)}\n />\n ) : (\n <prompt.prompt.component\n {...slotProps}\n dialog={prompt.dialog}\n answer={(value) => onAnswer(prompt.dialog.id, value)}\n cancel={() => onCancel(prompt.dialog.id)}\n />\n )\n }\n </ToolRendererBoundary>\n ) : (\n fallbackAsk\n );\n const askingId = asking === null ? undefined : (prompt?.dialog.id ?? ask?.id);\n const askingTitle = prompt?.dialog.title ?? ask?.title;\n // Screen readers hear a question once when it arrives, not on every re-render.\n useEffect(() => {\n if (askingId !== undefined)\n AccessibilityInfo.announceForAccessibility(`Po is asking: ${askingTitle ?? 'a question'}`);\n }, [askingId, askingTitle]);\n // An empty conversation a person's own package may fill on the phone; with no fill the list shows as before.\n const emptyRegion =\n entries.length === 0 ? renderRegion(HOST_SLOTS.emptyStateRegion, null, slotProps, sessionId) : null;\n const composerShown =\n !props.readOnly && !stopped && !prompt && (props.panel === undefined || props.retainComposer === true);\n return (\n <View style={styles.screen}>\n {!props.slotProps && tabs.length > 1 ? (\n <Tabs value={activeTab} onValueChange={setActiveTab}>\n <TabsList>\n {tabs.map((tab) => (\n <TabsTrigger key={tab.id} value={tab.id}>\n {tab.label}\n </TabsTrigger>\n ))}\n </TabsList>\n </Tabs>\n ) : null}\n {/* A plugin's line about this session, such as the run a workflow step belongs to; each fill pads itself. */}\n {slotFills(HOST_SLOTS.conversationStrip, sessionId).map(({ pluginId, id, component: Strip }) =>\n Strip ? <Strip key={`${pluginId}:${id}`} {...slotProps} /> : null,\n )}\n {props.panel !== undefined ? (\n <View style={styles.list}>{props.panel}</View>\n ) : ActivePanel ? (\n <View style={styles.list}>\n <ActivePanel {...slotProps} />\n </View>\n ) : emptyRegion ? (\n <View style={styles.list}>{emptyRegion}</View>\n ) : (\n <SessionTimeline\n sessionId={sessionId}\n entries={entries}\n live={props.liveTranscript}\n slotProps={slotProps}\n statuses={statuses}\n sessionToolRenderer={sessionToolRenderer}\n onMessageActions={!props.readOnly && messageActions.length ? setActionTarget : undefined}\n markdown={props.markdown}\n transcript={props.transcript}\n />\n )}\n {/* A document panel carries its own progress in the host header; only failures still show here. */}\n {props.panel !== undefined ? (\n <ActivityPanel error={error} />\n ) : props.liveTranscript ? (\n <LiveActivity sessionId={sessionId} error={error} showsWork={props.transcript?.showsWork} />\n ) : (\n <ActivityPanel status={props.transcript?.showsWork?.(entries) ? undefined : activity} error={error} />\n )}\n {offline && !props.readOnly && !stopped ? (\n <View style={styles.offline} accessibilityLiveRegion=\"polite\">\n <Text style={styles.offlineText}>Po on your computer is not connected. Your message is kept.</Text>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n loading={offline.restoring ?? false}\n loadingLabel=\"Restoring the connection\"\n onPress={offline.onRestore}\n >\n Restore\n </Button>\n </View>\n ) : null}\n {asking ? (\n // ponytail: a fixed share of the screen keeps the transcript visible; the prompt scrolls inside it.\n <View style={[styles.promptDock, !composerShown && styles.promptInset]}>\n {props.promptError ? (\n <Text style={styles.promptError} accessibilityRole=\"alert\">\n {props.promptError}\n </Text>\n ) : null}\n {asking}\n </View>\n ) : null}\n {props.contextItems?.length && (props.panel === undefined || props.retainComposer) ? (\n <View style={styles.contextItems}>\n {props.contextItems.map((item) => (\n <Button\n key={`${item.source}:${item.id}`}\n variant=\"ghost\"\n size=\"sm\"\n accessibilityLabel={`Remove ${item.label}`}\n onPress={() => props.onRemoveContext?.(item.source, item.id)}\n >\n {item.label} ×\n </Button>\n ))}\n </View>\n ) : null}\n {!props.readOnly && stopped ? (\n <View style={styles.stopped}>\n <Text style={styles.stoppedTitle}>Session stopped</Text>\n <Text style={styles.stoppedText}>\n Review the conversation above, then wake to continue.\n {stopped.folder ? ` History is on disk in ${stopped.folder}.` : ' Your history is saved.'}\n </Text>\n {stopped.error ? (\n <Text style={styles.stoppedError} accessibilityRole=\"alert\">\n {stopped.error}\n </Text>\n ) : null}\n <Button variant=\"primary\" size=\"md\" loading={stopped.waking} loadingLabel=\"Waking\" onPress={stopped.onWake}>\n Wake session\n </Button>\n </View>\n ) : composerShown ? (\n <Composer\n {...composer}\n onSend={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={sessionId}\n slotProps={slotProps}\n />\n ) : null}\n <MessageActionsSheet\n sessionId={sessionId}\n message={props.readOnly ? undefined : actionTarget}\n actions={messageActions}\n onClose={() => setActionTarget(undefined)}\n />\n {!props.readOnly &&\n slotFills(HOST_SLOTS.overlay, sessionId).map(({ pluginId, id, component: Overlay }) =>\n Overlay ? <Overlay key={`${pluginId}:${id}`} {...slotProps} /> : null,\n )}\n </View>\n );\n}\n\n/** A plugin renderer reads result images inline, so one the transcript sent by reference is filled in once read. */\nfunction PluginToolMessage<P extends { result: ToolResultView | null }>({\n message: Message,\n props,\n}: {\n message: ComponentType<P>;\n props: P;\n}) {\n const result = useImageRefs(props.result);\n return <Message {...props} result={result} />;\n}\n/** A template row reads images inline too, so it gets the entry with referenced images filled in. */\nfunction TemplateItem({\n entry,\n render,\n}: {\n entry: TimelineEntry;\n render: (entry: TimelineEntry) => ReactElement | null;\n}) {\n return render(useImageRefs(entry));\n}\nfunction LiveActivity({\n sessionId,\n error,\n showsWork,\n}: {\n sessionId: string;\n error?: string;\n showsWork?: SessionTranscript['showsWork'];\n}) {\n const mapEntry = useMemo(createNativeEntryMapper, []);\n // Entries are mapped only for a template that asks; the default screen reads the flag alone.\n const working = useStore(\n sessionStoreFor(sessionId),\n (state) => state.streaming && !showsWork?.(state.entries.flatMap(mapEntry)),\n );\n return <ActivityPanel status={working ? 'Working...' : undefined} error={error} />;\n}\n\nconst SessionTimeline = memo(function SessionTimeline({\n sessionId,\n entries,\n live,\n slotProps,\n statuses,\n sessionToolRenderer,\n onMessageActions,\n markdown,\n transcript,\n}: {\n sessionId: string;\n entries: readonly TimelineEntry[];\n live?: boolean;\n slotProps: WebPluginSlotProps;\n statuses: Readonly<Record<string, string>>;\n sessionToolRenderer?: SessionScreenProps['sessionToolRenderer'];\n onMessageActions?: (entry: TimelineEntry) => void;\n markdown?: SessionScreenProps['markdown'];\n transcript?: SessionTranscript;\n}) {\n const raw = useStore(sessionStoreFor(sessionId), (state) => (live ? state.entries : undefined));\n const mapEntry = useMemo(createNativeEntryMapper, []);\n const groupTools = useMemo(() => (transcript?.createGrouper ?? createToolGrouper)(), [transcript]);\n const data = useMemo(\n () => groupTools(raw === undefined ? entries : raw.flatMap(mapEntry)),\n [raw, entries, mapEntry, groupTools],\n );\n const registryVersion = useRegistryVersion();\n const renderTool = useCallback(\n (entry: TimelineEntry): ReactNode | null => {\n const toolName = entry.toolName;\n const tool = entry.payload as ToolPayload | undefined;\n if (!toolName || !tool) return null;\n const Message = sessionToolRenderer?.(sessionId, toolName, statuses, tool.result?.details)?.message;\n if (!Message) return null;\n // Another tool's own card for a call made on this one's behalf, as the web's nestedToolCard. Null when no\n // plugin claims the tool; the nested card gets no renderTool, so nesting stops at one level.\n const nested: NonNullable<ToolMessageRenderProps['renderTool']> = (call) => {\n const Nested = sessionToolRenderer?.(sessionId, call.toolName, statuses, call.result?.details)?.message;\n if (!Nested) return null;\n const output = (call.result?.content ?? [])\n .flatMap((item) => {\n const block = item as { type?: unknown; text?: unknown };\n return block.type === 'text' && typeof block.text === 'string' ? [block.text] : [];\n })\n .join('\\n');\n return (\n <ToolRendererBoundary toolName={call.toolName}>\n {(nestedFailed) =>\n nestedFailed ? (\n <Text selectable>{output}</Text>\n ) : (\n <PluginToolMessage\n message={Nested}\n props={{\n ...slotProps,\n toolCallId: `${tool.toolCallId}:${call.toolName}`,\n toolName: call.toolName,\n args: call.args,\n result: call.result,\n output,\n running: false,\n isError: call.isError,\n }}\n />\n )\n }\n </ToolRendererBoundary>\n );\n };\n return (\n <ToolRendererBoundary key={entry.id} toolName={toolName}>\n {(failed) =>\n failed ? (\n <TimelineItem entry={entry} />\n ) : (\n <PluginToolMessage message={Message} props={{ ...slotProps, toolName, ...tool, renderTool: nested }} />\n )\n }\n </ToolRendererBoundary>\n );\n },\n [sessionId, statuses, slotProps, sessionToolRenderer, registryVersion],\n );\n const renderItem = useCallback(\n (entry: TimelineEntry) => {\n const builtIn = (item: TimelineEntry) => (\n <MemoTimelineItem\n entry={item}\n renderTool={renderTool}\n onMessageActions={onMessageActions}\n markdown={markdown}\n />\n );\n return transcript ? (\n <TemplateItem entry={entry} render={(item) => transcript.renderItem(item, builtIn, slotProps)} />\n ) : (\n builtIn(entry)\n );\n },\n [renderTool, onMessageActions, markdown, transcript, slotProps],\n );\n return (\n <ImageRefScope value={sessionId}>\n <List\n style={styles.list}\n startAtBottom\n separators={false}\n data={data}\n keyExtractor={entryKey}\n renderItem={renderItem}\n accessibilityLabel=\"Transcript\"\n />\n </ImageRefScope>\n );\n});\n\n/** Each transcript owns its cache; removed dashboard entries are only weakly referenced. */\nexport function createNativeEntryMapper(): (entry: DashboardEntry) => TimelineEntry[] {\n const cache = new WeakMap<DashboardEntry, TimelineEntry[]>();\n return (entry) => {\n let mapped = cache.get(entry);\n if (mapped === undefined) {\n mapped = nativeEntry(entry);\n cache.set(entry, mapped);\n }\n return mapped;\n };\n}\n\n/**\n * Folds each run of two or more consecutive tool calls into `tools` entries of\n * at most TOOL_GROUP_LIMIT calls, so one list cell never mounts a whole long\n * run. Chunks count from the run's start, so keys stay put as the run grows.\n * A group whose calls are unchanged keeps its object, so the memoised row and\n * the calls in it do not re-render while another entry streams.\n */\nexport function createToolGrouper(): (entries: readonly TimelineEntry[]) => TimelineEntry[] {\n let previous = new Map<string, TimelineEntry>();\n return (entries) => {\n const next = new Map<string, TimelineEntry>();\n const out: TimelineEntry[] = [];\n let run: TimelineEntry[] = [];\n const flush = () => {\n const first = run[0];\n if (first === undefined || run.length < 2) {\n out.push(...run);\n } else {\n const id = `tools:${first.id}`;\n const old = previous.get(id);\n const same = old?.calls?.length === run.length && run.every((call, index) => old.calls?.[index] === call);\n const group: TimelineEntry = same && old !== undefined ? old : { id, role: 'tools', text: '', calls: run };\n next.set(id, group);\n out.push(group);\n }\n run = [];\n };\n for (const entry of entries) {\n if (entry.role === 'tool') {\n run.push(entry);\n if (run.length === TOOL_GROUP_LIMIT) flush();\n } else {\n flush();\n out.push(entry);\n }\n }\n flush();\n previous = next;\n return out;\n };\n}\n\nconst styles = StyleSheet.create((theme, rt) => ({\n promptDock: { maxHeight: '70%' },\n // Clears the home indicator when no composer sits below; the keyboard covers that edge while it is open.\n promptInset: { paddingBottom: rt.insets.ime > 0 ? 0 : rt.insets.bottom },\n promptError: {\n paddingHorizontal: theme.spacing(4),\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeight.sm,\n color: theme.colors.red,\n },\n contextItems: { flexDirection: 'row', flexWrap: 'wrap', paddingHorizontal: theme.spacing(3), gap: theme.spacing(2) },\n screen: {\n flex: 1,\n backgroundColor: theme.colors.bg,\n },\n list: {\n flex: 1,\n paddingVertical: theme.spacing(2),\n },\n stopped: {\n gap: theme.spacing(2),\n margin: theme.spacing(3),\n padding: theme.spacing(4),\n borderRadius: theme.borderRadius.lg,\n borderWidth: 1,\n borderColor: theme.colors['border-soft'],\n },\n stoppedTitle: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.base,\n lineHeight: theme.lineHeight.base,\n fontWeight: theme.fontWeight.semibold,\n color: theme.colors.hi,\n },\n stoppedText: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeightRelaxed.sm,\n color: theme.colors.dim,\n },\n stoppedError: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeightRelaxed.sm,\n color: theme.colors.red,\n },\n offline: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: theme.spacing(2),\n paddingLeft: theme.spacing(4),\n paddingRight: theme.spacing(2),\n },\n offlineText: {\n flex: 1,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeight.sm,\n color: theme.colors.dim,\n },\n}));\n\n/** Maps dashboard transcript entries onto the native timeline; tool payload feeds plugin renderers. */\nexport function nativeEntry(entry: DashboardEntry): TimelineEntry[] {\n const at = entry.timestamp === undefined ? {} : { timestamp: entry.timestamp };\n switch (entry.kind) {\n case 'user':\n case 'queued':\n return [\n {\n id: entry.id,\n role: 'user',\n text: entry.text,\n ...(entry.images?.length ? { images: entry.images } : {}),\n ...at,\n },\n ];\n case 'assistant': {\n if (!entry.text) return [];\n const name = entry.identity?.name ?? entry.identity?.profile;\n const author = name === undefined ? {} : { author: { name, initials: personaInitials(name) } };\n return [{ id: entry.id, role: 'assistant', text: entry.text, ...author, ...at }];\n }\n case 'intercom':\n return [\n {\n id: entry.id,\n role: 'assistant',\n text: entry.text,\n author: { name: entry.name, initials: personaInitials(entry.name) },\n ...at,\n },\n ];\n case 'notice':\n return [{ id: entry.id, role: 'notice', text: entry.text, tone: entry.tone, ...at }];\n case 'settled':\n return [{ id: entry.id, role: 'settled', text: '', tools: entry.tools, ...at }];\n case 'tool':\n return [\n {\n id: entry.id,\n role: 'tool',\n toolName: entry.name,\n text: entry.output || entry.argSummary,\n ...at,\n payload: {\n toolCallId: entry.toolCallId,\n args: entry.args,\n argSummary: entry.argSummary,\n result: entry.result,\n output: entry.output,\n running: entry.running,\n isError: entry.isError,\n },\n },\n ];\n default:\n return [];\n }\n}\n\n/** Host-owned native transcript adapters, using the same session/thread folds as the conversation. */\nexport function NativeTranscript({\n sessionId,\n threadId,\n options,\n markdown,\n}: {\n sessionId: string;\n threadId?: string;\n options?: ThreadViewOptions;\n markdown?: Pick<MarkdownProps, 'loadImage' | 'onFileLink'>;\n}) {\n useRenderTrace('NativeTranscript');\n useEffect(() => {\n if (threadId !== undefined) {\n subscribeThread(sessionId, threadId);\n return () => unsubscribeThread(sessionId, threadId);\n }\n // A transcript shown outside focus keeps its session's extension channels.\n return holdSessionChannels(sessionId);\n }, [sessionId, threadId]);\n const key = threadId === undefined ? sessionId : threadStoreKey(sessionId, threadId);\n const raw = useStore(sessionStoreFor(key), (state) => state.entries);\n const mapEntry = useMemo(createNativeEntryMapper, []);\n const entries = useMemo(() => raw.flatMap(mapEntry), [raw, mapEntry]);\n const limit = options?.limit;\n const visible = useMemo(\n () => (limit === undefined ? entries : limit <= 0 ? [] : entries.slice(-limit)),\n [entries, limit],\n );\n const renderItem = useCallback(\n (entry: TimelineEntry) => <MemoTimelineItem entry={entry} markdown={markdown} />,\n [markdown],\n );\n return (\n <ImageRefScope value={key}>\n <List\n data={visible}\n keyExtractor={entryKey}\n renderItem={renderItem}\n separators={false}\n accessibilityLabel=\"Transcript\"\n />\n </ImageRefScope>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAoDA,MAAMoD,mBAAmB;AACzB,MAAMC,gBAA0C,CAAA;AAChD,MAAMC,iBAAmD,CAAC;AAC1D,MAAMG,mBAAmBtB,KAAKgB,YAAY;AAC1C,MAAMO,YAAYC,UAAyBA,MAAMC;;AAEjD,MAAMC,mBAAmB;;AA0CzB,SAASmB,qBAA6B;CACpC,MAAM,CAACC,SAASC,QAAQzC,YAAY0C,UAAkBA,QAAQ,GAAG,CAAC;CAClE5C,gBAAgB1B,2BAA2BqE,IAAI,GAAG,CAAA,CAAE;CACpD,OAAOD;AACT;AAEA,SAAgBG,cAAcC,OAA2B;CACvDrD,eAAe,eAAe;CAC9B,MAAM,EACJsD,WACAhB,UAAUjB,eACVkC,QACAC,qBACAC,KACAC,UACAC,UACAC,UACAC,OACAtB,UACAuB,SACAC,YACEV;CACJ,MAAMW,WAAWX,MAAMW,YAAY1C;CACnC,MAAM,CAAC2C,WAAWC,gBAAgBxD,SAASU,gBAAgB;CAC3D,MAAM,CAAC+C,Q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ACvN,SAASuN,KAAK,CACjB;CACA,MAAMjN,aAAatC,aAChBqB,UAAyB,oBAAC,kBAAD;EAAyBA;EAAiB4F;CAAS,IAC7E,CAACA,QAAQ,CACX;CACA,OACE,oBAAC,eAAD;EAAe,OAAOqI;YACpB,oBAAC,MAAD;GACE,MAAME;GACN,cAAcpO;GACFkB;GACZ,YAAY;GACZ,oBAAmB;EAAY;CAEpB;AAEnB"}
|
|
1
|
+
{"version":3,"file":"SessionScreen.mjs","names":["NativeTemplateSessionProps","ToolMessageRenderProps","ToolResultView","ThreadViewOptions","WebPluginSlotProps","Button","fontOf","List","MarkdownProps","Sheet","SheetContent","SheetHeader","SheetTitle","Tabs","TabsList","TabsTrigger","ImageRefScope","subscribeWebPluginRegistry","personaInitials","sessionStoreFor","subscribeThread","unsubscribeThread","threadStoreKey","holdSessionChannels","HOST_SLOTS","pluginUserMessageActions","renderRegion","slotFills","TimelineEntry","DashboardEntry","toolMessageProps","toolPromptClaim","ToolPromptInput","ToolRendererBoundary","useImageRefs","webTabs","useRenderTrace","useStore","ComponentType","memo","ReactElement","ReactNode","useCallback","useEffect","useMemo","useReducer","useState","AccessibilityInfo","StyleSheet","ActivityPanel","Composer","ComposerProps","DialogSheet","MessageActionsSheet","nativeSlotProps","TimelineItem","CONVERSATION_TAB","EMPTY_ENTRIES","EMPTY_STATUSES","Readonly","Record","MemoTimelineItem","entryKey","entry","id","TOOL_GROUP_LIMIT","ASIDE_SNAP_POINTS","ToolPayload","toolCallId","args","result","output","running","isError","SessionScreenProps","entries","composer","Omit","transcript","SessionTranscript","composerAside","conversationOpen","onConversationOpenChange","open","asideLabel","createGrouper","renderItem","builtIn","slotProps","showsWork","useRegistryVersion","version","bump","value","SessionScreen","props","sessionId","onSend","sessionToolRenderer","ask","onAnswer","onCancel","activity","error","stopped","offline","statuses","activeTab","setActiveTab","drafts","setDrafts","actionTarget","setActionTarget","messageActions","updateDraft","onDraftChange","text","current","tabId","addition","trim","draft","initialText","separator","test","pluginTabs","tabs","label","map","ActivePanel","find","tab","panel","prompt","readOnly","promptInput","fallbackAsk","dialogValue","onDialogValueChange","asking","dialog","name","failed","askingId","undefined","askingTitle","title","announceForAccessibility","emptyRegion","length","emptyStateRegion","aside","composerShown","retainComposer","composerProps","disabled","Boolean","draftStore","onChangeText","promptDock","inset","styles","promptInset","promptError","contextChips","contextItems","item","source","onRemoveContext","asideFooter","about","screen","conversationStrip","pluginId","component","Strip","list","liveTranscript","markdown","offlineText","restoring","onRestore","stoppedTitle","stoppedText","folder","stoppedError","waking","onWake","overlay","Overlay","PluginToolMessage","message","Message","P","TemplateItem","render","LiveActivity","mapEntry","createNativeEntryMapper","working","state","streaming","flatMap","SessionTimeline","live","onMessageActions","raw","groupTools","createToolGrouper","data","registryVersion","renderTool","toolName","tool","payload","details","nested","NonNullable","call","Nested","content","block","type","join","nestedFailed","cache","WeakMap","mapped","get","nativeEntry","set","previous","Map","next","out","run","flush","first","push","old","same","calls","every","index","group","role","create","theme","rt","maxHeight","paddingBottom","insets","ime","bottom","uni__dependencies","paddingHorizontal","spacing","fontFamily","sans","fontSize","sm","lineHeight","color","colors","red","gap","dim","flexDirection","flexWrap","flex","backgroundColor","bg","paddingVertical","margin","padding","borderRadius","lg","borderWidth","borderColor","base","fontWeight","semibold","hi","lineHeightRelaxed","alignItems","paddingLeft","paddingRight","at","timestamp","kind","images","identity","profile","author","initials","tone","tools","argSummary","NativeTranscript","threadId","options","Pick","key","limit","visible","slice"],"sources":["../../src/screens/SessionScreen.tsx"],"sourcesContent":["import type { NativeTemplateSessionProps } from '@agimon-ai/po-core/native';\nimport type {\n ToolMessageRenderProps,\n ToolResultView,\n ThreadViewOptions,\n WebPluginSlotProps,\n} from '@agimon-ai/po-core/web';\nimport {\n Button,\n fontOf,\n List,\n type MarkdownProps,\n Sheet,\n SheetContent,\n SheetHeader,\n SheetTitle,\n Tabs,\n TabsList,\n TabsTrigger,\n} from '@agimon-ai/po-native-components';\nimport {\n ImageRefScope,\n subscribeWebPluginRegistry,\n personaInitials,\n sessionStoreFor,\n subscribeThread,\n unsubscribeThread,\n threadStoreKey,\n holdSessionChannels,\n HOST_SLOTS,\n pluginUserMessageActions,\n renderRegion,\n slotFills,\n type TimelineEntry as DashboardEntry,\n toolMessageProps,\n toolPromptClaim,\n type ToolPromptInput,\n ToolRendererBoundary,\n useImageRefs,\n webTabs,\n useRenderTrace,\n} from '@agimon-ai/po-web-dashboard/core';\nimport { useStore } from '@tanstack/react-store';\nimport {\n type ComponentType,\n memo,\n type ReactElement,\n type ReactNode,\n useCallback,\n useEffect,\n useMemo,\n useReducer,\n useState,\n} from 'react';\nimport { AccessibilityInfo, Text, View } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport { ActivityPanel } from '../components/ActivityPanel';\nimport { Composer, type ComposerProps } from '../components/Composer';\nimport { DialogSheet } from '../components/DialogSheet';\nimport { MessageActionsSheet } from '../components/MessageActionsSheet';\nimport { nativeSlotProps } from '../components/slotProps';\nimport { type TimelineEntry, TimelineItem } from '../components/TimelineItem';\n\nconst CONVERSATION_TAB = 'conversation';\nconst EMPTY_ENTRIES: readonly TimelineEntry[] = [];\nconst EMPTY_STATUSES: Readonly<Record<string, string>> = {};\nconst MemoTimelineItem = memo(TimelineItem);\nconst entryKey = (entry: TimelineEntry) => entry.id;\n/** The most tool calls one transcript cell holds; a longer run splits into several groups. */\nconst TOOL_GROUP_LIMIT = 20;\n/** The conversation sheet's one detent, leaving the panel above it in view. */\nconst ASIDE_SNAP_POINTS = ['58%'];\n\n/** The tool entry fields a plugin renderer reads, carried as TimelineEntry.payload. */\nexport interface ToolPayload {\n toolCallId: string;\n args: Record<string, unknown>;\n result: ToolResultView | null;\n output: string;\n running: boolean;\n isError: boolean;\n}\n\n/**\n * The app's session contract plus the presentation hooks a template may add. Every addition is\n * optional, so a template screen typed with these props still accepts what the app hands it.\n */\nexport interface SessionScreenProps extends NativeTemplateSessionProps {\n entries?: readonly TimelineEntry[];\n /** Options and run controls for the composer row. */\n composer?: Omit<ComposerProps, 'onSend' | 'disabled' | 'value' | 'onChangeText'>;\n /** Lets a template regroup and redraw transcript rows; absent keeps the built-in tool groups and rows. */\n transcript?: SessionTranscript;\n /** With a retained-composer panel, the prompt lives in a conversation sheet over the panel instead of below it. */\n composerAside?: boolean;\n /** Whether that conversation sheet is open; the app owns it so the panel can open it too. */\n conversationOpen?: boolean;\n onConversationOpenChange?: (open: boolean) => void;\n /** What the panel shows, named in the sheet's About line; absent leaves the line out. */\n asideLabel?: string;\n}\n\nexport interface SessionTranscript {\n /** Called once per transcript, so the grouper can keep unchanged groups by identity between renders. */\n createGrouper: () => (entries: readonly TimelineEntry[]) => TimelineEntry[];\n /**\n * `entry` arrives with images the transcript sent by reference filled in once read.\n * `builtIn` draws one entry the default way, with plugin tool cards, for rows the template keeps.\n */\n renderItem: (\n entry: TimelineEntry,\n builtIn: (entry: TimelineEntry) => ReactElement,\n /** The session's slot props, for a row that opens plugin surfaces such as Author. */\n slotProps: WebPluginSlotProps,\n ) => ReactElement | null;\n /** True when a row already shows the turn at work, so the screen leaves out its own Working line. */\n showsWork?: (entries: readonly TimelineEntry[]) => boolean;\n}\n\n/** Re-renders when plugin installs change what the registry resolves. */\nfunction useRegistryVersion(): number {\n const [version, bump] = useReducer((value: number) => value + 1, 0);\n useEffect(() => subscribeWebPluginRegistry(bump), []);\n return version;\n}\n\nexport function SessionScreen(props: SessionScreenProps) {\n useRenderTrace('SessionScreen');\n const {\n sessionId,\n entries = EMPTY_ENTRIES,\n onSend,\n sessionToolRenderer,\n ask,\n onAnswer,\n onCancel,\n activity,\n error,\n composer,\n stopped,\n offline,\n } = props;\n const statuses = props.statuses ?? EMPTY_STATUSES;\n const [activeTab, setActiveTab] = useState(CONVERSATION_TAB);\n const [drafts, setDrafts] = useState<Record<string, string>>({});\n const [actionTarget, setActionTarget] = useState<TimelineEntry>();\n const messageActions = pluginUserMessageActions();\n const updateDraft =\n props.onDraftChange ?? ((text: string) => setDrafts((current) => ({ ...current, [sessionId]: text })));\n useRegistryVersion();\n const slotProps =\n props.slotProps ??\n nativeSlotProps(\n sessionId,\n statuses,\n (tabId) => setActiveTab(tabId ?? CONVERSATION_TAB),\n (text) => {\n const addition = text.trim();\n if (!addition) return;\n setDrafts((current) => {\n const draft = current[sessionId] ?? composer?.initialText ?? '';\n const separator = draft === '' || /\\s$/.test(draft) ? '' : ' ';\n return { ...current, [sessionId]: `${draft}${separator}${addition}` };\n });\n },\n );\n const pluginTabs = webTabs(sessionId);\n const tabs = [{ id: CONVERSATION_TAB, label: 'Conversation' }, ...pluginTabs.map(({ id, label }) => ({ id, label }))];\n const ActivePanel = pluginTabs.find((tab) => tab.id === activeTab)?.panel;\n const prompt =\n !props.readOnly && props.promptInput && onAnswer && onCancel\n ? // The app builds it from the dashboard's own session state, so the contract's wide shape narrows back.\n toolPromptClaim(props.promptInput as ToolPromptInput, null, sessionId)\n : null;\n const fallbackAsk =\n !props.readOnly && ask && onAnswer ? (\n <DialogSheet\n ask={ask}\n onAnswer={onAnswer}\n onCancel={onCancel}\n value={props.dialogValue}\n onChangeValue={props.onDialogValueChange}\n />\n ) : null;\n const asking =\n prompt && onAnswer && onCancel ? (\n <ToolRendererBoundary key={`${sessionId}:${prompt.dialog.id}`} toolName={prompt.entry?.name ?? 'dialog'}>\n {(failed) =>\n failed ? (\n fallbackAsk\n ) : prompt.entry ? (\n <prompt.prompt.component\n {...toolMessageProps(slotProps, prompt.entry, statuses)}\n dialog={prompt.dialog}\n answer={(value) => onAnswer(prompt.dialog.id, value)}\n cancel={() => onCancel(prompt.dialog.id)}\n />\n ) : (\n <prompt.prompt.component\n {...slotProps}\n dialog={prompt.dialog}\n answer={(value) => onAnswer(prompt.dialog.id, value)}\n cancel={() => onCancel(prompt.dialog.id)}\n />\n )\n }\n </ToolRendererBoundary>\n ) : (\n fallbackAsk\n );\n const askingId = asking === null ? undefined : (prompt?.dialog.id ?? ask?.id);\n const askingTitle = prompt?.dialog.title ?? ask?.title;\n // Screen readers hear a question once when it arrives, not on every re-render.\n useEffect(() => {\n if (askingId !== undefined)\n AccessibilityInfo.announceForAccessibility(`Po is asking: ${askingTitle ?? 'a question'}`);\n }, [askingId, askingTitle]);\n // An empty conversation a person's own package may fill on the phone; with no fill the list shows as before.\n const emptyRegion =\n entries.length === 0 ? renderRegion(HOST_SLOTS.emptyStateRegion, null, slotProps, sessionId) : null;\n const aside = props.composerAside === true && props.panel !== undefined;\n const conversationOpen = aside && props.conversationOpen === true;\n const composerShown =\n !aside && !props.readOnly && !stopped && !prompt && (props.panel === undefined || props.retainComposer === true);\n const composerProps: ComposerProps = {\n ...composer,\n onSend,\n disabled: Boolean(ask),\n value: props.draftStore ? undefined : (props.draft ?? drafts[sessionId] ?? composer?.initialText ?? ''),\n onChangeText: props.draftStore ? undefined : updateDraft,\n draftStore: props.draftStore,\n sessionId,\n slotProps,\n };\n const promptDock = (inset: boolean) => (\n // ponytail: a fixed share of the screen keeps the transcript visible; the prompt scrolls inside it.\n <View style={[styles.promptDock, inset && styles.promptInset]}>\n {props.promptError ? (\n <Text style={styles.promptError} accessibilityRole=\"alert\">\n {props.promptError}\n </Text>\n ) : null}\n {asking}\n </View>\n );\n const contextChips = props.contextItems?.length ? (\n <View style={styles.contextItems}>\n {props.contextItems.map((item) => (\n <Button\n key={`${item.source}:${item.id}`}\n variant=\"ghost\"\n size=\"sm\"\n accessibilityLabel={`Remove ${item.label}`}\n onPress={() => props.onRemoveContext?.(item.source, item.id)}\n >\n {item.label} ×\n </Button>\n ))}\n </View>\n ) : null;\n // The footer stays given so the sheet keeps its footer slot; its content mounts only while open, so the\n // composer's autoFocus lands after present() has dismissed the keyboard of the field behind.\n const asideFooter = aside ? (\n <View style={styles.asideFooter}>\n {conversationOpen ? (\n <>\n {contextChips}\n {props.asideLabel ? (\n <Text style={styles.about} numberOfLines={1}>\n About {props.asideLabel}\n </Text>\n ) : null}\n {asking ? (\n promptDock(false)\n ) : !props.readOnly && !stopped ? (\n <Composer {...composerProps} quiet autoFocus />\n ) : null}\n </>\n ) : null}\n </View>\n ) : undefined;\n return (\n <View style={styles.screen}>\n {!props.slotProps && tabs.length > 1 ? (\n <Tabs value={activeTab} onValueChange={setActiveTab}>\n <TabsList>\n {tabs.map((tab) => (\n <TabsTrigger key={tab.id} value={tab.id}>\n {tab.label}\n </TabsTrigger>\n ))}\n </TabsList>\n </Tabs>\n ) : null}\n {/* A plugin's line about this session, such as the run a workflow step belongs to; each fill pads itself. */}\n {slotFills(HOST_SLOTS.conversationStrip, sessionId).map(({ pluginId, id, component: Strip }) =>\n Strip ? <Strip key={`${pluginId}:${id}`} {...slotProps} /> : null,\n )}\n {props.panel !== undefined ? (\n <View style={styles.list}>{props.panel}</View>\n ) : ActivePanel ? (\n <View style={styles.list}>\n <ActivePanel {...slotProps} />\n </View>\n ) : emptyRegion ? (\n <View style={styles.list}>{emptyRegion}</View>\n ) : (\n <SessionTimeline\n sessionId={sessionId}\n entries={entries}\n live={props.liveTranscript}\n slotProps={slotProps}\n statuses={statuses}\n sessionToolRenderer={sessionToolRenderer}\n onMessageActions={!props.readOnly && messageActions.length ? setActionTarget : undefined}\n markdown={props.markdown}\n transcript={props.transcript}\n />\n )}\n {/* A document panel carries its own progress in the host header; only failures still show here. */}\n {props.panel !== undefined ? (\n <ActivityPanel error={error} />\n ) : props.liveTranscript ? (\n <LiveActivity sessionId={sessionId} error={error} showsWork={props.transcript?.showsWork} />\n ) : (\n <ActivityPanel status={props.transcript?.showsWork?.(entries) ? undefined : activity} error={error} />\n )}\n {offline && !props.readOnly && !stopped ? (\n <View style={styles.offline} accessibilityLiveRegion=\"polite\">\n <Text style={styles.offlineText}>Po on your computer is not connected. Your message is kept.</Text>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n loading={offline.restoring ?? false}\n loadingLabel=\"Restoring the connection\"\n onPress={offline.onRestore}\n >\n Restore\n </Button>\n </View>\n ) : null}\n {/* A question stays in view below the panel while the sheet is closed; the open sheet carries it. */}\n {asking && !conversationOpen ? promptDock(!composerShown) : null}\n {!aside && (props.panel === undefined || props.retainComposer) ? contextChips : null}\n {!props.readOnly && stopped ? (\n <View style={styles.stopped}>\n <Text style={styles.stoppedTitle}>Session stopped</Text>\n <Text style={styles.stoppedText}>\n Review the conversation above, then wake to continue.\n {stopped.folder ? ` History is on disk in ${stopped.folder}.` : ' Your history is saved.'}\n </Text>\n {stopped.error ? (\n <Text style={styles.stoppedError} accessibilityRole=\"alert\">\n {stopped.error}\n </Text>\n ) : null}\n <Button variant=\"primary\" size=\"md\" loading={stopped.waking} loadingLabel=\"Waking\" onPress={stopped.onWake}>\n Wake session\n </Button>\n </View>\n ) : composerShown ? (\n <Composer {...composerProps} />\n ) : null}\n {aside ? (\n // No backdrop: the panel above stays visible and usable while the conversation is open.\n <Sheet open={conversationOpen} onOpenChange={props.onConversationOpenChange}>\n <SheetContent\n snapPoints={ASIDE_SNAP_POINTS}\n backdrop={false}\n keep\n background=\"bg\"\n scrollable={false}\n footer={asideFooter}\n >\n <SheetHeader closeLabel=\"Close the conversation\">\n <SheetTitle>Conversation</SheetTitle>\n </SheetHeader>\n <SessionTimeline\n sessionId={sessionId}\n entries={entries}\n live={props.liveTranscript}\n slotProps={slotProps}\n statuses={statuses}\n sessionToolRenderer={sessionToolRenderer}\n onMessageActions={!props.readOnly && messageActions.length ? setActionTarget : undefined}\n markdown={props.markdown}\n transcript={props.transcript}\n />\n </SheetContent>\n </Sheet>\n ) : null}\n <MessageActionsSheet\n sessionId={sessionId}\n message={props.readOnly ? undefined : actionTarget}\n actions={messageActions}\n onClose={() => setActionTarget(undefined)}\n />\n {!props.readOnly &&\n slotFills(HOST_SLOTS.overlay, sessionId).map(({ pluginId, id, component: Overlay }) =>\n Overlay ? <Overlay key={`${pluginId}:${id}`} {...slotProps} /> : null,\n )}\n </View>\n );\n}\n\n/** A plugin renderer reads result images inline, so one the transcript sent by reference is filled in once read. */\nfunction PluginToolMessage<P extends { result: ToolResultView | null }>({\n message: Message,\n props,\n}: {\n message: ComponentType<P>;\n props: P;\n}) {\n const result = useImageRefs(props.result);\n return <Message {...props} result={result} />;\n}\n/** A template row reads images inline too, so it gets the entry with referenced images filled in. */\nfunction TemplateItem({\n entry,\n render,\n}: {\n entry: TimelineEntry;\n render: (entry: TimelineEntry) => ReactElement | null;\n}) {\n return render(useImageRefs(entry));\n}\nfunction LiveActivity({\n sessionId,\n error,\n showsWork,\n}: {\n sessionId: string;\n error?: string;\n showsWork?: SessionTranscript['showsWork'];\n}) {\n const mapEntry = useMemo(createNativeEntryMapper, []);\n // Entries are mapped only for a template that asks; the default screen reads the flag alone.\n const working = useStore(\n sessionStoreFor(sessionId),\n (state) => state.streaming && !showsWork?.(state.entries.flatMap(mapEntry)),\n );\n return <ActivityPanel status={working ? 'Working...' : undefined} error={error} />;\n}\n\nconst SessionTimeline = memo(function SessionTimeline({\n sessionId,\n entries,\n live,\n slotProps,\n statuses,\n sessionToolRenderer,\n onMessageActions,\n markdown,\n transcript,\n}: {\n sessionId: string;\n entries: readonly TimelineEntry[];\n live?: boolean;\n slotProps: WebPluginSlotProps;\n statuses: Readonly<Record<string, string>>;\n sessionToolRenderer?: SessionScreenProps['sessionToolRenderer'];\n onMessageActions?: (entry: TimelineEntry) => void;\n markdown?: SessionScreenProps['markdown'];\n transcript?: SessionTranscript;\n}) {\n const raw = useStore(sessionStoreFor(sessionId), (state) => (live ? state.entries : undefined));\n const mapEntry = useMemo(createNativeEntryMapper, []);\n const groupTools = useMemo(() => (transcript?.createGrouper ?? createToolGrouper)(), [transcript]);\n const data = useMemo(\n () => groupTools(raw === undefined ? entries : raw.flatMap(mapEntry)),\n [raw, entries, mapEntry, groupTools],\n );\n const registryVersion = useRegistryVersion();\n const renderTool = useCallback(\n (entry: TimelineEntry): ReactNode | null => {\n const toolName = entry.toolName;\n const tool = entry.payload as ToolPayload | undefined;\n if (!toolName || !tool) return null;\n const Message = sessionToolRenderer?.(sessionId, toolName, statuses, tool.result?.details)?.message;\n if (!Message) return null;\n // Another tool's own card for a call made on this one's behalf, as the web's nestedToolCard. Null when no\n // plugin claims the tool; the nested card gets no renderTool, so nesting stops at one level.\n const nested: NonNullable<ToolMessageRenderProps['renderTool']> = (call) => {\n const Nested = sessionToolRenderer?.(sessionId, call.toolName, statuses, call.result?.details)?.message;\n if (!Nested) return null;\n const output = (call.result?.content ?? [])\n .flatMap((item) => {\n const block = item as { type?: unknown; text?: unknown };\n return block.type === 'text' && typeof block.text === 'string' ? [block.text] : [];\n })\n .join('\\n');\n return (\n <ToolRendererBoundary toolName={call.toolName}>\n {(nestedFailed) =>\n nestedFailed ? (\n <Text selectable>{output}</Text>\n ) : (\n <PluginToolMessage\n message={Nested}\n props={{\n ...slotProps,\n toolCallId: `${tool.toolCallId}:${call.toolName}`,\n toolName: call.toolName,\n args: call.args,\n result: call.result,\n output,\n running: false,\n isError: call.isError,\n }}\n />\n )\n }\n </ToolRendererBoundary>\n );\n };\n return (\n <ToolRendererBoundary key={entry.id} toolName={toolName}>\n {(failed) =>\n failed ? (\n <TimelineItem entry={entry} />\n ) : (\n <PluginToolMessage message={Message} props={{ ...slotProps, toolName, ...tool, renderTool: nested }} />\n )\n }\n </ToolRendererBoundary>\n );\n },\n [sessionId, statuses, slotProps, sessionToolRenderer, registryVersion],\n );\n const renderItem = useCallback(\n (entry: TimelineEntry) => {\n const builtIn = (item: TimelineEntry) => (\n <MemoTimelineItem\n entry={item}\n renderTool={renderTool}\n onMessageActions={onMessageActions}\n markdown={markdown}\n />\n );\n return transcript ? (\n <TemplateItem entry={entry} render={(item) => transcript.renderItem(item, builtIn, slotProps)} />\n ) : (\n builtIn(entry)\n );\n },\n [renderTool, onMessageActions, markdown, transcript, slotProps],\n );\n return (\n <ImageRefScope value={sessionId}>\n <List\n style={styles.list}\n startAtBottom\n separators={false}\n data={data}\n keyExtractor={entryKey}\n renderItem={renderItem}\n accessibilityLabel=\"Transcript\"\n />\n </ImageRefScope>\n );\n});\n\n/** Each transcript owns its cache; removed dashboard entries are only weakly referenced. */\nexport function createNativeEntryMapper(): (entry: DashboardEntry) => TimelineEntry[] {\n const cache = new WeakMap<DashboardEntry, TimelineEntry[]>();\n return (entry) => {\n let mapped = cache.get(entry);\n if (mapped === undefined) {\n mapped = nativeEntry(entry);\n cache.set(entry, mapped);\n }\n return mapped;\n };\n}\n\n/**\n * Folds each run of two or more consecutive tool calls into `tools` entries of\n * at most TOOL_GROUP_LIMIT calls, so one list cell never mounts a whole long\n * run. Chunks count from the run's start, so keys stay put as the run grows.\n * A group whose calls are unchanged keeps its object, so the memoised row and\n * the calls in it do not re-render while another entry streams.\n */\nexport function createToolGrouper(): (entries: readonly TimelineEntry[]) => TimelineEntry[] {\n let previous = new Map<string, TimelineEntry>();\n return (entries) => {\n const next = new Map<string, TimelineEntry>();\n const out: TimelineEntry[] = [];\n let run: TimelineEntry[] = [];\n const flush = () => {\n const first = run[0];\n if (first === undefined || run.length < 2) {\n out.push(...run);\n } else {\n const id = `tools:${first.id}`;\n const old = previous.get(id);\n const same = old?.calls?.length === run.length && run.every((call, index) => old.calls?.[index] === call);\n const group: TimelineEntry = same && old !== undefined ? old : { id, role: 'tools', text: '', calls: run };\n next.set(id, group);\n out.push(group);\n }\n run = [];\n };\n for (const entry of entries) {\n if (entry.role === 'tool') {\n run.push(entry);\n if (run.length === TOOL_GROUP_LIMIT) flush();\n } else {\n flush();\n out.push(entry);\n }\n }\n flush();\n previous = next;\n return out;\n };\n}\n\nconst styles = StyleSheet.create((theme, rt) => ({\n promptDock: { maxHeight: '70%' },\n // Clears the home indicator when no composer sits below; the keyboard covers that edge while it is open.\n promptInset: { paddingBottom: rt.insets.ime > 0 ? 0 : rt.insets.bottom },\n promptError: {\n paddingHorizontal: theme.spacing(4),\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeight.sm,\n color: theme.colors.red,\n },\n asideFooter: { gap: theme.spacing(1) },\n about: {\n paddingHorizontal: theme.spacing(4),\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeight.sm,\n color: theme.colors.dim,\n },\n contextItems: { flexDirection: 'row', flexWrap: 'wrap', paddingHorizontal: theme.spacing(3), gap: theme.spacing(2) },\n screen: {\n flex: 1,\n backgroundColor: theme.colors.bg,\n },\n list: {\n flex: 1,\n paddingVertical: theme.spacing(2),\n },\n stopped: {\n gap: theme.spacing(2),\n margin: theme.spacing(3),\n padding: theme.spacing(4),\n borderRadius: theme.borderRadius.lg,\n borderWidth: 1,\n borderColor: theme.colors['border-soft'],\n },\n stoppedTitle: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.base,\n lineHeight: theme.lineHeight.base,\n fontWeight: theme.fontWeight.semibold,\n color: theme.colors.hi,\n },\n stoppedText: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeightRelaxed.sm,\n color: theme.colors.dim,\n },\n stoppedError: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeightRelaxed.sm,\n color: theme.colors.red,\n },\n offline: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: theme.spacing(2),\n paddingLeft: theme.spacing(4),\n paddingRight: theme.spacing(2),\n },\n offlineText: {\n flex: 1,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeight.sm,\n color: theme.colors.dim,\n },\n}));\n\n/** Maps dashboard transcript entries onto the native timeline; tool payload feeds plugin renderers. */\nexport function nativeEntry(entry: DashboardEntry): TimelineEntry[] {\n const at = entry.timestamp === undefined ? {} : { timestamp: entry.timestamp };\n switch (entry.kind) {\n case 'user':\n case 'queued':\n return [\n {\n id: entry.id,\n role: 'user',\n text: entry.text,\n ...(entry.images?.length ? { images: entry.images } : {}),\n ...at,\n },\n ];\n case 'assistant': {\n if (!entry.text) return [];\n const name = entry.identity?.name ?? entry.identity?.profile;\n const author = name === undefined ? {} : { author: { name, initials: personaInitials(name) } };\n return [{ id: entry.id, role: 'assistant', text: entry.text, ...author, ...at }];\n }\n case 'intercom':\n return [\n {\n id: entry.id,\n role: 'assistant',\n text: entry.text,\n author: { name: entry.name, initials: personaInitials(entry.name) },\n ...at,\n },\n ];\n case 'notice':\n return [{ id: entry.id, role: 'notice', text: entry.text, tone: entry.tone, ...at }];\n case 'settled':\n return [{ id: entry.id, role: 'settled', text: '', tools: entry.tools, ...at }];\n case 'tool':\n return [\n {\n id: entry.id,\n role: 'tool',\n toolName: entry.name,\n text: entry.output || entry.argSummary,\n ...at,\n payload: {\n toolCallId: entry.toolCallId,\n args: entry.args,\n argSummary: entry.argSummary,\n result: entry.result,\n output: entry.output,\n running: entry.running,\n isError: entry.isError,\n },\n },\n ];\n default:\n return [];\n }\n}\n\n/** Host-owned native transcript adapters, using the same session/thread folds as the conversation. */\nexport function NativeTranscript({\n sessionId,\n threadId,\n options,\n markdown,\n}: {\n sessionId: string;\n threadId?: string;\n options?: ThreadViewOptions;\n markdown?: Pick<MarkdownProps, 'loadImage' | 'onFileLink'>;\n}) {\n useRenderTrace('NativeTranscript');\n useEffect(() => {\n if (threadId !== undefined) {\n subscribeThread(sessionId, threadId);\n return () => unsubscribeThread(sessionId, threadId);\n }\n // A transcript shown outside focus keeps its session's extension channels.\n return holdSessionChannels(sessionId);\n }, [sessionId, threadId]);\n const key = threadId === undefined ? sessionId : threadStoreKey(sessionId, threadId);\n const raw = useStore(sessionStoreFor(key), (state) => state.entries);\n const mapEntry = useMemo(createNativeEntryMapper, []);\n const entries = useMemo(() => raw.flatMap(mapEntry), [raw, mapEntry]);\n const limit = options?.limit;\n const visible = useMemo(\n () => (limit === undefined ? entries : limit <= 0 ? [] : entries.slice(-limit)),\n [entries, limit],\n );\n const renderItem = useCallback(\n (entry: TimelineEntry) => <MemoTimelineItem entry={entry} markdown={markdown} />,\n [markdown],\n );\n return (\n <ImageRefScope value={key}>\n <List\n data={visible}\n keyExtractor={entryKey}\n renderItem={renderItem}\n separators={false}\n accessibilityLabel=\"Transcript\"\n />\n </ImageRefScope>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAgEA,MAAMwD,mBAAmB;AACzB,MAAMC,gBAA0C,CAAA;AAChD,MAAMC,iBAAmD,CAAC;AAC1D,MAAMG,mBAAmBtB,KAAKgB,YAAY;AAC1C,MAAMO,YAAYC,UAAyBA,MAAMC;;AAEjD,MAAMC,mBAAmB;;AAEzB,MAAMC,oBAAoB,CAAC,KAAK;;AAiDhC,SAASwB,qBAA6B;CACpC,MAAM,CAACC,SAASC,QAAQ/C,YAAYgD,UAAkBA,QAAQ,GAAG,CAAC;CAClElD,gBAAgB1B,2BAA2B2E,IAAI,GAAG,CAAA,CAAE;CACpD,OAAOD;AACT;AAEA,SAAgBG,cAAcC,OAA2B;CACvD3D,eAAe,eAAe;CAC9B,MAAM,EACJ4D,WACArB,UAAUlB,eACVwC,QACAC,qBACAC,KACAC,UACAC,UACAC,UACAC,OACA3B,UACA4B,SACAC,YACEV;CACJ,MAAMW,WAAWX,MAAMW,YAAYhD;CACnC,MAAM,CAACiD,WAAWC,gBAAgB9D,SAASU,gBAAgB;CAC3D,MAAM,CAACqD,QAAQC,aAAahE,SAAiC,CAAC,CAAC;CAC/D,MAAM,CAACiE,cAAcC,mBAAmBlE,SAAwB;CAChE,MAAMmE,iBAAiBxF,yBAAyB;CAChD,MAAMyF,cACJnB,MAAMoB,mBAAmBC,SAAiBN,WAAWO,aAAa;EAAE,GAAGA;GAAUrB,YAAYoB;CAAK,EAAE;CACtG1B,mBAAmB;CACnB,MAAMF,YACJO,MAAMP,aACNlC,gBACE0C,WACAU,WACCY,UAAUV,aAAaU,SAAS9D,gBAAgB,IAChD4D,SAAS;EACR,MAAMG,WAAWH,KAAKI,KAAK;EAC3B,IAAI,CAACD,UAAU;EACfT,WAAWO,YAAY;GACrB,MAAMI,QAAQJ,QAAQrB,cAAcpB,UAAU8C,eAAe;GAC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imon-ai/po-native-dashboard",
|
|
3
|
-
"version": "0.0.0-alpha.
|
|
3
|
+
"version": "0.0.0-alpha.39",
|
|
4
4
|
"description": "Shared React Native session views for Po native templates: transcript, composer and session sheets.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -43,14 +43,14 @@
|
|
|
43
43
|
"access": "public"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@agimon-ai/po-core": "0.0.0-alpha.
|
|
47
|
-
"@agimon-ai/po-native-components": "0.0.0-alpha.
|
|
48
|
-
"@agimon-ai/po-web-dashboard": "0.0.0-alpha.
|
|
46
|
+
"@agimon-ai/po-core": "0.0.0-alpha.167",
|
|
47
|
+
"@agimon-ai/po-native-components": "0.0.0-alpha.167",
|
|
48
|
+
"@agimon-ai/po-web-dashboard": "0.0.0-alpha.167"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@agimon-ai/po-build": "0.0.0-alpha.
|
|
52
|
-
"@agimon-ai/po-web-components": "0.0.0-alpha.
|
|
53
|
-
"@agimon-ai/vibe-lint-plugin-po-core": "0.0.0-alpha.
|
|
51
|
+
"@agimon-ai/po-build": "0.0.0-alpha.167",
|
|
52
|
+
"@agimon-ai/po-web-components": "0.0.0-alpha.167",
|
|
53
|
+
"@agimon-ai/vibe-lint-plugin-po-core": "0.0.0-alpha.167",
|
|
54
54
|
"@tanstack/react-store": "0.11.2",
|
|
55
55
|
"@tanstack/store": "0.11.2",
|
|
56
56
|
"@types/node": "26.6.5",
|