@dvina/sdk 4.0.126 → 4.0.151

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 (31) hide show
  1. package/README.md +12 -8
  2. package/dist/_generated_documents-3N6BQ5SR.js +4 -0
  3. package/dist/{_generated_documents-EETCZBVL.js.map → _generated_documents-3N6BQ5SR.js.map} +1 -1
  4. package/dist/{_generated_documents-2J4XR7QK.cjs → _generated_documents-R4Q64XRB.cjs} +639 -515
  5. package/dist/{_generated_documents-2J4XR7QK.cjs.map → _generated_documents-R4Q64XRB.cjs.map} +1 -1
  6. package/dist/adapters/angular/index.cjs +4 -4
  7. package/dist/adapters/angular/index.d.cts +1 -1
  8. package/dist/adapters/angular/index.d.ts +1 -1
  9. package/dist/adapters/angular/index.js +2 -2
  10. package/dist/{chunk-4J3LMQVG.js → chunk-4BKKU67P.js} +75 -44
  11. package/dist/chunk-4BKKU67P.js.map +1 -0
  12. package/dist/{chunk-H5WMTA3W.cjs → chunk-D7AKD4KG.cjs} +109 -47
  13. package/dist/chunk-D7AKD4KG.cjs.map +1 -0
  14. package/dist/{chunk-7N4QKDOR.js → chunk-N64A3FWK.js} +1084 -81
  15. package/dist/chunk-N64A3FWK.js.map +1 -0
  16. package/dist/{chunk-NXYGWVNO.cjs → chunk-RSSJCKVR.cjs} +1587 -574
  17. package/dist/chunk-RSSJCKVR.cjs.map +1 -0
  18. package/dist/client-BK4gb0rI.d.ts +6171 -0
  19. package/dist/client-Bqg_UhDO.d.cts +6171 -0
  20. package/dist/index.cjs +429 -389
  21. package/dist/index.d.cts +94 -5803
  22. package/dist/index.d.ts +94 -5803
  23. package/dist/index.js +2 -2
  24. package/package.json +1 -1
  25. package/dist/_generated_documents-EETCZBVL.js +0 -4
  26. package/dist/chunk-4J3LMQVG.js.map +0 -1
  27. package/dist/chunk-7N4QKDOR.js.map +0 -1
  28. package/dist/chunk-H5WMTA3W.cjs.map +0 -1
  29. package/dist/chunk-NXYGWVNO.cjs.map +0 -1
  30. package/dist/client-B5LbpEC3.d.ts +0 -77
  31. package/dist/client-Dp5JOq16.d.cts +0 -77
@@ -2,7 +2,7 @@ import { Request, Connection, PageInfo, defaultConnection } from './chunk-KEM6SU
2
2
  import { createInferenceClientInternal } from './chunk-PDM2KR7T.js';
3
3
  import { createHttpTransport, BillingClient, print, Kind } from './chunk-5TAY5I34.js';
4
4
  import { GRAPHQL_ERROR_CODES, DvinaAuthenticationError, DvinaNetworkError, DvinaGraphQLError, DvinaError, createGraphQLError } from './chunk-7XBJ77RJ.js';
5
- import { ChatConnectionFragmentDoc, ChatFragmentDoc, FileFragmentDoc, ChatMessageFragmentDoc, AgentConnectionFragmentDoc, ArtifactConnectionFragmentDoc, InsightFragmentDoc, ChatMessageConnectionFragmentDoc, ContentBlockFragmentDoc, FeedbackFragmentDoc, DatabaseEngineFragmentDoc, TableConnectionFragmentDoc, DocumentContentFragmentDoc, DocumentFormatFragmentDoc, FeedSendMessageActionFragmentDoc, FeedArtifactDataFragmentDoc, ReportMemberFragmentDoc, ReportConnectionFragmentDoc, IntegrationProviderFragmentDoc, IntegrationFragmentDoc, InsightConnectionFragmentDoc, DatabaseFragmentDoc, DocumentFragmentDoc, RelationFragmentDoc, AddInsightToReportDocument, CancelOauthFlowDocument, CancelWorkspaceDeletionDocument, ConnectIntegrationDocument, ConsumePulseEventsDocument, ContinueImportedChatDocument, ContinueInterpretationDocument, CreateAgentDocument, CreateChatDocument, CreateDatabaseDocument, CreateDocumentDocument, CreateFeedbackDocument, CreateFolderDocument, CreateInsightDocument, CreateIntegrationDocument, CreateReportDocument, CreateTableDocument, CreateUserSkillFileDocument, CreateUserSkillFolderDocument, DeleteAgentDocument, DeleteArtifactDocument, DeleteChatDocument, DeleteDatabaseDocument, DeleteDocumentDocument, DeleteFolderDocument, DeleteInsightDocument, DeleteInsightsDocument, DeleteIntegrationDocument, DeleteReportDocument, DeleteTableDocument, DeleteUserSkillFileDocument, DeleteUserSkillFolderDocument, DisconnectIntegrationDocument, DismissPulseEventDocument, ExecuteChatImportDocument, GenerateUploadUriDocument, PreviewChatImportDocument, ReanalyzeDocumentDocument, RefineMindInstructionDocument, RefreshDatabaseSchemaDocument, RefreshInsightDocument, ReinterpretSourceDocument, ReinterpretSourcesOfuserDocument, RelocateInsightDocument, RemoveInsightFromReportDocument, ResetWorkspaceDocument, ResolvePulseEventDocument, ScheduleWorkspaceDeletionDocument, SetDatabasePrimaryKeyDocument, UpdateAgentDocument, UpdateArtifactNameDocument, UpdateChatDocument, UpdateDatabaseDocument, UpdateDocumentDocument, UpdateFolderDocument, UpdateInsightDocument, UpdateInsightInReportDocument, UpdateInsightThumbnailDocument, UpdateInterpDocument, UpdatePulseTriggerDocument, UpdateReportDocument, UpdateTableDocument, UpdateUserSkillFileDocument, UpdateUserSkillFolderDocument, AgentDocument, Agent_ChatsDocument, AgentsDocument, ArtifactDocument, Artifact_ChatDocument, Artifact_Chat_InsightDocument, Artifact_FileDocument, Artifact_MessageDocument, Artifact_Message_ChatDocument, Artifact_Message_ContentsDocument, Artifact_Message_FeedbackDocument, ArtifactsDocument, ChatDocument, Chat_AgentsDocument, Chat_ArtifactsDocument, Chat_InsightDocument, Chat_Insight_ReportMembersDocument, Chat_Insight_ThumbnailFileDocument, Chat_MessagesDocument, ChatMessageDocument, ChatMessage_ArtifactsDocument, ChatMessage_ChatDocument, ChatMessage_Chat_InsightDocument, ChatMessage_ContentsDocument, ChatMessage_FeedbackDocument, ChatMessagesDocument, ChatsDocument, DatabaseDocument, Database_EngineDocument, Database_Engine_CatalogDocument, Database_TablesDocument, DatabaseCatalogDocument, DatabaseCatalog_EngineDocument, DatabaseCatalogsDocument, DatabaseSchemaDocument, DatabasesDocument, DocumentDocument, Document_ContentsDocument, Document_FileDocument, Document_FormatDocument, Document_Format_CatalogDocument, Document_TablesDocument, DocumentCatalogDocument, DocumentCatalog_FormatDocument, DocumentCatalogsDocument, DocumentsDocument, ExportDocument, ExportWithInsightIdDocument, FeedItemDocument, FeedItem_ActionDocument, FeedItem_DataDocument, FeedItemsDocument, FileDocument, FileMetaDocument, FileUrlsDocument, FindFitTierDocument, FolderDocument, FoldersDocument, GetCapabilityDocument, GetDevAccessTokenDocument, GetLimitDocument, GetRemainingDocument, GetTokenUsageByModelDocument, GetTokenUsageHistoryDocument, GetTokenUsageStatusDocument, UsageWindowsStatusTypeFragmentDoc, GetTokenUsageStatus_WindowsDocument, GetTokenUsageStatus_Windows_DayDocument, GetTokenUsageStatus_Windows_FiveHourDocument, GetTokenUsageStatus_Windows_WeekDocument, GetUsageDocument, InsightDocument, Insight_ChatDocument, Insight_ReportMembersDocument, Insight_ReportsDocument, Insight_ThumbnailFileDocument, InsightsDocument, IntegrationDocument, Integration_ProviderDocument, Integration_Provider_CatalogDocument, IntegrationCatalogDocument, IntegrationCatalog_ProviderDocument, IntegrationCatalogToolsDocument, IntegrationCatalogsDocument, IntegrationsDocument, InterpretationsDocument, NotificationDocument, NotificationsDocument, NotificationsByReferenceDocument, PrivacyStatsDocument, PulseAppSummaryDocument, PulseEventDocument, PulseEvent_IntegrationDocument, PulseEvent_Integration_ProviderDocument, PulseEventsDocument, PulseTriggerSettingsDocument, QueryDocument, QueryWithInsightIdDocument, QueryWithMessageIdDocument, ReportDocument, Report_InsightsDocument, Report_LayoutDocument, ReportsDocument, SearchDocument, TableDocument, Table_DatabaseDocument, Table_Database_EngineDocument, Table_DocumentDocument, Table_Document_ContentsDocument, Table_Document_FileDocument, Table_Document_FormatDocument, Table_FromRelationsDocument, Table_ToRelationsDocument, TablesDocument, UserSkillFileDocument, UserSkillFilesDocument, UserSkillFolderDocument, UserSkillFoldersDocument, WorkspaceDeletionScheduleDocument, McpAuthUpdatesDocument, SendMessageStreamDocument, TokenUsageUpdatesDocument } from './chunk-4J3LMQVG.js';
5
+ import { ChatConnectionFragmentDoc, ChatFragmentDoc, FileFragmentDoc, ChatMessageFragmentDoc, AgentConnectionFragmentDoc, ArtifactConnectionFragmentDoc, InsightFragmentDoc, ChatMessageConnectionFragmentDoc, ContentBlockFragmentDoc, FeedbackFragmentDoc, DatabaseEngineFragmentDoc, TableConnectionFragmentDoc, DocumentContentFragmentDoc, DocumentFormatFragmentDoc, FeedSendMessageActionFragmentDoc, FeedArtifactDataFragmentDoc, ReportMemberFragmentDoc, ReportConnectionFragmentDoc, IntegrationProviderFragmentDoc, IntegrationFragmentDoc, InsightConnectionFragmentDoc, DatabaseFragmentDoc, DocumentFragmentDoc, RelationFragmentDoc, AbortChatDocument, AddInsightToReportDocument, CancelOauthFlowDocument, CancelWorkspaceDeletionDocument, ConnectIntegrationDocument, ConsumePulseEventsDocument, ContinueImportedChatDocument, ContinueInterpretationDocument, CreateAgentDocument, CreateChatDocument, CreateDatabaseDocument, CreateDocumentDocument, CreateFeedbackDocument, CreateFolderDocument, CreateInsightDocument, CreateIntegrationDocument, CreateReportDocument, CreateTableDocument, CreateUserSkillFileDocument, CreateUserSkillFolderDocument, DeleteAgentDocument, DeleteArtifactDocument, DeleteChatDocument, DeleteDatabaseDocument, DeleteDocumentDocument, DeleteFolderDocument, DeleteInsightDocument, DeleteInsightsDocument, DeleteIntegrationDocument, DeleteReportDocument, DeleteTableDocument, DeleteUserSkillFileDocument, DeleteUserSkillFolderDocument, DisconnectIntegrationDocument, DismissPulseEventDocument, ExecuteChatImportDocument, GenerateUploadUriDocument, PreviewChatImportDocument, ReanalyzeDocumentDocument, RefineMindInstructionDocument, RefreshDatabaseSchemaDocument, RefreshInsightDocument, ReinterpretSourceDocument, ReinterpretSourcesOfuserDocument, RelocateInsightDocument, RemoveInsightFromReportDocument, ResetWorkspaceDocument, ResolvePulseEventDocument, ScheduleWorkspaceDeletionDocument, SendMessageDocument, SetDatabasePrimaryKeyDocument, UpdateAgentDocument, UpdateArtifactNameDocument, UpdateChatDocument, UpdateDatabaseDocument, UpdateDocumentDocument, UpdateFolderDocument, UpdateInsightDocument, UpdateInsightInReportDocument, UpdateInsightThumbnailDocument, UpdateInterpDocument, UpdateLiveContextDocument, UpdatePulseTriggerDocument, UpdateReportDocument, UpdateTableDocument, UpdateUserSkillFileDocument, UpdateUserSkillFolderDocument, AgentDocument, Agent_ChatsDocument, AgentsDocument, ArtifactDocument, Artifact_ChatDocument, Artifact_Chat_InsightDocument, Artifact_FileDocument, Artifact_MessageDocument, Artifact_Message_ChatDocument, Artifact_Message_ContentsDocument, Artifact_Message_FeedbackDocument, ArtifactsDocument, ChatDocument, Chat_AgentsDocument, Chat_ArtifactsDocument, Chat_InsightDocument, Chat_Insight_ReportMembersDocument, Chat_Insight_ThumbnailFileDocument, Chat_MessagesDocument, ChatMessageDocument, ChatMessage_ArtifactsDocument, ChatMessage_ChatDocument, ChatMessage_Chat_InsightDocument, ChatMessage_ContentsDocument, ChatMessage_FeedbackDocument, ChatMessagesDocument, ChatsDocument, DatabaseDocument, Database_EngineDocument, Database_Engine_CatalogDocument, Database_TablesDocument, DatabaseCatalogDocument, DatabaseCatalog_EngineDocument, DatabaseCatalogsDocument, DatabaseSchemaDocument, DatabasesDocument, DocumentDocument, Document_ContentsDocument, Document_FileDocument, Document_FormatDocument, Document_Format_CatalogDocument, Document_TablesDocument, DocumentCatalogDocument, DocumentCatalog_FormatDocument, DocumentCatalogsDocument, DocumentsDocument, ExportDocument, ExportWithInsightIdDocument, FeedItemDocument, FeedItem_ActionDocument, FeedItem_DataDocument, FeedItemsDocument, FileDocument, FileMetaDocument, FileUrlsDocument, FindFitTierDocument, FolderDocument, FoldersDocument, GetCapabilityDocument, GetDevAccessTokenDocument, GetLimitDocument, GetRemainingDocument, GetTokenUsageByModelDocument, GetTokenUsageHistoryDocument, GetTokenUsageStatusDocument, UsageWindowsStatusTypeFragmentDoc, GetTokenUsageStatus_WindowsDocument, GetTokenUsageStatus_Windows_DayDocument, GetTokenUsageStatus_Windows_FiveHourDocument, GetTokenUsageStatus_Windows_MonthDocument, GetTokenUsageStatus_Windows_WeekDocument, GetUsageDocument, InsightDocument, Insight_ChatDocument, Insight_ReportMembersDocument, Insight_ReportsDocument, Insight_ThumbnailFileDocument, InsightsDocument, IntegrationDocument, Integration_ProviderDocument, Integration_Provider_CatalogDocument, IntegrationCatalogDocument, IntegrationCatalog_ProviderDocument, IntegrationCatalogToolsDocument, IntegrationCatalogsDocument, IntegrationsDocument, InterpretationsDocument, NotificationDocument, NotificationsDocument, NotificationsByReferenceDocument, PrivacyStatsDocument, PulseAppSummaryDocument, PulseEventDocument, PulseEvent_IntegrationDocument, PulseEvent_Integration_ProviderDocument, PulseEventsDocument, PulseTriggerSettingsDocument, QueryDocument, QueryWithInsightIdDocument, QueryWithMessageIdDocument, ReportDocument, Report_InsightsDocument, Report_LayoutDocument, ReportsDocument, TableDocument, Table_DatabaseDocument, Table_Database_EngineDocument, Table_DocumentDocument, Table_Document_ContentsDocument, Table_Document_FileDocument, Table_Document_FormatDocument, Table_FromRelationsDocument, Table_ToRelationsDocument, TablesDocument, UserSkillFileDocument, UserSkillFilesDocument, UserSkillFolderDocument, UserSkillFoldersDocument, WorkspaceDeletionScheduleDocument, McpAuthUpdatesDocument, TokenUsageUpdatesDocument } from './chunk-4BKKU67P.js';
6
6
  import { __commonJS, __toESM } from './chunk-5WRI5ZAA.js';
