minicode-ai 0.15.0 → 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/commands/exec.ts +3 -2
- package/cli/commands/openwork.ts +1 -1
- package/cli/commands.ts +6 -6
- package/cli/index.ts +4 -4
- package/cli/model-manager.ts +1 -1
- package/cli/setup.ts +57 -30
- package/cli/tui.ts +106 -11
- package/docs/CONTROL-PLANE-MAP.md +6 -4
- 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 +54 -7
- package/docs/UI_RENDER_PIPELINE.md +47 -8
- package/docs/agents.md +1 -1
- package/docs/architecture.md +9 -8
- package/docs/autonomous-scheduler.md +142 -0
- package/docs/choosing-mode.md +2 -2
- package/docs/cli.md +4 -4
- package/docs/concepts.md +5 -5
- package/docs/config-providers.md +3 -3
- package/docs/contributing.md +7 -9
- package/docs/environment.md +5 -4
- package/docs/getting-started.md +4 -4
- package/docs/mcp-lsp.md +2 -2
- package/docs/memory-sessions.md +1 -1
- package/docs/policy-sandbox.md +7 -4
- package/docs/pricing-budget.md +3 -3
- package/docs/quickstart.md +1 -1
- package/docs/repl.md +5 -5
- package/docs/security-model.md +1 -1
- 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/src/app/session.ts +40 -7
- package/src/constants.ts +31 -0
- package/src/hooks/run.ts +5 -6
- package/src/mcp/http-transport.ts +1 -1
- package/src/policy/bash-guard.ts +26 -6
- package/src/policy/compaction.ts +107 -17
- package/src/policy/consequence-engine.ts +3 -3
- package/src/policy/context-window.ts +24 -1
- package/src/policy/context.ts +16 -4
- package/src/policy/permission.ts +219 -4
- package/src/presentation/adapter.ts +1 -1
- package/src/presentation/events.ts +2 -2
- package/src/presentation/label.ts +3 -3
- package/src/presentation/model.ts +4 -0
- package/src/presentation/store.ts +2 -2
- package/src/runtime/child-execution.ts +1 -1
- package/src/runtime/composition.ts +5 -5
- package/src/runtime/execution-registry.ts +1 -1
- package/src/runtime/production-execution.ts +3 -3
- 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/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 +1 -1
- package/src/task/autonomous-context.ts +2 -2
- 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.ts +3 -2
- package/src/task/scheduling-policy.ts +2 -1
- package/src/task/trigger.ts +5 -5
- package/src/tools/read_image.ts +2 -1
- package/src/tools/task.ts +1 -1
- package/src/ui/assistant/simple.ts +33 -30
- package/src/ui/footer.ts +48 -9
- package/src/ui/i18n/en.ts +1 -0
- package/src/ui/i18n/id.ts +1 -0
- 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/ledger.ts +47 -0
- package/src/ui/render/theme.ts +32 -4
- package/src/ui/render/width.ts +2 -2
- package/src/ui/render/wrap.ts +5 -3
- package/src/ui/runtime/screen.ts +84 -7
- package/src/ui/runtime/statusline.ts +26 -0
- package/src/ui/screens/model-manager.ts +1 -1
- package/src/ui/tui/app.ts +336 -65
- package/src/ui/tui/transcript.ts +247 -88
- package/vendor/minicore/VENDOR.md +15 -11
- package/vendor/minicore/src/core/events.ts +1 -0
- package/vendor/minicore/src/core/loop.ts +10 -0
- package/vendor/minicore/src/core/session.ts +39 -0
package/src/policy/permission.ts
CHANGED
|
@@ -156,6 +156,15 @@ const NO_PROMPT_TOOLS = new Set(["todo_write", "submit_result", "bash_output", "
|
|
|
156
156
|
// ini memang menahan efek samping. Agent yang butuh menulis file punya
|
|
157
157
|
// `write_file`/`edit` yang ter-jail, bukan shell.
|
|
158
158
|
//
|
|
159
|
+
// Area node/npm (di bawah) merupakan perluasan SADAR demi menjalankan project
|
|
160
|
+
// web npm (keluhan: agent menolak "tidak bisa akses & menjalankan nodejs"):
|
|
161
|
+
// `node *` = menjalankan berkas skrip (REPL `node` polos tak cocok, pola butuh
|
|
162
|
+
// argumen); bentuk eval inline (`-e`/`--eval`/`--require`/`-r`/`--loader`) tetap
|
|
163
|
+
// diblokir bash-guard dulu. `npm install`/`ci` JUGA menjalankan lifecycle
|
|
164
|
+
// script (postinstall = kode arbitrer dari registry) — oleh sebab itu kategori
|
|
165
|
+
// ini tidak lagi murni read-only, melainkan "trusted project". Chain (`;|&`),
|
|
166
|
+
// ekspansi `$()`-backtick, dan redirection tetap ditahan lapisan di bawah.
|
|
167
|
+
//
|
|
159
168
|
// Perhatikan: allowlist diperiksa SETELAH bash-guard, jadi `cat *` di sini
|
|
160
169
|
// tidak berarti `cat .env` lolos — guard menolaknya lebih dulu. Pola di sini
|
|
161
170
|
// soal "bentuk perintah apa yang boleh", bukan "target apa yang boleh".
|
|
@@ -171,6 +180,24 @@ const DEFAULT_BASH_ALLOWLIST = [
|
|
|
171
180
|
"npm run *",
|
|
172
181
|
"npm exec *",
|
|
173
182
|
"npx *",
|
|
183
|
+
// Project web npm: install dependensi + jalankan script bare (npm test/start
|
|
184
|
+
// adalah bentuk pendek `npm run test/start` yang TIDAK cocok pola `npm run *`).
|
|
185
|
+
// Package manager JS lain ikut (bun/pnpm/yarn) supaya proyek yang memilih PM
|
|
186
|
+
// selain npm tetap bisa install/run di mode ini — konsisten dengan `npm *`.
|
|
187
|
+
"npm install*",
|
|
188
|
+
"npm ci*",
|
|
189
|
+
"npm test*",
|
|
190
|
+
"npm start*",
|
|
191
|
+
"bun install*",
|
|
192
|
+
"bun add*",
|
|
193
|
+
"bun remove*",
|
|
194
|
+
"pnpm install*",
|
|
195
|
+
"pnpm add*",
|
|
196
|
+
"pnpm i *",
|
|
197
|
+
"pnpm remove*",
|
|
198
|
+
"yarn install*",
|
|
199
|
+
"yarn add*",
|
|
200
|
+
"yarn remove*",
|
|
174
201
|
"echo *",
|
|
175
202
|
"ls*",
|
|
176
203
|
"dir*",
|
|
@@ -187,10 +214,191 @@ const DEFAULT_BASH_ALLOWLIST = [
|
|
|
187
214
|
"rg *",
|
|
188
215
|
"find *",
|
|
189
216
|
"which *",
|
|
190
|
-
|
|
217
|
+
// Menjalankan berkas skrip Node (mis. `node server.js`) — bukan REPL polos
|
|
218
|
+
// (pola `*` butuh argumen) dan bukan eval inline (diblokir bash-guard).
|
|
219
|
+
// Subsumes `node --version` (versi lama) sehingga entri itu tak lagi khusus.
|
|
220
|
+
"node *",
|
|
191
221
|
"bun --version",
|
|
192
222
|
]
|
|
193
223
|
|
|
224
|
+
// [0.16.x] Allowlist "developer" untuk fallback no-sandbox (restrictBash) —
|
|
225
|
+
// sesi TRUSTED pengembang di mesin tanpa isolasi OS (Windows default, atau
|
|
226
|
+
// Linux/mac tanpa bwrap/seatbelt + tanpa `--sandbox docker`). DI SINI user
|
|
227
|
+
// menjalankan KODE SENDIRI, jadi run/test/build/install ekosistem umum boleh.
|
|
228
|
+
// Ini BUKAN pengganti isolasi: untuk repo tak-terpercaya tetap pakai
|
|
229
|
+
// `--sandbox docker` / `--allowlist` (daftar narrow di atas) — daftar ini
|
|
230
|
+
// hanya menghapus gesekan "kenapa node/pip gak bisa jalan" di mesin sendiri.
|
|
231
|
+
//
|
|
232
|
+
// Deny-list bash-guard TETAP zirah di semua mode (berjalan SEBELUM allowlist
|
|
233
|
+
// apa pun): eksekusi kode inline `-e`/`-c` (`python -c`, `node -e`), baca kredensial, exfiltrasi,
|
|
234
|
+
// perintah destruktif, dan tulis di luar workspace tetap ditolak. Verba
|
|
235
|
+
// berbahaya (`* publish`, `* login`) sengaja TIDAK dicantumkan.
|
|
236
|
+
const DEFAULT_DEV_BASH_ALLOWLIST = [
|
|
237
|
+
...DEFAULT_BASH_ALLOWLIST, // dasar read + git + node/npm/bun/pnpm/yarn + readers
|
|
238
|
+
// ── Runtime/interpreter (menjalankan berkas skrip; eval inline `-e`/`-c`
|
|
239
|
+
// tetap ditolak bash-guard). `node *` sudah ada di daftar narrow. ──
|
|
240
|
+
"python *",
|
|
241
|
+
"python3 *",
|
|
242
|
+
"deno run*",
|
|
243
|
+
"deno test*",
|
|
244
|
+
"deno task*",
|
|
245
|
+
"deno lint*",
|
|
246
|
+
"deno fmt*",
|
|
247
|
+
"ruby *",
|
|
248
|
+
"php *",
|
|
249
|
+
"perl *",
|
|
250
|
+
"lua*",
|
|
251
|
+
"luajit*",
|
|
252
|
+
"julia*",
|
|
253
|
+
"Rscript *",
|
|
254
|
+
"elixir*",
|
|
255
|
+
"escript*",
|
|
256
|
+
"erl*",
|
|
257
|
+
"groovy*",
|
|
258
|
+
"scala*",
|
|
259
|
+
"tclsh*",
|
|
260
|
+
"dart*",
|
|
261
|
+
"swift*",
|
|
262
|
+
"dotnet*",
|
|
263
|
+
"java*",
|
|
264
|
+
// ── JS/TS: package manager + framework/bundler + test/lint ──
|
|
265
|
+
"pnpm run *",
|
|
266
|
+
"pnpm test*",
|
|
267
|
+
"pnpm dlx *",
|
|
268
|
+
"pnpm exec *",
|
|
269
|
+
"yarn run *",
|
|
270
|
+
"yarn test*",
|
|
271
|
+
"yarn dlx *",
|
|
272
|
+
"yarn exec *",
|
|
273
|
+
"vite*",
|
|
274
|
+
"vitest*",
|
|
275
|
+
"next*",
|
|
276
|
+
"nuxt*",
|
|
277
|
+
"remix*",
|
|
278
|
+
"astro*",
|
|
279
|
+
"svelte-kit*",
|
|
280
|
+
"webpack*",
|
|
281
|
+
"esbuild*",
|
|
282
|
+
"rollup*",
|
|
283
|
+
"parcel*",
|
|
284
|
+
"swc*",
|
|
285
|
+
"babel*",
|
|
286
|
+
"turbo*",
|
|
287
|
+
"nx *",
|
|
288
|
+
"tsx*",
|
|
289
|
+
"ts-node*",
|
|
290
|
+
"jest*",
|
|
291
|
+
"mocha*",
|
|
292
|
+
"ava*",
|
|
293
|
+
"playwright*",
|
|
294
|
+
"cypress*",
|
|
295
|
+
"eslint*",
|
|
296
|
+
"prettier*",
|
|
297
|
+
"biome*",
|
|
298
|
+
"stylelint*",
|
|
299
|
+
"tsc*",
|
|
300
|
+
// ── Python: package/test/lint ──
|
|
301
|
+
"pip *",
|
|
302
|
+
"pip3 *",
|
|
303
|
+
"uv *",
|
|
304
|
+
"pipx *",
|
|
305
|
+
"poetry*",
|
|
306
|
+
"pipenv*",
|
|
307
|
+
"conda*",
|
|
308
|
+
"mypy*",
|
|
309
|
+
"pytest*",
|
|
310
|
+
"ruff*",
|
|
311
|
+
"black*",
|
|
312
|
+
"flake8*",
|
|
313
|
+
"isort*",
|
|
314
|
+
"pylint*",
|
|
315
|
+
"tox*",
|
|
316
|
+
"nox*",
|
|
317
|
+
"django-admin*",
|
|
318
|
+
// ── Ruby (tanpa `gem push`) ──
|
|
319
|
+
"gem install*",
|
|
320
|
+
"gem list*",
|
|
321
|
+
"gem update*",
|
|
322
|
+
"gem build*",
|
|
323
|
+
"gem outdated*",
|
|
324
|
+
"bundle*",
|
|
325
|
+
"bundler*",
|
|
326
|
+
"rake*",
|
|
327
|
+
"rails*",
|
|
328
|
+
"rspec*",
|
|
329
|
+
"rubocop*",
|
|
330
|
+
// ── PHP ──
|
|
331
|
+
"composer*",
|
|
332
|
+
"phpunit*",
|
|
333
|
+
"artisan*",
|
|
334
|
+
"phpcs*",
|
|
335
|
+
"phpstan*",
|
|
336
|
+
"psalm*",
|
|
337
|
+
// ── Rust (tanpa `cargo publish`/`login`) ──
|
|
338
|
+
"cargo build*",
|
|
339
|
+
"cargo run*",
|
|
340
|
+
"cargo test*",
|
|
341
|
+
"cargo check*",
|
|
342
|
+
"cargo add*",
|
|
343
|
+
"cargo remove*",
|
|
344
|
+
"cargo fmt*",
|
|
345
|
+
"cargo clippy*",
|
|
346
|
+
"cargo bench*",
|
|
347
|
+
"cargo doc*",
|
|
348
|
+
"cargo update*",
|
|
349
|
+
"cargo clean*",
|
|
350
|
+
"cargo install*",
|
|
351
|
+
"cargo fix*",
|
|
352
|
+
"rustc*",
|
|
353
|
+
"rustup*",
|
|
354
|
+
// ── Go ──
|
|
355
|
+
"go *",
|
|
356
|
+
// ── Java/Kotlin/JVM ──
|
|
357
|
+
"javac*",
|
|
358
|
+
"jar*",
|
|
359
|
+
"gradle*",
|
|
360
|
+
"gradlew*",
|
|
361
|
+
"./gradlew*",
|
|
362
|
+
"mvn*",
|
|
363
|
+
"./mvnw*",
|
|
364
|
+
"kotlin*",
|
|
365
|
+
"kotlinc*",
|
|
366
|
+
"sbt*",
|
|
367
|
+
// ── .NET ──
|
|
368
|
+
"msbuild*",
|
|
369
|
+
"nuget restore*",
|
|
370
|
+
// ── C/C++/build ──
|
|
371
|
+
"make*",
|
|
372
|
+
"cmake*",
|
|
373
|
+
"ninja*",
|
|
374
|
+
"meson*",
|
|
375
|
+
"bazel*",
|
|
376
|
+
"gcc*",
|
|
377
|
+
"g++*",
|
|
378
|
+
"clang*",
|
|
379
|
+
"clang++*",
|
|
380
|
+
"cc*",
|
|
381
|
+
"pkg-config*",
|
|
382
|
+
// ── Swift/Dart/Flutter ──
|
|
383
|
+
"xcodebuild*",
|
|
384
|
+
"flutter*",
|
|
385
|
+
"pub*",
|
|
386
|
+
// ── DB / ORM CLI ──
|
|
387
|
+
"psql*",
|
|
388
|
+
"mysql*",
|
|
389
|
+
"sqlite3*",
|
|
390
|
+
"redis-cli*",
|
|
391
|
+
"mongosh*",
|
|
392
|
+
"prisma*",
|
|
393
|
+
"drizzle-kit*",
|
|
394
|
+
"knex*",
|
|
395
|
+
// ── Container (dev lokal; escape di-guard CONTAINER_ESCAPE) ──
|
|
396
|
+
"docker*",
|
|
397
|
+
"docker-compose*",
|
|
398
|
+
"podman*",
|
|
399
|
+
"compose*",
|
|
400
|
+
]
|
|
401
|
+
|
|
194
402
|
// 6.4 — npm exec / npx hanya di-allow bila arg "known-good": tak ada
|
|
195
403
|
// ekspansi shell ($/backtick) atau redirection (< >). Chaining ;|& sudah
|
|
196
404
|
// diblokir oleh matchBashAllowlist (pattern tak mengandungnya).
|
|
@@ -376,12 +584,17 @@ export function createPermissionHandler(
|
|
|
376
584
|
const sessionGrants: string[] = []
|
|
377
585
|
// bash allowlist di-cache sekali (bukan baca env tiap panggilan)
|
|
378
586
|
const envRaw = process.env.MINICODE_BASH_ALLOWLIST
|
|
379
|
-
const
|
|
587
|
+
const envList = envRaw
|
|
380
588
|
? envRaw
|
|
381
589
|
.split(",")
|
|
382
590
|
.map((s) => s.trim())
|
|
383
591
|
.filter(Boolean)
|
|
384
|
-
:
|
|
592
|
+
: undefined
|
|
593
|
+
// Dua daftar: narrow (--allowlist = task tak-terpercaya) vs developer
|
|
594
|
+
// (restrictBash = fallback no-sandbox pada sesi TRUSTED). Env override
|
|
595
|
+
// MINICODE_BASH_ALLOWLIST (keputusan operator) menimpa KEDUANYA.
|
|
596
|
+
const bashAllowlist = envList ?? DEFAULT_BASH_ALLOWLIST
|
|
597
|
+
const devBashAllowlist = envList ?? DEFAULT_DEV_BASH_ALLOWLIST
|
|
385
598
|
|
|
386
599
|
async function getAllowlist(): Promise<string[]> {
|
|
387
600
|
if (allowlistCache) return allowlistCache
|
|
@@ -581,8 +794,10 @@ export function createPermissionHandler(
|
|
|
581
794
|
const br = bashDenyReason(cmd)
|
|
582
795
|
if (br) return deny(call, `bash-guard: ${br}`)
|
|
583
796
|
// restrictBash: bash hanya boleh pola allow-list (fallback no-sandbox).
|
|
797
|
+
// Pakai daftar DEVELOPER (lebih luas) — sesi trusted di mesin sendiri,
|
|
798
|
+
// bukan task tak-terpercaya (yang memakai daftar narrow via --allowlist).
|
|
584
799
|
if (restrictBash) {
|
|
585
|
-
const matched =
|
|
800
|
+
const matched = devBashAllowlist.filter((pat) => matchBashAllowlist(cmd, pat))
|
|
586
801
|
if (matched.length === 0)
|
|
587
802
|
return deny(
|
|
588
803
|
call,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Adaptor semantik lama → DomainEvent V2.1 (Fase 1).
|
|
2
2
|
//
|
|
3
3
|
// Kenapa berkas ini ada: kernel meng-emit event miskin (deny/unknown/validate
|
|
4
|
-
// tanpa event — executor.ts:44-73; abort/timeout
|
|
4
|
+
// tanpa event — executor.ts:44-73; abort/timeout kini `turn:interrupted` — session.ts);
|
|
5
5
|
// finalText dibuang UI; approval hanya callback). Berkas ini merekonstruksi
|
|
6
6
|
// lifecycle yang hilang TANPA mengubah kernel: deny dari step.results,
|
|
7
7
|
// turn-settle dari driver (noteRunSettled), approval dari hook permission.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Kenapa berkas ini ada: runtime (MiniCore) meng-emit 9 event miskin tanpa
|
|
4
4
|
// lifecycle gagal/batal/deny dan tanpa identitas yang selamat sampai UI
|
|
5
5
|
// (vendor/minicore/src/core/events.ts, executor.ts:44-73 return tanpa emit,
|
|
6
|
-
// session.ts:
|
|
6
|
+
// session.ts:261 jalur sukses; `turn:interrupted` pada abort/timeout). Dua sink UI menafsir event mentah
|
|
7
7
|
// sendiri-sendiri dan divergen. Berkas ini mendefinisikan SATU bahasa yang
|
|
8
8
|
// dipakai adaptor → reducer → proyeksi, sehingga TUI/linear/ACP kelak berbagi
|
|
9
9
|
// makna yang sama tanpa masing-masing merekonstruksi semantik runtime.
|
|
@@ -614,7 +614,7 @@ export const DURABILITY: Record<DomainEventType, { durable: boolean; replayable:
|
|
|
614
614
|
|
|
615
615
|
/**
|
|
616
616
|
* Bus sumber yang dibaca adaptor — struktural seperti UiBus (handler `any`
|
|
617
|
-
* disengaja karena `on` kernel generik-kondisional; lihat contract.ts:
|
|
617
|
+
* disengaja karena `on` kernel generik-kondisional; lihat contract.ts:62-71).
|
|
618
618
|
*/
|
|
619
619
|
export interface EventBusLike {
|
|
620
620
|
on(type: string, handler: (event: any) => void): () => void
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// tool. Murni, tanpa IO/clock.
|
|
3
3
|
//
|
|
4
4
|
// Kenapa di sini: 4 labeler lama + 3 angka cap berbeda; reducer (summary) dan
|
|
5
|
-
// proyeksi (label) harus berbagi satu sumber.
|
|
6
|
-
//
|
|
5
|
+
// proyeksi (label) harus berbagi satu sumber. Labeler linear
|
|
6
|
+
// (`src/ui/render/ledger.ts`) tetap terpisah karena hidup di lapisan UI.
|
|
7
7
|
//
|
|
8
8
|
// Batas lapisan: src/presentation TIDAK boleh impor src/ui (ui-boundary) —
|
|
9
9
|
// sanitasi tampilan tetap di renderer (sanitizeAnsi defense-in-depth). Label
|
|
@@ -135,6 +135,6 @@ export function summarizeResult(name: string, result: unknown): string {
|
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
const first = text.split(/\r?\n/, 1)[0] ?? ""
|
|
138
|
-
if (r.isError && name === "bash") return clip(
|
|
138
|
+
if (r.isError && name === "bash") return clip(first || name, MAX_SUMMARY)
|
|
139
139
|
return clip(first || name, MAX_SUMMARY)
|
|
140
140
|
}
|
|
@@ -18,6 +18,10 @@ export type TurnStatus = "running" | "completed" | "failed" | "cancelled" | "int
|
|
|
18
18
|
export type PlanStatus = "open" | "completed" | "cancelled"
|
|
19
19
|
export type ResultStatus = "completed" | "failed" | "cancelled"
|
|
20
20
|
export type SystemKind = "context_compacted" | "recovery" | "checkpoint" | "notice"
|
|
21
|
+
// Catatan retention (K.7): ini cap REDUCER presentasi (state durable/resume).
|
|
22
|
+
// Berbeda dan sengaja tak sama dengan TRANSCRIPT_CAP=5000 di src/ui/tui/transcript.ts
|
|
23
|
+
// yang membatasi TAMPILAN transkrip — dua lapis retention berbeda untuk substansi
|
|
24
|
+
// berbeda (riwayat yang bisa di-replay vs viewport).
|
|
21
25
|
export const MAX_STATE_ENTRIES = 4096
|
|
22
26
|
|
|
23
27
|
export interface ActivityEntry {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// yang adil untuk sesi panjang. Reducer TIDAK PERNAH membaca store untuk
|
|
6
6
|
// keputusan (I-A04) — store hanya dilayani expand/proyeksi.
|
|
7
7
|
//
|
|
8
|
-
//
|
|
8
|
+
// Besar angka = `src/ui/session-state.ts` (200K per-entry / 500K total) — dipertahankan
|
|
9
9
|
// sebagai awal, bukan angka magis baru. Evict = FIFO tertua + tandai dead
|
|
10
10
|
// (bukan hapus diam-diam): proyeksi menampilkan penanda retensi, bukan string
|
|
11
11
|
// kosong yang menyesatkan.
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
//
|
|
17
17
|
// Pola potong (surrogate-safe + splitTrailingEscape) DIUlang di sini (bukan
|
|
18
18
|
// impor src/ui — boundary src/** non-ui dilarang impor src/ui). Pola sama
|
|
19
|
-
// dengan
|
|
19
|
+
// dengan `src/ui/session-state.ts`; trigonometri escape disederhanakan untuk kasus
|
|
20
20
|
// tail yang mungkin terpotong.
|
|
21
21
|
|
|
22
22
|
import type { ContentRef } from "./events.ts"
|
|
@@ -151,7 +151,7 @@ export function admitChild(
|
|
|
151
151
|
return { admitted: false, reason: `capability: ${attenuated.denied}` }
|
|
152
152
|
|
|
153
153
|
// 4. Deadline: ≤ sisa parent; tak diketahui = ceiling backend existing.
|
|
154
|
-
// Evidence ceiling: SUB_AGENT_TIMEOUT_MS (task.ts
|
|
154
|
+
// Evidence ceiling: SUB_AGENT_TIMEOUT_MS (dipakai di `src/tools/task.ts`).
|
|
155
155
|
const backendCeiling = LIMITS.SUB_AGENT_TIMEOUT_MS
|
|
156
156
|
let effectiveDeadlineMs: number | null
|
|
157
157
|
if (spec.parentRemainingDeadlineMs !== undefined) {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
// mutable di module scope: dua komposisi (session/workspace berbeda) tidak
|
|
18
18
|
// mungkin saling melihat event, jurnal, atau dispatch satu sama lain.
|
|
19
19
|
// - Journal path EKSPLISIT dari caller. Tidak ada default global dan tidak ada
|
|
20
|
-
//
|
|
20
|
+
// pengambilan dari acak: resume berarti caller memberikan path yang SAMA.
|
|
21
21
|
// - Journal wajib secara default (fail-closed): open gagal = konstruksi gagal.
|
|
22
22
|
// "Tak ada jurnal" hanya boleh terjadi bila mode non-durable diminta eksplisit.
|
|
23
23
|
//
|
|
@@ -34,15 +34,15 @@
|
|
|
34
34
|
// - host.shutdown() = latch admitting/run + hook onShutdown milik PEMILIK. Hook
|
|
35
35
|
// itu adalah tempat owner menghentikan produsen event; karena itu hook berjalan
|
|
36
36
|
// SEBELUM drain/flush, bukan sesudah.
|
|
37
|
-
// - Execution drain = menunggu kerja in-flight yang DIDAFTARKAN runtime (track())
|
|
38
|
-
//
|
|
37
|
+
// - Execution drain = menunggu kerja in-flight yang DIDAFTARKAN runtime (track()).
|
|
38
|
+
// Executions non-terminal yang TIDAK dilacak TIDAK ditulis ulang:
|
|
39
39
|
// shutdown tak pernah mengarang COMPLETED; ia melapor, dan M12 yang menafsirkan.
|
|
40
40
|
// - Event delivery drain: M10 emit() sepenuhnya sinkron (tak ada antrean), jadi
|
|
41
41
|
// satu-satunya pengiriman async adalah append M11. Drain menunggu append yang
|
|
42
42
|
// masih jalan, termasuk yang muncul selama drain itu sendiri.
|
|
43
43
|
// - journal.flush() setelah drain: inilah batas durability. Setelah flush, hook
|
|
44
44
|
// berhenti append (barrier) — sehingga tak ada append SETELAH flush, dan
|
|
45
|
-
//
|
|
45
|
+
// pastinya tak ada reopen yang diam-diam.
|
|
46
46
|
// - journal.close() sesudah flush: bukti durable sudah dicatat; gagalnya close
|
|
47
47
|
// tak boleh membatalkan bukti itu.
|
|
48
48
|
// - host.close() TERAKHIR: host tak memegang jurnal, jadi menutupnya lebih dulu
|
|
@@ -505,7 +505,7 @@ export function createRuntimeComposition(opts: RuntimeCompositionOptions): Runti
|
|
|
505
505
|
// admitted ⇔ kernel punya record ADMITTED. Gagal = reason jujur ke M13 supaya
|
|
506
506
|
// state dispatch-nya benar (BLOCKED/REJECTED), bukan "sukses".
|
|
507
507
|
// Latch diperiksa LEBIH DALAM dari hostState: jeda antara latch composition dan
|
|
508
|
-
// host.shutdown() itu async, jadi satu-satunya cara
|
|
508
|
+
// host.shutdown() itu async, jadi satu-satunya cara deterministik untuk menutup
|
|
509
509
|
// admission adalah memeriksa latch itu sendiri.
|
|
510
510
|
const bridge = createDispatchBridge({
|
|
511
511
|
admission: {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
// Mutasi hasil inspect TAK PERNAH menyentuh internal.
|
|
18
18
|
// - Retensi terkontestasi (BUKAN arbitrasi — FINAL QA P2): bila dua observasi
|
|
19
19
|
// terminal BERBEDA tiba untuk satu id, registry TIDAK TAHU mana yang commit
|
|
20
|
-
// duluan (otoritas serialisasi = Kernel M8,
|
|
20
|
+
// duluan (otoritas serialisasi = Kernel M8, `src/runtime/execution-kernel.ts`). Yang disimpan adalah
|
|
21
21
|
// observasi pertama (retensi deterministik anti-flap) + flag `contested:true`
|
|
22
22
|
// yang menyatakan "butuh kernel truth untuk resolve — JANGAN baca snapshot
|
|
23
23
|
// ini sebagai keputusan lifecycle". Observasi non-terminal sesudah terminal
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// composition root, sub-agen, dan scheduler, sehingga lifecycle turn tidak punya
|
|
6
6
|
// authority yang jelas dan tidak pernah masuk jurnal durable M11. M15 tidak
|
|
7
7
|
// menulis lifecycle semantics baru: ia MEMINDAHKAN pencatatan lifecycle turn ke
|
|
8
|
-
// Kernel yang sudah ada (M8) melalui admission M13,
|
|
8
|
+
// Kernel yang sudah ada (M8) melalui admission M13, sementara eksekusi fisiknya
|
|
9
9
|
// tetap milik lapisan yang sudah terbukti benar (vendor MiniCore + tool executor).
|
|
10
10
|
//
|
|
11
11
|
// Aturan yang dikunci (jangan dilonggarkan tanpa ADR baru):
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
// - Mode `off` = tak ada runtime; jalur legacy persis seperti sebelum M15.
|
|
20
20
|
// - Pemetaan hasil (COMPLETED/FAILED/CANCELLED/TIMED_OUT/BUDGET_EXCEEDED) memakai
|
|
21
21
|
// taksonomi yang SUDAH ADA (AgentError.kind). Tidak ada taksonomi baru; error
|
|
22
|
-
// asli selalu dilempar ulang apa adanya
|
|
23
|
-
// - Setiap pekerjaan yang runtime
|
|
22
|
+
// asli selalu dilempar ulang apa adanya sehingga atribusi error tak berubah.
|
|
23
|
+
// - Setiap pekerjaan yang runtime ini daftarkan masuk ke `track()` sehingga
|
|
24
24
|
// drain M14 benar-benar menutup eksekusi milik runtime (utang M14 resolved).
|
|
25
25
|
// - Tanpa efek samping di modul ini: tidak ada spawn, tidak ada network, tidak
|
|
26
26
|
// ada akses langsung ke TaskStore/scheduler/UI/CLI.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// M14/M15 — Produksi runtime composition: SATU seam,
|
|
1
|
+
// M14/M15 — Produksi runtime composition: SATU seam, mode bertingkat.
|
|
2
2
|
//
|
|
3
3
|
// Kenapa berkas ini ada: `createRuntimeComposition` (composition.ts) merakit satu
|
|
4
4
|
// runtime, tapi tidak tahu BAGAIMANA produksi memanggilnya. Tanpa lapisan ini,
|
|
@@ -185,7 +185,7 @@ export { runtimeFactsFrom } from "./runtime-status-facts.ts"
|
|
|
185
185
|
* sini — flush adalah operasi drain, bukan probe; memanggilnya dari jalur
|
|
186
186
|
* status akan memicu drain setiap kali status dibaca.
|
|
187
187
|
*
|
|
188
|
-
* Sumber kebenaran:(handle → composition). FAKTA runtime dibaca dari komposisi
|
|
188
|
+
* Sumber kebenaran: (handle → composition). FAKTA runtime dibaca dari komposisi
|
|
189
189
|
* (satu-satunya pemilik state runtime); observation hanya menimpa fakta
|
|
190
190
|
* lapisan task (scheduler/TaskStore) yang memang tak bisa dibaca dari dalam.
|
|
191
191
|
*/
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
//
|
|
8
8
|
// BEDA dari M6 (`src/runtime/capability.ts`): M6 adalah izin EKSEKUSI per
|
|
9
9
|
// eksekusi (request → grant → approval, anak ⊆ parent). Yang di sini adalah
|
|
10
|
-
// pernyataan KETERSEDIAAN runtime — "apakah lapisan ini bisa
|
|
10
|
+
// pernyataan KETERSEDIAAN runtime — "apakah lapisan ini bisa dipakai SEKARANG",
|
|
11
11
|
// bukan "apakah operasi ini diizinkan". Mencampur keduanya menghasilkan
|
|
12
12
|
// "runtime punya kapabilitas" yang sebenarnya "eksekusi ini diizinkan".
|
|
13
13
|
//
|
|
@@ -22,7 +22,7 @@ import type { FailureClassification } from "./supervisor.ts"
|
|
|
22
22
|
/**
|
|
23
23
|
* Bentuk hasil drain jurnal runtime.
|
|
24
24
|
*
|
|
25
|
-
* PADA: bentuk "drain selesai + berapa append
|
|
25
|
+
* PADA: bentuk "drain selesai + berapa append yang selesai" — BUKAN probe
|
|
26
26
|
* readiness. Keberadaan drain yang berhasil tak berarti persistence-nya utuh
|
|
27
27
|
* saat ini (dan sebaliknya, drain yang belum jalan tak berarti persistence-nya
|
|
28
28
|
* rusak) — dua hal yang beda, jadi bentuknya dipisah dari bukti readiness.
|
|
@@ -39,11 +39,11 @@
|
|
|
39
39
|
// HISTORY EKSEKUSI (intent dispatch + event kernel), bukan syarat kerja:
|
|
40
40
|
// mode non-durable (`journalRequired: false`, dipakai mode runtime
|
|
41
41
|
// `constructed`) secara resmi berjalan tanpa jurnal — jadi menjadikannya
|
|
42
|
-
// syarat akan
|
|
42
|
+
// syarat akan menutup gerbang untuk konfigurasi yang sah. Yang TIDAK boleh
|
|
43
43
|
// hilang adalah otoritas task (TaskStore) dan pemiliknya (scheduler).
|
|
44
44
|
//
|
|
45
45
|
// SEMUA BUTIR HANYA YANG BISA DIBUKTI DARI KODE. Tidak ada kapabilitas yang
|
|
46
|
-
// diANGGAP lebih tinggi dari yang
|
|
46
|
+
// diANGGAP lebih tinggi dari yang dilalui jalur kode nyata.
|
|
47
47
|
|
|
48
48
|
import {
|
|
49
49
|
createRequirementMap,
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
// - Tanpa state durable: ContextView hidup hanya di RAM per proses.
|
|
17
17
|
//
|
|
18
18
|
// Bentuk ringkasan sintetis mengikuti konvensi vendor yang sudah ada
|
|
19
|
-
// (vendor/minicore/src/core/compact.ts:
|
|
19
|
+
// (vendor/minicore/src/core/compact.ts:48-51 — {role:"user", content:"Previous
|
|
20
20
|
// context:\n..."}): pesan user biasa, TANPA field persistence-only (event_id,
|
|
21
21
|
// seq, run_id, thread_id, migrated, …) dan tidak pernah ditulis balik ke histori.
|
|
22
22
|
|
|
@@ -180,6 +180,13 @@ function assembleViewMessages(
|
|
|
180
180
|
*
|
|
181
181
|
* Fallback = histori kanonik utuh, tanpa filter/urutan/transformasi — identik
|
|
182
182
|
* dengan replay `loadSession` hari ini.
|
|
183
|
+
*
|
|
184
|
+
* LEGACY (T7): tidak lagi di-wire ke jalur produksi — `selectContext`
|
|
185
|
+
* (context-selector.ts) adalah satu-satunya selector produksi (superset:
|
|
186
|
+
* CURRENT + STALE-rule-8 + budget-tail + fallback-unknown). Fungsi ini dan
|
|
187
|
+
* primitif di bawahnya (`boundaryIsSafe`, `syntheticSummaryMessage`, …) TETAP
|
|
188
|
+
* diekspor karena dipakai sebagai primitif bersama oleh selector P3.3 dan
|
|
189
|
+
* diuji langsung oleh `context-assembly.test.ts`.
|
|
183
190
|
*/
|
|
184
191
|
export function assembleContext(
|
|
185
192
|
sessionId: string,
|
|
@@ -40,7 +40,7 @@ export type ContextFrontierRelation = "EQUAL" | "A_AHEAD" | "B_AHEAD" | "DIVERGE
|
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* Referensi event kanonis — bentuk baris durable `messages` (lihat
|
|
43
|
-
* loadSession di persistence.ts:
|
|
43
|
+
* loadSession di persistence.ts:1513). `content` di sini adalah nilai
|
|
44
44
|
* TERSIMPAN (sudah safeContent/scrub/cap saat tulis), bukan objek runtime:
|
|
45
45
|
* hanya dari sanalah anchor stabil lintas replay/restart.
|
|
46
46
|
*/
|
|
@@ -361,7 +361,7 @@ export function assessContextFreshness(
|
|
|
361
361
|
* Derivasikan revisi kanonis dari daftar event durable: jumlah event
|
|
362
362
|
* `context.compacted` yang durable+replayable (events.ts DURABILITY).
|
|
363
363
|
* Jembatan kernel `context:compacted` → durable `context.compacted` ada di
|
|
364
|
-
* adapter.ts:
|
|
364
|
+
* adapter.ts:1123-1129, jadi setiap kompaksi loop/recovery meninggalkan satu
|
|
365
365
|
* marker durable — kecuali jalur yang tak memasang adapter (headless tanpa
|
|
366
366
|
* presentation): revisi undercount di sana adalah seam P3.5, bukan angka
|
|
367
367
|
* yang boleh ditebak di sini (fail-closed: hitung yang durable saja).
|
|
@@ -13,9 +13,10 @@
|
|
|
13
13
|
// - TULIS = HANYA `history_projections` (derived). NEVER `messages`/head/run.
|
|
14
14
|
// - Bukan otoritas: proyeksi tetap cache; `saveSession` tetap satu-satunya
|
|
15
15
|
// penulis kanonik.
|
|
16
|
-
// - Ringkasan = render fold
|
|
17
|
-
// PREFIX kanonik [0, baseSeq); ekor
|
|
18
|
-
// algoritma A+C lanjutan (P3.7),
|
|
16
|
+
// - Ringkasan = render fold HOST yang SUDAH ADA (`mechanicalKeepResults` —
|
|
17
|
+
// mempertahankan hasil tool) atas PREFIX kanonik [0, baseSeq); ekor
|
|
18
|
+
// [baseSeq, head] tetap verbatim. BUKAN algoritma A+C lanjutan (P3.7),
|
|
19
|
+
// bukan LLM/embedding/network.
|
|
19
20
|
// - Deterministik: urutan kanonik, tanpa Date.now/random di jalur derivasi
|
|
20
21
|
// (built_at diisi primitif P2.7, bukan klaim cakupan).
|
|
21
22
|
//
|
|
@@ -27,9 +28,13 @@
|
|
|
27
28
|
//
|
|
28
29
|
// Runtime adapter / revision bridge ke runtime = P3.5 (di luar modul ini).
|
|
29
30
|
|
|
30
|
-
import { ContextStore
|
|
31
|
+
import { ContextStore } from "#minicore"
|
|
31
32
|
import type { Message } from "#minicore/core/types.ts"
|
|
32
33
|
import { LIMITS } from "../constants.ts"
|
|
34
|
+
// R10/A — pakai folder HOST (mempertahankan hasil tool) alih-alih folder kernel
|
|
35
|
+
// (`mechanicalCompaction`) yang menulis `<result omitted>`; proyeksi durable
|
|
36
|
+
// yang dipakai saat resume tidak boleh membuang fakta hasil tool.
|
|
37
|
+
import { mechanicalKeepResults } from "../policy/compaction.ts"
|
|
33
38
|
import { renderFullHistoryFold } from "./full-history-fold.ts"
|
|
34
39
|
import {
|
|
35
40
|
buildProjection,
|
|
@@ -53,9 +58,9 @@ export interface ProjectionProducePolicy {
|
|
|
53
58
|
readonly keepRecentTurns: number
|
|
54
59
|
/**
|
|
55
60
|
* P3.7 — strategi fold. `"mechanical"` (default) = perilaku P3.4 yang sudah
|
|
56
|
-
* ada (prefix parsial via
|
|
57
|
-
* (cakupan penuh [0, N), CURRENT-capable).
|
|
58
|
-
* lama bila field absen.
|
|
61
|
+
* ada (prefix parsial via folder host yang mempertahankan hasil tool).
|
|
62
|
+
* `"full-history"` = renderer P3.7 (cakupan penuh [0, N), CURRENT-capable).
|
|
63
|
+
* Default eksplisit menjaga perilaku lama bila field absen.
|
|
59
64
|
*/
|
|
60
65
|
readonly fold?: "mechanical" | "full-history"
|
|
61
66
|
}
|
|
@@ -74,8 +79,9 @@ export interface ProjectionProduceResult {
|
|
|
74
79
|
|
|
75
80
|
/**
|
|
76
81
|
* Derivasi DETERMINISTIK {summaryText, baseSeq} dari baris kanonik memakai render
|
|
77
|
-
* fold
|
|
78
|
-
* tak memutasi input). Mengembalikan null bila tak ada
|
|
82
|
+
* fold HOST yang SUDAH ADA (`mechanicalKeepResults`, mempertahankan hasil tool).
|
|
83
|
+
* MURNI (tak menyentuh DB, tak memutasi input). Mengembalikan null bila tak ada
|
|
84
|
+
* prefix untuk diringkas.
|
|
79
85
|
*
|
|
80
86
|
* base_seq = jumlah baris prefix yang diringkas = total - |ekor verbatim|.
|
|
81
87
|
*/
|
|
@@ -84,13 +90,27 @@ export function deriveSummaryFromCanonical(
|
|
|
84
90
|
policy: ProjectionProducePolicy,
|
|
85
91
|
): { summaryText: string; baseSeq: number } | null {
|
|
86
92
|
if (messages.length === 0) return null
|
|
93
|
+
// R10/T1 — bila messages[0] SUDAH merupakan ringkasan kernel (LLM/mechanical,
|
|
94
|
+
// ber-prefix "Previous context"), JANGAN re-fold mekanikal (itu menurunkan
|
|
95
|
+
// fidelitas: ringkasan LLM yang kaya berubah jadi head per-baris yang kasar).
|
|
96
|
+
// Reuse apa adanya sehingga resume melihat ringkasan yang SAMA dengan yang
|
|
97
|
+
// dilihat model saat kompaksi. baseSeq=1: ringkasan mewakili baris indeks 0,
|
|
98
|
+
// ekor [1, N) verbatim.
|
|
99
|
+
const first = messages[0] as { role?: unknown; content?: unknown } | undefined
|
|
100
|
+
if (
|
|
101
|
+
first?.role === "user" &&
|
|
102
|
+
typeof first.content === "string" &&
|
|
103
|
+
first.content.startsWith("Previous context")
|
|
104
|
+
) {
|
|
105
|
+
return { summaryText: first.content, baseSeq: 1 }
|
|
106
|
+
}
|
|
87
107
|
const keep =
|
|
88
108
|
Number.isInteger(policy.keepRecentTurns) && policy.keepRecentTurns >= 1
|
|
89
109
|
? policy.keepRecentTurns
|
|
90
110
|
: 1
|
|
91
111
|
const store = new ContextStore()
|
|
92
112
|
store.appendAll(messages)
|
|
93
|
-
const folded =
|
|
113
|
+
const folded = mechanicalKeepResults(store, keep)
|
|
94
114
|
// Tak ada fold (prefix kosong) → tak ada cakupan untuk proyeksi.
|
|
95
115
|
if (folded.length >= messages.length) return null
|
|
96
116
|
const kept = folded.length - 1
|
|
@@ -102,7 +122,12 @@ export function deriveSummaryFromCanonical(
|
|
|
102
122
|
}
|
|
103
123
|
|
|
104
124
|
function boundProjectionSummary(text: string): string {
|
|
105
|
-
|
|
125
|
+
// R10/T1 — proyeksi boleh membawa ringkasan kernel yang lebih kaya (hasil
|
|
126
|
+
// `summaryCharBudgetForWindow`, hingga jendela besar). Atapnya dinaikkan dari
|
|
127
|
+
// 4k char ke `COMPACTION_SUMMARY_SCALED_MAX_CHARS` supaya ringkasan LLM untuk
|
|
128
|
+
// model 1M tidak terpotong di batas proyeksi. Storage hard-cap (512KB) tetap
|
|
129
|
+
// dijaga lapisan persistence.
|
|
130
|
+
const cap = LIMITS.COMPACTION_SUMMARY_SCALED_MAX_CHARS
|
|
106
131
|
if (text.length <= cap) return text
|
|
107
132
|
const marker = "\n[projection summary truncated; older details may be missing]"
|
|
108
133
|
let head = text.slice(0, Math.max(0, cap - marker.length))
|
|
@@ -121,7 +121,7 @@ function open(cwd?: string, local = false): Database {
|
|
|
121
121
|
// [Phase 7 / Live #1] Pembukaan koneksi + PRAGMA setup dibungkus dengan
|
|
122
122
|
// withBusyRetrySync. Sebelumnya hanya DDL yang di-retry; `new Database(p)`
|
|
123
123
|
// dan `PRAGMA journal_mode=WAL` bisa gagal SQLITE_BUSY saat dua proses CLI
|
|
124
|
-
// paralel membuka DB bersamaan (race nyata
|
|
124
|
+
// paralel membuka DB bersamaan (race nyata saat dua proses CLI membuka DB). Dengan
|
|
125
125
|
// membungkus seluruh urutan inisialisasi, proses yang kalah tunggu lalu
|
|
126
126
|
// coba ulang sampai lock dilepas (backoff eksponensial + jitter, 8×).
|
|
127
127
|
// PRAGMA busy_timeout DIATUR dalam retry yang sama SEBELUM journal_mode:
|
|
@@ -45,7 +45,7 @@ import type { TaskStore } from "./store.ts"
|
|
|
45
45
|
*
|
|
46
46
|
* [DESIGN DECISION] The shape is deliberately one an INTERACTIVE session id can
|
|
47
47
|
* never have. Production session ids are 8 hex characters
|
|
48
|
-
* (`
|
|
48
|
+
* (`src/session/identity.ts` -> `randomUUID().slice(0, 8)`); this contains a
|
|
49
49
|
* `~` and a `#` and is far longer, so an autonomous context can never be
|
|
50
50
|
* confused with — or collide with — a user's session. `isAutonomousSessionId`
|
|
51
51
|
* is the recogniser, and `assertNotAutonomousSessionId` is used on every
|
|
@@ -105,7 +105,7 @@ export interface AutonomousSession {
|
|
|
105
105
|
opts: { signal: AbortSignal; model?: string },
|
|
106
106
|
): Promise<{ finalText?: string; usage: { steps: number } }>
|
|
107
107
|
abort(): void
|
|
108
|
-
/**
|
|
108
|
+
/** Hook opsional yang dipanggil composition root saat sesi dibersihkan. */
|
|
109
109
|
cleanup?(): void
|
|
110
110
|
}
|
|
111
111
|
|