@raisindb/client 0.5.3 → 0.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/{chunk-3KMOXRTK.mjs → chunk-765DLJMZ.mjs} +24 -3
  2. package/dist/chunk-765DLJMZ.mjs.map +1 -0
  3. package/dist/{chunk-Q4IBPW2W.mjs → chunk-AULHRX5C.mjs} +2 -2
  4. package/dist/{chunk-QJKYNLT4.mjs → chunk-IFV4ECHC.mjs} +3 -3
  5. package/dist/{chunk-B6EFDYFS.mjs → chunk-VMUT6PIO.mjs} +2 -2
  6. package/dist/{chunk-P44XWTPA.mjs → chunk-ZUUSBLVP.mjs} +3 -3
  7. package/dist/{conversation-list-store-DVYgTaaA.d.mts → conversation-list-store-BaeGM2lx.d.mts} +439 -173
  8. package/dist/{conversation-list-store-DVYgTaaA.d.ts → conversation-list-store-BaeGM2lx.d.ts} +439 -173
  9. package/dist/{index-BOO1gV6F.d.mts → index-C4pX6FVI.d.mts} +1 -1
  10. package/dist/{index-AKUurvWQ.d.ts → index-DCtNAWZ0.d.ts} +1 -1
  11. package/dist/index.d.mts +4 -4
  12. package/dist/index.d.ts +4 -4
  13. package/dist/index.js +256 -16
  14. package/dist/index.js.map +1 -1
  15. package/dist/index.mjs +238 -19
  16. package/dist/index.mjs.map +1 -1
  17. package/dist/react.d.mts +2 -2
  18. package/dist/react.d.ts +2 -2
  19. package/dist/react.js +23 -2
  20. package/dist/react.js.map +1 -1
  21. package/dist/react.mjs +3 -3
  22. package/dist/{svelte-sql-B1nLVQuc.d.mts → svelte-sql-BhMxrqn_.d.mts} +1 -1
  23. package/dist/{svelte-sql-ABIom_Bb.d.ts → svelte-sql-DN3NpM4c.d.ts} +1 -1
  24. package/dist/svelte.d.mts +2 -2
  25. package/dist/svelte.d.ts +2 -2
  26. package/dist/svelte.js +23 -2
  27. package/dist/svelte.js.map +1 -1
  28. package/dist/svelte.mjs +3 -3
  29. package/dist/vue.d.mts +2 -2
  30. package/dist/vue.d.ts +2 -2
  31. package/dist/vue.js +23 -2
  32. package/dist/vue.js.map +1 -1
  33. package/dist/vue.mjs +2 -2
  34. package/package.json +1 -1
  35. package/dist/chunk-3KMOXRTK.mjs.map +0 -1
  36. /package/dist/{chunk-Q4IBPW2W.mjs.map → chunk-AULHRX5C.mjs.map} +0 -0
  37. /package/dist/{chunk-QJKYNLT4.mjs.map → chunk-IFV4ECHC.mjs.map} +0 -0
  38. /package/dist/{chunk-B6EFDYFS.mjs.map → chunk-VMUT6PIO.mjs.map} +0 -0
  39. /package/dist/{chunk-P44XWTPA.mjs.map → chunk-ZUUSBLVP.mjs.map} +0 -0
