@fungi.computer/parakeet 0.9.2 → 0.10.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 +4 -5
- package/dist/components/ChatComposer.d.ts +2 -0
- package/dist/components/ChatComposer.js +9 -7
- package/dist/components/RunFailureNotice.d.ts +1 -1
- package/dist/components/RunFailureNotice.js +20 -4
- package/dist/components/TimelineItem.js +15 -2
- package/dist/core/build-timeline.js +6 -3
- package/dist/host-facts.d.ts +35 -0
- package/dist/host-facts.js +16 -0
- package/dist/index.d.ts +1 -0
- package/dist/parakeet.d.ts +7 -2
- package/dist/parakeet.js +71 -44
- package/dist/styles.css +244 -9
- package/docs/api/index.md +32 -0
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -16,13 +16,12 @@ message; the visitor mode does not register or execute slash commands.
|
|
|
16
16
|
|
|
17
17
|
## Set up
|
|
18
18
|
|
|
19
|
-
Install `@fungi.computer/parakeet` from
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
those major versions. Build the dependency closure from the repository root:
|
|
19
|
+
Install `@fungi.computer/parakeet` from npm. It requires a compatible React and
|
|
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.
|
|
23
22
|
|
|
24
23
|
```sh
|
|
25
|
-
|
|
24
|
+
npm install @fungi.computer/parakeet react react-dom @tanstack/react-query
|
|
26
25
|
```
|
|
27
26
|
|
|
28
27
|
Browser hosts import `@fungi.computer/parakeet/styles.css` once. It includes the
|
|
@@ -15,6 +15,8 @@ export type ChatComposerProps = {
|
|
|
15
15
|
queuedRecall: Pick<ComposerController, "recall" | "recallState" | "images"> | undefined;
|
|
16
16
|
/** Caller-owned prompt hint; omitted for the ordinary Session composer. */
|
|
17
17
|
placeholder?: string | undefined;
|
|
18
|
+
/** Why typing cannot work yet, such as no model connected. It disables input and sending, and replaces the hint. */
|
|
19
|
+
disabledReason?: string | undefined;
|
|
18
20
|
/** Hide internal model, usage and status readouts for visitors. */
|
|
19
21
|
showFooter?: boolean;
|
|
20
22
|
/** Display-only status text supplied by the conversation's admitted entries. */
|
|
@@ -63,7 +63,7 @@ const presentations = {
|
|
|
63
63
|
tone: "neutral",
|
|
64
64
|
},
|
|
65
65
|
};
|
|
66
|
-
function HostComposerTextarea({ placeholder, onChange, onSend, onAbort, slash, slashListId, textareaId, textareaRef, value, queuedRecall, }) {
|
|
66
|
+
function HostComposerTextarea({ disabledReason, placeholder, onChange, onSend, onAbort, slash, slashListId, textareaId, textareaRef, value, queuedRecall, }) {
|
|
67
67
|
const latestValue = useRef(value);
|
|
68
68
|
const [history, setHistory] = useState([]);
|
|
69
69
|
const [historyIndex, setHistoryIndex] = useState(-1);
|
|
@@ -197,7 +197,7 @@ function HostComposerTextarea({ placeholder, onChange, onSend, onAbort, slash, s
|
|
|
197
197
|
: `${textareaId}-recall-guidance`,
|
|
198
198
|
]
|
|
199
199
|
.filter((id) => id !== undefined)
|
|
200
|
-
.join(" ") || undefined, "aria-busy": recalling, readOnly: recalling, ...(slash === undefined
|
|
200
|
+
.join(" ") || undefined, "aria-busy": recalling, disabled: disabledReason !== undefined, readOnly: recalling, ...(slash === undefined
|
|
201
201
|
? {}
|
|
202
202
|
: completionFieldProps({
|
|
203
203
|
open: listOpen,
|
|
@@ -206,7 +206,8 @@ function HostComposerTextarea({ placeholder, onChange, onSend, onAbort, slash, s
|
|
|
206
206
|
})), className: "font-sans text-base-content", id: textareaId, onChange: (event) => {
|
|
207
207
|
onChange(event.target.value);
|
|
208
208
|
setHistoryIndex(-1);
|
|
209
|
-
}, onKeyDown: onKeyDown, placeholder:
|
|
209
|
+
}, onKeyDown: onKeyDown, placeholder: disabledReason ??
|
|
210
|
+
placeholder ??
|
|
210
211
|
(slash === undefined ? "Ask agent..." : "Ask agent… (/ for commands)"), ref: textareaRef, rows: 1, value: value }), queuedRecall === undefined ? null : (_jsx("span", { id: `${textareaId}-recall-guidance`, className: "sr-only", children: "Press Up on an empty composer to recall your newest queued message." }))] }));
|
|
211
212
|
}
|
|
212
213
|
/** Full Session readout for announcements; the footer only draws attention states. */
|
|
@@ -318,7 +319,7 @@ function ComposerAttachments({ images, onRemove, }) {
|
|
|
318
319
|
onRemove(index);
|
|
319
320
|
}, size: "xs", variant: "outline" }))] }, index))) }));
|
|
320
321
|
}
|
|
321
|
-
export const ChatComposer = memo(function ChatComposer({ queuedRecall, onImagesChange, placeholder, showFooter = true, statusChips, actionVariant = "primary", draft, failure, failureCause, admissionError, model, onAbort, onChange, onRetry, onSend, status, viewState, textareaRef, usage, context, slash, }) {
|
|
322
|
+
export const ChatComposer = memo(function ChatComposer({ queuedRecall, onImagesChange, placeholder, disabledReason, showFooter = true, statusChips, actionVariant = "primary", draft, failure, failureCause, admissionError, model, onAbort, onChange, onRetry, onSend, status, viewState, textareaRef, usage, context, slash, }) {
|
|
322
323
|
const textareaId = useId();
|
|
323
324
|
const slashListId = `${textareaId}-commands`;
|
|
324
325
|
const fileInput = useRef(null);
|
|
@@ -353,8 +354,9 @@ export const ChatComposer = memo(function ChatComposer({ queuedRecall, onImagesC
|
|
|
353
354
|
blocked: recallBusy,
|
|
354
355
|
});
|
|
355
356
|
const sendLabel = busy ? "Queue follow-up" : "Send message";
|
|
356
|
-
const sendAction = (_jsx(SendAction, { "aria-label": sendLabel, className: "composer-send-key", disabled:
|
|
357
|
-
(
|
|
357
|
+
const sendAction = (_jsx(SendAction, { "aria-label": sendLabel, className: "composer-send-key", disabled: disabledReason !== undefined ||
|
|
358
|
+
(sendState === "busy" &&
|
|
359
|
+
(recallBusy || status === "queued" || status === "cancelling")), onClick: () => {
|
|
358
360
|
onSend(busy ? "followUp" : "steer");
|
|
359
361
|
}, onStop: onAbort, state: sendState, stopLabel: "Stop current turn", title: sendState === "busy"
|
|
360
362
|
? "Stop the current turn. Queued messages keep running in order."
|
|
@@ -392,7 +394,7 @@ export const ChatComposer = memo(function ChatComposer({ queuedRecall, onImagesC
|
|
|
392
394
|
onImagesChange(images.filter((_image, at) => at !== index));
|
|
393
395
|
} })) : undefined, input: _jsxs(_Fragment, { children: [takeover === undefined || slash === undefined ? null : (_jsx(DecisionComposer, { item: takeover, position: slash.awaiting.position, total: slash.awaiting.total, onLater: () => {
|
|
394
396
|
slash.store.awaiting.later(takeover.key);
|
|
395
|
-
}, takeFocus: hadFocus.current }, takeover.key)), _jsx("div", { hidden: takeover !== undefined, children: _jsx(HostComposerTextarea, { queuedRecall: queuedRecall, placeholder: placeholder, onChange: onChange, onAbort: onAbort, onSend: () => {
|
|
397
|
+
}, takeFocus: hadFocus.current }, takeover.key)), _jsx("div", { hidden: takeover !== undefined, children: _jsx(HostComposerTextarea, { disabledReason: disabledReason, queuedRecall: queuedRecall, placeholder: placeholder, onChange: onChange, onAbort: onAbort, onSend: () => {
|
|
396
398
|
onSend(busy ? "followUp" : "steer");
|
|
397
399
|
}, slash: slash, slashListId: slashListId, textareaId: textareaId, textareaRef: textareaRef, value: draft }) })] }), row:
|
|
398
400
|
// A decision brings its own Later and Send row to the bottom edge.
|
|
@@ -4,4 +4,4 @@ export declare function RunFailureNotice({ failure, cause, onRetry, }: Readonly<
|
|
|
4
4
|
failure: NonNullable<ComposerController["failure"]>;
|
|
5
5
|
cause?: string | undefined;
|
|
6
6
|
onRetry: () => void;
|
|
7
|
-
}>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
}>): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { SetupNotice } from "@fungi.computer/caps/blocks/setup-notice";
|
|
3
|
+
import { FailureLine } from "@fungi.computer/caps/components/failure-line";
|
|
4
4
|
import { boundedDiagnostic } from "@fungi.computer/bird-dog/effect";
|
|
5
|
+
import { useContext } from "react";
|
|
6
|
+
import { ParakeetHostFactsContext } from "../host-facts.js";
|
|
5
7
|
const messages = {
|
|
6
8
|
admission: "Your prompt didn’t make it through. Let’s give it another go.",
|
|
7
9
|
failed: "The run stopped. Check the message above before trying again.",
|
|
@@ -10,6 +12,12 @@ const messages = {
|
|
|
10
12
|
};
|
|
11
13
|
/** Session failures do not carry a billing receipt; never promise a refund. */
|
|
12
14
|
export function RunFailureNotice({ failure, cause, onRetry, }) {
|
|
15
|
+
const { billing = true, modelSetup } = useContext(ParakeetHostFactsContext);
|
|
16
|
+
// With no model connected the timeline already says so, once, with the fix.
|
|
17
|
+
if (failure === "failed" && modelSetup?.state === "missing")
|
|
18
|
+
return null;
|
|
19
|
+
if (failure === "admission" && modelSetup?.state === "missing")
|
|
20
|
+
return (_jsx(SetupNotice, { cause: "No model is connected to this workspace.", fix: modelSetup.fix, need: "No model could answer", variant: "inline" }));
|
|
13
21
|
const bounded = cause === undefined ? undefined : boundedDiagnostic(cause);
|
|
14
22
|
// Diagnostic metadata is useful to the owner, not a public explanation.
|
|
15
23
|
const publicCause = bounded !== undefined &&
|
|
@@ -18,5 +26,13 @@ export function RunFailureNotice({ failure, cause, onRetry, }) {
|
|
|
18
26
|
? bounded
|
|
19
27
|
: undefined;
|
|
20
28
|
const interruptedWithReason = failure === "interrupted" && publicCause !== undefined;
|
|
21
|
-
|
|
29
|
+
const credits = billing
|
|
30
|
+
? " If the model didn’t start, there’s no charge. Model work already done can still use credits."
|
|
31
|
+
: "";
|
|
32
|
+
const message = interruptedWithReason
|
|
33
|
+
? `This turn stopped before it finished: ${publicCause}. Your prompt is still here.`
|
|
34
|
+
: `${messages[failure]}${credits}${publicCause ? ` ${publicCause}` : ""}`;
|
|
35
|
+
return (_jsx(FailureLine, { message: message, role: "alert", ...(failure === "cancelled"
|
|
36
|
+
? {}
|
|
37
|
+
: { onRetry, retryAriaLabel: "Retry prompt" }) }));
|
|
22
38
|
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { Sigil } from "@fungi.computer/sigils";
|
|
3
3
|
import { Button } from "@fungi.computer/caps/components/button";
|
|
4
|
-
import { memo } from "react";
|
|
4
|
+
import { memo, useContext } from "react";
|
|
5
5
|
import { disclosureOpen, initialToolDisclosure, } from "../core/tool-groups.js";
|
|
6
6
|
import { assistantMessageVisible } from "../core/assistant-visibility.js";
|
|
7
7
|
import { formatTokenCount } from "../core/format-context.js";
|
|
8
|
+
import { SetupNotice } from "@fungi.computer/caps/blocks/setup-notice";
|
|
9
|
+
import { FailureLine } from "@fungi.computer/caps/components/failure-line";
|
|
10
|
+
import { ParakeetHostFactsContext, plainModelFailure } from "../host-facts.js";
|
|
8
11
|
import { ChatMessage, PendingMessageStatus } from "./ChatMessage.js";
|
|
9
12
|
import { ToolGroup } from "./ToolGroup.js";
|
|
10
13
|
const ignoreToggle = () => undefined;
|
|
@@ -15,6 +18,7 @@ const compactionNoticeLabel = {
|
|
|
15
18
|
insufficient: "compaction skipped: the summary would not fit",
|
|
16
19
|
};
|
|
17
20
|
export const TimelineItem = memo(function TimelineItem({ item, onDismissFailed, onCancelQueued, cancellingQueued = false, renderToolActions, claimsToolMedia, renderAssistantAttachment, formatAssistantText, toolDisclosure = initialToolDisclosure, onToggleTool = ignoreToggle, }) {
|
|
21
|
+
const facts = useContext(ParakeetHostFactsContext);
|
|
18
22
|
switch (item.kind) {
|
|
19
23
|
case "user_message": {
|
|
20
24
|
const pending = item.status === "pending" || item.status === "queued";
|
|
@@ -41,12 +45,21 @@ export const TimelineItem = memo(function TimelineItem({ item, onDismissFailed,
|
|
|
41
45
|
}
|
|
42
46
|
return (_jsxs(_Fragment, { children: [item.author ? (_jsx("div", { className: "px-3 text-xs text-dim", "data-author": item.author.id, children: item.author.name })) : null, _jsx(ChatMessage, { pending: pending, speaker: "user", children: item.text }), failed, cancelAction] }));
|
|
43
47
|
}
|
|
44
|
-
case "assistant_message":
|
|
48
|
+
case "assistant_message": {
|
|
45
49
|
if (!assistantMessageVisible(item))
|
|
46
50
|
return null;
|
|
51
|
+
const modelFailure = item.isError
|
|
52
|
+
? plainModelFailure(item.text)
|
|
53
|
+
: undefined;
|
|
54
|
+
if (modelFailure !== undefined) {
|
|
55
|
+
// One line per run of identical failures, never the raw code.
|
|
56
|
+
return modelFailure.unreachable &&
|
|
57
|
+
facts.modelSetup?.state === "missing" ? (_jsx(SetupNotice, { cause: "No model is connected to this workspace.", fix: facts.modelSetup.fix, need: "No model could answer", variant: "inline" })) : (_jsx(FailureLine, { count: item.repeatCount ?? 1, message: modelFailure.message }));
|
|
58
|
+
}
|
|
47
59
|
return (_jsxs(_Fragment, { children: [item.author ? (_jsx("div", { className: "px-3 text-xs text-dim", "data-author": item.author.id, children: item.author.name })) : null, _jsx(ChatMessage, { isError: item.isError === true, pending: item.pending, speaker: "agent", ...(item.thinking ? { thinking: item.thinking } : {}), children: formatAssistantText?.(item.text) ?? item.text }), item.isError && item.repeatCount !== undefined ? (_jsxs("span", { className: "px-3 text-error", children: ["x", item.repeatCount] })) : null, item.isError && item.errorDetail ? (_jsx("p", { className: "px-3 text-dim", children: item.errorDetail })) : null, item.isError && item.providerError !== undefined ? (_jsx("div", { className: "px-3 text-error", "data-provider-error": item.id, children: _jsxs("details", { children: [_jsx("summary", { children: "Provider details (latest response)" }), _jsx("pre", { className: "whitespace-pre-wrap", children: item.providerError })] }) })) : null, !item.pending && !item.isError
|
|
48
60
|
? renderAssistantAttachment?.(item.text)
|
|
49
61
|
: null] }));
|
|
62
|
+
}
|
|
50
63
|
case "tool_group":
|
|
51
64
|
return (_jsx(ToolGroup, { disclosure: toolDisclosure, group: item, onToggle: onToggleTool, renderToolActions: renderToolActions, claimsToolMedia: claimsToolMedia }));
|
|
52
65
|
case "compaction_divider":
|
|
@@ -129,8 +129,9 @@ function collapseProviderErrors(rows, breakBefore) {
|
|
|
129
129
|
row.isError &&
|
|
130
130
|
prior?.kind === "assistant_message" &&
|
|
131
131
|
prior.isError &&
|
|
132
|
-
|
|
133
|
-
|
|
132
|
+
// Error-only turns repeat too: a provider detail is not required to fold.
|
|
133
|
+
(row.providerError === undefined) ===
|
|
134
|
+
(prior.providerError === undefined) &&
|
|
134
135
|
row.text === prior.text &&
|
|
135
136
|
row.errorDetail === prior.errorDetail &&
|
|
136
137
|
row.thinking === prior.thinking &&
|
|
@@ -140,7 +141,9 @@ function collapseProviderErrors(rows, breakBefore) {
|
|
|
140
141
|
...prior,
|
|
141
142
|
repeatCount: (prior.repeatCount ?? 1) + 1,
|
|
142
143
|
// Details show the latest response, including its request id.
|
|
143
|
-
|
|
144
|
+
...(row.providerError !== undefined && {
|
|
145
|
+
providerError: row.providerError,
|
|
146
|
+
}),
|
|
144
147
|
};
|
|
145
148
|
aliases.set(row.id, prior.id);
|
|
146
149
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** Whether a model is connected, with the one fix the host offers. */
|
|
2
|
+
export type ParakeetModelSetup = Readonly<{
|
|
3
|
+
/** `missing` turns a model failure into the setup notice; `unknown` leaves it a failure. */
|
|
4
|
+
state: "ready" | "missing" | "unknown";
|
|
5
|
+
/** Opens the host's model setup, such as Keys. Required: a notice never has a dead button. */
|
|
6
|
+
fix: Readonly<{
|
|
7
|
+
/** The button text, such as "Add a model key". */
|
|
8
|
+
label: string;
|
|
9
|
+
/** Called when the person chooses it. */
|
|
10
|
+
onSelect: () => void;
|
|
11
|
+
}>;
|
|
12
|
+
}>;
|
|
13
|
+
/** What the host knows that the conversation needs to speak plainly. */
|
|
14
|
+
export type ParakeetHostFacts = Readonly<{
|
|
15
|
+
/** Absent means unknown: failures show as failures, never as setup. */
|
|
16
|
+
modelSetup?: ParakeetModelSetup | undefined;
|
|
17
|
+
/** False when the host has no billing, so no sentence promises or denies credits. Default true. */
|
|
18
|
+
billing?: boolean | undefined;
|
|
19
|
+
/** One-click prompts the empty conversation offers; each sends as written. */
|
|
20
|
+
starters?: readonly string[] | undefined;
|
|
21
|
+
}>;
|
|
22
|
+
/** Provided by the conversation view; read by the failure and empty states. */
|
|
23
|
+
export declare const ParakeetHostFactsContext: import("react").Context<Readonly<{
|
|
24
|
+
/** Absent means unknown: failures show as failures, never as setup. */
|
|
25
|
+
modelSetup?: ParakeetModelSetup | undefined;
|
|
26
|
+
/** False when the host has no billing, so no sentence promises or denies credits. Default true. */
|
|
27
|
+
billing?: boolean | undefined;
|
|
28
|
+
/** One-click prompts the empty conversation offers; each sends as written. */
|
|
29
|
+
starters?: readonly string[] | undefined;
|
|
30
|
+
}>>;
|
|
31
|
+
/** A model run that failed, with the plain sentence for its cause; undefined for any other text. */
|
|
32
|
+
export declare function plainModelFailure(text: string): Readonly<{
|
|
33
|
+
unreachable: boolean;
|
|
34
|
+
message: string;
|
|
35
|
+
}> | undefined;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createContext } from "react";
|
|
2
|
+
/** Provided by the conversation view; read by the failure and empty states. */
|
|
3
|
+
export const ParakeetHostFactsContext = createContext({});
|
|
4
|
+
const modelFailure = /^Model request failed \(([a-z_]+)\)\./u;
|
|
5
|
+
/** A model run that failed, with the plain sentence for its cause; undefined for any other text. */
|
|
6
|
+
export function plainModelFailure(text) {
|
|
7
|
+
const code = modelFailure.exec(text)?.[1];
|
|
8
|
+
if (code === undefined)
|
|
9
|
+
return undefined;
|
|
10
|
+
return code === "provider_unavailable" || code === "setup_required"
|
|
11
|
+
? {
|
|
12
|
+
unreachable: true,
|
|
13
|
+
message: "The model provider couldn't be reached. Try again.",
|
|
14
|
+
}
|
|
15
|
+
: { unreachable: false, message: "The model request failed. Try again." };
|
|
16
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export type { ParakeetVisitor } from "./parakeet.js";
|
|
|
7
7
|
export { InteractionPanel, type InteractionPanelProps, } from "./components/InteractionPanel.js";
|
|
8
8
|
export type { QueuedRecallState, QueuedRecallOutcome, ParakeetAssistantMessageItem, ComposerController, ParakeetDraftCheckpoint, ParakeetDraftIdentity, ParakeetDraftStorage, ParakeetModel, ParakeetSession, ParakeetStatus, ParakeetTimelineItem, ParakeetToolArguments, ParakeetToolCallSection, ParakeetToolCallView, ParakeetToolDiffFile, ParakeetToolDiffHunk, ParakeetToolDiffLine, ParakeetToolDiffRow, ParakeetToolExcerptLine, ParakeetToolMatch, ParakeetToolOutputLine, ParakeetToolGroupItem, ParakeetToolItem, ParakeetToolKind, ToolDisclosureState, ParakeetUsage, ParakeetUserMessageItem, StatusController, TimelineController, MarkdownBlock, MarkdownInline, } from "./headless.js";
|
|
9
9
|
export type { ParakeetProps, ParakeetViewProps } from "./parakeet.js";
|
|
10
|
+
export type { ParakeetHostFacts, ParakeetModelSetup } from "./host-facts.js";
|
|
10
11
|
export type { ParakeetAuthor, ParakeetAuthorOf } from "./core/author-labels.js";
|
|
11
12
|
export type { ParakeetSessionCommand, ParakeetPromptResult, } from "./session.js";
|
|
12
13
|
export * from "./agent-head.js";
|
package/dist/parakeet.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ClientEntryV1 } from "@fungi.computer/shiitake/client-entry";
|
|
2
|
+
import { type ParakeetHostFacts } from "./host-facts.js";
|
|
2
3
|
import { type ReactElement, type ReactNode } from "react";
|
|
3
4
|
import { type ParakeetAuthorOf } from "./core/author-labels.js";
|
|
4
5
|
import type { ToolItem } from "./store/types.js";
|
|
@@ -43,6 +44,8 @@ export type ParakeetProps = Readonly<{
|
|
|
43
44
|
onOpen?: ((target: NonNullable<RowV1["open"]>) => void) | undefined;
|
|
44
45
|
/** Optional caller-owned empty conversation state. */
|
|
45
46
|
empty?: ReactNode | undefined;
|
|
47
|
+
/** What the host knows: model setup, billing and starter prompts. */
|
|
48
|
+
hostFacts?: ParakeetHostFacts | undefined;
|
|
46
49
|
/** Optional host Whistle runtime; Parakeet makes its own when omitted. */
|
|
47
50
|
commands?: ParakeetCommandRuntime | undefined;
|
|
48
51
|
}>;
|
|
@@ -68,6 +71,8 @@ export type ParakeetViewProps = Readonly<{
|
|
|
68
71
|
onOpen?: ((target: NonNullable<RowV1["open"]>) => void) | undefined;
|
|
69
72
|
/** Optional caller-owned empty conversation state. */
|
|
70
73
|
empty?: ReactNode | undefined;
|
|
74
|
+
/** What the host knows: model setup, billing and starter prompts. */
|
|
75
|
+
hostFacts?: ParakeetHostFacts | undefined;
|
|
71
76
|
/**
|
|
72
77
|
* Optional host Whistle runtime holding the host's own commands. Parakeet
|
|
73
78
|
* adds its built-ins and the Session's advertised commands to it, and makes
|
|
@@ -76,6 +81,6 @@ export type ParakeetViewProps = Readonly<{
|
|
|
76
81
|
commands?: ParakeetCommandRuntime | undefined;
|
|
77
82
|
}>;
|
|
78
83
|
/** Render the retained conversation surface within one Parakeet provider. */
|
|
79
|
-
export declare function ParakeetView({ disambiguateAuthors, visitor, composerActionVariant, empty, commands, renderToolActions, claimsToolMedia, renderAssistantAttachment, formatAssistantText, onLink, onOpen, }: ParakeetViewProps): ReactElement;
|
|
84
|
+
export declare function ParakeetView({ disambiguateAuthors, visitor, composerActionVariant, empty, hostFacts, commands, renderToolActions, claimsToolMedia, renderAssistantAttachment, formatAssistantText, onLink, onOpen, }: ParakeetViewProps): ReactElement;
|
|
80
85
|
/** Standalone typed composer and exact-message timeline. */
|
|
81
|
-
export declare function Parakeet({ authorOf, disambiguateAuthors, visitor, markdownPolicy, composerActionVariant, empty, session, clients, renderToolActions, claimsToolMedia, renderAssistantAttachment, formatAssistantText, commands, onLink, onOpen, }: ParakeetProps): ReactElement;
|
|
86
|
+
export declare function Parakeet({ authorOf, disambiguateAuthors, visitor, markdownPolicy, composerActionVariant, empty, hostFacts, session, clients, renderToolActions, claimsToolMedia, renderAssistantAttachment, formatAssistantText, commands, onLink, onOpen, }: ParakeetProps): ReactElement;
|
package/dist/parakeet.js
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { Button } from "@fungi.computer/caps/components/button";
|
|
3
|
+
import { SetupNotice } from "@fungi.computer/caps/blocks/setup-notice";
|
|
4
|
+
import { EmptyState } from "@fungi.computer/caps/blocks/empty-state";
|
|
5
|
+
import { ParakeetHostFactsContext, } from "./host-facts.js";
|
|
3
6
|
import { Dialog, DialogContent } from "@fungi.computer/caps/components/dialog";
|
|
4
7
|
import { ScrollToBottomBlob } from "@fungi.computer/caps/components/scroll-to-bottom-blob";
|
|
5
8
|
import { createWhistle } from "@fungi.computer/whistle";
|
|
6
9
|
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
7
|
-
import { useCallback, useEffect, useMemo, useRef, useState, } from "react";
|
|
10
|
+
import { useCallback, useContext, useEffect, useMemo, useRef, useState, } from "react";
|
|
8
11
|
import { ParakeetProvider, useComposer, useClientContributions, useDismissFailedPrompt, useStatus, useTimeline, } from "./conversation.js";
|
|
9
12
|
import { awaitingTakeover } from "./core/awaiting-answer.js";
|
|
10
13
|
import { initialToolDisclosure, toggleDisclosure } from "./core/tool-groups.js";
|
|
@@ -19,7 +22,7 @@ import { useSlashCommands, } from "./commands/use-slash-commands.js";
|
|
|
19
22
|
import { TimelineItem } from "./components/TimelineItem.js";
|
|
20
23
|
import { MarkdownPolicyContext } from "./components/MarkdownRenderer.js";
|
|
21
24
|
/** Render the retained conversation surface within one Parakeet provider. */
|
|
22
|
-
export function ParakeetView({ disambiguateAuthors, visitor, composerActionVariant, empty, commands, renderToolActions, claimsToolMedia, renderAssistantAttachment, formatAssistantText, onLink, onOpen, }) {
|
|
25
|
+
export function ParakeetView({ disambiguateAuthors, visitor, composerActionVariant, empty, hostFacts, commands, renderToolActions, claimsToolMedia, renderAssistantAttachment, formatAssistantText, onLink, onOpen, }) {
|
|
23
26
|
const textareaRef = useRef(null);
|
|
24
27
|
const [ownCommands] = useState(() => createWhistle());
|
|
25
28
|
const slash = useSlashCommands({
|
|
@@ -40,46 +43,47 @@ export function ParakeetView({ disambiguateAuthors, visitor, composerActionVaria
|
|
|
40
43
|
timelineController.commandAnchors,
|
|
41
44
|
timelineController.positionAnchors,
|
|
42
45
|
]);
|
|
43
|
-
return (_jsxs("div", { className: "parakeet flex h-full flex-col items-stretch", "data-parakeet": "standalone", "data-testid": "parakeet-view", onClickCapture: (event) => {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
46
|
+
return (_jsx(ParakeetHostFactsContext.Provider, { value: hostFacts ?? noHostFacts, children: _jsxs("div", { className: "parakeet flex h-full flex-col items-stretch", "data-parakeet": "standalone", "data-testid": "parakeet-view", onClickCapture: (event) => {
|
|
47
|
+
const anchor = event.target instanceof Element
|
|
48
|
+
? event.target.closest("a[href]")
|
|
49
|
+
: null;
|
|
50
|
+
if (anchor instanceof HTMLAnchorElement && onLink?.(anchor.href))
|
|
51
|
+
event.preventDefault();
|
|
52
|
+
}, children: [_jsxs("div", { className: "flex h-full w-full flex-col border-r border-base-300", children: [_jsx(ConversationTimeline, { disambiguateAuthors: visitor === undefined && disambiguateAuthors === true, clientActions: clientActions, onOpen: onOpen, focusAfterJump: textareaRef, empty: empty, renderToolActions: renderToolActions, claimsToolMedia: claimsToolMedia, renderAssistantAttachment: renderAssistantAttachment, formatAssistantText: formatAssistantText }), contributions.some(({ entryId, value }) => value.panel.some((row) => JSON.stringify([entryId, row.id]) !== answering)) ? (_jsx("section", { "aria-label": "Session extension controls", className: "w-full shrink-0 border-t border-base-300 bg-base-100", children: contributions.map(({ entryId, value: contribution }) => {
|
|
53
|
+
const value = {
|
|
54
|
+
...contribution,
|
|
55
|
+
panel: contribution.panel.filter((row) => JSON.stringify([entryId, row.id]) !== answering),
|
|
56
|
+
};
|
|
57
|
+
// An extension's retained-event notice and null-anchor rows
|
|
58
|
+
// join its own footer entry; one with no panel row here keeps
|
|
59
|
+
// none of this, rather than growing a section just to show it.
|
|
60
|
+
const omittedHere = value.panel.length === 0
|
|
61
|
+
? undefined
|
|
62
|
+
: placed.omitted.find((entry) => entry.entryId === entryId);
|
|
63
|
+
const unanchoredHere = value.panel.length === 0
|
|
64
|
+
? []
|
|
65
|
+
: placed.unanchored
|
|
66
|
+
.filter((entry) => entry.entryId === entryId)
|
|
67
|
+
.flatMap(({ cell }) => cell.rows.map((row) => ({
|
|
68
|
+
...row,
|
|
69
|
+
id: `unanchored:${cell.id}:${row.id}`,
|
|
70
|
+
})));
|
|
71
|
+
return (_jsx(ClientRows, { entryId: entryId, rows: [
|
|
72
|
+
...value.panel,
|
|
73
|
+
...(omittedHere === undefined
|
|
74
|
+
? []
|
|
75
|
+
: [
|
|
76
|
+
{
|
|
77
|
+
id: `omitted:${entryId}`,
|
|
78
|
+
title: `${String(omittedHere.count)} earlier change${omittedHere.count === 1 ? "" : "s"} omitted`,
|
|
79
|
+
tone: "muted",
|
|
80
|
+
},
|
|
81
|
+
]),
|
|
82
|
+
...unanchoredHere,
|
|
83
|
+
], actions: clientActions, onOpen: onOpen }, entryId));
|
|
84
|
+
}) })) : null, _jsx(ConversationWaiting, { clientActions: clientActions }), _jsx(ConversationComposer, { visitor: visitor, textareaRef: textareaRef, composerActionVariant: composerActionVariant, slash: slash })] }), visitor === undefined ? (_jsx(ConversationInteraction, { slash: slash })) : null] }) }));
|
|
82
85
|
}
|
|
86
|
+
const noHostFacts = {};
|
|
83
87
|
const busyStatuses = new Set([
|
|
84
88
|
"cancelling",
|
|
85
89
|
"queued",
|
|
@@ -217,7 +221,25 @@ function ConversationTimeline({ disambiguateAuthors, clientActions, onOpen, focu
|
|
|
217
221
|
},
|
|
218
222
|
}
|
|
219
223
|
: item, onDismissFailed: dismissFailed, onCancelQueued: cancelQueued, cancellingQueued: timelineController.cancellingQueued, onToggleTool: toggleTool, renderToolActions: renderToolActions, claimsToolMedia: claimsToolMedia, renderAssistantAttachment: renderAssistantAttachment, formatAssistantText: formatAssistantText, toolDisclosure: toolDisclosure }), placed.after.get(item.id)?.map(({ entryId, cell }) => (_jsx(ClientRows, { entryId: entryId, rows: cell.rows, actions: clientActions, onOpen: onOpen }, `${entryId}:${cell.id}`)))] }, virtualItem.key));
|
|
220
|
-
}) })) : before.length > 0 ? (before) : hasMoreHistory ? null : ((empty ??
|
|
224
|
+
}) })) : before.length > 0 ? (before) : hasMoreHistory ? null : ((empty ?? _jsx(ConversationStarters, {}))) }), count > 0 ? (_jsx(ScrollToBottomBlob, { direction: "forward", unread: unread, focusAfterJump: focusAfterJump, onJump: jumpToBottom, scrollerRef: scrollerRef })) : null] }));
|
|
225
|
+
}
|
|
226
|
+
/** The empty conversation: host starter chips when there are any, the quiet prompt otherwise. */
|
|
227
|
+
function ConversationStarters() {
|
|
228
|
+
const { modelSetup, starters } = useContext(ParakeetHostFactsContext);
|
|
229
|
+
const composer = useComposer();
|
|
230
|
+
// Known up front, before any run: say so once, with the fix as the one action.
|
|
231
|
+
if (modelSetup?.state === "missing")
|
|
232
|
+
return (_jsx("div", { className: "flex h-full items-center justify-center", children: _jsx(SetupNotice, { cause: "No model is connected to this workspace yet.", fix: modelSetup.fix, need: "Connect a model to start", variant: "panel" }) }));
|
|
233
|
+
if (starters === undefined || starters.length === 0)
|
|
234
|
+
return (_jsx("div", { className: "flex h-full items-center justify-center text-center", children: _jsxs("div", { children: [_jsx("p", { className: "mb-1 text-xs text-base-content", children: "Ready" }), _jsx("p", { className: "text-[10px] text-dim", children: "What would you like to build?" })] }) }));
|
|
235
|
+
return (_jsx("div", { className: "flex h-full items-center justify-center", children: _jsx(EmptyState, { description: "Pick one to start, or type your own below.", suggestions: starters.map((prompt) => ({
|
|
236
|
+
label: prompt,
|
|
237
|
+
onSelect: () => {
|
|
238
|
+
// Same path as typing it: the draft is the prompt, then it sends.
|
|
239
|
+
composer.setDraft(prompt);
|
|
240
|
+
composer.send();
|
|
241
|
+
},
|
|
242
|
+
})), title: "What would you like to do?", variant: "quiet" }) }));
|
|
221
243
|
}
|
|
222
244
|
/** Independently contributed waiting controls; queued messages stay in the transcript. */
|
|
223
245
|
function ConversationWaiting({ clientActions, }) {
|
|
@@ -235,6 +257,7 @@ function ConversationWaiting({ clientActions, }) {
|
|
|
235
257
|
}, children: extensionWaiting.value.waiting.cancel.label })] })) }));
|
|
236
258
|
}
|
|
237
259
|
function ConversationComposer({ visitor, textareaRef, composerActionVariant, slash, }) {
|
|
260
|
+
const hostFacts = useContext(ParakeetHostFactsContext);
|
|
238
261
|
const composer = useComposer();
|
|
239
262
|
const sessionStatus = useStatus();
|
|
240
263
|
const contributions = useClientContributions();
|
|
@@ -266,6 +289,10 @@ function ConversationComposer({ visitor, textareaRef, composerActionVariant, sla
|
|
|
266
289
|
onSend: slash.submit,
|
|
267
290
|
slash: visitor === undefined ? slash : undefined,
|
|
268
291
|
placeholder: visitor === undefined ? undefined : `Ask ${visitor.agentName}…`,
|
|
292
|
+
// No model means no reply: say why instead of taking a prompt that cannot work.
|
|
293
|
+
disabledReason: hostFacts.modelSetup?.state === "missing"
|
|
294
|
+
? "Connect a model to start chatting"
|
|
295
|
+
: undefined,
|
|
269
296
|
showFooter: visitor === undefined,
|
|
270
297
|
status: sessionStatus.status,
|
|
271
298
|
viewState: sessionStatus.viewState,
|
|
@@ -277,6 +304,6 @@ function ConversationComposer({ visitor, textareaRef, composerActionVariant, sla
|
|
|
277
304
|
return _jsx(ChatComposer, { ...composerProps });
|
|
278
305
|
}
|
|
279
306
|
/** Standalone typed composer and exact-message timeline. */
|
|
280
|
-
export function Parakeet({ authorOf, disambiguateAuthors, visitor, markdownPolicy = "session", composerActionVariant, empty, session, clients, renderToolActions, claimsToolMedia, renderAssistantAttachment, formatAssistantText, commands, onLink, onOpen, }) {
|
|
281
|
-
return (_jsx(MarkdownPolicyContext.Provider, { value: markdownPolicy, children: _jsx(ParakeetProvider, { session: session, clients: clients, authorOf: authorOf, children: _jsx(ParakeetView, { disambiguateAuthors: disambiguateAuthors, visitor: visitor, composerActionVariant: composerActionVariant, empty: empty, renderToolActions: renderToolActions, claimsToolMedia: claimsToolMedia, renderAssistantAttachment: renderAssistantAttachment, formatAssistantText: formatAssistantText, commands: commands, onLink: onLink, onOpen: onOpen }) }) }));
|
|
307
|
+
export function Parakeet({ authorOf, disambiguateAuthors, visitor, markdownPolicy = "session", composerActionVariant, empty, hostFacts, session, clients, renderToolActions, claimsToolMedia, renderAssistantAttachment, formatAssistantText, commands, onLink, onOpen, }) {
|
|
308
|
+
return (_jsx(MarkdownPolicyContext.Provider, { value: markdownPolicy, children: _jsx(ParakeetProvider, { session: session, clients: clients, authorOf: authorOf, children: _jsx(ParakeetView, { disambiguateAuthors: disambiguateAuthors, visitor: visitor, composerActionVariant: composerActionVariant, empty: empty, hostFacts: hostFacts, renderToolActions: renderToolActions, claimsToolMedia: claimsToolMedia, renderAssistantAttachment: renderAssistantAttachment, formatAssistantText: formatAssistantText, commands: commands, onLink: onLink, onOpen: onOpen }) }) }));
|
|
282
309
|
}
|
package/dist/styles.css
CHANGED
|
@@ -6421,9 +6421,6 @@
|
|
|
6421
6421
|
.max-h-72 {
|
|
6422
6422
|
max-height: calc(var(--spacing) * 72);
|
|
6423
6423
|
}
|
|
6424
|
-
.max-h-screen {
|
|
6425
|
-
max-height: 100vh;
|
|
6426
|
-
}
|
|
6427
6424
|
.min-h-0 {
|
|
6428
6425
|
min-height: calc(var(--spacing) * 0);
|
|
6429
6426
|
}
|
|
@@ -6450,9 +6447,6 @@
|
|
|
6450
6447
|
.w-8 {
|
|
6451
6448
|
width: calc(var(--spacing) * 8);
|
|
6452
6449
|
}
|
|
6453
|
-
.w-11\/12 {
|
|
6454
|
-
width: calc(11 / 12 * 100%);
|
|
6455
|
-
}
|
|
6456
6450
|
.w-12 {
|
|
6457
6451
|
width: calc(var(--spacing) * 12);
|
|
6458
6452
|
}
|
|
@@ -6468,9 +6462,6 @@
|
|
|
6468
6462
|
.w-px {
|
|
6469
6463
|
width: 1px;
|
|
6470
6464
|
}
|
|
6471
|
-
.max-w-\(--container-lg\) {
|
|
6472
|
-
max-width: var(--container-lg);
|
|
6473
|
-
}
|
|
6474
6465
|
.max-w-\(--container-xs\) {
|
|
6475
6466
|
max-width: var(--container-xs);
|
|
6476
6467
|
}
|
|
@@ -6638,6 +6629,9 @@
|
|
|
6638
6629
|
.gap-2 {
|
|
6639
6630
|
gap: calc(var(--spacing) * 2);
|
|
6640
6631
|
}
|
|
6632
|
+
.gap-3 {
|
|
6633
|
+
gap: calc(var(--spacing) * 3);
|
|
6634
|
+
}
|
|
6641
6635
|
.gap-lg {
|
|
6642
6636
|
gap: var(--spacing-lg);
|
|
6643
6637
|
}
|
|
@@ -9203,6 +9197,101 @@
|
|
|
9203
9197
|
position: static;
|
|
9204
9198
|
flex: none;
|
|
9205
9199
|
}
|
|
9200
|
+
@layer utilities {
|
|
9201
|
+
.caps-setup-notice-frame {
|
|
9202
|
+
container-type: inline-size;
|
|
9203
|
+
}
|
|
9204
|
+
.caps-setup-notice-title {
|
|
9205
|
+
display: flex;
|
|
9206
|
+
align-items: center;
|
|
9207
|
+
gap: var(--spacing-sm);
|
|
9208
|
+
}
|
|
9209
|
+
.caps-setup-notice[data-variant] {
|
|
9210
|
+
border-color: var(--color-warning);
|
|
9211
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
9212
|
+
border-color: color-mix(in oklab, var(--color-warning) 45%, transparent);
|
|
9213
|
+
}
|
|
9214
|
+
background: var(--color-warning);
|
|
9215
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
9216
|
+
background: color-mix( in oklab, var(--color-warning) 12%, var(--stipe-surface-raised) );
|
|
9217
|
+
}
|
|
9218
|
+
color: var(--color-base-content);
|
|
9219
|
+
}
|
|
9220
|
+
.caps-setup-notice-actions {
|
|
9221
|
+
display: flex;
|
|
9222
|
+
flex-wrap: wrap;
|
|
9223
|
+
align-items: center;
|
|
9224
|
+
justify-content: flex-end;
|
|
9225
|
+
gap: var(--spacing-xs);
|
|
9226
|
+
}
|
|
9227
|
+
.caps-setup-notice-dot {
|
|
9228
|
+
margin-block: var(--spacing-md);
|
|
9229
|
+
scale: 2.5;
|
|
9230
|
+
}
|
|
9231
|
+
.caps-setup-notice-available {
|
|
9232
|
+
color: var(--stipe-fg-muted);
|
|
9233
|
+
}
|
|
9234
|
+
.caps-setup-notice[data-variant="inline"] {
|
|
9235
|
+
padding: var(--spacing-xs) var(--spacing-sm);
|
|
9236
|
+
font-size: var(--text-sm);
|
|
9237
|
+
}
|
|
9238
|
+
.caps-setup-notice[data-variant="banner"] {
|
|
9239
|
+
border-radius: 0;
|
|
9240
|
+
border-inline: 0;
|
|
9241
|
+
}
|
|
9242
|
+
@container (width <= 36rem) {
|
|
9243
|
+
.caps-setup-notice[data-variant] {
|
|
9244
|
+
flex-direction: column;
|
|
9245
|
+
align-items: stretch;
|
|
9246
|
+
}
|
|
9247
|
+
.caps-setup-notice[data-variant] > * {
|
|
9248
|
+
flex: none;
|
|
9249
|
+
width: 100%;
|
|
9250
|
+
}
|
|
9251
|
+
.caps-setup-notice-actions {
|
|
9252
|
+
justify-content: flex-start;
|
|
9253
|
+
}
|
|
9254
|
+
}
|
|
9255
|
+
.caps-failure-line {
|
|
9256
|
+
display: flex;
|
|
9257
|
+
align-items: flex-start;
|
|
9258
|
+
gap: var(--spacing-sm);
|
|
9259
|
+
min-width: 0;
|
|
9260
|
+
font-size: var(--text-sm);
|
|
9261
|
+
}
|
|
9262
|
+
.caps-failure-line-copy {
|
|
9263
|
+
display: grid;
|
|
9264
|
+
flex: 1;
|
|
9265
|
+
min-width: 0;
|
|
9266
|
+
gap: var(--spacing-2xs);
|
|
9267
|
+
}
|
|
9268
|
+
.caps-failure-line-count {
|
|
9269
|
+
color: var(--stipe-fg-muted);
|
|
9270
|
+
font-size: var(--text-xs);
|
|
9271
|
+
}
|
|
9272
|
+
.caps-failure-line > .caps-status {
|
|
9273
|
+
margin-block-start: var(--spacing-2xs);
|
|
9274
|
+
}
|
|
9275
|
+
.caps-failure-line-actions {
|
|
9276
|
+
display: flex;
|
|
9277
|
+
flex: none;
|
|
9278
|
+
gap: var(--spacing-2xs);
|
|
9279
|
+
}
|
|
9280
|
+
.caps-failure-line[data-density="tile"] {
|
|
9281
|
+
flex-direction: column;
|
|
9282
|
+
align-items: center;
|
|
9283
|
+
justify-content: center;
|
|
9284
|
+
height: 100%;
|
|
9285
|
+
padding: var(--spacing-md);
|
|
9286
|
+
text-align: center;
|
|
9287
|
+
}
|
|
9288
|
+
.caps-failure-line[data-density="tile"] > .caps-status {
|
|
9289
|
+
margin-block-start: 0;
|
|
9290
|
+
}
|
|
9291
|
+
.caps-failure-line[data-density="tile"] .caps-failure-line-copy {
|
|
9292
|
+
flex: none;
|
|
9293
|
+
}
|
|
9294
|
+
}
|
|
9206
9295
|
:root, [data-theme] {
|
|
9207
9296
|
--caps-primary-text: light-dark(
|
|
9208
9297
|
oklch(from var(--color-primary) clamp(0.2, l, 0.4) c h),
|
|
@@ -9222,6 +9311,130 @@
|
|
|
9222
9311
|
.caps-toaster[data-sonner-toaster] {
|
|
9223
9312
|
z-index: var(--stipe-layer-toast);
|
|
9224
9313
|
}
|
|
9314
|
+
.caps-toaster[data-sonner-toaster][data-sonner-theme] {
|
|
9315
|
+
font-family: inherit;
|
|
9316
|
+
--border-radius: var(--radius-box);
|
|
9317
|
+
--normal-bg: var(--stipe-surface-raised);
|
|
9318
|
+
--normal-bg-hover: var(--color-base-200);
|
|
9319
|
+
--normal-border: var(--stipe-hairline-quiet);
|
|
9320
|
+
--normal-border-hover: var(--stipe-hairline);
|
|
9321
|
+
--normal-text: var(--color-base-content);
|
|
9322
|
+
--success-bg: var(--color-success);
|
|
9323
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
9324
|
+
--success-bg: color-mix(
|
|
9325
|
+
in oklab,
|
|
9326
|
+
var(--color-success) 10%,
|
|
9327
|
+
var(--stipe-surface-raised)
|
|
9328
|
+
);
|
|
9329
|
+
}
|
|
9330
|
+
--success-border: var(--color-success);
|
|
9331
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
9332
|
+
--success-border: color-mix(in oklab, var(--color-success) 35%, transparent);
|
|
9333
|
+
}
|
|
9334
|
+
--success-text: var(--color-base-content);
|
|
9335
|
+
--info-bg: var(--color-info);
|
|
9336
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
9337
|
+
--info-bg: color-mix(
|
|
9338
|
+
in oklab,
|
|
9339
|
+
var(--color-info) 10%,
|
|
9340
|
+
var(--stipe-surface-raised)
|
|
9341
|
+
);
|
|
9342
|
+
}
|
|
9343
|
+
--info-border: var(--color-info);
|
|
9344
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
9345
|
+
--info-border: color-mix(in oklab, var(--color-info) 35%, transparent);
|
|
9346
|
+
}
|
|
9347
|
+
--info-text: var(--color-base-content);
|
|
9348
|
+
--warning-bg: var(--color-warning);
|
|
9349
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
9350
|
+
--warning-bg: color-mix(
|
|
9351
|
+
in oklab,
|
|
9352
|
+
var(--color-warning) 12%,
|
|
9353
|
+
var(--stipe-surface-raised)
|
|
9354
|
+
);
|
|
9355
|
+
}
|
|
9356
|
+
--warning-border: var(--color-warning);
|
|
9357
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
9358
|
+
--warning-border: color-mix(in oklab, var(--color-warning) 40%, transparent);
|
|
9359
|
+
}
|
|
9360
|
+
--warning-text: var(--color-base-content);
|
|
9361
|
+
--error-bg: var(--color-error);
|
|
9362
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
9363
|
+
--error-bg: color-mix(
|
|
9364
|
+
in oklab,
|
|
9365
|
+
var(--color-error) 10%,
|
|
9366
|
+
var(--stipe-surface-raised)
|
|
9367
|
+
);
|
|
9368
|
+
}
|
|
9369
|
+
--error-border: var(--color-error);
|
|
9370
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
9371
|
+
--error-border: color-mix(in oklab, var(--color-error) 40%, transparent);
|
|
9372
|
+
}
|
|
9373
|
+
--error-text: var(--color-base-content);
|
|
9374
|
+
}
|
|
9375
|
+
.caps-toaster[data-sonner-toaster] [data-sonner-toast][data-styled="true"] {
|
|
9376
|
+
font-size: var(--text-sm);
|
|
9377
|
+
line-height: 1.35;
|
|
9378
|
+
box-shadow: 0 0.25rem 0.75rem var(--color-base-content);
|
|
9379
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
9380
|
+
box-shadow: 0 0.25rem 0.75rem color-mix( in oklab, var(--color-base-content) calc(var(--depth) * 14%), transparent );
|
|
9381
|
+
}
|
|
9382
|
+
}
|
|
9383
|
+
.caps-toaster[data-sonner-toaster] [data-sonner-toast][data-styled] {
|
|
9384
|
+
align-items: flex-start;
|
|
9385
|
+
font-family: inherit;
|
|
9386
|
+
}
|
|
9387
|
+
.caps-toaster[data-sonner-toaster] [data-sonner-toast][data-styled] [data-icon] {
|
|
9388
|
+
align-items: center;
|
|
9389
|
+
height: calc(var(--text-sm) * 1.35);
|
|
9390
|
+
margin: 0;
|
|
9391
|
+
}
|
|
9392
|
+
.caps-toaster[data-sonner-toaster] [data-sonner-toast][data-styled] [data-description] {
|
|
9393
|
+
color: var(--color-base-content);
|
|
9394
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
9395
|
+
color: color-mix(in oklab, var(--color-base-content) 78%, transparent);
|
|
9396
|
+
}
|
|
9397
|
+
}
|
|
9398
|
+
.caps-toaster[data-sonner-toaster] [data-sonner-toast][data-styled] [data-close-button] {
|
|
9399
|
+
position: static;
|
|
9400
|
+
order: 99;
|
|
9401
|
+
align-self: flex-start;
|
|
9402
|
+
margin-inline-start: auto;
|
|
9403
|
+
transform: none;
|
|
9404
|
+
flex: none;
|
|
9405
|
+
}
|
|
9406
|
+
.caps-toaster[data-sonner-toaster] [data-sonner-toast][data-styled] [data-icon] {
|
|
9407
|
+
color: var(--color-base-content);
|
|
9408
|
+
}
|
|
9409
|
+
.caps-toaster[data-sonner-toaster] [data-sonner-toast][data-styled][data-type="success"] [data-icon] {
|
|
9410
|
+
color: var(--color-success);
|
|
9411
|
+
}
|
|
9412
|
+
.caps-toaster[data-sonner-toaster] [data-sonner-toast][data-styled][data-type="error"] [data-icon] {
|
|
9413
|
+
color: var(--color-error);
|
|
9414
|
+
}
|
|
9415
|
+
.caps-toaster[data-sonner-toaster] [data-sonner-toast][data-styled][data-type="warning"] [data-icon] {
|
|
9416
|
+
color: var(--color-warning);
|
|
9417
|
+
}
|
|
9418
|
+
.caps-toaster[data-sonner-toaster] [data-sonner-toast][data-styled][data-type="info"] [data-icon] {
|
|
9419
|
+
color: var(--color-info);
|
|
9420
|
+
}
|
|
9421
|
+
.caps-toaster[data-sonner-toaster] [data-sonner-toast][data-styled] [data-close-button] {
|
|
9422
|
+
width: 1.25rem;
|
|
9423
|
+
height: 1.25rem;
|
|
9424
|
+
color: var(--color-base-content);
|
|
9425
|
+
background: var(--stipe-surface-raised);
|
|
9426
|
+
border: var(--border) solid var(--stipe-hairline);
|
|
9427
|
+
transition-duration: var(--stipe-motion-fast);
|
|
9428
|
+
}
|
|
9429
|
+
.caps-toaster[data-sonner-toaster] [data-sonner-toast][data-styled] [data-close-button]:hover {
|
|
9430
|
+
background: var(--color-base-200);
|
|
9431
|
+
border-color: var(--stipe-hairline);
|
|
9432
|
+
}
|
|
9433
|
+
.caps-toaster[data-sonner-toaster] [data-sonner-toast][data-styled] [data-close-button]:focus-visible {
|
|
9434
|
+
outline: 2px solid var(--caps-focus-ring);
|
|
9435
|
+
outline-offset: 1px;
|
|
9436
|
+
box-shadow: none;
|
|
9437
|
+
}
|
|
9225
9438
|
@layer caps-dropdown {
|
|
9226
9439
|
.caps-dropdown-popup {
|
|
9227
9440
|
max-height: var(--available-height);
|
|
@@ -10617,6 +10830,11 @@
|
|
|
10617
10830
|
.caps-shortcuts dt, .caps-shortcuts dd {
|
|
10618
10831
|
margin: 0;
|
|
10619
10832
|
}
|
|
10833
|
+
.caps-dialog-popup-default {
|
|
10834
|
+
width: min( var(--container-lg), calc( 100% - max(1rem, env(safe-area-inset-left)) - max(1rem, env(safe-area-inset-right)) ) );
|
|
10835
|
+
max-width: none;
|
|
10836
|
+
max-height: calc( 100dvh - max(1rem, env(safe-area-inset-top)) - max(1rem, env(safe-area-inset-bottom)) );
|
|
10837
|
+
}
|
|
10620
10838
|
dialog.caps-surface {
|
|
10621
10839
|
color: inherit;
|
|
10622
10840
|
}
|
|
@@ -17175,6 +17393,23 @@
|
|
|
17175
17393
|
min-width: var(--caps-keycap-label-min-width, auto);
|
|
17176
17394
|
line-height: var(--caps-keycap-label-line-height, inherit);
|
|
17177
17395
|
}
|
|
17396
|
+
.caps-keycap[data-size="hint"] {
|
|
17397
|
+
display: inline-block;
|
|
17398
|
+
min-width: 0;
|
|
17399
|
+
min-height: 0;
|
|
17400
|
+
margin-inline: var(--spacing-2xs);
|
|
17401
|
+
padding: 0 var(--spacing-2xs);
|
|
17402
|
+
border-radius: var(--radius-selector);
|
|
17403
|
+
border-color: var(--stipe-hairline-quiet);
|
|
17404
|
+
background: transparent;
|
|
17405
|
+
box-shadow: none;
|
|
17406
|
+
color: var(--color-base-content);
|
|
17407
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
17408
|
+
color: color-mix(in oklab, var(--color-base-content) 65%, transparent);
|
|
17409
|
+
}
|
|
17410
|
+
font-size: var(--text-xs);
|
|
17411
|
+
line-height: 1.25;
|
|
17412
|
+
}
|
|
17178
17413
|
.caps-keycap-button .caps-keycap {
|
|
17179
17414
|
flex: var(--caps-keycap-shortcut-flex, 0 1 auto);
|
|
17180
17415
|
min-width: var( --caps-keycap-shortcut-size, var(--caps-keycap-legend-min-size, 2rem) );
|
package/docs/api/index.md
CHANGED
|
@@ -531,6 +531,36 @@ Renderer-neutral presentation of one tool call and its joined result.
|
|
|
531
531
|
|
|
532
532
|
---
|
|
533
533
|
|
|
534
|
+
### ParakeetModelSetup
|
|
535
|
+
|
|
536
|
+
```ts
|
|
537
|
+
type ParakeetModelSetup = Readonly<{
|
|
538
|
+
state: "ready" | "missing" | "unknown";
|
|
539
|
+
fix: Readonly<{
|
|
540
|
+
label: string;
|
|
541
|
+
onSelect: () => void;
|
|
542
|
+
}>;
|
|
543
|
+
}>;
|
|
544
|
+
```
|
|
545
|
+
|
|
546
|
+
Whether a model is connected, with the one fix the host offers.
|
|
547
|
+
|
|
548
|
+
---
|
|
549
|
+
|
|
550
|
+
### ParakeetHostFacts
|
|
551
|
+
|
|
552
|
+
```ts
|
|
553
|
+
type ParakeetHostFacts = Readonly<{
|
|
554
|
+
modelSetup?: ParakeetModelSetup;
|
|
555
|
+
billing?: boolean;
|
|
556
|
+
starters?: readonly string[];
|
|
557
|
+
}>;
|
|
558
|
+
```
|
|
559
|
+
|
|
560
|
+
What the host knows that the conversation needs to speak plainly.
|
|
561
|
+
|
|
562
|
+
---
|
|
563
|
+
|
|
534
564
|
### ParakeetVisitor
|
|
535
565
|
|
|
536
566
|
```ts
|
|
@@ -561,6 +591,7 @@ type ParakeetProps = Readonly<{
|
|
|
561
591
|
onLink?: (href) => boolean;
|
|
562
592
|
onOpen?: (target) => void;
|
|
563
593
|
empty?: ReactNode;
|
|
594
|
+
hostFacts?: ParakeetHostFacts;
|
|
564
595
|
commands?: ParakeetCommandRuntime;
|
|
565
596
|
}>;
|
|
566
597
|
```
|
|
@@ -583,6 +614,7 @@ type ParakeetViewProps = Readonly<{
|
|
|
583
614
|
onLink?: (href) => boolean;
|
|
584
615
|
onOpen?: (target) => void;
|
|
585
616
|
empty?: ReactNode;
|
|
617
|
+
hostFacts?: ParakeetHostFacts;
|
|
586
618
|
commands?: ParakeetCommandRuntime;
|
|
587
619
|
}>;
|
|
588
620
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fungi.computer/parakeet",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"author": "Levi <levi@technomancy.dev>",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Standalone React composer for a typed Shiitake Session",
|
|
@@ -60,16 +60,16 @@
|
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
62
|
"@earendil-works/pi-ai": "1.3.0",
|
|
63
|
-
"@fungi.computer/agar": "0.
|
|
63
|
+
"@fungi.computer/agar": "0.9.0",
|
|
64
64
|
"@fungi.computer/bird-dog": "0.3.6",
|
|
65
65
|
"@fungi.computer/cairn": "0.1.0",
|
|
66
|
-
"@fungi.computer/caps": "0.
|
|
67
|
-
"@fungi.computer/gills": "0.
|
|
68
|
-
"@fungi.computer/knapsack": "0.4.
|
|
69
|
-
"@fungi.computer/shiitake": "0.12.
|
|
66
|
+
"@fungi.computer/caps": "0.9.0",
|
|
67
|
+
"@fungi.computer/gills": "0.3.0",
|
|
68
|
+
"@fungi.computer/knapsack": "0.4.9",
|
|
69
|
+
"@fungi.computer/shiitake": "0.12.3",
|
|
70
70
|
"@fungi.computer/sigils": "0.3.0",
|
|
71
|
-
"@fungi.computer/sprite": "0.2.
|
|
72
|
-
"@fungi.computer/sprite-zdog": "0.3.
|
|
71
|
+
"@fungi.computer/sprite": "0.2.2",
|
|
72
|
+
"@fungi.computer/sprite-zdog": "0.3.2",
|
|
73
73
|
"@fungi.computer/whistle": "0.3.0",
|
|
74
74
|
"@tanstack/markdown": "0.0.12",
|
|
75
75
|
"@tanstack/react-virtual": "3.14.10",
|