@rallycry/conveyor-agent 7.0.12 → 7.0.14

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.
@@ -484,7 +484,7 @@ var ModeController = class {
484
484
  }
485
485
  get isReadOnly() {
486
486
  const m = this.effectiveMode;
487
- if (["discovery", "code-review", "help"].includes(m)) return true;
487
+ if (["discovery", "help"].includes(m)) return true;
488
488
  return m === "auto" && !this._hasExitedPlanMode;
489
489
  }
490
490
  get isAutoPlanning() {
@@ -492,13 +492,13 @@ var ModeController = class {
492
492
  }
493
493
  get isBuildCapable() {
494
494
  const m = this.effectiveMode;
495
- return m === "building" || m === "auto" && this._hasExitedPlanMode;
495
+ return m === "building" || m === "review" || m === "auto" && this._hasExitedPlanMode;
496
496
  }
497
497
  // ── Mode resolution ────────────────────────────────────────────────
498
498
  /** Resolve the initial mode based on task context */
499
499
  resolveInitialMode(context) {
500
500
  if (this._runnerMode === "code-review") {
501
- this._mode = "code-review";
501
+ this._mode = "review";
502
502
  return this._mode;
503
503
  }
504
504
  if (this._mode === "auto" && this.canBypassPlanning(context)) {
@@ -517,8 +517,12 @@ var ModeController = class {
517
517
  // ── Mode transitions ───────────────────────────────────────────────
518
518
  /** Handle mode change from server */
519
519
  handleModeChange(newMode) {
520
- if (this._runnerMode !== "pm") return { type: "noop" };
521
520
  if (newMode === this._mode) return { type: "noop" };
521
+ if (this._runnerMode === "task" && newMode === "review") {
522
+ this._mode = newMode;
523
+ return { type: "restart_query", newMode: "review" };
524
+ }
525
+ if (this._runnerMode !== "pm") return { type: "noop" };
522
526
  this._mode = newMode;
523
527
  this.updateExitedPlanModeFlag(newMode);
524
528
  if (this.isBuildCapable) {
@@ -903,6 +907,8 @@ var PlanSync = class {
903
907
 
904
908
  // ../shared/dist/index.js
905
909
  import { z } from "zod";
910
+ import { z as z2 } from "zod";
911
+ import { z as z3 } from "zod";
906
912
  var MAX_FILE_SIZE_BYTES = 25 * 1024 * 1024;
907
913
  var EMBED_THRESHOLD_IMAGES = 5 * 1024 * 1024;
908
914
  var EMBED_THRESHOLD_TEXT = 2 * 1024 * 1024;
@@ -1121,157 +1127,6 @@ var UpdateChildStatusRequestSchema = z.object({
1121
1127
  childTaskId: z.string(),
1122
1128
  status: z.string()
1123
1129
  });
1124
- var RegisterProjectAgentRequestSchema = z.object({
1125
- projectId: z.string(),
1126
- capabilities: z.array(z.string())
1127
- });
1128
- var ProjectRunnerHeartbeatRequestSchema = z.object({
1129
- projectId: z.string()
1130
- });
1131
- var ReportProjectAgentStatusRequestSchema = z.object({
1132
- projectId: z.string(),
1133
- status: z.enum(["busy", "idle"]),
1134
- activeChatId: z.string().nullish(),
1135
- activeTaskId: z.string().nullish(),
1136
- activeBranch: z.string().nullish()
1137
- });
1138
- var DisconnectProjectRunnerRequestSchema = z.object({
1139
- projectId: z.string()
1140
- });
1141
- var GetProjectAgentContextRequestSchema = z.object({
1142
- projectId: z.string()
1143
- });
1144
- var GetProjectChatHistoryRequestSchema = z.object({
1145
- projectId: z.string(),
1146
- limit: z.number().int().positive().optional().default(50),
1147
- chatId: z.string().optional()
1148
- });
1149
- var PostProjectAgentMessageRequestSchema = z.object({
1150
- projectId: z.string(),
1151
- content: z.string().min(1),
1152
- chatId: z.string().optional()
1153
- });
1154
- var ListProjectTasksRequestSchema = z.object({
1155
- projectId: z.string(),
1156
- status: z.string().optional(),
1157
- assigneeId: z.string().optional(),
1158
- limit: z.number().int().positive().optional().default(50)
1159
- });
1160
- var GetProjectTaskRequestSchema = z.object({
1161
- projectId: z.string(),
1162
- taskId: z.string()
1163
- });
1164
- var SearchProjectTasksRequestSchema = z.object({
1165
- projectId: z.string(),
1166
- tagNames: z.array(z.string()).optional(),
1167
- searchQuery: z.string().optional(),
1168
- statusFilters: z.array(z.string()).optional(),
1169
- limit: z.number().int().positive().optional().default(20)
1170
- });
1171
- var ListProjectTagsRequestSchema = z.object({
1172
- projectId: z.string()
1173
- });
1174
- var GetProjectSummaryRequestSchema = z.object({
1175
- projectId: z.string()
1176
- });
1177
- var CreateProjectTaskRequestSchema = z.object({
1178
- projectId: z.string(),
1179
- title: z.string().min(1),
1180
- description: z.string().optional(),
1181
- plan: z.string().optional(),
1182
- status: z.string().optional(),
1183
- isBug: z.boolean().optional()
1184
- });
1185
- var UpdateProjectTaskRequestSchema = z.object({
1186
- projectId: z.string(),
1187
- taskId: z.string(),
1188
- title: z.string().optional(),
1189
- description: z.string().optional(),
1190
- plan: z.string().optional(),
1191
- status: z.string().optional(),
1192
- assignedUserId: z.string().nullish()
1193
- });
1194
- var ReportProjectAgentEventRequestSchema = z.object({
1195
- projectId: z.string(),
1196
- event: z.record(z.string(), z.unknown())
1197
- });
1198
- var ReportTagAuditProgressRequestSchema = z.object({
1199
- projectId: z.string(),
1200
- requestId: z.string(),
1201
- activity: z.object({
1202
- tool: z.string(),
1203
- input: z.string().optional(),
1204
- timestamp: z.string()
1205
- })
1206
- });
1207
- var ReportTagAuditResultRequestSchema = z.object({
1208
- projectId: z.string(),
1209
- requestId: z.string(),
1210
- recommendations: z.array(z.record(z.string(), z.unknown())),
1211
- summary: z.string(),
1212
- complete: z.boolean()
1213
- });
1214
- var ReportNewCommitsDetectedRequestSchema = z.object({
1215
- projectId: z.string(),
1216
- commits: z.array(
1217
- z.object({
1218
- sha: z.string(),
1219
- message: z.string(),
1220
- author: z.string()
1221
- })
1222
- ),
1223
- branch: z.string()
1224
- });
1225
- var ReportEnvironmentReadyRequestSchema = z.object({
1226
- projectId: z.string(),
1227
- branch: z.string(),
1228
- setupComplete: z.boolean(),
1229
- startCommandRunning: z.boolean()
1230
- });
1231
- var ReportEnvSwitchProgressRequestSchema = z.object({
1232
- projectId: z.string(),
1233
- step: z.string(),
1234
- progress: z.number(),
1235
- message: z.string().optional()
1236
- });
1237
- var ForwardProjectChatMessageRequestSchema = z.object({
1238
- projectId: z.string(),
1239
- chatId: z.string(),
1240
- content: z.string().min(1),
1241
- targetUserId: z.string().optional()
1242
- });
1243
- var CancelQueuedProjectMessageRequestSchema = z.object({
1244
- projectId: z.string(),
1245
- index: z.number().int().nonnegative()
1246
- });
1247
- var GetProjectCliHistoryRequestSchema = z.object({
1248
- projectId: z.string(),
1249
- limit: z.number().int().positive().optional().default(50),
1250
- source: z.string().optional()
1251
- });
1252
- var PostToProjectTaskChatRequestSchema = z.object({
1253
- projectId: z.string(),
1254
- taskId: z.string(),
1255
- content: z.string()
1256
- });
1257
- var GetProjectTaskCliRequestSchema = z.object({
1258
- projectId: z.string(),
1259
- taskId: z.string(),
1260
- limit: z.number().int().positive().optional().default(50),
1261
- source: z.string().optional()
1262
- });
1263
- var StartProjectBuildRequestSchema = z.object({
1264
- projectId: z.string(),
1265
- taskId: z.string()
1266
- });
1267
- var StopProjectBuildRequestSchema = z.object({
1268
- projectId: z.string(),
1269
- taskId: z.string()
1270
- });
1271
- var ApproveProjectMergePRRequestSchema = z.object({
1272
- projectId: z.string(),
1273
- childTaskId: z.string()
1274
- });
1275
1130
  var GetAgentStatusRequestSchema = z.object({
1276
1131
  taskId: z.string()
1277
1132
  });
@@ -1367,7 +1222,200 @@ var RegisterProjectAgentResponseSchema = z.object({
1367
1222
  agentSettings: z.record(z.string(), z.unknown()).nullable(),
1368
1223
  branchSwitchCommand: z.string().nullable()
1369
1224
  });
1370
- var CRITICAL_AUTOMATED_SOURCES = /* @__PURE__ */ new Set(["ci_failure"]);
1225
+ var RegisterProjectAgentRequestSchema = z2.object({
1226
+ projectId: z2.string(),
1227
+ capabilities: z2.array(z2.string())
1228
+ });
1229
+ var ProjectRunnerHeartbeatRequestSchema = z2.object({
1230
+ projectId: z2.string()
1231
+ });
1232
+ var ReportProjectAgentStatusRequestSchema = z2.object({
1233
+ projectId: z2.string(),
1234
+ status: z2.enum(["busy", "idle"]),
1235
+ activeChatId: z2.string().nullish(),
1236
+ activeTaskId: z2.string().nullish(),
1237
+ activeBranch: z2.string().nullish()
1238
+ });
1239
+ var DisconnectProjectRunnerRequestSchema = z2.object({
1240
+ projectId: z2.string()
1241
+ });
1242
+ var GetProjectAgentContextRequestSchema = z2.object({
1243
+ projectId: z2.string()
1244
+ });
1245
+ var GetProjectChatHistoryRequestSchema = z2.object({
1246
+ projectId: z2.string(),
1247
+ limit: z2.number().int().positive().optional().default(50),
1248
+ chatId: z2.string().optional()
1249
+ });
1250
+ var PostProjectAgentMessageRequestSchema = z2.object({
1251
+ projectId: z2.string(),
1252
+ content: z2.string().min(1),
1253
+ chatId: z2.string().optional()
1254
+ });
1255
+ var ListProjectTasksRequestSchema = z2.object({
1256
+ projectId: z2.string(),
1257
+ status: z2.string().optional(),
1258
+ assigneeId: z2.string().optional(),
1259
+ limit: z2.number().int().positive().optional().default(50)
1260
+ });
1261
+ var GetProjectTaskRequestSchema = z2.object({
1262
+ projectId: z2.string(),
1263
+ taskId: z2.string()
1264
+ });
1265
+ var SearchProjectTasksRequestSchema = z2.object({
1266
+ projectId: z2.string(),
1267
+ tagNames: z2.array(z2.string()).optional(),
1268
+ searchQuery: z2.string().optional(),
1269
+ statusFilters: z2.array(z2.string()).optional(),
1270
+ limit: z2.number().int().positive().optional().default(20)
1271
+ });
1272
+ var ListProjectTagsRequestSchema = z2.object({
1273
+ projectId: z2.string()
1274
+ });
1275
+ var GetProjectSummaryRequestSchema = z2.object({
1276
+ projectId: z2.string()
1277
+ });
1278
+ var CreateProjectTaskRequestSchema = z2.object({
1279
+ projectId: z2.string(),
1280
+ title: z2.string().min(1),
1281
+ description: z2.string().optional(),
1282
+ plan: z2.string().optional(),
1283
+ status: z2.string().optional(),
1284
+ isBug: z2.boolean().optional()
1285
+ });
1286
+ var UpdateProjectTaskRequestSchema = z2.object({
1287
+ projectId: z2.string(),
1288
+ taskId: z2.string(),
1289
+ title: z2.string().optional(),
1290
+ description: z2.string().optional(),
1291
+ plan: z2.string().optional(),
1292
+ status: z2.string().optional(),
1293
+ assignedUserId: z2.string().nullish()
1294
+ });
1295
+ var ReportProjectAgentEventRequestSchema = z2.object({
1296
+ projectId: z2.string(),
1297
+ event: z2.record(z2.string(), z2.unknown())
1298
+ });
1299
+ var ReportTagAuditProgressRequestSchema = z2.object({
1300
+ projectId: z2.string(),
1301
+ requestId: z2.string(),
1302
+ activity: z2.object({
1303
+ tool: z2.string(),
1304
+ input: z2.string().optional(),
1305
+ timestamp: z2.string()
1306
+ })
1307
+ });
1308
+ var ReportTagAuditResultRequestSchema = z2.object({
1309
+ projectId: z2.string(),
1310
+ requestId: z2.string(),
1311
+ recommendations: z2.array(z2.record(z2.string(), z2.unknown())),
1312
+ summary: z2.string(),
1313
+ complete: z2.boolean()
1314
+ });
1315
+ var ReportNewCommitsDetectedRequestSchema = z2.object({
1316
+ projectId: z2.string(),
1317
+ commits: z2.array(
1318
+ z2.object({
1319
+ sha: z2.string(),
1320
+ message: z2.string(),
1321
+ author: z2.string()
1322
+ })
1323
+ ),
1324
+ branch: z2.string()
1325
+ });
1326
+ var ReportEnvironmentReadyRequestSchema = z2.object({
1327
+ projectId: z2.string(),
1328
+ branch: z2.string(),
1329
+ setupComplete: z2.boolean(),
1330
+ startCommandRunning: z2.boolean()
1331
+ });
1332
+ var ReportEnvSwitchProgressRequestSchema = z2.object({
1333
+ projectId: z2.string(),
1334
+ step: z2.string(),
1335
+ progress: z2.number(),
1336
+ message: z2.string().optional()
1337
+ });
1338
+ var ForwardProjectChatMessageRequestSchema = z2.object({
1339
+ projectId: z2.string(),
1340
+ chatId: z2.string(),
1341
+ content: z2.string().min(1),
1342
+ targetUserId: z2.string().optional()
1343
+ });
1344
+ var CancelQueuedProjectMessageRequestSchema = z2.object({
1345
+ projectId: z2.string(),
1346
+ index: z2.number().int().nonnegative()
1347
+ });
1348
+ var GetProjectCliHistoryRequestSchema = z2.object({
1349
+ projectId: z2.string(),
1350
+ limit: z2.number().int().positive().optional().default(50),
1351
+ source: z2.string().optional()
1352
+ });
1353
+ var PostToProjectTaskChatRequestSchema = z2.object({
1354
+ projectId: z2.string(),
1355
+ taskId: z2.string(),
1356
+ content: z2.string()
1357
+ });
1358
+ var GetProjectTaskCliRequestSchema = z2.object({
1359
+ projectId: z2.string(),
1360
+ taskId: z2.string(),
1361
+ limit: z2.number().int().positive().optional().default(50),
1362
+ source: z2.string().optional()
1363
+ });
1364
+ var StartProjectBuildRequestSchema = z2.object({
1365
+ projectId: z2.string(),
1366
+ taskId: z2.string()
1367
+ });
1368
+ var StopProjectBuildRequestSchema = z2.object({
1369
+ projectId: z2.string(),
1370
+ taskId: z2.string()
1371
+ });
1372
+ var ApproveProjectMergePRRequestSchema = z2.object({
1373
+ projectId: z2.string(),
1374
+ childTaskId: z2.string()
1375
+ });
1376
+ var CRITICAL_AUTOMATED_SOURCES = /* @__PURE__ */ new Set(["ci_failure", "review_trigger"]);
1377
+ var StartTaskAuditRequestSchema = z3.object({
1378
+ projectId: z3.string(),
1379
+ taskIds: z3.array(z3.string()).min(1)
1380
+ });
1381
+ var ReportTaskAuditProgressRequestSchema = z3.object({
1382
+ projectId: z3.string(),
1383
+ requestId: z3.string(),
1384
+ taskId: z3.string(),
1385
+ activity: z3.string()
1386
+ });
1387
+ var ReportTaskAuditResultRequestSchema = z3.object({
1388
+ projectId: z3.string(),
1389
+ requestId: z3.string(),
1390
+ taskId: z3.string(),
1391
+ summary: z3.string(),
1392
+ turnGrades: z3.array(
1393
+ z3.object({
1394
+ turnIndex: z3.number(),
1395
+ phase: z3.enum(["planning", "building", "human"]),
1396
+ grade: z3.enum(["correct", "neutral", "blunder"]),
1397
+ reasoning: z3.string(),
1398
+ eventType: z3.string(),
1399
+ eventSummary: z3.string()
1400
+ })
1401
+ ),
1402
+ planningAccuracy: z3.number().nullable(),
1403
+ buildingAccuracy: z3.number().nullable(),
1404
+ humanAccuracy: z3.number().nullable(),
1405
+ planningCorrect: z3.number(),
1406
+ planningNeutral: z3.number(),
1407
+ planningBlunder: z3.number(),
1408
+ buildingCorrect: z3.number(),
1409
+ buildingNeutral: z3.number(),
1410
+ buildingBlunder: z3.number(),
1411
+ humanCorrect: z3.number(),
1412
+ humanNeutral: z3.number(),
1413
+ humanBlunder: z3.number(),
1414
+ suggestionIds: z3.array(z3.string()),
1415
+ auditCostUsd: z3.number().nullable(),
1416
+ model: z3.string().nullable(),
1417
+ error: z3.string().optional()
1418
+ });
1371
1419
 
1372
1420
  // src/execution/pack-runner-prompt.ts
1373
1421
  function findLastAgentMessageIndex(history) {
@@ -1859,8 +1907,6 @@ function buildModePrompt(agentMode, context) {
1859
1907
  return buildReviewPrompt(context);
1860
1908
  case "auto":
1861
1909
  return buildAutoPrompt(context);
1862
- case "code-review":
1863
- return buildCodeReviewPrompt();
1864
1910
  default:
1865
1911
  return null;
1866
1912
  }
@@ -1869,8 +1915,9 @@ function buildReviewPrompt(context) {
1869
1915
  const parts = [
1870
1916
  `
1871
1917
  ## Mode: Review`,
1872
- `You are in Review mode \u2014 reviewing and coordinating.`,
1873
- `- You have read-only access plus light edit capability (can suggest fixes, run tests, check linting)`,
1918
+ `You are in Review mode \u2014 performing code review with fix capability.`,
1919
+ `- You have full write access \u2014 you can audit code, make fixes, push changes, and run tests`,
1920
+ `- Safety rules: no destructive operations, use --force-with-lease instead of --force`,
1874
1921
  ``
1875
1922
  ];
1876
1923
  if (context?.isParentTask) {
@@ -1892,80 +1939,62 @@ function buildReviewPrompt(context) {
1892
1939
  );
1893
1940
  } else {
1894
1941
  parts.push(
1895
- `### Leaf Task Review`,
1896
- `You are reviewing your own work before completion.`,
1897
- `- Run tests and check linting to verify the PR is ready.`,
1898
- `- If the PR is already open, review the diff for correctness.`,
1899
- `- You can get hands dirty \u2014 if a fix is small, make it directly.`,
1900
- `- If follow-up work is needed, use \`create_follow_up_task\`.`
1942
+ `### Code Review Process`,
1943
+ `1. Run \`git diff <baseBranch>..HEAD\` to see all changes in this PR`,
1944
+ `2. Read the task plan to understand the intended changes`,
1945
+ `3. Explore the surrounding codebase to verify pattern consistency`,
1946
+ `4. Review against the criteria below`,
1947
+ ``,
1948
+ `### Review Criteria`,
1949
+ `- **Correctness**: Does the code do what the plan says? Logic errors, off-by-one, race conditions?`,
1950
+ `- **Pattern Consistency**: Does the code follow existing patterns in the codebase? Check nearby files.`,
1951
+ `- **Security**: No hardcoded secrets, no injection vulnerabilities, proper input validation at boundaries.`,
1952
+ `- **Performance**: No unnecessary loops, no N+1 queries, no blocking in async contexts.`,
1953
+ `- **Error Handling**: Appropriate error handling at system boundaries. No swallowed errors.`,
1954
+ `- **Test Coverage**: Are new code paths tested? Edge cases covered?`,
1955
+ `- **TypeScript Best Practices**: Proper typing (no unnecessary \`any\`), correct React patterns, proper async/await.`,
1956
+ `- **Naming & Readability**: Clear names, no misleading comments, self-documenting code.`,
1957
+ ``,
1958
+ `### Fix Capability`,
1959
+ `You have full write access. If you find issues:`,
1960
+ `- **Small fixes**: Make the fix directly, commit, and push. Then re-review.`,
1961
+ `- **Larger issues**: Use \`request_code_changes\` to flag them for the team.`,
1962
+ `- After pushing fixes, wait for CI to pass before approving.`,
1963
+ ``,
1964
+ `### Output \u2014 You MUST do exactly ONE of:`,
1965
+ ``,
1966
+ `#### If code passes review (or after you've fixed all issues):`,
1967
+ `Use the \`approve_code_review\` tool with a brief summary of what looks good.`,
1968
+ ``,
1969
+ `#### If changes are needed that you cannot fix:`,
1970
+ `Use the \`request_code_changes\` tool with specific issues:`,
1971
+ `- Reference specific files and line numbers`,
1972
+ `- Explain what's wrong and suggest fixes`,
1973
+ `- Focus on substantive issues, not style nitpicks (linting handles that)`,
1974
+ ``,
1975
+ `### Previous Review Feedback`,
1976
+ `If previous review feedback is present in the chat history, verify those specific issues were addressed before raising new concerns.`,
1977
+ ``,
1978
+ `### Rules`,
1979
+ `- Do NOT re-review things CI already validates (formatting, lint rules).`,
1980
+ `- Be concise \u2014 actionable specifics over general observations.`,
1981
+ `- Max 5-7 issues per review. Prioritize the most important ones.`
1901
1982
  );
1902
1983
  }
1903
- parts.push(
1904
- ``,
1905
- `### General Review Guidelines`,
1906
- `- For larger issues, create a follow-up task rather than fixing directly.`,
1907
- `- Focus on correctness, pattern consistency, and test coverage.`,
1908
- `- Be concise in feedback \u2014 actionable specifics over general observations.`,
1909
- `- Goal: ensure quality, provide feedback, coordinate progression.`
1910
- );
1911
1984
  if (process.env.CLAUDESPACE_NAME) {
1912
1985
  parts.push(
1913
1986
  ``,
1914
1987
  `### Resource Management`,
1915
- `Your pod starts with minimal resources (0.25 CPU / 1 Gi). You MUST call \`scale_up_resources\``,
1916
- `BEFORE running any of these operations \u2014 they WILL fail or OOM at baseline resources:`,
1917
- `- **light** (1 CPU / 4 Gi) \u2014 bun/npm/yarn install, pip install, basic dev servers, light builds`,
1918
- `- **standard** (2 CPU / 8 Gi) \u2014 full dev servers, test suites, typecheck, lint`,
1919
- `- **heavy** (4 CPU / 16 Gi) \u2014 E2E/browser automation, large parallel builds`,
1988
+ `Your pod starts with minimal resources. You MUST call \`scale_up_resources\``,
1989
+ `BEFORE running any resource-intensive operations \u2014 they WILL fail or OOM at baseline resources:`,
1990
+ `- **setup** \u2014 package installs, basic dev servers, light builds`,
1991
+ `- **build** \u2014 full dev servers, test suites, typecheck, lint, E2E tests`,
1920
1992
  `Scaling is one-way (up only) and capped by project limits.`,
1921
- `CRITICAL: Always scale to at least "light" before running any package install command.`
1993
+ `CRITICAL: Always scale to at least "setup" before running any package install command.`
1922
1994
  );
1923
1995
  }
1924
1996
  return parts.join("\n");
1925
1997
  }
1926
- function buildCodeReviewPrompt() {
1927
- return [
1928
- `
1929
- ## Mode: Code Review`,
1930
- `You are an automated code reviewer. A PR has passed all CI checks and you are performing a final code quality review before merge.`,
1931
- ``,
1932
- `## Review Process`,
1933
- `1. Run \`git diff <devBranch>..HEAD\` to see all changes in this PR`,
1934
- `2. Read the task plan to understand the intended changes`,
1935
- `3. Explore the surrounding codebase to verify pattern consistency`,
1936
- `4. Review against the criteria below`,
1937
- ``,
1938
- `### Review Criteria`,
1939
- `- **Correctness**: Does the code do what the plan says? Logic errors, off-by-one, race conditions?`,
1940
- `- **Pattern Consistency**: Does the code follow existing patterns in the codebase? Check nearby files.`,
1941
- `- **Security**: No hardcoded secrets, no injection vulnerabilities, proper input validation at boundaries.`,
1942
- `- **Performance**: No unnecessary loops, no N+1 queries, no blocking in async contexts.`,
1943
- `- **Error Handling**: Appropriate error handling at system boundaries. No swallowed errors.`,
1944
- `- **Test Coverage**: Are new code paths tested? Edge cases covered?`,
1945
- `- **TypeScript Best Practices**: Proper typing (no unnecessary \`any\`), correct React patterns, proper async/await.`,
1946
- `- **Naming & Readability**: Clear names, no misleading comments, self-documenting code.`,
1947
- ``,
1948
- `## Output \u2014 You MUST do exactly ONE of:`,
1949
- ``,
1950
- `### If code passes review:`,
1951
- `Use the \`approve_code_review\` tool with a brief summary of what looks good.`,
1952
- ``,
1953
- `### If changes are needed:`,
1954
- `Use the \`request_code_changes\` tool with specific issues:`,
1955
- `- Reference specific files and line numbers`,
1956
- `- Explain what's wrong and suggest fixes`,
1957
- `- Focus on substantive issues, not style nitpicks (linting handles that)`,
1958
- ``,
1959
- `## Previous Review Feedback`,
1960
- `If previous review feedback is present in the chat history, verify those specific issues were addressed before raising new concerns. Focus on whether the requested changes were implemented correctly.`,
1961
- ``,
1962
- `## Rules`,
1963
- `- You are READ-ONLY. Do NOT modify any files.`,
1964
- `- Do NOT re-review things CI already validates (formatting, lint rules).`,
1965
- `- Be concise \u2014 the task agent needs actionable feedback, not essays.`,
1966
- `- Max 5-7 issues per review. Prioritize the most important ones.`
1967
- ].join("\n");
1968
- }
1969
1998
 
1970
1999
  // src/execution/system-prompt.ts
1971
2000
  function formatProjectAgentLine(pa) {
@@ -2392,18 +2421,6 @@ ${context.plan}`);
2392
2421
  }
2393
2422
  return parts;
2394
2423
  }
2395
- function buildCodeReviewInstructions(context) {
2396
- const parts = [
2397
- `You are performing an automated code review for this task.`,
2398
- `The PR branch is "${context.githubBranch}"${context.baseBranch ? ` based on "${context.baseBranch}"` : ""}.`,
2399
- `Begin your code review by running \`git diff ${context.baseBranch ?? "dev"}..HEAD\` to see all changes.`,
2400
- ``,
2401
- `CRITICAL: You are in Code Review mode. You are READ-ONLY \u2014 do NOT modify any files.`,
2402
- `After reviewing, you MUST call exactly one of: \`approve_code_review\` or \`request_code_changes\`.`,
2403
- `Do NOT go idle, ask for confirmation, or wait for instructions \u2014 complete the review and exit.`
2404
- ];
2405
- return parts;
2406
- }
2407
2424
  function buildFreshInstructions(isPm, isAutoMode, context, agentMode) {
2408
2425
  if (isPm && agentMode === "building") {
2409
2426
  return [
@@ -2554,10 +2571,6 @@ function buildIdleRelaunchInstructions(context, isPm, agentMode, isAuto) {
2554
2571
  function buildInstructions(mode, context, scenario, agentMode, isAuto) {
2555
2572
  const parts = [`
2556
2573
  ## Instructions`];
2557
- if (agentMode === "code-review") {
2558
- parts.push(...buildCodeReviewInstructions(context));
2559
- return parts;
2560
- }
2561
2574
  const isPm = mode === "pm";
2562
2575
  if (scenario === "fresh") {
2563
2576
  parts.push(...buildFreshInstructions(isPm, agentMode === "auto", context, agentMode));
@@ -2572,7 +2585,7 @@ function buildInstructions(mode, context, scenario, agentMode, isAuto) {
2572
2585
  }
2573
2586
  async function buildInitialPrompt(mode, context, isAuto, agentMode) {
2574
2587
  const isPackRunner = mode === "pm" && !!isAuto && !!context.isParentTask;
2575
- if (!isPackRunner && agentMode !== "code-review") {
2588
+ if (!isPackRunner) {
2576
2589
  const sessionRelaunch = buildRelaunchWithSession(mode, context, agentMode, isAuto);
2577
2590
  if (sessionRelaunch) return sessionRelaunch;
2578
2591
  }
@@ -2587,7 +2600,7 @@ async function buildInitialPrompt(mode, context, isAuto, agentMode) {
2587
2600
  }
2588
2601
 
2589
2602
  // src/tools/common-tools.ts
2590
- import { z as z2 } from "zod";
2603
+ import { z as z4 } from "zod";
2591
2604
 
2592
2605
  // src/tools/helpers.ts
2593
2606
  function textResult(text) {
@@ -2621,8 +2634,8 @@ function buildReadTaskChatTool(connection) {
2621
2634
  "read_task_chat",
2622
2635
  "Read recent messages from a task chat. Omit task_id to read the current task's chat, or provide a child task ID to read a child's chat.",
2623
2636
  {
2624
- limit: z2.number().optional().describe("Number of recent messages to fetch (default 20)"),
2625
- task_id: z2.string().optional().describe("Child task ID to read chat from. Omit to read the current task's chat.")
2637
+ limit: z4.number().optional().describe("Number of recent messages to fetch (default 20)"),
2638
+ task_id: z4.string().optional().describe("Child task ID to read chat from. Omit to read the current task's chat.")
2626
2639
  },
2627
2640
  async ({ limit, task_id }) => {
2628
2641
  try {
@@ -2666,7 +2679,7 @@ function buildGetTaskTool(connection) {
2666
2679
  "get_task",
2667
2680
  "Look up a task by slug or ID to get its title, description, plan, and status",
2668
2681
  {
2669
- slug_or_id: z2.string().describe("The task slug (e.g. 'my-task') or CUID")
2682
+ slug_or_id: z4.string().describe("The task slug (e.g. 'my-task') or CUID")
2670
2683
  },
2671
2684
  async ({ slug_or_id }) => {
2672
2685
  try {
@@ -2689,9 +2702,9 @@ function buildGetTaskCliTool(connection) {
2689
2702
  "get_task_cli",
2690
2703
  "Read CLI execution logs from a task. Returns agent reasoning, tool calls, setup output, and other execution events. Use 'source' to filter: 'agent' for agent reasoning/tool calls only, 'application' for setup/dev-server output only.",
2691
2704
  {
2692
- task_id: z2.string().optional().describe("Task ID or slug. Omit to read logs from the current task."),
2693
- source: z2.enum(["agent", "application"]).optional().describe("Filter by log source. Omit for all logs."),
2694
- limit: z2.number().optional().describe("Max number of log entries to return (default 50, max 500).")
2705
+ task_id: z4.string().optional().describe("Task ID or slug. Omit to read logs from the current task."),
2706
+ source: z4.enum(["agent", "application"]).optional().describe("Filter by log source. Omit for all logs."),
2707
+ limit: z4.number().optional().describe("Max number of log entries to return (default 50, max 500).")
2695
2708
  },
2696
2709
  async ({ task_id, source, limit }) => {
2697
2710
  try {
@@ -2751,7 +2764,7 @@ function buildGetTaskFileTool(connection) {
2751
2764
  return defineTool(
2752
2765
  "get_task_file",
2753
2766
  "Get a specific task file's content and download URL by file ID",
2754
- { fileId: z2.string().describe("The file ID to retrieve") },
2767
+ { fileId: z4.string().describe("The file ID to retrieve") },
2755
2768
  async ({ fileId }) => {
2756
2769
  try {
2757
2770
  const file = await connection.call("getTaskFile", {
@@ -2782,8 +2795,8 @@ function buildSearchIncidentsTool(connection) {
2782
2795
  "search_incidents",
2783
2796
  "Search incidents in the current project. Optionally filter by status (Open, Acknowledged, Investigating, Resolved, Closed) or source.",
2784
2797
  {
2785
- status: z2.string().optional().describe("Filter by incident status"),
2786
- source: z2.string().optional().describe("Filter by source (e.g., 'conveyor', 'agent', 'build')")
2798
+ status: z4.string().optional().describe("Filter by incident status"),
2799
+ source: z4.string().optional().describe("Filter by source (e.g., 'conveyor', 'agent', 'build')")
2787
2800
  },
2788
2801
  async ({ status, source }) => {
2789
2802
  try {
@@ -2807,7 +2820,7 @@ function buildGetTaskIncidentsTool(connection) {
2807
2820
  "get_task_incidents",
2808
2821
  "Get all incidents linked to the current task (or a specified task). Returns full incident details including title, description, severity, status, and source.",
2809
2822
  {
2810
- task_id: z2.string().optional().describe("Task ID (defaults to current task)")
2823
+ task_id: z4.string().optional().describe("Task ID (defaults to current task)")
2811
2824
  },
2812
2825
  async ({ task_id }) => {
2813
2826
  try {
@@ -2830,12 +2843,12 @@ function buildQueryGcpLogsTool(connection) {
2830
2843
  "query_gcp_logs",
2831
2844
  "Query GCP Cloud Logging for the current project. Returns log entries matching the given filters. Use severity to filter by minimum log level. The project's GCP credentials are used automatically.",
2832
2845
  {
2833
- filter: z2.string().optional().describe(
2846
+ filter: z4.string().optional().describe(
2834
2847
  `Cloud Logging filter expression (e.g., 'resource.type="gce_instance"'). Max 1000 chars.`
2835
2848
  ),
2836
- start_time: z2.string().optional().describe("Start time in ISO 8601 format (e.g., '2024-01-01T00:00:00Z')"),
2837
- end_time: z2.string().optional().describe("End time in ISO 8601 format (e.g., '2024-01-02T00:00:00Z')"),
2838
- severity: z2.enum([
2849
+ start_time: z4.string().optional().describe("Start time in ISO 8601 format (e.g., '2024-01-01T00:00:00Z')"),
2850
+ end_time: z4.string().optional().describe("End time in ISO 8601 format (e.g., '2024-01-02T00:00:00Z')"),
2851
+ severity: z4.enum([
2839
2852
  "DEFAULT",
2840
2853
  "DEBUG",
2841
2854
  "INFO",
@@ -2846,7 +2859,7 @@ function buildQueryGcpLogsTool(connection) {
2846
2859
  "ALERT",
2847
2860
  "EMERGENCY"
2848
2861
  ]).optional().describe("Minimum severity level to filter by (default: all levels)"),
2849
- page_size: z2.number().optional().describe("Number of log entries to return (default 100, max 500)")
2862
+ page_size: z4.number().optional().describe("Number of log entries to return (default 100, max 500)")
2850
2863
  },
2851
2864
  async ({ filter, start_time, end_time, severity, page_size }) => {
2852
2865
  try {
@@ -2900,8 +2913,8 @@ function buildGetSuggestionsTool(connection) {
2900
2913
  "get_suggestions",
2901
2914
  "List project suggestions sorted by vote score. Use this to see what the team thinks is important.",
2902
2915
  {
2903
- status: z2.string().optional().describe("Filter by status: Open, Accepted, Rejected, Implemented"),
2904
- limit: z2.number().optional().describe("Max results (default 20)")
2916
+ status: z4.string().optional().describe("Filter by status: Open, Accepted, Rejected, Implemented"),
2917
+ limit: z4.number().optional().describe("Max results (default 20)")
2905
2918
  },
2906
2919
  async ({ status: _status, limit: _limit }) => {
2907
2920
  try {
@@ -2926,8 +2939,8 @@ function buildPostToChatTool(connection) {
2926
2939
  "post_to_chat",
2927
2940
  "Post a message to a task chat. Your normal replies already appear in chat \u2014 only use this for explicit out-of-band updates or posting to a child task's chat.",
2928
2941
  {
2929
- message: z2.string().describe("The message to post to the team"),
2930
- task_id: z2.string().optional().describe("Child task ID to post to. Omit to post to the current task's chat.")
2942
+ message: z4.string().describe("The message to post to the team"),
2943
+ task_id: z4.string().optional().describe("Child task ID to post to. Omit to post to the current task's chat.")
2931
2944
  },
2932
2945
  async ({ message, task_id }) => {
2933
2946
  try {
@@ -2954,8 +2967,8 @@ function buildForceUpdateTaskStatusTool(connection) {
2954
2967
  "force_update_task_status",
2955
2968
  "EMERGENCY ONLY: Force-override a task's Kanban status. Status transitions happen automatically (building sets InProgress, PR creation sets ReviewPR, merge sets ReviewDev). Only use this if an automatic transition failed or a task is stuck in the wrong status. Omit task_id to update the current task, or provide a child task ID.",
2956
2969
  {
2957
- status: z2.enum(["InProgress", "ReviewPR", "ReviewDev", "Complete"]).describe("The new status for the task"),
2958
- task_id: z2.string().optional().describe("Child task ID to update. Omit to update the current task.")
2970
+ status: z4.enum(["InProgress", "ReviewPR", "ReviewDev", "Complete"]).describe("The new status for the task"),
2971
+ task_id: z4.string().optional().describe("Child task ID to update. Omit to update the current task.")
2959
2972
  },
2960
2973
  async ({ status, task_id }) => {
2961
2974
  try {
@@ -2986,15 +2999,15 @@ function buildCreatePullRequestTool(connection, config) {
2986
2999
  "create_pull_request",
2987
3000
  "Create a GitHub pull request for this task. Automatically stages uncommitted changes, commits them, and pushes before creating the PR. Use this instead of gh CLI or git commands to create PRs.",
2988
3001
  {
2989
- title: z2.string().describe("The PR title"),
2990
- body: z2.string().describe("The PR description/body in markdown"),
2991
- branch: z2.string().optional().describe(
3002
+ title: z4.string().describe("The PR title"),
3003
+ body: z4.string().describe("The PR description/body in markdown"),
3004
+ branch: z4.string().optional().describe(
2992
3005
  "The head branch name for the PR. If the task doesn't have a branch set, this will be used. Defaults to the task's existing branch."
2993
3006
  ),
2994
- baseBranch: z2.string().optional().describe(
3007
+ baseBranch: z4.string().optional().describe(
2995
3008
  "The base branch to target for the PR (e.g. 'main', 'develop'). Defaults to the project's configured dev branch."
2996
3009
  ),
2997
- commitMessage: z2.string().optional().describe(
3010
+ commitMessage: z4.string().optional().describe(
2998
3011
  "Commit message for staging uncommitted changes. If not provided, a default message based on the PR title will be used."
2999
3012
  )
3000
3013
  },
@@ -3072,7 +3085,7 @@ function buildAddDependencyTool(connection) {
3072
3085
  "add_dependency",
3073
3086
  "Add a dependency \u2014 this task cannot start until the specified task is merged to dev",
3074
3087
  {
3075
- depends_on_slug_or_id: z2.string().describe("Slug or ID of the task this task depends on")
3088
+ depends_on_slug_or_id: z4.string().describe("Slug or ID of the task this task depends on")
3076
3089
  },
3077
3090
  async ({ depends_on_slug_or_id }) => {
3078
3091
  try {
@@ -3094,7 +3107,7 @@ function buildRemoveDependencyTool(connection) {
3094
3107
  "remove_dependency",
3095
3108
  "Remove a dependency from this task",
3096
3109
  {
3097
- depends_on_slug_or_id: z2.string().describe("Slug or ID of the task to remove as dependency")
3110
+ depends_on_slug_or_id: z4.string().describe("Slug or ID of the task to remove as dependency")
3098
3111
  },
3099
3112
  async ({ depends_on_slug_or_id }) => {
3100
3113
  try {
@@ -3116,10 +3129,10 @@ function buildCreateFollowUpTaskTool(connection) {
3116
3129
  "create_follow_up_task",
3117
3130
  "Create a follow-up task in this project that depends on the current task. Use for out-of-scope work, v1.1 features, or cleanup that should happen after this task merges.",
3118
3131
  {
3119
- title: z2.string().describe("Follow-up task title"),
3120
- description: z2.string().optional().describe("Brief description of the follow-up work"),
3121
- plan: z2.string().optional().describe("Implementation plan if known"),
3122
- story_point_value: z2.number().optional().describe("Story point estimate (1=Common, 2=Magic, 3=Rare, 5=Unique)")
3132
+ title: z4.string().describe("Follow-up task title"),
3133
+ description: z4.string().optional().describe("Brief description of the follow-up work"),
3134
+ plan: z4.string().optional().describe("Implementation plan if known"),
3135
+ story_point_value: z4.number().optional().describe("Story point estimate (1=Common, 2=Magic, 3=Rare, 5=Unique)")
3123
3136
  },
3124
3137
  async ({ title, description, plan, story_point_value }) => {
3125
3138
  try {
@@ -3146,9 +3159,9 @@ function buildCreateSuggestionTool(connection) {
3146
3159
  "create_suggestion",
3147
3160
  "Suggest a feature, improvement, or idea for the project. If you want to recommend something \u2014 a document, a rule, a feature, a task, an optimization \u2014 use this tool. If a similar suggestion already exists, your vote will be added to it instead of creating a duplicate.",
3148
3161
  {
3149
- title: z2.string().describe("Short title for the suggestion"),
3150
- description: z2.string().optional().describe("Details about the suggestion"),
3151
- tag_names: z2.array(z2.string()).optional().describe("Tag names to categorize the suggestion")
3162
+ title: z4.string().describe("Short title for the suggestion"),
3163
+ description: z4.string().optional().describe("Details about the suggestion"),
3164
+ tag_names: z4.array(z4.string()).optional().describe("Tag names to categorize the suggestion")
3152
3165
  },
3153
3166
  async ({ title, description, tag_names }) => {
3154
3167
  try {
@@ -3177,8 +3190,8 @@ function buildVoteSuggestionTool(connection) {
3177
3190
  "vote_suggestion",
3178
3191
  "Vote on a project suggestion. Use +1 to upvote or -1 to downvote.",
3179
3192
  {
3180
- suggestion_id: z2.string().describe("The suggestion ID to vote on"),
3181
- value: z2.number().refine((v) => v === 1 || v === -1, { message: "Value must be 1 or -1" }).describe("+1 to upvote, -1 to downvote")
3193
+ suggestion_id: z4.string().describe("The suggestion ID to vote on"),
3194
+ value: z4.number().refine((v) => v === 1 || v === -1, { message: "Value must be 1 or -1" }).describe("+1 to upvote, -1 to downvote")
3182
3195
  },
3183
3196
  async ({ suggestion_id, value }) => {
3184
3197
  try {
@@ -3201,8 +3214,8 @@ function buildScaleUpResourcesTool(connection) {
3201
3214
  "scale_up_resources",
3202
3215
  "Scale up the pod's CPU and memory resources. Use before running dev servers, tests, builds, or other resource-intensive operations. Phases: 'setup' (installs, basic dev servers), 'build' (full dev servers, test suites, typecheck, builds). Actual CPU/memory values are configured per-project. Scaling is one-way (up only).",
3203
3216
  {
3204
- tier: z2.enum(["initial", "setup", "build"]).describe("The resource phase to scale up to"),
3205
- reason: z2.string().optional().describe("Brief reason for scaling (e.g., 'running test suite')")
3217
+ tier: z4.enum(["initial", "setup", "build"]).describe("The resource phase to scale up to"),
3218
+ reason: z4.string().optional().describe("Brief reason for scaling (e.g., 'running test suite')")
3206
3219
  },
3207
3220
  async ({ tier, reason }) => {
3208
3221
  try {
@@ -3255,15 +3268,15 @@ function buildCommonTools(connection, config) {
3255
3268
  }
3256
3269
 
3257
3270
  // src/tools/pm-tools.ts
3258
- import { z as z3 } from "zod";
3271
+ import { z as z5 } from "zod";
3259
3272
  var SP_DESCRIPTION = "Story point value (1=Common, 2=Magic, 3=Rare, 5=Unique)";
3260
3273
  function buildUpdateTaskTool(connection) {
3261
3274
  return defineTool(
3262
3275
  "update_task",
3263
3276
  "Save the finalized task plan and/or description",
3264
3277
  {
3265
- plan: z3.string().optional().describe("The task plan in markdown"),
3266
- description: z3.string().optional().describe("Updated task description")
3278
+ plan: z5.string().optional().describe("The task plan in markdown"),
3279
+ description: z5.string().optional().describe("Updated task description")
3267
3280
  },
3268
3281
  async ({ plan, description }) => {
3269
3282
  try {
@@ -3284,11 +3297,11 @@ function buildCreateSubtaskTool(connection) {
3284
3297
  "create_subtask",
3285
3298
  "Create a subtask under the current parent task. Use for breaking complex tasks into smaller pieces.",
3286
3299
  {
3287
- title: z3.string().describe("Subtask title"),
3288
- description: z3.string().optional().describe("Brief description"),
3289
- plan: z3.string().optional().describe("Implementation plan in markdown"),
3290
- ordinal: z3.number().optional().describe("Step/order number (0-based)"),
3291
- storyPointValue: z3.number().optional().describe(SP_DESCRIPTION)
3300
+ title: z5.string().describe("Subtask title"),
3301
+ description: z5.string().optional().describe("Brief description"),
3302
+ plan: z5.string().optional().describe("Implementation plan in markdown"),
3303
+ ordinal: z5.number().optional().describe("Step/order number (0-based)"),
3304
+ storyPointValue: z5.number().optional().describe(SP_DESCRIPTION)
3292
3305
  },
3293
3306
  async ({ title, description, plan, ordinal, storyPointValue }) => {
3294
3307
  try {
@@ -3314,12 +3327,12 @@ function buildUpdateSubtaskTool(connection) {
3314
3327
  "update_subtask",
3315
3328
  "Update an existing subtask's fields",
3316
3329
  {
3317
- subtaskId: z3.string().describe("The subtask ID to update"),
3318
- title: z3.string().optional(),
3319
- description: z3.string().optional(),
3320
- plan: z3.string().optional(),
3321
- ordinal: z3.number().optional(),
3322
- storyPointValue: z3.number().optional().describe(SP_DESCRIPTION)
3330
+ subtaskId: z5.string().describe("The subtask ID to update"),
3331
+ title: z5.string().optional(),
3332
+ description: z5.string().optional(),
3333
+ plan: z5.string().optional(),
3334
+ ordinal: z5.number().optional(),
3335
+ storyPointValue: z5.number().optional().describe(SP_DESCRIPTION)
3323
3336
  },
3324
3337
  async ({ subtaskId, title, description, plan, storyPointValue }) => {
3325
3338
  try {
@@ -3342,7 +3355,7 @@ function buildDeleteSubtaskTool(connection) {
3342
3355
  return defineTool(
3343
3356
  "delete_subtask",
3344
3357
  "Delete a subtask",
3345
- { subtaskId: z3.string().describe("The subtask ID to delete") },
3358
+ { subtaskId: z5.string().describe("The subtask ID to delete") },
3346
3359
  async ({ subtaskId }) => {
3347
3360
  try {
3348
3361
  await connection.call("deleteSubtask", {
@@ -3380,7 +3393,7 @@ function buildPackTools(connection) {
3380
3393
  "start_child_cloud_build",
3381
3394
  "Start a cloud build for a child task. The child must be in Open status with story points and an agent assigned.",
3382
3395
  {
3383
- childTaskId: z3.string().describe("The child task ID to start a cloud build for")
3396
+ childTaskId: z5.string().describe("The child task ID to start a cloud build for")
3384
3397
  },
3385
3398
  async ({ childTaskId }) => {
3386
3399
  try {
@@ -3400,7 +3413,7 @@ function buildPackTools(connection) {
3400
3413
  "stop_child_build",
3401
3414
  "Stop a running cloud build for a child task. Sends a stop signal to the child agent.",
3402
3415
  {
3403
- childTaskId: z3.string().describe("The child task ID whose build should be stopped")
3416
+ childTaskId: z5.string().describe("The child task ID whose build should be stopped")
3404
3417
  },
3405
3418
  async ({ childTaskId }) => {
3406
3419
  try {
@@ -3420,7 +3433,7 @@ function buildPackTools(connection) {
3420
3433
  "approve_and_merge_pr",
3421
3434
  "Approve and merge a child task's pull request. Only succeeds if all CI/CD checks are passing. Returns an error if checks are pending (retry after waiting) or failed (investigate). The child task must be in ReviewPR status.",
3422
3435
  {
3423
- childTaskId: z3.string().describe("The child task ID whose PR should be approved and merged")
3436
+ childTaskId: z5.string().describe("The child task ID whose PR should be approved and merged")
3424
3437
  },
3425
3438
  async ({ childTaskId }) => {
3426
3439
  try {
@@ -3458,7 +3471,7 @@ function buildPmTools(connection, options) {
3458
3471
  }
3459
3472
 
3460
3473
  // src/tools/discovery-tools.ts
3461
- import { z as z4 } from "zod";
3474
+ import { z as z6 } from "zod";
3462
3475
  var SP_DESCRIPTION2 = "Story point value (1=Common, 2=Magic, 3=Rare, 5=Unique)";
3463
3476
  function buildDiscoveryTools(connection) {
3464
3477
  return [
@@ -3466,10 +3479,10 @@ function buildDiscoveryTools(connection) {
3466
3479
  "update_task_properties",
3467
3480
  "Set one or more task properties in a single call. All fields are optional \u2014 only include the fields you want to update.",
3468
3481
  {
3469
- title: z4.string().optional().describe("The new task title"),
3470
- storyPointValue: z4.number().optional().describe(SP_DESCRIPTION2),
3471
- tagIds: z4.array(z4.string()).optional().describe("Array of tag IDs to assign"),
3472
- githubPRUrl: z4.string().url().optional().describe("GitHub pull request URL to link to this task")
3482
+ title: z6.string().optional().describe("The new task title"),
3483
+ storyPointValue: z6.number().optional().describe(SP_DESCRIPTION2),
3484
+ tagIds: z6.array(z6.string()).optional().describe("Array of tag IDs to assign"),
3485
+ githubPRUrl: z6.string().url().optional().describe("GitHub pull request URL to link to this task")
3473
3486
  },
3474
3487
  async ({ title, storyPointValue, tagIds, githubPRUrl }) => {
3475
3488
  try {
@@ -3498,14 +3511,14 @@ function buildDiscoveryTools(connection) {
3498
3511
  }
3499
3512
 
3500
3513
  // src/tools/code-review-tools.ts
3501
- import { z as z5 } from "zod";
3514
+ import { z as z7 } from "zod";
3502
3515
  function buildCodeReviewTools(connection) {
3503
3516
  return [
3504
3517
  defineTool(
3505
3518
  "approve_code_review",
3506
3519
  "Approve the code review. Use this when the code passes all review criteria and is ready to merge.",
3507
3520
  {
3508
- summary: z5.string().describe("Brief summary of what was reviewed and why it looks good")
3521
+ summary: z7.string().describe("Brief summary of what was reviewed and why it looks good")
3509
3522
  },
3510
3523
  async ({ summary }) => {
3511
3524
  const content = `**Code Review: Approved** :white_check_mark:
@@ -3528,15 +3541,15 @@ ${summary}`;
3528
3541
  "request_code_changes",
3529
3542
  "Request changes during code review. Use this when substantive issues are found that need to be fixed before merge.",
3530
3543
  {
3531
- issues: z5.array(
3532
- z5.object({
3533
- file: z5.string().describe("File path where the issue was found"),
3534
- line: z5.number().optional().describe("Line number (if applicable)"),
3535
- severity: z5.enum(["critical", "major", "minor"]).describe("Issue severity"),
3536
- description: z5.string().describe("What is wrong and how to fix it")
3544
+ issues: z7.array(
3545
+ z7.object({
3546
+ file: z7.string().describe("File path where the issue was found"),
3547
+ line: z7.number().optional().describe("Line number (if applicable)"),
3548
+ severity: z7.enum(["critical", "major", "minor"]).describe("Issue severity"),
3549
+ description: z7.string().describe("What is wrong and how to fix it")
3537
3550
  })
3538
3551
  ).describe("List of issues found during review"),
3539
- summary: z5.string().describe("Brief overall summary of the review findings")
3552
+ summary: z7.string().describe("Brief overall summary of the review findings")
3540
3553
  },
3541
3554
  async ({ issues, summary }) => {
3542
3555
  const issueLines = issues.map((issue) => {
@@ -3566,10 +3579,10 @@ ${issueLines}`;
3566
3579
  }
3567
3580
 
3568
3581
  // src/tools/debug-tools.ts
3569
- import { z as z8 } from "zod";
3582
+ import { z as z10 } from "zod";
3570
3583
 
3571
3584
  // src/tools/telemetry-tools.ts
3572
- import { z as z6 } from "zod";
3585
+ import { z as z8 } from "zod";
3573
3586
 
3574
3587
  // src/debug/telemetry-injector.ts
3575
3588
  var BUFFER_SIZE = 200;
@@ -3964,12 +3977,12 @@ function buildGetTelemetryTool(manager) {
3964
3977
  "debug_get_telemetry",
3965
3978
  "Query structured telemetry events (HTTP requests, database queries, Socket.IO events, errors) captured from the running dev server. Returns filtered, structured data instead of raw logs.",
3966
3979
  {
3967
- type: z6.enum(["http", "db", "socket", "error"]).optional().describe("Filter by event type"),
3968
- urlPattern: z6.string().optional().describe("Regex pattern to filter HTTP events by URL"),
3969
- minDuration: z6.number().optional().describe("Minimum duration in ms \u2014 only return events slower than this"),
3970
- errorOnly: z6.boolean().optional().describe("Only return error events and HTTP 4xx/5xx responses"),
3971
- since: z6.number().optional().describe("Only return events after this timestamp (ms since epoch)"),
3972
- limit: z6.number().optional().describe("Max events to return (default: 20, from most recent)")
3980
+ type: z8.enum(["http", "db", "socket", "error"]).optional().describe("Filter by event type"),
3981
+ urlPattern: z8.string().optional().describe("Regex pattern to filter HTTP events by URL"),
3982
+ minDuration: z8.number().optional().describe("Minimum duration in ms \u2014 only return events slower than this"),
3983
+ errorOnly: z8.boolean().optional().describe("Only return error events and HTTP 4xx/5xx responses"),
3984
+ since: z8.number().optional().describe("Only return events after this timestamp (ms since epoch)"),
3985
+ limit: z8.number().optional().describe("Max events to return (default: 20, from most recent)")
3973
3986
  },
3974
3987
  async ({ type, urlPattern, minDuration, errorOnly, since, limit }) => {
3975
3988
  const clientOrErr = requireDebugClient(manager);
@@ -4039,7 +4052,7 @@ function buildTelemetryTools(manager) {
4039
4052
  }
4040
4053
 
4041
4054
  // src/tools/client-debug-tools.ts
4042
- import { z as z7 } from "zod";
4055
+ import { z as z9 } from "zod";
4043
4056
  function requirePlaywrightClient(manager) {
4044
4057
  if (!manager.isClientDebugMode()) {
4045
4058
  return "Client debug mode is not active. Use debug_enter_mode with clientSide: true first.";
@@ -4059,11 +4072,11 @@ function buildClientBreakpointTools(manager) {
4059
4072
  "debug_set_client_breakpoint",
4060
4073
  "Set a breakpoint in client-side code running in the headless Chromium browser. V8 resolves source maps automatically, so original .tsx/.ts file paths work. Use this for React components, client utilities, and browser-side code.",
4061
4074
  {
4062
- file: z7.string().describe(
4075
+ file: z9.string().describe(
4063
4076
  "Original source file path (e.g., src/components/App.tsx) \u2014 source maps resolve automatically"
4064
4077
  ),
4065
- line: z7.number().describe("Line number (1-based) in the original source file"),
4066
- condition: z7.string().optional().describe("JavaScript condition expression \u2014 breakpoint only triggers when truthy")
4078
+ line: z9.number().describe("Line number (1-based) in the original source file"),
4079
+ condition: z9.string().optional().describe("JavaScript condition expression \u2014 breakpoint only triggers when truthy")
4067
4080
  },
4068
4081
  async ({ file, line, condition }) => {
4069
4082
  const clientOrErr = requirePlaywrightClient(manager);
@@ -4085,7 +4098,7 @@ Breakpoint ID: ${breakpointId}${sourceMapNote}`
4085
4098
  "debug_remove_client_breakpoint",
4086
4099
  "Remove a previously set client-side breakpoint by its ID.",
4087
4100
  {
4088
- breakpointId: z7.string().describe("The breakpoint ID returned by debug_set_client_breakpoint")
4101
+ breakpointId: z9.string().describe("The breakpoint ID returned by debug_set_client_breakpoint")
4089
4102
  },
4090
4103
  async ({ breakpointId }) => {
4091
4104
  const clientOrErr = requirePlaywrightClient(manager);
@@ -4165,8 +4178,8 @@ ${JSON.stringify(queuedHits, null, 2)}`
4165
4178
  "debug_evaluate_client",
4166
4179
  "Evaluate a JavaScript expression in the client-side browser context. When paused at a client breakpoint, evaluates in the paused scope. Can access DOM, window, React internals, etc.",
4167
4180
  {
4168
- expression: z7.string().describe("JavaScript expression to evaluate in the browser context"),
4169
- frameIndex: z7.number().optional().describe("Call stack frame index (0 = top frame). Defaults to the top frame.")
4181
+ expression: z9.string().describe("JavaScript expression to evaluate in the browser context"),
4182
+ frameIndex: z9.number().optional().describe("Call stack frame index (0 = top frame). Defaults to the top frame.")
4170
4183
  },
4171
4184
  async ({ expression, frameIndex }) => {
4172
4185
  const clientOrErr = requirePlaywrightClient(manager);
@@ -4239,7 +4252,7 @@ function buildClientInteractionTools(manager) {
4239
4252
  "debug_navigate_client",
4240
4253
  "Navigate the headless browser to a specific URL. Use this to reproduce specific flows or visit different pages.",
4241
4254
  {
4242
- url: z7.string().describe("URL to navigate to (e.g., http://localhost:3000/dashboard)")
4255
+ url: z9.string().describe("URL to navigate to (e.g., http://localhost:3000/dashboard)")
4243
4256
  },
4244
4257
  async ({ url }) => {
4245
4258
  const clientOrErr = requirePlaywrightClient(manager);
@@ -4256,7 +4269,7 @@ function buildClientInteractionTools(manager) {
4256
4269
  "debug_click_client",
4257
4270
  "Click an element on the page in the headless browser. Use CSS selectors to target elements. Useful for reproducing bugs by interacting with the UI programmatically.",
4258
4271
  {
4259
- selector: z7.string().describe(
4272
+ selector: z9.string().describe(
4260
4273
  "CSS selector of the element to click (e.g., 'button.submit', '#login-form input[type=submit]')"
4261
4274
  )
4262
4275
  },
@@ -4278,8 +4291,8 @@ function buildClientConsoleTool(manager) {
4278
4291
  "debug_get_client_console",
4279
4292
  "Get console messages captured from the headless browser. Includes console.log, warn, error, etc.",
4280
4293
  {
4281
- level: z7.string().optional().describe("Filter by console level: log, warn, error, info, debug"),
4282
- limit: z7.number().optional().describe("Maximum number of recent messages to return (default: all)")
4294
+ level: z9.string().optional().describe("Filter by console level: log, warn, error, info, debug"),
4295
+ limit: z9.number().optional().describe("Maximum number of recent messages to return (default: all)")
4283
4296
  },
4284
4297
  // oxlint-disable-next-line require-await
4285
4298
  async ({ level, limit }) => {
@@ -4306,8 +4319,8 @@ function buildClientNetworkTool(manager) {
4306
4319
  "debug_get_client_network",
4307
4320
  "Get network requests captured from the headless browser. Shows URLs, methods, status codes, and timing.",
4308
4321
  {
4309
- filter: z7.string().optional().describe("Regex pattern to filter requests by URL"),
4310
- limit: z7.number().optional().describe("Maximum number of recent requests to return (default: all)")
4322
+ filter: z9.string().optional().describe("Regex pattern to filter requests by URL"),
4323
+ limit: z9.number().optional().describe("Maximum number of recent requests to return (default: all)")
4311
4324
  },
4312
4325
  // oxlint-disable-next-line require-await
4313
4326
  async ({ filter, limit }) => {
@@ -4335,7 +4348,7 @@ function buildClientErrorsTool(manager) {
4335
4348
  "debug_get_client_errors",
4336
4349
  "Get uncaught errors captured from the headless browser. Includes error messages and source-mapped stack traces.",
4337
4350
  {
4338
- limit: z7.number().optional().describe("Maximum number of recent errors to return (default: all)")
4351
+ limit: z9.number().optional().describe("Maximum number of recent errors to return (default: all)")
4339
4352
  },
4340
4353
  // oxlint-disable-next-line require-await
4341
4354
  async ({ limit }) => {
@@ -4429,12 +4442,12 @@ function buildDebugLifecycleTools(manager) {
4429
4442
  "debug_enter_mode",
4430
4443
  "Activate debug mode: restarts the dev server with Node.js --inspect flag and connects the CDP debugger. Optionally launch a headless Chromium browser for client-side debugging. Use serverSide for backend breakpoints, clientSide for frontend breakpoints, or both for full-stack.",
4431
4444
  {
4432
- hypothesis: z8.string().optional().describe("Your hypothesis about the bug \u2014 helps track debugging intent"),
4433
- serverSide: z8.boolean().optional().describe(
4445
+ hypothesis: z10.string().optional().describe("Your hypothesis about the bug \u2014 helps track debugging intent"),
4446
+ serverSide: z10.boolean().optional().describe(
4434
4447
  "Enable server-side Node.js debugging (default: true if clientSide is not set)"
4435
4448
  ),
4436
- clientSide: z8.boolean().optional().describe("Enable client-side browser debugging via headless Chromium + Playwright"),
4437
- previewUrl: z8.string().optional().describe(
4449
+ clientSide: z10.boolean().optional().describe("Enable client-side browser debugging via headless Chromium + Playwright"),
4450
+ previewUrl: z10.string().optional().describe(
4438
4451
  "Preview URL for client-side debugging (e.g., http://localhost:3000). Required when clientSide is true."
4439
4452
  )
4440
4453
  },
@@ -4470,9 +4483,9 @@ function buildBreakpointTools(manager) {
4470
4483
  "debug_set_breakpoint",
4471
4484
  "Set a breakpoint at the specified file and line number. Optionally provide a condition expression that must evaluate to true for the breakpoint to pause execution.",
4472
4485
  {
4473
- file: z8.string().describe("Absolute or relative file path to set the breakpoint in"),
4474
- line: z8.number().describe("Line number (1-based) to set the breakpoint on"),
4475
- condition: z8.string().optional().describe("JavaScript condition expression \u2014 breakpoint only triggers when truthy")
4486
+ file: z10.string().describe("Absolute or relative file path to set the breakpoint in"),
4487
+ line: z10.number().describe("Line number (1-based) to set the breakpoint on"),
4488
+ condition: z10.string().optional().describe("JavaScript condition expression \u2014 breakpoint only triggers when truthy")
4476
4489
  },
4477
4490
  async ({ file, line, condition }) => {
4478
4491
  const clientOrErr = requireDebugClient2(manager);
@@ -4494,7 +4507,7 @@ Breakpoint ID: ${breakpointId}`
4494
4507
  "debug_remove_breakpoint",
4495
4508
  "Remove a previously set breakpoint by its ID.",
4496
4509
  {
4497
- breakpointId: z8.string().describe("The breakpoint ID returned by debug_set_breakpoint")
4510
+ breakpointId: z10.string().describe("The breakpoint ID returned by debug_set_breakpoint")
4498
4511
  },
4499
4512
  async ({ breakpointId }) => {
4500
4513
  const clientOrErr = requireDebugClient2(manager);
@@ -4575,8 +4588,8 @@ ${JSON.stringify(queuedHits, null, 2)}`
4575
4588
  "debug_evaluate",
4576
4589
  "Evaluate a JavaScript expression in the current paused scope (or globally if not paused). When paused, use frameIndex to evaluate in a specific call frame.",
4577
4590
  {
4578
- expression: z8.string().describe("The JavaScript expression to evaluate"),
4579
- frameIndex: z8.number().optional().describe("Call stack frame index (0 = top frame). Defaults to the top frame.")
4591
+ expression: z10.string().describe("The JavaScript expression to evaluate"),
4592
+ frameIndex: z10.number().optional().describe("Call stack frame index (0 = top frame). Defaults to the top frame.")
4580
4593
  },
4581
4594
  async ({ expression, frameIndex }) => {
4582
4595
  const clientOrErr = requireDebugClient2(manager);
@@ -4604,12 +4617,12 @@ function buildProbeManagementTools(manager) {
4604
4617
  "debug_add_probe",
4605
4618
  "Add a debug probe at a specific code location. Captures expression values each time the line executes \u2014 without pausing or modifying source files. Like console.log but better: structured, no diff pollution, auto-cleaned on debug exit.",
4606
4619
  {
4607
- file: z8.string().describe("File path to probe"),
4608
- line: z8.number().describe("Line number (1-based) to probe"),
4609
- expressions: z8.array(z8.string()).describe(
4620
+ file: z10.string().describe("File path to probe"),
4621
+ line: z10.number().describe("Line number (1-based) to probe"),
4622
+ expressions: z10.array(z10.string()).describe(
4610
4623
  'JavaScript expressions to capture when the line executes (e.g., ["req.params.id", "user.role"])'
4611
4624
  ),
4612
- label: z8.string().optional().describe("Optional label for this probe (defaults to file:line)")
4625
+ label: z10.string().optional().describe("Optional label for this probe (defaults to file:line)")
4613
4626
  },
4614
4627
  async ({ file, line, expressions, label }) => {
4615
4628
  const clientOrErr = requireDebugClient2(manager);
@@ -4634,7 +4647,7 @@ Trigger the code path, then use debug_get_probe_results to see captured values.`
4634
4647
  "debug_remove_probe",
4635
4648
  "Remove a previously set debug probe by its ID.",
4636
4649
  {
4637
- probeId: z8.string().describe("The probe ID returned by debug_add_probe")
4650
+ probeId: z10.string().describe("The probe ID returned by debug_add_probe")
4638
4651
  },
4639
4652
  async ({ probeId }) => {
4640
4653
  const clientOrErr = requireDebugClient2(manager);
@@ -4674,9 +4687,9 @@ function buildProbeResultTools(manager) {
4674
4687
  "debug_get_probe_results",
4675
4688
  "Fetch captured probe hit data. Returns expression values from each time a probed line executed.",
4676
4689
  {
4677
- probeId: z8.string().optional().describe("Filter results by probe ID (resolves to its label)"),
4678
- label: z8.string().optional().describe("Filter results by probe label"),
4679
- limit: z8.number().optional().describe("Maximum number of recent hits to return (default: all)")
4690
+ probeId: z10.string().optional().describe("Filter results by probe ID (resolves to its label)"),
4691
+ label: z10.string().optional().describe("Filter results by probe label"),
4692
+ limit: z10.number().optional().describe("Maximum number of recent hits to return (default: all)")
4680
4693
  },
4681
4694
  async ({ probeId, label, limit }) => {
4682
4695
  const clientOrErr = requireDebugClient2(manager);
@@ -4839,23 +4852,20 @@ function getModeTools(agentMode, connection, config, context) {
4839
4852
  }
4840
4853
  function buildConveyorTools(connection, config, context, agentMode, debugManager) {
4841
4854
  const effectiveMode = agentMode ?? context?.agentMode ?? void 0;
4842
- if (effectiveMode === "code-review") {
4843
- return [
4844
- buildReadTaskChatTool(connection),
4845
- buildGetTaskPlanTool(connection),
4846
- buildGetTaskTool(connection),
4847
- buildGetTaskCliTool(connection),
4848
- buildListTaskFilesTool(connection),
4849
- buildGetTaskFileTool(connection),
4850
- ...buildCodeReviewTools(connection)
4851
- ];
4852
- }
4853
4855
  const commonTools = buildCommonTools(connection, config);
4854
4856
  const modeTools = getModeTools(effectiveMode, connection, config, context);
4855
4857
  const discoveryTools = effectiveMode === "discovery" || effectiveMode === "auto" ? buildDiscoveryTools(connection) : [];
4858
+ const codeReviewTools = effectiveMode === "review" ? buildCodeReviewTools(connection) : [];
4856
4859
  const emergencyTools = [buildForceUpdateTaskStatusTool(connection)];
4857
4860
  const debugTools = debugManager && effectiveMode === "building" ? buildDebugTools(debugManager) : [];
4858
- return [...commonTools, ...modeTools, ...discoveryTools, ...emergencyTools, ...debugTools];
4861
+ return [
4862
+ ...commonTools,
4863
+ ...modeTools,
4864
+ ...discoveryTools,
4865
+ ...codeReviewTools,
4866
+ ...emergencyTools,
4867
+ ...debugTools
4868
+ ];
4859
4869
  }
4860
4870
  function createConveyorMcpServer(harness, connection, config, context, agentMode, debugManager) {
4861
4871
  return harness.createMcpServer({
@@ -5274,7 +5284,6 @@ function collectMissingProps(taskProps) {
5274
5284
  // src/execution/tool-access.ts
5275
5285
  var PM_PLAN_FILE_TOOLS = /* @__PURE__ */ new Set(["Write", "Edit", "MultiEdit"]);
5276
5286
  var DESTRUCTIVE_CMD_PATTERN = /git\s+push\s+--force(?!\s*-with-lease)|git\s+reset\s+--hard|rm\s+-rf\s+\//;
5277
- var CODE_REVIEW_WRITE_CMD_PATTERN = /git\s+push|git\s+commit|git\s+add|rm\s+|mv\s+|cp\s+|mkdir\s+|touch\s+|chmod\s+|chown\s+/;
5278
5287
  var RESOURCE_HEAVY_PATTERNS = [
5279
5288
  /\bbun\s+(install|i|add)\b/,
5280
5289
  /\bnpm\s+(install|ci|i)\b/,
@@ -5311,48 +5320,12 @@ function handleBuildingToolAccess(toolName, input) {
5311
5320
  }
5312
5321
  return { behavior: "allow", updatedInput: input };
5313
5322
  }
5314
- function handleReviewToolAccess(toolName, input, isParentTask) {
5315
- if (isParentTask) {
5316
- return handleBuildingToolAccess(toolName, input);
5317
- }
5318
- if (PM_PLAN_FILE_TOOLS.has(toolName)) {
5319
- if (isPlanFile(input)) {
5320
- return { behavior: "allow", updatedInput: input };
5321
- }
5322
- return {
5323
- behavior: "deny",
5324
- message: "Review mode restricts file writes. Use bash to run tests and linting instead."
5325
- };
5326
- }
5327
- if (toolName === "Bash") {
5328
- const cmd = String(input.command ?? "");
5329
- if (DESTRUCTIVE_CMD_PATTERN.test(cmd)) {
5330
- return { behavior: "deny", message: "Destructive operation blocked in review mode." };
5331
- }
5332
- }
5333
- return { behavior: "allow", updatedInput: input };
5334
- }
5335
- function handleCodeReviewToolAccess(toolName, input) {
5336
- if (PM_PLAN_FILE_TOOLS.has(toolName)) {
5337
- return {
5338
- behavior: "deny",
5339
- message: "Code review mode is fully read-only. File writes are not permitted."
5340
- };
5341
- }
5342
- if (toolName === "Bash") {
5343
- const cmd = String(input.command ?? "");
5344
- if (DESTRUCTIVE_CMD_PATTERN.test(cmd) || CODE_REVIEW_WRITE_CMD_PATTERN.test(cmd)) {
5345
- return {
5346
- behavior: "deny",
5347
- message: "Code review mode is read-only. Write operations and destructive commands are blocked."
5348
- };
5349
- }
5350
- }
5351
- return { behavior: "allow", updatedInput: input };
5323
+ function handleReviewToolAccess(toolName, input) {
5324
+ return handleBuildingToolAccess(toolName, input);
5352
5325
  }
5353
5326
  function handleAutoToolAccess(toolName, input, hasExitedPlanMode, isParentTask) {
5354
5327
  if (hasExitedPlanMode) {
5355
- return isParentTask ? handleReviewToolAccess(toolName, input, true) : handleBuildingToolAccess(toolName, input);
5328
+ return isParentTask ? handleReviewToolAccess(toolName, input) : handleBuildingToolAccess(toolName, input);
5356
5329
  }
5357
5330
  return { behavior: "allow", updatedInput: input };
5358
5331
  }
@@ -5465,11 +5438,9 @@ function resolveToolAccess(host, toolName, input) {
5465
5438
  case "building":
5466
5439
  return handleBuildingToolAccess(toolName, input);
5467
5440
  case "review":
5468
- return handleReviewToolAccess(toolName, input, host.isParentTask);
5441
+ return handleReviewToolAccess(toolName, input);
5469
5442
  case "auto":
5470
5443
  return handleAutoToolAccess(toolName, input, host.hasExitedPlanMode, host.isParentTask);
5471
- case "code-review":
5472
- return handleCodeReviewToolAccess(toolName, input);
5473
5444
  default:
5474
5445
  return { behavior: "allow", updatedInput: input };
5475
5446
  }
@@ -5548,13 +5519,10 @@ function buildHooks(host) {
5548
5519
  };
5549
5520
  }
5550
5521
  function isReadOnlyMode(mode, hasExitedPlanMode) {
5551
- return mode === "discovery" || mode === "help" || mode === "code-review" || mode === "auto" && !hasExitedPlanMode;
5522
+ return mode === "discovery" || mode === "help" || mode === "auto" && !hasExitedPlanMode;
5552
5523
  }
5553
5524
  function buildDisallowedTools(settings, mode, hasExitedPlanMode) {
5554
5525
  const modeDisallowed = isReadOnlyMode(mode, hasExitedPlanMode) ? ["TodoWrite", "TodoRead", "NotebookEdit"] : [];
5555
- if (mode === "code-review") {
5556
- modeDisallowed.push("ExitPlanMode", "EnterPlanMode");
5557
- }
5558
5526
  const configured = settings.disallowedTools ?? [];
5559
5527
  const combined = [...configured, ...modeDisallowed];
5560
5528
  return combined.length > 0 ? combined : void 0;
@@ -5590,11 +5558,11 @@ function buildQueryOptions(host, context) {
5590
5558
  },
5591
5559
  sandbox: context.useSandbox ? { enabled: true } : { enabled: false },
5592
5560
  hooks: buildHooks(host),
5593
- maxTurns: mode === "code-review" ? Math.min(settings.maxTurns ?? 15, 15) : settings.maxTurns,
5561
+ maxTurns: settings.maxTurns,
5594
5562
  effort: settings.effort,
5595
5563
  thinking: settings.thinking,
5596
5564
  betas: settings.betas,
5597
- maxBudgetUsd: mode === "code-review" ? Math.min(settings.maxBudgetUsd ?? 10, 10) : settings.maxBudgetUsd ?? 50,
5565
+ maxBudgetUsd: settings.maxBudgetUsd ?? 50,
5598
5566
  abortController: host.abortController ?? void 0,
5599
5567
  disallowedTools: buildDisallowedTools(settings, mode, host.hasExitedPlanMode),
5600
5568
  enableFileCheckpointing: settings.enableFileCheckpointing,
@@ -6290,14 +6258,7 @@ var SessionRunner = class _SessionRunner {
6290
6258
  async executeInitialMode() {
6291
6259
  if (!this.taskContext || !this.fullContext) return false;
6292
6260
  const effectiveMode = this.mode.effectiveMode;
6293
- if (effectiveMode === "code-review") {
6294
- await this.setState("running");
6295
- await this.callbacks.onEvent({ type: "execute_mode", mode: effectiveMode });
6296
- await this.executeQuery();
6297
- this.stopped = true;
6298
- return true;
6299
- }
6300
- const shouldRun = effectiveMode === "building" || effectiveMode === "auto" || effectiveMode === "review" && this.mode.isPackRunner(this.taskContext);
6261
+ const shouldRun = effectiveMode === "building" || effectiveMode === "auto" || effectiveMode === "review";
6301
6262
  if (shouldRun) {
6302
6263
  await this.setState("running");
6303
6264
  await this.callbacks.onEvent({ type: "execute_mode", mode: effectiveMode });
@@ -6422,6 +6383,7 @@ var SessionRunner = class _SessionRunner {
6422
6383
  }
6423
6384
  }
6424
6385
  // ── Context & bridge construction ────────────────────────────────
6386
+ // oxlint-disable-next-line complexity
6425
6387
  buildFullContext(ctx) {
6426
6388
  const chatHistory = mapChatHistory(ctx.chatHistory);
6427
6389
  return {
@@ -6448,7 +6410,8 @@ var SessionRunner = class _SessionRunner {
6448
6410
  projectTags: ctx.projectTags ?? void 0,
6449
6411
  taskTagIds: ctx.taskTagIds ?? void 0,
6450
6412
  projectObjectives: ctx.projectObjectives ?? void 0,
6451
- incidents: ctx.incidents ?? void 0
6413
+ incidents: ctx.incidents ?? void 0,
6414
+ agentSettings: ctx.agentSettings ?? null
6452
6415
  };
6453
6416
  }
6454
6417
  createQueryBridge() {
@@ -6498,6 +6461,12 @@ var SessionRunner = class _SessionRunner {
6498
6461
  if (action.type === "start_auto") {
6499
6462
  this.connection.emitModeChanged(this.mode.effectiveMode);
6500
6463
  this.softStop();
6464
+ } else if (action.type === "restart_query") {
6465
+ if (this.fullContext && action.newMode === "review") {
6466
+ this.fullContext.claudeSessionId = null;
6467
+ }
6468
+ this.connection.emitModeChanged(action.newMode);
6469
+ this.softStop();
6501
6470
  }
6502
6471
  });
6503
6472
  this.connection.onWake(() => this.lifecycle.wake());
@@ -6953,7 +6922,7 @@ import * as path from "path";
6953
6922
  import { fileURLToPath } from "url";
6954
6923
 
6955
6924
  // src/tools/project-tools.ts
6956
- import { z as z9 } from "zod";
6925
+ import { z as z11 } from "zod";
6957
6926
  function buildTaskListTools(connection) {
6958
6927
  const projectId = connection.projectId;
6959
6928
  return [
@@ -6961,9 +6930,9 @@ function buildTaskListTools(connection) {
6961
6930
  "list_tasks",
6962
6931
  "List tasks in the project. Optionally filter by status or assignee.",
6963
6932
  {
6964
- status: z9.string().optional().describe("Filter by task status"),
6965
- assigneeId: z9.string().optional().describe("Filter by assigned user ID"),
6966
- limit: z9.number().optional().describe("Max number of tasks to return (default 50)")
6933
+ status: z11.string().optional().describe("Filter by task status"),
6934
+ assigneeId: z11.string().optional().describe("Filter by assigned user ID"),
6935
+ limit: z11.number().optional().describe("Max number of tasks to return (default 50)")
6967
6936
  },
6968
6937
  async (params) => {
6969
6938
  try {
@@ -6980,7 +6949,7 @@ function buildTaskListTools(connection) {
6980
6949
  defineTool(
6981
6950
  "get_task",
6982
6951
  "Get detailed information about a task including chat messages, child tasks, and session.",
6983
- { task_id: z9.string().describe("The task ID to look up") },
6952
+ { task_id: z11.string().describe("The task ID to look up") },
6984
6953
  async ({ task_id }) => {
6985
6954
  try {
6986
6955
  const task = await connection.call("getProjectTask", { projectId, taskId: task_id });
@@ -6997,10 +6966,10 @@ function buildTaskListTools(connection) {
6997
6966
  "search_tasks",
6998
6967
  "Search tasks by tags, text query, or status filters.",
6999
6968
  {
7000
- tagNames: z9.array(z9.string()).optional().describe("Filter by tag names"),
7001
- searchQuery: z9.string().optional().describe("Text search in title/description"),
7002
- statusFilters: z9.array(z9.string()).optional().describe("Filter by statuses"),
7003
- limit: z9.number().optional().describe("Max results (default 20)")
6969
+ tagNames: z11.array(z11.string()).optional().describe("Filter by tag names"),
6970
+ searchQuery: z11.string().optional().describe("Text search in title/description"),
6971
+ statusFilters: z11.array(z11.string()).optional().describe("Filter by statuses"),
6972
+ limit: z11.number().optional().describe("Max results (default 20)")
7004
6973
  },
7005
6974
  async (params) => {
7006
6975
  try {
@@ -7060,11 +7029,11 @@ function buildMutationTools(connection) {
7060
7029
  "create_task",
7061
7030
  "Create a new task in the project.",
7062
7031
  {
7063
- title: z9.string().describe("Task title"),
7064
- description: z9.string().optional().describe("Task description"),
7065
- plan: z9.string().optional().describe("Implementation plan in markdown"),
7066
- status: z9.string().optional().describe("Initial status (default: Planning)"),
7067
- isBug: z9.boolean().optional().describe("Whether this is a bug report")
7032
+ title: z11.string().describe("Task title"),
7033
+ description: z11.string().optional().describe("Task description"),
7034
+ plan: z11.string().optional().describe("Implementation plan in markdown"),
7035
+ status: z11.string().optional().describe("Initial status (default: Planning)"),
7036
+ isBug: z11.boolean().optional().describe("Whether this is a bug report")
7068
7037
  },
7069
7038
  async (params) => {
7070
7039
  try {
@@ -7081,12 +7050,12 @@ function buildMutationTools(connection) {
7081
7050
  "update_task",
7082
7051
  "Update an existing task's title, description, plan, status, or assignee.",
7083
7052
  {
7084
- task_id: z9.string().describe("The task ID to update"),
7085
- title: z9.string().optional().describe("New title"),
7086
- description: z9.string().optional().describe("New description"),
7087
- plan: z9.string().optional().describe("New plan in markdown"),
7088
- status: z9.string().optional().describe("New status"),
7089
- assignedUserId: z9.string().nullable().optional().describe("Assign to user ID, or null to unassign")
7053
+ task_id: z11.string().describe("The task ID to update"),
7054
+ title: z11.string().optional().describe("New title"),
7055
+ description: z11.string().optional().describe("New description"),
7056
+ plan: z11.string().optional().describe("New plan in markdown"),
7057
+ status: z11.string().optional().describe("New status"),
7058
+ assignedUserId: z11.string().nullable().optional().describe("Assign to user ID, or null to unassign")
7090
7059
  },
7091
7060
  async ({ task_id, ...fields }) => {
7092
7061
  try {
@@ -7535,7 +7504,7 @@ var ProjectRunner = class {
7535
7504
  async handleAuditTags(request) {
7536
7505
  this.connection.emitStatus("busy");
7537
7506
  try {
7538
- const { handleTagAudit } = await import("./tag-audit-handler-L7YPDXTA.js");
7507
+ const { handleTagAudit } = await import("./tag-audit-handler-PACJJEDB.js");
7539
7508
  await handleTagAudit(request, this.connection, this.projectDir);
7540
7509
  } catch (error) {
7541
7510
  const msg = error instanceof Error ? error.message : String(error);
@@ -7956,4 +7925,4 @@ export {
7956
7925
  loadForwardPorts,
7957
7926
  loadConveyorConfig
7958
7927
  };
7959
- //# sourceMappingURL=chunk-5CBPSIEV.js.map
7928
+ //# sourceMappingURL=chunk-5ZINKEUR.js.map