@hraness/slopcamera 3.2.8 → 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 (150) hide show
  1. package/README.md +29 -9
  2. package/apps/desktop/application/context.ts +6 -0
  3. package/apps/desktop/application/default-registry.ts +26 -0
  4. package/apps/desktop/application/operation.ts +14 -1
  5. package/apps/desktop/application/operations/index.ts +4 -0
  6. package/apps/desktop/application/operations/spatial-behavior.ts +151 -0
  7. package/apps/desktop/application/operations/spatial-direction.ts +222 -0
  8. package/apps/desktop/application/operations/spatial-rendered-audit.ts +174 -0
  9. package/apps/desktop/application/operations/spatial-review.ts +194 -0
  10. package/apps/desktop/application/operations/spatial-scene.ts +25 -1
  11. package/apps/desktop/application/registry.ts +2 -2
  12. package/apps/desktop/application/spatial-asset-admission.ts +201 -0
  13. package/apps/desktop/application/spatial-assets.ts +160 -31
  14. package/apps/desktop/application/spatial-render.ts +217 -20
  15. package/apps/desktop/application/spatial-rendered-audit.ts +273 -0
  16. package/apps/desktop/application/spatial-review.ts +361 -0
  17. package/apps/desktop/application/spatial-spz.ts +48 -3
  18. package/apps/desktop/application/spatial-world-import.ts +26 -5
  19. package/apps/desktop/application/spatial-world-metadata.ts +105 -0
  20. package/apps/desktop/cli/args.ts +514 -11
  21. package/apps/desktop/cli/capability-manifest.ts +374 -0
  22. package/apps/desktop/cli/cinema-renderer.ts +608 -0
  23. package/apps/desktop/cli/command-host-resources.ts +29 -1
  24. package/apps/desktop/cli/commands.ts +1188 -4
  25. package/apps/desktop/cli/gateway-review-provider.ts +334 -0
  26. package/apps/desktop/cli/help.ts +172 -6
  27. package/apps/desktop/cli/main.ts +3 -3
  28. package/apps/desktop/cli/portable-surface.ts +6 -1
  29. package/apps/desktop/cli/spatial-asset-service.ts +124 -0
  30. package/apps/desktop/cli/spatial-design-service.ts +237 -0
  31. package/apps/desktop/cli/spatial-generate-service.ts +370 -0
  32. package/apps/desktop/cli/spatial-scene-service.ts +268 -4
  33. package/apps/desktop/cli/workflow-code.ts +1 -1
  34. package/apps/desktop/code/semantic-builder.ts +24 -0
  35. package/apps/desktop/contracts/cinema.ts +736 -0
  36. package/apps/desktop/contracts/index.ts +1 -0
  37. package/apps/desktop/contracts/spatial-asset.ts +16 -0
  38. package/apps/desktop/contracts/spatial-world.ts +26 -3
  39. package/apps/desktop/core/cinema-plan.ts +1320 -0
  40. package/apps/desktop/core/index.ts +1 -0
  41. package/apps/desktop/core/storage.ts +75 -0
  42. package/apps/desktop/dist/cli/main.js +725 -273
  43. package/apps/desktop/html-overlay/spatial.ts +619 -57
  44. package/apps/desktop/workflows/cinematic-world.ts +127 -0
  45. package/apps/desktop/workflows/index.ts +6 -0
  46. package/dist/cli.js +25 -429
  47. package/dist/code/advanced.js +1 -269
  48. package/dist/code/index.js +16 -2239
  49. package/dist/generate.js +1 -23
  50. package/dist/host-resources.js +1 -25
  51. package/dist/index-0bbesn4m.js +35 -0
  52. package/dist/index-296qhpf2.js +3 -0
  53. package/dist/index-3cxf2c58.js +3 -0
  54. package/dist/index-77fjfg9f.js +3 -0
  55. package/dist/index-80a36bc0.js +3 -0
  56. package/dist/index-a3vvs3rf.js +3 -0
  57. package/dist/index-b3geqczn.js +5 -0
  58. package/dist/index-cgpkyjqa.js +3 -0
  59. package/dist/index-f0ptv8dm.js +7 -0
  60. package/dist/index-grk47tgs.js +3 -0
  61. package/dist/index-qry58nj2.js +10 -0
  62. package/dist/index.js +1 -226
  63. package/dist/operations.js +1 -28
  64. package/dist/skill-install-gx7afxsd.js +2 -0
  65. package/dist/vectorize/worker.js +1 -141
  66. package/dist/workflow.js +1 -15
  67. package/docs/README.md +5 -1
  68. package/package.json +7 -5
  69. package/skills/slopcamera/SKILL.md +6 -1
  70. package/skills/slopcamera/references/directed-scenes.md +22 -2
  71. package/skills/slopcamera/references/gateway-media.md +15 -1
  72. package/skills/slopcamera/references/image-galleries.md +166 -0
  73. package/skills/slopcamera/references/install.md +1 -1
  74. package/skills/slopcamera/references/parametric-design.md +14 -0
  75. package/skills/slopcamera/references/scene-building.md +32 -0
  76. package/skills/slopcamera/references/social-collage-banners.md +204 -0
  77. package/skills/slopcamera/references/workflows-sdk.md +3 -3
  78. package/skills/slopcamera/scripts/compose-social-collage-banner.ts +728 -0
  79. package/src/capability-manifest.ts +361 -0
  80. package/src/cli.ts +222 -4
  81. package/src/code/canonical-json.ts +9 -0
  82. package/src/generate.ts +2 -2
  83. package/src/icon.ts +1111 -0
  84. package/src/image-gallery.ts +1049 -0
  85. package/src/index.ts +11 -0
  86. package/src/mcp/boundary.ts +11 -11
  87. package/src/mcp/index.ts +3 -0
  88. package/src/mcp/server.ts +2 -1
  89. package/src/mcp/tools.ts +1642 -130
  90. package/src/mcp/types.ts +19 -0
  91. package/src/operations.ts +412 -0
  92. package/src/portable-capability-manifest.ts +67 -0
  93. package/src/scene-gallery.ts +184 -0
  94. package/src/spatial-scene/asset-admission.ts +183 -0
  95. package/src/spatial-scene/audit-rendered.ts +692 -0
  96. package/src/spatial-scene/audit.ts +617 -0
  97. package/src/spatial-scene/behavior-audit.ts +252 -0
  98. package/src/spatial-scene/behavior-bake.ts +233 -0
  99. package/src/spatial-scene/behavior-fns.ts +585 -0
  100. package/src/spatial-scene/behavior-gallery.ts +109 -0
  101. package/src/spatial-scene/behavior-stdlib.ts +323 -0
  102. package/src/spatial-scene/behavior-trace.ts +325 -0
  103. package/src/spatial-scene/behavior.ts +618 -0
  104. package/src/spatial-scene/build.ts +632 -0
  105. package/src/spatial-scene/camera-rig.ts +125 -0
  106. package/src/spatial-scene/camera-track.ts +4 -2
  107. package/src/spatial-scene/character.ts +124 -0
  108. package/src/spatial-scene/contracts.ts +75 -7
  109. package/src/spatial-scene/design-templates.ts +351 -0
  110. package/src/spatial-scene/design.ts +327 -0
  111. package/src/spatial-scene/direction-compile.ts +584 -0
  112. package/src/spatial-scene/direction.ts +122 -0
  113. package/src/spatial-scene/effects.ts +149 -0
  114. package/src/spatial-scene/evaluate.ts +109 -29
  115. package/src/spatial-scene/gallery.ts +277 -0
  116. package/src/spatial-scene/generate.ts +239 -0
  117. package/src/spatial-scene/geometry-native.ts +165 -0
  118. package/src/spatial-scene/geometry.ts +1216 -0
  119. package/src/spatial-scene/gltf.ts +600 -77
  120. package/src/spatial-scene/identity.ts +55 -2
  121. package/src/spatial-scene/index.ts +36 -0
  122. package/src/spatial-scene/inspect.ts +35 -6
  123. package/src/spatial-scene/material-lighting.ts +609 -0
  124. package/src/spatial-scene/math.ts +21 -4
  125. package/src/spatial-scene/motion-evidence.ts +88 -0
  126. package/src/spatial-scene/parametric.ts +765 -0
  127. package/src/spatial-scene/particle-preparation.ts +183 -0
  128. package/src/spatial-scene/particle.ts +195 -0
  129. package/src/spatial-scene/patch.ts +109 -15
  130. package/src/spatial-scene/performance.ts +1613 -0
  131. package/src/spatial-scene/probe.ts +137 -0
  132. package/src/spatial-scene/recipe-pack.ts +86 -0
  133. package/src/spatial-scene/render-effects.ts +240 -0
  134. package/src/spatial-scene/review.ts +639 -0
  135. package/src/spatial-scene/simulation-bake.ts +206 -0
  136. package/src/spatial-scene/simulation.ts +187 -0
  137. package/src/spatial-scene/solve.ts +366 -0
  138. package/src/spatial-scene/temporal-audit.ts +354 -0
  139. package/src/version.ts +1 -1
  140. package/dist/index-42zsesc1.js +0 -2257
  141. package/dist/index-7131pg1c.js +0 -1820
  142. package/dist/index-7308egqr.js +0 -48
  143. package/dist/index-8txs6fkn.js +0 -712
  144. package/dist/index-fava6pge.js +0 -192
  145. package/dist/index-h1k0fnjq.js +0 -2363
  146. package/dist/index-r7gdhmsp.js +0 -424
  147. package/dist/index-sh6xbav6.js +0 -1219
  148. package/dist/index-z1w83f81.js +0 -4
  149. package/dist/index-zfnddgay.js +0 -2029
  150. package/dist/skill-install-dh0ntqba.js +0 -10
