@arbidocs/sdk 0.4.104 → 0.4.106

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 { t as ConfigStore, q as CliConfig, r as CliCredentials, C as ChatSession, aJ as SkippedFile, bd as UploadResult, m as AuthHeaders, b9 as UploadBatchResult, bc as UploadOptions, ba as UploadDirectOptions, bb as UploadDirectResult, aG as SUPPORTED_EXTENSIONS, a0 as MailAttachment, I as DmCryptoContext } from './browser-9CxXW_cZ.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 DOC_TERMINAL_STATUSES, E as DecryptedDmNotification, G as DmAttachmentFile, H as DmAttachmentInput, J as DocNameMap, K as DocumentAutomationAction, L as DocumentListFields, M as DocumentListOrder, N as DocumentSelector, O as DocumentWaiter, P as DocumentWaiterOptions, T as FormattedWsMessage, U as IdentityErrorCode, V as IdentityPurchase, W as IdentityState, X as IdentityStatus, Y as LinkedRun, Z as ListAllOptions, $ as ListPaginatedOptions, a1 as MessageLevel, a2 as MessageMetadataPayload, a3 as MessageQueuedEvent, a4 as OutputTokensDetails, a5 as ParsedSlashCommand, a6 as PendingAuthResponse, a7 as PlanStepsError, a8 as PlanWorkRequest, aa as ProjectBudget, ab as ProjectConversationUsageResponse, ac as ProjectDetails, ad as ProjectEventKind, ae as ProjectEventResponse, af as ProjectInvoicesResponse, ag as ProjectResponse, ah as ProjectUpdateRequest, ai as ProjectUsageResponse, aj as QueryOptions, ak as RaisedSignal, al as ReconnectOptions, am as ReconnectableWsConnection, an as ResolvedCitation, ao as ResolvedRecipient, ap as ResponseCompletedEvent, aq as ResponseContentPartAddedEvent, ar as ResponseCreatedEvent, as as ResponseFailedEvent, at as ResponseOutputItemAddedEvent, au as ResponseOutputItemDoneEvent, av as ResponseOutputTextDeltaEvent, aw as ResponseOutputTextDoneEvent, ax as ResponseUsage, ay as RunProgress, az as RunStep, aA as RunWaitingOn, aB as SSEEvent, aC as SSEStreamCallbacks, aD as SSEStreamResult, aE as SSEStreamStartData, aF as STEP_FIELD_OPTION_TONES, aH as SendBack, aI as SkillSummary, aK as StepActionRequest, aL as StepActivityEvent, aM as StepAssignee, aN as StepField, aO as StepFieldOption, aP as StepFieldOptionTone, aQ as StepKind, aR as StepPhase, aS as StepSignal, aT as StepSignalWhen, aU as StepState, aV as StepStatus, aW as SubmitBackgroundQueryOptions, aX as TagChange, aY as TagFieldDefinition, aZ as TagKind, a_ as TagKindField, a$ as TagKindSchema, b0 as TagLinks, b1 as TagListQuery, b2 as TagResponse, b3 as TaskPlan, b4 as TaskPlanStep, b5 as TokenBudgetContext, b6 as UpdateConversationRequest, b8 as UpdateWorkflowRequest, be as UsageBreakdown, bf as UserDailyUsageResponse, bg as UserInfo, bh as UserInputRequestEvent, bi as UserMessageEvent, bj as WebSocketAuthError, bk as WorkStatus, bl as WorkflowAuthMode, bm as WorkflowResponse, bn as WorkflowRunHistoryResponse, bo as WorkflowRunResponse, bp as WorkspaceContext, bq as WsConnection, br as account, bs as agentconfig, bt as agents, bu as assistant, bv as authenticatedFetch, bw as buildDocNameMap, bx as buildFactsContextTool, by as buildRetrievalChunkTool, bz as buildRetrievalFullContextTool, bA as buildRetrievalTocTool, bB as connectWebSocket, bC as connectWithReconnect, bD as consumeSSEStream, bE as contacts, bF as conversations, bG as countCitations, bH as createAuthenticatedClient, bI as createDocumentWaiter, bJ as dm, bK as doctags, bL as documents, bM as facts, bN as files, bO as filterSkills, bP as formatAgentStepLabel, bQ as formatFileSize, bR as formatItemLabel, bS as formatStreamSummary, bT as formatUserName, bU as formatWorkspaceChoices, bV as formatWsMessage, bW as generateEncryptedWorkspaceKey, bX as generateNewWorkspaceKey, bY as getErrorCode, bZ as getErrorMessage, b_ as getRawWorkspaceKey, b$ as health, c1 as identityErrorCode, c0 as identityVerification, c2 as mail, c3 as parseSSEEvents, c4 as parseSlashCommand, c5 as parseSlashTokenInProgress, c6 as performPasswordLogin, c7 as performSigningKeyLogin, c8 as performSsoDeviceFlowLogin, c9 as profile, ca as projects, cb as requireData, cc as requireOk, cd as resolveAuth, ce as resolveCitations, cf as resolveWorkspace, cg as responses, ch as selectWorkspace, ci as selectWorkspaceById, cj as sessions, ck as settings, cl as signatureRequests, cm as streamSSE, cn as stripCitationMarkdown, co as summarizeCitations, cp as tags, cq as work, cr as workflowSteps, cs as workflows, ct as workspaces } from './browser-9CxXW_cZ.cjs';
1
+ import { t as ConfigStore, q as CliConfig, r as CliCredentials, C as ChatSession, aK as SkippedFile, be as UploadResult, m as AuthHeaders, ba as UploadBatchResult, bd as UploadOptions, bb as UploadDirectOptions, bc as UploadDirectResult, aH as SUPPORTED_EXTENSIONS, a1 as MailAttachment, J as DmCryptoContext } from './browser-CxWTmtEq.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 MessageLevel, a3 as MessageMetadataPayload, a4 as MessageQueuedEvent, a5 as OutputTokensDetails, a6 as ParsedSlashCommand, a7 as PendingAuthResponse, a8 as PlanStepsError, a9 as PlanWorkRequest, ab as ProjectBudget, ac as ProjectConversationUsageResponse, ad as ProjectDetails, ae as ProjectEventKind, af as ProjectEventResponse, ag as ProjectInvoicesResponse, ah as ProjectResponse, ai as ProjectUpdateRequest, aj as ProjectUsageResponse, ak as QueryOptions, al as RaisedSignal, am as ReconnectOptions, an as ReconnectableWsConnection, ao as ResolvedCitation, ap as ResolvedRecipient, aq as ResponseCompletedEvent, ar as ResponseContentPartAddedEvent, as as ResponseCreatedEvent, at as ResponseFailedEvent, au as ResponseOutputItemAddedEvent, av as ResponseOutputItemDoneEvent, aw as ResponseOutputTextDeltaEvent, ax as ResponseOutputTextDoneEvent, ay as ResponseUsage, az as RunProgress, aA as RunStep, aB as RunWaitingOn, aC as SSEEvent, aD as SSEStreamCallbacks, aE as SSEStreamResult, aF as SSEStreamStartData, aG as STEP_FIELD_OPTION_TONES, aI as SendBack, aJ as SkillSummary, aL as StepActionRequest, aM as StepActivityEvent, aN as StepAssignee, aO as StepField, aP as StepFieldOption, aQ as StepFieldOptionTone, aR as StepKind, aS as StepPhase, aT as StepSignal, aU as StepSignalWhen, aV as StepState, aW as StepStatus, aX as SubmitBackgroundQueryOptions, aY as TagChange, aZ as TagFieldDefinition, a_ as TagKind, a$ as TagKindField, b0 as TagKindSchema, b1 as TagLinks, b2 as TagListQuery, b3 as TagResponse, b4 as TaskPlan, b5 as TaskPlanStep, b6 as TokenBudgetContext, b7 as UpdateConversationRequest, b9 as UpdateWorkflowRequest, bf as UsageBreakdown, bg as UserDailyUsageResponse, bh as UserInfo, bi as UserInputRequestEvent, bj as UserMessageEvent, bk as WebSocketAuthError, bl as WorkStatus, bm as WorkflowAuthMode, bn as WorkflowResponse, bo as WorkflowRunHistoryResponse, bp as WorkflowRunResponse, bq as WorkspaceContext, br as WsConnection, bs as account, bt as agentconfig, bu as agents, bv as assistant, bw as authenticatedFetch, bx as buildDocNameMap, by as buildFactsContextTool, bz as buildRetrievalChunkTool, bA as buildRetrievalFullContextTool, bB as buildRetrievalTocTool, bC as connectWebSocket, bD as connectWithReconnect, bE as consumeSSEStream, bF as contacts, bG as conversations, bH as countCitations, bI as createAuthenticatedClient, bJ as createDocumentWaiter, bK as dm, bL as doctags, bM as documents, bN as facts, bO as files, bP as filterSkills, bQ as formatAgentStepLabel, bR as formatFileSize, bS as formatGbp, bT as formatGbpPerMillionTokens, bU as formatItemLabel, bV as formatStreamSummary, bW as formatUserName, bX as formatWorkspaceChoices, bY as formatWsMessage, bZ as generateEncryptedWorkspaceKey, b_ as generateNewWorkspaceKey, b$ as getErrorCode, c0 as getErrorMessage, c1 as getRawWorkspaceKey, c2 as health, c4 as identityErrorCode, c3 as identityVerification, c5 as mail, c6 as parseSSEEvents, c7 as parseSlashCommand, c8 as parseSlashTokenInProgress, c9 as performPasswordLogin, ca as performSigningKeyLogin, cb as performSsoDeviceFlowLogin, cc as profile, cd as projects, ce as requireData, cf as requireOk, cg as resolveAuth, ch as resolveCitations, ci as resolveWorkspace, cj as responses, ck as selectWorkspace, cl as selectWorkspaceById, cm as sessions, cn as settings, co as signatureRequests, cp as streamSSE, cq as stripCitationMarkdown, cr as summarizeCitations, cs as tags, ct as usdToGbp, cu as work, cv as workflowSteps, cw as workflows, cx as workspaces } from './browser-CxWTmtEq.cjs';
3
3
  import { SessionStorageProvider, ArbiClient } from '@arbidocs/client';
