@jskit-ai/agent-docs 0.1.198 → 0.1.200

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 (24) hide show
  1. package/guide/agent/app-extras/assistant-conversation.md +205 -19
  2. package/guide/agent/app-extras/assistant-voice.md +141 -15
  3. package/package.json +1 -1
  4. package/patterns/feature-package/example/booking-engine/package.json +1 -1
  5. package/patterns/minimal-foundation/example/package.json +4 -4
  6. package/patterns/shell-foundation/example/package.json +5 -5
  7. package/patterns/shell-foundation/example/packages/main/package.json +1 -1
  8. package/reference/autogen/PATTERN_INDEX.md +35 -35
  9. package/reference/autogen/packages/assistant-core.md +29 -1
  10. package/reference/autogen/packages/assistant-runtime.md +3 -3
  11. package/reference/autogen/packages/assistant-voice.md +8 -0
  12. package/skills/jskit/references/pattern-index.md +35 -35
  13. package/skills/jskit/references/patterns/app/minimal-foundation/example/package.json +4 -4
  14. package/skills/jskit/references/patterns/app/shell-foundation/example/package.json +5 -5
  15. package/skills/jskit/references/patterns/app/shell-foundation/example/packages/main/package.json +1 -1
  16. package/skills/jskit/references/patterns/auth/supabase-auth/example/package.json +1 -1
  17. package/skills/jskit/references/patterns/connectors/calendar-cli/example/package.json +4 -4
  18. package/skills/jskit/references/patterns/crud/json-api-resource-package/example/packages/books/package.json +2 -2
  19. package/skills/jskit/references/patterns/database/mysql-application/example/package.json +1 -1
  20. package/skills/jskit/references/patterns/database/postgres-application/example/package.json +1 -1
  21. package/skills/jskit/references/patterns/realtime/realtime-application/example/package.json +2 -2
  22. package/skills/jskit/references/patterns/server/feature-package/example/booking-engine/package.json +1 -1
  23. package/skills/jskit/references/patterns/users/user-administration-server/example/packages/users/package.json +2 -2
  24. package/skills/jskit/references/patterns/users/user-administration-server/example/packages/users-workspace/package.json +3 -3
@@ -249,7 +249,7 @@ The composable exposes the same `runtime` and `error` refs; it is unnecessary fo
249
249
  an application that only adds standard component slots.
250
250
 
251
251
  The composable's `presentation` option accepts a value, ref or getter. Supply transcript
252
- fields `assistantLabel`, `systemLabel`, `welcomeMessage`, `variant`, `visible`,
252
+ fields `assistantLabel`, `systemLabel`, `welcomeMessage`, `variant`, `visible`, `retainWhenHidden`,
253
253
  `userMessageFormat` and `progressPreviewLimit`, and composer fields `ariaLabel`,
254
254
  `submitAriaLabel`, `submitLabel`, `placeholder` and `rows`. `layout: "compact"`
255
255
  keeps the existing compact composer. These change presentation through the
@@ -262,7 +262,9 @@ state for an exact actor, endpoint, surface, workspace and conversation. Release
262
262
  a retained handle with `release()`. Final view/reader release detaches browser
263
263
  observers; it does not stop server work. A lost receipt remains uncertain with
264
264
  **Check delivery** until inspection or canonical history proves acceptance.
265
- Reconnection reads state and does not resend the request.
265
+ Reconnection reads state and does not resend the request. After an initial
266
+ subscription failure or timeout, **Reload** retries that exact subscription on
267
+ the connected socket with fresh authorization; it does not resend a message.
266
268
 
267
269
  Applications that create nonvisual tasks after setup can capture
268
270
  `useAssistantConversationFactory(commonOptions)` once during setup, then call
@@ -355,6 +357,22 @@ different submission replaces that reference; it never selects an older matching
355
357
  failure from history. Uncertain delivery still requires **Check delivery**.
356
358
  Voice sends keep their own authored capture and do not consume the typed draft.
357
359
 
360
+ `conversation_not_steerable` is a definite pre-admission rejection: its original
361
+ request remains failed, with the same message ID and captured steering intent.
362
+ It does not become uncertain or silently restart as new work. Hosts should use
363
+ this code only when the original turn is absent or finished before dispatch.
364
+ Transport and provider failures without that proof remain uncertain and require
365
+ receipt inspection; an HTTP 409 alone is not proof of rejection.
366
+
367
+ When `draftStorage` restores a page, known failed deliveries remain failed and
368
+ accepted receipts remain accepted. Saved uncertain, pending or unrecognised
369
+ delivery states stay uncertain with the exact original ID, payload and draft;
370
+ closing a page during HTTP is not proof of rejection. Only the transient
371
+ inspection flag is reset so **Check delivery** is reachable again. A matching
372
+ canonical row marked `receipt: false` cannot settle delivery. Unknown inspection
373
+ never retries; an actual accepted receipt is required to acknowledge the request.
374
+ The existing storage shape is unchanged and reads perform no historical repair.
375
+
358
376
  With `queueWhileSending: false`, the composer is disabled during admission and
359
377
  overlapping typed or retained voice sends return `false` before calling the
360
378
  supplied API. A runtime that supports sending while working still permits the
@@ -363,6 +381,20 @@ of the initial retained conversation composition, so use consistent options for
363
381
  mirrored readers of the same identity. The default is `clearDraftOn: "dispatch"`
364
382
  and the existing queuing behavior for a runtime that advertises steering.
365
383
 
