diff --git a/.agents/docs/ink-divergences.md b/.agents/docs/ink-divergences.md index 5b7556d..1af8141 100644 --- a/.agents/docs/ink-divergences.md +++ b/.agents/docs/ink-divergences.md @@ -31,16 +31,6 @@ deliberate. Divergences fall into a few kinds: - **Why:** mirrors Vue's own `createApp` mental model — a Vue developer expects an app object they mount, not a one-shot render call. -### App composable — `useAppContext()` instead of `useApp()` - -- **Ink:** `useApp()` returns `{ exit, waitUntilRenderFlush }` — stdin/stdout/stderr are - separate hooks (`useStdin`/`useStdout`/`useStderr`), not part of it. -- **vue-tui:** `useAppContext()` returns the same `{ exit, waitUntilRenderFlush }`, with - streams on those same peer composables. -- **Why:** only the name differs — `useApp` reads as "the Vue application instance" - (`createApp`, `app.mount`), so vue-tui qualifies it as `useAppContext`. The shape is - identical to Ink; a naming divergence, not a surface one. - ### Named type / prop re-exports - **Ink:** re-exports its component prop types plus a few data/handle types: diff --git a/README.md b/README.md index b727872..ca1d5e1 100644 --- a/README.md +++ b/README.md @@ -83,11 +83,11 @@ useInput((input) => { ## Packages -| Package | Description | -| -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| [`@vue-tui/runtime`](https://www.npmjs.com/package/@vue-tui/runtime) | The core framework — Vue 3 renderer for the terminal with components (`Box`, `Text`, `Static`, etc.), composables (`useInput`, `useFocus`, `useAppContext`, etc.), and yoga-based flexbox layout | -| [`@vue-tui/cli`](https://www.npmjs.com/package/@vue-tui/cli) | Development tool — `vue-tui dev` starts your app with Vite-powered HMR | -| [`@vue-tui/testing`](https://www.npmjs.com/package/@vue-tui/testing) | Test harness — render in an isolated fake terminal, simulate input, assert output frame by frame | +| Package | Description | +| -------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [`@vue-tui/runtime`](https://www.npmjs.com/package/@vue-tui/runtime) | The core framework — Vue 3 renderer for the terminal with components (`Box`, `Text`, `Static`, etc.), composables (`useInput`, `useFocus`, `useApp`, etc.), and yoga-based flexbox layout | +| [`@vue-tui/cli`](https://www.npmjs.com/package/@vue-tui/cli) | Development tool — `vue-tui dev` starts your app with Vite-powered HMR | +| [`@vue-tui/testing`](https://www.npmjs.com/package/@vue-tui/testing) | Test harness — render in an isolated fake terminal, simulate input, assert output frame by frame | ## Examples @@ -116,7 +116,7 @@ useInput((input) => { | `useInput(handler, opts?)` | Handle keyboard input — receives `(input, key)` with modifier and arrow key detection | | `useFocus(opts?)` | Component-level focus — returns `{ isFocused, focus }` | | `useFocusManager()` | App-level focus control — `focusNext()`, `focusPrevious()`, `focus(id)` | -| `useAppContext()` | App context — `{ exit(error?), waitUntilRenderFlush() }` | +| `useApp()` | App lifecycle — `{ exit(error?), waitUntilRenderFlush() }` | | `useTerminalSize()` | Reactive terminal dimensions — `{ columns, rows }` | | `useStdin()` | Access stdin stream and raw mode control | | `useStdout()` | Write directly to stdout | diff --git a/examples/coding-agent/src/App.vue b/examples/coding-agent/src/App.vue index b4a7c76..80c95aa 100644 --- a/examples/coding-agent/src/App.vue +++ b/examples/coding-agent/src/App.vue @@ -1,6 +1,6 @@