@h-rig/cli 0.0.6-alpha.84 → 0.0.6-alpha.85

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.
@@ -3260,7 +3260,6 @@ var KITTY_CHUNK_SIZE = 4096;
3260
3260
  var PANEL_BLUR_SCALE = 1;
3261
3261
  var PANEL_MASK_CACHE_LIMIT = 16;
3262
3262
  var ZLIB_LEVEL = 1;
3263
- var DEFAULT_IMAGE_RESOLUTION_SCALE = 1;
3264
3263
  var LOAD_BUCKETS = 5;
3265
3264
  function loadBucket(load) {
3266
3265
  if (!Number.isFinite(load ?? NaN))
@@ -3275,12 +3274,6 @@ function imageTransport() {
3275
3274
  return "rgba-zlib";
3276
3275
  return "png";
3277
3276
  }
3278
- function imageResolutionScale() {
3279
- const raw = Number.parseFloat(process.env.RIG_OPENTUI_IMAGE_SCALE ?? "");
3280
- if (Number.isFinite(raw) && raw > 0)
3281
- return Math.max(0.25, Math.min(1, raw));
3282
- return DEFAULT_IMAGE_RESOLUTION_SCALE;
3283
- }
3284
3277
  function rgbaWord(color) {
3285
3278
  return (color[3] << 24 | color[2] << 16 | color[1] << 8 | color[0]) >>> 0;
3286
3279
  }
@@ -4172,18 +4165,6 @@ class ImageVisualLayer {
4172
4165
  this.dispatchWorkerRender(slot, next);
4173
4166
  }
4174
4167
  }
4175
- function pixelSizeForRenderer(renderer) {
4176
- const resolution = renderer.resolution;
4177
- const base = resolution?.width && resolution?.height ? resolution : { width: renderer.width * 12, height: renderer.height * 24 };
4178
- const scale = imageResolutionScale();
4179
- return {
4180
- width: Math.max(renderer.width, Math.floor(base.width * scale)),
4181
- height: Math.max(renderer.height, Math.floor(base.height * scale))
4182
- };
4183
- }
4184
- function forceModernImageVisuals() {
4185
- return getRigTerminalCapabilities().supportsKittyImages;
4186
- }
4187
4168
 
4188
4169
  // packages/cli/src/app-opentui/render/text.ts
4189
4170
  import { RGBA as RGBA4, TextAttributes as TextAttributes4, TextRenderable } from "@opentui/core";
@@ -5176,68 +5157,42 @@ function isTerminalScene(scene) {
5176
5157
  }
