@botbotgo/better-call 0.1.33 → 0.1.34

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 (2) hide show
  1. package/package.json +1 -1
  2. package/scripts/demo.mjs +6 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botbotgo/better-call",
3
- "version": "0.1.33",
3
+ "version": "0.1.34",
4
4
  "description": "Small-model tool-call reliability layer for LangChain and custom agent runtimes.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
package/scripts/demo.mjs CHANGED
@@ -61,7 +61,11 @@ let wrappedOutput;
61
61
  try {
62
62
  wrappedOutput = await wrappedStockQuote.invoke(malformedRepairArgs);
63
63
  } catch (error) {
64
- exitWithError("wrapped stock_quote invocation", error);
64
+ const context = `tool=stock_quote args=${JSON.stringify(malformedRepairArgs)}`;
65
+ const message = `${errorMessage(error)} (${context})`;
66
+ const contextualError =
67
+ error instanceof Error ? new Error(message, { cause: error }) : new Error(message);
68
+ exitWithError("wrapped stock_quote invocation", contextualError);
65
69
  }
66
70
 
67
71
  let reliableResult = null;
@@ -144,7 +148,7 @@ if (json) {
144
148
  console.log("3. Gateway tool-name repair");
145
149
  console.log(` status: ${report.gatewayRepair.status}`);
146
150
  console.log(` tool: ${report.gatewayRepair.originalToolName} -> ${report.gatewayRepair.toolName}`);
147
- console.log(` reason: ${report.gatewayRepair.reason}`);
151
+ console.log(` reason: ${report.gatewayRepair.reason ?? "(none)"}`);
148
152
  console.log("");
149
153
  console.log("Run with --json for the full structured result.");
150
154
  }