@volter/world-host 3.0.8 → 3.0.10

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.
@@ -113,6 +113,8 @@ export async function createWorldHost(options) {
113
113
  const browserOrigin = !origins ? undefined : originBase
114
114
  ? (served) => { const label = worldOriginLabel(served); return label ? `${advertised?.protocol ?? 'https:'}//${label}.${originBase}${advertised?.port ? `:${advertised.port}` : ''}` : null; }
115
115
  : (served) => (port ? localWorldOrigin(served, port) : null);
116
+ // sites are routed only at this machine's loopback origins (the front's siteOfHost)
117
+ const sitesOrigin = origins && !originBase ? (served) => (port ? localWorldOrigin(served, port) : null) : undefined;
116
118
  // one key reader per trusted platform, shared by every World here (each caches its platform's key set)
117
119
  // https only, or http on this machine: keys read over plain http elsewhere could be swapped, and a swapped key forges passes
118
120
  const passIssuers = (options.trust ?? []).map((origin) => {
@@ -126,7 +128,7 @@ export async function createWorldHost(options) {
126
128
  const branches = new LocalBranches({ dir, origin: () => loopback, worlds: byServed, mount: (root) => mount({ name: '', root }), ...(options.announce ? { announce: options.announce } : {}) });
127
129
  const mount = async (w) => {
128
130
  const config = loadWorldConfig(join(w.root, '.volter', 'world.json'), w.root).config;
129
- return mountWorld(config.id, { root: w.root, branches: (served) => branches.doorsFor(served), ...(browserOrigin ? { browserOrigin } : {}), ...(passIssuers.length ? { passIssuers } : {}) });
131
+ return mountWorld(config.id, { root: w.root, branches: (served) => branches.doorsFor(served), ...(browserOrigin ? { browserOrigin } : {}), ...(sitesOrigin ? { sitesOrigin } : {}), ...(passIssuers.length ? { passIssuers } : {}) });
130
132
  };
131
133
  for (const w of found)
132
134
  byServed.set(w.name, await mount(w));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/world-host",
3
- "version": "3.0.8",
3
+ "version": "3.0.10",
4
4
  "description": "The hosted remote: worlds under one URL, each holding the canonical history of a real vendor account and its sealed credential — what a local world clones from and pushes to.",
5
5
  "keywords": [
6
6
  "twin",
@@ -27,11 +27,11 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@volter/world-access": "3.0.1",
30
- "@volter/world-core": "3.0.8",
31
- "@volter/world-runtime": "3.0.8"
30
+ "@volter/world-core": "3.0.10",
31
+ "@volter/world-runtime": "3.0.10"
32
32
  },
33
33
  "peerDependencies": {
34
- "@volter/world-console": "3.0.3"
34
+ "@volter/world-console": "3.0.5"
35
35
  },
36
36
  "peerDependenciesMeta": {
37
37
  "@volter/world-console": {
@@ -39,7 +39,7 @@
39
39
  }
40
40
  },
41
41
  "devDependencies": {
42
- "@volter/world-console": "3.0.3"
42
+ "@volter/world-console": "3.0.5"
43
43
  },
44
44
  "exports": {
45
45
  ".": {
package/src/twins-host.ts CHANGED
@@ -122,6 +122,8 @@ export async function createWorldHost(options: WorldHostOptions): Promise<WorldH
122
122
  const browserOrigin = !origins ? undefined : originBase
123
123
  ? (served: string) => { const label = worldOriginLabel(served); return label ? `${advertised?.protocol ?? 'https:'}//${label}.${originBase}${advertised?.port ? `:${advertised.port}` : ''}` : null; }
124
124
  : (served: string) => (port ? localWorldOrigin(served, port) : null);
125
+ // sites are routed only at this machine's loopback origins (the front's siteOfHost)
126
+ const sitesOrigin = origins && !originBase ? (served: string) => (port ? localWorldOrigin(served, port) : null) : undefined;
125
127
  // one key reader per trusted platform, shared by every World here (each caches its platform's key set)
126
128
  // https only, or http on this machine: keys read over plain http elsewhere could be swapped, and a swapped key forges passes
127
129
  const passIssuers: TrustedIssuer[] = (options.trust ?? []).map((origin) => {
@@ -134,7 +136,7 @@ export async function createWorldHost(options: WorldHostOptions): Promise<WorldH
134
136
  const branches: LocalBranches = new LocalBranches({ dir, origin: () => loopback, worlds: byServed, mount: (root) => mount({ name: '', root }), ...(options.announce ? { announce: options.announce } : {}) });
135
137
  const mount = async (w: { name: string; root: string }): Promise<MountedWorld> => {
136
138
  const config = loadWorldConfig(join(w.root, '.volter', 'world.json'), w.root).config;
137
- return mountWorld(config.id, { root: w.root, branches: (served) => branches.doorsFor(served), ...(browserOrigin ? { browserOrigin } : {}), ...(passIssuers.length ? { passIssuers } : {}) });
139
+ return mountWorld(config.id, { root: w.root, branches: (served) => branches.doorsFor(served), ...(browserOrigin ? { browserOrigin } : {}), ...(sitesOrigin ? { sitesOrigin } : {}), ...(passIssuers.length ? { passIssuers } : {}) });
138
140
  };
139
141
  for (const w of found) byServed.set(w.name, await mount(w));
140
142
  const host = options.host ?? '127.0.0.1';