@supyagent/sdk 0.1.22 → 0.1.24
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/index.cjs +25 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21 -1
- package/dist/index.d.ts +21 -1
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +143 -82
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +17 -2
- package/dist/react.d.ts +17 -2
- package/dist/react.js +144 -85
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
package/dist/react.cjs
CHANGED
|
@@ -32,6 +32,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
32
32
|
var react_exports = {};
|
|
33
33
|
__export(react_exports, {
|
|
34
34
|
BrevoFormatter: () => BrevoFormatter,
|
|
35
|
+
BrowserFormatter: () => BrowserFormatter,
|
|
35
36
|
CalendarEventFormatter: () => CalendarEventFormatter,
|
|
36
37
|
CalendlyFormatter: () => CalendlyFormatter,
|
|
37
38
|
CollapsibleResult: () => CollapsibleResult,
|
|
@@ -65,6 +66,8 @@ __export(react_exports, {
|
|
|
65
66
|
ToolInput: () => ToolInput,
|
|
66
67
|
TwilioFormatter: () => TwilioFormatter,
|
|
67
68
|
TwitterFormatter: () => TwitterFormatter,
|
|
69
|
+
ViewImageFormatter: () => ViewImageFormatter,
|
|
70
|
+
WhatsAppFormatter: () => WhatsAppFormatter,
|
|
68
71
|
extractArgs: () => extractArgs,
|
|
69
72
|
extractResult: () => extractResult,
|
|
70
73
|
extractState: () => extractState,
|
|
@@ -211,6 +214,8 @@ function getFormatterType(toolName) {
|
|
|
211
214
|
return "whatsapp";
|
|
212
215
|
case "browser":
|
|
213
216
|
return "browser";
|
|
217
|
+
case "viewImage":
|
|
218
|
+
return "viewImage";
|
|
214
219
|
case "db":
|
|
215
220
|
return "compute";
|
|
216
221
|
case "files":
|
|
@@ -281,7 +286,8 @@ var ICON_MAP = {
|
|
|
281
286
|
onedrive: import_lucide_react.HardDrive,
|
|
282
287
|
telegram: import_lucide_react.Send,
|
|
283
288
|
whatsapp: import_lucide_react.MessageCircle,
|
|
284
|
-
browser: import_lucide_react.Globe
|
|
289
|
+
browser: import_lucide_react.Globe,
|
|
290
|
+
viewImage: import_lucide_react.Image
|
|
285
291
|
};
|
|
286
292
|
function ProviderIcon({ toolName, className = "h-4 w-4" }) {
|
|
287
293
|
const provider = getProviderFromToolName(toolName);
|
|
@@ -733,6 +739,20 @@ function getBrowserSummary(data, toolName) {
|
|
|
733
739
|
}
|
|
734
740
|
return { text: humanizeToolName(toolName) };
|
|
735
741
|
}
|
|
742
|
+
function getViewImageSummary(data) {
|
|
743
|
+
if (typeof data === "object" && data !== null) {
|
|
744
|
+
const d = data;
|
|
745
|
+
if (d.url && typeof d.url === "string") {
|
|
746
|
+
try {
|
|
747
|
+
const hostname = new URL(d.url).hostname.replace("www.", "");
|
|
748
|
+
return { text: `Image from ${hostname}` };
|
|
749
|
+
} catch {
|
|
750
|
+
return { text: "Image displayed" };
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
return { text: "Image displayed" };
|
|
755
|
+
}
|
|
736
756
|
function getBashSummary(data) {
|
|
737
757
|
if (typeof data !== "object" || data === null) return { text: "Command executed" };
|
|
738
758
|
const d = data;
|
|
@@ -777,6 +797,7 @@ var SUMMARY_MAP = {
|
|
|
777
797
|
video: getVideoSummary,
|
|
778
798
|
whatsapp: getWhatsappSummary,
|
|
779
799
|
browser: getBrowserSummary,
|
|
800
|
+
viewImage: getViewImageSummary,
|
|
780
801
|
bash: getBashSummary,
|
|
781
802
|
generic: getGenericSummary
|
|
782
803
|
};
|
|
@@ -3246,17 +3267,52 @@ function BrowserFormatter({ data }) {
|
|
|
3246
3267
|
] });
|
|
3247
3268
|
}
|
|
3248
3269
|
|
|
3249
|
-
// src/ui/formatters/
|
|
3270
|
+
// src/ui/formatters/view-image.tsx
|
|
3271
|
+
var import_lucide_react31 = require("lucide-react");
|
|
3250
3272
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
3273
|
+
function isViewImageData(data) {
|
|
3274
|
+
return typeof data === "object" && data !== null && "url" in data;
|
|
3275
|
+
}
|
|
3276
|
+
function getDomain3(url) {
|
|
3277
|
+
try {
|
|
3278
|
+
return new URL(url).hostname.replace("www.", "");
|
|
3279
|
+
} catch {
|
|
3280
|
+
return url;
|
|
3281
|
+
}
|
|
3282
|
+
}
|
|
3283
|
+
function ViewImageFormatter({ data }) {
|
|
3284
|
+
if (!isViewImageData(data) || !data.url) {
|
|
3285
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("pre", { className: "rounded-lg border border-border bg-background p-3 text-xs text-foreground overflow-x-auto max-h-96 overflow-y-auto", children: JSON.stringify(data, null, 2) });
|
|
3286
|
+
}
|
|
3287
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "space-y-2", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "rounded-lg border border-border bg-background overflow-hidden", children: [
|
|
3288
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex items-center gap-2 px-3 py-1.5 bg-muted border-b border-border", children: [
|
|
3289
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react31.Image, { className: "h-3.5 w-3.5 text-muted-foreground" }),
|
|
3290
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-xs text-muted-foreground flex-1 truncate", children: getDomain3(data.url) }),
|
|
3291
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("a", { href: data.url, target: "_blank", rel: "noopener noreferrer", className: "shrink-0 text-muted-foreground hover:text-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react31.ExternalLink, { className: "h-3.5 w-3.5" }) })
|
|
3292
|
+
] }),
|
|
3293
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "p-2", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3294
|
+
"img",
|
|
3295
|
+
{
|
|
3296
|
+
src: data.url,
|
|
3297
|
+
alt: "Viewed image",
|
|
3298
|
+
className: "w-full rounded border border-border",
|
|
3299
|
+
loading: "lazy"
|
|
3300
|
+
}
|
|
3301
|
+
) })
|
|
3302
|
+
] }) });
|
|
3303
|
+
}
|
|
3304
|
+
|
|
3305
|
+
// src/ui/formatters/generic.tsx
|
|
3306
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
3251
3307
|
function GenericFormatter({ data }) {
|
|
3252
3308
|
if (data === null || data === void 0) {
|
|
3253
|
-
return /* @__PURE__ */ (0,
|
|
3309
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "text-sm text-muted-foreground italic", children: "No data returned" });
|
|
3254
3310
|
}
|
|
3255
|
-
return /* @__PURE__ */ (0,
|
|
3311
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("pre", { className: "rounded-lg border border-border bg-background p-3 text-xs text-foreground overflow-x-auto max-h-96 overflow-y-auto", children: JSON.stringify(data, null, 2) });
|
|
3256
3312
|
}
|
|
3257
3313
|
|
|
3258
3314
|
// src/ui/tool-result.tsx
|
|
3259
|
-
var
|
|
3315
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
3260
3316
|
function extractToolName(part) {
|
|
3261
3317
|
if (part.type.startsWith("tool-") && part.type !== "tool-invocation") {
|
|
3262
3318
|
return part.type.slice(5);
|
|
@@ -3309,63 +3365,65 @@ function maybeNormalize(toolName, formatterType, data) {
|
|
|
3309
3365
|
function renderFormatter(formatterType, data) {
|
|
3310
3366
|
switch (formatterType) {
|
|
3311
3367
|
case "email":
|
|
3312
|
-
return /* @__PURE__ */ (0,
|
|
3368
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(EmailFormatter, { data });
|
|
3313
3369
|
case "calendar":
|
|
3314
|
-
return /* @__PURE__ */ (0,
|
|
3370
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CalendarEventFormatter, { data });
|
|
3315
3371
|
case "slack":
|
|
3316
|
-
return /* @__PURE__ */ (0,
|
|
3372
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(SlackMessageFormatter, { data });
|
|
3317
3373
|
case "github":
|
|
3318
|
-
return /* @__PURE__ */ (0,
|
|
3374
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GithubFormatter, { data });
|
|
3319
3375
|
case "drive":
|
|
3320
|
-
return /* @__PURE__ */ (0,
|
|
3376
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(DriveFileFormatter, { data });
|
|
3321
3377
|
case "search":
|
|
3322
|
-
return /* @__PURE__ */ (0,
|
|
3378
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(SearchFormatter, { data });
|
|
3323
3379
|
case "docs":
|
|
3324
|
-
return /* @__PURE__ */ (0,
|
|
3380
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(DocsFormatter, { data });
|
|
3325
3381
|
case "sheets":
|
|
3326
|
-
return /* @__PURE__ */ (0,
|
|
3382
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(SheetsFormatter, { data });
|
|
3327
3383
|
case "slides":
|
|
3328
|
-
return /* @__PURE__ */ (0,
|
|
3384
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(SlidesFormatter, { data });
|
|
3329
3385
|
case "hubspot":
|
|
3330
|
-
return /* @__PURE__ */ (0,
|
|
3386
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(HubspotFormatter, { data });
|
|
3331
3387
|
case "linear":
|
|
3332
|
-
return /* @__PURE__ */ (0,
|
|
3388
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(LinearFormatter, { data });
|
|
3333
3389
|
case "pipedrive":
|
|
3334
|
-
return /* @__PURE__ */ (0,
|
|
3390
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(PipedriveFormatter, { data });
|
|
3335
3391
|
case "compute":
|
|
3336
|
-
return /* @__PURE__ */ (0,
|
|
3392
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ComputeFormatter, { data });
|
|
3337
3393
|
case "resend":
|
|
3338
|
-
return /* @__PURE__ */ (0,
|
|
3394
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ResendFormatter, { data });
|
|
3339
3395
|
case "inbox":
|
|
3340
|
-
return /* @__PURE__ */ (0,
|
|
3396
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(InboxFormatter, { data });
|
|
3341
3397
|
case "discord":
|
|
3342
|
-
return /* @__PURE__ */ (0,
|
|
3398
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(DiscordFormatter, { data });
|
|
3343
3399
|
case "notion":
|
|
3344
|
-
return /* @__PURE__ */ (0,
|
|
3400
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(NotionFormatter, { data });
|
|
3345
3401
|
case "twitter":
|
|
3346
|
-
return /* @__PURE__ */ (0,
|
|
3402
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TwitterFormatter, { data });
|
|
3347
3403
|
case "telegram":
|
|
3348
|
-
return /* @__PURE__ */ (0,
|
|
3404
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TelegramFormatter, { data });
|
|
3349
3405
|
case "stripe":
|
|
3350
|
-
return /* @__PURE__ */ (0,
|
|
3406
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(StripeFormatter, { data });
|
|
3351
3407
|
case "jira":
|
|
3352
|
-
return /* @__PURE__ */ (0,
|
|
3408
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(JiraFormatter, { data });
|
|
3353
3409
|
case "salesforce":
|
|
3354
|
-
return /* @__PURE__ */ (0,
|
|
3410
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(SalesforceFormatter, { data });
|
|
3355
3411
|
case "brevo":
|
|
3356
|
-
return /* @__PURE__ */ (0,
|
|
3412
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(BrevoFormatter, { data });
|
|
3357
3413
|
case "calendly":
|
|
3358
|
-
return /* @__PURE__ */ (0,
|
|
3414
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CalendlyFormatter, { data });
|
|
3359
3415
|
case "twilio":
|
|
3360
|
-
return /* @__PURE__ */ (0,
|
|
3416
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TwilioFormatter, { data });
|
|
3361
3417
|
case "linkedin":
|
|
3362
|
-
return /* @__PURE__ */ (0,
|
|
3418
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(LinkedInFormatter, { data });
|
|
3363
3419
|
case "whatsapp":
|
|
3364
|
-
return /* @__PURE__ */ (0,
|
|
3420
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(WhatsAppFormatter, { data });
|
|
3365
3421
|
case "browser":
|
|
3366
|
-
return /* @__PURE__ */ (0,
|
|
3422
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(BrowserFormatter, { data });
|
|
3423
|
+
case "viewImage":
|
|
3424
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ViewImageFormatter, { data });
|
|
3367
3425
|
default:
|
|
3368
|
-
return /* @__PURE__ */ (0,
|
|
3426
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GenericFormatter, { data });
|
|
3369
3427
|
}
|
|
3370
3428
|
}
|
|
3371
3429
|
function SupyagentToolResult({ part }) {
|
|
@@ -3380,7 +3438,7 @@ function SupyagentToolResult({ part }) {
|
|
|
3380
3438
|
const formatterType = getFormatterType(toolName);
|
|
3381
3439
|
const data = maybeNormalize(toolName, formatterType, result);
|
|
3382
3440
|
const summary = getSummary(formatterType, data, toolName);
|
|
3383
|
-
return /* @__PURE__ */ (0,
|
|
3441
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3384
3442
|
CollapsibleResult,
|
|
3385
3443
|
{
|
|
3386
3444
|
toolName,
|
|
@@ -3393,7 +3451,7 @@ function SupyagentToolResult({ part }) {
|
|
|
3393
3451
|
|
|
3394
3452
|
// src/ui/tool-input.tsx
|
|
3395
3453
|
var import_react2 = __toESM(require("react"), 1);
|
|
3396
|
-
var
|
|
3454
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
3397
3455
|
function formatValue(value) {
|
|
3398
3456
|
if (value === null || value === void 0) {
|
|
3399
3457
|
return { text: "null", muted: true };
|
|
@@ -3427,19 +3485,19 @@ function formatValue(value) {
|
|
|
3427
3485
|
}
|
|
3428
3486
|
function ToolInput({ args }) {
|
|
3429
3487
|
if (!args || Object.keys(args).length === 0) return null;
|
|
3430
|
-
return /* @__PURE__ */ (0,
|
|
3488
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "grid grid-cols-[auto_1fr] gap-x-4 gap-y-1 text-sm", children: Object.entries(args).map(([key, value]) => {
|
|
3431
3489
|
const formatted = formatValue(value);
|
|
3432
|
-
return /* @__PURE__ */ (0,
|
|
3433
|
-
/* @__PURE__ */ (0,
|
|
3434
|
-
/* @__PURE__ */ (0,
|
|
3490
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_react2.default.Fragment, { children: [
|
|
3491
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-muted-foreground select-none", children: key }),
|
|
3492
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: formatted.muted ? "text-muted-foreground" : "text-foreground", children: formatted.text })
|
|
3435
3493
|
] }, key);
|
|
3436
3494
|
}) });
|
|
3437
3495
|
}
|
|
3438
3496
|
|
|
3439
3497
|
// src/ui/tool-action.tsx
|
|
3440
3498
|
var import_react3 = require("react");
|
|
3441
|
-
var
|
|
3442
|
-
var
|
|
3499
|
+
var import_lucide_react32 = require("lucide-react");
|
|
3500
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
3443
3501
|
var BADGE_STYLES2 = {
|
|
3444
3502
|
default: "bg-muted text-muted-foreground",
|
|
3445
3503
|
success: "bg-green-500/10 text-green-500",
|
|
@@ -3472,59 +3530,59 @@ function SupyagentToolAction({ part, defaultExpanded = false }) {
|
|
|
3472
3530
|
const hasArgs = args && Object.keys(args).length > 0;
|
|
3473
3531
|
const hasExpandableContent = hasArgs || formatterOutput;
|
|
3474
3532
|
const canExpand = !isStreaming && hasExpandableContent;
|
|
3475
|
-
return /* @__PURE__ */ (0,
|
|
3533
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
3476
3534
|
"div",
|
|
3477
3535
|
{
|
|
3478
3536
|
className: "rounded-lg border border-border bg-card overflow-hidden",
|
|
3479
3537
|
"data-state": isDone ? "done" : isError ? "error" : isStreaming ? "streaming" : "pending",
|
|
3480
3538
|
children: [
|
|
3481
|
-
/* @__PURE__ */ (0,
|
|
3539
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
3482
3540
|
"button",
|
|
3483
3541
|
{
|
|
3484
3542
|
type: "button",
|
|
3485
3543
|
onClick: () => canExpand && setExpanded(!expanded),
|
|
3486
3544
|
className: `flex items-center gap-2 w-full px-3 py-2 text-left transition-colors ${canExpand ? "hover:bg-muted cursor-pointer" : "cursor-default"}`,
|
|
3487
3545
|
children: [
|
|
3488
|
-
/* @__PURE__ */ (0,
|
|
3489
|
-
/* @__PURE__ */ (0,
|
|
3490
|
-
isStreaming && /* @__PURE__ */ (0,
|
|
3546
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "relative shrink-0", children: [
|
|
3547
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ProviderIcon, { toolName, className: "h-4 w-4 text-muted-foreground" }),
|
|
3548
|
+
isStreaming && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react32.Loader2, { className: "absolute -top-1 -right-1 h-3 w-3 text-primary animate-spin" })
|
|
3491
3549
|
] }),
|
|
3492
|
-
/* @__PURE__ */ (0,
|
|
3493
|
-
/* @__PURE__ */ (0,
|
|
3494
|
-
summary && /* @__PURE__ */ (0,
|
|
3495
|
-
/* @__PURE__ */ (0,
|
|
3496
|
-
/* @__PURE__ */ (0,
|
|
3550
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-xs text-muted-foreground", children: providerLabel }),
|
|
3551
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-sm text-foreground", children: actionLabel }),
|
|
3552
|
+
summary && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
3553
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-muted-foreground text-xs", children: "\xB7" }),
|
|
3554
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-sm text-muted-foreground flex-1 truncate", children: summary.text })
|
|
3497
3555
|
] }),
|
|
3498
|
-
!summary && /* @__PURE__ */ (0,
|
|
3499
|
-
summary?.badge && /* @__PURE__ */ (0,
|
|
3556
|
+
!summary && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "flex-1" }),
|
|
3557
|
+
summary?.badge && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3500
3558
|
"span",
|
|
3501
3559
|
{
|
|
3502
3560
|
className: `inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium shrink-0 ${BADGE_STYLES2[summary.badge.variant || "default"]}`,
|
|
3503
3561
|
children: summary.badge.text
|
|
3504
3562
|
}
|
|
3505
3563
|
),
|
|
3506
|
-
isDone && /* @__PURE__ */ (0,
|
|
3507
|
-
isError && /* @__PURE__ */ (0,
|
|
3508
|
-
/* @__PURE__ */ (0,
|
|
3564
|
+
isDone && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react32.Check, { className: "h-3.5 w-3.5 text-green-500 shrink-0" }),
|
|
3565
|
+
isError && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { className: "inline-flex items-center gap-1 rounded-full bg-destructive/10 px-2 py-0.5 text-xs text-destructive shrink-0", children: [
|
|
3566
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react32.AlertCircle, { className: "h-3 w-3" }),
|
|
3509
3567
|
"Error"
|
|
3510
3568
|
] }),
|
|
3511
|
-
isStreaming && /* @__PURE__ */ (0,
|
|
3512
|
-
canExpand && (expanded ? /* @__PURE__ */ (0,
|
|
3569
|
+
isStreaming && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "inline-flex items-center gap-1 rounded-full bg-primary/10 px-2 py-0.5 text-xs text-primary animate-pulse shrink-0", children: "Calling..." }),
|
|
3570
|
+
canExpand && (expanded ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react32.ChevronDown, { className: "h-3.5 w-3.5 text-muted-foreground shrink-0" }) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react32.ChevronRight, { className: "h-3.5 w-3.5 text-muted-foreground shrink-0" }))
|
|
3513
3571
|
]
|
|
3514
3572
|
}
|
|
3515
3573
|
),
|
|
3516
|
-
/* @__PURE__ */ (0,
|
|
3574
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3517
3575
|
"div",
|
|
3518
3576
|
{
|
|
3519
3577
|
className: "grid transition-[grid-template-rows] duration-200 ease-out",
|
|
3520
3578
|
style: { gridTemplateRows: expanded ? "1fr" : "0fr" },
|
|
3521
|
-
children: /* @__PURE__ */ (0,
|
|
3522
|
-
args && Object.keys(args).length > 0 && /* @__PURE__ */ (0,
|
|
3523
|
-
/* @__PURE__ */ (0,
|
|
3524
|
-
/* @__PURE__ */ (0,
|
|
3579
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "border-t border-border px-3 py-2 space-y-3", children: [
|
|
3580
|
+
args && Object.keys(args).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { children: [
|
|
3581
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-[10px] font-medium uppercase tracking-wider text-muted-foreground mb-1.5", children: "Input" }),
|
|
3582
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ToolInput, { args })
|
|
3525
3583
|
] }),
|
|
3526
|
-
formatterOutput && /* @__PURE__ */ (0,
|
|
3527
|
-
/* @__PURE__ */ (0,
|
|
3584
|
+
formatterOutput && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { children: [
|
|
3585
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-[10px] font-medium uppercase tracking-wider text-muted-foreground mb-1.5", children: "Output" }),
|
|
3528
3586
|
formatterOutput
|
|
3529
3587
|
] })
|
|
3530
3588
|
] }) })
|
|
@@ -3537,8 +3595,8 @@ function SupyagentToolAction({ part, defaultExpanded = false }) {
|
|
|
3537
3595
|
|
|
3538
3596
|
// src/ui/tool-call.tsx
|
|
3539
3597
|
var import_react4 = require("react");
|
|
3540
|
-
var
|
|
3541
|
-
var
|
|
3598
|
+
var import_lucide_react33 = require("lucide-react");
|
|
3599
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
3542
3600
|
function extractToolName2(part) {
|
|
3543
3601
|
if (part.type.startsWith("tool-") && part.type !== "tool-invocation") {
|
|
3544
3602
|
return part.type.slice(5);
|
|
@@ -3567,39 +3625,39 @@ function SupyagentToolCall({ part }) {
|
|
|
3567
3625
|
const isStreaming = state === "input-streaming";
|
|
3568
3626
|
const isError = state === "output-error";
|
|
3569
3627
|
const isDone = state === "output-available";
|
|
3570
|
-
return /* @__PURE__ */ (0,
|
|
3628
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
3571
3629
|
"div",
|
|
3572
3630
|
{
|
|
3573
3631
|
className: "rounded-lg border border-border bg-card overflow-hidden",
|
|
3574
3632
|
"data-state": isDone ? "done" : isError ? "error" : isStreaming ? "streaming" : "pending",
|
|
3575
3633
|
children: [
|
|
3576
|
-
/* @__PURE__ */ (0,
|
|
3634
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
3577
3635
|
"button",
|
|
3578
3636
|
{
|
|
3579
3637
|
type: "button",
|
|
3580
3638
|
onClick: () => args && setExpanded(!expanded),
|
|
3581
3639
|
className: "flex items-center gap-2 w-full px-3 py-2 text-left hover:bg-muted transition-colors",
|
|
3582
3640
|
children: [
|
|
3583
|
-
/* @__PURE__ */ (0,
|
|
3584
|
-
/* @__PURE__ */ (0,
|
|
3585
|
-
isStreaming && /* @__PURE__ */ (0,
|
|
3641
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "relative", children: [
|
|
3642
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ProviderIcon, { toolName, className: "h-4 w-4 text-muted-foreground" }),
|
|
3643
|
+
isStreaming && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react33.Loader2, { className: "absolute -top-1 -right-1 h-3 w-3 text-primary animate-spin" })
|
|
3586
3644
|
] }),
|
|
3587
|
-
/* @__PURE__ */ (0,
|
|
3588
|
-
/* @__PURE__ */ (0,
|
|
3589
|
-
isDone && /* @__PURE__ */ (0,
|
|
3590
|
-
/* @__PURE__ */ (0,
|
|
3645
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "text-xs text-muted-foreground", children: providerLabel }),
|
|
3646
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "text-sm text-foreground flex-1", children: actionLabel }),
|
|
3647
|
+
isDone && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: "inline-flex items-center gap-1 rounded-full bg-green-500/10 px-2 py-0.5 text-xs text-green-500", children: [
|
|
3648
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react33.Check, { className: "h-3 w-3" }),
|
|
3591
3649
|
"Completed"
|
|
3592
3650
|
] }),
|
|
3593
|
-
isError && /* @__PURE__ */ (0,
|
|
3594
|
-
/* @__PURE__ */ (0,
|
|
3651
|
+
isError && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: "inline-flex items-center gap-1 rounded-full bg-destructive/10 px-2 py-0.5 text-xs text-destructive", children: [
|
|
3652
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react33.AlertCircle, { className: "h-3 w-3" }),
|
|
3595
3653
|
"Error"
|
|
3596
3654
|
] }),
|
|
3597
|
-
isStreaming && /* @__PURE__ */ (0,
|
|
3598
|
-
args && (expanded ? /* @__PURE__ */ (0,
|
|
3655
|
+
isStreaming && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "inline-flex items-center gap-1 rounded-full bg-primary/10 px-2 py-0.5 text-xs text-primary animate-pulse", children: "Calling..." }),
|
|
3656
|
+
args && (expanded ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react33.ChevronDown, { className: "h-3.5 w-3.5 text-muted-foreground" }) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react33.ChevronRight, { className: "h-3.5 w-3.5 text-muted-foreground" }))
|
|
3599
3657
|
]
|
|
3600
3658
|
}
|
|
3601
3659
|
),
|
|
3602
|
-
expanded && args && /* @__PURE__ */ (0,
|
|
3660
|
+
expanded && args && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "border-t border-border px-3 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("pre", { className: "text-xs text-muted-foreground overflow-x-auto", children: JSON.stringify(args, null, 2) }) })
|
|
3603
3661
|
]
|
|
3604
3662
|
}
|
|
3605
3663
|
);
|
|
@@ -3607,6 +3665,7 @@ function SupyagentToolCall({ part }) {
|
|
|
3607
3665
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3608
3666
|
0 && (module.exports = {
|
|
3609
3667
|
BrevoFormatter,
|
|
3668
|
+
BrowserFormatter,
|
|
3610
3669
|
CalendarEventFormatter,
|
|
3611
3670
|
CalendlyFormatter,
|
|
3612
3671
|
CollapsibleResult,
|
|
@@ -3640,6 +3699,8 @@ function SupyagentToolCall({ part }) {
|
|
|
3640
3699
|
ToolInput,
|
|
3641
3700
|
TwilioFormatter,
|
|
3642
3701
|
TwitterFormatter,
|
|
3702
|
+
ViewImageFormatter,
|
|
3703
|
+
WhatsAppFormatter,
|
|
3643
3704
|
extractArgs,
|
|
3644
3705
|
extractResult,
|
|
3645
3706
|
extractState,
|