@btst/stack 4.4.0 → 4.5.1
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/README.md +2 -2
- package/dist/packages/stack/src/plugins/ai-chat/api/compaction.cjs +166 -39
- package/dist/packages/stack/src/plugins/ai-chat/api/compaction.mjs +167 -40
- package/dist/packages/stack/src/plugins/ai-chat/api/context-checkpoint.cjs +54 -0
- package/dist/packages/stack/src/plugins/ai-chat/api/context-checkpoint.mjs +51 -0
- package/dist/packages/stack/src/plugins/ai-chat/api/getters.cjs +2 -0
- package/dist/packages/stack/src/plugins/ai-chat/api/getters.mjs +2 -0
- package/dist/packages/stack/src/plugins/ai-chat/api/operations.cjs +275 -95
- package/dist/packages/stack/src/plugins/ai-chat/api/operations.mjs +276 -96
- package/dist/packages/stack/src/plugins/ai-chat/api/plugin.cjs +8 -5
- package/dist/packages/stack/src/plugins/ai-chat/api/plugin.mjs +8 -5
- package/dist/packages/stack/src/plugins/ai-chat/api/serializers.cjs +1 -0
- package/dist/packages/stack/src/plugins/ai-chat/api/serializers.mjs +1 -0
- package/dist/packages/stack/src/plugins/ai-chat/client/components/chat-input.cjs +3 -2
- package/dist/packages/stack/src/plugins/ai-chat/client/components/chat-input.mjs +3 -2
- package/dist/packages/stack/src/plugins/ai-chat/client/components/chat-interface.cjs +26 -17
- package/dist/packages/stack/src/plugins/ai-chat/client/components/chat-interface.mjs +26 -17
- package/dist/packages/stack/src/plugins/ai-chat/client/components/chat-message.cjs +22 -2
- package/dist/packages/stack/src/plugins/ai-chat/client/components/chat-message.mjs +22 -2
- package/dist/packages/stack/src/plugins/ai-chat/db.cjs +8 -0
- package/dist/packages/stack/src/plugins/ai-chat/db.mjs +8 -0
- package/dist/packages/stack/src/plugins/ai-chat/history.cjs +47 -0
- package/dist/packages/stack/src/plugins/ai-chat/history.mjs +45 -0
- package/dist/plugins/ai-chat/api/index.d.cts +2 -2
- package/dist/plugins/ai-chat/api/index.d.mts +2 -2
- package/dist/plugins/ai-chat/api/index.d.ts +2 -2
- package/dist/plugins/ai-chat/client/components/index.d.cts +1 -1
- package/dist/plugins/ai-chat/client/components/index.d.mts +1 -1
- package/dist/plugins/ai-chat/client/components/index.d.ts +1 -1
- package/dist/plugins/ai-chat/client/hooks/index.d.cts +2 -2
- package/dist/plugins/ai-chat/client/hooks/index.d.mts +2 -2
- package/dist/plugins/ai-chat/client/hooks/index.d.ts +2 -2
- package/dist/plugins/ai-chat/client/index.d.cts +3 -3
- package/dist/plugins/ai-chat/client/index.d.mts +3 -3
- package/dist/plugins/ai-chat/client/index.d.ts +3 -3
- package/dist/plugins/ai-chat/query-keys.d.cts +1 -1
- package/dist/plugins/ai-chat/query-keys.d.mts +1 -1
- package/dist/plugins/ai-chat/query-keys.d.ts +1 -1
- package/dist/plugins/blog/api/index.d.cts +1 -1
- package/dist/plugins/blog/api/index.d.mts +1 -1
- package/dist/plugins/blog/api/index.d.ts +1 -1
- package/dist/plugins/blog/query-keys.d.cts +1 -1
- package/dist/plugins/blog/query-keys.d.mts +1 -1
- package/dist/plugins/blog/query-keys.d.ts +1 -1
- package/dist/plugins/cms/api/index.d.cts +1 -1
- package/dist/plugins/cms/api/index.d.mts +1 -1
- package/dist/plugins/cms/api/index.d.ts +1 -1
- package/dist/plugins/cms/query-keys.d.cts +1 -1
- package/dist/plugins/cms/query-keys.d.mts +1 -1
- package/dist/plugins/cms/query-keys.d.ts +1 -1
- package/dist/plugins/form-builder/api/index.d.cts +1 -1
- package/dist/plugins/form-builder/api/index.d.mts +1 -1
- package/dist/plugins/form-builder/api/index.d.ts +1 -1
- package/dist/plugins/form-builder/client/hooks/index.d.cts +1 -1
- package/dist/plugins/form-builder/client/hooks/index.d.mts +1 -1
- package/dist/plugins/form-builder/client/hooks/index.d.ts +1 -1
- package/dist/plugins/form-builder/query-keys.d.cts +1 -1
- package/dist/plugins/form-builder/query-keys.d.mts +1 -1
- package/dist/plugins/form-builder/query-keys.d.ts +1 -1
- package/dist/plugins/ui-builder/client/hooks/index.d.cts +1 -1
- package/dist/plugins/ui-builder/client/hooks/index.d.mts +1 -1
- package/dist/plugins/ui-builder/client/hooks/index.d.ts +1 -1
- package/dist/plugins/ui-builder/client/index.d.cts +1 -1
- package/dist/plugins/ui-builder/client/index.d.mts +1 -1
- package/dist/plugins/ui-builder/client/index.d.ts +1 -1
- package/dist/plugins/ui-builder/query-keys.d.cts +1 -1
- package/dist/plugins/ui-builder/query-keys.d.mts +1 -1
- package/dist/plugins/ui-builder/query-keys.d.ts +1 -1
- package/dist/shared/{stack.DDQlE2Pm.d.cts → stack.Cei2T2gc.d.cts} +1 -0
- package/dist/shared/{stack.C4zspX0T.d.ts → stack.DDQTbADz.d.ts} +7 -2
- package/dist/shared/{stack.tAUeRAtd.d.mts → stack.DZRZAzcx.d.mts} +1 -0
- package/dist/shared/{stack.ymWsP4HZ.d.cts → stack.IY-ngxuw.d.cts} +7 -2
- package/dist/shared/{stack.DlehgNZZ.d.ts → stack.byjorQi5.d.ts} +1 -0
- package/dist/shared/{stack.Ps3MDhTC.d.mts → stack.mU9iMF2j.d.mts} +7 -2
- package/package.json +1 -1
- package/src/plugins/ai-chat/__tests__/authorization.test.ts +56 -30
- package/src/plugins/ai-chat/__tests__/chat-input-authorization.test.tsx +42 -0
- package/src/plugins/ai-chat/__tests__/classnames-overrides.test.tsx +25 -0
- package/src/plugins/ai-chat/__tests__/client-sweep.test.tsx +101 -0
- package/src/plugins/ai-chat/__tests__/compaction.test.ts +79 -19
- package/src/plugins/ai-chat/__tests__/persisted-compaction.test.ts +948 -0
- package/src/plugins/ai-chat/api/compaction.ts +243 -52
- package/src/plugins/ai-chat/api/context-checkpoint.ts +66 -0
- package/src/plugins/ai-chat/api/getters.ts +2 -0
- package/src/plugins/ai-chat/api/operations.ts +377 -101
- package/src/plugins/ai-chat/api/plugin.ts +14 -8
- package/src/plugins/ai-chat/api/serializers.ts +1 -0
- package/src/plugins/ai-chat/client/components/chat-input.tsx +3 -3
- package/src/plugins/ai-chat/client/components/chat-interface.tsx +43 -23
- package/src/plugins/ai-chat/client/components/chat-message.tsx +32 -2
- package/src/plugins/ai-chat/client/localization/index.ts +1 -0
- package/src/plugins/ai-chat/db.ts +8 -0
- package/src/plugins/ai-chat/history.ts +68 -0
- package/src/plugins/ai-chat/types.ts +2 -0
- package/dist/shared/{stack.B8PG21zX.d.mts → stack.BLYaUcQa.d.mts} +88 -88
- package/dist/shared/{stack.DNw6Hv5o.d.cts → stack.BOZRaVpu.d.cts} +2 -2
- package/dist/shared/{stack.D6Pg-ufX.d.cts → stack.Bf6BGZNk.d.cts} +88 -88
- package/dist/shared/{stack.CGmh-Lpe.d.ts → stack.BuxUQqL8.d.ts} +12 -12
- package/dist/shared/{stack.zch70Loj.d.cts → stack.CX83YNuS.d.cts} +12 -12
- package/dist/shared/{stack.CyalJ0j6.d.ts → stack.CyltNNZZ.d.ts} +88 -88
- package/dist/shared/{stack.Clil75lW.d.ts → stack.DlBoNqYu.d.ts} +2 -2
- package/dist/shared/{stack.DhZtP2JZ.d.mts → stack.Dvy7FmaA.d.mts} +2 -2
- package/dist/shared/{stack.Doy2_wgl.d.mts → stack.Egr3RWhA.d.mts} +12 -12
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
const jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
const history = require('../../history.cjs');
|
|
5
6
|
const react = require('@ai-sdk/react');
|
|
6
7
|
const React = require('react');
|
|
7
8
|
const reactQuery = require('@tanstack/react-query');
|
|
@@ -43,23 +44,18 @@ function reconcilePersistedMessageIds(messages, persistedMessages) {
|
|
|
43
44
|
}
|
|
44
45
|
return messages.map((message) => ({
|
|
45
46
|
...message,
|
|
46
|
-
id: persistedIds.get(message) ?? message.id
|
|
47
|
+
id: persistedIds.get(message) ?? message.id,
|
|
48
|
+
...persistedMessages.some(
|
|
49
|
+
(saved) => saved.id === message.id && saved.interrupted
|
|
50
|
+
) ? { metadata: { ...message.metadata, interrupted: true } } : {}
|
|
47
51
|
}));
|
|
48
52
|
}
|
|
49
53
|
function persistedMessagesToUiMessages(messages) {
|
|
50
|
-
return
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
} catch {
|
|
56
|
-
parts = [{ type: "text", text: message.content }];
|
|
57
|
-
}
|
|
58
|
-
return {
|
|
59
|
-
id: message.id,
|
|
60
|
-
role: message.role,
|
|
61
|
-
parts
|
|
62
|
-
};
|
|
54
|
+
return history.persistedHistory(messages).map((message) => {
|
|
55
|
+
const abandoned = message.parts.some(
|
|
56
|
+
(part) => "toolCallId" in part && (part.state === "input-streaming" || part.state === "input-available")
|
|
57
|
+
);
|
|
58
|
+
return abandoned ? { ...message, metadata: { interrupted: true } } : message;
|
|
63
59
|
});
|
|
64
60
|
}
|
|
65
61
|
function ChatActionCheck({
|
|
@@ -382,12 +378,13 @@ function ChatInterface({
|
|
|
382
378
|
id: `${chatInstanceId}:${isPublicMode ? "public" : identitySessionVersion}`,
|
|
383
379
|
transport,
|
|
384
380
|
onData: ({ type, data }) => {
|
|
385
|
-
if (!
|
|
381
|
+
if (!mounted.current || !data || typeof data !== "object") return;
|
|
382
|
+
if (!isPublicMode && (identitySessionVersion !== identitySessionGeneration.current || activeStreamPartitionKey.current !== latestIdentityPartitionKey.current))
|
|
386
383
|
return;
|
|
387
384
|
if (type === "data-context-status" && "compacting" in data) {
|
|
388
385
|
setIsCompacting(data.compacting === true);
|
|
389
386
|
}
|
|
390
|
-
if (type === "data-context-checkpoint" && "summary" in data && "throughMessageId" in data && typeof data.summary === "string" && typeof data.throughMessageId === "string") {
|
|
387
|
+
if (isPublicMode && type === "data-context-checkpoint" && "summary" in data && "throughMessageId" in data && typeof data.summary === "string" && typeof data.throughMessageId === "string") {
|
|
391
388
|
contextCheckpoint$1.current = contextCheckpoint.captureContextCheckpoint(
|
|
392
389
|
submittedMessages.current,
|
|
393
390
|
data.summary,
|
|
@@ -481,6 +478,19 @@ function ChatInterface({
|
|
|
481
478
|
).length
|
|
482
479
|
});
|
|
483
480
|
}
|
|
481
|
+
if (completion?.isAbort || completion?.isError || completion?.isDisconnect) {
|
|
482
|
+
setMessages(
|
|
483
|
+
(current) => current.map(
|
|
484
|
+
(message) => message.id === completion.message.id ? {
|
|
485
|
+
...message,
|
|
486
|
+
metadata: {
|
|
487
|
+
...message.metadata,
|
|
488
|
+
interrupted: true
|
|
489
|
+
}
|
|
490
|
+
} : message
|
|
491
|
+
)
|
|
492
|
+
);
|
|
493
|
+
}
|
|
484
494
|
if (isPublicMode) {
|
|
485
495
|
activeStreamPartitionKey.current = void 0;
|
|
486
496
|
return;
|
|
@@ -1023,7 +1033,6 @@ function ChatInterface({
|
|
|
1023
1033
|
variant: isWidget ? "compact" : "default",
|
|
1024
1034
|
onFilesAttached: setAttachedFiles,
|
|
1025
1035
|
attachedFiles,
|
|
1026
|
-
allowAttachments: !isPublicMode,
|
|
1027
1036
|
attachmentPermissionFacts: {
|
|
1028
1037
|
...currentConversationId ? { conversationId: currentConversationId } : {},
|
|
1029
1038
|
...currentConversationOwnerId ? { ownerId: currentConversationOwnerId } : {}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { persistedHistory } from '../../history.mjs';
|
|
3
4
|
import { useChat } from '@ai-sdk/react';
|
|
4
5
|
import { useId, useRef, useState, useMemo, useEffect, useCallback, useLayoutEffect } from 'react';
|
|
5
6
|
import { useQueryClient, hashKey } from '@tanstack/react-query';
|
|
@@ -41,23 +42,18 @@ function reconcilePersistedMessageIds(messages, persistedMessages) {
|
|
|
41
42
|
}
|
|
42
43
|
return messages.map((message) => ({
|
|
43
44
|
...message,
|
|
44
|
-
id: persistedIds.get(message) ?? message.id
|
|
45
|
+
id: persistedIds.get(message) ?? message.id,
|
|
46
|
+
...persistedMessages.some(
|
|
47
|
+
(saved) => saved.id === message.id && saved.interrupted
|
|
48
|
+
) ? { metadata: { ...message.metadata, interrupted: true } } : {}
|
|
45
49
|
}));
|
|
46
50
|
}
|
|
47
51
|
function persistedMessagesToUiMessages(messages) {
|
|
48
|
-
return messages
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
} catch {
|
|
54
|
-
parts = [{ type: "text", text: message.content }];
|
|
55
|
-
}
|
|
56
|
-
return {
|
|
57
|
-
id: message.id,
|
|
58
|
-
role: message.role,
|
|
59
|
-
parts
|
|
60
|
-
};
|
|
52
|
+
return persistedHistory(messages).map((message) => {
|
|
53
|
+
const abandoned = message.parts.some(
|
|
54
|
+
(part) => "toolCallId" in part && (part.state === "input-streaming" || part.state === "input-available")
|
|
55
|
+
);
|
|
56
|
+
return abandoned ? { ...message, metadata: { interrupted: true } } : message;
|
|
61
57
|
});
|
|
62
58
|
}
|
|
63
59
|
function ChatActionCheck({
|
|
@@ -380,12 +376,13 @@ function ChatInterface({
|
|
|
380
376
|
id: `${chatInstanceId}:${isPublicMode ? "public" : identitySessionVersion}`,
|
|
381
377
|
transport,
|
|
382
378
|
onData: ({ type, data }) => {
|
|
383
|
-
if (!
|
|
379
|
+
if (!mounted.current || !data || typeof data !== "object") return;
|
|
380
|
+
if (!isPublicMode && (identitySessionVersion !== identitySessionGeneration.current || activeStreamPartitionKey.current !== latestIdentityPartitionKey.current))
|
|
384
381
|
return;
|
|
385
382
|
if (type === "data-context-status" && "compacting" in data) {
|
|
386
383
|
setIsCompacting(data.compacting === true);
|
|
387
384
|
}
|
|
388
|
-
if (type === "data-context-checkpoint" && "summary" in data && "throughMessageId" in data && typeof data.summary === "string" && typeof data.throughMessageId === "string") {
|
|
385
|
+
if (isPublicMode && type === "data-context-checkpoint" && "summary" in data && "throughMessageId" in data && typeof data.summary === "string" && typeof data.throughMessageId === "string") {
|
|
389
386
|
contextCheckpoint.current = captureContextCheckpoint(
|
|
390
387
|
submittedMessages.current,
|
|
391
388
|
data.summary,
|
|
@@ -479,6 +476,19 @@ function ChatInterface({
|
|
|
479
476
|
).length
|
|
480
477
|
});
|
|
481
478
|
}
|
|
479
|
+
if (completion?.isAbort || completion?.isError || completion?.isDisconnect) {
|
|
480
|
+
setMessages(
|
|
481
|
+
(current) => current.map(
|
|
482
|
+
(message) => message.id === completion.message.id ? {
|
|
483
|
+
...message,
|
|
484
|
+
metadata: {
|
|
485
|
+
...message.metadata,
|
|
486
|
+
interrupted: true
|
|
487
|
+
}
|
|
488
|
+
} : message
|
|
489
|
+
)
|
|
490
|
+
);
|
|
491
|
+
}
|
|
482
492
|
if (isPublicMode) {
|
|
483
493
|
activeStreamPartitionKey.current = void 0;
|
|
484
494
|
return;
|
|
@@ -1021,7 +1031,6 @@ function ChatInterface({
|
|
|
1021
1031
|
variant: isWidget ? "compact" : "default",
|
|
1022
1032
|
onFilesAttached: setAttachedFiles,
|
|
1023
1033
|
attachedFiles,
|
|
1024
|
-
allowAttachments: !isPublicMode,
|
|
1025
1034
|
attachmentPermissionFacts: {
|
|
1026
1035
|
...currentConversationId ? { conversationId: currentConversationId } : {},
|
|
1027
1036
|
...currentConversationOwnerId ? { ownerId: currentConversationOwnerId } : {}
|
|
@@ -82,6 +82,9 @@ function ChatMessage({
|
|
|
82
82
|
isRetrying = false
|
|
83
83
|
}) {
|
|
84
84
|
const isUser = message.role === "user";
|
|
85
|
+
const interrupted = Boolean(
|
|
86
|
+
message.metadata && typeof message.metadata === "object" && "interrupted" in message.metadata && message.metadata.interrupted
|
|
87
|
+
);
|
|
85
88
|
const {
|
|
86
89
|
localization: customLocalization,
|
|
87
90
|
toolRenderers,
|
|
@@ -359,10 +362,15 @@ function ChatMessage({
|
|
|
359
362
|
toolParts.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2", children: toolParts.map((part) => {
|
|
360
363
|
const toolName = ai.getToolName(part);
|
|
361
364
|
const toolCallId = part.toolCallId;
|
|
362
|
-
const
|
|
365
|
+
const unfinished = interrupted && (part.state === "input-streaming" || part.state === "input-available");
|
|
366
|
+
const state = unfinished ? "output-error" : part.state;
|
|
363
367
|
const input = part.input;
|
|
364
368
|
const output = part.output;
|
|
365
|
-
const errorText =
|
|
369
|
+
const errorText = unfinished ? tr(
|
|
370
|
+
"CHAT_INTERRUPTED",
|
|
371
|
+
"aiChat.interrupted",
|
|
372
|
+
"Response interrupted"
|
|
373
|
+
) : part.errorText;
|
|
366
374
|
const isLoading = state === "input-streaming" || state === "input-available";
|
|
367
375
|
const toolCallProps = {
|
|
368
376
|
toolCallId,
|
|
@@ -379,6 +387,18 @@ function ChatMessage({
|
|
|
379
387
|
}
|
|
380
388
|
return /* @__PURE__ */ jsxRuntime.jsx(toolCallDisplay.ToolCallDisplay, { ...toolCallProps }, toolCallId);
|
|
381
389
|
}) }),
|
|
390
|
+
interrupted && !isStreaming && /* @__PURE__ */ jsxRuntime.jsx(
|
|
391
|
+
"p",
|
|
392
|
+
{
|
|
393
|
+
className: "text-xs text-muted-foreground",
|
|
394
|
+
"data-testid": "chat-interrupted",
|
|
395
|
+
children: tr(
|
|
396
|
+
"CHAT_INTERRUPTED",
|
|
397
|
+
"aiChat.interrupted",
|
|
398
|
+
"Response interrupted"
|
|
399
|
+
)
|
|
400
|
+
}
|
|
401
|
+
),
|
|
382
402
|
displayContent ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
383
403
|
markdownContent.MarkdownContent,
|
|
384
404
|
{
|
|
@@ -76,6 +76,9 @@ function ChatMessage({
|
|
|
76
76
|
isRetrying = false
|
|
77
77
|
}) {
|
|
78
78
|
const isUser = message.role === "user";
|
|
79
|
+
const interrupted = Boolean(
|
|
80
|
+
message.metadata && typeof message.metadata === "object" && "interrupted" in message.metadata && message.metadata.interrupted
|
|
81
|
+
);
|
|
79
82
|
const {
|
|
80
83
|
localization: customLocalization,
|
|
81
84
|
toolRenderers,
|
|
@@ -353,10 +356,15 @@ function ChatMessage({
|
|
|
353
356
|
toolParts.length > 0 && /* @__PURE__ */ jsx("div", { className: "space-y-2", children: toolParts.map((part) => {
|
|
354
357
|
const toolName = getToolName(part);
|
|
355
358
|
const toolCallId = part.toolCallId;
|
|
356
|
-
const
|
|
359
|
+
const unfinished = interrupted && (part.state === "input-streaming" || part.state === "input-available");
|
|
360
|
+
const state = unfinished ? "output-error" : part.state;
|
|
357
361
|
const input = part.input;
|
|
358
362
|
const output = part.output;
|
|
359
|
-
const errorText =
|
|
363
|
+
const errorText = unfinished ? tr(
|
|
364
|
+
"CHAT_INTERRUPTED",
|
|
365
|
+
"aiChat.interrupted",
|
|
366
|
+
"Response interrupted"
|
|
367
|
+
) : part.errorText;
|
|
360
368
|
const isLoading = state === "input-streaming" || state === "input-available";
|
|
361
369
|
const toolCallProps = {
|
|
362
370
|
toolCallId,
|
|
@@ -373,6 +381,18 @@ function ChatMessage({
|
|
|
373
381
|
}
|
|
374
382
|
return /* @__PURE__ */ jsx(ToolCallDisplay, { ...toolCallProps }, toolCallId);
|
|
375
383
|
}) }),
|
|
384
|
+
interrupted && !isStreaming && /* @__PURE__ */ jsx(
|
|
385
|
+
"p",
|
|
386
|
+
{
|
|
387
|
+
className: "text-xs text-muted-foreground",
|
|
388
|
+
"data-testid": "chat-interrupted",
|
|
389
|
+
children: tr(
|
|
390
|
+
"CHAT_INTERRUPTED",
|
|
391
|
+
"aiChat.interrupted",
|
|
392
|
+
"Response interrupted"
|
|
393
|
+
)
|
|
394
|
+
}
|
|
395
|
+
),
|
|
376
396
|
displayContent ? /* @__PURE__ */ jsx(
|
|
377
397
|
MarkdownContent,
|
|
378
398
|
{
|
|
@@ -19,6 +19,10 @@ const aiChatSchema = db.createDbPlugin("aiChat", {
|
|
|
19
19
|
type: "string",
|
|
20
20
|
required: true
|
|
21
21
|
},
|
|
22
|
+
contextCheckpoint: {
|
|
23
|
+
type: "string",
|
|
24
|
+
required: false
|
|
25
|
+
},
|
|
22
26
|
createdAt: {
|
|
23
27
|
type: "date",
|
|
24
28
|
defaultValue: () => /* @__PURE__ */ new Date()
|
|
@@ -54,6 +58,10 @@ const aiChatSchema = db.createDbPlugin("aiChat", {
|
|
|
54
58
|
type: "string",
|
|
55
59
|
required: true
|
|
56
60
|
},
|
|
61
|
+
interrupted: {
|
|
62
|
+
type: "boolean",
|
|
63
|
+
required: false
|
|
64
|
+
},
|
|
57
65
|
createdAt: {
|
|
58
66
|
type: "date",
|
|
59
67
|
defaultValue: () => /* @__PURE__ */ new Date()
|
|
@@ -17,6 +17,10 @@ const aiChatSchema = createDbPlugin("aiChat", {
|
|
|
17
17
|
type: "string",
|
|
18
18
|
required: true
|
|
19
19
|
},
|
|
20
|
+
contextCheckpoint: {
|
|
21
|
+
type: "string",
|
|
22
|
+
required: false
|
|
23
|
+
},
|
|
20
24
|
createdAt: {
|
|
21
25
|
type: "date",
|
|
22
26
|
defaultValue: () => /* @__PURE__ */ new Date()
|
|
@@ -52,6 +56,10 @@ const aiChatSchema = createDbPlugin("aiChat", {
|
|
|
52
56
|
type: "string",
|
|
53
57
|
required: true
|
|
54
58
|
},
|
|
59
|
+
interrupted: {
|
|
60
|
+
type: "boolean",
|
|
61
|
+
required: false
|
|
62
|
+
},
|
|
55
63
|
createdAt: {
|
|
56
64
|
type: "date",
|
|
57
65
|
defaultValue: () => /* @__PURE__ */ new Date()
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function isMessagePart(value) {
|
|
4
|
+
if (!value || typeof value !== "object" || !("type" in value)) return false;
|
|
5
|
+
const part = value;
|
|
6
|
+
if (typeof part.type !== "string") return false;
|
|
7
|
+
switch (part.type) {
|
|
8
|
+
case "text":
|
|
9
|
+
case "reasoning":
|
|
10
|
+
return typeof part.text === "string";
|
|
11
|
+
case "file":
|
|
12
|
+
return typeof part.url === "string" && typeof part.mediaType === "string";
|
|
13
|
+
case "source-url":
|
|
14
|
+
return typeof part.sourceId === "string" && typeof part.url === "string";
|
|
15
|
+
case "source-document":
|
|
16
|
+
return typeof part.sourceId === "string" && typeof part.mediaType === "string" && typeof part.title === "string";
|
|
17
|
+
case "step-start":
|
|
18
|
+
return true;
|
|
19
|
+
default:
|
|
20
|
+
if (part.type.startsWith("data-")) return "data" in part;
|
|
21
|
+
return (part.type.startsWith("tool-") || part.type === "dynamic-tool" && typeof part.toolName === "string") && typeof part.toolCallId === "string" && [
|
|
22
|
+
"input-streaming",
|
|
23
|
+
"input-available",
|
|
24
|
+
"output-available",
|
|
25
|
+
"output-error"
|
|
26
|
+
].includes(String(part.state));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function persistedHistory(messages) {
|
|
30
|
+
return messages.filter((message) => message.role !== "data").map((message) => {
|
|
31
|
+
let parts;
|
|
32
|
+
try {
|
|
33
|
+
const parsed = JSON.parse(message.content);
|
|
34
|
+
parts = Array.isArray(parsed) && (parsed.length > 0 || message.role === "assistant") && parsed.every(isMessagePart) ? parsed : [{ type: "text", text: message.content }];
|
|
35
|
+
} catch {
|
|
36
|
+
parts = [{ type: "text", text: message.content }];
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
id: message.id,
|
|
40
|
+
role: message.role,
|
|
41
|
+
parts,
|
|
42
|
+
...message.interrupted ? { metadata: { interrupted: true } } : {}
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
exports.persistedHistory = persistedHistory;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
function isMessagePart(value) {
|
|
2
|
+
if (!value || typeof value !== "object" || !("type" in value)) return false;
|
|
3
|
+
const part = value;
|
|
4
|
+
if (typeof part.type !== "string") return false;
|
|
5
|
+
switch (part.type) {
|
|
6
|
+
case "text":
|
|
7
|
+
case "reasoning":
|
|
8
|
+
return typeof part.text === "string";
|
|
9
|
+
case "file":
|
|
10
|
+
return typeof part.url === "string" && typeof part.mediaType === "string";
|
|
11
|
+
case "source-url":
|
|
12
|
+
return typeof part.sourceId === "string" && typeof part.url === "string";
|
|
13
|
+
case "source-document":
|
|
14
|
+
return typeof part.sourceId === "string" && typeof part.mediaType === "string" && typeof part.title === "string";
|
|
15
|
+
case "step-start":
|
|
16
|
+
return true;
|
|
17
|
+
default:
|
|
18
|
+
if (part.type.startsWith("data-")) return "data" in part;
|
|
19
|
+
return (part.type.startsWith("tool-") || part.type === "dynamic-tool" && typeof part.toolName === "string") && typeof part.toolCallId === "string" && [
|
|
20
|
+
"input-streaming",
|
|
21
|
+
"input-available",
|
|
22
|
+
"output-available",
|
|
23
|
+
"output-error"
|
|
24
|
+
].includes(String(part.state));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function persistedHistory(messages) {
|
|
28
|
+
return messages.filter((message) => message.role !== "data").map((message) => {
|
|
29
|
+
let parts;
|
|
30
|
+
try {
|
|
31
|
+
const parsed = JSON.parse(message.content);
|
|
32
|
+
parts = Array.isArray(parsed) && (parsed.length > 0 || message.role === "assistant") && parsed.every(isMessagePart) ? parsed : [{ type: "text", text: message.content }];
|
|
33
|
+
} catch {
|
|
34
|
+
parts = [{ type: "text", text: message.content }];
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
id: message.id,
|
|
38
|
+
role: message.role,
|
|
39
|
+
parts,
|
|
40
|
+
...message.interrupted ? { metadata: { interrupted: true } } : {}
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export { persistedHistory };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as Conversation, M as Message } from '../../../shared/stack.
|
|
2
|
-
export { p as AI_CHAT_OPERATION_INVENTORY, q as AI_CHAT_RAW_ESCAPE_HATCH_INVENTORY, m as AiChatAccess, j as AiChatApiRouter, h as AiChatBackendConfig, n as AiChatBackendHooks, k as AiChatCompactionConfig, A as AiChatIdentityPartition, r as AiChatOperationError, l as AiChatPageContentConfig, g as AiChatQueryKeys, o as ChatApiContext, s as ChatOperationInputSchema, t as ConversationOperationInputSchema, C as ConversationWithMessages, b as CreateConversationInput, R as RenameConversationInput, U as UpdateConversationOperationInputSchema, i as aiChatBackendPlugin, d as aiChatIdentityKey, e as aiChatResources, f as createAiChatQueryKeys } from '../../../shared/stack.
|
|
1
|
+
import { c as Conversation, M as Message } from '../../../shared/stack.IY-ngxuw.cjs';
|
|
2
|
+
export { p as AI_CHAT_OPERATION_INVENTORY, q as AI_CHAT_RAW_ESCAPE_HATCH_INVENTORY, m as AiChatAccess, j as AiChatApiRouter, h as AiChatBackendConfig, n as AiChatBackendHooks, k as AiChatCompactionConfig, A as AiChatIdentityPartition, r as AiChatOperationError, l as AiChatPageContentConfig, g as AiChatQueryKeys, o as ChatApiContext, s as ChatOperationInputSchema, t as ConversationOperationInputSchema, C as ConversationWithMessages, b as CreateConversationInput, R as RenameConversationInput, U as UpdateConversationOperationInputSchema, i as aiChatBackendPlugin, d as aiChatIdentityKey, e as aiChatResources, f as createAiChatQueryKeys } from '../../../shared/stack.IY-ngxuw.cjs';
|
|
3
3
|
import { DBAdapter } from '@btst/db';
|
|
4
4
|
import '@btst/stack/plugins/client';
|
|
5
5
|
import '@btst/stack/plugins/api';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as Conversation, M as Message } from '../../../shared/stack.
|
|
2
|
-
export { p as AI_CHAT_OPERATION_INVENTORY, q as AI_CHAT_RAW_ESCAPE_HATCH_INVENTORY, m as AiChatAccess, j as AiChatApiRouter, h as AiChatBackendConfig, n as AiChatBackendHooks, k as AiChatCompactionConfig, A as AiChatIdentityPartition, r as AiChatOperationError, l as AiChatPageContentConfig, g as AiChatQueryKeys, o as ChatApiContext, s as ChatOperationInputSchema, t as ConversationOperationInputSchema, C as ConversationWithMessages, b as CreateConversationInput, R as RenameConversationInput, U as UpdateConversationOperationInputSchema, i as aiChatBackendPlugin, d as aiChatIdentityKey, e as aiChatResources, f as createAiChatQueryKeys } from '../../../shared/stack.
|
|
1
|
+
import { c as Conversation, M as Message } from '../../../shared/stack.mU9iMF2j.mjs';
|
|
2
|
+
export { p as AI_CHAT_OPERATION_INVENTORY, q as AI_CHAT_RAW_ESCAPE_HATCH_INVENTORY, m as AiChatAccess, j as AiChatApiRouter, h as AiChatBackendConfig, n as AiChatBackendHooks, k as AiChatCompactionConfig, A as AiChatIdentityPartition, r as AiChatOperationError, l as AiChatPageContentConfig, g as AiChatQueryKeys, o as ChatApiContext, s as ChatOperationInputSchema, t as ConversationOperationInputSchema, C as ConversationWithMessages, b as CreateConversationInput, R as RenameConversationInput, U as UpdateConversationOperationInputSchema, i as aiChatBackendPlugin, d as aiChatIdentityKey, e as aiChatResources, f as createAiChatQueryKeys } from '../../../shared/stack.mU9iMF2j.mjs';
|
|
3
3
|
import { DBAdapter } from '@btst/db';
|
|
4
4
|
import '@btst/stack/plugins/client';
|
|
5
5
|
import '@btst/stack/plugins/api';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as Conversation, M as Message } from '../../../shared/stack.
|
|
2
|
-
export { p as AI_CHAT_OPERATION_INVENTORY, q as AI_CHAT_RAW_ESCAPE_HATCH_INVENTORY, m as AiChatAccess, j as AiChatApiRouter, h as AiChatBackendConfig, n as AiChatBackendHooks, k as AiChatCompactionConfig, A as AiChatIdentityPartition, r as AiChatOperationError, l as AiChatPageContentConfig, g as AiChatQueryKeys, o as ChatApiContext, s as ChatOperationInputSchema, t as ConversationOperationInputSchema, C as ConversationWithMessages, b as CreateConversationInput, R as RenameConversationInput, U as UpdateConversationOperationInputSchema, i as aiChatBackendPlugin, d as aiChatIdentityKey, e as aiChatResources, f as createAiChatQueryKeys } from '../../../shared/stack.
|
|
1
|
+
import { c as Conversation, M as Message } from '../../../shared/stack.DDQTbADz.js';
|
|
2
|
+
export { p as AI_CHAT_OPERATION_INVENTORY, q as AI_CHAT_RAW_ESCAPE_HATCH_INVENTORY, m as AiChatAccess, j as AiChatApiRouter, h as AiChatBackendConfig, n as AiChatBackendHooks, k as AiChatCompactionConfig, A as AiChatIdentityPartition, r as AiChatOperationError, l as AiChatPageContentConfig, g as AiChatQueryKeys, o as ChatApiContext, s as ChatOperationInputSchema, t as ConversationOperationInputSchema, C as ConversationWithMessages, b as CreateConversationInput, R as RenameConversationInput, U as UpdateConversationOperationInputSchema, i as aiChatBackendPlugin, d as aiChatIdentityKey, e as aiChatResources, f as createAiChatQueryKeys } from '../../../shared/stack.DDQTbADz.js';
|
|
3
3
|
import { DBAdapter } from '@btst/db';
|
|
4
4
|
import '@btst/stack/plugins/client';
|
|
5
5
|
import '@btst/stack/plugins/api';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { j as ChatInput, C as ChatInterface, f as ChatLayout, g as ChatLayoutProps, i as ChatMessage, h as ChatSidebar, k as ToolCallDisplay } from '../../../../shared/stack.
|
|
1
|
+
export { j as ChatInput, C as ChatInterface, f as ChatLayout, g as ChatLayoutProps, i as ChatMessage, h as ChatSidebar, k as ToolCallDisplay } from '../../../../shared/stack.Cei2T2gc.cjs';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import { FallbackProps } from 'react-error-boundary';
|
|
4
4
|
import 'ai';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { j as ChatInput, C as ChatInterface, f as ChatLayout, g as ChatLayoutProps, i as ChatMessage, h as ChatSidebar, k as ToolCallDisplay } from '../../../../shared/stack.
|
|
1
|
+
export { j as ChatInput, C as ChatInterface, f as ChatLayout, g as ChatLayoutProps, i as ChatMessage, h as ChatSidebar, k as ToolCallDisplay } from '../../../../shared/stack.DZRZAzcx.mjs';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import { FallbackProps } from 'react-error-boundary';
|
|
4
4
|
import 'ai';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { j as ChatInput, C as ChatInterface, f as ChatLayout, g as ChatLayoutProps, i as ChatMessage, h as ChatSidebar, k as ToolCallDisplay } from '../../../../shared/stack.
|
|
1
|
+
export { j as ChatInput, C as ChatInterface, f as ChatLayout, g as ChatLayoutProps, i as ChatMessage, h as ChatSidebar, k as ToolCallDisplay } from '../../../../shared/stack.byjorQi5.js';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import { FallbackProps } from 'react-error-boundary';
|
|
4
4
|
import 'ai';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UseMutationResult } from '@tanstack/react-query';
|
|
2
2
|
import { ResourceFormResult } from '@btst/stack/plugins/client/hooks';
|
|
3
|
-
import { A as AiChatIdentityPartition, S as SerializedConversation, C as ConversationWithMessages, b as CreateConversationInput, R as RenameConversationInput } from '../../../../shared/stack.
|
|
4
|
-
export { a as SerializedMessage } from '../../../../shared/stack.
|
|
3
|
+
import { A as AiChatIdentityPartition, S as SerializedConversation, C as ConversationWithMessages, b as CreateConversationInput, R as RenameConversationInput } from '../../../../shared/stack.IY-ngxuw.cjs';
|
|
4
|
+
export { a as SerializedMessage } from '../../../../shared/stack.IY-ngxuw.cjs';
|
|
5
5
|
import '@btst/stack/plugins/client';
|
|
6
6
|
import '@btst/stack/plugins/api';
|
|
7
7
|
import '@btst/stack/authorization';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UseMutationResult } from '@tanstack/react-query';
|
|
2
2
|
import { ResourceFormResult } from '@btst/stack/plugins/client/hooks';
|
|
3
|
-
import { A as AiChatIdentityPartition, S as SerializedConversation, C as ConversationWithMessages, b as CreateConversationInput, R as RenameConversationInput } from '../../../../shared/stack.
|
|
4
|
-
export { a as SerializedMessage } from '../../../../shared/stack.
|
|
3
|
+
import { A as AiChatIdentityPartition, S as SerializedConversation, C as ConversationWithMessages, b as CreateConversationInput, R as RenameConversationInput } from '../../../../shared/stack.mU9iMF2j.mjs';
|
|
4
|
+
export { a as SerializedMessage } from '../../../../shared/stack.mU9iMF2j.mjs';
|
|
5
5
|
import '@btst/stack/plugins/client';
|
|
6
6
|
import '@btst/stack/plugins/api';
|
|
7
7
|
import '@btst/stack/authorization';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UseMutationResult } from '@tanstack/react-query';
|
|
2
2
|
import { ResourceFormResult } from '@btst/stack/plugins/client/hooks';
|
|
3
|
-
import { A as AiChatIdentityPartition, S as SerializedConversation, C as ConversationWithMessages, b as CreateConversationInput, R as RenameConversationInput } from '../../../../shared/stack.
|
|
4
|
-
export { a as SerializedMessage } from '../../../../shared/stack.
|
|
3
|
+
import { A as AiChatIdentityPartition, S as SerializedConversation, C as ConversationWithMessages, b as CreateConversationInput, R as RenameConversationInput } from '../../../../shared/stack.DDQTbADz.js';
|
|
4
|
+
export { a as SerializedMessage } from '../../../../shared/stack.DDQTbADz.js';
|
|
5
5
|
import '@btst/stack/plugins/client';
|
|
6
6
|
import '@btst/stack/plugins/api';
|
|
7
7
|
import '@btst/stack/authorization';
|
|
@@ -2,9 +2,9 @@ import * as _btst_stack_plugins_client from '@btst/stack/plugins/client';
|
|
|
2
2
|
import * as _btst_yar from '@btst/yar';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import { ComponentType } from 'react';
|
|
5
|
-
import { S as SerializedConversation, a as SerializedMessage, A as AiChatIdentityPartition } from '../../../shared/stack.
|
|
6
|
-
import { A as AiChatMode, a as AiChatPluginOverrides } from '../../../shared/stack.
|
|
7
|
-
export { l as AiChatAnalyticsEvent, b as AiChatProviderConfig, c as AllowedFileType, j as ChatInput, C as ChatInterface, f as ChatLayout, g as ChatLayoutProps, i as ChatMessage, h as ChatSidebar, D as DEFAULT_ALLOWED_FILE_TYPES, k as ToolCallDisplay, T as ToolCallProps, e as ToolCallRenderer, d as ToolCallState } from '../../../shared/stack.
|
|
5
|
+
import { S as SerializedConversation, a as SerializedMessage, A as AiChatIdentityPartition } from '../../../shared/stack.IY-ngxuw.cjs';
|
|
6
|
+
import { A as AiChatMode, a as AiChatPluginOverrides } from '../../../shared/stack.Cei2T2gc.cjs';
|
|
7
|
+
export { l as AiChatAnalyticsEvent, b as AiChatProviderConfig, c as AllowedFileType, j as ChatInput, C as ChatInterface, f as ChatLayout, g as ChatLayoutProps, i as ChatMessage, h as ChatSidebar, D as DEFAULT_ALLOWED_FILE_TYPES, k as ToolCallDisplay, T as ToolCallProps, e as ToolCallRenderer, d as ToolCallState } from '../../../shared/stack.Cei2T2gc.cjs';
|
|
8
8
|
export { UIMessage } from 'ai';
|
|
9
9
|
import '@btst/stack/plugins/api';
|
|
10
10
|
import '@btst/stack/authorization';
|
|
@@ -2,9 +2,9 @@ import * as _btst_stack_plugins_client from '@btst/stack/plugins/client';
|
|
|
2
2
|
import * as _btst_yar from '@btst/yar';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import { ComponentType } from 'react';
|
|
5
|
-
import { S as SerializedConversation, a as SerializedMessage, A as AiChatIdentityPartition } from '../../../shared/stack.
|
|
6
|
-
import { A as AiChatMode, a as AiChatPluginOverrides } from '../../../shared/stack.
|
|
7
|
-
export { l as AiChatAnalyticsEvent, b as AiChatProviderConfig, c as AllowedFileType, j as ChatInput, C as ChatInterface, f as ChatLayout, g as ChatLayoutProps, i as ChatMessage, h as ChatSidebar, D as DEFAULT_ALLOWED_FILE_TYPES, k as ToolCallDisplay, T as ToolCallProps, e as ToolCallRenderer, d as ToolCallState } from '../../../shared/stack.
|
|
5
|
+
import { S as SerializedConversation, a as SerializedMessage, A as AiChatIdentityPartition } from '../../../shared/stack.mU9iMF2j.mjs';
|
|
6
|
+
import { A as AiChatMode, a as AiChatPluginOverrides } from '../../../shared/stack.DZRZAzcx.mjs';
|
|
7
|
+
export { l as AiChatAnalyticsEvent, b as AiChatProviderConfig, c as AllowedFileType, j as ChatInput, C as ChatInterface, f as ChatLayout, g as ChatLayoutProps, i as ChatMessage, h as ChatSidebar, D as DEFAULT_ALLOWED_FILE_TYPES, k as ToolCallDisplay, T as ToolCallProps, e as ToolCallRenderer, d as ToolCallState } from '../../../shared/stack.DZRZAzcx.mjs';
|
|
8
8
|
export { UIMessage } from 'ai';
|
|
9
9
|
import '@btst/stack/plugins/api';
|
|
10
10
|
import '@btst/stack/authorization';
|
|
@@ -2,9 +2,9 @@ import * as _btst_stack_plugins_client from '@btst/stack/plugins/client';
|
|
|
2
2
|
import * as _btst_yar from '@btst/yar';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import { ComponentType } from 'react';
|
|
5
|
-
import { S as SerializedConversation, a as SerializedMessage, A as AiChatIdentityPartition } from '../../../shared/stack.
|
|
6
|
-
import { A as AiChatMode, a as AiChatPluginOverrides } from '../../../shared/stack.
|
|
7
|
-
export { l as AiChatAnalyticsEvent, b as AiChatProviderConfig, c as AllowedFileType, j as ChatInput, C as ChatInterface, f as ChatLayout, g as ChatLayoutProps, i as ChatMessage, h as ChatSidebar, D as DEFAULT_ALLOWED_FILE_TYPES, k as ToolCallDisplay, T as ToolCallProps, e as ToolCallRenderer, d as ToolCallState } from '../../../shared/stack.
|
|
5
|
+
import { S as SerializedConversation, a as SerializedMessage, A as AiChatIdentityPartition } from '../../../shared/stack.DDQTbADz.js';
|
|
6
|
+
import { A as AiChatMode, a as AiChatPluginOverrides } from '../../../shared/stack.byjorQi5.js';
|
|
7
|
+
export { l as AiChatAnalyticsEvent, b as AiChatProviderConfig, c as AllowedFileType, j as ChatInput, C as ChatInterface, f as ChatLayout, g as ChatLayoutProps, i as ChatMessage, h as ChatSidebar, D as DEFAULT_ALLOWED_FILE_TYPES, k as ToolCallDisplay, T as ToolCallProps, e as ToolCallRenderer, d as ToolCallState } from '../../../shared/stack.byjorQi5.js';
|
|
8
8
|
export { UIMessage } from 'ai';
|
|
9
9
|
import '@btst/stack/plugins/api';
|
|
10
10
|
import '@btst/stack/authorization';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '@btst/stack/plugins/client';
|
|
2
|
-
export { A as AiChatIdentityPartition, g as AiChatQueryKeys, C as ConversationWithMessages, b as CreateConversationInput, R as RenameConversationInput, d as aiChatIdentityKey, e as aiChatResources, f as createAiChatQueryKeys } from '../../shared/stack.
|
|
2
|
+
export { A as AiChatIdentityPartition, g as AiChatQueryKeys, C as ConversationWithMessages, b as CreateConversationInput, R as RenameConversationInput, d as aiChatIdentityKey, e as aiChatResources, f as createAiChatQueryKeys } from '../../shared/stack.IY-ngxuw.cjs';
|
|
3
3
|
import '@btst/stack/context';
|
|
4
4
|
import '@btst/stack/plugins/api';
|
|
5
5
|
import '@btst/stack/authorization';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '@btst/stack/plugins/client';
|
|
2
|
-
export { A as AiChatIdentityPartition, g as AiChatQueryKeys, C as ConversationWithMessages, b as CreateConversationInput, R as RenameConversationInput, d as aiChatIdentityKey, e as aiChatResources, f as createAiChatQueryKeys } from '../../shared/stack.
|
|
2
|
+
export { A as AiChatIdentityPartition, g as AiChatQueryKeys, C as ConversationWithMessages, b as CreateConversationInput, R as RenameConversationInput, d as aiChatIdentityKey, e as aiChatResources, f as createAiChatQueryKeys } from '../../shared/stack.mU9iMF2j.mjs';
|
|
3
3
|
import '@btst/stack/context';
|
|
4
4
|
import '@btst/stack/plugins/api';
|
|
5
5
|
import '@btst/stack/authorization';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '@btst/stack/plugins/client';
|
|
2
|
-
export { A as AiChatIdentityPartition, g as AiChatQueryKeys, C as ConversationWithMessages, b as CreateConversationInput, R as RenameConversationInput, d as aiChatIdentityKey, e as aiChatResources, f as createAiChatQueryKeys } from '../../shared/stack.
|
|
2
|
+
export { A as AiChatIdentityPartition, g as AiChatQueryKeys, C as ConversationWithMessages, b as CreateConversationInput, R as RenameConversationInput, d as aiChatIdentityKey, e as aiChatResources, f as createAiChatQueryKeys } from '../../shared/stack.DDQTbADz.js';
|
|
3
3
|
import '@btst/stack/context';
|
|
4
4
|
import '@btst/stack/plugins/api';
|
|
5
5
|
import '@btst/stack/authorization';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { B as BLOG_QUERY_KEYS, i as BlogApiRouter, k as BlogBackendHooks, f as BlogBackendOptions, l as BlogCreateErrorContext, m as BlogCreateOperationContext, n as BlogCreateResultContext, o as BlogDeleteErrorContext, p as BlogDeleteOperationContext, q as BlogDeleteResultContext, r as BlogListErrorContext, s as BlogListOperationContext, t as BlogListResultContext, u as BlogNextPreviousErrorContext, v as BlogNextPreviousOperationContext, w as BlogNextPreviousResultContext, e as BlogRouteKey, x as BlogUpdateErrorContext, y as BlogUpdateOperationContext, z as BlogUpdateResultContext, C as CreatePostOperationInputSchema, N as NextPreviousPostsQuerySchema, P as PostListParams, j as PostListQuerySchema, c as PostListResult, S as SerializedNextPreviousPostsResult, A as SerializedPostListResult, U as UpdatePostOperationInputSchema, h as blogBackendPlugin, d as createBlogQueryKeys, g as getAllPosts, b as getAllTags, a as getPostBySlug } from '../../../shared/stack.
|
|
1
|
+
export { B as BLOG_QUERY_KEYS, i as BlogApiRouter, k as BlogBackendHooks, f as BlogBackendOptions, l as BlogCreateErrorContext, m as BlogCreateOperationContext, n as BlogCreateResultContext, o as BlogDeleteErrorContext, p as BlogDeleteOperationContext, q as BlogDeleteResultContext, r as BlogListErrorContext, s as BlogListOperationContext, t as BlogListResultContext, u as BlogNextPreviousErrorContext, v as BlogNextPreviousOperationContext, w as BlogNextPreviousResultContext, e as BlogRouteKey, x as BlogUpdateErrorContext, y as BlogUpdateOperationContext, z as BlogUpdateResultContext, C as CreatePostOperationInputSchema, N as NextPreviousPostsQuerySchema, P as PostListParams, j as PostListQuerySchema, c as PostListResult, S as SerializedNextPreviousPostsResult, A as SerializedPostListResult, U as UpdatePostOperationInputSchema, h as blogBackendPlugin, d as createBlogQueryKeys, g as getAllPosts, b as getAllTags, a as getPostBySlug } from '../../../shared/stack.BOZRaVpu.cjs';
|
|
2
2
|
import { DBAdapter } from '@btst/db';
|
|
3
3
|
import { P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../../shared/stack.Dsatjh0B.cjs';
|
|
4
4
|
export { blogPermissions } from '../permissions.cjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { B as BLOG_QUERY_KEYS, i as BlogApiRouter, k as BlogBackendHooks, f as BlogBackendOptions, l as BlogCreateErrorContext, m as BlogCreateOperationContext, n as BlogCreateResultContext, o as BlogDeleteErrorContext, p as BlogDeleteOperationContext, q as BlogDeleteResultContext, r as BlogListErrorContext, s as BlogListOperationContext, t as BlogListResultContext, u as BlogNextPreviousErrorContext, v as BlogNextPreviousOperationContext, w as BlogNextPreviousResultContext, e as BlogRouteKey, x as BlogUpdateErrorContext, y as BlogUpdateOperationContext, z as BlogUpdateResultContext, C as CreatePostOperationInputSchema, N as NextPreviousPostsQuerySchema, P as PostListParams, j as PostListQuerySchema, c as PostListResult, S as SerializedNextPreviousPostsResult, A as SerializedPostListResult, U as UpdatePostOperationInputSchema, h as blogBackendPlugin, d as createBlogQueryKeys, g as getAllPosts, b as getAllTags, a as getPostBySlug } from '../../../shared/stack.
|
|
1
|
+
export { B as BLOG_QUERY_KEYS, i as BlogApiRouter, k as BlogBackendHooks, f as BlogBackendOptions, l as BlogCreateErrorContext, m as BlogCreateOperationContext, n as BlogCreateResultContext, o as BlogDeleteErrorContext, p as BlogDeleteOperationContext, q as BlogDeleteResultContext, r as BlogListErrorContext, s as BlogListOperationContext, t as BlogListResultContext, u as BlogNextPreviousErrorContext, v as BlogNextPreviousOperationContext, w as BlogNextPreviousResultContext, e as BlogRouteKey, x as BlogUpdateErrorContext, y as BlogUpdateOperationContext, z as BlogUpdateResultContext, C as CreatePostOperationInputSchema, N as NextPreviousPostsQuerySchema, P as PostListParams, j as PostListQuerySchema, c as PostListResult, S as SerializedNextPreviousPostsResult, A as SerializedPostListResult, U as UpdatePostOperationInputSchema, h as blogBackendPlugin, d as createBlogQueryKeys, g as getAllPosts, b as getAllTags, a as getPostBySlug } from '../../../shared/stack.Dvy7FmaA.mjs';
|
|
2
2
|
import { DBAdapter } from '@btst/db';
|
|
3
3
|
import { P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../../shared/stack.Dsatjh0B.mjs';
|
|
4
4
|
export { blogPermissions } from '../permissions.mjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { B as BLOG_QUERY_KEYS, i as BlogApiRouter, k as BlogBackendHooks, f as BlogBackendOptions, l as BlogCreateErrorContext, m as BlogCreateOperationContext, n as BlogCreateResultContext, o as BlogDeleteErrorContext, p as BlogDeleteOperationContext, q as BlogDeleteResultContext, r as BlogListErrorContext, s as BlogListOperationContext, t as BlogListResultContext, u as BlogNextPreviousErrorContext, v as BlogNextPreviousOperationContext, w as BlogNextPreviousResultContext, e as BlogRouteKey, x as BlogUpdateErrorContext, y as BlogUpdateOperationContext, z as BlogUpdateResultContext, C as CreatePostOperationInputSchema, N as NextPreviousPostsQuerySchema, P as PostListParams, j as PostListQuerySchema, c as PostListResult, S as SerializedNextPreviousPostsResult, A as SerializedPostListResult, U as UpdatePostOperationInputSchema, h as blogBackendPlugin, d as createBlogQueryKeys, g as getAllPosts, b as getAllTags, a as getPostBySlug } from '../../../shared/stack.
|
|
1
|
+
export { B as BLOG_QUERY_KEYS, i as BlogApiRouter, k as BlogBackendHooks, f as BlogBackendOptions, l as BlogCreateErrorContext, m as BlogCreateOperationContext, n as BlogCreateResultContext, o as BlogDeleteErrorContext, p as BlogDeleteOperationContext, q as BlogDeleteResultContext, r as BlogListErrorContext, s as BlogListOperationContext, t as BlogListResultContext, u as BlogNextPreviousErrorContext, v as BlogNextPreviousOperationContext, w as BlogNextPreviousResultContext, e as BlogRouteKey, x as BlogUpdateErrorContext, y as BlogUpdateOperationContext, z as BlogUpdateResultContext, C as CreatePostOperationInputSchema, N as NextPreviousPostsQuerySchema, P as PostListParams, j as PostListQuerySchema, c as PostListResult, S as SerializedNextPreviousPostsResult, A as SerializedPostListResult, U as UpdatePostOperationInputSchema, h as blogBackendPlugin, d as createBlogQueryKeys, g as getAllPosts, b as getAllTags, a as getPostBySlug } from '../../../shared/stack.DlBoNqYu.js';
|
|
2
2
|
import { DBAdapter } from '@btst/db';
|
|
3
3
|
import { P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../../shared/stack.Dsatjh0B.js';
|
|
4
4
|
export { blogPermissions } from '../permissions.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '@btst/stack/plugins/client';
|
|
2
|
-
export { D as blogResources, d as createBlogQueryKeys } from '../../shared/stack.
|
|
2
|
+
export { D as blogResources, d as createBlogQueryKeys } from '../../shared/stack.BOZRaVpu.cjs';
|
|
3
3
|
import 'zod';
|
|
4
4
|
import '../../shared/stack.Csi-4Mgz.cjs';
|
|
5
5
|
import '../../shared/stack.Dsatjh0B.cjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '@btst/stack/plugins/client';
|
|
2
|
-
export { D as blogResources, d as createBlogQueryKeys } from '../../shared/stack.
|
|
2
|
+
export { D as blogResources, d as createBlogQueryKeys } from '../../shared/stack.Dvy7FmaA.mjs';
|
|
3
3
|
import 'zod';
|
|
4
4
|
import '../../shared/stack.Csi-4Mgz.mjs';
|
|
5
5
|
import '../../shared/stack.Dsatjh0B.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '@btst/stack/plugins/client';
|
|
2
|
-
export { D as blogResources, d as createBlogQueryKeys } from '../../shared/stack.
|
|
2
|
+
export { D as blogResources, d as createBlogQueryKeys } from '../../shared/stack.DlBoNqYu.js';
|
|
3
3
|
import 'zod';
|
|
4
4
|
import '../../shared/stack.Csi-4Mgz.js';
|
|
5
5
|
import '../../shared/stack.Dsatjh0B.js';
|