@supyagent/sdk 0.1.19 → 0.1.20
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 +66 -1
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +66 -1
- package/dist/react.js.map +1 -1
- package/package.json +10 -10
package/dist/react.cjs
CHANGED
|
@@ -124,7 +124,10 @@ var PROVIDER_LABELS = {
|
|
|
124
124
|
salesforce: "Salesforce",
|
|
125
125
|
brevo: "Brevo",
|
|
126
126
|
calendly: "Calendly",
|
|
127
|
-
twilio: "Twilio"
|
|
127
|
+
twilio: "Twilio",
|
|
128
|
+
image: "Image",
|
|
129
|
+
audio: "Audio",
|
|
130
|
+
video: "Video"
|
|
128
131
|
};
|
|
129
132
|
function getProviderLabel(provider) {
|
|
130
133
|
return PROVIDER_LABELS[provider] || provider.charAt(0).toUpperCase() + provider.slice(1);
|
|
@@ -196,6 +199,15 @@ function getFormatterType(toolName) {
|
|
|
196
199
|
return "twilio";
|
|
197
200
|
case "linkedin":
|
|
198
201
|
return "linkedin";
|
|
202
|
+
case "image":
|
|
203
|
+
return "image";
|
|
204
|
+
case "tts":
|
|
205
|
+
case "stt":
|
|
206
|
+
return "audio";
|
|
207
|
+
case "video":
|
|
208
|
+
return "video";
|
|
209
|
+
case "ocr":
|
|
210
|
+
return "generic";
|
|
199
211
|
case "bash":
|
|
200
212
|
case "shell":
|
|
201
213
|
return "bash";
|
|
@@ -608,6 +620,56 @@ function getLinkedinSummary(data) {
|
|
|
608
620
|
}
|
|
609
621
|
return { text: "LinkedIn result" };
|
|
610
622
|
}
|
|
623
|
+
function getImageSummary(data, toolName) {
|
|
624
|
+
if (typeof data === "object" && data !== null) {
|
|
625
|
+
const d = data;
|
|
626
|
+
if (d.status === "processing" || d.poll_url) {
|
|
627
|
+
return { text: "Generating image...", badge: { text: "processing", variant: "warning" } };
|
|
628
|
+
}
|
|
629
|
+
if (d.image_url) {
|
|
630
|
+
return { text: "Image generated", badge: { text: "done", variant: "success" } };
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
return { text: humanizeToolName(toolName) };
|
|
634
|
+
}
|
|
635
|
+
function getAudioSummary(data, toolName) {
|
|
636
|
+
const isTTS = toolName.toLowerCase().startsWith("tts");
|
|
637
|
+
if (typeof data === "object" && data !== null) {
|
|
638
|
+
const d = data;
|
|
639
|
+
if (d.status === "processing" || d.poll_url) {
|
|
640
|
+
return {
|
|
641
|
+
text: isTTS ? "Generating audio..." : "Transcribing...",
|
|
642
|
+
badge: { text: "processing", variant: "warning" }
|
|
643
|
+
};
|
|
644
|
+
}
|
|
645
|
+
if (d.audio_url) {
|
|
646
|
+
return { text: "Audio generated", badge: { text: "done", variant: "success" } };
|
|
647
|
+
}
|
|
648
|
+
if (d.result && typeof d.result === "object" && "text" in d.result) {
|
|
649
|
+
return { text: "Transcription complete", badge: { text: "done", variant: "success" } };
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
return { text: isTTS ? "Text-to-speech" : "Transcription" };
|
|
653
|
+
}
|
|
654
|
+
function getVideoSummary(data, toolName) {
|
|
655
|
+
const isUnderstand = toolName.toLowerCase().includes("understand");
|
|
656
|
+
if (typeof data === "object" && data !== null) {
|
|
657
|
+
const d = data;
|
|
658
|
+
if (d.status === "processing" || d.poll_url) {
|
|
659
|
+
return {
|
|
660
|
+
text: isUnderstand ? "Analyzing video..." : "Generating video...",
|
|
661
|
+
badge: { text: "processing", variant: "warning" }
|
|
662
|
+
};
|
|
663
|
+
}
|
|
664
|
+
if (d.answer) {
|
|
665
|
+
return { text: "Video analysis complete", badge: { text: "done", variant: "success" } };
|
|
666
|
+
}
|
|
667
|
+
if (d.result && typeof d.result === "object") {
|
|
668
|
+
return { text: "Video generated", badge: { text: "done", variant: "success" } };
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
return { text: isUnderstand ? "Video analysis" : "Video generation" };
|
|
672
|
+
}
|
|
611
673
|
function getBashSummary(data) {
|
|
612
674
|
if (typeof data !== "object" || data === null) return { text: "Command executed" };
|
|
613
675
|
const d = data;
|
|
@@ -647,6 +709,9 @@ var SUMMARY_MAP = {
|
|
|
647
709
|
calendly: getCalendlySummary,
|
|
648
710
|
twilio: getTwilioSummary,
|
|
649
711
|
linkedin: getLinkedinSummary,
|
|
712
|
+
image: getImageSummary,
|
|
713
|
+
audio: getAudioSummary,
|
|
714
|
+
video: getVideoSummary,
|
|
650
715
|
bash: getBashSummary,
|
|
651
716
|
generic: getGenericSummary
|
|
652
717
|
};
|