opencode-mission-control icon indicating copy to clipboard operation
opencode-mission-control copied to clipboard

chore: Type safety cleanup — remove `any` types from production code

Open nigel-dev opened this issue 9 months ago • 0 comments

Description

Several production files use any types where proper typing would improve safety and developer experience. This is a focused cleanup task — great for getting familiar with the codebase.

Locations to Fix

1. src/index.ts — configInput: any

Lines 216, 218:

config: async (configInput: any) => {
  // ...
  registerCommands(configInput);

Fix: Type configInput using the OpenCode plugin config type (check @opencode-ai/plugin exports).

2. src/commands.ts — args as any

Line 161:

args ? { checkpoint: args as any } : {},

Fix: Type the args parameter from the command handler properly.

3. src/tools/cleanup.ts — implicit any[] return

Line 46:

return state.jobs.filter((j) => j.status !== 'running');

Fix: Add explicit return type annotation to determineJobsToClean. The function should return JobState[] or similar typed array.

4. src/index.ts — as any for tool registration

Line 248:

? { mc_report, mc_status } as any

Fix: Use proper tool type from the plugin SDK.

How to Verify

# After making changes, ensure build passes
bun run build

# Run tests
bun test

# Optionally check for remaining `as any` in src/ (not tests/)
grep -rn "as any" src/

Additional Context

This is a good first issue for contributors getting started with the codebase. Each fix is isolated, low-risk, and teaches you about the plugin structure:

  • index.ts — plugin entry point and lifecycle hooks
  • commands.ts — slash command registration
  • cleanup.ts — job cleanup logic

The test files (219 as any usages) are intentionally out of scope — mock typing in tests is a separate effort.

nigel-dev avatar Feb 12 '26 03:02 nigel-dev