@@ -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-DVYgTaaA.mjs';
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-BaeGM2lx.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-DVYgTaaA.js';
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-BaeGM2lx.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-DVYgTaaA.mjs';
2
- export { cW as AiContainerConfig, cV as AiErrorBehavior, cU as AiToolMode, aa as Archetypes, aW as AuditLogEntry, aV as AuditQueryPayload, G as AuthEvent, A as AuthManager, c8 as AuthProviders, J as AuthStateChange, K as AuthStateChangeCallback, b9 as AuthenticatePayload, ba as AuthenticateResponse, bG as BatchFileProgress, ad as BranchDiff, ae as BranchDivergence, ac as Branches, bP as BrowserFileSource, cO as CanonicalTaskType, dn as ChatAssistantMessageEvent, dq as ChatCompletedEvent, dz as ChatConversationCreatedEvent, ds as ChatDoneEvent, dh as ChatEvent, dr as ChatFailedEvent, dC as ChatLogEvent, b as ChatMessage, dB as ChatMessageDeliveredEvent, dA as ChatMessageSavedEvent, cT as ChatStepConfig, cS as ChatTerminationConfig, cR as ChatTerminationMode, dm as ChatTextChunkEvent, dv as ChatThoughtChunkEvent, du as ChatToolCallCompletedEvent, dt as ChatToolCallStartedEvent, dp as ChatWaitingEvent, bC as ChunkUploadResponse, x as ClientMode, bE as CompleteUploadRequest, bF as CompleteUploadResponse, az as Connection, aA as ConnectionOptions, C as ConnectionState, c_ as ContainerRule, cI as ContainerType, di as Conversation, cD as ConversationCreatedEvent, d as ConversationListItem, h as ConversationListSnapshot, e as ConversationListStore, g as ConversationListStoreOptions, dD as ConversationManager, dL as ConversationManagerOptions, dk as ConversationStatus, c as ConversationStore, f as ConversationStoreOptions, a as ConversationStoreSnapshot, dI as ConversationSubscription, dj as ConversationType, dG as CreateConvoOptions, bA as CreateUploadRequest, bB as CreateUploadResponse, af as CrossBranchCopySummary, ag as CrossBranchNodeChange, y as CurrentUser, bO as DEFAULT_BATCH_CONCURRENCY, bN as DEFAULT_BRANCH, bI as DEFAULT_CHUNK_SIZE, bJ as DEFAULT_MAX_RETRIES, bM as DEFAULT_NODE_TYPE, bK as DEFAULT_RETRY_BASE_DELAY, bL as DEFAULT_RETRY_MAX_DELAY, dE as DEFAULT_SEND_MESSAGE_INACTIVITY_TIMEOUT_MS, D as Database, Z as DatabaseHttpOptions, ab as ElementTypes, aK as ErrorInfo, ax as EventCallback, av as EventHandler, E as EventMessage, aw as EventSubscriptions, c$ as FanOutConfig, bX as FlowClient, F as FlowClientOptions, bZ as FlowCollectResult, cx as FlowCompletedEvent, d4 as FlowDefinition, d1 as FlowDefinitionContainer, d3 as FlowDefinitionNode, cX as FlowDefinitionNodeBase, cZ as FlowDefinitionStep, cK as FlowErrorStrategy, j as FlowExecutionEvent, cy as FlowFailedEvent, co as FlowInstanceStatus, cp as FlowInstanceStatusResponse, cq as FlowMetrics, cw as FlowResumedEvent, cn as FlowRunResponse, bY as FlowRunResult, cY as FlowStepProperties, cv as FlowWaitingEvent, i as FlowsApi, c9 as FunctionInvokeOptions, ca as FunctionInvokeResponse, cb as FunctionInvokeSyncResponse, b_ as FunctionsApi, cQ as HandoffTarget, aq as HttpArchetypes, V as HttpCurrentUser, O as HttpDatabase, ar as HttpElementTypes, b$ as HttpFunctionsApi, ap as HttpNodeTypes, W as HttpUserNode, Q as HttpWorkspaceClient, cN as HumanTaskType, c0 as IdentityAuthApi, aF as IdentityAuthError, aE as IdentityAuthResponse, c2 as IdentityAuthResult, c3 as IdentityAuthTransport, c4 as IdentityInfo, c5 as IdentityMe, I as IdentityUser, dd as InboxApi, de as InboxApiOptions, d5 as InboxTask, d6 as InboxTaskStatus, aM as IncomingRelation, dF as ListConversationsOptions, ak as ListInvocationsFilter, df as ListTasksOptions, dg as ListTasksResponse, aC as LocalStorageTokenStorage, cF as LogEvent, bo as LogLevel, bu as LoggerConfig, d2 as LoopConfig, c7 as MagicLinkOptions, c6 as MagicLinkSent, ci as McpCallToolResult, cc as McpClient, ch as McpContentBlock, ce as McpFrameStream, cf as McpJsonRpcFrame, ck as McpReadResourceResult, cj as McpResourceContents, cm as McpResourceSubscription, cl as McpResourceUpdate, cg as McpToolDescriptor, cd as McpTransport, aB as MemoryTokenStorage, d0 as MergeStrategy, dl as MessageBody, dx as MessageChild, cE as MessageSavedEvent, a4 as NodeCreateDeepOptions, aP as NodeCreateDeepPayload, a3 as NodeCreateOptions, aO as NodeCreatePayload, aR as NodeDeletePayload, ah as NodeDiffInfo, aI as NodeEventPayload, bQ as NodeFileSource, aS as NodeGetPayload, aT as NodeHistoryPayload, a2 as NodeOperations, a6 as NodeQueryOptions, aX as NodeQueryPayload, aN as NodeRelationships, a9 as NodeTypes, a5 as NodeUpdateOptions, aQ as NodeUpdatePayload, dK as PlanActionOptions, dJ as PlanActionReceipt, P as PlanProjection, k as PlanProjectionTask, dy as PlanTask, d8 as RETRY_STRATEGIES, cH as RaisinReference, bn as ReconnectManager, bb as RefreshTokenPayload, aY as RelationAddPayload, aZ as RelationRemovePayload, a_ as RelationsGetPayload, aJ as RequestContext, aG as RequestEnvelope, bh as RequestType, aH as ResponseEnvelope, aL as ResponseMetadata, bi as ResponseStatus, cL as RetryConfig, cM as RetryStrategy, aU as RevisionEntry, al as ScheduleInvocationOptions, am as ScheduledInvocation, an as ScheduledInvocationRef, ao as ScheduledInvocationTargetKind, aj as SchedulerApi, as as SchemaCommit, dH as SendMessageOptions, X as SignAssetOptions, Y as SignedAssetUrl, at as SqlQuery, a$ as SqlQueryPayload, b0 as SqlResult, cs as StepCompletedEvent, cJ as StepErrorBehavior, cu as StepFailedEvent, cr as StepStartedEvent, ct as StepUsage, b6 as SubscribePayload, ay as Subscription, S as SubscriptionFilters, b8 as SubscriptionResponse, ai as Tags, d7 as TaskCompletionResult, cP as TaskOption, cz as TextChunkEvent, cC as ThoughtChunkEvent, aD as TokenStorage, cB as ToolCallCompletedEvent, T as ToolCallInfo, dw as ToolCallRecord, cA as ToolCallStartedEvent, a7 as Transaction, bc as TransactionBeginPayload, bd as TransactionBeginResponse, be as TransactionCommitPayload, bf as TransactionCommitResponse, a8 as TransactionOptions, bg as TransactionRollbackPayload, b7 as UnsubscribePayload, bz as Upload, bH as UploadError, bW as UploadManager, bw as UploadOptions, bx as UploadProgress, by as UploadResult, bv as UploadStatus, bD as UploadStatusResponse, bV as Uploader, M as UserChangeCallback, L as UserChangeEvent, z as UserNode, b1 as Workspace, _ as WorkspaceClient, a0 as WorkspaceCreateOptions, b2 as WorkspaceCreatePayload, b4 as WorkspaceDeletePayload, b3 as WorkspaceGetPayload, $ as WorkspaceManager, a1 as WorkspaceUpdateOptions, b5 as WorkspaceUpdatePayload, bT as calculateChunkCount, bq as configureLogger, bR as createFileSource, au as createSqlHandler, bk as decodeMessage, bj as encodeMessage, bU as getChunkRange, bS as getContentType, bs as getLogLevel, bt as getLoggerConfig, d9 as getRefDisplayName, da as getRefPath, bl as isEventMessage, dc as isFlowDefinitionContainer, db as isFlowDefinitionStep, bm as isResponseEnvelope, cG as isTerminalEvent, bp as logger, dM as projectPlansFromMessages, c1 as readTokensFromFragment, br as setLogLevel } from './conversation-list-store-DVYgTaaA.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-BOO1gV6F.mjs';
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-BaeGM2lx.mjs';
2
+ export { d0 as AiContainerConfig, c$ as AiErrorBehavior, c_ as AiToolMode, x as Answer, ag as Archetypes, y as AskOptions, b0 as AuditLogEntry, a$ as AuditQueryPayload, O as AuthEvent, A as AuthManager, ce as AuthProviders, Q as AuthStateChange, V as AuthStateChangeCallback, bf as AuthenticatePayload, bg as AuthenticateResponse, bM as BatchFileProgress, aj as BranchDiff, ak as BranchDivergence, ai as Branches, bV as BrowserFileSource, cU as CanonicalTaskType, du as ChatAssistantMessageEvent, dw as ChatCompletedEvent, dF as ChatConversationCreatedEvent, dy as ChatDoneEvent, dn as ChatEvent, dx as ChatFailedEvent, dI as ChatLogEvent, b as ChatMessage, dH as ChatMessageDeliveredEvent, dG as ChatMessageSavedEvent, cZ as ChatStepConfig, cY as ChatTerminationConfig, cX as ChatTerminationMode, dt as ChatTextChunkEvent, dB as ChatThoughtChunkEvent, dA as ChatToolCallCompletedEvent, dz as ChatToolCallStartedEvent, dv as ChatWaitingEvent, bI as ChunkUploadResponse, z as Citation, K as ClientMode, bK as CompleteUploadRequest, bL as CompleteUploadResponse, aF as Connection, aG as ConnectionOptions, C as ConnectionState, d4 as ContainerRule, cO as ContainerType, dp as Conversation, cJ as ConversationCreatedEvent, d as ConversationListItem, h as ConversationListSnapshot, e as ConversationListStore, g as ConversationListStoreOptions, dJ as ConversationManager, dR as ConversationManagerOptions, dr as ConversationStatus, c as ConversationStore, f as ConversationStoreOptions, a as ConversationStoreSnapshot, dO as ConversationSubscription, dq as ConversationType, dM as CreateConvoOptions, bG as CreateUploadRequest, bH as CreateUploadResponse, al as CrossBranchCopySummary, am as CrossBranchNodeChange, L as CurrentUser, bU as DEFAULT_BATCH_CONCURRENCY, bT as DEFAULT_BRANCH, bO as DEFAULT_CHUNK_SIZE, bP as DEFAULT_MAX_RETRIES, bS as DEFAULT_NODE_TYPE, bQ as DEFAULT_RETRY_BASE_DELAY, bR as DEFAULT_RETRY_MAX_DELAY, dK as DEFAULT_SEND_MESSAGE_INACTIVITY_TIMEOUT_MS, D as Database, a3 as DatabaseHttpOptions, ah as ElementTypes, aQ as ErrorInfo, aD as EventCallback, aB as EventHandler, E as EventMessage, aC as EventSubscriptions, d5 as FanOutConfig, c1 as FlowClient, F as FlowClientOptions, c3 as FlowCollectResult, cD as FlowCompletedEvent, da as FlowDefinition, d7 as FlowDefinitionContainer, d9 as FlowDefinitionNode, d1 as FlowDefinitionNodeBase, d3 as FlowDefinitionStep, cQ as FlowErrorStrategy, j as FlowExecutionEvent, cE as FlowFailedEvent, cu as FlowInstanceStatus, cv as FlowInstanceStatusResponse, cw as FlowMetrics, cC as FlowResumedEvent, ct as FlowRunResponse, c2 as FlowRunResult, d2 as FlowStepProperties, cB as FlowWaitingEvent, i as FlowsApi, cf as FunctionInvokeOptions, cg as FunctionInvokeResponse, ch as FunctionInvokeSyncResponse, c4 as FunctionsApi, cW as HandoffTarget, aw as HttpArchetypes, $ as HttpCurrentUser, Z as HttpDatabase, ax as HttpElementTypes, c5 as HttpFunctionsApi, av as HttpNodeTypes, a0 as HttpUserNode, _ as HttpWorkspaceClient, cT as HumanTaskType, c6 as IdentityAuthApi, aL as IdentityAuthError, aK as IdentityAuthResponse, c8 as IdentityAuthResult, c9 as IdentityAuthTransport, ca as IdentityInfo, cb as IdentityMe, I as IdentityUser, dj as InboxApi, dk as InboxApiOptions, db as InboxTask, dc as InboxTaskStatus, aS as IncomingRelation, dL as ListConversationsOptions, aq as ListInvocationsFilter, dl as ListTasksOptions, dm as ListTasksResponse, aI as LocalStorageTokenStorage, cL as LogEvent, bu as LogLevel, bA as LoggerConfig, d8 as LoopConfig, cd as MagicLinkOptions, cc as MagicLinkSent, co as McpCallToolResult, ci as McpClient, cn as McpContentBlock, ck as McpFrameStream, cl as McpJsonRpcFrame, cq as McpReadResourceResult, cp as McpResourceContents, cs as McpResourceSubscription, cr as McpResourceUpdate, cm as McpToolDescriptor, cj as McpTransport, aH as MemoryTokenStorage, d6 as MergeStrategy, ds as MessageBody, dD as MessageChild, cK as MessageSavedEvent, aa as NodeCreateDeepOptions, aV as NodeCreateDeepPayload, a9 as NodeCreateOptions, aU as NodeCreatePayload, aX as NodeDeletePayload, an as NodeDiffInfo, aO as NodeEventPayload, bW as NodeFileSource, aY as NodeGetPayload, aZ as NodeHistoryPayload, a8 as NodeOperations, ac as NodeQueryOptions, b1 as NodeQueryPayload, aT as NodeRelationships, af as NodeTypes, ab as NodeUpdateOptions, aW as NodeUpdatePayload, dQ as PlanActionOptions, dP as PlanActionReceipt, P as PlanProjection, k as PlanProjectionTask, dE as PlanTask, de as RETRY_STRATEGIES, cN as RaisinReference, bt as ReconnectManager, bh as RefreshTokenPayload, b2 as RelationAddPayload, b3 as RelationRemovePayload, b4 as RelationsGetPayload, aP as RequestContext, aM as RequestEnvelope, bn as RequestType, aN as ResponseEnvelope, aR as ResponseMetadata, bo as ResponseStatus, cR as RetryConfig, cS as RetryStrategy, a_ as RevisionEntry, ar as ScheduleInvocationOptions, as as ScheduledInvocation, at as ScheduledInvocationRef, au as ScheduledInvocationTargetKind, ap as SchedulerApi, ay as SchemaCommit, G as SearchOptions, J as SearchPassage, dN as SendMessageOptions, a1 as SignAssetOptions, a2 as SignedAssetUrl, az as SqlQuery, b5 as SqlQueryPayload, b6 as SqlResult, cy as StepCompletedEvent, cP as StepErrorBehavior, cA as StepFailedEvent, cx as StepStartedEvent, cz as StepUsage, bc as SubscribePayload, aE as Subscription, S as SubscriptionFilters, be as SubscriptionResponse, ao as Tags, dd as TaskCompletionResult, cV as TaskOption, cF as TextChunkEvent, cI as ThoughtChunkEvent, aJ as TokenStorage, cH as ToolCallCompletedEvent, T as ToolCallInfo, dC as ToolCallRecord, cG as ToolCallStartedEvent, ad as Transaction, bi as TransactionBeginPayload, bj as TransactionBeginResponse, bk as TransactionCommitPayload, bl as TransactionCommitResponse, ae as TransactionOptions, bm as TransactionRollbackPayload, bd as UnsubscribePayload, bF as Upload, bN as UploadError, c0 as UploadManager, bC as UploadOptions, bD as UploadProgress, bE as UploadResult, bB as UploadStatus, bJ as UploadStatusResponse, b$ as Uploader, Y as UserChangeCallback, X as UserChangeEvent, M as UserNode, b7 as Workspace, a4 as WorkspaceClient, a6 as WorkspaceCreateOptions, b8 as WorkspaceCreatePayload, ba as WorkspaceDeletePayload, b9 as WorkspaceGetPayload, a5 as WorkspaceManager, W as WorkspaceScope, a7 as WorkspaceUpdateOptions, bb as WorkspaceUpdatePayload, bZ as calculateChunkCount, bw as configureLogger, bX as createFileSource, aA as createSqlHandler, bq as decodeMessage, bp as encodeMessage, b_ as getChunkRange, bY as getContentType, by as getLogLevel, bz as getLoggerConfig, df as getRefDisplayName, dg as getRefPath, br as isEventMessage, di as isFlowDefinitionContainer, dh as isFlowDefinitionStep, bs as isResponseEnvelope, cM as isTerminalEvent, bv as logger, dS as projectPlansFromMessages, c7 as readTokensFromFragment, bx as setLogLevel } from './conversation-list-store-BaeGM2lx.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-C4pX6FVI.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-B1nLVQuc.mjs';
5
+ export { b as SqlAdapter, S as SqlAdapterOptions, a as SqlSnapshot, c as createSqlAdapter } from './svelte-sql-BhMxrqn_.mjs';
6
6
  export { RaisinVue, VueComputedRef, VueLike, VueRef, createRaisinVue } from './vue.mjs';
