@rallycry/conveyor-agent 10.4.4 → 10.6.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.
package/dist/index.d.ts CHANGED
@@ -46,6 +46,19 @@ interface SpawnReviewData {
46
46
  prNumber?: number | null;
47
47
  checkoutRef?: string | null;
48
48
  }
49
+ /**
50
+ * Server push asking the builder pod to spawn an extra interactive child on
51
+ * this pod: a second Claude TUI (mode "adhoc") or a raw login shell (mode
52
+ * "shell"), each bound to a fresh WorkspaceSession (sessionId + sessionJwt).
53
+ * No taskId on the wire — the child inherits the parent's CONVEYOR_TASK_ID
54
+ * and the server derives it from the JWT (SEC-9).
55
+ */
56
+ interface SpawnTuiData {
57
+ sessionId: string;
58
+ sessionJwt: string;
59
+ mode: "adhoc" | "shell";
60
+ projectId: string;
61
+ }
49
62
  declare class AgentConnection {
50
63
  private socket;
51
64
  private readonly config;
@@ -75,6 +88,8 @@ declare class AgentConnection {
75
88
  private earlyPullBranches;
76
89
  private spawnReviewCallback;
77
90
  private earlySpawnReviews;
91
+ private spawnTuiCallback;
92
+ private earlySpawnTuis;
78
93
  private ptyInputCallback;
79
94
  private ptyResizeCallback;
80
95
  constructor(config: AgentConnectionConfig);
@@ -132,6 +147,13 @@ declare class AgentConnection {
132
147
  * it; the review session is identified separately.
133
148
  */
134
149
  reportReviewSpawnFailure(reviewSessionId: string, error?: string): void;
150
+ onSpawnTui(callback: (data: SpawnTuiData) => void): void;
151
+ /**
152
+ * Report that a same-pod TUI/shell child failed to spawn (fire-and-forget).
153
+ * The server Ends the orphaned session — no fallback pod (unlike review).
154
+ * sessionId is OUR (builder) session — the SEC-9 guard runs on it.
155
+ */
156
+ reportSessionSpawnFailure(spawnedSessionId: string, error?: string): void;
135
157
  onFinalizeSnapshot(callback: () => void): void;
136
158
  onRunStartCommand(callback: () => void): void;
137
159
  /**
@@ -282,24 +304,16 @@ declare class ModeController {
282
304
  /** Resolve the initial mode based on task context */
283
305
  resolveInitialMode(context: ModeTaskContext): AgentMode;
284
306
  /**
285
- * An auto task that still NEEDS PLANNING (no plan saved, pre-build status, no
286
- * PR see `taskNeedsPlanning` in @project/shared) runs the read-only plan turn
287
- * first (`--permission-mode plan`): resolveInitialMode leaves it in `auto` with
288
- * `_hasExitedPlanMode = false`, and once the agent finishes it calls
289
- * ExitPlanMode building. Everything else bypasses planning and builds
290
- * immediately with `--dangerously-skip-permissions`:
291
- *
292
- * - a plan already on the card (e.g. a Planning card planned by a human/PM),
293
- * - a build already underway (status past `Planning`/`Open` — releases booted
294
- * `InProgress`, pod restarts mid-build where DB `agentMode` stays `"auto"`),
295
- * - a PR already open (safety net if status lags).
296
- *
297
- * Runtime Build-after-Discovery never reaches this gate as `auto` — the server's
298
- * `resolveModeToSend` rewrites it to `"building"` for any task with a plan.
307
+ * Auto mode always bypasses the plan turn: resolveInitialMode calls
308
+ * transitionToBuilding() at boot, so the agent runs with
309
+ * `--dangerously-skip-permissions` from turn 1 and documents its plan into
310
+ * the card (via update_task_plan) as the approach firms up — non-blocking,
311
+ * never a gate. Use discovery mode for a plan turn that stops for human
312
+ * approval. Non-auto modes never bypass.
299
313
  */
300
- canBypassPlanning(context: ModeTaskContext): boolean;
314
+ canBypassPlanning(_context: ModeTaskContext): boolean;
301
315
  /** Handle mode change from server */
302
- handleModeChange(newMode: AgentMode, context?: ModeTaskContext | null): ModeAction;
316
+ handleModeChange(newMode: AgentMode, _context?: ModeTaskContext | null): ModeAction;
303
317
  /** Handle ExitPlanMode call from the agent */
304
318
  handleExitPlanMode(context: ModeTaskContext): ModeAction;
305
319
  /** Check if pack runner behavior should be used */
@@ -527,8 +541,8 @@ declare class SessionRunner {
527
541
  /** The build-phase nudge (In Progress, no PR). Offers BOTH escape routes so
528
542
  * the agent never just goes idle. */
529
543
  private static readonly STUCK_PROMPT;
530
- /** The planning-phase nudge (still Planning, identification/plan unfinished).
531
- * Same two-escape-route shape, aimed at finishing discovery instead of a PR. */
544
+ /** The pre-build nudge (still Planning/Open, identification/plan unfinished).
545
+ * Same two-escape-route shape, aimed at landing the plan + continuing to build. */
532
546
  private static readonly STUCK_PROMPT_PLANNING;
533
547
  /**
534
548
  * Classify how an auto task is "stuck" after its turn ended (call sites run
@@ -539,11 +553,12 @@ declare class SessionRunner {
539
553
  *
540
554
  * - "pr": In Progress with no open PR (build finished without shipping).
541
555
  * - "planning": still in a pre-build status (Planning/Open) without
542
- * (identified + saved plan). A fresh auto agent that finishes its plan turn
543
- * WITHOUT ExitPlanMode would otherwise idle clean-exit its session Ends
544
- * the workspace is reaped "agent_gone" before a plan ever landed. Nudging
545
- * (and, on exhaustion, going dormant) keeps the session Active so the pod
546
- * is never prematurely slept.
556
+ * (identified + saved plan) e.g. the server-side InProgress bump failed
557
+ * and the agent idled before documenting its plan. An agent that idles
558
+ * here would otherwise clean-exit its session Ends the workspace is
559
+ * reaped "agent_gone" before a plan ever landed. Nudging (and, on
560
+ * exhaustion, going dormant) keeps the session Active so the pod is never
561
+ * prematurely slept.
547
562
  */
548
563
  private autoStuckKind;
549
564
  private isAutoStuck;
package/dist/index.js CHANGED
@@ -20,7 +20,7 @@ import {
20
20
  unshallowRepo,
21
21
  updateRemoteToken,
22
22
  uploadSnapshotToGcs
23
- } from "./chunk-VCXKVINO.js";
23
+ } from "./chunk-5FRDOFI4.js";
24
24
  import "./chunk-7TQO4ZF4.js";
25
25
 
26
26
  // src/runner/worktree.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rallycry/conveyor-agent",
3
- "version": "10.4.4",
3
+ "version": "10.6.0",
4
4
  "description": "Conveyor Agent Runner v10 - PTY harness for the task chat (SDK harness for audit/project-chat). Agent-as-User architecture with BaseService patterns. Works locally too.",
5
5
  "keywords": [
6
6
  "agent",