@supyagent/sdk 0.1.20 → 0.1.21
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/dist/react.cjs +14 -1
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +7 -1
- package/dist/react.d.ts +7 -1
- package/dist/react.js +13 -1
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
package/dist/react.cjs
CHANGED
|
@@ -78,6 +78,7 @@ __export(react_exports, {
|
|
|
78
78
|
normalizeMicrosoftCalendar: () => normalizeMicrosoftCalendar,
|
|
79
79
|
normalizeMicrosoftDrive: () => normalizeMicrosoftDrive,
|
|
80
80
|
normalizeMicrosoftMail: () => normalizeMicrosoftMail,
|
|
81
|
+
resolveToolName: () => resolveToolName,
|
|
81
82
|
unwrapSupyagentResult: () => unwrapSupyagentResult
|
|
82
83
|
});
|
|
83
84
|
module.exports = __toCommonJS(react_exports);
|
|
@@ -206,6 +207,8 @@ function getFormatterType(toolName) {
|
|
|
206
207
|
return "audio";
|
|
207
208
|
case "video":
|
|
208
209
|
return "video";
|
|
210
|
+
case "code":
|
|
211
|
+
return "compute";
|
|
209
212
|
case "ocr":
|
|
210
213
|
return "generic";
|
|
211
214
|
case "bash":
|
|
@@ -215,6 +218,13 @@ function getFormatterType(toolName) {
|
|
|
215
218
|
return "generic";
|
|
216
219
|
}
|
|
217
220
|
}
|
|
221
|
+
function resolveToolName(rawToolName, args) {
|
|
222
|
+
if (rawToolName !== "apiCall" || !args) return rawToolName;
|
|
223
|
+
const path = typeof args.path === "string" ? args.path : "";
|
|
224
|
+
const stripped = path.replace(/^\/api\/v1\//, "");
|
|
225
|
+
if (!stripped || stripped === path) return rawToolName;
|
|
226
|
+
return stripped.split("/").filter(Boolean).join("_");
|
|
227
|
+
}
|
|
218
228
|
|
|
219
229
|
// src/ui/collapsible-result.tsx
|
|
220
230
|
var import_react = require("react");
|
|
@@ -3176,7 +3186,9 @@ function renderFormatter(formatterType, data) {
|
|
|
3176
3186
|
function SupyagentToolResult({ part }) {
|
|
3177
3187
|
const state = extractState(part);
|
|
3178
3188
|
const result = extractResult(part);
|
|
3179
|
-
const
|
|
3189
|
+
const rawToolName = extractToolName(part);
|
|
3190
|
+
const args = extractArgs(part);
|
|
3191
|
+
const toolName = resolveToolName(rawToolName, args);
|
|
3180
3192
|
if (state !== "output-available" || result === void 0) {
|
|
3181
3193
|
return null;
|
|
3182
3194
|
}
|
|
@@ -3456,6 +3468,7 @@ function SupyagentToolCall({ part }) {
|
|
|
3456
3468
|
normalizeMicrosoftCalendar,
|
|
3457
3469
|
normalizeMicrosoftDrive,
|
|
3458
3470
|
normalizeMicrosoftMail,
|
|
3471
|
+
resolveToolName,
|
|
3459
3472
|
unwrapSupyagentResult
|
|
3460
3473
|
});
|
|
3461
3474
|
//# sourceMappingURL=react.cjs.map
|