@arbidocs/sdk 0.3.115 → 0.3.117

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 { o as ConfigStore, l as CliConfig, m as CliCredentials, C as ChatSession, a3 as SkippedFile, ab as UploadResult, i as AuthHeaders, a7 as UploadBatchResult, aa as UploadOptions, a8 as UploadDirectOptions, a9 as UploadDirectResult, a1 as SUPPORTED_EXTENSIONS, s as DmCryptoContext } from './browser-B5b3SDW6.cjs';
2
- export { a as AgentStepEvent, b as Arbi, c as ArbiApiError, d as ArbiError, f as ArbiOptions, g as ArtifactEvent, h as AuthContext, j as AuthenticatedClient, k as CitationSummary, n as CommandDescriptor, p as ConnectOptions, D as DOC_TERMINAL_STATUSES, t as DocNameMap, u as DocumentListFields, v as DocumentListOrder, w as DocumentWaiter, x as DocumentWaiterOptions, F as FormattedWsMessage, L as ListAllOptions, y as ListPaginatedOptions, E as MessageLevel, G as MessageMetadataPayload, H as MessageQueuedEvent, O as OutputTokensDetails, P as ParsedSlashCommand, Q as QueryOptions, R as ReconnectOptions, I as ReconnectableWsConnection, J as ResolvedCitation, K as ResponseCompletedEvent, N as ResponseContentPartAddedEvent, S as ResponseCreatedEvent, T as ResponseFailedEvent, U as ResponseOutputItemAddedEvent, V as ResponseOutputItemDoneEvent, W as ResponseOutputTextDeltaEvent, X as ResponseOutputTextDoneEvent, Y as ResponseUsage, Z as SSEEvent, _ as SSEStreamCallbacks, $ as SSEStreamResult, a0 as SSEStreamStartData, a2 as SkillSummary, ac as UserInfo, ad as UserInputRequestEvent, ae as UserMessageEvent, af as WebSocketAuthError, ag as WorkspaceContext, ah as WsConnection, ai as agentconfig, aj as assistant, ak as authenticatedFetch, al as buildRetrievalChunkTool, am as buildRetrievalFullContextTool, an as buildRetrievalTocTool, ao as connectWebSocket, ap as connectWithReconnect, aq as consumeSSEStream, ar as contacts, as as conversations, at as countCitations, au as createAuthenticatedClient, av as createDocumentWaiter, aw as dm, ax as doctags, ay as documents, az as files, aA as filterSkills, aB as formatAgentStepLabel, aC as formatFileSize, aD as formatStreamSummary, aE as formatUserName, aF as formatWorkspaceChoices, aG as formatWsMessage, aH as generateEncryptedWorkspaceKey, aI as generateNewWorkspaceKey, aJ as getErrorCode, aK as getErrorMessage, aL as getRawWorkspaceKey, aM as health, aO as parseSSEEvents, aP as parseSlashCommand, aQ as parseSlashTokenInProgress, aR as performPasswordLogin, aS as performSigningKeyLogin, aT as performSsoDeviceFlowLogin, aU as requireData, aV as requireOk, aW as resolveAuth, aX as resolveCitations, aY as resolveWorkspace, aZ as responses, a_ as selectWorkspace, a$ as selectWorkspaceById, b0 as settings, b1 as streamSSE, b2 as stripCitationMarkdown, b3 as summarizeCitations, b4 as tags, b6 as workspaces } from './browser-B5b3SDW6.cjs';
1
+ import { o as ConfigStore, l as CliConfig, m as CliCredentials, C as ChatSession, a6 as SkippedFile, ae as UploadResult, i as AuthHeaders, aa as UploadBatchResult, ad as UploadOptions, ab as UploadDirectOptions, ac as UploadDirectResult, a4 as SUPPORTED_EXTENSIONS, s as DmCryptoContext } from './browser-CxTSIAhf.cjs';
2
+ export { a as AgentStepEvent, b as Arbi, c as ArbiApiError, d as ArbiError, f as ArbiOptions, g as ArtifactEvent, h as AuthContext, j as AuthenticatedClient, k as CitationSummary, n as CommandDescriptor, p as ConnectOptions, D as DOC_TERMINAL_STATUSES, t as DocNameMap, u as DocumentListFields, v as DocumentListOrder, w as DocumentWaiter, x as DocumentWaiterOptions, F as FormattedWsMessage, L as ListAllOptions, y as ListPaginatedOptions, E as MessageLevel, G as MessageMetadataPayload, H as MessageQueuedEvent, O as OutputTokensDetails, P as ParsedSlashCommand, I as ProjectInvoicesResponse, J as ProjectUsageResponse, Q as QueryOptions, R as ReconnectOptions, K as ReconnectableWsConnection, N as ResolvedCitation, S as ResolvedRecipient, T as ResponseCompletedEvent, U as ResponseContentPartAddedEvent, V as ResponseCreatedEvent, W as ResponseFailedEvent, X as ResponseOutputItemAddedEvent, Y as ResponseOutputItemDoneEvent, Z as ResponseOutputTextDeltaEvent, _ as ResponseOutputTextDoneEvent, $ as ResponseUsage, a0 as SSEEvent, a1 as SSEStreamCallbacks, a2 as SSEStreamResult, a3 as SSEStreamStartData, a5 as SkillSummary, af as UserDailyUsageResponse, ag as UserInfo, ah as UserInputRequestEvent, ai as UserMessageEvent, aj as WebSocketAuthError, ak as WorkspaceChronologyOut, al as WorkspaceContext, am as WsConnection, an as agentconfig, ao as assistant, ap as authenticatedFetch, aq as buildRetrievalChunkTool, ar as buildRetrievalFullContextTool, as as buildRetrievalTocTool, at as connectWebSocket, au as connectWithReconnect, av as consumeSSEStream, aw as contacts, ax as conversations, ay as countCitations, az as createAuthenticatedClient, aA as createDocumentWaiter, aB as dm, aC as doctags, aD as documents, aE as files, aF as filterSkills, aG as formatAgentStepLabel, aH as formatFileSize, aI as formatStreamSummary, aJ as formatUserName, aK as formatWorkspaceChoices, aL as formatWsMessage, aM as generateEncryptedWorkspaceKey, aN as generateNewWorkspaceKey, aO as getErrorCode, aP as getErrorMessage, aQ as getRawWorkspaceKey, aR as health, aT as parseSSEEvents, aU as parseSlashCommand, aV as parseSlashTokenInProgress, aW as performPasswordLogin, aX as performSigningKeyLogin, aY as performSsoDeviceFlowLogin, aZ as projects, a_ as requireData, a$ as requireOk, b0 as resolveAuth, b1 as resolveCitations, b2 as resolveWorkspace, b3 as responses, b4 as selectWorkspace, b5 as selectWorkspaceById, b6 as settings, b7 as streamSSE, b8 as stripCitationMarkdown, b9 as summarizeCitations, ba as tags, bc as workspaces } from './browser-CxTSIAhf.cjs';
3
3
  import { SessionStorageProvider, ArbiClient, components } from '@arbidocs/client';
