agentcut 0.0.0-stage → 0.1.1

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 (248) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +11 -2
  3. package/dist/bridge.d.ts +45 -0
  4. package/dist/bridge.js +691 -0
  5. package/dist/bridge.js.map +1 -0
  6. package/dist/config.d.ts +13 -0
  7. package/dist/config.js +50 -0
  8. package/dist/config.js.map +1 -0
  9. package/dist/index.d.ts +2 -0
  10. package/dist/index.js +35 -0
  11. package/dist/index.js.map +1 -0
  12. package/dist/log.d.ts +1 -0
  13. package/dist/log.js +14 -0
  14. package/dist/log.js.map +1 -0
  15. package/dist/studio/agents/claude.d.ts +7 -0
  16. package/dist/studio/agents/claude.js +155 -0
  17. package/dist/studio/agents/claude.js.map +1 -0
  18. package/dist/studio/agents/codex.d.ts +4 -0
  19. package/dist/studio/agents/codex.js +169 -0
  20. package/dist/studio/agents/codex.js.map +1 -0
  21. package/dist/studio/agents/index.d.ts +8 -0
  22. package/dist/studio/agents/index.js +50 -0
  23. package/dist/studio/agents/index.js.map +1 -0
  24. package/dist/studio/agents/types.d.ts +131 -0
  25. package/dist/studio/agents/types.js +11 -0
  26. package/dist/studio/agents/types.js.map +1 -0
  27. package/dist/studio/bundler.d.ts +29 -0
  28. package/dist/studio/bundler.js +136 -0
  29. package/dist/studio/bundler.js.map +1 -0
  30. package/dist/studio/chat.d.ts +147 -0
  31. package/dist/studio/chat.js +681 -0
  32. package/dist/studio/chat.js.map +1 -0
  33. package/dist/studio/cli.d.ts +2 -0
  34. package/dist/studio/cli.js +194 -0
  35. package/dist/studio/cli.js.map +1 -0
  36. package/dist/studio/components.d.ts +4 -0
  37. package/dist/studio/components.js +36 -0
  38. package/dist/studio/components.js.map +1 -0
  39. package/dist/studio/host.d.ts +105 -0
  40. package/dist/studio/host.js +634 -0
  41. package/dist/studio/host.js.map +1 -0
  42. package/dist/studio/http.d.ts +21 -0
  43. package/dist/studio/http.js +240 -0
  44. package/dist/studio/http.js.map +1 -0
  45. package/dist/studio/music.d.ts +35 -0
  46. package/dist/studio/music.js +130 -0
  47. package/dist/studio/music.js.map +1 -0
  48. package/dist/studio/proc.d.ts +11 -0
  49. package/dist/studio/proc.js +69 -0
  50. package/dist/studio/proc.js.map +1 -0
  51. package/dist/studio/projects.d.ts +84 -0
  52. package/dist/studio/projects.js +369 -0
  53. package/dist/studio/projects.js.map +1 -0
  54. package/dist/studio/render.d.ts +24 -0
  55. package/dist/studio/render.js +197 -0
  56. package/dist/studio/render.js.map +1 -0
  57. package/dist/studio/reveal.d.ts +7 -0
  58. package/dist/studio/reveal.js +49 -0
  59. package/dist/studio/reveal.js.map +1 -0
  60. package/dist/studio/schema.d.ts +4152 -0
  61. package/dist/studio/schema.js +358 -0
  62. package/dist/studio/schema.js.map +1 -0
  63. package/dist/studio/tools.d.ts +2 -0
  64. package/dist/studio/tools.js +165 -0
  65. package/dist/studio/tools.js.map +1 -0
  66. package/dist/studio/voice.d.ts +150 -0
  67. package/dist/studio/voice.js +434 -0
  68. package/dist/studio/voice.js.map +1 -0
  69. package/dist/studio/workspace.d.ts +31 -0
  70. package/dist/studio/workspace.js +187 -0
  71. package/dist/studio/workspace.js.map +1 -0
  72. package/package.json +50 -4
  73. package/template/AGENTS.md +13 -0
  74. package/template/components/CATALOG.md +1306 -0
  75. package/template/components/README.md +61 -0
  76. package/template/components/STYLES.md +246 -0
  77. package/template/components/arcade-title/ArcadeTitle.tsx +860 -0
  78. package/template/components/arcade-title/meta.json +28 -0
  79. package/template/components/aurora/Aurora.tsx +63 -0
  80. package/template/components/aurora/meta.json +28 -0
  81. package/template/components/bar-wipe-title/BarWipeTitle.tsx +94 -0
  82. package/template/components/bar-wipe-title/meta.json +29 -0
  83. package/template/components/before-after/BeforeAfter.tsx +89 -0
  84. package/template/components/before-after/meta.json +233 -0
  85. package/template/components/bento-grid/BentoGrid.tsx +202 -0
  86. package/template/components/bento-grid/meta.json +25 -0
  87. package/template/components/blur-in-title/BlurInTitle.tsx +121 -0
  88. package/template/components/blur-in-title/meta.json +32 -0
  89. package/template/components/catalog.json +8730 -0
  90. package/template/components/catalog.ts +103 -0
  91. package/template/components/chat-thread/ChatThread.tsx +128 -0
  92. package/template/components/chat-thread/meta.json +24 -0
  93. package/template/components/checklist/Checklist.tsx +129 -0
  94. package/template/components/checklist/meta.json +25 -0
  95. package/template/components/confetti/Confetti.tsx +109 -0
  96. package/template/components/confetti/meta.json +28 -0
  97. package/template/components/countdown/Countdown.tsx +166 -0
  98. package/template/components/countdown/meta.json +28 -0
  99. package/template/components/cut-and-paste/CutAndPaste.tsx +654 -0
  100. package/template/components/cut-and-paste/meta.json +29 -0
  101. package/template/components/decode-text/DecodeText.tsx +97 -0
  102. package/template/components/decode-text/meta.json +29 -0
  103. package/template/components/editorial-quote/EditorialQuote.tsx +122 -0
  104. package/template/components/editorial-quote/meta.json +28 -0
  105. package/template/components/glitch-title/GlitchTitle.tsx +171 -0
  106. package/template/components/glitch-title/meta.json +32 -0
  107. package/template/components/halftone-wave/HalftoneWave.tsx +106 -0
  108. package/template/components/halftone-wave/meta.json +28 -0
  109. package/template/components/highlighter/Highlighter.tsx +142 -0
  110. package/template/components/highlighter/meta.json +28 -0
  111. package/template/components/hook-card/HookCard.tsx +552 -0
  112. package/template/components/hook-card/meta.json +304 -0
  113. package/template/components/index.ts +149 -0
  114. package/template/components/iris-wipe/IrisWipe.tsx +76 -0
  115. package/template/components/iris-wipe/meta.json +24 -0
  116. package/template/components/kinetic-poster/KineticPoster.tsx +437 -0
  117. package/template/components/kinetic-poster/meta.json +31 -0
  118. package/template/components/kinetic-punch/KineticPunch.tsx +80 -0
  119. package/template/components/kinetic-punch/meta.json +30 -0
  120. package/template/components/lava-lamp/LavaLamp.tsx +92 -0
  121. package/template/components/lava-lamp/meta.json +28 -0
  122. package/template/components/letter-cascade/LetterCascade.tsx +102 -0
  123. package/template/components/letter-cascade/meta.json +29 -0
  124. package/template/components/lib.ts +179 -0
  125. package/template/components/light-leak/LightLeakTransition.tsx +43 -0
  126. package/template/components/light-leak/meta.json +74 -0
  127. package/template/components/line-diagram/LineDiagram.tsx +205 -0
  128. package/template/components/line-diagram/meta.json +217 -0
  129. package/template/components/list-card/ListCard.tsx +104 -0
  130. package/template/components/list-card/meta.json +232 -0
  131. package/template/components/logo-sting/LogoSting.tsx +129 -0
  132. package/template/components/logo-sting/meta.json +29 -0
  133. package/template/components/looks.tsx +1447 -0
  134. package/template/components/lower-third/LowerThird.tsx +100 -0
  135. package/template/components/lower-third/meta.json +24 -0
  136. package/template/components/marquee/Marquee.tsx +100 -0
  137. package/template/components/marquee/meta.json +30 -0
  138. package/template/components/notification/Notification.tsx +115 -0
  139. package/template/components/notification/meta.json +27 -0
  140. package/template/components/outline-fill/OutlineFill.tsx +106 -0
  141. package/template/components/outline-fill/meta.json +28 -0
  142. package/template/components/panel-sweep/PanelSweep.tsx +86 -0
  143. package/template/components/panel-sweep/meta.json +25 -0
  144. package/template/components/prompt-box/PromptBox.tsx +131 -0
  145. package/template/components/prompt-box/meta.json +24 -0
  146. package/template/components/props.ts +73 -0
  147. package/template/components/quote-card/QuoteCard.tsx +71 -0
  148. package/template/components/quote-card/meta.json +216 -0
  149. package/template/components/shape-shift/ShapeShift.tsx +420 -0
  150. package/template/components/shape-shift/meta.json +31 -0
  151. package/template/components/slide-zoom-message/SlideZoomMessage.tsx +179 -0
  152. package/template/components/slide-zoom-message/meta.json +199 -0
  153. package/template/components/social-post/SocialPost.tsx +185 -0
  154. package/template/components/social-post/meta.json +30 -0
  155. package/template/components/split-flap/SplitFlap.tsx +191 -0
  156. package/template/components/split-flap/meta.json +29 -0
  157. package/template/components/spotlight-grid/SpotlightGrid.tsx +84 -0
  158. package/template/components/spotlight-grid/meta.json +25 -0
  159. package/template/components/stat-counter/StatCounter.tsx +117 -0
  160. package/template/components/stat-counter/meta.json +27 -0
  161. package/template/components/sticker-badge/StickerBadge.tsx +46 -0
  162. package/template/components/sticker-badge/meta.json +220 -0
  163. package/template/components/sticker-slam/StickerSlam.tsx +941 -0
  164. package/template/components/sticker-slam/meta.json +34 -0
  165. package/template/components/style-layer.tsx +233 -0
  166. package/template/components/styles.json +762 -0
  167. package/template/components/styles.ts +113 -0
  168. package/template/components/target-lock/TargetLock.tsx +662 -0
  169. package/template/components/target-lock/meta.json +32 -0
  170. package/template/components/text-reveal/TextReveal.tsx +99 -0
  171. package/template/components/text-reveal/meta.json +28 -0
  172. package/template/components/tile-wipe/TileWipe.tsx +75 -0
  173. package/template/components/tile-wipe/meta.json +24 -0
  174. package/template/components/type-zoom/TypeZoom.tsx +103 -0
  175. package/template/components/type-zoom/meta.json +27 -0
  176. package/template/components/types.ts +66 -0
  177. package/template/components/typewriter/Typewriter.tsx +112 -0
  178. package/template/components/typewriter/meta.json +29 -0
  179. package/template/components/word-pop/WordPop.tsx +59 -0
  180. package/template/components/word-pop/meta.json +237 -0
  181. package/template/components/word-stack/WordStack.tsx +122 -0
  182. package/template/components/word-stack/meta.json +27 -0
  183. package/template/components/word-swap/WordSwap.tsx +127 -0
  184. package/template/components/word-swap/meta.json +30 -0
  185. package/template/presets/charcoal-sketch/PROMPT.md +48 -0
  186. package/template/presets/charcoal-sketch/assets/paper/grain-0.png +0 -0
  187. package/template/presets/charcoal-sketch/assets/paper/grain-1.png +0 -0
  188. package/template/presets/charcoal-sketch/assets/paper/grain-2.png +0 -0
  189. package/template/presets/charcoal-sketch/assets/paper/sketch-paper.jpg +0 -0
  190. package/template/presets/charcoal-sketch/assets/paper/smudge.png +0 -0
  191. package/template/presets/charcoal-sketch/poster.jpg +0 -0
  192. package/template/presets/charcoal-sketch/preset.json +17 -0
  193. package/template/presets/charcoal-sketch/preview.mp4 +0 -0
  194. package/template/presets/charcoal-sketch/scenes/Grain.tsx +23 -0
  195. package/template/presets/charcoal-sketch/scenes/Paper.tsx +17 -0
  196. package/template/presets/charcoal-sketch/scenes/examples/Agents.tsx +100 -0
  197. package/template/presets/charcoal-sketch/scenes/examples/Approvals.tsx +110 -0
  198. package/template/presets/charcoal-sketch/scenes/examples/Blog.tsx +105 -0
  199. package/template/presets/charcoal-sketch/scenes/examples/EndCard.tsx +41 -0
  200. package/template/presets/charcoal-sketch/scenes/examples/Hook.tsx +130 -0
  201. package/template/presets/charcoal-sketch/scenes/examples/Ideas.tsx +92 -0
  202. package/template/presets/charcoal-sketch/scenes/examples/Posting.tsx +128 -0
  203. package/template/presets/charcoal-sketch/scenes/lib/painfix.tsx +119 -0
  204. package/template/presets/charcoal-sketch/scenes/lib/sketch.tsx +291 -0
  205. package/template/presets/charcoal-sketch/scripts/build_layers.example.py +193 -0
  206. package/template/presets/charcoal-sketch/scripts/duck_music.py +34 -0
  207. package/template/presets/charcoal-sketch/scripts/make_textures.py +93 -0
  208. package/template/presets/punk-cut-paper/PROMPT.md +37 -0
  209. package/template/presets/punk-cut-paper/assets/paper/desk-cream.jpg +0 -0
  210. package/template/presets/punk-cut-paper/assets/paper/grain-overlay.png +0 -0
  211. package/template/presets/punk-cut-paper/assets/paper/halftone-black.png +0 -0
  212. package/template/presets/punk-cut-paper/assets/paper/halftone-red.png +0 -0
  213. package/template/presets/punk-cut-paper/assets/paper/halftone-yellow.png +0 -0
  214. package/template/presets/punk-cut-paper/assets/paper/kraft.jpg +0 -0
  215. package/template/presets/punk-cut-paper/assets/paper/newsprint.jpg +0 -0
  216. package/template/presets/punk-cut-paper/assets/paper/paper-cream.jpg +0 -0
  217. package/template/presets/punk-cut-paper/assets/paper/paper-white.jpg +0 -0
  218. package/template/presets/punk-cut-paper/assets/paper/tape.png +0 -0
  219. package/template/presets/punk-cut-paper/build_layers.example.py +150 -0
  220. package/template/presets/punk-cut-paper/poster.jpg +0 -0
  221. package/template/presets/punk-cut-paper/preset.json +15 -0
  222. package/template/presets/punk-cut-paper/preview.mp4 +0 -0
  223. package/template/presets/punk-cut-paper/scenes/Backdrop.tsx +76 -0
  224. package/template/presets/punk-cut-paper/scenes/Motif.tsx +376 -0
  225. package/template/presets/punk-cut-paper/scenes/Photo.tsx +73 -0
  226. package/template/presets/punk-cut-paper/scenes/Ransom.tsx +119 -0
  227. package/template/presets/punk-cut-paper/scenes/Xerox.tsx +31 -0
  228. package/template/presets/punk-cut-paper/scenes/lib/punk.tsx +208 -0
  229. package/template/runtime/composition.tsx +920 -0
  230. package/template/runtime/helpers.tsx +228 -0
  231. package/template/runtime/index.tsx +22 -0
  232. package/template/runtime/types.ts +248 -0
  233. package/template/skill/SKILL.md +149 -0
  234. package/template/skill/references/browser-export.md +61 -0
  235. package/template/skill/references/components.md +38 -0
  236. package/template/skill/references/craft.md +53 -0
  237. package/template/skill/references/cursor.md +91 -0
  238. package/template/skill/references/footage.md +73 -0
  239. package/template/skill/references/format.md +140 -0
  240. package/template/skill/references/presets.md +56 -0
  241. package/template/skill/references/sound.md +128 -0
  242. package/template/starter/.studio/chat.json +1 -0
  243. package/template/starter/assets/.keep +0 -0
  244. package/template/starter/layers.json +46 -0
  245. package/template/starter/notes.md +4 -0
  246. package/template/starter/project.json +13 -0
  247. package/template/starter/renders/.keep +0 -0
  248. package/template/starter/scenes/Title.tsx +38 -0
