@arbidocs/sdk 0.5.24 → 0.5.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { $ as ConfigStore, Y as CliConfig, Z as CliCredentials, V as ChatSession, c4 as SkippedFile, cS as UploadResult, p as AuthHeaders, cM as UploadBatchResult, cQ as UploadOptions, cN as UploadDirectOptions, cO as UploadDirectResult, bZ as SUPPORTED_EXTENSIONS, b7 as MailAttachment, N as ChatCryptoContext } from './browser-6pFZ1KEo.cjs';
2
- export { A as ACCOUNT_VENDOR, a as AccountSyncResult, b as ActivityKind, c as ActivityResponse, d as Arbi, e as ArbiApiError, f as ArbiError, g as ArbiHostSession, h as ArbiOptions, i as ArbiSessionExpiredError, j as ArbiWorkspaceChangedError, k as ArbiWorkspaceSupersededError, l as AskHandlers, m as AskRequest, n as AttendeeRead, o as AuthContext, q as AuthMode, r as AuthenticatedClient, B as BookingConfirmation, s as BookingPage, t as BookingPageWriteBody, u as BookingRequestBody, v as BridgeTokensOptions, C as CalDavConnectBody, w as CalDavProfile, x as CalendarAccount, y as CalendarAccountKind, z as CalendarCreateBody, D as CalendarEvent, E as CalendarKeys, F as CalendarRead, G as CalendarSettings, H as CalendarSettingsBody, I as CalendarUpdate, J as CalendarWindow, K as CallApiError, L as ChatAttachmentFile, M as ChatAttachmentInput, O as ChatKeyRing, P as ChatKind, Q as ChatMemberKey, R as ChatMemberResponse, S as ChatMessage, T as ChatMessageResponse, U as ChatResponse, W as CitationSummary, X as CitationToolSources, _ as CommandDescriptor, a0 as ConnectOptions, a1 as ConnectorCatalogEntry, a2 as ConnectorFolder, a3 as ConnectorSyncProgress, a4 as ConnectorSyncStatus, a5 as ConnectorVendorKey, a6 as ConnectorVisibilitySettings, a7 as ContextUsage, a8 as ConversationResponse, a9 as ConversationUsageResponse, ac as CreateWorkRequest, ad as CreateWorkflowRequest, ae as DEFAULT_AI_USD_PER_GBP, af as DOC_TERMINAL_STATUSES, ag as DRIVE_SYNC_VENDORS, ah as Database, ai as DatabaseColumn, aj as DatabaseColumnWrite, ak as DatabaseImportResult, al as DatabaseRow, am as DatabaseRowPage, an as DatabaseRowsQuery, ao as DateTimeSpec, ap as DecryptedChat, aq as DecryptedChatMessage, ar as DeploymentHouseTemplate, as as DocInfo, at as DocInfoMap, au as DocNameMap, av as DocumentAutomationAction, aw as DocumentListFields, ax as DocumentListOrder, ay as DocumentSelector, az as DocumentWaiter, aA as DocumentWaiterOptions, aB as DriveSyncProgress, aC as DriveSyncSummary, aD as DuplicateContactError, aE as ENTITY_KINDS, aF as EditScope, aG as EntityKind, aH as EventCreateBody, aI as EventPatchBody, aJ as FLAT_TAG_KINDS, aN as FindTimeParams, aO as FormattedWsMessage, aP as FreeBusyEntry, aQ as FullContextSelection, aR as GOOGLE_VENDORS, aS as HolidayCountry, aT as HouseTemplateCandidate, aU as IMANAGE_VENDORS, aV as IdentityErrorCode, aW as IdentityPurchase, aX as IdentityState, aY as IdentityStatus, aZ as ImportResult, a_ as InvitationRead, a$ as LinkedRun, b0 as ListAllOptions, b1 as ListEventsParams, b3 as ListPaginatedOptions, b4 as MAILBOX_SYNC_VENDORS, b5 as MAX_RETRIEVE_DOC_IDS, b6 as MICROSOFT_VENDORS, b8 as MessageLevel, b9 as OAuthAccountKind, ba as OutputItemDone, bb as OverlayItem, bc as OverlayLayerName, bd as PRESENCE_KINDS, be as PROMPT_CONTEXT_CHARS, bf as ParsedSlashCommand, bg as PendingAuthResponse, bh as PersonKey, bi as PlanStepsError, bj as PlanWorkRequest, bk as ProductResponse, bl as ProjectAddonKind, bm as ProjectAddonSettingsRequest, bn as ProjectBudget, bo as ProjectCheckoutRequest, bp as ProjectConversationUsageResponse, bq as ProjectCreateOptions, br as ProjectDetails, bs as ProjectEventKind, bt as ProjectEventResponse, bu as ProjectInvoicesResponse, bv as ProjectNextPeriodAddonsRequest, bw as ProjectPlanChangeRequest, bx as ProjectQuoteRequest, by as ProjectResponse, bz as ProjectUpdateRequest, bA as ProjectUsageResponse, bB as PublicBookingError, bC as PublicBookingPage, bD as QuotaExceeded, bE as RaisedSignal, bF as ReconnectOptions, bG as ReconnectableWsConnection, bH as ResolvedCitation, bI as ResolvedRecipient, bJ as RespondParams, bK as RespondPartstat, bL as RoomCreateBody, bM as RoomQuery, bN as RoomRead, bO as RunProgress, bP as RunStats, bQ as RunStep, bR as RunWaitingOn, bS as SHAREPOINT_VENDORS, bT as SSEEvent, bU as SSEStreamCallbacks, bV as SSEStreamResult, bW as STEP_FIELD_OPTION_TONES, bX as STOP_ID_WAIT_MS, bY as STOP_REPEAT_WINDOW_MS, b_ as ScopedTarget, b$ as SearchChunk, c0 as SendBack, c1 as ShareRead, c2 as ShareRole, c3 as SkillSummary, c5 as SlackConnectionStatus, c6 as StepActionRequest, c7 as StepActivityEvent, c8 as StepAssignee, c9 as StepDisplay, ca as StepField, cb as StepFieldOption, cc as StepFieldOptionTone, cd as StepKind, ce as StepPhase, cf as StepSignal, cg as StepSignalWhen, ch as StepState, ci as StepStatus, cj as SubagentBranchRecord, ck as SubagentLaneInfo, cl as SubmitBackgroundQueryOptions, cm as SubscribeParams, cn as SyncTriggerResult, co as TAG_KINDS, cp as TAG_NESTING_MAX_DEPTH, cq as TagChange, cr as TagFieldDefinition, cs as TagGroup, ct as TagKind, cu as TagKindField, cv as TagKindSchema, cw as TagLinks, cx as TagListQuery, cy as TagNode, cz as TagResponse, cA as TagScope, cB as TagTreeRow, cC as TaskPlan, cD as TaskPlanStep, cE as TaxQuoteResponse, cF as Thread, cG as ThreadsResponse, cH as TimeSuggestion, cI as TurnRequest, cJ as UpdateConversationRequest, cL as UpdateWorkflowRequest, cP as UploadDocumentsOptions, cR as UploadProgressListener, cT as UsageBreakdown, cU as UserConnectorEntry, cV as UserDailyUsageResponse, cW as UserInfo, cX as WebSocketAuthError, cY as WeeklyHoursSpec, cZ as WorkStatus, c_ as WorkflowAuthMode, c$ as WorkflowResponse, d0 as WorkflowRunHistoryResponse, d1 as WorkflowRunResponse, d2 as WorkspaceContext, d3 as WorkspaceOpenResponse, d4 as WsConnection, d5 as account, d6 as agentconfig, d7 as agents, d8 as appendTranscriptionHints, d9 as assistant, da as authenticatedFetch, db as bookPublicSlot, dc as buildCitationChunkData, dd as buildDocNameMap, de as buildDocumentTools, df as buildFactsContextTool, dg as buildRetrievalChunkTool, dh as buildRetrievalFullContextTool, di as buildRetrievalTocTool, dj as buildTurnRequest, dk as calendar, dl as calls, dm as canTagHaveParent, dn as cancelPublicBooking, dp as chats, dq as computeRunStats, dr as connectErrorMessage, ds as connectWebSocket, dt as connectWithReconnect, du as connectors, dv as contacts, dw as continuityPrompt, dx as conversations, dy as countCitations, dz as createAuthenticatedClient, dA as createDocumentWaiter, dB as createIndexAssigner, dC as databases, dD as defaultKindForFormat, dE as doctags, dF as documents, dG as estimateDraftTokens, dH as extractDocumentIdsFromMessages, dI as extractFactIdsFromMessages, dJ as extractSubagentLanes, dK as facts, dL as files, dM as filterDocumentTags, dN as filterSkills, dO as findLeafForTaskMessage, dP as findMainSiblingLeaf, dQ as findReplyTarget, dR as findSubagentRunId, dS as flattenTagTree, dT as formatAgentStepLabel, dU as formatFileSize, dV as formatGbp, dW as formatGbpPerMillionTokens, dX as formatItemLabel, dY as formatStreamSummary, dZ as formatTokens, d_ as formatUserName, d$ as formatWorkspaceChoices, e0 as formatWsMessage, e1 as generateEncryptedWorkspaceKey, e2 as generateNewWorkspaceKey, e3 as getAgentStepLabel, e4 as getAttachableRunId, e5 as getChildTags, e6 as getContextRemainingPercent, e7 as getContextUsedPercent, e8 as getContextUsedTokens, e9 as getCurrentStep, ea as getEligibleParentTags, eb as getErrorCode, ec as getErrorMessage, ed as getPublicBookingPage, ee as getRawWorkspaceKey, ef as getRunToAttach, eg as getRunToCancel, eh as getStepDisplay, ei as getStepTool, ej as getSubagentBranchRecord, ek as getTagDescendantIds, el as health, em as houseTemplates, en as hydrateAgentSteps, ep as identityErrorCode, eo as identityVerification, eq as isAnnotationTag, er as isConnectorVendorVisible, es as isDriveSyncVendor, et as isEntityTag, eu as isFlatKind, ev as isLabelTag, ew as isMailboxSyncVendor, ex as isNearAiUsageBudget, ey as isPresenceTag, ez as isSharePointVendor, eA as isSharedSkill, eB as isTraceItem, eC as mail, eD as mergeAgentSteps, eE as notifications, eF as parseSSEEvents, eG as parseSlashCommand, eH as parseSlashTokenInProgress, eI as performPasswordLogin, eJ as performSigningKeyLogin, eK as performSsoDeviceFlowLogin, eL as pickMainThread, eM as profile, eN as progressFetch, eO as projects, eP as quotaExceededFrom, eQ as quotaFromStreamError, eR as reduceOutputItem, eS as refusalReason, eT as requireData, eU as requireOk, eV as resolveAuth, eW as resolveCitations, eX as resolveSummary, eY as resolveWorkspace, eZ as responses, e_ as searchChunks, e$ as selectFullContextDocument, f0 as selectWorkspace, f1 as selectWorkspaceById, f2 as sessions, f3 as settings, f4 as signatureRequests, f5 as sliceToSubagentThread, f6 as streamSSE, f7 as stripCitationMarkdown, f8 as subagentJobLabel, f9 as summarizeCitations, fa as tagUseCount, fb as tags, fc as tagsForScope, fd as tagsOfGroup, fe as topLevelAgentSteps, ff as uploadSkill, fg as usdToGbp, fh as work, fi as workflowSteps, fj as workflows, fk as workspaces, fl as wouldCreateTagCycle } from './browser-6pFZ1KEo.cjs';
1
+ import { $ as ConfigStore, Y as CliConfig, Z as CliCredentials, V as ChatSession, c4 as SkippedFile, cS as UploadResult, p as AuthHeaders, cM as UploadBatchResult, cQ as UploadOptions, cN as UploadDirectOptions, cO as UploadDirectResult, bZ as SUPPORTED_EXTENSIONS, b7 as MailAttachment, N as ChatCryptoContext } from './browser-DJz2t6eb.cjs';
2
+ export { A as ACCOUNT_VENDOR, a as AccountSyncResult, b as ActivityKind, c as ActivityResponse, d as Arbi, e as ArbiApiError, f as ArbiError, g as ArbiHostSession, h as ArbiOptions, i as ArbiSessionExpiredError, j as ArbiWorkspaceChangedError, k as ArbiWorkspaceSupersededError, l as AskHandlers, m as AskRequest, n as AttendeeRead, o as AuthContext, q as AuthMode, r as AuthenticatedClient, B as BookingConfirmation, s as BookingPage, t as BookingPageWriteBody, u as BookingRequestBody, v as BridgeTokensOptions, C as CalDavConnectBody, w as CalDavProfile, x as CalendarAccount, y as CalendarAccountKind, z as CalendarCreateBody, D as CalendarEvent, E as CalendarKeys, F as CalendarRead, G as CalendarSettings, H as CalendarSettingsBody, I as CalendarUpdate, J as CalendarWindow, K as CallApiError, L as ChatAttachmentFile, M as ChatAttachmentInput, O as ChatKeyRing, P as ChatKind, Q as ChatMemberKey, R as ChatMemberResponse, S as ChatMessage, T as ChatMessageResponse, U as ChatResponse, W as CitationSummary, X as CitationToolSources, _ as CommandDescriptor, a0 as ConnectOptions, a1 as ConnectorCatalogEntry, a2 as ConnectorFolder, a3 as ConnectorSyncProgress, a4 as ConnectorSyncStatus, a5 as ConnectorVendorKey, a6 as ConnectorVisibilitySettings, a7 as ContextUsage, a8 as ConversationResponse, a9 as ConversationUsageResponse, ac as CreateWorkRequest, ad as CreateWorkflowRequest, ae as DEFAULT_AI_USD_PER_GBP, af as DOC_TERMINAL_STATUSES, ag as DRIVE_SYNC_VENDORS, ah as Database, ai as DatabaseColumn, aj as DatabaseColumnWrite, ak as DatabaseImportResult, al as DatabaseRow, am as DatabaseRowPage, an as DatabaseRowsQuery, ao as DateTimeSpec, ap as DecryptedChat, aq as DecryptedChatMessage, ar as DeploymentHouseTemplate, as as DocInfo, at as DocInfoMap, au as DocNameMap, av as DocumentAutomationAction, aw as DocumentListFields, ax as DocumentListOrder, ay as DocumentSelector, az as DocumentWaiter, aA as DocumentWaiterOptions, aB as DriveSyncProgress, aC as DriveSyncSummary, aD as DuplicateContactError, aE as ENTITY_KINDS, aF as EditScope, aG as EntityKind, aH as EventCreateBody, aI as EventPatchBody, aJ as FLAT_TAG_KINDS, aN as FindTimeParams, aO as FormattedWsMessage, aP as FreeBusyEntry, aQ as FullContextSelection, aR as GOOGLE_VENDORS, aS as HolidayCountry, aT as HouseTemplateCandidate, aU as IMANAGE_VENDORS, aV as IdentityErrorCode, aW as IdentityPurchase, aX as IdentityState, aY as IdentityStatus, aZ as ImportResult, a_ as InvitationRead, a$ as LinkedRun, b0 as ListAllOptions, b1 as ListEventsParams, b3 as ListPaginatedOptions, b4 as MAILBOX_SYNC_VENDORS, b5 as MAX_RETRIEVE_DOC_IDS, b6 as MICROSOFT_VENDORS, b8 as MessageLevel, b9 as OAuthAccountKind, ba as OutputItemDone, bb as OverlayItem, bc as OverlayLayerName, bd as PRESENCE_KINDS, be as PROMPT_CONTEXT_CHARS, bf as ParsedSlashCommand, bg as PendingAuthResponse, bh as PersonKey, bi as PlanStepsError, bj as PlanWorkRequest, bk as ProductResponse, bl as ProjectAddonKind, bm as ProjectAddonSettingsRequest, bn as ProjectBudget, bo as ProjectCheckoutRequest, bp as ProjectConversationUsageResponse, bq as ProjectCreateOptions, br as ProjectDetails, bs as ProjectEventKind, bt as ProjectEventResponse, bu as ProjectInvoicesResponse, bv as ProjectNextPeriodAddonsRequest, bw as ProjectPlanChangeRequest, bx as ProjectQuoteRequest, by as ProjectResponse, bz as ProjectUpdateRequest, bA as ProjectUsageResponse, bB as PublicBookingError, bC as PublicBookingPage, bD as QuotaExceeded, bE as RaisedSignal, bF as ReconnectOptions, bG as ReconnectableWsConnection, bH as ResolvedCitation, bI as ResolvedRecipient, bJ as RespondParams, bK as RespondPartstat, bL as RoomCreateBody, bM as RoomQuery, bN as RoomRead, bO as RunProgress, bP as RunStats, bQ as RunStep, bR as RunWaitingOn, bS as SHAREPOINT_VENDORS, bT as SSEEvent, bU as SSEStreamCallbacks, bV as SSEStreamResult, bW as STEP_FIELD_OPTION_TONES, bX as STOP_ID_WAIT_MS, bY as STOP_REPEAT_WINDOW_MS, b_ as ScopedTarget, b$ as SearchChunk, c0 as SendBack, c1 as ShareRead, c2 as ShareRole, c3 as SkillSummary, c5 as SlackConnectionStatus, c6 as StepActionRequest, c7 as StepActivityEvent, c8 as StepAssignee, c9 as StepDisplay, ca as StepField, cb as StepFieldOption, cc as StepFieldOptionTone, cd as StepKind, ce as StepPhase, cf as StepSignal, cg as StepSignalWhen, ch as StepState, ci as StepStatus, cj as SubagentBranchRecord, ck as SubagentLaneInfo, cl as SubmitBackgroundQueryOptions, cm as SubscribeParams, cn as SyncTriggerResult, co as TAG_KINDS, cp as TAG_NESTING_MAX_DEPTH, cq as TagChange, cr as TagFieldDefinition, cs as TagGroup, ct as TagKind, cu as TagKindField, cv as TagKindSchema, cw as TagLinks, cx as TagListQuery, cy as TagNode, cz as TagResponse, cA as TagScope, cB as TagTreeRow, cC as TaskPlan, cD as TaskPlanStep, cE as TaxQuoteResponse, cF as Thread, cG as ThreadsResponse, cH as TimeSuggestion, cI as TurnRequest, cJ as UpdateConversationRequest, cL as UpdateWorkflowRequest, cP as UploadDocumentsOptions, cR as UploadProgressListener, cT as UsageBreakdown, cU as UserConnectorEntry, cV as UserDailyUsageResponse, cW as UserInfo, cX as WebSocketAuthError, cY as WeeklyHoursSpec, cZ as WorkStatus, c_ as WorkflowAuthMode, c$ as WorkflowResponse, d0 as WorkflowRunHistoryResponse, d1 as WorkflowRunResponse, d2 as WorkspaceContext, d3 as WorkspaceOpenResponse, d4 as WsConnection, d5 as account, d6 as agentconfig, d7 as agents, d8 as appendTranscriptionHints, d9 as assistant, da as authenticatedFetch, db as bookPublicSlot, dc as buildCitationChunkData, dd as buildDocNameMap, de as buildDocumentTools, df as buildFactsContextTool, dg as buildRetrievalChunkTool, dh as buildRetrievalFullContextTool, di as buildRetrievalTocTool, dj as buildTurnRequest, dk as calendar, dl as calls, dm as canTagHaveParent, dn as cancelPublicBooking, dp as chats, dq as computeRunStats, dr as connectErrorMessage, ds as connectWebSocket, dt as connectWithReconnect, du as connectors, dv as contacts, dw as continuityPrompt, dx as conversations, dy as countCitations, dz as createAuthenticatedClient, dA as createDocumentWaiter, dB as createIndexAssigner, dC as databases, dD as defaultKindForFormat, dE as doctags, dF as documents, dG as estimateDraftTokens, dH as extractDocumentIdsFromMessages, dI as extractFactIdsFromMessages, dJ as extractSubagentLanes, dK as facts, dL as files, dM as filterDocumentTags, dN as filterSkills, dO as findLeafForTaskMessage, dP as findMainSiblingLeaf, dQ as findReplyTarget, dR as findSubagentRunId, dS as flattenTagTree, dT as formatAgentStepLabel, dU as formatFileSize, dV as formatGbp, dW as formatGbpPerMillionTokens, dX as formatItemLabel, dY as formatStreamSummary, dZ as formatTokens, d_ as formatUserName, d$ as formatWorkspaceChoices, e0 as formatWsMessage, e1 as generateEncryptedWorkspaceKey, e2 as generateNewWorkspaceKey, e3 as getAgentStepLabel, e4 as getAttachableRunId, e5 as getChildTags, e6 as getContextRemainingPercent, e7 as getContextUsedPercent, e8 as getContextUsedTokens, e9 as getCurrentStep, ea as getEligibleParentTags, eb as getErrorCode, ec as getErrorMessage, ed as getPublicBookingPage, ee as getRawWorkspaceKey, ef as getRunToAttach, eg as getRunToCancel, eh as getStepDisplay, ei as getStepTool, ej as getSubagentBranchRecord, ek as getTagDescendantIds, el as health, em as houseTemplates, en as hydrateAgentSteps, ep as identityErrorCode, eo as identityVerification, eq as isAnnotationTag, er as isConnectorVendorVisible, es as isDriveSyncVendor, et as isEntityTag, eu as isFlatKind, ev as isLabelTag, ew as isMailboxSyncVendor, ex as isNearAiUsageBudget, ey as isPresenceTag, ez as isSharePointVendor, eA as isSharedSkill, eB as isTraceItem, eC as mail, eD as mergeAgentSteps, eE as notifications, eF as parseSSEEvents, eG as parseSlashCommand, eH as parseSlashTokenInProgress, eI as performPasswordLogin, eJ as performSigningKeyLogin, eK as performSsoDeviceFlowLogin, eL as pickMainThread, eM as profile, eN as progressFetch, eO as projects, eP as quotaExceededFrom, eQ as quotaFromStreamError, eR as reduceOutputItem, eS as refusalReason, eT as requireData, eU as requireOk, eV as resolveAuth, eW as resolveCitations, eX as resolveSummary, eY as resolveWorkspace, eZ as responses, e_ as searchChunks, e$ as selectFullContextDocument, f0 as selectWorkspace, f1 as selectWorkspaceById, f2 as sessions, f3 as settings, f4 as signatureRequests, f5 as sliceToSubagentThread, f6 as streamSSE, f7 as stripCitationMarkdown, f8 as subagentJobLabel, f9 as summarizeCitations, fa as tagUseCount, fb as tags, fc as tagsForScope, fd as tagsOfGroup, fe as topLevelAgentSteps, ff as uploadSkill, fg as usdToGbp, fh as work, fi as workflowSteps, fj as workflows, fk as workspaces, fl as wouldCreateTagCycle } from './browser-DJz2t6eb.cjs';
3
3
  import { SessionPersistence, ArbiClient, components } from '@arbidocs/client';
