@arbidocs/sdk 0.4.108 → 0.4.110

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,6 +1,6 @@
1
- import { t as ConfigStore, q as CliConfig, r as CliCredentials, C as ChatSession, aL as SkippedFile, bf as UploadResult, m as AuthHeaders, bb as UploadBatchResult, be as UploadOptions, bc as UploadDirectOptions, bd as UploadDirectResult, aI as SUPPORTED_EXTENSIONS, a1 as MailAttachment, J as DmCryptoContext } from './browser-yXZhW9gn.cjs';
2
- export { A as ActivityKind, a as ActivityResponse, d as AgentStepEvent, e as Arbi, f as ArbiApiError, g as ArbiError, i as ArbiOptions, j as ArbiSessionExpiredError, k as ArtifactEvent, l as AuthContext, n as AuthMode, o as AuthenticatedClient, p as CitationSummary, s as CommandDescriptor, u as ConnectOptions, v as ConversationResponse, w as ConversationUsageResponse, z as CreateWorkRequest, B as CreateWorkflowRequest, D as DEFAULT_AI_USD_PER_GBP, E as DOC_TERMINAL_STATUSES, F as DecryptedDmNotification, H as DmAttachmentFile, I as DmAttachmentInput, K as DocNameMap, L as DocumentAutomationAction, M as DocumentListFields, N as DocumentListOrder, O as DocumentSelector, P as DocumentWaiter, Q as DocumentWaiterOptions, U as FormattedWsMessage, V as IdentityErrorCode, W as IdentityPurchase, X as IdentityState, Y as IdentityStatus, Z as LinkedRun, _ as ListAllOptions, a0 as ListPaginatedOptions, a2 as MailDraftSSEEvent, a3 as MessageLevel, a4 as MessageMetadataPayload, a5 as MessageQueuedEvent, a6 as OutputTokensDetails, a7 as ParsedSlashCommand, a8 as PendingAuthResponse, a9 as PlanStepsError, aa as PlanWorkRequest, ac as ProjectBudget, ad as ProjectConversationUsageResponse, ae as ProjectDetails, af as ProjectEventKind, ag as ProjectEventResponse, ah as ProjectInvoicesResponse, ai as ProjectResponse, aj as ProjectUpdateRequest, ak as ProjectUsageResponse, al as QueryOptions, am as RaisedSignal, an as ReconnectOptions, ao as ReconnectableWsConnection, ap as ResolvedCitation, aq as ResolvedRecipient, ar as ResponseCompletedEvent, as as ResponseContentPartAddedEvent, at as ResponseCreatedEvent, au as ResponseFailedEvent, av as ResponseOutputItemAddedEvent, aw as ResponseOutputItemDoneEvent, ax as ResponseOutputTextDeltaEvent, ay as ResponseOutputTextDoneEvent, az as ResponseUsage, aA as RunProgress, aB as RunStep, aC as RunWaitingOn, aD as SSEEvent, aE as SSEStreamCallbacks, aF as SSEStreamResult, aG as SSEStreamStartData, aH as STEP_FIELD_OPTION_TONES, aJ as SendBack, aK as SkillSummary, aM as StepActionRequest, aN as StepActivityEvent, aO as StepAssignee, aP as StepField, aQ as StepFieldOption, aR as StepFieldOptionTone, aS as StepKind, aT as StepPhase, aU as StepSignal, aV as StepSignalWhen, aW as StepState, aX as StepStatus, aY as SubmitBackgroundQueryOptions, aZ as TagChange, a_ as TagFieldDefinition, a$ as TagKind, b0 as TagKindField, b1 as TagKindSchema, b2 as TagLinks, b3 as TagListQuery, b4 as TagResponse, b5 as TaskPlan, b6 as TaskPlanStep, b7 as TokenBudgetContext, b8 as UpdateConversationRequest, ba as UpdateWorkflowRequest, bg as UsageBreakdown, bh as UserDailyUsageResponse, bi as UserInfo, bj as UserInputRequestEvent, bk as UserMessageEvent, bl as WebSocketAuthError, bm as WorkStatus, bn as WorkflowAuthMode, bo as WorkflowResponse, bp as WorkflowRunHistoryResponse, bq as WorkflowRunResponse, br as WorkspaceContext, bs as WsConnection, bt as account, bu as agentconfig, bv as agents, bw as assistant, bx as authenticatedFetch, by as buildDocNameMap, bz as buildFactsContextTool, bA as buildRetrievalChunkTool, bB as buildRetrievalFullContextTool, bC as buildRetrievalTocTool, bD as connectWebSocket, bE as connectWithReconnect, bF as consumeSSEStream, bG as contacts, bH as conversations, bI as countCitations, bJ as createAuthenticatedClient, bK as createDocumentWaiter, bL as dm, bM as doctags, bN as documents, bO as facts, bP as files, bQ as filterSkills, bR as formatAgentStepLabel, bS as formatFileSize, bT as formatGbp, bU as formatGbpPerMillionTokens, bV as formatItemLabel, bW as formatStreamSummary, bX as formatUserName, bY as formatWorkspaceChoices, bZ as formatWsMessage, b_ as generateEncryptedWorkspaceKey, b$ as generateNewWorkspaceKey, c0 as getErrorCode, c1 as getErrorMessage, c2 as getRawWorkspaceKey, c3 as health, c5 as identityErrorCode, c4 as identityVerification, c6 as mail, c7 as parseSSEEvents, c8 as parseSlashCommand, c9 as parseSlashTokenInProgress, ca as performPasswordLogin, cb as performSigningKeyLogin, cc as performSsoDeviceFlowLogin, cd as profile, ce as projects, cf as requireData, cg as requireOk, ch as resolveAuth, ci as resolveCitations, cj as resolveWorkspace, ck as responses, cl as selectWorkspace, cm as selectWorkspaceById, cn as sessions, co as settings, cp as signatureRequests, cq as streamSSE, cr as stripCitationMarkdown, cs as summarizeCitations, ct as tags, cu as usdToGbp, cv as work, cw as workflowSteps, cx as workflows, cy as workspaces } from './browser-yXZhW9gn.cjs';
3
- import { SessionStorageProvider, ArbiClient } from '@arbidocs/client';
1
+ import { E as ConfigStore, z as CliConfig, B as CliCredentials, x as ChatSession, aS as SkippedFile, bm as UploadResult, m as AuthHeaders, bi as UploadBatchResult, bl as UploadOptions, bj as UploadDirectOptions, bk as UploadDirectResult, aP as SUPPORTED_EXTENSIONS, a8 as MailAttachment, q as ChatCryptoContext } from './browser-ig67Srk0.cjs';
2
+ export { A as ActivityKind, a as ActivityResponse, d as AgentStepEvent, e as Arbi, f as ArbiApiError, g as ArbiError, i as ArbiOptions, j as ArbiSessionExpiredError, k as ArtifactEvent, l as AuthContext, n as AuthMode, o as AuthenticatedClient, C as ChatAttachmentFile, p as ChatAttachmentInput, r as ChatKeyRing, s as ChatKind, t as ChatMemberKey, u as ChatMemberResponse, v as ChatMessageResponse, w as ChatResponse, y as CitationSummary, D as CommandDescriptor, F as ConnectOptions, G as ConversationResponse, H as ConversationUsageResponse, K as CreateWorkRequest, L as CreateWorkflowRequest, M as DEFAULT_AI_USD_PER_GBP, N as DOC_TERMINAL_STATUSES, O as DecryptedChat, P as DecryptedChatMessage, R as DocNameMap, S as DocumentAutomationAction, T as DocumentListFields, U as DocumentListOrder, V as DocumentSelector, W as DocumentWaiter, X as DocumentWaiterOptions, $ as FormattedWsMessage, a0 as IdentityErrorCode, a1 as IdentityPurchase, a2 as IdentityState, a3 as IdentityStatus, a4 as LinkedRun, a5 as ListAllOptions, a7 as ListPaginatedOptions, a9 as MailDraftSSEEvent, aa as MessageLevel, ab as MessageMetadataPayload, ac as MessageQueuedEvent, ad as OutputTokensDetails, ae as ParsedSlashCommand, af as PendingAuthResponse, ag as PlanStepsError, ah as PlanWorkRequest, aj as ProjectBudget, ak as ProjectConversationUsageResponse, al as ProjectDetails, am as ProjectEventKind, an as ProjectEventResponse, ao as ProjectInvoicesResponse, ap as ProjectResponse, aq as ProjectUpdateRequest, ar as ProjectUsageResponse, as as QueryOptions, at as RaisedSignal, au as ReconnectOptions, av as ReconnectableWsConnection, aw as ResolvedCitation, ax as ResolvedRecipient, ay as ResponseCompletedEvent, az as ResponseContentPartAddedEvent, aA as ResponseCreatedEvent, aB as ResponseFailedEvent, aC as ResponseOutputItemAddedEvent, aD as ResponseOutputItemDoneEvent, aE as ResponseOutputTextDeltaEvent, aF as ResponseOutputTextDoneEvent, aG as ResponseUsage, aH as RunProgress, aI as RunStep, aJ as RunWaitingOn, aK as SSEEvent, aL as SSEStreamCallbacks, aM as SSEStreamResult, aN as SSEStreamStartData, aO as STEP_FIELD_OPTION_TONES, aQ as SendBack, aR as SkillSummary, aT as StepActionRequest, aU as StepActivityEvent, aV as StepAssignee, aW as StepField, aX as StepFieldOption, aY as StepFieldOptionTone, aZ as StepKind, a_ as StepPhase, a$ as StepSignal, b0 as StepSignalWhen, b1 as StepState, b2 as StepStatus, b3 as SubmitBackgroundQueryOptions, b4 as TagChange, b5 as TagFieldDefinition, b6 as TagKind, b7 as TagKindField, b8 as TagKindSchema, b9 as TagLinks, ba as TagListQuery, bb as TagResponse, bc as TaskPlan, bd as TaskPlanStep, be as TokenBudgetContext, bf as UpdateConversationRequest, bh as UpdateWorkflowRequest, bn as UsageBreakdown, bo as UserDailyUsageResponse, bp as UserInfo, bq as UserInputRequestEvent, br as UserMessageEvent, bs as WebSocketAuthError, bt as WorkStatus, bu as WorkflowAuthMode, bv as WorkflowResponse, bw as WorkflowRunHistoryResponse, bx as WorkflowRunResponse, by as WorkspaceContext, bz as WsConnection, bA as account, bB as agentconfig, bC as agents, bD as assistant, bE as authenticatedFetch, bF as buildDocNameMap, bG as buildFactsContextTool, bH as buildRetrievalChunkTool, bI as buildRetrievalFullContextTool, bJ as buildRetrievalTocTool, bK as chats, bL as connectWebSocket, bM as connectWithReconnect, bN as consumeSSEStream, bO as contacts, bP as conversations, bQ as countCitations, bR as createAuthenticatedClient, bS as createDocumentWaiter, bT as doctags, bU as documents, bV as facts, bW as files, bX as filterSkills, bY as formatAgentStepLabel, bZ as formatFileSize, b_ as formatGbp, b$ as formatGbpPerMillionTokens, c0 as formatItemLabel, c1 as formatStreamSummary, c2 as formatUserName, c3 as formatWorkspaceChoices, c4 as formatWsMessage, c5 as generateEncryptedWorkspaceKey, c6 as generateNewWorkspaceKey, c7 as getErrorCode, c8 as getErrorMessage, c9 as getRawWorkspaceKey, ca as health, cc as identityErrorCode, cb as identityVerification, cd as mail, ce as notifications, cf as parseSSEEvents, cg as parseSlashCommand, ch as parseSlashTokenInProgress, ci as performPasswordLogin, cj as performSigningKeyLogin, ck as performSsoDeviceFlowLogin, cl as profile, cm as projects, cn as requireData, co as requireOk, cp as resolveAuth, cq as resolveCitations, cr as resolveWorkspace, cs as responses, ct as selectWorkspace, cu as selectWorkspaceById, cv as sessions, cw as settings, cx as signatureRequests, cy as streamSSE, cz as stripCitationMarkdown, cA as summarizeCitations, cB as tags, cC as usdToGbp, cD as work, cE as workflowSteps, cF as workflows, cG as workspaces } from './browser-ig67Srk0.cjs';
3
+ import { SessionStorageProvider, ArbiClient, components } from '@arbidocs/client';
4
4
  export { LoginProfile } from '@arbidocs/client';
