@timurproko/a1 0.1.8-dev.260 → 0.1.8-dev.271

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 (28) hide show
  1. package/bin/update-recovery.js +272 -0
  2. package/dist/foundation/release/index.d.ts +1 -0
  3. package/dist/foundation/release/index.js +1 -0
  4. package/dist/foundation/release/release-gc.js +2 -0
  5. package/dist/foundation/release/update-recovery.d.ts +74 -0
  6. package/dist/foundation/release/update-recovery.js +352 -0
  7. package/dist/foundation/release/update-transaction.d.ts +10 -0
  8. package/dist/foundation/release/update-transaction.js +12 -1
  9. package/dist/foundation/release/update.d.ts +19 -1
  10. package/dist/foundation/release/update.js +67 -10
  11. package/dist/integrations/pi/components/owned-editor-ux.js +61 -8
  12. package/dist/integrations/pi/components/path-word-ranges.d.ts +2 -0
  13. package/dist/integrations/pi/components/path-word-ranges.js +37 -0
  14. package/dist/integrations/pi/engine/conformance.d.ts +1 -1
  15. package/dist/integrations/pi/engine/conformance.js +9 -1
  16. package/dist/integrations/pi/engine/runtime-integration.js +10 -1
  17. package/dist/integrations/pi/engine/windows-filesystem-hygiene.d.ts +21 -0
  18. package/dist/integrations/pi/engine/windows-filesystem-hygiene.js +55 -0
  19. package/dist/integrations/pi/session-ui/session-shell-root.d.ts +1 -1
  20. package/dist/integrations/pi/session-ui/session-shell-root.js +29 -20
  21. package/dist/native/darwin-arm64/manifest.json +1 -1
  22. package/dist/native/linux-x64/manifest.json +1 -1
  23. package/dist/native/win32-x64/manifest.json +2 -2
  24. package/dist/native/win32-x64/process-guardian.exe +0 -0
  25. package/dist/runtime-payload-inventory.json +1 -0
  26. package/dist/ui/components/transcript-viewport.d.ts +8 -0
  27. package/dist/ui/components/transcript-viewport.js +30 -6
  28. package/package.json +1 -1
