agentcut 0.2.26 → 0.2.28

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.
Files changed (97) hide show
  1. package/README.md +177 -177
  2. package/dist/studio/agents/claude.js +3 -2
  3. package/dist/studio/agents/claude.js.map +1 -1
  4. package/dist/studio/chat.js +1 -1
  5. package/dist/studio/chat.js.map +1 -1
  6. package/dist/studio/cli.js +24 -24
  7. package/dist/studio/download.d.ts +24 -0
  8. package/dist/studio/download.js +234 -0
  9. package/dist/studio/download.js.map +1 -0
  10. package/dist/studio/host.js +8 -0
  11. package/dist/studio/host.js.map +1 -1
  12. package/dist/studio/housekeeping.d.ts +2 -2
  13. package/dist/studio/housekeeping.js +18 -17
  14. package/dist/studio/housekeeping.js.map +1 -1
  15. package/dist/studio/release-cursor.js +21 -21
  16. package/dist/studio/release-video.js +10 -10
  17. package/dist/studio/schema.d.ts +102 -0
  18. package/dist/studio/schema.js +5 -0
  19. package/dist/studio/schema.js.map +1 -1
  20. package/dist/studio/tools.js +7 -0
  21. package/dist/studio/tools.js.map +1 -1
  22. package/package.json +56 -56
  23. package/template/AGENTS.md +14 -14
  24. package/template/components/README.md +70 -70
  25. package/template/components/before-after/BeforeAfter.tsx +89 -89
  26. package/template/components/catalog.ts +107 -107
  27. package/template/components/cinematic/Device3D.tsx +324 -324
  28. package/template/components/cinematic/devices3d/display-model.ts +184 -184
  29. package/template/components/cinematic/devices3d/iphone-model.ts +643 -643
  30. package/template/components/cinematic/devices3d/macbook-model.ts +608 -608
  31. package/template/components/cinematic/devices3d/models.ts +657 -657
  32. package/template/components/cinematic/devices3d/runtime.ts +267 -267
  33. package/template/components/cinematic/math.ts +100 -100
  34. package/template/components/color/grade-effect.ts +650 -650
  35. package/template/components/color/grade.ts +512 -512
  36. package/template/components/color/looks.ts +154 -154
  37. package/template/components/countdown/Countdown.tsx +166 -166
  38. package/template/components/dot-trace-title/DotTraceTitle.tsx +181 -181
  39. package/template/components/dot-trace-title/meta.json +51 -51
  40. package/template/components/generate/GenerateReveal.tsx +381 -381
  41. package/template/components/hook-card/HookCard.tsx +554 -554
  42. package/template/components/index.ts +199 -199
  43. package/template/components/lib.ts +191 -191
  44. package/template/components/line-diagram/LineDiagram.tsx +205 -205
  45. package/template/components/line-diagram/meta.json +215 -215
  46. package/template/components/list-card/ListCard.tsx +104 -104
  47. package/template/components/live-clip.ts +75 -75
  48. package/template/components/looks.tsx +1447 -1447
  49. package/template/components/loops/LoopCanvas.tsx +132 -132
  50. package/template/components/loops/engine.ts +184 -184
  51. package/template/components/loops/library.ts +667 -667
  52. package/template/components/loops/library2.ts +777 -777
  53. package/template/components/motion-loop/MotionLoop.tsx +37 -37
  54. package/template/components/motion-loop/meta.json +311 -311
  55. package/template/components/props.ts +73 -73
  56. package/template/components/quote-card/QuoteCard.tsx +71 -71
  57. package/template/components/style-layer.tsx +233 -233
  58. package/template/components/styles.ts +113 -113
  59. package/template/components/types.ts +66 -66
  60. package/template/components/word-pop/WordPop.tsx +59 -59
  61. package/template/components/word-stack/WordStack.tsx +122 -122
  62. package/template/presets/charcoal-sketch/PROMPT.md +48 -48
  63. package/template/presets/charcoal-sketch/scripts/duck_music.py +34 -34
  64. package/template/presets/punk-cut-paper/scenes/Motif.tsx +376 -376
  65. package/template/presets/punk-cut-paper/scenes/Photo.tsx +73 -73
  66. package/template/presets/punk-cut-paper/scenes/Ransom.tsx +119 -119
  67. package/template/runtime/composition.tsx +1207 -1189
  68. package/template/runtime/helpers.tsx +230 -230
  69. package/template/runtime/index.tsx +26 -22
  70. package/template/runtime/types.ts +324 -315
  71. package/template/skill/SKILL.md +188 -187
  72. package/template/skill/references/broll.md +44 -44
  73. package/template/skill/references/browser-export.md +61 -61
  74. package/template/skill/references/cinematic.md +206 -206
  75. package/template/skill/references/color.md +79 -79
  76. package/template/skill/references/craft.md +97 -97
  77. package/template/skill/references/editing-styles.md +57 -57
  78. package/template/skill/references/feature-launch.md +34 -34
  79. package/template/skill/references/footage.md +72 -72
  80. package/template/skill/references/format.md +145 -142
  81. package/template/skill/references/how-to.md +146 -146
  82. package/template/skill/references/launch-direction.md +89 -89
  83. package/template/skill/references/loops.md +151 -151
  84. package/template/skill/references/mcp-external.md +19 -19
  85. package/template/skill/references/performance.md +93 -93
  86. package/template/skill/references/person-cutout.md +19 -19
  87. package/template/skill/references/presets.md +60 -60
  88. package/template/skill/references/product-launch.md +134 -134
  89. package/template/skill/references/release-capture.md +53 -53
  90. package/template/skill/references/sound.md +167 -166
  91. package/template/skill/references/style-spy.md +160 -160
  92. package/template/skill/references/website-howto.md +45 -45
  93. package/template/starter/.studio/chat.json +1 -1
  94. package/template/starter/layers.json +46 -46
  95. package/template/starter/notes.md +4 -4
  96. package/template/starter/project.json +13 -13
  97. package/template/starter/scenes/Title.tsx +38 -38
