Skip to content

feat(examples): Cap'n Web 0.10 group chat + shared Claude todo list#962

Merged
AlemTuzlak merged 15 commits into
mainfrom
capnweb-update
Jul 20, 2026
Merged

feat(examples): Cap'n Web 0.10 group chat + shared Claude todo list#962
AlemTuzlak merged 15 commits into
mainfrom
capnweb-update

Conversation

@jherr

@jherr jherr commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Update examples/ts-group-chat for Cap'n Web 0.10 bidirectional push RPC (RpcStub + client ChatNotifier as localMain, Vite WebSocket upgrade, typed ChatApi)
  • Add a shared in-memory todo list with manual add/remove in the UI and Claude tools (listTodos / addTodo / removeTodo)
  • Add room-wide Claude passive vs active mode: passive waits for @Claude; active watches chat for todo intent/questions (silent NO_REPLY when unrelated, without sticky “responding” UI)
  • Fix persona switching so changing Alice→Bob leaves the previous user (avoids double-registered push clients / duplicated messages)
  • Clean up example packaging (drop nested pnpm-lock.yaml, move to vite.config.ts) and refresh the README

Test plan

  • cd examples/ts-group-chat && pnpm test:types
  • cd examples/ts-group-chat && cp .env.example .env (set ANTHROPIC_API_KEY) && pnpm dev
  • Open two tabs, pick different users, verify messages and presence push without polling
  • Manually add/remove todos; confirm both tabs sync
  • Passive mode: @Claude add milk to the todos and @Claude what's on the list?
  • Active mode: say “add pizza ingredients to the todos” without @Claude; ask a follow-up like approximate cost; unrelated chit-chat should not post a Claude reply
  • Switch personas in one tab; confirm old user leaves, online list updates, and messages are not duplicated

Made with Cursor

Summary by CodeRabbit

  • New Features
    • Added a shared in-memory todo list with add/remove controls and Claude-assisted management.
    • Introduced passive/active Claude modes with mention-aware behavior and responding indicators.
    • Reworked the example to use real-time, pushed updates for chat presence, todos, and Claude status (no polling).
  • Bug Fixes
    • Improved connection/join UX: gated input until joined, and surfaced inline send errors.
  • Documentation
    • Rewrote the group chat README with updated “How it works,” setup, and configuration details.
  • Chores
    • Updated Vite/RPC wiring and adjusted dev/build/preview scripts and example dependencies.

jherr and others added 11 commits June 17, 2026 08:10
Upgrade the group chat demo to Cap'n Web 0.10 bidirectional push, modern
TanStack Start/Nitro setup, and fix browser RPC by calling stubs via ref
instead of React state.

Co-authored-by: Cursor <cursoragent@cursor.com>
Give ts-group-chat an in-memory todo list users and Claude can manage, with
passive @claude mentions vs active chat watching, plus clean persona switching.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a9f23fce-0059-4be8-ad20-5359c0410424

📥 Commits

Reviewing files that changed from the base of the PR and between 8750a92 and 2453eef.

📒 Files selected for processing (13)
  • examples/ts-group-chat/chat-server/capnweb-rpc.ts
  • examples/ts-group-chat/chat-server/chat-api.ts
  • examples/ts-group-chat/chat-server/todo-logic.ts
  • examples/ts-group-chat/chat-server/vite-plugin.ts
  • examples/ts-group-chat/src/components/ChatInterface.tsx
  • examples/ts-group-chat/src/components/OnlineUsers.tsx
  • examples/ts-group-chat/src/components/TodoList.tsx
  • examples/ts-group-chat/src/hooks/useChatConnection.ts
  • examples/ts-group-chat/src/hooks/useChatMessages.ts
  • examples/ts-group-chat/src/hooks/useClaude.ts
  • examples/ts-group-chat/src/hooks/useTodos.ts
  • examples/ts-group-chat/src/lib/chat-notifier.ts
  • examples/ts-group-chat/src/routes/index.tsx