4
4
 
5
5
  /**
@@ -696,111 +696,6 @@ declare namespace sessions {
696
696
  export { sessions_listSessions as listSessions };
697
697
  }
698
698
 
699
- /**
700
- * Project operations — list, create, update, delete, checkout, refresh.
701
- */
702
-
703
- declare function listProjects(arbi: ArbiClient): Promise<{
704
- external_id: string;
705
- name: string;
706
- created_by: string;
707
- packs: number;
708
- subscription: string;
709
- created_at: string;
710
- quotas: {
711
- storage_gb: {
712
- used: number;
713
- limit: number;
714
- };
715
- ai_credits: {
716
- used: number;
717
- limit: number;
718
- };
719
- collaborators: {
720
- used: number;
721
- limit: number;
722
- };
723
- budget_reset_at?: number | null | undefined;
724
- };
725
- daily_cap_per_user?: number | null | undefined;
726
- price_id?: string | null | undefined;
727
- plan?: string | null | undefined;
728
- amount?: number | null | undefined;
729
- currency?: string | null | undefined;
730
- current_period_end?: number | null | undefined;
731
- cancel_at_period_end?: boolean | null | undefined;
732
- portal_url?: string | null | undefined;
733
- }[]>;
734
- declare function createProject(arbi: ArbiClient, name: string): Promise<{
735
- external_id: string;
736
- name: string;
737
- created_by: string;
738
- packs: number;
739
- subscription: string;
740
- created_at: string;
741
- quotas: {
742
- storage_gb: {
743
- used: number;
744
- limit: number;
745
- };
746
- ai_credits: {
747
- used: number;
748
- limit: number;
749
- };
750
- collaborators: {
751
- used: number;
752
- limit: number;
753
- };
754
- budget_reset_at?: number | null | undefined;
755
- };
756
- daily_cap_per_user?: number | null | undefined;
757
- price_id?: string | null | undefined;
758
- plan?: string | null | undefined;
759
- amount?: number | null | undefined;
760
- currency?: string | null | undefined;
761
- current_period_end?: number | null | undefined;
762
- cancel_at_period_end?: boolean | null | undefined;
763
- portal_url?: string | null | undefined;
764
- }>;
765
- declare function refreshProject(arbi: ArbiClient, projectExtId: string): Promise<{
766
- external_id: string;
767
- name: string;
768
- created_by: string;
769
- packs: number;
770
- subscription: string;
771
- created_at: string;
772
- quotas: {
773
- storage_gb: {
774
- used: number;
775
- limit: number;
776
- };
777
- ai_credits: {
778
- used: number;
779
- limit: number;
780
- };
781
- collaborators: {
782
- used: number;
783
- limit: number;
784
- };
785
- budget_reset_at?: number | null | undefined;
786
- };
787
- daily_cap_per_user?: number | null | undefined;
788
- price_id?: string | null | undefined;
789
- plan?: string | null | undefined;
790
- amount?: number | null | undefined;
791
- currency?: string | null | undefined;
792
- current_period_end?: number | null | undefined;
793
- cancel_at_period_end?: boolean | null | undefined;
794
- portal_url?: string | null | undefined;
795
- }>;
796
-
797
- declare const projects_createProject: typeof createProject;
798
- declare const projects_listProjects: typeof listProjects;
799
- declare const projects_refreshProject: typeof refreshProject;
800
- declare namespace projects {
801
- export { projects_createProject as createProject, projects_listProjects as listProjects, projects_refreshProject as refreshProject };
802
- }
803
-
804
699
  /**
805
700
  * Orchestrator interface for `arbi listen`.
806
701
  *
@@ -978,4 +873,4 @@ declare namespace index {
978
873
  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 };
979
874
  }
980
875
 
981
- export { AuthHeaders, ChatSession, ClaudeOrchestrator, type ClaudeOrchestratorOptions, CliConfig, CliCredentials, ConfigStore, DmCryptoContext, type DmListener, type DmListenerOptions, FileConfigStore, OpenClawOrchestrator, type OpenClawOrchestratorOptions, type Orchestrator, type PromptContext, agents, deviceFlow, documentsNode, index as listen, projects, sessions, startDmListener };
876
+ export { AuthHeaders, ChatSession, ClaudeOrchestrator, type ClaudeOrchestratorOptions, CliConfig, CliCredentials, ConfigStore, DmCryptoContext, type DmListener, type DmListenerOptions, FileConfigStore, OpenClawOrchestrator, type OpenClawOrchestratorOptions, type Orchestrator, type PromptContext, agents, deviceFlow, documentsNode, index as listen, sessions, startDmListener };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { o as ConfigStore, l as CliConfig, m as CliCredentials, C as ChatSession, a3 as SkippedFile, ab as UploadResult, i as AuthHeaders, a7 as UploadBatchResult, aa as UploadOptions, a8 as UploadDirectOptions, a9 as UploadDirectResult, a1 as SUPPORTED_EXTENSIONS, s as DmCryptoContext } from './browser-B5b3SDW6.js';
2
- export { a as AgentStepEvent, b as Arbi, c as ArbiApiError, d as ArbiError, f as ArbiOptions, g as ArtifactEvent, h as AuthContext, j as AuthenticatedClient, k as CitationSummary, n as CommandDescriptor, p as ConnectOptions, D as DOC_TERMINAL_STATUSES, t as DocNameMap, u as DocumentListFields, v as DocumentListOrder, w as DocumentWaiter, x as DocumentWaiterOptions, F as FormattedWsMessage, L as ListAllOptions, y as ListPaginatedOptions, E as MessageLevel, G as MessageMetadataPayload, H as MessageQueuedEvent, O as OutputTokensDetails, P as ParsedSlashCommand, Q as QueryOptions, R as ReconnectOptions, I as ReconnectableWsConnection, J as ResolvedCitation, K as ResponseCompletedEvent, N as ResponseContentPartAddedEvent, S as ResponseCreatedEvent, T as ResponseFailedEvent, U as ResponseOutputItemAddedEvent, V as ResponseOutputItemDoneEvent, W as ResponseOutputTextDeltaEvent, X as ResponseOutputTextDoneEvent, Y as ResponseUsage, Z as SSEEvent, _ as SSEStreamCallbacks, $ as SSEStreamResult, a0 as SSEStreamStartData, a2 as SkillSummary, ac as UserInfo, ad as UserInputRequestEvent, ae as UserMessageEvent, af as WebSocketAuthError, ag as WorkspaceContext, ah as WsConnection, ai as agentconfig, aj as assistant, ak as authenticatedFetch, al as buildRetrievalChunkTool, am as buildRetrievalFullContextTool, an as buildRetrievalTocTool, ao as connectWebSocket, ap as connectWithReconnect, aq as consumeSSEStream, ar as contacts, as as conversations, at as countCitations, au as createAuthenticatedClient, av as createDocumentWaiter, aw as dm, ax as doctags, ay as documents, az as files, aA as filterSkills, aB as formatAgentStepLabel, aC as formatFileSize, aD as formatStreamSummary, aE as formatUserName, aF as formatWorkspaceChoices, aG as formatWsMessage, aH as generateEncryptedWorkspaceKey, aI as generateNewWorkspaceKey, aJ as getErrorCode, aK as getErrorMessage, aL as getRawWorkspaceKey, aM as health, aO as parseSSEEvents, aP as parseSlashCommand, aQ as parseSlashTokenInProgress, aR as performPasswordLogin, aS as performSigningKeyLogin, aT as performSsoDeviceFlowLogin, aU as requireData, aV as requireOk, aW as resolveAuth, aX as resolveCitations, aY as resolveWorkspace, aZ as responses, a_ as selectWorkspace, a$ as selectWorkspaceById, b0 as settings, b1 as streamSSE, b2 as stripCitationMarkdown, b3 as summarizeCitations, b4 as tags, b6 as workspaces } from './browser-B5b3SDW6.js';
1
+ import { o as ConfigStore, l as CliConfig, m as CliCredentials, C as ChatSession, a6 as SkippedFile, ae as UploadResult, i as AuthHeaders, aa as UploadBatchResult, ad as UploadOptions, ab as UploadDirectOptions, ac as UploadDirectResult, a4 as SUPPORTED_EXTENSIONS, s as DmCryptoContext } from './browser-CxTSIAhf.js';
2
+ export { a as AgentStepEvent, b as Arbi, c as ArbiApiError, d as ArbiError, f as ArbiOptions, g as ArtifactEvent, h as AuthContext, j as AuthenticatedClient, k as CitationSummary, n as CommandDescriptor, p as ConnectOptions, D as DOC_TERMINAL_STATUSES, t as DocNameMap, u as DocumentListFields, v as DocumentListOrder, w as DocumentWaiter, x as DocumentWaiterOptions, F as FormattedWsMessage, L as ListAllOptions, y as ListPaginatedOptions, E as MessageLevel, G as MessageMetadataPayload, H as MessageQueuedEvent, O as OutputTokensDetails, P as ParsedSlashCommand, I as ProjectInvoicesResponse, J as ProjectUsageResponse, Q as QueryOptions, R as ReconnectOptions, K as ReconnectableWsConnection, N as ResolvedCitation, S as ResolvedRecipient, T as ResponseCompletedEvent, U as ResponseContentPartAddedEvent, V as ResponseCreatedEvent, W as ResponseFailedEvent, X as ResponseOutputItemAddedEvent, Y as ResponseOutputItemDoneEvent, Z as ResponseOutputTextDeltaEvent, _ as ResponseOutputTextDoneEvent, $ as ResponseUsage, a0 as SSEEvent, a1 as SSEStreamCallbacks, a2 as SSEStreamResult, a3 as SSEStreamStartData, a5 as SkillSummary, af as UserDailyUsageResponse, ag as UserInfo, ah as UserInputRequestEvent, ai as UserMessageEvent, aj as WebSocketAuthError, ak as WorkspaceChronologyOut, al as WorkspaceContext, am as WsConnection, an as agentconfig, ao as assistant, ap as authenticatedFetch, aq as buildRetrievalChunkTool, ar as buildRetrievalFullContextTool, as as buildRetrievalTocTool, at as connectWebSocket, au as connectWithReconnect, av as consumeSSEStream, aw as contacts, ax as conversations, ay as countCitations, az as createAuthenticatedClient, aA as createDocumentWaiter, aB as dm, aC as doctags, aD as documents, aE as files, aF as filterSkills, aG as formatAgentStepLabel, aH as formatFileSize, aI as formatStreamSummary, aJ as formatUserName, aK as formatWorkspaceChoices, aL as formatWsMessage, aM as generateEncryptedWorkspaceKey, aN as generateNewWorkspaceKey, aO as getErrorCode, aP as getErrorMessage, aQ as getRawWorkspaceKey, aR as health, aT as parseSSEEvents, aU as parseSlashCommand, aV as parseSlashTokenInProgress, aW as performPasswordLogin, aX as performSigningKeyLogin, aY as performSsoDeviceFlowLogin, aZ as projects, a_ as requireData, a$ as requireOk, b0 as resolveAuth, b1 as resolveCitations, b2 as resolveWorkspace, b3 as responses, b4 as selectWorkspace, b5 as selectWorkspaceById, b6 as settings, b7 as streamSSE, b8 as stripCitationMarkdown, b9 as summarizeCitations, ba as tags, bc as workspaces } from './browser-CxTSIAhf.js';
3
3
  import { SessionStorageProvider, ArbiClient, components } from '@arbidocs/client';
4
4
 
5
5
  /**
@@ -696,111 +696,6 @@ declare namespace sessions {
696
696
  export { sessions_listSessions as listSessions };
697
697
  }
698
698
 
699
- /**
700
- * Project operations — list, create, update, delete, checkout, refresh.
701
- */
702
-
703
- declare function listProjects(arbi: ArbiClient): Promise<{
704
- external_id: string;
705
- name: string;
706
- created_by: string;
707
- packs: number;
708
- subscription: string;
709
- created_at: string;
710
- quotas: {
711
- storage_gb: {
712
- used: number;
713
- limit: number;
714
- };
715
- ai_credits: {
716
- used: number;
717
- limit: number;
718
- };
719
- collaborators: {
720
- used: number;
721
- limit: number;
722
- };
723
- budget_reset_at?: number | null | undefined;
724
- };
725
- daily_cap_per_user?: number | null | undefined;
726
- price_id?: string | null | undefined;
727
- plan?: string | null | undefined;
728
- amount?: number | null | undefined;
729
- currency?: string | null | undefined;
730
- current_period_end?: number | null | undefined;
731
- cancel_at_period_end?: boolean | null | undefined;
732
- portal_url?: string | null | undefined;
733
- }[]>;
734
- declare function createProject(arbi: ArbiClient, name: string): Promise<{
735
- external_id: string;
736
- name: string;
737
- created_by: string;
738
- packs: number;
739
- subscription: string;
740
- created_at: string;
741
- quotas: {
742
- storage_gb: {
743
- used: number;
744
- limit: number;
745
- };
746
- ai_credits: {
747
- used: number;
748
- limit: number;
749
- };
750
- collaborators: {
751
- used: number;
752
- limit: number;
753
- };
754
- budget_reset_at?: number | null | undefined;
755
- };
756
- daily_cap_per_user?: number | null | undefined;
757
- price_id?: string | null | undefined;
758
- plan?: string | null | undefined;
759
- amount?: number | null | undefined;
760
- currency?: string | null | undefined;
761
- current_period_end?: number | null | undefined;
762
- cancel_at_period_end?: boolean | null | undefined;
763
- portal_url?: string | null | undefined;
764
- }>;
765
- declare function refreshProject(arbi: ArbiClient, projectExtId: string): Promise<{
766
- external_id: string;
767
- name: string;
768
- created_by: string;
769
- packs: number;
770
- subscription: string;
771
- created_at: string;
772
- quotas: {
773
- storage_gb: {
774
- used: number;
775
- limit: number;
776
- };
777
- ai_credits: {
778
- used: number;
779
- limit: number;
780
- };
781
- collaborators: {
782
- used: number;
783
- limit: number;
784
- };
785
- budget_reset_at?: number | null | undefined;
786
- };
787
- daily_cap_per_user?: number | null | undefined;
788
- price_id?: string | null | undefined;
789
- plan?: string | null | undefined;
790
- amount?: number | null | undefined;
791
- currency?: string | null | undefined;
792
- current_period_end?: number | null | undefined;
793
- cancel_at_period_end?: boolean | null | undefined;
794
- portal_url?: string | null | undefined;
795
- }>;
796
-
797
- declare const projects_createProject: typeof createProject;
798
- declare const projects_listProjects: typeof listProjects;
799
- declare const projects_refreshProject: typeof refreshProject;
800
- declare namespace projects {
801
- export { projects_createProject as createProject, projects_listProjects as listProjects, projects_refreshProject as refreshProject };
802
- }
803
-
804
699
  /**
805
700
  * Orchestrator interface for `arbi listen`.
806
701
  *
@@ -978,4 +873,4 @@ declare namespace index {
978
873
  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 };
979
874
  }
980
875
 
981
- export { AuthHeaders, ChatSession, ClaudeOrchestrator, type ClaudeOrchestratorOptions, CliConfig, CliCredentials, ConfigStore, DmCryptoContext, type DmListener, type DmListenerOptions, FileConfigStore, OpenClawOrchestrator, type OpenClawOrchestratorOptions, type Orchestrator, type PromptContext, agents, deviceFlow, documentsNode, index as listen, projects, sessions, startDmListener };
876
+ export { AuthHeaders, ChatSession, ClaudeOrchestrator, type ClaudeOrchestratorOptions, CliConfig, CliCredentials, ConfigStore, DmCryptoContext, type DmListener, type DmListenerOptions, FileConfigStore, OpenClawOrchestrator, type OpenClawOrchestratorOptions, type Orchestrator, type PromptContext, agents, deviceFlow, documentsNode, index as listen, sessions, startDmListener };
package/dist/index.js CHANGED
@@ -5178,6 +5178,7 @@ __export(workspaces_exports, {
5178
5178
  copyDocuments: () => copyDocuments,
5179
5179
  createWorkspace: () => createWorkspace,
5180
5180
  deleteWorkspaces: () => deleteWorkspaces,
5181
+ getWorkspaceChronology: () => getWorkspaceChronology,
5181
5182
  listWorkspaceUsers: () => listWorkspaceUsers,
5182
5183
  listWorkspaces: () => listWorkspaces,
5183
5184
  removeWorkspaceUsers: () => removeWorkspaceUsers,
@@ -5242,6 +5243,14 @@ async function setUserRole(arbi, userIds, role) {
5242
5243
  "Failed to update roles"
5243
5244
  );
5244
5245
  }
5246
+ async function getWorkspaceChronology(arbi, workspaceId) {
5247
+ return requireData(
5248
+ await arbi.fetch.GET("/v1/workspace/{workspace_ext_id}/chronology", {
5249
+ params: { path: { workspace_ext_id: workspaceId } }
5250
+ }),
5251
+ "Failed to fetch workspace chronology"
5252
+ );
5253
+ }
5245
5254
  async function copyDocuments(arbi, targetWorkspaceId, docIds, targetWorkspaceKey) {
5246
5255
  return requireData(
5247
5256
  await arbi.fetch.POST("/v1/workspace/copy", {
@@ -5606,13 +5615,58 @@ __export(dm_exports, {
5606
5615
  decryptDmContent: () => decryptDmContent,
5607
5616
  deleteDMs: () => deleteDMs,
5608
5617
  encryptDmContent: () => encryptDmContent,
5618
+ listActivity: () => listActivity,
5609
5619
  listDMs: () => listDMs,
5610
5620
  listDecryptedDMs: () => listDecryptedDMs,
5611
5621
  markRead: () => markRead,
5612
5622
  requestWorkspaceAccess: () => requestWorkspaceAccess,
5623
+ resolveRecipient: () => resolveRecipient,
5613
5624
  sendDM: () => sendDM,
5614
5625
  sendEncryptedDM: () => sendEncryptedDM
5615
5626
  });
5627
+
5628
+ // src/operations/agents.ts
5629
+ var agents_exports = {};
5630
+ __export(agents_exports, {
5631
+ createAgent: () => createAgent,
5632
+ deleteAgents: () => deleteAgents,
5633
+ getAgentConfig: () => getAgentConfig,
5634
+ listAgentWorkspaces: () => listAgentWorkspaces,
5635
+ listAgents: () => listAgents
5636
+ });
5637
+ async function listAgents(arbi) {
5638
+ return requireData(await arbi.fetch.GET("/v1/agents"), "Failed to fetch agents");
5639
+ }
5640
+ async function createAgent(arbi, name) {
5641
+ const body = { name };
5642
+ return requireData(await arbi.fetch.POST("/v1/agents", { body }), "Failed to create agent");
5643
+ }
5644
+ async function getAgentConfig(arbi, agentExtId) {
5645
+ return requireData(
5646
+ await arbi.fetch.GET("/v1/agents/{agent_ext_id}/config", {
5647
+ params: { path: { agent_ext_id: agentExtId } }
5648
+ }),
5649
+ "Failed to fetch agent config"
5650
+ );
5651
+ }
5652
+ async function listAgentWorkspaces(arbi, agentExtId) {
5653
+ return requireData(
5654
+ await arbi.fetch.GET("/v1/agents/{agent_ext_id}/workspaces", {
5655
+ params: { path: { agent_ext_id: agentExtId } }
5656
+ }),
5657
+ "Failed to fetch agent workspaces"
5658
+ );
5659
+ }
5660
+ async function deleteAgents(arbi, agentExtIds) {
5661
+ return requireData(
5662
+ await arbi.fetch.DELETE("/v1/agents", {
5663
+ body: { agent_ext_ids: agentExtIds }
5664
+ }),
5665
+ "Failed to delete agents"
5666
+ );
5667
+ }
5668
+
5669
+ // src/operations/dm.ts
5616
5670
  function createDmCryptoContext(arbi, signingPrivateKeyBytes, userExtId) {
5617
5671
  const ed25519PublicKey = signingPrivateKeyBytes.slice(32, 64);
5618
5672
  const encryptionKeypair = arbi.crypto.deriveEncryptionKeypairFromSigning({
@@ -5661,6 +5715,51 @@ async function listDecryptedDMs(arbi, crypto) {
5661
5715
  const raw = await listDMs(arbi);
5662
5716
  return decryptDmBatch(arbi, raw, crypto);
5663
5717
  }
5718
+ async function listActivity(arbi, options) {
5719
+ return requireData(
5720
+ await arbi.fetch.GET("/v1/notifications/", {
5721
+ params: {
5722
+ query: {
5723
+ type: "activity",
5724
+ ...options?.limit != null ? { limit: options.limit } : {},
5725
+ ...options?.offset != null ? { offset: options.offset } : {}
5726
+ }
5727
+ }
5728
+ }),
5729
+ "Failed to fetch activity"
5730
+ );
5731
+ }
5732
+ async function resolveRecipient(arbi, ref) {
5733
+ const isEmail = ref.includes("@");
5734
+ const matchKey = isEmail ? "email" : "external_id";
5735
+ const contacts = await listContacts(arbi);
5736
+ const contactMatch = contacts.find(
5737
+ (c2) => isEmail ? c2.email === ref : c2.user?.external_id === ref || c2.external_id === ref
5738
+ );
5739
+ if (contactMatch?.user?.encryption_public_key) {
5740
+ return {
5741
+ extId: contactMatch.user.external_id,
5742
+ pubKey: contactMatch.user.encryption_public_key
5743
+ };
5744
+ }
5745
+ try {
5746
+ const agents = await listAgents(arbi);
5747
+ const agentMatch = agents.find((a2) => a2[matchKey] === ref);
5748
+ if (agentMatch?.encryption_public_key) {
5749
+ return { extId: agentMatch.external_id, pubKey: agentMatch.encryption_public_key };
5750
+ }
5751
+ } catch {
5752
+ }
5753
+ try {
5754
+ const wsUsers = await listWorkspaceUsers(arbi);
5755
+ const wsMatch = wsUsers.find((wu) => wu.user[matchKey] === ref);
5756
+ if (wsMatch?.user.encryption_public_key) {
5757
+ return { extId: wsMatch.user.external_id, pubKey: wsMatch.user.encryption_public_key };
5758
+ }
5759
+ } catch {
5760
+ }
5761
+ return null;
5762
+ }
5664
5763
  async function sendEncryptedDM(arbi, messages, crypto) {
5665
5764
  const encrypted = await Promise.all(
5666
5765
  messages.map(async (msg) => ({
@@ -5857,47 +5956,6 @@ async function getFileContent(auth, fileId) {
5857
5956
  });
5858
5957
  }
5859
5958
 
5860
- // src/operations/agents.ts
5861
- var agents_exports = {};
5862
- __export(agents_exports, {
5863
- createAgent: () => createAgent,
5864
- deleteAgents: () => deleteAgents,
5865
- getAgentConfig: () => getAgentConfig,
5866
- listAgentWorkspaces: () => listAgentWorkspaces,
5867
- listAgents: () => listAgents
5868
- });
5869
- async function listAgents(arbi) {
5870
- return requireData(await arbi.fetch.GET("/v1/agents"), "Failed to fetch agents");
5871
- }
5872
- async function createAgent(arbi, name) {
5873
- const body = { name };
5874
- return requireData(await arbi.fetch.POST("/v1/agents", { body }), "Failed to create agent");
5875
- }
5876
- async function getAgentConfig(arbi, agentExtId) {
5877
- return requireData(
5878
- await arbi.fetch.GET("/v1/agents/{agent_ext_id}/config", {
5879
- params: { path: { agent_ext_id: agentExtId } }
5880
- }),
5881
- "Failed to fetch agent config"
5882
- );
5883
- }
5884
- async function listAgentWorkspaces(arbi, agentExtId) {
5885
- return requireData(
5886
- await arbi.fetch.GET("/v1/agents/{agent_ext_id}/workspaces", {
5887
- params: { path: { agent_ext_id: agentExtId } }
5888
- }),
5889
- "Failed to fetch agent workspaces"
5890
- );
5891
- }
5892
- async function deleteAgents(arbi, agentExtIds) {
5893
- return requireData(
5894
- await arbi.fetch.DELETE("/v1/agents", {
5895
- body: { agent_ext_ids: agentExtIds }
5896
- }),
5897
- "Failed to delete agents"
5898
- );
5899
- }
5900
-
5901
5959
  // src/operations/sessions.ts
5902
5960
  var sessions_exports = {};
5903
5961
  __export(sessions_exports, {
@@ -5911,6 +5969,9 @@ async function listSessions(arbi) {
5911
5969
  var projects_exports = {};
5912
5970
  __export(projects_exports, {
5913
5971
  createProject: () => createProject,
5972
+ getProjectInvoices: () => getProjectInvoices,
5973
+ getProjectUsage: () => getProjectUsage,
5974
+ getUserUsageToday: () => getUserUsageToday,
5914
5975
  listProjects: () => listProjects,
5915
5976
  refreshProject: () => refreshProject
5916
5977
  });
@@ -5933,6 +5994,28 @@ async function refreshProject(arbi, projectExtId) {
5933
5994
  "Failed to refresh project"
5934
5995
  );
5935
5996
  }
5997
+ async function getProjectUsage(arbi, projectExtId, monthsBack) {
5998
+ return requireData(
5999
+ await arbi.fetch.GET("/v1/user/projects/{project_ext_id}/usage", {
6000
+ params: {
6001
+ path: { project_ext_id: projectExtId },
6002
+ query: monthsBack === void 0 ? void 0 : { months_back: monthsBack }
6003
+ }
6004
+ }),
6005
+ "Failed to fetch project usage"
6006
+ );
6007
+ }
6008
+ async function getProjectInvoices(arbi, projectExtId) {
6009
+ return requireData(
6010
+ await arbi.fetch.GET("/v1/user/projects/{project_ext_id}/invoices", {
6011
+ params: { path: { project_ext_id: projectExtId } }
6012
+ }),
6013
+ "Failed to fetch project invoices"
6014
+ );
6015
+ }
6016
+ async function getUserUsageToday(arbi) {
6017
+ return requireData(await arbi.fetch.GET("/v1/user/me/usage/today"), "Failed to fetch today usage");
6018
+ }
5936
6019
 
5937
6020
  // src/operations/tasks.ts
5938
6021
  async function listTasks(arbi) {
@@ -6008,6 +6091,7 @@ var Arbi = class {
6008
6091
  client = null;
6009
6092
  loginResult = null;
6010
6093
  currentWorkspaceId = null;
6094
+ dmCryptoContext = null;
6011
6095
  options;
6012
6096
  constructor(options) {
6013
6097
  this.options = options;
@@ -6094,6 +6178,7 @@ var Arbi = class {
6094
6178
  }
6095
6179
  this.loginResult = null;
6096
6180
  this.currentWorkspaceId = null;
6181
+ this.dmCryptoContext = null;
6097
6182
  }
6098
6183
  // ── Accessors ─────────────────────────────────────────────────────────
6099
6184
  /** Get the underlying ArbiClient (throws if not initialized). */