@@ -1,75 +1,75 @@
1
- // Edits in progress. While a slider moves, its value goes straight to the one clip it changes, so only
2
- // that clip redraws: nothing else in the studio re-renders until the edit is saved on release.
3
- // Renders (captures and exports) never read this, so they only ever draw what's saved.
4
- import { useMemo, useSyncExternalStore } from "react";
5
-
6
- type Fields = Record<string, unknown>;
7
-
8
- /** Key for the whole-video grade, which isn't a clip. */
9
- export const LIVE_PROJECT = "project";
10
-
11
- const live = new Map<string, Fields>();
12
- const clearing = new Set<string>();
13
- const listeners = new Set<() => void>();
14
- let scheduled = false;
15
-
16
- function flush() {
17
- scheduled = false;
18
- for (const id of clearing) live.delete(id);
19
- clearing.clear();
20
- for (const listener of listeners) listener();
21
- }
22
-
23
- /** At most one redraw per display frame, however fast the pointer reports. */
24
- function schedule() {
25
- if (scheduled) return;
26
- scheduled = true;
27
- if (typeof requestAnimationFrame === "function") requestAnimationFrame(flush);
28
- else flush();
29
- }
30
-
31
- function subscribe(listener: () => void) {
32
- listeners.add(listener);
33
- return () => {
34
- listeners.delete(listener);
35
- };
36
- }
37
-
38
- export function setLiveClip(id: string, fields: Fields) {
39
- clearing.delete(id);
40
- live.set(id, { ...live.get(id), ...fields });
41
- schedule();
42
- }
43
-
44
- /** The edit is over. Takes effect on the next frame, after the saved value has reached the clip. */
45
- export function clearLiveClip(id: string) {
46
- if (!live.has(id)) return;
47
- clearing.add(id);
48
- schedule();
49
- }
50
-
51
- /** Fields being edited on this clip, or undefined. */
52
- export function getLiveClip(id: string): Fields | undefined {
53
- return live.get(id);
54
- }
55
-
56
- const none = () => undefined;
57
-
58
- /** `clip` with any edit in progress on top. Re-renders only when this clip's own edit changes. */
59
- export function useLiveClip<T extends { id: string }>(clip: T, isRendering = false): T {
60
- const id = clip.id;
61
- const snapshot = isRendering ? none : () => live.get(id);
62
- const fields = useSyncExternalStore(subscribe, snapshot, none);
63
- return useMemo(() => (fields ? { ...clip, ...fields } : clip), [clip, fields]);
64
- }
65
-
66
- /** Re-render when any of these edits change (a clip following adjustment layers and the project grade). */
67
- export function useLiveClips(ids: string[], isRendering = false) {
68
- const snapshot = () => {
69
- if (isRendering) return "";
70
- let key = "";
71
- for (const id of ids) if (live.has(id)) key += `${id}:${JSON.stringify(live.get(id))};`;
72
- return key;
73
- };
74
- useSyncExternalStore(subscribe, snapshot, () => "");
75
- }
1
+ // Edits in progress. While a slider moves, its value goes straight to the one clip it changes, so only
2
+ // that clip redraws: nothing else in the studio re-renders until the edit is saved on release.
3
+ // Renders (captures and exports) never read this, so they only ever draw what's saved.
4
+ import { useMemo, useSyncExternalStore } from "react";
5
+
6
+ type Fields = Record<string, unknown>;
7
+
8
+ /** Key for the whole-video grade, which isn't a clip. */
9
+ export const LIVE_PROJECT = "project";
10
+
11
+ const live = new Map<string, Fields>();
12
+ const clearing = new Set<string>();
13
+ const listeners = new Set<() => void>();
14
+ let scheduled = false;
15
+
16
+ function flush() {
17
+ scheduled = false;
18
+ for (const id of clearing) live.delete(id);
19
+ clearing.clear();
20
+ for (const listener of listeners) listener();
21
+ }
22
+
23
+ /** At most one redraw per display frame, however fast the pointer reports. */
24
+ function schedule() {
25
+ if (scheduled) return;
26
+ scheduled = true;
27
+ if (typeof requestAnimationFrame === "function") requestAnimationFrame(flush);
28
+ else flush();
29
+ }
30
+
31
+ function subscribe(listener: () => void) {
32
+ listeners.add(listener);
33
+ return () => {
34
+ listeners.delete(listener);
35
+ };
36
+ }
37
+
38
+ export function setLiveClip(id: string, fields: Fields) {
39
+ clearing.delete(id);
40
+ live.set(id, { ...live.get(id), ...fields });
41
+ schedule();
42
+ }
43
+
44
+ /** The edit is over. Takes effect on the next frame, after the saved value has reached the clip. */
45
+ export function clearLiveClip(id: string) {
46
+ if (!live.has(id)) return;
47
+ clearing.add(id);
48
+ schedule();
49
+ }
50
+
51
+ /** Fields being edited on this clip, or undefined. */
52
+ export function getLiveClip(id: string): Fields | undefined {
53
+ return live.get(id);
54
+ }
55
+
56
+ const none = () => undefined;
57
+
58
+ /** `clip` with any edit in progress on top. Re-renders only when this clip's own edit changes. */
59
+ export function useLiveClip<T extends { id: string }>(clip: T, isRendering = false): T {
60
+ const id = clip.id;
61
+ const snapshot = isRendering ? none : () => live.get(id);
62
+ const fields = useSyncExternalStore(subscribe, snapshot, none);
63
+ return useMemo(() => (fields ? { ...clip, ...fields } : clip), [clip, fields]);
64
+ }
65
+
66
+ /** Re-render when any of these edits change (a clip following adjustment layers and the project grade). */
67
+ export function useLiveClips(ids: string[], isRendering = false) {
68
+ const snapshot = () => {
69
+ if (isRendering) return "";
70
+ let key = "";
71
+ for (const id of ids) if (live.has(id)) key += `${id}:${JSON.stringify(live.get(id))};`;
72
+ return key;
73
+ };
74
+ useSyncExternalStore(subscribe, snapshot, () => "");
75
+ }