@arnilo/prism 0.0.8 → 0.0.11

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.
Files changed (62) hide show
  1. package/CHANGELOG.md +44 -3
  2. package/dist/agent-loops.d.ts +1 -0
  3. package/dist/agent-loops.js +44 -5
  4. package/dist/agents.js +141 -7
  5. package/dist/context-budget.d.ts +63 -0
  6. package/dist/context-budget.js +235 -0
  7. package/dist/contracts.d.ts +107 -0
  8. package/dist/contracts.js +77 -0
  9. package/dist/index.d.ts +7 -5
  10. package/dist/index.js +5 -4
  11. package/dist/input.d.ts +3 -0
  12. package/dist/input.js +71 -28
  13. package/dist/node/session-store-jsonl.js +4 -1
  14. package/dist/provider-events.d.ts +2 -0
  15. package/dist/provider-events.js +21 -13
  16. package/dist/providers/openai-compatible.js +8 -5
  17. package/dist/providers/transport.d.ts +10 -1
  18. package/dist/providers/transport.js +24 -8
  19. package/dist/rpc.js +13 -2
  20. package/dist/session-stores.d.ts +7 -2
  21. package/dist/session-stores.js +174 -4
  22. package/dist/structured-output.d.ts +5 -1
  23. package/dist/structured-output.js +18 -0
  24. package/dist/testing/persistence-schema.d.ts +1 -1
  25. package/dist/testing/persistence-schema.js +8 -2
  26. package/dist/testing/session-store-conformance.d.ts +6 -0
  27. package/dist/testing/session-store-conformance.js +36 -1
  28. package/dist/tools.js +2 -0
  29. package/docs/agent-events.md +3 -2
  30. package/docs/agent-loops.md +10 -3
  31. package/docs/agent-session-runtime.md +5 -1
  32. package/docs/browser-automation.md +124 -0
  33. package/docs/cli-rpc.md +2 -1
  34. package/docs/coding-agent-tools.md +178 -14
  35. package/docs/coding-security.md +84 -11
  36. package/docs/evaluations.md +13 -2
  37. package/docs/guardrails.md +2 -1
  38. package/docs/host-security.md +4 -2
  39. package/docs/index.md +19 -15
  40. package/docs/input-and-prompt-assembly.md +4 -1
  41. package/docs/migration.md +84 -0
  42. package/docs/node-jsonl-session-store.md +1 -1
  43. package/docs/performance.md +46 -0
  44. package/docs/postgres-persistence.md +3 -3
  45. package/docs/provider-conformance.md +1 -1
  46. package/docs/provider-packages.md +1 -1
  47. package/docs/provider-primitives.md +7 -1
  48. package/docs/providers/anthropic.md +92 -0
  49. package/docs/providers/google.md +87 -0
  50. package/docs/public-contracts.md +4 -0
  51. package/docs/release-and-install.md +197 -64
  52. package/docs/review-coverage-2026-07-20-phase-4.md +175 -0
  53. package/docs/review-coverage-2026-07-21-phase-5.md +172 -0
  54. package/docs/review-coverage-2026-07-22-phase-6.md +209 -0
  55. package/docs/session-store-conformance.md +2 -0
  56. package/docs/session-stores.md +40 -1
  57. package/docs/sqlite-persistence.md +3 -3
  58. package/docs/structured-output.md +9 -3
  59. package/docs/tools.md +3 -0
  60. package/docs/web-tools.md +1 -1
  61. package/docs/workflows.md +3 -0
  62. package/package.json +6 -5
@@ -45,7 +45,7 @@ Helpers accept normal `AIProvider`, `ProviderRequest`, `ProviderEvent`, `Usage`,
45
45
  - `collectProviderEvents()` returns provider events in stream order.
46
46
  - `assertProviderStreamConforms()` returns collected events after verifying the stream ends with `done` or `error`, terminal events are last, and optional text/usage expectations match.
47
47
  - `assertAbortIsObserved()` passes an already-aborted signal and expects provider generation to reject. This is the supported timeout primitive; use a host abort controller or `RunOptions.signal` rather than deprecated provider-level `timeoutMs`.
