@arbidocs/sdk 0.3.138 → 0.3.140
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-DSk5KK4x.d.cts → browser-B9JRGjYZ.d.cts} +119 -136
- package/dist/{browser-DSk5KK4x.d.ts → browser-B9JRGjYZ.d.ts} +119 -136
- package/dist/browser.cjs +32 -34
- 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 +32 -34
- package/dist/browser.js.map +1 -1
- package/dist/index.cjs +27 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +27 -26
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as ConfigStore, m as CliConfig, n as CliCredentials, C as ChatSession, a9 as SkippedFile,
|
|
2
|
-
export { b as AgentStepEvent, c as Arbi, d as ArbiApiError, e as ArbiError, g as ArbiOptions, h as ArtifactEvent, i as AuthContext, k as AuthenticatedClient, l as CitationSummary, o as CommandDescriptor, q as ConnectOptions, D as DOC_TERMINAL_STATUSES, v as DocNameMap, w as DocumentListFields, x as DocumentListOrder, y as DocumentWaiter, z as DocumentWaiterOptions, F as FormattedWsMessage, L as ListAllOptions, B as ListPaginatedOptions,
|
|
1
|
+
import { p as ConfigStore, m as CliConfig, n as CliCredentials, C as ChatSession, a9 as SkippedFile, ai as UploadResult, j as AuthHeaders, ae as UploadBatchResult, ah as UploadOptions, af as UploadDirectOptions, ag as UploadDirectResult, a7 as SUPPORTED_EXTENSIONS, u as DmCryptoContext } from './browser-B9JRGjYZ.cjs';
|
|
2
|
+
export { b as AgentStepEvent, c as Arbi, d as ArbiApiError, e as ArbiError, g as ArbiOptions, h as ArtifactEvent, i as AuthContext, k as AuthenticatedClient, l as CitationSummary, o as CommandDescriptor, q as ConnectOptions, D as DOC_TERMINAL_STATUSES, v as DocNameMap, w as DocumentListFields, x as DocumentListOrder, y as DocumentWaiter, z as DocumentWaiterOptions, F as FormattedWsMessage, L as ListAllOptions, B as ListPaginatedOptions, M as MessageLevel, E as MessageMetadataPayload, G as MessageQueuedEvent, O as OutputTokensDetails, P as ParsedSlashCommand, K as ProjectInvoicesResponse, Q as ProjectUsageResponse, R as QueryOptions, S as ReconnectOptions, T as ReconnectableWsConnection, U as ResolvedCitation, V as ResolvedRecipient, W as ResponseCompletedEvent, X as ResponseContentPartAddedEvent, Y as ResponseCreatedEvent, Z as ResponseFailedEvent, _ as ResponseOutputItemAddedEvent, $ as ResponseOutputItemDoneEvent, a0 as ResponseOutputTextDeltaEvent, a1 as ResponseOutputTextDoneEvent, a2 as ResponseUsage, a3 as SSEEvent, a4 as SSEStreamCallbacks, a5 as SSEStreamResult, a6 as SSEStreamStartData, a8 as SkillSummary, ab as TokenBudgetContext, aj as UserDailyUsageResponse, ak as UserInfo, al as UserInputRequestEvent, am as UserMessageEvent, an as WebSocketAuthError, ao as WorkspaceChronologyOut, ap as WorkspaceContext, aq as WsConnection, ar as agentconfig, as as assistant, at as authenticatedFetch, au as buildDocNameMap, av as buildRetrievalChunkTool, aw as buildRetrievalFullContextTool, ax as buildRetrievalTocTool, ay as connectWebSocket, az as connectWithReconnect, aA as consumeSSEStream, aB as contacts, aC as conversations, aD as countCitations, aE as createAuthenticatedClient, aF as createDocumentWaiter, aG as dm, aH as doctags, aI as documents, aJ as files, aK as filterSkills, aL as formatAgentStepLabel, aM as formatFileSize, aN as formatItemLabel, aO as formatStreamSummary, aP as formatUserName, aQ as formatWorkspaceChoices, aR as formatWsMessage, aS as generateEncryptedWorkspaceKey, aT as generateNewWorkspaceKey, aU as getErrorCode, aV as getErrorMessage, aW as getRawWorkspaceKey, aX as health, aZ as parseSSEEvents, a_ as parseSlashCommand, a$ as parseSlashTokenInProgress, b0 as performPasswordLogin, b1 as performSigningKeyLogin, b2 as performSsoDeviceFlowLogin, b3 as projects, b4 as requireData, b5 as requireOk, b6 as resolveAuth, b7 as resolveCitations, b8 as resolveWorkspace, b9 as responses, ba as selectWorkspace, bb as selectWorkspaceById, bc as settings, bd as streamSSE, be as stripCitationMarkdown, bf as summarizeCitations, bg as tags, bh as tasks, bi as workspaces } from './browser-B9JRGjYZ.cjs';
|
|
3
3
|
import { SessionStorageProvider, ArbiClient, components } from '@arbidocs/client';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -404,7 +404,7 @@ declare function getAgentConfig(arbi: ArbiClient, agentExtId: string): Promise<{
|
|
|
404
404
|
VISION_ENABLED: boolean;
|
|
405
405
|
CONVERSATION_SEARCH_ENABLED: boolean;
|
|
406
406
|
PERSONAL_AGENT: boolean;
|
|
407
|
-
|
|
407
|
+
NOTES_ENABLED: boolean;
|
|
408
408
|
PERSIST_LEARNINGS: boolean;
|
|
409
409
|
SKILLS_ENABLED: boolean;
|
|
410
410
|
SKILL_CREATION: boolean;
|
|
@@ -421,6 +421,7 @@ declare function getAgentConfig(arbi: ArbiClient, agentExtId: string): Promise<{
|
|
|
421
421
|
ENABLE_THINKING: boolean;
|
|
422
422
|
AGENT_STRICT_TOOL_CALLS: boolean;
|
|
423
423
|
AGENT_MAX_ITERATIONS: number;
|
|
424
|
+
AGENT_TURN_CREDIT_BUDGET: number;
|
|
424
425
|
AGENT_MAX_PARALLEL_TOOL_CALLS: number;
|
|
425
426
|
AGENT_HISTORY_CHAR_THRESHOLD: number;
|
|
426
427
|
AGENT_SYSTEM_PROMPT: string;
|
|
@@ -499,7 +500,6 @@ declare function getAgentConfig(arbi: ArbiClient, agentExtId: string): Promise<{
|
|
|
499
500
|
API_TYPE: "local" | "remote";
|
|
500
501
|
ENABLE_THINKING: boolean;
|
|
501
502
|
MODEL_NAME: string;
|
|
502
|
-
SYSTEM_INSTRUCTION: string;
|
|
503
503
|
TEMPERATURE: number;
|
|
504
504
|
MAX_TOKENS: number;
|
|
505
505
|
MAX_TOKEN_CONTEXT: number;
|
|
@@ -545,7 +545,6 @@ declare function getAgentConfig(arbi: ArbiClient, agentExtId: string): Promise<{
|
|
|
545
545
|
SYSTEM_INSTRUCTION: string;
|
|
546
546
|
TEMPERATURE: number;
|
|
547
547
|
MAX_TOKENS: number;
|
|
548
|
-
MAX_ITERATIONS: number;
|
|
549
548
|
};
|
|
550
549
|
ModelCitation: {
|
|
551
550
|
SIM_THREASHOLD: number;
|
|
@@ -639,7 +638,7 @@ declare function getAgentConfig(arbi: ArbiClient, agentExtId: string): Promise<{
|
|
|
639
638
|
IMAGE_ENABLED: boolean;
|
|
640
639
|
VISION_ENABLED: boolean;
|
|
641
640
|
CONVERSATION_SEARCH_ENABLED: boolean;
|
|
642
|
-
|
|
641
|
+
NOTES_ENABLED: boolean;
|
|
643
642
|
PERSIST_LEARNINGS: boolean;
|
|
644
643
|
SKILLS_ENABLED: boolean;
|
|
645
644
|
WORKSPACE_TOOLS_ENABLED: boolean;
|
|
@@ -650,6 +649,7 @@ declare function getAgentConfig(arbi: ArbiClient, agentExtId: string): Promise<{
|
|
|
650
649
|
AGENT_MODEL_NAME: string;
|
|
651
650
|
ENABLE_THINKING: boolean;
|
|
652
651
|
AGENT_MAX_ITERATIONS: number;
|
|
652
|
+
AGENT_TURN_CREDIT_BUDGET: number;
|
|
653
653
|
};
|
|
654
654
|
DoctagLLM: {
|
|
655
655
|
AUTO_RENAME: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as ConfigStore, m as CliConfig, n as CliCredentials, C as ChatSession, a9 as SkippedFile,
|
|
2
|
-
export { b as AgentStepEvent, c as Arbi, d as ArbiApiError, e as ArbiError, g as ArbiOptions, h as ArtifactEvent, i as AuthContext, k as AuthenticatedClient, l as CitationSummary, o as CommandDescriptor, q as ConnectOptions, D as DOC_TERMINAL_STATUSES, v as DocNameMap, w as DocumentListFields, x as DocumentListOrder, y as DocumentWaiter, z as DocumentWaiterOptions, F as FormattedWsMessage, L as ListAllOptions, B as ListPaginatedOptions,
|
|
1
|
+
import { p as ConfigStore, m as CliConfig, n as CliCredentials, C as ChatSession, a9 as SkippedFile, ai as UploadResult, j as AuthHeaders, ae as UploadBatchResult, ah as UploadOptions, af as UploadDirectOptions, ag as UploadDirectResult, a7 as SUPPORTED_EXTENSIONS, u as DmCryptoContext } from './browser-B9JRGjYZ.js';
|
|
2
|
+
export { b as AgentStepEvent, c as Arbi, d as ArbiApiError, e as ArbiError, g as ArbiOptions, h as ArtifactEvent, i as AuthContext, k as AuthenticatedClient, l as CitationSummary, o as CommandDescriptor, q as ConnectOptions, D as DOC_TERMINAL_STATUSES, v as DocNameMap, w as DocumentListFields, x as DocumentListOrder, y as DocumentWaiter, z as DocumentWaiterOptions, F as FormattedWsMessage, L as ListAllOptions, B as ListPaginatedOptions, M as MessageLevel, E as MessageMetadataPayload, G as MessageQueuedEvent, O as OutputTokensDetails, P as ParsedSlashCommand, K as ProjectInvoicesResponse, Q as ProjectUsageResponse, R as QueryOptions, S as ReconnectOptions, T as ReconnectableWsConnection, U as ResolvedCitation, V as ResolvedRecipient, W as ResponseCompletedEvent, X as ResponseContentPartAddedEvent, Y as ResponseCreatedEvent, Z as ResponseFailedEvent, _ as ResponseOutputItemAddedEvent, $ as ResponseOutputItemDoneEvent, a0 as ResponseOutputTextDeltaEvent, a1 as ResponseOutputTextDoneEvent, a2 as ResponseUsage, a3 as SSEEvent, a4 as SSEStreamCallbacks, a5 as SSEStreamResult, a6 as SSEStreamStartData, a8 as SkillSummary, ab as TokenBudgetContext, aj as UserDailyUsageResponse, ak as UserInfo, al as UserInputRequestEvent, am as UserMessageEvent, an as WebSocketAuthError, ao as WorkspaceChronologyOut, ap as WorkspaceContext, aq as WsConnection, ar as agentconfig, as as assistant, at as authenticatedFetch, au as buildDocNameMap, av as buildRetrievalChunkTool, aw as buildRetrievalFullContextTool, ax as buildRetrievalTocTool, ay as connectWebSocket, az as connectWithReconnect, aA as consumeSSEStream, aB as contacts, aC as conversations, aD as countCitations, aE as createAuthenticatedClient, aF as createDocumentWaiter, aG as dm, aH as doctags, aI as documents, aJ as files, aK as filterSkills, aL as formatAgentStepLabel, aM as formatFileSize, aN as formatItemLabel, aO as formatStreamSummary, aP as formatUserName, aQ as formatWorkspaceChoices, aR as formatWsMessage, aS as generateEncryptedWorkspaceKey, aT as generateNewWorkspaceKey, aU as getErrorCode, aV as getErrorMessage, aW as getRawWorkspaceKey, aX as health, aZ as parseSSEEvents, a_ as parseSlashCommand, a$ as parseSlashTokenInProgress, b0 as performPasswordLogin, b1 as performSigningKeyLogin, b2 as performSsoDeviceFlowLogin, b3 as projects, b4 as requireData, b5 as requireOk, b6 as resolveAuth, b7 as resolveCitations, b8 as resolveWorkspace, b9 as responses, ba as selectWorkspace, bb as selectWorkspaceById, bc as settings, bd as streamSSE, be as stripCitationMarkdown, bf as summarizeCitations, bg as tags, bh as tasks, bi as workspaces } from './browser-B9JRGjYZ.js';
|
|
3
3
|
import { SessionStorageProvider, ArbiClient, components } from '@arbidocs/client';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -404,7 +404,7 @@ declare function getAgentConfig(arbi: ArbiClient, agentExtId: string): Promise<{
|
|
|
404
404
|
VISION_ENABLED: boolean;
|
|
405
405
|
CONVERSATION_SEARCH_ENABLED: boolean;
|
|
406
406
|
PERSONAL_AGENT: boolean;
|
|
407
|
-
|
|
407
|
+
NOTES_ENABLED: boolean;
|
|
408
408
|
PERSIST_LEARNINGS: boolean;
|
|
409
409
|
SKILLS_ENABLED: boolean;
|
|
410
410
|
SKILL_CREATION: boolean;
|
|
@@ -421,6 +421,7 @@ declare function getAgentConfig(arbi: ArbiClient, agentExtId: string): Promise<{
|
|
|
421
421
|
ENABLE_THINKING: boolean;
|
|
422
422
|
AGENT_STRICT_TOOL_CALLS: boolean;
|
|
423
423
|
AGENT_MAX_ITERATIONS: number;
|
|
424
|
+
AGENT_TURN_CREDIT_BUDGET: number;
|
|
424
425
|
AGENT_MAX_PARALLEL_TOOL_CALLS: number;
|
|
425
426
|
AGENT_HISTORY_CHAR_THRESHOLD: number;
|
|
426
427
|
AGENT_SYSTEM_PROMPT: string;
|
|
@@ -499,7 +500,6 @@ declare function getAgentConfig(arbi: ArbiClient, agentExtId: string): Promise<{
|
|
|
499
500
|
API_TYPE: "local" | "remote";
|
|
500
501
|
ENABLE_THINKING: boolean;
|
|
501
502
|
MODEL_NAME: string;
|
|
502
|
-
SYSTEM_INSTRUCTION: string;
|
|
503
503
|
TEMPERATURE: number;
|
|
504
504
|
MAX_TOKENS: number;
|
|
505
505
|
MAX_TOKEN_CONTEXT: number;
|
|
@@ -545,7 +545,6 @@ declare function getAgentConfig(arbi: ArbiClient, agentExtId: string): Promise<{
|
|
|
545
545
|
SYSTEM_INSTRUCTION: string;
|
|
546
546
|
TEMPERATURE: number;
|
|
547
547
|
MAX_TOKENS: number;
|
|
548
|
-
MAX_ITERATIONS: number;
|
|
549
548
|
};
|
|
550
549
|
ModelCitation: {
|
|
551
550
|
SIM_THREASHOLD: number;
|
|
@@ -639,7 +638,7 @@ declare function getAgentConfig(arbi: ArbiClient, agentExtId: string): Promise<{
|
|
|
639
638
|
IMAGE_ENABLED: boolean;
|
|
640
639
|
VISION_ENABLED: boolean;
|
|
641
640
|
CONVERSATION_SEARCH_ENABLED: boolean;
|
|
642
|
-
|
|
641
|
+
NOTES_ENABLED: boolean;
|
|
643
642
|
PERSIST_LEARNINGS: boolean;
|
|
644
643
|
SKILLS_ENABLED: boolean;
|
|
645
644
|
WORKSPACE_TOOLS_ENABLED: boolean;
|
|
@@ -650,6 +649,7 @@ declare function getAgentConfig(arbi: ArbiClient, agentExtId: string): Promise<{
|
|
|
650
649
|
AGENT_MODEL_NAME: string;
|
|
651
650
|
ENABLE_THINKING: boolean;
|
|
652
651
|
AGENT_MAX_ITERATIONS: number;
|
|
652
|
+
AGENT_TURN_CREDIT_BUDGET: number;
|
|
653
653
|
};
|
|
654
654
|
DoctagLLM: {
|
|
655
655
|
AUTO_RENAME: boolean;
|
package/dist/index.js
CHANGED
|
@@ -4354,6 +4354,7 @@ async function streamSSE(response, callbacks = {}) {
|
|
|
4354
4354
|
}
|
|
4355
4355
|
if (data.context) {
|
|
4356
4356
|
context = data.context;
|
|
4357
|
+
callbacks.onContextUpdate?.(data.context);
|
|
4357
4358
|
}
|
|
4358
4359
|
if (data.t != null) callbacks.onElapsedTime?.(data.t);
|
|
4359
4360
|
callbacks.onComplete?.();
|
|
@@ -4469,6 +4470,9 @@ function formatStreamSummary(result, elapsedTime) {
|
|
|
4469
4470
|
const used = result.context.all_llm_calls?.last_input_tokens ?? result.context.total_input;
|
|
4470
4471
|
parts.push(`${used.toLocaleString()}/${result.context.context_window.toLocaleString()} context`);
|
|
4471
4472
|
}
|
|
4473
|
+
if (result.context?.credits_spent != null && result.context.credit_budget != null) {
|
|
4474
|
+
parts.push(`${result.context.credits_spent.toFixed(2)}/${result.context.credit_budget} credits`);
|
|
4475
|
+
}
|
|
4472
4476
|
if (elapsedTime != null) {
|
|
4473
4477
|
parts.push(`${elapsedTime.toFixed(1)}s`);
|
|
4474
4478
|
}
|
|
@@ -6117,38 +6121,35 @@ async function runTask(arbi, taskId) {
|
|
|
6117
6121
|
);
|
|
6118
6122
|
}
|
|
6119
6123
|
|
|
6120
|
-
// src/operations/
|
|
6121
|
-
async function
|
|
6122
|
-
return requireData(await arbi.fetch.POST("/v1/
|
|
6124
|
+
// src/operations/notes.ts
|
|
6125
|
+
async function createNote(arbi, body) {
|
|
6126
|
+
return requireData(await arbi.fetch.POST("/v1/notes/", { body }), "Failed to create note");
|
|
6123
6127
|
}
|
|
6124
|
-
async function
|
|
6128
|
+
async function listNotes(arbi, options) {
|
|
6125
6129
|
return requireData(
|
|
6126
|
-
await arbi.fetch.GET("/v1/
|
|
6130
|
+
await arbi.fetch.GET("/v1/notes/list", {
|
|
6127
6131
|
params: { query: { pinned_only: options?.pinnedOnly ?? false } }
|
|
6128
6132
|
}),
|
|
6129
|
-
"Failed to list
|
|
6133
|
+
"Failed to list notes"
|
|
6130
6134
|
);
|
|
6131
6135
|
}
|
|
6132
|
-
async function
|
|
6133
|
-
return requireData(
|
|
6134
|
-
await arbi.fetch.POST("/v1/memory/search", { body }),
|
|
6135
|
-
"Failed to search memories"
|
|
6136
|
-
);
|
|
6136
|
+
async function searchNotes(arbi, body) {
|
|
6137
|
+
return requireData(await arbi.fetch.POST("/v1/notes/search", { body }), "Failed to search notes");
|
|
6137
6138
|
}
|
|
6138
|
-
async function
|
|
6139
|
+
async function updateNote(arbi, memoryId, body) {
|
|
6139
6140
|
return requireData(
|
|
6140
|
-
await arbi.fetch.PATCH("/v1/
|
|
6141
|
-
params: { path: {
|
|
6141
|
+
await arbi.fetch.PATCH("/v1/notes/{note_ext_id}", {
|
|
6142
|
+
params: { path: { note_ext_id: memoryId } },
|
|
6142
6143
|
body
|
|
6143
6144
|
}),
|
|
6144
|
-
"Failed to update
|
|
6145
|
+
"Failed to update note"
|
|
6145
6146
|
);
|
|
6146
6147
|
}
|
|
6147
|
-
async function
|
|
6148
|
-
const { error } = await arbi.fetch.DELETE("/v1/
|
|
6149
|
-
params: { path: {
|
|
6148
|
+
async function deleteNote(arbi, memoryId) {
|
|
6149
|
+
const { error } = await arbi.fetch.DELETE("/v1/notes/{note_ext_id}", {
|
|
6150
|
+
params: { path: { note_ext_id: memoryId } }
|
|
6150
6151
|
});
|
|
6151
|
-
if (error) throw new Error("Failed to delete
|
|
6152
|
+
if (error) throw new Error("Failed to delete note");
|
|
6152
6153
|
}
|
|
6153
6154
|
|
|
6154
6155
|
// src/arbi.ts
|
|
@@ -6627,13 +6628,13 @@ var Arbi = class {
|
|
|
6627
6628
|
delete: (taskId) => deleteTask(this.requireClient(), taskId),
|
|
6628
6629
|
run: (taskId) => runTask(this.requireClient(), taskId)
|
|
6629
6630
|
};
|
|
6630
|
-
// ── Workspace
|
|
6631
|
-
|
|
6632
|
-
create: (body) =>
|
|
6633
|
-
list: (options) =>
|
|
6634
|
-
search: (body) =>
|
|
6635
|
-
update: (
|
|
6636
|
-
delete: (
|
|
6631
|
+
// ── Workspace notes ─────────────────────────────────────────────────
|
|
6632
|
+
notes = {
|
|
6633
|
+
create: (body) => createNote(this.requireClient(), body),
|
|
6634
|
+
list: (options) => listNotes(this.requireClient(), options),
|
|
6635
|
+
search: (body) => searchNotes(this.requireClient(), body),
|
|
6636
|
+
update: (noteId, body) => updateNote(this.requireClient(), noteId, body),
|
|
6637
|
+
delete: (noteId) => deleteNote(this.requireClient(), noteId)
|
|
6637
6638
|
};
|
|
6638
6639
|
// ── Sessions ────────────────────────────────────────────────────────
|
|
6639
6640
|
sessions = {
|