Commit Graph

27 Commits

Author SHA1 Message Date
can1357 bc39ffa265 feat: introduced omptype validation package and migrated workspace dependencies
- Introduce `@oh-my-pi/omptype` as a new ArkType-compatible schema validation package featuring a lazy JIT runtime, JSON Schema emission, and compatibility adapters.
- Replace `arktype` across workspace packages and test utilities with `@oh-my-pi/omptype`.
- Add benchmark suites, tests, and documentation for the new validation engine and adapters.
- Update workspace build, test runner, and release configurations to include the new package.
2026-08-03 21:56:48 +02:00
metaphorics 48b2a742c8 fix(ask): distinct chat redirect result, row-specific note prefill
Op: correct
Restores: review:4375

- Widen ExtensionAskDialogResult to a union with { kind: "chat" } variant
  so AskTool can distinguish chat handoff from cancel (undefined).
- AskDialogComponent.#finishChat passes { kind: "chat" } via onChat.
- Controller settles { kind: "chat" } locally and propagates a "chat"
  sentinel through the guest/collab path instead of returning undefined.
- AskTool returns a chat-redirect AgentToolResult (chatRedirect details)
  instead of aborting with ToolAbortError.
- #promptForNote prefills with the existing note only when editing the
  same row (noteRowKey === rowItem.key), preventing cross-row note leaks.
- Add ask-dialog and ask tool tests for chat redirect and row-specific
  note prefill.
2026-07-03 11:52:51 +09:00
metaphorics 38a5c8a893 feat(ask): add rich interactive dialog
Adds the rich TUI ask dialog, additive schema fields, ask.enabled tool gating, note/preview/header support, chat redirect, and timeout behavior that defers while nested prompts are active instead of discarding user input.

Op: extend
2026-07-03 09:20:29 +09:00
can1357 3b80dc01de fix(tui): cap sparse ask other gaps 2026-07-01 21:42:24 +02:00
roboomp d34ca214ae fix(tui): bounded ask other title by rendered rows
Pre-truncate every line in the Other editor title to one rendered row at the live terminal width (truncateToWidth + Ellipsis), then enforce a hard total-row budget (MAX_CUSTOM_INPUT_TITLE_ROWS=16) by dropping description rows for unchecked options first, then checked options, so the input row and hint stay reachable on 80x24.

Refs #3660
2026-06-27 14:21:39 +00:00
roboomp e28289a06e fix(tui): bounded checked ask other rows
Kept checked multi-select rows within the Other editor context budget and summarized omitted checked options in gap markers.

Refs #3660
2026-06-27 14:13:30 +00:00
roboomp 4276b854c1 fix(tui): capped ask other editor context
Bounded the editor title rendered while typing a custom 'Other' answer: window options around the selected/first/checked rows, flatten and truncate descriptions to a single line, and emit '… N more options …' markers for dropped runs.

Refs #3660
2026-06-27 14:08:16 +00:00
roboomp 1c6d3ca5a8 style: bun run fix 2026-06-27 14:00:25 +00:00
roboomp 6a83f0a4aa fix(tui): preserved ask other context
Kept the ask tool question and options visible when switching to the Other custom input editor.

Added a regression test for the custom editor title context.

Fixes #3660
2026-06-27 13:59:19 +00:00
roboomp 12aedd7388 fix(coding-agent): returned to ask options after custom escape
Keep the ask tool on the current question when the custom answer editor is dismissed, so Escape from Other returns to the option selector instead of aborting or recording an empty answer.

