@neta-art/cohub-cli 10.13.0 → 10.14.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.
@@ -5683,6 +5683,10 @@ const BOARD_DEFAULT_SIZES$1 = {
5683
5683
  width: 480,
5684
5684
  height: 270
5685
5685
  },
5686
+ session: {
5687
+ width: 320,
5688
+ height: 176
5689
+ },
5686
5690
  effect: {
5687
5691
  width: 240,
5688
5692
  height: 240
@@ -5896,7 +5900,7 @@ const BoardFrameItemSchema$1 = object({
5896
5900
  type: literal("frame"),
5897
5901
  props: object({
5898
5902
  label: string().max(280).default(""),
5899
- decoration: _enum(["frame", "none"]).optional().describe("none hides the title, border and background: an invisible group whose tracks move every child."),
5903
+ decoration: _enum(["frame", "none"]).optional().describe("none hides the title, border and background: an invisible group whose tracks move every child; with a label it is also a page viewers step to."),
5900
5904
  clip: boolean().default(true).describe("Hide children outside the frame.")
5901
5905
  }).strict().prefault({})
5902
5906
  }).strict();
@@ -6096,6 +6100,22 @@ const BoardTaskItemSchema$1 = object({
6096
6100
  snapshot: BoardTaskSnapshotSchema$1.describe("Maintained by the server; omit it.")
6097
6101
  }).strict()
6098
6102
  }).strict();
