@sneub/pair 0.0.3 → 0.0.4

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/cli.js CHANGED
@@ -12760,7 +12760,7 @@ init_dist();
12760
12760
  // package.json
12761
12761
  var package_default = {
12762
12762
  name: "@sneub/pair",
12763
- version: "0.0.3",
12763
+ version: "0.0.4",
12764
12764
  type: "module",
12765
12765
  description: "A personal AI assistant powered by Claude Code \u2014 connects Telegram and Slack to Claude with persistent memory and custom tools",
12766
12766
  bin: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sneub/pair",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "type": "module",
5
5
  "description": "A personal AI assistant powered by Claude Code — connects Telegram and Slack to Claude with persistent memory and custom tools",
6
6
  "bin": {
@@ -13,10 +13,16 @@ function flag(name: string): string | undefined {
13
13
 
14
14
  const filter = flag("filter");
15
15
  const limitStr = flag("limit");
16
- const limit = limitStr ? Math.max(1, Number.parseInt(limitStr, 10)) : 25;
16
+ const limit = limitStr ? Math.max(1, Math.min(200, Number.parseInt(limitStr, 10))) : 25;
17
17
 
18
- const url = new URL("https://api.todoist.com/api/v1/tasks");
19
- if (filter) url.searchParams.set("filter", filter);
18
+ // Todoist API v1 split filter-language queries out of /tasks into a dedicated
19
+ // /tasks/filter endpoint with a `query` parameter. The plain /tasks endpoint
20
+ // no longer accepts a `filter` param.
21
+ const url = filter
22
+ ? new URL("https://api.todoist.com/api/v1/tasks/filter")
23
+ : new URL("https://api.todoist.com/api/v1/tasks");
24
+ if (filter) url.searchParams.set("query", filter);
25
+ url.searchParams.set("limit", String(limit));
20
26
 
21
27
  const res = await fetch(url, {
22
28
  headers: {
@@ -29,9 +35,13 @@ if (!res.ok) {
29
35
  process.exit(1);
30
36
  }
31
37
 
32
- const tasks = (await res.json()) as Array<Record<string, any>>;
38
+ // v1 returns a paginated envelope: { results: [...], next_cursor: string | null }
39
+ const body = (await res.json()) as {
40
+ results: Array<Record<string, any>>;
41
+ next_cursor: string | null;
42
+ };
33
43
 
34
- const compact = tasks.slice(0, limit).map((t) => ({
44
+ const compact = body.results.map((t) => ({
35
45
  id: t.id,
36
46
  content: t.content,
37
47
  ...(t.description ? { description: t.description } : {}),
@@ -44,7 +54,11 @@ const compact = tasks.slice(0, limit).map((t) => ({
44
54
 
45
55
  console.log(
46
56
  JSON.stringify(
47
- { count: compact.length, total: tasks.length, tasks: compact },
57
+ {
58
+ count: compact.length,
59
+ ...(body.next_cursor ? { has_more: true } : {}),
60
+ tasks: compact,
61
+ },
48
62
  null,
49
63
  2,
50
64
  ),