@@ -240,7 +240,19 @@ export class TranscriptViewport {
240
240
  const previousDescriptor = this.#frame?.descriptor ?? null;
241
241
  const dock = input.dockRows.length > height ? input.dockRows.slice(-height) : [...input.dockRows];
242
242
  const viewportHeight = Math.max(0, height - dock.length);
243
- this.#maxScroll = Math.max(0, input.documentRows.length - viewportHeight);
243
+ const bottomAlignedTailRowCount = clamp(input.bottomAlignedTailRowCount ?? 0, 0, input.documentRows.length);
244
+ const transientAlignmentGapRows = bottomAlignedTailRowCount > 0
245
+ ? Math.max(0, viewportHeight - input.documentRows.length)
246
+ : 0;
247
+ const tailStart = input.documentRows.length - bottomAlignedTailRowCount;
248
+ const documentRows = transientAlignmentGapRows === 0
249
+ ? input.documentRows
250
+ : [
251
+ ...input.documentRows.slice(0, tailStart),
252
+ ...Array.from({ length: transientAlignmentGapRows }, () => ""),
253
+ ...input.documentRows.slice(tailStart),
254
+ ];
255
+ this.#maxScroll = Math.max(0, documentRows.length - viewportHeight);
244
256
  if (this.#followingEnd)
245
257
  this.#scrollTop = this.#maxScroll;
246
258
  else
@@ -250,7 +262,7 @@ export class TranscriptViewport {
250
262
  if (this.#followingEnd)
251
263
  this.#newMessages = 0;
252
264
  const geometry = scrollbarGeometry({
253
- contentLength: input.documentRows.length,
265
+ contentLength: documentRows.length,
254
266
  viewportHeight,
255
267
  scroll: this.#scrollTop,
256
268
  // Compatibility: the session rail deliberately starts one line below the viewport top.
@@ -266,7 +278,7 @@ export class TranscriptViewport {
266
278
  now: input.now ?? Date.now(),
267
279
  });
268
280
  const contentWidth = presentation.reservesSpace ? Math.max(1, width - 1) : width;
269
- this.#documentRows = input.documentRows;
281
+ this.#documentRows = documentRows;
270
282
  this.#selectableDocumentRowCount = clamp(input.selectableDocumentRowCount ?? input.documentRows.length, 0, input.documentRows.length);
271
283
  this.#promptAnchors = input.promptAnchors;
272
284
  this.#contentWidth = contentWidth;
@@ -278,7 +290,7 @@ export class TranscriptViewport {
278
290
  trimCache(this.#finalRowCache, cacheLimit);
279
291
  const paintId = this.#functionId(paintDocumentRow);
280
292
  const paintRecomputedRows = new Set();
281
- const visible = input.documentRows
293
+ const visible = documentRows
282
294
  .slice(this.#scrollTop, this.#scrollTop + viewportHeight)
283
295
  .map((row, index) => {
284
296
  const painted = cachedString(this.#paintedRowCache, `${paintId}\u0000${row}`, cacheLimit, () => paintDocumentRow(row));
@@ -366,7 +378,7 @@ export class TranscriptViewport {
366
378
  }
367
379
  const nextDocumentRange = {
368
380
  start: this.#scrollTop,
369
- end: Math.min(input.documentRows.length, this.#scrollTop + viewportHeight),
381
+ end: Math.min(documentRows.length, this.#scrollTop + viewportHeight),
370
382
  };
371
383
  const previousDocumentRange = previousDescriptor?.nextDocumentRange ?? null;
372
384
  const sameGeometry = previousDescriptor !== null
@@ -391,6 +403,9 @@ export class TranscriptViewport {
391
403
  nextDocumentRange,
392
404
  previousFollowingEnd: previousDescriptor?.followingEnd ?? null,
393
405
  followingEnd: this.#followingEnd,
406
+ transientRowCount: Math.max(0, documentRows.length - this.#selectableDocumentRowCount),
407
+ transientAlignmentGapRows,
408
+ bottomAlignedTailRowCount,
394
409
  verticalShiftRows,
395
410
  safeVerticalShift,
396
411
  selectionRevision: composingSelectionRevision,
@@ -416,7 +431,7 @@ export class TranscriptViewport {
416
431
  },
417
432
  sticky: stickyActive ? { row: 1, target: governing.firstRow, width: contentWidth } : null,
418
433
  bottom: bottomHit,
419
- transientTail: Array.from({ length: Math.max(0, Math.min(input.documentRows.length, this.#scrollTop + viewportHeight) - Math.max(this.#scrollTop, this.#selectableDocumentRowCount)) }, (_row, index) => Math.max(this.#scrollTop, this.#selectableDocumentRowCount) - this.#scrollTop + index + 1),
434
+ transientTail: Array.from({ length: Math.max(0, Math.min(documentRows.length, this.#scrollTop + viewportHeight) - Math.max(this.#scrollTop, this.#selectableDocumentRowCount)) }, (_row, index) => Math.max(this.#scrollTop, this.#selectableDocumentRowCount) - this.#scrollTop + index + 1),
420
435
  };
421
436
  const frame = {
422
437
  rows: frameRows,
@@ -462,6 +477,9 @@ export class TranscriptViewport {
462
477
  nextDocumentRange: previous.descriptor.nextDocumentRange,
463
478
  previousFollowingEnd: previous.followingEnd,
464
479
  followingEnd: previous.followingEnd,
480
+ transientRowCount: previous.descriptor.transientRowCount,
481
+ transientAlignmentGapRows: previous.descriptor.transientAlignmentGapRows,
482
+ bottomAlignedTailRowCount: previous.descriptor.bottomAlignedTailRowCount,
465
483
  verticalShiftRows: 0,
466
484
  safeVerticalShift: false,
467
485
  selectionRevision: this.#selectionRevision,
@@ -587,6 +605,12 @@ export function assertTranscriptViewportFrameDescriptor(descriptor) {
587
605
  assertDocumentRange(descriptor.nextDocumentRange, "next");
588
606
  if (descriptor.previousDocumentRange !== null)
589
607
  assertDocumentRange(descriptor.previousDocumentRange, "previous");
608
+ if (!Number.isSafeInteger(descriptor.transientRowCount) || descriptor.transientRowCount < 0
609
+ || !Number.isSafeInteger(descriptor.transientAlignmentGapRows) || descriptor.transientAlignmentGapRows < 0
610
+ || !Number.isSafeInteger(descriptor.bottomAlignedTailRowCount) || descriptor.bottomAlignedTailRowCount < 0
611
+ || descriptor.transientAlignmentGapRows + descriptor.bottomAlignedTailRowCount > descriptor.transientRowCount) {
612
+ throw new TypeError("viewport frame descriptor transient geometry is invalid");
613
+ }
590
614
  if (!Number.isSafeInteger(descriptor.verticalShiftRows))
591
615
  throw new TypeError("viewport frame descriptor shift is invalid");
592
616
  if (descriptor.previousDocumentRange === null && descriptor.verticalShiftRows !== 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@timurproko/a1",
3
- "version": "0.1.8-dev.260",
3
+ "version": "0.1.8-dev.271",
4
4
  "description": "Standalone terminal workspace for supervised native and managed agents",
5
5
  "type": "module",
6
6
  "packageManager": "npm@11.13.0",