apex-code 0.6.0 → 0.6.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.
Files changed (32) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/core/keybindings.d.ts +5 -0
  3. package/dist/core/keybindings.d.ts.map +1 -1
  4. package/dist/core/keybindings.js +1 -0
  5. package/dist/core/keybindings.js.map +1 -1
  6. package/dist/modes/interactive/components/bash-execution.d.ts +13 -2
  7. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  8. package/dist/modes/interactive/components/bash-execution.js +56 -1
  9. package/dist/modes/interactive/components/bash-execution.js.map +1 -1
  10. package/dist/modes/interactive/components/error-summary.d.ts +2 -0
  11. package/dist/modes/interactive/components/error-summary.d.ts.map +1 -1
  12. package/dist/modes/interactive/components/error-summary.js +10 -0
  13. package/dist/modes/interactive/components/error-summary.js.map +1 -1
  14. package/dist/modes/interactive/components/footer.d.ts +3 -0
  15. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  16. package/dist/modes/interactive/components/footer.js +13 -0
  17. package/dist/modes/interactive/components/footer.js.map +1 -1
  18. package/dist/modes/interactive/components/tool-execution.d.ts +9 -1
  19. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  20. package/dist/modes/interactive/components/tool-execution.js +81 -8
  21. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  22. package/dist/modes/interactive/components/tool-panel.d.ts +7 -0
  23. package/dist/modes/interactive/components/tool-panel.d.ts.map +1 -1
  24. package/dist/modes/interactive/components/tool-panel.js +35 -0
  25. package/dist/modes/interactive/components/tool-panel.js.map +1 -1
  26. package/dist/modes/interactive/interactive-mode.d.ts +1 -0
  27. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  28. package/dist/modes/interactive/interactive-mode.js +29 -11
  29. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  30. package/docs/keybindings.md +2 -1
  31. package/npm-shrinkwrap.json +5 -5
  32. package/package.json +2 -2
