@cluesmith/codev 3.3.0 → 3.3.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.
Files changed (119) hide show
  1. package/dashboard-dist/assets/{index-JCbkpAcV.js → index-D3XaKpZW.js} +45 -43
  2. package/dashboard-dist/assets/index-D3XaKpZW.js.map +1 -0
  3. package/dashboard-dist/index.html +1 -1
  4. package/dist/agent-farm/cli.d.ts.map +1 -1
  5. package/dist/agent-farm/cli.js +63 -51
  6. package/dist/agent-farm/cli.js.map +1 -1
  7. package/dist/agent-farm/commands/reset/constants.d.ts +1 -1
  8. package/dist/agent-farm/commands/reset/constants.js +1 -1
  9. package/dist/agent-farm/commands/reset/context.d.ts +2 -2
  10. package/dist/agent-farm/commands/reset/context.js +3 -3
  11. package/dist/agent-farm/commands/reset/context.js.map +1 -1
  12. package/dist/agent-farm/commands/reset/index.d.ts +7 -7
  13. package/dist/agent-farm/commands/reset/index.js +8 -8
  14. package/dist/agent-farm/commands/reset/index.js.map +1 -1
  15. package/dist/agent-farm/commands/reset/receipt.d.ts +1 -1
  16. package/dist/agent-farm/commands/reset/receipt.js +4 -4
  17. package/dist/agent-farm/commands/reset/receipt.js.map +1 -1
  18. package/dist/agent-farm/commands/reset/reorient.d.ts +1 -1
  19. package/dist/agent-farm/commands/reset/reorient.d.ts.map +1 -1
  20. package/dist/agent-farm/commands/reset/reorient.js +4 -4
  21. package/dist/agent-farm/commands/reset/reorient.js.map +1 -1
  22. package/dist/agent-farm/commands/reset.d.ts +18 -3
  23. package/dist/agent-farm/commands/reset.d.ts.map +1 -1
  24. package/dist/agent-farm/commands/reset.js +32 -15
  25. package/dist/agent-farm/commands/reset.js.map +1 -1
  26. package/dist/agent-farm/commands/spawn-worktree.js +1 -1
  27. package/dist/agent-farm/commands/spawn-worktree.js.map +1 -1
  28. package/dist/agent-farm/commands/tower.d.ts.map +1 -1
  29. package/dist/agent-farm/commands/tower.js +13 -0
  30. package/dist/agent-farm/commands/tower.js.map +1 -1
  31. package/dist/agent-farm/lib/reconnect-backoff.d.ts +10 -0
  32. package/dist/agent-farm/lib/reconnect-backoff.d.ts.map +1 -1
  33. package/dist/agent-farm/lib/reconnect-backoff.js +10 -0
  34. package/dist/agent-farm/lib/reconnect-backoff.js.map +1 -1
  35. package/dist/agent-farm/lib/tunnel-client.d.ts.map +1 -1
  36. package/dist/agent-farm/lib/tunnel-client.js +7 -3
  37. package/dist/agent-farm/lib/tunnel-client.js.map +1 -1
  38. package/dist/agent-farm/servers/canvas-relay.d.ts +60 -0
  39. package/dist/agent-farm/servers/canvas-relay.d.ts.map +1 -0
  40. package/dist/agent-farm/servers/canvas-relay.js +376 -0
  41. package/dist/agent-farm/servers/canvas-relay.js.map +1 -0
  42. package/dist/agent-farm/servers/gate-profiles.d.ts +1 -1
  43. package/dist/agent-farm/servers/gate-profiles.js +1 -1
  44. package/dist/agent-farm/servers/mailbox-wiring.d.ts +1 -1
  45. package/dist/agent-farm/servers/mailbox-wiring.js +1 -1
  46. package/dist/agent-farm/servers/overview.d.ts +19 -0
  47. package/dist/agent-farm/servers/overview.d.ts.map +1 -1
  48. package/dist/agent-farm/servers/overview.js +78 -1
  49. package/dist/agent-farm/servers/overview.js.map +1 -1
  50. package/dist/agent-farm/servers/session-submit.d.ts +1 -1
  51. package/dist/agent-farm/servers/session-submit.js +1 -1
  52. package/dist/agent-farm/servers/tower-routes.d.ts.map +1 -1
  53. package/dist/agent-farm/servers/tower-routes.js +157 -41
  54. package/dist/agent-farm/servers/tower-routes.js.map +1 -1
  55. package/dist/agent-farm/servers/tower-server.js +25 -3
  56. package/dist/agent-farm/servers/tower-server.js.map +1 -1
  57. package/dist/agent-farm/servers/tower-terminals.d.ts +6 -0
  58. package/dist/agent-farm/servers/tower-terminals.d.ts.map +1 -1
  59. package/dist/agent-farm/servers/tower-terminals.js +30 -5
  60. package/dist/agent-farm/servers/tower-terminals.js.map +1 -1
  61. package/dist/agent-farm/servers/tower-websocket.d.ts +6 -1
  62. package/dist/agent-farm/servers/tower-websocket.d.ts.map +1 -1
  63. package/dist/agent-farm/servers/tower-websocket.js +90 -37
  64. package/dist/agent-farm/servers/tower-websocket.js.map +1 -1
  65. package/dist/agent-farm/types.d.ts +1 -1
  66. package/dist/agent-farm/utils/harness.d.ts +3 -3
  67. package/dist/agent-farm/utils/harness.js +1 -1
  68. package/dist/agent-farm/utils/message-format.d.ts +8 -0
  69. package/dist/agent-farm/utils/message-format.d.ts.map +1 -1
  70. package/dist/agent-farm/utils/message-format.js +20 -0
  71. package/dist/agent-farm/utils/message-format.js.map +1 -1
  72. package/dist/agent-farm/utils/server-utils.d.ts +80 -4
  73. package/dist/agent-farm/utils/server-utils.d.ts.map +1 -1
  74. package/dist/agent-farm/utils/server-utils.js +286 -5
  75. package/dist/agent-farm/utils/server-utils.js.map +1 -1
  76. package/dist/lib/forge-contracts.d.ts +9 -0
  77. package/dist/lib/forge-contracts.d.ts.map +1 -1
  78. package/dist/lib/forge-contracts.js.map +1 -1
  79. package/dist/lib/github.d.ts +15 -1
  80. package/dist/lib/github.d.ts.map +1 -1
  81. package/dist/lib/github.js +17 -0
  82. package/dist/lib/github.js.map +1 -1
  83. package/dist/terminal/attach-replay.d.ts +39 -0
  84. package/dist/terminal/attach-replay.d.ts.map +1 -0
  85. package/dist/terminal/attach-replay.js +76 -0
  86. package/dist/terminal/attach-replay.js.map +1 -0
  87. package/dist/terminal/pty-manager.d.ts.map +1 -1
  88. package/dist/terminal/pty-manager.js +35 -17
  89. package/dist/terminal/pty-manager.js.map +1 -1
  90. package/dist/terminal/pty-session.d.ts +81 -12
  91. package/dist/terminal/pty-session.d.ts.map +1 -1
  92. package/dist/terminal/pty-session.js +113 -25
  93. package/dist/terminal/pty-session.js.map +1 -1
  94. package/dist/terminal/session-screen.d.ts +25 -0
  95. package/dist/terminal/session-screen.d.ts.map +1 -1
  96. package/dist/terminal/session-screen.js +53 -8
  97. package/dist/terminal/session-screen.js.map +1 -1
  98. package/package.json +10 -7
  99. package/scripts/forge/gitea/pr-view.sh +4 -1
  100. package/scripts/forge/github/pr-view.sh +1 -1
  101. package/scripts/forge/gitlab/pr-view.sh +4 -1
  102. package/skeleton/.claude/skills/afx/SKILL.md +54 -0
  103. package/skeleton/.codex/skills/afx/SKILL.md +54 -0
  104. package/skeleton/protocols/pir/builder-prompt.md +3 -2
  105. package/skeleton/protocols/pir/prompts/implement.md +1 -1
  106. package/skeleton/protocols/pir/prompts/plan.md +1 -1
  107. package/skeleton/protocols/pir/prompts/review.md +1 -1
  108. package/skeleton/protocols/pir/protocol.md +4 -4
  109. package/skeleton/resources/commands/agent-farm.md +14 -11
  110. package/skeleton/roles/builder.md +3 -4
  111. package/templates/3d-viewer.html +32 -4
  112. package/templates/open.html +58 -12
  113. package/templates/tower.html +26 -7
  114. package/templates/vendor/three-3MFLoader.js +1478 -0
  115. package/templates/vendor/three-STLLoader.js +410 -0
  116. package/templates/vendor/three-TrackballControls.js +828 -0
  117. package/templates/vendor/three-fflate.module.js +2474 -0
  118. package/templates/vendor/three.module.js +53044 -0
  119. package/dashboard-dist/assets/index-JCbkpAcV.js.map +0 -1
