@jskit-ai/agent-docs 0.1.207 → 0.1.209

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 (35) hide show
  1. package/guide/agent/app-extras/assistant-conversation.md +543 -6
  2. package/guide/agent/app-extras/assistant-voice.md +16 -1
  3. package/guide/agent/app-extras/assistant.md +8 -0
  4. package/guide/agent/framework/application-operations.md +29 -0
  5. package/guide/agent/framework/crud-operations.md +100 -0
  6. package/package.json +1 -1
  7. package/patterns/feature-package/example/booking-engine/package.json +1 -1
  8. package/patterns/minimal-foundation/example/package.json +4 -4
  9. package/patterns/server-search.md +16 -0
  10. package/patterns/shell-foundation/example/package.json +5 -5
  11. package/patterns/shell-foundation/example/packages/main/package.json +1 -1
  12. package/patterns/ui-testing.md +13 -0
  13. package/reference/autogen/PATTERN_INDEX.md +35 -35
  14. package/reference/autogen/packages/assistant-core.md +33 -10
  15. package/reference/autogen/packages/assistant-runtime.md +3 -2
  16. package/reference/autogen/packages/assistant-voice-sherpa.md +1 -0
  17. package/reference/autogen/packages/assistant-voice.md +1 -0
  18. package/reference/autogen/packages/shell-web.md +15 -0
  19. package/skills/jskit/SKILL.md +20 -7
  20. package/skills/jskit/references/app-operations.md +29 -0
  21. package/skills/jskit/references/crud-operations.md +100 -0
  22. package/skills/jskit/references/pattern-index.md +35 -35
  23. package/skills/jskit/references/patterns/app/minimal-foundation/example/package.json +4 -4
  24. package/skills/jskit/references/patterns/app/shell-foundation/example/package.json +5 -5
  25. package/skills/jskit/references/patterns/app/shell-foundation/example/packages/main/package.json +1 -1
  26. package/skills/jskit/references/patterns/auth/supabase-auth/example/package.json +1 -1
  27. package/skills/jskit/references/patterns/connectors/calendar-cli/example/package.json +4 -4
  28. package/skills/jskit/references/patterns/crud/json-api-resource-package/PATTERN.md +33 -0
  29. package/skills/jskit/references/patterns/crud/json-api-resource-package/example/packages/books/package.json +2 -2
  30. package/skills/jskit/references/patterns/database/mysql-application/example/package.json +1 -1
  31. package/skills/jskit/references/patterns/database/postgres-application/example/package.json +1 -1
  32. package/skills/jskit/references/patterns/realtime/realtime-application/example/package.json +2 -2
  33. package/skills/jskit/references/patterns/server/feature-package/example/booking-engine/package.json +1 -1
  34. package/skills/jskit/references/patterns/users/user-administration-server/example/packages/users/package.json +2 -2
  35. package/skills/jskit/references/patterns/users/user-administration-server/example/packages/users-workspace/package.json +3 -3
@@ -282,6 +282,12 @@ latest bounded page; **Load older messages** is available again where older hist
282
282
  Reconnection reads state and does not resend the request. After an initial
283
283
  subscription failure or timeout, **Reload** retries that exact subscription on
284
284
  the connected socket with fresh authorization; it does not resend a message.
285
+ When a product selection changes the native observer behind the same logical
286
+ conversation ID, call the retained runtime’s `reload({ resubscribe: true })` from
287
+ that product’s authorized selection invalidation. It reuses the same subscription
288
+ ID and existing epoch/release guards to attach the current owner, retaining loaded
289
+ history, the draft and delivery receipts. It does not select an assistant or resend
290
+ work; ordinary `reload()` still refreshes canonical history.
285
291
 
286
292
  Applications that create nonvisual tasks after setup can capture
287
293
  `useAssistantConversationFactory(commonOptions)` once during setup, then call
@@ -381,6 +387,15 @@ this code only when the original turn is absent or finished before dispatch.
381
387
  Transport and provider failures without that proof remain uncertain and require
382
388
  receipt inspection; an HTTP 409 alone is not proof of rejection.
383
389
 
390
+ At an application's known pre-admission boundary, a structured HTTP client error
391
+ may carry `details.delivery: { status: "not-sent", messageId }`. The binding accepts
392
+ only an exact current message ID and a 4xx HTTP error; it retains the original
393
+ error and failed request for manual Retry with the same captured payload. Hosts
394
+ must attach this fact before any routing/native dispatch, preserve error
395
+ sanitization and never derive it from missing history. Mismatched metadata,
396
+ server/transport failures and unknown inspection stay uncertain. This response
397
+ fact cannot repair an older saved uncertain request or grant actor access.
398
+
384
399
  When `draftStorage` restores a page, known failed deliveries remain failed and
385
400
  accepted receipts remain accepted. Saved uncertain, pending or unrecognised
386
401
  delivery states stay uncertain with the exact original ID, payload and draft;
@@ -412,6 +427,29 @@ false and belongs to the initial retained conversation composition. It adds no
412
427
  server queue or persisted queue recovery; genuine uncertainty still blocks new
413
428
  submissions and requires receipt inspection.
414
429
 
430
+ An application that already owns a queue accepting messages during active work
431
+ may instead set `admitWhileWorking: true`. Ordinary nonsteerable typed and retained
432
+ voice messages then reach that application's API while the conversation reports
433
+ working. The existing serial delivery queue waits for each real admission receipt,
434
+ not for a ready snapshot. Message IDs and captured data remain distinct; this
435
+ option neither cancels active work nor supplies a server queue or native steering.
436
+ Stop, actor retirement, denied access and uncertain-delivery guards still apply.
437
+ It defaults to false, belongs to the initial retained composition, and cannot be
438
+ combined with `deferWhileWorking: true`. The application must authorize and save
439
+ each request before returning acceptance; enabling this option alone is not a
440
+ backend queue implementation.
441
+
442
+ Both `deferWhileWorking` and `admitWhileWorking` also accept a synchronous
443
+ predicate receiving the actual conversation snapshot, or `null` before its first
444
+ read. Return a boolean for every snapshot, including `null`; promises and other
445
+ results are rejected. The two resolved options must never both be true. This
446
+ lets one retained binding choose its working policy from the actual backend,
447
+ without changing message IDs, captured data or native steering intent. A queued
448
+ application-admission follower rechecks the current policy at the serial delivery
449
+ tail before dispatch; if admission is no longer enabled, it returns `false`
450
+ without calling the API. Deferred requests still wait for ready. The existing
451
+ Stop, actor, access and uncertain-delivery guards remain in force.
452
+
415
453
  Set `draftWhileLoading: true` when people should be able to type before the
416
454
  application resolves its conversation ID or while the first read is unavailable.
417
455
  This keeps one local input scoped to the real actor, endpoint, surface and
