@arbidocs/sdk 0.3.101 → 0.3.103

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
@@ -5837,12 +5837,35 @@ async function getFileContent(auth, fileId) {
5837
5837
  // src/operations/agents.ts
5838
5838
  var agents_exports = {};
5839
5839
  __export(agents_exports, {
5840
+ createAgent: () => createAgent,
5840
5841
  deleteAgents: () => deleteAgents,
5842
+ getAgentConfig: () => getAgentConfig,
5843
+ listAgentWorkspaces: () => listAgentWorkspaces,
5841
5844
  listAgents: () => listAgents
5842
5845
  });
5843
5846
  async function listAgents(arbi) {
5844
5847
  return requireData(await arbi.fetch.GET("/v1/agents"), "Failed to fetch agents");
5845
5848
  }
5849
+ async function createAgent(arbi, name) {
5850
+ const body = { name };
5851
+ return requireData(await arbi.fetch.POST("/v1/agents", { body }), "Failed to create agent");
5852
+ }
5853
+ async function getAgentConfig(arbi, agentExtId) {
5854
+ return requireData(
5855
+ await arbi.fetch.GET("/v1/agents/{agent_ext_id}/config", {
5856
+ params: { path: { agent_ext_id: agentExtId } }
5857
+ }),
5858
+ "Failed to fetch agent config"
5859
+ );
5860
+ }
5861
+ async function listAgentWorkspaces(arbi, agentExtId) {
5862
+ return requireData(
5863
+ await arbi.fetch.GET("/v1/agents/{agent_ext_id}/workspaces", {
5864
+ params: { path: { agent_ext_id: agentExtId } }
5865
+ }),
5866
+ "Failed to fetch agent workspaces"
5867
+ );
5868
+ }
5846
5869
  async function deleteAgents(arbi, agentExtIds) {
5847
5870
  return requireData(
5848
5871
  await arbi.fetch.DELETE("/v1/agents", {
@@ -5888,6 +5911,75 @@ async function refreshProject(arbi, projectExtId) {
5888
5911
  );
5889
5912
  }
5890
5913
 
5914
+ // src/operations/tasks.ts
5915
+ async function listTasks(arbi) {
5916
+ return requireData(await arbi.fetch.GET("/v1/tasks"), "Failed to list tasks");
5917
+ }
5918
+ async function createTask(arbi, body) {
5919
+ return requireData(await arbi.fetch.POST("/v1/tasks", { body }), "Failed to create task");
5920
+ }
5921
+ async function getTask(arbi, taskId) {
5922
+ return requireData(
5923
+ await arbi.fetch.GET("/v1/tasks/{task_id}", { params: { path: { task_id: taskId } } }),
5924
+ "Failed to get task"
5925
+ );
5926
+ }
5927
+ async function updateTask(arbi, taskId, body) {
5928
+ return requireData(
5929
+ await arbi.fetch.PATCH("/v1/tasks/{task_id}", {
5930
+ params: { path: { task_id: taskId } },
5931
+ body
5932
+ }),
5933
+ "Failed to update task"
5934
+ );
5935
+ }
5936
+ async function deleteTask(arbi, taskId) {
5937
+ const { error } = await arbi.fetch.DELETE("/v1/tasks/{task_id}", {
5938
+ params: { path: { task_id: taskId } }
5939
+ });
5940
+ if (error) throw new Error("Failed to delete task");
5941
+ }
5942
+ async function runTask(arbi, taskId) {
5943
+ return requireData(
5944
+ await arbi.fetch.POST("/v1/tasks/{task_id}/run", { params: { path: { task_id: taskId } } }),
5945
+ "Failed to run task"
5946
+ );
5947
+ }
5948
+
5949
+ // src/operations/memory.ts
5950
+ async function createMemory(arbi, body) {
5951
+ return requireData(await arbi.fetch.POST("/v1/memory/", { body }), "Failed to create memory");
5952
+ }
5953
+ async function listMemories(arbi, options) {
5954
+ return requireData(
5955
+ await arbi.fetch.GET("/v1/memory/list", {
5956
+ params: { query: { pinned_only: options?.pinnedOnly ?? false } }
5957
+ }),
5958
+ "Failed to list memories"
5959
+ );
5960
+ }
5961
+ async function searchMemories(arbi, body) {
5962
+ return requireData(
5963
+ await arbi.fetch.POST("/v1/memory/search", { body }),
5964
+ "Failed to search memories"
5965
+ );
5966
+ }
5967
+ async function updateMemory(arbi, memoryId, body) {
5968
+ return requireData(
5969
+ await arbi.fetch.PATCH("/v1/memory/{memory_ext_id}", {
5970
+ params: { path: { memory_ext_id: memoryId } },
5971
+ body
5972
+ }),
5973
+ "Failed to update memory"
5974
+ );
5975
+ }
5976
+ async function deleteMemory(arbi, memoryId) {
5977
+ const { error } = await arbi.fetch.DELETE("/v1/memory/{memory_ext_id}", {
5978
+ params: { path: { memory_ext_id: memoryId } }
5979
+ });
5980
+ if (error) throw new Error("Failed to delete memory");
5981
+ }
5982
+
5891
5983
  // src/arbi.ts
5892
5984
  var Arbi = class {
5893
5985
  client = null;
@@ -6224,8 +6316,28 @@ var Arbi = class {
6224
6316
  // ── Agents ──────────────────────────────────────────────────────────
6225
6317
  agents = {
6226
6318
  list: () => listAgents(this.requireClient()),
6319
+ create: (name) => createAgent(this.requireClient(), name),
6320
+ getConfig: (agentExtId) => getAgentConfig(this.requireClient(), agentExtId),
6321
+ listWorkspaces: (agentExtId) => listAgentWorkspaces(this.requireClient(), agentExtId),
6227
6322
  delete: (agentExtIds) => deleteAgents(this.requireClient(), agentExtIds)
6228
6323
  };
6324
+ // ── Scheduled tasks ───────────────────────────────────────────────────
6325
+ tasks = {
6326
+ list: () => listTasks(this.requireClient()),
6327
+ create: (body) => createTask(this.requireClient(), body),
6328
+ get: (taskId) => getTask(this.requireClient(), taskId),
6329
+ update: (taskId, body) => updateTask(this.requireClient(), taskId, body),
6330
+ delete: (taskId) => deleteTask(this.requireClient(), taskId),
6331
+ run: (taskId) => runTask(this.requireClient(), taskId)
6332
+ };
6333
+ // ── Workspace memory ──────────────────────────────────────────────────
6334
+ memory = {
6335
+ create: (body) => createMemory(this.requireClient(), body),
6336
+ list: (options) => listMemories(this.requireClient(), options),
6337
+ search: (body) => searchMemories(this.requireClient(), body),
6338
+ update: (memoryId, body) => updateMemory(this.requireClient(), memoryId, body),
6339
+ delete: (memoryId) => deleteMemory(this.requireClient(), memoryId)
6340
+ };
6229
6341
  // ── Sessions ────────────────────────────────────────────────────────
6230
6342
  sessions = {
6231
6343
  list: () => listSessions(this.requireClient())