@petercjl/topazlabscli 0.2.2 → 0.2.3

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 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 also used for installation, without changing the user's `.npmrc`. When an update is available the CLI upgrades itself, 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.
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 complete update 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@petercjl/topazlabscli",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "Cross-Agent CLI and portable Skill for queued remote Topaz Video AI processing",
5
5
  "type": "module",
6
6
  "bin": {
@@ -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. A newer stable package is installed from the same registry that answered the version check, 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.
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. A newer stable package is fully downloaded from the registry that answered the version check 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/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";
@@ -118,10 +119,26 @@ function registryFailureMessage(attempts) {
118
119
  export async function installLatestPackage(pkg, registry, dependencies = {}) {
119
120
  const env = dependencies.env || process.env;
120
121
  const execute = dependencies.run || run;
121
- return execute("npm", ["install", "--global", `${pkg.name}@latest`, "--registry", registry], {
122
- env,
123
- timeoutMs: dependencies.installTimeoutMs
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