@eve/board 0.2.0 → 0.3.0

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.
Files changed (38) hide show
  1. package/dist/extension/_manifest.json +1 -1
  2. package/dist/extension/extension.d.ts +2 -0
  3. package/dist/extension/extension.mjs +19 -1
  4. package/dist/extension/hooks/claims.d.ts +2 -0
  5. package/dist/extension/hooks/claims.mjs +11 -0
  6. package/dist/extension/instructions.md +2 -2
  7. package/dist/extension/lib/authorize.d.ts +7 -4
  8. package/dist/extension/lib/board-channel.d.ts +2 -14
  9. package/dist/extension/lib/board-channel.mjs +13 -107
  10. package/dist/extension/lib/claims.d.ts +38 -0
  11. package/dist/extension/lib/claims.mjs +231 -0
  12. package/dist/extension/lib/client.d.ts +21 -0
  13. package/dist/extension/lib/client.mjs +31 -2
  14. package/dist/extension/lib/tools.d.ts +201 -9
  15. package/dist/extension/lib/tools.mjs +268 -24
  16. package/dist/extension/lib/watches.mjs +28 -14
  17. package/dist/extension/skills/collaborate/SKILL.md +6 -3
  18. package/dist/extension/tools/block_task.d.ts +1 -1
  19. package/dist/extension/tools/block_task.mjs +2 -1
  20. package/dist/extension/tools/claim_task.d.ts +70 -0
  21. package/dist/extension/tools/claim_task.mjs +10 -0
  22. package/dist/extension/tools/complete_task.d.ts +1 -1
  23. package/dist/extension/tools/complete_task.mjs +2 -1
  24. package/dist/extension/tools/create_task.d.ts +5 -0
  25. package/dist/extension/tools/fail_task.d.ts +1 -1
  26. package/dist/extension/tools/fail_task.mjs +2 -1
  27. package/dist/extension/tools/note.d.ts +5 -0
  28. package/dist/extension/tools/post.d.ts +10 -0
  29. package/dist/extension/tools/read.d.ts +40 -0
  30. package/dist/extension/tools/release_task.d.ts +3 -0
  31. package/dist/extension/tools/release_task.mjs +11 -0
  32. package/dist/extension/tools/reply.d.ts +10 -0
  33. package/dist/extension/tools/tasks.d.ts +40 -0
  34. package/dist/extension/tools/tasks.mjs +10 -0
  35. package/dist/extension/tools/watches.d.ts +1 -1
  36. package/dist/tools/index.d.ts +3 -0
  37. package/dist/tools/index.mjs +4 -1
  38. package/package.json +3 -3
@@ -7,6 +7,15 @@ __eveCreateRequire(import.meta.url);
7
7
  import { createHash } from "node:crypto";
8
8
  import { board } from "@vercel/board";
9
9
  import { compileAccess } from "@vercel/board/access";
