hyperframes 0.7.17 → 0.7.18
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/dist/cli.js +1232 -686
- package/dist/hyperframe-runtime.js +18 -18
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +18 -18
- package/dist/skills/hyperframes-cli/SKILL.md +4 -2
- package/dist/skills/hyperframes-cli/references/preview-render.md +42 -0
- package/dist/studio/assets/{index-BDx28x9R.js → index-B7_M3NXS.js} +1 -1
- package/dist/studio/assets/{index-hiqLDAtz.js → index-D0468l1X.js} +180 -180
- package/dist/studio/assets/{index-BCAdHPz_.js → index-mZiDOLTB.js} +1 -1
- package/dist/studio/index.html +1 -1
- package/dist/studio/index.js +379 -238
- package/dist/studio/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -14,7 +14,7 @@ Everything runs through `npx hyperframes` unless project instructions specify a
|
|
|
14
14
|
3. **Lint** — `npx hyperframes lint`
|
|
15
15
|
4. **Validate** — `npx hyperframes validate` (runtime errors + contrast)
|
|
16
16
|
5. **Visual inspect** — `npx hyperframes inspect`
|
|
17
|
-
6. **Preview** — `npx hyperframes preview` opens **Studio**, the timeline editor where the user can manually edit anything (not just watch). Review there, then ask before rendering.
|
|
17
|
+
6. **Preview / edit** — `npx hyperframes preview` opens **Studio**, the timeline editor where the user can manually edit anything (not just watch). Review there, then ask before rendering.
|
|
18
18
|
7. **Render** — pick the variant:
|
|
19
19
|
- Iterate: `npx hyperframes render --quality draft`
|
|
20
20
|
- Deliver: `npx hyperframes render --quality high --output out.mp4`
|
|
@@ -29,12 +29,14 @@ For motion-heavy work, prefer snapshot-driven iteration and a `*.motion.json` si
|
|
|
29
29
|
|
|
30
30
|
Cross-cutting rules that hold for every command:
|
|
31
31
|
|
|
32
|
-
- **`--json` is available on every command except `render`, `preview`, and `play
|
|
32
|
+
- **`--json` is available on every command except `render`, `preview`, and `play` server modes.** Use it for any agent / CI invocation of the supported commands; output includes a `_meta` envelope (cli version, latest available, update advice). `render` reports status via stdout + exit code only — verify success with the post-render check below. `preview --selection --json` and `preview --context --json` are the preview exceptions: they do not start a server, they query the user's running Studio session and exit.
|
|
33
33
|
- **`doctor --json` always exits 0**, even when the environment is broken. Gate on the payload's `ok` field: `npx hyperframes doctor --json | jq -e '.ok' > /dev/null`. This insulates pipelines from CLI release churn.
|
|
34
34
|
- **Non-TTY mode is auto-detected.** When `stdout` is not a TTY (CI, agents, piped output) the CLI auto-switches to non-interactive; `init` then **requires `--example`**. Pass `--non-interactive` to force this mode even on a TTY.
|
|
35
35
|
- **CI gating on render**: `--strict` fails on lint errors, `--strict-all` fails on warnings too, `--strict-variables` fails on undeclared `--variables` keys.
|
|
36
36
|
- **Paths in `--json` are redacted** — `$HOME` becomes the literal `$HOME` so output is safe to paste into bug reports and agent contexts.
|
|
37
37
|
- **Render is user-gated.** Never auto-render once the checks pass. Pause at `preview`, tell the user the video is editable in Studio, and render only after they approve.
|
|
38
|
+
- **Use Studio context for user-directed edits.** When the user says "this selected element", "the thing I clicked", "current selection", or similar, ask them to select it in Studio, then run `npx hyperframes preview --context --json --context-fields selection`. Use the returned `selection.target.hfId` / `selector`, `selection.sourceFile`, `selection.currentTime`, and `selection.thumbnailUrl` to anchor the edit. If `selection` is `null` and `errors.selection.code` is `no-selection`, ask the user to click the element and rerun; do not guess from screenshots.
|
|
39
|
+
- **Keep Studio context compact.** `preview --context --json` returns compact selection by default. Add `--context-fields selection`, `--context-fields selection,lint`, or `--context-fields lint` to avoid bloating agent context. Use `--context-detail full` only when you need heavy fields like computed styles, inline styles, or text-field metadata.
|
|
38
40
|
- **Post-render verification.** After `render` returns exit 0, confirm the output file exists and has plausible size before reporting success: `[ -s "$OUTPUT" ] || echo "render produced no output"`. The CLI prints `◇ <path>` on success; for long renders also sanity-check duration with `ffprobe -i "$OUTPUT" -show_format -v error`.
|
|
39
41
|
|
|
40
42
|
## Routing
|
|
@@ -7,6 +7,8 @@ Serve, render, and share commands.
|
|
|
7
7
|
```bash
|
|
8
8
|
npx hyperframes preview # serve current directory
|
|
9
9
|
npx hyperframes preview --port 4567 # custom port (default 3002)
|
|
10
|
+
npx hyperframes preview --selection --json # print the current Studio selection and exit
|
|
11
|
+
npx hyperframes preview --context --json # print compact agent context from Studio
|
|
10
12
|
```
|
|
11
13
|
|
|
12
14
|
Hot-reloads on file changes. Opens Studio in the browser automatically — the full timeline editor, where the user can play the video and edit anything by hand before rendering. This is the review surface, not just a viewer.
|
|
@@ -19,6 +21,46 @@ http://localhost:<port>/#project/<project-name>
|
|
|
19
21
|
|
|
20
22
|
Use the actual port and project directory name; treat `index.html` as source-code context, not the preview surface. For example, after `npx hyperframes preview --port 3017` in `codex-openai-video`, report `http://localhost:3017/#project/codex-openai-video`.
|
|
21
23
|
|
|
24
|
+
### Agent context from Studio selection
|
|
25
|
+
|
|
26
|
+
`preview --context` and `preview --selection` are the agent bridge into a running Studio session. They do **not** start a new server; they find the active preview server for the current project, read agent-useful state from Studio, print it, and exit.
|
|
27
|
+
|
|
28
|
+
Use it when the user gives deictic edit instructions like "change this", "move the selected element", "make the card I clicked bigger", or "fix the current selection":
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npx hyperframes preview --context --json --context-fields selection
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
The compact context payload includes the selected element's source file, composition path, current timeline time, `data-hf-id` / selector target, bounding box, text content, and a thumbnail URL for the selected element. Prefer `selection.target.hfId` when present; fall back to `selection.target.selector` only when no stable `data-hf-id` exists. If `selection` is `null`, inspect `errors.selection.code` (for example, `no-selection`).
|
|
35
|
+
|
|
36
|
+
Keep agent context small by asking only for the slices you need:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npx hyperframes preview --context --json --context-fields selection
|
|
40
|
+
npx hyperframes preview --context --json --context-fields lint
|
|
41
|
+
npx hyperframes preview --context --json --context-fields selection,lint
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Use `--context-detail full` only when the edit genuinely needs heavy selection fields such as `computedStyles`, `inlineStyles`, `dataAttributes`, or editable text-field metadata:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
npx hyperframes preview --context --json --context-fields selection --context-detail full
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
`preview --selection --json` remains available when you explicitly want the full selected-element payload and do not need lint/server context.
|
|
51
|
+
|
|
52
|
+
Failure modes:
|
|
53
|
+
|
|
54
|
+
| Code | Meaning |
|
|
55
|
+
| -------------------------- | -------------------------------------------------------------------------- |
|
|
56
|
+
| `preview-not-running` | Start Studio first with `npx hyperframes preview`. |
|
|
57
|
+
| `ambiguous-preview-server` | Multiple matching Studio servers are open; rerun with one listed `--port`. |
|
|
58
|
+
| `preview-port-mismatch` | The requested `--port` is not one of the matching Studio servers. |
|
|
59
|
+
| `no-selection` | Studio is open, but the user has not selected an element yet. |
|
|
60
|
+
| `selection-unavailable` | The running preview server does not expose selection context cleanly. |
|
|
61
|
+
|
|
62
|
+
If there is no selection, ask the user to click the target element in Studio and rerun the command. If the server error lists candidate ports, rerun the same command with `--port <candidate>`. Do not infer the target from a screenshot when the CLI can give a stable element target.
|
|
63
|
+
|
|
22
64
|
## play (lightweight player)
|
|
23
65
|
|
|
24
66
|
```bash
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as P}from"./index-
|
|
1
|
+
import{g as P}from"./index-D0468l1X.js";function j(c,d){for(var s=0;s<d.length;s++){const a=d[s];if(typeof a!="string"&&!Array.isArray(a)){for(const i in a)if(i!=="default"&&!(i in c)){const l=Object.getOwnPropertyDescriptor(a,i);l&&Object.defineProperty(c,i,l.get?l:{enumerable:!0,get:()=>a[i]})}}}return Object.freeze(Object.defineProperty(c,Symbol.toStringTag,{value:"Module"}))}var v={},w;function k(){if(w)return v;w=1,Object.defineProperty(v,"__esModule",{value:!0}),v.default=d;var c=window.OfflineAudioContext||window.webkitOfflineAudioContext;function d(e){var r=a(e);return r.start(0),[i,y,O(e.sampleRate),s].reduce(function(t,o){return o(t)},r.buffer.getChannelData(0))}function s(e){return e.sort(function(r,t){return t.count-r.count}).splice(0,5)[0].tempo}function a(e){var r=e.length,t=e.numberOfChannels,o=e.sampleRate,n=new c(t,r,o),u=n.createBufferSource();u.buffer=e;var f=n.createBiquadFilter();return f.type="lowpass",u.connect(f),f.connect(n.destination),u}function i(e){for(var r=[],t=.9,o=.3,n=15;r.length<n&&t>=o;)r=l(e,t),t-=.05;if(r.length<n)throw new Error("Could not find enough samples for a reliable detection.");return r}function l(e,r){for(var t=[],o=0,n=e.length;o<n;o+=1)e[o]>r&&(t.push(o),o+=1e4);return t}function y(e){var r=[];return e.forEach(function(t,o){for(var n=function(x){var g=e[o+x]-t,_=r.some(function(h){if(h.interval===g)return h.count+=1});_||r.push({interval:g,count:1})},u=0;u<10;u+=1)n(u)}),r}function O(e){return function(r){var t=[];return r.forEach(function(o){if(o.interval!==0){for(var n=60/(o.interval/e);n<90;)n*=2;for(;n>180;)n/=2;n=Math.round(n);var u=t.some(function(f){if(f.tempo===n)return f.count+=o.count});u||t.push({tempo:n,count:o.count})}}),t}}return v}var p,b;function q(){return b||(b=1,p=k().default),p}var m=q();const A=P(m),D=j({__proto__:null,default:A},[m]);export{D as i};
|