opencode-prompt-logger 0.1.0 → 0.2.0

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.
@@ -0,0 +1,25 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/tui.tsx", "../src/tui-panel/panel.tsx", "../src/log/limits.ts", "../src/rpc.ts", "../src/core.ts", "../src/settings.ts", "../src/rpc-client.ts", "../src/ui-support.ts", "../src/session-scope.ts", "../src/session-scope-client.ts", "../src/log/sanitize.ts", "../src/view-model.ts", "../src/detail-lines.ts", "../src/tui-panel/detail.tsx", "../src/tui-status.tsx", "../src/logging-indicator.ts"],
4
+ "sourcesContent": [
5
+ "import { createComponent as _$createComponent } from \"@opentui/solid\";\n/** @jsxImportSource @opentui/solid */\nimport { Plugin } from \"@opencode/plugin/tui\";\nimport { LogView } from \"./tui-panel/panel\";\nimport { LoggingBadge, createLoggingSnapshot } from \"./tui-status\";\nimport { promptLogApi } from \"./rpc-client\";\nimport { scopeLabel } from \"./session-scope\";\nimport { toggleSessionArmed } from \"./session-scope-client\";\nimport { errorMessage } from \"./ui-support\";\nimport { PANEL_NAME } from \"./view-model\";\nconst PAGE_NAME = \"prompt-logger\";\n\n/**\n * TUI side of the plugin.\n *\n * - In a session, `/prompt-log` or the palette command opens the session panel.\n * - From Home, the same command opens the global page: all sessions, plus the\n * settings dialog. Logging can therefore be turned on before any session\n * exists, which is the whole point of a troubleshooting logger.\n *\n * Both views read the log through the server RPC, so they work against a local\n * or a remote server and never open the file themselves.\n */\nexport default Plugin.define({\n id: \"prompt-logger.tui\",\n setup(ctx) {\n // One state snapshot feeds both footer badges. It reads the status once and\n // follows `settingsChanged`, so the footer never polls.\n const logging = createLoggingSnapshot(ctx);\n const disposePage = ctx.ui.router.register({\n name: PAGE_NAME,\n render: input => _$createComponent(LogView, {\n ctx: ctx,\n initialScope: \"all\",\n get openSettings() {\n return input.data?.settings === true;\n },\n get width() {\n return ctx.renderer.width;\n },\n close: () => ctx.ui.router.navigate({\n type: \"home\"\n })\n })\n });\n const disposePanel = ctx.ui.slot({\n append: \"session.panel\",\n render: input => input.name === PANEL_NAME ? _$createComponent(LogView, {\n ctx: ctx,\n get sessionID() {\n return input.sessionID;\n },\n get width() {\n return input.width;\n },\n close: () => input.close()\n }) : null\n });\n\n // The status bar is the only always-visible TUI surface. A badge means\n // \"logging on\"; it is absent while logging is off.\n const disposeSessionStatus = ctx.ui.slot({\n append: \"prompt.footer.status\",\n render: input => _$createComponent(LoggingBadge, {\n get snapshot() {\n return logging.current;\n },\n get theme() {\n return ctx.theme;\n },\n get sessionID() {\n return input.sessionID;\n }\n })\n });\n const disposeHomeStatus = ctx.ui.slot({\n append: \"home.footer.status\",\n render: () => _$createComponent(LoggingBadge, {\n get snapshot() {\n return logging.current;\n },\n get theme() {\n return ctx.theme;\n }\n })\n });\n ctx.keymap.layer(() => {\n // The explicit block body avoids the TSX parser ambiguity between a\n // parenthesized object literal and arrow parameters.\n return {\n mode: \"global\",\n commands: [{\n id: \"prompt-logger.open\",\n title: \"Prompt log\",\n description: \"Inspect the assembled prompt and, when enabled, the raw request body\",\n group: \"Prompt logger\",\n bind: false,\n palette: true,\n slash: {\n name: \"prompt-log\"\n },\n run: () => {\n if (ctx.ui.panel.current()?.name === PANEL_NAME) {\n ctx.ui.panel.close();\n return;\n }\n // A session panel is the most contextual view; from Home there\n // is no session to attach it to, so open the global page instead.\n if (!ctx.ui.panel.open(PANEL_NAME, {\n presentation: \"fullscreen\"\n })) {\n ctx.ui.router.navigate({\n type: \"plugin\",\n name: PAGE_NAME\n });\n }\n }\n }, {\n id: \"prompt-logger.settings\",\n title: \"Prompt logger settings\",\n description: \"Configure logging and maintain the prompt log without a session\",\n group: \"Prompt logger\",\n bind: false,\n palette: true,\n run: () => {\n ctx.ui.router.navigate({\n type: \"plugin\",\n name: PAGE_NAME,\n data: {\n settings: true\n }\n });\n }\n }, {\n id: \"prompt-logger.only\",\n title: \"Log only this session\",\n description: \"Record model requests for the current session and pause the others\",\n group: \"Prompt logger\",\n bind: false,\n palette: true,\n slash: {\n name: \"prompt-log-only\"\n },\n run: async () => {\n const route = ctx.ui.router.current();\n if (route.type !== \"session\") {\n ctx.ui.toast.show({\n message: \"open a session to log only that session\",\n variant: \"info\"\n });\n return;\n }\n try {\n const result = await toggleSessionArmed(promptLogApi(ctx.client, ctx.location), route.sessionID);\n ctx.ui.toast.show({\n message: `logging: ${scopeLabel(result.sessionScope, result.settings.enabled, route.sessionID)}`,\n variant: \"success\"\n });\n } catch (cause) {\n ctx.ui.toast.show({\n message: errorMessage(cause),\n variant: \"warning\"\n });\n }\n }\n }]\n };\n });\n return () => {\n disposePage();\n disposePanel();\n disposeSessionStatus();\n disposeHomeStatus();\n logging.dispose();\n };\n }\n});",
6
+ "import { createTextNode as _$createTextNode } from \"@opentui/solid\";\nimport { insertNode as _$insertNode } from \"@opentui/solid\";\nimport { effect as _$effect } from \"@opentui/solid\";\nimport { use as _$use } from \"@opentui/solid\";\nimport { insert as _$insert } from \"@opentui/solid\";\nimport { createComponent as _$createComponent } from \"@opentui/solid\";\nimport { setProp as _$setProp } from \"@opentui/solid\";\nimport { createElement as _$createElement } from \"@opentui/solid\";\n/** @jsxImportSource @opentui/solid */\nimport { TextAttributes } from \"@opentui/core\";\nimport { For, Show, createEffect, createMemo, createSignal, on, onCleanup } from \"solid-js\";\nimport { MAX_FULL_RECORD_BYTES } from \"../log/limits\";\nimport { promptLogApi } from \"../rpc-client\";\nimport { errorMessage, warningLabel } from \"../ui-support\";\nimport { CONTRACT_VERSION } from \"../rpc\";\nimport { isSelected, scopeLabel } from \"../session-scope\";\nimport { toggleSessionArmed } from \"../session-scope-client\";\nimport { detailLinesForSections } from \"../detail-lines\";\nimport { DetailPane } from \"./detail\";\nimport { DETAIL_PAGE, PREVIEW_LIMIT, displayText, entryLine, fitText, formatBytes, mergeSummaries, sectionsFor, summaryKey } from \"../view-model\";\n/** Expanded sections stay bounded so the line tokenizer cannot freeze the TUI. */\nconst TUI_SECTION_LIMIT = 256 * 1024;\nconst BUDGET_PRESETS = [{\n title: \"64 MB\",\n value: 64 * 1024 * 1024\n}, {\n title: \"256 MB\",\n value: 256 * 1024 * 1024\n}, {\n title: \"1 GB\",\n value: 1024 * 1024 * 1024\n}, {\n title: \"No budget\",\n value: false\n}];\nfunction budgetLabel(value) {\n return value === 0 ? \"no budget\" : formatBytes(value);\n}\n\n/**\n * The prompt log viewer, shared by the session panel and the global page.\n *\n * - With `sessionID`, it starts scoped to that session (the panel).\n * - Without it, it starts on all sessions and works from Home, before any\n * session exists; the settings dialog can then turn logging on.\n *\n * It owns the keyboard while mounted: j/k navigate, Enter opens one record,\n * and every metadata change goes through the bounded RPC, never the file.\n */\nexport function LogView(props) {\n const [status, setStatus] = createSignal();\n const [entries, setEntries] = createSignal([]);\n const [cursor, setCursor] = createSignal(0);\n const [scope, setScope] = createSignal(props.initialScope ?? (props.sessionID === undefined ? \"all\" : \"session\"));\n const [type, setType] = createSignal(\"all\");\n const [filter, setFilter] = createSignal(\"\");\n const [live, setLive] = createSignal(true);\n const [loading, setLoading] = createSignal(false);\n const [hasMore, setHasMore] = createSignal(false);\n const [error, setError] = createSignal();\n const [help, setHelp] = createSignal(false);\n const [detailData, setDetailData] = createSignal();\n const [expanded, setExpanded] = createSignal(false);\n const [detailLoading, setDetailLoading] = createSignal(false);\n const [detailOffset, setDetailOffset] = createSignal(0);\n const api = () => promptLogApi(props.ctx.client, props.ctx.location);\n let scroller;\n let listAbort;\n let detailAbort;\n let listGeneration = 0;\n let statusGeneration = 0;\n let pollTimer;\n let debounceTimer;\n let unsubscribe;\n let unsubscribeSettings;\n let disposed = false;\n let lastSearchKey = \"\";\n let lastSearchAt = 0;\n function isAbort(cause) {\n return cause !== null && typeof cause === \"object\" && \"name\" in cause && cause.name === \"AbortError\";\n }\n function toast(message, variant = \"info\") {\n props.ctx.ui.toast.show({\n message: displayText(message, 600),\n variant\n });\n }\n function listInput(cursorValue) {\n return {\n ...(scope() === \"session\" && props.sessionID !== undefined ? {\n sessionID: props.sessionID\n } : {}),\n ...(type() === \"all\" ? {} : {\n type: type()\n }),\n ...(filter().trim() === \"\" ? {} : {\n query: filter().trim()\n }),\n limit: 50,\n ...(cursorValue === undefined ? {} : {\n cursor: cursorValue\n })\n };\n }\n async function refreshStatus() {\n const generation = ++statusGeneration;\n try {\n const next = await api().status();\n if (generation === statusGeneration) {\n setStatus(next);\n setError(undefined);\n }\n } catch (cause) {\n if (generation === statusGeneration && !isAbort(cause)) setError(errorMessage(cause));\n }\n }\n async function refreshList(mode = \"refresh\") {\n const generation = ++listGeneration;\n listAbort?.abort();\n const controller = new AbortController();\n listAbort = controller;\n setLoading(true);\n try {\n const query = filter().trim();\n if (query !== \"\") {\n if (mode === \"more\") {\n setHasMore(false);\n return;\n }\n const searchKey = `${query}\\u0000${scope()}\\u0000${props.sessionID ?? \"\"}\\u0000${type()}`;\n // The live poll refreshes the normal list every two seconds. A content\n // search over the store is heavier: keep its result for a few seconds\n // unless the user explicitly refreshes or changes a filter.\n if (mode === \"refresh\" && searchKey === lastSearchKey && Date.now() - lastSearchAt < 5_000) return;\n const result = await api().search({\n ...(scope() === \"session\" && props.sessionID !== undefined ? {\n sessionID: props.sessionID\n } : {}),\n ...(type() === \"all\" ? {} : {\n type: type()\n }),\n query,\n limit: 50,\n ignoreCase: true\n }, controller.signal);\n if (generation !== listGeneration) return;\n lastSearchKey = searchKey;\n lastSearchAt = Date.now();\n setEntries(result.matches.map(match => match.entry));\n setHasMore(false);\n setError(result.error ?? undefined);\n setCursor(0);\n return;\n }\n const last = mode === \"more\" ? entries().at(-1) : undefined;\n const result = await api().list(listInput(last?.cursor), controller.signal);\n if (generation !== listGeneration) return;\n setError(result.error ?? undefined);\n if (mode === \"reset\") {\n setEntries(result.entries);\n setHasMore(result.hasMore);\n setCursor(0);\n } else if (mode === \"more\") {\n const known = new Set(entries().map(summaryKey));\n const next = [...entries(), ...result.entries.filter(entry => !known.has(summaryKey(entry)))];\n setEntries(next.slice(0, 200));\n setHasMore(result.hasMore && next.length < 200);\n } else if (result.records === 0 && result.entries.length === 0) {\n // The store was deleted by another process: do not keep showing keys\n // that no longer exist.\n setEntries([]);\n setHasMore(false);\n setCursor(0);\n } else {\n const merged = mergeSummaries(entries(), result.entries);\n setEntries(merged);\n if (result.hasMore) setHasMore(true);\n setCursor(value => Math.min(value, Math.max(0, merged.length - 1)));\n }\n } catch (cause) {\n if (generation === listGeneration && !isAbort(cause)) setError(errorMessage(cause));\n } finally {\n if (generation === listGeneration) setLoading(false);\n }\n }\n function schedulePoll(delay = 2000) {\n if (disposed || pollTimer !== undefined) return;\n pollTimer = setTimeout(() => {\n pollTimer = undefined;\n if (disposed) return;\n void (async () => {\n await refreshStatus();\n await refreshList(\"refresh\");\n if (!disposed && live()) schedulePoll(2000);\n })();\n }, delay);\n pollTimer.unref?.();\n }\n function subscribe() {\n try {\n unsubscribe = api().onChanged(event => {\n const current = status();\n if (current !== undefined && event.store !== current.store.path) return;\n if (event.reason === \"truncate\") {\n setEntries([]);\n setCursor(0);\n setDetailData(undefined);\n setDetailOffset(0);\n void refreshStatus();\n void refreshList(\"reset\");\n return;\n }\n if (!live()) return;\n if (debounceTimer !== undefined) return;\n debounceTimer = setTimeout(() => {\n debounceTimer = undefined;\n void refreshStatus();\n void refreshList(\"refresh\");\n }, 250);\n debounceTimer.unref?.();\n });\n unsubscribeSettings = api().onSettingsChanged(() => {\n void refreshStatus();\n });\n } catch {\n // The event stream is optional; the poll below is the fallback.\n }\n }\n function move(delta) {\n const length = entries().length;\n if (length === 0) return;\n const next = Math.max(0, Math.min(length - 1, cursor() + delta));\n setCursor(next);\n queueMicrotask(() => scroller?.scrollChildIntoView?.(`row-${next}`));\n }\n function moveEdge(toEnd) {\n const length = entries().length;\n if (length === 0) return;\n const next = toEnd ? length - 1 : 0;\n setCursor(next);\n queueMicrotask(() => scroller?.scrollChildIntoView?.(`row-${next}`));\n }\n async function loadMore() {\n if (!hasMore() || loading()) return;\n await refreshList(\"more\");\n }\n async function readDetail(entry, full) {\n detailAbort?.abort();\n const controller = new AbortController();\n detailAbort = controller;\n setDetailLoading(true);\n try {\n const result = await api().read({\n key: entry.key,\n ...(full ? {\n maxBytes: MAX_FULL_RECORD_BYTES\n } : {})\n }, controller.signal);\n setDetailData({\n entry,\n record: result.record,\n truncated: result.truncated,\n moreAvailable: result.moreAvailable,\n fullBytes: result.fullBytes,\n httpEnabled: status()?.settings.http\n });\n // A full load should reveal more than the 16 KB preview straight away.\n setExpanded(full);\n setDetailOffset(0);\n } catch (cause) {\n if (!isAbort(cause)) setError(errorMessage(cause));\n } finally {\n setDetailLoading(false);\n }\n }\n async function openDetail() {\n const entry = entries()[cursor()];\n if (entry === undefined) return;\n await readDetail(entry, false);\n }\n async function loadFullDetail() {\n const data = detailData();\n if (data === undefined || data.moreAvailable !== true) return;\n await readDetail(data.entry, true);\n }\n function buildDetailSections(data, full) {\n const limit = full ? TUI_SECTION_LIMIT : PREVIEW_LIMIT;\n if (data.record === null) {\n return [{\n title: data.truncated ? \"Record (truncated)\" : \"Record\",\n text: \"the record could not be read\",\n tone: \"warning\",\n language: \"text\"\n }];\n }\n return sectionsFor(data.record, limit, {\n httpEnabled: data.httpEnabled\n });\n }\n const detail = createMemo(() => {\n const data = detailData();\n if (data === undefined) return undefined;\n return {\n entry: data.entry,\n sections: buildDetailSections(data, expanded())\n };\n });\n const hasTruncated = createMemo(() => detail()?.sections.some(section => section.truncated === true) ?? false);\n function closeDetail() {\n setDetailData(undefined);\n setExpanded(false);\n setDetailOffset(0);\n }\n function toggleExpand() {\n if (!expanded() && !hasTruncated()) return;\n setExpanded(value => !value);\n setDetailOffset(0);\n }\n const detailLines = createMemo(() => {\n const current = detail();\n if (current === undefined) return [];\n return detailLinesForSections(current.sections);\n });\n const detailPage = createMemo(() => detailLines().slice(detailOffset(), detailOffset() + DETAIL_PAGE));\n const rowWidth = () => Math.max(40, (props.width ?? 100) - 4);\n function scrollDetail(delta) {\n const total = detailLines().length;\n setDetailOffset(value => Math.max(0, Math.min(Math.max(0, total - 1), value + delta)));\n }\n async function truncate(target) {\n if (status()?.settings.maintenance === false) {\n toast(\"delete actions are disabled in the settings\", \"warning\");\n return;\n }\n if (target === \"current\" && props.sessionID === undefined) {\n toast(\"open a session to delete its log\", \"warning\");\n return;\n }\n const what = target === \"current\" ? \"this session's log\" : \"all session logs\";\n const confirmed = await props.ctx.ui.dialog.confirm({\n title: \"Delete the prompt log?\",\n message: `This removes ${what}. The action cannot be undone.`,\n label: {\n confirm: \"Delete\",\n cancel: \"Cancel\"\n }\n });\n if (confirmed !== true) return;\n try {\n const result = await api().truncate(target, target === \"current\" ? props.sessionID : undefined);\n toast(`removed ${formatBytes(result.bytesFreed)}`, \"success\");\n setDetailData(undefined);\n setDetailOffset(0);\n await refreshStatus();\n await refreshList(\"reset\");\n } catch (cause) {\n toast(errorMessage(cause), \"warning\");\n }\n }\n async function applySettings(next) {\n try {\n await api().setSettings(next);\n toast(\"settings saved\", \"success\");\n await refreshStatus();\n } catch (cause) {\n toast(errorMessage(cause), \"warning\");\n }\n }\n async function applySessionScope(run) {\n try {\n const result = await run();\n toast(`logging: ${scopeLabel(result.sessionScope, result.settings.enabled, props.sessionID)}`, \"success\");\n await refreshStatus();\n } catch (cause) {\n toast(errorMessage(cause), \"warning\");\n }\n }\n async function toggleSessionScope() {\n const sessionID = props.sessionID;\n if (sessionID === undefined) {\n toast(\"open a session to log only that session\", \"info\");\n return;\n }\n await applySessionScope(() => toggleSessionArmed(api(), sessionID));\n }\n async function settingsDialog() {\n const current = status();\n if (current === undefined) {\n toast(\"the prompt logger status is not available yet\", \"warning\");\n return;\n }\n const settings = current.settings;\n const choice = await props.ctx.ui.dialog.select({\n title: \"Prompt logger settings\",\n options: [{\n title: `Logging: ${settings.enabled ? \"on\" : \"off\"}`,\n description: \"Record one assembled request per model call: system prompt, messages, agent, model and tools. Off writes nothing and keeps the viewer available.\",\n value: \"enabled\"\n }, {\n title: props.sessionID === undefined ? `Session scope: ${scopeLabel(current.sessionScope, settings.enabled)}` : `Log only this session: ${isSelected(current.sessionScope, props.sessionID) ? \"on\" : \"off\"}`,\n description: props.sessionID === undefined ? \"All sessions are recorded by default. Select a session from its prompt log panel to record only that session. Clearing the selection pauses logging instead of recording everything.\" : \"Record only this session from now on and pause the others. Turning it off pauses this session; it does not fall back to logging every session.\",\n value: \"sessionScope\"\n }, {\n title: `HTTP bodies: ${settings.http ? \"on\" : \"off\"}`,\n description: \"Capture the exact provider request body as bytes and link it to the assembled request. Gzip and binary bodies stay lossless. Usually the largest part of the store.\",\n value: \"http\"\n }, {\n title: `Disk budget: ${budgetLabel(settings.diskBudget)}`,\n description: `Total size of all sessions. Oldest sessions are deleted first. Also keeps sessions for at most ${settings.retention.maxAgeDays === 0 ? \"unlimited time\" : `${settings.retention.maxAgeDays} days`} and ${settings.retention.maxSessions === null ? \"unlimited sessions\" : `${settings.retention.maxSessions} sessions`}.`,\n value: \"budget\"\n }, {\n title: `Retention age: ${settings.retentionMaxAgeDays === 0 ? \"unlimited\" : `${settings.retentionMaxAgeDays} days`}`,\n description: \"Delete sessions whose last write is older than this when retention runs. Zero means unlimited.\",\n value: \"age\"\n }, {\n title: `Retention sessions: ${settings.retentionMaxSessions === 0 ? \"unlimited\" : `${settings.retentionMaxSessions} sessions`}`,\n description: \"Keep at most this many sessions after the age and byte limits are applied. Zero means unlimited.\",\n value: \"sessions\"\n }, {\n title: `Storage directory: ${settings.directory === \"\" ? \"default\" : settings.directory}`,\n description: \"Where the per-session store lives. The value is saved now and applies on the next server start; the current store keeps being used until then.\",\n value: \"directory\"\n }, {\n title: `Delete actions: ${settings.maintenance ? \"allowed\" : \"read-only\"}`,\n description: \"Allow destructive actions from the viewer. This is a UI guardrail, not a security boundary.\",\n value: \"maintenance\"\n }, {\n title: \"Reset to defaults\",\n description: \"Restore logging, HTTP capture, the disk budget, retention, the storage directory and delete actions to their built-in defaults. Does not delete data.\",\n value: \"reset\"\n }]\n });\n if (choice === undefined) return;\n if (choice === \"enabled\") {\n await applySettings({\n ...settings,\n enabled: !settings.enabled\n });\n return;\n }\n if (choice === \"sessionScope\") {\n if (props.sessionID !== undefined) {\n await toggleSessionScope();\n return;\n }\n const next = await props.ctx.ui.dialog.select({\n title: \"Session scope\",\n current: current.sessionScope?.mode,\n options: [{\n title: \"Log all sessions\",\n description: \"Record every session again, subject to the master switch. The selected list is cleared; use a session panel to select one again.\",\n value: \"all\"\n }, {\n title: \"Clear selected sessions (pause)\",\n description: \"Keep the scope limited but select nothing: no session is recorded until one is selected again. It does not delete data.\",\n value: \"clear\"\n }]\n });\n if (next === \"all\") await applySessionScope(() => api().updateSessionScope({\n mode: \"all\"\n }));\n if (next === \"clear\") await applySessionScope(() => api().updateSessionScope({\n action: \"clear\"\n }));\n return;\n }\n if (choice === \"http\") {\n await applySettings({\n ...settings,\n http: !settings.http\n });\n return;\n }\n if (choice === \"maintenance\") {\n await applySettings({\n ...settings,\n maintenance: !settings.maintenance\n });\n return;\n }\n if (choice === \"reset\") {\n try {\n await api().resetSettings();\n toast(\"settings reset to defaults\", \"success\");\n await refreshStatus();\n } catch (cause) {\n toast(errorMessage(cause), \"warning\");\n }\n return;\n }\n if (choice === \"directory\") {\n const value = await props.ctx.ui.dialog.prompt({\n title: \"Storage directory\",\n description: \"Absolute path, ~ path, or a path relative to the project. Leave empty for the platform default. Applies on the next server start.\",\n value: settings.directory\n });\n if (value !== undefined) {\n await applySettings({\n ...settings,\n directory: value.trim()\n });\n toast(\"storage directory saved; restart the server to apply\", \"info\");\n }\n return;\n }\n if (choice === \"age\") {\n const value = await props.ctx.ui.dialog.select({\n title: \"Retention age\",\n current: settings.retentionMaxAgeDays,\n options: [{\n title: \"Unlimited\",\n description: \"Never delete a session by age.\",\n value: 0\n }, {\n title: \"7 days\",\n description: \"Remove sessions inactive for more than a week.\",\n value: 7\n }, {\n title: \"30 days\",\n description: \"Default; remove sessions inactive for more than a month.\",\n value: 30\n }, {\n title: \"90 days\",\n description: \"Keep a quarter of history.\",\n value: 90\n }, {\n title: \"1 year\",\n description: \"Keep a year of history.\",\n value: 365\n }]\n });\n if (value !== undefined) await applySettings({\n ...settings,\n retentionMaxAgeDays: value\n });\n return;\n }\n if (choice === \"sessions\") {\n const value = await props.ctx.ui.dialog.select({\n title: \"Retention session count\",\n current: settings.retentionMaxSessions,\n options: [{\n title: \"Unlimited\",\n description: \"Never delete by session count.\",\n value: 0\n }, {\n title: \"50 sessions\",\n description: \"Keep the 50 newest sessions.\",\n value: 50\n }, {\n title: \"200 sessions\",\n description: \"Default; keep the 200 newest sessions.\",\n value: 200\n }, {\n title: \"500 sessions\",\n description: \"Keep the 500 newest sessions.\",\n value: 500\n }, {\n title: \"1000 sessions\",\n description: \"Keep the 1000 newest sessions.\",\n value: 1000\n }]\n });\n if (value !== undefined) await applySettings({\n ...settings,\n retentionMaxSessions: value\n });\n return;\n }\n const value = await props.ctx.ui.dialog.select({\n title: \"Retention disk budget\",\n current: settings.diskBudget === 0 ? false : settings.diskBudget,\n options: BUDGET_PRESETS.map(preset => ({\n title: preset.value === false ? \"No budget\" : preset.title,\n description: preset.value === false ? \"No total byte budget. The age and session limits still apply.\" : `${preset.title} total budget across all sessions; the oldest sessions are removed first.`,\n value: preset.value\n }))\n });\n if (value !== undefined) await applySettings({\n ...settings,\n diskBudget: value === false ? 0 : value\n });\n }\n async function filterDialog() {\n const value = await props.ctx.ui.dialog.prompt({\n title: \"Search entries\",\n description: \"Searches the system prompt, messages, HTTP bodies and metadata. Leave empty to clear the search.\",\n placeholder: \"AGENTS.md, tool output, a model name…\",\n value: filter()\n });\n if (value !== undefined) setFilter(value.trim());\n }\n function toggleLive() {\n const next = !live();\n setLive(next);\n if (next) schedulePoll(0);\n }\n function toggleScope() {\n if (props.sessionID === undefined) {\n toast(\"No session is routed; the viewer shows all sessions\", \"info\");\n return;\n }\n setScope(scope() === \"session\" ? \"all\" : \"session\");\n }\n function cycleType() {\n setType(type() === \"all\" ? \"assembled\" : type() === \"assembled\" ? \"http\" : \"all\");\n }\n function refreshAll() {\n void refreshStatus();\n void refreshList(\"reset\");\n }\n const headerLines = createMemo(() => {\n const current = status();\n const path = current === undefined ? \"…\" : props.ctx.ui.format.path(current.store.path);\n const settings = current?.settings;\n const lines = [`Prompt log${props.sessionID === undefined ? \" · all sessions\" : \"\"} · ${path}`, current === undefined ? \"waiting for the prompt logger rpc…\" : `size ${formatBytes(current.store.bytes)} · ${current.cache.requests} requests`, settings === undefined ? `show ${scope()} · type ${type()} · live ${live() ? \"on\" : \"off\"}` : `show ${scope()} · type ${type()} · live ${live() ? \"on\" : \"off\"}${filter() === \"\" ? \"\" : ` · search “${filter()}”`} · logging ${scopeLabel(current?.sessionScope, settings.enabled, props.sessionID)} · http ${settings.http ? \"on\" : \"off\"} · budget ${budgetLabel(settings.diskBudget)}`];\n return lines.map(line => displayText(line, 800));\n });\n const warningLines = createMemo(() => {\n const current = status();\n if (current === undefined) return [];\n const warnings = [];\n if (current.version !== CONTRACT_VERSION) {\n warnings.push(`the server plugin speaks contract ${current.version}; this viewer expects ${CONTRACT_VERSION}`);\n }\n for (const warning of current.store.warnings) warnings.push(warningLabel(warning));\n if (current.store.exists === false) warnings.push(\"the store does not exist yet\");\n if (current.cache.error !== null) warnings.push(`cache: ${current.cache.error}`);\n if (current.settings.maintenance === false) warnings.push(\"delete actions are disabled in the settings\");\n if (current.lastWriteError !== null) {\n warnings.push(`last write failed at ${current.lastWriteError.at}: ${current.lastWriteError.message}`);\n }\n return [...new Set(warnings)].map(warning => displayText(warning, 800));\n });\n const emptyLines = createMemo(() => {\n const current = status();\n if (current?.settings.enabled === false) {\n return \"logging is off; enable it from the settings (c)\";\n }\n const sessionScope = current?.sessionScope;\n if (sessionScope?.mode === \"only\" && sessionScope.sessions.length === 0) {\n return \"logging is paused; press c to log all sessions again\";\n }\n if (sessionScope?.mode === \"only\") {\n if (props.sessionID !== undefined && !isSelected(sessionScope, props.sessionID)) {\n return `logging is limited to ${sessionScope.sessions.length} selected session${sessionScope.sessions.length === 1 ? \"\" : \"s\"}; press shift+l to record this session`;\n }\n if (props.sessionID === undefined) {\n return `logging is limited to ${sessionScope.sessions.length} selected session${sessionScope.sessions.length === 1 ? \"\" : \"s\"}`;\n }\n }\n return \"no entries yet; the store fills as requests are logged\";\n });\n const listFooter = createMemo(() => {\n if (!help()) return \"j/k move · enter open · n more · ? help · esc close\";\n return \"j/k move · g/G first/last · enter open · n more · a show · t type · f search · l live · shift+l only this session · x delete session · R refresh · c settings · esc close\";\n });\n const helpLines = createMemo(() => [\"j/k or arrows move the cursor; g/G jump to the ends.\", \"Enter opens the assembled prompt, the messages and the raw HTTP body.\", \"n loads older entries; the viewer keeps at most 200 in memory.\", \"a changes what the viewer shows: this session or all sessions; t cycles the request type.\", \"shift+l records only this session and pauses the others. Turning it off pauses this session instead of logging every session.\", \"f searches prompt content: system prompt, messages, HTTP bodies and metadata.\", \"In a request, e expands or collapses the truncated sections and j/k scrolls.\", \"shift+e loads the complete request when the preview read budget was hit.\", \"x deletes this session's log, shift+x deletes every session log, and c opens settings. Retention prunes the store instead of rotating a file.\", \"The log contains unredacted prompts. Treat a screenshot or a copy as sensitive data.\"]);\n props.ctx.keymap.layer(() => {\n const command = (id, title, bind, run) => ({\n id,\n title,\n bind,\n run\n });\n if (detail() !== undefined) {\n return {\n commands: [command(\"prompt-logger.detail.up\", \"Scroll up\", \"up\", () => scrollDetail(-1)), command(\"prompt-logger.detail.up.k\", \"Scroll up\", \"k\", () => scrollDetail(-1)), command(\"prompt-logger.detail.down\", \"Scroll down\", \"down\", () => scrollDetail(1)), command(\"prompt-logger.detail.down.j\", \"Scroll down\", \"j\", () => scrollDetail(1)), command(\"prompt-logger.detail.page.up\", \"Page up\", \"pageup\", () => scrollDetail(-DETAIL_PAGE)), command(\"prompt-logger.detail.page.down\", \"Page down\", \"pagedown\", () => scrollDetail(DETAIL_PAGE)), command(\"prompt-logger.detail.home\", \"First line\", \"home\", () => {\n setDetailOffset(0);\n }), command(\"prompt-logger.detail.end\", \"Last line\", \"end\", () => {\n setDetailOffset(Math.max(0, detailLines().length - DETAIL_PAGE));\n }), command(\"prompt-logger.detail.expand\", \"Expand or collapse sections\", \"e\", toggleExpand), command(\"prompt-logger.detail.full\", \"Load the complete request\", \"shift+e\", () => void loadFullDetail()), command(\"prompt-logger.detail.back\", \"Back to the list\", \"escape\", closeDetail), command(\"prompt-logger.detail.backspace\", \"Back to the list\", \"backspace\", closeDetail), command(\"prompt-logger.detail.close\", \"Close the viewer\", \"q\", () => props.close())]\n };\n }\n return {\n commands: [command(\"prompt-logger.up\", \"Move up\", \"up\", () => move(-1)), command(\"prompt-logger.up.k\", \"Move up\", \"k\", () => move(-1)), command(\"prompt-logger.down\", \"Move down\", \"down\", () => move(1)), command(\"prompt-logger.down.j\", \"Move down\", \"j\", () => move(1)), command(\"prompt-logger.page.up\", \"Page up\", \"pageup\", () => move(-10)), command(\"prompt-logger.page.down\", \"Page down\", \"pagedown\", () => move(10)), command(\"prompt-logger.first\", \"First entry\", \"g\", () => moveEdge(false)), command(\"prompt-logger.last\", \"Last entry\", \"shift+g\", () => moveEdge(true)), command(\"prompt-logger.open\", \"Open the record\", \"return\", () => void openDetail()), command(\"prompt-logger.more\", \"Load older entries\", \"n\", () => void loadMore()), command(\"prompt-logger.scope\", \"Toggle session/all sessions\", \"a\", toggleScope), command(\"prompt-logger.type\", \"Cycle record type\", \"t\", cycleType), command(\"prompt-logger.filter\", \"Filter entries\", \"f\", () => void filterDialog()), command(\"prompt-logger.live\", \"Toggle live updates\", \"l\", toggleLive), command(\"prompt-logger.only\", \"Log only this session\", \"shift+l\", () => void toggleSessionScope()), command(\"prompt-logger.refresh\", \"Refresh\", \"shift+r\", refreshAll), command(\"prompt-logger.truncate\", \"Delete this session's log\", \"x\", () => void truncate(\"current\")), command(\"prompt-logger.truncate.all\", \"Delete every session log\", \"shift+x\", () => void truncate(\"all\")), command(\"prompt-logger.settings\", \"Settings\", \"c\", () => void settingsDialog()), command(\"prompt-logger.help\", \"Help\", \"?\", () => {\n setHelp(value => !value);\n }), command(\"prompt-logger.close\", \"Close the viewer\", \"escape\", () => props.close()), command(\"prompt-logger.close.q\", \"Close the viewer\", \"q\", () => props.close())]\n };\n });\n createEffect(on([scope, type, filter], () => {\n setCursor(0);\n setDetailData(undefined);\n setDetailOffset(0);\n void refreshList(\"reset\");\n }, {\n defer: true\n }));\n let settingsOpened = false;\n createEffect(() => {\n if (props.openSettings !== true || settingsOpened || status() === undefined) return;\n settingsOpened = true;\n void settingsDialog();\n });\n void refreshStatus();\n void refreshList(\"reset\");\n subscribe();\n schedulePoll(2000);\n onCleanup(() => {\n disposed = true;\n listAbort?.abort();\n detailAbort?.abort();\n if (pollTimer !== undefined) clearTimeout(pollTimer);\n if (debounceTimer !== undefined) clearTimeout(debounceTimer);\n unsubscribe?.();\n unsubscribeSettings?.();\n });\n const color = tone => {\n switch (tone) {\n case \"muted\":\n return props.ctx.theme.text.muted;\n case \"warning\":\n return props.ctx.theme.text.feedback.warning.base;\n case \"accent\":\n return props.ctx.theme.text.feedback.info.base;\n default:\n return props.ctx.theme.text.base;\n }\n };\n return (() => {\n var _el$ = _$createElement(\"box\");\n _$setProp(_el$, \"flexDirection\", \"column\");\n _$setProp(_el$, \"paddingLeft\", 1);\n _$setProp(_el$, \"paddingRight\", 1);\n _$insert(_el$, _$createComponent(Show, {\n get when() {\n return detail() !== undefined;\n },\n get fallback() {\n return (() => {\n var _el$2 = _$createElement(\"scrollbox\"),\n _el$3 = _$createElement(\"text\"),\n _el$0 = _$createElement(\"text\"),\n _el$1 = _$createElement(\"text\");\n _$insertNode(_el$2, _el$3);\n _$insertNode(_el$2, _el$0);\n _$insertNode(_el$2, _el$1);\n _$use(target => {\n scroller = target;\n const focusable = target;\n if (focusable !== null && typeof focusable === \"object\") focusable.focusable = false;\n }, _el$2);\n _$setProp(_el$2, \"flexGrow\", 1);\n _$setProp(_el$2, \"scrollY\", true);\n _$setProp(_el$2, \"verticalScrollbarOptions\", {\n visible: true\n });\n _$insert(_el$2, _$createComponent(For, {\n get each() {\n return headerLines();\n },\n children: line => (() => {\n var _el$10 = _$createElement(\"text\");\n _$insert(_el$10, line);\n _$effect(_$p => _$setProp(_el$10, \"fg\", color(\"base\"), _$p));\n return _el$10;\n })()\n }), _el$3);\n _$insert(_el$2, _$createComponent(For, {\n get each() {\n return warningLines();\n },\n children: line => (() => {\n var _el$11 = _$createElement(\"text\"),\n _el$12 = _$createTextNode(`warning: `);\n _$insertNode(_el$11, _el$12);\n _$insert(_el$11, line, null);\n _$effect(_$p => _$setProp(_el$11, \"fg\", color(\"warning\"), _$p));\n return _el$11;\n })()\n }), _el$3);\n _$insert(_el$2, _$createComponent(Show, {\n get when() {\n return help();\n },\n get children() {\n return [_$createComponent(For, {\n get each() {\n return helpLines();\n },\n children: line => (() => {\n var _el$13 = _$createElement(\"text\");\n _$insert(_el$13, line);\n _$effect(_$p => _$setProp(_el$13, \"fg\", color(\"muted\"), _$p));\n return _el$13;\n })()\n }), (() => {\n var _el$4 = _$createElement(\"text\");\n _$effect(_$p => _$setProp(_el$4, \"fg\", color(\"muted\"), _$p));\n return _el$4;\n })()];\n }\n }), _el$0);\n _$insert(_el$2, _$createComponent(For, {\n get each() {\n return entries();\n },\n children: (entry, index) => {\n const selected = () => index() === cursor();\n return (() => {\n var _el$14 = _$createElement(\"text\");\n _$insert(_el$14, () => fitText(entryLine(entry), rowWidth()));\n _$effect(_p$ => {\n var _v$4 = `row-${index()}`,\n _v$5 = entry.type === \"http\" ? color(\"accent\") : color(\"base\"),\n _v$6 = selected() ? props.ctx.theme.background.raised.high : undefined,\n _v$7 = selected() ? TextAttributes.BOLD : undefined;\n _v$4 !== _p$.e && (_p$.e = _$setProp(_el$14, \"id\", _v$4, _p$.e));\n _v$5 !== _p$.t && (_p$.t = _$setProp(_el$14, \"fg\", _v$5, _p$.t));\n _v$6 !== _p$.a && (_p$.a = _$setProp(_el$14, \"bg\", _v$6, _p$.a));\n _v$7 !== _p$.o && (_p$.o = _$setProp(_el$14, \"attributes\", _v$7, _p$.o));\n return _p$;\n }, {\n e: undefined,\n t: undefined,\n a: undefined,\n o: undefined\n });\n return _el$14;\n })();\n }\n }), _el$0);\n _$insert(_el$2, _$createComponent(Show, {\n get when() {\n return entries().length === 0;\n },\n get children() {\n var _el$5 = _$createElement(\"text\");\n _$insert(_el$5, emptyLines);\n _$effect(_$p => _$setProp(_el$5, \"fg\", color(\"muted\"), _$p));\n return _el$5;\n }\n }), _el$0);\n _$insert(_el$2, _$createComponent(Show, {\n get when() {\n return loading();\n },\n get children() {\n var _el$6 = _$createElement(\"text\");\n _$insertNode(_el$6, _$createTextNode(`loading…`));\n _$effect(_$p => _$setProp(_el$6, \"fg\", color(\"muted\"), _$p));\n return _el$6;\n }\n }), _el$0);\n _$insert(_el$2, _$createComponent(Show, {\n get when() {\n return error() !== undefined;\n },\n get children() {\n var _el$8 = _$createElement(\"text\"),\n _el$9 = _$createTextNode(`error: `);\n _$insertNode(_el$8, _el$9);\n _$insert(_el$8, () => displayText(error(), 800), null);\n _$effect(_$p => _$setProp(_el$8, \"fg\", color(\"warning\"), _$p));\n return _el$8;\n }\n }), _el$0);\n _$insert(_el$1, listFooter);\n _$effect(_p$ => {\n var _v$ = color(\"muted\"),\n _v$2 = color(\"muted\"),\n _v$3 = color(\"muted\");\n _v$ !== _p$.e && (_p$.e = _$setProp(_el$3, \"fg\", _v$, _p$.e));\n _v$2 !== _p$.t && (_p$.t = _$setProp(_el$0, \"fg\", _v$2, _p$.t));\n _v$3 !== _p$.a && (_p$.a = _$setProp(_el$1, \"fg\", _v$3, _p$.a));\n return _p$;\n }, {\n e: undefined,\n t: undefined,\n a: undefined\n });\n return _el$2;\n })();\n },\n get children() {\n return _$createComponent(Show, {\n get when() {\n return detail();\n },\n children: current => _$createComponent(DetailPane, {\n get ctx() {\n return props.ctx;\n },\n get detail() {\n return current();\n },\n get lines() {\n return detailLines();\n },\n get page() {\n return detailPage();\n },\n get offset() {\n return detailOffset();\n },\n get data() {\n return detailData();\n },\n get loading() {\n return detailLoading();\n },\n get expanded() {\n return expanded();\n },\n get hasTruncated() {\n return hasTruncated();\n }\n })\n });\n }\n }));\n return _el$;\n })();\n}",
7
+ "/** Entries returned by one `list` call. */\nexport const DEFAULT_PAGE = 50\nexport const MAX_PAGE = 200\n\n/** One request returned by `read`, before the viewer asks for more. */\nexport const MAX_RECORD_BYTES = 2 * 1024 * 1024\n\n/** Hard ceiling for an explicit \"load complete entry\" read. */\nexport const MAX_FULL_RECORD_BYTES = 16 * 1024 * 1024\n\n/** A full-text search stops at whichever budget expires first. */\nexport const MAX_SEARCH_BYTES = 128 * 1024 * 1024\nexport const MAX_SEARCH_MS = 2_000\nexport const MAX_SEARCH_QUERY = 500\nexport const MAX_SEARCH_RESULTS = 100\n\n/** One `changed` event per second at most, however busy the store is. */\nexport const EVENT_COALESCE_MS = 1_000\n\n/**\n * Bench ceilings. They are intentionally loose: a regression that parses a\n * whole request or rescans a session file is orders of magnitude slower.\n */\nexport const BENCH_BUDGETS = {\n listMs: 20,\n readMs: 100,\n searchMs: 2_000,\n heapMb: 256,\n} as const\n\nexport function clampInteger(value: unknown, min: number, max: number, fallback: number): number {\n if (typeof value !== \"number\" || !Number.isFinite(value)) return fallback\n return Math.min(max, Math.max(min, Math.round(value)))\n}\n\nexport function clampPage(value: unknown): number {\n return clampInteger(value, 1, MAX_PAGE, DEFAULT_PAGE)\n}\n\nexport function clampReadBytes(value: unknown): number {\n return clampInteger(value, 1024, MAX_FULL_RECORD_BYTES, MAX_RECORD_BYTES)\n}\n\nexport function clampSearchBytes(value: unknown): number {\n return clampInteger(value, 1024 * 1024, MAX_SEARCH_BYTES, MAX_SEARCH_BYTES)\n}\n\nexport function clampSearchMs(value: unknown): number {\n return clampInteger(value, 100, MAX_SEARCH_MS, MAX_SEARCH_MS)\n}\n\nexport function boundedString(value: unknown, maxLength: number): string | undefined {\n if (typeof value !== \"string\") return undefined\n const trimmed = value.trim()\n if (trimmed === \"\") return undefined\n return trimmed.length > maxLength ? trimmed.slice(0, maxLength) : trimmed\n}\n",
8
+ "import { Rpc } from \"@opencode/plugin/rpc\"\nimport type { SessionScope, SessionScopeChange } from \"./session-scope\"\nimport {\n MAX_SETTINGS_DIRECTORY,\n MAX_SETTINGS_DISK_BUDGET,\n MAX_SETTINGS_RETENTION_DAYS,\n MAX_SETTINGS_RETENTION_SESSIONS,\n type Settings,\n} from \"./settings\"\nimport type { LogSummary, SearchMatch } from \"./log/types\"\n\nexport const CONTRACT_VERSION = 6\n\nexport type StoreStatusView = {\n readonly path: string\n readonly exists: boolean\n readonly bytes: number\n readonly mtimeMs: number | null\n /** True when the store root is a directory. */\n readonly directory: boolean\n readonly symlink: boolean\n readonly mode: number | null\n readonly directoryMode: number | null\n readonly warnings: readonly string[]\n}\n\nexport type CacheView = {\n readonly requests: number\n readonly requestBytes: number\n readonly lastScanMs: number\n readonly error: string | null\n}\n\n/** Settings plus the computed retention policy. */\nexport type StatusSettings = Settings & {\n /** Effective retention policy. `null` means unlimited. */\n readonly retention: {\n readonly maxTotalBytes: number | null\n readonly maxAgeDays: number\n readonly maxSessions: number | null\n }\n}\n\nexport type StatusResponse = {\n readonly version: number\n readonly store: StoreStatusView\n readonly settings: StatusSettings\n /** Which sessions are written while logging is enabled. */\n readonly sessionScope: SessionScope\n readonly cache: CacheView\n readonly lastWriteAt: string | null\n readonly lastWriteError: { readonly at: string; readonly code?: string; readonly message: string } | null\n}\n\nexport type ListRequest = {\n readonly sessionID?: string\n readonly type?: string\n readonly kind?: string\n readonly agent?: string\n readonly model?: string\n readonly query?: string\n readonly limit?: number\n readonly cursor?: string\n}\n\nexport type ListResponse = {\n readonly entries: readonly LogSummary[]\n readonly hasMore: boolean\n readonly records: number\n readonly error: string | null\n}\n\nexport type ReadRequest = {\n /** Opaque v2 request key from the list. */\n readonly key: string\n /**\n * Read budget in bytes. Omit for the preview budget; an explicit\n * \"load complete entry\" may ask for up to `MAX_FULL_RECORD_BYTES`.\n */\n readonly maxBytes?: number\n}\n\nexport type ReadResponse = {\n readonly record: unknown\n readonly bytes: number\n readonly truncated: boolean\n /** A larger `maxBytes` could return more of the same request. */\n readonly moreAvailable?: boolean\n /** Logical size of the complete request, including the decoded body. */\n readonly fullBytes?: number\n /** Concrete files backing this record, for \"Reveal\" actions. */\n readonly paths?: {\n readonly session?: string\n readonly requests?: string\n readonly body?: string\n }\n}\n\nexport type SearchRequest = {\n readonly sessionID?: string\n readonly type?: string\n readonly kind?: string\n readonly agent?: string\n readonly model?: string\n readonly query: string\n readonly limit?: number\n readonly ignoreCase?: boolean\n readonly budgetBytes?: number\n readonly budgetMs?: number\n}\n\nexport type SearchResponse = {\n readonly matches: readonly SearchMatch[]\n readonly partial: boolean\n readonly scannedBytes: number\n readonly skipped: number\n readonly error: string | null\n}\n\nexport type TruncateTarget = \"current\" | \"all\"\n\nexport type TruncateRequest = {\n readonly target: TruncateTarget\n /** The session whose directory is deleted by `current`. */\n readonly sessionID?: string\n readonly confirm: true\n}\n\nexport type TruncateResponse = {\n readonly target: TruncateTarget\n readonly bytesFreed: number\n}\n\nexport type SettingsResponse = {\n readonly settings: Settings\n readonly sessionScope: SessionScope\n}\n\nexport type SetSettingsRequest = {\n readonly settings: Settings\n}\n\n/** The scope transition accepted by `updateSessionScope`. */\nexport type UpdateSessionScopeRequest = SessionScopeChange\n\nexport type UpdateSessionScopeResponse = {\n readonly sessionScope: SessionScope\n /** Selecting a session while logging is off turns the master switch on. */\n readonly settings: Settings\n}\n\nexport type SettingsChangedEvent = SettingsResponse\n\nexport type ChangedReason = \"append\" | \"truncate\" | \"error\"\n\nexport type ChangedEvent = {\n /** The store root, not a single file. */\n readonly store: string\n readonly reason: ChangedReason\n readonly at: string\n}\n\nconst nullableString = { type: [\"string\", \"null\"] } as const\nconst modelSchema = {\n anyOf: [\n { type: \"null\" },\n {\n type: \"object\",\n properties: {\n providerID: { type: \"string\" },\n id: { type: \"string\" },\n variant: { type: \"string\" },\n },\n additionalProperties: false,\n },\n ],\n} as const\n\nconst summarySchema = {\n type: \"object\",\n properties: {\n key: { type: \"string\" },\n cursor: { type: \"string\" },\n bytes: { type: \"number\" },\n at: nullableString,\n type: nullableString,\n kind: nullableString,\n sessionID: nullableString,\n agent: nullableString,\n model: modelSchema,\n url: nullableString,\n messages: { type: \"number\" },\n bodyBytes: { type: \"number\" },\n hasBody: { type: \"boolean\" },\n },\n required: [\"key\", \"cursor\", \"bytes\", \"at\", \"type\", \"kind\", \"sessionID\", \"agent\", \"model\", \"url\"],\n additionalProperties: false,\n} as const\n\nconst storeStatusSchema = {\n type: \"object\",\n properties: {\n path: { type: \"string\" },\n exists: { type: \"boolean\" },\n bytes: { type: \"number\" },\n mtimeMs: { anyOf: [{ type: \"number\" }, { type: \"null\" }] },\n directory: { type: \"boolean\" },\n symlink: { type: \"boolean\" },\n mode: { anyOf: [{ type: \"number\" }, { type: \"null\" }] },\n directoryMode: { anyOf: [{ type: \"number\" }, { type: \"null\" }] },\n warnings: { type: \"array\", items: { type: \"string\" } },\n },\n required: [\"path\", \"exists\", \"bytes\", \"mtimeMs\", \"directory\", \"symlink\", \"mode\", \"directoryMode\", \"warnings\"],\n additionalProperties: false,\n} as const\n\nconst cacheSchema = {\n type: \"object\",\n properties: {\n requests: { type: \"number\" },\n requestBytes: { type: \"number\" },\n lastScanMs: { type: \"number\" },\n error: nullableString,\n },\n required: [\"requests\", \"requestBytes\", \"lastScanMs\", \"error\"],\n additionalProperties: false,\n} as const\n\nconst settingsSchema = {\n type: \"object\",\n properties: {\n enabled: { type: \"boolean\" },\n http: { type: \"boolean\" },\n diskBudget: { type: \"number\", minimum: 0, maximum: MAX_SETTINGS_DISK_BUDGET },\n retentionMaxAgeDays: { type: \"number\", minimum: 0, maximum: MAX_SETTINGS_RETENTION_DAYS },\n retentionMaxSessions: { type: \"number\", minimum: 0, maximum: MAX_SETTINGS_RETENTION_SESSIONS },\n directory: { type: \"string\", maxLength: MAX_SETTINGS_DIRECTORY },\n maintenance: { type: \"boolean\" },\n },\n required: [\n \"enabled\",\n \"http\",\n \"diskBudget\",\n \"retentionMaxAgeDays\",\n \"retentionMaxSessions\",\n \"directory\",\n \"maintenance\",\n ],\n additionalProperties: false,\n} as const\n\nconst statusSettingsSchema = {\n type: \"object\",\n properties: {\n ...settingsSchema.properties,\n retention: {\n type: \"object\",\n properties: {\n maxTotalBytes: { anyOf: [{ type: \"number\" }, { type: \"null\" }] },\n maxAgeDays: { type: \"number\" },\n maxSessions: { anyOf: [{ type: \"number\" }, { type: \"null\" }] },\n },\n required: [\"maxTotalBytes\", \"maxAgeDays\", \"maxSessions\"],\n additionalProperties: false,\n },\n },\n required: [...settingsSchema.required, \"retention\"],\n additionalProperties: false,\n} as const\n\nconst sessionScopeSchema = {\n type: \"object\",\n properties: {\n mode: { type: \"string\", enum: [\"all\", \"only\"] },\n sessions: { type: \"array\", items: { type: \"string\", maxLength: 200 } },\n max: { type: \"number\" },\n },\n required: [\"mode\", \"sessions\", \"max\"],\n additionalProperties: false,\n} as const\n\nconst settingsResponseSchema = {\n type: \"object\",\n properties: {\n settings: settingsSchema,\n sessionScope: sessionScopeSchema,\n },\n required: [\"settings\", \"sessionScope\"],\n additionalProperties: false,\n} as const\n\nconst errorSchema = {\n type: \"object\",\n properties: { message: { type: \"string\" } },\n additionalProperties: false,\n} as const\n\nconst errors = {\n io: errorSchema,\n not_found: errorSchema,\n bad_request: errorSchema,\n forbidden: errorSchema,\n} as const\n\nconst filtersSchema = {\n sessionID: { type: \"string\", maxLength: 200 },\n type: { type: \"string\", maxLength: 80 },\n kind: { type: \"string\", maxLength: 80 },\n agent: { type: \"string\", maxLength: 200 },\n model: { type: \"string\", maxLength: 200 },\n query: { type: \"string\", maxLength: 200 },\n} as const\n\nexport const PromptLogger = Rpc.define({\n id: \"prompt-logger\",\n methods: {\n status: {\n input: { type: \"object\", properties: {}, additionalProperties: false },\n output: {\n type: \"object\",\n properties: {\n version: { type: \"number\" },\n store: storeStatusSchema,\n settings: statusSettingsSchema,\n sessionScope: sessionScopeSchema,\n cache: cacheSchema,\n lastWriteAt: { anyOf: [{ type: \"string\" }, { type: \"null\" }] },\n lastWriteError: {\n anyOf: [\n { type: \"null\" },\n {\n type: \"object\",\n properties: {\n at: { type: \"string\" },\n code: { type: \"string\" },\n message: { type: \"string\" },\n },\n required: [\"at\", \"message\"],\n additionalProperties: false,\n },\n ],\n },\n },\n required: [\"version\", \"store\", \"settings\", \"sessionScope\", \"cache\", \"lastWriteAt\", \"lastWriteError\"],\n additionalProperties: false,\n },\n errors,\n },\n list: {\n input: {\n type: \"object\",\n properties: {\n ...filtersSchema,\n limit: { type: \"number\" },\n cursor: { type: \"string\" },\n },\n additionalProperties: false,\n },\n output: {\n type: \"object\",\n properties: {\n entries: { type: \"array\", items: summarySchema },\n hasMore: { type: \"boolean\" },\n records: { type: \"number\" },\n error: nullableString,\n },\n required: [\"entries\", \"hasMore\", \"records\", \"error\"],\n additionalProperties: false,\n },\n errors,\n },\n read: {\n input: {\n type: \"object\",\n properties: {\n key: { type: \"string\", maxLength: 300 },\n maxBytes: { type: \"number\" },\n },\n required: [\"key\"],\n additionalProperties: false,\n },\n output: {\n type: \"object\",\n properties: {\n record: {},\n bytes: { type: \"number\" },\n truncated: { type: \"boolean\" },\n moreAvailable: { type: \"boolean\" },\n fullBytes: { type: \"number\" },\n paths: {\n type: \"object\",\n properties: {\n session: { type: \"string\" },\n requests: { type: \"string\" },\n body: { type: \"string\" },\n },\n additionalProperties: false,\n },\n },\n required: [\"record\", \"bytes\", \"truncated\"],\n additionalProperties: false,\n },\n errors,\n },\n search: {\n input: {\n type: \"object\",\n properties: {\n ...filtersSchema,\n query: { type: \"string\", minLength: 1, maxLength: 500 },\n limit: { type: \"number\" },\n ignoreCase: { type: \"boolean\" },\n budgetBytes: { type: \"number\" },\n budgetMs: { type: \"number\" },\n },\n required: [\"query\"],\n additionalProperties: false,\n },\n output: {\n type: \"object\",\n properties: {\n matches: {\n type: \"array\",\n items: {\n type: \"object\",\n properties: { entry: summarySchema, snippet: { type: \"string\" } },\n required: [\"entry\", \"snippet\"],\n additionalProperties: false,\n },\n },\n partial: { type: \"boolean\" },\n scannedBytes: { type: \"number\" },\n skipped: { type: \"number\" },\n error: nullableString,\n },\n required: [\"matches\", \"partial\", \"scannedBytes\", \"skipped\", \"error\"],\n additionalProperties: false,\n },\n errors,\n },\n truncate: {\n input: {\n type: \"object\",\n properties: {\n target: { type: \"string\", enum: [\"current\", \"all\"] },\n sessionID: { type: \"string\", maxLength: 200 },\n confirm: { type: \"boolean\", enum: [true] },\n },\n required: [\"target\", \"confirm\"],\n additionalProperties: false,\n },\n output: {\n type: \"object\",\n properties: {\n target: { type: \"string\", enum: [\"current\", \"all\"] },\n bytesFreed: { type: \"number\" },\n },\n required: [\"target\", \"bytesFreed\"],\n additionalProperties: false,\n },\n errors,\n },\n getSettings: {\n input: { type: \"object\", properties: {}, additionalProperties: false },\n output: settingsResponseSchema,\n errors,\n },\n setSettings: {\n input: {\n type: \"object\",\n properties: { settings: settingsSchema },\n required: [\"settings\"],\n additionalProperties: false,\n },\n output: settingsResponseSchema,\n errors,\n },\n resetSettings: {\n input: { type: \"object\", properties: {}, additionalProperties: false },\n output: settingsResponseSchema,\n errors,\n },\n updateSessionScope: {\n input: {\n type: \"object\",\n properties: {\n mode: { type: \"string\", enum: [\"all\", \"only\"] },\n action: { type: \"string\", enum: [\"only\", \"disarm\", \"clear\"] },\n sessionID: { type: \"string\", maxLength: 200 },\n },\n additionalProperties: false,\n },\n output: {\n type: \"object\",\n properties: {\n sessionScope: sessionScopeSchema,\n settings: settingsSchema,\n },\n required: [\"sessionScope\", \"settings\"],\n additionalProperties: false,\n },\n errors,\n },\n },\n events: {\n changed: {\n schema: {\n type: \"object\",\n properties: {\n store: { type: \"string\" },\n reason: { type: \"string\", enum: [\"append\", \"truncate\", \"error\"] },\n at: { type: \"string\" },\n },\n required: [\"store\", \"reason\", \"at\"],\n additionalProperties: false,\n },\n },\n settingsChanged: {\n schema: settingsResponseSchema,\n },\n },\n})\n",
9
+ "/** Default disk budget when no setting is configured: 256 MiB. */\nexport const DEFAULT_DISK_BUDGET = 256 * 1024 * 1024\n\n/** Model request kinds captured through one hook each. */\nexport const CONTEXT_KINDS = [\"context\", \"compaction\", \"generate\", \"title\"] as const\n\nexport type ContextKind = (typeof CONTEXT_KINDS)[number]\n\n/**\n * Structural view of the `context`, `compaction`, `generate` and `title` hook\n * events. `agent` and `tools` are only present on the kinds that carry them\n * (`title` has neither), so every field accepts the shape of the event it\n * actually receives.\n */\nexport type AssembledEvent = {\n readonly sessionID: string\n readonly model?: unknown\n readonly system?: unknown\n readonly messages?: unknown\n readonly agent?: unknown\n readonly tools?: Record<string, unknown>\n}\n\n/** Structural view of the `http.request` hook event. */\nexport type HttpEvent = {\n readonly sessionID: string\n readonly agent: unknown\n readonly model: unknown\n readonly kind: string\n readonly request: Request\n}\n\nexport type WriteError = {\n readonly at: string\n readonly code?: string\n readonly message: string\n}\n",
10
+ "import { DEFAULT_DISK_BUDGET } from \"./core\"\n\n/**\n * Every setting. The plugin's server storage is the only source of truth: the\n * configuration file registers the plugin, but it never carries settings.\n */\nexport type Settings = {\n readonly enabled: boolean\n readonly http: boolean\n /** Total store budget in bytes. Zero means no byte budget. */\n readonly diskBudget: number\n /** Remove sessions inactive for longer than this. Zero means unlimited. */\n readonly retentionMaxAgeDays: number\n /** Keep at most this many sessions. Zero means unlimited. */\n readonly retentionMaxSessions: number\n /** Store root. Empty means the platform default. */\n readonly directory: string\n /** Allow destructive actions from the viewer. */\n readonly maintenance: boolean\n}\n\n/** Settings live under this key. */\nexport const SETTINGS_KEY = \"settings\"\n\n/** A setting must stay sane; the UI offers presets well below these limits. */\nexport const MAX_SETTINGS_DISK_BUDGET = 8 * 1024 * 1024 * 1024\nexport const MAX_SETTINGS_RETENTION_DAYS = 3650\nexport const MAX_SETTINGS_RETENTION_SESSIONS = 10_000\nexport const MAX_SETTINGS_DIRECTORY = 4096\n\nexport const DEFAULT_SETTINGS: Settings = {\n enabled: true,\n http: false,\n diskBudget: DEFAULT_DISK_BUDGET,\n retentionMaxAgeDays: 30,\n retentionMaxSessions: 200,\n directory: \"\",\n maintenance: true,\n}\n\n/** A fresh copy of the built-in settings, safe for an editor to mutate. */\nexport function defaultSettings(): Settings {\n return { ...DEFAULT_SETTINGS }\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === \"object\" && !Array.isArray(value)\n}\n\nfunction isBoundedInteger(value: unknown, max: number): value is number {\n return (\n typeof value === \"number\" &&\n Number.isFinite(value) &&\n value >= 0 &&\n Math.floor(value) === value &&\n value <= max\n )\n}\n\nfunction boundedInteger(value: unknown, max: number, fallback: number): number {\n if (typeof value !== \"number\" || !Number.isFinite(value) || value < 0) return fallback\n return Math.min(max, Math.floor(value))\n}\n\nfunction directoryValue(value: unknown): string | undefined {\n if (typeof value !== \"string\") return undefined\n return value.trim().slice(0, MAX_SETTINGS_DIRECTORY)\n}\n\nfunction overlay(target: Settings, value: unknown): Settings {\n if (!isRecord(value)) return target\n const next: { -readonly [K in keyof Settings]: Settings[K] } = { ...target }\n if (typeof value.enabled === \"boolean\") next.enabled = value.enabled\n if (typeof value.http === \"boolean\") next.http = value.http\n next.diskBudget = boundedInteger(value.diskBudget, MAX_SETTINGS_DISK_BUDGET, next.diskBudget)\n next.retentionMaxAgeDays = boundedInteger(\n value.retentionMaxAgeDays,\n MAX_SETTINGS_RETENTION_DAYS,\n next.retentionMaxAgeDays,\n )\n next.retentionMaxSessions = boundedInteger(\n value.retentionMaxSessions,\n MAX_SETTINGS_RETENTION_SESSIONS,\n next.retentionMaxSessions,\n )\n const directory = directoryValue(value.directory)\n if (directory !== undefined) next.directory = directory\n if (typeof value.maintenance === \"boolean\") next.maintenance = value.maintenance\n return next\n}\n\n/**\n * Read a stored value defensively. A value written by a newer version, a\n * manual edit or a corrupted store is replaced field by field with a default\n * instead of breaking logging.\n */\nexport function sanitizeSettings(value: unknown): Settings {\n return overlay(defaultSettings(), value)\n}\n\n/**\n * Strict validation for a user action. Unlike `sanitizeSettings`, a malformed\n * request fails loudly instead of being silently repaired.\n */\nexport function isValidSettings(value: unknown): value is Settings {\n if (!isRecord(value)) return false\n if (typeof value.enabled !== \"boolean\" || typeof value.http !== \"boolean\") return false\n if (typeof value.maintenance !== \"boolean\") return false\n if (typeof value.directory !== \"string\" || value.directory.length > MAX_SETTINGS_DIRECTORY) return false\n return (\n isBoundedInteger(value.diskBudget, MAX_SETTINGS_DISK_BUDGET) &&\n isBoundedInteger(value.retentionMaxAgeDays, MAX_SETTINGS_RETENTION_DAYS) &&\n isBoundedInteger(value.retentionMaxSessions, MAX_SETTINGS_RETENTION_SESSIONS)\n )\n}\n\n/** Reads the `{ settings }` envelope used by the RPC methods and event. */\nexport function settingsFromEnvelope(value: unknown): Settings {\n return sanitizeSettings(isRecord(value) ? value.settings : undefined)\n}\n\n/**\n * Strip the computed `retention` policy that only exists in the status view\n * before writing a settings object back over the RPC.\n */\nexport function pickSettings(value: Settings): Settings {\n return {\n enabled: value.enabled,\n http: value.http,\n diskBudget: value.diskBudget,\n retentionMaxAgeDays: value.retentionMaxAgeDays,\n retentionMaxSessions: value.retentionMaxSessions,\n directory: value.directory,\n maintenance: value.maintenance,\n }\n}\n",
11
+ "import type { OpenCodeClient } from \"@opencode/client\"\nimport {\n CONTRACT_VERSION,\n PromptLogger,\n type ChangedEvent,\n type ListRequest,\n type ListResponse,\n type ReadRequest,\n type ReadResponse,\n type SearchRequest,\n type SearchResponse,\n type SetSettingsRequest,\n type SettingsChangedEvent,\n type SettingsResponse,\n type StatusResponse,\n type TruncateResponse,\n type UpdateSessionScopeRequest,\n type UpdateSessionScopeResponse,\n} from \"./rpc\"\nimport { pickSettings, settingsFromEnvelope, type Settings } from \"./settings\"\nimport {\n MAX_SEARCH_RESULTS,\n boundedString,\n clampInteger,\n clampPage,\n clampReadBytes,\n clampSearchBytes,\n clampSearchMs,\n} from \"./log/limits\"\n\nexport type RpcLocation = { readonly directory?: string }\n\n/** Defensive decode of a settings response or event payload. */\nfunction asSettingsResponse(value: unknown): SettingsResponse {\n const response = value as SettingsResponse\n return {\n settings: settingsFromEnvelope(value),\n sessionScope: response.sessionScope,\n }\n}\n\n/**\n * Typed client for the prompt-logger RPC, shared by the TUI and the desktop\n * GUI. JSON Schema returns `unknown`; this is the one place it is cast back to\n * the declared types, after the same clamps the server applies. Defence in\n * depth: a stale client cannot ask for an unbounded page.\n */\nexport function promptLogApi(client: OpenCodeClient, location?: RpcLocation) {\n const rpc = client.rpc(PromptLogger)\n const options = (signal?: AbortSignal) => ({\n ...(location?.directory === undefined ? {} : { location: { directory: location.directory } }),\n ...(signal === undefined ? {} : { signal }),\n })\n\n return {\n status(signal?: AbortSignal): Promise<StatusResponse> {\n return rpc.status({}, options(signal)) as Promise<StatusResponse>\n },\n\n list(input: ListRequest = {}, signal?: AbortSignal): Promise<ListResponse> {\n return rpc.list(clampList(input), options(signal)) as Promise<ListResponse>\n },\n\n read(input: ReadRequest, signal?: AbortSignal): Promise<ReadResponse> {\n return rpc.read(clampRead(input), options(signal)) as Promise<ReadResponse>\n },\n\n search(input: SearchRequest, signal?: AbortSignal): Promise<SearchResponse> {\n return rpc.search(clampSearch(input), options(signal)) as Promise<SearchResponse>\n },\n\n truncate(target: \"current\" | \"all\", sessionID?: string): Promise<TruncateResponse> {\n return rpc.truncate(\n {\n target,\n confirm: true,\n ...(sessionID === undefined ? {} : { sessionID: boundedString(sessionID, 200) }),\n },\n options(),\n ) as Promise<TruncateResponse>\n },\n\n getSettings(): Promise<SettingsResponse> {\n return rpc.getSettings({}, options()).then(asSettingsResponse) as Promise<SettingsResponse>\n },\n\n setSettings(settings: Settings): Promise<SettingsResponse> {\n const input: SetSettingsRequest = { settings: pickSettings(settings) }\n return rpc.setSettings(input, options()).then(asSettingsResponse) as Promise<SettingsResponse>\n },\n\n resetSettings(): Promise<SettingsResponse> {\n return rpc.resetSettings({}, options()).then(asSettingsResponse) as Promise<SettingsResponse>\n },\n\n updateSessionScope(input: UpdateSessionScopeRequest): Promise<UpdateSessionScopeResponse> {\n const sessionID = boundedString(input.sessionID, 200)\n return rpc.updateSessionScope(\n {\n ...(input.mode === undefined ? {} : { mode: input.mode }),\n ...(input.action === undefined ? {} : { action: input.action }),\n ...(sessionID === undefined ? {} : { sessionID }),\n },\n options(),\n ) as Promise<UpdateSessionScopeResponse>\n },\n\n onChanged(handler: (event: ChangedEvent) => void, signal?: AbortSignal): () => void {\n if (typeof rpc.events?.on !== \"function\") return () => {}\n return rpc.events.on(\n \"changed\",\n (event) => handler(event.data as ChangedEvent),\n signal === undefined ? undefined : { signal },\n )\n },\n\n onSettingsChanged(handler: (event: SettingsChangedEvent) => void, signal?: AbortSignal): () => void {\n if (typeof rpc.events?.on !== \"function\") return () => {}\n return rpc.events.on(\n \"settingsChanged\",\n (event) => handler(asSettingsResponse(event.data)),\n signal === undefined ? undefined : { signal },\n )\n },\n\n contractVersion: CONTRACT_VERSION,\n }\n}\n\nexport type PromptLogApi = ReturnType<typeof promptLogApi>\n\nfunction filtersOf(input: ListRequest | SearchRequest): Partial<ListRequest> {\n const sessionID = boundedString(input.sessionID, 200)\n const type = boundedString(input.type, 80)\n const kind = boundedString(input.kind, 80)\n const agent = boundedString(input.agent, 200)\n const model = boundedString(input.model, 200)\n return {\n ...(sessionID === undefined ? {} : { sessionID }),\n ...(type === undefined ? {} : { type }),\n ...(kind === undefined ? {} : { kind }),\n ...(agent === undefined ? {} : { agent }),\n ...(model === undefined ? {} : { model }),\n }\n}\n\nfunction clampList(input: ListRequest): ListRequest {\n return {\n ...filtersOf(input),\n ...(boundedString(input.query, 200) === undefined ? {} : { query: boundedString(input.query, 200) }),\n limit: clampPage(input.limit),\n ...(boundedString(input.cursor, 400) === undefined ? {} : { cursor: boundedString(input.cursor, 400) }),\n }\n}\n\nfunction clampRead(input: ReadRequest): ReadRequest {\n return {\n key: boundedString(input.key, 300) ?? \"\",\n maxBytes: clampReadBytes(input.maxBytes),\n }\n}\n\nfunction clampSearch(input: SearchRequest): SearchRequest {\n return {\n ...filtersOf(input),\n query: (input.query ?? \"\").trim().slice(0, 500),\n limit: clampInteger(input.limit, 1, MAX_SEARCH_RESULTS, 50),\n ignoreCase: input.ignoreCase === true,\n budgetBytes: clampSearchBytes(input.budgetBytes),\n budgetMs: clampSearchMs(input.budgetMs),\n }\n}\n",
12
+ "/** Error and path-warning text shared by the TUI and the desktop viewer. */\n\nexport function errorMessage(cause: unknown): string {\n if (cause instanceof Error) return cause.message\n if (cause !== null && typeof cause === \"object\" && \"message\" in cause) {\n return String((cause as { message: unknown }).message)\n }\n return \"the prompt logger rpc is unavailable\"\n}\n\nexport function warningLabel(warning: string): string {\n switch (warning) {\n case \"directory-permissions\":\n return \"the store directory is writable by others\"\n case \"symlink\":\n return \"the store path is a symlink\"\n case \"not-regular\":\n return \"the store path is not a directory\"\n default:\n return warning\n }\n}\n",
13
+ "/**\n * Session-scoped logging. `enabled` stays the master switch; this scope only\n * decides which sessions are written while it is on.\n *\n * The scope is runtime state, persisted in the plugin's server storage next to\n * the settings. `mode: \"all\"` keeps the historical behaviour.\n * `mode: \"only\"` writes the listed sessions and nothing else; an empty list is\n * a deliberate pause, not a fallback to every session.\n */\nexport type SessionMode = \"all\" | \"only\"\n\nexport type SessionScope = {\n readonly mode: SessionMode\n readonly sessions: readonly string[]\n readonly max: number\n}\n\n/**\n * A validated transition request. `mode` and `action` are mutually exclusive:\n * a mode switches the whole scope, an action changes the selected session.\n */\nexport type SessionScopeChange = {\n /** Switch every session back on, or keep the current selection limited. */\n readonly mode?: SessionMode\n /**\n * `only` records exactly this session and pauses the others; `disarm` drops\n * this session from the selection (the scope stays limited); `clear` drops\n * every selection and pauses logging.\n */\n readonly action?: \"only\" | \"disarm\" | \"clear\"\n readonly sessionID?: string\n}\n\n/** Runtime key. The settings key is \"settings\"; this is the same kind of state. */\nexport const SESSION_SCOPE_KEY = \"sessionScope\"\n\n/** A bounded allowlist keeps stale session IDs from accumulating forever. */\nexport const MAX_SESSION_SCOPE = 50\n\nexport function emptySessionScope(): SessionScope {\n return { mode: \"all\", sessions: [], max: MAX_SESSION_SCOPE }\n}\n\n/**\n * Read a stored scope defensively. A value written by a newer version, a\n * manual edit or a corrupted store falls back to the default (all sessions)\n * instead of breaking logging. Session IDs are bounded and deduplicated.\n */\nexport function parseSessionScope(value: unknown): SessionScope {\n if (value === null || typeof value !== \"object\" || Array.isArray(value)) {\n return emptySessionScope()\n }\n const record = value as Record<string, unknown>\n const sessions: string[] = []\n const seen = new Set<string>()\n if (Array.isArray(record.sessions)) {\n for (const entry of record.sessions) {\n if (typeof entry !== \"string\") continue\n const sessionID = entry.trim()\n if (sessionID === \"\" || sessionID.length > 200 || seen.has(sessionID)) continue\n seen.add(sessionID)\n sessions.push(sessionID)\n if (sessions.length >= MAX_SESSION_SCOPE) break\n }\n }\n return {\n mode: record.mode === \"only\" ? \"only\" : \"all\",\n sessions,\n max: MAX_SESSION_SCOPE,\n }\n}\n\n/**\n * What the hook gate asks: is this session written at all? Unlike\n * `isSelected`, a session in `mode: \"all\"` is allowed even though it is not in\n * the list.\n */\nexport function sessionAllowed(scope: SessionScope, sessionID: string | undefined): boolean {\n if (sessionID === undefined || sessionID === \"\") return false\n return scope.mode === \"all\" || scope.sessions.includes(sessionID)\n}\n\n/** Whether the user explicitly selected this session in the limited scope. */\nexport function isSelected(scope: SessionScope | undefined, sessionID: string | undefined): boolean {\n if (scope === undefined || scope.mode !== \"only\" || sessionID === undefined) return false\n return scope.sessions.includes(sessionID)\n}\n\n/** Short label shared by the TUI header, the desktop subtitle and toasts. */\nexport function scopeLabel(scope: SessionScope | undefined, enabled: boolean, sessionID?: string): string {\n if (!enabled) return \"off\"\n if (scope === undefined) return \"unavailable\"\n if (scope.mode === \"all\") return \"all sessions\"\n if (scope.sessions.length === 0) return \"paused\"\n if (sessionID !== undefined && isSelected(scope, sessionID)) return \"this session\"\n return scope.sessions.length === 1 ? \"1 session\" : `${scope.sessions.length} sessions`\n}\n\n/** \"Log only this session\": an exclusive selection. */\nexport function onlySession(scope: SessionScope, sessionID: string): SessionScope {\n return { mode: \"only\", sessions: [sessionID], max: scope.max }\n}\n\n/** Remove one selected session; the scope stays limited, possibly paused. */\nexport function removeSession(scope: SessionScope, sessionID: string): SessionScope {\n return {\n mode: scope.mode,\n sessions: scope.sessions.filter((entry) => entry !== sessionID),\n max: scope.max,\n }\n}\n\n/** Keep the limited scope but select nothing: logging is paused. */\nexport function clearSessions(scope: SessionScope): SessionScope {\n return { mode: \"only\", sessions: [], max: scope.max }\n}\n\n/** Back to the historical behaviour: every session is written. */\nexport function allSessions(scope: SessionScope): SessionScope {\n return { mode: \"all\", sessions: [], max: scope.max }\n}\n\n/**\n * Apply a validated change. The handler rejects unknown or incomplete\n * requests first; an empty ID here is a defensive no-op, never a selection\n * with an empty string.\n */\nexport function changeSessionScope(scope: SessionScope, change: SessionScopeChange): SessionScope {\n const sessionID = change.sessionID?.trim() ?? \"\"\n if (change.action === \"only\") return sessionID === \"\" ? scope : onlySession(scope, sessionID)\n if (change.action === \"disarm\") return sessionID === \"\" ? scope : removeSession(scope, sessionID)\n if (change.action === \"clear\") return clearSessions(scope)\n if (change.mode === \"all\") return allSessions(scope)\n return { ...scope, mode: \"only\" }\n}\n",
14
+ "import type { UpdateSessionScopeResponse } from \"./rpc\"\nimport type { PromptLogApi } from \"./rpc-client\"\nimport { isSelected } from \"./session-scope\"\n\n/**\n * Read the current scope, then arm or disarm exactly this session. The panel\n * switch already knows the desired state; the keybind and slash commands do\n * not, so they share this read-then-toggle path.\n */\nexport async function toggleSessionArmed(api: PromptLogApi, sessionID: string): Promise<UpdateSessionScopeResponse> {\n const status = await api.status()\n return api.updateSessionScope(\n isSelected(status.sessionScope, sessionID)\n ? { action: \"disarm\", sessionID }\n : { action: \"only\", sessionID },\n )\n}\n",
15
+ "/**\n * Untrusted log content is rendered as plain text. Prompts and tool output can\n * contain terminal control sequences: an escape sequence could clear the TUI,\n * move the cursor, spoof a prompt, or set the window title. The viewer strips\n * them before rendering, and caps the result so one record cannot freeze the\n * layout.\n *\n * The raw record is never modified; this is a display-only transformation.\n */\nexport type SanitizedText = {\n readonly text: string\n /** True when `limit` cut the input; the text carries a visible marker. */\n readonly truncated: boolean\n}\n\nexport function sanitizeTerminalInfo(input: string, limit = 64_000): SanitizedText {\n const parts: string[] = []\n let length = 0\n let truncated = false\n let i = 0\n\n const append = (value: string): void => {\n if (length >= limit) {\n truncated = true\n return\n }\n parts.push(value)\n length += value.length\n }\n\n while (i < input.length) {\n if (length >= limit) {\n truncated = true\n break\n }\n\n const code = input.charCodeAt(i)\n\n if (code === 0x1b) {\n i = skipEscape(input, i)\n continue\n }\n if (code === 0x0d) {\n append(\"\\n\")\n i += input.charCodeAt(i + 1) === 0x0a ? 2 : 1\n continue\n }\n if (code === 0x0a || code === 0x09) {\n append(input[i] as string)\n i += 1\n continue\n }\n // C0 controls, DEL and C1 controls have no place in a plain text view.\n if (code < 0x20 || code === 0x7f) {\n i += 1\n continue\n }\n if (code >= 0x80 && code <= 0x9f) {\n i += 1\n continue\n }\n if (isBidiControl(code)) {\n i += 1\n continue\n }\n\n // Keep surrogate pairs together: a lone half would render as a\n // replacement character and corrupt emoji.\n if (code >= 0xd800 && code <= 0xdbff && i + 1 < input.length) {\n if (length + 2 > limit) {\n truncated = true\n break\n }\n append(input.slice(i, i + 2))\n i += 2\n continue\n }\n\n append(input[i] as string)\n i += 1\n }\n\n const text = parts.join(\"\")\n if (truncated) return { text: `${text.slice(0, limit)}\\n… [truncated]`, truncated: true }\n return { text, truncated: false }\n}\n\nexport function sanitizeTerminal(input: string, limit = 64_000): string {\n return sanitizeTerminalInfo(input, limit).text\n}\n\n/** Skip one escape sequence and return the position after it. */\nfunction skipEscape(input: string, start: number): number {\n const next = input[start + 1]\n if (next === undefined) return start + 1\n\n // CSI: ESC [ ... final byte in 0x40-0x7e.\n if (next === \"[\") {\n let i = start + 2\n while (i < input.length) {\n const code = input.charCodeAt(i)\n i += 1\n if (code >= 0x40 && code <= 0x7e) break\n }\n return i\n }\n\n // OSC: ESC ] ... BEL or ST. DCS/SOS/PM/APC: ESC P/X/^/_ ... ST.\n if (next === \"]\" || next === \"P\" || next === \"X\" || next === \"^\" || next === \"_\") {\n let i = start + 2\n while (i < input.length) {\n const code = input.charCodeAt(i)\n if (code === 0x07) return i + 1\n if (code === 0x1b && input[i + 1] === \"\\\\\") return i + 2\n i += 1\n }\n return i\n }\n\n // Two-byte escape such as ESC 7, ESC 8, ESC =, ESC >.\n return start + 2\n}\n\nfunction isBidiControl(code: number): boolean {\n if (code === 0x061c || code === 0x200e || code === 0x200f) return true\n if (code >= 0x202a && code <= 0x202e) return true\n if (code >= 0x2066 && code <= 0x2069) return true\n return false\n}\n",
16
+ "import { sanitizeTerminal, sanitizeTerminalInfo } from \"./log/sanitize\"\nimport { MAX_FULL_RECORD_BYTES } from \"./log/limits\"\nimport type { LogSummary, ModelRef } from \"./log/types\"\n\n/** Shared by the TUI panel and the desktop panel. */\nexport const PANEL_NAME = \"prompt-logger.log\"\n\n/** Lines rendered in one detail page. */\nexport const DETAIL_PAGE = 30\n\n/** Characters of one section shown before the user asks for more. */\nexport const PREVIEW_LIMIT = 16 * 1024\n\n/**\n * Upper bound for a section that the viewer expanded. It matches the full-read\n * budget, so a section of a completely loaded request can be revealed without\n * a second hidden cap.\n */\nconst FULL_SECTION_LIMIT = MAX_FULL_RECORD_BYTES\n\n/**\n * Pretty-printing a compact JSON value can expand it by orders of magnitude\n * (indentation at every depth). Sections and HTTP bodies get separate budgets:\n * a raw message preview is worth formatting, while a pathological body is not.\n */\nconst SECTION_PRETTY_SOURCE_CHARS = 4 * 1024 * 1024\nconst SECTION_PRETTY_OUTPUT_CHARS = 8 * 1024 * 1024\nconst BODY_PRETTY_SOURCE_CHARS = 256 * 1024\nconst BODY_PRETTY_OUTPUT_CHARS = 1024 * 1024\n\nexport type SectionTone =\n | \"metadata\"\n | \"system\"\n | \"messages\"\n | \"tools\"\n | \"http-meta\"\n | \"http-body\"\n | \"warning\"\n\nexport type SectionLanguage = \"text\" | \"json\" | \"key-value\"\n\nexport type Section = {\n readonly title: string\n readonly text: string\n readonly tone?: SectionTone\n readonly language?: SectionLanguage\n /** True when `text` is a prefix; `expand` recomputes the rest on demand. */\n readonly truncated?: boolean\n /** Computes the expanded text on first use; only present when requested. */\n readonly expand?: () => string\n}\n\nexport type SectionsOptions = {\n /** False when HTTP body capture is disabled; adds an explanatory hint. */\n readonly httpEnabled?: boolean\n /**\n * Make truncated sections expandable. The expanded text is not built until\n * the viewer calls `expand`, so a large request does not pay for it on open.\n */\n readonly full?: boolean\n}\n\nexport type JsonTokenKind = \"key\" | \"string\" | \"number\" | \"boolean\" | \"null\" | \"punctuation\" | \"plain\"\n\nexport type JsonToken = {\n readonly text: string\n readonly kind: JsonTokenKind\n}\n\n/** Split a metadata line into its key and the part after the first colon. */\nexport function splitKeyValueLine(line: string): { key: string; value: string } | null {\n const at = line.indexOf(\":\")\n if (at <= 0) return null\n return { key: line.slice(0, at), value: line.slice(at + 1) }\n}\n\n/**\n * Best-effort JSON tokenizer. It deliberately does not require the whole text\n * to parse: a record can be capped with `[truncated]`, and a body can be a\n * fragment. Every input character is preserved, only its kind is classified.\n */\nexport function tokenizeJson(text: string): JsonToken[] {\n const tokens: JsonToken[] = []\n const push = (value: string, kind: JsonTokenKind): void => {\n if (value === \"\") return\n const previous = tokens.at(-1)\n if (previous !== undefined && previous.kind === kind) {\n tokens[tokens.length - 1] = { text: previous.text + value, kind }\n return\n }\n tokens.push({ text: value, kind })\n }\n\n let index = 0\n while (index < text.length) {\n const char = text[index] as string\n if (char === \" \" || char === \"\\t\" || char === \"\\n\" || char === \"\\r\") {\n let end = index + 1\n while (end < text.length && /[ \\t\\n\\r]/.test(text[end] as string)) end += 1\n push(text.slice(index, end), \"plain\")\n index = end\n continue\n }\n if (char === '\"') {\n let end = index + 1\n while (end < text.length) {\n if (text[end] === \"\\\\\") {\n end += 2\n continue\n }\n end += 1\n if (text[end - 1] === '\"') break\n }\n let lookahead = end\n while (lookahead < text.length && /[ \\t\\n\\r]/.test(text[lookahead] as string)) lookahead += 1\n push(text.slice(index, end), text[lookahead] === \":\" ? \"key\" : \"string\")\n index = end\n continue\n }\n if (char === \"-\" || (char >= \"0\" && char <= \"9\")) {\n let end = index + 1\n while (end < text.length && /[0-9.eE+-]/.test(text[end] as string)) end += 1\n push(text.slice(index, end), \"number\")\n index = end\n continue\n }\n if (text.startsWith(\"true\", index) || text.startsWith(\"false\", index)) {\n const value = text.startsWith(\"true\", index) ? \"true\" : \"false\"\n push(value, \"boolean\")\n index += value.length\n continue\n }\n if (text.startsWith(\"null\", index)) {\n push(\"null\", \"null\")\n index += 4\n continue\n }\n if (\"{}[],:\".includes(char)) {\n push(char, \"punctuation\")\n index += 1\n continue\n }\n let end = index + 1\n while (end < text.length) {\n const next = text[end] as string\n if (next === '\"' || next === \"-\" || (next >= \"0\" && next <= \"9\")) break\n if (\"{}[],:\".includes(next) || next === \" \" || next === \"\\t\" || next === \"\\n\" || next === \"\\r\") break\n end += 1\n }\n push(text.slice(index, end), \"plain\")\n index = end\n }\n return tokens\n}\n\n\nconst encoder = new TextEncoder()\n\nfunction byteLength(text: string): number {\n return encoder.encode(text).length\n}\n\nexport function formatBytes(bytes: number): string {\n if (!Number.isFinite(bytes) || bytes < 0) return \"?\"\n if (bytes < 1024) return `${bytes} B`\n if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`\n if (bytes < 1024 * 1024 * 1024) return `${(bytes / (1024 * 1024)).toFixed(1)} MB`\n return `${(bytes / (1024 * 1024 * 1024)).toFixed(1)} GB`\n}\n\nexport function formatTime(at: string | null): string {\n if (at === null) return \"—\"\n const date = new Date(at)\n if (Number.isNaN(date.getTime())) return at.length > 19 ? at.slice(11, 19) : at\n return date.toISOString().slice(11, 19)\n}\n\nexport function modelLabel(model: ModelRef | null): string {\n if (model === null) return \"—\"\n const base = [model.providerID, model.id].filter((part) => part !== undefined && part !== \"\").join(\"/\")\n if (base === \"\") return \"—\"\n return model.variant === undefined ? base : `${base}/${model.variant}`\n}\n\n/** Display-only text from an untrusted field. */\nexport function displayText(value: string | null | undefined, limit = 500): string {\n return sanitizeTerminal(value ?? \"\", limit)\n}\n\n/** One terminal row: never let a list entry wrap into the next record. */\nexport function fitText(text: string, width: number): string {\n if (width <= 0) return \"\"\n if (text.length <= width) return text\n return `${text.slice(0, Math.max(0, width - 1))}…`\n}\n\nfunction shortSession(sessionID: string | null): string {\n if (sessionID === null) return \"—\"\n return sessionID.length <= 12 ? sessionID : sessionID.slice(0, 12)\n}\n\nexport function entryLine(entry: LogSummary): string {\n const base = entry.type === null ? \"?\" : entry.kind === null ? entry.type : `${entry.type}/${entry.kind}`\n // In v2 an HTTP body is attached to its assembled request; make that visible\n // in the list instead of pretending it is a separate record.\n const type =\n entry.hasBody === true && entry.type === \"assembled\"\n ? `${entry.kind ?? \"assembled\"}+http`\n : entry.hasBody === true && entry.type !== \"http\"\n ? `${base}+http`\n : base\n const extra = [\n entry.messages === undefined ? null : `${entry.messages} msg`,\n entry.hasBody === true ? \"body\" : null,\n ].filter((value): value is string => value !== null)\n return sanitizeTerminal(\n [\n formatTime(entry.at),\n type.padEnd(18),\n shortSession(entry.sessionID).padEnd(12),\n (entry.agent ?? \"—\").padEnd(9),\n modelLabel(entry.model).padEnd(26),\n formatBytes(entry.bytes),\n ...extra,\n ].join(\" \"),\n 400,\n )\n}\n\nexport function entryTitle(entry: LogSummary): string {\n return sanitizeTerminal(\n `${formatTime(entry.at)} · ${entry.type ?? \"unknown\"}${entry.kind === null ? \"\" : `/${entry.kind}`} · ${\n entry.sessionID ?? \"no session\"\n } · ${formatBytes(entry.bytes)}${entry.messages === undefined ? \"\" : ` · ${entry.messages} messages`}${\n entry.hasBody === true ? \" · HTTP body\" : \"\"\n }`,\n 500,\n )\n}\n\n/** A stable identity for a summary row across refreshes and pages. */\nexport function summaryKey(entry: LogSummary): string {\n return entry.key\n}\n\n/**\n * Merge a refreshed page into the rows already loaded. Pages are ordered by\n * cursor and deduplicated by key: refreshing keeps older pages loaded while the\n * newest requests are prepended.\n */\nexport function mergeSummaries(\n current: readonly LogSummary[],\n incoming: readonly LogSummary[],\n limit = 200,\n): readonly LogSummary[] {\n if (incoming.length === 0) return current\n const known = new Set(current.map(summaryKey))\n const fresh = incoming.filter((entry) => !known.has(summaryKey(entry)))\n const merged = [...fresh, ...current]\n merged.sort((left, right) => right.cursor.localeCompare(left.cursor))\n return merged.slice(0, limit)\n}\n\nfunction asObject(value: unknown): Record<string, unknown> | null {\n return value !== null && typeof value === \"object\" && !Array.isArray(value) ? (value as Record<string, unknown>) : null\n}\n\nfunction textOf(value: unknown): string | null {\n if (typeof value === \"string\") return value\n if (Array.isArray(value)) {\n const parts: string[] = []\n for (const part of value) {\n const record = asObject(part)\n if (record !== null && typeof record.text === \"string\") parts.push(record.text)\n }\n return parts.length === 0 ? null : parts.join(\"\\n\\n\")\n }\n return null\n}\n\nfunction withText(\n title: string,\n text: string,\n limit: number,\n tone: SectionTone,\n language: SectionLanguage,\n full: boolean,\n): Section {\n const preview = sanitizeTerminalInfo(text, limit)\n const expand =\n full && preview.truncated ? () => sanitizeTerminalInfo(text, FULL_SECTION_LIMIT).text : undefined\n return {\n title,\n text: preview.text,\n tone,\n language,\n ...(preview.truncated ? { truncated: true } : {}),\n ...(expand === undefined ? {} : { expand }),\n }\n}\n\nfunction prettyJson(\n value: unknown,\n sourceLimit: number,\n outputLimit: number,\n): { readonly text: string; readonly pretty: boolean } {\n const compact = JSON.stringify(value) ?? \"null\"\n if (compact.length > sourceLimit) return { text: compact, pretty: false }\n const pretty = JSON.stringify(value, null, 2) ?? compact\n return pretty.length <= outputLimit ? { text: pretty, pretty: true } : { text: compact, pretty: false }\n}\n\nfunction jsonText(value: unknown): string {\n return prettyJson(value, SECTION_PRETTY_SOURCE_CHARS, SECTION_PRETTY_OUTPUT_CHARS).text\n}\n\nfunction section(\n title: string,\n value: unknown,\n limit: number,\n tone: SectionTone,\n language?: SectionLanguage,\n full = false,\n): Section | null {\n if (value === undefined || value === null) return null\n const isText = typeof value === \"string\"\n const text = isText ? value : jsonText(value)\n if (text === undefined) return null\n return withText(\n `${title} (${formatBytes(byteLength(text))})`,\n text,\n limit,\n tone,\n language ?? (isText ? \"text\" : \"json\"),\n full,\n )\n}\n\n/**\n * HTTP body metadata and content, shared by an assembled request (whose `http`\n * field carries the provider body) and a standalone http record. A binary body\n * is never dumped as a giant base64 string; the viewer shows its size and a\n * bounded preview. The raw blob stays on disk.\n */\nfunction httpSections(value: unknown, limit: number, title = \"HTTP body\", full = false): Section[] {\n const http = asObject(value)\n if (http === null) return []\n\n const meta: string[] = []\n if (typeof http.url === \"string\") meta.push(`url: ${http.url}`)\n if (typeof http.bodyEncoding === \"string\") meta.push(`encoding: ${http.bodyEncoding}`)\n if (typeof http.contentType === \"string\") meta.push(`content-type: ${http.contentType}`)\n if (typeof http.bodyBytes === \"number\") meta.push(`wire bytes: ${formatBytes(http.bodyBytes)}`)\n if (typeof http.decodedBytes === \"number\") meta.push(`decoded bytes: ${formatBytes(http.decodedBytes)}`)\n if (http.bodyTruncated === true || http.truncated === true) {\n meta.push(http.bodyCapped === true || http.truncated === true ? \"the body was capped while capturing\" : \"the body was truncated for display\")\n }\n\n const sections: Section[] = []\n if (meta.length > 0) {\n sections.push(withText(`${title} metadata`, meta.join(\"\\n\"), limit, \"http-meta\", \"key-value\", full))\n }\n\n if (typeof http.body === \"string\") {\n let pretty = http.body\n let language: SectionLanguage = \"text\"\n if (http.body.length <= BODY_PRETTY_SOURCE_CHARS) {\n try {\n const formatted = prettyJson(JSON.parse(http.body), BODY_PRETTY_SOURCE_CHARS, BODY_PRETTY_OUTPUT_CHARS)\n pretty = formatted.text\n language = \"json\"\n } catch {\n // Not JSON: show the raw text, still capped and sanitized.\n }\n }\n sections.push(\n withText(`${title} (${formatBytes(byteLength(pretty))})`, pretty, limit, \"http-body\", language, full),\n )\n } else if (typeof http.bodyBase64 === \"string\") {\n const preview = http.bodyBase64.slice(0, Math.min(2048, limit))\n const suffix = http.bodyBase64.length > preview.length ? \"\\n… [base64 preview truncated]\" : \"\"\n sections.push(\n withText(\n `${title} (binary)`,\n `binary body\\n${preview}${suffix}`,\n limit,\n \"http-body\",\n \"text\",\n false,\n ),\n )\n } else if (http.bodyUnavailable === true) {\n sections.push({\n title: `${title} (unavailable)`,\n text: \"the body blob is missing from the log\",\n tone: \"warning\",\n language: \"text\",\n })\n }\n\n return sections\n}\n\n/**\n * Expand every section that carries an `expand` callback. The desktop\n * \"Load complete entry\" uses this so the 16 KB previews are replaced as soon\n * as the full request has arrived.\n */\nexport function expandAllSections(\n sections: readonly Section[],\n): { readonly expanded: ReadonlySet<number>; readonly texts: Record<number, string> } {\n const expanded = new Set<number>()\n const texts: Record<number, string> = {}\n sections.forEach((section, index) => {\n if (section.expand === undefined) return\n expanded.add(index)\n texts[index] = section.expand()\n })\n return { expanded, texts }\n}\n\n/**\n * Structured sections for one record. The text is sanitized before it leaves\n * this module; the tone and language only describe how the renderers paint it.\n * JSON and key/value bodies are tokenized by the caller.\n */\nexport function sectionsFor(\n record: unknown,\n limit = PREVIEW_LIMIT,\n options: SectionsOptions = {},\n): Section[] {\n const full = options.full === true\n const object = asObject(record)\n if (object === null) {\n return [withText(\"Record\", String(record), limit, \"warning\", \"text\", full)]\n }\n\n const meta: string[] = []\n for (const key of [\"at\", \"type\", \"kind\", \"sessionID\", \"agent\"] as const) {\n if (typeof object[key] === \"string\") meta.push(`${key}: ${object[key] as string}`)\n }\n const model = asObject(object.model)\n if (model !== null) {\n meta.push(\n `model: ${modelLabel({\n providerID: typeof model.providerID === \"string\" ? model.providerID : undefined,\n id: typeof model.id === \"string\" ? model.id : undefined,\n variant: typeof model.variant === \"string\" ? model.variant : undefined,\n })}`,\n )\n }\n if (typeof object.url === \"string\") meta.push(`url: ${object.url}`)\n const http = asObject(object.http)\n if (http !== null) {\n const encoding = typeof http.bodyEncoding === \"string\" ? http.bodyEncoding : \"unknown\"\n const size = typeof http.bodyBytes === \"number\" ? `, ${formatBytes(http.bodyBytes)} on the wire` : \"\"\n meta.push(http.bodyUnavailable === true ? \"http body: missing blob\" : `http body: captured (${encoding}${size})`)\n }\n\n const sections: Section[] = [\n withText(\"Metadata\", meta.join(\"\\n\") || \"—\", limit, \"metadata\", \"key-value\", full),\n ]\n\n if (object.type === \"assembled\") {\n const system = textOf(object.system)\n const systemSection = section(\"System prompt\", system, limit, \"system\", \"text\", full)\n if (systemSection !== null) sections.push(systemSection)\n\n if (Array.isArray(object.messages)) {\n const total = typeof object.messageCount === \"number\" ? object.messageCount : object.messages.length\n const roles = object.messages\n .map((message) => asObject(message)?.role)\n .filter((role): role is string => typeof role === \"string\")\n const summary = [\n `messages: ${total}`,\n ...(object.messages.length < total ? [`previewed: ${object.messages.length}`] : []),\n ...roles.slice(0, 40).map((role, index) => `${index + 1}. ${role}`),\n ]\n if (object.messages.length > 40) summary.push(`… ${object.messages.length - 40} more`)\n sections.push(withText(\"Messages\", summary.join(\"\\n\"), limit, \"messages\", \"text\", full))\n const raw = section(\"Messages (raw preview)\", object.messages, limit, \"messages\", \"json\", full)\n if (raw !== null) sections.push(raw)\n }\n\n if (Array.isArray(object.tools)) {\n const tools = object.tools.filter((tool): tool is string => typeof tool === \"string\")\n sections.push(withText(`Tools (${tools.length})`, tools.join(\", \") || \"none\", limit, \"tools\", \"text\", full))\n }\n if (object.http !== undefined) {\n sections.push(...httpSections(object.http, limit, \"HTTP request\", full))\n } else if (options.httpEnabled === false) {\n sections.push({\n title: \"HTTP body (not captured)\",\n text:\n 'HTTP body logging is disabled, so the provider bytes for this request are not in the store. ' +\n 'Enable \"Log HTTP bodies\" in the Prompt logger settings and repeat the request to capture them.',\n tone: \"warning\",\n language: \"text\",\n })\n }\n } else if (object.type === \"http\") {\n sections.push(...httpSections(object, limit, \"HTTP body\", full))\n } else {\n const raw = section(\"Record\", record, limit, \"metadata\", \"json\", full)\n if (raw !== null) sections.push(raw)\n }\n\n return sections\n}\n",
17
+ "import {\n splitKeyValueLine,\n tokenizeJson,\n type JsonTokenKind,\n type Section,\n type SectionTone,\n} from \"./view-model\"\n\nexport type DetailToken = JsonTokenKind | \"key\" | \"value\"\n\nexport type DetailSegment = {\n readonly text: string\n readonly token?: DetailToken\n}\n\nexport type DetailLine = {\n readonly segments: readonly DetailSegment[]\n readonly tone?: SectionTone\n readonly bold?: boolean\n}\n\nfunction textLine(text: string, token?: DetailToken): DetailLine {\n return { segments: [{ text, ...(token === undefined ? {} : { token }) }] }\n}\n\nfunction jsonLines(text: string): DetailLine[] {\n const lines: DetailLine[] = []\n let segments: DetailSegment[] = []\n const flush = (): void => {\n lines.push({ segments: segments.length === 0 ? [{ text: \"\" }] : segments })\n segments = []\n }\n\n for (const token of tokenizeJson(text)) {\n const parts = token.text.split(\"\\n\")\n for (let index = 0; index < parts.length; index += 1) {\n if (index > 0) flush()\n const part = parts[index] ?? \"\"\n if (part !== \"\") {\n segments.push({ text: part, ...(token.kind === \"plain\" ? {} : { token: token.kind }) })\n }\n }\n }\n flush()\n return lines\n}\n\nfunction keyValueLines(text: string): DetailLine[] {\n return text.split(\"\\n\").map((line) => {\n const parts = splitKeyValueLine(line)\n if (parts === null) return textLine(line)\n return {\n segments: [\n { text: parts.key, token: \"key\" },\n { text: \":\", token: \"punctuation\" },\n { text: parts.value, token: \"value\" },\n ],\n }\n })\n}\n\nfunction bodyLines(section: Section): DetailLine[] {\n if (section.language === \"json\") return jsonLines(section.text)\n if (section.language === \"key-value\") return keyValueLines(section.text)\n return section.text.split(\"\\n\").map((line) => ({\n ...textLine(line),\n ...(section.tone === \"warning\" ? { tone: section.tone } : {}),\n }))\n}\n\n/**\n * Turn the shared detail sections into TUI rows. Section headers are bold and\n * toned; JSON and key/value bodies carry token kinds, and every other body line\n * stays plain text. The result is paged by line, exactly like the old strings.\n */\nexport function detailLinesForSections(sections: readonly Section[]): DetailLine[] {\n const lines: DetailLine[] = []\n for (const section of sections) {\n lines.push({\n segments: [{ text: `== ${section.title} ==` }],\n ...(section.tone === undefined ? {} : { tone: section.tone }),\n bold: true,\n })\n lines.push(...bodyLines(section))\n lines.push(textLine(\"\"))\n }\n return lines\n}\n",
18
+ "import { spread as _$spread } from \"@opentui/solid\";\nimport { mergeProps as _$mergeProps } from \"@opentui/solid\";\nimport { createComponent as _$createComponent } from \"@opentui/solid\";\nimport { effect as _$effect } from \"@opentui/solid\";\nimport { createTextNode as _$createTextNode } from \"@opentui/solid\";\nimport { insertNode as _$insertNode } from \"@opentui/solid\";\nimport { memo as _$memo } from \"@opentui/solid\";\nimport { insert as _$insert } from \"@opentui/solid\";\nimport { setProp as _$setProp } from \"@opentui/solid\";\nimport { createElement as _$createElement } from \"@opentui/solid\";\n/** @jsxImportSource @opentui/solid */\nimport { TextAttributes } from \"@opentui/core\";\nimport { For, Show } from \"solid-js\";\nimport { MAX_FULL_RECORD_BYTES, MAX_RECORD_BYTES } from \"../log/limits\";\nimport { DETAIL_PAGE, entryTitle, formatBytes } from \"../view-model\";\nfunction sectionColor(ctx, tone) {\n switch (tone) {\n case \"metadata\":\n return ctx.theme.text.muted;\n case \"system\":\n return ctx.theme.text.feedback.info.base;\n case \"messages\":\n return ctx.theme.text.feedback.success.base;\n case \"tools\":\n return ctx.theme.text.feedback.warning.base;\n case \"http-meta\":\n case \"http-body\":\n return ctx.theme.text.action.primary.base;\n case \"warning\":\n return ctx.theme.text.feedback.warning.base;\n default:\n return ctx.theme.text.base;\n }\n}\nfunction tokenColor(ctx, token, fallback) {\n switch (token) {\n case \"key\":\n return ctx.theme.syntax.variable;\n case \"string\":\n return ctx.theme.syntax.string;\n case \"number\":\n return ctx.theme.syntax.number;\n case \"boolean\":\n return ctx.theme.syntax.keyword;\n case \"null\":\n return ctx.theme.syntax.comment;\n case \"punctuation\":\n return ctx.theme.syntax.punctuation;\n default:\n return fallback;\n }\n}\n\n/** The paged request detail, separated from the list/fetch state in LogView. */\nexport function DetailPane(props) {\n return (() => {\n var _el$ = _$createElement(\"box\"),\n _el$2 = _$createElement(\"text\"),\n _el$3 = _$createElement(\"text\"),\n _el$4 = _$createTextNode(`section page `),\n _el$5 = _$createTextNode(` of `),\n _el$7 = _$createTextNode(` · j/k scroll · `),\n _el$9 = _$createTextNode(` · `),\n _el$1 = _$createTextNode(`esc back · q close`),\n _el$10 = _$createElement(\"text\"),\n _el$14 = _$createElement(\"text\"),\n _el$15 = _$createElement(\"text\"),\n _el$16 = _$createTextNode(`–`),\n _el$17 = _$createTextNode(` of `),\n _el$18 = _$createTextNode(` lines · the request is displayed as sanitized plain text`);\n _$insertNode(_el$, _el$2);\n _$insertNode(_el$, _el$3);\n _$insertNode(_el$, _el$10);\n _$insertNode(_el$, _el$14);\n _$insertNode(_el$, _el$15);\n _$setProp(_el$, \"flexDirection\", \"column\");\n _$setProp(_el$, \"flexGrow\", 1);\n _$insert(_el$2, () => entryTitle(props.detail.entry));\n _$insertNode(_el$3, _el$4);\n _$insertNode(_el$3, _el$5);\n _$insertNode(_el$3, _el$7);\n _$insertNode(_el$3, _el$9);\n _$insertNode(_el$3, _el$1);\n _$insert(_el$3, () => Math.floor(props.offset / DETAIL_PAGE) + 1, _el$5);\n _$insert(_el$3, () => Math.max(1, Math.ceil(props.lines.length / DETAIL_PAGE)), _el$7);\n _$insert(_el$3, (() => {\n var _c$ = _$memo(() => !!props.expanded);\n return () => _c$() ? \"e collapse\" : props.hasTruncated ? \"e expand\" : \"no truncated sections\";\n })(), _el$9);\n _$insert(_el$3, () => props.data?.moreAvailable === true ? \"shift+e full · \" : \"\", _el$1);\n _$insert(_el$, _$createComponent(Show, {\n get when() {\n return props.data?.truncated === true;\n },\n get children() {\n var _el$11 = _$createElement(\"text\");\n _$insert(_el$11, (() => {\n var _c$2 = _$memo(() => props.data?.moreAvailable === true);\n return () => _c$2() ? `the request is ${formatBytes(props.data?.fullBytes ?? 0)} and is truncated at the ${formatBytes(MAX_RECORD_BYTES)} read budget; press shift+e to load the complete request` : `the request is ${formatBytes(props.data?.fullBytes ?? 0)}${(props.data?.fullBytes ?? 0) > MAX_FULL_RECORD_BYTES ? `, larger than the ${formatBytes(MAX_FULL_RECORD_BYTES)} viewer limit` : \"; it is still truncated for display\"}; the stored files may contain more`;\n })());\n _$effect(_$p => _$setProp(_el$11, \"fg\", props.ctx.theme.text.feedback.warning.base, _$p));\n return _el$11;\n }\n }), _el$14);\n _$insert(_el$, _$createComponent(Show, {\n get when() {\n return props.loading;\n },\n get children() {\n var _el$12 = _$createElement(\"text\");\n _$insertNode(_el$12, _$createTextNode(`loading the request…`));\n _$effect(_$p => _$setProp(_el$12, \"fg\", props.ctx.theme.text.muted, _$p));\n return _el$12;\n }\n }), _el$14);\n _$insert(_el$, _$createComponent(For, {\n get each() {\n return props.page;\n },\n children: line => {\n const lineColor = line.tone === undefined ? props.ctx.theme.text.base : sectionColor(props.ctx, line.tone);\n return (() => {\n var _el$19 = _$createElement(\"text\");\n _$setProp(_el$19, \"fg\", lineColor);\n _$insert(_el$19, _$createComponent(For, {\n get each() {\n return line.segments;\n },\n children: segment => (() => {\n var _el$20 = _$createElement(\"span\");\n _$spread(_el$20, _$mergeProps(() => ({\n fg: tokenColor(props.ctx, segment.token, lineColor)\n })), true);\n _$insert(_el$20, () => segment.text);\n return _el$20;\n })()\n }));\n _$effect(_$p => _$setProp(_el$19, \"attributes\", line.bold === true ? TextAttributes.BOLD : undefined, _$p));\n return _el$19;\n })();\n }\n }), _el$14);\n _$insertNode(_el$15, _el$16);\n _$insertNode(_el$15, _el$17);\n _$insertNode(_el$15, _el$18);\n _$insert(_el$15, () => props.offset + 1, _el$16);\n _$insert(_el$15, () => Math.min(props.offset + DETAIL_PAGE, props.lines.length), _el$17);\n _$insert(_el$15, () => props.lines.length, _el$18);\n _$effect(_p$ => {\n var _v$ = props.ctx.theme.text.base,\n _v$2 = TextAttributes.BOLD,\n _v$3 = props.ctx.theme.text.muted,\n _v$4 = props.ctx.theme.text.muted,\n _v$5 = props.ctx.theme.text.muted,\n _v$6 = props.ctx.theme.text.muted;\n _v$ !== _p$.e && (_p$.e = _$setProp(_el$2, \"fg\", _v$, _p$.e));\n _v$2 !== _p$.t && (_p$.t = _$setProp(_el$2, \"attributes\", _v$2, _p$.t));\n _v$3 !== _p$.a && (_p$.a = _$setProp(_el$3, \"fg\", _v$3, _p$.a));\n _v$4 !== _p$.o && (_p$.o = _$setProp(_el$10, \"fg\", _v$4, _p$.o));\n _v$5 !== _p$.i && (_p$.i = _$setProp(_el$14, \"fg\", _v$5, _p$.i));\n _v$6 !== _p$.n && (_p$.n = _$setProp(_el$15, \"fg\", _v$6, _p$.n));\n return _p$;\n }, {\n e: undefined,\n t: undefined,\n a: undefined,\n o: undefined,\n i: undefined,\n n: undefined\n });\n return _el$;\n })();\n}",
19
+ "import { createComponent as _$createComponent } from \"@opentui/solid\";\nimport { setProp as _$setProp } from \"@opentui/solid\";\nimport { effect as _$effect } from \"@opentui/solid\";\nimport { insert as _$insert } from \"@opentui/solid\";\nimport { createElement as _$createElement } from \"@opentui/solid\";\n/** @jsxImportSource @opentui/solid */\nimport { Show, createSignal } from \"solid-js\";\nimport { loggingIndicator } from \"./logging-indicator\";\nimport { promptLogApi } from \"./rpc-client\";\n/**\n * The logging state shared by the Home and session footer badges.\n *\n * The server emits `settingsChanged` for every settings or scope write, so a\n * badge never polls. The one status read on startup covers a viewer opened\n * after logging was already configured; `server.connected` retries it after a\n * reconnect, when the first read may have raced the server.\n */\nexport function createLoggingSnapshot(ctx) {\n const [snapshot, setSnapshot] = createSignal();\n const api = promptLogApi(ctx.client, ctx.location);\n let disposed = false;\n const apply = (enabled, scope) => {\n if (disposed) return;\n setSnapshot({\n enabled,\n scope\n });\n };\n const refresh = async () => {\n try {\n const status = await api.status();\n apply(status.settings.enabled, status.sessionScope);\n } catch {\n // The panel reports the full error when it opens. Keep the last known\n // state rather than flashing a misleading \"off\" badge.\n }\n };\n void refresh();\n let unsubscribeSettings = () => {};\n try {\n unsubscribeSettings = api.onSettingsChanged(event => {\n apply(event.settings.enabled, event.sessionScope);\n });\n } catch {\n // The event stream is optional; the initial status read still works.\n }\n let unsubscribeConnected = () => {};\n try {\n if (typeof ctx.data?.on === \"function\") {\n unsubscribeConnected = ctx.data.on(\"server.connected\", () => {\n void refresh();\n });\n }\n } catch {\n // The connection events are optional; the settings event and initial read\n // still cover a normal session.\n }\n return {\n current: snapshot,\n dispose() {\n disposed = true;\n unsubscribeSettings();\n unsubscribeConnected();\n }\n };\n}\n\n/**\n * The footer badge. It is absent while logging is off: presence itself is the\n * signal, and a permanent \"off\" chip would only take room from the footer.\n */\nexport function LoggingBadge(props) {\n const indicator = () => {\n const current = props.snapshot();\n if (current === undefined) return undefined;\n return loggingIndicator({\n enabled: current.enabled,\n scope: current.scope,\n ...(props.sessionID === undefined ? {} : {\n sessionID: props.sessionID\n })\n });\n };\n const visible = () => {\n const current = indicator();\n return current !== undefined && current.tone !== \"off\";\n };\n const color = () => {\n const tone = indicator()?.tone;\n if (tone === \"recording\") return props.theme.text.feedback.success.base;\n if (tone === \"paused\") return props.theme.text.feedback.warning.base;\n return props.theme.text.muted;\n };\n const label = () => {\n const current = indicator();\n if (current === undefined) return \"\";\n return `${current.tone === \"paused\" ? \"◐\" : \"●\"} ${current.label}`;\n };\n return _$createComponent(Show, {\n get when() {\n return visible();\n },\n get children() {\n var _el$ = _$createElement(\"text\");\n _$insert(_el$, label);\n _$effect(_$p => _$setProp(_el$, \"fg\", color(), _$p));\n return _el$;\n }\n });\n}",
20
+ "import { isSelected, type SessionScope } from \"./session-scope\"\n\n/** The effective logging state a viewer knows about. */\nexport type LoggingState = {\n readonly enabled: boolean\n readonly scope: SessionScope | undefined\n}\n\nexport type LoggingIndicatorTone = \"recording\" | \"paused\" | \"off\"\n\n/**\n * A short, viewer-independent description of the logging state.\n *\n * The TUI renders `label` in its footer; the desktop uses `detail` in a\n * tooltip and the tone to pick an icon. Keeping the decision here means the\n * two clients cannot disagree about what \"paused\" means.\n */\nexport type LoggingIndicator = {\n readonly tone: LoggingIndicatorTone\n /** Compact label for a status bar, e.g. `log: all`. */\n readonly label: string\n /** Full sentence for a tooltip or accessible name. */\n readonly detail: string\n}\n\n/**\n * Resolve the state for one session, or for Home when `sessionID` is omitted.\n *\n * `enabled` is the master switch. When it is on, a limited scope can still\n * exclude this session: that is `paused`, not `off`, and the distinction is\n * the reason the indicator exists.\n */\nexport function loggingIndicator(\n state: LoggingState & { readonly sessionID?: string },\n): LoggingIndicator {\n if (!state.enabled) {\n return { tone: \"off\", label: \"log: off\", detail: \"Logging is off\" }\n }\n\n const scope = state.scope\n if (scope === undefined) {\n return { tone: \"off\", label: \"log: unavailable\", detail: \"Prompt logger status is unavailable\" }\n }\n\n if (scope.mode === \"all\") {\n return { tone: \"recording\", label: \"log: all\", detail: \"Recording all sessions\" }\n }\n\n const sessionID = state.sessionID\n if (sessionID !== undefined) {\n if (isSelected(scope, sessionID)) {\n return { tone: \"recording\", label: \"log: this\", detail: \"Recording this session only\" }\n }\n return {\n tone: \"paused\",\n label: \"log: paused\",\n detail: \"Logging is on, but paused for this session\",\n }\n }\n\n const count = scope.sessions.length\n if (count === 0) {\n return { tone: \"paused\", label: \"log: paused\", detail: \"Logging is paused: no session is selected\" }\n }\n return {\n tone: \"recording\",\n label: `log: ${count}`,\n detail: count === 1 ? \"Recording 1 session\" : `Recording ${count} sessions`,\n }\n}\n"
21
+ ],
22
+ "mappings": ";;AAAA,4BAAS;AAET;;;ACFA,2BAAS;AACT,uBAAS;AACT,mBAAS;AACT,gBAAS;AACT,mBAAS;AACT,4BAAS;AACT,oBAAS;AACT,0BAAS;AAET,2BAAS;AACT,gBAAS,cAAK;;;ACTP,IAAM,eAAe;AACrB,IAAM,WAAW;AAGjB,IAAM,mBAAmB,IAAI,OAAO;AAGpC,IAAM,wBAAwB,KAAK,OAAO;AAG1C,IAAM,mBAAmB,MAAM,OAAO;AACtC,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,MAAM,SAAS,MAAM,mBAAmB,aAAa,IAAI,QAAQ,IAAI,QAAQ,GAAG,MAAM,SAAS;AAAA,cAC/F,IAAI,GAAG,MAAM,KAAK;AAAA,gBAChB,SAAS,YAAY,WAAW,OAAO,cAAc,OAAO,SAAS,SAAS,MAAM,SAAS;AAAA,gBAC7F,SAAS;AAAA,cACX,CAAC;AAAA,cACD,OAAO,OAAO;AAAA,cACd,IAAI,GAAG,MAAM,KAAK;AAAA,gBAChB,SAAS,aAAa,KAAK;AAAA,gBAC3B,SAAS;AAAA,cACX,CAAC;AAAA;AAAA;AAAA,QAGP,CAAC;AAAA,MACH;AAAA,KACD;AAAA,IACD,OAAO,MAAM;AAAA,MACX,YAAY;AAAA,MACZ,aAAa;AAAA,MACb,qBAAqB;AAAA,MACrB,kBAAkB;AAAA,MAClB,QAAQ,QAAQ;AAAA;AAAA;AAGtB,CAAC;",
23
+ "debugId": "10760FA9AAE231EC64756E2164756E21",
24
+ "names": []
25
+ }
@@ -0,0 +1,3 @@
1
+ /** Error and path-warning text shared by the TUI and the desktop viewer. */
2
+ export declare function errorMessage(cause: unknown): string;
3
+ export declare function warningLabel(warning: string): string;
@@ -0,0 +1,76 @@
1
+ import type { LogSummary, ModelRef } from "./log/types";
2
+ /** Shared by the TUI panel and the desktop panel. */
3
+ export declare const PANEL_NAME = "prompt-logger.log";
4
+ /** Lines rendered in one detail page. */
5
+ export declare const DETAIL_PAGE = 30;
6
+ /** Characters of one section shown before the user asks for more. */
7
+ export declare const PREVIEW_LIMIT: number;
8
+ export type SectionTone = "metadata" | "system" | "messages" | "tools" | "http-meta" | "http-body" | "warning";
9
+ export type SectionLanguage = "text" | "json" | "key-value";
10
+ export type Section = {
11
+ readonly title: string;
12
+ readonly text: string;
13
+ readonly tone?: SectionTone;
14
+ readonly language?: SectionLanguage;
15
+ /** True when `text` is a prefix; `expand` recomputes the rest on demand. */
16
+ readonly truncated?: boolean;
17
+ /** Computes the expanded text on first use; only present when requested. */
18
+ readonly expand?: () => string;
19
+ };
20
+ export type SectionsOptions = {
21
+ /** False when HTTP body capture is disabled; adds an explanatory hint. */
22
+ readonly httpEnabled?: boolean;
23
+ /**
24
+ * Make truncated sections expandable. The expanded text is not built until
25
+ * the viewer calls `expand`, so a large request does not pay for it on open.
26
+ */
27
+ readonly full?: boolean;
28
+ };
29
+ export type JsonTokenKind = "key" | "string" | "number" | "boolean" | "null" | "punctuation" | "plain";
30
+ export type JsonToken = {
31
+ readonly text: string;
32
+ readonly kind: JsonTokenKind;
33
+ };
34
+ /** Split a metadata line into its key and the part after the first colon. */
35
+ export declare function splitKeyValueLine(line: string): {
36
+ key: string;
37
+ value: string;
38
+ } | null;
39
+ /**
40
+ * Best-effort JSON tokenizer. It deliberately does not require the whole text
41
+ * to parse: a record can be capped with `[truncated]`, and a body can be a
42
+ * fragment. Every input character is preserved, only its kind is classified.
43
+ */
44
+ export declare function tokenizeJson(text: string): JsonToken[];
45
+ export declare function formatBytes(bytes: number): string;
46
+ export declare function formatTime(at: string | null): string;
47
+ export declare function modelLabel(model: ModelRef | null): string;
48
+ /** Display-only text from an untrusted field. */
49
+ export declare function displayText(value: string | null | undefined, limit?: number): string;
50
+ /** One terminal row: never let a list entry wrap into the next record. */
51
+ export declare function fitText(text: string, width: number): string;
52
+ export declare function entryLine(entry: LogSummary): string;
53
+ export declare function entryTitle(entry: LogSummary): string;
54
+ /** A stable identity for a summary row across refreshes and pages. */
55
+ export declare function summaryKey(entry: LogSummary): string;
56
+ /**
57
+ * Merge a refreshed page into the rows already loaded. Pages are ordered by
58
+ * cursor and deduplicated by key: refreshing keeps older pages loaded while the
59
+ * newest requests are prepended.
60
+ */
61
+ export declare function mergeSummaries(current: readonly LogSummary[], incoming: readonly LogSummary[], limit?: number): readonly LogSummary[];
62
+ /**
63
+ * Expand every section that carries an `expand` callback. The desktop
64
+ * "Load complete entry" uses this so the 16 KB previews are replaced as soon
65
+ * as the full request has arrived.
66
+ */
67
+ export declare function expandAllSections(sections: readonly Section[]): {
68
+ readonly expanded: ReadonlySet<number>;
69
+ readonly texts: Record<number, string>;
70
+ };
71
+ /**
72
+ * Structured sections for one record. The text is sanitized before it leaves
73
+ * this module; the tone and language only describe how the renderers paint it.
74
+ * JSON and key/value bodies are tokenized by the caller.
75
+ */
76
+ export declare function sectionsFor(record: unknown, limit?: number, options?: SectionsOptions): Section[];