10
+ const BOARD_TASK_STATES = [
11
+ "waiting",
12
+ "ready",
13
+ "claimed",
14
+ "blocked",
15
+ "completed",
16
+ "failed",
17
+ "canceled"
18
+ ];
10
19
  const BOARD_PERMISSIONS = [
11
20
  "read",
12
21
  "post",
@@ -168,7 +177,11 @@ function createBoardClient(board, can) {
168
177
  async typing(id, status) {
169
178
  await handle.typing(id, status === void 0 ? void 0 : status.slice(0, 50));
170
179
  },
171
- thread: async (id, range = {}) => threadOf(await handle.thread(id, range.after === void 0 ? {} : { after: range.after })),
180
+ thread: async (id, range = {}) => threadOf(await handle.thread(id, {
181
+ ...range.after !== void 0 && { after: range.after },
182
+ ...range.limit !== void 0 && { limit: range.limit }
183
+ })),
184
+ posted: async (id) => messageOf(await handle.posted(id)),
172
185
  linked: async (url) => threadOf(await handle.linked(url)),
173
186
  async threads(query = {}) {
174
187
  return (await threadsPage(query)).threads;
@@ -202,6 +215,20 @@ function createBoardClient(board, can) {
202
215
  const { canceled } = await handle.cancelSchedule(id);
203
216
  return { canceled };
204
217
  },
218
+ async tasks(query = {}) {
219
+ const page = await handle.tasks.list({
220
+ ...query,
221
+ ...query.label !== void 0 && { label: [...query.label] }
222
+ });
223
+ return {
224
+ cursor: page.cursor,
225
+ tasks: page.tasks.map((summary) => ({
226
+ last: summary.last === null ? null : messageOf(summary.last),
227
+ message: messageOf(summary.message),
228
+ replies: summary.replies
229
+ }))
230
+ };
231
+ },
205
232
  async claimReady(query) {
206
233
  const claim = await handle.tasks.claim({
207
234
  channel: query.channel,
@@ -302,6 +329,8 @@ function messageOf(view) {
302
329
  actor: task.claim.actor,
303
330
  until: task.claim.until
304
331
  },
332
+ for: task.for,
333
+ needs: [...task.needs],
305
334
  owner: task.owner,
306
335
  reason: task.reason,
307
336
  result: task.result,
@@ -360,4 +389,4 @@ function scheduleOf(schedule) {
360
389
  text: schedule.text
361
390
  };
362
391
  }
363
- export { BOARD_CHANNEL_SELECTOR, BOARD_HOLD_KIND_PATTERN, BOARD_NAME_PATTERN, BOARD_PERMISSIONS, BOARD_TAIL_LIMIT, BOARD_TASK_NOTE_LIMIT, BOARD_TEXT_LIMIT, BOARD_UPLOAD_LIMIT, DEFAULT_BOARD_PROFILE, boardAllows, boardErrorCode, boardPostId, createBoardClient, withHints };
392
+ export { BOARD_CHANNEL_SELECTOR, BOARD_HOLD_KIND_PATTERN, BOARD_NAME_PATTERN, BOARD_PERMISSIONS, BOARD_TAIL_LIMIT, BOARD_TASK_NOTE_LIMIT, BOARD_TASK_STATES, BOARD_TEXT_LIMIT, BOARD_UPLOAD_LIMIT, DEFAULT_BOARD_PROFILE, boardAllows, boardErrorCode, boardPostId, createBoardClient, withHints };
@@ -3,6 +3,7 @@ import { type BoardSettings } from "./client.ts";
3
3
  import { type BoardWatchAction } from "./watches.ts";
4
4
  type Settings = () => BoardSettings;
5
5
  export declare function holdsTask(ctx: Pick<ToolContext, "channel">): boolean;
6
+ export declare function holdsSessionTask(): boolean;
6
7
  /** Lists the board's channels. */
7
8
  export declare function defineBoardChannelsTool(settings: Settings): import("eve/tools").ToolDefinition<{
8
9
  board?: string | undefined;
@@ -36,9 +37,14 @@ export declare function defineBoardReadTool(settings: Settings): import("eve/too
36
37
  readonly kind: string | null;
37
38
  readonly reason: string;
38
39
  } | null;
40
+ for: string | null;
39
41
  holder: string | null;
42
+ needs: readonly string[];
43
+ owner: string;
44
+ reason: string | null;
40
45
  result: string | null;
41
46
  state: string;
47
+ until: string | null;
42
48
  } | undefined;
43
49
  };
44
50
  replies: {
@@ -55,9 +61,14 @@ export declare function defineBoardReadTool(settings: Settings): import("eve/too
55
61
  readonly kind: string | null;
56
62
  readonly reason: string;
57
63
  } | null;
64
+ for: string | null;
58
65
  holder: string | null;
66
+ needs: readonly string[];
67
+ owner: string;
68
+ reason: string | null;
59
69
  result: string | null;
60
70
  state: string;
71
+ until: string | null;
61
72
  } | undefined;
62
73
  }[];
63
74
  } | {
@@ -79,9 +90,14 @@ export declare function defineBoardReadTool(settings: Settings): import("eve/too
79
90
  readonly kind: string | null;
80
91
  readonly reason: string;
81
92
  } | null;
93
+ for: string | null;
82
94
  holder: string | null;
95
+ needs: readonly string[];
96
+ owner: string;
97
+ reason: string | null;
83
98
  result: string | null;
84
99
  state: string;
100
+ until: string | null;
85
101
  } | undefined;
86
102
  } | null;
87
103
  message: {
@@ -98,9 +114,14 @@ export declare function defineBoardReadTool(settings: Settings): import("eve/too
98
114
  readonly kind: string | null;
99
115
  readonly reason: string;
100
116
  } | null;
117
+ for: string | null;
101
118
  holder: string | null;
119
+ needs: readonly string[];
120
+ owner: string;
121
+ reason: string | null;
102
122
  result: string | null;
103
123
  state: string;
124
+ until: string | null;
104
125
  } | undefined;
105
126
  };
