@bytevion/cli 0.3.0 → 0.4.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.
- package/bin/postinstall.js +58 -0
- package/dist/commands/providers/add.js +10 -2
- package/dist/commands/run.js +1 -1
- package/dist/commands/setup.d.ts +1 -0
- package/dist/commands/setup.js +96 -1
- package/dist/hooks/init/home.js +24 -0
- package/dist/lib/api.d.ts +1 -0
- package/dist/lib/api.js +6 -0
- package/dist/lib/tui.d.ts +105 -0
- package/dist/lib/tui.gate.test.d.ts +1 -0
- package/dist/lib/tui.gate.test.js +96 -0
- package/dist/lib/tui.js +62 -0
- package/dist/tui/__tests__/home.render.test.d.ts +1 -0
- package/dist/tui/__tests__/home.render.test.js +59 -0
- package/dist/tui/__tests__/state.test.d.ts +1 -0
- package/dist/tui/__tests__/state.test.js +88 -0
- package/dist/tui/components/App.d.ts +7 -0
- package/dist/tui/components/App.js +129 -0
- package/dist/tui/components/Brand.d.ts +9 -0
- package/dist/tui/components/Brand.js +13 -0
- package/dist/tui/components/Card.d.ts +11 -0
- package/dist/tui/components/Card.js +12 -0
- package/dist/tui/components/DoneScreen.d.ts +11 -0
- package/dist/tui/components/DoneScreen.js +30 -0
- package/dist/tui/components/Home.d.ts +12 -0
- package/dist/tui/components/Home.js +144 -0
- package/dist/tui/components/KeyStep.d.ts +13 -0
- package/dist/tui/components/KeyStep.js +44 -0
- package/dist/tui/components/Panel.d.ts +11 -0
- package/dist/tui/components/Panel.js +12 -0
- package/dist/tui/components/Picker.d.ts +19 -0
- package/dist/tui/components/Picker.js +68 -0
- package/dist/tui/components/PresetStep.d.ts +12 -0
- package/dist/tui/components/PresetStep.js +26 -0
- package/dist/tui/components/ProviderStep.d.ts +20 -0
- package/dist/tui/components/ProviderStep.js +159 -0
- package/dist/tui/components/Stepper.d.ts +9 -0
- package/dist/tui/components/Stepper.js +29 -0
- package/dist/tui/contract.d.ts +99 -0
- package/dist/tui/contract.js +5 -0
- package/dist/tui/index.d.ts +3 -0
- package/dist/tui/index.js +78 -0
- package/dist/tui/package.json +1 -0
- package/dist/tui/state.d.ts +77 -0
- package/dist/tui/state.js +84 -0
- package/dist/tui/theme.d.ts +23 -0
- package/dist/tui/theme.js +49 -0
- package/oclif.manifest.json +104 -104
- package/package.json +16 -4
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// Pure wizard state machine. No react, no ink, no Date.now / Math.random — every transition
|
|
2
|
+
// is a deterministic function of (state, action) so the whole flow is unit-testable without a
|
|
3
|
+
// terminal. The App component owns the side effects (calling ports) and dispatches results
|
|
4
|
+
// back in here. Errors are NON-FATAL: an ERROR action records what broke and keeps the current
|
|
5
|
+
// step mounted so the user can retry, never unwinding the wizard.
|
|
6
|
+
export const STEPS = ['welcome', 'signin', 'provider', 'model', 'key', 'preset', 'integrate', 'done'];
|
|
7
|
+
export function initialState(initial) {
|
|
8
|
+
return {
|
|
9
|
+
step: 'welcome',
|
|
10
|
+
busy: false,
|
|
11
|
+
signedIn: initial.signedIn,
|
|
12
|
+
email: initial.email,
|
|
13
|
+
providerStatus: 'pending',
|
|
14
|
+
models: [],
|
|
15
|
+
preset: 'maximum',
|
|
16
|
+
byteKey: initial.byteKey,
|
|
17
|
+
byteKeyRevealed: false,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function advance(step) {
|
|
21
|
+
const i = STEPS.indexOf(step);
|
|
22
|
+
return i >= 0 && i < STEPS.length - 1 ? STEPS[i + 1] : step;
|
|
23
|
+
}
|
|
24
|
+
export function reducer(state, action) {
|
|
25
|
+
switch (action.type) {
|
|
26
|
+
case 'BUSY':
|
|
27
|
+
return { ...state, busy: action.busy };
|
|
28
|
+
// Non-fatal: surface the message, drop the busy flag, stay on the same step.
|
|
29
|
+
case 'ERROR':
|
|
30
|
+
return { ...state, busy: false, error: { from: action.from, message: action.message } };
|
|
31
|
+
case 'CLEAR_ERROR':
|
|
32
|
+
return { ...state, error: undefined };
|
|
33
|
+
case 'NEXT':
|
|
34
|
+
return { ...state, step: advance(state.step), error: undefined };
|
|
35
|
+
case 'GOTO':
|
|
36
|
+
return { ...state, step: action.step, error: undefined };
|
|
37
|
+
case 'SIGNED_IN':
|
|
38
|
+
return { ...state, busy: false, signedIn: true, email: action.email ?? state.email, error: undefined, step: 'provider' };
|
|
39
|
+
case 'PICK_PROVIDER':
|
|
40
|
+
return { ...state, providerChoice: action.id, baseUrl: action.baseUrl, error: undefined };
|
|
41
|
+
case 'PROVIDER_RESULT': {
|
|
42
|
+
const models = action.models ?? [];
|
|
43
|
+
// Connected with models → go pick one. Saved/connected without models → skip the model
|
|
44
|
+
// step and move on; the summary will say "saved" so we never over-claim success.
|
|
45
|
+
const next = action.status === 'connected' && models.length ? 'model' : 'key';
|
|
46
|
+
return {
|
|
47
|
+
...state,
|
|
48
|
+
busy: false,
|
|
49
|
+
error: undefined,
|
|
50
|
+
providerStatus: action.status,
|
|
51
|
+
models,
|
|
52
|
+
connId: action.connId,
|
|
53
|
+
step: next,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
case 'PROVIDER_SKIP':
|
|
57
|
+
return { ...state, busy: false, error: undefined, providerStatus: 'skipped', models: [], step: 'key' };
|
|
58
|
+
// Stay on the provider step so the key entry remounts for another attempt.
|
|
59
|
+
case 'PROVIDER_RETRY':
|
|
60
|
+
return { ...state, busy: false, error: undefined, providerStatus: 'pending', step: 'provider' };
|
|
61
|
+
case 'PICK_MODEL':
|
|
62
|
+
return { ...state, model: action.model, error: undefined, step: 'key' };
|
|
63
|
+
case 'KEY_CREATED':
|
|
64
|
+
return { ...state, busy: false, byteKey: action.key, byteKeyRevealed: true, error: undefined };
|
|
65
|
+
case 'REVEAL_KEY':
|
|
66
|
+
return { ...state, byteKeyRevealed: true };
|
|
67
|
+
case 'PICK_PRESET':
|
|
68
|
+
return { ...state, preset: action.preset, error: undefined, step: 'integrate' };
|
|
69
|
+
case 'PICK_CONNECT':
|
|
70
|
+
return { ...state, connect: action.connect, error: undefined, step: 'done' };
|
|
71
|
+
default:
|
|
72
|
+
return state;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
export function selectSummary(state) {
|
|
76
|
+
const provider = state.providerStatus === 'pending' ? 'skipped' : state.providerStatus;
|
|
77
|
+
return {
|
|
78
|
+
model: state.model,
|
|
79
|
+
provider,
|
|
80
|
+
preset: state.preset,
|
|
81
|
+
byteKeyCreated: Boolean(state.byteKey),
|
|
82
|
+
connect: state.connect && state.connect !== 'skip' ? state.connect : undefined,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare function hex(t: number): string;
|
|
2
|
+
export declare function gradient(count: number): string[];
|
|
3
|
+
export interface Glyphs {
|
|
4
|
+
filled: string;
|
|
5
|
+
check: string;
|
|
6
|
+
empty: string;
|
|
7
|
+
arrow: string;
|
|
8
|
+
bullet: string;
|
|
9
|
+
border: 'round' | 'classic';
|
|
10
|
+
spark: string[];
|
|
11
|
+
brand: string[];
|
|
12
|
+
divider: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function glyphs(ascii: boolean): Glyphs;
|
|
15
|
+
export interface Tone {
|
|
16
|
+
accent: string | undefined;
|
|
17
|
+
ok: string | undefined;
|
|
18
|
+
warn: string | undefined;
|
|
19
|
+
bad: string | undefined;
|
|
20
|
+
muted: string | undefined;
|
|
21
|
+
brandMid: string | undefined;
|
|
22
|
+
}
|
|
23
|
+
export declare function tones(plainColor: boolean): Tone;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Byte's terminal palette. The signature is a cyan→blue per-character gradient (no library
|
|
2
|
+
// does true gradients in a terminal, so we interpolate the RGB ramp ourselves and hand Ink a
|
|
3
|
+
// hex per glyph). Everything degrades cleanly: under plainColor the colors collapse to a
|
|
4
|
+
// single accent, under ascii the unicode glyph sets swap for 7-bit equivalents.
|
|
5
|
+
const A = [0x22, 0xd3, 0xee]; // cyan-300 #22d3ee
|
|
6
|
+
const B = [0x3b, 0x82, 0xf6]; // blue-500 #3b82f6
|
|
7
|
+
// Interpolate a single channel/color t∈[0,1] across the cyan→blue ramp → "#rrggbb".
|
|
8
|
+
export function hex(t) {
|
|
9
|
+
const clamped = t < 0 ? 0 : t > 1 ? 1 : t;
|
|
10
|
+
return ('#' +
|
|
11
|
+
A.map((a, i) => Math.round(a + (B[i] - a) * clamped).toString(16).padStart(2, '0')).join(''));
|
|
12
|
+
}
|
|
13
|
+
// Spread N glyphs evenly across the gradient. A single glyph sits at the cyan end.
|
|
14
|
+
export function gradient(count) {
|
|
15
|
+
if (count <= 1)
|
|
16
|
+
return [hex(0)];
|
|
17
|
+
return Array.from({ length: count }, (_, i) => hex(i / (count - 1)));
|
|
18
|
+
}
|
|
19
|
+
const UNICODE = {
|
|
20
|
+
filled: '●',
|
|
21
|
+
check: '✓',
|
|
22
|
+
empty: '○',
|
|
23
|
+
arrow: '›',
|
|
24
|
+
bullet: '•',
|
|
25
|
+
border: 'round',
|
|
26
|
+
spark: ['▁', '▂', '▃', '▄', '▅', '▆', '▇', '█'],
|
|
27
|
+
brand: ['›', 'b', '_'],
|
|
28
|
+
divider: '─',
|
|
29
|
+
};
|
|
30
|
+
const ASCII = {
|
|
31
|
+
filled: '[*]',
|
|
32
|
+
check: '[x]',
|
|
33
|
+
empty: '[ ]',
|
|
34
|
+
arrow: '>',
|
|
35
|
+
bullet: '-',
|
|
36
|
+
border: 'classic',
|
|
37
|
+
spark: ['.', ':', '-', '=', '+', '*', '#'],
|
|
38
|
+
brand: ['>', 'b', '_'],
|
|
39
|
+
divider: '-',
|
|
40
|
+
};
|
|
41
|
+
export function glyphs(ascii) {
|
|
42
|
+
return ascii ? ASCII : UNICODE;
|
|
43
|
+
}
|
|
44
|
+
export function tones(plainColor) {
|
|
45
|
+
if (plainColor) {
|
|
46
|
+
return { accent: undefined, ok: undefined, warn: undefined, bad: undefined, muted: 'gray', brandMid: undefined };
|
|
47
|
+
}
|
|
48
|
+
return { accent: 'cyan', ok: 'green', warn: 'yellow', bad: 'red', muted: 'gray', brandMid: hex(0.5) };
|
|
49
|
+
}
|
package/oclif.manifest.json
CHANGED
|
@@ -514,9 +514,9 @@
|
|
|
514
514
|
"type": "option"
|
|
515
515
|
},
|
|
516
516
|
"model": {
|
|
517
|
-
"description": "Model or Byte alias",
|
|
517
|
+
"description": "Model or Byte alias (default: auto — routes to your enabled model)",
|
|
518
518
|
"name": "model",
|
|
519
|
-
"default": "
|
|
519
|
+
"default": "auto",
|
|
520
520
|
"hasDynamicHelp": false,
|
|
521
521
|
"multiple": false,
|
|
522
522
|
"type": "option"
|
|
@@ -1199,23 +1199,10 @@
|
|
|
1199
1199
|
"rotate.js"
|
|
1200
1200
|
]
|
|
1201
1201
|
},
|
|
1202
|
-
"
|
|
1202
|
+
"sessions": {
|
|
1203
1203
|
"aliases": [],
|
|
1204
|
-
"args": {
|
|
1205
|
-
|
|
1206
|
-
"description": "Mode to apply",
|
|
1207
|
-
"name": "preset",
|
|
1208
|
-
"options": [
|
|
1209
|
-
"maximum",
|
|
1210
|
-
"max_savings",
|
|
1211
|
-
"balanced",
|
|
1212
|
-
"lowest_latency",
|
|
1213
|
-
"reliability_first"
|
|
1214
|
-
],
|
|
1215
|
-
"required": true
|
|
1216
|
-
}
|
|
1217
|
-
},
|
|
1218
|
-
"description": "Apply an optimization mode for the whole org (maximum, balanced, max_savings, lowest_latency, reliability_first).",
|
|
1204
|
+
"args": {},
|
|
1205
|
+
"description": "List active terminal sessions (CLI tokens) for the org.",
|
|
1219
1206
|
"flags": {
|
|
1220
1207
|
"json": {
|
|
1221
1208
|
"description": "Format output as json.",
|
|
@@ -1243,7 +1230,7 @@
|
|
|
1243
1230
|
},
|
|
1244
1231
|
"hasDynamicHelp": false,
|
|
1245
1232
|
"hiddenAliases": [],
|
|
1246
|
-
"id": "
|
|
1233
|
+
"id": "sessions",
|
|
1247
1234
|
"pluginAlias": "@bytevion/cli",
|
|
1248
1235
|
"pluginName": "@bytevion/cli",
|
|
1249
1236
|
"pluginType": "core",
|
|
@@ -1253,80 +1240,20 @@
|
|
|
1253
1240
|
"relativePath": [
|
|
1254
1241
|
"dist",
|
|
1255
1242
|
"commands",
|
|
1256
|
-
"
|
|
1257
|
-
"
|
|
1243
|
+
"sessions",
|
|
1244
|
+
"index.js"
|
|
1258
1245
|
]
|
|
1259
1246
|
},
|
|
1260
|
-
"
|
|
1247
|
+
"sessions:revoke": {
|
|
1261
1248
|
"aliases": [],
|
|
1262
1249
|
"args": {
|
|
1263
|
-
"
|
|
1264
|
-
"description": "
|
|
1265
|
-
"name": "
|
|
1266
|
-
"required": true
|
|
1267
|
-
},
|
|
1268
|
-
"value": {
|
|
1269
|
-
"description": "on or off",
|
|
1270
|
-
"name": "value",
|
|
1271
|
-
"options": [
|
|
1272
|
-
"on",
|
|
1273
|
-
"off",
|
|
1274
|
-
"true",
|
|
1275
|
-
"false"
|
|
1276
|
-
],
|
|
1250
|
+
"id": {
|
|
1251
|
+
"description": "Session id (see `byte sessions`)",
|
|
1252
|
+
"name": "id",
|
|
1277
1253
|
"required": true
|
|
1278
1254
|
}
|
|
1279
1255
|
},
|
|
1280
|
-
"description": "
|
|
1281
|
-
"examples": [
|
|
1282
|
-
"<%= config.bin %> opt set compression_enabled off",
|
|
1283
|
-
"<%= config.bin %> opt set response_cache_enabled on"
|
|
1284
|
-
],
|
|
1285
|
-
"flags": {
|
|
1286
|
-
"json": {
|
|
1287
|
-
"description": "Format output as json.",
|
|
1288
|
-
"helpGroup": "GLOBAL",
|
|
1289
|
-
"name": "json",
|
|
1290
|
-
"allowNo": false,
|
|
1291
|
-
"type": "boolean"
|
|
1292
|
-
},
|
|
1293
|
-
"profile": {
|
|
1294
|
-
"description": "Configuration profile to use",
|
|
1295
|
-
"env": "BYTE_PROFILE",
|
|
1296
|
-
"name": "profile",
|
|
1297
|
-
"hasDynamicHelp": false,
|
|
1298
|
-
"multiple": false,
|
|
1299
|
-
"type": "option"
|
|
1300
|
-
},
|
|
1301
|
-
"base-url": {
|
|
1302
|
-
"description": "Override the API base URL",
|
|
1303
|
-
"env": "BYTE_BASE_URL",
|
|
1304
|
-
"name": "base-url",
|
|
1305
|
-
"hasDynamicHelp": false,
|
|
1306
|
-
"multiple": false,
|
|
1307
|
-
"type": "option"
|
|
1308
|
-
}
|
|
1309
|
-
},
|
|
1310
|
-
"hasDynamicHelp": false,
|
|
1311
|
-
"hiddenAliases": [],
|
|
1312
|
-
"id": "opt:set",
|
|
1313
|
-
"pluginAlias": "@bytevion/cli",
|
|
1314
|
-
"pluginName": "@bytevion/cli",
|
|
1315
|
-
"pluginType": "core",
|
|
1316
|
-
"strict": true,
|
|
1317
|
-
"enableJsonFlag": true,
|
|
1318
|
-
"isESM": false,
|
|
1319
|
-
"relativePath": [
|
|
1320
|
-
"dist",
|
|
1321
|
-
"commands",
|
|
1322
|
-
"opt",
|
|
1323
|
-
"set.js"
|
|
1324
|
-
]
|
|
1325
|
-
},
|
|
1326
|
-
"opt:show": {
|
|
1327
|
-
"aliases": [],
|
|
1328
|
-
"args": {},
|
|
1329
|
-
"description": "Show the current optimization mode and every layer running on your requests.",
|
|
1256
|
+
"description": "Revoke a terminal session (CLI token) by id.",
|
|
1330
1257
|
"flags": {
|
|
1331
1258
|
"json": {
|
|
1332
1259
|
"description": "Format output as json.",
|
|
@@ -1354,7 +1281,7 @@
|
|
|
1354
1281
|
},
|
|
1355
1282
|
"hasDynamicHelp": false,
|
|
1356
1283
|
"hiddenAliases": [],
|
|
1357
|
-
"id": "
|
|
1284
|
+
"id": "sessions:revoke",
|
|
1358
1285
|
"pluginAlias": "@bytevion/cli",
|
|
1359
1286
|
"pluginName": "@bytevion/cli",
|
|
1360
1287
|
"pluginType": "core",
|
|
@@ -1364,8 +1291,8 @@
|
|
|
1364
1291
|
"relativePath": [
|
|
1365
1292
|
"dist",
|
|
1366
1293
|
"commands",
|
|
1367
|
-
"
|
|
1368
|
-
"
|
|
1294
|
+
"sessions",
|
|
1295
|
+
"revoke.js"
|
|
1369
1296
|
]
|
|
1370
1297
|
},
|
|
1371
1298
|
"providers:add": {
|
|
@@ -1614,10 +1541,23 @@
|
|
|
1614
1541
|
"test.js"
|
|
1615
1542
|
]
|
|
1616
1543
|
},
|
|
1617
|
-
"
|
|
1544
|
+
"opt:preset": {
|
|
1618
1545
|
"aliases": [],
|
|
1619
|
-
"args": {
|
|
1620
|
-
|
|
1546
|
+
"args": {
|
|
1547
|
+
"preset": {
|
|
1548
|
+
"description": "Mode to apply",
|
|
1549
|
+
"name": "preset",
|
|
1550
|
+
"options": [
|
|
1551
|
+
"maximum",
|
|
1552
|
+
"max_savings",
|
|
1553
|
+
"balanced",
|
|
1554
|
+
"lowest_latency",
|
|
1555
|
+
"reliability_first"
|
|
1556
|
+
],
|
|
1557
|
+
"required": true
|
|
1558
|
+
}
|
|
1559
|
+
},
|
|
1560
|
+
"description": "Apply an optimization mode for the whole org (maximum, balanced, max_savings, lowest_latency, reliability_first).",
|
|
1621
1561
|
"flags": {
|
|
1622
1562
|
"json": {
|
|
1623
1563
|
"description": "Format output as json.",
|
|
@@ -1645,7 +1585,7 @@
|
|
|
1645
1585
|
},
|
|
1646
1586
|
"hasDynamicHelp": false,
|
|
1647
1587
|
"hiddenAliases": [],
|
|
1648
|
-
"id": "
|
|
1588
|
+
"id": "opt:preset",
|
|
1649
1589
|
"pluginAlias": "@bytevion/cli",
|
|
1650
1590
|
"pluginName": "@bytevion/cli",
|
|
1651
1591
|
"pluginType": "core",
|
|
@@ -1655,20 +1595,35 @@
|
|
|
1655
1595
|
"relativePath": [
|
|
1656
1596
|
"dist",
|
|
1657
1597
|
"commands",
|
|
1658
|
-
"
|
|
1659
|
-
"
|
|
1598
|
+
"opt",
|
|
1599
|
+
"preset.js"
|
|
1660
1600
|
]
|
|
1661
1601
|
},
|
|
1662
|
-
"
|
|
1602
|
+
"opt:set": {
|
|
1663
1603
|
"aliases": [],
|
|
1664
1604
|
"args": {
|
|
1665
|
-
"
|
|
1666
|
-
"description": "
|
|
1667
|
-
"name": "
|
|
1605
|
+
"flag": {
|
|
1606
|
+
"description": "Optimization field name",
|
|
1607
|
+
"name": "flag",
|
|
1608
|
+
"required": true
|
|
1609
|
+
},
|
|
1610
|
+
"value": {
|
|
1611
|
+
"description": "on or off",
|
|
1612
|
+
"name": "value",
|
|
1613
|
+
"options": [
|
|
1614
|
+
"on",
|
|
1615
|
+
"off",
|
|
1616
|
+
"true",
|
|
1617
|
+
"false"
|
|
1618
|
+
],
|
|
1668
1619
|
"required": true
|
|
1669
1620
|
}
|
|
1670
1621
|
},
|
|
1671
|
-
"description": "
|
|
1622
|
+
"description": "Toggle a single optimization layer on or off. See field names with `byte opt show --json`.",
|
|
1623
|
+
"examples": [
|
|
1624
|
+
"<%= config.bin %> opt set compression_enabled off",
|
|
1625
|
+
"<%= config.bin %> opt set response_cache_enabled on"
|
|
1626
|
+
],
|
|
1672
1627
|
"flags": {
|
|
1673
1628
|
"json": {
|
|
1674
1629
|
"description": "Format output as json.",
|
|
@@ -1696,7 +1651,7 @@
|
|
|
1696
1651
|
},
|
|
1697
1652
|
"hasDynamicHelp": false,
|
|
1698
1653
|
"hiddenAliases": [],
|
|
1699
|
-
"id": "
|
|
1654
|
+
"id": "opt:set",
|
|
1700
1655
|
"pluginAlias": "@bytevion/cli",
|
|
1701
1656
|
"pluginName": "@bytevion/cli",
|
|
1702
1657
|
"pluginType": "core",
|
|
@@ -1706,10 +1661,55 @@
|
|
|
1706
1661
|
"relativePath": [
|
|
1707
1662
|
"dist",
|
|
1708
1663
|
"commands",
|
|
1709
|
-
"
|
|
1710
|
-
"
|
|
1664
|
+
"opt",
|
|
1665
|
+
"set.js"
|
|
1666
|
+
]
|
|
1667
|
+
},
|
|
1668
|
+
"opt:show": {
|
|
1669
|
+
"aliases": [],
|
|
1670
|
+
"args": {},
|
|
1671
|
+
"description": "Show the current optimization mode and every layer running on your requests.",
|
|
1672
|
+
"flags": {
|
|
1673
|
+
"json": {
|
|
1674
|
+
"description": "Format output as json.",
|
|
1675
|
+
"helpGroup": "GLOBAL",
|
|
1676
|
+
"name": "json",
|
|
1677
|
+
"allowNo": false,
|
|
1678
|
+
"type": "boolean"
|
|
1679
|
+
},
|
|
1680
|
+
"profile": {
|
|
1681
|
+
"description": "Configuration profile to use",
|
|
1682
|
+
"env": "BYTE_PROFILE",
|
|
1683
|
+
"name": "profile",
|
|
1684
|
+
"hasDynamicHelp": false,
|
|
1685
|
+
"multiple": false,
|
|
1686
|
+
"type": "option"
|
|
1687
|
+
},
|
|
1688
|
+
"base-url": {
|
|
1689
|
+
"description": "Override the API base URL",
|
|
1690
|
+
"env": "BYTE_BASE_URL",
|
|
1691
|
+
"name": "base-url",
|
|
1692
|
+
"hasDynamicHelp": false,
|
|
1693
|
+
"multiple": false,
|
|
1694
|
+
"type": "option"
|
|
1695
|
+
}
|
|
1696
|
+
},
|
|
1697
|
+
"hasDynamicHelp": false,
|
|
1698
|
+
"hiddenAliases": [],
|
|
1699
|
+
"id": "opt:show",
|
|
1700
|
+
"pluginAlias": "@bytevion/cli",
|
|
1701
|
+
"pluginName": "@bytevion/cli",
|
|
1702
|
+
"pluginType": "core",
|
|
1703
|
+
"strict": true,
|
|
1704
|
+
"enableJsonFlag": true,
|
|
1705
|
+
"isESM": false,
|
|
1706
|
+
"relativePath": [
|
|
1707
|
+
"dist",
|
|
1708
|
+
"commands",
|
|
1709
|
+
"opt",
|
|
1710
|
+
"show.js"
|
|
1711
1711
|
]
|
|
1712
1712
|
}
|
|
1713
1713
|
},
|
|
1714
|
-
"version": "0.
|
|
1714
|
+
"version": "0.4.1"
|
|
1715
1715
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bytevion/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Byte — control your LLM optimization gateway from the terminal.",
|
|
5
5
|
"author": "Byte",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
10
10
|
"bin": {
|
|
11
|
-
"byte": "./bin/run.js"
|
|
11
|
+
"byte": "./bin/run.js",
|
|
12
|
+
"bytevion": "./bin/run.js"
|
|
12
13
|
},
|
|
13
14
|
"type": "commonjs",
|
|
14
15
|
"engines": {
|
|
@@ -23,11 +24,18 @@
|
|
|
23
24
|
"@clack/prompts": "^1.5.0",
|
|
24
25
|
"@oclif/core": "^4.0.0",
|
|
25
26
|
"cli-table3": "^0.6.5",
|
|
26
|
-
"
|
|
27
|
+
"ink": "^7.0.5",
|
|
28
|
+
"ink-spinner": "^5.0.0",
|
|
29
|
+
"ink-text-input": "^6.0.0",
|
|
30
|
+
"picocolors": "^1.1.1",
|
|
31
|
+
"react": "^19.2.6"
|
|
27
32
|
},
|
|
28
33
|
"devDependencies": {
|
|
29
34
|
"@types/node": "^22.0.0",
|
|
35
|
+
"@types/react": "^19.2.15",
|
|
36
|
+
"ink-testing-library": "^4.0.0",
|
|
30
37
|
"oclif": "^4.14.0",
|
|
38
|
+
"tsx": "^4.22.3",
|
|
31
39
|
"typescript": "^5.5.0"
|
|
32
40
|
},
|
|
33
41
|
"oclif": {
|
|
@@ -66,7 +74,11 @@
|
|
|
66
74
|
}
|
|
67
75
|
},
|
|
68
76
|
"scripts": {
|
|
69
|
-
"build": "tsc -b && oclif manifest",
|
|
77
|
+
"build": "tsc -b && node scripts/tui-pkg.js && oclif manifest",
|
|
78
|
+
"postinstall": "node ./bin/postinstall.js",
|
|
79
|
+
"test": "npm run build && npm run test:unit && npm run test:tui",
|
|
80
|
+
"test:unit": "tsx --test \"src/**/*.test.ts\" \"src/**/*.test.tsx\"",
|
|
81
|
+
"test:tui": "node --test \"src/**/*.test.mts\"",
|
|
70
82
|
"clean": "tsc -b --clean",
|
|
71
83
|
"prepublishOnly": "node -e \"const fs=require('fs');for(const f of (fs.existsSync('dist')?fs.readdirSync('dist'):[])){if(f.endsWith('.tar.gz')||f.endsWith('.tar.xz')||f.startsWith('SHA256SUMS'))fs.rmSync('dist/'+f,{force:true})}\"",
|
|
72
84
|
"prepack": "npm run build",
|