@dremio/js-sdk 0.42.0 → 0.43.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.
Files changed (115) hide show
  1. package/README.md +274 -0
  2. package/dist/cloud/ai/AIResource.d.ts +716 -17
  3. package/dist/cloud/ai/AIResource.js +40 -18
  4. package/dist/cloud/ai/AIResource.js.map +1 -1
  5. package/dist/cloud/ai/DremioModelProvider.d.ts +1 -1
  6. package/dist/cloud/ai/DremioModelProvider.js +6 -13
  7. package/dist/cloud/ai/DremioModelProvider.js.map +1 -1
  8. package/dist/cloud/ai/modelProviderCodec.d.ts +12 -0
  9. package/dist/cloud/replaceOriginResource.js +4 -0
  10. package/dist/cloud/replaceOriginResource.js.map +1 -1
  11. package/dist/common/ConflictResolver.d.ts +9 -1
  12. package/dist/common/ConflictResolver.js +10 -1
  13. package/dist/common/ConflictResolver.js.map +1 -1
  14. package/dist/common/refineRfc9557Schema.d.ts +1 -0
  15. package/dist/common/refineRfc9557Schema.js +26 -0
  16. package/dist/common/refineRfc9557Schema.js.map +1 -0
  17. package/dist/common/sharedExports.d.ts +1 -0
  18. package/dist/common/sharedExports.js +1 -0
  19. package/dist/common/sharedExports.js.map +1 -1
  20. package/dist/enterprise/Dremio.d.ts +1 -1
  21. package/dist/enterprise/Dremio.js +3 -2
  22. package/dist/enterprise/Dremio.js.map +1 -1
  23. package/dist/enterprise/ai/AIResource.d.ts +699 -18
  24. package/dist/enterprise/ai/AIResource.js +41 -19
  25. package/dist/enterprise/ai/AIResource.js.map +1 -1
  26. package/dist/enterprise/ai/chat/ChatSession.d.ts +4 -25
  27. package/dist/enterprise/ai/chat/ChatSession.js +6 -55
  28. package/dist/enterprise/ai/chat/ChatSession.js.map +1 -1
  29. package/dist/enterprise/ai/chat/UserChatMessage.d.ts +38 -22
  30. package/dist/enterprise/ai/chat/UserChatMessage.js +33 -41
  31. package/dist/enterprise/ai/chat/UserChatMessage.js.map +1 -1
  32. package/dist/enterprise/ai/chat/chatEventSchema.d.ts +169 -11
  33. package/dist/enterprise/ai/chat/chatEventSchema.js +183 -35
  34. package/dist/enterprise/ai/chat/chatEventSchema.js.map +1 -1
  35. package/dist/enterprise/ai/chat/eventWrappers/AgentChatPartialResponse.d.ts +0 -6
  36. package/dist/enterprise/ai/chat/eventWrappers/AgentChatResponse.d.ts +6 -6
  37. package/dist/enterprise/ai/chat/eventWrappers/AgentChatResponse.js +2 -2
  38. package/dist/enterprise/ai/chat/eventWrappers/AgentChatResponse.js.map +1 -1
  39. package/dist/enterprise/ai/chat/index.d.ts +0 -3
  40. package/dist/enterprise/ai/chat/index.js +0 -1
  41. package/dist/enterprise/ai/chat/index.js.map +1 -1
  42. package/dist/enterprise/ai/chat/methods/sendChatMessage.js +4 -1
  43. package/dist/enterprise/ai/chat/methods/sendChatMessage.js.map +1 -1
  44. package/dist/enterprise/ai/chat/responseContent/AgentModelResponseContent.d.ts +1 -2
  45. package/dist/enterprise/ai/chat/responseContent/AgentModelResponseContent.js.map +1 -1
  46. package/dist/enterprise/ai/chat/responseContent/AgentToolRequestResponseContent.d.ts +1 -2
  47. package/dist/enterprise/ai/chat/responseContent/AgentToolRequestResponseContent.js +0 -1
  48. package/dist/enterprise/ai/chat/responseContent/AgentToolRequestResponseContent.js.map +1 -1
  49. package/dist/enterprise/ai/chat/responseContent/AgentToolResultResponseContent.d.ts +1 -2
  50. package/dist/enterprise/ai/chat/responseContent/AgentToolResultResponseContent.js +0 -1
  51. package/dist/enterprise/ai/chat/responseContent/AgentToolResultResponseContent.js.map +1 -1
  52. package/dist/enterprise/ai/conversations/AgentConversation.d.ts +215 -0
  53. package/dist/enterprise/ai/conversations/AgentConversation.js +180 -0
  54. package/dist/enterprise/ai/conversations/AgentConversation.js.map +1 -0
  55. package/dist/enterprise/ai/conversations/conversationPropertiesCodec.d.ts +22 -0
  56. package/dist/enterprise/ai/conversations/conversationPropertiesCodec.js +62 -0
  57. package/dist/enterprise/ai/conversations/conversationPropertiesCodec.js.map +1 -0
  58. package/dist/enterprise/ai/conversations/createConversationMachine.d.ts +682 -0
  59. package/dist/enterprise/ai/conversations/createConversationMachine.js +354 -0
  60. package/dist/enterprise/ai/conversations/createConversationMachine.js.map +1 -0
  61. package/dist/enterprise/ai/conversations/methods/createConversation.d.ts +28 -0
  62. package/dist/enterprise/ai/conversations/methods/createConversation.js +68 -0
  63. package/dist/enterprise/ai/conversations/methods/createConversation.js.map +1 -0
  64. package/dist/enterprise/ai/conversations/methods/createExchangeRun.d.ts +16 -0
  65. package/dist/enterprise/ai/conversations/methods/createExchangeRun.js +36 -0
  66. package/dist/enterprise/ai/conversations/methods/createExchangeRun.js.map +1 -0
  67. package/dist/enterprise/ai/conversations/methods/deleteConversation.d.ts +2 -0
  68. package/dist/enterprise/ai/conversations/methods/deleteConversation.js +24 -0
  69. package/dist/enterprise/ai/conversations/methods/deleteConversation.js.map +1 -0
  70. package/dist/enterprise/ai/conversations/methods/listConversations.d.ts +8 -0
  71. package/dist/enterprise/ai/conversations/methods/listConversations.js +30 -0
  72. package/dist/enterprise/ai/conversations/methods/listConversations.js.map +1 -0
  73. package/dist/enterprise/ai/conversations/methods/retrieveConversation.d.ts +12 -0
  74. package/dist/enterprise/ai/conversations/methods/retrieveConversation.js +29 -0
  75. package/dist/enterprise/ai/conversations/methods/retrieveConversation.js.map +1 -0
  76. package/dist/enterprise/ai/conversations/methods/retrieveConversationHistory.d.ts +86 -0
  77. package/dist/enterprise/ai/conversations/methods/retrieveConversationHistory.js +32 -0
  78. package/dist/enterprise/ai/conversations/methods/retrieveConversationHistory.js.map +1 -0
  79. package/dist/enterprise/ai/conversations/methods/stopExchangeRun.d.ts +2 -0
  80. package/dist/enterprise/ai/conversations/methods/stopExchangeRun.js +24 -0
  81. package/dist/enterprise/ai/conversations/methods/stopExchangeRun.js.map +1 -0
  82. package/dist/enterprise/ai/conversations/methods/streamRunEvents.d.ts +6 -0
  83. package/dist/enterprise/ai/conversations/methods/streamRunEvents.js +33 -0
  84. package/dist/enterprise/ai/conversations/methods/streamRunEvents.js.map +1 -0
  85. package/dist/enterprise/ai/conversations/methods/updateConversation.d.ts +15 -0
  86. package/dist/enterprise/ai/conversations/methods/updateConversation.js +35 -0
  87. package/dist/enterprise/ai/conversations/methods/updateConversation.js.map +1 -0
  88. package/dist/enterprise/ai/conversations/reduceChatEvents.d.ts +17 -0
  89. package/dist/enterprise/ai/conversations/reduceChatEvents.js +74 -0
  90. package/dist/enterprise/ai/conversations/reduceChatEvents.js.map +1 -0
  91. package/dist/enterprise/ai/index.d.ts +5 -1
  92. package/dist/enterprise/ai/index.js +4 -1
  93. package/dist/enterprise/ai/index.js.map +1 -1
  94. package/dist/enterprise/ai/modelProvider/ModelProvider.d.ts +15 -1
  95. package/dist/enterprise/ai/modelProvider/ModelProvider.js +12 -1
  96. package/dist/enterprise/ai/modelProvider/ModelProvider.js.map +1 -1
  97. package/dist/enterprise/ai/modelProvider/modelProviderCodec.d.ts +40 -0
  98. package/dist/enterprise/ai/modelProvider/modelProviderCodec.js +10 -1
  99. package/dist/enterprise/ai/modelProvider/modelProviderCodec.js.map +1 -1
  100. package/dist/enterprise/ai/modelProvider/modelProviderConfigSchemas.d.ts +21 -0
  101. package/dist/enterprise/ai/modelProvider/modelProviderConfigSchemas.js +17 -0
  102. package/dist/enterprise/ai/modelProvider/modelProviderConfigSchemas.js.map +1 -1
  103. package/dist/oss/catalog/CatalogReferences/DatasetCatalogReference.d.ts +1 -0
  104. package/dist/oss/catalog/CatalogReferences/DatasetCatalogReference.js +1 -0
  105. package/dist/oss/catalog/CatalogReferences/DatasetCatalogReference.js.map +1 -1
  106. package/dist-iife/cloud.js +21620 -6202
  107. package/dist-iife/community.js +14 -0
  108. package/dist-iife/enterprise.js +19404 -4038
  109. package/package.json +5 -2
  110. package/dist/enterprise/ai/chat/ChatSessionClient.d.ts +0 -18
  111. package/dist/enterprise/ai/chat/ChatSessionClient.js +0 -55
  112. package/dist/enterprise/ai/chat/ChatSessionClient.js.map +0 -1
  113. package/dist/enterprise/ai/chat/UserChatMessageContent.d.ts +0 -19
  114. package/dist/enterprise/ai/chat/UserChatMessageContent.js +0 -44
  115. package/dist/enterprise/ai/chat/UserChatMessageContent.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dremio/js-sdk",
