@botbotgo/better-call 0.1.40 → 0.1.41
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/package.json +1 -1
- package/scripts/demo.mjs +6 -2
package/package.json
CHANGED
package/scripts/demo.mjs
CHANGED
|
@@ -76,7 +76,7 @@ const stockQuote = {
|
|
|
76
76
|
throw new Error("Invalid ticker: expected a non-empty string.");
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
if (!VALID_MARKETS.includes(market)) {
|
|
79
|
+
if (typeof market !== "string" || !VALID_MARKETS.includes(market)) {
|
|
80
80
|
throw new Error("Invalid market: expected one of US, HK, CN.");
|
|
81
81
|
}
|
|
82
82
|
|
|
@@ -181,7 +181,11 @@ const gatewayRepair =
|
|
|
181
181
|
errorCause: null,
|
|
182
182
|
};
|
|
183
183
|
|
|
184
|
-
|
|
184
|
+
// Missing or empty calls are expected in some demo/error paths; normalize to null for reporting.
|
|
185
|
+
const repairedCall =
|
|
186
|
+
Array.isArray(reliableResult?.calls) && reliableResult.calls.length > 0
|
|
187
|
+
? reliableResult.calls[0]
|
|
188
|
+
: null;
|
|
185
189
|
|
|
186
190
|
const report = {
|
|
187
191
|
wrappedTool: {
|