Skip to content

refactor(cli): flatten Encoding/EncodedIO namespaces to module exports#9918

Merged
chrarnoldus merged 2 commits into
mainfrom
fix/encoding-flat-exports
May 6, 2026
Merged

refactor(cli): flatten Encoding/EncodedIO namespaces to module exports#9918
chrarnoldus merged 2 commits into
mainfrom
fix/encoding-flat-exports

Conversation

@kilo-code-bot
Copy link
Copy Markdown
Contributor

@kilo-code-bot kilo-code-bot Bot commented May 5, 2026

Summary

  • Replace export namespace Encoding / export namespace EncodedIO wrappers with top-level module exports.
  • Update consumers to import * as Encoding / import * as EncodedIO, letting the module itself act as the namespace.

Why

Per review feedback, the namespace-as-wrapper pattern is unusual and can be fragile under tree-shaking / differing module resolution strategies. Using the module-as-namespace via import * as is more idiomatic and behaves consistently across tooling.

Replace `export namespace Encoding`/`EncodedIO` wrappers with top-level
exports and switch consumers to `import * as Encoding`/`EncodedIO`.
The module itself acts as the namespace, avoiding the TS-namespace
wrapper that tree-shakers and some module resolvers handle awkwardly.
@kilo-code-bot
Copy link
Copy Markdown
Contributor Author

kilo-code-bot Bot commented May 5, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (8 files)
  • packages/opencode/src/kilocode/encoding.ts
  • packages/opencode/src/kilocode/tool/encoded-io.ts
  • packages/opencode/src/patch/index.ts
  • packages/opencode/src/tool/apply_patch.ts
  • packages/opencode/src/tool/edit.ts
  • packages/opencode/src/tool/read.ts
  • packages/opencode/src/tool/write.ts
  • packages/opencode/test/kilocode/encoding.test.ts

Reviewed by gpt-5.5-20260423 · 198,330 tokens

…orts

# Conflicts:
#	packages/opencode/src/kilocode/encoding.ts
@chrarnoldus chrarnoldus merged commit 5a90684 into main May 6, 2026
11 checks passed
@chrarnoldus chrarnoldus deleted the fix/encoding-flat-exports branch May 6, 2026 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants