@btst/stack 4.3.0 → 4.4.0

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.
Files changed (85) hide show
  1. package/README.md +2 -2
  2. package/dist/packages/stack/src/plugins/ai-chat/api/compaction.cjs +249 -0
  3. package/dist/packages/stack/src/plugins/ai-chat/api/compaction.mjs +241 -0
  4. package/dist/packages/stack/src/plugins/ai-chat/api/operations.cjs +20 -0
  5. package/dist/packages/stack/src/plugins/ai-chat/api/operations.mjs +20 -0
  6. package/dist/packages/stack/src/plugins/ai-chat/api/plugin.cjs +5 -0
  7. package/dist/packages/stack/src/plugins/ai-chat/api/plugin.mjs +5 -0
  8. package/dist/packages/stack/src/plugins/ai-chat/client/components/chat-interface.cjs +38 -3
  9. package/dist/packages/stack/src/plugins/ai-chat/client/components/chat-interface.mjs +38 -3
  10. package/dist/packages/stack/src/plugins/ai-chat/client/context-checkpoint.cjs +30 -0
  11. package/dist/packages/stack/src/plugins/ai-chat/client/context-checkpoint.mjs +27 -0
  12. package/dist/packages/stack/src/plugins/ai-chat/schemas.cjs +2 -0
  13. package/dist/packages/stack/src/plugins/ai-chat/schemas.mjs +2 -0
  14. package/dist/packages/ui/src/components/markdown-content.cjs +9 -9
  15. package/dist/packages/ui/src/components/markdown-content.mjs +9 -9
  16. package/dist/plugins/ai-chat/api/index.d.cts +2 -2
  17. package/dist/plugins/ai-chat/api/index.d.mts +2 -2
  18. package/dist/plugins/ai-chat/api/index.d.ts +2 -2
  19. package/dist/plugins/ai-chat/client/components/index.d.cts +1 -1
  20. package/dist/plugins/ai-chat/client/components/index.d.mts +1 -1
  21. package/dist/plugins/ai-chat/client/components/index.d.ts +1 -1
  22. package/dist/plugins/ai-chat/client/hooks/index.d.cts +2 -2
  23. package/dist/plugins/ai-chat/client/hooks/index.d.mts +2 -2
  24. package/dist/plugins/ai-chat/client/hooks/index.d.ts +2 -2
  25. package/dist/plugins/ai-chat/client/index.d.cts +3 -3
  26. package/dist/plugins/ai-chat/client/index.d.mts +3 -3
  27. package/dist/plugins/ai-chat/client/index.d.ts +3 -3
  28. package/dist/plugins/ai-chat/query-keys.d.cts +1 -1
  29. package/dist/plugins/ai-chat/query-keys.d.mts +1 -1
  30. package/dist/plugins/ai-chat/query-keys.d.ts +1 -1
  31. package/dist/plugins/blog/api/index.d.cts +2 -2
  32. package/dist/plugins/blog/api/index.d.mts +2 -2
  33. package/dist/plugins/blog/api/index.d.ts +2 -2
  34. package/dist/plugins/blog/client/hooks/index.d.cts +2 -2
  35. package/dist/plugins/blog/client/hooks/index.d.mts +2 -2
  36. package/dist/plugins/blog/client/hooks/index.d.ts +2 -2
  37. package/dist/plugins/blog/client/index.d.cts +2 -2
  38. package/dist/plugins/blog/client/index.d.mts +2 -2
  39. package/dist/plugins/blog/client/index.d.ts +2 -2
  40. package/dist/plugins/blog/query-keys.d.cts +2 -2
  41. package/dist/plugins/blog/query-keys.d.mts +2 -2
  42. package/dist/plugins/blog/query-keys.d.ts +2 -2
  43. package/dist/plugins/cms/api/index.d.cts +1 -1
  44. package/dist/plugins/cms/api/index.d.mts +1 -1
  45. package/dist/plugins/cms/api/index.d.ts +1 -1
  46. package/dist/plugins/cms/query-keys.d.cts +1 -1
  47. package/dist/plugins/cms/query-keys.d.mts +1 -1
  48. package/dist/plugins/cms/query-keys.d.ts +1 -1
  49. package/dist/plugins/ui-builder/client/hooks/index.d.cts +1 -1
  50. package/dist/plugins/ui-builder/client/hooks/index.d.mts +1 -1
  51. package/dist/plugins/ui-builder/client/hooks/index.d.ts +1 -1
  52. package/dist/plugins/ui-builder/client/index.d.cts +1 -1
  53. package/dist/plugins/ui-builder/client/index.d.mts +1 -1
  54. package/dist/plugins/ui-builder/client/index.d.ts +1 -1
  55. package/dist/plugins/ui-builder/query-keys.d.cts +1 -1
  56. package/dist/plugins/ui-builder/query-keys.d.mts +1 -1
  57. package/dist/plugins/ui-builder/query-keys.d.ts +1 -1
  58. package/dist/shared/{stack.rmWRtSjs.d.cts → stack.BGzgFx3R.d.cts} +4 -4
  59. package/dist/shared/{stack.DBH1Bjko.d.ts → stack.C4zspX0T.d.ts} +13 -2
  60. package/dist/shared/{stack.D2y4gl03.d.mts → stack.CjCSDfWy.d.mts} +4 -4
  61. package/dist/shared/{stack.DQpyA3Cq.d.ts → stack.Clil75lW.d.ts} +86 -86
  62. package/dist/shared/{stack.DzJgoNqJ.d.cts → stack.DDQlE2Pm.d.cts} +1 -0
  63. package/dist/shared/{stack.DiYg7Jw1.d.cts → stack.DNw6Hv5o.d.cts} +86 -86
  64. package/dist/shared/{stack.CZ1h_T4k.d.mts → stack.DhZtP2JZ.d.mts} +86 -86
  65. package/dist/shared/{stack.qMp2VzNw.d.ts → stack.DlehgNZZ.d.ts} +1 -0
  66. package/dist/shared/{stack.CnDMBj4z.d.ts → stack.Dpg_JjIo.d.ts} +4 -4
  67. package/dist/shared/{stack.B7Mj74BQ.d.mts → stack.Ps3MDhTC.d.mts} +13 -2
  68. package/dist/shared/{stack.CHrtGKLz.d.mts → stack.tAUeRAtd.d.mts} +1 -0
  69. package/dist/shared/{stack.Dgt3MCtW.d.cts → stack.ymWsP4HZ.d.cts} +13 -2
  70. package/package.json +1 -1
  71. package/src/__tests__/markdown-link-navigation.test.tsx +29 -0
  72. package/src/plugins/ai-chat/__tests__/compaction.test.ts +272 -0
  73. package/src/plugins/ai-chat/api/compaction.ts +310 -0
  74. package/src/plugins/ai-chat/api/operations.ts +25 -0
  75. package/src/plugins/ai-chat/api/plugin.ts +14 -0
  76. package/src/plugins/ai-chat/client/components/chat-interface.tsx +58 -3
  77. package/src/plugins/ai-chat/client/context-checkpoint.ts +47 -0
  78. package/src/plugins/ai-chat/client/localization/index.ts +1 -0
  79. package/src/plugins/ai-chat/schemas.ts +2 -0
  80. package/dist/shared/{stack.lsbdKRj7.d.mts → stack.B8PG21zX.d.mts} +16 -16
  81. package/dist/shared/{stack.DtZgEX84.d.cts → stack.Csi-4Mgz.d.cts} +6 -6
  82. package/dist/shared/{stack.DtZgEX84.d.mts → stack.Csi-4Mgz.d.mts} +6 -6
  83. package/dist/shared/{stack.DtZgEX84.d.ts → stack.Csi-4Mgz.d.ts} +6 -6
  84. package/dist/shared/{stack.BMlTZnZp.d.ts → stack.CyalJ0j6.d.ts} +16 -16
  85. package/dist/shared/{stack.BV0uNV4f.d.cts → stack.D6Pg-ufX.d.cts} +16 -16
@@ -38,6 +38,10 @@ import {
38
38
  type AiChatPageContentConfig,
39
39
  } from "./page-tools";
40
40
  import { serializeConversation, serializeMessage } from "./serializers";
41
+ import {
42
+ compactingChatResponse,
43
+ type AiChatCompactionConfig,
44
+ } from "./compaction";
41
45
 
42
46
  type TransactionAdapter = Parameters<Parameters<Adapter["transaction"]>[0]>[0];
43
47
  type ActiveAdapter = Omit<Adapter, "transaction"> &
@@ -82,6 +86,7 @@ export type ChatOperationInput = {
82
86
  }
83
87
  )[];
84
88
  readonly conversationId?: string;
89
+ readonly contextSummary?: string;
85
90
  readonly model?: string;
86
91
  readonly pageContext?: string;
87
92
  readonly availableTools?: readonly string[];
@@ -400,6 +405,7 @@ export interface AiChatOperationsConfig {
400
405
  access: AiChatAccess;
401
406
  model: LanguageModel;
402
407
  systemPrompt?: string;
408
+ compaction?: AiChatCompactionConfig;
403
409
  tools?: Record<string, Tool>;
404
410
  pageContent?: AiChatPageContentConfig;
405
411
  enablePageTools?: boolean;
@@ -1342,6 +1348,13 @@ export function createAiChatOperations(
1342
1348
  );
1343
1349
  }
