Skip to content

refactor(cli): migrate remaining unblocked CJS modules to TypeScript #1298

@cv

Description

@cv

Summary

Migrate the 3 remaining unblocked CJS modules in bin/lib/ to TypeScript:

File Lines Notes
resolve-openshell.js 58 Path resolution for openshell binary, DI-friendly
version.js 43 Reads package.json + git describe for CLI version
chat-filter.js 29 New file, small utility

Total: ~130 lines. This completes the "everything not blocked is converted" goal.

Approach

For each file:

  1. Write the TS implementation in src/lib/
  2. Replace bin/lib/*.js with a thin re-export shim: module.exports = require("../../dist/lib/...")
  3. Co-locate tests in src/lib/*.test.ts, importing from ../../dist/lib/ for coverage attribution
  4. Follow the established pattern from refactor(cli): extract pure functions from onboard.js to typed TypeScript modules #1240, refactor(cli): migrate preflight.js to TypeScript #1262, refactor(cli): migrate inference-config.js to TypeScript #1265, refactor(cli): migrate runtime-recovery.js to TypeScript #1268, refactor(cli): migrate local-inference.js to TypeScript #1270, refactor(cli): migrate nim.js to TypeScript #1271, refactor(cli): migrate onboard-session.js to TypeScript #1272

Can be done as one PR (all 3 files are small and independent) or three separate PRs.

Context

Not blocked by

Any of the #924 blocker PRs (#781, #782, #819, #672, #794, #634).

Metadata

Metadata

Assignees

Labels

NemoClaw CLIUse this label to identify issues with the NemoClaw command-line interface (CLI).refactorThis is a refactor of the code and/or architecture.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions