@qilin-agent/client-ui-chat 0.0.0-stage → 3.1.4

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 (99) hide show
  1. package/LICENSE +21 -0
  2. package/README.i18n.yaml +55 -0
  3. package/README.md +132 -2
  4. package/README.zh.md +134 -0
  5. package/lib/client.js +13900 -0
  6. package/lib/index.js +54 -0
  7. package/lib/types/chat-settings.d.ts +47 -0
  8. package/lib/types/client/apply.d.ts +15 -0
  9. package/lib/types/client/chat/ApprovalCommand.d.ts +20 -0
  10. package/lib/types/client/chat/AssistantMarkdown.d.ts +52 -0
  11. package/lib/types/client/chat/AssistantNodeView.d.ts +7 -0
  12. package/lib/types/client/chat/ChatFlow.d.ts +4 -0
  13. package/lib/types/client/chat/ChatGroupSeat.d.ts +15 -0
  14. package/lib/types/client/chat/ChatNodeSeat.d.ts +25 -0
  15. package/lib/types/client/chat/ChatView.d.ts +7 -0
  16. package/lib/types/client/chat/CommandNodeView.d.ts +9 -0
  17. package/lib/types/client/chat/CompactionCommandCard.d.ts +8 -0
  18. package/lib/types/client/chat/CompactionItem.d.ts +19 -0
  19. package/lib/types/client/chat/ContextBody.d.ts +131 -0
  20. package/lib/types/client/chat/ContextInjectionRow.d.ts +26 -0
  21. package/lib/types/client/chat/GenericCommandCard.d.ts +9 -0
  22. package/lib/types/client/chat/MessageIconActions.d.ts +37 -0
  23. package/lib/types/client/chat/MessageItem.d.ts +42 -0
  24. package/lib/types/client/chat/ReasoningContent.d.ts +16 -0
  25. package/lib/types/client/chat/ReasoningRow.d.ts +23 -0
  26. package/lib/types/client/chat/RunningSeal.d.ts +6 -0
  27. package/lib/types/client/chat/RunningStatus.d.ts +13 -0
  28. package/lib/types/client/chat/StatsPills.d.ts +71 -0
  29. package/lib/types/client/chat/SystemPromptRow.d.ts +22 -0
  30. package/lib/types/client/chat/TurnNavigator.d.ts +28 -0
  31. package/lib/types/client/chat/TurnProcessNodeView.d.ts +4 -0
  32. package/lib/types/client/chat/TurnTailNodeView.d.ts +7 -0
  33. package/lib/types/client/chat/TurnTriggerNodeView.d.ts +4 -0
  34. package/lib/types/client/chat/TurnUsagePanel.d.ts +15 -0
  35. package/lib/types/client/chat/flow-motion.d.ts +59 -0
  36. package/lib/types/client/chat/message-chrome.d.ts +50 -0
  37. package/lib/types/client/chat/register-node-renderers.d.ts +14 -0
  38. package/lib/types/client/chat/render-entry.d.ts +9 -0
  39. package/lib/types/client/chat/searchable-hidden.d.ts +17 -0
  40. package/lib/types/client/chat/stat-dialog.d.ts +20 -0
  41. package/lib/types/client/chat/step-process.d.ts +11 -0
  42. package/lib/types/client/chat/token-format.d.ts +25 -0
  43. package/lib/types/client/chat/turn-assistant.d.ts +8 -0
  44. package/lib/types/client/chat/turn-rail-items.d.ts +37 -0
  45. package/lib/types/client/chat/turn-trigger.d.ts +15 -0
  46. package/lib/types/client/chat/use-calendar-day.d.ts +6 -0
  47. package/lib/types/client/chat/use-chat-navigation.d.ts +69 -0
  48. package/lib/types/client/chat/use-chat-reading.d.ts +110 -0
  49. package/lib/types/client/chat/use-chat-scroll.d.ts +43 -0
  50. package/lib/types/client/chat/use-chat-viewport.d.ts +197 -0
  51. package/lib/types/client/chat/use-disclosure.d.ts +15 -0
  52. package/lib/types/client/chat/use-process-scroll.d.ts +23 -0
  53. package/lib/types/client/chat/use-scroll-follow.d.ts +106 -0
  54. package/lib/types/client/chat/use-turn-data.d.ts +9 -0
  55. package/lib/types/client/contract/assistant-content.d.ts +9 -0
  56. package/lib/types/client/contract/chat-nodes.d.ts +108 -0
  57. package/lib/types/client/contract/chat-visibility.d.ts +10 -0
  58. package/lib/types/client/contract/process-groups.d.ts +25 -0
  59. package/lib/types/client/contract/slots.d.ts +340 -0
  60. package/lib/types/client/contract/snapshot.d.ts +107 -0
  61. package/lib/types/client/contract/store.d.ts +15 -0
  62. package/lib/types/client/contract/turn-metrics.d.ts +19 -0
  63. package/lib/types/client/contract/turn-process.d.ts +40 -0
  64. package/lib/types/client/conversation-nodes/assistant.d.ts +36 -0
  65. package/lib/types/client/conversation-nodes/chat-snapshot-builder.d.ts +103 -0
  66. package/lib/types/client/conversation-nodes/command.d.ts +53 -0
  67. package/lib/types/client/conversation-nodes/common.d.ts +41 -0
  68. package/lib/types/client/conversation-nodes/compaction.d.ts +21 -0
  69. package/lib/types/client/conversation-nodes/event-projection.d.ts +63 -0
  70. package/lib/types/client/conversation-nodes/fallback.d.ts +16 -0
  71. package/lib/types/client/conversation-nodes/inbox.d.ts +40 -0
  72. package/lib/types/client/conversation-nodes/message.d.ts +42 -0
  73. package/lib/types/client/conversation-nodes/process-activity.d.ts +9 -0
  74. package/lib/types/client/conversation-nodes/process-groups.d.ts +27 -0
  75. package/lib/types/client/conversation-nodes/register.d.ts +7 -0
  76. package/lib/types/client/conversation-nodes/request-prompt.d.ts +44 -0
  77. package/lib/types/client/conversation-nodes/retry.d.ts +22 -0
  78. package/lib/types/client/conversation-nodes/tool.d.ts +23 -0
  79. package/lib/types/client/conversation-nodes/turn-error.d.ts +30 -0
  80. package/lib/types/client/conversation-nodes/turn-max-tokens.d.ts +22 -0
  81. package/lib/types/client/conversation-nodes/turn-navigation.d.ts +17 -0
  82. package/lib/types/client/conversation-nodes/turn-process-presentation.d.ts +30 -0
  83. package/lib/types/client/conversation-nodes/turn-process.d.ts +34 -0
  84. package/lib/types/client/conversation-nodes/turn-tail.d.ts +28 -0
  85. package/lib/types/client/index.d.ts +38 -0
  86. package/lib/types/client/locale.d.ts +386 -0
  87. package/lib/types/client/markdown-labels.d.ts +10 -0
  88. package/lib/types/client/model/conversation-context.d.ts +21 -0
  89. package/lib/types/client/model/tool-call-tree.d.ts +45 -0
  90. package/lib/types/client/performance-usage.d.ts +20 -0
  91. package/lib/types/client/presentation-policy.d.ts +37 -0
  92. package/lib/types/client/settings/LinkOpeningRow.d.ts +24 -0
  93. package/lib/types/client/settings/PerformanceUsageRow.d.ts +22 -0
  94. package/lib/types/client/settings/PreferenceRow.d.ts +18 -0
  95. package/lib/types/client/settings/TranscriptViewRow.d.ts +27 -0
  96. package/lib/types/client/stores.d.ts +30 -0
  97. package/lib/types/client/transcript-view.d.ts +35 -0
  98. package/lib/types/index.d.ts +6 -0
  99. package/package.json +106 -3
