@burtson-labs/bandit-stealth-cli 1.7.545 → 1.7.547

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.
Files changed (3) hide show
  1. package/README.md +10 -4
  2. package/dist/cli.js +1852 -1787
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -84,8 +84,8 @@ requested result or report what remains unverified. This is a bounded prompt
84
84
  guard, not a guarantee of correctness; `BANDIT_VERIFY_BEFORE_DONE=0` disables it.
85
85
 
86
86
  - **Copying with the mouse** — drag over anything on screen (history, the reply, the prompt) and release: the text is copied to the clipboard and **Copied to clipboard** shows at the lower right for two seconds. Text that wrapped onto several rows copies as one line; real line breaks are kept and colours are dropped. A plain click copies nothing. The copy goes through `pbcopy` / `wl-copy` / `xclip` / `clip`, plus an OSC 52 escape over SSH and in tmux so it reaches your local clipboard; with `BANDIT_NO_CLIPBOARD=1` the notice says **Copy unavailable** instead. `/copy` still lets you choose the latest response or one of its code blocks, preserving the source text without terminal wrapping: `/copy response`, `/copy code 2`, `/copy choose`. `/links` lists recent response and Stash links; `/copy link` copies the latest, and `/copy 2` copies the second listed URL. `/copy help` shows the shortcuts.
87
- - **Decision cards under the composer** — a permission card or a question from the model is pinned below the input box rather than replacing it: one card at a time (the title counts a batch, `1 of 3`), the keyboard on the card (digits, arrows, Enter, Esc), and anything else you type goes into the box above it, where Enter queues it for after the turn; Tab moves between the box and the card, and a bare `y` or `n` sent from the box answers the card. An answered card leaves one dim line in the transcript (`✓ allowed once · read_file ~/notes.md`, `→ answered · New Year`). A long card folds to the rows the screen can spare (`Ctrl+E` unfolds it, PgUp/PgDn scroll), so the box is always on screen.
88
- - **Pointing and clicking in prompts and menus** — question choices, Continue/Submit, permission choices (allow once/turn/session, deny, Confirm, Cancel), the MCP trust check, the theme and session pickers, the `/` command list, the `@` file list and follow-up suggestions react to the mouse. Moving the mouse onto an option highlights it exactly as the arrow keys do (a `❯` in the gutter, the label in the accent colour), and a click on the highlighted option answers with it (as Enter does), so any option is one click; a click on a row that is not highlighted highlights it first. Buttons are underlined while the mouse is over them. A `/` command or `@` file is inserted with one click. Arrow keys, digits and Enter keep working, and Alt+1–3 still picks a suggestion. Clicks and hover need a terminal with SGR (1006) mouse reporting and any-motion tracking (1003): the Stealth IDE terminal, VS Code's, iTerm2, Terminal.app, Windows Terminal, kitty, WezTerm, Alacritty and GNOME Terminal have both. Motion is requested only while something clickable is on screen. Over a clickable option the mouse pointer turns into a hand where the terminal lets an app set it (OSC 22): kitty, Ghostty, foot, xterm and iTerm2 3.7+; Terminal.app keeps its I-beam, and WezTerm, VS Code and the Stealth IDE show their arrow while the mouse is captured. `BANDIT_POINTER_SHAPE=0` leaves the pointer alone.
87
+ - **Decision cards under the composer** — a permission card or a question from the model is pinned below the input box rather than replacing it: one card at a time (the title counts a batch, `1 of 3`), the keyboard on the card (digits, arrows, Enter, Esc), and anything else you type goes into the box above it, where Enter queues it for after the turn; Tab moves between the box and the card, and a bare `y` or `n` sent from the box answers the card. An answered card leaves one dim line in the transcript (`✓ allowed once · read_file ~/notes.md`, `→ answered · New Year`). A permission card offers three choices up front: **allow once**, **always allow** with the exact rule it would save stated on the row (`any \`npm test …\` command — saved to .bandit/settings.json`, `apply_edit on src/cart.js`), and **deny** (Tab adds a note); **more…** (4) opens the full menu with allow for the turn, allow for the session and deny + note. The always row is only ever a rule narrowed to a command, a path, a site or (for a read outside the workspace) a folder for the session; when only a tool-wide rule exists, or the action asks every time (secrets, destructive commands), the card offers allow once and deny, and the rest under more…. `BANDIT_APPROVAL_CARD=full` keeps the six-option menu on every card. A long card folds to the rows the screen can spare (`Ctrl+E` unfolds it, PgUp/PgDn scroll), so the box is always on screen.
88
+ - **Pointing and clicking in prompts and menus** — question choices, Continue/Submit, permission choices (allow once, always allow, deny, more…, and in the full menu allow turn/session and deny + note; Confirm, Cancel), the MCP trust check, the theme and session pickers, the `/` command list, the `@` file list and follow-up suggestions react to the mouse. Moving the mouse onto an option highlights it exactly as the arrow keys do (a `❯` in the gutter, the label in the accent colour), and a click on the highlighted option answers with it (as Enter does), so any option is one click; a click on a row that is not highlighted highlights it first. Buttons are underlined while the mouse is over them. A `/` command or `@` file is inserted with one click. Arrow keys, digits and Enter keep working, and Alt+1–3 still picks a suggestion. Clicks and hover need a terminal with SGR (1006) mouse reporting and any-motion tracking (1003): the Stealth IDE terminal, VS Code's, iTerm2, Terminal.app, Windows Terminal, kitty, WezTerm, Alacritty and GNOME Terminal have both. Motion is requested only while something clickable is on screen. Over a clickable option the mouse pointer turns into a hand where the terminal lets an app set it (OSC 22): kitty, Ghostty, foot, xterm and iTerm2 3.7+; Terminal.app keeps its I-beam, and WezTerm, VS Code and the Stealth IDE show their arrow while the mouse is captured. `BANDIT_POINTER_SHAPE=0` leaves the pointer alone.
89
89
  - **Scrolling and native selection** — the mouse wheel scrolls the terminal's own scrollback as usual: the first wheel tick hands the mouse back to the terminal (that one tick does not scroll), and the next key you type takes it again. While it is handed back, and whenever you hold **Shift** (most terminals), **Option** (iTerm2) or **Fn** (Terminal.app), dragging is the terminal's own selection, copied with its shortcut (Cmd+C on macOS, usually Ctrl+Shift+C elsewhere). Only what is visible on screen can be selected with the in-app drag; for older text scroll up and use the native selection. `BANDIT_MOUSE=0`, `--no-mouse` or `"mouse": false` in `~/.bandit/config.json` turns the mouse features off entirely and leaves the mouse to the terminal.