7
7
 
8
8
  // ../../node_modules/.pnpm/dexie@4.3.0/node_modules/dexie/dist/dexie.js
@@ -6030,6 +6030,569 @@ var require_dexie = __commonJS({
6030
6030
  }
6031
6031
  });
6032
6032
 
6033
+ // src/chat-stream.ts
6034
+ var INITIAL_RECONNECT_DELAY_MS = 1e3;
6035
+ var MAX_RECONNECT_DELAY_MS = 3e4;
6036
+ var RECONNECT_BACKOFF_MULTIPLIER = 2;
6037
+ var MAX_CONSECUTIVE_AUTH_FAILURES = 3;
6038
+ var AuthChatStreamError = class extends Error {
6039
+ constructor(status) {
6040
+ super(`Chat stream auth failed: ${status}`);
6041
+ this.status = status;
6042
+ this.name = "AuthChatStreamError";
6043
+ }
6044
+ };
6045
+ var ChatStreamConnection = class {
6046
+ constructor(chatId, options, onEmpty) {
6047
+ this.chatId = chatId;
6048
+ this.options = options;
6049
+ this.onEmpty = onEmpty;
6050
+ }
6051
+ abortController;
6052
+ consecutiveAuthFailures = 0;
6053
+ destroyed = false;
6054
+ lastEventId;
6055
+ needsForceRefresh = false;
6056
+ reconnectDelay = INITIAL_RECONNECT_DELAY_MS;
6057
+ reconnectTimer;
6058
+ shouldReconnect = false;
6059
+ subscribers = /* @__PURE__ */ new Set();
6060
+ addSubscriber(subscriber) {
6061
+ if (this.destroyed) {
6062
+ throw new Error(`Chat stream '${this.chatId}' is closed`);
6063
+ }
6064
+ this.subscribers.add(subscriber);
6065
+ if (!this.shouldReconnect) {
6066
+ this.shouldReconnect = true;
6067
+ void this.doConnect();
6068
+ }
6069
+ }
6070
+ removeSubscriber(subscriber) {
6071
+ this.subscribers.delete(subscriber);
6072
+ if (this.subscribers.size === 0) {
6073
+ this.close();
6074
+ }
6075
+ }
6076
+ close(error) {
6077
+ this.shouldReconnect = false;
6078
+ this.destroyed = true;
6079
+ if (this.reconnectTimer) {
6080
+ clearTimeout(this.reconnectTimer);
6081
+ this.reconnectTimer = void 0;
6082
+ }
6083
+ if (this.abortController) {
6084
+ this.abortController.abort();
6085
+ this.abortController = void 0;
6086
+ }
6087
+ for (const subscriber of Array.from(this.subscribers)) {
6088
+ subscriber.finish(error);
6089
+ }
6090
+ this.subscribers.clear();
6091
+ this.onEmpty(this.chatId, this);
6092
+ }
6093
+ get isDestroyed() {
6094
+ return this.destroyed;
6095
+ }
6096
+ async doConnect() {
6097
+ if (!this.shouldReconnect || this.destroyed || this.subscribers.size === 0) {
6098
+ return;
6099
+ }
6100
+ this.abortController = new AbortController();
6101
+ try {
6102
+ const forceRefresh = this.needsForceRefresh;
6103
+ this.needsForceRefresh = false;
6104
+ const token = await this.options.getToken(forceRefresh ? { forceRefresh: true } : void 0);
6105
+ const url = new URL(`${this.options.baseUrl}/${encodeURIComponent(this.chatId)}/stream`);
6106
+ if (this.lastEventId) {
6107
+ url.searchParams.set("lastEventId", this.lastEventId);
6108
+ }
6109
+ const response = await fetch(url.toString(), {
6110
+ method: "GET",
6111
+ headers: {
6112
+ Accept: "text/event-stream",
6113
+ Authorization: `Bearer ${token}`,
6114
+ "Cache-Control": "no-cache",
6115
+ ...this.lastEventId ? { "Last-Event-ID": this.lastEventId } : {}
6116
+ },
6117
+ signal: this.abortController.signal
6118
+ });
6119
+ if (!response.ok) {
6120
+ if (response.status === 401 || response.status === 403) {
6121
+ throw new AuthChatStreamError(response.status);
6122
+ }
6123
+ throw new Error(`Chat stream connection failed: ${response.status} ${response.statusText}`);
6124
+ }
6125
+ if (!response.body) {
6126
+ throw new Error("Chat stream response has no body");
6127
+ }
6128
+ this.consecutiveAuthFailures = 0;
6129
+ this.reconnectDelay = INITIAL_RECONNECT_DELAY_MS;
6130
+ await this.parseSseStream(response.body, this.abortController.signal);
6131
+ } catch (error) {
6132
+ if (error.name === "AbortError") {
6133
+ return;
6134
+ }
6135
+ if (!this.shouldReconnect || this.destroyed || this.subscribers.size === 0) {
6136
+ return;
6137
+ }
6138
+ const isAuthError2 = error instanceof AuthChatStreamError;
6139
+ if (isAuthError2) {
6140
+ this.consecutiveAuthFailures += 1;
6141
+ if (this.consecutiveAuthFailures >= MAX_CONSECUTIVE_AUTH_FAILURES) {
6142
+ const authError = new DvinaAuthenticationError("Chat SSE stream authentication failed permanently");
6143
+ this.options.onError?.(authError);
6144
+ this.close(authError);
6145
+ return;
6146
+ }
6147
+ this.needsForceRefresh = true;
6148
+ }
6149
+ const delay = isAuthError2 ? INITIAL_RECONNECT_DELAY_MS : this.reconnectDelay;
6150
+ this.scheduleReconnect(delay);
6151
+ if (!isAuthError2) {
6152
+ this.reconnectDelay = Math.min(
6153
+ this.reconnectDelay * RECONNECT_BACKOFF_MULTIPLIER,
6154
+ MAX_RECONNECT_DELAY_MS
6155
+ );
6156
+ }
6157
+ }
6158
+ }
6159
+ async parseSseStream(body, signal) {
6160
+ const reader = body.getReader();
6161
+ const decoder = new TextDecoder();
6162
+ let buffer = "";
6163
+ try {
6164
+ while (!signal.aborted && this.shouldReconnect && !this.destroyed) {
6165
+ const { done, value } = await reader.read();
6166
+ if (done) {
6167
+ break;
6168
+ }
6169
+ buffer += decoder.decode(value, { stream: true });
6170
+ const parts = buffer.split(/(?:\r\n|\r|\n){2}/);
6171
+ buffer = parts.pop() ?? "";
6172
+ for (const part of parts) {
6173
+ this.processEventBlock(part.trim());
6174
+ }
6175
+ }
6176
+ } finally {
6177
+ reader.releaseLock();
6178
+ }
6179
+ if (this.shouldReconnect && !this.destroyed && this.subscribers.size > 0) {
6180
+ this.scheduleReconnect(this.reconnectDelay);
6181
+ }
6182
+ }
6183
+ processEventBlock(block) {
6184
+ if (!block || block.startsWith(":")) {
6185
+ return;
6186
+ }
6187
+ let eventId;
6188
+ let eventType;
6189
+ const dataLines = [];
6190
+ for (const line of block.split(/\r\n|\r|\n/)) {
6191
+ if (line.startsWith("id: ")) {
6192
+ eventId = line.slice(4).trim();
6193
+ } else if (line.startsWith("event: ")) {
6194
+ eventType = line.slice(7).trim();
6195
+ } else if (line.startsWith("data: ")) {
6196
+ dataLines.push(line.slice(6));
6197
+ }
6198
+ }
6199
+ if (eventType === "token-expired") {
6200
+ this.needsForceRefresh = true;
6201
+ return;
6202
+ }
6203
+ if (!eventId || dataLines.length === 0) {
6204
+ return;
6205
+ }
6206
+ this.lastEventId = eventId;
6207
+ try {
6208
+ const payload = JSON.parse(dataLines.join("\n"));
6209
+ this.push(payload);
6210
+ } catch {
6211
+ }
6212
+ }
6213
+ push(value) {
6214
+ for (const subscriber of this.subscribers) {
6215
+ subscriber.push(value);
6216
+ }
6217
+ }
6218
+ scheduleReconnect(delay) {
6219
+ if (!this.shouldReconnect || this.destroyed || this.subscribers.size === 0) {
6220
+ return;
6221
+ }
6222
+ if (this.reconnectTimer) {
6223
+ clearTimeout(this.reconnectTimer);
6224
+ }
6225
+ this.reconnectTimer = setTimeout(() => {
6226
+ this.reconnectTimer = void 0;
6227
+ void this.doConnect();
6228
+ }, delay);
6229
+ }
6230
+ };
6231
+ var ActiveChatStreamConnection = class {
6232
+ constructor(options, onEmpty) {
6233
+ this.options = options;
6234
+ this.onEmpty = onEmpty;
6235
+ }
6236
+ abortController;
6237
+ consecutiveAuthFailures = 0;
6238
+ destroyed = false;
6239
+ needsForceRefresh = false;
6240
+ reconnectDelay = INITIAL_RECONNECT_DELAY_MS;
6241
+ reconnectTimer;
6242
+ shouldReconnect = false;
6243
+ subscribers = /* @__PURE__ */ new Set();
6244
+ addSubscriber(subscriber) {
6245
+ if (this.destroyed) {
6246
+ throw new Error("Active chat stream is closed");
6247
+ }
6248
+ this.subscribers.add(subscriber);
6249
+ if (!this.shouldReconnect) {
6250
+ this.shouldReconnect = true;
6251
+ void this.doConnect();
6252
+ }
6253
+ }
6254
+ removeSubscriber(subscriber) {
6255
+ this.subscribers.delete(subscriber);
6256
+ if (this.subscribers.size === 0) {
6257
+ this.close();
6258
+ }
6259
+ }
6260
+ close(error) {
6261
+ this.shouldReconnect = false;
6262
+ this.destroyed = true;
6263
+ if (this.reconnectTimer) {
6264
+ clearTimeout(this.reconnectTimer);
6265
+ this.reconnectTimer = void 0;
6266
+ }
6267
+ if (this.abortController) {
6268
+ this.abortController.abort();
6269
+ this.abortController = void 0;
6270
+ }
6271
+ for (const subscriber of Array.from(this.subscribers)) {
6272
+ subscriber.finish(error);
6273
+ }
6274
+ this.subscribers.clear();
6275
+ this.onEmpty(this);
6276
+ }
6277
+ get isDestroyed() {
6278
+ return this.destroyed;
6279
+ }
6280
+ async doConnect() {
6281
+ if (!this.shouldReconnect || this.destroyed || this.subscribers.size === 0) {
6282
+ return;
6283
+ }
6284
+ this.abortController = new AbortController();
6285
+ try {
6286
+ const forceRefresh = this.needsForceRefresh;
6287
+ this.needsForceRefresh = false;
6288
+ const token = await this.options.getToken(forceRefresh ? { forceRefresh: true } : void 0);
6289
+ const response = await fetch(new URL(`${this.options.baseUrl}/active`).toString(), {
6290
+ method: "GET",
6291
+ headers: {
6292
+ Accept: "text/event-stream",
6293
+ Authorization: `Bearer ${token}`,
6294
+ "Cache-Control": "no-cache"
6295
+ },
6296
+ signal: this.abortController.signal
6297
+ });
6298
+ if (!response.ok) {
6299
+ if (response.status === 401 || response.status === 403) {
6300
+ throw new AuthChatStreamError(response.status);
6301
+ }
6302
+ throw new Error(`Active chat stream connection failed: ${response.status} ${response.statusText}`);
6303
+ }
6304
+ if (!response.body) {
6305
+ throw new Error("Active chat stream response has no body");
6306
+ }
6307
+ this.consecutiveAuthFailures = 0;
6308
+ this.reconnectDelay = INITIAL_RECONNECT_DELAY_MS;
6309
+ await this.parseSseStream(response.body, this.abortController.signal);
6310
+ } catch (error) {
6311
+ if (error.name === "AbortError") {
6312
+ return;
6313
+ }
6314
+ if (!this.shouldReconnect || this.destroyed || this.subscribers.size === 0) {
6315
+ return;
6316
+ }
6317
+ const isAuthError2 = error instanceof AuthChatStreamError;
6318
+ if (isAuthError2) {
6319
+ this.consecutiveAuthFailures += 1;
6320
+ if (this.consecutiveAuthFailures >= MAX_CONSECUTIVE_AUTH_FAILURES) {
6321
+ const authError = new DvinaAuthenticationError(
6322
+ "Active chat SSE stream authentication failed permanently"
6323
+ );
6324
+ this.options.onError?.(authError);
6325
+ this.close(authError);
6326
+ return;
6327
+ }
6328
+ this.needsForceRefresh = true;
6329
+ }
6330
+ const delay = isAuthError2 ? INITIAL_RECONNECT_DELAY_MS : this.reconnectDelay;
6331
+ this.scheduleReconnect(delay);
6332
+ if (!isAuthError2) {
6333
+ this.reconnectDelay = Math.min(
6334
+ this.reconnectDelay * RECONNECT_BACKOFF_MULTIPLIER,
6335
+ MAX_RECONNECT_DELAY_MS
6336
+ );
6337
+ }
6338
+ }
6339
+ }
6340
+ async parseSseStream(body, signal) {
6341
+ const reader = body.getReader();
6342
+ const decoder = new TextDecoder();
6343
+ let buffer = "";
6344
+ try {
6345
+ while (!signal.aborted && this.shouldReconnect && !this.destroyed) {
6346
+ const { done, value } = await reader.read();
6347
+ if (done) {
6348
+ break;
6349
+ }
6350
+ buffer += decoder.decode(value, { stream: true });
6351
+ const parts = buffer.split(/(?:\r\n|\r|\n){2}/);
6352
+ buffer = parts.pop() ?? "";
6353
+ for (const part of parts) {
6354
+ this.processEventBlock(part.trim());
6355
+ }
6356
+ }
6357
+ } finally {
6358
+ reader.releaseLock();
6359
+ }
6360
+ if (this.shouldReconnect && !this.destroyed && this.subscribers.size > 0) {
6361
+ this.scheduleReconnect(this.reconnectDelay);
6362
+ }
6363
+ }
6364
+ processEventBlock(block) {
6365
+ if (!block || block.startsWith(":")) {
6366
+ return;
6367
+ }
6368
+ let eventType;
6369
+ const dataLines = [];
6370
+ for (const line of block.split(/\r\n|\r|\n/)) {
6371
+ if (line.startsWith("event: ")) {
6372
+ eventType = line.slice(7).trim();
6373
+ } else if (line.startsWith("data: ")) {
6374
+ dataLines.push(line.slice(6));
6375
+ }
6376
+ }
6377
+ if (eventType === "token-expired") {
6378
+ this.needsForceRefresh = true;
6379
+ return;
6380
+ }
6381
+ if (eventType !== "active" || dataLines.length === 0) {
6382
+ return;
6383
+ }
6384
+ try {
6385
+ const payload = JSON.parse(dataLines.join("\n"));
6386
+ if (!Array.isArray(payload) || payload.some((chatId) => typeof chatId !== "string")) {
6387
+ return;
6388
+ }
6389
+ this.push(payload);
6390
+ } catch {
6391
+ }
6392
+ }
6393
+ push(value) {
6394
+ for (const subscriber of this.subscribers) {
6395
+ subscriber.push(value);
6396
+ }
6397
+ }
6398
+ scheduleReconnect(delay) {
6399
+ if (!this.shouldReconnect || this.destroyed || this.subscribers.size === 0) {
6400
+ return;
6401
+ }
6402
+ if (this.reconnectTimer) {
6403
+ clearTimeout(this.reconnectTimer);
6404
+ }
6405
+ this.reconnectTimer = setTimeout(() => {
6406
+ this.reconnectTimer = void 0;
6407
+ void this.doConnect();
6408
+ }, delay);
6409
+ }
6410
+ };
6411
+ function createChatStreamClient(options) {
6412
+ const connections = /* @__PURE__ */ new Map();
6413
+ let activeConnection;
6414
+ function getConnection(chatId) {
6415
+ const existing = connections.get(chatId);
6416
+ if (existing && !existing.isDestroyed) {
6417
+ return existing;
6418
+ }
6419
+ const connection = new ChatStreamConnection(chatId, options, (emptyChatId, currentConnection) => {
6420
+ if (connections.get(emptyChatId) === currentConnection) {
6421
+ connections.delete(emptyChatId);
6422
+ }
6423
+ });
6424
+ connections.set(chatId, connection);
6425
+ return connection;
6426
+ }
6427
+ function getActiveConnection() {
6428
+ if (activeConnection && !activeConnection.isDestroyed) {
6429
+ return activeConnection;
6430
+ }
6431
+ activeConnection = new ActiveChatStreamConnection(options, (currentConnection) => {
6432
+ if (activeConnection === currentConnection) {
6433
+ activeConnection = void 0;
6434
+ }
6435
+ });
6436
+ return activeConnection;
6437
+ }
6438
+ function stream(chatId) {
6439
+ return {
6440
+ [Symbol.asyncIterator]() {
6441
+ const connection = getConnection(chatId);
6442
+ const queue = [];
6443
+ let done = false;
6444
+ let pending = null;
6445
+ let terminalError;
6446
+ const subscriber = {
6447
+ finish(error) {
6448
+ if (done) {
6449
+ return;
6450
+ }
6451
+ done = true;
6452
+ terminalError = error;
6453
+ if (pending) {
6454
+ if (error) {
6455
+ pending.reject(error);
6456
+ } else {
6457
+ pending.resolve({ value: void 0, done: true });
6458
+ }
6459
+ pending = null;
6460
+ }
6461
+ },
6462
+ push(value) {
6463
+ if (done) {
6464
+ return;
6465
+ }
6466
+ if (pending) {
6467
+ pending.resolve({ value, done: false });
6468
+ pending = null;
6469
+ return;
6470
+ }
6471
+ queue.push(value);
6472
+ }
6473
+ };
6474
+ connection.addSubscriber(subscriber);
6475
+ return {
6476
+ async next() {
6477
+ if (queue.length > 0) {
6478
+ return { value: queue.shift(), done: false };
6479
+ }
6480
+ if (done) {
6481
+ if (terminalError) {
6482
+ throw terminalError;
6483
+ }
6484
+ return { value: void 0, done: true };
6485
+ }
6486
+ return new Promise((resolve, reject) => {
6487
+ pending = { resolve, reject };
6488
+ });
6489
+ },
6490
+ async return() {
6491
+ done = true;
6492
+ connection.removeSubscriber(subscriber);
6493
+ if (pending) {
6494
+ pending.resolve({ value: void 0, done: true });
6495
+ pending = null;
6496
+ }
6497
+ return { value: void 0, done: true };
6498
+ },
6499
+ [Symbol.asyncIterator]() {
6500
+ return this;
6501
+ }
6502
+ };
6503
+ }
6504
+ };
6505
+ }
6506
+ function listen(chatId, handlers) {
6507
+ const iterator = stream(chatId)[Symbol.asyncIterator]();
6508
+ let stopped = false;
6509
+ let cleanupStarted = false;
6510
+ const cleanup = () => {
6511
+ if (cleanupStarted) {
6512
+ return;
6513
+ }
6514
+ cleanupStarted = true;
6515
+ if (typeof iterator.return === "function") {
6516
+ void iterator.return().catch(() => void 0);
6517
+ }
6518
+ };
6519
+ void (async () => {
6520
+ try {
6521
+ while (!stopped) {
6522
+ const result = await iterator.next();
6523
+ if (result.done || stopped) {
6524
+ break;
6525
+ }
6526
+ handlers.next(result.value);
6527
+ }
6528
+ } catch (error) {
6529
+ if (!stopped) {
6530
+ handlers.error?.(error);
6531
+ }
6532
+ } finally {
6533
+ cleanup();
6534
+ }
6535
+ })();
6536
+ return {
6537
+ chatId,
6538
+ stop() {
6539
+ if (stopped) {
6540
+ return;
6541
+ }
6542
+ stopped = true;
6543
+ cleanup();
6544
+ }
6545
+ };
6546
+ }
6547
+ function listenActive(handlers) {
6548
+ const connection = getActiveConnection();
6549
+ let stopped = false;
6550
+ const subscriber = {
6551
+ finish(error) {
6552
+ if (stopped) {
6553
+ return;
6554
+ }
6555
+ stopped = true;
6556
+ if (error) {
6557
+ handlers.error?.(error);
6558
+ }
6559
+ },
6560
+ push(value) {
6561
+ if (stopped) {
6562
+ return;
6563
+ }
6564
+ handlers.next(value);
6565
+ }
6566
+ };
6567
+ connection.addSubscriber(subscriber);
6568
+ return {
6569
+ stop() {
6570
+ if (stopped) {
6571
+ return;
6572
+ }
6573
+ stopped = true;
6574
+ connection.removeSubscriber(subscriber);
6575
+ }
6576
+ };
6577
+ }
6578
+ function destroy() {
6579
+ for (const connection of Array.from(connections.values())) {
6580
+ connection.close();
6581
+ }
6582
+ connections.clear();
6583
+ activeConnection?.close();
6584
+ activeConnection = void 0;
6585
+ }
6586
+ return {
6587
+ active: {
6588
+ listen: listenActive
6589
+ },
6590
+ listen,
6591
+ stream,
6592
+ destroy
6593
+ };
6594
+ }
6595
+
6033
6596
  // ../../node_modules/.pnpm/graphql-ws@6.0.7_graphql@16.9.0_ws@8.19.0/node_modules/graphql-ws/dist/common-CGW11Fyb.js