@@ -0,0 +1,187 @@
1
+ import { copyFileSync, existsSync, mkdirSync, readdirSync, readFileSync, statSync, writeFileSync, } from "node:fs";
2
+ import { homedir } from "node:os";
3
+ import { dirname, join, resolve } from "node:path";
4
+ import { fileURLToPath } from "node:url";
5
+ import { getConfig, PACKAGE_VERSION } from "../config.js";
6
+ import { AGENTS } from "./agents/index.js";
7
+ export const REMOTION_VERSION = "4.0.536";
8
+ export const REACT_VERSION = "19.2.8";
9
+ const packageRoot = dirname(dirname(dirname(fileURLToPath(import.meta.url))));
10
+ export const TEMPLATE_DIR = join(packageRoot, "template");
11
+ export const MCP_ENTRY = join(packageRoot, "dist", "index.js");
12
+ export const SKILL_NAME = "agentcut";
13
+ export function defaultWorkspaceDir() {
14
+ return join(homedir(), "Agentcut");
15
+ }
16
+ export function workspacePaths(root) {
17
+ const absolute = resolve(root);
18
+ return {
19
+ root: absolute,
20
+ projects: join(absolute, "projects"),
21
+ library: join(absolute, "library"),
22
+ internal: join(absolute, ".agentcut"),
23
+ runtime: join(absolute, ".agentcut", "runtime"),
24
+ render: join(absolute, ".agentcut", "render"),
25
+ mcpConfig: join(absolute, ".agentcut", "mcp.json"),
26
+ };
27
+ }
28
+ /** The agentcut MCP server every agent in the workspace connects to. */
29
+ export function studioMcpServer(paths) {
30
+ return {
31
+ name: "agentcut",
32
+ command: process.execPath,
33
+ args: [MCP_ENTRY],
34
+ env: {
35
+ AGENTCUT_WORKSPACE: paths.root,
36
+ AGENTCUT_PORT: String(getConfig().port),
37
+ },
38
+ };
39
+ }
40
+ function copyDir(from, to) {
41
+ mkdirSync(to, { recursive: true });
42
+ for (const entry of readdirSync(from, { withFileTypes: true })) {
43
+ const source = join(from, entry.name);
44
+ const target = join(to, entry.name);
45
+ if (entry.isDirectory())
46
+ copyDir(source, target);
47
+ else
48
+ copyFileSync(source, target);
49
+ }
50
+ }
51
+ function writeIfChanged(path, contents) {
52
+ mkdirSync(dirname(path), { recursive: true });
53
+ try {
54
+ if (readFileSync(path, "utf8") === contents)
55
+ return;
56
+ }
57
+ catch { }
58
+ writeFileSync(path, contents);
59
+ }
60
+ const MANAGED_DEPENDENCIES = {
61
+ remotion: REMOTION_VERSION,
62
+ "@remotion/media": REMOTION_VERSION,
63
+ "@remotion/transitions": REMOTION_VERSION,
64
+ "@remotion/shapes": REMOTION_VERSION,
65
+ "@remotion/paths": REMOTION_VERSION,
66
+ "@remotion/noise": REMOTION_VERSION,
67
+ "@remotion/light-leaks": REMOTION_VERSION,
68
+ "@remotion/cli": REMOTION_VERSION,
69
+ react: REACT_VERSION,
70
+ "react-dom": REACT_VERSION,
71
+ };
72
+ const MANAGED_DEV_DEPENDENCIES = {
73
+ "@types/react": "^19.2.0",
74
+ typescript: "^5.8.3",
75
+ };
76
+ /**
77
+ * Managed packages that aren't installed in the workspace (or are on another pinned version).
78
+ * A local render runs `npm install` when this isn't empty, so new library deps arrive on their own.
79
+ */
80
+ export function missingManagedDependencies(root) {
81
+ return Object.entries(MANAGED_DEPENDENCIES)
82
+ .filter(([name, wanted]) => {
83
+ try {
84
+ const installed = JSON.parse(readFileSync(join(root, "node_modules", name, "package.json"), "utf8"));
85
+ return /^\d/.test(wanted) && installed.version !== wanted;
86
+ }
87
+ catch {
88
+ return true;
89
+ }
90
+ })
91
+ .map(([name]) => name);
92
+ }
93
+ function ensurePackageJson(root) {
94
+ const path = join(root, "package.json");
95
+ let current = {};
96
+ try {
97
+ current = JSON.parse(readFileSync(path, "utf8"));
98
+ }
99
+ catch { }
100
+ const dependencies = { ...current.dependencies };
101
+ const devDependencies = { ...current.devDependencies };
102
+ Object.assign(dependencies, MANAGED_DEPENDENCIES);
103
+ Object.assign(devDependencies, MANAGED_DEV_DEPENDENCIES);
104
+ const next = {
105
+ name: "agentcut-workspace",
106
+ private: true,
107
+ description: "Agentcut workspace. Remotion versions are managed by agentcut.",
108
+ ...current,
109
+ dependencies,
110
+ devDependencies,
111
+ scripts: {
112
+ typecheck: "tsc --noEmit",
113
+ ...current.scripts,
114
+ },
115
+ };
116
+ writeIfChanged(path, `${JSON.stringify(next, null, 2)}\n`);
117
+ }
118
+ const TSCONFIG = {
119
+ compilerOptions: {
120
+ target: "ES2022",
121
+ lib: ["ES2022", "DOM", "DOM.Iterable"],
122
+ module: "ESNext",
123
+ moduleResolution: "Bundler",
124
+ jsx: "react-jsx",
125
+ strict: true,
126
+ skipLibCheck: true,
127
+ noEmit: true,
128
+ resolveJsonModule: true,
129
+ baseUrl: ".",
130
+ paths: {
131
+ "agentcut": [".agentcut/runtime/helpers.tsx"],
132
+ "agentcut/components": [".agentcut/components/index.ts"],
133
+ },
134
+ },
135
+ include: ["projects/**/*.ts", "projects/**/*.tsx", ".agentcut/runtime/**/*.tsx", ".agentcut/runtime/**/*.ts", ".agentcut/components/**/*.tsx", ".agentcut/components/**/*.ts"],
136
+ };
137
+ /** Create or refresh the workspace. Managed files are rewritten; projects are never touched. */
138
+ export function scaffoldWorkspace(root) {
139
+ const paths = workspacePaths(root);
140
+ const created = !existsSync(paths.root);
141
+ for (const dir of [paths.root, paths.projects, paths.library, paths.internal, paths.render]) {
142
+ mkdirSync(dir, { recursive: true });
143
+ }
144
+ copyDir(join(TEMPLATE_DIR, "runtime"), paths.runtime);
145
+ // The component library: the agent reads it (and the catalog), local renders import it.
146
+ if (existsSync(join(TEMPLATE_DIR, "components"))) {
147
+ copyDir(join(TEMPLATE_DIR, "components"), join(paths.root, ".agentcut", "components"));
148
+ }
149
+ // Built-in video style presets land in the library once; after that they're the user's to edit.
150
+ const presets = join(TEMPLATE_DIR, "presets");
151
+ if (existsSync(presets)) {
152
+ for (const entry of readdirSync(presets, { withFileTypes: true })) {
153
+ const target = join(paths.library, "presets", entry.name);
154
+ if (entry.isDirectory() && !existsSync(target))
155
+ copyDir(join(presets, entry.name), target);
156
+ }
157
+ }
158
+ // Each agent reads its own instructions file and finds skills in its own folder.
159
+ const instructions = readFileSync(join(TEMPLATE_DIR, "AGENTS.md"), "utf8");
160
+ for (const dir of new Set(AGENTS.map((agent) => agent.skillsDir))) {
161
+ copyDir(join(TEMPLATE_DIR, "skill"), join(paths.root, dir, SKILL_NAME));
162
+ }
163
+ for (const agent of AGENTS) {
164
+ const skillPath = `${agent.skillsDir}/${SKILL_NAME}/SKILL.md`;
165
+ writeIfChanged(join(paths.root, agent.instructionsFile), instructions.replaceAll("{{SKILL_PATH}}", skillPath));
166
+ }
167
+ writeIfChanged(join(paths.root, "tsconfig.json"), `${JSON.stringify(TSCONFIG, null, 2)}\n`);
168
+ ensurePackageJson(paths.root);
169
+ const mcp = studioMcpServer(paths);
170
+ writeIfChanged(paths.mcpConfig, `${JSON.stringify({ mcpServers: { [mcp.name]: { command: mcp.command, args: mcp.args, env: mcp.env } } }, null, 2)}\n`);
171
+ writeIfChanged(join(paths.internal, "VERSION"), `${PACKAGE_VERSION}\n`);
172
+ writeIfChanged(join(paths.internal, "README.md"), "Managed by agentcut. Files here are rewritten every time the studio starts.\n");
173
+ const projectEntries = readdirSync(paths.projects).filter((name) => !name.startsWith("."));
174
+ if (projectEntries.length === 0) {
175
+ copyDir(join(TEMPLATE_DIR, "starter"), join(paths.projects, "welcome"));
176
+ }
177
+ return { paths, created };
178
+ }
179
+ export function isDirectory(path) {
180
+ try {
181
+ return statSync(path).isDirectory();
182
+ }
183
+ catch {
184
+ return false;
185
+ }
186
+ }
187
+ //# sourceMappingURL=workspace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../src/studio/workspace.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,UAAU,EACV,SAAS,EACT,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAsB,MAAM,mBAAmB,CAAC;AAE/D,MAAM,CAAC,MAAM,gBAAgB,GAAG,SAAS,CAAC;AAC1C,MAAM,CAAC,MAAM,aAAa,GAAG,QAAQ,CAAC;AAEtC,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9E,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;AAC1D,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;AAY/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O,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,IAAI,CAAC;QACH,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;IACtC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,52 @@
1
1
  {
2
2
  "name": "agentcut",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.1",
4
+ "description": "Local helper for Agentcut: runs your coding agent (Claude Code or Codex), your video workspace and live preview bundles for the Agentcut studio page.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "bin": {
8
+ "agentcut": "dist/studio/cli.js"
9
+ },
10
+ "publishConfig": {
11
+ "access": "public"
12
+ },
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/deifos/Agentcut.git",
16
+ "directory": "packages/agentcut"
17
+ },
18
+ "files": [
19
+ "dist",
20
+ "template",
21
+ "README.md",
22
+ "LICENSE"
23
+ ],
24
+ "scripts": {
25
+ "build": "tsc",
26
+ "typecheck": "tsc --noEmit",
27
+ "studio": "tsx src/studio/cli.ts",
28
+ "sync:skill": "node scripts/sync-studio-skill.mjs",
29
+ "prepack": "npm run sync:skill && npm run build"
30
+ },
31
+ "keywords": [
32
+ "agentcut",
33
+ "mcp",
34
+ "remotion",
35
+ "video",
36
+ "claude-code",
37
+ "codex"
38
+ ],
39
+ "engines": {
40
+ "node": ">=20.10"
41
+ },
42
+ "dependencies": {
43
+ "@modelcontextprotocol/sdk": "^1.29.0",
44
+ "esbuild": "^0.28.2",
45
+ "zod": "^3.25.76"
46
+ },
47
+ "devDependencies": {
48
+ "@types/node": "^24.0.3",
49
+ "tsx": "^4.20.3",
50
+ "typescript": "^5.8.3"
51
+ }
52
+ }
@@ -0,0 +1,13 @@
1
+ # Agentcut workspace
2
+
3
+ Managed by `agentcut` (rewritten on every start; put your own notes in a project's `notes.md`).
4
+
5
+ You build videos here for the user, who watches the Agentcut page (chat, live preview,
6
+ timeline). Every message comes with a `<studio-context>` block naming the active project (and an
7
+ `<earlier-conversation>` block when you take over a chat another agent started).
8
+
9
+ - Load and follow the `agentcut` skill (`{{SKILL_PATH}}`) before any change.
10
+ - Projects live in `projects/<slug>/`: `project.json`, `layers.json`, `scenes/*.tsx`, `assets/`, `notes.md`, `renders/`.
11
+ - Never delete or overwrite anything in `renders/`; never touch `.agentcut/` (managed).
12
+ - Check your work with the `agentcut_*` tools (status, capture frames, listen) — never claim a
13
+ frame looks right or a sound fits without a capture or a measurement behind it.