@fungi.computer/parakeet 0.13.1 → 0.13.2
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 +63 -30
- package/dist/components/ChatComposer.d.ts +2 -0
- package/dist/components/ChatComposer.js +5 -4
- package/dist/parakeet.js +3 -0
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,40 +1,19 @@
|
|
|
1
1
|
# Parakeet (`@fungi.computer/parakeet`)
|
|
2
2
|
|
|
3
|
-
Parakeet
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
Parakeet shows a conversation with an AI agent: the messages, the box you type
|
|
4
|
+
in, and the status. Browsers get a React view, and terminals get the same pieces
|
|
5
|
+
as hooks.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
visitor-session adapter supplies the visitor's scoped Session read, watch and
|
|
9
|
-
prompt commands; credentials and admission remain with the host.
|
|
10
|
-
`markdownPolicy="visitor"` renders Markdown links without loading images or
|
|
11
|
-
unsafe destinations. A prompt recorded for a human returns `status: "recorded"`,
|
|
12
|
-
not a fabricated Agent-work acceptance. Closing the view stops observation, not
|
|
13
|
-
the Agent's work. Pass `visitor={{ agentName: "Front Desk" }}` to hide model,
|
|
14
|
-
usage and command controls. Slash-prefixed text remains a normal visitor
|
|
15
|
-
message; the visitor mode does not register or execute slash commands.
|
|
7
|
+

