@fungi.computer/parakeet 0.0.0-stage → 0.0.1

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 (117) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +186 -2
  3. package/dist/account-commands.d.ts +102 -0
  4. package/dist/account-commands.js +239 -0
  5. package/dist/agent-head.d.ts +4 -0
  6. package/dist/agent-head.js +2 -0
  7. package/dist/client-contributions.d.ts +20 -0
  8. package/dist/client-contributions.js +41 -0
  9. package/dist/commands/advertised.d.ts +23 -0
  10. package/dist/commands/advertised.js +72 -0
  11. package/dist/commands/builtins.d.ts +14 -0
  12. package/dist/commands/builtins.js +91 -0
  13. package/dist/commands/hints.d.ts +36 -0
  14. package/dist/commands/hints.js +64 -0
  15. package/dist/commands/interactions.d.ts +55 -0
  16. package/dist/commands/interactions.js +101 -0
  17. package/dist/commands/run.d.ts +11 -0
  18. package/dist/commands/run.js +61 -0
  19. package/dist/commands/slash.d.ts +124 -0
  20. package/dist/commands/slash.js +182 -0
  21. package/dist/commands/use-slash-commands.d.ts +57 -0
  22. package/dist/commands/use-slash-commands.js +207 -0
  23. package/dist/components/AgentHead.d.ts +27 -0
  24. package/dist/components/AgentHead.js +53 -0
  25. package/dist/components/ChatComposer.d.ts +43 -0
  26. package/dist/components/ChatComposer.js +209 -0
  27. package/dist/components/ChatMessage.d.ts +8 -0
  28. package/dist/components/ChatMessage.js +16 -0
  29. package/dist/components/ClientRows.d.ts +11 -0
  30. package/dist/components/ClientRows.js +46 -0
  31. package/dist/components/CodeBlock.d.ts +11 -0
  32. package/dist/components/CodeBlock.js +38 -0
  33. package/dist/components/InteractionPanel.d.ts +15 -0
  34. package/dist/components/InteractionPanel.js +42 -0
  35. package/dist/components/MarkdownRenderer.d.ts +6 -0
  36. package/dist/components/MarkdownRenderer.js +48 -0
  37. package/dist/components/RunFailureNotice.d.ts +7 -0
  38. package/dist/components/RunFailureNotice.js +13 -0
  39. package/dist/components/ShiitakeAvatar.d.ts +19 -0
  40. package/dist/components/ShiitakeAvatar.js +20 -0
  41. package/dist/components/SlashMenu.d.ts +8 -0
  42. package/dist/components/SlashMenu.js +50 -0
  43. package/dist/components/ThinkingBlock.d.ts +3 -0
  44. package/dist/components/ThinkingBlock.js +18 -0
  45. package/dist/components/TimelineItem.d.ts +15 -0
  46. package/dist/components/TimelineItem.js +35 -0
  47. package/dist/components/ToolGroup.d.ts +12 -0
  48. package/dist/components/ToolGroup.js +90 -0
  49. package/dist/components/WaitingNotice.d.ts +7 -0
  50. package/dist/components/WaitingNotice.js +8 -0
  51. package/dist/components/avatar-presentation.d.ts +23 -0
  52. package/dist/components/avatar-presentation.js +16 -0
  53. package/dist/components/sprite-service.d.ts +2 -0
  54. package/dist/components/sprite-service.js +9 -0
  55. package/dist/components/still-frame-cache.d.ts +16 -0
  56. package/dist/components/still-frame-cache.js +63 -0
  57. package/dist/conversation.d.ts +164 -0
  58. package/dist/conversation.js +760 -0
  59. package/dist/core/assistant-visibility.d.ts +3 -0
  60. package/dist/core/assistant-visibility.js +4 -0
  61. package/dist/core/author-labels.d.ts +16 -0
  62. package/dist/core/author-labels.js +16 -0
  63. package/dist/core/build-timeline.d.ts +36 -0
  64. package/dist/core/build-timeline.js +328 -0
  65. package/dist/core/client-actions.d.ts +35 -0
  66. package/dist/core/client-actions.js +128 -0
  67. package/dist/core/client-contributions.d.ts +24 -0
  68. package/dist/core/client-contributions.js +115 -0
  69. package/dist/core/client-timeline.d.ts +33 -0
  70. package/dist/core/client-timeline.js +72 -0
  71. package/dist/core/format-context.d.ts +11 -0
  72. package/dist/core/format-context.js +20 -0
  73. package/dist/core/format-tokens.d.ts +2 -0
  74. package/dist/core/format-tokens.js +6 -0
  75. package/dist/core/model-identity.d.ts +3 -0
  76. package/dist/core/model-identity.js +7 -0
  77. package/dist/core/session-projection.d.ts +11 -0
  78. package/dist/core/session-projection.js +191 -0
  79. package/dist/core/session-query.d.ts +118 -0
  80. package/dist/core/session-query.js +187 -0
  81. package/dist/core/session-view-state.d.ts +66 -0
  82. package/dist/core/session-view-state.js +114 -0
  83. package/dist/core/tool-contract.d.ts +15 -0
  84. package/dist/core/tool-contract.js +3 -0
  85. package/dist/core/tool-groups.d.ts +36 -0
  86. package/dist/core/tool-groups.js +151 -0
  87. package/dist/core/tool-view.d.ts +182 -0
  88. package/dist/core/tool-view.js +618 -0
  89. package/dist/headless.d.ts +28 -0
  90. package/dist/headless.js +24 -0
  91. package/dist/index.d.ts +9 -0
  92. package/dist/index.js +4 -0
  93. package/dist/lib/failure.d.ts +2 -0
  94. package/dist/lib/failure.js +9 -0
  95. package/dist/markdown.d.ts +3 -0
  96. package/dist/markdown.js +6 -0
  97. package/dist/model-commands.d.ts +44 -0
  98. package/dist/model-commands.js +232 -0
  99. package/dist/parakeet.d.ts +77 -0
  100. package/dist/parakeet.js +276 -0
  101. package/dist/provider-choices.d.ts +8 -0
  102. package/dist/provider-choices.js +43 -0
  103. package/dist/reload-command.d.ts +43 -0
  104. package/dist/reload-command.js +72 -0
  105. package/dist/session-commands.d.ts +53 -0
  106. package/dist/session-commands.js +259 -0
  107. package/dist/session.d.ts +24 -0
  108. package/dist/session.js +1 -0
  109. package/dist/store/types.d.ts +163 -0
  110. package/dist/store/types.js +1 -0
  111. package/dist/styles.css +19156 -0
  112. package/docs/api/README.md +15 -0
  113. package/docs/api/commands/slash.md +321 -0
  114. package/docs/api/headless.md +2510 -0
  115. package/docs/api/index.md +1253 -0
  116. package/package.json +79 -3
  117. package/src/styles.css +268 -0
