@prettier-ai/dsh-client-ui-chat 0.1.2-alpha.1

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 (76) hide show
  1. package/LICENSE +21 -0
  2. package/README.i18n.yaml +6 -0
  3. package/README.md +69 -0
  4. package/README.zh.md +69 -0
  5. package/lib/client.js +7588 -0
  6. package/lib/index.js +25 -0
  7. package/lib/invariant.js +16 -0
  8. package/lib/types/chat-settings.d.ts +20 -0
  9. package/lib/types/client/apply.d.ts +10 -0
  10. package/lib/types/client/chat/ApprovalCommand.d.ts +20 -0
  11. package/lib/types/client/chat/AssistantMarkdown.d.ts +22 -0
  12. package/lib/types/client/chat/AssistantNodeView.d.ts +4 -0
  13. package/lib/types/client/chat/ChatNodeSeat.d.ts +15 -0
  14. package/lib/types/client/chat/ChatView.d.ts +7 -0
  15. package/lib/types/client/chat/CommandNodeView.d.ts +9 -0
  16. package/lib/types/client/chat/CompactionCommandCard.d.ts +8 -0
  17. package/lib/types/client/chat/CompactionItem.d.ts +19 -0
  18. package/lib/types/client/chat/ContextBody.d.ts +131 -0
  19. package/lib/types/client/chat/ContextInjectionRow.d.ts +26 -0
  20. package/lib/types/client/chat/GenericCommandCard.d.ts +9 -0
  21. package/lib/types/client/chat/MessageIconActions.d.ts +36 -0
  22. package/lib/types/client/chat/MessageItem.d.ts +42 -0
  23. package/lib/types/client/chat/ReasoningRow.d.ts +14 -0
  24. package/lib/types/client/chat/StatsLine.d.ts +64 -0
  25. package/lib/types/client/chat/SystemPromptRow.d.ts +19 -0
  26. package/lib/types/client/chat/TurnNavigator.d.ts +21 -0
  27. package/lib/types/client/chat/TurnProcessNodeView.d.ts +4 -0
  28. package/lib/types/client/chat/TurnTailNodeView.d.ts +7 -0
  29. package/lib/types/client/chat/TurnUsageDisclosure.d.ts +9 -0
  30. package/lib/types/client/chat/message-chrome.d.ts +49 -0
  31. package/lib/types/client/chat/register-node-renderers.d.ts +7 -0
  32. package/lib/types/client/chat/searchable-hidden.d.ts +9 -0
  33. package/lib/types/client/chat/token-format.d.ts +25 -0
  34. package/lib/types/client/chat/turn-assistant.d.ts +8 -0
  35. package/lib/types/client/chat/use-calendar-day.d.ts +6 -0
  36. package/lib/types/client/chat/use-throttled-visual-update.d.ts +8 -0
  37. package/lib/types/client/contract/assistant-content.d.ts +9 -0
  38. package/lib/types/client/contract/chat-nodes.d.ts +110 -0
  39. package/lib/types/client/contract/slots.d.ts +195 -0
  40. package/lib/types/client/contract/snapshot.d.ts +65 -0
  41. package/lib/types/client/contract/store.d.ts +22 -0
  42. package/lib/types/client/contract/turn-metrics.d.ts +38 -0
  43. package/lib/types/client/contract/turn-process.d.ts +48 -0
  44. package/lib/types/client/conversation-nodes/assistant.d.ts +37 -0
  45. package/lib/types/client/conversation-nodes/chat-snapshot-builder.d.ts +42 -0
  46. package/lib/types/client/conversation-nodes/command.d.ts +54 -0
  47. package/lib/types/client/conversation-nodes/common.d.ts +41 -0
  48. package/lib/types/client/conversation-nodes/compaction.d.ts +22 -0
  49. package/lib/types/client/conversation-nodes/event-projection.d.ts +57 -0
  50. package/lib/types/client/conversation-nodes/fallback.d.ts +17 -0
  51. package/lib/types/client/conversation-nodes/inbox.d.ts +21 -0
  52. package/lib/types/client/conversation-nodes/message.d.ts +31 -0
  53. package/lib/types/client/conversation-nodes/partial.d.ts +34 -0
  54. package/lib/types/client/conversation-nodes/register.d.ts +7 -0
  55. package/lib/types/client/conversation-nodes/request-prompt.d.ts +30 -0
  56. package/lib/types/client/conversation-nodes/retry.d.ts +23 -0
  57. package/lib/types/client/conversation-nodes/tool.d.ts +23 -0
  58. package/lib/types/client/conversation-nodes/turn-error.d.ts +31 -0
  59. package/lib/types/client/conversation-nodes/turn-max-tokens.d.ts +23 -0
  60. package/lib/types/client/conversation-nodes/turn-navigation.d.ts +17 -0
  61. package/lib/types/client/conversation-nodes/turn-process.d.ts +32 -0
  62. package/lib/types/client/conversation-nodes/turn-tail.d.ts +28 -0
  63. package/lib/types/client/details/DetailsPanel.d.ts +4 -0
  64. package/lib/types/client/details/tool-node-reader.d.ts +9 -0
  65. package/lib/types/client/index.d.ts +36 -0
  66. package/lib/types/client/locale.d.ts +224 -0
  67. package/lib/types/client/markdown-labels.d.ts +10 -0
  68. package/lib/types/client/model/conversation-context.d.ts +22 -0
  69. package/lib/types/client/model/steering-history.d.ts +23 -0
  70. package/lib/types/client/model/tool-call-tree.d.ts +45 -0
  71. package/lib/types/client/settings/TranscriptViewRow.d.ts +22 -0
  72. package/lib/types/client/stores.d.ts +22 -0
  73. package/lib/types/client/transcript-view.d.ts +22 -0
  74. package/lib/types/index.d.ts +6 -0
  75. package/lib/types/invariant.d.ts +13 -0
  76. package/package.json +121 -0
