@hydraharness/harness-client-ui-conversation 0.1.1-rc.6

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 (83) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +79 -0
  3. package/lib/client.js +11683 -0
  4. package/lib/index.js +28 -0
  5. package/lib/invariant.js +25 -0
  6. package/lib/types/client/apply.d.ts +16 -0
  7. package/lib/types/client/chat/ActivityGroup.d.ts +22 -0
  8. package/lib/types/client/chat/AssistantMarkdown.d.ts +20 -0
  9. package/lib/types/client/chat/AssistantNodeView.d.ts +4 -0
  10. package/lib/types/client/chat/ChatNodeSeat.d.ts +11 -0
  11. package/lib/types/client/chat/ChatView.d.ts +7 -0
  12. package/lib/types/client/chat/CommandNodeView.d.ts +9 -0
  13. package/lib/types/client/chat/CompactionCommandCard.d.ts +8 -0
  14. package/lib/types/client/chat/CompactionItem.d.ts +19 -0
  15. package/lib/types/client/chat/ContextBody.d.ts +130 -0
  16. package/lib/types/client/chat/ContextInjectionRow.d.ts +26 -0
  17. package/lib/types/client/chat/GenericCommandCard.d.ts +9 -0
  18. package/lib/types/client/chat/MessageIconActions.d.ts +44 -0
  19. package/lib/types/client/chat/MessageItem.d.ts +46 -0
  20. package/lib/types/client/chat/PromptVersionMenu.d.ts +21 -0
  21. package/lib/types/client/chat/ReasoningRow.d.ts +14 -0
  22. package/lib/types/client/chat/StatsLine.d.ts +87 -0
  23. package/lib/types/client/chat/TurnTailNodeView.d.ts +9 -0
  24. package/lib/types/client/chat/message-chrome.d.ts +49 -0
  25. package/lib/types/client/chat/register-node-renderers.d.ts +11 -0
  26. package/lib/types/client/chat/tool-node-reader.d.ts +16 -0
  27. package/lib/types/client/chat/turn-assistant.d.ts +8 -0
  28. package/lib/types/client/chat/turn-metrics.d.ts +38 -0
  29. package/lib/types/client/chat/use-calendar-day.d.ts +6 -0
  30. package/lib/types/client/chat/use-throttled-visual-update.d.ts +8 -0
  31. package/lib/types/client/chat/useVersionNavigation.d.ts +12 -0
  32. package/lib/types/client/chat/web-citations.d.ts +11 -0
  33. package/lib/types/client/contract/chat-nodes.d.ts +68 -0
  34. package/lib/types/client/contract/composer-submission.d.ts +8 -0
  35. package/lib/types/client/contract/prompt-edit.d.ts +6 -0
  36. package/lib/types/client/contract/queue.d.ts +9 -0
  37. package/lib/types/client/contract/slots.d.ts +819 -0
  38. package/lib/types/client/contract/views.d.ts +39 -0
  39. package/lib/types/client/conversation-nodes/assistant.d.ts +35 -0
  40. package/lib/types/client/conversation-nodes/chat-snapshot-builder.d.ts +29 -0
  41. package/lib/types/client/conversation-nodes/command.d.ts +54 -0
  42. package/lib/types/client/conversation-nodes/common.d.ts +40 -0
  43. package/lib/types/client/conversation-nodes/compaction.d.ts +21 -0
  44. package/lib/types/client/conversation-nodes/fallback.d.ts +16 -0
  45. package/lib/types/client/conversation-nodes/inbox.d.ts +21 -0
  46. package/lib/types/client/conversation-nodes/message.d.ts +30 -0
  47. package/lib/types/client/conversation-nodes/register.d.ts +7 -0
  48. package/lib/types/client/conversation-nodes/retry.d.ts +23 -0
  49. package/lib/types/client/conversation-nodes/tool.d.ts +25 -0
  50. package/lib/types/client/conversation-nodes/turn-error.d.ts +30 -0
  51. package/lib/types/client/conversation-nodes/turn-max-tokens.d.ts +22 -0
  52. package/lib/types/client/conversation-nodes/turn-tail.d.ts +28 -0
  53. package/lib/types/client/image-labels.d.ts +22 -0
  54. package/lib/types/client/index.d.ts +30 -0
  55. package/lib/types/client/input/blocks.d.ts +57 -0
  56. package/lib/types/client/input/contract.d.ts +340 -0
  57. package/lib/types/client/input/decorations.d.ts +71 -0
  58. package/lib/types/client/input/facade.d.ts +261 -0
  59. package/lib/types/client/input/hub.d.ts +88 -0
  60. package/lib/types/client/input/machine.d.ts +135 -0
  61. package/lib/types/client/input/submission-policy.d.ts +46 -0
  62. package/lib/types/client/locales.d.ts +242 -0
  63. package/lib/types/client/queue/QueueDock.d.ts +29 -0
  64. package/lib/types/client/queue/store.d.ts +19 -0
  65. package/lib/types/client/reference/ReferenceIcon.d.ts +16 -0
  66. package/lib/types/client/service.d.ts +220 -0
  67. package/lib/types/client/settings/EnterBehaviorRow.d.ts +21 -0
  68. package/lib/types/client/settings/UsageSection.d.ts +21 -0
  69. package/lib/types/client/skeleton/ApprovalPanel.d.ts +13 -0
  70. package/lib/types/client/skeleton/ContextMeter.d.ts +14 -0
  71. package/lib/types/client/skeleton/ConversationRoot.d.ts +5 -0
  72. package/lib/types/client/skeleton/ConversationSession.d.ts +20 -0
  73. package/lib/types/client/skeleton/DetailsPanel.d.ts +5 -0
  74. package/lib/types/client/skeleton/EmptyHero.d.ts +58 -0
  75. package/lib/types/client/skeleton/InputBar.d.ts +11 -0
  76. package/lib/types/client/skeleton/PermissionSelect.d.ts +11 -0
  77. package/lib/types/client/skeleton/TodoPanel.d.ts +28 -0
  78. package/lib/types/client/skeleton/safari.d.ts +18 -0
  79. package/lib/types/client/stores.d.ts +22 -0
  80. package/lib/types/index.d.ts +9 -0
  81. package/lib/types/invariant.d.ts +16 -0
  82. package/lib/types/submission-settings.d.ts +20 -0
  83. package/package.json +121 -0