@@ -40,6 +40,14 @@ export const QUIESCENCE_DEBOUNCE_MS = 500;
40
40
  * successful recovery always lands before the teardown fires.
41
41
  */
42
42
  export const SHELLPER_CLOSE_GRACE_MS = 15_000;
43
+ /**
44
+ * Bound on {@link PtySession.replaySnapshot}'s flush-until-quiescent loop. Each retry
45
+ * means output arrived during the previous parser flush; three consecutive busy flushes
46
+ * (each typically <100ms even for MB-scale backlogs) indicate a pathologically streaming
47
+ * session, for which the raw-tail fallback (whose correctness the client nudge already
48
+ * recovers) is the right answer rather than an unbounded wait (PIR #1354).
49
+ */
50
+ export const REPLAY_FLUSH_ATTEMPTS = 3;
43
51
  export class PtySession extends EventEmitter {
44
52
  config;
45
53
  id;
@@ -123,8 +131,17 @@ export class PtySession extends EventEmitter {
123
131
  * Attach a shellper client as the I/O backend instead of node-pty.
124
132
  * Data flows: shellper → ring buffer → WebSocket clients.
125
133
  * User input flows: WebSocket → write() → shellper.
134
+ *
135
+ * `mirrorSeed` (PIR #1354): the UNCAPPED replay for the screen mirror, when the
136
+ * caller capped `replayData` for the ring (`capRingSeed`). The two seeds diverge
137
+ * deliberately — ring contents are shipped raw to clients only on the fallback
138
+ * path, so the 1 MiB client-payload cap stays; the mirror folds its seed into a
139
+ * fixed-size grid, so feeding it the full (wire-capped, ≤8 MB) history costs
140
+ * bounded parse time and shrinks the #1361 born-torn window from 1 MiB to the
141
+ * shellper's whole retention. Omitted → the mirror gets `replayData`, i.e. the
142
+ * pre-#1354 behavior (fresh spawns, whose replay is never capped).
126
143
  */
127
- attachShellper(client, replayData, shellperPid, shellperSessionId) {
144
+ attachShellper(client, replayData, shellperPid, shellperSessionId, mirrorSeed) {
128
145
  // Idempotent re-attach (Issue #1047 Fix E): if a previous client is still
129
146
  // attached, drop our listeners on it before subscribing to the new one so
130
147
  // a re-attach can't double the per-byte data fan-out (each leaked 'data'
@@ -157,15 +174,19 @@ export class PtySession extends EventEmitter {
157
174
  fs.mkdirSync(path.dirname(this.logPath), { recursive: true });
158
175
  this.logFd = fs.openSync(this.logPath, 'a');
159
176
  }
160
- // Populate ring buffer with replay data from shellper, and seed the gate mirror with
161
- // the SAME bytes (Spec 1313 render-gate round 2) so it reflects the session's history
162
- // from the moment Tower (re)attaches — a mirror seeded only from live output after this
163
- // point would be born torn. Fed through the shared feedGateScreen so it and
164
- // `ringBuffer.bytesWritten` (the gate's change token) advance together.
177
+ // Populate the ring buffer and seed the screen mirror so both reflect the session's
178
+ // history from the moment Tower (re)attaches — a mirror seeded only from live output
179
+ // after this point would be born torn (Spec 1313 render-gate round 2). The mirror may
180
+ // receive a LONGER seed than the ring (see `mirrorSeed` above); that superset is safe
181
+ // for the `bytesWritten` token protocol, which only ever compares the token against
182
+ // itself across a flush — every LIVE byte after this point still feeds both in
183
+ // lockstep via onPtyData.
165
184
  if (replayData.length > 0) {
166
- const replay = replayData.toString('utf-8');
167
- this.ringBuffer.pushData(replay);
168
- this.feedGateScreen(replay);
185
+ this.ringBuffer.pushData(replayData.toString('utf-8'));
186
+ }
187
+ const screenSeed = mirrorSeed ?? replayData;
188
+ if (screenSeed.length > 0) {
189
+ this.feedGateScreen(screenSeed.toString('utf-8'));
169
190
  }
170
191
  // Forward shellper data to ring buffer + WebSocket clients
171
192
  client.on('data', (buf) => {
@@ -364,16 +385,16 @@ export class PtySession extends EventEmitter {
364
385
  }
365
386
  /**
366
387
  * Fold one output chunk into the persistent gate mirror (Spec 1313 render-gate round 2),
367
- * creating it lazily on the first byte. Called at EVERY point the ring buffer is fed —
368
- * `onPtyData` (live output) and the `attachShellper` replay seed — with the SAME bytes, so
388
+ * creating it lazily on the first byte. Called at EVERY point the mirror is fed —
389
+ * `onPtyData` (live output, in lockstep with the ring) and the `attachShellper` seed — so
369
390
  * the mirror's rendered screen and `ringBuffer.bytesWritten` (the gate's monotone change
370
- * token) can never drift apart. Creating it on the first byte (not at construction) means a
371
- * session that never emits output costs nothing, while any session that does is mirrored from its
372
- * very first LIVE byte. NOTE: the `attachShellper` seed is the reconnect/adopt REPLAY, which
373
- * `tower-terminals.ts` caps to the last 1 MiB (`capRingSeed`); a long-lived alt-screen frame whose
374
- * coherent start predates that tail is seeded born-torn → the gate HOLDS (fail-safe) until the next
375
- * repaint/viewer nudge heals it. Pre-existing, not a round-2 regression (the pre-round-2 whole-ring
376
- * gate classified that same capped seed); tracked as a fast-follow, #1361.
391
+ * token) can never drift apart on the live path. Creating it on the first byte (not at
392
+ * construction) means a session that never emits output costs nothing, while any session
393
+ * that does is mirrored from its very first LIVE byte. On adopt/reconnect the seed is the
394
+ * FULL shellper replay (≤8 MB wire cap), not the ring's 1 MiB `capRingSeed` tail
395
+ * (PIR #1354) — so a long-lived alt-screen frame is only born torn when its coherent
396
+ * start predates the shellper's whole retention (#1361's residual case); the gate then
397
+ * HOLDS (fail-safe) until the next repaint heals it.
377
398
  */
378
399
  feedGateScreen(data) {
379
400
  if (!this._gateScreen)
@@ -510,24 +531,91 @@ export class PtySession extends EventEmitter {
510
531
  }
511
532
  this.cleanup();
512
533
  }
513
- /** Attach a WebSocket client. Returns ring buffer contents for replay. */
514
- attach(client) {
534
+ /**
535
+ * Register a live client for output broadcast without producing any replay.
536
+ * The replay-payload decision (snapshot vs raw lines) belongs to the attach
537
+ * path (PIR #1354); this is the shared registration step every variant uses.
538
+ */
539
+ addClient(client) {
515
540
  this.clients.add(client);
516
541
  if (this.disconnectTimer) {
517
542
  clearTimeout(this.disconnectTimer);
518
543
  this.disconnectTimer = null;
519
544
  }
545
+ }
546
+ /** Attach a WebSocket client. Returns ring buffer contents for replay. */
547
+ attach(client) {
548
+ this.addClient(client);
520
549
  return this.ringBuffer.getAll();
521
550
  }
522
551
  /** Attach with resume from a specific sequence number. */
523
552
  attachResume(client, sinceSeq) {
524
- this.clients.add(client);
525
- if (this.disconnectTimer) {
526
- clearTimeout(this.disconnectTimer);
527
- this.disconnectTimer = null;
528
- }
553
+ this.addClient(client);
529
554
  return this.ringBuffer.getSince(sinceSeq);
530
555
  }
556
+ /**
557
+ * Which buffer the session's emulated screen is in: 'alternate' means a
558
+ * full-screen TUI, the case whose reconnect is unservable from the line ring
559
+ * (a caught-up client's delta resume returns [] — `ring-buffer.ts` getSince)
560
+ * and so must be served the snapshot. Null before the first output byte and
561
+ * after teardown.
562
+ */
563
+ get screenBufferType() {
564
+ if (!this._gateScreen)
565
+ return null;
566
+ return this._gateScreen.bufferType;
567
+ }
568
+ /**
569
+ * Produce the O(screen) viewer-attach replay payload from the session's mirror
570
+ * (PIR #1354): the serialized current screen plus bounded scrollback, replacing
571
+ * the raw ring-tail replay whose truncation the client-side resize nudge papered
572
+ * over. Does NOT attach the client — the caller must, and the split is what makes
573
+ * the byte partition airtight:
574
+ *
575
+ * The flush loop samples `ringBuffer.bytesWritten` (the same monotone token the
576
+ * render gate uses), flushes the mirror's parser, and re-checks; an unchanged token
577
+ * proves every byte ever fed is parsed into the grid. Serialization then happens
578
+ * synchronously, and the caller's continuation (token re-check + `addClient` +
579
+ * replay send) runs in a microtask — PTY output only arrives via I/O macrotasks, so
580
+ * nothing can interleave before the client is attached. Every output byte is
581
+ * therefore either in the snapshot or broadcast live to the attached client:
582
+ * no gap, no duplication.
583
+ *
584
+ * Failure never degrades availability: callers fall back to the raw-ring replay
585
+ * (today's behavior, nudge-recovered), logging the `reason`.
586
+ */
587
+ async replaySnapshot() {
588
+ const screen = this._gateScreen;
589
+ if (!screen) {
590
+ // Lazily created on the first output byte, so no mirror simply means a
591
+ // session that has never produced output (or was torn down) — benign.
592
+ return { ok: false, reason: 'no-mirror' };
593
+ }
594
+ for (let attempt = 0; attempt < REPLAY_FLUSH_ATTEMPTS; attempt++) {
595
+ const token = this.ringBuffer.bytesWritten;
596
+ await screen.read();
597
+ if (this._gateScreen !== screen) {
598
+ // Torn down mid-flush; the freed term has no coherent frame.
599
+ return { ok: false, reason: 'no-mirror' };
600
+ }
601
+ if (this.ringBuffer.bytesWritten !== token)
602
+ continue;
603
+ let data;
604
+ try {
605
+ data = screen.serialize();
606
+ }
607
+ catch (error) {
608
+ return { ok: false, reason: 'serialize-error', error };
609
+ }
610
+ if (!data) {
611
+ // A live mirror exists only for sessions that produced output, so an
612
+ // empty serialization is the desync canary, not an idle session.
613
+ return { ok: false, reason: 'empty-snapshot' };
614
+ }
615
+ return { ok: true, data, token };
616
+ }
617
+ return { ok: false, reason: 'flush-timeout' };
618
+ }
531
619
  /** Detach a WebSocket client. Starts disconnect timer if no clients remain (non-shellper only). */
532
620
  detach(client) {
533
621
  this.clients.delete(client);
@@ -1 +1 @@
1
- {"version":3,"file":"pty-session.js","sourceRoot":"","sources":["../../src/terminal/pty-session.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;A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B,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YACnC,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;QAC9B,CAAC;QACD,IAAI,IAAI,CAAC,gBAAgB,EAAE,CAAC;YAC1B,YAAY,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;YACpC,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;QAC/B,CAAC;QACD,gCAAgC;QAChC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QACrB,6BAA6B;QAC7B,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;QACxB,2DAA2D;QAC3D,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE,CAAC;QAC5B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,wBAAwB;QACxB,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;YACxB,IAAI,CAAC;gBAAC,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAAC,CAAC;YAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC;YACxD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QACpB,CAAC;IACH,CAAC;CACF"}
@@ -45,6 +45,7 @@ export interface ScreenView {
45
45
  }
46
46
  export declare class SessionScreen {
47
47
  private readonly term;
48
+ private readonly serializer;
48
49
  private _cols;
49
50
  private _rows;
50
51
  private pending;
@@ -82,6 +83,30 @@ export declare class SessionScreen {
82
83
  * wiring already holds before a read() can reach a disposed mirror in practice.
83
84
  */
84
85
  read(): Promise<ScreenView>;
86
+ /**
87
+ * Serialize the current screen state (both buffers, colors/attrs, cursor, alt-screen
88
+ * mode, plus up to {@link SCREEN_SCROLLBACK} lines of history) back into a terminal
89
+ * byte stream a client can replay — the O(screen) viewer-attach payload (PIR #1354).
90
+ *
91
+ * SYNCHRONOUS by design: it reads whatever is parsed into the grid right now.
92
+ * Callers wanting a coherent frame must flush first ({@link read}) and must call this
93
+ * with no intervening `await` afterward — the same no-interleave discipline the render
94
+ * gate's classifier relies on. `PtySession.replaySnapshot` owns that protocol.
95
+ *
96
+ * Throws whatever the addon throws; the caller maps failures to the raw-replay
97
+ * fallback. After {@link dispose} the term is freed — return '' rather than touching it
98
+ * (callers treat an empty snapshot for a non-empty session as a fallback signal).
99
+ */
100
+ serialize(): string;
101
+ /**
102
+ * Which buffer the emulated app is currently in. 'alternate' identifies the
103
+ * full-screen-TUI case whose delta resume is unservable from the line-based ring
104
+ * (`RingBuffer.getSince` returns [] for a caught-up client), so the attach path
105
+ * routes it to {@link serialize} instead. Read without flushing: worst case the
106
+ * routing decision lags the last few unparsed bytes, and both routes remain correct
107
+ * (the raw path keeps its client-nudge recovery).
108
+ */
109
+ get bufferType(): 'normal' | 'alternate';
85
110
  /** Current mirror geometry (matches the live session). */
86
111
  get cols(): number;
87
112
  get rows(): number;
@@ -1 +1 @@
1
- {"version":3,"file":"session-screen.d.ts","sourceRoot":"","sources":["../../src/terminal/session-screen.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAOH,OAAO,KAAK,EAAE,QAAQ,IAAI,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAcpE,wFAAwF;AACxF,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,gBAAgB,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAmB;IACxC,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,KAAK,CAAS;IAItB,OAAO,CAAC,OAAO,CAAoC;IACnD,OAAO,CAAC,QAAQ,CAAS;gBAEb,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAMtC;;;;;;OAMG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAKxB;;;;OAIG;IACH,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AAG,WAAW,CAEvC;IAED,0DAA0D;IAC1D,IAAI,IAAI,IAAI,MAAM,CAEjB;IACD,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,0FAA0F;IAC1F,OAAO,IAAI,IAAI;CAUhB"}
@@ -40,19 +40,29 @@
40
40
  // and its named exports are not statically analyzable, so a native-node ESM
41
41
  // `import { Terminal }` throws "Named export 'Terminal' not found" under the compiled
42
42
  // dist (see the identical note in render-gate.ts). Default-import the module object.
43
+ // `@xterm/addon-serialize` ships the same way (same repo and release train).
43
44
  import xtermHeadless from '@xterm/headless';
45
+ import xtermSerialize from '@xterm/addon-serialize';
44
46
  const { Terminal } = xtermHeadless;
47
+ const { SerializeAddon } = xtermSerialize;
45
48
  /**
46
- * Scrollback retained by the mirror. The gate reads ONLY the current viewport
47
- * (`viewportY … viewportY + rows`), never scrollback, so this can be modest — it exists
48
- * only so a transient scroll doesn't momentarily drop viewport lines during reflow. Kept
49
- * small to bound per-session memory (one Terminal per live session): at ~200 lines it is a
50
- * few hundred KB even at a wide geometry. The viewport a classify sees is identical for any
51
- * scrollback ≥ rows, so this never changes a verdict (asserted by the production-path tests).
49
+ * Scrollback retained by the mirror, now serving two consumers (PIR #1354):
50
+ *
51
+ * - The render gate reads ONLY the current viewport (`viewportY … viewportY + rows`),
52
+ * never scrollback, and its verdict is identical for any scrollback ≥ rows (asserted
53
+ * by the production-path tests) — so for the gate this value is a free variable.
54
+ * - {@link SessionScreen.serialize} is the viewer-attach replay payload, and its
55
+ * scrollback IS the history a reconnecting viewer gets back. 1000 matches the ring
56
+ * buffer's default line capacity (`ringBufferLines`), so snapshot replay does not
57
+ * regress history depth versus the raw-ring replay it replaces.
58
+ *
59
+ * Memory: measured ~509 KB per fully-scrolled 200x50 terminal at 1000 lines (~215 KB
60
+ * at the previous 200) — the bounded per-session budget the plan commits to.
52
61
  */
53
- const GATE_SCROLLBACK = 200;
62
+ const SCREEN_SCROLLBACK = 1000;
54
63
  export class SessionScreen {
55
64
  term;
65
+ serializer;
56
66
  _cols;
57
67
  _rows;
58
68
  // Promise of the most recently issued write's parse completion. `@xterm/headless`
@@ -63,7 +73,12 @@ export class SessionScreen {
63
73
  constructor(cols, rows) {
64
74
  this._cols = cols;
65
75
  this._rows = rows;
66
- this.term = new Terminal({ cols, rows, allowProposedApi: true, scrollback: GATE_SCROLLBACK });
76
+ this.term = new Terminal({ cols, rows, allowProposedApi: true, scrollback: SCREEN_SCROLLBACK });
77
+ this.serializer = new SerializeAddon();
78
+ // The addon's typings bind to the full `@xterm/xterm` Terminal; its runtime touches
79
+ // only the buffer/parser surface the headless build shares (proven by the round-trip
80
+ // suite), so the declared-type gap is bridged explicitly here.
81
+ this.term.loadAddon(this.serializer);
67
82
  }
68
83
  /**
69
84
  * Fold one chunk of PTY output into the screen. Called at the session's single output
@@ -112,6 +127,36 @@ export class SessionScreen {
112
127
  await this.pending;
113
128
  return { term: this.term, cols: this._cols, rows: this._rows };
114
129
  }
130
+ /**
131
+ * Serialize the current screen state (both buffers, colors/attrs, cursor, alt-screen
132
+ * mode, plus up to {@link SCREEN_SCROLLBACK} lines of history) back into a terminal
133
+ * byte stream a client can replay — the O(screen) viewer-attach payload (PIR #1354).
134
+ *
135
+ * SYNCHRONOUS by design: it reads whatever is parsed into the grid right now.
136
+ * Callers wanting a coherent frame must flush first ({@link read}) and must call this
137
+ * with no intervening `await` afterward — the same no-interleave discipline the render
138
+ * gate's classifier relies on. `PtySession.replaySnapshot` owns that protocol.
139
+ *
140
+ * Throws whatever the addon throws; the caller maps failures to the raw-replay
141
+ * fallback. After {@link dispose} the term is freed — return '' rather than touching it
142
+ * (callers treat an empty snapshot for a non-empty session as a fallback signal).
143
+ */
144
+ serialize() {
145
+ if (this.disposed)
146
+ return '';
147
+ return this.serializer.serialize({ scrollback: SCREEN_SCROLLBACK });
148
+ }
149
+ /**
150
+ * Which buffer the emulated app is currently in. 'alternate' identifies the
151
+ * full-screen-TUI case whose delta resume is unservable from the line-based ring
152
+ * (`RingBuffer.getSince` returns [] for a caught-up client), so the attach path
153
+ * routes it to {@link serialize} instead. Read without flushing: worst case the
154
+ * routing decision lags the last few unparsed bytes, and both routes remain correct
155
+ * (the raw path keeps its client-nudge recovery).
156
+ */
157
+ get bufferType() {
158
+ return this.term.buffer.active.type;
159
+ }
115
160
  /** Current mirror geometry (matches the live session). */
116
161
  get cols() {
117
162
  return this._cols;
@@ -1 +1 @@
1
- {"version":3,"file":"session-screen.js","sourceRoot":"","sources":["../../src/terminal/session-screen.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,wFAAwF;AACxF,4EAA4E;AAC5E,sFAAsF;AACtF,qFAAqF;AACrF,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAG5C,MAAM,EAAE,QAAQ,EAAE,GAAG,aAAa,CAAC;AAEnC;;;;;;;GAOG;AACH,MAAM,eAAe,GAAG,GAAG,CAAC;AAS5B,MAAM,OAAO,aAAa;IACP,IAAI,CAAmB;IAChC,KAAK,CAAS;IACd,KAAK,CAAS;IACtB,kFAAkF;IAClF,kFAAkF;IAClF,wFAAwF;IAChF,OAAO,GAAkB,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3C,QAAQ,GAAG,KAAK,CAAC;IAEzB,YAAY,IAAY,EAAE,IAAY;QACpC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,IAAI,GAAG,IAAI,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,UAAU,EAAE,eAAe,EAAE,CAAC,CAAC;IAChG,CAAC;IAED;;;;;;OAMG;IACH,IAAI,CAAC,IAAY;QACf,IAAI,IAAI,CAAC,QAAQ;YAAE,OAAO;QAC1B,IAAI,CAAC,OAAO,GAAG,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC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pB,CAAC;IAED,0FAA0F;IAC1F,OAAO;QACL,IAAI,IAAI,CAAC,QAAQ;YAAE,OAAO;QAC1B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;QACpB,8FAA8F;QAC9F,kGAAkG;QAClG,+FAA+F;QAC/F,+FAA+F;QAC/F,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IACnC,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cluesmith/codev",
3
- "version": "3.3.0",
3
+ "version": "3.3.1",
4
4
  "description": "Codev CLI - AI-assisted software development framework",
5
5
  "type": "module",
6
6
  "bin": {
@@ -24,6 +24,7 @@
24
24
  "@anthropic-ai/claude-agent-sdk": "^0.2.41",
25
25
  "@google/genai": "^1.0.0",
26
26
  "@openai/codex-sdk": "^0.146.0",
27
+ "@xterm/addon-serialize": "^0.14.0",
27
28
  "@xterm/headless": "^6.0.0",
28
29
  "better-sqlite3": "^12.10.0",
29
30
  "chalk": "^5.3.0",
@@ -34,24 +35,25 @@
34
35
  "open": "^10.1.0",
35
36
  "tree-kill": "^1.2.2",
36
37
  "ws": "^8.18.0",
37
- "@cluesmith/codev-core": "3.3.0",
38
- "@cluesmith/codev-sdk": "3.3.0"
38
+ "@cluesmith/codev-core": "3.3.1",
39
+ "@cluesmith/codev-sdk": "3.3.1",
40
+ "@cluesmith/codev-types": "3.3.1"
39
41
  },
40
42
  "devDependencies": {
41
43
  "@playwright/test": "^1.58.0",
42
- "@xterm/xterm": "^5.5.0",
43
44
  "@types/better-sqlite3": "^7.6.13",
44
45
  "@types/js-yaml": "^4.0.9",
45
46
  "@types/node": "^22.10.1",
46
47
  "@types/ws": "^8.18.1",
47
48
  "@vitest/coverage-v8": "^4.0.18",
49
+ "@xterm/xterm": "^5.5.0",
48
50
  "jsdom": "^28.1.0",
49
51
  "playwright": "^1.58.0",
52
+ "three": "0.160.0",
50
53
  "tsx": "^4.19.2",
51
54
  "typescript": "^6.0.3",
52
55
  "vitest": "^4.0.15",
53
- "@cluesmith/codev-web": "0.0.0",
54
- "@cluesmith/codev-types": "3.3.0"
56
+ "@cluesmith/codev-web": "0.0.0"
55
57
  },
56
58
  "engines": {
57
59
  "node": ">=20.0.0"
@@ -73,7 +75,8 @@
73
75
  },
74
76
  "scripts": {
75
77
  "clean": "rm -rf dist",
76
- "build": "pnpm --filter \"@cluesmith/codev^...\" build && pnpm clean && tsc && pnpm copy-dashboard && pnpm copy-skeleton",
78
+ "build": "pnpm --filter \"@cluesmith/codev^...\" build && pnpm clean && tsc && pnpm bundle-assets",
79
+ "bundle-assets": "pnpm copy-dashboard && pnpm copy-skeleton && node ./scripts/copy-three.mjs",
77
80
  "copy-dashboard": "rm -rf dashboard-dist && cp -r ../../apps/web/dist dashboard-dist",
78
81
  "dev:dashboard": "cd ../../apps/web && pnpm dev",
79
82
  "copy-skeleton": "rm -rf skeleton && cp -r ../../codev-skeleton skeleton",
@@ -1,3 +1,6 @@
1
1
  #!/bin/sh
2
2
  # Forge concept: pr-view (Gitea via tea CLI)
3
- exec tea pulls view "$CODEV_PR_NUMBER" --output json
3
+ # Sets `url` to the PR's browser page (`html_url`). Gitea's own `url` field is
4
+ # the API endpoint (would render raw JSON in a browser), so we prefer `html_url`
5
+ # and fall back to the existing `url` only if `html_url` is absent.
6
+ tea pulls view "$CODEV_PR_NUMBER" --output json | jq '.url = (.html_url // .url)'
@@ -7,5 +7,5 @@ if [ "$CODEV_INCLUDE_COMMENTS" = "1" ]; then
7
7
  exec gh pr view "$CODEV_PR_NUMBER" --comments
8
8
  else
9
9
  exec gh pr view "$CODEV_PR_NUMBER" \
10
- --json title,body,state,author,baseRefName,headRefName,additions,deletions
10
+ --json title,body,state,url,author,baseRefName,headRefName,additions,deletions
11
11
  fi
@@ -1,3 +1,6 @@
1
1
  #!/bin/sh
2
2
  # Forge concept: pr-view (GitLab via glab CLI)
3
- exec glab mr view "$CODEV_PR_NUMBER" --output json
3
+ # Adds a `url` field mapped from GitLab's `web_url` (the MR's browser page);
4
+ # all other fields glab emits are passed through unchanged. `. + {url: …}` is
5
+ # non-destructive — if `web_url` is absent, `url` is null (optional by contract).
6
+ glab mr view "$CODEV_PR_NUMBER" --output json | jq '. + {url: .web_url}'
@@ -69,6 +69,60 @@ afx send 0042 "PR approved, please merge"
69
69
  afx send 0585 "check the test output" --file /tmp/test-results.txt
70
70
  ```
71
71
 
72
+ ## afx interrupt
73
+
74
+ Sends an ESC keystroke to a builder's PTY — the only thing that reaches it **mid-turn**.
75
+
76
+ ```
77
+ afx interrupt <builder>
78
+ ```
79
+
80
+ | Flag | Description |
81
+ |------|-------------|
82
+ | `--no-enter` | Send ESC alone, without the trailing Enter |
83
+
84
+ A builder chaining foreground waits inside one turn queues every `afx send` unread — including your order
85
+ to stop. ESC ends the turn so the queue processes. Distinct from `afx send --interrupt` (Ctrl+C).
86
+
87
+ ```bash
88
+ afx interrupt 0042
89
+ afx send 0042 "That producer died — stop waiting and report."
90
+ ```
91
+
92
+ ## afx refresh
93
+
94
+ Refreshes a builder's context: save working state → `/clear` → re-orient. Use when a builder's context window
95
+ is exhausted; `afx spawn --resume` reattaches the *same* conversation and does **not** give it a fresh one.
96
+
97
+ ```
98
+ afx refresh <builder>
99
+ ```
100
+
101
+ | Flag | Description |
102
+ |------|-------------|
103
+ | `--dry-run` | Print what would be sent; write nothing to the builder |
104
+ | `--note <text>` | Extra context appended to the re-orientation |
105
+ | `--file <path>` | Append file content (48KB max, read from *your* filesystem) |
106
+ | `--interrupt-first` | ESC before the save request, for a builder already wedged |
107
+ | `--mode <strict\|soft>` | Override mode if it cannot be detected |
108
+ | `--timeout <seconds>` | Wait for the save-state receipt (default 300) |
109
+ | `--min-bytes <n>` | Minimum state-file size to accept (default 1000) |
110
+ | `--quiet-window <ms>` | Terminal silence counting as turn-ended (default 1500) |
111
+
112
+ Every gate fails safe: if the state file never arrives, carries a stale nonce, is a stub, is still being
113
+ written, or the builder will not go quiet, the command **aborts without clearing** and exits non-zero,
114
+ naming the gate. Requires a harness with in-session context clearing (Claude Code); others abort loudly.
115
+
116
+ `afx reset` is a deprecated alias: it still works, prints a one-line notice to stderr, and will be removed
117
+ in a future release.
118
+
119
+ ```bash
120
+ afx refresh 0042 --dry-run # inspect first — touches nothing
121
+ afx refresh 0042
122
+ afx refresh 0042 --note "PR #90 merged while you were mid-phase. Rebase first."
123
+ afx refresh 0042 --interrupt-first # builder is wedged mid-turn
124
+ ```
125
+
72
126
  ## afx cleanup
73
127
 
74
128
  Removes a builder's worktree and branch after work is done.
@@ -69,6 +69,60 @@ afx send 0042 "PR approved, please merge"
69
69
  afx send 0585 "check the test output" --file /tmp/test-results.txt
70
70
  ```
71
71
 
72
+ ## afx interrupt
73
+
74
+ Sends an ESC keystroke to a builder's PTY — the only thing that reaches it **mid-turn**.
75
+
76
+ ```
77
+ afx interrupt <builder>
78
+ ```
79
+
80
+ | Flag | Description |
81
+ |------|-------------|
82
+ | `--no-enter` | Send ESC alone, without the trailing Enter |
83
+
84
+ A builder chaining foreground waits inside one turn queues every `afx send` unread — including your order
85
+ to stop. ESC ends the turn so the queue processes. Distinct from `afx send --interrupt` (Ctrl+C).
86
+
87
+ ```bash
88
+ afx interrupt 0042
89
+ afx send 0042 "That producer died — stop waiting and report."
90
+ ```
91
+
92
+ ## afx refresh
93
+
94
+ Refreshes a builder's context: save working state → `/clear` → re-orient. Use when a builder's context window
95
+ is exhausted; `afx spawn --resume` reattaches the *same* conversation and does **not** give it a fresh one.
96
+
97
+ ```
98
+ afx refresh <builder>
99
+ ```
100
+
101
+ | Flag | Description |
102
+ |------|-------------|
103
+ | `--dry-run` | Print what would be sent; write nothing to the builder |
104
+ | `--note <text>` | Extra context appended to the re-orientation |
105
+ | `--file <path>` | Append file content (48KB max, read from *your* filesystem) |
106
+ | `--interrupt-first` | ESC before the save request, for a builder already wedged |
107
+ | `--mode <strict\|soft>` | Override mode if it cannot be detected |
108
+ | `--timeout <seconds>` | Wait for the save-state receipt (default 300) |
109
+ | `--min-bytes <n>` | Minimum state-file size to accept (default 1000) |
110
+ | `--quiet-window <ms>` | Terminal silence counting as turn-ended (default 1500) |
111
+
112
+ Every gate fails safe: if the state file never arrives, carries a stale nonce, is a stub, is still being
113
+ written, or the builder will not go quiet, the command **aborts without clearing** and exits non-zero,
114
+ naming the gate. Requires a harness with in-session context clearing (Claude Code); others abort loudly.
115
+
116
+ `afx reset` is a deprecated alias: it still works, prints a one-line notice to stderr, and will be removed
117
+ in a future release.
118
+
119
+ ```bash
120
+ afx refresh 0042 --dry-run # inspect first — touches nothing
121
+ afx refresh 0042
122
+ afx refresh 0042 --note "PR #90 merged while you were mid-phase. Rebase first."
123
+ afx refresh 0042 --interrupt-first # builder is wedged mid-turn
124
+ ```
125
+
72
126
  ## afx cleanup
73
127
 
74
128
  Removes a builder's worktree and branch after work is done.
@@ -42,8 +42,9 @@ the code directly in the worktree (you see it via `git diff`), typing into your
42
42
  `afx send <your-builder-id>` (queued — check next turn), or a comment on the GitHub issue
43
43
  (re-fetch with `gh issue view <N> --comments`).
44
44
 
45
- Revise, recommit, ask whether more remains. **The gate stays pending until the human runs
46
- `porch approve` — never call it yourself.**
45
+ Revise, recommit, ask whether more remains. **The gate stays pending until the human approves. When
46
+ the architect relays that approval, run `porch approve <id> <gate> --a-human-explicitly-approved-this`
47
+ to record it and continue — never on your own initiative.**
47
48
 
48
49
  ## Resumption After Crash
49
50