@rallycry/conveyor-mcp 3.4.0 → 3.6.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/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ConveyorConnection
4
- } from "./chunk-2DPMMT6S.js";
4
+ } from "./chunk-VGAKBJ2O.js";
5
5
 
6
6
  // src/cli.ts
7
7
  import { createRequire } from "module";
@@ -9,29 +9,43 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
9
9
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
10
10
 
11
11
  // src/tools/project.ts
12
+ import { z } from "zod";
12
13
  function registerProjectTools(server2, conn2) {
13
14
  server2.tool(
14
- "get_project_summary",
15
- "Get overall project status: task counts by status, active builds, repo info",
15
+ "list_projects",
16
+ "List Conveyor projects available to this MCP token's user. Use a returned project id as projectId on other tools when no default project is configured or when targeting a different project.",
16
17
  {},
17
18
  async () => {
18
- const summary = await conn2.getProjectSummary();
19
+ const projects = await conn2.listProjects();
20
+ return { content: [{ type: "text", text: JSON.stringify(projects, null, 2) }] };
21
+ }
22
+ );
23
+ server2.tool(
24
+ "get_project_summary",
25
+ "Get overall project status: task counts by status, active builds, repo info. Pass projectId to target a specific project; otherwise the configured default project is used.",
26
+ {
27
+ projectId: z.string().optional().describe("Target Conveyor project ID")
28
+ },
29
+ async (params) => {
30
+ const summary = await conn2.getProjectSummary(params.projectId);
19
31
  return { content: [{ type: "text", text: JSON.stringify(summary, null, 2) }] };
20
32
  }
21
33
  );
22
34
  server2.tool(
23
35
  "list_project_members",
24
- "List project members with user ID, name, email, and access level \u2014 use to resolve a person's name or email to a user ID for task assignment or review",
25
- {},
26
- async () => {
27
- const members = await conn2.listProjectMembers();
36
+ "List project members with user ID, name, email, and access level \u2014 use to resolve a person's name or email to a user ID for task assignment or review. Pass projectId to target a specific project; otherwise the configured default project is used.",
37
+ {
38
+ projectId: z.string().optional().describe("Target Conveyor project ID")
39
+ },
40
+ async (params) => {
41
+ const members = await conn2.listProjectMembers(params.projectId);
28
42
  return { content: [{ type: "text", text: JSON.stringify(members, null, 2) }] };
29
43
  }
30
44
  );
31
45
  }
32
46
 
33
47
  // src/tools/tasks.ts
34
- import { z } from "zod";
48
+ import { z as z2 } from "zod";
35
49
  var CLI_EVENT_FORMATTERS = {
36
50
  thinking: (data) => String(data.message ?? ""),
37
51
  tool_use: (data) => `${data.tool}: ${String(data.input ?? "").slice(0, 1e3)}`,
@@ -69,12 +83,13 @@ var STATUS_ENUM = [
69
83
  function registerListTasks(server2, conn2) {
70
84
  server2.tool(
71
85
  "list_tasks",
72
- "List project tasks, optionally filtered by status or assignment (a specific assignee, or unassigned tasks). Returns summaries \u2014 plan omitted, description truncated; use get_task for full details.",
86
+ "List project tasks, optionally filtered by status or assignment (a specific assignee, or unassigned tasks). Pass projectId to target a specific project; otherwise the configured default project is used. Returns summaries \u2014 plan omitted, description truncated; use get_task for full details.",
73
87
  {
74
- status: z.enum(STATUS_ENUM).optional().describe("Filter by task status"),
75
- assigneeId: z.string().optional().describe("Filter by assigned user ID"),
76
- unassigned: z.boolean().optional().describe("Only return tasks with no assignee (mutually exclusive with assigneeId)"),
77
- limit: z.number().optional().describe("Max tasks to return (default 50)")
88
+ projectId: z2.string().optional().describe("Target Conveyor project ID"),
89
+ status: z2.enum(STATUS_ENUM).optional().describe("Filter by task status"),
90
+ assigneeId: z2.string().optional().describe("Filter by assigned user ID"),
91
+ unassigned: z2.boolean().optional().describe("Only return tasks with no assignee (mutually exclusive with assigneeId)"),
92
+ limit: z2.number().optional().describe("Max tasks to return (default 50)")
78
93
  },
79
94
  async (params) => {
80
95
  const tasks = await conn2.listTasks(params);
@@ -87,12 +102,27 @@ function registerListTasks(server2, conn2) {
87
102
  function registerGetTask(server2, conn2) {
88
103
  server2.tool(
89
104
  "get_task",
90
- "Get full task details including plan, chat history, PR info, subtasks, and build status",
105
+ "Get full task details including plan, chat history, PR info, subtasks, and build status. Pass projectId to target a specific project; otherwise the configured default project is used.",
91
106
  {
92
- taskId: z.string().describe("The task ID or slug (the value in a card URL, /cards/<slug>)")
107
+ projectId: z2.string().optional().describe("Target Conveyor project ID"),
108
+ taskId: z2.string().describe("The task ID or slug (the value in a card URL, /cards/<slug>)")
93
109
  },
94
110
  async (params) => {
95
- const task = await conn2.getTask(params.taskId);
111
+ const task = await conn2.getTask(params.taskId, params.projectId);
112
+ return { content: [{ type: "text", text: JSON.stringify(task, null, 2) }] };
113
+ }
114
+ );
115
+ }
116
+ function registerGetCardBySlug(server2, conn2) {
117
+ server2.tool(
118
+ "get_card_by_slug",
119
+ "Get full card details by the slug from a card URL (/cards/<slug>) instead of a task ID. Pass projectId to target a specific project; otherwise the configured default project is used.",
120
+ {
121
+ projectId: z2.string().optional().describe("Target Conveyor project ID"),
122
+ slug: z2.string().describe("The card slug from a Conveyor card URL, e.g. 'ship-it'")
123
+ },
124
+ async (params) => {
125
+ const task = await conn2.getCardBySlug(params.slug, params.projectId);
96
126
  return { content: [{ type: "text", text: JSON.stringify(task, null, 2) }] };
97
127
  }
98
128
  );
@@ -100,12 +130,13 @@ function registerGetTask(server2, conn2) {
100
130
  function registerCreateTask(server2, conn2) {
101
131
  server2.tool(
102
132
  "create_task",
103
- "Create a new task with title, description, and optional plan. Icon, story points, and agent assignment are auto-filled when a task is created in (or later moved to) a status beyond Planning \u2014 don't spend turns on them.",
133
+ "Create a new task with title, description, and optional plan. Pass projectId to target a specific project; otherwise the configured default project is used. Icon, story points, and agent assignment are auto-filled when a task is created in (or later moved to) a status beyond Planning \u2014 don't spend turns on them.",
104
134
  {
105
- title: z.string().describe("Task title"),
106
- description: z.string().optional().describe("Task description"),
107
- plan: z.string().optional().describe("Task implementation plan (markdown)"),
108
- status: z.enum(["Planning", "Open"]).optional().describe("Initial status (default: Planning)")
135
+ projectId: z2.string().optional().describe("Target Conveyor project ID"),
136
+ title: z2.string().describe("Task title"),
137
+ description: z2.string().optional().describe("Task description"),
138
+ plan: z2.string().optional().describe("Task implementation plan (markdown)"),
139
+ status: z2.enum(["Planning", "Open"]).optional().describe("Initial status (default: Planning)")
109
140
  },
110
141
  async (params) => {
111
142
  const task = await conn2.createTask(params);
@@ -118,14 +149,15 @@ function registerCreateTask(server2, conn2) {
118
149
  function registerUpdateTask(server2, conn2) {
119
150
  server2.tool(
120
151
  "update_task",
121
- "Update task fields: title, description, plan, status, or assignment. Moving a task beyond Planning auto-fills any missing icon, story points, and agent assignment \u2014 don't spend turns on them.",
152
+ "Update task fields: title, description, plan, status, or assignment. Pass projectId to target a specific project; otherwise the configured default project is used. Moving a task beyond Planning auto-fills any missing icon, story points, and agent assignment \u2014 don't spend turns on them.",
122
153
  {
123
- taskId: z.string().describe("The task ID"),
124
- title: z.string().optional().describe("New title"),
125
- description: z.string().optional().describe("New description"),
126
- plan: z.string().optional().describe("New plan (markdown)"),
127
- status: z.enum(STATUS_ENUM).optional().describe("New status"),
128
- assignedUserId: z.string().nullable().optional().describe("User ID to assign, or null")
154
+ projectId: z2.string().optional().describe("Target Conveyor project ID"),
155
+ taskId: z2.string().describe("The task ID"),
156
+ title: z2.string().optional().describe("New title"),
157
+ description: z2.string().optional().describe("New description"),
158
+ plan: z2.string().optional().describe("New plan (markdown)"),
159
+ status: z2.enum(STATUS_ENUM).optional().describe("New status"),
160
+ assignedUserId: z2.string().nullable().optional().describe("User ID to assign, or null")
129
161
  },
130
162
  async (params) => {
131
163
  const result = await conn2.updateTask(params);
@@ -138,25 +170,27 @@ function registerUpdateTask(server2, conn2) {
138
170
  function registerChatTools(server2, conn2) {
139
171
  server2.tool(
140
172
  "read_task_chat",
141
- "Read messages from a task's chat. For agent execution logs use get_task_logs.",
173
+ "Read messages from a task's chat. Pass projectId to target a specific project; otherwise the configured default project is used. For agent execution logs use get_task_logs.",
142
174
  {
143
- taskId: z.string().describe("The task ID"),
144
- limit: z.number().optional().describe("Max messages to return (default 50)")
175
+ projectId: z2.string().optional().describe("Target Conveyor project ID"),
176
+ taskId: z2.string().describe("The task ID"),
177
+ limit: z2.number().optional().describe("Max messages to return (default 50)")
145
178
  },
146
179
  async (params) => {
147
- const messages = await conn2.getTaskChat(params.taskId, params.limit);
180
+ const messages = await conn2.getTaskChat(params.taskId, params.limit, params.projectId);
148
181
  return { content: [{ type: "text", text: JSON.stringify(messages, null, 2) }] };
149
182
  }
150
183
  );
151
184
  server2.tool(
152
185
  "post_to_chat",
153
- "Post a message to a task's chat",
186
+ "Post a message to a task's chat. Pass projectId to target a specific project; otherwise the configured default project is used.",
154
187
  {
155
- taskId: z.string().describe("The task ID"),
156
- content: z.string().describe("Message content")
188
+ projectId: z2.string().optional().describe("Target Conveyor project ID"),
189
+ taskId: z2.string().describe("The task ID"),
190
+ content: z2.string().describe("Message content")
157
191
  },
158
192
  async (params) => {
159
- await conn2.postToTaskChat(params.taskId, params.content);
193
+ await conn2.postToTaskChat(params.taskId, params.content, params.projectId);
160
194
  return { content: [{ type: "text", text: "Message posted" }] };
161
195
  }
162
196
  );
@@ -164,17 +198,18 @@ function registerChatTools(server2, conn2) {
164
198
  function registerGetTaskCli(server2, conn2) {
165
199
  server2.tool(
166
200
  "get_task_logs",
167
- "Read CLI execution logs from a task. Returns agent reasoning, tool calls, setup output, and other execution events. For human chat use read_task_chat.",
201
+ "Read CLI execution logs from a task. Pass projectId to target a specific project; otherwise the configured default project is used. Returns agent reasoning, tool calls, setup output, and other execution events. For human chat use read_task_chat.",
168
202
  {
169
- taskId: z.string().describe("The task ID or slug"),
170
- source: z.enum(["agent", "application"]).optional().describe(
203
+ projectId: z2.string().optional().describe("Target Conveyor project ID"),
204
+ taskId: z2.string().describe("The task ID or slug"),
205
+ source: z2.enum(["agent", "application"]).optional().describe(
171
206
  "Filter by log source: 'agent' for reasoning/tool calls, 'application' for setup/dev-server output"
172
207
  ),
173
- limit: z.number().optional().describe("Max entries to return (default 50, max 500)")
208
+ limit: z2.number().optional().describe("Max entries to return (default 50, max 500)")
174
209
  },
175
- async ({ taskId, source, limit }) => {
210
+ async ({ taskId, source, limit, projectId: projectId2 }) => {
176
211
  const effectiveLimit = Math.min(limit ?? 50, 500);
177
- const logs = await conn2.getTaskCli(taskId, effectiveLimit, source);
212
+ const logs = await conn2.getTaskCli(taskId, effectiveLimit, source, projectId2);
178
213
  const formatted = logs.map((log) => {
179
214
  return `[${log.timestamp}] [${log.type}] ${formatCliEventSummary(log.type, log.data)}`;
180
215
  }).join("\n");
@@ -187,14 +222,15 @@ function registerGetTaskCli(server2, conn2) {
187
222
  function registerSearchTasks(server2, conn2) {
188
223
  server2.tool(
189
224
  "search_tasks",
190
- "Search tasks by tag name, text query, status, and/or assignment. Use tag names like 'agent-runner', not IDs. Returns summaries \u2014 plan omitted, description truncated; use get_task for full details.",
225
+ "Search tasks by tag name, text query, status, and/or assignment. Pass projectId to target a specific project; otherwise the configured default project is used. Use tag names like 'agent-runner', not IDs. Returns summaries \u2014 plan omitted, description truncated; use get_task for full details.",
191
226
  {
192
- tagNames: z.array(z.string()).optional().describe('Tag names to filter by (e.g., ["agent-runner", "chat"])'),
193
- searchQuery: z.string().optional().describe("Text search on title and description"),
194
- statusFilters: z.array(z.enum(STATUS_ENUM)).optional().describe("Filter by one or more statuses"),
195
- assigneeId: z.string().optional().describe("Filter by assigned user ID"),
196
- unassigned: z.boolean().optional().describe("Only return tasks with no assignee (mutually exclusive with assigneeId)"),
197
- limit: z.number().optional().describe("Max results to return (default 20)")
227
+ projectId: z2.string().optional().describe("Target Conveyor project ID"),
228
+ tagNames: z2.array(z2.string()).optional().describe('Tag names to filter by (e.g., ["agent-runner", "chat"])'),
229
+ searchQuery: z2.string().optional().describe("Text search on title and description"),
230
+ statusFilters: z2.array(z2.enum(STATUS_ENUM)).optional().describe("Filter by one or more statuses"),
231
+ assigneeId: z2.string().optional().describe("Filter by assigned user ID"),
232
+ unassigned: z2.boolean().optional().describe("Only return tasks with no assignee (mutually exclusive with assigneeId)"),
233
+ limit: z2.number().optional().describe("Max results to return (default 20)")
198
234
  },
199
235
  async (params) => {
200
236
  const tasks = await conn2.searchTasks(params);
@@ -207,10 +243,12 @@ function registerSearchTasks(server2, conn2) {
207
243
  function registerListTags(server2, conn2) {
208
244
  server2.tool(
209
245
  "list_tags",
210
- "List all project tags with their names, IDs, and colors",
211
- {},
212
- async () => {
213
- const tags = await conn2.listTags();
246
+ "List all project tags with their names, IDs, and colors. Pass projectId to target a specific project; otherwise the configured default project is used.",
247
+ {
248
+ projectId: z2.string().optional().describe("Target Conveyor project ID")
249
+ },
250
+ async (params) => {
251
+ const tags = await conn2.listTags(params.projectId);
214
252
  return { content: [{ type: "text", text: JSON.stringify(tags, null, 2) }] };
215
253
  }
216
254
  );
@@ -218,12 +256,13 @@ function registerListTags(server2, conn2) {
218
256
  function registerReviewTools(server2, conn2) {
219
257
  server2.tool(
220
258
  "approve_task",
221
- "Move a task forward in the review flow (ReviewPR -> ReviewDev, or -> Complete)",
259
+ "Move a task forward in the review flow (ReviewPR -> ReviewDev, or -> Complete). Pass projectId to target a specific project; otherwise the configured default project is used.",
222
260
  {
223
- taskId: z.string().describe("The task ID")
261
+ projectId: z2.string().optional().describe("Target Conveyor project ID"),
262
+ taskId: z2.string().describe("The task ID")
224
263
  },
225
264
  async (params) => {
226
- const result = await conn2.approveTask(params.taskId);
265
+ const result = await conn2.approveTask(params.taskId, params.projectId);
227
266
  return {
228
267
  content: [{ type: "text", text: `Task approved, new status: ${result.status}` }]
229
268
  };
@@ -231,12 +270,13 @@ function registerReviewTools(server2, conn2) {
231
270
  );
232
271
  server2.tool(
233
272
  "approve_and_merge_pr",
234
- "Approve and merge a child task's pull request. Only succeeds if all CI/CD checks are passing. The child task must be in ReviewPR status with a PR.",
273
+ "Approve and merge a child task's pull request. Pass projectId to target a specific project; otherwise the configured default project is used. Only succeeds if all CI/CD checks are passing. The child task must be in ReviewPR status with a PR.",
235
274
  {
236
- childTaskId: z.string().describe("The child task ID whose PR should be approved and merged")
275
+ projectId: z2.string().optional().describe("Target Conveyor project ID"),
276
+ childTaskId: z2.string().describe("The child task ID whose PR should be approved and merged")
237
277
  },
238
278
  async (params) => {
239
- const result = await conn2.approveAndMergePR(params.childTaskId);
279
+ const result = await conn2.approveAndMergePR(params.childTaskId, params.projectId);
240
280
  return {
241
281
  content: [
242
282
  {
@@ -249,13 +289,14 @@ function registerReviewTools(server2, conn2) {
249
289
  );
250
290
  server2.tool(
251
291
  "request_changes",
252
- "Post feedback and send task back to InProgress for more work",
292
+ "Post feedback and send task back to InProgress for more work. Pass projectId to target a specific project; otherwise the configured default project is used.",
253
293
  {
254
- taskId: z.string().describe("The task ID"),
255
- feedback: z.string().describe("Feedback message describing requested changes")
294
+ projectId: z2.string().optional().describe("Target Conveyor project ID"),
295
+ taskId: z2.string().describe("The task ID"),
296
+ feedback: z2.string().describe("Feedback message describing requested changes")
256
297
  },
257
298
  async (params) => {
258
- await conn2.requestChanges(params.taskId, params.feedback);
299
+ await conn2.requestChanges(params.taskId, params.feedback, params.projectId);
259
300
  return { content: [{ type: "text", text: "Changes requested, task moved to InProgress" }] };
260
301
  }
261
302
  );
@@ -267,10 +308,11 @@ function formatReviewerList(reviewers) {
267
308
  function registerReviewerTools(server2, conn2) {
268
309
  server2.tool(
269
310
  "add_reviewer",
270
- "Add a project member as a reviewer on a task. Idempotent \u2014 adding an existing reviewer is a no-op.",
311
+ "Add a project member as a reviewer on a task. Pass projectId to target a specific project; otherwise the configured default project is used. Idempotent \u2014 adding an existing reviewer is a no-op.",
271
312
  {
272
- taskId: z.string().describe("The task ID or slug"),
273
- userId: z.string().describe("User ID of the reviewer (use list_project_members to resolve a name or email)")
313
+ projectId: z2.string().optional().describe("Target Conveyor project ID"),
314
+ taskId: z2.string().describe("The task ID or slug"),
315
+ userId: z2.string().describe("User ID of the reviewer (use list_project_members to resolve a name or email)")
274
316
  },
275
317
  async (params) => {
276
318
  const result = await conn2.addReviewer(params);
@@ -286,10 +328,11 @@ function registerReviewerTools(server2, conn2) {
286
328
  );
287
329
  server2.tool(
288
330
  "remove_reviewer",
289
- "Remove a reviewer from a task. Idempotent \u2014 removing a non-reviewer is a no-op.",
331
+ "Remove a reviewer from a task. Pass projectId to target a specific project; otherwise the configured default project is used. Idempotent \u2014 removing a non-reviewer is a no-op.",
290
332
  {
291
- taskId: z.string().describe("The task ID or slug"),
292
- userId: z.string().describe("User ID of the reviewer to remove")
333
+ projectId: z2.string().optional().describe("Target Conveyor project ID"),
334
+ taskId: z2.string().describe("The task ID or slug"),
335
+ userId: z2.string().describe("User ID of the reviewer to remove")
293
336
  },
294
337
  async (params) => {
295
338
  const result = await conn2.removeReviewer(params);
@@ -307,6 +350,7 @@ function registerReviewerTools(server2, conn2) {
307
350
  function registerTaskTools(server2, conn2) {
308
351
  registerListTasks(server2, conn2);
309
352
  registerGetTask(server2, conn2);
353
+ registerGetCardBySlug(server2, conn2);
310
354
  registerCreateTask(server2, conn2);
311
355
  registerUpdateTask(server2, conn2);
312
356
  registerChatTools(server2, conn2);
@@ -318,51 +362,55 @@ function registerTaskTools(server2, conn2) {
318
362
  }
319
363
 
320
364
  // src/tools/builds.ts
321
- import { z as z2 } from "zod";
365
+ import { z as z3 } from "zod";
322
366
  function registerBuildTools(server2, conn2) {
323
367
  server2.tool(
324
368
  "start_task",
325
- "Start a cloud build (codespace) for a task",
369
+ "Start a cloud build (codespace) for a task. Pass projectId to target a specific project; otherwise the configured default project is used.",
326
370
  {
327
- taskId: z2.string().describe("The task ID")
371
+ projectId: z3.string().optional().describe("Target Conveyor project ID"),
372
+ taskId: z3.string().describe("The task ID")
328
373
  },
329
374
  async (params) => {
330
- const result = await conn2.startBuild(params.taskId);
375
+ const result = await conn2.startBuild(params.taskId, params.projectId);
331
376
  return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
332
377
  }
333
378
  );
334
379
  server2.tool(
335
380
  "stop_task",
336
- "Stop a running cloud build for a task",
381
+ "Stop a running cloud build for a task. Pass projectId to target a specific project; otherwise the configured default project is used.",
337
382
  {
338
- taskId: z2.string().describe("The task ID")
383
+ projectId: z3.string().optional().describe("Target Conveyor project ID"),
384
+ taskId: z3.string().describe("The task ID")
339
385
  },
340
386
  async (params) => {
341
- const result = await conn2.stopBuild(params.taskId);
387
+ const result = await conn2.stopBuild(params.taskId, params.projectId);
342
388
  return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
343
389
  }
344
390
  );
345
391
  server2.tool(
346
392
  "create_release",
347
- "Create a release for the project \u2014 the same flow as the Release button in the web UI. Creates a release task with a release/YYYY.MM.N branch and a PR from the dev branch to the default branch. Omit taskIds to release ALL cards currently in Review (Dev); pass a subset to cherry-pick \u2014 a cloud build agent then cherry-picks those changes and resolves conflicts. Fails if a release is already in progress or no cards are in Review (Dev).",
393
+ "Create a release for the project \u2014 the same flow as the Release button in the web UI. Pass projectId to target a specific project; otherwise the configured default project is used. Creates a release task with a release/YYYY.MM.N branch and a PR from the dev branch to the default branch. Omit taskIds to release ALL cards currently in Review (Dev); pass a subset to cherry-pick \u2014 a cloud build agent then cherry-picks those changes and resolves conflicts. Fails if a release is already in progress or no cards are in Review (Dev).",
348
394
  {
349
- taskIds: z2.array(z2.string()).optional().describe(
395
+ projectId: z3.string().optional().describe("Target Conveyor project ID"),
396
+ taskIds: z3.array(z3.string()).optional().describe(
350
397
  "Task IDs in Review (Dev) to cherry-pick into the release. Omit to release all of them."
351
398
  )
352
399
  },
353
400
  async (params) => {
354
- const result = await conn2.createRelease(params.taskIds);
401
+ const result = await conn2.createRelease(params.taskIds, params.projectId);
355
402
  return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
356
403
  }
357
404
  );
358
405
  server2.tool(
359
406
  "get_build_status",
360
- "Check codespace and agent status for a task",
407
+ "Check codespace and agent status for a task. Pass projectId to target a specific project; otherwise the configured default project is used.",
361
408
  {
362
- taskId: z2.string().describe("The task ID")
409
+ projectId: z3.string().optional().describe("Target Conveyor project ID"),
410
+ taskId: z3.string().describe("The task ID")
363
411
  },
364
412
  async (params) => {
365
- const status = await conn2.getBuildStatus(params.taskId);
413
+ const status = await conn2.getBuildStatus(params.taskId, params.projectId);
366
414
  return { content: [{ type: "text", text: JSON.stringify(status, null, 2) }] };
367
415
  }
368
416
  );
@@ -371,7 +419,7 @@ function registerBuildTools(server2, conn2) {
371
419
  // src/tools/attachments.ts
372
420
  import { readFile, stat } from "fs/promises";
373
421
  import { basename, extname } from "path";
374
- import { z as z3 } from "zod";
422
+ import { z as z4 } from "zod";
375
423
  var MAX_FILE_SIZE_BYTES = 25 * 1024 * 1024;
376
424
  var MIME_BY_EXT = {
377
425
  ".png": "image/png",
@@ -406,12 +454,13 @@ function inferMimeType(filePath, override) {
406
454
  function registerListTaskFiles(server2, conn2) {
407
455
  server2.tool(
408
456
  "list_task_files",
409
- "List all files attached to a task with metadata (no contents \u2014 fast and small). Use before fetching a specific file to see what is available and how large each is. For file contents use get_attachment.",
457
+ "List all files attached to a task with metadata (no contents \u2014 fast and small). Pass projectId to target a specific project; otherwise the configured default project is used. Use before fetching a specific file to see what is available and how large each is. For file contents use get_attachment.",
410
458
  {
411
- taskId: z3.string().describe("The task ID or slug")
459
+ projectId: z4.string().optional().describe("Target Conveyor project ID"),
460
+ taskId: z4.string().describe("The task ID or slug")
412
461
  },
413
462
  async (params) => {
414
- const files = await conn2.listTaskFiles(params.taskId);
463
+ const files = await conn2.listTaskFiles(params.taskId, params.projectId);
415
464
  return { content: [{ type: "text", text: JSON.stringify(files, null, 2) }] };
416
465
  }
417
466
  );
@@ -448,17 +497,19 @@ function buildAttachmentContent(file) {
448
497
  function registerGetAttachment(server2, conn2) {
449
498
  server2.tool(
450
499
  "get_attachment",
451
- "Fetch one task file's content plus metadata by file ID (accepts task id or slug). Images are returned as viewable image blocks. Large text files (logs, JSON) are returned in pages \u2014 use `offset`/`maxBytes` to read more, or fetch `downloadUrl` for the whole file. Call list_task_files first to discover IDs and sizes.",
500
+ "Fetch one task file's content plus metadata by file ID (accepts task id or slug). Pass projectId to target a specific project; otherwise the configured default project is used. Images are returned as viewable image blocks. Large text files (logs, JSON) are returned in pages \u2014 use `offset`/`maxBytes` to read more, or fetch `downloadUrl` for the whole file. Call list_task_files first to discover IDs and sizes.",
452
501
  {
453
- taskId: z3.string().describe("The task ID or slug"),
454
- fileId: z3.string().describe("The file ID to fetch"),
455
- offset: z3.number().int().nonnegative().optional().describe("Byte offset into text content (paging). Default 0."),
456
- maxBytes: z3.number().int().positive().optional().describe("Max bytes of text content to return from offset.")
502
+ projectId: z4.string().optional().describe("Target Conveyor project ID"),
503
+ taskId: z4.string().describe("The task ID or slug"),
504
+ fileId: z4.string().describe("The file ID to fetch"),
505
+ offset: z4.number().int().nonnegative().optional().describe("Byte offset into text content (paging). Default 0."),
506
+ maxBytes: z4.number().int().positive().optional().describe("Max bytes of text content to return from offset.")
457
507
  },
458
508
  async (params) => {
459
509
  const file = await conn2.getAttachment(params.taskId, params.fileId, {
460
510
  offset: params.offset,
461
- maxBytes: params.maxBytes
511
+ maxBytes: params.maxBytes,
512
+ projectId: params.projectId
462
513
  });
463
514
  return { content: buildAttachmentContent(file) };
464
515
  }
@@ -467,12 +518,13 @@ function registerGetAttachment(server2, conn2) {
467
518
  function registerUploadAttachment(server2, conn2) {
468
519
  server2.tool(
469
520
  "upload_attachment",
470
- "Upload a local file as a task attachment (any file type, up to 25MB). The file appears under the task's Files. Pass `comment` to also post it to the task chat in the same step.",
521
+ "Upload a local file as a task attachment (any file type, up to 25MB). Pass projectId to target a specific project; otherwise the configured default project is used. The file appears under the task's Files. Pass `comment` to also post it to the task chat in the same step.",
471
522
  {
472
- taskId: z3.string().describe("The task ID or slug"),
473
- path: z3.string().describe("Absolute path to the local file to upload"),
474
- comment: z3.string().optional().describe("When set, also posts the attachment to the task chat with this text"),
475
- mimeType: z3.string().optional().describe("Override the mime type inferred from the file extension")
523
+ projectId: z4.string().optional().describe("Target Conveyor project ID"),
524
+ taskId: z4.string().describe("The task ID or slug"),
525
+ path: z4.string().describe("Absolute path to the local file to upload"),
526
+ comment: z4.string().optional().describe("When set, also posts the attachment to the task chat with this text"),
527
+ mimeType: z4.string().optional().describe("Override the mime type inferred from the file extension")
476
528
  },
477
529
  async (params) => {
478
530
  const info = await stat(params.path).catch(() => null);
@@ -494,7 +546,8 @@ function registerUploadAttachment(server2, conn2) {
494
546
  const { fileId, uploadUrl } = await conn2.requestFileUpload(params.taskId, {
495
547
  fileName,
496
548
  mimeType,
497
- fileSize: info.size
549
+ fileSize: info.size,
550
+ projectId: params.projectId
498
551
  });
499
552
  const body = await readFile(params.path);
500
553
  const res = await fetch(uploadUrl, {
@@ -512,7 +565,12 @@ function registerUploadAttachment(server2, conn2) {
512
565
  ]
513
566
  };
514
567
  }
515
- const result = await conn2.confirmFileUpload(params.taskId, fileId, params.comment);
568
+ const result = await conn2.confirmFileUpload(
569
+ params.taskId,
570
+ fileId,
571
+ params.comment,
572
+ params.projectId
573
+ );
516
574
  const lines = [
517
575
  `Uploaded ${result.fileName} (${info.size} bytes, ${mimeType}). File ID: ${result.fileId}`
518
576
  ];
@@ -529,17 +587,18 @@ function registerAttachmentTools(server2, conn2) {
529
587
  }
530
588
 
531
589
  // src/tools/pull-request.ts
532
- import { z as z4 } from "zod";
590
+ import { z as z5 } from "zod";
533
591
  function registerPullRequestTools(server2, conn2) {
534
592
  server2.tool(
535
593
  "create_pull_request",
536
- "Open a GitHub pull request for a task's existing branch (the branch must already be pushed to origin). Moves the task to ReviewPR. Returns the PR number and URL.",
594
+ "Open a GitHub pull request for a task's existing branch (the branch must already be pushed to origin). Pass projectId to target a specific project; otherwise the configured default project is used. Moves the task to ReviewPR. Returns the PR number and URL.",
537
595
  {
538
- taskId: z4.string().describe("The task ID whose branch should be opened as a PR"),
539
- title: z4.string().describe("Pull request title"),
540
- body: z4.string().describe("Pull request body (markdown)"),
541
- head: z4.string().optional().describe("Source branch for the PR (defaults to the task's branch)"),
542
- base: z4.string().optional().describe("Target branch for the PR (defaults to the repo default)")
596
+ projectId: z5.string().optional().describe("Target Conveyor project ID"),
597
+ taskId: z5.string().describe("The task ID whose branch should be opened as a PR"),
598
+ title: z5.string().describe("Pull request title"),
599
+ body: z5.string().describe("Pull request body (markdown)"),
600
+ head: z5.string().optional().describe("Source branch for the PR (defaults to the task's branch)"),
601
+ base: z5.string().optional().describe("Target branch for the PR (defaults to the repo default)")
543
602
  },
544
603
  async (params) => {
545
604
  const result = await conn2.createPullRequest(params);
@@ -551,7 +610,7 @@ function registerPullRequestTools(server2, conn2) {
551
610
  }
552
611
 
553
612
  // src/tools/subtasks.ts
554
- import { z as z5 } from "zod";
613
+ import { z as z6 } from "zod";
555
614
  var STATUS_ENUM2 = [
556
615
  "Planning",
557
616
  "Open",
@@ -566,14 +625,15 @@ var SP_DESCRIPTION = "Story point value (1=Common, 2=Magic, 3=Rare, 5=Unique)";
566
625
  function registerCreateSubtask(server2, conn2) {
567
626
  server2.tool(
568
627
  "create_subtask",
569
- "Create a subtask under a parent task. Subtasks break a larger task into independently buildable pieces.",
628
+ "Create a subtask under a parent task. Pass projectId to target a specific project; otherwise the configured default project is used. Subtasks break a larger task into independently buildable pieces.",
570
629
  {
571
- parentTaskId: z5.string().describe("The parent task ID"),
572
- title: z5.string().describe("Subtask title"),
573
- description: z5.string().optional().describe("Subtask description"),
574
- plan: z5.string().optional().describe("Subtask implementation plan (markdown)"),
575
- ordinal: z5.number().optional().describe("Ordering position among siblings"),
576
- storyPointValue: z5.number().optional().describe(SP_DESCRIPTION)
630
+ projectId: z6.string().optional().describe("Target Conveyor project ID"),
631
+ parentTaskId: z6.string().describe("The parent task ID"),
632
+ title: z6.string().describe("Subtask title"),
633
+ description: z6.string().optional().describe("Subtask description"),
634
+ plan: z6.string().optional().describe("Subtask implementation plan (markdown)"),
635
+ ordinal: z6.number().optional().describe("Ordering position among siblings"),
636
+ storyPointValue: z6.number().optional().describe(SP_DESCRIPTION)
577
637
  },
578
638
  async (params) => {
579
639
  const subtask = await conn2.createSubtask(params);
@@ -586,15 +646,16 @@ function registerCreateSubtask(server2, conn2) {
586
646
  function registerUpdateSubtask(server2, conn2) {
587
647
  server2.tool(
588
648
  "update_subtask",
589
- "Update a subtask's fields: title, description, plan, status, ordering, or story points. Moving a subtask beyond Planning auto-fills missing story points and agent assignment \u2014 don't spend turns on them.",
649
+ "Update a subtask's fields: title, description, plan, status, ordering, or story points. Pass projectId to target a specific project; otherwise the configured default project is used. Moving a subtask beyond Planning auto-fills missing story points and agent assignment \u2014 don't spend turns on them.",
590
650
  {
591
- subtaskId: z5.string().describe("The subtask ID"),
592
- title: z5.string().optional().describe("New title"),
593
- description: z5.string().optional().describe("New description"),
594
- plan: z5.string().optional().describe("New plan (markdown)"),
595
- status: z5.enum(STATUS_ENUM2).optional().describe("New status"),
596
- ordinal: z5.number().optional().describe("New ordering position among siblings"),
597
- storyPointValue: z5.number().optional().describe(SP_DESCRIPTION)
651
+ projectId: z6.string().optional().describe("Target Conveyor project ID"),
652
+ subtaskId: z6.string().describe("The subtask ID"),
653
+ title: z6.string().optional().describe("New title"),
654
+ description: z6.string().optional().describe("New description"),
655
+ plan: z6.string().optional().describe("New plan (markdown)"),
656
+ status: z6.enum(STATUS_ENUM2).optional().describe("New status"),
657
+ ordinal: z6.number().optional().describe("New ordering position among siblings"),
658
+ storyPointValue: z6.number().optional().describe(SP_DESCRIPTION)
598
659
  },
599
660
  async (params) => {
600
661
  const result = await conn2.updateSubtask(params);
@@ -609,12 +670,13 @@ function registerUpdateSubtask(server2, conn2) {
609
670
  function registerListSubtasks(server2, conn2) {
610
671
  server2.tool(
611
672
  "list_subtasks",
612
- "List all subtasks of a parent task with their status and ordering.",
673
+ "List all subtasks of a parent task with their status and ordering. Pass projectId to target a specific project; otherwise the configured default project is used.",
613
674
  {
614
- taskId: z5.string().describe("The parent task ID")
675
+ projectId: z6.string().optional().describe("Target Conveyor project ID"),
676
+ taskId: z6.string().describe("The parent task ID")
615
677
  },
616
678
  async (params) => {
617
- const subtasks = await conn2.listSubtasks(params.taskId);
679
+ const subtasks = await conn2.listSubtasks(params.taskId, params.projectId);
618
680
  return { content: [{ type: "text", text: JSON.stringify(subtasks, null, 2) }] };
619
681
  }
620
682
  );
@@ -622,12 +684,13 @@ function registerListSubtasks(server2, conn2) {
622
684
  function registerDeleteSubtask(server2, conn2) {
623
685
  server2.tool(
624
686
  "delete_subtask",
625
- "Delete a subtask by ID. This is permanent \u2014 use update_subtask to set status to Cancelled if you only want to close it.",
687
+ "Delete a subtask by ID. Pass projectId to target a specific project; otherwise the configured default project is used. This is permanent \u2014 use update_subtask to set status to Cancelled if you only want to close it.",
626
688
  {
627
- subtaskId: z5.string().describe("The subtask ID to delete")
689
+ projectId: z6.string().optional().describe("Target Conveyor project ID"),
690
+ subtaskId: z6.string().describe("The subtask ID to delete")
628
691
  },
629
692
  async (params) => {
630
- const result = await conn2.deleteSubtask(params.subtaskId);
693
+ const result = await conn2.deleteSubtask(params.subtaskId, params.projectId);
631
694
  return {
632
695
  content: [
633
696
  { type: "text", text: result.deleted ? "Subtask deleted" : "Subtask not deleted" }
@@ -644,16 +707,17 @@ function registerSubtaskTools(server2, conn2) {
644
707
  }
645
708
 
646
709
  // src/tools/dependencies.ts
647
- import { z as z6 } from "zod";
710
+ import { z as z7 } from "zod";
648
711
  function registerGetDependencies(server2, conn2) {
649
712
  server2.tool(
650
713
  "get_dependencies",
651
- "Get a task's dependencies and their met/unmet status (met = merged to dev). Use to confirm blockers merged, or see why a task cannot start. For task state use get_task.",
714
+ "Get a task's dependencies and their met/unmet status (met = merged to dev). Pass projectId to target a specific project; otherwise the configured default project is used. Use to confirm blockers merged, or see why a task cannot start. For task state use get_task.",
652
715
  {
653
- taskId: z6.string().describe("The task ID")
716
+ projectId: z7.string().optional().describe("Target Conveyor project ID"),
717
+ taskId: z7.string().describe("The task ID")
654
718
  },
655
719
  async (params) => {
656
- const deps = await conn2.getDependencies(params.taskId);
720
+ const deps = await conn2.getDependencies(params.taskId, params.projectId);
657
721
  return { content: [{ type: "text", text: JSON.stringify(deps, null, 2) }] };
658
722
  }
659
723
  );
@@ -661,10 +725,11 @@ function registerGetDependencies(server2, conn2) {
661
725
  function registerAddDependency(server2, conn2) {
662
726
  server2.tool(
663
727
  "add_dependency",
664
- "Add a blocking dependency \u2014 this task cannot start until the named task is merged to dev.",
728
+ "Add a blocking dependency \u2014 this task cannot start until the named task is merged to dev. Pass projectId to target a specific project; otherwise the configured default project is used.",
665
729
  {
666
- taskId: z6.string().describe("The task ID that will be blocked"),
667
- dependsOnSlugOrId: z6.string().describe("Slug or ID of the task this one depends on")
730
+ projectId: z7.string().optional().describe("Target Conveyor project ID"),
731
+ taskId: z7.string().describe("The task ID that will be blocked"),
732
+ dependsOnSlugOrId: z7.string().describe("Slug or ID of the task this one depends on")
668
733
  },
669
734
  async (params) => {
670
735
  await conn2.addDependency(params);
@@ -675,10 +740,11 @@ function registerAddDependency(server2, conn2) {
675
740
  function registerRemoveDependency(server2, conn2) {
676
741
  server2.tool(
677
742
  "remove_dependency",
678
- "Remove a previously added dependency from a task. The task is no longer blocked by the named task. Returns: confirmation string.",
743
+ "Remove a previously added dependency from a task. Pass projectId to target a specific project; otherwise the configured default project is used. The task is no longer blocked by the named task. Returns: confirmation string.",
679
744
  {
680
- taskId: z6.string().describe("The task ID to unblock"),
681
- dependsOnSlugOrId: z6.string().describe("Slug or ID of the dependency to remove")
745
+ projectId: z7.string().optional().describe("Target Conveyor project ID"),
746
+ taskId: z7.string().describe("The task ID to unblock"),
747
+ dependsOnSlugOrId: z7.string().describe("Slug or ID of the dependency to remove")
682
748
  },
683
749
  async (params) => {
684
750
  await conn2.removeDependency(params);
@@ -693,15 +759,16 @@ function registerDependencyTools(server2, conn2) {
693
759
  }
694
760
 
695
761
  // src/tools/suggestions.ts
696
- import { z as z7 } from "zod";
762
+ import { z as z8 } from "zod";
697
763
  function registerSuggestionTools(server2, conn2) {
698
764
  server2.tool(
699
765
  "create_suggestion",
700
- "Suggest a feature, improvement, rule, or idea for the project. Duplicates are deduped and your upvote is recorded.",
766
+ "Suggest a feature, improvement, rule, or idea for the project. Pass projectId to target a specific project; otherwise the configured default project is used. Duplicates are deduped and your upvote is recorded.",
701
767
  {
702
- title: z7.string().describe("Suggestion title"),
703
- description: z7.string().optional().describe("Suggestion details (markdown)"),
704
- tagNames: z7.array(z7.string()).optional().describe('Tag names to categorize the suggestion (e.g., ["agent-runner"])')
768
+ projectId: z8.string().optional().describe("Target Conveyor project ID"),
769
+ title: z8.string().describe("Suggestion title"),
770
+ description: z8.string().optional().describe("Suggestion details (markdown)"),
771
+ tagNames: z8.array(z8.string()).optional().describe('Tag names to categorize the suggestion (e.g., ["agent-runner"])')
705
772
  },
706
773
  async (params) => {
707
774
  const result = await conn2.createSuggestion(params);
@@ -712,22 +779,29 @@ function registerSuggestionTools(server2, conn2) {
712
779
  }
713
780
 
714
781
  // src/tools/checklists.ts
715
- import { z as z8 } from "zod";
782
+ import { z as z9 } from "zod";
716
783
  function registerListManualTests(server2, conn2) {
717
784
  server2.tool(
718
785
  "list_manual_tests",
719
- "List the manual test checklist items for a task. Use to see what manual verification steps have already been recorded.",
786
+ "List the manual test checklist items for a task. Pass projectId to target a specific project; otherwise the configured default project is used. Use to see what manual verification steps have already been recorded.",
720
787
  {
721
- taskId: z8.string().describe("The task ID or slug (the value in a card URL, /cards/<slug>)")
788
+ projectId: z9.string().optional().describe("Target Conveyor project ID"),
789
+ taskId: z9.string().describe("The task ID or slug (the value in a card URL, /cards/<slug>)")
722
790
  },
723
791
  async (params) => {
724
- const items = await conn2.listManualTests(params.taskId);
792
+ const items = await conn2.listManualTests(params.taskId, params.projectId);
725
793
  if (items.length === 0) {
726
794
  return { content: [{ type: "text", text: "No manual tests recorded for this task." }] };
727
795
  }
728
- const lines = items.map((item, i) => {
796
+ const lines = items.flatMap((item, i) => {
729
797
  const checked = item.checked ? "[x]" : "[ ]";
730
- return `${i + 1}. ${checked} ${item.title}`;
798
+ const row = [`${i + 1}. ${checked} ${item.title}`];
799
+ for (const f of item.failures ?? []) {
800
+ const who = f.userName ?? "Someone";
801
+ const reason = f.reason ?? "(no message)";
802
+ row.push(` \u26A0 Failed (${who}): ${reason}`);
803
+ }
804
+ return row;
731
805
  });
732
806
  return { content: [{ type: "text", text: lines.join("\n") }] };
733
807
  }
@@ -736,26 +810,60 @@ function registerListManualTests(server2, conn2) {
736
810
  function registerSetManualTests(server2, conn2) {
737
811
  server2.tool(
738
812
  "set_manual_tests",
739
- "Add manual test steps to a task's checklist. Existing items with the same title are automatically skipped (deduplication). Use to record specific manual verification steps that reviewers should follow when testing the task's PR.",
813
+ "Add manual test steps to a task's checklist. Pass projectId to target a specific project; otherwise the configured default project is used. Existing items with the same title are automatically skipped (deduplication). Use to record specific manual verification steps that reviewers should follow when testing the task's PR.",
740
814
  {
741
- taskId: z8.string().describe("The task ID or slug"),
742
- items: z8.array(z8.object({ title: z8.string().min(1).describe("A concise, actionable test step") })).min(1).describe("List of manual test steps to add")
815
+ projectId: z9.string().optional().describe("Target Conveyor project ID"),
816
+ taskId: z9.string().describe("The task ID or slug"),
817
+ items: z9.array(z9.object({ title: z9.string().min(1).describe("A concise, actionable test step") })).min(1).describe("List of manual test steps to add")
743
818
  },
744
819
  async (params) => {
745
- const result = await conn2.setManualTests(params.taskId, params.items);
820
+ const result = await conn2.setManualTests(params.taskId, params.items, params.projectId);
746
821
  const parts = [`Created ${result.created} manual test item(s).`];
747
822
  if (result.skipped > 0) parts.push(`Skipped ${result.skipped} duplicate(s).`);
748
823
  return { content: [{ type: "text", text: parts.join(" ") }] };
749
824
  }
750
825
  );
751
826
  }
827
+ function registerEditManualTest(server2, conn2) {
828
+ server2.tool(
829
+ "edit_manual_test",
830
+ "Rename an existing manual test step on a task. Pass projectId to target a specific project; otherwise the configured default project is used. Identify the test by its current title (case-insensitive) and pass the new title to replace it.",
831
+ {
832
+ projectId: z9.string().optional().describe("Target Conveyor project ID"),
833
+ taskId: z9.string().describe("The task ID or slug"),
834
+ title: z9.string().min(1).describe("The current title of the manual test to edit"),
835
+ newTitle: z9.string().min(1).describe("The new title for the manual test")
836
+ },
837
+ async (params) => {
838
+ await conn2.editManualTest(params.taskId, params.title, params.newTitle, params.projectId);
839
+ return { content: [{ type: "text", text: `Updated manual test to "${params.newTitle}".` }] };
840
+ }
841
+ );
842
+ }
843
+ function registerRemoveManualTest(server2, conn2) {
844
+ server2.tool(
845
+ "remove_manual_test",
846
+ "Remove an existing manual test step from a task's checklist. Pass projectId to target a specific project; otherwise the configured default project is used. Identify the test by its title (case-insensitive).",
847
+ {
848
+ projectId: z9.string().optional().describe("Target Conveyor project ID"),
849
+ taskId: z9.string().describe("The task ID or slug"),
850
+ title: z9.string().min(1).describe("The title of the manual test to remove")
851
+ },
852
+ async (params) => {
853
+ await conn2.removeManualTest(params.taskId, params.title, params.projectId);
854
+ return { content: [{ type: "text", text: `Removed manual test "${params.title}".` }] };
855
+ }
856
+ );
857
+ }
752
858
  function registerChecklistTools(server2, conn2) {
753
859
  registerListManualTests(server2, conn2);
754
860
  registerSetManualTests(server2, conn2);
861
+ registerEditManualTest(server2, conn2);
862
+ registerRemoveManualTest(server2, conn2);
755
863
  }
756
864
 
757
865
  // src/tools/workspace.ts
758
- import { z as z9 } from "zod";
866
+ import { z as z10 } from "zod";
759
867
 
760
868
  // src/workspace-ssh-tunnel.ts
761
869
  import net from "net";
@@ -858,8 +966,8 @@ function registerAttachInfoTool(server2, conn2) {
858
966
  "workspace_attach_info",
859
967
  "Return SSH/SFTP attach metadata for a running task Claudespace, plus hosted preview URLs and configured preview ports. Optionally installs an OpenSSH public key for this attach session.",
860
968
  {
861
- taskId: z9.string().describe("The task ID"),
862
- sshPublicKey: z9.string().optional().describe("Optional OpenSSH public key to install into the workspace")
969
+ taskId: z10.string().describe("The task ID"),
970
+ sshPublicKey: z10.string().optional().describe("Optional OpenSSH public key to install into the workspace")
863
971
  },
864
972
  async ({ taskId, sshPublicKey }) => {
865
973
  const info = await conn2.getWorkspaceAttachInfo(taskId, sshPublicKey);
@@ -872,7 +980,7 @@ function registerPreviewUrlsTool(server2, conn2) {
872
980
  "workspace_preview_urls",
873
981
  "Return the hosted preview URLs and preview ports for a running task Claudespace. This mirrors the web UI preview link metadata.",
874
982
  {
875
- taskId: z9.string().describe("The task ID")
983
+ taskId: z10.string().describe("The task ID")
876
984
  },
877
985
  async ({ taskId }) => {
878
986
  const info = await conn2.getWorkspaceAttachInfo(taskId);
@@ -901,10 +1009,10 @@ function registerStartTunnelTool(server2, conn2, startTunnel) {
901
1009
  "workspace_start_tunnel",
902
1010
  "Start a local loopback tunnel through the MCP server to a running task Claudespace port. Use port 2222 for SSH/SFTP, or one of previewPorts for app access.",
903
1011
  {
904
- taskId: z9.string().describe("The task ID"),
905
- port: z9.number().optional().describe("Remote Claudespace port. Defaults to SSH port 2222."),
906
- preferredLocalPort: z9.number().optional().describe("Preferred local loopback port. If omitted, the OS chooses one."),
907
- sshPublicKey: z9.string().optional().describe("Optional OpenSSH public key to install before opening the tunnel")
1012
+ taskId: z10.string().describe("The task ID"),
1013
+ port: z10.number().optional().describe("Remote Claudespace port. Defaults to SSH port 2222."),
1014
+ preferredLocalPort: z10.number().optional().describe("Preferred local loopback port. If omitted, the OS chooses one."),
1015
+ sshPublicKey: z10.string().optional().describe("Optional OpenSSH public key to install before opening the tunnel")
908
1016
  },
909
1017
  async ({ taskId, port, preferredLocalPort, sshPublicKey }) => {
910
1018
  const info = await conn2.getWorkspaceAttachInfo(taskId, sshPublicKey);
@@ -954,7 +1062,7 @@ function registerStopTunnelTool(server2) {
954
1062
  "workspace_stop_tunnel",
955
1063
  "Stop a local workspace tunnel previously opened by workspace_start_tunnel.",
956
1064
  {
957
- tunnelId: z9.string().describe("Tunnel id returned by workspace_start_tunnel")
1065
+ tunnelId: z10.string().describe("Tunnel id returned by workspace_start_tunnel")
958
1066
  },
959
1067
  async ({ tunnelId }) => {
960
1068
  const tunnel = activeTunnels.get(tunnelId);
@@ -989,11 +1097,11 @@ function registerAllTools(server2, conn2) {
989
1097
  // src/cli.ts
990
1098
  var { version } = createRequire(import.meta.url)("../package.json");
991
1099
  var apiUrl = process.env.CONVEYOR_API_URL;
992
- var projectToken = process.env.CONVEYOR_PROJECT_TOKEN;
1100
+ var projectToken = process.env.CONVEYOR_USER_TOKEN ?? process.env.CONVEYOR_PROJECT_TOKEN;
993
1101
  var projectId = process.env.CONVEYOR_PROJECT_ID;
994
- if (!apiUrl || !projectToken || !projectId) {
1102
+ if (!apiUrl || !projectToken) {
995
1103
  process.stderr.write(
996
- "Error: CONVEYOR_API_URL, CONVEYOR_PROJECT_TOKEN, and CONVEYOR_PROJECT_ID environment variables are required.\n"
1104
+ "Error: CONVEYOR_API_URL and CONVEYOR_USER_TOKEN or CONVEYOR_PROJECT_TOKEN environment variables are required. CONVEYOR_PROJECT_ID is optional and sets the default project.\n"
997
1105
  );
998
1106
  process.exit(1);
999
1107
  }