@kernelonpanic/kitcode 1.3.2 → 1.4.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/README.md CHANGED
@@ -24,14 +24,14 @@ OpenAI-compatible providers, including OpenRouter and local model servers.
24
24
  - persistent and resumable sessions with native terminal scrollback;
25
25
  - searchable session management with rename, delete, and Markdown export;
26
26
  - input history with the `↑` and `↓` keys;
27
- - queued messages while the agent is working;
27
+ - queued messages while the agent is working, with status and settings commands running immediately;
28
28
  - image and UTF-8 text attachments;
29
- - manual and automatic context compaction;
29
+ - manual and automatic context compaction with a selectable context window;
30
30
  - token, estimated cost, exact context-window, and provider rate-limit indicators;
31
31
  - automatic file checkpoints with `/undo`;
32
32
  - detected project checks after file edits;
33
33
  - model and provider switching from the TUI;
34
- - live MCP add, enable, disable, and delete operations, plus skills and subagents;
34
+ - live MCP add, enable, disable, and delete operations, plus skills and subagents running concurrently;
35
35
  - a local `/checker` report for the runtime, provider, session, context, and MCP setup;
36
36
  - English and Russian interfaces with configurable accents.
37
37
 
@@ -111,6 +111,7 @@ Press `/` to open the command list.
111
111
  | `/key [provider]` | Change API key for a provider. |
112
112
  | `/refresh [provider]` | Reload a provider's model list, bypassing the 24h cache. |
113
113
  | `/effort [auto|low|medium|high|xhigh|max]` · `/thinking` | Select reasoning effort and configure reasoning output. |
114
+ | `/context [tokens]` | Show or set the model context window used by the meter and automatic compaction. |
114
115
  | `/memory show` · `/memory set <text>` · `/memory clear` | View, replace, or clear this project's persistent notes. |
115
116
  | `/resume` · `/clear` | Resume a session or start a new one. |
116
117
  | `/sessions` | Search sessions, then resume, rename, delete, or export one. |
@@ -151,7 +152,11 @@ Press `/` to open the command list.
151
152
  | `Ctrl+V` / `Cmd+V` | Attach an image from the system clipboard; `/attach clipboard` is the explicit fallback. |
152
153
  | `Esc` | Cancel the current request or close an overlay. |
153
154
 
154
- Messages entered while the agent is running are queued and processed in order.
155
+ Messages entered while the agent is running are queued and processed in order. Status and settings
156
+ commands — `/help`, `/usage`, `/context`, `/model`, `/effort`, `/thinking`, `/budget`, `/theme`,
157
+ `/lang`, `/subagents`, `/config`, `/checker`, `/exit` — run immediately instead. Commands that
158
+ change the running turn or the session (`/clear`, `/compact`, `/resume`, `/undo`, `/login`,
159
+ `/provider`, `/logout`, `/key`, `/refresh`, `/mcp`, `/sessions`) wait for the turn to finish.
155
160
 
156
161
  ## Modes
157
162
 
@@ -166,7 +171,26 @@ Completed output is committed to
166
171
  normal terminal scrollback, so it remains smooth to scroll while a response is streaming.
167
172
 
168
173
  When exact usage reaches 80% of a known context window, KitCode automatically summarizes older
169
- turns while keeping the latest two user turns. `/compact` runs the same operation manually.
174
+ turns while keeping the latest two user turns. `/compact` runs the same operation manually, and
175
+ `/context` sets the window when the provider does not report one.
176
+
177
+ ## Context window
178
+
179
+ `/context` shows the window currently in use and opens a picker with the common sizes — `256k`,
180
+ `512k`, `1M` — plus `auto`. The argument form accepts the same values and any explicit token count:
181
+
182
+ ```text
183
+ /context 256k
184
+ /context 1m
185
+ /context 400000
186
+ /context auto
187
+ ```
188
+
189
+ The value is stored in the config as `contextWindow` and survives restarts. A manual value outranks
190
+ whatever the provider catalogue reports, so a gateway that understates its window does not distort
191
+ the meter. It feeds both the status-bar capsule and the 80% threshold for automatic compaction.
192
+ `auto` returns to the provider's number; when the provider reports none, the meter shows `ctx ?` and
193
+ automatic compaction stays off, because it needs a known window to decide anything.
170
194
 
171
195
  Before the built-in `write` and `edit` tools change a file, KitCode creates a private checkpoint.
172
196
  `/undo` restores the latest checkpoint and leaves files with newer manual changes untouched.
@@ -211,6 +235,19 @@ in the conversation. Secret-pattern redaction is best effort; do not put credent
211
235
  Context compaction separately asks the model to preserve requirements, evidence, verification