384
+ Applications may opt into `deferWhileWorking: true` with
385
+ `queueWhileSending: true` for a conversation that cannot steer its active turn.
386
+ Typed and retained voice submissions become pending in the original serial
387
+ queue with their exact message ID, text, attachments and captured data. The
388
+ existing subscription must report ready before each ordinary request reaches
389
+ the API; normal server permissions still apply at dispatch. Show **Send** and
390
+ the existing pending status, not **Steer**, when the runtime cannot steer.
391
+ Native steering and explicit retries keep their captured intent. Stop aborts
392
+ these local pre-dispatch followers before stopping the original turn; actor
393
+ retirement and lost access cannot dispatch them later. This option defaults to
394
+ false and belongs to the initial retained conversation composition. It adds no
395
+ server queue or persisted queue recovery; genuine uncertainty still blocks new
396
+ submissions and requires receipt inspection.
397
+
366
398
  Set `draftWhileLoading: true` when people should be able to type before the
367
399
  application resolves its conversation ID or while the first read is unavailable.
368
400
  This keeps one local input scoped to the real actor, endpoint, surface and
@@ -526,7 +558,7 @@ composer is present, and `stop` when `canStop` can become true.
526
558
  | `setDraft(text)` | Update the application draft synchronously. |
527
559
  | `submit({ configuration, attachments })` | Send or steer through the app's normal admission, attachment and delivery path. Use the delivery controller below for pending messages and failures; retain accepted-draft clearing and application admission. The element checks `canSend` before calling. |
528
560
  | `stop()` | Request cancellation through the backend owner. Report pending state, errors, and what actually stopped; the element checks stop availability. |
529
- | `loadMore({ complete })` | Prepend older turns, then call `complete({ changed })` after updating reactive state. Call it on failures too; this releases the scroll anchor. |
561
+ | `loadMore({ complete })` | Prepend older turns, then call `complete({ changed })` synchronously after updating reactive state, before yielding to rendering. Call it on failures too; this releases the scroll anchor. Pending reader movement stays tracked if new replies change the transcript height before completion. |
530
562
  | `reload()` | Refresh authoritative history. |
531
563
  | `resend(id)`, `cancel(id)`, `edit(id)` | Optional overrides of the shared delivery actions. Keep the stable message identity when retrying. |
532
564
  | `openLink({ event, href, text })` | Optionally handle app-owned links and call `event.preventDefault()`. Otherwise a validated ordinary link keeps normal browser behavior. |
@@ -534,12 +566,49 @@ composer is present, and `stop` when `canStop` can become true.
534
566
 
535
567
  `scrollKey` changes when conversation ownership changes, resetting scroll and
536
568
  expansion state. `followLatestKey` requests following the newest message.
569
+ `retainWhenHidden: true` keeps the original transcript scroll node while `visible`
570
+ is false and suspends hidden scroll work. It captures a reader's visible turn
571
+ before hiding and restores that turn's offset after reopening layout settles;
572
+ readers following the latest message still follow new replies. An older-history
573
+ load completed while hidden restores its original anchor after reopening. First
574
+ open and a changed `scrollKey` still position the conversation at its latest
575
+ message. Retained transcripts lay out their message rows without offscreen height
576
+ estimates so later materialization cannot move the restored anchor; this opt-in
577
+ uses more layout work for long histories. The default is false and retains the
578
+ existing remove-and-follow behavior and offscreen layout optimization.
537
579
  Scrolling upward within 160 CSS pixels of the transcript's top requests older
538
580
  history through `loadMore`, including touch, wheel and keyboard scrolling.
539
581
  Only one request runs at a time, and prepending preserves the reading position.
540
582
  Initial positioning and conversation selection do not fetch older pages.
541
583
  `loadMoreError` pauses automatic loading; the older-messages button remains
542
584
  available for an explicit retry. Clear the error when retrying succeeds.
585
+ A transcript `error` appears in a compact, content-sized warning above the loaded
586
+ messages. It does not replace history, remount the message body, clear a draft or
587
+ reset an older-history reader. A failure to receive updates does not establish
588
+ that the assistant stopped. While updates are unavailable, the supplied binding
589
+ hides its stale working hint without disabling the existing Stop action; a fresh
590
+ update restores the hint. `errorReloadable: true` offers **Reload chat** only
591
+ inside that warning when the permanent `reloadable` control is off; it emits the
592
+ same `reload` action and respects `reloading`. Enable it only when the current
593
+ actor may recover that conversation. The supplied runtime binding derives this
594
+ from its existing access-denial state; a 401/403 still clears private history and
595
+ drafts and offers no error-only Reload. Restore access or sign in through the
596
+ application before reopening. A subscription transport failure says **Chat
597
+ updates could not reconnect. Reload chat to try again.** and retains its original
598
+ error as `cause`; provider errors keep their own wording.
599
+
600
+ When `runtime.logger` is supplied, subscriptions emit structured
601
+ `assistant.conversation.subscription` records containing `stage`, `previousStage`,
602
+ `durationMs`, `elapsedMs`, and the server-generated `subscriptionEpoch`. The
603
+ conversation identity is included only after opening and authorization succeed;
604
+ raw client subscription IDs and rejected conversation inputs are not logged. Stages cover
605
+ authentication, action admission, conversation opening, observer attachment,
606
+ snapshot reading and acknowledgement. The acknowledgement stage includes
607
+ `snapshotTurns` and `snapshotLimit` when available, without message content.
608
+ `acknowledgement-sent` records server dispatch, not client receipt. Diagnose the
609
+ measured slow stage before changing the existing ten-second acknowledgement
610
+ deadline.
611
+
543
612
  `reloadable`, `reloading`, `welcomeMessage`, and `variant: "main" | "task"`
544
613
  control the corresponding transcript presentation. `userMessageFormat` is
