@dremio/js-sdk 0.45.1 → 0.45.2

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.
@@ -96,7 +96,7 @@ export declare class AIResource {
96
96
  modelProviderId: string | null;
97
97
  modifiedAt: import("temporal-polyfill").Temporal.Instant;
98
98
  tag: string;
99
- title: string;
99
+ title: string | null;
100
100
  }, {
101
101
  conversationId: string;
102
102
  }, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<{
@@ -204,7 +204,7 @@ export declare class AIResource {
204
204
  modelProviderId: string | null;
205
205
  modifiedAt: import("temporal-polyfill").Temporal.Instant;
206
206
  tag: string;
207
- title: string;
207
+ title: string | null;
208
208
  };
209
209
  history: {
210
210
  data: ({
@@ -312,7 +312,7 @@ export declare class AIResource {
312
312
  modelProviderId: string | null;
313
313
  modifiedAt: import("temporal-polyfill").Temporal.Instant;
314
314
  tag: string;
315
- title: string;
315
+ title: string | null;
316
316
  };
317
317
  currentRunId: string;
318
318
  }, {
@@ -435,7 +435,7 @@ export declare class AIResource {
435
435
  modelProviderId: string | null;
436
436
  modifiedAt: import("temporal-polyfill").Temporal.Instant;
437
437
  tag: string;
438
- title: string;
438
+ title: string | null;
439
439
  }, {
440
440
  conversationId: string;
441
441
  }, import("xstate").EventObject>;
@@ -551,7 +551,7 @@ export declare class AIResource {
551
551
  modelProviderId: string | null;
552
552
  modifiedAt: import("temporal-polyfill").Temporal.Instant;
553
553
  tag: string;
554
- title: string;
554
+ title: string | null;
555
555
  };
556
556
  history: {
557
557
  data: ({
@@ -663,7 +663,7 @@ export declare class AIResource {
663
663
  modelProviderId: string | null;
664
664
  modifiedAt: import("temporal-polyfill").Temporal.Instant;
665
665
  tag: string;
666
- title: string;
666
+ title: string | null;
667
667
  };
668
668
  currentRunId: string;
669
669
  }, {
@@ -823,7 +823,7 @@ export declare class AIResource {
823
823
  modelProviderId: string | null;
824
824
  modifiedAt: import("temporal-polyfill").Temporal.Instant;
825
825
  tag: string;
826
- title: string;
826
+ title: string | null;
827
827
  }, HttpError>;
828
828
  retrieveConversationHistory(id: string): {
829
829
  data(): AsyncGenerator<ChatEvent, void, HttpError>;
@@ -38,7 +38,7 @@ export declare class AIResource {
38
38
  modelProviderId: string | null;
39
39
  modifiedAt: import("temporal-polyfill").Temporal.Instant;
40
40
  tag: string;
41
- title: string;
41
+ title: string | null;
42
42
  }, {
43
43
  conversationId: string;
44
44
  }, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<{
@@ -146,7 +146,7 @@ export declare class AIResource {
146
146
  modelProviderId: string | null;
147
147
  modifiedAt: import("temporal-polyfill").Temporal.Instant;
148
148
  tag: string;
149
- title: string;
149
+ title: string | null;
150
150
  };
151
151
  history: {
152
152
  data: ({
@@ -254,7 +254,7 @@ export declare class AIResource {
254
254
  modelProviderId: string | null;
255
255
  modifiedAt: import("temporal-polyfill").Temporal.Instant;
256
256
  tag: string;
257
- title: string;
257
+ title: string | null;
258
258
  };
259
259
  currentRunId: string;
260
260
  }, {
@@ -377,7 +377,7 @@ export declare class AIResource {
377
377
  modelProviderId: string | null;
378
378
  modifiedAt: import("temporal-polyfill").Temporal.Instant;
379
379
  tag: string;
380
- title: string;
380
+ title: string | null;
381
381
  }, {
382
382
  conversationId: string;
383
383
  }, import("xstate").EventObject>;
@@ -493,7 +493,7 @@ export declare class AIResource {
493
493
  modelProviderId: string | null;
494
494
  modifiedAt: import("temporal-polyfill").Temporal.Instant;
495
495
  tag: string;
496
- title: string;
496
+ title: string | null;
497
497
  };
498
498
  history: {
499
499
  data: ({
@@ -605,7 +605,7 @@ export declare class AIResource {
605
605
  modelProviderId: string | null;
606
606
  modifiedAt: import("temporal-polyfill").Temporal.Instant;
607
607
  tag: string;
608
- title: string;
608
+ title: string | null;
609
609
  };
610
610
  currentRunId: string;
611
611
  }, {
@@ -20,7 +20,7 @@ export declare class AgentConversation implements AgentConversationProperties {
20
20
  get modelProviderId(): string | null;
21
21
  get modifiedAt(): import("temporal-polyfill").Temporal.Instant;
22
22
  get tag(): string;
23
- get title(): string;
23
+ get title(): string | null;
24
24
  clone(): AgentConversation;
25
25
  /**
26
26
  * Permanently deletes this conversation.
@@ -1 +1 @@
1
- {"version":3,"file":"AgentConversation.js","sourceRoot":"","sources":["../../../../src/enterprise/ai/conversations/AgentConversation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAE/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAC/F,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAC3B,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,2BAA2B,EAAE,MAAM,0CAA0C,CAAC;AAEvF,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAKzD;;GAEG;AACH,MAAM,OAAO,iBAAiB;IACnB,OAAO,CAAgB;IACvB,SAAS,CAA2C;IACpD,EAAE,CAAoC;IAC/C,aAAa,CAA8C;IAC3D,UAAU,CAA2C;IACrD,gBAAgB,C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AAU,KAAK,SAAS,EAAE,CAAC;YACxC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC;QAC3C,CAAC;QAED,IAAI,UAAU,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;YACjC,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC,GAAG,CAAC;QAC7B,CAAC;QAED,IAAI,UAAU,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;YACnC,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC;QACjC,CAAC;IACH,CAAC;IAED,MAAM,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IAC3C,MAAM,CAAC,YAAY,GAAG,wBAAwB,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\";\nimport { conversationPropertiesCodec } from \"./conversationPropertiesCodec.ts\";\nimport type { SonarV4Config } from \"../../../common/Config.ts\";\nimport { createExchangeRun } from \"./methods/createExchangeRun.ts\";\nimport { deleteConversation } from \"./methods/deleteConversation.ts\";\nimport { conversationUpdateSchema, updateConversation } from \"./methods/updateConversation.ts\";\nimport { map } from \"rxjs\";\nimport { stopExchangeRun } from \"./methods/stopExchangeRun.ts\";\nimport { chatEventCodec } from \"../chat/chatEventSchema.ts\";\nimport { fromTextEventStream } from \"../../../common/fromTextEventStream.ts\";\nimport { streamRunEvents } from \"./methods/streamRunEvents.ts\";\nimport { retrieveConversationHistory } from \"./methods/retrieveConversationHistory.ts\";\nimport type { SignalParam } from \"../../../common/Params.ts\";\nimport { reduceChatEvents } from \"./reduceChatEvents.ts\";\nimport type { ConflictResolver } from \"../../../common/ConflictResolver.ts\";\nimport { AsyncResult } from \"ts-results-es\";\nimport { retrieveConversation } from \"./methods/retrieveConversation.ts\";\nimport { isProblem } from \"../../../common/HttpError.ts\";\nimport type { createConversationCodec } from \"./methods/createConversation.ts\";\n\nexport type AgentConversationProperties = z.output<typeof conversationPropertiesCodec>;\n\n/**\n * Represents a saved conversation with the Dremio AI Agent.\n */\nexport class AgentConversation implements AgentConversationProperties {\n readonly #config: SonarV4Config;\n readonly createdAt: AgentConversationProperties[\"createdAt\"];\n readonly id: AgentConversationProperties[\"id\"];\n #currentRunId: AgentConversationProperties[\"currentRunId\"];\n #modelName: AgentConversationProperties[\"modelName\"];\n #modelProviderId: AgentConversationProperties[\"modelProviderId\"];\n #modifiedAt: AgentConversationProperties[\"modifiedAt\"];\n #tag: string;\n #title: string;\n\n constructor(config: SonarV4Config, properties: AgentConversationProperties) {\n this.#config = config;\n this.createdAt = properties.createdAt;\n this.id = properties.id;\n this.#currentRunId = properties.currentRunId;\n this.#modelName = properties.modelName;\n this.#modelProviderId = properties.modelProviderId;\n this.#modifiedAt = properties.modifiedAt;\n this.#tag = properties.tag;\n this.#title = properties.title;\n }\n\n get currentRunId() {\n return this.#currentRunId;\n }\n\n get modelName() {\n return this.#modelName;\n }\n\n get modelProviderId() {\n return this.#modelProviderId;\n }\n\n get modifiedAt() {\n return this.#modifiedAt;\n }\n\n get tag() {\n return this.#tag;\n }\n\n get title() {\n return this.#title;\n }\n\n clone() {\n return new AgentConversation(this.#config, this);\n }\n\n /**\n * Permanently deletes this conversation.\n */\n delete() {\n return deleteConversation(this.#config)(this.id);\n }\n\n /**\n * Patches properties for this `AgentConversation`, mutating instance properties after\n * a successful commit.\n */\n update(\n properties: z.infer<typeof AgentConversation.updateSchema>,\n options: {\n onConflict?: ConflictResolver<\n AgentConversationProperties,\n z.infer<typeof AgentConversation.updateSchema>\n >;\n } = {},\n ) {\n const { onConflict = () => null } = options;\n return new AsyncResult(\n (async () => {\n const attempt = await updateConversation(this.#config)(this.id, this.#tag, properties).map(\n (properties) => {\n this.#updateProperties(properties);\n },\n );\n\n if (\n attempt.isErr() &&\n isProblem(attempt.error.body) &&\n attempt.error.body.title === \"https://api.dremio.dev/problems/concurrent-modification\"\n ) {\n const remoteResult = await retrieveConversation(this.#config)(this.id);\n if (remoteResult.isOk()) {\n const remote = new AgentConversation(this.#config, remoteResult.value);\n const resolved = await onConflict(this.toJSON(), remote.toJSON(), properties);\n if (resolved !== null) {\n return updateConversation(this.#config)(this.id, remote.tag, resolved).map(\n (properties) => {\n this.#updateProperties(properties);\n },\n );\n }\n }\n }\n\n return attempt;\n })(),\n );\n }\n\n history({ signal }: SignalParam = {}) {\n return retrieveConversationHistory(this.#config)(this.id, { signal }).map(\n (response) => response.data,\n );\n }\n\n runEvents$(runId: string) {\n return fromTextEventStream(({ signal }) =>\n streamRunEvents(this.#config)({ conversationId: this.id, runId }, { signal }),\n ).pipe(\n map((event) =>\n z.decode(chatEventCodec, JSON.parse(event.data) as z.input<typeof chatEventCodec>),\n ),\n );\n }\n\n /**\n * Sends a message to the Agent, initiating a new run process.\n * @returns An `AsyncResult` containing the `runId` for the newly created run.\n */\n startRun(properties: z.input<typeof createConversationCodec>) {\n const asyncResult = createExchangeRun(this.#config)(this.id, properties);\n\n asyncResult\n .then((result) => {\n if (result.isOk()) {\n this.#updateProperties(result.value.conversationProperties);\n }\n })\n .catch(() => {});\n\n return asyncResult.map((properties) => properties.currentRunId);\n }\n\n /**\n * Only a single run can be active for a conversation, so for now\n * this method is kept private.\n */\n stopRun(id: string) {\n const asyncResult = stopExchangeRun(this.#config)(this.id, id);\n\n asyncResult\n .then((result) => {\n if (result.isOk() && this.#currentRunId === id) {\n this.#currentRunId = null;\n }\n })\n .catch(() => {});\n\n return asyncResult;\n }\n\n toJSON(): AgentConversationProperties {\n return {\n createdAt: this.createdAt,\n currentRunId: this.currentRunId,\n id: this.id,\n modelName: this.modelName,\n modelProviderId: this.modelProviderId,\n modifiedAt: this.modifiedAt,\n tag: this.tag,\n title: this.title,\n };\n }\n\n #updateProperties(properties: Partial<Omit<AgentConversationProperties, \"createdAt\" | \"id\">>) {\n if (properties.currentRunId !== undefined) {\n this.#currentRunId = properties.currentRunId;\n }\n\n if (properties.modelName !== undefined) {\n this.#modelName = properties.modelName;\n }\n\n if (properties.modelProviderId !== undefined) {\n this.#modelProviderId = properties.modelProviderId;\n }\n\n if (properties.modifiedAt !== undefined) {\n this.#modifiedAt = properties.modifiedAt;\n }\n\n if (properties.tag !== undefined) {\n this.#tag = properties.tag;\n }\n\n if (properties.title !== undefined) {\n this.#title = properties.title;\n }\n }\n\n static reduceChatEvents = reduceChatEvents;\n static updateSchema = conversationUpdateSchema;\n}\n"]}
1
+ {"version":3,"file":"AgentConversation.js","sourceRoot":"","sources":["../../../../src/enterprise/ai/conversations/AgentConversation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAE/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAC/F,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAC3B,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,2BAA2B,EAAE,MAAM,0CAA0C,CAAC;AAEvF,OAAO,EAAE,gBAAgB,EAAE,MAA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IAAI,CAAC,aAAa,GAAG,UAAU,CAAC,YAAY,CAAC;QAC/C,CAAC;QAED,IAAI,UAAU,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;YACvC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,SAAS,CAAC;QACzC,CAAC;QAED,IAAI,UAAU,CAAC,eAAe,KAAK,SAAS,EAAE,CAAC;YAC7C,IAAI,CAAC,gBAAgB,GAAG,UAAU,CAAC,eAAe,CAAC;QACrD,CAAC;QAED,IAAI,UAAU,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;YACxC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC;QAC3C,CAAC;QAED,IAAI,UAAU,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;YACjC,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC,GAAG,CAAC;QAC7B,CAAC;QAED,IAAI,UAAU,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;YACnC,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC;QACjC,CAAC;IACH,CAAC;IAED,MAAM,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IAC3C,MAAM,CAAC,YAAY,GAAG,wBAAwB,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\";\nimport { conversationPropertiesCodec } from \"./conversationPropertiesCodec.ts\";\nimport type { SonarV4Config } from \"../../../common/Config.ts\";\nimport { createExchangeRun } from \"./methods/createExchangeRun.ts\";\nimport { deleteConversation } from \"./methods/deleteConversation.ts\";\nimport { conversationUpdateSchema, updateConversation } from \"./methods/updateConversation.ts\";\nimport { map } from \"rxjs\";\nimport { stopExchangeRun } from \"./methods/stopExchangeRun.ts\";\nimport { chatEventCodec } from \"../chat/chatEventSchema.ts\";\nimport { fromTextEventStream } from \"../../../common/fromTextEventStream.ts\";\nimport { streamRunEvents } from \"./methods/streamRunEvents.ts\";\nimport { retrieveConversationHistory } from \"./methods/retrieveConversationHistory.ts\";\nimport type { SignalParam } from \"../../../common/Params.ts\";\nimport { reduceChatEvents } from \"./reduceChatEvents.ts\";\nimport type { ConflictResolver } from \"../../../common/ConflictResolver.ts\";\nimport { AsyncResult } from \"ts-results-es\";\nimport { retrieveConversation } from \"./methods/retrieveConversation.ts\";\nimport { isProblem } from \"../../../common/HttpError.ts\";\nimport type { createConversationCodec } from \"./methods/createConversation.ts\";\n\nexport type AgentConversationProperties = z.output<typeof conversationPropertiesCodec>;\n\n/**\n * Represents a saved conversation with the Dremio AI Agent.\n */\nexport class AgentConversation implements AgentConversationProperties {\n readonly #config: SonarV4Config;\n readonly createdAt: AgentConversationProperties[\"createdAt\"];\n readonly id: AgentConversationProperties[\"id\"];\n #currentRunId: AgentConversationProperties[\"currentRunId\"];\n #modelName: AgentConversationProperties[\"modelName\"];\n #modelProviderId: AgentConversationProperties[\"modelProviderId\"];\n #modifiedAt: AgentConversationProperties[\"modifiedAt\"];\n #tag: string;\n #title: string | null;\n\n constructor(config: SonarV4Config, properties: AgentConversationProperties) {\n this.#config = config;\n this.createdAt = properties.createdAt;\n this.id = properties.id;\n this.#currentRunId = properties.currentRunId;\n this.#modelName = properties.modelName;\n this.#modelProviderId = properties.modelProviderId;\n this.#modifiedAt = properties.modifiedAt;\n this.#tag = properties.tag;\n this.#title = properties.title;\n }\n\n get currentRunId() {\n return this.#currentRunId;\n }\n\n get modelName() {\n return this.#modelName;\n }\n\n get modelProviderId() {\n return this.#modelProviderId;\n }\n\n get modifiedAt() {\n return this.#modifiedAt;\n }\n\n get tag() {\n return this.#tag;\n }\n\n get title() {\n return this.#title;\n }\n\n clone() {\n return new AgentConversation(this.#config, this);\n }\n\n /**\n * Permanently deletes this conversation.\n */\n delete() {\n return deleteConversation(this.#config)(this.id);\n }\n\n /**\n * Patches properties for this `AgentConversation`, mutating instance properties after\n * a successful commit.\n */\n update(\n properties: z.infer<typeof AgentConversation.updateSchema>,\n options: {\n onConflict?: ConflictResolver<\n AgentConversationProperties,\n z.infer<typeof AgentConversation.updateSchema>\n >;\n } = {},\n ) {\n const { onConflict = () => null } = options;\n return new AsyncResult(\n (async () => {\n const attempt = await updateConversation(this.#config)(this.id, this.#tag, properties).map(\n (properties) => {\n this.#updateProperties(properties);\n },\n );\n\n if (\n attempt.isErr() &&\n isProblem(attempt.error.body) &&\n attempt.error.body.title === \"https://api.dremio.dev/problems/concurrent-modification\"\n ) {\n const remoteResult = await retrieveConversation(this.#config)(this.id);\n if (remoteResult.isOk()) {\n const remote = new AgentConversation(this.#config, remoteResult.value);\n const resolved = await onConflict(this.toJSON(), remote.toJSON(), properties);\n if (resolved !== null) {\n return updateConversation(this.#config)(this.id, remote.tag, resolved).map(\n (properties) => {\n this.#updateProperties(properties);\n },\n );\n }\n }\n }\n\n return attempt;\n })(),\n );\n }\n\n history({ signal }: SignalParam = {}) {\n return retrieveConversationHistory(this.#config)(this.id, { signal }).map(\n (response) => response.data,\n );\n }\n\n runEvents$(runId: string) {\n return fromTextEventStream(({ signal }) =>\n streamRunEvents(this.#config)({ conversationId: this.id, runId }, { signal }),\n ).pipe(\n map((event) =>\n z.decode(chatEventCodec, JSON.parse(event.data) as z.input<typeof chatEventCodec>),\n ),\n );\n }\n\n /**\n * Sends a message to the Agent, initiating a new run process.\n * @returns An `AsyncResult` containing the `runId` for the newly created run.\n */\n startRun(properties: z.input<typeof createConversationCodec>) {\n const asyncResult = createExchangeRun(this.#config)(this.id, properties);\n\n asyncResult\n .then((result) => {\n if (result.isOk()) {\n this.#updateProperties(result.value.conversationProperties);\n }\n })\n .catch(() => {});\n\n return asyncResult.map((properties) => properties.currentRunId);\n }\n\n /**\n * Only a single run can be active for a conversation, so for now\n * this method is kept private.\n */\n stopRun(id: string) {\n const asyncResult = stopExchangeRun(this.#config)(this.id, id);\n\n asyncResult\n .then((result) => {\n if (result.isOk() && this.#currentRunId === id) {\n this.#currentRunId = null;\n }\n })\n .catch(() => {});\n\n return asyncResult;\n }\n\n toJSON(): AgentConversationProperties {\n return {\n createdAt: this.createdAt,\n currentRunId: this.currentRunId,\n id: this.id,\n modelName: this.modelName,\n modelProviderId: this.modelProviderId,\n modifiedAt: this.modifiedAt,\n tag: this.tag,\n title: this.title,\n };\n }\n\n #updateProperties(properties: Partial<Omit<AgentConversationProperties, \"createdAt\" | \"id\">>) {\n if (properties.currentRunId !== undefined) {\n this.#currentRunId = properties.currentRunId;\n }\n\n if (properties.modelName !== undefined) {\n this.#modelName = properties.modelName;\n }\n\n if (properties.modelProviderId !== undefined) {\n this.#modelProviderId = properties.modelProviderId;\n }\n\n if (properties.modifiedAt !== undefined) {\n this.#modifiedAt = properties.modifiedAt;\n }\n\n if (properties.tag !== undefined) {\n this.#tag = properties.tag;\n }\n\n if (properties.title !== undefined) {\n this.#title = properties.title;\n }\n }\n\n static reduceChatEvents = reduceChatEvents;\n static updateSchema = conversationUpdateSchema;\n}\n"]}
@@ -8,7 +8,7 @@ export declare const conversationPropertiesCodec: z.ZodMiniCodec<z.ZodMiniObject
8
8
  modelProviderId: z.ZodMiniOptional<z.ZodMiniString<string>>;
9
9
  modifiedAt: z.iso.ZodMiniISODateTime;
10
10
  tag: z.ZodMiniString<string>;
11
- title: z.ZodMiniString<string>;
11
+ title: z.ZodMiniNullable<z.ZodMiniString<string>>;
12
12
  }, z.core.$strip>, z.ZodMiniObject<{
13
13
  createdAt: z.ZodMiniCustom<Temporal.Instant, Temporal.Instant>;
14
14
  currentRunId: z.ZodMiniNullable<z.ZodMiniString<string>>;
@@ -17,6 +17,6 @@ export declare const conversationPropertiesCodec: z.ZodMiniCodec<z.ZodMiniObject
17
17
  modelProviderId: z.ZodMiniNullable<z.ZodMiniString<string>>;
18
18
  modifiedAt: z.ZodMiniCustom<Temporal.Instant, Temporal.Instant>;
19
19
  tag: z.ZodMiniString<string>;
20
- title: z.ZodMiniString<string>;
20
+ title: z.ZodMiniNullable<z.ZodMiniString<string>>;
21
21
  }, z.core.$strip>>;
22
22
  export type ConversationEntity = z.input<typeof conversationPropertiesCodec>;
@@ -23,7 +23,7 @@ export const conversationPropertiesCodec = z.codec(z.object({
23
23
  modelProviderId: z.optional(z.string()),
24
24
  modifiedAt: z.iso.datetime(),
25
25
  tag: z.string(),
26
- title: z.string(),
26
+ title: z.nullable(z.string()),
27
27
  }), z.object({
28
28
  createdAt: z.instanceof(Temporal.Instant),
29
29
  currentRunId: z.nullable(z.string()),
@@ -32,7 +32,7 @@ export const conversationPropertiesCodec = z.codec(z.object({
32
32
  modelProviderId: z.nullable(z.string()),
33
33
  modifiedAt: z.instanceof(Temporal.Instant),
34
34
  tag: z.string(),
35
- title: z.string(),
35
+ title: z.nullable(z.string()),
36
36
  }), {
37
37
  decode(v) {
38
38
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"conversationPropertiesCodec.js","sourceRoot":"","sources":["../../../../src/enterprise/ai/conversations/conversationPropertiesCodec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAE9B,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAChD,CAAC,CAAC,MAAM,CAAC;IACP,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;IAC1B,SAAS,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE;IAC3B,YAAY,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IACpC,SAAS,EAAE,CAAC,C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,CAAC,KAAK;SACf,CAAC;IACJ,CAAC;IACD,MAAM,CAAC,CAAC;QACN,OAAO;YACL,cAAc,EAAE,CAAC,CAAC,EAAE;YACpB,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,QAAQ,EAAE;YACjC,YAAY,EAAE,CAAC,CAAC,YAAY,IAAI,SAAS;YACzC,SAAS,EAAE,CAAC,CAAC,SAAS,IAAI,SAAS;YACnC,eAAe,EAAE,CAAC,CAAC,eAAe,IAAI,SAAS;YAC/C,UAAU,EAAE,CAAC,CAAC,UAAU,CAAC,QAAQ,EAAE;YACnC,GAAG,EAAE,CAAC,CAAC,GAAG;YACV,KAAK,EAAE,CAAC,CAAC,KAAK;SACf,CAAC;IACJ,CAAC;CACF,CACF,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 { Temporal } from \"temporal-polyfill\";\nimport * as z from \"zod/mini\";\n\nexport const conversationPropertiesCodec = z.codec(\n z.object({\n conversationId: z.string(),\n createdAt: z.iso.datetime(),\n currentRunId: z.optional(z.string()),\n modelName: z.optional(z.string()),\n modelProviderId: z.optional(z.string()),\n modifiedAt: z.iso.datetime(),\n tag: z.string(),\n title: z.string(),\n }),\n z.object({\n createdAt: z.instanceof(Temporal.Instant),\n currentRunId: z.nullable(z.string()),\n id: z.string(),\n modelName: z.nullable(z.string()),\n modelProviderId: z.nullable(z.string()),\n modifiedAt: z.instanceof(Temporal.Instant),\n tag: z.string(),\n title: z.string(),\n }),\n {\n decode(v) {\n return {\n createdAt: Temporal.Instant.from(v.createdAt),\n currentRunId: v.currentRunId || null,\n id: v.conversationId,\n modelName: v.modelName || null,\n modelProviderId: v.modelProviderId || null,\n modifiedAt: Temporal.Instant.from(v.modifiedAt),\n tag: v.tag,\n title: v.title,\n };\n },\n encode(v) {\n return {\n conversationId: v.id,\n createdAt: v.createdAt.toString(),\n currentRunId: v.currentRunId || undefined,\n modelName: v.modelName || undefined,\n modelProviderId: v.modelProviderId || undefined,\n modifiedAt: v.modifiedAt.toString(),\n tag: v.tag,\n title: v.title,\n };\n },\n },\n);\n\nexport type ConversationEntity = z.input<typeof conversationPropertiesCodec>;\n"]}
1
+ {"version":3,"file":"conversationPropertiesCodec.js","sourceRoot":"","sources":["../../../../src/enterprise/ai/conversations/conversationPropertiesCodec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAE9B,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAChD,CAAC,CAAC,MAAM,CAAC;IACP,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;IAC1B,SAAS,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE;IAC3B,YAAY,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IACpC,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IACjC,eAAe,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IACvC,UAAU,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE;IAC5B,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,KAAK,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;CAC9B,CAAC,EACF,CAAC,CAAC,MAAM,CAAC;IACP,SAAS,EAAE,CAAC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,IAAI,SAAS;YAC/C,UAAU,EAAE,CAAC,CAAC,UAAU,CAAC,QAAQ,EAAE;YACnC,GAAG,EAAE,CAAC,CAAC,GAAG;YACV,KAAK,EAAE,CAAC,CAAC,KAAK;SACf,CAAC;IACJ,CAAC;CACF,CACF,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 { Temporal } from \"temporal-polyfill\";\nimport * as z from \"zod/mini\";\n\nexport const conversationPropertiesCodec = z.codec(\n z.object({\n conversationId: z.string(),\n createdAt: z.iso.datetime(),\n currentRunId: z.optional(z.string()),\n modelName: z.optional(z.string()),\n modelProviderId: z.optional(z.string()),\n modifiedAt: z.iso.datetime(),\n tag: z.string(),\n title: z.nullable(z.string()),\n }),\n z.object({\n createdAt: z.instanceof(Temporal.Instant),\n currentRunId: z.nullable(z.string()),\n id: z.string(),\n modelName: z.nullable(z.string()),\n modelProviderId: z.nullable(z.string()),\n modifiedAt: z.instanceof(Temporal.Instant),\n tag: z.string(),\n title: z.nullable(z.string()),\n }),\n {\n decode(v) {\n return {\n createdAt: Temporal.Instant.from(v.createdAt),\n currentRunId: v.currentRunId || null,\n id: v.conversationId,\n modelName: v.modelName || null,\n modelProviderId: v.modelProviderId || null,\n modifiedAt: Temporal.Instant.from(v.modifiedAt),\n tag: v.tag,\n title: v.title,\n };\n },\n encode(v) {\n return {\n conversationId: v.id,\n createdAt: v.createdAt.toString(),\n currentRunId: v.currentRunId || undefined,\n modelName: v.modelName || undefined,\n modelProviderId: v.modelProviderId || undefined,\n modifiedAt: v.modifiedAt.toString(),\n tag: v.tag,\n title: v.title,\n };\n },\n },\n);\n\nexport type ConversationEntity = z.input<typeof conversationPropertiesCodec>;\n"]}
@@ -56,7 +56,7 @@ export declare const createConversationMachine: (config: SonarV4Config) => impor
56
56
  modelProviderId: string | null;
57
57
  modifiedAt: import("temporal-polyfill").Temporal.Instant;
58
58
  tag: string;
59
- title: string;
59
+ title: string | null;
60
60
  }, {
61
61
  conversationId: string;
62
62
  }, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<{
@@ -164,7 +164,7 @@ export declare const createConversationMachine: (config: SonarV4Config) => impor
164
164
  modelProviderId: string | null;
165
165
  modifiedAt: import("temporal-polyfill").Temporal.Instant;
166
166
  tag: string;
167
- title: string;
167
+ title: string | null;
168
168
  };
169
169
  history: {
170
170
  data: ({
@@ -272,7 +272,7 @@ export declare const createConversationMachine: (config: SonarV4Config) => impor
272
272
  modelProviderId: string | null;
273
273
  modifiedAt: import("temporal-polyfill").Temporal.Instant;
274
274
  tag: string;
275
- title: string;
275
+ title: string | null;
276
276
  };
277
277
  currentRunId: string;
278
278
  }, {
@@ -395,7 +395,7 @@ export declare const createConversationMachine: (config: SonarV4Config) => impor
395
395
  modelProviderId: string | null;
396
396
  modifiedAt: import("temporal-polyfill").Temporal.Instant;
397
397
  tag: string;
398
- title: string;
398
+ title: string | null;
399
399
  }, {
400
400
  conversationId: string;
401
401
  }, import("xstate").EventObject>;
@@ -511,7 +511,7 @@ export declare const createConversationMachine: (config: SonarV4Config) => impor
511
511
  modelProviderId: string | null;
512
512
  modifiedAt: import("temporal-polyfill").Temporal.Instant;
513
513
  tag: string;
514
- title: string;
514
+ title: string | null;
515
515
  };
516
516
  history: {
517
517
  data: ({
@@ -623,7 +623,7 @@ export declare const createConversationMachine: (config: SonarV4Config) => impor
623
623
  modelProviderId: string | null;
624
624
  modifiedAt: import("temporal-polyfill").Temporal.Instant;
625
625
  tag: string;
626
- title: string;
626
+ title: string | null;
627
627
  };
628
628
  currentRunId: string;
629
629
  }, {
@@ -10,7 +10,7 @@ export declare const createExchangeRun: (config: SonarV4Config) => (conversation
10
10
  modelProviderId: string | null;
11
11
  modifiedAt: import("temporal-polyfill").Temporal.Instant;
12
12
  tag: string;
13
- title: string;
13
+ title: string | null;
14
14
  };
15
15
  currentRunId: string;
16
16
  }, import("../../../index.ts").HttpError>;
@@ -8,5 +8,5 @@ export declare const retrieveConversation: (config: SonarV4Config) => (id: strin
8
8
  modelProviderId: string | null;
9
9
  modifiedAt: import("temporal-polyfill").Temporal.Instant;
10
10
  tag: string;
11
- title: string;
11
+ title: string | null;
12
12
  }, import("../../../index.ts").HttpError>;
@@ -8,7 +8,7 @@ export declare const updateConversation: (config: SonarV4Config) => (id: string,
8
8
  modelProviderId: string | null;
9
9
  modifiedAt: import("temporal-polyfill").Temporal.Instant;
10
10
  tag: string;
11
- title: string;
11
+ title: string | null;
12
12
  }, import("../../../index.ts").HttpError>;
13
13
  export declare const conversationUpdateSchema: z.ZodMiniObject<{
14
14
  title: z.ZodMiniOptional<z.ZodMiniString<string>>;
@@ -24616,7 +24616,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
24616
24616
  modelProviderId: optional(string2()),
24617
24617
  modifiedAt: iso_exports.datetime(),
24618
24618
  tag: string2(),
24619
- title: string2()
24619
+ title: nullable(string2())
24620
24620
  }), object({
24621
24621
  createdAt: _instanceof(Xn.Instant),
24622
24622
  currentRunId: nullable(string2()),
@@ -24625,7 +24625,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
24625
24625
  modelProviderId: nullable(string2()),
24626
24626
  modifiedAt: _instanceof(Xn.Instant),
24627
24627
  tag: string2(),
24628
- title: string2()
24628
+ title: nullable(string2())
24629
24629
  }), {
24630
24630
  decode(v2) {
24631
24631
  return {
@@ -25279,7 +25279,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
25279
25279
  modelProviderId: optional(string2()),
25280
25280
  modifiedAt: iso_exports.datetime(),
25281
25281
  tag: string2(),
25282
- title: string2()
25282
+ title: nullable(string2())
25283
25283
  }), object({
25284
25284
  createdAt: _instanceof(Xn.Instant),
25285
25285
  currentRunId: nullable(string2()),
@@ -25288,7 +25288,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
25288
25288
  modelProviderId: nullable(string2()),
25289
25289
  modifiedAt: _instanceof(Xn.Instant),
25290
25290
  tag: string2(),
25291
- title: string2()
25291
+ title: nullable(string2())
25292
25292
  }), {
25293
25293
  decode(v2) {
25294
25294
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dremio/js-sdk",
3
- "version": "0.45.1",
3
+ "version": "0.45.2",
4
4
  "description": "JavaScript library for the Dremio API",
5
5
  "keywords": [
6
6
  "dremio",