command-code 1.93.3 → 1.93.5

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/CHANGELOG.md CHANGED
@@ -1,15 +1,37 @@
1
1
  # command-code
2
2
 
3
+ ## 1.93.5
4
+
5
+ ### Patch Changes
6
+
7
+ - fix: Make CLI tables responsive on narrow terminals.
8
+ - fix: copy now works over SSH, mosh, tmux, screen and containers (OSC 52 and `tmux load-buffer -w`)
9
+ - feat: Add a Deny-and-steer option to permission prompts to tell Command Code what to do instead.
10
+ - fix: denying one tool call no longer throws away the others in the same batch: the calls you approved still run, then the turn ends.
11
+ - fix: Unauthenticated users need to run `cmd login`.
12
+
13
+ ## 1.93.4
14
+
15
+ ### Patch Changes
16
+
17
+ - fix: a project's `effort` in `.commandcode/settings.json` now overrides your saved `/effort`
18
+ - fix: queued prompts now send one at a time, each with its own reply
19
+ - fix: recalling queued prompts now keeps your draft and pastes intact
20
+ - fix: switching to plan mode now denies an open permission prompt instead of hanging
21
+ - feat: sub-agent runs now link to the task that started them
22
+ - feat: Shift+Up now pulls queued prompts into the input to edit without stopping the turn
23
+
3
24
  ## 1.93.3
4
25
 
5
26
  ### Patch Changes
6
27
 
7
- - fix: /connect imports reasoning effort levels from the model registry, so DeepSeek V4.1 Flash and other reasoning models offer their levels in /effort
8
- - feat: let a BYOK provider opt in to zero data retention. Under `CMD_ZDR=1` every custom provider from `~/.commandcode/providers.json` was refused with `CMD_ZDR_NO_PROVIDERS`, because Command Code can't vouch for an endpoint it doesn't route. Users running a local model or their own gateway with ZDR enforced had no way to keep `CMD_ZDR=1` on for hosted models while also using that endpoint, so they ran two separate clients. A provider entry now takes `"zdr": true`: its models run under `CMD_ZDR=1` and every other custom provider is still refused. Mods can set the same `zdr: true` on the module they pass to `cmd.addProvider()`. The refusal for an unmarked BYOK provider now names this opt-in.
9
- - fix: `/model` in a cloud session now switches the model the cloud session runs, `cmd -p --cloud` and `cmd cloud list|status` exit as soon as they finish instead of 2 s later, and `cmd cloud list` no longer crashes on a session without a repo.
10
- - fix: in a cloud session, `/model` closes at once and never drops what you type while the cloud session wakes up, and an idle window now shows turns started from another client.
11
- - fix: `--effort` now sets reasoning effort for that session only and no longer rewrites your saved effort
12
- - fix: when `cmd update` or `/update` fails, error log is saved to `~/.commandcode/logs/update-error.log`
28
+ - fix: reasoning models like DeepSeek V4.1 Flash now show their effort levels in /effort
29
+ - feat: custom providers can now be used with zero data retention on
30
+ - fix: /model now switches the model in cloud sessions, without losing what you type
31
+ - fix: cloud commands exit faster, and `cmd cloud list` no longer crashes
32
+ - fix: an idle cloud session window now shows turns started from another client
33
+ - fix: `--effort` now only applies to the current session
34
+ - fix: a failed `cmd update` now saves its error log
13
35
 
14
36
  ## 1.93.2
15
37
 
@@ -144,7 +144,7 @@ cmd --yolo # yolo (permission bypass) - alias for --dan
144
144
 
