Skip to main content

Crate kitchen_shell

Crate kitchen_shell 

Source
Expand description

The frame the neuro-kitchen apps share. An app registers what it can do; the shell draws it the same way everywhere.

  • command: one list of commands (command::CommandSpec in a command::Registry) that becomes the menus, the search, the key bindings and an agent’s tools.
  • scripts: the Scripts workspace: Python and Rust scripts that become commands and pipeline nodes.
  • search: the search over the registry (Ctrl+K).
  • frame: the frame (frame::Shell): title bar, workspaces, menu row, status bar with jobs and meters, Settings, search.
  • jobs: what runs in the background, with progress and cancel.
  • changes: the Changes panel: watched project files as diffs against a baseline, an agent’s proposed change reviewed hunk by hunk.
  • container: the view container: a dock of views, “Add view or container”, arrangements, the buttons in a view’s tab.

cargo run -p kitchen-shell --example shell-gallery shows each piece.

Re-exports§

pub use changes::Baseline;
pub use changes::ChangesEvent;
pub use changes::ChangesPanel;
pub use command::CommandSpec;
pub use command::MenuItem;
pub use command::MenuProvider;
pub use command::MenuSpec;
pub use command::Registry;
pub use command::RunCommand;
pub use container::AddViewDialog;
pub use container::Arrangement;
pub use container::DialogEvent;
pub use container::ViewOption;
pub use frame::RemoteSpec;
pub use frame::SettingsSection;
pub use frame::Shell;
pub use frame::ShellEvent;
pub use frame::ShellSpec;
pub use frame::StatusItems;
pub use frame::WorkspaceSpec;
pub use frame::frame_rounded;
pub use frame::resize_edge;
pub use scripts::NodeSpec;
pub use scripts::Port;
pub use scripts::Script;
pub use scripts::ScriptMeta;
pub use scripts::ScriptsEvent;
pub use scripts::ScriptsWorkspace;
pub use search::Search;
pub use search::SearchEvent;

Modules§

changes
The Changes panel: the files that say what a project is and how its analysis was done (session.json, pipeline.json, project.json), watched, and what changed in them shown as git-style diffs (kitchen-ui’s DiffView): added lines green, removed red, compared by key (reordered keys are not changes) with long arrays as one summary line (cells: 2,539 → 2,712).
command
What an app can do, declared once: each CommandSpec has an id, a title, an icon, a line saying what it does, a group, a key, the JSON Schema of its arguments, when it is enabled (and why not), and the function that runs it. The Registry turns that one list into the menus (Registry::menu_button), the search rows (crate::search), the key bindings (Registry::bind_keys) and an agent’s tools (kitchen-agent), so none drifts from the others: a command is in the search because it is in the list, greyed with its reason wherever it cannot run.
container
One container for every workspace’s views (lumen’s planes, tables and plots; dsp-kitchen’s traces and rasters): a dock whose views are tabs dragged into splits, the “Add view or container” dialog (after Rerun’s: arrange every view, or add one), and the buttons in a view’s tab. A workspace only lists its view kinds (ViewOption) with their flags: whether each can be added now (and why not), which one a view shows.
frame
The frame every app shares (Shell): an app hands it its registry, its workspaces, its menus and its Settings sections (ShellSpec), and the frame draws them the same way in every app (Affinity’s layout):
jobs
What runs in the background, in one place (from lumen’s job registry): each job has a kind (histology, model, export…), a name saying what it is doing, how far it is, and a cancel flag. Only one job that drives the GPU runs at a time (a second is refused, saying what runs). The status bar lists them with a cancel button each; the work itself (off the UI thread) updates its job through its JobHandle, which ends the job when dropped (finished, failed or cancelled alike).
scripts
The Scripts workspace: one space to write the app’s custom commands and pipeline steps, in Python or Rust. Scripts tree on the left, the editor (kitchen-ui’s CodeView: highlighting, errors on their lines) in the middle, the run panel (output, the result, errors) under it.
search
The search (Ctrl+K, F3; as Spotlight or Blender’s F3): every registered command by name, filtered as you type, under its group: an icon tile, the title, a line saying what it does, its key at the right. A command that cannot run now stays listed, greyed, with the reason in place of its line. ↑ ↓ move between the commands that can run, Enter runs the highlighted one, a click runs any, Escape or a click outside closes.