@fungi.computer/parakeet 0.8.2 → 0.9.1
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/dist/components/ChatComposer.js +11 -4
- package/dist/core/session-query.d.ts +4 -0
- package/dist/headless.d.ts +1 -1
- package/dist/headless.js +1 -1
- package/dist/model-commands.d.ts +5 -15
- package/dist/model-commands.js +27 -1
- package/dist/session-commands.d.ts +4 -2
- package/dist/session-commands.js +11 -3
- package/docs/api/headless.md +186 -12
- package/package.json +6 -6
|
@@ -271,6 +271,7 @@ function useComposerRow({ showFooter, statusChips, model, status, viewState, usa
|
|
|
271
271
|
const label = sessionReadout("idle", viewState);
|
|
272
272
|
const needsAttention = viewState.kind === "waiting_for_you" || viewState.kind === "error";
|
|
273
273
|
const modelName = model === undefined ? undefined : composerModelName(model);
|
|
274
|
+
const canPickModel = slash?.available("model") === true;
|
|
274
275
|
const contextText = context === undefined ? undefined : formatContextUsage(context);
|
|
275
276
|
const usageText = usage === undefined
|
|
276
277
|
? undefined
|
|
@@ -287,7 +288,10 @@ function useComposerRow({ showFooter, statusChips, model, status, viewState, usa
|
|
|
287
288
|
label: (_jsxs("span", { className: "composer-settings-chip", children: [_jsx(SlidersHorizontal, { "aria-hidden": "true" }), "Settings"] })),
|
|
288
289
|
accessibleLabel: "Session settings",
|
|
289
290
|
title: "Settings",
|
|
290
|
-
content: (_jsxs(StatusTrayList, { className: "composer-settings", children: [modelName === undefined ? null : (_jsx(StatusTrayRow, { primary: "Model", secondary: modelName
|
|
291
|
+
content: (_jsxs(StatusTrayList, { className: "composer-settings", children: [modelName === undefined ? null : (_jsx(StatusTrayRow, { primary: "Model", secondary: modelName, actions: canPickModel ? (_jsx(Button, { size: "xs", variant: "ghost", onClick: () => {
|
|
292
|
+
setOpenId(null);
|
|
293
|
+
slash.runCommand("model");
|
|
294
|
+
}, children: "Open" })) : undefined })), contextText === undefined ? null : (_jsx(StatusTrayRow, { primary: "Context", secondary: contextText, title: "Context used / model context" })), usageText === undefined ? null : (_jsx(StatusTrayRow, { primary: "Usage", secondary: usageText })), commands.map(({ alias, label: commandLabel }) => (_jsx(StatusTrayRow, { primary: commandLabel, actions: _jsx(Button, { size: "xs", variant: "ghost", onClick: () => {
|
|
291
295
|
setOpenId(null);
|
|
292
296
|
slash?.runCommand(alias);
|
|
293
297
|
}, children: "Open" }) }, alias)))] })),
|
|
@@ -298,9 +302,12 @@ function useComposerRow({ showFooter, statusChips, model, status, viewState, usa
|
|
|
298
302
|
openId,
|
|
299
303
|
onOpenChange: setOpenId,
|
|
300
304
|
action: send,
|
|
301
|
-
controls: (_jsxs(_Fragment, { children: [attach, modelName === undefined ? null : (_jsx(ComposerModelKey, { "aria-label": `Model: ${modelName}. Open settings`, "aria-haspopup": "dialog", expanded: openId === "settings", label: modelName, onClick: () => {
|
|
302
|
-
|
|
303
|
-
|
|
305
|
+
controls: (_jsxs(_Fragment, { children: [attach, modelName === undefined ? null : (_jsx(ComposerModelKey, { "aria-label": `Model: ${modelName}. ${canPickModel ? "Change model" : "Open settings"}`, "aria-haspopup": "dialog", ...(canPickModel ? {} : { expanded: openId === "settings" }), label: modelName, onClick: () => {
|
|
306
|
+
if (canPickModel)
|
|
307
|
+
slash.runCommand("model");
|
|
308
|
+
else
|
|
309
|
+
setOpenId((id) => (id === "settings" ? null : "settings"));
|
|
310
|
+
}, title: canPickModel ? "Change model" : `${modelName} · Settings` })), statusChips?.map((chip, index) => (_jsx("span", { className: "composer-status-chip min-w-0 truncate", title: chip, children: chip }, index)))] })),
|
|
304
311
|
status: needsAttention ? (_jsx(Status, { className: "parakeet-composer-status", label: _jsx("span", { className: "composer-attention-label", children: label }), title: label, tone: tone })) : null,
|
|
305
312
|
readout: usageText === undefined ? undefined : (_jsx("span", { title: "Tokens \u00B7 cost", children: usageText })),
|
|
306
313
|
};
|
|
@@ -86,6 +86,7 @@ export type SessionActivity = Readonly<{
|
|
|
86
86
|
export declare function subscribeSessionActivity(queryClient: QueryClient, session: ParakeetSession, listener: (activity: SessionActivity) => void, questionExtensionId: string | undefined): () => void;
|
|
87
87
|
/** Shared, demand-loaded history; the live watch remains a separate small tail. */
|
|
88
88
|
export declare function sessionHistoryQueryOptions(session: ParakeetSession, before?: string | null): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseInfiniteQueryOptions<Readonly<{
|
|
89
|
+
parent?: import("@fungi.computer/shiitake/extensions").AttentionRecipient;
|
|
89
90
|
sessionId: string;
|
|
90
91
|
cursor: string | null;
|
|
91
92
|
hasMore: boolean;
|
|
@@ -104,6 +105,7 @@ export declare function sessionHistoryQueryOptions(session: ParakeetSession, bef
|
|
|
104
105
|
context?: import("@fungi.computer/shiitake/client").SessionContext;
|
|
105
106
|
}>, Error, {
|
|
106
107
|
pages: Readonly<{
|
|
108
|
+
parent?: import("@fungi.computer/shiitake/extensions").AttentionRecipient;
|
|
107
109
|
sessionId: string;
|
|
108
110
|
cursor: string | null;
|
|
109
111
|
hasMore: boolean;
|
|
@@ -128,6 +130,7 @@ export declare function sessionHistoryQueryOptions(session: ParakeetSession, bef
|
|
|
128
130
|
newerOverflow: boolean;
|
|
129
131
|
}>>, "queryFn"> & {
|
|
130
132
|
queryFn?: import("@tanstack/react-query").QueryFunction<Readonly<{
|
|
133
|
+
parent?: import("@fungi.computer/shiitake/extensions").AttentionRecipient;
|
|
131
134
|
sessionId: string;
|
|
132
135
|
cursor: string | null;
|
|
133
136
|
hasMore: boolean;
|
|
@@ -150,6 +153,7 @@ export declare function sessionHistoryQueryOptions(session: ParakeetSession, bef
|
|
|
150
153
|
newerOverflow: boolean;
|
|
151
154
|
}>>;
|
|
152
155
|
} & import("@tanstack/react-query").QueryKeyWithDataTag<string[], import("@tanstack/react-query").InfiniteData<Readonly<{
|
|
156
|
+
parent?: import("@fungi.computer/shiitake/extensions").AttentionRecipient;
|
|
153
157
|
sessionId: string;
|
|
154
158
|
cursor: string | null;
|
|
155
159
|
hasMore: boolean;
|
package/dist/headless.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export { type SessionActivity, seedSessionQuery, sessionQueryOptions, subscribeS
|
|
|
12
12
|
export { accountCommandDefinitions, contributeAccountCommands, loginRegistry, type AccountCommandOptions, type AccountOwner, type ProviderAccess, type ModelAccountContext, type LoginHost, type LoginMethod, type LoginMethodKind, type LoginPolicy, type LoginProvider, type LoginScope, } from "./account-commands.js";
|
|
13
13
|
export { contributeModelCommands, sessionModelCommandDefinitions, type SessionModelChoice, type SessionModelCommandOptions, } from "./model-commands.js";
|
|
14
14
|
export { contributeReloadCommand, reloadCommandDefinitions, reloadSources, type ReloadCommandOptions, type ReloadSource, } from "./reload-command.js";
|
|
15
|
-
export { contributeSessionCommands, type ParakeetSessionCommandOptions, } from "./session-commands.js";
|
|
15
|
+
export { contributeSessionCommands, sessionCommandDefinitions, type ParakeetSessionCommandOptions, } from "./session-commands.js";
|
|
16
16
|
export { completeSlash, fuzzyMatch, keyBindings, keyLabel, parseSlashDraft, slashRegistry, type FuzzyMatch, type KeyBindingRow, type SlashCommand, type SlashCommandItem, type SlashCompletion, type SlashParse, type SlashWordItem, } from "./commands/slash.js";
|
|
17
17
|
export { composerHints, fitHints, formatHints, type ComposerHintContext, type ComposerKeys, type KeyHint, } from "./commands/hints.js";
|
|
18
18
|
export { isCancelledOutcome, runSlashDraft, type SlashRuntime, } from "./commands/run.js";
|
package/dist/headless.js
CHANGED
|
@@ -10,7 +10,7 @@ export { seedSessionQuery, sessionQueryOptions, subscribeSessionActivity, } from
|
|
|
10
10
|
export { accountCommandDefinitions, contributeAccountCommands, loginRegistry, } from "./account-commands.js";
|
|
11
11
|
export { contributeModelCommands, sessionModelCommandDefinitions, } from "./model-commands.js";
|
|
12
12
|
export { contributeReloadCommand, reloadCommandDefinitions, reloadSources, } from "./reload-command.js";
|
|
13
|
-
export { contributeSessionCommands, } from "./session-commands.js";
|
|
13
|
+
export { contributeSessionCommands, sessionCommandDefinitions, } from "./session-commands.js";
|
|
14
14
|
export { completeSlash, fuzzyMatch, keyBindings, keyLabel, parseSlashDraft, slashRegistry, } from "./commands/slash.js";
|
|
15
15
|
export { composerHints, fitHints, formatHints, } from "./commands/hints.js";
|
|
16
16
|
export { isCancelledOutcome, runSlashDraft, } from "./commands/run.js";
|
package/dist/model-commands.d.ts
CHANGED
|
@@ -1,19 +1,9 @@
|
|
|
1
1
|
import { type ModelPreference } from "@fungi.computer/shiitake/model-preference";
|
|
2
|
+
import type { AgentModelList } from "@fungi.computer/shiitake/model-list";
|
|
2
3
|
import { type WhistleAvailability, type WhistleRuntime, type WhistleContribution } from "@fungi.computer/whistle";
|
|
3
4
|
import { type ModelAccountContext } from "./account-commands.js";
|
|
4
|
-
/**
|
|
5
|
-
export type SessionModelChoice = Readonly<
|
|
6
|
-
/** Stable provider identity used in a Session preference. */
|
|
7
|
-
providerId: string;
|
|
8
|
-
/** Provider label displayed by clients. */
|
|
9
|
-
providerName: string;
|
|
10
|
-
/** Model identity within this provider. */
|
|
11
|
-
id: string;
|
|
12
|
-
/** Human-facing model label. */
|
|
13
|
-
name: string;
|
|
14
|
-
/** Thinking levels supported by this catalog entry. */
|
|
15
|
-
reasoning: readonly NonNullable<ModelPreference["reasoning"]>[];
|
|
16
|
-
}>;
|
|
5
|
+
/** The TUI and Grove render the same secret-free host projection. */
|
|
6
|
+
export type SessionModelChoice = Readonly<AgentModelList[number]>;
|
|
17
7
|
export type ModelPreferenceOwner = Readonly<{
|
|
18
8
|
modelPreference: Readonly<{
|
|
19
9
|
read: () => Promise<ModelPreference | null>;
|
|
@@ -22,8 +12,8 @@ export type ModelPreferenceOwner = Readonly<{
|
|
|
22
12
|
}>;
|
|
23
13
|
/** Contribution identity, catalog and optional local model-picker presentation. */
|
|
24
14
|
export type SessionModelCommandOptions = Readonly<{
|
|
25
|
-
/**
|
|
26
|
-
account
|
|
15
|
+
/** Local credential owner; hosted Agents offer only their admitted catalog. */
|
|
16
|
+
account?: ModelAccountContext;
|
|
27
17
|
/** Host source that owns the contribution lease. */
|
|
28
18
|
sourceId: string;
|
|
29
19
|
/** Namespace for the semantic model command. */
|
package/dist/model-commands.js
CHANGED
|
@@ -42,6 +42,29 @@ async function chooseReasoning(interaction, model, current) {
|
|
|
42
42
|
/** Leave one Whistle option for inheriting the Agent model. */
|
|
43
43
|
const maximumModelOptions = 255;
|
|
44
44
|
async function chooseProviderModels(interaction, models, account, refreshModels, currentProviderId) {
|
|
45
|
+
if (account === undefined) {
|
|
46
|
+
const providers = [
|
|
47
|
+
...new Map(models.map((model) => [model.providerId, model.providerName])),
|
|
48
|
+
].slice(0, maximumModelOptions);
|
|
49
|
+
const providerId = await interaction.prompt({
|
|
50
|
+
type: "choice",
|
|
51
|
+
message: "Choose a provider",
|
|
52
|
+
summary: "Or follow the Agent's own model.",
|
|
53
|
+
current: currentProviderId ?? defaultChoice,
|
|
54
|
+
options: [
|
|
55
|
+
{ value: defaultChoice, label: "Use agent model" },
|
|
56
|
+
...providers.map(([value, label]) => ({ value, label })),
|
|
57
|
+
],
|
|
58
|
+
});
|
|
59
|
+
if (providerId === defaultChoice)
|
|
60
|
+
return null;
|
|
61
|
+
const offered = (await interaction.run(() => refreshModels(interaction.signal)))
|
|
62
|
+
.filter((model) => model.providerId === providerId)
|
|
63
|
+
.slice(0, maximumModelOptions);
|
|
64
|
+
if (offered.length === 0)
|
|
65
|
+
throw new WhistleActionError("model_unavailable", "That provider has no available models. Retry /model.");
|
|
66
|
+
return offered;
|
|
67
|
+
}
|
|
45
68
|
const { owner } = account;
|
|
46
69
|
const [access, registry] = await Promise.all([
|
|
47
70
|
owner.access(interaction.signal),
|
|
@@ -201,7 +224,10 @@ export function sessionModelCommandDefinitions(session, options) {
|
|
|
201
224
|
}
|
|
202
225
|
if (preference !== null) {
|
|
203
226
|
const selected = preference;
|
|
204
|
-
const
|
|
227
|
+
const offered = options.account === undefined
|
|
228
|
+
? await options.refreshModels(input.signal ?? new AbortController().signal)
|
|
229
|
+
: options.models;
|
|
230
|
+
const model = offered.find((choice) => choice.providerId === selected.providerId &&
|
|
205
231
|
choice.id === selected.modelId);
|
|
206
232
|
if (model === undefined)
|
|
207
233
|
throw new WhistleActionError("model_unavailable", "That model is not in the current catalog");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ParakeetSessionCommand } from "./session.js";
|
|
2
|
-
import type { WhistleRuntime } from "@fungi.computer/whistle";
|
|
2
|
+
import type { WhistleContribution, WhistleRuntime } from "@fungi.computer/whistle";
|
|
3
3
|
import { buildDurableTimeline } from "./core/build-timeline.js";
|
|
4
4
|
import { type SessionViewFacts } from "./core/session-view-state.js";
|
|
5
5
|
export type SessionCommandRuntime = Pick<WhistleRuntime, "contribute">;
|
|
@@ -37,8 +37,10 @@ export type ParakeetSessionCommandOptions = Readonly<{
|
|
|
37
37
|
/** Show a title the owner just saved; null means the derived title is back. */
|
|
38
38
|
onTitled?: ((title: string | null) => void | Promise<void>) | undefined;
|
|
39
39
|
}>;
|
|
40
|
+
/** Shared Session definitions; a pane includes its model command in this namespace. */
|
|
41
|
+
export declare function sessionCommandDefinitions(session: SessionCommandSession, options: ParakeetSessionCommandOptions): WhistleContribution["commands"];
|
|
40
42
|
/** Contribute the shared Session command vocabulary to one Whistle host. */
|
|
41
43
|
export declare function contributeSessionCommands(commands: Pick<SessionCommandRuntime, "contribute">, session: SessionCommandSession, options: ParakeetSessionCommandOptions): Readonly<{
|
|
42
|
-
update: (commands:
|
|
44
|
+
update: (commands: WhistleContribution["commands"]) => void;
|
|
43
45
|
dispose: () => void;
|
|
44
46
|
}>;
|
package/dist/session-commands.js
CHANGED
|
@@ -27,8 +27,8 @@ function tell(interaction, message) {
|
|
|
27
27
|
interaction?.notify({ type: "info", message });
|
|
28
28
|
return message;
|
|
29
29
|
}
|
|
30
|
-
/**
|
|
31
|
-
export function
|
|
30
|
+
/** Shared Session definitions; a pane includes its model command in this namespace. */
|
|
31
|
+
export function sessionCommandDefinitions(session, options) {
|
|
32
32
|
const unavailable = (name) => {
|
|
33
33
|
throw new Error(`${name} is unavailable in this host.`);
|
|
34
34
|
};
|
|
@@ -230,5 +230,13 @@ export function contributeSessionCommands(commands, session, options) {
|
|
|
230
230
|
},
|
|
231
231
|
],
|
|
232
232
|
};
|
|
233
|
-
return commands
|
|
233
|
+
return contribution.commands;
|
|
234
|
+
}
|
|
235
|
+
/** Contribute the shared Session command vocabulary to one Whistle host. */
|
|
236
|
+
export function contributeSessionCommands(commands, session, options) {
|
|
237
|
+
return commands.contribute({
|
|
238
|
+
sourceId: options.sourceId,
|
|
239
|
+
namespace: options.namespace,
|
|
240
|
+
commands: sessionCommandDefinitions(session, options),
|
|
241
|
+
});
|
|
234
242
|
}
|
package/docs/api/headless.md
CHANGED
|
@@ -990,16 +990,10 @@ Coarse activity of a Session, for composer gating.
|
|
|
990
990
|
### SessionModelChoice
|
|
991
991
|
|
|
992
992
|
```ts
|
|
993
|
-
type SessionModelChoice = Readonly<
|
|
994
|
-
providerId: string;
|
|
995
|
-
providerName: string;
|
|
996
|
-
id: string;
|
|
997
|
-
name: string;
|
|
998
|
-
reasoning: readonly NonNullable<ModelPreference["reasoning"]>[];
|
|
999
|
-
}>;
|
|
993
|
+
type SessionModelChoice = Readonly<AgentModelList[number]>;
|
|
1000
994
|
```
|
|
1001
995
|
|
|
1002
|
-
|
|
996
|
+
The TUI and Grove render the same secret-free host projection.
|
|
1003
997
|
|
|
1004
998
|
---
|
|
1005
999
|
|
|
@@ -1007,7 +1001,7 @@ A host's maintained catalog projection; no credentials or provider execution.
|
|
|
1007
1001
|
|
|
1008
1002
|
```ts
|
|
1009
1003
|
type SessionModelCommandOptions = Readonly<{
|
|
1010
|
-
account
|
|
1004
|
+
account?: ModelAccountContext;
|
|
1011
1005
|
sourceId: string;
|
|
1012
1006
|
namespace: string;
|
|
1013
1007
|
models: readonly SessionModelChoice[];
|
|
@@ -2187,6 +2181,11 @@ Apply one already-decoded Shiitake frame to its authoritative projection.
|
|
|
2187
2181
|
function sessionQueryOptions(session): OmitKeyof<UseQueryOptions<Readonly<{
|
|
2188
2182
|
observation: "live" | "connecting";
|
|
2189
2183
|
snapshot: | Readonly<{
|
|
2184
|
+
parent?: {
|
|
2185
|
+
agentId: string;
|
|
2186
|
+
sessionId: string;
|
|
2187
|
+
name: string;
|
|
2188
|
+
};
|
|
2190
2189
|
sessionId: string;
|
|
2191
2190
|
cursor: string | null;
|
|
2192
2191
|
hasMore: boolean;
|
|
@@ -2249,6 +2248,11 @@ function sessionQueryOptions(session): OmitKeyof<UseQueryOptions<Readonly<{
|
|
|
2249
2248
|
}>, Error, Readonly<{
|
|
2250
2249
|
observation: "live" | "connecting";
|
|
2251
2250
|
snapshot: | Readonly<{
|
|
2251
|
+
parent?: {
|
|
2252
|
+
agentId: string;
|
|
2253
|
+
sessionId: string;
|
|
2254
|
+
name: string;
|
|
2255
|
+
};
|
|
2252
2256
|
sessionId: string;
|
|
2253
2257
|
cursor: string | null;
|
|
2254
2258
|
hasMore: boolean;
|
|
@@ -2311,6 +2315,11 @@ function sessionQueryOptions(session): OmitKeyof<UseQueryOptions<Readonly<{
|
|
|
2311
2315
|
}>, readonly ["shiitake-session", string]>, "queryFn"> & object & QueryKeyWithDataTag<readonly ["shiitake-session", string], Readonly<{
|
|
2312
2316
|
observation: "live" | "connecting";
|
|
2313
2317
|
snapshot: | Readonly<{
|
|
2318
|
+
parent?: {
|
|
2319
|
+
agentId: string;
|
|
2320
|
+
sessionId: string;
|
|
2321
|
+
name: string;
|
|
2322
|
+
};
|
|
2314
2323
|
sessionId: string;
|
|
2315
2324
|
cursor: string | null;
|
|
2316
2325
|
hasMore: boolean;
|
|
@@ -2398,7 +2407,8 @@ One shared TanStack observation keyed by Shiitake's logical Session address.
|
|
|
2398
2407
|
#### Returns
|
|
2399
2408
|
|
|
2400
2409
|
`OmitKeyof`\<`UseQueryOptions`\<`Readonly`\<\{ `observation`: `"live"` \|
|
|
2401
|
-
`"connecting"`; `snapshot`: \| `Readonly`\<\{ `
|
|
2410
|
+
`"connecting"`; `snapshot`: \| `Readonly`\<\{ `parent?`: \{ `agentId`: `string`;
|
|
2411
|
+
`sessionId`: `string`; `name`: `string`; \}; `sessionId`: `string`; `cursor`:
|
|
2402
2412
|
`string` \| `null`; `hasMore`: `boolean`; `oldestCursor?`: `string` \| `null`;
|
|
2403
2413
|
`messages`: readonly `Readonly`\<\{ `requestId?`: ...; `meta?`: ...; `data?`:
|
|
2404
2414
|
...; `origin?`: ...; `id`: ...; `sequence`: ...; `commandId`: ...; `value`: ...;
|
|
@@ -2417,7 +2427,8 @@ readonly `object`[]; `context?`: `Readonly`\<\{ `tokens`: ...; `window`: ...;
|
|
|
2417
2427
|
`latestPrompt`: \| `Readonly`\<\{ `commandId`: `string`; `text`: `string`;
|
|
2418
2428
|
`images`: readonly `object`[] \| `undefined`; \}\> \| `undefined`; \}\>,
|
|
2419
2429
|
`Error`, `Readonly`\<\{ `observation`: `"live"` \| `"connecting"`; `snapshot`:
|
|
2420
|
-
\| `Readonly`\<\{ `
|
|
2430
|
+
\| `Readonly`\<\{ `parent?`: \{ `agentId`: `string`; `sessionId`: `string`;
|
|
2431
|
+
`name`: `string`; \}; `sessionId`: `string`; `cursor`: `string` \| `null`;
|
|
2421
2432
|
`hasMore`: `boolean`; `oldestCursor?`: `string` \| `null`; `messages`: readonly
|
|
2422
2433
|
`Readonly`\<\{ `requestId?`: ...; `meta?`: ...; `data?`: ...; `origin?`: ...;
|
|
2423
2434
|
`id`: ...; `sequence`: ...; `commandId`: ...; `value`: ...; \}\>[]; `terminals`:
|
|
@@ -2437,7 +2448,8 @@ readonly `Readonly`\<\{ `commandId`: ...; `outcome`: ...; `sequence`: ...;
|
|
|
2437
2448
|
`undefined`; \}\> \| `undefined`; \}\>, readonly \[`"shiitake-session"`,
|
|
2438
2449
|
`string`\]\>, `"queryFn"`\> & `object` & `QueryKeyWithDataTag`\<readonly
|
|
2439
2450
|
\[`"shiitake-session"`, `string`\], `Readonly`\<\{ `observation`: `"live"` \|
|
|
2440
|
-
`"connecting"`; `snapshot`: \| `Readonly`\<\{ `
|
|
2451
|
+
`"connecting"`; `snapshot`: \| `Readonly`\<\{ `parent?`: \{ `agentId`: `string`;
|
|
2452
|
+
`sessionId`: `string`; `name`: `string`; \}; `sessionId`: `string`; `cursor`:
|
|
2441
2453
|
`string` \| `null`; `hasMore`: `boolean`; `oldestCursor?`: `string` \| `null`;
|
|
2442
2454
|
`messages`: readonly `Readonly`\<\{ `requestId?`: ... \| ...; `meta?`: ... \|
|
|
2443
2455
|
...; `data?`: ... \| ...; `origin?`: ... \| ...; `id`: `string`; `sequence`:
|
|
@@ -3077,6 +3089,168 @@ Contribute `/reload` to one Whistle host.
|
|
|
3077
3089
|
|
|
3078
3090
|
---
|
|
3079
3091
|
|
|
3092
|
+
### sessionCommandDefinitions()
|
|
3093
|
+
|
|
3094
|
+
```ts
|
|
3095
|
+
function sessionCommandDefinitions(session, options): readonly Readonly<{
|
|
3096
|
+
id: string;
|
|
3097
|
+
title: string;
|
|
3098
|
+
category: string;
|
|
3099
|
+
description?: string;
|
|
3100
|
+
projections?: {
|
|
3101
|
+
bindings?: {
|
|
3102
|
+
order?: number;
|
|
3103
|
+
values: readonly string[];
|
|
3104
|
+
};
|
|
3105
|
+
agent?: {
|
|
3106
|
+
keybind?: string;
|
|
3107
|
+
order?: number;
|
|
3108
|
+
};
|
|
3109
|
+
help?: {
|
|
3110
|
+
order?: number;
|
|
3111
|
+
};
|
|
3112
|
+
menu?: {
|
|
3113
|
+
order?: number;
|
|
3114
|
+
};
|
|
3115
|
+
palette?: {
|
|
3116
|
+
order?: number;
|
|
3117
|
+
};
|
|
3118
|
+
slash?: {
|
|
3119
|
+
aliases: readonly string[];
|
|
3120
|
+
consumesDraft?: boolean;
|
|
3121
|
+
order?: number;
|
|
3122
|
+
arguments?: {
|
|
3123
|
+
hint: string;
|
|
3124
|
+
words?: readonly ...[];
|
|
3125
|
+
text?: {
|
|
3126
|
+
field: ...;
|
|
3127
|
+
arguments: ...;
|
|
3128
|
+
requestIdField?: ...;
|
|
3129
|
+
};
|
|
3130
|
+
};
|
|
3131
|
+
};
|
|
3132
|
+
};
|
|
3133
|
+
action?: {
|
|
3134
|
+
inputSchema?: {
|
|
3135
|
+
[key: string]:
|
|
3136
|
+
| string
|
|
3137
|
+
| number
|
|
3138
|
+
| boolean
|
|
3139
|
+
| readonly string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | ... 4 more ... | null)[] | { ...; } | null)[] | { ...; } | null)[] | { ...; } | ...[]
|
|
3140
|
+
| {
|
|
3141
|
+
[key: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | ... 4 more ... | null)[] | { ...; } | null)[] | { ...; } | null)[] | { ...; } | ...;
|
|
3142
|
+
}
|
|
3143
|
+
| null;
|
|
3144
|
+
};
|
|
3145
|
+
outputSchema?: {
|
|
3146
|
+
[key: string]:
|
|
3147
|
+
| string
|
|
3148
|
+
| number
|
|
3149
|
+
| boolean
|
|
3150
|
+
| readonly string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | ... 4 more ... | null)[] | { ...; } | null)[] | { ...; } | null)[] | { ...; } | ...[]
|
|
3151
|
+
| {
|
|
3152
|
+
[key: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | ... 4 more ... | null)[] | { ...; } | null)[] | { ...; } | null)[] | { ...; } | ...;
|
|
3153
|
+
}
|
|
3154
|
+
| null;
|
|
3155
|
+
};
|
|
3156
|
+
presentation?: | {
|
|
3157
|
+
type: "action";
|
|
3158
|
+
}
|
|
3159
|
+
| {
|
|
3160
|
+
type: "custom";
|
|
3161
|
+
data: {
|
|
3162
|
+
[key: string]:
|
|
3163
|
+
| string
|
|
3164
|
+
| number
|
|
3165
|
+
| boolean
|
|
3166
|
+
| readonly string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | ... 4 more ... | null)[] | { ...; } | null)[] | { ...; } | null)[] | { ...; } | ...[]
|
|
3167
|
+
| {
|
|
3168
|
+
[key: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | ... 4 more ... | null)[] | { ...; } | null)[] | { ...; } | null)[] | { ...; } | ...;
|
|
3169
|
+
}
|
|
3170
|
+
| null;
|
|
3171
|
+
};
|
|
3172
|
+
}
|
|
3173
|
+
| {
|
|
3174
|
+
type: "choice";
|
|
3175
|
+
options: readonly object[];
|
|
3176
|
+
}
|
|
3177
|
+
| {
|
|
3178
|
+
type: "form";
|
|
3179
|
+
submitLabel?: string;
|
|
3180
|
+
}
|
|
3181
|
+
| {
|
|
3182
|
+
type: "confirmation";
|
|
3183
|
+
message: string;
|
|
3184
|
+
confirmLabel?: string;
|
|
3185
|
+
cancelLabel?: string;
|
|
3186
|
+
};
|
|
3187
|
+
};
|
|
3188
|
+
availability?: () => WhistleAvailability;
|
|
3189
|
+
handler: (input) => unknown;
|
|
3190
|
+
}>[];
|
|
3191
|
+
```
|
|
3192
|
+
|
|
3193
|
+
Shared Session definitions; a pane includes its model command in this namespace.
|
|
3194
|
+
|
|
3195
|
+
#### Parameters
|
|
3196
|
+
|
|
3197
|
+
| Parameter | Type |
|
|
3198
|
+
| --------- | ----------------------------------------------------------------- |
|
|
3199
|
+
| `session` | `SessionCommandSession` |
|
|
3200
|
+
| `options` | [`ParakeetSessionCommandOptions`](#parakeetsessioncommandoptions) |
|
|
3201
|
+
|
|
3202
|
+
#### Returns
|
|
3203
|
+
|
|
3204
|
+
readonly `Readonly`\<\{ `id`: `string`; `title`: `string`; `category`: `string`;
|
|
3205
|
+
`description?`: `string`; `projections?`: \{ `bindings?`: \{ `order?`: `number`;
|
|
3206
|
+
`values`: readonly `string`[]; \}; `agent?`: \{ `keybind?`: `string`; `order?`:
|
|
3207
|
+
`number`; \}; `help?`: \{ `order?`: `number`; \}; `menu?`: \{ `order?`:
|
|
3208
|
+
`number`; \}; `palette?`: \{ `order?`: `number`; \}; `slash?`: \{ `aliases`:
|
|
3209
|
+
readonly `string`[]; `consumesDraft?`: `boolean`; `order?`: `number`;
|
|
3210
|
+
`arguments?`: \{ `hint`: `string`; `words?`: readonly ...[]; `text?`: \{
|
|
3211
|
+
`field`: ...; `arguments`: ...; `requestIdField?`: ...; \}; \}; \}; \};
|
|
3212
|
+
`action?`: \{ `inputSchema?`: \{ \[`key`: `string`\]: \| `string` \| `number` \|
|
|
3213
|
+
`boolean` \| readonly string \| number \| boolean \| readonly (string \| number
|
|
3214
|
+
\| boolean \| readonly (string \| number \| boolean \| readonly (string \|
|
|
3215
|
+
number \| boolean \| readonly (string \| number \| boolean \| readonly (string
|
|
3216
|
+
\| number \| boolean \| readonly (string \| ... 4 more ... \| null)\[\] \| \{
|
|
3217
|
+
...; \} \| null)\[\] \| \{ ...; \} \| null)\[\] \| \{ ...; \} \| ...[] \| \{
|
|
3218
|
+
\[`key`: `string`\]: string \| number \| boolean \| readonly (string \| number
|
|
3219
|
+
\| boolean \| readonly (string \| number \| boolean \| readonly (string \|
|
|
3220
|
+
number \| boolean \| readonly (string \| number \| boolean \| readonly (string
|
|
3221
|
+
\| number \| boolean \| readonly (string \| ... 4 more ... \| null)\[\] \| \{
|
|
3222
|
+
...; \} \| null)\[\] \| \{ ...; \} \| null)\[\] \| \{ ...; \} \| ...; \} \|
|
|
3223
|
+
`null`; \}; `outputSchema?`: \{ \[`key`: `string`\]: \| `string` \| `number` \|
|
|
3224
|
+
`boolean` \| readonly string \| number \| boolean \| readonly (string \| number
|
|
3225
|
+
\| boolean \| readonly (string \| number \| boolean \| readonly (string \|
|
|
3226
|
+
number \| boolean \| readonly (string \| number \| boolean \| readonly (string
|
|
3227
|
+
\| number \| boolean \| readonly (string \| ... 4 more ... \| null)\[\] \| \{
|
|
3228
|
+
...; \} \| null)\[\] \| \{ ...; \} \| null)\[\] \| \{ ...; \} \| ...[] \| \{
|
|
3229
|
+
\[`key`: `string`\]: string \| number \| boolean \| readonly (string \| number
|
|
3230
|
+
\| boolean \| readonly (string \| number \| boolean \| readonly (string \|
|
|
3231
|
+
number \| boolean \| readonly (string \| number \| boolean \| readonly (string
|
|
3232
|
+
\| number \| boolean \| readonly (string \| ... 4 more ... \| null)\[\] \| \{
|
|
3233
|
+
...; \} \| null)\[\] \| \{ ...; \} \| null)\[\] \| \{ ...; \} \| ...; \} \|
|
|
3234
|
+
`null`; \}; `presentation?`: \| \{ `type`: `"action"`; \} \| \{ `type`:
|
|
3235
|
+
`"custom"`; `data`: \{ \[`key`: `string`\]: \| `string` \| `number` \| `boolean`
|
|
3236
|
+
\| readonly string \| number \| boolean \| readonly (string \| number \| boolean
|
|
3237
|
+
\| readonly (string \| number \| boolean \| readonly (string \| number \|
|
|
3238
|
+
boolean \| readonly (string \| number \| boolean \| readonly (string \| number
|
|
3239
|
+
\| boolean \| readonly (string \| ... 4 more ... \| null)\[\] \| \{ ...; \} \|
|
|
3240
|
+
null)\[\] \| \{ ...; \} \| null)\[\] \| \{ ...; \} \| ...[] \| \{ \[`key`:
|
|
3241
|
+
`string`\]: string \| number \| boolean \| readonly (string \| number \| boolean
|
|
3242
|
+
\| readonly (string \| number \| boolean \| readonly (string \| number \|
|
|
3243
|
+
boolean \| readonly (string \| number \| boolean \| readonly (string \| number
|
|
3244
|
+
\| boolean \| readonly (string \| ... 4 more ... \| null)\[\] \| \{ ...; \} \|
|
|
3245
|
+
null)\[\] \| \{ ...; \} \| null)\[\] \| \{ ...; \} \| ...; \} \| `null`; \}; \}
|
|
3246
|
+
\| \{ `type`: `"choice"`; `options`: readonly `object`[]; \} \| \{ `type`:
|
|
3247
|
+
`"form"`; `submitLabel?`: `string`; \} \| \{ `type`: `"confirmation"`;
|
|
3248
|
+
`message`: `string`; `confirmLabel?`: `string`; `cancelLabel?`: `string`; \};
|
|
3249
|
+
\}; `availability?`: () => `WhistleAvailability`; `handler`: (`input`) =>
|
|
3250
|
+
`unknown`; \}\>[]
|
|
3251
|
+
|
|
3252
|
+
---
|
|
3253
|
+
|
|
3080
3254
|
### contributeSessionCommands()
|
|
3081
3255
|
|
|
3082
3256
|
```ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fungi.computer/parakeet",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"author": "Levi <levi@technomancy.dev>",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Standalone React composer for a typed Shiitake Session",
|
|
@@ -60,13 +60,13 @@
|
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
62
|
"@earendil-works/pi-ai": "1.3.0",
|
|
63
|
-
"@fungi.computer/agar": "0.7.
|
|
64
|
-
"@fungi.computer/bird-dog": "0.3.
|
|
63
|
+
"@fungi.computer/agar": "0.7.3",
|
|
64
|
+
"@fungi.computer/bird-dog": "0.3.5",
|
|
65
65
|
"@fungi.computer/cairn": "0.1.0",
|
|
66
66
|
"@fungi.computer/caps": "0.7.1",
|
|
67
|
-
"@fungi.computer/gills": "0.2.
|
|
68
|
-
"@fungi.computer/knapsack": "0.4.
|
|
69
|
-
"@fungi.computer/shiitake": "0.
|
|
67
|
+
"@fungi.computer/gills": "0.2.2",
|
|
68
|
+
"@fungi.computer/knapsack": "0.4.7",
|
|
69
|
+
"@fungi.computer/shiitake": "0.12.1",
|
|
70
70
|
"@fungi.computer/sigils": "0.3.0",
|
|
71
71
|
"@fungi.computer/sprite": "0.2.0",
|
|
72
72
|
"@fungi.computer/sprite-zdog": "0.3.0",
|