Fixes #3269
2026-06-22 17:10:49 +00:00
can1357 687487385b test(coding-agent): drop tts/stt worker tests; harden timing-bound tests
The tts/stt suite spawns sherpa-onnx worker subprocesses that hang on the
headless CI runner (zero-output stall → SIGTERM), and the resulting event-loop
starvation tipped real-time TUI tests (streaming-preview, custom-editor shimmer,
ask timeouts) past bun's 5s default. Remove the tts/stt tests and give the
timing-sensitive tests an explicit 30s timeout.
2026-06-14 20:18:09 +02:00
can1357 fd06c70dde fix(ask): restored checkmark glyph on custom answers and done option
- Replaced ask-tool icon with success glyph swapped during status sweep.
- Updated tests to expect a single success glyph on custom input.
2026-06-10 11:02:47 +02:00
can1357 61a57c1d21 fix(coding-agent): stabilized streaming TUI rendering with readonly rows and memoized reuse
- Changed render methods to return component-owned `readonly string[]` rows.
- Added `RenderStablePrefix` row reuse to avoid repainting unchanged streaming content.
- Stabilized streaming gutters and spinner placement to reduce preview jitter and flicker.
- Finalized commit-safe transcript behavior for tool-call previews and added streaming edge-case tests.
2026-06-10 07:26:02 +02:00
can1357 1dc95e72fc fix(coding-agent/tools): normalized ask tool call args to prevent TUI render crashes
- Normalized untrusted `questions` arguments by parsing double-encoded JSON strings and skipping invalid question entries before rendering.
- Added option normalization that dropped malformed option items while preserving valid entries in multi-choice rendering.
- Expanded ask tool renderer tests to verify malformed or unparsable questions no longer crash and now fall back safely.
2026-06-10 06:33:35 +02:00
can1357 bda3102451 ux(coding-agent): updated status glyphs and fixed extension model discovery refresh
- Added status.done and tool.* symbols to theme mappings and presets.
- Replaced generic success glyphs with contextual +/-, tool icons, and warnings.
- Mapped tool/task/job completions to status.done or status.enabled with icon overrides.
- Triggered runtime provider refresh after extension registration and warned on failure.
2026-06-08 18:28:15 +02:00
can1357 4a3984eb0a fix(coding-agent/tools): fixed Markdown cache contamination from mutable render arrays
- Marked Markdown cached lines as readonly snapshots and returned copied arrays from `render()`.
- Stored fresh snapshot arrays in both L1 and L2 caches so callers appending rows cannot mutate shared cached Markdown output.
- Added an AskTool test that renders calls and results twice to verify repeated renders remain stable and do not duplicate option labels.
2026-06-07 07:33:43 +02:00
can1357 7f271f9b9d feat(coding-agent): added native selection markers to ask dialogs
- Added `selectionMarker`, `checkedIndices`, and `markableCount` options to render radio/checkbox glyphs per row.
- Moved checkbox rendering from inline label prefixes into the selector component.
- Kept trailing control rows like "Other"/"Done" on the plain cursor.
2026-06-04 03:43:17 +02:00
can1357 9a544b6ee0 feat(coding-agent): added radio markers for single-choice ask options
- Rendered single-choice questions with circular radio glyphs instead of checkboxes.
- Kept rectangular checkboxes for multi-select questions.
- Added radio.selected/unselected symbols to unicode, nerd-font, and ASCII presets.
2026-06-03 22:21:06 +02:00
rimless-casualty 3c7d50d292 Improve ask option rendering 2026-06-01 17:37:26 +08:00
can1357 59c8749ad7 fix(tui): resolved tui status footer truncation using VT stripping
- Replaced ad-hoc ANSI/VT stripping regexes with `stripVTControlCharacters` in status text handling and related tests.
- Updated status footer rendering to truncate using `truncateToWidth` and visible width after VT stripping.
- Extended tui cursor handling and rendering to strip markers from all lines and fit repaint/append-tail lines to width.
- Expanded deterministic render tests with overlay-aware assertions and recorded the truncation/cursor-marker behavior in changelogs.
2026-05-31 07:54:23 +02:00
Leo Kim 5c60e1c9f8 feat(coding-agent): default ask.timeout to 0 (wait indefinitely)
The 30 second default for 'ask.timeout' silently auto-selects the
recommended option mid-deliberation, which surprises users who are
weighing options the agent flagged as having materially different
tradeoffs. The setting was meant to be opt-in: 0 already means
'wait indefinitely' and plan mode already forces the timer off.

Flip the default to 0 so a fresh install matches the documented
'wait until the user replies' behavior, and update the AskTool
prompt so the model expects unlimited reply time by default. Users
who liked the auto-select can still set a positive timeout from
the Interaction settings tab.

Add a regression test asserting the dialog timeout is not passed
to the underlying selector when 'ask.timeout' is unset.
2026-05-11 10:54:09 +09:00
Vu Anh Nguyen b98a1bcfcf fix(ask): preserve prior answer when custom editor dismissed in single-select 2026-03-26 17:20:31 +07:00
Vu Anh Nguyen 5a616b3cd6 fix(ask): preserve multiselect choices on editor dismiss 2026-03-26 16:35:34 +07:00
Vu Anh Nguyen 99dabb7c18 fix(ask): keep multiline custom input in prompt gutter 2026-03-26 16:14:52 +07:00
can1357 b5a471d8db feat(ask): add back and forward multi-question navigation
Fixes #262
2026-03-03 15:09:46 +01:00
daandden 60086d8a49 fix(ask): restore ask timeout auto-select behavior (#269)
* fix(coding-agent): restore ask timeout auto-select behavior

Fixes #266

* fix(coding-agent): derive ask timeout from ui timeout events

* fix(coding-agent): enforce ask timeout during custom input

* fix(ask): preserve sub-second timeout precision in interactive flow

* fix(ask): reset hook input timeout on user activity

* fix(ask): keep expiration timeout when refreshing tick interval

* fix(ask): auto-select deterministic default on timeout

Fixes #266

---------

Co-authored-by: Vũ Anh Nguyễn <vu.anh.nguyen@mgm-tp.com>
Co-authored-by: can1357 <me@can.ac>
2026-03-03 14:45:06 +01:00
can1357 1643cd4673 feat(ask): migrated ask tool to AbortSignal-based cancellation for unified abort handling
- Replaced timeout-based cancellation with AbortSignal-based cancellation in ask tool for unified abort handling.
- Added signal parameter to UIContext select() and input() methods to support external cancellation propagation.
- Fixed race condition in dialog overlay handling by replacing direct resolve() calls with settled flag wrapper.
- Added comprehensive test coverage for ask tool cancellation behavior across user-initiated and timeout scenarios.
2026-03-01 11:19:32 +01:00