3
- "version": "0.42.0",
3
+ "version": "0.43.1",
4
4
  "description": "JavaScript library for the Dremio API",
5
5
  "keywords": [
6
6
  "dremio",
@@ -47,14 +47,17 @@
47
47
  "prepare": "node --run dist"
48
48
  },
49
49
  "dependencies": {
50
+ "dequal": "^2",
50
51
  "eventsource-parser": "^3.0.1",
51
52
  "moize": "^6",
53
+ "mutative": "^1.3.0",
52
54
  "nanoid": "^5",
53
55
  "parse-ms": "^4",
54
56
  "rxjs": "^7",
55
57
  "semver": "^7",
56
58
  "temporal-polyfill": "^0.3.0",
57
- "ts-results-es": "^6.0.0",
59
+ "ts-results-es": "^6",
60
+ "xstate": "^5",
58
61
  "zod": "^4.1.0"
59
62
  },
60
63
  "devDependencies": {
@@ -1,18 +0,0 @@
1
- import { Observable } from "rxjs";
2
- import type { ChatSession } from "./ChatSession.ts";
3
- import type { UserChatMessage } from "./UserChatMessage.ts";
4
- import type { AgentChatExchange } from "./eventWrappers/AgentChatExchange.ts";
5
- export declare class ChatSessionClient {
6
- #private;
7
- readonly chatSession: ChatSession;
8
- readonly agentChatExchanges$: Observable<AgentChatExchange[]>;
9
- readonly agentIsReplying$: Observable<boolean>;
10
- constructor({ chatSession, createAgentChatExchange$, }: {
11
- chatSession: ChatSession;
12
- createAgentChatExchange$: (chatSession: ChatSession, userChatMessage: UserChatMessage) => Observable<AgentChatExchange>;
13
- });
14
- startChatExchange(message: UserChatMessage): void;
15
- cancelChatExchange(): void;
16
- agentChatExchanges(): Promise<AgentChatExchange[]>;
17
- agentIsReplying(): Promise<boolean>;
18
- }
@@ -1,55 +0,0 @@
1
- /*
2
- * Copyright (C) 2024-2025 Dremio Corporation
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import { firstValueFrom, map, merge, Observable, scan, shareReplay, Subject, switchMap, takeUntil, takeWhile, withLatestFrom, } from "rxjs";
17
- import { AgentEndTurn } from "./eventWrappers/AgentEndTurn.js";
18
- export class ChatSessionClient {
19
- #createAgentChatExchange$;
20
- #cancelEvents$ = new Subject();
21
- #userChatMessages$ = new Subject();
22
- chatSession;
23
- agentChatExchanges$ = this.#userChatMessages$.pipe(switchMap((userChatMessage) => {
24
- const agentChatExchange$ = this.#createAgentChatExchange$(this.chatSession, userChatMessage).pipe(takeUntil(this.#cancelEvents$), shareReplay({ bufferSize: 1, refCount: true }));
25
- return merge(agentChatExchange$, this.#cancelEvents$.pipe(withLatestFrom(agentChatExchange$), map(([, agentChatExchange]) => {
26
- return agentChatExchange._addChatEvent(new AgentEndTurn({ type: "user_canceled" }));
27
- }))).pipe(takeWhile((chatExchange) => !chatExchange.isComplete, true));
28
- }), scan((acc, curr) => {
29
- if (acc.at(-1)?.id === curr.id) {
30
- return [...acc.slice(0, -1), curr];
31
- }
32
- return [...acc, curr];
33
- }, []), shareReplay({ bufferSize: 1, refCount: true }));
34
- agentIsReplying$ = this.agentChatExchanges$.pipe(map((chatExchanges) => {
35
- const lastChatExchange = chatExchanges.at(-1);
36
- return !!lastChatExchange && !lastChatExchange.isComplete;
37
- }));
38
- constructor({ chatSession, createAgentChatExchange$, }) {
39
- this.chatSession = chatSession;
40
- this.#createAgentChatExchange$ = createAgentChatExchange$;
41
- }
42
- startChatExchange(message) {
43
- this.#userChatMessages$.next(message);
44
- }
45
- cancelChatExchange() {
46
- this.#cancelEvents$.next();
47
- }
48
- agentChatExchanges() {
49
- return firstValueFrom(this.agentChatExchanges$);
50
- }
51
- agentIsReplying() {
52
- return firstValueFrom(this.agentIsReplying$);
53
- }
54
- }
55
- //# sourceMappingURL=ChatSessionClient.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChatSessionClient.js","sourceRoot":"","sources":["../../../../src/enterprise/ai/chat/ChatSessionClient.ts"],"names":[],"mappings":"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","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n firstValueFrom,\n map,\n merge,\n Observable,\n scan,\n shareReplay,\n Subject,\n switchMap,\n takeUntil,\n takeWhile,\n withLatestFrom,\n} from \"rxjs\";\nimport type { ChatSession } from \"./ChatSession.ts\";\nimport type { UserChatMessage } from \"./UserChatMessage.ts\";\nimport { AgentEndTurn } from \"./eventWrappers/AgentEndTurn.ts\";\nimport type { AgentChatExchange } from \"./eventWrappers/AgentChatExchange.ts\";\n\nexport class ChatSessionClient {\n readonly #createAgentChatExchange$: (\n chatSession: ChatSession,\n userChatMessage: UserChatMessage,\n ) => Observable<AgentChatExchange>;\n readonly #cancelEvents$ = new Subject<void>();\n readonly #userChatMessages$ = new Subject<UserChatMessage>();\n\n readonly chatSession: ChatSession;\n\n readonly agentChatExchanges$ = this.#userChatMessages$.pipe(\n switchMap((userChatMessage) => {\n const agentChatExchange$ = this.#createAgentChatExchange$(\n this.chatSession,\n userChatMessage,\n ).pipe(takeUntil(this.#cancelEvents$), shareReplay({ bufferSize: 1, refCount: true }));\n\n return merge(\n agentChatExchange$,\n this.#cancelEvents$.pipe(\n withLatestFrom(agentChatExchange$),\n map(([, agentChatExchange]) => {\n return agentChatExchange._addChatEvent(new AgentEndTurn({ type: \"user_canceled\" }));\n }),\n ),\n ).pipe(takeWhile((chatExchange) => !chatExchange.isComplete, true));\n }),\n scan((acc, curr) => {\n if (acc.at(-1)?.id === curr.id) {\n return [...acc.slice(0, -1), curr];\n }\n return [...acc, curr];\n }, [] as AgentChatExchange[]),\n shareReplay({ bufferSize: 1, refCount: true }),\n );\n\n readonly agentIsReplying$ = this.agentChatExchanges$.pipe(\n map((chatExchanges) => {\n const lastChatExchange = chatExchanges.at(-1);\n return !!lastChatExchange && !lastChatExchange.isComplete;\n }),\n );\n\n constructor({\n chatSession,\n createAgentChatExchange$,\n }: {\n chatSession: ChatSession;\n createAgentChatExchange$: (\n chatSession: ChatSession,\n userChatMessage: UserChatMessage,\n ) => Observable<AgentChatExchange>;\n }) {\n this.chatSession = chatSession;\n this.#createAgentChatExchange$ = createAgentChatExchange$;\n }\n\n startChatExchange(message: UserChatMessage) {\n this.#userChatMessages$.next(message);\n }\n\n cancelChatExchange() {\n this.#cancelEvents$.next();\n }\n\n agentChatExchanges() {\n return firstValueFrom(this.agentChatExchanges$);\n }\n\n agentIsReplying() {\n return firstValueFrom(this.agentIsReplying$);\n }\n}\n"]}
@@ -1,19 +0,0 @@
1
- import * as z from "zod/mini";
2
- export declare class UserChatMessageStringContent implements UserChatMessageContent {
3
- readonly content: string;
4
- constructor(content: string);
5
- toJSON(): {
6
- content: string;
7
- type: "string";
8
- };
9
- static fromJSON(data: z.input<typeof UserChatMessageStringContent.codec>): UserChatMessageStringContent;
10
- static codec: z.ZodMiniCodec<z.ZodMiniObject<{
11
- content: z.ZodMiniString<string>;
12
- type: z.ZodMiniLiteral<"string">;
13
- }, z.core.$strip>, z.ZodMiniCustom<UserChatMessageStringContent, UserChatMessageStringContent>>;
14
- }
15
- export declare const userChatMessageContentCodec: z.ZodMiniCodec<z.ZodMiniObject<{
16
- content: z.ZodMiniString<string>;
17
- type: z.ZodMiniLiteral<"string">;
18
- }, z.core.$strip>, z.ZodMiniCustom<UserChatMessageStringContent, UserChatMessageStringContent>>;
19
- export type UserChatMessageContent = UserChatMessageStringContent;
@@ -1,44 +0,0 @@
1
- /*
2
- * Copyright (C) 2024-2025 Dremio Corporation
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import * as z from "zod/mini";
17
- export class UserChatMessageStringContent {
18
- content;
19
- constructor(content) {
20
- this.content = content;
21
- }
22
- toJSON() {
23
- return z.encode(UserChatMessageStringContent.codec, this);
24
- }
25
- static fromJSON(data) {
26
- return z.decode(UserChatMessageStringContent.codec, data);
27
- }
28
- static codec = z.codec(z.object({
29
- content: z.string(),
30
- type: z.literal("string"),
31
- }), z.instanceof(UserChatMessageStringContent), {
32
- decode(v) {
33
- return new UserChatMessageStringContent(v.content);
34
- },
35
- encode(v) {
36
- return {
37
- content: v.content,
38
- type: "string",
39
- };
40
- },
41
- });
42
- }
43
- export const userChatMessageContentCodec = UserChatMessageStringContent.codec;
44
- //# sourceMappingURL=UserChatMessageContent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"UserChatMessageContent.js","sourceRoot":"","sources":["../../../../src/enterprise/ai/chat/UserChatMessageContent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAE9B,MAAM,OAAO,4BAA4B;IAC9B,OAAO,CAAS;IAEzB,YAAY,OAAe;QACzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,MAAM;QACJ,OAAO,CAAC,CAAC,MAAM,CAAC,4BAA4B,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC5D,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,IAAwD;QACtE,OAAO,CAAC,CAAC,MAAM,CAAC,4BAA4B,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC5D,CAAC;IAED,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CACpB,CAAC,CAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;QACnB,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;KAC1B,CAAC,EACF,CAAC,CAAC,UAAU,CAAC,4BAA4B,CAAC,EAC1C;QACE,MAAM,CAAC,CAAC;YACN,OAAO,IAAI,4BAA4B,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;QACrD,CAAC;QACD,MAAM,CAAC,CAAC;YACN,OAAO;gBACL,OAAO,EAAE,CAAC,CAAC,OAAO;gBAClB,IAAI,EAAE,QAAQ;aACN,CAAC;QACb,CAAC;KACF,CACF,CAAC;;AAGJ,MAAM,CAAC,MAAM,2BAA2B,GAAG,4BAA4B,CAAC,KAAK,CAAC","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as z from \"zod/mini\";\n\nexport class UserChatMessageStringContent implements UserChatMessageContent {\n readonly content: string;\n\n constructor(content: string) {\n this.content = content;\n }\n\n toJSON() {\n return z.encode(UserChatMessageStringContent.codec, this);\n }\n\n static fromJSON(data: z.input<typeof UserChatMessageStringContent.codec>) {\n return z.decode(UserChatMessageStringContent.codec, data);\n }\n\n static codec = z.codec(\n z.object({\n content: z.string(),\n type: z.literal(\"string\"),\n }),\n z.instanceof(UserChatMessageStringContent),\n {\n decode(v) {\n return new UserChatMessageStringContent(v.content);\n },\n encode(v) {\n return {\n content: v.content,\n type: \"string\",\n } as const;\n },\n },\n );\n}\n\nexport const userChatMessageContentCodec = UserChatMessageStringContent.codec;\n\nexport type UserChatMessageContent = UserChatMessageStringContent;\n"]}