@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.
- package/README.md +45 -6
- package/dist/account-commands.js +3 -11
- package/dist/commands/advertised.d.ts +3 -1
- package/dist/commands/advertised.js +89 -4
- package/dist/commands/builtins.js +1 -1
- package/dist/commands/interactions.d.ts +22 -7
- package/dist/commands/interactions.js +41 -17
- package/dist/commands/run.d.ts +3 -2
- package/dist/commands/run.js +5 -2
- package/dist/commands/slash.d.ts +2 -0
- package/dist/commands/slash.js +13 -7
- package/dist/commands/use-slash-commands.js +4 -4
- package/dist/components/AgentHead.d.ts +9 -12
- package/dist/components/AgentHead.js +12 -44
- package/dist/components/ChatComposer.d.ts +3 -1
- package/dist/components/ChatComposer.js +79 -15
- package/dist/components/ChatMessage.d.ts +4 -0
- package/dist/components/ChatMessage.js +6 -2
- package/dist/components/ClientRows.js +2 -2
- package/dist/components/InteractionPanel.d.ts +2 -4
- package/dist/components/InteractionPanel.js +2 -2
- package/dist/components/ShiitakeAvatar.d.ts +7 -5
- package/dist/components/ShiitakeAvatar.js +6 -4
- package/dist/components/TimelineItem.d.ts +2 -0
- package/dist/components/TimelineItem.js +31 -7
- package/dist/components/avatar-presentation.d.ts +7 -14
- package/dist/components/avatar-presentation.js +6 -13
- package/dist/conversation-opening.d.ts +47 -0
- package/dist/conversation-opening.js +173 -0
- package/dist/conversation.d.ts +50 -5
- package/dist/conversation.js +587 -87
- package/dist/core/author-labels.d.ts +2 -0
- package/dist/core/build-timeline.d.ts +4 -2
- package/dist/core/build-timeline.js +46 -7
- package/dist/core/client-actions.js +6 -3
- package/dist/core/client-timeline.d.ts +9 -2
- package/dist/core/client-timeline.js +15 -4
- package/dist/core/draft-storage.d.ts +63 -0
- package/dist/core/draft-storage.js +50 -0
- package/dist/core/model-identity.d.ts +2 -0
- package/dist/core/model-identity.js +6 -0
- package/dist/core/queued-recall.d.ts +35 -0
- package/dist/core/queued-recall.js +138 -0
- package/dist/core/session-projection.js +17 -0
- package/dist/core/session-query.d.ts +54 -11
- package/dist/core/session-query.js +38 -12
- package/dist/core/tool-groups.d.ts +1 -1
- package/dist/core/tool-groups.js +3 -1
- package/dist/core/tool-view.d.ts +1 -1
- package/dist/core/tool-view.js +3 -2
- package/dist/core/use-timeline-item-key.d.ts +8 -0
- package/dist/core/use-timeline-item-key.js +29 -0
- package/dist/headless.d.ts +6 -4
- package/dist/headless.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/model-commands.js +65 -40
- package/dist/parakeet.js +17 -18
- package/dist/provider-choices.js +10 -7
- package/dist/session-commands.d.ts +0 -9
- package/dist/session-commands.js +39 -68
- package/dist/session.d.ts +1 -1
- package/dist/store/types.d.ts +10 -4
- package/dist/styles.css +105 -117
- package/docs/api/commands/slash.md +24 -21
- package/docs/api/headless.md +375 -232
- package/docs/api/index.md +168 -60
- package/package.json +16 -10
- package/src/styles.css +4 -9
- package/dist/components/still-frame-cache.d.ts +0 -16
- 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
|
|
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
|
|
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
|
-
|
|
570
|
+
status: "unknown";
|
|
490
571
|
}>
|
|
491
572
|
| Readonly<{
|
|
492
|
-
|
|
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`: `"
|
|
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`: `
|
|
532
|
-
| `input.commandId` | `
|
|
533
|
-
| `input.onlyIfPending?` | `
|
|
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`: `"
|
|
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"
|
|
573
|
-
| `input.type` | `"fork"
|
|
574
|
-
| `input.entryId` | `
|
|
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
|
-
|
|
677
|
+
status: "unknown";
|
|
594
678
|
}>
|
|
595
679
|
| Readonly<{
|
|
596
|
-
|
|
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`: `"
|
|
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`: `"
|
|
613
|
-
`
|
|
614
|
-
`"
|
|
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<
|
|
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
|
|
782
|
-
| ------------ |
|
|
783
|
-
| `id` | `string`
|
|
784
|
-
| `kind` | `"compaction_notice"`
|
|
785
|
-
| `at` | `number`
|
|
786
|
-
| `trigger` | `SessionCompactionTrigger`
|
|
787
|
-
| `result` | `"failed"` \| `"nothing_to_compact"` | What the compaction did: nothing to summarize, or a
|
|
788
|
-
| `diagnostic` | `string` \| `null`
|
|
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
|
-
}
|
|
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
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
`
|
|
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
|
-
|
|
870
|
-
|
|
871
|
-
|
|
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" | "
|
|
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"` \| `"
|
|
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
|
|
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/
|
|
47
|
-
"@fungi.computer/
|
|
48
|
-
"@fungi.computer/
|
|
49
|
-
"@fungi.computer/
|
|
50
|
-
"@fungi.computer/
|
|
51
|
-
"@fungi.computer/
|
|
52
|
-
"@fungi.computer/sprite
|
|
53
|
-
"@fungi.computer/
|
|
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
|
|
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
|
-
}
|