mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-23 11:29:54 +00:00
8bc73a0bd34313790bdbf6be43cf67f311800711
5
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
8bc73a0bd3 |
fix(cli): show control characters as text in init, skills and render printed lines (#8352)
* fix(cli): show control characters as text in init, skills and render printed lines Lines that quote a name, a path, a flag value, a tool's reply or a caught message now pass it through terminalText / terminalLines before printing. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * test(cli): build the expected init path with the platform separator Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * fix(cli): init prints only commands that run as written; one line per render progress update A project name or old-flag value with a control character is left out of the printed commands: the next steps say to go into the project folder, and the renamed-flag examples use a placeholder. A render progress update whose text has line breaks is written as one line. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * fix(cli): init answers a --json run with a refused value as given With --json before the command name, a refused --resolution, a missing --video or --audio file, a folder that is not empty and a failed example now report the value as it was given in the answer, and as visible text on the terminal. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * fix(cli): init's renamed-flag refusals answer --json with the value as given The two lines keep the example people see. A --json answer now names the flag and the value as typed. One entry-point case per init failure line, and a check that a new failure line cannot be added with a bare console.error. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * fix(cli): answer a --json init failure with the value exactly as given A failure line's values now reach the answer untouched, line breaks and trailing spaces included. Status lines wait until the project is made, so a later failure still answers in JSON, and a run that asked for JSON no longer stops to ask questions. Next steps for a folder name that cannot be typed back are printed as bare commands under a prose line. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * fix(cli): hold a converted video's status lines with the rest of init's With every answer given by flags, init printed the two lines about converting a video through a spinner, apart from its other status lines. At a terminal that drew on stdout ahead of the JSON answer to a failed run. They now go the same way as the other status lines; the run that asks questions keeps its spinner. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * test(cli): cover a failed project after a converted video in a JSON run Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com> |
||
|
|
a744f5c3f5 |
fix(cli): show control characters as text in four more commands' printed lines (#8346)
* fix(cli): show control characters as text in five more commands' printed lines browser, models, templates, transcribe and lambda policies now write control characters out as visible text in the lines they print for people: failure lines and the path, name and pattern lines. JSON output and the bare path that browser path prints for scripts are unchanged. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * fix(cli): show control characters as text in a transcription status line The status line a runner reports beside the spinner is rewritten the same way as the label next to it. The lambda policies change moves to the pull request that covers the rest of the lambda commands. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * fix(cli): show control characters in more local-input warnings, keep --json messages as given The warnings printed by the browser cache and download code, the media probe, the speech runtime loader and the optional-package installer now show control characters as text. A failed --json run that takes its message from stderr gets the text as given again. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * test(cli): run the probe case from an inline script Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com> |
||
|
|
183bc10807 |
fix(cli): show control characters in failure messages as text (#8336)
* fix(cli): show control characters in failure messages as text A failure message can quote text from the project, such as a file name or a data-composition-src value. `compare`, `grade-compare` and `add` printed that message to the terminal as it was, so a control character in the quoted text reached the terminal instead of being shown. - failCaught now prints the message with control characters written out (\x1b, \x07, ...), the same way errorBox does. The --json envelope is unchanged. - The composition size limit messages write the file label the same way, so every caller and the render server's logs get readable text. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * refactor(cli): carry the reason in the helper's name instead of a comment Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com> |
||
|
|
47d007e5b0 |
fix(cli): render --json gives each missing tool, a held slot and an old Node its own code (#7842)
* fix(cli): render --json gives each missing tool, a held slot and an old Node its own code Every failed `render --json` answered with `error.code: "runtime_error"`, so a script could only tell a missing FFmpeg from a busy render slot by matching the human message. A CliRuntimeError now carries a code, as CliUsageError does, and the envelope reports it: chrome_not_found, ffmpeg_not_found, ffprobe_not_found, render_locked. A Node older than 22 prints the envelope too (node_version_unsupported) when the run asked for --json. Other failures keep runtime_error. Refs #7408 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * test(cli): give the bin entry test's runtimeVersion stub the new JSON export bin/hyperframes.mjs now imports runtimeVersionJson, so the stub dist file binEntry.test.ts writes must export it too, or the bin fails to load. --------- Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com> |
||
|
|
85efaece7e |
fix(cli): every --json failure answers with one envelope, and --json only where supported (#6622)
* fix(cli): every --json failure answers with one envelope, and --json only where supported
Under --json, failures came back as a bare string (`"error": "Command failed"`
from lint), a command-specific shape, or nothing at all on stdout (info,
compositions, render, snapshot, cloud get). Now every failure is
`{"ok": false, "error": {"code", "message", "hint"?}}`:
- jsonFailure() in utils/jsonError.ts builds it. The commands that printed
`{ok: false, error: "<text>"}` use it, keeping their extra fields (lint's
findings, validate's errors). A refused timeline edit now writes it to stdout
instead of stderr, and keeps its `reason` and `fix` fields.
- When a --json run fails without writing anything to stdout, cli.ts writes the
envelope itself: usage errors carry their own code (unknown_flag,
unknown_command, json_unsupported, confirmation_required), anything else is
runtime_error with the message the command printed on stderr.
--json is no longer accepted by every command. A command supports it by
declaring a `json` arg; the others reject it with exit 2 and the code
json_unsupported, instead of accepting the flag and printing prose.
The contract test now checks every command's --json path, and packages/cli
gets an AGENTS.md with the rules: stdout is data, stderr is messages, never
prompt without a TTY, exit 2 for usage errors, --json always returns an
envelope.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(cli): put the real failure in the --json envelope, never the generic text or a notice
lint --json and check --json in a directory with no project answered
"message": "Command failed". The project check reports the problem, then
throws a presented "Command failed" with the real error as its cause, and the
command's own catch serialized that generic text. failureMessage() now returns
the cause, or else what the command reported through errorBox, and every
command catch that writes a --json failure uses it (lint, check, validate,
layout, snapshot, compare, grade-compare, media-treatment, tts,
remove-background, add, skills, lambda policies). compare, grade-compare and
add share failCaught() for that catch.
The boundary envelope follows the same order: the error's own message unless
it is the generic one, then its cause, then the errorBox title and hint, and
only then the stderr text. Notices (the telemetry disclosure, deprecation
lines, diag progress) are no longer captured, so validate, layout and inspect
no longer put "is deprecated" in the error message.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(cli): render --json keeps human output off stdout so a failure answers with the envelope
Under --json a single render printed its header, lint findings and progress on
stdout, so a later failure such as `render --variables '{bad' --json` ended
with no JSON envelope. --json now silences that output the way --batch --json
already did, and --variables is parsed before the browser check so a bad value
fails without a Chrome download.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(cli): a --strict lint abort says why, even under --json
Under --json the render is quiet, so a --strict lint abort printed nothing and
the envelope said only "Command failed". The abort is now an error box on
stderr in every mode, naming the error and warning counts and the first
finding, and the --json envelope carries the same message. Lint now runs
before the browser check, so the abort never waits on a Chrome download.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(cli): time the render setup cancel from the wrapper's exit
The 1 s budget started when the command did. With lint now running before the
browser check, its subprocess (about 250 ms here) sat inside that budget, and
the test failed once under load. The budget now starts when the wrapper exits,
which is the latency the test is about.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|