@@ -6141,7 +6226,26 @@ var Arbi = class {
6141
6226
  projects = {
6142
6227
  list: () => listProjects(this.requireClient()),
6143
6228
  create: (name) => createProject(this.requireClient(), name),
6144
- refresh: (projectExtId) => refreshProject(this.requireClient(), projectExtId)
6229
+ refresh: (projectExtId) => refreshProject(this.requireClient(), projectExtId),
6230
+ /** AI usage + spend breakdown for a project's billing period. */
6231
+ usage: (projectExtId, monthsBack) => getProjectUsage(this.requireClient(), projectExtId, monthsBack),
6232
+ /** Stripe invoices for a project's subscription. */
6233
+ invoices: (projectExtId) => getProjectInvoices(this.requireClient(), projectExtId)
6234
+ };
6235
+ // ── User (account-scoped usage) ───────────────────────────────────────
6236
+ user = {
6237
+ /**
6238
+ * The authenticated user's identity from the current session
6239
+ * (`external_id` + `email`), established at login. Returns `null` when not
6240
+ * logged in. This is the canonical "who am I" accessor — DM direction and
6241
+ * ownership checks read it instead of re-deriving identity per call.
6242
+ */
6243
+ identity: () => {
6244
+ const state = this.requireClient().session.getState();
6245
+ return state.userExtId && state.userEmail ? { externalId: state.userExtId, email: state.userEmail } : null;
6246
+ },
6247
+ /** Today's deployment-wide credit spend for the current user. */
6248
+ usageToday: () => getUserUsageToday(this.requireClient())
6145
6249
  };
6146
6250
  // ── Workspaces ────────────────────────────────────────────────────────
6147
6251
  workspaces = {
@@ -6189,6 +6293,14 @@ var Arbi = class {
6189
6293
  targetWorkspaceId,
6190
6294
  docIds,
6191
6295
  targetWorkspaceKey
6296
+ ),
6297
+ /**
6298
+ * The last-generated document-derived chronology (key case events / dates).
6299
+ * Defaults to the currently open workspace when no id is passed.
6300
+ */
6301
+ chronology: (workspaceId) => getWorkspaceChronology(
6302
+ this.requireClient(),
6303
+ workspaceId ?? this.requireWorkspace()
6192
6304
  )
6193
6305
  };
6194
6306
  // ── Documents ─────────────────────────────────────────────────────────
@@ -6315,11 +6427,80 @@ var Arbi = class {
6315
6427
  groupByStatus: groupContactsByStatus
6316
6428
  };
6317
6429
  // ── Direct Messages ───────────────────────────────────────────────────
6430
+ /**
6431
+ * Build (and cache) the DM crypto context for the current session.
6432
+ *
6433
+ * Derives the user's curve25519 keypair from the stored signing key and pairs
6434
+ * it with their external_id — everything `list()`/`send()` need to encrypt and
6435
+ * decrypt. Cached for the session and cleared on logout. Consumers never touch
6436
+ * this: it's an internal of the `dm` surface.
6437
+ */
6438
+ async requireDmCrypto() {
6439
+ if (this.dmCryptoContext) return this.dmCryptoContext;
6440
+ const client = this.requireClient();
6441
+ const session = await client.storage.getSession();
6442
+ if (!session) {
6443
+ throw new ArbiError("Not authenticated \u2014 no session available for DM encryption");
6444
+ }
6445
+ const userExtId = client.session.getState().userExtId;
6446
+ if (!userExtId) {
6447
+ throw new ArbiError("No user identity in session \u2014 cannot set up DM encryption");
6448
+ }
6449
+ this.dmCryptoContext = createDmCryptoContext(client, session.signingPrivateKey, userExtId);
6450
+ return this.dmCryptoContext;
6451
+ }
6318
6452
  dm = {
6319
- list: () => listDMs(this.requireClient()),
6320
- send: (messages) => sendDM(this.requireClient(), messages),
6453
+ /**
6454
+ * List direct messages, newest first, with content already **decrypted**.
6455
+ * (A message that can't be decrypted comes back as `[Decryption failed]`.)
6456
+ */
6457
+ list: async () => listDecryptedDMs(this.requireClient(), await this.requireDmCrypto()),
6458
+ /**
6459
+ * Send an E2E-encrypted DM to a recipient (email or `usr-`/`agt-` id).
6460
+ * Resolves the recipient's public key and encrypts internally — the caller
6461
+ * passes plaintext and never handles keys or ciphertext.
6462
+ */
6463
+ send: async (recipient, text) => {
6464
+ const client = this.requireClient();
6465
+ const resolved = await resolveRecipient(client, recipient);
6466
+ if (!resolved) {
6467
+ throw new ArbiError(
6468
+ `Could not resolve DM recipient "${recipient}" (not a known contact, agent, or workspace member)`
6469
+ );
6470
+ }
6471
+ return sendEncryptedDM(
6472
+ client,
6473
+ [
6474
+ {
6475
+ recipient_ext_id: resolved.extId,
6476
+ content: text,
6477
+ recipient_encryption_public_key: resolved.pubKey
6478
+ }
6479
+ ],
6480
+ await this.requireDmCrypto()
6481
+ );
6482
+ },
6483
+ /**
6484
+ * Send to a recipient whose external_id + public key are already known
6485
+ * (e.g. from a message's `sender`), skipping directory resolution.
6486
+ */
6487
+ sendTo: async (recipientExtId, recipientPublicKey, text) => sendEncryptedDM(
6488
+ this.requireClient(),
6489
+ [
6490
+ {
6491
+ recipient_ext_id: recipientExtId,
6492
+ content: text,
6493
+ recipient_encryption_public_key: recipientPublicKey
6494
+ }
6495
+ ],
6496
+ await this.requireDmCrypto()
6497
+ ),
6498
+ /** Resolve a recipient reference to `{ extId, pubKey }` (contacts → agents → workspace). */
6499
+ resolveRecipient: (recipient) => resolveRecipient(this.requireClient(), recipient),
6321
6500
  markRead: (messageIds) => markRead(this.requireClient(), messageIds),
6322
- delete: (messageIds) => deleteDMs(this.requireClient(), messageIds)
6501
+ delete: (messageIds) => deleteDMs(this.requireClient(), messageIds),
6502
+ /** List the current user's durable activity feed (never unread; excluded from DMs). */
6503
+ listActivity: (options) => listActivity(this.requireClient(), options)
6323
6504
  };
6324
6505
  // ── Settings ──────────────────────────────────────────────────────────
6325
6506
  settings = {