minicode-ai 0.23.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/tui.ts +28 -2
- package/docs/README.md +2 -2
- package/docs/SUMMARY.md +10 -19
- package/docs/TERMINAL_CONTRACT.md +82 -28
- 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 +3 -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/config.ts +2 -0
- package/src/constants.ts +3 -0
- package/src/lib/safe-open.ts +21 -12
- package/src/memory/vector.ts +0 -31
- package/src/policy/context-window.ts +0 -33
- 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 +3 -3
- package/src/providers/detect.ts +27 -0
- package/src/providers/provision.ts +15 -1
- 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/footer.ts +41 -29
- package/src/ui/i18n/en.ts +4 -0
- package/src/ui/i18n/id.ts +4 -0
- package/src/ui/render/activity-group.ts +1 -0
- package/src/ui/render/ledger.ts +1 -9
- package/src/ui/render/logo.ts +0 -5
- package/src/ui/render/markdown-table.ts +0 -3
- package/src/ui/render/table-grid.ts +0 -3
- package/src/ui/render/theme.ts +31 -5
- package/src/ui/runtime/screen.ts +7 -1
- package/src/ui/screens/dialog.ts +45 -81
- package/src/ui/screens/form.ts +10 -10
- package/src/ui/screens/model-manager.ts +7 -10
- package/src/ui/screens/picker.ts +8 -11
- package/src/ui/screens/provider-manager.ts +9 -13
- package/src/ui/tui/app.ts +92 -9
- package/src/ui/tui/transcript.ts +4 -0
- 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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Autonomous Scheduler (eksperimental)
|
|
1
|
+
# Autonomous Scheduler & Open Work (eksperimental)
|
|
2
2
|
|
|
3
3
|
> **Eksperimental.** Opt-in per invokasi, nonaktif secara bawaan, dan dipicu manual.
|
|
4
4
|
> Tidak ada timer latar (no background timer). Tidak ada yang berjalan kecuali Anda memintanya.
|
|
@@ -135,8 +135,289 @@ kebijakannya sempit, bukan permisif.
|
|
|
135
135
|
tertutup.
|
|
136
136
|
- Eksperimental. Antarmukanya bisa berubah.
|
|
137
137
|
|
|
138
|
+
## Open Work lintas sesi
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
minicode openwork ① TEMUKAN (read-only, lintas sesi)
|
|
142
|
+
minicode openwork inventory ①b AUDIT (inventaris P14.0 lintas sumber)
|
|
143
|
+
minicode openwork context --session S --task tN
|
|
144
|
+
①c SUSUN KONTEKS (P14.5, tanpa eksekusi)
|
|
145
|
+
minicode --session <target> \
|
|
146
|
+
--adopt-task <source>/<taskId> "..." ② ADOPSI (eksplisit, otoritas ganda)
|
|
147
|
+
/scheduler run ③ LANJUTKAN (manual, lewat gate continuity)
|
|
148
|
+
(minimum satu turn) ④ KERJAKAN (claim = generasi BARU)
|
|
149
|
+
minicode openwork --closed ⑤ TUTUP (feedback berprovenance)
|
|
150
|
+
minicode openwork export --out FILE ⑤b EKSPOR (json/md, atomik)
|
|
151
|
+
minicode openwork merge ... ⑥ DEDUP (eksplisit + evidence)
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### ① Menemukan: `minicode openwork`
|
|
155
|
+
|
|
156
|
+
Portofolio read-only seluruh task non-terminal di **workspace ini** (tasks.db
|
|
157
|
+
memang per-workspace — sesi proyek lain memang tidak terlihat, itu batas yang
|
|
158
|
+
benar, bukan bug), **ditambah** kandidat intent terstruktur dari histori
|
|
159
|
+
(lihat "Kandidat intent" di bawah).
|
|
160
|
+
|
|
161
|
+
```
|
|
162
|
+
Open Work — 1 item(s) · 1 intent · 1 stale · 0 unknown-provenance
|
|
163
|
+
workspace: D:\proyek · stale after 7d · TaskStore remains the sole status authority
|
|
164
|
+
|
|
165
|
+
p14ow-source/t1 · IN_PROGRESS · PARTIAL · P2 · 2d old
|
|
166
|
+
title: Fix login bug
|
|
167
|
+
flags: STALE · FROM:p14ow-source · SIMILAR×2(UNPROVEN)
|
|
168
|
+
blockers: TASK_BLOCKED: API key rotated
|
|
169
|
+
depends on: t2 (PENDING, unsatisfied)
|
|
170
|
+
next: resume: rebuild context from provenance, then continue via TaskStore/Scheduler
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Arti bidang:
|
|
174
|
+
|
|
175
|
+
| Bidang | Makna |
|
|
176
|
+
|---|---|
|
|
177
|
+
| `status` | status kanonik TaskStore — **satu-satunya otoritas** |
|
|
178
|
+
| state (kolom ke-4) | state P14.1 berbasis bukti: `OPEN/PARTIAL/BLOCKED/WAITING_FOR_USER/DELEGATED/FAILED_NEEDS_FOLLOWUP/UNKNOWN`; verifikasi gagal → FAILED_NEEDS_FOLLOWUP, dependensi tak tuntas → BLOCKED |
|
|
179
|
+
| `P0..P3` | prioritas presentasi: BLOCKED/FAILED=P0, WAITING/DELEGATED/UNKNOWN=P1, PARTIAL=P2, OPEN=P3; item STALE dinaikkan satu tingkat — umur sinyal, bukan bukti |
|
|
180
|
+
| `blockers:` | blocker eksplisit (TASK_BLOCKED / DEPENDENCY / VERIFICATION); kosong = tidak ada yang diklaim |
|
|
181
|
+
| `depends on:` | dependensi kanonik direkonsiliasi ke status saat baca; hanya COMPLETED yang *satisfied* |
|
|
182
|
+
| `next:` | tindak lanjut eksplisit — selalu lewat jalur otoritas yang ada; openwork TIDAK PERNAH mengeksekusi |
|
|
183
|
+
|
|
184
|
+
Arti penanda:
|
|
185
|
+
|
|
186
|
+
| Penanda | Makna | Tindak lanjut |
|
|
187
|
+
|---|---|---|
|
|
188
|
+
| `STALE` | baris tak bergerak ≥ ambang (default 7 hari, `--stale-days <n>`) | prioritas, bukan keputusan otoritas |
|
|
189
|
+
| `PROVENANCE-UNKNOWN` | tidak ada baris sesi di sessions.db — asal tak bisa ditelusuri | periksa manual; jangan dianggap rusak |
|
|
190
|
+
| `FROM:<sesi>` | task ini DIPINDAHKAN dari sesi lain (ledger `task_transfers`) | provenance asal eksplisit |
|
|
191
|
+
| `SIMILAR×N(UNPROVEN)` | N task berbagi judul ternormalisasi | **bukan bukti duplikat** — lihat ⑥ |
|
|
192
|
+
| `DUP-GROUP×N(UNPROVEN)` | grup duplikat **lintas sesi** (task + intent) beranggota N | lihat seksi "Grup duplikat lintas sesi" |
|
|
193
|
+
|
|
194
|
+
Filter: `--session <id>`, `--status <S>`, `--state <S>`, `--priority <P0..P3>`,
|
|
195
|
+
`--min-age-days <n>`, `--blocked`, `--depends-on <taskId>`, `--closed`,
|
|
196
|
+
`--json` (satu objek JSON mesin di stdout). Exit: `0` sukses (termasuk daftar
|
|
197
|
+
kosong), `1` gagal runtime/lookup, `2` salah pakai (nilai enum tak dikenal
|
|
198
|
+
termasuk).
|
|
199
|
+
|
|
200
|
+
**Batas kejujuran:** `openwork` tidak pernah menulis apa pun — tidak
|
|
201
|
+
mengakuisisi lease, tidak membuat sessions.db, tidak menulis backup manifest
|
|
202
|
+
korup, tidak memicu scheduler. Ia indeks, bukan otoritas. (Dijaga guard
|
|
203
|
+
arsitektur + tes nol-mutasi, kini termasuk jalur inventaris.)
|
|
204
|
+
|
|
205
|
+
### Kandidat intent: histori terstruktur, TANPA menebak prosa
|
|
206
|
+
|
|
207
|
+
Portofolio juga menampilkan **kandidat intent open** dari histori yang
|
|
208
|
+
terstruktur dan durable:
|
|
209
|
+
|
|
210
|
+
| Sumber | Kapan jadi kandidat | State |
|
|
211
|
+
|---|---|---|
|
|
212
|
+
| `plan.updated` | langkah plan `pending`/`active`/`blocked` **tanpa** task kanonik (atau baris task-nya hilang) | OPEN / PARTIAL / BLOCKED |
|
|
213
|
+
| `approval.requested` | belum ada `approval.settled` | WAITING_FOR_USER |
|
|
214
|
+
| sesi anak sub-agent | belum ada hasil terminal | DELEGATED |
|
|
215
|
+
| sesi anak + `turn.failed` | delegasi gagal | FAILED_NEEDS_FOLLOWUP |
|
|
216
|
+
| run `INTERRUPTED` | eksekusi terputus (restart/kill) | FAILED_NEEDS_FOLLOWUP |
|
|
217
|
+
|
|
218
|
+
Yang SENGAJA tidak dilakukan: memindai isi pesan bebas pengguna. Janji dari
|
|
219
|
+
prosa ("nanti kita perbaiki login") TIDAK PERNAH menjadi tugas — roadmap P14
|
|
220
|
+
melarang menganggap brainstorming sebagai task, dan menentukan kapan intent
|
|
221
|
+
prosa jadi komitmen adalah keputusan produk yang belum diputuskan pemilik.
|
|
222
|
+
|
|
223
|
+
Aturan kejujuran ekstraksi (dijaga tes):
|
|
224
|
+
|
|
225
|
+
1. Langkah plan yang menunjuk task kanonik yang masih OPEN **menempel sebagai
|
|
226
|
+
bukti** di entri task (`plan evidence`), bukan item duplikat.
|
|
227
|
+
2. Langkah plan yang mengaku `active` atas task yang SUDAH terminal tidak
|
|
228
|
+
dihidupkan kembali — masuk closure dengan alasan "canonical task
|
|
229
|
+
<status> supersedes plan claim", konflik diungkap, bukan disembunyikan.
|
|
230
|
+
3. Approval yang di-**allow** bukan bukti pekerjaan selesai — tidak
|
|
231
|
+
menghasilkan kandidat apa pun (hanya deny yang menghasilkan DECLINED).
|
|
232
|
+
4. Run `RUNNING` bukan open loop — runtime hidup adalah kondisi normal.
|
|
233
|
+
5. Cakupan pencarian dibatasi binding `cwd` baris sesi; **sesi anak mewarisi
|
|
234
|
+
cakupan leluhur termulaiannya** (hasil sub-agent tetap terlihat); sesi
|
|
235
|
+
tanpa binding dilabel UNBOUND dan dikeluarkan — tidak ada yang ditebak.
|
|
236
|
+
6. `plan.updated` adalah **snapshot**, bukan delta: adaptor menerbitkannya setiap
|
|
237
|
+
`todo_write` sukses dengan SELURUH daftar langkah. Hanya snapshot TERAKHIR
|
|
238
|
+
per **sesi** yang dibaca (bukan per `planId` — `planId` memuat nomor turn,
|
|
239
|
+
sedangkan daftar todo milik sesi). Akibatnya: versi pending/active lama tidak
|
|
240
|
+
muncul sebagai open loop kedua, langkah yang dihapus dari daftar tidak
|
|
241
|
+
dihidupkan, dan langkah yang masih terbuka tidak berganda di setiap turn.
|
|
242
|
+
|
|
243
|
+
### Grup duplikat lintas sesi (P14.3 penuh)
|
|
244
|
+
|
|
245
|
+
Kandidat dengan judul ternormalisasi sama **lintas sesi** (termasuk task vs
|
|
246
|
+
langkah plan) dikelompokkan dan diungkapkan:
|
|
247
|
+
|
|
248
|
+
```
|
|
249
|
+
Similar groups — 1 (UNPROVEN, never auto-merged)
|
|
250
|
+
"fix login bug" ×2 across 2 session(s) · DIVERGENT states
|
|
251
|
+
sessions: p14fs-a · p14fs-b
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
Grup dengan state yang saling bertentangan ditandai `DIVERGENT` (jumlahnya
|
|
255
|
+
juga di header + `counts.conflicts`). Grup **tidak pernah** menyatukkan apa
|
|
256
|
+
pun: perpindahan otoritas tetap wajib adopsi eksplisit (②), merge tetap
|
|
257
|
+
satu-sesi (⑥). Tugas berulang yang sengaja independen boleh berbagi grup —
|
|
258
|
+
itu penanda untuk diperiksa, bukan vonis.
|
|
259
|
+
|
|
260
|
+
### ①b Inventaris: `minicode openwork inventory [--json]`
|
|
261
|
+
|
|
262
|
+
Inventaris P14.0 lintas sumber, read-only: jumlah sesi (in-scope / foreign /
|
|
263
|
+
unbound / anak), task (total/open/terminal), event presentasi per tipe, run,
|
|
264
|
+
manifest checkpoint (termasuk yang **corrupt** — dilabel, tidak dibackup oleh
|
|
265
|
+
proyeksi), langkah plan, approval, dan hasil sub-agent. Sesi yang dikeluarkan
|
|
266
|
+
dicantumkan **dengan alasannya**. Event yang gagal didekode dilaporkan sebagai
|
|
267
|
+
"unreadable", tidak disembunyikan.
|
|
268
|
+
|
|
269
|
+
### ①c Konteks: `minicode openwork context --session <id> --task <taskId>`
|
|
270
|
+
|
|
271
|
+
Context pack P14.5 untuk satu task: field kanonik (status/revisi/verification/
|
|
272
|
+
dependsOn/evidence), state + prioritas + blocker + next action, bukti langkah
|
|
273
|
+
plan, ketersediaan checkpoint (termasuk corrupt), provenance transfer/merge,
|
|
274
|
+
freshness, dan **checklist resume**. Pack ini murni baca — checklist menunjuk
|
|
275
|
+
jalur yang MEMAKSAK otoritas saat resume (ceiling P12, gate continuity P13.3,
|
|
276
|
+
claim generation TaskStore, budget/cancellation P12/P13); openwork sendiri
|
|
277
|
+
tidak memeriksa apalagi mengeksekusi. Exit `1` bila task tak ditemukan,
|
|
278
|
+
`2` bila id cacat.
|
|
279
|
+
|
|
280
|
+
### ② Mengadopsi: `--adopt-task <source>/<taskId>`
|
|
281
|
+
|
|
282
|
+
Satu task per invokasi, HANYA saat startup sesi tujuan, sebelum turn pertama:
|
|
283
|
+
|
|
284
|
+
```
|
|
285
|
+
minicode --session target --adopt-task p14ow-source/t1 "lanjutkan pekerjaan ini"
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
Yang terjadi (satu transaksi TaskStore, dicek ulang di dalam transaksi):
|
|
289
|
+
inkarnasi sumber+tujuan, revisi, **kedua lease** (token sumber dan tujuan),
|
|
290
|
+
status non-terminal, konsistensi lineage, tabrakan id target, dan provenance
|
|
291
|
+
relasi. Penulis sesi sumber yang **hidup** = `REFUSED_SOURCE_BUSY` (tidak ada
|
|
292
|
+
takeover paksa). Lease sumber kedaluwarsa = takeover + **fence epoch** —
|
|
293
|
+
proses lama tidak bisa lagi renew/release/menulis/menjadwalkan sesi sumber.
|
|
294
|
+
|
|
295
|
+
Yang TIDAK terjadi: tidak menyalin task, tidak membuat generasi baru, tidak
|
|
296
|
+
menandai selesai, tidak menyentuh jurnal runtime/child run/approval, dan
|
|
297
|
+
**tidak memicu scheduler**. Task in-flight hasil adopsi tetap `IN_PROGRESS`
|
|
298
|
+
dengan lineage asli — apakah boleh dilanjutkan adalah keputusan gate (③),
|
|
299
|
+
bukan adopsi.
|
|
300
|
+
|
|
301
|
+
Rantai relasi diadopsi **berurutan** (parent/dependency dulu, lalu anak);
|
|
302
|
+
penolakan menamai id yang belum diadopsi. Id task tidak pernah direnumber.
|
|
303
|
+
|
|
304
|
+
### ③ Melanjutkan: `/scheduler run` (manual, tersupervisi)
|
|
305
|
+
|
|
306
|
+
Adopsi tidak menyalakan scheduler. Lanjutan tetap lewat trigger manual yang
|
|
307
|
+
sudah ada (`/scheduler run` di sesi TUJUAN; butuh `--enable-scheduler` saat
|
|
308
|
+
memulai sesi CLI, sedangkan sesi daemon hosted mendapatkannya via
|
|
309
|
+
`--runtime owned`). Reconcilasi menilai task in-flight hasil
|
|
310
|
+
adopsi lewat **continuity gate P13.3** — kontraknya tidak berubah:
|
|
311
|
+
|
|
312
|
+
- `SAFE_TO_RETRY` (bukti resume + admission + **seluruh** scope tool otonom
|
|
313
|
+
read-only) → revert ke PENDING → **claim generasi BARU** → dispatch serial.
|
|
314
|
+
- Selain itu → `HOLD` / `REQUIRES_VERIFIER`, baris tidak disentuh, nol
|
|
315
|
+
dispatch. Tanpa gate = HOLD (fail-closed).
|
|
316
|
+
|
|
317
|
+
**Tidak pernah ada replay instruksi tool jurnal lama** — work item hanya
|
|
318
|
+
membawa `(taskId, title, instruction, sessionId)`; eksekusi baru lahir dari
|
|
319
|
+
claim baru. Permission ceiling P12, budget, cancellation, dan stop criteria
|
|
320
|
+
P13 tetap berlaku persis seperti sesi biasa.
|
|
321
|
+
|
|
322
|
+
### ④ Menutup: lifecycle biasa
|
|
323
|
+
|
|
324
|
+
Selesaian lewat jalur kanonik yang sudah ada (verifier / `todo_write` /
|
|
325
|
+
operator) — P14 tidak punya jalur penutupan sendiri dan tidak pernah
|
|
326
|
+
menulis `COMPLETED` atas nama operator.
|
|
327
|
+
|
|
328
|
+
### ⑤ Feedback penutupan: `minicode openwork --closed`
|
|
329
|
+
|
|
330
|
+
Closure feedback adalah **pembacaan ulang status kanonik + ledger**, bukan
|
|
331
|
+
kesimpulan: task yang sudah terminal dan punya provenance P14 (transfer
|
|
332
|
+
atau merge) muncul dengan `status`, `closed`, `FROM <sesi>`,
|
|
333
|
+
`duplicate-of <task>`, dan evidence operator. Duplikat yang dibuka kembali
|
|
334
|
+
operator otomatis muncul lagi di seksi open — status saat itulah kebenaran.
|
|
335
|
+
|
|
336
|
+
Sejak pengiriman full-scope, closure juga mencakup **artefak intent terminal**
|
|
337
|
+
(`kind INTENT`) dengan **label klaim** yang wajib dibaca:
|
|
338
|
+
|
|
339
|
+
| `claim` | Arti |
|
|
340
|
+
|---|---|
|
|
341
|
+
| `verified` | task kanonik terminal dengan `verification.verdict = passed` |
|
|
342
|
+
| `unverified` | klaim penyelesaian oleh artefak (mis. plan step `completed`) **tanpa** verifikasi — ditampilkan apa adanya, BUKAN disembunyikan, BUKAN dianggap terbukti |
|
|
343
|
+
| `not-applicable` | DECLINED/CANCELLED — tidak ada klaim penyelesaian untuk diverifikasi |
|
|
344
|
+
|
|
345
|
+
Termasuk: approval yang ditolak pengguna → `DECLINED` (terminal, tidak pernah
|
|
346
|
+
hidup lagi sebagai open loop), dan langkah plan yang mengaku `active` atas task
|
|
347
|
+
terminal → closure dengan alasan "canonical task `<status>` supersedes plan
|
|
348
|
+
claim" — konflik klaim diungkap, tidak ditelan.
|
|
349
|
+
|
|
350
|
+
### ⑤b Ekspor: `minicode openwork export --out <path> [--format json|md] [--force]`
|
|
351
|
+
|
|
352
|
+
- `json` (default) — objek portofolio lengkap (selalu menyertakan inventaris
|
|
353
|
+
P14.0), indentasi 2 spasi.
|
|
354
|
+
- `md` — laporan manusia tersanitasi (judul/evidence bebas sekuens ANSI).
|
|
355
|
+
- Ditulis **atomik** (`atomicWriteText`); **menolak menimpa** berkas yang ada
|
|
356
|
+
kecuali `--force`; kegagalan tulis = exit `1` tanpa berkas sampah `.tmp.*`.
|
|
357
|
+
|
|
358
|
+
### ⑥ Dedup eksplisit: `openwork merge`
|
|
359
|
+
|
|
360
|
+
```
|
|
361
|
+
minicode openwork merge --session target --keep t1 --drop t2 \
|
|
362
|
+
--evidence "satu unit kerja yang sama: sama-sama memperbaiki login bug"
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
Aturan (dijaga tes + guard):
|
|
366
|
+
|
|
367
|
+
1. **Evidence WAJIB** dan direkam utuh di ledger append-only `task_merges`.
|
|
368
|
+
Kemiripan judul TIDAK PERNAH menjadi bukti; `SIMILAR×N(UNPROVEN)` hanyalah
|
|
369
|
+
penanda. Tidak ada merge otomatis dari proyeksi.
|
|
370
|
+
2. Duplikat ditutup **`CANCELLED`, bukan `COMPLETED`** — menyatakan "dikerjakan
|
|
371
|
+
di task lain" tidak boleh meng-inferr penyelesaian.
|
|
372
|
+
3. Penulisan status lewat `patchTask` (lifecycle biasa: revisi maju, ownership
|
|
373
|
+
in-flight dilepas) + INSERT ledger dalam **SATU transaksi** — gagal ledger =
|
|
374
|
+
status ikut rollback.
|
|
375
|
+
4. Duplikat terminal ditolak (pekerjaan tertutup tidak dibuka untuk ditutup
|
|
376
|
+
lagi). Survivor terminal BOLEH (kasus klasik: pending ternyata sudah
|
|
377
|
+
dikerjakan task yang selesai — duplikat tetap CANCELLED).
|
|
378
|
+
5. **Antar-sesi ditolak**: merge hanya satu namespace. Duplikat lintas sesi
|
|
379
|
+
harus diadopsi dulu (②), lalu merge di sesi tujuan.
|
|
380
|
+
6. Pembalikan = penulisan lifecycle biasa (patch status kembali). Ledger
|
|
381
|
+
append-only tetap mencatat deklarasi — audit sejarah, status = kebenaran.
|
|
382
|
+
|
|
383
|
+
### Peta bukti
|
|
384
|
+
|
|
385
|
+
| Klaim | Bukti |
|
|
386
|
+
|---|---|
|
|
387
|
+
| Proyeksi read-only (nol mutasi) | `test/p14-open-work.test.ts` (proyeksi nol-mutasi) |
|
|
388
|
+
| Nol mutasi jalur PENUH (histori + inventaris ikut diuji; tanpa backup manifest korup) | `test/p14-full-scope.test.ts` (zero-mutasi proyeksi penuh) |
|
|
389
|
+
| UNKNOWN/stale dilabel jujur | `test/p14-open-work.test.ts` (provenance UNKNOWN tanpa membuat sessions.db; STALE ambang disuntik) |
|
|
390
|
+
| Kemiripan bukan identitas | idem (SIMILAR UNPROVEN, ambiguous tetap terpisah) |
|
|
391
|
+
| Grup duplikat LINTAS SESI + konflik divergent, tanpa merge otomatis | `test/p14-full-scope.test.ts` (P14.3 grup lintas sesi) |
|
|
392
|
+
| Kontrak P14.1: state/prioritas/next action murni + fail-closed | idem (P14.1 kontrak murni) |
|
|
393
|
+
| Ekstraksi intent: approval allow ≠ COMPLETED; pesan bebas tak dipindai; cakupan lineage | idem (P14.2 extractIntentCandidates) |
|
|
394
|
+
| Klaim plan atas task terminal: tak dihidupkan, konflik diungkap, label claim verified/unverified | idem (P14.2 proyeksi histori) |
|
|
395
|
+
| Inventaris P14.0 lintas sumber + sesi dikeluarkan dengan alasan | idem (P14.0 inventaris) |
|
|
396
|
+
| Matriks forensik: restart/terputus/pembatalan/stale | idem (P14.6 matriks forensik) |
|
|
397
|
+
| Portofolio: blocker/dependensi/verifikasi/next action | idem (P14.4 bidang portofolio) |
|
|
398
|
+
| CLI: filter baru, inventory, context, export atomik + sanitasi | idem (CLI full-scope; exit 0/1/2 sesuai I28) |
|
|
399
|
+
| Merge aman/auditable/atomic | `test/p14-open-work.test.ts` (DECLARED/refusal/terminal/stale/atomic-rollback/pembalikan) |
|
|
400
|
+
| Alur ①→⑤ utuh, generasi baru, tanpa replay | idem (P14.5 alur operator) |
|
|
401
|
+
| Adopsi: otoritas ganda, fence, ledger transfer | `test/p14-cross-session-adoption.test.ts` (14 skenario) |
|
|
402
|
+
| Guard "bukan TaskStore/scheduler kedua" + proyeksi murni | `test/p2-architecture-guards.test.ts` |
|
|
403
|
+
| Kontrak penulis CLI (OAP-008) | `test/writer-inventory.test.ts` (deklarasi per writer) |
|
|
404
|
+
| Snapshot `plan.updated` dikolaps per sesi (tanpa duplikasi riwayat) | `test/p14-full-scope.test.ts` (5 tes snapshot plan) |
|
|
405
|
+
|
|
406
|
+
### Batas scope yang TIDAK diklaim
|
|
407
|
+
|
|
408
|
+
Dokumen ini sengaja tidak menjanjikan hal-hal berikut; semuanya eksklusi
|
|
409
|
+
scope P14 yang disetujui pemilik 2026-10-26, bukan pekerjaan tertunda:
|
|
410
|
+
|
|
411
|
+
| Tidak ada | Alasan |
|
|
412
|
+
|---|---|
|
|
413
|
+
| Ekstraksi intent dari prosa bebas | Dilarang eksplisit oleh roadmap ("jangan anggap setiap pesan brainstorming sebagai tugas") |
|
|
414
|
+
| Readout TUI `/openwork` | Teks milestone hanya "tampilkan/ekspor"; permukaan TUI baru butuh kontrak terminal sendiri |
|
|
415
|
+
| Merge dengan lease/admission | Di luar teks milestone; merge tetap satu transaksi + ledger audit |
|
|
416
|
+
| Merge lintas sesi tanpa adopsi eksplisit | Model otoritas roadmap: portfolio = projection, perubahan task lewat jalur authority |
|
|
417
|
+
| Klaim release-ready | Closure P14 hanya untuk kontrak bukti-terstruktur; limitasi P13 tetap berlaku dan tree masih uncommitted |
|
|
418
|
+
|
|
138
419
|
## Terkait
|
|
139
420
|
|
|
140
421
|
- [CLI](cli.md) — referensi lengkap flag.
|
|
141
422
|
- [Arsitektur](architecture.md) — di mana scheduler berada.
|
|
142
|
-
- [Open Work](
|
|
423
|
+
- [Open Work](autonomous-scheduler.md) — pekerjaan lintas sesi yang diteruskan scheduler.
|
package/docs/choosing-mode.md
CHANGED
|
@@ -6,7 +6,7 @@ Tiga sumbu terpisah menentukan apa yang bisa/tidak bisa dilakukan agent:
|
|
|
6
6
|
2. **PermissionMode** (persetujuan) — *apakah* butuh izin manusia: `AUTO` (otonom) atau `ASK` (diawasi).
|
|
7
7
|
3. **Tool Access Policy** — *apa* yang tersedia (read-only set, bash allowlist, delegasi, MCP, scope).
|
|
8
8
|
|
|
9
|
-
Hard security (path jail, sensitive-file, owned-state, bash-guard) selalu berlaku, di atas ketiganya — **kecuali mode `unrestricted
|
|
9
|
+
Hard security (path jail luar workspace, sensitive-file, owned-state, bash-guard) selalu berlaku, di atas ketiganya — **kecuali mode `unrestricted`**, yang membuka jail path luar workspace + bash-guard + allowlist, tetapi file sensitif (`.env`, `.ssh`) dan state milik minicode (`.minicode/`) tetap ditolak (lihat baris terakhir tabel).
|
|
10
10
|
|
|
11
11
|
## Kalau tujuan Anda X → gunakan Y
|
|
12
12
|
|
|
@@ -18,7 +18,7 @@ Hard security (path jail, sensitive-file, owned-state, bash-guard) selalu berlak
|
|
|
18
18
|
| Menyusun rencana tanpa eksekusi | `--work-mode PLAN` | Baca + artefak rencana (`todo_write`) + delegasi read-only; tanpa mutasi file/git/commit |
|
|
19
19
|
| Otomasi/CI tanpa manusia | One-shot/`exec` + default `DISCUSS` untuk baca; tambah `--work-mode BUILD` bila perlu mutasi | `AUTO` menolak `ask_user` deterministik (BLOCKED) di non-TTY; MCP tak-terkonfigurasi deny; tidak ada prompt yang bisa menggantung |
|
|
20
20
|
| Otonom penuh di mesin sendiri | `--work-mode BUILD` + `AUTO` + `--sandbox docker` (atau OS) + `--budget` | Tanpa prompt, TETAPI jail path + bash-guard tetap aktif; sandbox memberi isolasi nyata |
|
|
21
|
-
| Full akses tanpa pembatas (VM/VPN tepercaya) | `/unrestric` (perintah TUI tersembunyi, per-sesi) | Melepas jail + bash-guard + sandbox
|
|
21
|
+
| Full akses tanpa pembatas (VM/VPN tepercaya) | `/unrestric` (perintah TUI tersembunyi, per-sesi) | Melepas jail path luar workspace + bash-guard + allowlist/sandbox; kredensial git sempit (`GH_TOKEN`/`GITHUB_TOKEN`/`SSH_AUTH_SOCK`) diteruskan hanya di mode ini; file sensitif dan state minicode tetap ditolak; footer menampilkan `○` merah |
|
|
22
22
|
|
|
23
23
|
## Rule of thumb
|
|
24
24
|
|
|
@@ -27,7 +27,7 @@ Hard security (path jail, sensitive-file, owned-state, bash-guard) selalu berlak
|
|
|
27
27
|
3. **`ASK` untuk wilayah asing** — repo orang, perintah yang belum Anda pahami. Jawab `always` hanya untuk pasangan tool+args spesifik yang sudah Anda nilai.
|
|
28
28
|
4. **AUTO ≠ allow-all.** Kapabilitas yang tidak diotorisasi (mis. MCP tak-terkonfigurasi, `ask_user` di AUTO, code tanpa sandbox) di-*deny* dengan alasan, bukan di-prompt.
|
|
29
29
|
5. **Legacy `--allow-all`/`--allowlist`** dipetakan ke profil akses; path jail + bash-guard tetap menolak.
|
|
30
|
-
6. **`/unrestric` hanya untuk lingkungan yang benar-benar Anda percaya** —
|
|
30
|
+
6. **`/unrestric` hanya untuk lingkungan yang benar-benar Anda percaya** — model bisa menyentuh file apa pun di host (kecuali file sensitif/state minicode), menjalankan shell tanpa allow-list, dan `git_push` ke remote. Sering kali `BUILD`+`AUTO`+sandbox sudah cukup.
|
|
31
31
|
|
|
32
32
|
## Tradeoff yang jujur
|
|
33
33
|
|
|
@@ -37,7 +37,7 @@ Hard security (path jail, sensitive-file, owned-state, bash-guard) selalu berlak
|
|
|
37
37
|
|
|
38
38
|
## Lanjut
|
|
39
39
|
|
|
40
|
-
- [
|
|
40
|
+
- [Keamanan](security.md) — apa yang ditegakkan tiap mode.
|
|
41
41
|
- [Policy & Sandbox](policy-sandbox.md) — tabel semantik presisi + bukti guard.
|
|
42
42
|
- [Otomasi & CI](exec.md) — batasan headless.
|
|
43
43
|
- [CLI](cli.md) — referensi flag WorkMode/PermissionMode.
|
package/docs/concepts.md
CHANGED
|
@@ -28,7 +28,7 @@ ditulis sendiri) dan membagi dua jalur secara tegas:
|
|
|
28
28
|
buffer utama kembali persis (transkrip tidak di-dump ke scrollback).
|
|
29
29
|
- Warna hanya saat TTY; `NO_COLOR` selalu menang; output program tetap bersih dari cursor-control saat di-pipe.
|
|
30
30
|
|
|
31
|
-
Detail lengkap + kontrak FROZEN-nya di [Kontrak Terminal](
|
|
31
|
+
Detail lengkap + kontrak FROZEN-nya di [Kontrak Terminal](TERMINAL_CONTRACT.md).
|
|
32
32
|
|
|
33
33
|
## Kejujuran sebagai fitur
|
|
34
34
|
|
|
@@ -45,9 +45,45 @@ Runtime tanpa dependency pihak ketiga; satu-satunya kebutuhan keras adalah **Bun
|
|
|
45
45
|
|
|
46
46
|
## Bahasa
|
|
47
47
|
|
|
48
|
-
Dokumentasi dan komentar kode berbahasa **Indonesia** dengan istilah teknis tetap English (`provider`, `checkpoint`, `sandbox`, `jail`).
|
|
48
|
+
Dokumentasi dan komentar kode berbahasa **Indonesia** dengan istilah teknis tetap English (`provider`, `checkpoint`, `sandbox`, `jail`). Tabel di bawah mengunci makna istilah yang paling sering dipakai.
|
|
49
|
+
|
|
50
|
+
## Glosarium
|
|
51
|
+
|
|
52
|
+
Istilah MiniCode yang punya makna spesifik. Dokumentasi berbahasa Indonesia dengan
|
|
53
|
+
istilah teknis English — tabel ini mengunci maknanya.
|
|
54
|
+
|
|
55
|
+
| Istilah | Makna |
|
|
56
|
+
|---|---|
|
|
57
|
+
| **MiniCore** | Kernel runtime `STATE / MODEL / ACTION / LOOP` di-vendor ke `vendor/minicore`; inti beku, zero-dep, di-resolve via `#minicore` |
|
|
58
|
+
| **Minicode** | Layer agencode di atas MiniCore: tools, agents, policy, providers, memory, sessions, CLI |
|
|
59
|
+
| **Tool** | Kemampuan yang dipilih model dalam loop ReAct; tool MCP dapat ditambahkan dinamis sebagai `serverId.toolName` |
|
|
60
|
+
| **Tool scope** | `full` atau subset read-only `explore` — flag `--tool-scope` |
|
|
61
|
+
| **WorkMode** | Cara agent bekerja: `DISCUSS`, `PLAN`, atau `BUILD` (alias produk untuk identitas internal `EXECUTE`) |
|
|
62
|
+
| **PermissionMode** | Pilihan pengawasan: `AUTO` menjalankan capability yang diotorisasi; `ASK` meminta persetujuan untuk aksi yang digate |
|
|
63
|
+
| **Tool Access Policy** | Batas capability yang tersedia, seperti read-only, allowlist, atau profil akses warisan `--allow-all` |
|
|
64
|
+
| **Gate** | Tool wajib persetujuan manusia saat TTY; non-TTY selalu tolak (mis. `git_commit`, MCP, `delegate_task`) |
|
|
65
|
+
| **Path jail** | Pembatasan akses file ke workspace (realpath + symlink; `O_NOFOLLOW` pada POSIX dan pencocokan identitas handle `dev+ino` pada semua platform); aktif bahkan `--allow-all` |
|
|
66
|
+
| **Bash-guard** | Normalisasi + blokir pola bash berbahaya sebelum eksekusi (quote-split, indirection, wrapper) |
|
|
67
|
+
| **Sandbox OS** | bubblewrap (Linux) / seatbelt (macOS) — otomatis bila tersedia |
|
|
68
|
+
| **Sandbox Docker** | Container ephemeral `--network none`, 512m, 1 CPU, `node:22-alpine` |
|
|
69
|
+
| **Checkpoint** | Snapshot per turn via shadow-git: SHA tree di `refs/minicode/…` (O(delta), HEAD/index tak tersentuh) |
|
|
70
|
+
| **Recovery journal** | `journal-<sesi>.jsonl`: `pending` → `committed`/`failed`/`unknown`; finalisasi menandai cakupan turn yang sudah durable |
|
|
71
|
+
| **Session** | Riwayat tersimpan di `.minicode/sessions.db` (SQLite WAL); kompaksi dapat mengganti bagian lama dengan ringkasan + tail |
|
|
72
|
+
| **Memory dua lapis** | `MEMORY.md` hierarki (selalu ke system prompt) + vector RAG hybrid (injeksi bila skor ≥ ambang) |
|
|
73
|
+
| **RAG hybrid** | Pencarian memory cosine 0.7 + keyword 0.3, ranking MMR (λ 0.7), dedup >0.92 |
|
|
74
|
+
| **Repo-map** | Simbol per file (regex 9 bahasa, fallback LSP) disuntik ke system prompt |
|
|
75
|
+
| **Skill** | Prompt terpaket `.minicode/skills/*.md` dengan frontmatter `name`/`description` |
|
|
76
|
+
| **Hook** | Skrip `pre/post-run` dari `~/.minicode/hooks` + `.minicode/hooks`; mati default, `MINICODE_HOOKS=1` |
|
|
77
|
+
| **Env scrub** | `sanitizeSpawnEnv` menghapus kata-kunci kredensial dari env subprocess |
|
|
78
|
+
| **Secret scrubber** | Redaksi `sk-`/`ghp_`/`AKIA`/PEM/JWT/Bearer sebelum teks ke LLM |
|
|
79
|
+
| **Ledger** | Baris ` › name target` / ` › name: …` di stderr — jejak aksi agent |
|
|
80
|
+
| **Scrollback** | Riwayat layar terminal; jalur non-interaktif minicode append-only di sana (interaktif pakai alternate screen) |
|
|
81
|
+
| **Transient** | UI muncul-sekali yang menghapus dirinya (spinner, garis status turn) — vs transkrip yang menetap |
|
|
82
|
+
| **Composition root** | `cli/index.ts` + `cli/setup.ts`: satu tempat wiring DI (provider, RAG, session, tools) |
|
|
83
|
+
| **Seam aditif** | Satu-satunya patch yang dibolehkan ke kernel beku: `compactAsync`, `initialMessages`, `cwd` |
|
|
84
|
+
| **Self-contained** | Tanpa clone repo lain — kernel di-vendor, runtime zero-dep, butuh Bun ≥ 1.1.13 |
|
|
49
85
|
|
|
50
86
|
## Lanjut
|
|
51
87
|
|
|
52
88
|
- [Arsitektur](architecture.md) — tiga lapisan, boundary, alur satu prompt.
|
|
53
|
-
- [Quickstart](
|
|
89
|
+
- [Instalasi & Quickstart](getting-started.md) — dari nol ke prompt pertama yang ter-verify.
|
package/docs/config.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Config
|
|
1
|
+
# Config & Provider
|
|
2
2
|
|
|
3
|
-
Di mana pengaturan dan data Minicode tinggal,
|
|
3
|
+
Di mana pengaturan dan data Minicode tinggal, bagaimana file lokal yang tak tepercaya diperlakukan, dan provider mana yang bisa dipakai.
|
|
4
4
|
|
|
5
5
|
## Skema `.minicode/config.json`
|
|
6
6
|
|
|
@@ -20,12 +20,98 @@ Di mana pengaturan dan data Minicode tinggal, dan bagaimana file lokal yang tak
|
|
|
20
20
|
}
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
- `providers` — bisa juga diisi lewat wizard/`minicode config add`/`/provider`; lihat daftar preset di
|
|
23
|
+
- `providers` — bisa juga diisi lewat wizard/`minicode config add`/`/provider`; lihat daftar preset di bawah.
|
|
24
24
|
- `providers[].contextWindows` — batas konteks dalam token per model; exact model ID menang, lalu key `"*"` menjadi fallback provider. Nilai harus integer positif. Karena gateway memakai alias model, MiniCode memakai **default konservatif 128K** untuk alias generik (`auto`/`best`/...) dan **32K** untuk model tak dikenal lainnya; jendela eksak tersedia lewat katalog built-in (keluarga umum), overlay `minicode pricing sync` (models.dev), dan **tokenizer presisi on-demand** dari HuggingFace untuk model open. `--context-window` mengalahkan nilai config selama sesi itu.
|
|
25
25
|
- `mcpServers` — dua bentuk: stdio (`command`+`args`) dan HTTP (`url`+opsional `headers`). Detail transport di [MCP & LSP](mcp-lsp.md).
|
|
26
26
|
- `verifyCommand` — dipakai `--verify` bila auto-detect tidak menemukan (urutan deteksi: `typecheck` → `test` → `tsconfig`).
|
|
27
27
|
- `bashAllowlist` — pola koma/pola glob perintah bash yang dianggap aman (mode `allowlist`).
|
|
28
28
|
|
|
29
|
+
## 15 preset gateway (termasuk Custom URL)
|
|
30
|
+
|
|
31
|
+
`Gateway >` hanya menampilkan `[0] Label` tanpa URL (minimalis, tanpa bocor endpoint).
|
|
32
|
+
|
|
33
|
+
| id | Label | Catatan |
|
|
34
|
+
|---|---|---|
|
|
35
|
+
| `openai` | OpenAI | gpt, o-series |
|
|
36
|
+
| `anthropic` | Anthropic | Claude, streaming `tool_use` |
|
|
37
|
+
| `openrouter` | OpenRouter | Gateway 75+ model |
|
|
38
|
+
| `deepseek` | DeepSeek | chat/reasoner |
|
|
39
|
+
| `opencode-zen` | OpenCode Zen | Gateway |
|
|
40
|
+
| `google` | Google Gemini | Konteks 1M, `thought_signature` pass-through |
|
|
41
|
+
| `ollama` | Ollama | Lokal, gratis, tanpa key |
|
|
42
|
+
| `qwen` | Qwen | Alibaba Qwen3-Coder (satu-satunya dengan spec OAuth terdaftar) |
|
|
43
|
+
| `groq` | Groq | Inferensi cepat |
|
|
44
|
+
| `together` | Together AI | Model terbuka |
|
|
45
|
+
| `fireworks` | Fireworks AI | — |
|
|
46
|
+
| `mistral` | Mistral AI | — |
|
|
47
|
+
| `cohere` | Cohere | — |
|
|
48
|
+
| `generic` | OpenAI-compatible umum | vLLM / LM Studio |
|
|
49
|
+
| `custom` | Custom URL | Pseudo-preset untuk baseUrl sendiri |
|
|
50
|
+
|
|
51
|
+
Alur: wizard & `/provider` (add `[0] OpenAI` … `[14] Custom URL`) → API key ter-masking → auto-detect models via `GET /models` timeout 4 dtk → provider otomatis pindah saat pilih model beda provider (tanpa restart, via `reloadProviders()` setelah `Gateway >2`).
|
|
52
|
+
|
|
53
|
+
## Dua jalur autentikasi
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# 1. API key
|
|
57
|
+
minicode config add --baseUrl https://api.openai.com/v1 --apiKey sk-…
|
|
58
|
+
|
|
59
|
+
# 2. OAuth device-code (tanpa API key, tanpa kartu kredit) — RFC 8628
|
|
60
|
+
minicode auth list # provider yang mendukung
|
|
61
|
+
minicode auth login qwen # kode singkat → buka URL → tunggu persetujuan
|
|
62
|
+
minicode auth status # kredensial + kapan kedaluwarsa
|
|
63
|
+
minicode auth logout qwen
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Token di `~/.minicode/auth.json` (chmod 600), bukan `config.json`. Refresh otomatis margin 60 dtk. Provider OAuth yang belum login dibuang dari daftar dengan peringatan, bukan dikirim dengan header kosong.
|
|
67
|
+
|
|
68
|
+
> Kejujuran: device flow teruji lengkap ke server OAuth lokal (pending/slow_down/denied/expired/clamp), tapi endpoint/clientId provider belum semua terkonfirmasi live. `auth login chatgpt` fail-fast di non-TTY. Jangan baca token aplikasi desktop orang lain — itu pencurian kredensial.
|
|
69
|
+
|
|
70
|
+
## Keyring OS (ganti plaintext config)
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
minicode config set-key openrouter # pindah API key ke OS store, config tinggal referensi
|
|
74
|
+
minicode config delete-key openrouter # lupakan (provider nonaktif sampai di-set ulang)
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Windows memakai DPAPI user-scope (hanya user ini yang bisa membuka); selain itu berkas chmod 600 dengan label jujur `plain-file` (bukan keyring). Referensi hilang/rusak = provider di-skip dengan peringatan (fail-closed, seperti OAuth). Matikan paksa via `MINICODE_KEYSTORE_DISABLE=1`.
|
|
78
|
+
|
|
79
|
+
## Model & thinking effort
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
/model [cari] → picker provider::model, bisa difilter
|
|
83
|
+
Enter → pilih model (+ picker effort bila modelnya mendukung)
|
|
84
|
+
Esc → batal total
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Effort tersimpan di `ProviderEntry.reasoningEffort`, berlaku sesi berikutnya, tampil badge `[low|medium|high]`. **Default universal = omit** (tanpa param thinking): default bawaan tiap model sudah di-tune vendornya. Knob hanya dikirim ke keluarga terbukti, dalam bahasa native-nya: OpenAI reasoning (`o1`/`o3`/`o4`, `gpt-5`/`gpt-6` → `reasoning_effort`, level tervalidasi per model — pro = high saja); Claude ≤4.5 → budget `1024/2048/4096`; Claude ≥4.6/5 → adaptive + `output_config.effort`. **Selain itu tak pernah dikirimi param thinking** (DeepSeek, Gemini, Groq, Ollama, free-tier, custom). Bila model menolak param (400/500), request diulang sekali tanpa param + diingat per sesi + dicatat `[thinking]` di stderr. Picker effort hanya muncul untuk model yang mendukung; sisanya select langsung tanpa menyentuh effort tersimpan. `detectAndSave`/`auth login` mempertahankan effort (tidak reset diam-diam). Mutasi ditulis ke file scope asal (bukan hasil merge) agar tidak duplikat/shadowing.
|
|
88
|
+
|
|
89
|
+
Model override sekali jalan:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
minicode --model providerId::modelName "prompt"
|
|
93
|
+
minicode --provider openai "prompt"
|
|
94
|
+
minicode models --match gemini
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
`MINICODE_PROVIDER_ORDER=openai,anthropic,deepseek` mengurutkan provider agnostik tanpa edit config.
|
|
98
|
+
|
|
99
|
+
## Pin eksplisit `provider::model` (kontrak)
|
|
100
|
+
|
|
101
|
+
Model berformat `providerId::modelName` = PIN: request hanya ke provider
|
|
102
|
+
itu — **tanpa fallback lintas provider dan tanpa substitusi diam-diam**.
|
|
103
|
+
Gagal = error jujur dari provider yang dipilih (limit/saldo/error server),
|
|
104
|
+
user memilih model lanjutannya sendiri via `/model`. Alasan: fallback
|
|
105
|
+
otomatis pernah melempar user dari model gratis ke model berbayar provider
|
|
106
|
+
lain (tagihan tak terduga). Model bare (tanpa `::`) tetap perilaku lama
|
|
107
|
+
(first-match + substitusi + fallback rate_limit/server/network).
|
|
108
|
+
|
|
109
|
+
## Build & router
|
|
110
|
+
|
|
111
|
+
Build provider terpusat di `src/providers/build.ts`. Router fallback untuk rate_limit/server/network (clone-error + base64 fix + retryAfter cap). Deteksi wire dari probe path `/responses` → hint `responses`; substring host hanya fallback. `max_tokens` 8192; stop `length` = peringatan eksplisit, bukan teks sunyi.
|
|
112
|
+
|
|
113
|
+
Responses API: `/v1/responses`, `previous_response_id` chaining per model, `store:false` default.
|
|
114
|
+
|
|
29
115
|
## Global vs lokal
|
|
30
116
|
|
|
31
117
|
| File | Lokasi | Catatan |
|
|
@@ -39,7 +125,7 @@ Merge dengan **prioritas lokal menang**. Mutasi (add/update provider, MCP, LSP)
|
|
|
39
125
|
|
|
40
126
|
## Token OAuth bukan di config
|
|
41
127
|
|
|
42
|
-
Kredensial OAuth di `~/.minicode/auth.json` (chmod 600) — terpisah dari config karena config lokal rawan ikut ter-commit sedangkan token rahasia berumur pendek. Provider OAuth menyimpan `apiKey: ""` di config dan mengambil token saat runtime. Detail di [Config & Provider](config
|
|
128
|
+
Kredensial OAuth di `~/.minicode/auth.json` (chmod 600) — terpisah dari config karena config lokal rawan ikut ter-commit sedangkan token rahasia berumur pendek. Provider OAuth menyimpan `apiKey: ""` di config dan mengambil token saat runtime. Detail di [Config & Provider](config.md).
|
|
43
129
|
|
|
44
130
|
## Lokasi data
|
|
45
131
|
|
package/docs/environment.md
CHANGED
|
@@ -80,6 +80,8 @@ Variabel yang paling menentukan perilaku (sisanya referensi di bawah):
|
|
|
80
80
|
| Variabel | Fungsi |
|
|
81
81
|
|---|---|
|
|
82
82
|
| `MINICODE_ASCII` | `1` → paksa glyph ASCII (`[OK]`, `>`, `.`) untuk konsol tanpa UTF-8 |
|
|
83
|
+
| `MINICODE_BOX` | gaya sudut kotak popup: default **melengkung** (`╭╮╰╯`); `square` → lancip (`┌┐└┘`); `ascii` → `+-|` (sama dengan `MINICODE_ASCII=1`). Untuk terminal yang merender glyph melengkung jelek |
|
|
84
|
+
| `MINICODE_SCRIM` | `none` → paksa scrim backdrop jadi `faint` saja (tanpa latar gelap `48;5;236`) — diagnostik/tema terminal yang memetakan 256-warna aneh |
|
|
83
85
|
| `MINICODE_COMPACT` | `1` → tool call ringkas, `0` → expanded. Default: compact di TUI, expanded di one-shot/exec (juga `/compact`, Ctrl+O) |
|
|
84
86
|
| `MINICODE_JUSTIFY` | `1` → aktifkan rata kanan-kiri (justify) keluaran teks model. Default: mati (opt-in) — justify menyuntik spasi yang mengubah teks asli saat di-copy/–pipe |
|
|
85
87
|
| `MINICODE_DROPDOWN` | `0` → matikan floating dropdown, pakai hint inline (konsol legacy) |
|
|
@@ -91,6 +93,7 @@ Variabel yang paling menentukan perilaku (sisanya referensi di bawah):
|
|
|
91
93
|
| `MINICODE_SHOW_THINKING` | reasoning model terlihat SECARA DEFAULT; `0` → minimized (hanya penanda), `1` → paksa terlihat |
|
|
92
94
|
| `MINICODE_MINIMIZE_ACTIVITY` | ON secara default di TUI; `0` → transparan (baris per-tool). Lipat aktivitas tool per turn jadi satu ringkasan (detail via `/expand`) |
|
|
93
95
|
| `MINICODE_ACTIVITY_PANEL` | `0` → matikan panel aktivitas (default AKTIF di TUI; `/fold` toggle); `1` → paksa aktif juga di jalur linear/one-shot |
|
|
96
|
+
| `MINICODE_AUTORESUME_BG` | `0` → nonaktifkan auto-resume turn TUI saat job background selesai (default aktif; sekali per job, hanya bila tidak ada turn berjalan) |
|
|
94
97
|
| `MINICORE_THINKING` | `off` → kirim `enable_thinking:false` ke OpenAI-compat (DeepSeek). Alias lama `MINICODE_THINKING` masih dihormati |
|
|
95
98
|
| `NO_COLOR` | Set apa pun selain `0` → matikan seluruh warna |
|
|
96
99
|
|
package/docs/getting-started.md
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
# Instalasi
|
|
1
|
+
# Instalasi & Quickstart
|
|
2
|
+
|
|
3
|
+
Dari nol sampai prompt pertama yang ter-verify: pasang, setup provider, jalankan, verifikasi.
|
|
2
4
|
|
|
3
5
|
Prasyarat tunggal: **`bun >= 1.1.13`** — runtime Minicode, bukan Node.js. `npm` hanya dipakai untuk distribusi, bukan untuk menjalankan. (Lantai versi: kode memakai `AbortSignal.any()` yang absen di Bun 1.0.x; `minicode` gagal cepat dengan pesan jelas bila versi lebih lama.)
|
|
4
6
|
|
|
@@ -50,6 +52,61 @@ bun test # offline/hermetic; live & docker di-skip otomatis
|
|
|
50
52
|
|
|
51
53
|
Setup wizard berjalan otomatis saat `minicode` pertama kali bila belum ada provider.
|
|
52
54
|
|
|
55
|
+
## Prompt pertama
|
|
56
|
+
|
|
57
|
+
Tujuan: dari nol sampai prompt pertama yang ter-verify, tanpa membaca seluruh manual.
|
|
58
|
+
|
|
59
|
+
## 1. Jalan pertama (1 menit)
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
minicode
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Bila belum ada provider, wizard setup muncul. Isi berurutan: pilih gateway → tempel API key (ter-masking) → auto-detect models. Wizard memakai picker (panah + filter), bukan `readline` nomor — mengetik di luar rentang tidak lagi diam-diam memilih `[0]`.
|
|
66
|
+
|
|
67
|
+
Alternatif tanpa API key:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
minicode auth login # device-code: kode singkat + URL, setujui di browser
|
|
71
|
+
minicode auth status # lihat kredensial + kapan kedaluwarsa
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## 2. Prompt pertama (2 menit)
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
minicode --work-mode BUILD "buat http server hello world di server.ts" --verbose
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Yang terjadi: model menerima system prompt berisi `# Environment` (cwd + platform) + repo-map ringkas, lalu loop ReAct `Thought → Action → Observation` sampai jawaban final atau batas (`--max-steps` default 50, `--timeout` default 1 jam).
|
|
81
|
+
|
|
82
|
+
Coba mode interaktif:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
minicode --interactive
|
|
86
|
+
# minicode › jelaskan isi src/tools/index.ts
|
|
87
|
+
# /model → picker provider::model, Enter = pilih + atur effort
|
|
88
|
+
# /status → token + biaya kumulatif sesi
|
|
89
|
+
# /exit → keluar (Esc ganda saat abort juga bisa)
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## 3. Verify otomatis (2 menit)
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
minicode --work-mode BUILD --verify "fix bugs lalu typecheck"
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Sebelum agen jalan, baseline diuji dulu. Bila baseline sudah merah, catatan Health-Check ditempel ke prompt awal agar agen memperbaiki dulu. Setelah run, verify dijalankan; bila gagal, agen self-heal maks 3 siklus. Output error dibungkus fence agar tidak jadi prompt injection. Custom command via `MINICODE_VERIFY_CMD` atau `verifyCommand` di config.
|
|
99
|
+
|
|
100
|
+
## Contoh pola harian
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
minicode --ask "deploy script" # human-in-loop confirmation card
|
|
104
|
+
minicode --sandbox docker "task" # bash di container ephemeral
|
|
105
|
+
minicode --budget 0.50 "task besar" # warn 80%; pagu lewat → prompt baru ditolak + turn berjalan digugurkan
|
|
106
|
+
minicode exec "prompt" --json # headless CI: JSONL stream + summary
|
|
107
|
+
minicode "/review src/a.ts" # skill slash-command
|
|
108
|
+
```
|
|
109
|
+
|
|
53
110
|
## Matriks OS
|
|
54
111
|
|
|
55
112
|
| OS | Sandbox otomatis | Default permission | Catatan |
|
|
@@ -100,5 +157,4 @@ Uninstall = `npm uninstall -g minicode-ai` (atau hapus clone + `bun unlink` bila
|
|
|
100
157
|
|
|
101
158
|
## Berikutnya
|
|
102
159
|
|
|
103
|
-
- [Quickstart 5 menit](quickstart.md) — wizard → prompt pertama → verify.
|
|
104
160
|
- [Troubleshooting](troubleshooting.md) — bila `doctor` merah atau sandbox tidak jalan.
|
package/docs/repl.md
CHANGED
|
@@ -36,7 +36,7 @@ locale OS > en. `/lang` tanpa argumen = tampilkan aktif. Semua string lewat kamu
|
|
|
36
36
|
|
|
37
37
|
Alias (jalan, tidak diiklankan di `/help`): `/models` → `/model`, `/providers` → `/provider`, `/usage` & `/cost` → `/status`, `/resume [id]` → `/sessions [id]`, `/compact`, `/thinking`, `/minimize`, `/quit`.
|
|
38
38
|
|
|
39
|
-
Perintah tersembunyi (sengaja tak tampil di `/help`/dropdown, per-sesi): `/unrestric` —
|
|
39
|
+
Perintah tersembunyi (sengaja tak tampil di `/help`/dropdown, per-sesi): `/unrestric` — jembatan jail luar workspace + bash-guard + allowlist dibuka, kredensial git sempit diteruskan, tetapi file sensitif/state minicode tetap ditolak; gerbang = kepercayaan operator (toggle; footer menampilkan `○` merah). Detail di [Keamanan](security.md).
|
|
40
40
|
|
|
41
41
|
Did-you-mean: typo `/sessoons` → `Did you mean /sessions?` (jarak ≤ 2).
|
|
42
42
|
|