@fungi.computer/parakeet 0.0.1 → 0.2.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 (71) hide show
  1. package/README.md +45 -6
  2. package/dist/account-commands.js +3 -11
  3. package/dist/commands/advertised.d.ts +3 -1
  4. package/dist/commands/advertised.js +89 -4
  5. package/dist/commands/builtins.js +1 -1
  6. package/dist/commands/interactions.d.ts +22 -7
  7. package/dist/commands/interactions.js +41 -17
  8. package/dist/commands/run.d.ts +3 -2
  9. package/dist/commands/run.js +5 -2
  10. package/dist/commands/slash.d.ts +2 -0
  11. package/dist/commands/slash.js +13 -7
  12. package/dist/commands/use-slash-commands.js +4 -4
  13. package/dist/components/AgentHead.d.ts +9 -12
  14. package/dist/components/AgentHead.js +12 -44
  15. package/dist/components/ChatComposer.d.ts +3 -1
  16. package/dist/components/ChatComposer.js +79 -15
  17. package/dist/components/ChatMessage.d.ts +4 -0
  18. package/dist/components/ChatMessage.js +6 -2
  19. package/dist/components/ClientRows.js +2 -2
  20. package/dist/components/InteractionPanel.d.ts +2 -4
  21. package/dist/components/InteractionPanel.js +2 -2
  22. package/dist/components/ShiitakeAvatar.d.ts +7 -5
  23. package/dist/components/ShiitakeAvatar.js +6 -4
  24. package/dist/components/TimelineItem.d.ts +2 -0
  25. package/dist/components/TimelineItem.js +31 -7
  26. package/dist/components/avatar-presentation.d.ts +7 -14
  27. package/dist/components/avatar-presentation.js +6 -13
  28. package/dist/conversation-opening.d.ts +47 -0
  29. package/dist/conversation-opening.js +173 -0
  30. package/dist/conversation.d.ts +50 -5
  31. package/dist/conversation.js +587 -87
  32. package/dist/core/author-labels.d.ts +2 -0
  33. package/dist/core/build-timeline.d.ts +4 -2
  34. package/dist/core/build-timeline.js +46 -7
  35. package/dist/core/client-actions.js +6 -3
  36. package/dist/core/client-timeline.d.ts +9 -2
  37. package/dist/core/client-timeline.js +15 -4
  38. package/dist/core/draft-storage.d.ts +63 -0
  39. package/dist/core/draft-storage.js +50 -0
  40. package/dist/core/model-identity.d.ts +2 -0
  41. package/dist/core/model-identity.js +6 -0
  42. package/dist/core/queued-recall.d.ts +35 -0
  43. package/dist/core/queued-recall.js +138 -0
  44. package/dist/core/session-projection.js +17 -0
  45. package/dist/core/session-query.d.ts +54 -11
  46. package/dist/core/session-query.js +38 -12
  47. package/dist/core/tool-groups.d.ts +1 -1
  48. package/dist/core/tool-groups.js +3 -1
  49. package/dist/core/tool-view.d.ts +1 -1
  50. package/dist/core/tool-view.js +3 -2
  51. package/dist/core/use-timeline-item-key.d.ts +8 -0
  52. package/dist/core/use-timeline-item-key.js +29 -0
  53. package/dist/headless.d.ts +6 -4
  54. package/dist/headless.js +1 -1
  55. package/dist/index.d.ts +2 -2
  56. package/dist/index.js +1 -1
  57. package/dist/model-commands.js +65 -40
  58. package/dist/parakeet.js +17 -18
  59. package/dist/provider-choices.js +10 -7
  60. package/dist/session-commands.d.ts +0 -9
  61. package/dist/session-commands.js +39 -68
  62. package/dist/session.d.ts +1 -1
  63. package/dist/store/types.d.ts +10 -4
  64. package/dist/styles.css +105 -117
  65. package/docs/api/commands/slash.md +24 -21
  66. package/docs/api/headless.md +375 -232
  67. package/docs/api/index.md +168 -60
  68. package/package.json +16 -10
  69. package/src/styles.css +4 -9
  70. package/dist/components/still-frame-cache.d.ts +0 -16
  71. package/dist/components/still-frame-cache.js +0 -63
