fix(client): review fixes for invocation rendering and turn boundaries

The user-turn predicate (opensUserTurn) unifies the three parallel
consumers a new node kind silently missed — produced-files turn reset,
retry liveness, own-words force-scroll — so a skill invocation behaves as
the turn opener it is. The menu marker resolves through ctx.locale.bind
instead of a hand-rolled snapshot lookup; the dead legacy <skill> render
arm goes with the removal cut; command-over-skill name precedence is now
documented at the matchEnter seam; and the emptied replacement catalog
keeps the no-reload sentence, with the never-published residual recorded
in the Agent Note.
This commit is contained in:
Yichen Jiang
2026-08-08 11:30:16 +08:00
parent c4c2355b50
commit 31ed85900d
19 changed files with 77 additions and 31 deletions
@@ -45,6 +45,7 @@ export { createSnapshotStore, defineStore, shallowEqual } from './contract/store
export type {
EngineStoreHandle, EngineStoreInstance, ObservableSnapshot, SnapshotStore,
} from './contract/store.ts'
export { opensUserTurn } from './sessions/conversation.ts'
export type {
AssistantBlock, AssistantMessageNode, AssistantProvenanceView, AssistantRequestConfig,
AssistantTiming, CodeSubCall, CommandNode, CompactionSummaryNode, ComposerPhase,
@@ -258,6 +258,20 @@ export interface CommandNode {
outcome: { kind: 'success' | 'error'; text?: string } | null
}
/**
* Whether a node opens a user turn on the transcript surface. A direct user
* message and a user-explicit skill invocation both start the turn the next
* assistant answer closes; parallel consumers (turn boundaries, retry
* liveness, own-words scrolling) share this one predicate instead of each
* re-encoding the kind list. Steering stays out: an interjection lands
* mid-turn and closes nothing.
* @param node - any conversation node.
* @returns true for the user-turn-opening kinds.
*/
export function opensUserTurn(node: Pick<ConversationNode, 'kind'>): boolean {
return node.kind === 'user' || node.kind === 'skill-invocation'
}
/** Finalized conversation node union (kind discriminates; seq is the React key). */
export type ConversationNode =
| UserMessageNode