@caupulican/pi-adaptative 0.81.9 → 0.81.13
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.
- package/CHANGELOG.md +26 -0
- package/dist/bundled-resources/skills/tool-call-repair/SKILL.md +152 -0
- package/dist/bundled-resources/skills/tool-call-repair/references/failure-grammar.md +128 -0
- package/dist/bundled-resources/skills/tool-call-repair/references/repair-catalogue.md +201 -0
- package/dist/bundled-resources/skills/tool-call-repair/references/text-protocol-grammar.md +141 -0
- package/dist/cli/list-models.d.ts.map +1 -1
- package/dist/cli/list-models.js +5 -0
- package/dist/cli/list-models.js.map +1 -1
- package/dist/core/agent-session.d.ts +46 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +394 -1
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/delegation/worker-actions.d.ts +2 -1
- package/dist/core/delegation/worker-actions.d.ts.map +1 -1
- package/dist/core/delegation/worker-actions.js +34 -2
- package/dist/core/delegation/worker-actions.js.map +1 -1
- package/dist/core/extensions/types.d.ts +3 -1
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/failure-corpus.d.ts +27 -1
- package/dist/core/failure-corpus.d.ts.map +1 -1
- package/dist/core/failure-corpus.js +33 -11
- package/dist/core/failure-corpus.js.map +1 -1
- package/dist/core/model-registry.d.ts +3 -2
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +12 -4
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/models/adaptation-store.d.ts +79 -0
- package/dist/core/models/adaptation-store.d.ts.map +1 -0
- package/dist/core/models/adaptation-store.js +196 -0
- package/dist/core/models/adaptation-store.js.map +1 -0
- package/dist/core/session-analytics.d.ts +24 -1
- package/dist/core/session-analytics.d.ts.map +1 -1
- package/dist/core/session-analytics.js +75 -0
- package/dist/core/session-analytics.js.map +1 -1
- package/dist/core/settings-manager.d.ts +6 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +10 -0
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/system-prompt-builder.d.ts +4 -0
- package/dist/core/system-prompt-builder.d.ts.map +1 -1
- package/dist/core/system-prompt-builder.js +8 -0
- package/dist/core/system-prompt-builder.js.map +1 -1
- package/dist/core/tool-repair-health.d.ts +3 -0
- package/dist/core/tool-repair-health.d.ts.map +1 -0
- package/dist/core/tool-repair-health.js +63 -0
- package/dist/core/tool-repair-health.js.map +1 -0
- package/dist/core/tool-repair-settings.d.ts +11 -0
- package/dist/core/tool-repair-settings.d.ts.map +1 -0
- package/dist/core/tool-repair-settings.js +18 -0
- package/dist/core/tool-repair-settings.js.map +1 -0
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +0 -9
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +10 -7
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +15 -9
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +7 -3
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +21 -4
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/external-editor.d.ts.map +1 -1
- package/dist/modes/interactive/external-editor.js +5 -3
- package/dist/modes/interactive/external-editor.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +61 -7
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +16 -0
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +47 -1
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/docs/index.md +1 -0
- package/docs/models.md +5 -1
- package/docs/rpc.md +75 -0
- package/docs/settings.md +22 -0
- package/docs/tool-repair.md +83 -0
- package/docs/usage.md +3 -0
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +12 -12
- package/package.json +6 -4
- package/docs/bug-ledger.md +0 -134
|
@@ -1043,21 +1043,21 @@ export class InteractiveMode {
|
|
|
1043
1043
|
return;
|
|
1044
1044
|
}
|
|
1045
1045
|
}
|
|
1046
|
-
attachToolExecutionComponent(toolName, toolCallId, args) {
|
|
1046
|
+
attachToolExecutionComponent(toolName, toolCallId, args, repair) {
|
|
1047
1047
|
const actionKey = getToolPanelActionKey(this.getToolPanelScope(), toolName, args);
|
|
1048
1048
|
const toolDefinition = this.getRegisteredToolDefinition(toolName);
|
|
1049
1049
|
const reuseInPlace = shouldReuseToolPanelInPlace(toolName, args);
|
|
1050
1050
|
const existing = this.toolPanels.getReusable(actionKey, { allowActive: reuseInPlace });
|
|
1051
1051
|
if (existing) {
|
|
1052
1052
|
if (reuseInPlace && actionKey) {
|
|
1053
|
-
existing.resetInvocation(toolName, toolCallId, args, toolDefinition);
|
|
1053
|
+
existing.resetInvocation(toolName, toolCallId, args, toolDefinition, repair);
|
|
1054
1054
|
existing.setExpanded(this.toolOutputExpanded);
|
|
1055
1055
|
this.toolPanels.replaceActiveForAction(toolCallId, existing, actionKey);
|
|
1056
1056
|
this.ui.requestRender();
|
|
1057
1057
|
return existing;
|
|
1058
1058
|
}
|
|
1059
1059
|
this.detachToolExecutionComponent(existing);
|
|
1060
|
-
existing.resetInvocation(toolName, toolCallId, args, toolDefinition);
|
|
1060
|
+
existing.resetInvocation(toolName, toolCallId, args, toolDefinition, repair);
|
|
1061
1061
|
existing.setExpanded(this.toolOutputExpanded);
|
|
1062
1062
|
this.appendToolExecutionComponent(existing, true);
|
|
1063
1063
|
this.toolPanels.register(toolCallId, existing, actionKey);
|
|
@@ -1066,6 +1066,7 @@ export class InteractiveMode {
|
|
|
1066
1066
|
const component = new ToolExecutionComponent(toolName, toolCallId, args, {
|
|
1067
1067
|
showImages: this.settingsManager.getShowImages(),
|
|
1068
1068
|
imageWidthCells: this.settingsManager.getImageWidthCells(),
|
|
1069
|
+
repair,
|
|
1069
1070
|
}, toolDefinition, this.ui, this.sessionManager.getCwd());
|
|
1070
1071
|
component.setExpanded(this.toolOutputExpanded);
|
|
1071
1072
|
this.appendToolExecutionComponent(component, true);
|
|
@@ -1326,6 +1327,46 @@ export class InteractiveMode {
|
|
|
1326
1327
|
this.editor.setText("");
|
|
1327
1328
|
return;
|
|
1328
1329
|
}
|
|
1330
|
+
if (text === "/toolhealth") {
|
|
1331
|
+
this.showStatus(this.session.formatToolRepairHealthReport());
|
|
1332
|
+
this.editor.setText("");
|
|
1333
|
+
return;
|
|
1334
|
+
}
|
|
1335
|
+
if (text === "/toolprobe" || text.startsWith("/toolprobe ")) {
|
|
1336
|
+
const target = text.slice("/toolprobe".length).trim();
|
|
1337
|
+
this.editor.setText("");
|
|
1338
|
+
this.showStatus("Running tool probe...");
|
|
1339
|
+
try {
|
|
1340
|
+
const report = await this.session.probeToolCalling(target || undefined);
|
|
1341
|
+
this.showStatus(report.table);
|
|
1342
|
+
}
|
|
1343
|
+
catch (error) {
|
|
1344
|
+
this.showWarning(error instanceof Error ? error.message : String(error));
|
|
1345
|
+
}
|
|
1346
|
+
return;
|
|
1347
|
+
}
|
|
1348
|
+
if (text.startsWith("/toolrule-remove")) {
|
|
1349
|
+
const [model, mode] = text.slice("/toolrule-remove".length).trim().split(/\s+/, 2);
|
|
1350
|
+
const message = model && mode
|
|
1351
|
+
? this.session.removeToolRepairRule(model, mode)
|
|
1352
|
+
? `Removed tool repair rule ${mode} for ${model}.`
|
|
1353
|
+
: `No tool repair rule ${mode} found for ${model}.`
|
|
1354
|
+
: "Usage: /toolrule-remove <provider/model> <mode>";
|
|
1355
|
+
this.showStatus(message);
|
|
1356
|
+
this.editor.setText("");
|
|
1357
|
+
return;
|
|
1358
|
+
}
|
|
1359
|
+
if (text.startsWith("/toolprotocol-reset")) {
|
|
1360
|
+
const model = text.slice("/toolprotocol-reset".length).trim();
|
|
1361
|
+
const message = model
|
|
1362
|
+
? this.session.resetToolProtocolCalibration(model)
|
|
1363
|
+
? `Reset text tool protocol calibration for ${model}.`
|
|
1364
|
+
: `No text tool protocol calibration found for ${model}.`
|
|
1365
|
+
: "Usage: /toolprotocol-reset <provider/model>";
|
|
1366
|
+
this.showStatus(message);
|
|
1367
|
+
this.editor.setText("");
|
|
1368
|
+
return;
|
|
1369
|
+
}
|
|
1329
1370
|
if (text === "/scoped-models") {
|
|
1330
1371
|
this.editor.setText("");
|
|
1331
1372
|
await this.showModelsSelector();
|
|
@@ -1657,14 +1698,17 @@ export class InteractiveMode {
|
|
|
1657
1698
|
case "tool_execution_start": {
|
|
1658
1699
|
let component = this.toolPanels.getActive(event.toolCallId);
|
|
1659
1700
|
if (!component)
|
|
1660
|
-
component = this.attachToolExecutionComponent(event.toolName, event.toolCallId, event.args);
|
|
1661
|
-
|
|
1701
|
+
component = this.attachToolExecutionComponent(event.toolName, event.toolCallId, event.args, event.repair);
|
|
1702
|
+
else
|
|
1703
|
+
component.updateArgs(event.args, event.repair);
|
|
1704
|
+
component.markExecutionStarted(event.repair);
|
|
1662
1705
|
this.ui.requestRender();
|
|
1663
1706
|
break;
|
|
1664
1707
|
}
|
|
1665
1708
|
case "tool_execution_update": {
|
|
1666
1709
|
const component = this.toolPanels.getActive(event.toolCallId);
|
|
1667
1710
|
if (component) {
|
|
1711
|
+
component.updateArgs(event.args, event.repair);
|
|
1668
1712
|
component.updateResult({ ...event.partialResult, isError: false }, true);
|
|
1669
1713
|
this.ui.requestRender();
|
|
1670
1714
|
}
|
|
@@ -1865,17 +1909,27 @@ export class InteractiveMode {
|
|
|
1865
1909
|
}
|
|
1866
1910
|
})();
|
|
1867
1911
|
}
|
|
1912
|
+
getToolCallRepairInfo(toolCall) {
|
|
1913
|
+
if (!toolCall.rawArguments && !toolCall.repairNotes?.length)
|
|
1914
|
+
return undefined;
|
|
1915
|
+
return {
|
|
1916
|
+
repaired: true,
|
|
1917
|
+
...(toolCall.rawArguments ? { rawArguments: toolCall.rawArguments } : {}),
|
|
1918
|
+
...(toolCall.repairNotes?.length ? { notes: toolCall.repairNotes } : {}),
|
|
1919
|
+
};
|
|
1920
|
+
}
|
|
1868
1921
|
attachStreamingToolPanels(message) {
|
|
1869
1922
|
for (const content of message.content) {
|
|
1870
1923
|
if (content.type !== "toolCall")
|
|
1871
1924
|
continue;
|
|
1925
|
+
const repair = this.getToolCallRepairInfo(content);
|
|
1872
1926
|
if (!this.toolPanels.hasActive(content.id)) {
|
|
1873
|
-
this.attachToolExecutionComponent(content.name, content.id, content.arguments);
|
|
1927
|
+
this.attachToolExecutionComponent(content.name, content.id, content.arguments, repair);
|
|
1874
1928
|
}
|
|
1875
1929
|
else {
|
|
1876
1930
|
const component = this.toolPanels.getActive(content.id);
|
|
1877
1931
|
if (component) {
|
|
1878
|
-
component.updateArgs(content.arguments);
|
|
1932
|
+
component.updateArgs(content.arguments, repair);
|
|
1879
1933
|
}
|
|
1880
1934
|
}
|
|
1881
1935
|
}
|