@@ -0,0 +1,42 @@
1
+ import type { Context } from '@prettier-ai/cordis';
2
+ import type { ConversationTimelineSnapshot, ConversationViewBuilder, ConversationViewDefinition } from '@prettier-ai/dsh-client-ui-conversation/client';
3
+ import type { ChatConversationViewNode } from '../contract/chat-nodes.ts';
4
+ import type { ChatSnapshot } from '../contract/snapshot.ts';
5
+ /**
6
+ * Order visible Chat Nodes without changing existing relative order as process
7
+ * eligibility changes. Opening human input precedes process candidates, while
8
+ * each synthetic process control sits between them.
9
+ * @param nodes - currently materialized Chat Nodes.
10
+ * @returns visible Nodes in presentation order.
11
+ */
12
+ export declare function orderedVisibleChatNodes(nodes: readonly ChatConversationViewNode[]): ChatConversationViewNode[];
13
+ /** Incremental keyed Chat builder registered under the `chat` target. */
14
+ export declare class ChatSnapshotBuilder implements ConversationViewBuilder<ChatConversationViewNode, ChatSnapshot> {
15
+ private readonly store;
16
+ private readonly locations;
17
+ private readonly navigation;
18
+ private readonly legacy;
19
+ private readonly referenceLabels;
20
+ private order;
21
+ /** Last published timeline: a Turn boundary can land without a new node. */
22
+ private timeline;
23
+ readonly empty: ChatSnapshot;
24
+ constructor();
25
+ replace(input: {
26
+ readonly nodes: readonly ChatConversationViewNode[];
27
+ readonly timeline: ConversationTimelineSnapshot;
28
+ }): ChatSnapshot;
29
+ apply(input: {
30
+ readonly upserts: readonly ChatConversationViewNode[];
31
+ readonly timeline: ConversationTimelineSnapshot;
32
+ }): ChatSnapshot;
33
+ private snapshot;
34
+ }
35
+ /** Chat target factory contributed to the Conversation view registry. */
36
+ export declare const chatViewDefinition: ConversationViewDefinition<ChatConversationViewNode, ChatSnapshot>;
37
+ /**
38
+ * Register the incremental Chat target builder.
39
+ * @param ctx - owning UI Conversation context.
40
+ */
41
+ export declare function registerChatConversationView(ctx: Context): void;
42
+ //# sourceMappingURL=chat-snapshot-builder.d.ts.map
@@ -0,0 +1,54 @@
1
+ import type { Context } from '@prettier-ai/cordis';
2
+ import type { ConversationMatch, ConversationNodeDefinition } from '@prettier-ai/dsh-client-ui-conversation/client';
3
+ import type { CommandNode, CompactionSummaryNode } from '../contract/snapshot.ts';
4
+ declare module '../contract/chat-nodes.ts' {
5
+ interface ChatNodeDataMap {
6
+ /** Ordinary slash-command lifecycle. */
7
+ command: CommandNode;
8
+ /** Manual compact command combined with its compaction transaction. */
9
+ 'manual-compaction': ManualCompactionChatData;
10
+ }
11
+ }
12
+ type CommandId = CommandNode['commandId'];
13
+ interface CommandState {
14
+ readonly command: CommandNode;
15
+ readonly summary?: ConversationMatch;
16
+ readonly checkpoint?: ConversationMatch;
17
+ }
18
+ interface CompactionEvidence {
19
+ readonly summary?: ConversationMatch;
20
+ readonly checkpoint?: ConversationMatch;
21
+ }
22
+ /**
23
+ * Read correlation identity from a compaction replacement checkpoint.
24
+ * @param event - candidate Session event.
25
+ * @returns correlated compaction and optional command identity.
26
+ */
27
+ declare function compactSource(event: Parameters<ConversationNodeDefinition['match']>[0]): {
28
+ compactionId: string;
29
+ sourceCommandId?: CommandId;
30
+ } | undefined;
31
+ /**
32
+ * Build the visible summary marker from optional lifecycle evidence.
33
+ * @param match - compaction/summary Match, when loaded.
34
+ * @param checkpoint - replacement checkpoint Match.
35
+ * @returns final compaction summary Node data.
36
+ */
37
+ declare function compactSummary(match: ConversationMatch | undefined, checkpoint: ConversationMatch): CompactionSummaryNode;
38
+ /**
39
+ * Fold shared compaction evidence into a Definition-owned State.
40
+ * @param state - current business State carrying optional compaction evidence.
41
+ * @param match - next compaction lifecycle Match.
42
+ * @returns adopted State, preserving reference identity when the Match adds no evidence.
43
+ */
44
+ export declare function updateCompactionState<State extends CompactionEvidence>(state: State, match: ConversationMatch): State;
45
+ /** Slash-command lifecycle, including integrated manual compaction, Definition. */
46
+ export declare const commandDefinition: ConversationNodeDefinition<CommandState>;
47
+ /**
48
+ * Register the command lifecycle business contribution.
49
+ * @param ctx - owning UI Conversation context.
50
+ */
51
+ export declare function registerCommandConversationNode(ctx: Context): void;
52
+ /** Shared structural checkpoint recognizer for automatic compaction. */
53
+ export { compactSource, compactSummary };
54
+ //# sourceMappingURL=command.d.ts.map
@@ -0,0 +1,41 @@
1
+ import type { ConversationLocation, ConversationNodeContext } from '@prettier-ai/dsh-client-ui-conversation/client';
2
+ import type { ChatNode, ChatNodeDataMap, ChatNodeKind } from '../contract/chat-nodes.ts';
3
+ /**
4
+ * Relative positions in one durable event's seq neighborhood: interrupted
5
+ * Assistant, its follow-up Nodes, then follow-ups to an ordinary final. The
6
+ * max-tokens notice sits between a closing Assistant and the turn-tail so the
7
+ * tail stays the turn's last node and keeps its branch action enabled.
8
+ */
9
+ export declare const CHAT_SYNTHETIC_SEQ_OFFSETS: {
10
+ readonly interruptedAssistant: -0.9;
11
+ readonly interruptedFollowup: -0.8;
12
+ readonly processControl: -0.1;
13
+ readonly maxTokensNotice: 0.05;
14
+ readonly finalizedFollowup: 0.1;
15
+ };
16
+ /**
17
+ * Resolve one Context's best currently loaded event Location.
18
+ * @param context - assembled business Context.
19
+ * @returns start or first-match Location, otherwise unresolved.
20
+ */
21
+ export declare function contextLocation(context: ConversationNodeContext): ConversationLocation;
22
+ /**
23
+ * Build one final Chat target Node with the engine-owned stable key.
24
+ * @param context - assembled business Context.
25
+ * @param kind - Chat renderer dispatch key.
26
+ * @param anchorSeq - sortable render position.
27
+ * @param data - renderer-owned payload.
28
+ * @param options - optional Location and visibility overrides.
29
+ * @returns final Chat view Node.
30
+ */
31
+ export declare function chatNode<Kind extends ChatNodeKind>(context: ConversationNodeContext, kind: Kind, anchorSeq: number, data: ChatNodeDataMap[Kind], options?: {
32
+ readonly location?: ConversationLocation;
33
+ readonly visibility?: 'visible' | 'hidden';
34
+ }): ChatNode<Kind>;
35
+ /**
36
+ * Read a finite non-negative integer from a structurally narrowed payload.
37
+ * @param value - untrusted payload field.
38
+ * @returns valid coordinate, otherwise undefined.
39
+ */
40
+ export declare function coordinate(value: unknown): number | undefined;
41
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1,22 @@
1
+ import type { Context } from '@prettier-ai/cordis';
2
+ import type { ConversationMatch, ConversationNodeDefinition } from '@prettier-ai/dsh-client-ui-conversation/client';
3
+ import type { CompactionSummaryNode } from '../contract/snapshot.ts';
4
+ declare module '../contract/chat-nodes.ts' {
5
+ interface ChatNodeDataMap {
6
+ /** Automatic compaction checkpoint marker. */
7
+ compaction: CompactionSummaryNode;
8
+ }
9
+ }
10
+ interface CompactionState {
11
+ readonly summary?: ConversationMatch;
12
+ readonly checkpoint?: ConversationMatch;
13
+ }
14
+ /** Automatic compaction lifecycle and landed checkpoint Definition. */
15
+ export declare const compactionDefinition: ConversationNodeDefinition<CompactionState>;
16
+ /**
17
+ * Register the automatic-compaction business contribution.
18
+ * @param ctx - owning UI Conversation context.
19
+ */
20
+ export declare function registerCompactionConversationNode(ctx: Context): void;
21
+ export {};
22
+ //# sourceMappingURL=compaction.d.ts.map
@@ -0,0 +1,57 @@
1
+ /** Chat-owned conversion from durable Session events to Chat view data. */
2
+ import type { ContentBlock, StreamChunk } from '@prettier-ai/dsh-llm/types';
3
+ import type { AssistantBlock, ContextProvenanceView, KnownContextForm } from '@prettier-ai/dsh-client-ui-conversation/client';
4
+ /**
5
+ * Read the target-supported presentation form from a durable message source.
6
+ * @param source - Logged `user/message` source.
7
+ * @returns Supported form, or null for the opaque presentation.
8
+ */
9
+ export declare function contextForm(source: unknown): KnownContextForm | null;
10
+ /**
11
+ * Project a durable message source to the Chat row's role and producer label.
12
+ * @param source - Logged `user/message` source.
13
+ * @returns Role and label rendered by Chat.
14
+ */
15
+ export declare function contextProvenance(source: unknown): ContextProvenanceView;
16
+ /**
17
+ * Read distinct labels cited by a durable cross-session recall source.
18
+ * @param source - Logged `user/message` source.
19
+ * @returns Labels in first-seen order.
20
+ */
21
+ export declare function sessionRecallLabels(source: unknown): string[];
22
+ /**
23
+ * Classify finalized Assistant content for Chat rendering.
24
+ * @param content - Core content blocks.
25
+ * @returns Chat blocks in source order.
26
+ */
27
+ export declare function toAssistantBlocks(content: readonly ContentBlock[]): AssistantBlock[];
28
+ /**
29
+ * Classify one finalized Assistant block for Chat rendering.
30
+ * @param block - Core content block.
31
+ * @returns Chat block.
32
+ */
33
+ export declare function toAssistantBlock(block: ContentBlock): AssistantBlock;
34
+ /**
35
+ * Create the initial Chat block for one streamed Assistant block kind.
36
+ * @param blockType - Wire block kind.
37
+ * @returns Empty block ready to receive deltas.
38
+ */
39
+ export declare function emptyAssistantBlock(blockType: string): AssistantBlock;
40
+ /** Display-safe failure fields retained by Chat projections. */
41
+ export interface DisplayFailure {
42
+ readonly code?: string;
43
+ readonly message: string;
44
+ }
45
+ /**
46
+ * Convert a durable failure to locale-independent fields safe for Chat.
47
+ * @param failure - Failure preserved by a Session event.
48
+ * @returns Sanitized message and optional stable provider code.
49
+ */
50
+ export declare function displayFailure(failure: unknown): DisplayFailure;
51
+ /**
52
+ * Whether a stream chunk carries visible model output for Chat timing.
53
+ * @param chunk - Stream chunk to inspect.
54
+ * @returns true for a non-empty text, reasoning, or Tool-call delta.
55
+ */
56
+ export declare function isTokenDelta(chunk: StreamChunk): boolean;
57
+ //# sourceMappingURL=event-projection.d.ts.map
@@ -0,0 +1,17 @@
1
+ import type { Context } from '@prettier-ai/cordis';
2
+ import type { ConversationNodeDefinition } from '@prettier-ai/dsh-client-ui-conversation/client';
3
+ import type { UnknownSurfaceNode } from '../contract/snapshot.ts';
4
+ declare module '../contract/chat-nodes.ts' {
5
+ interface ChatNodeDataMap {
6
+ /** Generic presentation of an unclaimed append-surface event. */
7
+ unknown: UnknownSurfaceNode;
8
+ }
9
+ }
10
+ /** Unclaimed append-surface fallback Definition. */
11
+ export declare const unknownFallbackDefinition: ConversationNodeDefinition<UnknownSurfaceNode>;
12
+ /**
13
+ * Register the unmatched append-surface fallback contribution.
14
+ * @param ctx - owning UI Conversation context.
15
+ */
16
+ export declare function registerUnknownConversationFallback(ctx: Context): void;
17
+ //# sourceMappingURL=fallback.d.ts.map
@@ -0,0 +1,21 @@
1
+ import type { Context } from '@prettier-ai/cordis';
2
+ import type { ConversationNodeDefinition } from '@prettier-ai/dsh-client-ui-conversation/client';
3
+ interface InboxIdentity {
4
+ readonly id: string;
5
+ }
6
+ /** Cumulative state after one durable inbox splice. */
7
+ export interface InboxState {
8
+ readonly pending: readonly InboxIdentity[];
9
+ readonly claimed: ReadonlySet<string>;
10
+ }
11
+ /** Cumulative next-turn inbox splice Definition. */
12
+ export declare const nextTurnInboxDefinition: ConversationNodeDefinition<InboxState>;
13
+ /** Cumulative next-step inbox splice Definition used to classify steering. */
14
+ export declare const nextStepInboxDefinition: ConversationNodeDefinition<InboxState>;
15
+ /**
16
+ * Register the two durable Inbox-state contributions.
17
+ * @param ctx - owning UI Conversation context.
18
+ */
19
+ export declare function registerInboxConversationNodes(ctx: Context): void;
20
+ export {};
21
+ //# sourceMappingURL=inbox.d.ts.map
@@ -0,0 +1,31 @@
1
+ import type { Context } from '@prettier-ai/cordis';
2
+ import type { ConversationNodeDefinition } from '@prettier-ai/dsh-client-ui-conversation/client';
3
+ import type { ContextMessageNode, SteeringMessageNode, UserMessageNode } from '../contract/snapshot.ts';
4
+ interface ReferencedUserMessageNode extends UserMessageNode {
5
+ /** Labels cited by the immediately following session-reference context. */
6
+ readonly referenceLabels?: readonly string[];
7
+ }
8
+ interface ReferencedSteeringMessageNode extends SteeringMessageNode {
9
+ /** Labels cited by the immediately following session-reference context. */
10
+ readonly referenceLabels?: readonly string[];
11
+ }
12
+ type MessageNode = ReferencedUserMessageNode | ReferencedSteeringMessageNode | ContextMessageNode;
13
+ declare module '../contract/chat-nodes.ts' {
14
+ interface ChatNodeDataMap {
15
+ /** Ordinary turn-opening user message. */
16
+ user: ReferencedUserMessageNode;
17
+ /** User message admitted into an active turn. */
18
+ steering: ReferencedSteeringMessageNode;
19
+ /** Non-user context injected into model history. */
20
+ context: ContextMessageNode;
21
+ }
22
+ }
23
+ /** User, steering, and injected-context message classification Definition. */
24
+ export declare const messageDefinition: ConversationNodeDefinition<MessageNode>;
25
+ /**
26
+ * Register the user, steering, and injected-context message contribution.
27
+ * @param ctx - owning UI Conversation context.
28
+ */
29
+ export declare function registerMessageConversationNode(ctx: Context): void;
30
+ export {};
31
+ //# sourceMappingURL=message.d.ts.map
@@ -0,0 +1,34 @@
1
+ import type { StreamChunk } from '@prettier-ai/dsh-llm/types';
2
+ import type { AssistantBlock, PartialAssistant } from '../contract/snapshot.ts';
3
+ /**
4
+ * Whether a stream chunk changes the partial assistant projection shown by the UI.
5
+ * @param type - Stream chunk discriminant.
6
+ * @returns Whether publishing the accumulated partial can change the visible snapshot.
7
+ */
8
+ export declare function isVisibleAssistantChunk(type: string): boolean;
9
+ /** assistant/chunk accumulator: folds StreamChunks into AssistantBlock[] with block-level immutability. */
10
+ export declare class PartialAccumulator {
11
+ readonly turn: number;
12
+ readonly step: number;
13
+ private blocks;
14
+ private changed;
15
+ private snapshot;
16
+ /**
17
+ * @param turn - Owning agent turn.
18
+ * @param step - Owning model step.
19
+ * @param initialBlocks - Materialized prefix when accumulation begins after history replay.
20
+ */
21
+ constructor(turn: number, step: number, initialBlocks?: readonly AssistantBlock[]);
22
+ /**
23
+ * Fold one chunk.
24
+ * @param chunk - the stream chunk.
25
+ * @returns whether it caused a visible change (usage/finish return false, skipping notification).
26
+ */
27
+ push(chunk: StreamChunk): boolean;
28
+ /**
29
+ * Current partial projection.
30
+ * @returns the cached snapshot (the blocks array reference only changes after a mutation).
31
+ */
32
+ toPartial(): PartialAssistant;
33
+ }
34
+ //# sourceMappingURL=partial.d.ts.map
@@ -0,0 +1,7 @@
1
+ import type { Context } from '@prettier-ai/cordis';
2
+ /**
3
+ * Register the Chat business Definitions and target builder contributed by this package.
4
+ * @param ctx - owning UI Conversation context.
5
+ */
6
+ export declare function registerConversationNodes(ctx: Context): void;
7
+ //# sourceMappingURL=register.d.ts.map
@@ -0,0 +1,30 @@
1
+ import type { Context } from '@prettier-ai/cordis';
2
+ import type { ConversationNodeDefinition, RequestPromptInspector } from '@prettier-ai/dsh-client-ui-conversation/client';
3
+ declare module '../contract/chat-nodes.ts' {
4
+ interface ChatNodeDataMap {
5
+ /** Complete system prompt rendered for one model request. */
6
+ 'system-prompt': {
7
+ readonly text: string;
8
+ };
9
+ }
10
+ }
11
+ interface RequestPromptState extends ReturnType<RequestPromptInspector> {
12
+ readonly anchorSeq: number;
13
+ readonly showsPrompt: boolean;
14
+ readonly turn?: number;
15
+ readonly step?: number;
16
+ }
17
+ /**
18
+ * Request-header prompt Definition for the Chat target.
19
+ * @param inspect - the shared prompt interpretation, supplied by the
20
+ * uiConversation service (a client bundle cannot value-import it).
21
+ * @returns the Chat request-prompt Definition.
22
+ */
23
+ export declare function requestPromptDefinition(inspect: RequestPromptInspector): ConversationNodeDefinition<RequestPromptState>;
24
+ /**
25
+ * Register model-request system prompts in the Chat flow.
26
+ * @param ctx - Owning UI Conversation context.
27
+ */
28
+ export declare function registerRequestPromptConversationNode(ctx: Context): void;
29
+ export {};
30
+ //# sourceMappingURL=request-prompt.d.ts.map
@@ -0,0 +1,23 @@
1
+ import type { Context } from '@prettier-ai/cordis';
2
+ import type { ConversationNodeDefinition } from '@prettier-ai/dsh-client-ui-conversation/client';
3
+ import type { ModelRetryNode } from '../contract/snapshot.ts';
4
+ declare module '../contract/chat-nodes.ts' {
5
+ interface ChatNodeDataMap {
6
+ /** Producer-correlated model retry chain. */
7
+ 'model-retry': RetryChatData;
8
+ }
9
+ }
10
+ /** Accumulated retry attempts sharing one producer-owned RetryId. */
11
+ export interface RetryState {
12
+ readonly turn: number;
13
+ readonly step: number;
14
+ readonly attempts: readonly ModelRetryNode[];
15
+ }
16
+ /** Producer-correlated model retry chain Definition. */
17
+ export declare const retryDefinition: ConversationNodeDefinition<RetryState>;
18
+ /**
19
+ * Register the correlated model-retry business contribution.
20
+ * @param ctx - owning UI Conversation context.
21
+ */
22
+ export declare function registerRetryConversationNode(ctx: Context): void;
23
+ //# sourceMappingURL=retry.d.ts.map
@@ -0,0 +1,23 @@
1
+ import type { Context } from '@prettier-ai/cordis';
2
+ import type { ConversationNodeDefinition } from '@prettier-ai/dsh-client-ui-conversation/client';
3
+ import type { ToolCallBlock } from '../contract/snapshot.ts';
4
+ declare module '../contract/chat-nodes.ts' {
5
+ interface ChatNodeDataMap {
6
+ /** Root Tool lifecycle with recursively nested subcalls. */
7
+ 'tool-call': ToolChatData;
8
+ }
9
+ }
10
+ interface ToolState {
11
+ readonly root: ToolCallBlock;
12
+ readonly children: ReadonlyMap<string, readonly ToolCallBlock[]>;
13
+ readonly parents: ReadonlyMap<string, string>;
14
+ }
15
+ /** Root Tool lifecycle and nested Code Dispatch Definition. */
16
+ export declare const toolDefinition: ConversationNodeDefinition<ToolState>;
17
+ /**
18
+ * Register the root Tool lifecycle and nested-subcall contribution.
19
+ * @param ctx - owning UI Conversation context.
20
+ */
21
+ export declare function registerToolConversationNode(ctx: Context): void;
22
+ export {};
23
+ //# sourceMappingURL=tool.d.ts.map
@@ -0,0 +1,31 @@
1
+ import type { Context } from '@prettier-ai/cordis';
2
+ import type { ConversationNodeDefinition } from '@prettier-ai/dsh-client-ui-conversation/client';
3
+ import type { TurnErrorNode } from '../contract/snapshot.ts';
4
+ declare module '../contract/chat-nodes.ts' {
5
+ interface ChatNodeDataMap {
6
+ /** Terminal turn failure recorded on the turn's end reason. */
7
+ 'turn-error': TurnErrorNode;
8
+ }
9
+ }
10
+ interface TurnErrorState {
11
+ readonly turn: number;
12
+ readonly failure?: {
13
+ readonly seq: number;
14
+ readonly time: number;
15
+ readonly message: string;
16
+ readonly code?: string;
17
+ };
18
+ }
19
+ /**
20
+ * Terminal turn failure Definition. Retries run inside the failing turn, so the
21
+ * turn's `llm/retry` history never suppresses this terminal row; the model-retry
22
+ * node renders that history separately.
23
+ */
24
+ export declare const turnErrorDefinition: ConversationNodeDefinition<TurnErrorState>;
25
+ /**
26
+ * Register the terminal Turn-error business contribution.
27
+ * @param ctx - owning UI Conversation context.
28
+ */
29
+ export declare function registerTurnErrorConversationNode(ctx: Context): void;
30
+ export {};
31
+ //# sourceMappingURL=turn-error.d.ts.map
@@ -0,0 +1,23 @@
1
+ import type { Context } from '@prettier-ai/cordis';
2
+ import type { ConversationNodeDefinition } from '@prettier-ai/dsh-client-ui-conversation/client';
3
+ import type { TurnMaxTokensNode } from '../contract/snapshot.ts';
4
+ declare module '../contract/chat-nodes.ts' {
5
+ interface ChatNodeDataMap {
6
+ /** Turn ended by the per-request output-token cap. */
7
+ 'turn-max-tokens': TurnMaxTokensNode;
8
+ }
9
+ }
10
+ interface TurnMaxTokensState {
11
+ readonly turn: number;
12
+ readonly seq: number;
13
+ readonly time: number;
14
+ }
15
+ /** Notice Definition for a turn the provider ended at its output-token cap. */
16
+ export declare const turnMaxTokensDefinition: ConversationNodeDefinition<TurnMaxTokensState>;
17
+ /**
18
+ * Register the max-tokens turn-end notice contribution.
19
+ * @param ctx - owning UI Conversation context.
20
+ */
21
+ export declare function registerTurnMaxTokensConversationNode(ctx: Context): void;
22
+ export {};
23
+ //# sourceMappingURL=turn-max-tokens.d.ts.map
@@ -0,0 +1,17 @@
1
+ import type { ChatLocationNodeIndex, ChatNodeStore, TurnNavigationItem } from '../contract/snapshot.ts';
2
+ /**
3
+ * Whether two items carry the same rail state, so the reader can keep its array.
4
+ * @param left - previously published item, when the Turn had one.
5
+ * @param right - freshly derived item, when the Turn still has one.
6
+ * @returns whether both sides describe the same mark.
7
+ */
8
+ export declare function sameTurnNavigationItem(left: TurnNavigationItem | undefined, right: TurnNavigationItem | undefined): boolean;
9
+ /**
10
+ * Project one loaded Turn into its rail item.
11
+ * @param turn - Turn number the item addresses.
12
+ * @param locations - live Location index supplying the Turn's node keys.
13
+ * @param nodes - live Chat node store.
14
+ * @returns the item, or undefined when the Turn has no visible loaded node.
15
+ */
16
+ export declare function turnNavigationItem(turn: number, locations: ChatLocationNodeIndex, nodes: ChatNodeStore): TurnNavigationItem | undefined;
17
+ //# sourceMappingURL=turn-navigation.d.ts.map
@@ -0,0 +1,32 @@
1
+ import type { Context } from '@prettier-ai/cordis';
2
+ import type { ConversationNodeDefinition } from '@prettier-ai/dsh-client-ui-conversation/client';
3
+ import { type TurnProcessSignature } from '../contract/turn-process.ts';
4
+ declare module '../contract/chat-nodes.ts' {
5
+ interface ChatNodeDataMap {
6
+ /** Turn-level disclosure controlling process rows before the finalized answer. */
7
+ 'turn-process': import('../contract/chat-nodes.ts').TurnProcessChatData;
8
+ }
9
+ }
10
+ declare module '@prettier-ai/dsh-client-ui-conversation/client' {
11
+ interface ConversationTurnDataMap {
12
+ /** Encoded process range and finalized answer boundary for this Turn. */
13
+ 'turn-process': TurnProcessSignature;
14
+ }
15
+ }
16
+ interface TurnProcessState {
17
+ readonly turn: number;
18
+ readonly assistantStartByStep: ReadonlyMap<number, number>;
19
+ readonly messageCountByStep: ReadonlyMap<number, number>;
20
+ readonly otherStartSeq?: number;
21
+ readonly toolCallCount: number;
22
+ readonly subagentCount: number;
23
+ }
24
+ /** Turn-scoped process range and answer-boundary Definition. */
25
+ export declare const turnProcessDefinition: ConversationNodeDefinition<TurnProcessState>;
26
+ /**
27
+ * Register the Turn-scoped process disclosure projection.
28
+ * @param ctx - owning UI Conversation context.
29
+ */
30
+ export declare function registerTurnProcess(ctx: Context): void;
31
+ export {};
32
+ //# sourceMappingURL=turn-process.d.ts.map
@@ -0,0 +1,28 @@
1
+ import type { Context } from '@prettier-ai/cordis';
2
+ import type { ConversationMatch, ConversationNodeDefinition } from '@prettier-ai/dsh-client-ui-conversation/client';
3
+ import type { TurnTailChatData } from '../contract/chat-nodes.ts';
4
+ declare module '../contract/chat-nodes.ts' {
5
+ interface ChatNodeDataMap {
6
+ /** Completed-turn actions and extension tail. */
7
+ 'turn-tail': TurnTailChatData;
8
+ }
9
+ }
10
+ declare module '@prettier-ai/dsh-client-ui-conversation/client' {
11
+ interface ConversationTurnDataMap {
12
+ /** Closing Assistant and footer facts derived for this completed Turn. */
13
+ 'turn-tail': TurnTailChatData;
14
+ }
15
+ }
16
+ interface TurnTailState {
17
+ readonly turn: number;
18
+ readonly end?: ConversationMatch;
19
+ }
20
+ /** Completed-turn footer Definition independent of any Assistant row. */
21
+ export declare const turnTailDefinition: ConversationNodeDefinition<TurnTailState>;
22
+ /**
23
+ * Register completed-Turn footer data and its Chat node contribution.
24
+ * @param ctx - owning UI Conversation context.
25
+ */
26
+ export declare function registerTurnTailConversationNode(ctx: Context): void;
27
+ export {};
28
+ //# sourceMappingURL=turn-tail.d.ts.map
@@ -0,0 +1,4 @@
1
+ import type { DetailsSlotProps } from '../contract/slots.ts';
2
+ export type DetailsPanelProps = DetailsSlotProps;
3
+ export declare function DetailsPanel({ useChat, useSessions, sessionId, useStore, renderSlot, closeDetails, t }: DetailsPanelProps): import("react").JSX.Element;
4
+ //# sourceMappingURL=DetailsPanel.d.ts.map
@@ -0,0 +1,9 @@
1
+ import type { ChatSnapshot, ToolCallBlock } from '../contract/snapshot.ts';
2
+ /**
3
+ * Find any root or nested Tool lifecycle through the internal Node store.
4
+ * @param snapshot - current Conversation snapshot.
5
+ * @param callId - root or nested call identity.
6
+ * @returns current Tool lifecycle when materialized in the loaded window.
7
+ */
8
+ export declare function findToolCall(snapshot: ChatSnapshot, callId: string): ToolCallBlock | undefined;
9
+ //# sourceMappingURL=tool-node-reader.d.ts.map
@@ -0,0 +1,36 @@
1
+ /** Browser Chat target plugin. */
2
+ export { apply, inject } from './apply.ts';
3
+ export type {} from './conversation-nodes/assistant.ts';
4
+ export type {} from './conversation-nodes/command.ts';
5
+ export type {} from './conversation-nodes/compaction.ts';
6
+ export type {} from './conversation-nodes/fallback.ts';
7
+ export type {} from './conversation-nodes/message.ts';
8
+ export type {} from './conversation-nodes/request-prompt.ts';
9
+ export type {} from './conversation-nodes/retry.ts';
10
+ export type {} from './conversation-nodes/tool.ts';
11
+ export type {} from './conversation-nodes/turn-error.ts';
12
+ export type {} from './conversation-nodes/turn-max-tokens.ts';
13
+ export type {} from './conversation-nodes/turn-process.ts';
14
+ export type {} from './conversation-nodes/turn-tail.ts';
15
+ export type { AssistantBlock, AssistantMessageNode, AssistantProvenanceView, AssistantRequestConfig, AssistantTiming, ChatLocationNodeIndex, ChatNodeStore, ChatSnapshot, ChatTurnNavigationIndex, CommandNode, CompactionSummaryNode, ContextMessageNode, ConversationNode, LegacyConversationSlice, ModelRetryNode, PartialAssistant, RunningToolCall, SteeringMessageNode, ToolCallBlock, ToolResultNode, TurnErrorNode, TurnMaxTokensNode, TurnNavigationItem, UnknownSurfaceNode, UserMessageNode, } from './contract/snapshot.ts';
16
+ export type { AssistantChatData, ChatConversationViewNode, ChatNode, ChatNodeKind, FinalAssistantChatData, ManualCompactionChatData, RetryChatData, ToolChatData, TurnProcessChatData, TurnTailChatData, } from './contract/chat-nodes.ts';
17
+ export type { ChatStoreState, SelectionTarget, ToolCallId, TurnProcessViewEntry } from './contract/store.ts';
18
+ export type { TranscriptViewRowInjected, TranscriptViewRowProps } from './settings/TranscriptViewRow.tsx';
19
+ export type { TranscriptViewMode } from '../chat-settings.ts';
20
+ export type { AssistantActionOwnerProps, ChatFileMentions, ChatNodeOwnerProps, ChatNodeTurnDataInjected, ChatNodeViewProps, ChatScrollPosition, ChatStore, ChatViewInjected, ChatViewSlotProps, CommandRowOwnerProps, CommandRowProps, DetailsInjected, DetailsSlotProps, DetailsToolOwnerProps, MessageImagesProps, TurnProcessOwnerProps, TurnTailOwnerProps, UseChat, UseChatNodeTurnData, } from './contract/slots.ts';
21
+ export type { TurnProcessGeneration, TurnProcessSignature, TurnProcessSpec, } from './contract/turn-process.ts';
22
+ export type { ChatKey } from './locale.ts';
23
+ export type { ConversationContext, ConversationContextOriginKind } from './model/conversation-context.ts';
24
+ export type { ContextProvenanceView, ContextRole, KnownContextForm, } from '@prettier-ai/dsh-client-ui-conversation/client';
25
+ export type { ConversationPromptSnapshot, RequestInspectionSnapshot, RequestPromptChange, RequestView, } from '@prettier-ai/dsh-client-ui-conversation/client';
26
+ export { isRunningTool, isSettledTool } from './contract/chat-nodes.ts';
27
+ export { EMPTY_CHAT_SNAPSHOT } from './contract/snapshot.ts';
28
+ /** Public merge surface for Chat renderer payloads contributed by other plugins. */
29
+ export interface ChatNodeDataMap {
30
+ }
31
+ type PublicChatNodeDataMap = ChatNodeDataMap;
32
+ declare module './contract/chat-nodes.ts' {
33
+ interface ChatNodeDataMap extends PublicChatNodeDataMap {
34
+ }
35
+ }
36
+ //# sourceMappingURL=index.d.ts.map