pudu-ai 0.2.12 → 0.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +209 -183
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -1986,10 +1986,10 @@ import { render } from "ink";
|
|
|
1986
1986
|
|
|
1987
1987
|
// src/tui/App.tsx
|
|
1988
1988
|
import { Box as Box11, useApp as useApp2, useInput as useInput4 } from "ink";
|
|
1989
|
-
import { useMemo as useMemo2, useRef as useRef2, useState as
|
|
1989
|
+
import { useMemo as useMemo2, useRef as useRef2, useState as useState5 } from "react";
|
|
1990
1990
|
|
|
1991
1991
|
// src/tui/views/Dashboard.tsx
|
|
1992
|
-
import { Box, Text } from "ink";
|
|
1992
|
+
import { Box, Text as Text2 } from "ink";
|
|
1993
1993
|
|
|
1994
1994
|
// src/shared/format.ts
|
|
1995
1995
|
function formatNumber(value, digits = 1) {
|
|
@@ -2035,6 +2035,39 @@ function sparkline(values, width = 24) {
|
|
|
2035
2035
|
return slice.map((v) => glyphs[Math.min(glyphs.length - 1, Math.floor(v / max * (glyphs.length - 1)))]).join("").padStart(width, glyphs[0]);
|
|
2036
2036
|
}
|
|
2037
2037
|
|
|
2038
|
+
// src/tui/Typewriter.tsx
|
|
2039
|
+
import { Text } from "ink";
|
|
2040
|
+
import { useEffect, useState } from "react";
|
|
2041
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2042
|
+
var finished = /* @__PURE__ */ new Set();
|
|
2043
|
+
function Typewriter(props) {
|
|
2044
|
+
const start = props.once && finished.has(props.text) ? props.text.length : 0;
|
|
2045
|
+
const [n, setN] = useState(start);
|
|
2046
|
+
useEffect(() => {
|
|
2047
|
+
if (props.once && finished.has(props.text)) {
|
|
2048
|
+
setN(props.text.length);
|
|
2049
|
+
return;
|
|
2050
|
+
}
|
|
2051
|
+
setN(0);
|
|
2052
|
+
}, [props.text, props.once]);
|
|
2053
|
+
useEffect(() => {
|
|
2054
|
+
if (n >= props.text.length) return;
|
|
2055
|
+
const timer = setTimeout(() => {
|
|
2056
|
+
setN((v) => {
|
|
2057
|
+
const next = v + 1;
|
|
2058
|
+
if (props.once && next >= props.text.length) finished.add(props.text);
|
|
2059
|
+
return next;
|
|
2060
|
+
});
|
|
2061
|
+
}, props.ms ?? 16);
|
|
2062
|
+
return () => clearTimeout(timer);
|
|
2063
|
+
}, [n, props.text, props.ms, props.once]);
|
|
2064
|
+
const done = n >= props.text.length;
|
|
2065
|
+
return /* @__PURE__ */ jsxs(Text, { color: props.color, dimColor: props.dimColor, bold: props.bold, children: [
|
|
2066
|
+
props.text.slice(0, n),
|
|
2067
|
+
done ? null : /* @__PURE__ */ jsx(Text, { color: "cyan", bold: true, children: "\u258D" })
|
|
2068
|
+
] });
|
|
2069
|
+
}
|
|
2070
|
+
|
|
2038
2071
|
// src/tui/width.ts
|
|
2039
2072
|
import { useStdout } from "ink";
|
|
2040
2073
|
function useCols() {
|
|
@@ -2049,7 +2082,7 @@ function fit(text, width) {
|
|
|
2049
2082
|
}
|
|
2050
2083
|
|
|
2051
2084
|
// src/tui/views/Dashboard.tsx
|
|
2052
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2085
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
2053
2086
|
function Dashboard({ session }) {
|
|
2054
2087
|
const cols = useCols();
|
|
2055
2088
|
const h = session.hardware;
|
|
@@ -2057,41 +2090,41 @@ function Dashboard({ session }) {
|
|
|
2057
2090
|
`${h.machineModel ?? t("unknownMachine")} \xB7 ${h.cpu.name ?? t("cpuNa")} \xB7 ${formatBytes(h.memory.totalBytes, 0)} ${memoryLabel(h)}`,
|
|
2058
2091
|
cols
|
|
2059
2092
|
);
|
|
2060
|
-
return /* @__PURE__ */
|
|
2061
|
-
/* @__PURE__ */
|
|
2062
|
-
/* @__PURE__ */
|
|
2063
|
-
/* @__PURE__ */
|
|
2093
|
+
return /* @__PURE__ */ jsxs2(Box, { flexDirection: "column", width: cols, children: [
|
|
2094
|
+
/* @__PURE__ */ jsx2(Text2, { bold: true, color: "cyan", children: t("machine") }),
|
|
2095
|
+
/* @__PURE__ */ jsx2(Text2, { children: line }),
|
|
2096
|
+
/* @__PURE__ */ jsx2(Text2, { children: session.runtimes.map((r, i) => /* @__PURE__ */ jsxs2(Text2, { color: r.detected ? "green" : "gray", children: [
|
|
2064
2097
|
i ? " " : "",
|
|
2065
2098
|
r.detected ? "\u2713" : "\u25CB",
|
|
2066
2099
|
r.label
|
|
2067
2100
|
] }, r.id)) }),
|
|
2068
|
-
/* @__PURE__ */
|
|
2069
|
-
session.rows.length === 0 && /* @__PURE__ */
|
|
2070
|
-
session.rows.slice(0, 6).map((row) => /* @__PURE__ */
|
|
2071
|
-
/* @__PURE__ */
|
|
2072
|
-
/* @__PURE__ */
|
|
2073
|
-
/* @__PURE__ */
|
|
2074
|
-
/* @__PURE__ */
|
|
2101
|
+
/* @__PURE__ */ jsx2(Text2, { bold: true, color: "cyan", children: t("installedModels") }),
|
|
2102
|
+
session.rows.length === 0 && /* @__PURE__ */ jsx2(Text2, { dimColor: true, children: t("noModels") }),
|
|
2103
|
+
session.rows.slice(0, 6).map((row) => /* @__PURE__ */ jsxs2(Text2, { children: [
|
|
2104
|
+
/* @__PURE__ */ jsx2(Text2, { color: "green", children: fit(row.local.name, 18) }),
|
|
2105
|
+
/* @__PURE__ */ jsx2(Text2, { children: " " }),
|
|
2106
|
+
/* @__PURE__ */ jsx2(Text2, { color: gradeColor(row.compatibility?.grade), children: row.compatibility?.grade ?? "\u2014" }),
|
|
2107
|
+
/* @__PURE__ */ jsxs2(Text2, { dimColor: true, children: [
|
|
2075
2108
|
" ",
|
|
2076
2109
|
row.lastBenchmark?.benchmark.generationTokensPerSecond ? formatTokensPerSec(row.lastBenchmark.benchmark.generationTokensPerSecond) : t("notTested")
|
|
2077
2110
|
] })
|
|
2078
2111
|
] }, row.local.id)),
|
|
2079
|
-
/* @__PURE__ */
|
|
2080
|
-
session.recommendations.slice(0, 4).map((rec) => /* @__PURE__ */
|
|
2081
|
-
/* @__PURE__ */
|
|
2082
|
-
/* @__PURE__ */
|
|
2112
|
+
/* @__PURE__ */ jsx2(Text2, { bold: true, color: "cyan", children: t("recommended") }),
|
|
2113
|
+
session.recommendations.slice(0, 4).map((rec) => /* @__PURE__ */ jsxs2(Text2, { children: [
|
|
2114
|
+
/* @__PURE__ */ jsx2(Text2, { color: "magenta", children: fit(rec.useCase, 10) }),
|
|
2115
|
+
/* @__PURE__ */ jsxs2(Text2, { children: [
|
|
2083
2116
|
" ",
|
|
2084
2117
|
fit(rec.model.name, 22),
|
|
2085
2118
|
" "
|
|
2086
2119
|
] }),
|
|
2087
|
-
/* @__PURE__ */
|
|
2120
|
+
/* @__PURE__ */ jsx2(Text2, { color: gradeColor(rec.grade), children: rec.grade })
|
|
2088
2121
|
] }, `${rec.useCase}-${rec.model.id}`)),
|
|
2089
|
-
/* @__PURE__ */
|
|
2122
|
+
/* @__PURE__ */ jsx2(Typewriter, { text: fit(t("setupCta"), cols), ms: 18, color: "yellow" })
|
|
2090
2123
|
] });
|
|
2091
2124
|
}
|
|
2092
2125
|
|
|
2093
2126
|
// src/tui/views/Models.tsx
|
|
2094
|
-
import { Box as Box2, Text as
|
|
2127
|
+
import { Box as Box2, Text as Text3 } from "ink";
|
|
2095
2128
|
|
|
2096
2129
|
// src/compatibility/types.ts
|
|
2097
2130
|
var GRADE_MEANING = {
|
|
@@ -2295,57 +2328,57 @@ function resultText(record, assessment) {
|
|
|
2295
2328
|
}
|
|
2296
2329
|
|
|
2297
2330
|
// src/tui/views/Models.tsx
|
|
2298
|
-
import { jsx as
|
|
2331
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
2299
2332
|
function ModelsView({ session }) {
|
|
2300
|
-
return /* @__PURE__ */
|
|
2301
|
-
/* @__PURE__ */
|
|
2302
|
-
/* @__PURE__ */
|
|
2333
|
+
return /* @__PURE__ */ jsxs3(Box2, { flexDirection: "column", children: [
|
|
2334
|
+
/* @__PURE__ */ jsx3(Text3, { children: modelsText(session) }),
|
|
2335
|
+
/* @__PURE__ */ jsx3(Text3, { color: "yellow", children: t("modelsHint") })
|
|
2303
2336
|
] });
|
|
2304
2337
|
}
|
|
2305
2338
|
|
|
2306
2339
|
// src/tui/views/Hardware.tsx
|
|
2307
|
-
import { Box as Box3, Text as
|
|
2308
|
-
import { jsx as
|
|
2340
|
+
import { Box as Box3, Text as Text4 } from "ink";
|
|
2341
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
2309
2342
|
function HardwareView({ session }) {
|
|
2310
|
-
return /* @__PURE__ */
|
|
2311
|
-
/* @__PURE__ */
|
|
2312
|
-
/* @__PURE__ */
|
|
2313
|
-
/* @__PURE__ */
|
|
2343
|
+
return /* @__PURE__ */ jsxs4(Box3, { flexDirection: "column", children: [
|
|
2344
|
+
/* @__PURE__ */ jsx4(Text4, { children: hardwareText(session) }),
|
|
2345
|
+
/* @__PURE__ */ jsx4(Text4, { children: runtimesText(session) }),
|
|
2346
|
+
/* @__PURE__ */ jsx4(Text4, { color: "yellow", children: t("hardwareHint") })
|
|
2314
2347
|
] });
|
|
2315
2348
|
}
|
|
2316
2349
|
|
|
2317
2350
|
// src/tui/views/Recommend.tsx
|
|
2318
|
-
import { Box as Box4, Text as
|
|
2319
|
-
import { jsx as
|
|
2351
|
+
import { Box as Box4, Text as Text5 } from "ink";
|
|
2352
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
2320
2353
|
function RecommendView({ session }) {
|
|
2321
2354
|
const cols = useCols();
|
|
2322
|
-
return /* @__PURE__ */
|
|
2323
|
-
/* @__PURE__ */
|
|
2324
|
-
/* @__PURE__ */
|
|
2325
|
-
session.recommendations.map((rec) => /* @__PURE__ */
|
|
2326
|
-
/* @__PURE__ */
|
|
2327
|
-
/* @__PURE__ */
|
|
2355
|
+
return /* @__PURE__ */ jsxs5(Box4, { flexDirection: "column", width: cols, children: [
|
|
2356
|
+
/* @__PURE__ */ jsx5(Text5, { bold: true, color: "magenta", children: t("recommended") }),
|
|
2357
|
+
/* @__PURE__ */ jsx5(Typewriter, { text: fit(t("aboutRecommend"), cols), ms: 12, dimColor: true }),
|
|
2358
|
+
session.recommendations.map((rec) => /* @__PURE__ */ jsxs5(Text5, { children: [
|
|
2359
|
+
/* @__PURE__ */ jsx5(Text5, { color: "magenta", children: fit(rec.useCase, 10) }),
|
|
2360
|
+
/* @__PURE__ */ jsxs5(Text5, { children: [
|
|
2328
2361
|
" ",
|
|
2329
2362
|
fit(rec.model.name, 22),
|
|
2330
2363
|
" "
|
|
2331
2364
|
] }),
|
|
2332
|
-
/* @__PURE__ */
|
|
2333
|
-
/* @__PURE__ */
|
|
2365
|
+
/* @__PURE__ */ jsx5(Text5, { color: gradeColor(rec.grade), children: rec.grade }),
|
|
2366
|
+
/* @__PURE__ */ jsxs5(Text5, { children: [
|
|
2334
2367
|
" ",
|
|
2335
2368
|
GRADE_MEANING[rec.grade]
|
|
2336
2369
|
] }),
|
|
2337
|
-
/* @__PURE__ */
|
|
2370
|
+
/* @__PURE__ */ jsxs5(Text5, { dimColor: true, children: [
|
|
2338
2371
|
" ",
|
|
2339
2372
|
resolveOllamaTag(rec.model.id, rec.model.name) ?? "\u2014"
|
|
2340
2373
|
] })
|
|
2341
2374
|
] }, `${rec.useCase}-${rec.model.id}`)),
|
|
2342
|
-
/* @__PURE__ */
|
|
2375
|
+
/* @__PURE__ */ jsx5(Text5, { color: "yellow", children: fit(t("setupCta"), cols) })
|
|
2343
2376
|
] });
|
|
2344
2377
|
}
|
|
2345
2378
|
|
|
2346
2379
|
// src/tui/views/Setup.tsx
|
|
2347
|
-
import { Box as Box5, Text as
|
|
2348
|
-
import { useState } from "react";
|
|
2380
|
+
import { Box as Box5, Text as Text6, useApp, useInput } from "ink";
|
|
2381
|
+
import { useState as useState2 } from "react";
|
|
2349
2382
|
|
|
2350
2383
|
// src/integrations/catalog.ts
|
|
2351
2384
|
var INTEGRATIONS = {
|
|
@@ -2535,7 +2568,7 @@ async function pullOllamaModel(modelId, extraName) {
|
|
|
2535
2568
|
}
|
|
2536
2569
|
|
|
2537
2570
|
// src/tui/views/Setup.tsx
|
|
2538
|
-
import { jsx as
|
|
2571
|
+
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2539
2572
|
var TOOLS = [
|
|
2540
2573
|
{ key: "1", id: "opencode", label: "OpenCode" },
|
|
2541
2574
|
{ key: "2", id: "hermes", label: "Hermes" },
|
|
@@ -2544,9 +2577,9 @@ var TOOLS = [
|
|
|
2544
2577
|
function SetupView({ session }) {
|
|
2545
2578
|
const cols = useCols();
|
|
2546
2579
|
const { exit } = useApp();
|
|
2547
|
-
const [cursor, setCursor] =
|
|
2548
|
-
const [log, setLog] =
|
|
2549
|
-
const [busy, setBusy] =
|
|
2580
|
+
const [cursor, setCursor] = useState2(0);
|
|
2581
|
+
const [log, setLog] = useState2("");
|
|
2582
|
+
const [busy, setBusy] = useState2(false);
|
|
2550
2583
|
const recs = session.recommendations;
|
|
2551
2584
|
const rec = recs[cursor];
|
|
2552
2585
|
useInput((input, key) => {
|
|
@@ -2582,19 +2615,19 @@ function SetupView({ session }) {
|
|
|
2582
2615
|
}
|
|
2583
2616
|
});
|
|
2584
2617
|
const tag = rec ? resolveOllamaTag(rec.model.id, rec.model.name) : void 0;
|
|
2585
|
-
return /* @__PURE__ */
|
|
2586
|
-
/* @__PURE__ */
|
|
2587
|
-
recs.map((item, i) => /* @__PURE__ */
|
|
2618
|
+
return /* @__PURE__ */ jsxs6(Box5, { flexDirection: "column", width: cols, children: [
|
|
2619
|
+
/* @__PURE__ */ jsx6(Text6, { bold: true, color: "yellow", children: fit(t("setupTitle"), cols) }),
|
|
2620
|
+
recs.map((item, i) => /* @__PURE__ */ jsxs6(Text6, { color: i === cursor ? "cyan" : void 0, children: [
|
|
2588
2621
|
i === cursor ? "\u276F " : " ",
|
|
2589
2622
|
fit(item.model.name, 20),
|
|
2590
2623
|
" ",
|
|
2591
|
-
/* @__PURE__ */
|
|
2592
|
-
/* @__PURE__ */
|
|
2624
|
+
/* @__PURE__ */ jsx6(Text6, { color: gradeColor(item.grade), children: item.grade }),
|
|
2625
|
+
/* @__PURE__ */ jsxs6(Text6, { dimColor: true, children: [
|
|
2593
2626
|
" ",
|
|
2594
2627
|
resolveOllamaTag(item.model.id, item.model.name) ?? "\u2014"
|
|
2595
2628
|
] })
|
|
2596
2629
|
] }, `${item.useCase}-${item.model.id}`)),
|
|
2597
|
-
/* @__PURE__ */
|
|
2630
|
+
/* @__PURE__ */ jsx6(Text6, { children: session.agents.map((agent, index) => /* @__PURE__ */ jsxs6(Text6, { color: agent.detected ? "green" : "gray", children: [
|
|
2598
2631
|
index ? " " : "",
|
|
2599
2632
|
"[",
|
|
2600
2633
|
index + 1,
|
|
@@ -2602,28 +2635,28 @@ function SetupView({ session }) {
|
|
|
2602
2635
|
agent.detected ? "\u2713" : "\u25CB",
|
|
2603
2636
|
agent.label
|
|
2604
2637
|
] }, agent.id)) }),
|
|
2605
|
-
/* @__PURE__ */
|
|
2606
|
-
log ? /* @__PURE__ */
|
|
2638
|
+
/* @__PURE__ */ jsx6(Typewriter, { text: fit(`Enter=pull ${tag ?? ""} 1/2/3=agent Esc=back`, cols), ms: 14, dimColor: true }),
|
|
2639
|
+
log ? /* @__PURE__ */ jsx6(Text6, { color: "green", children: fit(log, cols) }) : null
|
|
2607
2640
|
] });
|
|
2608
2641
|
}
|
|
2609
2642
|
|
|
2610
2643
|
// src/tui/views/Compare.tsx
|
|
2611
|
-
import { Box as Box6, Text as
|
|
2612
|
-
import { jsx as
|
|
2644
|
+
import { Box as Box6, Text as Text7 } from "ink";
|
|
2645
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
2613
2646
|
function CompareView({ session }) {
|
|
2614
|
-
return /* @__PURE__ */
|
|
2647
|
+
return /* @__PURE__ */ jsx7(Box6, { flexDirection: "column", children: /* @__PURE__ */ jsx7(Text7, { children: compareText(session.history) }) });
|
|
2615
2648
|
}
|
|
2616
2649
|
|
|
2617
2650
|
// src/tui/views/Benchmark.tsx
|
|
2618
|
-
import { Box as Box7, Text as
|
|
2619
|
-
import { useEffect, useRef, useState as
|
|
2620
|
-
import { jsx as
|
|
2651
|
+
import { Box as Box7, Text as Text8, useInput as useInput2 } from "ink";
|
|
2652
|
+
import { useEffect as useEffect2, useRef, useState as useState3 } from "react";
|
|
2653
|
+
import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2621
2654
|
function BenchmarkView(props) {
|
|
2622
|
-
const [phase, setPhase] =
|
|
2623
|
-
const [sample, setSample] =
|
|
2624
|
-
const [elapsed, setElapsed] =
|
|
2625
|
-
const [result, setResult] =
|
|
2626
|
-
const [error, setError] =
|
|
2655
|
+
const [phase, setPhase] = useState3(props.models.length ? "select" : "error");
|
|
2656
|
+
const [sample, setSample] = useState3();
|
|
2657
|
+
const [elapsed, setElapsed] = useState3(0);
|
|
2658
|
+
const [result, setResult] = useState3();
|
|
2659
|
+
const [error, setError] = useState3(props.models.length ? "" : t("noGguf"));
|
|
2627
2660
|
const cpuHist = useRef([]);
|
|
2628
2661
|
const memHist = useRef([]);
|
|
2629
2662
|
const abortRef = useRef(void 0);
|
|
@@ -2639,7 +2672,7 @@ function BenchmarkView(props) {
|
|
|
2639
2672
|
props.onBack();
|
|
2640
2673
|
}
|
|
2641
2674
|
});
|
|
2642
|
-
|
|
2675
|
+
useEffect2(() => {
|
|
2643
2676
|
if (phase !== "running") return;
|
|
2644
2677
|
const model2 = props.models[props.selected];
|
|
2645
2678
|
if (!model2) return;
|
|
@@ -2677,19 +2710,19 @@ function BenchmarkView(props) {
|
|
|
2677
2710
|
const h = props.session.hardware;
|
|
2678
2711
|
const model = props.models[props.selected];
|
|
2679
2712
|
if (phase === "select") {
|
|
2680
|
-
return /* @__PURE__ */
|
|
2681
|
-
/* @__PURE__ */
|
|
2682
|
-
props.models.map((m, i) => /* @__PURE__ */
|
|
2713
|
+
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", children: [
|
|
2714
|
+
/* @__PURE__ */ jsx8(Text8, { bold: true, children: t("selectBenchmark") }),
|
|
2715
|
+
props.models.map((m, i) => /* @__PURE__ */ jsxs7(Text8, { color: i === props.selected ? "cyan" : void 0, children: [
|
|
2683
2716
|
i === props.selected ? "\u276F " : " ",
|
|
2684
2717
|
m.name
|
|
2685
2718
|
] }, m.id)),
|
|
2686
|
-
/* @__PURE__ */
|
|
2719
|
+
/* @__PURE__ */ jsx8(Text8, { dimColor: true, children: t("enterToRun") })
|
|
2687
2720
|
] });
|
|
2688
2721
|
}
|
|
2689
2722
|
if (phase === "done" && result) {
|
|
2690
|
-
return /* @__PURE__ */
|
|
2691
|
-
/* @__PURE__ */
|
|
2692
|
-
/* @__PURE__ */
|
|
2723
|
+
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", children: [
|
|
2724
|
+
/* @__PURE__ */ jsx8(Text8, { children: resultText(result.record, result.assessment) }),
|
|
2725
|
+
/* @__PURE__ */ jsxs7(Text8, { dimColor: true, children: [
|
|
2693
2726
|
t("saved"),
|
|
2694
2727
|
" ",
|
|
2695
2728
|
result.path
|
|
@@ -2697,17 +2730,17 @@ function BenchmarkView(props) {
|
|
|
2697
2730
|
] });
|
|
2698
2731
|
}
|
|
2699
2732
|
if (phase === "error") {
|
|
2700
|
-
return /* @__PURE__ */
|
|
2733
|
+
return /* @__PURE__ */ jsx8(Box7, { flexDirection: "column", children: /* @__PURE__ */ jsx8(Text8, { color: "red", children: error }) });
|
|
2701
2734
|
}
|
|
2702
2735
|
const cpu = sample?.cpu?.utilizationPercent;
|
|
2703
2736
|
const gpu = sample?.gpu?.utilizationPercent;
|
|
2704
2737
|
const memUsed = sample?.memory.usedBytes;
|
|
2705
2738
|
const memTotal = h.memory.totalBytes;
|
|
2706
|
-
return /* @__PURE__ */
|
|
2707
|
-
/* @__PURE__ */
|
|
2708
|
-
/* @__PURE__ */
|
|
2709
|
-
/* @__PURE__ */
|
|
2710
|
-
/* @__PURE__ */
|
|
2739
|
+
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", children: [
|
|
2740
|
+
/* @__PURE__ */ jsxs7(Box7, { borderStyle: "round", borderColor: "cyan", flexDirection: "column", paddingX: 1, children: [
|
|
2741
|
+
/* @__PURE__ */ jsx8(Text8, { bold: true, children: t("benchmarkTitle") }),
|
|
2742
|
+
/* @__PURE__ */ jsx8(Text8, { children: model?.name }),
|
|
2743
|
+
/* @__PURE__ */ jsxs7(Text8, { dimColor: true, children: [
|
|
2711
2744
|
h.cpu.name,
|
|
2712
2745
|
" \xB7 ",
|
|
2713
2746
|
formatBytes(h.memory.totalBytes, 0),
|
|
@@ -2715,31 +2748,31 @@ function BenchmarkView(props) {
|
|
|
2715
2748
|
memoryLabel(h)
|
|
2716
2749
|
] })
|
|
2717
2750
|
] }),
|
|
2718
|
-
/* @__PURE__ */
|
|
2719
|
-
/* @__PURE__ */
|
|
2720
|
-
/* @__PURE__ */
|
|
2751
|
+
/* @__PURE__ */ jsxs7(Box7, { marginTop: 1, flexDirection: "column", children: [
|
|
2752
|
+
/* @__PURE__ */ jsx8(Text8, { bold: true, color: "cyan", children: t("performance") }),
|
|
2753
|
+
/* @__PURE__ */ jsxs7(Text8, { children: [
|
|
2721
2754
|
t("elapsed"),
|
|
2722
2755
|
" ",
|
|
2723
2756
|
elapsed.toFixed(1),
|
|
2724
2757
|
" s"
|
|
2725
2758
|
] }),
|
|
2726
|
-
/* @__PURE__ */
|
|
2759
|
+
/* @__PURE__ */ jsx8(Text8, { dimColor: true, children: t("measuredAfter") })
|
|
2727
2760
|
] }),
|
|
2728
|
-
/* @__PURE__ */
|
|
2729
|
-
/* @__PURE__ */
|
|
2730
|
-
/* @__PURE__ */
|
|
2761
|
+
/* @__PURE__ */ jsxs7(Box7, { marginTop: 1, flexDirection: "column", children: [
|
|
2762
|
+
/* @__PURE__ */ jsx8(Text8, { bold: true, color: "cyan", children: t("system") }),
|
|
2763
|
+
/* @__PURE__ */ jsxs7(Text8, { children: [
|
|
2731
2764
|
"CPU ",
|
|
2732
2765
|
bar(cpu),
|
|
2733
2766
|
" ",
|
|
2734
2767
|
formatPercent(cpu)
|
|
2735
2768
|
] }),
|
|
2736
|
-
/* @__PURE__ */
|
|
2769
|
+
/* @__PURE__ */ jsxs7(Text8, { children: [
|
|
2737
2770
|
"GPU ",
|
|
2738
2771
|
bar(gpu),
|
|
2739
2772
|
" ",
|
|
2740
2773
|
formatPercent(gpu)
|
|
2741
2774
|
] }),
|
|
2742
|
-
/* @__PURE__ */
|
|
2775
|
+
/* @__PURE__ */ jsxs7(Text8, { children: [
|
|
2743
2776
|
"Memory ",
|
|
2744
2777
|
bar(memUsed && memTotal ? memUsed / memTotal * 100 : void 0),
|
|
2745
2778
|
" ",
|
|
@@ -2747,56 +2780,56 @@ function BenchmarkView(props) {
|
|
|
2747
2780
|
" / ",
|
|
2748
2781
|
formatBytes(memTotal, 0)
|
|
2749
2782
|
] }),
|
|
2750
|
-
/* @__PURE__ */
|
|
2783
|
+
/* @__PURE__ */ jsxs7(Text8, { children: [
|
|
2751
2784
|
"Swap ",
|
|
2752
2785
|
bar(0),
|
|
2753
2786
|
" ",
|
|
2754
2787
|
sample ? formatBytes(sample.memory.swapUsedBytes) : "N/A"
|
|
2755
2788
|
] })
|
|
2756
2789
|
] }),
|
|
2757
|
-
/* @__PURE__ */
|
|
2758
|
-
/* @__PURE__ */
|
|
2759
|
-
/* @__PURE__ */
|
|
2790
|
+
/* @__PURE__ */ jsxs7(Box7, { marginTop: 1, flexDirection: "column", children: [
|
|
2791
|
+
/* @__PURE__ */ jsx8(Text8, { bold: true, color: "cyan", children: t("powerThermals") }),
|
|
2792
|
+
/* @__PURE__ */ jsxs7(Text8, { children: [
|
|
2760
2793
|
"Package ",
|
|
2761
2794
|
sample?.packagePowerWatts ?? "N/A",
|
|
2762
2795
|
" W"
|
|
2763
2796
|
] }),
|
|
2764
|
-
/* @__PURE__ */
|
|
2797
|
+
/* @__PURE__ */ jsxs7(Text8, { children: [
|
|
2765
2798
|
"Temperature ",
|
|
2766
2799
|
sample?.thermal?.temperatureC ?? "N/A",
|
|
2767
2800
|
" \xB0C"
|
|
2768
2801
|
] }),
|
|
2769
|
-
/* @__PURE__ */
|
|
2802
|
+
/* @__PURE__ */ jsxs7(Text8, { children: [
|
|
2770
2803
|
"Thermal Pressure ",
|
|
2771
2804
|
sample?.thermal?.pressure ?? "N/A"
|
|
2772
2805
|
] }),
|
|
2773
|
-
/* @__PURE__ */
|
|
2806
|
+
/* @__PURE__ */ jsx8(Text8, { dimColor: true, children: t("permissionsHint") })
|
|
2774
2807
|
] }),
|
|
2775
|
-
/* @__PURE__ */
|
|
2808
|
+
/* @__PURE__ */ jsxs7(Text8, { children: [
|
|
2776
2809
|
sparkline(cpuHist.current),
|
|
2777
2810
|
" CPU"
|
|
2778
2811
|
] }),
|
|
2779
|
-
/* @__PURE__ */
|
|
2812
|
+
/* @__PURE__ */ jsxs7(Text8, { children: [
|
|
2780
2813
|
sparkline(memHist.current.map((v) => v / 1024 ** 3)),
|
|
2781
2814
|
" Memory"
|
|
2782
2815
|
] }),
|
|
2783
|
-
/* @__PURE__ */
|
|
2816
|
+
/* @__PURE__ */ jsx8(Text8, { dimColor: true, children: t("cancelHint") })
|
|
2784
2817
|
] });
|
|
2785
2818
|
}
|
|
2786
2819
|
|
|
2787
2820
|
// src/tui/views/History.tsx
|
|
2788
|
-
import { Box as Box8, Text as
|
|
2789
|
-
import { jsx as
|
|
2821
|
+
import { Box as Box8, Text as Text9 } from "ink";
|
|
2822
|
+
import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2790
2823
|
function HistoryView({ session }) {
|
|
2791
|
-
return /* @__PURE__ */
|
|
2792
|
-
/* @__PURE__ */
|
|
2793
|
-
/* @__PURE__ */
|
|
2824
|
+
return /* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", children: [
|
|
2825
|
+
/* @__PURE__ */ jsx9(Text9, { bold: true, color: "cyan", children: t("measured") }),
|
|
2826
|
+
/* @__PURE__ */ jsx9(Text9, { children: historyText(session.history) })
|
|
2794
2827
|
] });
|
|
2795
2828
|
}
|
|
2796
2829
|
|
|
2797
2830
|
// src/tui/views/Tasks.tsx
|
|
2798
|
-
import { Box as Box9, Text as
|
|
2799
|
-
import { useMemo, useState as
|
|
2831
|
+
import { Box as Box9, Text as Text10, useInput as useInput3 } from "ink";
|
|
2832
|
+
import { useMemo, useState as useState4 } from "react";
|
|
2800
2833
|
|
|
2801
2834
|
// src/tasks/catalog.ts
|
|
2802
2835
|
var TASK_CATALOG = [
|
|
@@ -2991,7 +3024,7 @@ function tasksText(plans, answers) {
|
|
|
2991
3024
|
}
|
|
2992
3025
|
|
|
2993
3026
|
// src/tui/views/Tasks.tsx
|
|
2994
|
-
import { Fragment, jsx as
|
|
3027
|
+
import { Fragment, jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2995
3028
|
var KIND_LABEL = {
|
|
2996
3029
|
code: "tasksOptCode",
|
|
2997
3030
|
video: "tasksOptVideo",
|
|
@@ -3000,11 +3033,11 @@ var KIND_LABEL = {
|
|
|
3000
3033
|
chat: "tasksOptChat"
|
|
3001
3034
|
};
|
|
3002
3035
|
function TasksView({ session }) {
|
|
3003
|
-
const [step, setStep] =
|
|
3004
|
-
const [cursor, setCursor] =
|
|
3005
|
-
const [kinds, setKinds] =
|
|
3006
|
-
const [scope, setScope] =
|
|
3007
|
-
const [priority, setPriority] =
|
|
3036
|
+
const [step, setStep] = useState4(0);
|
|
3037
|
+
const [cursor, setCursor] = useState4(0);
|
|
3038
|
+
const [kinds, setKinds] = useState4(["code", "chat"]);
|
|
3039
|
+
const [scope, setScope] = useState4("installed");
|
|
3040
|
+
const [priority, setPriority] = useState4("balanced");
|
|
3008
3041
|
const plans = useMemo(
|
|
3009
3042
|
() => planTasks(session, { kinds, scope, priority }),
|
|
3010
3043
|
[session, kinds, scope, priority]
|
|
@@ -3032,13 +3065,13 @@ function TasksView({ session }) {
|
|
|
3032
3065
|
}
|
|
3033
3066
|
});
|
|
3034
3067
|
if (step === 3) {
|
|
3035
|
-
return /* @__PURE__ */
|
|
3068
|
+
return /* @__PURE__ */ jsx10(Box9, { flexDirection: "column", children: /* @__PURE__ */ jsx10(Text10, { children: tasksText(plans, { kinds, scope, priority }) }) });
|
|
3036
3069
|
}
|
|
3037
|
-
return /* @__PURE__ */
|
|
3038
|
-
/* @__PURE__ */
|
|
3039
|
-
step === 0 && /* @__PURE__ */
|
|
3040
|
-
/* @__PURE__ */
|
|
3041
|
-
WORK_KINDS.map((kind, i) => /* @__PURE__ */
|
|
3070
|
+
return /* @__PURE__ */ jsxs9(Box9, { flexDirection: "column", children: [
|
|
3071
|
+
/* @__PURE__ */ jsx10(Text10, { bold: true, color: "cyan", children: t("tasksTitle") }),
|
|
3072
|
+
step === 0 && /* @__PURE__ */ jsxs9(Fragment, { children: [
|
|
3073
|
+
/* @__PURE__ */ jsx10(Text10, { children: t("tasksQ1") }),
|
|
3074
|
+
WORK_KINDS.map((kind, i) => /* @__PURE__ */ jsxs9(Text10, { color: i === cursor ? "cyan" : void 0, children: [
|
|
3042
3075
|
i === cursor ? "\u276F " : " ",
|
|
3043
3076
|
"[",
|
|
3044
3077
|
kinds.includes(kind) ? "x" : " ",
|
|
@@ -3046,20 +3079,20 @@ function TasksView({ session }) {
|
|
|
3046
3079
|
t(KIND_LABEL[kind])
|
|
3047
3080
|
] }, kind))
|
|
3048
3081
|
] }),
|
|
3049
|
-
step === 1 && /* @__PURE__ */
|
|
3050
|
-
/* @__PURE__ */
|
|
3051
|
-
/* @__PURE__ */
|
|
3082
|
+
step === 1 && /* @__PURE__ */ jsxs9(Fragment, { children: [
|
|
3083
|
+
/* @__PURE__ */ jsx10(Text10, { children: t("tasksQ2") }),
|
|
3084
|
+
/* @__PURE__ */ jsxs9(Text10, { color: scope === "installed" ? "cyan" : void 0, children: [
|
|
3052
3085
|
scope === "installed" ? "\u276F " : " ",
|
|
3053
3086
|
t("tasksOptInstalled")
|
|
3054
3087
|
] }),
|
|
3055
|
-
/* @__PURE__ */
|
|
3088
|
+
/* @__PURE__ */ jsxs9(Text10, { color: scope === "all" ? "cyan" : void 0, children: [
|
|
3056
3089
|
scope === "all" ? "\u276F " : " ",
|
|
3057
3090
|
t("tasksOptAll")
|
|
3058
3091
|
] })
|
|
3059
3092
|
] }),
|
|
3060
|
-
step === 2 && /* @__PURE__ */
|
|
3061
|
-
/* @__PURE__ */
|
|
3062
|
-
["speed", "balanced", "quality"].map((item) => /* @__PURE__ */
|
|
3093
|
+
step === 2 && /* @__PURE__ */ jsxs9(Fragment, { children: [
|
|
3094
|
+
/* @__PURE__ */ jsx10(Text10, { children: t("tasksQ3") }),
|
|
3095
|
+
["speed", "balanced", "quality"].map((item) => /* @__PURE__ */ jsxs9(Text10, { color: priority === item ? "cyan" : void 0, children: [
|
|
3063
3096
|
priority === item ? "\u276F " : " ",
|
|
3064
3097
|
item === "speed" ? t("tasksOptSpeed") : item === "quality" ? t("tasksOptQuality") : t("tasksOptBalanced")
|
|
3065
3098
|
] }, item))
|
|
@@ -3095,61 +3128,54 @@ function handleAppKey(screen, input, key) {
|
|
|
3095
3128
|
}
|
|
3096
3129
|
|
|
3097
3130
|
// src/tui/Welcome.tsx
|
|
3098
|
-
import { Box as Box10, Text as
|
|
3099
|
-
import { Fragment as Fragment2, jsx as
|
|
3131
|
+
import { Box as Box10, Text as Text11 } from "ink";
|
|
3132
|
+
import { Fragment as Fragment2, jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3100
3133
|
function Chrome() {
|
|
3101
3134
|
const cols = useCols();
|
|
3102
3135
|
const wide = cols >= 72;
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
/* @__PURE__ */
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
] })
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
/* @__PURE__ */
|
|
3115
|
-
/* @__PURE__ */
|
|
3116
|
-
/* @__PURE__ */
|
|
3117
|
-
/* @__PURE__ */
|
|
3118
|
-
/* @__PURE__ */
|
|
3119
|
-
/* @__PURE__ */
|
|
3120
|
-
/* @__PURE__ */
|
|
3121
|
-
/* @__PURE__ */
|
|
3122
|
-
/* @__PURE__ */
|
|
3123
|
-
/* @__PURE__ */
|
|
3124
|
-
|
|
3125
|
-
/* @__PURE__ */
|
|
3126
|
-
/* @__PURE__ */
|
|
3127
|
-
/* @__PURE__ */
|
|
3128
|
-
/* @__PURE__ */
|
|
3129
|
-
/* @__PURE__ */
|
|
3130
|
-
/* @__PURE__ */
|
|
3131
|
-
|
|
3132
|
-
/* @__PURE__ */
|
|
3133
|
-
/* @__PURE__ */
|
|
3134
|
-
/* @__PURE__ */ jsx10(Text10, { color: "cyan", children: "[M]" }),
|
|
3135
|
-
/* @__PURE__ */ jsx10(Text10, { color: "magenta", children: "[R]" }),
|
|
3136
|
-
/* @__PURE__ */ jsx10(Text10, { color: "blue", children: "[T]" }),
|
|
3137
|
-
/* @__PURE__ */ jsx10(Text10, { children: "[H]" }),
|
|
3138
|
-
/* @__PURE__ */ jsx10(Text10, { color: "green", children: "[C]" }),
|
|
3139
|
-
/* @__PURE__ */ jsx10(Text10, { color: "cyan", children: "[L]" }),
|
|
3140
|
-
/* @__PURE__ */ jsx10(Text10, { color: "red", children: "[Q]" })
|
|
3136
|
+
const brand = `${t("appTitle")} ${t("byline")}`;
|
|
3137
|
+
return /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", width: cols, marginBottom: 1, children: [
|
|
3138
|
+
/* @__PURE__ */ jsx11(Typewriter, { text: brand, ms: 28, color: "cyan", bold: true, once: true }),
|
|
3139
|
+
/* @__PURE__ */ jsx11(Text11, { children: wide ? /* @__PURE__ */ jsxs10(Fragment2, { children: [
|
|
3140
|
+
/* @__PURE__ */ jsx11(Text11, { color: "yellow", children: "[S] Setup" }),
|
|
3141
|
+
/* @__PURE__ */ jsx11(Text11, { children: " " }),
|
|
3142
|
+
/* @__PURE__ */ jsx11(Text11, { color: "green", children: "[B] Bench" }),
|
|
3143
|
+
/* @__PURE__ */ jsx11(Text11, { children: " " }),
|
|
3144
|
+
/* @__PURE__ */ jsx11(Text11, { color: "cyan", children: "[M] Models" }),
|
|
3145
|
+
/* @__PURE__ */ jsx11(Text11, { children: " " }),
|
|
3146
|
+
/* @__PURE__ */ jsx11(Text11, { color: "magenta", children: "[R] Rec" }),
|
|
3147
|
+
/* @__PURE__ */ jsx11(Text11, { children: " " }),
|
|
3148
|
+
/* @__PURE__ */ jsx11(Text11, { color: "blue", children: "[T] Tasks" }),
|
|
3149
|
+
/* @__PURE__ */ jsx11(Text11, { children: " " }),
|
|
3150
|
+
/* @__PURE__ */ jsx11(Text11, { children: "[H] HW" }),
|
|
3151
|
+
/* @__PURE__ */ jsx11(Text11, { children: " " }),
|
|
3152
|
+
/* @__PURE__ */ jsx11(Text11, { color: "green", children: "[C] Cmp" }),
|
|
3153
|
+
/* @__PURE__ */ jsx11(Text11, { children: " " }),
|
|
3154
|
+
/* @__PURE__ */ jsx11(Text11, { color: "cyan", children: "[L] Log" }),
|
|
3155
|
+
/* @__PURE__ */ jsx11(Text11, { children: " " }),
|
|
3156
|
+
/* @__PURE__ */ jsx11(Text11, { color: "red", children: "[Q] Quit" })
|
|
3157
|
+
] }) : /* @__PURE__ */ jsxs10(Fragment2, { children: [
|
|
3158
|
+
/* @__PURE__ */ jsx11(Text11, { color: "yellow", children: "[S]" }),
|
|
3159
|
+
/* @__PURE__ */ jsx11(Text11, { color: "green", children: "[B]" }),
|
|
3160
|
+
/* @__PURE__ */ jsx11(Text11, { color: "cyan", children: "[M]" }),
|
|
3161
|
+
/* @__PURE__ */ jsx11(Text11, { color: "magenta", children: "[R]" }),
|
|
3162
|
+
/* @__PURE__ */ jsx11(Text11, { color: "blue", children: "[T]" }),
|
|
3163
|
+
/* @__PURE__ */ jsx11(Text11, { children: "[H]" }),
|
|
3164
|
+
/* @__PURE__ */ jsx11(Text11, { color: "green", children: "[C]" }),
|
|
3165
|
+
/* @__PURE__ */ jsx11(Text11, { color: "cyan", children: "[L]" }),
|
|
3166
|
+
/* @__PURE__ */ jsx11(Text11, { color: "red", children: "[Q]" })
|
|
3141
3167
|
] }) })
|
|
3142
3168
|
] });
|
|
3143
3169
|
}
|
|
3144
3170
|
|
|
3145
3171
|
// src/tui/App.tsx
|
|
3146
|
-
import { jsx as
|
|
3172
|
+
import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3147
3173
|
function App(props) {
|
|
3148
3174
|
const { exit } = useApp2();
|
|
3149
|
-
const [screen, setScreen] =
|
|
3175
|
+
const [screen, setScreen] = useState5(props.start ?? "home");
|
|
3150
3176
|
const screenRef = useRef2(screen);
|
|
3151
3177
|
screenRef.current = screen;
|
|
3152
|
-
const [selected, setSelected] =
|
|
3178
|
+
const [selected, setSelected] = useState5(0);
|
|
3153
3179
|
const benchable = useMemo2(
|
|
3154
3180
|
() => props.session.models.filter((m) => Boolean(m.artifactPath)),
|
|
3155
3181
|
[props.session.models]
|
|
@@ -3160,17 +3186,17 @@ function App(props) {
|
|
|
3160
3186
|
if (result.type === "home") setScreen("home");
|
|
3161
3187
|
if (result.type === "screen") setScreen(result.screen);
|
|
3162
3188
|
});
|
|
3163
|
-
return /* @__PURE__ */
|
|
3164
|
-
screen !== "benchmark" && /* @__PURE__ */
|
|
3165
|
-
screen === "home" && /* @__PURE__ */
|
|
3166
|
-
screen === "models" && /* @__PURE__ */
|
|
3167
|
-
screen === "hardware" && /* @__PURE__ */
|
|
3168
|
-
screen === "recommend" && /* @__PURE__ */
|
|
3169
|
-
screen === "setup" && /* @__PURE__ */
|
|
3170
|
-
screen === "compare" && /* @__PURE__ */
|
|
3171
|
-
screen === "history" && /* @__PURE__ */
|
|
3172
|
-
screen === "tasks" && /* @__PURE__ */
|
|
3173
|
-
screen === "benchmark" && /* @__PURE__ */
|
|
3189
|
+
return /* @__PURE__ */ jsxs11(Box11, { flexDirection: "column", paddingX: 1, children: [
|
|
3190
|
+
screen !== "benchmark" && /* @__PURE__ */ jsx12(Chrome, {}),
|
|
3191
|
+
screen === "home" && /* @__PURE__ */ jsx12(Dashboard, { session: props.session }),
|
|
3192
|
+
screen === "models" && /* @__PURE__ */ jsx12(ModelsView, { session: props.session }),
|
|
3193
|
+
screen === "hardware" && /* @__PURE__ */ jsx12(HardwareView, { session: props.session }),
|
|
3194
|
+
screen === "recommend" && /* @__PURE__ */ jsx12(RecommendView, { session: props.session }),
|
|
3195
|
+
screen === "setup" && /* @__PURE__ */ jsx12(SetupView, { session: props.session }),
|
|
3196
|
+
screen === "compare" && /* @__PURE__ */ jsx12(CompareView, { session: props.session }),
|
|
3197
|
+
screen === "history" && /* @__PURE__ */ jsx12(HistoryView, { session: props.session }),
|
|
3198
|
+
screen === "tasks" && /* @__PURE__ */ jsx12(TasksView, { session: props.session }),
|
|
3199
|
+
screen === "benchmark" && /* @__PURE__ */ jsx12(
|
|
3174
3200
|
BenchmarkView,
|
|
3175
3201
|
{
|
|
3176
3202
|
session: props.session,
|
|
@@ -3185,9 +3211,9 @@ function App(props) {
|
|
|
3185
3211
|
}
|
|
3186
3212
|
|
|
3187
3213
|
// src/tui/render.tsx
|
|
3188
|
-
import { jsx as
|
|
3214
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
3189
3215
|
async function renderDashboard(session, preset, start) {
|
|
3190
|
-
const instance = render(/* @__PURE__ */
|
|
3216
|
+
const instance = render(/* @__PURE__ */ jsx13(App, { session, preset, start }));
|
|
3191
3217
|
await instance.waitUntilExit();
|
|
3192
3218
|
}
|
|
3193
3219
|
|