@cueframe/kernel 0.2.4 → 0.2.5

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.
@@ -310,7 +310,7 @@ Call wait_job(kind="compose", id="${j.composeJobId}", projectId="${a.projectId}"
310
310
  name: "apply_composition",
311
311
  operationId: "applyComposition",
312
312
  pathArgs: { projectId: "id" },
313
- description: 'Atomically apply an array of CompositionOps to a project composition. All ops succeed or none do (transactional). Pass `if_match` for optimistic-concurrency control (409 stale_etag on mismatch) and `dry_run: true` to validate the batch without persisting. Use this to seed a composition (add media clips) or make targeted edits (set a crop intent, reorder clips, set the format). CAPTIONS: attach content with {type:"captions.fromTranscript", mediaId, window?} \u2014 the server slices the cached word-timed transcript, rebases times, and sentence-splits into segments (no pasting words; 422 media_no_transcript if the media has no speech); style it with {type:"setCaptionStyle", style}; or set explicit words with {type:"setCaptions", segments, style?} (e.g. translations or your own VO timings). Brand is NOT set here \u2014 it lives on the project (create_project / PATCH /projects/:id with brandKitId). CARDS: a {kind:"card", html, tokens} clip projects each `tokens` KEY `x` to the CSS custom property `--cf-x`, so the html must read it as `var(--cf-x)` \u2014 write `tokens:{"plate":"#0af"}` + `background:var(--cf-plate)`. Do NOT put dashes in the key: `"--plate"` becomes `--cf---plate` and your `var(--plate)` then resolves to NOTHING, which CSS silently degrades to a transparent background and black text. Responses carry `warnings[]` when a card reads a var nothing defines. SCENE SHOTS: for a 3D product shot \u2014 a tilted page screenshot, a lit laptop/phone showing a real screenshot, two-colour type, a colour-field backdrop, focus/grain/vignette and a camera move \u2014 use {type:"scene.add", clipId, newTrack|trackId, startTime, duration, scene, assets} and revise it with {type:"scene.update", clipId, scene?, assets?, startTime?, duration?}. You author a scene SPEC, never wrapper TSX; the server registers the component for you. There is NO built-in scene primitive in list_catalog \u2014 READ cueframe://scene-shot first for the JSON schema, a copyable two-shot example with its asset-binding map, the admitted image formats (PNG/JPEG/WebP), the reference-aspect rule, screen-vs-world text, the v1 limits and the global-effect scope gap.',
313
+ description: 'Atomically apply an array of CompositionOps to a project composition. All ops succeed or none do (transactional). Pass `if_match` for optimistic-concurrency control (409 stale_etag on mismatch) and `dry_run: true` to validate the batch without persisting. Use this to seed a composition (add media clips) or make targeted edits (set a crop intent, reorder clips, set the format). CAPTIONS: attach content with {type:"captions.fromTranscript", mediaId, window?} \u2014 the server slices the cached word-timed transcript, rebases times, and sentence-splits into segments (no pasting words; 422 media_no_transcript if the media has no speech); style it with {type:"setCaptionStyle", style}; or set explicit words with {type:"setCaptions", segments, style?} (e.g. translations or your own VO timings). Brand is NOT set here \u2014 it lives on the project (create_project / PATCH /projects/:id with brandKitId). CARDS: a {kind:"card", html, tokens} clip projects each `tokens` KEY `x` to the CSS custom property `--cf-x`, so the html must read it as `var(--cf-x)` \u2014 write `tokens:{"plate":"#0af"}` + `background:var(--cf-plate)`. Do NOT put dashes in the key: `"--plate"` becomes `--cf---plate` and your `var(--plate)` then resolves to NOTHING, which CSS silently degrades to a transparent background and black text. Responses carry `warnings[]` when a card reads a var nothing defines. SCENE SHOTS: for a 3D product shot \u2014 a tilted page screenshot, a lit laptop/phone showing a real screenshot, two-colour type, a colour-field backdrop, focus/grain/vignette and a camera move \u2014 use {type:"scene.add", clipId, newTrack|trackId, startTime, duration, scene, assets} and revise it with {type:"scene.update", clipId, scene?, assets?, startTime?, duration?}. You author a scene SPEC, never wrapper TSX; the server registers the component for you. There is NO built-in scene primitive in list_catalog \u2014 READ cueframe://scene-shot first for the JSON schema, the canonical V2 world-objects recipe with nested groups, slabs, pages, phones, laptops, world/screen text, admitted surfaces, camera motion, lighting, and the current resource limits.',
314
314
  okFormat: (j, a) => {
315
315
  const warns = formatWarnings(j);
316
316
  if (j && typeof j.valid === "boolean") {
@@ -271,16 +271,32 @@ function assertAssetBindingsMatch(request) {
271
271
  async function bakeComponentAlphaV2(options) {
272
272
  assertSceneShotCapabilitySupported(options.job?.source?.manifest, { componentId: options.job?.source?.componentId });
273
273
  const job = ComponentBakeJobV2.parse(options.job);
274
- assertSceneShotParamsAdmitted(job.source.manifest, job.params, { componentId: job.source.componentId });
274
+ const scene = assertSceneShotParamsAdmitted(job.source.manifest, job.params, { componentId: job.source.componentId });
275
+ if (scene && !options.prepareScene) throw new ComponentRuntimeError(
276
+ "component_scene_invalid",
277
+ "scene_prepared_plan_required: The scene bake host must supply canonical scene preparation before capture."
278
+ );
275
279
  const assetServer = await startComponentAssetServer({ assets: job.assets, files: job.assetFiles });
280
+ let sceneLease;
276
281
  try {
277
282
  const { assetFiles: _assetFiles, ...unsealedRequest } = job;
278
- const request = ComponentBakeRequestV2.parse({
283
+ let request = ComponentBakeRequestV2.parse({
279
284
  ...unsealedRequest,
280
285
  assets: assetServer.bindings
281
286
  });
282
287
  assertAssetBindingsMatch(request);
283
288
  const materialized = materializeComponentSource(options.workspaceRoot, request.source);
289
+ const allowedAssetOrigins = /* @__PURE__ */ new Set([assetServer.origin]);
290
+ if (scene) {
291
+ sceneLease = await options.prepareScene({
292
+ request,
293
+ materialized,
294
+ runtimeAssets: assetServer.runtimeAssets,
295
+ allowedAssetOrigins
296
+ });
297
+ request = ComponentBakeRequestV2.parse({ ...request, params: sceneLease.params });
298
+ assertSceneShotParamsAdmitted(request.source.manifest, request.params, { componentId: request.source.componentId });
299
+ }
284
300
  const bundleId = componentBundleId({
285
301
  sourceVersionId: materialized.sourceVersionId,
286
302
  runtimeDigest: request.runtimeDigest,
@@ -307,7 +323,7 @@ async function bakeComponentAlphaV2(options) {
307
323
  id: request.source.componentId,
308
324
  params: request.params,
309
325
  assets: assetServer.runtimeAssets,
310
- allowedAssetOrigins: /* @__PURE__ */ new Set([assetServer.origin]),
326
+ allowedAssetOrigins,
311
327
  seed: request.seed,
312
328
  graphics: request.source.manifest.graphics,
313
329
  codec: request.codec,
@@ -360,7 +376,11 @@ async function bakeComponentAlphaV2(options) {
360
376
  assertRendererReceiptMatches(renderRequest, receipt);
361
377
  return receipt;
362
378
  } finally {
363
- await assetServer.close();
379
+ try {
380
+ await sceneLease?.cleanup();
381
+ } finally {
382
+ await assetServer.close();
383
+ }
364
384
  }
365
385
  }
366
386
  function sourceIdentityForBake(request) {
@@ -7,7 +7,7 @@ import {
7
7
  sourceIdentityForBake,
8
8
  startComponentAssetServer,
9
9
  verifyComponentOutput
10
- } from "./chunk-UY77TMKD.js";
10
+ } from "./chunk-VCSSJLOU.js";
11
11
  import {
12
12
  COMPONENT_MEDIA_HEADROOM,
13
13
  COMPONENT_MEDIA_TIERS,
@@ -16,7 +16,7 @@ import {
16
16
  } from "../chunk-6BVVCRRD.js";
17
17
  import {
18
18
  CURATED_TOOLS
19
- } from "../chunk-UN6NY2E6.js";
19
+ } from "../chunk-SC55VDLC.js";
20
20
  import "../chunk-2ESYSVXG.js";
21
21
 
22
22
  // ../mcp/src/adapter.ts
@@ -10,7 +10,7 @@ import {
10
10
  formatResourceCandidates,
11
11
  formatTranscriptPage,
12
12
  formatWarnings
13
- } from "../chunk-UN6NY2E6.js";
13
+ } from "../chunk-SC55VDLC.js";
14
14
  import "../chunk-2ESYSVXG.js";
15
15
  export {
16
16
  CRUD_COVERAGE,
@@ -7,10 +7,10 @@ import {
7
7
  registerRawTools,
8
8
  registerSkillPrompts,
9
9
  titleCase
10
- } from "../chunk-EBIBLL7E.js";
10
+ } from "../chunk-KQDZAHLP.js";
11
11
  import "../chunk-E7GIZEPS.js";
12
12
  import "../chunk-6BVVCRRD.js";
13
- import "../chunk-UN6NY2E6.js";
13
+ import "../chunk-SC55VDLC.js";
14
14
  import "../chunk-2ESYSVXG.js";
15
15
  export {
16
16
  RAW_EXCLUDED_OPERATION_IDS,
package/dist/mcp.js CHANGED
@@ -7,10 +7,10 @@ import {
7
7
  buildServer,
8
8
  registerCuratedTools,
9
9
  registerRawTools
10
- } from "./chunk-EBIBLL7E.js";
10
+ } from "./chunk-KQDZAHLP.js";
11
11
  import "./chunk-E7GIZEPS.js";
12
12
  import "./chunk-6BVVCRRD.js";
13
- import "./chunk-UN6NY2E6.js";
13
+ import "./chunk-SC55VDLC.js";
14
14
  import "./chunk-2ESYSVXG.js";
15
15
  export {
16
16
  API_URLS,
@@ -8,7 +8,7 @@ import {
8
8
  import {
9
9
  assertCardHtmlAssetFree
10
10
  } from "./chunk-ODUWCQI3.js";
11
- import "./chunk-UY77TMKD.js";
11
+ import "./chunk-VCSSJLOU.js";
12
12
  import "./chunk-BVA3537Z.js";
13
13
  import {
14
14
  COMPONENT_STILL_RUNTIME_IDENTITY,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cueframe/kernel",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "type": "module",
5
5
  "description": "Publish-only aggregate of CueFrame's isomorphic kernel packages — composition, primitives, authoring, MCP, and friends shipped as one npm artifact. Members remain separate workspace packages; this only changes what ships.",
6
6
  "files": [
@@ -19,24 +19,24 @@
19
19
  "typescript": "^5.9.3",
20
20
  "@cueframe/account-model": "0.1.0",
21
21
  "@cueframe/animate": "0.1.0",
22
+ "@cueframe/composition": "0.1.0",
22
23
  "@cueframe/cloud-import": "0.1.0",
24
+ "@cueframe/compose": "0.1.0",
23
25
  "@cueframe/authoring": "0.1.0",
24
26
  "@cueframe/brand-derivation": "0.1.0",
25
- "@cueframe/compose": "0.1.0",
26
- "@cueframe/composition-ops": "0.1.0",
27
- "@cueframe/composition": "0.1.0",
28
27
  "@cueframe/component-runtime": "0.1.0",
29
28
  "@cueframe/core": "0.1.0",
30
- "@cueframe/director": "0.1.0",
29
+ "@cueframe/composition-ops": "0.1.0",
31
30
  "@cueframe/errors": "0.1.0",
32
31
  "@cueframe/foundation": "0.1.0",
32
+ "@cueframe/director": "0.1.0",
33
33
  "@cueframe/mcp": "0.1.0",
34
- "@cueframe/media-model": "0.1.0",
35
34
  "@cueframe/nle-export": "0.1.0",
36
- "@cueframe/primitives": "0.1.0",
37
- "@cueframe/render-harness": "0.1.0",
35
+ "@cueframe/perception": "0.1.0",
36
+ "@cueframe/media-model": "0.1.0",
38
37
  "@cueframe/plane": "0.1.0",
39
- "@cueframe/perception": "0.1.0"
38
+ "@cueframe/render-harness": "0.1.0",
39
+ "@cueframe/primitives": "0.1.0"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "gsap": "3.13.0",