4
4
  export { CallPeer, LoginProfile } from '@arbidocs/client';
5
5
  export { b as AgentStepEvent, d as ArtifactEvent, M as MailDraftSSEEvent, e as MessageMetadataPayload, f as MessageQueuedEvent, O as OutputTokensDetails, R as ResponseCompletedEvent, g as ResponseContentPartAddedEvent, h as ResponseCreatedEvent, i as ResponseFailedEvent, j as ResponseOutputItemAddedEvent, k as ResponseOutputItemDoneEvent, l as ResponseOutputTextDeltaEvent, m as ResponseOutputTextDoneEvent, n as ResponseUsage, S as SSEStreamStartData, T as TokenBudgetContext, U as UserInputRequestEvent, o as UserMessageEvent } from './sse-types-BbR7JG5o.cjs';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { $ as ConfigStore, Y as CliConfig, Z as CliCredentials, V as ChatSession, c4 as SkippedFile, cS as UploadResult, p as AuthHeaders, cM as UploadBatchResult, cQ as UploadOptions, cN as UploadDirectOptions, cO as UploadDirectResult, bZ as SUPPORTED_EXTENSIONS, b7 as MailAttachment, N as ChatCryptoContext } from './browser-BTAy2lP0.js';
2
- export { A as ACCOUNT_VENDOR, a as AccountSyncResult, b as ActivityKind, c as ActivityResponse, d as Arbi, e as ArbiApiError, f as ArbiError, g as ArbiHostSession, h as ArbiOptions, i as ArbiSessionExpiredError, j as ArbiWorkspaceChangedError, k as ArbiWorkspaceSupersededError, l as AskHandlers, m as AskRequest, n as AttendeeRead, o as AuthContext, q as AuthMode, r as AuthenticatedClient, B as BookingConfirmation, s as BookingPage, t as BookingPageWriteBody, u as BookingRequestBody, v as BridgeTokensOptions, C as CalDavConnectBody, w as CalDavProfile, x as CalendarAccount, y as CalendarAccountKind, z as CalendarCreateBody, D as CalendarEvent, E as CalendarKeys, F as CalendarRead, G as CalendarSettings, H as CalendarSettingsBody, I as CalendarUpdate, J as CalendarWindow, K as CallApiError, L as ChatAttachmentFile, M as ChatAttachmentInput, O as ChatKeyRing, P as ChatKind, Q as ChatMemberKey, R as ChatMemberResponse, S as ChatMessage, T as ChatMessageResponse, U as ChatResponse, W as CitationSummary, X as CitationToolSources, _ as CommandDescriptor, a0 as ConnectOptions, a1 as ConnectorCatalogEntry, a2 as ConnectorFolder, a3 as ConnectorSyncProgress, a4 as ConnectorSyncStatus, a5 as ConnectorVendorKey, a6 as ConnectorVisibilitySettings, a7 as ContextUsage, a8 as ConversationResponse, a9 as ConversationUsageResponse, ac as CreateWorkRequest, ad as CreateWorkflowRequest, ae as DEFAULT_AI_USD_PER_GBP, af as DOC_TERMINAL_STATUSES, ag as DRIVE_SYNC_VENDORS, ah as Database, ai as DatabaseColumn, aj as DatabaseColumnWrite, ak as DatabaseImportResult, al as DatabaseRow, am as DatabaseRowPage, an as DatabaseRowsQuery, ao as DateTimeSpec, ap as DecryptedChat, aq as DecryptedChatMessage, ar as DeploymentHouseTemplate, as as DocInfo, at as DocInfoMap, au as DocNameMap, av as DocumentAutomationAction, aw as DocumentListFields, ax as DocumentListOrder, ay as DocumentSelector, az as DocumentWaiter, aA as DocumentWaiterOptions, aB as DriveSyncProgress, aC as DriveSyncSummary, aD as DuplicateContactError, aE as ENTITY_KINDS, aF as EditScope, aG as EntityKind, aH as EventCreateBody, aI as EventPatchBody, aJ as FLAT_TAG_KINDS, aN as FindTimeParams, aO as FormattedWsMessage, aP as FreeBusyEntry, aQ as FullContextSelection, aR as GOOGLE_VENDORS, aS as HolidayCountry, aT as HouseTemplateCandidate, aU as IMANAGE_VENDORS, aV as IdentityErrorCode, aW as IdentityPurchase, aX as IdentityState, aY as IdentityStatus, aZ as ImportResult, a_ as InvitationRead, a$ as LinkedRun, b0 as ListAllOptions, b1 as ListEventsParams, b3 as ListPaginatedOptions, b4 as MAILBOX_SYNC_VENDORS, b5 as MAX_RETRIEVE_DOC_IDS, b6 as MICROSOFT_VENDORS, b8 as MessageLevel, b9 as OAuthAccountKind, ba as OutputItemDone, bb as OverlayItem, bc as OverlayLayerName, bd as PRESENCE_KINDS, be as PROMPT_CONTEXT_CHARS, bf as ParsedSlashCommand, bg as PendingAuthResponse, bh as PersonKey, bi as PlanStepsError, bj as PlanWorkRequest, bk as ProductResponse, bl as ProjectAddonKind, bm as ProjectAddonSettingsRequest, bn as ProjectBudget, bo as ProjectCheckoutRequest, bp as ProjectConversationUsageResponse, bq as ProjectCreateOptions, br as ProjectDetails, bs as ProjectEventKind, bt as ProjectEventResponse, bu as ProjectInvoicesResponse, bv as ProjectNextPeriodAddonsRequest, bw as ProjectPlanChangeRequest, bx as ProjectQuoteRequest, by as ProjectResponse, bz as ProjectUpdateRequest, bA as ProjectUsageResponse, bB as PublicBookingError, bC as PublicBookingPage, bD as QuotaExceeded, bE as RaisedSignal, bF as ReconnectOptions, bG as ReconnectableWsConnection, bH as ResolvedCitation, bI as ResolvedRecipient, bJ as RespondParams, bK as RespondPartstat, bL as RoomCreateBody, bM as RoomQuery, bN as RoomRead, bO as RunProgress, bP as RunStats, bQ as RunStep, bR as RunWaitingOn, bS as SHAREPOINT_VENDORS, bT as SSEEvent, bU as SSEStreamCallbacks, bV as SSEStreamResult, bW as STEP_FIELD_OPTION_TONES, bX as STOP_ID_WAIT_MS, bY as STOP_REPEAT_WINDOW_MS, b_ as ScopedTarget, b$ as SearchChunk, c0 as SendBack, c1 as ShareRead, c2 as ShareRole, c3 as SkillSummary, c5 as SlackConnectionStatus, c6 as StepActionRequest, c7 as StepActivityEvent, c8 as StepAssignee, c9 as StepDisplay, ca as StepField, cb as StepFieldOption, cc as StepFieldOptionTone, cd as StepKind, ce as StepPhase, cf as StepSignal, cg as StepSignalWhen, ch as StepState, ci as StepStatus, cj as SubagentBranchRecord, ck as SubagentLaneInfo, cl as SubmitBackgroundQueryOptions, cm as SubscribeParams, cn as SyncTriggerResult, co as TAG_KINDS, cp as TAG_NESTING_MAX_DEPTH, cq as TagChange, cr as TagFieldDefinition, cs as TagGroup, ct as TagKind, cu as TagKindField, cv as TagKindSchema, cw as TagLinks, cx as TagListQuery, cy as TagNode, cz as TagResponse, cA as TagScope, cB as TagTreeRow, cC as TaskPlan, cD as TaskPlanStep, cE as TaxQuoteResponse, cF as Thread, cG as ThreadsResponse, cH as TimeSuggestion, cI as TurnRequest, cJ as UpdateConversationRequest, cL as UpdateWorkflowRequest, cP as UploadDocumentsOptions, cR as UploadProgressListener, cT as UsageBreakdown, cU as UserConnectorEntry, cV as UserDailyUsageResponse, cW as UserInfo, cX as WebSocketAuthError, cY as WeeklyHoursSpec, cZ as WorkStatus, c_ as WorkflowAuthMode, c$ as WorkflowResponse, d0 as WorkflowRunHistoryResponse, d1 as WorkflowRunResponse, d2 as WorkspaceContext, d3 as WorkspaceOpenResponse, d4 as WsConnection, d5 as account, d6 as agentconfig, d7 as agents, d8 as appendTranscriptionHints, d9 as assistant, da as authenticatedFetch, db as bookPublicSlot, dc as buildCitationChunkData, dd as buildDocNameMap, de as buildDocumentTools, df as buildFactsContextTool, dg as buildRetrievalChunkTool, dh as buildRetrievalFullContextTool, di as buildRetrievalTocTool, dj as buildTurnRequest, dk as calendar, dl as calls, dm as canTagHaveParent, dn as cancelPublicBooking, dp as chats, dq as computeRunStats, dr as connectErrorMessage, ds as connectWebSocket, dt as connectWithReconnect, du as connectors, dv as contacts, dw as continuityPrompt, dx as conversations, dy as countCitations, dz as createAuthenticatedClient, dA as createDocumentWaiter, dB as createIndexAssigner, dC as databases, dD as defaultKindForFormat, dE as doctags, dF as documents, dG as estimateDraftTokens, dH as extractDocumentIdsFromMessages, dI as extractFactIdsFromMessages, dJ as extractSubagentLanes, dK as facts, dL as files, dM as filterDocumentTags, dN as filterSkills, dO as findLeafForTaskMessage, dP as findMainSiblingLeaf, dQ as findReplyTarget, dR as findSubagentRunId, dS as flattenTagTree, dT as formatAgentStepLabel, dU as formatFileSize, dV as formatGbp, dW as formatGbpPerMillionTokens, dX as formatItemLabel, dY as formatStreamSummary, dZ as formatTokens, d_ as formatUserName, d$ as formatWorkspaceChoices, e0 as formatWsMessage, e1 as generateEncryptedWorkspaceKey, e2 as generateNewWorkspaceKey, e3 as getAgentStepLabel, e4 as getAttachableRunId, e5 as getChildTags, e6 as getContextRemainingPercent, e7 as getContextUsedPercent, e8 as getContextUsedTokens, e9 as getCurrentStep, ea as getEligibleParentTags, eb as getErrorCode, ec as getErrorMessage, ed as getPublicBookingPage, ee as getRawWorkspaceKey, ef as getRunToAttach, eg as getRunToCancel, eh as getStepDisplay, ei as getStepTool, ej as getSubagentBranchRecord, ek as getTagDescendantIds, el as health, em as houseTemplates, en as hydrateAgentSteps, ep as identityErrorCode, eo as identityVerification, eq as isAnnotationTag, er as isConnectorVendorVisible, es as isDriveSyncVendor, et as isEntityTag, eu as isFlatKind, ev as isLabelTag, ew as isMailboxSyncVendor, ex as isNearAiUsageBudget, ey as isPresenceTag, ez as isSharePointVendor, eA as isSharedSkill, eB as isTraceItem, eC as mail, eD as mergeAgentSteps, eE as notifications, eF as parseSSEEvents, eG as parseSlashCommand, eH as parseSlashTokenInProgress, eI as performPasswordLogin, eJ as performSigningKeyLogin, eK as performSsoDeviceFlowLogin, eL as pickMainThread, eM as profile, eN as progressFetch, eO as projects, eP as quotaExceededFrom, eQ as quotaFromStreamError, eR as reduceOutputItem, eS as refusalReason, eT as requireData, eU as requireOk, eV as resolveAuth, eW as resolveCitations, eX as resolveSummary, eY as resolveWorkspace, eZ as responses, e_ as searchChunks, e$ as selectFullContextDocument, f0 as selectWorkspace, f1 as selectWorkspaceById, f2 as sessions, f3 as settings, f4 as signatureRequests, f5 as sliceToSubagentThread, f6 as streamSSE, f7 as stripCitationMarkdown, f8 as subagentJobLabel, f9 as summarizeCitations, fa as tagUseCount, fb as tags, fc as tagsForScope, fd as tagsOfGroup, fe as topLevelAgentSteps, ff as uploadSkill, fg as usdToGbp, fh as work, fi as workflowSteps, fj as workflows, fk as workspaces, fl as wouldCreateTagCycle } from './browser-BTAy2lP0.js';
1
+ import { $ as ConfigStore, Y as CliConfig, Z as CliCredentials, V as ChatSession, c4 as SkippedFile, cS as UploadResult, p as AuthHeaders, cM as UploadBatchResult, cQ as UploadOptions, cN as UploadDirectOptions, cO as UploadDirectResult, bZ as SUPPORTED_EXTENSIONS, b7 as MailAttachment, N as ChatCryptoContext } from './browser-DXMOExjT.js';
2
+ export { A as ACCOUNT_VENDOR, a as AccountSyncResult, b as ActivityKind, c as ActivityResponse, d as Arbi, e as ArbiApiError, f as ArbiError, g as ArbiHostSession, h as ArbiOptions, i as ArbiSessionExpiredError, j as ArbiWorkspaceChangedError, k as ArbiWorkspaceSupersededError, l as AskHandlers, m as AskRequest, n as AttendeeRead, o as AuthContext, q as AuthMode, r as AuthenticatedClient, B as BookingConfirmation, s as BookingPage, t as BookingPageWriteBody, u as BookingRequestBody, v as BridgeTokensOptions, C as CalDavConnectBody, w as CalDavProfile, x as CalendarAccount, y as CalendarAccountKind, z as CalendarCreateBody, D as CalendarEvent, E as CalendarKeys, F as CalendarRead, G as CalendarSettings, H as CalendarSettingsBody, I as CalendarUpdate, J as CalendarWindow, K as CallApiError, L as ChatAttachmentFile, M as ChatAttachmentInput, O as ChatKeyRing, P as ChatKind, Q as ChatMemberKey, R as ChatMemberResponse, S as ChatMessage, T as ChatMessageResponse, U as ChatResponse, W as CitationSummary, X as CitationToolSources, _ as CommandDescriptor, a0 as ConnectOptions, a1 as ConnectorCatalogEntry, a2 as ConnectorFolder, a3 as ConnectorSyncProgress, a4 as ConnectorSyncStatus, a5 as ConnectorVendorKey, a6 as ConnectorVisibilitySettings, a7 as ContextUsage, a8 as ConversationResponse, a9 as ConversationUsageResponse, ac as CreateWorkRequest, ad as CreateWorkflowRequest, ae as DEFAULT_AI_USD_PER_GBP, af as DOC_TERMINAL_STATUSES, ag as DRIVE_SYNC_VENDORS, ah as Database, ai as DatabaseColumn, aj as DatabaseColumnWrite, ak as DatabaseImportResult, al as DatabaseRow, am as DatabaseRowPage, an as DatabaseRowsQuery, ao as DateTimeSpec, ap as DecryptedChat, aq as DecryptedChatMessage, ar as DeploymentHouseTemplate, as as DocInfo, at as DocInfoMap, au as DocNameMap, av as DocumentAutomationAction, aw as DocumentListFields, ax as DocumentListOrder, ay as DocumentSelector, az as DocumentWaiter, aA as DocumentWaiterOptions, aB as DriveSyncProgress, aC as DriveSyncSummary, aD as DuplicateContactError, aE as ENTITY_KINDS, aF as EditScope, aG as EntityKind, aH as EventCreateBody, aI as EventPatchBody, aJ as FLAT_TAG_KINDS, aN as FindTimeParams, aO as FormattedWsMessage, aP as FreeBusyEntry, aQ as FullContextSelection, aR as GOOGLE_VENDORS, aS as HolidayCountry, aT as HouseTemplateCandidate, aU as IMANAGE_VENDORS, aV as IdentityErrorCode, aW as IdentityPurchase, aX as IdentityState, aY as IdentityStatus, aZ as ImportResult, a_ as InvitationRead, a$ as LinkedRun, b0 as ListAllOptions, b1 as ListEventsParams, b3 as ListPaginatedOptions, b4 as MAILBOX_SYNC_VENDORS, b5 as MAX_RETRIEVE_DOC_IDS, b6 as MICROSOFT_VENDORS, b8 as MessageLevel, b9 as OAuthAccountKind, ba as OutputItemDone, bb as OverlayItem, bc as OverlayLayerName, bd as PRESENCE_KINDS, be as PROMPT_CONTEXT_CHARS, bf as ParsedSlashCommand, bg as PendingAuthResponse, bh as PersonKey, bi as PlanStepsError, bj as PlanWorkRequest, bk as ProductResponse, bl as ProjectAddonKind, bm as ProjectAddonSettingsRequest, bn as ProjectBudget, bo as ProjectCheckoutRequest, bp as ProjectConversationUsageResponse, bq as ProjectCreateOptions, br as ProjectDetails, bs as ProjectEventKind, bt as ProjectEventResponse, bu as ProjectInvoicesResponse, bv as ProjectNextPeriodAddonsRequest, bw as ProjectPlanChangeRequest, bx as ProjectQuoteRequest, by as ProjectResponse, bz as ProjectUpdateRequest, bA as ProjectUsageResponse, bB as PublicBookingError, bC as PublicBookingPage, bD as QuotaExceeded, bE as RaisedSignal, bF as ReconnectOptions, bG as ReconnectableWsConnection, bH as ResolvedCitation, bI as ResolvedRecipient, bJ as RespondParams, bK as RespondPartstat, bL as RoomCreateBody, bM as RoomQuery, bN as RoomRead, bO as RunProgress, bP as RunStats, bQ as RunStep, bR as RunWaitingOn, bS as SHAREPOINT_VENDORS, bT as SSEEvent, bU as SSEStreamCallbacks, bV as SSEStreamResult, bW as STEP_FIELD_OPTION_TONES, bX as STOP_ID_WAIT_MS, bY as STOP_REPEAT_WINDOW_MS, b_ as ScopedTarget, b$ as SearchChunk, c0 as SendBack, c1 as ShareRead, c2 as ShareRole, c3 as SkillSummary, c5 as SlackConnectionStatus, c6 as StepActionRequest, c7 as StepActivityEvent, c8 as StepAssignee, c9 as StepDisplay, ca as StepField, cb as StepFieldOption, cc as StepFieldOptionTone, cd as StepKind, ce as StepPhase, cf as StepSignal, cg as StepSignalWhen, ch as StepState, ci as StepStatus, cj as SubagentBranchRecord, ck as SubagentLaneInfo, cl as SubmitBackgroundQueryOptions, cm as SubscribeParams, cn as SyncTriggerResult, co as TAG_KINDS, cp as TAG_NESTING_MAX_DEPTH, cq as TagChange, cr as TagFieldDefinition, cs as TagGroup, ct as TagKind, cu as TagKindField, cv as TagKindSchema, cw as TagLinks, cx as TagListQuery, cy as TagNode, cz as TagResponse, cA as TagScope, cB as TagTreeRow, cC as TaskPlan, cD as TaskPlanStep, cE as TaxQuoteResponse, cF as Thread, cG as ThreadsResponse, cH as TimeSuggestion, cI as TurnRequest, cJ as UpdateConversationRequest, cL as UpdateWorkflowRequest, cP as UploadDocumentsOptions, cR as UploadProgressListener, cT as UsageBreakdown, cU as UserConnectorEntry, cV as UserDailyUsageResponse, cW as UserInfo, cX as WebSocketAuthError, cY as WeeklyHoursSpec, cZ as WorkStatus, c_ as WorkflowAuthMode, c$ as WorkflowResponse, d0 as WorkflowRunHistoryResponse, d1 as WorkflowRunResponse, d2 as WorkspaceContext, d3 as WorkspaceOpenResponse, d4 as WsConnection, d5 as account, d6 as agentconfig, d7 as agents, d8 as appendTranscriptionHints, d9 as assistant, da as authenticatedFetch, db as bookPublicSlot, dc as buildCitationChunkData, dd as buildDocNameMap, de as buildDocumentTools, df as buildFactsContextTool, dg as buildRetrievalChunkTool, dh as buildRetrievalFullContextTool, di as buildRetrievalTocTool, dj as buildTurnRequest, dk as calendar, dl as calls, dm as canTagHaveParent, dn as cancelPublicBooking, dp as chats, dq as computeRunStats, dr as connectErrorMessage, ds as connectWebSocket, dt as connectWithReconnect, du as connectors, dv as contacts, dw as continuityPrompt, dx as conversations, dy as countCitations, dz as createAuthenticatedClient, dA as createDocumentWaiter, dB as createIndexAssigner, dC as databases, dD as defaultKindForFormat, dE as doctags, dF as documents, dG as estimateDraftTokens, dH as extractDocumentIdsFromMessages, dI as extractFactIdsFromMessages, dJ as extractSubagentLanes, dK as facts, dL as files, dM as filterDocumentTags, dN as filterSkills, dO as findLeafForTaskMessage, dP as findMainSiblingLeaf, dQ as findReplyTarget, dR as findSubagentRunId, dS as flattenTagTree, dT as formatAgentStepLabel, dU as formatFileSize, dV as formatGbp, dW as formatGbpPerMillionTokens, dX as formatItemLabel, dY as formatStreamSummary, dZ as formatTokens, d_ as formatUserName, d$ as formatWorkspaceChoices, e0 as formatWsMessage, e1 as generateEncryptedWorkspaceKey, e2 as generateNewWorkspaceKey, e3 as getAgentStepLabel, e4 as getAttachableRunId, e5 as getChildTags, e6 as getContextRemainingPercent, e7 as getContextUsedPercent, e8 as getContextUsedTokens, e9 as getCurrentStep, ea as getEligibleParentTags, eb as getErrorCode, ec as getErrorMessage, ed as getPublicBookingPage, ee as getRawWorkspaceKey, ef as getRunToAttach, eg as getRunToCancel, eh as getStepDisplay, ei as getStepTool, ej as getSubagentBranchRecord, ek as getTagDescendantIds, el as health, em as houseTemplates, en as hydrateAgentSteps, ep as identityErrorCode, eo as identityVerification, eq as isAnnotationTag, er as isConnectorVendorVisible, es as isDriveSyncVendor, et as isEntityTag, eu as isFlatKind, ev as isLabelTag, ew as isMailboxSyncVendor, ex as isNearAiUsageBudget, ey as isPresenceTag, ez as isSharePointVendor, eA as isSharedSkill, eB as isTraceItem, eC as mail, eD as mergeAgentSteps, eE as notifications, eF as parseSSEEvents, eG as parseSlashCommand, eH as parseSlashTokenInProgress, eI as performPasswordLogin, eJ as performSigningKeyLogin, eK as performSsoDeviceFlowLogin, eL as pickMainThread, eM as profile, eN as progressFetch, eO as projects, eP as quotaExceededFrom, eQ as quotaFromStreamError, eR as reduceOutputItem, eS as refusalReason, eT as requireData, eU as requireOk, eV as resolveAuth, eW as resolveCitations, eX as resolveSummary, eY as resolveWorkspace, eZ as responses, e_ as searchChunks, e$ as selectFullContextDocument, f0 as selectWorkspace, f1 as selectWorkspaceById, f2 as sessions, f3 as settings, f4 as signatureRequests, f5 as sliceToSubagentThread, f6 as streamSSE, f7 as stripCitationMarkdown, f8 as subagentJobLabel, f9 as summarizeCitations, fa as tagUseCount, fb as tags, fc as tagsForScope, fd as tagsOfGroup, fe as topLevelAgentSteps, ff as uploadSkill, fg as usdToGbp, fh as work, fi as workflowSteps, fj as workflows, fk as workspaces, fl as wouldCreateTagCycle } from './browser-DXMOExjT.js';
3
3
  import { SessionPersistence, ArbiClient, components } from '@arbidocs/client';
