@raisindb/client 0.5.9 → 0.5.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -0
- package/dist/{chunk-IFV4ECHC.mjs → chunk-ASOWGNQZ.mjs} +3 -3
- package/dist/{chunk-ZUUSBLVP.mjs → chunk-FYWYSNQG.mjs} +3 -3
- package/dist/{chunk-765DLJMZ.mjs → chunk-NOPZAMIV.mjs} +31 -2
- package/dist/chunk-NOPZAMIV.mjs.map +1 -0
- package/dist/{chunk-AULHRX5C.mjs → chunk-TPZNJNZR.mjs} +2 -2
- package/dist/{chunk-VMUT6PIO.mjs → chunk-ZCRYQCXS.mjs} +2 -2
- package/dist/{conversation-list-store-CHaqGtSi.d.mts → conversation-list-store-CqgIk8Rn.d.mts} +179 -3
- package/dist/{conversation-list-store-CHaqGtSi.d.ts → conversation-list-store-CqgIk8Rn.d.ts} +179 -3
- package/dist/{index-AobOnS4A.d.mts → index-BD3rutlF.d.mts} +1 -1
- package/dist/{index-DiL2gplR.d.ts → index-CDUAMIub.d.ts} +1 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +383 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +356 -10
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +30 -1
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +3 -3
- package/dist/{svelte-sql-FQqis53r.d.ts → svelte-sql-D9YU1wYS.d.ts} +1 -1
- package/dist/{svelte-sql-BUrNcoHR.d.mts → svelte-sql-l1wmTWM4.d.mts} +1 -1
- package/dist/svelte.d.mts +2 -2
- package/dist/svelte.d.ts +2 -2
- package/dist/svelte.js +30 -1
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +3 -3
- package/dist/vue.d.mts +2 -2
- package/dist/vue.d.ts +2 -2
- package/dist/vue.js +30 -1
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-765DLJMZ.mjs.map +0 -1
- /package/dist/{chunk-IFV4ECHC.mjs.map → chunk-ASOWGNQZ.mjs.map} +0 -0
- /package/dist/{chunk-ZUUSBLVP.mjs.map → chunk-FYWYSNQG.mjs.map} +0 -0
- /package/dist/{chunk-AULHRX5C.mjs.map → chunk-TPZNJNZR.mjs.map} +0 -0
- /package/dist/{chunk-VMUT6PIO.mjs.map → chunk-ZCRYQCXS.mjs.map} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { l as PropertyValue, m as RelationRef, N as Node, H as HttpClientOptions, n as ClientOptions, o as Credentials, p as RaisinHttpClient, R as RaisinClient, q as RetryOptions, U as UploadErrorCode, B as BatchUpload, r as UploaderConfig, s as FileSource, t as BatchUploadOptions, u as BatchUploadResult, v as BatchProgress, w as ReconnectOptions } from './conversation-list-store-
|
|
2
|
-
export { au as AgentRunChildView, aR as AgentRunCommand, aS as AgentRunControlAck, aT as AgentRunEvent, aU as AgentRunFence, aV as AgentRunStatus, aW as AgentRunSubject, av as AgentRunSubscribeOptions, aw as AgentRunSubscription, aX as AgentRunView, aq as AgentRunsApi, aY as AgentRunsTransport, at as AgentRunsWsApi, dE as AiContainerConfig, dD as AiErrorBehavior, dC as AiToolMode, x as Answer, ag as Archetypes, y as AskOptions, bD as AuditLogEntry, bC as AuditQueryPayload, O as AuthEvent, A as AuthManager, cR as AuthProviders, Q as AuthStateChange, V as AuthStateChangeCallback, bS as AuthenticatePayload, bT as AuthenticateResponse, cn as BatchFileProgress, aZ as BeginOperationOptions, aj as BranchDiff, ak as BranchDivergence, ai as Branches, cw as BrowserFileSource, dw as CanonicalTaskType, aF as ChangeOp, aG as ChangesetOptions, e5 as ChatAssistantMessageEvent, e7 as ChatCompletedEvent, eg as ChatConversationCreatedEvent, e9 as ChatDoneEvent, d$ as ChatEvent, e8 as ChatFailedEvent, ej as ChatLogEvent, b as ChatMessage, ei as ChatMessageDeliveredEvent, eh as ChatMessageSavedEvent, dB as ChatStepConfig, dA as ChatTerminationConfig, dz as ChatTerminationMode, e4 as ChatTextChunkEvent, ec as ChatThoughtChunkEvent, eb as ChatToolCallCompletedEvent, ea as ChatToolCallStartedEvent, e6 as ChatWaitingEvent, aA as CheckpointOptions, ax as ChildAction, ay as ChildContext, az as ChildObjective, cj as ChunkUploadResponse, z as Citation, K as ClientMode, cl as CompleteUploadRequest, cm as CompleteUploadResponse, bg as Connection, bh as ConnectionOptions, C as ConnectionState, dI as ContainerRule, dq as ContainerType, e0 as Conversation, dk as ConversationCreatedEvent, d as ConversationListItem, h as ConversationListSnapshot, e as ConversationListStore, g as ConversationListStoreOptions, ek as ConversationManager,
|
|
3
|
-
export { F as FlowStatus, j as RaisinContextValue, i as RaisinProviderProps, g as RaisinReact, R as ReactLike, h as ReactLikeWithContext, k as UseAuthReturn, l as UseConnectionReturn, b as UseConversationListReturn, U as UseConversationReturn, d as UseFlowOptions, e as UseFlowReturn, m as UseSqlOptions, n as UseSqlReturn, o as UseSubscriptionOptions, f as createRaisinReact, u as useConversation, a as useConversationList, c as useFlow } from './index-
|
|
1
|
+
import { l as PropertyValue, m as RelationRef, N as Node, H as HttpClientOptions, n as ClientOptions, o as Credentials, p as RaisinHttpClient, R as RaisinClient, q as RetryOptions, U as UploadErrorCode, B as BatchUpload, r as UploaderConfig, s as FileSource, t as BatchUploadOptions, u as BatchUploadResult, v as BatchProgress, w as ReconnectOptions } from './conversation-list-store-CqgIk8Rn.js';
|
|
2
|
+
export { au as AgentRunChildView, aR as AgentRunCommand, aS as AgentRunControlAck, aT as AgentRunEvent, aU as AgentRunFence, aV as AgentRunStatus, aW as AgentRunSubject, av as AgentRunSubscribeOptions, aw as AgentRunSubscription, aX as AgentRunView, aq as AgentRunsApi, aY as AgentRunsTransport, at as AgentRunsWsApi, dE as AiContainerConfig, dD as AiErrorBehavior, dC as AiToolMode, eo as AnonymousConversation, x as Answer, ag as Archetypes, y as AskOptions, bD as AuditLogEntry, bC as AuditQueryPayload, O as AuthEvent, A as AuthManager, cR as AuthProviders, Q as AuthStateChange, V as AuthStateChangeCallback, bS as AuthenticatePayload, bT as AuthenticateResponse, cn as BatchFileProgress, aZ as BeginOperationOptions, aj as BranchDiff, ak as BranchDivergence, ai as Branches, cw as BrowserFileSource, dw as CanonicalTaskType, aF as ChangeOp, aG as ChangesetOptions, e5 as ChatAssistantMessageEvent, e7 as ChatCompletedEvent, eg as ChatConversationCreatedEvent, e9 as ChatDoneEvent, d$ as ChatEvent, e8 as ChatFailedEvent, ej as ChatLogEvent, b as ChatMessage, ei as ChatMessageDeliveredEvent, eh as ChatMessageSavedEvent, dB as ChatStepConfig, dA as ChatTerminationConfig, dz as ChatTerminationMode, e4 as ChatTextChunkEvent, ec as ChatThoughtChunkEvent, eb as ChatToolCallCompletedEvent, ea as ChatToolCallStartedEvent, e6 as ChatWaitingEvent, aA as CheckpointOptions, ax as ChildAction, ay as ChildContext, az as ChildObjective, cj as ChunkUploadResponse, z as Citation, K as ClientMode, cl as CompleteUploadRequest, cm as CompleteUploadResponse, bg as Connection, bh as ConnectionOptions, C as ConnectionState, dI as ContainerRule, dq as ContainerType, e0 as Conversation, dk as ConversationCreatedEvent, d as ConversationListItem, h as ConversationListSnapshot, e as ConversationListStore, g as ConversationListStoreOptions, ek as ConversationManager, ey as ConversationManagerOptions, e2 as ConversationStatus, c as ConversationStore, f as ConversationStoreOptions, a as ConversationStoreSnapshot, ev as ConversationSubscription, e1 as ConversationType, a_ as CreateAgentRunOptions, a$ as CreateAgentRunResult, et as CreateConvoOptions, ch as CreateUploadRequest, ci as CreateUploadResponse, al as CrossBranchCopySummary, am as CrossBranchNodeChange, L as CurrentUser, cv as DEFAULT_BATCH_CONCURRENCY, cu as DEFAULT_BRANCH, cp as DEFAULT_CHUNK_SIZE, cq as DEFAULT_MAX_RETRIES, ct as DEFAULT_NODE_TYPE, cr as DEFAULT_RETRY_BASE_DELAY, cs as DEFAULT_RETRY_MAX_DELAY, el as DEFAULT_SEND_MESSAGE_INACTIVITY_TIMEOUT_MS, D as Database, a3 as DatabaseHttpOptions, ah as ElementTypes, br as ErrorInfo, be as EventCallback, bc as EventHandler, E as EventMessage, bd as EventSubscriptions, dJ as FanOutConfig, b0 as FinishOperationOptions, cE as FlowClient, F as FlowClientOptions, cG as FlowCollectResult, de as FlowCompletedEvent, dO as FlowDefinition, dL as FlowDefinitionContainer, dN as FlowDefinitionNode, dF as FlowDefinitionNodeBase, dH as FlowDefinitionStep, ds as FlowErrorStrategy, j as FlowExecutionEvent, df as FlowFailedEvent, d5 as FlowInstanceStatus, d6 as FlowInstanceStatusResponse, d7 as FlowMetrics, dd as FlowResumedEvent, d4 as FlowRunResponse, cF as FlowRunResult, dG as FlowStepProperties, dc as FlowWaitingEvent, i as FlowsApi, cS as FunctionInvokeOptions, cT as FunctionInvokeResponse, cU as FunctionInvokeSyncResponse, cH as FunctionsApi, dy as HandoffTarget, b7 as HttpArchetypes, $ as HttpCurrentUser, Z as HttpDatabase, b8 as HttpElementTypes, cI as HttpFunctionsApi, b6 as HttpNodeTypes, a0 as HttpUserNode, _ as HttpWorkspaceClient, dv as HumanTaskType, cJ as IdentityAuthApi, bm as IdentityAuthError, bl as IdentityAuthResponse, cL as IdentityAuthResult, cM as IdentityAuthTransport, cN as IdentityInfo, cO as IdentityMe, I as IdentityUser, dX as InboxApi, dY as InboxApiOptions, dP as InboxTask, dQ as InboxTaskStatus, bt as IncomingRelation, es as ListConversationsOptions, b1 as ListInvocationsFilter, dZ as ListTasksOptions, d_ as ListTasksResponse, bj as LocalStorageTokenStorage, dm as LogEvent, c5 as LogLevel, cb as LoggerConfig, dM as LoopConfig, cQ as MagicLinkOptions, cP as MagicLinkSent, aB as MailboxEntry, c$ as McpCallToolResult, cV as McpClient, c_ as McpContentBlock, cX as McpFrameStream, cY as McpJsonRpcFrame, d1 as McpReadResourceResult, d0 as McpResourceContents, d3 as McpResourceSubscription, d2 as McpResourceUpdate, cZ as McpToolDescriptor, cW as McpTransport, bi as MemoryTokenStorage, dK as MergeStrategy, e3 as MessageBody, ee as MessageChild, dl as MessageSavedEvent, aa as NodeCreateDeepOptions, bw as NodeCreateDeepPayload, a9 as NodeCreateOptions, bv as NodeCreatePayload, by as NodeDeletePayload, aE as NodeDevApi, aH as NodeDevCommitOutcome, aI as NodeDevCommon, aJ as NodeDevConflict, aP as NodeDevReceipt, aK as NodeDevTransport, an as NodeDiffInfo, bp as NodeEventPayload, cx as NodeFileSource, bz as NodeGetPayload, bA as NodeHistoryPayload, aL as NodeLocator, a8 as NodeOperations, ac as NodeQueryOptions, bE as NodeQueryPayload, bu as NodeRelationships, aM as NodeRevision, aN as NodeTarget, af as NodeTypes, ab as NodeUpdateOptions, bx as NodeUpdatePayload, aO as OpReceipt, ex as PlanActionOptions, ew as PlanActionReceipt, P as PlanProjection, k as PlanProjectionTask, ef as PlanTask, dS as RETRY_STRATEGIES, dp as RaisinReference, c4 as ReconnectManager, bU as RefreshTokenPayload, bF as RelationAddPayload, bG as RelationRemovePayload, bH as RelationsGetPayload, bq as RequestContext, bn as RequestEnvelope, b_ as RequestType, bo as ResponseEnvelope, bs as ResponseMetadata, b$ as ResponseStatus, dt as RetryConfig, du as RetryStrategy, bB as RevisionEntry, b2 as ScheduleInvocationOptions, b3 as ScheduledInvocation, b4 as ScheduledInvocationRef, b5 as ScheduledInvocationTargetKind, ap as SchedulerApi, b9 as SchemaCommit, G as SearchOptions, J as SearchPassage, eu as SendMessageOptions, a1 as SignAssetOptions, a2 as SignedAssetUrl, aC as SpawnChildOptions, aD as SpawnChildResult, ba as SqlQuery, bI as SqlQueryPayload, bJ as SqlResult, ep as StartAnonymousOptions, d9 as StepCompletedEvent, dr as StepErrorBehavior, db as StepFailedEvent, d8 as StepStartedEvent, da as StepUsage, bP as SubscribePayload, bf as Subscription, S as SubscriptionFilters, bR as SubscriptionResponse, ao as Tags, dR as TaskCompletionResult, dx as TaskOption, dg as TextChunkEvent, dj as ThoughtChunkEvent, bk as TokenStorage, di as ToolCallCompletedEvent, T as ToolCallInfo, ed as ToolCallRecord, dh as ToolCallStartedEvent, ad as Transaction, bV as TransactionBeginPayload, bW as TransactionBeginResponse, bX as TransactionCommitPayload, bY as TransactionCommitResponse, ae as TransactionOptions, bZ as TransactionRollbackPayload, bQ as UnsubscribePayload, cg as Upload, co as UploadError, cD as UploadManager, cd as UploadOptions, ce as UploadProgress, cf as UploadResult, cc as UploadStatus, ck as UploadStatusResponse, cC as Uploader, Y as UserChangeCallback, X as UserChangeEvent, M as UserNode, em as VisitorChatError, eq as VisitorChatLimits, er as VisitorSessionStore, aQ as WorkRoot, bK as Workspace, a4 as WorkspaceClient, a6 as WorkspaceCreateOptions, bL as WorkspaceCreatePayload, bN as WorkspaceDeletePayload, bM as WorkspaceGetPayload, a5 as WorkspaceManager, W as WorkspaceScope, a7 as WorkspaceUpdateOptions, bO as WorkspaceUpdatePayload, cA as calculateChunkCount, c7 as configureLogger, cy as createFileSource, bb as createSqlHandler, c1 as decodeMessage, en as defaultVisitorSessionStore, c0 as encodeMessage, cB as getChunkRange, cz as getContentType, c9 as getLogLevel, ca as getLoggerConfig, dT as getRefDisplayName, dU as getRefPath, c2 as isEventMessage, dW as isFlowDefinitionContainer, dV as isFlowDefinitionStep, c3 as isResponseEnvelope, dn as isTerminalEvent, c6 as logger, ar as newControlId, ez as projectPlansFromMessages, cK as readTokensFromFragment, c8 as setLogLevel, as as subjectOf } from './conversation-list-store-CqgIk8Rn.js';
|
|
3
|
+
export { F as FlowStatus, j as RaisinContextValue, i as RaisinProviderProps, g as RaisinReact, R as ReactLike, h as ReactLikeWithContext, k as UseAuthReturn, l as UseConnectionReturn, b as UseConversationListReturn, U as UseConversationReturn, d as UseFlowOptions, e as UseFlowReturn, m as UseSqlOptions, n as UseSqlReturn, o as UseSubscriptionOptions, f as createRaisinReact, u as useConversation, a as useConversationList, c as useFlow } from './index-CDUAMIub.js';
|
|
4
4
|
export { AuthAdapter, AuthSnapshot, ConnectionAdapter, ConnectionSnapshot, FlowAdapter, FlowAdapterOptions, FlowSnapshot, RAISIN_CONTEXT_KEY, RaisinContext, SubscriptionAdapter, FlowStatus as SvelteFlowStatus, createAuthAdapter, createConnectionAdapter, createConversationAdapter, createConversationListAdapter, createFlowAdapter, createSubscriptionAdapter } from './svelte.js';
|
|
5
|
-
export { b as SqlAdapter, S as SqlAdapterOptions, a as SqlSnapshot, c as createSqlAdapter } from './svelte-sql-
|
|
5
|
+
export { b as SqlAdapter, S as SqlAdapterOptions, a as SqlSnapshot, c as createSqlAdapter } from './svelte-sql-D9YU1wYS.js';
|
|
6
6
|
export { RaisinVue, VueComputedRef, VueLike, VueRef, createRaisinVue } from './vue.js';
|
|
7
7
|
import 'events';
|
|
8
8
|
import 'fs/promises';
|
package/dist/index.js
CHANGED
|
@@ -99,6 +99,7 @@ __export(src_exports, {
|
|
|
99
99
|
UploadErrorCode: () => UploadErrorCode,
|
|
100
100
|
UploadManager: () => UploadManager,
|
|
101
101
|
Uploader: () => Uploader,
|
|
102
|
+
VisitorChatError: () => VisitorChatError,
|
|
102
103
|
WorkspaceClient: () => WorkspaceClient,
|
|
103
104
|
WorkspaceManager: () => WorkspaceManager,
|
|
104
105
|
calculateChunkCount: () => calculateChunkCount,
|
|
@@ -120,6 +121,7 @@ __export(src_exports, {
|
|
|
120
121
|
createSqlHandler: () => createSqlHandler,
|
|
121
122
|
createSubscriptionAdapter: () => createSubscriptionAdapter,
|
|
122
123
|
decodeMessage: () => decodeMessage,
|
|
124
|
+
defaultVisitorSessionStore: () => defaultVisitorSessionStore,
|
|
123
125
|
encodeMessage: () => encodeMessage,
|
|
124
126
|
getChunkRange: () => getChunkRange,
|
|
125
127
|
getContentType: () => getContentType,
|
|
@@ -973,6 +975,8 @@ var RequestType = /* @__PURE__ */ ((RequestType2) => {
|
|
|
973
975
|
RequestType2["ScheduledInvocationCancel"] = "scheduled_invocation_cancel";
|
|
974
976
|
RequestType2["ScheduledInvocationList"] = "scheduled_invocation_list";
|
|
975
977
|
RequestType2["ScheduledInvocationGet"] = "scheduled_invocation_get";
|
|
978
|
+
RequestType2["VisitorChatStart"] = "visitor_chat_start";
|
|
979
|
+
RequestType2["VisitorChatSend"] = "visitor_chat_send";
|
|
976
980
|
return RequestType2;
|
|
977
981
|
})(RequestType || {});
|
|
978
982
|
var ResponseStatus = /* @__PURE__ */ ((ResponseStatus2) => {
|
|
@@ -1256,7 +1260,8 @@ var EventHandler = class {
|
|
|
1256
1260
|
this.filterSubscriptions.set(hash, {
|
|
1257
1261
|
serverId: subscriptionId,
|
|
1258
1262
|
filters: {},
|
|
1259
|
-
callbacks: /* @__PURE__ */ new Set([callback])
|
|
1263
|
+
callbacks: /* @__PURE__ */ new Set([callback]),
|
|
1264
|
+
synthetic: true
|
|
1260
1265
|
});
|
|
1261
1266
|
this.subscriptions.set(subscriptionId, hash);
|
|
1262
1267
|
this.callbackToHash.set(callback, hash);
|
|
@@ -1291,11 +1296,12 @@ var EventHandler = class {
|
|
|
1291
1296
|
async restoreSubscriptions(options) {
|
|
1292
1297
|
if (!options?.retry) {
|
|
1293
1298
|
for (const entry of this.filterSubscriptions.values()) {
|
|
1299
|
+
if (entry.synthetic) continue;
|
|
1294
1300
|
this.subscriptions.delete(entry.serverId);
|
|
1295
1301
|
entry.restorePending = true;
|
|
1296
1302
|
}
|
|
1297
1303
|
}
|
|
1298
|
-
const entriesToRestore = Array.from(this.filterSubscriptions.entries()).filter(([, entry]) => entry.restorePending);
|
|
1304
|
+
const entriesToRestore = Array.from(this.filterSubscriptions.entries()).filter(([, entry]) => entry.restorePending && !entry.synthetic);
|
|
1299
1305
|
let failureCount = 0;
|
|
1300
1306
|
let lastError;
|
|
1301
1307
|
for (const [hash, entry] of entriesToRestore) {
|
|
@@ -4487,7 +4493,8 @@ function normalizeHomePath(home) {
|
|
|
4487
4493
|
// src/conversations.ts
|
|
4488
4494
|
var DEFAULT_SEND_MESSAGE_INACTIVITY_TIMEOUT_MS = 12e4;
|
|
4489
4495
|
var ConversationManager = class {
|
|
4490
|
-
constructor(baseUrl, repository, authManager, options = {}, executeSql) {
|
|
4496
|
+
constructor(baseUrl, repository, authManager, options = {}, executeSql, visitor) {
|
|
4497
|
+
this.visitor = visitor;
|
|
4491
4498
|
this.baseUrl = baseUrl.replace(/\/$/, "");
|
|
4492
4499
|
this.repository = repository;
|
|
4493
4500
|
this.authManager = authManager;
|
|
@@ -4608,6 +4615,45 @@ var ConversationManager = class {
|
|
|
4608
4615
|
]
|
|
4609
4616
|
};
|
|
4610
4617
|
}
|
|
4618
|
+
/**
|
|
4619
|
+
* Start (or resume) an ANONYMOUS conversation with an agent — a public
|
|
4620
|
+
* website's chat, without login.
|
|
4621
|
+
*
|
|
4622
|
+
* Works on an anonymous connection only, and only with an agent that allows
|
|
4623
|
+
* anonymous visitors (`anonymous.enabled: true` on its raisin:AIAgent). The
|
|
4624
|
+
* server keeps the conversation in an ephemeral visitor session that only
|
|
4625
|
+
* this browser session can read; the session secret is kept in
|
|
4626
|
+
* sessionStorage (override with `options.store`), so a reload continues the
|
|
4627
|
+
* same conversation. Then use `sendMessage`, `getMessages`, `subscribe` and
|
|
4628
|
+
* `ConversationStore` / `useConversation` exactly as for a signed-in user.
|
|
4629
|
+
*
|
|
4630
|
+
* @example
|
|
4631
|
+
* ```typescript
|
|
4632
|
+
* const convo = await db.conversations.startAnonymous('/agents/website-assistant');
|
|
4633
|
+
* for await (const ev of db.conversations.sendMessage(convo.conversationPath, 'Hello')) {
|
|
4634
|
+
* if (ev.type === 'text_chunk') append(ev.text);
|
|
4635
|
+
* if (ev.type === 'failed') showLimit(ev.code); // e.g. RATE_LIMITED, LIMIT_REACHED
|
|
4636
|
+
* }
|
|
4637
|
+
* ```
|
|
4638
|
+
*/
|
|
4639
|
+
async startAnonymous(agent, options) {
|
|
4640
|
+
if (!this.visitor) {
|
|
4641
|
+
throw new Error("Anonymous chat needs a WebSocket database: use client.database(repo).");
|
|
4642
|
+
}
|
|
4643
|
+
return this.visitor.start(this.normalizeAgentPath(agent), options);
|
|
4644
|
+
}
|
|
4645
|
+
/** Forget the stored anonymous session for `agent` (the next start begins a new one). */
|
|
4646
|
+
forgetAnonymous(agent, options) {
|
|
4647
|
+
this.visitor?.forget(this.normalizeAgentPath(agent), options);
|
|
4648
|
+
}
|
|
4649
|
+
/** Whether this tab remembers an anonymous conversation with `agent`. */
|
|
4650
|
+
hasStoredAnonymous(agent, options) {
|
|
4651
|
+
return this.visitor?.remembers(this.normalizeAgentPath(agent), options) ?? false;
|
|
4652
|
+
}
|
|
4653
|
+
/** Whether `conversationPath` is an anonymous conversation of this client. */
|
|
4654
|
+
isAnonymous(conversationPath) {
|
|
4655
|
+
return this.visitor?.isAnonymous(conversationPath) ?? false;
|
|
4656
|
+
}
|
|
4611
4657
|
/**
|
|
4612
4658
|
* Open an existing conversation by path.
|
|
4613
4659
|
* Returns null if not found.
|
|
@@ -4653,6 +4699,7 @@ var ConversationManager = class {
|
|
|
4653
4699
|
* Mark a conversation as read by setting unread_count to 0.
|
|
4654
4700
|
*/
|
|
4655
4701
|
async markAsRead(conversationPath) {
|
|
4702
|
+
if (this.isAnonymous(conversationPath)) return;
|
|
4656
4703
|
const workspace = "raisin:access_control";
|
|
4657
4704
|
await this.sqlQuery(
|
|
4658
4705
|
`UPDATE '${workspace}' SET properties = jsonb_set(properties, '{unread_count}', '0'::jsonb) WHERE path = $1 AND node_type = 'raisin:Conversation'`,
|
|
@@ -4663,6 +4710,7 @@ var ConversationManager = class {
|
|
|
4663
4710
|
* Mark a single message as read by the current user.
|
|
4664
4711
|
*/
|
|
4665
4712
|
async markMessageAsRead(messagePath) {
|
|
4713
|
+
if (messagePath.startsWith("/visitors/")) return;
|
|
4666
4714
|
const workspace = "raisin:access_control";
|
|
4667
4715
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
4668
4716
|
await this.sqlQuery(
|
|
@@ -4687,6 +4735,18 @@ var ConversationManager = class {
|
|
|
4687
4735
|
*/
|
|
4688
4736
|
async *sendMessage(conversationPath, content, options) {
|
|
4689
4737
|
const shouldStream = options?.stream !== false;
|
|
4738
|
+
if (this.visitor?.isAnonymous(conversationPath)) {
|
|
4739
|
+
if (!shouldStream) {
|
|
4740
|
+
await this.visitor.post(conversationPath, content);
|
|
4741
|
+
yield { type: "waiting", timestamp: (/* @__PURE__ */ new Date()).toISOString() };
|
|
4742
|
+
return;
|
|
4743
|
+
}
|
|
4744
|
+
yield* this.visitor.stream(conversationPath, content, {
|
|
4745
|
+
signal: options?.signal,
|
|
4746
|
+
inactivityTimeoutMs: options?.inactivityTimeoutMs ?? DEFAULT_SEND_MESSAGE_INACTIVITY_TIMEOUT_MS
|
|
4747
|
+
});
|
|
4748
|
+
return;
|
|
4749
|
+
}
|
|
4690
4750
|
logger.debug("[ConversationManager] Starting SSE stream for message send");
|
|
4691
4751
|
if (!shouldStream) {
|
|
4692
4752
|
await this.createUserMessage(conversationPath, content);
|
|
@@ -4774,6 +4834,10 @@ var ConversationManager = class {
|
|
|
4774
4834
|
*/
|
|
4775
4835
|
async createUserMessage(conversationPath, content) {
|
|
4776
4836
|
logger.debug("[ConversationManager] Creating user message", { path: conversationPath });
|
|
4837
|
+
if (this.visitor?.isAnonymous(conversationPath)) {
|
|
4838
|
+
await this.visitor.post(conversationPath, content);
|
|
4839
|
+
return;
|
|
4840
|
+
}
|
|
4777
4841
|
const workspace = "raisin:access_control";
|
|
4778
4842
|
const properties = await this.loadConversationProperties(conversationPath, workspace);
|
|
4779
4843
|
const flowInstanceId = typeof properties?.flow_instance_id === "string" ? properties.flow_instance_id.trim() : "";
|
|
@@ -4825,6 +4889,12 @@ var ConversationManager = class {
|
|
|
4825
4889
|
* initiated messages, etc.). Auto-reconnects on disconnect.
|
|
4826
4890
|
*/
|
|
4827
4891
|
subscribe(conversationPath, onEvent, options) {
|
|
4892
|
+
if (this.visitor?.isAnonymous(conversationPath)) {
|
|
4893
|
+
const stop = this.visitor.listen(conversationPath, onEvent);
|
|
4894
|
+
options?.signal?.addEventListener("abort", stop, { once: true });
|
|
4895
|
+
return { unsubscribe: stop, waitUntilConnected: async () => {
|
|
4896
|
+
} };
|
|
4897
|
+
}
|
|
4828
4898
|
logger.info("[ConversationManager] Subscribing to SSE", { path: conversationPath });
|
|
4829
4899
|
const sseUrl = `${this.baseUrl}/api/conversations/${this.repository}/events`;
|
|
4830
4900
|
const headers = {};
|
|
@@ -5264,6 +5334,272 @@ var ConversationManager = class {
|
|
|
5264
5334
|
}
|
|
5265
5335
|
};
|
|
5266
5336
|
|
|
5337
|
+
// src/visitor-chat.ts
|
|
5338
|
+
function defaultVisitorSessionStore() {
|
|
5339
|
+
const memory = /* @__PURE__ */ new Map();
|
|
5340
|
+
const storage = () => {
|
|
5341
|
+
try {
|
|
5342
|
+
return typeof sessionStorage !== "undefined" ? sessionStorage : null;
|
|
5343
|
+
} catch {
|
|
5344
|
+
return null;
|
|
5345
|
+
}
|
|
5346
|
+
};
|
|
5347
|
+
return {
|
|
5348
|
+
get(key) {
|
|
5349
|
+
try {
|
|
5350
|
+
return storage()?.getItem(key) ?? memory.get(key) ?? null;
|
|
5351
|
+
} catch {
|
|
5352
|
+
return memory.get(key) ?? null;
|
|
5353
|
+
}
|
|
5354
|
+
},
|
|
5355
|
+
set(key, value) {
|
|
5356
|
+
memory.set(key, value);
|
|
5357
|
+
try {
|
|
5358
|
+
storage()?.setItem(key, value);
|
|
5359
|
+
} catch {
|
|
5360
|
+
}
|
|
5361
|
+
},
|
|
5362
|
+
remove(key) {
|
|
5363
|
+
memory.delete(key);
|
|
5364
|
+
try {
|
|
5365
|
+
storage()?.removeItem(key);
|
|
5366
|
+
} catch {
|
|
5367
|
+
}
|
|
5368
|
+
}
|
|
5369
|
+
};
|
|
5370
|
+
}
|
|
5371
|
+
var VisitorChatError = class extends Error {
|
|
5372
|
+
constructor(message, code) {
|
|
5373
|
+
super(message);
|
|
5374
|
+
this.name = "VisitorChatError";
|
|
5375
|
+
this.code = code;
|
|
5376
|
+
}
|
|
5377
|
+
};
|
|
5378
|
+
var REBIND_CODES = /* @__PURE__ */ new Set(["NO_SESSION", "UNKNOWN_CONVERSATION"]);
|
|
5379
|
+
function asError(err) {
|
|
5380
|
+
const e = err;
|
|
5381
|
+
return new VisitorChatError(e?.message ?? String(err), e?.code ?? "UNAVAILABLE");
|
|
5382
|
+
}
|
|
5383
|
+
var VisitorChat = class {
|
|
5384
|
+
constructor(repository, send, events, onReconnected) {
|
|
5385
|
+
this.repository = repository;
|
|
5386
|
+
this.send = send;
|
|
5387
|
+
this.events = events;
|
|
5388
|
+
this.byPath = /* @__PURE__ */ new Map();
|
|
5389
|
+
this.token = null;
|
|
5390
|
+
onReconnected?.(() => {
|
|
5391
|
+
void this.rebindAll();
|
|
5392
|
+
});
|
|
5393
|
+
}
|
|
5394
|
+
/** Whether `conversationPath` is a visitor conversation started here. */
|
|
5395
|
+
isAnonymous(conversationPath) {
|
|
5396
|
+
return this.byPath.has(conversationPath);
|
|
5397
|
+
}
|
|
5398
|
+
storeOf(options) {
|
|
5399
|
+
if (options.store === false) return null;
|
|
5400
|
+
return options.store ?? defaultVisitorSessionStore();
|
|
5401
|
+
}
|
|
5402
|
+
keyOf(agent, options) {
|
|
5403
|
+
return options.storageKey ?? `raisindb:visitor:${this.repository}:${agent}`;
|
|
5404
|
+
}
|
|
5405
|
+
/** Start (or resume) a visitor conversation with `agent` (`/agents/<name>`). */
|
|
5406
|
+
async start(agent, options = {}) {
|
|
5407
|
+
const store = this.storeOf(options);
|
|
5408
|
+
const key = this.keyOf(agent, options);
|
|
5409
|
+
const sessionToken = options.sessionToken ?? this.token ?? store?.get(`${key}:session`) ?? void 0;
|
|
5410
|
+
const conversationId = options.newConversation ? void 0 : options.conversationId ?? store?.get(`${key}:conversation`) ?? void 0;
|
|
5411
|
+
let res;
|
|
5412
|
+
try {
|
|
5413
|
+
res = await this.send(
|
|
5414
|
+
{ agent, session_token: sessionToken, conversation_id: conversationId },
|
|
5415
|
+
"visitor_chat_start"
|
|
5416
|
+
);
|
|
5417
|
+
} catch (err) {
|
|
5418
|
+
const e = asError(err);
|
|
5419
|
+
if ((conversationId || sessionToken) && !options.conversationId && !options.sessionToken && ["UNKNOWN_CONVERSATION", "INVALID_CONVERSATION", "SESSION_EXPIRED", "SESSION_MISMATCH"].includes(e.code)) {
|
|
5420
|
+
store?.remove(`${key}:conversation`);
|
|
5421
|
+
if (e.code !== "UNKNOWN_CONVERSATION" && e.code !== "INVALID_CONVERSATION") {
|
|
5422
|
+
store?.remove(`${key}:session`);
|
|
5423
|
+
this.token = null;
|
|
5424
|
+
}
|
|
5425
|
+
return this.start(agent, { ...options, newConversation: true });
|
|
5426
|
+
}
|
|
5427
|
+
throw e;
|
|
5428
|
+
}
|
|
5429
|
+
const token = res.session_token ?? sessionToken ?? this.token;
|
|
5430
|
+
if (!token) throw new VisitorChatError("the server returned no session", "UNAVAILABLE");
|
|
5431
|
+
this.token = token;
|
|
5432
|
+
store?.set(`${key}:session`, token);
|
|
5433
|
+
store?.set(`${key}:conversation`, res.conversation_id);
|
|
5434
|
+
const path = res.conversation_path;
|
|
5435
|
+
let entry = this.byPath.get(path);
|
|
5436
|
+
if (!entry) {
|
|
5437
|
+
entry = {
|
|
5438
|
+
agent: res.agent,
|
|
5439
|
+
conversationId: res.conversation_id,
|
|
5440
|
+
subscriptionId: res.subscription_id,
|
|
5441
|
+
listeners: /* @__PURE__ */ new Set(),
|
|
5442
|
+
options
|
|
5443
|
+
};
|
|
5444
|
+
this.byPath.set(path, entry);
|
|
5445
|
+
}
|
|
5446
|
+
this.route(entry);
|
|
5447
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
5448
|
+
return {
|
|
5449
|
+
id: res.conversation_id,
|
|
5450
|
+
type: "ai_chat",
|
|
5451
|
+
agentRef: res.agent,
|
|
5452
|
+
conversationPath: path,
|
|
5453
|
+
conversationWorkspace: res.conversation_workspace,
|
|
5454
|
+
anonymous: true,
|
|
5455
|
+
conversationId: res.conversation_id,
|
|
5456
|
+
sessionToken: token,
|
|
5457
|
+
limits: res.limits,
|
|
5458
|
+
initialEvents: [{ type: "waiting", timestamp: now }]
|
|
5459
|
+
};
|
|
5460
|
+
}
|
|
5461
|
+
/** Route the server's forwarded events for this conversation to its listeners. */
|
|
5462
|
+
route(entry) {
|
|
5463
|
+
this.events.removeFlowEventListener(entry.subscriptionId);
|
|
5464
|
+
this.events.addFlowEventListener(entry.subscriptionId, (msg) => {
|
|
5465
|
+
const event = msg.payload;
|
|
5466
|
+
if (!event || typeof event.type !== "string") return;
|
|
5467
|
+
for (const listener of entry.listeners) {
|
|
5468
|
+
try {
|
|
5469
|
+
listener(event);
|
|
5470
|
+
} catch (err) {
|
|
5471
|
+
logger.error("[VisitorChat] listener failed", err);
|
|
5472
|
+
}
|
|
5473
|
+
}
|
|
5474
|
+
});
|
|
5475
|
+
}
|
|
5476
|
+
/** Re-prove the session on a new connection, for every conversation started here. */
|
|
5477
|
+
async rebindAll() {
|
|
5478
|
+
for (const entry of this.byPath.values()) {
|
|
5479
|
+
try {
|
|
5480
|
+
await this.send(
|
|
5481
|
+
{ agent: entry.agent, session_token: this.token, conversation_id: entry.conversationId },
|
|
5482
|
+
"visitor_chat_start"
|
|
5483
|
+
);
|
|
5484
|
+
this.route(entry);
|
|
5485
|
+
} catch (err) {
|
|
5486
|
+
logger.warn("[VisitorChat] could not resume a conversation after reconnect", err);
|
|
5487
|
+
}
|
|
5488
|
+
}
|
|
5489
|
+
}
|
|
5490
|
+
/** Listen to a visitor conversation's events. Returns an unsubscribe function. */
|
|
5491
|
+
listen(conversationPath, listener) {
|
|
5492
|
+
const entry = this.require(conversationPath);
|
|
5493
|
+
entry.listeners.add(listener);
|
|
5494
|
+
return () => {
|
|
5495
|
+
entry.listeners.delete(listener);
|
|
5496
|
+
};
|
|
5497
|
+
}
|
|
5498
|
+
require(conversationPath) {
|
|
5499
|
+
const entry = this.byPath.get(conversationPath);
|
|
5500
|
+
if (!entry) {
|
|
5501
|
+
throw new VisitorChatError(
|
|
5502
|
+
"not a visitor conversation of this client; call startAnonymous first",
|
|
5503
|
+
"UNKNOWN_CONVERSATION"
|
|
5504
|
+
);
|
|
5505
|
+
}
|
|
5506
|
+
return entry;
|
|
5507
|
+
}
|
|
5508
|
+
/** Make sure this connection is bound (after a reconnect nothing else may read the home). */
|
|
5509
|
+
async ensureBound(conversationPath) {
|
|
5510
|
+
const entry = this.require(conversationPath);
|
|
5511
|
+
await this.send(
|
|
5512
|
+
{ agent: entry.agent, session_token: this.token, conversation_id: entry.conversationId },
|
|
5513
|
+
"visitor_chat_start"
|
|
5514
|
+
).catch((err) => {
|
|
5515
|
+
throw asError(err);
|
|
5516
|
+
});
|
|
5517
|
+
}
|
|
5518
|
+
/** Send one visitor message. Events arrive through {@link listen}. */
|
|
5519
|
+
async post(conversationPath, text) {
|
|
5520
|
+
const entry = this.require(conversationPath);
|
|
5521
|
+
const once = async () => await this.send(
|
|
5522
|
+
{ conversation_id: entry.conversationId, text },
|
|
5523
|
+
"visitor_chat_send"
|
|
5524
|
+
);
|
|
5525
|
+
try {
|
|
5526
|
+
const res = await once();
|
|
5527
|
+
return { messageId: res.message_id, messagesLeft: res.messages_left };
|
|
5528
|
+
} catch (err) {
|
|
5529
|
+
const e = asError(err);
|
|
5530
|
+
if (!REBIND_CODES.has(e.code)) throw e;
|
|
5531
|
+
await this.ensureBound(conversationPath);
|
|
5532
|
+
this.route(entry);
|
|
5533
|
+
const res = await once().catch((again) => {
|
|
5534
|
+
throw asError(again);
|
|
5535
|
+
});
|
|
5536
|
+
return { messageId: res.message_id, messagesLeft: res.messages_left };
|
|
5537
|
+
}
|
|
5538
|
+
}
|
|
5539
|
+
/**
|
|
5540
|
+
* Send one visitor message and stream the turn: `text_chunk`,
|
|
5541
|
+
* `tool_call_started`, `tool_call_completed`, … until `done`. A refusal
|
|
5542
|
+
* ends the stream with `failed` (its `code` says why). No event for
|
|
5543
|
+
* `inactivityTimeoutMs` ends it with a synthetic `waiting`.
|
|
5544
|
+
*/
|
|
5545
|
+
async *stream(conversationPath, text, options = {}) {
|
|
5546
|
+
const queue = [];
|
|
5547
|
+
let wake = null;
|
|
5548
|
+
const push = (event) => {
|
|
5549
|
+
queue.push(event);
|
|
5550
|
+
wake?.();
|
|
5551
|
+
};
|
|
5552
|
+
const stop = this.listen(conversationPath, push);
|
|
5553
|
+
const onAbort = () => push({ type: "failed", error: "aborted", code: "ABORTED", timestamp: (/* @__PURE__ */ new Date()).toISOString() });
|
|
5554
|
+
options.signal?.addEventListener("abort", onAbort, { once: true });
|
|
5555
|
+
const timeout = options.inactivityTimeoutMs ?? 12e4;
|
|
5556
|
+
try {
|
|
5557
|
+
try {
|
|
5558
|
+
await this.post(conversationPath, text);
|
|
5559
|
+
} catch (err) {
|
|
5560
|
+
const e = asError(err);
|
|
5561
|
+
yield { type: "failed", error: e.message, code: e.code, timestamp: (/* @__PURE__ */ new Date()).toISOString() };
|
|
5562
|
+
return;
|
|
5563
|
+
}
|
|
5564
|
+
for (; ; ) {
|
|
5565
|
+
if (!queue.length) {
|
|
5566
|
+
const idle = await new Promise((resolve) => {
|
|
5567
|
+
const timer = timeout > 0 ? setTimeout(() => resolve(true), timeout) : null;
|
|
5568
|
+
wake = () => {
|
|
5569
|
+
if (timer) clearTimeout(timer);
|
|
5570
|
+
resolve(false);
|
|
5571
|
+
};
|
|
5572
|
+
});
|
|
5573
|
+
wake = null;
|
|
5574
|
+
if (idle && !queue.length) {
|
|
5575
|
+
yield { type: "waiting", timestamp: (/* @__PURE__ */ new Date()).toISOString() };
|
|
5576
|
+
return;
|
|
5577
|
+
}
|
|
5578
|
+
}
|
|
5579
|
+
const event = queue.shift();
|
|
5580
|
+
yield event;
|
|
5581
|
+
if (event.type === "done" || event.type === "failed" || event.type === "waiting") return;
|
|
5582
|
+
}
|
|
5583
|
+
} finally {
|
|
5584
|
+
stop();
|
|
5585
|
+
options.signal?.removeEventListener("abort", onAbort);
|
|
5586
|
+
}
|
|
5587
|
+
}
|
|
5588
|
+
/** Whether the store remembers a conversation with `agent`. */
|
|
5589
|
+
remembers(agent, options = {}) {
|
|
5590
|
+
const store = this.storeOf(options);
|
|
5591
|
+
return !!store?.get(`${this.keyOf(agent, options)}:conversation`);
|
|
5592
|
+
}
|
|
5593
|
+
/** Forget the stored session (e.g. a "new chat" button that should start a new session). */
|
|
5594
|
+
forget(agent, options = {}) {
|
|
5595
|
+
const store = this.storeOf(options);
|
|
5596
|
+
const key = this.keyOf(agent, options);
|
|
5597
|
+
store?.remove(`${key}:session`);
|
|
5598
|
+
store?.remove(`${key}:conversation`);
|
|
5599
|
+
this.token = null;
|
|
5600
|
+
}
|
|
5601
|
+
};
|
|
5602
|
+
|
|
5267
5603
|
// src/flow-client.ts
|
|
5268
5604
|
var FlowClient = class _FlowClient {
|
|
5269
5605
|
/**
|
|
@@ -6156,7 +6492,13 @@ var Database = class _Database {
|
|
|
6156
6492
|
this.repository,
|
|
6157
6493
|
this.httpOptions.authManager,
|
|
6158
6494
|
{},
|
|
6159
|
-
(query, params) => this.executeSql(query, params)
|
|
6495
|
+
(query, params) => this.executeSql(query, params),
|
|
6496
|
+
new VisitorChat(
|
|
6497
|
+
this.repository,
|
|
6498
|
+
(payload, requestType) => this.sendRequest(payload, requestType),
|
|
6499
|
+
this.eventHandler,
|
|
6500
|
+
this.httpOptions.onReconnected
|
|
6501
|
+
)
|
|
6160
6502
|
);
|
|
6161
6503
|
}
|
|
6162
6504
|
return this._conversationManager;
|
|
@@ -10023,7 +10365,11 @@ var _RaisinClient = class _RaisinClient extends import_events4.EventEmitter {
|
|
|
10023
10365
|
void 0,
|
|
10024
10366
|
() => this.getUploadManager(),
|
|
10025
10367
|
(options) => this.signAssetUrl(options),
|
|
10026
|
-
{
|
|
10368
|
+
{
|
|
10369
|
+
httpBaseUrl: this._httpBaseUrl,
|
|
10370
|
+
authManager: this.authManager,
|
|
10371
|
+
onReconnected: (callback) => this.onReconnected(callback)
|
|
10372
|
+
}
|
|
10027
10373
|
);
|
|
10028
10374
|
}
|
|
10029
10375
|
/**
|
|
@@ -11403,6 +11749,34 @@ var ConversationStore = class {
|
|
|
11403
11749
|
this._watchdogIntervalMs = options.watchdogIntervalMs ?? 3e4;
|
|
11404
11750
|
if (this._conversationPath) {
|
|
11405
11751
|
this.ensureSubscription();
|
|
11752
|
+
} else if (this.createOptions?.anonymous) {
|
|
11753
|
+
void this.resumeAnonymous();
|
|
11754
|
+
}
|
|
11755
|
+
}
|
|
11756
|
+
anonymousOptions() {
|
|
11757
|
+
const a = this.createOptions?.anonymous;
|
|
11758
|
+
if (!a) return null;
|
|
11759
|
+
return a === true ? {} : a;
|
|
11760
|
+
}
|
|
11761
|
+
/**
|
|
11762
|
+
* Resume the visitor conversation this tab already has (the session secret
|
|
11763
|
+
* and conversation id live in sessionStorage), and load its history. A tab
|
|
11764
|
+
* without one starts nothing until the first message.
|
|
11765
|
+
*/
|
|
11766
|
+
async resumeAnonymous() {
|
|
11767
|
+
const opts = this.anonymousOptions();
|
|
11768
|
+
if (!opts || !this.createOptions || this._conversationPath) return;
|
|
11769
|
+
const agent = this.createOptions.participant;
|
|
11770
|
+
try {
|
|
11771
|
+
if (!this.manager.hasStoredAnonymous(agent, opts)) return;
|
|
11772
|
+
const convo = await this.manager.startAnonymous(agent, opts);
|
|
11773
|
+
if (this._conversationPath) return;
|
|
11774
|
+
this._conversationPath = convo.conversationPath;
|
|
11775
|
+
this._conversationType = convo.type;
|
|
11776
|
+
this.ensureSubscription();
|
|
11777
|
+
await this.loadMessages();
|
|
11778
|
+
} catch (err) {
|
|
11779
|
+
logger.debug("[ConversationStore] No visitor conversation to resume", err);
|
|
11406
11780
|
}
|
|
11407
11781
|
}
|
|
11408
11782
|
// ==========================================================================
|
|
@@ -11457,7 +11831,8 @@ var ConversationStore = class {
|
|
|
11457
11831
|
throw new Error("No conversationPath and no createOptions provided");
|
|
11458
11832
|
}
|
|
11459
11833
|
try {
|
|
11460
|
-
const
|
|
11834
|
+
const anonymous = this.anonymousOptions();
|
|
11835
|
+
const convo = anonymous ? await this.manager.startAnonymous(this.createOptions.participant, anonymous) : await this.manager.create({
|
|
11461
11836
|
participant: this.createOptions.participant,
|
|
11462
11837
|
input: this.createOptions.input
|
|
11463
11838
|
});
|
|
@@ -13345,6 +13720,7 @@ function createRaisinVue(vue) {
|
|
|
13345
13720
|
UploadErrorCode,
|
|
13346
13721
|
UploadManager,
|
|
13347
13722
|
Uploader,
|
|
13723
|
+
VisitorChatError,
|
|
13348
13724
|
WorkspaceClient,
|
|
13349
13725
|
WorkspaceManager,
|
|
13350
13726
|
calculateChunkCount,
|
|
@@ -13366,6 +13742,7 @@ function createRaisinVue(vue) {
|
|
|
13366
13742
|
createSqlHandler,
|
|
13367
13743
|
createSubscriptionAdapter,
|
|
13368
13744
|
decodeMessage,
|
|
13745
|
+
defaultVisitorSessionStore,
|
|
13369
13746
|
encodeMessage,
|
|
13370
13747
|
getChunkRange,
|
|
13371
13748
|
getContentType,
|