package/docs/api/index.md CHANGED
@@ -26,11 +26,10 @@ What the head is doing: at rest, working something out, or talking.
26
26
  type InteractionPanelProps = Readonly<{
27
27
  host: WhistleInteractionHost;
28
28
  onClose?: () => void;
29
- onRetry?: () => void;
30
29
  }>;
31
30
  ```
32
31
 
33
- The interaction to draw and the page's close and retry callbacks.
32
+ The interaction to draw and the page's close callback.
34
33
 
35
34
  ---
36
35
 
@@ -42,7 +41,7 @@ type AvatarState = Readonly<
42
41
  >;
43
42
  ```
44
43
 
45
- The current activity and expression supplied to a composer avatar.
44
+ The current activity and expression supplied to a live avatar.
46
45
 
47
46
  ---
48
47
 
@@ -96,8 +95,11 @@ Conversation activity presented by Parakeet.
96
95
 
97
96
  ```ts
98
97
  type TimelineController = Readonly<{
98
+ cancelQueued: (commandId) => Promise<void>;
99
+ cancellingQueued: boolean;
99
100
  settled: readonly ParakeetTimelineItem[];
100
101
  tail: readonly ParakeetTimelineItem[];
102
+ positionAnchors: ReadonlyMap<number, string | null>;
101
103
  commandAnchors: ReadonlyMap<string, string>;
102
104
  queued: SessionPendingPrompts;
103
105
  pendingHasMore: boolean;
@@ -117,12 +119,33 @@ Stable history and replaceable work rendered by a conversation client.
117
119
 
118
120
  ---
119
121
 
122
+ ### ParakeetDraftCheckpoint
123
+
124
+ ```ts
125
+ type ParakeetDraftCheckpoint =
126
+ | Readonly<{
127
+ status: "saved";
128
+ }>
129
+ | Readonly<{
130
+ status: "failed";
131
+ reason: string;
132
+ }>;
133
+ ```
134
+
135
+ A host may proceed with restart only after the current journal committed.
136
+
137
+ ---
138
+
120
139
  ### ComposerController
121
140
 
122
141
  ```ts