@@ -0,0 +1,39 @@
1
+ /** Shared conversation view, selection, and store-state contracts. */
2
+ /** Tool call identity as carried on the wire (branded upstream in connection). */
3
+ export type CallId = string;
4
+ /** Selection target for the details linkage channel (toolcall is the step special case). */
5
+ export interface SelectionTarget {
6
+ turnSeq: number;
7
+ stepSeq?: number;
8
+ callId?: CallId;
9
+ toolName?: string;
10
+ }
11
+ /**
12
+ * One conversation view tab, projected from a 'conversation.view' slot
13
+ * entry's registration options (label falls back to the entry id).
14
+ */
15
+ export interface ViewTab {
16
+ id: string;
17
+ label: string;
18
+ }
19
+ /**
20
+ * Per-session state shared by conversation, chat-view, and details slots.
21
+ * Unknown persisted view ids fall back to the stable Chat view.
22
+ */
23
+ export interface ChatStoreState {
24
+ /** Details-linkage channel (conversation writes, details reads). */
25
+ selection: SelectionTarget | null;
26
+ /** Composer draft (persisted; survives session switches and reloads). */
27
+ draft: string;
28
+ /** Active conversation view id ('conversation.view' entry id); null falls back to Chat. */
29
+ view: string | null;
30
+ /**
31
+ * One-shot inspect handoff: chat writes the call to reveal, the trajectory
32
+ * view consumes it and acknowledges by clearing. Read with `?? null` —
33
+ * persisted snapshots from before this field rehydrate without it.
34
+ */
35
+ inspect: {
36
+ callId: CallId;
37
+ } | null;
38
+ }
39
+ //# sourceMappingURL=views.d.ts.map
@@ -0,0 +1,35 @@
1
+ import type { Context } from '@hydraharness/cordis';
2
+ import type { AssistantBlock, ConversationMatch, ConversationNodeDefinition } from '@hydraharness/harness-client-runtime/client';
3
+ import type { AssistantChatData } from '../contract/chat-nodes.ts';
4
+ declare module '@hydraharness/harness-client-ui-conversation/client' {
5
+ interface ChatNodeDataMap {
6
+ /** Streaming, settled, or interrupted Assistant step. */
7
+ 'assistant-step': AssistantChatData;
8
+ }
9
+ }
10
+ declare module '@hydraharness/harness-client-runtime/client' {
11
+ interface ConversationStepDataMap {
12
+ /** Streaming, settled, or interrupted Assistant material for this Step. */
13
+ 'assistant-step': AssistantChatData;
14
+ }
15
+ }
16
+ interface AssistantState {
17
+ readonly turn: number;
18
+ readonly step: number;
19
+ readonly blocks: readonly (AssistantBlock | undefined)[];
20
+ readonly firstVisibleSeq: number | undefined;
21
+ readonly firstVisibleTime: number | undefined;
22
+ readonly firstTokenTime: number | undefined;
23
+ readonly hidden: boolean;
24
+ readonly final: ConversationMatch | undefined;
25
+ readonly usage: unknown;
26
+ }
27
+ /** Per-step Assistant streaming/final/interruption Definition. */
28
+ export declare const assistantDefinition: ConversationNodeDefinition<AssistantState>;
29
+ /**
30
+ * Register the Assistant lifecycle business contribution.
31
+ * @param ctx - owning UI Conversation context.
32
+ */
33
+ export declare function registerAssistantConversationNode(ctx: Context): void;
34
+ export {};
35
+ //# sourceMappingURL=assistant.d.ts.map
@@ -0,0 +1,29 @@
1
+ import type { Context } from '@hydraharness/cordis';
2
+ import type { ChatConversationViewNode, ChatSnapshot, ConversationTimelineSnapshot, ConversationViewBuilder, ConversationViewDefinition } from '@hydraharness/harness-client-runtime/client';
3
+ /** Incremental keyed Chat builder registered under the `chat` target. */
4
+ export declare class ChatSnapshotBuilder implements ConversationViewBuilder<ChatConversationViewNode, ChatSnapshot> {
5
+ private readonly store;
6
+ private readonly locations;
7
+ private readonly legacy;
8
+ private readonly referenceLabels;
9
+ private order;
10
+ readonly empty: ChatSnapshot;
11
+ constructor();
12
+ replace(input: {
13
+ readonly nodes: readonly ChatConversationViewNode[];
14
+ readonly timeline: ConversationTimelineSnapshot;
15
+ }): ChatSnapshot;
16
+ apply(input: {
17
+ readonly upserts: readonly ChatConversationViewNode[];
18
+ readonly timeline: ConversationTimelineSnapshot;
19
+ }): ChatSnapshot;
20
+ private snapshot;
21
+ }
22
+ /** Chat target factory contributed to the Runtime view registry. */
23
+ export declare const chatViewDefinition: ConversationViewDefinition<ChatConversationViewNode, ChatSnapshot>;
24
+ /**
25
+ * Register the incremental Chat target builder.
26
+ * @param ctx - owning UI Conversation context.
27
+ */
28
+ export declare function registerChatConversationView(ctx: Context): void;
29
+ //# sourceMappingURL=chat-snapshot-builder.d.ts.map
@@ -0,0 +1,54 @@
1
+ import type { Context } from '@hydraharness/cordis';
2
+ import type { CommandNode, CompactionSummaryNode, ConversationMatch, ConversationNodeDefinition } from '@hydraharness/harness-client-runtime/client';
3
+ import type { ManualCompactionChatData } from '../contract/chat-nodes.ts';
4
+ declare module '@hydraharness/harness-client-ui-conversation/client' {
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,40 @@
1
+ import type { ConversationLocation, ConversationNodeContext } from '@hydraharness/harness-client-runtime/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 maxTokensNotice: 0.05;
13
+ readonly finalizedFollowup: 0.1;
14
+ };
15
+ /**
16
+ * Resolve one Context's best currently loaded event Location.
17
+ * @param context - assembled business Context.
18
+ * @returns start or first-match Location, otherwise unresolved.
19
+ */
20
+ export declare function contextLocation(context: ConversationNodeContext): ConversationLocation;
21
+ /**
22
+ * Build one final Chat target Node with the engine-owned stable key.
23
+ * @param context - assembled business Context.
24
+ * @param kind - Chat renderer dispatch key.
25
+ * @param anchorSeq - sortable render position.
26
+ * @param data - renderer-owned payload.
27
+ * @param options - optional Location and visibility overrides.
28
+ * @returns final Chat view Node.
29
+ */
30
+ export declare function chatNode<Kind extends ChatNodeKind>(context: ConversationNodeContext, kind: Kind, anchorSeq: number, data: ChatNodeDataMap[Kind], options?: {
31
+ readonly location?: ConversationLocation;
32
+ readonly visibility?: 'visible' | 'hidden';
33
+ }): ChatNode<Kind>;
34
+ /**
35
+ * Read a finite non-negative integer from a structurally narrowed payload.
36
+ * @param value - untrusted payload field.
37
+ * @returns valid coordinate, otherwise undefined.
38
+ */
39
+ export declare function coordinate(value: unknown): number | undefined;
40
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1,21 @@
1
+ import type { Context } from '@hydraharness/cordis';
2
+ import type { CompactionSummaryNode, ConversationMatch, ConversationNodeDefinition } from '@hydraharness/harness-client-runtime/client';
3
+ declare module '@hydraharness/harness-client-ui-conversation/client' {
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,16 @@
1
+ import type { Context } from '@hydraharness/cordis';
2
+ import type { ConversationNodeDefinition, UnknownSurfaceNode } from '@hydraharness/harness-client-runtime/client';
3
+ declare module '@hydraharness/harness-client-ui-conversation/client' {
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,21 @@
1
+ import type { Context } from '@hydraharness/cordis';
2
+ import type { ConversationNodeDefinition } from '@hydraharness/harness-client-runtime/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,30 @@
1
+ import type { Context } from '@hydraharness/cordis';
2
+ import type { ContextMessageNode, ConversationNodeDefinition, SteeringMessageNode, UserMessageNode } from '@hydraharness/harness-client-runtime/client';
3
+ interface ReferencedUserMessageNode extends UserMessageNode {
4
+ /** Labels cited by the immediately following session-reference context. */
5
+ readonly referenceLabels?: readonly string[];
6
+ }
7
+ interface ReferencedSteeringMessageNode extends SteeringMessageNode {
8
+ /** Labels cited by the immediately following session-reference context. */
9
+ readonly referenceLabels?: readonly string[];
10
+ }
11
+ type MessageNode = ReferencedUserMessageNode | ReferencedSteeringMessageNode | ContextMessageNode;
12
+ declare module '@hydraharness/harness-client-ui-conversation/client' {
13
+ interface ChatNodeDataMap {
14
+ /** Ordinary turn-opening user message. */
15
+ user: ReferencedUserMessageNode;
16
+ /** User message admitted into an active turn. */
17
+ steering: ReferencedSteeringMessageNode;
18
+ /** Non-user context injected into model history. */
19
+ context: ContextMessageNode;
20
+ }
21
+ }
22
+ /** User, steering, and injected-context message classification Definition. */
23
+ export declare const messageDefinition: ConversationNodeDefinition<MessageNode>;
24
+ /**
25
+ * Register the user, steering, and injected-context message contribution.
26
+ * @param ctx - owning UI Conversation context.
27
+ */
28
+ export declare function registerMessageConversationNode(ctx: Context): void;
29
+ export {};
30
+ //# sourceMappingURL=message.d.ts.map
@@ -0,0 +1,7 @@
1
+ import type { Context } from '@hydraharness/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,23 @@
1
+ import type { Context } from '@hydraharness/cordis';
2
+ import type { ConversationNodeDefinition, ModelRetryNode } from '@hydraharness/harness-client-runtime/client';
3
+ import type { RetryChatData } from '../contract/chat-nodes.ts';
4
+ declare module '@hydraharness/harness-client-ui-conversation/client' {
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,25 @@
1
+ import type { Context } from '@hydraharness/cordis';
2
+ import type { ConversationNodeDefinition, ToolCallBlock } from '@hydraharness/harness-client-runtime/client';
3
+ import type { ToolChatData } from '../contract/chat-nodes.ts';
4
+ declare module '@hydraharness/harness-client-ui-conversation/client' {
5
+ interface ChatNodeDataMap {
6
+ /** Root Tool lifecycle with recursively nested subcalls. */
7
+ 'tool-call': ToolChatData;
8
+ /** Media generation output rendered outside tool activity groups. */
9
+ 'media-generation': ToolChatData;
10
+ }
11
+ }
12
+ interface ToolState {
13
+ readonly root: ToolCallBlock;
14
+ readonly children: ReadonlyMap<string, readonly ToolCallBlock[]>;
15
+ readonly parents: ReadonlyMap<string, string>;
16
+ }
17
+ /** Root Tool lifecycle and nested Code Dispatch Definition. */
18
+ export declare const toolDefinition: ConversationNodeDefinition<ToolState>;
19
+ /**
20
+ * Register the root Tool lifecycle and nested-subcall contribution.
21
+ * @param ctx - owning UI Conversation context.
22
+ */
23
+ export declare function registerToolConversationNode(ctx: Context): void;
24
+ export {};
25
+ //# sourceMappingURL=tool.d.ts.map
@@ -0,0 +1,30 @@
1
+ import type { Context } from '@hydraharness/cordis';
2
+ import type { ConversationNodeDefinition, TurnErrorNode } from '@hydraharness/harness-client-runtime/client';
3
+ declare module '@hydraharness/harness-client-ui-conversation/client' {
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 '@hydraharness/cordis';
2
+ import type { ConversationNodeDefinition, TurnMaxTokensNode } from '@hydraharness/harness-client-runtime/client';
3
+ declare module '@hydraharness/harness-client-ui-conversation/client' {
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,28 @@
1
+ import type { Context } from '@hydraharness/cordis';
2
+ import type { ConversationMatch, ConversationNodeDefinition } from '@hydraharness/harness-client-runtime/client';
3
+ import type { TurnTailChatData } from '../contract/chat-nodes.ts';
4
+ declare module '@hydraharness/harness-client-ui-conversation/client' {
5
+ interface ChatNodeDataMap {
6
+ /** Completed-turn actions and extension tail. */
7
+ 'turn-tail': TurnTailChatData;
8
+ }
9
+ }
10
+ declare module '@hydraharness/harness-client-runtime/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,22 @@
1
+ /** Attachment error and limit copy owned by the conversation input flow. */
2
+ import type { ImageAttachmentLimits } from '@hydraharness/harness-attachment';
3
+ import type { Translate } from '@hydraharness/harness-client-ui-slots';
4
+ import type { ConversationKey } from './locales.ts';
5
+ /**
6
+ * Byte count as user-facing megabytes (`10MB`, `2.5MB`).
7
+ * @param bytes - the byte count.
8
+ * @returns the rounded megabyte text.
9
+ */
10
+ export declare function imageSizeText(bytes: number): string;
11
+ /**
12
+ * Product copy for a host attachment rejection (the `attachment-error`
13
+ * `details.reason`). User-solvable reasons name the limit and the way out;
14
+ * reasons the user cannot act on fold into one send-failed line carrying the
15
+ * reason code for a bug report.
16
+ * @param t - the conversation-namespace translate.
17
+ * @param reason - the wire `details.reason` code.
18
+ * @param limits - projected limits interpolated into count/size copy, when known.
19
+ * @returns the banner text.
20
+ */
21
+ export declare function attachmentErrorText(t: Translate<ConversationKey>, reason: string, limits?: ImageAttachmentLimits): string;
22
+ //# sourceMappingURL=image-labels.d.ts.map
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Browser conversation plugin. `contract/` is the shared type boundary
3
+ * between the independently implemented skeleton and chat domains; `apply.ts`
4
+ * owns their slot assembly.
5
+ */
6
+ export type {} from './conversation-nodes/assistant.ts';
7
+ export type {} from './conversation-nodes/command.ts';
8
+ export type {} from './conversation-nodes/compaction.ts';
9
+ export type {} from './conversation-nodes/fallback.ts';
10
+ export type {} from './conversation-nodes/message.ts';
11
+ export type {} from './conversation-nodes/retry.ts';
12
+ export type {} from './conversation-nodes/tool.ts';
13
+ export type {} from './conversation-nodes/turn-error.ts';
14
+ export type {} from './conversation-nodes/turn-max-tokens.ts';
15
+ export type {} from './conversation-nodes/turn-tail.ts';
16
+ export { apply, inject } from './apply.ts';
17
+ export { ConversationController } from './service.ts';
18
+ export type { BrowserAnnotationSelection, DraftBrowserAnnotation, IConversation } from './service.ts';
19
+ export type { DraftAttachmentId } from './input/contract.ts';
20
+ export type { CallId, ChatStoreState, SelectionTarget, ViewTab, } from './contract/views.ts';
21
+ export type { ConversationKey } from './locales.ts';
22
+ export type { AssistantChatData, ChatNode, ChatNodeDataMap, ChatNodeKind, ManualCompactionChatData, RetryChatData, ToolChatData, TurnTailChatData, } from './contract/chat-nodes.ts';
23
+ export type { ChatFileMentions, ChatNodeOwnerProps, ChatNodeViewProps, ChatStore, ChatViewInjected, ChatViewSlotProps, CommandRowOwnerProps, CommandRowProps, ComposerBarInjected, BrowserAnnotationAttachment, ComposerAttachment, ComposerAttachmentsOwnerProps, ComposerAttachmentsProps, ComposerChainProps, ConversationInjected, ConversationHeaderLineageOwnerProps, ConversationSessionHeaderInjected, ConversationSessionInjected, ConversationSlotProps, ConvViewOwnerProps, ConvViewProps, DetailsInjected, DetailsSlotProps, DetailsToolOwnerProps, EmptyWorkspaceOwnerProps, HeroBrandMarkOwnerProps, MessageImagesOwnerProps, MessageImagesProps, RenderMessageImages, TurnTailOwnerProps, UseChatNodeTurnData, } from './contract/slots.ts';
24
+ declare module '@hydraharness/cordis' {
25
+ interface Context {
26
+ /** The outward face only; the concrete service stays inside this plugin. */
27
+ conversation: import('./service.ts').IConversation;
28
+ }
29
+ }
30
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Composer blocks: the one way another plugin stops a session's input.
3
+ *
4
+ * The composer cannot read the plugins that would know — the dependency runs
5
+ * ui-model-selection → ui-conversation, never back — so a blocker pushes here and the
6
+ * bar reads its own session's store. A block carries the localized reason it
7
+ * exists, because the plugin that raised it owns that copy; the composer only
8
+ * knows how to render an inert textarea with a placeholder, exactly as it
9
+ * already does for a session with no workspace.
10
+ *
11
+ * This is an affordance, not enforcement: the Host refuses a prompt it cannot
12
+ * route regardless of what any client disables.
13
+ */
14
+ import type { SessionId, SnapshotStore } from '@hydraharness/harness-client-runtime/client';
15
+ /** Why one session's composer is inert. */
16
+ export interface ComposerBlock {
17
+ /**
18
+ * Localized placeholder replacing the composer's own, owned by the plugin
19
+ * that raised the block.
20
+ */
21
+ readonly reason: string;
22
+ }
23
+ /** The registry face other plugins reach through `ctx.conversation.blocks`. */
24
+ export interface ComposerBlocks {
25
+ /**
26
+ * Raise or clear this session's block. Idempotent: setting a block equal to
27
+ * the current one, or clearing an absent one, notifies nobody.
28
+ * @param sessionId - the session whose composer is affected.
29
+ * @param block - the block to raise, or undefined to clear it.
30
+ */
31
+ set(sessionId: SessionId, block: ComposerBlock | undefined): void;
32
+ /**
33
+ * The store the composer subscribes to for one session. Created on first
34
+ * read from either side, so a blocker may raise a block before the session's
35
+ * composer mounts and the composer still sees it.
36
+ * @param sessionId - the session to observe.
37
+ * @returns that session's block store (undefined value = not blocked).
38
+ */
39
+ storeFor(sessionId: SessionId): SnapshotStore<ComposerBlock | undefined>;
40
+ /**
41
+ * Drop one session's store. The session scope's disposer calls this; a
42
+ * blocker never needs to.
43
+ * @param sessionId - the session being torn down.
44
+ */
45
+ forget(sessionId: SessionId): void;
46
+ }
47
+ /** The per-session composer-block registry (one instance per plugin fiber). */
48
+ export declare class ComposerBlockRegistry implements ComposerBlocks {
49
+ private readonly stores;
50
+ /** @inheritdoc */
51
+ set(sessionId: SessionId, block: ComposerBlock | undefined): void;
52
+ /** @inheritdoc */
53
+ storeFor(sessionId: SessionId): SnapshotStore<ComposerBlock | undefined>;
54
+ /** @inheritdoc */
55
+ forget(sessionId: SessionId): void;
56
+ }
57
+ //# sourceMappingURL=blocks.d.ts.map