@knightcodeai/cli-linux-x64 0.8.0 → 0.9.0
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/bin/CHANGELOG.md +56 -0
- package/bin/docs/compaction.md +1 -1
- package/bin/docs/environment-variables.md +1 -0
- package/bin/docs/extensions.md +13 -4
- package/bin/docs/quickstart.md +1 -1
- package/bin/docs/sessions.md +35 -0
- package/bin/docs/settings.md +5 -3
- package/bin/docs/usage.md +2 -0
- package/bin/knightcode +2 -2
- package/bin/package.json +6 -6
- package/package.json +1 -1
package/bin/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,61 @@
|
|
|
1
1
|
# @knightcodeai/cli
|
|
2
2
|
|
|
3
|
+
## 0.9.0
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Added unsubscribe to extension events: `knightcode.on(event, handler)` now returns a function that removes that one registration, so an extension can listen once or stop listening without reloading. Removing a handler never affects a dispatch already in progress.
|
|
8
|
+
|
|
9
|
+
- Added what the desktop IDE's first run needs to `knightcode-engine`:
|
|
10
|
+
|
|
11
|
+
- `PUT /v1/models/default` records the model you pick in the IDE as your default, the same setting `/model` writes in the CLI, so both use one choice.
|
|
12
|
+
- `GET` and `PUT /v1/settings/telemetry` read and change the install-telemetry setting the CLI already has, so the IDE asks once and both follow the answer. The switch refuses to move while `KNIGHTCODE_TELEMETRY` is set in the environment.
|
|
13
|
+
- When the IDE starts the engine, it sends the same anonymous install ping as the CLI, once per IDE version, and not at all if you turned install telemetry off.
|
|
14
|
+
|
|
15
|
+
- Added `/undo`: pick an earlier user message and go back to it, with the option to restore every file the abandoned turns edited. Files are backed up before each `edit` and `write`, so the restore needs no git; `/tree` and double-Escape offer the same restore. `KNIGHTCODE_DISABLE_FILE_CHECKPOINTS=1` turns the backups off.
|
|
16
|
+
|
|
17
|
+
- Added click-to-expand for compaction, branch-summary and skill entries in the transcript. A left click toggles them the same way the expand shortcut does.
|
|
18
|
+
|
|
19
|
+
- Added a `terminal` option to `InteractiveMode`, so an embedder or test can drive the interactive UI against its own terminal implementation instead of the process's.
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- Changed long shell command timings to read as minutes and hours (`26m 32s`, `2h 3m 4s`) instead of a raw seconds count; anything under a minute still shows tenths of a second.
|
|
24
|
+
|
|
25
|
+
- Changed the copy shortcut's description in the hotkeys list and keybinding settings to say what it does: it copies the current selection, or the last assistant message when nothing is selected.
|
|
26
|
+
|
|
27
|
+
- Changed the transcript types so tool-call arguments and tool-result `details` are declared as JSON values instead of `any`. A tool that puts a `Date`, a function or `undefined` into `details` is now a type error rather than something that silently fails to round-trip through the session file.
|
|
28
|
+
|
|
29
|
+
- Changed the Kimi For Coding catalog to read from the provider's current listing, which reports the 1M-token context window and low / high / max thinking levels for `kimi-for-coding`.
|
|
30
|
+
|
|
31
|
+
### Fixed
|
|
32
|
+
|
|
33
|
+
- Fixed thinking blocks being dropped on the next turn when an Anthropic-compatible endpoint reports a different model name than the one requested. The requested model stays on the message, and the reported one is kept separately for cost attribution.
|
|
34
|
+
|
|
35
|
+
- Fixed the "Anthropic dropped thinking" notice repeating on every turn and flooding the transcript with per-block reasons. It now shows a short count, only when a response drops more blocks than the previous one, and not again when a session is reloaded; the details stay in the session file.
|
|
36
|
+
|
|
37
|
+
- Fixed a shell command killed by a signal (an OOM kill, `kill -9`, a `SIGTERM`) being reported to the model as a success. It now fails with the conventional exit code (137 for `SIGKILL`, 143 for `SIGTERM`) and keeps the output it produced before dying.
|
|
38
|
+
|
|
39
|
+
- Fixed a bare `400` or `413` with no body from any provider being treated as a context overflow and triggering compaction. Only Cerebras reports overflow that way, so the rule now applies to Cerebras alone.
|
|
40
|
+
|
|
41
|
+
- Fixed automatic compaction doing nothing when the newest tool result alone exceeds the retained-token budget. The cut now falls back to the assistant message that made the tool call, so older history is summarized before the next request instead of the session overflowing.
|
|
42
|
+
|
|
43
|
+
- Fixed DeepSeek V4.1 Flash offering the wrong thinking levels on OpenRouter and OpenCode Go. Both now expose the low / high / max efforts the model actually accepts, and OpenCode Go lists it under its current ID, `deepseek-v4.1-flash`.
|
|
44
|
+
|
|
45
|
+
- Fixed `knightcode-engine` answering a login request whose body is not JSON, or is too large, with a 500 instead of a 400 or 413.
|
|
46
|
+
|
|
47
|
+
- Fixed a `before_agent_start` handler that returns `systemPrompt` (or sets `forceSystemPrompt`) not actually replacing the prompt on models that accept mid-conversation system messages: they kept the original prompt at the head and received the forced text as a later update. The forced prompt is now sent as the leading system prompt for the run, and the session transcript keeps recording the structured sections instead of the forced text.
|
|
48
|
+
|
|
49
|
+
- Fixed fuzzy search in the model, session and file pickers lagging on long lists; matching now skips ahead with a native substring search and returns the same results in the same order.
|
|
50
|
+
|
|
51
|
+
- Fixed Gemini requests asking for thinking levels a model does not support. Turning thinking off, or picking a level the model lacks, now falls back to the lowest level that model advertises instead of a hard-coded Gemini 3 Pro / Flash guess.
|
|
52
|
+
|
|
53
|
+
- Fixed llama.cpp models whose chat template supports thinking (Qwen-style `enable_thinking`) always running as non-reasoning models. Loaded models are now checked through the server's `/props`, and those templates get an on/off thinking toggle.
|
|
54
|
+
|
|
55
|
+
- Fixed two transient provider failures ending the turn instead of retrying: Cloudflare `520` responses and Azure's "currently experiencing high demand" peak-load rejections are now retried like other overload errors.
|
|
56
|
+
|
|
57
|
+
- Fixed Vercel AI Gateway conversations losing their thinking on the next turn. The gateway returns thinking without a signature for models it translates, and those blocks are now replayed instead of being stripped.
|
|
58
|
+
|
|
3
59
|
## 0.8.0
|
|
4
60
|
|
|
5
61
|
### Added
|
package/bin/docs/compaction.md
CHANGED
|
@@ -151,7 +151,7 @@ See [`prepareCompaction()`](https://github.com/KnightCodeAI/knightcode/blob/main
|
|
|
151
151
|
|
|
152
152
|
### When It Triggers
|
|
153
153
|
|
|
154
|
-
When you use `/tree` to navigate to a different branch, KnightCode offers to summarize the work you're leaving. This injects context from the left branch into the new branch.
|
|
154
|
+
When you use `/tree` to navigate to a different branch, KnightCode offers to summarize the work you're leaving. `/undo` never summarizes; it only rewinds. This injects context from the left branch into the new branch.
|
|
155
155
|
|
|
156
156
|
### How It Works
|
|
157
157
|
|
|
@@ -84,6 +84,7 @@ These variables are read by KnightCode itself:
|
|
|
84
84
|
| `KNIGHTCODE_SERVER_DIR` | Override the experimental server profile and socket directory; default is `~/.knightcode/server` |
|
|
85
85
|
| `KNIGHTCODE_SERVER_ID` | Select the logical experimental server ID when `--server-id` is omitted |
|
|
86
86
|
| `KNIGHTCODE_OFFLINE` | Disable startup network operations, including update checks, package updates, and install/update telemetry |
|
|
87
|
+
| `KNIGHTCODE_DISABLE_FILE_CHECKPOINTS` | Set to `1`, `true`, or `yes` to stop backing up files before edits; `/undo` then rewinds the conversation only. See [Sessions](sessions.md#file-restore) |
|
|
87
88
|
| `KNIGHTCODE_SKIP_VERSION_CHECK` | Disable the `knightcode.dev` latest-version request |
|
|
88
89
|
| `KNIGHTCODE_TELEMETRY` | Override install/update telemetry and provider attribution headers: `1`/`true`/`yes` or `0`/`false`/`no` |
|
|
89
90
|
| `KNIGHTCODE_CACHE_RETENTION` | Set to `long` for extended provider prompt caching where supported |
|
package/bin/docs/extensions.md
CHANGED
|
@@ -333,7 +333,7 @@ user sends another prompt ◄─────────────────
|
|
|
333
333
|
├─► session_compact (success)
|
|
334
334
|
└─► session_compact_failed (failure or abort)
|
|
335
335
|
|
|
336
|
-
/tree navigation
|
|
336
|
+
/tree, /undo, or double-Escape navigation
|
|
337
337
|
├─► session_before_tree (can cancel or customize)
|
|
338
338
|
└─► session_tree
|
|
339
339
|
|
|
@@ -492,7 +492,7 @@ knightcode.on("session_compact_failed", async (event, ctx) => {
|
|
|
492
492
|
|
|
493
493
|
#### session_before_tree / session_tree
|
|
494
494
|
|
|
495
|
-
Fired on `/tree
|
|
495
|
+
Fired on `/tree`, `/undo`, and double-Escape navigation. See [Sessions](sessions.md) for tree navigation concepts.
|
|
496
496
|
|
|
497
497
|
```typescript
|
|
498
498
|
knightcode.on("session_before_tree", async (event, ctx) => {
|
|
@@ -563,7 +563,7 @@ knightcode.on("before_agent_start", async (event, ctx) => {
|
|
|
563
563
|
});
|
|
564
564
|
```
|
|
565
565
|
|
|
566
|
-
The `systemPromptOptions` field gives extensions access to the same structured data KnightCode uses to build the system prompt. Collections are mutable. Prefer changing `sections`, `selectedTools`, or `promptGuidelines`: KnightCode diffs the resulting prompt sections against what the model already has and appends one system message patching only the changed sections. Returning `systemPrompt`, or setting `forceSystemPrompt`, replaces the whole prompt
|
|
566
|
+
The `systemPromptOptions` field gives extensions access to the same structured data KnightCode uses to build the system prompt. Collections are mutable. Prefer changing `sections`, `selectedTools`, or `promptGuidelines`: KnightCode diffs the resulting prompt sections against what the model already has and appends one system message patching only the changed sections. Returning `systemPrompt`, or setting `forceSystemPrompt`, replaces the whole prompt for the run: every provider receives the forced text as its leading system prompt (a cache miss when it changes), and the session transcript keeps recording the structured sections. Tool selection changes update both the prompt contributions and executable provider tools; calling `knightcode.setActiveTools()` inside the handler has the same effect as editing `selectedTools`. Models that accept system messages mid-conversation receive the patch in place and keep their cached prefix; other models get the replayed prompt as their system prompt, which is a cache miss once per change.
|
|
567
567
|
|
|
568
568
|
Inside `before_agent_start`, `event.systemPrompt` and `ctx.getSystemPrompt()` both reflect the chained system prompt as of the current handler. Later `before_agent_start` handlers can still modify it again.
|
|
569
569
|
|
|
@@ -1371,7 +1371,16 @@ export default function (knightcode: ExtensionAPI) {
|
|
|
1371
1371
|
|
|
1372
1372
|
### knightcode.on(event, handler)
|
|
1373
1373
|
|
|
1374
|
-
Subscribe to events. See [Events](#events) for event types and return values.
|
|
1374
|
+
Subscribe to events. Returns an unsubscribe function that removes only that registration. See [Events](#events) for event types and return values.
|
|
1375
|
+
|
|
1376
|
+
```typescript
|
|
1377
|
+
const unsubscribe = knightcode.on("agent_end", async (event) => {
|
|
1378
|
+
unsubscribe();
|
|
1379
|
+
await updateIntegration(event.messages);
|
|
1380
|
+
});
|
|
1381
|
+
```
|
|
1382
|
+
|
|
1383
|
+
Handlers run in extension load order, then registration order within each extension. Adding or removing a handler does not affect a dispatch already in progress.
|
|
1375
1384
|
|
|
1376
1385
|
### knightcode.registerTool(definition)
|
|
1377
1386
|
|
package/bin/docs/quickstart.md
CHANGED
|
@@ -142,7 +142,7 @@ knightcode --name "my task" # Set session display name at startup
|
|
|
142
142
|
knightcode --session <path|id> # Open a specific session
|
|
143
143
|
```
|
|
144
144
|
|
|
145
|
-
Inside knightcode, use `/resume`, `/new`, `/tree`, `/fork`, and `/clone` to manage sessions.
|
|
145
|
+
Inside knightcode, use `/resume`, `/new`, `/undo`, `/tree`, `/fork`, and `/clone` to manage sessions.
|
|
146
146
|
|
|
147
147
|
### Non-interactive mode
|
|
148
148
|
|
package/bin/docs/sessions.md
CHANGED
|
@@ -28,6 +28,7 @@ For the JSONL file format and SessionManager API, see [Session Format](session-f
|
|
|
28
28
|
| `/name <name>` | Set the current session display name |
|
|
29
29
|
| `/session` | Show session info |
|
|
30
30
|
| `/tree` | Navigate the current session tree |
|
|
31
|
+
| `/undo` | Go back to an earlier user message, optionally restoring files |
|
|
31
32
|
| `/fork` | Create a new session from a previous user message |
|
|
32
33
|
| `/clone` | Duplicate the current active branch into a new session |
|
|
33
34
|
| `/compact [prompt]` | Summarize older context; see [Compaction](compaction.md) |
|
|
@@ -117,6 +118,40 @@ Selecting an assistant, tool, compaction, or other non-user entry:
|
|
|
117
118
|
|
|
118
119
|
Selecting the root user message resets the leaf to an empty conversation and places the original prompt in the editor.
|
|
119
120
|
|
|
121
|
+
## Undoing with `/undo`
|
|
122
|
+
|
|
123
|
+
`/undo` is the quick form of `/tree` for the common case: pick a user message on the current
|
|
124
|
+
branch and go back to it. It lists only user messages, newest at the bottom, with the time
|
|
125
|
+
and how many files an undo to that point would restore. Enter goes back; the turns after the
|
|
126
|
+
chosen message are left as an abandoned branch (still reachable through `/tree`) and the
|
|
127
|
+
message text returns to the editor for editing and resubmitting.
|
|
128
|
+
|
|
129
|
+
### File Restore
|
|
130
|
+
|
|
131
|
+
Before `edit` or `write` changes a file, KnightCode copies the original into
|
|
132
|
+
`~/.knightcode/agent/file-history/<session id>/`, once per file per user turn. When you go
|
|
133
|
+
back past a turn that changed files, through `/undo`, `/tree`, or double-Escape, you are asked:
|
|
134
|
+
|
|
135
|
+
- **Conversation only**: files stay as they are.
|
|
136
|
+
- **Conversation and N files**: every file the abandoned turns touched is put back to its
|
|
137
|
+
content from before those turns; files they created are deleted.
|
|
138
|
+
|
|
139
|
+
Escape at that prompt cancels the navigation entirely.
|
|
140
|
+
|
|
141
|
+
Limits:
|
|
142
|
+
|
|
143
|
+
- Changes made by shell commands (`bash`, `powershell`) are not tracked. The prompt says so
|
|
144
|
+
when a shell command ran in the abandoned turns.
|
|
145
|
+
- Edits made by subagents or outside KnightCode are not tracked either; a tracked file is
|
|
146
|
+
restored to its backup regardless of who changed it afterwards.
|
|
147
|
+
- If you go back without restoring files and later go back further, only the edits on the
|
|
148
|
+
branch you are on are restored.
|
|
149
|
+
- Jumping sideways to another branch with `/tree` restores to the fork point; edits on the
|
|
150
|
+
target branch are not re-applied.
|
|
151
|
+
|
|
152
|
+
Backups older than 30 days are removed at startup. Set `KNIGHTCODE_DISABLE_FILE_CHECKPOINTS=1`
|
|
153
|
+
to turn file tracking off; `/undo` then rewinds the conversation only.
|
|
154
|
+
|
|
120
155
|
## `/tree`, `/fork`, and `/clone`
|
|
121
156
|
|
|
122
157
|
| Feature | `/tree` | `/fork` | `/clone` |
|
package/bin/docs/settings.md
CHANGED
|
@@ -27,8 +27,8 @@ Use `/trust` in interactive mode to save a project trust decision for future ses
|
|
|
27
27
|
|
|
28
28
|
| Setting | Type | Default | Description |
|
|
29
29
|
|---------|------|---------|-------------|
|
|
30
|
-
| `defaultProvider` | string | - | Startup provider (e.g., `"anthropic"`, `"openai"`; saved with Ctrl+S in `/model`, or edited manually) |
|
|
31
|
-
| `defaultModel` | string | - | Startup model ID (saved with Ctrl+S in `/model`, or edited manually) |
|
|
30
|
+
| `defaultProvider` | string | - | Startup provider (e.g., `"anthropic"`, `"openai"`; saved with Ctrl+S in `/model`, by the IDE's model picker, or edited manually) |
|
|
31
|
+
| `defaultModel` | string | - | Startup model ID (saved with Ctrl+S in `/model`, by the IDE's model picker, or edited manually) |
|
|
32
32
|
| `defaultThinkingLevel` | string | - | Startup thinking level (saved with Ctrl+S in `/thinking`, or edited manually): `"off"`, `"minimal"`, `"low"`, `"medium"`, `"high"`, `"xhigh"`, `"max"` |
|
|
33
33
|
| `modelThinkingLevels` | object | - | Per-model startup thinking levels keyed by `"provider/modelId"`; configure from `/settings` → Default thinking level per model or edit manually |
|
|
34
34
|
| `hideThinkingBlock` | boolean | `false` | Hide thinking blocks in output |
|
|
@@ -60,7 +60,7 @@ Use `/trust` in interactive mode to save a project trust decision for future ses
|
|
|
60
60
|
| `enableInstallTelemetry` | boolean | `true` | Send the anonymous install/update ping and selected provider attribution headers. This does not control update checks |
|
|
61
61
|
| `enableAnalytics` | boolean | `false` | Opt-in analytics data sharing. Currently only asked for during the experimental first-time setup (`KNIGHTCODE_EXPERIMENTAL=1`) |
|
|
62
62
|
| `trackingId` | string | - | Analytics tracking identifier, generated when `enableAnalytics` is turned on |
|
|
63
|
-
| `doubleEscapeAction` | string | `"tree"` | Action for double-escape: `"tree"`, `"fork"`, or `"none"` |
|
|
63
|
+
| `doubleEscapeAction` | string | `"tree"` | Action for double-escape: `"tree"`, `"fork"`, or `"none"`. `/undo` is the quick way to a user message |
|
|
64
64
|
| `treeFilterMode` | string | `"default"` | Default filter for `/tree`: `"default"`, `"no-tools"`, `"user-only"`, `"labeled-only"`, `"all"` |
|
|
65
65
|
| `editorPaddingX` | number | `0` | Horizontal padding for input editor (0-3) |
|
|
66
66
|
| `outputPad` | number | `1` | Horizontal padding for user messages, assistant messages, and thinking (0 or 1) |
|
|
@@ -83,6 +83,8 @@ For VS Code, include `--wait` so knightcode resumes after the editor exits:
|
|
|
83
83
|
|
|
84
84
|
`enableInstallTelemetry` controls the anonymous install/update ping to `https://knightcode.dev/api/report-install` and KnightCode attribution headers for OpenRouter, NVIDIA NIM, and Cloudflare provider requests. Opting out disables both. It does not disable update checks; KnightCode can still fetch `https://knightcode.dev/api/latest-version` to look for the latest version.
|
|
85
85
|
|
|
86
|
+
The KnightCode IDE shares this setting rather than keeping its own. Its first run and its settings write `enableInstallTelemetry` here, except while `KNIGHTCODE_TELEMETRY` is set, because the variable outranks the setting. The engine the IDE starts sends the same ping once per IDE version, with a `knightcode-ide` user agent, and records the version it was delivered for as `lastIdeVersion`. A ping that fails is retried on the next start.
|
|
87
|
+
|
|
86
88
|
Set `KNIGHTCODE_SKIP_VERSION_CHECK=1` to disable the KnightCode version update check. Use `--offline` or `KNIGHTCODE_OFFLINE=1` to disable all startup network operations described here, including update checks, package update checks, and install/update telemetry.
|
|
87
89
|
|
|
88
90
|
### Network
|
package/bin/docs/usage.md
CHANGED
|
@@ -48,6 +48,7 @@ Type `/` in the editor to open command completion. Extensions can register custo
|
|
|
48
48
|
| `/name <name>` | Set session display name |
|
|
49
49
|
| `/session` | Show session file, ID, messages, tokens, and cost |
|
|
50
50
|
| `/tree` | Jump to any point in the session and continue from there |
|
|
51
|
+
| `/undo` | Go back to an earlier user message; optionally restore the files edited after it |
|
|
51
52
|
| `/trust` | Save project trust decision for future sessions |
|
|
52
53
|
| `/fork` | Create a new session from a previous user message |
|
|
53
54
|
| `/clone` | Duplicate the current active branch into a new session |
|
|
@@ -122,6 +123,7 @@ Useful session commands:
|
|
|
122
123
|
|
|
123
124
|
- `/session` shows the current session file and ID.
|
|
124
125
|
- `/tree` navigates the in-file session tree and can summarize abandoned branches.
|
|
126
|
+
- `/undo` goes back to an earlier user message and can restore the files edited after it.
|
|
125
127
|
- `/fork` creates a new session from an earlier user message.
|
|
126
128
|
- `/clone` duplicates the current active branch into a new session file.
|
|
127
129
|
- `/compact` summarizes older messages to free context.
|
package/bin/knightcode
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: package/bin/knightcode
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 117489223 bytes
|
|
4
|
+
sha256: c63b1c290333f73c7b200d72bde88f663a23495f1449b8dbe55516a07b5d1d9f
|
package/bin/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@knightcodeai/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "KnightCode — a local, BYOK terminal coding agent powered by OpenRouter.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"test": "vitest --run"
|
|
38
38
|
},
|
|
39
39
|
"optionalDependencies": {
|
|
40
|
-
"@knightcodeai/cli-linux-x64": "0.
|
|
41
|
-
"@knightcodeai/cli-linux-arm64": "0.
|
|
42
|
-
"@knightcodeai/cli-darwin-x64": "0.
|
|
43
|
-
"@knightcodeai/cli-darwin-arm64": "0.
|
|
44
|
-
"@knightcodeai/cli-win32-x64": "0.
|
|
40
|
+
"@knightcodeai/cli-linux-x64": "0.9.0",
|
|
41
|
+
"@knightcodeai/cli-linux-arm64": "0.9.0",
|
|
42
|
+
"@knightcodeai/cli-darwin-x64": "0.9.0",
|
|
43
|
+
"@knightcodeai/cli-darwin-arm64": "0.9.0",
|
|
44
|
+
"@knightcodeai/cli-win32-x64": "0.9.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@agentclientprotocol/sdk": "1.4.0",
|