🚧 Files skipped from review as they are similar to previous changes (13)
  • examples/ts-group-chat/src/lib/chat-notifier.ts
  • examples/ts-group-chat/chat-server/chat-api.ts
  • examples/ts-group-chat/chat-server/vite-plugin.ts
  • examples/ts-group-chat/src/routes/index.tsx
  • examples/ts-group-chat/src/components/OnlineUsers.tsx
  • examples/ts-group-chat/src/components/ChatInterface.tsx
  • examples/ts-group-chat/src/components/TodoList.tsx
  • examples/ts-group-chat/src/hooks/useChatConnection.ts
  • examples/ts-group-chat/chat-server/todo-logic.ts
  • examples/ts-group-chat/src/hooks/useTodos.ts
  • examples/ts-group-chat/src/hooks/useChatMessages.ts
  • examples/ts-group-chat/src/hooks/useClaude.ts
  • examples/ts-group-chat/chat-server/capnweb-rpc.ts

📝 Walkthrough

Walkthrough

The group chat example is migrated from polling to typed Cap’n Web push notifications, adds shared todos and Claude modes, introduces typed server/client contracts, updates Claude queue processing, and revises the UI, documentation, scripts, and Vite runtime configuration.

Changes

Group chat RPC and Claude integration

Layer / File(s) Summary
Shared contracts and Claude services
examples/ts-group-chat/chat-server/chat-api.ts, chat-logic.ts, todo-logic.ts, claude-service.ts, index.ts
Shared API types, synchronous chat operations, in-memory todo management, Claude todo tools, mode-aware prompts, and queue status fields are introduced.
Server notifier and chat queue flow
examples/ts-group-chat/chat-server/capnweb-rpc.ts, vite-plugin.ts
The server registers typed notifier targets, pushes normalized chat and state events, expands join state, and queues Claude responses through the WebSocket RPC session.
Client connection and push synchronization
examples/ts-group-chat/src/hooks/*, examples/ts-group-chat/src/lib/chat-notifier.ts
Client hooks establish and dispose typed RPC sessions, consume pushed notifications, manage persona joins, synchronize Claude status and todos, and expose typed operations.
Todo and chat interface integration
examples/ts-group-chat/src/components/*, examples/ts-group-chat/src/routes/index.tsx
The UI adds todo and Claude-mode controls, joined-state gating, inline send errors, queue indicators, and mode-specific instructions.
Example runtime and documentation setup
examples/ts-group-chat/README.md, package.json, vite.config.ts, .env.example, src/routes/__root.tsx
Documentation, environment guidance, scripts, dependencies, Vite/Nitro settings, and devtools event-bus configuration are updated for the new example flow.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Browser
  participant ChatServer
  participant ChatNotifier
  participant ClaudeService
  Browser->>ChatServer: joinChat(username)
  ChatServer->>ChatNotifier: push room state
  Browser->>ChatServer: sendMessage(message)
  ChatServer->>ChatNotifier: push chat event
  ChatServer->>ClaudeService: enqueue request
  ClaudeService->>ChatNotifier: push Claude status and response
Loading

Suggested reviewers: tombeckenham

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description has Summary and Test plan, but it omits the required Checklist and Release Impact sections. Add the template sections for ✅ Checklist and 🚀 Release Impact, including the contributing/test checkboxes and whether a changeset is needed.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main change: Cap'n Web 0.10 group chat with Claude todo features.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch capnweb-update

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

No changeset entries found. Merging this PR will not cause a version bump for any packages.

@socket-security

socket-security Bot commented Jul 19, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedcapnweb@​0.1.0 ⏵ 0.10.079 -2110010096 -4100

View full report

@nx-cloud

nx-cloud Bot commented Jul 19, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 0e3913f

Command Status Duration Result
nx run-many --targets=build --exclude=examples/... ✅ Succeeded 2s View ↗

☁️ Nx Cloud last updated this comment at 2026-07-19 16:16:04 UTC

@pkg-pr-new

pkg-pr-new Bot commented Jul 19, 2026

Copy link
Copy Markdown

Open in StackBlitz

@tanstack/ai

npm i https://pkg.pr.new/@tanstack/ai@962

@tanstack/ai-acp

npm i https://pkg.pr.new/@tanstack/ai-acp@962

@tanstack/ai-angular

npm i https://pkg.pr.new/@tanstack/ai-angular@962

@tanstack/ai-anthropic

npm i https://pkg.pr.new/@tanstack/ai-anthropic@962

@tanstack/ai-bedrock

npm i https://pkg.pr.new/@tanstack/ai-bedrock@962

@tanstack/ai-claude-code

npm i https://pkg.pr.new/@tanstack/ai-claude-code@962

@tanstack/ai-client

npm i https://pkg.pr.new/@tanstack/ai-client@962

@tanstack/ai-code-mode

npm i https://pkg.pr.new/@tanstack/ai-code-mode@962

@tanstack/ai-code-mode-skills

npm i https://pkg.pr.new/@tanstack/ai-code-mode-skills@962

@tanstack/ai-codex

npm i https://pkg.pr.new/@tanstack/ai-codex@962

@tanstack/ai-devtools-core

npm i https://pkg.pr.new/@tanstack/ai-devtools-core@962

@tanstack/ai-elevenlabs

npm i https://pkg.pr.new/@tanstack/ai-elevenlabs@962

@tanstack/ai-event-client

npm i https://pkg.pr.new/@tanstack/ai-event-client@962

@tanstack/ai-fal

npm i https://pkg.pr.new/@tanstack/ai-fal@962

@tanstack/ai-gemini

npm i https://pkg.pr.new/@tanstack/ai-gemini@962

@tanstack/ai-grok

npm i https://pkg.pr.new/@tanstack/ai-grok@962

@tanstack/ai-grok-build

npm i https://pkg.pr.new/@tanstack/ai-grok-build@962

@tanstack/ai-groq

npm i https://pkg.pr.new/@tanstack/ai-groq@962

@tanstack/ai-isolate-cloudflare

npm i https://pkg.pr.new/@tanstack/ai-isolate-cloudflare@962

@tanstack/ai-isolate-node

npm i https://pkg.pr.new/@tanstack/ai-isolate-node@962

@tanstack/ai-isolate-quickjs

npm i https://pkg.pr.new/@tanstack/ai-isolate-quickjs@962

@tanstack/ai-mcp

npm i https://pkg.pr.new/@tanstack/ai-mcp@962

@tanstack/ai-mistral

npm i https://pkg.pr.new/@tanstack/ai-mistral@962

@tanstack/ai-ollama

npm i https://pkg.pr.new/@tanstack/ai-ollama@962

@tanstack/ai-openai

npm i https://pkg.pr.new/@tanstack/ai-openai@962

@tanstack/ai-opencode

npm i https://pkg.pr.new/@tanstack/ai-opencode@962

@tanstack/ai-openrouter

npm i https://pkg.pr.new/@tanstack/ai-openrouter@962

@tanstack/ai-preact

npm i https://pkg.pr.new/@tanstack/ai-preact@962

@tanstack/ai-react

npm i https://pkg.pr.new/@tanstack/ai-react@962

@tanstack/ai-react-ui

npm i https://pkg.pr.new/@tanstack/ai-react-ui@962

@tanstack/ai-sandbox

npm i https://pkg.pr.new/@tanstack/ai-sandbox@962

@tanstack/ai-sandbox-cloudflare

npm i https://pkg.pr.new/@tanstack/ai-sandbox-cloudflare@962

@tanstack/ai-sandbox-daytona

npm i https://pkg.pr.new/@tanstack/ai-sandbox-daytona@962

@tanstack/ai-sandbox-docker

npm i https://pkg.pr.new/@tanstack/ai-sandbox-docker@962

@tanstack/ai-sandbox-local-process

npm i https://pkg.pr.new/@tanstack/ai-sandbox-local-process@962

@tanstack/ai-sandbox-sprites

npm i https://pkg.pr.new/@tanstack/ai-sandbox-sprites@962

@tanstack/ai-sandbox-vercel

npm i https://pkg.pr.new/@tanstack/ai-sandbox-vercel@962

@tanstack/ai-solid

npm i https://pkg.pr.new/@tanstack/ai-solid@962

@tanstack/ai-solid-ui

npm i https://pkg.pr.new/@tanstack/ai-solid-ui@962

@tanstack/ai-svelte

npm i https://pkg.pr.new/@tanstack/ai-svelte@962

@tanstack/ai-utils

npm i https://pkg.pr.new/@tanstack/ai-utils@962

@tanstack/ai-vue

npm i https://pkg.pr.new/@tanstack/ai-vue@962

@tanstack/ai-vue-ui

npm i https://pkg.pr.new/@tanstack/ai-vue-ui@962

@tanstack/openai-base

npm i https://pkg.pr.new/@tanstack/openai-base@962

@tanstack/preact-ai-devtools

npm i https://pkg.pr.new/@tanstack/preact-ai-devtools@962

@tanstack/react-ai-devtools

npm i https://pkg.pr.new/@tanstack/react-ai-devtools@962

@tanstack/solid-ai-devtools

npm i https://pkg.pr.new/@tanstack/solid-ai-devtools@962

commit: 2453eef

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
examples/ts-group-chat/chat-server/chat-api.ts (1)

21-86: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Fix widespread ESLint errors (method-signature-style, array-type).

Static analysis flags method-signature-style errors on nearly every ChatApi/ChatNotifierApi member (Lines 72, 76-85) and array-type errors on string[]/TodoItem[]/ChatMessage[] fields (Lines 27, 28, 41, 42, 46, 52-54, 65). Since these are configured as ESLint errors, they'll likely fail lint/CI for this shared contracts file.

🔧 Example fix pattern
 export interface ChatApi {
-  joinChat(username: string): JoinResult
-  leaveChat(): { message: string }
+  joinChat: (username: string) => JoinResult
+  leaveChat: () => { message: string }
   ...
 }

Apply the same Array<T> / function-property conversion to the other flagged lines.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/ts-group-chat/chat-server/chat-api.ts` around lines 21 - 86, Update
the shared interfaces in ChatNotification, ChatRoomState, ChatState, JoinResult,
ClaudeQueueStatus, and ChatApi to satisfy the configured array-type and
method-signature-style rules: replace flagged T[] declarations with Array<T> and
express interface methods such as notify, joinChat, leaveChat, and the remaining
ChatApi members as function properties. Preserve all existing types, parameters,
and return contracts.

Source: Linters/SAST tools

examples/ts-group-chat/chat-server/capnweb-rpc.ts (1)

334-351: 🚀 Performance & Scalability | 🔵 Trivial

Active mode invokes an LLM stream for every message.

In active mode, every non-Claude message enqueues a Claude request and runs a full streamResponse just to decide whether to reply (often NO_REPLY). For a busy room this multiplies latency and Anthropic API cost per message. Consider a cheap pre-filter (e.g. keyword/intent gate before enqueue) or debouncing to avoid a model call on clearly-unrelated chatter.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/ts-group-chat/chat-server/capnweb-rpc.ts` around lines 334 - 351,
Add a low-cost relevance gate to the active-mode path before calling
enqueueClaudeRequest, so clearly unrelated messages are sent without starting an
LLM stream while mentions retain the existing behavior. Update the logic around
shouldAskClaude and enqueueClaudeRequest, preserving direct Claude mentions and
the current chat response messages.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@examples/ts-group-chat/chat-server/todo-logic.ts`:
- Around line 4-13: Fix the ESLint violations across the listed sites: use
Array<TodoItem> and Array<string> in todo-logic.ts and capnweb-rpc.ts; remove
the unnecessary optional chaining in chat-notifier.ts; reorder imports in
vite-plugin.ts; sort and hoist the RefObject type import in useChatMessages.ts
and useClaude.ts; remove the redundant message type assertions in both hooks.
Apply these changes at examples/ts-group-chat/chat-server/todo-logic.ts lines
4-13, examples/ts-group-chat/chat-server/capnweb-rpc.ts lines 158 and 269,
examples/ts-group-chat/src/lib/chat-notifier.ts line 19,
examples/ts-group-chat/chat-server/vite-plugin.ts line 2,
examples/ts-group-chat/src/hooks/useChatMessages.ts lines 1 and 26, and
examples/ts-group-chat/src/hooks/useClaude.ts lines 1 and 77.

---

Nitpick comments:
In `@examples/ts-group-chat/chat-server/capnweb-rpc.ts`:
- Around line 334-351: Add a low-cost relevance gate to the active-mode path
before calling enqueueClaudeRequest, so clearly unrelated messages are sent
without starting an LLM stream while mentions retain the existing behavior.
Update the logic around shouldAskClaude and enqueueClaudeRequest, preserving
direct Claude mentions and the current chat response messages.

In `@examples/ts-group-chat/chat-server/chat-api.ts`:
- Around line 21-86: Update the shared interfaces in ChatNotification,
ChatRoomState, ChatState, JoinResult, ClaudeQueueStatus, and ChatApi to satisfy
the configured array-type and method-signature-style rules: replace flagged T[]
declarations with Array<T> and express interface methods such as notify,
joinChat, leaveChat, and the remaining ChatApi members as function properties.
Preserve all existing types, parameters, and return contracts.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ebe86302-1b94-4e32-9a0e-ca7625af50cb

📥 Commits

Reviewing files that changed from the base of the PR and between bf870fa and 8750a92.

⛔ Files ignored due to path filters (2)
  • examples/ts-group-chat/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (22)
  • examples/ts-group-chat/.env.example
  • examples/ts-group-chat/README.md
  • examples/ts-group-chat/chat-server/capnweb-rpc.ts
  • examples/ts-group-chat/chat-server/chat-api.ts
  • examples/ts-group-chat/chat-server/chat-logic.ts
  • examples/ts-group-chat/chat-server/claude-service.ts
  • examples/ts-group-chat/chat-server/index.ts
  • examples/ts-group-chat/chat-server/todo-logic.ts
  • examples/ts-group-chat/chat-server/vite-plugin.ts
  • examples/ts-group-chat/package.json
  • examples/ts-group-chat/src/components/ChatInterface.tsx
  • examples/ts-group-chat/src/components/OnlineUsers.tsx
  • examples/ts-group-chat/src/components/TodoList.tsx
  • examples/ts-group-chat/src/components/UsernameInput.tsx
  • examples/ts-group-chat/src/hooks/useChatConnection.ts
  • examples/ts-group-chat/src/hooks/useChatMessages.ts
  • examples/ts-group-chat/src/hooks/useClaude.ts
  • examples/ts-group-chat/src/hooks/useTodos.ts
  • examples/ts-group-chat/src/lib/chat-notifier.ts
  • examples/ts-group-chat/src/routes/__root.tsx
  • examples/ts-group-chat/src/routes/index.tsx
  • examples/ts-group-chat/vite.config.ts
💤 Files with no reviewable changes (1)
  • examples/ts-group-chat/src/components/UsernameInput.tsx

Comment thread examples/ts-group-chat/chat-server/todo-logic.ts Outdated
jherr and others added 2 commits July 19, 2026 09:12
Align array/method signature styles and remove always-false conditionals so the Cap'n Web example matches repo lint conventions.

Co-authored-by: Cursor <cursoragent@cursor.com>
@AlemTuzlak
AlemTuzlak merged commit f29a63c into main Jul 20, 2026
10 checks passed
@AlemTuzlak
AlemTuzlak deleted the capnweb-update branch July 20, 2026 09:00
AlemTuzlak added a commit that referenced this pull request Jul 21, 2026
The ts-group-chat example (added in #962) kept nitro 3.0.1-alpha.2 while all
other examples use 3.0.260610-beta, causing sherif's multiple-dependency-versions
check to fail in CI. Bump it to match.
AlemTuzlak added a commit that referenced this pull request Jul 21, 2026
* chore: migrate toolchain to oxc + TypeScript 7 + vite 8

Replace ESLint/Prettier with the oxc toolchain, upgrade the type
checker to TypeScript 7 (native Go compiler), and move the build stack
to vite 8 (Rolldown). Framework tooling that can't run TS7/vite8 yet is
pinned back via the @typescript/typescript6 shim and per-package vite
pins.

Formatter
- Prettier -> oxfmt (.oxfmtrc.json migrated from prettier config).
  oxfmt formats .svelte natively, so prettier + prettier-plugin-svelte
  are removed. `format` -> `oxfmt .`.

Linter
- ESLint -> oxlint, untyped + type-aware (oxlint-tsgolint). The custom
  `as unknown as` ban is ported via oxlint-plugin-eslint; unused-imports
  and @Stylistic run through oxlint's JS-plugin layer. ESLint and
  @tanstack/eslint-config removed. `test:eslint` -> `test:oxlint`.

TypeScript 7
- Root typescript -> 7.0.2 (tsc is the native Go compiler). types now
  defaults to [], so tsconfig.base sets `"types": ["node"]`.
- JS-Compiler-API consumers use the @typescript/typescript6 (6.0.2)
  shim: vite-plugin-dts (built-in fallback), @sveltejs/package,
  svelte-check, vue-tsc, kiira, knip (packageExtensions);
  @analogjs/vite-plugin-angular pinned to 5.9.3. Framework packages
  (angular/vue/solid/svelte) stay on 5.9.3.
- Fixes: ai-acp Uint8Array->BufferSource (TS 5.7 typed-array generics);
  ai-react/ai-preact rootDir "../.." (TS7 rootDir default + cross-package
  test fixtures); one ai-client @ts-expect-error reposition.

Build (vite 8 / Rolldown)
- vite -> 8.1.4, vitest -> 4.1.10. @tanstack/vite-config bumped to 0.5.2
  and patched: outDir->outDirs (vite-plugin-dts 5.x) and an added
  rollupOptions.preserveModules mirror so multi-entry output holds on
  both vite 7 and 8.
- ai-solid-ui stays on vite 7: Solid JSX has no vite 8/Rolldown support
  yet (solidjs/solid-start#2075).

Also: nx 22->23, knip 5->6. sherif ignores typescript+vite (intentional
multi-version). CLAUDE.md updated for the new commands/tooling.

* ci: apply automated fixes

* fix(examples): pin example apps to vite 7

The TanStack Start example apps (Start + nitro + framework plugins)
don't build under vite 8 / Rolldown yet — ts-solid-chat and
ts-react-chat fail in the Start server-fn compiler / nitro server
build. Keep the library packages on vite 8 and hold the dev-only
example apps on vite 7 until Start/nitro support vite 8.

* fix: unblock example builds + ai-mcp CI timeout under the new toolchain

- ai/realtime: drop the literal `createServerFn()` from the JSDoc example.
  The vite 8/Rolldown build preserves JSDoc in the emitted .js (vite 7
  stripped it), and TanStack Start's server-fn plugin string-matches
  `createServerFn`, so it tried to compile @tanstack/ai's realtime dist and
  resolve the framework runtime (@tanstack/solid-start) from ai's package,
  failing ts-solid-chat's build. The example still shows realtimeToken usage.
- ai-mcp: raise vitest testTimeout to 30s. The client/server handshake
  tests absorb ~20s+ cold module-import cost on CI, tipping the first test
  over the 5s default (flaky timeout).

* chore(examples): upgrade nitro to latest

- nitro (v3): sandbox-web + ts-react-media 3.0.1-alpha.2 -> 3.0.260610-beta;
  ts-react-search pinned off the floating `latest` tag to the same version.
  Consolidates to a single nitro v3 in the lockfile (drops the stale alpha).
- @tanstack/nitro-v2-vite-plugin: ^1.154.7 -> ^1.155.0 across the Start
  examples + testing/panel + testing/e2e.

Verified: all six examples build and testing/panel + testing/e2e typecheck.
Examples stay on vite 7 for now (Start/nitro vite 8 support is a separate
follow-up).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(examples): move React Start examples to nitro 3 + vite 8

Un-pins the React Start examples from vite 7 and standardizes them on
nitro 3 (`nitro/vite`), dropping @tanstack/nitro-v2-vite-plugin.

- sandbox-web, ts-react-media, ts-react-search: already nitro 3 — flipped
  vite ^7.3.3 -> ^8.1.4.
- ts-react-chat, ts-code-mode-web: migrated nitroV2Plugin() -> nitro(),
  vite -> ^8.1.4.

nitro 3's server build (rolldown) externalizes node_modules but must
resolve each external at build time. Under pnpm, server-only deps reached
only via a workspace adapter's nested store dir don't resolve from the
example, so the native/wasm/binary ones are declared as direct deps:
  - ts-react-chat: @anthropic-ai/sdk, @elevenlabs/elevenlabs-js, dockerode
  - ts-code-mode-web: isolated-vm, quickjs-emscripten(+core) and the four
    @jitl/quickjs-wasmfile-* variants
The pure-JS server deps the old nitro-v2 externals list named
(google-auth-library, gaxios, jws, gcp-metadata, google-logging-utils, ws,
node-fetch, openai) are now bundled normally and dropped from ssr.external.

ts-solid-chat stays on vite 7 (Solid JSX has no vite 8/Rolldown support
yet); its nitroV2Plugin was already disabled.

Verified: all five migrated examples build and test:types clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* chore(examples): drop stray route-dir test in ts-react-chat

`src/routes/api.sandbox-triage.test.ts` sat under the router's route
directory, so TanStack Router picked it up as a route candidate and
warned it exports no Route. Delete it; equivalent coverage already lives
at `src/sandbox-triage.test.ts`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* chore(examples): use vite 8 native tsconfig paths, drop vite-tsconfig-paths

Vite 8 resolves tsconfig `paths` natively via `resolve.tsconfigPaths`, so
the `vite-tsconfig-paths` plugin is redundant (and now emits a deprecation
warning). Replace `viteTsConfigPaths({ projects: ['./tsconfig.json'] })`
with `resolve: { tsconfigPaths: true }` and remove the dep in the six
vite-8 projects (ts-react-chat, ts-code-mode-web, ts-react-media,
ts-react-search, testing/panel, testing/e2e).

ts-solid-chat and ts-group-chat stay on vite 7, so they keep the plugin.

Verified: all six build and test:types clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* ci: apply automated fixes

* feat(examples): move ts-solid-chat to vite 8

Both blockers the vite-7 pin cited are resolved upstream: vitejs/vite#22057
(Rolldown JSX scanner) and solidjs/solid-start#2075 (vite 8 compat) are now
closed. The example builds on vite 8 because it applies `vite-plugin-solid`
itself, which handles Solid's JSX transform under Rolldown.

- vite ^7.3.3 -> ^8.1.4; also switch to vite 8 native `resolve.tsconfigPaths`
  and drop the vite-tsconfig-paths plugin (merged into the existing resolve).
- @tanstack/ai-solid-ui stays on vite 7: its @tanstack/vite-config library
  build runs no Solid JSX transform, and Rolldown's parser rejects raw JSX
  ("JSX syntax is disabled") where vite 7's esbuild parsed it implicitly.
  That needs a build-pipeline fix (or vite-plugin-solid@3 / Solid 2), not a
  version bump.

Verified: ts-solid-chat builds and test:types clean on vite 8.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(ai-solid-ui): build on vite 8 via vite-plugin-solid

ai-solid-ui was the last Solid holdout on vite 7. Its @tanstack/vite-config
build had no Solid JSX transform — vite 7's esbuild parsed the `.tsx`
(jsxImportSource: solid-js) implicitly, but vite 8's Rolldown parser rejects
raw JSX ("JSX syntax is disabled").

Fix it in the package's own config (not the shared vite-config patch, which
is framework-agnostic): add vite-plugin-solid, mirroring what
solid-ai-devtools already does on vite 8.

- vite ^7.3.3 -> ^8.1.4; add vite-plugin-solid + `plugins: [solid()]`.
- Test env node -> happy-dom: once solid() transforms the components into the
  test graph they import solid-js/web (references `document`), so the suite
  needs a DOM. Adds happy-dom devDep.

Verified: build, test:types, test:lib (7/7), and publint all pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix: align dep ranges to satisfy sherif (happy-dom, dockerode, isolated-vm)

The vite-8/nitro-3 work pinned three newly-direct deps to their resolved
versions, which mismatched the ranges the workspace already declares and
tripped sherif's multiple-dependency-versions check:

- happy-dom  ^20.0.11 -> ^20.0.10 (matches root)
- dockerode  ^4.0.12  -> ^4.0.2  (matches @tanstack/ai-sandbox-docker)
- isolated-vm ^6.1.2  -> ^6.0.2  (matches @tanstack/ai-isolate-node)

Each existing range still resolves to the same installed version, so this
is a declared-range alignment only. sherif passes; affected builds + tests
unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* ci: apply automated fixes

* fix: align ts-group-chat nitro version to fix sherif

The ts-group-chat example (added in #962) kept nitro 3.0.1-alpha.2 while all
other examples use 3.0.260610-beta, causing sherif's multiple-dependency-versions
check to fail in CI. Bump it to match.

* fix: resolve oxlint/knip failures from main merge under new toolchain

The merge brought main's resumable-streams work into the oxc/oxlint/knip6 toolchain, surfacing three checks that were green on main's eslint/knip5 setup:

- ai/stream-to-response.ts: oxlint no-control-regex flagged /[\0\r\n]/; replace
  with String.includes checks (same behavior, no control-char regex).
- ai-durable-stream: still had eslint lint scripts (added on main); migrate to
  oxlint (test:oxlint + lint:fix) and vitest run, matching every other package.
- ai-groq/schema-converter.ts: knip6 flagged a dead transformNullsToUndefined
  re-export (imported only to re-export, consumed nowhere); remove it.

* chore: consume @tanstack/vite-config via pkg.pr.new, drop patch + dts override

TanStack/config#403 fixes vite-config for vite-plugin-dts 5 / Vite 8 upstream.
Point @tanstack/vite-config at that PR's pkg.pr.new build (SHA-pinned,
integrity-locked) and remove the local workarounds it obviates:

- delete patches/@tanstack__vite-config@0.5.2.patch + its patchedDependencies entry
- drop the vite-plugin-dts: 5.0.3 override (the fixed config pins dts 5 itself,
  and it's ai's only path to vite-plugin-dts)
- type durableStream's read(signal?: AbortSignal) — the fixed config's stricter
  dts pass surfaced a latent implicit-any
- CLAUDE.md: correct the TS6-shim tool list (dts is native-TS7 now)

Revert to the released @tanstack/vite-config once #403 lands (tracked in #975).

* chore: use @tanstack/vite-config@0.6.0 (released dts-5/Vite-8 fix)

TanStack/config#403 shipped in 0.6.0. Swap the pkg.pr.new preview for the real
release. Added to minimumReleaseAgeExclude since 0.6.0 is fresh (<24h) and the
build-time devDep is needed now.

* chore: use kiira@0.6.0 (native TS7 engine), drop kiira TS6 shim

kiira 0.6.0 type-checks doc snippets with the project's native TypeScript 7
compiler (engine: auto) and fixes the pnpm external-package install
(ERR_PNPM_IGNORED_BUILDS false failure). It no longer needs the
@typescript/typescript6 shim, so remove the kiira packageExtension. Refresh the
minimumReleaseAge excludes to 0.6.0 (freshly published).

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Tom Beckenham <34339192+tombeckenham@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

2 participants