@agimon-ai/po-codemode 0.0.1-alpha.37 → 0.0.1-alpha.38

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.
@@ -115,7 +115,7 @@ function CallRow({ call }) {
115
115
  const opens = hasArgs || printed;
116
116
  return /* @__PURE__ */ jsxs(View, {
117
117
  testID: "exec-call",
118
- style: styles.card,
118
+ style: styles.call,
119
119
  children: [
120
120
  /* @__PURE__ */ jsxs(Pressable, {
121
121
  disabled: !opens,
@@ -319,13 +319,8 @@ const styles = StyleSheet.create((theme) => ({
319
319
  borderColor: theme.colors["border-soft"],
320
320
  uni__dependencies: [0]
321
321
  },
322
- card: {
322
+ call: {
323
323
  gap: theme.spacing(2),
324
- paddingHorizontal: theme.spacing(3),
325
- paddingVertical: theme.spacing(1),
326
- borderWidth: 1,
327
- borderRadius: theme.borderRadius.lg,
328
- borderColor: theme.colors["border-soft"],
329
324
  uni__dependencies: [0]
330
325
  },
331
326
  press: {
@@ -1 +1 @@
1
- {"version":3,"file":"native.mjs","names":["ToolMessageRenderProps","CodeBlock","fontOf","Markdown","MessageItem","MessageItemBody","MessageItemHeader","toolTone","PoNativeTheme","useState","StyleSheet","callArgsSummary","execCalls","execCode","execResultView","execSummary","execToolName","readsAsDocument","ExecCall","ExecImage","ExecToolCardProps","defaultExpanded","Visuals","text","images","label","map","image","index","mimeType","String","uri","data","styles","CallRow","call","open","setOpen","view","result","lines","join","printed","hasArgs","Object","keys","args","length","opens","card","value","undefined","expanded","press","argsLine","mono","name","shrink","sans","dim","keep","ok","error","ms","JSON","stringify","Returned","isError","document","whole","leaf","stack","ExecToolCard","running","code","calls","details","failed","filter","settled","summary","rail","create","theme","flex","flexDirection","alignItems","gap","spacing","minWidth","uni__dependencies","flexShrink","marginHorizontal","marginBottom","paddingLeft","borderLeftWidth","borderColor","colors","paddingHorizontal","paddingVertical","borderWidth","borderRadius","lg","minHeight","justifyContent","fontFamily","fontSize","sm","lineHeight","fontWeight","color","green","red","width","aspectRatio","md","toolExec"],"sources":["../../src/extensions/workspaces/sessions/(frontend)/tool/_lib/execToolView.ts","../../src/extensions/workspaces/sessions/(frontend)/tool/_components/ExecToolCard.native.tsx","../../src/extensions/workspaces/sessions/(frontend)/tool/exec.native.tsx","../../generated/native.ts"],"sourcesContent":["// Imports nothing at runtime: the web and native cards share it, and the native\n// bundle may not load the web contract.\nimport type { ToolResultView } from '@agimon-ai/po-core/web';\n\n/** Tool names this package registers (registerTool's `name`). */\nexport const execToolName = 'exec' as const;\nexport const discoverToolName = 'discover' as const;\n\nconst SUMMARY_MAX = 120;\nconst ARGS_MAX = 160;\nconst CALLS_MAX = 50;\nconst IMAGE_TYPES = /^image\\/(?:png|jpeg|webp|gif)$/u;\nconst SAVED_LINE = /^Saved as (\\S+) \\((.+)\\)$/u;\n// A heading or a fence starts a line of Markdown, never one of JSON or a log.\nconst DOCUMENT_LINE = /^(?:#{1,6} |```)/mu;\n\nfunction record(value: unknown): Record<string, unknown> | undefined {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : undefined;\n}\n\nfunction clip(text: string, max: number): string {\n return text.length <= max ? text : `${text.slice(0, max - 1)}…`;\n}\n\n/** The script the call ran, exactly as the agent wrote it. */\nexport function execCode(args: Readonly<Record<string, unknown>>): string {\n return typeof args.code === 'string' ? args.code : '';\n}\n\n/** The header line: the script's first line, with a leading `//` comment marker dropped. */\nexport function execSummary(args: Readonly<Record<string, unknown>>): string {\n const first = execCode(args)\n .split('\\n')\n .map((line) => line.trim())\n .find((line) => line !== '');\n if (first === undefined) return 'script';\n return clip(first.replace(/^\\/\\/+\\s*/u, ''), SUMMARY_MAX);\n}\n\n/** One namespace call the script made, as exec reports it in the result's details. */\nexport interface ExecCall {\n /** The member called, such as `browser.click` or `mcp.github.search_issues`. */\n name: string;\n args: Record<string, unknown>;\n ok: boolean;\n ms: number;\n /** The tool name whose own card shows this call, when another package has one. */\n tool?: string;\n error?: string;\n result?: ToolResultView;\n}\n\nfunction callOf(value: unknown): ExecCall | undefined {\n const call = record(value);\n if (call === undefined || typeof call.name !== 'string' || call.name === '') return undefined;\n const result = record(call.result);\n return {\n name: call.name,\n args: record(call.args) ?? {},\n ok: call.ok !== false,\n ms: typeof call.ms === 'number' && Number.isFinite(call.ms) && call.ms >= 0 ? Math.round(call.ms) : 0,\n ...(typeof call.tool === 'string' && call.tool !== '' ? { tool: call.tool } : {}),\n ...(typeof call.error === 'string' && call.error !== '' ? { error: call.error } : {}),\n ...(result !== undefined && Array.isArray(result.content)\n ? { result: { content: result.content, details: result.details } }\n : {}),\n };\n}\n\n/** The nested calls recorded in a result's details; anything malformed is skipped. */\nexport function execCalls(details: unknown): ExecCall[] {\n const calls = record(details)?.calls;\n if (!Array.isArray(calls)) return [];\n return calls\n .slice(0, CALLS_MAX)\n .map(callOf)\n .filter((call): call is ExecCall => call !== undefined);\n}\n\n/** A call's arguments on one line, for a row that has no card of its own. */\nexport function callArgsSummary(args: Readonly<Record<string, unknown>>): string {\n return Object.keys(args).length === 0 ? '' : clip(JSON.stringify(args), ARGS_MAX);\n}\n\nexport interface ExecImage {\n mimeType: string;\n data: string;\n}\n\nexport interface ExecResultView {\n lines: string[];\n /** The saved-script footer exec appends: the id to import it by, and where it lives. */\n saved?: { id: string; path: string };\n images: ExecImage[];\n}\n\n/** What a result holds, with the saved-script footer and the pictures taken out of the text. */\nexport function execResultView(result: ToolResultView | null): ExecResultView {\n if (result === null) return { lines: [], images: [] };\n let saved: ExecResultView['saved'];\n const texts: string[] = [];\n const images: ExecImage[] = [];\n for (const block of result.content) {\n const item = record(block);\n if (item?.type === 'text' && typeof item.text === 'string') {\n const match = SAVED_LINE.exec(item.text.trim());\n if (match?.[1] !== undefined && match[2] !== undefined) saved = { id: match[1], path: match[2] };\n else texts.push(item.text);\n } else if (\n item?.type === 'image' &&\n typeof item.data === 'string' &&\n typeof item.mimeType === 'string' &&\n IMAGE_TYPES.test(item.mimeType)\n ) {\n images.push({ mimeType: item.mimeType, data: item.data });\n }\n }\n // As po-core's toolResultTextLines: CRLF folded, tabs widened, trailing blank lines dropped.\n const lines = texts.join('\\n').replaceAll('\\r\\n', '\\n').replaceAll('\\r', '\\n').replaceAll('\\t', ' ').split('\\n');\n while (lines.length > 0 && lines.at(-1)?.trim() === '') lines.pop();\n return { lines, ...(saved === undefined ? {} : { saved }), images };\n}\n\n/** Whether result text is a document, such as a report or a mermaid diagram, to draw rather than print. */\nexport function readsAsDocument(text: string): boolean {\n return DOCUMENT_LINE.test(text);\n}\n\n/** The header line for discover: what was asked for. */\nexport function discoverSummary(args: Readonly<Record<string, unknown>>): string {\n if (typeof args.namespace === 'string' && args.namespace !== '') return args.namespace;\n if (typeof args.query === 'string' && args.query !== '') return `find \"${clip(args.query, SUMMARY_MAX)}\"`;\n return 'namespaces and scripts';\n}\n","import type { ToolMessageRenderProps } from '@agimon-ai/po-core/native';\nimport {\n CodeBlock,\n fontOf,\n Markdown,\n MessageItem,\n MessageItemBody,\n MessageItemHeader,\n toolTone,\n} from '@agimon-ai/po-native-components';\nimport type { PoNativeTheme } from '@agimon-ai/po-web-components/nativeTheme';\nimport { useState } from 'react';\nimport { Image, Pressable, Text, View } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport {\n callArgsSummary,\n execCalls,\n execCode,\n execResultView,\n execSummary,\n execToolName,\n readsAsDocument,\n type ExecCall,\n type ExecImage,\n} from '../_lib/execToolView';\n\nexport type ExecToolCardProps = ToolMessageRenderProps & { defaultExpanded?: boolean };\n\n/** Pictures and documents stay on screen whether or not their row is open: they are the point of the call. */\nfunction Visuals({ text, images, label }: { text: string; images: readonly ExecImage[]; label: string }) {\n return (\n <>\n {readsAsDocument(text) ? <Markdown text={text} /> : null}\n {images.map((image, index) => (\n <Image\n key={`${image.mimeType}-${String(index)}`}\n source={{ uri: `data:${image.mimeType};base64,${image.data}` }}\n accessibilityLabel={`${label} image ${String(index + 1)}`}\n resizeMode=\"contain\"\n style={styles.image}\n />\n ))}\n </>\n );\n}\n\n/** One call on the rail. Tapping it opens its whole args and result; its pictures and documents show either way. */\nfunction CallRow({ call }: { call: ExecCall }) {\n const [open, setOpen] = useState(false);\n const view = execResultView(call.result ?? null);\n const text = view.lines.join('\\n');\n const printed = text !== '' && !readsAsDocument(text);\n const hasArgs = Object.keys(call.args).length > 0;\n const opens = hasArgs || printed;\n return (\n <View testID=\"exec-call\" style={styles.card}>\n <Pressable\n disabled={!opens}\n onPress={() => setOpen((value) => !value)}\n accessibilityRole={opens ? 'button' : undefined}\n accessibilityState={opens ? { expanded: open } : undefined}\n accessibilityHint={opens ? 'Shows the whole arguments and result' : undefined}\n style={styles.press}\n >\n <View style={styles.argsLine}>\n <Text numberOfLines={1} style={[styles.mono, styles.name, styles.shrink]}>\n {call.name}\n </Text>\n {opens ? <Text style={[styles.sans, styles.dim, styles.keep]}>{open ? '\\u2304' : '\\u203a'}</Text> : null}\n </View>\n <View style={styles.argsLine}>\n <Text numberOfLines={1} style={[styles.mono, styles.args]}>\n {open ? '' : callArgsSummary(call.args)}\n </Text>\n <Text\n accessibilityLabel={call.ok ? 'completed' : 'failed'}\n style={[styles.sans, call.ok ? styles.ok : styles.error]}\n >\n {call.ok ? '\\u2713' : '\\u2717'}\n </Text>\n <Text style={[styles.sans, styles.dim]}>{call.ms} ms</Text>\n </View>\n </Pressable>\n {open && hasArgs ? <CodeBlock text={JSON.stringify(call.args, null, 2)} language=\"json\" /> : null}\n {open && printed ? (\n <Text testID=\"exec-call-output\" selectable style={[styles.mono, styles.text]}>\n {text}\n </Text>\n ) : null}\n {call.error === undefined ? null : <Text style={[styles.sans, styles.error]}>{call.error}</Text>}\n <Visuals text={text} images={view.images} label={call.name} />\n </View>\n );\n}\n\n/** The script's outcome as the rail's last leaf: one line while the card is folded, all of it once opened. */\nfunction Returned({\n result,\n isError,\n expanded,\n}: {\n result: ExecToolCardProps['result'];\n isError: boolean;\n expanded: boolean;\n}) {\n const view = execResultView(result);\n const text = view.lines.join('\\n');\n const document = readsAsDocument(text);\n const whole = expanded || isError;\n return (\n <View testID={`tool-result-${execToolName}`} style={styles.leaf}>\n {view.lines.length === 0 ? (\n <Text style={[styles.sans, styles.dim]}>{isError ? 'Failed with no output.' : 'Returned nothing.'}</Text>\n ) : document ? (\n <Text style={[styles.sans, styles.dim, styles.label]}>{isError ? 'Error' : 'Returned'}</Text>\n ) : (\n <View style={whole ? styles.stack : styles.argsLine}>\n <Text style={[styles.sans, styles.dim, styles.label]}>{isError ? 'Error' : 'Returned'}</Text>\n <Text\n selectable\n numberOfLines={whole ? undefined : 1}\n style={[styles.mono, styles.args, isError ? styles.error : styles.text]}\n >\n {whole ? text : view.lines.join(' ')}\n </Text>\n </View>\n )}\n <Visuals text={text} images={view.images} label=\"Script\" />\n </View>\n );\n}\n\n/**\n * The exec tool's timeline item on native, as the web's ExecToolCard: the\n * calls the script made hang under it on a rail, with what it returned as the\n * last leaf. Opening the item shows the script itself.\n */\nexport function ExecToolCard({ args, result, running, isError, defaultExpanded = false }: ExecToolCardProps) {\n const code = execCode(args);\n const calls = execCalls(result?.details);\n const failed = calls.filter((call) => !call.ok).length;\n const settled = !running || result !== null;\n return (\n <MessageItem tone={toolTone({ running, isError })} expandable={code !== ''} defaultExpanded={defaultExpanded}>\n {({ expanded }) => (\n <>\n <MessageItemHeader title={execToolName}>\n <View testID={`tool-call-${execToolName}`} style={styles.summary}>\n <Text numberOfLines={1} style={[styles.sans, styles.text, styles.shrink]}>\n {execSummary(args)}\n </Text>\n {calls.length > 0 ? (\n <Text numberOfLines={1} style={[styles.sans, styles.dim, styles.keep]}>\n {calls.length} {calls.length === 1 ? 'call' : 'calls'}\n {failed > 0 ? <Text style={styles.error}>, {failed} failed</Text> : null}\n </Text>\n ) : null}\n </View>\n </MessageItemHeader>\n {expanded ? (\n <MessageItemBody>\n <CodeBlock text={code} language=\"ts\" />\n </MessageItemBody>\n ) : null}\n {settled ? (\n <View accessibilityLabel=\"Script calls\" style={styles.rail}>\n {calls.map((call, index) => (\n <CallRow key={`${String(index)}-${call.name}`} call={call} />\n ))}\n <Returned result={result} isError={isError} expanded={expanded} />\n </View>\n ) : null}\n </>\n )}\n </MessageItem>\n );\n}\n\nconst styles = StyleSheet.create((theme: PoNativeTheme) => ({\n summary: { flex: 1, flexDirection: 'row', alignItems: 'center', gap: theme.spacing(2), minWidth: 0 },\n shrink: { flexShrink: 1 },\n keep: { flexShrink: 0 },\n rail: {\n gap: theme.spacing(2),\n marginHorizontal: theme.spacing(4),\n marginBottom: theme.spacing(3),\n paddingLeft: theme.spacing(3),\n borderLeftWidth: 1,\n borderColor: theme.colors['border-soft'],\n },\n card: {\n gap: theme.spacing(2),\n paddingHorizontal: theme.spacing(3),\n paddingVertical: theme.spacing(1),\n borderWidth: 1,\n borderRadius: theme.borderRadius.lg,\n borderColor: theme.colors['border-soft'],\n },\n // 44pt: the smallest comfortable touch target.\n press: { minHeight: 44, justifyContent: 'center', gap: theme.spacing(0.5), paddingVertical: theme.spacing(1) },\n argsLine: { flexDirection: 'row', alignItems: 'center', gap: theme.spacing(2) },\n stack: { gap: theme.spacing(1) },\n leaf: { gap: theme.spacing(2) },\n sans: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeight.sm,\n },\n mono: {\n fontFamily: fontOf(theme.fontFamily.mono),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeight.sm,\n },\n name: { fontWeight: '600', color: theme.colors.text },\n args: { flex: 1, minWidth: 0, color: theme.colors.dim },\n label: { fontWeight: '600' },\n text: { color: theme.colors.text },\n dim: { color: theme.colors.dim },\n ok: { color: theme.colors.green },\n error: { color: theme.colors.red },\n image: {\n width: '100%',\n aspectRatio: 16 / 9,\n borderWidth: 1,\n borderRadius: theme.borderRadius.md,\n borderColor: theme.colors['border-soft'],\n },\n}));\n","import { defineToolRenderer } from '@agimon-ai/po-core/native';\n\nimport { ExecToolCard } from './_components/ExecToolCard.native';\n\nexport default defineToolRenderer({ message: ExecToolCard });\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { defineNativePlugin, type WebPluginContributions } from '@agimon-ai/po-core/native';\n\nimport toolExec from '../src/extensions/workspaces/sessions/(frontend)/tool/exec.native';\n\nconst via = <T>(identity: Record<string, unknown>, value: unknown): T =>\n (value === undefined ? undefined : { ...identity, ...(value as object) }) as T;\n\nexport const nativePlugin = defineNativePlugin({\n id: 'codemode',\n session: {\n get toolRenderers(): WebPluginContributions['toolRenderers'] { return [via({ tools: ['exec'] }, toolExec)]; },\n },\n});\n"],"mappings":";;;;;;;;;;;AAKA,MAAa,eAAe;AAG5B,MAAM,cAAc;AACpB,MAAM,WAAW;AACjB,MAAM,YAAY;AAClB,MAAM,cAAc;AACpB,MAAM,aAAa;AAEnB,MAAM,gBAAgB;AAEtB,SAAS,OAAO,OAAqD;CACnE,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK,IACrE,QACD,KAAA;AACN;AAEA,SAAS,KAAK,MAAc,KAAqB;CAC/C,OAAO,KAAK,UAAU,MAAM,OAAO,GAAG,KAAK,MAAM,GAAG,MAAM,CAAC,EAAE;AAC/D;;AAGA,SAAgB,SAAS,MAAiD;CACxE,OAAO,OAAO,KAAK,SAAS,WAAW,KAAK,OAAO;AACrD;;AAGA,SAAgB,YAAY,MAAiD;CAC3E,MAAM,QAAQ,SAAS,IAAI,CAAC,CACzB,MAAM,IAAI,CAAC,CACX,KAAK,SAAS,KAAK,KAAK,CAAC,CAAC,CAC1B,MAAM,SAAS,SAAS,EAAE;CAC7B,IAAI,UAAU,KAAA,GAAW,OAAO;CAChC,OAAO,KAAK,MAAM,QAAQ,cAAc,EAAE,GAAG,WAAW;AAC1D;AAeA,SAAS,OAAO,OAAsC;CACpD,MAAM,OAAO,OAAO,KAAK;CACzB,IAAI,SAAS,KAAA,KAAa,OAAO,KAAK,SAAS,YAAY,KAAK,SAAS,IAAI,OAA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OAAO3B,MAAMc,OAAOtC;EAAG+B,mBAAA,CAAA,CAAA;CAAC;CACtDjE,OAAO,EAAEoF,YAAY,MAAM;CAC3BtF,MAAM;EAAEuF,OAAO3B,MAAMc,OAAO1E;EAAImE,mBAAA,CAAA,CAAA;CAAC;CACjC/B,KAAK;EAAEmD,OAAO3B,MAAMc,OAAOtC;EAAG+B,mBAAA,CAAA,CAAA;CAAC;CAC/B7B,IAAI;EAAEiD,OAAO3B,MAAMc,OAAOc;EAAKrB,mBAAA,CAAA,CAAA;CAAC;CAChC5B,OAAO;EAAEgD,OAAO3B,MAAMc,OAAOe;EAAGtB,mBAAA,CAAA,CAAA;CAAC;CACjC/D,OAAO;EACLsF,OAAO;EACPC,aAAa,KAAK;EAClBd,aAAa;EACbC,cAAclB,MAAMkB,aAAac;EACjCnB,aAAab,MAAMc,OAAO;EAAcP,mBAAA,CAAA,CAAA;CAC1C;AACF,EAAE;;;AChOF,IAAA,sBAAe,mBAAmB,EAAE,SAAS,aAAa,CAAC;;;ACC3D,MAAM,OAAU,UAAmC,UAChD,UAAU,KAAA,IAAY,KAAA,IAAY;CAAE,GAAG;CAAU,GAAI;AAAiB;AAEzE,MAAa,eAAe,mBAAmB;CAC7C,IAAI;CACJ,SAAS,EACP,IAAI,gBAAyD;EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,MAAM,EAAE,GAAG0B,mBAAQ,CAAC;CAAG,EAC9G;AACF,CAAC"}
1
+ {"version":3,"file":"native.mjs","names":["ToolMessageRenderProps","CodeBlock","fontOf","Markdown","MessageItem","MessageItemBody","MessageItemHeader","toolTone","PoNativeTheme","useState","StyleSheet","callArgsSummary","execCalls","execCode","execResultView","execSummary","execToolName","readsAsDocument","ExecCall","ExecImage","ExecToolCardProps","defaultExpanded","Visuals","text","images","label","map","image","index","mimeType","String","uri","data","styles","CallRow","call","open","setOpen","view","result","lines","join","printed","hasArgs","Object","keys","args","length","opens","value","undefined","expanded","press","argsLine","mono","name","shrink","sans","dim","keep","ok","error","ms","JSON","stringify","Returned","isError","document","whole","leaf","stack","ExecToolCard","running","code","calls","details","failed","filter","settled","summary","rail","create","theme","flex","flexDirection","alignItems","gap","spacing","minWidth","uni__dependencies","flexShrink","marginHorizontal","marginBottom","paddingLeft","borderLeftWidth","borderColor","colors","minHeight","justifyContent","paddingVertical","fontFamily","fontSize","sm","lineHeight","fontWeight","color","green","red","width","aspectRatio","borderWidth","borderRadius","md","toolExec"],"sources":["../../src/extensions/workspaces/sessions/(frontend)/tool/_lib/execToolView.ts","../../src/extensions/workspaces/sessions/(frontend)/tool/_components/ExecToolCard.native.tsx","../../src/extensions/workspaces/sessions/(frontend)/tool/exec.native.tsx","../../generated/native.ts"],"sourcesContent":["// Imports nothing at runtime: the web and native cards share it, and the native\n// bundle may not load the web contract.\nimport type { ToolResultView } from '@agimon-ai/po-core/web';\n\n/** Tool names this package registers (registerTool's `name`). */\nexport const execToolName = 'exec' as const;\nexport const discoverToolName = 'discover' as const;\n\nconst SUMMARY_MAX = 120;\nconst ARGS_MAX = 160;\nconst CALLS_MAX = 50;\nconst IMAGE_TYPES = /^image\\/(?:png|jpeg|webp|gif)$/u;\nconst SAVED_LINE = /^Saved as (\\S+) \\((.+)\\)$/u;\n// A heading or a fence starts a line of Markdown, never one of JSON or a log.\nconst DOCUMENT_LINE = /^(?:#{1,6} |```)/mu;\n\nfunction record(value: unknown): Record<string, unknown> | undefined {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : undefined;\n}\n\nfunction clip(text: string, max: number): string {\n return text.length <= max ? text : `${text.slice(0, max - 1)}…`;\n}\n\n/** The script the call ran, exactly as the agent wrote it. */\nexport function execCode(args: Readonly<Record<string, unknown>>): string {\n return typeof args.code === 'string' ? args.code : '';\n}\n\n/** The header line: the script's first line, with a leading `//` comment marker dropped. */\nexport function execSummary(args: Readonly<Record<string, unknown>>): string {\n const first = execCode(args)\n .split('\\n')\n .map((line) => line.trim())\n .find((line) => line !== '');\n if (first === undefined) return 'script';\n return clip(first.replace(/^\\/\\/+\\s*/u, ''), SUMMARY_MAX);\n}\n\n/** One namespace call the script made, as exec reports it in the result's details. */\nexport interface ExecCall {\n /** The member called, such as `browser.click` or `mcp.github.search_issues`. */\n name: string;\n args: Record<string, unknown>;\n ok: boolean;\n ms: number;\n /** The tool name whose own card shows this call, when another package has one. */\n tool?: string;\n error?: string;\n result?: ToolResultView;\n}\n\nfunction callOf(value: unknown): ExecCall | undefined {\n const call = record(value);\n if (call === undefined || typeof call.name !== 'string' || call.name === '') return undefined;\n const result = record(call.result);\n return {\n name: call.name,\n args: record(call.args) ?? {},\n ok: call.ok !== false,\n ms: typeof call.ms === 'number' && Number.isFinite(call.ms) && call.ms >= 0 ? Math.round(call.ms) : 0,\n ...(typeof call.tool === 'string' && call.tool !== '' ? { tool: call.tool } : {}),\n ...(typeof call.error === 'string' && call.error !== '' ? { error: call.error } : {}),\n ...(result !== undefined && Array.isArray(result.content)\n ? { result: { content: result.content, details: result.details } }\n : {}),\n };\n}\n\n/** The nested calls recorded in a result's details; anything malformed is skipped. */\nexport function execCalls(details: unknown): ExecCall[] {\n const calls = record(details)?.calls;\n if (!Array.isArray(calls)) return [];\n return calls\n .slice(0, CALLS_MAX)\n .map(callOf)\n .filter((call): call is ExecCall => call !== undefined);\n}\n\n/** A call's arguments on one line, for a row that has no card of its own. */\nexport function callArgsSummary(args: Readonly<Record<string, unknown>>): string {\n return Object.keys(args).length === 0 ? '' : clip(JSON.stringify(args), ARGS_MAX);\n}\n\nexport interface ExecImage {\n mimeType: string;\n data: string;\n}\n\nexport interface ExecResultView {\n lines: string[];\n /** The saved-script footer exec appends: the id to import it by, and where it lives. */\n saved?: { id: string; path: string };\n images: ExecImage[];\n}\n\n/** What a result holds, with the saved-script footer and the pictures taken out of the text. */\nexport function execResultView(result: ToolResultView | null): ExecResultView {\n if (result === null) return { lines: [], images: [] };\n let saved: ExecResultView['saved'];\n const texts: string[] = [];\n const images: ExecImage[] = [];\n for (const block of result.content) {\n const item = record(block);\n if (item?.type === 'text' && typeof item.text === 'string') {\n const match = SAVED_LINE.exec(item.text.trim());\n if (match?.[1] !== undefined && match[2] !== undefined) saved = { id: match[1], path: match[2] };\n else texts.push(item.text);\n } else if (\n item?.type === 'image' &&\n typeof item.data === 'string' &&\n typeof item.mimeType === 'string' &&\n IMAGE_TYPES.test(item.mimeType)\n ) {\n images.push({ mimeType: item.mimeType, data: item.data });\n }\n }\n // As po-core's toolResultTextLines: CRLF folded, tabs widened, trailing blank lines dropped.\n const lines = texts.join('\\n').replaceAll('\\r\\n', '\\n').replaceAll('\\r', '\\n').replaceAll('\\t', ' ').split('\\n');\n while (lines.length > 0 && lines.at(-1)?.trim() === '') lines.pop();\n return { lines, ...(saved === undefined ? {} : { saved }), images };\n}\n\n/** Whether result text is a document, such as a report or a mermaid diagram, to draw rather than print. */\nexport function readsAsDocument(text: string): boolean {\n return DOCUMENT_LINE.test(text);\n}\n\n/** The header line for discover: what was asked for. */\nexport function discoverSummary(args: Readonly<Record<string, unknown>>): string {\n if (typeof args.namespace === 'string' && args.namespace !== '') return args.namespace;\n if (typeof args.query === 'string' && args.query !== '') return `find \"${clip(args.query, SUMMARY_MAX)}\"`;\n return 'namespaces and scripts';\n}\n","import type { ToolMessageRenderProps } from '@agimon-ai/po-core/native';\nimport {\n CodeBlock,\n fontOf,\n Markdown,\n MessageItem,\n MessageItemBody,\n MessageItemHeader,\n toolTone,\n} from '@agimon-ai/po-native-components';\nimport type { PoNativeTheme } from '@agimon-ai/po-web-components/nativeTheme';\nimport { useState } from 'react';\nimport { Image, Pressable, Text, View } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport {\n callArgsSummary,\n execCalls,\n execCode,\n execResultView,\n execSummary,\n execToolName,\n readsAsDocument,\n type ExecCall,\n type ExecImage,\n} from '../_lib/execToolView';\n\nexport type ExecToolCardProps = ToolMessageRenderProps & { defaultExpanded?: boolean };\n\n/** Pictures and documents stay on screen whether or not their row is open: they are the point of the call. */\nfunction Visuals({ text, images, label }: { text: string; images: readonly ExecImage[]; label: string }) {\n return (\n <>\n {readsAsDocument(text) ? <Markdown text={text} /> : null}\n {images.map((image, index) => (\n <Image\n key={`${image.mimeType}-${String(index)}`}\n source={{ uri: `data:${image.mimeType};base64,${image.data}` }}\n accessibilityLabel={`${label} image ${String(index + 1)}`}\n resizeMode=\"contain\"\n style={styles.image}\n />\n ))}\n </>\n );\n}\n\n/** One call on the rail. Tapping it opens its whole args and result; its pictures and documents show either way. */\nfunction CallRow({ call }: { call: ExecCall }) {\n const [open, setOpen] = useState(false);\n const view = execResultView(call.result ?? null);\n const text = view.lines.join('\\n');\n const printed = text !== '' && !readsAsDocument(text);\n const hasArgs = Object.keys(call.args).length > 0;\n const opens = hasArgs || printed;\n return (\n <View testID=\"exec-call\" style={styles.call}>\n <Pressable\n disabled={!opens}\n onPress={() => setOpen((value) => !value)}\n accessibilityRole={opens ? 'button' : undefined}\n accessibilityState={opens ? { expanded: open } : undefined}\n accessibilityHint={opens ? 'Shows the whole arguments and result' : undefined}\n style={styles.press}\n >\n <View style={styles.argsLine}>\n <Text numberOfLines={1} style={[styles.mono, styles.name, styles.shrink]}>\n {call.name}\n </Text>\n {opens ? <Text style={[styles.sans, styles.dim, styles.keep]}>{open ? '\\u2304' : '\\u203a'}</Text> : null}\n </View>\n <View style={styles.argsLine}>\n <Text numberOfLines={1} style={[styles.mono, styles.args]}>\n {open ? '' : callArgsSummary(call.args)}\n </Text>\n <Text\n accessibilityLabel={call.ok ? 'completed' : 'failed'}\n style={[styles.sans, call.ok ? styles.ok : styles.error]}\n >\n {call.ok ? '\\u2713' : '\\u2717'}\n </Text>\n <Text style={[styles.sans, styles.dim]}>{call.ms} ms</Text>\n </View>\n </Pressable>\n {open && hasArgs ? <CodeBlock text={JSON.stringify(call.args, null, 2)} language=\"json\" /> : null}\n {open && printed ? (\n <Text testID=\"exec-call-output\" selectable style={[styles.mono, styles.text]}>\n {text}\n </Text>\n ) : null}\n {call.error === undefined ? null : <Text style={[styles.sans, styles.error]}>{call.error}</Text>}\n <Visuals text={text} images={view.images} label={call.name} />\n </View>\n );\n}\n\n/** The script's outcome as the rail's last leaf: one line while the card is folded, all of it once opened. */\nfunction Returned({\n result,\n isError,\n expanded,\n}: {\n result: ExecToolCardProps['result'];\n isError: boolean;\n expanded: boolean;\n}) {\n const view = execResultView(result);\n const text = view.lines.join('\\n');\n const document = readsAsDocument(text);\n const whole = expanded || isError;\n return (\n <View testID={`tool-result-${execToolName}`} style={styles.leaf}>\n {view.lines.length === 0 ? (\n <Text style={[styles.sans, styles.dim]}>{isError ? 'Failed with no output.' : 'Returned nothing.'}</Text>\n ) : document ? (\n <Text style={[styles.sans, styles.dim, styles.label]}>{isError ? 'Error' : 'Returned'}</Text>\n ) : (\n <View style={whole ? styles.stack : styles.argsLine}>\n <Text style={[styles.sans, styles.dim, styles.label]}>{isError ? 'Error' : 'Returned'}</Text>\n <Text\n selectable\n numberOfLines={whole ? undefined : 1}\n style={[styles.mono, styles.args, isError ? styles.error : styles.text]}\n >\n {whole ? text : view.lines.join(' ')}\n </Text>\n </View>\n )}\n <Visuals text={text} images={view.images} label=\"Script\" />\n </View>\n );\n}\n\n/**\n * The exec tool's timeline item on native, as the web's ExecToolCard: the\n * calls the script made hang under it on a rail, with what it returned as the\n * last leaf. Opening the item shows the script itself.\n */\nexport function ExecToolCard({ args, result, running, isError, defaultExpanded = false }: ExecToolCardProps) {\n const code = execCode(args);\n const calls = execCalls(result?.details);\n const failed = calls.filter((call) => !call.ok).length;\n const settled = !running || result !== null;\n return (\n <MessageItem tone={toolTone({ running, isError })} expandable={code !== ''} defaultExpanded={defaultExpanded}>\n {({ expanded }) => (\n <>\n <MessageItemHeader title={execToolName}>\n <View testID={`tool-call-${execToolName}`} style={styles.summary}>\n <Text numberOfLines={1} style={[styles.sans, styles.text, styles.shrink]}>\n {execSummary(args)}\n </Text>\n {calls.length > 0 ? (\n <Text numberOfLines={1} style={[styles.sans, styles.dim, styles.keep]}>\n {calls.length} {calls.length === 1 ? 'call' : 'calls'}\n {failed > 0 ? <Text style={styles.error}>, {failed} failed</Text> : null}\n </Text>\n ) : null}\n </View>\n </MessageItemHeader>\n {expanded ? (\n <MessageItemBody>\n <CodeBlock text={code} language=\"ts\" />\n </MessageItemBody>\n ) : null}\n {settled ? (\n <View accessibilityLabel=\"Script calls\" style={styles.rail}>\n {calls.map((call, index) => (\n <CallRow key={`${String(index)}-${call.name}`} call={call} />\n ))}\n <Returned result={result} isError={isError} expanded={expanded} />\n </View>\n ) : null}\n </>\n )}\n </MessageItem>\n );\n}\n\nconst styles = StyleSheet.create((theme: PoNativeTheme) => ({\n summary: { flex: 1, flexDirection: 'row', alignItems: 'center', gap: theme.spacing(2), minWidth: 0 },\n shrink: { flexShrink: 1 },\n keep: { flexShrink: 0 },\n rail: {\n gap: theme.spacing(2),\n marginHorizontal: theme.spacing(4),\n marginBottom: theme.spacing(3),\n paddingLeft: theme.spacing(3),\n borderLeftWidth: 1,\n borderColor: theme.colors['border-soft'],\n },\n // A row on the rail, not a card: the rail already groups the calls.\n call: { gap: theme.spacing(2) },\n // 44pt: the smallest comfortable touch target.\n press: { minHeight: 44, justifyContent: 'center', gap: theme.spacing(0.5), paddingVertical: theme.spacing(1) },\n argsLine: { flexDirection: 'row', alignItems: 'center', gap: theme.spacing(2) },\n stack: { gap: theme.spacing(1) },\n leaf: { gap: theme.spacing(2) },\n sans: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeight.sm,\n },\n mono: {\n fontFamily: fontOf(theme.fontFamily.mono),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeight.sm,\n },\n name: { fontWeight: '600', color: theme.colors.text },\n args: { flex: 1, minWidth: 0, color: theme.colors.dim },\n label: { fontWeight: '600' },\n text: { color: theme.colors.text },\n dim: { color: theme.colors.dim },\n ok: { color: theme.colors.green },\n error: { color: theme.colors.red },\n image: {\n width: '100%',\n aspectRatio: 16 / 9,\n borderWidth: 1,\n borderRadius: theme.borderRadius.md,\n borderColor: theme.colors['border-soft'],\n },\n}));\n","import { defineToolRenderer } from '@agimon-ai/po-core/native';\n\nimport { ExecToolCard } from './_components/ExecToolCard.native';\n\nexport default defineToolRenderer({ message: ExecToolCard });\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { defineNativePlugin, type WebPluginContributions } from '@agimon-ai/po-core/native';\n\nimport toolExec from '../src/extensions/workspaces/sessions/(frontend)/tool/exec.native';\n\nconst via = <T>(identity: Record<string, unknown>, value: unknown): T =>\n (value === undefined ? undefined : { ...identity, ...(value as object) }) as T;\n\nexport const nativePlugin = defineNativePlugin({\n id: 'codemode',\n session: {\n get toolRenderers(): WebPluginContributions['toolRenderers'] { return [via({ tools: ['exec'] }, toolExec)]; },\n },\n});\n"],"mappings":";;;;;;;;;;;AAKA,MAAa,eAAe;AAG5B,MAAM,cAAc;AACpB,MAAM,WAAW;AACjB,MAAM,YAAY;AAClB,MAAM,cAAc;AACpB,MAAM,aAAa;AAEnB,MAAM,gBAAgB;AAEtB,SAAS,OAAO,OAAqD;CACnE,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK,IACrE,QACD,KAAA;AACN;AAEA,SAAS,KAAK,MAAc,KAAqB;CAC/C,OAAO,KAAK,UAAU,MAAM,OAAO,GAAG,KAAK,MAAM,GAAG,MAAM,CAAC,EAAE;AAC/D;;AAGA,SAAgB,SAAS,MAAiD;CACxE,OAAO,OAAO,KAAK,SAAS,WAAW,KAAK,OAAO;AACrD;;AAGA,SAAgB,YAAY,MAAiD;CAC3E,MAAM,QAAQ,SAAS,IAAI,CAAC,CACzB,MAAM,IAAI,CAAC,CACX,KAAK,SAAS,KAAK,KAAK,CAAC,CAAC,CAC1B,MAAM,SAAS,SAAS,EAAE;CAC7B,IAAI,UAAU,KAAA,GAAW,OAAO;CAChC,OAAO,KAAK,MAAM,QAAQ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GK,UAAU;EAAGiB,OAAOvB,MAAMc,OAAOtC;EAAG+B,mBAAA,CAAA,CAAA;CAAC;CACtDhE,OAAO,EAAE+E,YAAY,MAAM;CAC3BjF,MAAM;EAAEkF,OAAOvB,MAAMc,OAAOzE;EAAIkE,mBAAA,CAAA,CAAA;CAAC;CACjC/B,KAAK;EAAE+C,OAAOvB,MAAMc,OAAOtC;EAAG+B,mBAAA,CAAA,CAAA;CAAC;CAC/B7B,IAAI;EAAE6C,OAAOvB,MAAMc,OAAOU;EAAKjB,mBAAA,CAAA,CAAA;CAAC;CAChC5B,OAAO;EAAE4C,OAAOvB,MAAMc,OAAOW;EAAGlB,mBAAA,CAAA,CAAA;CAAC;CACjC9D,OAAO;EACLiF,OAAO;EACPC,aAAa,KAAK;EAClBC,aAAa;EACbC,cAAc7B,MAAM6B,aAAaC;EACjCjB,aAAab,MAAMc,OAAO;EAAcP,mBAAA,CAAA,CAAA;CAC1C;AACF,EAAE;;;AC1NF,IAAA,sBAAe,mBAAmB,EAAE,SAAS,aAAa,CAAC;;;ACC3D,MAAM,OAAU,UAAmC,UAChD,UAAU,KAAA,IAAY,KAAA,IAAY;CAAE,GAAG;CAAU,GAAI;AAAiB;AAEzE,MAAa,eAAe,mBAAmB;CAC7C,IAAI;CACJ,SAAS,EACP,IAAI,gBAAyD;EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,MAAM,EAAE,GAAGwB,mBAAQ,CAAC;CAAG,EAC9G;AACF,CAAC"}
@@ -206,7 +206,7 @@ function CallRow({ call }) {
206
206
  ] });
207
207
  return /* @__PURE__ */ jsxs("div", {
208
208
  "data-testid": "exec-call",
209
- className: "flex flex-col gap-2 rounded-lg border border-po-border-soft px-3 py-2",
209
+ className: "flex flex-col gap-2 py-1.5",
210
210
  children: [
211
211
  opens ? /* @__PURE__ */ jsxs("details", {
212
212
  className: "group text-sm",
@@ -1 +1 @@
1
- {"version":3,"file":"web.mjs","names":["toolDiscover","toolExec"],"sources":["../../src/extensions/workspaces/sessions/(frontend)/tool/_lib/execToolView.ts","../../src/extensions/workspaces/sessions/(frontend)/tool/_components/DiscoverToolCard.tsx","../../src/extensions/workspaces/sessions/(frontend)/tool/discover.web.tsx","../../src/extensions/workspaces/sessions/(frontend)/tool/_components/ToolSection.tsx","../../src/extensions/workspaces/sessions/(frontend)/tool/_components/ExecToolCard.tsx","../../src/extensions/workspaces/sessions/(frontend)/tool/exec.web.tsx","../../generated/web.ts"],"sourcesContent":["// Imports nothing at runtime: the web and native cards share it, and the native\n// bundle may not load the web contract.\nimport type { ToolResultView } from '@agimon-ai/po-core/web';\n\n/** Tool names this package registers (registerTool's `name`). */\nexport const execToolName = 'exec' as const;\nexport const discoverToolName = 'discover' as const;\n\nconst SUMMARY_MAX = 120;\nconst ARGS_MAX = 160;\nconst CALLS_MAX = 50;\nconst IMAGE_TYPES = /^image\\/(?:png|jpeg|webp|gif)$/u;\nconst SAVED_LINE = /^Saved as (\\S+) \\((.+)\\)$/u;\n// A heading or a fence starts a line of Markdown, never one of JSON or a log.\nconst DOCUMENT_LINE = /^(?:#{1,6} |```)/mu;\n\nfunction record(value: unknown): Record<string, unknown> | undefined {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : undefined;\n}\n\nfunction clip(text: string, max: number): string {\n return text.length <= max ? text : `${text.slice(0, max - 1)}…`;\n}\n\n/** The script the call ran, exactly as the agent wrote it. */\nexport function execCode(args: Readonly<Record<string, unknown>>): string {\n return typeof args.code === 'string' ? args.code : '';\n}\n\n/** The header line: the script's first line, with a leading `//` comment marker dropped. */\nexport function execSummary(args: Readonly<Record<string, unknown>>): string {\n const first = execCode(args)\n .split('\\n')\n .map((line) => line.trim())\n .find((line) => line !== '');\n if (first === undefined) return 'script';\n return clip(first.replace(/^\\/\\/+\\s*/u, ''), SUMMARY_MAX);\n}\n\n/** One namespace call the script made, as exec reports it in the result's details. */\nexport interface ExecCall {\n /** The member called, such as `browser.click` or `mcp.github.search_issues`. */\n name: string;\n args: Record<string, unknown>;\n ok: boolean;\n ms: number;\n /** The tool name whose own card shows this call, when another package has one. */\n tool?: string;\n error?: string;\n result?: ToolResultView;\n}\n\nfunction callOf(value: unknown): ExecCall | undefined {\n const call = record(value);\n if (call === undefined || typeof call.name !== 'string' || call.name === '') return undefined;\n const result = record(call.result);\n return {\n name: call.name,\n args: record(call.args) ?? {},\n ok: call.ok !== false,\n ms: typeof call.ms === 'number' && Number.isFinite(call.ms) && call.ms >= 0 ? Math.round(call.ms) : 0,\n ...(typeof call.tool === 'string' && call.tool !== '' ? { tool: call.tool } : {}),\n ...(typeof call.error === 'string' && call.error !== '' ? { error: call.error } : {}),\n ...(result !== undefined && Array.isArray(result.content)\n ? { result: { content: result.content, details: result.details } }\n : {}),\n };\n}\n\n/** The nested calls recorded in a result's details; anything malformed is skipped. */\nexport function execCalls(details: unknown): ExecCall[] {\n const calls = record(details)?.calls;\n if (!Array.isArray(calls)) return [];\n return calls\n .slice(0, CALLS_MAX)\n .map(callOf)\n .filter((call): call is ExecCall => call !== undefined);\n}\n\n/** A call's arguments on one line, for a row that has no card of its own. */\nexport function callArgsSummary(args: Readonly<Record<string, unknown>>): string {\n return Object.keys(args).length === 0 ? '' : clip(JSON.stringify(args), ARGS_MAX);\n}\n\nexport interface ExecImage {\n mimeType: string;\n data: string;\n}\n\nexport interface ExecResultView {\n lines: string[];\n /** The saved-script footer exec appends: the id to import it by, and where it lives. */\n saved?: { id: string; path: string };\n images: ExecImage[];\n}\n\n/** What a result holds, with the saved-script footer and the pictures taken out of the text. */\nexport function execResultView(result: ToolResultView | null): ExecResultView {\n if (result === null) return { lines: [], images: [] };\n let saved: ExecResultView['saved'];\n const texts: string[] = [];\n const images: ExecImage[] = [];\n for (const block of result.content) {\n const item = record(block);\n if (item?.type === 'text' && typeof item.text === 'string') {\n const match = SAVED_LINE.exec(item.text.trim());\n if (match?.[1] !== undefined && match[2] !== undefined) saved = { id: match[1], path: match[2] };\n else texts.push(item.text);\n } else if (\n item?.type === 'image' &&\n typeof item.data === 'string' &&\n typeof item.mimeType === 'string' &&\n IMAGE_TYPES.test(item.mimeType)\n ) {\n images.push({ mimeType: item.mimeType, data: item.data });\n }\n }\n // As po-core's toolResultTextLines: CRLF folded, tabs widened, trailing blank lines dropped.\n const lines = texts.join('\\n').replaceAll('\\r\\n', '\\n').replaceAll('\\r', '\\n').replaceAll('\\t', ' ').split('\\n');\n while (lines.length > 0 && lines.at(-1)?.trim() === '') lines.pop();\n return { lines, ...(saved === undefined ? {} : { saved }), images };\n}\n\n/** Whether result text is a document, such as a report or a mermaid diagram, to draw rather than print. */\nexport function readsAsDocument(text: string): boolean {\n return DOCUMENT_LINE.test(text);\n}\n\n/** The header line for discover: what was asked for. */\nexport function discoverSummary(args: Readonly<Record<string, unknown>>): string {\n if (typeof args.namespace === 'string' && args.namespace !== '') return args.namespace;\n if (typeof args.query === 'string' && args.query !== '') return `find \"${clip(args.query, SUMMARY_MAX)}\"`;\n return 'namespaces and scripts';\n}\n","import type { ToolMessageRenderProps } from '@agimon-ai/po-core/web';\nimport {\n CodeBlock,\n MessageItem,\n MessageItemBody,\n MessageItemHeader,\n MessageItemStatus,\n toolTone,\n} from '@agimon-ai/po-web-components';\n\nimport { discoverSummary, discoverToolName } from '../_lib/execToolView';\n\nexport type DiscoverToolCardProps = ToolMessageRenderProps & { defaultExpanded?: boolean };\n\n/** The discover tool's timeline item: folded to what was asked for, open to what came back. */\nexport function DiscoverToolCard({ args, output, running, isError, defaultExpanded = false }: DiscoverToolCardProps) {\n const declarations = typeof args.namespace === 'string' && args.namespace !== '' && !isError;\n return (\n <MessageItem tone={toolTone({ running, isError })} expandable defaultExpanded={defaultExpanded}>\n {({ expanded }) => (\n <>\n <MessageItemHeader title={discoverToolName}>\n <span data-testid={`tool-call-${discoverToolName}`} className=\"min-w-0 flex-1 truncate text-po-text\">\n {discoverSummary(args)}\n </span>\n </MessageItemHeader>\n {expanded ? (\n <MessageItemBody data-testid={`tool-result-${discoverToolName}`} className=\"flex flex-col gap-2\">\n {running && output === '' ? <MessageItemStatus tone=\"running\">running</MessageItemStatus> : null}\n {output === '' ? null : declarations ? (\n <div className=\"max-h-96 overflow-auto\">\n <CodeBlock text={output} className=\"language-ts\" />\n </div>\n ) : (\n <pre\n data-testid=\"tool-output\"\n className={`max-h-96 overflow-auto font-mono text-sm break-words whitespace-pre-wrap ${isError ? 'text-po-red' : 'text-po-text'}`}\n >\n {output}\n </pre>\n )}\n </MessageItemBody>\n ) : null}\n </>\n )}\n </MessageItem>\n );\n}\n","import { defineToolRenderer } from '@agimon-ai/po-core/web';\n\nimport { DiscoverToolCard } from './_components/DiscoverToolCard';\n\nexport default defineToolRenderer({ message: DiscoverToolCard });\n","import type { ReactNode } from 'react';\n\n/** A labelled part of an expanded card body. */\nexport function ToolSection({ label, children }: { label: string; children: ReactNode }) {\n return (\n <section className=\"flex flex-col gap-1.5\">\n <h4 className=\"text-sm font-medium text-po-dim\">{label}</h4>\n {children}\n </section>\n );\n}\n","import type { ToolMessageRenderProps } from '@agimon-ai/po-core/web';\nimport {\n CodeBlock,\n Markdown,\n MessageItem,\n MessageItemBody,\n MessageItemHeader,\n toolTone,\n} from '@agimon-ai/po-web-components';\n\nimport {\n callArgsSummary,\n execCalls,\n execCode,\n execResultView,\n execSummary,\n execToolName,\n readsAsDocument,\n type ExecCall,\n type ExecImage,\n} from '../_lib/execToolView';\nimport { ToolSection } from './ToolSection';\n\n/** Draws another tool's own card for a nested call, or nothing when no package owns one. */\nexport type RenderNestedTool = NonNullable<ToolMessageRenderProps['renderTool']>;\n\nexport type ExecToolCardProps = ToolMessageRenderProps & { defaultExpanded?: boolean };\n\n/** The tree's elbow: a short branch from the rail to the item it leads to. */\nconst BRANCH =\n 'relative before:absolute before:top-[1.125rem] before:-left-4 before:w-3 before:border-t before:border-po-border-soft';\n\nconst SUMMARY =\n 'flex min-h-6 cursor-pointer list-none items-center gap-x-2 gap-y-0.5 [&::-webkit-details-marker]:hidden';\n\n/** The folding mark at the end of a summary; it turns when the section opens. */\nfunction Chevron() {\n return (\n <span aria-hidden className=\"w-3 shrink-0 text-center text-po-dim transition-transform group-open:rotate-90\">\n ›\n </span>\n );\n}\n\n/** Pictures and documents stay on screen whether or not their section is open: they are the point of the call. */\nfunction Visuals({ text, images, label }: { text: string; images: readonly ExecImage[]; label: string }) {\n return (\n <>\n {readsAsDocument(text) ? (\n <div data-testid=\"tool-output-document\" className=\"max-h-96 overflow-auto text-sm\">\n <Markdown text={text} />\n </div>\n ) : null}\n {images.map((image, index) => (\n <img\n key={`${image.mimeType}-${String(index)}`}\n src={`data:${image.mimeType};base64,${image.data}`}\n alt={`${label} image ${String(index + 1)}`}\n data-testid=\"tool-output-image\"\n className=\"max-h-48 max-w-full self-start rounded-md border border-po-border-soft\"\n />\n ))}\n </>\n );\n}\n\n/** One call on the rail. It opens to its whole args and result; its pictures and documents show either way. */\nfunction CallRow({ call }: { call: ExecCall }) {\n const view = execResultView(call.result ?? null);\n const text = view.lines.join('\\n');\n const printed = text !== '' && !readsAsDocument(text);\n const opens = Object.keys(call.args).length > 0 || printed;\n const head = (\n <>\n <span className=\"shrink-0 truncate font-mono font-semibold text-po-text max-sm:basis-full\">{call.name}</span>\n <span className=\"min-w-0 flex-1 truncate font-mono text-po-dim group-open:invisible\">\n {callArgsSummary(call.args)}\n </span>\n <span aria-hidden className={`w-3 shrink-0 text-center ${call.ok ? 'text-po-green' : 'text-po-red'}`}>\n {call.ok ? '✓' : '✗'}\n </span>\n <span className=\"sr-only\">{call.ok ? 'completed' : 'failed'}</span>\n <span className=\"w-16 shrink-0 text-right tabular-nums text-po-dim\">{call.ms} ms</span>\n </>\n );\n return (\n <div data-testid=\"exec-call\" className=\"flex flex-col gap-2 rounded-lg border border-po-border-soft px-3 py-2\">\n {opens ? (\n <details className=\"group text-sm\">\n <summary className={`${SUMMARY} flex-wrap`}>\n {head}\n <Chevron />\n </summary>\n <div className=\"mt-2 flex flex-col gap-2\">\n {Object.keys(call.args).length > 0 ? (\n <CodeBlock text={JSON.stringify(call.args, null, 2)} className=\"language-json\" />\n ) : null}\n {printed ? (\n <pre\n data-testid=\"exec-call-output\"\n className=\"max-h-72 overflow-auto font-mono text-sm break-words whitespace-pre-wrap text-po-text\"\n >\n {text}\n </pre>\n ) : null}\n </div>\n </details>\n ) : (\n <div className=\"flex flex-wrap items-center gap-x-2 gap-y-0.5 text-sm\">{head}</div>\n )}\n {call.error === undefined ? null : <p className=\"text-sm break-words text-po-red\">{call.error}</p>}\n <Visuals text={text} images={view.images} label={call.name} />\n </div>\n );\n}\n\n/** The script's outcome as the tree's last leaf: one line until opened, the whole text after; visuals always. */\nfunction Returned({ result, isError }: { result: ExecToolCardProps['result']; isError: boolean }) {\n const view = execResultView(result);\n const text = view.lines.join('\\n');\n const label = isError ? 'Error' : 'Returned';\n const ink = isError ? 'text-po-red' : 'text-po-text';\n return (\n <div data-testid={`tool-result-${execToolName}`} className=\"flex flex-col gap-2\">\n {view.lines.length === 0 ? (\n <p className=\"text-sm text-po-dim\">{isError ? 'Failed with no output.' : 'Returned nothing.'}</p>\n ) : readsAsDocument(text) ? (\n <p className=\"text-sm font-semibold text-po-dim\">{label}</p>\n ) : (\n <details open={isError} className=\"group text-sm\">\n <summary className={`${SUMMARY} text-po-dim hover:text-po-blue`}>\n <span className=\"shrink-0 font-semibold\">{label}</span>\n <span className={`min-w-0 flex-1 truncate font-mono group-open:hidden ${ink}`}>{view.lines.join(' ')}</span>\n <Chevron />\n </summary>\n <pre\n data-testid=\"tool-output\"\n className={`mt-1 max-h-72 overflow-auto font-mono text-sm break-words whitespace-pre-wrap ${ink}`}\n >\n {text}\n </pre>\n </details>\n )}\n <Visuals text={text} images={view.images} label=\"Script\" />\n </div>\n );\n}\n\n/**\n * The exec tool's timeline item. The calls the script made hang under it as a\n * tree, each as the owning tool's own card when one exists, with what the\n * script returned as the last leaf. Opening the item shows the script itself.\n */\nexport function ExecToolCard({\n args,\n result,\n running,\n isError,\n defaultExpanded = false,\n renderTool,\n}: ExecToolCardProps) {\n const code = execCode(args);\n const saved = execResultView(result).saved;\n const calls = execCalls(result?.details);\n const failed = calls.filter((call) => !call.ok).length;\n const settled = !running || result !== null;\n return (\n <MessageItem tone={toolTone({ running, isError })} expandable={code !== ''} defaultExpanded={defaultExpanded}>\n {({ expanded }) => (\n <>\n <MessageItemHeader title={execToolName}>\n <span data-testid={`tool-call-${execToolName}`} className=\"min-w-0 flex-1 truncate text-po-text\">\n {execSummary(args)}\n </span>\n {calls.length > 0 ? (\n <span className=\"shrink-0 text-sm text-po-dim\">\n {calls.length} {calls.length === 1 ? 'call' : 'calls'}\n {failed > 0 ? <span className=\"text-po-red\">, {failed} failed</span> : null}\n </span>\n ) : null}\n </MessageItemHeader>\n {expanded ? (\n <MessageItemBody className=\"flex flex-col gap-2\">\n <ToolSection label=\"Code\">\n <CodeBlock text={code} className=\"language-ts\" />\n </ToolSection>\n {saved === undefined ? null : (\n <p className=\"text-sm text-po-dim\" title={saved.path}>\n Saved as <span className=\"font-mono text-po-text\">{saved.id}</span>\n </p>\n )}\n </MessageItemBody>\n ) : null}\n {settled ? (\n <ol\n aria-label=\"Script calls\"\n className=\"mx-4 mb-3 flex flex-col gap-2 border-l border-po-border-soft pl-4 sm:ml-[2.125rem]\"\n >\n {calls.map((call, index) => {\n const card =\n call.tool === undefined || renderTool === undefined\n ? null\n : renderTool({\n toolName: call.tool,\n args: call.args,\n result: call.result ?? null,\n isError: !call.ok,\n });\n // ponytail: another tool's card folds as it likes, so its pictures are repeated under it and\n // may show twice while it is open; drop this once cards keep pictures visible when folded.\n return (\n <li key={`${String(index)}-${call.name}`} className={`${BRANCH} flex flex-col gap-2`}>\n {card === null ? (\n <CallRow call={call} />\n ) : (\n <>\n {card}\n <Visuals text=\"\" images={execResultView(call.result ?? null).images} label={call.name} />\n </>\n )}\n </li>\n );\n })}\n <li className={BRANCH}>\n <Returned result={result} isError={isError} />\n </li>\n </ol>\n ) : null}\n </>\n )}\n </MessageItem>\n );\n}\n","import { defineToolRenderer } from '@agimon-ai/po-core/web';\n\nimport { ExecToolCard } from './_components/ExecToolCard';\n\nexport default defineToolRenderer({ message: ExecToolCard });\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { defineWebPlugin, type WebPluginContributions } from '@agimon-ai/po-core/web';\n\nimport toolDiscover from '../src/extensions/workspaces/sessions/(frontend)/tool/discover.web';\nimport toolExec from '../src/extensions/workspaces/sessions/(frontend)/tool/exec.web';\n\nconst via = <T>(identity: Record<string, unknown>, value: unknown): T =>\n (value === undefined ? undefined : { ...identity, ...(value as object) }) as T;\n\nexport const webPlugin = defineWebPlugin({\n id: 'codemode',\n session: {\n get toolRenderers(): WebPluginContributions['toolRenderers'] { return [via({ tools: ['discover'] }, toolDiscover), via({ tools: ['exec'] }, toolExec)]; },\n },\n});\n"],"mappings":";;;;;AAKA,MAAa,eAAe;AAC5B,MAAa,mBAAmB;AAEhC,MAAM,cAAc;AACpB,MAAM,WAAW;AACjB,MAAM,YAAY;AAClB,MAAM,cAAc;AACpB,MAAM,aAAa;AAEnB,MAAM,gBAAgB;AAEtB,SAAS,OAAO,OAAqD;CACnE,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK,IACrE,QACD,KAAA;AACN;AAEA,SAAS,KAAK,MAAc,KAAqB;CAC/C,OAAO,KAAK,UAAU,MAAM,OAAO,GAAG,KAAK,MAAM,GAAG,MAAM,CAAC,EAAE;AAC/D;;AAGA,SAAgB,SAAS,MAAiD;CACxE,OAAO,OAAO,KAAK,SAAS,WAAW,KAAK,OAAO;AACrD;;AAGA,SAAgB,YAAY,MAAiD;CAC3E,MAAM,QAAQ,SAAS,IAAI,CAAC,CACzB,MAAM,IAAI,CAAC,CACX,KAAK,SAAS,KAAK,KAAK,CAAC,CAAC,CAC1B,MAAM,SAAS,SAAS,EAAE;CAC7B,IAAI,UAAU,KAAA,GAAW,OAAO;CAChC,OAAO,KAAK,MAAM,QAAQ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MAAM,EAAE,GAAGC,gBAAQ,CAAC;CAAG,EAC1J;AACF,CAAC"}
1
+ {"version":3,"file":"web.mjs","names":["toolDiscover","toolExec"],"sources":["../../src/extensions/workspaces/sessions/(frontend)/tool/_lib/execToolView.ts","../../src/extensions/workspaces/sessions/(frontend)/tool/_components/DiscoverToolCard.tsx","../../src/extensions/workspaces/sessions/(frontend)/tool/discover.web.tsx","../../src/extensions/workspaces/sessions/(frontend)/tool/_components/ToolSection.tsx","../../src/extensions/workspaces/sessions/(frontend)/tool/_components/ExecToolCard.tsx","../../src/extensions/workspaces/sessions/(frontend)/tool/exec.web.tsx","../../generated/web.ts"],"sourcesContent":["// Imports nothing at runtime: the web and native cards share it, and the native\n// bundle may not load the web contract.\nimport type { ToolResultView } from '@agimon-ai/po-core/web';\n\n/** Tool names this package registers (registerTool's `name`). */\nexport const execToolName = 'exec' as const;\nexport const discoverToolName = 'discover' as const;\n\nconst SUMMARY_MAX = 120;\nconst ARGS_MAX = 160;\nconst CALLS_MAX = 50;\nconst IMAGE_TYPES = /^image\\/(?:png|jpeg|webp|gif)$/u;\nconst SAVED_LINE = /^Saved as (\\S+) \\((.+)\\)$/u;\n// A heading or a fence starts a line of Markdown, never one of JSON or a log.\nconst DOCUMENT_LINE = /^(?:#{1,6} |```)/mu;\n\nfunction record(value: unknown): Record<string, unknown> | undefined {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : undefined;\n}\n\nfunction clip(text: string, max: number): string {\n return text.length <= max ? text : `${text.slice(0, max - 1)}…`;\n}\n\n/** The script the call ran, exactly as the agent wrote it. */\nexport function execCode(args: Readonly<Record<string, unknown>>): string {\n return typeof args.code === 'string' ? args.code : '';\n}\n\n/** The header line: the script's first line, with a leading `//` comment marker dropped. */\nexport function execSummary(args: Readonly<Record<string, unknown>>): string {\n const first = execCode(args)\n .split('\\n')\n .map((line) => line.trim())\n .find((line) => line !== '');\n if (first === undefined) return 'script';\n return clip(first.replace(/^\\/\\/+\\s*/u, ''), SUMMARY_MAX);\n}\n\n/** One namespace call the script made, as exec reports it in the result's details. */\nexport interface ExecCall {\n /** The member called, such as `browser.click` or `mcp.github.search_issues`. */\n name: string;\n args: Record<string, unknown>;\n ok: boolean;\n ms: number;\n /** The tool name whose own card shows this call, when another package has one. */\n tool?: string;\n error?: string;\n result?: ToolResultView;\n}\n\nfunction callOf(value: unknown): ExecCall | undefined {\n const call = record(value);\n if (call === undefined || typeof call.name !== 'string' || call.name === '') return undefined;\n const result = record(call.result);\n return {\n name: call.name,\n args: record(call.args) ?? {},\n ok: call.ok !== false,\n ms: typeof call.ms === 'number' && Number.isFinite(call.ms) && call.ms >= 0 ? Math.round(call.ms) : 0,\n ...(typeof call.tool === 'string' && call.tool !== '' ? { tool: call.tool } : {}),\n ...(typeof call.error === 'string' && call.error !== '' ? { error: call.error } : {}),\n ...(result !== undefined && Array.isArray(result.content)\n ? { result: { content: result.content, details: result.details } }\n : {}),\n };\n}\n\n/** The nested calls recorded in a result's details; anything malformed is skipped. */\nexport function execCalls(details: unknown): ExecCall[] {\n const calls = record(details)?.calls;\n if (!Array.isArray(calls)) return [];\n return calls\n .slice(0, CALLS_MAX)\n .map(callOf)\n .filter((call): call is ExecCall => call !== undefined);\n}\n\n/** A call's arguments on one line, for a row that has no card of its own. */\nexport function callArgsSummary(args: Readonly<Record<string, unknown>>): string {\n return Object.keys(args).length === 0 ? '' : clip(JSON.stringify(args), ARGS_MAX);\n}\n\nexport interface ExecImage {\n mimeType: string;\n data: string;\n}\n\nexport interface ExecResultView {\n lines: string[];\n /** The saved-script footer exec appends: the id to import it by, and where it lives. */\n saved?: { id: string; path: string };\n images: ExecImage[];\n}\n\n/** What a result holds, with the saved-script footer and the pictures taken out of the text. */\nexport function execResultView(result: ToolResultView | null): ExecResultView {\n if (result === null) return { lines: [], images: [] };\n let saved: ExecResultView['saved'];\n const texts: string[] = [];\n const images: ExecImage[] = [];\n for (const block of result.content) {\n const item = record(block);\n if (item?.type === 'text' && typeof item.text === 'string') {\n const match = SAVED_LINE.exec(item.text.trim());\n if (match?.[1] !== undefined && match[2] !== undefined) saved = { id: match[1], path: match[2] };\n else texts.push(item.text);\n } else if (\n item?.type === 'image' &&\n typeof item.data === 'string' &&\n typeof item.mimeType === 'string' &&\n IMAGE_TYPES.test(item.mimeType)\n ) {\n images.push({ mimeType: item.mimeType, data: item.data });\n }\n }\n // As po-core's toolResultTextLines: CRLF folded, tabs widened, trailing blank lines dropped.\n const lines = texts.join('\\n').replaceAll('\\r\\n', '\\n').replaceAll('\\r', '\\n').replaceAll('\\t', ' ').split('\\n');\n while (lines.length > 0 && lines.at(-1)?.trim() === '') lines.pop();\n return { lines, ...(saved === undefined ? {} : { saved }), images };\n}\n\n/** Whether result text is a document, such as a report or a mermaid diagram, to draw rather than print. */\nexport function readsAsDocument(text: string): boolean {\n return DOCUMENT_LINE.test(text);\n}\n\n/** The header line for discover: what was asked for. */\nexport function discoverSummary(args: Readonly<Record<string, unknown>>): string {\n if (typeof args.namespace === 'string' && args.namespace !== '') return args.namespace;\n if (typeof args.query === 'string' && args.query !== '') return `find \"${clip(args.query, SUMMARY_MAX)}\"`;\n return 'namespaces and scripts';\n}\n","import type { ToolMessageRenderProps } from '@agimon-ai/po-core/web';\nimport {\n CodeBlock,\n MessageItem,\n MessageItemBody,\n MessageItemHeader,\n MessageItemStatus,\n toolTone,\n} from '@agimon-ai/po-web-components';\n\nimport { discoverSummary, discoverToolName } from '../_lib/execToolView';\n\nexport type DiscoverToolCardProps = ToolMessageRenderProps & { defaultExpanded?: boolean };\n\n/** The discover tool's timeline item: folded to what was asked for, open to what came back. */\nexport function DiscoverToolCard({ args, output, running, isError, defaultExpanded = false }: DiscoverToolCardProps) {\n const declarations = typeof args.namespace === 'string' && args.namespace !== '' && !isError;\n return (\n <MessageItem tone={toolTone({ running, isError })} expandable defaultExpanded={defaultExpanded}>\n {({ expanded }) => (\n <>\n <MessageItemHeader title={discoverToolName}>\n <span data-testid={`tool-call-${discoverToolName}`} className=\"min-w-0 flex-1 truncate text-po-text\">\n {discoverSummary(args)}\n </span>\n </MessageItemHeader>\n {expanded ? (\n <MessageItemBody data-testid={`tool-result-${discoverToolName}`} className=\"flex flex-col gap-2\">\n {running && output === '' ? <MessageItemStatus tone=\"running\">running</MessageItemStatus> : null}\n {output === '' ? null : declarations ? (\n <div className=\"max-h-96 overflow-auto\">\n <CodeBlock text={output} className=\"language-ts\" />\n </div>\n ) : (\n <pre\n data-testid=\"tool-output\"\n className={`max-h-96 overflow-auto font-mono text-sm break-words whitespace-pre-wrap ${isError ? 'text-po-red' : 'text-po-text'}`}\n >\n {output}\n </pre>\n )}\n </MessageItemBody>\n ) : null}\n </>\n )}\n </MessageItem>\n );\n}\n","import { defineToolRenderer } from '@agimon-ai/po-core/web';\n\nimport { DiscoverToolCard } from './_components/DiscoverToolCard';\n\nexport default defineToolRenderer({ message: DiscoverToolCard });\n","import type { ReactNode } from 'react';\n\n/** A labelled part of an expanded card body. */\nexport function ToolSection({ label, children }: { label: string; children: ReactNode }) {\n return (\n <section className=\"flex flex-col gap-1.5\">\n <h4 className=\"text-sm font-medium text-po-dim\">{label}</h4>\n {children}\n </section>\n );\n}\n","import type { ToolMessageRenderProps } from '@agimon-ai/po-core/web';\nimport {\n CodeBlock,\n Markdown,\n MessageItem,\n MessageItemBody,\n MessageItemHeader,\n toolTone,\n} from '@agimon-ai/po-web-components';\n\nimport {\n callArgsSummary,\n execCalls,\n execCode,\n execResultView,\n execSummary,\n execToolName,\n readsAsDocument,\n type ExecCall,\n type ExecImage,\n} from '../_lib/execToolView';\nimport { ToolSection } from './ToolSection';\n\n/** Draws another tool's own card for a nested call, or nothing when no package owns one. */\nexport type RenderNestedTool = NonNullable<ToolMessageRenderProps['renderTool']>;\n\nexport type ExecToolCardProps = ToolMessageRenderProps & { defaultExpanded?: boolean };\n\n/** The tree's elbow: a short branch from the rail to the item it leads to. */\nconst BRANCH =\n 'relative before:absolute before:top-[1.125rem] before:-left-4 before:w-3 before:border-t before:border-po-border-soft';\n\nconst SUMMARY =\n 'flex min-h-6 cursor-pointer list-none items-center gap-x-2 gap-y-0.5 [&::-webkit-details-marker]:hidden';\n\n/** The folding mark at the end of a summary; it turns when the section opens. */\nfunction Chevron() {\n return (\n <span aria-hidden className=\"w-3 shrink-0 text-center text-po-dim transition-transform group-open:rotate-90\">\n ›\n </span>\n );\n}\n\n/** Pictures and documents stay on screen whether or not their section is open: they are the point of the call. */\nfunction Visuals({ text, images, label }: { text: string; images: readonly ExecImage[]; label: string }) {\n return (\n <>\n {readsAsDocument(text) ? (\n <div data-testid=\"tool-output-document\" className=\"max-h-96 overflow-auto text-sm\">\n <Markdown text={text} />\n </div>\n ) : null}\n {images.map((image, index) => (\n <img\n key={`${image.mimeType}-${String(index)}`}\n src={`data:${image.mimeType};base64,${image.data}`}\n alt={`${label} image ${String(index + 1)}`}\n data-testid=\"tool-output-image\"\n className=\"max-h-48 max-w-full self-start rounded-md border border-po-border-soft\"\n />\n ))}\n </>\n );\n}\n\n/** One call on the rail. It opens to its whole args and result; its pictures and documents show either way. */\nfunction CallRow({ call }: { call: ExecCall }) {\n const view = execResultView(call.result ?? null);\n const text = view.lines.join('\\n');\n const printed = text !== '' && !readsAsDocument(text);\n const opens = Object.keys(call.args).length > 0 || printed;\n const head = (\n <>\n <span className=\"shrink-0 truncate font-mono font-semibold text-po-text max-sm:basis-full\">{call.name}</span>\n <span className=\"min-w-0 flex-1 truncate font-mono text-po-dim group-open:invisible\">\n {callArgsSummary(call.args)}\n </span>\n <span aria-hidden className={`w-3 shrink-0 text-center ${call.ok ? 'text-po-green' : 'text-po-red'}`}>\n {call.ok ? '✓' : '✗'}\n </span>\n <span className=\"sr-only\">{call.ok ? 'completed' : 'failed'}</span>\n <span className=\"w-16 shrink-0 text-right tabular-nums text-po-dim\">{call.ms} ms</span>\n </>\n );\n return (\n <div data-testid=\"exec-call\" className=\"flex flex-col gap-2 py-1.5\">\n {opens ? (\n <details className=\"group text-sm\">\n <summary className={`${SUMMARY} flex-wrap`}>\n {head}\n <Chevron />\n </summary>\n <div className=\"mt-2 flex flex-col gap-2\">\n {Object.keys(call.args).length > 0 ? (\n <CodeBlock text={JSON.stringify(call.args, null, 2)} className=\"language-json\" />\n ) : null}\n {printed ? (\n <pre\n data-testid=\"exec-call-output\"\n className=\"max-h-72 overflow-auto font-mono text-sm break-words whitespace-pre-wrap text-po-text\"\n >\n {text}\n </pre>\n ) : null}\n </div>\n </details>\n ) : (\n <div className=\"flex flex-wrap items-center gap-x-2 gap-y-0.5 text-sm\">{head}</div>\n )}\n {call.error === undefined ? null : <p className=\"text-sm break-words text-po-red\">{call.error}</p>}\n <Visuals text={text} images={view.images} label={call.name} />\n </div>\n );\n}\n\n/** The script's outcome as the tree's last leaf: one line until opened, the whole text after; visuals always. */\nfunction Returned({ result, isError }: { result: ExecToolCardProps['result']; isError: boolean }) {\n const view = execResultView(result);\n const text = view.lines.join('\\n');\n const label = isError ? 'Error' : 'Returned';\n const ink = isError ? 'text-po-red' : 'text-po-text';\n return (\n <div data-testid={`tool-result-${execToolName}`} className=\"flex flex-col gap-2\">\n {view.lines.length === 0 ? (\n <p className=\"text-sm text-po-dim\">{isError ? 'Failed with no output.' : 'Returned nothing.'}</p>\n ) : readsAsDocument(text) ? (\n <p className=\"text-sm font-semibold text-po-dim\">{label}</p>\n ) : (\n <details open={isError} className=\"group text-sm\">\n <summary className={`${SUMMARY} text-po-dim hover:text-po-blue`}>\n <span className=\"shrink-0 font-semibold\">{label}</span>\n <span className={`min-w-0 flex-1 truncate font-mono group-open:hidden ${ink}`}>{view.lines.join(' ')}</span>\n <Chevron />\n </summary>\n <pre\n data-testid=\"tool-output\"\n className={`mt-1 max-h-72 overflow-auto font-mono text-sm break-words whitespace-pre-wrap ${ink}`}\n >\n {text}\n </pre>\n </details>\n )}\n <Visuals text={text} images={view.images} label=\"Script\" />\n </div>\n );\n}\n\n/**\n * The exec tool's timeline item. The calls the script made hang under it as a\n * tree, each as the owning tool's own card when one exists, with what the\n * script returned as the last leaf. Opening the item shows the script itself.\n */\nexport function ExecToolCard({\n args,\n result,\n running,\n isError,\n defaultExpanded = false,\n renderTool,\n}: ExecToolCardProps) {\n const code = execCode(args);\n const saved = execResultView(result).saved;\n const calls = execCalls(result?.details);\n const failed = calls.filter((call) => !call.ok).length;\n const settled = !running || result !== null;\n return (\n <MessageItem tone={toolTone({ running, isError })} expandable={code !== ''} defaultExpanded={defaultExpanded}>\n {({ expanded }) => (\n <>\n <MessageItemHeader title={execToolName}>\n <span data-testid={`tool-call-${execToolName}`} className=\"min-w-0 flex-1 truncate text-po-text\">\n {execSummary(args)}\n </span>\n {calls.length > 0 ? (\n <span className=\"shrink-0 text-sm text-po-dim\">\n {calls.length} {calls.length === 1 ? 'call' : 'calls'}\n {failed > 0 ? <span className=\"text-po-red\">, {failed} failed</span> : null}\n </span>\n ) : null}\n </MessageItemHeader>\n {expanded ? (\n <MessageItemBody className=\"flex flex-col gap-2\">\n <ToolSection label=\"Code\">\n <CodeBlock text={code} className=\"language-ts\" />\n </ToolSection>\n {saved === undefined ? null : (\n <p className=\"text-sm text-po-dim\" title={saved.path}>\n Saved as <span className=\"font-mono text-po-text\">{saved.id}</span>\n </p>\n )}\n </MessageItemBody>\n ) : null}\n {settled ? (\n <ol\n aria-label=\"Script calls\"\n className=\"mx-4 mb-3 flex flex-col gap-2 border-l border-po-border-soft pl-4 sm:ml-[2.125rem]\"\n >\n {calls.map((call, index) => {\n const card =\n call.tool === undefined || renderTool === undefined\n ? null\n : renderTool({\n toolName: call.tool,\n args: call.args,\n result: call.result ?? null,\n isError: !call.ok,\n });\n // ponytail: another tool's card folds as it likes, so its pictures are repeated under it and\n // may show twice while it is open; drop this once cards keep pictures visible when folded.\n return (\n <li key={`${String(index)}-${call.name}`} className={`${BRANCH} flex flex-col gap-2`}>\n {card === null ? (\n <CallRow call={call} />\n ) : (\n <>\n {card}\n <Visuals text=\"\" images={execResultView(call.result ?? null).images} label={call.name} />\n </>\n )}\n </li>\n );\n })}\n <li className={BRANCH}>\n <Returned result={result} isError={isError} />\n </li>\n </ol>\n ) : null}\n </>\n )}\n </MessageItem>\n );\n}\n","import { defineToolRenderer } from '@agimon-ai/po-core/web';\n\nimport { ExecToolCard } from './_components/ExecToolCard';\n\nexport default defineToolRenderer({ message: ExecToolCard });\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { defineWebPlugin, type WebPluginContributions } from '@agimon-ai/po-core/web';\n\nimport toolDiscover from '../src/extensions/workspaces/sessions/(frontend)/tool/discover.web';\nimport toolExec from '../src/extensions/workspaces/sessions/(frontend)/tool/exec.web';\n\nconst via = <T>(identity: Record<string, unknown>, value: unknown): T =>\n (value === undefined ? undefined : { ...identity, ...(value as object) }) as T;\n\nexport const webPlugin = defineWebPlugin({\n id: 'codemode',\n session: {\n get toolRenderers(): WebPluginContributions['toolRenderers'] { return [via({ tools: ['discover'] }, toolDiscover), via({ tools: ['exec'] }, toolExec)]; },\n },\n});\n"],"mappings":";;;;;AAKA,MAAa,eAAe;AAC5B,MAAa,mBAAmB;AAEhC,MAAM,cAAc;AACpB,MAAM,WAAW;AACjB,MAAM,YAAY;AAClB,MAAM,cAAc;AACpB,MAAM,aAAa;AAEnB,MAAM,gBAAgB;AAEtB,SAAS,OAAO,OAAqD;CACnE,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK,IACrE,QACD,KAAA;AACN;AAEA,SAAS,KAAK,MAAc,KAAqB;CAC/C,OAAO,KAAK,UAAU,MAAM,OAAO,GAAG,KAAK,MAAM,GAAG,MAAM,CAAC,EAAE;AAC/D;;AAGA,SAAgB,SAAS,MAAiD;CACxE,OAAO,OAAO,KAAK,SAAS,WAAW,KAAK,OAAO;AACrD;;AAGA,SAAgB,YAAY,MAAiD;CAC3E,MAAM,QAAQ,SAAS,IAAI,CAAC,CACzB,MAAM,IAAI,CAAC,CACX,KAAK,SAAS,KAAK,KAAK,CAAC,CAAC,C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AE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,EAAE,GAAGA,oBAAY,GAAG,IAAI,EAAE,OAAO,CAAC,MAAM,EAAE,GAAGC,gBAAQ,CAAC;CAAG,EAC1J;AACF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agimon-ai/po-codemode",
3
- "version": "0.0.1-alpha.37",
3
+ "version": "0.0.1-alpha.38",
4
4
  "description": "Code mode for Po sessions: discover and exec over namespaces other packages contribute",
5
5
  "keywords": [
6
6
  "ai",
@@ -55,18 +55,18 @@
55
55
  "access": "public"
56
56
  },
57
57
  "dependencies": {
58
- "@agimon-ai/po-config": "0.0.0-alpha.64",
59
- "@agimon-ai/po-core": "0.0.0-alpha.64",
60
- "@agimon-ai/po-web-components": "0.0.0-alpha.64",
58
+ "@agimon-ai/po-config": "0.0.0-alpha.65",
59
+ "@agimon-ai/po-core": "0.0.0-alpha.65",
60
+ "@agimon-ai/po-web-components": "0.0.0-alpha.65",
61
61
  "@deepseek-ai/cordis": "4.0.5",
62
62
  "react": "19.3.1",
63
63
  "typebox": "1.4.2"
64
64
  },
65
65
  "devDependencies": {
66
- "@agimon-ai/po-build": "0.0.0-alpha.64",
67
- "@agimon-ai/po-native-components": "0.0.0-alpha.64",
68
- "@agimon-ai/vibe-lint-plugin-po-extension": "0.0.0-alpha.64",
69
- "@agimon-ai/vibe-lint-plugin-po-web": "0.0.0-alpha.64",
66
+ "@agimon-ai/po-build": "0.0.0-alpha.65",
67
+ "@agimon-ai/po-native-components": "0.0.0-alpha.65",
68
+ "@agimon-ai/vibe-lint-plugin-po-extension": "0.0.0-alpha.65",
69
+ "@agimon-ai/vibe-lint-plugin-po-web": "0.0.0-alpha.65",
70
70
  "@earendil-works/pi-coding-agent": "1.4.0",
71
71
  "@types/node": "26.6.5",
72
72
  "@types/react": "19.3.0",
@@ -80,7 +80,7 @@
80
80
  "vitest": "5.0.4"
81
81
  },
82
82
  "peerDependencies": {
83
- "@agimon-ai/po-native-components": "0.0.0-alpha.64",
83
+ "@agimon-ai/po-native-components": "0.0.0-alpha.65",
84
84
  "@earendil-works/pi-coding-agent": "1.4.0",
85
85
  "react-native": "0.88.0",
86
86
  "react-native-unistyles": "^3.5.3"