centaurus-cli 2.9.4 → 2.9.5

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 (54) hide show
  1. package/dist/cli-adapter.d.ts +2 -2
  2. package/dist/cli-adapter.d.ts.map +1 -1
  3. package/dist/cli-adapter.js +299 -111
  4. package/dist/cli-adapter.js.map +1 -1
  5. package/dist/context/context-manager.d.ts +6 -0
  6. package/dist/context/context-manager.d.ts.map +1 -1
  7. package/dist/context/context-manager.js +11 -0
  8. package/dist/context/context-manager.js.map +1 -1
  9. package/dist/context/handlers/docker-handler.d.ts +2 -0
  10. package/dist/context/handlers/docker-handler.d.ts.map +1 -1
  11. package/dist/context/handlers/docker-handler.js +63 -7
  12. package/dist/context/handlers/docker-handler.js.map +1 -1
  13. package/dist/index.js.map +1 -1
  14. package/dist/services/local-chat-storage.d.ts +3 -1
  15. package/dist/services/local-chat-storage.d.ts.map +1 -1
  16. package/dist/services/local-chat-storage.js +8 -3
  17. package/dist/services/local-chat-storage.js.map +1 -1
  18. package/dist/tools/command.d.ts.map +1 -1
  19. package/dist/tools/command.js +92 -38
  20. package/dist/tools/command.js.map +1 -1
  21. package/dist/tools/grep-search.d.ts +1 -1
  22. package/dist/tools/grep-search.d.ts.map +1 -1
  23. package/dist/tools/grep-search.js +80 -1
  24. package/dist/tools/grep-search.js.map +1 -1
  25. package/dist/ui/components/App.d.ts.map +1 -1
  26. package/dist/ui/components/App.js +18 -4
  27. package/dist/ui/components/App.js.map +1 -1
  28. package/dist/ui/components/Breadcrumbs.d.ts.map +1 -1
  29. package/dist/ui/components/Breadcrumbs.js +22 -2
  30. package/dist/ui/components/Breadcrumbs.js.map +1 -1
  31. package/dist/ui/components/InputBox.d.ts.map +1 -1
  32. package/dist/ui/components/InputBox.js +58 -17
  33. package/dist/ui/components/InputBox.js.map +1 -1
  34. package/dist/ui/components/InteractiveShell.d.ts +2 -0
  35. package/dist/ui/components/InteractiveShell.d.ts.map +1 -1
  36. package/dist/ui/components/InteractiveShell.js +42 -15
  37. package/dist/ui/components/InteractiveShell.js.map +1 -1
  38. package/dist/ui/components/KeyboardHelp.d.ts.map +1 -1
  39. package/dist/ui/components/KeyboardHelp.js +14 -6
  40. package/dist/ui/components/KeyboardHelp.js.map +1 -1
  41. package/dist/ui/components/ToolExecutionMessage.js +1 -2
  42. package/dist/ui/components/ToolExecutionMessage.js.map +1 -1
  43. package/dist/utils/ansi-encoder.d.ts.map +1 -1
  44. package/dist/utils/ansi-encoder.js +7 -0
  45. package/dist/utils/ansi-encoder.js.map +1 -1
  46. package/dist/utils/editor-utils.d.ts +9 -0
  47. package/dist/utils/editor-utils.d.ts.map +1 -1
  48. package/dist/utils/editor-utils.js +105 -0
  49. package/dist/utils/editor-utils.js.map +1 -1
  50. package/dist/utils/terminal-output.d.ts +3 -1
  51. package/dist/utils/terminal-output.d.ts.map +1 -1
  52. package/dist/utils/terminal-output.js +138 -157
  53. package/dist/utils/terminal-output.js.map +1 -1
  54. package/package.json +1 -1
