@petercjl/topazlabscli 0.2.2 → 0.2.4
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 +1 -1
- package/package.json +1 -1
- package/skill/topazlabscli/SKILL.md +1 -1
- package/src/cli.mjs +1 -1
- package/src/update.mjs +24 -7
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ npm install --global @petercjl/topazlabscli
|
|
|
15
15
|
topazlabscli skill install --agent all
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
The CLI checks npm for a newer stable release before operational commands, at most once every six hours. It first uses the registry already configured for npm and automatically tries `https://registry.npmmirror.com/` if that registry is unavailable. The successful registry is
|
|
18
|
+
The CLI checks npm for a newer stable release before operational commands, at most once every six hours. It first uses the registry already configured for npm and automatically tries `https://registry.npmmirror.com/` if that registry is unavailable. The successful registry is used to download the exact discovered version as a complete tarball before the installed version is touched, without changing the user's `.npmrc`. When an update is available the CLI upgrades itself from that local tarball, refreshes installed Agent Skills, and then resumes the original command. It discovers npm through the running Node installation, preserves SealSeek's managed global prefix/cache, and discovers Windows OpenSSH through the standard system location, so it also works in Agent runtimes with a restricted `PATH`. A temporary registry outage does not block video processing. `topazlabscli update` forces an immediate manual update.
|
|
19
19
|
|
|
20
20
|
On Windows, SealSeek Skills are installed into `%USERPROFILE%\.sealseek\workspace\skills` when that workspace is present. The CLI automatically uses a managed copy because SealSeek rejects junctions that resolve outside the workspace Skill root; subsequent CLI updates refresh the copy from the npm package. The copy includes a local runtime manifest so the Agent can invoke the canonical package even when its PATH is restricted. `SEALSEEK_SKILLS_HOME` remains available as an explicit override.
|
|
21
21
|
|
package/package.json
CHANGED
|
@@ -39,7 +39,7 @@ Use the CLI as the single execution surface. Do not reproduce SSH, SFTP, queue,
|
|
|
39
39
|
|
|
40
40
|
Configuration, hostnames, addresses, usernames, SSH identities, VPN details, media, Topaz binaries, models, and credentials are external to this Skill and npm package. Installation does not grant access to a workstation. Treat the configured server and Topaz license as user-managed resources.
|
|
41
41
|
|
|
42
|
-
Before operational commands, the CLI performs a cached npm update check. It tries the user's current npm registry and then its built-in reachable-registry fallback without changing the user's global npm configuration.
|
|
42
|
+
Before operational commands, the CLI performs a cached npm update check. It tries the user's current npm registry and then its built-in reachable-registry fallback without changing the user's global npm configuration. The exact version returned by that check is fully downloaded from the same registry before the installed version is touched, then installed Agent Skills are refreshed and the original command resumes under the new version. The CLI resolves npm through the running Agent's Node installation when PATH is restricted. Registry, npm, and Skill-refresh failures produce a warning and continue with the installed version. Treat `doctor`'s `updates.registry` check as advisory; a failed update source does not make video processing unavailable.
|
|
43
43
|
|
|
44
44
|
Do not overwrite a local output unless the user has authorized that exact existing target. The remote worker retains job inputs, outputs, status, and logs for operator review; cleanup is an administrative action outside version 0.2.
|
|
45
45
|
|
package/src/cli.mjs
CHANGED
|
@@ -337,7 +337,7 @@ export async function main(rawArgs) {
|
|
|
337
337
|
const query = await queryLatestVersion(pkg, config);
|
|
338
338
|
if (!query.ok) throw new CliError("UPDATE_FAILED", updateRegistryWarning(query.attempts), { attempts: query.attempts });
|
|
339
339
|
const previousSkills = skillStatus("all");
|
|
340
|
-
const result = await installLatestPackage(pkg, query.registry);
|
|
340
|
+
const result = await installLatestPackage(pkg, query.latest, query.registry);
|
|
341
341
|
if (result.code !== 0) throw new CliError("UPDATE_FAILED", result.stderr.trim() || "npm update failed.");
|
|
342
342
|
const skills = [];
|
|
343
343
|
for (const existing of previousSkills.filter((item) => item.installed)) {
|
package/src/update.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
|
+
import os from "node:os";
|
|
2
3
|
import path from "node:path";
|
|
3
4
|
import { loadConfig } from "./config.mjs";
|
|
4
5
|
import { binScript, updateStatePath } from "./paths.mjs";
|
|
@@ -115,13 +116,29 @@ function registryFailureMessage(attempts) {
|
|
|
115
116
|
return `Unable to check npm for updates: ${attempts.map((item) => `${item.registry} (${item.detail})`).join("; ")}`;
|
|
116
117
|
}
|
|
117
118
|
|
|
118
|
-
export async function installLatestPackage(pkg, registry, dependencies = {}) {
|
|
119
|
+
export async function installLatestPackage(pkg, latest, registry, dependencies = {}) {
|
|
119
120
|
const env = dependencies.env || process.env;
|
|
120
121
|
const execute = dependencies.run || run;
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
122
|
+
const temporary = fs.mkdtempSync(path.join(os.tmpdir(), "topazlabscli-update-"));
|
|
123
|
+
try {
|
|
124
|
+
const packed = await execute("npm", ["pack", `${pkg.name}@${latest}`, "--json", "--pack-destination", temporary, "--registry", registry], {
|
|
125
|
+
env,
|
|
126
|
+
timeoutMs: dependencies.timeoutMs || UPDATE_TIMEOUT_MS
|
|
127
|
+
});
|
|
128
|
+
if (packed.code !== 0) return packed;
|
|
129
|
+
let filename;
|
|
130
|
+
try { filename = JSON.parse(packed.stdout.trim())[0]?.filename; }
|
|
131
|
+
catch {}
|
|
132
|
+
if (!filename) {
|
|
133
|
+
return { ...packed, code: 1, stderr: packed.stderr || "npm pack did not return a package filename." };
|
|
134
|
+
}
|
|
135
|
+
return await execute("npm", ["install", "--global", path.join(temporary, filename)], {
|
|
136
|
+
env,
|
|
137
|
+
timeoutMs: dependencies.installTimeoutMs
|
|
138
|
+
});
|
|
139
|
+
} finally {
|
|
140
|
+
fs.rmSync(temporary, { recursive: true, force: true });
|
|
141
|
+
}
|
|
125
142
|
}
|
|
126
143
|
|
|
127
144
|
export async function maybeAutoUpdate(rawArgs, pkg, dependencies = {}) {
|
|
@@ -136,7 +153,7 @@ export async function maybeAutoUpdate(rawArgs, pkg, dependencies = {}) {
|
|
|
136
153
|
const intervalHours = Number(config.settings?.update_check_hours ?? DEFAULT_INTERVAL_HOURS);
|
|
137
154
|
const intervalMs = Math.max(0, intervalHours) * 60 * 60 * 1000;
|
|
138
155
|
const state = readState(stateFile);
|
|
139
|
-
if (intervalMs > 0 && Number.isFinite(state.last_checked_at) && now - state.last_checked_at < intervalMs) {
|
|
156
|
+
if (intervalMs > 0 && state.registry && Number.isFinite(state.last_checked_at) && now - state.last_checked_at < intervalMs) {
|
|
140
157
|
return { checked: false, reason: "fresh", latest: state.latest || null, registry: state.registry || null };
|
|
141
158
|
}
|
|
142
159
|
|
|
@@ -152,7 +169,7 @@ export async function maybeAutoUpdate(rawArgs, pkg, dependencies = {}) {
|
|
|
152
169
|
const installedSkills = getSkillStatus("all").filter((item) => item.installed);
|
|
153
170
|
let install;
|
|
154
171
|
try {
|
|
155
|
-
install = await installLatestPackage(pkg, registry, dependencies);
|
|
172
|
+
install = await installLatestPackage(pkg, latest, registry, dependencies);
|
|
156
173
|
} catch (error) {
|
|
157
174
|
return { checked: true, warning: `Automatic npm update failed: ${error.message}`, latest, registry };
|
|
158
175
|
}
|