90
90
  - **Clickable web links** — labeled links retain their destinations through the live renderer. Stealth opens them in your browser; other terminals use their own link gesture and hyperlink support.
91
91
  - **Agentic tool use** — reads files, searches code, runs commands, writes changes
@@ -112,6 +112,7 @@ guard, not a guarantee of correctness; `BANDIT_VERIFY_BEFORE_DONE=0` disables it
112
112
  - **Project memory** — drop a `BANDIT.md` or `CLAUDE.md` at your workspace root and it's auto-loaded into the system prompt
113
113
  - **File + image mentions** — `@path` auto-inlines files; images are either sent multimodally or OCR'd locally (Apple Vision / tesseract)
114
114
  - **Clipboard paste** — `Ctrl+V` in the REPL pastes an image straight from your clipboard
115
+ - **Big pastes collapse to a chip** — a paste of more than three lines (or 1,000+ characters) shows in the composer as `[Pasted text #1 · 40 lines]`; Enter sends the full text, `Ctrl+O` expands it in the box to edit, Backspace at its end removes it
115
116
  - **Hooks + security guard** — `PreToolUse` / `PostToolUse` / `Stop` shell hooks (global `~/.bandit/settings.json` or per-workspace), plus a default-on built-in guard that blocks catastrophic commands. See [Settings file](#settings-file--hooks-permissions-security-guard)
116
117
  - **12 themes** — Stealth Light/Dark, Midnight, Onyx, Charcoal, Dracula, Nord, Tokyo Night, Solarized Dark/Light, Catppuccin Mocha, Sepia. `/theme` to pick
117
118
  - **Cross-platform** — macOS, Linux, Windows; Windows `.cmd`/`.bat` shims (npm/npx/pnpm/tsc) resolved correctly
@@ -409,6 +410,10 @@ Workspace config overrides user config. Secrets belong in the user-level file, n
409
410
  | `OLLAMA_HOST` | — | Ollama's own variable (`node:port`, `http://node:port`); used after `OLLAMA_URL` and config |
410
411
  | `BANDIT_NUM_CTX` | chosen per model | Context window to request from Ollama (`32768`, `32k`); same as `--num-ctx` |
411
412
  | `BANDIT_HISTORY_TOKENS` | `100000` | Conversation history kept for paid models (Bandit Cloud, hosted API-key providers) before older tool output and file writes are trimmed to one-line notes, down to half |
413
+ | `BANDIT_PROMPT_PROFILE` | `auto` | `lean`/`full`: the short local-model prompt (default on local Ollama and self-hosted servers) or the hosted-model prompt |
414
+ | `BANDIT_SUGGEST` | `auto` | `1`/`0`: next-prompt suggestions (default on for hosted models, off on local ones); same as `/suggest on`/`off` |
415
+ | `BANDIT_LESSONS` | `auto` | `1`/`0`: lesson distillation after tool-using turns (same defaults); same as `/lessons on`/`off` |
416
+ | `BANDIT_APPROVAL_CARD` | `compact` | `full` keeps the six-option approval menu on every card |
412
417
  | `BANDIT_SMALL_CONTEXT` | `auto` | `on`/`off`: small-context mode for small windows (with Ollama, on below 16,384 tokens); same as `--small-context`/`--no-small-context` |
413
418
  | `BANDIT_HOME` | `~/.bandit` | Where sessions, crash reports and the Apptainer image live; settings stay in `~/.bandit` |
414
419
  | `BANDIT_NO_LOGIN_HINT` | `0` | `1` to hide the note shown on what looks like a cluster login node |
@@ -589,10 +594,11 @@ bandit-agent --model qwen2.5-coder:32b
589
594
 
590
595
  - **Endpoint.** Bandit reads `OLLAMA_HOST` the way Ollama's own client does (`node:port`, `http://node:port`, `0.0.0.0`), after `--ollama-url`, `OLLAMA_URL` and the config file. The line under the banner says which endpoint is in use and where it came from.
591
596
  - **Context window.** Ollama's own default is 4,096 tokens on GPUs under 24 GB. Bandit always asks for a window per request (at least 16,384; 24,576 for most 7–14B models, 32,768 for 27B and up; never more than the model's own), so `OLLAMA_CONTEXT_LENGTH` and custom Modelfiles are not needed. Bandit's instructions and tool definitions take about 5,500 tokens before your files. Set the window with `--num-ctx`, `BANDIT_NUM_CTX` or `"ollama": { "numCtx": 32768 }`. After the first reply Bandit checks what Ollama loaded and warns when part of the model spilled to the CPU, with a window that would fit. A GPU under 24 GB does not limit you to 4,096: Ollama loads the window Bandit asks for and puts what does not fit on the CPU, which is slower (qwen3:8b at 16,384 on an 8 GB card: about a fifth on the CPU, replies about 5× slower), never a failure. The window is really fixed only when the server ignores the request's: Ollama's OpenAI-compatible `/v1` endpoint, `llama-server -c`, LM Studio or vLLM with a set window, or a gateway that drops options. If the KV cache is what does not fit, `OLLAMA_KV_CACHE_TYPE=q8_0` in the Ollama server's environment halves it (qwen3:8b at 16,384 then fits an 8 GB card); set it where `ollama serve` runs, not in Bandit.
