@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/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/memory.ts
6130
- async function createMemory(arbi, body) {
6131
- return requireData(await arbi.fetch.POST("/v1/memory/", { body }), "Failed to create memory");
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 listMemories(arbi, options) {
6137
+ async function listNotes(arbi, options) {
6134
6138
  return requireData(
6135
- await arbi.fetch.GET("/v1/memory/list", {
6139
+ await arbi.fetch.GET("/v1/notes/list", {
6136
6140
  params: { query: { pinned_only: options?.pinnedOnly ?? false } }
6137
6141
  }),
6138
- "Failed to list memories"
6142
+ "Failed to list notes"
6139
6143
  );
6140
6144
  }
6141
- async function searchMemories(arbi, body) {
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 updateMemory(arbi, memoryId, body) {
6148
+ async function updateNote(arbi, memoryId, body) {
6148
6149
  return requireData(
6149
- await arbi.fetch.PATCH("/v1/memory/{memory_ext_id}", {
6150
- params: { path: { memory_ext_id: memoryId } },
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 memory"
6154
+ "Failed to update note"
6154
6155
  );
6155
6156
  }
6156
- async function deleteMemory(arbi, memoryId) {
6157
- const { error } = await arbi.fetch.DELETE("/v1/memory/{memory_ext_id}", {
6158
- params: { path: { memory_ext_id: memoryId } }
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 memory");
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 memory ──────────────────────────────────────────────────
6640
- memory = {
6641
- create: (body) => createMemory(this.requireClient(), body),
6642
- list: (options) => listMemories(this.requireClient(), options),
6643
- search: (body) => searchMemories(this.requireClient(), body),
6644
- update: (memoryId, body) => updateMemory(this.requireClient(), memoryId, body),
6645
- delete: (memoryId) => deleteMemory(this.requireClient(), memoryId)
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 = {