123
142
  type ComposerController = Readonly<{
124
143
  cancel: () => Promise<void>;
125
144
  draft: string;
145
+ images: PromptCommand["images"];
146
+ recallState: QueuedRecallState;
147
+ recall: () => Promise<QueuedRecallOutcome>;
148
+ checkpointDraft: () => ParakeetDraftCheckpoint;
126
149
  failure: "admission" | "failed" | "cancelled" | "interrupted" | undefined;
127
150
  admissionError: "queue_full" | undefined;
128
151
  retry: () => void;
@@ -160,6 +183,7 @@ Session activity, observation, and Agent-lifetime controls.
160
183
  type ParakeetAuthor = Readonly<{
161
184
  id: string;
162
185
  name: string;
186
+ kind?: "agent";
163
187
  }>;
164
188
  ```
165
189
 
@@ -188,6 +212,60 @@ Parakeet never interprets metadata itself.
188
212
 
189
213
  ---
190
214
 
215
+ ### ParakeetDraftIdentity
216
+
217
+ ```ts
218
+ type ParakeetDraftIdentity = Readonly<{
219
+ agentId: string;
220
+ sessionId: string;
221
+ }>;
222
+ ```
223
+
224
+ Durable owner identity, independent of the current service endpoint.
225
+
226
+ ---
227
+
228
+ ### ParakeetDraftStorage
229
+
230
+ ```ts
231
+ type ParakeetDraftStorage = Readonly<{
232
+ getItem: (key) => string | null;
233
+ setItem: (key, value) => void;
234
+ }>;
235
+ ```
236
+
237
+ Hosts must commit a replacement before returning, or throw without changing it.
238
+
239
+ ---
240
+
241
+ ### QueuedRecallState
242
+
243
+ ```ts
244
+ type QueuedRecallState =
245
+ | Readonly<{
246
+ kind: "idle" | "recalling" | "restored";
247
+ }>
248
+ | Readonly<{
249
+ kind: "too_late" | "uncertain";
250
+ message: string;
251
+ }>;
252
+ ```
253
+
254
+ Ephemeral composer reservation, never an admission journal or queue.
255
+
256
+ ---
257
+
258
+ ### QueuedRecallOutcome
259
+
260
+ ```ts
261
+ type QueuedRecallOutcome =
262
+ "ignored" | "empty" | "restored" | "too_late" | "uncertain";
263
+ ```
264
+
265
+ Result of one recall gesture; an empty queue permits local input history.
266
+
267
+ ---
268
+
191
269
  ### ParakeetToolArguments
192
270
 
193
271
  ```ts
@@ -481,15 +559,18 @@ type ParakeetSessionCommand = {
481
559
  status: "accepted";
482
560
  commandId: string;
483
561
  }>
562
+ | Readonly<{
563
+ status: "recorded";
564
+ }>
484
565
  | Readonly<{
485
566
  status: "too_late";
486
567
  commandId: string;
487
568
  }>
488
569
  | Readonly<{
489
- sessionId: string;
570
+ status: "unknown";
490
571
  }>
491
572
  | Readonly<{
492
- status: "recorded";
573
+ sessionId: string;
493
574
  }>
494
575
  | undefined
495
576
  >;
@@ -508,9 +589,9 @@ Admit Agent work or record a prompt held for a human reply.
508
589
 
509
590
  ##### Parameters
510
591
 
511
- | Parameter | Type |
512
- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
513
- | `input` | \| \{ `delivery`: `"followUp"` \| `"steer"`; `requestId`: `string`; `type`: `"prompt"`; `text`: `string`; `images?`: readonly `object`[]; \} \| \{ `type`: `"compact"`; `requestId`: `string`; `instructions?`: `string`; \} |
592
+ | Parameter | Type |
593
+ | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
594
+ | `input` | \| \{ `delivery`: `Schema.Literals`\<readonly \[`"steer"`, `"followUp"`\]\>; `requestId`: `Schema.String`; `type`: `Schema.Literal`\<`"prompt"`\>; `text`: `Schema.String`; `images?`: `Schema.optionalKey`\<`Schema.$Array`\<`Schema.Struct`\<\{ `type`: `Schema.Literal`\<`"image"`\>; `data`: `Schema.String`; `mimeType`: `Schema.String`; \}\>\>\>; \} \| \{ `type`: `Schema.Literal`\<`"compact"`\>; `requestId`: `Schema.String`; `instructions?`: `Schema.optionalKey`\<`Schema.String`\>; \} |
514
595
 
515
596
  ##### Returns
516
597
 
@@ -526,12 +607,12 @@ Cancel the named queued or running command.
526
607
 
527
608
  ##### Parameters
528
609
 
529
- | Parameter | Type |
530
- | ---------------------- | ----------------------------------------------------------------------------- |
531
- | `input` | \{ `commandId`: `string`; `onlyIfPending?`: `boolean`; `type`: `"cancel"`; \} |
532
- | `input.commandId` | `string` |
533
- | `input.onlyIfPending?` | `boolean` |
534
- | `input.type` | `"cancel"` |
610
+ | Parameter | Type |
611
+ | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
612
+ | `input` | \{ `commandId`: `Schema.String`; `onlyIfPending?`: `Schema.optional`\<`Schema.Boolean`\>; `type`: `Schema.Literal`\<`"cancel"`\>; \} |
613
+ | `input.commandId` | `Schema.String` |
614
+ | `input.onlyIfPending?` | `Schema.optional`\<`Schema.Boolean`\> |
615
+ | `input.type` | `Schema.Literal`\<`"cancel"`\> |
535
616
 
536
617
  ##### Returns
537
618
 
@@ -547,9 +628,9 @@ Forward an owner-supported Session control command.
547
628
 
548
629
  ##### Parameters
549
630
 
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`; \} |
631
+ | Parameter | Type |
632
+ | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
633
+ | `input` | \| \{ `type`: `Schema.Literal`\<`"branch"`\>; `entryId`: `Schema.String`; \} \| \{ `type`: `Schema.Literal`\<`"operator"`\>; `requestId`: `Schema.String`; `author`: `Schema.Literals`\<readonly \[`"operator"`, `"party"`\]\>; `text`: `Schema.String`; \} \| \{ `type`: `Schema.Literal`\<`"title"`\>; `title`: `Schema.NullOr`\<`Schema.String`\>; \} \| \{ `type`: `Schema.Literal`\<`"abort"`\>; \} |
553
634
 
554
635
  ##### Returns
555
636
 
@@ -567,11 +648,11 @@ Return the owner-issued address of a forked Session.
567
648
 
568
649
  ##### Parameters
569
650
 
570
- | Parameter | Type |
571
- | --------------- | -------------------------------------------- |
572
- | `input` | \{ `type`: `"fork"`; `entryId`: `string`; \} |
573
- | `input.type` | `"fork"` |
574
- | `input.entryId` | `string` |
651
+ | Parameter | Type |
652
+ | --------------- | ----------------------------------------------------------------------- |
653
+ | `input` | \{ `type`: `Schema.Literal`\<`"fork"`\>; `entryId`: `Schema.String`; \} |
654
+ | `input.type` | `Schema.Literal`\<`"fork"`\> |
655
+ | `input.entryId` | `Schema.String` |
575
656
 
576
657
  ##### Returns
577
658
 
@@ -584,16 +665,19 @@ Return the owner-issued address of a forked Session.
584
665
  | Readonly<{
585
666
  status: "accepted";
586
667
  commandId: string;
668
+ }>
669
+ | Readonly<{
670
+ status: "recorded";
587
671
  }>
588
672
  | Readonly<{
589
673
  status: "too_late";
590
674
  commandId: string;
591
675
  }>
592
676
  | Readonly<{
593
- sessionId: string;
677
+ status: "unknown";
594
678
  }>
595
679
  | Readonly<{
596
- status: "recorded";
680
+ sessionId: string;
597
681
  }>
598
682
  | undefined>;
599
683
  ```
@@ -602,16 +686,16 @@ Dispatch a typed command without inventing an admission result.
602
686
 
603
687
  ##### Parameters
604
688
 
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`; \} |
689
+ | Parameter | Type |
690
+ | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
691
+ | `input` | \| \{ `delivery`: `Schema.Literals`\<readonly \[`"steer"`, `"followUp"`\]\>; `requestId`: `Schema.String`; `type`: `Schema.Literal`\<`"prompt"`\>; `text`: `Schema.String`; `images?`: `Schema.optionalKey`\<`Schema.$Array`\<`Schema.Struct`\<\{ `type`: `Schema.Literal`\<`"image"`\>; `data`: `Schema.String`; `mimeType`: `Schema.String`; \}\>\>\>; \} \| \{ `type`: `Schema.Literal`\<`"abort"`\>; \} \| \{ `commandId`: `Schema.String`; `onlyIfPending?`: `Schema.optional`\<`Schema.Boolean`\>; `type`: `Schema.Literal`\<`"cancel"`\>; \} \| \{ `type`: `Schema.Literal`\<`"branch"`\>; `entryId`: `Schema.String`; \} \| \{ `type`: `Schema.Literal`\<`"fork"`\>; `entryId`: `Schema.String`; \} \| \{ `type`: `Schema.Literal`\<`"operator"`\>; `requestId`: `Schema.String`; `author`: `Schema.Literals`\<readonly \[`"operator"`, `"party"`\]\>; `text`: `Schema.String`; \} \| \{ `type`: `Schema.Literal`\<`"compact"`\>; `requestId`: `Schema.String`; `instructions?`: `Schema.optionalKey`\<`Schema.String`\>; \} \| \{ `type`: `Schema.Literal`\<`"title"`\>; `title`: `Schema.NullOr`\<`Schema.String`\>; \} |
608
692
 
609
693
  ##### Returns
610
694
 
611
695
  `Promise`\< \| `Readonly`\<\{ `status`: `"accepted"`; `commandId`: `string`;
612
- \}\> \| `Readonly`\<\{ `status`: `"too_late"`; `commandId`: `string`; \}\> \|
613
- `Readonly`\<\{ `sessionId`: `string`; \}\> \| `Readonly`\<\{ `status`:
614
- `"recorded"`; \}\> \| `undefined`\>
696
+ \}\> \| `Readonly`\<\{ `status`: `"recorded"`; \}\> \| `Readonly`\<\{ `status`:
697
+ `"too_late"`; `commandId`: `string`; \}\> \| `Readonly`\<\{ `status`:
698
+ `"unknown"`; \}\> \| `Readonly`\<\{ `sessionId`: `string`; \}\> \| `undefined`\>
615
699
 
616
700
  ---
617
701
 
@@ -619,7 +703,11 @@ Dispatch a typed command without inventing an admission result.
619
703
 
620
704
  ```ts
621
705
  type ParakeetSession = Readonly<
622
- Pick<ShiitakeSession, "address" | "extension" | "read" | "watch"> & object
706
+ Pick<
707
+ ShiitakeSession,
708
+ "address" | "extension" | "read" | "watch" | "withdraw" | "latestPending"
709
+ > &
710
+ object
623
711
  >;
624
712
  ```
625
713
 
@@ -681,6 +769,7 @@ type ParakeetToolItem = Readonly<{
681
769
  kind: "tool";
682
770
  name: string;
683
771
  result?: ToolResultMessage;
772
+ data?: SessionMessage["data"];
684
773
  startedAt?: number;
685
774
  status: "completed" | "error" | "running" | "unknown";
686
775
  }>;
@@ -728,7 +817,7 @@ type ParakeetTimelineItem =
728
817
  kind: "compaction_notice";
729
818
  at: number;
730
819
  trigger: SessionCompactionTrigger;
731
- result: "failed" | "nothing_to_compact";
820
+ result: "failed" | "nothing_to_compact" | "stale" | "insufficient";
732
821
  diagnostic: string | null;
733
822
  }
734
823
  | ParakeetToolGroupItem
@@ -773,19 +862,19 @@ Stable row grammar rendered by Parakeet's timeline.
773
862
  kind: "compaction_notice";
774
863
  at: number;
775
864
  trigger: SessionCompactionTrigger;
776
- result: "failed" | "nothing_to_compact";
865
+ result: "failed" | "nothing_to_compact" | "stale" | "insufficient";
777
866
  diagnostic: string | null;
778
867
  }
779
868
  ```
780
869
 
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". |
870
+ | Name | Type | Description |
871
+ | ------------ | --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
872
+ | `id` | `string` | Stable rendered-item identity, from the durable notice entry. |
873
+ | `kind` | `"compaction_notice"` | Compaction-notice timeline discriminator. |
874
+ | `at` | `number` | When it was recorded, in milliseconds since the epoch. |
875
+ | `trigger` | `SessionCompactionTrigger` | What started it: the user, the context threshold, or an overflow. |
876
+ | `result` | `"failed"` \| `"nothing_to_compact"` \| `"stale"` \| `"insufficient"` | What the compaction did: nothing to summarize, a failure, or a summary dropped because its head no longer fit the context (stale) or because placing it would have left the context over the limit (insufficient). |
877
+ | `diagnostic` | `string` \| `null` | A failure's bounded reason; null otherwise. |
789
878
 
790
879
  ---
791
880
 
@@ -801,8 +890,9 @@ Stable row grammar rendered by Parakeet's timeline.
801
890
 
802
891
  ```ts
803
892
  const AgentHead: NamedExoticComponent<{
893
+ timeMs?: number;
804
894
  activity?: AgentHeadActivity;
805
- avatar?: {
895
+ avatar: {
806
896
  v: 1;
807
897
  character: "mushroom" | "cat" | "burger";
808
898
  appearance: z.ZodRecord<
@@ -819,22 +909,17 @@ const AgentHead: NamedExoticComponent<{
819
909
  | "blueprint"
820
910
  | "crt"
821
911
  | "watercolor";
822
- } | null;
912
+ };
823
913
  className?: string;
824
914
  name: string;
825
- seed: string;
826
915
  size?: number;
827
916
  }>;
828
917
  ```
829
918
 
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.
919
+ An Agent's head at avatar size, drawn from the Agent's own avatar (a property of
920
+ the Agent record, never of a conversation). The letter shows until a frame is
921
+ ready. The live canvas stays mounted and is paused unless `thinking` or
922
+ `speaking`, so an idle head shows its real look without animating.
838
923
 
839
924
  ---
840
925
 
@@ -866,9 +951,10 @@ const ShiitakeAvatar: NamedExoticComponent<{
866
951
  }>;
867
952
  ```
868
953
 
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.
954
+ A sprite head drawn in the live activity and expression it is given. With an
955
+ `avatar` it draws that look (a member's own, in their settings); with none it is
956
+ Shiitake, the product mascot, in the character's own defaults. Conversations
957
+ have no avatar: an Agent's head is `AgentHead`, drawn from the Agent record.
872
958
 
873
959
  ---
874
960
 
@@ -913,9 +999,9 @@ Own one renderer-neutral conversation scope over the existing query cache.
913
999
 
914
1000
  #### Parameters
915
1001
 
916
- | Parameter | Type |
917
- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
918
- | `__namedParameters` | `Readonly`\<\{ `children`: `ReactNode`; `session`: [`ParakeetSession`](#parakeetsession); `clients?`: readonly `ClientEntryV1`[]; `interactionStore?`: [`ParakeetInteractions`](headless.md#parakeetinteractions); `authorOf?`: [`ParakeetAuthorOf`](#parakeetauthorof); \}\> |
1002
+ | Parameter | Type |
1003
+ | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1004
+ | `__namedParameters` | `Readonly`\<\{ `children`: `ReactNode`; `session`: [`ParakeetSession`](#parakeetsession); `clients?`: readonly `ClientEntryV1`[]; `interactionStore?`: [`ParakeetInteractions`](headless.md#parakeetinteractions); `onToast?`: (`toast`) => `void`; `draftStorage?`: [`ParakeetDraftStorage`](#parakeetdraftstorage); `draftIdentity?`: [`ParakeetDraftIdentity`](#parakeetdraftidentity); `authorOf?`: [`ParakeetAuthorOf`](#parakeetauthorof); \}\> |
919
1005
 
920
1006
  #### Returns
921
1007
 
@@ -1027,6 +1113,28 @@ The durable assistant's provider/model ids, shared by browser and terminal.
1027
1113
 
1028
1114
  ---
1029
1115
 
1116
+ ### formatModelWithLevel()
1117
+
1118
+ ```ts
1119
+ function formatModelWithLevel(model, level): string;
1120
+ ```
1121
+
1122
+ The model identity with its thinking level, "provider/model (level)"; no level,
1123
+ no suffix.
1124
+
1125
+ #### Parameters
1126
+
1127
+ | Parameter | Type |
1128
+ | --------- | --------------------------------- |
1129
+ | `model` | [`ParakeetModel`](#parakeetmodel) |
1130
+ | `level` | `string` \| `undefined` |
1131
+
1132
+ #### Returns
1133
+
1134
+ `string`
1135
+
1136
+ ---
1137
+
1030
1138
  ### toolGroupDefaultOpen()
1031
1139
 
1032
1140
  ```ts
@@ -1061,7 +1169,7 @@ function visibleToolCalls(
1061
1169
  activeVerb: string;
1062
1170
  label: string;
1063
1171
  paths: readonly string[];
1064
- status: "error" | "unknown" | "completed" | "running";
1172
+ status: "error" | "unknown" | "running" | "completed";
1065
1173
  durationMs?: number;
1066
1174
  exitCode?: number;
1067
1175
  error?: string;
@@ -1083,7 +1191,7 @@ Even a folded group shows recent calls, rather than hiding all tool work.
1083
1191
  readonly `Readonly`\<\{ `id`: `string`; `kind`:
1084
1192
  [`ParakeetToolKind`](#parakeettoolkind); `name`: `string`; `verb`: `string`;
1085
1193
  `activeVerb`: `string`; `label`: `string`; `paths`: readonly `string`[];
1086
- `status`: `"error"` \| `"unknown"` \| `"completed"` \| `"running"`;
1194
+ `status`: `"error"` \| `"unknown"` \| `"running"` \| `"completed"`;
1087
1195
  `durationMs?`: `number`; `exitCode?`: `number`; `error?`: `string`; `sections`:
1088
1196
  readonly [`ParakeetToolCallSection`](#parakeettoolcallsection)[]; \}\>[]
1089
1197
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fungi.computer/parakeet",
3
- "version": "0.0.1",
3
+ "version": "0.2.0",
4
4
  "author": "Levi <levi@technomancy.dev>",
5
5
  "private": false,
6
6
  "description": "Standalone React composer for a typed Shiitake Session",
@@ -19,6 +19,10 @@
19
19
  "types": "./dist/headless.d.ts",
20
20
  "import": "./dist/headless.js"
21
21
  },
22
+ "./conversation-opening": {
23
+ "types": "./dist/conversation-opening.d.ts",
24
+ "import": "./dist/conversation-opening.js"
25
+ },
22
26
  "./agent-head": {
23
27
  "types": "./dist/agent-head.d.ts",
24
28
  "import": "./dist/agent-head.js"
@@ -43,23 +47,25 @@
43
47
  "react-dom": "^18.2.0 || ^19.2.0"
44
48
  },
45
49
  "dependencies": {
46
- "@fungi.computer/cairn": "0.0.1",
47
- "@fungi.computer/caps": "0.0.2",
48
- "@fungi.computer/knapsack": "0.0.2",
49
- "@fungi.computer/shiitake": "0.1.0",
50
- "@fungi.computer/sigils": "0.0.1",
51
- "@fungi.computer/sprite": "0.0.1",
52
- "@fungi.computer/sprite-zdog": "0.0.1",
53
- "@fungi.computer/whistle": "0.0.1",
50
+ "@fungi.computer/agar": "0.3.0",
51
+ "@fungi.computer/cairn": "0.1.0",
52
+ "@fungi.computer/caps": "0.2.0",
53
+ "@fungi.computer/knapsack": "0.2.0",
54
+ "@fungi.computer/shiitake": "0.3.0",
55
+ "@fungi.computer/sigils": "0.2.0",
56
+ "@fungi.computer/sprite": "0.2.0",
57
+ "@fungi.computer/sprite-zdog": "0.2.0",
58
+ "@fungi.computer/whistle": "0.1.0",
54
59
  "@tanstack/markdown": "0.0.12",
55
60
  "@tanstack/react-virtual": "3.14.10",
56
61
  "diff": "8.0.4",
62
+ "eventsource": "5.1.1",
57
63
  "jotai": "2.20.3",
58
64
  "jotai-tanstack-query": "0.11.0",
59
65
  "lucide-react": "0.460.0",
60
66
  "strip-ansi": "7.2.0",
61
67
  "zod": "4.4.3",
62
- "@fungi.computer/gills": "0.0.1"
68
+ "@fungi.computer/gills": "0.2.0"
63
69
  },
64
70
  "dependenciesMeta": {
65
71
  "@fungi.computer/caps": {
package/src/styles.css CHANGED
@@ -5,7 +5,11 @@
5
5
  */
6
6
  @import "@fungi.computer/caps/tailwind.css";
7
7
 
8
+ /* In the workspace Tailwind scans the component source; published, this
9
+ * entry ships without it, and the compiled components in dist carry the same
10
+ * class names. */
8
11
  @source "./";
12
+ @source "../dist/**/*.js";
9
13
 
10
14
  @plugin "@tailwindcss/typography";
11
15
 
@@ -109,15 +113,6 @@
109
113
  color: var(--color-success);
110
114
  }
111
115
 
112
- .chat-composer .parakeet-key-hints {
113
- margin: 0;
114
- padding: 0 0.75rem 0.25rem;
115
- background: var(--color-base-200);
116
- font-family: var(--font-sans);
117
- font-size: 0.6rem;
118
- color: var(--stipe-fg-muted);
119
- }
120
-
121
116
  .chat-composer .footer-divider {
122
117
  width: 3px;
123
118
  height: 3px;
@@ -1,16 +0,0 @@
1
- import type { AvatarSpriteProps } from "./avatar-presentation.js";
2
- /** The still-frame cache key for one presentation at one pixel size. */
3
- export declare function stillFrameKey(presentation: AvatarSpriteProps, size: number, devicePixelRatio: number): string;
4
- /** The cached still frame for `key`, refreshing its recency, or `undefined`. */
5
- export declare function getStillFrame(key: string): string | undefined;
6
- /** Cache `value` (a data URL) for `key`, evicting the oldest entry past 128. */
7
- export declare function setStillFrame(key: string, value: string): void;
8
- /**
9
- * Capture the idle frame of a just-rendered Sprite host as a still image, or
10
- * `undefined` when the host has no live canvas yet (not ready) or the
11
- * canvas export is denied because the canvas is tainted. Other export failures
12
- * propagate with their cause.
13
- */
14
- export declare function captureStillFrame(host: HTMLElement | null): string | undefined;
15
- /** Test-only: clears every cached still frame so tests do not leak between runs. */
16
- export declare function clearStillFrameCache(): void;
@@ -1,63 +0,0 @@
1
- const MAX_ENTRIES = 128;
2
- /**
3
- * Idle heads shown over and over (an Agent rail) do not need their own live
4
- * canvas: once one instance of a descriptor has rendered, every other idle
5
- * instance can show the same still frame. Keyed by the resolved presentation
6
- * plus the pixel size it was drawn at, so a resize or a different size
7
- * elsewhere never serves the wrong frame. An LRU of about 128 entries; the
8
- * oldest is evicted once that is exceeded.
9
- */
10
- const cache = new Map();
11
- /** The still-frame cache key for one presentation at one pixel size. */
12
- export function stillFrameKey(presentation, size, devicePixelRatio) {
13
- return JSON.stringify([
14
- presentation.src,
15
- presentation.appearance,
16
- presentation.expression,
17
- presentation.renderStyle,
18
- size,
19
- devicePixelRatio,
20
- ]);
21
- }
22
- /** The cached still frame for `key`, refreshing its recency, or `undefined`. */
23
- export function getStillFrame(key) {
24
- const value = cache.get(key);
25
- if (value === undefined)
26
- return undefined;
27
- cache.delete(key);
28
- cache.set(key, value);
29
- return value;
30
- }
31
- /** Cache `value` (a data URL) for `key`, evicting the oldest entry past 128. */
32
- export function setStillFrame(key, value) {
33
- cache.delete(key);
34
- cache.set(key, value);
35
- if (cache.size <= MAX_ENTRIES)
36
- return;
37
- const oldestKey = cache.keys().next().value;
38
- if (oldestKey !== undefined)
39
- cache.delete(oldestKey);
40
- }
41
- /**
42
- * Capture the idle frame of a just-rendered Sprite host as a still image, or
43
- * `undefined` when the host has no live canvas yet (not ready) or the
44
- * canvas export is denied because the canvas is tainted. Other export failures
45
- * propagate with their cause.
46
- */
47
- export function captureStillFrame(host) {
48
- const canvas = host?.querySelector("canvas");
49
- if (!canvas)
50
- return undefined;
51
- try {
52
- return canvas.toDataURL("image/png");
53
- }
54
- catch (cause) {
55
- if (cause instanceof DOMException && cause.name === "SecurityError")
56
- return undefined;
57
- throw new Error("Could not capture an avatar still frame", { cause });
58
- }
59
- }
60
- /** Test-only: clears every cached still frame so tests do not leak between runs. */
61
- export function clearStillFrameCache() {
62
- cache.clear();
63
- }