@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/{conversation-list-store-CHaqGtSi.d.mts → conversation-list-store-CqgIk8Rn.d.mts}
RENAMED
|
@@ -229,7 +229,9 @@ declare enum RequestType {
|
|
|
229
229
|
ScheduledInvocationCreate = "scheduled_invocation_create",
|
|
230
230
|
ScheduledInvocationCancel = "scheduled_invocation_cancel",
|
|
231
231
|
ScheduledInvocationList = "scheduled_invocation_list",
|
|
232
|
-
ScheduledInvocationGet = "scheduled_invocation_get"
|
|
232
|
+
ScheduledInvocationGet = "scheduled_invocation_get",
|
|
233
|
+
VisitorChatStart = "visitor_chat_start",
|
|
234
|
+
VisitorChatSend = "visitor_chat_send"
|
|
233
235
|
}
|
|
234
236
|
/**
|
|
235
237
|
* Response status
|
|
@@ -5626,6 +5628,8 @@ interface ChatFailedEvent {
|
|
|
5626
5628
|
type: 'failed';
|
|
5627
5629
|
/** Error description */
|
|
5628
5630
|
error: string;
|
|
5631
|
+
/** Machine-readable reason, when the server gave one (visitor chat refusals) */
|
|
5632
|
+
code?: string;
|
|
5629
5633
|
timestamp: string;
|
|
5630
5634
|
}
|
|
5631
5635
|
/** Conversation turn is complete — server closes the SSE stream */
|
|
@@ -5661,6 +5665,9 @@ interface ChatToolCallStartedEvent {
|
|
|
5661
5665
|
interface ChatToolCallCompletedEvent {
|
|
5662
5666
|
type: 'tool_call_completed';
|
|
5663
5667
|
toolCallId: string;
|
|
5668
|
+
/** The tool's name, when the server knows it */
|
|
5669
|
+
functionName?: string;
|
|
5670
|
+
/** The tool's result — null unless the agent streams tool results (`stream_tool_results`) */
|
|
5664
5671
|
result: unknown;
|
|
5665
5672
|
/** Error message if the tool call failed */
|
|
5666
5673
|
error?: string;
|
|
@@ -5708,6 +5715,131 @@ interface ChatLogEvent {
|
|
|
5708
5715
|
timestamp: string;
|
|
5709
5716
|
}
|
|
5710
5717
|
|
|
5718
|
+
/**
|
|
5719
|
+
* Anonymous visitor chat — an agent chat on a public website, straight from
|
|
5720
|
+
* the browser over the WebSocket. No login, no site server endpoint, no
|
|
5721
|
+
* service identity.
|
|
5722
|
+
*
|
|
5723
|
+
* The server keeps a visitor session per browser tab: an ephemeral home
|
|
5724
|
+
* (`/visitors/<key>` in `raisin:access_control`) that only this session can
|
|
5725
|
+
* read, and that nobody but the server writes. The browser holds the
|
|
5726
|
+
* session's secret (in sessionStorage by default) so a reload or a reconnect
|
|
5727
|
+
* continues the same conversation.
|
|
5728
|
+
*
|
|
5729
|
+
* Use it through `db.conversations`:
|
|
5730
|
+
*
|
|
5731
|
+
* ```typescript
|
|
5732
|
+
* const client = new RaisinClient('wss://db.example.com/ws/website');
|
|
5733
|
+
* await client.connect(); // anonymous
|
|
5734
|
+
* const db = client.database('website');
|
|
5735
|
+
*
|
|
5736
|
+
* const convo = await db.conversations.startAnonymous('/agents/website-assistant');
|
|
5737
|
+
* for await (const ev of db.conversations.sendMessage(convo.conversationPath, 'Hi!')) {
|
|
5738
|
+
* if (ev.type === 'text_chunk') render(ev.text);
|
|
5739
|
+
* }
|
|
5740
|
+
* const history = await db.conversations.getMessages(convo.conversationPath);
|
|
5741
|
+
* ```
|
|
5742
|
+
*
|
|
5743
|
+
* The agent must allow anonymous visitors (`anonymous.enabled: true` on its
|
|
5744
|
+
* raisin:AIAgent node); its limits (message size and count, token budget,
|
|
5745
|
+
* rate, one turn at a time) are enforced by the server and surface here as
|
|
5746
|
+
* {@link VisitorChatError} codes.
|
|
5747
|
+
*/
|
|
5748
|
+
|
|
5749
|
+
/** Where the session secret is kept between page loads. */
|
|
5750
|
+
interface VisitorSessionStore {
|
|
5751
|
+
get(key: string): string | null;
|
|
5752
|
+
set(key: string, value: string): void;
|
|
5753
|
+
remove(key: string): void;
|
|
5754
|
+
}
|
|
5755
|
+
/** sessionStorage when the page has one, memory otherwise (one tab = one session). */
|
|
5756
|
+
declare function defaultVisitorSessionStore(): VisitorSessionStore;
|
|
5757
|
+
/** Options for {@link VisitorChat.start}. */
|
|
5758
|
+
interface StartAnonymousOptions {
|
|
5759
|
+
/** Continue this conversation of the session (from `conversationId` of an earlier start). */
|
|
5760
|
+
conversationId?: string;
|
|
5761
|
+
/** Force a fresh conversation even when the store remembers one. */
|
|
5762
|
+
newConversation?: boolean;
|
|
5763
|
+
/** A session secret to resume; defaults to the one in `store`. */
|
|
5764
|
+
sessionToken?: string;
|
|
5765
|
+
/** Where to keep the secret and the last conversation; `false` keeps nothing. */
|
|
5766
|
+
store?: VisitorSessionStore | false;
|
|
5767
|
+
/** Store key prefix (default `raisindb:visitor:<repo>:<agent>`). */
|
|
5768
|
+
storageKey?: string;
|
|
5769
|
+
}
|
|
5770
|
+
/** The limits the agent applies, as the server reported them. */
|
|
5771
|
+
interface VisitorChatLimits {
|
|
5772
|
+
max_messages: number;
|
|
5773
|
+
max_message_chars: number;
|
|
5774
|
+
}
|
|
5775
|
+
/** A conversation started with {@link VisitorChat.start}. */
|
|
5776
|
+
interface AnonymousConversation extends Conversation {
|
|
5777
|
+
anonymous: true;
|
|
5778
|
+
/** The conversation id (also its event channel `chat:<id>`). */
|
|
5779
|
+
conversationId: string;
|
|
5780
|
+
/** The session secret. Keep it private: it is the visitor's credential. */
|
|
5781
|
+
sessionToken: string;
|
|
5782
|
+
limits: VisitorChatLimits;
|
|
5783
|
+
}
|
|
5784
|
+
/**
|
|
5785
|
+
* A refusal from the server. `code` is one of:
|
|
5786
|
+
* `ANONYMOUS_NOT_ALLOWED`, `ORIGIN_NOT_ALLOWED`, `RATE_LIMITED`, `BUSY`,
|
|
5787
|
+
* `TOO_LONG`, `EMPTY_MESSAGE`, `TOO_MANY_MESSAGES`, `LIMIT_REACHED`,
|
|
5788
|
+
* `CONVERSATION_LIMIT`, `SESSION_EXPIRED`, `SESSION_MISMATCH`,
|
|
5789
|
+
* `UNKNOWN_CONVERSATION`, `NO_SESSION`, `NOT_ANONYMOUS`, `UNAVAILABLE`.
|
|
5790
|
+
*/
|
|
5791
|
+
declare class VisitorChatError extends Error {
|
|
5792
|
+
readonly code: string;
|
|
5793
|
+
constructor(message: string, code: string);
|
|
5794
|
+
}
|
|
5795
|
+
type Send = (payload: unknown, requestType: string) => Promise<unknown>;
|
|
5796
|
+
/**
|
|
5797
|
+
* The anonymous half of `db.conversations`. Not used directly: call
|
|
5798
|
+
* `db.conversations.startAnonymous(...)`.
|
|
5799
|
+
*/
|
|
5800
|
+
declare class VisitorChat {
|
|
5801
|
+
private readonly repository;
|
|
5802
|
+
private readonly send;
|
|
5803
|
+
private readonly events;
|
|
5804
|
+
private byPath;
|
|
5805
|
+
private token;
|
|
5806
|
+
constructor(repository: string, send: Send, events: EventHandler, onReconnected?: (callback: () => void) => () => void);
|
|
5807
|
+
/** Whether `conversationPath` is a visitor conversation started here. */
|
|
5808
|
+
isAnonymous(conversationPath: string): boolean;
|
|
5809
|
+
private storeOf;
|
|
5810
|
+
private keyOf;
|
|
5811
|
+
/** Start (or resume) a visitor conversation with `agent` (`/agents/<name>`). */
|
|
5812
|
+
start(agent: string, options?: StartAnonymousOptions): Promise<AnonymousConversation>;
|
|
5813
|
+
/** Route the server's forwarded events for this conversation to its listeners. */
|
|
5814
|
+
private route;
|
|
5815
|
+
/** Re-prove the session on a new connection, for every conversation started here. */
|
|
5816
|
+
private rebindAll;
|
|
5817
|
+
/** Listen to a visitor conversation's events. Returns an unsubscribe function. */
|
|
5818
|
+
listen(conversationPath: string, listener: (event: ChatEvent) => void): () => void;
|
|
5819
|
+
private require;
|
|
5820
|
+
/** Make sure this connection is bound (after a reconnect nothing else may read the home). */
|
|
5821
|
+
ensureBound(conversationPath: string): Promise<void>;
|
|
5822
|
+
/** Send one visitor message. Events arrive through {@link listen}. */
|
|
5823
|
+
post(conversationPath: string, text: string): Promise<{
|
|
5824
|
+
messageId: string;
|
|
5825
|
+
messagesLeft?: number;
|
|
5826
|
+
}>;
|
|
5827
|
+
/**
|
|
5828
|
+
* Send one visitor message and stream the turn: `text_chunk`,
|
|
5829
|
+
* `tool_call_started`, `tool_call_completed`, … until `done`. A refusal
|
|
5830
|
+
* ends the stream with `failed` (its `code` says why). No event for
|
|
5831
|
+
* `inactivityTimeoutMs` ends it with a synthetic `waiting`.
|
|
5832
|
+
*/
|
|
5833
|
+
stream(conversationPath: string, text: string, options?: {
|
|
5834
|
+
signal?: AbortSignal;
|
|
5835
|
+
inactivityTimeoutMs?: number;
|
|
5836
|
+
}): AsyncIterable<ChatEvent>;
|
|
5837
|
+
/** Whether the store remembers a conversation with `agent`. */
|
|
5838
|
+
remembers(agent: string, options?: StartAnonymousOptions): boolean;
|
|
5839
|
+
/** Forget the stored session (e.g. a "new chat" button that should start a new session). */
|
|
5840
|
+
forget(agent: string, options?: StartAnonymousOptions): void;
|
|
5841
|
+
}
|
|
5842
|
+
|
|
5711
5843
|
/**
|
|
5712
5844
|
* Unified ConversationManager for RaisinDB.
|
|
5713
5845
|
*
|
|
@@ -5818,9 +5950,10 @@ declare class ConversationManager {
|
|
|
5818
5950
|
private fetchImpl;
|
|
5819
5951
|
private requestTimeout;
|
|
5820
5952
|
private executeSql?;
|
|
5953
|
+
private visitor?;
|
|
5821
5954
|
private cachedUserId?;
|
|
5822
5955
|
private cachedUserHome?;
|
|
5823
|
-
constructor(baseUrl: string, repository: string, authManager: AuthManager, options?: ConversationManagerOptions, executeSql?: (query: string, params?: unknown[]) => Promise<SqlResult
|
|
5956
|
+
constructor(baseUrl: string, repository: string, authManager: AuthManager, options?: ConversationManagerOptions, executeSql?: (query: string, params?: unknown[]) => Promise<SqlResult>, visitor?: VisitorChat);
|
|
5824
5957
|
private ensureCurrentUser;
|
|
5825
5958
|
/**
|
|
5826
5959
|
* List conversations for the current user.
|
|
@@ -5834,6 +5967,34 @@ declare class ConversationManager {
|
|
|
5834
5967
|
* - Everything else creates a `direct_message`
|
|
5835
5968
|
*/
|
|
5836
5969
|
create(options: CreateConversationOptions): Promise<Conversation>;
|
|
5970
|
+
/**
|
|
5971
|
+
* Start (or resume) an ANONYMOUS conversation with an agent — a public
|
|
5972
|
+
* website's chat, without login.
|
|
5973
|
+
*
|
|
5974
|
+
* Works on an anonymous connection only, and only with an agent that allows
|
|
5975
|
+
* anonymous visitors (`anonymous.enabled: true` on its raisin:AIAgent). The
|
|
5976
|
+
* server keeps the conversation in an ephemeral visitor session that only
|
|
5977
|
+
* this browser session can read; the session secret is kept in
|
|
5978
|
+
* sessionStorage (override with `options.store`), so a reload continues the
|
|
5979
|
+
* same conversation. Then use `sendMessage`, `getMessages`, `subscribe` and
|
|
5980
|
+
* `ConversationStore` / `useConversation` exactly as for a signed-in user.
|
|
5981
|
+
*
|
|
5982
|
+
* @example
|
|
5983
|
+
* ```typescript
|
|
5984
|
+
* const convo = await db.conversations.startAnonymous('/agents/website-assistant');
|
|
5985
|
+
* for await (const ev of db.conversations.sendMessage(convo.conversationPath, 'Hello')) {
|
|
5986
|
+
* if (ev.type === 'text_chunk') append(ev.text);
|
|
5987
|
+
* if (ev.type === 'failed') showLimit(ev.code); // e.g. RATE_LIMITED, LIMIT_REACHED
|
|
5988
|
+
* }
|
|
5989
|
+
* ```
|
|
5990
|
+
*/
|
|
5991
|
+
startAnonymous(agent: string, options?: StartAnonymousOptions): Promise<AnonymousConversation>;
|
|
5992
|
+
/** Forget the stored anonymous session for `agent` (the next start begins a new one). */
|
|
5993
|
+
forgetAnonymous(agent: string, options?: StartAnonymousOptions): void;
|
|
5994
|
+
/** Whether this tab remembers an anonymous conversation with `agent`. */
|
|
5995
|
+
hasStoredAnonymous(agent: string, options?: StartAnonymousOptions): boolean;
|
|
5996
|
+
/** Whether `conversationPath` is an anonymous conversation of this client. */
|
|
5997
|
+
isAnonymous(conversationPath: string): boolean;
|
|
5837
5998
|
/**
|
|
5838
5999
|
* Open an existing conversation by path.
|
|
5839
6000
|
* Returns null if not found.
|
|
@@ -6748,6 +6909,8 @@ interface DatabaseHttpOptions {
|
|
|
6748
6909
|
httpBaseUrl?: string;
|
|
6749
6910
|
/** Auth manager for token access */
|
|
6750
6911
|
authManager?: AuthManager;
|
|
6912
|
+
/** Called after every successful reconnect (visitor chats re-prove their session). */
|
|
6913
|
+
onReconnected?: (callback: () => void) => () => void;
|
|
6751
6914
|
}
|
|
6752
6915
|
/**
|
|
6753
6916
|
* Database interface for repository operations
|
|
@@ -7993,6 +8156,12 @@ interface ConversationStoreOptions {
|
|
|
7993
8156
|
createOptions?: {
|
|
7994
8157
|
participant: string;
|
|
7995
8158
|
input?: Record<string, unknown>;
|
|
8159
|
+
/**
|
|
8160
|
+
* Chat WITHOUT login (a public website): starts or resumes an anonymous
|
|
8161
|
+
* visitor conversation (`db.conversations.startAnonymous`). `true`, or the
|
|
8162
|
+
* start options. The agent must allow anonymous visitors.
|
|
8163
|
+
*/
|
|
8164
|
+
anonymous?: boolean | StartAnonymousOptions;
|
|
7996
8165
|
};
|
|
7997
8166
|
/** Callback for individual chat events */
|
|
7998
8167
|
onEvent?: (event: ChatEvent) => void;
|
|
@@ -8029,6 +8198,13 @@ declare class ConversationStore {
|
|
|
8029
8198
|
private _watchdogIntervalMs;
|
|
8030
8199
|
private _watchdogTimer;
|
|
8031
8200
|
constructor(options: ConversationStoreOptions);
|
|
8201
|
+
private anonymousOptions;
|
|
8202
|
+
/**
|
|
8203
|
+
* Resume the visitor conversation this tab already has (the session secret
|
|
8204
|
+
* and conversation id live in sessionStorage), and load its history. A tab
|
|
8205
|
+
* without one starts nothing until the first message.
|
|
8206
|
+
*/
|
|
8207
|
+
private resumeAnonymous;
|
|
8032
8208
|
/**
|
|
8033
8209
|
* Subscribe to state changes.
|
|
8034
8210
|
* Returns an unsubscribe function.
|
|
@@ -8195,4 +8371,4 @@ declare class ConversationListStore {
|
|
|
8195
8371
|
private notify;
|
|
8196
8372
|
}
|
|
8197
8373
|
|
|
8198
|
-
export { type CurrentUser$1 as $, AuthManager as A, type BatchUpload as B, ConnectionState as C, Database as D, type EventMessage as E, type FlowClientOptions as F, type SearchOptions as G, type HttpClientOptions as H, type IdentityUser as I, type SearchPassage as J, type ClientMode as K, type CurrentUser as L, type UserNode as M, type Node as N, type AuthEvent as O, type PlanProjection as P, type AuthStateChange as Q, RaisinClient as R, type SubscriptionFilters as S, type ToolCallInfo as T, UploadErrorCode as U, type AuthStateChangeCallback as V, type WorkspaceScope as W, type UserChangeEvent as X, type UserChangeCallback as Y, HttpDatabase as Z, HttpWorkspaceClient as _, type ConversationStoreSnapshot as a, type CreateAgentRunResult as a$, type UserNode$1 as a0, type SignAssetOptions as a1, type SignedAssetUrl as a2, type DatabaseHttpOptions as a3, WorkspaceClient as a4, WorkspaceManager as a5, type WorkspaceCreateOptions as a6, type WorkspaceUpdateOptions as a7, NodeOperations as a8, type NodeCreateOptions as a9, type CheckpointOptions as aA, type MailboxEntry as aB, type SpawnChildOptions as aC, type SpawnChildResult as aD, NodeDevApi as aE, type ChangeOp as aF, type ChangesetOptions as aG, type CommitOutcome as aH, type NodeDevCommon as aI, type NodeDevConflict as aJ, type NodeDevTransport as aK, type NodeLocator as aL, type NodeRevision as aM, type NodeTarget as aN, type OpReceipt as aO, type Receipt as aP, type WorkRoot as aQ, type AgentRunCommand as aR, type AgentRunControlAck as aS, type AgentRunEvent as aT, type AgentRunFence as aU, type AgentRunStatus as aV, type AgentRunSubject as aW, type AgentRunView as aX, type AgentRunsTransport as aY, type BeginOperationOptions as aZ, type CreateAgentRunOptions as a_, type NodeCreateDeepOptions as aa, type NodeUpdateOptions as ab, type NodeQueryOptions as ac, Transaction as ad, type TransactionOptions as ae, NodeTypes as af, Archetypes as ag, ElementTypes as ah, Branches as ai, type BranchDiff as aj, type BranchDivergence as ak, type CrossBranchCopySummary as al, type CrossBranchNodeChange as am, type NodeDiffInfo as an, Tags as ao, SchedulerApi as ap, AgentRunsApi as aq, newControlId as ar, subjectOf as as, AgentRunsWsApi as at, type AgentRunChildView as au, type AgentRunSubscribeOptions as av, type AgentRunSubscription as aw, type ChildAction as ax, type ChildContext as ay, type ChildObjective as az, type ChatMessage as b, ResponseStatus as b$, type FinishOperationOptions as b0, type ListInvocationsFilter as b1, type ScheduleInvocationOptions as b2, type ScheduledInvocation as b3, type ScheduledInvocationRef as b4, type ScheduledInvocationTargetKind as b5, HttpNodeTypes as b6, HttpArchetypes as b7, HttpElementTypes as b8, type SchemaCommit as b9, type NodeHistoryPayload as bA, type RevisionEntry as bB, type AuditQueryPayload as bC, type AuditLogEntry as bD, type NodeQueryPayload as bE, type RelationAddPayload as bF, type RelationRemovePayload as bG, type RelationsGetPayload as bH, type SqlQueryPayload as bI, type SqlResult as bJ, type Workspace as bK, type WorkspaceCreatePayload as bL, type WorkspaceGetPayload as bM, type WorkspaceDeletePayload as bN, type WorkspaceUpdatePayload as bO, type SubscribePayload as bP, type UnsubscribePayload as bQ, type SubscriptionResponse as bR, type AuthenticatePayload as bS, type AuthenticateResponse as bT, type RefreshTokenPayload as bU, type TransactionBeginPayload as bV, type TransactionBeginResponse as bW, type TransactionCommitPayload as bX, type TransactionCommitResponse as bY, type TransactionRollbackPayload as bZ, RequestType as b_, SqlQuery as ba, createSqlHandler as bb, EventHandler as bc, EventSubscriptions as bd, type EventCallback as be, type Subscription as bf, Connection as bg, type ConnectionOptions as bh, MemoryTokenStorage as bi, LocalStorageTokenStorage as bj, type TokenStorage as bk, type IdentityAuthResponse as bl, type IdentityAuthError as bm, type RequestEnvelope as bn, type ResponseEnvelope as bo, type NodeEventPayload as bp, type RequestContext as bq, type ErrorInfo as br, type ResponseMetadata as bs, type IncomingRelation as bt, type NodeRelationships as bu, type NodeCreatePayload as bv, type NodeCreateDeepPayload as bw, type NodeUpdatePayload as bx, type NodeDeletePayload as by, type NodeGetPayload as bz, ConversationStore as c, type McpCallToolResult as c$, encodeMessage as c0, decodeMessage as c1, isEventMessage as c2, isResponseEnvelope as c3, ReconnectManager as c4, LogLevel as c5, logger as c6, configureLogger as c7, setLogLevel as c8, getLogLevel as c9, calculateChunkCount as cA, getChunkRange as cB, Uploader as cC, UploadManager as cD, FlowClient as cE, type FlowRunResult as cF, type FlowCollectResult as cG, FunctionsApi as cH, HttpFunctionsApi as cI, IdentityAuthApi as cJ, readTokensFromFragment as cK, type IdentityAuthResult as cL, type IdentityAuthTransport as cM, type IdentityInfo as cN, type IdentityMe as cO, type MagicLinkSent as cP, type MagicLinkOptions as cQ, type AuthProviders as cR, type FunctionInvokeOptions as cS, type FunctionInvokeResponse as cT, type FunctionInvokeSyncResponse as cU, McpClient as cV, type McpTransport as cW, type McpFrameStream as cX, type McpJsonRpcFrame as cY, type McpToolDescriptor as cZ, type McpContentBlock as c_, getLoggerConfig as ca, type LoggerConfig as cb, type UploadStatus as cc, type UploadOptions as cd, type UploadProgress as ce, type UploadResult as cf, type Upload as cg, type CreateUploadRequest as ch, type CreateUploadResponse as ci, type ChunkUploadResponse as cj, type UploadStatusResponse as ck, type CompleteUploadRequest as cl, type CompleteUploadResponse as cm, type BatchFileProgress as cn, UploadError as co, DEFAULT_CHUNK_SIZE as cp, DEFAULT_MAX_RETRIES as cq, DEFAULT_RETRY_BASE_DELAY as cr, DEFAULT_RETRY_MAX_DELAY as cs, DEFAULT_NODE_TYPE as ct, DEFAULT_BRANCH as cu, DEFAULT_BATCH_CONCURRENCY as cv, BrowserFileSource as cw, NodeFileSource as cx, createFileSource as cy, getContentType as cz, type ConversationListItem as d, type ChatEvent as d$, type McpResourceContents as d0, type McpReadResourceResult as d1, type McpResourceUpdate as d2, type McpResourceSubscription as d3, type FlowRunResponse as d4, type FlowInstanceStatus as d5, type FlowInstanceStatusResponse as d6, type FlowMetrics as d7, type StepStartedEvent as d8, type StepCompletedEvent as d9, type ChatTerminationConfig as dA, type ChatStepConfig as dB, type AiToolMode as dC, type AiErrorBehavior as dD, type AiContainerConfig as dE, type FlowDefinitionNodeBase as dF, type FlowStepProperties as dG, type FlowDefinitionStep as dH, type ContainerRule as dI, type FanOutConfig as dJ, type MergeStrategy as dK, type FlowDefinitionContainer as dL, type LoopConfig as dM, type FlowDefinitionNode as dN, type FlowDefinition as dO, type InboxTask as dP, type InboxTaskStatus as dQ, type TaskCompletionResult as dR, RETRY_STRATEGIES as dS, getRefDisplayName as dT, getRefPath as dU, isFlowDefinitionStep as dV, isFlowDefinitionContainer as dW, InboxApi as dX, type InboxApiOptions as dY, type ListTasksOptions as dZ, type ListTasksResponse as d_, type StepUsage as da, type StepFailedEvent as db, type FlowWaitingEvent as dc, type FlowResumedEvent as dd, type FlowCompletedEvent as de, type FlowFailedEvent as df, type TextChunkEvent as dg, type ToolCallStartedEvent as dh, type ToolCallCompletedEvent as di, type ThoughtChunkEvent as dj, type ConversationCreatedEvent as dk, type MessageSavedEvent as dl, type LogEvent as dm, isTerminalEvent as dn, type RaisinReference as dp, type ContainerType as dq, type StepErrorBehavior as dr, type FlowErrorStrategy as ds, type RetryConfig as dt, type RetryStrategy as du, type HumanTaskType as dv, type CanonicalTaskType as dw, type TaskOption as dx, type HandoffTarget as dy, type ChatTerminationMode as dz, ConversationListStore as e, type Conversation as e0, type ConversationType as e1, type ConversationStatus as e2, type MessageBody as e3, type ChatTextChunkEvent as e4, type ChatAssistantMessageEvent as e5, type ChatWaitingEvent as e6, type ChatCompletedEvent as e7, type ChatFailedEvent as e8, type ChatDoneEvent as e9, type ChatToolCallStartedEvent as ea, type ChatToolCallCompletedEvent as eb, type ChatThoughtChunkEvent as ec, type ToolCallRecord as ed, type MessageChild as ee, type PlanTask as ef, type ChatConversationCreatedEvent as eg, type ChatMessageSavedEvent as eh, type ChatMessageDeliveredEvent as ei, type ChatLogEvent as ej, ConversationManager as ek, DEFAULT_SEND_MESSAGE_INACTIVITY_TIMEOUT_MS as el, type ListConversationsOptions as
|
|
8374
|
+
export { type CurrentUser$1 as $, AuthManager as A, type BatchUpload as B, ConnectionState as C, Database as D, type EventMessage as E, type FlowClientOptions as F, type SearchOptions as G, type HttpClientOptions as H, type IdentityUser as I, type SearchPassage as J, type ClientMode as K, type CurrentUser as L, type UserNode as M, type Node as N, type AuthEvent as O, type PlanProjection as P, type AuthStateChange as Q, RaisinClient as R, type SubscriptionFilters as S, type ToolCallInfo as T, UploadErrorCode as U, type AuthStateChangeCallback as V, type WorkspaceScope as W, type UserChangeEvent as X, type UserChangeCallback as Y, HttpDatabase as Z, HttpWorkspaceClient as _, type ConversationStoreSnapshot as a, type CreateAgentRunResult as a$, type UserNode$1 as a0, type SignAssetOptions as a1, type SignedAssetUrl as a2, type DatabaseHttpOptions as a3, WorkspaceClient as a4, WorkspaceManager as a5, type WorkspaceCreateOptions as a6, type WorkspaceUpdateOptions as a7, NodeOperations as a8, type NodeCreateOptions as a9, type CheckpointOptions as aA, type MailboxEntry as aB, type SpawnChildOptions as aC, type SpawnChildResult as aD, NodeDevApi as aE, type ChangeOp as aF, type ChangesetOptions as aG, type CommitOutcome as aH, type NodeDevCommon as aI, type NodeDevConflict as aJ, type NodeDevTransport as aK, type NodeLocator as aL, type NodeRevision as aM, type NodeTarget as aN, type OpReceipt as aO, type Receipt as aP, type WorkRoot as aQ, type AgentRunCommand as aR, type AgentRunControlAck as aS, type AgentRunEvent as aT, type AgentRunFence as aU, type AgentRunStatus as aV, type AgentRunSubject as aW, type AgentRunView as aX, type AgentRunsTransport as aY, type BeginOperationOptions as aZ, type CreateAgentRunOptions as a_, type NodeCreateDeepOptions as aa, type NodeUpdateOptions as ab, type NodeQueryOptions as ac, Transaction as ad, type TransactionOptions as ae, NodeTypes as af, Archetypes as ag, ElementTypes as ah, Branches as ai, type BranchDiff as aj, type BranchDivergence as ak, type CrossBranchCopySummary as al, type CrossBranchNodeChange as am, type NodeDiffInfo as an, Tags as ao, SchedulerApi as ap, AgentRunsApi as aq, newControlId as ar, subjectOf as as, AgentRunsWsApi as at, type AgentRunChildView as au, type AgentRunSubscribeOptions as av, type AgentRunSubscription as aw, type ChildAction as ax, type ChildContext as ay, type ChildObjective as az, type ChatMessage as b, ResponseStatus as b$, type FinishOperationOptions as b0, type ListInvocationsFilter as b1, type ScheduleInvocationOptions as b2, type ScheduledInvocation as b3, type ScheduledInvocationRef as b4, type ScheduledInvocationTargetKind as b5, HttpNodeTypes as b6, HttpArchetypes as b7, HttpElementTypes as b8, type SchemaCommit as b9, type NodeHistoryPayload as bA, type RevisionEntry as bB, type AuditQueryPayload as bC, type AuditLogEntry as bD, type NodeQueryPayload as bE, type RelationAddPayload as bF, type RelationRemovePayload as bG, type RelationsGetPayload as bH, type SqlQueryPayload as bI, type SqlResult as bJ, type Workspace as bK, type WorkspaceCreatePayload as bL, type WorkspaceGetPayload as bM, type WorkspaceDeletePayload as bN, type WorkspaceUpdatePayload as bO, type SubscribePayload as bP, type UnsubscribePayload as bQ, type SubscriptionResponse as bR, type AuthenticatePayload as bS, type AuthenticateResponse as bT, type RefreshTokenPayload as bU, type TransactionBeginPayload as bV, type TransactionBeginResponse as bW, type TransactionCommitPayload as bX, type TransactionCommitResponse as bY, type TransactionRollbackPayload as bZ, RequestType as b_, SqlQuery as ba, createSqlHandler as bb, EventHandler as bc, EventSubscriptions as bd, type EventCallback as be, type Subscription as bf, Connection as bg, type ConnectionOptions as bh, MemoryTokenStorage as bi, LocalStorageTokenStorage as bj, type TokenStorage as bk, type IdentityAuthResponse as bl, type IdentityAuthError as bm, type RequestEnvelope as bn, type ResponseEnvelope as bo, type NodeEventPayload as bp, type RequestContext as bq, type ErrorInfo as br, type ResponseMetadata as bs, type IncomingRelation as bt, type NodeRelationships as bu, type NodeCreatePayload as bv, type NodeCreateDeepPayload as bw, type NodeUpdatePayload as bx, type NodeDeletePayload as by, type NodeGetPayload as bz, ConversationStore as c, type McpCallToolResult as c$, encodeMessage as c0, decodeMessage as c1, isEventMessage as c2, isResponseEnvelope as c3, ReconnectManager as c4, LogLevel as c5, logger as c6, configureLogger as c7, setLogLevel as c8, getLogLevel as c9, calculateChunkCount as cA, getChunkRange as cB, Uploader as cC, UploadManager as cD, FlowClient as cE, type FlowRunResult as cF, type FlowCollectResult as cG, FunctionsApi as cH, HttpFunctionsApi as cI, IdentityAuthApi as cJ, readTokensFromFragment as cK, type IdentityAuthResult as cL, type IdentityAuthTransport as cM, type IdentityInfo as cN, type IdentityMe as cO, type MagicLinkSent as cP, type MagicLinkOptions as cQ, type AuthProviders as cR, type FunctionInvokeOptions as cS, type FunctionInvokeResponse as cT, type FunctionInvokeSyncResponse as cU, McpClient as cV, type McpTransport as cW, type McpFrameStream as cX, type McpJsonRpcFrame as cY, type McpToolDescriptor as cZ, type McpContentBlock as c_, getLoggerConfig as ca, type LoggerConfig as cb, type UploadStatus as cc, type UploadOptions as cd, type UploadProgress as ce, type UploadResult as cf, type Upload as cg, type CreateUploadRequest as ch, type CreateUploadResponse as ci, type ChunkUploadResponse as cj, type UploadStatusResponse as ck, type CompleteUploadRequest as cl, type CompleteUploadResponse as cm, type BatchFileProgress as cn, UploadError as co, DEFAULT_CHUNK_SIZE as cp, DEFAULT_MAX_RETRIES as cq, DEFAULT_RETRY_BASE_DELAY as cr, DEFAULT_RETRY_MAX_DELAY as cs, DEFAULT_NODE_TYPE as ct, DEFAULT_BRANCH as cu, DEFAULT_BATCH_CONCURRENCY as cv, BrowserFileSource as cw, NodeFileSource as cx, createFileSource as cy, getContentType as cz, type ConversationListItem as d, type ChatEvent as d$, type McpResourceContents as d0, type McpReadResourceResult as d1, type McpResourceUpdate as d2, type McpResourceSubscription as d3, type FlowRunResponse as d4, type FlowInstanceStatus as d5, type FlowInstanceStatusResponse as d6, type FlowMetrics as d7, type StepStartedEvent as d8, type StepCompletedEvent as d9, type ChatTerminationConfig as dA, type ChatStepConfig as dB, type AiToolMode as dC, type AiErrorBehavior as dD, type AiContainerConfig as dE, type FlowDefinitionNodeBase as dF, type FlowStepProperties as dG, type FlowDefinitionStep as dH, type ContainerRule as dI, type FanOutConfig as dJ, type MergeStrategy as dK, type FlowDefinitionContainer as dL, type LoopConfig as dM, type FlowDefinitionNode as dN, type FlowDefinition as dO, type InboxTask as dP, type InboxTaskStatus as dQ, type TaskCompletionResult as dR, RETRY_STRATEGIES as dS, getRefDisplayName as dT, getRefPath as dU, isFlowDefinitionStep as dV, isFlowDefinitionContainer as dW, InboxApi as dX, type InboxApiOptions as dY, type ListTasksOptions as dZ, type ListTasksResponse as d_, type StepUsage as da, type StepFailedEvent as db, type FlowWaitingEvent as dc, type FlowResumedEvent as dd, type FlowCompletedEvent as de, type FlowFailedEvent as df, type TextChunkEvent as dg, type ToolCallStartedEvent as dh, type ToolCallCompletedEvent as di, type ThoughtChunkEvent as dj, type ConversationCreatedEvent as dk, type MessageSavedEvent as dl, type LogEvent as dm, isTerminalEvent as dn, type RaisinReference as dp, type ContainerType as dq, type StepErrorBehavior as dr, type FlowErrorStrategy as ds, type RetryConfig as dt, type RetryStrategy as du, type HumanTaskType as dv, type CanonicalTaskType as dw, type TaskOption as dx, type HandoffTarget as dy, type ChatTerminationMode as dz, ConversationListStore as e, type Conversation as e0, type ConversationType as e1, type ConversationStatus as e2, type MessageBody as e3, type ChatTextChunkEvent as e4, type ChatAssistantMessageEvent as e5, type ChatWaitingEvent as e6, type ChatCompletedEvent as e7, type ChatFailedEvent as e8, type ChatDoneEvent as e9, type ChatToolCallStartedEvent as ea, type ChatToolCallCompletedEvent as eb, type ChatThoughtChunkEvent as ec, type ToolCallRecord as ed, type MessageChild as ee, type PlanTask as ef, type ChatConversationCreatedEvent as eg, type ChatMessageSavedEvent as eh, type ChatMessageDeliveredEvent as ei, type ChatLogEvent as ej, ConversationManager as ek, DEFAULT_SEND_MESSAGE_INACTIVITY_TIMEOUT_MS as el, VisitorChatError as em, defaultVisitorSessionStore as en, type AnonymousConversation as eo, type StartAnonymousOptions as ep, type VisitorChatLimits as eq, type VisitorSessionStore as er, type ListConversationsOptions as es, type CreateConversationOptions as et, type SendMessageOptions as eu, type ConversationSubscription as ev, type PlanActionReceipt as ew, type PlanActionOptions as ex, type ConversationManagerOptions as ey, projectPlansFromMessages as ez, type ConversationStoreOptions as f, type ConversationListStoreOptions as g, type ConversationListSnapshot as h, FlowsApi as i, type FlowExecutionEvent as j, type PlanProjectionTask as k, type PropertyValue as l, type RelationRef as m, type ClientOptions as n, type Credentials as o, RaisinHttpClient as p, type RetryOptions as q, type UploaderConfig as r, type FileSource as s, type BatchUploadOptions as t, type BatchUploadResult as u, type BatchProgress as v, type ReconnectOptions as w, type Answer as x, type AskOptions as y, type Citation as z };
|
package/dist/{conversation-list-store-CHaqGtSi.d.ts → conversation-list-store-CqgIk8Rn.d.ts}
RENAMED
|
@@ -229,7 +229,9 @@ declare enum RequestType {
|
|
|
229
229
|
ScheduledInvocationCreate = "scheduled_invocation_create",
|
|
230
230
|
ScheduledInvocationCancel = "scheduled_invocation_cancel",
|
|
231
231
|
ScheduledInvocationList = "scheduled_invocation_list",
|
|
232
|
-
ScheduledInvocationGet = "scheduled_invocation_get"
|
|
232
|
+
ScheduledInvocationGet = "scheduled_invocation_get",
|
|
233
|
+
VisitorChatStart = "visitor_chat_start",
|
|
234
|
+
VisitorChatSend = "visitor_chat_send"
|
|
233
235
|
}
|
|
234
236
|
/**
|
|
235
237
|
* Response status
|
|
@@ -5626,6 +5628,8 @@ interface ChatFailedEvent {
|
|
|
5626
5628
|
type: 'failed';
|
|
5627
5629
|
/** Error description */
|
|
5628
5630
|
error: string;
|
|
5631
|
+
/** Machine-readable reason, when the server gave one (visitor chat refusals) */
|
|
5632
|
+
code?: string;
|
|
5629
5633
|
timestamp: string;
|
|
5630
5634
|
}
|
|
5631
5635
|
/** Conversation turn is complete — server closes the SSE stream */
|
|
@@ -5661,6 +5665,9 @@ interface ChatToolCallStartedEvent {
|
|
|
5661
5665
|
interface ChatToolCallCompletedEvent {
|
|
5662
5666
|
type: 'tool_call_completed';
|
|
5663
5667
|
toolCallId: string;
|
|
5668
|
+
/** The tool's name, when the server knows it */
|
|
5669
|
+
functionName?: string;
|
|
5670
|
+
/** The tool's result — null unless the agent streams tool results (`stream_tool_results`) */
|
|
5664
5671
|
result: unknown;
|
|
5665
5672
|
/** Error message if the tool call failed */
|
|
5666
5673
|
error?: string;
|
|
@@ -5708,6 +5715,131 @@ interface ChatLogEvent {
|
|
|
5708
5715
|
timestamp: string;
|
|
5709
5716
|
}
|
|
5710
5717
|
|
|
5718
|
+
/**
|
|
5719
|
+
* Anonymous visitor chat — an agent chat on a public website, straight from
|
|
5720
|
+
* the browser over the WebSocket. No login, no site server endpoint, no
|
|
5721
|
+
* service identity.
|
|
5722
|
+
*
|
|
5723
|
+
* The server keeps a visitor session per browser tab: an ephemeral home
|
|
5724
|
+
* (`/visitors/<key>` in `raisin:access_control`) that only this session can
|
|
5725
|
+
* read, and that nobody but the server writes. The browser holds the
|
|
5726
|
+
* session's secret (in sessionStorage by default) so a reload or a reconnect
|
|
5727
|
+
* continues the same conversation.
|
|
5728
|
+
*
|
|
5729
|
+
* Use it through `db.conversations`:
|
|
5730
|
+
*
|
|
5731
|
+
* ```typescript
|
|
5732
|
+
* const client = new RaisinClient('wss://db.example.com/ws/website');
|
|
5733
|
+
* await client.connect(); // anonymous
|
|
5734
|
+
* const db = client.database('website');
|
|
5735
|
+
*
|
|
5736
|
+
* const convo = await db.conversations.startAnonymous('/agents/website-assistant');
|
|
5737
|
+
* for await (const ev of db.conversations.sendMessage(convo.conversationPath, 'Hi!')) {
|
|
5738
|
+
* if (ev.type === 'text_chunk') render(ev.text);
|
|
5739
|
+
* }
|
|
5740
|
+
* const history = await db.conversations.getMessages(convo.conversationPath);
|
|
5741
|
+
* ```
|
|
5742
|
+
*
|
|
5743
|
+
* The agent must allow anonymous visitors (`anonymous.enabled: true` on its
|
|
5744
|
+
* raisin:AIAgent node); its limits (message size and count, token budget,
|
|
5745
|
+
* rate, one turn at a time) are enforced by the server and surface here as
|
|
5746
|
+
* {@link VisitorChatError} codes.
|
|
5747
|
+
*/
|
|
5748
|
+
|
|
5749
|
+
/** Where the session secret is kept between page loads. */
|
|
5750
|
+
interface VisitorSessionStore {
|
|
5751
|
+
get(key: string): string | null;
|
|
5752
|
+
set(key: string, value: string): void;
|
|
5753
|
+
remove(key: string): void;
|
|
5754
|
+
}
|
|
5755
|
+
/** sessionStorage when the page has one, memory otherwise (one tab = one session). */
|
|
5756
|
+
declare function defaultVisitorSessionStore(): VisitorSessionStore;
|
|
5757
|
+
/** Options for {@link VisitorChat.start}. */
|
|
5758
|
+
interface StartAnonymousOptions {
|
|
5759
|
+
/** Continue this conversation of the session (from `conversationId` of an earlier start). */
|
|
5760
|
+
conversationId?: string;
|
|
5761
|
+
/** Force a fresh conversation even when the store remembers one. */
|
|
5762
|
+
newConversation?: boolean;
|
|
5763
|
+
/** A session secret to resume; defaults to the one in `store`. */
|
|
5764
|
+
sessionToken?: string;
|
|
5765
|
+
/** Where to keep the secret and the last conversation; `false` keeps nothing. */
|
|
5766
|
+
store?: VisitorSessionStore | false;
|
|
5767
|
+
/** Store key prefix (default `raisindb:visitor:<repo>:<agent>`). */
|
|
5768
|
+
storageKey?: string;
|
|
5769
|
+
}
|
|
5770
|
+
/** The limits the agent applies, as the server reported them. */
|
|
5771
|
+
interface VisitorChatLimits {
|
|
5772
|
+
max_messages: number;
|
|
5773
|
+
max_message_chars: number;
|
|
5774
|
+
}
|
|
5775
|
+
/** A conversation started with {@link VisitorChat.start}. */
|
|
5776
|
+
interface AnonymousConversation extends Conversation {
|
|
5777
|
+
anonymous: true;
|
|
5778
|
+
/** The conversation id (also its event channel `chat:<id>`). */
|
|
5779
|
+
conversationId: string;
|
|
5780
|
+
/** The session secret. Keep it private: it is the visitor's credential. */
|
|
5781
|
+
sessionToken: string;
|
|
5782
|
+
limits: VisitorChatLimits;
|
|
5783
|
+
}
|
|
5784
|
+
/**
|
|
5785
|
+
* A refusal from the server. `code` is one of:
|
|
5786
|
+
* `ANONYMOUS_NOT_ALLOWED`, `ORIGIN_NOT_ALLOWED`, `RATE_LIMITED`, `BUSY`,
|
|
5787
|
+
* `TOO_LONG`, `EMPTY_MESSAGE`, `TOO_MANY_MESSAGES`, `LIMIT_REACHED`,
|
|
5788
|
+
* `CONVERSATION_LIMIT`, `SESSION_EXPIRED`, `SESSION_MISMATCH`,
|
|
5789
|
+
* `UNKNOWN_CONVERSATION`, `NO_SESSION`, `NOT_ANONYMOUS`, `UNAVAILABLE`.
|
|
5790
|
+
*/
|
|
5791
|
+
declare class VisitorChatError extends Error {
|
|
5792
|
+
readonly code: string;
|
|
5793
|
+
constructor(message: string, code: string);
|
|
5794
|
+
}
|
|
5795
|
+
type Send = (payload: unknown, requestType: string) => Promise<unknown>;
|
|
5796
|
+
/**
|
|
5797
|
+
* The anonymous half of `db.conversations`. Not used directly: call
|
|
5798
|
+
* `db.conversations.startAnonymous(...)`.
|
|
5799
|
+
*/
|
|
5800
|
+
declare class VisitorChat {
|
|
5801
|
+
private readonly repository;
|
|
5802
|
+
private readonly send;
|
|
5803
|
+
private readonly events;
|
|
5804
|
+
private byPath;
|
|
5805
|
+
private token;
|
|
5806
|
+
constructor(repository: string, send: Send, events: EventHandler, onReconnected?: (callback: () => void) => () => void);
|
|
5807
|
+
/** Whether `conversationPath` is a visitor conversation started here. */
|
|
5808
|
+
isAnonymous(conversationPath: string): boolean;
|
|
5809
|
+
private storeOf;
|
|
5810
|
+
private keyOf;
|
|
5811
|
+
/** Start (or resume) a visitor conversation with `agent` (`/agents/<name>`). */
|
|
5812
|
+
start(agent: string, options?: StartAnonymousOptions): Promise<AnonymousConversation>;
|
|
5813
|
+
/** Route the server's forwarded events for this conversation to its listeners. */
|
|
5814
|
+
private route;
|
|
5815
|
+
/** Re-prove the session on a new connection, for every conversation started here. */
|
|
5816
|
+
private rebindAll;
|
|
5817
|
+
/** Listen to a visitor conversation's events. Returns an unsubscribe function. */
|
|
5818
|
+
listen(conversationPath: string, listener: (event: ChatEvent) => void): () => void;
|
|
5819
|
+
private require;
|
|
5820
|
+
/** Make sure this connection is bound (after a reconnect nothing else may read the home). */
|
|
5821
|
+
ensureBound(conversationPath: string): Promise<void>;
|
|
5822
|
+
/** Send one visitor message. Events arrive through {@link listen}. */
|
|
5823
|
+
post(conversationPath: string, text: string): Promise<{
|
|
5824
|
+
messageId: string;
|
|
5825
|
+
messagesLeft?: number;
|
|
5826
|
+
}>;
|
|
5827
|
+
/**
|
|
5828
|
+
* Send one visitor message and stream the turn: `text_chunk`,
|
|
5829
|
+
* `tool_call_started`, `tool_call_completed`, … until `done`. A refusal
|
|
5830
|
+
* ends the stream with `failed` (its `code` says why). No event for
|
|
5831
|
+
* `inactivityTimeoutMs` ends it with a synthetic `waiting`.
|
|
5832
|
+
*/
|
|
5833
|
+
stream(conversationPath: string, text: string, options?: {
|
|
5834
|
+
signal?: AbortSignal;
|
|
5835
|
+
inactivityTimeoutMs?: number;
|
|
5836
|
+
}): AsyncIterable<ChatEvent>;
|
|
5837
|
+
/** Whether the store remembers a conversation with `agent`. */
|
|
5838
|
+
remembers(agent: string, options?: StartAnonymousOptions): boolean;
|
|
5839
|
+
/** Forget the stored session (e.g. a "new chat" button that should start a new session). */
|
|
5840
|
+
forget(agent: string, options?: StartAnonymousOptions): void;
|
|
5841
|
+
}
|
|
5842
|
+
|
|
5711
5843
|
/**
|
|
5712
5844
|
* Unified ConversationManager for RaisinDB.
|
|
5713
5845
|
*
|
|
@@ -5818,9 +5950,10 @@ declare class ConversationManager {
|
|
|
5818
5950
|
private fetchImpl;
|
|
5819
5951
|
private requestTimeout;
|
|
5820
5952
|
private executeSql?;
|
|
5953
|
+
private visitor?;
|
|
5821
5954
|
private cachedUserId?;
|
|
5822
5955
|
private cachedUserHome?;
|
|
5823
|
-
constructor(baseUrl: string, repository: string, authManager: AuthManager, options?: ConversationManagerOptions, executeSql?: (query: string, params?: unknown[]) => Promise<SqlResult
|
|
5956
|
+
constructor(baseUrl: string, repository: string, authManager: AuthManager, options?: ConversationManagerOptions, executeSql?: (query: string, params?: unknown[]) => Promise<SqlResult>, visitor?: VisitorChat);
|
|
5824
5957
|
private ensureCurrentUser;
|
|
5825
5958
|
/**
|
|
5826
5959
|
* List conversations for the current user.
|
|
@@ -5834,6 +5967,34 @@ declare class ConversationManager {
|
|
|
5834
5967
|
* - Everything else creates a `direct_message`
|
|
5835
5968
|
*/
|
|
5836
5969
|
create(options: CreateConversationOptions): Promise<Conversation>;
|
|
5970
|
+
/**
|
|
5971
|
+
* Start (or resume) an ANONYMOUS conversation with an agent — a public
|
|
5972
|
+
* website's chat, without login.
|
|
5973
|
+
*
|
|
5974
|
+
* Works on an anonymous connection only, and only with an agent that allows
|
|
5975
|
+
* anonymous visitors (`anonymous.enabled: true` on its raisin:AIAgent). The
|
|
5976
|
+
* server keeps the conversation in an ephemeral visitor session that only
|
|
5977
|
+
* this browser session can read; the session secret is kept in
|
|
5978
|
+
* sessionStorage (override with `options.store`), so a reload continues the
|
|
5979
|
+
* same conversation. Then use `sendMessage`, `getMessages`, `subscribe` and
|
|
5980
|
+
* `ConversationStore` / `useConversation` exactly as for a signed-in user.
|
|
5981
|
+
*
|
|
5982
|
+
* @example
|
|
5983
|
+
* ```typescript
|
|
5984
|
+
* const convo = await db.conversations.startAnonymous('/agents/website-assistant');
|
|
5985
|
+
* for await (const ev of db.conversations.sendMessage(convo.conversationPath, 'Hello')) {
|
|
5986
|
+
* if (ev.type === 'text_chunk') append(ev.text);
|
|
5987
|
+
* if (ev.type === 'failed') showLimit(ev.code); // e.g. RATE_LIMITED, LIMIT_REACHED
|
|
5988
|
+
* }
|
|
5989
|
+
* ```
|
|
5990
|
+
*/
|
|
5991
|
+
startAnonymous(agent: string, options?: StartAnonymousOptions): Promise<AnonymousConversation>;
|
|
5992
|
+
/** Forget the stored anonymous session for `agent` (the next start begins a new one). */
|
|
5993
|
+
forgetAnonymous(agent: string, options?: StartAnonymousOptions): void;
|
|
5994
|
+
/** Whether this tab remembers an anonymous conversation with `agent`. */
|
|
5995
|
+
hasStoredAnonymous(agent: string, options?: StartAnonymousOptions): boolean;
|
|
5996
|
+
/** Whether `conversationPath` is an anonymous conversation of this client. */
|
|
5997
|
+
isAnonymous(conversationPath: string): boolean;
|
|
5837
5998
|
/**
|
|
5838
5999
|
* Open an existing conversation by path.
|
|
5839
6000
|
* Returns null if not found.
|
|
@@ -6748,6 +6909,8 @@ interface DatabaseHttpOptions {
|
|
|
6748
6909
|
httpBaseUrl?: string;
|
|
6749
6910
|
/** Auth manager for token access */
|
|
6750
6911
|
authManager?: AuthManager;
|
|
6912
|
+
/** Called after every successful reconnect (visitor chats re-prove their session). */
|
|
6913
|
+
onReconnected?: (callback: () => void) => () => void;
|
|
6751
6914
|
}
|
|
6752
6915
|
/**
|
|
6753
6916
|
* Database interface for repository operations
|
|
@@ -7993,6 +8156,12 @@ interface ConversationStoreOptions {
|
|
|
7993
8156
|
createOptions?: {
|
|
7994
8157
|
participant: string;
|
|
7995
8158
|
input?: Record<string, unknown>;
|
|
8159
|
+
/**
|
|
8160
|
+
* Chat WITHOUT login (a public website): starts or resumes an anonymous
|
|
8161
|
+
* visitor conversation (`db.conversations.startAnonymous`). `true`, or the
|
|
8162
|
+
* start options. The agent must allow anonymous visitors.
|
|
8163
|
+
*/
|
|
8164
|
+
anonymous?: boolean | StartAnonymousOptions;
|
|
7996
8165
|
};
|
|
7997
8166
|
/** Callback for individual chat events */
|
|
7998
8167
|
onEvent?: (event: ChatEvent) => void;
|
|
@@ -8029,6 +8198,13 @@ declare class ConversationStore {
|
|
|
8029
8198
|
private _watchdogIntervalMs;
|
|
8030
8199
|
private _watchdogTimer;
|
|
8031
8200
|
constructor(options: ConversationStoreOptions);
|
|
8201
|
+
private anonymousOptions;
|
|
8202
|
+
/**
|
|
8203
|
+
* Resume the visitor conversation this tab already has (the session secret
|
|
8204
|
+
* and conversation id live in sessionStorage), and load its history. A tab
|
|
8205
|
+
* without one starts nothing until the first message.
|
|
8206
|
+
*/
|
|
8207
|
+
private resumeAnonymous;
|
|
8032
8208
|
/**
|
|
8033
8209
|
* Subscribe to state changes.
|
|
8034
8210
|
* Returns an unsubscribe function.
|
|
@@ -8195,4 +8371,4 @@ declare class ConversationListStore {
|
|
|
8195
8371
|
private notify;
|
|
8196
8372
|
}
|
|
8197
8373
|
|
|
8198
|
-
export { type CurrentUser$1 as $, AuthManager as A, type BatchUpload as B, ConnectionState as C, Database as D, type EventMessage as E, type FlowClientOptions as F, type SearchOptions as G, type HttpClientOptions as H, type IdentityUser as I, type SearchPassage as J, type ClientMode as K, type CurrentUser as L, type UserNode as M, type Node as N, type AuthEvent as O, type PlanProjection as P, type AuthStateChange as Q, RaisinClient as R, type SubscriptionFilters as S, type ToolCallInfo as T, UploadErrorCode as U, type AuthStateChangeCallback as V, type WorkspaceScope as W, type UserChangeEvent as X, type UserChangeCallback as Y, HttpDatabase as Z, HttpWorkspaceClient as _, type ConversationStoreSnapshot as a, type CreateAgentRunResult as a$, type UserNode$1 as a0, type SignAssetOptions as a1, type SignedAssetUrl as a2, type DatabaseHttpOptions as a3, WorkspaceClient as a4, WorkspaceManager as a5, type WorkspaceCreateOptions as a6, type WorkspaceUpdateOptions as a7, NodeOperations as a8, type NodeCreateOptions as a9, type CheckpointOptions as aA, type MailboxEntry as aB, type SpawnChildOptions as aC, type SpawnChildResult as aD, NodeDevApi as aE, type ChangeOp as aF, type ChangesetOptions as aG, type CommitOutcome as aH, type NodeDevCommon as aI, type NodeDevConflict as aJ, type NodeDevTransport as aK, type NodeLocator as aL, type NodeRevision as aM, type NodeTarget as aN, type OpReceipt as aO, type Receipt as aP, type WorkRoot as aQ, type AgentRunCommand as aR, type AgentRunControlAck as aS, type AgentRunEvent as aT, type AgentRunFence as aU, type AgentRunStatus as aV, type AgentRunSubject as aW, type AgentRunView as aX, type AgentRunsTransport as aY, type BeginOperationOptions as aZ, type CreateAgentRunOptions as a_, type NodeCreateDeepOptions as aa, type NodeUpdateOptions as ab, type NodeQueryOptions as ac, Transaction as ad, type TransactionOptions as ae, NodeTypes as af, Archetypes as ag, ElementTypes as ah, Branches as ai, type BranchDiff as aj, type BranchDivergence as ak, type CrossBranchCopySummary as al, type CrossBranchNodeChange as am, type NodeDiffInfo as an, Tags as ao, SchedulerApi as ap, AgentRunsApi as aq, newControlId as ar, subjectOf as as, AgentRunsWsApi as at, type AgentRunChildView as au, type AgentRunSubscribeOptions as av, type AgentRunSubscription as aw, type ChildAction as ax, type ChildContext as ay, type ChildObjective as az, type ChatMessage as b, ResponseStatus as b$, type FinishOperationOptions as b0, type ListInvocationsFilter as b1, type ScheduleInvocationOptions as b2, type ScheduledInvocation as b3, type ScheduledInvocationRef as b4, type ScheduledInvocationTargetKind as b5, HttpNodeTypes as b6, HttpArchetypes as b7, HttpElementTypes as b8, type SchemaCommit as b9, type NodeHistoryPayload as bA, type RevisionEntry as bB, type AuditQueryPayload as bC, type AuditLogEntry as bD, type NodeQueryPayload as bE, type RelationAddPayload as bF, type RelationRemovePayload as bG, type RelationsGetPayload as bH, type SqlQueryPayload as bI, type SqlResult as bJ, type Workspace as bK, type WorkspaceCreatePayload as bL, type WorkspaceGetPayload as bM, type WorkspaceDeletePayload as bN, type WorkspaceUpdatePayload as bO, type SubscribePayload as bP, type UnsubscribePayload as bQ, type SubscriptionResponse as bR, type AuthenticatePayload as bS, type AuthenticateResponse as bT, type RefreshTokenPayload as bU, type TransactionBeginPayload as bV, type TransactionBeginResponse as bW, type TransactionCommitPayload as bX, type TransactionCommitResponse as bY, type TransactionRollbackPayload as bZ, RequestType as b_, SqlQuery as ba, createSqlHandler as bb, EventHandler as bc, EventSubscriptions as bd, type EventCallback as be, type Subscription as bf, Connection as bg, type ConnectionOptions as bh, MemoryTokenStorage as bi, LocalStorageTokenStorage as bj, type TokenStorage as bk, type IdentityAuthResponse as bl, type IdentityAuthError as bm, type RequestEnvelope as bn, type ResponseEnvelope as bo, type NodeEventPayload as bp, type RequestContext as bq, type ErrorInfo as br, type ResponseMetadata as bs, type IncomingRelation as bt, type NodeRelationships as bu, type NodeCreatePayload as bv, type NodeCreateDeepPayload as bw, type NodeUpdatePayload as bx, type NodeDeletePayload as by, type NodeGetPayload as bz, ConversationStore as c, type McpCallToolResult as c$, encodeMessage as c0, decodeMessage as c1, isEventMessage as c2, isResponseEnvelope as c3, ReconnectManager as c4, LogLevel as c5, logger as c6, configureLogger as c7, setLogLevel as c8, getLogLevel as c9, calculateChunkCount as cA, getChunkRange as cB, Uploader as cC, UploadManager as cD, FlowClient as cE, type FlowRunResult as cF, type FlowCollectResult as cG, FunctionsApi as cH, HttpFunctionsApi as cI, IdentityAuthApi as cJ, readTokensFromFragment as cK, type IdentityAuthResult as cL, type IdentityAuthTransport as cM, type IdentityInfo as cN, type IdentityMe as cO, type MagicLinkSent as cP, type MagicLinkOptions as cQ, type AuthProviders as cR, type FunctionInvokeOptions as cS, type FunctionInvokeResponse as cT, type FunctionInvokeSyncResponse as cU, McpClient as cV, type McpTransport as cW, type McpFrameStream as cX, type McpJsonRpcFrame as cY, type McpToolDescriptor as cZ, type McpContentBlock as c_, getLoggerConfig as ca, type LoggerConfig as cb, type UploadStatus as cc, type UploadOptions as cd, type UploadProgress as ce, type UploadResult as cf, type Upload as cg, type CreateUploadRequest as ch, type CreateUploadResponse as ci, type ChunkUploadResponse as cj, type UploadStatusResponse as ck, type CompleteUploadRequest as cl, type CompleteUploadResponse as cm, type BatchFileProgress as cn, UploadError as co, DEFAULT_CHUNK_SIZE as cp, DEFAULT_MAX_RETRIES as cq, DEFAULT_RETRY_BASE_DELAY as cr, DEFAULT_RETRY_MAX_DELAY as cs, DEFAULT_NODE_TYPE as ct, DEFAULT_BRANCH as cu, DEFAULT_BATCH_CONCURRENCY as cv, BrowserFileSource as cw, NodeFileSource as cx, createFileSource as cy, getContentType as cz, type ConversationListItem as d, type ChatEvent as d$, type McpResourceContents as d0, type McpReadResourceResult as d1, type McpResourceUpdate as d2, type McpResourceSubscription as d3, type FlowRunResponse as d4, type FlowInstanceStatus as d5, type FlowInstanceStatusResponse as d6, type FlowMetrics as d7, type StepStartedEvent as d8, type StepCompletedEvent as d9, type ChatTerminationConfig as dA, type ChatStepConfig as dB, type AiToolMode as dC, type AiErrorBehavior as dD, type AiContainerConfig as dE, type FlowDefinitionNodeBase as dF, type FlowStepProperties as dG, type FlowDefinitionStep as dH, type ContainerRule as dI, type FanOutConfig as dJ, type MergeStrategy as dK, type FlowDefinitionContainer as dL, type LoopConfig as dM, type FlowDefinitionNode as dN, type FlowDefinition as dO, type InboxTask as dP, type InboxTaskStatus as dQ, type TaskCompletionResult as dR, RETRY_STRATEGIES as dS, getRefDisplayName as dT, getRefPath as dU, isFlowDefinitionStep as dV, isFlowDefinitionContainer as dW, InboxApi as dX, type InboxApiOptions as dY, type ListTasksOptions as dZ, type ListTasksResponse as d_, type StepUsage as da, type StepFailedEvent as db, type FlowWaitingEvent as dc, type FlowResumedEvent as dd, type FlowCompletedEvent as de, type FlowFailedEvent as df, type TextChunkEvent as dg, type ToolCallStartedEvent as dh, type ToolCallCompletedEvent as di, type ThoughtChunkEvent as dj, type ConversationCreatedEvent as dk, type MessageSavedEvent as dl, type LogEvent as dm, isTerminalEvent as dn, type RaisinReference as dp, type ContainerType as dq, type StepErrorBehavior as dr, type FlowErrorStrategy as ds, type RetryConfig as dt, type RetryStrategy as du, type HumanTaskType as dv, type CanonicalTaskType as dw, type TaskOption as dx, type HandoffTarget as dy, type ChatTerminationMode as dz, ConversationListStore as e, type Conversation as e0, type ConversationType as e1, type ConversationStatus as e2, type MessageBody as e3, type ChatTextChunkEvent as e4, type ChatAssistantMessageEvent as e5, type ChatWaitingEvent as e6, type ChatCompletedEvent as e7, type ChatFailedEvent as e8, type ChatDoneEvent as e9, type ChatToolCallStartedEvent as ea, type ChatToolCallCompletedEvent as eb, type ChatThoughtChunkEvent as ec, type ToolCallRecord as ed, type MessageChild as ee, type PlanTask as ef, type ChatConversationCreatedEvent as eg, type ChatMessageSavedEvent as eh, type ChatMessageDeliveredEvent as ei, type ChatLogEvent as ej, ConversationManager as ek, DEFAULT_SEND_MESSAGE_INACTIVITY_TIMEOUT_MS as el, type ListConversationsOptions as
|
|
8374
|
+
export { type CurrentUser$1 as $, AuthManager as A, type BatchUpload as B, ConnectionState as C, Database as D, type EventMessage as E, type FlowClientOptions as F, type SearchOptions as G, type HttpClientOptions as H, type IdentityUser as I, type SearchPassage as J, type ClientMode as K, type CurrentUser as L, type UserNode as M, type Node as N, type AuthEvent as O, type PlanProjection as P, type AuthStateChange as Q, RaisinClient as R, type SubscriptionFilters as S, type ToolCallInfo as T, UploadErrorCode as U, type AuthStateChangeCallback as V, type WorkspaceScope as W, type UserChangeEvent as X, type UserChangeCallback as Y, HttpDatabase as Z, HttpWorkspaceClient as _, type ConversationStoreSnapshot as a, type CreateAgentRunResult as a$, type UserNode$1 as a0, type SignAssetOptions as a1, type SignedAssetUrl as a2, type DatabaseHttpOptions as a3, WorkspaceClient as a4, WorkspaceManager as a5, type WorkspaceCreateOptions as a6, type WorkspaceUpdateOptions as a7, NodeOperations as a8, type NodeCreateOptions as a9, type CheckpointOptions as aA, type MailboxEntry as aB, type SpawnChildOptions as aC, type SpawnChildResult as aD, NodeDevApi as aE, type ChangeOp as aF, type ChangesetOptions as aG, type CommitOutcome as aH, type NodeDevCommon as aI, type NodeDevConflict as aJ, type NodeDevTransport as aK, type NodeLocator as aL, type NodeRevision as aM, type NodeTarget as aN, type OpReceipt as aO, type Receipt as aP, type WorkRoot as aQ, type AgentRunCommand as aR, type AgentRunControlAck as aS, type AgentRunEvent as aT, type AgentRunFence as aU, type AgentRunStatus as aV, type AgentRunSubject as aW, type AgentRunView as aX, type AgentRunsTransport as aY, type BeginOperationOptions as aZ, type CreateAgentRunOptions as a_, type NodeCreateDeepOptions as aa, type NodeUpdateOptions as ab, type NodeQueryOptions as ac, Transaction as ad, type TransactionOptions as ae, NodeTypes as af, Archetypes as ag, ElementTypes as ah, Branches as ai, type BranchDiff as aj, type BranchDivergence as ak, type CrossBranchCopySummary as al, type CrossBranchNodeChange as am, type NodeDiffInfo as an, Tags as ao, SchedulerApi as ap, AgentRunsApi as aq, newControlId as ar, subjectOf as as, AgentRunsWsApi as at, type AgentRunChildView as au, type AgentRunSubscribeOptions as av, type AgentRunSubscription as aw, type ChildAction as ax, type ChildContext as ay, type ChildObjective as az, type ChatMessage as b, ResponseStatus as b$, type FinishOperationOptions as b0, type ListInvocationsFilter as b1, type ScheduleInvocationOptions as b2, type ScheduledInvocation as b3, type ScheduledInvocationRef as b4, type ScheduledInvocationTargetKind as b5, HttpNodeTypes as b6, HttpArchetypes as b7, HttpElementTypes as b8, type SchemaCommit as b9, type NodeHistoryPayload as bA, type RevisionEntry as bB, type AuditQueryPayload as bC, type AuditLogEntry as bD, type NodeQueryPayload as bE, type RelationAddPayload as bF, type RelationRemovePayload as bG, type RelationsGetPayload as bH, type SqlQueryPayload as bI, type SqlResult as bJ, type Workspace as bK, type WorkspaceCreatePayload as bL, type WorkspaceGetPayload as bM, type WorkspaceDeletePayload as bN, type WorkspaceUpdatePayload as bO, type SubscribePayload as bP, type UnsubscribePayload as bQ, type SubscriptionResponse as bR, type AuthenticatePayload as bS, type AuthenticateResponse as bT, type RefreshTokenPayload as bU, type TransactionBeginPayload as bV, type TransactionBeginResponse as bW, type TransactionCommitPayload as bX, type TransactionCommitResponse as bY, type TransactionRollbackPayload as bZ, RequestType as b_, SqlQuery as ba, createSqlHandler as bb, EventHandler as bc, EventSubscriptions as bd, type EventCallback as be, type Subscription as bf, Connection as bg, type ConnectionOptions as bh, MemoryTokenStorage as bi, LocalStorageTokenStorage as bj, type TokenStorage as bk, type IdentityAuthResponse as bl, type IdentityAuthError as bm, type RequestEnvelope as bn, type ResponseEnvelope as bo, type NodeEventPayload as bp, type RequestContext as bq, type ErrorInfo as br, type ResponseMetadata as bs, type IncomingRelation as bt, type NodeRelationships as bu, type NodeCreatePayload as bv, type NodeCreateDeepPayload as bw, type NodeUpdatePayload as bx, type NodeDeletePayload as by, type NodeGetPayload as bz, ConversationStore as c, type McpCallToolResult as c$, encodeMessage as c0, decodeMessage as c1, isEventMessage as c2, isResponseEnvelope as c3, ReconnectManager as c4, LogLevel as c5, logger as c6, configureLogger as c7, setLogLevel as c8, getLogLevel as c9, calculateChunkCount as cA, getChunkRange as cB, Uploader as cC, UploadManager as cD, FlowClient as cE, type FlowRunResult as cF, type FlowCollectResult as cG, FunctionsApi as cH, HttpFunctionsApi as cI, IdentityAuthApi as cJ, readTokensFromFragment as cK, type IdentityAuthResult as cL, type IdentityAuthTransport as cM, type IdentityInfo as cN, type IdentityMe as cO, type MagicLinkSent as cP, type MagicLinkOptions as cQ, type AuthProviders as cR, type FunctionInvokeOptions as cS, type FunctionInvokeResponse as cT, type FunctionInvokeSyncResponse as cU, McpClient as cV, type McpTransport as cW, type McpFrameStream as cX, type McpJsonRpcFrame as cY, type McpToolDescriptor as cZ, type McpContentBlock as c_, getLoggerConfig as ca, type LoggerConfig as cb, type UploadStatus as cc, type UploadOptions as cd, type UploadProgress as ce, type UploadResult as cf, type Upload as cg, type CreateUploadRequest as ch, type CreateUploadResponse as ci, type ChunkUploadResponse as cj, type UploadStatusResponse as ck, type CompleteUploadRequest as cl, type CompleteUploadResponse as cm, type BatchFileProgress as cn, UploadError as co, DEFAULT_CHUNK_SIZE as cp, DEFAULT_MAX_RETRIES as cq, DEFAULT_RETRY_BASE_DELAY as cr, DEFAULT_RETRY_MAX_DELAY as cs, DEFAULT_NODE_TYPE as ct, DEFAULT_BRANCH as cu, DEFAULT_BATCH_CONCURRENCY as cv, BrowserFileSource as cw, NodeFileSource as cx, createFileSource as cy, getContentType as cz, type ConversationListItem as d, type ChatEvent as d$, type McpResourceContents as d0, type McpReadResourceResult as d1, type McpResourceUpdate as d2, type McpResourceSubscription as d3, type FlowRunResponse as d4, type FlowInstanceStatus as d5, type FlowInstanceStatusResponse as d6, type FlowMetrics as d7, type StepStartedEvent as d8, type StepCompletedEvent as d9, type ChatTerminationConfig as dA, type ChatStepConfig as dB, type AiToolMode as dC, type AiErrorBehavior as dD, type AiContainerConfig as dE, type FlowDefinitionNodeBase as dF, type FlowStepProperties as dG, type FlowDefinitionStep as dH, type ContainerRule as dI, type FanOutConfig as dJ, type MergeStrategy as dK, type FlowDefinitionContainer as dL, type LoopConfig as dM, type FlowDefinitionNode as dN, type FlowDefinition as dO, type InboxTask as dP, type InboxTaskStatus as dQ, type TaskCompletionResult as dR, RETRY_STRATEGIES as dS, getRefDisplayName as dT, getRefPath as dU, isFlowDefinitionStep as dV, isFlowDefinitionContainer as dW, InboxApi as dX, type InboxApiOptions as dY, type ListTasksOptions as dZ, type ListTasksResponse as d_, type StepUsage as da, type StepFailedEvent as db, type FlowWaitingEvent as dc, type FlowResumedEvent as dd, type FlowCompletedEvent as de, type FlowFailedEvent as df, type TextChunkEvent as dg, type ToolCallStartedEvent as dh, type ToolCallCompletedEvent as di, type ThoughtChunkEvent as dj, type ConversationCreatedEvent as dk, type MessageSavedEvent as dl, type LogEvent as dm, isTerminalEvent as dn, type RaisinReference as dp, type ContainerType as dq, type StepErrorBehavior as dr, type FlowErrorStrategy as ds, type RetryConfig as dt, type RetryStrategy as du, type HumanTaskType as dv, type CanonicalTaskType as dw, type TaskOption as dx, type HandoffTarget as dy, type ChatTerminationMode as dz, ConversationListStore as e, type Conversation as e0, type ConversationType as e1, type ConversationStatus as e2, type MessageBody as e3, type ChatTextChunkEvent as e4, type ChatAssistantMessageEvent as e5, type ChatWaitingEvent as e6, type ChatCompletedEvent as e7, type ChatFailedEvent as e8, type ChatDoneEvent as e9, type ChatToolCallStartedEvent as ea, type ChatToolCallCompletedEvent as eb, type ChatThoughtChunkEvent as ec, type ToolCallRecord as ed, type MessageChild as ee, type PlanTask as ef, type ChatConversationCreatedEvent as eg, type ChatMessageSavedEvent as eh, type ChatMessageDeliveredEvent as ei, type ChatLogEvent as ej, ConversationManager as ek, DEFAULT_SEND_MESSAGE_INACTIVITY_TIMEOUT_MS as el, VisitorChatError as em, defaultVisitorSessionStore as en, type AnonymousConversation as eo, type StartAnonymousOptions as ep, type VisitorChatLimits as eq, type VisitorSessionStore as er, type ListConversationsOptions as es, type CreateConversationOptions as et, type SendMessageOptions as eu, type ConversationSubscription as ev, type PlanActionReceipt as ew, type PlanActionOptions as ex, type ConversationManagerOptions as ey, projectPlansFromMessages as ez, type ConversationStoreOptions as f, type ConversationListStoreOptions as g, type ConversationListSnapshot as h, FlowsApi as i, type FlowExecutionEvent as j, type PlanProjectionTask as k, type PropertyValue as l, type RelationRef as m, type ClientOptions as n, type Credentials as o, RaisinHttpClient as p, type RetryOptions as q, type UploaderConfig as r, type FileSource as s, type BatchUploadOptions as t, type BatchUploadResult as u, type BatchProgress as v, type ReconnectOptions as w, type Answer as x, type AskOptions as y, type Citation as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as ConversationStoreOptions, a as ConversationStoreSnapshot, b as ChatMessage, g as ConversationListStoreOptions, h as ConversationListSnapshot, d as ConversationListItem, R as RaisinClient, I as IdentityUser, C as ConnectionState, S as SubscriptionFilters, D as Database, A as AuthManager, F as FlowClientOptions, i as FlowsApi, j as FlowExecutionEvent, E as EventMessage } from './conversation-list-store-
|
|
1
|
+
import { f as ConversationStoreOptions, a as ConversationStoreSnapshot, b as ChatMessage, g as ConversationListStoreOptions, h as ConversationListSnapshot, d as ConversationListItem, R as RaisinClient, I as IdentityUser, C as ConnectionState, S as SubscriptionFilters, D as Database, A as AuthManager, F as FlowClientOptions, i as FlowsApi, j as FlowExecutionEvent, E as EventMessage } from './conversation-list-store-CqgIk8Rn.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* React adapters for the RaisinDB conversation stores.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as ConversationStoreOptions, a as ConversationStoreSnapshot, b as ChatMessage, g as ConversationListStoreOptions, h as ConversationListSnapshot, d as ConversationListItem, R as RaisinClient, I as IdentityUser, C as ConnectionState, S as SubscriptionFilters, D as Database, A as AuthManager, F as FlowClientOptions, i as FlowsApi, j as FlowExecutionEvent, E as EventMessage } from './conversation-list-store-
|
|
1
|
+
import { f as ConversationStoreOptions, a as ConversationStoreSnapshot, b as ChatMessage, g as ConversationListStoreOptions, h as ConversationListSnapshot, d as ConversationListItem, R as RaisinClient, I as IdentityUser, C as ConnectionState, S as SubscriptionFilters, D as Database, A as AuthManager, F as FlowClientOptions, i as FlowsApi, j as FlowExecutionEvent, E as EventMessage } from './conversation-list-store-CqgIk8Rn.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* React adapters for the RaisinDB conversation stores.
|
package/dist/index.d.mts
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.mjs';
|
|
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.mjs';
|
|
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-BD3rutlF.mjs';
|
|
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.mjs';
|
|
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-l1wmTWM4.mjs';
|
|
6
6
|
export { RaisinVue, VueComputedRef, VueLike, VueRef, createRaisinVue } from './vue.mjs';
|
|
7
7
|
import 'events';
|
|
8
8
|
import 'fs/promises';
|