@rallycry/conveyor-agent 7.0.3 → 7.0.4

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.
@@ -263,6 +263,7 @@ var AgentConnection = class {
263
263
  };
264
264
  const heartbeatStatus = statusMap[this.lastEmittedStatus ?? "idle"] ?? "active";
265
265
  void this.call("heartbeat", {
266
+ sessionId: this.config.sessionId,
266
267
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
267
268
  status: heartbeatStatus
268
269
  }).catch(() => {
@@ -1172,6 +1173,14 @@ function buildDiscoveryPrompt(context) {
1172
1173
  `- If the work fits in a single task (1-3 SP), update YOUR OWN plan and properties \u2014 do not create subtasks`,
1173
1174
  `- Only create subtasks when the work genuinely requires multiple independent pieces (e.g., Pack-tier work, 8+ SP)`,
1174
1175
  ``,
1176
+ `### Subtask Plan Requirements`,
1177
+ `When creating subtasks, each MUST include a detailed \`plan\` field:`,
1178
+ `- Plans should be multi-step implementation guides, not vague descriptions`,
1179
+ `- Include specific file paths, function names, and code patterns to modify`,
1180
+ `- Reference existing implementations when relevant (e.g., "follow the pattern in src/services/foo.ts")`,
1181
+ `- Include testing requirements and acceptance criteria`,
1182
+ `- Set \`storyPointValue\` based on estimated complexity`,
1183
+ ``,
1175
1184
  `### Finishing Planning`,
1176
1185
  `Once your plan is complete and all required properties are set, call the **ExitPlanMode** tool.`,
1177
1186
  `- Required before ExitPlanMode will succeed: **plan** (via update_task), **story points** (via update_task_properties), **title** (via update_task_properties)`,
@@ -1203,6 +1212,14 @@ function buildAutoPrompt(context) {
1203
1212
  `- Once ExitPlanMode succeeds, the system will automatically restart your session in Building mode with the appropriate model`,
1204
1213
  `- You do NOT need to do anything after calling ExitPlanMode \u2014 the transition is handled for you`,
1205
1214
  ``,
1215
+ `### Subtask Plan Requirements`,
1216
+ `When creating subtasks, each MUST include a detailed \`plan\` field:`,
1217
+ `- Plans should be multi-step implementation guides, not vague descriptions`,
1218
+ `- Include specific file paths, function names, and code patterns to modify`,
1219
+ `- Reference existing implementations when relevant`,
1220
+ `- Include testing requirements and acceptance criteria`,
1221
+ `- Set \`storyPointValue\` based on estimated complexity`,
1222
+ ``,
1206
1223
  `### Autonomous Guidelines:`,
1207
1224
  `- Make decisions independently \u2014 do not ask the team for approval at each step`,
1208
1225
  `- Only escalate when genuinely blocked (ambiguous requirements, missing access, conflicting instructions)`,
@@ -1229,13 +1246,12 @@ function buildModePrompt(agentMode, context) {
1229
1246
  parts.push(
1230
1247
  ``,
1231
1248
  `### Resource Management`,
1232
- `Your pod starts with minimal resources (0.25 CPU / 1 Gi). You MUST call \`scale_up_resources\``,
1233
- `BEFORE running any of these operations \u2014 they WILL fail or OOM at baseline resources:`,
1234
- `- **light** (1 CPU / 4 Gi) \u2014 bun/npm/yarn install, pip install, basic dev servers, light builds`,
1235
- `- **standard** (2 CPU / 8 Gi) \u2014 full dev servers, test suites, typecheck, lint`,
1236
- `- **heavy** (4 CPU / 16 Gi) \u2014 E2E/browser automation, large parallel builds`,
1237
- `Scaling is one-way (up only) and capped by project limits.`,
1238
- `CRITICAL: Always scale to at least "light" before running any package install command.`
1249
+ `Your pod starts with minimal resources. You MUST call \`scale_up_resources\``,
1250
+ `BEFORE running any resource-intensive operations \u2014 they WILL fail or OOM at baseline resources:`,
1251
+ `- **setup** \u2014 package installs, basic dev servers, light builds`,
1252
+ `- **build** \u2014 full dev servers, test suites, typecheck, lint, E2E tests`,
1253
+ `Actual CPU/memory values are configured per-project. Scaling is one-way (up only).`,
1254
+ `CRITICAL: Always scale to at least "setup" before running any package install command.`
1239
1255
  );
1240
1256
  }
1241
1257
  return parts.join("\n");
@@ -2348,7 +2364,15 @@ Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>`;
2348
2364
  return textResult(`Pull request #${result.prNumber} created: ${result.prUrl}`);
2349
2365
  } catch (error) {
2350
2366
  const msg = error instanceof Error ? error.message : "Unknown error";
2351
- return textResult(`Failed to create pull request: ${msg}`);
2367
+ return textResult(
2368
+ `Failed to create pull request: ${msg}
2369
+
2370
+ Troubleshooting:
2371
+ - Ensure all changes are committed and pushed to the remote branch
2372
+ - Check that the branch exists on the remote (run: git push -u origin HEAD)
2373
+ - Verify there isn't already an open PR for this branch
2374
+ - If git auth fails, the token may have expired \u2014 retry the operation`
2375
+ );
2352
2376
  }
2353
2377
  }
2354
2378
  );
@@ -2485,9 +2509,9 @@ function buildVoteSuggestionTool(connection) {
2485
2509
  function buildScaleUpResourcesTool(connection) {
2486
2510
  return defineTool(
2487
2511
  "scale_up_resources",
2488
- "Scale up the pod's CPU and memory resources. Use before running dev servers, tests, builds, or other resource-intensive operations. Tiers: 'light' (1 CPU / 4 Gi \u2014 installs, basic dev servers), 'standard' (2 CPU / 8 Gi \u2014 full dev servers, test suites, typecheck), 'heavy' (4 CPU / 16 Gi \u2014 E2E tests, large parallel builds). Scaling is one-way (up only) and capped by project limits.",
2512
+ "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).",
2489
2513
  {
2490
- tier: z.enum(["initial", "light", "standard", "heavy"]).describe("The resource tier to scale up to"),
2514
+ tier: z.enum(["initial", "setup", "build"]).describe("The resource phase to scale up to"),
2491
2515
  reason: z.string().optional().describe("Brief reason for scaling (e.g., 'running test suite')")
2492
2516
  },
2493
2517
  async ({ tier, reason }) => {
@@ -2498,13 +2522,8 @@ function buildScaleUpResourcesTool(connection) {
2498
2522
  reason
2499
2523
  });
2500
2524
  if (result.success) {
2501
- if (result.currentTier === result.previousTier) {
2502
- return textResult(
2503
- `Already at ${result.currentTier} tier (${result.cpu} CPU / ${result.memory} Gi). No scaling needed.`
2504
- );
2505
- }
2506
2525
  return textResult(
2507
- `Scaled to ${result.cpu} CPU / ${result.memory} Gi (${result.currentTier} tier, was ${result.previousTier}).`
2526
+ `Scaled to ${result.currentTier} phase (${result.cpu}). Was ${result.previousTier}.`
2508
2527
  );
2509
2528
  }
2510
2529
  return textResult(
@@ -2581,14 +2600,15 @@ function buildCreateSubtaskTool(connection) {
2581
2600
  ordinal: z2.number().optional().describe("Step/order number (0-based)"),
2582
2601
  storyPointValue: z2.number().optional().describe(SP_DESCRIPTION)
2583
2602
  },
2584
- async ({ title, description, plan: _plan, ordinal, storyPointValue }) => {
2603
+ async ({ title, description, plan, ordinal, storyPointValue }) => {
2585
2604
  try {
2586
2605
  const result = await connection.call("createSubtask", {
2587
2606
  sessionId: connection.sessionId,
2588
2607
  title,
2589
- description,
2590
- storyPoints: storyPointValue,
2591
- ordinal
2608
+ ...description !== void 0 && { description },
2609
+ ...plan !== void 0 && { plan },
2610
+ ...storyPointValue !== void 0 && { storyPointValue },
2611
+ ...ordinal !== void 0 && { ordinal }
2592
2612
  });
2593
2613
  return textResult(`Subtask created with ID: ${result.id}`);
2594
2614
  } catch (error) {
@@ -2611,20 +2631,15 @@ function buildUpdateSubtaskTool(connection) {
2611
2631
  ordinal: z2.number().optional(),
2612
2632
  storyPointValue: z2.number().optional().describe(SP_DESCRIPTION)
2613
2633
  },
2614
- async ({
2615
- subtaskId,
2616
- title,
2617
- description,
2618
- plan: _plan,
2619
- ordinal: _ordinal,
2620
- storyPointValue: _sp
2621
- }) => {
2634
+ async ({ subtaskId, title, description, plan, storyPointValue }) => {
2622
2635
  try {
2623
2636
  await connection.call("updateSubtask", {
2624
2637
  sessionId: connection.sessionId,
2625
2638
  subtaskId,
2626
- title,
2627
- description
2639
+ ...title !== void 0 && { title },
2640
+ ...description !== void 0 && { description },
2641
+ ...plan !== void 0 && { plan },
2642
+ ...storyPointValue !== void 0 && { storyPointValue }
2628
2643
  });
2629
2644
  return textResult("Subtask updated.");
2630
2645
  } catch (error) {
@@ -4686,6 +4701,14 @@ function handleAutoToolAccess(toolName, input, hasExitedPlanMode, isParentTask)
4686
4701
  }
4687
4702
  return { behavior: "allow", updatedInput: input };
4688
4703
  }
4704
+ function collectMissingProps(taskProps) {
4705
+ const missing = [];
4706
+ if (!taskProps.plan?.trim()) missing.push("plan (save via update_task)");
4707
+ if (!taskProps.storyPointId) missing.push("story points (use update_task_properties)");
4708
+ if (!taskProps.title || taskProps.title === "Untitled")
4709
+ missing.push("title (use update_task_properties)");
4710
+ return missing;
4711
+ }
4689
4712
  async function handleExitPlanMode(host, input) {
4690
4713
  if (host.hasExitedPlanMode) {
4691
4714
  return { behavior: "allow", updatedInput: input };
@@ -4693,11 +4716,24 @@ async function handleExitPlanMode(host, input) {
4693
4716
  try {
4694
4717
  host.syncPlanFile();
4695
4718
  const taskProps = await host.connection.getTaskProperties();
4696
- const missingProps = [];
4697
- if (!taskProps.plan?.trim()) missingProps.push("plan (save via update_task)");
4698
- if (!taskProps.storyPointId) missingProps.push("story points (use update_task_properties)");
4699
- if (!taskProps.title || taskProps.title === "Untitled")
4700
- missingProps.push("title (use update_task_properties)");
4719
+ const missingProps = collectMissingProps(taskProps);
4720
+ if (host.isParentTask) {
4721
+ try {
4722
+ const subtasks = await host.connection.call("listSubtasks", {
4723
+ sessionId: host.connection.sessionId
4724
+ });
4725
+ const subtasksWithoutPlans = subtasks.filter(
4726
+ (s) => !s.plan?.trim()
4727
+ );
4728
+ if (subtasksWithoutPlans.length > 0) {
4729
+ const names = subtasksWithoutPlans.map((s) => s.title).join(", ");
4730
+ missingProps.push(
4731
+ `subtask plans \u2014 these subtasks are missing plans: ${names} (use update_subtask with plan field)`
4732
+ );
4733
+ }
4734
+ } catch {
4735
+ }
4736
+ }
4701
4737
  if (missingProps.length > 0) {
4702
4738
  return {
4703
4739
  behavior: "deny",
@@ -7087,4 +7123,4 @@ export {
7087
7123
  removeWorktree,
7088
7124
  ProjectRunner
7089
7125
  };
7090
- //# sourceMappingURL=chunk-L7ZH423N.js.map
7126
+ //# sourceMappingURL=chunk-K2TJHPMA.js.map