@supyagent/sdk 0.1.25 → 0.1.36

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.d.cts CHANGED
@@ -21,7 +21,7 @@ declare function getProviderLabel(provider: string): string;
21
21
  /**
22
22
  * Determine which formatter to use based on tool name prefix.
23
23
  */
24
- type FormatterType = "email" | "calendar" | "slack" | "github" | "drive" | "search" | "docs" | "sheets" | "slides" | "hubspot" | "linear" | "pipedrive" | "compute" | "resend" | "inbox" | "discord" | "notion" | "twitter" | "telegram" | "stripe" | "jira" | "salesforce" | "brevo" | "calendly" | "twilio" | "linkedin" | "bash" | "image" | "audio" | "video" | "whatsapp" | "browser" | "viewImage" | "generic";
24
+ type FormatterType = "email" | "calendar" | "slack" | "github" | "drive" | "search" | "docs" | "sheets" | "slides" | "hubspot" | "linear" | "pipedrive" | "compute" | "resend" | "inbox" | "discord" | "notion" | "twitter" | "telegram" | "stripe" | "jira" | "salesforce" | "brevo" | "calendly" | "twilio" | "linkedin" | "bash" | "image" | "audio" | "video" | "whatsapp" | "browser" | "viewImage" | "jobs" | "generic";
25
25
  declare function getFormatterType(toolName: string): FormatterType;
26
26
  /**
27
27
  * Resolve a virtual tool name for rendering purposes.
package/dist/react.d.ts CHANGED
@@ -21,7 +21,7 @@ declare function getProviderLabel(provider: string): string;
21
21
  /**
22
22
  * Determine which formatter to use based on tool name prefix.
23
23
  */
24
- type FormatterType = "email" | "calendar" | "slack" | "github" | "drive" | "search" | "docs" | "sheets" | "slides" | "hubspot" | "linear" | "pipedrive" | "compute" | "resend" | "inbox" | "discord" | "notion" | "twitter" | "telegram" | "stripe" | "jira" | "salesforce" | "brevo" | "calendly" | "twilio" | "linkedin" | "bash" | "image" | "audio" | "video" | "whatsapp" | "browser" | "viewImage" | "generic";
24
+ type FormatterType = "email" | "calendar" | "slack" | "github" | "drive" | "search" | "docs" | "sheets" | "slides" | "hubspot" | "linear" | "pipedrive" | "compute" | "resend" | "inbox" | "discord" | "notion" | "twitter" | "telegram" | "stripe" | "jira" | "salesforce" | "brevo" | "calendly" | "twilio" | "linkedin" | "bash" | "image" | "audio" | "video" | "whatsapp" | "browser" | "viewImage" | "jobs" | "generic";
25
25
  declare function getFormatterType(toolName: string): FormatterType;
26
26
  /**
27
27
  * Resolve a virtual tool name for rendering purposes.
package/dist/react.js CHANGED
@@ -136,6 +136,8 @@ function getFormatterType(toolName) {
136
136
  return "drive";
137
137
  case "radar":
138
138
  return "search";
139
+ case "jobs":
140
+ return "jobs";
139
141
  case "image":
140
142
  return "image";
141
143
  case "tts":
@@ -159,7 +161,11 @@ function resolveToolName(rawToolName, args) {
159
161
  const path = typeof args.path === "string" ? args.path : "";
160
162
  const stripped = path.replace(/^\/api\/v1\//, "");
161
163
  if (!stripped || stripped === path) return rawToolName;
162
- return stripped.split("/").filter(Boolean).join("_");
164
+ const segments = stripped.split("/").filter(Boolean);
165
+ if (segments[0] === "jobs" && segments.length === 2) {
166
+ return "jobs_status";
167
+ }
168
+ return segments.join("_");
163
169
  }
164
170
 
165
171
  // src/ui/collapsible-result.tsx
@@ -703,6 +709,35 @@ function getBashSummary(data) {
703
709
  if (exitCode === 0) return { text: "Command succeeded", badge: { text: "exit 0", variant: "success" } };
704
710
  return { text: `Command failed`, badge: { text: `exit ${exitCode}`, variant: "error" } };
705
711
  }
712
+ function getJobsSummary(data) {
713
+ if (typeof data !== "object" || data === null) return { text: "Job status" };
714
+ const d = data;
715
+ const service = typeof d.service === "string" ? d.service : "";
716
+ const action = typeof d.action === "string" ? d.action : "";
717
+ const label = service ? `${service.charAt(0).toUpperCase() + service.slice(1)}${action ? ` ${action}` : ""}` : "Job";
718
+ if (d.status === "processing") {
719
+ return { text: `Checking ${label.toLowerCase()}...`, badge: { text: "processing", variant: "warning" } };
720
+ }
721
+ if (d.status === "completed") {
722
+ const elapsed = formatElapsed(d.created_at, d.completed_at);
723
+ return { text: elapsed ? `${label} completed in ${elapsed}` : `${label} completed`, badge: { text: "done", variant: "success" } };
724
+ }
725
+ if (d.status === "failed" || d.error) {
726
+ return { text: `${label} failed`, badge: { text: "failed", variant: "error" } };
727
+ }
728
+ return { text: `${label} status` };
729
+ }
730
+ function formatElapsed(start, end) {
731
+ if (typeof start !== "string") return void 0;
732
+ const s = new Date(start).getTime();
733
+ const e = typeof end === "string" ? new Date(end).getTime() : Date.now();
734
+ if (isNaN(s) || isNaN(e)) return void 0;
735
+ const sec = Math.round((e - s) / 1e3);
736
+ if (sec < 60) return `${sec}s`;
737
+ const min = Math.floor(sec / 60);
738
+ const rem = sec % 60;
739
+ return rem > 0 ? `${min}m ${rem}s` : `${min}m`;
740
+ }
706
741
  function getGenericSummary(_data, toolName) {
707
742
  return { text: humanizeToolName(toolName) };
708
743
  }
@@ -740,6 +775,7 @@ var SUMMARY_MAP = {
740
775
  browser: getBrowserSummary,
741
776
  viewImage: getViewImageSummary,
742
777
  bash: getBashSummary,
778
+ jobs: getJobsSummary,
743
779
  generic: getGenericSummary
744
780
  };
745
781
  function getSummary(formatterType, data, toolName) {