@synthetic-ai/premiere-mcp 2.0.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 (104) hide show
  1. package/CHANGELOG.md +73 -0
  2. package/LICENSE +21 -0
  3. package/README.md +242 -0
  4. package/cep-plugin/.debug +8 -0
  5. package/cep-plugin/CSInterface.js +70 -0
  6. package/cep-plugin/CSXS/manifest.xml +49 -0
  7. package/cep-plugin/host.jsx +7 -0
  8. package/cep-plugin/index.html +419 -0
  9. package/cep-plugin/main.js +327 -0
  10. package/cep-plugin/premiere.jsx +24947 -0
  11. package/cep-plugin/synthetic-logo.png +0 -0
  12. package/dist/bridge/file-bridge.d.ts +29 -0
  13. package/dist/bridge/file-bridge.js +145 -0
  14. package/dist/bridge/script-builder.d.ts +19 -0
  15. package/dist/bridge/script-builder.js +408 -0
  16. package/dist/http-server.d.ts +21 -0
  17. package/dist/http-server.js +140 -0
  18. package/dist/index.d.ts +3 -0
  19. package/dist/index.js +70 -0
  20. package/dist/resources/extendscript-reference.d.ts +2 -0
  21. package/dist/resources/extendscript-reference.js +219 -0
  22. package/dist/server.d.ts +4 -0
  23. package/dist/server.js +276 -0
  24. package/dist/tools/advanced.d.ts +530 -0
  25. package/dist/tools/advanced.js +923 -0
  26. package/dist/tools/audio-advanced.d.ts +847 -0
  27. package/dist/tools/audio-advanced.js +1653 -0
  28. package/dist/tools/audio.d.ts +84 -0
  29. package/dist/tools/audio.js +123 -0
  30. package/dist/tools/captions.d.ts +30 -0
  31. package/dist/tools/captions.js +73 -0
  32. package/dist/tools/clipboard.d.ts +153 -0
  33. package/dist/tools/clipboard.js +381 -0
  34. package/dist/tools/color-advanced.d.ts +821 -0
  35. package/dist/tools/color-advanced.js +772 -0
  36. package/dist/tools/discovery.d.ts +128 -0
  37. package/dist/tools/discovery.js +445 -0
  38. package/dist/tools/effects.d.ts +211 -0
  39. package/dist/tools/effects.js +554 -0
  40. package/dist/tools/export-presets.d.ts +333 -0
  41. package/dist/tools/export-presets.js +490 -0
  42. package/dist/tools/export.d.ts +320 -0
  43. package/dist/tools/export.js +618 -0
  44. package/dist/tools/health.d.ts +9 -0
  45. package/dist/tools/health.js +25 -0
  46. package/dist/tools/inspection.d.ts +179 -0
  47. package/dist/tools/inspection.js +1089 -0
  48. package/dist/tools/keyframes.d.ts +253 -0
  49. package/dist/tools/keyframes.js +611 -0
  50. package/dist/tools/markers.d.ts +117 -0
  51. package/dist/tools/markers.js +206 -0
  52. package/dist/tools/media.d.ts +297 -0
  53. package/dist/tools/media.js +493 -0
  54. package/dist/tools/metadata.d.ts +178 -0
  55. package/dist/tools/metadata.js +278 -0
  56. package/dist/tools/multicam.d.ts +199 -0
  57. package/dist/tools/multicam.js +212 -0
  58. package/dist/tools/playback.d.ts +34 -0
  59. package/dist/tools/playback.js +63 -0
  60. package/dist/tools/playhead.d.ts +77 -0
  61. package/dist/tools/playhead.js +185 -0
  62. package/dist/tools/project-manager.d.ts +65 -0
  63. package/dist/tools/project-manager.js +81 -0
  64. package/dist/tools/project.d.ts +390 -0
  65. package/dist/tools/project.js +596 -0
  66. package/dist/tools/scripting.d.ts +98 -0
  67. package/dist/tools/scripting.js +434 -0
  68. package/dist/tools/selection.d.ts +120 -0
  69. package/dist/tools/selection.js +334 -0
  70. package/dist/tools/sequence-advanced.d.ts +84 -0
  71. package/dist/tools/sequence-advanced.js +471 -0
  72. package/dist/tools/sequence-settings.d.ts +397 -0
  73. package/dist/tools/sequence-settings.js +967 -0
  74. package/dist/tools/sequence.d.ts +211 -0
  75. package/dist/tools/sequence.js +378 -0
  76. package/dist/tools/source-monitor.d.ts +95 -0
  77. package/dist/tools/source-monitor.js +180 -0
  78. package/dist/tools/text.d.ts +97 -0
  79. package/dist/tools/text.js +159 -0
  80. package/dist/tools/timeline.d.ts +265 -0
  81. package/dist/tools/timeline.js +575 -0
  82. package/dist/tools/track-management.d.ts +482 -0
  83. package/dist/tools/track-management.js +787 -0
  84. package/dist/tools/track-targeting.d.ts +666 -0
  85. package/dist/tools/track-targeting.js +1318 -0
  86. package/dist/tools/tracks.d.ts +90 -0
  87. package/dist/tools/tracks.js +183 -0
  88. package/dist/tools/transitions-motion.d.ts +788 -0
  89. package/dist/tools/transitions-motion.js +680 -0
  90. package/dist/tools/transitions.d.ts +124 -0
  91. package/dist/tools/transitions.js +267 -0
  92. package/dist/tools/utility.d.ts +469 -0
  93. package/dist/tools/utility.js +1118 -0
  94. package/dist/tools/workspace.d.ts +25 -0
  95. package/dist/tools/workspace.js +61 -0
  96. package/package.json +66 -0
  97. package/scripts/build-chat-dmg.sh +210 -0
  98. package/scripts/build-chat-zip.sh +291 -0
  99. package/scripts/install-cep-windows.ps1 +99 -0
  100. package/scripts/install-cep.sh +66 -0
  101. package/scripts/install-chat-plugin.bat +67 -0
  102. package/scripts/install-chat-plugin.sh +85 -0
  103. package/scripts/install-windows.bat +95 -0
  104. package/scripts/package.mjs +218 -0