106
127
  replies: number;
@@ -132,9 +153,14 @@ export declare function defineBoardReadTool(settings: Settings): import("eve/too
132
153
  readonly kind: string | null;
133
154
  readonly reason: string;
134
155
  } | null;
156
+ for: string | null;
135
157
  holder: string | null;
158
+ needs: readonly string[];
159
+ owner: string;
160
+ reason: string | null;
136
161
  result: string | null;
137
162
  state: string;
163
+ until: string | null;
138
164
  } | undefined;
139
165
  };
140
166
  replies: {
@@ -151,9 +177,14 @@ export declare function defineBoardReadTool(settings: Settings): import("eve/too
151
177
  readonly kind: string | null;
152
178
  readonly reason: string;
153
179
  } | null;
180
+ for: string | null;
154
181
  holder: string | null;
182
+ needs: readonly string[];
183
+ owner: string;
184
+ reason: string | null;
155
185
  result: string | null;
156
186
  state: string;
187
+ until: string | null;
157
188
  } | undefined;
158
189
  }[];
159
190
  } | {
@@ -175,9 +206,14 @@ export declare function defineBoardReadTool(settings: Settings): import("eve/too
175
206
  readonly kind: string | null;
176
207
  readonly reason: string;
177
208
  } | null;
209
+ for: string | null;
178
210
  holder: string | null;
211
+ needs: readonly string[];
212
+ owner: string;
213
+ reason: string | null;
179
214
  result: string | null;
180
215
  state: string;
216
+ until: string | null;
181
217
  } | undefined;
182
218
  } | null;
183
219
  message: {
@@ -194,9 +230,14 @@ export declare function defineBoardReadTool(settings: Settings): import("eve/too
194
230
  readonly kind: string | null;
195
231
  readonly reason: string;
196
232
  } | null;
233
+ for: string | null;
197
234
  holder: string | null;
235
+ needs: readonly string[];
236
+ owner: string;
237
+ reason: string | null;
198
238
  result: string | null;
199
239
  state: string;
240
+ until: string | null;
200
241
  } | undefined;
201
242
  };
202
243
  replies: number;
@@ -226,9 +267,14 @@ export declare function defineBoardPostTool(settings: Settings): import("eve/too
226
267
  readonly kind: string | null;
227
268
  readonly reason: string;
228
269
  } | null;
270
+ for: string | null;
229
271
  holder: string | null;
272
+ needs: readonly string[];
273
+ owner: string;
274
+ reason: string | null;
230
275
  result: string | null;
231
276
  state: string;
277
+ until: string | null;
232
278
  } | undefined;
233
279
  }> & {
234
280
  execute(input: {
@@ -253,9 +299,14 @@ export declare function defineBoardPostTool(settings: Settings): import("eve/too
253
299
  readonly kind: string | null;
254
300
  readonly reason: string;
255
301
  } | null;
302
+ for: string | null;
256
303
  holder: string | null;
304
+ needs: readonly string[];
305
+ owner: string;
306
+ reason: string | null;
257
307
  result: string | null;
258
308
  state: string;
309
+ until: string | null;
259
310
  } | undefined;
260
311
  }>;
261
312
  };
@@ -282,9 +333,14 @@ export declare function defineBoardReplyTool(settings: Settings): import("eve/to
282
333
  readonly kind: string | null;
283
334
  readonly reason: string;
284
335
  } | null;
336
+ for: string | null;
285
337
  holder: string | null;
338
+ needs: readonly string[];
339
+ owner: string;
340
+ reason: string | null;
286
341
  result: string | null;
287
342
  state: string;
343
+ until: string | null;
288
344
  } | undefined;
