cozyclay 1.8.1 → 1.9.0

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 (156) hide show
  1. package/CHANGELOG.md +74 -1
  2. package/README.md +89 -142
  3. package/THIRD_PARTY_NOTICES.md +48 -0
  4. package/bin/agent/agent-routes.mjs +619 -119
  5. package/bin/agent/agent-runner.mjs +513 -0
  6. package/bin/agent/agent-tools.mjs +11 -19
  7. package/bin/agent/codex-client.mjs +6 -150
  8. package/bin/agent/credential-store.mjs +93 -0
  9. package/bin/agent/fal-contract.mjs +25 -0
  10. package/bin/agent/h3-preservation.mjs +0 -4
  11. package/bin/agent/motion-runtime.mjs +304 -0
  12. package/bin/agent/pi-tools.mjs +64 -0
  13. package/bin/agent/provider-keys.mjs +56 -0
  14. package/bin/agent/providers.mjs +344 -0
  15. package/bin/agent/schema-to-typebox.mjs +58 -0
  16. package/bin/agent/secure-file.mjs +19 -0
  17. package/bin/agent/session-store.mjs +324 -0
  18. package/bin/agent/studio-prompt.mjs +1 -0
  19. package/bin/agent/studio-tools.mjs +53 -0
  20. package/bin/agent/video-adapters.mjs +60 -9
  21. package/bin/codex-auth.mjs +37 -13
  22. package/bin/cozyclay.mjs +42 -10
  23. package/bin/live/cli.mjs +474 -0
  24. package/bin/live/client.mjs +216 -0
  25. package/bin/live/studio.mjs +85 -0
  26. package/bin/live/workspace.mjs +69 -0
  27. package/bin/live-endpoint.mjs +52 -0
  28. package/bin/mcp-runtime.mjs +4 -0
  29. package/bin/telemetry-state.mjs +10 -0
  30. package/dist/app/index.html +6 -5
  31. package/dist/assets/analytics-B1hnH66c.js +1 -0
  32. package/dist/assets/app-BWusbqgO.js +4861 -0
  33. package/dist/assets/app-qKDo4PBX.css +1 -0
  34. package/dist/assets/{demo-BENMp24T.js → demo-B-eg1CT8.js} +1 -1
  35. package/dist/assets/first-shot-handoff-CGgnvNu8.js +1 -0
  36. package/dist/assets/landing-IbRp3FnQ.js +1 -0
  37. package/dist/assets/shot-prompt-CHUtw6af.js +17 -0
  38. package/dist/assets/shot-prompt-C_g2BHVc.css +1 -0
  39. package/dist/assets/{ticket-BDieXjZs.js → ticket-BgIzOBOf.js} +1 -1
  40. package/dist/assets/workflow-CVwzMhz2.js +179 -0
  41. package/dist/assets/{workflow-CeQxy8Uq.css → workflow-DsudxKHF.css} +1 -1
  42. package/dist/cozyclay-package.json +1 -1
  43. package/dist/greybox-to-video/index.html +19 -0
  44. package/dist/index.html +15 -118
  45. package/dist/privacy/index.html +57 -3
  46. package/dist/sitemap.xml +3 -3
  47. package/dist/workflow/index.html +5 -5
  48. package/mcp/LIVE-PROTOCOL.md +89 -16
  49. package/mcp/README.md +12 -3
  50. package/mcp/live-hub.mjs +364 -35
  51. package/mcp/package.json +2 -2
  52. package/mcp/server.mjs +47 -21
  53. package/mcp/tool-handlers.mjs +113 -37
  54. package/package.json +8 -3
  55. package/src/App.jsx +2294 -751
  56. package/src/analytics.js +361 -27
  57. package/src/app-stage.jsx +111 -96
  58. package/src/ardy/client.js +19 -9
  59. package/src/ardy/foot-lock.js +230 -0
  60. package/src/ardy/ground.js +52 -0
  61. package/src/ardy/ik.js +25 -7
  62. package/src/ardy/motion-calibration.js +0 -4
  63. package/src/ardy/npz.js +7 -1
  64. package/src/ardy/physics-refine.js +1 -1
  65. package/src/ardy/physics-review.js +102 -52
  66. package/src/ardy/playback.js +0 -8
  67. package/src/asset-pane.jsx +97 -8
  68. package/src/asset-shelf.js +10 -3
  69. package/src/camera-tutorial.jsx +33 -7
  70. package/src/controls.jsx +91 -8
  71. package/src/dualview.jsx +7 -7
  72. package/src/execution-telemetry.js +97 -0
  73. package/src/facing-marks.js +72 -0
  74. package/src/fal-motion-client.js +80 -0
  75. package/src/fal-motion-studio.jsx +180 -0
  76. package/src/first-shot-handoff.js +44 -0
  77. package/src/hierarchy-panel.jsx +20 -2
  78. package/src/keyframe-pack.js +1 -0
  79. package/src/live-control.js +257 -11
  80. package/src/mesh-graph-clone.js +23 -0
  81. package/src/mesh-sniff.js +82 -0
  82. package/src/model-presets.js +8 -3
  83. package/src/motion-readiness-ui.jsx +67 -0
  84. package/src/motion-readiness.js +29 -0
  85. package/src/motion-resources.js +177 -0
  86. package/src/motion-store.js +65 -0
  87. package/src/multimodel-ingest.js +9 -0
  88. package/src/offscreen-export.js +125 -59
  89. package/src/part-colours.js +25 -15
  90. package/src/posestudio.jsx +2 -1
  91. package/src/project-resources.js +286 -0
  92. package/src/project.js +219 -32
  93. package/src/props.jsx +99 -2
  94. package/src/render-passes.js +17 -5
  95. package/src/resource-status.jsx +174 -0
  96. package/src/result-modal.jsx +23 -7
  97. package/src/scene-asset-cache.js +19 -2
  98. package/src/scene-assets.js +73 -12
  99. package/src/scene-fbx.js +75 -0
  100. package/src/scene-history.js +8 -4
  101. package/src/scene-mesh-cache.js +135 -0
  102. package/src/scene-mesh.js +390 -0
  103. package/src/scene-objects.js +146 -41
  104. package/src/scenes.js +55 -21
  105. package/src/semantic-edit.js +98 -0
  106. package/src/settings-menu.jsx +29 -1
  107. package/src/shot-authoring.js +4 -1
  108. package/src/shot.js +4 -0
  109. package/src/studio-agent-commands.js +561 -0
  110. package/src/studio-agent-context.js +113 -0
  111. package/src/studio-agent-motion.js +440 -0
  112. package/src/studio-agent-protocol.js +508 -0
  113. package/src/studio-elements.js +78 -0
  114. package/src/styles.css +422 -3
  115. package/src/tutorial-analytics.js +86 -0
  116. package/src/use-semantic-state.js +12 -0
  117. package/src/workflow/AgentPanel.jsx +668 -186
  118. package/src/workflow/CozySceneNode.jsx +31 -6
  119. package/src/workflow/WorkflowBuilder.jsx +222 -118
  120. package/src/workflow/agent-client.js +1254 -53
  121. package/src/workflow/agent-panel.css +464 -2
  122. package/src/workflow/attachment-image.js +163 -0
  123. package/src/workflow/canvas-commands.js +16 -5
  124. package/src/workflow/cozy-scene-node.css +14 -3
  125. package/src/workflow/cozy-scene-node.js +22 -0
  126. package/src/workflow/keyframe-pack-request.js +16 -2
  127. package/src/workflow/main.jsx +3 -0
  128. package/src/workflow/node-schema.js +1 -1
  129. package/src/workflow/scene-asset-sync.js +2 -2
  130. package/src/workflow/video-contract.js +25 -0
  131. package/src/workflow/workflow-resources.js +275 -0
  132. package/src/workflow/workflow.css +2 -0
  133. package/tools/ardy/README.md +13 -0
  134. package/tools/ardy/__pycache__/cclay_gvhmr_worker.cpython-313.pyc +0 -0
  135. package/tools/ardy/bridge.mjs +28 -47
  136. package/tools/ardy/bvh-cskel27.mjs +0 -2
  137. package/tools/ardy/cclay_gvhmr_worker.py +7 -1
  138. package/tools/ardy/extract.mjs +6 -2
  139. package/tools/ardy/motion-stabilize.mjs +109 -4
  140. package/tools/ardy/runners/gvhmr-worker.mjs +11 -2
  141. package/tools/dev/pages/privacy.html +57 -3
  142. package/tools/dev-full.mjs +5 -2
  143. package/tools/kimodo/edit.mjs +1 -6
  144. package/tools/kimodo/generate.mjs +84 -35
  145. package/tools/kimodo/local-output.mjs +265 -0
  146. package/tools/kimodo/mlx-generate.py +111 -0
  147. package/tools/kimodo/pose-constraints.mjs +0 -2
  148. package/tools/kimodo/runner.mjs +46 -8
  149. package/tools/kimodo/setup-on-box.sh +288 -32
  150. package/tools/run-tests.mjs +72 -4
  151. package/dist/assets/analytics-Dc9ooyn1.js +0 -1
  152. package/dist/assets/app-CCw5KRC0.css +0 -1
  153. package/dist/assets/app-CG7OIkz0.js +0 -4859
  154. package/dist/assets/shot-prompt-CuqtYxB7.css +0 -1
  155. package/dist/assets/shot-prompt-F2C_YN3J.js +0 -15
  156. package/dist/assets/workflow-BHvP2fxY.js +0 -179
