@caupulican/pi-adaptative 0.80.15 → 0.80.17

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.
@@ -62,7 +62,7 @@ import { SettingsSelectorComponent } from "./components/settings-selector.js";
62
62
  import { SkillInvocationMessageComponent } from "./components/skill-invocation-message.js";
63
63
  import { ToolExecutionComponent } from "./components/tool-execution.js";
64
64
  import { ToolGroupComponent } from "./components/tool-group.js";
65
- import { getToolPanelActionKey, shouldReuseToolPanelInPlace, ToolPanelRegistry, } from "./components/tool-panel-registry.js";
65
+ import { getToolPanelActionKey, getToolPanelResultActionKeys, shouldReuseToolPanelInPlace, ToolPanelRegistry, } from "./components/tool-panel-registry.js";
66
66
  import { TreeSelectorComponent } from "./components/tree-selector.js";
67
67
  import { TrustSelectorComponent } from "./components/trust-selector.js";
68
68
  import { UserMessageComponent } from "./components/user-message.js";
@@ -1567,12 +1567,13 @@ export class InteractiveMode {
1567
1567
  attachToolExecutionComponent(toolName, toolCallId, args) {
1568
1568
  const actionKey = getToolPanelActionKey(this.getToolPanelScope(), toolName, args);
1569
1569
  const toolDefinition = this.getRegisteredToolDefinition(toolName);
1570
- const existing = this.toolPanels.getReusable(actionKey);
1570
+ const reuseInPlace = shouldReuseToolPanelInPlace(toolName, args);
1571
+ const existing = this.toolPanels.getReusable(actionKey, { allowActive: reuseInPlace });
1571
1572
  if (existing) {
1572
- if (shouldReuseToolPanelInPlace(toolName, args)) {
1573
+ if (reuseInPlace && actionKey) {
1573
1574
  existing.resetInvocation(toolName, toolCallId, args, toolDefinition);
1574
1575
  existing.setExpanded(this.toolOutputExpanded);
1575
- this.toolPanels.register(toolCallId, existing, actionKey);
1576
+ this.toolPanels.replaceActiveForAction(toolCallId, existing, actionKey);
1576
1577
  this.ui.requestRender();
1577
1578
  return existing;
1578
1579
  }
@@ -2695,6 +2696,7 @@ export class InteractiveMode {
2695
2696
  const component = this.toolPanels.getActive(event.toolCallId);
2696
2697
  if (component) {
2697
2698
  component.updateResult({ ...event.result, isError: event.isError });
2699
+ this.toolPanels.registerAliases(component, getToolPanelResultActionKeys(this.getToolPanelScope(), event.toolName, event.result));
2698
2700
  this.toolPanels.finish(event.toolCallId);
2699
2701
  this.ui.requestRender();
2700
2702
  }
@@ -3545,8 +3547,13 @@ export class InteractiveMode {
3545
3547
  for (const message of preCommands) {
3546
3548
  await this.session.prompt(message.text);
3547
3549
  }
3548
- // Send first prompt (starts streaming)
3549
- const promptPromise = this.session.prompt(firstPrompt.text, { images: firstPrompt.images }).catch((error) => {
3550
+ // Send first prompt (starts streaming). Auto-compaction can finish while the
3551
+ // agent is still processing; in that case, queue the message with the same
3552
+ // steering/follow-up mode instead of surfacing an internal streamingBehavior error.
3553
+ const promptOptions = this.session.isStreaming
3554
+ ? { images: firstPrompt.images, streamingBehavior: firstPrompt.mode }
3555
+ : { images: firstPrompt.images };
3556
+ const promptPromise = this.session.prompt(firstPrompt.text, promptOptions).catch((error) => {
3550
3557
  restoreQueue(error);
3551
3558
  });
3552
3559
  // Queue remaining messages