minicode-ai 0.22.0 → 0.25.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 +2 -2
- package/cli/commands.ts +10 -0
- package/cli/index.ts +11 -0
- package/cli/setup.ts +64 -33
- package/cli/tui.ts +29 -3
- package/docs/README.md +2 -2
- package/docs/SUMMARY.md +10 -19
- package/docs/TERMINAL_CONTRACT.md +119 -32
- package/docs/architecture.md +1 -1
- package/docs/autonomous-scheduler.md +283 -2
- package/docs/choosing-mode.md +4 -4
- package/docs/concepts.md +39 -3
- package/docs/config.md +90 -4
- package/docs/environment.md +6 -0
- package/docs/getting-started.md +58 -2
- package/docs/repl.md +1 -1
- package/docs/security.md +49 -2
- package/docs/tools.md +2 -1
- package/package.json +2 -36
- package/src/app/provider-layer.ts +1 -1
- package/src/app/session.ts +129 -20
- package/src/config.ts +102 -2
- package/src/constants.ts +32 -4
- package/src/lib/safe-open.ts +21 -12
- package/src/memory/vector.ts +0 -31
- package/src/policy/compaction.ts +27 -0
- package/src/policy/context-budget.ts +132 -0
- package/src/policy/context-escalation.ts +140 -0
- package/src/policy/context-window.ts +14 -9
- package/src/policy/context.ts +10 -1
- package/src/policy/microcompact.ts +162 -0
- package/src/policy/no-progress.ts +1 -1
- package/src/policy/permission.ts +5 -0
- package/src/policy/scrub.ts +15 -2
- package/src/policy/tool-contract.ts +11 -9
- package/src/presentation/reducer.ts +1 -0
- package/src/providers/anthropic.ts +17 -3
- package/src/providers/detect.ts +155 -13
- package/src/providers/provision.ts +92 -1
- package/src/providers/responses.ts +13 -1
- package/src/session/persistence.ts +56 -0
- package/src/task/autonomous-policy.ts +7 -0
- package/src/task/graph-validate.ts +1 -1
- package/src/task/session-authority.ts +0 -5
- package/src/task/store.ts +0 -4
- package/src/tools/ask_user.ts +14 -1
- package/src/tools/bash.ts +57 -9
- package/src/tools/context.ts +10 -0
- package/src/tools/delete_file.ts +3 -2
- package/src/tools/edit.ts +5 -4
- package/src/tools/git.ts +70 -12
- package/src/tools/glob.ts +13 -5
- package/src/tools/grep.ts +26 -10
- package/src/tools/index.ts +3 -2
- package/src/tools/lsp.ts +15 -9
- package/src/tools/move_file.ts +4 -3
- package/src/tools/patch.ts +5 -4
- package/src/tools/read_file.ts +3 -2
- package/src/tools/read_image.ts +3 -2
- package/src/tools/task.ts +1 -0
- package/src/tools/todo.ts +4 -8
- package/src/tools/write_file.ts +4 -3
- package/src/ui/approval/prompt.ts +226 -77
- package/src/ui/assistant/simple.ts +1 -1
- package/src/ui/footer.ts +41 -29
- package/src/ui/i18n/en.ts +23 -4
- package/src/ui/i18n/id.ts +25 -4
- package/src/ui/input/input.ts +2 -2
- package/src/ui/render/activity-group.ts +1 -0
- package/src/ui/render/activity-panel.ts +21 -3
- package/src/ui/render/hint.ts +28 -0
- package/src/ui/render/ledger.ts +1 -9
- package/src/ui/render/logo.ts +86 -0
- package/src/ui/render/markdown-table.ts +0 -3
- package/src/ui/render/session-summary.ts +22 -1
- package/src/ui/render/table-grid.ts +0 -3
- package/src/ui/render/theme.ts +36 -5
- package/src/ui/runtime/screen.ts +11 -3
- package/src/ui/screens/dialog.ts +45 -81
- package/src/ui/screens/form.ts +29 -33
- package/src/ui/screens/lifecycle.ts +80 -0
- package/src/ui/screens/model-manager.ts +84 -91
- package/src/ui/screens/picker.ts +36 -33
- package/src/ui/screens/provider-manager.ts +50 -59
- package/src/ui/screens/watchdog.ts +27 -0
- package/src/ui/screens/wizard.ts +3 -20
- package/src/ui/tui/app.ts +97 -11
- package/src/ui/tui/transcript.ts +55 -16
- package/vendor/minicore/src/core/compact.ts +10 -0
- package/vendor/minicore/src/core/errors.ts +11 -1
- package/vendor/minicore/src/core/executor.ts +6 -1
- package/vendor/minicore/src/core/loop.ts +92 -2
- package/vendor/minicore/src/core/session.ts +8 -0
- package/vendor/minicore/src/providers/openai-compat.ts +15 -2
- package/docs/P14_OPEN_WORK.md +0 -290
- package/docs/config-providers.md +0 -87
- package/docs/glossary.md +0 -39
- package/docs/quickstart.md +0 -60
- package/docs/security-model.md +0 -96
- package/docs/terminal.md +0 -91
package/docs/terminal.md
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
# Kontrak Terminal
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Kontrak ini **FROZEN**: setiap perubahan perilaku terminal wajib update dokumen
|
|
5
|
-
ini + test peta proteksinya. Versi lengkap (kontrak internal kontributor, peta
|
|
6
|
-
proteksi per invariant, residual risk yang disengaja) ada di
|
|
7
|
-
[Terminal Contract](TERMINAL_CONTRACT.md).
|
|
8
|
-
|
|
9
|
-
## Satu tampilan interaktif: TUI fullscreen
|
|
10
|
-
|
|
11
|
-
Sesi interaktif (`minicode` di TTY mampu) SELALU membuka TUI **alternate
|
|
12
|
-
screen**: transkrip ala shell + status bar satu baris + popup komposit di atas
|
|
13
|
-
transkrip yang tetap terlihat (redup). REPL linier, footer lengket (chrome
|
|
14
|
-
scroll-region), overlay inline, dan jendela info **DIHAPUS** — tak ada mode,
|
|
15
|
-
tak ada flag legacy (`--tui` usang = no-op). Keluar = buffer utama kembali
|
|
16
|
-
persis; transkrip sesi tidak di-dump ke scrollback.
|
|
17
|
-
|
|
18
|
-
Jalur **non-interaktif** (one-shot prompt, `exec`, pipe/redirect/CI,
|
|
19
|
-
`TERM=dumb`, layar < 10 baris) tetap shell-first: cetak polos, append-only ke
|
|
20
|
-
scrollback, tanpa alternate screen. Justru jalur inilah yang membuat hasil agen
|
|
21
|
-
bisa di-pipe, di-grep, dan tinggal di scrollback Anda sendiri.
|
|
22
|
-
|
|
23
|
-
## Dua stream, dua isi
|
|
24
|
-
|
|
25
|
-
| Stream | Isi |
|
|
26
|
-
|---|---|
|
|
27
|
-
| stdout | Output program: teks model (wrapped, fence 2-spasi; pipe-table menjadi grid selaras di TTY), receipt perubahan (`› write_file …`), artefak perintah. Bersih dari cursor-control saat non-TTY |
|
|
28
|
-
| stderr | Progress/diagnostik: ledger tool (`› …` hijau/merah), reasoning (verbose), warning, error. Boleh transient bila TTY — ditahan saat layar interaktif memegang terminal |
|
|
29
|
-
|
|
30
|
-
- Warna hanya bila TTY (`stdout.isTTY`); `NO_COLOR` menang; `TERM`/`COLORTERM` tidak menyalakan warna di pipe.
|
|
31
|
-
- Error `pesan actionable` (berwarna merah, tanpa ikon sejak v0.17.0) sekali per kegagalan (`takePendingError`) — bukan spam di setiap langkah.
|
|
32
|
-
|
|
33
|
-
## Primitif tampilan
|
|
34
|
-
|
|
35
|
-
1. Transkrip fullscreen — prompt `minicode ›` saat editing + jawaban model + ledger, viewport ikut ekor otomatis; drag mouse membuat selection app-level, `Ctrl+C` menyalin, wheel dan `PgUp/PgDn` menggulir layar
|
|
36
|
-
2. Status bar satu baris — `✦ 00.00.00 mode model cwd` (timer `HH.MM.SS` di sebelah sparkle; redup idle, detik putih saat aktif, menit mulai terang di 60 dtk, jam di 1 jam; tanpa bullet separator; konteks rata kanan)
|
|
37
|
-
3. Popup komposit satu kotak — `/model`, `/provider`, `/sessions`, form, approval; Esc dua-tahap, kursor diparkir
|
|
38
|
-
4. Ledger — ` › name target` hijau / ` › name: …` merah
|
|
39
|
-
5. Teks model & thinking — mengalir redup (thinking), di-buffer untuk `/expand`
|
|
40
|
-
6. Error actionable — sekali per kegagalan
|
|
41
|
-
|
|
42
|
-
## Arbitrasi transient + hold layar interaktif
|
|
43
|
-
|
|
44
|
-
Satu-satunya arbitrator transient: `src/ui/runtime/statusline.ts`
|
|
45
|
-
(`acquireTransientPaint` + `paintWrite`). Painter aktif (garis status turn vs
|
|
46
|
-
spinner wizard) mutually exclusive; overlap = signal `[transient-paint]`, bukan
|
|
47
|
-
crash. Foreign stderr writer (non-UI) boleh mentah — arbitrator mengkomitnya
|
|
48
|
-
sebagai baris permanen bersih.
|
|
49
|
-
|
|
50
|
-
`beginInteractiveScreen()` menahan SEMUA painter transient selama layar
|
|
51
|
-
interaktif memegang terminal (nol byte + baris painter dibersihkan sekali;
|
|
52
|
-
nested + release idempoten). Pemegangnya: `askLine`/`askSecret`/`runPicker`
|
|
53
|
-
(raw-mode) dan setiap handle `openAltScreen` (dilepas di `close()`). Tanpa ini
|
|
54
|
-
tick `\r\x1b[2K` spinner menghapus baris prompt wizard (laporan "macet di
|
|
55
|
-
Menyiapkan sesi…").
|
|
56
|
-
|
|
57
|
-
Karena `screen.paint` kini mendiff secara inkremental, tulis ASING ke stderr
|
|
58
|
-
selama alt-screen hidup (mis. `[hooks] skipped …`, warning provider) juga
|
|
59
|
-
menandai terminal "kotor" — `statusline.consumeScreenDrift()` yang dikonsumsi
|
|
60
|
-
layar untuk memaksa repaint penuh sekali pada paint berikutnya. `beginInteractiveScreen`
|
|
61
|
-
memasang wrapper stderr pada depth 0→1 supaya sinyal ini aktif bahkan tanpa
|
|
62
|
-
owner transient. Tanpa ini fragmen asing tetap menempel di baris yang kebetulan
|
|
63
|
-
tak berubah.
|
|
64
|
-
|
|
65
|
-
## Invariant I1–I35
|
|
66
|
-
|
|
67
|
-
Peta lengkap 35 invariant + test proteksinya (mis. `tui-app`, `screen-buffer`,
|
|
68
|
-
`tui-popup`, `transient-arbitration`, `input-resize`, `exit-codes`, `acp`) ada di
|
|
69
|
-
[Terminal Contract](TERMINAL_CONTRACT.md). Setiap fitur terminal baru tunduk
|
|
70
|
-
pada invariant itu — mis. tak boleh menulis cursor-control ke stdout non-TTY,
|
|
71
|
-
tak boleh mengandalkan alternate screen di jalur non-interaktif.
|
|
72
|
-
|
|
73
|
-
Kontrak versi **v7.12** (2026-11-10) juga mencantumkan **peta gap proteksi**:
|
|
74
|
-
klaim yang implementasinya benar tetapi belum punya assertion penjaga. Baca
|
|
75
|
-
saga itu sebelum menyatakan "sudah dijaga".
|
|
76
|
-
|
|
77
|
-
## Aksesibilitas & konsol lawas
|
|
78
|
-
|
|
79
|
-
`MINICODE_ASCII=1` (glyph `[OK]`/`>`/`.`), `MINICODE_A11Y=1` (live-region approval polos tanpa ANSI), `MINICODE_BELL=0`, `MINICODE_DROPDOWN=0` (hint inline), `MINICODE_MOTION=0` (spark statis, tanpa pulse). Daftar lengkap di [Environment Variables](environment.md).
|
|
80
|
-
|
|
81
|
-
### Sinyal fatal & pemulihan terminal
|
|
82
|
-
|
|
83
|
-
Sesi TUI memasang handler SIGTERM/SIGHUP sendiri selama hidup (dilepas saat
|
|
84
|
-
quit): sinyal = raw mode dimatikan + alt-screen ditutup + exit `128+n`
|
|
85
|
-
(SIGTERM=143, SIGHUP=129) — terminal tidak tertinggal di buffer alt. `kill -9`
|
|
86
|
-
tetap di luar jangkauan (ketik `reset`; residual kontrak #2).
|
|
87
|
-
|
|
88
|
-
## Lanjut
|
|
89
|
-
|
|
90
|
-
- [Konsep & Desain](concepts.md) — kenapa interaktif pakai alt-screen, non-interaktif shell-first.
|
|
91
|
-
- [TUI — Slash & Keyboard](repl.md) — interaksi harian di atas kontrak ini.
|