@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.cjs
CHANGED
|
@@ -4363,6 +4363,7 @@ async function streamSSE(response, callbacks = {}) {
|
|
|
4363
4363
|
}
|
|
4364
4364
|
if (data.context) {
|
|
4365
4365
|
context = data.context;
|
|
4366
|
+
callbacks.onContextUpdate?.(data.context);
|
|
4366
4367
|
}
|
|
4367
4368
|
if (data.t != null) callbacks.onElapsedTime?.(data.t);
|
|
4368
4369
|
callbacks.onComplete?.();
|
|
@@ -4478,6 +4479,9 @@ function formatStreamSummary(result, elapsedTime) {
|
|
|
4478
4479
|
const used = result.context.all_llm_calls?.last_input_tokens ?? result.context.total_input;
|
|
4479
4480
|
parts.push(`${used.toLocaleString()}/${result.context.context_window.toLocaleString()} context`);
|
|
4480
4481
|
}
|
|
4482
|
+
if (result.context?.credits_spent != null && result.context.credit_budget != null) {
|
|
4483
|
+
parts.push(`${result.context.credits_spent.toFixed(2)}/${result.context.credit_budget} credits`);
|
|
4484
|
+
}
|
|
4481
4485
|
if (elapsedTime != null) {
|
|
4482
4486
|
parts.push(`${elapsedTime.toFixed(1)}s`);
|
|
4483
4487
|
}
|
|
@@ -6126,38 +6130,35 @@ async function runTask(arbi, taskId) {
|
|
|
6126
6130
|
);
|
|
6127
6131
|
}
|
|
6128
6132
|
|
|
6129
|
-
// src/operations/
|
|
6130
|
-
async function
|
|
6131
|
-
return requireData(await arbi.fetch.POST("/v1/
|
|
6133
|
+
// src/operations/notes.ts
|
|
6134
|
+
async function createNote(arbi, body) {
|
|
6135
|
+
return requireData(await arbi.fetch.POST("/v1/notes/", { body }), "Failed to create note");
|
|
6132
6136
|
}
|
|
6133
|
-
async function
|
|
6137
|
+
async function listNotes(arbi, options) {
|
|
6134
6138
|
return requireData(
|
|
6135
|
-
await arbi.fetch.GET("/v1/
|
|
6139
|
+
await arbi.fetch.GET("/v1/notes/list", {
|
|
6136
6140
|
params: { query: { pinned_only: options?.pinnedOnly ?? false } }
|
|
6137
6141
|
}),
|
|
6138
|
-
"Failed to list
|
|
6142
|
+
"Failed to list notes"
|
|
6139
6143
|
);
|
|
6140
6144
|
}
|
|
6141
|
-
async function
|
|
6142
|
-
return requireData(
|
|
6143
|
-
await arbi.fetch.POST("/v1/memory/search", { body }),
|
|
6144
|
-
"Failed to search memories"
|
|
6145
|
-
);
|
|
6145
|
+
async function searchNotes(arbi, body) {
|
|
6146
|
+
return requireData(await arbi.fetch.POST("/v1/notes/search", { body }), "Failed to search notes");
|
|
6146
6147
|
}
|
|
6147
|
-
async function
|
|
6148
|
+
async function updateNote(arbi, memoryId, body) {
|
|
6148
6149
|
return requireData(
|
|
6149
|
-
await arbi.fetch.PATCH("/v1/
|
|
6150
|
-
params: { path: {
|
|
6150
|
+
await arbi.fetch.PATCH("/v1/notes/{note_ext_id}", {
|
|
6151
|
+
params: { path: { note_ext_id: memoryId } },
|
|
6151
6152
|
body
|
|
6152
6153
|
}),
|
|
6153
|
-
"Failed to update
|
|
6154
|
+
"Failed to update note"
|
|
6154
6155
|
);
|
|
6155
6156
|
}
|
|
6156
|
-
async function
|
|
6157
|
-
const { error } = await arbi.fetch.DELETE("/v1/
|
|
6158
|
-
params: { path: {
|
|
6157
|
+
async function deleteNote(arbi, memoryId) {
|
|
6158
|
+
const { error } = await arbi.fetch.DELETE("/v1/notes/{note_ext_id}", {
|
|
6159
|
+
params: { path: { note_ext_id: memoryId } }
|
|
6159
6160
|
});
|
|
6160
|
-
if (error) throw new Error("Failed to delete
|
|
6161
|
+
if (error) throw new Error("Failed to delete note");
|
|
6161
6162
|
}
|
|
6162
6163
|
|
|
6163
6164
|
// src/arbi.ts
|
|
@@ -6636,13 +6637,13 @@ var Arbi = class {
|
|
|
6636
6637
|
delete: (taskId) => deleteTask(this.requireClient(), taskId),
|
|
6637
6638
|
run: (taskId) => runTask(this.requireClient(), taskId)
|
|
6638
6639
|
};
|
|
6639
|
-
// ── Workspace
|
|
6640
|
-
|
|
6641
|
-
create: (body) =>
|
|
6642
|
-
list: (options) =>
|
|
6643
|
-
search: (body) =>
|
|
6644
|
-
update: (
|
|
6645
|
-
delete: (
|
|
6640
|
+
// ── Workspace notes ─────────────────────────────────────────────────
|
|
6641
|
+
notes = {
|
|
6642
|
+
create: (body) => createNote(this.requireClient(), body),
|
|
6643
|
+
list: (options) => listNotes(this.requireClient(), options),
|
|
6644
|
+
search: (body) => searchNotes(this.requireClient(), body),
|
|
6645
|
+
update: (noteId, body) => updateNote(this.requireClient(), noteId, body),
|
|
6646
|
+
delete: (noteId) => deleteNote(this.requireClient(), noteId)
|
|
6646
6647
|
};
|
|
6647
6648
|
// ── Sessions ────────────────────────────────────────────────────────
|
|
6648
6649
|
sessions = {
|