7
7
  import 'events';
8
8
  import 'fs/promises';
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-DVYgTaaA.js';
2
- export { cW as AiContainerConfig, cV as AiErrorBehavior, cU as AiToolMode, aa as Archetypes, aW as AuditLogEntry, aV as AuditQueryPayload, G as AuthEvent, A as AuthManager, c8 as AuthProviders, J as AuthStateChange, K as AuthStateChangeCallback, b9 as AuthenticatePayload, ba as AuthenticateResponse, bG as BatchFileProgress, ad as BranchDiff, ae as BranchDivergence, ac as Branches, bP as BrowserFileSource, cO as CanonicalTaskType, dn as ChatAssistantMessageEvent, dq as ChatCompletedEvent, dz as ChatConversationCreatedEvent, ds as ChatDoneEvent, dh as ChatEvent, dr as ChatFailedEvent, dC as ChatLogEvent, b as ChatMessage, dB as ChatMessageDeliveredEvent, dA as ChatMessageSavedEvent, cT as ChatStepConfig, cS as ChatTerminationConfig, cR as ChatTerminationMode, dm as ChatTextChunkEvent, dv as ChatThoughtChunkEvent, du as ChatToolCallCompletedEvent, dt as ChatToolCallStartedEvent, dp as ChatWaitingEvent, bC as ChunkUploadResponse, x as ClientMode, bE as CompleteUploadRequest, bF as CompleteUploadResponse, az as Connection, aA as ConnectionOptions, C as ConnectionState, c_ as ContainerRule, cI as ContainerType, di as Conversation, cD as ConversationCreatedEvent, d as ConversationListItem, h as ConversationListSnapshot, e as ConversationListStore, g as ConversationListStoreOptions, dD as ConversationManager, dL as ConversationManagerOptions, dk as ConversationStatus, c as ConversationStore, f as ConversationStoreOptions, a as ConversationStoreSnapshot, dI as ConversationSubscription, dj as ConversationType, dG as CreateConvoOptions, bA as CreateUploadRequest, bB as CreateUploadResponse, af as CrossBranchCopySummary, ag as CrossBranchNodeChange, y as CurrentUser, bO as DEFAULT_BATCH_CONCURRENCY, bN as DEFAULT_BRANCH, bI as DEFAULT_CHUNK_SIZE, bJ as DEFAULT_MAX_RETRIES, bM as DEFAULT_NODE_TYPE, bK as DEFAULT_RETRY_BASE_DELAY, bL as DEFAULT_RETRY_MAX_DELAY, dE as DEFAULT_SEND_MESSAGE_INACTIVITY_TIMEOUT_MS, D as Database, Z as DatabaseHttpOptions, ab as ElementTypes, aK as ErrorInfo, ax as EventCallback, av as EventHandler, E as EventMessage, aw as EventSubscriptions, c$ as FanOutConfig, bX as FlowClient, F as FlowClientOptions, bZ as FlowCollectResult, cx as FlowCompletedEvent, d4 as FlowDefinition, d1 as FlowDefinitionContainer, d3 as FlowDefinitionNode, cX as FlowDefinitionNodeBase, cZ as FlowDefinitionStep, cK as FlowErrorStrategy, j as FlowExecutionEvent, cy as FlowFailedEvent, co as FlowInstanceStatus, cp as FlowInstanceStatusResponse, cq as FlowMetrics, cw as FlowResumedEvent, cn as FlowRunResponse, bY as FlowRunResult, cY as FlowStepProperties, cv as FlowWaitingEvent, i as FlowsApi, c9 as FunctionInvokeOptions, ca as FunctionInvokeResponse, cb as FunctionInvokeSyncResponse, b_ as FunctionsApi, cQ as HandoffTarget, aq as HttpArchetypes, V as HttpCurrentUser, O as HttpDatabase, ar as HttpElementTypes, b$ as HttpFunctionsApi, ap as HttpNodeTypes, W as HttpUserNode, Q as HttpWorkspaceClient, cN as HumanTaskType, c0 as IdentityAuthApi, aF as IdentityAuthError, aE as IdentityAuthResponse, c2 as IdentityAuthResult, c3 as IdentityAuthTransport, c4 as IdentityInfo, c5 as IdentityMe, I as IdentityUser, dd as InboxApi, de as InboxApiOptions, d5 as InboxTask, d6 as InboxTaskStatus, aM as IncomingRelation, dF as ListConversationsOptions, ak as ListInvocationsFilter, df as ListTasksOptions, dg as ListTasksResponse, aC as LocalStorageTokenStorage, cF as LogEvent, bo as LogLevel, bu as LoggerConfig, d2 as LoopConfig, c7 as MagicLinkOptions, c6 as MagicLinkSent, ci as McpCallToolResult, cc as McpClient, ch as McpContentBlock, ce as McpFrameStream, cf as McpJsonRpcFrame, ck as McpReadResourceResult, cj as McpResourceContents, cm as McpResourceSubscription, cl as McpResourceUpdate, cg as McpToolDescriptor, cd as McpTransport, aB as MemoryTokenStorage, d0 as MergeStrategy, dl as MessageBody, dx as MessageChild, cE as MessageSavedEvent, a4 as NodeCreateDeepOptions, aP as NodeCreateDeepPayload, a3 as NodeCreateOptions, aO as NodeCreatePayload, aR as NodeDeletePayload, ah as NodeDiffInfo, aI as NodeEventPayload, bQ as NodeFileSource, aS as NodeGetPayload, aT as NodeHistoryPayload, a2 as NodeOperations, a6 as NodeQueryOptions, aX as NodeQueryPayload, aN as NodeRelationships, a9 as NodeTypes, a5 as NodeUpdateOptions, aQ as NodeUpdatePayload, dK as PlanActionOptions, dJ as PlanActionReceipt, P as PlanProjection, k as PlanProjectionTask, dy as PlanTask, d8 as RETRY_STRATEGIES, cH as RaisinReference, bn as ReconnectManager, bb as RefreshTokenPayload, aY as RelationAddPayload, aZ as RelationRemovePayload, a_ as RelationsGetPayload, aJ as RequestContext, aG as RequestEnvelope, bh as RequestType, aH as ResponseEnvelope, aL as ResponseMetadata, bi as ResponseStatus, cL as RetryConfig, cM as RetryStrategy, aU as RevisionEntry, al as ScheduleInvocationOptions, am as ScheduledInvocation, an as ScheduledInvocationRef, ao as ScheduledInvocationTargetKind, aj as SchedulerApi, as as SchemaCommit, dH as SendMessageOptions, X as SignAssetOptions, Y as SignedAssetUrl, at as SqlQuery, a$ as SqlQueryPayload, b0 as SqlResult, cs as StepCompletedEvent, cJ as StepErrorBehavior, cu as StepFailedEvent, cr as StepStartedEvent, ct as StepUsage, b6 as SubscribePayload, ay as Subscription, S as SubscriptionFilters, b8 as SubscriptionResponse, ai as Tags, d7 as TaskCompletionResult, cP as TaskOption, cz as TextChunkEvent, cC as ThoughtChunkEvent, aD as TokenStorage, cB as ToolCallCompletedEvent, T as ToolCallInfo, dw as ToolCallRecord, cA as ToolCallStartedEvent, a7 as Transaction, bc as TransactionBeginPayload, bd as TransactionBeginResponse, be as TransactionCommitPayload, bf as TransactionCommitResponse, a8 as TransactionOptions, bg as TransactionRollbackPayload, b7 as UnsubscribePayload, bz as Upload, bH as UploadError, bW as UploadManager, bw as UploadOptions, bx as UploadProgress, by as UploadResult, bv as UploadStatus, bD as UploadStatusResponse, bV as Uploader, M as UserChangeCallback, L as UserChangeEvent, z as UserNode, b1 as Workspace, _ as WorkspaceClient, a0 as WorkspaceCreateOptions, b2 as WorkspaceCreatePayload, b4 as WorkspaceDeletePayload, b3 as WorkspaceGetPayload, $ as WorkspaceManager, a1 as WorkspaceUpdateOptions, b5 as WorkspaceUpdatePayload, bT as calculateChunkCount, bq as configureLogger, bR as createFileSource, au as createSqlHandler, bk as decodeMessage, bj as encodeMessage, bU as getChunkRange, bS as getContentType, bs as getLogLevel, bt as getLoggerConfig, d9 as getRefDisplayName, da as getRefPath, bl as isEventMessage, dc as isFlowDefinitionContainer, db as isFlowDefinitionStep, bm as isResponseEnvelope, cG as isTerminalEvent, bp as logger, dM as projectPlansFromMessages, c1 as readTokensFromFragment, br as setLogLevel } from './conversation-list-store-DVYgTaaA.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-AKUurvWQ.js';
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-BaeGM2lx.js';
2
+ export { d0 as AiContainerConfig, c$ as AiErrorBehavior, c_ as AiToolMode, x as Answer, ag as Archetypes, y as AskOptions, b0 as AuditLogEntry, a$ as AuditQueryPayload, O as AuthEvent, A as AuthManager, ce as AuthProviders, Q as AuthStateChange, V as AuthStateChangeCallback, bf as AuthenticatePayload, bg as AuthenticateResponse, bM as BatchFileProgress, aj as BranchDiff, ak as BranchDivergence, ai as Branches, bV as BrowserFileSource, cU as CanonicalTaskType, du as ChatAssistantMessageEvent, dw as ChatCompletedEvent, dF as ChatConversationCreatedEvent, dy as ChatDoneEvent, dn as ChatEvent, dx as ChatFailedEvent, dI as ChatLogEvent, b as ChatMessage, dH as ChatMessageDeliveredEvent, dG as ChatMessageSavedEvent, cZ as ChatStepConfig, cY as ChatTerminationConfig, cX as ChatTerminationMode, dt as ChatTextChunkEvent, dB as ChatThoughtChunkEvent, dA as ChatToolCallCompletedEvent, dz as ChatToolCallStartedEvent, dv as ChatWaitingEvent, bI as ChunkUploadResponse, z as Citation, K as ClientMode, bK as CompleteUploadRequest, bL as CompleteUploadResponse, aF as Connection, aG as ConnectionOptions, C as ConnectionState, d4 as ContainerRule, cO as ContainerType, dp as Conversation, cJ as ConversationCreatedEvent, d as ConversationListItem, h as ConversationListSnapshot, e as ConversationListStore, g as ConversationListStoreOptions, dJ as ConversationManager, dR as ConversationManagerOptions, dr as ConversationStatus, c as ConversationStore, f as ConversationStoreOptions, a as ConversationStoreSnapshot, dO as ConversationSubscription, dq as ConversationType, dM as CreateConvoOptions, bG as CreateUploadRequest, bH as CreateUploadResponse, al as CrossBranchCopySummary, am as CrossBranchNodeChange, L as CurrentUser, bU as DEFAULT_BATCH_CONCURRENCY, bT as DEFAULT_BRANCH, bO as DEFAULT_CHUNK_SIZE, bP as DEFAULT_MAX_RETRIES, bS as DEFAULT_NODE_TYPE, bQ as DEFAULT_RETRY_BASE_DELAY, bR as DEFAULT_RETRY_MAX_DELAY, dK as DEFAULT_SEND_MESSAGE_INACTIVITY_TIMEOUT_MS, D as Database, a3 as DatabaseHttpOptions, ah as ElementTypes, aQ as ErrorInfo, aD as EventCallback, aB as EventHandler, E as EventMessage, aC as EventSubscriptions, d5 as FanOutConfig, c1 as FlowClient, F as FlowClientOptions, c3 as FlowCollectResult, cD as FlowCompletedEvent, da as FlowDefinition, d7 as FlowDefinitionContainer, d9 as FlowDefinitionNode, d1 as FlowDefinitionNodeBase, d3 as FlowDefinitionStep, cQ as FlowErrorStrategy, j as FlowExecutionEvent, cE as FlowFailedEvent, cu as FlowInstanceStatus, cv as FlowInstanceStatusResponse, cw as FlowMetrics, cC as FlowResumedEvent, ct as FlowRunResponse, c2 as FlowRunResult, d2 as FlowStepProperties, cB as FlowWaitingEvent, i as FlowsApi, cf as FunctionInvokeOptions, cg as FunctionInvokeResponse, ch as FunctionInvokeSyncResponse, c4 as FunctionsApi, cW as HandoffTarget, aw as HttpArchetypes, $ as HttpCurrentUser, Z as HttpDatabase, ax as HttpElementTypes, c5 as HttpFunctionsApi, av as HttpNodeTypes, a0 as HttpUserNode, _ as HttpWorkspaceClient, cT as HumanTaskType, c6 as IdentityAuthApi, aL as IdentityAuthError, aK as IdentityAuthResponse, c8 as IdentityAuthResult, c9 as IdentityAuthTransport, ca as IdentityInfo, cb as IdentityMe, I as IdentityUser, dj as InboxApi, dk as InboxApiOptions, db as InboxTask, dc as InboxTaskStatus, aS as IncomingRelation, dL as ListConversationsOptions, aq as ListInvocationsFilter, dl as ListTasksOptions, dm as ListTasksResponse, aI as LocalStorageTokenStorage, cL as LogEvent, bu as LogLevel, bA as LoggerConfig, d8 as LoopConfig, cd as MagicLinkOptions, cc as MagicLinkSent, co as McpCallToolResult, ci as McpClient, cn as McpContentBlock, ck as McpFrameStream, cl as McpJsonRpcFrame, cq as McpReadResourceResult, cp as McpResourceContents, cs as McpResourceSubscription, cr as McpResourceUpdate, cm as McpToolDescriptor, cj as McpTransport, aH as MemoryTokenStorage, d6 as MergeStrategy, ds as MessageBody, dD as MessageChild, cK as MessageSavedEvent, aa as NodeCreateDeepOptions, aV as NodeCreateDeepPayload, a9 as NodeCreateOptions, aU as NodeCreatePayload, aX as NodeDeletePayload, an as NodeDiffInfo, aO as NodeEventPayload, bW as NodeFileSource, aY as NodeGetPayload, aZ as NodeHistoryPayload, a8 as NodeOperations, ac as NodeQueryOptions, b1 as NodeQueryPayload, aT as NodeRelationships, af as NodeTypes, ab as NodeUpdateOptions, aW as NodeUpdatePayload, dQ as PlanActionOptions, dP as PlanActionReceipt, P as PlanProjection, k as PlanProjectionTask, dE as PlanTask, de as RETRY_STRATEGIES, cN as RaisinReference, bt as ReconnectManager, bh as RefreshTokenPayload, b2 as RelationAddPayload, b3 as RelationRemovePayload, b4 as RelationsGetPayload, aP as RequestContext, aM as RequestEnvelope, bn as RequestType, aN as ResponseEnvelope, aR as ResponseMetadata, bo as ResponseStatus, cR as RetryConfig, cS as RetryStrategy, a_ as RevisionEntry, ar as ScheduleInvocationOptions, as as ScheduledInvocation, at as ScheduledInvocationRef, au as ScheduledInvocationTargetKind, ap as SchedulerApi, ay as SchemaCommit, G as SearchOptions, J as SearchPassage, dN as SendMessageOptions, a1 as SignAssetOptions, a2 as SignedAssetUrl, az as SqlQuery, b5 as SqlQueryPayload, b6 as SqlResult, cy as StepCompletedEvent, cP as StepErrorBehavior, cA as StepFailedEvent, cx as StepStartedEvent, cz as StepUsage, bc as SubscribePayload, aE as Subscription, S as SubscriptionFilters, be as SubscriptionResponse, ao as Tags, dd as TaskCompletionResult, cV as TaskOption, cF as TextChunkEvent, cI as ThoughtChunkEvent, aJ as TokenStorage, cH as ToolCallCompletedEvent, T as ToolCallInfo, dC as ToolCallRecord, cG as ToolCallStartedEvent, ad as Transaction, bi as TransactionBeginPayload, bj as TransactionBeginResponse, bk as TransactionCommitPayload, bl as TransactionCommitResponse, ae as TransactionOptions, bm as TransactionRollbackPayload, bd as UnsubscribePayload, bF as Upload, bN as UploadError, c0 as UploadManager, bC as UploadOptions, bD as UploadProgress, bE as UploadResult, bB as UploadStatus, bJ as UploadStatusResponse, b$ as Uploader, Y as UserChangeCallback, X as UserChangeEvent, M as UserNode, b7 as Workspace, a4 as WorkspaceClient, a6 as WorkspaceCreateOptions, b8 as WorkspaceCreatePayload, ba as WorkspaceDeletePayload, b9 as WorkspaceGetPayload, a5 as WorkspaceManager, W as WorkspaceScope, a7 as WorkspaceUpdateOptions, bb as WorkspaceUpdatePayload, bZ as calculateChunkCount, bw as configureLogger, bX as createFileSource, aA as createSqlHandler, bq as decodeMessage, bp as encodeMessage, b_ as getChunkRange, bY as getContentType, by as getLogLevel, bz as getLoggerConfig, df as getRefDisplayName, dg as getRefPath, br as isEventMessage, di as isFlowDefinitionContainer, dh as isFlowDefinitionStep, bs as isResponseEnvelope, cM as isTerminalEvent, bv as logger, dS as projectPlansFromMessages, c7 as readTokensFromFragment, bx as setLogLevel } from './conversation-list-store-BaeGM2lx.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-DCtNAWZ0.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-ABIom_Bb.js';
5
+ export { b as SqlAdapter, S as SqlAdapterOptions, a as SqlSnapshot, c as createSqlAdapter } from './svelte-sql-DN3NpM4c.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
@@ -3526,6 +3526,104 @@ var HttpFunctionsApi = class {
3526
3526
  }