4
4
  export { LoginProfile } from '@arbidocs/client';
5
5
 
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { t as ConfigStore, q as CliConfig, r as CliCredentials, C as ChatSession, aJ as SkippedFile, bd as UploadResult, m as AuthHeaders, b9 as UploadBatchResult, bc as UploadOptions, ba as UploadDirectOptions, bb as UploadDirectResult, aG as SUPPORTED_EXTENSIONS, a0 as MailAttachment, I as DmCryptoContext } from './browser-9CxXW_cZ.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 DOC_TERMINAL_STATUSES, E as DecryptedDmNotification, G as DmAttachmentFile, H as DmAttachmentInput, J as DocNameMap, K as DocumentAutomationAction, L as DocumentListFields, M as DocumentListOrder, N as DocumentSelector, O as DocumentWaiter, P as DocumentWaiterOptions, T as FormattedWsMessage, U as IdentityErrorCode, V as IdentityPurchase, W as IdentityState, X as IdentityStatus, Y as LinkedRun, Z as ListAllOptions, $ as ListPaginatedOptions, a1 as MessageLevel, a2 as MessageMetadataPayload, a3 as MessageQueuedEvent, a4 as OutputTokensDetails, a5 as ParsedSlashCommand, a6 as PendingAuthResponse, a7 as PlanStepsError, a8 as PlanWorkRequest, aa as ProjectBudget, ab as ProjectConversationUsageResponse, ac as ProjectDetails, ad as ProjectEventKind, ae as ProjectEventResponse, af as ProjectInvoicesResponse, ag as ProjectResponse, ah as ProjectUpdateRequest, ai as ProjectUsageResponse, aj as QueryOptions, ak as RaisedSignal, al as ReconnectOptions, am as ReconnectableWsConnection, an as ResolvedCitation, ao as ResolvedRecipient, ap as ResponseCompletedEvent, aq as ResponseContentPartAddedEvent, ar as ResponseCreatedEvent, as as ResponseFailedEvent, at as ResponseOutputItemAddedEvent, au as ResponseOutputItemDoneEvent, av as ResponseOutputTextDeltaEvent, aw as ResponseOutputTextDoneEvent, ax as ResponseUsage, ay as RunProgress, az as RunStep, aA as RunWaitingOn, aB as SSEEvent, aC as SSEStreamCallbacks, aD as SSEStreamResult, aE as SSEStreamStartData, aF as STEP_FIELD_OPTION_TONES, aH as SendBack, aI as SkillSummary, aK as StepActionRequest, aL as StepActivityEvent, aM as StepAssignee, aN as StepField, aO as StepFieldOption, aP as StepFieldOptionTone, aQ as StepKind, aR as StepPhase, aS as StepSignal, aT as StepSignalWhen, aU as StepState, aV as StepStatus, aW as SubmitBackgroundQueryOptions, aX as TagChange, aY as TagFieldDefinition, aZ as TagKind, a_ as TagKindField, a$ as TagKindSchema, b0 as TagLinks, b1 as TagListQuery, b2 as TagResponse, b3 as TaskPlan, b4 as TaskPlanStep, b5 as TokenBudgetContext, b6 as UpdateConversationRequest, b8 as UpdateWorkflowRequest, be as UsageBreakdown, bf as UserDailyUsageResponse, bg as UserInfo, bh as UserInputRequestEvent, bi as UserMessageEvent, bj as WebSocketAuthError, bk as WorkStatus, bl as WorkflowAuthMode, bm as WorkflowResponse, bn as WorkflowRunHistoryResponse, bo as WorkflowRunResponse, bp as WorkspaceContext, bq as WsConnection, br as account, bs as agentconfig, bt as agents, bu as assistant, bv as authenticatedFetch, bw as buildDocNameMap, bx as buildFactsContextTool, by as buildRetrievalChunkTool, bz as buildRetrievalFullContextTool, bA as buildRetrievalTocTool, bB as connectWebSocket, bC as connectWithReconnect, bD as consumeSSEStream, bE as contacts, bF as conversations, bG as countCitations, bH as createAuthenticatedClient, bI as createDocumentWaiter, bJ as dm, bK as doctags, bL as documents, bM as facts, bN as files, bO as filterSkills, bP as formatAgentStepLabel, bQ as formatFileSize, bR as formatItemLabel, bS as formatStreamSummary, bT as formatUserName, bU as formatWorkspaceChoices, bV as formatWsMessage, bW as generateEncryptedWorkspaceKey, bX as generateNewWorkspaceKey, bY as getErrorCode, bZ as getErrorMessage, b_ as getRawWorkspaceKey, b$ as health, c1 as identityErrorCode, c0 as identityVerification, c2 as mail, c3 as parseSSEEvents, c4 as parseSlashCommand, c5 as parseSlashTokenInProgress, c6 as performPasswordLogin, c7 as performSigningKeyLogin, c8 as performSsoDeviceFlowLogin, c9 as profile, ca as projects, cb as requireData, cc as requireOk, cd as resolveAuth, ce as resolveCitations, cf as resolveWorkspace, cg as responses, ch as selectWorkspace, ci as selectWorkspaceById, cj as sessions, ck as settings, cl as signatureRequests, cm as streamSSE, cn as stripCitationMarkdown, co as summarizeCitations, cp as tags, cq as work, cr as workflowSteps, cs as workflows, ct as workspaces } from './browser-9CxXW_cZ.js';
1
+ import { t as ConfigStore, q as CliConfig, r as CliCredentials, C as ChatSession, aK as SkippedFile, be as UploadResult, m as AuthHeaders, ba as UploadBatchResult, bd as UploadOptions, bb as UploadDirectOptions, bc as UploadDirectResult, aH as SUPPORTED_EXTENSIONS, a1 as MailAttachment, J as DmCryptoContext } from './browser-CxWTmtEq.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 MessageLevel, a3 as MessageMetadataPayload, a4 as MessageQueuedEvent, a5 as OutputTokensDetails, a6 as ParsedSlashCommand, a7 as PendingAuthResponse, a8 as PlanStepsError, a9 as PlanWorkRequest, ab as ProjectBudget, ac as ProjectConversationUsageResponse, ad as ProjectDetails, ae as ProjectEventKind, af as ProjectEventResponse, ag as ProjectInvoicesResponse, ah as ProjectResponse, ai as ProjectUpdateRequest, aj as ProjectUsageResponse, ak as QueryOptions, al as RaisedSignal, am as ReconnectOptions, an as ReconnectableWsConnection, ao as ResolvedCitation, ap as ResolvedRecipient, aq as ResponseCompletedEvent, ar as ResponseContentPartAddedEvent, as as ResponseCreatedEvent, at as ResponseFailedEvent, au as ResponseOutputItemAddedEvent, av as ResponseOutputItemDoneEvent, aw as ResponseOutputTextDeltaEvent, ax as ResponseOutputTextDoneEvent, ay as ResponseUsage, az as RunProgress, aA as RunStep, aB as RunWaitingOn, aC as SSEEvent, aD as SSEStreamCallbacks, aE as SSEStreamResult, aF as SSEStreamStartData, aG as STEP_FIELD_OPTION_TONES, aI as SendBack, aJ as SkillSummary, aL as StepActionRequest, aM as StepActivityEvent, aN as StepAssignee, aO as StepField, aP as StepFieldOption, aQ as StepFieldOptionTone, aR as StepKind, aS as StepPhase, aT as StepSignal, aU as StepSignalWhen, aV as StepState, aW as StepStatus, aX as SubmitBackgroundQueryOptions, aY as TagChange, aZ as TagFieldDefinition, a_ as TagKind, a$ as TagKindField, b0 as TagKindSchema, b1 as TagLinks, b2 as TagListQuery, b3 as TagResponse, b4 as TaskPlan, b5 as TaskPlanStep, b6 as TokenBudgetContext, b7 as UpdateConversationRequest, b9 as UpdateWorkflowRequest, bf as UsageBreakdown, bg as UserDailyUsageResponse, bh as UserInfo, bi as UserInputRequestEvent, bj as UserMessageEvent, bk as WebSocketAuthError, bl as WorkStatus, bm as WorkflowAuthMode, bn as WorkflowResponse, bo as WorkflowRunHistoryResponse, bp as WorkflowRunResponse, bq as WorkspaceContext, br as WsConnection, bs as account, bt as agentconfig, bu as agents, bv as assistant, bw as authenticatedFetch, bx as buildDocNameMap, by as buildFactsContextTool, bz as buildRetrievalChunkTool, bA as buildRetrievalFullContextTool, bB as buildRetrievalTocTool, bC as connectWebSocket, bD as connectWithReconnect, bE as consumeSSEStream, bF as contacts, bG as conversations, bH as countCitations, bI as createAuthenticatedClient, bJ as createDocumentWaiter, bK as dm, bL as doctags, bM as documents, bN as facts, bO as files, bP as filterSkills, bQ as formatAgentStepLabel, bR as formatFileSize, bS as formatGbp, bT as formatGbpPerMillionTokens, bU as formatItemLabel, bV as formatStreamSummary, bW as formatUserName, bX as formatWorkspaceChoices, bY as formatWsMessage, bZ as generateEncryptedWorkspaceKey, b_ as generateNewWorkspaceKey, b$ as getErrorCode, c0 as getErrorMessage, c1 as getRawWorkspaceKey, c2 as health, c4 as identityErrorCode, c3 as identityVerification, c5 as mail, c6 as parseSSEEvents, c7 as parseSlashCommand, c8 as parseSlashTokenInProgress, c9 as performPasswordLogin, ca as performSigningKeyLogin, cb as performSsoDeviceFlowLogin, cc as profile, cd as projects, ce as requireData, cf as requireOk, cg as resolveAuth, ch as resolveCitations, ci as resolveWorkspace, cj as responses, ck as selectWorkspace, cl as selectWorkspaceById, cm as sessions, cn as settings, co as signatureRequests, cp as streamSSE, cq as stripCitationMarkdown, cr as summarizeCitations, cs as tags, ct as usdToGbp, cu as work, cv as workflowSteps, cw as workflows, cx as workspaces } from './browser-CxWTmtEq.js';
3
3
  import { SessionStorageProvider, ArbiClient } from '@arbidocs/client';
