claude-opencode-viewer 2.1.8 → 2.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.
Files changed (3) hide show
  1. package/index.html +4 -3
  2. package/package.json +1 -1
  3. package/server.js +2 -2
package/index.html CHANGED
@@ -145,7 +145,7 @@
145
145
  var isIOS = /iPhone|iPad|iPod/i.test(navigator.userAgent);
146
146
  var MOBILE_COLS = 60;
147
147
  var fontSize = isMobile ? 11 : 13;
148
- var currentMode = 'claude';
148
+ var currentMode = 'opencode';
149
149
  var isTransitioning = false;
150
150
 
151
151
  var term = new Terminal({
@@ -369,13 +369,11 @@
369
369
  function startTransition() {
370
370
  isTransitioning = true;
371
371
  terminalEl.classList.add('transitioning');
372
- modeIndicator.textContent = '切换中...';
373
372
  }
374
373
 
375
374
  function endTransition(mode) {
376
375
  currentMode = mode;
377
376
  modeSelect.value = mode;
378
- modeIndicator.textContent = mode === 'claude' ? 'Claude' : 'OpenCode';
379
377
  terminalEl.classList.remove('transitioning');
380
378
  isTransitioning = false;
381
379
  }
@@ -390,6 +388,9 @@
390
388
  switchMode(modeSelect.value);
391
389
  });
392
390
 
391
+ // 设置初始选中项
392
+ modeSelect.value = currentMode;
393
+
393
394
  function connect() {
394
395
  var proto = location.protocol === 'https:' ? 'wss:' : 'ws:';
395
396
  ws = new WebSocket(proto + '//' + location.host + '/ws');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-opencode-viewer",
3
- "version": "2.1.8",
3
+ "version": "2.2.0",
4
4
  "description": "A unified terminal viewer for Claude Code and OpenCode with seamless switching",
5
5
  "type": "module",
6
6
  "main": "server.js",
package/server.js CHANGED
@@ -20,7 +20,6 @@ let ptyModule = null;
20
20
  let claudeProcess = null;
21
21
  let opencodeProcess = null;
22
22
  let currentProcess = null;
23
- let currentMode = 'claude';
24
23
  let outputBuffer = '';
25
24
  const dataListeners = [];
26
25
  const exitListeners = [];
@@ -30,6 +29,7 @@ let lastPtyRows = 30;
30
29
  let activeWs = null;
31
30
  const clientSizes = new Map();
32
31
  const mobileClients = new Set();
32
+ let currentMode = 'opencode';
33
33
 
34
34
  function getMobileSize() {
35
35
  for (const mws of mobileClients) {
@@ -334,5 +334,5 @@ server.listen(PORT, '0.0.0.0', async () => {
334
334
  console.log('='.repeat(50));
335
335
  console.log('\n按 Ctrl+C 停止服务\n');
336
336
 
337
- await spawnProcess('claude');
337
+ await spawnProcess('opencode');
338
338
  });