@@ -885,6 +923,19 @@ slot, the text-only layout has no avatar region or visibility control and requir
885
923
  voice package or speech service. The application supplies artwork and any
886
924
  animation; the element does not acquire audio or another conversation.
887
925
 
926
+ While the transcript has an `error`, the avatar and its controls temporarily
927
+ occupy space above the transcript instead of floating over the warning. This
928
+ keeps the warning text and **Reload chat** reachable at narrow widths, including
929
+ with hidden artwork and retained controls. The warning stacks its text and
930
+ recovery button. The loaded message body and draft remain mounted; this layout
931
+ temporarily leaves less height for history. Clearing the error restores the
932
+ floating layout without changing the requested avatar size.
933
+
934
+ The error row reserves its full text and recovery-button height. If a short
935
+ conversation cannot fit the avatar, warning and composer together, the error
936
+ layout scrolls vertically to keep those controls reachable; the retained message
937
+ body keeps its separate scroll owner. Normal layout returns when the error clears.
938
+
888
939
  ```vue
889
940
  <AssistantConversationElement :adapter="adapter" v-model:avatar-size="avatarSize">
890
941
  <template #avatar><SupportAvatar /></template>
@@ -1392,6 +1443,23 @@ conversations in one runtime can use different hosts. An open handle rejects a
1392
1443
  second, conflicting host; native bindings also validate their saved worktree and
1393
1444
  credential scope on reopen. Environment values are not persisted.
1394
1445
 
1446
+ Claude's original scoped native history may live in the authorized credential
1447
+ HOME while its logical conversation belongs to a private host workdir. Such a
1448
+ server-owned binding retains the physical path in `workdir` and the logical path
1449
+ in `scopeWorkdir`. Reopening validates both against the current host's real paths,
1450
+ and retains the same native UUID and account checks. Ordinary bindings without
1451
+ `scopeWorkdir` keep their existing workdir validation. This does not import legacy
1452
+ records, change account fingerprints or authorize a browser-supplied native path;
1453
+ historical conversion belongs to the application's stopped state-upgrade owner.
1454
+
1455
+ The existing `server/claude-history` reader accepts `allowIncompleteTail: false`
1456
+ for stopped maintenance that must reject a partial final JSON frame. Its default
1457
+ remains true for live observation. `claudeHistoryPath` and the unambiguous inventory
1458
+ are existing native-history facilities, not browser path authority. The conversation
1459
+ module exposes the existing `conversationHistoryVersions` cursor mapping so an
1460
+ application-owned offline conversion can reuse canonical identity/version rules.
1461
+ These pure/read-only facilities neither grant access nor resume or replay work.
1462
+
1395
1463
  An existing application using the extracted Codex owner can supply
1396
1464
  `host.conversation({ id, context })` to bind its original transcript, native
1397
1465
  identity, delivery journal and lifecycle facilities. That bound path uses those
@@ -1408,6 +1476,13 @@ validation and authorization of these facts; data does not supply tool authority
1408
1476
  actor identity or a delivery receipt. Unconfigured messages retain their existing
1409
1477
  record shape.
1410
1478
 
1479
+ The existing `conversationRequestText({ text, origin, data })` renderer is exported
1480
+ from `@jskit-ai/assistant-core/server/conversation`. A bound host that owns native
1481
+ input preparation can use it to retain the same application-data envelope around
1482
+ its prepared prompt. Supply only validated current-request data; keep canonical
1483
+ display words and server-only admission separate. This renderer grants no tool
1484
+ authority and does not replace the actual accepted message/native identity guards.
1485
+
1411
1486
  A server-owned bound conversation can opt into common application-tool setup
1412
1487
  with `applicationTools: { storage, prepareContext }`, alongside the runtime's
1413
1488
  existing `actions`/`toolPolicy` or `toolCatalog`. `storage` must be the original
@@ -1444,6 +1519,15 @@ actor/resource checks or native thread check, and it is not serialized. Hosts
1444
1519
  choose this check explicitly; the generic runtime still preserves originating
1445
1520
  contexts for already invoked actions and saved-result recovery.
1446
1521
 
1522
+ Bound native admissions also expose `assertCompletionCurrent()` for the host's
1523
+ original final-settlement callback. It requires a finishing native request and
1524
+ retains cancellation, accepted-message, binding and segment ownership after
1525
+ live tools finish. A newer accepted request retires that receipt even after the
1526
+ newer request settles; rejected input does not replace it. The host must still
1527
+ freshly authorize access and verify its exact current inactive native turn and
1528
+ original final result immediately before binding that output. This assertion
1529
+ does not authorize tool effects or replace `assertCurrent()`.
1530
+
1447
1531
  For an opted-in bound Codex conversation, the common driver installs the same
1448
1532
  application-tool schemas and executor used by its standalone path. The original
1449
1533
  message preparation passes them to `ensureCodexAppServerThread()` before native
@@ -1465,6 +1549,17 @@ executor or observation failure uses the original thread's interrupt and drain.
1465
1549
  Helper authentication refresh and isolated Helper request refusal retain their
1466
1550
  original precedence.
1467
1551
 
1552
+ For managed providers, the existing preparation's `runInContext(operation)` is
1553
+ also retained by each registered thread handler. The host supplies an admitted
1554
+ observation/control context that remains valid after the socket-opening callback
1555
+ returns; it must not retain a temporary write grant. A directly constructed
1556
+ `CodexAppServerAgentProvider` can receive the same optional `runInContext` in its
1557
+ options. Without it, callbacks retain their existing direct execution. This
1558
+ context re-entry does not authorize effects: the original request's tool
1559
+ authorization and `prepareContext` still recheck current actor, resource and
1560
+ native-turn authority. Socket dispatch, account refresh and peer threads retain
1561
+ their existing owners.
1562
+
1468
1563
  The host still owns exact write authorization, readiness composition and native
1469
1564
  identity persistence. This shared prerequisite does not establish a particular
1470
1565
  application's integration, installed acceptance or real native acceptance.
@@ -1625,6 +1720,20 @@ corrections are included, even outside the recent-history window; if they exceed
1625
1720
  with a briefing. Nothing is silently dropped. The application remains responsible
1626
1721
  for authorizing edits to its transcript.
1627
1722
 
1723
+ Fresh native history uses up to 30 recent messages by default, without a
1724
+ per-message text cap. A consumer with an established shorter seed can set
1725
+ server-owned `limits.maxInitialNativeHistoryMessages` to a non-negative integer and
1726
+ `limits.maxInitialNativeHistoryMessageCharacters` to a positive integer. A configured
1727
+ message window includes the current authored user message at the single-request
1728
+ boundary: a window of 24 supplies up to 23 prior messages for a user request and
1729
+ 24 for an application wake. A zero effective allowance supplies no prior messages.
1730
+ The default, unconfigured window still supplies up to 30 prior messages. These
1731
+ limits apply only to a fresh native context's quoted history. They do not shorten
1732
+ the current user input, edit stored messages or their delivery fingerprints, or
1733
+ truncate a returning engine's missed/edited messages. Attachment references and
1734
+ removed-message identities retain their existing delivery ownership. The direct
1735
+ API's initial continuity policy is separate and is unchanged by these limits.
1736
+
1628
1737
  An application whose established selection policy creates a fresh native
1629
1738
  conversation can pass `retireNative: true` to `select()`. This uses the same
1630
1739
  selection transaction and allocates a new binding even for a compatible model
@@ -1662,8 +1771,9 @@ cleanup, retains the predecessor's native binding and installs the successor.
1662
1771
  The first native submission carries the saved briefing and bounded recent written
1663
1772
  history; later native turns do not repeat that history. The API driver supplies
1664
1773
  the same continuity with its subsequent request history. Visible user messages
1665
- remain exactly the submitted text. Carry-over includes up to 30 recent messages,
1666
- with each text bounded to 2,000 characters and truncation/omission marked. The
1774
+ remain exactly the submitted text. API carry-over includes up to 30 recent messages,
1775
+ with each text bounded to 2,000 characters and truncation/omission marked. Native
1776
+ initial history uses the consumer limits described above. The
1667
1777
  combined budget is `limits.maxContinuityCharacters` (128,000 by default); an
1668
1778
  oversized supplied briefing fails before changing the binding.
1669
1779
 
@@ -1681,6 +1791,24 @@ preflight without changing its saved state. Complete that operation with the
1681
1791
  previous release before upgrading; the runtime does not guess a new boundary.
1682
1792
  Application checkpoints and file restoration remain separate application actions.
1683
1793
 
1794
+ The pure `upgradeConversationRuntimeState({ metadata, conversationLog, retirement })`
1795
+ transform can accept an explicit Codex metadata retirement. The server-owned
1796
+ `retirement` object supplies string `operationId` and `successorSegmentId`, the exact
1797
+ `expectedSegmentId`, `expectedThreadId` and `expectedToolSchemaIdentity`, and trusted
1798
+ physical `workdir` and `configRoot` paths matching the saved binding. It retains the
1799
+ old predecessor and written history, and produces the same inert binding and
1800
+ seen/last-delivered reset as live fresh selection. Omission preserves the existing
1801
+ upgrade behavior; it never automatically retires an eligible-looking binding.
1802
+
1803
+ This is only a metadata transform. It does not stop native work, inspect goals,
1804
+ verify accounts or filesystem authorization, exclude concurrent writers, or publish
1805
+ state. The application must establish those facts through its existing owners
1806
+ before a separately approved stopped-service numbered upgrade. Pending current
1807
+ requests/replacements, mismatched identities, reused IDs and unsupported formats
1808
+ refuse without changing input. Verified BEFORE metadata and stable IDs produce
1809
+ the same output; applying the old tuple to AFTER refuses. Publication backups and
1810
+ retry remain the application's upgrade-owner responsibility, with no lazy repair.
1811
+
1684
1812
  The unreleased common runtime now validates its versioned metadata. Earlier local
1685
1813
  development records with an older runtime version fail with an explicit export/restart
1686
1814
  message; normal startup does not rewrite them. Consumer migration of published
@@ -1777,6 +1905,146 @@ share the configured input-size limit. A retry must retain the same data as well
1777
1905
  as the same message ID and text. Supply trusted authorization separately through
1778
1906
  the conversation context; this data never grants permissions.
1779
1907
 
1908
+ For an application that validates a complete native response before executing an
1909
+ action, server-owned `completedEnvelope: true` enables
1910
+ `prepareCompletedResponse({ messageId, turnId }, { signal, toolSet })` on the existing
1911
+ conversation handle. This requires a tool catalogue, runtime-owned canonical
1912
+ storage and a Codex, Claude or OpenCode driver. API, supplied and scoped native
1913
+ owners are rejected. The application worker's `AbortSignal` is required; the
1914
+ authenticated context comes from `open()`, never from the response or caller data.
1915
+
1916
+ An application worker that continues discovery across several completed responses
1917
+ may supply the same server-owned `toolSet` resolved by this runtime's catalogue.
1918
+ Retain it only for that worker's unchanged action-policy and focused-project scope;
1919
+ resolve a new set when either scope changes or a new worker starts. Omitting it
1920
+ resolves a fresh set for the prepared operation. This preserves loaded exact action
1921
+ contracts between responses without sharing their durable call receipts. The
1922
+ existing executor still rechecks current authorization and action availability;
1923
+ the set is neither caller input nor permission to execute a revoked action.
1924
+
1925
+ Only a newly reserved application `wake()` receives the internal turn marker.
1926
+ Ordinary user messages, goals, caller data and historical unmarked requests cannot
1927
+ acquire it through reopening, retry or inspection. Marked responses omit native
1928
+ application-tool registration; unmarked requests retain their existing tools.
1929
+ Codex preserves its native thread tool schema: changing between those two tool
1930
+ shapes on the same thread refuses before dispatch, without replacing the binding.
1931
+ Marked internal responses use the finite `limits.maxOutputCharacters` wire limit
1932
+ (64,000 by default) rather than the human `maxFinalReplyCharacters` limit. Set the
1933
+ wire allowance to fit the configured response schema, including JSON escaping.
1934
+ Live output and retained native recovery apply the same distinction. Codex also
1935
+ checks the exact saved marker, segment and native thread/turn before its canonical
1936
+ writer permits that allowance. Ordinary replies, goals and forged message data
1937
+ retain the human limit. The completed-envelope parser still enforces its decoded
1938
+ field bounds; this wire allowance grants neither tool nor publication authority.
1939
+
1940
+ Codex's canonical assistant, commentary and thinking writes resolve the existing
1941
+ native authorship before appending a marked application's response. Its exact
1942
+ private turn remains the target when the application has already saved newer human
1943
+ messages. Generated native message and output IDs stay intact; an explicit
1944
+ correction retains its original target. A verified marked request whose original
1945
+ row is absent refuses before appending, rather than using a newer human row.
1946
+ Ordinary unpinned transcript writes keep
1947
+ their existing latest-open-turn behavior. No new native receipt or history repair
1948
+ is inferred from a later human message.
1949
+
1950
+ Preparation requires the exact saved successful assistant response, current native
1951
+ binding and saved account fingerprint. Native input inspection verifies that
1952
+ association; it does not establish completion or rewrite an absent account identity.
1953
+ Claude structured output can coexist with separate native commentary, so its final
1954
+ canonical receipt is checked without requiring equal projected native text.
1955
+
1956
+ New marked Claude requests also record `nativeToolAttempt` through their original
1957
+ command owner. Its typed observation carries only the bounded logical tool name
1958
+ and actual authored-message/thread IDs; arguments and provider frames are neither
1959
+ published nor added to canonical metadata. The initial authorized catalogue uses
1960
+ its ordinary direct/discovery policy. Exact catalogue names and the Claude
1961
+ `mcp__application__` alias count; `StructuredOutput`, unrelated native tools and
1962
+ nested-agent frames do not. The receipt write is awaited before completion can
1963
+ be prepared. Callback write failures retain the original native interruption and
1964
+ error cause, rather than becoming presentation-only errors; an interrupted receipt
1965
+ cannot prepare an application effect.
1966
+
1967
+ Claude preparation returns that verified boolean as `nativeToolAttempt`, which
1968
+ the shared completed-response loop uses for its existing reply-only correction
1969
+ rule. An old marked reservation or response without boolean evidence refuses;
1970
+ reopening and delivery inspection do not infer a historical false value. The
1971
+ flag is part of the immutable prepared identity. Marked Claude responses cannot
1972
+ share a native steering turn with another marked response, an ordinary request
1973
+ or a goal message. This refusal applies before successor reservation, including
1974
+ a retained marked unconfirmed delivery. Ordinary-to-ordinary steering and other
1975
+ native owners retain their existing policies. Applications still own the pending
1976
+ queue needed to supersede completed responses without native steering.
1977
+
1978
+ The result contains `{ text, toolCallId, tools }`. Use that exact stable call ID
1979
+ with `tools.execute()` after validating the response. Execution rechecks authority
1980
+ and receipt ownership through the same conversation queue, then uses the existing
1981
+ catalogue and durable `applicationTools` records. Independently prepared handles
1982
+ reuse the same saved result; changed arguments conflict and unknown effects refuse.
1983
+ A failed result write retains the actual result for `retrySave()` without repeating
1984
+ inference or the action. Native completion remains distinct from an application's
1985
+ unconfirmed effect.
1986
+
1987
+ The prepared result also provides `publishReply({ turnId })` for a validated
1988
+ plain reply. Supply only the existing plain user/system turn ID selected by the
1989
+ application worker; caller text, credentials and acknowledgement fields are not
1990
+ accepted. The runtime decodes the exact saved response and rechecks current
1991
+ authority, native association, account and signal before publication. A tool
1992
+ envelope, Claude native application-tool misroute or existing action receipt
1993
+ cannot publish a reply.
1994
+
1995
+ The existing reentrant transcript transaction saves the decoded assistant
1996
+ message, its exact consumed assistant fingerprint and the internal receipt's
1997
+ `publishedReplyTurnId` together. It does not acknowledge the authored user turn
1998
+ or change its data. Independent handles and restart may reuse that same target
1999
+ and unchanged saved final; changed targets, edited/cleared text or unrelated
2000
+ existing content refuse. A failed write rolls back all three records and may
2001
+ retry without inference. Publication and application effects are mutually
2002
+ exclusive for the same receipt. This applies to future marked responses, with
2003
+ no historical backfill. The application retains queue, target selection and
2004
+ worker revocation ownership.
2005
+
2006
+ The existing transcript readers accept explicit server-side `{ presentation: true }`
2007
+ to omit newly marked internal application turns. Raw reads remain the default for
2008
+ receipt inspection and native preservation. Presentation pagination filters before
2009
+ selecting the page, so its counts and cursors describe the visible product turns.
2010
+ Caller data or JSON-looking text cannot mark a turn as internal.
2011
+
2012
+ Native continuity uses those same product rows for history versions and API
2013
+ briefings while retaining raw canonical envelopes in storage. An application
2014
+ coordinator can pass trusted top-level `completedEnvelope: true` and
2015
+ `excludedMessageIds` to the existing changeover `send()`: current-batch IDs are
2016
+ excluded only from rendered catch-up, after the original initial-history window
2017
+ is selected. The full product snapshot remains captured in the original pending
2018
+ record and becomes consumed only on actual native admission. An unknown delivery
2019
+ retry retains that exact snapshot and prepared input; it does not recapture a new
2020
+ batch or infer admission from caller data. Applications must still connect this
2021
+ private facility to their own queue, visible replies and observation adapter.
2022
+
2023
+ In the opted runtime, human `read()` and paged reads select this presentation
2024
+ view on the server. Queries cannot override it. Only marked private pending
2025
+ input and streams are hidden; status, phase and current errors still use raw
2026
+ current state, including while browsing old pages. Worker subscriptions retain
2027
+ raw completed and partial carriers with a trusted `completedEnvelope` scalar
2028
+ from the exact saved turn, current authored request or captured native stream
2029
+ association. Input data and incoming event marker fields cannot establish it.
2030
+ Applications must filter those raw carriers in their browser observation adapter.
2031
+
2032
+ `wake(input, { excludedMessageIds })` captures the private batch list outside
2033
+ message data in the original admission owner. The second argument is restricted
2034
+ to tracked runtime-owned native application wakes. Exact IDs are copied into the
2035
+ new pending reservation; changed same-ID retry lists and lists attached to a
2036
+ different unresolved request refuse. Old unmarked reservations gain no marker or
2037
+ list. The existing changeover receives this immutable capture; its original
2038
+ native admission remains the only consumption authority.
2039
+
2040
+ The application owns its worker generation and revocation through fresh `tool`
2041
+ authorization and the supplied signal. Generic `cancel()` drains the existing
2042
+ queue; it does not independently revoke every still-authorized prepared handle.
2043
+ Already invoked actions retain their original receipt while Stop drains them.
2044
+ This operation does not supply product queue policy or the browser observation
2045
+ adapter. Complete those application owners before enabling it in a consumer;
2046
+ never manufacture historical markers or completion receipts.
2047
+
1780
2048
  Saved turns distinguish complete, failed, cancelled and interrupted work. Error
1781
2049
  messages are not assistant replies. After restart, accepted work is marked
1782
2050
  interrupted and is never replayed. API reservations interrupted before admission
@@ -1786,6 +2054,12 @@ that handle. Repair storage and call `retrySave()` to save the retained result;
1786
2054
  this never reruns inference. Disposal and shutdown also retry that pending save
1787
2055
  and report failure without discarding it. Do not blindly resend the message.
1788
2056
 
2057
+ Ordinary Codex tool-failure cleanup retains both returned Stop failures and
2058
+ thrown native control errors as unconfirmed cleanup. The existing runtime keeps
2059
+ that failure unavailable and blocks Send/selection until explicit `cancel()`
2060
+ confirms the same owner's cleanup. It retains the original error and shared
2061
+ peer process/thread ownership; neither Stop retry nor selection replays work.
2062
+
1789
2063
  Native acknowledgement can be lost after the engine received a message.
1790
2064
  `inspectDelivery({ messageId })` checks its native history and returns an accepted
1791
2065
  receipt only when that message is found. It also recovers output for an already
@@ -1812,6 +2086,44 @@ Unconfirmed cleanup retains the identity through the existing native binding for
1812
2086
  Stop/recovery. If binding publication also fails, the original startup failure and
1813
2087
  in-memory custody remain, with the persistence error in `bindingError`; durable
1814
2088
  restart recovery is not established until that binding can be saved.
2089
+ During Claude initialization, the trusted `onStarted(executionId, stop)` callback
2090
+ shares the process factory's existing private cleanup closure. It may follow the
2091
+ host's early ID-only publication; the turn owner accepts the cleanup receipt
2092
+ without saving or publishing the same execution again. The owner keeps
2093
+ that receipt in memory until initialization transfers the native handle or
2094
+ confirmed cleanup and binding release finish. Cancel and startup failure join the
2095
+ same stop promise; the client is not treated as initialized before its handshake.
2096
+ Unconfirmed cleanup or failed release retains the exact-ID receipt for Stop retry.
2097
+ Historical missing-handle recovery and local foreign/missing-ID refusal are unchanged;
2098
+ no receipt is reconstructed from mere process absence or stored in conversation data.
2099
+
2100
+ Runtime-owned transcripts persist completed commentary by default. A server can
2101
+ supply `persistCommentary: false` to `createConversationRuntime()` when its product
2102
+ requires progress to remain transient. Live streams still publish and complete;
2103
+ only commentary is excluded from subsequent canonical writes, including native
2104
+ output recovery. Assistant answers, reasoning, tool receipts and native provider
2105
+ history are unchanged. The existing Codex output owner retains item/fingerprint
2106
+ deduplication without writing a commentary row. Existing saved rows are never
2107
+ removed or repaired. Supplied native owners retain their own transcript policy;
2108
+ `open()` refuses a supplied conversation with this opt-out rather than silently
2109
+ persisting commentary or changing the host's owner.
2110
+ For runtime-owned Codex streams, an exact completed native item can emit the
2111
+ existing `message` event with `status: "complete"` and its verified canonical
2112
+ authored turn. Item custody remains private and is retained across steering;
2113
+ a pending request alone does not invent a canonical row. The completed item text
2114
+ replaces partial deltas and is carried once through the existing admission owner.
2115
+ If completion precedes admission publication, its exact request's existing
2116
+ progress custody holds it until accepted has been published; completion is then
2117
+ published before the original delivery commit permits native tools. Completion
2118
+ can resolve a pending captured message only to that same admitted row, not a
2119
+ successor. Subscriber authorization rechecks the captured native owner and
2120
+ unsealed request before delivery. Ordinary stream reads, repeated completion and fingerprint cleanup do not replay
2121
+ it. A canonical patch for the same output keeps the existing saved message
2122
+ identity rather than publishing a second transient completion. A first-seen
2123
+ completion without captured authored custody does not gain it from the newest
2124
+ request. This storage/completion option does not establish native progress/tool
2125
+ same-response association or a pre-effect progress bound.
2126
+
1815
2127
  An optional `limits.timeoutMs` deadline aborts work and waits for owned cleanup;
1816
2128
  a failed cleanup is still reported as unavailable rather than as a successful stop.
1817
2129
 
@@ -1847,6 +2159,15 @@ a call; interrupted streams do not imply permission to execute or retry it.
1847
2159
  Output limits count raw provider text, including hidden blocks. Code indentation
1848
2160
  and blank lines remain intact in ordinary API answers.
1849
2161
 
2162
+ An application can set server-owned `limits.maxApiToolProgressCharacters` to a
2163
+ positive safe integer to bound the decoded text accompanying confirmed API tool
2164
+ calls. The API driver rejects oversized progress before executing any call from
2165
+ that response; it does not clip the text or ask the model to repeat the operation.
2166
+ Omit the limit to retain the original API policy. It does not change final-answer
2167
+ limits or the original sixteen tool rounds and three recovery passes. This option
2168
+ applies only to the direct API carrier; native tool progress needs association
2169
+ with its exact admitted native use at that engine's execution boundary.
2170
+
1850
2171
  An application can additionally set server-owned `limits.maxFinalReplyCharacters`
1851
2172
  to a positive safe integer. This bounds completed, decoded assistant replies in
1852
2173
  JavaScript string characters, independently of raw transport and application-tool
@@ -2049,6 +2370,11 @@ initial Set to prepare a thread from that state. Later controls use the actual
2049
2370
  thread and current goal identity. A stopped or replaced thread does not become
2050
2371
  an unstarted conversation; its existing recovery and replacement checks still
2051
2372
  apply. The supplied client binding preserves the value automatically.
2373
+ Background goal reads keep controls available for the last verified current
2374
+ conversation observation. An initial read or changed native segment blocks
2375
+ commands until its goal target is verified; a supplied pinned goal target may
2376
+ differ from the visible chat segment. Actual goal commands remain serialized,
2377
+ and each sends the displayed goal and target identities for server validation.
2052
2378
 
2053
2379
  Claude uses its original native `/goal` commands through ordinary message
2054
2380
  admission. Set and resume require idle work; an unfinished goal must be cleared
@@ -2085,6 +2411,23 @@ admitted request, including its continuations. `read()` includes the last observ
2085
2411
  work started by another native client. Reopening does not resume unobserved goal
2086
2412
  work automatically.
2087
2413
 
2414
+ An admitted standalone Codex application-tool failure retains the same failure
2415
+ through both native completion orders. If direct interruption reaches its saved
2416
+ terminal before the native completion notification, the existing observation-stop
2417
+ owner still pauses the same active goal, verifies native idleness and saves the
2418
+ stopped barrier before the request settles. This handoff requires the same latched
2419
+ tool error and current provider/thread/turn; user cancellation, account invalidation
2420
+ and host-supplied native ownership keep their existing policies. It does not retry
2421
+ an effect or grant goal controls application-tool authority.
2422
+
2423
+ A thrown Stop error remains a cleanup failure until the original native owner
2424
+ confirms recovery. When a Stop checkpoint propagated the admitted tool error,
2425
+ only the cleanup annotation introduced for that exact error is retired after its
2426
+ same recovery task succeeds with the current provider/thread/turn unchanged.
2427
+ The authored tool failure remains failed. This does not clear cleanup annotations
2428
+ for genuine control refusals, prior cleanup failures, cancelled owners or failed
2429
+ recovery.
2430
+
2088
2431
  After restart, call `inspectDelivery({ messageId })` for an actual authored Send
2089
2432
  or steering message. Codex checks that exact native receipt and recovers output
2090
2433
  through the original native turn owner when the saved thread and run establish
@@ -2111,6 +2454,12 @@ grant uses that account's filesystem permissions and adds no OS sandbox. A
2111
2454
  multi-user host must supply its managed execution facility and appropriate
2112
2455
  isolation. User messages and model configuration cannot enable these tools.
2113
2456
 
2457
+ Custom-provider Codex model catalogues use the native Codex allowance of 10,000
2458
+ tokens for tool output, rather than a 10,000-byte cap. This lets ordinary source
2459
+ and guidance reads return the same amount of content as native models. Tool
2460
+ output remains bounded; this allowance is separate from the model's context
2461
+ window, response limit and provider usage quota.
2462
+
2114
2463
  Ambient hooks, MCP integrations and skills remain disabled. Native subagents and
2115
2464
  interactive permission questions are not enabled by this grant. Application
2116
2465
  `actions` continue through the authorized, durable tool executor above. The API
@@ -2202,6 +2551,12 @@ native account while retaining the Claude conversation. An explicit `model` must
2202
2551
  match the connection. The connection resolver authorizes the current key before
2203
2552
  dispatch; rotating an authorized external-provider key preserves the conversation.
2204
2553
 
2554
+ For a retained supplied-store host, verified native cleanup makes the saved turn
2555
+ inactive even when its interrupted checkpoint rejects. The original checkpoint
2556
+ error remains visible and is rethrown; the completion reports interruption rather
2557
+ than successful teaching. Completed-answer checkpoints still gate settlement and
2558
+ canonical final receipts. Failed native cleanup retains its original retry owner.
2559
+
2205
2560
  Advanced hosts may supply `host.execution` with `start`/`stop`, `host.env`,
2206
2561
  `host.commands.claude` and `host.limits`. The common execution request carries the
2207
2562
  executable, arguments, directory, environment, stream requirement and resource
@@ -2267,6 +2622,10 @@ turn retains its installed instruction snapshot even if the source changes or is
2267
2622
  temporarily unavailable. The next idle admission rereads the latest instructions;
2268
2623
  if native work starts during that refresh, instruction-only recovery defers
2269
2624
  without explicitly interrupting it.
2625
+ Deferred host instruction composition is outside the native-control deadline,
2626
+ as in the original preparation order. Native time already spent remains spent;
2627
+ the subsequent controls receive only the remaining allowance. An exhausted
2628
+ allowance still rejects recovery, and retired contexts cannot install the result.
2270
2629
  Real account, environment, socket and provider recovery still runs normally.
2271
2630
  Native compaction remains the engine's job.
2272
2631
  JSKIT owns the local history adapter used for model-provider changes. It keeps
@@ -2318,6 +2677,36 @@ native work running; failed stop or final persistence remains retryable. Recover
2318
2677
  uses the recorded native owner after reopening and never replays the request.
2319
2678
  Applications using the common runtime do not supply Codex recovery callbacks.
2320
2679
 
2680
+ OpenCode provider credentials are cached for a shared server lifetime. The
2681
+ application's private `publish` operation enters that same owner's acquisition
2682
+ fence after validating the selected provider. Pending starts drain before the
2683
+ owner checks all consumers. Another provider, an unowned driver target or an
2684
+ unconfirmed native terminal refuses publication before stopping work; the
2685
+ previous saved credential stays available. When only owned selected users remain,
2686
+ the original cleanup and verified server exit retire the native cache before
2687
+ publishing. New acquisitions refuse during this interval and can retry afterwards.
2688
+ The application supplies terminal inventory from its existing PTY owner; no
2689
+ second process owner or credential refresh proxy is involved.
2690
+
2691
+ An application's selected provider credential change uses the existing owner's
2692
+ `invalidateRuntimes({ modelProviderId, includeOwned, toolHomeSource })` branch.
2693
+ It inventories loaded native thread identities and exact provider assignments,
2694
+ stops only matching turns/goals, detaches their observers and verifies they are
2695
+ not loaded. Other provider threads, their queues and the shared server stay
2696
+ active. Malformed inventories or a retaining native terminal subscriber refuse
2697
+ the change before credential publication; close that terminal and retry. This
2698
+ branch never falls back to stopping the shared service. An exact isolated
2699
+ provider HOME whose default config caches the key may use the existing verified
2700
+ process retirement only after every loaded/cached thread is proved to belong to
2701
+ that provider; mixed-provider homes refuse retirement. Genuine account/socket
2702
+ changes retain the original whole-runtime invalidation and recovery.
2703
+
2704
+ The application owns independently saved orchestrator/provider records and
2705
+ validation before publication. This native lifecycle facility copies no keys
2706
+ and validates no other provider. Changed account fingerprints still require an
2707
+ explicit existing replacement/selection operation or another conversation;
2708
+ provider retirement does not weaken the native account guard.
2709
+
2321
2710
  A custom Codex execution facility supplies `run()` for capture/detached requests
2322
2711
  and `stop()` with confirmed scope cleanup. The supplied local facility supports
2323
2712
  both. An existing managed native integration may supply `host.codex({ providerId })`
@@ -2398,6 +2787,15 @@ The common driver passes that preparation to the same runtime's
2398
2787
  `startPreparedProcess`; native acquisition and startup stay inside the shared
2399
2788
  owner. The host retains execution policy, credential resolution and durable
2400
2789
  restart/stop proof. Ordinary apps use the supplied facility without writing one.
2790
+ A managed host that already authorizes replacing its own connection may return
2791
+ `allowCredentialRefresh: true`. Authored run preparation resolves that facility
2792
+ again and retains the same shared runtime, runtime directory, native database and
2793
+ session. The original shared owner verifies the old process's exit before starting
2794
+ with the current key. This flag does not identify a historical remote account or
2795
+ share credentials. Standalone defaults still reject a changed credential;
2796
+ inspection and completed-response preparation cannot rotate a binding. An old
2797
+ completed receipt must still match its original credential fingerprint before
2798
+ any effect or reply publication.
2401
2799
  Existing development bindings from the earlier private `history.db` implementation
2402
2800
  are rejected before inference; changing the stored path does not migrate native
2403
2801
  history. Their offline conversion remains unfinished.
@@ -2660,6 +3058,45 @@ runtime's durable tool calls. Disabling built-in native tools alone is not a rea
2660
3058
  to select the bounded protocol: both paths can execute supplied application actions
2661
3059
  through the same catalogue and execution owner.
2662
3060
 
3061
+ #### Completed reply/tool envelopes
3062
+
3063
+ An existing application that uses completed `reply`/`tool` JSON envelopes can
3064
+ opt into the same coordinator with `completedEnvelope: true`. This mode requires
3065
+ `policy.maximumResponses: 24` and a server-owned `settle` function. The default
3066
+ bounded workflow above retains its transient tools and existing error policy.
3067
+
3068
+ The fixed wire object contains `kind`, `text`, `toolName` and string `arguments`.
3069
+ The moved decoder preserves limits of 16,000 characters for reply text, 256 for
3070
+ the tool name, 262,144 for decoded arguments and 280 for tool progress text.
3071
+ These are decoded string limits; the catalogue's argument byte limit remains
3072
+ separate. `readAssistantResponseEnvelope` and `readPartialAssistantReply` are
3073
+ exported from `@jskit-ai/assistant-core/server`. The partial reader exposes only
3074
+ reply text and waits for complete JSON escapes; it never displays tool payloads.
3075
+
3076
+ `complete(prompt, { timeoutMs, outputSchema, previousResponse })` returns the
3077
+ completed text and any `nativeToolAttempt` fact. A tool response also requires
3078
+ the current durable `tools` instance and a stable `toolCallId` supplied by the
3079
+ completed-response owner. Reusing that response must reuse its call ID and saved
3080
+ records. The loop does not mint another ID during recovery. The existing tool
3081
+ executor retains authorization, reservation, result persistence, conflict and
3082
+ unknown-outcome checks. A sealed native request's old tools are not a valid
3083
+ post-completion instance. This mode does not itself implement or prove a native
3084
+ receipt bridge, application admission or history projection.
3085
+
3086
+ Before parsing, `settle({ phase: "before-parse", result })` returns `"use"`,
3087
+ `"continue"` for a superseded response, or `"end"`. Before returning a final
3088
+ reply, `settle({ phase: "after-final", response })` returns `"continue"` or
3089
+ `"end"`; the application retains its final persistence and admission-tail check.
3090
+ Unknown decisions fail. All completed responses, including discarded ones,
3091
+ spend the same 24-response allowance. Two invalid responses permit correction;
3092
+ the third fails. Valid tools and newly pending input do not reset that allowance.
3093
+ A native application-tool attempt invalidates a reply, but a valid completed
3094
+ tool envelope remains usable. `previousResponse` carries the actual tool result
3095
+ or the invalid-response fact; product instructions and feedback stay with the
3096
+ application. In this mode only, `invalidResponseError` may also be a factory
3097
+ receiving `{ nativeToolAttempt }` from the third invalid response and returning
3098
+ an `Error`. The existing `Error` option preserves its identity.
3099
+
2663
3100
  ### Native instruction lifecycle
2664
3101
 
2665
3102
  The created conversation runtime owns instruction installation and refresh.
@@ -2887,6 +3324,15 @@ completion metadata cannot supply this proof. New input, steering, account
2887
3324
  changes, interruption and cleanup invalidate it. Pending or failed native Stop
2888
3325
  cannot revive an older receipt. This optional getter preserves existing storage,
2889
3326
  checkpoint and cleanup behavior; the host still owns question or grading policy.
3327
+ For a supplied conversation running through the common runtime, native settlement
3328
+ first releases the receiver queue. The same accepted delivery then joins reserved
3329
+ steering in the original run owner before invoking the retained checkpoint, so
3330
+ `assertCompletionCurrent()` is armed while the saved turn still reports active.
3331
+ An accepted successor supersedes the earlier delivery; rejected preparation keeps
3332
+ the earlier accepted receipt. The original direct Send/wait completion still
3333
+ settles after the checkpoint and retains interruption and cleanup failures.
3334
+ This coordination applies with or without application tools and adds no host
3335
+ callback or execution-release capability.
2890
3336
  The turn owner preserves the production receiver's block lifecycle: deltas are
2891
3337
  temporary, block-stop removes them, and completed snapshots use their native
2892
3338
  UUIDs. It does not group distinct history snapshots into a synthetic reply.
@@ -2940,6 +3386,17 @@ cannot bypass admission, authorization, delivery inspection or cleanup proof.
2940
3386
  and message-block mapping stay inside the owner. Pass an authorized
2941
3387
  `configRoot`, `workdir` and native `conversationId` to the reader; these
2942
3388
  operations do not authorize an account or conversation.
3389
+ Stopped inspection can opt into `includeUserMessages: true` for raw native
3390
+ `userMessages` (`id`, `text`) and `includeFinalCarriers: true` for
3391
+ `completedResults` (`id`, `userId`, `text`), `failedResults` (`id`, `userId`) and `structuredOutputs`
3392
+ (`id`, `userId`, `toolUseId`, `text`). Completed results come only from actual
3393
+ successful native result frames. A recorded failed or interrupted result for the
3394
+ same user must block conversion even if an earlier carrier matches. No native
3395
+ error content is exposed by this field. Structured outputs are exact top-level
3396
+ `StructuredOutput` tool-use candidates, not proof of completion; the application
3397
+ must join its original completed receipt, exact user and final reply, and reject
3398
+ newer or competing output. These opt-ins use the same selected branch and parser,
3399
+ exclude sidechain/nested/meta carriers, and leave the default return shape intact.
2943
3400
  Reads preserve the selected rewind branch and tolerate only an unfinished final
2944
3401
  line in a growing transcript. `listClaudeConversationStorage` enumerates the
2945
3402
  specified binding's native conversations. Export and deletion policy remain with
@@ -2998,9 +3455,15 @@ The host supplies its application closing fact and retains subsequent Git,
2998
3455
  environment and managed PTY preparation.
2999
3456
  Startup uses an execution
3000
3457
  facility with `start({ command, args, cwd, env, stream })` and `stop(id)`;
3001
- `start` returns `{ id, stdin, stdout }` for duplex protocols, and a successful
3002
- stop must return `{ scopeEmpty: true }`. Engine flags, environment normalization
3003
- and the JSON initialization handshake stay inside JSKIT.
3458
+ `start` returns `{ id, stdin, stdout }` for duplex protocols. When the host also
3459
+ supplies an `exited` promise reporting the native process's `{ code, signal }`,
3460
+ startup rejects that confirmed exit even when the protocol stream remains open.
3461
+ Hosts without this optional receipt retain the original protocol EOF path. The error retains
3462
+ `processExit` and the acquired execution identity before the original exact-owner
3463
+ cleanup. Exit does not prove scope cleanup: a successful stop must still return
3464
+ `{ scopeEmpty: true }`. Engine flags, environment normalization and the JSON
3465
+ initialization handshake stay inside JSKIT. The existing control deadline and
3466
+ normal EOF event-draining order are unchanged.
3004
3467
 
3005
3468
  Without a replacement execution facility, Claude startup uses the supplied local
3006
3469
  POSIX process-group implementation. This is a trusted single-user host, not a
@@ -3104,6 +3567,15 @@ scoped turns and private renewal execution against the supplied application
3104
3567
  store and publication policy. Detached waiting and run-transition helpers stay
3105
3568
  inside that owner; hosts do not compose another observer or delivery journal.
3106
3569
 
3570
+ The same notification queue exposes `captureDrain(sessionId)` for a bound
3571
+ native driver's delayed settlement. Capture it while the opening namespace is
3572
+ valid; the returned function waits for that exact queue key and any same-key
3573
+ successors. It retains no request context or effect grant. The Codex driver uses
3574
+ it only for its three delayed run drains, so completion cannot re-read an expired
3575
+ admission scope. Ordinary `drain(sessionId)` still validates the current namespace;
3576
+ inspection, standalone disposal and provider release retain that original path.
3577
+ Different namespaces remain independent even when their session IDs are equal.
3578
+
3107
3579
  This advanced constructor adapts an existing managed host's retained run store
3108
3580
  and application effects. Ordinary applications use `createConversationRuntime`
3109
3581
  with their chosen conversation storage; they do not configure the following
@@ -3373,7 +3845,11 @@ order. Its internal admission inspection uses the bounded native user-message lo
3373
3845
  unknown, never permission to resend. The shared runtime owns admitted-turn
3374
3846
  steering and the original one-attempt missing-answer recovery. Its existing
3375
3847
  monitor projection preserves completed reasoning before recovery advances the
3376
- native input boundary. Applications retain their authorization and durable
3848
+ native input boundary. An overlapping newer input joins that turn's exact native
3849
+ recovery receipt before dispatch; native created-time/ID ordering is checked before
3850
+ its final is accepted. The admitted input keeps its durable receipt if observation
3851
+ fails. This uses the original turn lifetime, cancellation and cleanup, with no
3852
+ additional message queue or automatic resend. Applications retain their authorization and durable
3377
3853
  delivery receipts. The shared runtime's internal dispatch preserves event readiness before
3378
3854
  the application's admission hook, then records the attempted native send and
3379
3855
  submits the original resumed prompt. Delivery defaults to queue; a host steering
@@ -3476,6 +3952,22 @@ acknowledgement, retryable failure flags, admission release and current-monitor
3476
3952
  wait. It does not add an idle query. The existing observation-loss branch keeps
3477
3953
  its stronger native-stop or exact-process-exit proof. `turnSnapshot` supplies the
3478
3954
  same result fields to host readers.
3955
+ For a supplied native conversation, per-Send `acquire(context)` may return
3956
+ `runInContext(operation)` alongside its existing key and options. The application
3957
+ captures its durable control context before admission ends; the driver re-enters
3958
+ that context for retained HTTP application-tool callbacks. It does not retain a
3959
+ finite effect grant. The existing native identity, authored admission and current
3960
+ turn checks still apply, and application operations must obtain fresh permissions.
3961
+ Without this optional facility, the callback executes directly as before.
3962
+
3963
+ The existing Main monitor projection may also supply `runInContext(operation)`.
3964
+ The shared owner enters it while preparing, creating and registering that monitor,
3965
+ so its asynchronous observation, publication, checkpoint and retirement callbacks
3966
+ inherit the captured control context. Restored monitors use the same boundary.
3967
+ Enter the context synchronously and return the operation's result; do not wrap
3968
+ fresh Send preparation, retain an effect grant or capture context on the shared
3969
+ process. An absent facility preserves the original direct monitor behavior.
3970
+
3479
3971
  The bound OpenCode driver uses the same owner's `readSessionState` for canonical
3480
3972
  and native reads. Application context, saved identity and terminal-state facilities
3481
3973
  retain their original read order. Passive reads do not prepare or start a native
@@ -3567,6 +4059,27 @@ acquisition layer. Its plugin resolves the current instructions, environment,
3567
4059
  command wrapper and application-tool bridge by the registered native session.
3568
4060
  Changing one conversation's grant does not change another's permissions.
3569
4061
 
4062
+ For an explicitly stopped offline upgrade, `readCodexHistoryRows(file, start,
4063
+ end, signal, { strictComplete: true })` from `/server/codex-provider` reads the
4064
+ existing fixed file snapshot as `{ row, offset }` entries, with the original
4065
+ 32 MiB bound per record. Strict inspection rejects an unfinished final JSON
4066
+ record or invalid UTF-8. Omitting the option preserves compaction recovery's
4067
+ original unfinished-append tolerance. The caller owns opening and closing the
4068
+ file, trusted runtime/path and file-identity checks, cancellation, and native
4069
+ thread/account/turn/goal validation. Raw rows alone do not prove an idle native
4070
+ turn or authorize resuming it. This read does not start or stop an app-server,
4071
+ write history, or obtain credentials.
4072
+
4073
+ `readCodexNativeGoal(databasePath, { threadId, signal })` from
4074
+ `/server/codex-provider` inspects the native `goals_1.sqlite` store without
4075
+ starting an app-server or resuming a thread. It returns the original SQL goal
4076
+ fields or `null` for an absent row in that verified database; a missing database,
4077
+ journal sidecar, changed file or unknown goal representation is refused.
4078
+ Known unfinished goal statuses remain present. The stopped conversion caller
4079
+ must qualify its native producer and actual SQLite home, including any original
4080
+ `CODEX_SQLITE_HOME` override, and retain its existing goal/account/thread guards.
4081
+ A completed rollout or missing database does not establish goal absence.
4082
+
3570
4083
  ## Companions and templates
3571
4084
 
3572
4085
  A companion can receive an app-selected layer containing conversation state and
@@ -3616,3 +4129,27 @@ The textbox coalesces height measurements once per animation frame, after Vue
3616
4129
  applies model changes, and remeasures when its pane width or density changes.
3617
4130
  External state changes retain focus and selection. IME composition does not
3618
4131
  submit or move focus to Send.
4132
+
4133
+ ## Stopped native SQLite inspection
4134
+
4135
+ `readStoppedNativeDatabase` from `/server/native-history` is the shared read-only
4136
+ lifecycle for stopped native SQLite readers. It requires a canonical regular
4137
+ file and stopped writers. With no journal it opens immutable read-only. A valid
4138
+ stopped WAL/SHM pair is fingerprinted with the base file; exact private base/WAL
4139
+ copies let SQLite read committed pages and create its own temporary SHM. The
4140
+ native files are never opened writable. Both paths use `query_only` and one
4141
+ fixed transaction. Changed files, invalid journal headers, rollback journals and
4142
+ noncanonical files refuse inspection; private copies are removed on success,
4143
+ failure and cancellation. It never starts a native CLI, checkpoints, deletes a
4144
+ native sidecar or stops admitted work. The host must keep writers stopped through
4145
+ inspection and publication; a missing database is not proof of absent native state.
4146
+
4147
+ `readOpenCodeConversationDatabase` from `/server/opencode-client` streams the
4148
+ native session/message/part projection through the existing bounded export and
4149
+ message normalizer. It returns original session fields and revision/count
4150
+ receipts, refuses pending native admissions or foreign part identities, and
4151
+ leaves account authorization and historical-conversion policy to the host.
4152
+ `claudeConnectionIdentity` from `/server/claude-process` exposes the same native
4153
+ provider/configuration/endpoint/key digest already used by the live driver;
4154
+ hosts may translate a verified historical pin without changing its caller or
4155
+ copying credentials. These functions do not authorize native continuation.