@adea-ai/spatial 0.74.8 → 0.75.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.
package/dist/engine.d.ts CHANGED
@@ -18,6 +18,13 @@
18
18
  */
19
19
  export declare const OFFICIAL_AGENT_SIM_WEB_HOSTS: readonly ["adea.dev", "adea.io"];
20
20
  export type AgentSimWebPlatform = 'web' | 'desktop';
21
+ /**
22
+ * Designer surfaces the pack may expose as separate cold entries alongside
23
+ * the HQ entry. Each surface mounts through the same entitlement gate as
24
+ * the standard virtual view; a pack without the surface simply reports it
25
+ * unavailable and the host renders its offline fallback.
26
+ */
27
+ export type AgentSimEngineSurface = 'character-designer' | 'room-designer';
21
28
  export type AgentSimEngineManifest = {
22
29
  /**
23
30
  * Same-origin ES module URL of the engine entry. The entry must register
@@ -27,6 +34,13 @@ export type AgentSimEngineManifest = {
27
34
  entryUrl: string;
28
35
  /** Engine pack version (agent-sim repo release). Diagnostics only. */
29
36
  version: string;
37
+ /**
38
+ * Same-origin cold-entry URLs for the designer surfaces (agent-sim
39
+ * v0.13.2+ packs). A designer entry registers its mount under
40
+ * `window.adeaAgentSimSurfaces[surface]`. Absent on older packs — the
41
+ * host then renders the surface's offline fallback.
42
+ */
43
+ surfaces?: Partial<Record<AgentSimEngineSurface, string>>;
30
44
  };
31
45
  /** Well-known same-origin URL the official pack lane writes the manifest to. */
32
46
  export declare function agentSimEngineManifestUrl(origin: string): string;
package/dist/engine.js CHANGED
@@ -49,7 +49,30 @@ export function parseAgentSimEngineManifest(value, origin) {
49
49
  return { ok: false };
50
50
  if (!resolved.pathname.endsWith('.js'))
51
51
  return { ok: false };
52
- return { ok: true, manifest: { entryUrl: resolved.toString(), version } };
52
+ // Surfaces are optional and individually validated: anything that is not a
53
+ // same-origin .js URL is dropped rather than failing the whole manifest, so
54
+ // a partially-written pack degrades to the fallback instead of breaking HQ.
55
+ const rawSurfaces = value.engine?.surfaces;
56
+ let surfaces;
57
+ if (typeof rawSurfaces === 'object' && rawSurfaces !== null) {
58
+ for (const [name, url] of Object.entries(rawSurfaces)) {
59
+ if (typeof url !== 'string' || url.length === 0)
60
+ continue;
61
+ try {
62
+ const surfaceUrl = new URL(url, origin);
63
+ if (surfaceUrl.origin !== new URL(origin).origin)
64
+ continue;
65
+ if (!surfaceUrl.pathname.endsWith('.js'))
66
+ continue;
67
+ surfaces ??= {};
68
+ surfaces[name] = surfaceUrl.toString();
69
+ }
70
+ catch {
71
+ continue;
72
+ }
73
+ }
74
+ }
75
+ return { ok: true, manifest: { entryUrl: resolved.toString(), version, surfaces } };
53
76
  }
