@krtclcdy/tersio 2.23.0 → 2.24.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 +58 -45
- package/cli/agent-hosts.js +42 -0
- package/cli/agents.js +266 -0
- package/cli/common.js +16 -20
- package/cli/currency.js +8 -12
- package/cli/dashboard.js +49 -37
- package/cli/doctor-fix.js +28 -17
- package/cli/doctor.js +52 -41
- package/cli/hosts.js +118 -0
- package/cli/install.js +180 -117
- package/cli/interactive.js +27 -1
- package/cli/layer.js +24 -0
- package/cli/manifest.js +36 -0
- package/cli/omp-layer.js +51 -0
- package/cli/pi-layer.js +37 -0
- package/cli/pi-wiring.js +92 -0
- package/cli/profile.js +44 -46
- package/cli/reset.js +3 -26
- package/cli/rtk-wiring.js +10 -15
- package/cli/uninstall.js +135 -44
- package/cli/update.js +12 -19
- package/dashboard/dist/index.html +16 -16
- package/extensions/ai-addons-updater/index.js +31 -24
- package/extensions/ai-addons-updater/index.ts +32 -32
- package/extensions/caveman-session/index.js +6 -6
- package/extensions/caveman-session/index.ts +6 -6
- package/extensions/combo-toggle/index.js +42 -40
- package/extensions/combo-toggle/index.ts +36 -47
- package/extensions/lib/utils.js +36 -9
- package/extensions/lib/utils.ts +37 -9
- package/extensions/rtk-session/index.js +9 -9
- package/extensions/rtk-session/index.ts +9 -14
- package/extensions/shared/carbon.js +5 -8
- package/extensions/shared/carbon.ts +5 -8
- package/extensions/shared/host.js +68 -0
- package/extensions/shared/host.ts +104 -0
- package/extensions/shared/omp-prompt.js +12 -0
- package/extensions/shared/plugin-settings.js +43 -30
- package/extensions/shared/plugin-settings.ts +45 -26
- package/extensions/shared/pricing.js +26 -15
- package/extensions/shared/pricing.ts +28 -16
- package/extensions/shared/rtk-gain.js +11 -22
- package/extensions/shared/rtk-gain.ts +11 -22
- package/extensions/shared/session-state.js +21 -25
- package/extensions/shared/session-state.ts +22 -26
- package/extensions/shared/types.ts +10 -3
- package/extensions/shared/usage-ledger.js +24 -36
- package/extensions/shared/usage-ledger.ts +29 -50
- package/extensions/shared/usage-store.js +14 -12
- package/extensions/shared/usage-store.ts +16 -14
- package/extensions/tersio-commands/index.js +2 -1
- package/extensions/tersio-commands/index.ts +2 -1
- package/package.json +4 -2
- package/tersio.js +4 -4
- package/extensions/shared/mode-reinforcement.js +0 -26
package/cli/update.js
CHANGED
|
@@ -34,10 +34,8 @@ async function latestPublishedVersion() {
|
|
|
34
34
|
return null;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
//
|
|
38
|
-
//
|
|
39
|
-
// (cached under OMP_PLUGINS_DIR) unless force skips the cache — an explicit
|
|
40
|
-
// "check for updates" must never trust a stale cache.
|
|
37
|
+
// A newer published version, null when up to date, 'unknown' when the registry
|
|
38
|
+
// is unreachable. Cached for a TTL unless force, which must not trust a cache.
|
|
41
39
|
async function checkForUpdate(force = false) {
|
|
42
40
|
const cachePath = tersioDataPath('update-check.json', 'tersio-update-check.json');
|
|
43
41
|
const cached = parseJsonObject(await readTextIfExists(cachePath));
|
|
@@ -50,12 +48,11 @@ async function checkForUpdate(force = false) {
|
|
|
50
48
|
await fs.writeFile(cachePath, JSON.stringify({ latest, lastCheck: Date.now() }) + '\n', 'utf8').catch(() => { });
|
|
51
49
|
return newerThan(latest, PACKAGE_VERSION) ? latest : null;
|
|
52
50
|
}
|
|
53
|
-
//
|
|
54
|
-
// actionable
|
|
51
|
+
// Unreachable registry: a stale cache naming a newer release is still
|
|
52
|
+
// actionable, else report unknown so nobody claims "latest".
|
|
55
53
|
return cached?.latest && newerThan(cached.latest, PACKAGE_VERSION) ? cached.latest : 'unknown';
|
|
56
54
|
}
|
|
57
|
-
// Race a probe against a timeout;
|
|
58
|
-
// update plan stays best-effort and never blocks the update itself.
|
|
55
|
+
// Race a probe against a timeout; failures resolve null so nothing blocks.
|
|
59
56
|
async function settle(work, ms) {
|
|
60
57
|
let timer;
|
|
61
58
|
try {
|
|
@@ -68,9 +65,7 @@ async function settle(work, ms) {
|
|
|
68
65
|
clearTimeout(timer);
|
|
69
66
|
}
|
|
70
67
|
}
|
|
71
|
-
//
|
|
72
|
-
// renders its own interactive UI (the delegated installer runs Clack
|
|
73
|
-
// spinners), which a concurrent outer spinner would corrupt into stray bars.
|
|
68
|
+
// Inherited stdio, so a child spinner cannot corrupt this parent's.
|
|
74
69
|
async function execInherit(cmd, args) {
|
|
75
70
|
const code = await new Promise((resolve, reject) => {
|
|
76
71
|
const child = spawn(cmd, args, { stdio: 'inherit' });
|
|
@@ -80,8 +75,8 @@ async function execInherit(cmd, args) {
|
|
|
80
75
|
if (code !== 0)
|
|
81
76
|
throw new Error(`${cmd} exited with code ${code}`);
|
|
82
77
|
}
|
|
83
|
-
// Current → latest per add-on. Every probe is capped and nullable
|
|
84
|
-
// prints `unknown` for anything unreachable
|
|
78
|
+
// Current → latest per add-on. Every probe is capped and nullable, and the
|
|
79
|
+
// plan prints `unknown` for anything unreachable.
|
|
85
80
|
async function probeUpdatePlan(cliLatest) {
|
|
86
81
|
const rtkBin = resolveRtkBinary();
|
|
87
82
|
const ponytailPkg = path.join(OMP_PLUGINS_DIR, 'node_modules', '@dietrichgebert', 'ponytail', 'package.json');
|
|
@@ -102,8 +97,8 @@ async function probeUpdatePlan(cliLatest) {
|
|
|
102
97
|
ponytail: ponytailLocalText ? parseJsonObject(ponytailLocalText)?.version ?? null : null,
|
|
103
98
|
};
|
|
104
99
|
}
|
|
105
|
-
// Every add-on prints
|
|
106
|
-
//
|
|
100
|
+
// Every add-on prints a version jump when stale, "up to date" otherwise, and
|
|
101
|
+
// "unknown" when its source cannot be reached.
|
|
107
102
|
function planLines(plan) {
|
|
108
103
|
const stale = [];
|
|
109
104
|
const status = [];
|
|
@@ -137,12 +132,10 @@ async function runLatestUpdate() {
|
|
|
137
132
|
if (verbose)
|
|
138
133
|
forwardedArgs.push('--verbose');
|
|
139
134
|
const npmCommand = IS_WINDOWS ? process.env.ComSpec || 'cmd.exe' : 'npm';
|
|
140
|
-
//
|
|
141
|
-
// metadata cache, so a stale `@latest` can never pin an older release.
|
|
135
|
+
// `--prefer-online` beats the local cache, so a stale @latest cannot pin down.
|
|
142
136
|
const cliLatest = await latestPublishedVersion();
|
|
143
137
|
const target = cliLatest && /^\d+\.\d+\.\d+$/.test(cliLatest) ? `@${cliLatest}` : '@latest';
|
|
144
|
-
//
|
|
145
|
-
// unknown and never block the update.
|
|
138
|
+
// Best-effort: unreachable probes print as unknown.
|
|
146
139
|
const plan = await probeUpdatePlan(cliLatest);
|
|
147
140
|
const { stale, status } = planLines(plan);
|
|
148
141
|
if (dryRun) {
|