6034
6597
  function extendedTypeof(val) {
6035
6598
  if (val === null) {
@@ -6996,11 +7559,13 @@ function createWsTransport(options) {
6996
7559
  }
6997
7560
 
6998
7561
  // src/_generated_store.ts
6999
- var SCHEMA_HASH = "af30ecb1b8024d35";
7562
+ var SCHEMA_HASH = "a5a8b191f68c634e";
7000
7563
  var DB_ENTITY_SCHEMA = {
7001
7564
  actions: "id",
7002
7565
  agents: "id",
7003
7566
  artifacts: "id",
7567
+ candidateEvidences: "id",
7568
+ candidates: "id",
7004
7569
  chatMessages: "id",
7005
7570
  chats: "id",
7006
7571
  contentBlocks: "id",
@@ -7014,6 +7579,8 @@ var DB_ENTITY_SCHEMA = {
7014
7579
  documentContents: "id",
7015
7580
  documentFormats: "key",
7016
7581
  documents: "id",
7582
+ evidences: "id",
7583
+ failedSyncEventIngestions: "id",
7017
7584
  feedArtifactDatas: "id",
7018
7585
  feedback: "id, &chatMessageId",
7019
7586
  feedDatabaseDatas: "id",
@@ -7021,6 +7588,7 @@ var DB_ENTITY_SCHEMA = {
7021
7588
  feedIntegrationDatas: "id",
7022
7589
  feedItemGenerateds: "id",
7023
7590
  feedItems: "id",
7591
+ feedLiveContextDatas: "id",
7024
7592
  feedPulseDatas: "id",
7025
7593
  feedSendMessageActions: "id",
7026
7594
  files: "id",
@@ -7032,6 +7600,7 @@ var DB_ENTITY_SCHEMA = {
7032
7600
  integrations: "id",
7033
7601
  interpretations: "id",
7034
7602
  invocations: "id",
7603
+ liveContexts: "id",
7035
7604
  mcpClientInformations: "id",
7036
7605
  mcpCodeVerifiers: "id",
7037
7606
  mcpServers: "id",
@@ -7046,6 +7615,8 @@ var DB_ENTITY_SCHEMA = {
7046
7615
  reportMembers: "[reportId+insightId]",
7047
7616
  reports: "id",
7048
7617
  resolvedFileUrls: "id",
7618
+ streamEventSchemaAnchors: "id",
7619
+ syncEventCursors: "id",
7049
7620
  syncEvents: "id",
7050
7621
  tables: "id",
7051
7622
  tokenUsages: "id",
@@ -7060,6 +7631,8 @@ var TYPENAME_TO_TABLE = {
7060
7631
  Action: "actions",
7061
7632
  Agent: "agents",
7062
7633
  Artifact: "artifacts",
7634
+ Candidate: "candidates",
7635
+ CandidateEvidence: "candidateEvidences",
7063
7636
  Chat: "chats",
7064
7637
  ChatMessage: "chatMessages",
7065
7638
  ContentBlock: "contentBlocks",
@@ -7073,6 +7646,8 @@ var TYPENAME_TO_TABLE = {
7073
7646
  DocumentCatalog: "documentCatalogs",
7074
7647
  DocumentContent: "documentContents",
7075
7648
  DocumentFormat: "documentFormats",
7649
+ Evidence: "evidences",
7650
+ FailedSyncEventIngestion: "failedSyncEventIngestions",
7076
7651
  FeedArtifactData: "feedArtifactDatas",
7077
7652
  Feedback: "feedback",
7078
7653
  FeedDatabaseData: "feedDatabaseDatas",
@@ -7080,6 +7655,7 @@ var TYPENAME_TO_TABLE = {
7080
7655
  FeedIntegrationData: "feedIntegrationDatas",
7081
7656
  FeedItem: "feedItems",
7082
7657
  FeedItemGenerated: "feedItemGenerateds",
7658
+ FeedLiveContextData: "feedLiveContextDatas",
7083
7659
  FeedPulseData: "feedPulseDatas",
7084
7660
  FeedSendMessageAction: "feedSendMessageActions",
7085
7661
  File: "files",
@@ -7091,6 +7667,7 @@ var TYPENAME_TO_TABLE = {
7091
7667
  IntegrationProvider: "integrationProviders",
7092
7668
  Interpretation: "interpretations",
7093
7669
  Invocation: "invocations",
7670
+ LiveContext: "liveContexts",
7094
7671
  McpClientInformation: "mcpClientInformations",
7095
7672
  McpCodeVerifier: "mcpCodeVerifiers",
7096
7673
  McpServer: "mcpServers",
@@ -7105,7 +7682,9 @@ var TYPENAME_TO_TABLE = {
7105
7682
  Report: "reports",
7106
7683
  ReportMember: "reportMembers",
7107
7684
  ResolvedFileUrl: "resolvedFileUrls",
7685
+ StreamEventSchemaAnchor: "streamEventSchemaAnchors",
7108
7686
  SyncEvent: "syncEvents",
7687
+ SyncEventCursor: "syncEventCursors",
7109
7688
  Table: "tables",
7110
7689
  TokenUsage: "tokenUsages",
7111
7690
  UsageWindowsStatusType: "usageWindowsStatusTypes",
@@ -7119,6 +7698,8 @@ var TABLE_TO_TYPENAME = {
7119
7698
  actions: "Action",
7120
7699
  agents: "Agent",
7121
7700
  artifacts: "Artifact",
7701
+ candidateEvidences: "CandidateEvidence",
7702
+ candidates: "Candidate",
7122
7703
  chatMessages: "ChatMessage",
7123
7704
  chats: "Chat",
7124
7705
  contentBlocks: "ContentBlock",
@@ -7132,6 +7713,8 @@ var TABLE_TO_TYPENAME = {
7132
7713
  documentContents: "DocumentContent",
7133
7714
  documentFormats: "DocumentFormat",
7134
7715
  documents: "Document",
7716
+ evidences: "Evidence",
7717
+ failedSyncEventIngestions: "FailedSyncEventIngestion",
7135
7718
  feedArtifactDatas: "FeedArtifactData",
7136
7719
  feedback: "Feedback",
7137
7720
  feedDatabaseDatas: "FeedDatabaseData",
@@ -7139,6 +7722,7 @@ var TABLE_TO_TYPENAME = {
7139
7722
  feedIntegrationDatas: "FeedIntegrationData",
7140
7723
  feedItemGenerateds: "FeedItemGenerated",
7141
7724
  feedItems: "FeedItem",
7725
+ feedLiveContextDatas: "FeedLiveContextData",
7142
7726
  feedPulseDatas: "FeedPulseData",
7143
7727
  feedSendMessageActions: "FeedSendMessageAction",
7144
7728
  files: "File",
@@ -7150,6 +7734,7 @@ var TABLE_TO_TYPENAME = {
7150
7734
  integrations: "Integration",
7151
7735
  interpretations: "Interpretation",
7152
7736
  invocations: "Invocation",
7737
+ liveContexts: "LiveContext",
7153
7738
  mcpClientInformations: "McpClientInformation",
7154
7739
  mcpCodeVerifiers: "McpCodeVerifier",
7155
7740
  mcpServers: "McpServer",
@@ -7164,6 +7749,8 @@ var TABLE_TO_TYPENAME = {
7164
7749
  reportMembers: "ReportMember",
7165
7750
  reports: "Report",
7166
7751
  resolvedFileUrls: "ResolvedFileUrl",
7752
+ streamEventSchemaAnchors: "StreamEventSchemaAnchor",
7753
+ syncEventCursors: "SyncEventCursor",
7167
7754
  syncEvents: "SyncEvent",
7168
7755
  tables: "Table",
7169
7756
  tokenUsages: "TokenUsage",
@@ -7217,6 +7804,7 @@ var MUTATION_CACHE_RULES = {
7217
7804
  updateDocument: { type: "update", entityType: "documents" },
7218
7805
  updateFolder: { type: "update", entityType: "folders" },
7219
7806
  updateInsight: { type: "update", entityType: "insights" },
7807
+ updateLiveContext: { type: "update", entityType: "liveContexts" },
7220
7808
  updateReport: { type: "update", entityType: "reports" },
7221
7809
  updateTable: { type: "update", entityType: "tables" },
7222
7810
  updateUserSkillFile: { type: "update", entityType: "userSkillFiles" },
@@ -7469,15 +8057,15 @@ var AuthSseError = class extends Error {
7469
8057
  this.name = "AuthSseError";
7470
8058
  }
7471
8059
  };
7472
- var INITIAL_RECONNECT_DELAY_MS = 1e3;
7473
- var MAX_RECONNECT_DELAY_MS = 3e4;
7474
- var RECONNECT_BACKOFF_MULTIPLIER = 2;
7475
- var MAX_CONSECUTIVE_AUTH_FAILURES = 3;
8060
+ var INITIAL_RECONNECT_DELAY_MS2 = 1e3;
8061
+ var MAX_RECONNECT_DELAY_MS2 = 3e4;
8062
+ var RECONNECT_BACKOFF_MULTIPLIER2 = 2;
8063
+ var MAX_CONSECUTIVE_AUTH_FAILURES2 = 3;
7476
8064
  var SUBSCRIPTION_REFRESH_INTERVAL_MS = 5 * 60 * 1e3;
7477
8065
  function createSseTransport(options) {
7478
8066
  let abortController;
7479
8067
  let isConnected = false;
7480
- let reconnectDelay = INITIAL_RECONNECT_DELAY_MS;
8068
+ let reconnectDelay = INITIAL_RECONNECT_DELAY_MS2;
7481
8069
  let reconnectTimer;
7482
8070
  let refreshTimer;
7483
8071
  let shouldReconnect = false;
@@ -7524,7 +8112,7 @@ function createSseTransport(options) {
7524
8112
  }
7525
8113
  isConnected = true;
7526
8114
  consecutiveAuthFailures = 0;
7527
- reconnectDelay = INITIAL_RECONNECT_DELAY_MS;
8115
+ reconnectDelay = INITIAL_RECONNECT_DELAY_MS2;
7528
8116
  options.onStateChange?.("connected");
7529
8117
  const isReconnect = hasConnectedOnce;
7530
8118
  hasConnectedOnce = true;
@@ -7545,18 +8133,18 @@ function createSseTransport(options) {
7545
8133
  const isAuth = err instanceof AuthSseError;
7546
8134
  if (isAuth) {
7547
8135
  consecutiveAuthFailures++;
7548
- if (consecutiveAuthFailures >= MAX_CONSECUTIVE_AUTH_FAILURES) {
8136
+ if (consecutiveAuthFailures >= MAX_CONSECUTIVE_AUTH_FAILURES2) {
7549
8137
  disconnect();
7550
8138
  return;
7551
8139
  }
7552
8140
  needsForceRefresh = true;
7553
8141
  }
7554
- const delay = isAuth ? INITIAL_RECONNECT_DELAY_MS : reconnectDelay;
8142
+ const delay = isAuth ? INITIAL_RECONNECT_DELAY_MS2 : reconnectDelay;
7555
8143
  reconnectTimer = setTimeout(() => {
7556
8144
  doConnect();
7557
8145
  }, delay);
7558
8146
  if (!isAuth) {
7559
- reconnectDelay = Math.min(reconnectDelay * RECONNECT_BACKOFF_MULTIPLIER, MAX_RECONNECT_DELAY_MS);
8147
+ reconnectDelay = Math.min(reconnectDelay * RECONNECT_BACKOFF_MULTIPLIER2, MAX_RECONNECT_DELAY_MS2);
7560
8148
  }
7561
8149
  }
7562
8150
  }
@@ -8082,6 +8670,28 @@ function flattenEntity(data) {
8082
8670
  }
8083
8671
  return result;
8084
8672
  }
8673
+ function isPlainObject(value) {
8674
+ return Object.prototype.toString.call(value) === "[object Object]";
8675
+ }
8676
+ function areRecordValuesEqual(left, right) {
8677
+ if (Object.is(left, right)) {
8678
+ return true;
8679
+ }
8680
+ if (left instanceof Date && right instanceof Date) {
8681
+ return left.getTime() === right.getTime();
8682
+ }
8683
+ if (Array.isArray(left) && Array.isArray(right)) {
8684
+ return left.length === right.length && left.every((value, index) => areRecordValuesEqual(value, right[index]));
8685
+ }
8686
+ if (isPlainObject(left) && isPlainObject(right)) {
8687
+ const leftKeys = Object.keys(left);
8688
+ const rightKeys = Object.keys(right);
8689
+ return leftKeys.length === rightKeys.length && leftKeys.every(
8690
+ (key) => Object.prototype.hasOwnProperty.call(right, key) && areRecordValuesEqual(left[key], right[key])
8691
+ );
8692
+ }
8693
+ return false;
8694
+ }
8085
8695
  function normalize(data, rootField) {
8086
8696
  const entities = /* @__PURE__ */ new Map();
8087
8697
  const nestedConnections = /* @__PURE__ */ new Map();
@@ -8192,33 +8802,73 @@ function extractEntity(data, entities, nestedConnections) {
8192
8802
  }
8193
8803
  }
8194
8804
  function mergeEntityRecord(existing, incoming) {
8195
- const result = { ...existing };
8805
+ let result;
8196
8806
  for (const [key, value] of Object.entries(incoming)) {
8197
- if (value !== void 0) {
8198
- result[key] = value;
8807
+ if (value === void 0) {
8808
+ continue;
8199
8809
  }
8810
+ if (Object.prototype.hasOwnProperty.call(existing, key) && areRecordValuesEqual(existing[key], value)) {
8811
+ continue;
8812
+ }
8813
+ result ??= { ...existing };
8814
+ result[key] = value;
8200
8815
  }
8201
- return result;
8816
+ return result ?? existing;
8202
8817
  }
8203
8818
 
8204
8819
  // src/store/cache-manager.ts
8820
+ var QUERY_FRESHNESS_KEY_PREFIX = "queryFreshness:";
8821
+ function getQueryFreshnessKey(queryKey) {
8822
+ return `${QUERY_FRESHNESS_KEY_PREFIX}${queryKey}`;
8823
+ }
8824
+ function areArraysEqual(left, right) {
8825
+ return left.length === right.length && left.every((value, index) => value === right[index]);
8826
+ }
8827
+ function arePageInfosEqual(left, right) {
8828
+ if (left === right) {
8829
+ return true;
8830
+ }
8831
+ if (!left || !right) {
8832
+ return left === right;
8833
+ }
8834
+ return left.hasNextPage === right.hasNextPage && left.hasPreviousPage === right.hasPreviousPage && left.startCursor === right.startCursor && left.endCursor === right.endCursor;
8835
+ }
8836
+ function hasSameQueryResultContents(existing, incoming) {
8837
+ return existing.entityType === incoming.entityType && areArraysEqual(existing.entityIds, incoming.entityIds) && arePageInfosEqual(existing.pageInfo, incoming.pageInfo) && existing.totalCount === incoming.totalCount;
8838
+ }
8205
8839
  var CacheManager = class {
8206
8840
  constructor(_db) {
8207
8841
  this._db = _db;
8208
8842
  }
8843
+ async _touchQueryFreshness(queryKey, fetchedAt = Date.now()) {
8844
+ await this._db._sync.put({ key: getQueryFreshnessKey(queryKey), value: fetchedAt });
8845
+ }
8846
+ async getQueryFetchedAt(queryKey, fallback) {
8847
+ const freshness = await this._db._sync.get(getQueryFreshnessKey(queryKey));
8848
+ return typeof freshness?.value === "number" ? freshness.value : fallback?.fetchedAt;
8849
+ }
8209
8850
  /**
8210
8851
  * Write connection metadata to the `_queryResults` table.
8211
8852
  */
8212
8853
  async writeQueryResult(queryKey, connection) {
8854
+ const fetchedAt = Date.now();
8855
+ const existing = await this._db._queryResults.get(queryKey);
8856
+ if (existing && hasSameQueryResultContents(existing, connection)) {
8857
+ await this._touchQueryFreshness(queryKey, fetchedAt);
8858
+ return;
8859
+ }
8213
8860
  const entry = {
8214
8861
  key: queryKey,
8215
8862
  entityType: connection.entityType,
8216
8863
  entityIds: connection.entityIds,
8217
8864
  pageInfo: connection.pageInfo,
8218
8865
  totalCount: connection.totalCount,
8219
- fetchedAt: Date.now()
8866
+ fetchedAt
8220
8867
  };
8221
- await this._db._queryResults.put(entry);
8868
+ await this._db.transaction("rw", [this._db._queryResults, this._db._sync], async () => {
8869
+ await this._db._queryResults.put(entry);
8870
+ await this._touchQueryFreshness(queryKey, fetchedAt);
8871
+ });
8222
8872
  }
8223
8873
  /**
8224
8874
  * Append new page results to an existing query result entry.
@@ -8227,13 +8877,24 @@ var CacheManager = class {
8227
8877
  async appendQueryResult(queryKey, connection) {
8228
8878
  const existing = await this._db._queryResults.get(queryKey);
8229
8879
  if (existing) {
8880
+ const fetchedAt = Date.now();
8230
8881
  const existingIds = new Set(existing.entityIds);
8231
8882
  const newIds = connection.entityIds.filter((id) => !existingIds.has(id));
8232
- existing.entityIds = [...existing.entityIds, ...newIds];
8233
- existing.pageInfo = connection.pageInfo ?? existing.pageInfo;
8234
- existing.totalCount = connection.totalCount ?? existing.totalCount;
8235
- existing.fetchedAt = Date.now();
8236
- await this._db._queryResults.put(existing);
8883
+ const nextEntityIds = newIds.length > 0 ? [...existing.entityIds, ...newIds] : existing.entityIds;
8884
+ const nextPageInfo = connection.pageInfo ?? existing.pageInfo;
8885
+ const nextTotalCount = connection.totalCount ?? existing.totalCount;
8886
+ if (areArraysEqual(existing.entityIds, nextEntityIds) && arePageInfosEqual(existing.pageInfo, nextPageInfo) && existing.totalCount === nextTotalCount) {
8887
+ await this._touchQueryFreshness(queryKey, fetchedAt);
8888
+ return;
8889
+ }
8890
+ existing.entityIds = nextEntityIds;
8891
+ existing.pageInfo = nextPageInfo;
8892
+ existing.totalCount = nextTotalCount;
8893
+ existing.fetchedAt = fetchedAt;
8894
+ await this._db.transaction("rw", [this._db._queryResults, this._db._sync], async () => {
8895
+ await this._db._queryResults.put(existing);
8896
+ await this._touchQueryFreshness(queryKey, fetchedAt);
8897
+ });
8237
8898
  } else {
8238
8899
  await this.writeQueryResult(queryKey, connection);
8239
8900
  }
@@ -8250,7 +8911,10 @@ var CacheManager = class {
8250
8911
  */
8251
8912
  async invalidateQuery(operationName, variables) {
8252
8913
  const key = buildQueryKey(operationName, variables);
8253
- await this._db._queryResults.delete(key);
8914
+ await this._db.transaction("rw", [this._db._queryResults, this._db._sync], async () => {
8915
+ await this._db._queryResults.delete(key);
8916
+ await this._db._sync.delete(getQueryFreshnessKey(key));
8917
+ });
8254
8918
  }
8255
8919
  /**
8256
8920
  * Remove an entity ID from all query results for a given entity type.
@@ -8536,7 +9200,8 @@ var QueryExecutor = class {
8536
9200
  try {
8537
9201
  const result = await buildResult(this._db);
8538
9202
  ref._markInitialized(result);
8539
- if (Date.now() - cached.fetchedAt > CACHE_TTL_MS) {
9203
+ const fetchedAt = await this._cache.getQueryFetchedAt(queryKey, cached);
9204
+ if (!fetchedAt || Date.now() - fetchedAt > CACHE_TTL_MS) {
8540
9205
  this.query(document2, variables, operationName).catch(() => {
8541
9206
  });
8542
9207
  }
@@ -8585,10 +9250,17 @@ var QueryExecutor = class {
8585
9250
  return record[pkField];
8586
9251
  });
8587
9252
  const existingRecords = await table.bulkGet(pks);
8588
- const toPut = records.map((record, i) => {
9253
+ const toPut = records.flatMap((record, i) => {
8589
9254
  const existing = existingRecords[i];
8590
- return existing ? mergeEntityRecord(existing, record) : record;
9255
+ if (!existing) {
9256
+ return [record];
9257
+ }
9258
+ const merged = mergeEntityRecord(existing, record);
9259
+ return merged === existing ? [] : [merged];
8591
9260
  });
9261
+ if (toPut.length === 0) {
9262
+ continue;
9263
+ }
8592
9264
  await table.bulkPut(toPut);
8593
9265
  }
8594
9266
  });
@@ -8708,7 +9380,9 @@ var OptimisticManager = class {
8708
9380
  const snapshot = existing ? structuredClone(existing) : void 0;
8709
9381
  if (existing) {
8710
9382
  const merged = mergeEntityRecord(existing, data);
8711
- await table.put(merged);
9383
+ if (merged !== existing) {
9384
+ await table.put(merged);
9385
+ }
8712
9386
  }
8713
9387
  return async () => {
8714
9388
  if (snapshot) {
@@ -9175,7 +9849,9 @@ var SyncEngine = class {
9175
9849
  await this._queryExecutor.writeEntities(entities);
9176
9850
  } else if (existing) {
9177
9851
  const merged = mergeEntityRecord(existing, record);
9178
- await table.put(merged);
9852
+ if (merged !== existing) {
9853
+ await table.put(merged);
9854
+ }
9179
9855
  } else {
9180
9856
  await table.put(record);
9181
9857
  }
@@ -9219,7 +9895,8 @@ var SyncEngine = class {
9219
9895
  if (!touchedAt) return;
9220
9896
  const cached = await this._db._queryResults.get(sub.queryKey);
9221
9897
  if (!cached) return;
9222
- if (cached.fetchedAt >= touchedAt) return;
9898
+ const fetchedAt = await this._cache.getQueryFetchedAt(sub.queryKey, cached);
9899
+ if ((fetchedAt ?? cached.fetchedAt) >= touchedAt) return;
9223
9900
  await this.query(sub.document, sub.variables, sub.operationName).catch(() => void 0);
9224
9901
  }
9225
9902
  async _revalidateAllActiveSubscriptions() {
@@ -9615,7 +10292,7 @@ function createLazySyncEngine(httpTransport, sseUrl, syncPolicyUrl, getToken, ge
9615
10292
  var DEFAULT_UPLOAD_CONTENT_TYPE = "application/octet-stream";
9616
10293
  var AZURE_BLOCK_BLOB_TYPE = "BlockBlob";
9617
10294
  async function uploadFile(request, getToken, file, name, options) {
9618
- const { GenerateUploadUriDocument: GenerateUploadUriDocument2 } = await import('./_generated_documents-EETCZBVL.js');
10295
+ const { GenerateUploadUriDocument: GenerateUploadUriDocument2 } = await import('./_generated_documents-3N6BQ5SR.js');
9619
10296
  const key = `upload_${Date.now()}`;
9620
10297
  const response = await request(
9621
10298
  GenerateUploadUriDocument2,
@@ -9782,6 +10459,7 @@ function createDvinaClient(options) {
9782
10459
  const httpUrl = `${httpProtocol}://${baseUrl}/graphql`;
9783
10460
  const wsUrl = `${wsProtocol}://${baseUrl}/graphql`;
9784
10461
  const sseUrl = `${httpProtocol}://${baseUrl}/api/sync/stream`;
10462
+ const chatStreamBaseUrl = `${httpProtocol}://${baseUrl}/api/chat`;
9785
10463
  const syncPolicyUrl = `${httpProtocol}://${baseUrl}/api/sync/cache-policy`;
9786
10464
  const getToken = resolveGetToken(options);
9787
10465
  const getLanguage = resolveLanguage(options.language);
@@ -9809,6 +10487,11 @@ function createDvinaClient(options) {
9809
10487
  const subscribe = (document2, variables) => {
9810
10488
  return getWsTransport().subscribe(document2, variables);
9811
10489
  };
10490
+ const chatStream = createChatStreamClient({
10491
+ baseUrl: chatStreamBaseUrl,
10492
+ getToken,
10493
+ onError: options.onError
10494
+ });
9812
10495
  let db;
9813
10496
  let dbInitPromise;
9814
10497
  function getDb() {
@@ -9841,6 +10524,7 @@ function createDvinaClient(options) {
9841
10524
  syncEngine,
9842
10525
  request,
9843
10526
  subscribe,
10527
+ chatStream,
9844
10528
  getToken,
9845
10529
  terminateWs: () => wsTransport?.terminate(),
9846
10530
  closeDb: async () => {
@@ -9903,6 +10587,124 @@ function inferTargetTables(fieldName) {
9903
10587
  return normalizedTypeName === normalizedFieldName || normalizedTypeName.endsWith(normalizedFieldName) || normalizedTableName === normalizedFieldName || normalizedTableName === `${normalizedFieldName}s`;
9904
10588
  }).map(([tableName]) => tableName);
9905
10589
  }
10590
+ function getIncludeQueryKey(parentTable, parentId, fieldName) {
10591
+ return `${parentTable}.${parentId}.${fieldName}`;
10592
+ }
10593
+ function hasNestedIncludes(include) {
10594
+ return Boolean(include.children?.length);
10595
+ }
10596
+ function canUseFlatIncludeBatch(includes) {
10597
+ return includes.length > 0 && includes.every((include) => !hasNestedIncludes(include));
10598
+ }
10599
+ function cloneEntity(entity) {
10600
+ return { ...entity };
10601
+ }
10602
+ function defaultIncludeValue(inc) {
10603
+ if (inc.isConnection) {
10604
+ return {
10605
+ __typename: "Unknown",
10606
+ nodes: [],
10607
+ pageInfo: { hasNextPage: false, hasPreviousPage: false },
10608
+ totalCount: 0
10609
+ };
10610
+ }
10611
+ if (inc.isList) {
10612
+ return [];
10613
+ }
10614
+ return null;
10615
+ }
10616
+ async function preloadFlatIncludeContext(db, parentTable, parentIds, includes) {
10617
+ const queryKeys = [];
10618
+ for (const parentId of parentIds) {
10619
+ for (const include of includes) {
10620
+ queryKeys.push(getIncludeQueryKey(parentTable, parentId, include.fieldName));
10621
+ }
10622
+ }
10623
+ const queryResults = queryKeys.length > 0 ? await db._queryResults.bulkGet(queryKeys) : [];
10624
+ const queryResultsByKey = /* @__PURE__ */ new Map();
10625
+ const childIdsByType = /* @__PURE__ */ new Map();
10626
+ for (let i = 0; i < queryKeys.length; i++) {
10627
+ const queryResult = queryResults[i];
10628
+ if (!queryResult) {
10629
+ continue;
10630
+ }
10631
+ queryResultsByKey.set(queryKeys[i], queryResult);
10632
+ let entityIds = childIdsByType.get(queryResult.entityType);
10633
+ if (!entityIds) {
10634
+ entityIds = /* @__PURE__ */ new Set();
10635
+ childIdsByType.set(queryResult.entityType, entityIds);
10636
+ }
10637
+ for (const entityId of queryResult.entityIds) {
10638
+ entityIds.add(entityId);
10639
+ }
10640
+ }
10641
+ const childEntitiesByType = /* @__PURE__ */ new Map();
10642
+ await Promise.all(
10643
+ Array.from(childIdsByType.entries()).map(async ([entityType, entityIds]) => {
10644
+ const idList = Array.from(entityIds);
10645
+ const childRecords = await db.table(entityType).bulkGet(idList.map((id) => parsePrimaryKeyString(entityType, id)));
10646
+ const childMap = /* @__PURE__ */ new Map();
10647
+ for (let i = 0; i < idList.length; i++) {
10648
+ const childRecord = childRecords[i];
10649
+ if (!childRecord || typeof childRecord !== "object") {
10650
+ continue;
10651
+ }
10652
+ childMap.set(idList[i], childRecord);
10653
+ }
10654
+ childEntitiesByType.set(entityType, childMap);
10655
+ })
10656
+ );
10657
+ return { childEntitiesByType, queryResultsByKey };
10658
+ }
10659
+ function resolveFlatChildEntities(context, queryResult) {
10660
+ const childMap = context.childEntitiesByType.get(queryResult.entityType);
10661
+ if (!childMap) {
10662
+ return [];
10663
+ }
10664
+ const children = [];
10665
+ for (const entityId of queryResult.entityIds) {
10666
+ const child = childMap.get(entityId);
10667
+ if (child) {
10668
+ children.push(child);
10669
+ }
10670
+ }
10671
+ return children;
10672
+ }
10673
+ async function reconstructFlatEntity(db, parentTable, parentEntity, parentId, includes, context) {
10674
+ const result = cloneEntity(parentEntity);
10675
+ for (const inc of includes) {
10676
+ const queryResult = context.queryResultsByKey.get(getIncludeQueryKey(parentTable, parentId, inc.fieldName));
10677
+ if (!queryResult) {
10678
+ const fallback = inc.isConnection ? void 0 : await resolveSingleRelationFallback(db, parentTable, result, inc);
10679
+ if (fallback) {
10680
+ result[inc.fieldName] = fallback.entity;
10681
+ continue;
10682
+ }
10683
+ result[inc.fieldName] = defaultIncludeValue(inc);
10684
+ continue;
10685
+ }
10686
+ const childEntities = resolveFlatChildEntities(context, queryResult);
10687
+ if (inc.isConnection) {
10688
+ result[inc.fieldName] = {
10689
+ __typename: (TABLE_TO_TYPENAME[queryResult.entityType] ?? queryResult.entityType) + "Connection",
10690
+ nodes: childEntities.map(cloneEntity),
10691
+ pageInfo: queryResult.pageInfo ?? {
10692
+ hasNextPage: false,
10693
+ hasPreviousPage: false
10694
+ },
10695
+ totalCount: queryResult.totalCount ?? 0
10696
+ };
10697
+ continue;
10698
+ }
10699
+ if (inc.isList) {
10700
+ result[inc.fieldName] = childEntities.map(cloneEntity);
10701
+ continue;
10702
+ }
10703
+ const child = childEntities[0];
10704
+ result[inc.fieldName] = child ? cloneEntity(child) : null;
10705
+ }
10706
+ return result;
10707
+ }
9906
10708
  async function resolveSingleRelationFallback(db, parentTable, parentEntity, inc) {
9907
10709
  const targetTables = inc.syncMetadata?.entityType ? [inc.syncMetadata.entityType] : inferTargetTables(inc.fieldName);
9908
10710
  if (targetTables.length === 0) {
@@ -9927,9 +10729,13 @@ async function reconstructEntity(db, tableName, entityId, includes) {
9927
10729
  const dexieKey = parsePrimaryKeyString(tableName, entityId);
9928
10730
  const entity = await db.table(tableName).get(dexieKey);
9929
10731
  if (!entity) return {};
10732
+ if (canUseFlatIncludeBatch(includes)) {
10733
+ const context = await preloadFlatIncludeContext(db, tableName, [entityId], includes);
10734
+ return reconstructFlatEntity(db, tableName, entity, entityId, includes, context);
10735
+ }
9930
10736
  const result = { ...entity };
9931
10737
  for (const inc of includes) {
9932
- const connKey = `${tableName}.${entityId}.${inc.fieldName}`;
10738
+ const connKey = getIncludeQueryKey(tableName, entityId, inc.fieldName);
9933
10739
  const qr = await db._queryResults.get(connKey);
9934
10740
  if (!qr) {
9935
10741
  const fallback = inc.isConnection ? void 0 : await resolveSingleRelationFallback(db, tableName, result, inc);
@@ -9942,12 +10748,7 @@ async function reconstructEntity(db, tableName, entityId, includes) {
9942
10748
  result[inc.fieldName] = fallback.entity;
9943
10749
  continue;
9944
10750
  }
9945
- result[inc.fieldName] = inc.isConnection ? {
9946
- __typename: "Unknown",
9947
- nodes: [],
9948
- pageInfo: { hasNextPage: false, hasPreviousPage: false },
9949
- totalCount: 0
9950
- } : inc.isList ? [] : null;
10751
+ result[inc.fieldName] = defaultIncludeValue(inc);
9951
10752
  continue;
9952
10753
  }
9953
10754
  if (inc.isConnection) {
@@ -9996,6 +10797,27 @@ async function reconstructEntity(db, tableName, entityId, includes) {
9996
10797
  }
9997
10798
  async function reconstructConnectionNodes(db, entityTable, nodes, includes) {
9998
10799
  if (includes.length === 0) return nodes;
10800
+ if (canUseFlatIncludeBatch(includes)) {
10801
+ const nodeIds = nodes.map((node) => primaryKeyToString(entityTable, node));
10802
+ const parentEntities = await db.table(entityTable).bulkGet(nodeIds.map((id) => parsePrimaryKeyString(entityTable, id)));
10803
+ const context = await preloadFlatIncludeContext(db, entityTable, nodeIds, includes);
10804
+ return Promise.all(
10805
+ nodeIds.map(async (nodeId, index) => {
10806
+ const parentEntity = parentEntities[index];
10807
+ if (!parentEntity || typeof parentEntity !== "object") {
10808
+ return {};
10809
+ }
10810
+ return reconstructFlatEntity(
10811
+ db,
10812
+ entityTable,
10813
+ parentEntity,
10814
+ nodeId,
10815
+ includes,
10816
+ context
10817
+ );
10818
+ })
10819
+ );
10820
+ }
9999
10821
  return Promise.all(
10000
10822
  nodes.map(async (node) => {
10001
10823
  const nodeId = primaryKeyToString(entityTable, node);
@@ -10367,6 +11189,36 @@ var AudioEventOutput = class extends DvinaModel {
10367
11189
  this.type = data.type;
10368
11190
  }
10369
11191
  };
11192
+ var Candidate = class extends DvinaModel {
11193
+ createdAt;
11194
+ decidedAt;
11195
+ decisionPassed;
11196
+ decisionReason;
11197
+ id;
11198
+ userId;
11199
+ workspaceId;
11200
+ constructor(request, data, syncEngine, baseUrl) {
11201
+ super(request, syncEngine, baseUrl);
11202
+ this.createdAt = new Date(data.createdAt);
11203
+ this.decidedAt = data.decidedAt ? new Date(data.decidedAt) : void 0;
11204
+ this.decisionPassed = data.decisionPassed ?? void 0;
11205
+ this.decisionReason = data.decisionReason ?? void 0;
11206
+ this.id = data.id;
11207
+ this.userId = data.userId;
11208
+ this.workspaceId = data.workspaceId;
11209
+ }
11210
+ };
11211
+ var CandidateEvidence = class extends DvinaModel {
11212
+ candidateId;
11213
+ evidenceId;
11214
+ id;
11215
+ constructor(request, data, syncEngine, baseUrl) {
11216
+ super(request, syncEngine, baseUrl);
11217
+ this.candidateId = data.candidateId;
11218
+ this.evidenceId = data.evidenceId;
11219
+ this.id = data.id;
11220
+ }
11221
+ };
10370
11222
  var Chat = class extends DvinaModel {
10371
11223
  closedAt;
10372
11224
  createdAt;
@@ -10761,6 +11613,44 @@ var DocumentFormat = class extends DvinaModel {
10761
11613
  return new DocumentCatalogQuery(this._request, this._syncEngine, { formatKey: this._catalog?.formatKey }, this._baseUrl);
10762
11614
  }
10763
11615
  };
11616
+ var Evidence = class extends DvinaModel {
11617
+ content;
11618
+ deletedAt;
11619
+ generatedAt;
11620
+ id;
11621
+ isProcessed;
11622
+ metadata;
11623
+ userId;
11624
+ workspaceId;
11625
+ constructor(request, data, syncEngine, baseUrl) {
11626
+ super(request, syncEngine, baseUrl);
11627
+ this.content = data.content;
11628
+ this.deletedAt = data.deletedAt ? new Date(data.deletedAt) : void 0;
11629
+ this.generatedAt = new Date(data.generatedAt);
11630
+ this.id = data.id;
11631
+ this.isProcessed = data.isProcessed;
11632
+ this.metadata = data.metadata;
11633
+ this.userId = data.userId;
11634
+ this.workspaceId = data.workspaceId;
11635
+ }
11636
+ };
11637
+ var FailedSyncEventIngestion = class extends DvinaModel {
11638
+ createdAt;
11639
+ entityId;
11640
+ error;
11641
+ id;
11642
+ modelName;
11643
+ stack;
11644
+ constructor(request, data, syncEngine, baseUrl) {
11645
+ super(request, syncEngine, baseUrl);
11646
+ this.createdAt = new Date(data.createdAt);
11647
+ this.entityId = data.entityId;
11648
+ this.error = data.error;
11649
+ this.id = data.id;
11650
+ this.modelName = data.modelName;
11651
+ this.stack = data.stack ?? void 0;
11652
+ }
11653
+ };
10764
11654
  var FeedArtifactData = class extends DvinaModel {
10765
11655
  artifactKind;
10766
11656
  fileId;
@@ -10844,6 +11734,8 @@ var FeedItem = class extends DvinaModel {
10844
11734
  return new FeedDocumentData(request, value, syncEngine, baseUrl);
10845
11735
  case "FeedIntegrationData":
10846
11736
  return new FeedIntegrationData(request, value, syncEngine, baseUrl);
11737
+ case "FeedLiveContextData":
11738
+ return new FeedLiveContextData(request, value, syncEngine, baseUrl);
10847
11739
  case "FeedPulseData":
10848
11740
  return new FeedPulseData(request, value, syncEngine, baseUrl);
10849
11741
  default:
@@ -10883,6 +11775,15 @@ var FeedItemGenerated = class extends DvinaModel {
10883
11775
  this.workspaceId = data.workspaceId;
10884
11776
  }
10885
11777
  };
11778
+ var FeedLiveContextData = class extends DvinaModel {
11779
+ kind;
11780
+ summary;
11781
+ constructor(request, data, syncEngine, baseUrl) {
11782
+ super(request, syncEngine, baseUrl);
11783
+ this.kind = data.kind;
11784
+ this.summary = data.summary ?? void 0;
11785
+ }
11786
+ };
10886
11787
  var FeedPulseData = class extends DvinaModel {
10887
11788
  kind;
10888
11789
  priority;
@@ -10999,15 +11900,6 @@ var ImportedChatSummaryOutput = class extends DvinaModel {
10999
11900
  this.provider = data.provider;
11000
11901
  }
11001
11902
  };
11002
- var IndexContentObject = class extends DvinaModel {
11003
- content;
11004
- metadata;
11005
- constructor(request, data, syncEngine, baseUrl) {
11006
- super(request, syncEngine, baseUrl);
11007
- this.content = data.content;
11008
- this.metadata = data.metadata;
11009
- }
11010
- };
11011
11903
  var InferenceRequestAudit = class extends DvinaModel {
11012
11904
  assistantResponse;
11013
11905
  createdAt;
@@ -11233,6 +12125,27 @@ var Invocation = class extends DvinaModel {
11233
12125
  return new ChatMessageQuery(this._request, this._syncEngine, { id: this.chatMessageId }, this._baseUrl);
11234
12126
  }
11235
12127
  };
12128
+ var LiveContext = class extends DvinaModel {
12129
+ createdAt;
12130
+ id;
12131
+ sourceId;
12132
+ status;
12133
+ suggestedPrompt;
12134
+ summary;
12135
+ title;
12136
+ updatedAt;
12137
+ constructor(request, data, syncEngine, baseUrl) {
12138
+ super(request, syncEngine, baseUrl);
12139
+ this.createdAt = new Date(data.createdAt);
12140
+ this.id = data.id;
12141
+ this.sourceId = data.sourceId;
12142
+ this.status = data.status;
12143
+ this.suggestedPrompt = data.suggestedPrompt ?? void 0;
12144
+ this.summary = data.summary;
12145
+ this.title = data.title;
12146
+ this.updatedAt = new Date(data.updatedAt);
12147
+ }
12148
+ };
11236
12149
  var McpAuthUpdateModel = class extends DvinaModel {
11237
12150
  authorizationUrl;
11238
12151
  error;
@@ -11564,6 +12477,43 @@ var ResolvedFileUrl = class extends DvinaModel {
11564
12477
  this.url = data.url;
11565
12478
  }
11566
12479
  };
12480
+ var StreamEventSchemaAnchor = class extends DvinaModel {
12481
+ event;
12482
+ constructor(request, data, syncEngine, baseUrl) {
12483
+ super(request, syncEngine, baseUrl);
12484
+ this.event = (() => {
12485
+ const value = data.event;
12486
+ switch (value.__typename) {
12487
+ case "AudioEventOutput":
12488
+ return new AudioEventOutput(request, value, syncEngine, baseUrl);
12489
+ case "ChatTitleEventOutput":
12490
+ return new ChatTitleEventOutput(request, value, syncEngine, baseUrl);
12491
+ case "FinalContentEventOutput":
12492
+ return new FinalContentEventOutput(request, value, syncEngine, baseUrl);
12493
+ case "MessageEndEventOutput":
12494
+ return new MessageEndEventOutput(request, value, syncEngine, baseUrl);
12495
+ case "MessageStartEventOutput":
12496
+ return new MessageStartEventOutput(request, value, syncEngine, baseUrl);
12497
+ case "ReasoningEventOutput":
12498
+ return new ReasoningEventOutput(request, value, syncEngine, baseUrl);
12499
+ case "StreamableUiDeltaEventOutput":
12500
+ return new StreamableUiDeltaEventOutput(request, value, syncEngine, baseUrl);
12501
+ case "TextBlockEventOutput":
12502
+ return new TextBlockEventOutput(request, value, syncEngine, baseUrl);
12503
+ case "TextDeltaEventOutput":
12504
+ return new TextDeltaEventOutput(request, value, syncEngine, baseUrl);
12505
+ case "ToolInputDeltaEventOutput":
12506
+ return new ToolInputDeltaEventOutput(request, value, syncEngine, baseUrl);
12507
+ case "ToolResultEventOutput":
12508
+ return new ToolResultEventOutput(request, value, syncEngine, baseUrl);
12509
+ case "ToolStartEventOutput":
12510
+ return new ToolStartEventOutput(request, value, syncEngine, baseUrl);
12511
+ default:
12512
+ throw new Error("Unknown AgentStreamEvent member for StreamEventSchemaAnchor.event.");
12513
+ }
12514
+ })();
12515
+ }
12516
+ };
11567
12517
  var StreamMessageContentOutput = class extends DvinaModel {
11568
12518
  chatMessageId;
11569
12519
  content;
@@ -11634,6 +12584,17 @@ var SyncEvent = class extends DvinaModel {
11634
12584
  this.workspaceId = data.workspaceId;
11635
12585
  }
11636
12586
  };
12587
+ var SyncEventCursor = class extends DvinaModel {
12588
+ createdAt;
12589
+ key;
12590
+ updatedAt;
12591
+ constructor(request, data, syncEngine, baseUrl) {
12592
+ super(request, syncEngine, baseUrl);
12593
+ this.createdAt = new Date(data.createdAt);
12594
+ this.key = data.key;
12595
+ this.updatedAt = new Date(data.updatedAt);
12596
+ }
12597
+ };
11637
12598
  var Table = class extends DvinaModel {
11638
12599
  clearName;
11639
12600
  createdAt;
@@ -11705,6 +12666,7 @@ var TokenUsage = class extends DvinaModel {
11705
12666
  model;
11706
12667
  outputTokens;
11707
12668
  reasoningTokens;
12669
+ scope;
11708
12670
  constructor(request, data, syncEngine, baseUrl) {
11709
12671
  super(request, syncEngine, baseUrl);
11710
12672
  this.cacheCreation1hTokens = data.cacheCreation1hTokens ?? void 0;
@@ -11718,6 +12680,7 @@ var TokenUsage = class extends DvinaModel {
11718
12680
  this.model = data.model;
11719
12681
  this.outputTokens = data.outputTokens;
11720
12682
  this.reasoningTokens = data.reasoningTokens ?? void 0;
12683
+ this.scope = data.scope;
11721
12684
  }
11722
12685
  };
11723
12686
  var ToolInputDeltaEventOutput = class extends DvinaModel {
@@ -11821,14 +12784,16 @@ var UsageWindowsStatusType = class extends DvinaModel {
11821
12784
  unlocksAt;
11822
12785
  day;
11823
12786
  fiveHour;
12787
+ month;
11824
12788
  week;
11825
12789
  constructor(request, data, syncEngine, baseUrl) {
11826
12790
  super(request, syncEngine, baseUrl);
11827
12791
  this.activeWindow = data.activeWindow ?? void 0;
11828
12792
  this.unlocksAt = data.unlocksAt ? new Date(data.unlocksAt) : void 0;
11829
- this.day = new WindowDetailType(request, data.day, syncEngine, baseUrl);
11830
- this.fiveHour = new WindowDetailType(request, data.fiveHour, syncEngine, baseUrl);
11831
- this.week = new WindowDetailType(request, data.week, syncEngine, baseUrl);
12793
+ this.day = data.day ? new WindowDetailType(request, data.day, syncEngine, baseUrl) : void 0;
12794
+ this.fiveHour = data.fiveHour ? new WindowDetailType(request, data.fiveHour, syncEngine, baseUrl) : void 0;
12795
+ this.month = data.month ? new WindowDetailType(request, data.month, syncEngine, baseUrl) : void 0;
12796
+ this.week = data.week ? new WindowDetailType(request, data.week, syncEngine, baseUrl) : void 0;
11832
12797
  }
11833
12798
  };
11834
12799
  var UserSkillFile = class extends DvinaModel {
@@ -12986,6 +13951,12 @@ var TableSubBuilder = class {
12986
13951
  return this;
12987
13952
  }
12988
13953
  };
13954
+ var AbortChatMutation = class extends Request {
13955
+ async fetch(variables) {
13956
+ const response = await this._syncEngine.mutate(AbortChatDocument, variables, MUTATION_CACHE_RULES["abortChat"]);
13957
+ return response.abortChat;
13958
+ }
13959
+ };
12989
13960
  var AddInsightToReportMutation = class extends Request {
12990
13961
  async fetch(variables, options) {
12991
13962
  const response = await this._syncEngine.mutate(AddInsightToReportDocument, variables, MUTATION_CACHE_RULES["addInsightToReport"]);
@@ -13310,6 +14281,13 @@ var ScheduleWorkspaceDeletionMutation = class extends Request {
13310
14281
  return new WorkspaceDeleteSchedule(this._request, data, this._syncEngine, this._baseUrl);
13311
14282
  }
13312
14283
  };
14284
+ var SendMessageMutation = class extends Request {
14285
+ async fetch(variables, options) {
14286
+ const response = await this._syncEngine.mutate(SendMessageDocument, variables, MUTATION_CACHE_RULES["sendMessage"]);
14287
+ const data = response.sendMessage;
14288
+ return new ChatMessage(this._request, data, this._syncEngine, this._baseUrl);
14289
+ }
14290
+ };
13313
14291
  var SetDatabasePrimaryKeyMutation = class extends Request {
13314
14292
  async fetch(variables) {
13315
14293
  const response = await this._syncEngine.mutate(SetDatabasePrimaryKeyDocument, variables, MUTATION_CACHE_RULES["setDatabasePrimaryKey"]);
@@ -13385,6 +14363,13 @@ var UpdateInterpMutation = class extends Request {
13385
14363
  return new Interpretation(this._request, data, this._syncEngine, this._baseUrl);
13386
14364
  }
13387
14365
  };
14366
+ var UpdateLiveContextMutation = class extends Request {
14367
+ async fetch(variables, options) {
14368
+ const response = await this._syncEngine.mutate(UpdateLiveContextDocument, variables, MUTATION_CACHE_RULES["updateLiveContext"]);
14369
+ const data = response.updateLiveContext;
14370
+ return new LiveContext(this._request, data, this._syncEngine, this._baseUrl);
14371
+ }
14372
+ };
13388
14373
  var UpdatePulseTriggerMutation = class extends Request {
13389
14374
  async fetch(variables, options) {
13390
14375
  const response = await this._syncEngine.mutate(UpdatePulseTriggerDocument, variables, MUTATION_CACHE_RULES["updatePulseTrigger"]);
@@ -16725,6 +17710,36 @@ var GetTokenUsageStatus_Windows_FiveHourQuery = class extends Request {
16725
17710
  });
16726
17711
  }
16727
17712
  };
17713
+ var GetTokenUsageStatus_Windows_MonthQuery = class extends Request {
17714
+ _variables;
17715
+ constructor(request, syncEngine, variables = {}, baseUrl) {
17716
+ super(request, syncEngine, void 0, baseUrl);
17717
+ this._variables = variables;
17718
+ }
17719
+ async fetch(options) {
17720
+ const variables = this._variables;
17721
+ const response = await this._syncEngine.query(GetTokenUsageStatus_Windows_MonthDocument, variables, "getTokenUsageStatus");
17722
+ const data = response.getTokenUsageStatus?.windows?.month;
17723
+ return data ? new WindowDetailType(this._request, data, this._syncEngine, this._baseUrl) : void 0;
17724
+ }
17725
+ watch(options) {
17726
+ const variables = this._variables;
17727
+ const raw = this._syncEngine.watch(
17728
+ GetTokenUsageStatus_Windows_MonthDocument,
17729
+ variables,
17730
+ "getTokenUsageStatus",
17731
+ async (db) => {
17732
+ const vars = variables;
17733
+ const entity = vars?.id ? await db.table("windowDetailTypes").get(vars.id) : void 0;
17734
+ return { getTokenUsageStatus: { windows: { month: entity ?? null } } };
17735
+ }
17736
+ );
17737
+ return new MappedDvinaQueryRef(raw, (response) => {
17738
+ const data = response.getTokenUsageStatus?.windows?.month;
17739
+ return data ? new WindowDetailType(this._request, data, this._syncEngine, this._baseUrl) : void 0;
17740
+ });
17741
+ }
17742
+ };
16728
17743
  var GetTokenUsageStatus_Windows_WeekQuery = class extends Request {
16729
17744
  _variables;
16730
17745
  constructor(request, syncEngine, variables = {}, baseUrl) {
@@ -18335,21 +19350,6 @@ var ReportsQuery = class _ReportsQuery extends Request {
18335
19350
  return this;
18336
19351
  }
18337
19352
  };
18338
- var SearchQuery = class extends Request {
18339
- _variables;
18340
- _includes = [];
18341
- constructor(request, syncEngine, variables = {}, baseUrl) {
18342
- super(request, syncEngine, void 0, baseUrl);
18343
- this._variables = variables;
18344
- }
18345
- async fetch(options) {
18346
- const { document: queryDoc, variables: mergedVars } = buildSmartQuery(SearchDocument, "search", this._includes, this._variables);
18347
- const response = await this._syncEngine.query(queryDoc, mergedVars, "search");
18348
- const data = response.search;
18349
- if (!Array.isArray(data)) return [];
18350
- return data.map((item) => new IndexContentObject(this._request, item, this._syncEngine, this._baseUrl));
18351
- }
18352
- };
18353
19353
  var TableQuery = class extends Request {
18354
19354
  _variables;
18355
19355
  _includes = [];
@@ -19019,11 +20019,6 @@ var McpAuthUpdatesSubscription = class extends Request {
19019
20019
  }
19020
20020
  }
19021
20021
  };
19022
- var SendMessageStreamSubscription = class extends Request {
19023
- subscribe(variables) {
19024
- return this._subscribe(SendMessageStreamDocument, variables);
19025
- }
19026
- };
19027
20022
  var TokenUsageUpdatesSubscription = class extends Request {
19028
20023
  async *subscribe(variables) {
19029
20024
  for await (const response of this._subscribe(TokenUsageUpdatesDocument, variables)) {
@@ -19035,6 +20030,8 @@ var TokenUsageUpdatesSubscription = class extends Request {
19035
20030
  var DvinaSdk = class extends Request {
19036
20031
  /** The SyncEngine instance managing the local Dexie store and server sync. */
19037
20032
  syncEngine;
20033
+ /** Chat SSE client for chat-scoped stream listeners. */
20034
+ chatStream;
19038
20035
  _getToken;
19039
20036
  _terminateWs;
19040
20037
  _closeDb;
@@ -19043,15 +20040,20 @@ var DvinaSdk = class extends Request {
19043
20040
  /** Billing client for the Dvina Billing API (plans, subscriptions, seats, sessions). */
19044
20041
  billing;
19045
20042
  constructor(options) {
19046
- const { syncEngine, request, subscribe, getToken, terminateWs, closeDb, inference, billing, baseUrl } = createDvinaClient(options);
20043
+ const { syncEngine, request, subscribe, chatStream, getToken, terminateWs, closeDb, inference, billing, baseUrl } = createDvinaClient(options);
19047
20044
  super(request, syncEngine, subscribe, baseUrl);
19048
20045
  this.syncEngine = syncEngine;
20046
+ this.chatStream = chatStream;
19049
20047
  this._getToken = getToken;
19050
20048
  this._terminateWs = terminateWs;
19051
20049
  this._closeDb = closeDb;
19052
20050
  this.inference = inference;
19053
20051
  this.billing = billing;
19054
20052
  }
20053
+ /** Mutation: abortChat (scalar) */
20054
+ abortChat(variables) {
20055
+ return new AbortChatMutation(this._request, this._syncEngine).fetch(variables);
20056
+ }
19055
20057
  /** Mutation: addInsightToReport */
19056
20058
  addInsightToReport(variables) {
19057
20059
  return new AddInsightToReportMutation(this._request, this._syncEngine, void 0, this._baseUrl).fetch(variables);
@@ -19244,6 +20246,10 @@ var DvinaSdk = class extends Request {
19244
20246
  scheduleWorkspaceDeletion() {
19245
20247
  return new ScheduleWorkspaceDeletionMutation(this._request, this._syncEngine, void 0, this._baseUrl).fetch(void 0);
19246
20248
  }
20249
+ /** Mutation: sendMessage */
20250
+ sendMessage(variables) {
20251
+ return new SendMessageMutation(this._request, this._syncEngine, void 0, this._baseUrl).fetch(variables);
20252
+ }
19247
20253
  /** Mutation: setDatabasePrimaryKey (scalar) */
19248
20254
  setDatabasePrimaryKey(variables) {
19249
20255
  return new SetDatabasePrimaryKeyMutation(this._request, this._syncEngine).fetch(variables);
@@ -19288,6 +20294,10 @@ var DvinaSdk = class extends Request {
19288
20294
  updateInterp(variables) {
19289
20295
  return new UpdateInterpMutation(this._request, this._syncEngine, void 0, this._baseUrl).fetch(variables);
19290
20296
  }
20297
+ /** Mutation: updateLiveContext */
20298
+ updateLiveContext(variables) {
20299
+ return new UpdateLiveContextMutation(this._request, this._syncEngine, void 0, this._baseUrl).fetch(variables);
20300
+ }
19291
20301
  /** Mutation: updatePulseTrigger */
19292
20302
  updatePulseTrigger(variables) {
19293
20303
  return new UpdatePulseTriggerMutation(this._request, this._syncEngine, void 0, this._baseUrl).fetch(variables);
@@ -19532,10 +20542,6 @@ var DvinaSdk = class extends Request {
19532
20542
  reports(variables) {
19533
20543
  return new ReportsQuery(this._request, this._syncEngine, variables, this._baseUrl);
19534
20544
  }
19535
- /** Query: search — call .fetch() or .watch() to execute. */
19536
- search(variables) {
19537
- return new SearchQuery(this._request, this._syncEngine, variables, this._baseUrl);
19538
- }
19539
20545
  /** Query: table — call .fetch() or .watch() to execute. */
19540
20546
  table(variables) {
19541
20547
  return new TableQuery(this._request, this._syncEngine, variables, this._baseUrl);
@@ -19568,10 +20574,6 @@ var DvinaSdk = class extends Request {
19568
20574
  mcpAuthUpdates(variables) {
19569
20575
  return new McpAuthUpdatesSubscription(this._request, this._syncEngine, this._subscribe).subscribe(variables);
19570
20576
  }
19571
- /** sendMessageStream subscription */
19572
- sendMessageStream(variables) {
19573
- return new SendMessageStreamSubscription(this._request, this._syncEngine, this._subscribe).subscribe(variables);
19574
- }
19575
20577
  /** tokenUsageUpdates subscription */
19576
20578
  tokenUsageUpdates(variables) {
19577
20579
  return new TokenUsageUpdatesSubscription(this._request, this._syncEngine, this._subscribe).subscribe(variables);
@@ -19616,12 +20618,13 @@ var DvinaSdk = class extends Request {
19616
20618
  */
19617
20619
  async destroy() {
19618
20620
  this.syncEngine.stopSync();
20621
+ this.chatStream.destroy();
19619
20622
  this._terminateWs();
19620
20623
  this.billing.destroy();
19621
20624
  await this._closeDb();
19622
20625
  }
19623
20626
  };
19624
20627
 
19625
- export { Action, AddInsightToReportMutation, Agent, AgentConnection, AgentQuery, AgentSubBuilder, Agent_ChatsQuery, AgentsQuery, Artifact, ArtifactConnection, ArtifactQuery, ArtifactSubBuilder, Artifact_ChatQuery, Artifact_Chat_InsightQuery, Artifact_FileQuery, Artifact_MessageQuery, Artifact_Message_ChatQuery, Artifact_Message_ContentsQuery, Artifact_Message_FeedbackQuery, ArtifactsQuery, AudioEventOutput, CancelOauthFlowMutation, CancelWorkspaceDeletionMutation, Chat, ChatConnection, ChatImportExecuteOutput, ChatImportPreviewOutput, ChatMessage, ChatMessageConnection, ChatMessageQuery, ChatMessageSubBuilder, ChatMessage_ArtifactsQuery, ChatMessage_ChatQuery, ChatMessage_Chat_InsightQuery, ChatMessage_ContentsQuery, ChatMessage_FeedbackQuery, ChatMessagesQuery, ChatQuery, ChatSubBuilder, ChatTitleEventOutput, Chat_AgentsQuery, Chat_ArtifactsQuery, Chat_InsightQuery, Chat_Insight_ReportMembersQuery, Chat_Insight_ThumbnailFileQuery, Chat_MessagesQuery, ChatsQuery, ConnectIntegrationMutation, ConsumePulseEventsMutation, ContentBlock, ContentMask, ContinueImportedChatMutation, ContinueInterpretationMutation, CreateAgentMutation, CreateChatMutation, CreateDatabaseMutation, CreateDocumentMutation, CreateFeedbackMutation, CreateFolderMutation, CreateInsightMutation, CreateIntegrationMutation, CreateIntegrationOutput, CreateReportMutation, CreateTableMutation, CreateUserSkillFileMutation, CreateUserSkillFolderMutation, CubeModel, DB_ENTITY_SCHEMA, Database, DatabaseCatalog, DatabaseCatalogConnection, DatabaseCatalogQuery, DatabaseCatalogSubBuilder, DatabaseCatalog_EngineQuery, DatabaseCatalogsQuery, DatabaseConnection, DatabaseEngine, DatabaseQuery, DatabaseSchemaQuery, DatabaseSubBuilder, Database_EngineQuery, Database_Engine_CatalogQuery, Database_TablesQuery, DatabasesQuery, DeepAnalysisUsage, DeferredDvinaQueryRef, DeleteAgentMutation, DeleteArtifactMutation, DeleteChatMutation, DeleteDatabaseMutation, DeleteDocumentMutation, DeleteFolderMutation, DeleteInsightMutation, DeleteInsightsMutation, DeleteIntegrationMutation, DeleteReportMutation, DeleteTableMutation, DeleteUserSkillFileMutation, DeleteUserSkillFolderMutation, DevAccessTokenOutput, DexieLiveQueryRef, DisconnectIntegrationMutation, DismissPulseEventMutation, Document, DocumentCatalog, DocumentCatalogConnection, DocumentCatalogQuery, DocumentCatalogSubBuilder, DocumentCatalog_FormatQuery, DocumentCatalogsQuery, DocumentConnection, DocumentContent, DocumentFormat, DocumentQuery, DocumentSubBuilder, Document_ContentsQuery, Document_FileQuery, Document_FormatQuery, Document_Format_CatalogQuery, Document_TablesQuery, DocumentsQuery, DvinaDatabase, DvinaModel, DvinaSdk, ExecuteChatImportMutation, ExportQuery, ExportWithInsightIdQuery, FeedArtifactData, FeedConnection, FeedDatabaseData, FeedDocumentData, FeedIntegrationData, FeedItem, FeedItemGenerated, FeedItemQuery, FeedItemSubBuilder, FeedItem_ActionQuery, FeedItem_DataQuery, FeedItemsQuery, FeedPulseData, FeedSendMessageAction, Feedback, File, FileMetaQuery, FileModel, FileQuery, FileUrlsQuery, FinalContentEventOutput, FindFitTierQuery, Folder, FolderConnection, FolderQuery, FoldersQuery, GenerateUploadUriMutation, GetCapabilityQuery, GetDevAccessTokenQuery, GetLimitQuery, GetRemainingQuery, GetTokenUsageByModelQuery, GetTokenUsageHistoryQuery, GetTokenUsageStatusQuery, GetTokenUsageStatus_WindowsQuery, GetTokenUsageStatus_Windows_DayQuery, GetTokenUsageStatus_Windows_FiveHourQuery, GetTokenUsageStatus_Windows_WeekQuery, GetUsageQuery, ImportedChatSummaryOutput, IndexContentObject, InferenceRequestAudit, Insight, InsightConnection, InsightQuery, InsightSubBuilder, Insight_ChatQuery, Insight_ReportMembersQuery, Insight_ReportsQuery, Insight_ThumbnailFileQuery, InsightsQuery, Integration, IntegrationCatalog, IntegrationCatalogConnection, IntegrationCatalogQuery, IntegrationCatalogSubBuilder, IntegrationCatalogToolsQuery, IntegrationCatalog_ProviderQuery, IntegrationCatalogsQuery, IntegrationConnection, IntegrationProvider, IntegrationQuery, IntegrationSubBuilder, Integration_ProviderQuery, Integration_Provider_CatalogQuery, IntegrationsQuery, Interpretation, InterpretationConnection, InterpretationsQuery, Invocation, MUTATION_CACHE_RULES, MappedDvinaQueryRef, McpAuthUpdateModel, McpAuthUpdatesSubscription, McpClientInformation, McpCodeVerifier, McpServer, McpTokens, McpTool, MessageEndEventOutput, MessageStartEventOutput, ModelTokenUsage, Notification, NotificationConnection, NotificationQuery, NotificationsByReferenceQuery, NotificationsQuery, PRIMARY_KEY_CONFIG, PreviewChatImportMutation, PrivacyStats, PrivacyStatsQuery, PulseAppSummaryModel, PulseAppSummaryQuery, PulseEvent, PulseEventConnection, PulseEventQuery, PulseEventSubBuilder, PulseEvent_IntegrationQuery, PulseEvent_Integration_ProviderQuery, PulseEventsQuery, PulseTriggerSettingModel, PulseTriggerSettingsQuery, QueryQuery, QueryWithInsightIdQuery, QueryWithMessageIdQuery, ReanalyzeDocumentMutation, ReasoningEventOutput, RefineMindInstructionMutation, RefreshDatabaseSchemaMutation, RefreshInsightMutation, ReinterpretSourceMutation, ReinterpretSourcesOfuserMutation, Relation, RelocateInsightMutation, RemoveInsightFromReportMutation, Report, ReportConnection, ReportMember, ReportQuery, ReportSubBuilder, Report_InsightsQuery, Report_LayoutQuery, ReportsQuery, ResetWorkspaceMutation, ResolvePulseEventMutation, ResolvedFileUrl, ScheduleWorkspaceDeletionMutation, SearchQuery, SendMessageStreamSubscription, SetDatabasePrimaryKeyMutation, StreamMessageContentOutput, StreamMessageOutput, StreamableUiDeltaEventOutput, SyncEngine, SyncEvent, TABLE_TO_TYPENAME, TYPENAME_TO_TABLE, Table, TableConnection, TableQuery, TableSubBuilder, Table_DatabaseQuery, Table_Database_EngineQuery, Table_DocumentQuery, Table_Document_ContentsQuery, Table_Document_FileQuery, Table_Document_FormatQuery, Table_FromRelationsQuery, Table_ToRelationsQuery, TablesQuery, TextBlockEventOutput, TextDeltaEventOutput, TokenUsage, TokenUsageUpdatesSubscription, ToolInputDeltaEventOutput, ToolResultArtifactOutput, ToolResultEventOutput, ToolStartEventOutput, UpdateAgentMutation, UpdateArtifactNameMutation, UpdateChatMutation, UpdateDatabaseMutation, UpdateDocumentMutation, UpdateFolderMutation, UpdateInsightInReportMutation, UpdateInsightMutation, UpdateInsightThumbnailMutation, UpdateInterpMutation, UpdatePulseTriggerMutation, UpdateReportMutation, UpdateTableMutation, UpdateUserSkillFileMutation, UpdateUserSkillFolderMutation, UsageMetaOutput, UsageStatus, UsageWindowsStatusType, UserSkillFile, UserSkillFileModel, UserSkillFileQuery, UserSkillFilesQuery, UserSkillFolder, UserSkillFolderModel, UserSkillFolderQuery, UserSkillFoldersQuery, WindowDetailType, WorkspaceDeleteSchedule, WorkspaceDeletionScheduleQuery, closeDatabase, createDvinaClient, createLazySyncEngine, createSseTransport, createWsTransport, deleteDatabase, getOrCreateDatabase, reconstructConnectionNodes, reconstructEntity, uploadFile };
19626
- //# sourceMappingURL=chunk-7N4QKDOR.js.map
19627
- //# sourceMappingURL=chunk-7N4QKDOR.js.map
20628
+ export { AbortChatMutation, Action, AddInsightToReportMutation, Agent, AgentConnection, AgentQuery, AgentSubBuilder, Agent_ChatsQuery, AgentsQuery, Artifact, ArtifactConnection, ArtifactQuery, ArtifactSubBuilder, Artifact_ChatQuery, Artifact_Chat_InsightQuery, Artifact_FileQuery, Artifact_MessageQuery, Artifact_Message_ChatQuery, Artifact_Message_ContentsQuery, Artifact_Message_FeedbackQuery, ArtifactsQuery, AudioEventOutput, CancelOauthFlowMutation, CancelWorkspaceDeletionMutation, Candidate, CandidateEvidence, Chat, ChatConnection, ChatImportExecuteOutput, ChatImportPreviewOutput, ChatMessage, ChatMessageConnection, ChatMessageQuery, ChatMessageSubBuilder, ChatMessage_ArtifactsQuery, ChatMessage_ChatQuery, ChatMessage_Chat_InsightQuery, ChatMessage_ContentsQuery, ChatMessage_FeedbackQuery, ChatMessagesQuery, ChatQuery, ChatSubBuilder, ChatTitleEventOutput, Chat_AgentsQuery, Chat_ArtifactsQuery, Chat_InsightQuery, Chat_Insight_ReportMembersQuery, Chat_Insight_ThumbnailFileQuery, Chat_MessagesQuery, ChatsQuery, ConnectIntegrationMutation, ConsumePulseEventsMutation, ContentBlock, ContentMask, ContinueImportedChatMutation, ContinueInterpretationMutation, CreateAgentMutation, CreateChatMutation, CreateDatabaseMutation, CreateDocumentMutation, CreateFeedbackMutation, CreateFolderMutation, CreateInsightMutation, CreateIntegrationMutation, CreateIntegrationOutput, CreateReportMutation, CreateTableMutation, CreateUserSkillFileMutation, CreateUserSkillFolderMutation, CubeModel, DB_ENTITY_SCHEMA, Database, DatabaseCatalog, DatabaseCatalogConnection, DatabaseCatalogQuery, DatabaseCatalogSubBuilder, DatabaseCatalog_EngineQuery, DatabaseCatalogsQuery, DatabaseConnection, DatabaseEngine, DatabaseQuery, DatabaseSchemaQuery, DatabaseSubBuilder, Database_EngineQuery, Database_Engine_CatalogQuery, Database_TablesQuery, DatabasesQuery, DeepAnalysisUsage, DeferredDvinaQueryRef, DeleteAgentMutation, DeleteArtifactMutation, DeleteChatMutation, DeleteDatabaseMutation, DeleteDocumentMutation, DeleteFolderMutation, DeleteInsightMutation, DeleteInsightsMutation, DeleteIntegrationMutation, DeleteReportMutation, DeleteTableMutation, DeleteUserSkillFileMutation, DeleteUserSkillFolderMutation, DevAccessTokenOutput, DexieLiveQueryRef, DisconnectIntegrationMutation, DismissPulseEventMutation, Document, DocumentCatalog, DocumentCatalogConnection, DocumentCatalogQuery, DocumentCatalogSubBuilder, DocumentCatalog_FormatQuery, DocumentCatalogsQuery, DocumentConnection, DocumentContent, DocumentFormat, DocumentQuery, DocumentSubBuilder, Document_ContentsQuery, Document_FileQuery, Document_FormatQuery, Document_Format_CatalogQuery, Document_TablesQuery, DocumentsQuery, DvinaDatabase, DvinaModel, DvinaSdk, Evidence, ExecuteChatImportMutation, ExportQuery, ExportWithInsightIdQuery, FailedSyncEventIngestion, FeedArtifactData, FeedConnection, FeedDatabaseData, FeedDocumentData, FeedIntegrationData, FeedItem, FeedItemGenerated, FeedItemQuery, FeedItemSubBuilder, FeedItem_ActionQuery, FeedItem_DataQuery, FeedItemsQuery, FeedLiveContextData, FeedPulseData, FeedSendMessageAction, Feedback, File, FileMetaQuery, FileModel, FileQuery, FileUrlsQuery, FinalContentEventOutput, FindFitTierQuery, Folder, FolderConnection, FolderQuery, FoldersQuery, GenerateUploadUriMutation, GetCapabilityQuery, GetDevAccessTokenQuery, GetLimitQuery, GetRemainingQuery, GetTokenUsageByModelQuery, GetTokenUsageHistoryQuery, GetTokenUsageStatusQuery, GetTokenUsageStatus_WindowsQuery, GetTokenUsageStatus_Windows_DayQuery, GetTokenUsageStatus_Windows_FiveHourQuery, GetTokenUsageStatus_Windows_MonthQuery, GetTokenUsageStatus_Windows_WeekQuery, GetUsageQuery, ImportedChatSummaryOutput, InferenceRequestAudit, Insight, InsightConnection, InsightQuery, InsightSubBuilder, Insight_ChatQuery, Insight_ReportMembersQuery, Insight_ReportsQuery, Insight_ThumbnailFileQuery, InsightsQuery, Integration, IntegrationCatalog, IntegrationCatalogConnection, IntegrationCatalogQuery, IntegrationCatalogSubBuilder, IntegrationCatalogToolsQuery, IntegrationCatalog_ProviderQuery, IntegrationCatalogsQuery, IntegrationConnection, IntegrationProvider, IntegrationQuery, IntegrationSubBuilder, Integration_ProviderQuery, Integration_Provider_CatalogQuery, IntegrationsQuery, Interpretation, InterpretationConnection, InterpretationsQuery, Invocation, LiveContext, MUTATION_CACHE_RULES, MappedDvinaQueryRef, McpAuthUpdateModel, McpAuthUpdatesSubscription, McpClientInformation, McpCodeVerifier, McpServer, McpTokens, McpTool, MessageEndEventOutput, MessageStartEventOutput, ModelTokenUsage, Notification, NotificationConnection, NotificationQuery, NotificationsByReferenceQuery, NotificationsQuery, PRIMARY_KEY_CONFIG, PreviewChatImportMutation, PrivacyStats, PrivacyStatsQuery, PulseAppSummaryModel, PulseAppSummaryQuery, PulseEvent, PulseEventConnection, PulseEventQuery, PulseEventSubBuilder, PulseEvent_IntegrationQuery, PulseEvent_Integration_ProviderQuery, PulseEventsQuery, PulseTriggerSettingModel, PulseTriggerSettingsQuery, QueryQuery, QueryWithInsightIdQuery, QueryWithMessageIdQuery, ReanalyzeDocumentMutation, ReasoningEventOutput, RefineMindInstructionMutation, RefreshDatabaseSchemaMutation, RefreshInsightMutation, ReinterpretSourceMutation, ReinterpretSourcesOfuserMutation, Relation, RelocateInsightMutation, RemoveInsightFromReportMutation, Report, ReportConnection, ReportMember, ReportQuery, ReportSubBuilder, Report_InsightsQuery, Report_LayoutQuery, ReportsQuery, ResetWorkspaceMutation, ResolvePulseEventMutation, ResolvedFileUrl, ScheduleWorkspaceDeletionMutation, SendMessageMutation, SetDatabasePrimaryKeyMutation, StreamEventSchemaAnchor, StreamMessageContentOutput, StreamMessageOutput, StreamableUiDeltaEventOutput, SyncEngine, SyncEvent, SyncEventCursor, TABLE_TO_TYPENAME, TYPENAME_TO_TABLE, Table, TableConnection, TableQuery, TableSubBuilder, Table_DatabaseQuery, Table_Database_EngineQuery, Table_DocumentQuery, Table_Document_ContentsQuery, Table_Document_FileQuery, Table_Document_FormatQuery, Table_FromRelationsQuery, Table_ToRelationsQuery, TablesQuery, TextBlockEventOutput, TextDeltaEventOutput, TokenUsage, TokenUsageUpdatesSubscription, ToolInputDeltaEventOutput, ToolResultArtifactOutput, ToolResultEventOutput, ToolStartEventOutput, UpdateAgentMutation, UpdateArtifactNameMutation, UpdateChatMutation, UpdateDatabaseMutation, UpdateDocumentMutation, UpdateFolderMutation, UpdateInsightInReportMutation, UpdateInsightMutation, UpdateInsightThumbnailMutation, UpdateInterpMutation, UpdateLiveContextMutation, UpdatePulseTriggerMutation, UpdateReportMutation, UpdateTableMutation, UpdateUserSkillFileMutation, UpdateUserSkillFolderMutation, UsageMetaOutput, UsageStatus, UsageWindowsStatusType, UserSkillFile, UserSkillFileModel, UserSkillFileQuery, UserSkillFilesQuery, UserSkillFolder, UserSkillFolderModel, UserSkillFolderQuery, UserSkillFoldersQuery, WindowDetailType, WorkspaceDeleteSchedule, WorkspaceDeletionScheduleQuery, closeDatabase, createChatStreamClient, createDvinaClient, createLazySyncEngine, createSseTransport, createWsTransport, deleteDatabase, getOrCreateDatabase, reconstructConnectionNodes, reconstructEntity, uploadFile };
20629
+ //# sourceMappingURL=chunk-N64A3FWK.js.map
20630
+ //# sourceMappingURL=chunk-N64A3FWK.js.map