@itechchoice/prime-chatkit 0.1.0-alpha.0 → 0.1.0-alpha.10

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.
@@ -0,0 +1,758 @@
1
+ import { type ReactNode } from "react";
2
+ import type { IconSvgElement } from "@hugeicons/react";
3
+ import { type ChatModel } from "@/components/ui/chat-composer-clean";
4
+ import type { ApprovalMode } from "@/components/ui/chat-composer-clean";
5
+ import { type MouseEvent } from "react";
6
+ import { type AppShellProps, type ShellArtifact, type ShellBlock, type WorkspaceSource } from "@/components/app-shell";
7
+ import { type ChatComposerLabels } from "@/components/ui/chat-composer-clean";
8
+ import { type MessageActionsLabels } from "@/components/ui/message-actions-clean";
9
+ import { type ToolCallLabels } from "@/components/ui/tool-call-card-clean";
10
+ export type ThreadConnection = "online" | "offline" | "reconnecting";
11
+ export type ThreadTool = {
12
+ id: string;
13
+ /** What it did, in words – "Read ingest-design.md", "Checked the staging cluster" */
14
+ label: string;
15
+ /** Tool name as called by the agent, shown in mono in the details */
16
+ name?: string;
17
+ args?: unknown;
18
+ result?: unknown;
19
+ icon?: IconSvgElement;
20
+ status: "running" | "done" | "failed" | "stopped";
21
+ /** When it started, as a timestamp in ms – a running tool counts up from it */
22
+ startedAt?: number;
23
+ /** How long it took, once it's no longer running */
24
+ ms?: number;
25
+ /** Why it failed, in a few words */
26
+ error?: string;
27
+ };
28
+ /** A task as the thread mentions it – the Tasks screen has the rest */
29
+ export type ThreadTask = {
30
+ id: string;
31
+ title: string;
32
+ /** Where it is, in words – "Picking a queue", "Merged and on staging" */
33
+ status: string;
34
+ steps?: {
35
+ done: number;
36
+ total: number;
37
+ };
38
+ done?: boolean;
39
+ };
40
+ /** Something that waits on you in the Inbox – by its id there */
41
+ export type ThreadAsk = {
42
+ id: string;
43
+ question: string;
44
+ task: string;
45
+ kind?: "decision" | "pick" | "approval" | "question";
46
+ };
47
+ /** One answer to pick – a pick shows its wireframe as a small tile */
48
+ export type ThreadOption = {
49
+ id: string;
50
+ title: string;
51
+ summary?: string;
52
+ recommended?: boolean;
53
+ wireframe?: ShellBlock[];
54
+ };
55
+ /**
56
+ * A decision the orchestrator can't make alone – it docks above the composer. decision: options to pick from ·
57
+ * pick: visual variants as wireframe tiles · approval: facts, then Approve / Decline. Its last row takes your own words – the composer stays for new prompts
58
+ */
59
+ export type ThreadDecision = ThreadAsk & {
60
+ /** The task it belongs to, by id – its card and Task tab follow the answer */
61
+ taskId?: string;
62
+ /** decision and pick – all supplied options */
63
+ options?: ThreadOption[];
64
+ /** false 时不显示最后一行自由输入;默认 true。 */
65
+ own?: boolean;
66
+ /** approval: two or three lines of what it will do */
67
+ facts?: {
68
+ label: string;
69
+ value: string;
70
+ }[];
71
+ /** Only enable when the backend supports approval for this session. */
72
+ allowAlways?: boolean;
73
+ };
74
+ /** What you answered: an option and / or your own words – or approve / decline */
75
+ export type ThreadAnswer = {
76
+ option?: string;
77
+ text?: string;
78
+ } | "approve" | "approve-always" | "decline";
79
+ /** What the Task tab in the work area shows about a task */
80
+ export type ThreadTaskDetail = {
81
+ goal?: string;
82
+ project?: string;
83
+ /** When it started, in words – e.g. "Mon, Nov 3" */
84
+ started?: string;
85
+ steps?: {
86
+ label: string;
87
+ done?: boolean;
88
+ }[];
89
+ /** What happened so far, newest first – three or four plain lines */
90
+ history?: string[];
91
+ /** What it produced – file names; they open as further tabs */
92
+ artifacts?: string[];
93
+ /** What you decided for it before */
94
+ decided?: {
95
+ question: string;
96
+ answer: string;
97
+ at: number;
98
+ }[];
99
+ };
100
+ export type ThreadPart = {
101
+ kind: "text";
102
+ text: string;
103
+ } | {
104
+ kind: "note";
105
+ text: string;
106
+ } | {
107
+ kind: "tools";
108
+ id: string;
109
+ tools: ThreadTool[];
110
+ } | {
111
+ kind: "task";
112
+ task: ThreadTask;
113
+ } | {
114
+ kind: "decision";
115
+ ask: ThreadAsk;
116
+ } | {
117
+ kind: "artifacts";
118
+ names: string[];
119
+ }
120
+ /** A quiet error line – `retry` adds Retry, which calls onRetry with the message's id */
121
+ | {
122
+ kind: "error";
123
+ text: string;
124
+ retry?: boolean;
125
+ };
126
+ export type ThreadAttachment = {
127
+ id: string;
128
+ name: string;
129
+ /** In bytes */
130
+ size: number;
131
+ kind?: "file" | "image" | "video" | "voice";
132
+ /** A voice note's length */
133
+ seconds?: number;
134
+ };
135
+ export type ThreadUserMessage = {
136
+ id: string;
137
+ role: "user";
138
+ text: string;
139
+ /** When it was written, as a timestamp in ms */
140
+ at: number;
141
+ attachments?: ThreadAttachment[];
142
+ /** queued: written offline, waits to go out · sending · failed: shows Retry (default: sent) */
143
+ status?: "sent" | "queued" | "sending" | "failed";
144
+ /** It answers a decision – a small "Answered: …" line shows above it */
145
+ answer?: {
146
+ id: string;
147
+ question: string;
148
+ };
149
+ };
150
+ export type ThreadAgentMessage = {
151
+ id: string;
152
+ role: "agent";
153
+ at: number;
154
+ parts: ThreadPart[];
155
+ /** Still coming in: a caret after the text, Stop in the composer */
156
+ streaming?: boolean;
157
+ /** Ended with Stop */
158
+ stopped?: boolean;
159
+ };
160
+ export type ThreadMessage = ThreadUserMessage | ThreadAgentMessage;
161
+ /** A preset for previews: plays the sample story or puts the screen in one of its hard states */
162
+ export type ThreadSimulation = "live" | "decision" | "scrolled" | "offline" | "uploading" | "dictating" | "away" | "error";
163
+ declare function threadDefaults(locale: string): {
164
+ title: string;
165
+ orchestrator: string;
166
+ conversation: string;
167
+ placeholder: string;
168
+ listening: string;
169
+ transcribing: string;
170
+ send: string;
171
+ stop: string;
172
+ attach: string;
173
+ uploadFile: string;
174
+ photoVideo: string;
175
+ dictate: string;
176
+ dictateDone: string;
177
+ dictateDiscard: string;
178
+ needsYou: string;
179
+ decide: string;
180
+ open: string;
181
+ retry: string;
182
+ retryNow: string;
183
+ stopped: string;
184
+ waiting: string;
185
+ sending: string;
186
+ failedSend: string;
187
+ offline: string;
188
+ reconnecting: string;
189
+ backOnline: string;
190
+ uploadFailed: string;
191
+ pausedOffline: string;
192
+ savedOffline: string;
193
+ voiceNote: string;
194
+ away: string;
195
+ markRead: string;
196
+ openTasks: string;
197
+ openInbox: string;
198
+ jump: string;
199
+ answerOwn: string;
200
+ later: string;
201
+ show: string;
202
+ recommended: string;
203
+ approve: string;
204
+ decline: string;
205
+ approved: string;
206
+ approveAlways: string;
207
+ approvedAlways: string;
208
+ declined: string;
209
+ asked: string;
210
+ answeredBelow: string;
211
+ waitingOnYou: string;
212
+ answered: string;
213
+ showInTasks: string;
214
+ steps: string;
215
+ happened: string;
216
+ artifacts: string;
217
+ decided: string;
218
+ waitUploads: string;
219
+ fixUploads: string;
220
+ navThread: string;
221
+ navInbox: string;
222
+ navTasks: string;
223
+ navMemory: string;
224
+ navWorkspace: string;
225
+ navSettings: string;
226
+ task: string;
227
+ artifact: string;
228
+ markedRead: string;
229
+ discarded: string;
230
+ laterAnnouncement: string;
231
+ queuedAnnouncement: (waiting: string) => string;
232
+ uploadFailedAnnouncement: (failed: string, name: string) => string;
233
+ needsYouAnnouncement: (needsYou: string, question: string) => string;
234
+ answeredAnnouncement: (answered: string, answer: string) => string;
235
+ attachments: string;
236
+ dictating: string;
237
+ recording: (seconds: number) => string;
238
+ youAnswered: string;
239
+ youSaid: string;
240
+ duration: (ms: number) => string;
241
+ fileSize: (n: number) => string;
242
+ toolsRunning: (n: number) => string;
243
+ toolsStopped: (done: number, n: number) => string;
244
+ toolsRan: (n: number, duration: string) => string;
245
+ toolsFailed: (n: number, failed: number) => string;
246
+ toolRunning: string;
247
+ toolFailed: string;
248
+ toolStopped: string;
249
+ toolDone: string;
250
+ runningCount: (n: number) => string;
251
+ needsCount: (n: number) => string;
252
+ runningSummary: (n: number) => string;
253
+ needsSummary: (n: number, docked: boolean) => string;
254
+ stepsCount: (done: number, total: number) => string;
255
+ openTask: (open: string, title: string, status: string, steps?: {
256
+ done: number;
257
+ total: number;
258
+ }) => string;
259
+ doneCount: (n: number) => string;
260
+ newMessages: (n: number) => string;
261
+ awaySummary: (away: string, counts: string[], fallback: string) => string;
262
+ newSince: (time: string) => string;
263
+ retryingIn: (seconds: number) => string;
264
+ newLines: (n: number) => string;
265
+ stillWriting: string;
266
+ jumpSummary: (jump: string, count: string, writing: string) => string;
267
+ decisionsWaiting: (n: number) => string;
268
+ previousDecision: string;
269
+ nextDecision: string;
270
+ decisionPage: (index: number, count: number) => string;
271
+ ownAnswer: (question: string) => string;
272
+ taskLabel: (title: string) => string;
273
+ status: string;
274
+ project: string;
275
+ started: string;
276
+ stepWaiting: string;
277
+ stepProgress: string;
278
+ cancel: string;
279
+ remove: string;
280
+ cancelUpload: (name: string) => string;
281
+ removeUpload: (name: string) => string;
282
+ composer: {
283
+ placeholder: string;
284
+ requestApproval: string;
285
+ requestApprovalDescription: string;
286
+ approveForMe: string;
287
+ approveForMeDescription: string;
288
+ fullAccess: string;
289
+ fullAccessDescription: string;
290
+ add: string;
291
+ files: string;
292
+ attachClaude: string;
293
+ workInFolder: string;
294
+ chooseFolder: string;
295
+ goal: string;
296
+ goalDescription: string;
297
+ planMode: string;
298
+ planOnDescription: string;
299
+ recordSkill: string;
300
+ draw: string;
301
+ drawDescription: string;
302
+ plugins: string;
303
+ documents: string;
304
+ documentsDescription: string;
305
+ pdf: string;
306
+ pdfDescription: string;
307
+ noFolder: string;
308
+ planOff: string;
309
+ planOn: string;
310
+ recording: string;
311
+ recordingAdded: string;
312
+ recordingDiscarded: string;
313
+ messageSent: string;
314
+ composer: string;
315
+ message: string;
316
+ voiceInput: string;
317
+ sendMessage: string;
318
+ stop: string;
319
+ discardRecording: string;
320
+ useRecording: string;
321
+ connectApps: string;
322
+ addToChat: string;
323
+ planOffDescription: string;
324
+ approvalQuestion: string;
325
+ learnMore: string;
326
+ selectModel: string;
327
+ apps: string;
328
+ workingIn: (folder: string) => string;
329
+ appConnection: (name: string | undefined, connected: boolean) => string;
330
+ selected: (name: string | undefined) => string;
331
+ connectedCount: (n: number) => string;
332
+ };
333
+ messageActions: {
334
+ label: string;
335
+ copy: string;
336
+ copied: string;
337
+ copyMessage: string;
338
+ regenerate: string;
339
+ regenerating: string;
340
+ writing: string;
341
+ regenerateResponse: string;
342
+ goodResponse: string;
343
+ badResponse: string;
344
+ thanks: string;
345
+ markedGood: string;
346
+ markedBad: string;
347
+ thanksFeedback: string;
348
+ finishedReading: string;
349
+ readingAloud: string;
350
+ stoppedReading: string;
351
+ stop: string;
352
+ stopReading: string;
353
+ readAloud: string;
354
+ versions: string;
355
+ previousVersion: string;
356
+ nextVersion: string;
357
+ version: (index: number, count: number) => string;
358
+ whatWentWrong: string;
359
+ closeFeedback: string;
360
+ send: string;
361
+ morePlaceholder: string;
362
+ moreLabel: string;
363
+ notAccurate: string;
364
+ tooLong: string;
365
+ didNotFollow: string;
366
+ other: string;
367
+ };
368
+ toolCall: {
369
+ failed: string;
370
+ error: string;
371
+ retry: string;
372
+ arguments: string;
373
+ result: string;
374
+ waiting: string;
375
+ empty: string;
376
+ showAll: string;
377
+ showLess: string;
378
+ copied: string;
379
+ copyArguments: string;
380
+ copyResult: string;
381
+ running: (name: string) => string;
382
+ finished: (name: string) => string;
383
+ failedAnnouncement: (name: string, error?: string) => string;
384
+ duration: (ms: number, live: boolean) => string;
385
+ usingTools: string;
386
+ usedTools: (n: number) => string;
387
+ failedTools: (n: number) => string;
388
+ groupAnnouncement: (count: string, failed: number) => string;
389
+ };
390
+ };
391
+ declare const defaultLabels: {
392
+ title: string;
393
+ orchestrator: string;
394
+ conversation: string;
395
+ placeholder: string;
396
+ listening: string;
397
+ transcribing: string;
398
+ send: string;
399
+ stop: string;
400
+ attach: string;
401
+ uploadFile: string;
402
+ photoVideo: string;
403
+ dictate: string;
404
+ dictateDone: string;
405
+ dictateDiscard: string;
406
+ needsYou: string;
407
+ decide: string;
408
+ open: string;
409
+ retry: string;
410
+ retryNow: string;
411
+ stopped: string;
412
+ waiting: string;
413
+ sending: string;
414
+ failedSend: string;
415
+ offline: string;
416
+ reconnecting: string;
417
+ backOnline: string;
418
+ uploadFailed: string;
419
+ pausedOffline: string;
420
+ savedOffline: string;
421
+ voiceNote: string;
422
+ away: string;
423
+ markRead: string;
424
+ openTasks: string;
425
+ openInbox: string;
426
+ jump: string;
427
+ answerOwn: string;
428
+ later: string;
429
+ show: string;
430
+ recommended: string;
431
+ approve: string;
432
+ decline: string;
433
+ approved: string;
434
+ approveAlways: string;
435
+ approvedAlways: string;
436
+ declined: string;
437
+ asked: string;
438
+ answeredBelow: string;
439
+ waitingOnYou: string;
440
+ answered: string;
441
+ showInTasks: string;
442
+ steps: string;
443
+ happened: string;
444
+ artifacts: string;
445
+ decided: string;
446
+ waitUploads: string;
447
+ fixUploads: string;
448
+ navThread: string;
449
+ navInbox: string;
450
+ navTasks: string;
451
+ navMemory: string;
452
+ navWorkspace: string;
453
+ navSettings: string;
454
+ task: string;
455
+ artifact: string;
456
+ markedRead: string;
457
+ discarded: string;
458
+ laterAnnouncement: string;
459
+ queuedAnnouncement: (waiting: string) => string;
460
+ uploadFailedAnnouncement: (failed: string, name: string) => string;
461
+ needsYouAnnouncement: (needsYou: string, question: string) => string;
462
+ answeredAnnouncement: (answered: string, answer: string) => string;
463
+ attachments: string;
464
+ dictating: string;
465
+ recording: (seconds: number) => string;
466
+ youAnswered: string;
467
+ youSaid: string;
468
+ duration: (ms: number) => string;
469
+ fileSize: (n: number) => string;
470
+ toolsRunning: (n: number) => string;
471
+ toolsStopped: (done: number, n: number) => string;
472
+ toolsRan: (n: number, duration: string) => string;
473
+ toolsFailed: (n: number, failed: number) => string;
474
+ toolRunning: string;
475
+ toolFailed: string;
476
+ toolStopped: string;
477
+ toolDone: string;
478
+ runningCount: (n: number) => string;
479
+ needsCount: (n: number) => string;
480
+ runningSummary: (n: number) => string;
481
+ needsSummary: (n: number, docked: boolean) => string;
482
+ stepsCount: (done: number, total: number) => string;
483
+ openTask: (open: string, title: string, status: string, steps?: {
484
+ done: number;
485
+ total: number;
486
+ }) => string;
487
+ doneCount: (n: number) => string;
488
+ newMessages: (n: number) => string;
489
+ awaySummary: (away: string, counts: string[], fallback: string) => string;
490
+ newSince: (time: string) => string;
491
+ retryingIn: (seconds: number) => string;
492
+ newLines: (n: number) => string;
493
+ stillWriting: string;
494
+ jumpSummary: (jump: string, count: string, writing: string) => string;
495
+ decisionsWaiting: (n: number) => string;
496
+ previousDecision: string;
497
+ nextDecision: string;
498
+ decisionPage: (index: number, count: number) => string;
499
+ ownAnswer: (question: string) => string;
500
+ taskLabel: (title: string) => string;
501
+ status: string;
502
+ project: string;
503
+ started: string;
504
+ stepWaiting: string;
505
+ stepProgress: string;
506
+ cancel: string;
507
+ remove: string;
508
+ cancelUpload: (name: string) => string;
509
+ removeUpload: (name: string) => string;
510
+ composer: {
511
+ placeholder: string;
512
+ requestApproval: string;
513
+ requestApprovalDescription: string;
514
+ approveForMe: string;
515
+ approveForMeDescription: string;
516
+ fullAccess: string;
517
+ fullAccessDescription: string;
518
+ add: string;
519
+ files: string;
520
+ attachClaude: string;
521
+ workInFolder: string;
522
+ chooseFolder: string;
523
+ goal: string;
524
+ goalDescription: string;
525
+ planMode: string;
526
+ planOnDescription: string;
527
+ recordSkill: string;
528
+ draw: string;
529
+ drawDescription: string;
530
+ plugins: string;
531
+ documents: string;
532
+ documentsDescription: string;
533
+ pdf: string;
534
+ pdfDescription: string;
535
+ noFolder: string;
536
+ planOff: string;
537
+ planOn: string;
538
+ recording: string;
539
+ recordingAdded: string;
540
+ recordingDiscarded: string;
541
+ messageSent: string;
542
+ composer: string;
543
+ message: string;
544
+ voiceInput: string;
545
+ sendMessage: string;
546
+ stop: string;
547
+ discardRecording: string;
548
+ useRecording: string;
549
+ connectApps: string;
550
+ addToChat: string;
551
+ planOffDescription: string;
552
+ approvalQuestion: string;
553
+ learnMore: string;
554
+ selectModel: string;
555
+ apps: string;
556
+ workingIn: (folder: string) => string;
557
+ appConnection: (name: string | undefined, connected: boolean) => string;
558
+ selected: (name: string | undefined) => string;
559
+ connectedCount: (n: number) => string;
560
+ };
561
+ messageActions: {
562
+ label: string;
563
+ copy: string;
564
+ copied: string;
565
+ copyMessage: string;
566
+ regenerate: string;
567
+ regenerating: string;
568
+ writing: string;
569
+ regenerateResponse: string;
570
+ goodResponse: string;
571
+ badResponse: string;
572
+ thanks: string;
573
+ markedGood: string;
574
+ markedBad: string;
575
+ thanksFeedback: string;
576
+ finishedReading: string;
577
+ readingAloud: string;
578
+ stoppedReading: string;
579
+ stop: string;
580
+ stopReading: string;
581
+ readAloud: string;
582
+ versions: string;
583
+ previousVersion: string;
584
+ nextVersion: string;
585
+ version: (index: number, count: number) => string;
586
+ whatWentWrong: string;
587
+ closeFeedback: string;
588
+ send: string;
589
+ morePlaceholder: string;
590
+ moreLabel: string;
591
+ notAccurate: string;
592
+ tooLong: string;
593
+ didNotFollow: string;
594
+ other: string;
595
+ };
596
+ toolCall: {
597
+ failed: string;
598
+ error: string;
599
+ retry: string;
600
+ arguments: string;
601
+ result: string;
602
+ waiting: string;
603
+ empty: string;
604
+ showAll: string;
605
+ showLess: string;
606
+ copied: string;
607
+ copyArguments: string;
608
+ copyResult: string;
609
+ running: (name: string) => string;
610
+ finished: (name: string) => string;
611
+ failedAnnouncement: (name: string, error?: string) => string;
612
+ duration: (ms: number, live: boolean) => string;
613
+ usingTools: string;
614
+ usedTools: (n: number) => string;
615
+ failedTools: (n: number) => string;
616
+ groupAnnouncement: (count: string, failed: number) => string;
617
+ };
618
+ };
619
+ export { defaultLabels as defaultThreadLabels };
620
+ export type ThreadLabelsFull = typeof defaultLabels;
621
+ export type ThreadLabels = Partial<Omit<typeof defaultLabels, "composer" | "messageActions" | "toolCall">> & {
622
+ composer?: Partial<ChatComposerLabels>;
623
+ messageActions?: Partial<MessageActionsLabels>;
624
+ toolCall?: Partial<ToolCallLabels>;
625
+ };
626
+ type Labels = typeof defaultLabels;
627
+ export type AgentThreadScreenProps = Pick<AppShellProps, "onNavigate" | "user" | "className" | "rail" | "chats" | "projects" | "nav" | "groups" | "active" | "defaultPanelOpen" | "header" | "workspaceMeta" | "chrome" | "shellLabels"> & {
628
+ /** Image URL for the orchestrator's mark; omitted, the animated pixel mark stays. */
629
+ orchestratorAvatar?: string;
630
+ /** The workspace in the sidebar */
631
+ workspace?: string;
632
+ /** The conversation. Pass a stable array (state): the screen follows it when it changes. Left out, it shows sample content and answers with a sample reply */
633
+ messages?: ThreadMessage[];
634
+ /** Replaces the main view while keeping the conversation, decisions and composer mounted. */
635
+ overlay?: ReactNode;
636
+ start?: {
637
+ greeting?: string;
638
+ body?: string;
639
+ avatar?: string;
640
+ prompts?: {
641
+ id: string;
642
+ label: string;
643
+ icon?: ReactNode;
644
+ }[];
645
+ action?: {
646
+ label: string;
647
+ loading?: boolean;
648
+ onClick: () => void;
649
+ };
650
+ disabled?: boolean;
651
+ };
652
+ onStartPrompt?: (id: string) => void;
653
+ onLink?: (href: string, event: MouseEvent<HTMLAnchorElement>) => void;
654
+ /** Called when a message goes out – written offline, it waits as "Waiting to send" and is called once you're back online */
655
+ onSend?: (text: string, attachments: ThreadAttachment[]) => void;
656
+ /** Called with Stop or Esc while the orchestrator answers */
657
+ onStop?: () => void;
658
+ /** Called with Retry on a failed message (its id) – or on a failed tool's error line (the message's id) */
659
+ onRetry?: (messageId: string) => void;
660
+ /** Called after Copy with every text part joined as raw Markdown */
661
+ onCopy?: (messageId: string, text: string) => void;
662
+ /** Only the last agent message offers Regenerate */
663
+ onRegenerate?: (messageId: string) => void;
664
+ /** A down vote with a reason fires twice; upsert by message id instead of inserting two records. */
665
+ onFeedback?: (messageId: string, kind: "up" | "down" | null, reason?: string) => void;
666
+ feedbackReasons?: string[];
667
+ /** The connection, when your app knows it best – left out, the screen follows the browser's online / offline events */
668
+ connection?: ThreadConnection;
669
+ /** Called with Retry now in the connection banner */
670
+ onReconnect?: () => void;
671
+ /** When you were last here, as a timestamp in ms – what came after is summed up in a card where you left */
672
+ lastSeen?: number;
673
+ /** After how many minutes in another tab the screen counts you as away (default 5) */
674
+ awayAfter?: number;
675
+ /** Called with Mark as read */
676
+ onMarkRead?: () => void;
677
+ /** The head's quiet summary – how many tasks run and how many questions wait in the Inbox */
678
+ running?: {
679
+ running: number;
680
+ needs: number;
681
+ };
682
+ /** The decisions waiting on you, in order – the first docks above the composer. Pass a stable array (state): the screen follows it. Left out, sample decisions */
683
+ decisions?: ThreadDecision[];
684
+ /** Called when you answer a decision – an option, Approve / Decline, or your own words from the card's last row */
685
+ onDecide?: (id: string, answer: ThreadAnswer) => void;
686
+ /** Called with Later – the dock folds to a one-line reminder */
687
+ onLater?: (id: string) => void;
688
+ /** What the Task tab shows, by task id */
689
+ tasks?: Record<string, ThreadTaskDetail>;
690
+ /** Called when a task opens as a tab in the work area – from its card's Open or the away card */
691
+ onOpenTask?: (taskId: string) => void;
692
+ /** Called with "Show in Tasks" in the Task tab – the only way to the Tasks screen (default: onNavigate("Tasks")) */
693
+ onShowTask?: (taskId: string) => void;
694
+ /** Called with the head's "need you" when nothing is docked, and with the away card's Open Inbox (default: onNavigate("Inbox")) */
695
+ onOpenInbox?: (itemId?: string) => void;
696
+ /** What each artifact shows when it opens in the work area, by file name */
697
+ artifacts?: Record<string, ShellArtifact>;
698
+ /** Artifacts that are open as tabs in the work area when the screen starts, by name (default: none) */
699
+ openArtifacts?: string[];
700
+ /** Models to pick from in the composer – left out, there is no picker: the orchestrator chooses its models itself */
701
+ models?: ChatModel[];
702
+ composer?: {
703
+ addItems?: string[];
704
+ approval?: ApprovalMode | false;
705
+ voice?: boolean;
706
+ disabled?: boolean;
707
+ notice?: string;
708
+ };
709
+ /** Suggested in a New tab of the work area */
710
+ suggested?: WorkspaceSource[];
711
+ /** Uploads a file the composer holds: report progress from 0 to 1, honour the signal (Cancel); reject and the chip says "Upload failed · Retry". Left out, uploads are simulated */
712
+ upload?: (file: File, progress: (p: number) => void, signal: AbortSignal) => Promise<void>;
713
+ /** Turns a voice note into text – it lands in the field. Left out, a sample sentence */
714
+ transcribe?: (clip: ThreadAttachment) => Promise<string>;
715
+ /** A preset for previews – plays the sample story or starts in one of the hard states */
716
+ simulate?: ThreadSimulation;
717
+ /** Labels, e.g. for a translation */
718
+ labels?: ThreadLabels;
719
+ locale?: string;
720
+ };
721
+ declare function ThreadStart({ start, onStartPrompt }: {
722
+ start: NonNullable<AgentThreadScreenProps["start"]>;
723
+ onStartPrompt?: AgentThreadScreenProps["onStartPrompt"];
724
+ }): import("react").JSX.Element;
725
+ export declare function AgentThreadScreen({ workspace, messages: messagesProp, overlay, start, onStartPrompt, onLink, orchestratorAvatar, onCopy, onRegenerate, onFeedback, feedbackReasons, onSend, onStop, onRetry, connection: connectionProp, onReconnect, lastSeen: lastSeenProp, awayAfter, onMarkRead, running, decisions: decisionsProp, onDecide, onLater, tasks: taskDetailsProp, onOpenTask, onShowTask, onOpenInbox, artifacts, openArtifacts, models, composer, suggested, upload, transcribe, simulate, labels: labelProp, locale, onNavigate, ...props }: AgentThreadScreenProps): import("react").JSX.Element;
726
+ /** Yours: a soft bubble on the right, files above it; queued, sending or failed under it */
727
+ declare function UserMessage({ message: m, labels, onRetry }: {
728
+ message: ThreadUserMessage;
729
+ labels: Labels;
730
+ onRetry: () => void;
731
+ }): import("react").JSX.Element;
732
+ /** The orchestrator's: plain text on the page under its mark, with its cards, tools and files in between */
733
+ declare const ThreadLinkContext: import("react").Context<((href: string, event: MouseEvent<HTMLAnchorElement>) => void) | undefined>;
734
+ declare const ThreadMarkdown: import("react").NamedExoticComponent<{
735
+ text: string;
736
+ }>;
737
+ declare function AgentMessage({ message: m, status, phase, liveOpen, clock, orchestratorAvatar, first, now, labels, askState, onTask, onAsk, onRetry, onCopy, onRegenerate, onFeedback, feedbackReasons, }: {
738
+ message: ThreadAgentMessage;
739
+ status?: ReactNode;
740
+ phase?: "working" | "writing" | "done";
741
+ liveOpen?: boolean;
742
+ clock: Intl.DateTimeFormat;
743
+ orchestratorAvatar?: string;
744
+ first: boolean;
745
+ now: number;
746
+ labels: Labels;
747
+ askState: (id: string) => "waiting" | "answered" | "inbox";
748
+ onTask: (id: string) => void;
749
+ onAsk: (id: string) => void;
750
+ onRetry?: () => void;
751
+ } & Pick<AgentThreadScreenProps, "onCopy" | "onRegenerate" | "onFeedback" | "feedbackReasons">): import("react").JSX.Element;
752
+ export { UserMessage, AgentMessage, ThreadStart, ThreadMarkdown, ThreadLinkContext, threadDefaults };
753
+ export type { Labels };
754
+ /** The original message parts, with their shell tokens but no screen layout. */
755
+ export declare function ThreadPartsRoot({ children, className }: {
756
+ children: ReactNode;
757
+ className?: string;
758
+ }): import("react").JSX.Element;