autopilot-ai 2.0.0 → 2.2.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 +57 -8
- package/dist/index.js +2340 -2731
- package/dist/index.js.map +1 -1
- package/dist/sdk/index.d.ts +16 -3
- package/dist/sdk/index.js +323 -71
- package/dist/sdk/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -236,6 +236,20 @@ autopilot -p "..." --dangerously-allow-all # auto-approve mutating tool
|
|
|
236
236
|
autopilot -p "..." --reasoning # include chain-of-thought in stderr
|
|
237
237
|
```
|
|
238
238
|
|
|
239
|
+
### Run tasks on your own server
|
|
240
|
+
|
|
241
|
+
Send a task to an Autopilot server you run. It works in its own sandbox and opens a pull request, and you can close your laptop while it does.
|
|
242
|
+
|
|
243
|
+
```sh
|
|
244
|
+
autopilot remote add https://acme.example.com # approve the code in your browser; no keys copied
|
|
245
|
+
autopilot --on acme "fix the flaky checkout test" # runs on the server; uncommitted changes go along
|
|
246
|
+
autopilot runs # what's running or done, with PR links
|
|
247
|
+
autopilot runs watch <run> # follow a run (Ctrl-C detaches, the run keeps going)
|
|
248
|
+
autopilot pull <run> # check out the run's branch here
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
The run starts from the last commit your branch shares with `origin`. Unpushed commits, staged and unstaged edits, and untracked files that aren't ignored are sent along as a patch, up to 3 MiB. Add `--detach` to return right away and `-m <model>` to pick one of the server's models. Each task gets its own sandbox and branch, so several can run at once. The server keeps the model key and GitHub credentials; your laptop holds only a revocable, 90-day pairing credential in `~/.config/autopilot/remotes.json`. Setting up the server side is covered in [docs/aster-api.md](docs/aster-api.md).
|
|
252
|
+
|
|
239
253
|
### Headless SDK
|
|
240
254
|
|
|
241
255
|
Use autopilot programmatically from your own application — no TUI required.
|
|
@@ -390,7 +404,6 @@ autopilot
|
|
|
390
404
|
| `/mode edit\|plan\|auto` | Switch permission mode |
|
|
391
405
|
| `/shell auto\|bash\|cmd\|powershell` | Show or set the shell for the bash tool |
|
|
392
406
|
| `/thinking low\|medium\|high` | Reasoning effort (persists) |
|
|
393
|
-
| `/theme` | Interactive theme picker (`Ctrl+T`) |
|
|
394
407
|
| `/resume` | Pick a past conversation to restore |
|
|
395
408
|
| `/compact` | Summarize older turns to free context |
|
|
396
409
|
| `/init` | Scan repo and write `KIMI.md` project context |
|
|
@@ -401,9 +414,10 @@ autopilot
|
|
|
401
414
|
| `/provider` | List providers, or switch with `/provider <id> [key]` (see [Providers](#providers)) |
|
|
402
415
|
| `/jev` | Ask Jev for a typed, scoped one-shot decision |
|
|
403
416
|
| `/subagents` | List running subagents; `/subagents cancel <n>\|all` stops them; `/subagents off\|suggest\|auto` sets the delegation policy (default: `auto`) |
|
|
404
|
-
| `/now` | Run your latest queued message now instead of after the current turn
|
|
417
|
+
| `/now` | Run your latest queued message now instead of after the current turn |
|
|
405
418
|
| `/key` | Show the active provider's key — on OpenRouter with spend and credit (`/key set <key>`, `/key clear`) |
|
|
406
419
|
| `/cost` | Show cost by session, day, month and all time (OpenRouter-confirmed, or estimated from the provider's prices) |
|
|
420
|
+
| `/good` / `/bad` `[note]` | Rate the last turn; recorded in the session trace when [tracing](#session-traces-and-evals) is on |
|
|
407
421
|
| `/update` | Check for updates |
|
|
408
422
|
| `/help` | List all commands |
|
|
409
423
|
|
|
@@ -428,10 +442,8 @@ Type `!` followed by a command (for example `! gh auth login`) to run it in your
|
|
|
428
442
|
| `Ctrl+C` / `Esc` | Interrupt current turn when busy; exit when idle |
|
|
429
443
|
| `Ctrl+R` | Toggle reasoning display |
|
|
430
444
|
| `Ctrl+O` | Toggle verbose tool output |
|
|
431
|
-
| `Ctrl+T` | Open theme picker |
|
|
432
445
|
| `Shift+Tab` | Cycle mode (edit → plan → auto) |
|
|
433
446
|
| `↑` / `↓` | Walk prompt history |
|
|
434
|
-
| `Ctrl+G` | While the agent works: run your latest queued message now instead of after the turn |
|
|
435
447
|
|
|
436
448
|
### Messages sent while the agent is working
|
|
437
449
|
|
|
@@ -439,7 +451,7 @@ A message you send mid-turn is triaged instead of always waiting in line:
|
|
|
439
451
|
|
|
440
452
|
- **interrupt** ("stop, that's the wrong file"): the turn stops at the next safe point and your message runs next. Running subagents are never cancelled by an interrupt; while they run, the message is delivered as soon as they finish.
|
|
441
453
|
- **steer** ("also handle the empty case"): folded into the current task at the agent's next step.
|
|
442
|
-
- **queue** ("after this, update the changelog", or anything unclear): runs as its own turn afterwards.
|
|
454
|
+
- **queue** ("after this, update the changelog", or anything unclear): runs as its own turn afterwards. Send `/now` to promote it.
|
|
443
455
|
- **aside** ("how's it going?"): answered from the current state without disturbing the turn.
|
|
444
456
|
|
|
445
457
|
Clear phrasing is decided instantly; ambiguous messages get a quick model check (OpenRouter only), and anything uncertain is queued. Use `/subagents cancel <n>` to stop a single subagent.
|
|
@@ -498,6 +510,33 @@ Each log entry maps to one OTel `LogRecord`. Correlation IDs
|
|
|
498
510
|
encoding, and a `service.name=kimiflare` + `service.version` pair sits
|
|
499
511
|
on the resource.
|
|
500
512
|
|
|
513
|
+
## Session traces and evals
|
|
514
|
+
|
|
515
|
+
Autopilot can record its own sessions so you can see how it performs on your work, and compare setups on your own tasks. Everything stays on your machine.
|
|
516
|
+
|
|
517
|
+
### Session traces
|
|
518
|
+
|
|
519
|
+
Tracing is off by default. Turn it on for one run with `KIMIFLARE_TRACE=1`, or always with `"trace": { "enabled": true }` in `~/.config/kimiflare/config.json`. Each session then writes a `trace.jsonl` under `~/.local/share/kimiflare/traces/` (`KIMIFLARE_TRACE_DIR` or `trace.root` to change it), one event per line:
|
|
520
|
+
|
|
521
|
+
- every model request and response, with tokens, cost and latency
|
|
522
|
+
- tool calls and their results, and each permission decision
|
|
523
|
+
- compactions, completion checks, subagents and turn ends
|
|
524
|
+
- **outcome signals:** the git changes a session made, test, lint, typecheck and build commands and whether they passed, your `/good` and `/bad` ratings (with an optional note), and whether your next message corrected the agent or told it to carry on
|
|
525
|
+
|
|
526
|
+
Large bodies are stored once, by hash, next to the trace. Likely secrets are redacted before anything is written, nothing is uploaded, and old traces are pruned automatically: after 90 days, above 200 MB for one session, or when all traces pass 2 GB.
|
|
527
|
+
|
|
528
|
+
### Evals
|
|
529
|
+
|
|
530
|
+
`autopilot eval` runs Autopilot headlessly on a set of tasks and compares two configurations: a model, a setting, or a harness change.
|
|
531
|
+
|
|
532
|
+
```bash
|
|
533
|
+
autopilot eval run --tasks evals/tasks/autopilot-bench --config evals/configs/baseline.json --model <id> --out /tmp/eval-a
|
|
534
|
+
autopilot eval run --tasks evals/tasks/autopilot-bench --config evals/configs/my-change.json --model <id> --out /tmp/eval-b
|
|
535
|
+
autopilot eval compare /tmp/eval-a/results.jsonl /tmp/eval-b/results.jsonl
|
|
536
|
+
```
|
|
537
|
+
|
|
538
|
+
Each task is a JSON file naming a repo, a base commit, a prompt and a test command. Every run gets its own git worktree with tracing forced on, and the task passes if the test exits 0. `eval compare` prints success rates with a paired significance test, cost, turns and the tasks that flipped. This repository ships `autopilot-bench`, twenty tasks mined from its own merged pull requests; see [evals/README.md](evals/README.md) for the task format and how to build a set from your own repo.
|
|
539
|
+
|
|
501
540
|
## Hooks
|
|
502
541
|
|
|
503
542
|
autopilot can fire shell commands at these points, configured
|
|
@@ -507,12 +546,12 @@ still read (see [Settings location](#settings-location)):
|
|
|
507
546
|
|
|
508
547
|
| Event | Fires when | Veto? |
|
|
509
548
|
|--------------------|-------------------------------------------------|-------|
|
|
510
|
-
| `SessionStart` | A session's first
|
|
549
|
+
| `SessionStart` | A session's first prompt, before `UserPromptSubmit` (`source`: startup/resume) | No |
|
|
511
550
|
| `PreToolUse` | A tool call is about to run | Yes |
|
|
512
551
|
| `PostToolUse` | A tool call just finished (success or failure) | No |
|
|
513
552
|
| `PostToolUseFailure` | A tool call failed (also fires `PostToolUse`) | No |
|
|
514
553
|
| `PermissionRequest` | You're about to be asked to approve a call | Allow / deny |
|
|
515
|
-
| `UserPromptSubmit` |
|
|
554
|
+
| `UserPromptSubmit` | A prompt is submitted, in every mode (TUI, `-p`, `--emit-events`, `serve`, SDK) | Yes |
|
|
516
555
|
| `Stop` | A turn ended cleanly | No |
|
|
517
556
|
| `PreCompact` | Auto-compaction is about to run | No |
|
|
518
557
|
| `SessionEnd` | autopilot exits, or `/clear` (`reason`) | No |
|
|
@@ -528,7 +567,17 @@ prefer reading stdin. Payloads
|
|
|
528
567
|
also carry Claude Code's field names (`hook_event_name`, `tool_name`,
|
|
529
568
|
`tool_input`, `tool_response`, `tool_call_id`, `transcript_path`), so
|
|
530
569
|
Claude Code hook scripts — and tools built for them, like
|
|
531
|
-
[Agent Beacon](docs/beacon.md) — work unchanged.
|
|
570
|
+
[Agent Beacon](docs/beacon.md) — work unchanged. A successful
|
|
571
|
+
`write`/`edit`'s `tool_response` carries Claude Code's `structuredPatch`
|
|
572
|
+
and `originalFile` (and `type: "create" | "update"` for `Write`); see
|
|
573
|
+
[docs/beacon.md](docs/beacon.md#tool-names-and-result-shapes) for the
|
|
574
|
+
size limits.
|
|
575
|
+
|
|
576
|
+
A blocked `UserPromptSubmit` never reaches the model: the TUI shows the
|
|
577
|
+
reason, `-p` and one-shot `--emit-events` exit with code **44**,
|
|
578
|
+
`serve` answers `403 prompt_blocked`, and the SDK's `prompt()` rejects
|
|
579
|
+
with `PromptBlockedError` (details in
|
|
580
|
+
[docs/beacon.md](docs/beacon.md#session-and-prompt-events)).
|
|
532
581
|
#### Blocking and exit codes
|
|
533
582
|
|
|
534
583
|
Veto events (`PreToolUse`, `UserPromptSubmit`) follow Claude Code's rules:
|