4
4
  export { CallPeer, LoginProfile } from '@arbidocs/client';
5
5
  export { b as AgentStepEvent, d as ArtifactEvent, M as MailDraftSSEEvent, e as MessageMetadataPayload, f as MessageQueuedEvent, O as OutputTokensDetails, R as ResponseCompletedEvent, g as ResponseContentPartAddedEvent, h as ResponseCreatedEvent, i as ResponseFailedEvent, j as ResponseOutputItemAddedEvent, k as ResponseOutputItemDoneEvent, l as ResponseOutputTextDeltaEvent, m as ResponseOutputTextDoneEvent, n as ResponseUsage, S as SSEStreamStartData, T as TokenBudgetContext, U as UserInputRequestEvent, o as UserMessageEvent } from './sse-types-BbR7JG5o.js';
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import fs2, { readFileSync } from 'fs';
2
2
  import path3, { dirname, resolve } from 'path';
3
3
  import os2 from 'os';
4
- import { createArbiClient, base64ToBytes, unwrapWorkspaceKey, sealKeyForSession, buildWebSocketUrl, createAuthMessage, parseServerMessage, isMessageType, createContentHash, encryptFile, initSodium, encryptionKeypairFromSigningKey, sealedBoxDecrypt, bytesToBase64, encryptWithChatKey, decryptWithChatKey, decryptFile, deriveDirectChatKey, openSealedChatKey, generateChatKey, sealChatKey, sealCallKey, encryptMessage, decodeSecureMailKey, openSecureMail, secureMailClaim, createSessionManager, authRequestError, changePassword, openCallKeyOf, decryptCallTitle, generateCallKey, encryptCallTitle, sealCallKeyForPeers, openSealedCallKey, readSessionClaims } from '@arbidocs/client';
4
+ import { createArbiClient, base64ToBytes, unwrapWorkspaceKey, sealKeyForSession, buildWebSocketUrl, createAuthMessage, parseServerMessage, isMessageType, createContentHash, encryptFile, initSodium, encryptionKeypairFromSigningKey, sealedBoxDecrypt, bytesToBase64, encryptWithChatKey, decryptWithChatKey, decryptFile, deriveDirectChatKey, openSealedChatKey, generateChatKey, sealChatKey, sealCallKey, encryptMessage, decodeSecureMailKey, openSecureMail, secureMailClaim, createSessionManager, authRequestError, changePassword, openCallKeyOf, decryptCallTitle, generateCallKey, encryptCallTitle, sealCallKeyForPeers, openSealedCallKey, readSessionClaims, isAbortError } from '@arbidocs/client';
5
5
  import { execSync, spawn } from 'child_process';
