@supyagent/sdk 0.1.9 → 0.1.11
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/prisma.cjs +16 -9
- package/dist/prisma.cjs.map +1 -1
- package/dist/prisma.js +16 -9
- package/dist/prisma.js.map +1 -1
- package/dist/react.cjs +27 -11
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +27 -11
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
package/dist/prisma.cjs
CHANGED
|
@@ -35,16 +35,23 @@ function createPrismaAdapter(prisma) {
|
|
|
35
35
|
create: { id: chatId, title },
|
|
36
36
|
update: { title }
|
|
37
37
|
});
|
|
38
|
-
await prisma.message.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
chatId,
|
|
42
|
-
role: msg.role,
|
|
43
|
-
parts: JSON.stringify(msg.parts),
|
|
44
|
-
metadata: msg.metadata ? JSON.stringify(msg.metadata) : null
|
|
45
|
-
})),
|
|
46
|
-
skipDuplicates: true
|
|
38
|
+
const existing = await prisma.message.findMany({
|
|
39
|
+
where: { chatId },
|
|
40
|
+
select: { id: true }
|
|
47
41
|
});
|
|
42
|
+
const existingIds = new Set(existing.map((m) => m.id));
|
|
43
|
+
const newMessages = messages.filter((msg) => !existingIds.has(msg.id));
|
|
44
|
+
if (newMessages.length > 0) {
|
|
45
|
+
await prisma.message.createMany({
|
|
46
|
+
data: newMessages.map((msg) => ({
|
|
47
|
+
id: msg.id,
|
|
48
|
+
chatId,
|
|
49
|
+
role: msg.role,
|
|
50
|
+
parts: JSON.stringify(msg.parts),
|
|
51
|
+
metadata: msg.metadata ? JSON.stringify(msg.metadata) : null
|
|
52
|
+
}))
|
|
53
|
+
});
|
|
54
|
+
}
|
|
48
55
|
},
|
|
49
56
|
async loadChat(chatId) {
|
|
50
57
|
const messages = await prisma.message.findMany({
|
package/dist/prisma.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/prisma.ts","../src/persistence/prisma-adapter.ts"],"sourcesContent":["export { createPrismaAdapter } from \"./persistence/prisma-adapter.js\";\nexport type { ChatAdapter, ChatSummary, UIMessageLike } from \"./persistence/types.js\";\n","import type { ChatAdapter, ChatSummary, UIMessageLike } from \"./types.js\";\n\n/**\n * Accepts any PrismaClient instance.\n * We use `any` here because Prisma generates unique client types per schema,\n * and a structural interface can't satisfy Prisma's branded enum types\n * (e.g. SortOrder). The implementation only calls standard Prisma methods.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype PrismaLike = any;\n\n/**\n * Create a ChatAdapter backed by Prisma.\n *\n * @example\n * ```ts\n * import { createPrismaAdapter } from '@supyagent/sdk/prisma';\n * import { prisma } from '@/lib/prisma';\n *\n * const adapter = createPrismaAdapter(prisma);\n * ```\n */\nexport function createPrismaAdapter(prisma: PrismaLike): ChatAdapter {\n return {\n async saveChat(chatId: string, messages: UIMessageLike[]) {\n // Extract title from first user message\n const firstUserMsg = messages.find((m) => m.role === \"user\");\n const title = extractTitle(firstUserMsg);\n\n // Upsert the chat record\n await prisma.chat.upsert({\n where: { id: chatId },\n create: { id: chatId, title },\n update: { title },\n });\n\n // Insert only messages not already persisted (idempotent)\n await prisma.message.
|
|
1
|
+
{"version":3,"sources":["../src/prisma.ts","../src/persistence/prisma-adapter.ts"],"sourcesContent":["export { createPrismaAdapter } from \"./persistence/prisma-adapter.js\";\nexport type { ChatAdapter, ChatSummary, UIMessageLike } from \"./persistence/types.js\";\n","import type { ChatAdapter, ChatSummary, UIMessageLike } from \"./types.js\";\n\n/**\n * Accepts any PrismaClient instance.\n * We use `any` here because Prisma generates unique client types per schema,\n * and a structural interface can't satisfy Prisma's branded enum types\n * (e.g. SortOrder). The implementation only calls standard Prisma methods.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype PrismaLike = any;\n\n/**\n * Create a ChatAdapter backed by Prisma.\n *\n * @example\n * ```ts\n * import { createPrismaAdapter } from '@supyagent/sdk/prisma';\n * import { prisma } from '@/lib/prisma';\n *\n * const adapter = createPrismaAdapter(prisma);\n * ```\n */\nexport function createPrismaAdapter(prisma: PrismaLike): ChatAdapter {\n return {\n async saveChat(chatId: string, messages: UIMessageLike[]) {\n // Extract title from first user message\n const firstUserMsg = messages.find((m) => m.role === \"user\");\n const title = extractTitle(firstUserMsg);\n\n // Upsert the chat record\n await prisma.chat.upsert({\n where: { id: chatId },\n create: { id: chatId, title },\n update: { title },\n });\n\n // Insert only messages not already persisted (idempotent)\n const existing = await prisma.message.findMany({\n where: { chatId },\n select: { id: true },\n });\n const existingIds = new Set(existing.map((m: { id: string }) => m.id));\n const newMessages = messages.filter((msg) => !existingIds.has(msg.id));\n\n if (newMessages.length > 0) {\n await prisma.message.createMany({\n data: newMessages.map((msg) => ({\n id: msg.id,\n chatId,\n role: msg.role,\n parts: JSON.stringify(msg.parts),\n metadata: msg.metadata ? JSON.stringify(msg.metadata) : null,\n })),\n });\n }\n },\n\n async loadChat(chatId: string) {\n const messages = await prisma.message.findMany({\n where: { chatId },\n orderBy: { createdAt: \"asc\" },\n });\n\n return messages.map((msg: { id: string; role: string; parts: string; metadata: string | null }) => ({\n id: msg.id,\n role: msg.role,\n parts: JSON.parse(msg.parts),\n metadata: msg.metadata ? JSON.parse(msg.metadata) : undefined,\n }));\n },\n\n async listChats() {\n return prisma.chat.findMany({\n orderBy: { updatedAt: \"desc\" },\n select: {\n id: true,\n title: true,\n createdAt: true,\n updatedAt: true,\n },\n });\n },\n\n async deleteChat(chatId: string) {\n await prisma.chat.delete({ where: { id: chatId } });\n },\n };\n}\n\nfunction extractTitle(message?: UIMessageLike): string {\n if (!message) return \"New Chat\";\n const textPart = message.parts.find((p) => p.type === \"text\");\n if (textPart && typeof textPart.text === \"string\") {\n return textPart.text.slice(0, 100);\n }\n return \"New Chat\";\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACsBO,SAAS,oBAAoB,QAAiC;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AAK,MAAM,IAAI,QAAQ,IAAI;AAAA,MACtD,EAAE;AAAA,IACJ;AAAA,IAEA,MAAM,YAAY;AAChB,aAAO,OAAO,KAAK,SAAS;AAAA,QAC1B,SAAS,EAAE,WAAW,OAAO;AAAA,QAC7B,QAAQ;AAAA,UACN,IAAI;AAAA,UACJ,OAAO;AAAA,UACP,WAAW;AAAA,UACX,WAAW;AAAA,QACb;AAAA,MACF,CAAC;AAAA,IACH;AAAA,IAEA,MAAM,WAAW,QAAgB;AAC/B,YAAM,OAAO,KAAK,OAAO,EAAE,OAAO,EAAE,IAAI,OAAO,EAAE,CAAC;AAAA,IACpD;AAAA,EACF;AACF;AAEA,SAAS,aAAa,SAAiC;AACrD,MAAI,CAAC,QAAS,QAAO;AACrB,QAAM,WAAW,QAAQ,MAAM,KAAK,CAAC,MAAM,EAAE,SAAS,MAAM;AAC5D,MAAI,YAAY,OAAO,SAAS,SAAS,UAAU;AACjD,WAAO,SAAS,KAAK,MAAM,GAAG,GAAG;AAAA,EACnC;AACA,SAAO;AACT;","names":[]}
|
package/dist/prisma.js
CHANGED
|
@@ -9,16 +9,23 @@ function createPrismaAdapter(prisma) {
|
|
|
9
9
|
create: { id: chatId, title },
|
|
10
10
|
update: { title }
|
|
11
11
|
});
|
|
12
|
-
await prisma.message.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
chatId,
|
|
16
|
-
role: msg.role,
|
|
17
|
-
parts: JSON.stringify(msg.parts),
|
|
18
|
-
metadata: msg.metadata ? JSON.stringify(msg.metadata) : null
|
|
19
|
-
})),
|
|
20
|
-
skipDuplicates: true
|
|
12
|
+
const existing = await prisma.message.findMany({
|
|
13
|
+
where: { chatId },
|
|
14
|
+
select: { id: true }
|
|
21
15
|
});
|
|
16
|
+
const existingIds = new Set(existing.map((m) => m.id));
|
|
17
|
+
const newMessages = messages.filter((msg) => !existingIds.has(msg.id));
|
|
18
|
+
if (newMessages.length > 0) {
|
|
19
|
+
await prisma.message.createMany({
|
|
20
|
+
data: newMessages.map((msg) => ({
|
|
21
|
+
id: msg.id,
|
|
22
|
+
chatId,
|
|
23
|
+
role: msg.role,
|
|
24
|
+
parts: JSON.stringify(msg.parts),
|
|
25
|
+
metadata: msg.metadata ? JSON.stringify(msg.metadata) : null
|
|
26
|
+
}))
|
|
27
|
+
});
|
|
28
|
+
}
|
|
22
29
|
},
|
|
23
30
|
async loadChat(chatId) {
|
|
24
31
|
const messages = await prisma.message.findMany({
|
package/dist/prisma.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/persistence/prisma-adapter.ts"],"sourcesContent":["import type { ChatAdapter, ChatSummary, UIMessageLike } from \"./types.js\";\n\n/**\n * Accepts any PrismaClient instance.\n * We use `any` here because Prisma generates unique client types per schema,\n * and a structural interface can't satisfy Prisma's branded enum types\n * (e.g. SortOrder). The implementation only calls standard Prisma methods.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype PrismaLike = any;\n\n/**\n * Create a ChatAdapter backed by Prisma.\n *\n * @example\n * ```ts\n * import { createPrismaAdapter } from '@supyagent/sdk/prisma';\n * import { prisma } from '@/lib/prisma';\n *\n * const adapter = createPrismaAdapter(prisma);\n * ```\n */\nexport function createPrismaAdapter(prisma: PrismaLike): ChatAdapter {\n return {\n async saveChat(chatId: string, messages: UIMessageLike[]) {\n // Extract title from first user message\n const firstUserMsg = messages.find((m) => m.role === \"user\");\n const title = extractTitle(firstUserMsg);\n\n // Upsert the chat record\n await prisma.chat.upsert({\n where: { id: chatId },\n create: { id: chatId, title },\n update: { title },\n });\n\n // Insert only messages not already persisted (idempotent)\n await prisma.message.
|
|
1
|
+
{"version":3,"sources":["../src/persistence/prisma-adapter.ts"],"sourcesContent":["import type { ChatAdapter, ChatSummary, UIMessageLike } from \"./types.js\";\n\n/**\n * Accepts any PrismaClient instance.\n * We use `any` here because Prisma generates unique client types per schema,\n * and a structural interface can't satisfy Prisma's branded enum types\n * (e.g. SortOrder). The implementation only calls standard Prisma methods.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype PrismaLike = any;\n\n/**\n * Create a ChatAdapter backed by Prisma.\n *\n * @example\n * ```ts\n * import { createPrismaAdapter } from '@supyagent/sdk/prisma';\n * import { prisma } from '@/lib/prisma';\n *\n * const adapter = createPrismaAdapter(prisma);\n * ```\n */\nexport function createPrismaAdapter(prisma: PrismaLike): ChatAdapter {\n return {\n async saveChat(chatId: string, messages: UIMessageLike[]) {\n // Extract title from first user message\n const firstUserMsg = messages.find((m) => m.role === \"user\");\n const title = extractTitle(firstUserMsg);\n\n // Upsert the chat record\n await prisma.chat.upsert({\n where: { id: chatId },\n create: { id: chatId, title },\n update: { title },\n });\n\n // Insert only messages not already persisted (idempotent)\n const existing = await prisma.message.findMany({\n where: { chatId },\n select: { id: true },\n });\n const existingIds = new Set(existing.map((m: { id: string }) => m.id));\n const newMessages = messages.filter((msg) => !existingIds.has(msg.id));\n\n if (newMessages.length > 0) {\n await prisma.message.createMany({\n data: newMessages.map((msg) => ({\n id: msg.id,\n chatId,\n role: msg.role,\n parts: JSON.stringify(msg.parts),\n metadata: msg.metadata ? JSON.stringify(msg.metadata) : null,\n })),\n });\n }\n },\n\n async loadChat(chatId: string) {\n const messages = await prisma.message.findMany({\n where: { chatId },\n orderBy: { createdAt: \"asc\" },\n });\n\n return messages.map((msg: { id: string; role: string; parts: string; metadata: string | null }) => ({\n id: msg.id,\n role: msg.role,\n parts: JSON.parse(msg.parts),\n metadata: msg.metadata ? JSON.parse(msg.metadata) : undefined,\n }));\n },\n\n async listChats() {\n return prisma.chat.findMany({\n orderBy: { updatedAt: \"desc\" },\n select: {\n id: true,\n title: true,\n createdAt: true,\n updatedAt: true,\n },\n });\n },\n\n async deleteChat(chatId: string) {\n await prisma.chat.delete({ where: { id: chatId } });\n },\n };\n}\n\nfunction extractTitle(message?: UIMessageLike): string {\n if (!message) return \"New Chat\";\n const textPart = message.parts.find((p) => p.type === \"text\");\n if (textPart && typeof textPart.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,QACR,MAAM,IAAI;AAAA,QACV,OAAO,KAAK,MAAM,IAAI,KAAK;AAAA,QAC3B,UAAU,IAAI,WAAW,KAAK,MAAM,IAAI,QAAQ,IAAI;AAAA,MACtD,EAAE;AAAA,IACJ;AAAA,IAEA,MAAM,YAAY;AAChB,aAAO,OAAO,KAAK,SAAS;AAAA,QAC1B,SAAS,EAAE,WAAW,OAAO;AAAA,QAC7B,QAAQ;AAAA,UACN,IAAI;AAAA,UACJ,OAAO;AAAA,UACP,WAAW;AAAA,UACX,WAAW;AAAA,QACb;AAAA,MACF,CAAC;AAAA,IACH;AAAA,IAEA,MAAM,WAAW,QAAgB;AAC/B,YAAM,OAAO,KAAK,OAAO,EAAE,OAAO,EAAE,IAAI,OAAO,EAAE,CAAC;AAAA,IACpD;AAAA,EACF;AACF;AAEA,SAAS,aAAa,SAAiC;AACrD,MAAI,CAAC,QAAS,QAAO;AACrB,QAAM,WAAW,QAAQ,MAAM,KAAK,CAAC,MAAM,EAAE,SAAS,MAAM;AAC5D,MAAI,YAAY,OAAO,SAAS,SAAS,UAAU;AACjD,WAAO,SAAS,KAAK,MAAM,GAAG,GAAG;AAAA,EACnC;AACA,SAAO;AACT;","names":[]}
|
package/dist/react.cjs
CHANGED
|
@@ -1814,7 +1814,16 @@ function ResendFormatter({ data }) {
|
|
|
1814
1814
|
var import_lucide_react18 = require("lucide-react");
|
|
1815
1815
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1816
1816
|
function isInboxEvent(data) {
|
|
1817
|
-
|
|
1817
|
+
if (typeof data !== "object" || data === null) return false;
|
|
1818
|
+
if ("event_type" in data || "summary" in data) return true;
|
|
1819
|
+
if ("title" in data || "type" in data && "source" in data) return true;
|
|
1820
|
+
return false;
|
|
1821
|
+
}
|
|
1822
|
+
function resolveEventType(event) {
|
|
1823
|
+
if (event.event_type) {
|
|
1824
|
+
return event.event_type.split(".")[0];
|
|
1825
|
+
}
|
|
1826
|
+
return event.type;
|
|
1818
1827
|
}
|
|
1819
1828
|
function getEventIcon(type) {
|
|
1820
1829
|
switch (type) {
|
|
@@ -1844,21 +1853,27 @@ function formatTimestamp2(dateStr) {
|
|
|
1844
1853
|
}
|
|
1845
1854
|
}
|
|
1846
1855
|
function EventCard2({ event }) {
|
|
1847
|
-
const
|
|
1848
|
-
const
|
|
1856
|
+
const eventType = resolveEventType(event);
|
|
1857
|
+
const Icon = getEventIcon(eventType);
|
|
1858
|
+
const timestamp = event.received_at || event.timestamp || event.created_at;
|
|
1859
|
+
const title = event.summary || event.title;
|
|
1860
|
+
const source = event.provider || event.source;
|
|
1861
|
+
const snippet = event.description || event.payload?.snippet || event.payload?.text;
|
|
1862
|
+
const isUnread = event.status === "unread" || event.read === false;
|
|
1849
1863
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "rounded-lg border border-border bg-card p-3 space-y-1.5", children: [
|
|
1850
1864
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-start gap-2", children: [
|
|
1851
1865
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Icon, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
|
|
1852
1866
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
1853
1867
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
1854
|
-
|
|
1855
|
-
|
|
1868
|
+
eventType && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground capitalize", children: eventType }),
|
|
1869
|
+
source && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-xs text-muted-foreground capitalize", children: source }),
|
|
1870
|
+
isUnread && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "h-1.5 w-1.5 rounded-full bg-primary shrink-0" }),
|
|
1856
1871
|
timestamp && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-xs text-muted-foreground ml-auto shrink-0", children: formatTimestamp2(timestamp) })
|
|
1857
1872
|
] }),
|
|
1858
|
-
|
|
1873
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-sm font-medium text-foreground mt-1 line-clamp-1", children: title })
|
|
1859
1874
|
] })
|
|
1860
1875
|
] }),
|
|
1861
|
-
|
|
1876
|
+
snippet && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-xs text-muted-foreground line-clamp-2 pl-6", children: snippet })
|
|
1862
1877
|
] });
|
|
1863
1878
|
}
|
|
1864
1879
|
function InboxFormatter({ data }) {
|
|
@@ -3099,9 +3114,9 @@ function SupyagentToolAction({ part, defaultExpanded = false }) {
|
|
|
3099
3114
|
const provider = getProviderFromToolName(toolName);
|
|
3100
3115
|
const providerLabel = getProviderLabel(provider);
|
|
3101
3116
|
const actionLabel = humanizeToolName(toolName);
|
|
3102
|
-
const isStreaming = state === "input-streaming";
|
|
3103
|
-
const isError = state === "output-error";
|
|
3104
|
-
const isDone = state === "output-available";
|
|
3117
|
+
const isStreaming = state === "input-streaming" || state === "partial-call" || state === "call";
|
|
3118
|
+
const isError = state === "output-error" || state === "error";
|
|
3119
|
+
const isDone = state === "output-available" || state === "result";
|
|
3105
3120
|
const hasResult = isDone || isError;
|
|
3106
3121
|
let summary;
|
|
3107
3122
|
let formatterOutput;
|
|
@@ -3114,7 +3129,8 @@ function SupyagentToolAction({ part, defaultExpanded = false }) {
|
|
|
3114
3129
|
formatterOutput = renderFormatter(formatterType, data);
|
|
3115
3130
|
}
|
|
3116
3131
|
}
|
|
3117
|
-
const
|
|
3132
|
+
const hasArgs = args && Object.keys(args).length > 0;
|
|
3133
|
+
const hasExpandableContent = hasArgs || formatterOutput;
|
|
3118
3134
|
const canExpand = !isStreaming && hasExpandableContent;
|
|
3119
3135
|
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
3120
3136
|
"div",
|