@hraness/slopcamera 3.2.7 → 3.3.1

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 (188) hide show
  1. package/NOTICE.md +1 -7
  2. package/PRIVACY.md +16 -7
  3. package/README.md +65 -20
  4. package/apps/desktop/README.md +14 -130
  5. package/apps/desktop/application/context.ts +6 -9
  6. package/apps/desktop/application/default-registry.ts +26 -10
  7. package/apps/desktop/application/operation.ts +14 -5
  8. package/apps/desktop/application/operations/index.ts +4 -1
  9. package/apps/desktop/application/operations/spatial-behavior.ts +151 -0
  10. package/apps/desktop/application/operations/spatial-direction.ts +222 -0
  11. package/apps/desktop/application/operations/spatial-rendered-audit.ts +174 -0
  12. package/apps/desktop/application/operations/spatial-review.ts +194 -0
  13. package/apps/desktop/application/operations/spatial-scene.ts +25 -1
  14. package/apps/desktop/application/registry.ts +2 -2
  15. package/apps/desktop/application/spatial-asset-admission.ts +201 -0
  16. package/apps/desktop/application/spatial-assets.ts +160 -31
  17. package/apps/desktop/application/spatial-render.ts +217 -20
  18. package/apps/desktop/application/spatial-rendered-audit.ts +273 -0
  19. package/apps/desktop/application/spatial-review.ts +361 -0
  20. package/apps/desktop/application/spatial-spz.ts +48 -3
  21. package/apps/desktop/application/spatial-world-import.ts +26 -5
  22. package/apps/desktop/application/spatial-world-metadata.ts +105 -0
  23. package/apps/desktop/cli/args.ts +528 -97
  24. package/apps/desktop/cli/capability-manifest.ts +374 -0
  25. package/apps/desktop/cli/cinema-renderer.ts +608 -0
  26. package/apps/desktop/cli/command-host-resources.ts +31 -2
  27. package/apps/desktop/cli/commands.ts +1215 -70
  28. package/apps/desktop/cli/gateway-review-provider.ts +334 -0
  29. package/apps/desktop/cli/help.ts +183 -23
  30. package/apps/desktop/cli/html-scene.ts +139 -28
  31. package/apps/desktop/cli/io.ts +2 -1
  32. package/apps/desktop/cli/main.ts +26 -50
  33. package/apps/desktop/cli/menubar.ts +244 -0
  34. package/apps/desktop/cli/music-analysis-service.ts +61 -0
  35. package/apps/desktop/cli/portable-surface.ts +18 -5
  36. package/apps/desktop/cli/spatial-asset-service.ts +124 -0
  37. package/apps/desktop/cli/spatial-design-service.ts +237 -0
  38. package/apps/desktop/cli/spatial-generate-service.ts +370 -0
  39. package/apps/desktop/cli/spatial-scene-service.ts +268 -4
  40. package/apps/desktop/cli/workflow-code.ts +1 -1
  41. package/apps/desktop/code/application-node-planner.ts +0 -47
  42. package/apps/desktop/code/host-source-layout.ts +46 -0
  43. package/apps/desktop/code/public.ts +0 -1
  44. package/apps/desktop/code/runtime-identity.ts +50 -8
  45. package/apps/desktop/code/semantic-builder.ts +24 -43
  46. package/apps/desktop/code/source-bundle.ts +23 -6
  47. package/apps/desktop/code/source-typecheck.ts +131 -43
  48. package/apps/desktop/code/worker-client.ts +14 -2
  49. package/apps/desktop/contracts/cinema.ts +736 -0
  50. package/apps/desktop/contracts/index.ts +1 -0
  51. package/apps/desktop/contracts/spatial-asset.ts +16 -0
  52. package/apps/desktop/contracts/spatial-world.ts +26 -3
  53. package/apps/desktop/core/cinema-plan.ts +1320 -0
  54. package/apps/desktop/core/index.ts +1 -0
  55. package/apps/desktop/core/music-analysis.ts +124 -1
  56. package/apps/desktop/core/storage.ts +75 -0
  57. package/apps/desktop/dist/cli/main.js +737 -291
  58. package/apps/desktop/html-overlay/audio-reactivity.ts +127 -0
  59. package/apps/desktop/html-overlay/index.ts +9 -0
  60. package/apps/desktop/html-overlay/runtime.ts +2 -0
  61. package/apps/desktop/html-overlay/scene.ts +29 -0
  62. package/apps/desktop/html-overlay/spatial.ts +619 -57
  63. package/apps/desktop/workflows/cinematic-world.ts +127 -0
  64. package/apps/desktop/workflows/index.ts +6 -0
  65. package/dist/cli.js +32 -434
  66. package/dist/code/advanced.js +1 -269
  67. package/dist/code/index.js +16 -2239
  68. package/dist/generate.js +1 -23
  69. package/dist/host-resources.js +1 -25
  70. package/dist/index-0bbesn4m.js +35 -0
  71. package/dist/index-296qhpf2.js +3 -0
  72. package/dist/index-3cxf2c58.js +3 -0
  73. package/dist/index-77fjfg9f.js +3 -0
  74. package/dist/index-80a36bc0.js +3 -0
  75. package/dist/index-a3vvs3rf.js +3 -0
  76. package/dist/index-b3geqczn.js +5 -0
  77. package/dist/index-cgpkyjqa.js +3 -0
  78. package/dist/index-f0ptv8dm.js +7 -0
  79. package/dist/index-grk47tgs.js +3 -0
  80. package/dist/index-qry58nj2.js +10 -0
  81. package/dist/index.js +1 -240
  82. package/dist/operations.js +1 -28
  83. package/dist/skill-install-gx7afxsd.js +2 -0
  84. package/dist/vectorize/worker.js +1 -141
  85. package/dist/workflow.js +1 -15
  86. package/docs/README.md +5 -1
  87. package/docs/studio.md +1 -1
  88. package/package.json +11 -24
  89. package/skills/slopcamera/SKILL.md +14 -1
  90. package/skills/slopcamera/references/diagrams.md +5 -14
  91. package/skills/slopcamera/references/directed-scenes.md +22 -2
  92. package/skills/slopcamera/references/gateway-media.md +15 -1
  93. package/skills/slopcamera/references/image-galleries.md +166 -0
  94. package/skills/slopcamera/references/install.md +2 -2
  95. package/skills/slopcamera/references/music-video.md +23 -3
  96. package/skills/slopcamera/references/parametric-design.md +14 -0
  97. package/skills/slopcamera/references/reference-led-3d.md +1 -1
  98. package/skills/slopcamera/references/scene-building.md +32 -0
  99. package/skills/slopcamera/references/social-collage-banners.md +204 -0
  100. package/skills/slopcamera/references/support.md +25 -0
  101. package/skills/slopcamera/references/web-media-excerpts.md +120 -0
  102. package/skills/slopcamera/references/workflows-sdk.md +3 -3
  103. package/skills/slopcamera/scripts/compose-social-collage-banner.ts +728 -0
  104. package/src/capability-manifest.ts +361 -0
  105. package/src/cli.ts +250 -102
  106. package/src/code/canonical-json.ts +9 -0
  107. package/src/generate.ts +2 -2
  108. package/src/icon.ts +1111 -0
  109. package/src/image-gallery.ts +1049 -0
  110. package/src/index.ts +11 -23
  111. package/src/mcp/boundary.ts +11 -11
  112. package/src/mcp/index.ts +3 -0
  113. package/src/mcp/server.ts +2 -1
  114. package/src/mcp/tools.ts +1642 -130
  115. package/src/mcp/types.ts +19 -0
  116. package/src/operations.ts +412 -0
  117. package/src/portable-capability-manifest.ts +67 -0
  118. package/src/scene-gallery.ts +184 -0
  119. package/src/spatial-scene/asset-admission.ts +183 -0
  120. package/src/spatial-scene/audit-rendered.ts +692 -0
  121. package/src/spatial-scene/audit.ts +617 -0
  122. package/src/spatial-scene/behavior-audit.ts +252 -0
  123. package/src/spatial-scene/behavior-bake.ts +233 -0
  124. package/src/spatial-scene/behavior-fns.ts +585 -0
  125. package/src/spatial-scene/behavior-gallery.ts +109 -0
  126. package/src/spatial-scene/behavior-stdlib.ts +323 -0
  127. package/src/spatial-scene/behavior-trace.ts +325 -0
  128. package/src/spatial-scene/behavior.ts +618 -0
  129. package/src/spatial-scene/build.ts +632 -0
  130. package/src/spatial-scene/camera-rig.ts +125 -0
  131. package/src/spatial-scene/camera-track.ts +4 -2
  132. package/src/spatial-scene/character.ts +124 -0
  133. package/src/spatial-scene/contracts.ts +75 -7
  134. package/src/spatial-scene/design-templates.ts +351 -0
  135. package/src/spatial-scene/design.ts +327 -0
  136. package/src/spatial-scene/direction-compile.ts +584 -0
  137. package/src/spatial-scene/direction.ts +122 -0
  138. package/src/spatial-scene/effects.ts +149 -0
  139. package/src/spatial-scene/evaluate.ts +109 -29
  140. package/src/spatial-scene/gallery.ts +277 -0
  141. package/src/spatial-scene/generate.ts +239 -0
  142. package/src/spatial-scene/geometry-native.ts +165 -0
  143. package/src/spatial-scene/geometry.ts +1216 -0
  144. package/src/spatial-scene/gltf.ts +600 -77
  145. package/src/spatial-scene/identity.ts +55 -2
  146. package/src/spatial-scene/index.ts +36 -0
  147. package/src/spatial-scene/inspect.ts +35 -6
  148. package/src/spatial-scene/material-lighting.ts +609 -0
  149. package/src/spatial-scene/math.ts +21 -4
  150. package/src/spatial-scene/motion-evidence.ts +88 -0
  151. package/src/spatial-scene/parametric.ts +765 -0
  152. package/src/spatial-scene/particle-preparation.ts +183 -0
  153. package/src/spatial-scene/particle.ts +195 -0
  154. package/src/spatial-scene/patch.ts +109 -15
  155. package/src/spatial-scene/performance.ts +1613 -0
  156. package/src/spatial-scene/probe.ts +137 -0
  157. package/src/spatial-scene/recipe-pack.ts +86 -0
  158. package/src/spatial-scene/render-effects.ts +240 -0
  159. package/src/spatial-scene/review.ts +639 -0
  160. package/src/spatial-scene/simulation-bake.ts +206 -0
  161. package/src/spatial-scene/simulation.ts +187 -0
  162. package/src/spatial-scene/solve.ts +366 -0
  163. package/src/spatial-scene/temporal-audit.ts +354 -0
  164. package/src/support-completion.ts +16 -0
  165. package/src/support.ts +42 -0
  166. package/src/version.ts +1 -1
  167. package/apps/desktop/application/operations/recording/index.ts +0 -5
  168. package/apps/desktop/application/operations/recording/pause.ts +0 -34
  169. package/apps/desktop/application/operations/recording/resume.ts +0 -34
  170. package/apps/desktop/application/operations/recording/shared.ts +0 -199
  171. package/apps/desktop/application/operations/recording/start.ts +0 -169
  172. package/apps/desktop/application/operations/recording/stop.ts +0 -34
  173. package/apps/desktop/capture/protocol.ts +0 -689
  174. package/apps/desktop/cli/capture-bundle.ts +0 -1117
  175. package/apps/desktop/cli/recording-controller.ts +0 -1567
  176. package/apps/desktop/cli/recording-daemon.ts +0 -931
  177. package/dist/index-42zsesc1.js +0 -2257
  178. package/dist/index-7308egqr.js +0 -48
  179. package/dist/index-8txs6fkn.js +0 -712
  180. package/dist/index-mcy8z0br.js +0 -192
  181. package/dist/index-p63wavx0.js +0 -2029
  182. package/dist/index-r7gdhmsp.js +0 -424
  183. package/dist/index-rvghzt7b.js +0 -2013
  184. package/dist/index-sh6xbav6.js +0 -1219
  185. package/dist/index-z1w83f81.js +0 -4
  186. package/dist/index-z7239b4h.js +0 -2363
  187. package/dist/skill-install-dh0ntqba.js +0 -10
  188. package/src/desktop.ts +0 -253