48
- - `assertToolCallDeltasReconstruct()` rebuilds streamed `tool_call_delta` fragments into tool calls and validates expected id/name/arguments. The runtime uses the same reconstruction behavior before tool execution when a provider streams deltas.
48
+ - `assertToolCallDeltasReconstruct()` rebuilds streamed `tool_call_delta` fragments into tool calls and validates expected id/name/arguments. Malformed JSON with id+name present yields `argumentsError` (no throw); missing id/name throws typed `incomplete_delta`. The runtime uses the same reconstruction before tool execution when a provider streams deltas.
49
49
  - `assertUsageAccounting()` finds `usage` or `done.usage` and checks selected token fields including `cacheReadTokens` and `cacheWriteTokens`. This is the provider-neutral check for normalized cache read/write token extraction; every first-party provider package exercises it against server-specific fields (`cached_tokens`, `cache_read_input_tokens`, etc.).
50
50
  - `assertSerializedRequestCoversContent()` scans a serialized provider request body for primitive canaries from each Prism content block and fails if any supported block type is silently dropped. Provider-valid transcripts place assistant `tool_call` messages before matching role `tool` `tool_result` messages; runtime, cache-aware input layout, and observational-memory worker loops preserve that order before serialization.
51
51
  - `assertProviderOwnedHeadersWin()` compares captured request headers against the provider's authoritative owned header values and a caller-supplied header bag; it fails if any owned header (`authorization`, `content-type`, session/security headers) was overridden by caller headers, and also fails if a non-owned caller header was dropped. This is the provider-neutral check that caller `ProviderRequest.options.headers` cannot hijack provider credentials or sessions; every first-party provider package exercises it.