3527
3527
  };
3528
3528
 
3529
+ // src/search-api.ts
3530
+ var ASK_FUNCTION = "ask";
3531
+ var DEFAULT_LIMIT = 8;
3532
+ var MAX_LIMIT = 50;
3533
+ var SearchApi = class {
3534
+ constructor(runSql, runFunction) {
3535
+ this.runSql = runSql;
3536
+ this.runFunction = runFunction;
3537
+ }
3538
+ /**
3539
+ * Find the passages that match a query, by meaning and by keyword at once.
3540
+ *
3541
+ * No model is involved, so this is the call for a search box, a "related
3542
+ * content" list, or anything assembling its own context.
3543
+ */
3544
+ async search(query, options) {
3545
+ if (!query || !query.trim()) {
3546
+ throw new Error("search(query) requires a non-empty query");
3547
+ }
3548
+ if (!options || !options.workspaces || !options.workspaces.trim()) {
3549
+ throw new Error(
3550
+ "search() requires `workspaces` \u2014 name a workspace, a list, a glob, or 'ALL READABLE'. An unscoped search on a public site is how draft content reaches a visitor."
3551
+ );
3552
+ }
3553
+ const limit = Math.min(
3554
+ Math.max(Math.floor(options.limit ?? DEFAULT_LIMIT), 1),
3555
+ MAX_LIMIT
3556
+ );
3557
+ const distance = Number.isFinite(options.maxDistance) ? `, max_distance => ${Number(options.maxDistance)}` : "";
3558
+ const sql = `
3559
+ SELECT node_id, path, name, score, chunk_index, chunk_text, chunk_text_source
3560
+ FROM HYBRID_SEARCH($1, ${limit},
3561
+ workspaces => $2,
3562
+ granularity => 'chunk'${distance})
3563
+ `;
3564
+ const result = await this.runSql(sql, [query.trim(), options.workspaces.trim()]);
3565
+ const rows = result?.rows ?? [];
3566
+ return rows.map((row) => ({
3567
+ path: String(row.path ?? ""),
3568
+ nodeId: String(row.node_id ?? ""),
3569
+ name: String(row.name ?? ""),
3570
+ // `0` is a real chunk index — a document that was never split — so it
3571
+ // must not be collapsed into "missing" by a falsy check.
3572
+ chunkIndex: row.chunk_index == null ? 0 : Number(row.chunk_index),
3573
+ text: String(row.chunk_text ?? ""),
3574
+ textIsExact: row.chunk_text_source === "exact",
3575
+ score: Number(row.score ?? 0)
3576
+ })).filter((passage) => passage.text.length > 0);
3577
+ }
3578
+ /**
3579
+ * Answer a question from the stored content, with citations.
3580
+ *
3581
+ * Retrieves, judges whether what came back answers the question, rewrites the
3582
+ * query once if it does not, and answers from those passages only.
3583
+ */
3584
+ async ask(question, options) {
3585
+ if (!question || !question.trim()) {
3586
+ throw new Error("ask(question) requires a non-empty question");
3587
+ }
3588
+ if (!options || !options.workspaces || !options.workspaces.trim()) {
3589
+ throw new Error(
3590
+ "ask() requires `workspaces` \u2014 name a workspace, a list, a glob, or 'ALL READABLE'. An answer is quoted back to whoever asked, so the corpus it may be drawn from is stated, never assumed."
3591
+ );
3592
+ }
3593
+ const raw = await this.runFunction(ASK_FUNCTION, {
3594
+ question: question.trim(),
3595
+ workspaces: options.workspaces.trim(),
3596
+ limit: options.limit,
3597
+ model: options.model,
3598
+ use_graph: options.useGraph
3599
+ });
3600
+ if (raw && typeof raw === "object" && "error" in raw && raw.error) {
3601
+ throw new Error(`ask failed: ${String(raw.error)}`);
3602
+ }
3603
+ const citations = Array.isArray(raw?.citations) ? raw.citations : [];
3604
+ return {
3605
+ answer: String(raw?.answer ?? ""),
3606
+ // Absent counts as NOT grounded. This flag is the one a caller branches
3607
+ // on before showing an answer, so an unexpected response shape must fail
3608
+ // towards "we found nothing", never towards "trust this".
3609
+ grounded: raw?.grounded === true,
3610
+ citations: citations.map((c) => ({
3611
+ marker: Number(c.marker ?? 0),
3612
+ path: String(c.path ?? ""),
3613
+ nodeId: String(c.node_id ?? ""),
3614
+ name: String(c.title ?? ""),
3615
+ chunkIndex: c.chunk_index == null ? 0 : Number(c.chunk_index),
3616
+ textIsExact: c.text_is_exact === true
3617
+ })),
3618
+ attempts: Array.isArray(raw?.attempts) ? raw.attempts.map((a) => ({
3619
+ query: String(a.query ?? ""),
3620
+ passages: Number(a.passages ?? 0)
3621
+ })) : [],
3622
+ model: String(raw?.model ?? "")
3623
+ };
3624
+ }
3625
+ };
3626
+
3529
3627
  // src/errors.ts
