@arbidocs/sdk 0.3.100 → 0.3.102

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.js CHANGED
@@ -5828,12 +5828,35 @@ async function getFileContent(auth, fileId) {
5828
5828
  // src/operations/agents.ts
5829
5829
  var agents_exports = {};
5830
5830
  __export(agents_exports, {
5831
+ createAgent: () => createAgent,
5831
5832
  deleteAgents: () => deleteAgents,
5833
+ getAgentConfig: () => getAgentConfig,
5834
+ listAgentWorkspaces: () => listAgentWorkspaces,
5832
5835
  listAgents: () => listAgents
5833
5836
  });
5834
5837
  async function listAgents(arbi) {
5835
5838
  return requireData(await arbi.fetch.GET("/v1/agents"), "Failed to fetch agents");
5836
5839
  }
5840
+ async function createAgent(arbi, name) {
5841
+ const body = { name };
5842
+ return requireData(await arbi.fetch.POST("/v1/agents", { body }), "Failed to create agent");
5843
+ }
5844
+ async function getAgentConfig(arbi, agentExtId) {
5845
+ return requireData(
5846
+ await arbi.fetch.GET("/v1/agents/{agent_ext_id}/config", {
5847
+ params: { path: { agent_ext_id: agentExtId } }
5848
+ }),
5849
+ "Failed to fetch agent config"
5850
+ );
5851
+ }
5852
+ async function listAgentWorkspaces(arbi, agentExtId) {
5853
+ return requireData(
5854
+ await arbi.fetch.GET("/v1/agents/{agent_ext_id}/workspaces", {
5855
+ params: { path: { agent_ext_id: agentExtId } }
5856
+ }),
5857
+ "Failed to fetch agent workspaces"
5858
+ );
5859
+ }
5837
5860
  async function deleteAgents(arbi, agentExtIds) {
5838
5861
  return requireData(
5839
5862
  await arbi.fetch.DELETE("/v1/agents", {
@@ -5879,6 +5902,75 @@ async function refreshProject(arbi, projectExtId) {
5879
5902
  );
5880
5903
  }
5881
5904
 
5905
+ // src/operations/tasks.ts
5906
+ async function listTasks(arbi) {
5907
+ return requireData(await arbi.fetch.GET("/v1/tasks"), "Failed to list tasks");
5908
+ }
5909
+ async function createTask(arbi, body) {
5910
+ return requireData(await arbi.fetch.POST("/v1/tasks", { body }), "Failed to create task");
5911
+ }
5912
+ async function getTask(arbi, taskId) {
5913
+ return requireData(
5914
+ await arbi.fetch.GET("/v1/tasks/{task_id}", { params: { path: { task_id: taskId } } }),
5915
+ "Failed to get task"
5916
+ );
5917
+ }
5918
+ async function updateTask(arbi, taskId, body) {
5919
+ return requireData(
5920
+ await arbi.fetch.PATCH("/v1/tasks/{task_id}", {
5921
+ params: { path: { task_id: taskId } },
5922
+ body
5923
+ }),
5924
+ "Failed to update task"
5925
+ );
5926
+ }
5927
+ async function deleteTask(arbi, taskId) {
5928
+ const { error } = await arbi.fetch.DELETE("/v1/tasks/{task_id}", {
5929
+ params: { path: { task_id: taskId } }
5930
+ });
5931
+ if (error) throw new Error("Failed to delete task");
5932
+ }
5933
+ async function runTask(arbi, taskId) {
5934
+ return requireData(
5935
+ await arbi.fetch.POST("/v1/tasks/{task_id}/run", { params: { path: { task_id: taskId } } }),
5936
+ "Failed to run task"
5937
+ );
5938
+ }
5939
+
5940
+ // src/operations/memory.ts
5941
+ async function createMemory(arbi, body) {
5942
+ return requireData(await arbi.fetch.POST("/v1/memory/", { body }), "Failed to create memory");
5943
+ }
5944
+ async function listMemories(arbi, options) {
5945
+ return requireData(
5946
+ await arbi.fetch.GET("/v1/memory/list", {
5947
+ params: { query: { pinned_only: options?.pinnedOnly ?? false } }
5948
+ }),
5949
+ "Failed to list memories"
5950
+ );
5951
+ }
5952
+ async function searchMemories(arbi, body) {
5953
+ return requireData(
5954
+ await arbi.fetch.POST("/v1/memory/search", { body }),
5955
+ "Failed to search memories"
5956
+ );
5957
+ }
5958
+ async function updateMemory(arbi, memoryId, body) {
5959
+ return requireData(
5960
+ await arbi.fetch.PATCH("/v1/memory/{memory_ext_id}", {
5961
+ params: { path: { memory_ext_id: memoryId } },
5962
+ body
5963
+ }),
5964
+ "Failed to update memory"
5965
+ );
5966
+ }
5967
+ async function deleteMemory(arbi, memoryId) {
5968
+ const { error } = await arbi.fetch.DELETE("/v1/memory/{memory_ext_id}", {
5969
+ params: { path: { memory_ext_id: memoryId } }
5970
+ });
5971
+ if (error) throw new Error("Failed to delete memory");
5972
+ }
5973
+
5882
5974
  // src/arbi.ts
5883
5975
  var Arbi = class {
5884
5976
  client = null;
@@ -6215,8 +6307,28 @@ var Arbi = class {
6215
6307
  // ── Agents ──────────────────────────────────────────────────────────
6216
6308
  agents = {
6217
6309
  list: () => listAgents(this.requireClient()),
6310
+ create: (name) => createAgent(this.requireClient(), name),
6311
+ getConfig: (agentExtId) => getAgentConfig(this.requireClient(), agentExtId),
6312
+ listWorkspaces: (agentExtId) => listAgentWorkspaces(this.requireClient(), agentExtId),
6218
6313
  delete: (agentExtIds) => deleteAgents(this.requireClient(), agentExtIds)
6219
6314
  };
6315
+ // ── Scheduled tasks ───────────────────────────────────────────────────
6316
+ tasks = {
6317
+ list: () => listTasks(this.requireClient()),
6318
+ create: (body) => createTask(this.requireClient(), body),
6319
+ get: (taskId) => getTask(this.requireClient(), taskId),
6320
+ update: (taskId, body) => updateTask(this.requireClient(), taskId, body),
6321
+ delete: (taskId) => deleteTask(this.requireClient(), taskId),
6322
+ run: (taskId) => runTask(this.requireClient(), taskId)
6323
+ };
6324
+ // ── Workspace memory ──────────────────────────────────────────────────
6325
+ memory = {
6326
+ create: (body) => createMemory(this.requireClient(), body),
6327
+ list: (options) => listMemories(this.requireClient(), options),
6328
+ search: (body) => searchMemories(this.requireClient(), body),
6329
+ update: (memoryId, body) => updateMemory(this.requireClient(), memoryId, body),
6330
+ delete: (memoryId) => deleteMemory(this.requireClient(), memoryId)
6331
+ };
6220
6332
  // ── Sessions ────────────────────────────────────────────────────────
6221
6333
  sessions = {
6222
6334
  list: () => listSessions(this.requireClient())