1344
1350
  validateAttachments(uiMessages);
1351
+ if (config.compaction && fileParts(uiMessages).length) {
1352
+ throw new AiChatOperationError(
1353
+ 400,
1354
+ "Context compaction supports text-only conversations.",
1355
+ "INVALID_ATTACHMENT",
1356
+ );
1357
+ }
1345
1358
  const conversation =
1346
1359
  config.access === "authorized" && input.conversationId
1347
1360
  ? await getConversationById(adapter, input.conversationId)
@@ -1582,6 +1595,18 @@ export function createAiChatOperations(
1582
1595
  const systemContent =
1583
1596
  `${config.systemPrompt ?? ""}${readPageInstructions}${pageSuffix}` ||
1584
1597
  undefined;
1598
+ if (config.compaction && config.access === "public") {
1599
+ return compactingChatResponse({
1600
+ model: config.model,
1601
+ messages: uiMessages,
1602
+ summary: context.input.contextSummary,
1603
+ system: systemContent,
1604
+ tools: mergedTools,
1605
+ config: config.compaction,
1606
+ abortSignal: context.request?.signal,
1607
+ onError: reportStreamError,
1608
+ });
1609
+ }
1585
1610
  const messages = systemContent
1586
1611
  ? [
1587
1612
  { role: "system" as const, content: systemContent },
@@ -15,6 +15,8 @@ import {
15
15
  UpdateConversationOperationInputSchema,
16
16
  } from "./operations";
17
17
  import type { AiChatPageContentConfig } from "./page-tools";
18
+ import type { AiChatCompactionConfig } from "./compaction";
19
+ export type { AiChatCompactionConfig } from "./compaction";
18
20
  export type { AiChatPageContentConfig } from "./page-tools";
19
21
 
20
22
  export type {
@@ -57,6 +59,8 @@ export interface AiChatBackendConfig {
57
59
  */
58
60
  access?: AiChatAccess;
59
61
  systemPrompt?: string;
62
+ /** Automatically summarize older context in public text chats; off by default. */
63
+ compaction?: AiChatCompactionConfig;
60
64
  tools?: Record<string, Tool>;
61
65
  /** Enable the standard readPage server tool for full page content. Reserves the readPage tool name. */
62
66
  pageContent?: AiChatPageContentConfig;
@@ -85,6 +89,16 @@ export const aiChatBackendPlugin = <
85
89
  );
86
90
  }
87
91
  const access = config.access ?? "authorized";
92
+ if (
93
+ config.compaction &&
94
+ (access !== "public" ||
95
+ !Number.isSafeInteger(config.compaction.contextWindowTokens) ||
96
+ config.compaction.contextWindowTokens < 4096)
97
+ ) {
98
+ throw new TypeError(
99
+ "Compaction requires public access and a contextWindowTokens integer of at least 4096.",
100
+ );
101
+ }
88
102
  const operationsConfig = {
89
103
  ...config,
90
104
  access,
@@ -46,6 +46,11 @@ import {
46
46
  import { usePageAIContext } from "../context/page-ai-context";
47
47
  import { useChatAnalytics } from "../context/chat-analytics";
48
48
  import { navigateAiChatCrossOrigin } from "../navigation";
49
+ import {
50
+ captureContextCheckpoint,
51
+ contextRequest,
52
+ type ContextCheckpoint,
53
+ } from "../context-checkpoint";
49
54
 
50
55
  interface ChatInterfaceProps {
51
56
  initialMessages?: UIMessage[];
@@ -314,6 +319,9 @@ export function ChatInterface({
314
319
  Array<{ generation: number; identityPartitionKey: string }>
315
320
  >([]);
316
321
  const latestMessages = useRef<UIMessage[]>([]);
322
+ const contextCheckpoint = useRef<ContextCheckpoint | undefined>(undefined);
323
+ const submittedMessages = useRef<UIMessage[]>([]);
324
+ const [isCompacting, setIsCompacting] = useState(false);
317
325
 
318
326
  const conversationsListQueryKey = useMemo(() => {
319
327
  // In public mode, we don't need conversation queries
@@ -465,6 +473,7 @@ export function ChatInterface({
465
473
  pendingStreamRequests.current.push(request);
466
474
  activeStreamPartitionKey.current = request.identityPartitionKey;
467
475
  }
476
+ setIsCompacting(false);
468
477
  const currentPageContext = pageAIContextRef.current;
469
478
 
470
479
  // Build page context fields to include in every request
@@ -483,20 +492,26 @@ export function ChatInterface({
483
492
  if (newUserMessage) {
484
493
  messagesToSend.push(newUserMessage);
485
494
  }
495
+ submittedMessages.current = messagesToSend;
486
496
  // Clear the ref after use
487
497
  editMessagesRef.current = null;
488
498
  return {
489
499
  body: {
490
- messages: messagesToSend,
500
+ ...(isPublicMode
501
+ ? contextRequest(messagesToSend, contextCheckpoint.current)
502
+ : { messages: messagesToSend }),
491
503
  conversationId: conversationIdRef.current,
492
504
  ...pageContextBody,
493
505
  },
494
506
  };
495
507
  }
496
- // Normal case - use the messages as-is
508
+ submittedMessages.current = hookMessages;
509
+ // Retain the full UI history; compact only the transport payload.
497
510
  return {
498
511
  body: {
499
- messages: hookMessages,
512
+ ...(isPublicMode
513
+ ? contextRequest(hookMessages, contextCheckpoint.current)
514
+ : { messages: hookMessages }),
500
515
  conversationId: conversationIdRef.current,
501
516
  ...pageContextBody,
502
517
  },
@@ -550,6 +565,31 @@ export function ChatInterface({
550
565
  } = useChat({
551
566
  id: `${chatInstanceId}:${isPublicMode ? "public" : identitySessionVersion}`,
552
567
  transport,
568
+ onData: ({ type, data }) => {
569
+ if (
570
+ !isPublicMode ||
571
+ !mounted.current ||
572
+ !data ||
573
+ typeof data !== "object"
574
+ )
575
+ return;
576
+ if (type === "data-context-status" && "compacting" in data) {
577
+ setIsCompacting(data.compacting === true);
578
+ }
579
+ if (
580
+ type === "data-context-checkpoint" &&
581
+ "summary" in data &&
582
+ "throughMessageId" in data &&
583
+ typeof data.summary === "string" &&
584
+ typeof data.throughMessageId === "string"
585
+ ) {
586
+ contextCheckpoint.current = captureContextCheckpoint(
587
+ submittedMessages.current,
588
+ data.summary,
589
+ data.throughMessageId,
590
+ );
591
+ }
592
+ },
553
593
  // Automatically resubmit after all client-side tool results are provided
554
594
  sendAutomaticallyWhen: (options) =>
555
595
  mounted.current &&
@@ -630,6 +670,7 @@ export function ChatInterface({
630
670
  }
631
671
  },
632
672
  onError: (err) => {
673
+ setIsCompacting(false);
633
674
  if (!mounted.current) return;
634
675
  console.error("useChat onError:", err);
635
676
  if (
@@ -653,6 +694,7 @@ export function ChatInterface({
653
694
  // the provider or response stream failed.
654
695
  },
655
696
  onFinish: async (completion) => {
697
+ setIsCompacting(false);
656
698
  if (
657
699
  !mounted.current ||
658
700
  (!isPublicMode &&
@@ -1328,7 +1370,20 @@ export function ChatInterface({
1328
1370
  />
1329
1371
  ))
1330
1372
  )}
1373
+ {isLoading && isCompacting && (
1374
+ <div
1375
+ role="status"
1376
+ className="text-muted-foreground text-sm py-4"
1377
+ >
1378
+ {tr(
1379
+ "CHAT_COMPACTING",
1380
+ "aiChat.chat.compacting",
1381
+ "Summarizing earlier conversation…",
1382
+ )}
1383
+ </div>
1384
+ )}
1331
1385
  {isLoading &&
1386
+ !isCompacting &&
1332
1387
  messages[messages.length - 1]?.role !== "assistant" && (
1333
1388
  <div className="flex items-center gap-2 text-muted-foreground text-sm py-4">
1334
1389
  <div className="animate-pulse">
@@ -0,0 +1,47 @@
1
+ import type { UIMessage } from "ai";
2
+
3
+ /** Browser-only snapshot; never replaces or mutates the visible transcript. */
4
+ export interface ContextCheckpoint {
5
+ summary: string;
6
+ throughMessageId: string;
7
+ prefix: string;
8
+ }
9
+
10
+ export function captureContextCheckpoint(
11
+ messages: UIMessage[],
12
+ summary: string,
13
+ throughMessageId: string,
14
+ ): ContextCheckpoint | undefined {
15
+ const index = messages.findIndex(
16
+ (message) => message.id === throughMessageId,
17
+ );
18
+ if (index < 0) return undefined;
19
+ return {
20
+ summary,
21
+ throughMessageId,
22
+ prefix: JSON.stringify(messages.slice(0, index + 1)),
23
+ };
24
+ }
25
+
26
+ export function contextRequest(
27
+ messages: UIMessage[],
28
+ checkpoint?: ContextCheckpoint,
29
+ ) {
30
+ if (checkpoint) {
31
+ const index = messages.findIndex(
32
+ (message) => message.id === checkpoint.throughMessageId,
33
+ );
34
+ if (
35
+ index >= 0 &&
36
+ JSON.stringify(messages.slice(0, index + 1)) === checkpoint.prefix
37
+ ) {
38
+ return {
39
+ messages: messages.slice(index + 1),
40
+ contextSummary: checkpoint.summary,
41
+ };
42
+ }
43
+ }
44
+ // Editing or retrying a summarized turn invalidates the snapshot. Resend
45
+ // the original transcript so the server builds a fresh summary if needed.
46
+ return { messages };
47
+ }
@@ -12,6 +12,7 @@ export interface AiChatLocalization {
12
12
  CHAT_SEND_BUTTON: string;
13
13
  CHAT_EMPTY_STATE: string;
14
14
  CHAT_LOADING: string;
15
+ CHAT_COMPACTING?: string;
15
16
  CHAT_ERROR: string;
16
17
  CHAT_RETRY: string;
17
18
 
@@ -36,6 +36,8 @@ export const chatRequestSchema = z.object({
36
36
  ]),
37
37
  ),
38
38
  conversationId: z.string().optional(),
39
+ /** Untrusted continuation summary for opt-in public context compaction. */
40
+ contextSummary: z.string().max(32_000).optional(),
39
41
  model: z.string().optional(),
40
42
  /**
41
43
  * Description of the current page context, injected into the AI system prompt.
@@ -95,8 +95,8 @@ declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugin
95
95
  readonly id: string;
96
96
  readonly slug: string;
97
97
  readonly contentTypeId: string;
98
- readonly data: string;
99
98
  readonly authorId?: string | undefined;
99
+ readonly data: string;
100
100
  }[];
101
101
  readonly total: number;
102
102
  }>;
@@ -128,8 +128,8 @@ declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugin
128
128
  readonly id: string;
129
129
  readonly slug: string;
130
130
  readonly contentTypeId: string;
131
- readonly data: string;
132
131
  readonly authorId?: string | undefined;
132
+ readonly data: string;
133
133
  }>;
134
134
  readonly createContentItem: better_call.StrictEndpoint<"/content/:typeSlug", {
135
135
  params: z.ZodObject<{
@@ -165,8 +165,8 @@ declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugin
165
165
  readonly id: string;
166
166
  readonly slug: string;
167
167
  readonly contentTypeId: string;
168
- readonly data: string;
169
168
  readonly authorId?: string | undefined;
169
+ readonly data: string;
170
170
  }>;
171
171
  readonly updateContentItem: better_call.StrictEndpoint<"/content/:typeSlug/:id", {
172
172
  params: z.ZodObject<{
@@ -203,8 +203,8 @@ declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugin
203
203
  readonly id: string;
204
204
  readonly slug: string;
205
205
  readonly contentTypeId: string;
206
- readonly data: string;
207
206
  readonly authorId?: string | undefined;
207
+ readonly data: string;
208
208
  }>;
209
209
  readonly deleteContentItem: better_call.StrictEndpoint<"/content/:typeSlug/:id", {
210
210
  params: z.ZodObject<{
@@ -248,8 +248,8 @@ declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugin
248
248
  readonly id: string;
249
249
  readonly slug: string;
250
250
  readonly contentTypeId: string;
251
- readonly data: string;
252
251
  readonly authorId?: string | undefined;
252
+ readonly data: string;
253
253
  }[];
254
254
  };
255
255
  readonly contentType?: {
@@ -271,8 +271,8 @@ declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugin
271
271
  readonly id: string;
272
272
  readonly slug: string;
273
273
  readonly contentTypeId: string;
274
- readonly data: string;
275
274
  readonly authorId?: string | undefined;
275
+ readonly data: string;
276
276
  }>;
277
277
  readonly listContentByRelation: better_call.StrictEndpoint<"/content/:typeSlug/by-relation", {
278
278
  params: z.ZodObject<{
@@ -314,8 +314,8 @@ declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugin
314
314
  readonly id: string;
315
315
  readonly slug: string;
316
316
  readonly contentTypeId: string;
317
- readonly data: string;
318
317
  readonly authorId?: string | undefined;
318
+ readonly data: string;
319
319
  }[];
320
320
  readonly total: number;
321
321
  readonly limit: number;
@@ -383,8 +383,8 @@ declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugin
383
383
  readonly id: string;
384
384
  readonly slug: string;
385
385
  readonly contentTypeId: string;
386
- readonly data: string;
387
386
  readonly authorId?: string | undefined;
387
+ readonly data: string;
388
388
  }[];
389
389
  readonly total: number;
390
390
  readonly limit: number;
@@ -459,8 +459,8 @@ declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugin
459
459
  id: string;
460
460
  slug: string;
461
461
  contentTypeId: string;
462
- data: string;
463
462
  authorId?: string | undefined;
463
+ data: string;
464
464
  }[];
465
465
  total: number;
466
466
  }, false>;
@@ -493,8 +493,8 @@ declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugin
493
493
  id: string;
494
494
  slug: string;
495
495
  contentTypeId: string;
496
- data: string;
497
496
  authorId?: string | undefined;
497
+ data: string;
498
498
  }, false>;
499
499
  readonly createContentItem: _btst_stack_plugins_api.Operation<z.ZodObject<{
500
500
  typeSlug: z.ZodString;
@@ -522,8 +522,8 @@ declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugin
522
522
  id: string;
523
523
  slug: string;
524
524
  contentTypeId: string;
525
- data: string;
526
525
  authorId?: string | undefined;
526
+ data: string;
527
527
  }, false>;
528
528
  readonly updateContentItem: _btst_stack_plugins_api.Operation<z.ZodObject<{
529
529
  typeSlug: z.ZodString;
@@ -554,8 +554,8 @@ declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugin
554
554
  id: string;
555
555
  slug: string;
556
556
  contentTypeId: string;
557
- data: string;
558
557
  authorId?: string | undefined;
558
+ data: string;
559
559
  }, false>;
560
560
  readonly deleteContentItem: _btst_stack_plugins_api.Operation<z.ZodObject<{
561
561
  typeSlug: z.ZodString;
@@ -598,8 +598,8 @@ declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugin
598
598
  id: string;
599
599
  slug: string;
600
600
  contentTypeId: string;
601
- data: string;
602
601
  authorId?: string | undefined;
602
+ data: string;
603
603
  }[];
604
604
  };
605
605
  contentType?: {
@@ -619,8 +619,8 @@ declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugin
619
619
  id: string;
620
620
  slug: string;
621
621
  contentTypeId: string;
622
- data: string;
623
622
  authorId?: string | undefined;
623
+ data: string;
624
624
  }, false>;
625
625
  readonly listContentByRelation: _btst_stack_plugins_api.Operation<z.ZodObject<{
626
626
  typeSlug: z.ZodString;
@@ -657,8 +657,8 @@ declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugin
657
657
  id: string;
658
658
  slug: string;
659
659
  contentTypeId: string;
660
- data: string;
661
660
  authorId?: string | undefined;
661
+ data: string;
662
662
  }[];
663
663
  total: number;
664
664
  limit: number;
@@ -715,8 +715,8 @@ declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugin
715
715
  id: string;
716
716
  slug: string;
717
717
  contentTypeId: string;
718
- data: string;
719
718
  authorId?: string | undefined;
719
+ data: string;
720
720
  }[];
721
721
  total: number;
722
722
  limit: number;
@@ -1,12 +1,6 @@
1
1
  import { z } from 'zod';
2
2
 
3
3
  declare const createPostSchema: z.ZodObject<{
4
- slug: z.ZodOptional<z.ZodString>;
5
- published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
6
- title: z.ZodString;
7
- createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
8
- updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
9
- publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
10
4
  tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
11
5
  name: z.ZodString;
12
6
  }, z.core.$strip>, z.ZodObject<{
@@ -14,9 +8,15 @@ declare const createPostSchema: z.ZodObject<{
14
8
  name: z.ZodString;
15
9
  slug: z.ZodString;
16
10
  }, z.core.$strip>]>>>>;
11
+ slug: z.ZodOptional<z.ZodString>;
12
+ publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
13
+ createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
14
+ updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
15
+ title: z.ZodString;
17
16
  content: z.ZodString;
18
17
  excerpt: z.ZodString;
19
18
  image: z.ZodOptional<z.ZodString>;
19
+ published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
20
20
  }, z.core.$strip>;
21
21
  declare const updatePostSchema: z.ZodObject<{
22
22
  publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
@@ -1,12 +1,6 @@
1
1
  import { z } from 'zod';
2
2
 
3
3
  declare const createPostSchema: z.ZodObject<{
4
- slug: z.ZodOptional<z.ZodString>;
5
- published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
6
- title: z.ZodString;
7
- createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
8
- updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
9
- publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
10
4
  tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
11
5
  name: z.ZodString;
12
6
  }, z.core.$strip>, z.ZodObject<{
@@ -14,9 +8,15 @@ declare const createPostSchema: z.ZodObject<{
14
8
  name: z.ZodString;
15
9
  slug: z.ZodString;
16
10
  }, z.core.$strip>]>>>>;
11
+ slug: z.ZodOptional<z.ZodString>;
12
+ publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
13
+ createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
14
+ updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
15
+ title: z.ZodString;
17
16
  content: z.ZodString;
18
17
  excerpt: z.ZodString;
19
18
  image: z.ZodOptional<z.ZodString>;
19
+ published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
20
20
  }, z.core.$strip>;
21
21
  declare const updatePostSchema: z.ZodObject<{
22
22
  publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
@@ -1,12 +1,6 @@
1
1
  import { z } from 'zod';
2
2
 
3
3
  declare const createPostSchema: z.ZodObject<{
4
- slug: z.ZodOptional<z.ZodString>;
5
- published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
6
- title: z.ZodString;
7
- createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
8
- updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
9
- publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
10
4
  tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
11
5
  name: z.ZodString;
12
6
  }, z.core.$strip>, z.ZodObject<{
@@ -14,9 +8,15 @@ declare const createPostSchema: z.ZodObject<{
14
8
  name: z.ZodString;
15
9
  slug: z.ZodString;
16
10
  }, z.core.$strip>]>>>>;
11
+ slug: z.ZodOptional<z.ZodString>;
12
+ publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
13
+ createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
14
+ updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
15
+ title: z.ZodString;
17
16
  content: z.ZodString;
18
17
  excerpt: z.ZodString;
19
18
  image: z.ZodOptional<z.ZodString>;
19
+ published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
20
20
  }, z.core.$strip>;
21
21
  declare const updatePostSchema: z.ZodObject<{
22
22
  publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
@@ -95,8 +95,8 @@ declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugin
95
95
  readonly id: string;
96
96
  readonly slug: string;
97
97
  readonly contentTypeId: string;
98
- readonly data: string;
99
98
  readonly authorId?: string | undefined;
99
+ readonly data: string;
100
100
  }[];
101
101
  readonly total: number;
102
102
  }>;
@@ -128,8 +128,8 @@ declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugin
128
128
  readonly id: string;
129
129
  readonly slug: string;
130
130
  readonly contentTypeId: string;
131
- readonly data: string;
132
131
  readonly authorId?: string | undefined;
132
+ readonly data: string;
133
133
  }>;
134
134
  readonly createContentItem: better_call.StrictEndpoint<"/content/:typeSlug", {
135
135
  params: z.ZodObject<{
@@ -165,8 +165,8 @@ declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugin
165
165
  readonly id: string;
166
166
  readonly slug: string;
167
167
  readonly contentTypeId: string;
168
- readonly data: string;
169
168
  readonly authorId?: string | undefined;
169
+ readonly data: string;
170
170
  }>;
171
171
  readonly updateContentItem: better_call.StrictEndpoint<"/content/:typeSlug/:id", {
172
172
  params: z.ZodObject<{
@@ -203,8 +203,8 @@ declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugin
203
203
  readonly id: string;
204
204
  readonly slug: string;
205
205
  readonly contentTypeId: string;
206
- readonly data: string;
207
206
  readonly authorId?: string | undefined;
207
+ readonly data: string;
208
208
  }>;
209
209
  readonly deleteContentItem: better_call.StrictEndpoint<"/content/:typeSlug/:id", {
210
210
  params: z.ZodObject<{
@@ -248,8 +248,8 @@ declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugin
248
248
  readonly id: string;
249
249
  readonly slug: string;
250
250
  readonly contentTypeId: string;
251
- readonly data: string;
252
251
  readonly authorId?: string | undefined;
252
+ readonly data: string;
253
253
  }[];
254
254
  };
255
255
  readonly contentType?: {
@@ -271,8 +271,8 @@ declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugin
271
271
  readonly id: string;
272
272
  readonly slug: string;
273
273
  readonly contentTypeId: string;
274
- readonly data: string;
275
274
  readonly authorId?: string | undefined;
275
+ readonly data: string;
276
276
  }>;
277
277
  readonly listContentByRelation: better_call.StrictEndpoint<"/content/:typeSlug/by-relation", {
278
278
  params: z.ZodObject<{
@@ -314,8 +314,8 @@ declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugin
314
314
  readonly id: string;
315
315
  readonly slug: string;
316
316
  readonly contentTypeId: string;
317
- readonly data: string;
318
317
  readonly authorId?: string | undefined;
318
+ readonly data: string;
319
319
  }[];
320
320
  readonly total: number;
321
321
  readonly limit: number;
@@ -383,8 +383,8 @@ declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugin
383
383
  readonly id: string;
384
384
  readonly slug: string;
385
385
  readonly contentTypeId: string;
386
- readonly data: string;
387
386
  readonly authorId?: string | undefined;
387
+ readonly data: string;
388
388
  }[];
389
389
  readonly total: number;
390
390
  readonly limit: number;
@@ -459,8 +459,8 @@ declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugin
459
459
  id: string;
460
460
  slug: string;
461
461
  contentTypeId: string;
462
- data: string;
463
462
  authorId?: string | undefined;
463
+ data: string;
464
464
  }[];
465
465
  total: number;
466
466
  }, false>;
@@ -493,8 +493,8 @@ declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugin
493
493
  id: string;
494
494
  slug: string;
495
495
  contentTypeId: string;
496
- data: string;
497
496
  authorId?: string | undefined;
497
+ data: string;
498
498
  }, false>;
499
499
  readonly createContentItem: _btst_stack_plugins_api.Operation<z.ZodObject<{
500
500
  typeSlug: z.ZodString;
@@ -522,8 +522,8 @@ declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugin
522
522
  id: string;
523
523
  slug: string;
524
524
  contentTypeId: string;
525
- data: string;
526
525
  authorId?: string | undefined;
526
+ data: string;
527
527
  }, false>;
528
528
  readonly updateContentItem: _btst_stack_plugins_api.Operation<z.ZodObject<{
529
529
  typeSlug: z.ZodString;
@@ -554,8 +554,8 @@ declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugin
554
554
  id: string;
555
555
  slug: string;
556
556
  contentTypeId: string;
557
- data: string;
558
557
  authorId?: string | undefined;
558
+ data: string;
559
559
  }, false>;
560
560
  readonly deleteContentItem: _btst_stack_plugins_api.Operation<z.ZodObject<{
561
561
  typeSlug: z.ZodString;
@@ -598,8 +598,8 @@ declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugin
598
598
  id: string;
599
599
  slug: string;
600
600
  contentTypeId: string;
601
- data: string;
602
601
  authorId?: string | undefined;
602
+ data: string;
603
603
  }[];
604
604
  };
605
605
  contentType?: {
@@ -619,8 +619,8 @@ declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugin
619
619
  id: string;
620
620
  slug: string;
621
621
  contentTypeId: string;
622
- data: string;
623
622
  authorId?: string | undefined;
623
+ data: string;
624
624
  }, false>;
625
625
  readonly listContentByRelation: _btst_stack_plugins_api.Operation<z.ZodObject<{
626
626
  typeSlug: z.ZodString;
@@ -657,8 +657,8 @@ declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugin
657
657
  id: string;
658
658
  slug: string;
659
659
  contentTypeId: string;
660
- data: string;
661
660
  authorId?: string | undefined;
661
+ data: string;
662
662
  }[];
663
663
  total: number;
664
664
  limit: number;
@@ -715,8 +715,8 @@ declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugin
715
715
  id: string;
716
716
  slug: string;
717
717
  contentTypeId: string;
718
- data: string;
719
718
  authorId?: string | undefined;
719
+ data: string;
720
720
  }[];
721
721
  total: number;
722
722
  limit: number;