@arbidocs/sdk 0.5.69 → 0.5.70
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/{browser-BvdQbiFa.d.ts → browser-Bf6pRBuP.d.ts} +267 -173
- package/dist/{browser-CuDnbE8Y.d.cts → browser-CA2ecqVP.d.cts} +267 -173
- package/dist/browser.cjs +163 -15
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +1 -1
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +164 -17
- package/dist/browser.js.map +1 -1
- package/dist/index.cjs +163 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +164 -17
- package/dist/index.js.map +1 -1
- package/examples/react-chat/package.json +2 -2
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a4 as ConfigStore, a1 as CliConfig, a2 as CliCredentials, _ as ChatSession,
|
|
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 ArbiErrorOptions, h as ArbiHostSession, i as ArbiOptions, j as ArbiSessionExpiredError, k as ArbiStructuredOutputError, l as ArbiTransportError, m as ArbiWorkspaceChangedError, n as ArbiWorkspaceSupersededError, o as ArbiWorkspaceUnavailableError, p as AskHandlers, q as AskRequest, r as AttendeeRead, s as AuthContext, u as AuthMode, v as AuthenticatedClient, B as BookingConfirmation, w as BookingPage, x as BookingPageWriteBody, y as BookingRequestBody, z as BridgeTokensOptions, C as CalDavConnectBody, D as CalDavProfile, E as CalendarAccount, F as CalendarAccountKind, G as CalendarCreateBody, H as CalendarEvent, I as CalendarKeys, J as CalendarRead, K as CalendarSettings, L as CalendarSettingsBody, M as CalendarUpdate, N as CalendarWindow, O as CallApiError, P as Capabilities, Q as ChatAttachmentFile, R as ChatAttachmentInput, T as ChatKeyRing, U as ChatKind, V as ChatMemberKey, W as ChatMemberResponse, X as ChatMessage, Y as ChatMessageResponse, Z as ChatResponse, $ as CitationSummary, a0 as CitationToolSources, a3 as CommandDescriptor, a5 as Configuration, a6 as ConfigurationPatch, a7 as ConnectOptions, a8 as ConnectionModel, a9 as ConnectorCatalogEntry, aa as ConnectorFolder, ab as ConnectorSyncProgress, ac as ConnectorSyncStatus, ad as ConnectorVendorKey, ae as ConnectorVisibilitySettings, af as ContextUsage, ag as ConversationResponse, ah as ConversationUsageResponse, ak as CreateWorkRequest, al as CreateWorkflowRequest, am as DEFAULT_AI_USD_PER_GBP, an as DOC_TERMINAL_STATUSES, ao as DRIVE_SYNC_VENDORS, ap as Database, aq as DatabaseAggregateRequest, ar as DatabaseAggregateResult, as as DatabaseColumn, at as DatabaseColumnWrite, au as DatabaseImportResult, av as DatabaseRow, aw as DatabaseRowPage, ax as DatabaseRowsQuery, ay as DateTimeSpec, az as DecryptedChat, aA as DecryptedChatMessage, aB as DeploymentHouseTemplate, aC as DirectModelUsage, aD as DocInfo, aE as DocInfoMap, aF as DocNameMap, aG as DocumentAutomationAction, aH as DocumentListFields, aI as DocumentListOrder, aJ as DocumentSelector, aK as DocumentWaiter, aL as DocumentWaiterOptions, aM as DriveSyncProgress, aN as DriveSyncSummary, aO as DuplicateContactError, aP as ENTITY_KINDS, aQ as EditScope, aR as EntityKind, aS as EventCreateBody, aT as EventPatchBody, aU as FLAT_TAG_KINDS, aY as FindTimeParams, aZ as FormattedWsMessage, a_ as FreeBusyEntry, a$ as FullContextSelection, b0 as GOOGLE_VENDORS, b1 as HolidayCountry, b2 as HouseTemplateCandidate, b3 as IMANAGE_VENDORS, b4 as IdentityErrorCode, b5 as IdentityPurchase, b6 as IdentityState, b7 as IdentityStatus, b8 as ImportResult, b9 as InvitationRead, ba as JsonSchemaOutputFormat, bb as LinkedRun, bc as ListAllOptions, bd as ListEventsParams, bf as ListPaginatedOptions, bg as MAILBOX_SYNC_VENDORS, bh as MAX_RETRIEVE_DOC_IDS, bi as MICROSOFT_VENDORS, bk as MessageLevel, bl as ModelConnection, bm as OAuthAccountKind, bn as OutputItemDone, bo as OverlayItem, bp as OverlayLayerName, bq as PRESENCE_KINDS, br as PROMPT_CONTEXT_CHARS, bs as ParsedResponse, bt as ParsedSlashCommand, bu as ParsedStructuredResponse, bv as PendingAuthResponse, bw as PersonKey, bx as PersonalConnectionInput, by as PlanStepsError, bz as PlanWorkRequest, bA as ProductResponse, bB as ProjectAddonKind, bC as ProjectAddonSettingsRequest, bD as ProjectBudget, bE as ProjectCheckoutRequest, bF as ProjectConversationUsageResponse, bG as ProjectCreateOptions, bH as ProjectDetails, bI as ProjectEventKind, bJ as ProjectEventResponse, bK as ProjectInvoicesResponse, bL as ProjectNextPeriodAddonsRequest, bM as ProjectPlanChangeRequest, bN as ProjectQuoteRequest, bO as ProjectResponse, bP as ProjectUpdateRequest, bQ as ProjectUsageResponse, bR as PublicBookingError, bS as PublicBookingPage, bT as QuotaExceeded, bU as RaisedSignal, bV as RawResponseEvent, bW as ReconnectOptions, bX as ReconnectableWsConnection, bY as ResolvedCitation, bZ as ResolvedRecipient, b_ as RespondParams, b$ as RespondPartstat, c0 as Response, c1 as ResponseCreateRequest, c2 as ResponseCreateResult, c3 as ResponseHandle, c4 as ResponseSnapshot, c5 as ResponseStart, c6 as ResponseStartOptions, c7 as ResponseStream, c8 as ResponseStreamEvent, c9 as ResponseTools, ca as RoomCreateBody, cb as RoomQuery, cc as RoomRead, cd as RunProgress, ce as RunStats, cf as RunStep, cg as RunWaitingOn, ch as SHAREPOINT_VENDORS, ci as SSEEvent, cj as SSEStreamCallbacks, ck as SSEStreamOutcome, cl as SSEStreamResult, cm as STEP_FIELD_OPTION_TONES, cn as STOP_ID_WAIT_MS, co as STOP_REPEAT_WINDOW_MS, cq as ScopedTarget, cr as SearchChunk, cs as
|
|
1
|
+
import { a4 as ConfigStore, a1 as CliConfig, a2 as CliCredentials, _ as ChatSession, cz as SkippedFile, dl as UploadResult, t as AuthHeaders, df as UploadBatchResult, dj as UploadOptions, dg as UploadDirectOptions, dh as UploadDirectResult, cp as SUPPORTED_EXTENSIONS, bj as MailAttachment, S as ChatCryptoContext } from './browser-CA2ecqVP.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 ArbiErrorOptions, h as ArbiHostSession, i as ArbiOptions, j as ArbiSessionExpiredError, k as ArbiStructuredOutputError, l as ArbiTransportError, m as ArbiWorkspaceChangedError, n as ArbiWorkspaceSupersededError, o as ArbiWorkspaceUnavailableError, p as AskHandlers, q as AskRequest, r as AttendeeRead, s as AuthContext, u as AuthMode, v as AuthenticatedClient, B as BookingConfirmation, w as BookingPage, x as BookingPageWriteBody, y as BookingRequestBody, z as BridgeTokensOptions, C as CalDavConnectBody, D as CalDavProfile, E as CalendarAccount, F as CalendarAccountKind, G as CalendarCreateBody, H as CalendarEvent, I as CalendarKeys, J as CalendarRead, K as CalendarSettings, L as CalendarSettingsBody, M as CalendarUpdate, N as CalendarWindow, O as CallApiError, P as Capabilities, Q as ChatAttachmentFile, R as ChatAttachmentInput, T as ChatKeyRing, U as ChatKind, V as ChatMemberKey, W as ChatMemberResponse, X as ChatMessage, Y as ChatMessageResponse, Z as ChatResponse, $ as CitationSummary, a0 as CitationToolSources, a3 as CommandDescriptor, a5 as Configuration, a6 as ConfigurationPatch, a7 as ConnectOptions, a8 as ConnectionModel, a9 as ConnectorCatalogEntry, aa as ConnectorFolder, ab as ConnectorSyncProgress, ac as ConnectorSyncStatus, ad as ConnectorVendorKey, ae as ConnectorVisibilitySettings, af as ContextUsage, ag as ConversationResponse, ah as ConversationUsageResponse, ak as CreateWorkRequest, al as CreateWorkflowRequest, am as DEFAULT_AI_USD_PER_GBP, an as DOC_TERMINAL_STATUSES, ao as DRIVE_SYNC_VENDORS, ap as Database, aq as DatabaseAggregateRequest, ar as DatabaseAggregateResult, as as DatabaseColumn, at as DatabaseColumnWrite, au as DatabaseImportResult, av as DatabaseRow, aw as DatabaseRowPage, ax as DatabaseRowsQuery, ay as DateTimeSpec, az as DecryptedChat, aA as DecryptedChatMessage, aB as DeploymentHouseTemplate, aC as DirectModelUsage, aD as DocInfo, aE as DocInfoMap, aF as DocNameMap, aG as DocumentAutomationAction, aH as DocumentListFields, aI as DocumentListOrder, aJ as DocumentSelector, aK as DocumentWaiter, aL as DocumentWaiterOptions, aM as DriveSyncProgress, aN as DriveSyncSummary, aO as DuplicateContactError, aP as ENTITY_KINDS, aQ as EditScope, aR as EntityKind, aS as EventCreateBody, aT as EventPatchBody, aU as FLAT_TAG_KINDS, aY as FindTimeParams, aZ as FormattedWsMessage, a_ as FreeBusyEntry, a$ as FullContextSelection, b0 as GOOGLE_VENDORS, b1 as HolidayCountry, b2 as HouseTemplateCandidate, b3 as IMANAGE_VENDORS, b4 as IdentityErrorCode, b5 as IdentityPurchase, b6 as IdentityState, b7 as IdentityStatus, b8 as ImportResult, b9 as InvitationRead, ba as JsonSchemaOutputFormat, bb as LinkedRun, bc as ListAllOptions, bd as ListEventsParams, bf as ListPaginatedOptions, bg as MAILBOX_SYNC_VENDORS, bh as MAX_RETRIEVE_DOC_IDS, bi as MICROSOFT_VENDORS, bk as MessageLevel, bl as ModelConnection, bm as OAuthAccountKind, bn as OutputItemDone, bo as OverlayItem, bp as OverlayLayerName, bq as PRESENCE_KINDS, br as PROMPT_CONTEXT_CHARS, bs as ParsedResponse, bt as ParsedSlashCommand, bu as ParsedStructuredResponse, bv as PendingAuthResponse, bw as PersonKey, bx as PersonalConnectionInput, by as PlanStepsError, bz as PlanWorkRequest, bA as ProductResponse, bB as ProjectAddonKind, bC as ProjectAddonSettingsRequest, bD as ProjectBudget, bE as ProjectCheckoutRequest, bF as ProjectConversationUsageResponse, bG as ProjectCreateOptions, bH as ProjectDetails, bI as ProjectEventKind, bJ as ProjectEventResponse, bK as ProjectInvoicesResponse, bL as ProjectNextPeriodAddonsRequest, bM as ProjectPlanChangeRequest, bN as ProjectQuoteRequest, bO as ProjectResponse, bP as ProjectUpdateRequest, bQ as ProjectUsageResponse, bR as PublicBookingError, bS as PublicBookingPage, bT as QuotaExceeded, bU as RaisedSignal, bV as RawResponseEvent, bW as ReconnectOptions, bX as ReconnectableWsConnection, bY as ResolvedCitation, bZ as ResolvedRecipient, b_ as RespondParams, b$ as RespondPartstat, c0 as Response, c1 as ResponseCreateRequest, c2 as ResponseCreateResult, c3 as ResponseHandle, c4 as ResponseSnapshot, c5 as ResponseStart, c6 as ResponseStartOptions, c7 as ResponseStream, c8 as ResponseStreamEvent, c9 as ResponseTools, ca as RoomCreateBody, cb as RoomQuery, cc as RoomRead, cd as RunProgress, ce as RunStats, cf as RunStep, cg as RunWaitingOn, ch as SHAREPOINT_VENDORS, ci as SSEEvent, cj as SSEStreamCallbacks, ck as SSEStreamOutcome, cl as SSEStreamResult, cm as STEP_FIELD_OPTION_TONES, cn as STOP_ID_WAIT_MS, co as STOP_REPEAT_WINDOW_MS, cq as ScopedTarget, cr as SearchChunk, cs as SecureMailCompose, ct as SecureMailSend, cu as SecureMailSender, cv as SendBack, cw as ShareRead, cx as ShareRole, cy as SkillSummary, cA as SlackConnectionStatus, cB as StepActionRequest, cC as StepActivityEvent, cD as StepAssignee, cE as StepDisplay, cF as StepField, cG as StepFieldOption, cH as StepFieldOptionTone, cI as StepKind, cJ as StepPhase, cK as StepSignal, cL as StepSignalWhen, cM as StepState, cN as StepStatus, cO as SubagentBranchRecord, cP as SubagentLaneInfo, cQ as SubmitBackgroundQueryOptions, cR as SubscribeParams, cS as SyncTriggerResult, cT as TAG_KINDS, cU as TAG_NESTING_MAX_DEPTH, cV as TagChange, cW as TagFieldDefinition, cX as TagGroup, cY as TagKind, cZ as TagKindField, c_ as TagKindSchema, c$ as TagLinks, d0 as TagListQuery, d1 as TagNode, d2 as TagResponse, d3 as TagScope, d4 as TagTreeRow, d5 as TaskPlan, d6 as TaskPlanStep, d7 as TaxQuoteResponse, d8 as Thread, d9 as ThreadsResponse, da as TimeSuggestion, db as TurnRequest, dc as UpdateConversationRequest, de as UpdateWorkflowRequest, di as UploadDocumentsOptions, dk as UploadProgressListener, dm as UsageBreakdown, dn as UserConnectorEntry, dp as UserDailyUsageResponse, dq as UserInfo, dr as WebSocketAuthError, ds as WeeklyHoursSpec, dt as WorkStatus, du as WorkflowAuthMode, dv as WorkflowResponse, dw as WorkflowRunHistoryResponse, dx as WorkflowRunResponse, dy as WorkspaceConflict, dz as WorkspaceContext, dA as WorkspaceOpenResponse, dB as WorkspaceResponse, dC as WsConnection, dD as account, dE as agentconfig, dF as agents, dG as appendTranscriptionHints, dH as assistant, dI as authenticatedFetch, dJ as bookPublicSlot, dK as buildCitationChunkData, dL as buildDocNameMap, dM as buildDocumentTools, dN as buildFactsContextTool, dO as buildRetrievalChunkTool, dP as buildRetrievalFullContextTool, dQ as buildRetrievalTocTool, dR as buildTurnRequest, dS as calendar, dT as calls, dU as canTagHaveParent, dV as cancelPublicBooking, dW as capabilities, dX as chats, dY as composeConfiguration, dZ as composeTools, d_ as computeRunStats, d$ as connectErrorMessage, e0 as connectWebSocket, e1 as connectWithReconnect, e2 as connectors, e3 as contacts, e4 as continuityPrompt, e5 as conversations, e6 as countCitations, e7 as createAuthenticatedClient, e8 as createDocumentWaiter, e9 as createIndexAssigner, ea as databases, eb as defaultKindForFormat, ec as doctags, ed as documentTools, ee as documents, ef as estimateDraftTokens, eg as extractDocumentIdsFromMessages, eh as extractFactIdsFromMessages, ei as extractSubagentLanes, ej as facts, ek as files, el as filterDocumentTags, em as filterSkills, en as findLeafForTaskMessage, eo as findMainSiblingLeaf, ep as findReplyTarget, eq as findSubagentRunId, er as flattenTagTree, es as formatAgentStepLabel, et as formatFileSize, eu as formatGbp, ev as formatGbpPerMillionTokens, ew as formatItemLabel, ex as formatStreamSummary, ey as formatTokens, ez as formatUserName, eA as formatWorkspaceChoices, eB as formatWsMessage, eC as generateEncryptedWorkspaceKey, eD as generateNewWorkspaceKey, eE as getAgentStepLabel, eF as getAttachableRunId, eG as getChildTags, eH as getContextRemainingPercent, eI as getContextUsedPercent, eJ as getContextUsedTokens, eK as getCurrentStep, eL as getEligibleParentTags, eM as getErrorCode, eN as getErrorMessage, eO as getPublicBookingPage, eP as getRawWorkspaceKey, eQ as getRunToAttach, eR as getRunToCancel, eS as getStepDisplay, eT as getStepTool, eU as getSubagentBranchRecord, eV as getTagDescendantIds, eW as health, eX as houseTemplates, eY as hydrateAgentSteps, e_ as identityErrorCode, eZ as identityVerification, e$ as instructions, f0 as isAnnotationTag, f1 as isConnectorVendorVisible, f2 as isDriveSyncVendor, f3 as isEntityTag, f4 as isFlatKind, f5 as isLabelTag, f6 as isMailboxSyncVendor, f7 as isNearAiUsageBudget, f8 as isPresenceTag, f9 as isSharePointVendor, fa as isSharedSkill, fb as isTraceItem, fc as mail, fd as mcpTools, fe as mergeAgentSteps, ff as modelConnections, fg as notifications, fh as parseSSEEvents, fi as parseSlashCommand, fj as parseSlashTokenInProgress, fk as parseStructuredResponse, fl as performPasswordLogin, fm as performSigningKeyLogin, fn as performSsoDeviceFlowLogin, fo as pickMainThread, fp as profile, fq as progressFetch, fr as projects, fs as quotaExceededFrom, ft as quotaFromStreamError, fu as reduceOutputItem, fv as refusalReason, fw as requireData, fx as requireOk, fy as resolveAuth, fz as resolveCitations, fA as resolveSummary, fB as resolveWorkspace, fC as responses, fD as searchChunks, fE as secureMail, fF as selectFullContextDocument, fG as selectWorkspace, fH as selectWorkspaceById, fI as sessions, fJ as settings, fK as signatureRequests, fL as sliceToSubagentThread, fM as streamSSE, fN as stripCitationMarkdown, fO as subagentJobLabel, fP as summarizeCitations, fQ as tagUseCount, fR as tags, fS as tagsForScope, fT as tagsOfGroup, fU as topLevelAgentSteps, fV as uploadSkill, fW as usdToGbp, fX as work, fY as workflowSteps, fZ as workflows, f_ as workspaceConflictOf, f$ as workspaces, g0 as wouldCreateTagCycle } from './browser-CA2ecqVP.cjs';
|
|
3
3
|
import { SessionPersistence, ArbiClient, components } from '@arbidocs/client';
|
|
4
4
|
export { CallPeer, HttpErrorInfo, HttpRequestInfo, HttpResponseInfo, HttpTransportOptions, LoginProfile, SessionPersistence } 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 { a4 as ConfigStore, a1 as CliConfig, a2 as CliCredentials, _ as ChatSession,
|
|
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 ArbiErrorOptions, h as ArbiHostSession, i as ArbiOptions, j as ArbiSessionExpiredError, k as ArbiStructuredOutputError, l as ArbiTransportError, m as ArbiWorkspaceChangedError, n as ArbiWorkspaceSupersededError, o as ArbiWorkspaceUnavailableError, p as AskHandlers, q as AskRequest, r as AttendeeRead, s as AuthContext, u as AuthMode, v as AuthenticatedClient, B as BookingConfirmation, w as BookingPage, x as BookingPageWriteBody, y as BookingRequestBody, z as BridgeTokensOptions, C as CalDavConnectBody, D as CalDavProfile, E as CalendarAccount, F as CalendarAccountKind, G as CalendarCreateBody, H as CalendarEvent, I as CalendarKeys, J as CalendarRead, K as CalendarSettings, L as CalendarSettingsBody, M as CalendarUpdate, N as CalendarWindow, O as CallApiError, P as Capabilities, Q as ChatAttachmentFile, R as ChatAttachmentInput, T as ChatKeyRing, U as ChatKind, V as ChatMemberKey, W as ChatMemberResponse, X as ChatMessage, Y as ChatMessageResponse, Z as ChatResponse, $ as CitationSummary, a0 as CitationToolSources, a3 as CommandDescriptor, a5 as Configuration, a6 as ConfigurationPatch, a7 as ConnectOptions, a8 as ConnectionModel, a9 as ConnectorCatalogEntry, aa as ConnectorFolder, ab as ConnectorSyncProgress, ac as ConnectorSyncStatus, ad as ConnectorVendorKey, ae as ConnectorVisibilitySettings, af as ContextUsage, ag as ConversationResponse, ah as ConversationUsageResponse, ak as CreateWorkRequest, al as CreateWorkflowRequest, am as DEFAULT_AI_USD_PER_GBP, an as DOC_TERMINAL_STATUSES, ao as DRIVE_SYNC_VENDORS, ap as Database, aq as DatabaseAggregateRequest, ar as DatabaseAggregateResult, as as DatabaseColumn, at as DatabaseColumnWrite, au as DatabaseImportResult, av as DatabaseRow, aw as DatabaseRowPage, ax as DatabaseRowsQuery, ay as DateTimeSpec, az as DecryptedChat, aA as DecryptedChatMessage, aB as DeploymentHouseTemplate, aC as DirectModelUsage, aD as DocInfo, aE as DocInfoMap, aF as DocNameMap, aG as DocumentAutomationAction, aH as DocumentListFields, aI as DocumentListOrder, aJ as DocumentSelector, aK as DocumentWaiter, aL as DocumentWaiterOptions, aM as DriveSyncProgress, aN as DriveSyncSummary, aO as DuplicateContactError, aP as ENTITY_KINDS, aQ as EditScope, aR as EntityKind, aS as EventCreateBody, aT as EventPatchBody, aU as FLAT_TAG_KINDS, aY as FindTimeParams, aZ as FormattedWsMessage, a_ as FreeBusyEntry, a$ as FullContextSelection, b0 as GOOGLE_VENDORS, b1 as HolidayCountry, b2 as HouseTemplateCandidate, b3 as IMANAGE_VENDORS, b4 as IdentityErrorCode, b5 as IdentityPurchase, b6 as IdentityState, b7 as IdentityStatus, b8 as ImportResult, b9 as InvitationRead, ba as JsonSchemaOutputFormat, bb as LinkedRun, bc as ListAllOptions, bd as ListEventsParams, bf as ListPaginatedOptions, bg as MAILBOX_SYNC_VENDORS, bh as MAX_RETRIEVE_DOC_IDS, bi as MICROSOFT_VENDORS, bk as MessageLevel, bl as ModelConnection, bm as OAuthAccountKind, bn as OutputItemDone, bo as OverlayItem, bp as OverlayLayerName, bq as PRESENCE_KINDS, br as PROMPT_CONTEXT_CHARS, bs as ParsedResponse, bt as ParsedSlashCommand, bu as ParsedStructuredResponse, bv as PendingAuthResponse, bw as PersonKey, bx as PersonalConnectionInput, by as PlanStepsError, bz as PlanWorkRequest, bA as ProductResponse, bB as ProjectAddonKind, bC as ProjectAddonSettingsRequest, bD as ProjectBudget, bE as ProjectCheckoutRequest, bF as ProjectConversationUsageResponse, bG as ProjectCreateOptions, bH as ProjectDetails, bI as ProjectEventKind, bJ as ProjectEventResponse, bK as ProjectInvoicesResponse, bL as ProjectNextPeriodAddonsRequest, bM as ProjectPlanChangeRequest, bN as ProjectQuoteRequest, bO as ProjectResponse, bP as ProjectUpdateRequest, bQ as ProjectUsageResponse, bR as PublicBookingError, bS as PublicBookingPage, bT as QuotaExceeded, bU as RaisedSignal, bV as RawResponseEvent, bW as ReconnectOptions, bX as ReconnectableWsConnection, bY as ResolvedCitation, bZ as ResolvedRecipient, b_ as RespondParams, b$ as RespondPartstat, c0 as Response, c1 as ResponseCreateRequest, c2 as ResponseCreateResult, c3 as ResponseHandle, c4 as ResponseSnapshot, c5 as ResponseStart, c6 as ResponseStartOptions, c7 as ResponseStream, c8 as ResponseStreamEvent, c9 as ResponseTools, ca as RoomCreateBody, cb as RoomQuery, cc as RoomRead, cd as RunProgress, ce as RunStats, cf as RunStep, cg as RunWaitingOn, ch as SHAREPOINT_VENDORS, ci as SSEEvent, cj as SSEStreamCallbacks, ck as SSEStreamOutcome, cl as SSEStreamResult, cm as STEP_FIELD_OPTION_TONES, cn as STOP_ID_WAIT_MS, co as STOP_REPEAT_WINDOW_MS, cq as ScopedTarget, cr as SearchChunk, cs as
|
|
1
|
+
import { a4 as ConfigStore, a1 as CliConfig, a2 as CliCredentials, _ as ChatSession, cz as SkippedFile, dl as UploadResult, t as AuthHeaders, df as UploadBatchResult, dj as UploadOptions, dg as UploadDirectOptions, dh as UploadDirectResult, cp as SUPPORTED_EXTENSIONS, bj as MailAttachment, S as ChatCryptoContext } from './browser-Bf6pRBuP.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 ArbiErrorOptions, h as ArbiHostSession, i as ArbiOptions, j as ArbiSessionExpiredError, k as ArbiStructuredOutputError, l as ArbiTransportError, m as ArbiWorkspaceChangedError, n as ArbiWorkspaceSupersededError, o as ArbiWorkspaceUnavailableError, p as AskHandlers, q as AskRequest, r as AttendeeRead, s as AuthContext, u as AuthMode, v as AuthenticatedClient, B as BookingConfirmation, w as BookingPage, x as BookingPageWriteBody, y as BookingRequestBody, z as BridgeTokensOptions, C as CalDavConnectBody, D as CalDavProfile, E as CalendarAccount, F as CalendarAccountKind, G as CalendarCreateBody, H as CalendarEvent, I as CalendarKeys, J as CalendarRead, K as CalendarSettings, L as CalendarSettingsBody, M as CalendarUpdate, N as CalendarWindow, O as CallApiError, P as Capabilities, Q as ChatAttachmentFile, R as ChatAttachmentInput, T as ChatKeyRing, U as ChatKind, V as ChatMemberKey, W as ChatMemberResponse, X as ChatMessage, Y as ChatMessageResponse, Z as ChatResponse, $ as CitationSummary, a0 as CitationToolSources, a3 as CommandDescriptor, a5 as Configuration, a6 as ConfigurationPatch, a7 as ConnectOptions, a8 as ConnectionModel, a9 as ConnectorCatalogEntry, aa as ConnectorFolder, ab as ConnectorSyncProgress, ac as ConnectorSyncStatus, ad as ConnectorVendorKey, ae as ConnectorVisibilitySettings, af as ContextUsage, ag as ConversationResponse, ah as ConversationUsageResponse, ak as CreateWorkRequest, al as CreateWorkflowRequest, am as DEFAULT_AI_USD_PER_GBP, an as DOC_TERMINAL_STATUSES, ao as DRIVE_SYNC_VENDORS, ap as Database, aq as DatabaseAggregateRequest, ar as DatabaseAggregateResult, as as DatabaseColumn, at as DatabaseColumnWrite, au as DatabaseImportResult, av as DatabaseRow, aw as DatabaseRowPage, ax as DatabaseRowsQuery, ay as DateTimeSpec, az as DecryptedChat, aA as DecryptedChatMessage, aB as DeploymentHouseTemplate, aC as DirectModelUsage, aD as DocInfo, aE as DocInfoMap, aF as DocNameMap, aG as DocumentAutomationAction, aH as DocumentListFields, aI as DocumentListOrder, aJ as DocumentSelector, aK as DocumentWaiter, aL as DocumentWaiterOptions, aM as DriveSyncProgress, aN as DriveSyncSummary, aO as DuplicateContactError, aP as ENTITY_KINDS, aQ as EditScope, aR as EntityKind, aS as EventCreateBody, aT as EventPatchBody, aU as FLAT_TAG_KINDS, aY as FindTimeParams, aZ as FormattedWsMessage, a_ as FreeBusyEntry, a$ as FullContextSelection, b0 as GOOGLE_VENDORS, b1 as HolidayCountry, b2 as HouseTemplateCandidate, b3 as IMANAGE_VENDORS, b4 as IdentityErrorCode, b5 as IdentityPurchase, b6 as IdentityState, b7 as IdentityStatus, b8 as ImportResult, b9 as InvitationRead, ba as JsonSchemaOutputFormat, bb as LinkedRun, bc as ListAllOptions, bd as ListEventsParams, bf as ListPaginatedOptions, bg as MAILBOX_SYNC_VENDORS, bh as MAX_RETRIEVE_DOC_IDS, bi as MICROSOFT_VENDORS, bk as MessageLevel, bl as ModelConnection, bm as OAuthAccountKind, bn as OutputItemDone, bo as OverlayItem, bp as OverlayLayerName, bq as PRESENCE_KINDS, br as PROMPT_CONTEXT_CHARS, bs as ParsedResponse, bt as ParsedSlashCommand, bu as ParsedStructuredResponse, bv as PendingAuthResponse, bw as PersonKey, bx as PersonalConnectionInput, by as PlanStepsError, bz as PlanWorkRequest, bA as ProductResponse, bB as ProjectAddonKind, bC as ProjectAddonSettingsRequest, bD as ProjectBudget, bE as ProjectCheckoutRequest, bF as ProjectConversationUsageResponse, bG as ProjectCreateOptions, bH as ProjectDetails, bI as ProjectEventKind, bJ as ProjectEventResponse, bK as ProjectInvoicesResponse, bL as ProjectNextPeriodAddonsRequest, bM as ProjectPlanChangeRequest, bN as ProjectQuoteRequest, bO as ProjectResponse, bP as ProjectUpdateRequest, bQ as ProjectUsageResponse, bR as PublicBookingError, bS as PublicBookingPage, bT as QuotaExceeded, bU as RaisedSignal, bV as RawResponseEvent, bW as ReconnectOptions, bX as ReconnectableWsConnection, bY as ResolvedCitation, bZ as ResolvedRecipient, b_ as RespondParams, b$ as RespondPartstat, c0 as Response, c1 as ResponseCreateRequest, c2 as ResponseCreateResult, c3 as ResponseHandle, c4 as ResponseSnapshot, c5 as ResponseStart, c6 as ResponseStartOptions, c7 as ResponseStream, c8 as ResponseStreamEvent, c9 as ResponseTools, ca as RoomCreateBody, cb as RoomQuery, cc as RoomRead, cd as RunProgress, ce as RunStats, cf as RunStep, cg as RunWaitingOn, ch as SHAREPOINT_VENDORS, ci as SSEEvent, cj as SSEStreamCallbacks, ck as SSEStreamOutcome, cl as SSEStreamResult, cm as STEP_FIELD_OPTION_TONES, cn as STOP_ID_WAIT_MS, co as STOP_REPEAT_WINDOW_MS, cq as ScopedTarget, cr as SearchChunk, cs as SecureMailCompose, ct as SecureMailSend, cu as SecureMailSender, cv as SendBack, cw as ShareRead, cx as ShareRole, cy as SkillSummary, cA as SlackConnectionStatus, cB as StepActionRequest, cC as StepActivityEvent, cD as StepAssignee, cE as StepDisplay, cF as StepField, cG as StepFieldOption, cH as StepFieldOptionTone, cI as StepKind, cJ as StepPhase, cK as StepSignal, cL as StepSignalWhen, cM as StepState, cN as StepStatus, cO as SubagentBranchRecord, cP as SubagentLaneInfo, cQ as SubmitBackgroundQueryOptions, cR as SubscribeParams, cS as SyncTriggerResult, cT as TAG_KINDS, cU as TAG_NESTING_MAX_DEPTH, cV as TagChange, cW as TagFieldDefinition, cX as TagGroup, cY as TagKind, cZ as TagKindField, c_ as TagKindSchema, c$ as TagLinks, d0 as TagListQuery, d1 as TagNode, d2 as TagResponse, d3 as TagScope, d4 as TagTreeRow, d5 as TaskPlan, d6 as TaskPlanStep, d7 as TaxQuoteResponse, d8 as Thread, d9 as ThreadsResponse, da as TimeSuggestion, db as TurnRequest, dc as UpdateConversationRequest, de as UpdateWorkflowRequest, di as UploadDocumentsOptions, dk as UploadProgressListener, dm as UsageBreakdown, dn as UserConnectorEntry, dp as UserDailyUsageResponse, dq as UserInfo, dr as WebSocketAuthError, ds as WeeklyHoursSpec, dt as WorkStatus, du as WorkflowAuthMode, dv as WorkflowResponse, dw as WorkflowRunHistoryResponse, dx as WorkflowRunResponse, dy as WorkspaceConflict, dz as WorkspaceContext, dA as WorkspaceOpenResponse, dB as WorkspaceResponse, dC as WsConnection, dD as account, dE as agentconfig, dF as agents, dG as appendTranscriptionHints, dH as assistant, dI as authenticatedFetch, dJ as bookPublicSlot, dK as buildCitationChunkData, dL as buildDocNameMap, dM as buildDocumentTools, dN as buildFactsContextTool, dO as buildRetrievalChunkTool, dP as buildRetrievalFullContextTool, dQ as buildRetrievalTocTool, dR as buildTurnRequest, dS as calendar, dT as calls, dU as canTagHaveParent, dV as cancelPublicBooking, dW as capabilities, dX as chats, dY as composeConfiguration, dZ as composeTools, d_ as computeRunStats, d$ as connectErrorMessage, e0 as connectWebSocket, e1 as connectWithReconnect, e2 as connectors, e3 as contacts, e4 as continuityPrompt, e5 as conversations, e6 as countCitations, e7 as createAuthenticatedClient, e8 as createDocumentWaiter, e9 as createIndexAssigner, ea as databases, eb as defaultKindForFormat, ec as doctags, ed as documentTools, ee as documents, ef as estimateDraftTokens, eg as extractDocumentIdsFromMessages, eh as extractFactIdsFromMessages, ei as extractSubagentLanes, ej as facts, ek as files, el as filterDocumentTags, em as filterSkills, en as findLeafForTaskMessage, eo as findMainSiblingLeaf, ep as findReplyTarget, eq as findSubagentRunId, er as flattenTagTree, es as formatAgentStepLabel, et as formatFileSize, eu as formatGbp, ev as formatGbpPerMillionTokens, ew as formatItemLabel, ex as formatStreamSummary, ey as formatTokens, ez as formatUserName, eA as formatWorkspaceChoices, eB as formatWsMessage, eC as generateEncryptedWorkspaceKey, eD as generateNewWorkspaceKey, eE as getAgentStepLabel, eF as getAttachableRunId, eG as getChildTags, eH as getContextRemainingPercent, eI as getContextUsedPercent, eJ as getContextUsedTokens, eK as getCurrentStep, eL as getEligibleParentTags, eM as getErrorCode, eN as getErrorMessage, eO as getPublicBookingPage, eP as getRawWorkspaceKey, eQ as getRunToAttach, eR as getRunToCancel, eS as getStepDisplay, eT as getStepTool, eU as getSubagentBranchRecord, eV as getTagDescendantIds, eW as health, eX as houseTemplates, eY as hydrateAgentSteps, e_ as identityErrorCode, eZ as identityVerification, e$ as instructions, f0 as isAnnotationTag, f1 as isConnectorVendorVisible, f2 as isDriveSyncVendor, f3 as isEntityTag, f4 as isFlatKind, f5 as isLabelTag, f6 as isMailboxSyncVendor, f7 as isNearAiUsageBudget, f8 as isPresenceTag, f9 as isSharePointVendor, fa as isSharedSkill, fb as isTraceItem, fc as mail, fd as mcpTools, fe as mergeAgentSteps, ff as modelConnections, fg as notifications, fh as parseSSEEvents, fi as parseSlashCommand, fj as parseSlashTokenInProgress, fk as parseStructuredResponse, fl as performPasswordLogin, fm as performSigningKeyLogin, fn as performSsoDeviceFlowLogin, fo as pickMainThread, fp as profile, fq as progressFetch, fr as projects, fs as quotaExceededFrom, ft as quotaFromStreamError, fu as reduceOutputItem, fv as refusalReason, fw as requireData, fx as requireOk, fy as resolveAuth, fz as resolveCitations, fA as resolveSummary, fB as resolveWorkspace, fC as responses, fD as searchChunks, fE as secureMail, fF as selectFullContextDocument, fG as selectWorkspace, fH as selectWorkspaceById, fI as sessions, fJ as settings, fK as signatureRequests, fL as sliceToSubagentThread, fM as streamSSE, fN as stripCitationMarkdown, fO as subagentJobLabel, fP as summarizeCitations, fQ as tagUseCount, fR as tags, fS as tagsForScope, fT as tagsOfGroup, fU as topLevelAgentSteps, fV as uploadSkill, fW as usdToGbp, fX as work, fY as workflowSteps, fZ as workflows, f_ as workspaceConflictOf, f$ as workspaces, g0 as wouldCreateTagCycle } from './browser-Bf6pRBuP.js';
|
|
3
3
|
import { SessionPersistence, ArbiClient, components } from '@arbidocs/client';
|
|
4
4
|
export { CallPeer, HttpErrorInfo, HttpRequestInfo, HttpResponseInfo, HttpTransportOptions, LoginProfile, SessionPersistence } 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, sealedBoxEncrypt, sealedBoxDecrypt, bytesToBase64, encryptWithChatKey, decryptWithChatKey, decryptFile, deriveDirectChatKey, openSealedChatKey, generateChatKey, sealChatKey, sealCallKey, encryptMessage,
|
|
4
|
+
import { createArbiClient, base64ToBytes, unwrapWorkspaceKey, sealKeyForSession, buildWebSocketUrl, createAuthMessage, parseServerMessage, isMessageType, createContentHash, encryptFile, initSodium, encryptionKeypairFromSigningKey, sealedBoxEncrypt, sealedBoxDecrypt, bytesToBase64, sealSecureMail, decodeSecureMailKey, openSecureMail, secureMailClaim, encryptWithChatKey, decryptWithChatKey, decryptFile, deriveDirectChatKey, openSealedChatKey, generateChatKey, sealChatKey, sealCallKey, encryptMessage, createSessionManager, authRequestError, isAbortError, changePassword, openCallKeyOf, decryptCallTitle, generateCallKey, encryptCallTitle, sealCallKeyForPeers, openSealedCallKey, readSessionClaims } from '@arbidocs/client';
|
|
5
5
|
import { execSync, spawn } from 'child_process';
|
|
6
6
|
import { createHash } from 'crypto';
|
|
7
7
|
import { fileURLToPath } from 'url';
|
|
@@ -6567,6 +6567,130 @@ async function unlockModelConnections(arbi, keys, onlyId) {
|
|
|
6567
6567
|
}
|
|
6568
6568
|
}
|
|
6569
6569
|
|
|
6570
|
+
// src/operations/secure-mail.ts
|
|
6571
|
+
var secure_mail_exports = {};
|
|
6572
|
+
__export(secure_mail_exports, {
|
|
6573
|
+
claimSecureMail: () => claimSecureMail,
|
|
6574
|
+
prepareSecureMail: () => prepareSecureMail,
|
|
6575
|
+
secureMime: () => secureMime
|
|
6576
|
+
});
|
|
6577
|
+
var MAX_MESSAGE_BYTES = 25 * 1024 * 1024;
|
|
6578
|
+
var utf8 = new TextEncoder();
|
|
6579
|
+
var encodedWord = (value) => `=?UTF-8?B?${bytesToBase64(utf8.encode(value))}?=`;
|
|
6580
|
+
var folded = (value) => value.match(/.{1,76}/g)?.join("\r\n") ?? "";
|
|
6581
|
+
var safeHeader = (value) => {
|
|
6582
|
+
if (/[\r\n\0]/.test(value)) throw new Error("Email headers cannot contain newlines");
|
|
6583
|
+
return value;
|
|
6584
|
+
};
|
|
6585
|
+
function secureMime(compose, sender) {
|
|
6586
|
+
const address = (r2) => `${r2.name ? encodedWord(safeHeader(r2.name)) + " " : ""}<${safeHeader(r2.email)}>`;
|
|
6587
|
+
const boundary = "arbi-" + crypto.randomUUID();
|
|
6588
|
+
const headers = [
|
|
6589
|
+
`From: ${address({ email: sender.email, name: sender.display_name })}`,
|
|
6590
|
+
...compose.to.length ? [`To: ${compose.to.map(address).join(", ")}`] : [],
|
|
6591
|
+
...compose.cc.length ? [`Cc: ${compose.cc.map(address).join(", ")}`] : [],
|
|
6592
|
+
`Subject: ${encodedWord(safeHeader(compose.subject))}`,
|
|
6593
|
+
`Date: ${(/* @__PURE__ */ new Date()).toUTCString()}`,
|
|
6594
|
+
`Message-ID: <${crypto.randomUUID()}@${sender.email.split("@")[1]}>`,
|
|
6595
|
+
...compose.in_reply_to ? [`In-Reply-To: ${safeHeader(compose.in_reply_to)}`] : [],
|
|
6596
|
+
...compose.references?.length ? [`References: ${compose.references.map(safeHeader).join(" ")}`] : [],
|
|
6597
|
+
"MIME-Version: 1.0",
|
|
6598
|
+
"X-ARBI-Secure-Delivery: 1",
|
|
6599
|
+
`Content-Type: multipart/mixed; boundary="${boundary}"`
|
|
6600
|
+
];
|
|
6601
|
+
const alternative = "alternative-" + crypto.randomUUID();
|
|
6602
|
+
const plainPart = `Content-Type: text/plain; charset="utf-8"\r
|
|
6603
|
+
Content-Transfer-Encoding: base64\r
|
|
6604
|
+
\r
|
|
6605
|
+
${folded(bytesToBase64(utf8.encode(compose.text)))}`;
|
|
6606
|
+
const bodyPart = compose.html ? `Content-Type: multipart/alternative; boundary="${alternative}"\r
|
|
6607
|
+
\r
|
|
6608
|
+
--${alternative}\r
|
|
6609
|
+
${plainPart}\r
|
|
6610
|
+
--${alternative}\r
|
|
6611
|
+
Content-Type: text/html; charset="utf-8"\r
|
|
6612
|
+
Content-Transfer-Encoding: base64\r
|
|
6613
|
+
\r
|
|
6614
|
+
${folded(bytesToBase64(utf8.encode(compose.html)))}\r
|
|
6615
|
+
--${alternative}--\r
|
|
6616
|
+
` : plainPart;
|
|
6617
|
+
const parts = [
|
|
6618
|
+
`--${boundary}\r
|
|
6619
|
+
${bodyPart}`,
|
|
6620
|
+
...compose.attachments.map((a2) => {
|
|
6621
|
+
if (!a2.content_base64) throw new Error("Attachment content is missing");
|
|
6622
|
+
const name = encodeURIComponent(safeHeader(a2.name)).replace(/'/g, "%27");
|
|
6623
|
+
return `--${boundary}\r
|
|
6624
|
+
Content-Type: ${safeHeader(a2.content_type || "application/octet-stream")}\r
|
|
6625
|
+
Content-Disposition: attachment; filename*=UTF-8''${name}\r
|
|
6626
|
+
Content-Transfer-Encoding: base64\r
|
|
6627
|
+
\r
|
|
6628
|
+
${folded(a2.content_base64)}`;
|
|
6629
|
+
}),
|
|
6630
|
+
`--${boundary}--\r
|
|
6631
|
+
`
|
|
6632
|
+
];
|
|
6633
|
+
return utf8.encode(headers.join("\r\n") + "\r\n\r\n" + parts.join("\r\n"));
|
|
6634
|
+
}
|
|
6635
|
+
async function prepareSecureMail(compose, sender, { requestId, senderPublicKey, frontendOrigin }) {
|
|
6636
|
+
const raw = secureMime(compose, sender);
|
|
6637
|
+
try {
|
|
6638
|
+
if (raw.length > MAX_MESSAGE_BYTES) throw new Error("Email exceeds the message size limit");
|
|
6639
|
+
const metadata = {
|
|
6640
|
+
secure_delivery: true,
|
|
6641
|
+
id: "",
|
|
6642
|
+
subject: compose.subject,
|
|
6643
|
+
sender: [{ email: sender.email, name: sender.display_name }],
|
|
6644
|
+
to: compose.to,
|
|
6645
|
+
cc: compose.cc,
|
|
6646
|
+
bcc: [],
|
|
6647
|
+
received_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
6648
|
+
preview: compose.text.slice(0, 220),
|
|
6649
|
+
unread: false,
|
|
6650
|
+
text: "",
|
|
6651
|
+
references: compose.references ?? [],
|
|
6652
|
+
attachments: compose.attachments.map((a2, i2) => ({
|
|
6653
|
+
...a2,
|
|
6654
|
+
id: String(i2),
|
|
6655
|
+
content_base64: null
|
|
6656
|
+
}))
|
|
6657
|
+
};
|
|
6658
|
+
const recipients = [
|
|
6659
|
+
...new Set([...compose.to, ...compose.cc, ...compose.bcc].map((r2) => r2.email.toLowerCase()))
|
|
6660
|
+
];
|
|
6661
|
+
const sealed = await sealSecureMail(raw, metadata, senderPublicKey);
|
|
6662
|
+
return {
|
|
6663
|
+
request_id: requestId,
|
|
6664
|
+
draft_id: compose.draft_id,
|
|
6665
|
+
recipients: recipients.map((email) => ({
|
|
6666
|
+
id: crypto.randomUUID(),
|
|
6667
|
+
email,
|
|
6668
|
+
fragment_key: sealed.fragment_key
|
|
6669
|
+
})),
|
|
6670
|
+
ciphertext: sealed.ciphertext,
|
|
6671
|
+
metadata_ciphertext: sealed.metadata_ciphertext,
|
|
6672
|
+
sender_wrapped_key: sealed.sender_wrapped_key,
|
|
6673
|
+
frontend_origin: frontendOrigin
|
|
6674
|
+
};
|
|
6675
|
+
} finally {
|
|
6676
|
+
raw.fill(0);
|
|
6677
|
+
}
|
|
6678
|
+
}
|
|
6679
|
+
async function claimSecureMail(mail, id, fragmentKey, recipientPublicKey) {
|
|
6680
|
+
const key = decodeSecureMailKey(fragmentKey);
|
|
6681
|
+
try {
|
|
6682
|
+
const path5 = `/secure/${encodeURIComponent(id)}`;
|
|
6683
|
+
const response = await mail(path5);
|
|
6684
|
+
const { raw } = await openSecureMail(await response.json(), key);
|
|
6685
|
+
raw.fill(0);
|
|
6686
|
+
const claim = await secureMailClaim(key, recipientPublicKey);
|
|
6687
|
+
const claimed = await mail(`${path5}/claim`, { method: "POST", body: JSON.stringify(claim) });
|
|
6688
|
+
return await claimed.json();
|
|
6689
|
+
} finally {
|
|
6690
|
+
key.fill(0);
|
|
6691
|
+
}
|
|
6692
|
+
}
|
|
6693
|
+
|
|
6570
6694
|
// src/operations/workspaces.ts
|
|
6571
6695
|
var workspaces_exports = {};
|
|
6572
6696
|
__export(workspaces_exports, {
|
|
@@ -10225,7 +10349,6 @@ __export(mail_exports, {
|
|
|
10225
10349
|
NATIVE_ACCOUNT: () => NATIVE_ACCOUNT,
|
|
10226
10350
|
attachmentFromBytes: () => attachmentFromBytes,
|
|
10227
10351
|
claimNativeAlias: () => claimNativeAlias,
|
|
10228
|
-
claimSecureMail: () => claimSecureMail,
|
|
10229
10352
|
createMailFetch: () => createMailFetch,
|
|
10230
10353
|
downloadAttachment: () => downloadAttachment,
|
|
10231
10354
|
getMailPolicy: () => getMailPolicy,
|
|
@@ -10331,28 +10454,16 @@ async function unlockNativeMail(mail, keys) {
|
|
|
10331
10454
|
secretKey.fill(0);
|
|
10332
10455
|
}
|
|
10333
10456
|
}
|
|
10334
|
-
async function claimSecureMail(mail, id, fragmentKey, recipientPublicKey) {
|
|
10335
|
-
const key = decodeSecureMailKey(fragmentKey);
|
|
10336
|
-
try {
|
|
10337
|
-
const path5 = `/secure/${encodeURIComponent(id)}`;
|
|
10338
|
-
const { raw } = await openSecureMail(await json(mail(path5)), key);
|
|
10339
|
-
raw.fill(0);
|
|
10340
|
-
const claim = await secureMailClaim(key, recipientPublicKey);
|
|
10341
|
-
return await json(mail(`${path5}/claim`, { method: "POST", body: JSON.stringify(claim) }));
|
|
10342
|
-
} finally {
|
|
10343
|
-
key.fill(0);
|
|
10344
|
-
}
|
|
10345
|
-
}
|
|
10346
10457
|
function attachmentFromBytes(name, contentType, bytes) {
|
|
10347
10458
|
return {
|
|
10348
10459
|
id: "",
|
|
10349
10460
|
name,
|
|
10350
10461
|
content_type: contentType,
|
|
10351
10462
|
size: bytes.length,
|
|
10352
|
-
content_base64:
|
|
10463
|
+
content_base64: bytesToBase644(bytes)
|
|
10353
10464
|
};
|
|
10354
10465
|
}
|
|
10355
|
-
function
|
|
10466
|
+
function bytesToBase644(bytes) {
|
|
10356
10467
|
let binary = "";
|
|
10357
10468
|
for (let i2 = 0; i2 < bytes.length; i2 += 32768) {
|
|
10358
10469
|
binary += String.fromCharCode(...bytes.subarray(i2, i2 + 32768));
|
|
@@ -12637,6 +12748,42 @@ var Arbi = class {
|
|
|
12637
12748
|
});
|
|
12638
12749
|
}
|
|
12639
12750
|
};
|
|
12751
|
+
// ── Secure mail ─────────────────────────────────────────────────────
|
|
12752
|
+
/**
|
|
12753
|
+
* Mail to anyone, sealed in this browser under a key that travels only in the link's fragment
|
|
12754
|
+
* (see `operations/secure-mail`). Both sides use the signed-in user's encryption key: the
|
|
12755
|
+
* login's, or (a new tab not signed in to the server yet) the one kept on this device.
|
|
12756
|
+
*/
|
|
12757
|
+
secureMail = {
|
|
12758
|
+
/**
|
|
12759
|
+
* The `/secure/send` payload for `compose` from `account`, shown with the user's own name.
|
|
12760
|
+
* Links open on `frontendOrigin` (default: this page's origin).
|
|
12761
|
+
*/
|
|
12762
|
+
prepare: async (compose, account, requestId, frontendOrigin = globalThis.location?.origin ?? "") => {
|
|
12763
|
+
const user = this.client?.session.getState().user;
|
|
12764
|
+
const name = user ? [user.given_name, user.family_name] : [this.userProfile?.givenName, this.userProfile?.familyName];
|
|
12765
|
+
const senderName = name.filter(Boolean).join(" ");
|
|
12766
|
+
return prepareSecureMail(
|
|
12767
|
+
compose,
|
|
12768
|
+
{ ...account, display_name: senderName || account.display_name },
|
|
12769
|
+
{ requestId, senderPublicKey: await this.encryptionPublicKey(), frontendOrigin }
|
|
12770
|
+
);
|
|
12771
|
+
},
|
|
12772
|
+
/**
|
|
12773
|
+
* Claim the secure message `id` with the key from its link into the user's native inbox, over
|
|
12774
|
+
* `mail` (default: this session's mail transport). Resolves to the message's id there.
|
|
12775
|
+
*/
|
|
12776
|
+
claim: async (id, fragmentKey, mail = this.mail.fetch) => claimSecureMail(mail, id, fragmentKey, await this.encryptionPublicKey())
|
|
12777
|
+
};
|
|
12778
|
+
/** The signed-in user's X25519 public key (from the identity key; its secret half is wiped). */
|
|
12779
|
+
async encryptionPublicKey() {
|
|
12780
|
+
const signingKey = this.loginResult?.signingPrivateKey ?? (await this.client?.storage.getSession().catch(() => null))?.signingPrivateKey;
|
|
12781
|
+
if (!signingKey) throw new ArbiError("Sign in again to unlock your encryption key");
|
|
12782
|
+
await initSodium();
|
|
12783
|
+
const pair = encryptionKeypairFromSigningKey(signingKey);
|
|
12784
|
+
pair.secretKey.fill(0);
|
|
12785
|
+
return pair.publicKey;
|
|
12786
|
+
}
|
|
12640
12787
|
async openResponseHandle(open, options, id, bufferEvents = false) {
|
|
12641
12788
|
const controller = new AbortController();
|
|
12642
12789
|
const abort = () => controller.abort();
|
|
@@ -15533,6 +15680,6 @@ function composeTools(base, next, mode) {
|
|
|
15533
15680
|
return structuredClone(mode === "add" ? { ...base, ...next } : next);
|
|
15534
15681
|
}
|
|
15535
15682
|
|
|
15536
|
-
export { ACCOUNT_VENDOR, Arbi, ArbiApiError, ArbiError, ArbiSessionExpiredError, ArbiStructuredOutputError, ArbiTransportError, ArbiWorkspaceChangedError, ArbiWorkspaceSupersededError, ArbiWorkspaceUnavailableError, CallApiError, ClaudeOrchestrator, DEFAULT_AI_USD_PER_GBP, DOC_TERMINAL_STATUSES, DRIVE_SYNC_VENDORS, DuplicateContactError, ENTITY_KINDS, FLAT_TAG_KINDS, FileConfigStore, GOOGLE_VENDORS, IMANAGE_VENDORS, MAILBOX_SYNC_VENDORS, MAX_RETRIEVE_DOC_IDS, MICROSOFT_VENDORS, OpenClawOrchestrator, PRESENCE_KINDS, PROMPT_CONTEXT_CHARS, PlanStepsError, PublicBookingError, ResponseStream, SHAREPOINT_VENDORS, STEP_FIELD_OPTION_TONES, STOP_ID_WAIT_MS, STOP_REPEAT_WINDOW_MS, TAG_KINDS, TAG_NESTING_MAX_DEPTH, WebSocketAuthError, account_exports as account, agentconfig_exports as agentconfig, agents_exports as agents, appendTranscriptionHints, assistant_exports as assistant, authenticatedFetch, bookPublicSlot, buildCitationChunkData, buildDocNameMap, buildDocumentTools, buildFactsContextTool, buildRetrievalChunkTool, buildRetrievalFullContextTool, buildRetrievalTocTool, buildTurnRequest, calendar_exports as calendar, calls_exports as calls, canTagHaveParent, cancelPublicBooking, capabilities, chats_exports as chats, composeConfiguration, composeTools, computeRunStats, connectErrorMessage, connectWebSocket, connectWithReconnect, connectors_exports as connectors, contacts_exports as contacts, continuityPrompt, conversations_exports as conversations, countCitations, createAuthenticatedClient, createDocumentWaiter, createIndexAssigner, databases_exports as databases, defaultKindForFormat, device_flow_exports as deviceFlow, doctags_exports as doctags, documentTools, documents_exports as documents, documents_node_exports as documentsNode, estimateDraftTokens, extractDocumentIdsFromMessages, extractFactIdsFromMessages, extractSubagentLanes, facts_exports as facts, files_exports as files, filterDocumentTags, filterSkills, findLeafForTaskMessage, findMainSiblingLeaf, findReplyTarget, findSubagentRunId, firm_exports as firm, flattenTagTree, formatAgentStepLabel, formatFileSize, formatGbp, formatGbpPerMillionTokens, formatItemLabel, formatStreamSummary, formatTokens, formatUserName, formatWorkspaceChoices, formatWsMessage, generateEncryptedWorkspaceKey, generateNewWorkspaceKey, getAgentStepLabel, getAttachableRunId, getChildTags, getContextRemainingPercent, getContextUsedPercent, getContextUsedTokens, getCurrentStep, getEligibleParentTags, getErrorCode, getErrorMessage, getPublicBookingPage, getRawWorkspaceKey, getRunToAttach, getRunToCancel, getStepDisplay, getStepTool, getSubagentBranchRecord, getTagDescendantIds, health_exports as health, house_template_exports as houseTemplates, hydrateAgentSteps, identityErrorCode, identity_exports as identityVerification, instructions, isAnnotationTag, isConnectorVendorVisible, isDriveSyncVendor, isEntityTag, isFlatKind, isLabelTag, isMailboxSyncVendor, isNearAiUsageBudget, isPresenceTag, isSharePointVendor, isSharedSkill, isTraceItem, listen_exports as listen, mail_exports as mail, mail_node_exports as mailNode, mcpTools, mergeAgentSteps, model_connections_exports as modelConnections, notifications_exports as notifications, parseSSEEvents, parseSlashCommand, parseSlashTokenInProgress, parseStructuredResponse, performPasswordLogin, performSigningKeyLogin, performSsoDeviceFlowLogin, pickMainThread, profile_exports as profile, progressFetch, projects_exports as projects, quotaExceededFrom, quotaFromStreamError, reduceOutputItem, refusalReason, requireData, requireOk, resolveAuth, resolveCitations, resolveSummary, resolveWorkspace, responses_exports as responses, searchChunks, selectFullContextDocument, selectWorkspace, selectWorkspaceById, sessions_exports as sessions, settings_exports as settings, signature_requests_exports as signatureRequests, sliceToSubagentThread, startDmListener, streamSSE, stripCitationMarkdown, subagentJobLabel, summarizeCitations, tagUseCount, tags_exports as tags, tagsForScope, tagsOfGroup, topLevelAgentSteps, uploadSkill, usdToGbp, work_exports as work, workflow_steps_exports as workflowSteps, workflows_exports as workflows, workspaceConflictOf, workspaces_exports as workspaces, wouldCreateTagCycle };
|
|
15683
|
+
export { ACCOUNT_VENDOR, Arbi, ArbiApiError, ArbiError, ArbiSessionExpiredError, ArbiStructuredOutputError, ArbiTransportError, ArbiWorkspaceChangedError, ArbiWorkspaceSupersededError, ArbiWorkspaceUnavailableError, CallApiError, ClaudeOrchestrator, DEFAULT_AI_USD_PER_GBP, DOC_TERMINAL_STATUSES, DRIVE_SYNC_VENDORS, DuplicateContactError, ENTITY_KINDS, FLAT_TAG_KINDS, FileConfigStore, GOOGLE_VENDORS, IMANAGE_VENDORS, MAILBOX_SYNC_VENDORS, MAX_RETRIEVE_DOC_IDS, MICROSOFT_VENDORS, OpenClawOrchestrator, PRESENCE_KINDS, PROMPT_CONTEXT_CHARS, PlanStepsError, PublicBookingError, ResponseStream, SHAREPOINT_VENDORS, STEP_FIELD_OPTION_TONES, STOP_ID_WAIT_MS, STOP_REPEAT_WINDOW_MS, TAG_KINDS, TAG_NESTING_MAX_DEPTH, WebSocketAuthError, account_exports as account, agentconfig_exports as agentconfig, agents_exports as agents, appendTranscriptionHints, assistant_exports as assistant, authenticatedFetch, bookPublicSlot, buildCitationChunkData, buildDocNameMap, buildDocumentTools, buildFactsContextTool, buildRetrievalChunkTool, buildRetrievalFullContextTool, buildRetrievalTocTool, buildTurnRequest, calendar_exports as calendar, calls_exports as calls, canTagHaveParent, cancelPublicBooking, capabilities, chats_exports as chats, composeConfiguration, composeTools, computeRunStats, connectErrorMessage, connectWebSocket, connectWithReconnect, connectors_exports as connectors, contacts_exports as contacts, continuityPrompt, conversations_exports as conversations, countCitations, createAuthenticatedClient, createDocumentWaiter, createIndexAssigner, databases_exports as databases, defaultKindForFormat, device_flow_exports as deviceFlow, doctags_exports as doctags, documentTools, documents_exports as documents, documents_node_exports as documentsNode, estimateDraftTokens, extractDocumentIdsFromMessages, extractFactIdsFromMessages, extractSubagentLanes, facts_exports as facts, files_exports as files, filterDocumentTags, filterSkills, findLeafForTaskMessage, findMainSiblingLeaf, findReplyTarget, findSubagentRunId, firm_exports as firm, flattenTagTree, formatAgentStepLabel, formatFileSize, formatGbp, formatGbpPerMillionTokens, formatItemLabel, formatStreamSummary, formatTokens, formatUserName, formatWorkspaceChoices, formatWsMessage, generateEncryptedWorkspaceKey, generateNewWorkspaceKey, getAgentStepLabel, getAttachableRunId, getChildTags, getContextRemainingPercent, getContextUsedPercent, getContextUsedTokens, getCurrentStep, getEligibleParentTags, getErrorCode, getErrorMessage, getPublicBookingPage, getRawWorkspaceKey, getRunToAttach, getRunToCancel, getStepDisplay, getStepTool, getSubagentBranchRecord, getTagDescendantIds, health_exports as health, house_template_exports as houseTemplates, hydrateAgentSteps, identityErrorCode, identity_exports as identityVerification, instructions, isAnnotationTag, isConnectorVendorVisible, isDriveSyncVendor, isEntityTag, isFlatKind, isLabelTag, isMailboxSyncVendor, isNearAiUsageBudget, isPresenceTag, isSharePointVendor, isSharedSkill, isTraceItem, listen_exports as listen, mail_exports as mail, mail_node_exports as mailNode, mcpTools, mergeAgentSteps, model_connections_exports as modelConnections, notifications_exports as notifications, parseSSEEvents, parseSlashCommand, parseSlashTokenInProgress, parseStructuredResponse, performPasswordLogin, performSigningKeyLogin, performSsoDeviceFlowLogin, pickMainThread, profile_exports as profile, progressFetch, projects_exports as projects, quotaExceededFrom, quotaFromStreamError, reduceOutputItem, refusalReason, requireData, requireOk, resolveAuth, resolveCitations, resolveSummary, resolveWorkspace, responses_exports as responses, searchChunks, secure_mail_exports as secureMail, selectFullContextDocument, selectWorkspace, selectWorkspaceById, sessions_exports as sessions, settings_exports as settings, signature_requests_exports as signatureRequests, sliceToSubagentThread, startDmListener, streamSSE, stripCitationMarkdown, subagentJobLabel, summarizeCitations, tagUseCount, tags_exports as tags, tagsForScope, tagsOfGroup, topLevelAgentSteps, uploadSkill, usdToGbp, work_exports as work, workflow_steps_exports as workflowSteps, workflows_exports as workflows, workspaceConflictOf, workspaces_exports as workspaces, wouldCreateTagCycle };
|
|
15537
15684
|
//# sourceMappingURL=index.js.map
|
|
15538
15685
|
//# sourceMappingURL=index.js.map
|