4
4
  export { LoginProfile } from '@arbidocs/client';
5
5
 
package/dist/index.js CHANGED
@@ -4221,6 +4221,38 @@ async function resolveWorkspace(store, workspaceOpt) {
4221
4221
  };
4222
4222
  }
4223
4223
 
4224
+ // src/format.ts
4225
+ function formatFileSize(bytes, fallback = "N/A") {
4226
+ if (bytes === null || bytes === void 0) return fallback;
4227
+ if (bytes < 1024) return `${bytes} B`;
4228
+ if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
4229
+ if (bytes < 1024 * 1024 * 1024) return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
4230
+ return `${(bytes / (1024 * 1024 * 1024)).toFixed(1)} GB`;
4231
+ }
4232
+ function formatUserName(user) {
4233
+ if (!user) return "";
4234
+ return [user.given_name, user.family_name].filter(Boolean).join(" ");
4235
+ }
4236
+ function formatGbp(gbp) {
4237
+ const safe = typeof gbp === "number" && Number.isFinite(gbp) ? gbp : 0;
4238
+ if (safe > 0 && safe < 5e-3) return "<\xA30.01";
4239
+ const rounded = Math.round(safe * 100) / 100;
4240
+ const whole = Number.isInteger(rounded);
4241
+ const digits = Math.abs(rounded).toLocaleString("en-GB", {
4242
+ minimumFractionDigits: whole ? 0 : 2,
4243
+ maximumFractionDigits: whole ? 0 : 2
4244
+ });
4245
+ return `${rounded < 0 ? "-" : ""}\xA3${digits}`;
4246
+ }
4247
+ var DEFAULT_AI_USD_PER_GBP = 1;
4248
+ function usdToGbp(usd, usdPerGbp = DEFAULT_AI_USD_PER_GBP) {
4249
+ return usd / usdPerGbp;
4250
+ }
4251
+ function formatGbpPerMillionTokens(costPerToken) {
4252
+ if (!costPerToken) return null;
4253
+ return formatGbp(usdToGbp(costPerToken * 1e6));
4254
+ }
4255
+
4224
4256
  // src/sse.ts