3530
3628
  var RaisinError = class extends Error {
3531
3629
  constructor(message, code, details) {
@@ -4468,7 +4566,17 @@ var ConversationManager = class {
4468
4566
  tasks.push({
4469
4567
  id: row.id,
4470
4568
  title: row.properties?.title ?? row.name,
4471
- status: row.properties?.status ?? "pending"
4569
+ status: row.properties?.status ?? "pending",
4570
+ delegation: row.properties?.delegation_id ? {
4571
+ id: row.properties.delegation_id,
4572
+ status: row.properties.delegation_status ?? "unknown",
4573
+ agentRef: row.properties.delegated_agent_ref?.["raisin:path"] ?? row.properties.delegated_agent_ref?.["raisin:ref"] ?? (typeof row.properties.delegated_agent_ref === "string" ? row.properties.delegated_agent_ref : void 0),
4574
+ flowInstanceId: row.properties.delegation_flow_instance_id ?? void 0,
4575
+ branch: row.properties.delegation_branch ?? void 0,
4576
+ baseBranch: row.properties.delegation_base_branch ?? void 0,
4577
+ result: row.properties.delegation_result,
4578
+ error: row.properties.delegation_error ?? void 0
4579
+ } : void 0
4472
4580
  });
4473
4581
  tasksByPlan.set(planPath, tasks);
4474
4582
  continue;
@@ -5520,6 +5628,73 @@ var Database = class _Database {
5520
5628
  }
5521
5629
  return this._functionsApi;
5522
5630
  }
5631
+ /**
5632
+ * The retrieval implementation behind {@link search} and {@link ask}.
5633
+ *
5634
+ * Private: callers get the two verbs, not the object, so how retrieval is
5635
+ * served stays ours to change.
5636
+ */
5637
+ searchApi() {
5638
+ if (!this._searchApi) {
5639
+ this._searchApi = new SearchApi(
5640
+ (sql, params) => this.executeSql(sql, params),
5641
+ async (name, input) => {
5642
+ const run = await this.functions().invoke(name, input, {
5643
+ waitForResult: true
5644
+ });
5645
+ return run?.result ?? run;
5646
+ }
5647
+ );
5648
+ }
5649
+ return this._searchApi;
5650
+ }
5651
+ /**
5652
+ * Find the passages matching a query, by meaning and by keyword at once.
5653
+ *
5654
+ * No model is involved — this is the call for a search box or for assembling
5655
+ * your own context. Returns one entry per PASSAGE, so several may come from
5656
+ * one document.
5657
+ *
5658
+ * @example
5659
+ * ```typescript
5660
+ * const passages = await db.search('how much notice to terminate', {
5661
+ * workspaces: 'stories',
5662
+ * });
5663
+ * passages[0].text; // the passage itself
5664
+ * passages[0].chunkIndex; // where in the document it came from
5665
+ * ```
5666
+ */
5667
+ async search(query, options) {
5668
+ return this.searchApi().search(query, options);
5669
+ }
5670
+ /**
5671
+ * Answer a question from the stored content, with citations.
5672
+ *
5673
+ * Retrieves, judges whether what came back answers the question, rewrites the
5674
+ * query once if it does not, and answers from those passages only. Check
5675
+ * `grounded` before showing the answer: when it is false nothing relevant was
5676
+ * found and the model was never asked.
5677
+ *
5678
+ * `workspaces` is required, the same as on {@link search}: an answer is
5679
+ * quoted back to whoever asked, so the corpus it may be drawn from is stated
5680
+ * rather than assumed. One name, a comma-separated list, a glob, or
5681
+ * `'ALL READABLE'`.
5682
+ *
5683
+ * A method rather than `functions().invoke('ask', ...)` on purpose — see the
5684
+ * note at the top of `search-api.ts`. `invoke` is the escape hatch for
5685
+ * functions YOU wrote.
5686
+ *
5687
+ * @example
5688
+ * ```typescript
5689
+ * const { answer, citations, grounded } = await db.ask(
5690
+ * 'How much notice do we have to give?',
5691
+ * { workspaces: 'stories, handbook' }, // one name, a list, a glob, or 'ALL READABLE'
5692
+ * );
5693
+ * ```
5694
+ */
5695
+ async ask(question, options) {
5696
+ return this.searchApi().ask(question, options);
5697
+ }
5523
5698
  /**
5524
5699
  * Get a pre-configured ConversationManager for managing conversations.
5525
5700
  *
@@ -8064,19 +8239,6 @@ var HttpDatabase = class _HttpDatabase {
8064
8239
  getBranch() {
8065
8240
  return this.branch;
8066
8241
  }
8067
- /**
8068
- * Create a new HttpDatabase instance scoped to a specific branch.
8069
- *
8070
- * @param branch - Branch name
8071
- * @returns New HttpDatabase instance with branch context
8072
- *
8073
- * @example
8074
- * ```typescript
8075
- * const db = client.database('my-repo');
8076
- * const staging = db.onBranch('staging');
8077
- * const result = await staging.executeSql('SELECT * FROM content');
8078
- * ```
8079
- */
8080
8242
  onBranch(branch) {
8081
8243
  return new _HttpDatabase(this.repository, this.client, branch);
8082
8244
  }
@@ -8124,6 +8286,63 @@ var HttpDatabase = class _HttpDatabase {
8124
8286
  (repo, name, input) => this.client.invokeFunctionSync(repo, name, input)
8125
8287
  );
8126
8288
  }
8289
+ /**
8290
+ * The retrieval implementation behind {@link search} and {@link ask}.
8291
+ *
8292
+ * The SAME `SearchApi` the WebSocket client uses, handed this transport's SQL
8293
+ * and function runners. Retrieval is one behaviour — the query shape, the
8294
+ * limit clamp, the required scope, the `grounded` fail-closed mapping — and a
8295
+ * second copy written against HTTP would drift from the first the moment
8296
+ * either is touched. Only the two runners differ.
8297
+ */
8298
+ searchApi() {
8299
+ if (!this._searchApi) {
8300
+ this._searchApi = new SearchApi(
8301
+ (sql, params) => this.executeSql(sql, params),
8302
+ async (name, input) => {
8303
+ const run = await this.functions().invoke(name, input, {
8304
+ waitForResult: true
8305
+ });
8306
+ return run?.result ?? run;
8307
+ }
8308
+ );
8309
+ }
8310
+ return this._searchApi;
8311
+ }
8312
+ /**
8313
+ * Find the passages matching a query, by meaning and by keyword at once.
8314
+ *
8315
+ * Available on this HTTP client as well as the WebSocket one, because this is
8316
+ * the client a server-side route handler reaches for — and a route handler is
8317
+ * exactly where retrieval belongs when the page is public: the browser must
8318
+ * not hold a credential that can read the repository.
8319
+ *
8320
+ * @example
8321
+ * ```typescript
8322
+ * const passages = await db.search('how much notice to terminate', {
8323
+ * workspaces: 'stories',
8324
+ * });
8325
+ * ```
8326
+ */
8327
+ async search(query, options) {
8328
+ return this.searchApi().search(query, options);
8329
+ }
8330
+ /**
8331
+ * Answer a question from the stored content, with citations.
8332
+ *
8333
+ * Check `grounded` before showing the answer: when it is false nothing
8334
+ * relevant was retrieved and the model was never asked.
8335
+ *
8336
+ * @example
8337
+ * ```typescript
8338
+ * const { answer, citations, grounded } = await db.ask(question, {
8339
+ * workspaces: 'stories, handbook',
8340
+ * });
8341
+ * ```
8342
+ */
8343
+ async ask(question, options) {
8344
+ return this.searchApi().ask(question, options);
8345
+ }
8127
8346
  /**
8128
8347
  * Get an {@link McpClient} for a content-declared MCP server on this database.
8129
8348
  *
@@ -10462,12 +10681,23 @@ function parsePlanTasks(rawTasks) {
10462
10681
  }
10463
10682
  const task = asRecord(rawTask);
10464
10683
  if (!task) return null;
10684
+ const delegation = asRecord(task.delegation);
10465
10685
  return {
10466
10686
  taskId: asString(task.task_id) ?? asString(task.id),
10467
10687
  title: asString(task.title) ?? `Task ${index + 1}`,
10468
10688
  status: asString(task.status) ?? "pending",
10469
10689
  description: asString(task.description),
10470
- priority: asString(task.priority)
10690
+ priority: asString(task.priority),
10691
+ delegation: delegation ? {
10692
+ id: asString(delegation.id),
10693
+ status: asString(delegation.status) ?? "unknown",
10694
+ agentRef: asString(delegation.agent_ref) ?? asString(delegation.agentRef),
10695
+ flowInstanceId: asString(delegation.flow_instance_id) ?? asString(delegation.flowInstanceId),
10696
+ branch: asString(delegation.branch),
10697
+ baseBranch: asString(delegation.base_branch) ?? asString(delegation.baseBranch),
10698
+ result: delegation.result,
10699
+ error: asString(delegation.error)
10700
+ } : void 0
10471
10701
  };
10472
10702
  }).filter((task) => task !== null);
10473
10703
  }
@@ -10574,7 +10804,17 @@ function projectPlansFromMessages(messages) {
10574
10804
  plan.tasks = child.tasks.map((task) => ({
10575
10805
  taskId: task.id,
10576
10806
  title: task.title,
10577
- status: task.status
10807
+ status: task.status,
10808
+ delegation: task.delegation ? {
10809
+ id: task.delegation.id,
10810
+ status: task.delegation.status,
10811
+ agentRef: task.delegation.agentRef,
10812
+ flowInstanceId: task.delegation.flowInstanceId,
10813
+ branch: task.delegation.branch,
10814
+ baseBranch: task.delegation.baseBranch,
10815
+ result: task.delegation.result,
10816
+ error: task.delegation.error
10817
+ } : void 0
10578
10818
  }));
10579
10819
  }
10580
10820
  }