@fungi.computer/parakeet 0.0.0-stage → 0.1.0

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 (115) 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 +12 -0
  18. package/dist/commands/run.js +64 -0
  19. package/dist/commands/slash.d.ts +126 -0
  20. package/dist/commands/slash.js +190 -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 +22 -0
  24. package/dist/components/AgentHead.js +20 -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 +21 -0
  40. package/dist/components/ShiitakeAvatar.js +22 -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 +16 -0
  52. package/dist/components/avatar-presentation.js +9 -0
  53. package/dist/components/sprite-service.d.ts +2 -0
  54. package/dist/components/sprite-service.js +9 -0
  55. package/dist/conversation.d.ts +165 -0
  56. package/dist/conversation.js +762 -0
  57. package/dist/core/assistant-visibility.d.ts +3 -0
  58. package/dist/core/assistant-visibility.js +4 -0
  59. package/dist/core/author-labels.d.ts +16 -0
  60. package/dist/core/author-labels.js +16 -0
  61. package/dist/core/build-timeline.d.ts +36 -0
  62. package/dist/core/build-timeline.js +328 -0
  63. package/dist/core/client-actions.d.ts +35 -0
  64. package/dist/core/client-actions.js +128 -0
  65. package/dist/core/client-contributions.d.ts +24 -0
  66. package/dist/core/client-contributions.js +115 -0
  67. package/dist/core/client-timeline.d.ts +33 -0
  68. package/dist/core/client-timeline.js +72 -0
  69. package/dist/core/format-context.d.ts +11 -0
  70. package/dist/core/format-context.js +20 -0
  71. package/dist/core/format-tokens.d.ts +2 -0
  72. package/dist/core/format-tokens.js +6 -0
  73. package/dist/core/model-identity.d.ts +3 -0
  74. package/dist/core/model-identity.js +7 -0
  75. package/dist/core/session-projection.d.ts +11 -0
  76. package/dist/core/session-projection.js +191 -0
  77. package/dist/core/session-query.d.ts +118 -0
  78. package/dist/core/session-query.js +187 -0
  79. package/dist/core/session-view-state.d.ts +66 -0
  80. package/dist/core/session-view-state.js +114 -0
  81. package/dist/core/tool-contract.d.ts +15 -0
  82. package/dist/core/tool-contract.js +3 -0
  83. package/dist/core/tool-groups.d.ts +36 -0
  84. package/dist/core/tool-groups.js +151 -0
  85. package/dist/core/tool-view.d.ts +182 -0
  86. package/dist/core/tool-view.js +618 -0
  87. package/dist/headless.d.ts +28 -0
  88. package/dist/headless.js +24 -0
  89. package/dist/index.d.ts +9 -0
  90. package/dist/index.js +4 -0
  91. package/dist/lib/failure.d.ts +2 -0
  92. package/dist/lib/failure.js +9 -0
  93. package/dist/markdown.d.ts +3 -0
  94. package/dist/markdown.js +6 -0
  95. package/dist/model-commands.d.ts +44 -0
  96. package/dist/model-commands.js +232 -0
  97. package/dist/parakeet.d.ts +77 -0
  98. package/dist/parakeet.js +276 -0
  99. package/dist/provider-choices.d.ts +8 -0
  100. package/dist/provider-choices.js +46 -0
  101. package/dist/reload-command.d.ts +43 -0
  102. package/dist/reload-command.js +72 -0
  103. package/dist/session-commands.d.ts +53 -0
  104. package/dist/session-commands.js +259 -0
  105. package/dist/session.d.ts +24 -0
  106. package/dist/session.js +1 -0
  107. package/dist/store/types.d.ts +163 -0
  108. package/dist/store/types.js +1 -0
  109. package/dist/styles.css +19129 -0
  110. package/docs/api/README.md +15 -0
  111. package/docs/api/commands/slash.md +321 -0
  112. package/docs/api/headless.md +2510 -0
  113. package/docs/api/index.md +1249 -0
  114. package/package.json +79 -3
  115. package/src/styles.css +272 -0
