@raisindb/client 0.4.4 → 0.4.6

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.
@@ -954,6 +954,28 @@ declare class AuthManager {
954
954
  * @param response - Authentication response from server
955
955
  */
956
956
  setTokens(response: AuthenticateResponse): void;
957
+ /**
958
+ * Learn a bare token's expiry FROM THE TOKEN.
959
+ *
960
+ * `setTokens` is the only other writer of `expiresAt`, and it needs a whole
961
+ * `AuthenticateResponse`. Several paths hold nothing but a JWT string — a
962
+ * session restored from storage, `authenticate({type:'jwt'})`,
963
+ * `setIdentityTokens(token)` — and left `expiresAt` null. `isTokenExpired()`
964
+ * reads null as EXPIRED, so `isAuthenticated()` answered false for the whole
965
+ * life of every restored session, i.e. every page load after the first.
966
+ *
967
+ * It failed silently, and it had already been routed around three times
968
+ * rather than fixed: both HTTP send paths were made to stop consulting
969
+ * `isAuthenticated()` (see `request()` and `mcpStream()` in http-client),
970
+ * and Studio grew its own token parse to tell a 404 apart from a logged-out
971
+ * read. This is the missing writer those workarounds existed for.
972
+ *
973
+ * Same 60s safety margin as `setTokens`, so both writers agree on when a
974
+ * token stops counting as good.
975
+ *
976
+ * @param token - A JWT held in storage or handed to us
977
+ */
978
+ adoptToken(token: string): void;
957
979
  /**
958
980
  * Get current access token
959
981
  */
@@ -4259,6 +4281,25 @@ interface FlowInstanceStatusResponse {
4259
4281
  started_at: string;
4260
4282
  /** Error message (if status is failed) */
4261
4283
  error?: string;
4284
+ /** Execution metrics, when the server includes them. */
4285
+ metrics?: FlowMetrics;
4286
+ }
4287
+ /** Execution metrics for a flow run. */
4288
+ interface FlowMetrics {
4289
+ total_duration_ms: number;
4290
+ step_count: number;
4291
+ retry_count: number;
4292
+ compensation_count: number;
4293
+ ai_iteration_count: number;
4294
+ /**
4295
+ * Model calls whose usage was reported.
4296
+ *
4297
+ * Counted separately from the token totals: a call that reported no usage is
4298
+ * a different fact from no call at all.
4299
+ */
4300
+ ai_call_count: number;
4301
+ total_input_tokens: number;
4302
+ total_output_tokens: number;
4262
4303
  }
4263
4304
  /** Base properties shared by all events */
4264
4305
  interface BaseFlowEvent {
@@ -4271,12 +4312,33 @@ interface StepStartedEvent extends BaseFlowEvent {
4271
4312
  step_name?: string;
4272
4313
  step_type: string;
4273
4314
  }
4315
+ /**
4316
+ * Model usage attributable to ONE step.
4317
+ *
4318
+ * Mirrors the engine's `StepUsage`. Providers disagree on the wire spelling
4319
+ * (`input_tokens`/`output_tokens` vs OpenAI's `prompt_tokens`/
4320
+ * `completion_tokens`); the server normalises them, so these two names are what
4321
+ * ever reaches a client.
4322
+ */
4323
+ interface StepUsage {
4324
+ input_tokens: number;
4325
+ output_tokens: number;
4326
+ }
4274
4327
  /** A step has completed successfully */
4275
4328
  interface StepCompletedEvent extends BaseFlowEvent {
4276
4329
  type: 'step_completed';
4277
4330
  node_id: string;
4278
4331
  output: unknown;
4279
4332
  duration_ms: number;
4333
+ /**
4334
+ * Model usage for THIS step, when it made a model call.
4335
+ *
4336
+ * Absent means no call was made (a function step, a decision) — as distinct
4337
+ * from a call that reported nothing, which arrives as zeros. Flow-level totals
4338
+ * live on the instance's metrics; this is what attributes cost to a node,
4339
+ * which is the question anyone tuning an agent graph has.
4340
+ */
4341
+ usage?: StepUsage;
4280
4342
  }
4281
4343
  /** A step has failed */
4282
4344
  interface StepFailedEvent extends BaseFlowEvent {
@@ -5239,7 +5301,7 @@ declare function getRefDisplayName(ref: RaisinReference): string;
5239
5301
  /** Get the full path from a reference. */
5240
5302
  declare function getRefPath(ref: RaisinReference): string;
5241
5303
  /** Container types */
5242
- type ContainerType = 'and' | 'or' | 'parallel' | 'ai_sequence';
5304
+ type ContainerType = 'and' | 'or' | 'parallel' | 'loop' | 'ai_sequence' | 'competition';
5243
5305
  /** Step error behavior */
5244
5306
  type StepErrorBehavior = 'stop' | 'skip' | 'continue';
5245
5307
  /** Flow-level error strategy */
@@ -5390,7 +5452,9 @@ interface FlowStepProperties {
5390
5452
  /** Lua script for evaluation */
5391
5453
  lua_script?: string;
5392
5454
  /** Condition expression (REL) - same namespaces as templates:
5393
- * `input.*`, `steps.<id>.*`, `trigger.*`, flow variables */
5455
+ * `input.*`, `steps.<id>.*`, `trigger.*`, `visits.<step_id>` (how many times a
5456
+ * node has been entered — what bounds a cyclic graph), `history.<step_id>`
5457
+ * (that node's output per visit, oldest first), flow variables */
5394
5458
  condition?: string;
5395
5459
  /** Key for payload data */
5396
5460
  payload_key?: string;
@@ -5503,12 +5567,47 @@ interface FanOutConfig {
5503
5567
  }
5504
5568
  /** How a parallel container joins its branches */
5505
5569
  type MergeStrategy = 'merge_all' | 'first_success' | 'all_success';
5506
- /** Container node with children (AND/OR/Parallel/AI) */
5570
+ /**
5571
+ * How a loop container iterates.
5572
+ *
5573
+ * EXACTLY ONE of `over`, `while` or `times` decides the shape. `over` was once
5574
+ * required — correct while the engine hardcoded `for_each` and its while/times
5575
+ * arms were unreachable from the designer format — so it is optional here, and
5576
+ * naming none or several is refused by the engine rather than resolved by
5577
+ * precedence.
5578
+ */
5579
+ interface LoopConfig {
5580
+ /** for_each: expression resolving to the collection to iterate. */
5581
+ over?: string;
5582
+ /** while: a REL condition re-tested BEFORE each iteration. */
5583
+ while?: string;
5584
+ /** times: a fixed repeat count. */
5585
+ times?: number;
5586
+ /** Variable name for the current item (default `item`). */
5587
+ item?: string;
5588
+ /** Variable name for the current 0-based index. */
5589
+ index?: string;
5590
+ /** Safety cap on iterations. */
5591
+ max_iterations?: number;
5592
+ /**
5593
+ * `while` only: drop the iteration ceiling and run purely on the condition.
5594
+ *
5595
+ * Opt-in rather than the meaning of an absent `max_iterations`. Safe because
5596
+ * the executor bounds a runaway itself, so a condition that never goes false
5597
+ * costs a failed flow rather than a wedged worker.
5598
+ */
5599
+ unbounded?: boolean;
5600
+ /** Early-exit REL condition, evaluated after each completed iteration. */
5601
+ until?: string;
5602
+ }
5603
+ /** Container node with children (AND/OR/Parallel/Loop/AI/Competition) */
5507
5604
  interface FlowDefinitionContainer extends FlowDefinitionNodeBase {
5508
5605
  node_type: 'raisin:FlowContainer';
5509
5606
  container_type: ContainerType;
5510
5607
  rules?: ContainerRule[];
5511
5608
  children: FlowDefinitionNode[];
5609
+ /** Iteration configuration (only for loop type) */
5610
+ loop?: LoopConfig;
5512
5611
  /** AI container configuration (only for ai_sequence type) */
5513
5612
  ai_config?: AiContainerConfig;
5514
5613
  /** Fan-out configuration (only for parallel type): one branch per collection item */
@@ -7082,4 +7181,4 @@ declare class ConversationListStore {
7082
7181
  private notify;
7083
7182
  }
7084
7183
 
7085
- export { WorkspaceManager as $, AuthManager as A, type BatchUpload as B, ConnectionState as C, Database as D, type EventMessage as E, type FlowClientOptions as F, type AuthEvent as G, type HttpClientOptions as H, type IdentityUser as I, type AuthStateChange as J, type AuthStateChangeCallback as K, type UserChangeEvent as L, type UserChangeCallback as M, type Node as N, HttpDatabase as O, type PlanProjection as P, HttpWorkspaceClient as Q, RaisinClient as R, type SubscriptionFilters as S, type ToolCallInfo as T, UploadErrorCode as U, type CurrentUser$1 as V, type UserNode$1 as W, type SignAssetOptions as X, type SignedAssetUrl as Y, type DatabaseHttpOptions as Z, WorkspaceClient as _, type ConversationStoreSnapshot as a, type SqlQueryPayload as a$, type WorkspaceCreateOptions as a0, type WorkspaceUpdateOptions as a1, NodeOperations as a2, type NodeCreateOptions as a3, type NodeCreateDeepOptions as a4, type NodeUpdateOptions as a5, type NodeQueryOptions as a6, Transaction as a7, type TransactionOptions as a8, NodeTypes as a9, type ConnectionOptions as aA, MemoryTokenStorage as aB, LocalStorageTokenStorage as aC, type TokenStorage as aD, type IdentityAuthResponse as aE, type IdentityAuthError as aF, type RequestEnvelope as aG, type ResponseEnvelope as aH, type NodeEventPayload as aI, type RequestContext as aJ, type ErrorInfo as aK, type ResponseMetadata as aL, type IncomingRelation as aM, type NodeRelationships as aN, type NodeCreatePayload as aO, type NodeCreateDeepPayload as aP, type NodeUpdatePayload as aQ, type NodeDeletePayload as aR, type NodeGetPayload as aS, type NodeHistoryPayload as aT, type RevisionEntry as aU, type AuditQueryPayload as aV, type AuditLogEntry as aW, type NodeQueryPayload as aX, type RelationAddPayload as aY, type RelationRemovePayload as aZ, type RelationsGetPayload as a_, Archetypes as aa, ElementTypes as ab, Branches as ac, type BranchDiff as ad, type BranchDivergence as ae, type CrossBranchCopySummary as af, type CrossBranchNodeChange as ag, type NodeDiffInfo as ah, Tags as ai, SchedulerApi as aj, type ListInvocationsFilter as ak, type ScheduleInvocationOptions as al, type ScheduledInvocation as am, type ScheduledInvocationRef as an, type ScheduledInvocationTargetKind as ao, HttpNodeTypes as ap, HttpArchetypes as aq, HttpElementTypes as ar, type SchemaCommit as as, SqlQuery as at, createSqlHandler as au, EventHandler as av, EventSubscriptions as aw, type EventCallback as ax, type Subscription as ay, Connection as az, type ChatMessage as b, HttpFunctionsApi as b$, type SqlResult as b0, type Workspace as b1, type WorkspaceCreatePayload as b2, type WorkspaceGetPayload as b3, type WorkspaceDeletePayload as b4, type WorkspaceUpdatePayload as b5, type SubscribePayload as b6, type UnsubscribePayload as b7, type SubscriptionResponse as b8, type AuthenticatePayload as b9, type CreateUploadRequest as bA, type CreateUploadResponse as bB, type ChunkUploadResponse as bC, type UploadStatusResponse as bD, type CompleteUploadRequest as bE, type CompleteUploadResponse as bF, type BatchFileProgress as bG, UploadError as bH, DEFAULT_CHUNK_SIZE as bI, DEFAULT_MAX_RETRIES as bJ, DEFAULT_RETRY_BASE_DELAY as bK, DEFAULT_RETRY_MAX_DELAY as bL, DEFAULT_NODE_TYPE as bM, DEFAULT_BRANCH as bN, DEFAULT_BATCH_CONCURRENCY as bO, BrowserFileSource as bP, NodeFileSource as bQ, createFileSource as bR, getContentType as bS, calculateChunkCount as bT, getChunkRange as bU, Uploader as bV, UploadManager as bW, FlowClient as bX, type FlowRunResult as bY, type FlowCollectResult as bZ, FunctionsApi as b_, type AuthenticateResponse as ba, type RefreshTokenPayload as bb, type TransactionBeginPayload as bc, type TransactionBeginResponse as bd, type TransactionCommitPayload as be, type TransactionCommitResponse as bf, type TransactionRollbackPayload as bg, RequestType as bh, ResponseStatus as bi, encodeMessage as bj, decodeMessage as bk, isEventMessage as bl, isResponseEnvelope as bm, ReconnectManager as bn, LogLevel as bo, logger as bp, configureLogger as bq, setLogLevel as br, getLogLevel as bs, getLoggerConfig as bt, type LoggerConfig as bu, type UploadStatus as bv, type UploadOptions as bw, type UploadProgress as bx, type UploadResult as by, type Upload as bz, ConversationStore as c, type FlowDefinitionContainer as c$, IdentityAuthApi as c0, readTokensFromFragment as c1, type IdentityAuthResult as c2, type IdentityAuthTransport as c3, type IdentityInfo as c4, type IdentityMe as c5, type MagicLinkSent as c6, type MagicLinkOptions as c7, type AuthProviders as c8, type FunctionInvokeOptions as c9, type ThoughtChunkEvent as cA, type ConversationCreatedEvent as cB, type MessageSavedEvent as cC, type LogEvent as cD, isTerminalEvent as cE, type RaisinReference as cF, type ContainerType as cG, type StepErrorBehavior as cH, type FlowErrorStrategy as cI, type RetryConfig as cJ, type RetryStrategy as cK, type HumanTaskType as cL, type CanonicalTaskType as cM, type TaskOption as cN, type HandoffTarget as cO, type ChatTerminationMode as cP, type ChatTerminationConfig as cQ, type ChatStepConfig as cR, type AiToolMode as cS, type AiErrorBehavior as cT, type AiContainerConfig as cU, type FlowDefinitionNodeBase as cV, type FlowStepProperties as cW, type FlowDefinitionStep as cX, type ContainerRule as cY, type FanOutConfig as cZ, type MergeStrategy as c_, type FunctionInvokeResponse as ca, type FunctionInvokeSyncResponse as cb, McpClient as cc, type McpTransport as cd, type McpFrameStream as ce, type McpJsonRpcFrame as cf, type McpToolDescriptor as cg, type McpContentBlock as ch, type McpCallToolResult as ci, type McpResourceContents as cj, type McpReadResourceResult as ck, type McpResourceUpdate as cl, type McpResourceSubscription as cm, type FlowRunResponse as cn, type FlowInstanceStatus as co, type FlowInstanceStatusResponse as cp, type StepStartedEvent as cq, type StepCompletedEvent as cr, type StepFailedEvent as cs, type FlowWaitingEvent as ct, type FlowResumedEvent as cu, type FlowCompletedEvent as cv, type FlowFailedEvent as cw, type TextChunkEvent as cx, type ToolCallStartedEvent as cy, type ToolCallCompletedEvent as cz, type ConversationListItem as d, type FlowDefinitionNode as d0, type FlowDefinition as d1, type InboxTask as d2, type InboxTaskStatus as d3, type TaskCompletionResult as d4, RETRY_STRATEGIES as d5, getRefDisplayName as d6, getRefPath as d7, isFlowDefinitionStep as d8, isFlowDefinitionContainer as d9, ConversationManager as dA, DEFAULT_SEND_MESSAGE_INACTIVITY_TIMEOUT_MS as dB, type ListConversationsOptions as dC, type CreateConversationOptions as dD, type SendMessageOptions as dE, type ConversationSubscription as dF, type PlanActionReceipt as dG, type PlanActionOptions as dH, type ConversationManagerOptions as dI, projectPlansFromMessages as dJ, InboxApi as da, type InboxApiOptions as db, type ListTasksOptions as dc, type ListTasksResponse as dd, type ChatEvent as de, type Conversation as df, type ConversationType as dg, type ConversationStatus as dh, type MessageBody as di, type ChatTextChunkEvent as dj, type ChatAssistantMessageEvent as dk, type ChatWaitingEvent as dl, type ChatCompletedEvent as dm, type ChatFailedEvent as dn, type ChatDoneEvent as dp, type ChatToolCallStartedEvent as dq, type ChatToolCallCompletedEvent as dr, type ChatThoughtChunkEvent as ds, type ToolCallRecord as dt, type MessageChild as du, type PlanTask as dv, type ChatConversationCreatedEvent as dw, type ChatMessageSavedEvent as dx, type ChatMessageDeliveredEvent as dy, type ChatLogEvent as dz, ConversationListStore as e, 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 ClientMode as x, type CurrentUser as y, type UserNode as z };
7184
+ export { WorkspaceManager as $, AuthManager as A, type BatchUpload as B, ConnectionState as C, Database as D, type EventMessage as E, type FlowClientOptions as F, type AuthEvent as G, type HttpClientOptions as H, type IdentityUser as I, type AuthStateChange as J, type AuthStateChangeCallback as K, type UserChangeEvent as L, type UserChangeCallback as M, type Node as N, HttpDatabase as O, type PlanProjection as P, HttpWorkspaceClient as Q, RaisinClient as R, type SubscriptionFilters as S, type ToolCallInfo as T, UploadErrorCode as U, type CurrentUser$1 as V, type UserNode$1 as W, type SignAssetOptions as X, type SignedAssetUrl as Y, type DatabaseHttpOptions as Z, WorkspaceClient as _, type ConversationStoreSnapshot as a, type SqlQueryPayload as a$, type WorkspaceCreateOptions as a0, type WorkspaceUpdateOptions as a1, NodeOperations as a2, type NodeCreateOptions as a3, type NodeCreateDeepOptions as a4, type NodeUpdateOptions as a5, type NodeQueryOptions as a6, Transaction as a7, type TransactionOptions as a8, NodeTypes as a9, type ConnectionOptions as aA, MemoryTokenStorage as aB, LocalStorageTokenStorage as aC, type TokenStorage as aD, type IdentityAuthResponse as aE, type IdentityAuthError as aF, type RequestEnvelope as aG, type ResponseEnvelope as aH, type NodeEventPayload as aI, type RequestContext as aJ, type ErrorInfo as aK, type ResponseMetadata as aL, type IncomingRelation as aM, type NodeRelationships as aN, type NodeCreatePayload as aO, type NodeCreateDeepPayload as aP, type NodeUpdatePayload as aQ, type NodeDeletePayload as aR, type NodeGetPayload as aS, type NodeHistoryPayload as aT, type RevisionEntry as aU, type AuditQueryPayload as aV, type AuditLogEntry as aW, type NodeQueryPayload as aX, type RelationAddPayload as aY, type RelationRemovePayload as aZ, type RelationsGetPayload as a_, Archetypes as aa, ElementTypes as ab, Branches as ac, type BranchDiff as ad, type BranchDivergence as ae, type CrossBranchCopySummary as af, type CrossBranchNodeChange as ag, type NodeDiffInfo as ah, Tags as ai, SchedulerApi as aj, type ListInvocationsFilter as ak, type ScheduleInvocationOptions as al, type ScheduledInvocation as am, type ScheduledInvocationRef as an, type ScheduledInvocationTargetKind as ao, HttpNodeTypes as ap, HttpArchetypes as aq, HttpElementTypes as ar, type SchemaCommit as as, SqlQuery as at, createSqlHandler as au, EventHandler as av, EventSubscriptions as aw, type EventCallback as ax, type Subscription as ay, Connection as az, type ChatMessage as b, HttpFunctionsApi as b$, type SqlResult as b0, type Workspace as b1, type WorkspaceCreatePayload as b2, type WorkspaceGetPayload as b3, type WorkspaceDeletePayload as b4, type WorkspaceUpdatePayload as b5, type SubscribePayload as b6, type UnsubscribePayload as b7, type SubscriptionResponse as b8, type AuthenticatePayload as b9, type CreateUploadRequest as bA, type CreateUploadResponse as bB, type ChunkUploadResponse as bC, type UploadStatusResponse as bD, type CompleteUploadRequest as bE, type CompleteUploadResponse as bF, type BatchFileProgress as bG, UploadError as bH, DEFAULT_CHUNK_SIZE as bI, DEFAULT_MAX_RETRIES as bJ, DEFAULT_RETRY_BASE_DELAY as bK, DEFAULT_RETRY_MAX_DELAY as bL, DEFAULT_NODE_TYPE as bM, DEFAULT_BRANCH as bN, DEFAULT_BATCH_CONCURRENCY as bO, BrowserFileSource as bP, NodeFileSource as bQ, createFileSource as bR, getContentType as bS, calculateChunkCount as bT, getChunkRange as bU, Uploader as bV, UploadManager as bW, FlowClient as bX, type FlowRunResult as bY, type FlowCollectResult as bZ, FunctionsApi as b_, type AuthenticateResponse as ba, type RefreshTokenPayload as bb, type TransactionBeginPayload as bc, type TransactionBeginResponse as bd, type TransactionCommitPayload as be, type TransactionCommitResponse as bf, type TransactionRollbackPayload as bg, RequestType as bh, ResponseStatus as bi, encodeMessage as bj, decodeMessage as bk, isEventMessage as bl, isResponseEnvelope as bm, ReconnectManager as bn, LogLevel as bo, logger as bp, configureLogger as bq, setLogLevel as br, getLogLevel as bs, getLoggerConfig as bt, type LoggerConfig as bu, type UploadStatus as bv, type UploadOptions as bw, type UploadProgress as bx, type UploadResult as by, type Upload as bz, ConversationStore as c, type FanOutConfig as c$, IdentityAuthApi as c0, readTokensFromFragment as c1, type IdentityAuthResult as c2, type IdentityAuthTransport as c3, type IdentityInfo as c4, type IdentityMe as c5, type MagicLinkSent as c6, type MagicLinkOptions as c7, type AuthProviders as c8, type FunctionInvokeOptions as c9, type ToolCallStartedEvent as cA, type ToolCallCompletedEvent as cB, type ThoughtChunkEvent as cC, type ConversationCreatedEvent as cD, type MessageSavedEvent as cE, type LogEvent as cF, isTerminalEvent as cG, type RaisinReference as cH, type ContainerType as cI, type StepErrorBehavior as cJ, type FlowErrorStrategy as cK, type RetryConfig as cL, type RetryStrategy as cM, type HumanTaskType as cN, type CanonicalTaskType as cO, type TaskOption as cP, type HandoffTarget as cQ, type ChatTerminationMode as cR, type ChatTerminationConfig as cS, type ChatStepConfig as cT, type AiToolMode as cU, type AiErrorBehavior as cV, type AiContainerConfig as cW, type FlowDefinitionNodeBase as cX, type FlowStepProperties as cY, type FlowDefinitionStep as cZ, type ContainerRule as c_, type FunctionInvokeResponse as ca, type FunctionInvokeSyncResponse as cb, McpClient as cc, type McpTransport as cd, type McpFrameStream as ce, type McpJsonRpcFrame as cf, type McpToolDescriptor as cg, type McpContentBlock as ch, type McpCallToolResult as ci, type McpResourceContents as cj, type McpReadResourceResult as ck, type McpResourceUpdate as cl, type McpResourceSubscription as cm, type FlowRunResponse as cn, type FlowInstanceStatus as co, type FlowInstanceStatusResponse as cp, type FlowMetrics as cq, type StepStartedEvent as cr, type StepCompletedEvent as cs, type StepUsage as ct, type StepFailedEvent as cu, type FlowWaitingEvent as cv, type FlowResumedEvent as cw, type FlowCompletedEvent as cx, type FlowFailedEvent as cy, type TextChunkEvent as cz, type ConversationListItem as d, type MergeStrategy as d0, type FlowDefinitionContainer as d1, type LoopConfig as d2, type FlowDefinitionNode as d3, type FlowDefinition as d4, type InboxTask as d5, type InboxTaskStatus as d6, type TaskCompletionResult as d7, RETRY_STRATEGIES as d8, getRefDisplayName as d9, type ChatMessageSavedEvent as dA, type ChatMessageDeliveredEvent as dB, type ChatLogEvent as dC, ConversationManager as dD, DEFAULT_SEND_MESSAGE_INACTIVITY_TIMEOUT_MS as dE, type ListConversationsOptions as dF, type CreateConversationOptions as dG, type SendMessageOptions as dH, type ConversationSubscription as dI, type PlanActionReceipt as dJ, type PlanActionOptions as dK, type ConversationManagerOptions as dL, projectPlansFromMessages as dM, getRefPath as da, isFlowDefinitionStep as db, isFlowDefinitionContainer as dc, InboxApi as dd, type InboxApiOptions as de, type ListTasksOptions as df, type ListTasksResponse as dg, type ChatEvent as dh, type Conversation as di, type ConversationType as dj, type ConversationStatus as dk, type MessageBody as dl, type ChatTextChunkEvent as dm, type ChatAssistantMessageEvent as dn, type ChatWaitingEvent as dp, type ChatCompletedEvent as dq, type ChatFailedEvent as dr, type ChatDoneEvent as ds, type ChatToolCallStartedEvent as dt, type ChatToolCallCompletedEvent as du, type ChatThoughtChunkEvent as dv, type ToolCallRecord as dw, type MessageChild as dx, type PlanTask as dy, type ChatConversationCreatedEvent as dz, ConversationListStore as e, 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 ClientMode as x, type CurrentUser as y, type UserNode as z };
@@ -954,6 +954,28 @@ declare class AuthManager {
954
954
  * @param response - Authentication response from server
955
955
  */
956
956
  setTokens(response: AuthenticateResponse): void;
957
+ /**
958
+ * Learn a bare token's expiry FROM THE TOKEN.
959
+ *
960
+ * `setTokens` is the only other writer of `expiresAt`, and it needs a whole
961
+ * `AuthenticateResponse`. Several paths hold nothing but a JWT string — a
962
+ * session restored from storage, `authenticate({type:'jwt'})`,
963
+ * `setIdentityTokens(token)` — and left `expiresAt` null. `isTokenExpired()`
964
+ * reads null as EXPIRED, so `isAuthenticated()` answered false for the whole
965
+ * life of every restored session, i.e. every page load after the first.
966
+ *
967
+ * It failed silently, and it had already been routed around three times
968
+ * rather than fixed: both HTTP send paths were made to stop consulting
969
+ * `isAuthenticated()` (see `request()` and `mcpStream()` in http-client),
970
+ * and Studio grew its own token parse to tell a 404 apart from a logged-out
971
+ * read. This is the missing writer those workarounds existed for.
972
+ *
973
+ * Same 60s safety margin as `setTokens`, so both writers agree on when a
974
+ * token stops counting as good.
975
+ *
976
+ * @param token - A JWT held in storage or handed to us
977
+ */
978
+ adoptToken(token: string): void;
957
979
  /**
958
980
  * Get current access token
959
981
  */
@@ -4259,6 +4281,25 @@ interface FlowInstanceStatusResponse {
4259
4281
  started_at: string;
4260
4282
  /** Error message (if status is failed) */
4261
4283
  error?: string;
4284
+ /** Execution metrics, when the server includes them. */
4285
+ metrics?: FlowMetrics;
4286
+ }
4287
+ /** Execution metrics for a flow run. */
4288
+ interface FlowMetrics {
4289
+ total_duration_ms: number;
4290
+ step_count: number;
4291
+ retry_count: number;
4292
+ compensation_count: number;
4293
+ ai_iteration_count: number;
4294
+ /**
4295
+ * Model calls whose usage was reported.
4296
+ *
4297
+ * Counted separately from the token totals: a call that reported no usage is
4298
+ * a different fact from no call at all.
4299
+ */
4300
+ ai_call_count: number;
4301
+ total_input_tokens: number;
4302
+ total_output_tokens: number;
4262
4303
  }
4263
4304
  /** Base properties shared by all events */
4264
4305
  interface BaseFlowEvent {
@@ -4271,12 +4312,33 @@ interface StepStartedEvent extends BaseFlowEvent {
4271
4312
  step_name?: string;
4272
4313
  step_type: string;
4273
4314
  }
4315
+ /**
4316
+ * Model usage attributable to ONE step.
4317
+ *
4318
+ * Mirrors the engine's `StepUsage`. Providers disagree on the wire spelling
4319
+ * (`input_tokens`/`output_tokens` vs OpenAI's `prompt_tokens`/
4320
+ * `completion_tokens`); the server normalises them, so these two names are what
4321
+ * ever reaches a client.
4322
+ */
4323
+ interface StepUsage {
4324
+ input_tokens: number;
4325
+ output_tokens: number;
4326
+ }
4274
4327
  /** A step has completed successfully */
4275
4328
  interface StepCompletedEvent extends BaseFlowEvent {
4276
4329
  type: 'step_completed';
4277
4330
  node_id: string;
4278
4331
  output: unknown;
4279
4332
  duration_ms: number;
4333
+ /**
4334
+ * Model usage for THIS step, when it made a model call.
4335
+ *
4336
+ * Absent means no call was made (a function step, a decision) — as distinct
4337
+ * from a call that reported nothing, which arrives as zeros. Flow-level totals
4338
+ * live on the instance's metrics; this is what attributes cost to a node,
4339
+ * which is the question anyone tuning an agent graph has.
4340
+ */
4341
+ usage?: StepUsage;
4280
4342
  }
4281
4343
  /** A step has failed */
4282
4344
  interface StepFailedEvent extends BaseFlowEvent {
@@ -5239,7 +5301,7 @@ declare function getRefDisplayName(ref: RaisinReference): string;
5239
5301
  /** Get the full path from a reference. */
5240
5302
  declare function getRefPath(ref: RaisinReference): string;
5241
5303
  /** Container types */
5242
- type ContainerType = 'and' | 'or' | 'parallel' | 'ai_sequence';
5304
+ type ContainerType = 'and' | 'or' | 'parallel' | 'loop' | 'ai_sequence' | 'competition';
5243
5305
  /** Step error behavior */
5244
5306
  type StepErrorBehavior = 'stop' | 'skip' | 'continue';
5245
5307
  /** Flow-level error strategy */
@@ -5390,7 +5452,9 @@ interface FlowStepProperties {
5390
5452
  /** Lua script for evaluation */
5391
5453
  lua_script?: string;
5392
5454
  /** Condition expression (REL) - same namespaces as templates:
5393
- * `input.*`, `steps.<id>.*`, `trigger.*`, flow variables */
5455
+ * `input.*`, `steps.<id>.*`, `trigger.*`, `visits.<step_id>` (how many times a
5456
+ * node has been entered — what bounds a cyclic graph), `history.<step_id>`
5457
+ * (that node's output per visit, oldest first), flow variables */
5394
5458
  condition?: string;
5395
5459
  /** Key for payload data */
5396
5460
  payload_key?: string;
@@ -5503,12 +5567,47 @@ interface FanOutConfig {
5503
5567
  }
5504
5568
  /** How a parallel container joins its branches */
5505
5569
  type MergeStrategy = 'merge_all' | 'first_success' | 'all_success';
5506
- /** Container node with children (AND/OR/Parallel/AI) */
5570
+ /**
5571
+ * How a loop container iterates.
5572
+ *
5573
+ * EXACTLY ONE of `over`, `while` or `times` decides the shape. `over` was once
5574
+ * required — correct while the engine hardcoded `for_each` and its while/times
5575
+ * arms were unreachable from the designer format — so it is optional here, and
5576
+ * naming none or several is refused by the engine rather than resolved by
5577
+ * precedence.
5578
+ */
5579
+ interface LoopConfig {
5580
+ /** for_each: expression resolving to the collection to iterate. */
5581
+ over?: string;
5582
+ /** while: a REL condition re-tested BEFORE each iteration. */
5583
+ while?: string;
5584
+ /** times: a fixed repeat count. */
5585
+ times?: number;
5586
+ /** Variable name for the current item (default `item`). */
5587
+ item?: string;
5588
+ /** Variable name for the current 0-based index. */
5589
+ index?: string;
5590
+ /** Safety cap on iterations. */
5591
+ max_iterations?: number;
5592
+ /**
5593
+ * `while` only: drop the iteration ceiling and run purely on the condition.
5594
+ *
5595
+ * Opt-in rather than the meaning of an absent `max_iterations`. Safe because
5596
+ * the executor bounds a runaway itself, so a condition that never goes false
5597
+ * costs a failed flow rather than a wedged worker.
5598
+ */
5599
+ unbounded?: boolean;
5600
+ /** Early-exit REL condition, evaluated after each completed iteration. */
5601
+ until?: string;
5602
+ }
5603
+ /** Container node with children (AND/OR/Parallel/Loop/AI/Competition) */
5507
5604
  interface FlowDefinitionContainer extends FlowDefinitionNodeBase {
5508
5605
  node_type: 'raisin:FlowContainer';
5509
5606
  container_type: ContainerType;
5510
5607
  rules?: ContainerRule[];
5511
5608
  children: FlowDefinitionNode[];
5609
+ /** Iteration configuration (only for loop type) */
5610
+ loop?: LoopConfig;
5512
5611
  /** AI container configuration (only for ai_sequence type) */
5513
5612
  ai_config?: AiContainerConfig;
5514
5613
  /** Fan-out configuration (only for parallel type): one branch per collection item */
@@ -7082,4 +7181,4 @@ declare class ConversationListStore {
7082
7181
  private notify;
7083
7182
  }
7084
7183
 
7085
- export { WorkspaceManager as $, AuthManager as A, type BatchUpload as B, ConnectionState as C, Database as D, type EventMessage as E, type FlowClientOptions as F, type AuthEvent as G, type HttpClientOptions as H, type IdentityUser as I, type AuthStateChange as J, type AuthStateChangeCallback as K, type UserChangeEvent as L, type UserChangeCallback as M, type Node as N, HttpDatabase as O, type PlanProjection as P, HttpWorkspaceClient as Q, RaisinClient as R, type SubscriptionFilters as S, type ToolCallInfo as T, UploadErrorCode as U, type CurrentUser$1 as V, type UserNode$1 as W, type SignAssetOptions as X, type SignedAssetUrl as Y, type DatabaseHttpOptions as Z, WorkspaceClient as _, type ConversationStoreSnapshot as a, type SqlQueryPayload as a$, type WorkspaceCreateOptions as a0, type WorkspaceUpdateOptions as a1, NodeOperations as a2, type NodeCreateOptions as a3, type NodeCreateDeepOptions as a4, type NodeUpdateOptions as a5, type NodeQueryOptions as a6, Transaction as a7, type TransactionOptions as a8, NodeTypes as a9, type ConnectionOptions as aA, MemoryTokenStorage as aB, LocalStorageTokenStorage as aC, type TokenStorage as aD, type IdentityAuthResponse as aE, type IdentityAuthError as aF, type RequestEnvelope as aG, type ResponseEnvelope as aH, type NodeEventPayload as aI, type RequestContext as aJ, type ErrorInfo as aK, type ResponseMetadata as aL, type IncomingRelation as aM, type NodeRelationships as aN, type NodeCreatePayload as aO, type NodeCreateDeepPayload as aP, type NodeUpdatePayload as aQ, type NodeDeletePayload as aR, type NodeGetPayload as aS, type NodeHistoryPayload as aT, type RevisionEntry as aU, type AuditQueryPayload as aV, type AuditLogEntry as aW, type NodeQueryPayload as aX, type RelationAddPayload as aY, type RelationRemovePayload as aZ, type RelationsGetPayload as a_, Archetypes as aa, ElementTypes as ab, Branches as ac, type BranchDiff as ad, type BranchDivergence as ae, type CrossBranchCopySummary as af, type CrossBranchNodeChange as ag, type NodeDiffInfo as ah, Tags as ai, SchedulerApi as aj, type ListInvocationsFilter as ak, type ScheduleInvocationOptions as al, type ScheduledInvocation as am, type ScheduledInvocationRef as an, type ScheduledInvocationTargetKind as ao, HttpNodeTypes as ap, HttpArchetypes as aq, HttpElementTypes as ar, type SchemaCommit as as, SqlQuery as at, createSqlHandler as au, EventHandler as av, EventSubscriptions as aw, type EventCallback as ax, type Subscription as ay, Connection as az, type ChatMessage as b, HttpFunctionsApi as b$, type SqlResult as b0, type Workspace as b1, type WorkspaceCreatePayload as b2, type WorkspaceGetPayload as b3, type WorkspaceDeletePayload as b4, type WorkspaceUpdatePayload as b5, type SubscribePayload as b6, type UnsubscribePayload as b7, type SubscriptionResponse as b8, type AuthenticatePayload as b9, type CreateUploadRequest as bA, type CreateUploadResponse as bB, type ChunkUploadResponse as bC, type UploadStatusResponse as bD, type CompleteUploadRequest as bE, type CompleteUploadResponse as bF, type BatchFileProgress as bG, UploadError as bH, DEFAULT_CHUNK_SIZE as bI, DEFAULT_MAX_RETRIES as bJ, DEFAULT_RETRY_BASE_DELAY as bK, DEFAULT_RETRY_MAX_DELAY as bL, DEFAULT_NODE_TYPE as bM, DEFAULT_BRANCH as bN, DEFAULT_BATCH_CONCURRENCY as bO, BrowserFileSource as bP, NodeFileSource as bQ, createFileSource as bR, getContentType as bS, calculateChunkCount as bT, getChunkRange as bU, Uploader as bV, UploadManager as bW, FlowClient as bX, type FlowRunResult as bY, type FlowCollectResult as bZ, FunctionsApi as b_, type AuthenticateResponse as ba, type RefreshTokenPayload as bb, type TransactionBeginPayload as bc, type TransactionBeginResponse as bd, type TransactionCommitPayload as be, type TransactionCommitResponse as bf, type TransactionRollbackPayload as bg, RequestType as bh, ResponseStatus as bi, encodeMessage as bj, decodeMessage as bk, isEventMessage as bl, isResponseEnvelope as bm, ReconnectManager as bn, LogLevel as bo, logger as bp, configureLogger as bq, setLogLevel as br, getLogLevel as bs, getLoggerConfig as bt, type LoggerConfig as bu, type UploadStatus as bv, type UploadOptions as bw, type UploadProgress as bx, type UploadResult as by, type Upload as bz, ConversationStore as c, type FlowDefinitionContainer as c$, IdentityAuthApi as c0, readTokensFromFragment as c1, type IdentityAuthResult as c2, type IdentityAuthTransport as c3, type IdentityInfo as c4, type IdentityMe as c5, type MagicLinkSent as c6, type MagicLinkOptions as c7, type AuthProviders as c8, type FunctionInvokeOptions as c9, type ThoughtChunkEvent as cA, type ConversationCreatedEvent as cB, type MessageSavedEvent as cC, type LogEvent as cD, isTerminalEvent as cE, type RaisinReference as cF, type ContainerType as cG, type StepErrorBehavior as cH, type FlowErrorStrategy as cI, type RetryConfig as cJ, type RetryStrategy as cK, type HumanTaskType as cL, type CanonicalTaskType as cM, type TaskOption as cN, type HandoffTarget as cO, type ChatTerminationMode as cP, type ChatTerminationConfig as cQ, type ChatStepConfig as cR, type AiToolMode as cS, type AiErrorBehavior as cT, type AiContainerConfig as cU, type FlowDefinitionNodeBase as cV, type FlowStepProperties as cW, type FlowDefinitionStep as cX, type ContainerRule as cY, type FanOutConfig as cZ, type MergeStrategy as c_, type FunctionInvokeResponse as ca, type FunctionInvokeSyncResponse as cb, McpClient as cc, type McpTransport as cd, type McpFrameStream as ce, type McpJsonRpcFrame as cf, type McpToolDescriptor as cg, type McpContentBlock as ch, type McpCallToolResult as ci, type McpResourceContents as cj, type McpReadResourceResult as ck, type McpResourceUpdate as cl, type McpResourceSubscription as cm, type FlowRunResponse as cn, type FlowInstanceStatus as co, type FlowInstanceStatusResponse as cp, type StepStartedEvent as cq, type StepCompletedEvent as cr, type StepFailedEvent as cs, type FlowWaitingEvent as ct, type FlowResumedEvent as cu, type FlowCompletedEvent as cv, type FlowFailedEvent as cw, type TextChunkEvent as cx, type ToolCallStartedEvent as cy, type ToolCallCompletedEvent as cz, type ConversationListItem as d, type FlowDefinitionNode as d0, type FlowDefinition as d1, type InboxTask as d2, type InboxTaskStatus as d3, type TaskCompletionResult as d4, RETRY_STRATEGIES as d5, getRefDisplayName as d6, getRefPath as d7, isFlowDefinitionStep as d8, isFlowDefinitionContainer as d9, ConversationManager as dA, DEFAULT_SEND_MESSAGE_INACTIVITY_TIMEOUT_MS as dB, type ListConversationsOptions as dC, type CreateConversationOptions as dD, type SendMessageOptions as dE, type ConversationSubscription as dF, type PlanActionReceipt as dG, type PlanActionOptions as dH, type ConversationManagerOptions as dI, projectPlansFromMessages as dJ, InboxApi as da, type InboxApiOptions as db, type ListTasksOptions as dc, type ListTasksResponse as dd, type ChatEvent as de, type Conversation as df, type ConversationType as dg, type ConversationStatus as dh, type MessageBody as di, type ChatTextChunkEvent as dj, type ChatAssistantMessageEvent as dk, type ChatWaitingEvent as dl, type ChatCompletedEvent as dm, type ChatFailedEvent as dn, type ChatDoneEvent as dp, type ChatToolCallStartedEvent as dq, type ChatToolCallCompletedEvent as dr, type ChatThoughtChunkEvent as ds, type ToolCallRecord as dt, type MessageChild as du, type PlanTask as dv, type ChatConversationCreatedEvent as dw, type ChatMessageSavedEvent as dx, type ChatMessageDeliveredEvent as dy, type ChatLogEvent as dz, ConversationListStore as e, 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 ClientMode as x, type CurrentUser as y, type UserNode as z };
7184
+ export { WorkspaceManager as $, AuthManager as A, type BatchUpload as B, ConnectionState as C, Database as D, type EventMessage as E, type FlowClientOptions as F, type AuthEvent as G, type HttpClientOptions as H, type IdentityUser as I, type AuthStateChange as J, type AuthStateChangeCallback as K, type UserChangeEvent as L, type UserChangeCallback as M, type Node as N, HttpDatabase as O, type PlanProjection as P, HttpWorkspaceClient as Q, RaisinClient as R, type SubscriptionFilters as S, type ToolCallInfo as T, UploadErrorCode as U, type CurrentUser$1 as V, type UserNode$1 as W, type SignAssetOptions as X, type SignedAssetUrl as Y, type DatabaseHttpOptions as Z, WorkspaceClient as _, type ConversationStoreSnapshot as a, type SqlQueryPayload as a$, type WorkspaceCreateOptions as a0, type WorkspaceUpdateOptions as a1, NodeOperations as a2, type NodeCreateOptions as a3, type NodeCreateDeepOptions as a4, type NodeUpdateOptions as a5, type NodeQueryOptions as a6, Transaction as a7, type TransactionOptions as a8, NodeTypes as a9, type ConnectionOptions as aA, MemoryTokenStorage as aB, LocalStorageTokenStorage as aC, type TokenStorage as aD, type IdentityAuthResponse as aE, type IdentityAuthError as aF, type RequestEnvelope as aG, type ResponseEnvelope as aH, type NodeEventPayload as aI, type RequestContext as aJ, type ErrorInfo as aK, type ResponseMetadata as aL, type IncomingRelation as aM, type NodeRelationships as aN, type NodeCreatePayload as aO, type NodeCreateDeepPayload as aP, type NodeUpdatePayload as aQ, type NodeDeletePayload as aR, type NodeGetPayload as aS, type NodeHistoryPayload as aT, type RevisionEntry as aU, type AuditQueryPayload as aV, type AuditLogEntry as aW, type NodeQueryPayload as aX, type RelationAddPayload as aY, type RelationRemovePayload as aZ, type RelationsGetPayload as a_, Archetypes as aa, ElementTypes as ab, Branches as ac, type BranchDiff as ad, type BranchDivergence as ae, type CrossBranchCopySummary as af, type CrossBranchNodeChange as ag, type NodeDiffInfo as ah, Tags as ai, SchedulerApi as aj, type ListInvocationsFilter as ak, type ScheduleInvocationOptions as al, type ScheduledInvocation as am, type ScheduledInvocationRef as an, type ScheduledInvocationTargetKind as ao, HttpNodeTypes as ap, HttpArchetypes as aq, HttpElementTypes as ar, type SchemaCommit as as, SqlQuery as at, createSqlHandler as au, EventHandler as av, EventSubscriptions as aw, type EventCallback as ax, type Subscription as ay, Connection as az, type ChatMessage as b, HttpFunctionsApi as b$, type SqlResult as b0, type Workspace as b1, type WorkspaceCreatePayload as b2, type WorkspaceGetPayload as b3, type WorkspaceDeletePayload as b4, type WorkspaceUpdatePayload as b5, type SubscribePayload as b6, type UnsubscribePayload as b7, type SubscriptionResponse as b8, type AuthenticatePayload as b9, type CreateUploadRequest as bA, type CreateUploadResponse as bB, type ChunkUploadResponse as bC, type UploadStatusResponse as bD, type CompleteUploadRequest as bE, type CompleteUploadResponse as bF, type BatchFileProgress as bG, UploadError as bH, DEFAULT_CHUNK_SIZE as bI, DEFAULT_MAX_RETRIES as bJ, DEFAULT_RETRY_BASE_DELAY as bK, DEFAULT_RETRY_MAX_DELAY as bL, DEFAULT_NODE_TYPE as bM, DEFAULT_BRANCH as bN, DEFAULT_BATCH_CONCURRENCY as bO, BrowserFileSource as bP, NodeFileSource as bQ, createFileSource as bR, getContentType as bS, calculateChunkCount as bT, getChunkRange as bU, Uploader as bV, UploadManager as bW, FlowClient as bX, type FlowRunResult as bY, type FlowCollectResult as bZ, FunctionsApi as b_, type AuthenticateResponse as ba, type RefreshTokenPayload as bb, type TransactionBeginPayload as bc, type TransactionBeginResponse as bd, type TransactionCommitPayload as be, type TransactionCommitResponse as bf, type TransactionRollbackPayload as bg, RequestType as bh, ResponseStatus as bi, encodeMessage as bj, decodeMessage as bk, isEventMessage as bl, isResponseEnvelope as bm, ReconnectManager as bn, LogLevel as bo, logger as bp, configureLogger as bq, setLogLevel as br, getLogLevel as bs, getLoggerConfig as bt, type LoggerConfig as bu, type UploadStatus as bv, type UploadOptions as bw, type UploadProgress as bx, type UploadResult as by, type Upload as bz, ConversationStore as c, type FanOutConfig as c$, IdentityAuthApi as c0, readTokensFromFragment as c1, type IdentityAuthResult as c2, type IdentityAuthTransport as c3, type IdentityInfo as c4, type IdentityMe as c5, type MagicLinkSent as c6, type MagicLinkOptions as c7, type AuthProviders as c8, type FunctionInvokeOptions as c9, type ToolCallStartedEvent as cA, type ToolCallCompletedEvent as cB, type ThoughtChunkEvent as cC, type ConversationCreatedEvent as cD, type MessageSavedEvent as cE, type LogEvent as cF, isTerminalEvent as cG, type RaisinReference as cH, type ContainerType as cI, type StepErrorBehavior as cJ, type FlowErrorStrategy as cK, type RetryConfig as cL, type RetryStrategy as cM, type HumanTaskType as cN, type CanonicalTaskType as cO, type TaskOption as cP, type HandoffTarget as cQ, type ChatTerminationMode as cR, type ChatTerminationConfig as cS, type ChatStepConfig as cT, type AiToolMode as cU, type AiErrorBehavior as cV, type AiContainerConfig as cW, type FlowDefinitionNodeBase as cX, type FlowStepProperties as cY, type FlowDefinitionStep as cZ, type ContainerRule as c_, type FunctionInvokeResponse as ca, type FunctionInvokeSyncResponse as cb, McpClient as cc, type McpTransport as cd, type McpFrameStream as ce, type McpJsonRpcFrame as cf, type McpToolDescriptor as cg, type McpContentBlock as ch, type McpCallToolResult as ci, type McpResourceContents as cj, type McpReadResourceResult as ck, type McpResourceUpdate as cl, type McpResourceSubscription as cm, type FlowRunResponse as cn, type FlowInstanceStatus as co, type FlowInstanceStatusResponse as cp, type FlowMetrics as cq, type StepStartedEvent as cr, type StepCompletedEvent as cs, type StepUsage as ct, type StepFailedEvent as cu, type FlowWaitingEvent as cv, type FlowResumedEvent as cw, type FlowCompletedEvent as cx, type FlowFailedEvent as cy, type TextChunkEvent as cz, type ConversationListItem as d, type MergeStrategy as d0, type FlowDefinitionContainer as d1, type LoopConfig as d2, type FlowDefinitionNode as d3, type FlowDefinition as d4, type InboxTask as d5, type InboxTaskStatus as d6, type TaskCompletionResult as d7, RETRY_STRATEGIES as d8, getRefDisplayName as d9, type ChatMessageSavedEvent as dA, type ChatMessageDeliveredEvent as dB, type ChatLogEvent as dC, ConversationManager as dD, DEFAULT_SEND_MESSAGE_INACTIVITY_TIMEOUT_MS as dE, type ListConversationsOptions as dF, type CreateConversationOptions as dG, type SendMessageOptions as dH, type ConversationSubscription as dI, type PlanActionReceipt as dJ, type PlanActionOptions as dK, type ConversationManagerOptions as dL, projectPlansFromMessages as dM, getRefPath as da, isFlowDefinitionStep as db, isFlowDefinitionContainer as dc, InboxApi as dd, type InboxApiOptions as de, type ListTasksOptions as df, type ListTasksResponse as dg, type ChatEvent as dh, type Conversation as di, type ConversationType as dj, type ConversationStatus as dk, type MessageBody as dl, type ChatTextChunkEvent as dm, type ChatAssistantMessageEvent as dn, type ChatWaitingEvent as dp, type ChatCompletedEvent as dq, type ChatFailedEvent as dr, type ChatDoneEvent as ds, type ChatToolCallStartedEvent as dt, type ChatToolCallCompletedEvent as du, type ChatThoughtChunkEvent as dv, type ToolCallRecord as dw, type MessageChild as dx, type PlanTask as dy, type ChatConversationCreatedEvent as dz, ConversationListStore as e, 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 ClientMode as x, type CurrentUser as y, type UserNode 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-C135ghpi.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-D1y3gGqL.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-C135ghpi.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-D1y3gGqL.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-C135ghpi.mjs';
2
- export { cU as AiContainerConfig, cT as AiErrorBehavior, cS 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, cM as CanonicalTaskType, dk as ChatAssistantMessageEvent, dm as ChatCompletedEvent, dw as ChatConversationCreatedEvent, dp as ChatDoneEvent, de as ChatEvent, dn as ChatFailedEvent, dz as ChatLogEvent, b as ChatMessage, dy as ChatMessageDeliveredEvent, dx as ChatMessageSavedEvent, cR as ChatStepConfig, cQ as ChatTerminationConfig, cP as ChatTerminationMode, dj as ChatTextChunkEvent, ds as ChatThoughtChunkEvent, dr as ChatToolCallCompletedEvent, dq as ChatToolCallStartedEvent, dl as ChatWaitingEvent, bC as ChunkUploadResponse, x as ClientMode, bE as CompleteUploadRequest, bF as CompleteUploadResponse, az as Connection, aA as ConnectionOptions, C as ConnectionState, cY as ContainerRule, cG as ContainerType, df as Conversation, cB as ConversationCreatedEvent, d as ConversationListItem, h as ConversationListSnapshot, e as ConversationListStore, g as ConversationListStoreOptions, dA as ConversationManager, dI as ConversationManagerOptions, dh as ConversationStatus, c as ConversationStore, f as ConversationStoreOptions, a as ConversationStoreSnapshot, dF as ConversationSubscription, dg as ConversationType, dD 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, dB 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, cZ as FanOutConfig, bX as FlowClient, F as FlowClientOptions, bZ as FlowCollectResult, cv as FlowCompletedEvent, d1 as FlowDefinition, c$ as FlowDefinitionContainer, d0 as FlowDefinitionNode, cV as FlowDefinitionNodeBase, cX as FlowDefinitionStep, cI as FlowErrorStrategy, j as FlowExecutionEvent, cw as FlowFailedEvent, co as FlowInstanceStatus, cp as FlowInstanceStatusResponse, cu as FlowResumedEvent, cn as FlowRunResponse, bY as FlowRunResult, cW as FlowStepProperties, ct as FlowWaitingEvent, i as FlowsApi, c9 as FunctionInvokeOptions, ca as FunctionInvokeResponse, cb as FunctionInvokeSyncResponse, b_ as FunctionsApi, cO 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, cL 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, da as InboxApi, db as InboxApiOptions, d2 as InboxTask, d3 as InboxTaskStatus, aM as IncomingRelation, dC as ListConversationsOptions, ak as ListInvocationsFilter, dc as ListTasksOptions, dd as ListTasksResponse, aC as LocalStorageTokenStorage, cD as LogEvent, bo as LogLevel, bu as LoggerConfig, 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, c_ as MergeStrategy, di as MessageBody, du as MessageChild, cC 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, dH as PlanActionOptions, dG as PlanActionReceipt, P as PlanProjection, k as PlanProjectionTask, dv as PlanTask, d5 as RETRY_STRATEGIES, cF 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, cJ as RetryConfig, cK as RetryStrategy, aU as RevisionEntry, al as ScheduleInvocationOptions, am as ScheduledInvocation, an as ScheduledInvocationRef, ao as ScheduledInvocationTargetKind, aj as SchedulerApi, as as SchemaCommit, dE as SendMessageOptions, X as SignAssetOptions, Y as SignedAssetUrl, at as SqlQuery, a$ as SqlQueryPayload, b0 as SqlResult, cr as StepCompletedEvent, cH as StepErrorBehavior, cs as StepFailedEvent, cq as StepStartedEvent, b6 as SubscribePayload, ay as Subscription, S as SubscriptionFilters, b8 as SubscriptionResponse, ai as Tags, d4 as TaskCompletionResult, cN as TaskOption, cx as TextChunkEvent, cA as ThoughtChunkEvent, aD as TokenStorage, cz as ToolCallCompletedEvent, T as ToolCallInfo, dt as ToolCallRecord, cy 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, d6 as getRefDisplayName, d7 as getRefPath, bl as isEventMessage, d9 as isFlowDefinitionContainer, d8 as isFlowDefinitionStep, bm as isResponseEnvelope, cE as isTerminalEvent, bp as logger, dJ as projectPlansFromMessages, c1 as readTokensFromFragment, br as setLogLevel } from './conversation-list-store-C135ghpi.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-CsiWJ0cN.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-D1y3gGqL.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-D1y3gGqL.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-DnGYfAbL.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-BAURd7Ha.mjs';
5
+ export { b as SqlAdapter, S as SqlAdapterOptions, a as SqlSnapshot, c as createSqlAdapter } from './svelte-sql-FFUsoktQ.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-C135ghpi.js';
2
- export { cU as AiContainerConfig, cT as AiErrorBehavior, cS 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, cM as CanonicalTaskType, dk as ChatAssistantMessageEvent, dm as ChatCompletedEvent, dw as ChatConversationCreatedEvent, dp as ChatDoneEvent, de as ChatEvent, dn as ChatFailedEvent, dz as ChatLogEvent, b as ChatMessage, dy as ChatMessageDeliveredEvent, dx as ChatMessageSavedEvent, cR as ChatStepConfig, cQ as ChatTerminationConfig, cP as ChatTerminationMode, dj as ChatTextChunkEvent, ds as ChatThoughtChunkEvent, dr as ChatToolCallCompletedEvent, dq as ChatToolCallStartedEvent, dl as ChatWaitingEvent, bC as ChunkUploadResponse, x as ClientMode, bE as CompleteUploadRequest, bF as CompleteUploadResponse, az as Connection, aA as ConnectionOptions, C as ConnectionState, cY as ContainerRule, cG as ContainerType, df as Conversation, cB as ConversationCreatedEvent, d as ConversationListItem, h as ConversationListSnapshot, e as ConversationListStore, g as ConversationListStoreOptions, dA as ConversationManager, dI as ConversationManagerOptions, dh as ConversationStatus, c as ConversationStore, f as ConversationStoreOptions, a as ConversationStoreSnapshot, dF as ConversationSubscription, dg as ConversationType, dD 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, dB 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, cZ as FanOutConfig, bX as FlowClient, F as FlowClientOptions, bZ as FlowCollectResult, cv as FlowCompletedEvent, d1 as FlowDefinition, c$ as FlowDefinitionContainer, d0 as FlowDefinitionNode, cV as FlowDefinitionNodeBase, cX as FlowDefinitionStep, cI as FlowErrorStrategy, j as FlowExecutionEvent, cw as FlowFailedEvent, co as FlowInstanceStatus, cp as FlowInstanceStatusResponse, cu as FlowResumedEvent, cn as FlowRunResponse, bY as FlowRunResult, cW as FlowStepProperties, ct as FlowWaitingEvent, i as FlowsApi, c9 as FunctionInvokeOptions, ca as FunctionInvokeResponse, cb as FunctionInvokeSyncResponse, b_ as FunctionsApi, cO 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, cL 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, da as InboxApi, db as InboxApiOptions, d2 as InboxTask, d3 as InboxTaskStatus, aM as IncomingRelation, dC as ListConversationsOptions, ak as ListInvocationsFilter, dc as ListTasksOptions, dd as ListTasksResponse, aC as LocalStorageTokenStorage, cD as LogEvent, bo as LogLevel, bu as LoggerConfig, 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, c_ as MergeStrategy, di as MessageBody, du as MessageChild, cC 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, dH as PlanActionOptions, dG as PlanActionReceipt, P as PlanProjection, k as PlanProjectionTask, dv as PlanTask, d5 as RETRY_STRATEGIES, cF 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, cJ as RetryConfig, cK as RetryStrategy, aU as RevisionEntry, al as ScheduleInvocationOptions, am as ScheduledInvocation, an as ScheduledInvocationRef, ao as ScheduledInvocationTargetKind, aj as SchedulerApi, as as SchemaCommit, dE as SendMessageOptions, X as SignAssetOptions, Y as SignedAssetUrl, at as SqlQuery, a$ as SqlQueryPayload, b0 as SqlResult, cr as StepCompletedEvent, cH as StepErrorBehavior, cs as StepFailedEvent, cq as StepStartedEvent, b6 as SubscribePayload, ay as Subscription, S as SubscriptionFilters, b8 as SubscriptionResponse, ai as Tags, d4 as TaskCompletionResult, cN as TaskOption, cx as TextChunkEvent, cA as ThoughtChunkEvent, aD as TokenStorage, cz as ToolCallCompletedEvent, T as ToolCallInfo, dt as ToolCallRecord, cy 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, d6 as getRefDisplayName, d7 as getRefPath, bl as isEventMessage, d9 as isFlowDefinitionContainer, d8 as isFlowDefinitionStep, bm as isResponseEnvelope, cE as isTerminalEvent, bp as logger, dJ as projectPlansFromMessages, c1 as readTokensFromFragment, br as setLogLevel } from './conversation-list-store-C135ghpi.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-tIhGW3eq.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-D1y3gGqL.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-D1y3gGqL.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-hWuJEcBQ.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-DpAhe9g7.js';
5
+ export { b as SqlAdapter, S as SqlAdapterOptions, a as SqlSnapshot, c as createSqlAdapter } from './svelte-sql-BEX5lLij.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
@@ -701,7 +701,7 @@ var LocalStorageTokenStorage = class {
701
701
  function isJwtCredentials(credentials) {
702
702
  return "type" in credentials && credentials.type === "jwt";
703
703
  }
704
- var AuthManager = class {
704
+ var AuthManager = class _AuthManager {
705
705
  constructor(storage) {
706
706
  this.expiresAt = null;
707
707
  this._storage = storage ?? new MemoryTokenStorage();
@@ -724,6 +724,31 @@ var AuthManager = class {
724
724
  this.expiresAt = Date.now() + expiresInMs;
725
725
  this.scheduleTokenRefresh(expiresInMs);
726
726
  }
727
+ /**
728
+ * Learn a bare token's expiry FROM THE TOKEN.
729
+ *
730
+ * `setTokens` is the only other writer of `expiresAt`, and it needs a whole
731
+ * `AuthenticateResponse`. Several paths hold nothing but a JWT string — a
732
+ * session restored from storage, `authenticate({type:'jwt'})`,
733
+ * `setIdentityTokens(token)` — and left `expiresAt` null. `isTokenExpired()`
734
+ * reads null as EXPIRED, so `isAuthenticated()` answered false for the whole
735
+ * life of every restored session, i.e. every page load after the first.
736
+ *
737
+ * It failed silently, and it had already been routed around three times
738
+ * rather than fixed: both HTTP send paths were made to stop consulting
739
+ * `isAuthenticated()` (see `request()` and `mcpStream()` in http-client),
740
+ * and Studio grew its own token parse to tell a 404 apart from a logged-out
741
+ * read. This is the missing writer those workarounds existed for.
742
+ *
743
+ * Same 60s safety margin as `setTokens`, so both writers agree on when a
744
+ * token stops counting as good.
745
+ *
746
+ * @param token - A JWT held in storage or handed to us
747
+ */
748
+ adoptToken(token) {
749
+ const exp = _AuthManager.parseToken(token)?.exp;
750
+ this.expiresAt = typeof exp === "number" ? exp * 1e3 - 6e4 : null;
751
+ }
727
752
  /**
728
753
  * Get current access token
729
754
  */
@@ -7169,6 +7194,7 @@ var RaisinHttpClient = class extends import_events3.EventEmitter {
7169
7194
  async authenticate(credentials, repository) {
7170
7195
  if (isJwtCredentials(credentials)) {
7171
7196
  this.authManager.storage.setAccessToken(credentials.token);
7197
+ this.authManager.adoptToken(credentials.token);
7172
7198
  if (repository) {
7173
7199
  try {
7174
7200
  const userInfo = await this.fetchCurrentUser(repository);
@@ -7575,6 +7601,7 @@ var RaisinHttpClient = class extends import_events3.EventEmitter {
7575
7601
  setIdentityTokens(accessTokenOrResult, refreshToken) {
7576
7602
  if (typeof accessTokenOrResult === "string") {
7577
7603
  this.authManager.storage.setAccessToken(accessTokenOrResult);
7604
+ this.authManager.adoptToken(accessTokenOrResult);
7578
7605
  if (refreshToken) this.authManager.storage.setRefreshToken(refreshToken);
7579
7606
  return;
7580
7607
  }
@@ -8695,6 +8722,7 @@ var _RaisinClient = class _RaisinClient extends import_events4.EventEmitter {
8695
8722
  async authenticate(credentials) {
8696
8723
  if (isJwtCredentials(credentials)) {
8697
8724
  logger.info("[authenticate] Starting JWT authentication...");
8725
+ this.authManager.adoptToken(credentials.token);
8698
8726
  const payload = { token: credentials.token };
8699
8727
  const response = await this.sendRequestInternal(
8700
8728
  payload,
@@ -9189,7 +9217,13 @@ var _RaisinClient = class _RaisinClient extends import_events4.EventEmitter {
9189
9217
  logger.debug(`[scheduleAutoRefresh] Scheduling refresh in ${Math.round(clamped / 1e3 / 60)} minutes`);
9190
9218
  this._refreshTimer = setTimeout(async () => {
9191
9219
  logger.info("[autoRefresh] Auto-refreshing token...");
9192
- await this.refreshToken();
9220
+ const user = await this.refreshToken();
9221
+ if (!user) {
9222
+ logger.error("[autoRefresh] Refresh failed, clearing session");
9223
+ this.authManager.clear();
9224
+ this._currentUser = null;
9225
+ this._emitAuthEvent("SESSION_EXPIRED");
9226
+ }
9193
9227
  }, clamped);
9194
9228
  }
9195
9229
  /**