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,14 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/rpc.ts", "../src/core.ts", "../src/settings.ts", "../src/log/limits.ts", "../src/rpc-client.ts"],
4
+ "sourcesContent": [
5
+ "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",
6
+ "/** 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",
7
+ "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",
8
+ "/** 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",
9
+ "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"
10
+ ],
11
+ "mappings": ";;AAAA;;;ACCO,IAAM,sBAAsB,MAAM,OAAO;AAGzC,IAAM,gBAAgB,CAAC,WAAW,cAAc,YAAY,OAAO;;;ACkBnE,IAAM,eAAe;AAGrB,IAAM,2BAA2B,IAAI,OAAO,OAAO;AACnD,IAAM,8BAA8B;AACpC,IAAM,kCAAkC;AACxC,IAAM,yBAAyB;AAE/B,IAAM,mBAA6B;AAAA,EACxC,SAAS;AAAA,EACT,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,qBAAqB;AAAA,EACrB,sBAAsB;AAAA,EACtB,WAAW;AAAA,EACX,aAAa;AACf;AAGO,SAAS,eAAe,GAAa;AAAA,EAC1C,OAAO,KAAK,iBAAiB;AAAA;AAG/B,SAAS,QAAQ,CAAC,OAAkD;AAAA,EAClE,OAAO,UAAU,QAAQ,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK;AAAA;AAG5E,SAAS,gBAAgB,CAAC,OAAgB,KAA8B;AAAA,EACtE,OACE,OAAO,UAAU,YACjB,OAAO,SAAS,KAAK,KACrB,SAAS,KACT,KAAK,MAAM,KAAK,MAAM,SACtB,SAAS;AAAA;AAIb,SAAS,cAAc,CAAC,OAAgB,KAAa,UAA0B;AAAA,EAC7E,IAAI,OAAO,UAAU,YAAY,CAAC,OAAO,SAAS,KAAK,KAAK,QAAQ;AAAA,IAAG,OAAO;AAAA,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