package/CHANGELOG.md CHANGED
@@ -1,9 +1,79 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.9.0
4
+
5
+ The Agent panel moves onto the open-source pi harness with six model
6
+ providers, the Studio gains a gated Fal H3 motion workflow with a
7
+ mocap-readable mannequin, and the codebase sheds its dead exports and
8
+ committed research artifacts. **Node 22.19 is the new floor**, and Agent
9
+ sessions saved by earlier versions are skipped, not migrated.
10
+
11
+ Agent
12
+
13
+ - The Agent panel runs on the open-source pi agent harness
14
+ (`@earendil-works/pi-ai` and `@earendil-works/pi-agent-core`, MIT), which
15
+ the sidecar loads only when a turn starts.
16
+ - Six model providers instead of one: ChatGPT (the same Codex sign-in),
17
+ Anthropic, OpenAI, Google Gemini, OpenRouter and a self-hosted CLIProxyAPI.
18
+ Model ids read `provider/model`, and a bare id still resolves to the ChatGPT
19
+ provider. API keys come from `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`,
20
+ `GEMINI_API_KEY` or `GOOGLE_API_KEY`, `OPENROUTER_API_KEY` and
21
+ `CLIPROXY_API_KEY`, or from `~/.config/cozyclay/providers.json` (mode 0600),
22
+ managed through `GET/PUT/DELETE /agent/providers`, which never return key
23
+ material. Saved keys are validated before they are advertised as usable.
24
+ - A running Workflow turn can be steered: `POST /agent/turn/<turnId>/steer`
25
+ hands the text to the model at the next step of the same turn instead of
26
+ stopping it. Studio turns keep their frozen envelopes and refuse with
27
+ `STEER_UNSUPPORTED`.
28
+ - Conversations are stored in a new v2 transcript format that keeps each
29
+ provider's own message fields. Sessions saved before this version are
30
+ ignored, not migrated: the files stay on disk and are skipped by History.
31
+ - Images can be pasted or dropped into the Agent composer and travel with the
32
+ turn; pasted attachments come back as thumbnails in a resumed session.
33
+ - Studio Agent sessions persist across reloads, and the shared panel is split
34
+ into a surface-neutral core plus a Studio adapter whose receipts land as
35
+ Inspector rows.
36
+ - Studio commands: `patch_elements` is one thin family derived from the
37
+ element declaration table (environment description, style and sheet flag
38
+ included); element ranges are the single source of truth, partial receipts
39
+ are reported, revisions are read-safe, and a session re-admits within a turn.
40
+ - Stop handling: a Studio stop that names a motion job this session never
41
+ admitted is refused; retired jobs no longer accept stale stops; the model
42
+ registry is built single-flight and refreshed on sign-in.
43
+
44
+ Studio
45
+
46
+ - Gated Fal H3 motion generation: the capture card and a wide authoring modal
47
+ with duration, motion description and an editable prompt. References are
48
+ accepted only from a fixed camera with the palette mannequin, clipped or
49
+ unshaded references are rejected, and Fal video routes through H3 Max Turbo.
50
+ - The mannequin is readable for mocap input: separated palette hues per limb
51
+ and two eye marks on the face; a warning fires before cropped mocap framing.
52
+ - Motion extraction: hybrid 2D keypoints use palette-derived joints where the
53
+ render lost a part (face from ViTPose); GVHMR takes get a sigma-3 smoother and
54
+ a foot-anchored root. Clearing a motion take also drops its persisted
55
+ `motionRef`.
56
+ - Look through has one entry in the Shot monitor; the on-screen Shot camera
57
+ indicator and Esc return to the free camera without a duplicate toolbar
58
+ toggle.
59
+ - Camera fly, pan and orbit lock the pointer for the hold: the cursor hides,
60
+ the view can turn past the window edge, and release puts the cursor back
61
+ where the press started.
62
+ - One undo entry per key light, environment and character transform gesture;
63
+ agent camera history stays reachable after an object undo; persistence
64
+ elements are declared and verified.
65
+
66
+ Housekeeping
67
+
68
+ - Dead exports, duplicate 500 handlers and the committed `.omo/` research
69
+ artifacts are gone (#411). The README is restructured around the user path.
70
+ - `cclay live` and the agent sidecar share one workspace-selection rule.
71
+ - Agent tests keep their sessions out of the author's config directory.
72
+
3
73
  ## 1.8.1
4
74
 
5
75
  The Studio camera tutorial now starts where the landing page does and shows
6
- where to click.
76
+ where to click. Look-through flies the shot camera instead of opening the player.
7
77
 
8
78
  - Opening the tutorial (Settings ▾ → Camera tutorial or `/app/?tutorial=camera`)
9
79
  loads the City Block starter scene with the walk take on its character, at
@@ -16,6 +86,9 @@ where to click.
16
86
  turning green as they are pressed. The hint card names the region ("↓
17
87
  Timeline, Shots lane", "→ Viewport"). Overlays never take the pointer and go
18
88
  static under `prefers-reduced-motion`.
89
+ - **Look through** on the Camera bar (and the Shot monitor's expand icon) hands
90
+ the viewport to the shot camera with the same fly bindings as the free camera.
91
+ Esc returns. The chrome-free player remains the Workflow embed.
19
92
 
20
93
  ## 1.8.0
21
94
 
package/README.md CHANGED
@@ -13,24 +13,24 @@
13
13
  <p align="center">
14
14
  <a href="LICENSE"><img alt="License: AGPL-3.0" src="https://img.shields.io/badge/license-AGPL--3.0-blue"></a>
15
15
  <a href="https://www.npmjs.com/package/cozyclay"><img alt="npm" src="https://img.shields.io/npm/v/cozyclay"></a>
16
- <img alt="Node 22.13+" src="https://img.shields.io/badge/node-22.13%2B-brightgreen">
16
+ <img alt="Node 22.19+" src="https://img.shields.io/badge/node-22.19%2B-brightgreen">
17
17
  <a href="https://github.com/NomaDamas/CozyClay/stargazers"><img alt="Stars" src="https://img.shields.io/github/stars/NomaDamas/CozyClay?style=flat"></a>
18
18
  </p>
19
19
 
20
20
  <p align="center">
21
21
  <a href="https://cozyclay.org/#try">Try it in the browser</a> ·
22
- <a href="https://cozyclay.org/greybox-to-video/">Greybox to AI video</a> ·
23
- <a href="https://cozyclay.org/previs-software/">Previs software compared</a> ·
24
22
  <a href="#quick-start">Quick start</a> ·
25
23
  <a href="#what-you-can-do">Features</a> ·
26
- <a href="#ai-control-mcp">AI control</a> ·
24
+ <a href="#ai-control">AI control</a> ·
25
+ <a href="#workflow-canvas">Workflow</a> ·
27
26
  <a href="#controls">Controls</a> ·
27
+ <a href="#documentation">Docs</a> ·
28
28
  <a href="https://github.com/NomaDamas/CozyClay/issues">Issues</a>
29
29
  </p>
30
30
 
31
31
  ---
32
32
 
33
- CozyClay is a browser-based 3D staging studio built with Three.js and React Three Fiber. Block a scene, pose characters, sequence motion prompts on a timeline, and preview generated motion — all in one local workspace.
33
+ CozyClay is a browser-based previs studio built with Three.js and React Three Fiber. Block a scene, pose the cast, cut the camera on a timeline, then hand the same shot to an AI video model (Seedance, Kling, Veo, or your own) as a first frame, a reference clip, or a prompt — all from one local workspace. The keyframe pack's greybox clip is the input Seedance 2.5 documents as white-model control: "Use the white-model reference video as the sole guide for camera movement, pacing, framing, subject motion, and blocking" (seed.bytedance.com/en/seedance2_5). MiniMax H3, Wan 3.0, LTX Desktop and fal render-to-real take the same plain RGB clip.
34
34
 
35
35
  ```bash
36
36
  npx cozyclay
@@ -52,21 +52,19 @@ https://github.com/user-attachments/assets/1d0113e5-6922-443d-affc-1bdabc666247
52
52
 
53
53
  | | |
54
54
  | --- | --- |
55
- | **Stage a scene** | Create primitives and set pieces, then move, rotate and scale them with a W/E/R gizmo. Grid snapping is a preference, not a law — hold `Ctrl` mid-drag to invert it. A bird's-eye plan view drives 2D root waypoints for character paths. The topbar's Auto Color toggle gives every object its own stable display color — Blender's random viewport color, so twenty grey blockout boxes stay tellable apart — without touching the colors you authored (captures include the display colors while it is on). |
56
- | **Fly the camera** | Right-drag flies (WASD walks, Q/E cranes), middle-drag pans, Alt+drag orbits the selection, click selects, `F` frames — the muscle memory you already have from a 3D editor. |
57
- | **Undo anything** | Every scene mutation goes through one history store: a drag, a scrub, an inspector edit is exactly one undo entry. `Esc` cancels an in-flight drag and restores the pre-drag transform. |
58
- | **Generate motion** | Pose characters and export poses, sequence multi-phase motion as Prompt Blocks on a resizable timeline, send them to Kimodo, then play the result back with sparse IK correction where the generated motion needs fixing. |
59
- | **Direct it with an AI** | Connect Claude — or any MCP client — and ask for a shot in plain language. It places the cast, frames “a low wide profile”, generates multi-phase motion, and the viewport moves in front of you. See [AI control](#ai-control-mcp). |
60
-
61
- ## Requirements
62
-
63
- - Node.js 22.13 or newer
64
- - npm, or bun
65
- - A Chromium-based browser
66
- - An SSH-accessible NVIDIA machine running Kimodo, for motion generation — run `npm run kimodo:setup` once; the first setup downloads the Kimodo checkpoint and text-encoder stack.
55
+ | **Stage a scene** | Create primitives and set pieces, then move, rotate and scale them with the transform strip's gizmo. Grid snapping is a preference, not a law — hold `Ctrl` mid-drag to invert it. A bird's-eye Top-View drives 2D root waypoints for character paths. **View ▾** on the viewport bar holds the reference grid and Auto Color — Blender's random viewport color, so twenty grey blockout boxes stay tellable apart without touching the colors you authored (captures include the display colors while it is on). |
56
+ | **Fly the camera** | Right-drag flies (WASD walks, Q/E cranes), middle-drag pans, Alt+drag orbits the selection, click selects, `F` frames — the muscle memory you already have from a 3D editor. Fly, pan and orbit lock the pointer for the hold, so the view can turn past the window edge. Selecting the camera switches to Camera mode. **Look through** in the Shot monitor puts you behind the shot camera with the same bindings; click the on-screen **Shot camera** indicator or press `Esc` to return to the free camera. |
57
+ | **Cut and move the camera** | Add shots on the timeline, draw a dolly rail on the Top-View, set speed, height and crane, and preview the move through the shot camera. Each shot carries a **Target model** (Seedance 2.5, Kling 2, Veo 3, self-hosted MiniMax-H3) and is flagged when the cut runs past that model's limits. |
58
+ | **Export for AI video** | One **Export ▾** menu: a keyframe pack (first/last frame, clip, camera JSON, prompt, README) as a zip, an mp4 of the shot, depth + normal conditioning passes, a storyboard contact sheet, and an OTIO cut list. Seedance 2.5 reads the pack's greybox clip as its white-model reference video, and MiniMax H3, Wan 3.0, LTX Desktop and fal render-to-real accept the same clip. The **Shot Prompt** turns the framing into a structured prompt for the model you picked. |
59
+ | **Undo anything** | Every scene mutation goes through one history store: a drag, a scrub, an inspector edit, an agent's camera key is exactly one undo entry. `Esc` cancels an in-flight drag and restores the pre-drag transform. |
60
+ | **Generate motion** | Pose characters and export poses, sequence multi-phase motion as Prompt Blocks on a resizable timeline, send them to Kimodo, then play the result back with sparse IK correction where the generated motion needs fixing. Draw over a joint's trail to reshape a take, keep most of it and regenerate a window, and step back through its history. |
61
+ | **Capture motion from video or a photo** | Drop a clip or a still: the GPU box runs [GVHMR](https://github.com/zju3dv/GVHMR) and the result is retargeted onto the character with stabilisation, contact correction and a quality gate. |
62
+ | **Direct it with an AI** | Open the **Agent panel** (`Cmd/Ctrl+B`), sign in with your ChatGPT account, and ask for a shot in plain language; the conversation survives reloads and you can paste a reference screenshot into it. Or connect Claude — or any MCP client — or drive the Studio from a terminal with `cclay live`. All three place the cast, frame "a low wide profile", generate multi-phase motion, and the viewport moves in front of you. See [AI control](#ai-control). |
67
63
 
68
64
  ## Quick start
69
65
 
66
+ You need Node.js 22.19 or newer, npm or bun, and a Chromium-based browser.
67
+
70
68
  ```bash
71
69
  npx cozyclay
72
70
  # or
@@ -77,24 +75,55 @@ That downloads the built studio and opens it at `http://127.0.0.1:5180/app/`. No
77
75
 
78
76
  A global install gives you `cclay`, the same command with less typing. Once a day the launcher checks npm for a newer release and prints a one-line notice after the studio is up; it stays quiet when you're current or offline. `cclay update` installs the latest release, and `--no-update-check` skips the check entirely.
79
77
 
80
- Motion generation uses Kimodo by default once you point it at an SSH-accessible NVIDIA machine:
78
+ New to the camera? The seven-step tutorial runs inside the Studio on the City Block set: **Settings ▾ → Camera tutorial**, or open `http://127.0.0.1:5180/app/?tutorial=camera`. Each step points at the control it needs and completes only when you actually make the move.
79
+
80
+ ### From source
81
81
 
82
82
  ```bash
83
- CCLAY_KIMODO_HOST=user@your-gpu-box npx cozyclay
83
+ git clone https://github.com/NomaDamas/CozyClay.git
84
+ cd CozyClay
85
+ npm install
86
+ npm run dev
84
87
  ```
85
88
 
86
- Install the remote worker once:
89
+ Open `http://127.0.0.1:5180/app/` for the Studio (the root redirects there) and `http://127.0.0.1:5180/workflow/` for the Workflow canvas. `npm run dev` starts the studio together with its local Kimodo bridge once `CCLAY_KIMODO_HOST` points at a GPU box; without that variable it starts the studio alone and says so. `npm run dev:ui` starts the browser UI alone in every case.
90
+
91
+ ### Motion generation
92
+
93
+ Generating new motion needs Kimodo on a machine you can reach. Point the Studio at it and install the worker once:
87
94
 
88
95
  ```bash
89
96
  CCLAY_KIMODO_HOST=user@your-gpu-box npm run kimodo:setup
97
+ CCLAY_KIMODO_HOST=user@your-gpu-box npx cozyclay
90
98
  ```
91
99
 
92
- ## AI control (MCP)
100
+ The installer detects OS, architecture, RAM and CUDA and picks the best-supported backend for that host — kimodo-mlx on a big Apple Silicon machine, kimodo.cpp with Metal or CPU otherwise, the upstream PyTorch stack on NVIDIA. An SSH-accessible NVIDIA box is the classic target and the only route with the full feature set; the same box runs GVHMR for video and photo mocap. Routes, overrides and local-only limits are in [`docs/kimodo-setup.md`](docs/kimodo-setup.md).
101
+
102
+ ## AI control
103
+
104
+ Three surfaces drive the same scene, live, through one hub: a chat panel in the Studio, an MCP server for external assistants, and a terminal CLI.
93
105
 
94
- The studio ships an [MCP](https://modelcontextprotocol.io) server, so an AI assistant can drive it — the same scene, the same viewport, live:
106
+ ### Agent panel in the Studio
95
107
 
96
- > “Put a detective and a courier in an alley, give me a low wide profile shot,
97
- > then make her stand up from the chair, sprint, and trip.”
108
+ **View ▾ → Panels → Agent panel** (or `Cmd/Ctrl+B`) opens a chat column that signs in with your ChatGPT account (Codex OAuth; the token lives in `~/.config/cozyclay/`) and works the scene in front of you:
109
+
110
+ > "Put a detective and a courier in an alley, give me a low wide profile shot,
111
+ > then make her stand up from the chair, sprint, and trip."
112
+
113
+ - Every change comes back as a receipt that highlights the Inspector and hierarchy rows it touched, and `Cmd/Ctrl+Z` takes it back like any other edit.
114
+ - The conversation is stored under `~/.config/cozyclay/agent-sessions/` and resumes across reloads and restarts; **History** lists earlier sessions.
115
+ - Paste or drop up to four images into the composer — a reference frame, a storyboard panel — and they go with the turn.
116
+ - The agent has nine Studio tool families, from `inspect_studio` and `arrange_characters` to `patch_elements`, which sets any declared authored field (a character's tint, a shot's target model, the key light) by path. How it turns a pasted video prompt into blocking — what it asks, infers, or leaves empty — is the rule in [`docs/agent-prompt-to-scene.md`](docs/agent-prompt-to-scene.md).
117
+
118
+ The panel is not tied to ChatGPT. Models come from six providers: ChatGPT (your Codex sign-in), Anthropic, OpenAI, Google Gemini, OpenRouter and CLIProxyAPI. A model id reads `provider/model`, so you pick one in the dropdown and that is where the turn goes. The five API-key providers take a key from an environment variable (`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY` or `GOOGLE_API_KEY`, `OPENROUTER_API_KEY`, `CLIPROXY_API_KEY`) or from `~/.config/cozyclay/providers.json`, written at mode 0600 and never echoed back by any route; ChatGPT still signs in the way it always did. On the Workflow canvas you can steer a turn while it runs instead of stopping it. Conversations are saved in a new transcript format, so sessions recorded before this version are ignored rather than converted: the old files stay on disk, unread. The provider table, the key routes, the steer route and the session format are in [`docs/agent-cli.md`](docs/agent-cli.md).
119
+
120
+ The agent runs on [pi](https://github.com/earendil-works/pi), an open-source agent harness: `@earendil-works/pi-ai` and `@earendil-works/pi-agent-core` (MIT) are the only runtime dependencies the package declares, and the sidecar loads them lazily, when a turn starts.
121
+
122
+ The same panel sits on the right of the Workflow canvas, where it builds and runs canvas nodes.
123
+
124
+ ### MCP server
125
+
126
+ The studio ships an [MCP](https://modelcontextprotocol.io) server, so any MCP client can drive it — the same scene, the same viewport:
98
127
 
99
128
  ```json
100
129
  {
@@ -107,78 +136,20 @@ The studio ships an [MCP](https://modelcontextprotocol.io) server, so an AI assi
107
136
  }
108
137
  ```
109
138
 
110
- Drop that into `claude_desktop_config.json` (or any MCP client config) and restart the client. The
111
- first run automatically installs the MCP SDK's 95-package tree; opening the studio never waits on
112
- it, so those dependencies are fetched only when you actually want the server.
139
+ Drop that into `claude_desktop_config.json` (or any MCP client config) and restart the client. The first run automatically installs the MCP SDK's 95-package tree; opening the studio never waits on it, so those dependencies are fetched only when you actually want the server.
113
140
 
114
141
  - **Editor open?** Tool calls move the visible viewport — camera, cast, set, generated motion, prompt blocks on the timeline.
115
- - **No editor?** Scene and project tools run headless: block scenes, derive film vocabulary
116
- (“wide shot · right profile · knee level · 24mm”), render AI video prompts, and write
117
- `.cclayproject` files. `capture_frame`, `set_prompt_blocks`, `generate_motion`, and
118
- `apply_batch` require the live editor.
142
+ - **No editor?** Scene and project tools run headless: block scenes, derive film vocabulary ("wide shot · right profile · knee level · 24mm"), render AI video prompts, and write `.cclayproject` files. `capture_frame`, `set_prompt_blocks`, `generate_motion`, and `apply_batch` require the live editor.
119
143
 
120
144
  Tools, transports and the live-control protocol are documented in [`mcp/README.md`](mcp/README.md).
121
145
 
122
- ### From a clone
123
-
124
- ```bash
125
- git clone https://github.com/NomaDamas/CozyClay.git
126
- cd CozyClay
127
- npm install
128
- npm run dev
129
- ```
130
-
131
- Open `http://127.0.0.1:5180/` for the Studio. The Workflow canvas remains available at `http://127.0.0.1:5180/workflow/` when you need its node editor. `npm run dev` starts the studio together with its local Kimodo bridge once `CCLAY_KIMODO_HOST` points at a GPU box; without that variable it starts the studio alone and says so, and Block Generation stays unavailable until you set it. `npm run dev:ui` starts the browser UI alone in every case. The bridge listens on loopback only; Kimodo host variables are documented in [`tools/kimodo/setup-on-box.sh`](tools/kimodo/setup-on-box.sh).
132
-
133
- ### Workflow canvas
134
-
135
- The Vibe-Workflow canvas is available at `http://127.0.0.1:5180/workflow/`. It keeps the original node-style flow and adds a **CozyClay Scene** node with an interactive 3D viewport, frame/camera controls, and an Open Studio handoff. Start it with the normal dev server, or run `npm run dev:ui` by itself for local-only editing. Workflow graphs are saved in the browser and execute locally; no remote workflow service or API key is required.
136
-
137
- ## Hosted demo
138
-
139
- Installing a GPU motion backend is the hard part, so `cozyclay.org` also runs a queued demo: a visitor writes one prompt, gets a ticket link, and a GPU box owned by the maintainer generates the motion and uploads it. The visitor never installs anything and never leaves the site — the result opens in the studio itself.
140
-
141
- The pieces live in this repository, under `AGPL-3.0-or-later` like everything else:
142
-
143
- | Path | Role |
144
- | --- | --- |
145
- | `demo/`, `d/` | Static composer and ticket/result pages, built into `dist/` by the same `npm run build` |
146
- | `workers/api/` | Cloudflare Worker queue API (D1 for state, R2 for results), with its own pinned toolchain |
147
- | `tools/demo-worker/` | The GPU-box poller. Outbound fetch only — it never opens a listening socket |
148
-
149
- **Queue policy.** Jobs run in a single FIFO queue. All of these values live in `workers/api/src/policy.js`; nothing else carries a copy.
150
-
151
- | Rule | Value |
152
- | --- | --- |
153
- | Active jobs per account | 1 |
154
- | Daily cap | 2 per account |
155
- | Global waiting cap | 200, then submissions are refused |
156
- | Lease / heartbeat / hard timeout | 15 min lease, renewed every 60 s, 20 min hard stop |
157
- | Attempts | 2 (one automatic retry); a failed job refunds the daily cap |
158
- | Result retention | 30 days, then the R2 object is deleted |
159
- | Prompt limit | shared with the studio via `tools/ardy/prompt-limits.mjs` |
160
-
161
- **Secrets.** Never committed. Configure each with `wrangler secret put` against `workers/api/wrangler.toml`:
162
- `GOOGLE_CLIENT_SECRET`, `CC_WORKER_SECRET`, `SESSION_SIGNING_KEY`, `TURNSTILE_SECRET_KEY`. The non-secret `GOOGLE_CLIENT_ID` and `TURNSTILE_SITE_KEY` vars in `wrangler.toml` must also be replaced before a real deployment.
163
-
164
- **Running the API locally.**
146
+ ### From a terminal
165
147
 
166
- ```bash
167
- npm run demo:api:install # npm --prefix workers/api ci
168
- npm --prefix workers/api exec -- wrangler d1 migrations apply cozyclay-demo --local
169
- npm run demo:api # wrangler dev on 127.0.0.1:8787
170
- ```
148
+ `cclay live` is a small CLI that reads the scene, places and moves things, frames and keys shots, patches declared fields (`cclay live patch --target stage --set '{"keyLight.intensity":2.4}'`), verifies the result with a capture PNG, and undoes by receipt — one JSON object per command, stable error codes, no browser of your own required (only the studio tab itself). It is the intended surface for a coding agent that has to manage a running Studio. The full guide, with three worked sessions against a real editor, is in [`docs/agent-cli.md`](docs/agent-cli.md).
171
149
 
172
- **Running the GPU-box worker.** The hosted queue worker has its own isolated runtime and reaches the API outbound only. It is independent from the local Studio's Kimodo backend.
150
+ ## Workflow canvas
173
151
 
174
- ```bash
175
- CC_DEMO_API_BASE=https://api.cozyclay.org \
176
- CC_WORKER_ID=box1 \
177
- CC_WORKER_SECRET=... \
178
- npm run demo:worker
179
- ```
180
-
181
- See [`workers/api/README.md`](workers/api/README.md) for the deployment, migration and rollback runbook, and [`tools/demo-worker/README.md`](tools/demo-worker/README.md) for service units, environment-file permissions and the listening-socket check.
152
+ The Workflow canvas at `http://127.0.0.1:5180/workflow/` is a node editor around the Studio: a **CozyClay Scene** node with a live viewport that previews the shot camera, a **Shot Prompt** node that builds a structured prompt from the capture, **Image** nodes (versions, A/B, pinned references) and a **Video** node that runs through your own ComfyUI (`COZYCLAY_COMFY_URL`) or fal (`FAL_KEY`) — bring your own key, nothing is proxied. Graphs are saved in the browser and execute locally.
182
153
 
183
154
  ## Controls
184
155
 
@@ -192,7 +163,7 @@ See [`workers/api/README.md`](workers/api/README.md) for the deployment, migrati
192
163
  | Alt + drag | Orbit the selection |
193
164
  | Scroll | Dolly; while flying, sets the fly speed instead |
194
165
  | Click | Select; empty space clears |
195
- | W / E / R | Move / rotate / scale tool |
166
+ | Transform strip | Move / rotate / scale tool, snap |
196
167
  | Ctrl/Cmd (during drag) | Invert grid snapping |
197
168
  | Ctrl/Cmd+Z, Ctrl/Cmd+Shift+Z | Undo / redo |
198
169
  | Esc | Cancel the in-flight drag |
@@ -200,6 +171,26 @@ See [`workers/api/README.md`](workers/api/README.md) for the deployment, migrati
200
171
  | Ctrl/Cmd+D | Duplicate the selection |
201
172
  | Delete / Backspace | Delete the selection |
202
173
  | F | Frame the selection |
174
+ | Look through / Esc | Fly / leave the shot camera |
175
+ | Cmd/Ctrl+B | Show / hide the Agent panel |
176
+
177
+ Every control's home is recorded in [`docs/studio-ui-ia.md`](docs/studio-ui-ia.md), with the rule behind each placement.
178
+
179
+ ## Documentation
180
+
181
+ | Read | For |
182
+ | --- | --- |
183
+ | [`docs/kimodo-setup.md`](docs/kimodo-setup.md) | Installing Kimodo: the route table, CUDA over SSH, local MLX/Metal/CPU generation and what each route supports |
184
+ | [`docs/agent-cli.md`](docs/agent-cli.md) | Driving the Studio from a terminal with `cclay live` |
185
+ | [`docs/agent-prompt-to-scene.md`](docs/agent-prompt-to-scene.md) | The ask / infer / omit rule the Agent follows when turning a video prompt into blocking |
186
+ | [`mcp/README.md`](mcp/README.md) | MCP tools, transports, and the live-control protocol |
187
+ | [`docs/studio-ui-ia.md`](docs/studio-ui-ia.md) | Where every Studio control lives and why |
188
+ | [`docs/privacy.md`](docs/privacy.md) | The full analytics disclosure: events, identifiers, opt-out, internal QA marking |
189
+ | [`workers/api/README.md`](workers/api/README.md) | The hosted demo on cozyclay.org: queue policy, the Cloudflare Worker and the GPU-box poller |
190
+ | [`docs/releasing.md`](docs/releasing.md) | Publishing a signed npm release |
191
+ | [`CHANGELOG.md`](CHANGELOG.md) | What changed in each release |
192
+
193
+ Longer reads on the site: [Greybox to AI video](https://cozyclay.org/greybox-to-video/), [Seedance 2.5 camera control](https://cozyclay.org/seedance-camera-control/), [Camera control for AI video](https://cozyclay.org/ai-camera-control/), [Previs software compared](https://cozyclay.org/previs-software/).
203
194
 
204
195
  ## Validate
205
196
 
@@ -212,6 +203,9 @@ See [`workers/api/README.md`](workers/api/README.md) for the deployment, migrati
212
203
  | `npm run test:theme` / `test:appearance` / `test:layout` | UI theme, appearance, layout |
213
204
  | `npm run test:lifecycle` | Dev-server process lifecycle |
214
205
  | `npm run test:ardy` | Motion conversion, playback, and IK pipeline |
206
+ | `node tools/run-tests.mjs` | Every Node verification file (what CI runs) |
207
+ | `npm run qa:browser -- node test/qa-camera-tutorial-browser.mjs` | The seven-step tutorial driven with real input, beacons pinned to their controls |
208
+ | `QA_URL=… CDP_PORT=… OUT=/tmp/count npm run qa:browser -- node tools/qa/studio-control-count.mjs` | Simultaneously visible controls per mode (budget: Scene ≤35 / Camera ≤38 / Motion ≤52) |
215
209
  | `cd mcp && npm install && npm run verify` | MCP server over real stdio — all 420 framing combinations |
216
210
  | `cd mcp && npm run verify:live` | Live-control protocol against a fake editor (same `npm install` first) |
217
211
  | `npm run build` | Production build |
@@ -228,69 +222,22 @@ Found something broken, or want a feature? [Open an issue](https://github.com/No
228
222
 
229
223
  **Repository hygiene.** Generated motion archives, QA output, build output, logs and local runtime artifacts are not source files and must not be committed. Keep `tools/ardy/out/`, `artifacts/`, `dist/`, `.gjc/` and `.npz` files local.
230
224
 
231
- All runtime libraries intentionally live in `devDependencies` because the published npm package ships the prebuilt `dist/`, so `npx cozyclay` must not install the studio's dependency tree.
225
+ Every runtime library except the two agent packages (`@earendil-works/pi-ai`, `@earendil-works/pi-agent-core`) intentionally lives in `devDependencies`, because the published npm package ships the prebuilt `dist/`, so `npx cozyclay` must not install the studio's dependency tree.
232
226
 
233
227
  ## Analytics & privacy
234
228
 
235
- The hosted site at [cozyclay.org](https://cozyclay.org/) collects anonymous usage analytics via [PostHog](https://posthog.com/) (US Cloud). There are no cookies and no session recording, and Do-Not-Track is respected. A random pseudonymous identifier is kept in your browser's localStorage so that returning visits and retention can be counted; it is never linked to an account or project content and is removed by clearing site data or using the opt-out toggle.
236
-
237
- Events collected:
238
-
239
- | Event | Purpose |
240
- | --- | --- |
241
- | `install:first_launch` | First run of the official npm package |
242
- | `app:session_started` | Start of an official npm package session |
243
- | `app:session_ended` | Session duration, action count, and scenes touched (bucketed) |
244
- | `feature:used` | One signal per feature per session |
245
- | `$pageview` | Funnel and drop-off analysis |
246
- | `scene:created` | Funnel and drop-off analysis |
247
- | `scene:loaded` | Funnel and drop-off analysis |
248
- | `project:saved` | User-owned project persistence |
249
- | `project:opened` | Return to a saved project (age bucket) |
250
- | `craft:first_action` | Funnel and drop-off analysis |
251
- | `motion:backend_state` | Motion capability at session start (`none`, `local_kimodo`, or `hosted`) |
252
- | `motion:generate_blocked` | Generate intent when no motion backend is available |
253
- | `motion:job_started` | Motion reliability |
254
- | `motion:job_succeeded` | Motion reliability |
255
- | `motion:job_failed` | Motion reliability |
256
- | `export:blocking_frame_succeeded` | Funnel and drop-off analysis |
257
- | `activation:completed` | Funnel and drop-off analysis |
258
- | `hosted:composer_viewed`, `hosted:login_started`, `hosted:ticket_created` | Hosted demo funnel |
259
- | `hosted:result_opened`, `hosted:opened_in_studio` | Hosted result funnel |
260
-
261
- Geo data comes from ingest-time GeoIP country lookup only — no precise location is collected. Prompt text, asset names, file names, project content, local paths, and any user-entered text are never collected.
262
-
263
- The official npm package also measures anonymous first launches, sessions, and
264
- the same in-app funnel on its `127.0.0.1` studio. It stores one random
265
- installation identifier in `~/.config/cozyclay/state.json` so returning use can
266
- be counted across ports and browser storage resets. Source checkouts, forks,
267
- development servers, CI, and tests do not send analytics. Official npm
268
- artifacts carry a signature checked by the launcher, so copying or repackaging
269
- the source does not enable telemetry.
270
-
271
- Each event is registered with `origin_kind` (`local` or `hosted`), a coarse
272
- operating-system label, and (for npm sessions) `install_kind` (`npx` or
273
- `global`). Source checkouts are classified as `clone` and remain telemetry-off.
274
- The first npm launch may optionally answer a one-line channel question
275
- (`x`, `hn`, `reddit`, `github`, `friend`, `other`, or `skip`); `skip` sends no
276
- acquisition value. Session duration and action counts are buckets, and project
277
- events never include names, paths, prompts, or timestamps.
278
-
279
- The npm package prints this disclosure once on first launch. Control it at any
280
- time:
229
+ Anonymous usage counts, no cookies, no recordings, never your project content — on the hosted site via PostHog and in the official npm package, which prints the disclosure once on first launch. Source checkouts, forks, dev servers, CI and tests send nothing.
281
230
 
282
231
  ```bash
283
232
  cclay telemetry status
284
233
  cclay telemetry off
285
- cclay telemetry on
286
234
  ```
287
235
 
288
- `COZYCLAY_TELEMETRY=0` and `DO_NOT_TRACK=1` disable collection for a launch.
289
- The in-app topbar toggle changes the same npm-package setting and removes its
290
- anonymous installation identifier. Hosted-site visitors can opt out with that
291
- toggle, browser Do-Not-Track, or a content blocker.
236
+ `COZYCLAY_TELEMETRY=0` or `DO_NOT_TRACK=1` disables collection for a launch; **Settings ▾ → Privacy** is the same switch inside the Studio. The event list, what each identifier is, how internal QA traffic is marked and the first-edit definition are in [`docs/privacy.md`](docs/privacy.md).
237
+
238
+ ## Hosted demo
292
239
 
293
- PostHog's free plan retains events for 1 year.
240
+ Installing a GPU motion backend is the hard part, so `cozyclay.org` also runs a queued demo: a visitor writes one prompt, gets a ticket link, and a GPU box owned by the maintainer generates the motion and uploads it — the result opens in the studio itself. The composer pages, the Cloudflare Worker queue API and the GPU-box poller all live in this repository; the queue policy and runbooks are in [`workers/api/README.md`](workers/api/README.md).
294
241
 
295
242
  ## License & credits
296
243
 
@@ -34,6 +34,27 @@ ARDY is not bundled with CozyClay. Users must obtain, install, and operate ARDY
34
34
 
35
35
  ARDY model checkpoints and other model assets may be governed by separate terms, including the NVIDIA Open Model License identified by the ARDY project. Users are responsible for reviewing and complying with those terms before downloading or using the models.
36
36
 
37
+ ## NVIDIA Kimodo
38
+
39
+ CozyClay provides an optional bridge and data-conversion workflow for externally installed [Kimodo](https://github.com/nv-tlabs/kimodo), a human-motion generation project from NVIDIA Research, and [kimodo.cpp](https://github.com/localai-org/kimodo.cpp).
40
+
41
+ Kimodo runtimes and model weights are not bundled with CozyClay. Users must obtain, install, and operate them separately under NVIDIA's terms and the applicable runtime licenses.
42
+
43
+ - Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES (Kimodo skeleton data)
44
+ - Kimodo source license: Apache License 2.0
45
+ - Source: https://github.com/nv-tlabs/kimodo
46
+ - Source license: https://github.com/nv-tlabs/kimodo/blob/main/LICENSE
47
+ - kimodo.cpp source license: Apache License 2.0
48
+ - Source: https://github.com/localai-org/kimodo.cpp
49
+ - Source license: https://github.com/localai-org/kimodo.cpp/blob/main/LICENSE
50
+
51
+ `tools/kimodo/local-output.mjs` embeds skeleton constants extracted from the `nv-tlabs/kimodo` SOMA77 definitions and `kimodo/assets/skeletons/somaskel77/` assets at commit `1aece8c124d73d255ceff5086d983b844c9f4e94`: the joint hierarchy, neutral-pose offsets, and relaxed-hand rotation matrices. The source assets are pinned by SHA256:
52
+
53
+ - `joints.p`: `dc5fd8e39e0ff312f5d0f536a87ac22ac58445e13443fcb8ab54e6817cb97ce7`
54
+ - `relaxed_hands_rest_pose.npy`: `64a3828e0d1ef1f1de8228c74eba8040c0810d898169f1892d8997a213b2b64c`
55
+
56
+ Kimodo model checkpoints and other model assets may be governed by separate terms, including the NVIDIA Open Model License identified by the Kimodo project. Users are responsible for reviewing and complying with those terms before downloading or using the models.
57
+
37
58
  ## Meta Llama 3
38
59
 
39
60
  ARDY's text encoder is based on Meta Llama 3 (`Meta-Llama-3-8B-Instruct`).
@@ -117,6 +138,33 @@ event table and opt-out controls.
117
138
  - License: Apache-2.0 AND MIT
118
139
  - Source: https://github.com/PostHog/posthog-js
119
140
 
141
+ ## pi agent packages
142
+
143
+ The optional agent sidecar loads `@earendil-works/pi-ai` and
144
+ `@earendil-works/pi-agent-core` at runtime (they are declared dependencies,
145
+ loaded lazily by the sidecar; the launcher itself does not import them).
146
+
147
+ - Copyright (c) Earendil Works
148
+ - License: MIT
149
+ - Source: https://github.com/earendil-works/pi (packages/ai → @earendil-works/pi-ai, packages/agent → @earendil-works/pi-agent-core)
150
+
151
+ Their transitive runtime dependencies, which the agent sidecar also loads, are:
152
+
153
+ - `@anthropic-ai/sdk` — License: MIT — https://github.com/anthropics/anthropic-sdk-typescript
154
+ - `openai` — License: Apache-2.0 — https://github.com/openai/openai-node
155
+ - `@google/genai` — License: Apache-2.0 — https://github.com/googleapis/js-genai
156
+ - `@aws-sdk/client-bedrock-runtime` — License: Apache-2.0 — https://github.com/aws/aws-sdk-js-v3
157
+ - `@smithy/node-http-handler` — License: Apache-2.0 — https://github.com/smithy-lang/smithy-typescript
158
+ - `http-proxy-agent` — License: MIT — https://github.com/TooTallNate/proxy-agents
159
+ - `https-proxy-agent` — License: MIT — https://github.com/TooTallNate/proxy-agents
160
+ - `partial-json` — License: MIT — https://github.com/promplate/partial-json-parser-js
161
+ - `typebox` — License: MIT — https://github.com/sinclairzx81/typebox
162
+ - `@earendil-works/chord` — License: MIT — https://github.com/earendil-works/pi
163
+ - `@earendil-works/pi-telemetry` — License: MIT — https://github.com/earendil-works/pi
164
+ - `diff` — License: BSD-3-Clause — https://github.com/kpdecker/jsdiff
165
+ - `ignore` — License: MIT — https://github.com/kaelzhang/node-ignore
166
+ - `yaml` — License: ISC — https://github.com/eemeli/yaml
167
+
120
168
  ## CozyClay license scope
121
169
 
122
170
  The CozyClay combined work in this repository is distributed under AGPL-3.0-or-later, subject to the transition details in `LICENSING.md`. That license does not replace or relicense Three.js, ARDY, ARDY model checkpoints, the bundled fonts, the character rigs, or any other third-party component.