@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.d.cts CHANGED
@@ -23,6 +23,12 @@ declare function getProviderLabel(provider: string): string;
23
23
  */
24
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" | "generic";
25
25
  declare function getFormatterType(toolName: string): FormatterType;
26
+ /**
27
+ * Resolve a virtual tool name for rendering purposes.
28
+ * For `apiCall`, derives the tool name from the API path in args.
29
+ * For all other tools, returns the raw name unchanged.
30
+ */
31
+ declare function resolveToolName(rawToolName: string, args?: Record<string, unknown>): string;
26
32
 
27
33
  interface ToolResultPart {
28
34
  type: string;
@@ -261,4 +267,4 @@ interface LinkedInFormatterProps {
261
267
  }
262
268
  declare function LinkedInFormatter({ data }: LinkedInFormatterProps): react_jsx_runtime.JSX.Element;
263
269
 
264
- export { BrevoFormatter, CalendarEventFormatter, CalendlyFormatter, CollapsibleResult, type CollapsibleResultProps, ComputeFormatter, DiscordFormatter, DocsFormatter, DriveFileFormatter, EmailFormatter, type FormatterType, GenericFormatter, GithubFormatter, HubspotFormatter, InboxFormatter, JiraFormatter, LinearFormatter, LinkedInFormatter, NotionFormatter, PROVIDER_LABELS, PipedriveFormatter, ProviderIcon, ResendFormatter, SalesforceFormatter, SearchFormatter, SheetsFormatter, SlackMessageFormatter, SlidesFormatter, StripeFormatter, type SummaryResult, SupyagentToolAction, SupyagentToolCall, SupyagentToolResult, TelegramFormatter, ToolInput, type ToolResultPart, TwilioFormatter, TwitterFormatter, extractArgs, extractResult, extractState, extractToolName, getFormatterType, getProviderFromToolName, getProviderLabel, getSummary, humanizeToolName, maybeNormalize, normalizeMicrosoftCalendar, normalizeMicrosoftDrive, normalizeMicrosoftMail, unwrapSupyagentResult };
270
+ export { BrevoFormatter, CalendarEventFormatter, CalendlyFormatter, CollapsibleResult, type CollapsibleResultProps, ComputeFormatter, DiscordFormatter, DocsFormatter, DriveFileFormatter, EmailFormatter, type FormatterType, GenericFormatter, GithubFormatter, HubspotFormatter, InboxFormatter, JiraFormatter, LinearFormatter, LinkedInFormatter, NotionFormatter, PROVIDER_LABELS, PipedriveFormatter, ProviderIcon, ResendFormatter, SalesforceFormatter, SearchFormatter, SheetsFormatter, SlackMessageFormatter, SlidesFormatter, StripeFormatter, type SummaryResult, SupyagentToolAction, SupyagentToolCall, SupyagentToolResult, TelegramFormatter, ToolInput, type ToolResultPart, TwilioFormatter, TwitterFormatter, extractArgs, extractResult, extractState, extractToolName, getFormatterType, getProviderFromToolName, getProviderLabel, getSummary, humanizeToolName, maybeNormalize, normalizeMicrosoftCalendar, normalizeMicrosoftDrive, normalizeMicrosoftMail, resolveToolName, unwrapSupyagentResult };
package/dist/react.d.ts CHANGED
@@ -23,6 +23,12 @@ declare function getProviderLabel(provider: string): string;
23
23
  */
24
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" | "generic";
25
25
  declare function getFormatterType(toolName: string): FormatterType;
26
+ /**
27
+ * Resolve a virtual tool name for rendering purposes.
28
+ * For `apiCall`, derives the tool name from the API path in args.
29
+ * For all other tools, returns the raw name unchanged.
30
+ */
31
+ declare function resolveToolName(rawToolName: string, args?: Record<string, unknown>): string;
26
32
 
27
33
  interface ToolResultPart {
28
34
  type: string;
@@ -261,4 +267,4 @@ interface LinkedInFormatterProps {
261
267
  }
262
268
  declare function LinkedInFormatter({ data }: LinkedInFormatterProps): react_jsx_runtime.JSX.Element;
263
269
 
264
- export { BrevoFormatter, CalendarEventFormatter, CalendlyFormatter, CollapsibleResult, type CollapsibleResultProps, ComputeFormatter, DiscordFormatter, DocsFormatter, DriveFileFormatter, EmailFormatter, type FormatterType, GenericFormatter, GithubFormatter, HubspotFormatter, InboxFormatter, JiraFormatter, LinearFormatter, LinkedInFormatter, NotionFormatter, PROVIDER_LABELS, PipedriveFormatter, ProviderIcon, ResendFormatter, SalesforceFormatter, SearchFormatter, SheetsFormatter, SlackMessageFormatter, SlidesFormatter, StripeFormatter, type SummaryResult, SupyagentToolAction, SupyagentToolCall, SupyagentToolResult, TelegramFormatter, ToolInput, type ToolResultPart, TwilioFormatter, TwitterFormatter, extractArgs, extractResult, extractState, extractToolName, getFormatterType, getProviderFromToolName, getProviderLabel, getSummary, humanizeToolName, maybeNormalize, normalizeMicrosoftCalendar, normalizeMicrosoftDrive, normalizeMicrosoftMail, unwrapSupyagentResult };
270
+ export { BrevoFormatter, CalendarEventFormatter, CalendlyFormatter, CollapsibleResult, type CollapsibleResultProps, ComputeFormatter, DiscordFormatter, DocsFormatter, DriveFileFormatter, EmailFormatter, type FormatterType, GenericFormatter, GithubFormatter, HubspotFormatter, InboxFormatter, JiraFormatter, LinearFormatter, LinkedInFormatter, NotionFormatter, PROVIDER_LABELS, PipedriveFormatter, ProviderIcon, ResendFormatter, SalesforceFormatter, SearchFormatter, SheetsFormatter, SlackMessageFormatter, SlidesFormatter, StripeFormatter, type SummaryResult, SupyagentToolAction, SupyagentToolCall, SupyagentToolResult, TelegramFormatter, ToolInput, type ToolResultPart, TwilioFormatter, TwitterFormatter, extractArgs, extractResult, extractState, extractToolName, getFormatterType, getProviderFromToolName, getProviderLabel, getSummary, humanizeToolName, maybeNormalize, normalizeMicrosoftCalendar, normalizeMicrosoftDrive, normalizeMicrosoftMail, resolveToolName, unwrapSupyagentResult };
package/dist/react.js CHANGED
@@ -124,6 +124,8 @@ function getFormatterType(toolName) {
124
124
  return "audio";
125
125
  case "video":
126
126
  return "video";
127
+ case "code":
128
+ return "compute";
127
129
  case "ocr":
128
130
  return "generic";
129
131
  case "bash":
@@ -133,6 +135,13 @@ function getFormatterType(toolName) {
133
135
  return "generic";
134
136
  }
135
137
  }
138
+ function resolveToolName(rawToolName, args) {
139
+ if (rawToolName !== "apiCall" || !args) return rawToolName;
140
+ const path = typeof args.path === "string" ? args.path : "";
141
+ const stripped = path.replace(/^\/api\/v1\//, "");
142
+ if (!stripped || stripped === path) return rawToolName;
143
+ return stripped.split("/").filter(Boolean).join("_");
144
+ }
136
145
 
137
146
  // src/ui/collapsible-result.tsx
138
147
  import { useState } from "react";
@@ -3128,7 +3137,9 @@ function renderFormatter(formatterType, data) {
3128
3137
  function SupyagentToolResult({ part }) {
3129
3138
  const state = extractState(part);
3130
3139
  const result = extractResult(part);
3131
- const toolName = extractToolName(part);
3140
+ const rawToolName = extractToolName(part);
3141
+ const args = extractArgs(part);
3142
+ const toolName = resolveToolName(rawToolName, args);
3132
3143
  if (state !== "output-available" || result === void 0) {
3133
3144
  return null;
3134
3145
  }
@@ -3407,6 +3418,7 @@ export {
3407
3418
  normalizeMicrosoftCalendar,
3408
3419
  normalizeMicrosoftDrive,
3409
3420
  normalizeMicrosoftMail,
3421
+ resolveToolName,
3410
3422
  unwrapSupyagentResult
3411
3423
  };
3412
3424
  //# sourceMappingURL=react.js.map