Skip to content

Commit bbff037

Browse files
committed
fix(plugins): suppress stale notices and isolate plugin context
1 parent 2f908b1 commit bbff037

7 files changed

Lines changed: 29 additions & 12 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,7 @@ jobs:
578578
node --test
579579
skills/hyperframes-animation/scripts/package-loader.test.mjs
580580
skills/hyperframes-creative/scripts/package-loader.test.mjs
581+
skills/hyperframes/scripts/plugin-cli.test.mjs
581582
582583
# Guards that skills-manifest.json (the published freshness fingerprint read
583584
# by `hyperframes skills check`) was regenerated when a skill changed. Runs

‎packages/cli/src/utils/skillsUpdateCheck.test.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@ describe("skillsUpdateCheck", () => {
9797
return String(writeSpy.mock.calls[0]?.[0]);
9898
}
9999

100+
it("suppresses a cached stale-skills notice in an attended plugin run", async () => {
101+
vi.stubEnv("HYPERFRAMES_SKIP_SKILLS", "1");
102+
// The normal notice gate permits output (the attended TTY case).
103+
expect(await noticeTextFor({ skillsOutdatedCount: 2, skillsMissingCount: 1 })).toBeNull();
104+
});
105+
100106
it("the cached nudge total counts removed skills, not just outdated/missing", async () => {
101107
// Cache pre-populated as if a prior refreshSkillsCache had run — only
102108
// outdated + missing, no removed (the pre-fix shape).

‎packages/cli/src/utils/skillsUpdateCheck.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ function skillsNoticeText(meta: SkillsUpdateMeta): string | null {
134134
* as the CLI self-update notice (CI, non-TTY, dev, HYPERFRAMES_NO_UPDATE_CHECK).
135135
*/
136136
export function printSkillsUpdateNotice(): void {
137-
if (updateNoticesSuppressed()) return;
137+
if (process.env["HYPERFRAMES_SKIP_SKILLS"] === "1" || updateNoticesSuppressed()) return;
138138
const text = skillsNoticeText(getSkillsUpdateMeta());
139139
if (text) process.stderr.write(text);
140140
}

‎skills-manifest.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"files": 5
1919
},
2020
"hyperframes": {
21-
"hash": "a7ca1cd600c1f923",
21+
"hash": "93ee5e4fad423610",
2222
"files": 29
2323
},
2424
"hyperframes-animation": {

‎skills/hyperframes/references/plugin-installation.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,5 @@ in every workflow and reference:
3939

4040
To get newer skills, use the client's plugin update flow and reload the session.
4141
Do not silently update an installed plugin during a video task.
42+
43+
The launcher suppresses CLI update notices as well as standalone skill refreshes, including when running an older CLI with a stale notice cache. It passes the release as `HYPERFRAMES_PLUGIN_VERSION` for plugin-aware helpers and as `HYPERFRAMES_SKILL_PKG_VERSION` for the existing helper-package bootstrap. Our release process versions those packages together.

‎skills/hyperframes/scripts/plugin-cli.mjs‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Run from the user's project; locate the release from this installed file.
33
import { spawnSync } from "node:child_process";
44
import { existsSync, readFileSync, realpathSync } from "node:fs";
5-
import { dirname, join } from "node:path";
5+
import { join, win32 } from "node:path";
66
import { fileURLToPath, pathToFileURL } from "node:url";
77

88
const root = fileURLToPath(new URL("../../../", import.meta.url));
@@ -46,16 +46,22 @@ export function invocation(
4646
throw new Error(
4747
"Update HyperFrames through your agent's plugin manager; bundled skills are release-managed.",
4848
);
49-
const childEnv = { ...env, HYPERFRAMES_SKIP_SKILLS: "1", HYPERFRAMES_SKILL_PKG_VERSION: version };
49+
const childEnv = {
50+
...env,
51+
HYPERFRAMES_SKIP_SKILLS: "1",
52+
HYPERFRAMES_SKILL_PKG_VERSION: version,
53+
HYPERFRAMES_PLUGIN_VERSION: version,
54+
HYPERFRAMES_NO_UPDATE_CHECK: "1",
55+
};
5056
if (args[0] === "--script") {
51-
if (!args[1]) throw new Error("--script requires the path of a bundled Node script.");
57+
if (!args[1]) throw new Error("--script requires a Node script path.");
5258
return { command: node, args: args.slice(1), env: childEnv };
5359
}
5460
const cliArgs = ["--yes", `hyperframes@${version}`, ...args];
5561
if (platform !== "win32") return { command: "npx", args: cliArgs, env: childEnv };
5662
const candidates = [
57-
env.npm_execpath && join(dirname(env.npm_execpath), "npx-cli.js"),
58-
join(dirname(node), "node_modules", "npm", "bin", "npx-cli.js"),
63+
env.npm_execpath && win32.join(win32.dirname(env.npm_execpath), "npx-cli.js"),
64+
win32.join(win32.dirname(node), "node_modules", "npm", "bin", "npx-cli.js"),
5965
].filter(Boolean);
6066
const npx = candidates.find(pathExists);
6167
if (!npx)

‎skills/hyperframes/scripts/plugin-cli.test.mjs‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ test("pins CLI, suppresses standalone refresh, preserves unrelated environment",
6363
PATH: "/bin",
6464
HYPERFRAMES_SKIP_SKILLS: "1",
6565
HYPERFRAMES_SKILL_PKG_VERSION: "1.2.3",
66+
HYPERFRAMES_PLUGIN_VERSION: "1.2.3",
67+
HYPERFRAMES_NO_UPDATE_CHECK: "1",
6668
});
6769
assert.throws(() => invocation(["skills", "update"], { version: "1.2.3" }), /plugin manager/);
6870
});
@@ -71,13 +73,13 @@ test("Windows launches npx through Node without shell argument interpretation",
7173
const result = invocation(["render", "a & b"], {
7274
version: "1.2.3",
7375
platform: "win32",
74-
node: "/node.exe",
75-
env: { npm_execpath: "/npm/bin/npm-cli.js" },
76-
pathExists: (p) => p === "/npm/bin/npx-cli.js",
76+
node: String.raw`C:\Program Files\nodejs\node.exe`,
77+
env: { npm_execpath: String.raw`C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js` },
78+
pathExists: (p) => p === String.raw`C:\Program Files\nodejs\node_modules\npm\bin\npx-cli.js`,
7779
});
78-
assert.equal(result.command, "/node.exe");
80+
assert.equal(result.command, String.raw`C:\Program Files\nodejs\node.exe`);
7981
assert.deepEqual(result.args, [
80-
"/npm/bin/npx-cli.js",
82+
String.raw`C:\Program Files\nodejs\node_modules\npm\bin\npx-cli.js`,
8183
"--yes",
8284
8385
"render",

0 commit comments

Comments
 (0)