@@ -54,7 +54,7 @@ export declare class CentaurusCLI {
54
54
  private onRestoreMessagesCallback?;
55
55
  private uiMessageHistory;
56
56
  private cwdStack;
57
- private lastConnectionCommand;
57
+ private connectionCommandStack;
58
58
  private onBackgroundModeChange?;
59
59
  private onBackgroundTaskCountChange?;
60
60
  private onSetAutoMode?;
@@ -125,7 +125,7 @@ export declare class CentaurusCLI {
125
125
  setOnModelChange(callback: (modelName: string, contextWindow: number) => void): void;
126
126
  setOnSubshellContextChange(callback: (context: SubshellContext, stack?: SubshellContext[]) => void): void;
127
127
  setOnPasswordRequest(callback: (message: string) => Promise<string>): void;
128
- setOnInteractiveEditorMode(callback: (active: boolean, command?: string, cwd?: string, remoteContext?: SubshellContext) => void): void;
128
+ setOnInteractiveEditorMode(callback: (active: boolean, command?: string, cwd?: string, remoteContext?: SubshellContext, parentContext?: SubshellContext) => void): void;
129
129
  setOnConnectionStatusUpdate(callback: (status: {
130
130
  type: 'ssh' | 'wsl' | 'docker';
131
131
  status: 'connecting' | 'connected' | 'error';
@@ -1 +1 @@
1
- {"version":3,"file":"cli-adapter.d.ts","sourceRoot":"","sources":["../src/cli-adapter.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAY/C,OAAO,EAA6L,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAajP,OAAO,EAAmB,OAAO,IAAI,SAAS,EAAe,MAAM,iCAAiC,CAAC;AAQrG,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAQrD,OAAO,EAAmC,aAAa,EAAwC,MAAM,kCAAkC,CAAC;AACxI,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAyB,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAIlG,OAAO,EAAE,QAAQ,EAAwC,MAAM,qBAAqB,CAAC;AAErF,qBAAa,YAAY;IACvB,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,mBAAmB,CAAmB;IAC9C,OAAO,CAAC,GAAG,CAAS;IACpB,OAAO,CAAC,QAAQ,CAAkB;IAClC,OAAO,CAAC,kBAAkB,CAAuB;IACjD,OAAO,CAAC,WAAW,CAAkB;IACrC,OAAO,CAAC,cAAc,CAAkB;IACxC,OAAO,CAAC,cAAc,CAAa;IACnC,OAAO,CAAC,YAAY,CAAyC;IAC7D,OAAO,CAAC,kBAAkB,CAAC,CAA4B;IACvD,OAAO,CAAC,uBAAuB,CAAC,CAA4B;IAC5D,OAAO,CAAC,wBAAwB,CAAC,CAA0B;IAC3D,OAAO,CAAC,uBAAuB,CAAC,CAAa;IAC7C,OAAO,CAAC,uBAAuB,CAAC,CAA4B;IAC5D,OAAO,CAAC,yBAAyB,CAAC,CAAoC;IACtE,OAAO,CAAC,mBAAmB,CAAC,CAAiC;IAC7D,OAAO,CAAC,WAAW,CAAC,CAAwB;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,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAkN9D;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAa7B;;OAEG;IACH,gBAAgB,IAAI,MAAM,GAAG,IAAI;IAIjC;;OAEG;IACH,YAAY,IAAI,IAAI;IAsBpB;;;;;;OAMG;IACH,sBAAsB,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,IAAI;IAmBjD;;OAEG;IACH,4BAA4B,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,IAAI,GAAG,IAAI;IAM3E;;;OAGG;IACH,OAAO,CAAC,qBAAqB;IAe7B;;;OAGG;IACH,OAAO,CAAC,OAAO;IAMf,OAAO,CAAC,uBAAuB;IAsC/B;;OAEG;IACH,iBAAiB,IAAI,IAAI;IA+BzB;;;OAGG;IACH,4BAA4B,CAAC,OAAO,EAAE,UAAU,CAAC,kBAAkB,GAAG,SAAS,GAAG,IAAI;IAItF;;OAEG;YACW,0BAA0B;CAsfzC"}
@@ -94,7 +94,7 @@ export class CentaurusCLI {
94
94
  onRestoreMessagesCallback;
95
95
  uiMessageHistory = []; // Mirror of App.tsx's messageHistory for saving
96
96
  cwdStack = []; // Stack of CWDs for nested sessions (pushed when entering, popped when exiting)
97
- lastConnectionCommand = null; // Track the command used to connect to remote
97
+ connectionCommandStack = []; // Stack of commands used to connect (for nested sessions like SSH>SSH, SSH>Docker)
98
98
  onBackgroundModeChange;
99
99
  onBackgroundTaskCountChange;
100
100
  onSetAutoMode;
@@ -397,7 +397,7 @@ Begin executing now, starting with Step 1.`;
397
397
  const initialCwd = type === 'ssh' ? undefined : this.cwd;
398
398
  context = await detection.handler.connect(command, initialCwd);
399
399
  }
400
- this.lastConnectionCommand = command;
400
+ this.connectionCommandStack.push(command);
401
401
  this.contextManager.pushContext(context);
402
402
  // Explicitly sync this.cwd with the new context's CWD to ensure consistency immediately
403
403
  if (context.metadata.workingDirectory) {
@@ -481,7 +481,7 @@ Begin executing now, starting with Step 1.`;
481
481
  }
482
482
  this.contextManager.updateWorkingDirectory(this.cwd);
483
483
  if (newContext.type === 'local') {
484
- this.lastConnectionCommand = null;
484
+ this.connectionCommandStack.pop();
485
485
  }
486
486
  // Notify CWD change
487
487
  if (this.onCwdChange) {
@@ -530,7 +530,7 @@ Begin executing now, starting with Step 1.`;
530
530
  }
531
531
  this.contextManager.updateWorkingDirectory(this.cwd);
532
532
  if (currentContext.type === 'local') {
533
- this.lastConnectionCommand = null;
533
+ this.connectionCommandStack.pop();
534
534
  }
535
535
  // Notify CWD change
536
536
  if (this.onCwdChange) {
@@ -3769,12 +3769,32 @@ Create once, run many times across different machines.`;
3769
3769
  }
3770
3770
  return;
3771
3771
  }
3772
+ // Check if Docker is nested inside SSH
3773
+ const parentContext = this.contextManager.getParentContext();
3772
3774
  // Start remote task first to get callbacks
3773
3775
  const remoteTask = BackgroundTaskManager.startRemoteTask(command, effectiveCwd, remoteContextDisplay || 'docker');
3774
3776
  taskId = remoteTask.id;
3775
- // Create Docker PTY with the callbacks from BackgroundTaskManager
3776
- const dockerPty = runDockerCommand(containerId, command, effectiveCwd, remoteTask.onData, remoteTask.onExit);
3777
- remoteTask.setRemotePty(dockerPty);
3777
+ if (parentContext && parentContext.type === 'ssh') {
3778
+ // Nested Docker inside SSH: route docker exec command through SSH
3779
+ const sshClient = parentContext.handler?.client;
3780
+ if (!sshClient) {
3781
+ if (this.onResponseCallback) {
3782
+ this.onResponseCallback('❌ SSH client not available for nested Docker background task');
3783
+ }
3784
+ return;
3785
+ }
3786
+ // Build docker exec command to run via SSH
3787
+ const escapedCommand = command.replace(/"/g, '\\"');
3788
+ const dockerCommand = `docker exec -w "${effectiveCwd}" ${containerId} sh -c "${escapedCommand}"`;
3789
+ // Create SSH PTY to run the docker command
3790
+ const sshPty = runSSHCommand(sshClient, dockerCommand, parentContext.metadata.workingDirectory || '~', remoteTask.onData, remoteTask.onExit);
3791
+ remoteTask.setRemotePty(sshPty);
3792
+ }
3793
+ else {
3794
+ // Local Docker: use standard runDockerCommand
3795
+ const dockerPty = runDockerCommand(containerId, command, effectiveCwd, remoteTask.onData, remoteTask.onExit);
3796
+ remoteTask.setRemotePty(dockerPty);
3797
+ }
3778
3798
  }
3779
3799
  else {
3780
3800
  // Unknown remote type - fall back to local
@@ -3860,28 +3880,57 @@ Create once, run many times across different machines.`;
3860
3880
  // Capture remote context if in remote environment (SSH/WSL/Docker)
3861
3881
  // Use null to explicitly clear remote context when not in remote (so resuming won't reconnect)
3862
3882
  let remoteContext = null;
3883
+ let remoteContextStack = null;
3863
3884
  const currentContext = this.contextManager.getCurrentContext();
3864
- if (currentContext.type !== 'local' && this.lastConnectionCommand) {
3865
- remoteContext = {
3866
- type: currentContext.type,
3867
- connectionCommand: this.lastConnectionCommand,
3868
- remoteCwd: currentContext.metadata.workingDirectory,
3869
- localCwdBeforeRemote: this.cwdStack.length > 0 ? this.cwdStack[0] : process.cwd(),
3870
- metadata: {
3871
- hostname: currentContext.metadata.hostname,
3872
- username: currentContext.metadata.username,
3873
- distroName: currentContext.metadata.distroName,
3874
- containerId: currentContext.metadata.containerId,
3875
- port: currentContext.metadata.port,
3885
+ // Build remoteContextStack for nested sessions
3886
+ if (currentContext.type !== 'local' && this.connectionCommandStack.length > 0) {
3887
+ remoteContextStack = [];
3888
+ // Build stack of contexts from the connectionCommandStack and cwdStack
3889
+ // cwdStack[0] = local CWD before first remote
3890
+ // cwdStack[1] = first remote CWD before second remote (if nested)
3891
+ // connectionCommandStack[0] = first connection command
3892
+ // connectionCommandStack[1] = second connection command (if nested)
3893
+ for (let i = 0; i < this.connectionCommandStack.length; i++) {
3894
+ const connCmd = this.connectionCommandStack[i];
3895
+ // Detect the type from the command
3896
+ let ctxType = 'ssh';
3897
+ if (connCmd.startsWith('docker ') || connCmd.startsWith('docker-compose ')) {
3898
+ ctxType = 'docker';
3876
3899
  }
3877
- };
3900
+ else if (connCmd.startsWith('wsl')) {
3901
+ ctxType = 'wsl';
3902
+ }
3903
+ // Get the CWD before this remote connection
3904
+ const cwdBefore = i < this.cwdStack.length ? this.cwdStack[i] : process.cwd();
3905
+ // For the last (current) context, use the actual metadata
3906
+ const isLastContext = i === this.connectionCommandStack.length - 1;
3907
+ const remoteCwd = isLastContext ? currentContext.metadata.workingDirectory : (this.cwdStack[i + 1] || '~');
3908
+ const storedCtx = {
3909
+ type: ctxType,
3910
+ connectionCommand: connCmd,
3911
+ remoteCwd: remoteCwd,
3912
+ localCwdBeforeRemote: cwdBefore,
3913
+ metadata: isLastContext ? {
3914
+ hostname: currentContext.metadata.hostname,
3915
+ username: currentContext.metadata.username,
3916
+ distroName: currentContext.metadata.distroName,
3917
+ containerId: currentContext.metadata.containerId,
3918
+ port: currentContext.metadata.port,
3919
+ } : {}
3920
+ };
3921
+ remoteContextStack.push(storedCtx);
3922
+ }
3923
+ // For backward compatibility, also set remoteContext to the last (current) context
3924
+ if (remoteContextStack.length > 0) {
3925
+ remoteContext = remoteContextStack[remoteContextStack.length - 1];
3926
+ }
3878
3927
  }
3879
3928
  // Determine the local CWD to save (use base of cwdStack if in remote, otherwise current cwd)
3880
3929
  const cwdToSave = currentContext.type !== 'local' && this.cwdStack.length > 0
3881
3930
  ? this.cwdStack[0]
3882
3931
  : this.cwd;
3883
3932
  try {
3884
- localChatStorage.saveChat(this.currentChatId, storedMessages, storedUIMessages, cwdToSave, remoteContext);
3933
+ localChatStorage.saveChat(this.currentChatId, storedMessages, storedUIMessages, cwdToSave, remoteContext, remoteContextStack);
3885
3934
  // Also store the backend conversation ID (UUID) for file deletion
3886
3935
  // This is the ID used for GCS file storage, not the local chat ID
3887
3936
  const backendId = conversationManager.getCurrentConversationId();
@@ -3970,7 +4019,7 @@ Create once, run many times across different machines.`;
3970
4019
  this.contextManager.popContext();
3971
4020
  // Clear remote context tracking
3972
4021
  this.cwdStack = [];
3973
- this.lastConnectionCommand = null;
4022
+ this.connectionCommandStack = [];
3974
4023
  }
3975
4024
  // Load AI context
3976
4025
  this.loadChat(chatId);
@@ -3995,28 +4044,64 @@ Create once, run many times across different machines.`;
3995
4044
  this.onRestoreMessagesCallback(restoredMessages);
3996
4045
  }
3997
4046
  // Attempt to restore remote context if chat was saved while in remote environment
3998
- if (chat.remoteContext) {
3999
- const { type, connectionCommand, remoteCwd, localCwdBeforeRemote } = chat.remoteContext;
4000
- // Store local CWD for when user exits remote (as base of stack)
4001
- this.cwdStack = [localCwdBeforeRemote];
4002
- this.lastConnectionCommand = connectionCommand;
4003
- // Show reconnection notification
4047
+ // Support both remoteContextStack (for nested sessions) and single remoteContext (backward compat)
4048
+ const contextStackToRestore = chat.remoteContextStack ?? (chat.remoteContext ? [chat.remoteContext] : null);
4049
+ if (contextStackToRestore && contextStackToRestore.length > 0) {
4050
+ // Get the base local CWD from the first context's localCwdBeforeRemote
4051
+ const baseLocalCwd = contextStackToRestore[0].localCwdBeforeRemote;
4052
+ // Initialize stacks
4053
+ this.cwdStack = [baseLocalCwd];
4054
+ this.connectionCommandStack = [];
4055
+ // Show initial reconnection notification
4056
+ const nestingInfo = contextStackToRestore.length > 1
4057
+ ? ` (${contextStackToRestore.length} levels: ${contextStackToRestore.map(c => c.type).join(' > ')})`
4058
+ : '';
4004
4059
  if (this.onDirectMessageCallback) {
4005
- this.onDirectMessageCallback(`🔄 Reconnecting to ${type.toUpperCase()} session...`);
4006
- }
4007
- // Show connecting status
4008
- if (this.onConnectionStatusUpdate) {
4009
- this.onConnectionStatusUpdate({
4010
- type: type,
4011
- status: 'connecting',
4012
- connectionString: this.buildConnectionString(type, chat.remoteContext.metadata)
4013
- });
4060
+ this.onDirectMessageCallback(`🔄 Reconnecting to session${nestingInfo}...`);
4014
4061
  }
4015
- try {
4016
- // Detect and connect using the saved command
4017
- const detection = this.commandDetector.detect(connectionCommand);
4018
- if (detection) {
4019
- const context = await detection.handler.connect(connectionCommand, localCwdBeforeRemote);
4062
+ // Sequential reconnection through the stack
4063
+ let previousCwd = baseLocalCwd;
4064
+ for (let i = 0; i < contextStackToRestore.length; i++) {
4065
+ const remoteCtx = contextStackToRestore[i];
4066
+ const { type, connectionCommand, remoteCwd } = remoteCtx;
4067
+ const levelInfo = contextStackToRestore.length > 1 ? ` [${i + 1}/${contextStackToRestore.length}]` : '';
4068
+ // Show connecting status for this level
4069
+ if (this.onDirectMessageCallback) {
4070
+ this.onDirectMessageCallback(`🔄${levelInfo} Connecting to ${type.toUpperCase()}...`);
4071
+ }
4072
+ if (this.onConnectionStatusUpdate) {
4073
+ this.onConnectionStatusUpdate({
4074
+ type: type,
4075
+ status: 'connecting',
4076
+ connectionString: this.buildConnectionString(type, remoteCtx.metadata)
4077
+ });
4078
+ }
4079
+ try {
4080
+ // Detect and connect using the saved command
4081
+ const detection = this.commandDetector.detect(connectionCommand);
4082
+ if (!detection) {
4083
+ throw new Error(`Could not detect handler for: ${connectionCommand}`);
4084
+ }
4085
+ let context;
4086
+ // Check if this is a nested connection (i > 0 means we're inside a remote session)
4087
+ if (i > 0) {
4088
+ const currentContext = this.contextManager.getCurrentContext();
4089
+ if (detection.handler.connectFromRemote) {
4090
+ context = await detection.handler.connectFromRemote(connectionCommand, previousCwd, currentContext);
4091
+ }
4092
+ else {
4093
+ throw new Error(`Nested connections not supported by ${type} handler`);
4094
+ }
4095
+ }
4096
+ else {
4097
+ // First level: connect from local
4098
+ context = await detection.handler.connect(connectionCommand, previousCwd);
4099
+ }
4100
+ // Push to stacks
4101
+ this.connectionCommandStack.push(connectionCommand);
4102
+ if (i > 0) {
4103
+ this.cwdStack.push(previousCwd); // Save the previous remote CWD for nested exits
4104
+ }
4020
4105
  this.contextManager.pushContext(context);
4021
4106
  // Navigate to saved remote CWD
4022
4107
  if (remoteCwd && remoteCwd !== context.metadata.workingDirectory) {
@@ -4026,38 +4111,61 @@ Create once, run many times across different machines.`;
4026
4111
  catch (cdError) {
4027
4112
  // Failed to cd to saved path - warn but continue
4028
4113
  if (this.onDirectMessageCallback) {
4029
- this.onDirectMessageCallback(`⚠️ Could not restore remote directory: ${remoteCwd}`);
4114
+ this.onDirectMessageCallback(`⚠️ Could not restore ${type} directory: ${remoteCwd}`);
4030
4115
  }
4031
4116
  }
4032
4117
  }
4033
- // Show success
4118
+ // Update previousCwd for next iteration
4119
+ previousCwd = this.contextManager.getCurrentContext().metadata.workingDirectory;
4120
+ // Show success for this level
4034
4121
  if (this.onConnectionStatusUpdate) {
4035
4122
  this.onConnectionStatusUpdate({
4036
4123
  type: type,
4037
4124
  status: 'connected',
4038
- connectionString: this.buildConnectionString(type, chat.remoteContext.metadata)
4125
+ connectionString: this.buildConnectionString(type, remoteCtx.metadata)
4039
4126
  });
4040
4127
  }
4128
+ }
4129
+ catch (error) {
4130
+ // Connection failed at this level - fall back to local mode
4131
+ // If we partially connected, disconnect all and reset
4132
+ while (this.contextManager.getCurrentContext().type !== 'local') {
4133
+ const ctx = this.contextManager.getCurrentContext();
4134
+ if (ctx.handler) {
4135
+ try {
4136
+ await ctx.handler.disconnect();
4137
+ }
4138
+ catch (e) { /* ignore */ }
4139
+ }
4140
+ this.contextManager.popContext();
4141
+ }
4142
+ this.cwdStack = [];
4143
+ this.connectionCommandStack = [];
4144
+ if (this.onConnectionStatusUpdate) {
4145
+ this.onConnectionStatusUpdate({
4146
+ type: type,
4147
+ status: 'error',
4148
+ connectionString: this.buildConnectionString(type, remoteCtx.metadata),
4149
+ error: error.message
4150
+ });
4151
+ }
4152
+ const failedAt = contextStackToRestore.length > 1 ? ` at level ${i + 1} (${type})` : '';
4153
+ if (this.onDirectMessageCallback) {
4154
+ this.onDirectMessageCallback(`⚠️ Loaded chat: "${chat.title}"\n\n❌ Could not reconnect${failedAt}: ${error.message}\n\n📁 Restored to local directory: ${baseLocalCwd}`);
4155
+ }
4041
4156
  return;
4042
4157
  }
4043
4158
  }
4044
- catch (error) {
4045
- // Connection failed - fall back to local mode
4046
- this.cwdStack = [];
4047
- this.lastConnectionCommand = null;
4048
- if (this.onConnectionStatusUpdate) {
4049
- this.onConnectionStatusUpdate({
4050
- type: type,
4051
- status: 'error',
4052
- connectionString: this.buildConnectionString(type, chat.remoteContext.metadata),
4053
- error: error.message
4054
- });
4055
- }
4056
- if (this.onDirectMessageCallback) {
4057
- this.onDirectMessageCallback(`⚠️ Loaded chat: "${chat.title}"\n\n❌ Could not reconnect to ${type.toUpperCase()}: ${error.message}\n\n📁 Restored to local directory: ${localCwdBeforeRemote}`);
4159
+ // All levels connected successfully
4160
+ if (this.onDirectMessageCallback) {
4161
+ const successInfo = contextStackToRestore.length > 1
4162
+ ? `🔗 Reconnected through ${contextStackToRestore.length} levels`
4163
+ : '';
4164
+ if (successInfo) {
4165
+ this.onDirectMessageCallback(successInfo);
4058
4166
  }
4059
- return;
4060
4167
  }
4168
+ return;
4061
4169
  }
4062
4170
  // No remote context - show regular confirmation
4063
4171
  // No remote context - show regular confirmation and restore CWD
@@ -4107,7 +4215,7 @@ Create once, run many times across different machines.`;
4107
4215
  this.conversationStarted = false;
4108
4216
  this.uiMessageHistory = [];
4109
4217
  this.cwdStack = [];
4110
- this.lastConnectionCommand = null;
4218
+ this.connectionCommandStack = [];
4111
4219
  // Reset context limit state
4112
4220
  if (this.contextLimitReached) {
4113
4221
  this.contextLimitReached = false;
@@ -4270,7 +4378,8 @@ Once the user approves the plan:
4270
4378
  // Remote context (SSH, WSL, Docker) - pass remote context to App
4271
4379
  // Use the remote context's working directory, not the local Windows CWD
4272
4380
  const remoteCwd = currentContextForEditor.metadata?.workingDirectory || '~';
4273
- this.onInteractiveEditorMode(true, command, remoteCwd, currentContextForEditor);
4381
+ const parentContext = this.contextManager.getParentContext() || undefined; // Convert null to undefined
4382
+ this.onInteractiveEditorMode(true, command, remoteCwd, currentContextForEditor, parentContext);
4274
4383
  }
4275
4384
  return;
4276
4385
  }
@@ -4307,7 +4416,7 @@ Once the user approves the plan:
4307
4416
  }
4308
4417
  if (newContext.type === 'local') {
4309
4418
  // Clear tracking when back to local
4310
- this.lastConnectionCommand = null;
4419
+ this.connectionCommandStack.pop();
4311
4420
  }
4312
4421
  // Save chat - include remote context info if still in remote
4313
4422
  this.saveCurrentChat();
@@ -4331,12 +4440,18 @@ Once the user approves the plan:
4331
4440
  }
4332
4441
  */
4333
4442
  // Special handling for cd command - change the actual working directory
4334
- const cdMatch = command.match(/^cd\s+(.+)$/);
4443
+ // Check for chained commands: cd path && cmd or cd path ; cmd
4444
+ const chainedCdMatch = command.match(/^cd\s+([^;&]+?)\s*(&&|;)\s*(.+)$/);
4445
+ const simpleCdMatch = command.match(/^cd\s+(.+)$/);
4446
+ // Determine if this starts with cd
4447
+ const cdMatch = chainedCdMatch || simpleCdMatch;
4335
4448
  if (cdMatch) {
4336
4449
  const currentContext = this.contextManager.getCurrentContext();
4450
+ const targetDir = (chainedCdMatch ? chainedCdMatch[1] : cdMatch[1]).trim();
4451
+ const hasChainedCommand = !!chainedCdMatch;
4452
+ const chainedCommand = chainedCdMatch ? chainedCdMatch[3] : null;
4337
4453
  if (currentContext.type === 'local') {
4338
4454
  // Local cd handling
4339
- const targetDir = cdMatch[1].trim();
4340
4455
  const newCwd = path.resolve(this.cwd, targetDir);
4341
4456
  if (!fs.existsSync(newCwd)) {
4342
4457
  if (this.onResponseCallback) {
@@ -4350,19 +4465,31 @@ Once the user approves the plan:
4350
4465
  }
4351
4466
  return;
4352
4467
  }
4468
+ this.cwd = newCwd;
4353
4469
  this.contextManager.updateWorkingDirectory(newCwd);
4354
4470
  if (this.onResponseCallback) {
4355
4471
  this.onResponseCallback(`Changed directory to: ${newCwd}`);
4356
4472
  }
4473
+ // If there's a chained command, execute it in the new directory
4474
+ if (hasChainedCommand && chainedCommand) {
4475
+ // Recursively handle the next command
4476
+ await this.handleCommandModeExecution(chainedCommand);
4477
+ }
4357
4478
  return;
4358
4479
  }
4359
4480
  else {
4360
- // Subshell cd handling - execute via handler
4361
- const result = await this.contextManager.executeCommand(command);
4481
+ // Subshell cd handling - execute just the cd command via handler
4482
+ const cdOnlyCommand = `cd ${targetDir}`;
4483
+ const result = await this.contextManager.executeCommand(cdOnlyCommand);
4362
4484
  if (result.exitCode === 0) {
4363
4485
  if (this.onResponseCallback) {
4364
4486
  this.onResponseCallback(`Changed directory to: ${currentContext.metadata.workingDirectory}`);
4365
4487
  }
4488
+ // If there's a chained command, execute it in the new directory
4489
+ if (hasChainedCommand && chainedCommand) {
4490
+ // Recursively handle the next command
4491
+ await this.handleCommandModeExecution(chainedCommand);
4492
+ }
4366
4493
  }
4367
4494
  else {
4368
4495
  if (this.onResponseCallback) {
@@ -4492,57 +4619,118 @@ Once the user approves the plan:
4492
4619
  });
4493
4620
  }
4494
4621
  else if (currentContext.type === 'docker') {
4495
- // Docker execution with PTY for proper TTY handling
4622
+ // Docker execution - check if nested inside SSH
4623
+ const parentContext = this.contextManager.getParentContext();
4496
4624
  const remoteCwd = currentContext.metadata?.workingDirectory || '~';
4497
4625
  const containerId = currentContext.metadata?.containerId || '';
4498
4626
  let output = '';
4499
- await new Promise((resolve) => {
4500
- const dockerPty = runDockerCommand(containerId, command, remoteCwd, (data) => {
4501
- // Stream output to UI
4502
- output += data;
4503
- if (this.onToolStreamingOutput) {
4504
- this.onToolStreamingOutput({ toolName: 'execute_command', chunk: data, type: 'stdout' });
4505
- }
4506
- }, (exitCode) => {
4507
- // Notify UI of completion
4508
- if (this.onToolExecutionUpdate) {
4509
- if (exitCode !== 0) {
4510
- this.onToolExecutionUpdate({
4511
- toolName: 'execute_command',
4512
- status: 'error',
4513
- result: output,
4514
- error: `Exit Code: ${exitCode}`,
4515
- arguments: { command, cwd: remoteCwd, remoteContext }
4516
- });
4627
+ if (parentContext && parentContext.type === 'ssh') {
4628
+ // Nested Docker inside SSH: route docker exec command through SSH
4629
+ const sshClient = parentContext.handler?.client;
4630
+ if (!sshClient) {
4631
+ throw new Error('SSH client not available for nested Docker session');
4632
+ }
4633
+ // Build docker exec command to run via SSH
4634
+ const escapedCommand = command.replace(/"/g, '\\"');
4635
+ const dockerCommand = `docker exec -w "${remoteCwd}" ${containerId} sh -c "${escapedCommand}"`;
4636
+ await new Promise((resolve) => {
4637
+ const sshPty = runSSHCommand(sshClient, dockerCommand, parentContext.metadata.workingDirectory || '~', (data) => {
4638
+ // Stream output to UI
4639
+ output += data;
4640
+ if (this.onToolStreamingOutput) {
4641
+ this.onToolStreamingOutput({ toolName: 'execute_command', chunk: data, type: 'stdout' });
4517
4642
  }
4518
- else {
4519
- this.onToolExecutionUpdate({
4520
- toolName: 'execute_command',
4521
- status: 'completed',
4522
- result: output || 'Command executed successfully',
4523
- arguments: { command, cwd: remoteCwd, remoteContext }
4524
- });
4643
+ }, (exitCode) => {
4644
+ // Notify UI of completion
4645
+ if (this.onToolExecutionUpdate) {
4646
+ if (exitCode !== 0) {
4647
+ this.onToolExecutionUpdate({
4648
+ toolName: 'execute_command',
4649
+ status: 'error',
4650
+ result: output,
4651
+ error: `Exit Code: ${exitCode}`,
4652
+ arguments: { command, cwd: remoteCwd, remoteContext }
4653
+ });
4654
+ }
4655
+ else {
4656
+ this.onToolExecutionUpdate({
4657
+ toolName: 'execute_command',
4658
+ status: 'completed',
4659
+ result: output || 'Command executed successfully',
4660
+ arguments: { command, cwd: remoteCwd, remoteContext }
4661
+ });
4662
+ }
4525
4663
  }
4526
- }
4527
- // Record shell command to AI conversation history
4528
- this.recordShellCommandToHistory(command, output, remoteCwd, exitCode);
4529
- this.currentInteractiveProcess = undefined;
4530
- resolve();
4664
+ // Record shell command to AI conversation history
4665
+ this.recordShellCommandToHistory(command, output, remoteCwd, exitCode);
4666
+ this.currentInteractiveProcess = undefined;
4667
+ resolve();
4668
+ });
4669
+ // Set up interactive process for stdin
4670
+ this.currentInteractiveProcess = {
4671
+ process: null,
4672
+ write: (data) => sshPty.write(data),
4673
+ kill: () => sshPty.kill(),
4674
+ signal: (sig) => {
4675
+ if (sig === 'SIGINT') {
4676
+ sshPty.write('\x03'); // Ctrl+C
4677
+ }
4678
+ },
4679
+ resize: (cols, rows) => sshPty.resize(cols, rows),
4680
+ isPty: true
4681
+ };
4531
4682
  });
4532
- // Set up interactive process for stdin
4533
- this.currentInteractiveProcess = {
4534
- process: null,
4535
- write: (data) => dockerPty.write(data),
4536
- kill: () => dockerPty.kill(),
4537
- signal: (sig) => {
4538
- if (sig === 'SIGINT') {
4539
- dockerPty.write('\x03'); // Ctrl+C
4683
+ }
4684
+ else {
4685
+ // Local Docker: use standard runDockerCommand
4686
+ await new Promise((resolve) => {
4687
+ const dockerPty = runDockerCommand(containerId, command, remoteCwd, (data) => {
4688
+ // Stream output to UI
4689
+ output += data;
4690
+ if (this.onToolStreamingOutput) {
4691
+ this.onToolStreamingOutput({ toolName: 'execute_command', chunk: data, type: 'stdout' });
4540
4692
  }
4541
- },
4542
- resize: (cols, rows) => dockerPty.resize(cols, rows),
4543
- isPty: true
4544
- };
4545
- });
4693
+ }, (exitCode) => {
4694
+ // Notify UI of completion
4695
+ if (this.onToolExecutionUpdate) {
4696
+ if (exitCode !== 0) {
4697
+ this.onToolExecutionUpdate({
4698
+ toolName: 'execute_command',
4699
+ status: 'error',
4700
+ result: output,
4701
+ error: `Exit Code: ${exitCode}`,
4702
+ arguments: { command, cwd: remoteCwd, remoteContext }
4703
+ });
4704
+ }
4705
+ else {
4706
+ this.onToolExecutionUpdate({
4707
+ toolName: 'execute_command',
4708
+ status: 'completed',
4709
+ result: output || 'Command executed successfully',
4710
+ arguments: { command, cwd: remoteCwd, remoteContext }
4711
+ });
4712
+ }
4713
+ }
4714
+ // Record shell command to AI conversation history
4715
+ this.recordShellCommandToHistory(command, output, remoteCwd, exitCode);
4716
+ this.currentInteractiveProcess = undefined;
4717
+ resolve();
4718
+ });
4719
+ // Set up interactive process for stdin
4720
+ this.currentInteractiveProcess = {
4721
+ process: null,
4722
+ write: (data) => dockerPty.write(data),
4723
+ kill: () => dockerPty.kill(),
4724
+ signal: (sig) => {
4725
+ if (sig === 'SIGINT') {
4726
+ dockerPty.write('\x03'); // Ctrl+C
4727
+ }
4728
+ },
4729
+ resize: (cols, rows) => dockerPty.resize(cols, rows),
4730
+ isPty: true
4731
+ };
4732
+ });
4733
+ }
4546
4734
  }
4547
4735
  else if (currentContext.type === 'ssh') {
4548
4736
  // SSH execution with PTY for proper TTY handling