@lalalic/markcut 3.2.29 → 3.2.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/AGENTS.md +4 -0
- package/package.json +1 -1
- package/src/mcp/audio-preview-tree.ts +25 -0
- package/src/mcp/preview.mjs +2 -1
- package/src/mcp/remotion-app.bundle.js +296 -296
- package/src/mcp/remotion-app.tsx +4 -8
- package/src/mcp/web-audio-preview.ts +22 -17
- package/tests/mcp-web-audio-preview.test.ts +36 -0
package/AGENTS.md
CHANGED
|
@@ -301,3 +301,7 @@ For comment-editor or timeline-dot changes, verify the built MCP player in a rea
|
|
|
301
301
|
## MCP Provider Reload After Changes
|
|
302
302
|
|
|
303
303
|
Whenever Markcut MCP server, preview UI, bridge, or bundled player code changes, rebuild the MCP bundle and reload **only the Markcut MCP provider** through Neo's provider control interface before testing or declaring the change live. Verify the running provider serves the new resource URI, then open a fresh ChatGPT iframe and check its displayed version and affected behavior. A Git push or ChatGPT tool-list refresh alone is not a provider reload. Never restart the whole Neo MCP app as a workaround; if scoped reload fails, report the live version and blocker explicitly.
|
|
304
|
+
|
|
305
|
+
## MCP background-audio regression guard
|
|
306
|
+
|
|
307
|
+
When extracting HTTPS BGM from a preview tree, traverse the tree **before** returning the captured audio variable. JavaScript evaluates object properties left-to-right: returning `{audio, playbackRoot: strip(root)}` silently loses the BGM handle while removing the native audio node. Keep the pure extraction in `src/mcp/audio-preview-tree.ts` and run `tests/mcp-web-audio-preview.test.ts`. For user-style playback verification, check network HTTP 200, decoded duration, a running AudioContext, advancing Remotion frames, and nonzero Web Audio analyser RMS; a decoded source alone does not establish audible playback.
|
package/package.json
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// The MCP iframe plays HTTPS tracks through Web Audio instead of Remotion media
|
|
2
|
+
// elements. Keep the selected track separate from the visual playback tree.
|
|
3
|
+
export function extractRemotePreviewAudio(root:any) {
|
|
4
|
+
let audio:any=null;
|
|
5
|
+
const strip=(node:any):any=>{
|
|
6
|
+
if(!node||typeof node!=='object')return node;
|
|
7
|
+
if(node.type==='audio'&&String(node.src).startsWith('https://')){
|
|
8
|
+
audio??=node;
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
return {...node,...(Array.isArray(node.children)?{children:node.children.map(strip).filter(Boolean)}:{})};
|
|
12
|
+
};
|
|
13
|
+
// IMPORTANT: do not return {audio, playbackRoot: strip(root)}. Object
|
|
14
|
+
// properties are evaluated left to right; audio would be captured as null.
|
|
15
|
+
const playbackRoot=strip(root);
|
|
16
|
+
return {audio,playbackRoot};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Browser TTS suppresses recorded non-background audio, but preserves the soundtrack.
|
|
20
|
+
export function withoutRecordedNarration(root:any):any {
|
|
21
|
+
if(!root||typeof root!=='object')return root;
|
|
22
|
+
if(root.type==='audio'&&!root.isBackground)return null;
|
|
23
|
+
return {...root,...(Array.isArray(root.children)?{children:root.children.map(withoutRecordedNarration).filter(Boolean)}:{}),
|
|
24
|
+
...(root.type==='root'?{subtitle:undefined}:{})};
|
|
25
|
+
}
|
package/src/mcp/preview.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import { buildPreviewBridgeScript } from "./bridge.mjs";
|
|
|
8
8
|
import { externalizePreviewMedia, publicOrigin, resolveMountedFile, resolvePreviewPath, publishPlayerBundle, publishCompiledCache, prunePublishedCache, EXPORT_ROOT } from "./remote-assets.mjs";
|
|
9
9
|
|
|
10
10
|
export const TOOL_NAME = "markcut.preview";
|
|
11
|
-
export const RESOURCE_URI = "ui://markcut/video-preview-
|
|
11
|
+
export const RESOURCE_URI = "ui://markcut/video-preview-v36.html";
|
|
12
12
|
// Legacy entrypoints remain registered, but serve the current implementation.
|
|
13
13
|
export const LEGACY_RESOURCE_URIS = [
|
|
14
14
|
"ui://markcut/video-preview-v3.html",
|
|
@@ -43,6 +43,7 @@ export const LEGACY_RESOURCE_URIS = [
|
|
|
43
43
|
"ui://markcut/video-preview-v32.html",
|
|
44
44
|
"ui://markcut/video-preview-v33.html",
|
|
45
45
|
"ui://markcut/video-preview-v34.html",
|
|
46
|
+
"ui://markcut/video-preview-v35.html",
|
|
46
47
|
];
|
|
47
48
|
export const RESOURCE_MIME_TYPE = "text/html;profile=mcp-app";
|
|
48
49
|
// Google Maps JS loads libraries, tiles and Routes RPCs from these HTTPS origins.
|