@mariozechner/pi-coding-agent 0.50.0 → 0.50.1

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.
@@ -741,12 +741,6 @@ export class InteractiveMode {
741
741
  * Initialize the extension system with TUI-based UI context.
742
742
  */
743
743
  async initExtensions() {
744
- const extensionRunner = this.session.extensionRunner;
745
- if (!extensionRunner) {
746
- this.showLoadedResources({ extensionPaths: [], force: false });
747
- return;
748
- }
749
- // Create extension UI context
750
744
  const uiContext = this.createExtensionUIContext();
751
745
  await this.session.bindExtensions({
752
746
  uiContext,
@@ -758,21 +752,20 @@ export class InteractiveMode {
758
752
  this.loadingAnimation = undefined;
759
753
  }
760
754
  this.statusContainer.clear();
761
- const success = await this.session.newSession({ parentSession: options?.parentSession });
755
+ // Delegate to AgentSession (handles setup + agent state sync)
756
+ const success = await this.session.newSession(options);
762
757
  if (!success) {
763
758
  return { cancelled: true };
764
759
  }
765
- if (options?.setup) {
766
- await options.setup(this.sessionManager);
767
- }
760
+ // Clear UI state
768
761
  this.chatContainer.clear();
769
762
  this.pendingMessagesContainer.clear();
770
763
  this.compactionQueuedMessages = [];
771
764
  this.streamingComponent = undefined;
772
765
  this.streamingMessage = undefined;
773
766
  this.pendingTools.clear();
774
- this.chatContainer.addChild(new Spacer(1));
775
- this.chatContainer.addChild(new Text(`${theme.fg("accent", "✓ New session started")}`, 1, 1));
767
+ // Render any messages added via setup, or show empty session
768
+ this.renderInitialMessages();
776
769
  this.ui.requestRender();
777
770
  return { cancelled: false };
778
771
  },
@@ -813,6 +806,11 @@ export class InteractiveMode {
813
806
  this.showExtensionError(error.extensionPath, error.error, error.stack);
814
807
  },
815
808
  });
809
+ const extensionRunner = this.session.extensionRunner;
810
+ if (!extensionRunner) {
811
+ this.showLoadedResources({ extensionPaths: [], force: false });
812
+ return;
813
+ }
816
814
  this.setupExtensionShortcuts(extensionRunner);
817
815
  this.showLoadedResources({ extensionPaths: extensionRunner.getExtensionPaths(), force: false });
818
816
  }
@@ -3394,7 +3392,8 @@ export class InteractiveMode {
3394
3392
  `;
3395
3393
  for (const [key, shortcut] of shortcuts) {
3396
3394
  const description = shortcut.description ?? shortcut.extensionPath;
3397
- hotkeys += `| \`${key}\` | ${description} |\n`;
3395
+ const keyDisplay = key.replace(/\b\w/g, (c) => c.toUpperCase());
3396
+ hotkeys += `| \`${keyDisplay}\` | ${description} |\n`;
3398
3397
  }
3399
3398
  }
3400
3399
  }