Repository navigation
Commit 8b4dab7
committed
refactor: convert the five new modules to the prescribed ESM shape
packages/opencode/AGENTS.md L17-L20 requires flat top-level exports plus a
self-reexport rather than `export namespace`, because the namespace form
prevents tree-shaking and breaks Node's native TypeScript runner. The five
modules this PR introduces — termination, nudge, tool-result-cap, idle-done,
run-accounting — used the namespace form.
Contained to the five files. The prescribed `export * as Foo from "./foo"`
projection means consumers keep importing { Foo } and calling Foo.bar(), so
not one call site changes; the rewrite dedents each namespace body and adds
the self-reexport.
termination.ts carries the run-termination protocol, so this was verified as
behaviour-preserving rather than merely green. session + cli suites before and
after: 1914 pass, 2 fail, 17 skip, 45 todo, 1978 across 119 files — identical,
with an identical failing set (the two known pre-existing 5000ms prompt.test
flakes). termination.ts was converted and verified first, alone, before the
other four.
Also drops three now-unnecessary type assertions in redactArgValue, returning
the repo lint warning count to its 6201 baseline.1 parent 49e95ef commit 8b4dab7
6 files changed
Lines changed: 1193 additions & 1193 deletions
File tree
- packages/opencode/src
- cli/cmd
- session
0 commit comments