@h-rig/cli 0.0.6-alpha.87 → 0.0.6-alpha.88
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/rig.js +210 -562
- package/dist/src/app-opentui/adapters/common.d.ts +3 -0
- package/dist/src/app-opentui/adapters/common.js +4 -0
- package/dist/src/app-opentui/adapters/family.js +31 -4
- package/dist/src/app-opentui/adapters/pi-attach.d.ts +7 -0
- package/dist/src/app-opentui/adapters/pi-attach.js +527 -473
- package/dist/src/app-opentui/adapters/tasks.js +82 -468
- package/dist/src/app-opentui/bootstrap.js +210 -562
- package/dist/src/app-opentui/index.js +68 -441
- package/dist/src/app-opentui/keymap.js +2 -387
- package/dist/src/app-opentui/pi-host-child.js +31 -4
- package/dist/src/app-opentui/pi-pty-host.d.ts +14 -64
- package/dist/src/app-opentui/pi-pty-host.js +3 -397
- package/dist/src/app-opentui/react/App.js +42 -427
- package/dist/src/app-opentui/react/ChromeHost.js +28 -411
- package/dist/src/app-opentui/react/launch.js +106 -466
- package/dist/src/app-opentui/registry.js +96 -482
- package/dist/src/app-opentui/render/terminal-handoff.d.ts +16 -0
- package/dist/src/app-opentui/render/terminal-handoff.js +14 -0
- package/dist/src/app-opentui/runtime.js +68 -441
- package/dist/src/commands/_operator-view.js +31 -4
- package/dist/src/commands/_pi-frontend.d.ts +25 -0
- package/dist/src/commands/_pi-frontend.js +32 -4
- package/dist/src/commands/run.js +31 -4
- package/dist/src/commands/task.js +31 -4
- package/dist/src/commands.js +31 -4
- package/dist/src/index.js +31 -4
- package/package.json +8 -8
|
@@ -225,7 +225,7 @@ function formatFooter(footer, width) {
|
|
|
225
225
|
}
|
|
226
226
|
|
|
227
227
|
// packages/cli/src/app-opentui/runtime.ts
|
|
228
|
-
import { BoxRenderable as BoxRenderable3, RGBA as
|
|
228
|
+
import { BoxRenderable as BoxRenderable3, RGBA as RGBA7, StyledText as StyledText3, TextRenderable as TextRenderable4, createCliRenderer } from "@opentui/core";
|
|
229
229
|
|
|
230
230
|
// packages/cli/src/app-opentui/command-pty-host.ts
|
|
231
231
|
import { basename } from "path";
|
|
@@ -877,389 +877,6 @@ var HOLLOW_FAMILIES = new Set([
|
|
|
877
877
|
"test"
|
|
878
878
|
]);
|
|
879
879
|
|
|
880
|
-
// packages/cli/src/app-opentui/pi-pty-host.ts
|
|
881
|
-
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
882
|
-
import { basename as basename2 } from "path";
|
|
883
|
-
import { RGBA as RGBA2, StyledText as StyledText2, TextAttributes as TextAttributes2 } from "@opentui/core";
|
|
884
|
-
import { Terminal as XtermTerminal2 } from "@xterm/headless";
|
|
885
|
-
var MIN_COLS2 = 40;
|
|
886
|
-
var MIN_ROWS2 = 12;
|
|
887
|
-
var MAX_ROWS2 = 300;
|
|
888
|
-
var MAX_SNAPSHOT_LINES2 = 360;
|
|
889
|
-
var STYLED_SNAPSHOT_MARGIN = 6;
|
|
890
|
-
var SNAPSHOT_DELAY_MS2 = 120;
|
|
891
|
-
var fallbackChildScriptPath = fileURLToPath2(new URL("./pi-host-child.ts", import.meta.url));
|
|
892
|
-
var activeHost2 = null;
|
|
893
|
-
function clampCols2(cols) {
|
|
894
|
-
return Math.max(MIN_COLS2, Math.trunc(cols || 100));
|
|
895
|
-
}
|
|
896
|
-
function clampRows2(rows) {
|
|
897
|
-
return Math.max(MIN_ROWS2, Math.min(MAX_ROWS2, Math.trunc(rows || 35)));
|
|
898
|
-
}
|
|
899
|
-
var XTERM_COLOR_MODE_INDEXED_16 = 16777216;
|
|
900
|
-
var XTERM_COLOR_MODE_INDEXED_256 = 33554432;
|
|
901
|
-
var XTERM_COLOR_MODE_RGB = 50331648;
|
|
902
|
-
function rgbaFromXtermColor(mode, value) {
|
|
903
|
-
if (mode === 1 || mode === 2 || mode === XTERM_COLOR_MODE_INDEXED_16 || mode === XTERM_COLOR_MODE_INDEXED_256) {
|
|
904
|
-
return RGBA2.fromIndex(value);
|
|
905
|
-
}
|
|
906
|
-
if (mode === 3 || mode === XTERM_COLOR_MODE_RGB) {
|
|
907
|
-
return RGBA2.fromInts(value >> 16 & 255, value >> 8 & 255, value & 255);
|
|
908
|
-
}
|
|
909
|
-
return;
|
|
910
|
-
}
|
|
911
|
-
function textAttributesFromCell(cell) {
|
|
912
|
-
let attributes = TextAttributes2.NONE;
|
|
913
|
-
if (cell.isBold())
|
|
914
|
-
attributes |= TextAttributes2.BOLD;
|
|
915
|
-
if (cell.isDim())
|
|
916
|
-
attributes |= TextAttributes2.DIM;
|
|
917
|
-
if (cell.isItalic())
|
|
918
|
-
attributes |= TextAttributes2.ITALIC;
|
|
919
|
-
if (cell.isUnderline())
|
|
920
|
-
attributes |= TextAttributes2.UNDERLINE;
|
|
921
|
-
if (cell.isBlink())
|
|
922
|
-
attributes |= TextAttributes2.BLINK;
|
|
923
|
-
if (cell.isInverse())
|
|
924
|
-
attributes |= TextAttributes2.INVERSE;
|
|
925
|
-
if (cell.isInvisible())
|
|
926
|
-
attributes |= TextAttributes2.HIDDEN;
|
|
927
|
-
if (cell.isStrikethrough())
|
|
928
|
-
attributes |= TextAttributes2.STRIKETHROUGH;
|
|
929
|
-
return attributes;
|
|
930
|
-
}
|
|
931
|
-
function sameRgba(a, b) {
|
|
932
|
-
if (!a && !b)
|
|
933
|
-
return true;
|
|
934
|
-
return Boolean(a && b && a.equals(b));
|
|
935
|
-
}
|
|
936
|
-
function sameStyle(a, b) {
|
|
937
|
-
return sameRgba(a.fg, b.fg) && sameRgba(a.bg, b.bg) && (a.attributes ?? 0) === (b.attributes ?? 0);
|
|
938
|
-
}
|
|
939
|
-
function styleFromCell(cell) {
|
|
940
|
-
return {
|
|
941
|
-
fg: rgbaFromXtermColor(cell.getFgColorMode(), cell.getFgColor()),
|
|
942
|
-
bg: rgbaFromXtermColor(cell.getBgColorMode(), cell.getBgColor()),
|
|
943
|
-
attributes: textAttributesFromCell(cell)
|
|
944
|
-
};
|
|
945
|
-
}
|
|
946
|
-
function lineToStyledText(line, cols) {
|
|
947
|
-
if (!line)
|
|
948
|
-
return new StyledText2([{ __isChunk: true, text: "" }]);
|
|
949
|
-
const chunks = [];
|
|
950
|
-
let run = "";
|
|
951
|
-
let runStyle = null;
|
|
952
|
-
const flush = () => {
|
|
953
|
-
if (!run)
|
|
954
|
-
return;
|
|
955
|
-
chunks.push({
|
|
956
|
-
__isChunk: true,
|
|
957
|
-
text: run,
|
|
958
|
-
...runStyle?.fg ? { fg: runStyle.fg } : {},
|
|
959
|
-
...runStyle?.bg ? { bg: runStyle.bg } : {},
|
|
960
|
-
...(runStyle?.attributes ?? 0) !== 0 ? { attributes: runStyle.attributes } : {}
|
|
961
|
-
});
|
|
962
|
-
run = "";
|
|
963
|
-
};
|
|
964
|
-
for (let index = 0;index < cols; index += 1) {
|
|
965
|
-
const cell = line.getCell(index);
|
|
966
|
-
if (!cell) {
|
|
967
|
-
if (runStyle !== null)
|
|
968
|
-
flush();
|
|
969
|
-
runStyle = null;
|
|
970
|
-
run += " ";
|
|
971
|
-
continue;
|
|
972
|
-
}
|
|
973
|
-
if (cell.getWidth() === 0)
|
|
974
|
-
continue;
|
|
975
|
-
const style = styleFromCell(cell);
|
|
976
|
-
if (!runStyle || !sameStyle(runStyle, style)) {
|
|
977
|
-
flush();
|
|
978
|
-
runStyle = style;
|
|
979
|
-
}
|
|
980
|
-
run += cell.getChars() || " ";
|
|
981
|
-
}
|
|
982
|
-
flush();
|
|
983
|
-
return new StyledText2(chunks.length > 0 ? chunks : [{ __isChunk: true, text: "" }]);
|
|
984
|
-
}
|
|
985
|
-
function childCommandPrefix2() {
|
|
986
|
-
const execName = basename2(process.execPath).toLowerCase();
|
|
987
|
-
const currentEntry = process.argv[1];
|
|
988
|
-
if (execName === "bun" || execName === "bun.exe") {
|
|
989
|
-
return currentEntry ? [process.execPath, currentEntry, "__opentui-pi-host"] : [process.execPath, fallbackChildScriptPath];
|
|
990
|
-
}
|
|
991
|
-
return [process.execPath, "__opentui-pi-host"];
|
|
992
|
-
}
|
|
993
|
-
function withEnv2(base) {
|
|
994
|
-
const env = {};
|
|
995
|
-
for (const [key, value] of Object.entries(base ?? process.env)) {
|
|
996
|
-
if (key === "RIG_PLAIN" || key === "RIG_CLI_PLAIN_HELP" || key === "NO_COLOR")
|
|
997
|
-
continue;
|
|
998
|
-
if (typeof value === "string")
|
|
999
|
-
env[key] = value;
|
|
1000
|
-
}
|
|
1001
|
-
return {
|
|
1002
|
-
...env,
|
|
1003
|
-
TERM: "xterm-256color",
|
|
1004
|
-
COLORTERM: "truecolor",
|
|
1005
|
-
FORCE_COLOR: env.FORCE_COLOR ?? "1",
|
|
1006
|
-
RIG_OPENTUI_PI_HOST: "1"
|
|
1007
|
-
};
|
|
1008
|
-
}
|
|
1009
|
-
class PiPtyHost {
|
|
1010
|
-
runId;
|
|
1011
|
-
projectRoot;
|
|
1012
|
-
onSnapshot;
|
|
1013
|
-
onExit;
|
|
1014
|
-
onError;
|
|
1015
|
-
terminal;
|
|
1016
|
-
disposables = [];
|
|
1017
|
-
decoder = new TextDecoder("utf-8");
|
|
1018
|
-
proc = null;
|
|
1019
|
-
pty = null;
|
|
1020
|
-
status = "starting";
|
|
1021
|
-
cols;
|
|
1022
|
-
rows;
|
|
1023
|
-
message = "starting bundled Pi";
|
|
1024
|
-
lastResizeError = null;
|
|
1025
|
-
exitCode;
|
|
1026
|
-
signal;
|
|
1027
|
-
notifyTimer = null;
|
|
1028
|
-
lastStreamKey = "";
|
|
1029
|
-
_disposed = false;
|
|
1030
|
-
constructor(options) {
|
|
1031
|
-
this.runId = options.runId;
|
|
1032
|
-
this.projectRoot = options.projectRoot;
|
|
1033
|
-
this.cols = clampCols2(options.cols);
|
|
1034
|
-
this.rows = clampRows2(options.rows);
|
|
1035
|
-
this.onSnapshot = options.onSnapshot;
|
|
1036
|
-
this.onExit = options.onExit;
|
|
1037
|
-
this.onError = options.onError;
|
|
1038
|
-
this.terminal = new XtermTerminal2({
|
|
1039
|
-
allowProposedApi: true,
|
|
1040
|
-
cols: this.cols,
|
|
1041
|
-
rows: this.rows,
|
|
1042
|
-
scrollback: 1000
|
|
1043
|
-
});
|
|
1044
|
-
this.registerTerminalResponders();
|
|
1045
|
-
this.disposables.push(this.terminal.onWriteParsed(() => {
|
|
1046
|
-
if (this._disposed)
|
|
1047
|
-
return;
|
|
1048
|
-
const snapshot = this.createSnapshot();
|
|
1049
|
-
const key = snapshot.lines.join(`
|
|
1050
|
-
`);
|
|
1051
|
-
if (key === this.lastStreamKey)
|
|
1052
|
-
return;
|
|
1053
|
-
this.lastStreamKey = key;
|
|
1054
|
-
this.onSnapshot?.(snapshot);
|
|
1055
|
-
}));
|
|
1056
|
-
}
|
|
1057
|
-
get disposed() {
|
|
1058
|
-
return this._disposed;
|
|
1059
|
-
}
|
|
1060
|
-
get snapshot() {
|
|
1061
|
-
return this.createSnapshot();
|
|
1062
|
-
}
|
|
1063
|
-
async start() {
|
|
1064
|
-
if (this._disposed)
|
|
1065
|
-
throw new Error("Pi PTY host is disposed.");
|
|
1066
|
-
if (typeof Bun.Terminal !== "function") {
|
|
1067
|
-
throw new Error("Bun native PTY is unavailable in this runtime. Pi host requires Bun.Terminal.");
|
|
1068
|
-
}
|
|
1069
|
-
const spawnOptions = {
|
|
1070
|
-
cwd: this.projectRoot,
|
|
1071
|
-
env: withEnv2(process.env),
|
|
1072
|
-
terminal: {
|
|
1073
|
-
cols: this.cols,
|
|
1074
|
-
rows: this.rows,
|
|
1075
|
-
name: "xterm-256color",
|
|
1076
|
-
data: (_terminal, data) => this.handlePtyData(data)
|
|
1077
|
-
}
|
|
1078
|
-
};
|
|
1079
|
-
const proc = Bun.spawn([
|
|
1080
|
-
...childCommandPrefix2(),
|
|
1081
|
-
"--run-id",
|
|
1082
|
-
this.runId,
|
|
1083
|
-
"--project-root",
|
|
1084
|
-
this.projectRoot
|
|
1085
|
-
], spawnOptions);
|
|
1086
|
-
if (!proc.terminal)
|
|
1087
|
-
throw new Error("Bun did not attach a terminal to the bundled Pi child process.");
|
|
1088
|
-
this.proc = proc;
|
|
1089
|
-
this.pty = proc.terminal;
|
|
1090
|
-
this.status = "running";
|
|
1091
|
-
this.message = "bundled Pi running inside this app";
|
|
1092
|
-
this.emitSnapshotSoon(0);
|
|
1093
|
-
proc.exited.then((exitCode) => {
|
|
1094
|
-
if (this._disposed)
|
|
1095
|
-
return;
|
|
1096
|
-
this.status = exitCode === 0 ? "exited" : "failed";
|
|
1097
|
-
this.exitCode = exitCode;
|
|
1098
|
-
this.signal = null;
|
|
1099
|
-
this.message = exitCode === 0 ? "bundled Pi exited" : `bundled Pi exited with code ${exitCode}`;
|
|
1100
|
-
const snapshot = this.createSnapshot();
|
|
1101
|
-
this.onSnapshot?.(snapshot);
|
|
1102
|
-
this.onExit?.(snapshot);
|
|
1103
|
-
if (activeHost2 === this)
|
|
1104
|
-
activeHost2 = null;
|
|
1105
|
-
this.dispose("exit", { kill: false, notify: false });
|
|
1106
|
-
}).catch((error) => {
|
|
1107
|
-
if (this._disposed)
|
|
1108
|
-
return;
|
|
1109
|
-
this.status = "failed";
|
|
1110
|
-
this.message = error instanceof Error ? error.message : String(error);
|
|
1111
|
-
const snapshot = this.createSnapshot();
|
|
1112
|
-
this.onSnapshot?.(snapshot);
|
|
1113
|
-
this.onError?.(error, snapshot);
|
|
1114
|
-
if (activeHost2 === this)
|
|
1115
|
-
activeHost2 = null;
|
|
1116
|
-
this.dispose("error", { kill: false, notify: false });
|
|
1117
|
-
});
|
|
1118
|
-
}
|
|
1119
|
-
write(data) {
|
|
1120
|
-
if (this._disposed || !this.pty)
|
|
1121
|
-
return;
|
|
1122
|
-
try {
|
|
1123
|
-
this.pty.write(data);
|
|
1124
|
-
} catch (error) {
|
|
1125
|
-
this.status = "failed";
|
|
1126
|
-
this.message = error instanceof Error ? error.message : String(error);
|
|
1127
|
-
const snapshot = this.createSnapshot();
|
|
1128
|
-
this.onSnapshot?.(snapshot);
|
|
1129
|
-
this.onError?.(error, snapshot);
|
|
1130
|
-
}
|
|
1131
|
-
}
|
|
1132
|
-
resize(cols, rows) {
|
|
1133
|
-
const nextCols = clampCols2(cols);
|
|
1134
|
-
const nextRows = clampRows2(rows);
|
|
1135
|
-
if (nextCols === this.cols && nextRows === this.rows)
|
|
1136
|
-
return;
|
|
1137
|
-
this.cols = nextCols;
|
|
1138
|
-
this.rows = nextRows;
|
|
1139
|
-
this.terminal.resize(nextCols, nextRows);
|
|
1140
|
-
try {
|
|
1141
|
-
this.pty?.resize(nextCols, nextRows);
|
|
1142
|
-
this.lastResizeError = null;
|
|
1143
|
-
} catch (error) {
|
|
1144
|
-
this.lastResizeError = error instanceof Error ? error.message : String(error);
|
|
1145
|
-
}
|
|
1146
|
-
this.emitSnapshotSoon(0);
|
|
1147
|
-
}
|
|
1148
|
-
detach() {
|
|
1149
|
-
this.dispose("detach");
|
|
1150
|
-
return this.createSnapshot("detached from bundled Pi");
|
|
1151
|
-
}
|
|
1152
|
-
dispose(reason = "dispose", options = {}) {
|
|
1153
|
-
if (this._disposed)
|
|
1154
|
-
return;
|
|
1155
|
-
this._disposed = true;
|
|
1156
|
-
if (this.notifyTimer)
|
|
1157
|
-
clearTimeout(this.notifyTimer);
|
|
1158
|
-
this.notifyTimer = null;
|
|
1159
|
-
for (const disposable of this.disposables.splice(0)) {
|
|
1160
|
-
try {
|
|
1161
|
-
disposable.dispose();
|
|
1162
|
-
} catch {}
|
|
1163
|
-
}
|
|
1164
|
-
if (options.kill !== false) {
|
|
1165
|
-
try {
|
|
1166
|
-
this.proc?.kill("SIGTERM");
|
|
1167
|
-
} catch {}
|
|
1168
|
-
}
|
|
1169
|
-
try {
|
|
1170
|
-
this.pty?.close();
|
|
1171
|
-
} catch {}
|
|
1172
|
-
try {
|
|
1173
|
-
this.terminal.dispose();
|
|
1174
|
-
} catch {}
|
|
1175
|
-
if (activeHost2 === this)
|
|
1176
|
-
activeHost2 = null;
|
|
1177
|
-
if (options.notify) {
|
|
1178
|
-
this.message = reason;
|
|
1179
|
-
this.onSnapshot?.(this.createSnapshot(reason));
|
|
1180
|
-
}
|
|
1181
|
-
}
|
|
1182
|
-
handlePtyData(data) {
|
|
1183
|
-
if (this._disposed)
|
|
1184
|
-
return;
|
|
1185
|
-
const text = this.decoder.decode(data, { stream: true });
|
|
1186
|
-
this.respondToRawTerminalQueries(text);
|
|
1187
|
-
this.terminal.write(data);
|
|
1188
|
-
}
|
|
1189
|
-
emitSnapshotSoon(delayMs = SNAPSHOT_DELAY_MS2) {
|
|
1190
|
-
if (this._disposed || this.notifyTimer)
|
|
1191
|
-
return;
|
|
1192
|
-
this.notifyTimer = setTimeout(() => {
|
|
1193
|
-
this.notifyTimer = null;
|
|
1194
|
-
if (this._disposed)
|
|
1195
|
-
return;
|
|
1196
|
-
this.onSnapshot?.(this.createSnapshot());
|
|
1197
|
-
}, delayMs);
|
|
1198
|
-
}
|
|
1199
|
-
createSnapshot(message = this.message) {
|
|
1200
|
-
const buffer = this.terminal.buffer.active;
|
|
1201
|
-
const end = buffer.length;
|
|
1202
|
-
const start = Math.max(0, end - MAX_SNAPSHOT_LINES2);
|
|
1203
|
-
const styledStart = Math.max(start, end - this.rows - STYLED_SNAPSHOT_MARGIN);
|
|
1204
|
-
const lines = [];
|
|
1205
|
-
const styledLines = [];
|
|
1206
|
-
for (let row = start;row < end; row += 1) {
|
|
1207
|
-
const line = buffer.getLine(row);
|
|
1208
|
-
lines.push((line?.translateToString(false) ?? "").slice(0, this.cols));
|
|
1209
|
-
if (row >= styledStart)
|
|
1210
|
-
styledLines[lines.length - 1] = lineToStyledText(line, this.cols);
|
|
1211
|
-
}
|
|
1212
|
-
while (lines.length < this.rows) {
|
|
1213
|
-
lines.push("");
|
|
1214
|
-
styledLines[lines.length - 1] = new StyledText2([{ __isChunk: true, text: "" }]);
|
|
1215
|
-
}
|
|
1216
|
-
const resolvedMessage = this.lastResizeError ? `resize degraded: ${this.lastResizeError}` : message;
|
|
1217
|
-
return {
|
|
1218
|
-
runId: this.runId,
|
|
1219
|
-
status: this.status,
|
|
1220
|
-
cols: this.cols,
|
|
1221
|
-
rows: this.rows,
|
|
1222
|
-
lines,
|
|
1223
|
-
styledLines,
|
|
1224
|
-
message: resolvedMessage,
|
|
1225
|
-
...this.lastResizeError ? { resizeError: this.lastResizeError } : {},
|
|
1226
|
-
...this.exitCode !== undefined ? { exitCode: this.exitCode } : {},
|
|
1227
|
-
...this.signal !== undefined ? { signal: this.signal } : {}
|
|
1228
|
-
};
|
|
1229
|
-
}
|
|
1230
|
-
registerTerminalResponders() {
|
|
1231
|
-
this.disposables.push(this.terminal.parser.registerCsiHandler({ final: "c" }, (params) => {
|
|
1232
|
-
if (params.length === 0 || params[0] === 0)
|
|
1233
|
-
this.write("\x1B[?62;22c");
|
|
1234
|
-
return false;
|
|
1235
|
-
}));
|
|
1236
|
-
this.disposables.push(this.terminal.parser.registerCsiHandler({ prefix: ">", final: "c" }, (params) => {
|
|
1237
|
-
if (params.length === 0 || params[0] === 0)
|
|
1238
|
-
this.write("\x1B[>0;0;0c");
|
|
1239
|
-
return false;
|
|
1240
|
-
}));
|
|
1241
|
-
this.disposables.push(this.terminal.parser.registerCsiHandler({ final: "n" }, (params) => {
|
|
1242
|
-
if (params[0] === 5) {
|
|
1243
|
-
this.write("\x1B[0n");
|
|
1244
|
-
} else if (params[0] === 6) {
|
|
1245
|
-
const row = this.terminal.buffer.active.cursorY + 1;
|
|
1246
|
-
const col = this.terminal.buffer.active.cursorX + 1;
|
|
1247
|
-
this.write(`\x1B[${row};${col}R`);
|
|
1248
|
-
}
|
|
1249
|
-
return false;
|
|
1250
|
-
}));
|
|
1251
|
-
}
|
|
1252
|
-
respondToRawTerminalQueries(text) {
|
|
1253
|
-
if (!text)
|
|
1254
|
-
return;
|
|
1255
|
-
const decrqm = /\x1b\[\?(\d+)\$p/g;
|
|
1256
|
-
let match;
|
|
1257
|
-
while ((match = decrqm.exec(text)) !== null) {
|
|
1258
|
-
this.write(`\x1B[?${match[1]};2$y`);
|
|
1259
|
-
}
|
|
1260
|
-
}
|
|
1261
|
-
}
|
|
1262
|
-
|
|
1263
880
|
// packages/cli/src/commands/_server-events.ts
|
|
1264
881
|
import { WsTransport } from "@rig/client";
|
|
1265
882
|
import { RIG_WS_CHANNELS } from "@rig/contracts";
|
|
@@ -1287,19 +904,19 @@ var RESUMABLE_RUN_STATUSES = new Set([
|
|
|
1287
904
|
]);
|
|
1288
905
|
|
|
1289
906
|
// packages/cli/src/app-opentui/drone.ts
|
|
1290
|
-
import { RGBA as
|
|
907
|
+
import { RGBA as RGBA2, StyledText as StyledText2, TextAttributes as TextAttributes2 } from "@opentui/core";
|
|
1291
908
|
var COLOR = {
|
|
1292
|
-
body:
|
|
1293
|
-
mini:
|
|
1294
|
-
rotor:
|
|
1295
|
-
path:
|
|
1296
|
-
eye:
|
|
1297
|
-
dim:
|
|
1298
|
-
ink:
|
|
909
|
+
body: RGBA2.fromHex(RIG_UI.lime),
|
|
910
|
+
mini: RGBA2.fromHex(RIG_UI.limeDim),
|
|
911
|
+
rotor: RGBA2.fromHex(RIG_UI.cyan),
|
|
912
|
+
path: RGBA2.fromHex(RIG_UI.cyan),
|
|
913
|
+
eye: RGBA2.fromHex(RIG_UI.ink),
|
|
914
|
+
dim: RGBA2.fromHex(RIG_UI.ink4),
|
|
915
|
+
ink: RGBA2.fromHex(RIG_UI.ink2)
|
|
1299
916
|
};
|
|
1300
917
|
|
|
1301
918
|
// packages/cli/src/app-opentui/render/graphics.ts
|
|
1302
|
-
import { FrameBufferRenderable, RGBA as
|
|
919
|
+
import { FrameBufferRenderable, RGBA as RGBA3 } from "@opentui/core";
|
|
1303
920
|
|
|
1304
921
|
// packages/cli/src/app-opentui/render/constants.ts
|
|
1305
922
|
var LCG_MULTIPLIER = 1664525;
|
|
@@ -1336,13 +953,13 @@ var GLOW_FALLOFF_EXP_ASCII = 2.2;
|
|
|
1336
953
|
// packages/cli/src/app-opentui/render/graphics.ts
|
|
1337
954
|
var BRAILLE_SAMPLES_X = 2;
|
|
1338
955
|
var BRAILLE_SAMPLES_Y = 4;
|
|
1339
|
-
var TRANSPARENT =
|
|
1340
|
-
var BACKDROP =
|
|
1341
|
-
var PANEL_BG =
|
|
1342
|
-
var PANEL_HEADER_BG =
|
|
1343
|
-
var PANEL_LINE =
|
|
1344
|
-
var PANEL_LINE_DIM =
|
|
1345
|
-
var PANEL_TEXT_DIM =
|
|
956
|
+
var TRANSPARENT = RGBA3.fromValues(0, 0, 0, 0);
|
|
957
|
+
var BACKDROP = RGBA3.fromHex(RIG_UI.bg);
|
|
958
|
+
var PANEL_BG = RGBA3.fromInts(16, 17, 21, 184);
|
|
959
|
+
var PANEL_HEADER_BG = RGBA3.fromInts(16, 17, 21, 188);
|
|
960
|
+
var PANEL_LINE = RGBA3.fromInts(255, 255, 255, 20);
|
|
961
|
+
var PANEL_LINE_DIM = RGBA3.fromInts(255, 255, 255, 8);
|
|
962
|
+
var PANEL_TEXT_DIM = RGBA3.fromInts(108, 110, 121, 255);
|
|
1346
963
|
var AC_RGB = [204, 255, 77];
|
|
1347
964
|
var C2_RGB = [86, 216, 255];
|
|
1348
965
|
var MG_RGB = [255, 121, 176];
|
|
@@ -1447,7 +1064,7 @@ function paletteColor(ac, c2, mg, ink) {
|
|
|
1447
1064
|
const b = (AC_RGB[2] * ac + C2_RGB[2] * c2 + MG_RGB[2] * mg + INK_RGB[2] * ink) / total;
|
|
1448
1065
|
const intensity = Math.min(1, total / 4);
|
|
1449
1066
|
const lift = 0.34 + intensity * 0.66;
|
|
1450
|
-
return
|
|
1067
|
+
return RGBA3.fromInts(Math.round(r * lift), Math.round(g * lift), Math.round(b * lift), 255);
|
|
1451
1068
|
}
|
|
1452
1069
|
function clearCanvas(canvas) {
|
|
1453
1070
|
canvas.ac.fill(0);
|
|
@@ -1747,26 +1364,26 @@ var ACTIVE_STATUSES = new Set([
|
|
|
1747
1364
|
]);
|
|
1748
1365
|
|
|
1749
1366
|
// packages/cli/src/app-opentui/render/text.ts
|
|
1750
|
-
import { RGBA as
|
|
1367
|
+
import { RGBA as RGBA4, TextAttributes as TextAttributes3, TextRenderable as TextRenderable2 } from "@opentui/core";
|
|
1751
1368
|
|
|
1752
1369
|
// packages/cli/src/app-opentui/render/hover.ts
|
|
1753
1370
|
var listeners = new Set;
|
|
1754
1371
|
|
|
1755
1372
|
// packages/cli/src/app-opentui/render/text.ts
|
|
1756
|
-
var TRANSPARENT2 =
|
|
1757
|
-
var HOVER_BG =
|
|
1373
|
+
var TRANSPARENT2 = RGBA4.fromInts(0, 0, 0, 0);
|
|
1374
|
+
var HOVER_BG = RGBA4.fromHex(RIG_UI.hover);
|
|
1758
1375
|
|
|
1759
1376
|
// packages/cli/src/app-opentui/render/panels.ts
|
|
1760
|
-
import { RGBA as
|
|
1761
|
-
var TRANSPARENT3 =
|
|
1377
|
+
import { RGBA as RGBA5, ScrollBoxRenderable } from "@opentui/core";
|
|
1378
|
+
var TRANSPARENT3 = RGBA5.fromInts(0, 0, 0, 0);
|
|
1762
1379
|
var PANEL_BORDER = hexToRgba(RIG_UI.border, 255);
|
|
1763
1380
|
function hexToRgba(hex, alpha) {
|
|
1764
1381
|
const clean = hex.replace(/^#/, "");
|
|
1765
1382
|
const full = clean.length === 3 ? clean.split("").map((part) => `${part}${part}`).join("") : clean;
|
|
1766
1383
|
const value = Number.parseInt(full, 16);
|
|
1767
1384
|
if (!Number.isFinite(value))
|
|
1768
|
-
return
|
|
1769
|
-
return
|
|
1385
|
+
return RGBA5.fromInts(14, 15, 17, alpha);
|
|
1386
|
+
return RGBA5.fromInts(value >> 16 & 255, value >> 8 & 255, value & 255, alpha);
|
|
1770
1387
|
}
|
|
1771
1388
|
|
|
1772
1389
|
// packages/cli/src/app-opentui/render/native-host.ts
|
|
@@ -1774,7 +1391,7 @@ import {
|
|
|
1774
1391
|
BoxRenderable as BoxRenderable2,
|
|
1775
1392
|
CodeRenderable,
|
|
1776
1393
|
DiffRenderable,
|
|
1777
|
-
RGBA as
|
|
1394
|
+
RGBA as RGBA6,
|
|
1778
1395
|
ScrollBoxRenderable as ScrollBoxRenderable2,
|
|
1779
1396
|
SyntaxStyle,
|
|
1780
1397
|
TextRenderable as TextRenderable3,
|
|
@@ -1782,7 +1399,7 @@ import {
|
|
|
1782
1399
|
} from "@opentui/core";
|
|
1783
1400
|
|
|
1784
1401
|
// packages/cli/src/app-opentui/runtime.ts
|
|
1785
|
-
var PRELOADER_BACKDROP =
|
|
1402
|
+
var PRELOADER_BACKDROP = RGBA7.fromHex(RIG_UI.bg);
|
|
1786
1403
|
function inboxPendingCount(state) {
|
|
1787
1404
|
const inbox = state.data.inbox;
|
|
1788
1405
|
if (!inbox || typeof inbox !== "object" || Array.isArray(inbox))
|
|
@@ -1841,7 +1458,7 @@ function buildNavStrip(state) {
|
|
|
1841
1458
|
chunks.push(otuiBold(styles.yellow(String(badgeCount))));
|
|
1842
1459
|
}
|
|
1843
1460
|
});
|
|
1844
|
-
return new
|
|
1461
|
+
return new StyledText3(chunks);
|
|
1845
1462
|
}
|
|
1846
1463
|
var DESTRUCTIVE_ACTION_KINDS = new Set(["run-stop", "inbox-reject"]);
|
|
1847
1464
|
|