@supyagent/sdk 0.1.10 → 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 +809 -775
- 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 +783 -760
- 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,62 +1709,71 @@ 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;
|
|
1757
|
+
if ("event_type" in data || "summary" in data) return true;
|
|
1758
|
+
if ("title" in data || "type" in data && "source" in data) return true;
|
|
1759
|
+
return false;
|
|
1760
|
+
}
|
|
1761
|
+
function resolveEventType(event) {
|
|
1762
|
+
if (event.event_type) {
|
|
1763
|
+
return event.event_type.split(".")[0];
|
|
1764
|
+
}
|
|
1765
|
+
return event.type;
|
|
1818
1766
|
}
|
|
1819
1767
|
function getEventIcon(type) {
|
|
1820
1768
|
switch (type) {
|
|
1821
1769
|
case "email":
|
|
1822
|
-
return
|
|
1770
|
+
return import_lucide_react17.Mail;
|
|
1823
1771
|
case "message":
|
|
1824
|
-
return
|
|
1772
|
+
return import_lucide_react17.MessageSquare;
|
|
1825
1773
|
case "calendar":
|
|
1826
|
-
return
|
|
1774
|
+
return import_lucide_react17.Calendar;
|
|
1827
1775
|
default:
|
|
1828
|
-
return
|
|
1776
|
+
return import_lucide_react17.Bell;
|
|
1829
1777
|
}
|
|
1830
1778
|
}
|
|
1831
1779
|
function formatTimestamp2(dateStr) {
|
|
@@ -1844,31 +1792,37 @@ function formatTimestamp2(dateStr) {
|
|
|
1844
1792
|
}
|
|
1845
1793
|
}
|
|
1846
1794
|
function EventCard2({ event }) {
|
|
1847
|
-
const
|
|
1848
|
-
const
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1795
|
+
const eventType = resolveEventType(event);
|
|
1796
|
+
const Icon = getEventIcon(eventType);
|
|
1797
|
+
const timestamp = event.received_at || event.timestamp || event.created_at;
|
|
1798
|
+
const title = event.summary || event.title;
|
|
1799
|
+
const source = event.provider || event.source;
|
|
1800
|
+
const snippet = event.description || event.payload?.snippet || event.payload?.text;
|
|
1801
|
+
const isUnread = event.status === "unread" || event.read === false;
|
|
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) })
|
|
1857
1811
|
] }),
|
|
1858
|
-
|
|
1812
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "text-sm font-medium text-foreground mt-1 line-clamp-1", children: title })
|
|
1859
1813
|
] })
|
|
1860
1814
|
] }),
|
|
1861
|
-
|
|
1815
|
+
snippet && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "text-xs text-muted-foreground line-clamp-2 pl-6", children: snippet })
|
|
1862
1816
|
] });
|
|
1863
1817
|
}
|
|
1864
1818
|
function InboxFormatter({ data }) {
|
|
1865
1819
|
if (isInboxEvent(data)) {
|
|
1866
|
-
return /* @__PURE__ */ (0,
|
|
1820
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(EventCard2, { event: data });
|
|
1867
1821
|
}
|
|
1868
1822
|
if (Array.isArray(data)) {
|
|
1869
1823
|
const events = data.filter(isInboxEvent);
|
|
1870
1824
|
if (events.length > 0) {
|
|
1871
|
-
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)) });
|
|
1872
1826
|
}
|
|
1873
1827
|
}
|
|
1874
1828
|
if (typeof data === "object" && data !== null && "events" in data) {
|
|
@@ -1876,16 +1830,16 @@ function InboxFormatter({ data }) {
|
|
|
1876
1830
|
if (Array.isArray(events)) {
|
|
1877
1831
|
const inboxEvents = events.filter(isInboxEvent);
|
|
1878
1832
|
if (inboxEvents.length > 0) {
|
|
1879
|
-
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)) });
|
|
1880
1834
|
}
|
|
1881
1835
|
}
|
|
1882
1836
|
}
|
|
1883
|
-
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) });
|
|
1884
1838
|
}
|
|
1885
1839
|
|
|
1886
1840
|
// src/ui/formatters/discord.tsx
|
|
1887
|
-
var
|
|
1888
|
-
var
|
|
1841
|
+
var import_lucide_react18 = require("lucide-react");
|
|
1842
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1889
1843
|
function isGuildData(data) {
|
|
1890
1844
|
return typeof data === "object" && data !== null && "name" in data && ("owner" in data || "member_count" in data || "icon" in data);
|
|
1891
1845
|
}
|
|
@@ -1913,75 +1867,75 @@ function formatRelativeDate3(dateStr) {
|
|
|
1913
1867
|
}
|
|
1914
1868
|
}
|
|
1915
1869
|
function GuildCard({ guild }) {
|
|
1916
|
-
return /* @__PURE__ */ (0,
|
|
1917
|
-
/* @__PURE__ */ (0,
|
|
1918
|
-
/* @__PURE__ */ (0,
|
|
1919
|
-
/* @__PURE__ */ (0,
|
|
1920
|
-
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" })
|
|
1921
1875
|
] }),
|
|
1922
|
-
guild.member_count !== void 0 && /* @__PURE__ */ (0,
|
|
1923
|
-
/* @__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" }),
|
|
1924
1878
|
guild.member_count,
|
|
1925
1879
|
" members"
|
|
1926
1880
|
] })
|
|
1927
1881
|
] });
|
|
1928
1882
|
}
|
|
1929
1883
|
function ChannelCard2({ channel }) {
|
|
1930
|
-
return /* @__PURE__ */ (0,
|
|
1931
|
-
/* @__PURE__ */ (0,
|
|
1932
|
-
/* @__PURE__ */ (0,
|
|
1933
|
-
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: [
|
|
1934
1888
|
channel.member_count,
|
|
1935
1889
|
" members"
|
|
1936
1890
|
] })
|
|
1937
1891
|
] });
|
|
1938
1892
|
}
|
|
1939
1893
|
function MessageCard({ message }) {
|
|
1940
|
-
return /* @__PURE__ */ (0,
|
|
1941
|
-
/* @__PURE__ */ (0,
|
|
1942
|
-
/* @__PURE__ */ (0,
|
|
1943
|
-
message.author?.username && /* @__PURE__ */ (0,
|
|
1944
|
-
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) })
|
|
1945
1899
|
] }),
|
|
1946
|
-
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 })
|
|
1947
1901
|
] });
|
|
1948
1902
|
}
|
|
1949
1903
|
function DiscordFormatter({ data }) {
|
|
1950
1904
|
if (typeof data === "object" && data !== null && "guilds" in data) {
|
|
1951
1905
|
const guilds = data.guilds;
|
|
1952
1906
|
if (Array.isArray(guilds)) {
|
|
1953
|
-
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)) });
|
|
1954
1908
|
}
|
|
1955
1909
|
}
|
|
1956
1910
|
if (typeof data === "object" && data !== null && "channels" in data) {
|
|
1957
1911
|
const channels = data.channels;
|
|
1958
1912
|
if (Array.isArray(channels)) {
|
|
1959
|
-
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)) });
|
|
1960
1914
|
}
|
|
1961
1915
|
}
|
|
1962
1916
|
if (typeof data === "object" && data !== null && "messages" in data) {
|
|
1963
1917
|
const messages = data.messages;
|
|
1964
1918
|
if (Array.isArray(messages)) {
|
|
1965
|
-
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)) });
|
|
1966
1920
|
}
|
|
1967
1921
|
}
|
|
1968
|
-
if (isMessageData(data)) return /* @__PURE__ */ (0,
|
|
1922
|
+
if (isMessageData(data)) return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(MessageCard, { message: data });
|
|
1969
1923
|
if (Array.isArray(data)) {
|
|
1970
1924
|
const guilds = data.filter(isGuildData);
|
|
1971
1925
|
if (guilds.length > 0) {
|
|
1972
|
-
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)) });
|
|
1973
1927
|
}
|
|
1974
1928
|
const messages = data.filter(isMessageData);
|
|
1975
1929
|
if (messages.length > 0) {
|
|
1976
|
-
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)) });
|
|
1977
1931
|
}
|
|
1978
1932
|
}
|
|
1979
|
-
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) });
|
|
1980
1934
|
}
|
|
1981
1935
|
|
|
1982
1936
|
// src/ui/formatters/notion.tsx
|
|
1983
|
-
var
|
|
1984
|
-
var
|
|
1937
|
+
var import_lucide_react19 = require("lucide-react");
|
|
1938
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1985
1939
|
function isNotionPage(data) {
|
|
1986
1940
|
if (typeof data !== "object" || data === null) return false;
|
|
1987
1941
|
if ("properties" in data) return true;
|
|
@@ -2032,26 +1986,26 @@ function formatRelativeDate4(dateStr) {
|
|
|
2032
1986
|
}
|
|
2033
1987
|
function PageCard({ page }) {
|
|
2034
1988
|
const title = extractPageTitle(page);
|
|
2035
|
-
return /* @__PURE__ */ (0,
|
|
2036
|
-
/* @__PURE__ */ (0,
|
|
2037
|
-
/* @__PURE__ */ (0,
|
|
2038
|
-
/* @__PURE__ */ (0,
|
|
2039
|
-
(page.last_edited_time || page.lastEditedTime) && /* @__PURE__ */ (0,
|
|
2040
|
-
/* @__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" }),
|
|
2041
1995
|
formatRelativeDate4(page.last_edited_time || page.lastEditedTime)
|
|
2042
1996
|
] }),
|
|
2043
|
-
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" }) })
|
|
2044
1998
|
] })
|
|
2045
1999
|
] }) });
|
|
2046
2000
|
}
|
|
2047
2001
|
function DatabaseCard({ db }) {
|
|
2048
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";
|
|
2049
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;
|
|
2050
|
-
return /* @__PURE__ */ (0,
|
|
2051
|
-
/* @__PURE__ */ (0,
|
|
2052
|
-
/* @__PURE__ */ (0,
|
|
2053
|
-
/* @__PURE__ */ (0,
|
|
2054
|
-
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 })
|
|
2055
2009
|
] })
|
|
2056
2010
|
] }) });
|
|
2057
2011
|
}
|
|
@@ -2059,13 +2013,13 @@ function NotionFormatter({ data }) {
|
|
|
2059
2013
|
if (typeof data === "object" && data !== null && "pages" in data) {
|
|
2060
2014
|
const pages = data.pages;
|
|
2061
2015
|
if (Array.isArray(pages)) {
|
|
2062
|
-
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)) });
|
|
2063
2017
|
}
|
|
2064
2018
|
}
|
|
2065
2019
|
if (typeof data === "object" && data !== null && "databases" in data) {
|
|
2066
2020
|
const dbs = data.databases;
|
|
2067
2021
|
if (Array.isArray(dbs)) {
|
|
2068
|
-
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)) });
|
|
2069
2023
|
}
|
|
2070
2024
|
}
|
|
2071
2025
|
if (typeof data === "object" && data !== null && "results" in data) {
|
|
@@ -2073,28 +2027,28 @@ function NotionFormatter({ data }) {
|
|
|
2073
2027
|
if (Array.isArray(results)) {
|
|
2074
2028
|
const pages = results.filter(isNotionPage);
|
|
2075
2029
|
if (pages.length > 0) {
|
|
2076
|
-
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)) });
|
|
2077
2031
|
}
|
|
2078
2032
|
const dbs = results.filter(isNotionDatabase);
|
|
2079
2033
|
if (dbs.length > 0) {
|
|
2080
|
-
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)) });
|
|
2081
2035
|
}
|
|
2082
2036
|
}
|
|
2083
2037
|
}
|
|
2084
|
-
if (isNotionPage(data)) return /* @__PURE__ */ (0,
|
|
2085
|
-
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 });
|
|
2086
2040
|
if (Array.isArray(data)) {
|
|
2087
2041
|
const pages = data.filter(isNotionPage);
|
|
2088
2042
|
if (pages.length > 0) {
|
|
2089
|
-
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)) });
|
|
2090
2044
|
}
|
|
2091
2045
|
}
|
|
2092
|
-
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) });
|
|
2093
2047
|
}
|
|
2094
2048
|
|
|
2095
2049
|
// src/ui/formatters/twitter.tsx
|
|
2096
|
-
var
|
|
2097
|
-
var
|
|
2050
|
+
var import_lucide_react20 = require("lucide-react");
|
|
2051
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2098
2052
|
function isTweetData(data) {
|
|
2099
2053
|
return typeof data === "object" && data !== null && "text" in data;
|
|
2100
2054
|
}
|
|
@@ -2120,31 +2074,31 @@ function TweetCard({ tweet }) {
|
|
|
2120
2074
|
const likes = tweet.public_metrics?.like_count ?? tweet.like_count;
|
|
2121
2075
|
const retweets = tweet.public_metrics?.retweet_count ?? tweet.retweet_count;
|
|
2122
2076
|
const replies = tweet.public_metrics?.reply_count;
|
|
2123
|
-
return /* @__PURE__ */ (0,
|
|
2124
|
-
/* @__PURE__ */ (0,
|
|
2125
|
-
/* @__PURE__ */ (0,
|
|
2126
|
-
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: [
|
|
2127
2081
|
"@",
|
|
2128
2082
|
username
|
|
2129
2083
|
] }),
|
|
2130
|
-
tweet.author?.name && /* @__PURE__ */ (0,
|
|
2131
|
-
tweet.created_at && /* @__PURE__ */ (0,
|
|
2132
|
-
/* @__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" }),
|
|
2133
2087
|
formatRelativeDate5(tweet.created_at)
|
|
2134
2088
|
] })
|
|
2135
2089
|
] }),
|
|
2136
|
-
tweet.text && /* @__PURE__ */ (0,
|
|
2137
|
-
(likes !== void 0 || retweets !== void 0 || replies !== void 0) && /* @__PURE__ */ (0,
|
|
2138
|
-
likes !== void 0 && /* @__PURE__ */ (0,
|
|
2139
|
-
/* @__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" }),
|
|
2140
2094
|
likes
|
|
2141
2095
|
] }),
|
|
2142
|
-
retweets !== void 0 && /* @__PURE__ */ (0,
|
|
2143
|
-
/* @__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" }),
|
|
2144
2098
|
retweets
|
|
2145
2099
|
] }),
|
|
2146
|
-
replies !== void 0 && /* @__PURE__ */ (0,
|
|
2147
|
-
/* @__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" }),
|
|
2148
2102
|
replies
|
|
2149
2103
|
] })
|
|
2150
2104
|
] })
|
|
@@ -2154,26 +2108,26 @@ function TwitterFormatter({ data }) {
|
|
|
2154
2108
|
if (typeof data === "object" && data !== null && "tweets" in data) {
|
|
2155
2109
|
const tweets = data.tweets;
|
|
2156
2110
|
if (Array.isArray(tweets)) {
|
|
2157
|
-
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)) });
|
|
2158
2112
|
}
|
|
2159
2113
|
}
|
|
2160
2114
|
if (typeof data === "object" && data !== null && "data" in data && Array.isArray(data.data)) {
|
|
2161
2115
|
const tweets = data.data;
|
|
2162
|
-
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)) });
|
|
2163
2117
|
}
|
|
2164
|
-
if (isTweetData(data)) return /* @__PURE__ */ (0,
|
|
2118
|
+
if (isTweetData(data)) return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TweetCard, { tweet: data });
|
|
2165
2119
|
if (Array.isArray(data)) {
|
|
2166
2120
|
const tweets = data.filter(isTweetData);
|
|
2167
2121
|
if (tweets.length > 0) {
|
|
2168
|
-
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)) });
|
|
2169
2123
|
}
|
|
2170
2124
|
}
|
|
2171
|
-
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) });
|
|
2172
2126
|
}
|
|
2173
2127
|
|
|
2174
2128
|
// src/ui/formatters/telegram.tsx
|
|
2175
|
-
var
|
|
2176
|
-
var
|
|
2129
|
+
var import_lucide_react21 = require("lucide-react");
|
|
2130
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2177
2131
|
function isTelegramMessage(data) {
|
|
2178
2132
|
return typeof data === "object" && data !== null && ("text" in data || "message_id" in data);
|
|
2179
2133
|
}
|
|
@@ -2196,27 +2150,27 @@ function formatUnixDate(ts) {
|
|
|
2196
2150
|
}
|
|
2197
2151
|
function MessageCard2({ message }) {
|
|
2198
2152
|
const fromName = message.from ? [message.from.first_name, message.from.last_name].filter(Boolean).join(" ") || message.from.username : void 0;
|
|
2199
|
-
return /* @__PURE__ */ (0,
|
|
2200
|
-
/* @__PURE__ */ (0,
|
|
2201
|
-
/* @__PURE__ */ (0,
|
|
2202
|
-
fromName && /* @__PURE__ */ (0,
|
|
2203
|
-
/* @__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" }),
|
|
2204
2158
|
fromName
|
|
2205
2159
|
] }),
|
|
2206
|
-
message.chat?.title && /* @__PURE__ */ (0,
|
|
2207
|
-
message.date && /* @__PURE__ */ (0,
|
|
2208
|
-
/* @__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" }),
|
|
2209
2163
|
formatUnixDate(message.date)
|
|
2210
2164
|
] })
|
|
2211
2165
|
] }),
|
|
2212
|
-
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 })
|
|
2213
2167
|
] });
|
|
2214
2168
|
}
|
|
2215
2169
|
function TelegramFormatter({ data }) {
|
|
2216
2170
|
if (typeof data === "object" && data !== null && "messages" in data) {
|
|
2217
2171
|
const msgs = data.messages;
|
|
2218
2172
|
if (Array.isArray(msgs)) {
|
|
2219
|
-
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)) });
|
|
2220
2174
|
}
|
|
2221
2175
|
}
|
|
2222
2176
|
if (typeof data === "object" && data !== null && "result" in data) {
|
|
@@ -2224,23 +2178,23 @@ function TelegramFormatter({ data }) {
|
|
|
2224
2178
|
if (Array.isArray(result)) {
|
|
2225
2179
|
const msgs = result.filter(isTelegramMessage);
|
|
2226
2180
|
if (msgs.length > 0) {
|
|
2227
|
-
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)) });
|
|
2228
2182
|
}
|
|
2229
2183
|
}
|
|
2230
2184
|
}
|
|
2231
|
-
if (isTelegramMessage(data)) return /* @__PURE__ */ (0,
|
|
2185
|
+
if (isTelegramMessage(data)) return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(MessageCard2, { message: data });
|
|
2232
2186
|
if (Array.isArray(data)) {
|
|
2233
2187
|
const msgs = data.filter(isTelegramMessage);
|
|
2234
2188
|
if (msgs.length > 0) {
|
|
2235
|
-
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)) });
|
|
2236
2190
|
}
|
|
2237
2191
|
}
|
|
2238
|
-
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) });
|
|
2239
2193
|
}
|
|
2240
2194
|
|
|
2241
2195
|
// src/ui/formatters/stripe.tsx
|
|
2242
|
-
var
|
|
2243
|
-
var
|
|
2196
|
+
var import_lucide_react22 = require("lucide-react");
|
|
2197
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2244
2198
|
function isCustomer(data) {
|
|
2245
2199
|
return typeof data === "object" && data !== null && ("email" in data || "name" in data) && !("amount_due" in data) && !("plan" in data);
|
|
2246
2200
|
}
|
|
@@ -2279,106 +2233,106 @@ var STATUS_STYLES = {
|
|
|
2279
2233
|
trialing: "bg-yellow-500/10 text-yellow-600"
|
|
2280
2234
|
};
|
|
2281
2235
|
function StatusBadge({ status }) {
|
|
2282
|
-
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 });
|
|
2283
2237
|
}
|
|
2284
2238
|
function CustomerCard({ customer }) {
|
|
2285
|
-
return /* @__PURE__ */ (0,
|
|
2286
|
-
/* @__PURE__ */ (0,
|
|
2287
|
-
/* @__PURE__ */ (0,
|
|
2288
|
-
/* @__PURE__ */ (0,
|
|
2289
|
-
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 })
|
|
2290
2244
|
] })
|
|
2291
2245
|
] }) });
|
|
2292
2246
|
}
|
|
2293
2247
|
function InvoiceCard({ invoice }) {
|
|
2294
|
-
return /* @__PURE__ */ (0,
|
|
2295
|
-
/* @__PURE__ */ (0,
|
|
2296
|
-
/* @__PURE__ */ (0,
|
|
2297
|
-
/* @__PURE__ */ (0,
|
|
2298
|
-
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 })
|
|
2299
2253
|
] }),
|
|
2300
|
-
/* @__PURE__ */ (0,
|
|
2301
|
-
invoice.amount_due !== void 0 && invoice.currency && /* @__PURE__ */ (0,
|
|
2302
|
-
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 })
|
|
2303
2257
|
] })
|
|
2304
2258
|
] }) });
|
|
2305
2259
|
}
|
|
2306
2260
|
function SubscriptionCard({ sub }) {
|
|
2307
|
-
return /* @__PURE__ */ (0,
|
|
2308
|
-
/* @__PURE__ */ (0,
|
|
2309
|
-
/* @__PURE__ */ (0,
|
|
2310
|
-
/* @__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: [
|
|
2311
2265
|
sub.plan?.nickname || "Subscription",
|
|
2312
|
-
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: [
|
|
2313
2267
|
" ",
|
|
2314
2268
|
formatAmount(sub.plan.amount, sub.plan.currency),
|
|
2315
2269
|
"/",
|
|
2316
2270
|
sub.plan.interval
|
|
2317
2271
|
] })
|
|
2318
2272
|
] }),
|
|
2319
|
-
sub.current_period_end && /* @__PURE__ */ (0,
|
|
2320
|
-
/* @__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" }),
|
|
2321
2275
|
"Renews ",
|
|
2322
2276
|
formatUnixDate2(sub.current_period_end)
|
|
2323
2277
|
] })
|
|
2324
2278
|
] }),
|
|
2325
|
-
sub.status && /* @__PURE__ */ (0,
|
|
2279
|
+
sub.status && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(StatusBadge, { status: sub.status })
|
|
2326
2280
|
] }) });
|
|
2327
2281
|
}
|
|
2328
2282
|
function BalanceDisplay({ balance }) {
|
|
2329
|
-
return /* @__PURE__ */ (0,
|
|
2330
|
-
/* @__PURE__ */ (0,
|
|
2331
|
-
/* @__PURE__ */ (0,
|
|
2332
|
-
/* @__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" })
|
|
2333
2287
|
] }),
|
|
2334
|
-
/* @__PURE__ */ (0,
|
|
2335
|
-
balance.available && balance.available.length > 0 && /* @__PURE__ */ (0,
|
|
2336
|
-
/* @__PURE__ */ (0,
|
|
2337
|
-
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))
|
|
2338
2292
|
] }),
|
|
2339
|
-
balance.pending && balance.pending.length > 0 && /* @__PURE__ */ (0,
|
|
2340
|
-
/* @__PURE__ */ (0,
|
|
2341
|
-
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))
|
|
2342
2296
|
] })
|
|
2343
2297
|
] })
|
|
2344
2298
|
] });
|
|
2345
2299
|
}
|
|
2346
2300
|
function StripeFormatter({ data }) {
|
|
2347
|
-
if (isBalance(data)) return /* @__PURE__ */ (0,
|
|
2301
|
+
if (isBalance(data)) return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(BalanceDisplay, { balance: data });
|
|
2348
2302
|
if (typeof data === "object" && data !== null && "data" in data && Array.isArray(data.data)) {
|
|
2349
2303
|
const items = data.data;
|
|
2350
2304
|
const invoices = items.filter(isInvoice);
|
|
2351
2305
|
if (invoices.length > 0) {
|
|
2352
|
-
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)) });
|
|
2353
2307
|
}
|
|
2354
2308
|
const subs = items.filter(isSubscription);
|
|
2355
2309
|
if (subs.length > 0) {
|
|
2356
|
-
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)) });
|
|
2357
2311
|
}
|
|
2358
2312
|
const customers = items.filter(isCustomer);
|
|
2359
2313
|
if (customers.length > 0) {
|
|
2360
|
-
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)) });
|
|
2361
2315
|
}
|
|
2362
2316
|
}
|
|
2363
|
-
if (isInvoice(data)) return /* @__PURE__ */ (0,
|
|
2364
|
-
if (isSubscription(data)) return /* @__PURE__ */ (0,
|
|
2365
|
-
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 });
|
|
2366
2320
|
if (Array.isArray(data)) {
|
|
2367
2321
|
const invoices = data.filter(isInvoice);
|
|
2368
2322
|
if (invoices.length > 0) {
|
|
2369
|
-
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)) });
|
|
2370
2324
|
}
|
|
2371
2325
|
const customers = data.filter(isCustomer);
|
|
2372
2326
|
if (customers.length > 0) {
|
|
2373
|
-
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)) });
|
|
2374
2328
|
}
|
|
2375
2329
|
}
|
|
2376
|
-
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) });
|
|
2377
2331
|
}
|
|
2378
2332
|
|
|
2379
2333
|
// src/ui/formatters/jira.tsx
|
|
2380
|
-
var
|
|
2381
|
-
var
|
|
2334
|
+
var import_lucide_react23 = require("lucide-react");
|
|
2335
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2382
2336
|
function isJiraIssue(data) {
|
|
2383
2337
|
return typeof data === "object" && data !== null && "key" in data && "fields" in data;
|
|
2384
2338
|
}
|
|
@@ -2394,35 +2348,35 @@ var STATUS_COLORS = {
|
|
|
2394
2348
|
};
|
|
2395
2349
|
function PriorityIcon({ name }) {
|
|
2396
2350
|
const lower = (name || "").toLowerCase();
|
|
2397
|
-
if (lower === "highest" || lower === "critical") return /* @__PURE__ */ (0,
|
|
2398
|
-
if (lower === "high") return /* @__PURE__ */ (0,
|
|
2399
|
-
if (lower === "low") return /* @__PURE__ */ (0,
|
|
2400
|
-
if (lower === "lowest") return /* @__PURE__ */ (0,
|
|
2401
|
-
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" });
|
|
2402
2356
|
}
|
|
2403
2357
|
function IssueCard2({ issue }) {
|
|
2404
2358
|
const f = issue.fields || {};
|
|
2405
2359
|
const statusColor = f.status?.statusCategory?.colorName || "undefined";
|
|
2406
|
-
return /* @__PURE__ */ (0,
|
|
2407
|
-
/* @__PURE__ */ (0,
|
|
2408
|
-
/* @__PURE__ */ (0,
|
|
2409
|
-
/* @__PURE__ */ (0,
|
|
2410
|
-
/* @__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 }),
|
|
2411
2365
|
" ",
|
|
2412
2366
|
f.summary
|
|
2413
2367
|
] }),
|
|
2414
|
-
/* @__PURE__ */ (0,
|
|
2415
|
-
f.status?.name && /* @__PURE__ */ (0,
|
|
2416
|
-
/* @__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}` }),
|
|
2417
2371
|
f.status.name
|
|
2418
2372
|
] }),
|
|
2419
|
-
f.priority?.name && /* @__PURE__ */ (0,
|
|
2420
|
-
/* @__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 }),
|
|
2421
2375
|
f.priority.name
|
|
2422
2376
|
] }),
|
|
2423
|
-
f.issuetype?.name && /* @__PURE__ */ (0,
|
|
2424
|
-
f.assignee && /* @__PURE__ */ (0,
|
|
2425
|
-
/* @__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" }),
|
|
2426
2380
|
f.assignee.displayName || f.assignee.name
|
|
2427
2381
|
] })
|
|
2428
2382
|
] })
|
|
@@ -2430,15 +2384,15 @@ function IssueCard2({ issue }) {
|
|
|
2430
2384
|
] }) });
|
|
2431
2385
|
}
|
|
2432
2386
|
function ProjectCard2({ project }) {
|
|
2433
|
-
return /* @__PURE__ */ (0,
|
|
2434
|
-
/* @__PURE__ */ (0,
|
|
2435
|
-
/* @__PURE__ */ (0,
|
|
2436
|
-
/* @__PURE__ */ (0,
|
|
2437
|
-
/* @__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 }),
|
|
2438
2392
|
" ",
|
|
2439
2393
|
project.name
|
|
2440
2394
|
] }),
|
|
2441
|
-
project.projectTypeKey && /* @__PURE__ */ (0,
|
|
2395
|
+
project.projectTypeKey && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-xs text-muted-foreground", children: project.projectTypeKey })
|
|
2442
2396
|
] })
|
|
2443
2397
|
] }) });
|
|
2444
2398
|
}
|
|
@@ -2446,29 +2400,29 @@ function JiraFormatter({ data }) {
|
|
|
2446
2400
|
if (typeof data === "object" && data !== null && "issues" in data) {
|
|
2447
2401
|
const issues = data.issues;
|
|
2448
2402
|
if (Array.isArray(issues)) {
|
|
2449
|
-
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)) });
|
|
2450
2404
|
}
|
|
2451
2405
|
}
|
|
2452
2406
|
if (typeof data === "object" && data !== null && "projects" in data) {
|
|
2453
2407
|
const projects = data.projects;
|
|
2454
2408
|
if (Array.isArray(projects)) {
|
|
2455
|
-
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)) });
|
|
2456
2410
|
}
|
|
2457
2411
|
}
|
|
2458
|
-
if (isJiraIssue(data)) return /* @__PURE__ */ (0,
|
|
2459
|
-
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 });
|
|
2460
2414
|
if (Array.isArray(data)) {
|
|
2461
2415
|
const issues = data.filter(isJiraIssue);
|
|
2462
2416
|
if (issues.length > 0) {
|
|
2463
|
-
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)) });
|
|
2464
2418
|
}
|
|
2465
2419
|
}
|
|
2466
|
-
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) });
|
|
2467
2421
|
}
|
|
2468
2422
|
|
|
2469
2423
|
// src/ui/formatters/salesforce.tsx
|
|
2470
|
-
var
|
|
2471
|
-
var
|
|
2424
|
+
var import_lucide_react24 = require("lucide-react");
|
|
2425
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2472
2426
|
function isContact(data) {
|
|
2473
2427
|
if (typeof data !== "object" || data === null) return false;
|
|
2474
2428
|
return "Name" in data && ("Email" in data || "Phone" in data || "Title" in data);
|
|
@@ -2479,55 +2433,55 @@ function isOpportunity(data) {
|
|
|
2479
2433
|
}
|
|
2480
2434
|
function ContactCard2({ contact }) {
|
|
2481
2435
|
const account = contact.AccountName || contact.Account?.Name;
|
|
2482
|
-
return /* @__PURE__ */ (0,
|
|
2483
|
-
/* @__PURE__ */ (0,
|
|
2484
|
-
/* @__PURE__ */ (0,
|
|
2485
|
-
/* @__PURE__ */ (0,
|
|
2486
|
-
/* @__PURE__ */ (0,
|
|
2487
|
-
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 })
|
|
2488
2442
|
] })
|
|
2489
2443
|
] }),
|
|
2490
|
-
/* @__PURE__ */ (0,
|
|
2491
|
-
contact.Email && /* @__PURE__ */ (0,
|
|
2492
|
-
/* @__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" }),
|
|
2493
2447
|
contact.Email
|
|
2494
2448
|
] }),
|
|
2495
|
-
contact.Phone && /* @__PURE__ */ (0,
|
|
2496
|
-
/* @__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" }),
|
|
2497
2451
|
contact.Phone
|
|
2498
2452
|
] }),
|
|
2499
|
-
account && /* @__PURE__ */ (0,
|
|
2500
|
-
/* @__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" }),
|
|
2501
2455
|
account
|
|
2502
2456
|
] })
|
|
2503
2457
|
] })
|
|
2504
2458
|
] });
|
|
2505
2459
|
}
|
|
2506
2460
|
function OpportunityCard({ opp }) {
|
|
2507
|
-
return /* @__PURE__ */ (0,
|
|
2508
|
-
/* @__PURE__ */ (0,
|
|
2509
|
-
/* @__PURE__ */ (0,
|
|
2510
|
-
/* @__PURE__ */ (0,
|
|
2511
|
-
/* @__PURE__ */ (0,
|
|
2512
|
-
/* @__PURE__ */ (0,
|
|
2513
|
-
opp.Amount !== void 0 && /* @__PURE__ */ (0,
|
|
2514
|
-
opp.StageName && /* @__PURE__ */ (0,
|
|
2515
|
-
opp.CloseDate && /* @__PURE__ */ (0,
|
|
2516
|
-
/* @__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" }),
|
|
2517
2471
|
opp.CloseDate
|
|
2518
2472
|
] })
|
|
2519
2473
|
] })
|
|
2520
2474
|
] })
|
|
2521
2475
|
] }),
|
|
2522
|
-
opp.Probability !== void 0 && /* @__PURE__ */ (0,
|
|
2523
|
-
/* @__PURE__ */ (0,
|
|
2524
|
-
/* @__PURE__ */ (0,
|
|
2525
|
-
/* @__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: [
|
|
2526
2480
|
opp.Probability,
|
|
2527
2481
|
"%"
|
|
2528
2482
|
] })
|
|
2529
2483
|
] }),
|
|
2530
|
-
/* @__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)(
|
|
2531
2485
|
"div",
|
|
2532
2486
|
{
|
|
2533
2487
|
className: "h-full rounded-full bg-primary transition-all",
|
|
@@ -2544,31 +2498,31 @@ function SalesforceFormatter({ data }) {
|
|
|
2544
2498
|
const contacts = records.filter(isContact);
|
|
2545
2499
|
const opps = records.filter(isOpportunity);
|
|
2546
2500
|
if (opps.length > 0 && contacts.length === 0) {
|
|
2547
|
-
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)) });
|
|
2548
2502
|
}
|
|
2549
2503
|
if (contacts.length > 0) {
|
|
2550
|
-
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)) });
|
|
2551
2505
|
}
|
|
2552
2506
|
}
|
|
2553
2507
|
}
|
|
2554
|
-
if (isOpportunity(data)) return /* @__PURE__ */ (0,
|
|
2555
|
-
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 });
|
|
2556
2510
|
if (Array.isArray(data)) {
|
|
2557
2511
|
const contacts = data.filter(isContact);
|
|
2558
2512
|
if (contacts.length > 0) {
|
|
2559
|
-
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)) });
|
|
2560
2514
|
}
|
|
2561
2515
|
const opps = data.filter(isOpportunity);
|
|
2562
2516
|
if (opps.length > 0) {
|
|
2563
|
-
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)) });
|
|
2564
2518
|
}
|
|
2565
2519
|
}
|
|
2566
|
-
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) });
|
|
2567
2521
|
}
|
|
2568
2522
|
|
|
2569
2523
|
// src/ui/formatters/brevo.tsx
|
|
2570
|
-
var
|
|
2571
|
-
var
|
|
2524
|
+
var import_lucide_react25 = require("lucide-react");
|
|
2525
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2572
2526
|
function isBrevoContact(data) {
|
|
2573
2527
|
return typeof data === "object" && data !== null && "email" in data && ("attributes" in data || "id" in data);
|
|
2574
2528
|
}
|
|
@@ -2584,12 +2538,12 @@ var STATUS_STYLES2 = {
|
|
|
2584
2538
|
};
|
|
2585
2539
|
function ContactCard3({ contact }) {
|
|
2586
2540
|
const name = contact.attributes ? [contact.attributes.FIRSTNAME, contact.attributes.LASTNAME].filter(Boolean).join(" ") : void 0;
|
|
2587
|
-
return /* @__PURE__ */ (0,
|
|
2588
|
-
/* @__PURE__ */ (0,
|
|
2589
|
-
/* @__PURE__ */ (0,
|
|
2590
|
-
name && /* @__PURE__ */ (0,
|
|
2591
|
-
/* @__PURE__ */ (0,
|
|
2592
|
-
/* @__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" }),
|
|
2593
2547
|
contact.email
|
|
2594
2548
|
] })
|
|
2595
2549
|
] })
|
|
@@ -2597,26 +2551,26 @@ function ContactCard3({ contact }) {
|
|
|
2597
2551
|
}
|
|
2598
2552
|
function CampaignCard({ campaign }) {
|
|
2599
2553
|
const stats = campaign.statistics?.globalStats;
|
|
2600
|
-
return /* @__PURE__ */ (0,
|
|
2601
|
-
/* @__PURE__ */ (0,
|
|
2602
|
-
/* @__PURE__ */ (0,
|
|
2603
|
-
/* @__PURE__ */ (0,
|
|
2604
|
-
/* @__PURE__ */ (0,
|
|
2605
|
-
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 })
|
|
2606
2560
|
] }),
|
|
2607
|
-
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 })
|
|
2608
2562
|
] }),
|
|
2609
|
-
stats && /* @__PURE__ */ (0,
|
|
2610
|
-
/* @__PURE__ */ (0,
|
|
2611
|
-
/* @__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" }),
|
|
2612
2566
|
stats.sent ?? 0,
|
|
2613
2567
|
" sent"
|
|
2614
2568
|
] }),
|
|
2615
|
-
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: [
|
|
2616
2570
|
stats.opened,
|
|
2617
2571
|
" opened"
|
|
2618
2572
|
] }),
|
|
2619
|
-
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: [
|
|
2620
2574
|
stats.clicked,
|
|
2621
2575
|
" clicked"
|
|
2622
2576
|
] })
|
|
@@ -2627,33 +2581,33 @@ function BrevoFormatter({ data }) {
|
|
|
2627
2581
|
if (typeof data === "object" && data !== null && "contacts" in data) {
|
|
2628
2582
|
const contacts = data.contacts;
|
|
2629
2583
|
if (Array.isArray(contacts)) {
|
|
2630
|
-
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)) });
|
|
2631
2585
|
}
|
|
2632
2586
|
}
|
|
2633
2587
|
if (typeof data === "object" && data !== null && "campaigns" in data) {
|
|
2634
2588
|
const campaigns = data.campaigns;
|
|
2635
2589
|
if (Array.isArray(campaigns)) {
|
|
2636
|
-
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)) });
|
|
2637
2591
|
}
|
|
2638
2592
|
}
|
|
2639
|
-
if (isBrevoContact(data)) return /* @__PURE__ */ (0,
|
|
2640
|
-
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 });
|
|
2641
2595
|
if (Array.isArray(data)) {
|
|
2642
2596
|
const contacts = data.filter(isBrevoContact);
|
|
2643
2597
|
if (contacts.length > 0) {
|
|
2644
|
-
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)) });
|
|
2645
2599
|
}
|
|
2646
2600
|
const campaigns = data.filter(isBrevoCampaign);
|
|
2647
2601
|
if (campaigns.length > 0) {
|
|
2648
|
-
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)) });
|
|
2649
2603
|
}
|
|
2650
2604
|
}
|
|
2651
|
-
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) });
|
|
2652
2606
|
}
|
|
2653
2607
|
|
|
2654
2608
|
// src/ui/formatters/calendly.tsx
|
|
2655
|
-
var
|
|
2656
|
-
var
|
|
2609
|
+
var import_lucide_react26 = require("lucide-react");
|
|
2610
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2657
2611
|
function isCalendlyEvent(data) {
|
|
2658
2612
|
return typeof data === "object" && data !== null && "name" in data && ("start_time" in data || "status" in data);
|
|
2659
2613
|
}
|
|
@@ -2677,36 +2631,36 @@ var STATUS_STYLES3 = {
|
|
|
2677
2631
|
canceled: "bg-destructive/10 text-destructive"
|
|
2678
2632
|
};
|
|
2679
2633
|
function EventCard3({ event }) {
|
|
2680
|
-
return /* @__PURE__ */ (0,
|
|
2681
|
-
/* @__PURE__ */ (0,
|
|
2682
|
-
/* @__PURE__ */ (0,
|
|
2683
|
-
/* @__PURE__ */ (0,
|
|
2684
|
-
event.start_time && /* @__PURE__ */ (0,
|
|
2685
|
-
/* @__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" }),
|
|
2686
2640
|
formatDateTime(event.start_time),
|
|
2687
2641
|
event.end_time && ` - ${formatDateTime(event.end_time)}`
|
|
2688
2642
|
] }),
|
|
2689
|
-
event.location?.location && /* @__PURE__ */ (0,
|
|
2690
|
-
/* @__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" }),
|
|
2691
2645
|
event.location.location
|
|
2692
2646
|
] })
|
|
2693
2647
|
] }),
|
|
2694
|
-
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 })
|
|
2695
2649
|
] }) });
|
|
2696
2650
|
}
|
|
2697
2651
|
function EventTypeCard({ eventType }) {
|
|
2698
|
-
return /* @__PURE__ */ (0,
|
|
2699
|
-
/* @__PURE__ */ (0,
|
|
2700
|
-
/* @__PURE__ */ (0,
|
|
2701
|
-
/* @__PURE__ */ (0,
|
|
2702
|
-
eventType.description_plain && /* @__PURE__ */ (0,
|
|
2703
|
-
eventType.duration !== void 0 && /* @__PURE__ */ (0,
|
|
2704
|
-
/* @__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" }),
|
|
2705
2659
|
eventType.duration,
|
|
2706
2660
|
" min"
|
|
2707
2661
|
] })
|
|
2708
2662
|
] }),
|
|
2709
|
-
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" })
|
|
2710
2664
|
] }) });
|
|
2711
2665
|
}
|
|
2712
2666
|
function CalendlyFormatter({ data }) {
|
|
@@ -2716,33 +2670,33 @@ function CalendlyFormatter({ data }) {
|
|
|
2716
2670
|
const events = d.collection.filter(isCalendlyEvent);
|
|
2717
2671
|
const types = d.collection.filter(isCalendlyEventType);
|
|
2718
2672
|
if (types.length > 0 && events.length === 0) {
|
|
2719
|
-
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)) });
|
|
2720
2674
|
}
|
|
2721
2675
|
if (events.length > 0) {
|
|
2722
|
-
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)) });
|
|
2723
2677
|
}
|
|
2724
2678
|
}
|
|
2725
2679
|
if (Array.isArray(d.scheduled_events)) {
|
|
2726
|
-
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)) });
|
|
2727
2681
|
}
|
|
2728
2682
|
if (Array.isArray(d.event_types)) {
|
|
2729
|
-
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)) });
|
|
2730
2684
|
}
|
|
2731
2685
|
}
|
|
2732
|
-
if (isCalendlyEvent(data)) return /* @__PURE__ */ (0,
|
|
2733
|
-
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 });
|
|
2734
2688
|
if (Array.isArray(data)) {
|
|
2735
2689
|
const events = data.filter(isCalendlyEvent);
|
|
2736
2690
|
if (events.length > 0) {
|
|
2737
|
-
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)) });
|
|
2738
2692
|
}
|
|
2739
2693
|
}
|
|
2740
|
-
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) });
|
|
2741
2695
|
}
|
|
2742
2696
|
|
|
2743
2697
|
// src/ui/formatters/twilio.tsx
|
|
2744
|
-
var
|
|
2745
|
-
var
|
|
2698
|
+
var import_lucide_react27 = require("lucide-react");
|
|
2699
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2746
2700
|
function isTwilioMessage(data) {
|
|
2747
2701
|
return typeof data === "object" && data !== null && ("body" in data || "sid" in data) && ("from" in data || "to" in data);
|
|
2748
2702
|
}
|
|
@@ -2774,48 +2728,48 @@ var STATUS_STYLES4 = {
|
|
|
2774
2728
|
};
|
|
2775
2729
|
function MessageCard3({ message }) {
|
|
2776
2730
|
const isInbound = message.direction?.includes("inbound");
|
|
2777
|
-
const DirectionIcon = isInbound ?
|
|
2731
|
+
const DirectionIcon = isInbound ? import_lucide_react27.ArrowDownLeft : import_lucide_react27.ArrowUpRight;
|
|
2778
2732
|
const dateStr = message.date_sent || message.date_created;
|
|
2779
|
-
return /* @__PURE__ */ (0,
|
|
2780
|
-
/* @__PURE__ */ (0,
|
|
2781
|
-
/* @__PURE__ */ (0,
|
|
2782
|
-
/* @__PURE__ */ (0,
|
|
2783
|
-
/* @__PURE__ */ (0,
|
|
2784
|
-
message.from && /* @__PURE__ */ (0,
|
|
2785
|
-
/* @__PURE__ */ (0,
|
|
2786
|
-
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 })
|
|
2787
2741
|
] }),
|
|
2788
|
-
/* @__PURE__ */ (0,
|
|
2789
|
-
message.status && /* @__PURE__ */ (0,
|
|
2790
|
-
dateStr && /* @__PURE__ */ (0,
|
|
2791
|
-
/* @__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" }),
|
|
2792
2746
|
formatRelativeDate6(dateStr)
|
|
2793
2747
|
] })
|
|
2794
2748
|
] })
|
|
2795
2749
|
] }),
|
|
2796
|
-
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 })
|
|
2797
2751
|
] });
|
|
2798
2752
|
}
|
|
2799
2753
|
function TwilioFormatter({ data }) {
|
|
2800
2754
|
if (typeof data === "object" && data !== null && "messages" in data) {
|
|
2801
2755
|
const msgs = data.messages;
|
|
2802
2756
|
if (Array.isArray(msgs)) {
|
|
2803
|
-
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)) });
|
|
2804
2758
|
}
|
|
2805
2759
|
}
|
|
2806
|
-
if (isTwilioMessage(data)) return /* @__PURE__ */ (0,
|
|
2760
|
+
if (isTwilioMessage(data)) return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(MessageCard3, { message: data });
|
|
2807
2761
|
if (Array.isArray(data)) {
|
|
2808
2762
|
const msgs = data.filter(isTwilioMessage);
|
|
2809
2763
|
if (msgs.length > 0) {
|
|
2810
|
-
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)) });
|
|
2811
2765
|
}
|
|
2812
2766
|
}
|
|
2813
|
-
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) });
|
|
2814
2768
|
}
|
|
2815
2769
|
|
|
2816
2770
|
// src/ui/formatters/linkedin.tsx
|
|
2817
|
-
var
|
|
2818
|
-
var
|
|
2771
|
+
var import_lucide_react28 = require("lucide-react");
|
|
2772
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2819
2773
|
function isProfile(data) {
|
|
2820
2774
|
if (typeof data !== "object" || data === null) return false;
|
|
2821
2775
|
return "localizedFirstName" in data || "firstName" in data || "name" in data && "headline" in data;
|
|
@@ -2840,13 +2794,13 @@ function formatRelativeDate7(dateStr) {
|
|
|
2840
2794
|
}
|
|
2841
2795
|
function ProfileCard({ profile }) {
|
|
2842
2796
|
const name = profile.name || [profile.localizedFirstName || profile.firstName, profile.localizedLastName || profile.lastName].filter(Boolean).join(" ");
|
|
2843
|
-
return /* @__PURE__ */ (0,
|
|
2844
|
-
/* @__PURE__ */ (0,
|
|
2845
|
-
/* @__PURE__ */ (0,
|
|
2846
|
-
/* @__PURE__ */ (0,
|
|
2847
|
-
profile.headline && /* @__PURE__ */ (0,
|
|
2848
|
-
profile.vanityName && /* @__PURE__ */ (0,
|
|
2849
|
-
/* @__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" }),
|
|
2850
2804
|
"linkedin.com/in/",
|
|
2851
2805
|
profile.vanityName
|
|
2852
2806
|
] })
|
|
@@ -2856,24 +2810,24 @@ function ProfileCard({ profile }) {
|
|
|
2856
2810
|
function PostCard({ post }) {
|
|
2857
2811
|
const content = post.text || post.commentary;
|
|
2858
2812
|
const time = post.created?.time || post.timestamp;
|
|
2859
|
-
return /* @__PURE__ */ (0,
|
|
2860
|
-
/* @__PURE__ */ (0,
|
|
2861
|
-
/* @__PURE__ */ (0,
|
|
2862
|
-
post.author && /* @__PURE__ */ (0,
|
|
2863
|
-
time && /* @__PURE__ */ (0,
|
|
2864
|
-
/* @__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" }),
|
|
2865
2819
|
formatRelativeDate7(time)
|
|
2866
2820
|
] })
|
|
2867
2821
|
] }),
|
|
2868
|
-
content && /* @__PURE__ */ (0,
|
|
2822
|
+
content && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "text-sm text-foreground line-clamp-4", children: content })
|
|
2869
2823
|
] });
|
|
2870
2824
|
}
|
|
2871
2825
|
function LinkedInFormatter({ data }) {
|
|
2872
|
-
if (isProfile(data)) return /* @__PURE__ */ (0,
|
|
2826
|
+
if (isProfile(data)) return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ProfileCard, { profile: data });
|
|
2873
2827
|
if (typeof data === "object" && data !== null && "posts" in data) {
|
|
2874
2828
|
const posts = data.posts;
|
|
2875
2829
|
if (Array.isArray(posts)) {
|
|
2876
|
-
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)) });
|
|
2877
2831
|
}
|
|
2878
2832
|
}
|
|
2879
2833
|
if (typeof data === "object" && data !== null && "elements" in data) {
|
|
@@ -2881,32 +2835,32 @@ function LinkedInFormatter({ data }) {
|
|
|
2881
2835
|
if (Array.isArray(elements)) {
|
|
2882
2836
|
const posts = elements.filter(isPost);
|
|
2883
2837
|
if (posts.length > 0) {
|
|
2884
|
-
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)) });
|
|
2885
2839
|
}
|
|
2886
2840
|
}
|
|
2887
2841
|
}
|
|
2888
|
-
if (isPost(data)) return /* @__PURE__ */ (0,
|
|
2842
|
+
if (isPost(data)) return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(PostCard, { post: data });
|
|
2889
2843
|
if (Array.isArray(data)) {
|
|
2890
2844
|
const posts = data.filter(isPost);
|
|
2891
2845
|
if (posts.length > 0) {
|
|
2892
|
-
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)) });
|
|
2893
2847
|
}
|
|
2894
2848
|
}
|
|
2895
|
-
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) });
|
|
2896
2850
|
}
|
|
2897
2851
|
|
|
2898
2852
|
// src/ui/formatters/generic.tsx
|
|
2899
|
-
var
|
|
2853
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2900
2854
|
function GenericFormatter({ data }) {
|
|
2901
2855
|
if (data === null || data === void 0) {
|
|
2902
|
-
return /* @__PURE__ */ (0,
|
|
2856
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "text-sm text-muted-foreground italic", children: "No data returned" });
|
|
2903
2857
|
}
|
|
2904
|
-
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) });
|
|
2905
2859
|
}
|
|
2906
2860
|
|
|
2907
2861
|
// src/ui/tool-result.tsx
|
|
2908
|
-
var
|
|
2909
|
-
function
|
|
2862
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2863
|
+
function extractToolName(part) {
|
|
2910
2864
|
if (part.type.startsWith("tool-") && part.type !== "tool-invocation") {
|
|
2911
2865
|
return part.type.slice(5);
|
|
2912
2866
|
}
|
|
@@ -2917,7 +2871,7 @@ function extractToolName2(part) {
|
|
|
2917
2871
|
if (part.toolInvocation?.toolName) return part.toolInvocation.toolName;
|
|
2918
2872
|
return "unknown";
|
|
2919
2873
|
}
|
|
2920
|
-
function
|
|
2874
|
+
function extractState(part) {
|
|
2921
2875
|
return part.state ?? part.toolInvocation?.state;
|
|
2922
2876
|
}
|
|
2923
2877
|
function unwrapSupyagentResult(result) {
|
|
@@ -2926,7 +2880,7 @@ function unwrapSupyagentResult(result) {
|
|
|
2926
2880
|
}
|
|
2927
2881
|
return result;
|
|
2928
2882
|
}
|
|
2929
|
-
function
|
|
2883
|
+
function extractArgs(part) {
|
|
2930
2884
|
if (part.input && typeof part.input === "object" && !Array.isArray(part.input)) {
|
|
2931
2885
|
return part.input;
|
|
2932
2886
|
}
|
|
@@ -2958,72 +2912,72 @@ function maybeNormalize(toolName, formatterType, data) {
|
|
|
2958
2912
|
function renderFormatter(formatterType, data) {
|
|
2959
2913
|
switch (formatterType) {
|
|
2960
2914
|
case "email":
|
|
2961
|
-
return /* @__PURE__ */ (0,
|
|
2915
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(EmailFormatter, { data });
|
|
2962
2916
|
case "calendar":
|
|
2963
|
-
return /* @__PURE__ */ (0,
|
|
2917
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CalendarEventFormatter, { data });
|
|
2964
2918
|
case "slack":
|
|
2965
|
-
return /* @__PURE__ */ (0,
|
|
2919
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SlackMessageFormatter, { data });
|
|
2966
2920
|
case "github":
|
|
2967
|
-
return /* @__PURE__ */ (0,
|
|
2921
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(GithubFormatter, { data });
|
|
2968
2922
|
case "drive":
|
|
2969
|
-
return /* @__PURE__ */ (0,
|
|
2923
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DriveFileFormatter, { data });
|
|
2970
2924
|
case "search":
|
|
2971
|
-
return /* @__PURE__ */ (0,
|
|
2925
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SearchFormatter, { data });
|
|
2972
2926
|
case "docs":
|
|
2973
|
-
return /* @__PURE__ */ (0,
|
|
2927
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DocsFormatter, { data });
|
|
2974
2928
|
case "sheets":
|
|
2975
|
-
return /* @__PURE__ */ (0,
|
|
2929
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SheetsFormatter, { data });
|
|
2976
2930
|
case "slides":
|
|
2977
|
-
return /* @__PURE__ */ (0,
|
|
2931
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SlidesFormatter, { data });
|
|
2978
2932
|
case "hubspot":
|
|
2979
|
-
return /* @__PURE__ */ (0,
|
|
2933
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(HubspotFormatter, { data });
|
|
2980
2934
|
case "linear":
|
|
2981
|
-
return /* @__PURE__ */ (0,
|
|
2935
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(LinearFormatter, { data });
|
|
2982
2936
|
case "pipedrive":
|
|
2983
|
-
return /* @__PURE__ */ (0,
|
|
2937
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(PipedriveFormatter, { data });
|
|
2984
2938
|
case "compute":
|
|
2985
|
-
return /* @__PURE__ */ (0,
|
|
2939
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ComputeFormatter, { data });
|
|
2986
2940
|
case "resend":
|
|
2987
|
-
return /* @__PURE__ */ (0,
|
|
2941
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ResendFormatter, { data });
|
|
2988
2942
|
case "inbox":
|
|
2989
|
-
return /* @__PURE__ */ (0,
|
|
2943
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(InboxFormatter, { data });
|
|
2990
2944
|
case "discord":
|
|
2991
|
-
return /* @__PURE__ */ (0,
|
|
2945
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DiscordFormatter, { data });
|
|
2992
2946
|
case "notion":
|
|
2993
|
-
return /* @__PURE__ */ (0,
|
|
2947
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(NotionFormatter, { data });
|
|
2994
2948
|
case "twitter":
|
|
2995
|
-
return /* @__PURE__ */ (0,
|
|
2949
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TwitterFormatter, { data });
|
|
2996
2950
|
case "telegram":
|
|
2997
|
-
return /* @__PURE__ */ (0,
|
|
2951
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TelegramFormatter, { data });
|
|
2998
2952
|
case "stripe":
|
|
2999
|
-
return /* @__PURE__ */ (0,
|
|
2953
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(StripeFormatter, { data });
|
|
3000
2954
|
case "jira":
|
|
3001
|
-
return /* @__PURE__ */ (0,
|
|
2955
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(JiraFormatter, { data });
|
|
3002
2956
|
case "salesforce":
|
|
3003
|
-
return /* @__PURE__ */ (0,
|
|
2957
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SalesforceFormatter, { data });
|
|
3004
2958
|
case "brevo":
|
|
3005
|
-
return /* @__PURE__ */ (0,
|
|
2959
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(BrevoFormatter, { data });
|
|
3006
2960
|
case "calendly":
|
|
3007
|
-
return /* @__PURE__ */ (0,
|
|
2961
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CalendlyFormatter, { data });
|
|
3008
2962
|
case "twilio":
|
|
3009
|
-
return /* @__PURE__ */ (0,
|
|
2963
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TwilioFormatter, { data });
|
|
3010
2964
|
case "linkedin":
|
|
3011
|
-
return /* @__PURE__ */ (0,
|
|
2965
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(LinkedInFormatter, { data });
|
|
3012
2966
|
default:
|
|
3013
|
-
return /* @__PURE__ */ (0,
|
|
2967
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(GenericFormatter, { data });
|
|
3014
2968
|
}
|
|
3015
2969
|
}
|
|
3016
2970
|
function SupyagentToolResult({ part }) {
|
|
3017
|
-
const state =
|
|
2971
|
+
const state = extractState(part);
|
|
3018
2972
|
const result = extractResult(part);
|
|
3019
|
-
const toolName =
|
|
2973
|
+
const toolName = extractToolName(part);
|
|
3020
2974
|
if (state !== "output-available" || result === void 0) {
|
|
3021
2975
|
return null;
|
|
3022
2976
|
}
|
|
3023
2977
|
const formatterType = getFormatterType(toolName);
|
|
3024
2978
|
const data = maybeNormalize(toolName, formatterType, result);
|
|
3025
2979
|
const summary = getSummary(formatterType, data, toolName);
|
|
3026
|
-
return /* @__PURE__ */ (0,
|
|
2980
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3027
2981
|
CollapsibleResult,
|
|
3028
2982
|
{
|
|
3029
2983
|
toolName,
|
|
@@ -3034,13 +2988,9 @@ function SupyagentToolResult({ part }) {
|
|
|
3034
2988
|
);
|
|
3035
2989
|
}
|
|
3036
2990
|
|
|
3037
|
-
// src/ui/tool-action.tsx
|
|
3038
|
-
var import_react4 = require("react");
|
|
3039
|
-
var import_lucide_react30 = require("lucide-react");
|
|
3040
|
-
|
|
3041
2991
|
// src/ui/tool-input.tsx
|
|
3042
|
-
var
|
|
3043
|
-
var
|
|
2992
|
+
var import_react2 = __toESM(require("react"), 1);
|
|
2993
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
3044
2994
|
function formatValue(value) {
|
|
3045
2995
|
if (value === null || value === void 0) {
|
|
3046
2996
|
return { text: "null", muted: true };
|
|
@@ -3074,17 +3024,19 @@ function formatValue(value) {
|
|
|
3074
3024
|
}
|
|
3075
3025
|
function ToolInput({ args }) {
|
|
3076
3026
|
if (!args || Object.keys(args).length === 0) return null;
|
|
3077
|
-
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]) => {
|
|
3078
3028
|
const formatted = formatValue(value);
|
|
3079
|
-
return /* @__PURE__ */ (0,
|
|
3080
|
-
/* @__PURE__ */ (0,
|
|
3081
|
-
/* @__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 })
|
|
3082
3032
|
] }, key);
|
|
3083
3033
|
}) });
|
|
3084
3034
|
}
|
|
3085
3035
|
|
|
3086
3036
|
// src/ui/tool-action.tsx
|
|
3087
|
-
var
|
|
3037
|
+
var import_react3 = require("react");
|
|
3038
|
+
var import_lucide_react29 = require("lucide-react");
|
|
3039
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
3088
3040
|
var BADGE_STYLES2 = {
|
|
3089
3041
|
default: "bg-muted text-muted-foreground",
|
|
3090
3042
|
success: "bg-green-500/10 text-green-500",
|
|
@@ -3092,16 +3044,16 @@ var BADGE_STYLES2 = {
|
|
|
3092
3044
|
warning: "bg-yellow-500/10 text-yellow-600"
|
|
3093
3045
|
};
|
|
3094
3046
|
function SupyagentToolAction({ part, defaultExpanded = false }) {
|
|
3095
|
-
const [expanded, setExpanded] = (0,
|
|
3096
|
-
const toolName =
|
|
3097
|
-
const state =
|
|
3098
|
-
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);
|
|
3099
3051
|
const provider = getProviderFromToolName(toolName);
|
|
3100
3052
|
const providerLabel = getProviderLabel(provider);
|
|
3101
3053
|
const actionLabel = humanizeToolName(toolName);
|
|
3102
|
-
const isStreaming = state === "input-streaming";
|
|
3103
|
-
const isError = state === "output-error";
|
|
3104
|
-
const isDone = state === "output-available";
|
|
3054
|
+
const isStreaming = state === "input-streaming" || state === "partial-call" || state === "call";
|
|
3055
|
+
const isError = state === "output-error" || state === "error";
|
|
3056
|
+
const isDone = state === "output-available" || state === "result";
|
|
3105
3057
|
const hasResult = isDone || isError;
|
|
3106
3058
|
let summary;
|
|
3107
3059
|
let formatterOutput;
|
|
@@ -3114,61 +3066,62 @@ function SupyagentToolAction({ part, defaultExpanded = false }) {
|
|
|
3114
3066
|
formatterOutput = renderFormatter(formatterType, data);
|
|
3115
3067
|
}
|
|
3116
3068
|
}
|
|
3117
|
-
const
|
|
3069
|
+
const hasArgs = args && Object.keys(args).length > 0;
|
|
3070
|
+
const hasExpandableContent = hasArgs || formatterOutput;
|
|
3118
3071
|
const canExpand = !isStreaming && hasExpandableContent;
|
|
3119
|
-
return /* @__PURE__ */ (0,
|
|
3072
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
3120
3073
|
"div",
|
|
3121
3074
|
{
|
|
3122
3075
|
className: "rounded-lg border border-border bg-card overflow-hidden",
|
|
3123
3076
|
"data-state": isDone ? "done" : isError ? "error" : isStreaming ? "streaming" : "pending",
|
|
3124
3077
|
children: [
|
|
3125
|
-
/* @__PURE__ */ (0,
|
|
3078
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
3126
3079
|
"button",
|
|
3127
3080
|
{
|
|
3128
3081
|
type: "button",
|
|
3129
3082
|
onClick: () => canExpand && setExpanded(!expanded),
|
|
3130
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"}`,
|
|
3131
3084
|
children: [
|
|
3132
|
-
/* @__PURE__ */ (0,
|
|
3133
|
-
/* @__PURE__ */ (0,
|
|
3134
|
-
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" })
|
|
3135
3088
|
] }),
|
|
3136
|
-
/* @__PURE__ */ (0,
|
|
3137
|
-
/* @__PURE__ */ (0,
|
|
3138
|
-
summary && /* @__PURE__ */ (0,
|
|
3139
|
-
/* @__PURE__ */ (0,
|
|
3140
|
-
/* @__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 })
|
|
3141
3094
|
] }),
|
|
3142
|
-
!summary && /* @__PURE__ */ (0,
|
|
3143
|
-
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)(
|
|
3144
3097
|
"span",
|
|
3145
3098
|
{
|
|
3146
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"]}`,
|
|
3147
3100
|
children: summary.badge.text
|
|
3148
3101
|
}
|
|
3149
3102
|
),
|
|
3150
|
-
isDone && /* @__PURE__ */ (0,
|
|
3151
|
-
isError && /* @__PURE__ */ (0,
|
|
3152
|
-
/* @__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" }),
|
|
3153
3106
|
"Error"
|
|
3154
3107
|
] }),
|
|
3155
|
-
isStreaming && /* @__PURE__ */ (0,
|
|
3156
|
-
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" }))
|
|
3157
3110
|
]
|
|
3158
3111
|
}
|
|
3159
3112
|
),
|
|
3160
|
-
/* @__PURE__ */ (0,
|
|
3113
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3161
3114
|
"div",
|
|
3162
3115
|
{
|
|
3163
3116
|
className: "grid transition-[grid-template-rows] duration-200 ease-out",
|
|
3164
3117
|
style: { gridTemplateRows: expanded ? "1fr" : "0fr" },
|
|
3165
|
-
children: /* @__PURE__ */ (0,
|
|
3166
|
-
args && Object.keys(args).length > 0 && /* @__PURE__ */ (0,
|
|
3167
|
-
/* @__PURE__ */ (0,
|
|
3168
|
-
/* @__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 })
|
|
3169
3122
|
] }),
|
|
3170
|
-
formatterOutput && /* @__PURE__ */ (0,
|
|
3171
|
-
/* @__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" }),
|
|
3172
3125
|
formatterOutput
|
|
3173
3126
|
] })
|
|
3174
3127
|
] }) })
|
|
@@ -3178,6 +3131,76 @@ function SupyagentToolAction({ part, defaultExpanded = false }) {
|
|
|
3178
3131
|
}
|
|
3179
3132
|
);
|
|
3180
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
|
+
}
|
|
3181
3204
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3182
3205
|
0 && (module.exports = {
|
|
3183
3206
|
BrevoFormatter,
|
|
@@ -3197,6 +3220,7 @@ function SupyagentToolAction({ part, defaultExpanded = false }) {
|
|
|
3197
3220
|
LinearFormatter,
|
|
3198
3221
|
LinkedInFormatter,
|
|
3199
3222
|
NotionFormatter,
|
|
3223
|
+
PROVIDER_LABELS,
|
|
3200
3224
|
PipedriveFormatter,
|
|
3201
3225
|
ProviderIcon,
|
|
3202
3226
|
ResendFormatter,
|
|
@@ -3213,9 +3237,19 @@ function SupyagentToolAction({ part, defaultExpanded = false }) {
|
|
|
3213
3237
|
ToolInput,
|
|
3214
3238
|
TwilioFormatter,
|
|
3215
3239
|
TwitterFormatter,
|
|
3240
|
+
extractArgs,
|
|
3241
|
+
extractResult,
|
|
3242
|
+
extractState,
|
|
3243
|
+
extractToolName,
|
|
3244
|
+
getFormatterType,
|
|
3216
3245
|
getProviderFromToolName,
|
|
3217
3246
|
getProviderLabel,
|
|
3218
3247
|
getSummary,
|
|
3219
|
-
humanizeToolName
|
|
3248
|
+
humanizeToolName,
|
|
3249
|
+
maybeNormalize,
|
|
3250
|
+
normalizeMicrosoftCalendar,
|
|
3251
|
+
normalizeMicrosoftDrive,
|
|
3252
|
+
normalizeMicrosoftMail,
|
|
3253
|
+
unwrapSupyagentResult
|
|
3220
3254
|
});
|
|
3221
3255
|
//# sourceMappingURL=react.cjs.map
|