Skip to content

Support structured values in OSC protocol#9

Merged
seeden merged 2 commits intomainfrom
structured-osc-values
Mar 8, 2026
Merged

Support structured values in OSC protocol#9
seeden merged 2 commits intomainfrom
structured-osc-values

Conversation

@seeden
Copy link
Owner

@seeden seeden commented Mar 8, 2026

  • Widen option value type from string to unknown in @termprompt/protocol, allowing objects/numbers in select, multiselect, and search options
  • Replace manual OSC string slicing with streaming createOscParser(), fixing chunked and multi-message input handling
  • Add parseOscResolveValue callback to all prompt types for host-resolve validation (type checks, min/max, custom validate)
  • Emit OSC resolve back to terminal host on TUI submit only (not on host-resolve or cancel)
  • Fix group() return type from Promise<T> to Promise<Partial<T>> to reflect partial results on cancel
  • Stop stringifying option values in OSC payloads (select, multiselect, search, number)

Breaking changes: option value type, group return type, OSC payload format.

seeden added 2 commits March 8, 2026 20:54
- widen option value type from string to unknown in protocol
- replace manual OSC string parsing with streaming createOscParser
- add parseOscResolveValue validation to all prompt types
- emit OSC resolve back to host on TUI submit only
- fix group() return type to Partial<T> on cancel
- handle chunked and multi-message OSC input correctly
@seeden seeden merged commit de120cb into main Mar 8, 2026
1 check passed
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