letagents 0.12.16 → 0.12.18

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.
@@ -277,7 +277,7 @@ export function registerBoardIntentTools(server) {
277
277
  return taskToolError(String(error));
278
278
  }
279
279
  });
280
- server.tool("approve_board_intent", "Approve a pending board intent. For task_create intents this creates the task immediately and returns result.kind=\"task_created\"; do not call add_task afterward. Other intent types return a scoped approval token for the follow-up board action.", {
280
+ server.tool("approve_board_intent", "Approve a pending board intent. For task_create intents this creates the task immediately and returns result.kind=\"task_created\"; do not call add_task afterward. Other intent types notify the proposer to perform the exact follow-up with board_intent_id and their own worker session. The scoped approval token remains available for legacy callers; do not post it in room messages.", {
281
281
  intent_id: z.string().describe("Board intent id to approve."),
282
282
  reason: z.string().optional().describe("Short approval reason."),
283
283
  ...workerTaskIdentitySchema,
@@ -43,13 +43,16 @@ export function registerTaskBoardTools(server) {
43
43
  .string()
44
44
  .optional()
45
45
  .describe("Deprecated override. Agent identity is resolved automatically on room entry."),
46
+ client_task_id: z.string().trim().min(1).describe("Unique ID for this intended task. Reuse it on every retry; use a different ID for a separate task with identical contents."),
46
47
  source_message_id: z.string().optional().describe("Optional message ID where task was agreed, e.g. 'msg_42'"),
47
48
  ...workerTaskIdentitySchema,
48
49
  ...boardIntentApprovalSchema,
49
- }, async ({ title, description, created_by: _createdBy, source_message_id, room_id, conversation_id: _conversation_id, agent_session_id, board_intent_id, board_approval_token }) => {
50
+ }, async ({ title, description, created_by: _createdBy, source_message_id, client_task_id, room_id, conversation_id: _conversation_id, agent_session_id, board_intent_id, board_approval_token }) => {
50
51
  const target = resolveTaskToolTarget(room_id);
51
52
  if (!target)
52
53
  return taskToolError("Not in a room. Join one first.");
54
+ if (!client_task_id?.trim())
55
+ return taskToolError("client_task_id is required. Choose one ID for this intended task and reuse it on every retry.");
53
56
  const { identity, agentSession } = await resolveTaskToolIdentity(target, agent_session_id);
54
57
  const task = await createTask(target, {
55
58
  title,
@@ -57,10 +60,11 @@ export function registerTaskBoardTools(server) {
57
60
  created_by: identity.actor_label,
58
61
  ...taskActorPayload(identity, agentSession),
59
62
  source_message_id,
63
+ client_task_id,
60
64
  board_intent_id,
61
65
  board_approval_token,
62
66
  });
63
- await syncRoomPresence(target.effectiveRoomId, identity, getRememberedRoomPresence(target.effectiveRoomId, identity), agentSession);
67
+ await syncRoomPresence(target.effectiveRoomId, identity, getRememberedRoomPresence(target.effectiveRoomId, identity), agentSession).catch((error) => console.error("[tasks] Task created; presence update failed:", String(error)));
64
68
  return jsonToolResponse({ success: true, task, agent_identity: toPublicAgentIdentity(identity) }, 2);
65
69
  });
66
70
  server.tool("get_board", "Get the current task board for the room. By default shows only actionable tasks " +
@@ -6,8 +6,9 @@ import { resolveTaskToolIdentity, resolveTaskToolTarget, taskActorPayload, } fro
6
6
  import { jsonToolResponse, taskToolError } from "./response.js";
7
7
  import { deprecatedAssigneeSchema, boardIntentApprovalSchema, TASK_STATUSES, workerTaskIdentitySchema, workflowArtifactSchema, } from "./schemas.js";
8
8
  export function registerTaskMutationTools(server) {
9
- server.tool("claim_task", "Claim an accepted task. The task must be in 'accepted' " +
10
- "status. This sets the assignee to you and moves the status to 'assigned'. " +
9
+ server.tool("claim_task", "Claim an accepted task, or retry your own assigned task to recover a missing work lease. " +
10
+ "This sets the assignee to you and moves the status to 'assigned'. A retry with your active lease is idempotent. " +
11
+ "If approval is required, register a task claim intent; after the manager approves it, pass board_intent_id. Managed workers do not need to copy approval tokens. " +
11
12
  "Do NOT claim proposed tasks — they need to be accepted first.", {
12
13
  task_id: z.string().describe("The task ID to claim, e.g. 'task_1'"),
13
14
  assignee: deprecatedAssigneeSchema,
@@ -30,7 +31,7 @@ export function registerTaskMutationTools(server) {
30
31
  await syncRoomPresence(target.effectiveRoomId, identity, {
31
32
  status: "working",
32
33
  status_text: `claimed ${task_id}`,
33
- }, agentSession);
34
+ }, agentSession).catch((error) => console.error("[tasks] Task updated; presence update failed:", String(error)));
34
35
  return jsonToolResponse({ success: true, task: updated, agent_identity: toPublicAgentIdentity(identity) }, 2);
35
36
  }
36
37
  catch (error) {
@@ -76,7 +77,7 @@ export function registerTaskMutationTools(server) {
76
77
  await syncRoomPresence(target.effectiveRoomId, identity, {
77
78
  status: deriveTaskPresenceStatus(status ?? null, rememberedPresence.status),
78
79
  status_text: status ? `${task_id} -> ${status}` : rememberedPresence.status_text,
79
- }, agentSession);
80
+ }, agentSession).catch((error) => console.error("[tasks] Task updated; presence update failed:", String(error)));
80
81
  return jsonToolResponse({
81
82
  success: true,
82
83
  task: updated,
@@ -107,7 +108,7 @@ export function registerTaskMutationTools(server) {
107
108
  await syncRoomPresence(target.effectiveRoomId, identity, {
108
109
  status: "reviewing",
109
110
  status_text: `${task_id} -> in_review`,
110
- }, agentSession);
111
+ }, agentSession).catch((error) => console.error("[tasks] Task updated; presence update failed:", String(error)));
111
112
  return jsonToolResponse({
112
113
  success: true,
113
114
  task: updated,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "letagents",
3
- "version": "0.12.16",
3
+ "version": "0.12.18",
4
4
  "description": "Let Agents Chat — MCP server for AI agent communication",
5
5
  "type": "module",
6
6
  "main": "dist/mcp/server.js",