@@ -2628,6 +2628,7 @@ export class InteractiveMode {
2628
2628
  this.ui.onDebug = () => this.handleDebugCommand();
2629
2629
  this.defaultEditor.onAction("app.model.select", () => this.showModelSelector());
2630
2630
  this.defaultEditor.onAction("app.tools.expand", () => this.cycleChatDetail());
2631
+ this.defaultEditor.onAction("app.tools.expandLatest", () => this.toggleLatestOperation());
2631
2632
  this.defaultEditor.onAction("app.tasks.toggle", () => this.toggleTaskPanel());
2632
2633
  this.defaultEditor.onAction("app.thinking.toggle", () => this.toggleThinkingBlockVisibility());
2633
2634
  this.defaultEditor.onAction("app.editor.external", () => void this.handleOpenExternalEditor());
@@ -3379,7 +3380,8 @@ export class InteractiveMode {
3379
3380
  addMessageToChat(message, options) {
3380
3381
  switch (message.role) {
3381
3382
  case "bashExecution": {
3382
- const component = new BashExecutionComponent(message.command, this.ui, message.excludeFromContext);
3383
+ const component = new BashExecutionComponent(message.command, this.ui, message.excludeFromContext, this.settingsManager.getSymbolPreset());
3384
+ this.adoptChatDetail(component);
3383
3385
  if (message.output) {
3384
3386
  component.appendOutput(message.output);
3385
3387
  }
@@ -3961,11 +3963,26 @@ export class InteractiveMode {
3961
3963
  * remembering to set every axis.
3962
3964
  */
3963
3965
  adoptChatDetail(component) {
3966
+ if (component instanceof ToolExecutionComponent || component instanceof BashExecutionComponent) {
3967
+ component.setChatDetail(this.chatDetail);
3968
+ return;
3969
+ }
3964
3970
  if (isExpandable(component))
3965
3971
  component.setExpanded(this.toolOutputExpanded);
3966
3972
  if (hasEditDiffsExpansion(component))
3967
3973
  component.setEditDiffsExpanded(this.editDiffsExpanded);
3968
3974
  }
3975
+ toggleLatestOperation() {
3976
+ const pending = this.pendingMessagesContainer?.children ?? [];
3977
+ const operations = [...this.chatContainer.children, ...pending];
3978
+ const latest = operations
3979
+ .reverse()
3980
+ .find((child) => child instanceof ToolExecutionComponent || child instanceof BashExecutionComponent);
3981
+ if (latest instanceof ToolExecutionComponent || latest instanceof BashExecutionComponent) {
3982
+ latest.toggleExpanded();
3983
+ this.ui.requestRender();
3984
+ }
3985
+ }
3969
3986
  /** The expand key. A level the user picks is saved, so the next session opens at it. */
3970
3987
  cycleChatDetail() {
3971
3988
  this.chooseChatDetail(nextChatDetail(this.chatDetail));
@@ -3983,6 +4000,7 @@ export class InteractiveMode {
3983
4000
  this.chatDetail = detail;
3984
4001
  this.toolOutputExpanded = view.toolOutputExpanded;
3985
4002
  this.editDiffsExpanded = view.editDiffsExpanded;
4003
+ this.footer?.setChatDetail(detail);
3986
4004
  }
3987
4005
  /**
3988
4006
  * Presentation only. This never rewrites messages or the session transcript,
@@ -3994,7 +4012,6 @@ export class InteractiveMode {
3994
4012
  return;
3995
4013
  this.assignChatDetail(detail);
3996
4014
  this.applyChatDetail();
3997
- this.showStatus(`Conversation detail: ${detail}`);
3998
4015
  }
3999
4016
  /** True when thinking blocks are hidden right now, setting and detail level combined. */
4000
4017
  isThinkingHidden() {
@@ -4006,17 +4023,14 @@ export class InteractiveMode {
4006
4023
  if (isExpandable(activeHeader)) {
4007
4024
  activeHeader.setExpanded(this.toolOutputExpanded);
4008
4025
  }
4009
- for (const container of [this.loadedResourcesContainer, this.chatContainer]) {
4026
+ for (const container of [this.loadedResourcesContainer, this.chatContainer, this.pendingMessagesContainer]) {
4027
+ if (!container)
4028
+ continue;
4010
4029
  for (const child of container.children) {
4011
4030
  if (child instanceof AssistantMessageComponent) {
4012
4031
  child.setHideThinkingBlock(this.isThinkingHidden());
4013
4032
  }
4014
- if (isExpandable(child)) {
4015
- child.setExpanded(this.toolOutputExpanded);
4016
- }
4017
- if (hasEditDiffsExpansion(child)) {
4018
- child.setEditDiffsExpanded(this.editDiffsExpanded);
4019
- }
4033
+ this.adoptChatDetail(child);
4020
4034
  }
4021
4035
  }
4022
4036
  this.ui.requestRender();
@@ -6183,6 +6197,7 @@ export class InteractiveMode {
6183
6197
  const cycleModelForward = this.getAppKeyDisplay("app.model.cycleForward");
6184
6198
  const selectModel = this.getAppKeyDisplay("app.model.select");
6185
6199
  const expandTools = this.getAppKeyDisplay("app.tools.expand");
6200
+ const expandLatest = this.getAppKeyDisplay("app.tools.expandLatest");
6186
6201
  const toggleThinking = this.getAppKeyDisplay("app.thinking.toggle");
6187
6202
  const externalEditor = this.getAppKeyDisplay("app.editor.external");
6188
6203
  const cycleModelBackward = this.getAppKeyDisplay("app.model.cycleBackward");
@@ -6228,6 +6243,7 @@ export class InteractiveMode {
6228
6243
  | \`${cycleModelForward}\` / \`${cycleModelBackward}\` | Cycle models |
6229
6244
  | \`${selectModel}\` | Open model selector |
6230
6245
  | \`${expandTools}\` | Cycle conversation detail (overview / details / all) |
6246
+ | \`${expandLatest}\` | Toggle latest operation details |
6231
6247
  | \`${toggleThinking}\` | Toggle thinking block visibility |
6232
6248
  | \`${externalEditor}\` | Edit message in external editor |
6233
6249
  | \`${copyMessage}\` | Copy selection or last assistant message |
@@ -6378,7 +6394,8 @@ export class InteractiveMode {
6378
6394
  if (eventResult?.result) {
6379
6395
  const result = eventResult.result;
6380
6396
  // Create UI component for display
6381
- this.bashComponent = new BashExecutionComponent(command, this.ui, excludeFromContext);
6397
+ this.bashComponent = new BashExecutionComponent(command, this.ui, excludeFromContext, this.settingsManager.getSymbolPreset());
6398
+ this.adoptChatDetail(this.bashComponent);
6382
6399
  if (this.session.isStreaming) {
6383
6400
  this.pendingMessagesContainer.addChild(this.bashComponent);
6384
6401
  this.pendingBashComponents.push(this.bashComponent);
@@ -6399,7 +6416,8 @@ export class InteractiveMode {
6399
6416
  }
6400
6417
  // Normal execution path (possibly with custom operations)
6401
6418
  const isDeferred = this.session.isStreaming;
6402
- this.bashComponent = new BashExecutionComponent(command, this.ui, excludeFromContext);
6419
+ this.bashComponent = new BashExecutionComponent(command, this.ui, excludeFromContext, this.settingsManager.getSymbolPreset());
6420
+ this.adoptChatDetail(this.bashComponent);
6403
6421
  if (isDeferred) {
6404
6422
  // Show in pending area when agent is streaming
6405
6423
  this.pendingMessagesContainer.addChild(this.bashComponent);