@@ -0,0 +1,1249 @@
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 live 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
+ };
823
+ className?: string;
824
+ name: string;
825
+ size?: number;
826
+ }>;
827
+ ```
828
+
829
+ An Agent's head at avatar size, drawn from the Agent's own avatar (a property of
830
+ the Agent record, never of a conversation). The letter shows until a frame is
831
+ ready. The live canvas stays mounted and is paused unless `thinking` or
832
+ `speaking`, so an idle head shows its real look without animating.
833
+
834
+ ---
835
+
836
+ ### ShiitakeAvatar
837
+
838
+ ```ts
839
+ const ShiitakeAvatar: NamedExoticComponent<{
840
+ avatar?: {
841
+ v: 1;
842
+ character: "mushroom" | "cat" | "burger";
843
+ appearance: z.ZodRecord<
844
+ z.ZodString,
845
+ z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>
846
+ >;
847
+ expression: string;
848
+ renderStyle:
849
+ | "plain"
850
+ | "pencil"
851
+ | "manga"
852
+ | "riso"
853
+ | "halftone"
854
+ | "blueprint"
855
+ | "crt"
856
+ | "watercolor";
857
+ } | null;
858
+ className?: string;
859
+ service?: SpriteService;
860
+ state: AvatarState;
861
+ }>;
862
+ ```
863
+
864
+ A sprite head drawn in the live activity and expression it is given. With an
865
+ `avatar` it draws that look (a member's own, in their settings); with none it is
866
+ Shiitake, the product mascot, in the character's own defaults. Conversations
867
+ have no avatar: an Agent's head is `AgentHead`, drawn from the Agent record.
868
+
869
+ ---
870
+
871
+ ### initialToolDisclosure
872
+
873
+ ```ts
874
+ const initialToolDisclosure: ToolDisclosureState;
875
+ ```
876
+
877
+ Defaults only, with no reader choices.
878
+
879
+ ## Functions
880
+
881
+ ### InteractionPanel()
882
+
883
+ ```ts
884
+ function InteractionPanel(__namedParameters): Element;
885
+ ```
886
+
887
+ Browser renderer for one Whistle interaction. It draws the same host snapshot
888
+ the terminal draws; the command, not the page, defines the steps.
889
+
890
+ #### Parameters
891
+
892
+ | Parameter | Type |
893
+ | ------------------- | ------------------------------------------------- |
894
+ | `__namedParameters` | [`InteractionPanelProps`](#interactionpanelprops) |
895
+
896
+ #### Returns
897
+
898
+ `Element`
899
+
900
+ ---
901
+
902
+ ### ParakeetProvider()
903
+
904
+ ```ts
905
+ function ParakeetProvider(__namedParameters): Element;
906
+ ```
907
+
908
+ Own one renderer-neutral conversation scope over the existing query cache.
909
+
910
+ #### Parameters
911
+
912
+ | Parameter | Type |
913
+ | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
914
+ | `__namedParameters` | `Readonly`\<\{ `children`: `ReactNode`; `session`: [`ParakeetSession`](#parakeetsession); `clients?`: readonly `ClientEntryV1`[]; `interactionStore?`: [`ParakeetInteractions`](headless.md#parakeetinteractions); `authorOf?`: [`ParakeetAuthorOf`](#parakeetauthorof); \}\> |
915
+
916
+ #### Returns
917
+
918
+ `Element`
919
+
920
+ ---
921
+
922
+ ### useTimeline()
923
+
924
+ ```ts
925
+ function useTimeline(): TimelineController;
926
+ ```
927
+
928
+ Read stable history and replaceable live work.
929
+
930
+ #### Returns
931
+
932
+ [`TimelineController`](#timelinecontroller)
933
+
934
+ ---
935
+
936
+ ### useComposer()
937
+
938
+ ```ts
939
+ function useComposer(): ComposerController;
940
+ ```
941
+
942
+ Read and mutate the current conversation draft and prompt.
943
+
944
+ #### Returns
945
+
946
+ [`ComposerController`](#composercontroller)
947
+
948
+ ---
949
+
950
+ ### useStatus()
951
+
952
+ ```ts
953
+ function useStatus(): StatusController;
954
+ ```
955
+
956
+ Read Session activity and operate its observation.
957
+
958
+ #### Returns
959
+
960
+ [`StatusController`](#statuscontroller)
961
+
962
+ ---
963
+
964
+ ### formatTokenCount()
965
+
966
+ ```ts
967
+ function formatTokenCount(tokens): string;
968
+ ```
969
+
970
+ One token count, compacted for a narrow readout, e.g. `182000` to `182K`. Shared
971
+ by the context footer and the compaction divider and notices.
972
+
973
+ #### Parameters
974
+
975
+ | Parameter | Type |
976
+ | --------- | -------- |
977
+ | `tokens` | `number` |
978
+
979
+ #### Returns
980
+
981
+ `string`
982
+
983
+ ---
984
+
985
+ ### formatContextUsage()
986
+
987
+ ```ts
988
+ function formatContextUsage(context): string;
989
+ ```
990
+
991
+ Context used over the model's window, e.g. `12K/200K`, shared by the browser and
992
+ terminal footers. An unknown window shows the tokens alone.
993
+
994
+ #### Parameters
995
+
996
+ | Parameter | Type |
997
+ | --------- | ---------------- |
998
+ | `context` | `SessionContext` |
999
+
1000
+ #### Returns
1001
+
1002
+ `string`
1003
+
1004
+ ---
1005
+
1006
+ ### formatModelIdentity()
1007
+
1008
+ ```ts
1009
+ function formatModelIdentity(model): string;
1010
+ ```
1011
+
1012
+ The durable assistant's provider/model ids, shared by browser and terminal.
1013
+
1014
+ #### Parameters
1015
+
1016
+ | Parameter | Type |
1017
+ | --------- | --------------------------------- |
1018
+ | `model` | [`ParakeetModel`](#parakeetmodel) |
1019
+
1020
+ #### Returns
1021
+
1022
+ `string`
1023
+
1024
+ ---
1025
+
1026
+ ### toolGroupDefaultOpen()
1027
+
1028
+ ```ts
1029
+ function toolGroupDefaultOpen(group): boolean;
1030
+ ```
1031
+
1032
+ Active and failed groups show every call; clean history retains a visible tail.
1033
+
1034
+ #### Parameters
1035
+
1036
+ | Parameter | Type |
1037
+ | --------- | ------------------------------------------------- |
1038
+ | `group` | [`ParakeetToolGroupItem`](#parakeettoolgroupitem) |
1039
+
1040
+ #### Returns
1041
+
1042
+ `boolean`
1043
+
1044
+ ---
1045
+
1046
+ ### visibleToolCalls()
1047
+
1048
+ ```ts
1049
+ function visibleToolCalls(
1050
+ group,
1051
+ open,
1052
+ ): readonly Readonly<{
1053
+ id: string;
1054
+ kind: ParakeetToolKind;
1055
+ name: string;
1056
+ verb: string;
1057
+ activeVerb: string;
1058
+ label: string;
1059
+ paths: readonly string[];
1060
+ status: "error" | "unknown" | "completed" | "running";
1061
+ durationMs?: number;
1062
+ exitCode?: number;
1063
+ error?: string;
1064
+ sections: readonly ParakeetToolCallSection[];
1065
+ }>[];
1066
+ ```
1067
+
1068
+ Even a folded group shows recent calls, rather than hiding all tool work.
1069
+
1070
+ #### Parameters
1071
+
1072
+ | Parameter | Type |
1073
+ | --------- | ------------------------------------------------- |
1074
+ | `group` | [`ParakeetToolGroupItem`](#parakeettoolgroupitem) |
1075
+ | `open` | `boolean` |
1076
+
1077
+ #### Returns
1078
+
1079
+ readonly `Readonly`\<\{ `id`: `string`; `kind`:
1080
+ [`ParakeetToolKind`](#parakeettoolkind); `name`: `string`; `verb`: `string`;
1081
+ `activeVerb`: `string`; `label`: `string`; `paths`: readonly `string`[];
1082
+ `status`: `"error"` \| `"unknown"` \| `"completed"` \| `"running"`;
1083
+ `durationMs?`: `number`; `exitCode?`: `number`; `error?`: `string`; `sections`:
1084
+ readonly [`ParakeetToolCallSection`](#parakeettoolcallsection)[]; \}\>[]
1085
+
1086
+ ---
1087
+
1088
+ ### toolCallDefaultOpen()
1089
+
1090
+ ```ts
1091
+ function toolCallDefaultOpen(call): boolean;
1092
+ ```
1093
+
1094
+ A failed call opens by default so its error is visible.
1095
+
1096
+ #### Parameters
1097
+
1098
+ | Parameter | Type |
1099
+ | --------- | ----------------------------------------------- |
1100
+ | `call` | [`ParakeetToolCallView`](#parakeettoolcallview) |
1101
+
1102
+ #### Returns
1103
+
1104
+ `boolean`
1105
+
1106
+ ---
1107
+
1108
+ ### disclosureOpen()
1109
+
1110
+ ```ts
1111
+ function disclosureOpen(state, id, defaultOpen): boolean;
1112
+ ```
1113
+
1114
+ Whether a group or call is currently open.
1115
+
1116
+ #### Parameters
1117
+
1118
+ | Parameter | Type |
1119
+ | ------------- | --------------------------------------------- |
1120
+ | `state` | [`ToolDisclosureState`](#tooldisclosurestate) |
1121
+ | `id` | `string` |
1122
+ | `defaultOpen` | `boolean` |
1123
+
1124
+ #### Returns
1125
+
1126
+ `boolean`
1127
+
1128
+ ---
1129
+
1130
+ ### toggleDisclosure()
1131
+
1132
+ ```ts
1133
+ function toggleDisclosure(state, id, defaultOpen): ToolDisclosureState;
1134
+ ```
1135
+
1136
+ Flip one group or call, recording the reader's explicit choice.
1137
+
1138
+ #### Parameters
1139
+
1140
+ | Parameter | Type |
1141
+ | ------------- | --------------------------------------------- |
1142
+ | `state` | [`ToolDisclosureState`](#tooldisclosurestate) |
1143
+ | `id` | `string` |
1144
+ | `defaultOpen` | `boolean` |
1145
+
1146
+ #### Returns
1147
+
1148
+ [`ToolDisclosureState`](#tooldisclosurestate)
1149
+
1150
+ ---
1151
+
1152
+ ### toggleAllDisclosure()
1153
+
1154
+ ```ts
1155
+ function toggleAllDisclosure(state): ToolDisclosureState;
1156
+ ```
1157
+
1158
+ Expand everything, or collapse everything when the reader has expanded anything.
1159
+ Either way individual choices are cleared.
1160
+
1161
+ #### Parameters
1162
+
1163
+ | Parameter | Type |
1164
+ | --------- | --------------------------------------------- |
1165
+ | `state` | [`ToolDisclosureState`](#tooldisclosurestate) |
1166
+
1167
+ #### Returns
1168
+
1169
+ [`ToolDisclosureState`](#tooldisclosurestate)
1170
+
1171
+ ---
1172
+
1173
+ ### formatToolDuration()
1174
+
1175
+ ```ts
1176
+ function formatToolDuration(milliseconds): string;
1177
+ ```
1178
+
1179
+ Compact duration: `340ms`, `1.2s`, `2m 5s`.
1180
+
1181
+ #### Parameters
1182
+
1183
+ | Parameter | Type |
1184
+ | -------------- | -------- |
1185
+ | `milliseconds` | `number` |
1186
+
1187
+ #### Returns
1188
+
1189
+ `string`
1190
+
1191
+ ---
1192
+
1193
+ ### useMarkdown()
1194
+
1195
+ ```ts
1196
+ function useMarkdown(content): MarkdownDocument;
1197
+ ```
1198
+
1199
+ Parse chat Markdown for headless hosts, including terminal presentation.
1200
+
1201
+ #### Parameters
1202
+
1203
+ | Parameter | Type |
1204
+ | --------- | -------- |
1205
+ | `content` | `string` |
1206
+
1207
+ #### Returns
1208
+
1209
+ `MarkdownDocument`
1210
+
1211
+ ---
1212
+
1213
+ ### ParakeetView()
1214
+
1215
+ ```ts
1216
+ function ParakeetView(__namedParameters): ReactElement;
1217
+ ```
1218
+
1219
+ Render the retained conversation surface within one Parakeet provider.
1220
+
1221
+ #### Parameters
1222
+
1223
+ | Parameter | Type |
1224
+ | ------------------- | ----------------------------------------- |
1225
+ | `__namedParameters` | [`ParakeetViewProps`](#parakeetviewprops) |
1226
+
1227
+ #### Returns
1228
+
1229
+ `ReactElement`
1230
+
1231
+ ---
1232
+
1233
+ ### Parakeet()
1234
+
1235
+ ```ts
1236
+ function Parakeet(__namedParameters): ReactElement;
1237
+ ```
1238
+
1239
+ Standalone typed composer and exact-message timeline.
1240
+
1241
+ #### Parameters
1242
+
1243
+ | Parameter | Type |
1244
+ | ------------------- | --------------------------------- |
1245
+ | `__namedParameters` | [`ParakeetProps`](#parakeetprops) |
1246
+
1247
+ #### Returns
1248
+
1249
+ `ReactElement`