@@ -0,0 +1,99 @@
1
+ # Install the MCP Bridge CEP plugin for Premiere Pro on Windows.
2
+ # Run this script as the current user (does NOT require Administrator for user-space registry and %APPDATA%).
3
+ # However, creating a symbolic link requires Developer Mode OR Administrator privileges.
4
+ # Use the -Copy switch to copy the plugin folder instead of symlinking (no admin required).
5
+ #
6
+ # Usage:
7
+ # .\install-cep-windows.ps1 # symlink (requires Developer Mode or Admin)
8
+ # .\install-cep-windows.ps1 -Copy # copy files (no admin required)
9
+
10
+ param(
11
+ [switch]$Copy
12
+ )
13
+
14
+ $ErrorActionPreference = "Stop"
15
+
16
+ $ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
17
+ $ProjectDir = Split-Path -Parent $ScriptDir
18
+ $PluginSrc = Join-Path $ProjectDir "cep-plugin"
19
+ $PluginName = "MCPBridgeCEP"
20
+ $CepDir = Join-Path $env:APPDATA "Adobe\CEP\extensions"
21
+ $PluginDest = Join-Path $CepDir $PluginName
22
+
23
+ Write-Host ""
24
+ Write-Host "=== MCP Bridge CEP Plugin Installer (Windows) ===" -ForegroundColor Cyan
25
+ Write-Host ""
26
+ Write-Host "Source: $PluginSrc"
27
+ Write-Host "Destination: $PluginDest"
28
+ Write-Host ""
29
+
30
+ # ---- 1. Create CEP extensions directory if needed ----
31
+ if (!(Test-Path $CepDir)) {
32
+ Write-Host "Creating CEP extensions directory: $CepDir"
33
+ New-Item -ItemType Directory -Path $CepDir -Force | Out-Null
34
+ }
35
+
36
+ # ---- 2. Remove existing installation ----
37
+ if (Test-Path $PluginDest) {
38
+ Write-Host "Removing existing installation at $PluginDest ..."
39
+ Remove-Item -Recurse -Force $PluginDest
40
+ }
41
+
42
+ # ---- 3. Install the plugin ----
43
+ if ($Copy) {
44
+ Write-Host "Copying plugin files (no admin required)..."
45
+ Copy-Item -Recurse -Path $PluginSrc -Destination $PluginDest
46
+ Write-Host "Copied successfully." -ForegroundColor Green
47
+ } else {
48
+ Write-Host "Creating symbolic link (requires Developer Mode or Administrator)..."
49
+ try {
50
+ New-Item -ItemType SymbolicLink -Path $PluginDest -Target $PluginSrc | Out-Null
51
+ Write-Host "Symlink created successfully." -ForegroundColor Green
52
+ } catch {
53
+ Write-Warning "Symlink failed: $_"
54
+ Write-Warning "Falling back to copy. Re-run with -Copy flag to skip this step next time."
55
+ Copy-Item -Recurse -Path $PluginSrc -Destination $PluginDest
56
+ Write-Host "Copied successfully." -ForegroundColor Green
57
+ }
58
+ }
59
+
60
+ # ---- 4. Set PlayerDebugMode in the registry (allows unsigned CEP extensions) ----
61
+ Write-Host ""
62
+ Write-Host "Setting PlayerDebugMode in registry for CSXS 9.0 - 12.0 ..."
63
+
64
+ $versions = @("9.0", "10.0", "11.0", "12.0")
65
+ foreach ($v in $versions) {
66
+ $key = "HKCU:\Software\Adobe\CSXS.$v"
67
+ if (!(Test-Path $key)) {
68
+ New-Item -Path $key -Force | Out-Null
69
+ }
70
+ Set-ItemProperty -Path $key -Name "PlayerDebugMode" -Value "1" -Type String
71
+ Write-Host " Set $key\PlayerDebugMode = 1" -ForegroundColor DarkGray
72
+ }
73
+
74
+ Write-Host "Registry keys set." -ForegroundColor Green
75
+
76
+ # ---- 5. Print next steps ----
77
+ Write-Host ""
78
+ Write-Host "Installation complete!" -ForegroundColor Green
79
+ Write-Host ""
80
+ Write-Host "Next steps:"
81
+ Write-Host " 1. Restart Premiere Pro (completely - not just reopen a project)"
82
+ Write-Host " 2. Go to Window > Extensions > Synthetic Premiere MCP"
83
+ Write-Host " 3. Set the Temp Directory field to match PREMIERE_TEMP_DIR in your MCP config"
84
+ Write-Host " Default: $env:LOCALAPPDATA\Temp\premiere-mcp-bridge"
85
+ Write-Host " 4. Click Start Bridge - you should see a green Running status"
86
+ Write-Host " 5. Configure your MCP client (e.g., Claude Desktop) with:"
87
+ Write-Host ""
88
+ Write-Host ' {' -ForegroundColor Yellow
89
+ Write-Host ' "mcpServers": {' -ForegroundColor Yellow
90
+ Write-Host ' "premiere-pro": {' -ForegroundColor Yellow
91
+ Write-Host " `"command`": `"node`"," -ForegroundColor Yellow
92
+ Write-Host " `"args`": [`"$ProjectDir\dist\index.js`"]," -ForegroundColor Yellow
93
+ Write-Host ' "env": {' -ForegroundColor Yellow
94
+ Write-Host " `"PREMIERE_TEMP_DIR`": `"$env:LOCALAPPDATA\Temp\premiere-mcp-bridge`"" -ForegroundColor Yellow
95
+ Write-Host ' }' -ForegroundColor Yellow
96
+ Write-Host ' }' -ForegroundColor Yellow
97
+ Write-Host ' }' -ForegroundColor Yellow
98
+ Write-Host ' }' -ForegroundColor Yellow
99
+ Write-Host ""
@@ -0,0 +1,66 @@
1
+ #!/bin/bash
2
+ # Install the MCP Bridge CEP plugin for Premiere Pro
3
+ # This script creates a symlink from the CEP extensions directory to this project's cep-plugin folder.
4
+
5
+ set -e
6
+
7
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
8
+ PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
9
+ PLUGIN_SRC="$PROJECT_DIR/cep-plugin"
10
+ PLUGIN_NAME="MCPBridgeCEP"
11
+
12
+ # Detect OS
13
+ if [[ "$OSTYPE" == "darwin"* ]]; then
14
+ CEP_DIR="$HOME/Library/Application Support/Adobe/CEP/extensions"
15
+ elif [[ "$OSTYPE" == "msys" || "$OSTYPE" == "win32" ]]; then
16
+ CEP_DIR="$APPDATA/Adobe/CEP/extensions"
17
+ else
18
+ echo "Unsupported OS: $OSTYPE"
19
+ exit 1
20
+ fi
21
+
22
+ echo "=== MCP Bridge CEP Plugin Installer ==="
23
+ echo ""
24
+ echo "Source: $PLUGIN_SRC"
25
+ echo "Destination: $CEP_DIR/$PLUGIN_NAME"
26
+ echo ""
27
+
28
+ # Create CEP extensions directory if needed
29
+ mkdir -p "$CEP_DIR"
30
+
31
+ # Remove existing installation
32
+ if [ -e "$CEP_DIR/$PLUGIN_NAME" ] || [ -L "$CEP_DIR/$PLUGIN_NAME" ]; then
33
+ echo "Removing existing installation..."
34
+ rm -rf "$CEP_DIR/$PLUGIN_NAME"
35
+ fi
36
+
37
+ # Create symlink (for development) or copy (for production)
38
+ if [ "$1" == "--copy" ]; then
39
+ echo "Copying plugin files..."
40
+ cp -r "$PLUGIN_SRC" "$CEP_DIR/$PLUGIN_NAME"
41
+ else
42
+ echo "Creating symlink (development mode)..."
43
+ ln -s "$PLUGIN_SRC" "$CEP_DIR/$PLUGIN_NAME"
44
+ fi
45
+
46
+ echo ""
47
+
48
+ # Enable CEP debug mode (allows unsigned extensions)
49
+ if [[ "$OSTYPE" == "darwin"* ]]; then
50
+ echo "Enabling CEP debug mode..."
51
+ for version in 8 9 10 11 12 13 14; do
52
+ defaults write com.adobe.CSXS.$version PlayerDebugMode 1 2>/dev/null || true
53
+ done
54
+ echo "CEP debug mode enabled for CSXS 8-14"
55
+ fi
56
+
57
+ echo ""
58
+ echo "āœ“ Installation complete!"
59
+ echo ""
60
+ echo "Next steps:"
61
+ echo " 1. Restart Premiere Pro"
62
+ echo " 2. Go to Window > Extensions > Synthetic Premiere MCP"
63
+ echo " 3. Set the temp directory and click 'Start Bridge'"
64
+ echo " 4. Configure your MCP client (e.g., Claude Desktop) to use:"
65
+ echo " node $PROJECT_DIR/dist/index.js"
66
+ echo ""
@@ -0,0 +1,67 @@
1
+ @echo off
2
+ REM Premiere Pro AI Chat — Windows Installer
3
+ REM Copies the plugin to the Adobe CEP extensions folder
4
+ REM and enables unsigned extensions via registry.
5
+
6
+ setlocal enabledelayedexpansion
7
+
8
+ echo ========================================
9
+ echo Premiere Pro AI Chat — Plugin Installer
10
+ echo ========================================
11
+ echo.
12
+
13
+ REM Resolve paths
14
+ set "SCRIPT_DIR=%~dp0"
15
+ set "PROJECT_ROOT=%SCRIPT_DIR%.."
16
+ set "PLUGIN_SRC=%PROJECT_ROOT%\chat-plugin"
17
+ set "PLUGIN_NAME=com.ppro.ai.chat"
18
+ set "CEP_DIR=%APPDATA%\Adobe\CEP\extensions"
19
+
20
+ echo Plugin source: %PLUGIN_SRC%
21
+ echo CEP target: %CEP_DIR%\%PLUGIN_NAME%
22
+ echo.
23
+
24
+ REM Verify source exists
25
+ if not exist "%PLUGIN_SRC%" (
26
+ echo [ERROR] Plugin source not found at %PLUGIN_SRC%
27
+ pause
28
+ exit /b 1
29
+ )
30
+
31
+ REM Create CEP extensions directory if needed
32
+ if not exist "%CEP_DIR%" (
33
+ echo Creating CEP extensions directory...
34
+ mkdir "%CEP_DIR%"
35
+ )
36
+
37
+ REM Remove existing installation
38
+ if exist "%CEP_DIR%\%PLUGIN_NAME%" (
39
+ echo Removing existing installation...
40
+ rmdir /s /q "%CEP_DIR%\%PLUGIN_NAME%"
41
+ )
42
+
43
+ REM Copy plugin
44
+ echo Installing plugin...
45
+ xcopy /s /e /i /q "%PLUGIN_SRC%" "%CEP_DIR%\%PLUGIN_NAME%"
46
+ echo [OK] Plugin installed
47
+
48
+ REM Enable unsigned extensions (CSXS 9-12)
49
+ echo.
50
+ echo Enabling unsigned CEP extensions...
51
+ for %%v in (9 10 11 12) do (
52
+ reg add "HKCU\SOFTWARE\Adobe\CSXS.%%v" /v PlayerDebugMode /t REG_SZ /d 1 /f >nul 2>&1
53
+ )
54
+ echo [OK] Debug mode enabled (CSXS 9-12)
55
+
56
+ echo.
57
+ echo ========================================
58
+ echo [OK] Installation complete!
59
+ echo ========================================
60
+ echo.
61
+ echo Next steps:
62
+ echo 1. Restart Premiere Pro (if running)
63
+ echo 2. Open: Window ^> Extensions ^> AI Chat
64
+ echo 3. Enter your Claude or Gemini API key
65
+ echo 4. Start chatting to control Premiere Pro!
66
+ echo.
67
+ pause
@@ -0,0 +1,85 @@
1
+ #!/usr/bin/env bash
2
+ # Install the Premiere Pro AI Chat CEP plugin
3
+ # Creates a symlink (or copies) from the chat-plugin/ directory
4
+ # into the Adobe CEP extensions folder.
5
+
6
+ set -e
7
+
8
+ PLUGIN_NAME="com.ppro.ai.chat"
9
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
10
+ PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
11
+ PLUGIN_SRC="$PROJECT_ROOT/chat-plugin"
12
+
13
+ echo "========================================"
14
+ echo " Premiere Pro AI Chat — Plugin Installer"
15
+ echo "========================================"
16
+ echo ""
17
+
18
+ # Detect OS
19
+ if [[ "$OSTYPE" == "darwin"* ]]; then
20
+ CEP_DIR="$HOME/Library/Application Support/Adobe/CEP/extensions"
21
+ elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
22
+ CEP_DIR="$HOME/.config/Adobe/CEP/extensions"
23
+ else
24
+ echo "⚠ Windows detected. Please manually copy:"
25
+ echo " From: $PLUGIN_SRC"
26
+ echo " To: %APPDATA%\\Adobe\\CEP\\extensions\\$PLUGIN_NAME"
27
+ echo ""
28
+ echo "Then set registry key to enable unsigned extensions:"
29
+ echo ' HKEY_CURRENT_USER\SOFTWARE\Adobe\CSXS.11'
30
+ echo ' PlayerDebugMode = "1" (String)'
31
+ exit 0
32
+ fi
33
+
34
+ echo "Plugin source: $PLUGIN_SRC"
35
+ echo "CEP target: $CEP_DIR/$PLUGIN_NAME"
36
+ echo ""
37
+
38
+ # Verify source exists
39
+ if [ ! -d "$PLUGIN_SRC" ]; then
40
+ echo "āœ— Error: Plugin source not found at $PLUGIN_SRC"
41
+ exit 1
42
+ fi
43
+
44
+ # Create CEP extensions directory if needed
45
+ if [ ! -d "$CEP_DIR" ]; then
46
+ echo "Creating CEP extensions directory..."
47
+ mkdir -p "$CEP_DIR"
48
+ fi
49
+
50
+ # Remove existing installation
51
+ if [ -L "$CEP_DIR/$PLUGIN_NAME" ] || [ -d "$CEP_DIR/$PLUGIN_NAME" ]; then
52
+ echo "Removing existing installation..."
53
+ rm -rf "$CEP_DIR/$PLUGIN_NAME"
54
+ fi
55
+
56
+ # Create symlink
57
+ echo "Creating symlink..."
58
+ ln -s "$PLUGIN_SRC" "$CEP_DIR/$PLUGIN_NAME"
59
+ echo "āœ“ Symlink created"
60
+
61
+ # Enable unsigned extensions (macOS)
62
+ if [[ "$OSTYPE" == "darwin"* ]]; then
63
+ echo ""
64
+ echo "Enabling unsigned CEP extensions..."
65
+ # Support CSXS versions 9-12 for various Premiere Pro versions
66
+ for ver in 9 10 11 12; do
67
+ defaults write com.adobe.CSXS.$ver PlayerDebugMode 1 2>/dev/null || true
68
+ done
69
+ echo "āœ“ Debug mode enabled (CSXS 9-12)"
70
+ fi
71
+
72
+ echo ""
73
+ echo "========================================"
74
+ echo " āœ“ Installation complete!"
75
+ echo "========================================"
76
+ echo ""
77
+ echo "Next steps:"
78
+ echo " 1. Restart Premiere Pro (if running)"
79
+ echo " 2. Open: Window → Extensions → AI Chat"
80
+ echo " 3. Enter your Claude or Gemini API key"
81
+ echo " 4. Start chatting to control Premiere Pro!"
82
+ echo ""
83
+ echo "Note: The AI Chat panel and MCP Bridge panel"
84
+ echo "can run side by side if you have both installed."
85
+ echo ""
@@ -0,0 +1,95 @@
1
+ @echo off
2
+ :: MCP Bridge CEP Plugin Installer for Windows
3
+ :: Does NOT require Administrator rights — uses xcopy instead of symlinks.
4
+ :: Sets PlayerDebugMode registry keys for CSXS 9-12 to allow unsigned CEP extensions.
5
+
6
+ setlocal enabledelayedexpansion
7
+
8
+ set "SCRIPT_DIR=%~dp0"
9
+ :: Remove trailing backslash from SCRIPT_DIR
10
+ if "%SCRIPT_DIR:~-1%"=="\" set "SCRIPT_DIR=%SCRIPT_DIR:~0,-1%"
11
+
12
+ set "PROJECT_DIR=%SCRIPT_DIR%\.."
13
+ :: Resolve to absolute path
14
+ pushd "%PROJECT_DIR%"
15
+ set "PROJECT_DIR=%CD%"
16
+ popd
17
+
18
+ set "PLUGIN_SRC=%PROJECT_DIR%\cep-plugin"
19
+ set "PLUGIN_NAME=MCPBridgeCEP"
20
+ set "CEP_DIR=%APPDATA%\Adobe\CEP\extensions"
21
+ set "PLUGIN_DEST=%CEP_DIR%\%PLUGIN_NAME%"
22
+
23
+ echo.
24
+ echo === MCP Bridge CEP Plugin Installer for Windows ===
25
+ echo.
26
+ echo Source: %PLUGIN_SRC%
27
+ echo Destination: %PLUGIN_DEST%
28
+ echo.
29
+
30
+ :: 1. Create CEP extensions directory if needed
31
+ if not exist "%CEP_DIR%" (
32
+ echo Creating CEP extensions directory...
33
+ mkdir "%CEP_DIR%"
34
+ )
35
+
36
+ :: 2. Remove existing installation
37
+ if exist "%PLUGIN_DEST%" (
38
+ echo Removing existing installation...
39
+ rmdir /s /q "%PLUGIN_DEST%"
40
+ )
41
+
42
+ :: 3. Copy plugin files (xcopy works without admin)
43
+ echo Copying plugin files...
44
+ xcopy /e /i /q "%PLUGIN_SRC%" "%PLUGIN_DEST%"
45
+ if errorlevel 1 (
46
+ echo ERROR: Failed to copy plugin files.
47
+ pause
48
+ exit /b 1
49
+ )
50
+ echo Plugin files copied successfully.
51
+
52
+ :: 4. Set PlayerDebugMode registry keys for CSXS 9-12
53
+ echo.
54
+ echo Setting PlayerDebugMode in registry...
55
+
56
+ for %%v in (9.0 10.0 11.0 12.0) do (
57
+ reg add "HKCU\Software\Adobe\CSXS.%%v" /v PlayerDebugMode /t REG_SZ /d 1 /f >nul 2>&1
58
+ echo Set HKCU\Software\Adobe\CSXS.%%v\PlayerDebugMode = 1
59
+ )
60
+
61
+ echo Registry keys set.
62
+
63
+ :: 5. Print next steps
64
+ echo.
65
+ echo ============================================================
66
+ echo Installation complete!
67
+ echo ============================================================
68
+ echo.
69
+ echo Next steps:
70
+ echo 1. Restart Premiere Pro completely (close and reopen)
71
+ echo 2. Go to Window ^> Extensions ^> MCP Bridge
72
+ echo 3. Set the Temp Directory to:
73
+ echo %LOCALAPPDATA%\Temp\premiere-mcp-bridge
74
+ echo 4. Click "Start Bridge" - you should see a green "Running" status
75
+ echo.
76
+ echo 5. Configure Claude Desktop (%%APPDATA%%\Claude\claude_desktop_config.json):
77
+ echo.
78
+ echo {
79
+ echo "mcpServers": {
80
+ echo "premiere-pro": {
81
+ echo "command": "node",
82
+ echo "args": ["%PROJECT_DIR%\dist\index.js"],
83
+ echo "env": {
84
+ echo "PREMIERE_TEMP_DIR": "%LOCALAPPDATA%\Temp\premiere-mcp-bridge"
85
+ echo }
86
+ echo }
87
+ echo }
88
+ echo }
89
+ echo.
90
+ echo 6. Build the MCP server (if not already built):
91
+ echo cd "%PROJECT_DIR%" ^&^& npm install ^&^& npm run build
92
+ echo.
93
+
94
+ pause
95
+ endlocal
@@ -0,0 +1,218 @@
1
+ /**
2
+ * Synthetic Premiere Pro MCP — Build & Package
3
+ *
4
+ * Produces a distributable, IP-protected release in ./release :
5
+ * release/
6
+ * server/index.mjs bundled + minified (+ obfuscated) MCP server
7
+ * server/package.json minimal ESM marker
8
+ * MCPBridgeCEP.zxp signed CEP plugin (obfuscated premiere.jsx, no .debug)
9
+ * install/ install scripts
10
+ * README.md LICENSE
11
+ * synthetic-premiere-mcp-v{VERSION}.zip
12
+ *
13
+ * Usage: node scripts/package.mjs
14
+ * Env: ZXP_SIGN_CMD (path to ZXPSignCmd.exe), ZXP_CERT_PASSWORD (default "synthetic")
15
+ */
16
+ import {
17
+ readFileSync, writeFileSync, mkdirSync, copyFileSync, existsSync,
18
+ rmSync, readdirSync, statSync,
19
+ } from "fs";
20
+ import { join, dirname } from "path";
21
+ import { fileURLToPath } from "url";
22
+ import { execSync, spawnSync } from "child_process";
23
+ import { build as esbuild } from "esbuild";
24
+ import JavaScriptObfuscator from "javascript-obfuscator";
25
+
26
+ const __dirname = dirname(fileURLToPath(import.meta.url));
27
+ const ROOT = join(__dirname, "..");
28
+ const REL = join(ROOT, "release");
29
+ const pkg = JSON.parse(readFileSync(join(ROOT, "package.json"), "utf-8"));
30
+ const V = pkg.version;
31
+
32
+ console.log(`\nšŸ”Ø Packaging Synthetic Premiere MCP v${V}\n`);
33
+
34
+ // ─── 1. Clean ────────────────────────────────────────────────────────────────
35
+ if (existsSync(REL)) rmSync(REL, { recursive: true, force: true });
36
+ mkdirSync(join(REL, "server"), { recursive: true });
37
+ console.log("āœ“ Cleaned release/");
38
+
39
+ // ─── 2. Compile TS, then bundle with esbuild (single minified ESM file) ──────
40
+ console.log("āš™ tsc build...");
41
+ execSync("npm run build", { cwd: ROOT, stdio: "pipe" });
42
+ const serverOut = join(REL, "server", "index.mjs");
43
+ await esbuild({
44
+ entryPoints: [join(ROOT, "dist", "index.js")],
45
+ bundle: true,
46
+ platform: "node",
47
+ format: "esm",
48
+ target: "node18",
49
+ minify: true,
50
+ legalComments: "none",
51
+ outfile: serverOut,
52
+ });
53
+ const bundledSize = (statSync(serverOut).size / 1024).toFixed(1);
54
+ console.log(`āœ“ Bundled server → release/server/index.mjs (${bundledSize} KB)`);
55
+
56
+ // ─── 3. Obfuscate the bundle (conservative; falls back to minify-only) ───────
57
+ function validateServer(file) {
58
+ // Start the server; it must print "Registered 437 tools" on stderr then be ready.
59
+ const r = spawnSync(process.execPath, [file], {
60
+ input: "",
61
+ timeout: 8000,
62
+ encoding: "utf-8",
63
+ env: { ...process.env },
64
+ });
65
+ const out = (r.stderr || "") + (r.stdout || "");
66
+ const m = out.match(/Registered (\d+) tools/);
67
+ return m ? parseInt(m[1], 10) : 0;
68
+ }
69
+
70
+ const minifiedCode = readFileSync(serverOut, "utf-8");
71
+ let serverProtected = "minify-only";
72
+ try {
73
+ console.log("šŸ”’ Obfuscating server bundle...");
74
+ // Strip the shebang before obfuscating; re-add after.
75
+ const noShebang = minifiedCode.replace(/^#![^\n]*\n/, "");
76
+ const obf = JavaScriptObfuscator.obfuscate(noShebang, {
77
+ compact: true,
78
+ target: "node",
79
+ controlFlowFlattening: false,
80
+ deadCodeInjection: false,
81
+ debugProtection: false,
82
+ disableConsoleOutput: false,
83
+ identifierNamesGenerator: "hexadecimal",
84
+ numbersToExpressions: false,
85
+ renameGlobals: false,
86
+ selfDefending: false,
87
+ simplify: true,
88
+ splitStrings: false,
89
+ stringArray: true,
90
+ stringArrayEncoding: ["base64"],
91
+ stringArrayThreshold: 0.75,
92
+ unicodeEscapeSequence: false,
93
+ }).getObfuscatedCode();
94
+ writeFileSync(serverOut, "#!/usr/bin/env node\n" + obf);
95
+
96
+ const n = validateServer(serverOut);
97
+ if (n >= 400) {
98
+ serverProtected = "obfuscated";
99
+ console.log(`āœ“ Obfuscated server validated (registered ${n} tools)`);
100
+ } else {
101
+ throw new Error(`obfuscated server registered ${n} tools (expected 437)`);
102
+ }
103
+ } catch (e) {
104
+ console.warn(` ⚠ Obfuscation rejected (${e.message}). Falling back to minify-only.`);
105
+ writeFileSync(serverOut, minifiedCode);
106
+ const n = validateServer(serverOut);
107
+ if (n < 400) {
108
+ console.error(`āœ— Minified server also failed to register tools (${n}). Aborting.`);
109
+ process.exit(1);
110
+ }
111
+ console.log(`āœ“ Minified server validated (registered ${n} tools)`);
112
+ }
113
+ writeFileSync(join(REL, "server", "package.json"),
114
+ JSON.stringify({ name: "synthetic-premiere-mcp", version: V, type: "module", private: true }, null, 2));
115
+
116
+ // ─── 4. Stage the CEP plugin (obfuscate premiere.jsx + main.js, strip .debug) ─
117
+ const CEP_SRC = join(ROOT, "cep-plugin");
118
+ const CEP_STAGE = join(REL, "_cepstage");
119
+ copyDirSync(CEP_SRC, CEP_STAGE);
120
+
121
+ // 4a. Strip the dev debug file (opens a CEF debug port — must not ship).
122
+ const dbg = join(CEP_STAGE, ".debug");
123
+ if (existsSync(dbg)) { rmSync(dbg); console.log("āœ“ Stripped cep .debug"); }
124
+
125
+ // 4b. Stamp version into the staged manifest.
126
+ const mxPath = join(CEP_STAGE, "CSXS", "manifest.xml");
127
+ let mx = readFileSync(mxPath, "utf-8")
128
+ .replace(/ExtensionBundleVersion="[^"]*"/, `ExtensionBundleVersion="${V}"`)
129
+ .replace(/(<Extension Id="[^"]*" Version=")[^"]*(")/, `$1${V}$2`);
130
+ writeFileSync(mxPath, mx);
131
+
132
+ // 4c. Obfuscate the ExtendScript library + panel logic. ExtendScript-safe settings:
133
+ // renameGlobals MUST stay false (helper fns are called by name), no control-flow
134
+ // flattening / selfDefending (incompatible with the ExtendScript engine).
135
+ const ES_SAFE = {
136
+ compact: true,
137
+ controlFlowFlattening: false,
138
+ deadCodeInjection: false,
139
+ debugProtection: false,
140
+ disableConsoleOutput: false,
141
+ identifierNamesGenerator: "hexadecimal",
142
+ numbersToExpressions: false,
143
+ renameGlobals: false,
144
+ selfDefending: false,
145
+ simplify: true,
146
+ splitStrings: false,
147
+ stringArray: true,
148
+ stringArrayEncoding: ["base64"],
149
+ stringArrayThreshold: 0.75,
150
+ unicodeEscapeSequence: false,
151
+ };
152
+ for (const f of ["premiere.jsx", "main.js"]) {
153
+ const p = join(CEP_STAGE, f);
154
+ if (!existsSync(p)) continue;
155
+ const src = readFileSync(p, "utf-8").replace(/^#!.*\n/, "");
156
+ const obf = JavaScriptObfuscator.obfuscate(src, ES_SAFE).getObfuscatedCode();
157
+ writeFileSync(p, obf);
158
+ console.log(`āœ“ Obfuscated cep/${f} (${(obf.length / 1024).toFixed(1)} KB)`);
159
+ }
160
+
161
+ // ─── 5. Sign the staged plugin into a .zxp ───────────────────────────────────
162
+ const ZXP = process.env.ZXP_SIGN_CMD ||
163
+ "C:\\Users\\Artear\\Documents\\CEP-Resources\\ZXPSignCMD\\4.1.3\\x64\\ZXPSignCmd.exe";
164
+ const certPath = process.env.ZXP_CERT_PATH || join(ROOT, ".cert", "self-signed.p12");
165
+ const certPass = process.env.ZXP_CERT_PASSWORD || "synthetic";
166
+ const zxpOut = join(REL, "MCPBridgeCEP.zxp");
167
+
168
+ if (!existsSync(certPath)) { console.error(`āœ— Cert not found: ${certPath}`); process.exit(1); }
169
+ function sign(withTsa) {
170
+ const tsa = withTsa ? ` -tsa "http://timestamp.digicert.com"` : "";
171
+ execSync(`"${ZXP}" -sign "${CEP_STAGE}" "${zxpOut}" "${certPath}" "${certPass}"${tsa}`,
172
+ { cwd: ROOT, stdio: "pipe" });
173
+ }
174
+ console.log("šŸ–Š Signing MCPBridgeCEP.zxp...");
175
+ try {
176
+ try { sign(true); } catch { if (existsSync(zxpOut)) rmSync(zxpOut); console.warn(" ⚠ TSA failed — signing offline."); sign(false); }
177
+ console.log(`āœ“ Signed → release/MCPBridgeCEP.zxp (${(statSync(zxpOut).size / 1024).toFixed(1)} KB)`);
178
+ } catch (e) {
179
+ console.error("āœ— Signing failed:", (e.stderr || e.message || "").toString());
180
+ process.exit(1);
181
+ }
182
+ rmSync(CEP_STAGE, { recursive: true, force: true });
183
+
184
+ // ─── 6. Install scripts + docs ───────────────────────────────────────────────
185
+ mkdirSync(join(REL, "install"), { recursive: true });
186
+ for (const s of ["install-cep-windows.ps1", "install-windows.bat", "install-cep.sh"]) {
187
+ const p = join(ROOT, "scripts", s);
188
+ if (existsSync(p)) copyFileSync(p, join(REL, "install", s));
189
+ }
190
+ for (const f of ["LICENSE"]) {
191
+ if (existsSync(join(ROOT, f))) copyFileSync(join(ROOT, f), join(REL, f));
192
+ }
193
+ console.log("āœ“ Copied install scripts + LICENSE");
194
+
195
+ // ─── 7. Zip ──────────────────────────────────────────────────────────────────
196
+ const zipName = `synthetic-premiere-mcp-v${V}.zip`;
197
+ const zipPath = join(ROOT, zipName);
198
+ if (existsSync(zipPath)) rmSync(zipPath);
199
+ try {
200
+ execSync(`powershell -NoProfile -Command "Compress-Archive -Path '${REL}\\*' -DestinationPath '${zipPath}' -Force"`,
201
+ { stdio: "pipe" });
202
+ console.log(`āœ“ Zipped → ${zipName} (${(statSync(zipPath).size / 1024).toFixed(1)} KB)`);
203
+ } catch (e) {
204
+ console.warn(" ⚠ Zip step skipped:", (e.stderr || e.message || "").toString().slice(0, 120));
205
+ }
206
+
207
+ console.log(`\nāœ… Done. Server protection: ${serverProtected}.`);
208
+ console.log(` release/ + ${zipName}\n`);
209
+
210
+ // ─── helper ──────────────────────────────────────────────────────────────────
211
+ function copyDirSync(src, dest) {
212
+ mkdirSync(dest, { recursive: true });
213
+ for (const entry of readdirSync(src)) {
214
+ const s = join(src, entry), d = join(dest, entry);
215
+ if (statSync(s).isDirectory()) copyDirSync(s, d);
216
+ else copyFileSync(s, d);
217
+ }
218
+ }