6
6
  import { createHash } from 'crypto';
7
7
  import { fileURLToPath } from 'url';
@@ -4638,9 +4638,11 @@ var WebSocketAuthError = class extends Error {
4638
4638
  this.name = "WebSocketAuthError";
4639
4639
  }
4640
4640
  };
4641
+ var wsAborted = () => new DOMException("The connection was aborted.", "AbortError");
4641
4642
  function connectWebSocket(options) {
4642
- const { baseUrl, accessToken, onMessage, onClose, onAuthenticated } = options;
4643
+ const { baseUrl, accessToken, onMessage, onClose, onAuthenticated, signal } = options;
4643
4644
  const url = buildWebSocketUrl(baseUrl);
4645
+ if (signal?.aborted) return Promise.reject(wsAborted());
4644
4646
  return new Promise((resolve2, reject) => {
4645
4647
  const ws = new WebSocket(url);
4646
4648
  let authenticated = false;
@@ -4650,6 +4652,15 @@ function connectWebSocket(options) {
4650
4652
  reject(new Error("WebSocket auth timed out"));
4651
4653
  }
4652
4654
  }, AUTH_TIMEOUT_MS);
4655
+ signal?.addEventListener(
4656
+ "abort",
4657
+ () => {
4658
+ clearTimeout(timeout);
4659
+ ws.close();
4660
+ reject(wsAborted());
4661
+ },
4662
+ { once: true }
4663
+ );
4653
4664
  ws.addEventListener("open", () => {
4654
4665
  ws.send(createAuthMessage(accessToken));
4655
4666
  });
@@ -4699,7 +4710,8 @@ async function connectWithReconnect(options) {
4699
4710
  onAuthenticated,
4700
4711
  shouldReconnect,
4701
4712
  baseUrl,
4702
- accessToken
4713
+ accessToken,
4714
+ signal
4703
4715
  } = options;
4704
4716
  const resolveToken = getAccessToken ?? (() => accessToken);
4705
4717
  let closed = false;
@@ -4711,6 +4723,7 @@ async function connectWithReconnect(options) {
4711
4723
  return connectWebSocket({
4712
4724
  baseUrl,
4713
4725
  accessToken: token,
4726
+ signal,
4714
4727
  onMessage,
4715
4728
  onAuthenticated,
4716
4729
  onClose: (code, reason) => {
@@ -4747,22 +4760,28 @@ async function connectWithReconnect(options) {
4747
4760
  }
4748
4761
  if (!closed) onReconnectFailed?.();
4749
4762
  };
4763
+ const close = () => {
4764
+ closed = true;
4765
+ cancelDelay?.();
4766
+ currentConnection?.close();
4767
+ currentConnection = null;
4768
+ };
4769
+ if (signal?.aborted) throw wsAborted();
4770
+ signal?.addEventListener("abort", close, { once: true });
4750
4771
  try {
4751
4772
  currentConnection = await connectOnce();
4752
4773
  } catch (err) {
4774
+ if (closed) throw wsAborted();
4753
4775
  if (!(err instanceof WebSocketAuthError) || !refreshAuth) throw err;
4754
4776
  await refreshAuth().catch(() => {
4755
4777
  });
4756
4778
  currentConnection = await connectOnce();
4757
4779
  }
4758
- return {
4759
- close: () => {
4760
- closed = true;
4761
- cancelDelay?.();
4762
- currentConnection?.close();
4763
- currentConnection = null;
4764
- }
4765
- };
4780
+ if (closed) {
4781
+ close();
4782
+ throw wsAborted();
4783
+ }
4784
+ return { close };
4766
4785
  }
4767
4786
  var DOC_TERMINAL_STATUSES = /* @__PURE__ */ new Set([
4768
4787
  "completed",
@@ -10622,6 +10641,10 @@ var WorkspaceOpenIntent = class {
10622
10641
  workspaceId;
10623
10642
  result = null;
10624
10643
  };
10644
+ function keyLookupFailed(error) {
10645
+ if (isAbortError(error)) throw error;
10646
+ throw new ArbiError(error instanceof Error ? error.message : String(error));
10647
+ }
10625
10648
  var Arbi = class {
10626
10649
  client = null;
10627
10650
  loginResult = null;
@@ -10634,6 +10657,7 @@ var Arbi = class {
10634
10657
  /** The chat keys I hold, opened once per set of epochs (`chatRingSignature`). */
10635
10658
  chatRings = /* @__PURE__ */ new Map();
10636
10659
  sessionExpiredListeners = /* @__PURE__ */ new Set();
10660
+ signingOutListeners = /* @__PURE__ */ new Set();
10637
10661
  signedInListeners = /* @__PURE__ */ new Set();
10638
10662
  /** The client is this instance's own (`init`), not a host's (`options.session`). */
10639
10663
  ownsClient = false;
@@ -10673,6 +10697,9 @@ var Arbi = class {
10673
10697
  });
10674
10698
  this.ownsClient = true;
10675
10699
  this.client.auth.onSessionExpired(() => this.expireSession());
10700
+ this.client.auth.onSigningOut(() => {
10701
+ for (const listener of [...this.signingOutListeners]) listener();
10702
+ });
10676
10703
  await this.client.crypto.initSodium();
10677
10704
  return this.client;
10678
10705
  }
@@ -10814,9 +10841,7 @@ var Arbi = class {
10814
10841
  if (!key) throw new ArbiError(`Workspace ${workspaceId} not found or has no encryption key`);
10815
10842
  return key;
10816
10843
  };
10817
- const { wrappedKey, fromCache } = await keys.wrappedKey(workspaceId).catch((error) => {
10818
- throw new ArbiError(error instanceof Error ? error.message : String(error));
10819
- });
10844
+ const { wrappedKey, fromCache } = await keys.wrappedKey(workspaceId).catch(keyLookupFailed);
10820
10845
  try {
10821
10846
  return await withKey(required(wrappedKey));
10822
10847
  } catch (error) {
@@ -10906,9 +10931,7 @@ var Arbi = class {
10906
10931
  }),
10907
10932
  `Failed to open workspace ${workspaceId}`
10908
10933
  );
10909
- const listed = await client.workspaceKeys.wrappedKey(workspaceId).catch((error) => {
10910
- throw new ArbiError(error instanceof Error ? error.message : String(error));
10911
- });
10934
+ const listed = await client.workspaceKeys.wrappedKey(workspaceId).catch(keyLookupFailed);
10912
10935
  if (!listed.wrappedKey) return open("");
10913
10936
  return this.withWrappedKey(
10914
10937
  workspaceId,
@@ -10956,6 +10979,18 @@ var Arbi = class {
10956
10979
  this.sessionExpiredListeners.add(listener);
10957
10980
  return () => this.sessionExpiredListeners.delete(listener);
10958
10981
  }
10982
+ /**
10983
+ * Subscribe to "the session is ending": `logout` has begun. Called once nothing new can start on
10984
+ * the session (no request, no re-login, no workspace open) and before what is in flight is
10985
+ * aborted and the server revokes the token: stop the host's own work on it there (cancel its
10986
+ * queries, close its socket). Returns an unsubscribe. On a host's session it is the host
10987
+ * client's.
10988
+ */
10989
+ onSigningOut(listener) {
10990
+ if (this.client && !this.ownsClient) return this.client.auth.onSigningOut(listener);
10991
+ this.signingOutListeners.add(listener);
10992
+ return () => this.signingOutListeners.delete(listener);
10993
+ }
10959
10994
  expireSession() {
10960
10995
  if (this.loginResult) {
10961
10996
  this.loginResult.signingPrivateKey.fill(0);
@@ -10987,6 +11022,7 @@ var Arbi = class {
10987
11022
  const unauthorised = /\b401\b|token has expired/i.test(message);
10988
11023
  if (!(error instanceof ArbiApiError) || !(noWorkspace || unauthorised)) throw error;
10989
11024
  const client = this.requireClient();
11025
+ if (client.auth.isSigningOut()) throw error;
10990
11026
  const recovered = noWorkspace && await client.auth.reopenWorkspace() || await client.auth.relogin() !== null;
10991
11027
  if (!recovered) throw new ArbiSessionExpiredError();
10992
11028
  return run();
@@ -10997,9 +11033,11 @@ var Arbi = class {
10997
11033
  for (const listener of [...this.profileListeners]) listener(profile);
10998
11034
  }
10999
11035
  /**
11000
- * Sign out: the server session ends (every session of the user with `everywhere`), the session
11001
- * state is cleared and, with `everywhere`, so are the keys kept on this device (a single sign-out
11002
- * keeps them for an offline unlock). Then this instance's own state is cleared.
11036
+ * Sign out: first the session's work stops (nothing new starts, `onSigningOut` listeners run,
11037
+ * requests in flight are aborted), then the server session ends (every session of the user with
11038
+ * `everywhere`), the session state is cleared and, with `everywhere`, so are the keys kept on this
11039
+ * device (a single sign-out keeps them for an offline unlock). Then this instance's own state is
11040
+ * cleared.
11003
11041
  */
11004
11042
  async logout(options = {}) {
11005
11043
  if (this.client) {
@@ -11046,12 +11084,13 @@ var Arbi = class {
11046
11084
  * Reads the access token from the session on each call, so a token refreshed
11047
11085
  * elsewhere is reflected on the next (re)connect. Returns `null` when there is
11048
11086
  * no client/token yet (not logged in) rather than throwing, so callers can
11049
- * poll for readiness instead of guarding against exceptions.
11087
+ * poll for readiness instead of guarding against exceptions. `signal` is the
11088
+ * session's: aborted when a sign-out begins, so the transport closes with it.
11050
11089
  */
11051
11090
  getConnectionInfo() {
11052
11091
  const accessToken = this.client?.session.getState().accessToken;
11053
- if (!accessToken) return null;
11054
- return { baseUrl: this.options.url, accessToken };
11092
+ if (!this.client || !accessToken) return null;
11093
+ return { baseUrl: this.options.url, accessToken, signal: this.client.auth.sessionSignal() };
11055
11094
  }
11056
11095
  /**
11057
11096
  * Re-login silently and resolve the fresh access token (`null` when the session could not be