5
5
 
6
6
  /**
@@ -387,6 +387,59 @@ declare namespace mailNode {
387
387
  export { mailNode_attachmentFromFile as attachmentFromFile };
388
388
  }
389
389
 
390
+ /**
391
+ * Firm operations — the deployment's pooled monthly £ of AI usage (Box deployments).
392
+ */
393
+
394
+ type FirmPoolResponse = components['schemas']['FirmPoolResponse'];
395
+ /**
396
+ * The firm's AI usage pool this month (£): licence, add-ons, used of total, auto add-ons, and whether
397
+ * the caller may top up. `has_pool` is false where the deployment has no pooled budget. Readable by
398
+ * firm members and Box admins; anyone else gets a 403.
399
+ */
400
+ declare function getFirmPool(arbi: ArbiClient): Promise<FirmPoolResponse>;
401
+ /**
402
+ * Buy `aiAddons` renewing add-ons (+£10 of AI usage a month each) for the whole firm. Box admins only. Returns the
403
+ * updated pool and, when the payment needs the customer, the invoice to open.
404
+ */
405
+ declare function topUpFirmPool(arbi: ArbiClient, aiAddons: number): Promise<{
406
+ pool: {
407
+ has_pool: boolean;
408
+ month?: string | null | undefined;
409
+ resets_at?: string | null | undefined;
410
+ licence_status?: string | null | undefined;
411
+ expires_at?: string | null | undefined;
412
+ premium_only: boolean;
413
+ box_seats?: number | null | undefined;
414
+ plus_seats?: number | null | undefined;
415
+ ai_addons?: number | null | undefined;
416
+ addon_gbp?: number | null | undefined;
417
+ base_gbp?: number | null | undefined;
418
+ auto_addons?: number | null | undefined;
419
+ auto_addon_gbp?: number | null | undefined;
420
+ auto_addon_price_pence?: number | null | undefined;
421
+ auto_addon_spent_pence?: number | null | undefined;
422
+ auto_addon_limit_pence?: number | null | undefined;
423
+ total_gbp?: number | null | undefined;
424
+ used_gbp?: number | null | undefined;
425
+ remaining_gbp?: number | null | undefined;
426
+ people_this_month?: number | null | undefined;
427
+ report_computed_at?: string | null | undefined;
428
+ subscription_status?: string | null | undefined;
429
+ cancel_at_period_end?: boolean | null | undefined;
430
+ period_end?: string | null | undefined;
431
+ can_top_up: boolean;
432
+ };
433
+ invoice_url?: string | null | undefined;
434
+ }>;
435
+
436
+ type firm_FirmPoolResponse = FirmPoolResponse;
437
+ declare const firm_getFirmPool: typeof getFirmPool;
438
+ declare const firm_topUpFirmPool: typeof topUpFirmPool;
439
+ declare namespace firm {
440
+ export { type firm_FirmPoolResponse as FirmPoolResponse, firm_getFirmPool as getFirmPool, firm_topUpFirmPool as topUpFirmPool };
441
+ }
442
+
390
443
  /**
391
444
  * Orchestrator interface for `arbi listen`.
392
445
  *
@@ -504,12 +557,13 @@ declare class OpenClawOrchestrator implements Orchestrator {
504
557
  }
505
558
 
506
559
  /**
507
- * DM Listener Loop.
560
+ * PA chat listener loop.
508
561
  *
509
- * Connects to the WebSocket, listens for incoming DMs, decrypts them,
510
- * routes to an orchestrator, encrypts the reply, and sends it back.
562
+ * Connects to the WebSocket, listens for new messages in the agent's direct chat with its owner,
563
+ * decrypts them, routes them to an orchestrator, and posts the encrypted reply back to that chat.
511
564
  *
512
- * Only processes messages from the agent's parent user (owner).
565
+ * Only the owner (parent user) is answered: a personal agent is only ever a member of a direct
566
+ * chat with its owner, so any other sender is ignored.
513
567
  */
