@rallycry/conveyor-agent 5.8.0 → 5.9.1

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.
@@ -568,7 +568,7 @@ async function loadConveyorConfig(workspaceDir) {
568
568
  const envStart = process.env.CONVEYOR_START_COMMAND;
569
569
  const envPort = process.env.CONVEYOR_PREVIEW_PORT;
570
570
  const envAuth = process.env.CONVEYOR_AUTH_TOKEN_COMMAND;
571
- if (envSetup || envStart || envAuth) {
571
+ if (envSetup || envStart) {
572
572
  return {
573
573
  setupCommand: envSetup,
574
574
  startCommand: envStart,
@@ -2110,27 +2110,27 @@ function buildSubtaskTools(connection, spDescription) {
2110
2110
  )
2111
2111
  ];
2112
2112
  }
2113
+ function buildUpdateTaskTool(connection) {
2114
+ return tool2(
2115
+ "update_task",
2116
+ "Save the finalized task plan and/or description",
2117
+ {
2118
+ plan: z2.string().optional().describe("The task plan in markdown"),
2119
+ description: z2.string().optional().describe("Updated task description")
2120
+ },
2121
+ async ({ plan, description }) => {
2122
+ try {
2123
+ await Promise.resolve(connection.updateTaskFields({ plan, description }));
2124
+ return textResult("Task updated successfully.");
2125
+ } catch {
2126
+ return textResult("Failed to update task.");
2127
+ }
2128
+ }
2129
+ );
2130
+ }
2113
2131
  function buildPmTools(connection, storyPoints, options) {
2114
2132
  const spDescription = buildStoryPointDescription(storyPoints);
2115
- const tools = [
2116
- tool2(
2117
- "update_task",
2118
- "Save the finalized task plan and/or description",
2119
- {
2120
- plan: z2.string().optional().describe("The task plan in markdown"),
2121
- description: z2.string().optional().describe("Updated task description")
2122
- },
2123
- async ({ plan, description }) => {
2124
- try {
2125
- await Promise.resolve(connection.updateTaskFields({ plan, description }));
2126
- return textResult("Task updated successfully.");
2127
- } catch {
2128
- return textResult("Failed to update task.");
2129
- }
2130
- }
2131
- ),
2132
- ...buildSubtaskTools(connection, spDescription)
2133
- ];
2133
+ const tools = [buildUpdateTaskTool(connection), ...buildSubtaskTools(connection, spDescription)];
2134
2134
  if (!options?.includePackTools) return tools;
2135
2135
  return [...tools, ...buildPackTools(connection)];
2136
2136
  }
@@ -2320,8 +2320,14 @@ function textResult(text) {
2320
2320
  function imageBlock(data, mimeType) {
2321
2321
  return { type: "image", data, mimeType };
2322
2322
  }
2323
+ function getTaskModeTools(agentMode, connection) {
2324
+ if (agentMode === "discovery" || agentMode === "auto") {
2325
+ return [buildUpdateTaskTool(connection)];
2326
+ }
2327
+ return [];
2328
+ }
2323
2329
  function getModeTools(agentMode, connection, config, context) {
2324
- if (config.mode === "task") return [];
2330
+ if (config.mode === "task") return getTaskModeTools(agentMode, connection);
2325
2331
  switch (agentMode) {
2326
2332
  case "building":
2327
2333
  return context?.isParentTask ? buildPmTools(connection, context?.storyPoints, { includePackTools: true }) : [];
@@ -2417,6 +2423,7 @@ function handleAutoToolAccess(toolName, input, hasExitedPlanMode, isParentTask)
2417
2423
  }
2418
2424
  async function handleExitPlanMode(host, input) {
2419
2425
  try {
2426
+ host.syncPlanFile();
2420
2427
  const taskProps = await host.connection.getTaskProperties();
2421
2428
  const missingProps = [];
2422
2429
  if (!taskProps.plan?.trim()) missingProps.push("plan (save via update_task)");
@@ -2661,7 +2668,8 @@ async function runSdkQuery(host, context, followUpContent) {
2661
2668
  if (host.isStopped()) return;
2662
2669
  const mode = host.agentMode;
2663
2670
  const isDiscoveryLike = mode === "discovery" || mode === "help";
2664
- if (isDiscoveryLike) {
2671
+ const needsPlanSync = isDiscoveryLike || mode === "auto" && !host.hasExitedPlanMode;
2672
+ if (needsPlanSync) {
2665
2673
  host.snapshotPlanFiles();
2666
2674
  }
2667
2675
  const options = buildQueryOptions(host, context);
@@ -2694,7 +2702,7 @@ async function runSdkQuery(host, context, followUpContent) {
2694
2702
  host.activeQuery = null;
2695
2703
  }
2696
2704
  }
2697
- if (isDiscoveryLike) {
2705
+ if (needsPlanSync) {
2698
2706
  host.syncPlanFile();
2699
2707
  }
2700
2708
  }
@@ -4107,4 +4115,4 @@ export {
4107
4115
  ProjectRunner,
4108
4116
  FileCache
4109
4117
  };
4110
- //# sourceMappingURL=chunk-WKW7LCC2.js.map
4118
+ //# sourceMappingURL=chunk-X2QE27GN.js.map