@@ -0,0 +1,151 @@
1
+ import { z } from "zod";
2
+ import { createBoundedJsonValueSnapshot } from "../../../../src/code/json-snapshot";
3
+ import {
4
+ SpatialDigestSchema,
5
+ SpatialSceneV1Schema,
6
+ SpatialTimeUsSchema,
7
+ } from "../../../../src/spatial-scene/contracts";
8
+ import {
9
+ checkSpatialBehavior,
10
+ SpatialBehaviorCheckReportSchema,
11
+ SpatialBehaviorSchema,
12
+ } from "../../../../src/spatial-scene/behavior";
13
+ import {
14
+ auditSpatialBehaviorTrace,
15
+ SpatialBehaviorAuditOptionsSchema,
16
+ SpatialBehaviorAuditReportSchema,
17
+ } from "../../../../src/spatial-scene/behavior-audit";
18
+ import { bakeSpatialBehavior } from "../../../../src/spatial-scene/behavior-bake";
19
+ import { spatialBehaviorFnSignatures } from "../../../../src/spatial-scene/behavior-fns";
20
+ import {
21
+ planSpatialBehaviorGallery,
22
+ SpatialBehaviorGalleryPlanSchema,
23
+ } from "../../../../src/spatial-scene/behavior-gallery";
24
+ import {
25
+ SpatialBehaviorBakeSchema,
26
+ SpatialBehaviorChannelMapSchema,
27
+ SpatialBehaviorEmittedSchema,
28
+ } from "../../../../src/spatial-scene/behavior-trace";
29
+ import type { OperationDefinition, OperationPolicy } from "../operation";
30
+ import { throwIfAborted } from "./shared";
31
+
32
+ const capture = (value: unknown) => createBoundedJsonValueSnapshot(
33
+ value,
34
+ 8 * 1024 * 1024,
35
+ "behavior operation",
36
+ { maximumDepth: 36, maximumValues: 400_000 },
37
+ ).value;
38
+
39
+ export const SpatialBehaviorCheckInputSchema = z.preprocess(capture, z.strictObject({
40
+ behavior: SpatialBehaviorSchema,
41
+ scene: SpatialSceneV1Schema,
42
+ }));
43
+ export const SpatialBehaviorBakeInputSchema = z.preprocess(capture, z.strictObject({
44
+ behavior: SpatialBehaviorSchema,
45
+ channelMap: SpatialBehaviorChannelMapSchema.optional(),
46
+ scene: SpatialSceneV1Schema,
47
+ }));
48
+ export const SpatialBehaviorGalleryInputSchema = z.preprocess(capture, z.strictObject({
49
+ behavior: SpatialBehaviorSchema,
50
+ channelMap: SpatialBehaviorChannelMapSchema.optional(),
51
+ scene: SpatialSceneV1Schema,
52
+ }));
53
+
54
+ export const SpatialBehaviorAuditInputSchema = z.preprocess(capture, z.strictObject({
55
+ emitted: z.array(SpatialBehaviorEmittedSchema).max(16_384),
56
+ behaviorSha256: SpatialDigestSchema,
57
+ emittedSha256: SpatialDigestSchema,
58
+ rangeUs: z.strictObject({ startUs: SpatialTimeUsSchema, endUs: SpatialTimeUsSchema }),
59
+ options: SpatialBehaviorAuditOptionsSchema.optional(),
60
+ }));
61
+
62
+ export type SpatialBehaviorCheckInput = z.infer<typeof SpatialBehaviorCheckInputSchema>;
63
+ export type SpatialBehaviorBakeInput = z.infer<typeof SpatialBehaviorBakeInputSchema>;
64
+ export type SpatialBehaviorGalleryInput = z.infer<typeof SpatialBehaviorGalleryInputSchema>;
65
+ export type SpatialBehaviorAuditInput = z.infer<typeof SpatialBehaviorAuditInputSchema>;
66
+ export type SpatialBehaviorCheckOutput = z.infer<typeof SpatialBehaviorCheckReportSchema>;
67
+ export type SpatialBehaviorBakeOutput = z.infer<typeof SpatialBehaviorBakeSchema>;
68
+ export type SpatialBehaviorGalleryOutput = z.infer<typeof SpatialBehaviorGalleryPlanSchema>;
69
+ export type SpatialBehaviorAuditOutput = z.infer<typeof SpatialBehaviorAuditReportSchema>;
70
+
71
+ const purePolicy = Object.freeze({
72
+ cache: "content-addressed", cancellable: true, effect: "pure", maxDurationMs: 10_000,
73
+ maxFanOut: 0, maxInputBytes: 8 * 1024 * 1024, maxOutputBytes: 16 * 1024 * 1024,
74
+ preparation: [], resources: [{ amount: 1, resource: "cpu" }], resume: "deterministic",
75
+ } as const) satisfies OperationPolicy;
76
+
77
+ export const spatialBehaviorCheckOperationDefinition = {
78
+ kind: "scene.behavior.check", version: 1,
79
+ inputSchema: SpatialBehaviorCheckInputSchema,
80
+ inputSchemaId: "slopcamera.operation.scene.behavior.check.input/v1",
81
+ outputSchema: SpatialBehaviorCheckReportSchema,
82
+ outputSchemaId: "slopcamera.operation.scene.behavior.check.output/v1",
83
+ policy: purePolicy,
84
+ lifecycle: { kind: "pure", execute: (context, input) => {
85
+ throwIfAborted(context.abortSignal);
86
+ return Promise.resolve(SpatialBehaviorCheckReportSchema.parse(
87
+ checkSpatialBehavior({ behavior: input.behavior, scene: input.scene }, spatialBehaviorFnSignatures()),
88
+ ));
89
+ } },
90
+ summarize: output => ({ kind: "scene.behavior.check", fields: {
91
+ behaviorSha256: output.behaviorSha256, errors: output.counts.errors, warnings: output.counts.warnings,
92
+ } }),
93
+ } satisfies OperationDefinition<"scene.behavior.check", SpatialBehaviorCheckInput, SpatialBehaviorCheckOutput>;
94
+
95
+ export const spatialBehaviorBakeOperationDefinition = {
96
+ kind: "scene.behavior.bake", version: 1,
97
+ inputSchema: SpatialBehaviorBakeInputSchema,
98
+ inputSchemaId: "slopcamera.operation.scene.behavior.bake.input/v1",
99
+ outputSchema: SpatialBehaviorBakeSchema,
100
+ outputSchemaId: "slopcamera.operation.scene.behavior.bake.output/v1",
101
+ policy: purePolicy,
102
+ lifecycle: { kind: "pure", execute: async (context, input) => {
103
+ throwIfAborted(context.abortSignal);
104
+ const { bake } = await bakeSpatialBehavior({
105
+ behavior: input.behavior, scene: input.scene,
106
+ ...(input.channelMap === undefined ? {} : { channelMap: input.channelMap }),
107
+ });
108
+ return SpatialBehaviorBakeSchema.parse(bake);
109
+ } },
110
+ summarize: output => ({ kind: "scene.behavior.bake", fields: {
111
+ behaviorSha256: output.behaviorSha256, emitted: output.emitted.length,
112
+ directives: output.directives.length, unresolved: output.unresolvedIntents.length,
113
+ runDigest: output.receipt.runDigest,
114
+ } }),
115
+ } satisfies OperationDefinition<"scene.behavior.bake", SpatialBehaviorBakeInput, SpatialBehaviorBakeOutput>;
116
+
117
+ export const spatialBehaviorGalleryOperationDefinition = {
118
+ kind: "scene.behavior.gallery", version: 1,
119
+ inputSchema: SpatialBehaviorGalleryInputSchema,
120
+ inputSchemaId: "slopcamera.operation.scene.behavior.gallery.input/v1",
121
+ outputSchema: SpatialBehaviorGalleryPlanSchema,
122
+ outputSchemaId: "slopcamera.operation.scene.behavior.gallery.output/v1",
123
+ policy: purePolicy,
124
+ lifecycle: { kind: "pure", execute: async (context, input) => {
125
+ throwIfAborted(context.abortSignal);
126
+ return SpatialBehaviorGalleryPlanSchema.parse(await planSpatialBehaviorGallery({
127
+ behavior: input.behavior, scene: input.scene,
128
+ ...(input.channelMap === undefined ? {} : { channelMap: input.channelMap }),
129
+ }));
130
+ } },
131
+ summarize: output => ({ kind: "scene.behavior.gallery", fields: {
132
+ behaviorSha256: output.behaviorSha256, candidates: output.candidates.length,
133
+ } }),
134
+ } satisfies OperationDefinition<"scene.behavior.gallery", SpatialBehaviorGalleryInput, SpatialBehaviorGalleryOutput>;
135
+
136
+ export const spatialBehaviorAuditOperationDefinition = {
137
+ kind: "scene.behavior.audit", version: 1,
138
+ inputSchema: SpatialBehaviorAuditInputSchema,
139
+ inputSchemaId: "slopcamera.operation.scene.behavior.audit.input/v1",
140
+ outputSchema: SpatialBehaviorAuditReportSchema,
141
+ outputSchemaId: "slopcamera.operation.scene.behavior.audit.output/v1",
142
+ policy: purePolicy,
143
+ lifecycle: { kind: "pure", execute: (context, input) => {
144
+ throwIfAborted(context.abortSignal);
145
+ return Promise.resolve(SpatialBehaviorAuditReportSchema.parse(auditSpatialBehaviorTrace(input)));
146
+ } },
147
+ summarize: output => ({ kind: "scene.behavior.audit", fields: {
148
+ behaviorSha256: output.behaviorSha256, findings: output.findings.length,
149
+ channels: output.channelCount, emitted: output.emittedCount,
150
+ } }),
151
+ } satisfies OperationDefinition<"scene.behavior.audit", SpatialBehaviorAuditInput, SpatialBehaviorAuditOutput>;
@@ -0,0 +1,222 @@
1
+ import { z } from "zod";
2
+ import { createBoundedJsonValueSnapshot } from "../../../../src/code/json-snapshot";
3
+ import {
4
+ SpatialCameraIdSchema,
5
+ SpatialSceneV1Schema,
6
+ SpatialTimeUsSchema,
7
+ } from "../../../../src/spatial-scene/contracts";
8
+ import { SpatialDirectionSchema } from "../../../../src/spatial-scene/direction";
9
+ import {
10
+ checkSpatialDirection,
11
+ compileSpatialDirection,
12
+ SpatialDirectionCheckReportSchema,
13
+ SpatialDirectionCompilationSchema,
14
+ } from "../../../../src/spatial-scene/direction-compile";
15
+ import {
16
+ createSpatialEvaluationContext,
17
+ evaluateSpatialSceneInContext,
18
+ } from "../../../../src/spatial-scene/evaluate";
19
+ import {
20
+ planSpatialDirectionGallery,
21
+ SpatialGalleryAxisSchema,
22
+ SpatialGalleryPlanSchema,
23
+ } from "../../../../src/spatial-scene/gallery";
24
+ import { SpatialParticleSystemSchema } from "../../../../src/spatial-scene/particle";
25
+ import { SpatialRenderPlanSchema } from "../../../../src/spatial-scene/effects";
26
+ import {
27
+ checkSpatialRenderEffects,
28
+ planSpatialRenderEffects,
29
+ SPATIAL_RENDER_EFFECTS_LIMITS,
30
+ SpatialEffectsCheckReportSchema,
31
+ SpatialRenderEffectsBindingSchema,
32
+ SpatialRenderEffectsDocumentSchema,
33
+ } from "../../../../src/spatial-scene/render-effects";
34
+ import { SpatialSimulationBakeReceiptSchema } from "../../../../src/spatial-scene/simulation";
35
+ import {
36
+ auditSpatialTemporalEvidence,
37
+ SpatialTemporalAuditOptionsSchema,
38
+ SpatialTemporalAuditReportSchema,
39
+ } from "../../../../src/spatial-scene/temporal-audit";
40
+ import type { OperationDefinition, OperationPolicy } from "../operation";
41
+ import { throwIfAborted } from "./shared";
42
+
43
+ const capture = (value: unknown) => createBoundedJsonValueSnapshot(
44
+ value,
45
+ 8 * 1024 * 1024,
46
+ "scene planning operation",
47
+ { maximumDepth: 36, maximumValues: 400_000 },
48
+ ).value;
49
+
50
+ export const SpatialDirectionCheckInputSchema = z.preprocess(capture, z.strictObject({
51
+ direction: SpatialDirectionSchema,
52
+ scene: SpatialSceneV1Schema,
53
+ }));
54
+ export const SpatialDirectionCompileInputSchema = z.preprocess(capture, z.strictObject({
55
+ cameraId: SpatialCameraIdSchema.optional(),
56
+ direction: SpatialDirectionSchema,
57
+ scene: SpatialSceneV1Schema,
58
+ }));
59
+ export const SpatialDirectionGalleryInputSchema = z.preprocess(capture, z.strictObject({
60
+ axis: SpatialGalleryAxisSchema,
61
+ cameraId: SpatialCameraIdSchema.optional(),
62
+ direction: SpatialDirectionSchema,
63
+ scene: SpatialSceneV1Schema,
64
+ }));
65
+ export const SpatialEffectsCheckInputSchema = z.preprocess(capture, z.strictObject({
66
+ effects: z.union([SpatialRenderEffectsBindingSchema, SpatialRenderEffectsDocumentSchema]),
67
+ scene: SpatialSceneV1Schema,
68
+ }));
69
+ export const SpatialEffectsPlanInputSchema = z.preprocess(capture, z.strictObject({
70
+ particleSystems: z.array(SpatialParticleSystemSchema).max(SPATIAL_RENDER_EFFECTS_LIMITS.particleSystems).default([]),
71
+ renderPlan: SpatialRenderPlanSchema,
72
+ scene: SpatialSceneV1Schema,
73
+ simulationBakes: z.array(SpatialSimulationBakeReceiptSchema).max(SPATIAL_RENDER_EFFECTS_LIMITS.simulationBakes).default([]),
74
+ }));
75
+ export const SpatialTemporalAuditInputSchema = z.preprocess(capture, z.strictObject({
76
+ cameraId: SpatialCameraIdSchema,
77
+ options: SpatialTemporalAuditOptionsSchema.optional(),
78
+ scene: SpatialSceneV1Schema,
79
+ timesUs: z.array(SpatialTimeUsSchema).min(2).max(64).optional(),
80
+ }));
81
+ export type SpatialDirectionCheckInput = z.infer<typeof SpatialDirectionCheckInputSchema>;
82
+ export type SpatialDirectionCompileInput = z.infer<typeof SpatialDirectionCompileInputSchema>;
83
+ export type SpatialDirectionGalleryInput = z.infer<typeof SpatialDirectionGalleryInputSchema>;
84
+ export type SpatialEffectsCheckInput = z.infer<typeof SpatialEffectsCheckInputSchema>;
85
+ export type SpatialEffectsPlanInput = z.infer<typeof SpatialEffectsPlanInputSchema>;
86
+ export type SpatialTemporalAuditInput = z.infer<typeof SpatialTemporalAuditInputSchema>;
87
+ export type SpatialDirectionCheckOutput = z.infer<typeof SpatialDirectionCheckReportSchema>;
88
+ export type SpatialDirectionCompileOutput = z.infer<typeof SpatialDirectionCompilationSchema>;
89
+ export type SpatialDirectionGalleryOutput = z.infer<typeof SpatialGalleryPlanSchema>;
90
+ export type SpatialEffectsCheckOutput = z.infer<typeof SpatialEffectsCheckReportSchema>;
91
+ export type SpatialEffectsPlanOutput = z.infer<typeof SpatialRenderEffectsBindingSchema>;
92
+ export type SpatialTemporalAuditOutput = z.infer<typeof SpatialTemporalAuditReportSchema>;
93
+
94
+ const purePolicy = Object.freeze({
95
+ cache: "content-addressed", cancellable: true, effect: "pure", maxDurationMs: 10_000,
96
+ maxFanOut: 0, maxInputBytes: 8 * 1024 * 1024, maxOutputBytes: 16 * 1024 * 1024,
97
+ preparation: [], resources: [{ amount: 1, resource: "cpu" }], resume: "deterministic",
98
+ } as const) satisfies OperationPolicy;
99
+
100
+ const compileTimesUs = (input: SpatialTemporalAuditInput): readonly number[] => {
101
+ if (input.timesUs !== undefined) return [...input.timesUs].sort((left, right) => left - right);
102
+ const count = Math.min(17, Math.max(2, Math.ceil(input.scene.durationUs / 1_000_000) + 1));
103
+ return Array.from({ length: count }, (_, index) => Math.floor((input.scene.durationUs * index) / (count - 1)));
104
+ };
105
+
106
+ export const spatialDirectionCheckOperationDefinition = {
107
+ kind: "scene.direction.check", version: 1,
108
+ inputSchema: SpatialDirectionCheckInputSchema,
109
+ inputSchemaId: "slopcamera.operation.scene.direction.check.input/v1",
110
+ outputSchema: SpatialDirectionCheckReportSchema,
111
+ outputSchemaId: "slopcamera.operation.scene.direction.check.output/v1",
112
+ policy: purePolicy,
113
+ lifecycle: { kind: "pure", execute: (context, input) => {
114
+ throwIfAborted(context.abortSignal);
115
+ return Promise.resolve(SpatialDirectionCheckReportSchema.parse(
116
+ checkSpatialDirection({ direction: input.direction, scene: input.scene }),
117
+ ));
118
+ } },
119
+ summarize: output => ({ kind: "scene.direction.check", fields: {
120
+ directionSha256: output.directionSha256, errors: output.counts.errors, warnings: output.counts.warnings,
121
+ } }),
122
+ } satisfies OperationDefinition<"scene.direction.check", SpatialDirectionCheckInput, SpatialDirectionCheckOutput>;
123
+
124
+ export const spatialDirectionCompileOperationDefinition = {
125
+ kind: "scene.direction.compile", version: 1,
126
+ inputSchema: SpatialDirectionCompileInputSchema,
127
+ inputSchemaId: "slopcamera.operation.scene.direction.compile.input/v1",
128
+ outputSchema: SpatialDirectionCompilationSchema,
129
+ outputSchemaId: "slopcamera.operation.scene.direction.compile.output/v1",
130
+ policy: purePolicy,
131
+ lifecycle: { kind: "pure", execute: (context, input) => {
132
+ throwIfAborted(context.abortSignal);
133
+ return Promise.resolve(SpatialDirectionCompilationSchema.parse(compileSpatialDirection({
134
+ direction: input.direction, scene: input.scene,
135
+ ...(input.cameraId === undefined ? {} : { cameraId: input.cameraId }),
136
+ })));
137
+ } },
138
+ summarize: output => ({ kind: "scene.direction.compile", fields: {
139
+ sceneSha256: output.sceneSha256, shots: output.proposals.shots.length,
140
+ unresolved: output.unresolvedIntents.length, advisories: output.advisories.length,
141
+ } }),
142
+ } satisfies OperationDefinition<"scene.direction.compile", SpatialDirectionCompileInput, SpatialDirectionCompileOutput>;
143
+
144
+ export const spatialDirectionGalleryOperationDefinition = {
145
+ kind: "scene.direction.gallery", version: 1,
146
+ inputSchema: SpatialDirectionGalleryInputSchema,
147
+ inputSchemaId: "slopcamera.operation.scene.direction.gallery.input/v1",
148
+ outputSchema: SpatialGalleryPlanSchema,
149
+ outputSchemaId: "slopcamera.operation.scene.direction.gallery.output/v1",
150
+ policy: purePolicy,
151
+ lifecycle: { kind: "pure", execute: (context, input) => {
152
+ throwIfAborted(context.abortSignal);
153
+ return Promise.resolve(SpatialGalleryPlanSchema.parse(planSpatialDirectionGallery({
154
+ axis: input.axis, direction: input.direction, scene: input.scene,
155
+ ...(input.cameraId === undefined ? {} : { cameraId: input.cameraId }),
156
+ })));
157
+ } },
158
+ summarize: output => ({ kind: "scene.direction.gallery", fields: {
159
+ axis: output.axis, candidates: output.candidates.length, sourceSha256: output.sourceSha256,
160
+ } }),
161
+ } satisfies OperationDefinition<"scene.direction.gallery", SpatialDirectionGalleryInput, SpatialDirectionGalleryOutput>;
162
+
163
+ export const spatialEffectsCheckOperationDefinition = {
164
+ kind: "scene.effects.check", version: 1,
165
+ inputSchema: SpatialEffectsCheckInputSchema,
166
+ inputSchemaId: "slopcamera.operation.scene.effects.check.input/v1",
167
+ outputSchema: SpatialEffectsCheckReportSchema,
168
+ outputSchemaId: "slopcamera.operation.scene.effects.check.output/v1",
169
+ policy: purePolicy,
170
+ lifecycle: { kind: "pure", execute: (context, input) => {
171
+ throwIfAborted(context.abortSignal);
172
+ return Promise.resolve(SpatialEffectsCheckReportSchema.parse(
173
+ checkSpatialRenderEffects({ effects: input.effects, scene: input.scene }),
174
+ ));
175
+ } },
176
+ summarize: output => ({ kind: "scene.effects.check", fields: {
177
+ errors: output.counts.errors, warnings: output.counts.warnings, sceneSha256: output.sceneSha256,
178
+ } }),
179
+ } satisfies OperationDefinition<"scene.effects.check", SpatialEffectsCheckInput, SpatialEffectsCheckOutput>;
180
+
181
+ export const spatialEffectsPlanOperationDefinition = {
182
+ kind: "scene.effects.plan", version: 1,
183
+ inputSchema: SpatialEffectsPlanInputSchema,
184
+ inputSchemaId: "slopcamera.operation.scene.effects.plan.input/v1",
185
+ outputSchema: SpatialRenderEffectsBindingSchema,
186
+ outputSchemaId: "slopcamera.operation.scene.effects.plan.output/v1",
187
+ policy: purePolicy,
188
+ lifecycle: { kind: "pure", execute: (context, input) => {
189
+ throwIfAborted(context.abortSignal);
190
+ return Promise.resolve(SpatialRenderEffectsBindingSchema.parse(planSpatialRenderEffects({
191
+ particleSystems: input.particleSystems, renderPlan: input.renderPlan, scene: input.scene,
192
+ simulationBakes: input.simulationBakes,
193
+ })));
194
+ } },
195
+ summarize: output => ({ kind: "scene.effects.plan", fields: {
196
+ documentSha256: output.documentSha256, renderPlanSha256: output.document.renderPlanSha256,
197
+ } }),
198
+ } satisfies OperationDefinition<"scene.effects.plan", SpatialEffectsPlanInput, SpatialEffectsPlanOutput>;
199
+
200
+ export const spatialTemporalAuditOperationDefinition = {
201
+ kind: "scene.temporal-audit", version: 1,
202
+ inputSchema: SpatialTemporalAuditInputSchema,
203
+ inputSchemaId: "slopcamera.operation.scene.temporal-audit.input/v1",
204
+ outputSchema: SpatialTemporalAuditReportSchema,
205
+ outputSchemaId: "slopcamera.operation.scene.temporal-audit.output/v1",
206
+ policy: purePolicy,
207
+ lifecycle: { kind: "pure", execute: (context, input) => {
208
+ throwIfAborted(context.abortSignal);
209
+ const evaluationContext = createSpatialEvaluationContext(input.scene);
210
+ const snapshots = compileTimesUs(input).map(timeUs =>
211
+ evaluateSpatialSceneInContext(evaluationContext, { cameraId: input.cameraId, timeUs }));
212
+ return Promise.resolve(SpatialTemporalAuditReportSchema.parse(
213
+ auditSpatialTemporalEvidence({
214
+ snapshots,
215
+ ...(input.options === undefined ? {} : { options: input.options }),
216
+ }),
217
+ ));
218
+ } },
219
+ summarize: output => ({ kind: "scene.temporal-audit", fields: {
220
+ findings: output.findings.length, samples: output.sampleCount, sceneSha256: output.sceneSha256,
221
+ } }),
222
+ } satisfies OperationDefinition<"scene.temporal-audit", SpatialTemporalAuditInput, SpatialTemporalAuditOutput>;
@@ -0,0 +1,174 @@
1
+ import { constants } from "node:fs";
2
+ import { mkdtemp, open, rm } from "node:fs/promises";
3
+ import { dirname, join, posix } from "node:path";
4
+
5
+ import { z } from "zod";
6
+
7
+ import { createBoundedJsonValueSnapshot } from "../../../../src/code/json-snapshot";
8
+ import { SPATIAL_SCENE_LIMITS, SpatialAssetIdSchema, SpatialDigestSchema } from "../../../../src/spatial-scene/contracts";
9
+ import { parseSpatialScene, spatialSceneSha256 } from "../../../../src/spatial-scene/identity";
10
+ import { SpatialRenderedAuditReportSchema } from "../../../../src/spatial-scene/audit-rendered";
11
+ import { ensurePhysicalPrivateDirectoryWithin } from "../../cli/paths";
12
+ import { canonicalJson } from "../../core/canonical-json";
13
+ import { exactCapabilityByName } from "../capability-binding";
14
+ import type { ApplicationContext } from "../context";
15
+ import { ApplicationError } from "../errors";
16
+ import { bindHtmlOverlayBrowserRuntime, HtmlOverlayBrowserRuntimeBindingSchema } from "../html-overlay-browser-runtime";
17
+ import type { OperationDefinition, OperationExecutionContext } from "../operation";
18
+ import {
19
+ auditSpatialSceneRenderedHost, planSpatialRenderedAudit, spatialRenderedAuditCapabilityNames,
20
+ SpatialRenderedAuditRequestSchema, type SpatialRenderedAuditDependencies,
21
+ } from "../spatial-rendered-audit";
22
+ import { MediaCapabilityBindingsSchema, bindExpectedMediaCapabilities } from "./media/capabilities";
23
+ import {
24
+ MediaArtifactReferenceSchema, MediaArtifactRequestSchema, bindRepositoryMedia, loadRepositoryMedia,
25
+ createMediaOperationWorkspace,
26
+ } from "./media/shared";
27
+
28
+ const MAXIMUM_ASSET_BYTES = 256 * 1024 * 1024;
29
+ const AssetBindingSchema = z.strictObject({ assetId: SpatialAssetIdSchema, artifact: MediaArtifactReferenceSchema });
30
+ const requestShape = z.strictObject({
31
+ source: MediaArtifactRequestSchema,
32
+ assets: z.array(AssetBindingSchema).max(SPATIAL_SCENE_LIMITS.assets).optional(),
33
+ request: SpatialRenderedAuditRequestSchema,
34
+ sceneSha256: SpatialDigestSchema.optional(),
35
+ capabilityBindings: MediaCapabilityBindingsSchema.optional(),
36
+ browserRuntime: HtmlOverlayBrowserRuntimeBindingSchema.optional(),
37
+ });
38
+ const captured = (input: unknown) => createBoundedJsonValueSnapshot(input, 16 * 1024 * 1024, "spatial rendered audit request", { maximumDepth: 48, maximumValues: 500_000 }).value;
39
+ export const SpatialRenderedAuditInputSchema = z.preprocess(captured, requestShape);
40
+ export const BoundSpatialRenderedAuditInputSchema = z.preprocess(captured, requestShape.extend({
41
+ source: MediaArtifactReferenceSchema,
42
+ assets: z.array(AssetBindingSchema).max(SPATIAL_SCENE_LIMITS.assets),
43
+ sceneSha256: SpatialDigestSchema,
44
+ capabilityBindings: MediaCapabilityBindingsSchema,
45
+ browserRuntime: HtmlOverlayBrowserRuntimeBindingSchema,
46
+ }));
47
+ /** The output is the report itself, matching scene.audit; nothing is published. */
48
+ export const SpatialRenderedAuditOutputSchema = SpatialRenderedAuditReportSchema;
49
+ export type SpatialRenderedAuditInput = z.infer<typeof SpatialRenderedAuditInputSchema>;
50
+ export type BoundSpatialRenderedAuditInput = z.infer<typeof BoundSpatialRenderedAuditInputSchema>;
51
+ export type SpatialRenderedAuditOutput = z.infer<typeof SpatialRenderedAuditOutputSchema>;
52
+
53
+ function sourceDocument(data: Uint8Array) {
54
+ try { return parseSpatialScene(JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(data))); }
55
+ catch (error) { throw new ApplicationError("invalid-data", `Invalid spatial source: ${error instanceof Error ? error.message : String(error)}`); }
56
+ }
57
+
58
+ /**
59
+ * The source grants access only to its bounded, root-contained declared
60
+ * closure. Capability and browser-runtime identity are bound at admission and
61
+ * re-verified inside the host service, exactly like scene.render.
62
+ */
63
+ export async function bindSpatialRenderedAuditInput(
64
+ application: ApplicationContext,
65
+ input: unknown,
66
+ signal = new AbortController().signal,
67
+ bindRuntime: typeof bindHtmlOverlayBrowserRuntime = bindHtmlOverlayBrowserRuntime,
68
+ ): Promise<BoundSpatialRenderedAuditInput> {
69
+ const parsed = SpatialRenderedAuditInputSchema.parse(input);
70
+ const source = await loadRepositoryMedia(application, parsed.source, signal, SPATIAL_SCENE_LIMITS.sourceBytes);
71
+ const scene = sourceDocument(source.data);
72
+ planSpatialRenderedAudit(scene, parsed.request);
73
+ const sceneSha256 = spatialSceneSha256(scene);
74
+ if (parsed.sceneSha256 !== undefined && parsed.sceneSha256 !== sceneSha256) throw new ApplicationError("conflict", "Scene source changed after planning.");
75
+ if (scene.assets.reduce((sum, asset) => sum + asset.payload.bytes, 0) > MAXIMUM_ASSET_BYTES) throw new ApplicationError("invalid-data", "Scene asset closure exceeds 256 MiB.");
76
+ const supplied = parsed.assets === undefined ? undefined : new Map(parsed.assets.map(item => [item.assetId, item.artifact]));
77
+ if (supplied !== undefined && (supplied.size !== parsed.assets!.length || supplied.size !== scene.assets.length || scene.assets.some(asset => !supplied.has(asset.assetId)))) throw new ApplicationError("invalid-data", "Asset bindings must name every declared asset exactly once.");
78
+ const assets: z.infer<typeof AssetBindingSchema>[] = [];
79
+ for (const asset of scene.assets) {
80
+ const request = supplied?.get(asset.assetId) ?? {
81
+ ...asset.payload, path: posix.join(posix.dirname(source.artifact.path), asset.payload.path),
82
+ };
83
+ if (request.sha256 !== asset.payload.sha256 || request.bytes !== asset.payload.bytes) throw new ApplicationError("conflict", `Asset ${asset.assetId} does not match its source manifest.`);
84
+ const bound = await bindRepositoryMedia(application, request, signal, asset.payload.bytes);
85
+ assets.push({ assetId: asset.assetId, artifact: bound.artifact });
86
+ }
87
+ const capabilityBindings = await bindExpectedMediaCapabilities(application, spatialRenderedAuditCapabilityNames(scene), parsed.capabilityBindings);
88
+ const browserRuntime = await bindRuntime(exactCapabilityByName(capabilityBindings, "html-browser"), signal);
89
+ if (parsed.browserRuntime !== undefined && canonicalJson(parsed.browserRuntime) !== canonicalJson(browserRuntime)) throw new ApplicationError("conflict", "Browser runtime changed after rendered audit planning.");
90
+ return BoundSpatialRenderedAuditInputSchema.parse({ ...parsed, source: source.artifact, assets, sceneSha256, capabilityBindings, browserRuntime });
91
+ }
92
+
93
+ async function writePrivateFile(path: string, bytes: Uint8Array): Promise<void> {
94
+ const handle = await open(path, constants.O_CREAT | constants.O_EXCL | constants.O_WRONLY | constants.O_NOFOLLOW, 0o600);
95
+ try { await handle.writeFile(bytes); await handle.sync(); } finally { await handle.close(); }
96
+ }
97
+
98
+ /** Trusted test ports are never part of a serialized audit request. */
99
+ export interface SpatialRenderedAuditOperationDependencies extends SpatialRenderedAuditDependencies {
100
+ readonly createWorkspace?: typeof createMediaOperationWorkspace;
101
+ readonly createDirectory?: typeof mkdtemp;
102
+ readonly removeDirectory?: (path: string) => Promise<void>;
103
+ }
104
+
105
+ export async function executeSpatialRenderedAudit(
106
+ context: OperationExecutionContext,
107
+ input: SpatialRenderedAuditInput,
108
+ dependencies: SpatialRenderedAuditOperationDependencies = {},
109
+ ): Promise<SpatialRenderedAuditOutput> {
110
+ if (context.workflow !== undefined) BoundSpatialRenderedAuditInputSchema.parse(input);
111
+ const bound = await bindSpatialRenderedAuditInput(context.application, input, context.abortSignal, dependencies.bindBrowserRuntime);
112
+ const source = await loadRepositoryMedia(context.application, bound.source, context.abortSignal, SPATIAL_SCENE_LIMITS.sourceBytes);
113
+ const scene = sourceDocument(source.data);
114
+ const workspace = await (dependencies.createWorkspace ?? createMediaOperationWorkspace)(context);
115
+ let directory: string | undefined;
116
+ const cleanupErrors: unknown[] = [];
117
+ let completed: SpatialRenderedAuditOutput | undefined, failure: unknown, failed = false;
118
+ try {
119
+ directory = await (dependencies.createDirectory ?? mkdtemp)(join(workspace.path, "spatial-audit-source-"));
120
+ const assetRoot = await ensurePhysicalPrivateDirectoryWithin(directory, "assets");
121
+ const writtenPaths = new Map<string, string>();
122
+ for (const asset of scene.assets) {
123
+ const artifact = bound.assets.find(item => item.assetId === asset.assetId)!.artifact;
124
+ const loaded = await loadRepositoryMedia(context.application, artifact, context.abortSignal, asset.payload.bytes);
125
+ const previous = writtenPaths.get(asset.payload.path);
126
+ if (previous !== undefined) {
127
+ if (previous !== artifact.sha256) throw new ApplicationError("conflict", "Two scene assets declare different bytes at one path.");
128
+ continue;
129
+ }
130
+ const parent = dirname(asset.payload.path);
131
+ if (parent !== ".") await ensurePhysicalPrivateDirectoryWithin(assetRoot, parent);
132
+ await writePrivateFile(join(assetRoot, asset.payload.path), loaded.data);
133
+ writtenPaths.set(asset.payload.path, artifact.sha256);
134
+ }
135
+ const report = await auditSpatialSceneRenderedHost(context, {
136
+ scene, assetRoot, request: bound.request,
137
+ capabilityBindings: bound.capabilityBindings, browserRuntime: bound.browserRuntime,
138
+ }, dependencies);
139
+ completed = SpatialRenderedAuditOutputSchema.parse(report);
140
+ } catch (error) { failure = error; failed = true; }
141
+ finally {
142
+ if (directory !== undefined) try { await (dependencies.removeDirectory ?? (async path => { await rm(path, { recursive: true, force: true }); }))(directory); } catch (error) { cleanupErrors.push(error); }
143
+ try { await workspace.dispose(); } catch (error) { cleanupErrors.push(error); }
144
+ }
145
+ if (failed || cleanupErrors.length > 0) {
146
+ const cause = cleanupErrors.length === 0 ? failure : new AggregateError([...(failed ? [failure] : []), ...cleanupErrors], "Rendered scene audit failed during execution or cleanup.");
147
+ const error = new ApplicationError(failure instanceof ApplicationError ? failure.code : "internal",
148
+ cause instanceof Error ? cause.message : "Rendered scene audit failed.",
149
+ { cleanupErrors: cleanupErrors.map(error => error instanceof Error ? error.message : String(error)) });
150
+ error.cause = cause;
151
+ throw error;
152
+ }
153
+ if (completed === undefined) throw new ApplicationError("internal", "Rendered scene audit completed without a report.");
154
+ return completed;
155
+ }
156
+
157
+ export const spatialRenderedAuditOperationDefinition = {
158
+ kind: "scene.render-audit", version: 1,
159
+ inputSchema: SpatialRenderedAuditInputSchema, inputSchemaId: "slopcamera.operation.scene.render-audit.input/v1",
160
+ outputSchema: SpatialRenderedAuditOutputSchema, outputSchemaId: "slopcamera.operation.scene.render-audit.output/v1",
161
+ lifecycle: { kind: "local-artifact", execute: executeSpatialRenderedAudit },
162
+ policy: {
163
+ cache: "none", cancellable: true, effect: "local-derived-write", maxDurationMs: 300_000,
164
+ maxFanOut: 0, maxInputBytes: 16 * 1024 * 1024, maxOutputBytes: 34 * 1024 * 1024,
165
+ preparation: ["local-media"], resources: [
166
+ { amount: 1, resource: "cpu" }, { amount: 1, resource: "local-io" }, { amount: 1, resource: "browser" },
167
+ { amount: 1, resource: "ffmpeg" },
168
+ ], resume: "deterministic",
169
+ },
170
+ summarize: output => ({ kind: "scene.render-audit", fields: {
171
+ sceneSha256: output.sceneSha256, cameraId: output.cameraId, samples: output.timesUs.length,
172
+ entities: output.summary.entities.total, neverRendered: output.summary.entitiesNeverRendered.length, findings: output.findings.length,
173
+ } }),
174
+ } satisfies OperationDefinition<"scene.render-audit", SpatialRenderedAuditInput, SpatialRenderedAuditOutput>;