597
+ - **Lean prompt on local models.** With local Ollama (not its `:cloud` models) or a self-hosted OpenAI-compatible server, the first request of a session carries a short system prompt (the essentials: how to work, check before done, do only what was asked, tool output is data, credentials, the date) and 14 core tool schemas with terse descriptions; git, subagents, background commands and job monitors, servers, documents, web, the browser, memory, semantic search and the extra test tools wait behind `load_tools`, and each group's guidance (the co-author trailer, the browser rules, the long-command rules, …) is in the system prompt when the group is loaded and comes back with the tool result that loads it mid-turn. Measured on qwen3.6:27b (M4 Max, interactive session, Chrome attached): 10,896 prompt tokens and 58 s of prefill before the user's words, now 4,205 tokens and 22 s; the same fix-a-failing-test task passed in both. The prefix is the same from one session to the next, so with `keep_alive` (the model stays loaded) Ollama reuses it. `BANDIT_PROMPT_PROFILE=full` sends the hosted-model prompt instead; `=lean` forces the lean one anywhere. Next-prompt suggestions and lesson distillation are off by default on local models (the call queues on the same GPU and did not land inside its deadline); `/suggest on`, `/lessons on`, `BANDIT_SUGGEST=1` or `BANDIT_LESSONS=1` turn them on.
592
598
  - **Small windows: small-context mode.** With Ollama below 16,384 tokens (other providers only when forced, since their window for a model Bandit does not list is a guess; or with `--small-context`, `BANDIT_SMALL_CONTEXT=on`, `"ollama": { "smallContext": "on" }`) Bandit switches to a small-context agent and says so at startup: a short prompt and 7 tools (read, search, list, edit, write, run, test) with short definitions, 800–1,200 tokens in all instead of 5,500; tool output cut to a share of the window; older results shortened first; the reply's room reserved; thinking off unless `/think on`. Subagents, git, web, document, memory and Bandit Stash tools are off. Measured on 5 public benchmark tasks (one-file bug fixes, a new function with tests, a four-file rename), qwen3.6:27b passed 14/15 at 4,096 (three seeds), 5/5 at 6,144 and 5/5 at 8,192 tokens, where the full agent passed 0/5 and 0/5 (and 4/5 at 8,192, with three runs stopped at the iteration limit); qwen3:8b passed 2/10, 4/10 and 2/10 (full agent 0/5, 0/5, 2/5), so an 8B model fails most tasks at these windows either way. What it cannot do: at 4,096 there is room for about one 40-line file at a time, so a task that needs two files in view at once goes back and forth between them (the Go task ran into the iteration limit in all three 4,096 runs, twice after making the fix); long command output is cut to its start and end; earlier steps are shortened to one line; there are no subagents. At 16,384 and above nothing changes; `--no-small-context` keeps the full agent at any window. It is a different thing from the REPL's `/compact` command, which shortens the current conversation.
