minicode-ai 0.14.6 → 0.20.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 +6 -4
- package/cli/args.ts +20 -8
- package/cli/commands/exec.ts +17 -14
- package/cli/commands/openwork.ts +1 -1
- package/cli/commands.ts +39 -23
- package/cli/index.ts +29 -7
- package/cli/model-manager.ts +1 -1
- package/cli/router.ts +22 -9
- package/cli/setup.ts +77 -35
- package/cli/tui.ts +179 -25
- package/docs/CONTROL-PLANE-MAP.md +7 -5
- package/docs/OUTPUT_EVENT_MODEL.md +4 -3
- package/docs/OUTPUT_PROTOCOL_SPEC.md +1 -1
- package/docs/OUTPUT_RENDERING_SPEC.md +16 -4
- package/docs/OUTPUT_UX_RULES.md +38 -32
- package/docs/P14_OPEN_WORK.md +290 -0
- package/docs/README.md +1 -1
- package/docs/SUMMARY.md +36 -22
- package/docs/TERMINAL_CONTRACT.md +89 -17
- package/docs/UI_RENDER_PIPELINE.md +47 -8
- package/docs/agents.md +1 -1
- package/docs/architecture.md +10 -8
- package/docs/autonomous-scheduler.md +142 -0
- package/docs/choosing-mode.md +4 -2
- package/docs/cli.md +11 -9
- package/docs/concepts.md +5 -5
- package/docs/config-providers.md +3 -3
- package/docs/config.md +1 -1
- package/docs/contributing.md +7 -9
- package/docs/environment.md +8 -5
- package/docs/getting-started.md +5 -5
- package/docs/mcp-lsp.md +2 -2
- package/docs/memory-sessions.md +3 -3
- package/docs/policy-sandbox.md +7 -4
- package/docs/pricing-budget.md +3 -3
- package/docs/quickstart.md +1 -1
- package/docs/repl.md +11 -8
- package/docs/security-model.md +4 -2
- package/docs/security.md +9 -8
- package/docs/skills.md +2 -2
- package/docs/terminal.md +10 -2
- package/docs/tools.md +4 -4
- package/docs/troubleshooting.md +3 -3
- package/docs/verify-benchmark.md +0 -3
- package/package.json +9 -18
- package/scripts/vendor-overlays/minicode-context.patch +1 -1
- package/src/app/mentions.ts +1 -1
- package/src/app/rag-layer.ts +11 -2
- package/src/app/session.ts +128 -10
- package/src/constants.ts +32 -1
- package/src/daemon/client.ts +11 -6
- package/src/daemon/control.ts +2 -9
- package/src/daemon/resource.ts +5 -4
- package/src/hooks/run.ts +5 -6
- package/src/lib/keystore.ts +11 -9
- package/src/lib/net.ts +8 -3
- package/src/lib/safe-open.ts +29 -5
- package/src/lib/trusted-exec.ts +4 -1
- package/src/lsp/client.ts +9 -10
- package/src/mcp/http-transport.ts +1 -1
- package/src/mcp/server.ts +17 -7
- package/src/memory/files.ts +2 -1
- package/src/memory/vector.ts +25 -16
- package/src/policy/bash-guard.ts +58 -16
- package/src/policy/bpe.ts +110 -0
- package/src/policy/compaction.ts +139 -22
- package/src/policy/consequence-engine.ts +3 -3
- package/src/policy/context-window.ts +43 -1
- package/src/policy/context.ts +50 -12
- package/src/policy/jail.ts +48 -3
- package/src/policy/no-progress.ts +15 -8
- package/src/policy/permission.ts +243 -5
- package/src/policy/tokenizer-registry.ts +104 -0
- package/src/policy/usage.ts +20 -13
- package/src/policy/verifier.ts +7 -4
- package/src/policy/work-mode.ts +9 -5
- package/src/presentation/adapter.ts +8 -4
- package/src/presentation/events.ts +2 -2
- package/src/presentation/label.ts +3 -3
- package/src/presentation/model.ts +4 -0
- package/src/presentation/projection.ts +10 -2
- package/src/presentation/store.ts +2 -2
- package/src/providers/anthropic.ts +13 -3
- package/src/providers/responses.ts +16 -6
- package/src/runtime/capability.ts +22 -4
- package/src/runtime/child-execution.ts +1 -1
- package/src/runtime/composition.ts +5 -5
- package/src/runtime/execution-journal.ts +13 -7
- package/src/runtime/execution-registry.ts +1 -1
- package/src/runtime/production-execution.ts +7 -6
- package/src/runtime/production-runtime.ts +2 -2
- package/src/runtime/runtime-capabilities.ts +1 -1
- package/src/runtime/runtime-status-facts.ts +1 -1
- package/src/runtime/runtime-task-admission.ts +2 -2
- package/src/sandbox/os.ts +4 -3
- package/src/session/checkpoint.ts +29 -4
- package/src/session/context-assembly.ts +8 -1
- package/src/session/context-identity.ts +2 -2
- package/src/session/context-projection.ts +36 -11
- package/src/session/persistence.ts +22 -11
- package/src/task/autonomous-context.ts +2 -3
- package/src/task/autonomous-policy.ts +3 -3
- package/src/task/model.ts +2 -2
- package/src/task/production-scheduler.ts +2 -2
- package/src/task/scheduler-observability.ts +1 -0
- package/src/task/scheduler.ts +3 -2
- package/src/task/scheduling-policy.ts +2 -1
- package/src/task/trigger.ts +5 -5
- package/src/tools/git.ts +22 -4
- package/src/tools/lsp.ts +10 -8
- package/src/tools/read_image.ts +2 -1
- package/src/tools/task.ts +1 -1
- package/src/tools/web_fetch.ts +6 -2
- package/src/tools/web_search.ts +2 -1
- package/src/ui/assistant/simple.ts +42 -33
- package/src/ui/contract.ts +4 -0
- package/src/ui/footer.ts +63 -12
- package/src/ui/i18n/en.ts +14 -2
- package/src/ui/i18n/id.ts +14 -2
- package/src/ui/input/prompt-engine.ts +36 -10
- package/src/ui/render/cells.ts +320 -0
- package/src/ui/render/composer-wrap.ts +73 -0
- package/src/ui/render/detail.ts +2 -2
- package/src/ui/render/diff.ts +14 -5
- package/src/ui/render/highlight.ts +4 -4
- package/src/ui/render/ledger.ts +47 -0
- package/src/ui/render/markdown.ts +12 -5
- package/src/ui/render/session-summary.ts +50 -0
- package/src/ui/render/table-grid.ts +134 -6
- package/src/ui/render/theme.ts +49 -4
- package/src/ui/render/width.ts +91 -4
- package/src/ui/render/wrap.ts +5 -3
- package/src/ui/runtime/screen.ts +100 -22
- package/src/ui/runtime/statusline.ts +26 -0
- package/src/ui/screens/model-manager.ts +1 -1
- package/src/ui/session-state.ts +27 -1
- package/src/ui/tui/app.ts +336 -65
- package/src/ui/tui/transcript.ts +335 -104
- package/vendor/minicore/VENDOR.md +16 -12
- package/vendor/minicore/src/core/events.ts +1 -0
- package/vendor/minicore/src/core/loop.ts +11 -1
- package/vendor/minicore/src/core/session.ts +39 -0
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
# vendor/minicore —
|
|
1
|
+
# vendor/minicore — HOST-EDITABLE (unfrozen)
|
|
2
2
|
|
|
3
|
-
Salinan MiniCore
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
Salinan MiniCore yang kini **dapat diedit langsung di host** sejak v0.16.0
|
|
4
|
+
(keputusan pemilik 2026-11-10: "vendor beku" DIHAPUS agar pengembangan seam
|
|
5
|
+
host tidak terhambat di tengah banyak perubahan/upgrade).
|
|
6
|
+
|
|
7
|
+
Nilai pin di bawah adalah **referensi historis** (provenance sumber asal),
|
|
8
|
+
**bukan invarian keras**. `bun run vendor:check` tidak lagi dipakai sebagai
|
|
9
|
+
gate; test verifikasi fingerprint dinyatakan nonaktif bersamaan keputusan
|
|
10
|
+
unfreeze ini (lihat `test/import-convention.test.ts`,
|
|
11
|
+
`test/pack-integrity.test.ts`, `test/phase6ae-vendor-eol.test.ts` yang di-skip).
|
|
12
|
+
Bila suatu saat vendor dibekukan kembali, jalankan `bun run vendor:minicore`
|
|
13
|
+
lalu pulihkan test tersebut.
|
|
7
14
|
|
|
8
15
|
- source commit: `0d33571047c0ed3778986108fd42e4bde6828bb0`
|
|
9
16
|
- source hash: `c8d214bb8d5eea86`
|
|
10
|
-
- overlay sha256: `
|
|
17
|
+
- overlay sha256: `fa3e3a789782523c3de99c2d31c173789a7fee2bf0f8087267c222ce9b4eebcf`
|
|
11
18
|
- files: 20
|
|
12
|
-
- hash: `
|
|
13
|
-
- shipped hash: `
|
|
14
|
-
(hash di atas mencakup test/fakes.ts yang sengaja tidak ikut paket;
|
|
15
|
-
verifikasi dari paket terbit: hitung hash vendor/minicore di dalam tarball)
|
|
19
|
+
- hash: `4cee16b60d65d18f`
|
|
20
|
+
- shipped hash: `b714c2adc59ea720` (18 file)
|
|
16
21
|
|
|
17
|
-
Perbarui dengan `bun run vendor:minicore` (butuh `../minicore`).
|
|
18
|
-
`bun run vendor:check` memverifikasi source, overlay, dan fingerprint final.
|
|
22
|
+
Perbarui referensi dengan `bun run vendor:minicore` (butuh `../minicore`).
|
|
@@ -5,6 +5,7 @@ import type { Execution, Step, TurnResult } from "./session.ts";
|
|
|
5
5
|
export type AgentEvent =
|
|
6
6
|
| { type: "turn:started"; turn: number }
|
|
7
7
|
| { type: "turn:completed"; result: TurnResult }
|
|
8
|
+
| { type: "turn:interrupted" }
|
|
8
9
|
| { type: "step:started"; step: Step }
|
|
9
10
|
| { type: "step:completed"; step: Step }
|
|
10
11
|
| { type: "execution:started"; execution: Execution }
|
|
@@ -50,7 +50,7 @@ export async function executeTurn(
|
|
|
50
50
|
// Permit one follow-up policy compaction after tool results grow the current
|
|
51
51
|
// turn. The hard cap prevents a no-progress compactor from looping forever.
|
|
52
52
|
let budgetCompactions = 0;
|
|
53
|
-
const maxBudgetCompactions =
|
|
53
|
+
const maxBudgetCompactions = 3;
|
|
54
54
|
let compactedForRecovery = false;
|
|
55
55
|
|
|
56
56
|
// Resolve once for the turn: model switching is a between-turn operation,
|
|
@@ -274,6 +274,16 @@ export async function executeTurn(
|
|
|
274
274
|
steps.push(step);
|
|
275
275
|
s.state.stepCount = stepIndex + 1;
|
|
276
276
|
s.events.emit({ type: "step:completed", step: snapshotStep(step) });
|
|
277
|
+
// Live context occupancy (host seam): laporkan ukuran konteks turn-store
|
|
278
|
+
// SESUDAH hasil tool step ini masuk, sehingga host (footer TUI) dapat
|
|
279
|
+
// memperbarui meter konteks per step alih-alih menunggu turn selesai.
|
|
280
|
+
// Nilai ini memakai estimator "satu sumber" yang sama dengan pressure eval
|
|
281
|
+
// di atas — tanpa duplikasi estimator.
|
|
282
|
+
s.events.emit({
|
|
283
|
+
type: "provider:extension",
|
|
284
|
+
kind: "context-window",
|
|
285
|
+
data: { usedTokens: contextTokens(s), windowTokens: contextWindowTokens },
|
|
286
|
+
});
|
|
277
287
|
stepIndex++;
|
|
278
288
|
}
|
|
279
289
|
|
|
@@ -260,6 +260,17 @@ export function createSession(config: SessionConfig): Session {
|
|
|
260
260
|
state.stepCount = turnState.stepCount;
|
|
261
261
|
events.emit({ type: "turn:completed", result: snapshotTurnResult(result) });
|
|
262
262
|
return result;
|
|
263
|
+
} catch (error) {
|
|
264
|
+
// B3 (host seam): on abort/timeout/error, the turn is transactional —
|
|
265
|
+
// but a long turn that only reads (no mutations) would otherwise lose
|
|
266
|
+
// all accumulated context on resume. Commit the partUp to a complete
|
|
267
|
+
// step boundary so a later run/resume can continue instead of amnesia.
|
|
268
|
+
const safe = safeTurnBoundary(store.messages.length, turnStore.messages);
|
|
269
|
+
if (safe.length > store.messages.length) {
|
|
270
|
+
store.replace(0, store.messages.length, safe);
|
|
271
|
+
events.emit({ type: "turn:interrupted" });
|
|
272
|
+
}
|
|
273
|
+
throw error;
|
|
263
274
|
} finally {
|
|
264
275
|
timeout.cancel();
|
|
265
276
|
joined.cleanup();
|
|
@@ -338,3 +349,31 @@ function withAbort<T>(promise: Promise<T>, signal: AbortSignal): Promise<T> {
|
|
|
338
349
|
}
|
|
339
350
|
});
|
|
340
351
|
}
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* B3 — batas commit aman untuk turn yang terputus (abort/timeout/error).
|
|
355
|
+
*
|
|
356
|
+
* `executeTurn` selalu memulai turnStore dengan prefix committed + SATU pesan
|
|
357
|
+
* `user` (input), lalu per step menambah assistant(toolCalls) → tool results.
|
|
358
|
+
* Abort bisa meninggalkan (a) hanya si `user` input, atau (b) `assistant(toolCalls)`
|
|
359
|
+
* yang hasilnya belum sempat di-append (orphan). Keduanya HARUS dibuang:
|
|
360
|
+
* (a) karena menyimpannya membuat dua `user` berurutan pada run berikutnya
|
|
361
|
+
* (invariant role bergantian → HTTP 400), (b) karena pasangan tool-call/result
|
|
362
|
+
* yang menggantung akan ditolak dilihat resume. Selain itu, commit sejauh
|
|
363
|
+
* langkah lengkap terakhir.
|
|
364
|
+
*/
|
|
365
|
+
function safeTurnBoundary(committedLen: number, messages: readonly Message[]): readonly Message[] {
|
|
366
|
+
let end = messages.length
|
|
367
|
+
while (end > committedLen) {
|
|
368
|
+
const last = messages[end - 1]
|
|
369
|
+
if (last && last.role === "assistant" && Array.isArray(last.toolCalls) && last.toolCalls.length > 0) {
|
|
370
|
+
end-- // orphaned toolCalls tanpa hasil
|
|
371
|
+
} else {
|
|
372
|
+
break
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
if (end === committedLen + 1 && messages[committedLen]?.role === "user") {
|
|
376
|
+
end = committedLen // hanya input baru — tidak ada progres untuk dipertahankan
|
|
377
|
+
}
|
|
378
|
+
return messages.slice(0, end)
|
|
379
|
+
}
|