54
77
  /**
55
78
  * Whether a web origin is an official Adea deployment allowed to resolve the
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from './asset-manifests';
2
- export { agentSimEngineManifestUrl, isLocalDevHost, isOfficialAgentSimWebOrigin, parseAgentSimEngineManifest, OFFICIAL_AGENT_SIM_WEB_HOSTS, type AgentSimEngineManifest, } from './engine';
2
+ export { agentSimEngineManifestUrl, isLocalDevHost, isOfficialAgentSimWebOrigin, parseAgentSimEngineManifest, OFFICIAL_AGENT_SIM_WEB_HOSTS, type AgentSimEngineManifest, type AgentSimEngineSurface, } from './engine';
3
3
  export { hqHomeManifest, hqWorkManifest } from './manifests';
4
4
  export { appRouteHref, encodeSceneStartPosition, portalNavigationHref, readSceneStartPosition, type PortalNavigation, type SceneApp, } from './scene-spawn';
5
5
  export { createSceneTelemetryEnvelope, MAX_SCENE_TELEMETRY_BYTES, onRouterTransitionStart, parseScenePerformanceReport, recordNavigation, SCENE_TELEMETRY_LOG_PREFIX, type SceneNavigationType, type ScenePerformanceReport, type SceneRuntimeStats, type SceneTelemetryEnvelope, } from './telemetry';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adea-ai/spatial",
3
- "version": "0.74.8",
3
+ "version": "0.75.1",
4
4
  "description": "Scene and asset manifest contracts plus the shell-to-engine spatial protocol for Adea workspaces: scene mount manifests, spawn URL helpers, and scene telemetry schemas. Pure types — no rendering, no binaries.",
5
5
  "keywords": [
6
6
  "assets",
package/src/engine.ts CHANGED
@@ -25,6 +25,14 @@ const OFFICIAL_LOCAL_HOSTS = ['localhost', '127.0.0.1', '[::1]']
25
25
 
26
26
  export type AgentSimWebPlatform = 'web' | 'desktop'
27
27
 
28
+ /**
29
+ * Designer surfaces the pack may expose as separate cold entries alongside
30
+ * the HQ entry. Each surface mounts through the same entitlement gate as
31
+ * the standard virtual view; a pack without the surface simply reports it
32
+ * unavailable and the host renders its offline fallback.
33
+ */
34
+ export type AgentSimEngineSurface = 'character-designer' | 'room-designer'
35
+
28
36
  export type AgentSimEngineManifest = {
29
37
  /**
30
38
  * Same-origin ES module URL of the engine entry. The entry must register
@@ -34,6 +42,13 @@ export type AgentSimEngineManifest = {
34
42
  entryUrl: string
35
43
  /** Engine pack version (agent-sim repo release). Diagnostics only. */
36
44
  version: string
45
+ /**
46
+ * Same-origin cold-entry URLs for the designer surfaces (agent-sim
47
+ * v0.13.2+ packs). A designer entry registers its mount under
48
+ * `window.adeaAgentSimSurfaces[surface]`. Absent on older packs — the
49
+ * host then renders the surface's offline fallback.
50
+ */
51
+ surfaces?: Partial<Record<AgentSimEngineSurface, string>>
37
52
  }
38
53
 
39
54
  /** Well-known same-origin URL the official pack lane writes the manifest to. */
@@ -63,7 +78,28 @@ export function parseAgentSimEngineManifest(
63
78
  }
64
79
  if (resolved.origin !== new URL(origin).origin) return { ok: false }
65
80
  if (!resolved.pathname.endsWith('.js')) return { ok: false }
66
- return { ok: true, manifest: { entryUrl: resolved.toString(), version } }
81
+
82
+ // Surfaces are optional and individually validated: anything that is not a
83
+ // same-origin .js URL is dropped rather than failing the whole manifest, so
84
+ // a partially-written pack degrades to the fallback instead of breaking HQ.
85
+ const rawSurfaces = (value as { engine?: { surfaces?: unknown } }).engine?.surfaces
86
+ let surfaces: AgentSimEngineManifest['surfaces']
87
+ if (typeof rawSurfaces === 'object' && rawSurfaces !== null) {
88
+ for (const [name, url] of Object.entries(rawSurfaces as Record<string, unknown>)) {
89
+ if (typeof url !== 'string' || url.length === 0) continue
90
+ try {
91
+ const surfaceUrl = new URL(url, origin)
92
+ if (surfaceUrl.origin !== new URL(origin).origin) continue
93
+ if (!surfaceUrl.pathname.endsWith('.js')) continue
94
+ surfaces ??= {}
95
+ surfaces[name as keyof NonNullable<typeof surfaces>] = surfaceUrl.toString()
96
+ } catch {
97
+ continue
98
+ }
99
+ }
100
+ }
101
+
102
+ return { ok: true, manifest: { entryUrl: resolved.toString(), version, surfaces } }
67
103
  }
68
104
 
69
105
  /**
package/src/index.ts CHANGED
@@ -6,6 +6,7 @@ export {
6
6
  parseAgentSimEngineManifest,
7
7
  OFFICIAL_AGENT_SIM_WEB_HOSTS,
8
8
  type AgentSimEngineManifest,
9
+ type AgentSimEngineSurface,
9
10
  } from './engine'
10
11
  export { hqHomeManifest, hqWorkManifest } from './manifests'
11
12
  export {