@arbidocs/sdk 0.5.66 → 0.5.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{browser-DHvxPDoF.d.cts → browser-BsuUurv5.d.cts} +98 -1
- package/dist/{browser-DpDuiKeo.d.ts → browser-D0iEy5W9.d.ts} +98 -1
- package/dist/browser.cjs +122 -0
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +1 -1
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +123 -2
- package/dist/browser.js.map +1 -1
- package/dist/index.cjs +122 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +123 -2
- package/dist/index.js.map +1 -1
- package/examples/react-chat/package.json +2 -2
- package/package.json +2 -2
|
@@ -2037,6 +2037,84 @@ declare namespace houseTemplate {
|
|
|
2037
2037
|
export { type houseTemplate_DeploymentHouseTemplate as DeploymentHouseTemplate, type houseTemplate_HouseTemplateCandidate as HouseTemplateCandidate, houseTemplate_getDeploymentHouseTemplate as getDeploymentHouseTemplate, houseTemplate_isDeploymentAdmin as isDeploymentAdmin, houseTemplate_listHouseTemplateCandidates as listHouseTemplateCandidates, houseTemplate_setDeploymentHouseTemplate as setDeploymentHouseTemplate, houseTemplate_setWorkspaceHouseTemplate as setWorkspaceHouseTemplate, houseTemplate_supportsHouseTemplates as supportsHouseTemplates, houseTemplate_workspaceHouseTemplateId as workspaceHouseTemplateId };
|
|
2038
2038
|
}
|
|
2039
2039
|
|
|
2040
|
+
/**
|
|
2041
|
+
* Model connections (`/v1/model-connections`): OpenAI-compatible Chat Completions endpoints the
|
|
2042
|
+
* main agent may use. A box connection is the deployment's; a personal one is the user's own.
|
|
2043
|
+
*
|
|
2044
|
+
* A personal API key is sealed to the user's identity at rest (`sealPersonalApiKey`). A live
|
|
2045
|
+
* session can use it only after the client unseals it and deposits a copy sealed to the session
|
|
2046
|
+
* key (`unlockModelConnections`, run at sign-in and from Settings).
|
|
2047
|
+
*/
|
|
2048
|
+
|
|
2049
|
+
type ConnectionModel = components['schemas']['ConnectionModel'] & {
|
|
2050
|
+
reference?: string;
|
|
2051
|
+
};
|
|
2052
|
+
interface ModelConnection {
|
|
2053
|
+
id: string;
|
|
2054
|
+
name: string;
|
|
2055
|
+
protocol: 'openai_chat_completions';
|
|
2056
|
+
base_url: string;
|
|
2057
|
+
scope: 'personal' | 'box';
|
|
2058
|
+
enabled: boolean;
|
|
2059
|
+
allow_private_network: boolean;
|
|
2060
|
+
has_api_key: boolean;
|
|
2061
|
+
models: ConnectionModel[];
|
|
2062
|
+
sealed_api_key?: string;
|
|
2063
|
+
}
|
|
2064
|
+
/** The user's direct model calls of the last 30 days (billed by their provider, not ARBI). */
|
|
2065
|
+
interface DirectModelUsage {
|
|
2066
|
+
calls: Array<{
|
|
2067
|
+
id: string;
|
|
2068
|
+
connection_id: string;
|
|
2069
|
+
provider_model: string;
|
|
2070
|
+
status: string;
|
|
2071
|
+
input_tokens: number | null;
|
|
2072
|
+
output_tokens: number | null;
|
|
2073
|
+
created_at: string;
|
|
2074
|
+
}>;
|
|
2075
|
+
}
|
|
2076
|
+
type ModelConnectionWrite = components['schemas']['ConnectionWrite'];
|
|
2077
|
+
/** A personal connection to save: `id` replaces that one; `apiKey` is sealed before it is sent. */
|
|
2078
|
+
type PersonalConnectionInput = Omit<ModelConnectionWrite, 'protocol' | 'allow_private_network' | 'sealed_api_key' | 'api_key'> & {
|
|
2079
|
+
id?: string;
|
|
2080
|
+
apiKey?: string;
|
|
2081
|
+
};
|
|
2082
|
+
/** The keys an unlock needs: the user's identity key and the server session's key. */
|
|
2083
|
+
interface ModelConnectionKeys {
|
|
2084
|
+
signingPrivateKey: Uint8Array;
|
|
2085
|
+
serverSessionKey: Uint8Array;
|
|
2086
|
+
}
|
|
2087
|
+
/** The box's connections and the user's own. */
|
|
2088
|
+
declare function listConnections(arbi: ArbiClient): Promise<ModelConnection[]>;
|
|
2089
|
+
/** The user's direct model calls of the last 30 days. */
|
|
2090
|
+
declare function directUsage(arbi: ArbiClient): Promise<DirectModelUsage>;
|
|
2091
|
+
/** Add a personal connection, or replace the one `id` names. */
|
|
2092
|
+
declare function savePersonalConnection(arbi: ArbiClient, body: ModelConnectionWrite, id?: string): Promise<ModelConnection>;
|
|
2093
|
+
declare function removeConnection(arbi: ArbiClient, id: string): Promise<void>;
|
|
2094
|
+
/** Seal a provider API key to the user's identity; the plaintext bytes are wiped. */
|
|
2095
|
+
declare function sealPersonalApiKey(apiKey: string, signingPrivateKey: Uint8Array): Promise<string>;
|
|
2096
|
+
/**
|
|
2097
|
+
* Let this server session use the user's enabled personal keys (only `onlyId`'s when given):
|
|
2098
|
+
* unseal each with the identity key and deposit a copy sealed to the session key.
|
|
2099
|
+
*/
|
|
2100
|
+
declare function unlockModelConnections(arbi: ArbiClient, keys: ModelConnectionKeys, onlyId?: string): Promise<void>;
|
|
2101
|
+
|
|
2102
|
+
type modelConnections_ConnectionModel = ConnectionModel;
|
|
2103
|
+
type modelConnections_DirectModelUsage = DirectModelUsage;
|
|
2104
|
+
type modelConnections_ModelConnection = ModelConnection;
|
|
2105
|
+
type modelConnections_ModelConnectionKeys = ModelConnectionKeys;
|
|
2106
|
+
type modelConnections_ModelConnectionWrite = ModelConnectionWrite;
|
|
2107
|
+
type modelConnections_PersonalConnectionInput = PersonalConnectionInput;
|
|
2108
|
+
declare const modelConnections_directUsage: typeof directUsage;
|
|
2109
|
+
declare const modelConnections_listConnections: typeof listConnections;
|
|
2110
|
+
declare const modelConnections_removeConnection: typeof removeConnection;
|
|
2111
|
+
declare const modelConnections_savePersonalConnection: typeof savePersonalConnection;
|
|
2112
|
+
declare const modelConnections_sealPersonalApiKey: typeof sealPersonalApiKey;
|
|
2113
|
+
declare const modelConnections_unlockModelConnections: typeof unlockModelConnections;
|
|
2114
|
+
declare namespace modelConnections {
|
|
2115
|
+
export { type modelConnections_ConnectionModel as ConnectionModel, type modelConnections_DirectModelUsage as DirectModelUsage, type modelConnections_ModelConnection as ModelConnection, type modelConnections_ModelConnectionKeys as ModelConnectionKeys, type modelConnections_ModelConnectionWrite as ModelConnectionWrite, type modelConnections_PersonalConnectionInput as PersonalConnectionInput, modelConnections_directUsage as directUsage, modelConnections_listConnections as listConnections, modelConnections_removeConnection as removeConnection, modelConnections_savePersonalConnection as savePersonalConnection, modelConnections_sealPersonalApiKey as sealPersonalApiKey, modelConnections_unlockModelConnections as unlockModelConnections };
|
|
2116
|
+
}
|
|
2117
|
+
|
|
2040
2118
|
/**
|
|
2041
2119
|
* Workspace operations — list, create, delete, update, users, copy.
|
|
2042
2120
|
*/
|
|
@@ -15668,6 +15746,23 @@ declare class Arbi {
|
|
|
15668
15746
|
file_name: string;
|
|
15669
15747
|
}[]>;
|
|
15670
15748
|
};
|
|
15749
|
+
/**
|
|
15750
|
+
* The main agent's OpenAI-compatible endpoints: the box's and the user's own. A personal key is
|
|
15751
|
+
* sealed to the user's identity and usable by a session only once unlocked on it.
|
|
15752
|
+
*/
|
|
15753
|
+
readonly modelConnections: {
|
|
15754
|
+
list: () => Promise<ModelConnection[]>;
|
|
15755
|
+
/** The user's direct model calls of the last 30 days. */
|
|
15756
|
+
usage: () => Promise<DirectModelUsage>;
|
|
15757
|
+
/**
|
|
15758
|
+
* Add a personal connection (or replace `id`'s). An `apiKey` is sealed to the identity before
|
|
15759
|
+
* it is sent; an enabled connection with a key is unlocked on this session at once.
|
|
15760
|
+
*/
|
|
15761
|
+
save: ({ id, apiKey, ...body }: PersonalConnectionInput) => Promise<ModelConnection>;
|
|
15762
|
+
remove: (id: string) => Promise<void>;
|
|
15763
|
+
/** Let this session use the user's enabled personal keys (only `onlyId`'s when given). */
|
|
15764
|
+
unlock: (onlyId?: string) => Promise<void>;
|
|
15765
|
+
};
|
|
15671
15766
|
readonly databases: {
|
|
15672
15767
|
list: () => Promise<{
|
|
15673
15768
|
id: string;
|
|
@@ -15881,6 +15976,8 @@ declare class Arbi {
|
|
|
15881
15976
|
};
|
|
15882
15977
|
private requireClient;
|
|
15883
15978
|
private requireLogin;
|
|
15979
|
+
/** The signed-in user's identity (signing) key. */
|
|
15980
|
+
private identityKey;
|
|
15884
15981
|
private requireWorkspace;
|
|
15885
15982
|
}
|
|
15886
15983
|
|
|
@@ -17435,4 +17532,4 @@ declare function documentTools(options: {
|
|
|
17435
17532
|
/** Add replaces matching tool names; replace discards all previous tools. No mutation of inputs. */
|
|
17436
17533
|
declare function composeTools(base: ResponseTools, next: ResponseTools, mode: 'add' | 'replace'): ResponseTools;
|
|
17437
17534
|
|
|
17438
|
-
export { type CitationSummary as $, ACCOUNT_VENDOR as A, type BookingConfirmation as B, type CalDavConnectBody as C, type CalDavProfile as D, type CalendarAccount as E, type CalendarAccountKind as F, type CalendarCreateBody as G, type CalendarEvent as H, type CalendarKeys as I, type CalendarRead as J, type CalendarSettings as K, type CalendarSettingsBody as L, type CalendarUpdate as M, type CalendarWindow as N, CallApiError as O, type Capabilities as P, type ChatAttachmentFile as Q, type ChatAttachmentInput as R, type ChatCryptoContext as S, type ChatKeyRing as T, type ChatKind as U, type ChatMemberKey as V, type ChatMemberResponse as W, type ChatMessage as X, type ChatMessageResponse as Y, type ChatResponse as Z, type ChatSession as _, type AccountSyncResult as a, type HolidayCountry as a$, type CitationToolSources as a0, type CliConfig as a1, type CliCredentials as a2, type CommandDescriptor as a3, type ConfigStore as a4, type Configuration as a5, type ConfigurationPatch as a6, type ConnectOptions as a7, type ConnectorCatalogEntry as a8, type ConnectorFolder as a9, type DeploymentHouseTemplate as aA, type DocInfo as aB, type DocInfoMap as aC, type DocNameMap as aD, type DocumentAutomationAction as aE, type DocumentListFields as aF, type DocumentListOrder as aG, type DocumentSelector as aH, type DocumentWaiter as aI, type DocumentWaiterOptions as aJ, type DriveSyncProgress as aK, type DriveSyncSummary as aL, DuplicateContactError as aM, ENTITY_KINDS as aN, type EditScope as aO, type EntityKind as aP, type EventCreateBody as aQ, type EventPatchBody as aR, FLAT_TAG_KINDS as aS, type FactResponse as aT, type FactSearchRequest as aU, type FactSearchResponse as aV, type FindTimeParams as aW, type FormattedWsMessage as aX, type FreeBusyEntry as aY, type FullContextSelection as aZ, GOOGLE_VENDORS as a_, type ConnectorSyncProgress as aa, type ConnectorSyncStatus as ab, type ConnectorVendorKey as ac, type ConnectorVisibilitySettings as ad, type ContextUsage as ae, type ConversationResponse as af, type ConversationUsageResponse as ag, type CreateFactRequest as ah, type CreateFactsRequest as ai, type CreateWorkRequest as aj, type CreateWorkflowRequest as ak, DEFAULT_AI_USD_PER_GBP as al, DOC_TERMINAL_STATUSES as am, DRIVE_SYNC_VENDORS as an, type Database as ao, type DatabaseAggregateRequest as ap, type DatabaseAggregateResult as aq, type DatabaseColumn as ar, type DatabaseColumnWrite as as, type DatabaseImportResult as at, type DatabaseRow as au, type DatabaseRowPage as av, type DatabaseRowsQuery as aw, type DateTimeSpec as ax, type DecryptedChat as ay, type DecryptedChatMessage as az, type ActivityKind as b, type ResponseHandle as b$, type HouseTemplateCandidate as b0, IMANAGE_VENDORS as b1, type IdentityErrorCode as b2, type IdentityPurchase as b3, type IdentityState as b4, type IdentityStatus as b5, type ImportResult as b6, type InvitationRead as b7, type JsonSchemaOutputFormat as b8, type LinkedRun as b9, type ProjectCheckoutRequest as bA, type ProjectConversationUsageResponse as bB, type ProjectCreateOptions as bC, type ProjectDetails as bD, type ProjectEventKind as bE, type ProjectEventResponse as bF, type ProjectInvoicesResponse as bG, type ProjectNextPeriodAddonsRequest as bH, type ProjectPlanChangeRequest as bI, type ProjectQuoteRequest as bJ, type ProjectResponse as bK, type ProjectUpdateRequest as bL, type ProjectUsageResponse as bM, PublicBookingError as bN, type PublicBookingPage as bO, type QuotaExceeded as bP, type RaisedSignal as bQ, type RawResponseEvent as bR, type ReconnectOptions as bS, type ReconnectableWsConnection as bT, type ResolvedCitation as bU, type ResolvedRecipient as bV, type RespondParams as bW, type RespondPartstat as bX, type Response$1 as bY, type ResponseCreateRequest as bZ, type ResponseCreateResult as b_, type ListAllOptions as ba, type ListEventsParams as bb, type ListFactsOptions as bc, type ListPaginatedOptions as bd, MAILBOX_SYNC_VENDORS as be, MAX_RETRIEVE_DOC_IDS as bf, MICROSOFT_VENDORS as bg, type MailAttachment as bh, type MessageLevel as bi, type OAuthAccountKind as bj, type OutputItemDone as bk, type OverlayItem as bl, type OverlayLayerName as bm, PRESENCE_KINDS as bn, PROMPT_CONTEXT_CHARS as bo, type ParsedResponse as bp, type ParsedSlashCommand as bq, type ParsedStructuredResponse as br, type PendingAuthResponse as bs, type PersonKey as bt, PlanStepsError as bu, type PlanWorkRequest as bv, type ProductResponse as bw, type ProjectAddonKind as bx, type ProjectAddonSettingsRequest as by, type ProjectBudget as bz, type ActivityResponse as c, type TaskPlanStep as c$, type ResponseSnapshot as c0, type ResponseStart as c1, type ResponseStartOptions as c2, ResponseStream as c3, type ResponseStreamEvent as c4, type ResponseTools as c5, type RoomCreateBody as c6, type RoomQuery as c7, type RoomRead as c8, type RunProgress as c9, type StepFieldOptionTone as cA, type StepKind as cB, type StepPhase as cC, type StepSignal as cD, type StepSignalWhen as cE, type StepState as cF, type StepStatus as cG, type SubagentBranchRecord as cH, type SubagentLaneInfo as cI, type SubmitBackgroundQueryOptions as cJ, type SubscribeParams as cK, type SyncTriggerResult as cL, TAG_KINDS as cM, TAG_NESTING_MAX_DEPTH as cN, type TagChange as cO, type TagFieldDefinition as cP, type TagGroup as cQ, type TagKind as cR, type TagKindField as cS, type TagKindSchema as cT, type TagLinks as cU, type TagListQuery as cV, type TagNode as cW, type TagResponse as cX, type TagScope as cY, type TagTreeRow as cZ, type TaskPlan as c_, type RunStats as ca, type RunStep as cb, type RunWaitingOn as cc, SHAREPOINT_VENDORS as cd, type SSEEvent as ce, type SSEStreamCallbacks as cf, type SSEStreamOutcome as cg, type SSEStreamResult as ch, STEP_FIELD_OPTION_TONES as ci, STOP_ID_WAIT_MS as cj, STOP_REPEAT_WINDOW_MS as ck, SUPPORTED_EXTENSIONS as cl, type ScopedTarget as cm, type SearchChunk as cn, type SendBack as co, type ShareRead as cp, type ShareRole as cq, type SkillSummary as cr, type SkippedFile as cs, type SlackConnectionStatus as ct, type StepActionRequest as cu, type StepActivityEvent as cv, type StepAssignee as cw, type StepDisplay as cx, type StepField as cy, type StepFieldOption as cz, Arbi as d, countCitations as d$, type TaxQuoteResponse as d0, type Thread as d1, type ThreadsResponse as d2, type TimeSuggestion as d3, type TurnRequest as d4, type UpdateConversationRequest as d5, type UpdateFactRequest as d6, type UpdateWorkflowRequest as d7, type UploadBatchResult as d8, type UploadDirectOptions as d9, assistant as dA, authenticatedFetch as dB, bookPublicSlot as dC, buildCitationChunkData as dD, buildDocNameMap as dE, buildDocumentTools as dF, buildFactsContextTool as dG, buildRetrievalChunkTool as dH, buildRetrievalFullContextTool as dI, buildRetrievalTocTool as dJ, buildTurnRequest as dK, calendar as dL, calls as dM, canTagHaveParent as dN, cancelPublicBooking as dO, capabilities as dP, chats as dQ, composeConfiguration as dR, composeTools as dS, computeRunStats as dT, connectErrorMessage as dU, connectWebSocket as dV, connectWithReconnect as dW, connectors as dX, contacts as dY, continuityPrompt as dZ, conversations as d_, type UploadDirectResult as da, type UploadDocumentsOptions as db, type UploadOptions as dc, type UploadProgressListener as dd, type UploadResult as de, type UsageBreakdown as df, type UserConnectorEntry as dg, type UserDailyUsageResponse as dh, type UserInfo as di, WebSocketAuthError as dj, type WeeklyHoursSpec as dk, type WorkStatus as dl, type WorkflowAuthMode as dm, type WorkflowResponse as dn, type WorkflowRunHistoryResponse as dp, type WorkflowRunResponse as dq, type WorkspaceConflict as dr, type WorkspaceContext as ds, type WorkspaceOpenResponse as dt, type WorkspaceResponse as du, type WsConnection as dv, account as dw, agentconfig as dx, agents as dy, appendTranscriptionHints as dz, ArbiApiError as e, isMailboxSyncVendor as e$, createAuthenticatedClient as e0, createDocumentWaiter as e1, createIndexAssigner as e2, databases as e3, defaultKindForFormat as e4, doctags as e5, documentTools as e6, documents as e7, estimateDraftTokens as e8, extractDocumentIdsFromMessages as e9, getContextRemainingPercent as eA, getContextUsedPercent as eB, getContextUsedTokens as eC, getCurrentStep as eD, getEligibleParentTags as eE, getErrorCode as eF, getErrorMessage as eG, getPublicBookingPage as eH, getRawWorkspaceKey as eI, getRunToAttach as eJ, getRunToCancel as eK, getStepDisplay as eL, getStepTool as eM, getSubagentBranchRecord as eN, getTagDescendantIds as eO, health as eP, houseTemplate as eQ, hydrateAgentSteps as eR, identity as eS, identityErrorCode as eT, instructions as eU, isAnnotationTag as eV, isConnectorVendorVisible as eW, isDriveSyncVendor as eX, isEntityTag as eY, isFlatKind as eZ, isLabelTag as e_, extractFactIdsFromMessages as ea, extractSubagentLanes as eb, facts as ec, files as ed, filterDocumentTags as ee, filterSkills as ef, findLeafForTaskMessage as eg, findMainSiblingLeaf as eh, findReplyTarget as ei, findSubagentRunId as ej, flattenTagTree as ek, formatAgentStepLabel as el, formatFileSize as em, formatGbp as en, formatGbpPerMillionTokens as eo, formatItemLabel as ep, formatStreamSummary as eq, formatTokens as er, formatUserName as es, formatWorkspaceChoices as et, formatWsMessage as eu, generateEncryptedWorkspaceKey as ev, generateNewWorkspaceKey as ew, getAgentStepLabel as ex, getAttachableRunId as ey, getChildTags as ez, ArbiError as f, isNearAiUsageBudget as f0, isPresenceTag as f1, isSharePointVendor as f2, isSharedSkill as f3, isTraceItem as f4, mail as f5, mcpTools as f6, mergeAgentSteps as f7, notifications as f8, parseSSEEvents as f9, settings as fA, signatureRequests as fB, sliceToSubagentThread as fC, streamSSE as fD, stripCitationMarkdown as fE, subagentJobLabel as fF, summarizeCitations as fG, tagUseCount as fH, tags as fI, tagsForScope as fJ, tagsOfGroup as fK, topLevelAgentSteps as fL, uploadSkill as fM, usdToGbp as fN, work as fO, workflowSteps as fP, workflows as fQ, workspaceConflictOf as fR, workspaces as fS, wouldCreateTagCycle as fT, parseSlashCommand as fa, parseSlashTokenInProgress as fb, parseStructuredResponse as fc, performPasswordLogin as fd, performSigningKeyLogin as fe, performSsoDeviceFlowLogin as ff, pickMainThread as fg, profile as fh, progressFetch as fi, projects as fj, quotaExceededFrom as fk, quotaFromStreamError as fl, reduceOutputItem as fm, refusalReason as fn, requireData as fo, requireOk as fp, resolveAuth as fq, resolveCitations as fr, resolveSummary as fs, resolveWorkspace as ft, responses as fu, searchChunks as fv, selectFullContextDocument as fw, selectWorkspace as fx, selectWorkspaceById as fy, sessions as fz, type ArbiErrorOptions as g, type ArbiHostSession as h, type ArbiOptions as i, ArbiSessionExpiredError as j, ArbiStructuredOutputError as k, ArbiTransportError as l, ArbiWorkspaceChangedError as m, ArbiWorkspaceSupersededError as n, ArbiWorkspaceUnavailableError as o, type AskHandlers as p, type AskRequest as q, type AttendeeRead as r, type AuthContext as s, type AuthHeaders as t, type AuthMode as u, type AuthenticatedClient as v, type BookingPage as w, type BookingPageWriteBody as x, type BookingRequestBody as y, type BridgeTokensOptions as z };
|
|
17535
|
+
export { type CitationSummary as $, ACCOUNT_VENDOR as A, type BookingConfirmation as B, type CalDavConnectBody as C, type CalDavProfile as D, type CalendarAccount as E, type CalendarAccountKind as F, type CalendarCreateBody as G, type CalendarEvent as H, type CalendarKeys as I, type CalendarRead as J, type CalendarSettings as K, type CalendarSettingsBody as L, type CalendarUpdate as M, type CalendarWindow as N, CallApiError as O, type Capabilities as P, type ChatAttachmentFile as Q, type ChatAttachmentInput as R, type ChatCryptoContext as S, type ChatKeyRing as T, type ChatKind as U, type ChatMemberKey as V, type ChatMemberResponse as W, type ChatMessage as X, type ChatMessageResponse as Y, type ChatResponse as Z, type ChatSession as _, type AccountSyncResult as a, type FullContextSelection as a$, type CitationToolSources as a0, type CliConfig as a1, type CliCredentials as a2, type CommandDescriptor as a3, type ConfigStore as a4, type Configuration as a5, type ConfigurationPatch as a6, type ConnectOptions as a7, type ConnectionModel as a8, type ConnectorCatalogEntry as a9, type DecryptedChatMessage as aA, type DeploymentHouseTemplate as aB, type DirectModelUsage as aC, type DocInfo as aD, type DocInfoMap as aE, type DocNameMap as aF, type DocumentAutomationAction as aG, type DocumentListFields as aH, type DocumentListOrder as aI, type DocumentSelector as aJ, type DocumentWaiter as aK, type DocumentWaiterOptions as aL, type DriveSyncProgress as aM, type DriveSyncSummary as aN, DuplicateContactError as aO, ENTITY_KINDS as aP, type EditScope as aQ, type EntityKind as aR, type EventCreateBody as aS, type EventPatchBody as aT, FLAT_TAG_KINDS as aU, type FactResponse as aV, type FactSearchRequest as aW, type FactSearchResponse as aX, type FindTimeParams as aY, type FormattedWsMessage as aZ, type FreeBusyEntry as a_, type ConnectorFolder as aa, type ConnectorSyncProgress as ab, type ConnectorSyncStatus as ac, type ConnectorVendorKey as ad, type ConnectorVisibilitySettings as ae, type ContextUsage as af, type ConversationResponse as ag, type ConversationUsageResponse as ah, type CreateFactRequest as ai, type CreateFactsRequest as aj, type CreateWorkRequest as ak, type CreateWorkflowRequest as al, DEFAULT_AI_USD_PER_GBP as am, DOC_TERMINAL_STATUSES as an, DRIVE_SYNC_VENDORS as ao, type Database as ap, type DatabaseAggregateRequest as aq, type DatabaseAggregateResult as ar, type DatabaseColumn as as, type DatabaseColumnWrite as at, type DatabaseImportResult as au, type DatabaseRow as av, type DatabaseRowPage as aw, type DatabaseRowsQuery as ax, type DateTimeSpec as ay, type DecryptedChat as az, type ActivityKind as b, type RespondPartstat as b$, GOOGLE_VENDORS as b0, type HolidayCountry as b1, type HouseTemplateCandidate as b2, IMANAGE_VENDORS as b3, type IdentityErrorCode as b4, type IdentityPurchase as b5, type IdentityState as b6, type IdentityStatus as b7, type ImportResult as b8, type InvitationRead as b9, type ProductResponse as bA, type ProjectAddonKind as bB, type ProjectAddonSettingsRequest as bC, type ProjectBudget as bD, type ProjectCheckoutRequest as bE, type ProjectConversationUsageResponse as bF, type ProjectCreateOptions as bG, type ProjectDetails as bH, type ProjectEventKind as bI, type ProjectEventResponse as bJ, type ProjectInvoicesResponse as bK, type ProjectNextPeriodAddonsRequest as bL, type ProjectPlanChangeRequest as bM, type ProjectQuoteRequest as bN, type ProjectResponse as bO, type ProjectUpdateRequest as bP, type ProjectUsageResponse as bQ, PublicBookingError as bR, type PublicBookingPage as bS, type QuotaExceeded as bT, type RaisedSignal as bU, type RawResponseEvent as bV, type ReconnectOptions as bW, type ReconnectableWsConnection as bX, type ResolvedCitation as bY, type ResolvedRecipient as bZ, type RespondParams as b_, type JsonSchemaOutputFormat as ba, type LinkedRun as bb, type ListAllOptions as bc, type ListEventsParams as bd, type ListFactsOptions as be, type ListPaginatedOptions as bf, MAILBOX_SYNC_VENDORS as bg, MAX_RETRIEVE_DOC_IDS as bh, MICROSOFT_VENDORS as bi, type MailAttachment as bj, type MessageLevel as bk, type ModelConnection as bl, type OAuthAccountKind as bm, type OutputItemDone as bn, type OverlayItem as bo, type OverlayLayerName as bp, PRESENCE_KINDS as bq, PROMPT_CONTEXT_CHARS as br, type ParsedResponse as bs, type ParsedSlashCommand as bt, type ParsedStructuredResponse as bu, type PendingAuthResponse as bv, type PersonKey as bw, type PersonalConnectionInput as bx, PlanStepsError as by, type PlanWorkRequest as bz, type ActivityResponse as c, type TagResponse as c$, type Response$1 as c0, type ResponseCreateRequest as c1, type ResponseCreateResult as c2, type ResponseHandle as c3, type ResponseSnapshot as c4, type ResponseStart as c5, type ResponseStartOptions as c6, ResponseStream as c7, type ResponseStreamEvent as c8, type ResponseTools as c9, type StepAssignee as cA, type StepDisplay as cB, type StepField as cC, type StepFieldOption as cD, type StepFieldOptionTone as cE, type StepKind as cF, type StepPhase as cG, type StepSignal as cH, type StepSignalWhen as cI, type StepState as cJ, type StepStatus as cK, type SubagentBranchRecord as cL, type SubagentLaneInfo as cM, type SubmitBackgroundQueryOptions as cN, type SubscribeParams as cO, type SyncTriggerResult as cP, TAG_KINDS as cQ, TAG_NESTING_MAX_DEPTH as cR, type TagChange as cS, type TagFieldDefinition as cT, type TagGroup as cU, type TagKind as cV, type TagKindField as cW, type TagKindSchema as cX, type TagLinks as cY, type TagListQuery as cZ, type TagNode as c_, type RoomCreateBody as ca, type RoomQuery as cb, type RoomRead as cc, type RunProgress as cd, type RunStats as ce, type RunStep as cf, type RunWaitingOn as cg, SHAREPOINT_VENDORS as ch, type SSEEvent as ci, type SSEStreamCallbacks as cj, type SSEStreamOutcome as ck, type SSEStreamResult as cl, STEP_FIELD_OPTION_TONES as cm, STOP_ID_WAIT_MS as cn, STOP_REPEAT_WINDOW_MS as co, SUPPORTED_EXTENSIONS as cp, type ScopedTarget as cq, type SearchChunk as cr, type SendBack as cs, type ShareRead as ct, type ShareRole as cu, type SkillSummary as cv, type SkippedFile as cw, type SlackConnectionStatus as cx, type StepActionRequest as cy, type StepActivityEvent as cz, Arbi as d, connectors as d$, type TagScope as d0, type TagTreeRow as d1, type TaskPlan as d2, type TaskPlanStep as d3, type TaxQuoteResponse as d4, type Thread as d5, type ThreadsResponse as d6, type TimeSuggestion as d7, type TurnRequest as d8, type UpdateConversationRequest as d9, account as dA, agentconfig as dB, agents as dC, appendTranscriptionHints as dD, assistant as dE, authenticatedFetch as dF, bookPublicSlot as dG, buildCitationChunkData as dH, buildDocNameMap as dI, buildDocumentTools as dJ, buildFactsContextTool as dK, buildRetrievalChunkTool as dL, buildRetrievalFullContextTool as dM, buildRetrievalTocTool as dN, buildTurnRequest as dO, calendar as dP, calls as dQ, canTagHaveParent as dR, cancelPublicBooking as dS, capabilities as dT, chats as dU, composeConfiguration as dV, composeTools as dW, computeRunStats as dX, connectErrorMessage as dY, connectWebSocket as dZ, connectWithReconnect as d_, type UpdateFactRequest as da, type UpdateWorkflowRequest as db, type UploadBatchResult as dc, type UploadDirectOptions as dd, type UploadDirectResult as de, type UploadDocumentsOptions as df, type UploadOptions as dg, type UploadProgressListener as dh, type UploadResult as di, type UsageBreakdown as dj, type UserConnectorEntry as dk, type UserDailyUsageResponse as dl, type UserInfo as dm, WebSocketAuthError as dn, type WeeklyHoursSpec as dp, type WorkStatus as dq, type WorkflowAuthMode as dr, type WorkflowResponse as ds, type WorkflowRunHistoryResponse as dt, type WorkflowRunResponse as du, type WorkspaceConflict as dv, type WorkspaceContext as dw, type WorkspaceOpenResponse as dx, type WorkspaceResponse as dy, type WsConnection as dz, ArbiApiError as e, isDriveSyncVendor as e$, contacts as e0, continuityPrompt as e1, conversations as e2, countCitations as e3, createAuthenticatedClient as e4, createDocumentWaiter as e5, createIndexAssigner as e6, databases as e7, defaultKindForFormat as e8, doctags as e9, generateNewWorkspaceKey as eA, getAgentStepLabel as eB, getAttachableRunId as eC, getChildTags as eD, getContextRemainingPercent as eE, getContextUsedPercent as eF, getContextUsedTokens as eG, getCurrentStep as eH, getEligibleParentTags as eI, getErrorCode as eJ, getErrorMessage as eK, getPublicBookingPage as eL, getRawWorkspaceKey as eM, getRunToAttach as eN, getRunToCancel as eO, getStepDisplay as eP, getStepTool as eQ, getSubagentBranchRecord as eR, getTagDescendantIds as eS, health as eT, houseTemplate as eU, hydrateAgentSteps as eV, identity as eW, identityErrorCode as eX, instructions as eY, isAnnotationTag as eZ, isConnectorVendorVisible as e_, documentTools as ea, documents as eb, estimateDraftTokens as ec, extractDocumentIdsFromMessages as ed, extractFactIdsFromMessages as ee, extractSubagentLanes as ef, facts as eg, files as eh, filterDocumentTags as ei, filterSkills as ej, findLeafForTaskMessage as ek, findMainSiblingLeaf as el, findReplyTarget as em, findSubagentRunId as en, flattenTagTree as eo, formatAgentStepLabel as ep, formatFileSize as eq, formatGbp as er, formatGbpPerMillionTokens as es, formatItemLabel as et, formatStreamSummary as eu, formatTokens as ev, formatUserName as ew, formatWorkspaceChoices as ex, formatWsMessage as ey, generateEncryptedWorkspaceKey as ez, ArbiError as f, isEntityTag as f0, isFlatKind as f1, isLabelTag as f2, isMailboxSyncVendor as f3, isNearAiUsageBudget as f4, isPresenceTag as f5, isSharePointVendor as f6, isSharedSkill as f7, isTraceItem as f8, mail as f9, searchChunks as fA, selectFullContextDocument as fB, selectWorkspace as fC, selectWorkspaceById as fD, sessions as fE, settings as fF, signatureRequests as fG, sliceToSubagentThread as fH, streamSSE as fI, stripCitationMarkdown as fJ, subagentJobLabel as fK, summarizeCitations as fL, tagUseCount as fM, tags as fN, tagsForScope as fO, tagsOfGroup as fP, topLevelAgentSteps as fQ, uploadSkill as fR, usdToGbp as fS, work as fT, workflowSteps as fU, workflows as fV, workspaceConflictOf as fW, workspaces as fX, wouldCreateTagCycle as fY, mcpTools as fa, mergeAgentSteps as fb, modelConnections as fc, notifications as fd, parseSSEEvents as fe, parseSlashCommand as ff, parseSlashTokenInProgress as fg, parseStructuredResponse as fh, performPasswordLogin as fi, performSigningKeyLogin as fj, performSsoDeviceFlowLogin as fk, pickMainThread as fl, profile as fm, progressFetch as fn, projects as fo, quotaExceededFrom as fp, quotaFromStreamError as fq, reduceOutputItem as fr, refusalReason as fs, requireData as ft, requireOk as fu, resolveAuth as fv, resolveCitations as fw, resolveSummary as fx, resolveWorkspace as fy, responses as fz, type ArbiErrorOptions as g, type ArbiHostSession as h, type ArbiOptions as i, ArbiSessionExpiredError as j, ArbiStructuredOutputError as k, ArbiTransportError as l, ArbiWorkspaceChangedError as m, ArbiWorkspaceSupersededError as n, ArbiWorkspaceUnavailableError as o, type AskHandlers as p, type AskRequest as q, type AttendeeRead as r, type AuthContext as s, type AuthHeaders as t, type AuthMode as u, type AuthenticatedClient as v, type BookingPage as w, type BookingPageWriteBody as x, type BookingRequestBody as y, type BridgeTokensOptions as z };
|
|
@@ -2037,6 +2037,84 @@ declare namespace houseTemplate {
|
|
|
2037
2037
|
export { type houseTemplate_DeploymentHouseTemplate as DeploymentHouseTemplate, type houseTemplate_HouseTemplateCandidate as HouseTemplateCandidate, houseTemplate_getDeploymentHouseTemplate as getDeploymentHouseTemplate, houseTemplate_isDeploymentAdmin as isDeploymentAdmin, houseTemplate_listHouseTemplateCandidates as listHouseTemplateCandidates, houseTemplate_setDeploymentHouseTemplate as setDeploymentHouseTemplate, houseTemplate_setWorkspaceHouseTemplate as setWorkspaceHouseTemplate, houseTemplate_supportsHouseTemplates as supportsHouseTemplates, houseTemplate_workspaceHouseTemplateId as workspaceHouseTemplateId };
|
|
2038
2038
|
}
|
|
2039
2039
|
|
|
2040
|
+
/**
|
|
2041
|
+
* Model connections (`/v1/model-connections`): OpenAI-compatible Chat Completions endpoints the
|
|
2042
|
+
* main agent may use. A box connection is the deployment's; a personal one is the user's own.
|
|
2043
|
+
*
|
|
2044
|
+
* A personal API key is sealed to the user's identity at rest (`sealPersonalApiKey`). A live
|
|
2045
|
+
* session can use it only after the client unseals it and deposits a copy sealed to the session
|
|
2046
|
+
* key (`unlockModelConnections`, run at sign-in and from Settings).
|
|
2047
|
+
*/
|
|
2048
|
+
|
|
2049
|
+
type ConnectionModel = components['schemas']['ConnectionModel'] & {
|
|
2050
|
+
reference?: string;
|
|
2051
|
+
};
|
|
2052
|
+
interface ModelConnection {
|
|
2053
|
+
id: string;
|
|
2054
|
+
name: string;
|
|
2055
|
+
protocol: 'openai_chat_completions';
|
|
2056
|
+
base_url: string;
|
|
2057
|
+
scope: 'personal' | 'box';
|
|
2058
|
+
enabled: boolean;
|
|
2059
|
+
allow_private_network: boolean;
|
|
2060
|
+
has_api_key: boolean;
|
|
2061
|
+
models: ConnectionModel[];
|
|
2062
|
+
sealed_api_key?: string;
|
|
2063
|
+
}
|
|
2064
|
+
/** The user's direct model calls of the last 30 days (billed by their provider, not ARBI). */
|
|
2065
|
+
interface DirectModelUsage {
|
|
2066
|
+
calls: Array<{
|
|
2067
|
+
id: string;
|
|
2068
|
+
connection_id: string;
|
|
2069
|
+
provider_model: string;
|
|
2070
|
+
status: string;
|
|
2071
|
+
input_tokens: number | null;
|
|
2072
|
+
output_tokens: number | null;
|
|
2073
|
+
created_at: string;
|
|
2074
|
+
}>;
|
|
2075
|
+
}
|
|
2076
|
+
type ModelConnectionWrite = components['schemas']['ConnectionWrite'];
|
|
2077
|
+
/** A personal connection to save: `id` replaces that one; `apiKey` is sealed before it is sent. */
|
|
2078
|
+
type PersonalConnectionInput = Omit<ModelConnectionWrite, 'protocol' | 'allow_private_network' | 'sealed_api_key' | 'api_key'> & {
|
|
2079
|
+
id?: string;
|
|
2080
|
+
apiKey?: string;
|
|
2081
|
+
};
|
|
2082
|
+
/** The keys an unlock needs: the user's identity key and the server session's key. */
|
|
2083
|
+
interface ModelConnectionKeys {
|
|
2084
|
+
signingPrivateKey: Uint8Array;
|
|
2085
|
+
serverSessionKey: Uint8Array;
|
|
2086
|
+
}
|
|
2087
|
+
/** The box's connections and the user's own. */
|
|
2088
|
+
declare function listConnections(arbi: ArbiClient): Promise<ModelConnection[]>;
|
|
2089
|
+
/** The user's direct model calls of the last 30 days. */
|
|
2090
|
+
declare function directUsage(arbi: ArbiClient): Promise<DirectModelUsage>;
|
|
2091
|
+
/** Add a personal connection, or replace the one `id` names. */
|
|
2092
|
+
declare function savePersonalConnection(arbi: ArbiClient, body: ModelConnectionWrite, id?: string): Promise<ModelConnection>;
|
|
2093
|
+
declare function removeConnection(arbi: ArbiClient, id: string): Promise<void>;
|
|
2094
|
+
/** Seal a provider API key to the user's identity; the plaintext bytes are wiped. */
|
|
2095
|
+
declare function sealPersonalApiKey(apiKey: string, signingPrivateKey: Uint8Array): Promise<string>;
|
|
2096
|
+
/**
|
|
2097
|
+
* Let this server session use the user's enabled personal keys (only `onlyId`'s when given):
|
|
2098
|
+
* unseal each with the identity key and deposit a copy sealed to the session key.
|
|
2099
|
+
*/
|
|
2100
|
+
declare function unlockModelConnections(arbi: ArbiClient, keys: ModelConnectionKeys, onlyId?: string): Promise<void>;
|
|
2101
|
+
|
|
2102
|
+
type modelConnections_ConnectionModel = ConnectionModel;
|
|
2103
|
+
type modelConnections_DirectModelUsage = DirectModelUsage;
|
|
2104
|
+
type modelConnections_ModelConnection = ModelConnection;
|
|
2105
|
+
type modelConnections_ModelConnectionKeys = ModelConnectionKeys;
|
|
2106
|
+
type modelConnections_ModelConnectionWrite = ModelConnectionWrite;
|
|
2107
|
+
type modelConnections_PersonalConnectionInput = PersonalConnectionInput;
|
|
2108
|
+
declare const modelConnections_directUsage: typeof directUsage;
|
|
2109
|
+
declare const modelConnections_listConnections: typeof listConnections;
|
|
2110
|
+
declare const modelConnections_removeConnection: typeof removeConnection;
|
|
2111
|
+
declare const modelConnections_savePersonalConnection: typeof savePersonalConnection;
|
|
2112
|
+
declare const modelConnections_sealPersonalApiKey: typeof sealPersonalApiKey;
|
|
2113
|
+
declare const modelConnections_unlockModelConnections: typeof unlockModelConnections;
|
|
2114
|
+
declare namespace modelConnections {
|
|
2115
|
+
export { type modelConnections_ConnectionModel as ConnectionModel, type modelConnections_DirectModelUsage as DirectModelUsage, type modelConnections_ModelConnection as ModelConnection, type modelConnections_ModelConnectionKeys as ModelConnectionKeys, type modelConnections_ModelConnectionWrite as ModelConnectionWrite, type modelConnections_PersonalConnectionInput as PersonalConnectionInput, modelConnections_directUsage as directUsage, modelConnections_listConnections as listConnections, modelConnections_removeConnection as removeConnection, modelConnections_savePersonalConnection as savePersonalConnection, modelConnections_sealPersonalApiKey as sealPersonalApiKey, modelConnections_unlockModelConnections as unlockModelConnections };
|
|
2116
|
+
}
|
|
2117
|
+
|
|
2040
2118
|
/**
|
|
2041
2119
|
* Workspace operations — list, create, delete, update, users, copy.
|
|
2042
2120
|
*/
|
|
@@ -15668,6 +15746,23 @@ declare class Arbi {
|
|
|
15668
15746
|
file_name: string;
|
|
15669
15747
|
}[]>;
|
|
15670
15748
|
};
|
|
15749
|
+
/**
|
|
15750
|
+
* The main agent's OpenAI-compatible endpoints: the box's and the user's own. A personal key is
|
|
15751
|
+
* sealed to the user's identity and usable by a session only once unlocked on it.
|
|
15752
|
+
*/
|
|
15753
|
+
readonly modelConnections: {
|
|
15754
|
+
list: () => Promise<ModelConnection[]>;
|
|
15755
|
+
/** The user's direct model calls of the last 30 days. */
|
|
15756
|
+
usage: () => Promise<DirectModelUsage>;
|
|
15757
|
+
/**
|
|
15758
|
+
* Add a personal connection (or replace `id`'s). An `apiKey` is sealed to the identity before
|
|
15759
|
+
* it is sent; an enabled connection with a key is unlocked on this session at once.
|
|
15760
|
+
*/
|
|
15761
|
+
save: ({ id, apiKey, ...body }: PersonalConnectionInput) => Promise<ModelConnection>;
|
|
15762
|
+
remove: (id: string) => Promise<void>;
|
|
15763
|
+
/** Let this session use the user's enabled personal keys (only `onlyId`'s when given). */
|
|
15764
|
+
unlock: (onlyId?: string) => Promise<void>;
|
|
15765
|
+
};
|
|
15671
15766
|
readonly databases: {
|
|
15672
15767
|
list: () => Promise<{
|
|
15673
15768
|
id: string;
|
|
@@ -15881,6 +15976,8 @@ declare class Arbi {
|
|
|
15881
15976
|
};
|
|
15882
15977
|
private requireClient;
|
|
15883
15978
|
private requireLogin;
|
|
15979
|
+
/** The signed-in user's identity (signing) key. */
|
|
15980
|
+
private identityKey;
|
|
15884
15981
|
private requireWorkspace;
|
|
15885
15982
|
}
|
|
15886
15983
|
|
|
@@ -17435,4 +17532,4 @@ declare function documentTools(options: {
|
|
|
17435
17532
|
/** Add replaces matching tool names; replace discards all previous tools. No mutation of inputs. */
|
|
17436
17533
|
declare function composeTools(base: ResponseTools, next: ResponseTools, mode: 'add' | 'replace'): ResponseTools;
|
|
17437
17534
|
|
|
17438
|
-
export { type CitationSummary as $, ACCOUNT_VENDOR as A, type BookingConfirmation as B, type CalDavConnectBody as C, type CalDavProfile as D, type CalendarAccount as E, type CalendarAccountKind as F, type CalendarCreateBody as G, type CalendarEvent as H, type CalendarKeys as I, type CalendarRead as J, type CalendarSettings as K, type CalendarSettingsBody as L, type CalendarUpdate as M, type CalendarWindow as N, CallApiError as O, type Capabilities as P, type ChatAttachmentFile as Q, type ChatAttachmentInput as R, type ChatCryptoContext as S, type ChatKeyRing as T, type ChatKind as U, type ChatMemberKey as V, type ChatMemberResponse as W, type ChatMessage as X, type ChatMessageResponse as Y, type ChatResponse as Z, type ChatSession as _, type AccountSyncResult as a, type HolidayCountry as a$, type CitationToolSources as a0, type CliConfig as a1, type CliCredentials as a2, type CommandDescriptor as a3, type ConfigStore as a4, type Configuration as a5, type ConfigurationPatch as a6, type ConnectOptions as a7, type ConnectorCatalogEntry as a8, type ConnectorFolder as a9, type DeploymentHouseTemplate as aA, type DocInfo as aB, type DocInfoMap as aC, type DocNameMap as aD, type DocumentAutomationAction as aE, type DocumentListFields as aF, type DocumentListOrder as aG, type DocumentSelector as aH, type DocumentWaiter as aI, type DocumentWaiterOptions as aJ, type DriveSyncProgress as aK, type DriveSyncSummary as aL, DuplicateContactError as aM, ENTITY_KINDS as aN, type EditScope as aO, type EntityKind as aP, type EventCreateBody as aQ, type EventPatchBody as aR, FLAT_TAG_KINDS as aS, type FactResponse as aT, type FactSearchRequest as aU, type FactSearchResponse as aV, type FindTimeParams as aW, type FormattedWsMessage as aX, type FreeBusyEntry as aY, type FullContextSelection as aZ, GOOGLE_VENDORS as a_, type ConnectorSyncProgress as aa, type ConnectorSyncStatus as ab, type ConnectorVendorKey as ac, type ConnectorVisibilitySettings as ad, type ContextUsage as ae, type ConversationResponse as af, type ConversationUsageResponse as ag, type CreateFactRequest as ah, type CreateFactsRequest as ai, type CreateWorkRequest as aj, type CreateWorkflowRequest as ak, DEFAULT_AI_USD_PER_GBP as al, DOC_TERMINAL_STATUSES as am, DRIVE_SYNC_VENDORS as an, type Database as ao, type DatabaseAggregateRequest as ap, type DatabaseAggregateResult as aq, type DatabaseColumn as ar, type DatabaseColumnWrite as as, type DatabaseImportResult as at, type DatabaseRow as au, type DatabaseRowPage as av, type DatabaseRowsQuery as aw, type DateTimeSpec as ax, type DecryptedChat as ay, type DecryptedChatMessage as az, type ActivityKind as b, type ResponseHandle as b$, type HouseTemplateCandidate as b0, IMANAGE_VENDORS as b1, type IdentityErrorCode as b2, type IdentityPurchase as b3, type IdentityState as b4, type IdentityStatus as b5, type ImportResult as b6, type InvitationRead as b7, type JsonSchemaOutputFormat as b8, type LinkedRun as b9, type ProjectCheckoutRequest as bA, type ProjectConversationUsageResponse as bB, type ProjectCreateOptions as bC, type ProjectDetails as bD, type ProjectEventKind as bE, type ProjectEventResponse as bF, type ProjectInvoicesResponse as bG, type ProjectNextPeriodAddonsRequest as bH, type ProjectPlanChangeRequest as bI, type ProjectQuoteRequest as bJ, type ProjectResponse as bK, type ProjectUpdateRequest as bL, type ProjectUsageResponse as bM, PublicBookingError as bN, type PublicBookingPage as bO, type QuotaExceeded as bP, type RaisedSignal as bQ, type RawResponseEvent as bR, type ReconnectOptions as bS, type ReconnectableWsConnection as bT, type ResolvedCitation as bU, type ResolvedRecipient as bV, type RespondParams as bW, type RespondPartstat as bX, type Response$1 as bY, type ResponseCreateRequest as bZ, type ResponseCreateResult as b_, type ListAllOptions as ba, type ListEventsParams as bb, type ListFactsOptions as bc, type ListPaginatedOptions as bd, MAILBOX_SYNC_VENDORS as be, MAX_RETRIEVE_DOC_IDS as bf, MICROSOFT_VENDORS as bg, type MailAttachment as bh, type MessageLevel as bi, type OAuthAccountKind as bj, type OutputItemDone as bk, type OverlayItem as bl, type OverlayLayerName as bm, PRESENCE_KINDS as bn, PROMPT_CONTEXT_CHARS as bo, type ParsedResponse as bp, type ParsedSlashCommand as bq, type ParsedStructuredResponse as br, type PendingAuthResponse as bs, type PersonKey as bt, PlanStepsError as bu, type PlanWorkRequest as bv, type ProductResponse as bw, type ProjectAddonKind as bx, type ProjectAddonSettingsRequest as by, type ProjectBudget as bz, type ActivityResponse as c, type TaskPlanStep as c$, type ResponseSnapshot as c0, type ResponseStart as c1, type ResponseStartOptions as c2, ResponseStream as c3, type ResponseStreamEvent as c4, type ResponseTools as c5, type RoomCreateBody as c6, type RoomQuery as c7, type RoomRead as c8, type RunProgress as c9, type StepFieldOptionTone as cA, type StepKind as cB, type StepPhase as cC, type StepSignal as cD, type StepSignalWhen as cE, type StepState as cF, type StepStatus as cG, type SubagentBranchRecord as cH, type SubagentLaneInfo as cI, type SubmitBackgroundQueryOptions as cJ, type SubscribeParams as cK, type SyncTriggerResult as cL, TAG_KINDS as cM, TAG_NESTING_MAX_DEPTH as cN, type TagChange as cO, type TagFieldDefinition as cP, type TagGroup as cQ, type TagKind as cR, type TagKindField as cS, type TagKindSchema as cT, type TagLinks as cU, type TagListQuery as cV, type TagNode as cW, type TagResponse as cX, type TagScope as cY, type TagTreeRow as cZ, type TaskPlan as c_, type RunStats as ca, type RunStep as cb, type RunWaitingOn as cc, SHAREPOINT_VENDORS as cd, type SSEEvent as ce, type SSEStreamCallbacks as cf, type SSEStreamOutcome as cg, type SSEStreamResult as ch, STEP_FIELD_OPTION_TONES as ci, STOP_ID_WAIT_MS as cj, STOP_REPEAT_WINDOW_MS as ck, SUPPORTED_EXTENSIONS as cl, type ScopedTarget as cm, type SearchChunk as cn, type SendBack as co, type ShareRead as cp, type ShareRole as cq, type SkillSummary as cr, type SkippedFile as cs, type SlackConnectionStatus as ct, type StepActionRequest as cu, type StepActivityEvent as cv, type StepAssignee as cw, type StepDisplay as cx, type StepField as cy, type StepFieldOption as cz, Arbi as d, countCitations as d$, type TaxQuoteResponse as d0, type Thread as d1, type ThreadsResponse as d2, type TimeSuggestion as d3, type TurnRequest as d4, type UpdateConversationRequest as d5, type UpdateFactRequest as d6, type UpdateWorkflowRequest as d7, type UploadBatchResult as d8, type UploadDirectOptions as d9, assistant as dA, authenticatedFetch as dB, bookPublicSlot as dC, buildCitationChunkData as dD, buildDocNameMap as dE, buildDocumentTools as dF, buildFactsContextTool as dG, buildRetrievalChunkTool as dH, buildRetrievalFullContextTool as dI, buildRetrievalTocTool as dJ, buildTurnRequest as dK, calendar as dL, calls as dM, canTagHaveParent as dN, cancelPublicBooking as dO, capabilities as dP, chats as dQ, composeConfiguration as dR, composeTools as dS, computeRunStats as dT, connectErrorMessage as dU, connectWebSocket as dV, connectWithReconnect as dW, connectors as dX, contacts as dY, continuityPrompt as dZ, conversations as d_, type UploadDirectResult as da, type UploadDocumentsOptions as db, type UploadOptions as dc, type UploadProgressListener as dd, type UploadResult as de, type UsageBreakdown as df, type UserConnectorEntry as dg, type UserDailyUsageResponse as dh, type UserInfo as di, WebSocketAuthError as dj, type WeeklyHoursSpec as dk, type WorkStatus as dl, type WorkflowAuthMode as dm, type WorkflowResponse as dn, type WorkflowRunHistoryResponse as dp, type WorkflowRunResponse as dq, type WorkspaceConflict as dr, type WorkspaceContext as ds, type WorkspaceOpenResponse as dt, type WorkspaceResponse as du, type WsConnection as dv, account as dw, agentconfig as dx, agents as dy, appendTranscriptionHints as dz, ArbiApiError as e, isMailboxSyncVendor as e$, createAuthenticatedClient as e0, createDocumentWaiter as e1, createIndexAssigner as e2, databases as e3, defaultKindForFormat as e4, doctags as e5, documentTools as e6, documents as e7, estimateDraftTokens as e8, extractDocumentIdsFromMessages as e9, getContextRemainingPercent as eA, getContextUsedPercent as eB, getContextUsedTokens as eC, getCurrentStep as eD, getEligibleParentTags as eE, getErrorCode as eF, getErrorMessage as eG, getPublicBookingPage as eH, getRawWorkspaceKey as eI, getRunToAttach as eJ, getRunToCancel as eK, getStepDisplay as eL, getStepTool as eM, getSubagentBranchRecord as eN, getTagDescendantIds as eO, health as eP, houseTemplate as eQ, hydrateAgentSteps as eR, identity as eS, identityErrorCode as eT, instructions as eU, isAnnotationTag as eV, isConnectorVendorVisible as eW, isDriveSyncVendor as eX, isEntityTag as eY, isFlatKind as eZ, isLabelTag as e_, extractFactIdsFromMessages as ea, extractSubagentLanes as eb, facts as ec, files as ed, filterDocumentTags as ee, filterSkills as ef, findLeafForTaskMessage as eg, findMainSiblingLeaf as eh, findReplyTarget as ei, findSubagentRunId as ej, flattenTagTree as ek, formatAgentStepLabel as el, formatFileSize as em, formatGbp as en, formatGbpPerMillionTokens as eo, formatItemLabel as ep, formatStreamSummary as eq, formatTokens as er, formatUserName as es, formatWorkspaceChoices as et, formatWsMessage as eu, generateEncryptedWorkspaceKey as ev, generateNewWorkspaceKey as ew, getAgentStepLabel as ex, getAttachableRunId as ey, getChildTags as ez, ArbiError as f, isNearAiUsageBudget as f0, isPresenceTag as f1, isSharePointVendor as f2, isSharedSkill as f3, isTraceItem as f4, mail as f5, mcpTools as f6, mergeAgentSteps as f7, notifications as f8, parseSSEEvents as f9, settings as fA, signatureRequests as fB, sliceToSubagentThread as fC, streamSSE as fD, stripCitationMarkdown as fE, subagentJobLabel as fF, summarizeCitations as fG, tagUseCount as fH, tags as fI, tagsForScope as fJ, tagsOfGroup as fK, topLevelAgentSteps as fL, uploadSkill as fM, usdToGbp as fN, work as fO, workflowSteps as fP, workflows as fQ, workspaceConflictOf as fR, workspaces as fS, wouldCreateTagCycle as fT, parseSlashCommand as fa, parseSlashTokenInProgress as fb, parseStructuredResponse as fc, performPasswordLogin as fd, performSigningKeyLogin as fe, performSsoDeviceFlowLogin as ff, pickMainThread as fg, profile as fh, progressFetch as fi, projects as fj, quotaExceededFrom as fk, quotaFromStreamError as fl, reduceOutputItem as fm, refusalReason as fn, requireData as fo, requireOk as fp, resolveAuth as fq, resolveCitations as fr, resolveSummary as fs, resolveWorkspace as ft, responses as fu, searchChunks as fv, selectFullContextDocument as fw, selectWorkspace as fx, selectWorkspaceById as fy, sessions as fz, type ArbiErrorOptions as g, type ArbiHostSession as h, type ArbiOptions as i, ArbiSessionExpiredError as j, ArbiStructuredOutputError as k, ArbiTransportError as l, ArbiWorkspaceChangedError as m, ArbiWorkspaceSupersededError as n, ArbiWorkspaceUnavailableError as o, type AskHandlers as p, type AskRequest as q, type AttendeeRead as r, type AuthContext as s, type AuthHeaders as t, type AuthMode as u, type AuthenticatedClient as v, type BookingPage as w, type BookingPageWriteBody as x, type BookingRequestBody as y, type BridgeTokensOptions as z };
|
|
17535
|
+
export { type CitationSummary as $, ACCOUNT_VENDOR as A, type BookingConfirmation as B, type CalDavConnectBody as C, type CalDavProfile as D, type CalendarAccount as E, type CalendarAccountKind as F, type CalendarCreateBody as G, type CalendarEvent as H, type CalendarKeys as I, type CalendarRead as J, type CalendarSettings as K, type CalendarSettingsBody as L, type CalendarUpdate as M, type CalendarWindow as N, CallApiError as O, type Capabilities as P, type ChatAttachmentFile as Q, type ChatAttachmentInput as R, type ChatCryptoContext as S, type ChatKeyRing as T, type ChatKind as U, type ChatMemberKey as V, type ChatMemberResponse as W, type ChatMessage as X, type ChatMessageResponse as Y, type ChatResponse as Z, type ChatSession as _, type AccountSyncResult as a, type FullContextSelection as a$, type CitationToolSources as a0, type CliConfig as a1, type CliCredentials as a2, type CommandDescriptor as a3, type ConfigStore as a4, type Configuration as a5, type ConfigurationPatch as a6, type ConnectOptions as a7, type ConnectionModel as a8, type ConnectorCatalogEntry as a9, type DecryptedChatMessage as aA, type DeploymentHouseTemplate as aB, type DirectModelUsage as aC, type DocInfo as aD, type DocInfoMap as aE, type DocNameMap as aF, type DocumentAutomationAction as aG, type DocumentListFields as aH, type DocumentListOrder as aI, type DocumentSelector as aJ, type DocumentWaiter as aK, type DocumentWaiterOptions as aL, type DriveSyncProgress as aM, type DriveSyncSummary as aN, DuplicateContactError as aO, ENTITY_KINDS as aP, type EditScope as aQ, type EntityKind as aR, type EventCreateBody as aS, type EventPatchBody as aT, FLAT_TAG_KINDS as aU, type FactResponse as aV, type FactSearchRequest as aW, type FactSearchResponse as aX, type FindTimeParams as aY, type FormattedWsMessage as aZ, type FreeBusyEntry as a_, type ConnectorFolder as aa, type ConnectorSyncProgress as ab, type ConnectorSyncStatus as ac, type ConnectorVendorKey as ad, type ConnectorVisibilitySettings as ae, type ContextUsage as af, type ConversationResponse as ag, type ConversationUsageResponse as ah, type CreateFactRequest as ai, type CreateFactsRequest as aj, type CreateWorkRequest as ak, type CreateWorkflowRequest as al, DEFAULT_AI_USD_PER_GBP as am, DOC_TERMINAL_STATUSES as an, DRIVE_SYNC_VENDORS as ao, type Database as ap, type DatabaseAggregateRequest as aq, type DatabaseAggregateResult as ar, type DatabaseColumn as as, type DatabaseColumnWrite as at, type DatabaseImportResult as au, type DatabaseRow as av, type DatabaseRowPage as aw, type DatabaseRowsQuery as ax, type DateTimeSpec as ay, type DecryptedChat as az, type ActivityKind as b, type RespondPartstat as b$, GOOGLE_VENDORS as b0, type HolidayCountry as b1, type HouseTemplateCandidate as b2, IMANAGE_VENDORS as b3, type IdentityErrorCode as b4, type IdentityPurchase as b5, type IdentityState as b6, type IdentityStatus as b7, type ImportResult as b8, type InvitationRead as b9, type ProductResponse as bA, type ProjectAddonKind as bB, type ProjectAddonSettingsRequest as bC, type ProjectBudget as bD, type ProjectCheckoutRequest as bE, type ProjectConversationUsageResponse as bF, type ProjectCreateOptions as bG, type ProjectDetails as bH, type ProjectEventKind as bI, type ProjectEventResponse as bJ, type ProjectInvoicesResponse as bK, type ProjectNextPeriodAddonsRequest as bL, type ProjectPlanChangeRequest as bM, type ProjectQuoteRequest as bN, type ProjectResponse as bO, type ProjectUpdateRequest as bP, type ProjectUsageResponse as bQ, PublicBookingError as bR, type PublicBookingPage as bS, type QuotaExceeded as bT, type RaisedSignal as bU, type RawResponseEvent as bV, type ReconnectOptions as bW, type ReconnectableWsConnection as bX, type ResolvedCitation as bY, type ResolvedRecipient as bZ, type RespondParams as b_, type JsonSchemaOutputFormat as ba, type LinkedRun as bb, type ListAllOptions as bc, type ListEventsParams as bd, type ListFactsOptions as be, type ListPaginatedOptions as bf, MAILBOX_SYNC_VENDORS as bg, MAX_RETRIEVE_DOC_IDS as bh, MICROSOFT_VENDORS as bi, type MailAttachment as bj, type MessageLevel as bk, type ModelConnection as bl, type OAuthAccountKind as bm, type OutputItemDone as bn, type OverlayItem as bo, type OverlayLayerName as bp, PRESENCE_KINDS as bq, PROMPT_CONTEXT_CHARS as br, type ParsedResponse as bs, type ParsedSlashCommand as bt, type ParsedStructuredResponse as bu, type PendingAuthResponse as bv, type PersonKey as bw, type PersonalConnectionInput as bx, PlanStepsError as by, type PlanWorkRequest as bz, type ActivityResponse as c, type TagResponse as c$, type Response$1 as c0, type ResponseCreateRequest as c1, type ResponseCreateResult as c2, type ResponseHandle as c3, type ResponseSnapshot as c4, type ResponseStart as c5, type ResponseStartOptions as c6, ResponseStream as c7, type ResponseStreamEvent as c8, type ResponseTools as c9, type StepAssignee as cA, type StepDisplay as cB, type StepField as cC, type StepFieldOption as cD, type StepFieldOptionTone as cE, type StepKind as cF, type StepPhase as cG, type StepSignal as cH, type StepSignalWhen as cI, type StepState as cJ, type StepStatus as cK, type SubagentBranchRecord as cL, type SubagentLaneInfo as cM, type SubmitBackgroundQueryOptions as cN, type SubscribeParams as cO, type SyncTriggerResult as cP, TAG_KINDS as cQ, TAG_NESTING_MAX_DEPTH as cR, type TagChange as cS, type TagFieldDefinition as cT, type TagGroup as cU, type TagKind as cV, type TagKindField as cW, type TagKindSchema as cX, type TagLinks as cY, type TagListQuery as cZ, type TagNode as c_, type RoomCreateBody as ca, type RoomQuery as cb, type RoomRead as cc, type RunProgress as cd, type RunStats as ce, type RunStep as cf, type RunWaitingOn as cg, SHAREPOINT_VENDORS as ch, type SSEEvent as ci, type SSEStreamCallbacks as cj, type SSEStreamOutcome as ck, type SSEStreamResult as cl, STEP_FIELD_OPTION_TONES as cm, STOP_ID_WAIT_MS as cn, STOP_REPEAT_WINDOW_MS as co, SUPPORTED_EXTENSIONS as cp, type ScopedTarget as cq, type SearchChunk as cr, type SendBack as cs, type ShareRead as ct, type ShareRole as cu, type SkillSummary as cv, type SkippedFile as cw, type SlackConnectionStatus as cx, type StepActionRequest as cy, type StepActivityEvent as cz, Arbi as d, connectors as d$, type TagScope as d0, type TagTreeRow as d1, type TaskPlan as d2, type TaskPlanStep as d3, type TaxQuoteResponse as d4, type Thread as d5, type ThreadsResponse as d6, type TimeSuggestion as d7, type TurnRequest as d8, type UpdateConversationRequest as d9, account as dA, agentconfig as dB, agents as dC, appendTranscriptionHints as dD, assistant as dE, authenticatedFetch as dF, bookPublicSlot as dG, buildCitationChunkData as dH, buildDocNameMap as dI, buildDocumentTools as dJ, buildFactsContextTool as dK, buildRetrievalChunkTool as dL, buildRetrievalFullContextTool as dM, buildRetrievalTocTool as dN, buildTurnRequest as dO, calendar as dP, calls as dQ, canTagHaveParent as dR, cancelPublicBooking as dS, capabilities as dT, chats as dU, composeConfiguration as dV, composeTools as dW, computeRunStats as dX, connectErrorMessage as dY, connectWebSocket as dZ, connectWithReconnect as d_, type UpdateFactRequest as da, type UpdateWorkflowRequest as db, type UploadBatchResult as dc, type UploadDirectOptions as dd, type UploadDirectResult as de, type UploadDocumentsOptions as df, type UploadOptions as dg, type UploadProgressListener as dh, type UploadResult as di, type UsageBreakdown as dj, type UserConnectorEntry as dk, type UserDailyUsageResponse as dl, type UserInfo as dm, WebSocketAuthError as dn, type WeeklyHoursSpec as dp, type WorkStatus as dq, type WorkflowAuthMode as dr, type WorkflowResponse as ds, type WorkflowRunHistoryResponse as dt, type WorkflowRunResponse as du, type WorkspaceConflict as dv, type WorkspaceContext as dw, type WorkspaceOpenResponse as dx, type WorkspaceResponse as dy, type WsConnection as dz, ArbiApiError as e, isDriveSyncVendor as e$, contacts as e0, continuityPrompt as e1, conversations as e2, countCitations as e3, createAuthenticatedClient as e4, createDocumentWaiter as e5, createIndexAssigner as e6, databases as e7, defaultKindForFormat as e8, doctags as e9, generateNewWorkspaceKey as eA, getAgentStepLabel as eB, getAttachableRunId as eC, getChildTags as eD, getContextRemainingPercent as eE, getContextUsedPercent as eF, getContextUsedTokens as eG, getCurrentStep as eH, getEligibleParentTags as eI, getErrorCode as eJ, getErrorMessage as eK, getPublicBookingPage as eL, getRawWorkspaceKey as eM, getRunToAttach as eN, getRunToCancel as eO, getStepDisplay as eP, getStepTool as eQ, getSubagentBranchRecord as eR, getTagDescendantIds as eS, health as eT, houseTemplate as eU, hydrateAgentSteps as eV, identity as eW, identityErrorCode as eX, instructions as eY, isAnnotationTag as eZ, isConnectorVendorVisible as e_, documentTools as ea, documents as eb, estimateDraftTokens as ec, extractDocumentIdsFromMessages as ed, extractFactIdsFromMessages as ee, extractSubagentLanes as ef, facts as eg, files as eh, filterDocumentTags as ei, filterSkills as ej, findLeafForTaskMessage as ek, findMainSiblingLeaf as el, findReplyTarget as em, findSubagentRunId as en, flattenTagTree as eo, formatAgentStepLabel as ep, formatFileSize as eq, formatGbp as er, formatGbpPerMillionTokens as es, formatItemLabel as et, formatStreamSummary as eu, formatTokens as ev, formatUserName as ew, formatWorkspaceChoices as ex, formatWsMessage as ey, generateEncryptedWorkspaceKey as ez, ArbiError as f, isEntityTag as f0, isFlatKind as f1, isLabelTag as f2, isMailboxSyncVendor as f3, isNearAiUsageBudget as f4, isPresenceTag as f5, isSharePointVendor as f6, isSharedSkill as f7, isTraceItem as f8, mail as f9, searchChunks as fA, selectFullContextDocument as fB, selectWorkspace as fC, selectWorkspaceById as fD, sessions as fE, settings as fF, signatureRequests as fG, sliceToSubagentThread as fH, streamSSE as fI, stripCitationMarkdown as fJ, subagentJobLabel as fK, summarizeCitations as fL, tagUseCount as fM, tags as fN, tagsForScope as fO, tagsOfGroup as fP, topLevelAgentSteps as fQ, uploadSkill as fR, usdToGbp as fS, work as fT, workflowSteps as fU, workflows as fV, workspaceConflictOf as fW, workspaces as fX, wouldCreateTagCycle as fY, mcpTools as fa, mergeAgentSteps as fb, modelConnections as fc, notifications as fd, parseSSEEvents as fe, parseSlashCommand as ff, parseSlashTokenInProgress as fg, parseStructuredResponse as fh, performPasswordLogin as fi, performSigningKeyLogin as fj, performSsoDeviceFlowLogin as fk, pickMainThread as fl, profile as fm, progressFetch as fn, projects as fo, quotaExceededFrom as fp, quotaFromStreamError as fq, reduceOutputItem as fr, refusalReason as fs, requireData as ft, requireOk as fu, resolveAuth as fv, resolveCitations as fw, resolveSummary as fx, resolveWorkspace as fy, responses as fz, type ArbiErrorOptions as g, type ArbiHostSession as h, type ArbiOptions as i, ArbiSessionExpiredError as j, ArbiStructuredOutputError as k, ArbiTransportError as l, ArbiWorkspaceChangedError as m, ArbiWorkspaceSupersededError as n, ArbiWorkspaceUnavailableError as o, type AskHandlers as p, type AskRequest as q, type AttendeeRead as r, type AuthContext as s, type AuthHeaders as t, type AuthMode as u, type AuthenticatedClient as v, type BookingPage as w, type BookingPageWriteBody as x, type BookingRequestBody as y, type BridgeTokensOptions as z };
|
package/dist/browser.cjs
CHANGED
|
@@ -5911,6 +5911,82 @@ async function listHouseTemplateCandidates(arbi) {
|
|
|
5911
5911
|
);
|
|
5912
5912
|
}
|
|
5913
5913
|
|
|
5914
|
+
// src/operations/model-connections.ts
|
|
5915
|
+
var model_connections_exports = {};
|
|
5916
|
+
__export(model_connections_exports, {
|
|
5917
|
+
directUsage: () => directUsage,
|
|
5918
|
+
listConnections: () => listConnections,
|
|
5919
|
+
removeConnection: () => removeConnection,
|
|
5920
|
+
savePersonalConnection: () => savePersonalConnection,
|
|
5921
|
+
sealPersonalApiKey: () => sealPersonalApiKey,
|
|
5922
|
+
unlockModelConnections: () => unlockModelConnections
|
|
5923
|
+
});
|
|
5924
|
+
var FAILED = "Could not update model connections";
|
|
5925
|
+
async function listConnections(arbi) {
|
|
5926
|
+
return requireData(await arbi.fetch.GET("/v1/model-connections"), FAILED);
|
|
5927
|
+
}
|
|
5928
|
+
async function directUsage(arbi) {
|
|
5929
|
+
return requireData(
|
|
5930
|
+
await arbi.fetch.GET("/v1/model-connections/usage"),
|
|
5931
|
+
FAILED
|
|
5932
|
+
);
|
|
5933
|
+
}
|
|
5934
|
+
async function savePersonalConnection(arbi, body, id) {
|
|
5935
|
+
const result = id ? await arbi.fetch.PUT("/v1/model-connections/personal/{connection_id}", {
|
|
5936
|
+
params: { path: { connection_id: id } },
|
|
5937
|
+
body
|
|
5938
|
+
}) : await arbi.fetch.POST("/v1/model-connections/personal", { body });
|
|
5939
|
+
return requireData(result, FAILED);
|
|
5940
|
+
}
|
|
5941
|
+
async function removeConnection(arbi, id) {
|
|
5942
|
+
requireOk(
|
|
5943
|
+
await arbi.fetch.DELETE("/v1/model-connections/{connection_id}", {
|
|
5944
|
+
params: { path: { connection_id: id } }
|
|
5945
|
+
}),
|
|
5946
|
+
FAILED
|
|
5947
|
+
);
|
|
5948
|
+
}
|
|
5949
|
+
async function sealPersonalApiKey(apiKey, signingPrivateKey) {
|
|
5950
|
+
await client.initSodium();
|
|
5951
|
+
const pair = client.encryptionKeypairFromSigningKey(signingPrivateKey);
|
|
5952
|
+
const bytes = new TextEncoder().encode(apiKey);
|
|
5953
|
+
try {
|
|
5954
|
+
return client.sealedBoxEncrypt(bytes, pair.publicKey);
|
|
5955
|
+
} finally {
|
|
5956
|
+
bytes.fill(0);
|
|
5957
|
+
pair.secretKey.fill(0);
|
|
5958
|
+
}
|
|
5959
|
+
}
|
|
5960
|
+
async function unlockModelConnections(arbi, keys, onlyId) {
|
|
5961
|
+
await client.initSodium();
|
|
5962
|
+
const pair = client.encryptionKeypairFromSigningKey(keys.signingPrivateKey);
|
|
5963
|
+
try {
|
|
5964
|
+
const rows = requireData(
|
|
5965
|
+
await arbi.fetch.GET("/v1/model-connections/sealed-keys"),
|
|
5966
|
+
FAILED
|
|
5967
|
+
);
|
|
5968
|
+
for (const row of rows) {
|
|
5969
|
+
if (onlyId && onlyId !== row.id || !row.sealed_api_key || !row.enabled) continue;
|
|
5970
|
+
const bytes = client.sealedBoxDecrypt(row.sealed_api_key, pair.secretKey);
|
|
5971
|
+
try {
|
|
5972
|
+
requireOk(
|
|
5973
|
+
await arbi.fetch.POST("/v1/model-connections/session-key", {
|
|
5974
|
+
body: {
|
|
5975
|
+
connection_id: row.id,
|
|
5976
|
+
sealed_api_key: client.sealedBoxEncrypt(bytes, keys.serverSessionKey)
|
|
5977
|
+
}
|
|
5978
|
+
}),
|
|
5979
|
+
FAILED
|
|
5980
|
+
);
|
|
5981
|
+
} finally {
|
|
5982
|
+
bytes.fill(0);
|
|
5983
|
+
}
|
|
5984
|
+
}
|
|
5985
|
+
} finally {
|
|
5986
|
+
pair.secretKey.fill(0);
|
|
5987
|
+
}
|
|
5988
|
+
}
|
|
5989
|
+
|
|
5914
5990
|
// src/operations/workspaces.ts
|
|
5915
5991
|
var workspaces_exports = {};
|
|
5916
5992
|
__export(workspaces_exports, {
|
|
@@ -12945,6 +13021,46 @@ var Arbi = class {
|
|
|
12945
13021
|
/** The documents the open workspace may use as its house template. */
|
|
12946
13022
|
candidates: () => listHouseTemplateCandidates(this.requireClient())
|
|
12947
13023
|
};
|
|
13024
|
+
// ── Model connections ───────────────────────────────────────────────
|
|
13025
|
+
/**
|
|
13026
|
+
* The main agent's OpenAI-compatible endpoints: the box's and the user's own. A personal key is
|
|
13027
|
+
* sealed to the user's identity and usable by a session only once unlocked on it.
|
|
13028
|
+
*/
|
|
13029
|
+
modelConnections = {
|
|
13030
|
+
list: () => listConnections(this.requireClient()),
|
|
13031
|
+
/** The user's direct model calls of the last 30 days. */
|
|
13032
|
+
usage: () => directUsage(this.requireClient()),
|
|
13033
|
+
/**
|
|
13034
|
+
* Add a personal connection (or replace `id`'s). An `apiKey` is sealed to the identity before
|
|
13035
|
+
* it is sent; an enabled connection with a key is unlocked on this session at once.
|
|
13036
|
+
*/
|
|
13037
|
+
save: async ({ id, apiKey, ...body }) => {
|
|
13038
|
+
const sealed = apiKey ? await sealPersonalApiKey(apiKey, this.identityKey()) : void 0;
|
|
13039
|
+
const row = await savePersonalConnection(
|
|
13040
|
+
this.requireClient(),
|
|
13041
|
+
{
|
|
13042
|
+
...body,
|
|
13043
|
+
protocol: "openai_chat_completions",
|
|
13044
|
+
allow_private_network: false,
|
|
13045
|
+
...sealed ? { sealed_api_key: sealed } : {}
|
|
13046
|
+
},
|
|
13047
|
+
id
|
|
13048
|
+
);
|
|
13049
|
+
if (row.has_api_key && row.enabled) await this.modelConnections.unlock(row.id);
|
|
13050
|
+
return row;
|
|
13051
|
+
},
|
|
13052
|
+
remove: (id) => removeConnection(this.requireClient(), id),
|
|
13053
|
+
/** Let this session use the user's enabled personal keys (only `onlyId`'s when given). */
|
|
13054
|
+
unlock: async (onlyId) => {
|
|
13055
|
+
const serverSessionKey = this.client?.session.getState().serverSessionKey ?? this.loginResult?.serverSessionKey;
|
|
13056
|
+
if (!serverSessionKey) throw new ArbiError("Sign in again to unlock model connections");
|
|
13057
|
+
await unlockModelConnections(
|
|
13058
|
+
this.requireClient(),
|
|
13059
|
+
{ signingPrivateKey: this.identityKey(), serverSessionKey },
|
|
13060
|
+
onlyId
|
|
13061
|
+
);
|
|
13062
|
+
}
|
|
13063
|
+
};
|
|
12948
13064
|
// ── Databases (user-defined tables of the open workspace) ──────────
|
|
12949
13065
|
databases = {
|
|
12950
13066
|
list: () => listDatabases(this.requireClient()),
|
|
@@ -13002,6 +13118,11 @@ var Arbi = class {
|
|
|
13002
13118
|
}
|
|
13003
13119
|
return this.loginResult;
|
|
13004
13120
|
}
|
|
13121
|
+
/** The signed-in user's identity (signing) key. */
|
|
13122
|
+
identityKey() {
|
|
13123
|
+
if (!this.loginResult) throw new ArbiError("Unlock your identity first");
|
|
13124
|
+
return this.loginResult.signingPrivateKey;
|
|
13125
|
+
}
|
|
13005
13126
|
requireWorkspace() {
|
|
13006
13127
|
if (!this.currentWorkspaceId) {
|
|
13007
13128
|
throw new ArbiError("No workspace selected. Call selectWorkspace() first.");
|
|
@@ -13863,6 +13984,7 @@ exports.isTraceItem = isTraceItem;
|
|
|
13863
13984
|
exports.mail = mail_exports;
|
|
13864
13985
|
exports.mcpTools = mcpTools;
|
|
13865
13986
|
exports.mergeAgentSteps = mergeAgentSteps;
|
|
13987
|
+
exports.modelConnections = model_connections_exports;
|
|
13866
13988
|
exports.notifications = notifications_exports;
|
|
13867
13989
|
exports.parseSSEEvents = parseSSEEvents;
|
|
13868
13990
|
exports.parseSlashCommand = parseSlashCommand;
|