@@ -0,0 +1,1253 @@
1
+ <!-- Generated by Botanical API docs (TypeDoc + typedoc-plugin-markdown). Do not edit. -->
2
+
3
+ [**@fungi.computer/parakeet**](README.md)
4
+
5
+ ---
6
+
7
+ [@fungi.computer/parakeet](README.md) / index
8
+
9
+ # index
10
+
11
+ ## Type Aliases
12
+
13
+ ### AgentHeadActivity
14
+
15
+ ```ts
16
+ type AgentHeadActivity = "idle" | "thinking" | "speaking";
17
+ ```
18
+
19
+ What the head is doing: at rest, working something out, or talking.
20
+
21
+ ---
22
+
23
+ ### InteractionPanelProps
24
+
25
+ ```ts
26
+ type InteractionPanelProps = Readonly<{
27
+ host: WhistleInteractionHost;
28
+ onClose?: () => void;
29
+ onRetry?: () => void;
30
+ }>;
31
+ ```
32
+
33
+ The interaction to draw and the page's close and retry callbacks.
34
+
35
+ ---
36
+
37
+ ### AvatarState
38
+
39
+ ```ts
40
+ type AvatarState = Readonly<
41
+ Pick<AvatarPresentation, "activity" | "expression">
42
+ >;
43
+ ```
44
+
45
+ The current activity and expression supplied to a composer avatar.
46
+
47
+ ---
48
+
49
+ ### ParakeetModel
50
+
51
+ ```ts
52
+ type ParakeetModel = Readonly<{
53
+ model: string;
54
+ provider: string;
55
+ }>;
56
+ ```
57
+
58
+ Stable model identity presented by the current Session.
59
+
60
+ ---
61
+
62
+ ### ParakeetUsage
63
+
64
+ ```ts
65
+ type ParakeetUsage = Readonly<{
66
+ cost: number;
67
+ tokens: number;
68
+ }>;
69
+ ```
70
+
71
+ Aggregate usage presented by the current Session timeline.
72
+
73
+ ---
74
+
75
+ ### ParakeetStatus
76
+
77
+ ```ts
78
+ type ParakeetStatus =
79
+ | "connecting"
80
+ | "cancelling"
81
+ | "error"
82
+ | "idle"
83
+ | "queued"
84
+ | "retrying"
85
+ | "sending"
86
+ | "streaming"
87
+ | "thinking"
88
+ | "disconnected";
89
+ ```
90
+
91
+ Conversation activity presented by Parakeet.
92
+
93
+ ---
94
+
95
+ ### TimelineController
96
+
97
+ ```ts
98
+ type TimelineController = Readonly<{
99
+ settled: readonly ParakeetTimelineItem[];
100
+ tail: readonly ParakeetTimelineItem[];
101
+ commandAnchors: ReadonlyMap<string, string>;
102
+ queued: SessionPendingPrompts;
103
+ pendingHasMore: boolean;
104
+ hasMoreHistory: boolean;
105
+ loadingOlderHistory: boolean;
106
+ loadOlderHistory: () => void;
107
+ hasNewerHistory: boolean;
108
+ loadNewerHistory: () => void;
109
+ pinVisibleHistory: () => void;
110
+ jumpToLatest: () => void;
111
+ model?: ParakeetModel;
112
+ usage?: ParakeetUsage;
113
+ }>;
114
+ ```
115
+
116
+ Stable history and replaceable work rendered by a conversation client.
117
+
118
+ ---
119
+
120
+ ### ComposerController
121
+
122
+ ```ts
123
+ type ComposerController = Readonly<{
124
+ cancel: () => Promise<void>;
125
+ draft: string;
126
+ failure: "admission" | "failed" | "cancelled" | "interrupted" | undefined;
127
+ admissionError: "queue_full" | undefined;
128
+ retry: () => void;
129
+ dismissFailed: (requestId) => void;
130
+ send: (delivery?) => void;
131
+ submitCommand: (run) => Promise<WhistleExecutionOutcome | undefined>;
132
+ setDraft: (value) => void;
133
+ }>;
134
+ ```
135
+
136
+ Draft and prompt operations for the current conversation.
137
+
138
+ ---
139
+
140
+ ### StatusController
141
+
142
+ ```ts
143
+ type StatusController = Readonly<{
144
+ commandId: string | undefined;
145
+ observation: ParakeetObservation;
146
+ reconnect: () => Promise<ParakeetReconnectOutcome>;
147
+ status: ParakeetStatus;
148
+ viewState: ParakeetSessionViewState;
149
+ context: SessionContext | undefined;
150
+ }>;
151
+ ```
152
+
153
+ Session activity, observation, and Agent-lifetime controls.
154
+
155
+ ---
156
+
157
+ ### ParakeetAuthor
158
+
159
+ ```ts
160
+ type ParakeetAuthor = Readonly<{
161
+ id: string;
162
+ name: string;
163
+ }>;
164
+ ```
165
+
166
+ Who wrote a timeline line, as the host chose to show them.
167
+
168
+ ---
169
+
170
+ ### ParakeetAuthorOf
171
+
172
+ ```ts
173
+ type ParakeetAuthorOf = (meta) => ParakeetAuthor | undefined;
174
+ ```
175
+
176
+ The host's reading of a message's opaque metadata: the author to show, or none.
177
+ Parakeet never interprets metadata itself.
178
+
179
+ #### Parameters
180
+
181
+ | Parameter | Type |
182
+ | --------- | ---------------------------- |
183
+ | `meta` | `SessionMessage`\[`"meta"`\] |
184
+
185
+ #### Returns
186
+
187
+ [`ParakeetAuthor`](#parakeetauthor) \| `undefined`
188
+
189
+ ---
190
+
191
+ ### ParakeetToolArguments
192
+
193
+ ```ts
194
+ type ParakeetToolArguments = JsonObject;
195
+ ```
196
+
197
+ Pi's JSON argument object after the maintained Zod boundary parser.
198
+
199
+ ---
200
+
201
+ ### ToolDisclosureState
202
+
203
+ ```ts
204
+ type ToolDisclosureState = Readonly<{
205
+ mode: "collapsed" | "default" | "expanded";
206
+ overrides: ReadonlyMap<string, boolean>;
207
+ }>;
208
+ ```
209
+
210
+ View-only open/closed state shared by the browser and terminal renderers.
211
+
212
+ ---
213
+
214
+ ### ParakeetToolKind
215
+
216
+ ```ts
217
+ type ParakeetToolKind =
218
+ "code" | "command" | "edit" | "other" | "read" | "search";
219
+ ```
220
+
221
+ Closed presentation vocabulary for one tool call. It is chosen from the typed
222
+ tool name, never inferred from arguments or result text.
223
+
224
+ ---
225
+
226
+ ### ParakeetToolDiffLine
227
+
228
+ ```ts
229
+ type ParakeetToolDiffLine = Readonly<{
230
+ kind: "add" | "context" | "remove";
231
+ text: string;
232
+ }>;
233
+ ```
234
+
235
+ One changed or context line of a diff hunk.
236
+
237
+ ---
238
+
239
+ ### ParakeetToolDiffHunk
240
+
241
+ ```ts
242
+ type ParakeetToolDiffHunk = Readonly<{
243
+ header?: string;
244
+ lines: readonly ParakeetToolDiffLine[];
245
+ }>;
246
+ ```
247
+
248
+ One hunk: a jsdiff hunk, or one `@@` block of a Codex patch.
249
+
250
+ ---
251
+
252
+ ### ParakeetToolDiffFile
253
+
254
+ ```ts
255
+ type ParakeetToolDiffFile = Readonly<{
256
+ operation: "add" | "delete" | "update";
257
+ path?: string;
258
+ moveTo?: string;
259
+ hunks: readonly ParakeetToolDiffHunk[];
260
+ unified: string;
261
+ lineNumbers: boolean;
262
+ }>;
263
+ ```
264
+
265
+ The hunks for one file.
266
+
267
+ ---
268
+
269
+ ### ParakeetToolDiffRow
270
+
271
+ ```ts
272
+ type ParakeetToolDiffRow = Readonly<{
273
+ kind: "add" | "context" | "file" | "hunk" | "remove";
274
+ text: string;
275
+ }>;
276
+ ```
277
+
278
+ One display row of a diff, flattened once here so every renderer draws the same
279
+ rows. File rows appear only when a call touches several files.
280
+
281
+ ---
282
+
283
+ ### ParakeetToolExcerptLine
284
+
285
+ ```ts
286
+ type ParakeetToolExcerptLine = Readonly<{
287
+ number?: number;
288
+ text: string;
289
+ }>;
290
+ ```
291
+
292
+ One file excerpt line; the number is present only when it is known.
293
+
294
+ ---
295
+
296
+ ### ParakeetToolMatch
297
+
298
+ ```ts
299
+ type ParakeetToolMatch = Readonly<{
300
+ location: string;
301
+ text: string;
302
+ }>;
303
+ ```
304
+
305
+ One search hit.
306
+
307
+ ---
308
+
309
+ ### ParakeetToolOutputLine
310
+
311
+ ```ts
312
+ type ParakeetToolOutputLine = Readonly<{
313
+ stream: "stderr" | "stdout";
314
+ text: string;
315
+ }>;
316
+ ```
317
+
318
+ One line of command output, marked by the stream that produced it.
319
+
320
+ ---
321
+
322
+ ### ParakeetToolCallSection
323
+
324
+ ```ts
325
+ type ParakeetToolCallSection = Readonly<
326
+ | {
327
+ kind: "excerpt";
328
+ lines: readonly ParakeetToolExcerptLine[];
329
+ preview: number;
330
+ }
331
+ | {
332
+ kind: "matches";
333
+ matches: readonly ParakeetToolMatch[];
334
+ preview: number;
335
+ }
336
+ | {
337
+ kind: "diff";
338
+ files: readonly ParakeetToolDiffFile[];
339
+ lines: readonly ParakeetToolDiffRow[];
340
+ preview: number;
341
+ }
342
+ | {
343
+ kind: "command";
344
+ lines: readonly string[];
345
+ preview: number;
346
+ }
347
+ | {
348
+ kind: "script";
349
+ lines: readonly string[];
350
+ preview: number;
351
+ }
352
+ | {
353
+ kind: "output";
354
+ lines: readonly ParakeetToolOutputLine[];
355
+ preview: number;
356
+ }
357
+ | {
358
+ kind: "text";
359
+ label?: string;
360
+ language?: "json";
361
+ lines: readonly string[];
362
+ preview: number;
363
+ }
364
+ >;
365
+ ```
366
+
367
+ One typed section of an expanded call body. Sections hold complete bounded
368
+ content; renderers show `preview` items and offer the rest.
369
+
370
+ ---
371
+
372
+ ### ParakeetToolCallView
373
+
374
+ ```ts
375
+ type ParakeetToolCallView = Readonly<{
376
+ id: string;
377
+ kind: ParakeetToolKind;
378
+ name: string;
379
+ verb: string;
380
+ activeVerb: string;
381
+ label: string;
382
+ paths: readonly string[];
383
+ status: ParakeetToolItem["status"];
384
+ durationMs?: number;
385
+ exitCode?: number;
386
+ error?: string;
387
+ sections: readonly ParakeetToolCallSection[];
388
+ }>;
389
+ ```
390
+
391
+ Renderer-neutral presentation of one tool call and its joined result.
392
+
393
+ ---
394
+
395
+ ### ParakeetVisitor
396
+
397
+ ```ts
398
+ type ParakeetVisitor = Readonly<{
399
+ agentName: string;
400
+ }>;
401
+ ```
402
+
403
+ Public composer options for an anonymous visitor conversation.
404
+
405
+ ---
406
+
407
+ ### ParakeetProps
408
+
409
+ ```ts
410
+ type ParakeetProps = Readonly<{
411
+ disambiguateAuthors?: boolean;
412
+ authorOf?: ParakeetAuthorOf;
413
+ visitor?: ParakeetVisitor;
414
+ markdownPolicy?: "session" | "visitor";
415
+ session: ParakeetSession;
416
+ clients?: readonly ClientEntryV1[];
417
+ composerActionVariant?: "primary" | "outline";
418
+ renderToolActions?: (item) => ReactNode;
419
+ renderAssistantAttachment?: (text) => ReactNode;
420
+ formatAssistantText?: (text) => string;
421
+ onLink?: (href) => boolean;
422
+ onOpen?: (target) => void;
423
+ empty?: ReactNode;
424
+ commands?: ParakeetCommandRuntime;
425
+ }>;
426
+ ```
427
+
428
+ Props for the standalone retained conversation surface.
429
+
430
+ ---
431
+
432
+ ### ParakeetViewProps
433
+
434
+ ```ts
435
+ type ParakeetViewProps = Readonly<{
436
+ disambiguateAuthors?: boolean;
437
+ visitor?: ParakeetVisitor;
438
+ composerActionVariant?: "primary" | "outline";
439
+ renderToolActions?: (item) => ReactNode;
440
+ renderAssistantAttachment?: (text) => ReactNode;
441
+ formatAssistantText?: (text) => string;
442
+ onLink?: (href) => boolean;
443
+ onOpen?: (target) => void;
444
+ empty?: ReactNode;
445
+ commands?: ParakeetCommandRuntime;
446
+ }>;
447
+ ```
448
+
449
+ Props for the reusable retained conversation view.
450
+
451
+ ---
452
+
453
+ ### ParakeetPromptResult
454
+
455
+ ```ts
456
+ type ParakeetPromptResult =
457
+ | Accepted
458
+ | Readonly<{
459
+ status: "recorded";
460
+ }>;
461
+ ```
462
+
463
+ A prompt may be recorded for a human without admitting Agent work.
464
+
465
+ ---
466
+
467
+ ### ParakeetSessionCommand
468
+
469
+ ```ts
470
+ type ParakeetSessionCommand = {
471
+ (input): Promise<ParakeetPromptResult>;
472
+ (input): Promise<CancelResult>;
473
+ (input): Promise<undefined>;
474
+ (input): Promise<
475
+ Readonly<{
476
+ sessionId: string;
477
+ }>
478
+ >;
479
+ (input): Promise<
480
+ | Readonly<{
481
+ status: "accepted";
482
+ commandId: string;
483
+ }>
484
+ | Readonly<{
485
+ status: "too_late";
486
+ commandId: string;
487
+ }>
488
+ | Readonly<{
489
+ sessionId: string;
490
+ }>
491
+ | Readonly<{
492
+ status: "recorded";
493
+ }>
494
+ | undefined
495
+ >;
496
+ };
497
+ ```
498
+
499
+ Session commands preserve their owner results, including held visitor lines.
500
+
501
+ #### Call Signature
502
+
503
+ ```ts
504
+ (input): Promise<ParakeetPromptResult>;
505
+ ```
506
+
507
+ Admit Agent work or record a prompt held for a human reply.
508
+
509
+ ##### Parameters
510
+
511
+ | Parameter | Type |
512
+ | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
513
+ | `input` | \| \{ `delivery`: `"followUp"` \| `"steer"`; `requestId`: `string`; `type`: `"prompt"`; `text`: `string`; `images?`: readonly `object`[]; \} \| \{ `type`: `"compact"`; `requestId`: `string`; `instructions?`: `string`; \} |
514
+
515
+ ##### Returns
516
+
517
+ `Promise`\<[`ParakeetPromptResult`](#parakeetpromptresult)\>
518
+
519
+ #### Call Signature
520
+
521
+ ```ts
522
+ (input): Promise<CancelResult>;
523
+ ```
524
+
525
+ Cancel the named queued or running command.
526
+
527
+ ##### Parameters
528
+
529
+ | Parameter | Type |
530
+ | ---------------------- | ----------------------------------------------------------------------------- |
531
+ | `input` | \{ `commandId`: `string`; `onlyIfPending?`: `boolean`; `type`: `"cancel"`; \} |
532
+ | `input.commandId` | `string` |
533
+ | `input.onlyIfPending?` | `boolean` |
534
+ | `input.type` | `"cancel"` |
535
+
536
+ ##### Returns
537
+
538
+ `Promise`\<`CancelResult`\>
539
+
540
+ #### Call Signature
541
+
542
+ ```ts
543
+ (input): Promise<undefined>;
544
+ ```
545
+
546
+ Forward an owner-supported Session control command.
547
+
548
+ ##### Parameters
549
+
550
+ | Parameter | Type |
551
+ | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
552
+ | `input` | \| \{ `type`: `"abort"`; \} \| \{ `type`: `"branch"`; `entryId`: `string`; \} \| \{ `type`: `"operator"`; `requestId`: `string`; `author`: `"operator"` \| `"party"`; `text`: `string`; \} \| \{ `type`: `"title"`; `title`: `string` \| `null`; \} |
553
+
554
+ ##### Returns
555
+
556
+ `Promise`\<`undefined`\>
557
+
558
+ #### Call Signature
559
+
560
+ ```ts
561
+ (input): Promise<Readonly<{
562
+ sessionId: string;
563
+ }>>;
564
+ ```
565
+
566
+ Return the owner-issued address of a forked Session.
567
+
568
+ ##### Parameters
569
+
570
+ | Parameter | Type |
571
+ | --------------- | -------------------------------------------- |
572
+ | `input` | \{ `type`: `"fork"`; `entryId`: `string`; \} |
573
+ | `input.type` | `"fork"` |
574
+ | `input.entryId` | `string` |
575
+
576
+ ##### Returns
577
+
578
+ `Promise`\<`Readonly`\<\{ `sessionId`: `string`; \}\>\>
579
+
580
+ #### Call Signature
581
+
582
+ ```ts
583
+ (input): Promise<
584
+ | Readonly<{
585
+ status: "accepted";
586
+ commandId: string;
587
+ }>
588
+ | Readonly<{
589
+ status: "too_late";
590
+ commandId: string;
591
+ }>
592
+ | Readonly<{
593
+ sessionId: string;
594
+ }>
595
+ | Readonly<{
596
+ status: "recorded";
597
+ }>
598
+ | undefined>;
599
+ ```
600
+
601
+ Dispatch a typed command without inventing an admission result.
602
+
603
+ ##### Parameters
604
+
605
+ | Parameter | Type |
606
+ | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
607
+ | `input` | \| \{ `delivery`: `"followUp"` \| `"steer"`; `requestId`: `string`; `type`: `"prompt"`; `text`: `string`; `images?`: readonly `object`[]; \} \| \{ `type`: `"abort"`; \} \| \{ `commandId`: `string`; `onlyIfPending?`: `boolean`; `type`: `"cancel"`; \} \| \{ `type`: `"branch"`; `entryId`: `string`; \} \| \{ `type`: `"fork"`; `entryId`: `string`; \} \| \{ `type`: `"operator"`; `requestId`: `string`; `author`: `"operator"` \| `"party"`; `text`: `string`; \} \| \{ `type`: `"compact"`; `requestId`: `string`; `instructions?`: `string`; \} \| \{ `type`: `"title"`; `title`: `string` \| `null`; \} |
608
+
609
+ ##### Returns
610
+
611
+ `Promise`\< \| `Readonly`\<\{ `status`: `"accepted"`; `commandId`: `string`;
612
+ \}\> \| `Readonly`\<\{ `status`: `"too_late"`; `commandId`: `string`; \}\> \|
613
+ `Readonly`\<\{ `sessionId`: `string`; \}\> \| `Readonly`\<\{ `status`:
614
+ `"recorded"`; \}\> \| `undefined`\>
615
+
616
+ ---
617
+
618
+ ### ParakeetSession
619
+
620
+ ```ts
621
+ type ParakeetSession = Readonly<
622
+ Pick<ShiitakeSession, "address" | "extension" | "read" | "watch"> & object
623
+ >;
624
+ ```
625
+
626
+ The exact Shiitake operations consumed by the retained conversation UI.
627
+
628
+ ---
629
+
630
+ ### ParakeetUserMessageItem
631
+
632
+ ```ts
633
+ type ParakeetUserMessageItem = Readonly<{
634
+ author?: ParakeetAuthor;
635
+ origin?: SessionMessage["origin"];
636
+ id: string;
637
+ kind: "user_message";
638
+ requestId?: string;
639
+ commandId?: string;
640
+ status: "pending" | "accepted" | "queued" | "failed" | "confirmed";
641
+ delivery?: PromptDelivery;
642
+ error?: string;
643
+ at?: number;
644
+ text: string;
645
+ }>;
646
+ ```
647
+
648
+ One user prompt projected into the conversation timeline.
649
+
650
+ ---
651
+
652
+ ### ParakeetAssistantMessageItem
653
+
654
+ ```ts
655
+ type ParakeetAssistantMessageItem = Readonly<{
656
+ author?: ParakeetAuthor;
657
+ id: string;
658
+ kind: "assistant_message";
659
+ isError?: boolean;
660
+ pending: boolean;
661
+ at?: number;
662
+ text: string;
663
+ thinking?: string;
664
+ usage?: Readonly<{
665
+ cost: number;
666
+ tokens: number;
667
+ }>;
668
+ }>;
669
+ ```
670
+
671
+ One assistant message projected from exact stored Pi content.
672
+
673
+ ---
674
+
675
+ ### ParakeetToolItem
676
+
677
+ ```ts
678
+ type ParakeetToolItem = Readonly<{
679
+ args: Readonly<ParakeetToolArguments>;
680
+ id: string;
681
+ kind: "tool";
682
+ name: string;
683
+ result?: ToolResultMessage;
684
+ startedAt?: number;
685
+ status: "completed" | "error" | "running" | "unknown";
686
+ }>;
687
+ ```
688
+
689
+ One Pi tool call joined with its corresponding tool result.
690
+
691
+ ---
692
+
693
+ ### ParakeetToolGroupItem
694
+
695
+ ```ts
696
+ type ParakeetToolGroupItem = Readonly<{
697
+ active?: ParakeetToolCallView;
698
+ calls: readonly ParakeetToolCallView[];
699
+ durationMs?: number;
700
+ failedCount: number;
701
+ id: string;
702
+ kind: "tool_group";
703
+ status: "completed" | "error" | "running" | "unknown";
704
+ summary: string;
705
+ tools: readonly ParakeetToolItem[];
706
+ }>;
707
+ ```
708
+
709
+ One maximal run of consecutive tool calls between conversation rows. A lone call
710
+ is a group of one. Grouping is computed once by the headless projection.
711
+
712
+ ---
713
+
714
+ ### ParakeetTimelineItem
715
+
716
+ ```ts
717
+ type ParakeetTimelineItem =
718
+ | ParakeetAssistantMessageItem
719
+ | {
720
+ id: string;
721
+ kind: "compaction_divider";
722
+ at: number;
723
+ tokensBefore: number;
724
+ tokensAfter: number | null;
725
+ }
726
+ | {
727
+ id: string;
728
+ kind: "compaction_notice";
729
+ at: number;
730
+ trigger: SessionCompactionTrigger;
731
+ result: "failed" | "nothing_to_compact";
732
+ diagnostic: string | null;
733
+ }
734
+ | ParakeetToolGroupItem
735
+ | ParakeetUserMessageItem;
736
+ ```
737
+
738
+ Stable row grammar rendered by Parakeet's timeline.
739
+
740
+ #### Union Members
741
+
742
+ [`ParakeetAssistantMessageItem`](#parakeetassistantmessageitem)
743
+
744
+ ---
745
+
746
+ ##### Type Literal
747
+
748
+ ```ts
749
+ {
750
+ id: string;
751
+ kind: "compaction_divider";
752
+ at: number;
753
+ tokensBefore: number;
754
+ tokensAfter: number | null;
755
+ }
756
+ ```
757
+
758
+ | Name | Type | Description |
759
+ | -------------- | ---------------------- | -------------------------------------------------------------------- |
760
+ | `id` | `string` | Stable rendered-item identity, from the durable compaction entry. |
761
+ | `kind` | `"compaction_divider"` | Compaction-divider timeline discriminator. |
762
+ | `at` | `number` | When the compaction ran, in milliseconds since the epoch. |
763
+ | `tokensBefore` | `number` | Estimated context tokens the compaction started from. |
764
+ | `tokensAfter` | `number` \| `null` | Estimated context tokens right after it; null for older compactions. |
765
+
766
+ ---
767
+
768
+ ##### Type Literal
769
+
770
+ ```ts
771
+ {
772
+ id: string;
773
+ kind: "compaction_notice";
774
+ at: number;
775
+ trigger: SessionCompactionTrigger;
776
+ result: "failed" | "nothing_to_compact";
777
+ diagnostic: string | null;
778
+ }
779
+ ```
780
+
781
+ | Name | Type | Description |
782
+ | ------------ | ------------------------------------ | ----------------------------------------------------------------- |
783
+ | `id` | `string` | Stable rendered-item identity, from the durable notice entry. |
784
+ | `kind` | `"compaction_notice"` | Compaction-notice timeline discriminator. |
785
+ | `at` | `number` | When it was recorded, in milliseconds since the epoch. |
786
+ | `trigger` | `SessionCompactionTrigger` | What started it: the user, the context threshold, or an overflow. |
787
+ | `result` | `"failed"` \| `"nothing_to_compact"` | What the compaction did: nothing to summarize, or a failure. |
788
+ | `diagnostic` | `string` \| `null` | A failure's bounded reason; null for "nothing to compact". |
789
+
790
+ ---
791
+
792
+ [`ParakeetToolGroupItem`](#parakeettoolgroupitem)
793
+
794
+ ---
795
+
796
+ [`ParakeetUserMessageItem`](#parakeetusermessageitem)
797
+
798
+ ## Variables
799
+
800
+ ### AgentHead
801
+
802
+ ```ts
803
+ const AgentHead: NamedExoticComponent<{
804
+ activity?: AgentHeadActivity;
805
+ avatar?: {
806
+ v: 1;
807
+ character: "mushroom" | "cat" | "burger";
808
+ appearance: z.ZodRecord<
809
+ z.ZodString,
810
+ z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>
811
+ >;
812
+ expression: string;
813
+ renderStyle:
814
+ | "plain"
815
+ | "pencil"
816
+ | "manga"
817
+ | "riso"
818
+ | "halftone"
819
+ | "blueprint"
820
+ | "crt"
821
+ | "watercolor";
822
+ } | null;
823
+ className?: string;
824
+ name: string;
825
+ seed: string;
826
+ size?: number;
827
+ }>;
828
+ ```
829
+
830
+ An Agent's head at avatar size. Renders the Agent's own avatar when given one;
831
+ otherwise the pre-avatar seeded mushroom cap, byte-identical to before avatars
832
+ existed. The letter shows until a frame is ready. It holds still unless
833
+ `thinking` or `speaking`: an idle head whose render style is "plain" and already
834
+ has a cached still frame for its look never mounts a live canvas, so a long rail
835
+ is not a wall of animation. A render style other than "plain" is a CSS filter
836
+ over the live canvas, not part of the captured pixels, so a styled head always
837
+ stays live.
838
+
839
+ ---
840
+
841
+ ### ShiitakeAvatar
842
+
843
+ ```ts
844
+ const ShiitakeAvatar: NamedExoticComponent<{
845
+ avatar?: {
846
+ v: 1;
847
+ character: "mushroom" | "cat" | "burger";
848
+ appearance: z.ZodRecord<
849
+ z.ZodString,
850
+ z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>
851
+ >;
852
+ expression: string;
853
+ renderStyle:
854
+ | "plain"
855
+ | "pencil"
856
+ | "manga"
857
+ | "riso"
858
+ | "halftone"
859
+ | "blueprint"
860
+ | "crt"
861
+ | "watercolor";
862
+ } | null;
863
+ className?: string;
864
+ service?: SpriteService;
865
+ state: AvatarState;
866
+ }>;
867
+ ```
868
+
869
+ Shiitake's sprite head, drawn in the activity and expression it is given. With
870
+ no `avatar`, this is the product mascot, exactly as before avatars existed: no
871
+ seeded colour, the character's own defaults.
872
+
873
+ ---
874
+
875
+ ### initialToolDisclosure
876
+
877
+ ```ts
878
+ const initialToolDisclosure: ToolDisclosureState;
879
+ ```
880
+
881
+ Defaults only, with no reader choices.
882
+
883
+ ## Functions
884
+
885
+ ### InteractionPanel()
886
+
887
+ ```ts
888
+ function InteractionPanel(__namedParameters): Element;
889
+ ```
890
+
891
+ Browser renderer for one Whistle interaction. It draws the same host snapshot
892
+ the terminal draws; the command, not the page, defines the steps.
893
+
894
+ #### Parameters
895
+
896
+ | Parameter | Type |
897
+ | ------------------- | ------------------------------------------------- |
898
+ | `__namedParameters` | [`InteractionPanelProps`](#interactionpanelprops) |
899
+
900
+ #### Returns
901
+
902
+ `Element`
903
+
904
+ ---
905
+
906
+ ### ParakeetProvider()
907
+
908
+ ```ts
909
+ function ParakeetProvider(__namedParameters): Element;
910
+ ```
911
+
912
+ Own one renderer-neutral conversation scope over the existing query cache.
913
+
914
+ #### Parameters
915
+
916
+ | Parameter | Type |
917
+ | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
918
+ | `__namedParameters` | `Readonly`\<\{ `children`: `ReactNode`; `session`: [`ParakeetSession`](#parakeetsession); `clients?`: readonly `ClientEntryV1`[]; `interactionStore?`: [`ParakeetInteractions`](headless.md#parakeetinteractions); `authorOf?`: [`ParakeetAuthorOf`](#parakeetauthorof); \}\> |
919
+
920
+ #### Returns
921
+
922
+ `Element`
923
+
924
+ ---
925
+
926
+ ### useTimeline()
927
+
928
+ ```ts
929
+ function useTimeline(): TimelineController;
930
+ ```
931
+
932
+ Read stable history and replaceable live work.
933
+
934
+ #### Returns
935
+
936
+ [`TimelineController`](#timelinecontroller)
937
+
938
+ ---
939
+
940
+ ### useComposer()
941
+
942
+ ```ts
943
+ function useComposer(): ComposerController;
944
+ ```
945
+
946
+ Read and mutate the current conversation draft and prompt.
947
+
948
+ #### Returns
949
+
950
+ [`ComposerController`](#composercontroller)
951
+
952
+ ---
953
+
954
+ ### useStatus()
955
+
956
+ ```ts
957
+ function useStatus(): StatusController;
958
+ ```
959
+
960
+ Read Session activity and operate its observation.
961
+
962
+ #### Returns
963
+
964
+ [`StatusController`](#statuscontroller)
965
+
966
+ ---
967
+
968
+ ### formatTokenCount()
969
+
970
+ ```ts
971
+ function formatTokenCount(tokens): string;
972
+ ```
973
+
974
+ One token count, compacted for a narrow readout, e.g. `182000` to `182K`. Shared
975
+ by the context footer and the compaction divider and notices.
976
+
977
+ #### Parameters
978
+
979
+ | Parameter | Type |
980
+ | --------- | -------- |
981
+ | `tokens` | `number` |
982
+
983
+ #### Returns
984
+
985
+ `string`
986
+
987
+ ---
988
+
989
+ ### formatContextUsage()
990
+
991
+ ```ts
992
+ function formatContextUsage(context): string;
993
+ ```
994
+
995
+ Context used over the model's window, e.g. `12K/200K`, shared by the browser and
996
+ terminal footers. An unknown window shows the tokens alone.
997
+
998
+ #### Parameters
999
+
1000
+ | Parameter | Type |
1001
+ | --------- | ---------------- |
1002
+ | `context` | `SessionContext` |
1003
+
1004
+ #### Returns
1005
+
1006
+ `string`
1007
+
1008
+ ---
1009
+
1010
+ ### formatModelIdentity()
1011
+
1012
+ ```ts
1013
+ function formatModelIdentity(model): string;
1014
+ ```
1015
+
1016
+ The durable assistant's provider/model ids, shared by browser and terminal.
1017
+
1018
+ #### Parameters
1019
+
1020
+ | Parameter | Type |
1021
+ | --------- | --------------------------------- |
1022
+ | `model` | [`ParakeetModel`](#parakeetmodel) |
1023
+
1024
+ #### Returns
1025
+
1026
+ `string`
1027
+
1028
+ ---
1029
+
1030
+ ### toolGroupDefaultOpen()
1031
+
1032
+ ```ts
1033
+ function toolGroupDefaultOpen(group): boolean;
1034
+ ```
1035
+
1036
+ Active and failed groups show every call; clean history retains a visible tail.
1037
+
1038
+ #### Parameters
1039
+
1040
+ | Parameter | Type |
1041
+ | --------- | ------------------------------------------------- |
1042
+ | `group` | [`ParakeetToolGroupItem`](#parakeettoolgroupitem) |
1043
+
1044
+ #### Returns
1045
+
1046
+ `boolean`
1047
+
1048
+ ---
1049
+
1050
+ ### visibleToolCalls()
1051
+
1052
+ ```ts
1053
+ function visibleToolCalls(
1054
+ group,
1055
+ open,
1056
+ ): readonly Readonly<{
1057
+ id: string;
1058
+ kind: ParakeetToolKind;
1059
+ name: string;
1060
+ verb: string;
1061
+ activeVerb: string;
1062
+ label: string;
1063
+ paths: readonly string[];
1064
+ status: "error" | "unknown" | "completed" | "running";
1065
+ durationMs?: number;
1066
+ exitCode?: number;
1067
+ error?: string;
1068
+ sections: readonly ParakeetToolCallSection[];
1069
+ }>[];
1070
+ ```
1071
+
1072
+ Even a folded group shows recent calls, rather than hiding all tool work.
1073
+
1074
+ #### Parameters
1075
+
1076
+ | Parameter | Type |
1077
+ | --------- | ------------------------------------------------- |
1078
+ | `group` | [`ParakeetToolGroupItem`](#parakeettoolgroupitem) |
1079
+ | `open` | `boolean` |
1080
+
1081
+ #### Returns
1082
+
1083
+ readonly `Readonly`\<\{ `id`: `string`; `kind`:
1084
+ [`ParakeetToolKind`](#parakeettoolkind); `name`: `string`; `verb`: `string`;
1085
+ `activeVerb`: `string`; `label`: `string`; `paths`: readonly `string`[];
1086
+ `status`: `"error"` \| `"unknown"` \| `"completed"` \| `"running"`;
1087
+ `durationMs?`: `number`; `exitCode?`: `number`; `error?`: `string`; `sections`:
1088
+ readonly [`ParakeetToolCallSection`](#parakeettoolcallsection)[]; \}\>[]
1089
+
1090
+ ---
1091
+
1092
+ ### toolCallDefaultOpen()
1093
+
1094
+ ```ts
1095
+ function toolCallDefaultOpen(call): boolean;
1096
+ ```
1097
+
1098
+ A failed call opens by default so its error is visible.
1099
+
1100
+ #### Parameters
1101
+
1102
+ | Parameter | Type |
1103
+ | --------- | ----------------------------------------------- |
1104
+ | `call` | [`ParakeetToolCallView`](#parakeettoolcallview) |
1105
+
1106
+ #### Returns
1107
+
1108
+ `boolean`
1109
+
1110
+ ---
1111
+
1112
+ ### disclosureOpen()
1113
+
1114
+ ```ts
1115
+ function disclosureOpen(state, id, defaultOpen): boolean;
1116
+ ```
1117
+
1118
+ Whether a group or call is currently open.
1119
+
1120
+ #### Parameters
1121
+
1122
+ | Parameter | Type |
1123
+ | ------------- | --------------------------------------------- |
1124
+ | `state` | [`ToolDisclosureState`](#tooldisclosurestate) |
1125
+ | `id` | `string` |
1126
+ | `defaultOpen` | `boolean` |
1127
+
1128
+ #### Returns
1129
+
1130
+ `boolean`
1131
+
1132
+ ---
1133
+
1134
+ ### toggleDisclosure()
1135
+
1136
+ ```ts
1137
+ function toggleDisclosure(state, id, defaultOpen): ToolDisclosureState;
1138
+ ```
1139
+
1140
+ Flip one group or call, recording the reader's explicit choice.
1141
+
1142
+ #### Parameters
1143
+
1144
+ | Parameter | Type |
1145
+ | ------------- | --------------------------------------------- |
1146
+ | `state` | [`ToolDisclosureState`](#tooldisclosurestate) |
1147
+ | `id` | `string` |
1148
+ | `defaultOpen` | `boolean` |
1149
+
1150
+ #### Returns
1151
+
1152
+ [`ToolDisclosureState`](#tooldisclosurestate)
1153
+
1154
+ ---
1155
+
1156
+ ### toggleAllDisclosure()
1157
+
1158
+ ```ts
1159
+ function toggleAllDisclosure(state): ToolDisclosureState;
1160
+ ```
1161
+
1162
+ Expand everything, or collapse everything when the reader has expanded anything.
1163
+ Either way individual choices are cleared.
1164
+
1165
+ #### Parameters
1166
+
1167
+ | Parameter | Type |
1168
+ | --------- | --------------------------------------------- |
1169
+ | `state` | [`ToolDisclosureState`](#tooldisclosurestate) |
1170
+
1171
+ #### Returns
1172
+
1173
+ [`ToolDisclosureState`](#tooldisclosurestate)
1174
+
1175
+ ---
1176
+
1177
+ ### formatToolDuration()
1178
+
1179
+ ```ts
1180
+ function formatToolDuration(milliseconds): string;
1181
+ ```
1182
+
1183
+ Compact duration: `340ms`, `1.2s`, `2m 5s`.
1184
+
1185
+ #### Parameters
1186
+
1187
+ | Parameter | Type |
1188
+ | -------------- | -------- |
1189
+ | `milliseconds` | `number` |
1190
+
1191
+ #### Returns
1192
+
1193
+ `string`
1194
+
1195
+ ---
1196
+
1197
+ ### useMarkdown()
1198
+
1199
+ ```ts
1200
+ function useMarkdown(content): MarkdownDocument;
1201
+ ```
1202
+
1203
+ Parse chat Markdown for headless hosts, including terminal presentation.
1204
+
1205
+ #### Parameters
1206
+
1207
+ | Parameter | Type |
1208
+ | --------- | -------- |
1209
+ | `content` | `string` |
1210
+
1211
+ #### Returns
1212
+
1213
+ `MarkdownDocument`
1214
+
1215
+ ---
1216
+
1217
+ ### ParakeetView()
1218
+
1219
+ ```ts
1220
+ function ParakeetView(__namedParameters): ReactElement;
1221
+ ```
1222
+
1223
+ Render the retained conversation surface within one Parakeet provider.
1224
+
1225
+ #### Parameters
1226
+
1227
+ | Parameter | Type |
1228
+ | ------------------- | ----------------------------------------- |
1229
+ | `__namedParameters` | [`ParakeetViewProps`](#parakeetviewprops) |
1230
+
1231
+ #### Returns
1232
+
1233
+ `ReactElement`
1234
+
1235
+ ---
1236
+
1237
+ ### Parakeet()
1238
+
1239
+ ```ts
1240
+ function Parakeet(__namedParameters): ReactElement;
1241
+ ```
1242
+
1243
+ Standalone typed composer and exact-message timeline.
1244
+
1245
+ #### Parameters
1246
+
1247
+ | Parameter | Type |
1248
+ | ------------------- | --------------------------------- |
1249
+ | `__namedParameters` | [`ParakeetProps`](#parakeetprops) |
1250
+
1251
+ #### Returns
1252
+
1253
+ `ReactElement`