@qilin-agent/client-ui-conversation 0.0.0-stage → 3.1.3

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 (78) hide show
  1. package/LICENSE +21 -0
  2. package/README.i18n.yaml +37 -0
  3. package/README.md +149 -2
  4. package/README.zh.md +150 -0
  5. package/lib/client.js +19198 -0
  6. package/lib/index.js +46 -0
  7. package/lib/types/client/apply.d.ts +25 -0
  8. package/lib/types/client/context-occupancy.d.ts +14 -0
  9. package/lib/types/client/contract/composer-blocks.d.ts +28 -0
  10. package/lib/types/client/contract/composer-submission.d.ts +8 -0
  11. package/lib/types/client/contract/context-producer.d.ts +29 -0
  12. package/lib/types/client/contract/conversation.d.ts +279 -0
  13. package/lib/types/client/contract/draft-editor.d.ts +102 -0
  14. package/lib/types/client/contract/groups.d.ts +116 -0
  15. package/lib/types/client/contract/input.d.ts +361 -0
  16. package/lib/types/client/contract/records.d.ts +301 -0
  17. package/lib/types/client/contract/request-inspection.d.ts +131 -0
  18. package/lib/types/client/contract/slots.d.ts +541 -0
  19. package/lib/types/client/contract/snapshot.d.ts +20 -0
  20. package/lib/types/client/contract/system-prompt.d.ts +35 -0
  21. package/lib/types/client/contract/views.d.ts +36 -0
  22. package/lib/types/client/conversation/assembler.d.ts +151 -0
  23. package/lib/types/client/conversation/assembly.d.ts +128 -0
  24. package/lib/types/client/conversation/definition-registry.d.ts +33 -0
  25. package/lib/types/client/conversation/event-registry.d.ts +40 -0
  26. package/lib/types/client/conversation/group-registry.d.ts +30 -0
  27. package/lib/types/client/conversation/group-store.d.ts +29 -0
  28. package/lib/types/client/conversation/historical-images.d.ts +49 -0
  29. package/lib/types/client/conversation/location-index.d.ts +91 -0
  30. package/lib/types/client/conversation/view-registry.d.ts +12 -0
  31. package/lib/types/client/image-labels.d.ts +23 -0
  32. package/lib/types/client/index.d.ts +39 -0
  33. package/lib/types/client/input/blocks.d.ts +27 -0
  34. package/lib/types/client/input/decorations.d.ts +32 -0
  35. package/lib/types/client/input/editor/ComposerContentEditable.d.ts +16 -0
  36. package/lib/types/client/input/editor/DecoratorPortals.d.ts +14 -0
  37. package/lib/types/client/input/editor/DraftEditor.d.ts +27 -0
  38. package/lib/types/client/input/editor/ReferenceChip.d.ts +17 -0
  39. package/lib/types/client/input/editor/chip-node.d.ts +110 -0
  40. package/lib/types/client/input/editor/claim-decor.d.ts +23 -0
  41. package/lib/types/client/input/editor/keymap.d.ts +43 -0
  42. package/lib/types/client/input/editor/projection.d.ts +93 -0
  43. package/lib/types/client/input/editor/reference-activation.d.ts +10 -0
  44. package/lib/types/client/input/editor/runtime.d.ts +123 -0
  45. package/lib/types/client/input/editor/span-map.d.ts +38 -0
  46. package/lib/types/client/input/editor/text-ref.d.ts +49 -0
  47. package/lib/types/client/input/editor/view-binding.d.ts +60 -0
  48. package/lib/types/client/input/facade.d.ts +303 -0
  49. package/lib/types/client/input/hub.d.ts +100 -0
  50. package/lib/types/client/input/machine.d.ts +46 -0
  51. package/lib/types/client/input/submission-policy.d.ts +52 -0
  52. package/lib/types/client/layout-policy.d.ts +42 -0
  53. package/lib/types/client/locales.d.ts +770 -0
  54. package/lib/types/client/queue/QueueDock.d.ts +27 -0
  55. package/lib/types/client/service.d.ts +186 -0
  56. package/lib/types/client/settings/ContentWidthRow.d.ts +26 -0
  57. package/lib/types/client/settings/EnterBehaviorRow.d.ts +21 -0
  58. package/lib/types/client/skeleton/ContextMeter.d.ts +14 -0
  59. package/lib/types/client/skeleton/ConversationContent.d.ts +8 -0
  60. package/lib/types/client/skeleton/ConversationHeader.d.ts +8 -0
  61. package/lib/types/client/skeleton/ConversationMainPanel.d.ts +3 -0
  62. package/lib/types/client/skeleton/ConversationPanel.d.ts +9 -0
  63. package/lib/types/client/skeleton/ConversationRoot.d.ts +5 -0
  64. package/lib/types/client/skeleton/ConversationSession.d.ts +21 -0
  65. package/lib/types/client/skeleton/ConversationWidthControls.d.ts +14 -0
  66. package/lib/types/client/skeleton/DefaultConversationViews.d.ts +9 -0
  67. package/lib/types/client/skeleton/EmptyHero.d.ts +49 -0
  68. package/lib/types/client/skeleton/InputBar.d.ts +18 -0
  69. package/lib/types/client/skeleton/TodoPanel.d.ts +21 -0
  70. package/lib/types/client/skeleton/control-row-layout.d.ts +10 -0
  71. package/lib/types/client/skeleton/safari.d.ts +18 -0
  72. package/lib/types/client/stop-sequence.d.ts +32 -0
  73. package/lib/types/client/stop-shortcut.d.ts +17 -0
  74. package/lib/types/client/stores.d.ts +24 -0
  75. package/lib/types/client/view-selection.d.ts +11 -0
  76. package/lib/types/conversation-settings.d.ts +38 -0
  77. package/lib/types/index.d.ts +9 -0
  78. package/package.json +106 -3