4225
4257
  function humanizeStep(identifier) {
4226
4258
  const spaced = identifier.replace(/[_-]+/g, " ").trim();
@@ -4523,8 +4555,10 @@ function formatStreamSummary(result, elapsedTime) {
4523
4555
  const used = result.context.all_llm_calls?.last_input_tokens ?? result.context.total_input;
4524
4556
  parts.push(`${used.toLocaleString()}/${result.context.context_window.toLocaleString()} context`);
4525
4557
  }
4526
- if (result.context?.credits_spent != null && result.context.credit_budget != null) {
4527
- parts.push(`${result.context.credits_spent.toFixed(2)}/${result.context.credit_budget} credits`);
4558
+ if (result.context?.spent_gbp != null && result.context.budget_gbp != null) {
4559
+ parts.push(
4560
+ `${formatGbp(result.context.spent_gbp)}/${formatGbp(result.context.budget_gbp)} AI usage`
4561
+ );
4528
4562
  }
4529
4563
  if (elapsedTime != null) {
4530
4564
  parts.push(`${elapsedTime.toFixed(1)}s`);
@@ -4790,19 +4824,6 @@ function formatWsMessage(msg) {
4790
4824
  return { text: `${msg.type}`, level: "info" };
4791
4825
  }
4792
4826
 
4793
- // src/format.ts
4794
- function formatFileSize(bytes, fallback = "N/A") {
4795
- if (bytes === null || bytes === void 0) return fallback;
4796
- if (bytes < 1024) return `${bytes} B`;
4797
- if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
4798
- if (bytes < 1024 * 1024 * 1024) return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
4799
- return `${(bytes / (1024 * 1024 * 1024)).toFixed(1)} GB`;
4800
- }
4801
- function formatUserName(user) {
4802
- if (!user) return "";
4803
- return [user.given_name, user.family_name].filter(Boolean).join(" ");
4804
- }
4805
-
4806
4827
  // src/citations.ts
4807
4828
  function resolveCitations(metadata) {
4808
4829
  if (!metadata?.tools) return [];
@@ -8231,7 +8252,7 @@ var Arbi = class {
8231
8252
  update: (projectExtId, body) => updateProject(this.requireClient(), projectExtId, body),
8232
8253
  /** The project's stage and budget changes, newest first. */
8233
8254
  events: (projectExtId, options) => listProjectEvents(this.requireClient(), projectExtId, options),
8234
- /** The project's spend by conversation in a billing period (credits). */
8255
+ /** The project's spend by conversation in a billing period (£). */
8235
8256
  usageByConversation: (projectExtId, monthsBack) => getProjectConversationUsage(this.requireClient(), projectExtId, monthsBack),
8236
8257
  refresh: (projectExtId) => refreshProject(this.requireClient(), projectExtId),
8237
8258
  /** AI usage + spend breakdown for a project's billing period. */
@@ -8269,7 +8290,7 @@ var Arbi = class {
8269
8290
  this.profileListeners.add(listener);
8270
8291
  return () => this.profileListeners.delete(listener);
8271
8292
  },
8272
- /** Today's deployment-wide credit spend for the current user. */
8293
+ /** Today's deployment-wide AI usage (£) for the current user. */
8273
8294
  usageToday: () => getUserUsageToday(this.requireClient()),
8274
8295
  /**
8275
8296
  * The signed-in user from the server, with `can_create_projects`: false on deployments where
@@ -8527,7 +8548,7 @@ var Arbi = class {
8527
8548
  sendBackStep: (conversationId, step, options) => sendBackStep(this.requireClient(), conversationId, step, options),
8528
8549
  /** A stepped run's steps, signals, linked runs and send-backs, and what it waits for. */
8529
8550
  runProgress: (conversationId) => getRunProgress(this.requireClient(), conversationId),
8530
- /** What the conversation's AI work cost: by step, run, model, agent and feature (credits). */
8551
+ /** What the conversation's AI work cost: by step, run, model, agent and feature (£). */
8531
8552
  usage: (conversationId) => getConversationUsage(this.requireClient(), conversationId),
8532
8553
  /** Notify people about a conversation (each gets a notification); resolves with who was. */
8533
8554
  notify: (conversationId, userIds) => notifyConversation(this.requireClient(), conversationId, userIds),
@@ -10023,6 +10044,6 @@ async function startDmListener(options) {
10023
10044
  };
10024
10045
  }
10025
10046
 
10026
- export { Arbi, ArbiApiError, ArbiError, ArbiSessionExpiredError, ClaudeOrchestrator, DOC_TERMINAL_STATUSES, FileConfigStore, OpenClawOrchestrator, PlanStepsError, STEP_FIELD_OPTION_TONES, WebSocketAuthError, account_exports as account, agentconfig_exports as agentconfig, agents_exports as agents, assistant_exports as assistant, authenticatedFetch, buildDocNameMap, buildFactsContextTool, buildRetrievalChunkTool, buildRetrievalFullContextTool, buildRetrievalTocTool, connectWebSocket, connectWithReconnect, consumeSSEStream, contacts_exports as contacts, conversations_exports as conversations, countCitations, createAuthenticatedClient, createDocumentWaiter, device_flow_exports as deviceFlow, dm_exports as dm, doctags_exports as doctags, documents_exports as documents, documents_node_exports as documentsNode, facts_exports as facts, files_exports as files, filterSkills, formatAgentStepLabel, formatFileSize, formatItemLabel, formatStreamSummary, formatUserName, formatWorkspaceChoices, formatWsMessage, generateEncryptedWorkspaceKey, generateNewWorkspaceKey, getErrorCode, getErrorMessage, getRawWorkspaceKey, health_exports as health, identityErrorCode, identity_exports as identityVerification, listen_exports as listen, mail_exports as mail, mail_node_exports as mailNode, parseSSEEvents, parseSlashCommand, parseSlashTokenInProgress, performPasswordLogin, performSigningKeyLogin, performSsoDeviceFlowLogin, profile_exports as profile, projects_exports as projects, requireData, requireOk, resolveAuth, resolveCitations, resolveWorkspace, responses_exports as responses, selectWorkspace, selectWorkspaceById, sessions_exports as sessions, settings_exports as settings, signature_requests_exports as signatureRequests, startDmListener, streamSSE, stripCitationMarkdown, summarizeCitations, tags_exports as tags, work_exports as work, workflow_steps_exports as workflowSteps, workflows_exports as workflows, workspaces_exports as workspaces };
10047
+ export { Arbi, ArbiApiError, ArbiError, ArbiSessionExpiredError, ClaudeOrchestrator, DEFAULT_AI_USD_PER_GBP, DOC_TERMINAL_STATUSES, FileConfigStore, OpenClawOrchestrator, PlanStepsError, STEP_FIELD_OPTION_TONES, WebSocketAuthError, account_exports as account, agentconfig_exports as agentconfig, agents_exports as agents, assistant_exports as assistant, authenticatedFetch, buildDocNameMap, buildFactsContextTool, buildRetrievalChunkTool, buildRetrievalFullContextTool, buildRetrievalTocTool, connectWebSocket, connectWithReconnect, consumeSSEStream, contacts_exports as contacts, conversations_exports as conversations, countCitations, createAuthenticatedClient, createDocumentWaiter, device_flow_exports as deviceFlow, dm_exports as dm, doctags_exports as doctags, documents_exports as documents, documents_node_exports as documentsNode, facts_exports as facts, files_exports as files, filterSkills, formatAgentStepLabel, formatFileSize, formatGbp, formatGbpPerMillionTokens, formatItemLabel, formatStreamSummary, formatUserName, formatWorkspaceChoices, formatWsMessage, generateEncryptedWorkspaceKey, generateNewWorkspaceKey, getErrorCode, getErrorMessage, getRawWorkspaceKey, health_exports as health, identityErrorCode, identity_exports as identityVerification, listen_exports as listen, mail_exports as mail, mail_node_exports as mailNode, parseSSEEvents, parseSlashCommand, parseSlashTokenInProgress, performPasswordLogin, performSigningKeyLogin, performSsoDeviceFlowLogin, profile_exports as profile, projects_exports as projects, requireData, requireOk, resolveAuth, resolveCitations, resolveWorkspace, responses_exports as responses, selectWorkspace, selectWorkspaceById, sessions_exports as sessions, settings_exports as settings, signature_requests_exports as signatureRequests, startDmListener, streamSSE, stripCitationMarkdown, summarizeCitations, tags_exports as tags, usdToGbp, work_exports as work, workflow_steps_exports as workflowSteps, workflows_exports as workflows, workspaces_exports as workspaces };
10027
10048
  //# sourceMappingURL=index.js.map
10028
10049
  //# sourceMappingURL=index.js.map