release: add api proxy and ssr plugin with core refactoring #10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
@opencode-vibe/core@0.3.0
Minor Changes
963a6e9Thanks @joelhooks! - feat(api): add API proxy route for CORS-free mobile accessImplements ADR-013 Phase 1: API Proxy Route
/api/opencode/[port]/[[...path]]catch-all proxy route/api/opencode/${port}instead ofhttp://127.0.0.1:${port}This eliminates CORS issues when accessing OpenCode from mobile Safari via Tailscale.
fd68a7dThanks @joelhooks! - feat: architecture investigation and multi-directory supportCore Layer
React Layer
useMultiDirectorySessions,useMultiDirectoryStatususeSSEStateDocumentation
8321b6fThanks @joelhooks! - feat: ADR-016 Core Layer Responsibility Model - Smart BoundariesWhat Changed
Core Layer (
@opencode-vibe/core)New Effect Services:
StatusService- Session status computation (3-source logic)MessageService- Messages + Parts join (eliminates client-side joins)ContextService- Token usage computationNew APIs:
sessions.getStatus()- Computed session statussessions.listWithStatus()- Sessions with status pre-joinedmessages.listWithParts()- Messages with parts pre-joinedprompt.convertToApiParts()- Prompt transformationNew Utils:
formatRelativeTime()- "5m ago" formatting (SSR-safe)formatTokens()- "1.5K" token formattingnormalizeStatus()- SSE status normalizationDeleted:
packages/core/src/router/- 4,377 LOC of dead code (0 invocations)React Layer (
@opencode-vibe/react)Simplified Hooks:
useSessionStatus- Now uses Core's StatusServiceuseMessagesWithParts- Reads from SSE-populated storeuseContextUsage- Reads from SSE-populated storeuseSendMessage- Uses Core's prompt.convertToApiPartsEffect Isolation:
runWithRuntime()Migration
No breaking changes. Existing code continues to work.
Internal refactor moves computation from React to Core for:
5e5e4e6Thanks @joelhooks! - feat(world): unify world stream to atoms-only pathChanges:
--use-atomsflags from CLI (atoms are THE path now)consumer.ts(stream.ts already has SSE-wired createWorldStream)WorldStateAggregatorclass (394 → 196 lines, 50% reduction)createWorldStreamfrom core directlyCLI now works:
Patch Changes
e9da5e5Thanks @joelhooks! - fix: real-time UI updates for sessions and Task cardsFixes
Session Status Lag (projects-list.tsx)
Task Card Real-Time Updates (tool.tsx)
_opencodemetadata when present on messagesMessageRenderer Memo (session-messages.tsx)
_opencodemetadata to comparison logic7b21536Thanks @joelhooks! - fix: session-based routing for multi-TUI setupsWhen multiple TUI sessions run for the same directory (each spawning its own server), API requests were being routed to the wrong server. The atoms were calling
createClient(directory)without thesessionId, causing directory-based routing to pick the first discovered port instead of the server that owns the session.Fixed by passing
sessionIdtocreateClient()in:SessionAtom.get(),SessionAtom.promptAsync(),SessionAtom.command()MessageAtom.list()PartAtom.list()This enables session-based routing which tracks which server sent events for which session, ensuring requests go to the correct server.
@opencode-vibe/react@0.4.0
Minor Changes
5131e7fThanks @joelhooks! - feat(react): implement SSR plugin for provider-free hooks (ADR-013 Phase 2)Implements uploadthing-inspired factory + SSR plugin pattern:
<OpencodeSSRPlugin>injects config viauseServerInsertedHTMLgenerateOpencodeHelpers()creates hooks that read fromglobalThisfd68a7dThanks @joelhooks! - feat: architecture investigation and multi-directory supportCore Layer
React Layer
useMultiDirectorySessions,useMultiDirectoryStatususeSSEStateDocumentation
8321b6fThanks @joelhooks! - feat: ADR-016 Core Layer Responsibility Model - Smart BoundariesWhat Changed
Core Layer (
@opencode-vibe/core)New Effect Services:
StatusService- Session status computation (3-source logic)MessageService- Messages + Parts join (eliminates client-side joins)ContextService- Token usage computationNew APIs:
sessions.getStatus()- Computed session statussessions.listWithStatus()- Sessions with status pre-joinedmessages.listWithParts()- Messages with parts pre-joinedprompt.convertToApiParts()- Prompt transformationNew Utils:
formatRelativeTime()- "5m ago" formatting (SSR-safe)formatTokens()- "1.5K" token formattingnormalizeStatus()- SSE status normalizationDeleted:
packages/core/src/router/- 4,377 LOC of dead code (0 invocations)React Layer (
@opencode-vibe/react)Simplified Hooks:
useSessionStatus- Now uses Core's StatusServiceuseMessagesWithParts- Reads from SSE-populated storeuseContextUsage- Reads from SSE-populated storeuseSendMessage- Uses Core's prompt.convertToApiPartsEffect Isolation:
runWithRuntime()Migration
No breaking changes. Existing code continues to work.
Internal refactor moves computation from React to Core for:
8605599Thanks @joelhooks! - feat(react): expand factory pattern with 6 new hooksADR-013 Phase 3: Factory Hooks Expansion
Expands the factory pattern from Phase 2 to include all OpenCode hooks.
Components now import from
@/app/hooksinstead of@opencode-vibe/react.New Hooks in Factory
Migration Pattern
Files Changed
packages/react/src/factory.ts- Added 6 new hooks (9 total)packages/react/src/factory-types.ts- Type utilities for router mappingpackages/react/src/factory.test.ts- 22 tests for all hooksapps/web/src/app/hooks.ts- Exports all 9 factory hooks@/app/hooksPatch Changes
e9da5e5Thanks @joelhooks! - fix: real-time UI updates for sessions and Task cardsFixes
Session Status Lag (projects-list.tsx)
Task Card Real-Time Updates (tool.tsx)
_opencodemetadata when present on messagesMessageRenderer Memo (session-messages.tsx)
_opencodemetadata to comparison logicUpdated dependencies [
963a6e9,fd68a7d,8321b6f,e9da5e5,7b21536,5e5e4e6]:@opencode-vibe/swarm-cli@0.2.0
Minor Changes
5e5e4e6Thanks @joelhooks! - feat(world): unify world stream to atoms-only pathChanges:
--use-atomsflags from CLI (atoms are THE path now)consumer.ts(stream.ts already has SSE-wired createWorldStream)WorldStateAggregatorclass (394 → 196 lines, 50% reduction)createWorldStreamfrom core directlyCLI now works:
Patch Changes
963a6e9,fd68a7d,8321b6f,e9da5e5,7b21536,5e5e4e6]: