@hasna/todos 0.11.37 → 0.11.38

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
@@ -1847,7 +1847,7 @@ function buildQuery(params) {
1847
1847
  const search = new URLSearchParams;
1848
1848
  for (const [k, v] of Object.entries(params)) {
1849
1849
  if (v !== undefined)
1850
- search.set(k, String(v));
1850
+ search.set(k, Array.isArray(v) ? v.join(",") : String(v));
1851
1851
  }
1852
1852
  const s = search.toString();
1853
1853
  return s ? `?${s}` : "";
@@ -1861,11 +1861,11 @@ class TasksResource {
1861
1861
  async list(options) {
1862
1862
  return this.client._get("/api/tasks", buildQuery(options || {}));
1863
1863
  }
1864
- async get(id) {
1865
- return this.client._get(`/api/tasks/${id}`);
1864
+ async get(id, options) {
1865
+ return this.client._get(`/api/tasks/${id}`, buildQuery(options || {}));
1866
1866
  }
1867
1867
  async getWithRelations(id) {
1868
- return this.client._get(`/api/tasks/${id}`);
1868
+ return this.client._get(`/api/tasks/${id}`, buildQuery({ format: "full" }));
1869
1869
  }
1870
1870
  async create(data) {
1871
1871
  return this.client._post("/api/tasks", data);
@@ -1892,11 +1892,11 @@ class TasksResource {
1892
1892
  agent_id: agentId
1893
1893
  });
1894
1894
  }
1895
- async getProgress(id) {
1896
- return this.client._get(`/api/tasks/${id}/progress`);
1895
+ async getProgress(id, options) {
1896
+ return this.client._get(`/api/tasks/${id}/progress`, buildQuery(options || {}));
1897
1897
  }
1898
- async getHistory(id) {
1899
- return this.client._get(`/api/tasks/${id}/history`);
1898
+ async getHistory(id, options) {
1899
+ return this.client._get(`/api/tasks/${id}/history`, buildQuery(options || {}));
1900
1900
  }
1901
1901
  async getAttachments(id) {
1902
1902
  return this.client._get(`/api/tasks/${id}/attachments`);
@@ -1913,14 +1913,15 @@ class TasksResource {
1913
1913
  async stale(options) {
1914
1914
  return this.client._get("/api/tasks/stale", buildQuery(options || {}));
1915
1915
  }
1916
- async changedSince(since, projectId) {
1917
- return this.client._get("/api/tasks/changed", buildQuery({ since, project_id: projectId }));
1916
+ async changedSince(since, projectId, options) {
1917
+ return this.client._get("/api/tasks/changed", buildQuery({ since, project_id: projectId, fields: options?.fields }));
1918
1918
  }
1919
1919
  async context(options) {
1920
1920
  const q = buildQuery({
1921
1921
  agent_id: options?.agentId,
1922
1922
  project_id: options?.projectId,
1923
- format: options?.format
1923
+ format: options?.format,
1924
+ fields: options?.fields
1924
1925
  });
1925
1926
  const url = `${this.client.baseUrl}/api/tasks/context${q}`;
1926
1927
  const res = await this.client._fetchRaw(url);
@@ -2281,8 +2282,8 @@ class TodosClient {
2281
2282
  async listTasks(filter = {}) {
2282
2283
  return this.tasks.list(filter);
2283
2284
  }
2284
- async getTask(id) {
2285
- return this.tasks.get(id);
2285
+ async getTask(id, options) {
2286
+ return this.tasks.get(id, options);
2286
2287
  }
2287
2288
  async createTask(data) {
2288
2289
  return this.tasks.create(data);
@@ -2327,14 +2328,14 @@ class TodosClient {
2327
2328
  async claimNextTask(agentId, projectId) {
2328
2329
  return this.tasks.claim(agentId, projectId);
2329
2330
  }
2330
- async getTaskHistory(id) {
2331
- return this.tasks.getHistory(id);
2331
+ async getTaskHistory(id, options) {
2332
+ return this.tasks.getHistory(id, options);
2332
2333
  }
2333
2334
  async getTaskAttachments(id) {
2334
2335
  return this.tasks.getAttachments(id);
2335
2336
  }
2336
- async getTaskProgress(id) {
2337
- return this.tasks.getProgress(id);
2337
+ async getTaskProgress(id, options) {
2338
+ return this.tasks.getProgress(id, options);
2338
2339
  }
2339
2340
  async* subscribeToStream(options = {}) {
2340
2341
  yield* this.tasks.subscribe(options);
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":";AAoGA,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAO9E"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":";AAoFA,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAO9E"}