@causyne/agent 1.20.30 → 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/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/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/resolveAutomator.js +356 -89
- package/src/tools/resolveAutomator.ts +403 -0
- package/src/toolsList.js +1 -1
- package/src/toolsList.ts +1 -1
package/package.json
CHANGED
package/src/appChannel.js
CHANGED
|
@@ -20,94 +20,72 @@
|
|
|
20
20
|
// EXTENDING IT: A native automation bridge (ExtendScript bridge, Blender Python engine) is
|
|
21
21
|
// one more CHANNEL_A row, not a parallel architecture. That is the whole point
|
|
22
22
|
// of the table — "a native app API beats pixels".
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Apps that already have a Channel A tool, keyed by matcher.
|
|
26
|
-
*
|
|
27
|
-
* `match` is tested against a lowercased app name, so "Blender", "blender" and
|
|
28
|
-
* "Blender 4.2" all resolve. Order matters only for readability; the first hit
|
|
29
|
-
* wins.
|
|
30
|
-
*/
|
|
31
23
|
const CHANNEL_A = [
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
24
|
+
{ match: /\bblender\b/, tool: 'blender_act', app: 'Blender' },
|
|
25
|
+
{ match: /\b(davinci|resolve)\b/, tool: 'resolve_act', app: 'DaVinci Resolve' },
|
|
26
|
+
{ match: /\bgodot\b/, tool: 'godot_act', app: 'Godot' },
|
|
27
|
+
{ match: /\bpalmier\b/, tool: 'palmier_act', app: 'Palmier Pro' },
|
|
28
|
+
{
|
|
29
|
+
match: /\b(chrome|chromium|safari|firefox|edge|brave|arc)\b/,
|
|
30
|
+
tool: 'browser_act',
|
|
31
|
+
app: 'a web browser'
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
match: /\b(photo-studio|video-studio|motion-studio|vector-studio|layout-studio|encoder-studio|photostudio|videostudio|motionstudio|vectorstudio|layoutstudio|encoderstudio|photoshop|premiere(?:\s*pro)?|after\s*effects|illustrator|indesign|media\s*encoder|unreal(?:\s*engine|\s*editor)?|unity(?:\s*editor)?)\b/,
|
|
35
|
+
tool: 'creative_apps',
|
|
36
|
+
app: 'Creative & Game Engine Studio Bridge'
|
|
37
|
+
}
|
|
46
38
|
];
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Apps a GUI actuator must never drive, because a text interface already
|
|
50
|
-
* exists and driving it by pixels is strictly worse in every dimension —
|
|
51
|
-
* slower, costlier, and unable to read its own output reliably.
|
|
52
|
-
*/
|
|
53
39
|
const NEVER_BY_PIXEL = [
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
40
|
+
{
|
|
41
|
+
match: /\b(terminal|iterm|iterm2|konsole|gnome-terminal|powershell|cmd|wezterm|alacritty|kitty)\b/,
|
|
42
|
+
tool: 'sysRun',
|
|
43
|
+
reason: 'a shell is a text interface; clicking one is slower and cannot read its output reliably'
|
|
44
|
+
}
|
|
57
45
|
];
|
|
58
|
-
|
|
59
|
-
/** @typedef {{channel:'A'|'B'|'C', tool:string|null, reason:string, blocked:boolean}} ChannelChoice */
|
|
60
|
-
|
|
61
46
|
/**
|
|
62
47
|
* Decide the cheapest channel that can drive `appName`.
|
|
63
48
|
*
|
|
64
49
|
* Pure and total — an empty or unknown app name resolves to Channel C, which
|
|
65
50
|
* is correct: "I do not recognise this app" is exactly when the universal
|
|
66
51
|
* fallback is the right answer.
|
|
67
|
-
*
|
|
68
|
-
* @param {string} appName Application name, as the user or the OS reports it.
|
|
69
|
-
* @returns {ChannelChoice}
|
|
70
52
|
*/
|
|
71
53
|
export function resolveChannel(appName) {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
}
|
|
54
|
+
const name = String(appName || '').toLowerCase().trim();
|
|
55
|
+
if (name !== '') {
|
|
56
|
+
for (const entry of NEVER_BY_PIXEL) {
|
|
57
|
+
if (entry.match.test(name)) {
|
|
58
|
+
return {
|
|
59
|
+
channel: 'A',
|
|
60
|
+
tool: entry.tool,
|
|
61
|
+
reason: `${appName} must not be driven by pixels — ${entry.reason}. Use ${entry.tool}.`,
|
|
62
|
+
blocked: true
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
for (const entry of CHANNEL_A) {
|
|
67
|
+
if (entry.match.test(name)) {
|
|
68
|
+
return {
|
|
69
|
+
channel: 'A',
|
|
70
|
+
tool: entry.tool,
|
|
71
|
+
reason: `${entry.app} has a native automation API. ${entry.tool} is exact, roughly 10x cheaper `
|
|
72
|
+
+ `per observation, and does not break when the window moves. Use it instead of clicking.`,
|
|
73
|
+
blocked: true
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
}
|
|
96
77
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
blocked: false
|
|
107
|
-
};
|
|
78
|
+
return {
|
|
79
|
+
channel: 'C',
|
|
80
|
+
tool: null,
|
|
81
|
+
reason: name === ''
|
|
82
|
+
? 'No application named, so no native channel can be selected; the pixel path applies.'
|
|
83
|
+
: `No native automation channel is registered for "${appName}". Read it with ax_snapshot first `
|
|
84
|
+
+ `(Channel B, structured and ~5x cheaper than a screenshot), and act by element name where possible.`,
|
|
85
|
+
blocked: false
|
|
86
|
+
};
|
|
108
87
|
}
|
|
109
|
-
|
|
110
88
|
/** Every app name pattern with a Channel A tool. For tests and diagnostics. */
|
|
111
89
|
export function channelATools() {
|
|
112
|
-
|
|
90
|
+
return [...CHANNEL_A.map(e => e.tool), ...NEVER_BY_PIXEL.map(e => e.tool)];
|
|
113
91
|
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
// The Three-Channel Doctrine, made executable.
|
|
2
|
+
//
|
|
3
|
+
// Channel A — the app's own API / plugin / CLI ~50-200 tok exact
|
|
4
|
+
// Channel B — the accessibility tree ~200-800 tok structured
|
|
5
|
+
// Channel C — pixels: screenshot + OCR + click ~1,500-2,500 universal, brittle
|
|
6
|
+
//
|
|
7
|
+
// Channel C costs 10-50x Channel A per observation. An agent that reaches for
|
|
8
|
+
// pixels first is not more capable — it is more expensive AND less reliable.
|
|
9
|
+
//
|
|
10
|
+
// THIS MODULE IS A GUARD, NOT ADVICE. A doctrine that lives only in a system
|
|
11
|
+
// prompt is a suggestion the model may ignore on any given turn, and the turn
|
|
12
|
+
// it ignores it is the turn it clicks blindly through Blender instead of
|
|
13
|
+
// calling `blender_act`. So the router is consulted by `desktop_act` BEFORE any
|
|
14
|
+
// actuation, and it refuses the pixel path for an app that has a native one.
|
|
15
|
+
//
|
|
16
|
+
// It is deliberately NOT a tool the model calls. Another tool schema is another
|
|
17
|
+
// ~200 tokens on every request to describe a decision the runtime can make on
|
|
18
|
+
// its own, and a decision the model is allowed to skip is not a guard.
|
|
19
|
+
//
|
|
20
|
+
// EXTENDING IT: A native automation bridge (ExtendScript bridge, Blender Python engine) is
|
|
21
|
+
// one more CHANNEL_A row, not a parallel architecture. That is the whole point
|
|
22
|
+
// of the table — "a native app API beats pixels".
|
|
23
|
+
|
|
24
|
+
export interface ChannelChoice {
|
|
25
|
+
channel: 'A' | 'B' | 'C';
|
|
26
|
+
tool: string | null;
|
|
27
|
+
reason: string;
|
|
28
|
+
blocked: boolean;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const CHANNEL_A: ReadonlyArray<{ match: RegExp; tool: string; app: string }> = [
|
|
32
|
+
{ match: /\bblender\b/, tool: 'blender_act', app: 'Blender' },
|
|
33
|
+
{ match: /\b(davinci|resolve)\b/, tool: 'resolve_act', app: 'DaVinci Resolve' },
|
|
34
|
+
{ match: /\bgodot\b/, tool: 'godot_act', app: 'Godot' },
|
|
35
|
+
{ match: /\bpalmier\b/, tool: 'palmier_act', app: 'Palmier Pro' },
|
|
36
|
+
{
|
|
37
|
+
match: /\b(chrome|chromium|safari|firefox|edge|brave|arc)\b/,
|
|
38
|
+
tool: 'browser_act',
|
|
39
|
+
app: 'a web browser'
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
match: /\b(photo-studio|video-studio|motion-studio|vector-studio|layout-studio|encoder-studio|photostudio|videostudio|motionstudio|vectorstudio|layoutstudio|encoderstudio|photoshop|premiere(?:\s*pro)?|after\s*effects|illustrator|indesign|media\s*encoder|unreal(?:\s*engine|\s*editor)?|unity(?:\s*editor)?)\b/,
|
|
43
|
+
tool: 'creative_apps',
|
|
44
|
+
app: 'Creative & Game Engine Studio Bridge'
|
|
45
|
+
}
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
const NEVER_BY_PIXEL: ReadonlyArray<{ match: RegExp; tool: string; reason: string }> = [
|
|
49
|
+
{
|
|
50
|
+
match: /\b(terminal|iterm|iterm2|konsole|gnome-terminal|powershell|cmd|wezterm|alacritty|kitty)\b/,
|
|
51
|
+
tool: 'sysRun',
|
|
52
|
+
reason: 'a shell is a text interface; clicking one is slower and cannot read its output reliably'
|
|
53
|
+
}
|
|
54
|
+
];
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Decide the cheapest channel that can drive `appName`.
|
|
58
|
+
*
|
|
59
|
+
* Pure and total — an empty or unknown app name resolves to Channel C, which
|
|
60
|
+
* is correct: "I do not recognise this app" is exactly when the universal
|
|
61
|
+
* fallback is the right answer.
|
|
62
|
+
*/
|
|
63
|
+
export function resolveChannel(appName?: string | null): ChannelChoice {
|
|
64
|
+
const name = String(appName || '').toLowerCase().trim();
|
|
65
|
+
|
|
66
|
+
if (name !== '') {
|
|
67
|
+
for (const entry of NEVER_BY_PIXEL) {
|
|
68
|
+
if (entry.match.test(name)) {
|
|
69
|
+
return {
|
|
70
|
+
channel: 'A',
|
|
71
|
+
tool: entry.tool,
|
|
72
|
+
reason: `${appName} must not be driven by pixels — ${entry.reason}. Use ${entry.tool}.`,
|
|
73
|
+
blocked: true
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
for (const entry of CHANNEL_A) {
|
|
79
|
+
if (entry.match.test(name)) {
|
|
80
|
+
return {
|
|
81
|
+
channel: 'A',
|
|
82
|
+
tool: entry.tool,
|
|
83
|
+
reason: `${entry.app} has a native automation API. ${entry.tool} is exact, roughly 10x cheaper `
|
|
84
|
+
+ `per observation, and does not break when the window moves. Use it instead of clicking.`,
|
|
85
|
+
blocked: true
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return {
|
|
92
|
+
channel: 'C',
|
|
93
|
+
tool: null,
|
|
94
|
+
reason: name === ''
|
|
95
|
+
? 'No application named, so no native channel can be selected; the pixel path applies.'
|
|
96
|
+
: `No native automation channel is registered for "${appName}". Read it with ax_snapshot first `
|
|
97
|
+
+ `(Channel B, structured and ~5x cheaper than a screenshot), and act by element name where possible.`,
|
|
98
|
+
blocked: false
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** Every app name pattern with a Channel A tool. For tests and diagnostics. */
|
|
103
|
+
export function channelATools(): string[] {
|
|
104
|
+
return [...CHANNEL_A.map(e => e.tool), ...NEVER_BY_PIXEL.map(e => e.tool)];
|
|
105
|
+
}
|
|
106
|
+
|
package/src/creative/apps.js
CHANGED
|
@@ -32,27 +32,186 @@ export async function findBlender() {
|
|
|
32
32
|
}
|
|
33
33
|
return null;
|
|
34
34
|
}
|
|
35
|
+
export function unrealCandidates(platform = process.platform) {
|
|
36
|
+
const candidates = [];
|
|
37
|
+
if (platform === 'darwin') {
|
|
38
|
+
for (const root of ['/Users/Shared/Epic Games', '/Applications']) {
|
|
39
|
+
try {
|
|
40
|
+
const dirs = fs.readdirSync(root).filter(n => /^UE_\d/i.test(n)).sort().reverse();
|
|
41
|
+
for (const dir of dirs) {
|
|
42
|
+
candidates.push(path.join(root, dir, 'Engine/Binaries/Mac/UnrealEditor-Cmd'));
|
|
43
|
+
candidates.push(path.join(root, dir, 'Engine/Binaries/Mac/UnrealEditor.app/Contents/MacOS/UnrealEditor-Cmd'));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
catch { /* ignore */ }
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
else if (platform === 'win32') {
|
|
50
|
+
const root = path.join(process.env.ProgramFiles || 'C:\\Program Files', 'Epic Games');
|
|
51
|
+
try {
|
|
52
|
+
const dirs = fs.readdirSync(root).filter(n => /^UE_\d/i.test(n)).sort().reverse();
|
|
53
|
+
for (const dir of dirs) {
|
|
54
|
+
candidates.push(path.join(root, dir, 'Engine\\Binaries\\Win64\\UnrealEditor-Cmd.exe'));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
catch { /* ignore */ }
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
candidates.push(path.join(os.homedir(), 'UnrealEngine/Engine/Binaries/Linux/UnrealEditor-Cmd'), '/opt/unreal-engine/Engine/Binaries/Linux/UnrealEditor-Cmd');
|
|
61
|
+
}
|
|
62
|
+
return candidates;
|
|
63
|
+
}
|
|
64
|
+
export function findUnrealEngine(platform = process.platform) {
|
|
65
|
+
for (const executable of unrealCandidates(platform)) {
|
|
66
|
+
if (!fs.existsSync(executable))
|
|
67
|
+
continue;
|
|
68
|
+
const match = executable.match(/UE_(\d+(?:\.\d+)*)/i);
|
|
69
|
+
return { executable, version: match?.[1] ? `Unreal Engine ${match[1]}` : 'Unreal Engine 5' };
|
|
70
|
+
}
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
export function unityCandidates(platform = process.platform) {
|
|
74
|
+
const candidates = [];
|
|
75
|
+
if (platform === 'darwin') {
|
|
76
|
+
const hubRoot = '/Applications/Unity/Hub/Editor';
|
|
77
|
+
try {
|
|
78
|
+
const versions = fs.readdirSync(hubRoot).sort().reverse();
|
|
79
|
+
for (const v of versions) {
|
|
80
|
+
candidates.push(path.join(hubRoot, v, 'Unity.app/Contents/MacOS/Unity'));
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
catch { /* ignore */ }
|
|
84
|
+
candidates.push('/Applications/Unity/Unity.app/Contents/MacOS/Unity');
|
|
85
|
+
}
|
|
86
|
+
else if (platform === 'win32') {
|
|
87
|
+
const hubRoot = path.join(process.env.ProgramFiles || 'C:\\Program Files', 'Unity\\Hub\\Editor');
|
|
88
|
+
try {
|
|
89
|
+
const versions = fs.readdirSync(hubRoot).sort().reverse();
|
|
90
|
+
for (const v of versions) {
|
|
91
|
+
candidates.push(path.join(hubRoot, v, 'Editor\\Unity.exe'));
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
catch { /* ignore */ }
|
|
95
|
+
candidates.push(path.join(process.env.ProgramFiles || 'C:\\Program Files', 'Unity\\Editor\\Unity.exe'));
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
const hubRoot = path.join(os.homedir(), 'Unity/Hub/Editor');
|
|
99
|
+
try {
|
|
100
|
+
const versions = fs.readdirSync(hubRoot).sort().reverse();
|
|
101
|
+
for (const v of versions) {
|
|
102
|
+
candidates.push(path.join(hubRoot, v, 'Editor/Unity'));
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
catch { /* ignore */ }
|
|
106
|
+
candidates.push('/opt/unity/Editor/Unity');
|
|
107
|
+
}
|
|
108
|
+
return candidates;
|
|
109
|
+
}
|
|
110
|
+
export function findUnityEditor(platform = process.platform) {
|
|
111
|
+
for (const executable of unityCandidates(platform)) {
|
|
112
|
+
if (!fs.existsSync(executable))
|
|
113
|
+
continue;
|
|
114
|
+
const match = executable.match(/Editor[\\/]([^\\/]+)[\\/](?:Unity\.app|Editor)/i);
|
|
115
|
+
return { executable, version: match?.[1] ? `Unity ${match[1]}` : 'Unity Editor' };
|
|
116
|
+
}
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
export function godotCandidates(platform = process.platform) {
|
|
120
|
+
const homeDir = os.homedir();
|
|
121
|
+
const causyneGodotDir = path.join(homeDir, '.causyne', 'engines', 'godot');
|
|
122
|
+
if (platform === 'darwin') {
|
|
123
|
+
return [
|
|
124
|
+
path.join(causyneGodotDir, 'godot'),
|
|
125
|
+
'/Applications/Godot.app/Contents/MacOS/Godot',
|
|
126
|
+
'/Applications/Godot_4.app/Contents/MacOS/Godot',
|
|
127
|
+
'/opt/homebrew/bin/godot',
|
|
128
|
+
'/usr/local/bin/godot'
|
|
129
|
+
];
|
|
130
|
+
}
|
|
131
|
+
if (platform === 'win32') {
|
|
132
|
+
return [
|
|
133
|
+
path.join(causyneGodotDir, 'Godot.exe'),
|
|
134
|
+
path.join(causyneGodotDir, 'godot.exe'),
|
|
135
|
+
'C:\\Program Files\\Godot\\Godot_v4.exe',
|
|
136
|
+
'C:\\Program Files\\Godot\\godot.exe'
|
|
137
|
+
];
|
|
138
|
+
}
|
|
139
|
+
return [
|
|
140
|
+
path.join(causyneGodotDir, 'godot'),
|
|
141
|
+
'/usr/bin/godot',
|
|
142
|
+
'/usr/local/bin/godot'
|
|
143
|
+
];
|
|
144
|
+
}
|
|
145
|
+
export function findGodotEngine(platform = process.platform) {
|
|
146
|
+
for (const executable of godotCandidates(platform)) {
|
|
147
|
+
if (fs.existsSync(executable)) {
|
|
148
|
+
return { executable, version: 'Godot 4.x' };
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return null;
|
|
152
|
+
}
|
|
153
|
+
export function resolveCandidates(platform = process.platform) {
|
|
154
|
+
if (platform === 'darwin') {
|
|
155
|
+
return [
|
|
156
|
+
'/Applications/DaVinci Resolve/DaVinci Resolve.app/Contents/MacOS/Resolve',
|
|
157
|
+
'/Applications/DaVinci Resolve/DaVinci Resolve.app'
|
|
158
|
+
];
|
|
159
|
+
}
|
|
160
|
+
if (platform === 'win32') {
|
|
161
|
+
const programFiles = process.env.ProgramFiles || 'C:\\Program Files';
|
|
162
|
+
return [
|
|
163
|
+
path.join(programFiles, 'Blackmagic Design\\DaVinci Resolve\\Resolve.exe')
|
|
164
|
+
];
|
|
165
|
+
}
|
|
166
|
+
return ['/opt/resolve/bin/resolve'];
|
|
167
|
+
}
|
|
168
|
+
export function findDaVinciResolve(platform = process.platform) {
|
|
169
|
+
for (const executable of resolveCandidates(platform)) {
|
|
170
|
+
if (fs.existsSync(executable)) {
|
|
171
|
+
return { executable, version: 'DaVinci Resolve Studio' };
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return null;
|
|
175
|
+
}
|
|
35
176
|
/** Probes local creative application installations and native automation adapter readiness. */
|
|
36
177
|
export async function creativeAppStatus() {
|
|
37
178
|
const blender = await findBlender();
|
|
179
|
+
const resolve = findDaVinciResolve();
|
|
180
|
+
const unreal = findUnrealEngine();
|
|
181
|
+
const unity = findUnityEditor();
|
|
182
|
+
const godot = findGodotEngine();
|
|
38
183
|
const roots = process.platform === 'darwin'
|
|
39
184
|
? ['/Applications', path.join(os.homedir(), 'Applications')]
|
|
40
185
|
: process.platform === 'win32'
|
|
41
186
|
? [process.env.ProgramFiles || 'C:\\Program Files', process.env['ProgramFiles(x86)'] || 'C:\\Program Files (x86)']
|
|
42
187
|
: [];
|
|
43
|
-
const installedNames = roots.flatMap(root => {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
188
|
+
const installedNames = roots.flatMap(root => {
|
|
189
|
+
try {
|
|
190
|
+
const top = fs.readdirSync(root);
|
|
191
|
+
const adobeSub = top.filter(n => /Adobe/i.test(n)).flatMap(sub => {
|
|
192
|
+
try {
|
|
193
|
+
return fs.readdirSync(path.join(root, sub));
|
|
194
|
+
}
|
|
195
|
+
catch {
|
|
196
|
+
return [];
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
return [...top, ...adobeSub];
|
|
200
|
+
}
|
|
201
|
+
catch {
|
|
202
|
+
return [];
|
|
203
|
+
}
|
|
204
|
+
});
|
|
49
205
|
return [
|
|
50
206
|
{ id: 'blender', label: '3D Studio (Blender)', installed: Boolean(blender), available: Boolean(blender),
|
|
51
207
|
detail: blender ? `${blender.version} · native batch engine (geometry, materials, lighting, render)` : 'Install Blender to enable 3D batch modeling and rendering.' },
|
|
52
208
|
...[
|
|
53
|
-
['photoshop', 'Photo Studio', /Photoshop/i, '.psd/.png/.jpg', 'layer edits, transforms,
|
|
54
|
-
['premiere', 'Video Studio', /Premiere/i, '.prproj', '
|
|
55
|
-
['after-effects', 'Motion Studio', /After\s*Effects/i, '.aep', '
|
|
209
|
+
['photoshop', 'Photo Studio', /Photoshop/i, '.psd/.png/.jpg', 'live canvas/selection mask bridge, layer edits, transforms, UXP'],
|
|
210
|
+
['premiere', 'Video Studio', /Premiere/i, '.prproj', 'live active sequence insertion, timeline media imports, cuts, markers, UXP'],
|
|
211
|
+
['after-effects', 'Motion Studio', /After\s*Effects/i, '.aep', 'live active composition bridge, footage import, typography, motion'],
|
|
212
|
+
['illustrator', 'Vector Studio', /Illustrator/i, '.ai/.svg/.pdf', 'live artboard placement, vector paths, typography, SVG/PDF export'],
|
|
213
|
+
['indesign', 'Layout Studio', /InDesign/i, '.indd/.idml/.pdf', 'live spread/frame placement, multi-page editorial layout'],
|
|
214
|
+
['media-encoder', 'Encoder Studio', /Media\s*Encoder/i, '.mp4/.mov/.wav', 'render queue dispatch and hardware codec transcode']
|
|
56
215
|
].map(([id, label, pattern, ext, capabilities]) => {
|
|
57
216
|
const installed = installedNames.some(n => pattern.test(n));
|
|
58
217
|
return {
|
|
@@ -61,9 +220,45 @@ export async function creativeAppStatus() {
|
|
|
61
220
|
installed,
|
|
62
221
|
available: installed,
|
|
63
222
|
detail: installed
|
|
64
|
-
? `Connected · native automation
|
|
223
|
+
? `Connected · native automation & live session bridge ready (${ext} · ${capabilities})`
|
|
65
224
|
: `Not installed · install ${label} host engine to enable native creative automation`
|
|
66
225
|
};
|
|
67
|
-
})
|
|
226
|
+
}),
|
|
227
|
+
{
|
|
228
|
+
id: 'resolve',
|
|
229
|
+
label: 'Cinema Studio (DaVinci Resolve)',
|
|
230
|
+
installed: Boolean(resolve),
|
|
231
|
+
available: true,
|
|
232
|
+
detail: resolve
|
|
233
|
+
? `${resolve.version} (${resolve.executable}) · DaVinciResolveScript Python API (timeline assembly, RCM color management, LUT/CDL grading, render queue)`
|
|
234
|
+
: 'DaVinciResolveScript Python bridge & simulator ready (macOS/Windows/Linux) · install DaVinci Resolve for live NLE/grading execution'
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
id: 'unreal',
|
|
238
|
+
label: 'Unreal Engine (UE5)',
|
|
239
|
+
installed: Boolean(unreal),
|
|
240
|
+
available: true,
|
|
241
|
+
detail: unreal
|
|
242
|
+
? `${unreal.version} (${unreal.executable}) · Remote Control HTTP/WS API (30010) & Python Editor automation ready`
|
|
243
|
+
: 'Staged Python & Remote Control HTTP (30010) bridge ready · install Unreal Engine 5 for local CLI execution'
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
id: 'unity',
|
|
247
|
+
label: 'Unity Engine',
|
|
248
|
+
installed: Boolean(unity),
|
|
249
|
+
available: true,
|
|
250
|
+
detail: unity
|
|
251
|
+
? `${unity.version} (${unity.executable}) · C# Editor batchmode & AssetDatabase bridge ready`
|
|
252
|
+
: 'Staged C# Editor & AssetDatabase bridge ready · install Unity Editor for local batchmode execution'
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
id: 'godot',
|
|
256
|
+
label: 'Godot Engine',
|
|
257
|
+
installed: Boolean(godot),
|
|
258
|
+
available: true,
|
|
259
|
+
detail: godot
|
|
260
|
+
? `${godot.version} (${godot.executable}) · headless SceneTree GDScript & resource import bridge ready`
|
|
261
|
+
: 'Staged GDScript & scene resource bridge ready · install Godot 4 for local headless execution'
|
|
262
|
+
}
|
|
68
263
|
];
|
|
69
264
|
}
|