@supyagent/sdk 0.1.11 → 0.1.12
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 +787 -769
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +71 -39
- package/dist/react.d.ts +71 -39
- package/dist/react.js +761 -754
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
package/dist/react.cjs
CHANGED
|
@@ -48,6 +48,7 @@ __export(react_exports, {
|
|
|
48
48
|
LinearFormatter: () => LinearFormatter,
|
|
49
49
|
LinkedInFormatter: () => LinkedInFormatter,
|
|
50
50
|
NotionFormatter: () => NotionFormatter,
|
|
51
|
+
PROVIDER_LABELS: () => PROVIDER_LABELS,
|
|
51
52
|
PipedriveFormatter: () => PipedriveFormatter,
|
|
52
53
|
ProviderIcon: () => ProviderIcon,
|
|
53
54
|
ResendFormatter: () => ResendFormatter,
|
|
@@ -64,20 +65,23 @@ __export(react_exports, {
|
|
|
64
65
|
ToolInput: () => ToolInput,
|
|
65
66
|
TwilioFormatter: () => TwilioFormatter,
|
|
66
67
|
TwitterFormatter: () => TwitterFormatter,
|
|
68
|
+
extractArgs: () => extractArgs,
|
|
69
|
+
extractResult: () => extractResult,
|
|
70
|
+
extractState: () => extractState,
|
|
71
|
+
extractToolName: () => extractToolName,
|
|
72
|
+
getFormatterType: () => getFormatterType,
|
|
67
73
|
getProviderFromToolName: () => getProviderFromToolName,
|
|
68
74
|
getProviderLabel: () => getProviderLabel,
|
|
69
75
|
getSummary: () => getSummary,
|
|
70
|
-
humanizeToolName: () => humanizeToolName
|
|
76
|
+
humanizeToolName: () => humanizeToolName,
|
|
77
|
+
maybeNormalize: () => maybeNormalize,
|
|
78
|
+
normalizeMicrosoftCalendar: () => normalizeMicrosoftCalendar,
|
|
79
|
+
normalizeMicrosoftDrive: () => normalizeMicrosoftDrive,
|
|
80
|
+
normalizeMicrosoftMail: () => normalizeMicrosoftMail,
|
|
81
|
+
unwrapSupyagentResult: () => unwrapSupyagentResult
|
|
71
82
|
});
|
|
72
83
|
module.exports = __toCommonJS(react_exports);
|
|
73
84
|
|
|
74
|
-
// src/ui/tool-call.tsx
|
|
75
|
-
var import_react = require("react");
|
|
76
|
-
var import_lucide_react2 = require("lucide-react");
|
|
77
|
-
|
|
78
|
-
// src/ui/provider-icon.tsx
|
|
79
|
-
var import_lucide_react = require("lucide-react");
|
|
80
|
-
|
|
81
85
|
// src/ui/utils.ts
|
|
82
86
|
function getProviderFromToolName(toolName) {
|
|
83
87
|
const idx = toolName.indexOf("_");
|
|
@@ -197,7 +201,12 @@ function getFormatterType(toolName) {
|
|
|
197
201
|
}
|
|
198
202
|
}
|
|
199
203
|
|
|
204
|
+
// src/ui/collapsible-result.tsx
|
|
205
|
+
var import_react = require("react");
|
|
206
|
+
var import_lucide_react2 = require("lucide-react");
|
|
207
|
+
|
|
200
208
|
// src/ui/provider-icon.tsx
|
|
209
|
+
var import_lucide_react = require("lucide-react");
|
|
201
210
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
202
211
|
var ICON_MAP = {
|
|
203
212
|
gmail: import_lucide_react.Mail,
|
|
@@ -236,78 +245,8 @@ function ProviderIcon({ toolName, className = "h-4 w-4" }) {
|
|
|
236
245
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { className });
|
|
237
246
|
}
|
|
238
247
|
|
|
239
|
-
// src/ui/tool-call.tsx
|
|
240
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
241
|
-
function extractToolName(part) {
|
|
242
|
-
if (part.type.startsWith("tool-") && part.type !== "tool-invocation") {
|
|
243
|
-
return part.type.slice(5);
|
|
244
|
-
}
|
|
245
|
-
if (part.type === "dynamic-tool" && part.toolName) {
|
|
246
|
-
return part.toolName;
|
|
247
|
-
}
|
|
248
|
-
if (part.toolName) return part.toolName;
|
|
249
|
-
if (part.toolInvocation?.toolName) return part.toolInvocation.toolName;
|
|
250
|
-
return "unknown";
|
|
251
|
-
}
|
|
252
|
-
function extractState(part) {
|
|
253
|
-
return part.state || part.toolInvocation?.state || "input-available";
|
|
254
|
-
}
|
|
255
|
-
function extractArgs(part) {
|
|
256
|
-
return part.input || part.args || part.toolInvocation?.args;
|
|
257
|
-
}
|
|
258
|
-
function SupyagentToolCall({ part }) {
|
|
259
|
-
const [expanded, setExpanded] = (0, import_react.useState)(false);
|
|
260
|
-
const toolName = extractToolName(part);
|
|
261
|
-
const state = extractState(part);
|
|
262
|
-
const args = extractArgs(part);
|
|
263
|
-
const provider = getProviderFromToolName(toolName);
|
|
264
|
-
const providerLabel = getProviderLabel(provider);
|
|
265
|
-
const actionLabel = humanizeToolName(toolName);
|
|
266
|
-
const isStreaming = state === "input-streaming";
|
|
267
|
-
const isError = state === "output-error";
|
|
268
|
-
const isDone = state === "output-available";
|
|
269
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
270
|
-
"div",
|
|
271
|
-
{
|
|
272
|
-
className: "rounded-lg border border-border bg-card overflow-hidden",
|
|
273
|
-
"data-state": isDone ? "done" : isError ? "error" : isStreaming ? "streaming" : "pending",
|
|
274
|
-
children: [
|
|
275
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
276
|
-
"button",
|
|
277
|
-
{
|
|
278
|
-
type: "button",
|
|
279
|
-
onClick: () => args && setExpanded(!expanded),
|
|
280
|
-
className: "flex items-center gap-2 w-full px-3 py-2 text-left hover:bg-muted transition-colors",
|
|
281
|
-
children: [
|
|
282
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "relative", children: [
|
|
283
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ProviderIcon, { toolName, className: "h-4 w-4 text-muted-foreground" }),
|
|
284
|
-
isStreaming && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_lucide_react2.Loader2, { className: "absolute -top-1 -right-1 h-3 w-3 text-primary animate-spin" })
|
|
285
|
-
] }),
|
|
286
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "text-xs text-muted-foreground", children: providerLabel }),
|
|
287
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "text-sm text-foreground flex-1", children: actionLabel }),
|
|
288
|
-
isDone && /* @__PURE__ */ (0, import_jsx_runtime2.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: [
|
|
289
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_lucide_react2.Check, { className: "h-3 w-3" }),
|
|
290
|
-
"Completed"
|
|
291
|
-
] }),
|
|
292
|
-
isError && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: "inline-flex items-center gap-1 rounded-full bg-destructive/10 px-2 py-0.5 text-xs text-destructive", children: [
|
|
293
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_lucide_react2.AlertCircle, { className: "h-3 w-3" }),
|
|
294
|
-
"Error"
|
|
295
|
-
] }),
|
|
296
|
-
isStreaming && /* @__PURE__ */ (0, import_jsx_runtime2.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..." }),
|
|
297
|
-
args && (expanded ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_lucide_react2.ChevronDown, { className: "h-3.5 w-3.5 text-muted-foreground" }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_lucide_react2.ChevronRight, { className: "h-3.5 w-3.5 text-muted-foreground" }))
|
|
298
|
-
]
|
|
299
|
-
}
|
|
300
|
-
),
|
|
301
|
-
expanded && args && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "border-t border-border px-3 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("pre", { className: "text-xs text-muted-foreground overflow-x-auto", children: JSON.stringify(args, null, 2) }) })
|
|
302
|
-
]
|
|
303
|
-
}
|
|
304
|
-
);
|
|
305
|
-
}
|
|
306
|
-
|
|
307
248
|
// src/ui/collapsible-result.tsx
|
|
308
|
-
var
|
|
309
|
-
var import_lucide_react3 = require("lucide-react");
|
|
310
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
249
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
311
250
|
var BADGE_STYLES = {
|
|
312
251
|
default: "bg-muted text-muted-foreground",
|
|
313
252
|
success: "bg-green-500/10 text-green-500",
|
|
@@ -321,37 +260,37 @@ function CollapsibleResult({
|
|
|
321
260
|
defaultExpanded = false,
|
|
322
261
|
children
|
|
323
262
|
}) {
|
|
324
|
-
const [expanded, setExpanded] = (0,
|
|
263
|
+
const [expanded, setExpanded] = (0, import_react.useState)(defaultExpanded);
|
|
325
264
|
const provider = getProviderFromToolName(toolName);
|
|
326
265
|
const providerLabel = getProviderLabel(provider);
|
|
327
|
-
return /* @__PURE__ */ (0,
|
|
328
|
-
/* @__PURE__ */ (0,
|
|
266
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "rounded-lg border border-border bg-card overflow-hidden", children: [
|
|
267
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
329
268
|
"button",
|
|
330
269
|
{
|
|
331
270
|
type: "button",
|
|
332
271
|
onClick: () => setExpanded(!expanded),
|
|
333
272
|
className: "flex items-center gap-2 w-full px-3 py-2 text-left hover:bg-muted transition-colors",
|
|
334
273
|
children: [
|
|
335
|
-
/* @__PURE__ */ (0,
|
|
336
|
-
/* @__PURE__ */ (0,
|
|
337
|
-
/* @__PURE__ */ (0,
|
|
338
|
-
badge && /* @__PURE__ */ (0,
|
|
274
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ProviderIcon, { toolName, className: "h-4 w-4 text-muted-foreground" }),
|
|
275
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "text-xs text-muted-foreground", children: providerLabel }),
|
|
276
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "text-sm text-foreground flex-1 truncate", children: summary }),
|
|
277
|
+
badge && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
339
278
|
"span",
|
|
340
279
|
{
|
|
341
280
|
className: `inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${BADGE_STYLES[badge.variant || "default"]}`,
|
|
342
281
|
children: badge.text
|
|
343
282
|
}
|
|
344
283
|
),
|
|
345
|
-
expanded ? /* @__PURE__ */ (0,
|
|
284
|
+
expanded ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_lucide_react2.ChevronDown, { className: "h-3.5 w-3.5 text-muted-foreground shrink-0" }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_lucide_react2.ChevronRight, { className: "h-3.5 w-3.5 text-muted-foreground shrink-0" })
|
|
346
285
|
]
|
|
347
286
|
}
|
|
348
287
|
),
|
|
349
|
-
/* @__PURE__ */ (0,
|
|
288
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
350
289
|
"div",
|
|
351
290
|
{
|
|
352
291
|
className: "grid transition-[grid-template-rows] duration-200 ease-out",
|
|
353
292
|
style: { gridTemplateRows: expanded ? "1fr" : "0fr" },
|
|
354
|
-
children: /* @__PURE__ */ (0,
|
|
293
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "border-t border-border px-3 py-2", children }) })
|
|
355
294
|
}
|
|
356
295
|
)
|
|
357
296
|
] });
|
|
@@ -787,8 +726,8 @@ function normalizeMicrosoftDrive(data) {
|
|
|
787
726
|
}
|
|
788
727
|
|
|
789
728
|
// src/ui/formatters/email.tsx
|
|
790
|
-
var
|
|
791
|
-
var
|
|
729
|
+
var import_lucide_react3 = require("lucide-react");
|
|
730
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
792
731
|
function isEmailData(data) {
|
|
793
732
|
return typeof data === "object" && data !== null && ("subject" in data || "from" in data || "snippet" in data);
|
|
794
733
|
}
|
|
@@ -829,44 +768,44 @@ function resolveLabels(email) {
|
|
|
829
768
|
function EmailCard({ email }) {
|
|
830
769
|
const recipients = formatRecipients(email.to);
|
|
831
770
|
const labels = resolveLabels(email);
|
|
832
|
-
return /* @__PURE__ */ (0,
|
|
833
|
-
/* @__PURE__ */ (0,
|
|
834
|
-
/* @__PURE__ */ (0,
|
|
835
|
-
/* @__PURE__ */ (0,
|
|
836
|
-
/* @__PURE__ */ (0,
|
|
837
|
-
email.from && /* @__PURE__ */ (0,
|
|
838
|
-
recipients && /* @__PURE__ */ (0,
|
|
771
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "rounded-lg border border-border bg-card p-3 space-y-2", children: [
|
|
772
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex items-start gap-2", children: [
|
|
773
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react3.Mail, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
|
|
774
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
775
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "text-sm font-medium text-foreground truncate", children: email.subject || "No subject" }),
|
|
776
|
+
email.from && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "text-xs text-muted-foreground truncate", children: email.from }),
|
|
777
|
+
recipients && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("p", { className: "text-xs text-muted-foreground truncate", children: [
|
|
839
778
|
"To: ",
|
|
840
779
|
recipients
|
|
841
780
|
] })
|
|
842
781
|
] }),
|
|
843
|
-
/* @__PURE__ */ (0,
|
|
844
|
-
email.hasAttachments && /* @__PURE__ */ (0,
|
|
845
|
-
email.date && /* @__PURE__ */ (0,
|
|
782
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex items-center gap-1.5 shrink-0", children: [
|
|
783
|
+
email.hasAttachments && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react3.Paperclip, { className: "h-3.5 w-3.5 text-muted-foreground" }),
|
|
784
|
+
email.date && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-xs text-muted-foreground", children: formatRelativeDate(email.date) })
|
|
846
785
|
] })
|
|
847
786
|
] }),
|
|
848
|
-
labels.length > 0 && /* @__PURE__ */ (0,
|
|
787
|
+
labels.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "flex items-center gap-1.5 flex-wrap", children: labels.map((label) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
849
788
|
"span",
|
|
850
789
|
{
|
|
851
790
|
className: "inline-flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground",
|
|
852
791
|
children: [
|
|
853
|
-
/* @__PURE__ */ (0,
|
|
792
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react3.Tag, { className: "h-2.5 w-2.5" }),
|
|
854
793
|
label
|
|
855
794
|
]
|
|
856
795
|
},
|
|
857
796
|
label
|
|
858
797
|
)) }),
|
|
859
|
-
(email.snippet || email.body) && /* @__PURE__ */ (0,
|
|
798
|
+
(email.snippet || email.body) && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "text-xs text-muted-foreground line-clamp-3", children: email.snippet || email.body })
|
|
860
799
|
] });
|
|
861
800
|
}
|
|
862
801
|
function EmailFormatter({ data }) {
|
|
863
802
|
if (isEmailData(data)) {
|
|
864
|
-
return /* @__PURE__ */ (0,
|
|
803
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(EmailCard, { email: data });
|
|
865
804
|
}
|
|
866
805
|
if (Array.isArray(data)) {
|
|
867
806
|
const emails = data.filter(isEmailData);
|
|
868
807
|
if (emails.length > 0) {
|
|
869
|
-
return /* @__PURE__ */ (0,
|
|
808
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "space-y-2", children: emails.map((email, i) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(EmailCard, { email }, email.id || i)) });
|
|
870
809
|
}
|
|
871
810
|
}
|
|
872
811
|
if (typeof data === "object" && data !== null && "messages" in data) {
|
|
@@ -874,16 +813,16 @@ function EmailFormatter({ data }) {
|
|
|
874
813
|
if (Array.isArray(messages)) {
|
|
875
814
|
const emails = messages.filter(isEmailData);
|
|
876
815
|
if (emails.length > 0) {
|
|
877
|
-
return /* @__PURE__ */ (0,
|
|
816
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "space-y-2", children: emails.map((email, i) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(EmailCard, { email }, email.id || i)) });
|
|
878
817
|
}
|
|
879
818
|
}
|
|
880
819
|
}
|
|
881
|
-
return /* @__PURE__ */ (0,
|
|
820
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.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) });
|
|
882
821
|
}
|
|
883
822
|
|
|
884
823
|
// src/ui/formatters/calendar-event.tsx
|
|
885
|
-
var
|
|
886
|
-
var
|
|
824
|
+
var import_lucide_react4 = require("lucide-react");
|
|
825
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
887
826
|
function isCalendarEvent(data) {
|
|
888
827
|
return typeof data === "object" && data !== null && ("summary" in data || "start" in data);
|
|
889
828
|
}
|
|
@@ -918,37 +857,37 @@ function formatRelativeDateTime(dt) {
|
|
|
918
857
|
function ResponseStatusIcon({ status }) {
|
|
919
858
|
switch (status) {
|
|
920
859
|
case "accepted":
|
|
921
|
-
return /* @__PURE__ */ (0,
|
|
860
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react4.Check, { className: "h-3 w-3 text-green-500" });
|
|
922
861
|
case "declined":
|
|
923
|
-
return /* @__PURE__ */ (0,
|
|
862
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react4.X, { className: "h-3 w-3 text-destructive" });
|
|
924
863
|
case "tentative":
|
|
925
|
-
return /* @__PURE__ */ (0,
|
|
864
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react4.HelpCircle, { className: "h-3 w-3 text-yellow-500" });
|
|
926
865
|
default:
|
|
927
|
-
return /* @__PURE__ */ (0,
|
|
866
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react4.HelpCircle, { className: "h-3 w-3 text-muted-foreground" });
|
|
928
867
|
}
|
|
929
868
|
}
|
|
930
869
|
function EventCard({ event }) {
|
|
931
870
|
const startStr = formatRelativeDateTime(event.start);
|
|
932
871
|
const endStr = formatRelativeDateTime(event.end);
|
|
933
|
-
return /* @__PURE__ */ (0,
|
|
934
|
-
/* @__PURE__ */ (0,
|
|
935
|
-
/* @__PURE__ */ (0,
|
|
936
|
-
/* @__PURE__ */ (0,
|
|
937
|
-
/* @__PURE__ */ (0,
|
|
938
|
-
startStr && /* @__PURE__ */ (0,
|
|
872
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "rounded-lg border border-border bg-card p-3 space-y-2", children: [
|
|
873
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-start gap-2", children: [
|
|
874
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react4.Calendar, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
|
|
875
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
876
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "text-sm font-medium text-foreground", children: event.summary || "Untitled event" }),
|
|
877
|
+
startStr && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("p", { className: "text-xs text-muted-foreground", children: [
|
|
939
878
|
startStr,
|
|
940
879
|
endStr ? ` \u2192 ${endStr}` : ""
|
|
941
880
|
] })
|
|
942
881
|
] })
|
|
943
882
|
] }),
|
|
944
|
-
event.location && /* @__PURE__ */ (0,
|
|
945
|
-
/* @__PURE__ */ (0,
|
|
946
|
-
/* @__PURE__ */ (0,
|
|
883
|
+
event.location && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-center gap-1.5 text-xs text-muted-foreground", children: [
|
|
884
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react4.MapPin, { className: "h-3 w-3 shrink-0" }),
|
|
885
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "truncate", children: event.location })
|
|
947
886
|
] }),
|
|
948
|
-
event.attendees && event.attendees.length > 0 && /* @__PURE__ */ (0,
|
|
949
|
-
/* @__PURE__ */ (0,
|
|
950
|
-
/* @__PURE__ */ (0,
|
|
951
|
-
/* @__PURE__ */ (0,
|
|
887
|
+
event.attendees && event.attendees.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-start gap-1.5 text-xs text-muted-foreground", children: [
|
|
888
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react4.Users, { className: "h-3 w-3 shrink-0 mt-0.5" }),
|
|
889
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "flex flex-wrap gap-x-3 gap-y-1", children: event.attendees.map((a, i) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "inline-flex items-center gap-1", children: [
|
|
890
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ResponseStatusIcon, { status: a.responseStatus }),
|
|
952
891
|
a.displayName || a.email
|
|
953
892
|
] }, i)) })
|
|
954
893
|
] })
|
|
@@ -956,12 +895,12 @@ function EventCard({ event }) {
|
|
|
956
895
|
}
|
|
957
896
|
function CalendarEventFormatter({ data }) {
|
|
958
897
|
if (isCalendarEvent(data)) {
|
|
959
|
-
return /* @__PURE__ */ (0,
|
|
898
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(EventCard, { event: data });
|
|
960
899
|
}
|
|
961
900
|
if (Array.isArray(data)) {
|
|
962
901
|
const events = data.filter(isCalendarEvent);
|
|
963
902
|
if (events.length > 0) {
|
|
964
|
-
return /* @__PURE__ */ (0,
|
|
903
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "space-y-2", children: events.map((event, i) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(EventCard, { event }, event.id || i)) });
|
|
965
904
|
}
|
|
966
905
|
}
|
|
967
906
|
if (typeof data === "object" && data !== null && "events" in data) {
|
|
@@ -969,16 +908,16 @@ function CalendarEventFormatter({ data }) {
|
|
|
969
908
|
if (Array.isArray(events)) {
|
|
970
909
|
const calEvents = events.filter(isCalendarEvent);
|
|
971
910
|
if (calEvents.length > 0) {
|
|
972
|
-
return /* @__PURE__ */ (0,
|
|
911
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "space-y-2", children: calEvents.map((event, i) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(EventCard, { event }, event.id || i)) });
|
|
973
912
|
}
|
|
974
913
|
}
|
|
975
914
|
}
|
|
976
|
-
return /* @__PURE__ */ (0,
|
|
915
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.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) });
|
|
977
916
|
}
|
|
978
917
|
|
|
979
918
|
// src/ui/formatters/slack-message.tsx
|
|
980
|
-
var
|
|
981
|
-
var
|
|
919
|
+
var import_lucide_react5 = require("lucide-react");
|
|
920
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
982
921
|
function isSlackMessage(data) {
|
|
983
922
|
return typeof data === "object" && data !== null && ("text" in data || "channel" in data);
|
|
984
923
|
}
|
|
@@ -986,21 +925,21 @@ function isChannelList(data) {
|
|
|
986
925
|
return typeof data === "object" && data !== null && "channels" in data && Array.isArray(data.channels);
|
|
987
926
|
}
|
|
988
927
|
function MessageBubble({ message }) {
|
|
989
|
-
return /* @__PURE__ */ (0,
|
|
990
|
-
/* @__PURE__ */ (0,
|
|
991
|
-
/* @__PURE__ */ (0,
|
|
992
|
-
message.channel && /* @__PURE__ */ (0,
|
|
993
|
-
/* @__PURE__ */ (0,
|
|
928
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "rounded-lg border border-border bg-card p-3 space-y-1.5", children: [
|
|
929
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
930
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react5.MessageSquare, { className: "h-4 w-4 text-muted-foreground shrink-0" }),
|
|
931
|
+
message.channel && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "flex items-center gap-0.5 text-xs text-muted-foreground", children: [
|
|
932
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react5.Hash, { className: "h-3 w-3" }),
|
|
994
933
|
message.channel
|
|
995
934
|
] }),
|
|
996
|
-
message.user && /* @__PURE__ */ (0,
|
|
997
|
-
message.thread_ts && /* @__PURE__ */ (0,
|
|
998
|
-
/* @__PURE__ */ (0,
|
|
935
|
+
message.user && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "text-xs font-medium text-foreground", children: message.user }),
|
|
936
|
+
message.thread_ts && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
937
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react5.Reply, { className: "h-3 w-3" }),
|
|
999
938
|
message.reply_count ? `${message.reply_count} replies` : "Thread"
|
|
1000
939
|
] })
|
|
1001
940
|
] }),
|
|
1002
|
-
message.text && /* @__PURE__ */ (0,
|
|
1003
|
-
message.reactions && message.reactions.length > 0 && /* @__PURE__ */ (0,
|
|
941
|
+
message.text && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-sm text-foreground", children: message.text }),
|
|
942
|
+
message.reactions && message.reactions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "flex flex-wrap gap-1.5 pt-1", children: message.reactions.map((reaction) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
1004
943
|
"span",
|
|
1005
944
|
{
|
|
1006
945
|
className: "inline-flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground",
|
|
@@ -1008,7 +947,7 @@ function MessageBubble({ message }) {
|
|
|
1008
947
|
":",
|
|
1009
948
|
reaction.name,
|
|
1010
949
|
":",
|
|
1011
|
-
reaction.count && reaction.count > 1 && /* @__PURE__ */ (0,
|
|
950
|
+
reaction.count && reaction.count > 1 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "font-medium", children: reaction.count })
|
|
1012
951
|
]
|
|
1013
952
|
},
|
|
1014
953
|
reaction.name
|
|
@@ -1017,10 +956,10 @@ function MessageBubble({ message }) {
|
|
|
1017
956
|
}
|
|
1018
957
|
function ChannelCard({ channel }) {
|
|
1019
958
|
const members = channel.num_members ?? channel.memberCount;
|
|
1020
|
-
return /* @__PURE__ */ (0,
|
|
1021
|
-
/* @__PURE__ */ (0,
|
|
1022
|
-
/* @__PURE__ */ (0,
|
|
1023
|
-
members !== void 0 && /* @__PURE__ */ (0,
|
|
959
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex items-center gap-2 rounded-lg border border-border bg-card p-3", children: [
|
|
960
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react5.Hash, { className: "h-4 w-4 text-muted-foreground shrink-0" }),
|
|
961
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "text-sm text-foreground flex-1", children: channel.name || channel.id }),
|
|
962
|
+
members !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "text-xs text-muted-foreground", children: [
|
|
1024
963
|
members,
|
|
1025
964
|
" members"
|
|
1026
965
|
] })
|
|
@@ -1029,15 +968,15 @@ function ChannelCard({ channel }) {
|
|
|
1029
968
|
function SlackMessageFormatter({ data }) {
|
|
1030
969
|
if (isChannelList(data)) {
|
|
1031
970
|
const channels = data.channels;
|
|
1032
|
-
return /* @__PURE__ */ (0,
|
|
971
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "space-y-1.5", children: channels.map((ch, i) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ChannelCard, { channel: ch }, ch.id || i)) });
|
|
1033
972
|
}
|
|
1034
973
|
if (isSlackMessage(data)) {
|
|
1035
|
-
return /* @__PURE__ */ (0,
|
|
974
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(MessageBubble, { message: data });
|
|
1036
975
|
}
|
|
1037
976
|
if (Array.isArray(data)) {
|
|
1038
977
|
const messages = data.filter(isSlackMessage);
|
|
1039
978
|
if (messages.length > 0) {
|
|
1040
|
-
return /* @__PURE__ */ (0,
|
|
979
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "space-y-2", children: messages.map((msg, i) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(MessageBubble, { message: msg }, msg.ts || i)) });
|
|
1041
980
|
}
|
|
1042
981
|
}
|
|
1043
982
|
if (typeof data === "object" && data !== null && "messages" in data) {
|
|
@@ -1045,16 +984,16 @@ function SlackMessageFormatter({ data }) {
|
|
|
1045
984
|
if (Array.isArray(messages)) {
|
|
1046
985
|
const slackMsgs = messages.filter(isSlackMessage);
|
|
1047
986
|
if (slackMsgs.length > 0) {
|
|
1048
|
-
return /* @__PURE__ */ (0,
|
|
987
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "space-y-2", children: slackMsgs.map((msg, i) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(MessageBubble, { message: msg }, msg.ts || i)) });
|
|
1049
988
|
}
|
|
1050
989
|
}
|
|
1051
990
|
}
|
|
1052
|
-
return /* @__PURE__ */ (0,
|
|
991
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.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) });
|
|
1053
992
|
}
|
|
1054
993
|
|
|
1055
994
|
// src/ui/formatters/github.tsx
|
|
1056
|
-
var
|
|
1057
|
-
var
|
|
995
|
+
var import_lucide_react6 = require("lucide-react");
|
|
996
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1058
997
|
function isGithubItem(data) {
|
|
1059
998
|
return typeof data === "object" && data !== null && ("title" in data || "number" in data);
|
|
1060
999
|
}
|
|
@@ -1075,45 +1014,45 @@ function formatRelativeDate2(dateStr) {
|
|
|
1075
1014
|
function getStateInfo(item) {
|
|
1076
1015
|
const isPR = !!item.pull_request;
|
|
1077
1016
|
if (isPR && item.merged) {
|
|
1078
|
-
return { icon:
|
|
1017
|
+
return { icon: import_lucide_react6.GitMerge, color: "text-purple-500", label: "Merged" };
|
|
1079
1018
|
}
|
|
1080
1019
|
if (item.state === "open") {
|
|
1081
1020
|
return {
|
|
1082
|
-
icon: isPR ?
|
|
1021
|
+
icon: isPR ? import_lucide_react6.GitPullRequest : import_lucide_react6.CircleDot,
|
|
1083
1022
|
color: "text-green-500",
|
|
1084
1023
|
label: "Open"
|
|
1085
1024
|
};
|
|
1086
1025
|
}
|
|
1087
1026
|
return {
|
|
1088
|
-
icon: isPR ?
|
|
1027
|
+
icon: isPR ? import_lucide_react6.GitPullRequest : import_lucide_react6.CircleDot,
|
|
1089
1028
|
color: "text-destructive",
|
|
1090
1029
|
label: "Closed"
|
|
1091
1030
|
};
|
|
1092
1031
|
}
|
|
1093
1032
|
function GithubCard({ item }) {
|
|
1094
1033
|
const { icon: StateIcon, color: stateColor, label: stateLabel } = getStateInfo(item);
|
|
1095
|
-
return /* @__PURE__ */ (0,
|
|
1096
|
-
/* @__PURE__ */ (0,
|
|
1097
|
-
/* @__PURE__ */ (0,
|
|
1098
|
-
/* @__PURE__ */ (0,
|
|
1099
|
-
/* @__PURE__ */ (0,
|
|
1100
|
-
item.html_url ? /* @__PURE__ */ (0,
|
|
1101
|
-
item.number && /* @__PURE__ */ (0,
|
|
1034
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "rounded-lg border border-border bg-card p-3 space-y-1.5", children: [
|
|
1035
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-start gap-2", children: [
|
|
1036
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(StateIcon, { className: `h-4 w-4 mt-0.5 shrink-0 ${stateColor}` }),
|
|
1037
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
1038
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("p", { className: "text-sm font-medium text-foreground", children: [
|
|
1039
|
+
item.html_url ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("a", { href: item.html_url, target: "_blank", rel: "noopener noreferrer", className: "hover:underline", children: item.title }) : item.title,
|
|
1040
|
+
item.number && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "text-muted-foreground font-normal", children: [
|
|
1102
1041
|
" #",
|
|
1103
1042
|
item.number
|
|
1104
1043
|
] })
|
|
1105
1044
|
] }),
|
|
1106
|
-
/* @__PURE__ */ (0,
|
|
1107
|
-
/* @__PURE__ */ (0,
|
|
1108
|
-
item.user?.login && /* @__PURE__ */ (0,
|
|
1109
|
-
item.created_at && /* @__PURE__ */ (0,
|
|
1110
|
-
/* @__PURE__ */ (0,
|
|
1045
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-center gap-2 mt-0.5", children: [
|
|
1046
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: `text-xs ${stateColor}`, children: stateLabel }),
|
|
1047
|
+
item.user?.login && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-xs text-muted-foreground", children: item.user.login }),
|
|
1048
|
+
item.created_at && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
1049
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react6.Clock, { className: "h-3 w-3" }),
|
|
1111
1050
|
formatRelativeDate2(item.created_at)
|
|
1112
1051
|
] })
|
|
1113
1052
|
] })
|
|
1114
1053
|
] })
|
|
1115
1054
|
] }),
|
|
1116
|
-
item.labels && item.labels.length > 0 && /* @__PURE__ */ (0,
|
|
1055
|
+
item.labels && item.labels.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "flex flex-wrap gap-1.5", children: item.labels.map((label) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1117
1056
|
"span",
|
|
1118
1057
|
{
|
|
1119
1058
|
className: "rounded-full border border-border px-2 py-0.5 text-xs text-muted-foreground",
|
|
@@ -1122,35 +1061,35 @@ function GithubCard({ item }) {
|
|
|
1122
1061
|
},
|
|
1123
1062
|
label.name
|
|
1124
1063
|
)) }),
|
|
1125
|
-
item.body && /* @__PURE__ */ (0,
|
|
1064
|
+
item.body && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "text-xs text-muted-foreground line-clamp-2", children: item.body })
|
|
1126
1065
|
] });
|
|
1127
1066
|
}
|
|
1128
1067
|
function GithubFormatter({ data }) {
|
|
1129
1068
|
if (isGithubItem(data)) {
|
|
1130
|
-
return /* @__PURE__ */ (0,
|
|
1069
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(GithubCard, { item: data });
|
|
1131
1070
|
}
|
|
1132
1071
|
if (Array.isArray(data)) {
|
|
1133
1072
|
const items = data.filter(isGithubItem);
|
|
1134
1073
|
if (items.length > 0) {
|
|
1135
|
-
return /* @__PURE__ */ (0,
|
|
1074
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "space-y-2", children: items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(GithubCard, { item }, item.number || i)) });
|
|
1136
1075
|
}
|
|
1137
1076
|
}
|
|
1138
|
-
return /* @__PURE__ */ (0,
|
|
1077
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.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) });
|
|
1139
1078
|
}
|
|
1140
1079
|
|
|
1141
1080
|
// src/ui/formatters/drive-file.tsx
|
|
1142
|
-
var
|
|
1143
|
-
var
|
|
1081
|
+
var import_lucide_react7 = require("lucide-react");
|
|
1082
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1144
1083
|
function isDriveFile(data) {
|
|
1145
1084
|
return typeof data === "object" && data !== null && ("name" in data || "mimeType" in data);
|
|
1146
1085
|
}
|
|
1147
1086
|
function getFileIcon(mimeType) {
|
|
1148
|
-
if (!mimeType) return
|
|
1149
|
-
if (mimeType.includes("folder")) return
|
|
1150
|
-
if (mimeType.includes("image")) return
|
|
1151
|
-
if (mimeType.includes("video")) return
|
|
1152
|
-
if (mimeType.includes("spreadsheet") || mimeType.includes("excel")) return
|
|
1153
|
-
return
|
|
1087
|
+
if (!mimeType) return import_lucide_react7.FileText;
|
|
1088
|
+
if (mimeType.includes("folder")) return import_lucide_react7.Folder;
|
|
1089
|
+
if (mimeType.includes("image")) return import_lucide_react7.Image;
|
|
1090
|
+
if (mimeType.includes("video")) return import_lucide_react7.Film;
|
|
1091
|
+
if (mimeType.includes("spreadsheet") || mimeType.includes("excel")) return import_lucide_react7.FileSpreadsheet;
|
|
1092
|
+
return import_lucide_react7.FileText;
|
|
1154
1093
|
}
|
|
1155
1094
|
function formatFileSize(size) {
|
|
1156
1095
|
if (size === void 0) return null;
|
|
@@ -1164,29 +1103,29 @@ function formatFileSize(size) {
|
|
|
1164
1103
|
function FileCard({ file }) {
|
|
1165
1104
|
const Icon = getFileIcon(file.mimeType);
|
|
1166
1105
|
const sizeStr = formatFileSize(file.size);
|
|
1167
|
-
return /* @__PURE__ */ (0,
|
|
1168
|
-
/* @__PURE__ */ (0,
|
|
1169
|
-
/* @__PURE__ */ (0,
|
|
1170
|
-
/* @__PURE__ */ (0,
|
|
1171
|
-
/* @__PURE__ */ (0,
|
|
1172
|
-
file.modifiedTime && /* @__PURE__ */ (0,
|
|
1173
|
-
sizeStr && /* @__PURE__ */ (0,
|
|
1106
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex items-center gap-3 rounded-lg border border-border bg-card p-3", children: [
|
|
1107
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { className: "h-4 w-4 text-muted-foreground shrink-0" }),
|
|
1108
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
1109
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "text-sm text-foreground truncate", children: file.webViewLink ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("a", { href: file.webViewLink, target: "_blank", rel: "noopener noreferrer", className: "hover:underline", children: file.name || "Untitled" }) : file.name || "Untitled" }),
|
|
1110
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
1111
|
+
file.modifiedTime && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-xs text-muted-foreground", children: new Date(file.modifiedTime).toLocaleDateString() }),
|
|
1112
|
+
sizeStr && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-xs text-muted-foreground", children: sizeStr })
|
|
1174
1113
|
] })
|
|
1175
1114
|
] }),
|
|
1176
|
-
/* @__PURE__ */ (0,
|
|
1177
|
-
file.shared && /* @__PURE__ */ (0,
|
|
1178
|
-
file.webViewLink && /* @__PURE__ */ (0,
|
|
1115
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex items-center gap-1.5 shrink-0", children: [
|
|
1116
|
+
file.shared && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { title: "Shared", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react7.Users, { className: "h-3.5 w-3.5 text-muted-foreground" }) }),
|
|
1117
|
+
file.webViewLink && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("a", { href: file.webViewLink, target: "_blank", rel: "noopener noreferrer", className: "text-muted-foreground hover:text-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react7.ExternalLink, { className: "h-3.5 w-3.5" }) })
|
|
1179
1118
|
] })
|
|
1180
1119
|
] });
|
|
1181
1120
|
}
|
|
1182
1121
|
function DriveFileFormatter({ data }) {
|
|
1183
1122
|
if (isDriveFile(data)) {
|
|
1184
|
-
return /* @__PURE__ */ (0,
|
|
1123
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FileCard, { file: data });
|
|
1185
1124
|
}
|
|
1186
1125
|
if (Array.isArray(data)) {
|
|
1187
1126
|
const files = data.filter(isDriveFile);
|
|
1188
1127
|
if (files.length > 0) {
|
|
1189
|
-
return /* @__PURE__ */ (0,
|
|
1128
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "space-y-1.5", children: files.map((file, i) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FileCard, { file }, file.id || i)) });
|
|
1190
1129
|
}
|
|
1191
1130
|
}
|
|
1192
1131
|
if (typeof data === "object" && data !== null && "files" in data) {
|
|
@@ -1194,16 +1133,16 @@ function DriveFileFormatter({ data }) {
|
|
|
1194
1133
|
if (Array.isArray(files)) {
|
|
1195
1134
|
const driveFiles = files.filter(isDriveFile);
|
|
1196
1135
|
if (driveFiles.length > 0) {
|
|
1197
|
-
return /* @__PURE__ */ (0,
|
|
1136
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "space-y-1.5", children: driveFiles.map((file, i) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FileCard, { file }, file.id || i)) });
|
|
1198
1137
|
}
|
|
1199
1138
|
}
|
|
1200
1139
|
}
|
|
1201
|
-
return /* @__PURE__ */ (0,
|
|
1140
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.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) });
|
|
1202
1141
|
}
|
|
1203
1142
|
|
|
1204
1143
|
// src/ui/formatters/search.tsx
|
|
1205
|
-
var
|
|
1206
|
-
var
|
|
1144
|
+
var import_lucide_react8 = require("lucide-react");
|
|
1145
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1207
1146
|
function isSearchData(data) {
|
|
1208
1147
|
if (typeof data !== "object" || data === null) return false;
|
|
1209
1148
|
return "results" in data || "organic" in data || "answer" in data || "answerBox" in data;
|
|
@@ -1221,10 +1160,10 @@ function getDomain(url) {
|
|
|
1221
1160
|
function ResultCard({ result }) {
|
|
1222
1161
|
const href = result.link || result.url;
|
|
1223
1162
|
const snippet = result.snippet || result.description;
|
|
1224
|
-
return /* @__PURE__ */ (0,
|
|
1225
|
-
/* @__PURE__ */ (0,
|
|
1226
|
-
/* @__PURE__ */ (0,
|
|
1227
|
-
href ? /* @__PURE__ */ (0,
|
|
1163
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "rounded-lg border border-border bg-card p-3 space-y-1", children: [
|
|
1164
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex items-start gap-2", children: [
|
|
1165
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
1166
|
+
href ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1228
1167
|
"a",
|
|
1229
1168
|
{
|
|
1230
1169
|
href,
|
|
@@ -1233,12 +1172,12 @@ function ResultCard({ result }) {
|
|
|
1233
1172
|
className: "text-sm font-medium text-primary hover:underline",
|
|
1234
1173
|
children: result.title || href
|
|
1235
1174
|
}
|
|
1236
|
-
) : /* @__PURE__ */ (0,
|
|
1237
|
-
href && /* @__PURE__ */ (0,
|
|
1175
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "text-sm font-medium text-foreground", children: result.title }),
|
|
1176
|
+
href && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "text-xs text-muted-foreground truncate", children: getDomain(href) })
|
|
1238
1177
|
] }),
|
|
1239
|
-
href && /* @__PURE__ */ (0,
|
|
1178
|
+
href && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("a", { href, target: "_blank", rel: "noopener noreferrer", className: "shrink-0 text-muted-foreground hover:text-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react8.ExternalLink, { className: "h-3.5 w-3.5" }) })
|
|
1240
1179
|
] }),
|
|
1241
|
-
snippet && /* @__PURE__ */ (0,
|
|
1180
|
+
snippet && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "text-xs text-muted-foreground line-clamp-2", children: snippet })
|
|
1242
1181
|
] });
|
|
1243
1182
|
}
|
|
1244
1183
|
function SearchFormatter({ data }) {
|
|
@@ -1246,18 +1185,18 @@ function SearchFormatter({ data }) {
|
|
|
1246
1185
|
const results = data.results || data.organic || [];
|
|
1247
1186
|
const answerText = data.answer || data.answerBox?.answer || data.answerBox?.snippet;
|
|
1248
1187
|
const related = data.relatedSearches || data.related_searches;
|
|
1249
|
-
return /* @__PURE__ */ (0,
|
|
1250
|
-
answerText && /* @__PURE__ */ (0,
|
|
1251
|
-
/* @__PURE__ */ (0,
|
|
1252
|
-
data.answerBox?.title && /* @__PURE__ */ (0,
|
|
1188
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "space-y-3", children: [
|
|
1189
|
+
answerText && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "rounded-lg border border-border bg-card p-3", children: [
|
|
1190
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "text-sm text-foreground", children: answerText }),
|
|
1191
|
+
data.answerBox?.title && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "text-xs text-muted-foreground mt-1", children: data.answerBox.title })
|
|
1253
1192
|
] }),
|
|
1254
|
-
results.length > 0 && /* @__PURE__ */ (0,
|
|
1255
|
-
related && related.length > 0 && /* @__PURE__ */ (0,
|
|
1193
|
+
results.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "space-y-2", children: results.filter(isSearchResult).map((result, i) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ResultCard, { result }, result.link || result.url || i)) }),
|
|
1194
|
+
related && related.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "flex flex-wrap gap-1.5", children: related.map((r, i) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1256
1195
|
"span",
|
|
1257
1196
|
{
|
|
1258
1197
|
className: "inline-flex items-center gap-1 rounded-full bg-muted px-2.5 py-1 text-xs text-muted-foreground",
|
|
1259
1198
|
children: [
|
|
1260
|
-
/* @__PURE__ */ (0,
|
|
1199
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react8.Search, { className: "h-3 w-3" }),
|
|
1261
1200
|
r.query
|
|
1262
1201
|
]
|
|
1263
1202
|
},
|
|
@@ -1268,15 +1207,15 @@ function SearchFormatter({ data }) {
|
|
|
1268
1207
|
if (Array.isArray(data)) {
|
|
1269
1208
|
const results = data.filter(isSearchResult);
|
|
1270
1209
|
if (results.length > 0) {
|
|
1271
|
-
return /* @__PURE__ */ (0,
|
|
1210
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "space-y-2", children: results.map((result, i) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ResultCard, { result }, result.link || result.url || i)) });
|
|
1272
1211
|
}
|
|
1273
1212
|
}
|
|
1274
|
-
return /* @__PURE__ */ (0,
|
|
1213
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.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) });
|
|
1275
1214
|
}
|
|
1276
1215
|
|
|
1277
1216
|
// src/ui/formatters/docs.tsx
|
|
1278
|
-
var
|
|
1279
|
-
var
|
|
1217
|
+
var import_lucide_react9 = require("lucide-react");
|
|
1218
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1280
1219
|
function isDocData(data) {
|
|
1281
1220
|
return typeof data === "object" && data !== null && ("documentId" in data || "title" in data);
|
|
1282
1221
|
}
|
|
@@ -1299,31 +1238,31 @@ function extractTextContent(body) {
|
|
|
1299
1238
|
function DocCard({ doc }) {
|
|
1300
1239
|
const docUrl = doc.url || (doc.documentId ? `https://docs.google.com/document/d/${doc.documentId}` : null);
|
|
1301
1240
|
const textContent = doc.content || extractTextContent(doc.body);
|
|
1302
|
-
return /* @__PURE__ */ (0,
|
|
1303
|
-
/* @__PURE__ */ (0,
|
|
1304
|
-
/* @__PURE__ */ (0,
|
|
1305
|
-
/* @__PURE__ */ (0,
|
|
1306
|
-
docUrl && /* @__PURE__ */ (0,
|
|
1241
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "rounded-lg border border-border bg-card p-3 space-y-2", children: [
|
|
1242
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-start gap-2", children: [
|
|
1243
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react9.FileText, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
|
|
1244
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-sm font-medium text-foreground", children: docUrl ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("a", { href: docUrl, target: "_blank", rel: "noopener noreferrer", className: "hover:underline", children: doc.title || "Untitled document" }) : doc.title || "Untitled document" }) }),
|
|
1245
|
+
docUrl && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("a", { href: docUrl, target: "_blank", rel: "noopener noreferrer", className: "shrink-0 text-muted-foreground hover:text-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react9.ExternalLink, { className: "h-3.5 w-3.5" }) })
|
|
1307
1246
|
] }),
|
|
1308
|
-
textContent && /* @__PURE__ */ (0,
|
|
1247
|
+
textContent && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-xs text-muted-foreground line-clamp-4 whitespace-pre-wrap", children: textContent })
|
|
1309
1248
|
] });
|
|
1310
1249
|
}
|
|
1311
1250
|
function DocsFormatter({ data }) {
|
|
1312
1251
|
if (isDocData(data)) {
|
|
1313
|
-
return /* @__PURE__ */ (0,
|
|
1252
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DocCard, { doc: data });
|
|
1314
1253
|
}
|
|
1315
1254
|
if (Array.isArray(data)) {
|
|
1316
1255
|
const docs = data.filter(isDocData);
|
|
1317
1256
|
if (docs.length > 0) {
|
|
1318
|
-
return /* @__PURE__ */ (0,
|
|
1257
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "space-y-2", children: docs.map((doc, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DocCard, { doc }, doc.documentId || i)) });
|
|
1319
1258
|
}
|
|
1320
1259
|
}
|
|
1321
|
-
return /* @__PURE__ */ (0,
|
|
1260
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.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) });
|
|
1322
1261
|
}
|
|
1323
1262
|
|
|
1324
1263
|
// src/ui/formatters/sheets.tsx
|
|
1325
|
-
var
|
|
1326
|
-
var
|
|
1264
|
+
var import_lucide_react10 = require("lucide-react");
|
|
1265
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1327
1266
|
function isSheetsData(data) {
|
|
1328
1267
|
return typeof data === "object" && data !== null && ("spreadsheetId" in data || "values" in data || "range" in data || "updatedRange" in data);
|
|
1329
1268
|
}
|
|
@@ -1331,67 +1270,67 @@ function SheetsTable({ values }) {
|
|
|
1331
1270
|
if (values.length === 0) return null;
|
|
1332
1271
|
const headers = values[0];
|
|
1333
1272
|
const rows = values.slice(1);
|
|
1334
|
-
return /* @__PURE__ */ (0,
|
|
1335
|
-
/* @__PURE__ */ (0,
|
|
1336
|
-
/* @__PURE__ */ (0,
|
|
1273
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "overflow-x-auto rounded-lg border border-border", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("table", { className: "w-full text-xs", children: [
|
|
1274
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("tr", { className: "border-b border-border bg-muted", children: headers.map((header, i) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("th", { className: "px-3 py-2 text-left font-medium text-foreground whitespace-nowrap", children: String(header) }, i)) }) }),
|
|
1275
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("tbody", { children: rows.map((row, rowIdx) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("tr", { className: "border-b border-border last:border-0", children: headers.map((_, colIdx) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("td", { className: "px-3 py-1.5 text-muted-foreground whitespace-nowrap", children: String(row[colIdx] ?? "") }, colIdx)) }, rowIdx)) })
|
|
1337
1276
|
] }) });
|
|
1338
1277
|
}
|
|
1339
1278
|
function SheetsCard({ sheet }) {
|
|
1340
1279
|
const sheetUrl = sheet.url || (sheet.spreadsheetId ? `https://docs.google.com/spreadsheets/d/${sheet.spreadsheetId}` : null);
|
|
1341
|
-
return /* @__PURE__ */ (0,
|
|
1342
|
-
/* @__PURE__ */ (0,
|
|
1343
|
-
/* @__PURE__ */ (0,
|
|
1344
|
-
/* @__PURE__ */ (0,
|
|
1345
|
-
/* @__PURE__ */ (0,
|
|
1346
|
-
(sheet.updatedRange || sheet.range) && /* @__PURE__ */ (0,
|
|
1280
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-2", children: [
|
|
1281
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "rounded-lg border border-border bg-card p-3", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-start gap-2", children: [
|
|
1282
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react10.Table2, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
|
|
1283
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
1284
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "text-sm font-medium text-foreground", children: sheetUrl ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("a", { href: sheetUrl, target: "_blank", rel: "noopener noreferrer", className: "hover:underline", children: sheet.title || "Spreadsheet" }) : sheet.title || "Spreadsheet" }),
|
|
1285
|
+
(sheet.updatedRange || sheet.range) && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("p", { className: "text-xs text-muted-foreground", children: [
|
|
1347
1286
|
sheet.updatedRange || sheet.range,
|
|
1348
1287
|
sheet.updatedCells !== void 0 && ` \xB7 ${sheet.updatedCells} cells updated`
|
|
1349
1288
|
] })
|
|
1350
1289
|
] }),
|
|
1351
|
-
sheetUrl && /* @__PURE__ */ (0,
|
|
1290
|
+
sheetUrl && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("a", { href: sheetUrl, target: "_blank", rel: "noopener noreferrer", className: "shrink-0 text-muted-foreground hover:text-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react10.ExternalLink, { className: "h-3.5 w-3.5" }) })
|
|
1352
1291
|
] }) }),
|
|
1353
|
-
sheet.values && sheet.values.length > 0 && /* @__PURE__ */ (0,
|
|
1292
|
+
sheet.values && sheet.values.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SheetsTable, { values: sheet.values })
|
|
1354
1293
|
] });
|
|
1355
1294
|
}
|
|
1356
1295
|
function SheetsFormatter({ data }) {
|
|
1357
1296
|
if (isSheetsData(data)) {
|
|
1358
|
-
return /* @__PURE__ */ (0,
|
|
1297
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SheetsCard, { sheet: data });
|
|
1359
1298
|
}
|
|
1360
|
-
return /* @__PURE__ */ (0,
|
|
1299
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.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) });
|
|
1361
1300
|
}
|
|
1362
1301
|
|
|
1363
1302
|
// src/ui/formatters/slides.tsx
|
|
1364
|
-
var
|
|
1365
|
-
var
|
|
1303
|
+
var import_lucide_react11 = require("lucide-react");
|
|
1304
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1366
1305
|
function isSlidesData(data) {
|
|
1367
1306
|
return typeof data === "object" && data !== null && ("presentationId" in data || "title" in data && "slides" in data);
|
|
1368
1307
|
}
|
|
1369
1308
|
function SlidesCard({ presentation }) {
|
|
1370
1309
|
const slideUrl = presentation.url || (presentation.presentationId ? `https://docs.google.com/presentation/d/${presentation.presentationId}` : null);
|
|
1371
1310
|
const slideCount = presentation.slides?.length;
|
|
1372
|
-
return /* @__PURE__ */ (0,
|
|
1373
|
-
/* @__PURE__ */ (0,
|
|
1374
|
-
/* @__PURE__ */ (0,
|
|
1375
|
-
/* @__PURE__ */ (0,
|
|
1376
|
-
slideCount !== void 0 && /* @__PURE__ */ (0,
|
|
1311
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "rounded-lg border border-border bg-card p-3", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-start gap-2", children: [
|
|
1312
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react11.Presentation, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
|
|
1313
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
1314
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "text-sm font-medium text-foreground", children: slideUrl ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("a", { href: slideUrl, target: "_blank", rel: "noopener noreferrer", className: "hover:underline", children: presentation.title || "Presentation" }) : presentation.title || "Presentation" }),
|
|
1315
|
+
slideCount !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { className: "text-xs text-muted-foreground", children: [
|
|
1377
1316
|
slideCount,
|
|
1378
1317
|
" ",
|
|
1379
1318
|
slideCount === 1 ? "slide" : "slides"
|
|
1380
1319
|
] })
|
|
1381
1320
|
] }),
|
|
1382
|
-
slideUrl && /* @__PURE__ */ (0,
|
|
1321
|
+
slideUrl && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("a", { href: slideUrl, target: "_blank", rel: "noopener noreferrer", className: "shrink-0 text-muted-foreground hover:text-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react11.ExternalLink, { className: "h-3.5 w-3.5" }) })
|
|
1383
1322
|
] }) });
|
|
1384
1323
|
}
|
|
1385
1324
|
function SlidesFormatter({ data }) {
|
|
1386
1325
|
if (isSlidesData(data)) {
|
|
1387
|
-
return /* @__PURE__ */ (0,
|
|
1326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SlidesCard, { presentation: data });
|
|
1388
1327
|
}
|
|
1389
|
-
return /* @__PURE__ */ (0,
|
|
1328
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.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) });
|
|
1390
1329
|
}
|
|
1391
1330
|
|
|
1392
1331
|
// src/ui/formatters/hubspot.tsx
|
|
1393
|
-
var
|
|
1394
|
-
var
|
|
1332
|
+
var import_lucide_react12 = require("lucide-react");
|
|
1333
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1395
1334
|
function isHubspotContact(data) {
|
|
1396
1335
|
if (typeof data !== "object" || data === null) return false;
|
|
1397
1336
|
const d = data;
|
|
@@ -1412,21 +1351,21 @@ function ContactCard({ contact }) {
|
|
|
1412
1351
|
const phone = contact.phone || p.phone;
|
|
1413
1352
|
const company = contact.company || p.company;
|
|
1414
1353
|
const name = [first, last].filter(Boolean).join(" ") || "Unknown contact";
|
|
1415
|
-
return /* @__PURE__ */ (0,
|
|
1416
|
-
/* @__PURE__ */ (0,
|
|
1417
|
-
/* @__PURE__ */ (0,
|
|
1418
|
-
/* @__PURE__ */ (0,
|
|
1419
|
-
/* @__PURE__ */ (0,
|
|
1420
|
-
company && /* @__PURE__ */ (0,
|
|
1354
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "rounded-lg border border-border bg-card p-3 space-y-1.5", children: [
|
|
1355
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-start gap-2", children: [
|
|
1356
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react12.Users, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
|
|
1357
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
1358
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-sm font-medium text-foreground", children: name }),
|
|
1359
|
+
company && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-xs text-muted-foreground", children: company })
|
|
1421
1360
|
] })
|
|
1422
1361
|
] }),
|
|
1423
|
-
/* @__PURE__ */ (0,
|
|
1424
|
-
email && /* @__PURE__ */ (0,
|
|
1425
|
-
/* @__PURE__ */ (0,
|
|
1362
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex flex-wrap gap-x-4 gap-y-1 pl-6", children: [
|
|
1363
|
+
email && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
1364
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react12.Mail, { className: "h-3 w-3" }),
|
|
1426
1365
|
email
|
|
1427
1366
|
] }),
|
|
1428
|
-
phone && /* @__PURE__ */ (0,
|
|
1429
|
-
/* @__PURE__ */ (0,
|
|
1367
|
+
phone && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
1368
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react12.Phone, { className: "h-3 w-3" }),
|
|
1430
1369
|
phone
|
|
1431
1370
|
] })
|
|
1432
1371
|
] })
|
|
@@ -1434,18 +1373,18 @@ function ContactCard({ contact }) {
|
|
|
1434
1373
|
}
|
|
1435
1374
|
function CompanyCard({ company }) {
|
|
1436
1375
|
const p = company.properties || {};
|
|
1437
|
-
return /* @__PURE__ */ (0,
|
|
1438
|
-
/* @__PURE__ */ (0,
|
|
1439
|
-
/* @__PURE__ */ (0,
|
|
1440
|
-
/* @__PURE__ */ (0,
|
|
1441
|
-
/* @__PURE__ */ (0,
|
|
1442
|
-
p.industry && /* @__PURE__ */ (0,
|
|
1376
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "rounded-lg border border-border bg-card p-3 space-y-1.5", children: [
|
|
1377
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-start gap-2", children: [
|
|
1378
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react12.Building2, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
|
|
1379
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
1380
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-sm font-medium text-foreground", children: p.name || "Unknown company" }),
|
|
1381
|
+
p.industry && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-xs text-muted-foreground", children: p.industry })
|
|
1443
1382
|
] })
|
|
1444
1383
|
] }),
|
|
1445
|
-
/* @__PURE__ */ (0,
|
|
1446
|
-
p.domain && /* @__PURE__ */ (0,
|
|
1447
|
-
p.phone && /* @__PURE__ */ (0,
|
|
1448
|
-
/* @__PURE__ */ (0,
|
|
1384
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex flex-wrap gap-x-4 gap-y-1 pl-6", children: [
|
|
1385
|
+
p.domain && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "text-xs text-muted-foreground", children: p.domain }),
|
|
1386
|
+
p.phone && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
1387
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react12.Phone, { className: "h-3 w-3" }),
|
|
1449
1388
|
p.phone
|
|
1450
1389
|
] })
|
|
1451
1390
|
] })
|
|
@@ -1453,19 +1392,19 @@ function CompanyCard({ company }) {
|
|
|
1453
1392
|
}
|
|
1454
1393
|
function HubspotFormatter({ data }) {
|
|
1455
1394
|
if (isHubspotContact(data)) {
|
|
1456
|
-
return /* @__PURE__ */ (0,
|
|
1395
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ContactCard, { contact: data });
|
|
1457
1396
|
}
|
|
1458
1397
|
if (isHubspotCompany(data)) {
|
|
1459
|
-
return /* @__PURE__ */ (0,
|
|
1398
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CompanyCard, { company: data });
|
|
1460
1399
|
}
|
|
1461
1400
|
if (Array.isArray(data)) {
|
|
1462
1401
|
const contacts = data.filter(isHubspotContact);
|
|
1463
1402
|
if (contacts.length > 0) {
|
|
1464
|
-
return /* @__PURE__ */ (0,
|
|
1403
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "space-y-2", children: contacts.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ContactCard, { contact: c }, c.id || i)) });
|
|
1465
1404
|
}
|
|
1466
1405
|
const companies = data.filter(isHubspotCompany);
|
|
1467
1406
|
if (companies.length > 0) {
|
|
1468
|
-
return /* @__PURE__ */ (0,
|
|
1407
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "space-y-2", children: companies.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CompanyCard, { company: c }, c.id || i)) });
|
|
1469
1408
|
}
|
|
1470
1409
|
}
|
|
1471
1410
|
if (typeof data === "object" && data !== null && "contacts" in data) {
|
|
@@ -1473,7 +1412,7 @@ function HubspotFormatter({ data }) {
|
|
|
1473
1412
|
if (Array.isArray(contacts)) {
|
|
1474
1413
|
const valid = contacts.filter(isHubspotContact);
|
|
1475
1414
|
if (valid.length > 0) {
|
|
1476
|
-
return /* @__PURE__ */ (0,
|
|
1415
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "space-y-2", children: valid.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ContactCard, { contact: c }, c.id || i)) });
|
|
1477
1416
|
}
|
|
1478
1417
|
}
|
|
1479
1418
|
}
|
|
@@ -1482,20 +1421,20 @@ function HubspotFormatter({ data }) {
|
|
|
1482
1421
|
if (Array.isArray(results)) {
|
|
1483
1422
|
const contacts = results.filter(isHubspotContact);
|
|
1484
1423
|
if (contacts.length > 0) {
|
|
1485
|
-
return /* @__PURE__ */ (0,
|
|
1424
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "space-y-2", children: contacts.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ContactCard, { contact: c }, c.id || i)) });
|
|
1486
1425
|
}
|
|
1487
1426
|
const companies = results.filter(isHubspotCompany);
|
|
1488
1427
|
if (companies.length > 0) {
|
|
1489
|
-
return /* @__PURE__ */ (0,
|
|
1428
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "space-y-2", children: companies.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CompanyCard, { company: c }, c.id || i)) });
|
|
1490
1429
|
}
|
|
1491
1430
|
}
|
|
1492
1431
|
}
|
|
1493
|
-
return /* @__PURE__ */ (0,
|
|
1432
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.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) });
|
|
1494
1433
|
}
|
|
1495
1434
|
|
|
1496
1435
|
// src/ui/formatters/linear.tsx
|
|
1497
|
-
var
|
|
1498
|
-
var
|
|
1436
|
+
var import_lucide_react13 = require("lucide-react");
|
|
1437
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1499
1438
|
function isLinearIssue(data) {
|
|
1500
1439
|
if (typeof data !== "object" || data === null) return false;
|
|
1501
1440
|
return "title" in data && ("identifier" in data || "state" in data || "priority" in data);
|
|
@@ -1514,24 +1453,24 @@ var PRIORITY_LABELS = {
|
|
|
1514
1453
|
function IssueCard({ issue }) {
|
|
1515
1454
|
const priorityInfo = issue.priority !== void 0 ? PRIORITY_LABELS[issue.priority] : null;
|
|
1516
1455
|
const assigneeName = issue.assignee?.displayName || issue.assignee?.name;
|
|
1517
|
-
return /* @__PURE__ */ (0,
|
|
1518
|
-
/* @__PURE__ */ (0,
|
|
1519
|
-
|
|
1456
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "rounded-lg border border-border bg-card p-3 space-y-1.5", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex items-start gap-2", children: [
|
|
1457
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1458
|
+
import_lucide_react13.CircleDot,
|
|
1520
1459
|
{
|
|
1521
1460
|
className: "h-4 w-4 mt-0.5 shrink-0",
|
|
1522
1461
|
style: issue.state?.color ? { color: issue.state.color } : void 0
|
|
1523
1462
|
}
|
|
1524
1463
|
),
|
|
1525
|
-
/* @__PURE__ */ (0,
|
|
1526
|
-
/* @__PURE__ */ (0,
|
|
1527
|
-
issue.url ? /* @__PURE__ */ (0,
|
|
1528
|
-
issue.identifier && /* @__PURE__ */ (0,
|
|
1464
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
1465
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { className: "text-sm font-medium text-foreground", children: [
|
|
1466
|
+
issue.url ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("a", { href: issue.url, target: "_blank", rel: "noopener noreferrer", className: "hover:underline", children: issue.title }) : issue.title,
|
|
1467
|
+
issue.identifier && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "text-muted-foreground font-normal", children: [
|
|
1529
1468
|
" ",
|
|
1530
1469
|
issue.identifier
|
|
1531
1470
|
] })
|
|
1532
1471
|
] }),
|
|
1533
|
-
/* @__PURE__ */ (0,
|
|
1534
|
-
issue.state?.name && /* @__PURE__ */ (0,
|
|
1472
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex items-center gap-2 mt-0.5 flex-wrap", children: [
|
|
1473
|
+
issue.state?.name && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1535
1474
|
"span",
|
|
1536
1475
|
{
|
|
1537
1476
|
className: "rounded-full bg-muted px-2 py-0.5 text-xs",
|
|
@@ -1539,31 +1478,31 @@ function IssueCard({ issue }) {
|
|
|
1539
1478
|
children: issue.state.name
|
|
1540
1479
|
}
|
|
1541
1480
|
),
|
|
1542
|
-
priorityInfo && /* @__PURE__ */ (0,
|
|
1543
|
-
assigneeName && /* @__PURE__ */ (0,
|
|
1481
|
+
priorityInfo && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: `text-xs ${priorityInfo.style}`, children: issue.priorityLabel || priorityInfo.label }),
|
|
1482
|
+
assigneeName && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "text-xs text-muted-foreground", children: assigneeName })
|
|
1544
1483
|
] })
|
|
1545
1484
|
] })
|
|
1546
1485
|
] }) });
|
|
1547
1486
|
}
|
|
1548
1487
|
function ProjectCard({ project }) {
|
|
1549
1488
|
const progressPercent = project.progress !== void 0 ? Math.round(project.progress * 100) : null;
|
|
1550
|
-
return /* @__PURE__ */ (0,
|
|
1551
|
-
/* @__PURE__ */ (0,
|
|
1552
|
-
/* @__PURE__ */ (0,
|
|
1553
|
-
/* @__PURE__ */ (0,
|
|
1554
|
-
/* @__PURE__ */ (0,
|
|
1555
|
-
project.state && /* @__PURE__ */ (0,
|
|
1489
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "rounded-lg border border-border bg-card p-3 space-y-2", children: [
|
|
1490
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex items-start gap-2", children: [
|
|
1491
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react13.FolderKanban, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
|
|
1492
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
1493
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "text-sm font-medium text-foreground", children: project.url ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("a", { href: project.url, target: "_blank", rel: "noopener noreferrer", className: "hover:underline", children: project.name }) : project.name }),
|
|
1494
|
+
project.state && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "text-xs text-muted-foreground", children: project.state })
|
|
1556
1495
|
] })
|
|
1557
1496
|
] }),
|
|
1558
|
-
progressPercent !== null && /* @__PURE__ */ (0,
|
|
1559
|
-
/* @__PURE__ */ (0,
|
|
1497
|
+
progressPercent !== null && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "space-y-1", children: [
|
|
1498
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "h-1.5 rounded-full bg-muted overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1560
1499
|
"div",
|
|
1561
1500
|
{
|
|
1562
1501
|
className: "h-full rounded-full bg-primary transition-all",
|
|
1563
1502
|
style: { width: `${progressPercent}%` }
|
|
1564
1503
|
}
|
|
1565
1504
|
) }),
|
|
1566
|
-
/* @__PURE__ */ (0,
|
|
1505
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { className: "text-xs text-muted-foreground text-right", children: [
|
|
1567
1506
|
progressPercent,
|
|
1568
1507
|
"%"
|
|
1569
1508
|
] })
|
|
@@ -1572,19 +1511,19 @@ function ProjectCard({ project }) {
|
|
|
1572
1511
|
}
|
|
1573
1512
|
function LinearFormatter({ data }) {
|
|
1574
1513
|
if (isLinearIssue(data)) {
|
|
1575
|
-
return /* @__PURE__ */ (0,
|
|
1514
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IssueCard, { issue: data });
|
|
1576
1515
|
}
|
|
1577
1516
|
if (isLinearProject(data)) {
|
|
1578
|
-
return /* @__PURE__ */ (0,
|
|
1517
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ProjectCard, { project: data });
|
|
1579
1518
|
}
|
|
1580
1519
|
if (Array.isArray(data)) {
|
|
1581
1520
|
const issues = data.filter(isLinearIssue);
|
|
1582
1521
|
if (issues.length > 0) {
|
|
1583
|
-
return /* @__PURE__ */ (0,
|
|
1522
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "space-y-2", children: issues.map((issue, i) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IssueCard, { issue }, issue.id || i)) });
|
|
1584
1523
|
}
|
|
1585
1524
|
const projects = data.filter(isLinearProject);
|
|
1586
1525
|
if (projects.length > 0) {
|
|
1587
|
-
return /* @__PURE__ */ (0,
|
|
1526
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "space-y-2", children: projects.map((project, i) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ProjectCard, { project }, project.id || i)) });
|
|
1588
1527
|
}
|
|
1589
1528
|
}
|
|
1590
1529
|
if (typeof data === "object" && data !== null) {
|
|
@@ -1592,20 +1531,20 @@ function LinearFormatter({ data }) {
|
|
|
1592
1531
|
if (Array.isArray(arr)) {
|
|
1593
1532
|
const issues = arr.filter(isLinearIssue);
|
|
1594
1533
|
if (issues.length > 0) {
|
|
1595
|
-
return /* @__PURE__ */ (0,
|
|
1534
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "space-y-2", children: issues.map((issue, i) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IssueCard, { issue }, issue.id || i)) });
|
|
1596
1535
|
}
|
|
1597
1536
|
const projects = arr.filter(isLinearProject);
|
|
1598
1537
|
if (projects.length > 0) {
|
|
1599
|
-
return /* @__PURE__ */ (0,
|
|
1538
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "space-y-2", children: projects.map((project, i) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ProjectCard, { project }, project.id || i)) });
|
|
1600
1539
|
}
|
|
1601
1540
|
}
|
|
1602
1541
|
}
|
|
1603
|
-
return /* @__PURE__ */ (0,
|
|
1542
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.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) });
|
|
1604
1543
|
}
|
|
1605
1544
|
|
|
1606
1545
|
// src/ui/formatters/pipedrive.tsx
|
|
1607
|
-
var
|
|
1608
|
-
var
|
|
1546
|
+
var import_lucide_react14 = require("lucide-react");
|
|
1547
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1609
1548
|
function isPipedriveDeal(data) {
|
|
1610
1549
|
return typeof data === "object" && data !== null && ("title" in data || "value" in data || "status" in data) && !("subject" in data);
|
|
1611
1550
|
}
|
|
@@ -1637,35 +1576,35 @@ function getStatusBadge(status) {
|
|
|
1637
1576
|
}
|
|
1638
1577
|
function DealCard({ deal }) {
|
|
1639
1578
|
const statusBadge = getStatusBadge(deal.status);
|
|
1640
|
-
return /* @__PURE__ */ (0,
|
|
1641
|
-
/* @__PURE__ */ (0,
|
|
1642
|
-
/* @__PURE__ */ (0,
|
|
1643
|
-
/* @__PURE__ */ (0,
|
|
1644
|
-
/* @__PURE__ */ (0,
|
|
1645
|
-
/* @__PURE__ */ (0,
|
|
1646
|
-
deal.value !== void 0 && /* @__PURE__ */ (0,
|
|
1647
|
-
/* @__PURE__ */ (0,
|
|
1579
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "rounded-lg border border-border bg-card p-3 space-y-1.5", children: [
|
|
1580
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-start gap-2", children: [
|
|
1581
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react14.Briefcase, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
|
|
1582
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
1583
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "text-sm font-medium text-foreground", children: deal.title || "Untitled deal" }),
|
|
1584
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center gap-2 mt-0.5 flex-wrap", children: [
|
|
1585
|
+
deal.value !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "flex items-center gap-1 text-xs font-medium text-foreground", children: [
|
|
1586
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react14.DollarSign, { className: "h-3 w-3" }),
|
|
1648
1587
|
formatCurrency(deal.value, deal.currency)
|
|
1649
1588
|
] }),
|
|
1650
|
-
statusBadge && /* @__PURE__ */ (0,
|
|
1589
|
+
statusBadge && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: `rounded-full px-2 py-0.5 text-xs ${statusBadge.className}`, children: statusBadge.label })
|
|
1651
1590
|
] })
|
|
1652
1591
|
] })
|
|
1653
1592
|
] }),
|
|
1654
|
-
/* @__PURE__ */ (0,
|
|
1655
|
-
deal.person_name && /* @__PURE__ */ (0,
|
|
1656
|
-
deal.org_name && /* @__PURE__ */ (0,
|
|
1657
|
-
deal.stage_name && /* @__PURE__ */ (0,
|
|
1593
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex flex-wrap gap-x-4 gap-y-1 pl-6 text-xs text-muted-foreground", children: [
|
|
1594
|
+
deal.person_name && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: deal.person_name }),
|
|
1595
|
+
deal.org_name && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: deal.org_name }),
|
|
1596
|
+
deal.stage_name && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: deal.stage_name })
|
|
1658
1597
|
] })
|
|
1659
1598
|
] });
|
|
1660
1599
|
}
|
|
1661
1600
|
function PipedriveFormatter({ data }) {
|
|
1662
1601
|
if (isPipedriveDeal(data)) {
|
|
1663
|
-
return /* @__PURE__ */ (0,
|
|
1602
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DealCard, { deal: data });
|
|
1664
1603
|
}
|
|
1665
1604
|
if (Array.isArray(data)) {
|
|
1666
1605
|
const deals = data.filter(isPipedriveDeal);
|
|
1667
1606
|
if (deals.length > 0) {
|
|
1668
|
-
return /* @__PURE__ */ (0,
|
|
1607
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "space-y-2", children: deals.map((deal, i) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DealCard, { deal }, deal.id || i)) });
|
|
1669
1608
|
}
|
|
1670
1609
|
}
|
|
1671
1610
|
if (typeof data === "object" && data !== null && "deals" in data) {
|
|
@@ -1673,14 +1612,14 @@ function PipedriveFormatter({ data }) {
|
|
|
1673
1612
|
if (Array.isArray(items)) {
|
|
1674
1613
|
const deals = items.filter(isPipedriveDeal);
|
|
1675
1614
|
if (deals.length > 0) {
|
|
1676
|
-
return /* @__PURE__ */ (0,
|
|
1615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "space-y-2", children: deals.map((deal, i) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DealCard, { deal }, deal.id || i)) });
|
|
1677
1616
|
}
|
|
1678
1617
|
}
|
|
1679
1618
|
}
|
|
1680
1619
|
if (typeof data === "object" && data !== null && "deal" in data) {
|
|
1681
1620
|
const item = data.deal;
|
|
1682
1621
|
if (isPipedriveDeal(item)) {
|
|
1683
|
-
return /* @__PURE__ */ (0,
|
|
1622
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DealCard, { deal: item });
|
|
1684
1623
|
}
|
|
1685
1624
|
}
|
|
1686
1625
|
if (typeof data === "object" && data !== null && "data" in data) {
|
|
@@ -1688,19 +1627,19 @@ function PipedriveFormatter({ data }) {
|
|
|
1688
1627
|
if (Array.isArray(items)) {
|
|
1689
1628
|
const deals = items.filter(isPipedriveDeal);
|
|
1690
1629
|
if (deals.length > 0) {
|
|
1691
|
-
return /* @__PURE__ */ (0,
|
|
1630
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "space-y-2", children: deals.map((deal, i) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DealCard, { deal }, deal.id || i)) });
|
|
1692
1631
|
}
|
|
1693
1632
|
}
|
|
1694
1633
|
if (isPipedriveDeal(items)) {
|
|
1695
|
-
return /* @__PURE__ */ (0,
|
|
1634
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DealCard, { deal: items });
|
|
1696
1635
|
}
|
|
1697
1636
|
}
|
|
1698
|
-
return /* @__PURE__ */ (0,
|
|
1637
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.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) });
|
|
1699
1638
|
}
|
|
1700
1639
|
|
|
1701
1640
|
// src/ui/formatters/compute.tsx
|
|
1702
|
-
var
|
|
1703
|
-
var
|
|
1641
|
+
var import_lucide_react15 = require("lucide-react");
|
|
1642
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1704
1643
|
function isComputeData(data) {
|
|
1705
1644
|
if (typeof data !== "object" || data === null) return false;
|
|
1706
1645
|
return "stdout" in data || "stderr" in data || "exit_code" in data || "exitCode" in data || "output" in data;
|
|
@@ -1712,47 +1651,47 @@ function formatDuration(ms) {
|
|
|
1712
1651
|
}
|
|
1713
1652
|
function ComputeFormatter({ data }) {
|
|
1714
1653
|
if (!isComputeData(data)) {
|
|
1715
|
-
return /* @__PURE__ */ (0,
|
|
1654
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.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) });
|
|
1716
1655
|
}
|
|
1717
1656
|
const exitCode = data.exit_code ?? data.exitCode;
|
|
1718
1657
|
const duration = data.duration_ms ?? data.duration;
|
|
1719
1658
|
const stdout = data.stdout || data.output || "";
|
|
1720
1659
|
const stderr = data.stderr || data.error || "";
|
|
1721
1660
|
const success = exitCode === void 0 || exitCode === 0;
|
|
1722
|
-
return /* @__PURE__ */ (0,
|
|
1723
|
-
/* @__PURE__ */ (0,
|
|
1724
|
-
/* @__PURE__ */ (0,
|
|
1725
|
-
/* @__PURE__ */ (0,
|
|
1726
|
-
/* @__PURE__ */ (0,
|
|
1727
|
-
/* @__PURE__ */ (0,
|
|
1728
|
-
duration !== void 0 && /* @__PURE__ */ (0,
|
|
1729
|
-
exitCode !== void 0 && /* @__PURE__ */ (0,
|
|
1730
|
-
success ? /* @__PURE__ */ (0,
|
|
1661
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "space-y-2", children: [
|
|
1662
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "rounded-lg border border-border bg-background overflow-hidden", children: [
|
|
1663
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex items-center gap-2 px-3 py-1.5 bg-muted border-b border-border", children: [
|
|
1664
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react15.Terminal, { className: "h-3.5 w-3.5 text-muted-foreground" }),
|
|
1665
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "text-xs text-muted-foreground flex-1", children: "Output" }),
|
|
1666
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
1667
|
+
duration !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "text-xs text-muted-foreground", children: formatDuration(duration) }),
|
|
1668
|
+
exitCode !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: `inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs ${success ? "text-green-500 bg-green-500/10" : "text-destructive bg-destructive/10"}`, children: [
|
|
1669
|
+
success ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react15.Check, { className: "h-3 w-3" }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react15.X, { className: "h-3 w-3" }),
|
|
1731
1670
|
"exit ",
|
|
1732
1671
|
exitCode
|
|
1733
1672
|
] })
|
|
1734
1673
|
] })
|
|
1735
1674
|
] }),
|
|
1736
|
-
stdout && /* @__PURE__ */ (0,
|
|
1737
|
-
stderr && /* @__PURE__ */ (0,
|
|
1738
|
-
/* @__PURE__ */ (0,
|
|
1739
|
-
/* @__PURE__ */ (0,
|
|
1740
|
-
/* @__PURE__ */ (0,
|
|
1675
|
+
stdout && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("pre", { className: "p-3 text-xs text-foreground overflow-x-auto max-h-80 overflow-y-auto font-mono whitespace-pre-wrap", children: stdout }),
|
|
1676
|
+
stderr && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "border-t border-border", children: [
|
|
1677
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex items-center gap-1.5 px-3 py-1 bg-destructive/5", children: [
|
|
1678
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react15.AlertTriangle, { className: "h-3 w-3 text-destructive" }),
|
|
1679
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "text-xs text-destructive", children: "stderr" })
|
|
1741
1680
|
] }),
|
|
1742
|
-
/* @__PURE__ */ (0,
|
|
1681
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("pre", { className: "p-3 text-xs text-destructive overflow-x-auto max-h-40 overflow-y-auto font-mono whitespace-pre-wrap", children: stderr })
|
|
1743
1682
|
] }),
|
|
1744
|
-
!stdout && !stderr && /* @__PURE__ */ (0,
|
|
1683
|
+
!stdout && !stderr && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "p-3 text-xs text-muted-foreground italic", children: "No output" })
|
|
1745
1684
|
] }),
|
|
1746
|
-
data.files && data.files.length > 0 && /* @__PURE__ */ (0,
|
|
1747
|
-
/* @__PURE__ */ (0,
|
|
1748
|
-
file.url ? /* @__PURE__ */ (0,
|
|
1685
|
+
data.files && data.files.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "space-y-1", children: data.files.map((file, i) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex items-center gap-2 rounded-lg border border-border bg-card p-2", children: [
|
|
1686
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react15.Terminal, { className: "h-3.5 w-3.5 text-muted-foreground shrink-0" }),
|
|
1687
|
+
file.url ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("a", { href: file.url, target: "_blank", rel: "noopener noreferrer", className: "text-xs text-primary hover:underline truncate", children: file.name || file.url }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "text-xs text-foreground truncate", children: file.name })
|
|
1749
1688
|
] }, i)) })
|
|
1750
1689
|
] });
|
|
1751
1690
|
}
|
|
1752
1691
|
|
|
1753
1692
|
// src/ui/formatters/resend.tsx
|
|
1754
|
-
var
|
|
1755
|
-
var
|
|
1693
|
+
var import_lucide_react16 = require("lucide-react");
|
|
1694
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1756
1695
|
function isResendData(data) {
|
|
1757
1696
|
return typeof data === "object" && data !== null && ("id" in data || "to" in data) && ("subject" in data || "from" in data || "created_at" in data);
|
|
1758
1697
|
}
|
|
@@ -1770,49 +1709,49 @@ function formatTimestamp(dateStr) {
|
|
|
1770
1709
|
}
|
|
1771
1710
|
}
|
|
1772
1711
|
function ResendCard({ email }) {
|
|
1773
|
-
return /* @__PURE__ */ (0,
|
|
1774
|
-
/* @__PURE__ */ (0,
|
|
1775
|
-
/* @__PURE__ */ (0,
|
|
1776
|
-
/* @__PURE__ */ (0,
|
|
1777
|
-
/* @__PURE__ */ (0,
|
|
1778
|
-
email.subject && /* @__PURE__ */ (0,
|
|
1712
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "rounded-lg border border-border bg-card p-3 space-y-2", children: [
|
|
1713
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-start gap-2", children: [
|
|
1714
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "flex h-8 w-8 items-center justify-center rounded-full bg-green-500/10 shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react16.Send, { className: "h-4 w-4 text-green-500" }) }),
|
|
1715
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
1716
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "text-sm font-medium text-foreground", children: "Email sent" }),
|
|
1717
|
+
email.subject && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "text-xs text-muted-foreground truncate", children: email.subject })
|
|
1779
1718
|
] })
|
|
1780
1719
|
] }),
|
|
1781
|
-
/* @__PURE__ */ (0,
|
|
1782
|
-
/* @__PURE__ */ (0,
|
|
1783
|
-
/* @__PURE__ */ (0,
|
|
1720
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "pl-10 space-y-1 text-xs text-muted-foreground", children: [
|
|
1721
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("p", { children: [
|
|
1722
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "text-foreground", children: "To:" }),
|
|
1784
1723
|
" ",
|
|
1785
1724
|
formatRecipients2(email.to)
|
|
1786
1725
|
] }),
|
|
1787
|
-
email.from && /* @__PURE__ */ (0,
|
|
1788
|
-
/* @__PURE__ */ (0,
|
|
1726
|
+
email.from && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("p", { children: [
|
|
1727
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "text-foreground", children: "From:" }),
|
|
1789
1728
|
" ",
|
|
1790
1729
|
email.from
|
|
1791
1730
|
] }),
|
|
1792
|
-
email.created_at && /* @__PURE__ */ (0,
|
|
1793
|
-
/* @__PURE__ */ (0,
|
|
1731
|
+
email.created_at && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("p", { className: "flex items-center gap-1", children: [
|
|
1732
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react16.Clock, { className: "h-3 w-3" }),
|
|
1794
1733
|
formatTimestamp(email.created_at)
|
|
1795
1734
|
] }),
|
|
1796
|
-
email.last_event && /* @__PURE__ */ (0,
|
|
1735
|
+
email.last_event && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "inline-block rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground capitalize", children: email.last_event })
|
|
1797
1736
|
] })
|
|
1798
1737
|
] });
|
|
1799
1738
|
}
|
|
1800
1739
|
function ResendFormatter({ data }) {
|
|
1801
1740
|
if (isResendData(data)) {
|
|
1802
|
-
return /* @__PURE__ */ (0,
|
|
1741
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ResendCard, { email: data });
|
|
1803
1742
|
}
|
|
1804
1743
|
if (typeof data === "object" && data !== null && "data" in data) {
|
|
1805
1744
|
const inner = data.data;
|
|
1806
1745
|
if (isResendData(inner)) {
|
|
1807
|
-
return /* @__PURE__ */ (0,
|
|
1746
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ResendCard, { email: inner });
|
|
1808
1747
|
}
|
|
1809
1748
|
}
|
|
1810
|
-
return /* @__PURE__ */ (0,
|
|
1749
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.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) });
|
|
1811
1750
|
}
|
|
1812
1751
|
|
|
1813
1752
|
// src/ui/formatters/inbox.tsx
|
|
1814
|
-
var
|
|
1815
|
-
var
|
|
1753
|
+
var import_lucide_react17 = require("lucide-react");
|
|
1754
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1816
1755
|
function isInboxEvent(data) {
|
|
1817
1756
|
if (typeof data !== "object" || data === null) return false;
|
|
1818
1757
|
if ("event_type" in data || "summary" in data) return true;
|
|
@@ -1828,13 +1767,13 @@ function resolveEventType(event) {
|
|
|
1828
1767
|
function getEventIcon(type) {
|
|
1829
1768
|
switch (type) {
|
|
1830
1769
|
case "email":
|
|
1831
|
-
return
|
|
1770
|
+
return import_lucide_react17.Mail;
|
|
1832
1771
|
case "message":
|
|
1833
|
-
return
|
|
1772
|
+
return import_lucide_react17.MessageSquare;
|
|
1834
1773
|
case "calendar":
|
|
1835
|
-
return
|
|
1774
|
+
return import_lucide_react17.Calendar;
|
|
1836
1775
|
default:
|
|
1837
|
-
return
|
|
1776
|
+
return import_lucide_react17.Bell;
|
|
1838
1777
|
}
|
|
1839
1778
|
}
|
|
1840
1779
|
function formatTimestamp2(dateStr) {
|
|
@@ -1860,30 +1799,30 @@ function EventCard2({ event }) {
|
|
|
1860
1799
|
const source = event.provider || event.source;
|
|
1861
1800
|
const snippet = event.description || event.payload?.snippet || event.payload?.text;
|
|
1862
1801
|
const isUnread = event.status === "unread" || event.read === false;
|
|
1863
|
-
return /* @__PURE__ */ (0,
|
|
1864
|
-
/* @__PURE__ */ (0,
|
|
1865
|
-
/* @__PURE__ */ (0,
|
|
1866
|
-
/* @__PURE__ */ (0,
|
|
1867
|
-
/* @__PURE__ */ (0,
|
|
1868
|
-
eventType && /* @__PURE__ */ (0,
|
|
1869
|
-
source && /* @__PURE__ */ (0,
|
|
1870
|
-
isUnread && /* @__PURE__ */ (0,
|
|
1871
|
-
timestamp && /* @__PURE__ */ (0,
|
|
1802
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "rounded-lg border border-border bg-card p-3 space-y-1.5", children: [
|
|
1803
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-start gap-2", children: [
|
|
1804
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Icon, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
|
|
1805
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
1806
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
1807
|
+
eventType && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground capitalize", children: eventType }),
|
|
1808
|
+
source && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-xs text-muted-foreground capitalize", children: source }),
|
|
1809
|
+
isUnread && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "h-1.5 w-1.5 rounded-full bg-primary shrink-0" }),
|
|
1810
|
+
timestamp && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-xs text-muted-foreground ml-auto shrink-0", children: formatTimestamp2(timestamp) })
|
|
1872
1811
|
] }),
|
|
1873
|
-
title && /* @__PURE__ */ (0,
|
|
1812
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "text-sm font-medium text-foreground mt-1 line-clamp-1", children: title })
|
|
1874
1813
|
] })
|
|
1875
1814
|
] }),
|
|
1876
|
-
snippet && /* @__PURE__ */ (0,
|
|
1815
|
+
snippet && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "text-xs text-muted-foreground line-clamp-2 pl-6", children: snippet })
|
|
1877
1816
|
] });
|
|
1878
1817
|
}
|
|
1879
1818
|
function InboxFormatter({ data }) {
|
|
1880
1819
|
if (isInboxEvent(data)) {
|
|
1881
|
-
return /* @__PURE__ */ (0,
|
|
1820
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(EventCard2, { event: data });
|
|
1882
1821
|
}
|
|
1883
1822
|
if (Array.isArray(data)) {
|
|
1884
1823
|
const events = data.filter(isInboxEvent);
|
|
1885
1824
|
if (events.length > 0) {
|
|
1886
|
-
return /* @__PURE__ */ (0,
|
|
1825
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "space-y-2", children: events.map((event, i) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(EventCard2, { event }, event.id || i)) });
|
|
1887
1826
|
}
|
|
1888
1827
|
}
|
|
1889
1828
|
if (typeof data === "object" && data !== null && "events" in data) {
|
|
@@ -1891,16 +1830,16 @@ function InboxFormatter({ data }) {
|
|
|
1891
1830
|
if (Array.isArray(events)) {
|
|
1892
1831
|
const inboxEvents = events.filter(isInboxEvent);
|
|
1893
1832
|
if (inboxEvents.length > 0) {
|
|
1894
|
-
return /* @__PURE__ */ (0,
|
|
1833
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "space-y-2", children: inboxEvents.map((event, i) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(EventCard2, { event }, event.id || i)) });
|
|
1895
1834
|
}
|
|
1896
1835
|
}
|
|
1897
1836
|
}
|
|
1898
|
-
return /* @__PURE__ */ (0,
|
|
1837
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.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) });
|
|
1899
1838
|
}
|
|
1900
1839
|
|
|
1901
1840
|
// src/ui/formatters/discord.tsx
|
|
1902
|
-
var
|
|
1903
|
-
var
|
|
1841
|
+
var import_lucide_react18 = require("lucide-react");
|
|
1842
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1904
1843
|
function isGuildData(data) {
|
|
1905
1844
|
return typeof data === "object" && data !== null && "name" in data && ("owner" in data || "member_count" in data || "icon" in data);
|
|
1906
1845
|
}
|
|
@@ -1928,75 +1867,75 @@ function formatRelativeDate3(dateStr) {
|
|
|
1928
1867
|
}
|
|
1929
1868
|
}
|
|
1930
1869
|
function GuildCard({ guild }) {
|
|
1931
|
-
return /* @__PURE__ */ (0,
|
|
1932
|
-
/* @__PURE__ */ (0,
|
|
1933
|
-
/* @__PURE__ */ (0,
|
|
1934
|
-
/* @__PURE__ */ (0,
|
|
1935
|
-
guild.owner && /* @__PURE__ */ (0,
|
|
1870
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "rounded-lg border border-border bg-card p-3 space-y-1", children: [
|
|
1871
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
1872
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react18.Shield, { className: "h-4 w-4 text-muted-foreground shrink-0" }),
|
|
1873
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-sm font-medium text-foreground flex-1", children: guild.name }),
|
|
1874
|
+
guild.owner && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "rounded-full bg-yellow-500/10 px-2 py-0.5 text-xs text-yellow-600", children: "Owner" })
|
|
1936
1875
|
] }),
|
|
1937
|
-
guild.member_count !== void 0 && /* @__PURE__ */ (0,
|
|
1938
|
-
/* @__PURE__ */ (0,
|
|
1876
|
+
guild.member_count !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-1 pl-6 text-xs text-muted-foreground", children: [
|
|
1877
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react18.Users, { className: "h-3 w-3" }),
|
|
1939
1878
|
guild.member_count,
|
|
1940
1879
|
" members"
|
|
1941
1880
|
] })
|
|
1942
1881
|
] });
|
|
1943
1882
|
}
|
|
1944
1883
|
function ChannelCard2({ channel }) {
|
|
1945
|
-
return /* @__PURE__ */ (0,
|
|
1946
|
-
/* @__PURE__ */ (0,
|
|
1947
|
-
/* @__PURE__ */ (0,
|
|
1948
|
-
channel.member_count !== void 0 && /* @__PURE__ */ (0,
|
|
1884
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-2 rounded-lg border border-border bg-card p-3", children: [
|
|
1885
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react18.Hash, { className: "h-4 w-4 text-muted-foreground shrink-0" }),
|
|
1886
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-sm text-foreground flex-1", children: channel.name || channel.id }),
|
|
1887
|
+
channel.member_count !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "text-xs text-muted-foreground", children: [
|
|
1949
1888
|
channel.member_count,
|
|
1950
1889
|
" members"
|
|
1951
1890
|
] })
|
|
1952
1891
|
] });
|
|
1953
1892
|
}
|
|
1954
1893
|
function MessageCard({ message }) {
|
|
1955
|
-
return /* @__PURE__ */ (0,
|
|
1956
|
-
/* @__PURE__ */ (0,
|
|
1957
|
-
/* @__PURE__ */ (0,
|
|
1958
|
-
message.author?.username && /* @__PURE__ */ (0,
|
|
1959
|
-
message.timestamp && /* @__PURE__ */ (0,
|
|
1894
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "rounded-lg border border-border bg-card p-3 space-y-1.5", children: [
|
|
1895
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
1896
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react18.MessageSquare, { className: "h-4 w-4 text-muted-foreground shrink-0" }),
|
|
1897
|
+
message.author?.username && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-xs font-medium text-foreground", children: message.author.username }),
|
|
1898
|
+
message.timestamp && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-xs text-muted-foreground ml-auto", children: formatRelativeDate3(message.timestamp) })
|
|
1960
1899
|
] }),
|
|
1961
|
-
message.content && /* @__PURE__ */ (0,
|
|
1900
|
+
message.content && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-sm text-foreground line-clamp-3", children: message.content })
|
|
1962
1901
|
] });
|
|
1963
1902
|
}
|
|
1964
1903
|
function DiscordFormatter({ data }) {
|
|
1965
1904
|
if (typeof data === "object" && data !== null && "guilds" in data) {
|
|
1966
1905
|
const guilds = data.guilds;
|
|
1967
1906
|
if (Array.isArray(guilds)) {
|
|
1968
|
-
return /* @__PURE__ */ (0,
|
|
1907
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "space-y-1.5", children: guilds.filter(isGuildData).map((g, i) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(GuildCard, { guild: g }, g.id || i)) });
|
|
1969
1908
|
}
|
|
1970
1909
|
}
|
|
1971
1910
|
if (typeof data === "object" && data !== null && "channels" in data) {
|
|
1972
1911
|
const channels = data.channels;
|
|
1973
1912
|
if (Array.isArray(channels)) {
|
|
1974
|
-
return /* @__PURE__ */ (0,
|
|
1913
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "space-y-1.5", children: channels.filter(isChannelData).map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ChannelCard2, { channel: c }, c.id || i)) });
|
|
1975
1914
|
}
|
|
1976
1915
|
}
|
|
1977
1916
|
if (typeof data === "object" && data !== null && "messages" in data) {
|
|
1978
1917
|
const messages = data.messages;
|
|
1979
1918
|
if (Array.isArray(messages)) {
|
|
1980
|
-
return /* @__PURE__ */ (0,
|
|
1919
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "space-y-2", children: messages.filter(isMessageData).map((m, i) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(MessageCard, { message: m }, m.id || i)) });
|
|
1981
1920
|
}
|
|
1982
1921
|
}
|
|
1983
|
-
if (isMessageData(data)) return /* @__PURE__ */ (0,
|
|
1922
|
+
if (isMessageData(data)) return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(MessageCard, { message: data });
|
|
1984
1923
|
if (Array.isArray(data)) {
|
|
1985
1924
|
const guilds = data.filter(isGuildData);
|
|
1986
1925
|
if (guilds.length > 0) {
|
|
1987
|
-
return /* @__PURE__ */ (0,
|
|
1926
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "space-y-1.5", children: guilds.map((g, i) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(GuildCard, { guild: g }, g.id || i)) });
|
|
1988
1927
|
}
|
|
1989
1928
|
const messages = data.filter(isMessageData);
|
|
1990
1929
|
if (messages.length > 0) {
|
|
1991
|
-
return /* @__PURE__ */ (0,
|
|
1930
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "space-y-2", children: messages.map((m, i) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(MessageCard, { message: m }, m.id || i)) });
|
|
1992
1931
|
}
|
|
1993
1932
|
}
|
|
1994
|
-
return /* @__PURE__ */ (0,
|
|
1933
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.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) });
|
|
1995
1934
|
}
|
|
1996
1935
|
|
|
1997
1936
|
// src/ui/formatters/notion.tsx
|
|
1998
|
-
var
|
|
1999
|
-
var
|
|
1937
|
+
var import_lucide_react19 = require("lucide-react");
|
|
1938
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
2000
1939
|
function isNotionPage(data) {
|
|
2001
1940
|
if (typeof data !== "object" || data === null) return false;
|
|
2002
1941
|
if ("properties" in data) return true;
|
|
@@ -2047,26 +1986,26 @@ function formatRelativeDate4(dateStr) {
|
|
|
2047
1986
|
}
|
|
2048
1987
|
function PageCard({ page }) {
|
|
2049
1988
|
const title = extractPageTitle(page);
|
|
2050
|
-
return /* @__PURE__ */ (0,
|
|
2051
|
-
/* @__PURE__ */ (0,
|
|
2052
|
-
/* @__PURE__ */ (0,
|
|
2053
|
-
/* @__PURE__ */ (0,
|
|
2054
|
-
(page.last_edited_time || page.lastEditedTime) && /* @__PURE__ */ (0,
|
|
2055
|
-
/* @__PURE__ */ (0,
|
|
1989
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "rounded-lg border border-border bg-card p-3 space-y-1", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-start gap-2", children: [
|
|
1990
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react19.FileText, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
|
|
1991
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-sm font-medium text-foreground truncate", children: page.url ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("a", { href: page.url, target: "_blank", rel: "noopener noreferrer", className: "hover:underline", children: title }) : title }) }),
|
|
1992
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-center gap-1.5 shrink-0", children: [
|
|
1993
|
+
(page.last_edited_time || page.lastEditedTime) && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
1994
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react19.Clock, { className: "h-3 w-3" }),
|
|
2056
1995
|
formatRelativeDate4(page.last_edited_time || page.lastEditedTime)
|
|
2057
1996
|
] }),
|
|
2058
|
-
page.url && /* @__PURE__ */ (0,
|
|
1997
|
+
page.url && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("a", { href: page.url, target: "_blank", rel: "noopener noreferrer", className: "text-muted-foreground hover:text-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react19.ExternalLink, { className: "h-3 w-3" }) })
|
|
2059
1998
|
] })
|
|
2060
1999
|
] }) });
|
|
2061
2000
|
}
|
|
2062
2001
|
function DatabaseCard({ db }) {
|
|
2063
2002
|
const title = typeof db.title === "string" ? db.title : Array.isArray(db.title) && db.title.length > 0 ? db.title.map((t) => t.plain_text || "").join("") : "Untitled database";
|
|
2064
2003
|
const desc = typeof db.description === "string" ? db.description : Array.isArray(db.description) && db.description.length > 0 ? db.description.map((d) => d.plain_text || "").join("") : null;
|
|
2065
|
-
return /* @__PURE__ */ (0,
|
|
2066
|
-
/* @__PURE__ */ (0,
|
|
2067
|
-
/* @__PURE__ */ (0,
|
|
2068
|
-
/* @__PURE__ */ (0,
|
|
2069
|
-
desc && /* @__PURE__ */ (0,
|
|
2004
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "rounded-lg border border-border bg-card p-3 space-y-1", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-start gap-2", children: [
|
|
2005
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react19.Database, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
|
|
2006
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
2007
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-sm font-medium text-foreground truncate", children: db.url ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("a", { href: db.url, target: "_blank", rel: "noopener noreferrer", className: "hover:underline", children: title }) : title }),
|
|
2008
|
+
desc && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-xs text-muted-foreground line-clamp-2", children: desc })
|
|
2070
2009
|
] })
|
|
2071
2010
|
] }) });
|
|
2072
2011
|
}
|
|
@@ -2074,13 +2013,13 @@ function NotionFormatter({ data }) {
|
|
|
2074
2013
|
if (typeof data === "object" && data !== null && "pages" in data) {
|
|
2075
2014
|
const pages = data.pages;
|
|
2076
2015
|
if (Array.isArray(pages)) {
|
|
2077
|
-
return /* @__PURE__ */ (0,
|
|
2016
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "space-y-1.5", children: pages.filter(isNotionPage).map((p, i) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(PageCard, { page: p }, p.id || i)) });
|
|
2078
2017
|
}
|
|
2079
2018
|
}
|
|
2080
2019
|
if (typeof data === "object" && data !== null && "databases" in data) {
|
|
2081
2020
|
const dbs = data.databases;
|
|
2082
2021
|
if (Array.isArray(dbs)) {
|
|
2083
|
-
return /* @__PURE__ */ (0,
|
|
2022
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "space-y-1.5", children: dbs.filter(isNotionDatabase).map((d, i) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(DatabaseCard, { db: d }, d.id || i)) });
|
|
2084
2023
|
}
|
|
2085
2024
|
}
|
|
2086
2025
|
if (typeof data === "object" && data !== null && "results" in data) {
|
|
@@ -2088,28 +2027,28 @@ function NotionFormatter({ data }) {
|
|
|
2088
2027
|
if (Array.isArray(results)) {
|
|
2089
2028
|
const pages = results.filter(isNotionPage);
|
|
2090
2029
|
if (pages.length > 0) {
|
|
2091
|
-
return /* @__PURE__ */ (0,
|
|
2030
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "space-y-1.5", children: pages.map((p, i) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(PageCard, { page: p }, p.id || i)) });
|
|
2092
2031
|
}
|
|
2093
2032
|
const dbs = results.filter(isNotionDatabase);
|
|
2094
2033
|
if (dbs.length > 0) {
|
|
2095
|
-
return /* @__PURE__ */ (0,
|
|
2034
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "space-y-1.5", children: dbs.map((d, i) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(DatabaseCard, { db: d }, d.id || i)) });
|
|
2096
2035
|
}
|
|
2097
2036
|
}
|
|
2098
2037
|
}
|
|
2099
|
-
if (isNotionPage(data)) return /* @__PURE__ */ (0,
|
|
2100
|
-
if (isNotionDatabase(data)) return /* @__PURE__ */ (0,
|
|
2038
|
+
if (isNotionPage(data)) return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(PageCard, { page: data });
|
|
2039
|
+
if (isNotionDatabase(data)) return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(DatabaseCard, { db: data });
|
|
2101
2040
|
if (Array.isArray(data)) {
|
|
2102
2041
|
const pages = data.filter(isNotionPage);
|
|
2103
2042
|
if (pages.length > 0) {
|
|
2104
|
-
return /* @__PURE__ */ (0,
|
|
2043
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "space-y-1.5", children: pages.map((p, i) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(PageCard, { page: p }, p.id || i)) });
|
|
2105
2044
|
}
|
|
2106
2045
|
}
|
|
2107
|
-
return /* @__PURE__ */ (0,
|
|
2046
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.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) });
|
|
2108
2047
|
}
|
|
2109
2048
|
|
|
2110
2049
|
// src/ui/formatters/twitter.tsx
|
|
2111
|
-
var
|
|
2112
|
-
var
|
|
2050
|
+
var import_lucide_react20 = require("lucide-react");
|
|
2051
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2113
2052
|
function isTweetData(data) {
|
|
2114
2053
|
return typeof data === "object" && data !== null && "text" in data;
|
|
2115
2054
|
}
|
|
@@ -2135,31 +2074,31 @@ function TweetCard({ tweet }) {
|
|
|
2135
2074
|
const likes = tweet.public_metrics?.like_count ?? tweet.like_count;
|
|
2136
2075
|
const retweets = tweet.public_metrics?.retweet_count ?? tweet.retweet_count;
|
|
2137
2076
|
const replies = tweet.public_metrics?.reply_count;
|
|
2138
|
-
return /* @__PURE__ */ (0,
|
|
2139
|
-
/* @__PURE__ */ (0,
|
|
2140
|
-
/* @__PURE__ */ (0,
|
|
2141
|
-
username && /* @__PURE__ */ (0,
|
|
2077
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "rounded-lg border border-border bg-card p-3 space-y-1.5", children: [
|
|
2078
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
2079
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react20.MessageCircle, { className: "h-4 w-4 text-muted-foreground shrink-0" }),
|
|
2080
|
+
username && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: "text-xs font-medium text-foreground", children: [
|
|
2142
2081
|
"@",
|
|
2143
2082
|
username
|
|
2144
2083
|
] }),
|
|
2145
|
-
tweet.author?.name && /* @__PURE__ */ (0,
|
|
2146
|
-
tweet.created_at && /* @__PURE__ */ (0,
|
|
2147
|
-
/* @__PURE__ */ (0,
|
|
2084
|
+
tweet.author?.name && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-xs text-muted-foreground", children: tweet.author.name }),
|
|
2085
|
+
tweet.created_at && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: "flex items-center gap-1 text-xs text-muted-foreground ml-auto", children: [
|
|
2086
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react20.Clock, { className: "h-3 w-3" }),
|
|
2148
2087
|
formatRelativeDate5(tweet.created_at)
|
|
2149
2088
|
] })
|
|
2150
2089
|
] }),
|
|
2151
|
-
tweet.text && /* @__PURE__ */ (0,
|
|
2152
|
-
(likes !== void 0 || retweets !== void 0 || replies !== void 0) && /* @__PURE__ */ (0,
|
|
2153
|
-
likes !== void 0 && /* @__PURE__ */ (0,
|
|
2154
|
-
/* @__PURE__ */ (0,
|
|
2090
|
+
tweet.text && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-sm text-foreground line-clamp-4", children: tweet.text }),
|
|
2091
|
+
(likes !== void 0 || retweets !== void 0 || replies !== void 0) && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-center gap-4 pt-0.5", children: [
|
|
2092
|
+
likes !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
2093
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react20.Heart, { className: "h-3 w-3" }),
|
|
2155
2094
|
likes
|
|
2156
2095
|
] }),
|
|
2157
|
-
retweets !== void 0 && /* @__PURE__ */ (0,
|
|
2158
|
-
/* @__PURE__ */ (0,
|
|
2096
|
+
retweets !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
2097
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react20.Repeat2, { className: "h-3 w-3" }),
|
|
2159
2098
|
retweets
|
|
2160
2099
|
] }),
|
|
2161
|
-
replies !== void 0 && /* @__PURE__ */ (0,
|
|
2162
|
-
/* @__PURE__ */ (0,
|
|
2100
|
+
replies !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
2101
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react20.MessageCircle, { className: "h-3 w-3" }),
|
|
2163
2102
|
replies
|
|
2164
2103
|
] })
|
|
2165
2104
|
] })
|
|
@@ -2169,26 +2108,26 @@ function TwitterFormatter({ data }) {
|
|
|
2169
2108
|
if (typeof data === "object" && data !== null && "tweets" in data) {
|
|
2170
2109
|
const tweets = data.tweets;
|
|
2171
2110
|
if (Array.isArray(tweets)) {
|
|
2172
|
-
return /* @__PURE__ */ (0,
|
|
2111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "space-y-2", children: tweets.filter(isTweetData).map((t, i) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TweetCard, { tweet: t }, t.id || i)) });
|
|
2173
2112
|
}
|
|
2174
2113
|
}
|
|
2175
2114
|
if (typeof data === "object" && data !== null && "data" in data && Array.isArray(data.data)) {
|
|
2176
2115
|
const tweets = data.data;
|
|
2177
|
-
return /* @__PURE__ */ (0,
|
|
2116
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "space-y-2", children: tweets.filter(isTweetData).map((t, i) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TweetCard, { tweet: t }, t.id || i)) });
|
|
2178
2117
|
}
|
|
2179
|
-
if (isTweetData(data)) return /* @__PURE__ */ (0,
|
|
2118
|
+
if (isTweetData(data)) return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TweetCard, { tweet: data });
|
|
2180
2119
|
if (Array.isArray(data)) {
|
|
2181
2120
|
const tweets = data.filter(isTweetData);
|
|
2182
2121
|
if (tweets.length > 0) {
|
|
2183
|
-
return /* @__PURE__ */ (0,
|
|
2122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "space-y-2", children: tweets.map((t, i) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TweetCard, { tweet: t }, t.id || i)) });
|
|
2184
2123
|
}
|
|
2185
2124
|
}
|
|
2186
|
-
return /* @__PURE__ */ (0,
|
|
2125
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.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) });
|
|
2187
2126
|
}
|
|
2188
2127
|
|
|
2189
2128
|
// src/ui/formatters/telegram.tsx
|
|
2190
|
-
var
|
|
2191
|
-
var
|
|
2129
|
+
var import_lucide_react21 = require("lucide-react");
|
|
2130
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2192
2131
|
function isTelegramMessage(data) {
|
|
2193
2132
|
return typeof data === "object" && data !== null && ("text" in data || "message_id" in data);
|
|
2194
2133
|
}
|
|
@@ -2211,27 +2150,27 @@ function formatUnixDate(ts) {
|
|
|
2211
2150
|
}
|
|
2212
2151
|
function MessageCard2({ message }) {
|
|
2213
2152
|
const fromName = message.from ? [message.from.first_name, message.from.last_name].filter(Boolean).join(" ") || message.from.username : void 0;
|
|
2214
|
-
return /* @__PURE__ */ (0,
|
|
2215
|
-
/* @__PURE__ */ (0,
|
|
2216
|
-
/* @__PURE__ */ (0,
|
|
2217
|
-
fromName && /* @__PURE__ */ (0,
|
|
2218
|
-
/* @__PURE__ */ (0,
|
|
2153
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "rounded-lg border border-border bg-card p-3 space-y-1.5", children: [
|
|
2154
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
2155
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react21.MessageSquare, { className: "h-4 w-4 text-muted-foreground shrink-0" }),
|
|
2156
|
+
fromName && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: "flex items-center gap-1 text-xs font-medium text-foreground", children: [
|
|
2157
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react21.User, { className: "h-3 w-3" }),
|
|
2219
2158
|
fromName
|
|
2220
2159
|
] }),
|
|
2221
|
-
message.chat?.title && /* @__PURE__ */ (0,
|
|
2222
|
-
message.date && /* @__PURE__ */ (0,
|
|
2223
|
-
/* @__PURE__ */ (0,
|
|
2160
|
+
message.chat?.title && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-xs text-muted-foreground", children: message.chat.title }),
|
|
2161
|
+
message.date && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: "flex items-center gap-1 text-xs text-muted-foreground ml-auto", children: [
|
|
2162
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react21.Clock, { className: "h-3 w-3" }),
|
|
2224
2163
|
formatUnixDate(message.date)
|
|
2225
2164
|
] })
|
|
2226
2165
|
] }),
|
|
2227
|
-
message.text && /* @__PURE__ */ (0,
|
|
2166
|
+
message.text && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-sm text-foreground line-clamp-3", children: message.text })
|
|
2228
2167
|
] });
|
|
2229
2168
|
}
|
|
2230
2169
|
function TelegramFormatter({ data }) {
|
|
2231
2170
|
if (typeof data === "object" && data !== null && "messages" in data) {
|
|
2232
2171
|
const msgs = data.messages;
|
|
2233
2172
|
if (Array.isArray(msgs)) {
|
|
2234
|
-
return /* @__PURE__ */ (0,
|
|
2173
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "space-y-2", children: msgs.filter(isTelegramMessage).map((m, i) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(MessageCard2, { message: m }, m.message_id || i)) });
|
|
2235
2174
|
}
|
|
2236
2175
|
}
|
|
2237
2176
|
if (typeof data === "object" && data !== null && "result" in data) {
|
|
@@ -2239,23 +2178,23 @@ function TelegramFormatter({ data }) {
|
|
|
2239
2178
|
if (Array.isArray(result)) {
|
|
2240
2179
|
const msgs = result.filter(isTelegramMessage);
|
|
2241
2180
|
if (msgs.length > 0) {
|
|
2242
|
-
return /* @__PURE__ */ (0,
|
|
2181
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "space-y-2", children: msgs.map((m, i) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(MessageCard2, { message: m }, m.message_id || i)) });
|
|
2243
2182
|
}
|
|
2244
2183
|
}
|
|
2245
2184
|
}
|
|
2246
|
-
if (isTelegramMessage(data)) return /* @__PURE__ */ (0,
|
|
2185
|
+
if (isTelegramMessage(data)) return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(MessageCard2, { message: data });
|
|
2247
2186
|
if (Array.isArray(data)) {
|
|
2248
2187
|
const msgs = data.filter(isTelegramMessage);
|
|
2249
2188
|
if (msgs.length > 0) {
|
|
2250
|
-
return /* @__PURE__ */ (0,
|
|
2189
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "space-y-2", children: msgs.map((m, i) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(MessageCard2, { message: m }, m.message_id || i)) });
|
|
2251
2190
|
}
|
|
2252
2191
|
}
|
|
2253
|
-
return /* @__PURE__ */ (0,
|
|
2192
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.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) });
|
|
2254
2193
|
}
|
|
2255
2194
|
|
|
2256
2195
|
// src/ui/formatters/stripe.tsx
|
|
2257
|
-
var
|
|
2258
|
-
var
|
|
2196
|
+
var import_lucide_react22 = require("lucide-react");
|
|
2197
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2259
2198
|
function isCustomer(data) {
|
|
2260
2199
|
return typeof data === "object" && data !== null && ("email" in data || "name" in data) && !("amount_due" in data) && !("plan" in data);
|
|
2261
2200
|
}
|
|
@@ -2294,106 +2233,106 @@ var STATUS_STYLES = {
|
|
|
2294
2233
|
trialing: "bg-yellow-500/10 text-yellow-600"
|
|
2295
2234
|
};
|
|
2296
2235
|
function StatusBadge({ status }) {
|
|
2297
|
-
return /* @__PURE__ */ (0,
|
|
2236
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: `rounded-full px-2 py-0.5 text-xs ${STATUS_STYLES[status] || "bg-muted text-muted-foreground"}`, children: status });
|
|
2298
2237
|
}
|
|
2299
2238
|
function CustomerCard({ customer }) {
|
|
2300
|
-
return /* @__PURE__ */ (0,
|
|
2301
|
-
/* @__PURE__ */ (0,
|
|
2302
|
-
/* @__PURE__ */ (0,
|
|
2303
|
-
/* @__PURE__ */ (0,
|
|
2304
|
-
customer.email && /* @__PURE__ */ (0,
|
|
2239
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "rounded-lg border border-border bg-card p-3 space-y-1", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-start gap-2", children: [
|
|
2240
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react22.User, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
|
|
2241
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
2242
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "text-sm font-medium text-foreground", children: customer.name || "Unnamed customer" }),
|
|
2243
|
+
customer.email && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "text-xs text-muted-foreground", children: customer.email })
|
|
2305
2244
|
] })
|
|
2306
2245
|
] }) });
|
|
2307
2246
|
}
|
|
2308
2247
|
function InvoiceCard({ invoice }) {
|
|
2309
|
-
return /* @__PURE__ */ (0,
|
|
2310
|
-
/* @__PURE__ */ (0,
|
|
2311
|
-
/* @__PURE__ */ (0,
|
|
2312
|
-
/* @__PURE__ */ (0,
|
|
2313
|
-
invoice.customer_name && /* @__PURE__ */ (0,
|
|
2248
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "rounded-lg border border-border bg-card p-3 space-y-1", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-start gap-2", children: [
|
|
2249
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react22.FileText, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
|
|
2250
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
2251
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "text-sm font-medium text-foreground", children: invoice.number || invoice.id }),
|
|
2252
|
+
invoice.customer_name && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "text-xs text-muted-foreground", children: invoice.customer_name })
|
|
2314
2253
|
] }),
|
|
2315
|
-
/* @__PURE__ */ (0,
|
|
2316
|
-
invoice.amount_due !== void 0 && invoice.currency && /* @__PURE__ */ (0,
|
|
2317
|
-
invoice.status && /* @__PURE__ */ (0,
|
|
2254
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-center gap-1.5 shrink-0", children: [
|
|
2255
|
+
invoice.amount_due !== void 0 && invoice.currency && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "text-sm font-medium text-foreground", children: formatAmount(invoice.amount_due, invoice.currency) }),
|
|
2256
|
+
invoice.status && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(StatusBadge, { status: invoice.status })
|
|
2318
2257
|
] })
|
|
2319
2258
|
] }) });
|
|
2320
2259
|
}
|
|
2321
2260
|
function SubscriptionCard({ sub }) {
|
|
2322
|
-
return /* @__PURE__ */ (0,
|
|
2323
|
-
/* @__PURE__ */ (0,
|
|
2324
|
-
/* @__PURE__ */ (0,
|
|
2325
|
-
/* @__PURE__ */ (0,
|
|
2261
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "rounded-lg border border-border bg-card p-3 space-y-1", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-start gap-2", children: [
|
|
2262
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react22.RefreshCw, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
|
|
2263
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
2264
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("p", { className: "text-sm font-medium text-foreground", children: [
|
|
2326
2265
|
sub.plan?.nickname || "Subscription",
|
|
2327
|
-
sub.plan?.amount !== void 0 && sub.plan?.currency && /* @__PURE__ */ (0,
|
|
2266
|
+
sub.plan?.amount !== void 0 && sub.plan?.currency && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { className: "text-muted-foreground font-normal", children: [
|
|
2328
2267
|
" ",
|
|
2329
2268
|
formatAmount(sub.plan.amount, sub.plan.currency),
|
|
2330
2269
|
"/",
|
|
2331
2270
|
sub.plan.interval
|
|
2332
2271
|
] })
|
|
2333
2272
|
] }),
|
|
2334
|
-
sub.current_period_end && /* @__PURE__ */ (0,
|
|
2335
|
-
/* @__PURE__ */ (0,
|
|
2273
|
+
sub.current_period_end && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("p", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
2274
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react22.Clock, { className: "h-3 w-3" }),
|
|
2336
2275
|
"Renews ",
|
|
2337
2276
|
formatUnixDate2(sub.current_period_end)
|
|
2338
2277
|
] })
|
|
2339
2278
|
] }),
|
|
2340
|
-
sub.status && /* @__PURE__ */ (0,
|
|
2279
|
+
sub.status && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(StatusBadge, { status: sub.status })
|
|
2341
2280
|
] }) });
|
|
2342
2281
|
}
|
|
2343
2282
|
function BalanceDisplay({ balance }) {
|
|
2344
|
-
return /* @__PURE__ */ (0,
|
|
2345
|
-
/* @__PURE__ */ (0,
|
|
2346
|
-
/* @__PURE__ */ (0,
|
|
2347
|
-
/* @__PURE__ */ (0,
|
|
2283
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "rounded-lg border border-border bg-card p-3 space-y-2", children: [
|
|
2284
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
2285
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react22.CreditCard, { className: "h-4 w-4 text-muted-foreground" }),
|
|
2286
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "text-sm font-medium text-foreground", children: "Balance" })
|
|
2348
2287
|
] }),
|
|
2349
|
-
/* @__PURE__ */ (0,
|
|
2350
|
-
balance.available && balance.available.length > 0 && /* @__PURE__ */ (0,
|
|
2351
|
-
/* @__PURE__ */ (0,
|
|
2352
|
-
balance.available.map((b, i) => /* @__PURE__ */ (0,
|
|
2288
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "grid grid-cols-2 gap-4 pl-6", children: [
|
|
2289
|
+
balance.available && balance.available.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { children: [
|
|
2290
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "text-xs text-muted-foreground", children: "Available" }),
|
|
2291
|
+
balance.available.map((b, i) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "text-sm font-medium text-foreground", children: formatAmount(b.amount, b.currency) }, i))
|
|
2353
2292
|
] }),
|
|
2354
|
-
balance.pending && balance.pending.length > 0 && /* @__PURE__ */ (0,
|
|
2355
|
-
/* @__PURE__ */ (0,
|
|
2356
|
-
balance.pending.map((b, i) => /* @__PURE__ */ (0,
|
|
2293
|
+
balance.pending && balance.pending.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { children: [
|
|
2294
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "text-xs text-muted-foreground", children: "Pending" }),
|
|
2295
|
+
balance.pending.map((b, i) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "text-sm font-medium text-foreground", children: formatAmount(b.amount, b.currency) }, i))
|
|
2357
2296
|
] })
|
|
2358
2297
|
] })
|
|
2359
2298
|
] });
|
|
2360
2299
|
}
|
|
2361
2300
|
function StripeFormatter({ data }) {
|
|
2362
|
-
if (isBalance(data)) return /* @__PURE__ */ (0,
|
|
2301
|
+
if (isBalance(data)) return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(BalanceDisplay, { balance: data });
|
|
2363
2302
|
if (typeof data === "object" && data !== null && "data" in data && Array.isArray(data.data)) {
|
|
2364
2303
|
const items = data.data;
|
|
2365
2304
|
const invoices = items.filter(isInvoice);
|
|
2366
2305
|
if (invoices.length > 0) {
|
|
2367
|
-
return /* @__PURE__ */ (0,
|
|
2306
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "space-y-1.5", children: invoices.map((inv, i) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(InvoiceCard, { invoice: inv }, inv.id || i)) });
|
|
2368
2307
|
}
|
|
2369
2308
|
const subs = items.filter(isSubscription);
|
|
2370
2309
|
if (subs.length > 0) {
|
|
2371
|
-
return /* @__PURE__ */ (0,
|
|
2310
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "space-y-1.5", children: subs.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SubscriptionCard, { sub: s }, s.id || i)) });
|
|
2372
2311
|
}
|
|
2373
2312
|
const customers = items.filter(isCustomer);
|
|
2374
2313
|
if (customers.length > 0) {
|
|
2375
|
-
return /* @__PURE__ */ (0,
|
|
2314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "space-y-1.5", children: customers.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(CustomerCard, { customer: c }, c.id || i)) });
|
|
2376
2315
|
}
|
|
2377
2316
|
}
|
|
2378
|
-
if (isInvoice(data)) return /* @__PURE__ */ (0,
|
|
2379
|
-
if (isSubscription(data)) return /* @__PURE__ */ (0,
|
|
2380
|
-
if (isCustomer(data)) return /* @__PURE__ */ (0,
|
|
2317
|
+
if (isInvoice(data)) return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(InvoiceCard, { invoice: data });
|
|
2318
|
+
if (isSubscription(data)) return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SubscriptionCard, { sub: data });
|
|
2319
|
+
if (isCustomer(data)) return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(CustomerCard, { customer: data });
|
|
2381
2320
|
if (Array.isArray(data)) {
|
|
2382
2321
|
const invoices = data.filter(isInvoice);
|
|
2383
2322
|
if (invoices.length > 0) {
|
|
2384
|
-
return /* @__PURE__ */ (0,
|
|
2323
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "space-y-1.5", children: invoices.map((inv, i) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(InvoiceCard, { invoice: inv }, inv.id || i)) });
|
|
2385
2324
|
}
|
|
2386
2325
|
const customers = data.filter(isCustomer);
|
|
2387
2326
|
if (customers.length > 0) {
|
|
2388
|
-
return /* @__PURE__ */ (0,
|
|
2327
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "space-y-1.5", children: customers.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(CustomerCard, { customer: c }, c.id || i)) });
|
|
2389
2328
|
}
|
|
2390
2329
|
}
|
|
2391
|
-
return /* @__PURE__ */ (0,
|
|
2330
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.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) });
|
|
2392
2331
|
}
|
|
2393
2332
|
|
|
2394
2333
|
// src/ui/formatters/jira.tsx
|
|
2395
|
-
var
|
|
2396
|
-
var
|
|
2334
|
+
var import_lucide_react23 = require("lucide-react");
|
|
2335
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2397
2336
|
function isJiraIssue(data) {
|
|
2398
2337
|
return typeof data === "object" && data !== null && "key" in data && "fields" in data;
|
|
2399
2338
|
}
|
|
@@ -2409,35 +2348,35 @@ var STATUS_COLORS = {
|
|
|
2409
2348
|
};
|
|
2410
2349
|
function PriorityIcon({ name }) {
|
|
2411
2350
|
const lower = (name || "").toLowerCase();
|
|
2412
|
-
if (lower === "highest" || lower === "critical") return /* @__PURE__ */ (0,
|
|
2413
|
-
if (lower === "high") return /* @__PURE__ */ (0,
|
|
2414
|
-
if (lower === "low") return /* @__PURE__ */ (0,
|
|
2415
|
-
if (lower === "lowest") return /* @__PURE__ */ (0,
|
|
2416
|
-
return /* @__PURE__ */ (0,
|
|
2351
|
+
if (lower === "highest" || lower === "critical") return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react23.ArrowUp, { className: "h-3 w-3 text-destructive" });
|
|
2352
|
+
if (lower === "high") return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react23.ArrowUp, { className: "h-3 w-3 text-orange-500" });
|
|
2353
|
+
if (lower === "low") return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react23.ArrowDown, { className: "h-3 w-3 text-blue-500" });
|
|
2354
|
+
if (lower === "lowest") return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react23.ArrowDown, { className: "h-3 w-3 text-green-500" });
|
|
2355
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react23.Minus, { className: "h-3 w-3 text-muted-foreground" });
|
|
2417
2356
|
}
|
|
2418
2357
|
function IssueCard2({ issue }) {
|
|
2419
2358
|
const f = issue.fields || {};
|
|
2420
2359
|
const statusColor = f.status?.statusCategory?.colorName || "undefined";
|
|
2421
|
-
return /* @__PURE__ */ (0,
|
|
2422
|
-
/* @__PURE__ */ (0,
|
|
2423
|
-
/* @__PURE__ */ (0,
|
|
2424
|
-
/* @__PURE__ */ (0,
|
|
2425
|
-
/* @__PURE__ */ (0,
|
|
2360
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "rounded-lg border border-border bg-card p-3 space-y-1.5", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex items-start gap-2", children: [
|
|
2361
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react23.CircleDot, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
|
|
2362
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
2363
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("p", { className: "text-sm font-medium text-foreground", children: [
|
|
2364
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "text-muted-foreground font-normal", children: issue.key }),
|
|
2426
2365
|
" ",
|
|
2427
2366
|
f.summary
|
|
2428
2367
|
] }),
|
|
2429
|
-
/* @__PURE__ */ (0,
|
|
2430
|
-
f.status?.name && /* @__PURE__ */ (0,
|
|
2431
|
-
/* @__PURE__ */ (0,
|
|
2368
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex items-center gap-2 mt-0.5 flex-wrap", children: [
|
|
2369
|
+
f.status?.name && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: "inline-flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
2370
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: `h-1.5 w-1.5 rounded-full ${STATUS_COLORS[statusColor] || STATUS_COLORS.undefined}` }),
|
|
2432
2371
|
f.status.name
|
|
2433
2372
|
] }),
|
|
2434
|
-
f.priority?.name && /* @__PURE__ */ (0,
|
|
2435
|
-
/* @__PURE__ */ (0,
|
|
2373
|
+
f.priority?.name && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: "inline-flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
2374
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(PriorityIcon, { name: f.priority.name }),
|
|
2436
2375
|
f.priority.name
|
|
2437
2376
|
] }),
|
|
2438
|
-
f.issuetype?.name && /* @__PURE__ */ (0,
|
|
2439
|
-
f.assignee && /* @__PURE__ */ (0,
|
|
2440
|
-
/* @__PURE__ */ (0,
|
|
2377
|
+
f.issuetype?.name && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "text-xs text-muted-foreground", children: f.issuetype.name }),
|
|
2378
|
+
f.assignee && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
2379
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react23.User, { className: "h-3 w-3" }),
|
|
2441
2380
|
f.assignee.displayName || f.assignee.name
|
|
2442
2381
|
] })
|
|
2443
2382
|
] })
|
|
@@ -2445,15 +2384,15 @@ function IssueCard2({ issue }) {
|
|
|
2445
2384
|
] }) });
|
|
2446
2385
|
}
|
|
2447
2386
|
function ProjectCard2({ project }) {
|
|
2448
|
-
return /* @__PURE__ */ (0,
|
|
2449
|
-
/* @__PURE__ */ (0,
|
|
2450
|
-
/* @__PURE__ */ (0,
|
|
2451
|
-
/* @__PURE__ */ (0,
|
|
2452
|
-
/* @__PURE__ */ (0,
|
|
2387
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "rounded-lg border border-border bg-card p-3", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex items-start gap-2", children: [
|
|
2388
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react23.SquareKanban, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
|
|
2389
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
2390
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("p", { className: "text-sm font-medium text-foreground", children: [
|
|
2391
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "text-muted-foreground font-normal", children: project.key }),
|
|
2453
2392
|
" ",
|
|
2454
2393
|
project.name
|
|
2455
2394
|
] }),
|
|
2456
|
-
project.projectTypeKey && /* @__PURE__ */ (0,
|
|
2395
|
+
project.projectTypeKey && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-xs text-muted-foreground", children: project.projectTypeKey })
|
|
2457
2396
|
] })
|
|
2458
2397
|
] }) });
|
|
2459
2398
|
}
|
|
@@ -2461,29 +2400,29 @@ function JiraFormatter({ data }) {
|
|
|
2461
2400
|
if (typeof data === "object" && data !== null && "issues" in data) {
|
|
2462
2401
|
const issues = data.issues;
|
|
2463
2402
|
if (Array.isArray(issues)) {
|
|
2464
|
-
return /* @__PURE__ */ (0,
|
|
2403
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "space-y-1.5", children: issues.filter(isJiraIssue).map((iss, i) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(IssueCard2, { issue: iss }, iss.key || i)) });
|
|
2465
2404
|
}
|
|
2466
2405
|
}
|
|
2467
2406
|
if (typeof data === "object" && data !== null && "projects" in data) {
|
|
2468
2407
|
const projects = data.projects;
|
|
2469
2408
|
if (Array.isArray(projects)) {
|
|
2470
|
-
return /* @__PURE__ */ (0,
|
|
2409
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "space-y-1.5", children: projects.filter(isJiraProject).map((p, i) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ProjectCard2, { project: p }, p.key || i)) });
|
|
2471
2410
|
}
|
|
2472
2411
|
}
|
|
2473
|
-
if (isJiraIssue(data)) return /* @__PURE__ */ (0,
|
|
2474
|
-
if (isJiraProject(data)) return /* @__PURE__ */ (0,
|
|
2412
|
+
if (isJiraIssue(data)) return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(IssueCard2, { issue: data });
|
|
2413
|
+
if (isJiraProject(data)) return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ProjectCard2, { project: data });
|
|
2475
2414
|
if (Array.isArray(data)) {
|
|
2476
2415
|
const issues = data.filter(isJiraIssue);
|
|
2477
2416
|
if (issues.length > 0) {
|
|
2478
|
-
return /* @__PURE__ */ (0,
|
|
2417
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "space-y-1.5", children: issues.map((iss, i) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(IssueCard2, { issue: iss }, iss.key || i)) });
|
|
2479
2418
|
}
|
|
2480
2419
|
}
|
|
2481
|
-
return /* @__PURE__ */ (0,
|
|
2420
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.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) });
|
|
2482
2421
|
}
|
|
2483
2422
|
|
|
2484
2423
|
// src/ui/formatters/salesforce.tsx
|
|
2485
|
-
var
|
|
2486
|
-
var
|
|
2424
|
+
var import_lucide_react24 = require("lucide-react");
|
|
2425
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2487
2426
|
function isContact(data) {
|
|
2488
2427
|
if (typeof data !== "object" || data === null) return false;
|
|
2489
2428
|
return "Name" in data && ("Email" in data || "Phone" in data || "Title" in data);
|
|
@@ -2494,55 +2433,55 @@ function isOpportunity(data) {
|
|
|
2494
2433
|
}
|
|
2495
2434
|
function ContactCard2({ contact }) {
|
|
2496
2435
|
const account = contact.AccountName || contact.Account?.Name;
|
|
2497
|
-
return /* @__PURE__ */ (0,
|
|
2498
|
-
/* @__PURE__ */ (0,
|
|
2499
|
-
/* @__PURE__ */ (0,
|
|
2500
|
-
/* @__PURE__ */ (0,
|
|
2501
|
-
/* @__PURE__ */ (0,
|
|
2502
|
-
contact.Title && /* @__PURE__ */ (0,
|
|
2436
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "rounded-lg border border-border bg-card p-3 space-y-1.5", children: [
|
|
2437
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-start gap-2", children: [
|
|
2438
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react24.User, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
|
|
2439
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
2440
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-sm font-medium text-foreground", children: contact.Name }),
|
|
2441
|
+
contact.Title && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-xs text-muted-foreground", children: contact.Title })
|
|
2503
2442
|
] })
|
|
2504
2443
|
] }),
|
|
2505
|
-
/* @__PURE__ */ (0,
|
|
2506
|
-
contact.Email && /* @__PURE__ */ (0,
|
|
2507
|
-
/* @__PURE__ */ (0,
|
|
2444
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-wrap gap-x-4 gap-y-1 pl-6", children: [
|
|
2445
|
+
contact.Email && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
2446
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react24.Mail, { className: "h-3 w-3" }),
|
|
2508
2447
|
contact.Email
|
|
2509
2448
|
] }),
|
|
2510
|
-
contact.Phone && /* @__PURE__ */ (0,
|
|
2511
|
-
/* @__PURE__ */ (0,
|
|
2449
|
+
contact.Phone && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
2450
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react24.Phone, { className: "h-3 w-3" }),
|
|
2512
2451
|
contact.Phone
|
|
2513
2452
|
] }),
|
|
2514
|
-
account && /* @__PURE__ */ (0,
|
|
2515
|
-
/* @__PURE__ */ (0,
|
|
2453
|
+
account && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
2454
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react24.Building2, { className: "h-3 w-3" }),
|
|
2516
2455
|
account
|
|
2517
2456
|
] })
|
|
2518
2457
|
] })
|
|
2519
2458
|
] });
|
|
2520
2459
|
}
|
|
2521
2460
|
function OpportunityCard({ opp }) {
|
|
2522
|
-
return /* @__PURE__ */ (0,
|
|
2523
|
-
/* @__PURE__ */ (0,
|
|
2524
|
-
/* @__PURE__ */ (0,
|
|
2525
|
-
/* @__PURE__ */ (0,
|
|
2526
|
-
/* @__PURE__ */ (0,
|
|
2527
|
-
/* @__PURE__ */ (0,
|
|
2528
|
-
opp.Amount !== void 0 && /* @__PURE__ */ (0,
|
|
2529
|
-
opp.StageName && /* @__PURE__ */ (0,
|
|
2530
|
-
opp.CloseDate && /* @__PURE__ */ (0,
|
|
2531
|
-
/* @__PURE__ */ (0,
|
|
2461
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "rounded-lg border border-border bg-card p-3 space-y-1.5", children: [
|
|
2462
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-start gap-2", children: [
|
|
2463
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react24.Briefcase, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
|
|
2464
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
2465
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-sm font-medium text-foreground", children: opp.Name }),
|
|
2466
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center gap-2 mt-0.5 flex-wrap", children: [
|
|
2467
|
+
opp.Amount !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "text-xs font-medium text-foreground", children: new Intl.NumberFormat(void 0, { style: "currency", currency: "USD" }).format(opp.Amount) }),
|
|
2468
|
+
opp.StageName && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground", children: opp.StageName }),
|
|
2469
|
+
opp.CloseDate && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
2470
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react24.Calendar, { className: "h-3 w-3" }),
|
|
2532
2471
|
opp.CloseDate
|
|
2533
2472
|
] })
|
|
2534
2473
|
] })
|
|
2535
2474
|
] })
|
|
2536
2475
|
] }),
|
|
2537
|
-
opp.Probability !== void 0 && /* @__PURE__ */ (0,
|
|
2538
|
-
/* @__PURE__ */ (0,
|
|
2539
|
-
/* @__PURE__ */ (0,
|
|
2540
|
-
/* @__PURE__ */ (0,
|
|
2476
|
+
opp.Probability !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "pl-6 space-y-0.5", children: [
|
|
2477
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
2478
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "text-xs text-muted-foreground", children: "Probability" }),
|
|
2479
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "text-xs font-medium text-foreground", children: [
|
|
2541
2480
|
opp.Probability,
|
|
2542
2481
|
"%"
|
|
2543
2482
|
] })
|
|
2544
2483
|
] }),
|
|
2545
|
-
/* @__PURE__ */ (0,
|
|
2484
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "h-1.5 rounded-full bg-muted overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2546
2485
|
"div",
|
|
2547
2486
|
{
|
|
2548
2487
|
className: "h-full rounded-full bg-primary transition-all",
|
|
@@ -2559,31 +2498,31 @@ function SalesforceFormatter({ data }) {
|
|
|
2559
2498
|
const contacts = records.filter(isContact);
|
|
2560
2499
|
const opps = records.filter(isOpportunity);
|
|
2561
2500
|
if (opps.length > 0 && contacts.length === 0) {
|
|
2562
|
-
return /* @__PURE__ */ (0,
|
|
2501
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "space-y-1.5", children: opps.map((o, i) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(OpportunityCard, { opp: o }, o.Id || i)) });
|
|
2563
2502
|
}
|
|
2564
2503
|
if (contacts.length > 0) {
|
|
2565
|
-
return /* @__PURE__ */ (0,
|
|
2504
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "space-y-1.5", children: contacts.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ContactCard2, { contact: c }, c.Id || i)) });
|
|
2566
2505
|
}
|
|
2567
2506
|
}
|
|
2568
2507
|
}
|
|
2569
|
-
if (isOpportunity(data)) return /* @__PURE__ */ (0,
|
|
2570
|
-
if (isContact(data)) return /* @__PURE__ */ (0,
|
|
2508
|
+
if (isOpportunity(data)) return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(OpportunityCard, { opp: data });
|
|
2509
|
+
if (isContact(data)) return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ContactCard2, { contact: data });
|
|
2571
2510
|
if (Array.isArray(data)) {
|
|
2572
2511
|
const contacts = data.filter(isContact);
|
|
2573
2512
|
if (contacts.length > 0) {
|
|
2574
|
-
return /* @__PURE__ */ (0,
|
|
2513
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "space-y-1.5", children: contacts.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ContactCard2, { contact: c }, c.Id || i)) });
|
|
2575
2514
|
}
|
|
2576
2515
|
const opps = data.filter(isOpportunity);
|
|
2577
2516
|
if (opps.length > 0) {
|
|
2578
|
-
return /* @__PURE__ */ (0,
|
|
2517
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "space-y-1.5", children: opps.map((o, i) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(OpportunityCard, { opp: o }, o.Id || i)) });
|
|
2579
2518
|
}
|
|
2580
2519
|
}
|
|
2581
|
-
return /* @__PURE__ */ (0,
|
|
2520
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.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) });
|
|
2582
2521
|
}
|
|
2583
2522
|
|
|
2584
2523
|
// src/ui/formatters/brevo.tsx
|
|
2585
|
-
var
|
|
2586
|
-
var
|
|
2524
|
+
var import_lucide_react25 = require("lucide-react");
|
|
2525
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2587
2526
|
function isBrevoContact(data) {
|
|
2588
2527
|
return typeof data === "object" && data !== null && "email" in data && ("attributes" in data || "id" in data);
|
|
2589
2528
|
}
|
|
@@ -2599,12 +2538,12 @@ var STATUS_STYLES2 = {
|
|
|
2599
2538
|
};
|
|
2600
2539
|
function ContactCard3({ contact }) {
|
|
2601
2540
|
const name = contact.attributes ? [contact.attributes.FIRSTNAME, contact.attributes.LASTNAME].filter(Boolean).join(" ") : void 0;
|
|
2602
|
-
return /* @__PURE__ */ (0,
|
|
2603
|
-
/* @__PURE__ */ (0,
|
|
2604
|
-
/* @__PURE__ */ (0,
|
|
2605
|
-
name && /* @__PURE__ */ (0,
|
|
2606
|
-
/* @__PURE__ */ (0,
|
|
2607
|
-
/* @__PURE__ */ (0,
|
|
2541
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "rounded-lg border border-border bg-card p-3", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-start gap-2", children: [
|
|
2542
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react25.User, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
|
|
2543
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
2544
|
+
name && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "text-sm font-medium text-foreground", children: name }),
|
|
2545
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("p", { className: "text-xs text-muted-foreground flex items-center gap-1", children: [
|
|
2546
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react25.Mail, { className: "h-3 w-3" }),
|
|
2608
2547
|
contact.email
|
|
2609
2548
|
] })
|
|
2610
2549
|
] })
|
|
@@ -2612,26 +2551,26 @@ function ContactCard3({ contact }) {
|
|
|
2612
2551
|
}
|
|
2613
2552
|
function CampaignCard({ campaign }) {
|
|
2614
2553
|
const stats = campaign.statistics?.globalStats;
|
|
2615
|
-
return /* @__PURE__ */ (0,
|
|
2616
|
-
/* @__PURE__ */ (0,
|
|
2617
|
-
/* @__PURE__ */ (0,
|
|
2618
|
-
/* @__PURE__ */ (0,
|
|
2619
|
-
/* @__PURE__ */ (0,
|
|
2620
|
-
campaign.subject && /* @__PURE__ */ (0,
|
|
2554
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "rounded-lg border border-border bg-card p-3 space-y-1.5", children: [
|
|
2555
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-start gap-2", children: [
|
|
2556
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react25.Mail, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
|
|
2557
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
2558
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "text-sm font-medium text-foreground", children: campaign.name }),
|
|
2559
|
+
campaign.subject && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "text-xs text-muted-foreground", children: campaign.subject })
|
|
2621
2560
|
] }),
|
|
2622
|
-
campaign.status && /* @__PURE__ */ (0,
|
|
2561
|
+
campaign.status && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: `rounded-full px-2 py-0.5 text-xs ${STATUS_STYLES2[campaign.status] || "bg-muted text-muted-foreground"}`, children: campaign.status })
|
|
2623
2562
|
] }),
|
|
2624
|
-
stats && /* @__PURE__ */ (0,
|
|
2625
|
-
/* @__PURE__ */ (0,
|
|
2626
|
-
/* @__PURE__ */ (0,
|
|
2563
|
+
stats && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-center gap-4 pl-6", children: [
|
|
2564
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
2565
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react25.BarChart3, { className: "h-3 w-3" }),
|
|
2627
2566
|
stats.sent ?? 0,
|
|
2628
2567
|
" sent"
|
|
2629
2568
|
] }),
|
|
2630
|
-
stats.opened !== void 0 && /* @__PURE__ */ (0,
|
|
2569
|
+
stats.opened !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: "text-xs text-muted-foreground", children: [
|
|
2631
2570
|
stats.opened,
|
|
2632
2571
|
" opened"
|
|
2633
2572
|
] }),
|
|
2634
|
-
stats.clicked !== void 0 && /* @__PURE__ */ (0,
|
|
2573
|
+
stats.clicked !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: "text-xs text-muted-foreground", children: [
|
|
2635
2574
|
stats.clicked,
|
|
2636
2575
|
" clicked"
|
|
2637
2576
|
] })
|
|
@@ -2642,33 +2581,33 @@ function BrevoFormatter({ data }) {
|
|
|
2642
2581
|
if (typeof data === "object" && data !== null && "contacts" in data) {
|
|
2643
2582
|
const contacts = data.contacts;
|
|
2644
2583
|
if (Array.isArray(contacts)) {
|
|
2645
|
-
return /* @__PURE__ */ (0,
|
|
2584
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "space-y-1.5", children: contacts.filter(isBrevoContact).map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ContactCard3, { contact: c }, c.id || i)) });
|
|
2646
2585
|
}
|
|
2647
2586
|
}
|
|
2648
2587
|
if (typeof data === "object" && data !== null && "campaigns" in data) {
|
|
2649
2588
|
const campaigns = data.campaigns;
|
|
2650
2589
|
if (Array.isArray(campaigns)) {
|
|
2651
|
-
return /* @__PURE__ */ (0,
|
|
2590
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "space-y-1.5", children: campaigns.filter(isBrevoCampaign).map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(CampaignCard, { campaign: c }, c.id || i)) });
|
|
2652
2591
|
}
|
|
2653
2592
|
}
|
|
2654
|
-
if (isBrevoContact(data)) return /* @__PURE__ */ (0,
|
|
2655
|
-
if (isBrevoCampaign(data)) return /* @__PURE__ */ (0,
|
|
2593
|
+
if (isBrevoContact(data)) return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ContactCard3, { contact: data });
|
|
2594
|
+
if (isBrevoCampaign(data)) return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(CampaignCard, { campaign: data });
|
|
2656
2595
|
if (Array.isArray(data)) {
|
|
2657
2596
|
const contacts = data.filter(isBrevoContact);
|
|
2658
2597
|
if (contacts.length > 0) {
|
|
2659
|
-
return /* @__PURE__ */ (0,
|
|
2598
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "space-y-1.5", children: contacts.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ContactCard3, { contact: c }, c.id || i)) });
|
|
2660
2599
|
}
|
|
2661
2600
|
const campaigns = data.filter(isBrevoCampaign);
|
|
2662
2601
|
if (campaigns.length > 0) {
|
|
2663
|
-
return /* @__PURE__ */ (0,
|
|
2602
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "space-y-1.5", children: campaigns.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(CampaignCard, { campaign: c }, c.id || i)) });
|
|
2664
2603
|
}
|
|
2665
2604
|
}
|
|
2666
|
-
return /* @__PURE__ */ (0,
|
|
2605
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.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) });
|
|
2667
2606
|
}
|
|
2668
2607
|
|
|
2669
2608
|
// src/ui/formatters/calendly.tsx
|
|
2670
|
-
var
|
|
2671
|
-
var
|
|
2609
|
+
var import_lucide_react26 = require("lucide-react");
|
|
2610
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2672
2611
|
function isCalendlyEvent(data) {
|
|
2673
2612
|
return typeof data === "object" && data !== null && "name" in data && ("start_time" in data || "status" in data);
|
|
2674
2613
|
}
|
|
@@ -2692,36 +2631,36 @@ var STATUS_STYLES3 = {
|
|
|
2692
2631
|
canceled: "bg-destructive/10 text-destructive"
|
|
2693
2632
|
};
|
|
2694
2633
|
function EventCard3({ event }) {
|
|
2695
|
-
return /* @__PURE__ */ (0,
|
|
2696
|
-
/* @__PURE__ */ (0,
|
|
2697
|
-
/* @__PURE__ */ (0,
|
|
2698
|
-
/* @__PURE__ */ (0,
|
|
2699
|
-
event.start_time && /* @__PURE__ */ (0,
|
|
2700
|
-
/* @__PURE__ */ (0,
|
|
2634
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "rounded-lg border border-border bg-card p-3 space-y-1", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-start gap-2", children: [
|
|
2635
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react26.Calendar, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
|
|
2636
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
2637
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-sm font-medium text-foreground", children: event.name }),
|
|
2638
|
+
event.start_time && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("p", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
2639
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react26.Clock, { className: "h-3 w-3" }),
|
|
2701
2640
|
formatDateTime(event.start_time),
|
|
2702
2641
|
event.end_time && ` - ${formatDateTime(event.end_time)}`
|
|
2703
2642
|
] }),
|
|
2704
|
-
event.location?.location && /* @__PURE__ */ (0,
|
|
2705
|
-
/* @__PURE__ */ (0,
|
|
2643
|
+
event.location?.location && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("p", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
2644
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react26.MapPin, { className: "h-3 w-3" }),
|
|
2706
2645
|
event.location.location
|
|
2707
2646
|
] })
|
|
2708
2647
|
] }),
|
|
2709
|
-
event.status && /* @__PURE__ */ (0,
|
|
2648
|
+
event.status && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: `rounded-full px-2 py-0.5 text-xs ${STATUS_STYLES3[event.status] || "bg-muted text-muted-foreground"}`, children: event.status })
|
|
2710
2649
|
] }) });
|
|
2711
2650
|
}
|
|
2712
2651
|
function EventTypeCard({ eventType }) {
|
|
2713
|
-
return /* @__PURE__ */ (0,
|
|
2714
|
-
/* @__PURE__ */ (0,
|
|
2715
|
-
/* @__PURE__ */ (0,
|
|
2716
|
-
/* @__PURE__ */ (0,
|
|
2717
|
-
eventType.description_plain && /* @__PURE__ */ (0,
|
|
2718
|
-
eventType.duration !== void 0 && /* @__PURE__ */ (0,
|
|
2719
|
-
/* @__PURE__ */ (0,
|
|
2652
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "rounded-lg border border-border bg-card p-3", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-start gap-2", children: [
|
|
2653
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react26.Calendar, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
|
|
2654
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
2655
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-sm font-medium text-foreground", children: eventType.name }),
|
|
2656
|
+
eventType.description_plain && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-xs text-muted-foreground line-clamp-2", children: eventType.description_plain }),
|
|
2657
|
+
eventType.duration !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("p", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
2658
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react26.Clock, { className: "h-3 w-3" }),
|
|
2720
2659
|
eventType.duration,
|
|
2721
2660
|
" min"
|
|
2722
2661
|
] })
|
|
2723
2662
|
] }),
|
|
2724
|
-
eventType.active !== void 0 && /* @__PURE__ */ (0,
|
|
2663
|
+
eventType.active !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: `rounded-full px-2 py-0.5 text-xs ${eventType.active ? "bg-green-500/10 text-green-500" : "bg-muted text-muted-foreground"}`, children: eventType.active ? "Active" : "Inactive" })
|
|
2725
2664
|
] }) });
|
|
2726
2665
|
}
|
|
2727
2666
|
function CalendlyFormatter({ data }) {
|
|
@@ -2731,33 +2670,33 @@ function CalendlyFormatter({ data }) {
|
|
|
2731
2670
|
const events = d.collection.filter(isCalendlyEvent);
|
|
2732
2671
|
const types = d.collection.filter(isCalendlyEventType);
|
|
2733
2672
|
if (types.length > 0 && events.length === 0) {
|
|
2734
|
-
return /* @__PURE__ */ (0,
|
|
2673
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "space-y-1.5", children: types.map((t, i) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(EventTypeCard, { eventType: t }, t.uri || i)) });
|
|
2735
2674
|
}
|
|
2736
2675
|
if (events.length > 0) {
|
|
2737
|
-
return /* @__PURE__ */ (0,
|
|
2676
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "space-y-1.5", children: events.map((e, i) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(EventCard3, { event: e }, e.uri || i)) });
|
|
2738
2677
|
}
|
|
2739
2678
|
}
|
|
2740
2679
|
if (Array.isArray(d.scheduled_events)) {
|
|
2741
|
-
return /* @__PURE__ */ (0,
|
|
2680
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "space-y-1.5", children: d.scheduled_events.filter(isCalendlyEvent).map((e, i) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(EventCard3, { event: e }, e.uri || i)) });
|
|
2742
2681
|
}
|
|
2743
2682
|
if (Array.isArray(d.event_types)) {
|
|
2744
|
-
return /* @__PURE__ */ (0,
|
|
2683
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "space-y-1.5", children: d.event_types.filter(isCalendlyEventType).map((t, i) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(EventTypeCard, { eventType: t }, t.uri || i)) });
|
|
2745
2684
|
}
|
|
2746
2685
|
}
|
|
2747
|
-
if (isCalendlyEvent(data)) return /* @__PURE__ */ (0,
|
|
2748
|
-
if (isCalendlyEventType(data)) return /* @__PURE__ */ (0,
|
|
2686
|
+
if (isCalendlyEvent(data)) return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(EventCard3, { event: data });
|
|
2687
|
+
if (isCalendlyEventType(data)) return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(EventTypeCard, { eventType: data });
|
|
2749
2688
|
if (Array.isArray(data)) {
|
|
2750
2689
|
const events = data.filter(isCalendlyEvent);
|
|
2751
2690
|
if (events.length > 0) {
|
|
2752
|
-
return /* @__PURE__ */ (0,
|
|
2691
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "space-y-1.5", children: events.map((e, i) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(EventCard3, { event: e }, e.uri || i)) });
|
|
2753
2692
|
}
|
|
2754
2693
|
}
|
|
2755
|
-
return /* @__PURE__ */ (0,
|
|
2694
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.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) });
|
|
2756
2695
|
}
|
|
2757
2696
|
|
|
2758
2697
|
// src/ui/formatters/twilio.tsx
|
|
2759
|
-
var
|
|
2760
|
-
var
|
|
2698
|
+
var import_lucide_react27 = require("lucide-react");
|
|
2699
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2761
2700
|
function isTwilioMessage(data) {
|
|
2762
2701
|
return typeof data === "object" && data !== null && ("body" in data || "sid" in data) && ("from" in data || "to" in data);
|
|
2763
2702
|
}
|
|
@@ -2789,48 +2728,48 @@ var STATUS_STYLES4 = {
|
|
|
2789
2728
|
};
|
|
2790
2729
|
function MessageCard3({ message }) {
|
|
2791
2730
|
const isInbound = message.direction?.includes("inbound");
|
|
2792
|
-
const DirectionIcon = isInbound ?
|
|
2731
|
+
const DirectionIcon = isInbound ? import_lucide_react27.ArrowDownLeft : import_lucide_react27.ArrowUpRight;
|
|
2793
2732
|
const dateStr = message.date_sent || message.date_created;
|
|
2794
|
-
return /* @__PURE__ */ (0,
|
|
2795
|
-
/* @__PURE__ */ (0,
|
|
2796
|
-
/* @__PURE__ */ (0,
|
|
2797
|
-
/* @__PURE__ */ (0,
|
|
2798
|
-
/* @__PURE__ */ (0,
|
|
2799
|
-
message.from && /* @__PURE__ */ (0,
|
|
2800
|
-
/* @__PURE__ */ (0,
|
|
2801
|
-
message.to && /* @__PURE__ */ (0,
|
|
2733
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "rounded-lg border border-border bg-card p-3 space-y-1.5", children: [
|
|
2734
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
2735
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react27.Phone, { className: "h-4 w-4 text-muted-foreground shrink-0" }),
|
|
2736
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(DirectionIcon, { className: "h-3 w-3 text-muted-foreground shrink-0" }),
|
|
2737
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-center gap-1.5 flex-1 min-w-0", children: [
|
|
2738
|
+
message.from && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-xs text-muted-foreground", children: message.from }),
|
|
2739
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-xs text-muted-foreground", children: "\u2192" }),
|
|
2740
|
+
message.to && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-xs text-muted-foreground", children: message.to })
|
|
2802
2741
|
] }),
|
|
2803
|
-
/* @__PURE__ */ (0,
|
|
2804
|
-
message.status && /* @__PURE__ */ (0,
|
|
2805
|
-
dateStr && /* @__PURE__ */ (0,
|
|
2806
|
-
/* @__PURE__ */ (0,
|
|
2742
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-center gap-1.5 shrink-0", children: [
|
|
2743
|
+
message.status && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: `rounded-full px-2 py-0.5 text-xs ${STATUS_STYLES4[message.status] || "bg-muted text-muted-foreground"}`, children: message.status }),
|
|
2744
|
+
dateStr && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
2745
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react27.Clock, { className: "h-3 w-3" }),
|
|
2807
2746
|
formatRelativeDate6(dateStr)
|
|
2808
2747
|
] })
|
|
2809
2748
|
] })
|
|
2810
2749
|
] }),
|
|
2811
|
-
message.body && /* @__PURE__ */ (0,
|
|
2750
|
+
message.body && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-sm text-foreground line-clamp-3", children: message.body })
|
|
2812
2751
|
] });
|
|
2813
2752
|
}
|
|
2814
2753
|
function TwilioFormatter({ data }) {
|
|
2815
2754
|
if (typeof data === "object" && data !== null && "messages" in data) {
|
|
2816
2755
|
const msgs = data.messages;
|
|
2817
2756
|
if (Array.isArray(msgs)) {
|
|
2818
|
-
return /* @__PURE__ */ (0,
|
|
2757
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "space-y-1.5", children: msgs.filter(isTwilioMessage).map((m, i) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(MessageCard3, { message: m }, m.sid || i)) });
|
|
2819
2758
|
}
|
|
2820
2759
|
}
|
|
2821
|
-
if (isTwilioMessage(data)) return /* @__PURE__ */ (0,
|
|
2760
|
+
if (isTwilioMessage(data)) return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(MessageCard3, { message: data });
|
|
2822
2761
|
if (Array.isArray(data)) {
|
|
2823
2762
|
const msgs = data.filter(isTwilioMessage);
|
|
2824
2763
|
if (msgs.length > 0) {
|
|
2825
|
-
return /* @__PURE__ */ (0,
|
|
2764
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "space-y-1.5", children: msgs.map((m, i) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(MessageCard3, { message: m }, m.sid || i)) });
|
|
2826
2765
|
}
|
|
2827
2766
|
}
|
|
2828
|
-
return /* @__PURE__ */ (0,
|
|
2767
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.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) });
|
|
2829
2768
|
}
|
|
2830
2769
|
|
|
2831
2770
|
// src/ui/formatters/linkedin.tsx
|
|
2832
|
-
var
|
|
2833
|
-
var
|
|
2771
|
+
var import_lucide_react28 = require("lucide-react");
|
|
2772
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2834
2773
|
function isProfile(data) {
|
|
2835
2774
|
if (typeof data !== "object" || data === null) return false;
|
|
2836
2775
|
return "localizedFirstName" in data || "firstName" in data || "name" in data && "headline" in data;
|
|
@@ -2855,13 +2794,13 @@ function formatRelativeDate7(dateStr) {
|
|
|
2855
2794
|
}
|
|
2856
2795
|
function ProfileCard({ profile }) {
|
|
2857
2796
|
const name = profile.name || [profile.localizedFirstName || profile.firstName, profile.localizedLastName || profile.lastName].filter(Boolean).join(" ");
|
|
2858
|
-
return /* @__PURE__ */ (0,
|
|
2859
|
-
/* @__PURE__ */ (0,
|
|
2860
|
-
/* @__PURE__ */ (0,
|
|
2861
|
-
/* @__PURE__ */ (0,
|
|
2862
|
-
profile.headline && /* @__PURE__ */ (0,
|
|
2863
|
-
profile.vanityName && /* @__PURE__ */ (0,
|
|
2864
|
-
/* @__PURE__ */ (0,
|
|
2797
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "rounded-lg border border-border bg-card p-3 space-y-1", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex items-start gap-2", children: [
|
|
2798
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react28.User, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
|
|
2799
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
2800
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "text-sm font-medium text-foreground", children: name || "LinkedIn Profile" }),
|
|
2801
|
+
profile.headline && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "text-xs text-muted-foreground line-clamp-2", children: profile.headline }),
|
|
2802
|
+
profile.vanityName && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("p", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
2803
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react28.ExternalLink, { className: "h-3 w-3" }),
|
|
2865
2804
|
"linkedin.com/in/",
|
|
2866
2805
|
profile.vanityName
|
|
2867
2806
|
] })
|
|
@@ -2871,24 +2810,24 @@ function ProfileCard({ profile }) {
|
|
|
2871
2810
|
function PostCard({ post }) {
|
|
2872
2811
|
const content = post.text || post.commentary;
|
|
2873
2812
|
const time = post.created?.time || post.timestamp;
|
|
2874
|
-
return /* @__PURE__ */ (0,
|
|
2875
|
-
/* @__PURE__ */ (0,
|
|
2876
|
-
/* @__PURE__ */ (0,
|
|
2877
|
-
post.author && /* @__PURE__ */ (0,
|
|
2878
|
-
time && /* @__PURE__ */ (0,
|
|
2879
|
-
/* @__PURE__ */ (0,
|
|
2813
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "rounded-lg border border-border bg-card p-3 space-y-1.5", children: [
|
|
2814
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
2815
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react28.FileText, { className: "h-4 w-4 text-muted-foreground shrink-0" }),
|
|
2816
|
+
post.author && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-xs font-medium text-foreground", children: post.author }),
|
|
2817
|
+
time && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: "flex items-center gap-1 text-xs text-muted-foreground ml-auto", children: [
|
|
2818
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react28.Clock, { className: "h-3 w-3" }),
|
|
2880
2819
|
formatRelativeDate7(time)
|
|
2881
2820
|
] })
|
|
2882
2821
|
] }),
|
|
2883
|
-
content && /* @__PURE__ */ (0,
|
|
2822
|
+
content && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "text-sm text-foreground line-clamp-4", children: content })
|
|
2884
2823
|
] });
|
|
2885
2824
|
}
|
|
2886
2825
|
function LinkedInFormatter({ data }) {
|
|
2887
|
-
if (isProfile(data)) return /* @__PURE__ */ (0,
|
|
2826
|
+
if (isProfile(data)) return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ProfileCard, { profile: data });
|
|
2888
2827
|
if (typeof data === "object" && data !== null && "posts" in data) {
|
|
2889
2828
|
const posts = data.posts;
|
|
2890
2829
|
if (Array.isArray(posts)) {
|
|
2891
|
-
return /* @__PURE__ */ (0,
|
|
2830
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "space-y-1.5", children: posts.filter(isPost).map((p, i) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(PostCard, { post: p }, p.id || i)) });
|
|
2892
2831
|
}
|
|
2893
2832
|
}
|
|
2894
2833
|
if (typeof data === "object" && data !== null && "elements" in data) {
|
|
@@ -2896,32 +2835,32 @@ function LinkedInFormatter({ data }) {
|
|
|
2896
2835
|
if (Array.isArray(elements)) {
|
|
2897
2836
|
const posts = elements.filter(isPost);
|
|
2898
2837
|
if (posts.length > 0) {
|
|
2899
|
-
return /* @__PURE__ */ (0,
|
|
2838
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "space-y-1.5", children: posts.map((p, i) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(PostCard, { post: p }, p.id || i)) });
|
|
2900
2839
|
}
|
|
2901
2840
|
}
|
|
2902
2841
|
}
|
|
2903
|
-
if (isPost(data)) return /* @__PURE__ */ (0,
|
|
2842
|
+
if (isPost(data)) return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(PostCard, { post: data });
|
|
2904
2843
|
if (Array.isArray(data)) {
|
|
2905
2844
|
const posts = data.filter(isPost);
|
|
2906
2845
|
if (posts.length > 0) {
|
|
2907
|
-
return /* @__PURE__ */ (0,
|
|
2846
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "space-y-1.5", children: posts.map((p, i) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(PostCard, { post: p }, p.id || i)) });
|
|
2908
2847
|
}
|
|
2909
2848
|
}
|
|
2910
|
-
return /* @__PURE__ */ (0,
|
|
2849
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.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) });
|
|
2911
2850
|
}
|
|
2912
2851
|
|
|
2913
2852
|
// src/ui/formatters/generic.tsx
|
|
2914
|
-
var
|
|
2853
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2915
2854
|
function GenericFormatter({ data }) {
|
|
2916
2855
|
if (data === null || data === void 0) {
|
|
2917
|
-
return /* @__PURE__ */ (0,
|
|
2856
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "text-sm text-muted-foreground italic", children: "No data returned" });
|
|
2918
2857
|
}
|
|
2919
|
-
return /* @__PURE__ */ (0,
|
|
2858
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.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) });
|
|
2920
2859
|
}
|
|
2921
2860
|
|
|
2922
2861
|
// src/ui/tool-result.tsx
|
|
2923
|
-
var
|
|
2924
|
-
function
|
|
2862
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2863
|
+
function extractToolName(part) {
|
|
2925
2864
|
if (part.type.startsWith("tool-") && part.type !== "tool-invocation") {
|
|
2926
2865
|
return part.type.slice(5);
|
|
2927
2866
|
}
|
|
@@ -2932,7 +2871,7 @@ function extractToolName2(part) {
|
|
|
2932
2871
|
if (part.toolInvocation?.toolName) return part.toolInvocation.toolName;
|
|
2933
2872
|
return "unknown";
|
|
2934
2873
|
}
|
|
2935
|
-
function
|
|
2874
|
+
function extractState(part) {
|
|
2936
2875
|
return part.state ?? part.toolInvocation?.state;
|
|
2937
2876
|
}
|
|
2938
2877
|
function unwrapSupyagentResult(result) {
|
|
@@ -2941,7 +2880,7 @@ function unwrapSupyagentResult(result) {
|
|
|
2941
2880
|
}
|
|
2942
2881
|
return result;
|
|
2943
2882
|
}
|
|
2944
|
-
function
|
|
2883
|
+
function extractArgs(part) {
|
|
2945
2884
|
if (part.input && typeof part.input === "object" && !Array.isArray(part.input)) {
|
|
2946
2885
|
return part.input;
|
|
2947
2886
|
}
|
|
@@ -2973,72 +2912,72 @@ function maybeNormalize(toolName, formatterType, data) {
|
|
|
2973
2912
|
function renderFormatter(formatterType, data) {
|
|
2974
2913
|
switch (formatterType) {
|
|
2975
2914
|
case "email":
|
|
2976
|
-
return /* @__PURE__ */ (0,
|
|
2915
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(EmailFormatter, { data });
|
|
2977
2916
|
case "calendar":
|
|
2978
|
-
return /* @__PURE__ */ (0,
|
|
2917
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CalendarEventFormatter, { data });
|
|
2979
2918
|
case "slack":
|
|
2980
|
-
return /* @__PURE__ */ (0,
|
|
2919
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SlackMessageFormatter, { data });
|
|
2981
2920
|
case "github":
|
|
2982
|
-
return /* @__PURE__ */ (0,
|
|
2921
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(GithubFormatter, { data });
|
|
2983
2922
|
case "drive":
|
|
2984
|
-
return /* @__PURE__ */ (0,
|
|
2923
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DriveFileFormatter, { data });
|
|
2985
2924
|
case "search":
|
|
2986
|
-
return /* @__PURE__ */ (0,
|
|
2925
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SearchFormatter, { data });
|
|
2987
2926
|
case "docs":
|
|
2988
|
-
return /* @__PURE__ */ (0,
|
|
2927
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DocsFormatter, { data });
|
|
2989
2928
|
case "sheets":
|
|
2990
|
-
return /* @__PURE__ */ (0,
|
|
2929
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SheetsFormatter, { data });
|
|
2991
2930
|
case "slides":
|
|
2992
|
-
return /* @__PURE__ */ (0,
|
|
2931
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SlidesFormatter, { data });
|
|
2993
2932
|
case "hubspot":
|
|
2994
|
-
return /* @__PURE__ */ (0,
|
|
2933
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(HubspotFormatter, { data });
|
|
2995
2934
|
case "linear":
|
|
2996
|
-
return /* @__PURE__ */ (0,
|
|
2935
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(LinearFormatter, { data });
|
|
2997
2936
|
case "pipedrive":
|
|
2998
|
-
return /* @__PURE__ */ (0,
|
|
2937
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(PipedriveFormatter, { data });
|
|
2999
2938
|
case "compute":
|
|
3000
|
-
return /* @__PURE__ */ (0,
|
|
2939
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ComputeFormatter, { data });
|
|
3001
2940
|
case "resend":
|
|
3002
|
-
return /* @__PURE__ */ (0,
|
|
2941
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ResendFormatter, { data });
|
|
3003
2942
|
case "inbox":
|
|
3004
|
-
return /* @__PURE__ */ (0,
|
|
2943
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(InboxFormatter, { data });
|
|
3005
2944
|
case "discord":
|
|
3006
|
-
return /* @__PURE__ */ (0,
|
|
2945
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DiscordFormatter, { data });
|
|
3007
2946
|
case "notion":
|
|
3008
|
-
return /* @__PURE__ */ (0,
|
|
2947
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(NotionFormatter, { data });
|
|
3009
2948
|
case "twitter":
|
|
3010
|
-
return /* @__PURE__ */ (0,
|
|
2949
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TwitterFormatter, { data });
|
|
3011
2950
|
case "telegram":
|
|
3012
|
-
return /* @__PURE__ */ (0,
|
|
2951
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TelegramFormatter, { data });
|
|
3013
2952
|
case "stripe":
|
|
3014
|
-
return /* @__PURE__ */ (0,
|
|
2953
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(StripeFormatter, { data });
|
|
3015
2954
|
case "jira":
|
|
3016
|
-
return /* @__PURE__ */ (0,
|
|
2955
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(JiraFormatter, { data });
|
|
3017
2956
|
case "salesforce":
|
|
3018
|
-
return /* @__PURE__ */ (0,
|
|
2957
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SalesforceFormatter, { data });
|
|
3019
2958
|
case "brevo":
|
|
3020
|
-
return /* @__PURE__ */ (0,
|
|
2959
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(BrevoFormatter, { data });
|
|
3021
2960
|
case "calendly":
|
|
3022
|
-
return /* @__PURE__ */ (0,
|
|
2961
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CalendlyFormatter, { data });
|
|
3023
2962
|
case "twilio":
|
|
3024
|
-
return /* @__PURE__ */ (0,
|
|
2963
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TwilioFormatter, { data });
|
|
3025
2964
|
case "linkedin":
|
|
3026
|
-
return /* @__PURE__ */ (0,
|
|
2965
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(LinkedInFormatter, { data });
|
|
3027
2966
|
default:
|
|
3028
|
-
return /* @__PURE__ */ (0,
|
|
2967
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(GenericFormatter, { data });
|
|
3029
2968
|
}
|
|
3030
2969
|
}
|
|
3031
2970
|
function SupyagentToolResult({ part }) {
|
|
3032
|
-
const state =
|
|
2971
|
+
const state = extractState(part);
|
|
3033
2972
|
const result = extractResult(part);
|
|
3034
|
-
const toolName =
|
|
2973
|
+
const toolName = extractToolName(part);
|
|
3035
2974
|
if (state !== "output-available" || result === void 0) {
|
|
3036
2975
|
return null;
|
|
3037
2976
|
}
|
|
3038
2977
|
const formatterType = getFormatterType(toolName);
|
|
3039
2978
|
const data = maybeNormalize(toolName, formatterType, result);
|
|
3040
2979
|
const summary = getSummary(formatterType, data, toolName);
|
|
3041
|
-
return /* @__PURE__ */ (0,
|
|
2980
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3042
2981
|
CollapsibleResult,
|
|
3043
2982
|
{
|
|
3044
2983
|
toolName,
|
|
@@ -3049,13 +2988,9 @@ function SupyagentToolResult({ part }) {
|
|
|
3049
2988
|
);
|
|
3050
2989
|
}
|
|
3051
2990
|
|
|
3052
|
-
// src/ui/tool-action.tsx
|
|
3053
|
-
var import_react4 = require("react");
|
|
3054
|
-
var import_lucide_react30 = require("lucide-react");
|
|
3055
|
-
|
|
3056
2991
|
// src/ui/tool-input.tsx
|
|
3057
|
-
var
|
|
3058
|
-
var
|
|
2992
|
+
var import_react2 = __toESM(require("react"), 1);
|
|
2993
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
3059
2994
|
function formatValue(value) {
|
|
3060
2995
|
if (value === null || value === void 0) {
|
|
3061
2996
|
return { text: "null", muted: true };
|
|
@@ -3089,17 +3024,19 @@ function formatValue(value) {
|
|
|
3089
3024
|
}
|
|
3090
3025
|
function ToolInput({ args }) {
|
|
3091
3026
|
if (!args || Object.keys(args).length === 0) return null;
|
|
3092
|
-
return /* @__PURE__ */ (0,
|
|
3027
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "grid grid-cols-[auto_1fr] gap-x-4 gap-y-1 text-sm", children: Object.entries(args).map(([key, value]) => {
|
|
3093
3028
|
const formatted = formatValue(value);
|
|
3094
|
-
return /* @__PURE__ */ (0,
|
|
3095
|
-
/* @__PURE__ */ (0,
|
|
3096
|
-
/* @__PURE__ */ (0,
|
|
3029
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_react2.default.Fragment, { children: [
|
|
3030
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-muted-foreground select-none", children: key }),
|
|
3031
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: formatted.muted ? "text-muted-foreground" : "text-foreground", children: formatted.text })
|
|
3097
3032
|
] }, key);
|
|
3098
3033
|
}) });
|
|
3099
3034
|
}
|
|
3100
3035
|
|
|
3101
3036
|
// src/ui/tool-action.tsx
|
|
3102
|
-
var
|
|
3037
|
+
var import_react3 = require("react");
|
|
3038
|
+
var import_lucide_react29 = require("lucide-react");
|
|
3039
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
3103
3040
|
var BADGE_STYLES2 = {
|
|
3104
3041
|
default: "bg-muted text-muted-foreground",
|
|
3105
3042
|
success: "bg-green-500/10 text-green-500",
|
|
@@ -3107,10 +3044,10 @@ var BADGE_STYLES2 = {
|
|
|
3107
3044
|
warning: "bg-yellow-500/10 text-yellow-600"
|
|
3108
3045
|
};
|
|
3109
3046
|
function SupyagentToolAction({ part, defaultExpanded = false }) {
|
|
3110
|
-
const [expanded, setExpanded] = (0,
|
|
3111
|
-
const toolName =
|
|
3112
|
-
const state =
|
|
3113
|
-
const args =
|
|
3047
|
+
const [expanded, setExpanded] = (0, import_react3.useState)(defaultExpanded);
|
|
3048
|
+
const toolName = extractToolName(part);
|
|
3049
|
+
const state = extractState(part);
|
|
3050
|
+
const args = extractArgs(part);
|
|
3114
3051
|
const provider = getProviderFromToolName(toolName);
|
|
3115
3052
|
const providerLabel = getProviderLabel(provider);
|
|
3116
3053
|
const actionLabel = humanizeToolName(toolName);
|
|
@@ -3132,59 +3069,59 @@ function SupyagentToolAction({ part, defaultExpanded = false }) {
|
|
|
3132
3069
|
const hasArgs = args && Object.keys(args).length > 0;
|
|
3133
3070
|
const hasExpandableContent = hasArgs || formatterOutput;
|
|
3134
3071
|
const canExpand = !isStreaming && hasExpandableContent;
|
|
3135
|
-
return /* @__PURE__ */ (0,
|
|
3072
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
3136
3073
|
"div",
|
|
3137
3074
|
{
|
|
3138
3075
|
className: "rounded-lg border border-border bg-card overflow-hidden",
|
|
3139
3076
|
"data-state": isDone ? "done" : isError ? "error" : isStreaming ? "streaming" : "pending",
|
|
3140
3077
|
children: [
|
|
3141
|
-
/* @__PURE__ */ (0,
|
|
3078
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
3142
3079
|
"button",
|
|
3143
3080
|
{
|
|
3144
3081
|
type: "button",
|
|
3145
3082
|
onClick: () => canExpand && setExpanded(!expanded),
|
|
3146
3083
|
className: `flex items-center gap-2 w-full px-3 py-2 text-left transition-colors ${canExpand ? "hover:bg-muted cursor-pointer" : "cursor-default"}`,
|
|
3147
3084
|
children: [
|
|
3148
|
-
/* @__PURE__ */ (0,
|
|
3149
|
-
/* @__PURE__ */ (0,
|
|
3150
|
-
isStreaming && /* @__PURE__ */ (0,
|
|
3085
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "relative shrink-0", children: [
|
|
3086
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ProviderIcon, { toolName, className: "h-4 w-4 text-muted-foreground" }),
|
|
3087
|
+
isStreaming && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react29.Loader2, { className: "absolute -top-1 -right-1 h-3 w-3 text-primary animate-spin" })
|
|
3151
3088
|
] }),
|
|
3152
|
-
/* @__PURE__ */ (0,
|
|
3153
|
-
/* @__PURE__ */ (0,
|
|
3154
|
-
summary && /* @__PURE__ */ (0,
|
|
3155
|
-
/* @__PURE__ */ (0,
|
|
3156
|
-
/* @__PURE__ */ (0,
|
|
3089
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-xs text-muted-foreground", children: providerLabel }),
|
|
3090
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-sm text-foreground", children: actionLabel }),
|
|
3091
|
+
summary && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
3092
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-muted-foreground text-xs", children: "\xB7" }),
|
|
3093
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-sm text-muted-foreground flex-1 truncate", children: summary.text })
|
|
3157
3094
|
] }),
|
|
3158
|
-
!summary && /* @__PURE__ */ (0,
|
|
3159
|
-
summary?.badge && /* @__PURE__ */ (0,
|
|
3095
|
+
!summary && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "flex-1" }),
|
|
3096
|
+
summary?.badge && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3160
3097
|
"span",
|
|
3161
3098
|
{
|
|
3162
3099
|
className: `inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium shrink-0 ${BADGE_STYLES2[summary.badge.variant || "default"]}`,
|
|
3163
3100
|
children: summary.badge.text
|
|
3164
3101
|
}
|
|
3165
3102
|
),
|
|
3166
|
-
isDone && /* @__PURE__ */ (0,
|
|
3167
|
-
isError && /* @__PURE__ */ (0,
|
|
3168
|
-
/* @__PURE__ */ (0,
|
|
3103
|
+
isDone && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react29.Check, { className: "h-3.5 w-3.5 text-green-500 shrink-0" }),
|
|
3104
|
+
isError && /* @__PURE__ */ (0, import_jsx_runtime32.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: [
|
|
3105
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react29.AlertCircle, { className: "h-3 w-3" }),
|
|
3169
3106
|
"Error"
|
|
3170
3107
|
] }),
|
|
3171
|
-
isStreaming && /* @__PURE__ */ (0,
|
|
3172
|
-
canExpand && (expanded ? /* @__PURE__ */ (0,
|
|
3108
|
+
isStreaming && /* @__PURE__ */ (0, import_jsx_runtime32.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..." }),
|
|
3109
|
+
canExpand && (expanded ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react29.ChevronDown, { className: "h-3.5 w-3.5 text-muted-foreground shrink-0" }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react29.ChevronRight, { className: "h-3.5 w-3.5 text-muted-foreground shrink-0" }))
|
|
3173
3110
|
]
|
|
3174
3111
|
}
|
|
3175
3112
|
),
|
|
3176
|
-
/* @__PURE__ */ (0,
|
|
3113
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3177
3114
|
"div",
|
|
3178
3115
|
{
|
|
3179
3116
|
className: "grid transition-[grid-template-rows] duration-200 ease-out",
|
|
3180
3117
|
style: { gridTemplateRows: expanded ? "1fr" : "0fr" },
|
|
3181
|
-
children: /* @__PURE__ */ (0,
|
|
3182
|
-
args && Object.keys(args).length > 0 && /* @__PURE__ */ (0,
|
|
3183
|
-
/* @__PURE__ */ (0,
|
|
3184
|
-
/* @__PURE__ */ (0,
|
|
3118
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "border-t border-border px-3 py-2 space-y-3", children: [
|
|
3119
|
+
args && Object.keys(args).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { children: [
|
|
3120
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "text-[10px] font-medium uppercase tracking-wider text-muted-foreground mb-1.5", children: "Input" }),
|
|
3121
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ToolInput, { args })
|
|
3185
3122
|
] }),
|
|
3186
|
-
formatterOutput && /* @__PURE__ */ (0,
|
|
3187
|
-
/* @__PURE__ */ (0,
|
|
3123
|
+
formatterOutput && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { children: [
|
|
3124
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "text-[10px] font-medium uppercase tracking-wider text-muted-foreground mb-1.5", children: "Output" }),
|
|
3188
3125
|
formatterOutput
|
|
3189
3126
|
] })
|
|
3190
3127
|
] }) })
|
|
@@ -3194,6 +3131,76 @@ function SupyagentToolAction({ part, defaultExpanded = false }) {
|
|
|
3194
3131
|
}
|
|
3195
3132
|
);
|
|
3196
3133
|
}
|
|
3134
|
+
|
|
3135
|
+
// src/ui/tool-call.tsx
|
|
3136
|
+
var import_react4 = require("react");
|
|
3137
|
+
var import_lucide_react30 = require("lucide-react");
|
|
3138
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
3139
|
+
function extractToolName2(part) {
|
|
3140
|
+
if (part.type.startsWith("tool-") && part.type !== "tool-invocation") {
|
|
3141
|
+
return part.type.slice(5);
|
|
3142
|
+
}
|
|
3143
|
+
if (part.type === "dynamic-tool" && part.toolName) {
|
|
3144
|
+
return part.toolName;
|
|
3145
|
+
}
|
|
3146
|
+
if (part.toolName) return part.toolName;
|
|
3147
|
+
if (part.toolInvocation?.toolName) return part.toolInvocation.toolName;
|
|
3148
|
+
return "unknown";
|
|
3149
|
+
}
|
|
3150
|
+
function extractState2(part) {
|
|
3151
|
+
return part.state || part.toolInvocation?.state || "input-available";
|
|
3152
|
+
}
|
|
3153
|
+
function extractArgs2(part) {
|
|
3154
|
+
return part.input || part.args || part.toolInvocation?.args;
|
|
3155
|
+
}
|
|
3156
|
+
function SupyagentToolCall({ part }) {
|
|
3157
|
+
const [expanded, setExpanded] = (0, import_react4.useState)(false);
|
|
3158
|
+
const toolName = extractToolName2(part);
|
|
3159
|
+
const state = extractState2(part);
|
|
3160
|
+
const args = extractArgs2(part);
|
|
3161
|
+
const provider = getProviderFromToolName(toolName);
|
|
3162
|
+
const providerLabel = getProviderLabel(provider);
|
|
3163
|
+
const actionLabel = humanizeToolName(toolName);
|
|
3164
|
+
const isStreaming = state === "input-streaming";
|
|
3165
|
+
const isError = state === "output-error";
|
|
3166
|
+
const isDone = state === "output-available";
|
|
3167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
3168
|
+
"div",
|
|
3169
|
+
{
|
|
3170
|
+
className: "rounded-lg border border-border bg-card overflow-hidden",
|
|
3171
|
+
"data-state": isDone ? "done" : isError ? "error" : isStreaming ? "streaming" : "pending",
|
|
3172
|
+
children: [
|
|
3173
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
3174
|
+
"button",
|
|
3175
|
+
{
|
|
3176
|
+
type: "button",
|
|
3177
|
+
onClick: () => args && setExpanded(!expanded),
|
|
3178
|
+
className: "flex items-center gap-2 w-full px-3 py-2 text-left hover:bg-muted transition-colors",
|
|
3179
|
+
children: [
|
|
3180
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "relative", children: [
|
|
3181
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ProviderIcon, { toolName, className: "h-4 w-4 text-muted-foreground" }),
|
|
3182
|
+
isStreaming && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react30.Loader2, { className: "absolute -top-1 -right-1 h-3 w-3 text-primary animate-spin" })
|
|
3183
|
+
] }),
|
|
3184
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-xs text-muted-foreground", children: providerLabel }),
|
|
3185
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-sm text-foreground flex-1", children: actionLabel }),
|
|
3186
|
+
isDone && /* @__PURE__ */ (0, import_jsx_runtime33.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: [
|
|
3187
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react30.Check, { className: "h-3 w-3" }),
|
|
3188
|
+
"Completed"
|
|
3189
|
+
] }),
|
|
3190
|
+
isError && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "inline-flex items-center gap-1 rounded-full bg-destructive/10 px-2 py-0.5 text-xs text-destructive", children: [
|
|
3191
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react30.AlertCircle, { className: "h-3 w-3" }),
|
|
3192
|
+
"Error"
|
|
3193
|
+
] }),
|
|
3194
|
+
isStreaming && /* @__PURE__ */ (0, import_jsx_runtime33.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..." }),
|
|
3195
|
+
args && (expanded ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react30.ChevronDown, { className: "h-3.5 w-3.5 text-muted-foreground" }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react30.ChevronRight, { className: "h-3.5 w-3.5 text-muted-foreground" }))
|
|
3196
|
+
]
|
|
3197
|
+
}
|
|
3198
|
+
),
|
|
3199
|
+
expanded && args && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "border-t border-border px-3 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("pre", { className: "text-xs text-muted-foreground overflow-x-auto", children: JSON.stringify(args, null, 2) }) })
|
|
3200
|
+
]
|
|
3201
|
+
}
|
|
3202
|
+
);
|
|
3203
|
+
}
|
|
3197
3204
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3198
3205
|
0 && (module.exports = {
|
|
3199
3206
|
BrevoFormatter,
|
|
@@ -3213,6 +3220,7 @@ function SupyagentToolAction({ part, defaultExpanded = false }) {
|
|
|
3213
3220
|
LinearFormatter,
|
|
3214
3221
|
LinkedInFormatter,
|
|
3215
3222
|
NotionFormatter,
|
|
3223
|
+
PROVIDER_LABELS,
|
|
3216
3224
|
PipedriveFormatter,
|
|
3217
3225
|
ProviderIcon,
|
|
3218
3226
|
ResendFormatter,
|
|
@@ -3229,9 +3237,19 @@ function SupyagentToolAction({ part, defaultExpanded = false }) {
|
|
|
3229
3237
|
ToolInput,
|
|
3230
3238
|
TwilioFormatter,
|
|
3231
3239
|
TwitterFormatter,
|
|
3240
|
+
extractArgs,
|
|
3241
|
+
extractResult,
|
|
3242
|
+
extractState,
|
|
3243
|
+
extractToolName,
|
|
3244
|
+
getFormatterType,
|
|
3232
3245
|
getProviderFromToolName,
|
|
3233
3246
|
getProviderLabel,
|
|
3234
3247
|
getSummary,
|
|
3235
|
-
humanizeToolName
|
|
3248
|
+
humanizeToolName,
|
|
3249
|
+
maybeNormalize,
|
|
3250
|
+
normalizeMicrosoftCalendar,
|
|
3251
|
+
normalizeMicrosoftDrive,
|
|
3252
|
+
normalizeMicrosoftMail,
|
|
3253
|
+
unwrapSupyagentResult
|
|
3236
3254
|
});
|
|
3237
3255
|
//# sourceMappingURL=react.cjs.map
|