5177
5158
  function Backdrop(props) {
5178
5159
  const renderer = useRenderer();
5179
- const imageRef = useRef(null);
5180
5160
  const graphicsRef = useRef(null);
5181
5161
  useEffect(() => {
5182
- const imageVisuals = forceModernImageVisuals() ? new ImageVisualLayer(process.stdout, () => renderer.requestRender?.()) : null;
5183
- if (imageVisuals?.enabled) {
5184
- imageRef.current = imageVisuals;
5185
- } else {
5186
- const layout = computeStageLayout(renderer.width, renderer.height);
5187
- const graphics = createGraphicsLayer(renderer, layout);
5188
- renderer.root.add(graphics);
5189
- graphicsRef.current = graphics;
5190
- }
5162
+ const layout = computeStageLayout(renderer.width, renderer.height);
5163
+ const graphics = createGraphicsLayer(renderer, layout);
5164
+ renderer.root.add(graphics);
5165
+ graphicsRef.current = graphics;
5191
5166
  return () => {
5192
- imageRef.current?.destroy();
5193
- const graphics = graphicsRef.current;
5194
- if (graphics) {
5167
+ const g = graphicsRef.current;
5168
+ if (g) {
5195
5169
  try {
5196
- renderer.root.remove(graphics.id);
5170
+ renderer.root.remove(g.id);
5197
5171
  } catch {}
5198
5172
  }
5199
- imageRef.current = null;
5200
5173
  graphicsRef.current = null;
5201
5174
  };
5202
5175
  }, [renderer]);
5203
5176
  useEffect(() => {
5204
- const layout = computeStageLayout(renderer.width, renderer.height);
5205
- const image = imageRef.current;
5206
5177
  const graphics = graphicsRef.current;
5178
+ if (!graphics)
5179
+ return;
5180
+ const layout = computeStageLayout(renderer.width, renderer.height);
5207
5181
  if (layout.tooSmall) {
5208
- image?.clear();
5209
- if (graphics)
5210
- clearGraphicsLayer(graphics);
5182
+ clearGraphicsLayer(graphics);
5211
5183
  return;
5212
5184
  }
5213
5185
  const stats = fleetStatsFromState(props.state);
5214
- const tick = props.state.tick;
5215
- const animationTick = Math.floor(tick / ANIMATION_SLOWDOWN);
5186
+ const animationTick = Math.floor(props.state.tick / ANIMATION_SLOWDOWN);
5216
5187
  const panels = (props.frame.panels ?? []).map((panel) => ({ ...panel }));
5217
5188
  const terminalActive = props.frame.terminalActive ?? isTerminalScene(props.state.scene);
5218
5189
  const fullScreen = Boolean(props.frame.fullScreen);
5219
- if (image) {
5220
- if (terminalActive || fullScreen) {
5221
- image.clear();
5222
- } else {
5223
- image.render({
5224
- layout,
5225
- pixelSize: pixelSizeForRenderer(renderer),
5226
- panels,
5227
- scene: props.state.scene,
5228
- tick,
5229
- load: stats.load,
5230
- activeRuns: stats.active
5231
- });
5232
- }
5233
- } else if (graphics) {
5234
- resizeGraphicsLayer(graphics, layout);
5235
- if (terminalActive || fullScreen) {
5236
- clearGraphicsLayer(graphics);
5237
- } else {
5238
- drawAmbientField(graphics, layout, animationTick, props.state.scene, stats.load, stats.active);
5239
- drawPanelChrome(graphics, layout, panels);
5240
- }
5190
+ resizeGraphicsLayer(graphics, layout);
5191
+ if (terminalActive || fullScreen) {
5192
+ clearGraphicsLayer(graphics);
5193
+ } else {
5194
+ drawAmbientField(graphics, layout, animationTick, props.state.scene, stats.load, stats.active);
5195
+ drawPanelChrome(graphics, layout, panels);
5241
5196
  }
5242
5197
  });
5243
5198
  return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@h-rig/cli",
3
- "version": "0.0.6-alpha.84",
3
+ "version": "0.0.6-alpha.85",
4
4
  "type": "module",
5
5
  "description": "Rig package",
6
6
  "license": "UNLICENSED",
@@ -28,13 +28,13 @@
28
28
  "@earendil-works/pi-tui": "^0.79.0",
29
29
  "@opentui/core": "^0.4.1",
30
30
  "@opentui/react": "0.4.1",
31
- "@rig/client": "npm:@h-rig/client@0.0.6-alpha.84",
32
- "@rig/contracts": "npm:@h-rig/contracts@0.0.6-alpha.84",
33
- "@rig/core": "npm:@h-rig/core@0.0.6-alpha.84",
34
- "@rig/pi-rig": "npm:@h-rig/pi-rig@0.0.6-alpha.84",
35
- "@rig/runtime": "npm:@h-rig/runtime@0.0.6-alpha.84",
36
- "@rig/server": "npm:@h-rig/server@0.0.6-alpha.84",
37
- "@rig/standard-plugin": "npm:@h-rig/standard-plugin@0.0.6-alpha.84",
31
+ "@rig/client": "npm:@h-rig/client@0.0.6-alpha.85",
32
+ "@rig/contracts": "npm:@h-rig/contracts@0.0.6-alpha.85",
33
+ "@rig/core": "npm:@h-rig/core@0.0.6-alpha.85",
34
+ "@rig/pi-rig": "npm:@h-rig/pi-rig@0.0.6-alpha.85",
35
+ "@rig/runtime": "npm:@h-rig/runtime@0.0.6-alpha.85",
36
+ "@rig/server": "npm:@h-rig/server@0.0.6-alpha.85",
37
+ "@rig/standard-plugin": "npm:@h-rig/standard-plugin@0.0.6-alpha.85",
38
38
  "@xterm/headless": "^6.0.0",
39
39
  "effect": "4.0.0-beta.78",
40
40
  "picocolors": "^1.1.1",