@@ -0,0 +1,53 @@
1
+ import type { Context } from '@qilin-agent/kylin';
2
+ import type { CommandNode, CompactionSummaryNode, ConversationMatch, ConversationNodeDefinition } from '@qilin-agent/client-ui-conversation/client';
3
+ declare module '../contract/chat-nodes.ts' {
4
+ interface ChatNodeDataMap {
5
+ /** Ordinary slash-command lifecycle. */
6
+ command: CommandNode;
7
+ /** Manual compact command combined with its compaction transaction. */
8
+ 'manual-compaction': ManualCompactionChatData;
9
+ }
10
+ }
11
+ type CommandId = CommandNode['commandId'];
12
+ interface CommandState {
13
+ readonly command: CommandNode;
14
+ readonly summary?: ConversationMatch;
15
+ readonly checkpoint?: ConversationMatch;
16
+ }
17
+ interface CompactionEvidence {
18
+ readonly summary?: ConversationMatch;
19
+ readonly checkpoint?: ConversationMatch;
20
+ }
21
+ /**
22
+ * Read correlation identity from a compaction replacement checkpoint.
23
+ * @param event - candidate Session event.
24
+ * @returns correlated compaction and optional command identity.
25
+ */
26
+ declare function compactSource(event: Parameters<ConversationNodeDefinition['match']>[0]): {
27
+ compactionId: string;
28
+ sourceCommandId?: CommandId;
29
+ } | undefined;
30
+ /**
31
+ * Build the visible summary marker from optional lifecycle evidence.
32
+ * @param match - compaction/summary Match, when loaded.
33
+ * @param checkpoint - replacement checkpoint Match.
34
+ * @returns final compaction summary Node data.
35
+ */
36
+ declare function compactSummary(match: ConversationMatch | undefined, checkpoint: ConversationMatch): CompactionSummaryNode;
37
+ /**
38
+ * Fold shared compaction evidence into a Definition-owned State.
39
+ * @param state - current business State carrying optional compaction evidence.
40
+ * @param match - next compaction lifecycle Match.
41
+ * @returns adopted State, preserving reference identity when the Match adds no evidence.
42
+ */
43
+ export declare function updateCompactionState<State extends CompactionEvidence>(state: State, match: ConversationMatch): State;
44
+ /** Slash-command lifecycle, including integrated manual compaction, Definition. */
45
+ export declare const commandDefinition: ConversationNodeDefinition<CommandState>;
46
+ /**
47
+ * Register the command lifecycle business contribution.
48
+ * @param ctx - owning UI Conversation context.
49
+ */
50
+ export declare function registerCommandConversationNode(ctx: Context): void;
51
+ /** Shared structural checkpoint recognizer for automatic compaction. */
52
+ export { compactSource, compactSummary };
53
+ //# sourceMappingURL=command.d.ts.map
@@ -0,0 +1,41 @@
1
+ import type { ConversationLocation, ConversationNodeContext } from '@qilin-agent/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,21 @@
1
+ import type { Context } from '@qilin-agent/kylin';
2
+ import type { CompactionSummaryNode, ConversationMatch, ConversationNodeDefinition } from '@qilin-agent/client-ui-conversation/client';
3
+ declare module '../contract/chat-nodes.ts' {
4
+ interface ChatNodeDataMap {
5
+ /** Automatic compaction checkpoint marker. */
6
+ compaction: CompactionSummaryNode;
7
+ }
8
+ }
9
+ interface CompactionState {
10
+ readonly summary?: ConversationMatch;
11
+ readonly checkpoint?: ConversationMatch;
12
+ }
13
+ /** Automatic compaction lifecycle and landed checkpoint Definition. */
14
+ export declare const compactionDefinition: ConversationNodeDefinition<CompactionState>;
15
+ /**
16
+ * Register the automatic-compaction business contribution.
17
+ * @param ctx - owning UI Conversation context.
18
+ */
19
+ export declare function registerCompactionConversationNode(ctx: Context): void;
20
+ export {};
21
+ //# sourceMappingURL=compaction.d.ts.map
@@ -0,0 +1,63 @@
1
+ /** Chat-owned conversion from durable Session events to Chat view data. */
2
+ import type { ContentBlock, StreamChunk } from '@qilin-agent/llm/types';
3
+ import type { AssistantBlock, ContextProducerView, KnownContextForm } from '@qilin-agent/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 contextProducer(source: unknown): ContextProducerView;
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
+ * Read the skill name a durable skill-invocation injection loaded.
24
+ * @param source - Logged `user/message` source.
25
+ * @returns The skill name, or null for every other source.
26
+ */
27
+ export declare function skillInvocationName(source: unknown): string | null;
28
+ /**
29
+ * Classify finalized Assistant content for Chat rendering.
30
+ * @param content - Core content blocks.
31
+ * @returns Chat blocks in source order.
32
+ */
33
+ export declare function toAssistantBlocks(content: readonly ContentBlock[]): AssistantBlock[];
34
+ /**
35
+ * Classify one finalized Assistant block for Chat rendering.
36
+ * @param block - Core content block.
37
+ * @returns Chat block.
38
+ */
39
+ export declare function toAssistantBlock(block: ContentBlock): AssistantBlock;
40
+ /**
41
+ * Create the initial Chat block for one streamed Assistant block kind.
42
+ * @param blockType - Wire block kind.
43
+ * @returns Empty block ready to receive deltas.
44
+ */
45
+ export declare function emptyAssistantBlock(blockType: string): AssistantBlock;
46
+ /** Display-safe failure fields retained by Chat projections. */
47
+ export interface DisplayFailure {
48
+ readonly code?: string;
49
+ readonly message: string;
50
+ }
51
+ /**
52
+ * Convert a durable failure to locale-independent fields safe for Chat.
53
+ * @param failure - Failure preserved by a Session event.
54
+ * @returns Sanitized message and optional stable provider code.
55
+ */
56
+ export declare function displayFailure(failure: unknown): DisplayFailure;
57
+ /**
58
+ * Whether a stream chunk carries visible model output for Chat timing.
59
+ * @param chunk - Stream chunk to inspect.
60
+ * @returns true for a non-empty text, reasoning, or Tool-call delta.
61
+ */
62
+ export declare function isTokenDelta(chunk: StreamChunk): boolean;
63
+ //# sourceMappingURL=event-projection.d.ts.map
@@ -0,0 +1,16 @@
1
+ import type { Context } from '@qilin-agent/kylin';
2
+ import type { ConversationNodeDefinition, UnknownSurfaceNode } from '@qilin-agent/client-ui-conversation/client';
3
+ declare module '../contract/chat-nodes.ts' {
4
+ interface ChatNodeDataMap {
5
+ /** Generic presentation of an unclaimed append-surface event. */
6
+ unknown: UnknownSurfaceNode;
7
+ }
8
+ }
9
+ /** Unclaimed append-surface fallback Definition. */
10
+ export declare const unknownFallbackDefinition: ConversationNodeDefinition<UnknownSurfaceNode>;
11
+ /**
12
+ * Register the unmatched append-surface fallback contribution.
13
+ * @param ctx - owning UI Conversation context.
14
+ */
15
+ export declare function registerUnknownConversationFallback(ctx: Context): void;
16
+ //# sourceMappingURL=fallback.d.ts.map
@@ -0,0 +1,40 @@
1
+ import type { Context } from '@qilin-agent/kylin';
2
+ import type { ConversationNodeDefinition } from '@qilin-agent/client-ui-conversation/client';
3
+ interface InboxIdentity {
4
+ readonly id: string;
5
+ readonly source: {
6
+ readonly kind: string;
7
+ };
8
+ }
9
+ interface PendingSnapshot {
10
+ readonly kind: 'snapshot';
11
+ readonly ids: readonly InboxIdentity[];
12
+ }
13
+ interface PendingSplice {
14
+ readonly kind: 'splice';
15
+ readonly previous: PendingState;
16
+ readonly start: number;
17
+ readonly removedCount: number;
18
+ readonly inserted: readonly InboxIdentity[];
19
+ }
20
+ type PendingState = PendingSnapshot | PendingSplice;
21
+ /** Persistent Inbox state after one durable Inbox splice. */
22
+ export interface InboxState {
23
+ /** Persistent splice chain materialized only when a batch is claimed. */
24
+ readonly pending: PendingState;
25
+ /** Message ids in the current claim, shared until the next claim. */
26
+ readonly currentClaimed: ReadonlySet<string>;
27
+ readonly claimSeq: number;
28
+ readonly claimedHuman: boolean;
29
+ }
30
+ /** Persistent next-step claims identify messages admitted into a running Turn. */
31
+ export declare const nextStepInboxDefinition: ConversationNodeDefinition<InboxState>;
32
+ /** Persistent next-turn claims identify messages that wake a new Turn. */
33
+ export declare const nextTurnInboxDefinition: ConversationNodeDefinition<InboxState>;
34
+ /**
35
+ * Register the Inbox state used by Chat message classification.
36
+ * @param ctx - owning UI Conversation context.
37
+ */
38
+ export declare function registerInboxConversationNodes(ctx: Context): void;
39
+ export {};
40
+ //# sourceMappingURL=inbox.d.ts.map
@@ -0,0 +1,42 @@
1
+ import type { Context } from '@qilin-agent/kylin';
2
+ import type { ContextMessageNode, ConversationNodeDefinition, SteeringMessageNode, UserMessageNode } from '@qilin-agent/client-ui-conversation/client';
3
+ interface ReferencedUserMessageNode extends UserMessageNode {
4
+ /** Labels cited by the immediately following session-reference context. */
5
+ readonly referenceLabels?: readonly string[];
6
+ /** Skill names the same step's `skill-invocation` injections loaded. */
7
+ readonly skillNames?: readonly string[];
8
+ }
9
+ interface ReferencedSteeringMessageNode extends SteeringMessageNode {
10
+ /** Labels cited by the immediately following session-reference context. */
11
+ readonly referenceLabels?: readonly string[];
12
+ /** Skill names the same step's `skill-invocation` injections loaded. */
13
+ readonly skillNames?: readonly string[];
14
+ }
15
+ type MessageNode = ReferencedUserMessageNode | ReferencedSteeringMessageNode | (ContextMessageNode & {
16
+ readonly waking?: boolean;
17
+ });
18
+ declare module '../contract/chat-nodes.ts' {
19
+ interface ChatNodeDataMap {
20
+ /** Ordinary turn-opening user message. */
21
+ user: ReferencedUserMessageNode;
22
+ /** User message admitted into an active turn. */
23
+ steering: ReferencedSteeringMessageNode;
24
+ /** Non-user context injected into model history. */
25
+ context: ContextMessageNode;
26
+ /** Developer history: context presentation over a developer-role event. */
27
+ 'developer-message': ContextMessageNode;
28
+ /** Non-human input that starts a Turn. */
29
+ 'turn-trigger': ContextMessageNode;
30
+ }
31
+ }
32
+ /** User, steering, and injected-context message classification Definition. */
33
+ export declare const messageDefinition: ConversationNodeDefinition<MessageNode>;
34
+ /** Developer history uses the input-message lifecycle and context presentation. */
35
+ export declare const developerMessageDefinition: ConversationNodeDefinition<MessageNode>;
36
+ /**
37
+ * Register the user, steering, injected-context, and developer message contributions.
38
+ * @param ctx - owning UI Conversation context.
39
+ */
40
+ export declare function registerMessageConversationNode(ctx: Context): void;
41
+ export {};
42
+ //# sourceMappingURL=message.d.ts.map
@@ -0,0 +1,9 @@
1
+ import type { ProcessActivitySummary } from '../contract/process-groups.ts';
2
+ import type { ChatNode } from '../contract/chat-nodes.ts';
3
+ /**
4
+ * Rank categories by distinct call count, breaking ties by first appearance.
5
+ * @param nodes - process members, including recursive tools.
6
+ * @returns all ranked categories and the latest running tool category and bounded task detail.
7
+ */
8
+ export declare function processActivity(nodes: readonly ChatNode[]): ProcessActivitySummary;
9
+ //# sourceMappingURL=process-activity.d.ts.map
@@ -0,0 +1,27 @@
1
+ import type { ConversationGroupDefinition, ConversationGroupInput, GroupUpdate } from '@qilin-agent/client-ui-conversation/client';
2
+ import type { ChatConversationViewNode } from '../contract/chat-nodes.ts';
3
+ import type { ProcessGroupData } from '../contract/process-groups.ts';
4
+ type ProcessInput = ConversationGroupInput<ChatConversationViewNode>;
5
+ /** Session-local Turn results; ordinary updates never read other Turns' Node contents. */
6
+ export declare class ProcessState {
7
+ private turns;
8
+ private order;
9
+ private pending;
10
+ /**
11
+ * Consume one synchronous Builder input without retaining its readers.
12
+ * @param input - projected Node changes, indexed positions, and Turn lifecycle.
13
+ */
14
+ accept(input: ProcessInput): void;
15
+ private rootEntries;
16
+ /**
17
+ * Read pending output without advancing State.
18
+ * @returns the repeatable update for the last input batch.
19
+ */
20
+ output(): GroupUpdate<ProcessGroupData> | null;
21
+ }
22
+ /** Chat's registered business grouping; presentation modes never enter its State. */
23
+ export declare const processGroupDefinition: ConversationGroupDefinition<ChatConversationViewNode, ProcessState, ProcessGroupData> & {
24
+ readonly target: 'chat';
25
+ };
26
+ export {};
27
+ //# sourceMappingURL=process-groups.d.ts.map
@@ -0,0 +1,7 @@
1
+ import type { Context } from '@qilin-agent/kylin';
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,44 @@
1
+ import type { Context } from '@qilin-agent/kylin';
2
+ import type { ConversationNodeDefinition, RequestPromptInspector, SystemPromptState, SystemPromptInspector } from '@qilin-agent/client-ui-conversation/client';
3
+ declare module '../contract/chat-nodes.ts' {
4
+ interface ChatNodeDataMap {
5
+ /** Complete system prompt rendered for one model request, or an in-history prompt update at its own position. */
6
+ 'system-prompt': {
7
+ readonly text: string;
8
+ readonly update?: true;
9
+ };
10
+ }
11
+ }
12
+ interface RequestPromptState extends ReturnType<RequestPromptInspector> {
13
+ readonly anchorSeq: number;
14
+ readonly showsPrompt: boolean;
15
+ readonly turn?: number;
16
+ readonly step?: number;
17
+ }
18
+ /**
19
+ * System-prompt surface node Definition for the Chat target. It owns every
20
+ * `system/message` event on the Chat target so the unknown-surface fallback
21
+ * never renders the prompt as a transcript row. Each nonempty append owns a
22
+ * prompt card, even without a loaded request header. Initial cards precede
23
+ * their step's input; in-history updates stay at their own positions. The
24
+ * request-prompt Definition owns replacement and later-series cards. Positional
25
+ * replacements advance the effective prompt without changing historical cards.
26
+ * @param inspect - Pure surface interpretation supplied by uiConversation.
27
+ * @returns The Chat system-prompt Definition.
28
+ */
29
+ export declare function systemMessageDefinition(inspect: SystemPromptInspector): ConversationNodeDefinition<SystemPromptState>;
30
+ /**
31
+ * Request-header prompt Definition for the Chat target. Resume and explicit
32
+ * series starts retain a prompt card even when the system text is unchanged.
33
+ * @param inspect - the shared prompt interpretation, supplied by the
34
+ * uiConversation service (a client bundle cannot value-import it).
35
+ * @returns the Chat request-prompt Definition.
36
+ */
37
+ export declare function requestPromptDefinition(inspect: RequestPromptInspector): ConversationNodeDefinition<RequestPromptState>;
38
+ /**
39
+ * Register the system-prompt surface node and the model-request prompt card in the Chat flow.
40
+ * @param ctx - Owning UI Conversation context.
41
+ */
42
+ export declare function registerRequestPromptConversationNode(ctx: Context): void;
43
+ export {};
44
+ //# sourceMappingURL=request-prompt.d.ts.map
@@ -0,0 +1,22 @@
1
+ import type { Context } from '@qilin-agent/kylin';
2
+ import type { ConversationNodeDefinition, ModelRetryNode } from '@qilin-agent/client-ui-conversation/client';
3
+ declare module '../contract/chat-nodes.ts' {
4
+ interface ChatNodeDataMap {
5
+ /** Producer-correlated model retry chain. */
6
+ 'model-retry': RetryChatData;
7
+ }
8
+ }
9
+ /** Accumulated retry attempts sharing one producer-owned RetryId. */
10
+ export interface RetryState {
11
+ readonly turn: number;
12
+ readonly step: number;
13
+ readonly attempts: readonly ModelRetryNode[];
14
+ }
15
+ /** Producer-correlated model retry chain Definition. */
16
+ export declare const retryDefinition: ConversationNodeDefinition<RetryState>;
17
+ /**
18
+ * Register the correlated model-retry business contribution.
19
+ * @param ctx - owning UI Conversation context.
20
+ */
21
+ export declare function registerRetryConversationNode(ctx: Context): void;
22
+ //# sourceMappingURL=retry.d.ts.map
@@ -0,0 +1,23 @@
1
+ import type { Context } from '@qilin-agent/kylin';
2
+ import type { ConversationNodeDefinition, ToolCallBlock } from '@qilin-agent/client-ui-conversation/client';
3
+ declare module '../contract/chat-nodes.ts' {
4
+ interface ChatNodeDataMap {
5
+ /** Root Tool lifecycle with recursively nested subcalls. */
6
+ 'tool-call': ToolChatData;
7
+ }
8
+ }
9
+ interface ToolState {
10
+ /** Absent until a named delta or `tool/call` identifies the call. */
11
+ readonly root: ToolCallBlock | undefined;
12
+ readonly children: ReadonlyMap<string, readonly ToolCallBlock[]>;
13
+ readonly parents: ReadonlyMap<string, string>;
14
+ }
15
+ /** Root Tool preparation, dispatch, result, and nested PTC calls. */
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,30 @@
1
+ import type { Context } from '@qilin-agent/kylin';
2
+ import type { ConversationNodeDefinition, TurnErrorNode } from '@qilin-agent/client-ui-conversation/client';
3
+ declare module '../contract/chat-nodes.ts' {
4
+ interface ChatNodeDataMap {
5
+ /** Terminal turn failure recorded on the turn's end reason. */
6
+ 'turn-error': TurnErrorNode;
7
+ }
8
+ }
9
+ interface TurnErrorState {
10
+ readonly turn: number;
11
+ readonly failure?: {
12
+ readonly seq: number;
13
+ readonly time: number;
14
+ readonly message: string;
15
+ readonly code?: string;
16
+ };
17
+ }
18
+ /**
19
+ * Terminal turn failure Definition. Retries run inside the failing turn, so the
20
+ * turn's `llm/retry` history never suppresses this terminal row; the model-retry
21
+ * node renders that history separately.
22
+ */
23
+ export declare const turnErrorDefinition: ConversationNodeDefinition<TurnErrorState>;
24
+ /**
25
+ * Register the terminal Turn-error business contribution.
26
+ * @param ctx - owning UI Conversation context.
27
+ */
28
+ export declare function registerTurnErrorConversationNode(ctx: Context): void;
29
+ export {};
30
+ //# sourceMappingURL=turn-error.d.ts.map
@@ -0,0 +1,22 @@
1
+ import type { Context } from '@qilin-agent/kylin';
2
+ import type { ConversationNodeDefinition, TurnMaxTokensNode } from '@qilin-agent/client-ui-conversation/client';
3
+ declare module '../contract/chat-nodes.ts' {
4
+ interface ChatNodeDataMap {
5
+ /** Turn ended by the per-request output-token cap. */
6
+ 'turn-max-tokens': TurnMaxTokensNode;
7
+ }
8
+ }
9
+ interface TurnMaxTokensState {
10
+ readonly turn: number;
11
+ readonly seq: number;
12
+ readonly time: number;
13
+ }
14
+ /** Notice Definition for a turn the provider ended at its output-token cap. */
15
+ export declare const turnMaxTokensDefinition: ConversationNodeDefinition<TurnMaxTokensState>;
16
+ /**
17
+ * Register the max-tokens turn-end notice contribution.
18
+ * @param ctx - owning UI Conversation context.
19
+ */
20
+ export declare function registerTurnMaxTokensConversationNode(ctx: Context): void;
21
+ export {};
22
+ //# 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,30 @@
1
+ import type { ChatNode } from '../contract/chat-nodes.ts';
2
+ import type { ChatLocationNodeIndex, ChatNodeStore, ChatTurnProcessPresentation } from '../contract/snapshot.ts';
3
+ /** Mutable projection of cross-Node process layout facts by Turn. */
4
+ export declare class ChatTurnProcessProjector {
5
+ private presentations;
6
+ /**
7
+ * Read the retained process presentation for a Node's Turn.
8
+ * @param node - Current Chat Node.
9
+ * @returns The Turn's process presentation, when present.
10
+ */
11
+ get(node: ChatNode | undefined): ChatTurnProcessPresentation | undefined;
12
+ /**
13
+ * Replace every projected Turn.
14
+ * @param order - visible Chat Node order.
15
+ * @param locations - current Chat Location index.
16
+ * @param nodes - current Chat Node store.
17
+ * @returns Turns whose process presentation changed.
18
+ */
19
+ replace(order: readonly string[], locations: ChatLocationNodeIndex, nodes: ChatNodeStore): ReadonlySet<number>;
20
+ /**
21
+ * Recompute selected Turns after incremental Node changes.
22
+ * @param turns - affected Turn numbers.
23
+ * @param locations - current Chat Location index.
24
+ * @param nodes - current Chat Node store.
25
+ * @returns Turns whose process presentation changed.
26
+ */
27
+ update(turns: ReadonlySet<number>, locations: ChatLocationNodeIndex, nodes: ChatNodeStore): ReadonlySet<number>;
28
+ private set;
29
+ }
30
+ //# sourceMappingURL=turn-process-presentation.d.ts.map
@@ -0,0 +1,34 @@
1
+ import type { Context } from '@qilin-agent/kylin';
2
+ import type { ConversationNodeDefinition } from '@qilin-agent/client-ui-conversation/client';
3
+ import { type TurnProcessSpec } 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 '@qilin-agent/client-ui-conversation/client' {
11
+ interface ConversationTurnDataMap {
12
+ /** Process range and finalized answer boundary for this Turn. */
13
+ 'turn-process': TurnProcessSpec;
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 controlAnchorSeq?: number;
22
+ readonly messageCount: number;
23
+ readonly toolCallCount: number;
24
+ readonly subagentCount: number;
25
+ }
26
+ /** Turn-scoped process range and answer-boundary Definition. */
27
+ export declare const turnProcessDefinition: ConversationNodeDefinition<TurnProcessState>;
28
+ /**
29
+ * Register the Turn-scoped process disclosure projection.
30
+ * @param ctx - owning UI Conversation context.
31
+ */
32
+ export declare function registerTurnProcess(ctx: Context): void;
33
+ export {};
34
+ //# sourceMappingURL=turn-process.d.ts.map
@@ -0,0 +1,28 @@
1
+ import type { Context } from '@qilin-agent/kylin';
2
+ import type { ConversationMatch, ConversationNodeDefinition } from '@qilin-agent/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 '@qilin-agent/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,38 @@
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, AssistantProviderMetadataView, AssistantRequestConfig, AssistantTiming, ChatLocationNodeIndex, ChatNodeProcessSource, ChatNodeSource, ChatNodeStore, ChatSnapshot, ChatTurnNavigationIndex, ChatTurnProcessPresentation, CommandNode, CompactionSummaryNode, ContextMessageNode, ConversationNode, LegacyConversationSlice, ModelRetryNode, PartialAssistant, PreparingToolCall, RunningToolCall, StartedToolCall, SteeringMessageNode, ToolArgs, 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, 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 { ChatPresentationPolicy } from './presentation-policy.ts';
21
+ export type { AssistantActionOwnerProps, ChatFileMentions, ChatNodeHookContext, ChatNodeInjected, ChatNodeOwnerProps, ChatNodeViewProps, ChatScrollPosition, ChatStore, ChatViewInjected, ChatViewSlotProps, ChatFlowDataInjected, ChatFlowHookContext, ChatFlowInjected, ChatFlowOwnerProps, ChatFlowSlotProps, UseGroupHeaderAction, ReasoningBodyOwnerProps, ReasoningContentInput, CommandRowOwnerProps, CommandRowProps, MessageImagesProps, OpenFileOptions, PerformanceUsageInjected, PresentationInjected, TurnProcessOwnerProps, TurnTailOwnerProps, UseChat, UseChatNodeTurnData, UseDisclosure, UsePresentation, UseGroupAction, } from './contract/slots.ts';
22
+ export type { ProcessActivity, ProcessActivitySummary, ProcessGroupData, } from './contract/process-groups.ts';
23
+ export type { TurnProcessSpec, } from './contract/turn-process.ts';
24
+ export type { ChatKey } from './locale.ts';
25
+ export type { ConversationContext, ConversationContextOriginKind } from './model/conversation-context.ts';
26
+ export type { ContextProducerView, ContextRole, KnownContextForm, } from '@qilin-agent/client-ui-conversation/client';
27
+ export type { ConversationPromptSnapshot, RequestInspectionSnapshot, RequestPromptChange, RequestView, } from '@qilin-agent/client-ui-conversation/client';
28
+ export { isRunningTool, isSettledTool } from './contract/chat-nodes.ts';
29
+ export { EMPTY_CHAT_SNAPSHOT } from './contract/snapshot.ts';
30
+ /** Public merge surface for Chat renderer payloads contributed by other plugins. */
31
+ export interface ChatNodeDataMap {
32
+ }
33
+ type PublicChatNodeDataMap = ChatNodeDataMap;
34
+ declare module './contract/chat-nodes.ts' {
35
+ interface ChatNodeDataMap extends PublicChatNodeDataMap {
36
+ }
37
+ }
38
+ //# sourceMappingURL=index.d.ts.map