545
614
  `"formatted"` by default; `"plain"` preserves literal user-authored text.
@@ -547,13 +616,40 @@ control the corresponding transcript presentation. `userMessageFormat` is
547
616
  For live speech that has not been admitted, supply
548
617
  `adapter.conversation.previewMessage = { messageId, text }` (the original
549
618
  voice capture's `id` is also accepted). The element displays one pending user
550
- message after merging canonical and delivery turns. A matching canonical or
619
+ message after merging canonical and delivery turns. A matching admitted canonical or
551
620
  delivery message ID suppresses that preview, so an admitted utterance appears
552
- once. The application owns updating or clearing its current capture. Preview
621
+ once. An exact unadmitted canonical user (`receipt: false`) or known failed local
622
+ delivery may retain the same bubble as an editable preview; its real status and
623
+ error remain unchanged until the host performs an explicit action. The application owns updating or clearing its current capture. Preview
553
624
  text never enters saved history, the retained runtime's turns or receipt
554
625
  reconciliation; it cannot acknowledge a pending or uncertain send. Keep it out
555
626
  of `adapter.conversation.turns`.
556
627
 
628
+ An optional `previewMessage.actions` supplies `discard(messageId)` and
629
+ `edit(messageId)` with explicit `canDiscard` and `canEdit` booleans. The element
630
+ shows X and pencil actions only on its unsent preview bubble; accepted messages
631
+ never receive them. Add `editing`, `update(messageId, text)`, `send(messageId)`,
632
+ `canSend` and `sending` to reuse the original review textarea inside that same
633
+ bubble and its existing action row for Send. An empty editor remains visible.
634
+ The host owns identity, admission and current-target guards; the typed draft need
635
+ not change. For a known failed voice delivery, explicit Edit may cancel only that
636
+ exact failed local entry through the original delivery owner before authoring a
637
+ fresh request. Plain Retry preserves its original text and intent. The preview
638
+ row replaces the generic failed-action row without concealing the real error.
639
+ `user-message-actions` receives `{ message, turn }` inside the existing user
640
+ bubble; the assistant's `message-actions` slot remains separate.
641
+
642
+ A host with both an existing pending utterance and a newer live capture can
643
+ project `adapter.conversation.previewMessages` as a read-only, identity-deduplicated
644
+ list of those existing descriptors. The singular `previewMessage` contract stays
645
+ available; a supplied list owns the displayed previews. Each row binds only its
646
+ matching descriptor, so the retained failed bubble keeps its actual error and
647
+ recovery controls while newer words stay visible. This list never queues,
648
+ submits or stores transcripts. The host disables the newer capture's Edit while
649
+ its existing pending editor is occupied, preserving its independent Discard.
650
+ Existing runtime presentation options that forward only `previewMessage` do not
651
+ implicitly forward this list; supply it on the host's final adapter conversation.
652
+
557
653
  ### Message delivery
558
654
 
559
655
  Use `createAssistantMessageDelivery` from `/client/conversation` (or the
@@ -765,8 +861,10 @@ are `focus()`, `preserveHeightForNextModelValue()` and `queueResizeTextarea()`;
765
861
 
766
862
  ### Optional avatar
767
863
 
768
- Supply the `avatar` slot to add artwork above the existing transcript. With no
769
- slot, the text-only layout has no avatar region or size control and requires no
864
+ Supply the `avatar` slot to add artwork fixed at the chat's upper right. It stays
865
+ outside the transcript's scroll container; chat text scrolls behind the artwork
866
+ and controls. It creates no side gutter or text wrapping. With no
867
+ slot, the text-only layout has no avatar region or visibility control and requires no
770
868
  voice package or speech service. The application supplies artwork and any
771
869
  animation; the element does not acquire audio or another conversation.
772
870
 
@@ -777,12 +875,30 @@ animation; the element does not acquire audio or another conversation.
777
875
  ```
778
876
 
779
877
  `avatarSize` is a controlled preference: `hidden`, `compact`, `standard`, or
780
- `large`, requesting 0, 64, 112, or 176 CSS pixels of artwork. Its default is
781
- `compact`. The Avatar size button opens the four-preset menu and emits
782
- `update:avatarSize`; keep that value in the application's existing preference
783
- owner if it should be remembered. The button uses the default composer toolbar.
784
- A custom or transcript-only composer uses a separate row above the transcript.
785
- Hidden leaves the button available so the person can show the avatar again.
878
+ `large`, requesting 0, 96, 112, or 176 CSS pixels of artwork. Its default is
879
+ `compact`. The anonymous avatar icon at the chat's upper right shows the avatar;
880
+ the expanded round minus icon at the end of the avatar controls row hides it
881
+ (accessible label **Minimise avatar**). The collapsed **Show avatar** icon remains
882
+ at the chat's upper right and remains clickable above the transcript's reload
883
+ control. Both controls emit
884
+ `update:avatarSize`; keep that
885
+ value in the application's existing preference owner if it should be remembered.
886
+ Show restores the last visible size, or Compact if none has been selected.
887
+ There is no size menu. Hosts can still supply any supported controlled preset.
888
+ The overlay is transparent, so transcript text shows behind the supplied artwork
889
+ rather than an opaque panel.
890
+ Changing visibility does not change the input or composer button layout.
891
+
892
+ The optional `avatar-tools` slot receives the same `{ size, height }` scope and
893
+ places application-supplied controls below the artwork, outside the composer,
894
+ immediately before the element's round minimise control in the same compact row.
895
+ Its content stays mounted while Hidden conceals the presentation with `v-show`,
896
+ so a local controls target can retain its identity. Keep required review,
897
+ recovery and active-capture controls visible outside the hidden presentation.
898
+ The always-visible `avatar-control` slot receives `{ size, height }` beside
899
+ Show/Hide. An application can use it for a collapsed active-mic
900
+ indicator or control without placing voice state in the conversation element.
901
+ The element supplies no audio session or control actions.
786
902
 
787
903
  The effective artwork height uses the conversation container's actual remaining
788
904
  space after its composer, feedback, support and other controls, leaving a target
@@ -793,8 +909,8 @@ a preference change; enlarging the container restores the requested size.
793
909
  The slot receives `{ size, height }`, where `size` is the requested preset and
794
910
  `height` is the effective artwork height. Size artwork to fit that region.
795
911
 
796
- `AssistantConversationClientElement` accepts the same slot and
797
- `v-model:avatar-size`. Its slot also receives the existing retained `runtime`.
912
+ `AssistantConversationClientElement` forwards all three avatar slots and
913
+ `v-model:avatar-size`. Its slots also receive the existing retained `runtime`.
798
914
  Changing the preference does not acquire a new runtime, change the transcript,
799
915
  clear the draft, or deliberately move focus. The transcript retains its normal
800
916
  scroll-following behavior; application visibility and focus policies remain
@@ -1330,7 +1446,12 @@ await conversation.select({
1330
1446
  ```
1331
1447
 
1332
1448
  Selecting a native engine used earlier restores its latest retained binding.
1333
- Changing a model on the current engine retains that native conversation. Before
1449
+ Changing a model on the current engine retains that native conversation. OpenCode
1450
+ retains it only within the same `integrationId`: selecting a different integration
1451
+ reserves a fresh native binding while preserving the application conversation and
1452
+ history. Returning to OpenCode restores only a binding for that integration; an
1453
+ unselected account change still fails its identity guard. Selection never submits
1454
+ a prompt or replays a retained failed or uncertain request. Before
1334
1455
  the next request, JSKIT supplies missed messages, corrections and removed message
1335
1456
  identities as quoted history. Unchanged messages are not injected again. All
1336
1457
  corrections are included, even outside the recent-history window; if they exceed
@@ -1338,6 +1459,14 @@ corrections are included, even outside the recent-history window; if they exceed
1338
1459
  with a briefing. Nothing is silently dropped. The application remains responsible
1339
1460
  for authorizing edits to its transcript.
1340
1461
 
1462
+ An application whose established selection policy creates a fresh native
1463
+ conversation can pass `retireNative: true` to `select()`. This uses the same
1464
+ selection transaction and allocates a new binding even for a compatible model
1465
+ or effort change; it does not restore an earlier retained binding. Written
1466
+ history and predecessor receipts remain, and the next request receives the
1467
+ retained discussion through the existing history handoff. The operation does
1468
+ not submit a prompt. Omit this option for the native reuse policy above.
1469
+
1341
1470
  Selection requires idle work and confirmed process cleanup. An uncertain receipt
1342
1471
  may remain with another selected engine, but the same message ID cannot be sent
1343
1472
  there again. Return to its original engine and use `inspectDelivery()` to resolve
@@ -1948,8 +2077,13 @@ driver uses this backend. Ordinary applications use the common conversation API
1948
2077
  with its supplied execution and credential defaults.
1949
2078
 
1950
2079
  Changed instructions use the existing thread-control restoration and verification
1951
- before sending new work; they do not replace the shared process. Ordinary turns
1952
- preserve the instruction binding. Native compaction remains the engine's job.
2080
+ before sending new work; they do not replace the shared process. A healthy active
2081
+ turn retains its installed instruction snapshot even if the source changes or is
2082
+ temporarily unavailable. The next idle admission rereads the latest instructions;
2083
+ if native work starts during that refresh, instruction-only recovery defers
2084
+ without explicitly interrupting it.
2085
+ Real account, environment, socket and provider recovery still runs normally.
2086
+ Native compaction remains the engine's job.
1953
2087
  JSKIT owns the local history adapter used for model-provider changes. It keeps
1954
2088
  native history intact and translates only outgoing requests. For qualified
1955
2089
  DeepSeek and GLM models, an OpenAI encrypted compaction is supplemented with the
@@ -2137,6 +2271,19 @@ This advanced host operation has no HTTP, socket or client counterpart and accep
2137
2271
  no caller-supplied engine, native descriptor or host override. Ordinary standalone
2138
2272
  applications keep using `open()` and their existing storage contract.
2139
2273
 
2274
+ Existing detached run/stream facades can call
2275
+ `runtime.runNativeDetachedConversation({ id, context, input, options })` on that
2276
+ same runtime. Authorization uses `runDetachedConversation`. Its configured host
2277
+ returns `{ sessionId: id, engine, native, input, context, options }`, with the
2278
+ admitted context separate from the original engine options. Optional submitted
2279
+ `options` go only to that host; they never select a native owner or override the
2280
+ host. The driver uses the existing native execution and cleanup owners without
2281
+ opening Main, creating a retained handle or writing canonical message history.
2282
+ The application retains profile approval, write leases and original event/result
2283
+ codecs. Codex/OpenCode facade profile events remain unawaited;
2284
+ Claude acquires its entry before the profile event and awaits that event before
2285
+ starting work. This operation has no browser, HTTP or socket counterpart.
2286
+
2140
2287
  The same advanced host can prepare native readiness before retaining a handle
2141
2288
  with `runtime.ensureNativeConversation({ id, context })`. Authorization uses
2142
2289
  operation `ensure`; only the configured host supplies the prepared
@@ -2359,7 +2506,9 @@ pauses/resumes an active goal only when still authorized, verifies the owned
2359
2506
  shell environment after reload and never retries the caller's operation.
2360
2507
  Changed instructions or an unknown installation update native configuration and
2361
2508
  add one explicit developer-context revision before new work. Acknowledged ordinary
2362
- turns and socket reconnects do not repeat it. Compaction rebuilds context with the
2509
+ active turns keep their installed instructions rather than interrupting for a
2510
+ source-only change. Idle admission rereads the source, and socket reconnects with
2511
+ unchanged acknowledged instructions do not repeat the revision. Compaction rebuilds context with the
2363
2512
  current configuration; restricted consumers retain their own execution environment.
2364
2513
  The same provider owner selects and replaces cached providers, constructs native
2365
2514
  connections, acquires the shared runtime and retries an unconfirmed observation
@@ -2462,6 +2611,19 @@ accounting and the engine's own compaction remain native behavior.
2462
2611
 
2463
2612
  API-model apps can use `createAiConnectionClient` with an authorized AI integration resolver (see [Assistant](./assistant.md)), or `createAiClient` for existing environment-based configurations, and the tool-catalog helpers
2464
2613
  from `@jskit-ai/assistant-core/server`, or the complete assistant runtime.
2614
+ `createAiConnectionClient` preserves immediate rejection for a provider error,
2615
+ cancellation or invalid tool call. It does not wait for transport EOF to report
2616
+ that failure. Later text, tool calls, completion frames or transport errors cannot
2617
+ replace the reported failure or become another yielded chunk. The original signal
2618
+ reason remains the cancellation error. This does not retry the request or execute
2619
+ later tool calls.
2620
+ The common API conversation enables `reportUnavailableToolCalls` only for its
2621
+ application catalogue. A well-formed object call rejected specifically as an
2622
+ unavailable tool reaches that existing catalogue, which records a no-effect
2623
+ refusal and supplies it to the same bounded model/tool loop. This grants no tool
2624
+ access. Provider-executed calls, malformed or non-object arguments and every
2625
+ other validation error remain rejected. Direct SDK clients retain strict
2626
+ validation by default.
2465
2627
  Ordinary native conversations use `createConversationRuntime` and the supplied
2466
2628
  server/client integration described above. The native facilities below support
2467
2629
  hosts that already own managed execution, credential homes, authorized native
@@ -2507,6 +2669,10 @@ completion and the interruption barrier for steering. Normalized owner events
2507
2669
  let the host persist admissions and publish application state; receiver
2508
2670
  completion alone does not prove process exit. `claudeNativeMessageId()`
2509
2671
  retains the same stable native message IDs used by the Vibe64 adapter.
2672
+ An exact native acknowledgement ends its ACK deadline before the admission
2673
+ writer runs; a slow write remains awaited, and a rejected write rejects admission.
2674
+ A missing acknowledgement remains uncertain. Native failure-result text stays
2675
+ in the turn's error rather than becoming an assistant answer.
2510
2676
  The turn owner preserves the production receiver's block lifecycle: deltas are
2511
2677
  temporary, block-stop removes them, and completed snapshots use their native
2512
2678
  UUIDs. It does not group distinct history snapshots into a synthetic reply.
@@ -2703,6 +2869,19 @@ Set transport limits appropriate to the host; the default payload limit is
2703
2869
  unbounded. A request abort retires the local request; interrupt a running native
2704
2870
  turn with `turn/interrupt` when cancellation must stop provider work.
2705
2871
 
2872
+ The original public import contracts remain available alongside these host and
2873
+ testing surfaces. `/server/codex-client` exports `CodexAppServerJsonRpcClient`
2874
+ and `socketPathFromCodexAppServerEndpoint`; `/server/codex-events` retains its
2875
+ original event classification, text and notification helpers; `/server/codex-turn`
2876
+ retains `createCodexAppServerDetachedTurnWatcher` and the original turn-status
2877
+ predicates. `/server/opencode-client` retains `createOpenCodeServerClient`,
2878
+ `readBoundedResponse`, `OPENCODE_RESPONSE_LIMIT_BYTES` and
2879
+ `openCodeAssistantMessageText`. These exports forward to the same native owners;
2880
+ using a low-level client does not supply application authorization, account
2881
+ isolation or native cancellation. `/client/conversation-submit` retains
2882
+ `createAssistantTextSubmission`, also exported by `/client/conversation`.
2883
+ The newer host exports remain available.
2884
+
2706
2885
  Managed Codex hosts use `createCodexAppServerRunOwner` from
2707
2886
  `/server/codex-turn`. It constructs the native notification queue from the
2708
2887
  supplied request-context and logging facilities and its own shutdown fence.
@@ -2779,6 +2958,13 @@ The provider-selection facet restores Helper ownership before model discovery or
2779
2958
  account description, retaining supplied-provider reuse, lifecycle gating and the
2780
2959
  original per-connection catalog cache. Authorized scope/account preparation,
2781
2960
  deadlines and result policy remain with the host.
2961
+ Provider lifecycle work retains its owner-local FIFO and shutdown task tracking.
2962
+ Its shared critical sections serialize only the same native runtime directory;
2963
+ a held catalogue in a different owner and runtime does not delay cached Stop or
2964
+ provider creation. Work in the same owner still follows its FIFO across runtime
2965
+ directories. Catalogue preparation remains tracked before its directory is known.
2966
+ Rejected work leaves both queues usable, and a settled runtime tail cannot remove
2967
+ newer queued work. Peer inventory, exit proof and recovery barriers are unchanged.
2782
2968
  Legacy detached host operations use that same owner's `acquireDetachedThread`,
2783
2969
  `detachedThreadId` and `dispatchDetachedTurn`. The ID projection accepts the
2784
2970
  original native response shapes and requested-thread fallback after either
@@ -116,7 +116,7 @@ navigation action without replacing the retained voice session.
116
116
 
117
117
  `VoiceConversation` accepts `adapter`, `session`, `disabled`, and controlled
118
118
  `avatarSize`, and emits `update:avatarSize`. `VoiceConversationHost` forwards that
119
- preference and event. Supply `v-model:avatar-size` from the application's existing
119
+ preference and event; its default is `hidden`. Supply `v-model:avatar-size` from the application's existing
120
120
  preference owner. Its avatar slot receives the original visual state plus the
121
121
  core slot's requested `size` and effective `height`; temporary clamping preserves
122
122
  the preference.
@@ -125,26 +125,81 @@ the preference.
125
125
  Set `binding.showAvatar: false` when using `VoiceConversationHost` to omit the
126
126
  portrait entirely. Caption-only views then give that space to the existing
127
127
  captions and controls; adapter-backed views omit the core avatar slot and its
128
- sizing control. This presentation choice does not change the retained session,
128
+ visibility control. This presentation choice does not change the retained session,
129
129
  typed draft, capture, review or playback operations.
130
130
 
131
131
  `VoiceConversationControls` reuses the session's original Talk/Pause gesture,
132
- speaker, Stop speaking, error and recording review operations. `compact` places
133
- 48px voice actions beside the ordinary composer tools and bounds the independent
134
- review textarea. Captured words stay explicitly Not sent until normal admission;
135
- review edits do not replace the typed draft. While capture, transcription or review
136
- needs resolving, the canonical typed composer stays editable and its Send is
137
- disabled. Finish the recording, then send or discard its reviewed words before
138
- sending the typed draft. This presentation guard keeps the original adapter's
132
+ speaker, Stop speaking, error and recording review operations. `compact` uses
133
+ 48px voice actions. Optional `iconOnly`, default `false`, replaces the Talk label
134
+ with its microphone icon while retaining the full state label in `aria-label`,
135
+ the gesture hint and the original pointer/keyboard handlers. The microphone
136
+ tooltip reads “click or long press to talk”.
137
+ Stop speaking keeps a 48px target. Icon-only Talk, speaker and the compact
138
+ settings cog use 32px visible circles inside transparent targets 40px wide and
139
+ 44px tall, with no gap between targets and 8px between visible circles. The
140
+ expanded avatar's minimise button uses the same compact target; collapsed Show
141
+ avatar keeps its 44px square target. All voice controls remain visible while idle. Stop speaking sits beside that pair without changing its position.
142
+ The adapter-backed voice view places these icons below the fixed upper-right
143
+ avatar, outside the composer. Hidden preserves the tools target. Its default
144
+ collapsed presentation shows passive Listening and Speaking icons only while
145
+ those states are active; Show avatar restores the ordinary controls. An idle or
146
+ muted microphone has no Listening indicator. Icon-only presentation omits the
147
+ routine Listening footer; errors, provisional words, review and sound recovery
148
+ remain visible.
149
+ Its `avatar-control` slot forwards the core scope for an always-visible control
150
+ supplied by the application. Hiding is presentation only; it does not pause
151
+ capture, cancel speech or end the session. Compact review keeps its
152
+ independent editable textarea beside the 48px Discard and Send actions, with up
153
+ to two rows and scrolling. Errors keep their full text in small body typography
154
+ to preserve readable history in short containers. Compact Talk keeps one bounded track across Talk, Pause,
155
+ Connecting and held-recording labels. In the labelled compact layout, space for Stop speaking and the normal
156
+ status line remains allocated while idle; an unavailable Stop speaking action
157
+ is absent from keyboard and accessibility navigation. These reservations keep
158
+ capture and playback state changes from moving Talk. Captured words stay
159
+ explicitly Not sent until normal admission;
160
+ review edits do not replace the typed draft. An open hands-free microphone
161
+ does not block typed steering. `session.composerBlocked` gates Send during startup and non-live or
162
+ non-hands-free capture, admission or review. Live hands-free keeps typed Send
163
+ available while spoken requests await admission;
164
+ `session.hasUnsentSpeech` independently protects target switching. The latest
165
+ recognized words remain observable through `binding.onTranscript`, including
166
+ while an earlier request awaits admission. Pause remains usable during that wait
167
+ and does not discard either recording or stop playback. This presentation guard keeps the original adapter's
139
168
  actions, attachments and questions. Send retries keep the recording's
140
169
  UUID and captured destination; Discard uses the original cleanup operation.
141
170
 
171
+ `onTranscript(transcript, { canTake })` preserves the original `{ id, text }` or
172
+ null projection and supplies eligibility for unsent-preview controls.
173
+ `session.takeTranscript(messageId, transfer?)` refuses wrong, admitted,
174
+ committing or sending messages. An optional synchronous `transfer(text)` must
175
+ recheck the host's empty typed draft, set it through its original setter, and
176
+ return true; false leaves speech untouched. Taking an active partial uses the
177
+ original capture cancellation and guarded hands-free restart, preserving the
178
+ session and playback. Taking a pending review clears only that review. Hosts
179
+ also gate these controls while their canonical delivery has uncertain admission.
180
+
142
181
  For custom compositions, its optional `toolsTarget` is a DOM element belonging
143
- to the local composer-tools slot. One controls instance moves its buttons there
144
- with Vue Teleport, while review and errors remain in composer-feedback. Keep
145
- that target mounted with the composer; there is no global portal or second
182
+ to the local host, such as an `avatar-tools` target. One controls instance moves
183
+ its buttons there with Vue Teleport, while review and errors stay in the host's
184
+ visible feedback region. Optional `feedbackTarget` moves those existing
185
+ feedback controls into a local composer element without creating another
186
+ controller or replacing its typed draft. Keep these targets mounted, including while the avatar
187
+ is hidden; there is no global portal or second
146
188
  gesture/session owner. With no target, the controls render together in place.
147
189
 
190
+ `VoiceConversationHost` accepts `presentation: 'dialog' | 'inline'`, defaulting
191
+ to `dialog`. Inline replaces the modal wrapper with an in-flow section using
192
+ the same settings, error, target-switch recovery and conversation slot. It omits
193
+ the separate window title, settings and close-button header. Its settings control
194
+ sits with the avatar tools when using the built-in conversation. It has
195
+ no scrim, activator, focus trap, floating reopen button or modal sizing. Its body
196
+ remains mounted for the retained session even when the controller is minimized.
197
+ The application chooses inline only while its existing conversation host is
198
+ present and chooses dialog for fallback; changing presentation does not end or
199
+ replace the controller/session. The `conversation` slot still receives
200
+ `{ binding, session, disabled }`, and the existing `settings` slot receives
201
+ `{ voice }` in either presentation.
202
+
148
203
  The host's optional `conversation` slot receives `{ binding, session, disabled }`
149
204
  and replaces its primary body. Settings, target-switch guards, minimizing,
150
205
  reopening and controller lifetime stay with the same host. An application can
@@ -176,8 +231,13 @@ target interrupts it.
176
231
  The speaker button changes the requested preference. Its optional
177
232
  `binding.onReadAloudChange(value)` callback runs only for that explicit change,
178
233
  never for preference hydration, microphone actions or navigation. The application
179
- owns storing it for the correct authenticated user. `defaults.readAloud` initializes
180
- a new session; it is not a second preference store. Sound on applies to future
234
+ owns storing it for the correct authenticated user. A live optional
235
+ `binding.readAloudChangePending: true` fences the next explicit preference change
236
+ before the local toggle. The session exposes that computed flag; controls disable
237
+ only the speaker choice (or an explicit `speakerDisabled` prop), leaving
238
+ **Enable sound**, microphone capture and typing available. `defaults.readAloud` initializes
239
+ a new session and hydrates a live boolean preference without emitting the callback;
240
+ it is not a second preference store. Sound on applies to future
181
241
  outputs and does not replay history. If browser playback is blocked, the speaker
182
242
  choice stays on and **Enable sound** retries unlocking it. Microphone permission
183
243
  and capture continue independently, including while sound unlock is pending.
@@ -193,7 +253,11 @@ Bindings may supply `defaults.mode` (`push-to-talk` or `hands-free`),
193
253
  `reviewBeforeSend`. The Talk/Pause microphone icon and speaker toggle show their states. The
194
254
  Voice settings cog loads the service's installed voices without recording.
195
255
  Pause finalizes the current utterance before muting, including buffered audio,
196
- and applies the recording's review preference. Resume starts a fresh recording.
256
+ and applies the recording's review preference. If an earlier request is pending,
257
+ Pause finishes the newer recording after that request settles. Resume keeps an
258
+ unfinished recording open or starts a fresh recording after it ends. Talk and
259
+ hold remain available during pending delivery, while transcribing and committing
260
+ retain their original guards.
197
261
  The review panel stays hidden during automatic admission; failed admission keeps
198
262
  the words and message identity available for review and retry.
199
263
  The retained-adapter view scrolls the shared full history while its composer and
@@ -363,3 +427,65 @@ through an application-authorized route; credentials stay on the server. The
363
427
  result contains `voices` (IDs, labels and optional languages) and `defaultVoice`,
364
428
  matching the WebSocket greeting. Listing voices does not synthesize or load
365
429
  additional voice models.
430
+
431
+ `VoiceConversationSettings` from `/client` extracts that same menu for hosts
432
+ which supply their own conversation body. Pass the existing `voice` object and
433
+ use its default slot for application-owned avatar and voice preferences. The
434
+ slot receives `{ voice }`; saved identity, scope, permissions and defaults remain
435
+ the application's responsibility. With no slot, opening connects the existing
436
+ voice object and lists installed voices, without recording. `compact` gives the
437
+ cog the same small visual circle and 48-pixel target as the avatar voice tools.
438
+ Use `VoiceConversationControls`'s `settings-control` slot to put it after the
439
+ microphone and speaker controls. A custom conversation body owns placement of
440
+ its extracted settings menu.
441
+
442
+ When Pause occurs while an earlier message is awaiting admission, the original
443
+ recording retains its words, ID and captured destination. Pause immediately mutes
444
+ input; once that earlier admission settles, the existing capture owner finalizes
445
+ and sends the retained utterance exactly once. Resuming before admission settles
446
+ keeps that recording open. Cancellation retires the requested finish; genuinely
447
+ unknown delivery remains unresolved until the person uses existing recovery.
448
+
449
+ ### Optional activity narration
450
+
451
+ A host can supply a live `binding.narration` object with `turns`, `loading`,
452
+ `working`, `eligible`, `vocalizeThinking`, `vocalizeInterimTurns` and
453
+ `thinkingSounds`. Without it, the existing canonical-answer behavior is unchanged.
454
+ The host owns these preferences and eligibility; JSKIT does not persist them or
455
+ change the shared default for read aloud.
456
+
457
+ The retained narration tracker observes thinking/commentary once, retires old or
458
+ disabled content, and settles an unchanged trailing phrase after 700ms while work
459
+ continues. The tracker retains the full activity history, so later short deltas can continue
460
+ beyond 4000 cumulative characters. The original splitter caps each newly observed
461
+ delta at 4000 characters before producing activity chunks of at most 300
462
+ characters; a larger single burst can lose its remaining tail. With thinking sounds
463
+ selected, an idle working conversation may say “Hmm...” after 20 seconds; it does
464
+ not overlap existing audio.
465
+
466
+ Optional activity joins the original speech queue. Canonical answers take priority
467
+ and keep their existing output IDs and playback callbacks. Activity and thinking
468
+ sounds have no canonical output identity and emit no `onPlayback` receipt; they
469
+ cannot satisfy lesson audio completion. Optional speech yields to microphone
470
+ startup, capture and transcription. Canonical answers retain full duplex playback.
471
+ Hiding the avatar is presentation only and does not disable either facility.
472
+
473
+ Stop speaking, speaker-off hydration, target retirement, loading, hidden pages and
474
+ close retire the applicable optional speech and timers. Returning or enabling a
475
+ flag does not replay old activity. An explicit new request or speaker choice can
476
+ lift the existing Stop-speaking silence policy; preference hydration never writes
477
+ back through `onReadAloudChange`.
478
+
479
+ For a binding that opts into narration, hiding the browser tab consumes newly
480
+ observed canonical outputs without speaking or replaying them on return. A
481
+ streamed output first finalized while hidden is interrupted with its existing
482
+ output ID, never reported as completed. Completed answers already queued while
483
+ visible may finish playing when no capture is active.
484
+
485
+ Hiding that tab cancels microphone startup and unfinished capture. These current
486
+ words are discarded under the original Main capture policy; an earlier pending,
487
+ admitted or unresolved delivery retains its text, ID and destination. Returning
488
+ does not restart capture; use Talk explicitly. This document-hidden boundary is
489
+ independent of avatar collapse or chat minimization, which preserve the session
490
+ and ordinary full duplex. Bindings without narration retain their existing tab
491
+ behavior; page suspension still uses the original transport recovery.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/agent-docs",
3
- "version": "0.1.198",
3
+ "version": "0.1.200",
4
4
  "description": "Distributed JSKIT agent references, prompts, guides, and generated reference maps.",
5
5
  "type": "module",
6
6
  "files": [
@@ -5,7 +5,7 @@
5
5
  "private": true,
6
6
  "type": "module",
7
7
  "dependencies": {
8
- "@jskit-ai/kernel": "0.1.226",
8
+ "@jskit-ai/kernel": "0.1.228",
9
9
  "json-rest-schema": "^1.0.17"
10
10
  },
11
11
  "exports": {
@@ -34,7 +34,7 @@
34
34
  "dependencies": {
35
35
  "@local/main": "0.1.0",
36
36
  "@fastify/static": "^10.1.3",
37
- "@jskit-ai/kernel": "0.1.226",
37
+ "@jskit-ai/kernel": "0.1.228",
38
38
  "@tanstack/vue-query": "^5.101.0",
39
39
  "fastify": "^5.8.5",
40
40
  "json-rest-schema": "^1.0.17",
@@ -42,13 +42,13 @@
42
42
  "vue": "^3.5.43",
43
43
  "vue-router": "^5.3.1",
44
44
  "vuetify": "^4.1.2",
45
- "@jskit-ai/http-runtime": "0.1.224",
45
+ "@jskit-ai/http-runtime": "0.1.226",
46
46
  "@fastify/fast-json-stringify-compiler": "^5.1.0",
47
47
  "@vue/devtools-api": "^8.2.1"
48
48
  },
49
49
  "devDependencies": {
50
- "@jskit-ai/config-eslint": "0.1.223",
51
- "@jskit-ai/jskit-catalog": "0.1.251",
50
+ "@jskit-ai/config-eslint": "0.1.225",
51
+ "@jskit-ai/jskit-catalog": "0.1.253",
52
52
  "@playwright/test": "1.61.1",
53
53
  "@vitejs/plugin-vue": "^6.0.7",
54
54
  "eslint": "^10.8.0",
@@ -34,7 +34,7 @@
34
34
  "dependencies": {
35
35
  "@local/main": "0.1.0",
36
36
  "@fastify/static": "^10.1.3",
37
- "@jskit-ai/kernel": "0.1.226",
37
+ "@jskit-ai/kernel": "0.1.228",
38
38
  "@tanstack/vue-query": "^5.101.0",
39
39
  "fastify": "^5.8.5",
40
40
  "json-rest-schema": "^1.0.17",
@@ -42,15 +42,15 @@
42
42
  "vue": "^3.5.43",
43
43
  "vue-router": "^5.3.1",
44
44
  "vuetify": "^4.1.2",
45
- "@jskit-ai/http-runtime": "0.1.224",
45
+ "@jskit-ai/http-runtime": "0.1.226",
46
46
  "@mdi/js": "^7.4.47",
47
- "@jskit-ai/shell-web": "0.1.230",
47
+ "@jskit-ai/shell-web": "0.1.232",
48
48
  "@fastify/fast-json-stringify-compiler": "^5.1.0",
49
49
  "@vue/devtools-api": "^8.2.1"
50
50
  },
51
51
  "devDependencies": {
52
- "@jskit-ai/config-eslint": "0.1.223",
53
- "@jskit-ai/jskit-catalog": "0.1.251",
52
+ "@jskit-ai/config-eslint": "0.1.225",
53
+ "@jskit-ai/jskit-catalog": "0.1.253",
54
54
  "@playwright/test": "1.61.1",
55
55
  "@vitejs/plugin-vue": "^6.0.7",
56
56
  "eslint": "^10.8.0",