514
568
 
515
569
  interface DmListenerOptions {
@@ -518,8 +572,8 @@ interface DmListenerOptions {
518
572
  arbi: ArbiClient;
519
573
  /** Base URL of the ARBI server */
520
574
  baseUrl: string;
521
- /** DM crypto context for encrypt/decrypt */
522
- crypto: DmCryptoContext;
575
+ /** Chat crypto context (the agent's own keys) */
576
+ crypto: ChatCryptoContext;
523
577
  /** Orchestrator to route prompts to */
524
578
  orchestrator: Orchestrator;
525
579
  /** Parent user ext_id — only process messages from this sender */
@@ -534,14 +588,13 @@ interface DmListener {
534
588
  close(): void;
535
589
  }
536
590
  /**
537
- * Start listening for DMs and routing them to the orchestrator.
591
+ * Start listening for the owner's messages and routing them to the orchestrator.
538
592
  *
539
- * Connects via WebSocket with auto-reconnect. For each incoming DM:
540
- * 1. Filters to parent user only
541
- * 2. Decrypts the message
593
+ * Connects via WebSocket with auto-reconnect. For each new `chat.message` in a direct chat:
594
+ * 1. Filters to the parent user only (and skips context-only notes)
595
+ * 2. Decrypts it with the direct-chat key
542
596
  * 3. Sends plaintext to orchestrator.prompt()
543
- * 4. Encrypts the response
544
- * 5. Sends encrypted reply via DM
597
+ * 4. Posts the encrypted reply to the same chat and moves the read watermark
545
598
  */
546
599
  declare function startDmListener(options: DmListenerOptions): Promise<DmListener>;
547
600
 
@@ -564,4 +617,4 @@ declare namespace index {
564
617
  export { index_ClaudeOrchestrator as ClaudeOrchestrator, type index_ClaudeOrchestratorOptions as ClaudeOrchestratorOptions, type index_DmListener as DmListener, type index_DmListenerOptions as DmListenerOptions, index_OpenClawOrchestrator as OpenClawOrchestrator, type index_OpenClawOrchestratorOptions as OpenClawOrchestratorOptions, type index_Orchestrator as Orchestrator, type index_PromptContext as PromptContext, index_startDmListener as startDmListener };
565
618
  }
566
619
 
567
- export { AuthHeaders, ChatSession, ClaudeOrchestrator, type ClaudeOrchestratorOptions, CliConfig, CliCredentials, ConfigStore, DmCryptoContext, type DmListener, type DmListenerOptions, FileConfigStore, OpenClawOrchestrator, type OpenClawOrchestratorOptions, type Orchestrator, type PromptContext, deviceFlow, documentsNode, index as listen, mailNode, startDmListener };
620
+ export { AuthHeaders, ChatCryptoContext, ChatSession, ClaudeOrchestrator, type ClaudeOrchestratorOptions, CliConfig, CliCredentials, ConfigStore, type DmListener, type DmListenerOptions, FileConfigStore, type FirmPoolResponse, OpenClawOrchestrator, type OpenClawOrchestratorOptions, type Orchestrator, type PromptContext, deviceFlow, documentsNode, firm, index as listen, mailNode, startDmListener };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { t as ConfigStore, q as CliConfig, r as CliCredentials, C as ChatSession, aL as SkippedFile, bf as UploadResult, m as AuthHeaders, bb as UploadBatchResult, be as UploadOptions, bc as UploadDirectOptions, bd as UploadDirectResult, aI as SUPPORTED_EXTENSIONS, a1 as MailAttachment, J as DmCryptoContext } from './browser-yXZhW9gn.js';
2
- export { A as ActivityKind, a as ActivityResponse, d as AgentStepEvent, e as Arbi, f as ArbiApiError, g as ArbiError, i as ArbiOptions, j as ArbiSessionExpiredError, k as ArtifactEvent, l as AuthContext, n as AuthMode, o as AuthenticatedClient, p as CitationSummary, s as CommandDescriptor, u as ConnectOptions, v as ConversationResponse, w as ConversationUsageResponse, z as CreateWorkRequest, B as CreateWorkflowRequest, D as DEFAULT_AI_USD_PER_GBP, E as DOC_TERMINAL_STATUSES, F as DecryptedDmNotification, H as DmAttachmentFile, I as DmAttachmentInput, K as DocNameMap, L as DocumentAutomationAction, M as DocumentListFields, N as DocumentListOrder, O as DocumentSelector, P as DocumentWaiter, Q as DocumentWaiterOptions, U as FormattedWsMessage, V as IdentityErrorCode, W as IdentityPurchase, X as IdentityState, Y as IdentityStatus, Z as LinkedRun, _ as ListAllOptions, a0 as ListPaginatedOptions, a2 as MailDraftSSEEvent, a3 as MessageLevel, a4 as MessageMetadataPayload, a5 as MessageQueuedEvent, a6 as OutputTokensDetails, a7 as ParsedSlashCommand, a8 as PendingAuthResponse, a9 as PlanStepsError, aa as PlanWorkRequest, ac as ProjectBudget, ad as ProjectConversationUsageResponse, ae as ProjectDetails, af as ProjectEventKind, ag as ProjectEventResponse, ah as ProjectInvoicesResponse, ai as ProjectResponse, aj as ProjectUpdateRequest, ak as ProjectUsageResponse, al as QueryOptions, am as RaisedSignal, an as ReconnectOptions, ao as ReconnectableWsConnection, ap as ResolvedCitation, aq as ResolvedRecipient, ar as ResponseCompletedEvent, as as ResponseContentPartAddedEvent, at as ResponseCreatedEvent, au as ResponseFailedEvent, av as ResponseOutputItemAddedEvent, aw as ResponseOutputItemDoneEvent, ax as ResponseOutputTextDeltaEvent, ay as ResponseOutputTextDoneEvent, az as ResponseUsage, aA as RunProgress, aB as RunStep, aC as RunWaitingOn, aD as SSEEvent, aE as SSEStreamCallbacks, aF as SSEStreamResult, aG as SSEStreamStartData, aH as STEP_FIELD_OPTION_TONES, aJ as SendBack, aK as SkillSummary, aM as StepActionRequest, aN as StepActivityEvent, aO as StepAssignee, aP as StepField, aQ as StepFieldOption, aR as StepFieldOptionTone, aS as StepKind, aT as StepPhase, aU as StepSignal, aV as StepSignalWhen, aW as StepState, aX as StepStatus, aY as SubmitBackgroundQueryOptions, aZ as TagChange, a_ as TagFieldDefinition, a$ as TagKind, b0 as TagKindField, b1 as TagKindSchema, b2 as TagLinks, b3 as TagListQuery, b4 as TagResponse, b5 as TaskPlan, b6 as TaskPlanStep, b7 as TokenBudgetContext, b8 as UpdateConversationRequest, ba as UpdateWorkflowRequest, bg as UsageBreakdown, bh as UserDailyUsageResponse, bi as UserInfo, bj as UserInputRequestEvent, bk as UserMessageEvent, bl as WebSocketAuthError, bm as WorkStatus, bn as WorkflowAuthMode, bo as WorkflowResponse, bp as WorkflowRunHistoryResponse, bq as WorkflowRunResponse, br as WorkspaceContext, bs as WsConnection, bt as account, bu as agentconfig, bv as agents, bw as assistant, bx as authenticatedFetch, by as buildDocNameMap, bz as buildFactsContextTool, bA as buildRetrievalChunkTool, bB as buildRetrievalFullContextTool, bC as buildRetrievalTocTool, bD as connectWebSocket, bE as connectWithReconnect, bF as consumeSSEStream, bG as contacts, bH as conversations, bI as countCitations, bJ as createAuthenticatedClient, bK as createDocumentWaiter, bL as dm, bM as doctags, bN as documents, bO as facts, bP as files, bQ as filterSkills, bR as formatAgentStepLabel, bS as formatFileSize, bT as formatGbp, bU as formatGbpPerMillionTokens, bV as formatItemLabel, bW as formatStreamSummary, bX as formatUserName, bY as formatWorkspaceChoices, bZ as formatWsMessage, b_ as generateEncryptedWorkspaceKey, b$ as generateNewWorkspaceKey, c0 as getErrorCode, c1 as getErrorMessage, c2 as getRawWorkspaceKey, c3 as health, c5 as identityErrorCode, c4 as identityVerification, c6 as mail, c7 as parseSSEEvents, c8 as parseSlashCommand, c9 as parseSlashTokenInProgress, ca as performPasswordLogin, cb as performSigningKeyLogin, cc as performSsoDeviceFlowLogin, cd as profile, ce as projects, cf as requireData, cg as requireOk, ch as resolveAuth, ci as resolveCitations, cj as resolveWorkspace, ck as responses, cl as selectWorkspace, cm as selectWorkspaceById, cn as sessions, co as settings, cp as signatureRequests, cq as streamSSE, cr as stripCitationMarkdown, cs as summarizeCitations, ct as tags, cu as usdToGbp, cv as work, cw as workflowSteps, cx as workflows, cy as workspaces } from './browser-yXZhW9gn.js';
3
- import { SessionStorageProvider, ArbiClient } from '@arbidocs/client';
1
+ import { E as ConfigStore, z as CliConfig, B as CliCredentials, x as ChatSession, aS as SkippedFile, bm as UploadResult, m as AuthHeaders, bi as UploadBatchResult, bl as UploadOptions, bj as UploadDirectOptions, bk as UploadDirectResult, aP as SUPPORTED_EXTENSIONS, a8 as MailAttachment, q as ChatCryptoContext } from './browser-ig67Srk0.js';
2
+ export { A as ActivityKind, a as ActivityResponse, d as AgentStepEvent, e as Arbi, f as ArbiApiError, g as ArbiError, i as ArbiOptions, j as ArbiSessionExpiredError, k as ArtifactEvent, l as AuthContext, n as AuthMode, o as AuthenticatedClient, C as ChatAttachmentFile, p as ChatAttachmentInput, r as ChatKeyRing, s as ChatKind, t as ChatMemberKey, u as ChatMemberResponse, v as ChatMessageResponse, w as ChatResponse, y as CitationSummary, D as CommandDescriptor, F as ConnectOptions, G as ConversationResponse, H as ConversationUsageResponse, K as CreateWorkRequest, L as CreateWorkflowRequest, M as DEFAULT_AI_USD_PER_GBP, N as DOC_TERMINAL_STATUSES, O as DecryptedChat, P as DecryptedChatMessage, R as DocNameMap, S as DocumentAutomationAction, T as DocumentListFields, U as DocumentListOrder, V as DocumentSelector, W as DocumentWaiter, X as DocumentWaiterOptions, $ as FormattedWsMessage, a0 as IdentityErrorCode, a1 as IdentityPurchase, a2 as IdentityState, a3 as IdentityStatus, a4 as LinkedRun, a5 as ListAllOptions, a7 as ListPaginatedOptions, a9 as MailDraftSSEEvent, aa as MessageLevel, ab as MessageMetadataPayload, ac as MessageQueuedEvent, ad as OutputTokensDetails, ae as ParsedSlashCommand, af as PendingAuthResponse, ag as PlanStepsError, ah as PlanWorkRequest, aj as ProjectBudget, ak as ProjectConversationUsageResponse, al as ProjectDetails, am as ProjectEventKind, an as ProjectEventResponse, ao as ProjectInvoicesResponse, ap as ProjectResponse, aq as ProjectUpdateRequest, ar as ProjectUsageResponse, as as QueryOptions, at as RaisedSignal, au as ReconnectOptions, av as ReconnectableWsConnection, aw as ResolvedCitation, ax as ResolvedRecipient, ay as ResponseCompletedEvent, az as ResponseContentPartAddedEvent, aA as ResponseCreatedEvent, aB as ResponseFailedEvent, aC as ResponseOutputItemAddedEvent, aD as ResponseOutputItemDoneEvent, aE as ResponseOutputTextDeltaEvent, aF as ResponseOutputTextDoneEvent, aG as ResponseUsage, aH as RunProgress, aI as RunStep, aJ as RunWaitingOn, aK as SSEEvent, aL as SSEStreamCallbacks, aM as SSEStreamResult, aN as SSEStreamStartData, aO as STEP_FIELD_OPTION_TONES, aQ as SendBack, aR as SkillSummary, aT as StepActionRequest, aU as StepActivityEvent, aV as StepAssignee, aW as StepField, aX as StepFieldOption, aY as StepFieldOptionTone, aZ as StepKind, a_ as StepPhase, a$ as StepSignal, b0 as StepSignalWhen, b1 as StepState, b2 as StepStatus, b3 as SubmitBackgroundQueryOptions, b4 as TagChange, b5 as TagFieldDefinition, b6 as TagKind, b7 as TagKindField, b8 as TagKindSchema, b9 as TagLinks, ba as TagListQuery, bb as TagResponse, bc as TaskPlan, bd as TaskPlanStep, be as TokenBudgetContext, bf as UpdateConversationRequest, bh as UpdateWorkflowRequest, bn as UsageBreakdown, bo as UserDailyUsageResponse, bp as UserInfo, bq as UserInputRequestEvent, br as UserMessageEvent, bs as WebSocketAuthError, bt as WorkStatus, bu as WorkflowAuthMode, bv as WorkflowResponse, bw as WorkflowRunHistoryResponse, bx as WorkflowRunResponse, by as WorkspaceContext, bz as WsConnection, bA as account, bB as agentconfig, bC as agents, bD as assistant, bE as authenticatedFetch, bF as buildDocNameMap, bG as buildFactsContextTool, bH as buildRetrievalChunkTool, bI as buildRetrievalFullContextTool, bJ as buildRetrievalTocTool, bK as chats, bL as connectWebSocket, bM as connectWithReconnect, bN as consumeSSEStream, bO as contacts, bP as conversations, bQ as countCitations, bR as createAuthenticatedClient, bS as createDocumentWaiter, bT as doctags, bU as documents, bV as facts, bW as files, bX as filterSkills, bY as formatAgentStepLabel, bZ as formatFileSize, b_ as formatGbp, b$ as formatGbpPerMillionTokens, c0 as formatItemLabel, c1 as formatStreamSummary, c2 as formatUserName, c3 as formatWorkspaceChoices, c4 as formatWsMessage, c5 as generateEncryptedWorkspaceKey, c6 as generateNewWorkspaceKey, c7 as getErrorCode, c8 as getErrorMessage, c9 as getRawWorkspaceKey, ca as health, cc as identityErrorCode, cb as identityVerification, cd as mail, ce as notifications, cf as parseSSEEvents, cg as parseSlashCommand, ch as parseSlashTokenInProgress, ci as performPasswordLogin, cj as performSigningKeyLogin, ck as performSsoDeviceFlowLogin, cl as profile, cm as projects, cn as requireData, co as requireOk, cp as resolveAuth, cq as resolveCitations, cr as resolveWorkspace, cs as responses, ct as selectWorkspace, cu as selectWorkspaceById, cv as sessions, cw as settings, cx as signatureRequests, cy as streamSSE, cz as stripCitationMarkdown, cA as summarizeCitations, cB as tags, cC as usdToGbp, cD as work, cE as workflowSteps, cF as workflows, cG as workspaces } from './browser-ig67Srk0.js';
3
+ import { SessionStorageProvider, ArbiClient, components } from '@arbidocs/client';
4
4
  export { LoginProfile } from '@arbidocs/client';
5
5
 
6
6
  /**
@@ -387,6 +387,59 @@ declare namespace mailNode {
387
387
  export { mailNode_attachmentFromFile as attachmentFromFile };
388
388
  }
389
389
 
390
+ /**
391
+ * Firm operations — the deployment's pooled monthly £ of AI usage (Box deployments).
392
+ */
393
+
394
+ type FirmPoolResponse = components['schemas']['FirmPoolResponse'];
395
+ /**
396
+ * The firm's AI usage pool this month (£): licence, add-ons, used of total, auto add-ons, and whether
397
+ * the caller may top up. `has_pool` is false where the deployment has no pooled budget. Readable by
398
+ * firm members and Box admins; anyone else gets a 403.
399
+ */
400
+ declare function getFirmPool(arbi: ArbiClient): Promise<FirmPoolResponse>;
401
+ /**
402
+ * Buy `aiAddons` renewing add-ons (+£10 of AI usage a month each) for the whole firm. Box admins only. Returns the
403
+ * updated pool and, when the payment needs the customer, the invoice to open.
404
+ */
405
+ declare function topUpFirmPool(arbi: ArbiClient, aiAddons: number): Promise<{
406
+ pool: {
407
+ has_pool: boolean;
408
+ month?: string | null | undefined;
409
+ resets_at?: string | null | undefined;
410
+ licence_status?: string | null | undefined;
411
+ expires_at?: string | null | undefined;
412
+ premium_only: boolean;
413
+ box_seats?: number | null | undefined;
414
+ plus_seats?: number | null | undefined;
415
+ ai_addons?: number | null | undefined;
416
+ addon_gbp?: number | null | undefined;
417
+ base_gbp?: number | null | undefined;
418
+ auto_addons?: number | null | undefined;
419
+ auto_addon_gbp?: number | null | undefined;
420
+ auto_addon_price_pence?: number | null | undefined;
421
+ auto_addon_spent_pence?: number | null | undefined;
422
+ auto_addon_limit_pence?: number | null | undefined;
423
+ total_gbp?: number | null | undefined;
424
+ used_gbp?: number | null | undefined;
425
+ remaining_gbp?: number | null | undefined;
426
+ people_this_month?: number | null | undefined;
427
+ report_computed_at?: string | null | undefined;
428
+ subscription_status?: string | null | undefined;
429
+ cancel_at_period_end?: boolean | null | undefined;
430
+ period_end?: string | null | undefined;
431
+ can_top_up: boolean;
432
+ };
433
+ invoice_url?: string | null | undefined;
434
+ }>;
435
+
436
+ type firm_FirmPoolResponse = FirmPoolResponse;
437
+ declare const firm_getFirmPool: typeof getFirmPool;
438
+ declare const firm_topUpFirmPool: typeof topUpFirmPool;
439
+ declare namespace firm {
440
+ export { type firm_FirmPoolResponse as FirmPoolResponse, firm_getFirmPool as getFirmPool, firm_topUpFirmPool as topUpFirmPool };
441
+ }
442
+
390
443
  /**
391
444
  * Orchestrator interface for `arbi listen`.
392
445
  *
@@ -504,12 +557,13 @@ declare class OpenClawOrchestrator implements Orchestrator {
504
557
  }
505
558
 
506
559
  /**
507
- * DM Listener Loop.
560
+ * PA chat listener loop.
508
561
  *
509
- * Connects to the WebSocket, listens for incoming DMs, decrypts them,
510
- * routes to an orchestrator, encrypts the reply, and sends it back.
562
+ * Connects to the WebSocket, listens for new messages in the agent's direct chat with its owner,
563
+ * decrypts them, routes them to an orchestrator, and posts the encrypted reply back to that chat.
511
564
  *
512
- * Only processes messages from the agent's parent user (owner).
565
+ * Only the owner (parent user) is answered: a personal agent is only ever a member of a direct
566
+ * chat with its owner, so any other sender is ignored.
513
567
  */
514
568
 
515
569
  interface DmListenerOptions {
@@ -518,8 +572,8 @@ interface DmListenerOptions {
518
572
  arbi: ArbiClient;
519
573
  /** Base URL of the ARBI server */
520
574
  baseUrl: string;
521
- /** DM crypto context for encrypt/decrypt */
522
- crypto: DmCryptoContext;
575
+ /** Chat crypto context (the agent's own keys) */
576
+ crypto: ChatCryptoContext;
523
577
  /** Orchestrator to route prompts to */
524
578
  orchestrator: Orchestrator;
525
579
  /** Parent user ext_id — only process messages from this sender */
@@ -534,14 +588,13 @@ interface DmListener {
534
588
  close(): void;
535
589
  }
536
590
  /**
537
- * Start listening for DMs and routing them to the orchestrator.
591
+ * Start listening for the owner's messages and routing them to the orchestrator.
538
592
  *
539
- * Connects via WebSocket with auto-reconnect. For each incoming DM:
540
- * 1. Filters to parent user only
541
- * 2. Decrypts the message
593
+ * Connects via WebSocket with auto-reconnect. For each new `chat.message` in a direct chat:
594
+ * 1. Filters to the parent user only (and skips context-only notes)
595
+ * 2. Decrypts it with the direct-chat key
542
596
  * 3. Sends plaintext to orchestrator.prompt()
543
- * 4. Encrypts the response
544
- * 5. Sends encrypted reply via DM
597
+ * 4. Posts the encrypted reply to the same chat and moves the read watermark
545
598
  */
546
599
  declare function startDmListener(options: DmListenerOptions): Promise<DmListener>;
547
600
 
@@ -564,4 +617,4 @@ declare namespace index {
564
617
  export { index_ClaudeOrchestrator as ClaudeOrchestrator, type index_ClaudeOrchestratorOptions as ClaudeOrchestratorOptions, type index_DmListener as DmListener, type index_DmListenerOptions as DmListenerOptions, index_OpenClawOrchestrator as OpenClawOrchestrator, type index_OpenClawOrchestratorOptions as OpenClawOrchestratorOptions, type index_Orchestrator as Orchestrator, type index_PromptContext as PromptContext, index_startDmListener as startDmListener };
565
618
  }
566
619
 
567
- export { AuthHeaders, ChatSession, ClaudeOrchestrator, type ClaudeOrchestratorOptions, CliConfig, CliCredentials, ConfigStore, DmCryptoContext, type DmListener, type DmListenerOptions, FileConfigStore, OpenClawOrchestrator, type OpenClawOrchestratorOptions, type Orchestrator, type PromptContext, deviceFlow, documentsNode, index as listen, mailNode, startDmListener };
620
+ export { AuthHeaders, ChatCryptoContext, ChatSession, ClaudeOrchestrator, type ClaudeOrchestratorOptions, CliConfig, CliCredentials, ConfigStore, type DmListener, type DmListenerOptions, FileConfigStore, type FirmPoolResponse, OpenClawOrchestrator, type OpenClawOrchestratorOptions, type Orchestrator, type PromptContext, deviceFlow, documentsNode, firm, index as listen, mailNode, startDmListener };