@krtclcdy/tersio 2.22.0 → 2.23.0
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/README.md +38 -30
- package/cli/common.js +43 -39
- package/cli/currency.js +2 -2
- package/cli/dashboard.js +60 -116
- package/cli/doctor-fix.js +35 -29
- package/cli/doctor.js +26 -15
- package/cli/install.js +15 -34
- package/cli/profile.js +2 -1
- package/cli/settings.js +6 -6
- package/cli/update.js +12 -11
- package/cli/usage.js +6 -1
- package/dashboard/dist/index.html +65 -0
- package/extensions/ai-addons-updater/index.js +7 -3
- package/extensions/ai-addons-updater/index.ts +15 -3
- package/extensions/caveman-session/index.js +17 -12
- package/extensions/caveman-session/index.ts +17 -12
- package/extensions/caveman-session/rule.md +90 -0
- package/extensions/combo-toggle/index.js +22 -2
- package/extensions/combo-toggle/index.ts +26 -2
- package/extensions/lib/utils.js +20 -4
- package/extensions/lib/utils.ts +18 -4
- package/extensions/rtk-session/index.js +11 -10
- package/extensions/rtk-session/index.ts +10 -11
- package/extensions/shared/plugin-settings.js +37 -3
- package/extensions/shared/plugin-settings.ts +34 -3
- package/extensions/shared/rtk-gain.js +2 -2
- package/extensions/shared/rtk-gain.ts +3 -3
- package/extensions/shared/session-state.js +5 -3
- package/extensions/shared/session-state.ts +4 -3
- package/extensions/shared/types.ts +5 -0
- package/extensions/shared/usage-ledger.js +114 -4
- package/extensions/shared/usage-ledger.ts +122 -4
- package/extensions/tersio-commands/index.js +10 -13
- package/extensions/tersio-commands/index.ts +10 -13
- package/package.json +21 -12
- package/tersio.js +10 -10
- package/dashboard/charts.js +0 -1208
- package/dashboard/core.js +0 -357
- package/dashboard/settings.js +0 -166
- package/dashboard/share.js +0 -218
- package/dashboard/styles.css +0 -379
- package/dashboard/template.html +0 -515
- package/extensions/shared/mode-reinforcement.ts +0 -29
- package/gain/dist/brand.webp +0 -0
- package/gain/dist/index.html +0 -65
- package/gain/dist/vite.svg +0 -1
- /package/dashboard/{brand.webp → dist/brand.webp} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// /tersio root command — status, check, update,
|
|
1
|
+
// /tersio root command — status, check, update, dashboard, usage, help.
|
|
2
2
|
// Mode switches live on their own commands (/caveman, /rtk, /combo, and the
|
|
3
3
|
// upstream /ponytail): the router keeps no redundant copies. Shared-state
|
|
4
4
|
// publishes sync sibling mirrors live, so switches notify and take effect
|
|
@@ -18,7 +18,7 @@ const HELP = [
|
|
|
18
18
|
'/tersio status — active modes + combo level',
|
|
19
19
|
'/tersio check — add-on version check',
|
|
20
20
|
'/tersio update <ponytail|rtk|caveman|all> [--dry-run]',
|
|
21
|
-
'/tersio
|
|
21
|
+
'/tersio dashboard — open the Dashboard',
|
|
22
22
|
'/tersio usage — ledger report for this machine',
|
|
23
23
|
'/tersio help — this table',
|
|
24
24
|
'mode switches: /caveman /rtk /combo (tersio) + /ponytail (upstream)',
|
|
@@ -40,19 +40,16 @@ function usageSummary(): string {
|
|
|
40
40
|
return `tersio usage: ${rows.length} rows (${parts.join(', ')}), last write ${last}.`;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
// the shell command when export or open fails.
|
|
46
|
-
async function openGainDashboard(pi: ExtensionApi, ctx?: ExtensionCtx): Promise<void> {
|
|
47
|
-
const file = path.join(os.tmpdir(), `tersio-gain-${Date.now()}.html`);
|
|
43
|
+
async function openDashboard(pi: ExtensionApi, ctx?: ExtensionCtx): Promise<void> {
|
|
44
|
+
const file = path.join(os.tmpdir(), `tersio-dashboard-${Date.now()}.html`);
|
|
48
45
|
try {
|
|
49
|
-
const exported = await pi.exec?.('tersio', ['
|
|
46
|
+
const exported = await pi.exec?.('tersio', ['dashboard', '--export', file], { cwd: ctx?.cwd });
|
|
50
47
|
if (!exported || exported.code !== 0) throw new Error((exported?.stderr || 'export failed').trim());
|
|
51
48
|
const openCmd = process.platform === 'darwin' ? 'open' : process.platform === 'win32' ? 'start' : 'xdg-open';
|
|
52
49
|
await pi.exec?.(openCmd, [file], { cwd: ctx?.cwd });
|
|
53
|
-
ctx?.ui?.notify?.(`tersio
|
|
50
|
+
ctx?.ui?.notify?.(`tersio dashboard: opened in your browser.`, 'info');
|
|
54
51
|
} catch (e) {
|
|
55
|
-
ctx?.ui?.notify?.(`tersio
|
|
52
|
+
ctx?.ui?.notify?.(`tersio dashboard: could not open (${(e as Error).message}). Run 'tersio dashboard --open' in a shell.`, 'warning');
|
|
56
53
|
}
|
|
57
54
|
}
|
|
58
55
|
|
|
@@ -61,7 +58,7 @@ export default function tersioCommandsExtension(pi: ExtensionApi): void {
|
|
|
61
58
|
|
|
62
59
|
|
|
63
60
|
pi.registerCommand?.('tersio', {
|
|
64
|
-
description: 'Tersio root: status|check|update|
|
|
61
|
+
description: 'Tersio root: status|check|update|dashboard|usage|help',
|
|
65
62
|
handler: async (args, ctx) => {
|
|
66
63
|
const parts = String(args || '').trim().toLowerCase().split(/\s+/).filter(Boolean);
|
|
67
64
|
const [sub] = [parts[0]];
|
|
@@ -90,8 +87,8 @@ export default function tersioCommandsExtension(pi: ExtensionApi): void {
|
|
|
90
87
|
await runAddonUpdate(pi, ctx, target, dryRun);
|
|
91
88
|
return;
|
|
92
89
|
}
|
|
93
|
-
if (sub === '
|
|
94
|
-
await
|
|
90
|
+
if (sub === 'dashboard') {
|
|
91
|
+
await openDashboard(pi, ctx);
|
|
95
92
|
return;
|
|
96
93
|
}
|
|
97
94
|
if (sub === 'usage') {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@krtclcdy/tersio",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.23.0",
|
|
4
4
|
"description": "✂️ Token-saving OMP add-ons: terse Caveman replies, compact RTK shell output, lean Ponytail code calls — one-command combo presets.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"omp",
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
"./extensions/caveman-session/index.ts",
|
|
30
30
|
"./extensions/rtk-session/index.ts",
|
|
31
31
|
"./extensions/combo-toggle/index.ts",
|
|
32
|
-
"./extensions/shared/mode-reinforcement.ts",
|
|
33
32
|
"./extensions/tersio-commands/index.ts"
|
|
34
33
|
],
|
|
35
34
|
"skills": [
|
|
@@ -56,6 +55,11 @@
|
|
|
56
55
|
],
|
|
57
56
|
"default": "off"
|
|
58
57
|
},
|
|
58
|
+
"comboSetupComplete": {
|
|
59
|
+
"type": "boolean",
|
|
60
|
+
"description": "Whether the first interactive OMP launch has completed the Combo preset prompt",
|
|
61
|
+
"default": false
|
|
62
|
+
},
|
|
59
63
|
"cavemanDefault": {
|
|
60
64
|
"type": "enum",
|
|
61
65
|
"description": "Session-start default (no saved state)",
|
|
@@ -64,7 +68,9 @@
|
|
|
64
68
|
"lite",
|
|
65
69
|
"full",
|
|
66
70
|
"ultra",
|
|
67
|
-
"wenyan"
|
|
71
|
+
"wenyan-lite",
|
|
72
|
+
"wenyan-full",
|
|
73
|
+
"wenyan-ultra"
|
|
68
74
|
],
|
|
69
75
|
"default": "off"
|
|
70
76
|
},
|
|
@@ -80,14 +86,13 @@
|
|
|
80
86
|
"off",
|
|
81
87
|
"lite",
|
|
82
88
|
"full",
|
|
83
|
-
"ultra"
|
|
84
|
-
"review"
|
|
89
|
+
"ultra"
|
|
85
90
|
],
|
|
86
91
|
"default": "off"
|
|
87
92
|
},
|
|
88
93
|
"currency": {
|
|
89
94
|
"type": "enum",
|
|
90
|
-
"description": "Display currency for usage/
|
|
95
|
+
"description": "Display currency for usage/dashboard reports (--currency overrides per run)",
|
|
91
96
|
"values": [
|
|
92
97
|
"USD",
|
|
93
98
|
"PHP",
|
|
@@ -107,19 +112,22 @@
|
|
|
107
112
|
"files": [
|
|
108
113
|
"tersio.js",
|
|
109
114
|
"cli/**/*.js",
|
|
110
|
-
"dashboard/**/*",
|
|
111
|
-
"gain/dist/**/*",
|
|
115
|
+
"dashboard/dist/**/*",
|
|
112
116
|
"extensions/**/*.js",
|
|
113
|
-
"extensions/**/*.ts"
|
|
117
|
+
"extensions/**/*.ts",
|
|
118
|
+
"extensions/caveman-session/rule.md"
|
|
114
119
|
],
|
|
115
120
|
"scripts": {
|
|
116
|
-
"clean": "rm -f tersio.js cli/*.js extensions/**/*.js && rm -rf
|
|
117
|
-
"build": "tsc && bun run build:
|
|
118
|
-
"build:
|
|
121
|
+
"clean": "rm -f tersio.js cli/*.js extensions/**/*.js && rm -rf dashboard/dist",
|
|
122
|
+
"build": "tsc && bun run build:dashboard",
|
|
123
|
+
"build:dashboard": "bun install --cwd dashboard/app --frozen-lockfile && bun run --cwd dashboard/app build",
|
|
119
124
|
"prepublishOnly": "bun run build",
|
|
120
125
|
"check": "tsc --noEmit",
|
|
121
126
|
"doctor": "node tersio.js --doctor",
|
|
122
127
|
"dry-run": "node tersio.js --dry-run --scope user --yes",
|
|
128
|
+
"lint": "oxlint cli extensions test tersio.ts",
|
|
129
|
+
"lint:dashboard": "bun run --cwd dashboard/app lint",
|
|
130
|
+
"lint:fix": "oxlint cli extensions test tersio.ts --fix",
|
|
123
131
|
"test": "vitest run"
|
|
124
132
|
},
|
|
125
133
|
"engines": {
|
|
@@ -127,6 +135,7 @@
|
|
|
127
135
|
},
|
|
128
136
|
"devDependencies": {
|
|
129
137
|
"@types/node": "^26.4.1",
|
|
138
|
+
"oxlint": "^1.85.0",
|
|
130
139
|
"typescript": "^7.0.2",
|
|
131
140
|
"vitest": "^5.0.1"
|
|
132
141
|
},
|
package/tersio.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// tersio.ts — Install Tersio (caveman/rtk/ponytail) add-ons on any OMP device.
|
|
3
|
-
// Usage: node tersio.js [install|update|reinstall|doctor|uninstall|version|help] [options]
|
|
3
|
+
// Usage: node tersio.js [install|update|reinstall|doctor|dashboard|uninstall|version|help] [options]
|
|
4
4
|
// Requires: node/npm and omp CLI
|
|
5
|
-
import { PACKAGE_BIN, PACKAGE_VERSION, applyUpdate, commandArg,
|
|
5
|
+
import { PACKAGE_BIN, PACKAGE_VERSION, applyUpdate, commandArg, dashboard, dashboardExport, dashboardOpen, dashboardPort, doctor, reset, settings, showHelp, showVersion, uninstall, unknownCommand, update, usage, } from './cli/common.js';
|
|
6
6
|
import { closeRL } from './cli/interactive.js';
|
|
7
7
|
import { runInstall } from './cli/install.js';
|
|
8
8
|
import { runDoctor } from './cli/doctor.js';
|
|
@@ -21,7 +21,7 @@ Commands:
|
|
|
21
21
|
reinstall Clean and reinstall the user-scope add-ons
|
|
22
22
|
doctor Check the current installation (--fix repairs, --dry-run previews)
|
|
23
23
|
usage Ledger-backed usage + savings report
|
|
24
|
-
|
|
24
|
+
dashboard Open the Dashboard (localhost only)
|
|
25
25
|
reset Clear tersio statistics (usage ledger)
|
|
26
26
|
settings View/change session-start defaults (combo, caveman, rtk, ponytail)
|
|
27
27
|
uninstall Remove the managed extensions
|
|
@@ -34,16 +34,16 @@ Options:
|
|
|
34
34
|
--keep-ponytail (uninstall: keep the bundled Ponytail copy — removed by default)
|
|
35
35
|
--remove-rtk (uninstall: also remove the RTK binary)
|
|
36
36
|
--combo-default off|medium|balanced|max (implies caveman, rtk, ponytail)
|
|
37
|
-
--caveman-default off|lite|full|ultra|wenyan (override; default follows combo)
|
|
38
|
-
--ponytail-default off|lite|full|ultra
|
|
37
|
+
--caveman-default off|lite|full|ultra|wenyan-lite|wenyan-full|wenyan-ultra (override; default follows combo)
|
|
38
|
+
--ponytail-default off|lite|full|ultra (override; default follows combo)
|
|
39
39
|
--rtk-default on|off (override; default follows combo)
|
|
40
40
|
--yes, -y
|
|
41
41
|
--dry-run
|
|
42
42
|
--verbose
|
|
43
|
-
--port <n> (
|
|
44
|
-
--open (
|
|
45
|
-
--export <file> (
|
|
46
|
-
--currency <code> (usage|
|
|
43
|
+
--port <n> (dashboard: pin port, default ephemeral)
|
|
44
|
+
--open (dashboard: open browser)
|
|
45
|
+
--export <file> (dashboard: write HTML file instead of serving)
|
|
46
|
+
--currency <code> (usage|dashboard: display currency; flag wins, then tersio settings default, then USD)
|
|
47
47
|
--version, -v
|
|
48
48
|
--help, -h`);
|
|
49
49
|
}
|
|
@@ -80,7 +80,7 @@ async function main() {
|
|
|
80
80
|
closeRL();
|
|
81
81
|
return;
|
|
82
82
|
}
|
|
83
|
-
if (
|
|
83
|
+
if (dashboard) {
|
|
84
84
|
await runDashboard({ port: dashboardPort, open: dashboardOpen, exportFile: dashboardExport });
|
|
85
85
|
closeRL();
|
|
86
86
|
return;
|