@lalalic/markcut 3.2.47 → 3.2.49
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/README.md +15 -7
- package/docs/developer-reference.md +4 -0
- package/package.json +1 -1
- package/src/mcp/bridge.mjs +48 -18
- package/src/mcp/mobile-review-cli.mjs +66 -8
- package/src/mcp/preview.mjs +5 -6
- package/src/mcp/remotion-app.bundle.js +73 -73
- package/src/mcp/remotion-app.tsx +2 -3
- package/src/mcp/review-delivery.mjs +6 -5
- package/src/mcp/server.mjs +2 -2
- package/src/render/cli.mjs +1 -0
- package/src/vision/cli.mjs +37 -3
- package/tests/mcp-preview-bridge.test.ts +41 -28
- package/tests/mcp-preview-delivery.test.ts +7 -6
- package/tests/mcp-preview.test.ts +14 -0
- package/tests/mobile-preview-cli.test.ts +40 -2
- package/tests/vision-normalize-only.test.ts +55 -0
package/README.md
CHANGED
|
@@ -393,10 +393,18 @@ choose or manage a browser/model provider.
|
|
|
393
393
|
|
|
394
394
|
### Independent preview and mobile delivery
|
|
395
395
|
|
|
396
|
-
`markcut.preview`
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
396
|
+
`markcut.preview` compiles immutable video revisions and exposes the player.
|
|
397
|
+
The MCP compiler itself does **not** send APNs notifications, manage Relay
|
|
398
|
+
Invocations, or change Task state. Through Neo MCP, Neo's Federation Wrapper
|
|
399
|
+
binds an optional Relay execution, watches compilation, and delivers the review
|
|
400
|
+
through Neo.app Core's loopback-only `POST /mobile/review/notify` REST API.
|
|
401
|
+
|
|
402
|
+
The terminal command `markcut preview video.md --delivery event --event-template
|
|
403
|
+
/path/event.json` compiles the same immutable revision, then sends its request
|
|
404
|
+
to that same Neo.app Core REST endpoint. Exit status is nonzero if Neo Core does
|
|
405
|
+
not confirm durable Inbox storage; a `review_requested` receipt confirms only
|
|
406
|
+
Inbox acceptance, not the person's decision. `--delivery text` similarly
|
|
407
|
+
mirrors a view-only mobile preview when no ChatGPT thread is bound. Neither
|
|
408
|
+
path embeds an APNs key or creates its own notification provider. Standalone
|
|
409
|
+
Markcut compilation without human-review delivery does not require Neo Mobile
|
|
410
|
+
or Agents Relay.
|
|
@@ -316,3 +316,7 @@ When extracting HTTPS BGM from a preview tree, traverse the tree **before** retu
|
|
|
316
316
|
## Route map framing
|
|
317
317
|
|
|
318
318
|
For `map view:route`, omit `zoom` to auto-fit geotagged stops to the Remotion composition dimensions, including 9:16 vertical output; auto-fit reserves 14% padding. The route schema and both descriptive compiler paths must leave omitted zoom undefined, or their old `zoom:10` defaults silently override the runtime fit. Explicit `zoom` and camera tweens still override fit. Verify the real browser map's zoom/center and rendered tiles, not just a successful Markdown compile or Google API HTTP response. A calculated Directions line is not proof of a recorded GPS track.
|
|
319
|
+
|
|
320
|
+
## Git-backed interactive Review identity (2026-11)
|
|
321
|
+
|
|
322
|
+
Event-mode Markcut Preview requires a full 40-character Git Commit SHA from a **validated** Neo Project Stage, supplied with `--commit-sha SHA` (CLI) or `review.commitSha` (MCP). The Neo Project Runner commits *before* preview delivery, then adds an immutable `review/rN` tag. The Neo Master REST request and Relay `task.interactive_decision` use `commitSha` as the only review revision identity (with `interactive.revision=commitSha`). `mediaHash` is retained separately for compiled preview media retrieval, **not** for decision binding; standalone `delivery:text` continues to use Markcut's internal compile cache identity. Never accept an Event review without an explicit SHA or silently revert to content-hash identity.
|
package/package.json
CHANGED
package/src/mcp/bridge.mjs
CHANGED
|
@@ -3,17 +3,26 @@ return `
|
|
|
3
3
|
const feedback=document.getElementById('feedback'),status=document.getElementById('status'),pathLabel=document.getElementById('path-label');
|
|
4
4
|
let nextId=0,identity=null,busy=false,expectedPath=null,activePath=null,activeRelay=null,activeReview={delivery:"text"},expectedDelivery="text",submittedRevision=null,submission=null;
|
|
5
5
|
const comments=[];
|
|
6
|
-
let currentScene={sceneId:null,sceneName:null,sceneStart:0,timeSeconds:0},selectedId=
|
|
6
|
+
let currentScene={sceneId:null,sceneName:null,sceneStart:0,timeSeconds:0},selectedId=0,nextCommentId=0;
|
|
7
7
|
const mode=document.getElementById('comment-mode');
|
|
8
8
|
const sceneKey=c=>String(c?.sceneName||c?.sceneId||'Overall');
|
|
9
|
+
function updateDeliveryMode(){
|
|
10
|
+
const el=document.getElementById('review-delivery-mode');
|
|
11
|
+
if(!el)return;
|
|
12
|
+
// Never claim a bound Event destination until the authoritative provider
|
|
13
|
+
// result actually supplies the authenticated event template.
|
|
14
|
+
const bound=activeReview?.delivery==='event'&&Boolean(activeReview.eventTemplate);
|
|
15
|
+
el.textContent=bound?'Event mode':expectedDelivery==='event'?'Event mode · unavailable':'Text mode';
|
|
16
|
+
el.title=bound?'Review decisions publish via the bound Events provider':
|
|
17
|
+
expectedDelivery==='event'?'Waiting for authenticated event delivery configuration':
|
|
18
|
+
'Review decisions are sent as messages in this conversation';
|
|
19
|
+
}
|
|
9
20
|
function allComments(){
|
|
10
21
|
return comments.filter(x=>x.text.trim()).map(({scope,text,context})=>({scope,text:text.trim(),playbackContext:context}));
|
|
11
22
|
}
|
|
12
23
|
function redrawComments(){
|
|
13
24
|
const names=[...new Set(comments.filter(x=>x.text.trim()&&x.scope!=='overall').map(x=>sceneKey(x.context)))];
|
|
14
25
|
window.dispatchEvent(new CustomEvent('markcut:comments-change',{detail:{sceneNames:names}}));
|
|
15
|
-
const count=document.getElementById('comment-count');
|
|
16
|
-
if(count)count.textContent=comments.length+' comment'+(comments.length===1?'':'s');
|
|
17
26
|
const remove=document.getElementById('remove-spot');
|
|
18
27
|
if(remove)remove.disabled=selectedId===null||selectedId===0;
|
|
19
28
|
const overall=selectedId===0||comments.some(x=>x.id===selectedId&&x.scope==='overall');
|
|
@@ -23,7 +32,7 @@ function redrawComments(){
|
|
|
23
32
|
window.dispatchEvent(new CustomEvent('markcut:spots-change',{detail:{spots}}));
|
|
24
33
|
}
|
|
25
34
|
function clearComments(){
|
|
26
|
-
comments.length=0;selectedId=
|
|
35
|
+
comments.length=0;selectedId=0;currentScene={sceneId:null,sceneName:null,sceneStart:0,timeSeconds:0};feedback.value='';mode.value='spot';redrawComments();
|
|
27
36
|
}
|
|
28
37
|
window.addEventListener('markcut:scene-change',event=>{currentScene={...(event.detail||{})};});
|
|
29
38
|
function autoSaveBeforeSwitch(){
|
|
@@ -66,19 +75,27 @@ document.getElementById('remove-spot').onclick=()=>{
|
|
|
66
75
|
selectedId=null;feedback.value='';
|
|
67
76
|
redrawComments();
|
|
68
77
|
};
|
|
69
|
-
|
|
70
|
-
const value=feedback.value.trim()
|
|
71
|
-
if(!value){status.textContent='Write a comment first.';return;}
|
|
78
|
+
function saveDraft({fallbackOverall=false}={}){
|
|
79
|
+
const value=feedback.value.trim();
|
|
80
|
+
if(!value){status.textContent='Write a comment first.';return false;}
|
|
81
|
+
let scope=(selectedId===0||comments.some(x=>x.id===selectedId&&x.scope==='overall'))?'overall':mode.value;
|
|
72
82
|
const live=window.__markcutPlaybackContext||currentScene;
|
|
73
|
-
if(scope!=='overall'&&!live.sceneId&&!live.sceneName){
|
|
83
|
+
if(scope!=='overall'&&!live.sceneId&&!live.sceneName){
|
|
84
|
+
if(!fallbackOverall){status.textContent='Choose a scene first.';return false;}
|
|
85
|
+
scope='overall';
|
|
86
|
+
}
|
|
74
87
|
const context=scope==='overall'?{sceneId:null,sceneName:null,timeSeconds:0}:
|
|
75
88
|
{...live,timeSeconds:scope==='scene'?(Number(live.sceneStart)||0):(Number(live.timeSeconds)||0)};
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
89
|
+
const existing=comments.find(x=>x.id===selectedId) ||
|
|
90
|
+
(selectedId===0?comments.find(x=>x.scope==='overall'):null);
|
|
91
|
+
const saved=existing||{id:++nextCommentId,scope,text:value,context};
|
|
92
|
+
if(existing){existing.text=value;existing.scope=scope;existing.context=context;}
|
|
93
|
+
else comments.push(saved);
|
|
94
|
+
selectedId=scope==='overall'?saved.id:null;
|
|
95
|
+
feedback.value='';status.textContent='';redrawComments();
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
document.getElementById('save-spot').onclick=()=>saveDraft({fallbackOverall:true});
|
|
82
99
|
const pending=new Map();
|
|
83
100
|
const resultsByPath=new Map();
|
|
84
101
|
let fallbackGeneration=0;
|
|
@@ -113,6 +130,7 @@ function applyToolInput(params){
|
|
|
113
130
|
if(typeof input.path!=='string')return;
|
|
114
131
|
expectedPath=input.path;
|
|
115
132
|
expectedDelivery=input.review?.delivery==='event'?'event':'text';
|
|
133
|
+
updateDeliveryMode();
|
|
116
134
|
// The selection has no authority to change delivery; only the compiled
|
|
117
135
|
// operation result supplies the provider-bound review configuration.
|
|
118
136
|
loadRemoteScenes(expectedPath);
|
|
@@ -120,7 +138,7 @@ function applyToolInput(params){
|
|
|
120
138
|
const cached=resultsByPath.get(expectedPath);
|
|
121
139
|
if(cached){if(cached.operationUrl)trackOperation(cached);else renderRevision(cached);return;}
|
|
122
140
|
if(window.__markcutRevision?.path!==expectedPath && window.__markcutRevision?.requestedPath!==expectedPath){
|
|
123
|
-
identity=null;activeReview={delivery:"text"};
|
|
141
|
+
identity=null;activeReview={delivery:"text"};updateDeliveryMode();
|
|
124
142
|
window.__markcutRevision=null;
|
|
125
143
|
window.dispatchEvent(new CustomEvent('markcut:revision',{detail:null}));
|
|
126
144
|
pathLabel.textContent=expectedPath;
|
|
@@ -135,10 +153,10 @@ function eventEnvelope(template,review){
|
|
|
135
153
|
const fixed=template.data.interactive;
|
|
136
154
|
if(!match || !fixed || fixed.jobId!==match[1] || fixed.taskId!==match[2] ||
|
|
137
155
|
fixed.executionId!==match[3] || !fixed.invocationId ||
|
|
138
|
-
['decision','feedback','comments','revision','revisionId','contentHash','previewId','requestId','idempotencyKey']
|
|
156
|
+
['decision','feedback','comments','revision','revisionId','contentHash','commitSha','previewId','requestId','idempotencyKey']
|
|
139
157
|
.some(key=>Object.prototype.hasOwnProperty.call(fixed,key)))throw new Error('Invalid bound interactive decision');
|
|
140
158
|
return {type:template.type,source:template.source,data:{...template.data,interactive:{
|
|
141
|
-
...fixed,revision:
|
|
159
|
+
...fixed,revision:activeReview.commitSha,commitSha:activeReview.commitSha,
|
|
142
160
|
previewId:review.previewId,requestId:review.requestId,decision:review.decision,
|
|
143
161
|
feedback:review.feedback||review.comments.map(c=>c.text).join('\\n'),
|
|
144
162
|
comments:review.comments,idempotencyKey:review.idempotencyKey
|
|
@@ -146,6 +164,8 @@ function eventEnvelope(template,review){
|
|
|
146
164
|
}
|
|
147
165
|
|
|
148
166
|
async function sendReviewEvent(result){
|
|
167
|
+
if(!/^[a-f0-9]{40}$/.test(activeReview.commitSha||''))throw new Error('Review requires Git Commit SHA');
|
|
168
|
+
result.commitSha=activeReview.commitSha;
|
|
149
169
|
const event=eventEnvelope(activeReview.eventTemplate,result);
|
|
150
170
|
// MCP Apps tools/call is host-mediated; an unavailable or unauthorized Events
|
|
151
171
|
// provider MUST fail, never be substituted with ui/message.
|
|
@@ -224,6 +244,7 @@ async function renderRevision(data){
|
|
|
224
244
|
if(!data.compiled&&!data.compiledUrl){status.textContent='Compiled scenes unavailable';return;}
|
|
225
245
|
identity={requestId:data.requestId||data.operationId||data.revisionId,previewId:data.id,revisionId:data.revisionId,contentHash:data.contentHash};
|
|
226
246
|
activeReview=data.review||{delivery:'text'};
|
|
247
|
+
updateDeliveryMode();
|
|
227
248
|
activePath=data.requestedPath||data.path||expectedPath||null;
|
|
228
249
|
activeRelay=data.relay||null;
|
|
229
250
|
if(submittedRevision!==data.revisionId){busy=false;submittedRevision=null;submission=null;}
|
|
@@ -279,7 +300,14 @@ async function submit(decision){
|
|
|
279
300
|
if(document.getElementById(decision==='approved'?'approve':'changes').disabled){
|
|
280
301
|
status.textContent='Review disabled for this revision or delivery configuration.';return;
|
|
281
302
|
}
|
|
282
|
-
|
|
303
|
+
// The submission button must save a draft, not silently require a second '+' action.
|
|
304
|
+
if(feedback.value.trim()){
|
|
305
|
+
if(decision==='approved'){
|
|
306
|
+
status.textContent='You have draft feedback. Submit feedback or clear it before approving.';
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
if(!saveDraft({fallbackOverall:true}))return;
|
|
310
|
+
}
|
|
283
311
|
const preparedComments=allComments();
|
|
284
312
|
if(decision==='changes_requested'&&!preparedComments.length){status.textContent='Feedback is required.';return;}
|
|
285
313
|
if(decision==='approved'&&preparedComments.length){status.textContent='Submit or remove draft comments before approval.';return;}
|
|
@@ -315,6 +343,8 @@ async function submit(decision){
|
|
|
315
343
|
}
|
|
316
344
|
document.getElementById('approve').onclick=()=>submit('approved');
|
|
317
345
|
document.getElementById('changes').onclick=()=>submit('changes_requested');
|
|
346
|
+
redrawComments();
|
|
347
|
+
updateDeliveryMode();
|
|
318
348
|
initialize();
|
|
319
349
|
`;
|
|
320
350
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/** Standalone terminal preview compiler. Notification is owned by the Neo MCP wrapper. */
|
|
3
|
-
import {readFileSync} from 'node:fs';
|
|
4
|
-
import {join,resolve} from 'node:path';
|
|
3
|
+
import {readFileSync,existsSync} from 'node:fs';
|
|
4
|
+
import {join,resolve,basename} from 'node:path';
|
|
5
|
+
import {homedir} from 'node:os';
|
|
5
6
|
import {pathToFileURL} from 'node:url';
|
|
6
7
|
import {normalizeReviewConfig} from './review-delivery.mjs';
|
|
7
8
|
|
|
@@ -9,26 +10,81 @@ const delay = ms => new Promise(done => setTimeout(done,ms));
|
|
|
9
10
|
|
|
10
11
|
export function parseEventPreviewOptions(argv) {
|
|
11
12
|
if (argv[0] !== 'preview' || !argv[1] || argv[1].startsWith('--')) throw new Error('Usage: markcut preview <file.md> --delivery event --event-template <file.json>');
|
|
12
|
-
const allowed=new Set(['--delivery','--event-template','--timeout-ms']);
|
|
13
|
+
const allowed=new Set(['--delivery','--event-template','--timeout-ms','--commit-sha']);
|
|
13
14
|
const options={file:resolve(argv[1])};
|
|
14
15
|
for(let i=2;i<argv.length;i+=2){
|
|
15
16
|
const flag=argv[i],value=argv[i+1];
|
|
16
17
|
if(!allowed.has(flag) || !value || value.startsWith('--'))throw new Error('Missing or unsupported preview event flag: '+flag);
|
|
17
|
-
const key={'--delivery':'delivery','--event-template':'eventTemplatePath','--timeout-ms':'timeoutMs'}[flag];
|
|
18
|
+
const key={'--delivery':'delivery','--event-template':'eventTemplatePath','--timeout-ms':'timeoutMs','--commit-sha':'commitSha'}[flag];
|
|
18
19
|
if(Object.hasOwn(options,key))throw new Error('Duplicate flag: '+flag);
|
|
19
20
|
options[key]=value;
|
|
20
21
|
}
|
|
21
22
|
if(!['text','event'].includes(options.delivery) || (options.delivery==='event')!==Boolean(options.eventTemplatePath))
|
|
22
23
|
throw new Error('Event delivery requires --event-template; Text delivery must omit it');
|
|
24
|
+
if(options.delivery==='event' && !/^[a-f0-9]{40}$/.test(options.commitSha||''))
|
|
25
|
+
throw new Error('Event review requires --commit-sha with full 40-character Git SHA');
|
|
26
|
+
if(options.delivery==='text' && options.commitSha)throw new Error('Text previews do not bind a Git Commit SHA');
|
|
23
27
|
const limit=options.timeoutMs===undefined ? 300000 : Number(options.timeoutMs);
|
|
24
28
|
if(!Number.isSafeInteger(limit) || limit<1000 || limit>1800000)throw new Error('--timeout-ms must be 1000..1800000');
|
|
25
29
|
options.timeoutMs=limit;
|
|
26
30
|
return options;
|
|
27
31
|
}
|
|
28
32
|
|
|
33
|
+
// The compiler stays platform-neutral. The explicit CLI review workflow
|
|
34
|
+
// delivers to Neo.app's authenticated local Core REST boundary, never APNs or
|
|
35
|
+
// the Agent-facing MCP tool surface. Inability to persist the inbox is fatal.
|
|
36
|
+
export function neoReviewEndpoint(override=process.env.NEO_REVIEW_NOTIFY_URL,
|
|
37
|
+
deploymentFile=join(homedir(),'Library','Application Support','NeoY','deployment.json')){
|
|
38
|
+
let url;
|
|
39
|
+
if(override)url=new URL(override);
|
|
40
|
+
else{
|
|
41
|
+
let port=6767;
|
|
42
|
+
if(existsSync(deploymentFile)){
|
|
43
|
+
const config=JSON.parse(readFileSync(deploymentFile,'utf8'));
|
|
44
|
+
if(Number.isInteger(config.mcpPort)&&config.mcpPort>0&&config.mcpPort<=65535)port=config.mcpPort;
|
|
45
|
+
}
|
|
46
|
+
url=new URL('http://127.0.0.1:'+port+'/mobile/review/notify');
|
|
47
|
+
}
|
|
48
|
+
if(url.protocol!=='http:'||!['localhost','127.0.0.1'].includes(url.hostname)||
|
|
49
|
+
url.pathname!=='/mobile/review/notify'||url.search||url.hash||url.username||url.password)
|
|
50
|
+
throw Error('Neo Review delivery must use the local REST notify endpoint');
|
|
51
|
+
return url.href;
|
|
52
|
+
}
|
|
53
|
+
export function buildReviewRequest(options,config,state,operationId){
|
|
54
|
+
const data=state?.result;
|
|
55
|
+
if(!data||typeof data.contentHash!=='string'||typeof data.revisionId!=='string'||
|
|
56
|
+
!data.contentHash.match(/^[a-f0-9]{64}$/)||!data.revisionId)
|
|
57
|
+
throw Error('Compiled Preview has no immutable revision identity');
|
|
58
|
+
const request={id:operationId,previewId:data.id,title:basename(options.file,'.md'),delivery:config.delivery};
|
|
59
|
+
if(config.delivery==='event'){
|
|
60
|
+
if(!/^[a-f0-9]{40}$/.test(options.commitSha||''))throw Error('Git Commit SHA required for Event Review');
|
|
61
|
+
request.commitSha=options.commitSha;
|
|
62
|
+
request.mediaHash=data.contentHash; // Transport-only lookup for the compiled player, never the review identity.
|
|
63
|
+
const fixed=config.eventTemplate.data.interactive;
|
|
64
|
+
request.eventTemplate=config.eventTemplate;
|
|
65
|
+
request.jobId=fixed.jobId;
|
|
66
|
+
request.groupId=`job/${fixed.jobId}/task/${fixed.taskId}`;
|
|
67
|
+
}else {request.contentHash=data.contentHash;request.revisionId=data.revisionId;request.groupId=options.file;}
|
|
68
|
+
return request;
|
|
69
|
+
}
|
|
70
|
+
export async function submitNeoReview(request,{fetchImpl=fetch,url=neoReviewEndpoint()}={}){
|
|
71
|
+
const destination=new URL(url);
|
|
72
|
+
if(destination.protocol!=='http:'||!['127.0.0.1','localhost'].includes(destination.hostname)||
|
|
73
|
+
destination.pathname!=='/mobile/review/notify'||destination.search||destination.hash)
|
|
74
|
+
throw Error('Refusing a nonlocal Neo Review notification destination');
|
|
75
|
+
const response=await fetchImpl(destination.href,{method:'POST',
|
|
76
|
+
headers:{'Content-Type':'application/json','Accept':'application/json'},
|
|
77
|
+
body:JSON.stringify(request),signal:AbortSignal.timeout(55000),redirect:'error'});
|
|
78
|
+
if(!response.ok)throw Error('Neo Review REST rejected delivery: HTTP '+response.status);
|
|
79
|
+
const receipt=await response.json();
|
|
80
|
+
if(receipt?.stored!==true||receipt.requestId!==request.id)
|
|
81
|
+
throw Error('Neo Review Core did not acknowledge durable Inbox storage');
|
|
82
|
+
return receipt;
|
|
83
|
+
}
|
|
84
|
+
|
|
29
85
|
export async function runMobilePreview(argv){
|
|
30
86
|
const opts=parseEventPreviewOptions(argv);
|
|
31
|
-
const config=opts.delivery==='event' ? normalizeReviewConfig({delivery:'event',
|
|
87
|
+
const config=opts.delivery==='event' ? normalizeReviewConfig({delivery:'event',commitSha:opts.commitSha,
|
|
32
88
|
eventTemplate:JSON.parse(readFileSync(resolve(opts.eventTemplatePath),'utf8'))}) : {delivery:'text'};
|
|
33
89
|
const [{startCompileOperation},{EXPORT_ROOT}]=await Promise.all([
|
|
34
90
|
import('./compile-operation.mjs'),import('./remote-assets.mjs'),
|
|
@@ -44,10 +100,12 @@ export async function runMobilePreview(argv){
|
|
|
44
100
|
await delay(300);
|
|
45
101
|
}
|
|
46
102
|
if(state?.state!=='ready')throw new Error('Preview compile timed out; operation '+operation.operationId);
|
|
47
|
-
|
|
48
|
-
|
|
103
|
+
const request=buildReviewRequest(opts,config,state,operation.operationId);
|
|
104
|
+
const receipt=await submitNeoReview(request);
|
|
105
|
+
return {status:'review_requested',operationId:operation.operationId,requestId:request.id,
|
|
106
|
+
...(opts.delivery==='event' ? {commitSha:opts.commitSha} : {contentHash:state.result.contentHash,revisionId:state.result.revisionId}),
|
|
49
107
|
...(config.delivery==='event' ? {jobId:config.eventTemplate.data.interactive.jobId} : {}),
|
|
50
|
-
delivery:config.delivery,notification:'
|
|
108
|
+
delivery:config.delivery,notification:receipt.accepted?'apns_submitted':'inbox_stored'};
|
|
51
109
|
}
|
|
52
110
|
|
|
53
111
|
if(process.argv[1] && import.meta.url===pathToFileURL(resolve(process.argv[1])).href){
|
package/src/mcp/preview.mjs
CHANGED
|
@@ -9,10 +9,11 @@ import { externalizePreviewMedia, publicOrigin, resolveMountedFile, resolvePrevi
|
|
|
9
9
|
import {fingerprintInputs} from "./source-fingerprint.mjs";
|
|
10
10
|
|
|
11
11
|
export const TOOL_NAME = "markcut.preview";
|
|
12
|
-
export const RESOURCE_URI = "ui://markcut/video-preview-
|
|
12
|
+
export const RESOURCE_URI = "ui://markcut/video-preview-v45.html";
|
|
13
13
|
const PREVIEW_VERSION = RESOURCE_URI.match(/video-preview-(v\d+)/)?.[1] ?? "unknown";
|
|
14
14
|
// Legacy entrypoints remain registered, but serve the current implementation.
|
|
15
15
|
export const LEGACY_RESOURCE_URIS = [
|
|
16
|
+
"ui://markcut/video-preview-v44.html",
|
|
16
17
|
"ui://markcut/video-preview-v3.html",
|
|
17
18
|
"ui://markcut/video-preview-v4.html",
|
|
18
19
|
"ui://markcut/video-preview-v5.html",
|
|
@@ -276,14 +277,12 @@ export function buildPreviewHtml() {
|
|
|
276
277
|
// from terminating the embedding script tag or leaking source into the DOM.
|
|
277
278
|
return `<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
|
|
278
279
|
<title>Markcut</title>
|
|
279
|
-
<style>body{font:14px system-ui;margin:0;background:#fff;color:#17202a}main{padding:12px;max-width:960px;margin:auto}h1{font-size:17px}.path{font-size:12px;overflow-wrap:anywhere}.transport{display:flex;align-items:center;gap:10px;padding:12px 0}.transport input{flex:1;min-width:50px}button{cursor:pointer;padding:8px;border-radius:6px;border:1px solid #a8a8a8}#approve{background:#198038;color:white}#changes{background:#c72b29;color:white}#comment-entry{display:flex;align-items:center;gap:6px;margin:5px 0}#feedback{flex:1;min-width:0;box-sizing:border-box;height:34px;padding:6px 9px;border:1px solid #b5bdc8;border-radius:6px}#comment-mode{max-width:102px;height:34px;border:1px solid #b5bdc8;border-radius:6px;background:white}#save-spot,#remove-spot{width:34px;height:34px;padding:0;font-size:19px}#comment-
|
|
280
|
+
<style>body{font:14px system-ui;margin:0;background:#fff;color:#17202a}main{padding:12px;max-width:960px;margin:auto}h1{font-size:17px}.path{font-size:12px;overflow-wrap:anywhere}.transport{display:flex;align-items:center;gap:10px;padding:12px 0}.transport input{flex:1;min-width:50px}button{cursor:pointer;padding:8px;border-radius:6px;border:1px solid #a8a8a8}#approve{background:#198038;color:white}#changes{background:#c72b29;color:white}#comment-entry{display:flex;align-items:center;gap:6px;margin:5px 0}#feedback{flex:1;min-width:0;box-sizing:border-box;height:34px;padding:6px 9px;border:1px solid #b5bdc8;border-radius:6px}#comment-mode{max-width:102px;height:34px;border:1px solid #b5bdc8;border-radius:6px;background:white}#save-spot,#remove-spot{width:34px;height:34px;padding:0;font-size:19px}#comment-entry button:disabled{opacity:.4;cursor:default}.review-actions{display:flex;justify-content:space-between;align-items:center;width:100%;gap:16px}.review-actions button{min-width:110px}#remotion-canvas{background:#090b12}#status{flex:1;min-width:0;font-size:12px;color:#526071;text-align:center;overflow-wrap:anywhere}#status:empty{display:none}#scene-thumbnails{display:flex;gap:7px;overflow-x:auto;padding:12px 2px;scrollbar-width:thin} .scene-pill{flex-shrink:0;padding:7px 11px;border:1px solid #d4dbe4;border-radius:9px;cursor:pointer;background:#f5f7fa;color:#475569;font-size:12px;white-space:nowrap} .scene-pill.active{background:#e7f0ff;color:#125ea2;border-color:#408bd7} .scene-pill.commented{border-color:#cc8b12;background:#fff4d6;color:#764900;font-weight:650} .scene-pill.commented::after{content:' •';color:#ad5b00} #comment-list{display:grid;gap:4px;margin:8px 0} #comment-list>div{display:flex;gap:8px} #comment-list button:first-child{flex:1;text-align:left;overflow:hidden;text-overflow:ellipsis} #comment-target{font-size:12px;color:#526071;margin:8px 0}</style></head>
|
|
280
281
|
<style>.comment-marker{position:absolute;top:50%;transform:translate(-50%,-50%);width:20px;height:20px;min-width:20px;padding:0;border:0;border-radius:50%;background:transparent;z-index:10;cursor:pointer;touch-action:none}.comment-marker::after{content:'';display:block;width:14px;height:14px;border-radius:50%;margin:auto;background:#f59e0b;border:2px solid white;box-sizing:border-box}.comment-marker.scope-scene::after{background:#3b82f6}.comment-marker.scope-overall{left:-28px!important}.comment-marker.scope-overall::after{background:#8b5cf6}.comment-marker.scope-overall.placeholder::after{background:transparent;border-color:#8b5cf6}.comment-marker.selected::after,.comment-marker:focus-visible::after{outline:2px solid #2563eb;outline-offset:2px}.comment-marker:hover::after{transform:scale(1.2)}</style>
|
|
281
282
|
<style>#comment-entry{position:relative;display:block}#feedback{display:block;width:100%;height:auto;min-height:76px;max-height:240px;field-sizing:content;resize:none;padding:9px 112px 32px 9px;font:inherit}#comment-tools{position:absolute;bottom:6px;right:8px;display:flex;align-items:center;gap:2px;background:white}#comment-tools>*{width:30px;height:28px;padding:0;border:0;background:transparent;color:#526071;font:inherit;text-align:center}#comment-tools button{font-size:20px}#comment-tools>*:focus-visible{outline:2px solid #408bd7;outline-offset:-2px}#comment-mode{width:70px;max-width:none;font-size:12px;font-weight:650;text-align:center;text-align-last:center;line-height:28px}#comment-mode:has(option[value=spot]:checked){color:#b45309}#comment-mode:has(option[value=scene]:checked){color:#2563eb}#overall-mode{width:70px;height:28px;line-height:28px;text-align:center;font-size:12px;font-weight:650;color:#7c3aed}</style>
|
|
282
|
-
<body><main><header style="display:flex;justify-content:space-between;align-items:center"><h1>Markcut · <span id="video-md-version">video</span></h1><div style="display:flex;align-items:center;gap:14px;margin-left:auto"><span id="header-tts"></span><span id="player-version" style="font-size:12px;color:#667">${PREVIEW_VERSION}</span></div></header><div class="path" id="path-label" hidden></div><div id="interactive-ui" hidden><div id="remotion-root"></div>
|
|
283
|
+
<body><main><header style="display:flex;justify-content:space-between;align-items:center"><h1>Markcut · <span id="video-md-version">video</span></h1><div style="display:flex;align-items:center;gap:14px;margin-left:auto"><span id="header-tts"></span><span id="review-delivery-mode" aria-label="Review delivery mode" style="font-size:12px;color:#526071;white-space:nowrap">Text mode</span><span id="player-version" style="font-size:12px;color:#667">${PREVIEW_VERSION}</span></div></header><div class="path" id="path-label" hidden></div><div id="interactive-ui" hidden><div id="remotion-root"></div>
|
|
283
284
|
<div id="comment-entry"><textarea id="feedback" rows="3" aria-label="Feedback" placeholder="Add a comment…"></textarea><div id="comment-tools"><select id="comment-mode" aria-label="Comment scope" title="Comment scope"><option value="spot" style="color:#b45309">Spot</option><option value="scene" style="color:#2563eb">Scene</option></select><span id="overall-mode" hidden>Overall</span><button id="save-spot" type="button" title="Add or update comment" aria-label="Add or update comment">+</button><button id="remove-spot" type="button" title="Remove selected comment" aria-label="Remove selected comment" disabled>−</button></div></div>
|
|
284
|
-
<div
|
|
285
|
-
<div id="status" role="status">Starting preview…</div>
|
|
286
|
-
<div class="review-actions"><button id="changes">Submit all feedback</button><button id="approve">Approve</button></div></div></main>
|
|
285
|
+
<div class="review-actions"><button id="changes">Submit feedback</button><span id="status" role="status">Starting preview…</span><button id="approve">Approve</button></div></div></main>
|
|
287
286
|
<script src="${playerScriptUrl}"></script>
|
|
288
287
|
<script>${buildPreviewBridgeScript().replaceAll("__MARKCUT_ORIGIN__",JSON.stringify(publicOrigin()))}</script></body></html>`;
|
|
289
288
|
}
|