claude-remote-cli 3.0.6 → 3.1.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.
@@ -60,6 +60,7 @@ describe('sessions', () => {
60
60
  assert.ok(session, 'should return the session');
61
61
  assert.strictEqual(session.id, result.id);
62
62
  assert.strictEqual(session.repoName, 'test-repo');
63
+ assert.strictEqual(session.mode, 'pty');
63
64
  assert.ok(session.pty, 'get should include the pty object');
64
65
  });
65
66
  it('get returns undefined for nonexistent id', () => {
@@ -100,8 +101,10 @@ describe('sessions', () => {
100
101
  createdIds.push(result.id);
101
102
  const session = sessions.get(result.id);
102
103
  assert.ok(session);
104
+ assert.strictEqual(session.mode, 'pty');
105
+ const ptySession = session;
103
106
  let output = '';
104
- session.pty.onData((data) => {
107
+ ptySession.pty.onData((data) => {
105
108
  output += data;
106
109
  if (output.includes('hello')) {
107
110
  done();
@@ -388,9 +391,11 @@ describe('sessions', () => {
388
391
  createdIds.push(result.id);
389
392
  const session = sessions.get(result.id);
390
393
  assert.ok(session);
391
- session.onPtyReplacedCallbacks.push((newPty) => {
394
+ assert.strictEqual(session.mode, 'pty');
395
+ const ptySession = session;
396
+ ptySession.onPtyReplacedCallbacks.push((newPty) => {
392
397
  assert.ok(newPty, 'should receive new PTY');
393
- assert.strictEqual(session.pty, newPty, 'session.pty should be updated to new PTY');
398
+ assert.strictEqual(ptySession.pty, newPty, 'session.pty should be updated to new PTY');
394
399
  done();
395
400
  });
396
401
  });
@@ -404,7 +409,9 @@ describe('sessions', () => {
404
409
  createdIds.push(result.id);
405
410
  const session = sessions.get(result.id);
406
411
  assert.ok(session);
407
- session.onPtyReplacedCallbacks.push(() => {
412
+ assert.strictEqual(session.mode, 'pty');
413
+ const ptySession = session;
414
+ ptySession.onPtyReplacedCallbacks.push(() => {
408
415
  const stillExists = sessions.get(result.id);
409
416
  assert.ok(stillExists, 'session should still exist after retry');
410
417
  done();
@@ -420,9 +427,11 @@ describe('sessions', () => {
420
427
  createdIds.push(result.id);
421
428
  const session = sessions.get(result.id);
422
429
  assert.ok(session);
423
- session.onPtyReplacedCallbacks.push((newPty) => {
430
+ assert.strictEqual(session.mode, 'pty');
431
+ const ptySession = session;
432
+ ptySession.onPtyReplacedCallbacks.push((newPty) => {
424
433
  assert.ok(newPty, 'should receive new PTY even with exit code 0');
425
- assert.strictEqual(session.pty, newPty, 'session.pty should be updated');
434
+ assert.strictEqual(ptySession.pty, newPty, 'session.pty should be updated');
426
435
  const stillExists = sessions.get(result.id);
427
436
  assert.ok(stillExists, 'session should still exist after retry');
428
437
  done();
@@ -452,6 +461,7 @@ describe('sessions', () => {
452
461
  createdIds.push(result.id);
453
462
  const session = sessions.get(result.id);
454
463
  assert.ok(session);
464
+ assert.strictEqual(session.mode, 'pty');
455
465
  assert.ok(session.scrollback.length >= 1);
456
466
  assert.strictEqual(session.scrollback[0], 'prior output\r\n');
457
467
  });
@@ -489,6 +499,7 @@ describe('session persistence', () => {
489
499
  // Manually push some scrollback
490
500
  const session = sessions.get(s.id);
491
501
  assert.ok(session);
502
+ assert.strictEqual(session.mode, 'pty');
492
503
  session.scrollback.push('hello world');
493
504
  serializeAll(configDir);
494
505
  // Check pending-sessions.json
@@ -519,6 +530,7 @@ describe('session persistence', () => {
519
530
  const originalId = s.id;
520
531
  const session = sessions.get(originalId);
521
532
  assert.ok(session);
533
+ assert.strictEqual(session.mode, 'pty');
522
534
  session.scrollback.push('saved output');
523
535
  serializeAll(configDir);
524
536
  // Kill the original session
@@ -533,6 +545,7 @@ describe('session persistence', () => {
533
545
  assert.strictEqual(restoredSession.repoPath, '/tmp');
534
546
  assert.strictEqual(restoredSession.displayName, 'my-session');
535
547
  // Scrollback should be restored
548
+ assert.strictEqual(restoredSession.mode, 'pty');
536
549
  assert.ok(restoredSession.scrollback.length >= 1);
537
550
  assert.strictEqual(restoredSession.scrollback[0], 'saved output');
538
551
  // pending-sessions.json should be cleaned up
@@ -597,7 +610,7 @@ describe('session persistence', () => {
597
610
  lastActivity: new Date().toISOString(),
598
611
  useTmux: true,
599
612
  tmuxSessionName: 'crc-my-session-tmux-tes',
600
- customCommand: null,
613
+ customCommand: '/bin/cat', // Use /bin/cat to avoid spawning real claude binary in test
601
614
  cwd: '/tmp',
602
615
  }],
603
616
  };
@@ -606,6 +619,7 @@ describe('session persistence', () => {
606
619
  assert.strictEqual(restored, 1);
607
620
  const session = sessions.get('tmux-test-id');
608
621
  assert.ok(session, 'restored session should exist');
622
+ assert.strictEqual(session.mode, 'pty');
609
623
  assert.strictEqual(session.tmuxSessionName, 'crc-my-session-tmux-tes', 'tmuxSessionName should be preserved from serialized data');
610
624
  });
611
625
  it('restored session remains in list after PTY exits (disconnected status)', async () => {
@@ -705,6 +719,7 @@ describe('session persistence', () => {
705
719
  // Verify tmux session name survived the round trip
706
720
  const restoredTmux = sessions.get('tmux-roundtrip-id');
707
721
  assert.ok(restoredTmux);
722
+ assert.strictEqual(restoredTmux.mode, 'pty');
708
723
  assert.strictEqual(restoredTmux.tmuxSessionName, 'crc-tmux-session-tmux-rou');
709
724
  assert.strictEqual(restoredTmux.displayName, 'Tmux Session');
710
725
  });
@@ -719,6 +734,7 @@ describe('session persistence', () => {
719
734
  });
720
735
  const session = sessions.get(s.id);
721
736
  assert.ok(session);
737
+ assert.strictEqual(session.mode, 'pty');
722
738
  session.scrollback.push('important output');
723
739
  serializeAll(configDir);
724
740
  // Kill after serialize (mimics gracefulShutdown sequence)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-remote-cli",
3
- "version": "3.0.6",
3
+ "version": "3.1.0",
4
4
  "description": "Remote web interface for Claude Code CLI sessions",
5
5
  "type": "module",
6
6
  "main": "dist/server/index.js",
@@ -42,6 +42,7 @@
42
42
  "license": "MIT",
43
43
  "author": "Donovan Yohan",
44
44
  "dependencies": {
45
+ "@anthropic-ai/claude-agent-sdk": "^0.2.77",
45
46
  "@tanstack/svelte-query": "^6.0.18",
46
47
  "@xterm/addon-fit": "^0.11.0",
47
48
  "@xterm/xterm": "^6.0.0",