mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-19 11:26:02 +00:00
fix(skills): the launcher never starts a CLI older than its security floor (#8125)
The skill launcher raises its floor to 0.9.64, the oldest release with every protection for projects received from someone else. The floor applies to a plugin pin, to --cli-version and to HYPERFRAMES_STANDALONE_CLI_VERSION. A release below it is refused with a message that names the floor. The skill lifecycle reference no longer sends the agent back to the project's pinned release after a failed check. The agent stops and reports, and runs the old release only when the person asks for it. The CLI notice for a project that pins a newer release now says the pin is the person's choice.
This commit is contained in:
@@ -97,7 +97,11 @@ describe("printStalePinNotice", () => {
|
||||
const mismatch = writes.filter((w) => w.includes("This is hyperframes 0.7.71"));
|
||||
expect(mismatch.length).toBe(2);
|
||||
expect(mismatch[0]).toContain("--cli-version 0.9.66");
|
||||
expect(mismatch[0]).toContain("start in your home folder, run npx hyperframes@0.9.66");
|
||||
// fails without the fix: the notice told an agent to run the release the project's own
|
||||
// package.json named, as if the project could choose the CLI.
|
||||
expect(mismatch[0]).toContain("an agent runs the pinned release only when the person asks");
|
||||
expect(mismatch[0]).not.toContain("to run the pinned release.");
|
||||
expect(mismatch[0]).toContain("starting in your home folder, running npx hyperframes@0.9.66");
|
||||
expect(mismatch[0]).toContain("absolute path");
|
||||
expect(writes.join("")).not.toContain("upgrade --project");
|
||||
});
|
||||
|
||||
@@ -389,10 +389,12 @@ export function printStalePinNotice(cwd: string = process.cwd()): void {
|
||||
// A CLI older than the pin (e.g. a stale npx cache) misjudges every run, so this is never throttled.
|
||||
const newerPins = pins.filter((v) => isNewerSemver(v, VERSION)).sort(compareVersions);
|
||||
if (newerPins.length > 0) {
|
||||
const pin = newerPins.at(-1);
|
||||
process.stderr.write(
|
||||
`\n This is hyperframes ${VERSION}, but this project pins hyperframes@${newerPins.join(", ")}.\n` +
|
||||
` Use the installed standalone skill launcher with --cli-version ${newerPins.at(-1)} to run the pinned release.\n` +
|
||||
` Without standalone skills, start in your home folder, run npx hyperframes@${newerPins.at(-1)} with the desired command, and pass the project by absolute path.\n\n`,
|
||||
` A project's pin does not choose the CLI; an agent runs the pinned release only when the person asks for it.\n` +
|
||||
` To choose it, pass --cli-version ${pin} to the installed standalone skill launcher.\n` +
|
||||
` Without standalone skills, choose it by starting in your home folder, running npx hyperframes@${pin} with the desired command, and passing the project by absolute path.\n\n`,
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user