Skip to content

Commit 4f9e8f3

Browse files
release: refactor core sse streaming into unified merged-stream
1 parent a6f3d05 commit 4f9e8f3

File tree

9 files changed

+92
-75
lines changed

9 files changed

+92
-75
lines changed

.changeset/merged-stream-refactor.md

Lines changed: 0 additions & 50 deletions
This file was deleted.

apps/swarm-cli/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# @opencode-vibe/swarm-cli
22

3+
## 0.2.1
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [[`c835050`](https://github.com/joelhooks/opencode-vibe/commit/c835050984388a9414b37b9c961a6a5b1a4deac5)]:
8+
- @opencode-vibe/core@0.4.0
9+
310
## 0.2.0
411

512
### Minor Changes

apps/swarm-cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@opencode-vibe/swarm-cli",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"private": true,
55
"type": "module",
66
"bin": {

bun.lock

Lines changed: 20 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@
2222
"ci:publish": "for dir in packages/*; do (cd \"$dir\" && bun publish --access public || true); done && changeset tag"
2323
},
2424
"devDependencies": {
25-
"@biomejs/biome": "^2.3.10",
25+
"@biomejs/biome": "^2.3.11",
2626
"@changesets/changelog-github": "^0.5.2",
2727
"@changesets/cli": "^2.29.8",
2828
"@libsql/darwin-arm64": "^0.5.22",
2929
"@types/bun": "latest",
3030
"@types/jsdom": "^27.0.0",
31-
"@typescript/native-preview": "^7.0.0-dev.20260101.1",
31+
"@typescript/native-preview": "^7.0.0-dev.20260103.1",
3232
"@vitest/coverage-v8": "^4.0.16",
3333
"happy-dom": "^20.0.11",
3434
"jsdom": "^27.4.0",

packages/core/CHANGELOG.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,58 @@
11
# @opencode-vibe/core
22

3+
## 0.4.0
4+
5+
### Minor Changes
6+
7+
- [`c835050`](https://github.com/joelhooks/opencode-vibe/commit/c835050984388a9414b37b9c961a6a5b1a4deac5) Thanks [@joelhooks](https://github.com/joelhooks)! - refactor(core): unify SSE streaming into merged-stream
8+
9+
```
10+
╔═══════════════════════════════════════════════════════════╗
11+
║ ║
12+
║ 🌊 STREAM UNIFICATION 🌊 ║
13+
║ ║
14+
║ sse-bridge.ts ┐ ║
15+
║ │ ║
16+
║ merged-stream.ts ├──► merged-stream.ts ║
17+
║ │ (unified) ║
18+
║ stream.ts ┘ ║
19+
║ ║
20+
║ THREE FLOWS → ONE ELEGANT STREAM ║
21+
║ ║
22+
╚═══════════════════════════════════════════════════════════╝
23+
```
24+
25+
> "If you find the same pattern of code repeated over and over,
26+
> see if you can reorganize the code to eliminate the repetition.
27+
> One approach is to factor the repeated code into a new function."
28+
> — John Ousterhout, A Philosophy of Software Design
29+
30+
**Refactoring Summary:**
31+
32+
- **DELETED** `sse-bridge.ts` - merged functionality into `merged-stream.ts`
33+
- **DRYed** SSE event handling logic (was duplicated across 3 files)
34+
- **Simplified** `stream.ts` via delegation to unified `merged-stream`
35+
- **Added** comprehensive tests for discovery, world stream, and watch command
36+
- **Improved** CLI output formatting with better throttling
37+
38+
**Files Changed:**
39+
40+
Core Package:
41+
42+
- `packages/core/src/world/merged-stream.ts` - unified SSE handling
43+
- `packages/core/src/world/stream.ts` - simplified via delegation
44+
- `packages/core/src/world/sse-bridge.ts` - DELETED
45+
- `packages/core/src/discovery/discovery.test.ts` - added tests
46+
- `packages/core/src/types/domain.ts` - type updates
47+
48+
Swarm CLI:
49+
50+
- `apps/swarm-cli/src/commands/watch.ts` - improved throttling
51+
- `apps/swarm-cli/src/output.ts` - better formatting
52+
- `apps/swarm-cli/STREAMING_EXAMPLE.md` - updated docs
53+
54+
**Breaking Changes:** None - external API unchanged.
55+
356
## 0.3.0
457

558
### Minor Changes

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@opencode-vibe/core",
3-
"version": "0.3.0",
3+
"version": "0.4.0",
44
"dependencies": {
55
"@effect-atom/atom": "^0.4.11",
66
"@libsql/client": "^0.15.15",

packages/react/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# @opencode-vibe/react
22

3+
## 0.4.1
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [[`c835050`](https://github.com/joelhooks/opencode-vibe/commit/c835050984388a9414b37b9c961a6a5b1a4deac5)]:
8+
- @opencode-vibe/core@0.4.0
9+
310
## 0.4.0
411

512
### Minor Changes

packages/react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@opencode-vibe/react",
3-
"version": "0.4.0",
3+
"version": "0.4.1",
44
"type": "module",
55
"description": "React bindings for OpenCode",
66
"exports": {

0 commit comments

Comments
 (0)