|
|
16
8
|
|
|
17
|
-
##
|
|
9
|
+
## Quick start
|
|
18
10
|
|
|
19
|
-
Install
|
|
20
|
-
React DOM pair, TanStack Query and an authorized Session supplied by the host.
|
|
21
|
-
The manifest supports React 18.2 or 19.2 and later within those major versions.
|
|
11
|
+
Install it:
|
|
22
12
|
|
|
23
13
|
```sh
|
|
24
|
-
npm install @fungi.computer/parakeet
|
|
14
|
+
npm install @fungi.computer/parakeet
|
|
25
15
|
```
|
|
26
16
|
|
|
27
|
-
Browser hosts import `@fungi.computer/parakeet/styles.css` once. It includes the
|
|
28
|
-
Caps/Stipe foundation and conversation utilities. Do not also load
|
|
29
|
-
`@fungi.computer/caps/styles.css` in that document. Import Caps' `fonts.css`
|
|
30
|
-
separately when using its bundled fonts, with font URLs handled by your bundler.
|
|
31
|
-
|
|
32
|
-
A host compiling its own Tailwind utilities uses the `/tailwind.css` source
|
|
33
|
-
instead and supplies its own `@source`. The built stylesheet cannot scan your
|
|
34
|
-
host's additional classes.
|
|
35
|
-
|
|
36
|
-
## Quick start in a browser
|
|
37
|
-
|
|
38
17
|
Illustrative: your host supplies the authorized `ParakeetSession` and a browser
|
|
39
18
|
bundler that handles CSS. This component owns its query cache and clears it on
|
|
40
19
|
unmount. It does not create an Agent, sign in or grant tools.
|
|
@@ -58,8 +37,7 @@ export function Conversation({ session }: { session: ParakeetSession }) {
|
|
|
58
37
|
|
|
59
38
|
Parakeet never reads a message's host metadata itself. To show who wrote a line,
|
|
60
39
|
pass `authorOf`: your reading of that metadata into a `ParakeetAuthor`
|
|
61
|
-
(`{ id, name }`).
|
|
62
|
-
`@fungi.computer/agar/agents`; without it, lines show no author.
|
|
40
|
+
(`{ id, name }`). Without it, lines show no author.
|
|
63
41
|
|
|
64
42
|
The view presents the Session's observed history, live work, composer and
|
|
65
43
|
errors. Screen readers receive the same Session status as the composer footer
|
|
@@ -77,6 +55,61 @@ provider, query cache, observations and prompt admission with typed fixtures.
|
|
|
77
55
|
The browser contract uses the real component with a fixture Session. A fake
|
|
78
56
|
Session checks the component, not hosted authentication or a model provider.
|
|
79
57
|
|
|
58
|
+
## Common tasks
|
|
59
|
+
|
|
60
|
+
### Show a conversation in a browser
|
|
61
|
+
|
|
62
|
+
Mount `Parakeet` with an authorized session, as in the Quick start.
|
|
63
|
+
|
|
64
|
+
### Add the shared composer
|
|
65
|
+
|
|
66
|
+
See [Shared composer](#shared-composer).
|
|
67
|
+
|
|
68
|
+
### Render it in a terminal
|
|
69
|
+
|
|
70
|
+
Terminal hosts use the headless hooks. See [Core concepts](#core-concepts).
|
|
71
|
+
|
|
72
|
+
### Handle slash commands and errors
|
|
73
|
+
|
|
74
|
+
See [Commands and errors](#commands-and-errors).
|
|
75
|
+
|
|
76
|
+
## Reference
|
|
77
|
+
|
|
78
|
+
### Overview
|
|
79
|
+
|
|
80
|
+
Parakeet shows a conversation with an AI agent. Browser hosts use its React
|
|
81
|
+
view; terminal hosts use its headless hooks to show the same history, composer
|
|
82
|
+
and status in their own UI.
|
|
83
|
+
|
|
84
|
+
Website hosts mount the same `Parakeet` component inside an isolated iframe. A
|
|
85
|
+
visitor-session adapter supplies the visitor's scoped Session read, watch and
|
|
86
|
+
prompt commands; credentials and admission remain with the host.
|
|
87
|
+
`markdownPolicy="visitor"` renders Markdown links without loading images or
|
|
88
|
+
unsafe destinations. A prompt recorded for a human returns `status: "recorded"`,
|
|
89
|
+
not a fabricated Agent-work acceptance. Closing the view stops observation, not
|
|
90
|
+
the Agent's work. Pass `visitor={{ agentName: "Front Desk" }}` to hide model,
|
|
91
|
+
usage and command controls. Slash-prefixed text remains a normal visitor
|
|
92
|
+
message; the visitor mode does not register or execute slash commands.
|
|
93
|
+
|
|
94
|
+
## Set up
|
|
95
|
+
|
|
96
|
+
Install `@fungi.computer/parakeet` from npm. It requires a compatible React and
|
|
97
|
+
React DOM pair, TanStack Query and an authorized Session supplied by the host.
|
|
98
|
+
The manifest supports React 18.2 or 19.2 and later within those major versions.
|
|
99
|
+
|
|
100
|
+
```sh
|
|
101
|
+
npm install @fungi.computer/parakeet react react-dom @tanstack/react-query
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Browser hosts import `@fungi.computer/parakeet/styles.css` once. It includes the
|
|
105
|
+
Caps/Stipe foundation and conversation utilities. Do not also load
|
|
106
|
+
`@fungi.computer/caps/styles.css` in that document. Import Caps' `fonts.css`
|
|
107
|
+
separately when using its bundled fonts, with font URLs handled by your bundler.
|
|
108
|
+
|
|
109
|
+
A host compiling its own Tailwind utilities uses the `/tailwind.css` source
|
|
110
|
+
instead and supplies its own `@source`. The built stylesheet cannot scan your
|
|
111
|
+
host's additional classes.
|
|
112
|
+
|
|
80
113
|
## Shared composer
|
|
81
114
|
|
|
82
115
|
`ComposerShell` is the shared chat and generation composer surface. It owns the
|
|
@@ -30,6 +30,8 @@ export type ChatComposerProps = {
|
|
|
30
30
|
status: ParakeetStatus;
|
|
31
31
|
/** Session owner readout, separate from local prompt admission. */
|
|
32
32
|
viewState: ParakeetSessionViewState;
|
|
33
|
+
/** An open item waits on the person; an ended turn alone does not. */
|
|
34
|
+
waitingOnYou?: boolean | undefined;
|
|
33
35
|
textareaRef: RefObject<HTMLTextAreaElement>;
|
|
34
36
|
usage?: ChatComposerUsage | undefined;
|
|
35
37
|
/** Context use the Session's compaction measures, once known. */
|
|
@@ -260,7 +260,7 @@ const settingsCommands = [
|
|
|
260
260
|
/**
|
|
261
261
|
* Session controls and Settings content; ComposerShell owns their row.
|
|
262
262
|
*/
|
|
263
|
-
function useComposerRow({ showFooter, statusChips, model, status, viewState, usage, context, slash, attach, send, }) {
|
|
263
|
+
function useComposerRow({ showFooter, statusChips, model, status, viewState, waitingOnYou, usage, context, slash, attach, send, }) {
|
|
264
264
|
const [openId, setOpenId] = useState(null);
|
|
265
265
|
// Footer visibility belongs here, before deriving any internal readouts.
|
|
266
266
|
if (!showFooter)
|
|
@@ -268,7 +268,8 @@ function useComposerRow({ showFooter, statusChips, model, status, viewState, usa
|
|
|
268
268
|
const tone = viewState.kind === "error" ? "error" : presentations[status].tone;
|
|
269
269
|
// Admission must not replace an outstanding owner attention readout.
|
|
270
270
|
const label = sessionReadout("idle", viewState);
|
|
271
|
-
const needsAttention = viewState.kind === "waiting_for_you"
|
|
271
|
+
const needsAttention = (viewState.kind === "waiting_for_you" && waitingOnYou === true) ||
|
|
272
|
+
viewState.kind === "error";
|
|
272
273
|
const modelName = model === undefined ? undefined : composerModelName(model);
|
|
273
274
|
const canPickModel = slash?.available("model") === true;
|
|
274
275
|
const contextText = context === undefined ? undefined : formatContextUsage(context);
|
|
@@ -317,7 +318,7 @@ function ComposerAttachments({ images, onRemove, }) {
|
|
|
317
318
|
onRemove(index);
|
|
318
319
|
}, size: "xs", variant: "outline" }))] }, index))) }));
|
|
319
320
|
}
|
|
320
|
-
export const ChatComposer = memo(function ChatComposer({ queuedRecall, onImagesChange, placeholder, showFooter = true, statusChips, actionVariant = "primary", draft, admissionError, model, onAbort, onChange, onSend, status, viewState, textareaRef, usage, context, slash, }) {
|
|
321
|
+
export const ChatComposer = memo(function ChatComposer({ queuedRecall, onImagesChange, placeholder, showFooter = true, statusChips, actionVariant = "primary", draft, admissionError, model, onAbort, onChange, onSend, status, viewState, waitingOnYou, textareaRef, usage, context, slash, }) {
|
|
321
322
|
const textareaId = useId();
|
|
322
323
|
const slashListId = `${textareaId}-commands`;
|
|
323
324
|
const fileInput = useRef(null);
|
|
@@ -366,7 +367,7 @@ export const ChatComposer = memo(function ChatComposer({ queuedRecall, onImagesC
|
|
|
366
367
|
});
|
|
367
368
|
}, ref: fileInput, type: "file" }), _jsx(KeycapButton, { "aria-label": "Attach images", className: "composer-attach-key", icon: _jsx(Plus, {}), label: null, onClick: () => fileInput.current?.click(), title: "Attach images" })] }));
|
|
368
369
|
// Visitors see only the field and the send key, never internal readouts.
|
|
369
|
-
const footerProps = { status, viewState };
|
|
370
|
+
const footerProps = { status, viewState, waitingOnYou };
|
|
370
371
|
footerProps.statusChips = statusChips;
|
|
371
372
|
if (model)
|
|
372
373
|
footerProps.model = model;
|
package/dist/parakeet.js
CHANGED
|
@@ -381,6 +381,9 @@ function ConversationComposer({ visitor, textareaRef, composerActionVariant, sla
|
|
|
381
381
|
showFooter: visitor === undefined,
|
|
382
382
|
status: sessionStatus.status,
|
|
383
383
|
viewState: sessionStatus.viewState,
|
|
384
|
+
// Only an open item a person must answer waits on you, as in the TUI.
|
|
385
|
+
waitingOnYou: slash.awaiting.total > 0 ||
|
|
386
|
+
contributions.some(({ value }) => value.panel.some((row) => row.tone === "attention" && (row.actions?.length ?? 0) > 0)),
|
|
384
387
|
textareaRef,
|
|
385
388
|
model: timeline.model,
|
|
386
389
|
usage: timeline.usage,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fungi.computer/parakeet",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.2",
|
|
4
4
|
"author": "Levi <levi@technomancy.dev>",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Standalone React composer for a typed Shiitake Session",
|
|
@@ -64,14 +64,14 @@
|
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
66
|
"@earendil-works/pi-ai": "1.5.2",
|
|
67
|
-
"@fungi.computer/agar": "0.
|
|
67
|
+
"@fungi.computer/agar": "0.22.0",
|
|
68
68
|
"@fungi.computer/bird-dog": "0.3.7",
|
|
69
69
|
"@fungi.computer/cairn": "0.1.0",
|
|
70
|
-
"@fungi.computer/caps": "0.12.
|
|
70
|
+
"@fungi.computer/caps": "0.12.1",
|
|
71
71
|
"@fungi.computer/gills": "0.4.0",
|
|
72
|
-
"@fungi.computer/knapsack": "0.4.
|
|
73
|
-
"@fungi.computer/mule": "0.2.
|
|
74
|
-
"@fungi.computer/shiitake": "0.20.
|
|
72
|
+
"@fungi.computer/knapsack": "0.4.19",
|
|
73
|
+
"@fungi.computer/mule": "0.2.7",
|
|
74
|
+
"@fungi.computer/shiitake": "0.20.3",
|
|
75
75
|
"@fungi.computer/sigils": "0.3.2",
|
|
76
76
|
"@fungi.computer/sprite": "0.2.2",
|
|
77
77
|
"@fungi.computer/sprite-zdog": "0.3.2",
|