commands
Import
Section titled “Import”import * as api from "@fungi.computer/nacre/commands";Exports
Section titled “Exports”| Kind | Export | Description |
|---|---|---|
| type alias | ShellActions | The behavior supplied by either a browser or terminal workspace shell. |
| constant | backBinding | The Back binding, also shown by the shell in window chrome. |
| function | shellCommands() | Shared workspace declarations. Window moves have direct Alt chords and leader keys; global actions live behind the shell-owned leader. |
ShellActionstype alias
Section titled “ShellActions”type ShellActions = Readonly<{ openApp: () => void; showKeys: () => void; showCommandLine: () => void; focusStep: (step) => void; swapStep: (step) => void; toggleZoom: () => void; back?: () => void;}>;The behavior supplied by either a browser or terminal workspace shell.
backBindingconstant
Section titled “backBinding”const backBinding: "<leader>[" = "<leader>[";The Back binding, also shown by the shell in window chrome.
shellCommands()function
Section titled “shellCommands()”function shellCommands(actions): readonly Readonly<{ id: string; title: string; category: string; description?: string; projections?: { bindings?: { order?: number; values: readonly string[]; }; agent?: { keybind?: string; order?: number; }; help?: { order?: number; }; menu?: { order?: number; }; palette?: { order?: number; }; slash?: { aliases: readonly string[]; consumesDraft?: boolean; order?: number; arguments?: { hint: string; words?: readonly ...[]; text?: { field: ...; arguments: ...; requestIdField?: ...; }; }; }; }; action?: { inputSchema?: { [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 | number | boolean | readonly (string | ... 4 more ... | null)[] | { ...; } | null)[] | { ...; } | null)[] | { ...; } | ...[] | { [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)[] | { ...; } | ...; } | null; }; outputSchema?: { [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 | number | boolean | readonly (string | ... 4 more ... | null)[] | { ...; } | null)[] | { ...; } | null)[] | { ...; } | ...[] | { [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)[] | { ...; } | ...; } | null; }; presentation?: | { type: "action"; } | { type: "custom"; data: { [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 | number | boolean | readonly (string | ... 4 more ... | null)[] | { ...; } | null)[] | { ...; } | null)[] | { ...; } | ...[] | { [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)[] | { ...; } | ...; } | null; }; } | { type: "choice"; options: readonly object[]; } | { type: "form"; submitLabel?: string; } | { type: "confirmation"; message: string; confirmLabel?: string; cancelLabel?: string; }; }; availability?: () => WhistleAvailability; handler: (input) => unknown;}>[];Shared workspace declarations. Window moves have direct Alt chords and leader keys; global actions live behind the shell-owned leader.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
actions |
ShellActions |
Returns
Section titled “Returns”readonly Readonly<{ id: string; title: string; category: string;
description?: string; projections?: { bindings?: { order?: number;
values: readonly string[]; }; agent?: { keybind?: string; order?:
number; }; help?: { order?: number; }; menu?: { order?:
number; }; palette?: { order?: number; }; slash?: { aliases:
readonly string[]; consumesDraft?: boolean; order?: number;
arguments?: { hint: string; words?: readonly …[]; text?: {
field: …; arguments: …; requestIdField?: …; }; }; }; };
action?: { inputSchema?: { [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
| number | boolean | readonly (string | … 4 more … | null)[] | {
…; } | null)[] | { …; } | null)[] | { …; } | …[] | {
[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)[] | { …; } | …; } |
null; }; outputSchema?: { [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
| number | boolean | readonly (string | … 4 more … | null)[] | {
…; } | null)[] | { …; } | null)[] | { …; } | …[] | {
[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)[] | { …; } | …; } |
null; }; presentation?: | { type: "action"; } | { type:
"custom"; data: { [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 | number
| boolean | readonly (string | … 4 more … | null)[] | { …; } |
null)[] | { …; } | null)[] | { …; } | …[] | { [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)[] | { …; } | …; } | null; }; }
| { type: "choice"; options: readonly object[]; } | { type:
"form"; submitLabel?: string; } | { type: "confirmation";
message: string; confirmLabel?: string; cancelLabel?: string; };
}; availability?: () => WhistleAvailability; handler: (input) =>
unknown; }>[]