@caupulican/pi-adaptative 0.80.0 → 0.80.2

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 (49) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/core/agent-session.d.ts +3 -1
  3. package/dist/core/agent-session.d.ts.map +1 -1
  4. package/dist/core/agent-session.js +5 -0
  5. package/dist/core/agent-session.js.map +1 -1
  6. package/dist/core/extensions/runner.d.ts +2 -0
  7. package/dist/core/extensions/runner.d.ts.map +1 -1
  8. package/dist/core/extensions/runner.js +8 -0
  9. package/dist/core/extensions/runner.js.map +1 -1
  10. package/dist/core/extensions/types.d.ts +2 -0
  11. package/dist/core/extensions/types.d.ts.map +1 -1
  12. package/dist/core/extensions/types.js.map +1 -1
  13. package/dist/core/footer-data-provider.d.ts +2 -0
  14. package/dist/core/footer-data-provider.d.ts.map +1 -1
  15. package/dist/core/footer-data-provider.js +29 -1
  16. package/dist/core/footer-data-provider.js.map +1 -1
  17. package/dist/modes/interactive/components/tool-execution.d.ts +1 -0
  18. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  19. package/dist/modes/interactive/components/tool-execution.js +11 -2
  20. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  21. package/dist/modes/interactive/components/tool-group.d.ts +3 -0
  22. package/dist/modes/interactive/components/tool-group.d.ts.map +1 -1
  23. package/dist/modes/interactive/components/tool-group.js +13 -0
  24. package/dist/modes/interactive/components/tool-group.js.map +1 -1
  25. package/dist/modes/interactive/interactive-mode.d.ts +1 -0
  26. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  27. package/dist/modes/interactive/interactive-mode.js +28 -3
  28. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  29. package/dist/modes/interactive/theme/matrix-machine.json +86 -0
  30. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  31. package/dist/modes/interactive/theme/theme.js +2 -0
  32. package/dist/modes/interactive/theme/theme.js.map +1 -1
  33. package/dist/modes/print-mode.d.ts.map +1 -1
  34. package/dist/modes/print-mode.js +1 -0
  35. package/dist/modes/print-mode.js.map +1 -1
  36. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  37. package/dist/modes/rpc/rpc-mode.js +1 -0
  38. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  39. package/docs/extensions.md +5 -1
  40. package/docs/themes.md +2 -1
  41. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  42. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  43. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  44. package/examples/extensions/sandbox/package-lock.json +2 -2
  45. package/examples/extensions/sandbox/package.json +1 -1
  46. package/examples/extensions/with-deps/package-lock.json +2 -2
  47. package/examples/extensions/with-deps/package.json +1 -1
  48. package/npm-shrinkwrap.json +12 -12
  49. package/package.json +4 -4
@@ -1190,6 +1190,7 @@ export class InteractiveMode {
1190
1190
  const uiContext = this.createExtensionUIContext();
1191
1191
  await this.session.bindExtensions({
1192
1192
  uiContext,
1193
+ mode: "tui",
1193
1194
  abortHandler: () => {
1194
1195
  this.restoreQueuedMessagesToEditor({ abort: true });
1195
1196
  },
@@ -1346,15 +1347,38 @@ export class InteractiveMode {
1346
1347
  }
1347
1348
  this.chatContainer.addChild(component);
1348
1349
  }
1350
+ detachToolExecutionComponent(component) {
1351
+ const children = this.chatContainer.children;
1352
+ const directIndex = children.indexOf(component);
1353
+ if (directIndex !== -1) {
1354
+ children.splice(directIndex, 1);
1355
+ return;
1356
+ }
1357
+ for (let i = 0; i < children.length; i++) {
1358
+ const child = children[i];
1359
+ if (!(child instanceof ToolGroupComponent) || !child.removeTool(component))
1360
+ continue;
1361
+ const remaining = child.getToolCount();
1362
+ if (remaining === 0) {
1363
+ children.splice(i, 1);
1364
+ }
1365
+ else if (remaining === 1) {
1366
+ const onlyTool = child.getOnlyTool();
1367
+ if (onlyTool)
1368
+ children[i] = onlyTool;
1369
+ }
1370
+ return;
1371
+ }
1372
+ }
1349
1373
  attachToolExecutionComponent(toolName, toolCallId, args) {
1350
1374
  const actionKey = getToolPanelActionKey(this.getToolPanelScope(), toolName, args);
1351
1375
  const toolDefinition = this.getRegisteredToolDefinition(toolName);
1352
1376
  const existing = this.toolPanels.getReusable(actionKey);
1353
1377
  if (existing) {
1354
- this.chatContainer.removeChild(existing);
1378
+ this.detachToolExecutionComponent(existing);
1355
1379
  existing.resetInvocation(toolName, toolCallId, args, toolDefinition);
1356
1380
  existing.setExpanded(this.toolOutputExpanded);
1357
- this.chatContainer.addChild(existing);
1381
+ this.appendToolExecutionComponent(existing, true);
1358
1382
  this.toolPanels.register(toolCallId, existing, actionKey);
1359
1383
  return existing;
1360
1384
  }
@@ -1363,7 +1387,7 @@ export class InteractiveMode {
1363
1387
  imageWidthCells: this.settingsManager.getImageWidthCells(),
1364
1388
  }, toolDefinition, this.ui, this.sessionManager.getCwd());
1365
1389
  component.setExpanded(this.toolOutputExpanded);
1366
- this.appendToolExecutionComponent(component, !actionKey);
1390
+ this.appendToolExecutionComponent(component, true);
1367
1391
  this.toolPanels.register(toolCallId, component, actionKey);
1368
1392
  return component;
1369
1393
  }
@@ -1384,6 +1408,7 @@ export class InteractiveMode {
1384
1408
  const createContext = () => ({
1385
1409
  ui: this.createExtensionUIContext(),
1386
1410
  hasUI: true,
1411
+ mode: "tui",
1387
1412
  cwd: this.sessionManager.getCwd(),
1388
1413
  sessionManager: this.sessionManager,
1389
1414
  modelRegistry: this.session.modelRegistry,