@@ -0,0 +1,88 @@
1
+ import { z } from "zod"
2
+
3
+ import { deepFreezeJson } from "../code/json-snapshot.js"
4
+ import { SpatialDigestSchema, SpatialEntityIdSchema, SpatialTimeUsSchema } from "./contracts.js"
5
+ import { parseSpatialValue, spatialValueSha256 } from "./identity.js"
6
+ import { positiveDimension } from "./effects.js"
7
+
8
+ /**
9
+ * Bounded motion-vector evidence for temporal effects and audits.
10
+ * This contract is diagnostic-only and must never pass through beauty
11
+ * post-processing modules; it is produced from renderer-per-sample motion.
12
+ */
13
+
14
+ export const SPATIAL_MOTION_EVIDENCE_LIMITS = Object.freeze({
15
+ dimension: 16_384,
16
+ evidenceSamples: 64,
17
+ exposureUs: 1_000_000,
18
+ pixels: 4096 * 4096,
19
+ samples: 16,
20
+ samplesPerPixel: 16,
21
+ })
22
+
23
+ const positivePixels = z.number().int().safe().positive().max(SPATIAL_MOTION_EVIDENCE_LIMITS.dimension)
24
+
25
+ export const SpatialMotionSampleSchema = z.strictObject({
26
+ byteLength: z.number().int().safe().positive().max(SPATIAL_MOTION_EVIDENCE_LIMITS.pixels * 8),
27
+ encoding: z.enum(["rg16f", "rg32f", "rg16un"]),
28
+ entityId: SpatialEntityIdSchema,
29
+ exposureUs: SpatialTimeUsSchema.min(1).max(SPATIAL_MOTION_EVIDENCE_LIMITS.exposureUs),
30
+ height: positivePixels,
31
+ id: z.string().min(1).max(64).regex(/^[a-z][a-z0-9_-]*$/u),
32
+ motionScale: positiveDimension,
33
+ motionSha256: SpatialDigestSchema,
34
+ previousTimeUs: SpatialTimeUsSchema,
35
+ sampleTimeUs: SpatialTimeUsSchema,
36
+ samplesPerPixel: z.number().int().min(1).max(SPATIAL_MOTION_EVIDENCE_LIMITS.samplesPerPixel),
37
+ viewport: z.tuple([
38
+ z.number().int().safe().nonnegative(),
39
+ z.number().int().safe().nonnegative(),
40
+ positivePixels,
41
+ positivePixels,
42
+ ]),
43
+ width: positivePixels,
44
+ }).superRefine((sample, context) => {
45
+ if (sample.width * sample.height > SPATIAL_MOTION_EVIDENCE_LIMITS.pixels) {
46
+ context.addIssue({ code: "custom", path: ["width"], message: `Motion sample ${sample.id} ${sample.width}x${sample.height} exceeds pixel budget.` })
47
+ }
48
+ const [x, y, viewportWidth, viewportHeight] = sample.viewport
49
+ if (x + viewportWidth > sample.width || y + viewportHeight > sample.height) {
50
+ context.addIssue({ code: "custom", path: ["viewport"], message: `Motion sample ${sample.id} viewport escapes its ${sample.width}x${sample.height} buffer.` })
51
+ }
52
+ if (sample.previousTimeUs >= sample.sampleTimeUs) {
53
+ context.addIssue({ code: "custom", path: ["previousTimeUs"], message: `Motion sample ${sample.id} requires previousTimeUs before sampleTimeUs.` })
54
+ }
55
+ const bytesPerPixel = sample.encoding === "rg32f" ? 8 : 4
56
+ if (sample.byteLength !== sample.width * sample.height * bytesPerPixel) {
57
+ context.addIssue({ code: "custom", path: ["byteLength"], message: `Motion sample ${sample.id} byteLength does not match its dimensions and encoding.` })
58
+ }
59
+ })
60
+
61
+ export const SpatialMotionEvidenceSchema = z.strictObject({
62
+ entityId: SpatialEntityIdSchema,
63
+ kind: z.literal("slopcamera.spatial-motion-evidence"),
64
+ renderRequestSha256: SpatialDigestSchema,
65
+ rendererSha256: SpatialDigestSchema,
66
+ samples: z.array(SpatialMotionSampleSchema).min(1).max(SPATIAL_MOTION_EVIDENCE_LIMITS.evidenceSamples),
67
+ schemaVersion: z.literal(1),
68
+ }).superRefine((evidence, context) => {
69
+ const ids = new Set<string>()
70
+ let previousTimeUs = -1
71
+ for (const [index, sample] of evidence.samples.entries()) {
72
+ if (ids.has(sample.id)) context.addIssue({ code: "custom", path: ["samples", index, "id"], message: `Duplicate motion sample id ${sample.id}.` })
73
+ ids.add(sample.id)
74
+ if (sample.entityId !== evidence.entityId) context.addIssue({ code: "custom", path: ["samples", index, "entityId"], message: `Motion sample ${sample.id} belongs to a different entity.` })
75
+ if (sample.sampleTimeUs <= previousTimeUs) context.addIssue({ code: "custom", path: ["samples", index, "sampleTimeUs"], message: "Motion samples must be strictly ordered by sampleTimeUs." })
76
+ previousTimeUs = sample.sampleTimeUs
77
+ }
78
+ })
79
+
80
+ export type SpatialMotionEvidence = Readonly<z.infer<typeof SpatialMotionEvidenceSchema>>
81
+
82
+ export function parseSpatialMotionEvidence(input: unknown): SpatialMotionEvidence {
83
+ return deepFreezeJson(parseSpatialValue(SpatialMotionEvidenceSchema, input, "motion evidence"))
84
+ }
85
+
86
+ export function spatialMotionEvidenceSha256(evidence: SpatialMotionEvidence): string {
87
+ return spatialValueSha256(evidence)
88
+ }