212
236
  commands and outcomes, assumptions, and remaining work. Generated summaries can still omit details.
213
237
 
238
+ ## Subagents
239
+
240
+ The `task` tool hands one self-contained sub-task to a subagent that works in its own fresh context
241
+ and reports back a single summary. Subagents share the filesystem and working directory but have no
242
+ memory of the conversation and cannot ask questions, so the prompt has to stand alone.
243
+
244
+ Consecutive `task` calls in one model response run concurrently, and there is no fixed cap on how
245
+ many: five or ten start together. Each subagent gets its own execution lane, so their tool calls and
246
+ model requests overlap instead of queueing. Two things stay deliberately serialized: approval prompts,
247
+ because the interface shows one at a time, and the per-message budget, which the whole turn shares.
248
+ The live box lists up to three running subagents and collapses the rest into a count; `/subagents`
249
+ prints every active task with its latest progress.
250
+
214
251
  ## Configuration
215
252
 
216
253
  KitCode uses these main paths:
@@ -242,9 +279,10 @@ Minimal manual provider configuration:
242
279
  }
243
280
  ```
244
281
 
245
- The main settings are `model`, `effort`, `thinking`, `maxTokens`, `budget`, and `diagnostics`,
246
- `theme`, `permissions`, `providers`, and `mcp`. `budget` controls local per-message safety limits for model
247
- requests, tokens, estimated cost (when model pricing is available), and subagents. These values are
282
+ The main settings are `model`, `effort`, `thinking`, `contextWindow`, `maxTokens`, `budget`,
283
+ `diagnostics`, `theme`, `permissions`, `providers`, and `mcp`. `budget` controls local per-message
284
+ safety limits for model requests, tokens, estimated cost (when model pricing is available), and
285
+ subagents. These values are
248
286
  not the provider's account balance or rate limits. `diagnostics.autoRun`
249
287
  enables checks after file edits; `diagnostics.commands` can replace automatic detection with up to
250
288
  eight explicit commands. KitCode checks npm for a newer version on every app start and prints the
package/README.ru.md CHANGED
@@ -24,14 +24,15 @@ OpenAI-совместимые провайдеры, включая OpenRouter и
24
24
  - продолжение и восстановление прошлых сессий с обычным scrollback терминала;
25
25
  - поиск по сессиям, переименование, удаление и экспорт в Markdown;
26
26
  - история введённых сообщений по клавишам `↑` и `↓`;
27
- - очередь сообщений, пока агент занят;
27
+ - очередь сообщений, пока агент занят, а статусные команды и настройки выполняются сразу;
28
28
  - вложения PNG, JPEG, GIF, WebP и текстовых UTF-8 файлов;
29
- - ручное и автоматическое сжатие старого контекста;
29
+ - ручное и автоматическое сжатие старого контекста с выбором размера окна;
30
30
  - индикатор токенов, стоимости, точного заполнения контекста и rate limits провайдера;
31
31
  - автоматические чекпоинты файлов и команда `/undo`;
32
32
  - автоматическое определение проверок проекта после правок;
33
33
  - переключение моделей и провайдеров из TUI;
34
- - добавление, включение, выключение и удаление MCP без перезапуска, skills и субагенты;
34
+ - добавление, включение, выключение и удаление MCP без перезапуска, skills и субагенты,
35
+ работающие параллельно;
35
36
  - команда `/checker` для проверки runtime, провайдера, сессии, контекста и MCP;
36
37
  - русский и английский интерфейс, настраиваемый цвет темы.
37
38
 
@@ -111,6 +112,7 @@ http://localhost:11434/v1
111
112
  | `/key [provider]` | Сменить ключ провайдера. |
112
113
  | `/refresh [provider]` | Перечитать список моделей провайдера в обход суточного кеша. |
113
114
  | `/effort [auto|low|medium|high|xhigh|max]` · `/thinking` | Выбрать effort и настроить reasoning. |
115
+ | `/context [tokens\|auto]` | Показать или задать окно контекста модели для индикатора и автосжатия. |
114
116
  | `/memory show` · `/memory set <текст>` · `/memory clear` | Просмотреть, заменить или очистить постоянные заметки проекта. |
115
117
  | `/resume` · `/clear` | Восстановить сессию или начать новую. |
116
118
  | `/sessions` | Найти сессию и открыть, переименовать, удалить или экспортировать её. |
@@ -151,6 +153,10 @@ http://localhost:11434/v1
151
153
  | `Esc` | Остановить текущий запрос или закрыть окно. |
152
154
 
153
155
  Сообщения можно вводить, пока агент работает: они попадут в очередь и выполнятся по порядку.
156
+ Статусные команды и настройки — `/help`, `/usage`, `/context`, `/model`, `/effort`, `/thinking`,
157
+ `/budget`, `/theme`, `/lang`, `/subagents`, `/config`, `/checker`, `/exit` — выполняются сразу.
158
+ Команды, которые меняют текущий ход или сессию (`/clear`, `/compact`, `/resume`, `/undo`, `/login`,
159
+ `/provider`, `/logout`, `/key`, `/refresh`, `/mcp`, `/sessions`), ждут завершения хода.
154
160
 
155
161
  ## Режимы
156
162
 
@@ -165,7 +171,39 @@ http://localhost:11434/v1
165
171
  scrollback терминала, поэтому историю можно плавно листать даже во время потокового ответа.
166
172
 
167
173
  При достижении 80% известного окна KitCode автоматически сворачивает старые сообщения в сводку,
168
- оставляя последние два пользовательских хода. Команда `/compact` запускает это вручную.
174
+ оставляя последние два пользовательских хода. Команда `/compact` запускает это вручную, а
175
+ `/context` задаёт окно, если провайдер его не сообщает.
176
+
177
+ ## Окно контекста
178
+
179
+ `/context` показывает текущее окно и открывает выбор из типичных размеров — `256k`, `512k`, `1M` —
180
+ плюс `auto`. Аргумент принимает те же значения и любое явное число токенов:
181
+
182
+ ```text
183
+ /context 256k
184
+ /context 1m
185
+ /context 400000
186
+ /context auto
187
+ ```
188
+
189
+ Значение хранится в конфиге как `contextWindow` и переживает перезапуски. Ручное значение важнее
190
+ того, что сообщает каталог провайдера, поэтому шлюз, занижающий окно, не искажает индикатор.
191
+ Оно питает и капсулу в статус-баре, и порог 80% для автосжатия. `auto` возвращает число провайдера;
192
+ если провайдер ничего не сообщает, индикатор показывает `ctx ?`, а автосжатие остаётся выключенным,
193
+ потому что без известного окна решать нечего.
194
+
195
+ ## Субагенты
196
+
197
+ Инструмент `task` передаёт одну самодостаточную подзадачу субагенту, который работает в своём
198
+ свежем контексте и возвращает один итог. Субагенты делят файловую систему и рабочую папку, но не
199
+ помнят переписку и не могут задавать вопросы, поэтому промт должен быть самостоятельным.
200
+
201
+ Подряд идущие вызовы `task` в одном ответе модели выполняются параллельно, и фиксированного
202
+ лимита нет: пять или десять стартуют одновременно. У каждого субагента свой execution lane, поэтому
203
+ их инструментальные вызовы и запросы к модели перекрываются, а не выстраиваются в очередь. Две вещи
204
+ остаются заведомо последовательными: подтверждения, потому что интерфейс показывает их по одному,
205
+ и бюджет на сообщение, общий для всего хода. Живой блок показывает до трёх работающих субагентов,
206
+ остальные сворачиваются в счётчик; `/subagents` печатает каждую активную задачу с её прогрессом.
169
207
 
170
208
  Перед изменением файла встроенными инструментами `write` и `edit` KitCode создаёт приватный
171
209
  чекпоинт. Команда `/undo` восстанавливает последний чекпоинт и не перезаписывает более свежие
@@ -241,9 +279,9 @@ OpenAI-совместимых моделей параметр не отправ
241
279
  }
242
280
  ```
243
281
 
244
- Основные параметры: `model`, `effort`, `thinking`, `maxTokens`, `budget` и `diagnostics`,
245
- `theme`, `permissions`, `providers` и `mcp`. Секция `budget` задаёт лимиты запросов к модели, токенов,
246
- примерной стоимости (если провайдер сообщает цены) и субагентов на одно сообщение.
282
+ Основные параметры: `model`, `effort`, `thinking`, `contextWindow`, `maxTokens`, `budget` и
283
+ `diagnostics`, `theme`, `permissions`, `providers` и `mcp`. Секция `budget` задаёт лимиты запросов к
284
+ модели, токенов, примерной стоимости (если провайдер сообщает цены) и субагентов на одно сообщение.
247
285
  `diagnostics.autoRun` включает проверки после правок, а `diagnostics.commands` позволяет заменить
248
286
  автоопределение списком до восьми команд. При каждом входе KitCode проверяет новую версию в npm и,
249
287
  если она вышла, показывает команду обновления. `/update` повторяет проверку вручную.