145
145
  Print mode (`-p`) is different. It blocks file writes, file edits, and shell commands unless you pass `--yolo` or `--dangerously-skip-permissions`. `--permission-mode yolo` sets the mode but does not lift that block, so a headless run that needs to change files takes `--yolo`. See [headless permissions](./headless.md#permissions).
146
146
 
147
- A mode switch also answers a prompt already on screen: `accept-edits` or `yolo` **approves** it (you said "stop asking"); `plan` **denies** it. A safety-forced prompt - destructive command, sensitive file, explicit `ask` rule - is never answered this way; it stays put for an explicit yes/no.
147
+ A mode switch also answers a prompt already on screen: `accept-edits` or `yolo` **approves** it (you said "stop asking"); `plan` **denies** it. A safety-forced prompt - destructive command, sensitive file, explicit `ask` rule - is never approved this way: `accept-edits` and `yolo` leave it on screen for an explicit answer, and `plan` denies it.
148
148
 
149
149
  ---
150
150
 
@@ -257,12 +257,22 @@ The `agent` tool is always allowed and never prompts. A sub-agent runs the **sam
257
257
 
258
258
  ## What happens at a prompt
259
259
 
260
- Every prompt offers three choices: allow once, allow **and remember**, or deny with feedback. The remembered scope matches the subject:
260
+ Every prompt offers three choices: allow once, allow **and remember**, or *"No, or tell Command Code what to do instead…"*. The remembered scope matches the subject:
261
261
 
262
262
  - **File ops** - *"Yes, allow all edits this session"* turns on accept edits for the session (same as shift+tab).
263
263
  - **Shell** - *"Yes, don't ask again for `git` commands in this project"* persists a `Shell(git:*)` allow rule to project settings. For a compound command, one rule per non-read-only base. Bases that run arbitrary code (`bash`, `python`, `curl`, …) persist the exact command, not a prefix.
264
264
  - **MCP / other** - *"Yes, don't ask again for `mcp__server__tool` in this project"* persists the tool name to project settings.
265
265
 
266
+ ### Deny and steer
267
+
268
+ The last row is a text field. Move onto it (arrow keys, `j`/`k`, or its number) and:
269
+
270
+ - **Enter with nothing typed** is a plain No: the call is denied and the turn stops so you can reply.
271
+ - **Type what to do instead, then Enter**: the call is denied, your text goes to the agent as that call's result, and it keeps working in the same turn. Any other calls it had planned alongside the denied one are skipped without asking.
272
+ - **Esc** is a plain No.
273
+
274
+ On the text row every key is text. Safety-forced prompts (a destructive command, a sensitive file) show only Yes and the text row. Denials are never remembered.
275
+
266
276
  ### Command explanations on demand
267
277
 
268
278
  The shell prompt can explain the command: press **ctrl+e** (**ctrl+y** in VS Code-family terminals, where the IDE grabs ctrl+e) and a background model call summarizes it inline. Governed by the `on-demand-tool-descriptions` setting (**on by default**): explanations only when asked. Turn it off (via `/config`) to generate every one upfront.
@@ -271,7 +281,7 @@ The shell prompt can explain the command: press **ctrl+e** (**ctrl+y** in VS Cod
271
281
 
272
282
  ## Safety behaviors
273
283
 
274
- Some prompts are forced by a safety check, not a mode or rule. They offer only one-time **Yes**/**No**, plus a banner naming the check. Session and project choices are hidden on purpose - destructive-command, sensitive-path, outside-workspace, and explicit `ask` approvals are never cached, so the next risky call asks again. To stop a recurring one, add a content-specific allow rule (e.g. `Edit(.commandcode/settings.json)`).
284
+ Some prompts are forced by a safety check, not a mode or rule. They offer only one-time **Yes** and the *"No, or tell Command Code what to do instead…"* row, plus a banner naming the check. Session and project choices are hidden on purpose - destructive-command, sensitive-path, outside-workspace, and explicit `ask` approvals are never cached, so the next risky call asks again. To stop a recurring one, add a content-specific allow rule (e.g. `Edit(.commandcode/settings.json)`).
275
285
 
276
286
  ### The root/home removal circuit breaker
277
287
 
@@ -310,7 +310,7 @@ With no path, the file is written as `command-code-session-<first 8 chars of id>
310
310
  /copy
311
311
  ```
312
312
 
313
- `/copy` copies the last assistant reply to the clipboard. Best-effort: in headless/SSH terminals without clipboard access, the feed line tells you it couldn't.
313
+ `/copy` copies the last assistant reply to the clipboard. Over SSH, mosh, tmux, screen or a container it sends the reply to your terminal's clipboard (OSC 52, or `tmux load-buffer -w`) and says it was sent, not copied, since terminals never confirm it; if nothing pastes, the line says what to turn on (for example `tmux set -g set-clipboard on`).
314
314
 
315
315
  ---
316
316
 
@@ -108,7 +108,7 @@ Details:
108
108
  - `cmd.clock.every(ms, fn)` / `after(ms, fn)` - timers owned by the mod: cancelled by their `Disposable`, and all of them when the mod reloads. They never hold the process open, and a throwing callback becomes `mod_error` while the timer keeps its schedule.
109
109
  - `cmd.model.complete({prompt})` - one text completion on the session's model client, with no transcript and no tools, billed and attributed like the session. It always resolves: `{isAnswered: true, text, model}` or `{isAnswered: false, reason: 'unavailable' | 'error' | 'aborted'}` (unavailable before a session binds).
110
110
  - `cmd.prompt.submit(text)` - submit a prompt as if typed: in the TUI it starts a turn once the session is idle and queues behind a running one. Headless, it rides the follow-up queue.
111
- - `cmd.ui.copy(text)` - write text to the system clipboard with the same helper `/copy` uses. See [Clipboard and sound](./ui.md#clipboard-and-sound).
111
+ - `cmd.ui.copy(text)` - copy text to the user's clipboard with the same helper `/copy` uses (the terminal over SSH; `isConfirmed: false` then). See [Clipboard and sound](./ui.md#clipboard-and-sound).
112
112
  - `cmd.audio.play({file})` / `cmd.audio.bell()` - play a sound file shipped with the mod, or ring the terminal bell. See [Clipboard and sound](./ui.md#clipboard-and-sound).
113
113
 
114
114
  ## `ModHooks`: hooks that change behavior
@@ -50,7 +50,7 @@ run({state, userInput?, config})
50
50
  working += tool-results user message
51
51
  working := setModState(...) for every afterToolCall `modState`
52
52
  contribution across the batch (BEFORE onTurnEnd runs)
53
- any deny ────────────────────────► pendingStop: permission_denied
53
+ any plain human deny ────────────► pendingStop: permission_denied
54
54
  any terminate ───────────────────► pendingStop: terminate
55
55
  else poll getSteeringMessages → append (source 'steering')
56
56
  ◆ onTurnEnd (each mod; receives THIS turn's usage; returns new state)
@@ -75,8 +75,13 @@ phase 1 - permissions (always sequential):
75
75
  permissions.generateDescription (5s timeout → null)
76
76
  permissions.check({toolName, input, description, permissionMode})
77
77
  throw ⇒ deny (fail closed)
78
- deny → tool_denied; batch aborted: every call gets a tool_result,
79
- run stops with permission_denied AFTER the turn commits
78
+ deny → tool_denied; the call gets its denial as its tool_result
79
+ plain human deny: the approved calls still run unless the batch also
80
+ has a denial with instructions. The run stops with permission_denied
81
+ after the turn commits
82
+ human deny with instructions: skip sibling calls and continue with the
83
+ user's instructions unless a plain human deny ends the run
84
+ policy deny (rule, mode gate): the turn continues so the model can fix it
80
85
  phase 2 - execution (sequential, or parallel when config.toolExecution='parallel'):
81
86
  ◆ beforeToolCall (each mod, in order; `input` rewrites CHAIN mod→mod;
82
87
  execution uses the LAST mod's input; a mod may also set `terminate`)
@@ -254,7 +259,7 @@ One sync sink, fan out with `createEventBus`. Payloads are snapshots - never liv
254
259
  | `message_end` | response complete | full assistant content |
255
260
  | `model_request_start/end` | bracket the inference call | `model`; end adds `usage`, raw-preferred `stopReason` |
256
261
  | `tool_queued` | per call, before permission checks | `input` - the ORIGINAL input, never the rewritten one |
257
- | `tool_denied` | permission denied | - (batch then aborts) |
262
+ | `tool_denied` | permission denied for one call | `toolCallId`, `toolName` |
258
263
  | `tool_hook_blocked` | a mod's beforeToolCall blocked | `hookOutput` - **terminal for that call**: no tool_running/completed/errored follows |
259
264
  | `tool_running` | execution begins (after beforeToolCall) | `description` from permissions.generateDescription |
260
265
  | `tool_update` | streaming tool progress | `partial` content |
@@ -13,10 +13,10 @@ Everything a mod can put on screen rides `cmd.ui`, `cmd.addRenderer`, and `cmd.s
13
13
 
14
14
  ## Clipboard and sound
15
15
 
16
- - `cmd.ui.copy(text)` - write `text` to the system clipboard through the same helper `/copy` uses. It never throws: `{isCopied: true}`, or `{isCopied: false, reason}` where `reason` is `headless` (no interactive host), `no-clipboard` (the machine's clipboard is unreachable, for example over SSH without X11), or `error`.
16
+ - `cmd.ui.copy(text)` - copy `text` to the user's clipboard through the same helper `/copy` uses: the system clipboard locally, and the terminal (OSC 52, or `tmux load-buffer -w` inside tmux) over SSH, in a container, or when the system clipboard is unreachable. It never throws: `{isCopied: true, isConfirmed}`, or `{isCopied: false, reason}`. `isConfirmed` is `false` when the text only went to the terminal: terminals never answer, so it may not have landed. `reason` is `headless` (no interactive host), `no-clipboard` (no clipboard and no terminal that takes it, or only a tmux paste buffer), `too-large` (more than about 750 KB of text, over the 1 MiB of base64 tmux accepts), or `error`.
17
17
  - `cmd.audio.play({file, timeoutMs?})` - play a sound file with the platform player: `afplay` on macOS, `paplay` then `aplay` on Linux, PowerShell `Media.SoundPlayer` on Windows. A relative `file` resolves against the directory of the mod's own file, so ship the sound next to it; an absolute path works too. It runs through the runtime shell and is killed after `timeoutMs` (default 10s). It never throws: `{isPlayed: true}`, or `{isPlayed: false, reason}` where `reason` is `headless`, `not-found`, `no-player`, `timeout`, or `error`.
18
18
  - `cmd.audio.bell()` - ring the terminal bell. Returns `{isPlayed: true}`, or `{isPlayed: false, reason: 'headless'}`.
19
- - Where they work today. In the desktop app, copy, bell, and play all answer `headless` for now. Over SSH without a display, copy answers `no-clipboard`. On Windows, and on Linux with only ALSA (`aplay`, no PulseAudio or PipeWire), play handles WAV files only. Ship a `.wav` if the mod should sound everywhere.
19
+ - Where they work today. In the desktop app, copy, bell, and play all answer `headless` for now. Over SSH or in a container, copy goes through the terminal and answers `isConfirmed: false`. On Windows, and on Linux with only ALSA (`aplay`, no PulseAudio or PipeWire), play handles WAV files only. Ship a `.wav` if the mod should sound everywhere.
20
20
  - Bad arguments never throw either. A `file` that is not a string answers `error`. A `timeoutMs` that is not a positive whole number falls back to the 10s default. A hot reload stops any sound the old code started.
21
21
 
22
22
  Sound is a side effect, so do not `await` it in a hook unless the turn should wait for it:
@@ -33,7 +33,7 @@ cmd.addCommand({
33
33
  handler: async ({exec, ui}) => {
34
34
  const {stdout} = await exec({command: 'git', args: ['branch', '--show-current']});
35
35
  const copied = await ui.copy(stdout.trim());
36
- return {message: copied.isCopied ? 'Copied.' : `Not copied: ${copied.reason}`};
36
+ return {message: copied.isCopied ? (copied.isConfirmed ? 'Copied.' : 'Sent to the terminal clipboard.') : `Not copied: ${copied.reason}`};
37
37
  },
38
38
  });
39
39
  ```
@@ -247,7 +247,7 @@ More mods support coming soon.
247
247
  | `sendUserMessage` | real user turn (queued while busy) | falls back to `queueMessage` | falls back to `queueMessage` |
248
248
  | `prompt.submit` | starts a turn when idle, queues when busy | follow-up queue | follow-up queue |
249
249
  | `shutdown` | exits after the turn settles | no-op | no-op |
250
- | `ui.copy` | system clipboard | `{isCopied: false, reason: 'headless'}` | `{isCopied: false, reason: 'headless'}` |
250
+ | `ui.copy` | system clipboard, or the terminal (OSC 52, tmux) over SSH | `{isCopied: false, reason: 'headless'}` | `{isCopied: false, reason: 'headless'}` |
251
251
  | `audio.play` / `audio.bell` | platform player / terminal bell | no sound, `reason: 'headless'` | no sound, `reason: 'headless'` |
252
252
 
253
253
  **TUI only for now.** `cmd.ui.override`, `cmd.ui.setTitle`, `cmd.ui.copy`, `cmd.audio`, `cmd.addShortcut`, `cmd.shutdown`, pane focus, and typing into `input` or picking in `select` elements are handled by the interactive TUI only. The desktop app draws an `input` or `select` element as plain text it cannot focus, and a `markdown` element as styled lines.