@@ -0,0 +1,131 @@
1
+ import type { ContentBlock, ToolSchema } from '@qilin-agent/llm/types';
2
+ import type { SessionEvent } from '@qilin-agent/session/types';
3
+ import type { AssistantProviderMetadataView, AssistantRequestConfig } from './records.ts';
4
+ export type { AssistantProviderMetadataView, AssistantRequestConfig, } from './records.ts';
5
+ /**
6
+ * Complete model-visible request state in force for an ordinary generation:
7
+ * the `request/header` config and tools plus the system prompt held by the
8
+ * current `system/message` surface node.
9
+ */
10
+ export interface ConversationPromptSnapshot {
11
+ /** Provider/model and sampling configuration from the effective request header. */
12
+ config: AssistantRequestConfig;
13
+ /**
14
+ * Rendered text of the `system/message` surface node in force for the
15
+ * request; empty when the surface has no system prompt or the node lies
16
+ * outside the loaded history window.
17
+ */
18
+ system: string;
19
+ /** Complete tool catalog sent with the request, including tools that were never called. */
20
+ tools: readonly ToolSchema[];
21
+ }
22
+ /** Effective prompt or introduced system node, anchored at the event that establishes it. */
23
+ export interface SystemPromptNode {
24
+ /** Sequence of the system event or replacement that establishes this prompt. */
25
+ seq: number;
26
+ /** Unix epoch ms of that event. */
27
+ time: number;
28
+ /** Turn the loop committed the node in. */
29
+ turn: number;
30
+ /** Step the loop committed the node in. */
31
+ step: number;
32
+ /** Rendered system prompt text; empty records "no system prompt". */
33
+ text: string;
34
+ /**
35
+ * True for a prompt appended after an earlier loaded system node: an
36
+ * in-history update the model reads at this position, presented where it
37
+ * was committed rather than by the next request header.
38
+ */
39
+ update: boolean;
40
+ }
41
+ /** System/tool change introduced while preparing one ordinary request, or by an in-history prompt update. */
42
+ export interface RequestPromptChange {
43
+ /**
44
+ * Sequence of the event that introduced this state: the `system/message`
45
+ * node when it introduced, replaced, or updated the system prompt, otherwise the
46
+ * `request/header` event.
47
+ */
48
+ seq: number;
49
+ /** Unix epoch ms of that event. */
50
+ time: number;
51
+ /** How the model-visible prompt differs from the previous recorded state. */
52
+ kind: 'initial' | 'system' | 'tools' | 'system-and-tools';
53
+ /** State immediately before this change; absent for the initial header. */
54
+ previous?: ConversationPromptSnapshot;
55
+ }
56
+ /** Canonical prompt snapshot and any model-visible change introduced by one request header. */
57
+ export interface RequestPromptInspection {
58
+ /** Complete prompt state in force for the header's request. */
59
+ prompt: ConversationPromptSnapshot;
60
+ /** System/tool change relative to the preceding loaded header. */
61
+ change?: RequestPromptChange;
62
+ }
63
+ /**
64
+ * The {@link inspectRequestPrompt} signature as a value seam: Chat and
65
+ * Trajectory Definitions receive it from the uiConversation service because a
66
+ * client bundle cannot value-import another plugin's module.
67
+ */
68
+ export type RequestPromptInspector = (previous: ConversationPromptSnapshot | undefined, event: SessionEvent<'request/header'>, system: SystemPromptNode | undefined) => RequestPromptInspection;
69
+ /**
70
+ * Canonicalize one request header against the system node in force and
71
+ * classify the model-visible prompt change.
72
+ * @param previous - Prompt from the preceding loaded request header, when available.
73
+ * @param event - Durable full request header to inspect.
74
+ * @param system - Effective nonempty system prompt after loaded surface replacements; empty when removed.
75
+ * An in-history update already presented its text at its own position, so the header reports no system change for it.
76
+ * @returns The canonical prompt and an initial/system/tool change when it can be established.
77
+ */
78
+ export declare function inspectRequestPrompt(previous: ConversationPromptSnapshot | undefined, event: SessionEvent<'request/header'>, system: SystemPromptNode | undefined): RequestPromptInspection;
79
+ /** Lifecycle fields shared by ordinary generation and compaction requests. */
80
+ interface RequestViewBase {
81
+ /** Sequence that opened the operation represented by this request. */
82
+ startSeq: number;
83
+ startedAt: number;
84
+ completedAt: number | null;
85
+ status: 'running' | 'complete' | 'error';
86
+ error?: string;
87
+ /** Stable provider code for localized presentation of known failures. */
88
+ errorCode?: string;
89
+ providerMetadata?: AssistantProviderMetadataView;
90
+ requestConfig?: AssistantRequestConfig;
91
+ usage?: unknown;
92
+ /** Assistant message or compaction summary sequence produced by this request. */
93
+ resultSeq?: number;
94
+ }
95
+ /** One ordinary assistant generation assembled from durable request events. */
96
+ interface AssistantRequestView extends RequestViewBase {
97
+ purpose: 'assistant';
98
+ turn: number;
99
+ /** Agent-loop step that issued this request. */
100
+ step: number;
101
+ /** Effective ordinary request input, inherited until a later header changes it. */
102
+ prompt?: ConversationPromptSnapshot;
103
+ /** Prompt change logged while preparing this request. */
104
+ promptChange?: RequestPromptChange;
105
+ /** Retry ordinal scheduled after a failed ordinary request. */
106
+ retry?: number;
107
+ maxRetries?: number;
108
+ retryDelayMs?: number;
109
+ }
110
+ /** One compaction provider request, either turn-owned or standalone between turns. */
111
+ interface CompactionRequestView extends RequestViewBase {
112
+ purpose: 'compaction';
113
+ /** Owning turn, or `null` when manual compaction ran between turns. */
114
+ turn: number | null;
115
+ /** Direct compaction requests do not consume an agent-loop step. */
116
+ step: 0;
117
+ /** Compaction replacement message sequence, when one was committed. */
118
+ replacementSeq?: number;
119
+ /** Safe compaction summary projection. */
120
+ summary?: readonly ContentBlock[];
121
+ /** Complete compaction provider output before the safe projection. */
122
+ rawOutput?: readonly ContentBlock[];
123
+ }
124
+ /** One provider request assembled from durable request lifecycle events. */
125
+ export type RequestView = AssistantRequestView | CompactionRequestView;
126
+ /** Request data consumed by the stage-oriented Trajectory layout. */
127
+ export interface RequestInspectionSnapshot {
128
+ requests: readonly RequestView[];
129
+ callSchemas: ReadonlyMap<string, ToolSchema>;
130
+ }
131
+ //# sourceMappingURL=request-inspection.d.ts.map
@@ -0,0 +1,541 @@
1
+ /** Target-neutral Conversation slot declarations and composed component props. */
2
+ import type { ReactNode, RefObject } from 'react';
3
+ import type { FileAttachmentRef, ImageAttachmentRef } from '@qilin-agent/attachment';
4
+ import type { SessionSnapshot } from '@qilin-agent/api-session-controller/client';
5
+ import type { FileUploadReceiptId } from '@qilin-agent/client-file-upload/client';
6
+ import type { WorkspaceSnapshot } from '@qilin-agent/api-workspace-controller/client';
7
+ import type { MaybeSnapshotSelectorHook, ObservableSnapshot, SnapshotSelectorHook } from '@qilin-agent/client-store';
8
+ import type { FactoryComponentPropsOf, FactoryLocalComponentPropsOf, InjectFace, PropsLocale, PropsRenderFactories, PropsRenderSlots, PropsRuntime, PropsStore } from '@qilin-agent/client-ui-slots';
9
+ import type { SessionPendingInteraction } from '@qilin-agent/client-ui-session/client';
10
+ import type { SessionId } from '@qilin-agent/session/types';
11
+ import type { WorkspaceId } from '@qilin-agent/workspace/types';
12
+ import type { ComposerBlock } from './composer-blocks.ts';
13
+ import type { DraftAttachmentId, InputActions, InputNotice, InputState } from './input.ts';
14
+ import type { ComposerKeyboard, EditSelection } from './draft-editor.ts';
15
+ import type { createConversationStore } from '../stores.ts';
16
+ import type { BusyEnterBehavior } from './composer-submission.ts';
17
+ import type { ConversationSnapshot } from './snapshot.ts';
18
+ import type { ViewTab } from './views.ts';
19
+ /** Browser-owned draft attachment that has not crossed the durable Host boundary. */
20
+ export type ComposerAttachment = ComposerImageAttachment | ComposerFileAttachment;
21
+ /** Browser-owned image, base64-encoded into the prompt at send time. */
22
+ export interface ComposerImageAttachment {
23
+ kind: 'image';
24
+ id: DraftAttachmentId;
25
+ file: File;
26
+ previewUrl: string;
27
+ /** Intrinsic pixel width, filled asynchronously by the intake header probe. */
28
+ width?: number;
29
+ /** Intrinsic pixel height, filled asynchronously by the intake header probe. */
30
+ height?: number;
31
+ }
32
+ /** Browser-owned generic file whose bytes upload to the Host as soon as it is picked. */
33
+ export interface ComposerFileAttachment {
34
+ kind: 'file';
35
+ id: DraftAttachmentId;
36
+ file: File;
37
+ }
38
+ /** Upload lifecycle of one picked file draft (files upload on pick, not on send). */
39
+ export type DraftFileUpload = {
40
+ readonly status: 'uploading';
41
+ readonly loaded: number;
42
+ readonly total?: number;
43
+ } | {
44
+ readonly status: 'ready';
45
+ readonly receiptId: FileUploadReceiptId;
46
+ readonly file: FileAttachmentRef;
47
+ } | {
48
+ readonly status: 'error';
49
+ readonly message: string;
50
+ };
51
+ /** Per-draft upload states keyed by draft attachment id. */
52
+ export type DraftFileUploads = Readonly<Record<string, DraftFileUpload>>;
53
+ /** Input state handed to the optional attachment presentation plugin. */
54
+ export interface ComposerAttachmentsOwnerProps {
55
+ /** Browser-owned draft attachments in input order. */
56
+ attachments: readonly ComposerAttachment[];
57
+ /** Whether a document-level file drop may add attachments now. */
58
+ canAcceptDrop: boolean;
59
+ /** Add one dropped batch through the composer's validation path. */
60
+ onAddFiles: (files: readonly File[]) => void;
61
+ /** Remove one draft attachment through the Conversation service. */
62
+ onRemoveAttachment: (id: DraftAttachmentId) => void;
63
+ /** Current per-draft upload states for file-kind attachments. */
64
+ uploads: DraftFileUploads;
65
+ /** Restart one failed file upload. */
66
+ onRetryFile: (id: DraftAttachmentId) => void;
67
+ /** Display-ready limits for the drop invitation. */
68
+ dropLimits?: {
69
+ readonly count: number;
70
+ readonly size: string;
71
+ } | undefined;
72
+ }
73
+ /**
74
+ * One image inside a message record: a durable admitted reference, or the
75
+ * local preview of a submission echo whose admission is still in flight.
76
+ */
77
+ export type MessageImageSource = {
78
+ readonly attachment: ImageAttachmentRef;
79
+ /** Presentation-only name for the thumbnail and lightbox; loading uses the original reference. */
80
+ readonly label?: string;
81
+ } | {
82
+ readonly preview: {
83
+ /** Browser-owned preview URL (lifecycle stays with the submitter). */
84
+ readonly url: string;
85
+ readonly name?: string;
86
+ /** Intrinsic pixel width, when the intake probe has resolved it. */
87
+ readonly width?: number;
88
+ /** Intrinsic pixel height, when the intake probe has resolved it. */
89
+ readonly height?: number;
90
+ };
91
+ };
92
+ /** Durable image loader with an optional synchronous cache read. */
93
+ export type MessageImageLoader = ((attachment: ImageAttachmentRef) => Promise<string>) & {
94
+ peek?: (attachment: ImageAttachmentRef) => string | undefined;
95
+ };
96
+ /** Message image group handed to the optional attachment presentation plugin. */
97
+ export interface MessageImagesOwnerProps {
98
+ /** Durable references or submission-echo previews in source order. */
99
+ images: readonly MessageImageSource[];
100
+ /** Session-authorized image URL loader for the durable arm. */
101
+ loadImage: MessageImageLoader;
102
+ /** Horizontal placement inside the owning record. */
103
+ align: 'start' | 'end';
104
+ /** Force every image into the compact message-attachment tile size. */
105
+ compact?: boolean;
106
+ /** Fixed, uncropped thumbnail for an attachment list row. */
107
+ thumbnail?: boolean;
108
+ }
109
+ /** Slot-backed renderer used by Conversation targets without importing an attachment implementation. */
110
+ export type RenderMessageImages = (owner: Omit<MessageImagesOwnerProps, 'loadImage'>) => ReactNode;
111
+ /** Selector hook over the current Session's assembled Conversation. */
112
+ export type UseConversation = SnapshotSelectorHook<ConversationSnapshot>;
113
+ /** Selector hook over the registered Conversation View roster. */
114
+ export type UseConversationViews = SnapshotSelectorHook<readonly ViewTab[]>;
115
+ declare module '@qilin-agent/client-ui-slots' {
116
+ interface SlotMap {
117
+ /** Conversation shell beneath its root-scoped main-panel entry. */
118
+ 'main.conversation': {
119
+ kind: 'single';
120
+ scope: 'session-maybe';
121
+ };
122
+ /** Strict per-Session Conversation body. */
123
+ 'conversation.session': {
124
+ kind: 'single';
125
+ scope: 'session';
126
+ owner: {
127
+ view?: string;
128
+ };
129
+ };
130
+ /** Resident navigation container, including when no Session is selected. */
131
+ 'conversation.header': {
132
+ kind: 'single';
133
+ scope: 'session-maybe';
134
+ };
135
+ /** Strict per-Session title, actions, and View navigation. */
136
+ 'conversation.session.header': {
137
+ kind: 'single';
138
+ scope: 'session';
139
+ owner: {
140
+ /** Parent-owned visibility shared with the header container styling. */
141
+ hideChrome: boolean;
142
+ };
143
+ };
144
+ /** Optional replacement for one Session breadcrumb title. */
145
+ 'conversation.session.header.lineage': {
146
+ kind: 'single';
147
+ scope: 'session';
148
+ owner: ConversationHeaderLineageOwnerProps;
149
+ };
150
+ /** Title-adjacent Session actions in ascending order. */
151
+ 'conversation.session.header.actions': {
152
+ kind: 'list';
153
+ scope: 'session';
154
+ owner: ConversationHeaderActionOwnerProps;
155
+ };
156
+ /** Right-aligned Session utilities in ascending order. */
157
+ 'conversation.session.header.utilities': {
158
+ kind: 'list';
159
+ scope: 'session';
160
+ owner: ConversationHeaderActionOwnerProps;
161
+ };
162
+ /**
163
+ * Global navigation before the Session title, available without a Session,
164
+ * for window-chrome-adjacent controls (macOS desktop sidebar reopen and
165
+ * New Session while the sidebar is hidden). The seat is laid out only while
166
+ * its occupant renders something.
167
+ */
168
+ 'conversation.header.leading': {
169
+ kind: 'single';
170
+ scope: 'root';
171
+ owner: ConversationHeaderLeadingOwnerProps;
172
+ };
173
+ /**
174
+ * The header's far-right corner, past the utilities' edge and into the
175
+ * header's own padding, for one control. The corner is laid out only while
176
+ * its occupant renders something; an occupant with nothing to show renders
177
+ * nothing, and the utilities take the header's edge.
178
+ */
179
+ 'conversation.session.header.corner': {
180
+ kind: 'single';
181
+ scope: 'session';
182
+ owner: ConversationHeaderCornerOwnerProps;
183
+ };
184
+ /** Registered Conversation target Views, rendered one at a time. */
185
+ 'conversation.view': {
186
+ kind: 'list';
187
+ scope: 'session';
188
+ owner: ConvViewOwnerProps;
189
+ };
190
+ /** Selector-routed replacements for the current Session's resident composer. */
191
+ 'conversation.composer': {
192
+ kind: 'chain';
193
+ scope: 'session';
194
+ owner: ComposerChainProps;
195
+ };
196
+ /** Workspace picker shown by the blank-session Hero. */
197
+ 'conversation.hero.workspace': {
198
+ kind: 'single';
199
+ scope: 'root';
200
+ owner: EmptyWorkspaceOwnerProps;
201
+ };
202
+ /** Brand mark shown before the blank-session headline. */
203
+ 'conversation.hero.brand.mark': {
204
+ kind: 'single';
205
+ scope: 'root';
206
+ owner: HeroBrandMarkOwnerProps;
207
+ };
208
+ /** Agent-preset control staged for a New Session. */
209
+ 'conversation.hero.agentPreset': {
210
+ kind: 'single';
211
+ scope: 'session-maybe';
212
+ owner: HeroAgentPresetOwnerProps;
213
+ };
214
+ /** Full-width entries above the composer card. */
215
+ 'conversation.input.dock': {
216
+ kind: 'list';
217
+ scope: 'session';
218
+ owner: InputZone;
219
+ };
220
+ /** Floating entries rendered inside the resident composer card. */
221
+ 'conversation.input.overlay': {
222
+ kind: 'list';
223
+ scope: 'session';
224
+ };
225
+ /** Ambient entries below the composer card. */
226
+ 'conversation.composer.dock': {
227
+ kind: 'list';
228
+ scope: 'session';
229
+ };
230
+ /** Compact controls at the left of the composer tool row. */
231
+ 'conversation.input.left': {
232
+ kind: 'list';
233
+ scope: 'session';
234
+ };
235
+ /** Compact controls before the composer submit action. */
236
+ 'conversation.input.right': {
237
+ kind: 'list';
238
+ scope: 'session';
239
+ };
240
+ /** Compact action after the model selector; it can expand across the toolbar while retaining the editor and submit action. */
241
+ 'conversation.input.activity': {
242
+ kind: 'single';
243
+ scope: 'session';
244
+ owner: InputActivityOwnerProps;
245
+ };
246
+ /** Resident composer body, including the no-Session inert state. */
247
+ 'conversation.composer.bar': {
248
+ kind: 'single';
249
+ scope: 'session-maybe';
250
+ owner: ComposerBarOwnerProps;
251
+ };
252
+ /** Optional draft-attachment rail and drop target. */
253
+ 'conversation.input.attachments': {
254
+ kind: 'single';
255
+ scope: 'session-maybe';
256
+ owner: ComposerAttachmentsOwnerProps;
257
+ };
258
+ /** Plan control inside the composer tool row. */
259
+ 'conversation.input.plan': {
260
+ kind: 'single';
261
+ scope: 'session';
262
+ owner: InputControlOwnerProps;
263
+ };
264
+ /** Current-session permission control inside the composer tool row. */
265
+ 'conversation.input.permission': {
266
+ kind: 'single';
267
+ scope: 'session';
268
+ owner: InputControlOwnerProps;
269
+ };
270
+ /**
271
+ * Model selector inside the composer tool row. When expanded controls cannot
272
+ * share a line, the row sets --dsh-composer-model-text-display to none and
273
+ * --dsh-composer-model-icon-display to block for an occupant's compact display.
274
+ */
275
+ 'conversation.input.model': {
276
+ kind: 'single';
277
+ scope: 'session';
278
+ owner: InputControlOwnerProps;
279
+ };
280
+ }
281
+ interface SlotFactoryMap {
282
+ /** Reusable Conversation content instantiated by presentation hosts. */
283
+ 'conversation.content': {
284
+ scope: 'session-maybe';
285
+ props: ConversationContentInputProps;
286
+ children: {
287
+ 'conversation.session': {
288
+ kind: 'single';
289
+ scope: 'session';
290
+ };
291
+ 'conversation.composer': {
292
+ kind: 'chain';
293
+ scope: 'session';
294
+ };
295
+ 'conversation.composer.bar': {
296
+ kind: 'single';
297
+ scope: 'session-maybe';
298
+ };
299
+ 'conversation.input.dock': {
300
+ kind: 'list';
301
+ scope: 'session';
302
+ };
303
+ 'conversation.hero.brand.mark': {
304
+ kind: 'single';
305
+ scope: 'root';
306
+ };
307
+ 'conversation.hero.workspace': {
308
+ kind: 'single';
309
+ scope: 'root';
310
+ };
311
+ 'conversation.hero.agentPreset': {
312
+ kind: 'single';
313
+ scope: 'session-maybe';
314
+ };
315
+ };
316
+ inject: ConversationInjected;
317
+ locale: 'conversation';
318
+ slots: {
319
+ views: {
320
+ scope: 'session';
321
+ };
322
+ widthControls: {
323
+ scope: 'root';
324
+ props: ConversationWidthControlsInputProps;
325
+ };
326
+ };
327
+ };
328
+ }
329
+ interface GlobalStandardProps {
330
+ /** Workspace selector supplied by the independently loaded Workspace UI. */
331
+ useWorkspaces: SnapshotSelectorHook<WorkspaceSnapshot>;
332
+ }
333
+ interface SessionStandardProps {
334
+ /** Selector hook over target-neutral Conversation assembly. */
335
+ useConversation: UseConversation;
336
+ /** Selector hook over the Session input machine. */
337
+ useInput: SnapshotSelectorHook<InputState>;
338
+ /** Stable public input actions for this Session. */
339
+ inputActions: InputActions;
340
+ }
341
+ interface SessionMaybeStandardProps {
342
+ /** Selector hook whose values are absent without a current Session. */
343
+ useConversation: MaybeSnapshotSelectorHook<ConversationSnapshot>;
344
+ /** Input values are absent without a current Session. */
345
+ useInput: MaybeSnapshotSelectorHook<InputState>;
346
+ /** Input actions are absent without a current Session. */
347
+ inputActions: InputActions | undefined;
348
+ }
349
+ }
350
+ /** Owner share of the Hero agent-preset control. */
351
+ export interface HeroAgentPresetOwnerProps {
352
+ /** Marker field: the occupant owns its roster and staged selection. */
353
+ children?: never;
354
+ }
355
+ /** Header actions derive their state from standard Session props. */
356
+ export interface ConversationHeaderActionOwnerProps {
357
+ /** Marker field: entries receive no owner-specific values. */
358
+ children?: never;
359
+ }
360
+ /** The header corner's occupant derives its state from standard Session props. */
361
+ export interface ConversationHeaderCornerOwnerProps {
362
+ /** Marker field: the occupant receives no owner-specific values. */
363
+ children?: never;
364
+ }
365
+ /** The leading seat's occupant derives its state from standard Session props. */
366
+ export interface ConversationHeaderLeadingOwnerProps {
367
+ /** Marker field: the occupant receives no owner-specific values. */
368
+ children?: never;
369
+ }
370
+ /** Plain breadcrumb data handed to the optional lineage renderer. */
371
+ export interface ConversationHeaderLineageOwnerProps {
372
+ /** Session represented by this breadcrumb title. */
373
+ lineageSessionId: SessionId;
374
+ /** Display title available to a combined title/control renderer. */
375
+ displayTitle: string;
376
+ /** Navigate to an ancestor title when present. */
377
+ openTitle?: () => void;
378
+ }
379
+ /** Point-in-time owner values for composer extension entries. */
380
+ export interface InputZone {
381
+ readonly session: SessionSnapshot;
382
+ readonly input: InputState;
383
+ }
384
+ /** Conversation View entries obtain their data from registered standard hooks. */
385
+ export interface ConvViewOwnerProps {
386
+ /** Focus request addressed to the selected View. */
387
+ viewRequest: import('./views.ts').ConversationViewRequest | null;
388
+ /** Select a View and address one opaque focus identity to it. */
389
+ openView: (view: string, focus: string) => void;
390
+ /** Acknowledge the current one-shot focus request. */
391
+ completeViewRequest: () => void;
392
+ /** Marker field: the shell gives Views no owner-specific values. */
393
+ children?: never;
394
+ }
395
+ /** Base props of one target-owned Conversation View entry. */
396
+ export type ConvViewProps = PropsRuntime<'conversation.view'>;
397
+ /** Business callbacks injected into the resident Conversation shell. */
398
+ export interface ConversationInjected {
399
+ /** Connect and open a blank Session in the selected Workspace. */
400
+ selectWorkspace: (workspaceId: WorkspaceId) => Promise<void>;
401
+ /** Session-addressed composer block source, or the stable absent source. */
402
+ hooks: {
403
+ composerBlock: ObservableSnapshot<ComposerBlock | undefined>;
404
+ /** Live transcript content width (px, or 0 for the adaptive column clamp). */
405
+ contentWidth: ObservableSnapshot<number>;
406
+ };
407
+ /** Persist a transcript content width requested by a width-handle drag. */
408
+ setContentWidth: (px: number) => void;
409
+ }
410
+ /** Business callbacks injected into the strict Session body. */
411
+ export interface ConversationSessionInjected {
412
+ /** Package-owned View roster source bound only for the Conversation body. */
413
+ readonly hooks: {
414
+ readonly conversationViews: ObservableSnapshot<readonly ViewTab[]>;
415
+ };
416
+ /** Bind input draft persistence to the Session-owned store instance. */
417
+ bindDraftMirror: (write: (text: string) => void) => () => void;
418
+ /** Select and activate one View while addressing an opaque focus request to it. */
419
+ openView: (view: string, focus: string) => void;
420
+ }
421
+ /** Business callbacks injected into the strict Session header. */
422
+ export interface ConversationSessionHeaderInjected {
423
+ /** Package-owned View roster source bound only for the Conversation header. */
424
+ readonly hooks: {
425
+ readonly conversationViews: ObservableSnapshot<readonly ViewTab[]>;
426
+ };
427
+ /** Select a Session through the Session Controller. */
428
+ open: (sessionId: SessionId) => void;
429
+ /** Select and activate one registered Conversation View. */
430
+ selectView: (view: string) => void;
431
+ }
432
+ /** Owner share of the resident composer bar. */
433
+ export interface ComposerBarOwnerProps {
434
+ /** Hero uses centered placement; composer uses the active bottom placement. */
435
+ variant: 'hero' | 'composer';
436
+ /** A feature-owned reason that makes message input inert while leaving model selection live. */
437
+ blocked?: {
438
+ readonly reason: string;
439
+ };
440
+ /** Lock all message actions while preserving the resident composer surface. */
441
+ disabled?: boolean;
442
+ /** Whether the shared Workspace picker is expanded. */
443
+ workspacePickerOpen?: boolean;
444
+ /** Open the Workspace picker from the inert composer surface. */
445
+ onRequestWorkspace?: () => void;
446
+ placeholder?: string;
447
+ /** Optional content rendered above the composer surface. */
448
+ accessory?: ReactNode;
449
+ }
450
+ /** Package-private operations injected into the resident composer bar. */
451
+ export interface ComposerBarInjected {
452
+ keyboard: ComposerKeyboard | undefined;
453
+ addFiles: ((files: readonly File[]) => string | null) | undefined;
454
+ removeAttachment: ((id: DraftAttachmentId) => void) | undefined;
455
+ resolveDraftAttachments: ((ids: readonly DraftAttachmentId[]) => readonly ComposerAttachment[]) | undefined;
456
+ /** Restart one failed file upload; absent without a session. */
457
+ retryFileUpload: ((id: DraftAttachmentId) => void) | undefined;
458
+ toggleCommandMenu: ((selection: EditSelection) => void) | undefined;
459
+ stop: (() => void) | undefined;
460
+ hooks: {
461
+ /**
462
+ * Live busy-state submission preference: the delivery mode plain Enter
463
+ * and the primary Send button use while the addressed agent is busy.
464
+ */
465
+ busyEnter: ObservableSnapshot<BusyEnterBehavior>;
466
+ /** Live per-draft upload states for file-kind drafts. */
467
+ fileUploads: ObservableSnapshot<DraftFileUploads>;
468
+ notices: ObservableSnapshot<InputNotice | null>;
469
+ lexicon: ObservableSnapshot<ReadonlyMap<'/' | '@', readonly string[]>>;
470
+ menuLauncher: ObservableSnapshot<string | null>;
471
+ };
472
+ }
473
+ /** Owner share of the named plan, permission, and model controls. */
474
+ export interface InputControlOwnerProps {
475
+ /** Whether the composer currently refuses interaction. */
476
+ locked: boolean;
477
+ }
478
+ /** A toolbar activity hides ordinary accessory controls while expanded; its occupant must release expansion on unmount. */
479
+ export interface InputActivityOwnerProps extends InputControlOwnerProps {
480
+ /** @param active - whether the occupant needs the toolbar width before the submit action. */
481
+ onActiveChange: (active: boolean) => void;
482
+ }
483
+ /** Full props of the resident composer bar. */
484
+ export type ComposerBarProps = PropsRuntime<'conversation.composer.bar'> & PropsRenderSlots<'conversation.input.attachments' | 'conversation.input.overlay' | 'conversation.input.permission' | 'conversation.input.left' | 'conversation.input.plan' | 'conversation.input.right' | 'conversation.input.model' | 'conversation.input.activity' | 'conversation.composer.dock'> & InjectFace<ComposerBarInjected> & PropsLocale<'conversation'>;
485
+ /** Owner values used to elect a composer takeover. */
486
+ export interface ComposerChainProps {
487
+ /** Current Session identity used by temporary business-owned entries. */
488
+ sessionId: SessionId | undefined;
489
+ /** Current Session lifecycle state, absent without a selected Session. */
490
+ session: SessionSnapshot | undefined;
491
+ /** Effective business-owned interaction awaiting the user in this Session. */
492
+ pendingInteraction: SessionPendingInteraction | undefined;
493
+ }
494
+ /** Presentation props supplied to the blank-session brand mark. */
495
+ export interface HeroBrandMarkOwnerProps {
496
+ /** Requested square edge in pixels. */
497
+ size: number;
498
+ /** Host class preserving the surrounding mark geometry. */
499
+ className?: string | undefined;
500
+ }
501
+ /** Full props of the resident optional-Session Conversation shell. */
502
+ export type ConversationSlotProps = PropsRuntime<'main.conversation'> & PropsRenderSlots<'conversation.header'> & PropsRenderFactories;
503
+ /** Full props of the resident navigation header. */
504
+ export type ConversationHeaderProps = PropsRuntime<'conversation.header'> & PropsRenderSlots<'conversation.header.leading' | 'conversation.session.header'>;
505
+ /** Inputs shared by main and embedded Conversation content occurrences. */
506
+ export interface ConversationContentInputProps {
507
+ variant: 'main' | 'embedded';
508
+ phase: 'settling' | 'hero' | 'active';
509
+ hero: boolean;
510
+ }
511
+ /** Values passed from shared content to its occurrence-selected width controls. */
512
+ export interface ConversationWidthControlsInputProps {
513
+ /** Mounted Conversation body measured and styled by the selected controls. */
514
+ container: HTMLDivElement | null;
515
+ /** Current body phase; handles render only for an active transcript. */
516
+ phase: ConversationContentInputProps['phase'];
517
+ }
518
+ /** Full props of the reusable Conversation Factory definition. */
519
+ export type ConversationContentProps = FactoryComponentPropsOf<'conversation.content'>;
520
+ /** Shared target-neutral Conversation store handle. */
521
+ export type ConversationStore = ReturnType<typeof createConversationStore>;
522
+ /** Full props of the Factory's caller-selectable Conversation View position. */
523
+ export type ConversationViewsProps = FactoryLocalComponentPropsOf<'conversation.content', 'views'>;
524
+ /** Full props of the Factory's caller-selected width-control position. */
525
+ export type ConversationWidthControlsProps = FactoryLocalComponentPropsOf<'conversation.content', 'widthControls'>;
526
+ /** Full props of the strict Session body. */
527
+ export type ConversationSessionSlotProps = PropsRuntime<'conversation.session'> & PropsRenderSlots<'conversation.view'> & PropsStore<ConversationStore> & InjectFace<ConversationSessionInjected>;
528
+ /** Full props of the strict Session header. */
529
+ export type ConversationSessionHeaderSlotProps = PropsRuntime<'conversation.session.header'> & PropsRenderSlots<'conversation.session.header.lineage' | 'conversation.session.header.actions' | 'conversation.session.header.utilities' | 'conversation.session.header.corner'> & PropsStore<ConversationStore> & InjectFace<ConversationSessionHeaderInjected> & PropsLocale<'conversation'>;
530
+ /** Full props of the draft-attachment renderer. */
531
+ export type ComposerAttachmentsProps = PropsRuntime<'conversation.input.attachments'> & PropsLocale<'conversation'>;
532
+ /** Owner share common to blank-session Workspace pickers. */
533
+ export interface EmptyWorkspaceOwnerProps {
534
+ open: boolean;
535
+ anchorRef?: RefObject<HTMLElement>;
536
+ /** Currently selected Workspace, when available. */
537
+ selectedId?: WorkspaceId | undefined;
538
+ onPick: (workspaceId: WorkspaceId) => void;
539
+ onClose: () => void;
540
+ }
541
+ //# sourceMappingURL=slots.d.ts.map