@eve/board 0.3.0 → 0.4.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.
- package/dist/extension/_manifest.json +1 -1
- package/dist/extension/extension.d.ts +8 -5
- package/dist/extension/extension.mjs +48 -37
- package/dist/extension/instructions.md +1 -1
- package/dist/extension/lib/authorize.d.ts +2 -2
- package/dist/extension/lib/board-channel.d.ts +5 -4
- package/dist/extension/lib/board-channel.mjs +46 -34
- package/dist/extension/lib/boards.d.ts +29 -4
- package/dist/extension/lib/boards.mjs +310 -45
- package/dist/extension/lib/claims.d.ts +1 -1
- package/dist/extension/lib/claims.mjs +18 -10
- package/dist/extension/lib/client.d.ts +21 -1
- package/dist/extension/lib/client.mjs +60 -11
- package/dist/extension/lib/inbound.d.ts +1 -1
- package/dist/extension/lib/inbound.mjs +1 -1
- package/dist/extension/lib/tools.d.ts +5 -0
- package/dist/extension/lib/tools.mjs +58 -44
- package/dist/extension/lib/watches.d.ts +3 -1
- package/dist/extension/skills/collaborate/SKILL.md +3 -3
- package/dist/extension/tools/boards.d.ts +6 -0
- package/dist/extension/tools/boards.mjs +10 -0
- package/dist/extension/tools/watches.d.ts +1 -1
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.mjs +2 -1
- package/package.json +3 -3
|
@@ -18,4 +18,4 @@ export declare function formatBoardContext(message: BoardMessage, boardKey?: str
|
|
|
18
18
|
export declare function formatTaskContext(claim: BoardClaimedTask, boardKey?: string): string;
|
|
19
19
|
export declare function formatTaskFollowUpContext(message: BoardMessage, boardKey?: string): string;
|
|
20
20
|
export declare function boardMessageContent(message: BoardMessage, boardKey?: string): MessageContent;
|
|
21
|
-
export declare function fetchBoardAttachment(url: string, client: BoardClient | ((boardKey: string | undefined) => BoardClient | undefined), maxBytes: number): Promise<FetchFileResult | null>;
|
|
21
|
+
export declare function fetchBoardAttachment(url: string, client: BoardClient | ((boardKey: string | undefined) => BoardClient | undefined | Promise<BoardClient | undefined>), maxBytes: number): Promise<FetchFileResult | null>;
|
|
@@ -94,7 +94,7 @@ async function fetchBoardAttachment(url, client, maxBytes) {
|
|
|
94
94
|
return null;
|
|
95
95
|
}
|
|
96
96
|
if (attachmentId.length === 0 || attachmentId.includes("/")) return null;
|
|
97
|
-
const resolved = typeof client === "function" ? client(boardKey) : client;
|
|
97
|
+
const resolved = typeof client === "function" ? await client(boardKey) : client;
|
|
98
98
|
if (resolved === void 0) return null;
|
|
99
99
|
const response = await resolved.download(attachmentId);
|
|
100
100
|
return {
|
|
@@ -4,6 +4,11 @@ import { type BoardWatchAction } from "./watches.ts";
|
|
|
4
4
|
type Settings = () => BoardSettings;
|
|
5
5
|
export declare function holdsTask(ctx: Pick<ToolContext, "channel">): boolean;
|
|
6
6
|
export declare function holdsSessionTask(): boolean;
|
|
7
|
+
/** Lists the boards the agent can access. */
|
|
8
|
+
export declare function defineBoardBoardsTool(settings: Settings): import("eve/tools").ToolDefinition<Record<string, never>, {
|
|
9
|
+
readonly boards: readonly import("./boards.ts").AccessibleBoardSummary[];
|
|
10
|
+
readonly defaultBoardId: string | null;
|
|
11
|
+
}>;
|
|
7
12
|
/** Lists the board's channels. */
|
|
8
13
|
export declare function defineBoardChannelsTool(settings: Settings): import("eve/tools").ToolDefinition<{
|
|
9
14
|
board?: string | undefined;
|
|
@@ -4,9 +4,9 @@ import { createRequire as __eveCreateRequire } from "node:module";
|
|
|
4
4
|
const __filename = __eveFileURLToPath(import.meta.url);
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
|
-
import {
|
|
7
|
+
import { listAccessibleBoards, matchesBoard, resolveBoards, selectBoardAsync } from "./boards.mjs";
|
|
8
8
|
import { CLAIM_LEASE_SECONDS, CLAIM_WATCH_LABEL, clearSessionClaim, readSessionClaim, settleClaim, stopClaimRenewal, writeSessionClaim } from "./claims.mjs";
|
|
9
|
-
import { BOARD_HOLD_KIND_PATTERN, BOARD_NAME_PATTERN, BOARD_TASK_NOTE_LIMIT, BOARD_TASK_STATES, BOARD_TEXT_LIMIT, boardAllows, boardPostId } from "./client.mjs";
|
|
9
|
+
import { BOARD_HOLD_KIND_PATTERN, BOARD_NAME_PATTERN, BOARD_TASK_NOTE_LIMIT, BOARD_TASK_STATES, BOARD_TEXT_LIMIT, boardAllows, boardErrorCode, boardPostId } from "./client.mjs";
|
|
10
10
|
import { boardClients, checkQueueScope, checkWatchScope, coversChannel, createWatch, listWatches, removeWatch, tailOf, watchIdOf } from "./watches.mjs";
|
|
11
11
|
import { authorOf } from "./inbound.mjs";
|
|
12
12
|
import { z } from "zod";
|
|
@@ -16,7 +16,7 @@ import { always } from "eve/tools/approval";
|
|
|
16
16
|
const defaultSettings = () => ({});
|
|
17
17
|
const SHARED = "Board channels are shared with the team, and a channel may sync to Slack, GitHub, or Linear, so everything posted there can reach people outside the board.";
|
|
18
18
|
const messageId = z.string().min(1).describe("Any message ID in the thread, as the board gave it.");
|
|
19
|
-
const boardOption = z.string().min(1).optional().describe("Which
|
|
19
|
+
const boardOption = z.string().min(1).optional().describe("Which board to use, by configured key, board name, or board ID (`brd_…`). Defaults to this session's board inside a board session, or to the team's default board (`General`) outside one when discovery is enabled; required outside a board session when multiple static boards are configured with discovery disabled.");
|
|
20
20
|
function postId(ctx) {
|
|
21
21
|
return boardPostId(`${ctx.session.id}:${ctx.callId}`);
|
|
22
22
|
}
|
|
@@ -33,27 +33,27 @@ function sessionBoard(ctx) {
|
|
|
33
33
|
function currentThread(ctx) {
|
|
34
34
|
return boardMetadata(ctx).boardThread || void 0;
|
|
35
35
|
}
|
|
36
|
-
function targetBoard(settings, board, ctx) {
|
|
37
|
-
return
|
|
36
|
+
async function targetBoard(settings, board, ctx, options) {
|
|
37
|
+
return await selectBoardAsync(settings(), board, sessionBoard(ctx), options);
|
|
38
38
|
}
|
|
39
|
-
function clientFor(settings, board, ctx) {
|
|
40
|
-
const resolved = targetBoard(settings, board, ctx);
|
|
39
|
+
async function clientFor(settings, board, ctx) {
|
|
40
|
+
const resolved = await targetBoard(settings, board, ctx);
|
|
41
41
|
return {
|
|
42
42
|
board: resolved,
|
|
43
43
|
client: boardClients(resolved).model
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
|
-
function threadOrCurrent(id, ctx,
|
|
46
|
+
function threadOrCurrent(id, ctx, target) {
|
|
47
47
|
if (id !== void 0) return id;
|
|
48
48
|
const sessionKey = sessionBoard(ctx);
|
|
49
|
-
if (sessionKey !== void 0 && sessionKey
|
|
49
|
+
if (sessionKey !== void 0 && !matchesBoard(target, sessionKey)) throw new Error(`Pass the thread's \`id\`: this session's thread is on board "${sessionKey}", not "${target.key}".`);
|
|
50
50
|
const thread = currentThread(ctx);
|
|
51
51
|
if (thread === void 0) throw new Error("Pass the thread's `id`: this session didn't start from a board thread.");
|
|
52
52
|
return thread;
|
|
53
53
|
}
|
|
54
|
-
function replyTarget(settings, boardKey, id, ctx) {
|
|
54
|
+
async function replyTarget(settings, boardKey, id, ctx) {
|
|
55
55
|
if (id !== void 0) {
|
|
56
|
-
const { board, client } = clientFor(settings, boardKey, ctx);
|
|
56
|
+
const { board, client } = await clientFor(settings, boardKey, ctx);
|
|
57
57
|
return {
|
|
58
58
|
board,
|
|
59
59
|
client,
|
|
@@ -62,9 +62,14 @@ function replyTarget(settings, boardKey, id, ctx) {
|
|
|
62
62
|
}
|
|
63
63
|
const meta = boardMetadata(ctx);
|
|
64
64
|
if (meta.boardThread) {
|
|
65
|
-
const { board, client } = clientFor(settings, boardKey, ctx);
|
|
65
|
+
const { board, client } = await clientFor(settings, boardKey, ctx);
|
|
66
66
|
const sessionKey = meta.board || void 0;
|
|
67
|
-
if (sessionKey !== void 0
|
|
67
|
+
if (sessionKey !== void 0) {
|
|
68
|
+
if (!matchesBoard(board, sessionKey)) throw new Error(`Pass the thread's \`id\`: this session's thread is on board "${sessionKey}", not "${board.key}".`);
|
|
69
|
+
} else if (boardKey !== void 0 && !board.shorthand) {
|
|
70
|
+
const own = await selectBoardAsync(settings(), void 0, void 0).catch(() => void 0);
|
|
71
|
+
if (own === void 0 || !matchesBoard(board, own.key)) throw new Error(`Pass the thread's \`id\`: this session's thread isn't on board "${board.key}".`);
|
|
72
|
+
}
|
|
68
73
|
return {
|
|
69
74
|
board,
|
|
70
75
|
client,
|
|
@@ -73,8 +78,8 @@ function replyTarget(settings, boardKey, id, ctx) {
|
|
|
73
78
|
}
|
|
74
79
|
const held = activeSessionClaim();
|
|
75
80
|
if (held !== null) {
|
|
76
|
-
|
|
77
|
-
|
|
81
|
+
const resolved = await selectBoardAsync(settings(), boardKey, held.board);
|
|
82
|
+
if (boardKey !== void 0 && !matchesBoard(resolved, held.board)) throw new Error(`Pass the thread's \`id\`: this session holds task #${held.claim.taskId} on board "${held.board}", not "${resolved.key}".`);
|
|
78
83
|
return {
|
|
79
84
|
board: resolved,
|
|
80
85
|
client: boardClients(resolved).model,
|
|
@@ -105,9 +110,9 @@ async function settleSessionTask(settings, settled, details) {
|
|
|
105
110
|
stopClaimRenewal(held.claim.token);
|
|
106
111
|
let resolved;
|
|
107
112
|
try {
|
|
108
|
-
resolved =
|
|
113
|
+
resolved = await selectBoardAsync(settings(), void 0, held.board);
|
|
109
114
|
} catch (error) {
|
|
110
|
-
clearSessionClaim();
|
|
115
|
+
if (boardErrorCode(error) === void 0) clearSessionClaim();
|
|
111
116
|
throw error;
|
|
112
117
|
}
|
|
113
118
|
const client = boardClients(resolved).deployment;
|
|
@@ -198,13 +203,23 @@ function summarize(message) {
|
|
|
198
203
|
function requireContent(text, attach) {
|
|
199
204
|
if ((text === void 0 || text.trim() === "") && (attach === void 0 || attach.length === 0)) throw new Error("Pass text, files to attach, or both.");
|
|
200
205
|
}
|
|
206
|
+
function defineBoardBoardsTool(settings) {
|
|
207
|
+
return defineTool({
|
|
208
|
+
deferred: true,
|
|
209
|
+
description: "List the boards this agent can access, with each board's key or ID (`board`), display name, whether it is the team's default board, and visibility.",
|
|
210
|
+
inputSchema: z.object({}),
|
|
211
|
+
async execute() {
|
|
212
|
+
return await listAccessibleBoards(settings());
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
}
|
|
201
216
|
function defineBoardChannelsTool(settings) {
|
|
202
217
|
return defineTool({
|
|
203
218
|
deferred: true,
|
|
204
219
|
description: "List the board's channels you can read.",
|
|
205
220
|
inputSchema: z.object({ board: boardOption }),
|
|
206
221
|
async execute({ board }, ctx) {
|
|
207
|
-
return { channels: await clientFor(settings, board, ctx).client.channels() };
|
|
222
|
+
return { channels: await (await clientFor(settings, board, ctx)).client.channels() };
|
|
208
223
|
}
|
|
209
224
|
});
|
|
210
225
|
}
|
|
@@ -224,7 +239,7 @@ function defineBoardReadTool(settings) {
|
|
|
224
239
|
limit: z.number().int().min(1).max(100).optional()
|
|
225
240
|
}),
|
|
226
241
|
async execute({ board: boardKey, id, link, after, ...query }, ctx) {
|
|
227
|
-
const board = clientFor(settings, boardKey, ctx).client;
|
|
242
|
+
const board = (await clientFor(settings, boardKey, ctx)).client;
|
|
228
243
|
if (id !== void 0) return summarizeThread(await board.thread(id, { after }));
|
|
229
244
|
if (link !== void 0) return summarizeThread(await board.linked(link));
|
|
230
245
|
if (query.channel === void 0) throw new Error("Pass `id`, `link`, or `channel`.");
|
|
@@ -259,7 +274,7 @@ function defineBoardPostTool(settings) {
|
|
|
259
274
|
}),
|
|
260
275
|
async execute({ board: boardKey, channel, text, attach, ...post }, ctx) {
|
|
261
276
|
requireContent(text, attach);
|
|
262
|
-
const board = clientFor(settings, boardKey, ctx).client;
|
|
277
|
+
const board = (await clientFor(settings, boardKey, ctx)).client;
|
|
263
278
|
const attachments = await uploadFiles(board, attach, ctx.getSandbox);
|
|
264
279
|
return written(await board.post(channel, {
|
|
265
280
|
...post,
|
|
@@ -283,7 +298,7 @@ function defineBoardReplyTool(settings) {
|
|
|
283
298
|
}),
|
|
284
299
|
async execute({ board: boardKey, id, text, attach, ...post }, ctx) {
|
|
285
300
|
requireContent(text, attach);
|
|
286
|
-
const { client: board, targetId } = replyTarget(settings, boardKey, id, ctx);
|
|
301
|
+
const { client: board, targetId } = await replyTarget(settings, boardKey, id, ctx);
|
|
287
302
|
const attachments = await uploadFiles(board, attach, ctx.getSandbox);
|
|
288
303
|
return written(await board.reply(targetId, {
|
|
289
304
|
...post,
|
|
@@ -304,7 +319,7 @@ function defineBoardNoteTool(settings) {
|
|
|
304
319
|
text: z.string().min(1).max(BOARD_TEXT_LIMIT)
|
|
305
320
|
}),
|
|
306
321
|
async execute({ board: boardKey, id, text }, ctx) {
|
|
307
|
-
const { client: board, targetId } = replyTarget(settings, boardKey, id, ctx);
|
|
322
|
+
const { client: board, targetId } = await replyTarget(settings, boardKey, id, ctx);
|
|
308
323
|
return written(await board.reply(targetId, {
|
|
309
324
|
id: postId(ctx),
|
|
310
325
|
noSync: true,
|
|
@@ -323,7 +338,7 @@ function defineBoardReactTool(settings) {
|
|
|
323
338
|
remove: z.boolean().optional()
|
|
324
339
|
}),
|
|
325
340
|
async execute({ board: boardKey, id, emoji, remove }, ctx) {
|
|
326
|
-
await clientFor(settings, boardKey, ctx).client.react(id, emoji, { remove });
|
|
341
|
+
await (await clientFor(settings, boardKey, ctx)).client.react(id, emoji, { remove });
|
|
327
342
|
return { ok: true };
|
|
328
343
|
}
|
|
329
344
|
});
|
|
@@ -340,7 +355,7 @@ function defineBoardLabelTool(settings) {
|
|
|
340
355
|
if: z.record(z.string(), z.string().nullable()).optional().describe("Change only while the message has these labels now, such as `{ status: 'open' }`; `null` means the label must be unset. Use it when others may change the same labels.")
|
|
341
356
|
}),
|
|
342
357
|
async execute({ board: boardKey, id, set, unset, if: conditions }, ctx) {
|
|
343
|
-
await clientFor(settings, boardKey, ctx).client.label(id, {
|
|
358
|
+
await (await clientFor(settings, boardKey, ctx)).client.label(id, {
|
|
344
359
|
if: conditions,
|
|
345
360
|
set,
|
|
346
361
|
unset
|
|
@@ -365,8 +380,8 @@ function defineBoardScheduleTool(settings) {
|
|
|
365
380
|
sync: z.boolean().optional().describe("Also post it to the thread's synced platforms, such as Slack.")
|
|
366
381
|
}),
|
|
367
382
|
async execute({ board: boardKey, id, sync, ...timing }, ctx) {
|
|
368
|
-
const { board: resolved, client: board } = clientFor(settings, boardKey, ctx);
|
|
369
|
-
const schedule = await board.schedule({ re: threadOrCurrent(id, ctx, resolved
|
|
383
|
+
const { board: resolved, client: board } = await clientFor(settings, boardKey, ctx);
|
|
384
|
+
const schedule = await board.schedule({ re: threadOrCurrent(id, ctx, resolved) }, {
|
|
370
385
|
...timing,
|
|
371
386
|
noSync: sync !== true
|
|
372
387
|
});
|
|
@@ -387,7 +402,7 @@ function defineBoardCancelScheduleTool(settings) {
|
|
|
387
402
|
id: z.string().min(1).describe("The schedule's ID.")
|
|
388
403
|
}),
|
|
389
404
|
async execute({ board: boardKey, id }, ctx) {
|
|
390
|
-
return await clientFor(settings, boardKey, ctx).client.cancelSchedule(id);
|
|
405
|
+
return await (await clientFor(settings, boardKey, ctx)).client.cancelSchedule(id);
|
|
391
406
|
}
|
|
392
407
|
});
|
|
393
408
|
}
|
|
@@ -401,9 +416,9 @@ function defineBoardSchedulesTool(settings) {
|
|
|
401
416
|
channel: z.string().min(1).optional()
|
|
402
417
|
}),
|
|
403
418
|
async execute({ board: boardKey, id, channel }, ctx) {
|
|
404
|
-
const { board: resolved, client: board } = clientFor(settings, boardKey, ctx);
|
|
419
|
+
const { board: resolved, client: board } = await clientFor(settings, boardKey, ctx);
|
|
405
420
|
const sessionKey = sessionBoard(ctx);
|
|
406
|
-
const sameBoard = sessionKey === void 0
|
|
421
|
+
const sameBoard = sessionKey === void 0 ? boardKey === void 0 : matchesBoard(resolved, sessionKey);
|
|
407
422
|
const re = id ?? (channel === void 0 && sameBoard ? currentThread(ctx) : void 0);
|
|
408
423
|
return { schedules: await board.schedules(re !== void 0 ? { re } : channel !== void 0 ? { channel } : { by: (await board.me()).actor }) };
|
|
409
424
|
}
|
|
@@ -420,7 +435,7 @@ function defineBoardActorsTool(settings) {
|
|
|
420
435
|
}),
|
|
421
436
|
async execute({ board: boardKey, search, limit }, ctx) {
|
|
422
437
|
const needle = search?.toLowerCase();
|
|
423
|
-
const actors = (await clientFor(settings, boardKey, ctx).client.actors()).filter((actor) => needle === void 0 || actor.handle.toLowerCase().includes(needle) || actor.name.toLowerCase().includes(needle));
|
|
438
|
+
const actors = (await (await clientFor(settings, boardKey, ctx)).client.actors()).filter((actor) => needle === void 0 || actor.handle.toLowerCase().includes(needle) || actor.name.toLowerCase().includes(needle));
|
|
424
439
|
return {
|
|
425
440
|
actors: actors.slice(0, limit ?? 50),
|
|
426
441
|
total: actors.length
|
|
@@ -441,7 +456,7 @@ function defineBoardCreateTaskTool(settings) {
|
|
|
441
456
|
noSync: z.boolean().optional()
|
|
442
457
|
}),
|
|
443
458
|
async execute({ board: boardKey, channel, ...task }, ctx) {
|
|
444
|
-
return summarize(await clientFor(settings, boardKey, ctx).client.createTask(channel, {
|
|
459
|
+
return summarize(await (await clientFor(settings, boardKey, ctx)).client.createTask(channel, {
|
|
445
460
|
...task,
|
|
446
461
|
id: postId(ctx)
|
|
447
462
|
}));
|
|
@@ -524,7 +539,7 @@ async function watchAuthorizationDenial(board, action, ctx, details = {}) {
|
|
|
524
539
|
if (caller.authenticator === "board-watcher") {
|
|
525
540
|
if (caller.attributes.actor_kind !== "person") return `Only a person on the team may ${what}, not a synced platform user or another agent.`;
|
|
526
541
|
const callerBoard = typeof caller.attributes.board_key === "string" ? caller.attributes.board_key : void 0;
|
|
527
|
-
if (callerBoard !== void 0 && callerBoard
|
|
542
|
+
if (callerBoard !== void 0 && !matchesBoard(board, callerBoard) || callerBoard === void 0 && !board.shorthand) return claiming ? "Board callers may only claim tasks on their own board. Configure `authorize` to allow it across boards." : "Board callers may only manage watches on their own board. Configure `authorize` to allow cross-board watch management.";
|
|
528
543
|
}
|
|
529
544
|
}
|
|
530
545
|
async function assertWatchAuthorized(board, action, ctx, details = {}) {
|
|
@@ -532,7 +547,7 @@ async function assertWatchAuthorized(board, action, ctx, details = {}) {
|
|
|
532
547
|
if (denial !== void 0) throw new Error(denial);
|
|
533
548
|
}
|
|
534
549
|
async function authorizingWatch(settings, board, action, ctx, details = {}) {
|
|
535
|
-
const resolved = targetBoard(settings, board, ctx);
|
|
550
|
+
const resolved = await targetBoard(settings, board, ctx, { needsMetadata: true });
|
|
536
551
|
await assertWatchAuthorized(resolved, action, ctx, details);
|
|
537
552
|
return {
|
|
538
553
|
config: resolved,
|
|
@@ -599,25 +614,24 @@ function defineBoardWatchTool(settings) {
|
|
|
599
614
|
function defineBoardWatchesTool(settings) {
|
|
600
615
|
return defineTool({
|
|
601
616
|
deferred: true,
|
|
602
|
-
description: "List your board watches: each one's ID and what it matches, and with `details`, what it does. Defaults to this session's board inside a board session; outside one,
|
|
617
|
+
description: "List your board watches: each one's ID and what it matches, and with `details`, what it does. Defaults to this session's board inside a board session; outside one, defaults to the team's default board (`General`) when discovery is enabled, or lists every authorized static board grouped by board when multiple static boards are configured with discovery disabled.",
|
|
603
618
|
inputSchema: z.object({
|
|
604
619
|
board: boardOption,
|
|
605
620
|
details: z.boolean().optional().describe("Also read each watch's instructions and action.")
|
|
606
621
|
}),
|
|
607
622
|
async execute({ board: boardKey, details }, ctx) {
|
|
608
|
-
const
|
|
623
|
+
const currentSettings = settings();
|
|
624
|
+
const set = resolveBoards(currentSettings);
|
|
609
625
|
const sessionKey = sessionBoard(ctx);
|
|
610
|
-
if (boardKey !== void 0 || sessionKey !== void 0 || set.byKey.size === 1) {
|
|
611
|
-
const
|
|
612
|
-
await assertWatchAuthorized(resolved, "watches", ctx);
|
|
613
|
-
const { deployment, watchChannel } = boardClients(resolved);
|
|
626
|
+
if (set.fallback !== void 0 || boardKey !== void 0 || sessionKey !== void 0 || set.byKey.size === 1) {
|
|
627
|
+
const { config, deployment, watchChannel } = await authorizingWatch(() => currentSettings, boardKey, "watches", ctx);
|
|
614
628
|
const watches = await listWatches({
|
|
615
629
|
client: deployment,
|
|
616
630
|
details: details === true,
|
|
617
631
|
watchChannel
|
|
618
632
|
});
|
|
619
|
-
return
|
|
620
|
-
board:
|
|
633
|
+
return config.shorthand ? { watches } : {
|
|
634
|
+
board: config.key,
|
|
621
635
|
watches
|
|
622
636
|
};
|
|
623
637
|
}
|
|
@@ -687,7 +701,7 @@ function defineBoardTasksTool(settings) {
|
|
|
687
701
|
limit: z.number().int().min(1).max(100).optional()
|
|
688
702
|
}),
|
|
689
703
|
async execute({ board: boardKey, ...query }, ctx) {
|
|
690
|
-
const page = await clientFor(settings, boardKey, ctx).client.tasks({
|
|
704
|
+
const page = await (await clientFor(settings, boardKey, ctx)).client.tasks({
|
|
691
705
|
...query,
|
|
692
706
|
limit: query.limit ?? 50
|
|
693
707
|
});
|
|
@@ -728,7 +742,7 @@ function defineBoardClaimTaskTool(settings) {
|
|
|
728
742
|
if (claimingSessions.has(ctx.session.id)) throw new Error("This session is already claiming a board task: claim one task at a time.");
|
|
729
743
|
claimingSessions.add(ctx.session.id);
|
|
730
744
|
try {
|
|
731
|
-
const resolved = targetBoard(settings, boardKey, ctx);
|
|
745
|
+
const resolved = await targetBoard(settings, boardKey, ctx, { needsMetadata: true });
|
|
732
746
|
const { deployment, model, watchChannel } = boardClients(resolved);
|
|
733
747
|
let claimChannel = channel;
|
|
734
748
|
if (id !== void 0) {
|
|
@@ -806,4 +820,4 @@ function defineBoardClaimTaskTool(settings) {
|
|
|
806
820
|
}
|
|
807
821
|
});
|
|
808
822
|
}
|
|
809
|
-
export { defineBoardActorsTool, defineBoardBlockTaskTool, defineBoardCancelScheduleTool, defineBoardChannelsTool, defineBoardClaimTaskTool, defineBoardCompleteTaskTool, defineBoardCreateTaskTool, defineBoardFailTaskTool, defineBoardLabelTool, defineBoardNoteTool, defineBoardPostTool, defineBoardReactTool, defineBoardReadTool, defineBoardReleaseTaskTool, defineBoardReplyTool, defineBoardScheduleTool, defineBoardSchedulesTool, defineBoardTasksTool, defineBoardUnwatchTool, defineBoardWatchTool, defineBoardWatchesTool, holdsSessionTask, holdsTask };
|
|
823
|
+
export { defineBoardActorsTool, defineBoardBlockTaskTool, defineBoardBoardsTool, defineBoardCancelScheduleTool, defineBoardChannelsTool, defineBoardClaimTaskTool, defineBoardCompleteTaskTool, defineBoardCreateTaskTool, defineBoardFailTaskTool, defineBoardLabelTool, defineBoardNoteTool, defineBoardPostTool, defineBoardReactTool, defineBoardReadTool, defineBoardReleaseTaskTool, defineBoardReplyTool, defineBoardScheduleTool, defineBoardSchedulesTool, defineBoardTasksTool, defineBoardUnwatchTool, defineBoardWatchTool, defineBoardWatchesTool, holdsSessionTask, holdsTask };
|
|
@@ -41,7 +41,9 @@ export interface BoardWatchFilter {
|
|
|
41
41
|
export declare function tailOf({ channel, label, by, text }: BoardWatchFilter): string;
|
|
42
42
|
export declare function coversChannel(pattern: string, channel: string): boolean;
|
|
43
43
|
export declare function assertWatchId(id: string): void;
|
|
44
|
-
export type BoardClientConfig = Pick<BoardSettings, "can" | "name" | "profile" | "team" | "url" | "watchChannel"
|
|
44
|
+
export type BoardClientConfig = Pick<BoardSettings, "can" | "id" | "name" | "profile" | "team" | "url" | "watchChannel"> & {
|
|
45
|
+
readonly ensure?: boolean;
|
|
46
|
+
};
|
|
45
47
|
export declare function boardClients(settings: BoardClientConfig): {
|
|
46
48
|
deployment: BoardClient;
|
|
47
49
|
model: BoardClient;
|
|
@@ -9,11 +9,11 @@ The board is where your team, and other agents, discuss work in channels and thr
|
|
|
9
9
|
|
|
10
10
|
## Multiple boards
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
By default, you can access any board on your team that your deployment has grants for. Use `boards` to discover available boards (their keys, IDs, and names):
|
|
13
13
|
|
|
14
14
|
- Inside a session a board started, your replies stay on that board and every board tool (including `watches`) defaults to it.
|
|
15
|
-
- Outside a board session, pass `board` with
|
|
16
|
-
-
|
|
15
|
+
- Outside a board session, omitting `board` uses the team's default board (`General`) when discovery is enabled; pass `board` with a board's name, ID (`brd_…`), or configured key to read, post to, watch, or manage another board.
|
|
16
|
+
- When the agent is restricted to a static set of configured boards (`"*": false`), your instructions list their keys: pass `board` with one of those keys outside a board session, or call `watches` with no `board` to list every authorized board's watches grouped by board.
|
|
17
17
|
|
|
18
18
|
## Before you post
|
|
19
19
|
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Lists the boards the agent can access. */
|
|
2
|
+
declare const _default: import("eve/tools").ToolDefinition<Record<string, never>, {
|
|
3
|
+
readonly boards: readonly import("../lib/boards.ts").AccessibleBoardSummary[];
|
|
4
|
+
readonly defaultBoardId: string | null;
|
|
5
|
+
}>;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { fileURLToPath as __eveFileURLToPath } from "node:url";
|
|
2
|
+
import { dirname as __eveDirname } from "node:path";
|
|
3
|
+
import { createRequire as __eveCreateRequire } from "node:module";
|
|
4
|
+
const __filename = __eveFileURLToPath(import.meta.url);
|
|
5
|
+
__eveDirname(__filename);
|
|
6
|
+
__eveCreateRequire(import.meta.url);
|
|
7
|
+
import extension_default from "../extension.mjs";
|
|
8
|
+
import { defineBoardBoardsTool } from "../lib/tools.mjs";
|
|
9
|
+
var boards_default = defineBoardBoardsTool(() => extension_default.config);
|
|
10
|
+
export { boards_default as default };
|
|
@@ -3,8 +3,8 @@ declare const _default: import("eve/tools").ToolDefinition<{
|
|
|
3
3
|
board?: string | undefined;
|
|
4
4
|
details?: boolean | undefined;
|
|
5
5
|
}, {
|
|
6
|
-
board?: undefined;
|
|
7
6
|
watches: import("../lib/watches.ts").BoardWatch[];
|
|
7
|
+
board?: undefined;
|
|
8
8
|
boards?: undefined;
|
|
9
9
|
} | {
|
|
10
10
|
board: string;
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
export { default as actors } from "../extension/tools/actors.js";
|
|
4
4
|
export { default as block_task } from "../extension/tools/block_task.js";
|
|
5
|
+
export { default as boards } from "../extension/tools/boards.js";
|
|
5
6
|
export { default as cancel_schedule } from "../extension/tools/cancel_schedule.js";
|
|
6
7
|
export { default as channels } from "../extension/tools/channels.js";
|
|
7
8
|
export { default as claim_task } from "../extension/tools/claim_task.js";
|
package/dist/tools/index.mjs
CHANGED
|
@@ -6,6 +6,7 @@ __eveDirname(__filename);
|
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
7
|
import actors_default from "../extension/tools/actors.mjs";
|
|
8
8
|
import block_task_default from "../extension/tools/block_task.mjs";
|
|
9
|
+
import boards_default from "../extension/tools/boards.mjs";
|
|
9
10
|
import cancel_schedule_default from "../extension/tools/cancel_schedule.mjs";
|
|
10
11
|
import channels_default from "../extension/tools/channels.mjs";
|
|
11
12
|
import claim_task_default from "../extension/tools/claim_task.mjs";
|
|
@@ -26,4 +27,4 @@ import tasks_default from "../extension/tools/tasks.mjs";
|
|
|
26
27
|
import unwatch_default from "../extension/tools/unwatch.mjs";
|
|
27
28
|
import watch_default from "../extension/tools/watch.mjs";
|
|
28
29
|
import watches_default from "../extension/tools/watches.mjs";
|
|
29
|
-
export { actors_default as actors, block_task_default as block_task, cancel_schedule_default as cancel_schedule, channels_default as channels, claim_task_default as claim_task, complete_task_default as complete_task, create_task_default as create_task, fail_task_default as fail_task, label_default as label, no_reply_default as no_reply, note_default as note, post_default as post, react_default as react, read_default as read, release_task_default as release_task, reply_default as reply, schedule_default as schedule, schedules_default as schedules, tasks_default as tasks, unwatch_default as unwatch, watch_default as watch, watches_default as watches };
|
|
30
|
+
export { actors_default as actors, block_task_default as block_task, boards_default as boards, cancel_schedule_default as cancel_schedule, channels_default as channels, claim_task_default as claim_task, complete_task_default as complete_task, create_task_default as create_task, fail_task_default as fail_task, label_default as label, no_reply_default as no_reply, note_default as note, post_default as post, react_default as react, read_default as read, release_task_default as release_task, reply_default as reply, schedule_default as schedule, schedules_default as schedules, tasks_default as tasks, unwatch_default as unwatch, watch_default as watch, watches_default as watches };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eve/board",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Vercel Board for eve agents: a channel that wakes the agent for watches it manages with tools, claims tasks, and replies in board threads",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eve",
|
|
@@ -44,12 +44,12 @@
|
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@vercel/board": "0.
|
|
47
|
+
"@vercel/board": "0.59.0",
|
|
48
48
|
"zod": "4.6.7"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@types/node": "26.6.6",
|
|
52
|
-
"eve": "1.
|
|
52
|
+
"eve": "1.8.0",
|
|
53
53
|
"typescript": "7.0.2"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|