@minato-aqukin/autodl-cli 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
GPU_SPECS,
|
|
8
8
|
PRO_CREATE_REGIONS,
|
|
9
9
|
VERSION,
|
|
10
|
+
findBaseImage,
|
|
10
11
|
getBalance,
|
|
11
12
|
getStockByRegion,
|
|
12
13
|
parseCudaVersion
|
|
@@ -47,9 +48,9 @@ import {
|
|
|
47
48
|
waitForShutdown
|
|
48
49
|
} from "./chunk-6QR4ZYQR.js";
|
|
49
50
|
|
|
50
|
-
// node_modules/react/cjs/react.production.js
|
|
51
|
+
// ../../../node_modules/react/cjs/react.production.js
|
|
51
52
|
var require_react_production = __commonJS({
|
|
52
|
-
"node_modules/react/cjs/react.production.js"(exports) {
|
|
53
|
+
"../../../node_modules/react/cjs/react.production.js"(exports) {
|
|
53
54
|
"use strict";
|
|
54
55
|
var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element");
|
|
55
56
|
var REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal");
|
|
@@ -488,9 +489,9 @@ var require_react_production = __commonJS({
|
|
|
488
489
|
}
|
|
489
490
|
});
|
|
490
491
|
|
|
491
|
-
// node_modules/react/cjs/react.development.js
|
|
492
|
+
// ../../../node_modules/react/cjs/react.development.js
|
|
492
493
|
var require_react_development = __commonJS({
|
|
493
|
-
"node_modules/react/cjs/react.development.js"(exports, module) {
|
|
494
|
+
"../../../node_modules/react/cjs/react.development.js"(exports, module) {
|
|
494
495
|
"use strict";
|
|
495
496
|
"production" !== process.env.NODE_ENV && (function() {
|
|
496
497
|
function defineDeprecationWarning(methodName, info) {
|
|
@@ -1460,9 +1461,9 @@ var require_react_development = __commonJS({
|
|
|
1460
1461
|
}
|
|
1461
1462
|
});
|
|
1462
1463
|
|
|
1463
|
-
// node_modules/react/index.js
|
|
1464
|
+
// ../../../node_modules/react/index.js
|
|
1464
1465
|
var require_react = __commonJS({
|
|
1465
|
-
"node_modules/react/index.js"(exports, module) {
|
|
1466
|
+
"../../../node_modules/react/index.js"(exports, module) {
|
|
1466
1467
|
"use strict";
|
|
1467
1468
|
if (process.env.NODE_ENV === "production") {
|
|
1468
1469
|
module.exports = require_react_production();
|
|
@@ -1472,9 +1473,9 @@ var require_react = __commonJS({
|
|
|
1472
1473
|
}
|
|
1473
1474
|
});
|
|
1474
1475
|
|
|
1475
|
-
// node_modules/
|
|
1476
|
+
// ../../../node_modules/signal-exit/signals.js
|
|
1476
1477
|
var require_signals = __commonJS({
|
|
1477
|
-
"node_modules/
|
|
1478
|
+
"../../../node_modules/signal-exit/signals.js"(exports, module) {
|
|
1478
1479
|
"use strict";
|
|
1479
1480
|
module.exports = [
|
|
1480
1481
|
"SIGABRT",
|
|
@@ -1510,9 +1511,9 @@ var require_signals = __commonJS({
|
|
|
1510
1511
|
}
|
|
1511
1512
|
});
|
|
1512
1513
|
|
|
1513
|
-
// node_modules/
|
|
1514
|
+
// ../../../node_modules/signal-exit/index.js
|
|
1514
1515
|
var require_signal_exit = __commonJS({
|
|
1515
|
-
"node_modules/
|
|
1516
|
+
"../../../node_modules/signal-exit/index.js"(exports, module) {
|
|
1516
1517
|
"use strict";
|
|
1517
1518
|
var process14 = global.process;
|
|
1518
1519
|
var processOk = function(process15) {
|
|
@@ -1670,9 +1671,9 @@ var require_signal_exit = __commonJS({
|
|
|
1670
1671
|
}
|
|
1671
1672
|
});
|
|
1672
1673
|
|
|
1673
|
-
// node_modules/react-reconciler/cjs/react-reconciler-constants.production.js
|
|
1674
|
+
// ../../../node_modules/react-reconciler/cjs/react-reconciler-constants.production.js
|
|
1674
1675
|
var require_react_reconciler_constants_production = __commonJS({
|
|
1675
|
-
"node_modules/react-reconciler/cjs/react-reconciler-constants.production.js"(exports) {
|
|
1676
|
+
"../../../node_modules/react-reconciler/cjs/react-reconciler-constants.production.js"(exports) {
|
|
1676
1677
|
"use strict";
|
|
1677
1678
|
exports.ConcurrentRoot = 1;
|
|
1678
1679
|
exports.ContinuousEventPriority = 8;
|
|
@@ -1684,17 +1685,17 @@ var require_react_reconciler_constants_production = __commonJS({
|
|
|
1684
1685
|
}
|
|
1685
1686
|
});
|
|
1686
1687
|
|
|
1687
|
-
// node_modules/react-reconciler/cjs/react-reconciler-constants.development.js
|
|
1688
|
+
// ../../../node_modules/react-reconciler/cjs/react-reconciler-constants.development.js
|
|
1688
1689
|
var require_react_reconciler_constants_development = __commonJS({
|
|
1689
|
-
"node_modules/react-reconciler/cjs/react-reconciler-constants.development.js"(exports) {
|
|
1690
|
+
"../../../node_modules/react-reconciler/cjs/react-reconciler-constants.development.js"(exports) {
|
|
1690
1691
|
"use strict";
|
|
1691
1692
|
"production" !== process.env.NODE_ENV && (exports.ConcurrentRoot = 1, exports.ContinuousEventPriority = 8, exports.DefaultEventPriority = 32, exports.DiscreteEventPriority = 2, exports.IdleEventPriority = 268435456, exports.LegacyRoot = 0, exports.NoEventPriority = 0);
|
|
1692
1693
|
}
|
|
1693
1694
|
});
|
|
1694
1695
|
|
|
1695
|
-
// node_modules/react-reconciler/constants.js
|
|
1696
|
+
// ../../../node_modules/react-reconciler/constants.js
|
|
1696
1697
|
var require_constants = __commonJS({
|
|
1697
|
-
"node_modules/react-reconciler/constants.js"(exports, module) {
|
|
1698
|
+
"../../../node_modules/react-reconciler/constants.js"(exports, module) {
|
|
1698
1699
|
"use strict";
|
|
1699
1700
|
if (process.env.NODE_ENV === "production") {
|
|
1700
1701
|
module.exports = require_react_reconciler_constants_production();
|
|
@@ -1704,9 +1705,9 @@ var require_constants = __commonJS({
|
|
|
1704
1705
|
}
|
|
1705
1706
|
});
|
|
1706
1707
|
|
|
1707
|
-
// node_modules/scheduler/cjs/scheduler.production.js
|
|
1708
|
+
// ../../../node_modules/scheduler/cjs/scheduler.production.js
|
|
1708
1709
|
var require_scheduler_production = __commonJS({
|
|
1709
|
-
"node_modules/scheduler/cjs/scheduler.production.js"(exports) {
|
|
1710
|
+
"../../../node_modules/scheduler/cjs/scheduler.production.js"(exports) {
|
|
1710
1711
|
"use strict";
|
|
1711
1712
|
function push(heap, node) {
|
|
1712
1713
|
var index = heap.length;
|
|
@@ -1977,9 +1978,9 @@ var require_scheduler_production = __commonJS({
|
|
|
1977
1978
|
}
|
|
1978
1979
|
});
|
|
1979
1980
|
|
|
1980
|
-
// node_modules/scheduler/cjs/scheduler.development.js
|
|
1981
|
+
// ../../../node_modules/scheduler/cjs/scheduler.development.js
|
|
1981
1982
|
var require_scheduler_development = __commonJS({
|
|
1982
|
-
"node_modules/scheduler/cjs/scheduler.development.js"(exports) {
|
|
1983
|
+
"../../../node_modules/scheduler/cjs/scheduler.development.js"(exports) {
|
|
1983
1984
|
"use strict";
|
|
1984
1985
|
"production" !== process.env.NODE_ENV && (function() {
|
|
1985
1986
|
function performWorkUntilDeadline() {
|
|
@@ -2236,9 +2237,9 @@ var require_scheduler_development = __commonJS({
|
|
|
2236
2237
|
}
|
|
2237
2238
|
});
|
|
2238
2239
|
|
|
2239
|
-
// node_modules/scheduler/index.js
|
|
2240
|
+
// ../../../node_modules/scheduler/index.js
|
|
2240
2241
|
var require_scheduler = __commonJS({
|
|
2241
|
-
"node_modules/scheduler/index.js"(exports, module) {
|
|
2242
|
+
"../../../node_modules/scheduler/index.js"(exports, module) {
|
|
2242
2243
|
"use strict";
|
|
2243
2244
|
if (process.env.NODE_ENV === "production") {
|
|
2244
2245
|
module.exports = require_scheduler_production();
|
|
@@ -2248,9 +2249,9 @@ var require_scheduler = __commonJS({
|
|
|
2248
2249
|
}
|
|
2249
2250
|
});
|
|
2250
2251
|
|
|
2251
|
-
// node_modules/react-reconciler/cjs/react-reconciler.production.js
|
|
2252
|
+
// ../../../node_modules/react-reconciler/cjs/react-reconciler.production.js
|
|
2252
2253
|
var require_react_reconciler_production = __commonJS({
|
|
2253
|
-
"node_modules/react-reconciler/cjs/react-reconciler.production.js"(exports, module) {
|
|
2254
|
+
"../../../node_modules/react-reconciler/cjs/react-reconciler.production.js"(exports, module) {
|
|
2254
2255
|
"use strict";
|
|
2255
2256
|
module.exports = function($$$config) {
|
|
2256
2257
|
function createFiber(tag, pendingProps, key, mode) {
|
|
@@ -10427,9 +10428,9 @@ var require_react_reconciler_production = __commonJS({
|
|
|
10427
10428
|
}
|
|
10428
10429
|
});
|
|
10429
10430
|
|
|
10430
|
-
// node_modules/react-reconciler/cjs/react-reconciler.development.js
|
|
10431
|
+
// ../../../node_modules/react-reconciler/cjs/react-reconciler.development.js
|
|
10431
10432
|
var require_react_reconciler_development = __commonJS({
|
|
10432
|
-
"node_modules/react-reconciler/cjs/react-reconciler.development.js"(exports, module) {
|
|
10433
|
+
"../../../node_modules/react-reconciler/cjs/react-reconciler.development.js"(exports, module) {
|
|
10433
10434
|
"use strict";
|
|
10434
10435
|
"production" !== process.env.NODE_ENV && (module.exports = function($$$config) {
|
|
10435
10436
|
function findHook(fiber, id) {
|
|
@@ -24200,9 +24201,9 @@ var require_react_reconciler_development = __commonJS({
|
|
|
24200
24201
|
}
|
|
24201
24202
|
});
|
|
24202
24203
|
|
|
24203
|
-
// node_modules/react-reconciler/index.js
|
|
24204
|
+
// ../../../node_modules/react-reconciler/index.js
|
|
24204
24205
|
var require_react_reconciler = __commonJS({
|
|
24205
|
-
"node_modules/react-reconciler/index.js"(exports, module) {
|
|
24206
|
+
"../../../node_modules/react-reconciler/index.js"(exports, module) {
|
|
24206
24207
|
"use strict";
|
|
24207
24208
|
if (process.env.NODE_ENV === "production") {
|
|
24208
24209
|
module.exports = require_react_reconciler_production();
|
|
@@ -24212,9 +24213,9 @@ var require_react_reconciler = __commonJS({
|
|
|
24212
24213
|
}
|
|
24213
24214
|
});
|
|
24214
24215
|
|
|
24215
|
-
// node_modules/mimic-fn/index.js
|
|
24216
|
+
// ../../../node_modules/mimic-fn/index.js
|
|
24216
24217
|
var require_mimic_fn = __commonJS({
|
|
24217
|
-
"node_modules/mimic-fn/index.js"(exports, module) {
|
|
24218
|
+
"../../../node_modules/mimic-fn/index.js"(exports, module) {
|
|
24218
24219
|
"use strict";
|
|
24219
24220
|
var mimicFn = (to, from) => {
|
|
24220
24221
|
for (const prop of Reflect.ownKeys(from)) {
|
|
@@ -24227,9 +24228,9 @@ var require_mimic_fn = __commonJS({
|
|
|
24227
24228
|
}
|
|
24228
24229
|
});
|
|
24229
24230
|
|
|
24230
|
-
// node_modules/onetime/index.js
|
|
24231
|
+
// ../../../node_modules/onetime/index.js
|
|
24231
24232
|
var require_onetime = __commonJS({
|
|
24232
|
-
"node_modules/onetime/index.js"(exports, module) {
|
|
24233
|
+
"../../../node_modules/onetime/index.js"(exports, module) {
|
|
24233
24234
|
"use strict";
|
|
24234
24235
|
var mimicFn = require_mimic_fn();
|
|
24235
24236
|
var calledFunctions = /* @__PURE__ */ new WeakMap();
|
|
@@ -24265,207 +24266,9 @@ var require_onetime = __commonJS({
|
|
|
24265
24266
|
}
|
|
24266
24267
|
});
|
|
24267
24268
|
|
|
24268
|
-
// node_modules/
|
|
24269
|
-
var require_signals2 = __commonJS({
|
|
24270
|
-
"node_modules/restore-cursor/node_modules/signal-exit/signals.js"(exports, module) {
|
|
24271
|
-
"use strict";
|
|
24272
|
-
module.exports = [
|
|
24273
|
-
"SIGABRT",
|
|
24274
|
-
"SIGALRM",
|
|
24275
|
-
"SIGHUP",
|
|
24276
|
-
"SIGINT",
|
|
24277
|
-
"SIGTERM"
|
|
24278
|
-
];
|
|
24279
|
-
if (process.platform !== "win32") {
|
|
24280
|
-
module.exports.push(
|
|
24281
|
-
"SIGVTALRM",
|
|
24282
|
-
"SIGXCPU",
|
|
24283
|
-
"SIGXFSZ",
|
|
24284
|
-
"SIGUSR2",
|
|
24285
|
-
"SIGTRAP",
|
|
24286
|
-
"SIGSYS",
|
|
24287
|
-
"SIGQUIT",
|
|
24288
|
-
"SIGIOT"
|
|
24289
|
-
// should detect profiler and enable/disable accordingly.
|
|
24290
|
-
// see #21
|
|
24291
|
-
// 'SIGPROF'
|
|
24292
|
-
);
|
|
24293
|
-
}
|
|
24294
|
-
if (process.platform === "linux") {
|
|
24295
|
-
module.exports.push(
|
|
24296
|
-
"SIGIO",
|
|
24297
|
-
"SIGPOLL",
|
|
24298
|
-
"SIGPWR",
|
|
24299
|
-
"SIGSTKFLT",
|
|
24300
|
-
"SIGUNUSED"
|
|
24301
|
-
);
|
|
24302
|
-
}
|
|
24303
|
-
}
|
|
24304
|
-
});
|
|
24305
|
-
|
|
24306
|
-
// node_modules/restore-cursor/node_modules/signal-exit/index.js
|
|
24307
|
-
var require_signal_exit2 = __commonJS({
|
|
24308
|
-
"node_modules/restore-cursor/node_modules/signal-exit/index.js"(exports, module) {
|
|
24309
|
-
"use strict";
|
|
24310
|
-
var process14 = global.process;
|
|
24311
|
-
var processOk = function(process15) {
|
|
24312
|
-
return process15 && typeof process15 === "object" && typeof process15.removeListener === "function" && typeof process15.emit === "function" && typeof process15.reallyExit === "function" && typeof process15.listeners === "function" && typeof process15.kill === "function" && typeof process15.pid === "number" && typeof process15.on === "function";
|
|
24313
|
-
};
|
|
24314
|
-
if (!processOk(process14)) {
|
|
24315
|
-
module.exports = function() {
|
|
24316
|
-
return function() {
|
|
24317
|
-
};
|
|
24318
|
-
};
|
|
24319
|
-
} else {
|
|
24320
|
-
assert = __require("assert");
|
|
24321
|
-
signals = require_signals2();
|
|
24322
|
-
isWin = /^win/i.test(process14.platform);
|
|
24323
|
-
EE = __require("events");
|
|
24324
|
-
if (typeof EE !== "function") {
|
|
24325
|
-
EE = EE.EventEmitter;
|
|
24326
|
-
}
|
|
24327
|
-
if (process14.__signal_exit_emitter__) {
|
|
24328
|
-
emitter = process14.__signal_exit_emitter__;
|
|
24329
|
-
} else {
|
|
24330
|
-
emitter = process14.__signal_exit_emitter__ = new EE();
|
|
24331
|
-
emitter.count = 0;
|
|
24332
|
-
emitter.emitted = {};
|
|
24333
|
-
}
|
|
24334
|
-
if (!emitter.infinite) {
|
|
24335
|
-
emitter.setMaxListeners(Infinity);
|
|
24336
|
-
emitter.infinite = true;
|
|
24337
|
-
}
|
|
24338
|
-
module.exports = function(cb, opts) {
|
|
24339
|
-
if (!processOk(global.process)) {
|
|
24340
|
-
return function() {
|
|
24341
|
-
};
|
|
24342
|
-
}
|
|
24343
|
-
assert.equal(typeof cb, "function", "a callback must be provided for exit handler");
|
|
24344
|
-
if (loaded === false) {
|
|
24345
|
-
load();
|
|
24346
|
-
}
|
|
24347
|
-
var ev = "exit";
|
|
24348
|
-
if (opts && opts.alwaysLast) {
|
|
24349
|
-
ev = "afterexit";
|
|
24350
|
-
}
|
|
24351
|
-
var remove = function() {
|
|
24352
|
-
emitter.removeListener(ev, cb);
|
|
24353
|
-
if (emitter.listeners("exit").length === 0 && emitter.listeners("afterexit").length === 0) {
|
|
24354
|
-
unload();
|
|
24355
|
-
}
|
|
24356
|
-
};
|
|
24357
|
-
emitter.on(ev, cb);
|
|
24358
|
-
return remove;
|
|
24359
|
-
};
|
|
24360
|
-
unload = function unload2() {
|
|
24361
|
-
if (!loaded || !processOk(global.process)) {
|
|
24362
|
-
return;
|
|
24363
|
-
}
|
|
24364
|
-
loaded = false;
|
|
24365
|
-
signals.forEach(function(sig) {
|
|
24366
|
-
try {
|
|
24367
|
-
process14.removeListener(sig, sigListeners[sig]);
|
|
24368
|
-
} catch (er) {
|
|
24369
|
-
}
|
|
24370
|
-
});
|
|
24371
|
-
process14.emit = originalProcessEmit;
|
|
24372
|
-
process14.reallyExit = originalProcessReallyExit;
|
|
24373
|
-
emitter.count -= 1;
|
|
24374
|
-
};
|
|
24375
|
-
module.exports.unload = unload;
|
|
24376
|
-
emit = function emit2(event, code, signal) {
|
|
24377
|
-
if (emitter.emitted[event]) {
|
|
24378
|
-
return;
|
|
24379
|
-
}
|
|
24380
|
-
emitter.emitted[event] = true;
|
|
24381
|
-
emitter.emit(event, code, signal);
|
|
24382
|
-
};
|
|
24383
|
-
sigListeners = {};
|
|
24384
|
-
signals.forEach(function(sig) {
|
|
24385
|
-
sigListeners[sig] = function listener() {
|
|
24386
|
-
if (!processOk(global.process)) {
|
|
24387
|
-
return;
|
|
24388
|
-
}
|
|
24389
|
-
var listeners = process14.listeners(sig);
|
|
24390
|
-
if (listeners.length === emitter.count) {
|
|
24391
|
-
unload();
|
|
24392
|
-
emit("exit", null, sig);
|
|
24393
|
-
emit("afterexit", null, sig);
|
|
24394
|
-
if (isWin && sig === "SIGHUP") {
|
|
24395
|
-
sig = "SIGINT";
|
|
24396
|
-
}
|
|
24397
|
-
process14.kill(process14.pid, sig);
|
|
24398
|
-
}
|
|
24399
|
-
};
|
|
24400
|
-
});
|
|
24401
|
-
module.exports.signals = function() {
|
|
24402
|
-
return signals;
|
|
24403
|
-
};
|
|
24404
|
-
loaded = false;
|
|
24405
|
-
load = function load2() {
|
|
24406
|
-
if (loaded || !processOk(global.process)) {
|
|
24407
|
-
return;
|
|
24408
|
-
}
|
|
24409
|
-
loaded = true;
|
|
24410
|
-
emitter.count += 1;
|
|
24411
|
-
signals = signals.filter(function(sig) {
|
|
24412
|
-
try {
|
|
24413
|
-
process14.on(sig, sigListeners[sig]);
|
|
24414
|
-
return true;
|
|
24415
|
-
} catch (er) {
|
|
24416
|
-
return false;
|
|
24417
|
-
}
|
|
24418
|
-
});
|
|
24419
|
-
process14.emit = processEmit;
|
|
24420
|
-
process14.reallyExit = processReallyExit;
|
|
24421
|
-
};
|
|
24422
|
-
module.exports.load = load;
|
|
24423
|
-
originalProcessReallyExit = process14.reallyExit;
|
|
24424
|
-
processReallyExit = function processReallyExit2(code) {
|
|
24425
|
-
if (!processOk(global.process)) {
|
|
24426
|
-
return;
|
|
24427
|
-
}
|
|
24428
|
-
process14.exitCode = code || /* istanbul ignore next */
|
|
24429
|
-
0;
|
|
24430
|
-
emit("exit", process14.exitCode, null);
|
|
24431
|
-
emit("afterexit", process14.exitCode, null);
|
|
24432
|
-
originalProcessReallyExit.call(process14, process14.exitCode);
|
|
24433
|
-
};
|
|
24434
|
-
originalProcessEmit = process14.emit;
|
|
24435
|
-
processEmit = function processEmit2(ev, arg) {
|
|
24436
|
-
if (ev === "exit" && processOk(global.process)) {
|
|
24437
|
-
if (arg !== void 0) {
|
|
24438
|
-
process14.exitCode = arg;
|
|
24439
|
-
}
|
|
24440
|
-
var ret = originalProcessEmit.apply(this, arguments);
|
|
24441
|
-
emit("exit", process14.exitCode, null);
|
|
24442
|
-
emit("afterexit", process14.exitCode, null);
|
|
24443
|
-
return ret;
|
|
24444
|
-
} else {
|
|
24445
|
-
return originalProcessEmit.apply(this, arguments);
|
|
24446
|
-
}
|
|
24447
|
-
};
|
|
24448
|
-
}
|
|
24449
|
-
var assert;
|
|
24450
|
-
var signals;
|
|
24451
|
-
var isWin;
|
|
24452
|
-
var EE;
|
|
24453
|
-
var emitter;
|
|
24454
|
-
var unload;
|
|
24455
|
-
var emit;
|
|
24456
|
-
var sigListeners;
|
|
24457
|
-
var loaded;
|
|
24458
|
-
var load;
|
|
24459
|
-
var originalProcessReallyExit;
|
|
24460
|
-
var processReallyExit;
|
|
24461
|
-
var originalProcessEmit;
|
|
24462
|
-
var processEmit;
|
|
24463
|
-
}
|
|
24464
|
-
});
|
|
24465
|
-
|
|
24466
|
-
// node_modules/escape-string-regexp/index.js
|
|
24269
|
+
// ../../../node_modules/escape-string-regexp/index.js
|
|
24467
24270
|
var require_escape_string_regexp = __commonJS({
|
|
24468
|
-
"node_modules/escape-string-regexp/index.js"(exports, module) {
|
|
24271
|
+
"../../../node_modules/escape-string-regexp/index.js"(exports, module) {
|
|
24469
24272
|
"use strict";
|
|
24470
24273
|
var matchOperatorsRegex = /[|\\{}()[\]^$+*?.-]/g;
|
|
24471
24274
|
module.exports = (string) => {
|
|
@@ -24477,9 +24280,9 @@ var require_escape_string_regexp = __commonJS({
|
|
|
24477
24280
|
}
|
|
24478
24281
|
});
|
|
24479
24282
|
|
|
24480
|
-
// node_modules/stack-utils/index.js
|
|
24283
|
+
// ../../../node_modules/stack-utils/index.js
|
|
24481
24284
|
var require_stack_utils = __commonJS({
|
|
24482
|
-
"node_modules/stack-utils/index.js"(exports, module) {
|
|
24285
|
+
"../../../node_modules/stack-utils/index.js"(exports, module) {
|
|
24483
24286
|
"use strict";
|
|
24484
24287
|
var escapeStringRegexp = require_escape_string_regexp();
|
|
24485
24288
|
var cwd2 = typeof process === "object" && process && typeof process.cwd === "function" ? process.cwd() : ".";
|
|
@@ -24730,9 +24533,9 @@ var require_stack_utils = __commonJS({
|
|
|
24730
24533
|
}
|
|
24731
24534
|
});
|
|
24732
24535
|
|
|
24733
|
-
// node_modules/react/cjs/react-jsx-runtime.production.js
|
|
24536
|
+
// ../../../node_modules/react/cjs/react-jsx-runtime.production.js
|
|
24734
24537
|
var require_react_jsx_runtime_production = __commonJS({
|
|
24735
|
-
"node_modules/react/cjs/react-jsx-runtime.production.js"(exports) {
|
|
24538
|
+
"../../../node_modules/react/cjs/react-jsx-runtime.production.js"(exports) {
|
|
24736
24539
|
"use strict";
|
|
24737
24540
|
var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element");
|
|
24738
24541
|
var REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
@@ -24760,9 +24563,9 @@ var require_react_jsx_runtime_production = __commonJS({
|
|
|
24760
24563
|
}
|
|
24761
24564
|
});
|
|
24762
24565
|
|
|
24763
|
-
// node_modules/react/cjs/react-jsx-runtime.development.js
|
|
24566
|
+
// ../../../node_modules/react/cjs/react-jsx-runtime.development.js
|
|
24764
24567
|
var require_react_jsx_runtime_development = __commonJS({
|
|
24765
|
-
"node_modules/react/cjs/react-jsx-runtime.development.js"(exports) {
|
|
24568
|
+
"../../../node_modules/react/cjs/react-jsx-runtime.development.js"(exports) {
|
|
24766
24569
|
"use strict";
|
|
24767
24570
|
"production" !== process.env.NODE_ENV && (function() {
|
|
24768
24571
|
function getComponentNameFromType(type) {
|
|
@@ -25017,9 +24820,9 @@ var require_react_jsx_runtime_development = __commonJS({
|
|
|
25017
24820
|
}
|
|
25018
24821
|
});
|
|
25019
24822
|
|
|
25020
|
-
// node_modules/react/jsx-runtime.js
|
|
24823
|
+
// ../../../node_modules/react/jsx-runtime.js
|
|
25021
24824
|
var require_jsx_runtime = __commonJS({
|
|
25022
|
-
"node_modules/react/jsx-runtime.js"(exports, module) {
|
|
24825
|
+
"../../../node_modules/react/jsx-runtime.js"(exports, module) {
|
|
25023
24826
|
"use strict";
|
|
25024
24827
|
if (process.env.NODE_ENV === "production") {
|
|
25025
24828
|
module.exports = require_react_jsx_runtime_production();
|
|
@@ -25029,15 +24832,15 @@ var require_jsx_runtime = __commonJS({
|
|
|
25029
24832
|
}
|
|
25030
24833
|
});
|
|
25031
24834
|
|
|
25032
|
-
// node_modules/ink/build/render.js
|
|
24835
|
+
// ../../../node_modules/ink/build/render.js
|
|
25033
24836
|
import { Stream } from "stream";
|
|
25034
24837
|
import process13 from "process";
|
|
25035
24838
|
|
|
25036
|
-
// node_modules/ink/build/ink.js
|
|
24839
|
+
// ../../../node_modules/ink/build/ink.js
|
|
25037
24840
|
var import_react16 = __toESM(require_react(), 1);
|
|
25038
24841
|
import process12 from "process";
|
|
25039
24842
|
|
|
25040
|
-
// node_modules/es-toolkit/dist/function/debounce.mjs
|
|
24843
|
+
// ../../../node_modules/es-toolkit/dist/function/debounce.mjs
|
|
25041
24844
|
function debounce(func, debounceMs, { signal, edges } = {}) {
|
|
25042
24845
|
let pendingThis = void 0;
|
|
25043
24846
|
let pendingArgs = null;
|
|
@@ -25091,7 +24894,7 @@ function debounce(func, debounceMs, { signal, edges } = {}) {
|
|
|
25091
24894
|
return debounced;
|
|
25092
24895
|
}
|
|
25093
24896
|
|
|
25094
|
-
// node_modules/es-toolkit/dist/compat/function/debounce.mjs
|
|
24897
|
+
// ../../../node_modules/es-toolkit/dist/compat/function/debounce.mjs
|
|
25095
24898
|
function debounce2(func, debounceMs = 0, options = {}) {
|
|
25096
24899
|
if (typeof options !== "object") options = {};
|
|
25097
24900
|
const { leading = false, trailing = true, maxWait } = options;
|
|
@@ -25108,7 +24911,7 @@ function debounce2(func, debounceMs = 0, options = {}) {
|
|
|
25108
24911
|
if (maxWait != null) {
|
|
25109
24912
|
if (pendingAt === null) pendingAt = Date.now();
|
|
25110
24913
|
if (Date.now() - pendingAt >= maxWait) {
|
|
25111
|
-
result = func.apply(this, args);
|
|
24914
|
+
if (leading || trailing) result = func.apply(this, args);
|
|
25112
24915
|
pendingAt = Date.now();
|
|
25113
24916
|
_debounced.cancel();
|
|
25114
24917
|
_debounced.schedule();
|
|
@@ -25127,7 +24930,7 @@ function debounce2(func, debounceMs = 0, options = {}) {
|
|
|
25127
24930
|
return debounced;
|
|
25128
24931
|
}
|
|
25129
24932
|
|
|
25130
|
-
// node_modules/es-toolkit/dist/compat/function/throttle.mjs
|
|
24933
|
+
// ../../../node_modules/es-toolkit/dist/compat/function/throttle.mjs
|
|
25131
24934
|
function throttle(func, throttleMs = 0, options = {}) {
|
|
25132
24935
|
const { leading = true, trailing = true } = options;
|
|
25133
24936
|
return debounce2(func, throttleMs, {
|
|
@@ -25137,7 +24940,7 @@ function throttle(func, throttleMs = 0, options = {}) {
|
|
|
25137
24940
|
});
|
|
25138
24941
|
}
|
|
25139
24942
|
|
|
25140
|
-
// node_modules/ansi-escapes/base.js
|
|
24943
|
+
// ../../../node_modules/ansi-escapes/base.js
|
|
25141
24944
|
var base_exports = {};
|
|
25142
24945
|
__export(base_exports, {
|
|
25143
24946
|
ConEmu: () => ConEmu,
|
|
@@ -25181,7 +24984,7 @@ __export(base_exports, {
|
|
|
25181
24984
|
import process2 from "process";
|
|
25182
24985
|
import os from "os";
|
|
25183
24986
|
|
|
25184
|
-
// node_modules/environment/index.js
|
|
24987
|
+
// ../../../node_modules/environment/index.js
|
|
25185
24988
|
var isBrowser = globalThis.window?.document !== void 0;
|
|
25186
24989
|
var isNode = globalThis.process?.versions?.node !== void 0;
|
|
25187
24990
|
var isBun = globalThis.process?.versions?.bun !== void 0;
|
|
@@ -25199,7 +25002,7 @@ var isLinux = platform === "Linux" || globalThis.navigator?.platform?.startsWith
|
|
|
25199
25002
|
var isIos = platform === "iOS" || globalThis.navigator?.platform === "MacIntel" && globalThis.navigator?.maxTouchPoints > 1 || /iPad|iPhone|iPod/.test(globalThis.navigator?.platform);
|
|
25200
25003
|
var isAndroid = platform === "Android" || globalThis.navigator?.platform === "Android" || globalThis.navigator?.userAgent?.includes(" Android ") === true || globalThis.process?.platform === "android";
|
|
25201
25004
|
|
|
25202
|
-
// node_modules/ansi-escapes/base.js
|
|
25005
|
+
// ../../../node_modules/ansi-escapes/base.js
|
|
25203
25006
|
var ESC = "\x1B[";
|
|
25204
25007
|
var OSC = "\x1B]";
|
|
25205
25008
|
var BEL = "\x07";
|
|
@@ -25339,13 +25142,13 @@ var ConEmu = {
|
|
|
25339
25142
|
};
|
|
25340
25143
|
var setCwd = (cwd2 = cwdFunction()) => iTerm.setCwd(cwd2) + ConEmu.setCwd(cwd2);
|
|
25341
25144
|
|
|
25342
|
-
// node_modules/is-in-ci/index.js
|
|
25145
|
+
// ../../../node_modules/is-in-ci/index.js
|
|
25343
25146
|
import { env } from "process";
|
|
25344
25147
|
var check = (key) => key in env && env[key] !== "0" && env[key] !== "false";
|
|
25345
25148
|
var isInCi = check("CI") || check("CONTINUOUS_INTEGRATION");
|
|
25346
25149
|
var is_in_ci_default = isInCi;
|
|
25347
25150
|
|
|
25348
|
-
// node_modules/auto-bind/index.js
|
|
25151
|
+
// ../../../node_modules/auto-bind/index.js
|
|
25349
25152
|
var getAllProperties = (object) => {
|
|
25350
25153
|
const properties = /* @__PURE__ */ new Set();
|
|
25351
25154
|
do {
|
|
@@ -25378,10 +25181,10 @@ function autoBind(self, { include, exclude } = {}) {
|
|
|
25378
25181
|
return self;
|
|
25379
25182
|
}
|
|
25380
25183
|
|
|
25381
|
-
// node_modules/ink/build/ink.js
|
|
25184
|
+
// ../../../node_modules/ink/build/ink.js
|
|
25382
25185
|
var import_signal_exit2 = __toESM(require_signal_exit(), 1);
|
|
25383
25186
|
|
|
25384
|
-
// node_modules/patch-console/dist/index.js
|
|
25187
|
+
// ../../../node_modules/patch-console/dist/index.js
|
|
25385
25188
|
import { PassThrough } from "stream";
|
|
25386
25189
|
var consoleMethods = [
|
|
25387
25190
|
"assert",
|
|
@@ -25427,10 +25230,10 @@ var patchConsole = (callback) => {
|
|
|
25427
25230
|
};
|
|
25428
25231
|
var dist_default = patchConsole;
|
|
25429
25232
|
|
|
25430
|
-
// node_modules/ink/build/ink.js
|
|
25233
|
+
// ../../../node_modules/ink/build/ink.js
|
|
25431
25234
|
var import_constants2 = __toESM(require_constants(), 1);
|
|
25432
25235
|
|
|
25433
|
-
// node_modules/yoga-layout/dist/binaries/yoga-wasm-base64-esm.js
|
|
25236
|
+
// ../../../node_modules/yoga-layout/dist/binaries/yoga-wasm-base64-esm.js
|
|
25434
25237
|
var loadYoga = (() => {
|
|
25435
25238
|
var _scriptDir = import.meta.url;
|
|
25436
25239
|
return (function(loadYoga2) {
|
|
@@ -26661,7 +26464,7 @@ var loadYoga = (() => {
|
|
|
26661
26464
|
})();
|
|
26662
26465
|
var yoga_wasm_base64_esm_default = loadYoga;
|
|
26663
26466
|
|
|
26664
|
-
// node_modules/yoga-layout/dist/src/generated/YGEnums.js
|
|
26467
|
+
// ../../../node_modules/yoga-layout/dist/src/generated/YGEnums.js
|
|
26665
26468
|
var Align = /* @__PURE__ */ (function(Align2) {
|
|
26666
26469
|
Align2[Align2["Auto"] = 0] = "Auto";
|
|
26667
26470
|
Align2[Align2["FlexStart"] = 1] = "FlexStart";
|
|
@@ -26864,7 +26667,7 @@ var constants = {
|
|
|
26864
26667
|
};
|
|
26865
26668
|
var YGEnums_default = constants;
|
|
26866
26669
|
|
|
26867
|
-
// node_modules/yoga-layout/dist/src/wrapAssembly.js
|
|
26670
|
+
// ../../../node_modules/yoga-layout/dist/src/wrapAssembly.js
|
|
26868
26671
|
function wrapAssembly(lib) {
|
|
26869
26672
|
function patch(prototype, name, fn) {
|
|
26870
26673
|
const original = prototype[name];
|
|
@@ -26965,11 +26768,11 @@ function wrapAssembly(lib) {
|
|
|
26965
26768
|
};
|
|
26966
26769
|
}
|
|
26967
26770
|
|
|
26968
|
-
// node_modules/yoga-layout/dist/src/index.js
|
|
26771
|
+
// ../../../node_modules/yoga-layout/dist/src/index.js
|
|
26969
26772
|
var Yoga = wrapAssembly(await yoga_wasm_base64_esm_default());
|
|
26970
26773
|
var src_default = Yoga;
|
|
26971
26774
|
|
|
26972
|
-
// node_modules/wrap-ansi/node_modules/ansi-regex/index.js
|
|
26775
|
+
// ../../../node_modules/wrap-ansi/node_modules/ansi-regex/index.js
|
|
26973
26776
|
function ansiRegex({ onlyFirst = false } = {}) {
|
|
26974
26777
|
const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
|
|
26975
26778
|
const osc = `(?:\\u001B\\][^\\u0007\\u001B\\u009C]*${ST})`;
|
|
@@ -26978,7 +26781,7 @@ function ansiRegex({ onlyFirst = false } = {}) {
|
|
|
26978
26781
|
return new RegExp(pattern, onlyFirst ? void 0 : "g");
|
|
26979
26782
|
}
|
|
26980
26783
|
|
|
26981
|
-
// node_modules/wrap-ansi/node_modules/strip-ansi/index.js
|
|
26784
|
+
// ../../../node_modules/wrap-ansi/node_modules/strip-ansi/index.js
|
|
26982
26785
|
var regex = ansiRegex();
|
|
26983
26786
|
function stripAnsi(string) {
|
|
26984
26787
|
if (typeof string !== "string") {
|
|
@@ -26990,7 +26793,7 @@ function stripAnsi(string) {
|
|
|
26990
26793
|
return string.replace(regex, "");
|
|
26991
26794
|
}
|
|
26992
26795
|
|
|
26993
|
-
// node_modules/get-east-asian-width/lookup-data.js
|
|
26796
|
+
// ../../../node_modules/get-east-asian-width/lookup-data.js
|
|
26994
26797
|
var ambiguousMinimalCodePoint = 161;
|
|
26995
26798
|
var ambiguousMaximumCodePoint = 1114109;
|
|
26996
26799
|
var ambiguousRanges = [161, 161, 164, 164, 167, 168, 170, 170, 173, 174, 176, 180, 182, 186, 188, 191, 198, 198, 208, 208, 215, 216, 222, 225, 230, 230, 232, 234, 236, 237, 240, 240, 242, 243, 247, 250, 252, 252, 254, 254, 257, 257, 273, 273, 275, 275, 283, 283, 294, 295, 299, 299, 305, 307, 312, 312, 319, 322, 324, 324, 328, 331, 333, 333, 338, 339, 358, 359, 363, 363, 462, 462, 464, 464, 466, 466, 468, 468, 470, 470, 472, 472, 474, 474, 476, 476, 593, 593, 609, 609, 708, 708, 711, 711, 713, 715, 717, 717, 720, 720, 728, 731, 733, 733, 735, 735, 768, 879, 913, 929, 931, 937, 945, 961, 963, 969, 1025, 1025, 1040, 1103, 1105, 1105, 8208, 8208, 8211, 8214, 8216, 8217, 8220, 8221, 8224, 8226, 8228, 8231, 8240, 8240, 8242, 8243, 8245, 8245, 8251, 8251, 8254, 8254, 8308, 8308, 8319, 8319, 8321, 8324, 8364, 8364, 8451, 8451, 8453, 8453, 8457, 8457, 8467, 8467, 8470, 8470, 8481, 8482, 8486, 8486, 8491, 8491, 8531, 8532, 8539, 8542, 8544, 8555, 8560, 8569, 8585, 8585, 8592, 8601, 8632, 8633, 8658, 8658, 8660, 8660, 8679, 8679, 8704, 8704, 8706, 8707, 8711, 8712, 8715, 8715, 8719, 8719, 8721, 8721, 8725, 8725, 8730, 8730, 8733, 8736, 8739, 8739, 8741, 8741, 8743, 8748, 8750, 8750, 8756, 8759, 8764, 8765, 8776, 8776, 8780, 8780, 8786, 8786, 8800, 8801, 8804, 8807, 8810, 8811, 8814, 8815, 8834, 8835, 8838, 8839, 8853, 8853, 8857, 8857, 8869, 8869, 8895, 8895, 8978, 8978, 9312, 9449, 9451, 9547, 9552, 9587, 9600, 9615, 9618, 9621, 9632, 9633, 9635, 9641, 9650, 9651, 9654, 9655, 9660, 9661, 9664, 9665, 9670, 9672, 9675, 9675, 9678, 9681, 9698, 9701, 9711, 9711, 9733, 9734, 9737, 9737, 9742, 9743, 9756, 9756, 9758, 9758, 9792, 9792, 9794, 9794, 9824, 9825, 9827, 9829, 9831, 9834, 9836, 9837, 9839, 9839, 9886, 9887, 9919, 9919, 9926, 9933, 9935, 9939, 9941, 9953, 9955, 9955, 9960, 9961, 9963, 9969, 9972, 9972, 9974, 9977, 9979, 9980, 9982, 9983, 10045, 10045, 10102, 10111, 11094, 11097, 12872, 12879, 57344, 63743, 65024, 65039, 65533, 65533, 127232, 127242, 127248, 127277, 127280, 127337, 127344, 127373, 127375, 127376, 127387, 127404, 917760, 917999, 983040, 1048573, 1048576, 1114109];
|
|
@@ -27001,7 +26804,7 @@ var wideMinimalCodePoint = 4352;
|
|
|
27001
26804
|
var wideMaximumCodePoint = 262141;
|
|
27002
26805
|
var wideRanges = [4352, 4447, 8986, 8987, 9001, 9002, 9193, 9196, 9200, 9200, 9203, 9203, 9725, 9726, 9748, 9749, 9776, 9783, 9800, 9811, 9855, 9855, 9866, 9871, 9875, 9875, 9889, 9889, 9898, 9899, 9917, 9918, 9924, 9925, 9934, 9934, 9940, 9940, 9962, 9962, 9970, 9971, 9973, 9973, 9978, 9978, 9981, 9981, 9989, 9989, 9994, 9995, 10024, 10024, 10060, 10060, 10062, 10062, 10067, 10069, 10071, 10071, 10133, 10135, 10160, 10160, 10175, 10175, 11035, 11036, 11088, 11088, 11093, 11093, 11904, 11929, 11931, 12019, 12032, 12245, 12272, 12287, 12289, 12350, 12353, 12438, 12441, 12543, 12549, 12591, 12593, 12686, 12688, 12773, 12783, 12830, 12832, 12871, 12880, 42124, 42128, 42182, 43360, 43388, 44032, 55203, 63744, 64255, 65040, 65049, 65072, 65106, 65108, 65126, 65128, 65131, 94176, 94180, 94192, 94198, 94208, 101589, 101631, 101662, 101760, 101874, 110576, 110579, 110581, 110587, 110589, 110590, 110592, 110882, 110898, 110898, 110928, 110930, 110933, 110933, 110948, 110951, 110960, 111355, 119552, 119638, 119648, 119670, 126980, 126980, 127183, 127183, 127374, 127374, 127377, 127386, 127488, 127490, 127504, 127547, 127552, 127560, 127568, 127569, 127584, 127589, 127744, 127776, 127789, 127797, 127799, 127868, 127870, 127891, 127904, 127946, 127951, 127955, 127968, 127984, 127988, 127988, 127992, 128062, 128064, 128064, 128066, 128252, 128255, 128317, 128331, 128334, 128336, 128359, 128378, 128378, 128405, 128406, 128420, 128420, 128507, 128591, 128640, 128709, 128716, 128716, 128720, 128722, 128725, 128728, 128732, 128735, 128747, 128748, 128756, 128764, 128992, 129003, 129008, 129008, 129292, 129338, 129340, 129349, 129351, 129535, 129648, 129660, 129664, 129674, 129678, 129734, 129736, 129736, 129741, 129756, 129759, 129770, 129775, 129784, 131072, 196605, 196608, 262141];
|
|
27003
26806
|
|
|
27004
|
-
// node_modules/get-east-asian-width/utilities.js
|
|
26807
|
+
// ../../../node_modules/get-east-asian-width/utilities.js
|
|
27005
26808
|
var isInRange = (ranges, codePoint) => {
|
|
27006
26809
|
let low = 0;
|
|
27007
26810
|
let high = Math.floor(ranges.length / 2) - 1;
|
|
@@ -27019,7 +26822,7 @@ var isInRange = (ranges, codePoint) => {
|
|
|
27019
26822
|
return false;
|
|
27020
26823
|
};
|
|
27021
26824
|
|
|
27022
|
-
// node_modules/get-east-asian-width/lookup.js
|
|
26825
|
+
// ../../../node_modules/get-east-asian-width/lookup.js
|
|
27023
26826
|
var commonCjkCodePoint = 19968;
|
|
27024
26827
|
var [wideFastPathStart, wideFastPathEnd] = /* @__PURE__ */ findWideFastPathRange(wideRanges);
|
|
27025
26828
|
function findWideFastPathRange(ranges) {
|
|
@@ -27060,7 +26863,7 @@ var isWide = (codePoint) => {
|
|
|
27060
26863
|
return isInRange(wideRanges, codePoint);
|
|
27061
26864
|
};
|
|
27062
26865
|
|
|
27063
|
-
// node_modules/get-east-asian-width/index.js
|
|
26866
|
+
// ../../../node_modules/get-east-asian-width/index.js
|
|
27064
26867
|
function validate(codePoint) {
|
|
27065
26868
|
if (!Number.isSafeInteger(codePoint)) {
|
|
27066
26869
|
throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
|
|
@@ -27074,7 +26877,7 @@ function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
|
|
|
27074
26877
|
return 1;
|
|
27075
26878
|
}
|
|
27076
26879
|
|
|
27077
|
-
// node_modules/wrap-ansi/node_modules/string-width/index.js
|
|
26880
|
+
// ../../../node_modules/wrap-ansi/node_modules/string-width/index.js
|
|
27078
26881
|
var segmenter = new Intl.Segmenter();
|
|
27079
26882
|
var zeroWidthClusterRegex = new RegExp("^(?:\\p{Default_Ignorable_Code_Point}|\\p{Control}|\\p{Format}|\\p{Nonspacing_Mark}|\\p{Enclosing_Mark}|\\p{Surrogate})+$", "v");
|
|
27080
26883
|
var leadingNonPrintingRegex = new RegExp("^[\\p{Default_Ignorable_Code_Point}\\p{Control}\\p{Format}\\p{Nonspacing_Mark}\\p{Enclosing_Mark}\\p{Surrogate}]+", "v");
|
|
@@ -27200,7 +27003,7 @@ function stringWidth2(input, options = {}) {
|
|
|
27200
27003
|
return width;
|
|
27201
27004
|
}
|
|
27202
27005
|
|
|
27203
|
-
// node_modules/ansi-styles/index.js
|
|
27006
|
+
// ../../../node_modules/ansi-styles/index.js
|
|
27204
27007
|
var ANSI_BACKGROUND_OFFSET = 10;
|
|
27205
27008
|
var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
27206
27009
|
var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
|
|
@@ -27386,7 +27189,7 @@ function assembleStyles() {
|
|
|
27386
27189
|
var ansiStyles = assembleStyles();
|
|
27387
27190
|
var ansi_styles_default = ansiStyles;
|
|
27388
27191
|
|
|
27389
|
-
// node_modules/wrap-ansi/index.js
|
|
27192
|
+
// ../../../node_modules/wrap-ansi/index.js
|
|
27390
27193
|
var ANSI_ESCAPE = "\x1B";
|
|
27391
27194
|
var ANSI_ESCAPE_BELL = "\x07";
|
|
27392
27195
|
var C1_CSI = "\x9B";
|
|
@@ -27674,18 +27477,18 @@ var applyLeadingSgrResets = (string, startIndex, activeStyles) => {
|
|
|
27674
27477
|
};
|
|
27675
27478
|
var getClosingSgrSequence = (activeStyles) => [...activeStyles].reverse().map((activeStyle) => wrapAnsiCode(activeStyle.close)).join("");
|
|
27676
27479
|
var getOpeningSgrSequence = (activeStyles) => activeStyles.map((activeStyle) => wrapAnsiCode(activeStyle.open)).join("");
|
|
27677
|
-
var wrapWord = (rows, word,
|
|
27480
|
+
var wrapWord = (rows, word, columns2, rowWidth2) => {
|
|
27678
27481
|
const tokens = getTokens(word);
|
|
27679
|
-
let visible =
|
|
27482
|
+
let visible = rowWidth2;
|
|
27680
27483
|
for (let index = 0; index < tokens.length; index++) {
|
|
27681
27484
|
const token = tokens[index];
|
|
27682
|
-
if (token.width > 0 && visible > 0 && visible + token.width >
|
|
27485
|
+
if (token.width > 0 && visible > 0 && visible + token.width > columns2) {
|
|
27683
27486
|
rows.push("");
|
|
27684
27487
|
visible = 0;
|
|
27685
27488
|
}
|
|
27686
27489
|
rows[rows.length - 1] += token.value;
|
|
27687
27490
|
visible += token.width;
|
|
27688
|
-
if (visible ===
|
|
27491
|
+
if (visible === columns2 && index < tokens.length - 1) {
|
|
27689
27492
|
rows.push("");
|
|
27690
27493
|
visible = 0;
|
|
27691
27494
|
}
|
|
@@ -27796,7 +27599,7 @@ var restoreStylesAcrossRows = (preString) => {
|
|
|
27796
27599
|
}
|
|
27797
27600
|
return returnValue + preString.slice(copiedIndex);
|
|
27798
27601
|
};
|
|
27799
|
-
var exec = (string,
|
|
27602
|
+
var exec = (string, columns2, options = {}) => {
|
|
27800
27603
|
if (options.trim !== false && string.trim() === "") {
|
|
27801
27604
|
return "";
|
|
27802
27605
|
}
|
|
@@ -27821,7 +27624,7 @@ var exec = (string, columns3, options = {}) => {
|
|
|
27821
27624
|
if (isFirstWord) {
|
|
27822
27625
|
isFirstWord = false;
|
|
27823
27626
|
} else {
|
|
27824
|
-
if (rowLength >=
|
|
27627
|
+
if (rowLength >= columns2 && (options.wordWrap === false || options.trim === false)) {
|
|
27825
27628
|
rows.push("");
|
|
27826
27629
|
rowLength = 0;
|
|
27827
27630
|
}
|
|
@@ -27830,27 +27633,27 @@ var exec = (string, columns3, options = {}) => {
|
|
|
27830
27633
|
rowLength++;
|
|
27831
27634
|
}
|
|
27832
27635
|
}
|
|
27833
|
-
if (options.hard && options.wordWrap !== false && word.width >
|
|
27834
|
-
const remainingColumns =
|
|
27835
|
-
const breaksStartingThisLine = 1 + Math.floor((word.width - remainingColumns - 1) /
|
|
27836
|
-
const breaksStartingNextLine = Math.floor((word.width - 1) /
|
|
27636
|
+
if (options.hard && options.wordWrap !== false && word.width > columns2) {
|
|
27637
|
+
const remainingColumns = columns2 - rowLength;
|
|
27638
|
+
const breaksStartingThisLine = 1 + Math.floor((word.width - remainingColumns - 1) / columns2);
|
|
27639
|
+
const breaksStartingNextLine = Math.floor((word.width - 1) / columns2);
|
|
27837
27640
|
if (breaksStartingNextLine < breaksStartingThisLine) {
|
|
27838
27641
|
rows.push("");
|
|
27839
27642
|
rowLength = 0;
|
|
27840
27643
|
}
|
|
27841
|
-
rowLength = wrapWord(rows, word.value,
|
|
27644
|
+
rowLength = wrapWord(rows, word.value, columns2, rowLength);
|
|
27842
27645
|
continue;
|
|
27843
27646
|
}
|
|
27844
|
-
if (rowLength + word.width >
|
|
27845
|
-
if (options.wordWrap === false && rowLength <
|
|
27846
|
-
rowLength = wrapWord(rows, word.value,
|
|
27647
|
+
if (rowLength + word.width > columns2 && rowLength > 0 && word.width > 0) {
|
|
27648
|
+
if (options.wordWrap === false && rowLength < columns2) {
|
|
27649
|
+
rowLength = wrapWord(rows, word.value, columns2, rowLength);
|
|
27847
27650
|
continue;
|
|
27848
27651
|
}
|
|
27849
27652
|
rows.push("");
|
|
27850
27653
|
rowLength = 0;
|
|
27851
27654
|
}
|
|
27852
|
-
if (rowLength + word.width >
|
|
27853
|
-
rowLength = wrapWord(rows, word.value,
|
|
27655
|
+
if (rowLength + word.width > columns2 && options.wordWrap === false) {
|
|
27656
|
+
rowLength = wrapWord(rows, word.value, columns2, rowLength);
|
|
27854
27657
|
continue;
|
|
27855
27658
|
}
|
|
27856
27659
|
rows[rows.length - 1] += word.value;
|
|
@@ -27861,11 +27664,11 @@ var exec = (string, columns3, options = {}) => {
|
|
|
27861
27664
|
}
|
|
27862
27665
|
return restoreStylesAcrossRows(rows.join("\n"));
|
|
27863
27666
|
};
|
|
27864
|
-
function wrapAnsi(string,
|
|
27865
|
-
return String(string).normalize().replaceAll("\r\n", "\n").split("\n").map((line) => exec(expandTabs(line),
|
|
27667
|
+
function wrapAnsi(string, columns2, options) {
|
|
27668
|
+
return String(string).normalize().replaceAll("\r\n", "\n").split("\n").map((line) => exec(expandTabs(line), columns2, options)).join("\n");
|
|
27866
27669
|
}
|
|
27867
27670
|
|
|
27868
|
-
// node_modules/terminal-size/index.js
|
|
27671
|
+
// ../../../node_modules/terminal-size/index.js
|
|
27869
27672
|
import process3 from "process";
|
|
27870
27673
|
import { execFileSync } from "child_process";
|
|
27871
27674
|
import fs from "fs";
|
|
@@ -27879,19 +27682,19 @@ var exec2 = (command, arguments_, { shell, env: env3 } = {}) => execFileSync(com
|
|
|
27879
27682
|
shell,
|
|
27880
27683
|
env: env3
|
|
27881
27684
|
}).trim();
|
|
27882
|
-
var create = (
|
|
27883
|
-
columns: Number.parseInt(
|
|
27685
|
+
var create = (columns2, rows) => ({
|
|
27686
|
+
columns: Number.parseInt(columns2, 10),
|
|
27884
27687
|
rows: Number.parseInt(rows, 10)
|
|
27885
27688
|
});
|
|
27886
27689
|
var createIfNotDefault = (maybeColumns, maybeRows) => {
|
|
27887
|
-
const { columns:
|
|
27888
|
-
if (Number.isNaN(
|
|
27690
|
+
const { columns: columns2, rows } = create(maybeColumns, maybeRows);
|
|
27691
|
+
if (Number.isNaN(columns2) || Number.isNaN(rows)) {
|
|
27889
27692
|
return;
|
|
27890
27693
|
}
|
|
27891
|
-
if (
|
|
27694
|
+
if (columns2 === defaultColumns && rows === defaultRows) {
|
|
27892
27695
|
return;
|
|
27893
27696
|
}
|
|
27894
|
-
return { columns:
|
|
27697
|
+
return { columns: columns2, rows };
|
|
27895
27698
|
};
|
|
27896
27699
|
var isForegroundProcess = () => {
|
|
27897
27700
|
if (process3.platform !== "linux") {
|
|
@@ -27943,17 +27746,17 @@ function terminalSize() {
|
|
|
27943
27746
|
var devTty = () => {
|
|
27944
27747
|
try {
|
|
27945
27748
|
const flags = process3.platform === "darwin" ? fs.constants.O_EVTONLY | fs.constants.O_NONBLOCK : fs.constants.O_NONBLOCK;
|
|
27946
|
-
const { columns:
|
|
27947
|
-
return { columns:
|
|
27749
|
+
const { columns: columns2, rows } = tty.WriteStream(fs.openSync("/dev/tty", flags));
|
|
27750
|
+
return { columns: columns2, rows };
|
|
27948
27751
|
} catch {
|
|
27949
27752
|
}
|
|
27950
27753
|
};
|
|
27951
27754
|
var tput = () => {
|
|
27952
27755
|
try {
|
|
27953
|
-
const
|
|
27756
|
+
const columns2 = exec2("tput", ["cols"], { env: { TERM: "dumb", ...process3.env } });
|
|
27954
27757
|
const rows = exec2("tput", ["lines"], { env: { TERM: "dumb", ...process3.env } });
|
|
27955
|
-
if (
|
|
27956
|
-
return createIfNotDefault(
|
|
27758
|
+
if (columns2 && rows) {
|
|
27759
|
+
return createIfNotDefault(columns2, rows);
|
|
27957
27760
|
}
|
|
27958
27761
|
} catch {
|
|
27959
27762
|
}
|
|
@@ -27971,27 +27774,27 @@ var resize = () => {
|
|
|
27971
27774
|
}
|
|
27972
27775
|
};
|
|
27973
27776
|
|
|
27974
|
-
// node_modules/ink/build/utils.js
|
|
27777
|
+
// ../../../node_modules/ink/build/utils.js
|
|
27975
27778
|
var getWindowSize = (stdout) => {
|
|
27976
|
-
const { columns:
|
|
27977
|
-
if (
|
|
27978
|
-
return { columns:
|
|
27779
|
+
const { columns: columns2, rows } = stdout;
|
|
27780
|
+
if (columns2 && rows) {
|
|
27781
|
+
return { columns: columns2, rows };
|
|
27979
27782
|
}
|
|
27980
27783
|
const fallbackSize = terminalSize();
|
|
27981
27784
|
return {
|
|
27982
|
-
columns:
|
|
27785
|
+
columns: columns2 || fallbackSize.columns || 80,
|
|
27983
27786
|
rows: rows || fallbackSize.rows || 24
|
|
27984
27787
|
};
|
|
27985
27788
|
};
|
|
27986
27789
|
|
|
27987
|
-
// node_modules/ink/build/reconciler.js
|
|
27790
|
+
// ../../../node_modules/ink/build/reconciler.js
|
|
27988
27791
|
var import_react_reconciler = __toESM(require_react_reconciler(), 1);
|
|
27989
27792
|
var import_constants = __toESM(require_constants(), 1);
|
|
27990
27793
|
var Scheduler = __toESM(require_scheduler(), 1);
|
|
27991
27794
|
import process4 from "process";
|
|
27992
27795
|
var import_react = __toESM(require_react(), 1);
|
|
27993
27796
|
|
|
27994
|
-
// node_modules/widest-line/node_modules/ansi-regex/index.js
|
|
27797
|
+
// ../../../node_modules/widest-line/node_modules/ansi-regex/index.js
|
|
27995
27798
|
function ansiRegex2({ onlyFirst = false } = {}) {
|
|
27996
27799
|
const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
|
|
27997
27800
|
const osc = `(?:\\u001B\\][^\\u0007\\u001B\\u009C]*${ST})`;
|
|
@@ -28000,7 +27803,7 @@ function ansiRegex2({ onlyFirst = false } = {}) {
|
|
|
28000
27803
|
return new RegExp(pattern, onlyFirst ? void 0 : "g");
|
|
28001
27804
|
}
|
|
28002
27805
|
|
|
28003
|
-
// node_modules/widest-line/node_modules/strip-ansi/index.js
|
|
27806
|
+
// ../../../node_modules/widest-line/node_modules/strip-ansi/index.js
|
|
28004
27807
|
var regex2 = ansiRegex2();
|
|
28005
27808
|
function stripAnsi2(string) {
|
|
28006
27809
|
if (typeof string !== "string") {
|
|
@@ -28012,7 +27815,7 @@ function stripAnsi2(string) {
|
|
|
28012
27815
|
return string.replace(regex2, "");
|
|
28013
27816
|
}
|
|
28014
27817
|
|
|
28015
|
-
// node_modules/widest-line/node_modules/string-width/index.js
|
|
27818
|
+
// ../../../node_modules/widest-line/node_modules/string-width/index.js
|
|
28016
27819
|
var segmenter3 = new Intl.Segmenter();
|
|
28017
27820
|
var zeroWidthClusterRegex2 = new RegExp("^(?:\\p{Default_Ignorable_Code_Point}|\\p{Control}|\\p{Format}|\\p{Nonspacing_Mark}|\\p{Enclosing_Mark}|\\p{Surrogate})+$", "v");
|
|
28018
27821
|
var leadingNonPrintingRegex2 = new RegExp("^[\\p{Default_Ignorable_Code_Point}\\p{Control}\\p{Format}\\p{Nonspacing_Mark}\\p{Enclosing_Mark}\\p{Surrogate}]+", "v");
|
|
@@ -28138,7 +27941,7 @@ function stringWidth3(input, options = {}) {
|
|
|
28138
27941
|
return width;
|
|
28139
27942
|
}
|
|
28140
27943
|
|
|
28141
|
-
// node_modules/widest-line/index.js
|
|
27944
|
+
// ../../../node_modules/widest-line/index.js
|
|
28142
27945
|
function widestLine(string) {
|
|
28143
27946
|
let lineWidth = 0;
|
|
28144
27947
|
for (const line of string.split("\n")) {
|
|
@@ -28147,7 +27950,7 @@ function widestLine(string) {
|
|
|
28147
27950
|
return lineWidth;
|
|
28148
27951
|
}
|
|
28149
27952
|
|
|
28150
|
-
// node_modules/ink/build/measure-text.js
|
|
27953
|
+
// ../../../node_modules/ink/build/measure-text.js
|
|
28151
27954
|
var cache = /* @__PURE__ */ new Map();
|
|
28152
27955
|
var measureText = (text) => {
|
|
28153
27956
|
if (text.length === 0) {
|
|
@@ -28168,7 +27971,7 @@ var measureText = (text) => {
|
|
|
28168
27971
|
};
|
|
28169
27972
|
var measure_text_default = measureText;
|
|
28170
27973
|
|
|
28171
|
-
// node_modules/
|
|
27974
|
+
// ../../../node_modules/is-fullwidth-code-point/index.js
|
|
28172
27975
|
function isFullwidthCodePoint(codePoint) {
|
|
28173
27976
|
if (!Number.isInteger(codePoint)) {
|
|
28174
27977
|
return false;
|
|
@@ -28176,7 +27979,7 @@ function isFullwidthCodePoint(codePoint) {
|
|
|
28176
27979
|
return isFullWidth(codePoint) || isWide(codePoint);
|
|
28177
27980
|
}
|
|
28178
27981
|
|
|
28179
|
-
// node_modules/slice-ansi/tokenize-ansi.js
|
|
27982
|
+
// ../../../node_modules/slice-ansi/tokenize-ansi.js
|
|
28180
27983
|
var ESCAPE_CODE_POINT = 27;
|
|
28181
27984
|
var C1_DCS_CODE_POINT = 144;
|
|
28182
27985
|
var C1_SOS_CODE_POINT = 152;
|
|
@@ -28782,7 +28585,7 @@ function tokenizeAnsi(string, { endCharacter = Number.POSITIVE_INFINITY } = {})
|
|
|
28782
28585
|
return tokens;
|
|
28783
28586
|
}
|
|
28784
28587
|
|
|
28785
|
-
// node_modules/slice-ansi/index.js
|
|
28588
|
+
// ../../../node_modules/slice-ansi/index.js
|
|
28786
28589
|
function applySgrFragments(activeStyles, fragments) {
|
|
28787
28590
|
for (const fragment of fragments) {
|
|
28788
28591
|
switch (fragment.type) {
|
|
@@ -29012,7 +28815,7 @@ function sliceAnsi(string, start, end) {
|
|
|
29012
28815
|
return returnValue;
|
|
29013
28816
|
}
|
|
29014
28817
|
|
|
29015
|
-
// node_modules/cli-truncate/node_modules/ansi-regex/index.js
|
|
28818
|
+
// ../../../node_modules/cli-truncate/node_modules/ansi-regex/index.js
|
|
29016
28819
|
function ansiRegex3({ onlyFirst = false } = {}) {
|
|
29017
28820
|
const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
|
|
29018
28821
|
const osc = `(?:\\u001B\\][^\\u0007\\u001B\\u009C]*${ST})`;
|
|
@@ -29021,7 +28824,7 @@ function ansiRegex3({ onlyFirst = false } = {}) {
|
|
|
29021
28824
|
return new RegExp(pattern, onlyFirst ? void 0 : "g");
|
|
29022
28825
|
}
|
|
29023
28826
|
|
|
29024
|
-
// node_modules/cli-truncate/node_modules/strip-ansi/index.js
|
|
28827
|
+
// ../../../node_modules/cli-truncate/node_modules/strip-ansi/index.js
|
|
29025
28828
|
var regex3 = ansiRegex3();
|
|
29026
28829
|
function stripAnsi3(string) {
|
|
29027
28830
|
if (typeof string !== "string") {
|
|
@@ -29033,7 +28836,7 @@ function stripAnsi3(string) {
|
|
|
29033
28836
|
return string.replace(regex3, "");
|
|
29034
28837
|
}
|
|
29035
28838
|
|
|
29036
|
-
// node_modules/cli-truncate/node_modules/string-width/index.js
|
|
28839
|
+
// ../../../node_modules/cli-truncate/node_modules/string-width/index.js
|
|
29037
28840
|
var segmenter4 = new Intl.Segmenter();
|
|
29038
28841
|
var zeroWidthClusterRegex3 = new RegExp("^(?:\\p{Default_Ignorable_Code_Point}|\\p{Control}|\\p{Format}|\\p{Nonspacing_Mark}|\\p{Enclosing_Mark}|\\p{Surrogate})+$", "v");
|
|
29039
28842
|
var leadingNonPrintingRegex3 = new RegExp("^[\\p{Default_Ignorable_Code_Point}\\p{Control}\\p{Format}\\p{Nonspacing_Mark}\\p{Enclosing_Mark}\\p{Surrogate}]+", "v");
|
|
@@ -29159,7 +28962,7 @@ function stringWidth4(input, options = {}) {
|
|
|
29159
28962
|
return width;
|
|
29160
28963
|
}
|
|
29161
28964
|
|
|
29162
|
-
// node_modules/cli-truncate/index.js
|
|
28965
|
+
// ../../../node_modules/cli-truncate/index.js
|
|
29163
28966
|
var validPositions = /* @__PURE__ */ new Set(["start", "middle", "end"]);
|
|
29164
28967
|
function getIndexOfNearestSpace(string, wantedIndex, shouldSearchRight) {
|
|
29165
28968
|
if (string.charAt(wantedIndex) === " ") {
|
|
@@ -29174,15 +28977,15 @@ function getIndexOfNearestSpace(string, wantedIndex, shouldSearchRight) {
|
|
|
29174
28977
|
}
|
|
29175
28978
|
return wantedIndex;
|
|
29176
28979
|
}
|
|
29177
|
-
function validateInput(text,
|
|
28980
|
+
function validateInput(text, columns2, position, truncationCharacter) {
|
|
29178
28981
|
if (typeof text !== "string") {
|
|
29179
28982
|
throw new TypeError(`Expected \`input\` to be a string, got ${typeof text}`);
|
|
29180
28983
|
}
|
|
29181
|
-
if (typeof
|
|
29182
|
-
throw new TypeError(`Expected \`columns\` to be a number, got ${typeof
|
|
28984
|
+
if (typeof columns2 !== "number") {
|
|
28985
|
+
throw new TypeError(`Expected \`columns\` to be a number, got ${typeof columns2}`);
|
|
29183
28986
|
}
|
|
29184
|
-
if (!Number.isFinite(
|
|
29185
|
-
throw new TypeError(`Expected \`columns\` to be a finite number, got ${
|
|
28987
|
+
if (!Number.isFinite(columns2)) {
|
|
28988
|
+
throw new TypeError(`Expected \`columns\` to be a finite number, got ${columns2}`);
|
|
29186
28989
|
}
|
|
29187
28990
|
if (!validPositions.has(position)) {
|
|
29188
28991
|
throw new TypeError(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${position}`);
|
|
@@ -29191,22 +28994,22 @@ function validateInput(text, columns3, position, truncationCharacter) {
|
|
|
29191
28994
|
throw new TypeError(`Expected \`options.truncationCharacter\` to be a string, got ${typeof truncationCharacter}`);
|
|
29192
28995
|
}
|
|
29193
28996
|
}
|
|
29194
|
-
function cliTruncate(text,
|
|
28997
|
+
function cliTruncate(text, columns2, options = {}) {
|
|
29195
28998
|
const {
|
|
29196
28999
|
position = "end",
|
|
29197
29000
|
space = false,
|
|
29198
29001
|
preferTruncationOnSpace = false
|
|
29199
29002
|
} = options;
|
|
29200
29003
|
let { truncationCharacter = "\u2026" } = options;
|
|
29201
|
-
validateInput(text,
|
|
29202
|
-
if (
|
|
29004
|
+
validateInput(text, columns2, position, truncationCharacter);
|
|
29005
|
+
if (columns2 < 1) {
|
|
29203
29006
|
return "";
|
|
29204
29007
|
}
|
|
29205
29008
|
const length = stringWidth4(text);
|
|
29206
|
-
if (length <=
|
|
29009
|
+
if (length <= columns2) {
|
|
29207
29010
|
return text;
|
|
29208
29011
|
}
|
|
29209
|
-
if (
|
|
29012
|
+
if (columns2 === 1) {
|
|
29210
29013
|
return truncationCharacter;
|
|
29211
29014
|
}
|
|
29212
29015
|
const ANSI = {
|
|
@@ -29261,47 +29064,47 @@ function cliTruncate(text, columns3, options = {}) {
|
|
|
29261
29064
|
}
|
|
29262
29065
|
if (position === "start") {
|
|
29263
29066
|
if (preferTruncationOnSpace) {
|
|
29264
|
-
const nearestSpace = getIndexOfNearestSpace(text, length -
|
|
29067
|
+
const nearestSpace = getIndexOfNearestSpace(text, length - columns2 + stringWidth4(truncationCharacter), true);
|
|
29265
29068
|
const right2 = sliceAnsi(text, nearestSpace, length).trim();
|
|
29266
29069
|
return prependWithInheritedStyleFromStart(truncationCharacter, right2);
|
|
29267
29070
|
}
|
|
29268
29071
|
if (space) {
|
|
29269
29072
|
truncationCharacter += " ";
|
|
29270
29073
|
}
|
|
29271
|
-
const right = sliceAnsi(text, length -
|
|
29074
|
+
const right = sliceAnsi(text, length - columns2 + stringWidth4(truncationCharacter), length);
|
|
29272
29075
|
return prependWithInheritedStyleFromStart(truncationCharacter, right);
|
|
29273
29076
|
}
|
|
29274
29077
|
if (position === "middle") {
|
|
29275
29078
|
if (space) {
|
|
29276
29079
|
truncationCharacter = ` ${truncationCharacter} `;
|
|
29277
|
-
if (stringWidth4(truncationCharacter) >=
|
|
29080
|
+
if (stringWidth4(truncationCharacter) >= columns2) {
|
|
29278
29081
|
truncationCharacter = truncationCharacter.trim();
|
|
29279
29082
|
}
|
|
29280
29083
|
}
|
|
29281
29084
|
const truncationWidth = stringWidth4(truncationCharacter);
|
|
29282
|
-
const half = Math.min(Math.floor(
|
|
29085
|
+
const half = Math.min(Math.floor(columns2 / 2), Math.max(0, columns2 - truncationWidth));
|
|
29283
29086
|
if (preferTruncationOnSpace) {
|
|
29284
29087
|
const spaceNearFirstBreakPoint = getIndexOfNearestSpace(text, half);
|
|
29285
|
-
const spaceNearSecondBreakPoint = getIndexOfNearestSpace(text, length - (
|
|
29088
|
+
const spaceNearSecondBreakPoint = getIndexOfNearestSpace(text, length - (columns2 - half) + truncationWidth, true);
|
|
29286
29089
|
return sliceAnsi(text, 0, spaceNearFirstBreakPoint) + truncationCharacter + sliceAnsi(text, spaceNearSecondBreakPoint, length).trim();
|
|
29287
29090
|
}
|
|
29288
|
-
return sliceAnsi(text, 0, half) + truncationCharacter + sliceAnsi(text, length - (
|
|
29091
|
+
return sliceAnsi(text, 0, half) + truncationCharacter + sliceAnsi(text, length - (columns2 - half) + truncationWidth, length);
|
|
29289
29092
|
}
|
|
29290
29093
|
if (position === "end") {
|
|
29291
29094
|
if (preferTruncationOnSpace) {
|
|
29292
|
-
const nearestSpace = getIndexOfNearestSpace(text,
|
|
29095
|
+
const nearestSpace = getIndexOfNearestSpace(text, columns2 - stringWidth4(truncationCharacter));
|
|
29293
29096
|
const left2 = sliceAnsi(text, 0, nearestSpace);
|
|
29294
29097
|
return appendWithInheritedStyleFromEnd(left2, truncationCharacter);
|
|
29295
29098
|
}
|
|
29296
29099
|
if (space) {
|
|
29297
29100
|
truncationCharacter = ` ${truncationCharacter}`;
|
|
29298
29101
|
}
|
|
29299
|
-
const left = sliceAnsi(text, 0,
|
|
29102
|
+
const left = sliceAnsi(text, 0, columns2 - stringWidth4(truncationCharacter));
|
|
29300
29103
|
return appendWithInheritedStyleFromEnd(left, truncationCharacter);
|
|
29301
29104
|
}
|
|
29302
29105
|
}
|
|
29303
29106
|
|
|
29304
|
-
// node_modules/ink/build/wrap-text.js
|
|
29107
|
+
// ../../../node_modules/ink/build/wrap-text.js
|
|
29305
29108
|
var cache2 = {};
|
|
29306
29109
|
var wrapText = (text, maxWidth, wrapType) => {
|
|
29307
29110
|
const cacheKey = text + String(maxWidth) + String(wrapType);
|
|
@@ -29338,7 +29141,7 @@ var wrapText = (text, maxWidth, wrapType) => {
|
|
|
29338
29141
|
};
|
|
29339
29142
|
var wrap_text_default = wrapText;
|
|
29340
29143
|
|
|
29341
|
-
// node_modules/ink/build/ansi-tokenizer.js
|
|
29144
|
+
// ../../../node_modules/ink/build/ansi-tokenizer.js
|
|
29342
29145
|
var bellCharacter = "\x07";
|
|
29343
29146
|
var escapeCharacter = "\x1B";
|
|
29344
29147
|
var stringTerminatorCharacter = "\x9C";
|
|
@@ -29645,7 +29448,7 @@ var tokenizeAnsi2 = (text) => {
|
|
|
29645
29448
|
return tokens;
|
|
29646
29449
|
};
|
|
29647
29450
|
|
|
29648
|
-
// node_modules/ink/build/sanitize-ansi.js
|
|
29451
|
+
// ../../../node_modules/ink/build/sanitize-ansi.js
|
|
29649
29452
|
var sgrParametersRegex = /^[\d:;]*$/;
|
|
29650
29453
|
var sanitizeAnsi = (text) => {
|
|
29651
29454
|
if (!hasAnsiControlCharacters(text)) {
|
|
@@ -29665,7 +29468,7 @@ var sanitizeAnsi = (text) => {
|
|
|
29665
29468
|
};
|
|
29666
29469
|
var sanitize_ansi_default = sanitizeAnsi;
|
|
29667
29470
|
|
|
29668
|
-
// node_modules/ink/build/squash-text-nodes.js
|
|
29471
|
+
// ../../../node_modules/ink/build/squash-text-nodes.js
|
|
29669
29472
|
var squashTextNodes = (node) => {
|
|
29670
29473
|
let text = "";
|
|
29671
29474
|
for (let index = 0; index < node.childNodes.length; index++) {
|
|
@@ -29690,7 +29493,7 @@ var squashTextNodes = (node) => {
|
|
|
29690
29493
|
};
|
|
29691
29494
|
var squash_text_nodes_default = squashTextNodes;
|
|
29692
29495
|
|
|
29693
|
-
// node_modules/ink/build/dom.js
|
|
29496
|
+
// ../../../node_modules/ink/build/dom.js
|
|
29694
29497
|
var createNode = (nodeName) => {
|
|
29695
29498
|
const node = {
|
|
29696
29499
|
nodeName,
|
|
@@ -29814,7 +29617,7 @@ var emitLayoutListeners = (rootNode) => {
|
|
|
29814
29617
|
}
|
|
29815
29618
|
};
|
|
29816
29619
|
|
|
29817
|
-
// node_modules/ink/build/styles.js
|
|
29620
|
+
// ../../../node_modules/ink/build/styles.js
|
|
29818
29621
|
var positionEdges = [
|
|
29819
29622
|
["top", src_default.EDGE_TOP],
|
|
29820
29623
|
["right", src_default.EDGE_RIGHT],
|
|
@@ -30101,7 +29904,7 @@ var styles2 = (node, style = {}, currentStyle = style) => {
|
|
|
30101
29904
|
};
|
|
30102
29905
|
var styles_default = styles2;
|
|
30103
29906
|
|
|
30104
|
-
// node_modules/ink/build/reconciler.js
|
|
29907
|
+
// ../../../node_modules/ink/build/reconciler.js
|
|
30105
29908
|
if (process4.env["DEV"] === "true") {
|
|
30106
29909
|
let isDevtoolsInstalled = false;
|
|
30107
29910
|
try {
|
|
@@ -30388,7 +30191,7 @@ var reconciler_default = (0, import_react_reconciler.default)({
|
|
|
30388
30191
|
rendererVersion: packageInfo.version
|
|
30389
30192
|
});
|
|
30390
30193
|
|
|
30391
|
-
// node_modules/indent-string/index.js
|
|
30194
|
+
// ../../../node_modules/indent-string/index.js
|
|
30392
30195
|
function indentString(string, count = 1, options = {}) {
|
|
30393
30196
|
const {
|
|
30394
30197
|
indent = " ",
|
|
@@ -30421,13 +30224,13 @@ function indentString(string, count = 1, options = {}) {
|
|
|
30421
30224
|
return string.replace(regex5, indent.repeat(count));
|
|
30422
30225
|
}
|
|
30423
30226
|
|
|
30424
|
-
// node_modules/ink/build/get-max-width.js
|
|
30227
|
+
// ../../../node_modules/ink/build/get-max-width.js
|
|
30425
30228
|
var getMaxWidth = (yogaNode) => {
|
|
30426
30229
|
return yogaNode.getComputedWidth() - yogaNode.getComputedPadding(src_default.EDGE_LEFT) - yogaNode.getComputedPadding(src_default.EDGE_RIGHT) - yogaNode.getComputedBorder(src_default.EDGE_LEFT) - yogaNode.getComputedBorder(src_default.EDGE_RIGHT);
|
|
30427
30230
|
};
|
|
30428
30231
|
var get_max_width_default = getMaxWidth;
|
|
30429
30232
|
|
|
30430
|
-
// node_modules/cli-boxes/boxes.json
|
|
30233
|
+
// ../../../node_modules/cli-boxes/boxes.json
|
|
30431
30234
|
var boxes_default = {
|
|
30432
30235
|
single: {
|
|
30433
30236
|
topLeft: "\u250C",
|
|
@@ -30511,10 +30314,10 @@ var boxes_default = {
|
|
|
30511
30314
|
}
|
|
30512
30315
|
};
|
|
30513
30316
|
|
|
30514
|
-
// node_modules/cli-boxes/index.js
|
|
30317
|
+
// ../../../node_modules/cli-boxes/index.js
|
|
30515
30318
|
var cli_boxes_default = boxes_default;
|
|
30516
30319
|
|
|
30517
|
-
// node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
30320
|
+
// ../../../node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
30518
30321
|
var ANSI_BACKGROUND_OFFSET2 = 10;
|
|
30519
30322
|
var wrapAnsi162 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
30520
30323
|
var wrapAnsi2562 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
|
|
@@ -30700,7 +30503,7 @@ function assembleStyles2() {
|
|
|
30700
30503
|
var ansiStyles2 = assembleStyles2();
|
|
30701
30504
|
var ansi_styles_default2 = ansiStyles2;
|
|
30702
30505
|
|
|
30703
|
-
// node_modules/chalk/source/vendor/supports-color/index.js
|
|
30506
|
+
// ../../../node_modules/chalk/source/vendor/supports-color/index.js
|
|
30704
30507
|
import process5 from "process";
|
|
30705
30508
|
import os2 from "os";
|
|
30706
30509
|
import tty2 from "tty";
|
|
@@ -30832,7 +30635,7 @@ var supportsColor = {
|
|
|
30832
30635
|
};
|
|
30833
30636
|
var supports_color_default = supportsColor;
|
|
30834
30637
|
|
|
30835
|
-
// node_modules/chalk/source/utilities.js
|
|
30638
|
+
// ../../../node_modules/chalk/source/utilities.js
|
|
30836
30639
|
function stringReplaceAll(string, substring, replacer) {
|
|
30837
30640
|
let index = string.indexOf(substring);
|
|
30838
30641
|
if (index === -1) {
|
|
@@ -30862,7 +30665,7 @@ function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
|
|
|
30862
30665
|
return returnValue;
|
|
30863
30666
|
}
|
|
30864
30667
|
|
|
30865
|
-
// node_modules/chalk/source/index.js
|
|
30668
|
+
// ../../../node_modules/chalk/source/index.js
|
|
30866
30669
|
var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
|
|
30867
30670
|
var GENERATOR = /* @__PURE__ */ Symbol("GENERATOR");
|
|
30868
30671
|
var STYLER = /* @__PURE__ */ Symbol("STYLER");
|
|
@@ -31009,7 +30812,7 @@ var chalk = createChalk();
|
|
|
31009
30812
|
var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
31010
30813
|
var source_default = chalk;
|
|
31011
30814
|
|
|
31012
|
-
// node_modules/ink/build/colorize.js
|
|
30815
|
+
// ../../../node_modules/ink/build/colorize.js
|
|
31013
30816
|
var rgbRegex = /^rgb\(\s?(\d+),\s?(\d+),\s?(\d+)\s?\)$/;
|
|
31014
30817
|
var ansiRegex4 = /^ansi256\(\s?(\d+)\s?\)$/;
|
|
31015
30818
|
var isNamedColor = (color) => {
|
|
@@ -31051,7 +30854,7 @@ var colorize = (str, color, type) => {
|
|
|
31051
30854
|
};
|
|
31052
30855
|
var colorize_default = colorize;
|
|
31053
30856
|
|
|
31054
|
-
// node_modules/ink/build/render-border.js
|
|
30857
|
+
// ../../../node_modules/ink/build/render-border.js
|
|
31055
30858
|
var stylePiece = (segment, fg, bg, dim) => {
|
|
31056
30859
|
let styled = colorize_default(segment, fg, "foreground");
|
|
31057
30860
|
styled = colorize_default(styled, bg, "background");
|
|
@@ -31081,8 +30884,8 @@ var renderBorder = (x, y, node, output) => {
|
|
|
31081
30884
|
const showBottomBorder = node.style.borderBottom !== false;
|
|
31082
30885
|
const showLeftBorder = node.style.borderLeft !== false;
|
|
31083
30886
|
const showRightBorder = node.style.borderRight !== false;
|
|
31084
|
-
const
|
|
31085
|
-
let topBorder = showTopBorder ? (showLeftBorder ? box.topLeft : "") + box.top.repeat(
|
|
30887
|
+
const contentWidth2 = width - (showLeftBorder ? 1 : 0) - (showRightBorder ? 1 : 0);
|
|
30888
|
+
let topBorder = showTopBorder ? (showLeftBorder ? box.topLeft : "") + box.top.repeat(contentWidth2) + (showRightBorder ? box.topRight : "") : void 0;
|
|
31086
30889
|
topBorder &&= stylePiece(topBorder, topBorderColor, topBorderBackgroundColor, dimTopBorderColor);
|
|
31087
30890
|
let verticalBorderHeight = height;
|
|
31088
30891
|
if (showTopBorder) {
|
|
@@ -31101,7 +30904,7 @@ var renderBorder = (x, y, node, output) => {
|
|
|
31101
30904
|
const one = stylePiece(box.right, rightBorderColor, rightBorderBackgroundColor, dimRightBorderColor);
|
|
31102
30905
|
rightBorder = (one + "\n").repeat(verticalBorderHeight);
|
|
31103
30906
|
}
|
|
31104
|
-
let bottomBorder = showBottomBorder ? (showLeftBorder ? box.bottomLeft : "") + box.bottom.repeat(
|
|
30907
|
+
let bottomBorder = showBottomBorder ? (showLeftBorder ? box.bottomLeft : "") + box.bottom.repeat(contentWidth2) + (showRightBorder ? box.bottomRight : "") : void 0;
|
|
31105
30908
|
bottomBorder &&= stylePiece(bottomBorder, bottomBorderColor, bottomBorderBackgroundColor, dimBottomBorderColor);
|
|
31106
30909
|
const offsetY = showTopBorder ? 1 : 0;
|
|
31107
30910
|
if (topBorder) {
|
|
@@ -31122,7 +30925,7 @@ var renderBorder = (x, y, node, output) => {
|
|
|
31122
30925
|
};
|
|
31123
30926
|
var render_border_default = renderBorder;
|
|
31124
30927
|
|
|
31125
|
-
// node_modules/ink/build/render-background.js
|
|
30928
|
+
// ../../../node_modules/ink/build/render-background.js
|
|
31126
30929
|
var renderBackground = (x, y, node, output) => {
|
|
31127
30930
|
if (!node.style.backgroundColor) {
|
|
31128
30931
|
return;
|
|
@@ -31133,19 +30936,19 @@ var renderBackground = (x, y, node, output) => {
|
|
|
31133
30936
|
const rightBorderWidth = node.style.borderStyle && node.style.borderRight !== false ? 1 : 0;
|
|
31134
30937
|
const topBorderHeight = node.style.borderStyle && node.style.borderTop !== false ? 1 : 0;
|
|
31135
30938
|
const bottomBorderHeight = node.style.borderStyle && node.style.borderBottom !== false ? 1 : 0;
|
|
31136
|
-
const
|
|
30939
|
+
const contentWidth2 = width - leftBorderWidth - rightBorderWidth;
|
|
31137
30940
|
const contentHeight = height - topBorderHeight - bottomBorderHeight;
|
|
31138
|
-
if (!(
|
|
30941
|
+
if (!(contentWidth2 > 0 && contentHeight > 0)) {
|
|
31139
30942
|
return;
|
|
31140
30943
|
}
|
|
31141
|
-
const backgroundLine = colorize_default(" ".repeat(
|
|
30944
|
+
const backgroundLine = colorize_default(" ".repeat(contentWidth2), node.style.backgroundColor, "background");
|
|
31142
30945
|
for (let row = 0; row < contentHeight; row++) {
|
|
31143
30946
|
output.write(x + leftBorderWidth, y + topBorderHeight + row, backgroundLine, { transformers: [] });
|
|
31144
30947
|
}
|
|
31145
30948
|
};
|
|
31146
30949
|
var render_background_default = renderBackground;
|
|
31147
30950
|
|
|
31148
|
-
// node_modules/ink/build/render-node-to-output.js
|
|
30951
|
+
// ../../../node_modules/ink/build/render-node-to-output.js
|
|
31149
30952
|
var applyPaddingToText = (node, text) => {
|
|
31150
30953
|
const yogaNode = node.childNodes[0]?.yogaNode;
|
|
31151
30954
|
if (yogaNode) {
|
|
@@ -31253,7 +31056,7 @@ var renderNodeToOutput = (node, output, options) => {
|
|
|
31253
31056
|
};
|
|
31254
31057
|
var render_node_to_output_default = renderNodeToOutput;
|
|
31255
31058
|
|
|
31256
|
-
// node_modules/ink/node_modules/ansi-regex/index.js
|
|
31059
|
+
// ../../../node_modules/ink/node_modules/ansi-regex/index.js
|
|
31257
31060
|
function ansiRegex5({ onlyFirst = false } = {}) {
|
|
31258
31061
|
const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
|
|
31259
31062
|
const osc = `(?:\\u001B\\][^\\u0007\\u001B\\u009C]*${ST})`;
|
|
@@ -31262,7 +31065,7 @@ function ansiRegex5({ onlyFirst = false } = {}) {
|
|
|
31262
31065
|
return new RegExp(pattern, onlyFirst ? void 0 : "g");
|
|
31263
31066
|
}
|
|
31264
31067
|
|
|
31265
|
-
// node_modules/ink/node_modules/strip-ansi/index.js
|
|
31068
|
+
// ../../../node_modules/ink/node_modules/strip-ansi/index.js
|
|
31266
31069
|
var regex4 = ansiRegex5();
|
|
31267
31070
|
function stripAnsi4(string) {
|
|
31268
31071
|
if (typeof string !== "string") {
|
|
@@ -31274,7 +31077,7 @@ function stripAnsi4(string) {
|
|
|
31274
31077
|
return string.replace(regex4, "");
|
|
31275
31078
|
}
|
|
31276
31079
|
|
|
31277
|
-
// node_modules/ink/node_modules/string-width/index.js
|
|
31080
|
+
// ../../../node_modules/ink/node_modules/string-width/index.js
|
|
31278
31081
|
var segmenter5 = new Intl.Segmenter();
|
|
31279
31082
|
var zeroWidthClusterRegex4 = new RegExp("^(?:\\p{Default_Ignorable_Code_Point}|\\p{Control}|\\p{Format}|\\p{Nonspacing_Mark}|\\p{Enclosing_Mark}|\\p{Surrogate})+$", "v");
|
|
31280
31083
|
var leadingNonPrintingRegex4 = new RegExp("^[\\p{Default_Ignorable_Code_Point}\\p{Control}\\p{Format}\\p{Nonspacing_Mark}\\p{Enclosing_Mark}\\p{Surrogate}]+", "v");
|
|
@@ -31400,7 +31203,7 @@ function stringWidth5(input, options = {}) {
|
|
|
31400
31203
|
return width;
|
|
31401
31204
|
}
|
|
31402
31205
|
|
|
31403
|
-
// node_modules/@alcalzone/ansi-tokenize/build/consts.js
|
|
31206
|
+
// ../../../node_modules/@alcalzone/ansi-tokenize/build/consts.js
|
|
31404
31207
|
var BEL2 = "\x07";
|
|
31405
31208
|
var ESC2 = "\x1B";
|
|
31406
31209
|
var BACKSLASH = "\\";
|
|
@@ -31424,7 +31227,7 @@ var linkEndCode = `${ESC2}${OSC2}8;;${BEL2}`;
|
|
|
31424
31227
|
var linkEndCodeST = `${ESC2}${OSC2}8;;${ESC2}${BACKSLASH}`;
|
|
31425
31228
|
var linkEndCodeC1ST = `${ESC2}${OSC2}8;;${C1_ST}`;
|
|
31426
31229
|
|
|
31427
|
-
// node_modules/@alcalzone/ansi-tokenize/build/ansiCodes.js
|
|
31230
|
+
// ../../../node_modules/@alcalzone/ansi-tokenize/build/ansiCodes.js
|
|
31428
31231
|
var endCodesSet = /* @__PURE__ */ new Set();
|
|
31429
31232
|
var endCodesMap = /* @__PURE__ */ new Map();
|
|
31430
31233
|
for (const [start, end] of ansi_styles_default.codes) {
|
|
@@ -31464,7 +31267,7 @@ function isIntensityCode(code) {
|
|
|
31464
31267
|
return code.code === ansi_styles_default.bold.open || code.code === ansi_styles_default.dim.open;
|
|
31465
31268
|
}
|
|
31466
31269
|
|
|
31467
|
-
// node_modules/@alcalzone/ansi-tokenize/build/reduce.js
|
|
31270
|
+
// ../../../node_modules/@alcalzone/ansi-tokenize/build/reduce.js
|
|
31468
31271
|
function reduceAnsiCodes(codes) {
|
|
31469
31272
|
return reduceAnsiCodesIncremental([], codes);
|
|
31470
31273
|
}
|
|
@@ -31489,7 +31292,7 @@ function reduceAnsiCodesIncremental(codes, newCodes) {
|
|
|
31489
31292
|
return ret;
|
|
31490
31293
|
}
|
|
31491
31294
|
|
|
31492
|
-
// node_modules/@alcalzone/ansi-tokenize/build/undo.js
|
|
31295
|
+
// ../../../node_modules/@alcalzone/ansi-tokenize/build/undo.js
|
|
31493
31296
|
function undoAnsiCodes2(codes) {
|
|
31494
31297
|
return reduceAnsiCodes(codes).reverse().map((code) => ({
|
|
31495
31298
|
...code,
|
|
@@ -31497,7 +31300,7 @@ function undoAnsiCodes2(codes) {
|
|
|
31497
31300
|
}));
|
|
31498
31301
|
}
|
|
31499
31302
|
|
|
31500
|
-
// node_modules/@alcalzone/ansi-tokenize/build/diff.js
|
|
31303
|
+
// ../../../node_modules/@alcalzone/ansi-tokenize/build/diff.js
|
|
31501
31304
|
function diffAnsiCodes(from, to) {
|
|
31502
31305
|
const endCodesInTo = new Set(to.map((code) => code.endCode));
|
|
31503
31306
|
const startCodesInTo = new Set(to.map((code) => code.code));
|
|
@@ -31516,7 +31319,7 @@ function diffAnsiCodes(from, to) {
|
|
|
31516
31319
|
];
|
|
31517
31320
|
}
|
|
31518
31321
|
|
|
31519
|
-
// node_modules/@alcalzone/ansi-tokenize/build/styledChars.js
|
|
31322
|
+
// ../../../node_modules/@alcalzone/ansi-tokenize/build/styledChars.js
|
|
31520
31323
|
function styledCharsFromTokens(tokens) {
|
|
31521
31324
|
let codes = [];
|
|
31522
31325
|
const ret = [];
|
|
@@ -31549,18 +31352,10 @@ function styledCharsToString(chars) {
|
|
|
31549
31352
|
return ret;
|
|
31550
31353
|
}
|
|
31551
31354
|
|
|
31552
|
-
// node_modules/@alcalzone/ansi-tokenize/
|
|
31553
|
-
function isFullwidthCodePoint2(codePoint) {
|
|
31554
|
-
if (!Number.isInteger(codePoint)) {
|
|
31555
|
-
return false;
|
|
31556
|
-
}
|
|
31557
|
-
return isFullWidth(codePoint) || isWide(codePoint);
|
|
31558
|
-
}
|
|
31559
|
-
|
|
31560
|
-
// node_modules/@alcalzone/ansi-tokenize/build/tokenize.js
|
|
31355
|
+
// ../../../node_modules/@alcalzone/ansi-tokenize/build/tokenize.js
|
|
31561
31356
|
var segmenter6 = new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
31562
31357
|
function isFullwidthGrapheme(grapheme, baseCodePoint) {
|
|
31563
|
-
if (
|
|
31358
|
+
if (isFullwidthCodePoint(baseCodePoint))
|
|
31564
31359
|
return true;
|
|
31565
31360
|
if (grapheme.includes("\uFE0F"))
|
|
31566
31361
|
return true;
|
|
@@ -31706,7 +31501,7 @@ function tokenize(str, endChar = Number.POSITIVE_INFINITY) {
|
|
|
31706
31501
|
return ret;
|
|
31707
31502
|
}
|
|
31708
31503
|
|
|
31709
|
-
// node_modules/ink/build/output.js
|
|
31504
|
+
// ../../../node_modules/ink/build/output.js
|
|
31710
31505
|
var OutputCaches = class {
|
|
31711
31506
|
widths = /* @__PURE__ */ new Map();
|
|
31712
31507
|
blockWidths = /* @__PURE__ */ new Map();
|
|
@@ -31894,7 +31689,7 @@ var Output = class {
|
|
|
31894
31689
|
}
|
|
31895
31690
|
};
|
|
31896
31691
|
|
|
31897
|
-
// node_modules/ink/build/renderer.js
|
|
31692
|
+
// ../../../node_modules/ink/build/renderer.js
|
|
31898
31693
|
var renderer = (node, isScreenReaderEnabled) => {
|
|
31899
31694
|
if (node.yogaNode) {
|
|
31900
31695
|
if (isScreenReaderEnabled) {
|
|
@@ -31950,7 +31745,7 @@ var renderer = (node, isScreenReaderEnabled) => {
|
|
|
31950
31745
|
};
|
|
31951
31746
|
var renderer_default = renderer;
|
|
31952
31747
|
|
|
31953
|
-
// node_modules/ink/build/cursor-helpers.js
|
|
31748
|
+
// ../../../node_modules/ink/build/cursor-helpers.js
|
|
31954
31749
|
var showCursorEscape = "\x1B[?25h";
|
|
31955
31750
|
var hideCursorEscape = "\x1B[?25l";
|
|
31956
31751
|
var cursorPositionChanged = (a, b) => a?.x !== b?.x || a?.y !== b?.y;
|
|
@@ -31981,12 +31776,12 @@ var buildReturnToBottomPrefix = (cursorWasShown, previousLineCount, previousCurs
|
|
|
31981
31776
|
return hideCursorEscape + buildReturnToBottom(previousLineCount, previousCursorPosition);
|
|
31982
31777
|
};
|
|
31983
31778
|
|
|
31984
|
-
// node_modules/cli-cursor/index.js
|
|
31779
|
+
// ../../../node_modules/cli-cursor/index.js
|
|
31985
31780
|
import process7 from "process";
|
|
31986
31781
|
|
|
31987
|
-
// node_modules/restore-cursor/index.js
|
|
31782
|
+
// ../../../node_modules/restore-cursor/index.js
|
|
31988
31783
|
var import_onetime = __toESM(require_onetime(), 1);
|
|
31989
|
-
var import_signal_exit = __toESM(
|
|
31784
|
+
var import_signal_exit = __toESM(require_signal_exit(), 1);
|
|
31990
31785
|
import process6 from "process";
|
|
31991
31786
|
var restoreCursor = (0, import_onetime.default)(() => {
|
|
31992
31787
|
(0, import_signal_exit.default)(() => {
|
|
@@ -31995,7 +31790,7 @@ var restoreCursor = (0, import_onetime.default)(() => {
|
|
|
31995
31790
|
});
|
|
31996
31791
|
var restore_cursor_default = restoreCursor;
|
|
31997
31792
|
|
|
31998
|
-
// node_modules/cli-cursor/index.js
|
|
31793
|
+
// ../../../node_modules/cli-cursor/index.js
|
|
31999
31794
|
var isHidden = false;
|
|
32000
31795
|
var cliCursor = {};
|
|
32001
31796
|
cliCursor.show = (writableStream = process7.stderr) => {
|
|
@@ -32025,7 +31820,7 @@ cliCursor.toggle = (force, writableStream) => {
|
|
|
32025
31820
|
};
|
|
32026
31821
|
var cli_cursor_default = cliCursor;
|
|
32027
31822
|
|
|
32028
|
-
// node_modules/ink/build/log-update.js
|
|
31823
|
+
// ../../../node_modules/ink/build/log-update.js
|
|
32029
31824
|
var visibleLineCount = (lines, str) => str.endsWith("\n") ? lines.length - 1 : lines.length;
|
|
32030
31825
|
var createStandard = (stream, { showCursor = false } = {}) => {
|
|
32031
31826
|
let previousLineCount = 0;
|
|
@@ -32255,23 +32050,23 @@ var create2 = (stream, { showCursor = false, incremental = false } = {}) => {
|
|
|
32255
32050
|
var logUpdate = { create: create2 };
|
|
32256
32051
|
var log_update_default = logUpdate;
|
|
32257
32052
|
|
|
32258
|
-
// node_modules/ink/build/write-synchronized.js
|
|
32053
|
+
// ../../../node_modules/ink/build/write-synchronized.js
|
|
32259
32054
|
var bsu = "\x1B[?2026h";
|
|
32260
32055
|
var esu = "\x1B[?2026l";
|
|
32261
32056
|
function shouldSynchronize(stream, interactive) {
|
|
32262
32057
|
return "isTTY" in stream && stream.isTTY && (interactive ?? !is_in_ci_default);
|
|
32263
32058
|
}
|
|
32264
32059
|
|
|
32265
|
-
// node_modules/ink/build/instances.js
|
|
32060
|
+
// ../../../node_modules/ink/build/instances.js
|
|
32266
32061
|
var instances = /* @__PURE__ */ new WeakMap();
|
|
32267
32062
|
var instances_default = instances;
|
|
32268
32063
|
|
|
32269
|
-
// node_modules/ink/build/components/App.js
|
|
32064
|
+
// ../../../node_modules/ink/build/components/App.js
|
|
32270
32065
|
var import_react15 = __toESM(require_react(), 1);
|
|
32271
32066
|
import { EventEmitter as EventEmitter2 } from "events";
|
|
32272
32067
|
import process11 from "process";
|
|
32273
32068
|
|
|
32274
|
-
// node_modules/ink/build/input-parser.js
|
|
32069
|
+
// ../../../node_modules/ink/build/input-parser.js
|
|
32275
32070
|
var escape = "\x1B";
|
|
32276
32071
|
var pasteStart = "\x1B[200~";
|
|
32277
32072
|
var pasteEnd = "\x1B[201~";
|
|
@@ -32456,7 +32251,7 @@ var createInputParser = () => {
|
|
|
32456
32251
|
};
|
|
32457
32252
|
};
|
|
32458
32253
|
|
|
32459
|
-
// node_modules/ink/build/components/AppContext.js
|
|
32254
|
+
// ../../../node_modules/ink/build/components/AppContext.js
|
|
32460
32255
|
var import_react2 = __toESM(require_react(), 1);
|
|
32461
32256
|
var noopSuspension = {
|
|
32462
32257
|
async resume() {
|
|
@@ -32481,7 +32276,7 @@ var AppContext = (0, import_react2.createContext)(defaultValue);
|
|
|
32481
32276
|
AppContext.displayName = "InternalAppContext";
|
|
32482
32277
|
var AppContext_default = AppContext;
|
|
32483
32278
|
|
|
32484
|
-
// node_modules/ink/build/components/StdinContext.js
|
|
32279
|
+
// ../../../node_modules/ink/build/components/StdinContext.js
|
|
32485
32280
|
var import_react3 = __toESM(require_react(), 1);
|
|
32486
32281
|
import { EventEmitter } from "events";
|
|
32487
32282
|
import process8 from "process";
|
|
@@ -32500,7 +32295,7 @@ var StdinContext = (0, import_react3.createContext)({
|
|
|
32500
32295
|
StdinContext.displayName = "InternalStdinContext";
|
|
32501
32296
|
var StdinContext_default = StdinContext;
|
|
32502
32297
|
|
|
32503
|
-
// node_modules/ink/build/components/StdoutContext.js
|
|
32298
|
+
// ../../../node_modules/ink/build/components/StdoutContext.js
|
|
32504
32299
|
var import_react4 = __toESM(require_react(), 1);
|
|
32505
32300
|
import process9 from "process";
|
|
32506
32301
|
var StdoutContext = (0, import_react4.createContext)({
|
|
@@ -32511,7 +32306,7 @@ var StdoutContext = (0, import_react4.createContext)({
|
|
|
32511
32306
|
StdoutContext.displayName = "InternalStdoutContext";
|
|
32512
32307
|
var StdoutContext_default = StdoutContext;
|
|
32513
32308
|
|
|
32514
|
-
// node_modules/ink/build/components/StderrContext.js
|
|
32309
|
+
// ../../../node_modules/ink/build/components/StderrContext.js
|
|
32515
32310
|
var import_react5 = __toESM(require_react(), 1);
|
|
32516
32311
|
import process10 from "process";
|
|
32517
32312
|
var StderrContext = (0, import_react5.createContext)({
|
|
@@ -32522,7 +32317,7 @@ var StderrContext = (0, import_react5.createContext)({
|
|
|
32522
32317
|
StderrContext.displayName = "InternalStderrContext";
|
|
32523
32318
|
var StderrContext_default = StderrContext;
|
|
32524
32319
|
|
|
32525
|
-
// node_modules/ink/build/components/FocusContext.js
|
|
32320
|
+
// ../../../node_modules/ink/build/components/FocusContext.js
|
|
32526
32321
|
var import_react6 = __toESM(require_react(), 1);
|
|
32527
32322
|
var FocusContext = (0, import_react6.createContext)({
|
|
32528
32323
|
activeId: void 0,
|
|
@@ -32548,7 +32343,7 @@ var FocusContext = (0, import_react6.createContext)({
|
|
|
32548
32343
|
FocusContext.displayName = "InternalFocusContext";
|
|
32549
32344
|
var FocusContext_default = FocusContext;
|
|
32550
32345
|
|
|
32551
|
-
// node_modules/ink/build/components/AnimationContext.js
|
|
32346
|
+
// ../../../node_modules/ink/build/components/AnimationContext.js
|
|
32552
32347
|
var import_react7 = __toESM(require_react(), 1);
|
|
32553
32348
|
var animationContext = (0, import_react7.createContext)({
|
|
32554
32349
|
renderThrottleMs: 0,
|
|
@@ -32563,7 +32358,7 @@ var animationContext = (0, import_react7.createContext)({
|
|
|
32563
32358
|
animationContext.displayName = "InternalAnimationContext";
|
|
32564
32359
|
var AnimationContext_default = animationContext;
|
|
32565
32360
|
|
|
32566
|
-
// node_modules/ink/build/components/CursorContext.js
|
|
32361
|
+
// ../../../node_modules/ink/build/components/CursorContext.js
|
|
32567
32362
|
var import_react8 = __toESM(require_react(), 1);
|
|
32568
32363
|
var CursorContext = (0, import_react8.createContext)({
|
|
32569
32364
|
setCursorPosition() {
|
|
@@ -32572,22 +32367,22 @@ var CursorContext = (0, import_react8.createContext)({
|
|
|
32572
32367
|
CursorContext.displayName = "InternalCursorContext";
|
|
32573
32368
|
var CursorContext_default = CursorContext;
|
|
32574
32369
|
|
|
32575
|
-
// node_modules/ink/build/components/ErrorBoundary.js
|
|
32370
|
+
// ../../../node_modules/ink/build/components/ErrorBoundary.js
|
|
32576
32371
|
var import_react14 = __toESM(require_react(), 1);
|
|
32577
32372
|
|
|
32578
|
-
// node_modules/ink/build/components/ErrorOverview.js
|
|
32373
|
+
// ../../../node_modules/ink/build/components/ErrorOverview.js
|
|
32579
32374
|
var import_react13 = __toESM(require_react(), 1);
|
|
32580
32375
|
var import_stack_utils = __toESM(require_stack_utils(), 1);
|
|
32581
32376
|
import * as fs2 from "fs";
|
|
32582
32377
|
import { cwd } from "process";
|
|
32583
32378
|
|
|
32584
|
-
// node_modules/convert-to-spaces/dist/index.js
|
|
32379
|
+
// ../../../node_modules/convert-to-spaces/dist/index.js
|
|
32585
32380
|
var convertToSpaces = (input, spaces = 2) => {
|
|
32586
32381
|
return input.replace(/^\t+/gm, ($1) => " ".repeat($1.length * spaces));
|
|
32587
32382
|
};
|
|
32588
32383
|
var dist_default2 = convertToSpaces;
|
|
32589
32384
|
|
|
32590
|
-
// node_modules/code-excerpt/dist/index.js
|
|
32385
|
+
// ../../../node_modules/code-excerpt/dist/index.js
|
|
32591
32386
|
var generateLineNumbers = (line, around) => {
|
|
32592
32387
|
const lineNumbers = [];
|
|
32593
32388
|
const min = line - around;
|
|
@@ -32613,20 +32408,20 @@ var codeExcerpt = (source, line, options = {}) => {
|
|
|
32613
32408
|
};
|
|
32614
32409
|
var dist_default3 = codeExcerpt;
|
|
32615
32410
|
|
|
32616
|
-
// node_modules/ink/build/components/Box.js
|
|
32411
|
+
// ../../../node_modules/ink/build/components/Box.js
|
|
32617
32412
|
var import_react11 = __toESM(require_react(), 1);
|
|
32618
32413
|
|
|
32619
|
-
// node_modules/ink/build/components/AccessibilityContext.js
|
|
32414
|
+
// ../../../node_modules/ink/build/components/AccessibilityContext.js
|
|
32620
32415
|
var import_react9 = __toESM(require_react(), 1);
|
|
32621
32416
|
var accessibilityContext = (0, import_react9.createContext)({
|
|
32622
32417
|
isScreenReaderEnabled: false
|
|
32623
32418
|
});
|
|
32624
32419
|
|
|
32625
|
-
// node_modules/ink/build/components/BackgroundContext.js
|
|
32420
|
+
// ../../../node_modules/ink/build/components/BackgroundContext.js
|
|
32626
32421
|
var import_react10 = __toESM(require_react(), 1);
|
|
32627
32422
|
var backgroundContext = (0, import_react10.createContext)(void 0);
|
|
32628
32423
|
|
|
32629
|
-
// node_modules/ink/build/components/Box.js
|
|
32424
|
+
// ../../../node_modules/ink/build/components/Box.js
|
|
32630
32425
|
var Box = (0, import_react11.forwardRef)(({ children, backgroundColor, "aria-label": ariaLabel, "aria-hidden": ariaHidden, "aria-role": role, "aria-state": ariaState, ...style }, ref) => {
|
|
32631
32426
|
const { isScreenReaderEnabled } = (0, import_react11.useContext)(accessibilityContext);
|
|
32632
32427
|
const label = ariaLabel ? import_react11.default.createElement("ink-text", null, ariaLabel) : void 0;
|
|
@@ -32654,7 +32449,7 @@ var Box = (0, import_react11.forwardRef)(({ children, backgroundColor, "aria-lab
|
|
|
32654
32449
|
Box.displayName = "Box";
|
|
32655
32450
|
var Box_default = Box;
|
|
32656
32451
|
|
|
32657
|
-
// node_modules/ink/build/components/Text.js
|
|
32452
|
+
// ../../../node_modules/ink/build/components/Text.js
|
|
32658
32453
|
var import_react12 = __toESM(require_react(), 1);
|
|
32659
32454
|
function Text({ color, backgroundColor, dimColor = false, bold = false, italic = false, underline = false, strikethrough = false, inverse = false, wrap = "wrap", children, "aria-label": ariaLabel, "aria-hidden": ariaHidden = false }) {
|
|
32660
32455
|
const { isScreenReaderEnabled } = (0, import_react12.useContext)(accessibilityContext);
|
|
@@ -32697,7 +32492,7 @@ function Text({ color, backgroundColor, dimColor = false, bold = false, italic =
|
|
|
32697
32492
|
return import_react12.default.createElement("ink-text", { style: { flexGrow: 0, flexShrink: 1, flexDirection: "row", textWrap: wrap }, internal_transform: transform }, childrenOrAriaLabel);
|
|
32698
32493
|
}
|
|
32699
32494
|
|
|
32700
|
-
// node_modules/ink/build/components/ErrorOverview.js
|
|
32495
|
+
// ../../../node_modules/ink/build/components/ErrorOverview.js
|
|
32701
32496
|
var cleanupPath = (path) => {
|
|
32702
32497
|
return path?.replace(`file://${cwd()}/`, "");
|
|
32703
32498
|
};
|
|
@@ -32810,7 +32605,7 @@ function ErrorOverview({ error }) {
|
|
|
32810
32605
|
);
|
|
32811
32606
|
}
|
|
32812
32607
|
|
|
32813
|
-
// node_modules/ink/build/components/ErrorBoundary.js
|
|
32608
|
+
// ../../../node_modules/ink/build/components/ErrorBoundary.js
|
|
32814
32609
|
var ErrorBoundary = class extends import_react14.PureComponent {
|
|
32815
32610
|
static displayName = "InternalErrorBoundary";
|
|
32816
32611
|
static getDerivedStateFromError(error) {
|
|
@@ -32830,7 +32625,7 @@ var ErrorBoundary = class extends import_react14.PureComponent {
|
|
|
32830
32625
|
}
|
|
32831
32626
|
};
|
|
32832
32627
|
|
|
32833
|
-
// node_modules/ink/build/components/App.js
|
|
32628
|
+
// ../../../node_modules/ink/build/components/App.js
|
|
32834
32629
|
var tab = " ";
|
|
32835
32630
|
var shiftTab = "\x1B[Z";
|
|
32836
32631
|
var escape2 = "\x1B";
|
|
@@ -33342,7 +33137,7 @@ function App({ children, stdin, stdout, stderr, writeToStdout, writeToStderr, ex
|
|
|
33342
33137
|
App.displayName = "InternalApp";
|
|
33343
33138
|
var App_default = App;
|
|
33344
33139
|
|
|
33345
|
-
// node_modules/ink/build/kitty-keyboard.js
|
|
33140
|
+
// ../../../node_modules/ink/build/kitty-keyboard.js
|
|
33346
33141
|
var kittyFlags = {
|
|
33347
33142
|
disambiguateEscapeCodes: 1,
|
|
33348
33143
|
reportEventTypes: 2,
|
|
@@ -33368,7 +33163,7 @@ var kittyModifiers = {
|
|
|
33368
33163
|
numLock: 128
|
|
33369
33164
|
};
|
|
33370
33165
|
|
|
33371
|
-
// node_modules/ink/build/ink.js
|
|
33166
|
+
// ../../../node_modules/ink/build/ink.js
|
|
33372
33167
|
var noop = () => {
|
|
33373
33168
|
};
|
|
33374
33169
|
var textEncoder = new TextEncoder();
|
|
@@ -34164,7 +33959,7 @@ var Ink = class {
|
|
|
34164
33959
|
}
|
|
34165
33960
|
};
|
|
34166
33961
|
|
|
34167
|
-
// node_modules/ink/build/render.js
|
|
33962
|
+
// ../../../node_modules/ink/build/render.js
|
|
34168
33963
|
var render = (node, options) => {
|
|
34169
33964
|
const inkOptions = {
|
|
34170
33965
|
stdout: process13.stdout,
|
|
@@ -34215,25 +34010,25 @@ var getInstance = (stdout, createInstance2) => {
|
|
|
34215
34010
|
return instance;
|
|
34216
34011
|
};
|
|
34217
34012
|
|
|
34218
|
-
// node_modules/ink/build/render-to-string.js
|
|
34013
|
+
// ../../../node_modules/ink/build/render-to-string.js
|
|
34219
34014
|
var import_constants3 = __toESM(require_constants(), 1);
|
|
34220
34015
|
|
|
34221
|
-
// node_modules/ink/build/components/Static.js
|
|
34016
|
+
// ../../../node_modules/ink/build/components/Static.js
|
|
34222
34017
|
var import_react17 = __toESM(require_react(), 1);
|
|
34223
34018
|
|
|
34224
|
-
// node_modules/ink/build/components/Transform.js
|
|
34019
|
+
// ../../../node_modules/ink/build/components/Transform.js
|
|
34225
34020
|
var import_react18 = __toESM(require_react(), 1);
|
|
34226
34021
|
|
|
34227
|
-
// node_modules/ink/build/components/Newline.js
|
|
34022
|
+
// ../../../node_modules/ink/build/components/Newline.js
|
|
34228
34023
|
var import_react19 = __toESM(require_react(), 1);
|
|
34229
34024
|
|
|
34230
|
-
// node_modules/ink/build/components/Spacer.js
|
|
34025
|
+
// ../../../node_modules/ink/build/components/Spacer.js
|
|
34231
34026
|
var import_react20 = __toESM(require_react(), 1);
|
|
34232
34027
|
|
|
34233
|
-
// node_modules/ink/build/hooks/use-input.js
|
|
34028
|
+
// ../../../node_modules/ink/build/hooks/use-input.js
|
|
34234
34029
|
var import_react22 = __toESM(require_react(), 1);
|
|
34235
34030
|
|
|
34236
|
-
// node_modules/ink/build/parse-keypress.js
|
|
34031
|
+
// ../../../node_modules/ink/build/parse-keypress.js
|
|
34237
34032
|
var textDecoder = new TextDecoder();
|
|
34238
34033
|
var metaKeyCodeRe = /^(?:\x1b)([a-zA-Z0-9])$/;
|
|
34239
34034
|
var fnKeyRe = /^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/;
|
|
@@ -34665,11 +34460,11 @@ var parseKeypress = (s = "") => {
|
|
|
34665
34460
|
};
|
|
34666
34461
|
var parse_keypress_default = parseKeypress;
|
|
34667
34462
|
|
|
34668
|
-
// node_modules/ink/build/hooks/use-stdin.js
|
|
34463
|
+
// ../../../node_modules/ink/build/hooks/use-stdin.js
|
|
34669
34464
|
var import_react21 = __toESM(require_react(), 1);
|
|
34670
34465
|
var useStdinContext = () => (0, import_react21.useContext)(StdinContext_default);
|
|
34671
34466
|
|
|
34672
|
-
// node_modules/ink/build/hooks/use-input.js
|
|
34467
|
+
// ../../../node_modules/ink/build/hooks/use-input.js
|
|
34673
34468
|
var useInput = (inputHandler, options = {}) => {
|
|
34674
34469
|
const { setRawMode, internal_exitOnCtrlC, internal_eventEmitter } = useStdinContext();
|
|
34675
34470
|
(0, import_react22.useEffect)(() => {
|
|
@@ -34749,41 +34544,41 @@ var useInput = (inputHandler, options = {}) => {
|
|
|
34749
34544
|
};
|
|
34750
34545
|
var use_input_default = useInput;
|
|
34751
34546
|
|
|
34752
|
-
// node_modules/ink/build/hooks/use-paste.js
|
|
34547
|
+
// ../../../node_modules/ink/build/hooks/use-paste.js
|
|
34753
34548
|
var import_react23 = __toESM(require_react(), 1);
|
|
34754
34549
|
|
|
34755
|
-
// node_modules/ink/build/hooks/use-app.js
|
|
34550
|
+
// ../../../node_modules/ink/build/hooks/use-app.js
|
|
34756
34551
|
var import_react24 = __toESM(require_react(), 1);
|
|
34757
34552
|
var useApp = () => (0, import_react24.useContext)(AppContext_default);
|
|
34758
34553
|
var use_app_default = useApp;
|
|
34759
34554
|
|
|
34760
|
-
// node_modules/ink/build/hooks/use-stdout.js
|
|
34555
|
+
// ../../../node_modules/ink/build/hooks/use-stdout.js
|
|
34761
34556
|
var import_react25 = __toESM(require_react(), 1);
|
|
34762
34557
|
var useStdout = () => (0, import_react25.useContext)(StdoutContext_default);
|
|
34763
34558
|
var use_stdout_default = useStdout;
|
|
34764
34559
|
|
|
34765
|
-
// node_modules/ink/build/hooks/use-stderr.js
|
|
34560
|
+
// ../../../node_modules/ink/build/hooks/use-stderr.js
|
|
34766
34561
|
var import_react26 = __toESM(require_react(), 1);
|
|
34767
34562
|
|
|
34768
|
-
// node_modules/ink/build/hooks/use-focus.js
|
|
34563
|
+
// ../../../node_modules/ink/build/hooks/use-focus.js
|
|
34769
34564
|
var import_react27 = __toESM(require_react(), 1);
|
|
34770
34565
|
|
|
34771
|
-
// node_modules/ink/build/hooks/use-focus-manager.js
|
|
34566
|
+
// ../../../node_modules/ink/build/hooks/use-focus-manager.js
|
|
34772
34567
|
var import_react28 = __toESM(require_react(), 1);
|
|
34773
34568
|
|
|
34774
|
-
// node_modules/ink/build/hooks/use-is-screen-reader-enabled.js
|
|
34569
|
+
// ../../../node_modules/ink/build/hooks/use-is-screen-reader-enabled.js
|
|
34775
34570
|
var import_react29 = __toESM(require_react(), 1);
|
|
34776
34571
|
|
|
34777
|
-
// node_modules/ink/build/hooks/use-cursor.js
|
|
34572
|
+
// ../../../node_modules/ink/build/hooks/use-cursor.js
|
|
34778
34573
|
var import_react30 = __toESM(require_react(), 1);
|
|
34779
34574
|
|
|
34780
|
-
// node_modules/ink/build/hooks/use-animation.js
|
|
34575
|
+
// ../../../node_modules/ink/build/hooks/use-animation.js
|
|
34781
34576
|
var import_react31 = __toESM(require_react(), 1);
|
|
34782
34577
|
|
|
34783
|
-
// node_modules/ink/build/hooks/use-window-size.js
|
|
34578
|
+
// ../../../node_modules/ink/build/hooks/use-window-size.js
|
|
34784
34579
|
var import_react32 = __toESM(require_react(), 1);
|
|
34785
34580
|
|
|
34786
|
-
// node_modules/ink/build/hooks/use-box-metrics.js
|
|
34581
|
+
// ../../../node_modules/ink/build/hooks/use-box-metrics.js
|
|
34787
34582
|
var import_react33 = __toESM(require_react(), 1);
|
|
34788
34583
|
|
|
34789
34584
|
// src/tui/app.tsx
|
|
@@ -34872,6 +34667,7 @@ async function copyToClipboard(text) {
|
|
|
34872
34667
|
// src/tui/components/confirm.tsx
|
|
34873
34668
|
var import_react34 = __toESM(require_react(), 1);
|
|
34874
34669
|
var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
|
|
34670
|
+
var CONFIRM_KEYS = "\u2190\u2192 \u5207\u6362 \xB7 Enter \u786E\u5B9A \xB7 y/n \u76F4\u63A5\u9009 \xB7 Esc \u53D6\u6D88";
|
|
34875
34671
|
function Confirm({
|
|
34876
34672
|
title,
|
|
34877
34673
|
detail,
|
|
@@ -34903,7 +34699,10 @@ function Confirm({
|
|
|
34903
34699
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { inverse: !yes, children: " \u53D6\u6D88 " }),
|
|
34904
34700
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: " " }),
|
|
34905
34701
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { inverse: yes, color: yes ? "red" : void 0, children: ` ${confirmLabel} ` }),
|
|
34906
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
34702
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, { dimColor: true, children: [
|
|
34703
|
+
"\u3000",
|
|
34704
|
+
CONFIRM_KEYS
|
|
34705
|
+
] })
|
|
34907
34706
|
] })
|
|
34908
34707
|
] });
|
|
34909
34708
|
}
|
|
@@ -34922,6 +34721,7 @@ var ROW_COLORS = ["#FFFFFF", "#D5E1FD", "#AAC4FB", "#80A6F9", "#5589F7", "#2B6BF
|
|
|
34922
34721
|
var BRAND_BLUE = "#2B6BF5";
|
|
34923
34722
|
var ART_COLUMNS = WORDMARK[0].length;
|
|
34924
34723
|
var MIN_COLUMNS = ART_COLUMNS + 21;
|
|
34724
|
+
var headerRows = (columns2) => columns2 < MIN_COLUMNS ? 3 : WORDMARK.length + 2;
|
|
34925
34725
|
function Wordmark() {
|
|
34926
34726
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Box_default, { flexDirection: "column", children: WORDMARK.map((line, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color: ROW_COLORS[index], children: line }, line)) });
|
|
34927
34727
|
}
|
|
@@ -34953,9 +34753,9 @@ function AccountPanel({
|
|
|
34953
34753
|
}
|
|
34954
34754
|
function BrandMark({
|
|
34955
34755
|
subtitle,
|
|
34956
|
-
columns:
|
|
34756
|
+
columns: columns2
|
|
34957
34757
|
}) {
|
|
34958
|
-
if (
|
|
34758
|
+
if (columns2 < ART_COLUMNS + 4) {
|
|
34959
34759
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { borderStyle: "round", borderColor: "blue", paddingX: 1, children: [
|
|
34960
34760
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { bold: true, color: BRAND_BLUE, children: "AutoDL" }),
|
|
34961
34761
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Text, { dimColor: true, children: [
|
|
@@ -34979,9 +34779,9 @@ function Header({
|
|
|
34979
34779
|
identity,
|
|
34980
34780
|
balance,
|
|
34981
34781
|
balanceError,
|
|
34982
|
-
columns:
|
|
34782
|
+
columns: columns2
|
|
34983
34783
|
}) {
|
|
34984
|
-
if (
|
|
34784
|
+
if (columns2 < MIN_COLUMNS) {
|
|
34985
34785
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { borderStyle: "round", borderColor: "blue", paddingX: 1, justifyContent: "space-between", children: [
|
|
34986
34786
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Text, { bold: true, color: BRAND_BLUE, children: [
|
|
34987
34787
|
"AutoDL",
|
|
@@ -35071,7 +34871,9 @@ function buildRow(instance, snapshot, now) {
|
|
|
35071
34871
|
ttlSeconds: tracked?.ttlSeconds ?? null
|
|
35072
34872
|
};
|
|
35073
34873
|
}
|
|
35074
|
-
|
|
34874
|
+
var HISTORY_POINTS = 32;
|
|
34875
|
+
var appendSample = (series, value) => value === null ? series : [...series, value].slice(-HISTORY_POINTS);
|
|
34876
|
+
function useInstances(client, { intervalMs = 1e4, paused = false, watch } = {}) {
|
|
35075
34877
|
const [instances2, setInstances] = (0, import_react35.useState)([]);
|
|
35076
34878
|
const [snapshots, setSnapshots] = (0, import_react35.useState)({});
|
|
35077
34879
|
const [loading, setLoading] = (0, import_react35.useState)(true);
|
|
@@ -35086,6 +34888,35 @@ function useInstances(client, { intervalMs = 1e4, paused = false } = {}) {
|
|
|
35086
34888
|
mounted.current = false;
|
|
35087
34889
|
};
|
|
35088
34890
|
}, []);
|
|
34891
|
+
const instancesRef = (0, import_react35.useRef)(instances2);
|
|
34892
|
+
instancesRef.current = instances2;
|
|
34893
|
+
const watchRef = (0, import_react35.useRef)(watch);
|
|
34894
|
+
watchRef.current = watch;
|
|
34895
|
+
const loadSnapshot = (0, import_react35.useCallback)(
|
|
34896
|
+
(uuid) => {
|
|
34897
|
+
const instance = instancesRef.current.find((i) => i.uuid === uuid);
|
|
34898
|
+
if (instance?.status !== "running") return;
|
|
34899
|
+
const startedAt = instance.startedAt;
|
|
34900
|
+
getInstanceSnapshot(client, uuid).then(
|
|
34901
|
+
(snapshot) => setSnapshots((prev) => {
|
|
34902
|
+
const previous = prev[uuid];
|
|
34903
|
+
const carried = previous && previous.startedAt === startedAt ? previous.history : { cpu: [], mem: [] };
|
|
34904
|
+
return {
|
|
34905
|
+
...prev,
|
|
34906
|
+
[uuid]: {
|
|
34907
|
+
startedAt,
|
|
34908
|
+
snapshot,
|
|
34909
|
+
history: {
|
|
34910
|
+
cpu: appendSample(carried.cpu, snapshot.usage.cpuPercent),
|
|
34911
|
+
mem: appendSample(carried.mem, snapshot.usage.memPercent)
|
|
34912
|
+
}
|
|
34913
|
+
}
|
|
34914
|
+
};
|
|
34915
|
+
})
|
|
34916
|
+
).catch(() => void 0);
|
|
34917
|
+
},
|
|
34918
|
+
[client]
|
|
34919
|
+
);
|
|
35089
34920
|
const load = (0, import_react35.useCallback)(async () => {
|
|
35090
34921
|
if (inFlight.current) return;
|
|
35091
34922
|
inFlight.current = true;
|
|
@@ -35093,8 +34924,10 @@ function useInstances(client, { intervalMs = 1e4, paused = false } = {}) {
|
|
|
35093
34924
|
const next = await listAllInstances(client);
|
|
35094
34925
|
if (!mounted.current) return;
|
|
35095
34926
|
setInstances(next);
|
|
34927
|
+
instancesRef.current = next;
|
|
35096
34928
|
setError(null);
|
|
35097
34929
|
setLastUpdated(Date.now());
|
|
34930
|
+
if (watchRef.current) loadSnapshot(watchRef.current);
|
|
35098
34931
|
} catch (err) {
|
|
35099
34932
|
if (mounted.current) {
|
|
35100
34933
|
setError(err.message);
|
|
@@ -35104,7 +34937,7 @@ function useInstances(client, { intervalMs = 1e4, paused = false } = {}) {
|
|
|
35104
34937
|
inFlight.current = false;
|
|
35105
34938
|
if (mounted.current) setLoading(false);
|
|
35106
34939
|
}
|
|
35107
|
-
}, [client]);
|
|
34940
|
+
}, [client, loadSnapshot]);
|
|
35108
34941
|
const refresh = (0, import_react35.useCallback)(() => {
|
|
35109
34942
|
void load();
|
|
35110
34943
|
}, [load]);
|
|
@@ -35115,16 +34948,14 @@ function useInstances(client, { intervalMs = 1e4, paused = false } = {}) {
|
|
|
35115
34948
|
const timer = setInterval(() => void load(), intervalMs);
|
|
35116
34949
|
return () => clearInterval(timer);
|
|
35117
34950
|
}, [load, intervalMs, paused, authError]);
|
|
35118
|
-
const
|
|
35119
|
-
|
|
35120
|
-
|
|
35121
|
-
|
|
35122
|
-
|
|
35123
|
-
|
|
35124
|
-
[client, instances2]
|
|
35125
|
-
);
|
|
34951
|
+
const freshEntry = (instance) => {
|
|
34952
|
+
const cached = snapshots[instance.uuid];
|
|
34953
|
+
if (!cached || instance.status !== "running") return void 0;
|
|
34954
|
+
return cached.startedAt === instance.startedAt ? cached : void 0;
|
|
34955
|
+
};
|
|
34956
|
+
const freshSnapshot = (instance) => freshEntry(instance)?.snapshot;
|
|
35126
34957
|
const now = Date.now();
|
|
35127
|
-
const rows = instances2.map((instance) => buildRow(instance,
|
|
34958
|
+
const rows = instances2.map((instance) => buildRow(instance, freshSnapshot(instance), now));
|
|
35128
34959
|
return {
|
|
35129
34960
|
rows,
|
|
35130
34961
|
loading,
|
|
@@ -35132,7 +34963,14 @@ function useInstances(client, { intervalMs = 1e4, paused = false } = {}) {
|
|
|
35132
34963
|
authError,
|
|
35133
34964
|
lastUpdated,
|
|
35134
34965
|
refresh,
|
|
35135
|
-
snapshotFor: (uuid) =>
|
|
34966
|
+
snapshotFor: (uuid) => {
|
|
34967
|
+
const instance = instances2.find((i) => i.uuid === uuid);
|
|
34968
|
+
return instance ? freshSnapshot(instance) : void 0;
|
|
34969
|
+
},
|
|
34970
|
+
historyFor: (uuid) => {
|
|
34971
|
+
const instance = instances2.find((i) => i.uuid === uuid);
|
|
34972
|
+
return instance ? freshEntry(instance)?.history : void 0;
|
|
34973
|
+
},
|
|
35136
34974
|
loadSnapshot
|
|
35137
34975
|
};
|
|
35138
34976
|
}
|
|
@@ -35277,12 +35115,88 @@ function CreateWizard({ busy, onSubmit, onCancel }) {
|
|
|
35277
35115
|
] });
|
|
35278
35116
|
}
|
|
35279
35117
|
|
|
35280
|
-
// src/tui/components/
|
|
35118
|
+
// src/tui/components/meters.tsx
|
|
35281
35119
|
var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
|
|
35120
|
+
var FILLED = "\u2588";
|
|
35121
|
+
var EMPTY = "\u2591";
|
|
35122
|
+
var RAMP = "\u2581\u2582\u2583\u2584\u2585\u2586\u2587\u2588";
|
|
35123
|
+
var clampPercent = (value) => Math.max(0, Math.min(100, value));
|
|
35124
|
+
function bar(percent, width) {
|
|
35125
|
+
const clamped = clampPercent(percent);
|
|
35126
|
+
const filled = clamped > 0 ? Math.max(1, Math.round(clamped / 100 * width)) : 0;
|
|
35127
|
+
const shown = Math.min(width, filled);
|
|
35128
|
+
return FILLED.repeat(shown) + EMPTY.repeat(width - shown);
|
|
35129
|
+
}
|
|
35130
|
+
function sparkline(values, width) {
|
|
35131
|
+
const recent = values.slice(-width);
|
|
35132
|
+
const drawn = recent.map((value) => {
|
|
35133
|
+
const rung = Math.floor(clampPercent(value) / 100 * (RAMP.length - 1) + 0.5);
|
|
35134
|
+
return RAMP[rung] ?? RAMP[0];
|
|
35135
|
+
}).join("");
|
|
35136
|
+
return " ".repeat(Math.max(0, width - recent.length)) + drawn;
|
|
35137
|
+
}
|
|
35138
|
+
var LABEL_WIDTH = 6;
|
|
35139
|
+
var READING_WIDTH = 7;
|
|
35140
|
+
function Gauge({ label, percent, detail, width, color }) {
|
|
35141
|
+
const head = `${label}${" ".repeat(Math.max(0, LABEL_WIDTH - stringWidth(label)))} `;
|
|
35142
|
+
const reading = percent === null ? "\u2014" : `${percent.toFixed(1)}%`;
|
|
35143
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { children: [
|
|
35144
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { dimColor: true, children: head }),
|
|
35145
|
+
percent === null ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { dimColor: true, children: "".padEnd(width, "\xB7") }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color, children: bar(percent, width) }),
|
|
35146
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { children: reading.padStart(READING_WIDTH) }),
|
|
35147
|
+
detail ? (
|
|
35148
|
+
// Truncated rather than wrapped: a size that does not fit should lose its tail,
|
|
35149
|
+
// not push the next gauge onto a second line and buckle the panel.
|
|
35150
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { dimColor: true, wrap: "truncate", children: ` ${detail}` })
|
|
35151
|
+
) : null
|
|
35152
|
+
] });
|
|
35153
|
+
}
|
|
35154
|
+
function Sparkline({ values, width, color }) {
|
|
35155
|
+
if (values.length === 0) {
|
|
35156
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { dimColor: true, children: "\u91C7\u6837\u4E2D\u2026".padEnd(width) });
|
|
35157
|
+
}
|
|
35158
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color, children: sparkline(values, width) });
|
|
35159
|
+
}
|
|
35160
|
+
|
|
35161
|
+
// src/tui/components/panel.tsx
|
|
35162
|
+
var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1);
|
|
35163
|
+
function Panel({
|
|
35164
|
+
title,
|
|
35165
|
+
note,
|
|
35166
|
+
accent,
|
|
35167
|
+
flexGrow,
|
|
35168
|
+
flexBasis,
|
|
35169
|
+
minHeight,
|
|
35170
|
+
children
|
|
35171
|
+
}) {
|
|
35172
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
35173
|
+
Box_default,
|
|
35174
|
+
{
|
|
35175
|
+
flexDirection: "column",
|
|
35176
|
+
borderStyle: "round",
|
|
35177
|
+
borderColor: accent,
|
|
35178
|
+
paddingX: 1,
|
|
35179
|
+
flexGrow,
|
|
35180
|
+
flexBasis,
|
|
35181
|
+
minHeight,
|
|
35182
|
+
children: [
|
|
35183
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { position: "absolute", marginLeft: 1, marginTop: -1, children: [
|
|
35184
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { bold: true, color: accent, children: ` ${title} ` }),
|
|
35185
|
+
note ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { dimColor: true, children: `${note} ` }) : null
|
|
35186
|
+
] }),
|
|
35187
|
+
children
|
|
35188
|
+
]
|
|
35189
|
+
}
|
|
35190
|
+
);
|
|
35191
|
+
}
|
|
35192
|
+
|
|
35193
|
+
// src/tui/components/table.tsx
|
|
35194
|
+
var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1);
|
|
35282
35195
|
function pad(value, width) {
|
|
35283
35196
|
const spare = width - stringWidth(value);
|
|
35284
35197
|
return spare > 0 ? " ".repeat(spare) : "";
|
|
35285
35198
|
}
|
|
35199
|
+
var CURSOR = { marker: "\u203A", blank: " " };
|
|
35286
35200
|
function clip(value, width) {
|
|
35287
35201
|
if (stringWidth(value) <= width) return value;
|
|
35288
35202
|
let out = "";
|
|
@@ -35292,41 +35206,63 @@ function clip(value, width) {
|
|
|
35292
35206
|
}
|
|
35293
35207
|
return `${out}\u2026`;
|
|
35294
35208
|
}
|
|
35209
|
+
var contentWidth = (columns2) => 1 + columns2.reduce((sum, column) => sum + column.width + 1, 0);
|
|
35210
|
+
var HEADER_RULE = "\u2500";
|
|
35211
|
+
var ROW_RULE = "\u2508";
|
|
35212
|
+
function Rule({ width, char }) {
|
|
35213
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Box_default, { paddingX: 1, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Text, { dimColor: true, children: char.repeat(width) }) });
|
|
35214
|
+
}
|
|
35295
35215
|
function Table({
|
|
35296
|
-
columns:
|
|
35216
|
+
columns: columns2,
|
|
35297
35217
|
rows,
|
|
35298
35218
|
selectedIndex,
|
|
35299
35219
|
keyFor,
|
|
35300
|
-
emptyMessage
|
|
35220
|
+
emptyMessage,
|
|
35221
|
+
maxRows,
|
|
35222
|
+
rules = false
|
|
35301
35223
|
}) {
|
|
35302
35224
|
if (rows.length === 0) {
|
|
35303
|
-
return /* @__PURE__ */ (0,
|
|
35304
|
-
}
|
|
35305
|
-
|
|
35306
|
-
|
|
35307
|
-
|
|
35308
|
-
|
|
35309
|
-
|
|
35310
|
-
|
|
35311
|
-
|
|
35225
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Box_default, { paddingX: 1, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Text, { dimColor: true, children: emptyMessage }) });
|
|
35226
|
+
}
|
|
35227
|
+
const visible = maxRows && maxRows > 0 ? Math.min(maxRows, rows.length) : rows.length;
|
|
35228
|
+
const start = Math.max(
|
|
35229
|
+
0,
|
|
35230
|
+
Math.min(selectedIndex - Math.floor((visible - 1) / 2), rows.length - visible)
|
|
35231
|
+
);
|
|
35232
|
+
const window2 = rows.slice(start, start + visible);
|
|
35233
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
35234
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Box_default, { paddingX: 1, children: [
|
|
35235
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Text, { children: CURSOR.blank }),
|
|
35236
|
+
columns2.map((column) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Text, { bold: true, children: [
|
|
35237
|
+
clip(column.header, column.width),
|
|
35238
|
+
pad(clip(column.header, column.width), column.width),
|
|
35239
|
+
" "
|
|
35240
|
+
] }, column.header))
|
|
35241
|
+
] }),
|
|
35242
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Rule, { width: contentWidth(columns2), char: HEADER_RULE }),
|
|
35243
|
+
window2.map((row, offset) => {
|
|
35244
|
+
const index = start + offset;
|
|
35312
35245
|
const selected = index === selectedIndex;
|
|
35313
|
-
return /* @__PURE__ */ (0,
|
|
35314
|
-
/* @__PURE__ */ (0,
|
|
35315
|
-
|
|
35316
|
-
|
|
35317
|
-
|
|
35318
|
-
|
|
35319
|
-
|
|
35320
|
-
|
|
35321
|
-
|
|
35322
|
-
|
|
35246
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
35247
|
+
rules && offset > 0 ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Rule, { width: contentWidth(columns2), char: ROW_RULE }) : null,
|
|
35248
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Box_default, { paddingX: 1, children: [
|
|
35249
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Text, { inverse: selected, children: selected ? CURSOR.marker : CURSOR.blank }),
|
|
35250
|
+
columns2.map((column) => {
|
|
35251
|
+
const clipped = clip(column.text(row), column.width);
|
|
35252
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Text, { inverse: selected, children: [
|
|
35253
|
+
column.render ? column.render(row, clipped) : clipped,
|
|
35254
|
+
pad(clipped, column.width),
|
|
35255
|
+
" "
|
|
35256
|
+
] }, column.header);
|
|
35257
|
+
})
|
|
35258
|
+
] })
|
|
35323
35259
|
] }, keyFor(row));
|
|
35324
35260
|
})
|
|
35325
35261
|
] });
|
|
35326
35262
|
}
|
|
35327
35263
|
|
|
35328
35264
|
// src/tui/screens/dashboard.tsx
|
|
35329
|
-
var
|
|
35265
|
+
var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1);
|
|
35330
35266
|
function statusColor(status) {
|
|
35331
35267
|
if (status === "running") return "green";
|
|
35332
35268
|
if (status === "starting" || status === "creating") return "cyan";
|
|
@@ -35343,7 +35279,7 @@ function costText(row) {
|
|
|
35343
35279
|
if (row.estimatedCostYuan === null) return "\u2026";
|
|
35344
35280
|
return `\u2248${formatYuan(row.estimatedCostYuan)}`;
|
|
35345
35281
|
}
|
|
35346
|
-
var
|
|
35282
|
+
var ALL_COLUMNS = [
|
|
35347
35283
|
{
|
|
35348
35284
|
header: "\u5B9E\u4F8B",
|
|
35349
35285
|
width: 20,
|
|
@@ -35353,7 +35289,7 @@ var columns = [
|
|
|
35353
35289
|
header: "\u72B6\u6001",
|
|
35354
35290
|
width: 12,
|
|
35355
35291
|
text: (row) => row.instance.status,
|
|
35356
|
-
render: (row, clipped) => /* @__PURE__ */ (0,
|
|
35292
|
+
render: (row, clipped) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { color: statusColor(row.instance.status), children: clipped })
|
|
35357
35293
|
},
|
|
35358
35294
|
{
|
|
35359
35295
|
header: "GPU",
|
|
@@ -35374,79 +35310,250 @@ var columns = [
|
|
|
35374
35310
|
header: "\u4F30\u7B97\u8D39\u7528",
|
|
35375
35311
|
width: 10,
|
|
35376
35312
|
text: costText,
|
|
35377
|
-
render: (row, clipped) => /* @__PURE__ */ (0,
|
|
35313
|
+
render: (row, clipped) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { color: row.instance.status === "running" ? "yellow" : void 0, children: clipped })
|
|
35378
35314
|
},
|
|
35379
35315
|
{
|
|
35380
35316
|
header: "TTL",
|
|
35381
35317
|
width: 8,
|
|
35382
35318
|
text: ttlText,
|
|
35383
35319
|
// Red once overdue: that is money leaking right now.
|
|
35384
|
-
render: (row, clipped) => row.ttlRemainingMs !== null && row.ttlRemainingMs <= 0 ? /* @__PURE__ */ (0,
|
|
35320
|
+
render: (row, clipped) => row.ttlRemainingMs !== null && row.ttlRemainingMs <= 0 ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { color: "red", children: clipped }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { children: clipped })
|
|
35385
35321
|
}
|
|
35386
35322
|
];
|
|
35387
|
-
|
|
35388
|
-
|
|
35389
|
-
|
|
35390
|
-
|
|
35323
|
+
var OPTIONAL_COLUMNS = ["\u5730\u533A", "GPU", "\u5DF2\u5F00\u673A"];
|
|
35324
|
+
var rowWidth = (columns2) => 3 + columns2.length + columns2.reduce((sum, column) => sum + column.width, 0);
|
|
35325
|
+
function columnsFor(width) {
|
|
35326
|
+
let columns2 = ALL_COLUMNS;
|
|
35327
|
+
for (const header of OPTIONAL_COLUMNS) {
|
|
35328
|
+
if (rowWidth(columns2) <= width) break;
|
|
35329
|
+
columns2 = columns2.filter((column) => column.header !== header);
|
|
35330
|
+
}
|
|
35331
|
+
return columns2;
|
|
35332
|
+
}
|
|
35333
|
+
var STATUS_ROWS = 4;
|
|
35334
|
+
var PANEL_CHROME = 4;
|
|
35335
|
+
var METRIC_ROWS = 6;
|
|
35336
|
+
var PANEL_PADDING = 4;
|
|
35337
|
+
var SPARK_GAP = 2;
|
|
35338
|
+
var NOTE_WIDTH = 24;
|
|
35339
|
+
var MIN_HEIGHT_FOR_METRICS = 22;
|
|
35340
|
+
var MIN_WIDTH_FOR_COLUMNS = 88;
|
|
35341
|
+
var percentOf = (used, total) => used === null || total === null || total <= 0 ? null : used / total * 100;
|
|
35342
|
+
var sizeOf = (used, total) => used === null || total === null || total <= 0 ? void 0 : `${formatBytes(used)} / ${formatBytes(total)}`;
|
|
35343
|
+
function runwayText(balance, ratePerHour) {
|
|
35344
|
+
if (ratePerHour <= 0) return "\u5F53\u524D\u4E0D\u4EA7\u751F\u8D39\u7528";
|
|
35345
|
+
if (!balance) return "\u4F59\u989D\u52A0\u8F7D\u4E2D\u2026";
|
|
35346
|
+
if (balance.balanceYuan <= 0) return "\u4F59\u989D\u5DF2\u8017\u5C3D";
|
|
35347
|
+
return `\u6309 ${formatRate(ratePerHour)} \u7EA6 ${formatDuration(
|
|
35348
|
+
Math.round(balance.balanceYuan / ratePerHour * 3600)
|
|
35349
|
+
)}`;
|
|
35350
|
+
}
|
|
35351
|
+
function Resources({
|
|
35352
|
+
row,
|
|
35353
|
+
snapshot,
|
|
35354
|
+
history,
|
|
35355
|
+
barWidth,
|
|
35356
|
+
trailWidth
|
|
35357
|
+
}) {
|
|
35358
|
+
if (!row) return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { dimColor: true, children: "\u6CA1\u6709\u9009\u4E2D\u7684\u5B9E\u4F8B\u3002" });
|
|
35359
|
+
if (row.instance.status !== "running") {
|
|
35360
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { dimColor: true, children: "\u5B9E\u4F8B\u672A\u8FD0\u884C\uFF0CAutoDL \u53EA\u5BF9\u8FD0\u884C\u4E2D\u7684\u5B9E\u4F8B\u66B4\u9732\u7528\u91CF\u3002" });
|
|
35361
|
+
}
|
|
35362
|
+
if (!snapshot) return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { dimColor: true, children: "\u6B63\u5728\u83B7\u53D6\u7528\u91CF\u2026" });
|
|
35363
|
+
const { usage, disk } = snapshot;
|
|
35364
|
+
const systemTotal = disk.systemInitBytes + disk.systemExpandBytes;
|
|
35365
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
35366
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Box_default, { children: [
|
|
35367
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Gauge, { label: "CPU", percent: usage.cpuPercent, width: barWidth, color: "cyan" }),
|
|
35368
|
+
trailWidth >= 8 ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Box_default, { marginLeft: 2, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Sparkline, { values: history?.cpu ?? [], width: trailWidth, color: "cyan" }) }) : null
|
|
35369
|
+
] }),
|
|
35370
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
35371
|
+
Gauge,
|
|
35391
35372
|
{
|
|
35392
|
-
|
|
35393
|
-
|
|
35394
|
-
|
|
35395
|
-
|
|
35396
|
-
|
|
35373
|
+
label: "\u5185\u5B58",
|
|
35374
|
+
percent: usage.memPercent ?? percentOf(usage.memUsedBytes, usage.memLimitBytes),
|
|
35375
|
+
detail: sizeOf(usage.memUsedBytes, usage.memLimitBytes),
|
|
35376
|
+
width: barWidth,
|
|
35377
|
+
color: "magenta"
|
|
35378
|
+
}
|
|
35379
|
+
),
|
|
35380
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
35381
|
+
Gauge,
|
|
35382
|
+
{
|
|
35383
|
+
label: "\u7CFB\u7EDF\u76D8",
|
|
35384
|
+
percent: percentOf(usage.rootFsUsedBytes, usage.rootFsTotalBytes ?? systemTotal),
|
|
35385
|
+
detail: sizeOf(usage.rootFsUsedBytes, usage.rootFsTotalBytes ?? systemTotal),
|
|
35386
|
+
width: barWidth,
|
|
35387
|
+
color: "blue"
|
|
35397
35388
|
}
|
|
35398
35389
|
),
|
|
35399
|
-
|
|
35390
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
35391
|
+
Gauge,
|
|
35392
|
+
{
|
|
35393
|
+
label: "\u6570\u636E\u76D8",
|
|
35394
|
+
percent: percentOf(usage.dataDiskUsedBytes, usage.dataDiskTotalBytes),
|
|
35395
|
+
detail: sizeOf(usage.dataDiskUsedBytes, usage.dataDiskTotalBytes) ?? "\u672A\u6302\u8F7D",
|
|
35396
|
+
width: barWidth,
|
|
35397
|
+
color: "blue"
|
|
35398
|
+
}
|
|
35399
|
+
)
|
|
35400
|
+
] });
|
|
35401
|
+
}
|
|
35402
|
+
function Billing({
|
|
35403
|
+
row,
|
|
35404
|
+
rows,
|
|
35405
|
+
balance
|
|
35406
|
+
}) {
|
|
35407
|
+
const running = rows.filter((entry) => entry.instance.status === "running");
|
|
35408
|
+
const fleetRate = running.reduce((sum, entry) => sum + (entry.priceYuanPerHour ?? 0), 0);
|
|
35409
|
+
const own = !row ? "\u2014" : row.instance.status !== "running" ? "\u672A\u8FD0\u884C\uFF0C\u4E0D\u8BA1\u8D39" : row.priceYuanPerHour === null ? "\u5355\u4EF7\u83B7\u53D6\u4E2D\u2026" : `${formatRate(row.priceYuanPerHour)}\u3000\u672C\u6B21\u5DF2\u4EA7\u751F ${formatYuan(row.estimatedCostYuan ?? 0)}`;
|
|
35410
|
+
const ttl = !row ? "\u2014" : row.ttlRemainingMs === null ? "\u672A\u8BBE\u7F6E\uFF0C\u4E0D\u4F1A\u81EA\u52A8\u5173\u673A" : row.ttlRemainingMs <= 0 ? "\u5DF2\u8D85\u65F6\uFF0C\u4ECD\u5728\u8BA1\u8D39" : `${formatDuration(Math.round(row.ttlRemainingMs / 1e3))} \u540E\u81EA\u52A8\u5173\u673A`;
|
|
35411
|
+
const ttlColor = row && (row.ttlRemainingMs === null || row.ttlRemainingMs <= 0) ? row.instance.status === "running" ? "red" : "yellow" : void 0;
|
|
35412
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
35413
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Box_default, { children: [
|
|
35414
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { dimColor: true, children: "\u672C\u673A " }),
|
|
35415
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { children: own })
|
|
35416
|
+
] }),
|
|
35417
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Box_default, { children: [
|
|
35418
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { dimColor: true, children: "TTL " }),
|
|
35419
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { color: ttlColor, children: ttl })
|
|
35420
|
+
] }),
|
|
35421
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Box_default, { children: [
|
|
35422
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { dimColor: true, children: "\u4F59\u989D " }),
|
|
35423
|
+
balance ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { color: "green", children: formatYuan(balance.balanceYuan) }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { dimColor: true, children: "\u52A0\u8F7D\u4E2D\u2026" })
|
|
35424
|
+
] }),
|
|
35425
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Box_default, { children: [
|
|
35426
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { dimColor: true, children: "\u7EED\u822A " }),
|
|
35427
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { children: runwayText(balance, fleetRate) })
|
|
35428
|
+
] })
|
|
35429
|
+
] });
|
|
35430
|
+
}
|
|
35431
|
+
function Dashboard({
|
|
35432
|
+
rows,
|
|
35433
|
+
selectedIndex,
|
|
35434
|
+
loading,
|
|
35435
|
+
snapshot,
|
|
35436
|
+
history,
|
|
35437
|
+
balance = null,
|
|
35438
|
+
width = 100,
|
|
35439
|
+
height = 30
|
|
35440
|
+
}) {
|
|
35441
|
+
const row = rows[selectedIndex];
|
|
35442
|
+
const showMetrics = height >= MIN_HEIGHT_FOR_METRICS;
|
|
35443
|
+
const sideBySide = width >= MIN_WIDTH_FOR_COLUMNS;
|
|
35444
|
+
const metricRows = showMetrics ? sideBySide ? METRIC_ROWS : METRIC_ROWS * 2 : 0;
|
|
35445
|
+
const estimateNote = rows.some(
|
|
35446
|
+
(entry) => entry.instance.status === "running" && entry.estimatedCostYuan === null
|
|
35447
|
+
);
|
|
35448
|
+
const rowBudget = Math.max(
|
|
35449
|
+
1,
|
|
35450
|
+
height - headerRows(width) - STATUS_ROWS - metricRows - PANEL_CHROME - (estimateNote ? 1 : 0)
|
|
35451
|
+
);
|
|
35452
|
+
const rules = rows.length > 1 && rows.length * 2 - 1 <= rowBudget;
|
|
35453
|
+
const maxRows = rules ? rows.length : rowBudget;
|
|
35454
|
+
const panelInner = (sideBySide ? Math.floor((width - 1) / 2) : width) - PANEL_PADDING;
|
|
35455
|
+
const budget = panelInner - 1;
|
|
35456
|
+
const fixed = LABEL_WIDTH + READING_WIDTH;
|
|
35457
|
+
const barWidth = Math.max(6, Math.min(18, budget - fixed - 18));
|
|
35458
|
+
const trailWidth = Math.max(0, Math.min(16, budget - fixed - barWidth - SPARK_GAP));
|
|
35459
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Box_default, { flexDirection: "column", flexGrow: 1, children: [
|
|
35460
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
35461
|
+
Panel,
|
|
35462
|
+
{
|
|
35463
|
+
title: "\u5B9E\u4F8B",
|
|
35464
|
+
note: rows.length > 0 ? `${Math.min(selectedIndex + 1, rows.length)}/${rows.length}` : "",
|
|
35465
|
+
accent: "cyan",
|
|
35466
|
+
flexGrow: 1,
|
|
35467
|
+
children: [
|
|
35468
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
35469
|
+
Table,
|
|
35470
|
+
{
|
|
35471
|
+
columns: columnsFor(width),
|
|
35472
|
+
rows,
|
|
35473
|
+
selectedIndex,
|
|
35474
|
+
keyFor: (entry) => entry.instance.uuid,
|
|
35475
|
+
emptyMessage: loading ? "\u6B63\u5728\u52A0\u8F7D\u5B9E\u4F8B\u2026" : "\u5F53\u524D\u8D26\u53F7\u4E0B\u6CA1\u6709\u5B9E\u4F8B\u3002\u6309 n \u65B0\u5EFA\u4E00\u53F0\u3002",
|
|
35476
|
+
maxRows,
|
|
35477
|
+
rules
|
|
35478
|
+
}
|
|
35479
|
+
),
|
|
35480
|
+
estimateNote ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Box_default, { paddingX: 1, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { dimColor: true, children: "\u8D39\u7528\u4E3A\u4F30\u7B97\u503C\uFF1AAutoDL \u6309\u79D2\u8BA1\u8D39\u4E14\u6709 \xA50.01 \u4E0B\u9650\uFF0C\u5355\u4EF7\u9700\u9009\u4E2D\u8FD0\u884C\u4E2D\u7684\u5B9E\u4F8B\u540E\u624D\u4F1A\u62C9\u53D6\u3002" }) }) : null
|
|
35481
|
+
]
|
|
35482
|
+
}
|
|
35483
|
+
),
|
|
35484
|
+
showMetrics ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Box_default, { flexDirection: sideBySide ? "row" : "column", gap: sideBySide ? 1 : 0, children: [
|
|
35485
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
35486
|
+
Panel,
|
|
35487
|
+
{
|
|
35488
|
+
title: "\u8D44\u6E90",
|
|
35489
|
+
note: row ? clip(row.instance.name || row.instance.uuid, NOTE_WIDTH) : "",
|
|
35490
|
+
flexGrow: 1,
|
|
35491
|
+
flexBasis: 0,
|
|
35492
|
+
minHeight: METRIC_ROWS,
|
|
35493
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
35494
|
+
Resources,
|
|
35495
|
+
{
|
|
35496
|
+
row,
|
|
35497
|
+
snapshot,
|
|
35498
|
+
history,
|
|
35499
|
+
barWidth,
|
|
35500
|
+
trailWidth
|
|
35501
|
+
}
|
|
35502
|
+
)
|
|
35503
|
+
}
|
|
35504
|
+
),
|
|
35505
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Panel, { title: "\u8BA1\u8D39", flexGrow: 1, flexBasis: 0, minHeight: METRIC_ROWS, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Billing, { row, rows, balance }) })
|
|
35506
|
+
] }) : null
|
|
35400
35507
|
] });
|
|
35401
35508
|
}
|
|
35402
35509
|
|
|
35403
35510
|
// src/tui/screens/detail.tsx
|
|
35404
|
-
var
|
|
35511
|
+
var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
|
|
35405
35512
|
function Field({ label, value }) {
|
|
35406
|
-
return /* @__PURE__ */ (0,
|
|
35407
|
-
/* @__PURE__ */ (0,
|
|
35408
|
-
/* @__PURE__ */ (0,
|
|
35513
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Box_default, { children: [
|
|
35514
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Box_default, { width: 12, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text, { dimColor: true, children: label }) }),
|
|
35515
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text, { children: value })
|
|
35409
35516
|
] });
|
|
35410
35517
|
}
|
|
35411
35518
|
function Detail({ row, snapshot, revealSecrets }) {
|
|
35412
35519
|
const { instance } = row;
|
|
35413
|
-
return /* @__PURE__ */ (0,
|
|
35414
|
-
/* @__PURE__ */ (0,
|
|
35415
|
-
/* @__PURE__ */ (0,
|
|
35416
|
-
/* @__PURE__ */ (0,
|
|
35417
|
-
/* @__PURE__ */ (0,
|
|
35418
|
-
/* @__PURE__ */ (0,
|
|
35419
|
-
/* @__PURE__ */ (0,
|
|
35420
|
-
/* @__PURE__ */ (0,
|
|
35421
|
-
/* @__PURE__ */ (0,
|
|
35422
|
-
row.uptimeSeconds !== null ? /* @__PURE__ */ (0,
|
|
35423
|
-
instance.status !== "running" ? /* @__PURE__ */ (0,
|
|
35424
|
-
/* @__PURE__ */ (0,
|
|
35520
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", paddingX: 1, children: [
|
|
35521
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text, { bold: true, children: instance.name || instance.uuid }),
|
|
35522
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Field, { label: "\u5B9E\u4F8B ID", value: instance.uuid }),
|
|
35523
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Field, { label: "\u72B6\u6001", value: instance.status }),
|
|
35524
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Field, { label: "GPU", value: `${instance.gpuSpec ?? "-"} \xD7${instance.gpuNum}` }),
|
|
35525
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Field, { label: "\u5730\u533A", value: instance.regionName ?? instance.regionSign ?? "-" }),
|
|
35526
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Field, { label: "\u8BA1\u8D39", value: instance.chargeType ?? "-" }),
|
|
35527
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Field, { label: "\u521B\u5EFA", value: formatTime(instance.createdAt) }),
|
|
35528
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Field, { label: "\u5F00\u673A", value: formatTime(instance.startedAt) }),
|
|
35529
|
+
row.uptimeSeconds !== null ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Field, { label: "\u5DF2\u5F00\u673A", value: formatDuration(row.uptimeSeconds) }) : null,
|
|
35530
|
+
instance.status !== "running" ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text, { dimColor: true, children: "\u5B9E\u4F8B\u672A\u8FD0\u884C\uFF0CSSH \u4FE1\u606F\u4E0E\u5355\u4EF7\u9700\u5F00\u673A\u540E\u624D\u80FD\u83B7\u53D6\u3002" }) }) : !snapshot ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text, { dimColor: true, children: "\u6B63\u5728\u83B7\u53D6 SSH \u4FE1\u606F\u2026" }) }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
|
|
35531
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
35425
35532
|
Field,
|
|
35426
35533
|
{
|
|
35427
35534
|
label: "\u5355\u4EF7",
|
|
35428
35535
|
value: snapshot.priceYuanPerHour ? formatRate(snapshot.priceYuanPerHour) : "-"
|
|
35429
35536
|
}
|
|
35430
35537
|
),
|
|
35431
|
-
/* @__PURE__ */ (0,
|
|
35432
|
-
/* @__PURE__ */ (0,
|
|
35538
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Field, { label: "SSH", value: snapshot.ssh.command ?? "-" }),
|
|
35539
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
35433
35540
|
Field,
|
|
35434
35541
|
{
|
|
35435
35542
|
label: "\u5BC6\u7801",
|
|
35436
|
-
value: revealSecrets ? snapshot.ssh.password ?? "-" : /* @__PURE__ */ (0,
|
|
35543
|
+
value: revealSecrets ? snapshot.ssh.password ?? "-" : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text, { dimColor: true, children: "*** \uFF08\u6309 p \u663E\u793A\uFF09" })
|
|
35437
35544
|
}
|
|
35438
35545
|
),
|
|
35439
|
-
snapshot.usage.cpuPercent !== null ? /* @__PURE__ */ (0,
|
|
35440
|
-
snapshot.usage.memUsedBytes !== null ? /* @__PURE__ */ (0,
|
|
35546
|
+
snapshot.usage.cpuPercent !== null ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Field, { label: "CPU", value: `${snapshot.usage.cpuPercent.toFixed(1)}%` }) : null,
|
|
35547
|
+
snapshot.usage.memUsedBytes !== null ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
35441
35548
|
Field,
|
|
35442
35549
|
{
|
|
35443
35550
|
label: "\u5185\u5B58",
|
|
35444
35551
|
value: `${formatBytes(snapshot.usage.memUsedBytes)} / ${formatBytes(snapshot.usage.memLimitBytes)}`
|
|
35445
35552
|
}
|
|
35446
35553
|
) : null,
|
|
35447
|
-
snapshot.services.length > 0 ? /* @__PURE__ */ (0,
|
|
35448
|
-
/* @__PURE__ */ (0,
|
|
35449
|
-
snapshot.services.map((service) => /* @__PURE__ */ (0,
|
|
35554
|
+
snapshot.services.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
|
|
35555
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text, { dimColor: true, children: "\u81EA\u5B9A\u4E49\u670D\u52A1" }),
|
|
35556
|
+
snapshot.services.map((service) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Text, { children: [
|
|
35450
35557
|
" ",
|
|
35451
35558
|
service.port,
|
|
35452
35559
|
" \u2192 ",
|
|
@@ -35458,7 +35565,7 @@ function Detail({ row, snapshot, revealSecrets }) {
|
|
|
35458
35565
|
}
|
|
35459
35566
|
|
|
35460
35567
|
// src/tui/screens/expired.tsx
|
|
35461
|
-
var
|
|
35568
|
+
var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
|
|
35462
35569
|
function SessionExpired({
|
|
35463
35570
|
message,
|
|
35464
35571
|
onRelogin,
|
|
@@ -35468,12 +35575,12 @@ function SessionExpired({
|
|
|
35468
35575
|
if (key.return) return onRelogin();
|
|
35469
35576
|
if (input === "q" || key.escape) return onQuit();
|
|
35470
35577
|
});
|
|
35471
|
-
return /* @__PURE__ */ (0,
|
|
35472
|
-
/* @__PURE__ */ (0,
|
|
35473
|
-
/* @__PURE__ */ (0,
|
|
35474
|
-
/* @__PURE__ */ (0,
|
|
35475
|
-
/* @__PURE__ */ (0,
|
|
35476
|
-
/* @__PURE__ */ (0,
|
|
35578
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "red", paddingX: 1, children: [
|
|
35579
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Text, { bold: true, color: "red", children: "\u767B\u5F55\u72B6\u6001\u5DF2\u5931\u6548" }),
|
|
35580
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Text, { children: message }),
|
|
35581
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Text, { dimColor: true, children: "Token \u53EF\u80FD\u5DF2\u8FC7\u671F\u3001\u88AB\u91CD\u7F6E\uFF0C\u6216\u8D26\u53F7\u5B9E\u540D\u72B6\u6001\u53D1\u751F\u4E86\u53D8\u5316\u3002" }),
|
|
35582
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Text, { dimColor: true, children: "\u5DF2\u6682\u505C\u5237\u65B0\uFF0C\u5B9E\u4F8B\u6570\u636E\u505C\u7559\u5728\u5931\u6548\u524D\u7684\u72B6\u6001\u3002" }),
|
|
35583
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Text, { children: "Enter \u91CD\u65B0\u767B\u5165 \xB7 q \u9000\u51FA" }) })
|
|
35477
35584
|
] });
|
|
35478
35585
|
}
|
|
35479
35586
|
|
|
@@ -35502,7 +35609,7 @@ function useTerminalSize() {
|
|
|
35502
35609
|
}
|
|
35503
35610
|
|
|
35504
35611
|
// src/tui/screens/login.tsx
|
|
35505
|
-
var
|
|
35612
|
+
var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
|
|
35506
35613
|
function sanitize(input) {
|
|
35507
35614
|
let out = "";
|
|
35508
35615
|
for (const char of input) {
|
|
@@ -35518,7 +35625,7 @@ function Login({
|
|
|
35518
35625
|
verifying,
|
|
35519
35626
|
notice
|
|
35520
35627
|
}) {
|
|
35521
|
-
const { columns:
|
|
35628
|
+
const { columns: columns2, rows } = useTerminalSize();
|
|
35522
35629
|
const [stage, setStage] = (0, import_react38.useState)("menu");
|
|
35523
35630
|
const [choice, setChoice] = (0, import_react38.useState)(0);
|
|
35524
35631
|
const [token, setToken] = (0, import_react38.useState)("");
|
|
@@ -35553,37 +35660,37 @@ function Login({
|
|
|
35553
35660
|
const clean = sanitize(input);
|
|
35554
35661
|
if (clean) setToken((v) => v + clean);
|
|
35555
35662
|
});
|
|
35556
|
-
return /* @__PURE__ */ (0,
|
|
35557
|
-
/* @__PURE__ */ (0,
|
|
35558
|
-
/* @__PURE__ */ (0,
|
|
35559
|
-
stage === "menu" ? /* @__PURE__ */ (0,
|
|
35560
|
-
notice ? /* @__PURE__ */ (0,
|
|
35561
|
-
/* @__PURE__ */ (0,
|
|
35562
|
-
/* @__PURE__ */ (0,
|
|
35663
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Box_default, { flexDirection: "column", height: rows, width: columns2, children: [
|
|
35664
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(BrandMark, { subtitle: "\u767B\u5165", columns: columns2 }),
|
|
35665
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 1, children: [
|
|
35666
|
+
stage === "menu" ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
|
|
35667
|
+
notice ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { color: "yellow", children: notice }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { dimColor: true, children: "\u5C1A\u672A\u914D\u7F6E\u5F00\u53D1\u8005 Token\uFF0C\u8BF7\u5148\u767B\u5165\u3002" }),
|
|
35668
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
|
|
35669
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Text, { inverse: choice === 0, children: [
|
|
35563
35670
|
choice === 0 ? "\u203A " : " ",
|
|
35564
35671
|
"\u914D\u7F6E Token \u767B\u5165"
|
|
35565
35672
|
] }),
|
|
35566
|
-
/* @__PURE__ */ (0,
|
|
35673
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Text, { inverse: choice === 1, children: [
|
|
35567
35674
|
choice === 1 ? "\u203A " : " ",
|
|
35568
35675
|
"\u9000\u51FA"
|
|
35569
35676
|
] })
|
|
35570
35677
|
] }),
|
|
35571
|
-
/* @__PURE__ */ (0,
|
|
35572
|
-
] }) : /* @__PURE__ */ (0,
|
|
35573
|
-
/* @__PURE__ */ (0,
|
|
35574
|
-
/* @__PURE__ */ (0,
|
|
35575
|
-
/* @__PURE__ */ (0,
|
|
35576
|
-
/* @__PURE__ */ (0,
|
|
35577
|
-
/* @__PURE__ */ (0,
|
|
35578
|
-
/* @__PURE__ */ (0,
|
|
35678
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { dimColor: true, children: "\u2191\u2193 \u9009\u62E9 \xB7 Enter \u786E\u5B9A \xB7 q \u9000\u51FA" }) })
|
|
35679
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
|
|
35680
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { dimColor: true, children: "\u7C98\u8D34\u4F60\u7684\u5F00\u53D1\u8005 Token\uFF1A" }),
|
|
35681
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { dimColor: true, children: "AutoDL \u63A7\u5236\u53F0 \u2192 \u8BBE\u7F6E \u2192 \u5F00\u53D1\u8005 Token\uFF08\u9700\u5148\u5B8C\u6210\u5B9E\u540D\u8BA4\u8BC1\uFF09" }),
|
|
35682
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Box_default, { marginTop: 1, children: [
|
|
35683
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { children: "\u203A " }),
|
|
35684
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { color: "green", children: token ? "\u2022".repeat(Math.min(token.length, 48)) : "" }),
|
|
35685
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { dimColor: true, children: token ? ` (${token.length} \u5B57\u7B26)` : "\u7B49\u5F85\u8F93\u5165\u2026" })
|
|
35579
35686
|
] }),
|
|
35580
|
-
/* @__PURE__ */ (0,
|
|
35687
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { dimColor: true, children: verifying ? "\u6B63\u5728\u9A8C\u8BC1\u2026" : "Enter \u9A8C\u8BC1\u5E76\u4FDD\u5B58 \xB7 Esc \u8FD4\u56DE \xB7 \u652F\u6301\u76F4\u63A5\u7C98\u8D34" }) })
|
|
35581
35688
|
] }),
|
|
35582
|
-
error ? /* @__PURE__ */ (0,
|
|
35689
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Text, { color: "red", children: [
|
|
35583
35690
|
"\u2716 ",
|
|
35584
35691
|
error
|
|
35585
35692
|
] }) }) : null,
|
|
35586
|
-
/* @__PURE__ */ (0,
|
|
35693
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Text, { dimColor: true, children: [
|
|
35587
35694
|
"\u9A8C\u8BC1\u901A\u8FC7\u540E\u4F1A\u4FDD\u5B58\u5230 ",
|
|
35588
35695
|
configPath(),
|
|
35589
35696
|
"\uFF08\u6743\u9650 0600\uFF09"
|
|
@@ -35593,7 +35700,7 @@ function Login({
|
|
|
35593
35700
|
}
|
|
35594
35701
|
|
|
35595
35702
|
// src/tui/screens/stock.tsx
|
|
35596
|
-
var
|
|
35703
|
+
var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
|
|
35597
35704
|
function toStockRows(snapshots, showEmpty) {
|
|
35598
35705
|
const rentable = new Map(GPU_SPECS.map((spec) => [spec.stockName, spec.id]));
|
|
35599
35706
|
const proRegions = new Set(PRO_CREATE_REGIONS.map((region) => region.id));
|
|
@@ -35609,7 +35716,7 @@ function toStockRows(snapshots, showEmpty) {
|
|
|
35609
35716
|
}))
|
|
35610
35717
|
).sort((a, b) => b.idle - a.idle);
|
|
35611
35718
|
}
|
|
35612
|
-
var
|
|
35719
|
+
var columns = [
|
|
35613
35720
|
{
|
|
35614
35721
|
header: "\u5730\u533A",
|
|
35615
35722
|
width: 12,
|
|
@@ -35619,7 +35726,7 @@ var columns2 = [
|
|
|
35619
35726
|
header: "\u53EF\u5EFAPro",
|
|
35620
35727
|
width: 8,
|
|
35621
35728
|
text: (row) => row.proCreate ? "\u662F" : "\u5426",
|
|
35622
|
-
render: (row) => row.proCreate ? /* @__PURE__ */ (0,
|
|
35729
|
+
render: (row) => row.proCreate ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text, { color: "green", children: "\u662F" }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text, { dimColor: true, children: "\u5426" })
|
|
35623
35730
|
},
|
|
35624
35731
|
{
|
|
35625
35732
|
header: "GPU",
|
|
@@ -35630,19 +35737,19 @@ var columns2 = [
|
|
|
35630
35737
|
header: "\u53EF\u79DF\u89C4\u683C",
|
|
35631
35738
|
width: 12,
|
|
35632
35739
|
text: (row) => row.gpuSpec ?? "\u2014",
|
|
35633
|
-
render: (row, clipped) => row.gpuSpec ? /* @__PURE__ */ (0,
|
|
35740
|
+
render: (row, clipped) => row.gpuSpec ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text, { color: "green", children: clipped }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text, { dimColor: true, children: clipped })
|
|
35634
35741
|
},
|
|
35635
35742
|
{
|
|
35636
35743
|
header: "\u7A7A\u95F2",
|
|
35637
35744
|
width: 7,
|
|
35638
35745
|
text: (row) => String(row.idle),
|
|
35639
|
-
render: (row, clipped) => /* @__PURE__ */ (0,
|
|
35746
|
+
render: (row, clipped) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text, { bold: row.idle > 0, children: clipped })
|
|
35640
35747
|
},
|
|
35641
35748
|
{
|
|
35642
35749
|
header: "\u603B\u6570",
|
|
35643
35750
|
width: 7,
|
|
35644
35751
|
text: (row) => String(row.total),
|
|
35645
|
-
render: (_row, clipped) => /* @__PURE__ */ (0,
|
|
35752
|
+
render: (_row, clipped) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text, { dimColor: true, children: clipped })
|
|
35646
35753
|
}
|
|
35647
35754
|
];
|
|
35648
35755
|
function StockScreen({
|
|
@@ -35650,30 +35757,30 @@ function StockScreen({
|
|
|
35650
35757
|
selectedIndex,
|
|
35651
35758
|
loading
|
|
35652
35759
|
}) {
|
|
35653
|
-
return /* @__PURE__ */ (0,
|
|
35654
|
-
/* @__PURE__ */ (0,
|
|
35760
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
35761
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
35655
35762
|
Table,
|
|
35656
35763
|
{
|
|
35657
|
-
columns
|
|
35764
|
+
columns,
|
|
35658
35765
|
rows,
|
|
35659
35766
|
selectedIndex,
|
|
35660
35767
|
keyFor: (row) => `${row.regionId}:${row.gpuName}`,
|
|
35661
35768
|
emptyMessage: loading ? "\u6B63\u5728\u67E5\u8BE2\u5E93\u5B58\u2026" : "\u67E5\u8BE2\u8303\u56F4\u5185\u6CA1\u6709\u7A7A\u95F2 GPU"
|
|
35662
35769
|
}
|
|
35663
35770
|
),
|
|
35664
|
-
/* @__PURE__ */ (0,
|
|
35665
|
-
/* @__PURE__ */ (0,
|
|
35771
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Box_default, { flexDirection: "column", paddingX: 1, marginTop: 1, children: [
|
|
35772
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Text, { dimColor: true, children: [
|
|
35666
35773
|
"\u300C\u53EF\u5EFAPro\u300D\u53EA\u6709 ",
|
|
35667
35774
|
PRO_CREATE_REGIONS.map((r) => r.displayName).join(" / "),
|
|
35668
35775
|
" \u4E3A\u662F\uFF0C \u5176\u4F59\u5730\u533A\u4EC5\u7528\u4E8E\u5F39\u6027\u90E8\u7F72\u3002"
|
|
35669
35776
|
] }),
|
|
35670
|
-
/* @__PURE__ */ (0,
|
|
35777
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text, { color: "yellow", children: "\u6570\u5B57\u6765\u81EA\u300C\u5F39\u6027\u90E8\u7F72 GPU \u5E93\u5B58\u300D\uFF0C\u4E0D\u4EE3\u8868 Pro \u5B9E\u4F8B\u53EF\u7528\u91CF\u2014\u2014\u5B9E\u6D4B\u51FA\u73B0\u8FC7\u663E\u793A 140 \u5F20\u7A7A\u95F2\u3001\u521B\u5EFA\u5374\u63D0\u793A\u6682\u65E0\u5E93\u5B58\u7684\u60C5\u51B5\u3002" })
|
|
35671
35778
|
] })
|
|
35672
35779
|
] });
|
|
35673
35780
|
}
|
|
35674
35781
|
|
|
35675
35782
|
// src/tui/app.tsx
|
|
35676
|
-
var
|
|
35783
|
+
var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1);
|
|
35677
35784
|
var SCREEN_TITLES = {
|
|
35678
35785
|
dashboard: "\u5B9E\u4F8B\u770B\u677F",
|
|
35679
35786
|
detail: "\u5B9E\u4F8B\u8BE6\u60C5",
|
|
@@ -35706,22 +35813,38 @@ function App2({
|
|
|
35706
35813
|
const [balance, setBalance] = (0, import_react39.useState)(null);
|
|
35707
35814
|
const [balanceError, setBalanceError] = (0, import_react39.useState)(null);
|
|
35708
35815
|
const [expired, setExpired] = (0, import_react39.useState)(null);
|
|
35709
|
-
const
|
|
35816
|
+
const [watched, setWatched] = (0, import_react39.useState)(void 0);
|
|
35817
|
+
const { columns: columns2, rows: terminalRows } = useTerminalSize();
|
|
35710
35818
|
const identity = (0, import_react39.useMemo)(() => identityFromToken(token), [token]);
|
|
35711
35819
|
const paused = view === "create" || pending !== null || expired !== null;
|
|
35712
|
-
const {
|
|
35820
|
+
const {
|
|
35821
|
+
rows,
|
|
35822
|
+
loading,
|
|
35823
|
+
error,
|
|
35824
|
+
authError,
|
|
35825
|
+
lastUpdated,
|
|
35826
|
+
refresh,
|
|
35827
|
+
snapshotFor,
|
|
35828
|
+
historyFor,
|
|
35829
|
+
loadSnapshot
|
|
35830
|
+
} = useInstances(client, { paused, watch: watched });
|
|
35713
35831
|
const noteAuthFailure = (0, import_react39.useCallback)((err) => {
|
|
35714
35832
|
if (isAuthError(err)) setExpired((current) => current ?? err.message);
|
|
35715
35833
|
}, []);
|
|
35716
35834
|
(0, import_react39.useEffect)(() => {
|
|
35717
35835
|
if (authError) setExpired((current) => current ?? authError);
|
|
35718
35836
|
}, [authError]);
|
|
35719
|
-
const
|
|
35837
|
+
const selectedIndex = Math.min(selected, Math.max(0, rows.length - 1));
|
|
35838
|
+
const row = rows[selectedIndex];
|
|
35720
35839
|
(0, import_react39.useEffect)(() => {
|
|
35721
|
-
if (
|
|
35722
|
-
|
|
35723
|
-
|
|
35724
|
-
|
|
35840
|
+
if (view === "detail" && !row) setView("dashboard");
|
|
35841
|
+
}, [view, row]);
|
|
35842
|
+
const selectedUuid = row?.instance.uuid;
|
|
35843
|
+
const selectedRunning = row?.instance.status === "running";
|
|
35844
|
+
(0, import_react39.useEffect)(() => {
|
|
35845
|
+
setWatched(selectedRunning ? selectedUuid : void 0);
|
|
35846
|
+
if (selectedUuid && selectedRunning) loadSnapshot(selectedUuid);
|
|
35847
|
+
}, [selectedUuid, selectedRunning, loadSnapshot]);
|
|
35725
35848
|
(0, import_react39.useEffect)(() => {
|
|
35726
35849
|
if (expired) return;
|
|
35727
35850
|
let cancelled = false;
|
|
@@ -35744,10 +35867,18 @@ function App2({
|
|
|
35744
35867
|
clearInterval(timer);
|
|
35745
35868
|
};
|
|
35746
35869
|
}, [client, expired, noteAuthFailure]);
|
|
35870
|
+
const noticeTimer = (0, import_react39.useRef)(null);
|
|
35747
35871
|
const flash = (0, import_react39.useCallback)((message) => {
|
|
35748
35872
|
setNotice(message);
|
|
35749
|
-
|
|
35873
|
+
if (noticeTimer.current) clearTimeout(noticeTimer.current);
|
|
35874
|
+
noticeTimer.current = setTimeout(() => setNotice(null), 6e3);
|
|
35750
35875
|
}, []);
|
|
35876
|
+
(0, import_react39.useEffect)(
|
|
35877
|
+
() => () => {
|
|
35878
|
+
if (noticeTimer.current) clearTimeout(noticeTimer.current);
|
|
35879
|
+
},
|
|
35880
|
+
[]
|
|
35881
|
+
);
|
|
35751
35882
|
const act = (0, import_react39.useCallback)(
|
|
35752
35883
|
async (label, fn) => {
|
|
35753
35884
|
setBusy(true);
|
|
@@ -35780,13 +35911,15 @@ function App2({
|
|
|
35780
35911
|
async (draft) => {
|
|
35781
35912
|
setBusy(true);
|
|
35782
35913
|
try {
|
|
35914
|
+
const image2 = findBaseImage(draft.imageUuid);
|
|
35915
|
+
const startCommand = composeStartCommand(draft.ttlSeconds, void 0);
|
|
35783
35916
|
const uuid = await createInstance(client, {
|
|
35784
35917
|
gpuSpec: draft.spec.id,
|
|
35785
35918
|
gpuNum: 1,
|
|
35786
35919
|
imageUuid: draft.imageUuid,
|
|
35787
|
-
cudaFrom: parseCudaVersion("11.8"),
|
|
35920
|
+
cudaFrom: parseCudaVersion(image2?.cuda ?? "11.8"),
|
|
35788
35921
|
expandSystemDiskGb: 0,
|
|
35789
|
-
startCommand
|
|
35922
|
+
...startCommand ? { startCommand } : {}
|
|
35790
35923
|
});
|
|
35791
35924
|
recordTTL({ uuid, ttlSeconds: draft.ttlSeconds, inInstanceTimer: true });
|
|
35792
35925
|
setView("dashboard");
|
|
@@ -35804,7 +35937,6 @@ function App2({
|
|
|
35804
35937
|
);
|
|
35805
35938
|
use_input_default(
|
|
35806
35939
|
(input, key) => {
|
|
35807
|
-
if (busy && view !== "dashboard") return;
|
|
35808
35940
|
if (view === "help") {
|
|
35809
35941
|
setView("dashboard");
|
|
35810
35942
|
return;
|
|
@@ -35815,7 +35947,8 @@ function App2({
|
|
|
35815
35947
|
if (view === "stock") {
|
|
35816
35948
|
const max = toStockRows(stock, false).length;
|
|
35817
35949
|
if (key.upArrow || input === "k") return setStockIndex((v) => Math.max(0, v - 1));
|
|
35818
|
-
if (key.downArrow || input === "j")
|
|
35950
|
+
if (key.downArrow || input === "j")
|
|
35951
|
+
return setStockIndex((v) => Math.max(0, Math.min(max - 1, v + 1)));
|
|
35819
35952
|
if (input === "r") return void loadStock();
|
|
35820
35953
|
return;
|
|
35821
35954
|
}
|
|
@@ -35827,7 +35960,7 @@ function App2({
|
|
|
35827
35960
|
if (input === "?") return setView("help");
|
|
35828
35961
|
if (key.upArrow || input === "k") return setSelected((v) => Math.max(0, v - 1));
|
|
35829
35962
|
if (key.downArrow || input === "j")
|
|
35830
|
-
return setSelected((v) => Math.min(rows.length - 1, v + 1));
|
|
35963
|
+
return setSelected((v) => Math.max(0, Math.min(rows.length - 1, v + 1)));
|
|
35831
35964
|
if (input === "r") return refresh();
|
|
35832
35965
|
if (input === "n") return setView("create");
|
|
35833
35966
|
if (isCtrl(input, key, "l")) return setPending({ kind: "logout" });
|
|
@@ -35842,12 +35975,14 @@ function App2({
|
|
|
35842
35975
|
return setView("detail");
|
|
35843
35976
|
}
|
|
35844
35977
|
if (input === "s") {
|
|
35978
|
+
if (busy) return;
|
|
35845
35979
|
return void act("\u5F00\u673A", async () => {
|
|
35846
35980
|
await startInstance(client, row.instance.uuid);
|
|
35847
35981
|
return `\u2714 ${row.instance.uuid} \u5F00\u673A\u6307\u4EE4\u5DF2\u53D1\u9001`;
|
|
35848
35982
|
});
|
|
35849
35983
|
}
|
|
35850
35984
|
if (input === "x") {
|
|
35985
|
+
if (busy) return;
|
|
35851
35986
|
return void act("\u5173\u673A", async () => {
|
|
35852
35987
|
const { stopped, status } = await stopInstance(client, row.instance.uuid);
|
|
35853
35988
|
return stopped ? `\u2714 ${row.instance.uuid} \u5DF2\u5173\u673A\uFF0C\u8BA1\u8D39\u5DF2\u505C\u6B62` : `\u26A0 \u5173\u673A\u672A\u751F\u6548\uFF0C\u72B6\u6001\u4ECD\u4E3A ${status}\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5`;
|
|
@@ -35866,32 +36001,41 @@ function App2({
|
|
|
35866
36001
|
});
|
|
35867
36002
|
return;
|
|
35868
36003
|
}
|
|
35869
|
-
if (isCtrl(input, key, "d"))
|
|
36004
|
+
if (isCtrl(input, key, "d")) {
|
|
36005
|
+
if (busy) return;
|
|
36006
|
+
return setPending({ kind: "release", row });
|
|
36007
|
+
}
|
|
35870
36008
|
},
|
|
35871
36009
|
{ isActive: view !== "create" && pending === null && expired === null }
|
|
35872
36010
|
);
|
|
36011
|
+
const hints = expired ? "Enter \u91CD\u65B0\u767B\u5165 \xB7 q \u9000\u51FA" : pending ? CONFIRM_KEYS : view === "create" ? (
|
|
36012
|
+
// Step-agnostic on purpose: the wizard's own line says what Enter does at this
|
|
36013
|
+
// step, and only Esc is true at every one of them.
|
|
36014
|
+
"Esc \u53D6\u6D88"
|
|
36015
|
+
) : view === "help" ? "\u6309\u4EFB\u610F\u952E\u8FD4\u56DE" : view === "detail" ? "p \u663E\u793A/\u9690\u85CF\u5BC6\u7801 \xB7 Esc \u8FD4\u56DE" : view === "stock" ? "\u2191\u2193 \u79FB\u52A8 \xB7 r \u5237\u65B0 \xB7 Esc \u8FD4\u56DE" : DASHBOARD_KEYS;
|
|
36016
|
+
const showsDashboard = !expired && !pending && view === "dashboard";
|
|
35873
36017
|
return (
|
|
35874
36018
|
// Claim the entire terminal so the dashboard is a fixed full-screen surface rather
|
|
35875
36019
|
// than a block that grows and shrinks with its content.
|
|
35876
|
-
/* @__PURE__ */ (0,
|
|
35877
|
-
/* @__PURE__ */ (0,
|
|
36020
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Box_default, { flexDirection: "column", height: terminalRows, width: columns2, children: [
|
|
36021
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
35878
36022
|
Header,
|
|
35879
36023
|
{
|
|
35880
36024
|
subtitle: SCREEN_TITLES[view],
|
|
35881
36025
|
identity,
|
|
35882
36026
|
balance,
|
|
35883
36027
|
balanceError,
|
|
35884
|
-
columns:
|
|
36028
|
+
columns: columns2
|
|
35885
36029
|
}
|
|
35886
36030
|
),
|
|
35887
|
-
expired ? /* @__PURE__ */ (0,
|
|
36031
|
+
expired ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
35888
36032
|
SessionExpired,
|
|
35889
36033
|
{
|
|
35890
36034
|
message: expired,
|
|
35891
36035
|
onRelogin: () => onLogout("\u4E0A\u4E00\u6B21\u4F1A\u8BDD\u7684 Token \u5DF2\u5931\u6548\uFF0C\u8BF7\u91CD\u65B0\u767B\u5165\u3002"),
|
|
35892
36036
|
onQuit: exit
|
|
35893
36037
|
}
|
|
35894
|
-
) : pending?.kind === "logout" ? /* @__PURE__ */ (0,
|
|
36038
|
+
) : pending?.kind === "logout" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
35895
36039
|
Confirm,
|
|
35896
36040
|
{
|
|
35897
36041
|
title: "\u9000\u51FA\u767B\u5F55\uFF1F",
|
|
@@ -35904,7 +36048,7 @@ function App2({
|
|
|
35904
36048
|
},
|
|
35905
36049
|
onCancel: () => setPending(null)
|
|
35906
36050
|
}
|
|
35907
|
-
) : pending ? /* @__PURE__ */ (0,
|
|
36051
|
+
) : pending ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
35908
36052
|
Confirm,
|
|
35909
36053
|
{
|
|
35910
36054
|
title: `\u91CA\u653E\u5B9E\u4F8B ${pending.row.instance.name || pending.row.instance.uuid}\uFF1F`,
|
|
@@ -35921,27 +36065,39 @@ function App2({
|
|
|
35921
36065
|
},
|
|
35922
36066
|
onCancel: () => setPending(null)
|
|
35923
36067
|
}
|
|
35924
|
-
) : view === "create" ? /* @__PURE__ */ (0,
|
|
36068
|
+
) : view === "create" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CreateWizard, { busy, onSubmit: submitCreate, onCancel: () => setView("dashboard") }) : view === "detail" && row ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Detail, { row, snapshot: snapshotFor(row.instance.uuid), revealSecrets: reveal }) : view === "stock" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
35925
36069
|
StockScreen,
|
|
35926
36070
|
{
|
|
35927
36071
|
rows: toStockRows(stock, false),
|
|
35928
36072
|
selectedIndex: stockIndex,
|
|
35929
36073
|
loading: stockLoading
|
|
35930
36074
|
}
|
|
35931
|
-
) : view === "help" ? /* @__PURE__ */ (0,
|
|
35932
|
-
/* @__PURE__ */ (0,
|
|
35933
|
-
/* @__PURE__ */ (0,
|
|
35934
|
-
/* @__PURE__ */ (0,
|
|
35935
|
-
] }) : /* @__PURE__ */ (0,
|
|
35936
|
-
|
|
35937
|
-
|
|
36075
|
+
) : view === "help" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", paddingX: 1, children: [
|
|
36076
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text, { bold: true, children: "\u5FEB\u6377\u952E" }),
|
|
36077
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Box_default, { children: HELP_COLUMNS.map((column) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Box_default, { flexDirection: "column", width: 22, children: column.map((item) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text, { children: item }, item)) }, column[0])) }),
|
|
36078
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text, { dimColor: true, children: "\u6309\u4EFB\u610F\u952E\u8FD4\u56DE" })
|
|
36079
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
36080
|
+
Dashboard,
|
|
36081
|
+
{
|
|
36082
|
+
rows,
|
|
36083
|
+
selectedIndex,
|
|
36084
|
+
loading,
|
|
36085
|
+
snapshot: selectedUuid ? snapshotFor(selectedUuid) : void 0,
|
|
36086
|
+
history: selectedUuid ? historyFor(selectedUuid) : void 0,
|
|
36087
|
+
balance,
|
|
36088
|
+
width: columns2,
|
|
36089
|
+
height: terminalRows
|
|
36090
|
+
}
|
|
36091
|
+
),
|
|
36092
|
+
showsDashboard ? null : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Box_default, { flexGrow: 1 }),
|
|
36093
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
35938
36094
|
StatusBar,
|
|
35939
36095
|
{
|
|
35940
36096
|
rows,
|
|
35941
36097
|
error: expired ? null : error,
|
|
35942
36098
|
notice,
|
|
35943
36099
|
lastUpdated,
|
|
35944
|
-
hints
|
|
36100
|
+
hints
|
|
35945
36101
|
}
|
|
35946
36102
|
)
|
|
35947
36103
|
] })
|
|
@@ -35987,12 +36143,12 @@ function Root({ globals }) {
|
|
|
35987
36143
|
[session]
|
|
35988
36144
|
);
|
|
35989
36145
|
if (!session) {
|
|
35990
|
-
return /* @__PURE__ */ (0,
|
|
36146
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Login, { onSubmit: submit, onQuit: exit, error, verifying, notice });
|
|
35991
36147
|
}
|
|
35992
36148
|
return (
|
|
35993
36149
|
// Keyed on the token so a re-login remounts: the previous session's instances,
|
|
35994
36150
|
// balance and error state must not bleed into the new account's dashboard.
|
|
35995
|
-
/* @__PURE__ */ (0,
|
|
36151
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
35996
36152
|
App2,
|
|
35997
36153
|
{
|
|
35998
36154
|
client: session.client,
|
|
@@ -36022,7 +36178,7 @@ async function runTui(globals = {}) {
|
|
|
36022
36178
|
process.once("SIGTERM", restore);
|
|
36023
36179
|
process.stdout.write(ENTER_ALT_SCREEN + CLEAR);
|
|
36024
36180
|
try {
|
|
36025
|
-
const app = render_default(/* @__PURE__ */ (0,
|
|
36181
|
+
const app = render_default(/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Root, { globals }));
|
|
36026
36182
|
await app.waitUntilExit();
|
|
36027
36183
|
} finally {
|
|
36028
36184
|
restore();
|
|
@@ -36148,4 +36304,4 @@ react/cjs/react-jsx-runtime.development.js:
|
|
|
36148
36304
|
* LICENSE file in the root directory of this source tree.
|
|
36149
36305
|
*)
|
|
36150
36306
|
*/
|
|
36151
|
-
//# sourceMappingURL=app-
|
|
36307
|
+
//# sourceMappingURL=app-4PY7NE53.js.map
|