289
345
  }> & {
290
346
  execute(input: {
@@ -309,9 +365,14 @@ export declare function defineBoardReplyTool(settings: Settings): import("eve/to
309
365
  readonly kind: string | null;
310
366
  readonly reason: string;
311
367
  } | null;
368
+ for: string | null;
312
369
  holder: string | null;
370
+ needs: readonly string[];
371
+ owner: string;
372
+ reason: string | null;
313
373
  result: string | null;
314
374
  state: string;
375
+ until: string | null;
315
376
  } | undefined;
316
377
  }>;
317
378
  };
@@ -335,9 +396,14 @@ export declare function defineBoardNoteTool(settings: Settings): import("eve/too
335
396
  readonly kind: string | null;
336
397
  readonly reason: string;
337
398
  } | null;
399
+ for: string | null;
338
400
  holder: string | null;
401
+ needs: readonly string[];
402
+ owner: string;
403
+ reason: string | null;
339
404
  result: string | null;
340
405
  state: string;
406
+ until: string | null;
341
407
  } | undefined;
342
408
  }>;
343
409
  /** Reacts to a message. */
@@ -430,18 +496,23 @@ export declare function defineBoardCreateTaskTool(settings: Settings): import("e
430
496
  readonly kind: string | null;
431
497
  readonly reason: string;
432
498
  } | null;
499
+ for: string | null;
433
500
  holder: string | null;
501
+ needs: readonly string[];
502
+ owner: string;
503
+ reason: string | null;
434
504
  result: string | null;
435
505
  state: string;
506
+ until: string | null;
436
507
  } | undefined;
437
508
  }>;
