@crazx/dsh-client-ui-conversation 0.1.5-alpha.1.zw.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 (63) hide show
  1. package/LICENSE +21 -0
  2. package/README.i18n.yaml +6 -0
  3. package/README.md +127 -0
  4. package/README.zh.md +127 -0
  5. package/lib/client.js +16935 -0
  6. package/lib/index.js +27 -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-provenance.d.ts +29 -0
  12. package/lib/types/client/contract/conversation.d.ts +256 -0
  13. package/lib/types/client/contract/input.d.ts +427 -0
  14. package/lib/types/client/contract/queue.d.ts +9 -0
  15. package/lib/types/client/contract/records.d.ts +272 -0
  16. package/lib/types/client/contract/request-inspection.d.ts +131 -0
  17. package/lib/types/client/contract/slots.d.ts +409 -0
  18. package/lib/types/client/contract/snapshot.d.ts +20 -0
  19. package/lib/types/client/contract/system-prompt.d.ts +35 -0
  20. package/lib/types/client/contract/views.d.ts +26 -0
  21. package/lib/types/client/conversation/assembler.d.ts +128 -0
  22. package/lib/types/client/conversation/assembly.d.ts +97 -0
  23. package/lib/types/client/conversation/definition-registry.d.ts +33 -0
  24. package/lib/types/client/conversation/event-registry.d.ts +24 -0
  25. package/lib/types/client/conversation/historical-images.d.ts +51 -0
  26. package/lib/types/client/conversation/location-index.d.ts +85 -0
  27. package/lib/types/client/conversation/view-registry.d.ts +12 -0
  28. package/lib/types/client/image-labels.d.ts +23 -0
  29. package/lib/types/client/index.d.ts +36 -0
  30. package/lib/types/client/input/blocks.d.ts +27 -0
  31. package/lib/types/client/input/decorations.d.ts +32 -0
  32. package/lib/types/client/input/editor/ComposerContentEditable.d.ts +16 -0
  33. package/lib/types/client/input/editor/DecoratorPortals.d.ts +14 -0
  34. package/lib/types/client/input/editor/ReferenceChip.d.ts +17 -0
  35. package/lib/types/client/input/editor/chip-node.d.ts +110 -0
  36. package/lib/types/client/input/editor/claim-decor.d.ts +23 -0
  37. package/lib/types/client/input/editor/keymap.d.ts +41 -0
  38. package/lib/types/client/input/editor/projection.d.ts +93 -0
  39. package/lib/types/client/input/editor/span-map.d.ts +38 -0
  40. package/lib/types/client/input/editor/text-ref.d.ts +60 -0
  41. package/lib/types/client/input/facade.d.ts +298 -0
  42. package/lib/types/client/input/hub.d.ts +88 -0
  43. package/lib/types/client/input/machine.d.ts +46 -0
  44. package/lib/types/client/input/queue-store.d.ts +20 -0
  45. package/lib/types/client/input/submission-policy.d.ts +52 -0
  46. package/lib/types/client/locales.d.ts +330 -0
  47. package/lib/types/client/queue/QueueDock.d.ts +26 -0
  48. package/lib/types/client/service.d.ts +185 -0
  49. package/lib/types/client/settings/EnterBehaviorRow.d.ts +21 -0
  50. package/lib/types/client/skeleton/ContextMeter.d.ts +14 -0
  51. package/lib/types/client/skeleton/ConversationRoot.d.ts +5 -0
  52. package/lib/types/client/skeleton/ConversationSession.d.ts +26 -0
  53. package/lib/types/client/skeleton/EmptyHero.d.ts +46 -0
  54. package/lib/types/client/skeleton/InputBar.d.ts +18 -0
  55. package/lib/types/client/skeleton/PermissionSelect.d.ts +11 -0
  56. package/lib/types/client/skeleton/TodoPanel.d.ts +21 -0
  57. package/lib/types/client/skeleton/safari.d.ts +18 -0
  58. package/lib/types/client/skeleton/toolbar-hosts.d.ts +17 -0
  59. package/lib/types/client/stores.d.ts +24 -0
  60. package/lib/types/client/view-selection.d.ts +9 -0
  61. package/lib/types/index.d.ts +9 -0
  62. package/lib/types/submission-settings.d.ts +20 -0
  63. package/package.json +103 -0
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Queue read face for the InputState.queue projection (frozen contract in
3
+ * ../contract/input.ts): a uSES-compatible observable over one session's
4
+ * transient inbox rows. The Session snapshot already keeps the queue array
5
+ * reference-stable across unrelated snapshot swaps, so this is a pure
6
+ * projection — no second store, no copy.
7
+ */
8
+ import type { SessionFace } from '@deepseek-ai/dsh-api-session-controller/client';
9
+ import type { ObservableSnapshot } from '@deepseek-ai/dsh-client-store';
10
+ import type { QueuedMessage } from '../contract/input.ts';
11
+ /**
12
+ * Project a session's transient inbox rows as a bare observable (subscribe/getSnapshot).
13
+ * The wiring layer overlays this onto InputState.queue; the runtime
14
+ * QueuedMessage and the input-contract QueuedMessage are structurally
15
+ * identical.
16
+ * @param session - the resident session face.
17
+ * @returns the queue read face (snapshot reference stable while the queue is unchanged).
18
+ */
19
+ export declare function queueReadFaceOf(session: SessionFace): ObservableSnapshot<readonly QueuedMessage[]>;
20
+ //# sourceMappingURL=queue-store.d.ts.map
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Composer submission policy. It owns the live busy-Enter preference and
3
+ * resolves submission gestures into queue/steer delivery modes; Host and
4
+ * Agent keep the actual delivery-window authority.
5
+ */
6
+ import { type SnapshotStore } from '@deepseek-ai/dsh-client-store';
7
+ import type { SettingsScope } from '@deepseek-ai/dsh-client-ui-settings/client';
8
+ import type { BusyEnterBehavior, ComposerSubmitGesture, InputSubmitMode } from '../contract/composer-submission.ts';
9
+ import type { ConversationSettings } from '../../submission-settings.ts';
10
+ export { DEFAULT_BUSY_ENTER_BEHAVIOR } from '../../submission-settings.ts';
11
+ /**
12
+ * Resolve one submission gesture against the busy-Enter preference. Plain
13
+ * Enter and the primary Send button share the `enter` gesture, so the button
14
+ * delivers exactly what Enter would. Direct `steer` is intentionally
15
+ * best-effort: AgentLoop turns a closed-window submission into the next waking
16
+ * Queue item.
17
+ * @param preferred - the live busy-Enter preference.
18
+ * @param running - whether the addressed agent currently reports busy.
19
+ * @param gesture - plain Enter (or the Send button) or the Cmd/Ctrl-accelerated chord.
20
+ * @param steeringAvailable - whether this session transport supports steering.
21
+ * @returns Queue outside steer-capable busy state; otherwise the preferred mode or its opposite.
22
+ */
23
+ export declare function resolveSubmitMode(preferred: BusyEnterBehavior, running: boolean, gesture: ComposerSubmitGesture, steeringAvailable: boolean): InputSubmitMode;
24
+ /**
25
+ * Busy-Enter preference shared by the composer bar inject face and its
26
+ * Settings row: one live store the bar's submission gestures and Send label
27
+ * read, backed by the Host user-settings document when one is composed.
28
+ */
29
+ export declare class ComposerSubmissionPolicy {
30
+ /** Reactive preference source for the composer bar and the Settings row. */
31
+ readonly busyEnter: SnapshotStore<BusyEnterBehavior>;
32
+ private readonly host;
33
+ /**
34
+ * @param host - durable preference scope owned by the providing plugin;
35
+ * absent compositions stay process-local. The adoption subscription shares
36
+ * the scope's plugin lifetime — a disposed scope never publishes again, so
37
+ * the policy needs no release hook.
38
+ */
39
+ constructor(host?: SettingsScope<ConversationSettings>);
40
+ /**
41
+ * Change the busy-state submission behavior; the live value publishes
42
+ * before the durable write starts.
43
+ * @param behavior - Queue or Steer.
44
+ */
45
+ setBusyEnter(behavior: BusyEnterBehavior): void;
46
+ /**
47
+ * Adopt the scope's accepted durable behavior without writing it back.
48
+ * @param host - the constructor-narrowed scope driving this adoption.
49
+ */
50
+ private adopt;
51
+ }
52
+ //# sourceMappingURL=submission-policy.d.ts.map
@@ -0,0 +1,330 @@
1
+ /** `conversation` namespace dictionaries. */
2
+ /** Dictionary namespace owned by this plugin. */
3
+ export declare const NS = "conversation";
4
+ /** Simplified Chinese dictionary (the key-set source of truth). */
5
+ export declare const zh: {
6
+ 'hint.plan': string;
7
+ 'hint.goal': string;
8
+ 'hint.goal.active': string;
9
+ 'placeholder.plan': string;
10
+ 'placeholder.default': string;
11
+ 'placeholder.unavailable': string;
12
+ 'placeholder.parentOffline': string;
13
+ 'placeholder.hero': string;
14
+ 'placeholder.workspace': string;
15
+ 'placeholder.steerQueue': string;
16
+ 'input.commands': string;
17
+ 'input.stop': string;
18
+ 'input.send': string;
19
+ 'input.send.queue': string;
20
+ 'input.send.steer': string;
21
+ 'input.accessMode': string;
22
+ 'attachment.pending': string;
23
+ 'attachment.scrollLeft': string;
24
+ 'attachment.scrollRight': string;
25
+ 'attachment.dropTitle': string;
26
+ 'attachment.dropDesc': string;
27
+ 'attachment.dropBlocked': string;
28
+ 'image.pending': string;
29
+ 'image.openOriginal': string;
30
+ 'image.openOriginalLabel': string;
31
+ 'image.remove': string;
32
+ 'image.original': string;
33
+ 'image.label': string;
34
+ 'image.loadFailed': string;
35
+ 'image.loading': string;
36
+ 'image.preview': string;
37
+ 'image.closePreview': string;
38
+ 'image.unsupportedType': string;
39
+ 'image.tooMany': string;
40
+ 'image.fileTooLarge': string;
41
+ 'image.totalTooLarge': string;
42
+ 'image.tooManyPixels': string;
43
+ 'image.dimensionTooLarge': string;
44
+ 'image.modelUnsupported': string;
45
+ 'image.sendFailed': string;
46
+ 'file.attach': string;
47
+ 'file.pending': string;
48
+ 'file.remove': string;
49
+ 'file.uploading': string;
50
+ 'file.uploadFailed': string;
51
+ 'file.retry': string;
52
+ 'file.stillUploading': string;
53
+ 'file.sessionUnavailable': string;
54
+ 'file.notStaged': string;
55
+ 'file.label': string;
56
+ 'context.aria': string;
57
+ 'context.used': string;
58
+ 'context.system': string;
59
+ 'context.tools': string;
60
+ 'context.messages': string;
61
+ 'settings.enter.title': string;
62
+ 'settings.enter.description': string;
63
+ 'settings.enter.queue': string;
64
+ 'settings.enter.steer': string;
65
+ 'access.preset.readOnly': string;
66
+ 'access.preset.workspaceWrite': string;
67
+ 'access.preset.fullAccess': string;
68
+ 'access.confirm.title': string;
69
+ 'access.confirm.description': string;
70
+ 'access.confirm.acknowledge': string;
71
+ 'access.confirm.cancel': string;
72
+ 'access.confirm.enable': string;
73
+ 'hero.headline': string;
74
+ 'hero.preview': string;
75
+ 'hero.chooseWorkspace': string;
76
+ 'session.hierarchy': string;
77
+ 'todo.title': string;
78
+ 'todo.progress.done': string;
79
+ 'todo.progress.active': string;
80
+ 'todo.progress.pending': string;
81
+ 'todo.rowTitle': string;
82
+ 'todo.completed': string;
83
+ 'command.attachmentsUnsupported': string;
84
+ 'ask.rowTitle': string;
85
+ 'ask.waiting': string;
86
+ 'ask.cancelled': string;
87
+ 'ask.cancelledDetail': string;
88
+ 'ask.interrupted': string;
89
+ 'ask.interruptedDetail': string;
90
+ 'ask.answered': string;
91
+ 'ask.skipped': string;
92
+ 'bash.running': string;
93
+ 'bash.failed': string;
94
+ 'bash.stopped': string;
95
+ 'row.running': string;
96
+ 'row.failed': string;
97
+ 'row.stopped': string;
98
+ 'row.input': string;
99
+ 'row.output': string;
100
+ 'row.inspect': string;
101
+ 'tool.title.search': string;
102
+ 'tool.title.read': string;
103
+ 'tool.title.bash': string;
104
+ 'tool.title.write': string;
105
+ 'tool.title.edit': string;
106
+ 'tool.title.code': string;
107
+ 'tool.title.generic': string;
108
+ 'tool.title.inspect': string;
109
+ 'tool.title.runCordis': string;
110
+ 'tool.title.stopCordis': string;
111
+ 'tool.title.removeCordis': string;
112
+ 'tool.title.pwsh': string;
113
+ 'tool.title.readImage': string;
114
+ 'tool.title.grep': string;
115
+ 'tool.title.glob': string;
116
+ 'tool.title.webSearch': string;
117
+ 'tool.title.webFetch': string;
118
+ 'diff.files.one': string;
119
+ 'diff.files.other': string;
120
+ 'diff.collapseAria': string;
121
+ 'diff.expandAria': string;
122
+ 'diff.expandRest': string;
123
+ 'read.window': string;
124
+ 'read.collapseAria': string;
125
+ 'read.expandAria': string;
126
+ 'read.expandRest': string;
127
+ 'search.paths': string;
128
+ 'search.paths.truncated': string;
129
+ 'search.matches': string;
130
+ 'search.matches.truncated': string;
131
+ 'search.noResults': string;
132
+ 'search.collapseAria': string;
133
+ 'search.expandAria': string;
134
+ 'search.expandRest': string;
135
+ 'web.noResults': string;
136
+ 'web.sourcesTruncated': string;
137
+ 'web.http': string;
138
+ 'web.contentTruncated': string;
139
+ 'details.running': string;
140
+ 'queue.count': string;
141
+ 'queue.sending': string;
142
+ 'queue.image': string;
143
+ 'queue.file': string;
144
+ 'queue.edit': string;
145
+ 'queue.edit.unsupported': string;
146
+ 'queue.save': string;
147
+ 'queue.cancelEdit': string;
148
+ 'queue.remove': string;
149
+ 'queue.steer': string;
150
+ 'queue.steer.unavailable': string;
151
+ 'queue.editFailed': string;
152
+ 'queue.removeFailed': string;
153
+ 'queue.steerFailed': string;
154
+ 'terminal.signal': string;
155
+ 'terminal.exitCode': string;
156
+ 'terminal.running': string;
157
+ 'terminal.failed': string;
158
+ 'terminal.done': string;
159
+ 'terminal.noOutput': string;
160
+ 'terminal.collapseAria': string;
161
+ 'terminal.expandAria': string;
162
+ 'terminal.expandRest': string;
163
+ 'terminal.sendInput': string;
164
+ 'terminal.session': string;
165
+ };
166
+ /** The conversation namespace key union. */
167
+ export type ConversationKey = keyof typeof zh;
168
+ /** English dictionary, checked complete against the zh key set. */
169
+ export declare const en: {
170
+ 'hint.plan': string;
171
+ 'hint.goal': string;
172
+ 'hint.goal.active': string;
173
+ 'placeholder.plan': string;
174
+ 'placeholder.default': string;
175
+ 'placeholder.unavailable': string;
176
+ 'placeholder.parentOffline': string;
177
+ 'placeholder.hero': string;
178
+ 'placeholder.workspace': string;
179
+ 'placeholder.steerQueue': string;
180
+ 'input.commands': string;
181
+ 'input.stop': string;
182
+ 'input.send': string;
183
+ 'input.send.queue': string;
184
+ 'input.send.steer': string;
185
+ 'input.accessMode': string;
186
+ 'attachment.pending': string;
187
+ 'attachment.scrollLeft': string;
188
+ 'attachment.scrollRight': string;
189
+ 'attachment.dropTitle': string;
190
+ 'attachment.dropDesc': string;
191
+ 'attachment.dropBlocked': string;
192
+ 'image.pending': string;
193
+ 'image.openOriginal': string;
194
+ 'image.openOriginalLabel': string;
195
+ 'image.remove': string;
196
+ 'image.original': string;
197
+ 'image.label': string;
198
+ 'image.loadFailed': string;
199
+ 'image.loading': string;
200
+ 'image.preview': string;
201
+ 'image.closePreview': string;
202
+ 'image.unsupportedType': string;
203
+ 'image.tooMany': string;
204
+ 'image.fileTooLarge': string;
205
+ 'image.totalTooLarge': string;
206
+ 'image.tooManyPixels': string;
207
+ 'image.dimensionTooLarge': string;
208
+ 'image.modelUnsupported': string;
209
+ 'image.sendFailed': string;
210
+ 'file.attach': string;
211
+ 'file.pending': string;
212
+ 'file.remove': string;
213
+ 'file.uploading': string;
214
+ 'file.uploadFailed': string;
215
+ 'file.retry': string;
216
+ 'file.stillUploading': string;
217
+ 'file.sessionUnavailable': string;
218
+ 'file.notStaged': string;
219
+ 'file.label': string;
220
+ 'context.aria': string;
221
+ 'context.used': string;
222
+ 'context.system': string;
223
+ 'context.tools': string;
224
+ 'context.messages': string;
225
+ 'settings.enter.title': string;
226
+ 'settings.enter.description': string;
227
+ 'settings.enter.queue': string;
228
+ 'settings.enter.steer': string;
229
+ 'access.preset.readOnly': string;
230
+ 'access.preset.workspaceWrite': string;
231
+ 'access.preset.fullAccess': string;
232
+ 'access.confirm.title': string;
233
+ 'access.confirm.description': string;
234
+ 'access.confirm.acknowledge': string;
235
+ 'access.confirm.cancel': string;
236
+ 'access.confirm.enable': string;
237
+ 'hero.headline': string;
238
+ 'hero.preview': string;
239
+ 'hero.chooseWorkspace': string;
240
+ 'session.hierarchy': string;
241
+ 'todo.title': string;
242
+ 'todo.progress.done': string;
243
+ 'todo.progress.active': string;
244
+ 'todo.progress.pending': string;
245
+ 'todo.rowTitle': string;
246
+ 'todo.completed': string;
247
+ 'command.attachmentsUnsupported': string;
248
+ 'ask.rowTitle': string;
249
+ 'ask.waiting': string;
250
+ 'ask.cancelled': string;
251
+ 'ask.cancelledDetail': string;
252
+ 'ask.interrupted': string;
253
+ 'ask.interruptedDetail': string;
254
+ 'ask.answered': string;
255
+ 'ask.skipped': string;
256
+ 'bash.running': string;
257
+ 'bash.failed': string;
258
+ 'bash.stopped': string;
259
+ 'row.running': string;
260
+ 'row.failed': string;
261
+ 'row.stopped': string;
262
+ 'row.input': string;
263
+ 'row.output': string;
264
+ 'row.inspect': string;
265
+ 'tool.title.search': string;
266
+ 'tool.title.read': string;
267
+ 'tool.title.bash': string;
268
+ 'tool.title.write': string;
269
+ 'tool.title.edit': string;
270
+ 'tool.title.code': string;
271
+ 'tool.title.generic': string;
272
+ 'tool.title.inspect': string;
273
+ 'tool.title.runCordis': string;
274
+ 'tool.title.stopCordis': string;
275
+ 'tool.title.removeCordis': string;
276
+ 'tool.title.pwsh': string;
277
+ 'tool.title.readImage': string;
278
+ 'tool.title.grep': string;
279
+ 'tool.title.glob': string;
280
+ 'tool.title.webSearch': string;
281
+ 'tool.title.webFetch': string;
282
+ 'diff.files.one': string;
283
+ 'diff.files.other': string;
284
+ 'diff.collapseAria': string;
285
+ 'diff.expandAria': string;
286
+ 'diff.expandRest': string;
287
+ 'read.window': string;
288
+ 'read.collapseAria': string;
289
+ 'read.expandAria': string;
290
+ 'read.expandRest': string;
291
+ 'search.paths': string;
292
+ 'search.paths.truncated': string;
293
+ 'search.matches': string;
294
+ 'search.matches.truncated': string;
295
+ 'search.noResults': string;
296
+ 'search.collapseAria': string;
297
+ 'search.expandAria': string;
298
+ 'search.expandRest': string;
299
+ 'web.noResults': string;
300
+ 'web.sourcesTruncated': string;
301
+ 'web.http': string;
302
+ 'web.contentTruncated': string;
303
+ 'details.running': string;
304
+ 'queue.count': string;
305
+ 'queue.sending': string;
306
+ 'queue.image': string;
307
+ 'queue.file': string;
308
+ 'queue.edit': string;
309
+ 'queue.edit.unsupported': string;
310
+ 'queue.save': string;
311
+ 'queue.cancelEdit': string;
312
+ 'queue.remove': string;
313
+ 'queue.steer': string;
314
+ 'queue.steer.unavailable': string;
315
+ 'queue.editFailed': string;
316
+ 'queue.removeFailed': string;
317
+ 'queue.steerFailed': string;
318
+ 'terminal.signal': string;
319
+ 'terminal.exitCode': string;
320
+ 'terminal.running': string;
321
+ 'terminal.failed': string;
322
+ 'terminal.done': string;
323
+ 'terminal.noOutput': string;
324
+ 'terminal.collapseAria': string;
325
+ 'terminal.expandAria': string;
326
+ 'terminal.expandRest': string;
327
+ 'terminal.sendInput': string;
328
+ 'terminal.session': string;
329
+ };
330
+ //# sourceMappingURL=locales.d.ts.map
@@ -0,0 +1,26 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import type { ImageAttachmentRef } from '@deepseek-ai/dsh-attachment';
3
+ import type { PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
4
+ import type { QueueAction, QueueItemId } from '../contract/queue.ts';
5
+ /** Queue operations injected by the session-scoped registration. */
6
+ export interface QueueDockInjected {
7
+ updateQueue: (itemId: QueueItemId, action: QueueAction) => Promise<void>;
8
+ notify: (level: 'info' | 'error', text: string) => void;
9
+ /** Resolve one durable queued image into a session-scoped browser URL. */
10
+ loadImage: (attachment: ImageAttachmentRef) => Promise<string>;
11
+ }
12
+ /** Full props of a dock entry: InputZone owner share + session standard kit + global seat + the locale seat. */
13
+ export type QueueDockProps = PropsRuntime<'conversation.input.dock'> & QueueDockInjected & PropsLocale<'conversation'>;
14
+ /**
15
+ * Queue strip: one item renders directly; multiple items default to a
16
+ * collapsible count header; an empty queue renders nothing. Local submissions
17
+ * show sending status and disabled actions until their Host queue rows arrive.
18
+ */
19
+ export declare function QueueDock({ useSession, updateQueue, notify, loadImage, t }: QueueDockProps): import("react").JSX.Element | null;
20
+ /** Registers queue actions backed by the session-scoped conversation service. */
21
+ export declare const queueDockEntry: {
22
+ name: string;
23
+ inject: string[];
24
+ apply(ctx: Context): void;
25
+ };
26
+ //# sourceMappingURL=QueueDock.d.ts.map
@@ -0,0 +1,185 @@
1
+ /**
2
+ * Scope-addressed conversation send, cancel, and history orchestration.
3
+ *
4
+ * Scope addressing rides the cordis Service tracker: property access through
5
+ * `ctx.conversation` rebinds `this.ctx` to the caller's context, so methods
6
+ * read the session tag with `scopeOf`. Mutable state must remain reachable
7
+ * through one property read; assignment through the tracker proxy and `#`
8
+ * private fields bypass that rebinding.
9
+ */
10
+ import { Service } from '@deepseek-ai/cordis';
11
+ import type { Context } from '@deepseek-ai/cordis';
12
+ import type { SessionFace } from '@deepseek-ai/dsh-api-session-controller/client';
13
+ import type { SessionId } from '@deepseek-ai/dsh-session/types';
14
+ import type { SnapshotStore } from '@deepseek-ai/dsh-client-store';
15
+ import type { ComposerAttachment, DraftFileUpload } from './contract/slots.ts';
16
+ import type { QueueAction, QueueItemId } from './contract/queue.ts';
17
+ import type { ComposerBlocks } from './contract/composer-blocks.ts';
18
+ import type { DraftAttachmentId, DraftAttachmentSerializationResult, SessionInputResolver, SubmitOutcome } from './contract/input.ts';
19
+ import type { InputSubmitMode } from './contract/composer-submission.ts';
20
+ /**
21
+ * The outward conversation face (`ctx.conversation`): the scope-addressed
22
+ * verbs and the input registry other plugins may reach — and exactly what a
23
+ * test fake must supply.
24
+ */
25
+ export interface IConversation {
26
+ /** The per-session input machine registry (SessionInputResolver face). */
27
+ readonly input: SessionInputResolver;
28
+ /**
29
+ * The per-session composer-block registry: how a plugin the composer
30
+ * cannot import makes a session's input inert with its own reason.
31
+ */
32
+ readonly blocks: ComposerBlocks;
33
+ /**
34
+ * Send a prompt into the caller scope's session (queued turn).
35
+ * @param text - prompt text, sent verbatim as one text block.
36
+ * @returns completion; business failures reject (and land in promptError).
37
+ */
38
+ send(text: string): Promise<void>;
39
+ /**
40
+ * Apply one edit, remove, or Steer operation to a pending queue occurrence.
41
+ * @param itemId - agent-owned inbox occurrence identity.
42
+ * @param action - requested queue operation.
43
+ * @returns completion; converged QueueDock races resolve, while other failures reject.
44
+ */
45
+ updateQueue(itemId: QueueItemId, action: QueueAction): Promise<void>;
46
+ /**
47
+ * Cancel the scoped session's in-flight turn while preserving its pending Queue.
48
+ * @returns completion; failures reject as in send.
49
+ */
50
+ cancel(): Promise<void>;
51
+ /**
52
+ * Pull one older history page for the scoped session.
53
+ * @returns completion of the page pull.
54
+ */
55
+ loadOlder(): Promise<void>;
56
+ }
57
+ /** Unsupported browser-declared image type, localized by the UI boundary. */
58
+ export declare class UnsupportedImageMediaTypeError extends Error {
59
+ /** Browser-declared MIME value, possibly empty. */
60
+ readonly mediaType: string;
61
+ /** @param mediaType - Browser-declared MIME value, possibly empty. */
62
+ constructor(mediaType: string);
63
+ }
64
+ /** Scope-addressed conversation service (root singleton, provided as `conversation`). */
65
+ export declare class ConversationController extends Service implements IConversation {
66
+ /** The per-session input machine registry (SessionInputResolver face). */
67
+ readonly input: SessionInputResolver;
68
+ /** The per-session composer-block registry. */
69
+ readonly blocks: ComposerBlocks;
70
+ /** Live upload state per file-kind draft; images never appear here. */
71
+ readonly fileUploads: SnapshotStore<Record<string, DraftFileUpload>>;
72
+ private readonly draftAttachments;
73
+ private readonly fileUploadOperations;
74
+ private readonly pendingFileUploads;
75
+ private readonly fileUploadQueue;
76
+ private activeFileUploads;
77
+ private readonly maxConcurrentFileUploads;
78
+ /**
79
+ * @param ctx - owning root context (the plugin apply context; the service
80
+ * registers itself and follows that fiber's lifetime).
81
+ * @param config - carries the SessionInputResolver and composer-block registry
82
+ * constructed by the plugin apply (the same instances the slot inject
83
+ * factories close over).
84
+ */
85
+ constructor(ctx: Context, config: {
86
+ input: SessionInputResolver;
87
+ blocks: ComposerBlocks;
88
+ maxConcurrentFileUploads: number;
89
+ });
90
+ /**
91
+ * Send a prompt into the scoped session. Business failures also land in the
92
+ * session snapshot's promptError (object-layer state); the rejection here
93
+ * exists for caller choreography (the composer restores the draft on it).
94
+ * @param text - prompt text, sent verbatim as one text block.
95
+ */
96
+ send(text: string): Promise<void>;
97
+ /**
98
+ * Submit ordered draft attachments with text through one host admission. A local
99
+ * submission echo enters the session snapshot synchronously; serialization
100
+ * and the prompt round-trip start after the browser can paint it. On the
101
+ * echo's observed retirement seeds admitted image previews into the durable
102
+ * cache and removes every attachment from the draft registry. On failure,
103
+ * every attachment remains registered so the composer can restore it.
104
+ * @param session - target session.
105
+ * @param text - serialized prompt text.
106
+ * @param attachmentIds - ordered draft-local attachment ids.
107
+ * @param mode - queue or steer delivery selected by composer policy.
108
+ * @param signal - optional cancellation for the complete Host admission.
109
+ * @returns the Host admission outcome; local attachment preparation failures reject.
110
+ */
111
+ sendSession(session: SessionFace, text: string, attachmentIds: readonly DraftAttachmentId[], mode: InputSubmitMode, signal?: AbortSignal): Promise<SubmitOutcome>;
112
+ /**
113
+ * Create runtime-only draft attachments. Files whose browser MIME is an
114
+ * accepted image type become image drafts (object URL preview, bytes sent
115
+ * with the prompt); every other file becomes a file draft whose background
116
+ * upload starts immediately and remains owned by this service across Session
117
+ * navigation until completion or explicit removal.
118
+ * @param sessionId - target Agent-scope identity.
119
+ * @param files - browser files to register.
120
+ * @returns ordered draft descriptors.
121
+ */
122
+ createDrafts(sessionId: SessionId, files: readonly File[]): readonly ComposerAttachment[];
123
+ /**
124
+ * Restart one failed file upload.
125
+ * @param sessionId - target Agent-scope identity.
126
+ * @param id - draft attachment id whose upload previously failed.
127
+ */
128
+ retryFileUpload(sessionId: SessionId, id: DraftAttachmentId): void;
129
+ /**
130
+ * Stage carried file drafts again for a new Session.
131
+ * @param sessionId - target Agent-scope identity after a Workspace switch.
132
+ * @param ids - carried draft attachment ids.
133
+ */
134
+ rebindDraftFiles(sessionId: SessionId, ids: readonly DraftAttachmentId[]): void;
135
+ private beginFileUpload;
136
+ /** Start queued upload Workers until the configured concurrency is occupied. */
137
+ private pumpFileUploads;
138
+ /**
139
+ * Resolve ordered input-state ids to runtime-owned draft attachments.
140
+ * @param ids - draft attachment ids.
141
+ * @returns descriptors that remain live, in requested order.
142
+ */
143
+ resolveDraftAttachments(ids: readonly DraftAttachmentId[]): readonly ComposerAttachment[];
144
+ /**
145
+ * Serialize ordered draft attachments to command-submit wire payloads without
146
+ * sending or releasing them. Images are encoded; generic files cite receipts
147
+ * from their completed background uploads and never reread browser bytes.
148
+ * @param attachmentIds - ordered draft-local attachment ids.
149
+ * @returns wire payloads in id order.
150
+ */
151
+ serializeDraftAttachments(attachmentIds: readonly DraftAttachmentId[]): Promise<DraftAttachmentSerializationResult>;
152
+ /**
153
+ * Release one browser-owned draft attachment, aborting its active upload.
154
+ * @param id - draft attachment id.
155
+ */
156
+ releaseDraftAttachment(id: DraftAttachmentId): void;
157
+ /**
158
+ * Release a set of browser-owned draft attachments.
159
+ * @param attachments - descriptors to release.
160
+ */
161
+ releaseDraftAttachments(attachments: readonly ComposerAttachment[]): void;
162
+ /** Apply one operation to a pending queue occurrence. */
163
+ updateQueue(itemId: QueueItemId, action: QueueAction): Promise<void>;
164
+ /** Cancel the scoped session's in-flight turn while preserving Queue (failures land in promptError and reject, as in send). */
165
+ cancel(): Promise<void>;
166
+ /** Pull one older history page for the scoped Session. */
167
+ loadOlder(): Promise<void>;
168
+ /** Resolve the caller scope's session face or throw on root contexts. */
169
+ private scopedSession;
170
+ /** Read the caller's session scope tag via the sessions service; root contexts fail loud. */
171
+ private scopeId;
172
+ private requireSessions;
173
+ /**
174
+ * Settle one submission's draft attachments when its echo retires. Observed:
175
+ * each image leaves the registry, handing its preview URL to the durable
176
+ * image cache (seeded under the admitted reference so the transcript node
177
+ * renders immediately while the cache reads canonical bytes) or revoking it
178
+ * when the cache already holds that reference. Failed: nothing changes;
179
+ * the ids stay registered for the composer's rail restore.
180
+ */
181
+ private settleSubmittedAttachments;
182
+ /** Canonical base64 wire form of one browser image file. */
183
+ private encodeImage;
184
+ }
185
+ //# sourceMappingURL=service.d.ts.map
@@ -0,0 +1,21 @@
1
+ import type { SnapshotStore } from '@deepseek-ai/dsh-client-store';
2
+ import type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
3
+ import type { BusyEnterBehavior } from '../contract/composer-submission.ts';
4
+ /** Registration-side preference face. */
5
+ export interface EnterBehaviorRowInjected {
6
+ hooks: {
7
+ /** Persisted busy-state preference bound as useBusyEnter. */
8
+ busyEnter: SnapshotStore<BusyEnterBehavior>;
9
+ };
10
+ /** Change the busy-state plain-Enter behavior. */
11
+ setBusyEnter: (behavior: BusyEnterBehavior) => void;
12
+ }
13
+ /** Full Settings-row props. */
14
+ export type EnterBehaviorRowProps = PropsRuntime<'settings.general.item'> & PropsLocale<'conversation'> & InjectFace<EnterBehaviorRowInjected>;
15
+ /**
16
+ * Render the busy-state Enter behavior selector.
17
+ * @param props - composed Settings slot props.
18
+ * @returns the preference row.
19
+ */
20
+ export declare function EnterBehaviorRow({ useBusyEnter, setBusyEnter, t }: EnterBehaviorRowProps): import("react").JSX.Element;
21
+ //# sourceMappingURL=EnterBehaviorRow.d.ts.map
@@ -0,0 +1,14 @@
1
+ /** Composer context-occupancy meter: a ring beside the send button fed by the
2
+ * `contextPressure` projection, with a click-open panel of the heuristic
3
+ * `contextBreakdown` composition (system prompt, tools, conversation).
4
+ * Renders nothing until a provider reports both pressure and a route
5
+ * capacity. */
6
+ import type { UseProjection } from '@deepseek-ai/dsh-api-session-controller/client';
7
+ import type { ComposerBarProps } from '../contract/slots.ts';
8
+ export interface ContextMeterProps {
9
+ useProjection: UseProjection;
10
+ /** The owning bar's locale seat, passed down as a plain prop. */
11
+ t: ComposerBarProps['t'];
12
+ }
13
+ export declare function ContextMeter({ useProjection, t }: ContextMeterProps): import("react").JSX.Element | null;
14
+ //# sourceMappingURL=ContextMeter.d.ts.map
@@ -0,0 +1,5 @@
1
+ import type { ConversationSlotProps } from '../contract/slots.ts';
2
+ /** Full props composed from the slot contract. */
3
+ export type ConversationRootProps = ConversationSlotProps;
4
+ export declare function ConversationRoot({ sessionId, useSession, useSessions, useSessionPendingInteraction, useWorkspaces, useConversation, useInput, useComposerBlock, renderSlot, renderSlotChain, selectWorkspace, t, }: ConversationRootProps): import("react").JSX.Element;
5
+ //# sourceMappingURL=ConversationRoot.d.ts.map