6103
+ const BoardSessionSnapshotSchema$1 = object({
6104
+ title: string().max(255).default(""),
6105
+ excerpt: string().max(480).optional().describe("The latest message as plain text."),
6106
+ source: string().max(120).optional().describe("Where the chat runs: web, cli or a channel."),
6107
+ issue: _enum(["failed", "lost"]).optional().describe("How the last run ended when it did not finish."),
6108
+ errorExcerpt: string().max(240).optional(),
6109
+ activityAt: string().max(64).optional()
6110
+ }).strict();
6111
+ const BoardSessionItemSchema$1 = object({
6112
+ ...boxed$1(BOARD_DEFAULT_SIZES$1.session),
6113
+ type: literal("session"),
6114
+ props: object({
6115
+ sessionId: string().min(1).max(160).describe("The chat shown; the server keeps its title, latest message and status up to date."),
6116
+ snapshot: BoardSessionSnapshotSchema$1.describe("Maintained by the server; omit it.")
6117
+ }).strict()
6118
+ }).strict();
6099
6119
  const BOARD_EFFECT_KINDS$1 = [
6100
6120
  "particles",
6101
6121
  "trail",
@@ -6150,6 +6170,7 @@ const BOARD_ITEM_SCHEMAS$1 = {
6150
6170
  audio: BoardAudioItemSchema$1,
6151
6171
  file: BoardFileItemSchema$1,
6152
6172
  task: BoardTaskItemSchema$1,
6173
+ session: BoardSessionItemSchema$1,
6153
6174
  effect: BoardEffectItemSchema$1,
6154
6175
  custom: BoardCustomItemSchema$1
6155
6176
  };
@@ -9808,8 +9829,8 @@ function boardNavigableFrames(scene) {
9808
9829
  for (const id of ids) {
9809
9830
  const item = scene.get(id);
9810
9831
  if (item?.type !== "frame") continue;
9811
- if (item.props.decoration === "none") visit(scene.children(id));
9812
- else frames.push(item);
9832
+ if (item.props.decoration !== "none" || item.props.label.trim()) frames.push(item);
9833
+ else visit(scene.children(id));
9813
9834
  }
9814
9835
  };
9815
9836
  visit(scene.children(void 0));
@@ -9902,6 +9923,9 @@ const BOARD_THEME_DATA = {
9902
9923
  hover: 2500907,
9903
9924
  border: 3158838,
9904
9925
  brand: 14564909,
9926
+ activity: 14564909,
9927
+ error: 15950429,
9928
+ warning: 15580004,
9905
9929
  text: 15330286,
9906
9930
  muted: 10198947,
9907
9931
  rare: 6009047,
@@ -9971,6 +9995,9 @@ const BOARD_THEME_DATA = {
9971
9995
  hover: 15330029,
9972
9996
  border: 14409442,
9973
9997
  brand: 13582898,
9998
+ activity: 13582898,
9999
+ error: 10165794,
10000
+ warning: 8804608,
9974
10001
  text: 66050,
9975
10002
  muted: 6251625,
9976
10003
  rare: 24458,
@@ -10040,6 +10067,9 @@ const BOARD_THEME_DATA = {
10040
10067
  hover: 1057828,
10041
10068
  border: 1582887,
10042
10069
  brand: 34240,
10070
+ activity: 34240,
10071
+ error: 15950429,
10072
+ warning: 14790474,
10043
10073
  text: 12572374,
10044
10074
  muted: 6848639,
10045
10075
  rare: 2206648,
@@ -10109,6 +10139,9 @@ const BOARD_THEME_DATA = {
10109
10139
  hover: 15920337,
10110
10140
  border: 14341313,
10111
10141
  brand: 31924,
10142
+ activity: 31924,
10143
+ error: 10363429,
10144
+ warning: 8936704,
10112
10145
  text: 2110772,
10113
10146
  muted: 5860973,
10114
10147
  rare: 28541,
@@ -10178,6 +10211,9 @@ const BOARD_THEME_DATA = {
10178
10211
  hover: 1973788,
10179
10212
  border: 1842202,
10180
10213
  brand: 3900150,
10214
+ activity: 15524306,
10215
+ error: 15562341,
10216
+ warning: 15449187,
10181
10217
  text: 16314853,
10182
10218
  muted: 7630695,
10183
10219
  rare: 9235170,
@@ -10244,6 +10280,9 @@ const BOARD_THEME_DATA = {
10244
10280
  hover: 16185078,
10245
10281
  border: 15527149,
10246
10282
  brand: 1824230,
10283
+ activity: 434355,
10284
+ error: 13705029,
10285
+ warning: 9725440,
10247
10286
  text: 1447704,
10248
10287
  muted: 7566452,
10249
10288
  rare: 31378,
@@ -10335,6 +10374,9 @@ const BOARD_THEME_DATA = {
10335
10374
  hover: 2237220,
10336
10375
  border: 2763565,
10337
10376
  brand: 1824230,
10377
+ activity: 3142143,
10378
+ error: 16740488,
10379
+ warning: 16766287,
10338
10380
  text: 16185078,
10339
10381
  muted: 9079436,
10340
10382
  rare: 1824230,
@@ -31656,7 +31698,7 @@ const CLOSE = 2;
31656
31698
  const MIDDLE = 3;
31657
31699
  const OPEN_NARROW = 4;
31658
31700
  const CLOSE_NARROW = 5;
31659
- const DOT = 6;
31701
+ const DOT$1 = 6;
31660
31702
  const COLON = 7;
31661
31703
  const SEMICOLON = 8;
31662
31704
  const OPEN_QUOTE = 9;
@@ -31680,7 +31722,7 @@ function getStaticCharType(text, index) {
31680
31722
  case 12289:
31681
31723
  case 12290:
31682
31724
  case 65292:
31683
- case 65294: return DOT;
31725
+ case 65294: return DOT$1;
31684
31726
  case 65306: return COLON;
31685
31727
  case 65307: return SEMICOLON;
31686
31728
  case 183:
@@ -31770,7 +31812,7 @@ function getFontData(measurement) {
31770
31812
  function getCharType(data, text, index) {
31771
31813
  const type = getStaticCharType(text, index);
31772
31814
  switch (type) {
31773
- case DOT: return data.typeForDot;
31815
+ case DOT$1: return data.typeForDot;
31774
31816
  case COLON: return data.typeForColon;
31775
31817
  case SEMICOLON: return data.typeForSemicolon;
31776
31818
  case OPEN_QUOTE: return data.quoteFullwidth ? OPEN : OPEN_NARROW;
@@ -33475,12 +33517,12 @@ function syncTextResolution(text, resolution) {
33475
33517
  if (text.resolution !== next) text.resolution = next;
33476
33518
  }
33477
33519
  const ICON = 12;
33478
- const GAP$2 = 5;
33520
+ const GAP$3 = 5;
33479
33521
  const MAX_GROWTH = 1.25;
33480
33522
  const MIN_READABLE = 7;
33481
- const SECOND$1 = 1e3;
33523
+ const SECOND$2 = 1e3;
33482
33524
  function formatBoardDuration(ms) {
33483
- const total = Math.max(0, Math.floor(ms / SECOND$1));
33525
+ const total = Math.max(0, Math.floor(ms / SECOND$2));
33484
33526
  const hours = Math.floor(total / 3600);
33485
33527
  const minutes = Math.floor(total % 3600 / 60);
33486
33528
  const seconds = String(total % 60).padStart(2, "0");
@@ -33534,6 +33576,14 @@ const PIXEL_GLYPHS = {
33534
33576
  ".###..",
33535
33577
  "..#...",
33536
33578
  "......"
33579
+ ],
33580
+ session: [
33581
+ "######",
33582
+ "#....#",
33583
+ "#....#",
33584
+ "######",
33585
+ "##....",
33586
+ "#....."
33537
33587
  ]
33538
33588
  };
33539
33589
  function drawLineGlyph(graphics, glyph, color) {
@@ -33607,6 +33657,24 @@ function drawLineGlyph(graphics, glyph, color) {
33607
33657
  4.7
33608
33658
  ]).fill({ color });
33609
33659
  return;
33660
+ case "session":
33661
+ graphics.poly([
33662
+ 1.5,
33663
+ 2,
33664
+ 10.5,
33665
+ 2,
33666
+ 10.5,
33667
+ 8.5,
33668
+ 6,
33669
+ 8.5,
33670
+ 3.5,
33671
+ 10.5,
33672
+ 3.5,
33673
+ 8.5,
33674
+ 1.5,
33675
+ 8.5
33676
+ ], true).stroke(line);
33677
+ return;
33610
33678
  }
33611
33679
  }
33612
33680
  function traceCube(graphics, cx, cy, radius) {
@@ -33694,7 +33762,7 @@ function syncCardTag(tag, input, context) {
33694
33762
  drawCardGlyph(tag.icon.clear(), input.glyph, color, pixel);
33695
33763
  tag.text.style.fill = color;
33696
33764
  tag.text.style.fontFamily = context.style.font;
33697
- fitTextToWidth(tag.text, input.text, Math.max(1, input.width - ICON - GAP$2));
33765
+ fitTextToWidth(tag.text, input.text, Math.max(1, input.width - ICON - GAP$3));
33698
33766
  tag.text.position.set(17, (ICON - tag.text.height) / 2);
33699
33767
  }
33700
33768
  syncTextResolution(tag.text, context.textResolution * tagScale(context.zoom));
@@ -34186,9 +34254,9 @@ function drawModelKey(graphics, cx, cy, radius, context) {
34186
34254
  cap: "round"
34187
34255
  });
34188
34256
  }
34189
- const GAP$1 = 12;
34257
+ const GAP$2 = 12;
34190
34258
  const WAVE_HEIGHT = 16;
34191
- const partsByContainer$13 = /* @__PURE__ */ new WeakMap();
34259
+ const partsByContainer$14 = /* @__PURE__ */ new WeakMap();
34192
34260
  function audioKeyCenter(width, height) {
34193
34261
  const radius = Math.min(16, Math.max(8, height / 2 - 8), width / 4);
34194
34262
  return {
@@ -34197,8 +34265,8 @@ function audioKeyCenter(width, height) {
34197
34265
  radius
34198
34266
  };
34199
34267
  }
34200
- function sync$13(container, item, context) {
34201
- const parts = partsByContainer$13.get(container);
34268
+ function sync$14(container, item, context) {
34269
+ const parts = partsByContainer$14.get(container);
34202
34270
  if (!parts) return;
34203
34271
  syncContent$1(parts, item, context);
34204
34272
  syncTextResolution(parts.title, context.textResolution);
@@ -34236,7 +34304,7 @@ function syncContent$1(parts, item, context) {
34236
34304
  });
34237
34305
  const key = audioKeyCenter(width, height);
34238
34306
  drawMediaPlayKey(parts.plate, key.x, key.y, key.radius, context, true);
34239
- const left = key.x + key.radius + GAP$1;
34307
+ const left = key.x + key.radius + GAP$2;
34240
34308
  const room = width - 14 - left;
34241
34309
  parts.title.visible = detailed && room > 24;
34242
34310
  parts.wave.clear();
@@ -34271,21 +34339,21 @@ const audioCardRenderer = {
34271
34339
  roundPixels: true
34272
34340
  });
34273
34341
  root.addChild(plate, wave, title);
34274
- partsByContainer$13.set(root, {
34342
+ partsByContainer$14.set(root, {
34275
34343
  root,
34276
34344
  plate,
34277
34345
  wave,
34278
34346
  title,
34279
34347
  sig: ""
34280
34348
  });
34281
- if (item.type === "audio") sync$13(root, item, context);
34349
+ if (item.type === "audio") sync$14(root, item, context);
34282
34350
  return root;
34283
34351
  },
34284
34352
  update: (container, item, context) => {
34285
- if (item.type === "audio") sync$13(container, item, context);
34353
+ if (item.type === "audio") sync$14(container, item, context);
34286
34354
  },
34287
34355
  resolution: (container, item, context) => {
34288
- if (item.type === "audio") sync$13(container, item, context);
34356
+ if (item.type === "audio") sync$14(container, item, context);
34289
34357
  },
34290
34358
  renderFar: (graphics, item, context) => {
34291
34359
  drawFarPlate(graphics, item.frame, {
@@ -34296,13 +34364,13 @@ const audioCardRenderer = {
34296
34364
  });
34297
34365
  },
34298
34366
  destroy: (container) => {
34299
- partsByContainer$13.get(container)?.root.destroy({ children: true });
34300
- partsByContainer$13.delete(container);
34367
+ partsByContainer$14.get(container)?.root.destroy({ children: true });
34368
+ partsByContainer$14.delete(container);
34301
34369
  }
34302
34370
  };
34303
34371
  //#endregion
34304
34372
  //#region ../sdk/src/board/render/renderers/model-card-renderer.ts
34305
- const partsByContainer$12 = /* @__PURE__ */ new WeakMap();
34373
+ const partsByContainer$13 = /* @__PURE__ */ new WeakMap();
34306
34374
  const INSET_RATIO = .06;
34307
34375
  const KEY_RADIUS = 14;
34308
34376
  const KEY_MARGIN = 10;
@@ -34315,8 +34383,8 @@ function modelKeyCenter(width, height) {
34315
34383
  radius
34316
34384
  };
34317
34385
  }
34318
- function sync$12(container, item, context) {
34319
- const parts = partsByContainer$12.get(container);
34386
+ function sync$13(container, item, context) {
34387
+ const parts = partsByContainer$13.get(container);
34320
34388
  if (!parts) return;
34321
34389
  positionShell(parts.root, item);
34322
34390
  const { width, height } = item.frame;
@@ -34390,7 +34458,7 @@ const modelCardRenderer = {
34390
34458
  const chrome = new Graphics();
34391
34459
  const tag = createCardTag();
34392
34460
  root.addChild(plate, sprite, chrome, tag.root);
34393
- partsByContainer$12.set(root, {
34461
+ partsByContainer$13.set(root, {
34394
34462
  root,
34395
34463
  plate,
34396
34464
  sprite,
@@ -34398,17 +34466,17 @@ const modelCardRenderer = {
34398
34466
  tag,
34399
34467
  sig: ""
34400
34468
  });
34401
- if (item.type === "file") sync$12(root, item, context);
34469
+ if (item.type === "file") sync$13(root, item, context);
34402
34470
  return root;
34403
34471
  },
34404
34472
  update: (container, item, context) => {
34405
- if (item.type === "file") sync$12(container, item, context);
34473
+ if (item.type === "file") sync$13(container, item, context);
34406
34474
  },
34407
34475
  resolution: (container, item, context) => {
34408
- if (item.type === "file") sync$12(container, item, context);
34476
+ if (item.type === "file") sync$13(container, item, context);
34409
34477
  },
34410
34478
  zoom: (container, zoom) => {
34411
- const tag = partsByContainer$12.get(container)?.tag;
34479
+ const tag = partsByContainer$13.get(container)?.tag;
34412
34480
  if (tag) zoomCardTag(tag, zoom);
34413
34481
  },
34414
34482
  renderFar: (graphics, item, context) => {
@@ -34420,8 +34488,8 @@ const modelCardRenderer = {
34420
34488
  });
34421
34489
  },
34422
34490
  destroy: (container) => {
34423
- partsByContainer$12.get(container)?.root.destroy({ children: true });
34424
- partsByContainer$12.delete(container);
34491
+ partsByContainer$13.get(container)?.root.destroy({ children: true });
34492
+ partsByContainer$13.delete(container);
34425
34493
  }
34426
34494
  };
34427
34495
  //#endregion
@@ -34484,9 +34552,9 @@ function arrowLabelAnchor(arrow, style) {
34484
34552
  }
34485
34553
  //#endregion
34486
34554
  //#region ../sdk/src/board/render/renderers/arrow-card-renderer.ts
34487
- const partsByContainer$11 = /* @__PURE__ */ new WeakMap();
34488
- function sync$11(container, item, context) {
34489
- const parts = partsByContainer$11.get(container);
34555
+ const partsByContainer$12 = /* @__PURE__ */ new WeakMap();
34556
+ function sync$12(container, item, context) {
34557
+ const parts = partsByContainer$12.get(container);
34490
34558
  if (!parts) return;
34491
34559
  parts.root.position.set(0, 0);
34492
34560
  parts.root.rotation = 0;
@@ -34590,7 +34658,7 @@ const arrowCardRenderer = {
34590
34658
  label.anchor.set(.5);
34591
34659
  const backdrop = new Graphics();
34592
34660
  root.addChild(line, backdrop, label);
34593
- partsByContainer$11.set(root, {
34661
+ partsByContainer$12.set(root, {
34594
34662
  root,
34595
34663
  line,
34596
34664
  backdrop,
@@ -34598,14 +34666,14 @@ const arrowCardRenderer = {
34598
34666
  lineSig: "",
34599
34667
  labelSig: ""
34600
34668
  });
34601
- if (item.type === "arrow") sync$11(root, item, context);
34669
+ if (item.type === "arrow") sync$12(root, item, context);
34602
34670
  return root;
34603
34671
  },
34604
34672
  update: (container, item, context) => {
34605
- if (item.type === "arrow") sync$11(container, item, context);
34673
+ if (item.type === "arrow") sync$12(container, item, context);
34606
34674
  },
34607
34675
  resolution: (container, _item, context) => {
34608
- const parts = partsByContainer$11.get(container);
34676
+ const parts = partsByContainer$12.get(container);
34609
34677
  if (parts) syncTextResolution(parts.label, context.textResolution);
34610
34678
  },
34611
34679
  renderFar: (graphics, item, context) => {
@@ -34618,13 +34686,13 @@ const arrowCardRenderer = {
34618
34686
  });
34619
34687
  },
34620
34688
  destroy: (container) => {
34621
- partsByContainer$11.get(container)?.root.destroy({ children: true });
34622
- partsByContainer$11.delete(container);
34689
+ partsByContainer$12.get(container)?.root.destroy({ children: true });
34690
+ partsByContainer$12.delete(container);
34623
34691
  }
34624
34692
  };
34625
34693
  //#endregion
34626
34694
  //#region ../sdk/src/board/render/renderers/draw-card-renderer.ts
34627
- const partsByContainer$10 = /* @__PURE__ */ new WeakMap();
34695
+ const partsByContainer$11 = /* @__PURE__ */ new WeakMap();
34628
34696
  function fillRibbon(graphics, ribbon, color) {
34629
34697
  const { positions, indices } = ribbon;
34630
34698
  for (let offset = 0; offset < indices.length; offset += 3) {
@@ -34675,8 +34743,8 @@ function tessellate(parts, points, size, paint) {
34675
34743
  texture: Texture.WHITE
34676
34744
  }));
34677
34745
  }
34678
- function sync$10(container, item, context) {
34679
- const parts = partsByContainer$10.get(container);
34746
+ function sync$11(container, item, context) {
34747
+ const parts = partsByContainer$11.get(container);
34680
34748
  if (!parts) return;
34681
34749
  positionShell(parts.root, item);
34682
34750
  const { points } = item.props;
@@ -34709,7 +34777,7 @@ const drawCardRenderer = {
34709
34777
  canRender: (item) => item.type === "draw",
34710
34778
  create: (item, context) => {
34711
34779
  const root = new Container();
34712
- partsByContainer$10.set(root, {
34780
+ partsByContainer$11.set(root, {
34713
34781
  root,
34714
34782
  stroke: null,
34715
34783
  ribbon: null,
@@ -34726,11 +34794,11 @@ const drawCardRenderer = {
34726
34794
  height: 1
34727
34795
  }
34728
34796
  });
34729
- if (item.type === "draw") sync$10(root, item, context);
34797
+ if (item.type === "draw") sync$11(root, item, context);
34730
34798
  return root;
34731
34799
  },
34732
34800
  update: (container, item, context) => {
34733
- if (item.type === "draw") sync$10(container, item, context);
34801
+ if (item.type === "draw") sync$11(container, item, context);
34734
34802
  },
34735
34803
  renderFar: (graphics, item, context) => {
34736
34804
  if (item.type !== "draw") return;
@@ -34743,15 +34811,15 @@ const drawCardRenderer = {
34743
34811
  });
34744
34812
  },
34745
34813
  destroy: (container) => {
34746
- partsByContainer$10.get(container)?.root.destroy({ children: true });
34747
- partsByContainer$10.delete(container);
34814
+ partsByContainer$11.get(container)?.root.destroy({ children: true });
34815
+ partsByContainer$11.delete(container);
34748
34816
  }
34749
34817
  };
34750
34818
  //#endregion
34751
34819
  //#region ../sdk/src/board/render/renderers/effect-card-renderer.ts
34752
34820
  const BOARD_EFFECT_MAX_PARTICLES = 4e3;
34753
34821
  const TRAIL_SAMPLES = 64;
34754
- const partsByContainer$9 = /* @__PURE__ */ new WeakMap();
34822
+ const partsByContainer$10 = /* @__PURE__ */ new WeakMap();
34755
34823
  function hashString(value) {
34756
34824
  let hash = 2166136261;
34757
34825
  for (let index = 0; index < value.length; index += 1) {
@@ -34892,8 +34960,8 @@ function drawTrail(graphics, parts, item, context, color) {
34892
34960
  });
34893
34961
  }
34894
34962
  }
34895
- function sync$9(container, item, context) {
34896
- const parts = partsByContainer$9.get(container);
34963
+ function sync$10(container, item, context) {
34964
+ const parts = partsByContainer$10.get(container);
34897
34965
  if (!parts) return;
34898
34966
  positionShell(parts.root, item);
34899
34967
  const { width, height } = item.frame;
@@ -34928,16 +34996,16 @@ const effectCardRenderer = {
34928
34996
  const root = new Container();
34929
34997
  const graphics = new Graphics();
34930
34998
  root.addChild(graphics);
34931
- partsByContainer$9.set(root, {
34999
+ partsByContainer$10.set(root, {
34932
35000
  root,
34933
35001
  graphics,
34934
35002
  trail: []
34935
35003
  });
34936
- if (item.type === "effect") sync$9(root, item, context);
35004
+ if (item.type === "effect") sync$10(root, item, context);
34937
35005
  return root;
34938
35006
  },
34939
35007
  update: (container, item, context) => {
34940
- if (item.type === "effect") sync$9(container, item, context);
35008
+ if (item.type === "effect") sync$10(container, item, context);
34941
35009
  },
34942
35010
  renderFar: (graphics, item, context) => {
34943
35011
  if (item.type !== "effect") return;
@@ -34947,8 +35015,8 @@ const effectCardRenderer = {
34947
35015
  });
34948
35016
  },
34949
35017
  destroy: (container) => {
34950
- partsByContainer$9.get(container)?.root.destroy({ children: true });
34951
- partsByContainer$9.delete(container);
35018
+ partsByContainer$10.get(container)?.root.destroy({ children: true });
35019
+ partsByContainer$10.delete(container);
34952
35020
  }
34953
35021
  };
34954
35022
  //#endregion
@@ -34956,21 +35024,21 @@ const effectCardRenderer = {
34956
35024
  const PADDING$1 = 10;
34957
35025
  const COVER_RATIO = .56;
34958
35026
  const MIN_BODY_FOR_COVER = 38;
34959
- const TITLE_SIZE = 13;
34960
- const TITLE_LINE = TITLE_SIZE * 1.35;
35027
+ const TITLE_SIZE$1 = 13;
35028
+ const TITLE_LINE$1 = TITLE_SIZE$1 * 1.35;
34961
35029
  const TITLE_MAX_LINES = 2;
34962
- const EXCERPT_SIZE = 11;
34963
- const EXCERPT_LINE = EXCERPT_SIZE * 1.45;
34964
- const EXCERPT_MAX_LINES = 3;
35030
+ const EXCERPT_SIZE$1 = 11;
35031
+ const EXCERPT_LINE$1 = EXCERPT_SIZE$1 * 1.45;
35032
+ const EXCERPT_MAX_LINES$1 = 3;
34965
35033
  const TYPE_MARK_SIZE = 28;
34966
- const GAP = 4;
35034
+ const GAP$1 = 4;
34967
35035
  const STRIPE = 2;
34968
35036
  const MAX_DASHES = 40;
34969
- const partsByContainer$8 = /* @__PURE__ */ new WeakMap();
35037
+ const partsByContainer$9 = /* @__PURE__ */ new WeakMap();
34970
35038
  function detailFor(zoom) {
34971
35039
  return boardCardDetailed(zoom) ? "full" : "title";
34972
35040
  }
34973
- function viewOf(item) {
35041
+ function viewOf$1(item) {
34974
35042
  if (item.type === "file") {
34975
35043
  const { src, snapshot } = item.props;
34976
35044
  return {
@@ -35001,7 +35069,7 @@ function coverHeight(view, height) {
35001
35069
  const ideal = Math.round(height * COVER_RATIO);
35002
35070
  return Math.max(0, Math.min(ideal, height - MIN_BODY_FOR_COVER));
35003
35071
  }
35004
- function linesInRoom(room, lineHeight, max) {
35072
+ function linesInRoom$1(room, lineHeight, max) {
35005
35073
  if (room < lineHeight * .85) return 0;
35006
35074
  return Math.max(0, Math.min(max, Math.floor((room + .5) / lineHeight)));
35007
35075
  }
@@ -35014,9 +35082,9 @@ function layoutCover(sprite, width, height, texture) {
35014
35082
  function syncClip(parts, rect, style) {
35015
35083
  traceCardOutline(parts.clip.clear(), rect, style).fill({ color: 16777215 });
35016
35084
  }
35017
- function sync$8(container, item, context) {
35018
- const parts = partsByContainer$8.get(container);
35019
- const view = viewOf(item);
35085
+ function sync$9(container, item, context) {
35086
+ const parts = partsByContainer$9.get(container);
35087
+ const view = viewOf$1(item);
35020
35088
  if (!parts || !view) return;
35021
35089
  syncContent(parts, item, view, context);
35022
35090
  for (const text of [
@@ -35131,9 +35199,9 @@ function syncContent(parts, item, view, context) {
35131
35199
  if (parts.typeMark.text !== mark) parts.typeMark.text = mark;
35132
35200
  parts.typeMark.position.set(PADDING$1, cursor);
35133
35201
  parts.typeMark.visible = true;
35134
- cursor += parts.typeMark.height + GAP;
35202
+ cursor += parts.typeMark.height + GAP$1;
35135
35203
  } else parts.typeMark.visible = false;
35136
- const titleLines = linesInRoom(Math.max(0, contentBottom - cursor), TITLE_LINE, TITLE_MAX_LINES);
35204
+ const titleLines = linesInRoom$1(Math.max(0, contentBottom - cursor), TITLE_LINE$1, TITLE_MAX_LINES);
35137
35205
  parts.title.style.fill = context.palette.text;
35138
35206
  fitTextToLines(parts.title, title, titleLines, innerWidth);
35139
35207
  parts.title.position.set(PADDING$1, cursor);
@@ -35142,8 +35210,8 @@ function syncContent(parts, item, view, context) {
35142
35210
  parts.excerpt.visible = false;
35143
35211
  return;
35144
35212
  }
35145
- const excerptTop = cursor + (titleLines > 0 ? parts.title.height + GAP : 0);
35146
- const excerptLines = linesInRoom(contentBottom - excerptTop, EXCERPT_LINE, EXCERPT_MAX_LINES);
35213
+ const excerptTop = cursor + (titleLines > 0 ? parts.title.height + GAP$1 : 0);
35214
+ const excerptLines = linesInRoom$1(contentBottom - excerptTop, EXCERPT_LINE$1, EXCERPT_MAX_LINES$1);
35147
35215
  const showExcerpt = Boolean(excerpt) && excerptLines > 0;
35148
35216
  if (showExcerpt) {
35149
35217
  parts.excerpt.style.fill = context.palette.muted;
@@ -35169,9 +35237,9 @@ const fileCardRenderer = {
35169
35237
  style: {
35170
35238
  fill: context.palette.text,
35171
35239
  fontFamily: BOARD_FONT_STACK,
35172
- fontSize: TITLE_SIZE,
35240
+ fontSize: TITLE_SIZE$1,
35173
35241
  fontWeight: "600",
35174
- lineHeight: TITLE_LINE
35242
+ lineHeight: TITLE_LINE$1
35175
35243
  },
35176
35244
  resolution,
35177
35245
  roundPixels: true
@@ -35181,9 +35249,9 @@ const fileCardRenderer = {
35181
35249
  style: {
35182
35250
  fill: context.palette.muted,
35183
35251
  fontFamily: BOARD_FONT_STACK,
35184
- fontSize: EXCERPT_SIZE,
35252
+ fontSize: EXCERPT_SIZE$1,
35185
35253
  fontWeight: "400",
35186
- lineHeight: EXCERPT_LINE
35254
+ lineHeight: EXCERPT_LINE$1
35187
35255
  },
35188
35256
  resolution,
35189
35257
  roundPixels: true
@@ -35204,7 +35272,7 @@ const fileCardRenderer = {
35204
35272
  body.addChild(cover, coverMask, typeMark, title, excerpt);
35205
35273
  const tag = createCardTag();
35206
35274
  root.addChild(plate, body, clip, tag.root);
35207
- partsByContainer$8.set(root, {
35275
+ partsByContainer$9.set(root, {
35208
35276
  tag,
35209
35277
  root,
35210
35278
  plate,
@@ -35218,17 +35286,17 @@ const fileCardRenderer = {
35218
35286
  visualSig: "",
35219
35287
  textSig: ""
35220
35288
  });
35221
- sync$8(root, item, context);
35289
+ sync$9(root, item, context);
35222
35290
  return root;
35223
35291
  },
35224
- update: sync$8,
35225
- resolution: sync$8,
35292
+ update: sync$9,
35293
+ resolution: sync$9,
35226
35294
  zoom: (container, zoom) => {
35227
- const tag = partsByContainer$8.get(container)?.tag;
35295
+ const tag = partsByContainer$9.get(container)?.tag;
35228
35296
  if (tag) zoomCardTag(tag, zoom);
35229
35297
  },
35230
35298
  renderFar: (graphics, item, context) => {
35231
- const category = viewOf(item)?.category ?? "other";
35299
+ const category = viewOf$1(item)?.category ?? "other";
35232
35300
  drawFarPlate(graphics, item.frame, {
35233
35301
  fill: farPictureTone(item, context) ?? context.palette.surface,
35234
35302
  fillAlpha: .96,
@@ -35237,16 +35305,16 @@ const fileCardRenderer = {
35237
35305
  });
35238
35306
  },
35239
35307
  destroy: (container) => {
35240
- partsByContainer$8.get(container)?.root.destroy({ children: true });
35241
- partsByContainer$8.delete(container);
35308
+ partsByContainer$9.get(container)?.root.destroy({ children: true });
35309
+ partsByContainer$9.delete(container);
35242
35310
  }
35243
35311
  };
35244
35312
  //#endregion
35245
35313
  //#region ../sdk/src/board/render/renderers/frame-card-renderer.ts
35246
- const partsByContainer$7 = /* @__PURE__ */ new WeakMap();
35314
+ const partsByContainer$8 = /* @__PURE__ */ new WeakMap();
35247
35315
  const DEFAULT_WASH = .04;
35248
- function sync$7(container, item, context) {
35249
- const parts = partsByContainer$7.get(container);
35316
+ function sync$8(container, item, context) {
35317
+ const parts = partsByContainer$8.get(container);
35250
35318
  if (!parts) return;
35251
35319
  const { frame, style, props, locked } = item;
35252
35320
  positionShell(parts.root, item);
@@ -35325,21 +35393,21 @@ const frameCardRenderer = {
35325
35393
  fontWeight: "600"
35326
35394
  }, context.textResolution);
35327
35395
  root.addChild(box, label);
35328
- partsByContainer$7.set(root, {
35396
+ partsByContainer$8.set(root, {
35329
35397
  root,
35330
35398
  box,
35331
35399
  label,
35332
35400
  visualSig: "",
35333
35401
  textSig: ""
35334
35402
  });
35335
- if (item.type === "frame") sync$7(root, item, context);
35403
+ if (item.type === "frame") sync$8(root, item, context);
35336
35404
  return root;
35337
35405
  },
35338
35406
  update: (container, item, context) => {
35339
- if (item.type === "frame") sync$7(container, item, context);
35407
+ if (item.type === "frame") sync$8(container, item, context);
35340
35408
  },
35341
35409
  resolution: (container, _item, context) => {
35342
- const parts = partsByContainer$7.get(container);
35410
+ const parts = partsByContainer$8.get(container);
35343
35411
  if (parts) syncTextResolution(parts.label, context.textResolution);
35344
35412
  },
35345
35413
  renderFar: (graphics, item, context) => {
@@ -35350,14 +35418,14 @@ const frameCardRenderer = {
35350
35418
  });
35351
35419
  },
35352
35420
  destroy: (container) => {
35353
- partsByContainer$7.delete(container);
35421
+ partsByContainer$8.delete(container);
35354
35422
  container.destroy({ children: true });
35355
35423
  }
35356
35424
  };
35357
35425
  //#endregion
35358
35426
  //#region ../sdk/src/board/render/renderers/shape-card-renderer.ts
35359
35427
  const DEFAULT_ROUNDED_RADIUS = 8;
35360
- const partsByContainer$6 = /* @__PURE__ */ new WeakMap();
35428
+ const partsByContainer$7 = /* @__PURE__ */ new WeakMap();
35361
35429
  const pathCache = /* @__PURE__ */ new Map();
35362
35430
  function parsedPath(d) {
35363
35431
  if (pathCache.has(d)) return pathCache.get(d) ?? null;
@@ -35438,8 +35506,8 @@ function outlinePoints(geometry, width, height, radius) {
35438
35506
  default: return roundRectPoints(width, height, radius);
35439
35507
  }
35440
35508
  }
35441
- function sync$6(container, item, context) {
35442
- const parts = partsByContainer$6.get(container);
35509
+ function sync$7(container, item, context) {
35510
+ const parts = partsByContainer$7.get(container);
35443
35511
  if (!parts) return;
35444
35512
  positionShell(parts.root, item);
35445
35513
  const { width, height } = item.frame;
@@ -35533,21 +35601,21 @@ const shapeCardRenderer = {
35533
35601
  roundPixels: true
35534
35602
  });
35535
35603
  root.addChild(shape, label);
35536
- partsByContainer$6.set(root, {
35604
+ partsByContainer$7.set(root, {
35537
35605
  root,
35538
35606
  shape,
35539
35607
  label,
35540
35608
  visualSig: "",
35541
35609
  textSig: ""
35542
35610
  });
35543
- if (item.type === "shape") sync$6(root, item, context);
35611
+ if (item.type === "shape") sync$7(root, item, context);
35544
35612
  return root;
35545
35613
  },
35546
35614
  update: (container, item, context) => {
35547
- if (item.type === "shape") sync$6(container, item, context);
35615
+ if (item.type === "shape") sync$7(container, item, context);
35548
35616
  },
35549
35617
  resolution: (container, _item, context) => {
35550
- const parts = partsByContainer$6.get(container);
35618
+ const parts = partsByContainer$7.get(container);
35551
35619
  if (parts) syncTextResolution(parts.label, context.textResolution);
35552
35620
  },
35553
35621
  renderFar: (graphics, item, context) => {
@@ -35560,16 +35628,16 @@ const shapeCardRenderer = {
35560
35628
  });
35561
35629
  },
35562
35630
  destroy: (container) => {
35563
- partsByContainer$6.get(container)?.root.destroy({ children: true });
35564
- partsByContainer$6.delete(container);
35631
+ partsByContainer$7.get(container)?.root.destroy({ children: true });
35632
+ partsByContainer$7.delete(container);
35565
35633
  }
35566
35634
  };
35567
35635
  //#endregion
35568
35636
  //#region ../sdk/src/board/render/renderers/custom-card-renderer.ts
35569
- const partsByContainer$5 = /* @__PURE__ */ new WeakMap();
35637
+ const partsByContainer$6 = /* @__PURE__ */ new WeakMap();
35570
35638
  const LABEL_LINE = 16;
35571
- function sync$5(container, item, context) {
35572
- const parts = partsByContainer$5.get(container);
35639
+ function sync$6(container, item, context) {
35640
+ const parts = partsByContainer$6.get(container);
35573
35641
  if (!parts) return;
35574
35642
  if (parts.id !== item.id) {
35575
35643
  context.scripts?.release(parts.id);
@@ -35629,7 +35697,7 @@ const customCardRenderer = {
35629
35697
  });
35630
35698
  label.anchor.set(.5);
35631
35699
  root.addChild(sprite, placeholder, label);
35632
- partsByContainer$5.set(root, {
35700
+ partsByContainer$6.set(root, {
35633
35701
  id: item.id,
35634
35702
  root,
35635
35703
  sprite,
@@ -35637,14 +35705,14 @@ const customCardRenderer = {
35637
35705
  label,
35638
35706
  sig: ""
35639
35707
  });
35640
- if (item.type === "custom") sync$5(root, item, context);
35708
+ if (item.type === "custom") sync$6(root, item, context);
35641
35709
  return root;
35642
35710
  },
35643
35711
  update: (container, item, context) => {
35644
- if (item.type === "custom") sync$5(container, item, context);
35712
+ if (item.type === "custom") sync$6(container, item, context);
35645
35713
  },
35646
35714
  resolution: (container, _item, context) => {
35647
- const parts = partsByContainer$5.get(container);
35715
+ const parts = partsByContainer$6.get(container);
35648
35716
  if (parts) syncTextResolution(parts.label, context.textResolution);
35649
35717
  },
35650
35718
  renderFar: (graphics, item, context) => {
@@ -35654,15 +35722,15 @@ const customCardRenderer = {
35654
35722
  });
35655
35723
  },
35656
35724
  destroy: (container, context) => {
35657
- const parts = partsByContainer$5.get(container);
35725
+ const parts = partsByContainer$6.get(container);
35658
35726
  if (parts) context.scripts?.release(parts.id);
35659
35727
  parts?.root.destroy({ children: true });
35660
- partsByContainer$5.delete(container);
35728
+ partsByContainer$6.delete(container);
35661
35729
  }
35662
35730
  };
35663
35731
  //#endregion
35664
35732
  //#region ../sdk/src/board/render/renderers/image-card-renderer.ts
35665
- const partsByContainer$4 = /* @__PURE__ */ new WeakMap();
35733
+ const partsByContainer$5 = /* @__PURE__ */ new WeakMap();
35666
35734
  function cropRect(crop) {
35667
35735
  if (!crop) return null;
35668
35736
  const w = Math.min(crop.w, 1 - crop.x);
@@ -35677,8 +35745,8 @@ function cropRect(crop) {
35677
35745
  const PRINT_MARGIN = 6;
35678
35746
  const FADE_MS = 160;
35679
35747
  const FAR_ALPHA = .9;
35680
- function sync$4(container, item, context) {
35681
- const parts = partsByContainer$4.get(container);
35748
+ function sync$5(container, item, context) {
35749
+ const parts = partsByContainer$5.get(container);
35682
35750
  if (!parts) return;
35683
35751
  positionShell(parts.root, item);
35684
35752
  const { width, height } = item.frame;
@@ -35768,7 +35836,7 @@ const imageCardRenderer = {
35768
35836
  const placeholder = new Graphics();
35769
35837
  const picture = new Graphics();
35770
35838
  root.addChild(placeholder, picture);
35771
- partsByContainer$4.set(root, {
35839
+ partsByContainer$5.set(root, {
35772
35840
  root,
35773
35841
  placeholder,
35774
35842
  picture,
@@ -35777,14 +35845,14 @@ const imageCardRenderer = {
35777
35845
  fadeFrom: null,
35778
35846
  clearSurface: false
35779
35847
  });
35780
- if (item.type === "image") sync$4(root, item, context);
35848
+ if (item.type === "image") sync$5(root, item, context);
35781
35849
  return root;
35782
35850
  },
35783
35851
  update: (container, item, context) => {
35784
- if (item.type === "image") sync$4(container, item, context);
35852
+ if (item.type === "image") sync$5(container, item, context);
35785
35853
  },
35786
35854
  tick: (container, clock) => {
35787
- const parts = partsByContainer$4.get(container);
35855
+ const parts = partsByContainer$5.get(container);
35788
35856
  if (parts?.fadeFrom == null) return null;
35789
35857
  const progress = Math.min(1, Math.max(0, (clock - parts.fadeFrom) / FADE_MS));
35790
35858
  parts.picture.alpha = 1 - (1 - progress) ** 3;
@@ -35800,6 +35868,367 @@ const imageCardRenderer = {
35800
35868
  fillAlpha: FAR_ALPHA
35801
35869
  });
35802
35870
  },
35871
+ destroy: (container) => {
35872
+ partsByContainer$5.get(container)?.root.destroy({ children: true });
35873
+ partsByContainer$5.delete(container);
35874
+ }
35875
+ };
35876
+ //#endregion
35877
+ //#region ../sdk/src/board/render/renderers/session-card-renderer.ts
35878
+ const PAD_X = 14;
35879
+ const PAD_Y = 12;
35880
+ const TITLE_SIZE = 14;
35881
+ const TITLE_LINE = 19;
35882
+ const STATUS_SIZE = 11.5;
35883
+ const STATUS_LINE = 16;
35884
+ const EXCERPT_SIZE = 12;
35885
+ const EXCERPT_LINE = 18;
35886
+ const EXCERPT_MAX_LINES = 6;
35887
+ const MODEL_SIZE = 10;
35888
+ const MODEL_LINE = 14;
35889
+ const GAP = 6;
35890
+ const DOT = 4;
35891
+ const UNREAD = 6;
35892
+ const RING = 8;
35893
+ const UNAVAILABLE_ALPHA = .55;
35894
+ const SECOND$1 = 1e3;
35895
+ const WAVE_FRAME_MS = 150;
35896
+ const PIP_SCREEN = 6;
35897
+ const partsByContainer$4 = /* @__PURE__ */ new WeakMap();
35898
+ const pad = (value) => String(value).padStart(2, "0");
35899
+ function compactTime(value) {
35900
+ const date = value ? new Date(value) : null;
35901
+ if (!date || Number.isNaN(date.getTime())) return "";
35902
+ const now = /* @__PURE__ */ new Date();
35903
+ const time = `${pad(date.getHours())}:${pad(date.getMinutes())}`;
35904
+ if (date.toDateString() === now.toDateString()) return time;
35905
+ const day = `${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;
35906
+ return date.getFullYear() === now.getFullYear() ? `${day} ${time}` : `${date.getFullYear()}-${day}`;
35907
+ }
35908
+ function sourceName(source) {
35909
+ const key = source?.trim().toLowerCase().replace(/^channel[:_]/, "").split(":")[0] ?? "";
35910
+ if (!key || key === "web" || key === "web_app") return "";
35911
+ if (key === "cli") return "CLI";
35912
+ return key.charAt(0).toUpperCase() + key.slice(1).replace(/_/g, " ");
35913
+ }
35914
+ function snapshotView(item, context, unavailable) {
35915
+ const { snapshot } = item.props;
35916
+ const status = snapshot.issue ?? "idle";
35917
+ const excerpt = (status === "failed" ? snapshot.errorExcerpt : void 0) ?? snapshot.excerpt ?? null;
35918
+ const meta = unavailable ? context.labels.sessionUnavailable : [sourceName(snapshot.source), compactTime(snapshot.activityAt)].filter(Boolean).join(" · ");
35919
+ return {
35920
+ title: snapshot.title || excerpt || context.labels.sessionUntitled,
35921
+ excerpt: snapshot.title ? excerpt : null,
35922
+ meta,
35923
+ status: unavailable ? "idle" : status,
35924
+ label: unavailable ? "" : status === "failed" ? context.labels.failed : status === "lost" ? context.labels.sessionLost : "",
35925
+ startedAt: null,
35926
+ model: null,
35927
+ unread: false,
35928
+ unavailable
35929
+ };
35930
+ }
35931
+ function viewOf(item, context) {
35932
+ const live = context.session?.(item.props.sessionId) ?? null;
35933
+ if (live === "unavailable") return snapshotView(item, context, true);
35934
+ return live ? {
35935
+ ...live,
35936
+ unavailable: false
35937
+ } : snapshotView(item, context, false);
35938
+ }
35939
+ function statusColor$1(status, context) {
35940
+ if (status === "running") return context.palette.activity;
35941
+ if (status === "failed") return context.palette.error;
35942
+ if (status === "lost") return context.palette.warning;
35943
+ return context.palette.muted;
35944
+ }
35945
+ function waveFor(status, context) {
35946
+ if (context.reducedMotion) return null;
35947
+ if (status === "running") return 1200;
35948
+ return status === "stopping" ? 2400 : null;
35949
+ }
35950
+ const RESTING_ALPHA = [
35951
+ 1,
35952
+ .6,
35953
+ .32
35954
+ ];
35955
+ function waveAlpha(index, clock, period) {
35956
+ const phase = ((clock - index * 150) % period + period) % period / period;
35957
+ return .32 + .68 * Math.max(0, Math.sin(phase * Math.PI * 2));
35958
+ }
35959
+ function drawDot(graphics, x, y, size, color, pixel) {
35960
+ graphics.clear();
35961
+ if (pixel) graphics.rect(x, y, size, size);
35962
+ else graphics.circle(x + size / 2, y + size / 2, size / 2);
35963
+ graphics.fill({ color });
35964
+ }
35965
+ function advance$1(parts, clock) {
35966
+ const { motion } = parts;
35967
+ let next = null;
35968
+ if (motion.wave) {
35969
+ const frame = Math.floor(clock / WAVE_FRAME_MS);
35970
+ if (frame !== motion.frame) {
35971
+ motion.frame = frame;
35972
+ const at = frame * WAVE_FRAME_MS;
35973
+ motion.wave.dots.forEach((dot, index) => {
35974
+ dot.alpha = waveAlpha(index, at, motion.wave.period);
35975
+ });
35976
+ }
35977
+ next = WAVE_FRAME_MS - clock % WAVE_FRAME_MS;
35978
+ }
35979
+ if (motion.startedAt !== null) {
35980
+ const elapsedMs = Date.now() - motion.startedAt;
35981
+ const elapsed = formatBoardDuration(elapsedMs);
35982
+ if (elapsed !== motion.elapsed) {
35983
+ motion.elapsed = elapsed;
35984
+ fitTextToWidth(parts.status, `${motion.label} · ${elapsed}`, motion.width);
35985
+ }
35986
+ const untilNextSecond = SECOND$1 - Math.max(0, elapsedMs) % SECOND$1;
35987
+ next = next === null ? untilNextSecond : Math.min(next, untilNextSecond);
35988
+ }
35989
+ return next;
35990
+ }
35991
+ function linesInRoom(room, lineHeight, max) {
35992
+ return room < lineHeight * .85 ? 0 : Math.max(0, Math.min(max, Math.floor((room + .5) / lineHeight)));
35993
+ }
35994
+ function sync$4(container, item, context) {
35995
+ const parts = partsByContainer$4.get(container);
35996
+ if (!parts) return;
35997
+ positionShell(parts.root, item);
35998
+ const { width, height } = item.frame;
35999
+ const view = viewOf(item, context);
36000
+ const full = boardCardDetailed(context.zoom);
36001
+ const elevation = cardElevation(context, item.id);
36002
+ const pixel = context.style.corner === "pixel";
36003
+ const color = statusColor$1(view.status, context);
36004
+ const showStatus = view.status !== "idle";
36005
+ const ring = view.status === "failed" || view.status === "lost";
36006
+ const counting = full && view.status === "running" && view.startedAt !== null;
36007
+ const elapsed = counting ? formatBoardDuration(Date.now() - view.startedAt) : "";
36008
+ const innerWidth = Math.max(1, width - 28);
36009
+ syncCardTag(parts.tag, {
36010
+ glyph: "session",
36011
+ text: view.meta,
36012
+ width
36013
+ }, context);
36014
+ const pip = full ? 0 : Math.round(Math.min(Math.max(PIP_SCREEN / context.zoom, DOT), Math.min(width, height) * .2));
36015
+ const textSig = [
36016
+ view.title,
36017
+ view.excerpt,
36018
+ view.label,
36019
+ counting,
36020
+ view.model,
36021
+ view.unread,
36022
+ showStatus,
36023
+ full,
36024
+ pip,
36025
+ width,
36026
+ height,
36027
+ color,
36028
+ context.palette.text,
36029
+ context.palette.muted,
36030
+ context.style.font,
36031
+ context.themeKey
36032
+ ].join("|");
36033
+ if (textSig !== parts.textSig) {
36034
+ parts.textSig = textSig;
36035
+ for (const text of [
36036
+ parts.title,
36037
+ parts.status,
36038
+ parts.excerpt
36039
+ ]) text.style.fontFamily = context.style.font;
36040
+ const statusLeft = PAD_X + (ring ? RING : 15) + GAP;
36041
+ let cursor = PAD_Y;
36042
+ parts.title.style.fill = context.palette.text;
36043
+ const titleRoom = innerWidth - (full ? view.unread ? 12 : 0 : showStatus ? pip + GAP : 0);
36044
+ fitTextToWidth(parts.title, view.title, Math.max(1, titleRoom));
36045
+ parts.title.position.set(PAD_X, cursor);
36046
+ cursor += TITLE_LINE;
36047
+ parts.status.visible = showStatus && full;
36048
+ if (showStatus) {
36049
+ cursor += 4;
36050
+ parts.status.style.fill = color;
36051
+ fitTextToWidth(parts.status, counting ? `${view.label} · ${elapsed}` : view.label, Math.max(1, width - statusLeft - PAD_X));
36052
+ parts.status.position.set(statusLeft, cursor);
36053
+ cursor += STATUS_LINE;
36054
+ }
36055
+ const showModel = full && Boolean(view.model);
36056
+ parts.model.visible = showModel;
36057
+ if (showModel) {
36058
+ parts.model.style.fill = context.palette.muted;
36059
+ fitTextToWidth(parts.model, view.model, innerWidth);
36060
+ parts.model.position.set(width - PAD_X - parts.model.width, height - PAD_Y - MODEL_LINE + 2);
36061
+ }
36062
+ const bottom = height - PAD_Y - (showModel ? 20 : 0);
36063
+ const lines = full && view.excerpt ? linesInRoom(bottom - cursor - GAP, EXCERPT_LINE, EXCERPT_MAX_LINES) : 0;
36064
+ parts.excerpt.visible = lines > 0;
36065
+ if (lines > 0) {
36066
+ parts.excerpt.style.fill = context.palette.muted;
36067
+ fitTextToLines(parts.excerpt, view.excerpt, lines, innerWidth);
36068
+ parts.excerpt.position.set(PAD_X, cursor + GAP);
36069
+ }
36070
+ }
36071
+ for (const text of [
36072
+ parts.title,
36073
+ parts.status,
36074
+ parts.excerpt,
36075
+ parts.model
36076
+ ]) syncTextResolution(text, context.textResolution);
36077
+ const visualSig = [
36078
+ width,
36079
+ height,
36080
+ pip,
36081
+ elevation,
36082
+ view.status,
36083
+ view.unread,
36084
+ view.unavailable,
36085
+ full,
36086
+ pixel,
36087
+ color,
36088
+ parts.title.width,
36089
+ context.palette.activity,
36090
+ context.palette.surface,
36091
+ context.themeKey
36092
+ ].join("|");
36093
+ if (visualSig !== parts.visualSig) {
36094
+ parts.visualSig = visualSig;
36095
+ const rect = {
36096
+ x: 0,
36097
+ y: 0,
36098
+ width,
36099
+ height
36100
+ };
36101
+ drawCardSurface(parts.plate.clear(), rect, context.style, {
36102
+ fill: context.palette.surface,
36103
+ border: context.palette.border,
36104
+ borderAlpha: .85,
36105
+ elevation
36106
+ });
36107
+ traceCardOutline(parts.clip.clear(), rect, context.style, -1).fill({ color: 16777215 });
36108
+ parts.content.alpha = view.unavailable ? UNAVAILABLE_ALPHA : 1;
36109
+ const markY = 43;
36110
+ parts.mark.clear();
36111
+ parts.mark.alpha = view.status === "queued" ? .7 : 1;
36112
+ for (const dot of parts.dots) dot.visible = false;
36113
+ if (showStatus && !full) drawDot(parts.mark, width - PAD_X - pip, PAD_Y, pip, color, pixel);
36114
+ else if (showStatus && ring) {
36115
+ if (pixel) parts.mark.rect(PAD_X, markY - RING / 2, RING, RING);
36116
+ else parts.mark.circle(18, markY, RING / 2 - .75);
36117
+ parts.mark.stroke({
36118
+ color,
36119
+ width: 1.5,
36120
+ alignment: pixel ? 1 : .5
36121
+ });
36122
+ } else if (showStatus) parts.dots.forEach((dot, index) => {
36123
+ drawDot(dot, PAD_X + index * 5.5, markY - DOT / 2, DOT, color, pixel);
36124
+ dot.alpha = (view.status === "queued" ? .7 : 1) * (RESTING_ALPHA[index] ?? 1);
36125
+ dot.visible = true;
36126
+ });
36127
+ parts.unread.visible = full && view.unread && !view.unavailable;
36128
+ if (parts.unread.visible) drawDot(parts.unread, PAD_X + parts.title.width + GAP, 18.5, UNREAD, context.palette.activity, pixel);
36129
+ }
36130
+ const wave = full && showStatus && !ring ? waveFor(view.status, context) : null;
36131
+ parts.motion.wave = wave ? {
36132
+ period: wave,
36133
+ dots: parts.dots
36134
+ } : null;
36135
+ if (!wave) parts.motion.frame = -1;
36136
+ parts.motion.startedAt = counting ? view.startedAt : null;
36137
+ parts.motion.label = view.label;
36138
+ parts.motion.elapsed = elapsed;
36139
+ parts.motion.width = Math.max(1, width - 35 - PAD_X);
36140
+ }
36141
+ function isSession(item) {
36142
+ return item.type === "session";
36143
+ }
36144
+ const sessionCardRenderer = {
36145
+ id: "session-card",
36146
+ canRender: isSession,
36147
+ create: (item, context) => {
36148
+ const root = new Container();
36149
+ const plate = new Graphics();
36150
+ const clip = new Graphics();
36151
+ const content = new Container();
36152
+ const mark = new Graphics();
36153
+ const dots = [
36154
+ new Graphics(),
36155
+ new Graphics(),
36156
+ new Graphics()
36157
+ ];
36158
+ const unread = new Graphics();
36159
+ const text = (fontFamily, fontSize, fontWeight, lineHeight) => new Text({
36160
+ text: "",
36161
+ style: {
36162
+ fontFamily,
36163
+ fontSize,
36164
+ fontWeight,
36165
+ lineHeight
36166
+ },
36167
+ resolution: context.textResolution,
36168
+ roundPixels: true
36169
+ });
36170
+ const title = text(context.style.font, TITLE_SIZE, "600", TITLE_LINE);
36171
+ const status = text(context.style.font, STATUS_SIZE, "500", STATUS_LINE);
36172
+ const excerpt = text(context.style.font, EXCERPT_SIZE, "400", EXCERPT_LINE);
36173
+ const model = text(BOARD_MONO_FONT_STACK, MODEL_SIZE, "500", MODEL_LINE);
36174
+ content.mask = clip;
36175
+ content.addChild(mark, ...dots, unread, title, status, excerpt, model);
36176
+ const tag = createCardTag();
36177
+ root.addChild(plate, content, clip, tag.root);
36178
+ partsByContainer$4.set(root, {
36179
+ root,
36180
+ plate,
36181
+ content,
36182
+ clip,
36183
+ mark,
36184
+ dots,
36185
+ unread,
36186
+ title,
36187
+ status,
36188
+ excerpt,
36189
+ model,
36190
+ tag,
36191
+ visualSig: "",
36192
+ textSig: "",
36193
+ motion: {
36194
+ wave: null,
36195
+ frame: -1,
36196
+ startedAt: null,
36197
+ label: "",
36198
+ elapsed: "",
36199
+ width: 0
36200
+ }
36201
+ });
36202
+ if (isSession(item)) sync$4(root, item, context);
36203
+ return root;
36204
+ },
36205
+ update: (container, item, context) => {
36206
+ if (isSession(item)) sync$4(container, item, context);
36207
+ },
36208
+ resolution: (container, item, context) => {
36209
+ if (isSession(item)) sync$4(container, item, context);
36210
+ },
36211
+ tick: (container, clock) => {
36212
+ const parts = partsByContainer$4.get(container);
36213
+ return parts ? advance$1(parts, clock) : null;
36214
+ },
36215
+ zoom: (container, zoom) => {
36216
+ const tag = partsByContainer$4.get(container)?.tag;
36217
+ if (tag) zoomCardTag(tag, zoom);
36218
+ },
36219
+ renderFar: (graphics, item, context) => {
36220
+ if (!isSession(item)) return;
36221
+ const { status, unavailable } = viewOf(item, context);
36222
+ const active = !unavailable && (status === "running" || status === "failed" || status === "lost");
36223
+ drawFarPlate(graphics, item.frame, {
36224
+ fill: context.palette.surface,
36225
+ fillAlpha: unavailable ? .6 : .96,
36226
+ ...active ? {
36227
+ accent: statusColor$1(status, context),
36228
+ accentAlpha: .9
36229
+ } : {}
36230
+ });
36231
+ },
35803
36232
  destroy: (container) => {
35804
36233
  partsByContainer$4.get(container)?.root.destroy({ children: true });
35805
36234
  partsByContainer$4.delete(container);
@@ -36700,7 +37129,10 @@ const DEFAULT_BOARD_RENDER_LABELS = {
36700
37129
  generating: "Generating",
36701
37130
  failed: "Failed",
36702
37131
  previewUnavailable: "Preview unavailable",
36703
- noPreview: "No preview"
37132
+ noPreview: "No preview",
37133
+ sessionUntitled: "New chat",
37134
+ sessionLost: "Run lost",
37135
+ sessionUnavailable: "Unavailable"
36704
37136
  };
36705
37137
  const playable = (renderer) => ({
36706
37138
  ...renderer,
@@ -36714,6 +37146,7 @@ const builtinCardRenderers = [
36714
37146
  playable(modelCardRenderer),
36715
37147
  fileCardRenderer,
36716
37148
  playable(taskCardRenderer),
37149
+ sessionCardRenderer,
36717
37150
  shapeCardRenderer,
36718
37151
  drawCardRenderer,
36719
37152
  arrowCardRenderer,
@@ -36767,6 +37200,10 @@ const BOARD_DEFAULT_SIZES = {
36767
37200
  width: 480,
36768
37201
  height: 270
36769
37202
  },
37203
+ session: {
37204
+ width: 320,
37205
+ height: 176
37206
+ },
36770
37207
  effect: {
36771
37208
  width: 240,
36772
37209
  height: 240
@@ -36975,7 +37412,7 @@ object({
36975
37412
  type: literal("frame"),
36976
37413
  props: object({
36977
37414
  label: string().max(280).default(""),
36978
- decoration: _enum(["frame", "none"]).optional().describe("none hides the title, border and background: an invisible group whose tracks move every child."),
37415
+ decoration: _enum(["frame", "none"]).optional().describe("none hides the title, border and background: an invisible group whose tracks move every child; with a label it is also a page viewers step to."),
36979
37416
  clip: boolean().default(true).describe("Hide children outside the frame.")
36980
37417
  }).strict().prefault({})
36981
37418
  }).strict();
@@ -37175,6 +37612,22 @@ object({
37175
37612
  snapshot: BoardTaskSnapshotSchema.describe("Maintained by the server; omit it.")
37176
37613
  }).strict()
37177
37614
  }).strict();
37615
+ const BoardSessionSnapshotSchema = object({
37616
+ title: string().max(255).default(""),
37617
+ excerpt: string().max(480).optional().describe("The latest message as plain text."),
37618
+ source: string().max(120).optional().describe("Where the chat runs: web, cli or a channel."),
37619
+ issue: _enum(["failed", "lost"]).optional().describe("How the last run ended when it did not finish."),
37620
+ errorExcerpt: string().max(240).optional(),
37621
+ activityAt: string().max(64).optional()
37622
+ }).strict();
37623
+ object({
37624
+ ...boxed(BOARD_DEFAULT_SIZES.session),
37625
+ type: literal("session"),
37626
+ props: object({
37627
+ sessionId: string().min(1).max(160).describe("The chat shown; the server keeps its title, latest message and status up to date."),
37628
+ snapshot: BoardSessionSnapshotSchema.describe("Maintained by the server; omit it.")
37629
+ }).strict()
37630
+ }).strict();
37178
37631
  const BOARD_EFFECT_KINDS = [
37179
37632
  "particles",
37180
37633
  "trail",
@@ -52,8 +52,8 @@ Example: cohub boards inspect lesson.board --animation lecture --at 0:20s:1s --j
52
52
  .option("--json", "Output as JSON")
53
53
  .addHelpText("after", `
54
54
  Order follows placement: rows top to bottom, each left to right. Move a frame to
55
- change where it falls. Frames inside plain (decoration: none) frames count; frames
56
- inside other frames do not. Left and right continue in reading order past a row's end.
55
+ change where it falls. A plain (decoration: none) frame with a label is a page;
56
+ without one, the frames inside it count. Frames inside pages do not. Left and right continue in reading order past a row's end.
57
57
  Viewers step with N, the arrow keys and swipes; #focus=<frame>&present presents.`)
58
58
  .action(async (target, options) => {
59
59
  try {
@@ -1,5 +1,5 @@
1
1
  import { createClient } from "../client.js";
2
- import { error, handleHttp, json as outJson, jsonRequested, ok, table } from "../output.js";
2
+ import { error, formatLocalDateTime, handleHttp, json as outJson, jsonRequested, ok, table } from "../output.js";
3
3
  import { webUrl } from "../web.js";
4
4
  function referralUrl(code) {
5
5
  return webUrl(`/referrals/${code}`);
@@ -33,6 +33,9 @@ export function registerReferrals(program) {
33
33
  if (jsonRequested(opts))
34
34
  return outJson(output);
35
35
  console.log(`\nReferral link: ${output.url}`);
36
+ const { quota } = result;
37
+ const resets = quota.cycleEndsAt ? `, resets ${formatLocalDateTime(quota.cycleEndsAt)}` : "";
38
+ console.log(`Cycle: ${quota.used}/${quota.limit} used, ${quota.reserved} pending, ${quota.available} available${resets}`);
36
39
  console.log(`Rewarded: ${result.summary.rewarded}`);
37
40
  console.log(`Earned: $${result.summary.earnedUsd.toFixed(2)}\n`);
38
41
  }
@@ -54,8 +57,9 @@ export function registerReferrals(program) {
54
57
  table(result.items, [
55
58
  { key: "id", label: "ID" },
56
59
  { key: "status", label: "Status" },
57
- { key: "claimedAt", label: "Claimed" },
58
- { key: "rewardedAt", label: "Rewarded" },
60
+ { key: "claimedAt", label: "Claimed", format: formatLocalDateTime },
61
+ { key: "expiresAt", label: "Expires", format: formatLocalDateTime },
62
+ { key: "rewardedAt", label: "Rewarded", format: formatLocalDateTime },
59
63
  ]);
60
64
  }
61
65
  catch (error) {
@@ -190,6 +190,14 @@ async function sendPrompt(command, words, opts) {
190
190
  return error("Conflicting schedule", "Use only one of --delay-ms, --at, or --cron");
191
191
  if (opts.cron && !opts.timezone)
192
192
  return error("Missing timezone", "--timezone is required with --cron");
193
+ if (opts.note) {
194
+ const agentOnly = Object.entries({
195
+ "--delay-ms": opts.delayMs, "--at": opts.at, "--cron": opts.cron, "--model": opts.model, "--provider": opts.provider,
196
+ "--thinking-level": opts.thinkingLevel, "--read-only": opts.readOnly, "--steer": opts.steer, "--env": opts.env?.length,
197
+ }).flatMap(([flag, value]) => value ? [flag] : []);
198
+ if (agentOnly.length)
199
+ return error("Conflicting options", `--note cannot be combined with ${agentOnly.join(", ")}`);
200
+ }
193
201
  const thinkingLevel = opts.thinkingLevel?.trim() || undefined;
194
202
  if (thinkingLevel
195
203
  && !new Set(["off", "minimal", "low", "medium", "high", "xhigh", "max"]).has(thinkingLevel)) {
@@ -234,6 +242,7 @@ async function sendPrompt(command, words, opts) {
234
242
  ...imageBlocks,
235
243
  ];
236
244
  const result = await client.space(spaceId).prompt({
245
+ ...(opts.note ? { mode: "note" } : {}),
237
246
  sessionId,
238
247
  title: sessionId === opts.session ? opts.title : undefined,
239
248
  content: promptContent,
@@ -250,7 +259,7 @@ async function sendPrompt(command, words, opts) {
250
259
  if (jsonRequested(opts))
251
260
  return outJson(result);
252
261
  if (result.mode === "immediate")
253
- return ok(`Prompt sent — sessionId: ${result.session.id}, turnId: ${result.turn.id}`);
262
+ return ok(`${opts.note ? "Note recorded" : "Prompt sent"} — sessionId: ${result.session.id}, turnId: ${result.turn.id}`);
254
263
  if (result.mode === "repeat")
255
264
  return ok(`Prompt scheduled — cronJobId: ${result.cronJobId}, nextRunAt: ${result.nextRunAt}`);
256
265
  return ok(`Prompt scheduled — taskRunId: ${result.taskRunId}, scheduledAt: ${result.scheduledAt}`);
@@ -357,6 +366,7 @@ export function registerPrompt(program) {
357
366
  .option("--label <ref>", "Attach a label, e.g. Bug or Area/Frontend", collectOption, [])
358
367
  .option("--env <key=value>", "Set an environment variable for this turn", collectOption, [])
359
368
  .option("--image <path>", "Attach an image", collectOption, [])
369
+ .option("--note", "Record the message without an AI reply")
360
370
  .option("--json", "Output as JSON")
361
371
  .action((words, opts) => sendPrompt(program, words, opts));
362
372
  program
@@ -720,6 +730,7 @@ export function registerSpaces(program) {
720
730
  .option("--label <ref>", "Attach a label, e.g. Bug or Area/Frontend", collectOption, [])
721
731
  .option("--env <key=value>", "Set an environment variable for this turn", collectOption, [])
722
732
  .option("--image <path>", "Attach an image", collectOption, [])
733
+ .option("--note", "Record the message without an AI reply")
723
734
  .option("--json", "Output as JSON")
724
735
  .action((words, opts) => sendPrompt(spacesCmd, words, opts));
725
736
  // ── spaces completion ──
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neta-art/cohub-cli",
3
- "version": "10.13.0",
3
+ "version": "10.14.0",
4
4
  "description": "CLI for Cohub — spaces, sessions, and agent collaboration.",
5
5
  "type": "module",
6
6
  "engines": {
@@ -18,7 +18,7 @@
18
18
  "NOTICE"
19
19
  ],
20
20
  "dependencies": {
21
- "@neta-art/cohub": "13.2.0",
21
+ "@neta-art/cohub": "13.3.0",
22
22
  "@neta-art/generation": "^0.1.41",
23
23
  "commander": "^15.0.0",
24
24
  "sharp": "^0.35.4",