@volter/world-host 2.0.54 → 3.0.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/src/cli.js +3 -3
- package/dist/src/twins-host.js +2 -2
- package/package.json +7 -7
- package/src/cli.ts +3 -3
- package/src/twins-host.test.ts +3 -3
- package/src/twins-host.ts +2 -2
package/dist/src/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// volter-host — worlds under one URL (see twins-host.ts).
|
|
3
3
|
//
|
|
4
|
-
// volter-host serve --dir <worlds> [--host H] [--port P] [--url <origin reached at>] [--console-port C] [--console-url <console origin reached at; same site as --url, or its
|
|
4
|
+
// volter-host serve --dir <worlds> [--host H] [--port P] [--url <origin reached at>] [--console-port C] [--console-url <console origin reached at; same site as --url, or its screen links are refused>] [--trust <platform origin>]… [--world-origins <domain>]
|
|
5
5
|
//
|
|
6
6
|
// `<dir>/<org>/<world>/` is a bare world (`volter world init --bare <org>/<world>`). Each world's
|
|
7
7
|
// token is in its own `.volter/token`; each world's serve record names this host's URL. The admin
|
|
@@ -16,7 +16,7 @@ const values = (flag) => rest.flatMap((a, i) => (a === flag && rest[i + 1] ? [re
|
|
|
16
16
|
if (cmd === 'serve') {
|
|
17
17
|
const dir = value('--dir');
|
|
18
18
|
if (!dir) {
|
|
19
|
-
process.stderr.write('volter-host serve --dir <worlds> [--host H] [--port P] [--url <origin reached at>] [--console-port C] [--console-url <console origin reached at; same site as --url, or its
|
|
19
|
+
process.stderr.write('volter-host serve --dir <worlds> [--host H] [--port P] [--url <origin reached at>] [--console-port C] [--console-url <console origin reached at; same site as --url, or its screen links are refused>] [--trust <platform origin>]… [--world-origins <domain>]\n');
|
|
20
20
|
process.exit(2);
|
|
21
21
|
}
|
|
22
22
|
// the console mounts when it is installed beside the host; a host without it serves the doors alone
|
|
@@ -36,6 +36,6 @@ if (cmd === 'serve') {
|
|
|
36
36
|
process.on('SIGINT', shutdown);
|
|
37
37
|
}
|
|
38
38
|
else {
|
|
39
|
-
process.stderr.write('usage: volter-host serve --dir <worlds> [--host H] [--port P] [--url <origin reached at>] [--console-port C] [--console-url <console origin reached at; same site as --url, or its
|
|
39
|
+
process.stderr.write('usage: volter-host serve --dir <worlds> [--host H] [--port P] [--url <origin reached at>] [--console-port C] [--console-url <console origin reached at; same site as --url, or its screen links are refused>]\n');
|
|
40
40
|
process.exit(2);
|
|
41
41
|
}
|
package/dist/src/twins-host.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
// Nothing of the vendor lives here — no arms, no keys, no folds: the host is the shell; the kernel
|
|
16
16
|
// serves. The v1 host (namespaces, links, the push flip, the R2 shell) left with v1.
|
|
17
17
|
import { chmodSync, existsSync, mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
18
|
-
import { assertStateRemovable, serveHttp, stateDirName, withAncestryLock, withStateRemoval } from '@volter/world-core';
|
|
18
|
+
import { assertStateRemovable, serveHttp, stateDirName, withAncestryLock, withStateRemoval } from '@volter/world-core/runtime';
|
|
19
19
|
import { dirname, join, resolve } from 'node:path';
|
|
20
20
|
import { assertWorldStateRemovable, resolveCatalog, CONSOLE_BASE, consoleRedirect, initWorld, LocalBranches, loadWorldConfig, localWorldOrigin, mountWorld, pathOfWorld, worldOriginLabel, serveConsoleApart, worldDoorUnderConsole, TOKEN_HEADER, worldOfHost } from '@volter/world-runtime';
|
|
21
21
|
import { issuerKeys, trustableIssuer } from '@volter/world-access';
|
|
@@ -279,7 +279,7 @@ export async function createWorldHost(options) {
|
|
|
279
279
|
return json({ error: `no world at ${at.host}` }, 404);
|
|
280
280
|
if (own && !pathOfWorld(path, own, CONSOLE_BASE))
|
|
281
281
|
return json({ error: `this origin serves ${own} only` }, 404);
|
|
282
|
-
// the console's pages of a World live at the World's own origin, beside its session and its
|
|
282
|
+
// the console's pages of a World live at the World's own origin, beside its session and its vendors' screens
|
|
283
283
|
// (the console's home, the list of Worlds, lives at the console's own origin: consoleRedirect below)
|
|
284
284
|
// a World named console/<world> keeps its doors (/-/console/<world>/…): they are never the console's pages
|
|
285
285
|
const worldDoor = worldDoorUnderConsole(path, (n) => byServed.has(n), CONSOLE_BASE);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volter/world-host",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
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",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
15
|
-
"url": "git+https://github.com/volter-ai/twin.git",
|
|
15
|
+
"url": "git+https://github.com/volter-ai/twin-world.git",
|
|
16
16
|
"directory": "packages/world-host"
|
|
17
17
|
},
|
|
18
18
|
"type": "module",
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
"postpack": "node ../../scripts/publish/prepare-publish.mjs postpack"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@volter/world-access": "
|
|
30
|
-
"@volter/world-core": "
|
|
31
|
-
"@volter/world-runtime": "
|
|
29
|
+
"@volter/world-access": "3.0.1",
|
|
30
|
+
"@volter/world-core": "3.0.1",
|
|
31
|
+
"@volter/world-runtime": "3.0.1"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@volter/world-console": "
|
|
34
|
+
"@volter/world-console": "3.0.1"
|
|
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": "
|
|
42
|
+
"@volter/world-console": "3.0.1"
|
|
43
43
|
},
|
|
44
44
|
"exports": {
|
|
45
45
|
".": {
|
package/src/cli.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// volter-host — worlds under one URL (see twins-host.ts).
|
|
3
3
|
//
|
|
4
|
-
// volter-host serve --dir <worlds> [--host H] [--port P] [--url <origin reached at>] [--console-port C] [--console-url <console origin reached at; same site as --url, or its
|
|
4
|
+
// volter-host serve --dir <worlds> [--host H] [--port P] [--url <origin reached at>] [--console-port C] [--console-url <console origin reached at; same site as --url, or its screen links are refused>] [--trust <platform origin>]… [--world-origins <domain>]
|
|
5
5
|
//
|
|
6
6
|
// `<dir>/<org>/<world>/` is a bare world (`volter world init --bare <org>/<world>`). Each world's
|
|
7
7
|
// token is in its own `.volter/token`; each world's serve record names this host's URL. The admin
|
|
@@ -17,7 +17,7 @@ const values = (flag: string): string[] => rest.flatMap((a, i) => (a === flag &&
|
|
|
17
17
|
|
|
18
18
|
if (cmd === 'serve') {
|
|
19
19
|
const dir = value('--dir');
|
|
20
|
-
if (!dir) { process.stderr.write('volter-host serve --dir <worlds> [--host H] [--port P] [--url <origin reached at>] [--console-port C] [--console-url <console origin reached at; same site as --url, or its
|
|
20
|
+
if (!dir) { process.stderr.write('volter-host serve --dir <worlds> [--host H] [--port P] [--url <origin reached at>] [--console-port C] [--console-url <console origin reached at; same site as --url, or its screen links are refused>] [--trust <platform origin>]… [--world-origins <domain>]\n'); process.exit(2); }
|
|
21
21
|
// the console mounts when it is installed beside the host; a host without it serves the doors alone
|
|
22
22
|
const console = await (async (): Promise<ConsoleMount | undefined> => {
|
|
23
23
|
try { const mod = await import('@volter/world-console') as { createConsole: () => ConsoleMount }; return mod.createConsole(); } catch { return undefined; }
|
|
@@ -27,6 +27,6 @@ if (cmd === 'serve') {
|
|
|
27
27
|
const shutdown = async () => { await host.stop(); process.exit(0); };
|
|
28
28
|
process.on('SIGTERM', shutdown); process.on('SIGINT', shutdown);
|
|
29
29
|
} else {
|
|
30
|
-
process.stderr.write('usage: volter-host serve --dir <worlds> [--host H] [--port P] [--url <origin reached at>] [--console-port C] [--console-url <console origin reached at; same site as --url, or its
|
|
30
|
+
process.stderr.write('usage: volter-host serve --dir <worlds> [--host H] [--port P] [--url <origin reached at>] [--console-port C] [--console-url <console origin reached at; same site as --url, or its screen links are refused>]\n');
|
|
31
31
|
process.exit(2);
|
|
32
32
|
}
|
package/src/twins-host.test.ts
CHANGED
|
@@ -5,12 +5,12 @@ import { mkdirSync, mkdtempSync, readdirSync, readFileSync, rmSync, existsSync,
|
|
|
5
5
|
import { tmpdir } from 'node:os';
|
|
6
6
|
import { join, resolve } from 'node:path';
|
|
7
7
|
import { spawnSync } from 'node:child_process';
|
|
8
|
-
import { forkTwin, observeResources, readTwinRequestJournal, scrubWorld } from '@volter/world-core';
|
|
8
|
+
import { forkTwin, observeResources, readTwinRequestJournal, scrubWorld } from '@volter/world-core/runtime';
|
|
9
9
|
import { statusWorld } from '@volter/world-runtime';
|
|
10
10
|
import { createWorldHost, worldsUnder, type WorldHostHandle } from './twins-host.ts';
|
|
11
11
|
|
|
12
12
|
const CLI = resolve(import.meta.dir, '..', '..', 'cli', 'src', 'cli.ts');
|
|
13
|
-
const PACKS = resolve(import.meta.dir, '..', '..', 'twin');
|
|
13
|
+
const PACKS = resolve(import.meta.dir, '..', '..', '..', '..', 'twin-packs-p3');
|
|
14
14
|
let dir: string; let host: WorldHostHandle;
|
|
15
15
|
const init = (name: string) => { const root = join(dir, ...name.split('/')); mkdirSync(root, { recursive: true }); const r = spawnSync(process.execPath, [CLI, 'world', 'init', '--bare', name, '--twins', 'github'], { cwd: root, encoding: 'utf8' }); if (r.status !== 0) throw new Error(r.stderr); return root; };
|
|
16
16
|
|
|
@@ -66,7 +66,7 @@ describe("the hosted product's doors", () => {
|
|
|
66
66
|
expect(team.base).toBe(`${host.url}/acme/team`);
|
|
67
67
|
expect(team.token).toBe(worldToken('acme/team'));
|
|
68
68
|
expect(team.readToken).toMatch(/^tok_r_/);
|
|
69
|
-
expect(team.twins).toMatchObject([{ vendor: 'github', protocol: { major:
|
|
69
|
+
expect(team.twins).toMatchObject([{ vendor: 'github', protocol: { major: 3 }, root: null }]);
|
|
70
70
|
});
|
|
71
71
|
test('the admin token opens nothing under a world', async () => {
|
|
72
72
|
expect((await fetch(`${host.url}/-/acme/team/log/github`, { headers: A() })).status).toBe(401);
|
package/src/twins-host.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
// Nothing of the vendor lives here — no arms, no keys, no folds: the host is the shell; the kernel
|
|
16
16
|
// serves. The v1 host (namespaces, links, the push flip, the R2 shell) left with v1.
|
|
17
17
|
import { chmodSync, existsSync, mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
18
|
-
import { assertStateRemovable, serveHttp, stateDirName, withAncestryLock, withStateRemoval } from '@volter/world-core';
|
|
18
|
+
import { assertStateRemovable, serveHttp, stateDirName, withAncestryLock, withStateRemoval } from '@volter/world-core/runtime';
|
|
19
19
|
import { dirname, join, resolve } from 'node:path';
|
|
20
20
|
import { assertWorldStateRemovable, resolveCatalog, CONSOLE_BASE, consoleRedirect, initWorld, LocalBranches, loadWorldConfig, localWorldOrigin, mountWorld, pathOfWorld, worldOriginLabel, serveConsoleApart, worldDoorUnderConsole, TOKEN_HEADER, worldOfHost, type ConsoleMount, type MountedWorld } from '@volter/world-runtime';
|
|
21
21
|
|
|
@@ -242,7 +242,7 @@ export async function createWorldHost(options: WorldHostOptions): Promise<WorldH
|
|
|
242
242
|
const own = origins ? worldOfHost(at.hostname, byServed.keys(), originBase) : undefined;
|
|
243
243
|
if (own === null) return json({ error: `no world at ${at.host}` }, 404);
|
|
244
244
|
if (own && !pathOfWorld(path, own, CONSOLE_BASE)) return json({ error: `this origin serves ${own} only` }, 404);
|
|
245
|
-
// the console's pages of a World live at the World's own origin, beside its session and its
|
|
245
|
+
// the console's pages of a World live at the World's own origin, beside its session and its vendors' screens
|
|
246
246
|
// (the console's home, the list of Worlds, lives at the console's own origin: consoleRedirect below)
|
|
247
247
|
// a World named console/<world> keeps its doors (/-/console/<world>/…): they are never the console's pages
|
|
248
248
|
const worldDoor = worldDoorUnderConsole(path, (n) => byServed.has(n), CONSOLE_BASE);
|