@rallycry/conveyor-agent 10.1.0 → 10.2.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.
@@ -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,27 @@ 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
+ /** Admin-only: list another member's sessions instead of the caller's. */
2776
+ targetUserId: z2.string().optional()
2777
+ });
2778
+ var StartAdhocSessionRequestSchema = z2.object({
2779
+ projectId: z2.string(),
2780
+ label: z2.string().max(200).optional(),
2781
+ requestingUserId: z2.string().optional()
2782
+ });
2783
+ var StopAdhocSessionRequestSchema = z2.object({
2784
+ projectId: z2.string(),
2785
+ workspaceId: z2.string(),
2786
+ destroy: z2.boolean().optional(),
2787
+ requestingUserId: z2.string().optional()
2788
+ });
2789
+ var ResumeAdhocSessionRequestSchema = z2.object({
2790
+ projectId: z2.string(),
2791
+ workspaceId: z2.string(),
2792
+ requestingUserId: z2.string().optional()
2793
+ });
2771
2794
  var CreateProjectReleaseRequestSchema = z2.object({
2772
2795
  projectId: z2.string(),
2773
2796
  taskIds: z2.array(z2.string()).optional(),
@@ -2790,6 +2813,7 @@ var CreateProjectSubtaskRequestSchema = z2.object({
2790
2813
  plan: z2.string().optional(),
2791
2814
  ordinal: z2.number().int().nonnegative().optional(),
2792
2815
  storyPointValue: z2.number().int().positive().optional(),
2816
+ followParentStatus: z2.boolean().optional(),
2793
2817
  requestingUserId: z2.string().optional()
2794
2818
  });
2795
2819
  var UpdateProjectSubtaskRequestSchema = z2.object({
@@ -2801,6 +2825,7 @@ var UpdateProjectSubtaskRequestSchema = z2.object({
2801
2825
  status: z2.string().optional(),
2802
2826
  ordinal: z2.number().int().nonnegative().optional(),
2803
2827
  storyPointValue: z2.number().int().positive().optional(),
2828
+ followParentStatus: z2.boolean().optional(),
2804
2829
  requestingUserId: z2.string().optional()
2805
2830
  });
2806
2831
  var DeleteProjectSubtaskRequestSchema = z2.object({
@@ -3450,15 +3475,28 @@ function numberField(record, ...keys) {
3450
3475
  return void 0;
3451
3476
  }
3452
3477
  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;
3478
+ if (record.subtype === "init") {
3479
+ const event = {
3480
+ type: "system",
3481
+ subtype: "init",
3482
+ model: stringField(record, "model") ?? ""
3483
+ };
3484
+ const sessionId = stringField(record, "session_id", "sessionId");
3485
+ if (sessionId !== void 0) event.session_id = sessionId;
3486
+ return event;
3487
+ }
3488
+ if (record.subtype === "turn_duration") {
3489
+ const event = {
3490
+ type: "result",
3491
+ subtype: "success",
3492
+ result: "",
3493
+ total_cost_usd: 0
3494
+ };
3495
+ const sessionId = stringField(record, "session_id", "sessionId");
3496
+ if (sessionId !== void 0) event.sessionId = sessionId;
3497
+ return event;
3498
+ }
3499
+ return null;
3462
3500
  }
3463
3501
  function mapUsage(message) {
3464
3502
  const usage = message.usage;
@@ -3935,6 +3973,11 @@ var SUBMIT_NUDGE_INTERVAL_MS = 2e3;
3935
3973
  var SUBMIT_NUDGE_MAX_PRESSES = 5;
3936
3974
  var SUBMIT_NUDGE_SLOW_INTERVAL_MS = 5e3;
3937
3975
  var SUBMIT_NUDGE_WINDOW_MS = 9e4;
3976
+ var PLAN_DIALOG_FIRST_PRESS_MS = 700;
3977
+ var PLAN_DIALOG_INTERVAL_MS = 1500;
3978
+ var PLAN_DIALOG_SLOW_INTERVAL_MS = 5e3;
3979
+ var PLAN_DIALOG_FAST_WINDOW_MS = 1e4;
3980
+ var PLAN_DIALOG_WINDOW_MS = 9e4;
3938
3981
  function turnOptionsFrom(options) {
3939
3982
  return {
3940
3983
  canUseTool: options.canUseTool,
@@ -4457,6 +4500,9 @@ var PtySession = class {
4457
4500
  }
4458
4501
  }
4459
4502
  handleProgress(progress) {
4503
+ if (this.pendingPlanApproval && progress.tool_name === "ExitPlanMode") {
4504
+ this.disarmPlanDialogAutoAccept();
4505
+ }
4460
4506
  this.pushEvent({
4461
4507
  type: "tool_progress",
4462
4508
  ...progress.tool_name === void 0 ? {} : { tool_name: progress.tool_name },
@@ -4473,6 +4519,7 @@ var PtySession = class {
4473
4519
  async handlePreToolUse(request) {
4474
4520
  if (request.tool_name === "AskUserQuestion") {
4475
4521
  this.disarmSubmitNudge();
4522
+ this.disarmPlanDialogAutoAccept();
4476
4523
  this.pushEvent({
4477
4524
  type: "user_question",
4478
4525
  questions: parseUserQuestions(request.tool_input)
@@ -4494,34 +4541,50 @@ var PtySession = class {
4494
4541
  }
4495
4542
  /**
4496
4543
  * 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.
4544
+ * right after the verdict and parks the turn until answered. Press Enter
4545
+ * (default option approves) until the ExitPlanMode PostToolUse envelope
4546
+ * proves the dialog was answered (handleProgress), or the turn ends, over a
4547
+ * two-phase fast/slow window.
4548
+ *
4549
+ * Transcript records are deliberately NOT a stop signal: the CLI flushes the
4550
+ * assistant record holding the ExitPlanMode tool_use ~0.5s AFTER the
4551
+ * PreToolUse hook fires (verified live on 2.1.202), so when the Conveyor
4552
+ * verdict resolves quickly that record lands right after arming — a
4553
+ * record-based disarm then cancels the presses before the first one fires,
4554
+ * which is exactly the failure that parked auto cards on the approval
4555
+ * dialog until a human pressed Enter.
4500
4556
  */
4501
4557
  armPlanDialogAutoAccept() {
4502
- if (this.planApprovalTimer) return;
4558
+ if (this.pendingPlanApproval) return;
4503
4559
  this.pendingPlanApproval = true;
4504
- let presses = 0;
4560
+ const startedAt = Date.now();
4505
4561
  const press = () => {
4506
- if (this._toreDown || !this.pendingPlanApproval || presses >= 6) {
4562
+ if (this._toreDown || !this.pendingPlanApproval) return;
4563
+ const elapsed = Date.now() - startedAt;
4564
+ if (elapsed >= PLAN_DIALOG_WINDOW_MS) {
4565
+ process.stderr.write(
4566
+ "[PtySession] plan-dialog auto-accept window expired without ExitPlanMode executing \u2014 the approval dialog may still be parked\n"
4567
+ );
4507
4568
  this.disarmPlanDialogAutoAccept();
4508
4569
  return;
4509
4570
  }
4510
- presses++;
4511
4571
  this.writeStdin("\r");
4572
+ const interval = elapsed < PLAN_DIALOG_FAST_WINDOW_MS ? PLAN_DIALOG_INTERVAL_MS : PLAN_DIALOG_SLOW_INTERVAL_MS;
4573
+ this.planApprovalTimer = setTimeout(press, interval);
4512
4574
  };
4513
- this.planApprovalTimer = setInterval(press, 1500);
4514
- setTimeout(press, 700);
4575
+ this.planApprovalTimer = setTimeout(press, PLAN_DIALOG_FIRST_PRESS_MS);
4515
4576
  }
4516
4577
  disarmPlanDialogAutoAccept() {
4517
4578
  this.pendingPlanApproval = false;
4518
4579
  if (this.planApprovalTimer) {
4519
- clearInterval(this.planApprovalTimer);
4580
+ clearTimeout(this.planApprovalTimer);
4520
4581
  this.planApprovalTimer = null;
4521
4582
  }
4522
4583
  }
4523
4584
  handleTranscriptEvent(event) {
4524
- if (this.pendingPlanApproval) this.disarmPlanDialogAutoAccept();
4585
+ if (this.pendingPlanApproval && event.type === "result") {
4586
+ this.disarmPlanDialogAutoAccept();
4587
+ }
4525
4588
  if (this.pendingSubmitNudge) this.disarmSubmitNudge();
4526
4589
  this.pushEvent(event);
4527
4590
  if (event.type === "result") {
@@ -7107,6 +7170,7 @@ function buildCommonTools(connection, config) {
7107
7170
  // src/tools/pm-tools.ts
7108
7171
  import { z as z8 } from "zod";
7109
7172
  var SP_DESCRIPTION = "Story point value (1=Common, 2=Magic, 3=Rare, 5=Unique)";
7173
+ 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
7174
  function buildUpdateTaskTool(connection) {
7111
7175
  return defineTool(
7112
7176
  "update_task_plan",
@@ -7138,9 +7202,10 @@ function buildCreateSubtaskTool(connection) {
7138
7202
  description: z8.string().optional().describe("Brief description"),
7139
7203
  plan: z8.string().optional().describe("Implementation plan in markdown"),
7140
7204
  ordinal: z8.number().optional().describe("Step/order number (0-based)"),
7141
- storyPointValue: z8.number().optional().describe(SP_DESCRIPTION)
7205
+ storyPointValue: z8.number().optional().describe(SP_DESCRIPTION),
7206
+ followParentStatus: z8.boolean().optional().describe(FOLLOW_PARENT_STATUS_DESCRIPTION)
7142
7207
  },
7143
- async ({ title, description, plan, ordinal, storyPointValue }) => {
7208
+ async ({ title, description, plan, ordinal, storyPointValue, followParentStatus }) => {
7144
7209
  try {
7145
7210
  const result = await connection.call("createSubtask", {
7146
7211
  sessionId: connection.sessionId,
@@ -7148,7 +7213,8 @@ function buildCreateSubtaskTool(connection) {
7148
7213
  ...description !== void 0 && { description },
7149
7214
  ...plan !== void 0 && { plan },
7150
7215
  ...storyPointValue !== void 0 && { storyPointValue },
7151
- ...ordinal !== void 0 && { ordinal }
7216
+ ...ordinal !== void 0 && { ordinal },
7217
+ ...followParentStatus !== void 0 && { followParentStatus }
7152
7218
  });
7153
7219
  return textResult(`Subtask created with ID: ${result.id}`);
7154
7220
  } catch (error) {
@@ -7169,9 +7235,10 @@ function buildUpdateSubtaskTool(connection) {
7169
7235
  description: z8.string().optional(),
7170
7236
  plan: z8.string().optional(),
7171
7237
  ordinal: z8.number().optional(),
7172
- storyPointValue: z8.number().optional().describe(SP_DESCRIPTION)
7238
+ storyPointValue: z8.number().optional().describe(SP_DESCRIPTION),
7239
+ followParentStatus: z8.boolean().optional().describe(FOLLOW_PARENT_STATUS_DESCRIPTION)
7173
7240
  },
7174
- async ({ subtaskId, title, description, plan, storyPointValue }) => {
7241
+ async ({ subtaskId, title, description, plan, storyPointValue, followParentStatus }) => {
7175
7242
  try {
7176
7243
  await connection.call("updateSubtask", {
7177
7244
  sessionId: connection.sessionId,
@@ -7179,7 +7246,8 @@ function buildUpdateSubtaskTool(connection) {
7179
7246
  ...title !== void 0 && { title },
7180
7247
  ...description !== void 0 && { description },
7181
7248
  ...plan !== void 0 && { plan },
7182
- ...storyPointValue !== void 0 && { storyPointValue }
7249
+ ...storyPointValue !== void 0 && { storyPointValue },
7250
+ ...followParentStatus !== void 0 && { followParentStatus }
7183
7251
  });
7184
7252
  return textResult("Subtask updated.");
7185
7253
  } catch (error) {
@@ -10554,11 +10622,13 @@ function unshallowRepo(workspaceDir) {
10554
10622
  }
10555
10623
 
10556
10624
  export {
10625
+ DEFAULT_SONNET_MODEL,
10557
10626
  fetchBootstrap,
10558
10627
  applyBootstrapToEnv,
10559
10628
  AgentConnection,
10560
10629
  DEFAULT_LIFECYCLE_CONFIG,
10561
10630
  Lifecycle,
10631
+ PtyHarness,
10562
10632
  createServiceLogger,
10563
10633
  hasUncommittedChanges,
10564
10634
  getCurrentBranch,
@@ -10585,4 +10655,4 @@ export {
10585
10655
  runStartCommand,
10586
10656
  unshallowRepo
10587
10657
  };
10588
- //# sourceMappingURL=chunk-DAHP6JPD.js.map
10658
+ //# sourceMappingURL=chunk-YGLTLUGA.js.map