@causyne/agent 1.20.29 → 1.20.31
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/package.json +1 -1
- package/src/acp/client.js +20 -6
- package/src/acp/client.ts +20 -6
- package/src/appChannel.js +52 -74
- package/src/appChannel.ts +106 -0
- package/src/creative/apps.js +206 -11
- package/src/creative/apps.ts +198 -6
- package/src/creative/liveBridge.js +1481 -0
- package/src/creative/liveBridge.ts +1829 -0
- package/src/creative/pipeline.js +31 -3
- package/src/creative/pipeline.ts +36 -7
- package/src/decideTools.js +3 -1
- package/src/decideTools.ts +3 -1
- package/src/decisionPolicy.js +5 -2
- package/src/decisionPolicy.ts +7 -1
- package/src/historyPruner.js +4 -1
- package/src/historyPruner.ts +4 -1
- package/src/memory/episodicStore.js +17 -5
- package/src/memory/episodicStore.ts +16 -5
- package/src/memory/symbolFolder.js +146 -22
- package/src/memory/symbolFolder.ts +144 -22
- package/src/sandbox.js +5 -1
- package/src/smartToolsUse.js +2 -1
- package/src/smartToolsUse.ts +2 -1
- package/src/tool-scripts/resolve_automator.py +167 -34
- package/src/toolPacks.js +5 -3
- package/src/toolPacks.ts +5 -3
- package/src/tools/creativeApps.js +226 -7
- package/src/tools/creativeApps.ts +233 -7
- package/src/tools/memoryRecall.js +1 -1
- package/src/tools/memoryRecall.ts +1 -1
- package/src/tools/resolveAutomator.js +356 -89
- package/src/tools/resolveAutomator.ts +403 -0
- package/src/toolsList.js +1 -1
- package/src/toolsList.ts +1 -1
|
@@ -127,11 +127,11 @@ function extractPrecedingDocComment(lines: readonly string[], lineIndex: number)
|
|
|
127
127
|
idx--;
|
|
128
128
|
}
|
|
129
129
|
const summary = docLines.join(' ').trim();
|
|
130
|
-
return summary ? summary.slice(0,
|
|
130
|
+
return summary ? summary.slice(0, 65) : undefined;
|
|
131
131
|
}
|
|
132
132
|
if (line.startsWith('//') || line.startsWith('#')) {
|
|
133
133
|
const cleaned = line.replace(/^(?:\/\/+|#+)\s*/, '').trim();
|
|
134
|
-
return cleaned ? cleaned.slice(0,
|
|
134
|
+
return cleaned ? cleaned.slice(0, 65) : undefined;
|
|
135
135
|
}
|
|
136
136
|
return undefined;
|
|
137
137
|
}
|
|
@@ -171,26 +171,144 @@ function extractCollapsedSignature(lines: readonly string[], startIndex: number,
|
|
|
171
171
|
.slice(0, 110);
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
function findBraceBlockEnd(lines: readonly string[], startIndex: number): number {
|
|
175
|
-
|
|
176
|
-
let
|
|
174
|
+
function findBraceBlockEnd(lines: readonly string[], startIndex: number, kind: FoldedSymbolKind): number {
|
|
175
|
+
const isCallable = kind === 'function' || kind === 'method';
|
|
176
|
+
let inBlockComment = false;
|
|
177
|
+
let parenDepth = 0;
|
|
178
|
+
let seenParamsOpen = false;
|
|
179
|
+
let seenParamsClose = !isCallable;
|
|
180
|
+
let typeBraceDepth = 0;
|
|
181
|
+
let bodyDepth = 0;
|
|
182
|
+
let bodyOpened = false;
|
|
183
|
+
let lastNonWs = '';
|
|
184
|
+
|
|
177
185
|
for (let i = startIndex; i < lines.length; i++) {
|
|
178
186
|
const line = lines[i] ?? '';
|
|
187
|
+
let inSingleQuote = false;
|
|
188
|
+
let inDoubleQuote = false;
|
|
189
|
+
let inTemplate = false;
|
|
190
|
+
|
|
179
191
|
for (let c = 0; c < line.length; c++) {
|
|
180
|
-
const ch = line[c];
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
192
|
+
const ch = line[c] ?? '';
|
|
193
|
+
const next = line[c + 1] ?? '';
|
|
194
|
+
|
|
195
|
+
if (inBlockComment) {
|
|
196
|
+
if (ch === '*' && next === '/') {
|
|
197
|
+
inBlockComment = false;
|
|
198
|
+
c += 1;
|
|
199
|
+
}
|
|
200
|
+
continue;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
if (ch === '\\') {
|
|
204
|
+
c += 1;
|
|
205
|
+
continue;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
if (inSingleQuote) {
|
|
209
|
+
if (ch === '\'') inSingleQuote = false;
|
|
210
|
+
continue;
|
|
211
|
+
}
|
|
212
|
+
if (inDoubleQuote) {
|
|
213
|
+
if (ch === '"') inDoubleQuote = false;
|
|
214
|
+
continue;
|
|
215
|
+
}
|
|
216
|
+
if (inTemplate) {
|
|
217
|
+
if (ch === '`') inTemplate = false;
|
|
218
|
+
continue;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
if (ch === '/' && next === '/') {
|
|
222
|
+
break;
|
|
223
|
+
}
|
|
224
|
+
if (ch === '/' && next === '*') {
|
|
225
|
+
inBlockComment = true;
|
|
226
|
+
c += 1;
|
|
227
|
+
continue;
|
|
228
|
+
}
|
|
229
|
+
if (ch === '\'') {
|
|
230
|
+
inSingleQuote = true;
|
|
231
|
+
if (seenParamsClose && !bodyOpened && typeBraceDepth === 0) lastNonWs = ch;
|
|
232
|
+
continue;
|
|
233
|
+
}
|
|
234
|
+
if (ch === '"') {
|
|
235
|
+
inDoubleQuote = true;
|
|
236
|
+
if (seenParamsClose && !bodyOpened && typeBraceDepth === 0) lastNonWs = ch;
|
|
237
|
+
continue;
|
|
238
|
+
}
|
|
239
|
+
if (ch === '`') {
|
|
240
|
+
inTemplate = true;
|
|
241
|
+
if (seenParamsClose && !bodyOpened && typeBraceDepth === 0) lastNonWs = ch;
|
|
242
|
+
continue;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
if (!seenParamsClose) {
|
|
246
|
+
if (ch === '(') {
|
|
247
|
+
parenDepth += 1;
|
|
248
|
+
seenParamsOpen = true;
|
|
249
|
+
} else if (ch === ')') {
|
|
250
|
+
parenDepth -= 1;
|
|
251
|
+
if (seenParamsOpen && parenDepth <= 0) {
|
|
252
|
+
seenParamsClose = true;
|
|
253
|
+
parenDepth = 0;
|
|
254
|
+
lastNonWs = ')';
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
continue;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
if (!bodyOpened) {
|
|
261
|
+
if (typeBraceDepth > 0) {
|
|
262
|
+
if (ch === '{') {
|
|
263
|
+
typeBraceDepth += 1;
|
|
264
|
+
} else if (ch === '}') {
|
|
265
|
+
typeBraceDepth -= 1;
|
|
266
|
+
if (typeBraceDepth <= 0) {
|
|
267
|
+
typeBraceDepth = 0;
|
|
268
|
+
lastNonWs = '}';
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
continue;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
if (ch === '(') {
|
|
275
|
+
parenDepth += 1;
|
|
276
|
+
lastNonWs = '(';
|
|
277
|
+
} else if (ch === ')') {
|
|
278
|
+
parenDepth = Math.max(0, parenDepth - 1);
|
|
279
|
+
lastNonWs = ')';
|
|
280
|
+
} else if (ch === '{') {
|
|
281
|
+
if (
|
|
282
|
+
isCallable &&
|
|
283
|
+
(parenDepth > 0 ||
|
|
284
|
+
lastNonWs === ':' ||
|
|
285
|
+
lastNonWs === '|' ||
|
|
286
|
+
lastNonWs === '&' ||
|
|
287
|
+
lastNonWs === '<' ||
|
|
288
|
+
lastNonWs === ',' ||
|
|
289
|
+
lastNonWs === '=')
|
|
290
|
+
) {
|
|
291
|
+
typeBraceDepth = 1;
|
|
292
|
+
} else {
|
|
293
|
+
bodyOpened = true;
|
|
294
|
+
bodyDepth = 1;
|
|
295
|
+
}
|
|
296
|
+
} else if (ch === ';' && parenDepth === 0) {
|
|
187
297
|
return i + 1;
|
|
298
|
+
} else if (!/\s/.test(ch)) {
|
|
299
|
+
lastNonWs = ch;
|
|
300
|
+
}
|
|
301
|
+
} else {
|
|
302
|
+
if (ch === '{') {
|
|
303
|
+
bodyDepth += 1;
|
|
304
|
+
} else if (ch === '}') {
|
|
305
|
+
bodyDepth -= 1;
|
|
306
|
+
if (bodyDepth <= 0) {
|
|
307
|
+
return i + 1;
|
|
308
|
+
}
|
|
188
309
|
}
|
|
189
310
|
}
|
|
190
311
|
}
|
|
191
|
-
if (!opened && line.trim().endsWith(';')) {
|
|
192
|
-
return i + 1;
|
|
193
|
-
}
|
|
194
312
|
}
|
|
195
313
|
return Math.min(lines.length, startIndex + 1);
|
|
196
314
|
}
|
|
@@ -223,6 +341,9 @@ export function foldSourceContentOutline(
|
|
|
223
341
|
const ext = path.extname(filePath).toLowerCase();
|
|
224
342
|
const language = LANGUAGE_BY_EXT[ext] ?? 'text';
|
|
225
343
|
const lines = content.split(/\r?\n/);
|
|
344
|
+
if (lines.length > 1 && lines[lines.length - 1] === '') {
|
|
345
|
+
lines.pop();
|
|
346
|
+
}
|
|
226
347
|
const totalLines = lines.length;
|
|
227
348
|
|
|
228
349
|
let importCount = 0;
|
|
@@ -255,20 +376,25 @@ export function foldSourceContentOutline(
|
|
|
255
376
|
const rawName = m[pat.nameGroup] || m[3] || '';
|
|
256
377
|
if (!rawName || RESERVED_METHOD_NAMES.has(rawName)) continue;
|
|
257
378
|
|
|
258
|
-
// For class method pattern, ensure it is
|
|
379
|
+
// For class method pattern, ensure it is not a bodyless call ending in `;`
|
|
259
380
|
if (pat.kind === 'method') {
|
|
260
381
|
const sigCheck = extractCollapsedSignature(lines, i, 'method');
|
|
261
|
-
if (sigCheck.endsWith(';')
|
|
382
|
+
if (sigCheck.endsWith(';')) continue;
|
|
262
383
|
}
|
|
263
384
|
|
|
264
385
|
const exported = /\bexport\b|\bpub\b/.test(line);
|
|
265
386
|
const lineStart = i + 1;
|
|
266
387
|
const lineEnd = language === 'python'
|
|
267
388
|
? findIndentBlockEnd(lines, i)
|
|
268
|
-
: findBraceBlockEnd(lines, i);
|
|
389
|
+
: findBraceBlockEnd(lines, i, pat.kind);
|
|
269
390
|
const signature = extractCollapsedSignature(lines, i, pat.kind);
|
|
270
391
|
const docComment = extractPrecedingDocComment(lines, i);
|
|
271
392
|
|
|
393
|
+
// Advance past non-class symbol bodies so statements inside functions/methods aren't misread as methods
|
|
394
|
+
if (pat.kind !== 'class') {
|
|
395
|
+
i = Math.max(i, lineEnd - 1);
|
|
396
|
+
}
|
|
397
|
+
|
|
272
398
|
if (lowerQuery) {
|
|
273
399
|
const hay = `${rawName} ${signature} ${docComment ?? ''}`.toLowerCase();
|
|
274
400
|
if (!hay.includes(lowerQuery)) break;
|
|
@@ -283,10 +409,6 @@ export function foldSourceContentOutline(
|
|
|
283
409
|
exported,
|
|
284
410
|
...(docComment ? { docComment } : {})
|
|
285
411
|
});
|
|
286
|
-
// Advance past multi-line parameter list header if applicable so inner lines aren't misread as methods
|
|
287
|
-
if (pat.kind === 'function') {
|
|
288
|
-
i = Math.max(i, lineEnd - 1);
|
|
289
|
-
}
|
|
290
412
|
break;
|
|
291
413
|
}
|
|
292
414
|
}
|
package/src/sandbox.js
CHANGED
|
@@ -296,7 +296,11 @@ export class Sandbox {
|
|
|
296
296
|
}
|
|
297
297
|
|
|
298
298
|
if (toolName === 'creative_apps') {
|
|
299
|
-
|
|
299
|
+
const isReadOnly =
|
|
300
|
+
args.action === 'status' ||
|
|
301
|
+
args.action === 'verify_bridge' ||
|
|
302
|
+
(args.action === 'live_bridge' && args.liveOperation === 'inspect_active');
|
|
303
|
+
return { allowed: true, risk: isReadOnly ? 'safe' : 'dangerous' };
|
|
300
304
|
}
|
|
301
305
|
|
|
302
306
|
if (toolName === 'native_engine') {
|
package/src/smartToolsUse.js
CHANGED
|
@@ -125,7 +125,7 @@ const SYSTEM_ADMIN_PATTERN = /\b(kill process|kill port|check port|port \d+|lsof
|
|
|
125
125
|
// Simple file management operations (reading small notes, listing/deleting/moving files)
|
|
126
126
|
const SIMPLE_FILE_OP_PATTERN = /\b(list (the )?files|show files|count files|rename file(s)?|delete file(s)?|move file(s)?|clean (up )?folder|read (the )?(?:note|file)|summarize (?:its )?content)\b/i;
|
|
127
127
|
// Media generation intent (explicit creation of 3D, video, audio, or synthesized speech)
|
|
128
|
-
const EXPLICIT_MEDIA_GENERATION_PATTERN = /\b(blender|3d model|render 3d|render frame|render animation|da vinci|resolve|audio synth|synthesizer|text to speech|tts|voiceover|dubbing)\b|\.blend\d
|
|
128
|
+
const EXPLICIT_MEDIA_GENERATION_PATTERN = /\b(blender|3d model|render 3d|render frame|render animation|da vinci|resolve|photoshop|premiere|after\s*effects|illustrator|indesign|media\s*encoder|uxp|audio synth|synthesizer|text to speech|tts|voiceover|dubbing)\b|\.(blend\d*|psd|prproj|aep|ai|indd|ccx)\b/i;
|
|
129
129
|
// Explicit web engineering intent
|
|
130
130
|
const EXPLICIT_WEB_ENGINEERING_PATTERN = /\b(build|create|make|design|develop|implement|redesign|buat\w*)\b[\s\S]*\b(web|website|webpage|webapp|landing page|dashboard|ui|frontend|threejs|three\.js|thre\.?js|3js|webgl|canvas)\b/i;
|
|
131
131
|
// Explicit game development intent
|
|
@@ -283,6 +283,7 @@ export function determineToolScope(prompt, _taskShape) {
|
|
|
283
283
|
// 7. Game development and interactive simulation intent (simulators, 3D worlds, games)
|
|
284
284
|
if (EXPLICIT_GAME_DEV_PATTERN.test(text)) {
|
|
285
285
|
const tools = new Set([
|
|
286
|
+
'creative_apps',
|
|
286
287
|
'fs_write',
|
|
287
288
|
'fs_edit',
|
|
288
289
|
'fs_read',
|
package/src/smartToolsUse.ts
CHANGED
|
@@ -166,7 +166,7 @@ const SIMPLE_FILE_OP_PATTERN =
|
|
|
166
166
|
|
|
167
167
|
// Media generation intent (explicit creation of 3D, video, audio, or synthesized speech)
|
|
168
168
|
const EXPLICIT_MEDIA_GENERATION_PATTERN =
|
|
169
|
-
/\b(blender|3d model|render 3d|render frame|render animation|da vinci|resolve|audio synth|synthesizer|text to speech|tts|voiceover|dubbing)\b|\.blend\d
|
|
169
|
+
/\b(blender|3d model|render 3d|render frame|render animation|da vinci|resolve|photoshop|premiere|after\s*effects|illustrator|indesign|media\s*encoder|uxp|audio synth|synthesizer|text to speech|tts|voiceover|dubbing)\b|\.(blend\d*|psd|prproj|aep|ai|indd|ccx)\b/i;
|
|
170
170
|
|
|
171
171
|
// Explicit web engineering intent
|
|
172
172
|
const EXPLICIT_WEB_ENGINEERING_PATTERN =
|
|
@@ -344,6 +344,7 @@ export function determineToolScope(
|
|
|
344
344
|
// 7. Game development and interactive simulation intent (simulators, 3D worlds, games)
|
|
345
345
|
if (EXPLICIT_GAME_DEV_PATTERN.test(text)) {
|
|
346
346
|
const tools = new Set([
|
|
347
|
+
'creative_apps',
|
|
347
348
|
'fs_write',
|
|
348
349
|
'fs_edit',
|
|
349
350
|
'fs_read',
|
|
@@ -6,60 +6,97 @@ def run_bridge(args):
|
|
|
6
6
|
try:
|
|
7
7
|
import DaVinciResolveScript as dvr_script
|
|
8
8
|
except ImportError:
|
|
9
|
-
print(json.dumps({
|
|
9
|
+
print(json.dumps({
|
|
10
|
+
"success": False,
|
|
11
|
+
"error": "[ENGINE MISSING] DaVinci Resolve Studio Python API not found. Ensure 'External scripting using: Local' is enabled in Preferences -> System -> General, and DaVinci Resolve is running."
|
|
12
|
+
}))
|
|
10
13
|
return
|
|
11
14
|
|
|
12
15
|
resolve = dvr_script.scriptapp("Resolve")
|
|
13
16
|
if resolve is None:
|
|
14
|
-
print(json.dumps({
|
|
17
|
+
print(json.dumps({
|
|
18
|
+
"success": False,
|
|
19
|
+
"error": "[CONNECTION ERROR] Could not connect to DaVinci Resolve. Ensure DaVinci Resolve is open."
|
|
20
|
+
}))
|
|
15
21
|
return
|
|
16
22
|
|
|
17
23
|
projectManager = resolve.GetProjectManager()
|
|
18
24
|
project = projectManager.GetCurrentProject()
|
|
19
25
|
if not project:
|
|
20
|
-
print(json.dumps({"success": False, "error": "No open project found."}))
|
|
26
|
+
print(json.dumps({"success": False, "error": "No open project found in DaVinci Resolve."}))
|
|
21
27
|
return
|
|
22
28
|
|
|
23
29
|
mediaPool = project.GetMediaPool()
|
|
24
30
|
timeline = project.GetCurrentTimeline()
|
|
25
|
-
|
|
26
31
|
action = args.get("action")
|
|
27
|
-
|
|
32
|
+
|
|
28
33
|
if action == "checkConnection":
|
|
34
|
+
tl_name = timeline.GetName() if timeline else None
|
|
29
35
|
print(json.dumps({
|
|
30
|
-
"success": True,
|
|
36
|
+
"success": True,
|
|
37
|
+
"projectName": project.GetName(),
|
|
38
|
+
"timelineName": tl_name,
|
|
31
39
|
"message": f"Connected to DaVinci Resolve. Active Project: {project.GetName()}"
|
|
32
40
|
}))
|
|
33
41
|
return
|
|
34
42
|
|
|
43
|
+
elif action == "inspectActive":
|
|
44
|
+
tl_name = timeline.GetName() if timeline else None
|
|
45
|
+
video_tracks = timeline.GetTrackCount("video") if timeline and hasattr(timeline, "GetTrackCount") else 0
|
|
46
|
+
audio_tracks = timeline.GetTrackCount("audio") if timeline and hasattr(timeline, "GetTrackCount") else 0
|
|
47
|
+
timecode = timeline.GetCurrentTimecode() if timeline and hasattr(timeline, "GetCurrentTimecode") else "01:00:00:00"
|
|
48
|
+
fps = project.GetSetting("timelineFrameRate") if hasattr(project, "GetSetting") else "24"
|
|
49
|
+
res_x = project.GetSetting("timelineResolutionWidth") if hasattr(project, "GetSetting") else "1920"
|
|
50
|
+
res_y = project.GetSetting("timelineResolutionHeight") if hasattr(project, "GetSetting") else "1080"
|
|
51
|
+
print(json.dumps({
|
|
52
|
+
"success": True,
|
|
53
|
+
"host": "resolve",
|
|
54
|
+
"operation": "inspectActive",
|
|
55
|
+
"projectName": project.GetName(),
|
|
56
|
+
"timelineName": tl_name,
|
|
57
|
+
"videoTracks": video_tracks,
|
|
58
|
+
"audioTracks": audio_tracks,
|
|
59
|
+
"currentTimecode": timecode,
|
|
60
|
+
"fps": fps or "24",
|
|
61
|
+
"resolutionWidth": res_x or "1920",
|
|
62
|
+
"resolutionHeight": res_y or "1080"
|
|
63
|
+
}))
|
|
64
|
+
return
|
|
65
|
+
|
|
35
66
|
elif action == "setupColorManagement":
|
|
36
|
-
mode = args.get("color_space_mode", "automatic").lower()
|
|
67
|
+
mode = str(args.get("color_space_mode", "automatic")).lower()
|
|
37
68
|
try:
|
|
38
69
|
project.SetSetting("colorScienceMode", "davinciYRGBColorManaged")
|
|
39
|
-
|
|
40
70
|
if mode == "automatic":
|
|
41
71
|
project.SetSetting("automaticColorManagement", "1")
|
|
42
72
|
print(json.dumps({
|
|
43
|
-
"success": True,
|
|
44
|
-
"
|
|
73
|
+
"success": True,
|
|
74
|
+
"mode": "automatic",
|
|
75
|
+
"message": "Applied Automatic DaVinci YRGB Color Management (RCM)."
|
|
45
76
|
}))
|
|
46
77
|
else:
|
|
78
|
+
in_cs = args.get("input_color_space", "ARRI LogC3")
|
|
79
|
+
tl_cs = args.get("timeline_color_space", "DaVinci WG/Intermediate")
|
|
80
|
+
out_cs = args.get("output_color_space", "Rec.709 Gamma 2.4")
|
|
47
81
|
project.SetSetting("automaticColorManagement", "0")
|
|
48
82
|
project.SetSetting("colorSpaceManager", "Custom")
|
|
49
|
-
project.SetSetting("colorSpaceInput",
|
|
50
|
-
project.SetSetting("colorSpaceTimeline",
|
|
51
|
-
project.SetSetting("colorSpaceOutput",
|
|
52
|
-
|
|
83
|
+
project.SetSetting("colorSpaceInput", in_cs)
|
|
84
|
+
project.SetSetting("colorSpaceTimeline", tl_cs)
|
|
85
|
+
project.SetSetting("colorSpaceOutput", out_cs)
|
|
53
86
|
print(json.dumps({
|
|
54
|
-
"success": True,
|
|
55
|
-
"
|
|
87
|
+
"success": True,
|
|
88
|
+
"mode": "custom",
|
|
89
|
+
"inputColorSpace": in_cs,
|
|
90
|
+
"timelineColorSpace": tl_cs,
|
|
91
|
+
"outputColorSpace": out_cs,
|
|
92
|
+
"message": f"Applied Custom RCM: {in_cs} -> {tl_cs} -> {out_cs}."
|
|
56
93
|
}))
|
|
57
94
|
except Exception as e:
|
|
58
95
|
print(json.dumps({"success": False, "error": f"Failed to setup RCM: {str(e)}"}))
|
|
59
96
|
return
|
|
60
97
|
|
|
61
|
-
elif action
|
|
62
|
-
media_path = args.get("mediaPath")
|
|
98
|
+
elif action in ("importAndAssemble", "insertClipAtPlayhead"):
|
|
99
|
+
media_path = args.get("mediaPath") or args.get("input")
|
|
63
100
|
if not media_path or not os.path.exists(media_path):
|
|
64
101
|
print(json.dumps({"success": False, "error": f"Media path not found: {media_path}"}))
|
|
65
102
|
return
|
|
@@ -69,41 +106,137 @@ def run_bridge(args):
|
|
|
69
106
|
if not imported_clips:
|
|
70
107
|
print(json.dumps({"success": False, "error": "No media found or imported."}))
|
|
71
108
|
return
|
|
72
|
-
|
|
109
|
+
|
|
73
110
|
fps = str(args.get("fps", "auto")).lower()
|
|
74
111
|
res_x = str(args.get("resolution_x", "auto")).lower()
|
|
75
112
|
res_y = str(args.get("resolution_y", "auto")).lower()
|
|
76
|
-
|
|
113
|
+
|
|
77
114
|
if fps == "auto" or res_x == "auto" or res_y == "auto":
|
|
78
115
|
first_clip = imported_clips[0]
|
|
79
|
-
|
|
80
116
|
if fps == "auto":
|
|
81
|
-
detected_fps = first_clip.GetClipProperty("FPS")
|
|
82
|
-
fps = str(detected_fps) if detected_fps else "
|
|
83
|
-
|
|
117
|
+
detected_fps = first_clip.GetClipProperty("FPS") if hasattr(first_clip, "GetClipProperty") else None
|
|
118
|
+
fps = str(detected_fps) if detected_fps else "24"
|
|
84
119
|
if res_x == "auto" or res_y == "auto":
|
|
85
|
-
detected_res = first_clip.GetClipProperty("Resolution")
|
|
120
|
+
detected_res = first_clip.GetClipProperty("Resolution") if hasattr(first_clip, "GetClipProperty") else None
|
|
86
121
|
if detected_res and "x" in str(detected_res):
|
|
87
122
|
parts = str(detected_res).split("x")
|
|
88
123
|
res_x, res_y = parts[0], parts[1]
|
|
89
124
|
else:
|
|
90
|
-
res_x, res_y = "
|
|
125
|
+
res_x, res_y = "1920", "1080"
|
|
91
126
|
|
|
92
127
|
project.SetSetting("timelineFrameRate", fps)
|
|
93
128
|
project.SetSetting("timelineResolutionWidth", res_x)
|
|
94
129
|
project.SetSetting("timelineResolutionHeight", res_y)
|
|
95
|
-
|
|
130
|
+
|
|
96
131
|
if not timeline:
|
|
97
|
-
|
|
98
|
-
|
|
132
|
+
timeline_name = args.get("timelineName") or "Causyne_Automated_Timeline"
|
|
133
|
+
timeline = mediaPool.CreateEmptyTimeline(timeline_name)
|
|
134
|
+
|
|
135
|
+
if args.get("timecode") and hasattr(timeline, "SetCurrentTimecode"):
|
|
136
|
+
timeline.SetCurrentTimecode(str(args.get("timecode")))
|
|
137
|
+
|
|
99
138
|
mediaPool.AppendToTimeline(imported_clips)
|
|
100
|
-
|
|
139
|
+
|
|
140
|
+
if args.get("markerName") and hasattr(timeline, "AddMarker"):
|
|
141
|
+
frame_id = int(args.get("markerFrame", 0))
|
|
142
|
+
marker_color = str(args.get("markerColor", "Blue"))
|
|
143
|
+
marker_name = str(args.get("markerName"))
|
|
144
|
+
marker_note = str(args.get("markerNote", "Added by Causyne Agent"))
|
|
145
|
+
timeline.AddMarker(frame_id, marker_color, marker_name, marker_note, 1)
|
|
146
|
+
|
|
147
|
+
print(json.dumps({
|
|
148
|
+
"success": True,
|
|
149
|
+
"action": action,
|
|
150
|
+
"timelineName": timeline.GetName(),
|
|
151
|
+
"importedCount": len(imported_clips),
|
|
152
|
+
"resolution": f"{res_x}x{res_y}",
|
|
153
|
+
"fps": fps,
|
|
154
|
+
"message": f"Imported {len(imported_clips)} clip(s) into timeline '{timeline.GetName()}' ({res_x}x{res_y} @ {fps}fps)."
|
|
155
|
+
}))
|
|
156
|
+
except Exception as e:
|
|
157
|
+
print(json.dumps({"success": False, "error": f"Failed during media import/assembly: {str(e)}"}))
|
|
158
|
+
return
|
|
159
|
+
|
|
160
|
+
elif action == "addMarker":
|
|
161
|
+
if not timeline:
|
|
162
|
+
print(json.dumps({"success": False, "error": "No active timeline in DaVinci Resolve."}))
|
|
163
|
+
return
|
|
164
|
+
try:
|
|
165
|
+
frame_id = int(args.get("frameId", 0))
|
|
166
|
+
color = str(args.get("markerColor", "Blue"))
|
|
167
|
+
name = str(args.get("markerName", "Causyne Marker"))
|
|
168
|
+
note = str(args.get("markerNote", ""))
|
|
169
|
+
duration = int(args.get("duration", 1))
|
|
170
|
+
ok = timeline.AddMarker(frame_id, color, name, note, duration)
|
|
171
|
+
print(json.dumps({
|
|
172
|
+
"success": bool(ok),
|
|
173
|
+
"timelineName": timeline.GetName(),
|
|
174
|
+
"frameId": frame_id,
|
|
175
|
+
"markerName": name,
|
|
176
|
+
"markerColor": color
|
|
177
|
+
}))
|
|
178
|
+
except Exception as e:
|
|
179
|
+
print(json.dumps({"success": False, "error": f"Failed to add marker: {str(e)}"}))
|
|
180
|
+
return
|
|
181
|
+
|
|
182
|
+
elif action == "applyLutOrGrade":
|
|
183
|
+
if not timeline:
|
|
184
|
+
print(json.dumps({"success": False, "error": "No active timeline in DaVinci Resolve."}))
|
|
185
|
+
return
|
|
186
|
+
try:
|
|
187
|
+
track_idx = int(args.get("trackIndex", 1))
|
|
188
|
+
items = timeline.GetItemListInTrack("video", track_idx) if hasattr(timeline, "GetItemListInTrack") else []
|
|
189
|
+
if not items:
|
|
190
|
+
print(json.dumps({"success": False, "error": f"No video clips found on track {track_idx}."}))
|
|
191
|
+
return
|
|
192
|
+
clip = items[0]
|
|
193
|
+
lut_path = args.get("lutPath")
|
|
194
|
+
node_idx = int(args.get("nodeIndex", 1))
|
|
195
|
+
if lut_path and hasattr(clip, "SetLUT"):
|
|
196
|
+
clip.SetLUT(node_idx, str(lut_path))
|
|
197
|
+
cdl = args.get("cdl")
|
|
198
|
+
if isinstance(cdl, dict) and hasattr(clip, "SetCDL"):
|
|
199
|
+
clip.SetCDL({
|
|
200
|
+
"NodeIndex": str(node_idx),
|
|
201
|
+
"Slope": str(cdl.get("slope", "1.0 1.0 1.0")),
|
|
202
|
+
"Offset": str(cdl.get("offset", "0.0 0.0 0.0")),
|
|
203
|
+
"Power": str(cdl.get("power", "1.0 1.0 1.0")),
|
|
204
|
+
"Saturation": str(cdl.get("saturation", "1.0"))
|
|
205
|
+
})
|
|
206
|
+
print(json.dumps({
|
|
207
|
+
"success": True,
|
|
208
|
+
"timelineName": timeline.GetName(),
|
|
209
|
+
"gradedClips": len(items),
|
|
210
|
+
"nodeIndex": node_idx
|
|
211
|
+
}))
|
|
212
|
+
except Exception as e:
|
|
213
|
+
print(json.dumps({"success": False, "error": f"Failed to apply LUT/CDL grade: {str(e)}"}))
|
|
214
|
+
return
|
|
215
|
+
|
|
216
|
+
elif action == "renderTimeline":
|
|
217
|
+
try:
|
|
218
|
+
preset_name = args.get("presetName")
|
|
219
|
+
if preset_name and hasattr(project, "LoadRenderPreset"):
|
|
220
|
+
project.LoadRenderPreset(str(preset_name))
|
|
221
|
+
render_settings = {}
|
|
222
|
+
if args.get("targetDir"):
|
|
223
|
+
render_settings["TargetDir"] = str(args.get("targetDir"))
|
|
224
|
+
if args.get("customName"):
|
|
225
|
+
render_settings["CustomName"] = str(args.get("customName"))
|
|
226
|
+
if render_settings and hasattr(project, "SetRenderSettings"):
|
|
227
|
+
project.SetRenderSettings(render_settings)
|
|
228
|
+
job_id = project.AddRenderJob() if hasattr(project, "AddRenderJob") else "job_1"
|
|
229
|
+
started = False
|
|
230
|
+
if args.get("startRender", True) and hasattr(project, "StartRendering"):
|
|
231
|
+
started = bool(project.StartRendering([job_id]))
|
|
101
232
|
print(json.dumps({
|
|
102
|
-
"success": True,
|
|
103
|
-
"
|
|
233
|
+
"success": True,
|
|
234
|
+
"jobId": job_id,
|
|
235
|
+
"started": started,
|
|
236
|
+
"targetDir": render_settings.get("TargetDir")
|
|
104
237
|
}))
|
|
105
238
|
except Exception as e:
|
|
106
|
-
print(json.dumps({"success": False, "error": f"Failed
|
|
239
|
+
print(json.dumps({"success": False, "error": f"Failed to queue render job: {str(e)}"}))
|
|
107
240
|
return
|
|
108
241
|
|
|
109
242
|
else:
|
|
@@ -116,4 +249,4 @@ if __name__ == "__main__":
|
|
|
116
249
|
args = json.loads(raw_args)
|
|
117
250
|
run_bridge(args)
|
|
118
251
|
except Exception as e:
|
|
119
|
-
print(json.dumps({"success": False, "error": f"Python Bridge Error: {str(e)}"}))
|
|
252
|
+
print(json.dumps({"success": False, "error": f"Python Bridge Error: {str(e)}"}))
|
package/src/toolPacks.js
CHANGED
|
@@ -43,6 +43,7 @@ export const PACKS = {
|
|
|
43
43
|
// Stage 1 of the game cascade calls check_system_specs to verify the
|
|
44
44
|
// engine, so it must travel with this pack as well as with media.
|
|
45
45
|
'check_system_specs',
|
|
46
|
+
'creative_apps',
|
|
46
47
|
'godot_act',
|
|
47
48
|
'game_build_html5',
|
|
48
49
|
'game_asset_fetch',
|
|
@@ -319,7 +320,8 @@ download on your own initiative.
|
|
|
319
320
|
When the user asks you to build, create, test, expand, or develop a game, follow these rules:
|
|
320
321
|
|
|
321
322
|
- **Browser / Three.js / WebGL / Python Games**: If the user explicitly requests a Three.js, WebGL, Canvas, HTML5, or Python game (or mentions libraries like Three.js, 3js, NumPy, Pygame), you do NOT need Godot. Build the game directly in HTML/JS/CSS or Python using \`fs_write\` (or \`file_write\`) and run/verify using \`sysRun\` or \`game_build_html5\`.
|
|
322
|
-
- **Godot / Full Engine Games**: When building a full engine game (Godot), follow the 7-stage production methodology using \`godot_act\`, \`game_lore_forge\`, \`game_asset_harvest\`, \`game_scene_build\`, and verify with \`game_web_runtime_inspector\` and \`game_canvas_audit
|
|
323
|
+
- **Godot / Full Engine Games**: When building a full engine game (Godot), follow the 7-stage production methodology using \`godot_act\`, \`game_lore_forge\`, \`game_asset_harvest\`, \`game_scene_build\`, and verify with \`game_web_runtime_inspector\` and \`game_canvas_audit\`.
|
|
324
|
+
- **Unreal Engine 5 / Unity / Native Engine Bridge**: When working with Unreal Engine 5 (\`.uproject\`, Remote Control HTTP port 30010, Python editor scripts) or Unity (\`Assets/\`, C# Editor \`-batchmode\`), use \`creative_apps\` with \`action: "engine_bridge"\` (\`engine: "unreal" | "unity" | "godot"\`).`
|
|
323
325
|
};
|
|
324
326
|
// ---------------------------------------------------------------------------
|
|
325
327
|
// Intent routing.
|
|
@@ -327,9 +329,9 @@ When the user asks you to build, create, test, expand, or develop a game, follow
|
|
|
327
329
|
// Every matcher below is anchored on word boundaries and tested against the
|
|
328
330
|
// raw prompt only.
|
|
329
331
|
// ---------------------------------------------------------------------------
|
|
330
|
-
const GAME_INTENT = /\b(game|games|gamedev|godot|unity|unreal|rpg|platformer|roguelike|arcade|sprite|spritesheet|tilemap|voxel|minecraft|aetheria|voxellia|nes|snes|gameplay|player character|level design|boss fight|simulator|simulation|simulasi)\b|\.(tscn|gd)\b|[-_]3d\b|\b3d[-_]/i;
|
|
332
|
+
const GAME_INTENT = /\b(game|games|gamedev|godot|unity|unreal|ue5|rpg|platformer|roguelike|arcade|sprite|spritesheet|tilemap|voxel|minecraft|aetheria|voxellia|nes|snes|gameplay|player character|level design|boss fight|simulator|simulation|simulasi)\b|\.(tscn|gd|uproject|umap)\b|[-_]3d\b|\b3d[-_]/i;
|
|
331
333
|
const WEB_INTENT = /\b(web|webpage|website|frontend|front-end|landing page|homepage|dashboard|portfolio|html|css|scss|tailwind|bootstrap|react|vue|svelte|angular|next\.?js|nuxt|astro|ui|ux|user interface|web app|webapp|spa|dom|responsive|ui forge|component forge|component generation|ui component|three?\.?js|three?js|webgl|canvas|babylon)\b/i;
|
|
332
|
-
const MEDIA_INTENT = /\b(image|images|picture|photo|render|3d model|blender|animation|animate|video|movie|film|audio|sound|sfx|music|song|voice|tts|text.to.speech|narration|podcast|thumbnail|poster|illustration|logo)\b/i;
|
|
334
|
+
const MEDIA_INTENT = /\b(image|images|picture|photo|photoshop|premiere|after\s*effects|illustrator|indesign|media\s*encoder|uxp|render|3d model|blender|animation|animate|video|movie|film|audio|sound|sfx|music|song|voice|tts|text.to.speech|narration|podcast|thumbnail|poster|illustration|logo)\b|\.(psd|prproj|aep|ai|indd|ccx)\b/i;
|
|
333
335
|
const SYSTEM_INTENT = /\b(process|processes|pid|kill|port|zip|unzip|tar|archive|compress|extract|clipboard|copy to clipboard|print|printer|open in browser|launch app|computer use|vision grounding|desktop vision|gui agent|coordinate click|desktop control)\b/i;
|
|
334
336
|
const ADVANCED_INTENT = /\b(pdf|document|proposal|screenplay|shotlist|shot list|voiceover|dubbing|forge a tool|custom tool|new tool|plugin|plugins|custom plugin|subagent|sub-agent|parallel agent|swarm|ast|symbols|refactor across)\b/i;
|
|
335
337
|
const REVERSE_ENGINEERING_INTENT = /\b(rea|rea-agents|decompile|decompiling|decompilation|disassemble|disassembly|disassembling|binary|binaries|apk|aab|dex|elf|mach-o|pe|coff|reverse[\s_-]?engineer(ing)?|sourcemap|deobfuscate|asar|symbols|ghidra|rizin|radare|hopper|frida|hook script|mitigations|pie|canary|clean[- ]?room)\b|\.(apk|aab|dex|dylib|so|dll|exe|asar)\b/i;
|
package/src/toolPacks.ts
CHANGED
|
@@ -69,6 +69,7 @@ export const PACKS: Record<PackName, string[]> = {
|
|
|
69
69
|
// Stage 1 of the game cascade calls check_system_specs to verify the
|
|
70
70
|
// engine, so it must travel with this pack as well as with media.
|
|
71
71
|
'check_system_specs',
|
|
72
|
+
'creative_apps',
|
|
72
73
|
'godot_act',
|
|
73
74
|
'game_build_html5',
|
|
74
75
|
'game_asset_fetch',
|
|
@@ -357,7 +358,8 @@ download on your own initiative.
|
|
|
357
358
|
When the user asks you to build, create, test, expand, or develop a game, follow these rules:
|
|
358
359
|
|
|
359
360
|
- **Browser / Three.js / WebGL / Python Games**: If the user explicitly requests a Three.js, WebGL, Canvas, HTML5, or Python game (or mentions libraries like Three.js, 3js, NumPy, Pygame), you do NOT need Godot. Build the game directly in HTML/JS/CSS or Python using \`fs_write\` (or \`file_write\`) and run/verify using \`sysRun\` or \`game_build_html5\`.
|
|
360
|
-
- **Godot / Full Engine Games**: When building a full engine game (Godot), follow the 7-stage production methodology using \`godot_act\`, \`game_lore_forge\`, \`game_asset_harvest\`, \`game_scene_build\`, and verify with \`game_web_runtime_inspector\` and \`game_canvas_audit
|
|
361
|
+
- **Godot / Full Engine Games**: When building a full engine game (Godot), follow the 7-stage production methodology using \`godot_act\`, \`game_lore_forge\`, \`game_asset_harvest\`, \`game_scene_build\`, and verify with \`game_web_runtime_inspector\` and \`game_canvas_audit\`.
|
|
362
|
+
- **Unreal Engine 5 / Unity / Native Engine Bridge**: When working with Unreal Engine 5 (\`.uproject\`, Remote Control HTTP port 30010, Python editor scripts) or Unity (\`Assets/\`, C# Editor \`-batchmode\`), use \`creative_apps\` with \`action: "engine_bridge"\` (\`engine: "unreal" | "unity" | "godot"\`).`
|
|
361
363
|
};
|
|
362
364
|
|
|
363
365
|
// ---------------------------------------------------------------------------
|
|
@@ -367,11 +369,11 @@ When the user asks you to build, create, test, expand, or develop a game, follow
|
|
|
367
369
|
// raw prompt only.
|
|
368
370
|
// ---------------------------------------------------------------------------
|
|
369
371
|
|
|
370
|
-
const GAME_INTENT = /\b(game|games|gamedev|godot|unity|unreal|rpg|platformer|roguelike|arcade|sprite|spritesheet|tilemap|voxel|minecraft|aetheria|voxellia|nes|snes|gameplay|player character|level design|boss fight|simulator|simulation|simulasi)\b|\.(tscn|gd)\b|[-_]3d\b|\b3d[-_]/i;
|
|
372
|
+
const GAME_INTENT = /\b(game|games|gamedev|godot|unity|unreal|ue5|rpg|platformer|roguelike|arcade|sprite|spritesheet|tilemap|voxel|minecraft|aetheria|voxellia|nes|snes|gameplay|player character|level design|boss fight|simulator|simulation|simulasi)\b|\.(tscn|gd|uproject|umap)\b|[-_]3d\b|\b3d[-_]/i;
|
|
371
373
|
|
|
372
374
|
const WEB_INTENT = /\b(web|webpage|website|frontend|front-end|landing page|homepage|dashboard|portfolio|html|css|scss|tailwind|bootstrap|react|vue|svelte|angular|next\.?js|nuxt|astro|ui|ux|user interface|web app|webapp|spa|dom|responsive|ui forge|component forge|component generation|ui component|three?\.?js|three?js|webgl|canvas|babylon)\b/i;
|
|
373
375
|
|
|
374
|
-
const MEDIA_INTENT = /\b(image|images|picture|photo|render|3d model|blender|animation|animate|video|movie|film|audio|sound|sfx|music|song|voice|tts|text.to.speech|narration|podcast|thumbnail|poster|illustration|logo)\b/i;
|
|
376
|
+
const MEDIA_INTENT = /\b(image|images|picture|photo|photoshop|premiere|after\s*effects|illustrator|indesign|media\s*encoder|uxp|render|3d model|blender|animation|animate|video|movie|film|audio|sound|sfx|music|song|voice|tts|text.to.speech|narration|podcast|thumbnail|poster|illustration|logo)\b|\.(psd|prproj|aep|ai|indd|ccx)\b/i;
|
|
375
377
|
|
|
376
378
|
const SYSTEM_INTENT = /\b(process|processes|pid|kill|port|zip|unzip|tar|archive|compress|extract|clipboard|copy to clipboard|print|printer|open in browser|launch app|computer use|vision grounding|desktop vision|gui agent|coordinate click|desktop control)\b/i;
|
|
377
379
|
|