@rallycry/conveyor-agent 10.1.0 → 10.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2426,7 +2426,8 @@ var CreateSubtaskRequestSchema = z.object({
2426
2426
  description: z.string().optional(),
2427
2427
  plan: z.string().optional(),
2428
2428
  storyPointValue: z.number().int().positive().optional(),
2429
- ordinal: z.number().int().nonnegative().optional()
2429
+ ordinal: z.number().int().nonnegative().optional(),
2430
+ followParentStatus: z.boolean().optional()
2430
2431
  });
2431
2432
  var UpdateSubtaskRequestSchema = z.object({
2432
2433
  sessionId: z.string(),
@@ -2435,7 +2436,8 @@ var UpdateSubtaskRequestSchema = z.object({
2435
2436
  description: z.string().optional(),
2436
2437
  plan: z.string().optional(),
2437
2438
  status: z.string().optional(),
2438
- storyPointValue: z.number().int().positive().optional()
2439
+ storyPointValue: z.number().int().positive().optional(),
2440
+ followParentStatus: z.boolean().optional()
2439
2441
  });
2440
2442
  var DeleteSubtaskRequestSchema = z.object({
2441
2443
  sessionId: z.string(),
@@ -2768,6 +2770,25 @@ var StopProjectWorkspaceRequestSchema = z2.object({
2768
2770
  destroy: z2.boolean().optional(),
2769
2771
  requestingUserId: z2.string().optional()
2770
2772
  });
2773
+ var ListMyLiveSessionsRequestSchema = z2.object({
2774
+ projectId: z2.string()
2775
+ });
2776
+ var StartAdhocSessionRequestSchema = z2.object({
2777
+ projectId: z2.string(),
2778
+ label: z2.string().max(200).optional(),
2779
+ requestingUserId: z2.string().optional()
2780
+ });
2781
+ var StopAdhocSessionRequestSchema = z2.object({
2782
+ projectId: z2.string(),
2783
+ workspaceId: z2.string(),
2784
+ destroy: z2.boolean().optional(),
2785
+ requestingUserId: z2.string().optional()
2786
+ });
2787
+ var ResumeAdhocSessionRequestSchema = z2.object({
2788
+ projectId: z2.string(),
2789
+ workspaceId: z2.string(),
2790
+ requestingUserId: z2.string().optional()
2791
+ });
2771
2792
  var CreateProjectReleaseRequestSchema = z2.object({
2772
2793
  projectId: z2.string(),
2773
2794
  taskIds: z2.array(z2.string()).optional(),
@@ -2790,6 +2811,7 @@ var CreateProjectSubtaskRequestSchema = z2.object({
2790
2811
  plan: z2.string().optional(),
2791
2812
  ordinal: z2.number().int().nonnegative().optional(),
2792
2813
  storyPointValue: z2.number().int().positive().optional(),
2814
+ followParentStatus: z2.boolean().optional(),
2793
2815
  requestingUserId: z2.string().optional()
2794
2816
  });
2795
2817
  var UpdateProjectSubtaskRequestSchema = z2.object({
@@ -2801,6 +2823,7 @@ var UpdateProjectSubtaskRequestSchema = z2.object({
2801
2823
  status: z2.string().optional(),
2802
2824
  ordinal: z2.number().int().nonnegative().optional(),
2803
2825
  storyPointValue: z2.number().int().positive().optional(),
2826
+ followParentStatus: z2.boolean().optional(),
2804
2827
  requestingUserId: z2.string().optional()
2805
2828
  });
2806
2829
  var DeleteProjectSubtaskRequestSchema = z2.object({
@@ -3450,15 +3473,28 @@ function numberField(record, ...keys) {
3450
3473
  return void 0;
3451
3474
  }
3452
3475
  function mapSystem(record) {
3453
- if (record.subtype !== "init") return null;
3454
- const event = {
3455
- type: "system",
3456
- subtype: "init",
3457
- model: stringField(record, "model") ?? ""
3458
- };
3459
- const sessionId = stringField(record, "session_id", "sessionId");
3460
- if (sessionId !== void 0) event.session_id = sessionId;
3461
- return event;
3476
+ if (record.subtype === "init") {
3477
+ const event = {
3478
+ type: "system",
3479
+ subtype: "init",
3480
+ model: stringField(record, "model") ?? ""
3481
+ };
3482
+ const sessionId = stringField(record, "session_id", "sessionId");
3483
+ if (sessionId !== void 0) event.session_id = sessionId;
3484
+ return event;
3485
+ }
3486
+ if (record.subtype === "turn_duration") {
3487
+ const event = {
3488
+ type: "result",
3489
+ subtype: "success",
3490
+ result: "",
3491
+ total_cost_usd: 0
3492
+ };
3493
+ const sessionId = stringField(record, "session_id", "sessionId");
3494
+ if (sessionId !== void 0) event.sessionId = sessionId;
3495
+ return event;
3496
+ }
3497
+ return null;
3462
3498
  }
3463
3499
  function mapUsage(message) {
3464
3500
  const usage = message.usage;
@@ -3935,6 +3971,11 @@ var SUBMIT_NUDGE_INTERVAL_MS = 2e3;
3935
3971
  var SUBMIT_NUDGE_MAX_PRESSES = 5;
3936
3972
  var SUBMIT_NUDGE_SLOW_INTERVAL_MS = 5e3;
3937
3973
  var SUBMIT_NUDGE_WINDOW_MS = 9e4;
3974
+ var PLAN_DIALOG_FIRST_PRESS_MS = 700;
3975
+ var PLAN_DIALOG_INTERVAL_MS = 1500;
3976
+ var PLAN_DIALOG_SLOW_INTERVAL_MS = 5e3;
3977
+ var PLAN_DIALOG_FAST_WINDOW_MS = 1e4;
3978
+ var PLAN_DIALOG_WINDOW_MS = 9e4;
3938
3979
  function turnOptionsFrom(options) {
3939
3980
  return {
3940
3981
  canUseTool: options.canUseTool,
@@ -4457,6 +4498,9 @@ var PtySession = class {
4457
4498
  }
4458
4499
  }
4459
4500
  handleProgress(progress) {
4501
+ if (this.pendingPlanApproval && progress.tool_name === "ExitPlanMode") {
4502
+ this.disarmPlanDialogAutoAccept();
4503
+ }
4460
4504
  this.pushEvent({
4461
4505
  type: "tool_progress",
4462
4506
  ...progress.tool_name === void 0 ? {} : { tool_name: progress.tool_name },
@@ -4473,6 +4517,7 @@ var PtySession = class {
4473
4517
  async handlePreToolUse(request) {
4474
4518
  if (request.tool_name === "AskUserQuestion") {
4475
4519
  this.disarmSubmitNudge();
4520
+ this.disarmPlanDialogAutoAccept();
4476
4521
  this.pushEvent({
4477
4522
  type: "user_question",
4478
4523
  questions: parseUserQuestions(request.tool_input)
@@ -4494,34 +4539,50 @@ var PtySession = class {
4494
4539
  }
4495
4540
  /**
4496
4541
  * A hook "allow" does not bypass the CLI's plan-approval dialog — it renders
4497
- * right after the verdict. Press Enter (default: "Yes, auto-accept edits")
4498
- * until the turn resumes; the next transcript record only lands once the
4499
- * dialog is answered, so it doubles as the stop signal.
4542
+ * right after the verdict and parks the turn until answered. Press Enter
4543
+ * (default option approves) until the ExitPlanMode PostToolUse envelope
4544
+ * proves the dialog was answered (handleProgress), or the turn ends, over a
4545
+ * two-phase fast/slow window.
4546
+ *
4547
+ * Transcript records are deliberately NOT a stop signal: the CLI flushes the
4548
+ * assistant record holding the ExitPlanMode tool_use ~0.5s AFTER the
4549
+ * PreToolUse hook fires (verified live on 2.1.202), so when the Conveyor
4550
+ * verdict resolves quickly that record lands right after arming — a
4551
+ * record-based disarm then cancels the presses before the first one fires,
4552
+ * which is exactly the failure that parked auto cards on the approval
4553
+ * dialog until a human pressed Enter.
4500
4554
  */
4501
4555
  armPlanDialogAutoAccept() {
4502
- if (this.planApprovalTimer) return;
4556
+ if (this.pendingPlanApproval) return;
4503
4557
  this.pendingPlanApproval = true;
4504
- let presses = 0;
4558
+ const startedAt = Date.now();
4505
4559
  const press = () => {
4506
- if (this._toreDown || !this.pendingPlanApproval || presses >= 6) {
4560
+ if (this._toreDown || !this.pendingPlanApproval) return;
4561
+ const elapsed = Date.now() - startedAt;
4562
+ if (elapsed >= PLAN_DIALOG_WINDOW_MS) {
4563
+ process.stderr.write(
4564
+ "[PtySession] plan-dialog auto-accept window expired without ExitPlanMode executing \u2014 the approval dialog may still be parked\n"
4565
+ );
4507
4566
  this.disarmPlanDialogAutoAccept();
4508
4567
  return;
4509
4568
  }
4510
- presses++;
4511
4569
  this.writeStdin("\r");
4570
+ const interval = elapsed < PLAN_DIALOG_FAST_WINDOW_MS ? PLAN_DIALOG_INTERVAL_MS : PLAN_DIALOG_SLOW_INTERVAL_MS;
4571
+ this.planApprovalTimer = setTimeout(press, interval);
4512
4572
  };
4513
- this.planApprovalTimer = setInterval(press, 1500);
4514
- setTimeout(press, 700);
4573
+ this.planApprovalTimer = setTimeout(press, PLAN_DIALOG_FIRST_PRESS_MS);
4515
4574
  }
4516
4575
  disarmPlanDialogAutoAccept() {
4517
4576
  this.pendingPlanApproval = false;
4518
4577
  if (this.planApprovalTimer) {
4519
- clearInterval(this.planApprovalTimer);
4578
+ clearTimeout(this.planApprovalTimer);
4520
4579
  this.planApprovalTimer = null;
4521
4580
  }
4522
4581
  }
4523
4582
  handleTranscriptEvent(event) {
4524
- if (this.pendingPlanApproval) this.disarmPlanDialogAutoAccept();
4583
+ if (this.pendingPlanApproval && event.type === "result") {
4584
+ this.disarmPlanDialogAutoAccept();
4585
+ }
4525
4586
  if (this.pendingSubmitNudge) this.disarmSubmitNudge();
4526
4587
  this.pushEvent(event);
4527
4588
  if (event.type === "result") {
@@ -7107,6 +7168,7 @@ function buildCommonTools(connection, config) {
7107
7168
  // src/tools/pm-tools.ts
7108
7169
  import { z as z8 } from "zod";
7109
7170
  var SP_DESCRIPTION = "Story point value (1=Common, 2=Magic, 3=Rare, 5=Unique)";
7171
+ var FOLLOW_PARENT_STATUS_DESCRIPTION = "Child mirrors the parent task's status automatically \u2014 for subtasks that ship on the parent's branch/PR with no build or PR of their own. Manual status writes on a follower stick only until the parent's next transition.";
7110
7172
  function buildUpdateTaskTool(connection) {
7111
7173
  return defineTool(
7112
7174
  "update_task_plan",
@@ -7138,9 +7200,10 @@ function buildCreateSubtaskTool(connection) {
7138
7200
  description: z8.string().optional().describe("Brief description"),
7139
7201
  plan: z8.string().optional().describe("Implementation plan in markdown"),
7140
7202
  ordinal: z8.number().optional().describe("Step/order number (0-based)"),
7141
- storyPointValue: z8.number().optional().describe(SP_DESCRIPTION)
7203
+ storyPointValue: z8.number().optional().describe(SP_DESCRIPTION),
7204
+ followParentStatus: z8.boolean().optional().describe(FOLLOW_PARENT_STATUS_DESCRIPTION)
7142
7205
  },
7143
- async ({ title, description, plan, ordinal, storyPointValue }) => {
7206
+ async ({ title, description, plan, ordinal, storyPointValue, followParentStatus }) => {
7144
7207
  try {
7145
7208
  const result = await connection.call("createSubtask", {
7146
7209
  sessionId: connection.sessionId,
@@ -7148,7 +7211,8 @@ function buildCreateSubtaskTool(connection) {
7148
7211
  ...description !== void 0 && { description },
7149
7212
  ...plan !== void 0 && { plan },
7150
7213
  ...storyPointValue !== void 0 && { storyPointValue },
7151
- ...ordinal !== void 0 && { ordinal }
7214
+ ...ordinal !== void 0 && { ordinal },
7215
+ ...followParentStatus !== void 0 && { followParentStatus }
7152
7216
  });
7153
7217
  return textResult(`Subtask created with ID: ${result.id}`);
7154
7218
  } catch (error) {
@@ -7169,9 +7233,10 @@ function buildUpdateSubtaskTool(connection) {
7169
7233
  description: z8.string().optional(),
7170
7234
  plan: z8.string().optional(),
7171
7235
  ordinal: z8.number().optional(),
7172
- storyPointValue: z8.number().optional().describe(SP_DESCRIPTION)
7236
+ storyPointValue: z8.number().optional().describe(SP_DESCRIPTION),
7237
+ followParentStatus: z8.boolean().optional().describe(FOLLOW_PARENT_STATUS_DESCRIPTION)
7173
7238
  },
7174
- async ({ subtaskId, title, description, plan, storyPointValue }) => {
7239
+ async ({ subtaskId, title, description, plan, storyPointValue, followParentStatus }) => {
7175
7240
  try {
7176
7241
  await connection.call("updateSubtask", {
7177
7242
  sessionId: connection.sessionId,
@@ -7179,7 +7244,8 @@ function buildUpdateSubtaskTool(connection) {
7179
7244
  ...title !== void 0 && { title },
7180
7245
  ...description !== void 0 && { description },
7181
7246
  ...plan !== void 0 && { plan },
7182
- ...storyPointValue !== void 0 && { storyPointValue }
7247
+ ...storyPointValue !== void 0 && { storyPointValue },
7248
+ ...followParentStatus !== void 0 && { followParentStatus }
7183
7249
  });
7184
7250
  return textResult("Subtask updated.");
7185
7251
  } catch (error) {
@@ -10554,11 +10620,13 @@ function unshallowRepo(workspaceDir) {
10554
10620
  }
10555
10621
 
10556
10622
  export {
10623
+ DEFAULT_SONNET_MODEL,
10557
10624
  fetchBootstrap,
10558
10625
  applyBootstrapToEnv,
10559
10626
  AgentConnection,
10560
10627
  DEFAULT_LIFECYCLE_CONFIG,
10561
10628
  Lifecycle,
10629
+ PtyHarness,
10562
10630
  createServiceLogger,
10563
10631
  hasUncommittedChanges,
10564
10632
  getCurrentBranch,
@@ -10585,4 +10653,4 @@ export {
10585
10653
  runStartCommand,
10586
10654
  unshallowRepo
10587
10655
  };
10588
- //# sourceMappingURL=chunk-DAHP6JPD.js.map
10656
+ //# sourceMappingURL=chunk-EDEMOFUN.js.map