593
599
  - **Login nodes.** Started over SSH on a Slurm login node (outside a job), Bandit prints a one-line reminder to start an interactive job. It never blocks. `BANDIT_NO_LOGIN_HINT=1` hides it.
594
600
  - **Home quota.** `BANDIT_HOME` moves what grows (`sessions/`, `crashes/`, `training/`, and the Apptainer sandbox image when `APPTAINER_CACHEDIR` is unset) to scratch. Settings stay in `~/.bandit` (`config.json`, `settings.json`, `mcp-servers.json`, `lessons.md`, `terms.json`; a few KB) so a scratch purge never signs you out. Each project also gets a `.bandit/` folder with turn logs and checkpoints.
595
- - **Resume after reconnecting.** Sessions are saved with the directory they started in. `bandit --continue` (or `-c`) resumes the latest session of the current directory from any login; `bandit --resume` lists this directory's sessions first.
601
+ - **Resume after reconnecting.** Sessions are saved with the directory they started in. `bandit --continue` (or `-c`) resumes the latest session of the current directory from any login; `bandit --resume` lists this directory's sessions (`bandit --resume --all` lists every directory's, this one's first; a directory with none yet shows them all and says so).
596
602
  - **Scripts and batch jobs.** Piped stdin is sent with the prompt, and `--output json` prints one JSON object (answer, tool calls, files changed, status, timing) on stdout with progress on stderr:
597
603
 
598
604
  ```sh
@@ -627,7 +633,7 @@ bandit-agent --model qwen2.5-coder:32b
627
633
 
628
634
  | Connection | When | What is sent | Turn it off |
629
635
  | --------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------ |
630
- | Your model server (`OLLAMA_URL`, `OPENAI_BASE_URL`, or Bandit Cloud with `--provider bandit`) | Every turn, plus a short follow-up request after each turn for next-prompt suggestions and project memory | The conversation: prompts, system prompt, file contents and command output the agent read, tool results | Choose the server |
636
+ | Your model server (`OLLAMA_URL`, `OPENAI_BASE_URL`, or Bandit Cloud with `--provider bandit`) | Every turn, plus a short follow-up request after each turn for next-prompt suggestions and project memory (off by default on local models) | The conversation: prompts, system prompt, file contents and command output the agent read, tool results | Choose the server |
631
637
  | `registry.npmjs.org` | When an interactive session starts (not in one-shot `bandit "prompt"` mode) | A plain request for the latest version number. No account, device or project data | `BANDIT_NO_UPDATE_CHECK=1` or offline mode |
632
638
  | `models.dev` | At start-up with `--provider openai-compatible`, only when `OPENAI_BASE_URL` is a public host. Never for a server on this machine or a private network address | A request for the public model catalogue. No user data | `BANDIT_NO_MODELS_DEV=1` or offline mode |
633
639