Skip to content

fix: TUI any types, logger strong types, PLAN.md rewrite#23

Merged
e6qu merged 1 commit intodevfrom
next/plan-remaining
Mar 21, 2026
Merged

fix: TUI any types, logger strong types, PLAN.md rewrite#23
e6qu merged 1 commit intodevfrom
next/plan-remaining

Conversation

@e6qu
Copy link
Copy Markdown
Owner

@e6qu e6qu commented Mar 21, 2026

Summary

  • 17 TUI any types removed across 5 TUI component files
  • Logger types strengthenedLogMessage = string | Error, LogExtra = Record<string, ...specific types...>, 17 caller files updated with error narrowing
  • PLAN.md rewritten — removed completed sections, added remaining work items

TUI Type Fixes

File Changes
routes/session/index.tsx ToolProps generics, state narrowing via discriminated unions, typed tool inputs
context/kv.tsx get/set typed
context/local.tsx typed response shape
ui/dialog.tsx replace() takes JSX.Element
ui/toast.tsx error callback typed

Logger Type Fixes

  • LogMessage: unknown -> string | Error
  • LogExtra: Record<string, unknown> -> Record<string, string | number | boolean | null | Error | object>
  • 17 caller files updated with e instanceof Error ? e : String(e) narrowing

Final any Count: 20

All remaining are documented structural exceptions (event emitters, SDK boundaries, generic patterns).

Test plan

  • bun run typecheck (tsgo) — 0 errors
  • bun test — 1448 pass, 0 fail

TUI type safety (17 any removed):
- session/index.tsx: ToolProps generics, state narrowing with discriminated
  unions, typed tool inputs (WebFetch, CodeSearch, WebSearch)
- kv.tsx: get/set use unknown instead of any
- local.tsx: typed response shape
- dialog.tsx: replace() takes JSX.Element
- toast.tsx: error callback typed

Logger type safety (util/log.ts):
- LogMessage: unknown → string | Error
- LogExtra: Record<string, unknown> → Record<string, string | number | boolean | null | Error | object>
- 17 caller files updated with error narrowing (instanceof Error ? e : String(e))

PLAN.md rewritten:
- Removed completed sections (bug fixes, type safety tiers, upstream sync phases)
- Added remaining work items (TUI types, Zod v3→v4, upstream re-sync)
- Updated completed features table
@e6qu e6qu merged commit 5bfa05d into dev Mar 21, 2026
1 check passed
@e6qu e6qu deleted the next/plan-remaining branch March 21, 2026 20:51
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.

1 participant