opencode-multiplexer 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,41 @@
1
+ name: Publish to npm
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+
8
+ jobs:
9
+ publish:
10
+ name: Publish
11
+ runs-on: ubuntu-latest
12
+ environment: prod
13
+ permissions:
14
+ id-token: write # required for OIDC trusted publishing
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Setup Node.js
20
+ uses: actions/setup-node@v4
21
+ with:
22
+ node-version: '24'
23
+ registry-url: 'https://registry.npmjs.org'
24
+
25
+ - name: Setup bun
26
+ uses: oven-sh/setup-bun@v2
27
+
28
+ - name: Install dependencies
29
+ run: npm ci
30
+
31
+ - name: Type check
32
+ run: npx tsc --noEmit
33
+
34
+ # - name: Test
35
+ # run: npm test
36
+
37
+ - name: Build
38
+ run: npm run build
39
+
40
+ - name: Publish to npm
41
+ run: npm publish
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-multiplexer",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "type": "module",
5
5
  "description": "Multiplexer for opencode AI coding agent sessions",
6
6
  "keywords": ["opencode", "ai", "agent", "tui", "multiplexer"],
@@ -9,7 +9,7 @@
9
9
  },
10
10
  "scripts": {
11
11
  "dev": "bun src/index.tsx",
12
- "build": "bun build src/index.tsx --outdir dist --target bun"
12
+ "build": "bun build src/index.tsx --outdir dist --target bun --external react-devtools-core"
13
13
  },
14
14
  "dependencies": {
15
15
  "@opencode-ai/sdk": "^1.2.27",
@@ -25,5 +25,13 @@
25
25
  "@types/react": "^19.2.14",
26
26
  "typescript": "^5.9.3"
27
27
  },
28
- "license": "ISC"
28
+ "license": "ISC",
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "https://github.com/joeyism/opencode-multiplexer"
32
+ },
33
+ "homepage": "https://github.com/joeyism/opencode-multiplexer",
34
+ "bugs": {
35
+ "url": "https://github.com/joeyism/opencode-multiplexer/issues"
36
+ }
29
37
  }
package/src/poller.ts CHANGED
@@ -77,7 +77,10 @@ function getRunningOpencodeProcesses(): RunningProcess[] {
77
77
  const trimmed = line.trim()
78
78
 
79
79
  // Match TUI: "opencode" or "opencode -s {sessionId}"
80
- const tuiMatch = trimmed.match(/^(\d+)\s+opencode(?:\s+-s\s+(\S+))?$/)
80
+ // Linux: "node /path/to/opencode" wrapper is 1:1 with real sessions. macOS: bare "opencode".
81
+ // Never match ".opencode" — it's always a child process or orphaned subagent.
82
+ // NOTE: Does not match standalone binaries ("/usr/local/bin/opencode") — assumes npm/nvm/bun wrapper on Linux.
83
+ const tuiMatch = trimmed.match(/^(\d+)\s+(?:(?:node|bun|deno)\s+\S*\/opencode|opencode)(?:\s+-s\s+(\S+))?$/)
81
84
  if (tuiMatch) {
82
85
  const pid = parseInt(tuiMatch[1]!, 10)
83
86
  const sessionId = tuiMatch[2] ?? null
@@ -87,7 +90,8 @@ function getRunningOpencodeProcesses(): RunningProcess[] {
87
90
  }
88
91
 
89
92
  // Match serve: "opencode serve --port {port} ..."
90
- const serveMatch = trimmed.match(/^(\d+)\s+opencode\s+serve\s+.*--port\s+(\d+)/)
93
+ // Linux: "node /path/to/opencode" wrapper. macOS: bare "opencode".
94
+ const serveMatch = trimmed.match(/^(\d+)\s+(?:(?:node|bun|deno)\s+\S*\/opencode|opencode)\s+serve\s+.*--port\s+(\d+)/)
91
95
  if (serveMatch) {
92
96
  const pid = parseInt(serveMatch[1]!, 10)
93
97
  const port = parseInt(serveMatch[2]!, 10)
@@ -110,7 +110,8 @@ function findPidByWorktree(worktree: string): number | null {
110
110
  for (const line of psOutput.split("\n")) {
111
111
  const trimmed = line.trim()
112
112
  // Match both TUI and serve patterns
113
- const match = trimmed.match(/^(\d+)\s+opencode(?:\s+serve|\s+-s\s+\S+)?/)
113
+ // Linux: "node /path/to/opencode" wrapper. macOS: bare "opencode".
114
+ const match = trimmed.match(/^(\d+)\s+(?:(?:node|bun|deno)\s+\S*\/opencode|opencode)(?:\s+serve|\s+-s\s+\S+)?/)
114
115
  if (!match) continue
115
116
  const pid = parseInt(match[1]!, 10)
116
117
  try {