@@ -67,7 +67,7 @@ Phase 6 also adds optional [`@arnilo/prism-provider-ai-sdk`](providers/ai-sdk.md
67
67
 
68
68
  Provider live tests are real smoke tests gated by `PRISM_LIVE_PROVIDER_TESTS=1` plus the provider-specific API key (`OPENAI_API_KEY`, `OPENROUTER_API_KEY`, `KIMI_API_KEY`, `ZAI_API_KEY`, `NEURALWATT_API_KEY`, or `OPENCODE_API_KEY`). They cover text generation, tool-call loop behavior, abort/error paths where supported, and no-secret-leak assertions; they skip by default and never run in release verification.
69
69
 
70
- These workspaces still follow the same rule as external packages: no provider SDK dependency, catalog fetch, env scan, keychain/file credential lookup, shell auth command, OAuth login, or live provider call runs by default. `@arnilo/prism-provider-openai` now registers OpenAI Responses and OpenAI Codex providers from caller-supplied credentials only, with optional `models`/`codexModels` overrides and an opt-in `listOpenAIModels()` helper for official `GET /models` discovery. `@arnilo/prism-provider-opencode-go` now registers docs-verified OpenCode Go open coding models with dual OpenAI/Anthropic routes (`compat.route`), official default base `https://opencode.ai/zen/go/v1`, `reasoning_content`/thinking preserve, and an opt-in `listOpenCodeGoModels()` helper for official `GET /zen/go/v1/models`. `@arnilo/prism-provider-openrouter` now registers an app-controlled OpenRouter catalog with routing/`reasoning`/cache passthrough, assistant `reasoning` replay, optional top-level automatic `cache_control`, and an opt-in `listOpenRouterModels()` helper for official `GET /api/v1/models` (setup still never fetches). `@arnilo/prism-provider-zai` now registers featured GLM-5.x/4.x metadata with official `thinking`/`reasoning_effort`/`tool_stream`/`clear_thinking` mapping, Preserved Thinking `reasoning_content` replay, implicit context caching, and an opt-in `listZaiModels()` helper for OpenAI-compatible `GET /models`. `@arnilo/prism-provider-kimi` now registers Kimi Coding Anthropic-compatible behavior by default, optional callable Moonshot Open Platform Chat Completions when `includeMoonshotModels` is requested, official Coding/Open Platform featured ids, thinking/`reasoning_effort` compat mapping, and an opt-in `listKimiModels()` helper for Moonshot `GET /v1/models`. `@arnilo/prism-provider-neuralwatt` now registers static featured model metadata with NeuralWatt reasoning_effort/thinking_token_budget/chat_template_kwargs request mapping, SSE comment tolerance, an opt-in `listNeuralWattModels()` helper for explicit `/v1/models` discovery, `getNeuralWattQuota()` for on-demand account balance/usage/energy, `neuralWattEventsWithTelemetry()`/`mapNeuralWattTelemetry()` for `: energy`/`: cost` telemetry, and `classifyNeuralWattError()` for retry classification. None of these helpers run during package setup or generation.
70
+ These workspaces still follow the same rule as external packages: no provider SDK dependency, catalog fetch, env scan, keychain/file credential lookup, shell auth command, OAuth login, or live provider call runs by default. `@arnilo/prism-provider-openai` now registers OpenAI Responses and OpenAI Codex providers from caller-supplied credentials only, with optional `models`/`codexModels` overrides and an opt-in `listOpenAIModels()` helper for official `GET /models` discovery. `@arnilo/prism-provider-opencode-go` now registers docs-verified OpenCode Go open coding models with dual OpenAI/Anthropic routes (`compat.route`), official default base `https://opencode.ai/zen/go/v1`, `reasoning_content`/thinking preserve, and an opt-in `listOpenCodeGoModels()` helper for official `GET /zen/go/v1/models`. `@arnilo/prism-provider-openrouter` now registers an app-controlled OpenRouter catalog with routing/`reasoning`/cache passthrough, assistant `reasoning` replay, optional top-level automatic `cache_control`, and an opt-in `listOpenRouterModels()` helper for official `GET /api/v1/models` (setup still never fetches). `@arnilo/prism-provider-zai` now registers featured GLM-5.x/4.x metadata with official `thinking`/`reasoning_effort`/`tool_stream`/`clear_thinking` mapping, Preserved Thinking `reasoning_content` replay, implicit context caching, and an opt-in `listZaiModels()` helper for OpenAI-compatible `GET /models`. `@arnilo/prism-provider-kimi` now registers Kimi Coding Anthropic-compatible behavior by default, optional callable Moonshot Open Platform Chat Completions when `includeMoonshotModels` is requested, official Coding/Open Platform featured ids, thinking/`reasoning_effort` compat mapping, and an opt-in `listKimiModels()` helper for Moonshot `GET /v1/models`. `@arnilo/prism-provider-neuralwatt` now registers static featured model metadata with NeuralWatt reasoning_effort/thinking_token_budget/chat_template_kwargs request mapping, SSE comment tolerance, an opt-in `listNeuralWattModels()` helper for explicit `/v1/models` discovery, `getNeuralWattQuota()` for on-demand account balance/usage/energy, `neuralWattEventsWithTelemetry()`/`mapNeuralWattTelemetry()` for `: energy`/`: cost` telemetry, and `classifyNeuralWattError()` for retry classification. None of these helpers run during package setup or generation. `@arnilo/prism-provider-anthropic` registers native Anthropic Messages (`createAnthropicProviderPackage` / `listAnthropicModels`). `@arnilo/prism-provider-google` registers native Gemini `generateContent` streaming (`createGoogleProviderPackage` / `listGoogleModels`; Vertex identity deferred). Both follow the same zero-setup-network / host-owned credential / provider-owned-header rules; see [`docs/providers/anthropic.md`](providers/anthropic.md) and [`docs/providers/google.md`](providers/google.md). `@arnilo/prism-provider-anthropic` registers native Anthropic Messages (`createAnthropicProviderPackage` / `listAnthropicModels`). `@arnilo/prism-provider-google` registers native Gemini `generateContent` streaming (`createGoogleProviderPackage` / `listGoogleModels`; Vertex identity deferred). Both follow the same zero-setup-network / host-owned credential / provider-owned-header rules; see [`docs/providers/anthropic.md`](providers/anthropic.md) and [`docs/providers/google.md`](providers/google.md).
71
71
 
72
72
  ### First-party cache behavior
73
73
 
@@ -110,7 +110,7 @@ export interface SseEvent {
110
110
  }
111
111
 
112
112
  export class ProviderTransportError extends Error {
113
- readonly code: "sse_buffer_overflow" | "sse_event_overflow" | "response_body_overflow" | "aborted";
113
+ readonly code: "sse_buffer_overflow" | "sse_event_overflow" | "response_body_overflow" | "aborted" | "invalid_json_arguments" | "incomplete_delta";
114
114
  readonly limitBytes?: number;
115
115
  }
116
116
 
@@ -131,6 +131,12 @@ export function parseJsonObjectArguments(
131
131
  text: string,
132
132
  options?: { toolName?: string; maxBytes?: number },
133
133
  ): JsonObject;
134
+
135
+ /** Non-throwing variant for recoverable tool-call recovery; prefer with \`toolCallFromArgumentsText\`. */
136
+ export function tryParseJsonObjectArguments(
137
+ text: string,
138
+ options?: { toolName?: string; maxBytes?: number },
139
+ ): { ok: true; value: JsonObject } | { ok: false; error: ProviderTransportError };
134
140
  ```
135
141
 
136
142
  **Performance:** Single pass over chunks; retained memory is `O(min(buffer, maxBufferBytes))`, not `O(stream)`. No full-stream accumulation.
@@ -0,0 +1,92 @@
1
+ # Anthropic provider package
2
+
3
+ ## What it does
4
+
5
+ `@arnilo/prism-provider-anthropic` is the first-party Anthropic Messages provider for Prism (`POST /v1/messages`). Setup is side-effect-free: no network, env scan, or keychain lookup during import/setup. Wire format is package-local (OpenCode Go / Kimi Anthropic routes are pattern-only, not a shared core serializer).
6
+
7
+ ## When to use it
8
+
9
+ Use for native Claude Messages (tools, `cache_control`, thinking/reasoning, media, usage, abort). Prefer this over the AI SDK escape hatch when Anthropic is a primary coding host.
10
+
11
+ Do **not** use for OpenCode Go Anthropic *route* hosting (`@arnilo/prism-provider-opencode-go`) or automatic credential discovery.
12
+
13
+ ## Inputs / request
14
+
15
+ ```ts
16
+ import {
17
+ createAnthropicProviderPackage,
18
+ createAnthropicMessagesProvider,
19
+ listAnthropicModels,
20
+ defineAnthropicModel,
21
+ } from "@arnilo/prism-provider-anthropic";
22
+
23
+ createAnthropicProviderPackage(options?: AnthropicProviderPackageOptions): ProviderPackage
24
+ createAnthropicMessagesProvider(options?): AIProvider
25
+ listAnthropicModels(options?: ListAnthropicModelsOptions): Promise<ModelConfig[]>
26
+ ```
27
+
28
+ | Field | Type | Purpose |
29
+ | --- | --- | --- |
30
+ | `apiKey` | `CredentialValueSource` | Host-owned Anthropic API key (late-bound). |
31
+ | `fetch` | `typeof fetch` | Optional fetch for tests/hosts. |
32
+ | `baseUrl` | `string` | Override default `https://api.anthropic.com`. |
33
+ | `id` | `string` | Provider id (default `anthropic`). |
34
+ | `userAgent` | `string` | Optional User-Agent. |
35
+ | `models` | `readonly ModelConfig[]` | Override featured offline models. |
36
+
37
+ Featured offline aliases: `claude-opus-4-8`, `claude-sonnet-5`, `claude-haiku-4-5`, `claude-fable-5`. Caller-gated discovery: `listAnthropicModels()` — never during setup.
38
+
39
+ ## Outputs / response / events
40
+
41
+ | Surface | Behavior |
42
+ | --- | --- |
43
+ | Stream | Prism text, thinking deltas, tool-call delta/final, usage (incl. cache read/create when present), `done`, redacted `error`. |
44
+ | Cache | Featured models use `cache.kind: "cache_control"`; markers on selected breakpoints (`long` → `ttl: "1h"`). |
45
+ | Thinking | Model-family aware (`adaptive` vs `enabled`+`budget_tokens`); helpers `anthropicThinking` / `anthropicEffort` / `anthropicPreserveThinking`. |
46
+ | Auth | `api_key` for provider id; provider-owned `content-type`, `x-api-key`, `anthropic-version` win over caller headers. |
47
+
48
+ ## Request/response example
49
+
50
+ ```json
51
+ {
52
+ "model": "claude-sonnet-5",
53
+ "messages": [{ "role": "user", "content": [{ "type": "text", "text": "Hello" }] }],
54
+ "stream": true,
55
+ "max_tokens": 1024
56
+ }
57
+ ```
58
+
59
+ ## Implementation example
60
+
61
+ ```ts
62
+ import { createProviderRegistry, createModelRegistry } from "@arnilo/prism";
63
+ import { createAnthropicProviderPackage, listAnthropicModels } from "@arnilo/prism-provider-anthropic";
64
+
65
+ const api = /* ExtensionAPI or host registries */;
66
+ api.registerProviderPackage(createAnthropicProviderPackage({ apiKey: hostKey }));
67
+
68
+ // Optional: caller-gated catalog refresh
69
+ const models = await listAnthropicModels({ apiKey: hostKey });
70
+ api.registerProviderPackage(createAnthropicProviderPackage({ apiKey: hostKey, models }));
71
+ ```
72
+
73
+ ## Extension and configuration notes
74
+
75
+ - Register via `defineProviderPackage` / host registries; no package auto-discovery.
76
+ - AI SDK (`@arnilo/prism-provider-ai-sdk`) remains an escape hatch, not the primary Anthropic path.
77
+ - Live smoke: `PRISM_LIVE_PROVIDER_TESTS=1` + `ANTHROPIC_API_KEY`.
78
+
79
+ ## Security and performance notes
80
+
81
+ - No network during import/setup/default tests; credentials host-owned and late-bound.
82
+ - Provider-owned auth headers cannot be overridden by caller headers.
83
+ - Media/SSRF bounds reuse `@arnilo/prism/providers/media` / transport helpers.
84
+ - Offline conformance: `@arnilo/prism/testing/provider-conformance`.
85
+
86
+ ## Related APIs
87
+
88
+ - [Provider packages](../provider-packages.md): package setup + discovery contract.
89
+ - [Provider caching](../provider-caching.md): `cache_control` breakpoints.
90
+ - [Thinking and reasoning](../thinking-and-reasoning.md): portable thinking helpers.
91
+ - [Provider conformance](../provider-conformance.md): network-free assertions.
92
+ - Package README: [`packages/provider-anthropic/README.md`](../../packages/provider-anthropic/README.md)
@@ -0,0 +1,87 @@
1
+ # Google provider package
2
+
3
+ ## What it does
4
+
5
+ `@arnilo/prism-provider-google` is the first-party Gemini `generateContent` / `streamGenerateContent` provider for Prism (`POST /v1beta/models/{model}:streamGenerateContent?alt=sse`). Setup is side-effect-free: no network, env scan, or keychain lookup during import/setup. Uses native `fetch` + SSE — no `@google/genai` runtime dependency.
6
+
7
+ ## When to use it
8
+
9
+ Use for first-party Gemini Developer API coding-host semantics (function calling, multimodal `inlineData`, thinking, usage, abort). Prefer this over the AI SDK escape hatch when Gemini is a primary host.
10
+
11
+ Do **not** use for Vertex enterprise identity (deferred to 0.0.13+) or as a substitute for Anthropic Messages.
12
+
13
+ ## Inputs / request
14
+
15
+ ```ts
16
+ import {
17
+ createGoogleProviderPackage,
18
+ createGoogleGenerateContentProvider,
19
+ listGoogleModels,
20
+ defineGoogleModel,
21
+ } from "@arnilo/prism-provider-google";
22
+
23
+ createGoogleProviderPackage(options?: GoogleProviderPackageOptions): ProviderPackage
24
+ createGoogleGenerateContentProvider(options?): AIProvider
25
+ listGoogleModels(options?: ListGoogleModelsOptions): Promise<ModelConfig[]>
26
+ ```
27
+
28
+ | Field | Type | Purpose |
29
+ | --- | --- | --- |
30
+ | `apiKey` | `CredentialValueSource` | Host-owned Google/Gemini API key (late-bound). |
31
+ | `fetch` | `typeof fetch` | Optional fetch for tests/hosts. |
32
+ | `baseUrl` | `string` | Override default Gemini REST base. |
33
+ | `id` | `string` | Provider id (default `google`). |
34
+ | `userAgent` | `string` | Optional User-Agent. |
35
+ | `models` | `readonly ModelConfig[]` | Override featured offline models. |
36
+
37
+ Featured offline aliases include `gemini-2.5-pro`, `gemini-2.5-flash`, `gemini-2.5-flash-lite`, and `gemini-3.5-flash` (see package README for the live curated list). Caller-gated discovery: `listGoogleModels()` — never during setup. Model ids may arrive prefixed with `models/`; Prism strips the prefix.
38
+
39
+ ## Outputs / response / events
40
+
41
+ | Surface | Behavior |
42
+ | --- | --- |
43
+ | Stream | Prism text, thinking when present, **complete** `tool_call` events (Gemini does not stream argument deltas), usage, `done`, redacted `error`. |
44
+ | Cache | No Anthropic-style `cache_control`; Gemini implicit caching is not exposed as Prism breakpoints in 0.0.11. |
45
+ | Multimodal | `inlineData` parts with MIME + base64; capability checks fail closed for unsupported modalities. |
46
+ | Auth | `api_key`; provider-owned `content-type` + `x-goog-api-key` win over caller headers. |
47
+
48
+ ## Request/response example
49
+
50
+ ```json
51
+ {
52
+ "contents": [{ "role": "user", "parts": [{ "text": "Hello" }] }],
53
+ "tools": [{ "functionDeclarations": [{ "name": "lookup", "parameters": { "type": "object" } }] }]
54
+ }
55
+ ```
56
+
57
+ ## Implementation example
58
+
59
+ ```ts
60
+ import { createGoogleProviderPackage, listGoogleModels } from "@arnilo/prism-provider-google";
61
+
62
+ api.registerProviderPackage(createGoogleProviderPackage({ apiKey: hostKey }));
63
+
64
+ const models = await listGoogleModels({ apiKey: hostKey });
65
+ api.registerProviderPackage(createGoogleProviderPackage({ apiKey: hostKey, models }));
66
+ ```
67
+
68
+ ## Extension and configuration notes
69
+
70
+ - Register via `defineProviderPackage` / host registries; no package auto-discovery.
71
+ - AI SDK remains an escape hatch, not the primary Google path.
72
+ - Live smoke: `PRISM_LIVE_PROVIDER_TESTS=1` + `GOOGLE_API_KEY` or `GEMINI_API_KEY`.
73
+ - Vertex / enterprise identity stays out of 0.0.11.
74
+
75
+ ## Security and performance notes
76
+
77
+ - No network during import/setup/default tests; credentials host-owned and late-bound.
78
+ - Provider-owned auth headers cannot be overridden by caller headers.
79
+ - Media bounds reuse shared provider media helpers; tool args arrive complete per chunk (no partial JSON reconstruction required).
80
+ - Offline conformance: `@arnilo/prism/testing/provider-conformance`.
81
+
82
+ ## Related APIs
83
+
84
+ - [Provider packages](../provider-packages.md): package setup + discovery contract.
85
+ - [Thinking and reasoning](../thinking-and-reasoning.md): portable thinking helpers.
86
+ - [Provider conformance](../provider-conformance.md): network-free assertions.
87
+ - Package README: [`packages/provider-google/README.md`](../../packages/provider-google/README.md)
@@ -151,6 +151,10 @@ Important request shapes:
151
151
  | `PersistenceQuery` | Common pagination controls: `cursor?`, `limit?`, `order?: "asc" \| "desc"`. |
152
152
  | `OwnershipScope` | Multi-tenant scope: `tenantId?`, `accountId?`, `userId?`. Included in records and queries. |
153
153
  | `SessionRecord` / `SessionQuery` | Stored session and query filters (parent, agent definition, retention policy, timestamps, ownership). |
154
+ | `SessionIndex` / `SessionSearchQuery` / `SessionSearchHit` | Bounded optional session search seam (`search` / `SessionStore.searchSessions?`). Filters: workspace (`metadata.workspaceRoot`), time, provider/model, label/summary, optional FTS `query`, ownership. Hits return `sessionId` + optional `leafId` for resume; never credentials. Caps via `resolveSessionSearchQuery` / `DEFAULT_*` / `HARD_MAX_*` session-search constants. |
155
+ | `contextBudget` / `getContextBudgetReport` / `ContextBudgetError` | Opt-in assembler budget on `AssembleProviderInputOptions`; deterministic eviction; omission report in `ProviderRequest.metadata` (kinds/ids/sizes only). |
156
+ | `AgentSession.steer` / `SteerOptions` / pending-steer caps | Mid-run enqueue into active run; optional `softInterrupt`; default 8 msgs / 64 KiB UTF-8. |
157
+ | `SessionSearchUnsupportedError` / `sessionSearchMode` | Memory opt-out + JSONL; typed throw (not empty success). |
154
158
  | `BranchRecord` / `BranchQuery` | Branch handle/leaf pointer and query filters (session, name, parent branch, leaf presence). |
155
159
  | `SessionEntryQuery` | Paginated entry filters: `sessionId`, `runId`, `parentId`, `leafId`, `kind`, timestamp range, ownership. |
156
160
  | `RunRecord` / `RunQuery` | Stored run and filters: session, branch, status, timestamps, ownership. |