438
- export declare function defineBoardCompleteTaskTool(): import("eve/tools").ToolDefinition<{
509
+ export declare function defineBoardCompleteTaskTool(settings?: Settings): import("eve/tools").ToolDefinition<{
439
510
  result?: string | undefined;
440
511
  }, {
441
512
  result?: string;
442
513
  reason?: string;
443
514
  kind?: string;
444
- settled: "blocked" | "completed" | "failed";
515
+ settled: "blocked" | "completed" | "failed" | "released";
445
516
  task: string;
446
517
  }> & {
447
518
  execute(input: {
@@ -450,17 +521,17 @@ export declare function defineBoardCompleteTaskTool(): import("eve/tools").ToolD
450
521
  result?: string;
451
522
  reason?: string;
452
523
  kind?: string;
453
- settled: "blocked" | "completed" | "failed";
524
+ settled: "blocked" | "completed" | "failed" | "released";
454
525
  task: string;
455
526
  }>;
456
527
  };
457
- export declare function defineBoardFailTaskTool(): import("eve/tools").ToolDefinition<{
528
+ export declare function defineBoardFailTaskTool(settings?: Settings): import("eve/tools").ToolDefinition<{
458
529
  reason: string;
459
530
  }, {
460
531
  result?: string;
461
532
  reason?: string;
462
533
  kind?: string;
463
- settled: "blocked" | "completed" | "failed";
534
+ settled: "blocked" | "completed" | "failed" | "released";
464
535
  task: string;
465
536
  }> & {
466
537
  execute(input: {
@@ -469,18 +540,18 @@ export declare function defineBoardFailTaskTool(): import("eve/tools").ToolDefin
469
540
  result?: string;
470
541
  reason?: string;
471
542
  kind?: string;
472
- settled: "blocked" | "completed" | "failed";
543
+ settled: "blocked" | "completed" | "failed" | "released";
473
544
  task: string;
474
545
  }>;
475
546
  };
476
- export declare function defineBoardBlockTaskTool(): import("eve/tools").ToolDefinition<{
547
+ export declare function defineBoardBlockTaskTool(settings?: Settings): import("eve/tools").ToolDefinition<{
477
548
  reason: string;
478
549
  kind?: string | undefined;
479
550
  }, {
480
551
  result?: string;
481
552
  reason?: string;
482
553
  kind?: string;
483
- settled: "blocked" | "completed" | "failed";
554
+ settled: "blocked" | "completed" | "failed" | "released";
484
555
  task: string;
485
556
  }> & {
486
557
  execute(input: {
@@ -490,7 +561,22 @@ export declare function defineBoardBlockTaskTool(): import("eve/tools").ToolDefi
490
561
  result?: string;
491
562
  reason?: string;
492
563
  kind?: string;
493
- settled: "blocked" | "completed" | "failed";
564
+ settled: "blocked" | "completed" | "failed" | "released";
565
+ task: string;
566
+ }>;
567
+ };
568
+ export declare function defineBoardReleaseTaskTool(settings?: Settings): import("eve/tools").ToolDefinition<Record<string, never>, {
569
+ result?: string;
570
+ reason?: string;
571
+ kind?: string;
572
+ settled: "blocked" | "completed" | "failed" | "released";
573
+ task: string;
574
+ }> & {
575
+ execute(input: Record<string, never>, ctx: ToolContext): Promise<{
576
+ result?: string;
577
+ reason?: string;
578
+ kind?: string;
579
+ settled: "blocked" | "completed" | "failed" | "released";
494
580
  task: string;
495
581
  }>;
496
582
  };
@@ -545,4 +631,110 @@ export declare function defineBoardUnwatchTool(settings: Settings): import("eve/
545
631
  readonly id: string;
546
632
  readonly removed: boolean;
547
633
  }>;
634
+ export declare function defineBoardTasksTool(settings: Settings): import("eve/tools").ToolDefinition<{
635
+ board?: string | undefined;
636
+ channel?: string | undefined;
637
+ state?: "all" | "blocked" | "canceled" | "claimed" | "completed" | "failed" | "open" | "ready" | "waiting" | undefined;
638
+ label?: string[] | undefined;
639
+ owner?: string | undefined;
640
+ for?: string | undefined;
641
+ needs?: string | undefined;
642
+ after?: string | undefined;
643
+ limit?: number | undefined;
644
+ }, {
645
+ cursor: string;
646
+ tasks: {
647
+ attachments: string[];
648
+ author: string;
649
+ channel: string;
650
+ createdAt: string;
651
+ id: string;
652
+ labels: Readonly<Record<string, string>>;
653
+ re: string | null;
654
+ text: string;
655
+ task?: {
656
+ blocked: {
657
+ readonly kind: string | null;
658
+ readonly reason: string;
659
+ } | null;
660
+ for: string | null;
661
+ holder: string | null;
662
+ needs: readonly string[];
663
+ owner: string;
664
+ reason: string | null;
665
+ result: string | null;
666
+ state: string;
667
+ until: string | null;
668
+ } | undefined;
669
+ replies: number;
670
+ }[];
671
+ }>;
672
+ export declare function defineBoardClaimTaskTool(settings: Settings): import("eve/tools").ToolDefinition<{
673
+ board?: string | undefined;
674
+ id?: string | undefined;
675
+ channel?: string | undefined;
676
+ label?: Record<string, string> | undefined;
677
+ from?: string[] | undefined;
678
+ }, {
679
+ board?: undefined;
680
+ claimed: boolean;
681
+ task: null;
682
+ until?: undefined;
683
+ } | {
684
+ board?: undefined;
685
+ claimed: boolean;
686
+ task: {
687
+ attachments: string[];
688
+ author: string;
689
+ channel: string;
690
+ createdAt: string;
691
+ id: string;
692
+ labels: Readonly<Record<string, string>>;
693
+ re: string | null;
694
+ text: string;
695
+ task?: {
696
+ blocked: {
697
+ readonly kind: string | null;
698
+ readonly reason: string;
699
+ } | null;
700
+ for: string | null;
701
+ holder: string | null;
702
+ needs: readonly string[];
703
+ owner: string;
704
+ reason: string | null;
705
+ result: string | null;
706
+ state: string;
707
+ until: string | null;
708
+ } | undefined;
709
+ };
710
+ until: string;
711
+ } | {
712
+ board: string;
713
+ claimed: boolean;
714
+ task: {
715
+ attachments: string[];
716
+ author: string;
717
+ channel: string;
718
+ createdAt: string;
719
+ id: string;
720
+ labels: Readonly<Record<string, string>>;
721
+ re: string | null;
722
+ text: string;
723
+ task?: {
724
+ blocked: {
725
+ readonly kind: string | null;
726
+ readonly reason: string;
727
+ } | null;
728
+ for: string | null;
729
+ holder: string | null;
730
+ needs: readonly string[];
731
+ owner: string;
732
+ reason: string | null;
733
+ result: string | null;
734
+ state: string;
735
+ until: string | null;
736
+ } | undefined;
737
+ };
738
+ until: string;
739
+ }>;
548
740
  export {};