@lalalic/markcut 3.2.55 → 3.2.56

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lalalic/markcut",
3
- "version": "3.2.55",
3
+ "version": "3.2.56",
4
4
  "description": "Markdown-to-video engine. Describe scenes in markdown, get a rendered video.",
5
5
  "bin": {
6
6
  "markcut": "bin/markcut"
@@ -15,6 +15,7 @@ Markcut turns a Markdown video definition into a compiled stream tree and a play
15
15
  | Make or revise a video | Load the project-selected template, author/edit its Markdown scenes, run `markcut verify <file>`, and **inspect real playback before claiming a finished video**. |
16
16
  | Quickly assess story structure | `markcut preview <file> --storyboard` (placeholder media, not a final-video quality check). |
17
17
  | Watch a native work-in-progress video | `markcut preview <file>`; test real visuals, sound, and seeking. |
18
+ | Watch a hosted preview without reviewing | Call `markcut.preview({path,readonly:true})`; no approval, comment submission, Git checkpoint, Relay change, or iPhone review request. |
18
19
  | Ask a person to review in ChatGPT | Call the available `markcut.preview({path})` tool; handle revision-specific feedback and approval. |
19
20
  | Ask for human review from Codex/terminal via iPhone | Use `markcut preview <video.md> --delivery event --event-template <relay-event.json>` on Neo Master. Neo Master stores the Preview and APNs notifies iPhone; the phone publishes the Event when the person submits. |
20
21
  | Deliver a finished MP4 | `markcut render <file> --output <path>`; inspect the resulting video and sound. |
@@ -56,7 +57,7 @@ Asset paths are relative to the Markdown document. A `prompt` without `src` asks
56
57
 
57
58
  1. **Structure gate:** `npx @lalalic/markcut verify video.md`, then `npx @lalalic/markcut preview video.md --storyboard` when rapid scene review is useful. Storyboard placeholders do not verify generated media or final audio.
58
59
  2. **Playback gate:** `npx @lalalic/markcut preview video.md`. Play and seek representative scenes; check black tails, media loading, narration, BGM, subtitles, route movement, and timing. For browser failures, load [Preview Troubleshooting](references/preview-troubleshooting.md) on demand.
59
- 3. **Human review gate:** Use Neo's `markcut.preview({path: "/absolute/path/video.md"})` when the user wants the hosted ChatGPT video player. This is **not** the CLI preview. The tool compiles/publishes a revision for playback; it does not rewrite the source. Comments with `decision: changes_requested` require editing that Markdown and calling `markcut.preview` again. `decision: approved` applies **only** to the identified revision/content hash; never apply an old approval to changed content. Follow [Review Contract](review.md) for actual video assessment.
60
+ 3. **Human review gate:** Use Neo's `markcut.preview({path: "/absolute/path/video.md"})` when the user wants to review the hosted ChatGPT video player. For playback only, use `readonly:true` instead; do not supply `review`. This is **not** the CLI preview. Managed requests correlate through `review.relay`, not a top-level `relay` field. The tool compiles/publishes a revision for playback; it does not rewrite the source. Comments with `decision: changes_requested` require editing that Markdown and calling `markcut.preview` again. `decision: approved` applies **only** to the identified revision/content hash; never apply an old approval to changed content. Follow [Review Contract](review.md) for actual video assessment.
60
61
  4. **Codex / terminal human-review gate:** `npx @lalalic/markcut preview /absolute/video.md --delivery event --event-template /absolute/relay-event.json` on Neo Master. The Event Template must match Relay's canonical `task.interactive_decision` Contract (`type`, `source`, `data.interactive.{jobId,taskId,executionId,invocationId}` only, without review-result fields). The CLI reuses the MCP compiler, publishes immutable preview assets, persists the review request on Neo Master and dispatches an APNs notification through the existing Neo Mobile provider. Exit receipt `review_requested` confirms only that **the iPhone inbox accepted the request**; human decisions arrive asynchronously on Events Bus. The phone need not be online. APNs delivery is best-effort; Neo Mobile synchronizes persisted requests on foreground. There is no automatic text fallback. Do not claim approval or Relay worker continuation from the receipt. For retries with an uncertain phone acknowledgment, pass a stable `--request-id UUID`. See [Codex/mobile review CLI](references/mobile-event-preview-cli.md).
61
62
  5. **Delivery gate:** `npx @lalalic/markcut render video.md --output out/video.mp4`. Confirm the MP4 exists and examine playback, including the final audio and subtitles. A valid Markdown file, compile success, or hosted-player resource alone is not proof of a finished video.
62
63
 
@@ -326,3 +326,23 @@ layout:parallel
326
326
  - **Media assets** — photo thumbnails (`waypoint.media`), images, bgm etc. should live in the md file's folder (e.g. `assets/...`). See the asset-path rules in `markdown-descriptive.md` §14 (verify enforces md-folder-relative paths).
327
327
  - **Don't set duration from script length** — the resolver computes it from TTS audio.
328
328
  - **3D (Map3D)** is experimental and opt-in (`cinematic.fallback:"none"`); the default `fallback:"2d"` gives the safe drone-chase look.
329
+
330
+ ## Google Maps four-view production gate (2026-11-11)
331
+
332
+ When working with native Google maps, prefer `view:overview|route|cinematic|streetview` directly in the authoritative `video.md`, rather than replacing them with schematic visuals. Use the source-linked Vlog GPS waypoints; never invent a track. A four-scene tested authoring reference lives in Vlog `templates/google-map-four-scenes.md`. The Google `streetview` node uses Maps JavaScript `StreetViewPanorama`, **not** the separately enabled Street View Static REST API.
333
+
334
+ **Fixed root cause:** Hosted Preview already stamped `GOOGLE_MAPS_API_KEY` during compilation, but `markcut render`'s Markdown pipeline previously called `compileDescriptiveRoot(final)` without options, leaving native maps unkeyed. The CLI now supplies `{googleMapsApiKey:process.env.GOOGLE_MAPS_API_KEY}` and refuses an unkeyed native map or fatal Google/Routes render error. The produced H.264 container alone is not proof that Google tiles, computed route or panorama are visible. Inspect real moving preview frames and confirm each view individually.
335
+
336
+ **Critical differences:** `route` is Google-computed navigational path between observed GPS positions, *not* proof of which road the creator traveled. `cinematic` defaults to 2D Google satellite pan/tilt/heading rather than actual drone/3D terrain. `streetview` needs a covered nearby panorama, otherwise the scene is invalid for that spot. For four-mode Vlog scenes, use `markcut verify /absolute/video.md` then the Neo-hosted `markcut.preview` UI. Its internal MP4 map cache is a playback optimization and must never replace the editable Markdown deliverable. Check Google Maps JavaScript API billing, restrictions, quotas and Routes API permissions before live rendering; preserve provider attribution and content-use terms for any public video.
337
+
338
+ ### 9:16 framing and human-paced route animation
339
+
340
+ For native Google `view:route`, the camera auto-fits the **full provider-returned road polyline** when available, with 19% padding for vertical mobile layouts; it falls back to fit filmed GPS stops while waiting for Google Routes. Do not set `zoom`/`center` on this mode unless you intentionally override the fit. Google road detours can extend outside the source stop bounds. Travel marker positions interpolate along polyline **distance**, not vertex indices, to avoid jerky movement. Route duration is **editorial screen time**; Google leg duration merely determines the proportions of time allocated to individual legs.
341
+
342
+ ```md
343
+ ## Map-Route
344
+ layout:parallel
345
+ - map view:route mapType:roadmap duration:8 routeAnimation:{startHold:0.5,endHold:0.7,easing:easeInOut} waypoints:[45.3,-75.9,"A";45.33,-75.87,"B"]
346
+ ```
347
+
348
+ This holds 0.5s at the start, animates the road route with gently eased start/finish, and holds 0.7s at the destination. If a map has children with `at:"Stop"` + timed duration (explicit intermediate dwell), the marker holds at the chosen stop and uses linear travel in the remaining time to keep manual stop times aligned. `fps:24` or `fps:30` produces smoother map footage than 12fps test renders. Cinematic remains a follow camera; consider `headingFollow:false` and a slow heading tween at sharp turns. Always keep original Google Maps branding, legal attribution and required map data notices visible; do not hide them in CSS, crop them out, or place captions over them.
@@ -163,6 +163,7 @@ export interface DescriptiveMap extends DescriptiveBaseNode {
163
163
  region?: string;
164
164
  travelMode?: "DRIVING" | "WALKING" | "BICYCLING" | "TRANSIT";
165
165
  routeMarker?: string;
166
+ routeAnimation?: {startHold?: number; endHold?: number; easing?: "linear" | "easeInOut"};
166
167
  camera?: {
167
168
  zoom?: DescriptiveTweenable;
168
169
  center?: { lat: DescriptiveTweenable; lng: DescriptiveTweenable };
@@ -658,6 +659,7 @@ function compileLeaf(node: Exclude<DescriptiveNode, DescriptiveContainer | Descr
658
659
  region: node.region,
659
660
  travelMode: node.travelMode ?? "DRIVING",
660
661
  routeMarker: node.routeMarker ?? "🚗",
662
+ routeAnimation: node.routeAnimation,
661
663
  camera: node.camera,
662
664
  cinematic: node.cinematic,
663
665
  streetView: node.streetView,
@@ -943,6 +945,7 @@ function compileMap(
943
945
  region: node.region,
944
946
  travelMode: node.travelMode ?? "DRIVING",
945
947
  routeMarker: node.routeMarker ?? "🚗",
948
+ routeAnimation: node.routeAnimation,
946
949
  camera: node.camera,
947
950
  cinematic: node.cinematic,
948
951
  streetView: node.streetView,
@@ -496,6 +496,11 @@ export function parseKeyValueTokens(
496
496
  // If the value looks like an inline JSON object/array, parse it as props
497
497
  if (strVal.startsWith("{") || strVal.startsWith("[")) {
498
498
  val = parseProps(strVal);
499
+ if (["camera", "cinematic", "streetView"].includes(key) &&
500
+ strVal.trim() !== "{}" && typeof val === "object" && val !== null &&
501
+ !Array.isArray(val) && Object.keys(val).length === 0) {
502
+ fail(`invalid structured ${key} value`, { ...ctx, token });
503
+ }
499
504
  } else {
500
505
  val = parseNumberMaybe(strVal);
501
506
  }
@@ -101,7 +101,7 @@ function preserveVariantAttrs(node: Record<string, unknown>, attrs: Record<strin
101
101
  "foreground", "visible", "isBackground", "instruction", "style", "effects", "on",
102
102
  "spots", "waypoints", "routeColor", "routeWeight", "routeMarker",
103
103
  "travelMode", "zoom", "center", "mapType", "data", "prompt",
104
- "view", "camera", "cinematic", "streetView",
104
+ "view", "camera", "cinematic", "streetView", "routeAnimation",
105
105
  "name", "title", "transition", "transitionTime", "layout",
106
106
  "componentName", "props", "speaker", "isNarration",
107
107
  ]);
@@ -342,6 +342,7 @@ function parseNodeLine(content: string, lineNum?: number): DescriptiveNode {
342
342
  start: attrs.start as any,
343
343
  view: attrs.view as any,
344
344
  routeMarker: attrs.routeMarker as any,
345
+ routeAnimation: attrs.routeAnimation as any,
345
346
  travelMode: attrs.travelMode as any,
346
347
  routeColor: attrs.routeColor as any,
347
348
  routeWeight: attrs.routeWeight as any,
@@ -1,17 +1,17 @@
1
1
  export function buildPreviewBridgeScript() {
2
2
  return `
3
3
  const feedback=document.getElementById('feedback'),status=document.getElementById('status'),pathLabel=document.getElementById('path-label');
4
- let nextId=0,identity=null,busy=false,expectedPath=null,activePath=null,activeRelay=null,activeReview={delivery:"text"},expectedDelivery="text",submittedRevision=null,submission=null;
4
+ let nextId=0,identity=null,busy=false,expectedPath=null,activePath=null,activeRelay=null,activeReview={delivery:"text"},expectedDelivery="text",expectedReadonly=false,submittedRevision=null,submission=null;
5
5
  const comments=[];
6
6
  let currentScene={sceneId:null,sceneName:null,sceneStart:0,timeSeconds:0},selectedId=0,nextCommentId=0;
7
7
  const mode=document.getElementById('comment-mode');
8
+ const isViewOnly=()=>expectedReadonly||activeReview?.readonly===true;
8
9
  const sceneKey=c=>String(c?.sceneName||c?.sceneId||'Overall');
9
10
  function updateDeliveryMode(){
10
11
  const el=document.getElementById('review-delivery-mode');
11
12
  if(!el)return;
12
- // Never claim a bound Event destination until the authoritative provider
13
- // result actually supplies the authenticated event template.
14
13
  const bound=activeReview?.delivery==='event'&&Boolean(activeReview.eventTemplate);
14
+ if(isViewOnly()){el.textContent='Read-only mode';el.title='Watch without submitting review';return;}
15
15
  el.textContent=bound?'Event mode':expectedDelivery==='event'?'Event mode · unavailable':'Text mode';
16
16
  el.title=bound?'Review decisions publish via the bound Events provider':
17
17
  expectedDelivery==='event'?'Waiting for authenticated event delivery configuration':
@@ -130,6 +130,7 @@ function applyToolInput(params){
130
130
  if(typeof input.path!=='string')return;
131
131
  expectedPath=input.path;
132
132
  expectedDelivery=input.review?.delivery==='event'?'event':'text';
133
+ expectedReadonly=input.readonly===true;
133
134
  updateDeliveryMode();
134
135
  // The selection has no authority to change delivery; only the compiled
135
136
  // operation result supplies the provider-bound review configuration.
@@ -233,8 +234,13 @@ async function currentRevisionMatches(path,hash){
233
234
  return latest.contentHash===hash && (!latest.requestId || !identity?.requestId || latest.requestId===identity.requestId);
234
235
  }
235
236
  function reviewReadonly(readonly,message){
236
- document.getElementById('approve').disabled=readonly;
237
- document.getElementById('changes').disabled=readonly;
237
+ const viewOnly=isViewOnly();
238
+ for(const id of ['approve','changes']){
239
+ const button=document.getElementById(id);
240
+ button.disabled=viewOnly||readonly;
241
+ button.style.display=viewOnly?'none':'';
242
+ }
243
+ document.getElementById('comment-entry').style.display=viewOnly?'none':'';
238
244
  if(readonly&&message)status.textContent=message;
239
245
  }
240
246
  async function renderRevision(data){
@@ -296,7 +302,7 @@ async function initialize(){
296
302
  catch(e){status.textContent=e.message||'MCP initialization failed';}
297
303
  }
298
304
  async function submit(decision){
299
- if(busy)return;
305
+ if(busy||isViewOnly())return;
300
306
  if(document.getElementById(decision==='approved'?'approve':'changes').disabled){
301
307
  status.textContent='Review disabled for this revision or delivery configuration.';return;
302
308
  }
@@ -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-v45.html";
12
+ export const RESOURCE_URI = "ui://markcut/video-preview-v46.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-v45.html",
16
17
  "ui://markcut/video-preview-v44.html",
17
18
  "ui://markcut/video-preview-v3.html",
18
19
  "ui://markcut/video-preview-v4.html",
@@ -121,6 +122,9 @@ export async function readPreviewAudio(path) {
121
122
  const markdown = await readFile(path, "utf8");
122
123
  const match = markdown.match(/^audio:\s*([^\r\n]+)\s*$/m);
123
124
  const filename = match ? match[1].trim() : `${basename(path, ".md")}.wav`;
125
+ // Hidden generated Markdown has no implicit sibling audio; explicit audio
126
+ // declarations still use the normal safe-local-filename validation.
127
+ if (!match && filename.startsWith(".")) return {};
124
128
  if (!/^[\w. -]+\.(wav|mp3|m4a|ogg)$/i.test(filename) || filename.startsWith(".")) throw new Error("audio must be a local audio filename in the Markdown directory");
125
129
  const file = resolve(dirname(path), filename);
126
130
  try { await access(file, fsConstants.R_OK); } catch (e) { if (!match && e.code === "ENOENT") return {}; throw e; }