super-dsh 0.1.4 → 0.1.5-a

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 (39) hide show
  1. package/README.md +6 -7
  2. package/agent-agy/dist/world-plugin.js +18 -33
  3. package/agent-codex/dist/world-plugin.js +18 -33
  4. package/agent-hermes/dist/world-plugin.js +18 -34
  5. package/agent-omp/dist/world-plugin.js +16 -32
  6. package/agent-pi/dist/world-plugin.js +18 -33
  7. package/client/index.js +2086 -0
  8. package/cordis.patch.yml +21 -7
  9. package/package.json +13 -3
  10. package/superd-hub/dist/agent-roster.d.ts +3 -1
  11. package/superd-hub/dist/agent-roster.js +4 -2
  12. package/superd-hub/dist/carrier.d.ts +41 -28
  13. package/superd-hub/dist/carrier.js +148 -202
  14. package/superd-hub/dist/fusion-transport.d.ts +150 -0
  15. package/superd-hub/dist/fusion-transport.js +369 -0
  16. package/superd-hub/dist/gateway.d.ts +7 -2
  17. package/superd-hub/dist/gateway.js +28 -2
  18. package/superd-hub/dist/hub-route.d.ts +74 -0
  19. package/superd-hub/dist/hub-route.js +188 -0
  20. package/superd-hub/dist/index.d.ts +10 -4
  21. package/superd-hub/dist/index.js +10 -4
  22. package/superd-hub/dist/roster.d.ts +2 -2
  23. package/superd-hub/dist/spawn-world.js +5 -3
  24. package/superd-hub/dist/switch-core.d.ts +630 -0
  25. package/superd-hub/dist/switch-core.js +734 -0
  26. package/superd-hub/dist/web-trust.d.ts +5 -5
  27. package/superd-hub/dist/web-trust.js +5 -5
  28. package/superd-hub/dist/world-entry.d.ts +20 -13
  29. package/superd-hub/dist/world-entry.js +15 -19
  30. package/superd-hub/dist/world-host.d.ts +15 -20
  31. package/superd-hub/dist/world-host.js +25 -4
  32. package/superd-hub/dist/world-join.js +14 -29
  33. package/superd-hub/dist/world-mount.d.ts +48 -26
  34. package/superd-hub/dist/world-mount.js +59 -27
  35. package/superd-hub/dist/world-provision.js +11 -4
  36. package/superd-hub/dist/world-web-server.d.ts +57 -106
  37. package/superd-hub/dist/world-web-server.js +61 -216
  38. package/superd-hub/lib/client/index.js +2086 -0
  39. package/superd-hub/package.json +12 -0
@@ -29,11 +29,11 @@
29
29
  * - config level: `trustedPageAuthorities: []` keeps the row mounted but
30
30
  * injects nothing (fully inert).
31
31
  *
32
- * Composed on BOTH trees: ctx0 through the `super-dsh/web-trust` row (the
33
- * composite bundle's insert list) and every world through the
34
- * `@pgmi-builds/superd-hub/web-trust` row (world mount patches) — world pages
35
- * emit `webserver/index-inject` on their own root, so a ctx0-only listener
36
- * would never reach them.
32
+ * Composed on ctx0 only (since path-separation T-D): the `super-dsh/web-trust`
33
+ * row in the composite bundle's insert list. The per-world row retired with
34
+ * the world pages themselves (T-D disabled the world webui rows — no world
35
+ * page renders, so no world-local injection exists); `/hub` is the sole
36
+ * foreign entry and it serves ctx0's index, which this ctx0 row covers.
37
37
  *
38
38
  * @module @pgmi-builds/superd-hub/web-trust
39
39
  */
@@ -29,11 +29,11 @@
29
29
  * - config level: `trustedPageAuthorities: []` keeps the row mounted but
30
30
  * injects nothing (fully inert).
31
31
  *
32
- * Composed on BOTH trees: ctx0 through the `super-dsh/web-trust` row (the
33
- * composite bundle's insert list) and every world through the
34
- * `@pgmi-builds/superd-hub/web-trust` row (world mount patches) — world pages
35
- * emit `webserver/index-inject` on their own root, so a ctx0-only listener
36
- * would never reach them.
32
+ * Composed on ctx0 only (since path-separation T-D): the `super-dsh/web-trust`
33
+ * row in the composite bundle's insert list. The per-world row retired with
34
+ * the world pages themselves (T-D disabled the world webui rows — no world
35
+ * page renders, so no world-local injection exists); `/hub` is the sole
36
+ * foreign entry and it serves ctx0's index, which this ctx0 row covers.
37
37
  *
38
38
  * @module @pgmi-builds/superd-hub/web-trust
39
39
  */
@@ -2,20 +2,27 @@
2
2
  * World-side mount plugin (AW-B DL1/DL3) — `@pgmi-builds/superd-hub/world`.
3
3
  *
4
4
  * Inserted into the WORLD root's composition (its own process-side root, no
5
- * listener). It provides the virtual `webServer` for that root: every route the
6
- * world's plugins register is translated to `/<label>+path` on ctx0's real
7
- * webServer, so the world's whole web surface lands under its mount with no
8
- * namespace list and no second socket.
5
+ * listener). Since path-separation T-D (2026-09-26, "disable their webui
6
+ * build, just like disable their webserver") it provides the world's whole
7
+ * remaining web-adjacent surface, shrunk to data-plane facts:
9
8
  *
10
- * The RPC channel is NOT the world's: `WorldWebServer` swallows `/api*`, and the
11
- * hub's carrier answers `/<label>/api` + `/<label>/api/remote.mux` in ctx0's
12
- * auth domain, dispatching to this world's gateway instance. Non-envelope
13
- * GET/HEAD traffic on `/<label>/api` is forwarded into the world's registered
14
- * exact Fetch routes (session-log export and friends) through the shared
15
- * `/api` fetch handler this plugin publishes into the cross-root registry
16
- * (`world-host.ts`) — still behind ctx0's fence, never the world's own.
17
-
18
- * auth domain, dispatching to this world's gateway instance.
9
+ * - the VIRTUAL `webServer` — a silent, registration-only shell
10
+ * (`world-web-server.ts`): every route a world plugin declares is
11
+ * accepted and swallowed, so the tree boots exactly as before while
12
+ * nothing is ever served (`/hub` is the sole entry, T-C);
13
+ * - the neutral `webRuntime` values — the ONE leg the disabled `web-runtime`
14
+ * row used to provide that the DATA plane still reads (the `connection`
15
+ * row injects it): loopback bind ⇒ no LAN literals, plus the deploy-level
16
+ * `--trusted-host` extras spawnWorld seeds the tree with (carried here by
17
+ * `worldMountPatches` in the row config).
18
+ *
19
+ * The RPC channel is NOT the world's: the hub's `/hub` family
20
+ * (`hub-route.ts`) answers `?agent=<key>` traffic in ctx0's auth domain,
21
+ * dispatching to this world's gateway instance. Non-envelope GET/HEAD traffic
22
+ * is forwarded into the world's registered exact Fetch routes (session-log
23
+ * export and friends) through the shared `/api` fetch handler this plugin
24
+ * publishes into the cross-root registry (`world-host.ts`) — still behind
25
+ * ctx0's fence, never the world's own.
19
26
  */
20
27
  import type { Context } from '@deepseek-ai/cordis';
21
28
  /** Stable Cordis plugin name. */
@@ -1,5 +1,6 @@
1
1
  import { noteWorldServer, publishWorldFetch, takeHostMount } from './world-host.js';
2
2
  import { WorldWebServer } from './world-web-server.js';
3
+ import { superdTrustedHosts } from './world-mount.js';
3
4
  /** Stable Cordis plugin name. */
4
5
  export const name = 'superd-world-mount';
5
6
  /** Apply the world mount. @param ctx - the WORLD root context. @param config - `{ key }`. */
@@ -14,37 +15,32 @@ export function apply(ctx, config) {
14
15
  ctx.logger?.warn?.(`superd-world-mount: no host mount registered for key ${JSON.stringify(key)}`);
15
16
  return;
16
17
  }
17
- const worldWebServer = new WorldWebServer(mount.labelPath, mount.real, {
18
- onIndexInject: (table) => { ctx.emit('webserver/index-inject', table); },
19
- // One auth domain: the mount, not this world, decides who may read a page.
20
- authorize: (req, res) => mount.authorize?.(req, res) ?? true,
21
- });
18
+ const worldWebServer = new WorldWebServer(mount.labelPath);
22
19
  noteWorldServer(key, worldWebServer);
23
20
  ctx.reflect.provide('webServer', worldWebServer);
24
- // The world's frontend-static still asks ITS OWN connection to authorize an
25
- // index request. That gate is answered by the mount above: the browser came
26
- // in through ctx0, the world is reached in-ctx, and the world's cookie secret
27
- // belongs to its own nested home — so a second check here could only 401 an
28
- // already-authorized read. Neutralize it instead of sharing credentials.
29
- // The same connection also composes the world's `/api` fetch handler (exact
30
- // Fetch routes + the gateway's RPC interceptor). It is published here so the
31
- // hub's carrier can forward non-envelope GET/HEAD traffic on
32
- // `/<label>/api` into the world's registered routes; auth stays in ctx0's
33
- // domain because the carrier fences the request BEFORE this handler runs.
21
+ // The data-plane leg of the disabled `web-runtime` row: the `connection`
22
+ // row injects `webRuntime` (and reads `ctx.webRuntime.trustedHosts` in its
23
+ // config). Same neutral shape as before T-D: a loopback-only bind resolves
24
+ // no LAN literals; the trusted-host extras are the same deploy-level env
25
+ // list `spawnWorld` feeds this tree as `--trusted-host` arguments (one
26
+ // derivation: `superdTrustedHosts`).
27
+ ctx.reflect.provide('webRuntime', { lanAddresses: [], trustedHosts: superdTrustedHosts(process.env.SUPERD_TRUSTED_HOSTS) });
28
+ // The world's `/api` fetch handler (exact Fetch routes + the gateway's RPC
29
+ // interceptor) is published here so the hub's `/hub` family can forward
30
+ // non-envelope GET/HEAD traffic into the world's registered routes; auth
31
+ // stays in ctx0's domain because the family fences the request BEFORE this
32
+ // handler runs. (The world's own index-authorization neutralization is
33
+ // gone with T-D: no world page exists to authorize.)
34
34
  let dropWorldFetch;
35
35
  ctx.inject(['connection'], (webCtx) => {
36
36
  const connection = webCtx.get('connection');
37
37
  if (connection === undefined)
38
38
  return;
39
- if (typeof connection.authorizeIndex === 'function') {
40
- connection.authorizeIndex = () => true;
41
- }
42
39
  if (typeof connection.createSharedFetchHandler === 'function') {
43
40
  dropWorldFetch = publishWorldFetch(key, connection.createSharedFetchHandler('/api'));
44
41
  }
45
42
  });
46
43
  ctx.effect(() => () => {
47
- worldWebServer.dispose();
48
44
  dropWorldFetch?.();
49
45
  }, 'superd-world-mount: virtual webServer');
50
46
  }
@@ -4,32 +4,26 @@
4
4
  * A world runs as its OWN cordis ROOT (events are root-scoped — probe
5
5
  * 2026-09-16), so ctx0 and the world cannot share service instances through
6
6
  * the context tree. They DO share this module (the profile links
7
- * `@pgmi-builds/superd-hub` at the same path), which is where the host hands the
8
- * world everything it needs to mount itself:
7
+ * `@pgmi-builds/superd-hub` at the same path), which is where the host hands
8
+ * the world what it needs to mount itself:
9
9
  *
10
- * ctx0 hub → registerHostMount({ key, labelPath, real }) (before spawn)
10
+ * ctx0 hub → registerHostMount({ key, labelPath }) (before spawn)
11
11
  * world → takeHostMount(key) → provides the virtual `webServer`
12
12
  *
13
+ * T-C (2026-09-26): the `real`/`authorize` legs were RETIRED with the
14
+ * per-label URL family. T-D (2026-09-26) swept the vestiges: the mount record
15
+ * is the world's ADDRESSABILITY entry only (`{ key, labelPath }`) — no ctx0
16
+ * webServer instance, no index gate; the adapter world-plugins' call sites
17
+ * were updated in the same round.
18
+ *
13
19
  * No selection state: the key is the world's own identity, fixed at spawn.
14
20
  */
15
- import type { RealWebServerFace } from './world-web-server.js';
16
- /** What a world needs to mount its surface onto ctx0's real webServer. */
21
+ /** What the host publishes for one world mount (the world's identity record). */
17
22
  export interface HostMount {
18
23
  /** Runtime key (`omp`, `codex`, …) — equals the mount label. */
19
24
  key: string;
20
25
  /** Mount root (`/omp`). */
21
26
  labelPath: string;
22
- /** ctx0's webServer instance (live object, passed across roots). */
23
- real: RealWebServerFace;
24
- /**
25
- * ctx0's index authorization (the SAME gate the native index goes through).
26
- * The mount is the only ingress and answers the world's pages/assets itself,
27
- * so auth is decided in ctx0's domain — by the cookie that authenticated
28
- * `<label>` — and never by the world's own browser-auth gate (a different
29
- * tree, a different secret). Returning false means the authorizer already
30
- * answered (401, or the token→cookie 303).
31
- */
32
- authorize?(req: unknown, res: unknown): boolean;
33
27
  }
34
28
  /** Publish the host side of one world mount (idempotent replace). */
35
29
  export declare function registerHostMount(mount: HostMount): () => void;
@@ -59,10 +53,11 @@ export interface WorldFetchHandler {
59
53
  fetch(request: Request): Promise<Response>;
60
54
  }
61
55
  /**
62
- * Publish one world's shared `/api` fetch handler so the carrier can forward
63
- * non-envelope traffic on `/<label>/api` into the world's registered routes
64
- * (session-log export and friends). Called from inside the world root
65
- * (`world-entry`); read from the host root (`carrier`). Idempotent replace.
56
+ * Publish one world's shared `/api` fetch handler so the hub's `/hub` family
57
+ * can forward non-envelope traffic (`?agent=<label>` GET/HEAD) into the
58
+ * world's registered routes (session-log export and friends). Called from
59
+ * inside the world root (`world-entry`); read from the host root
60
+ * (`carrier`). Idempotent replace.
66
61
  */
67
62
  export declare function publishWorldFetch(key: string, handler: WorldFetchHandler): () => void;
68
63
  /** The world's published shared `/api` fetch handler, if its root published one yet. */
@@ -1,3 +1,23 @@
1
+ /**
2
+ * Cross-root mount registry (AW-B DL1/DL3).
3
+ *
4
+ * A world runs as its OWN cordis ROOT (events are root-scoped — probe
5
+ * 2026-09-16), so ctx0 and the world cannot share service instances through
6
+ * the context tree. They DO share this module (the profile links
7
+ * `@pgmi-builds/superd-hub` at the same path), which is where the host hands
8
+ * the world what it needs to mount itself:
9
+ *
10
+ * ctx0 hub → registerHostMount({ key, labelPath }) (before spawn)
11
+ * world → takeHostMount(key) → provides the virtual `webServer`
12
+ *
13
+ * T-C (2026-09-26): the `real`/`authorize` legs were RETIRED with the
14
+ * per-label URL family. T-D (2026-09-26) swept the vestiges: the mount record
15
+ * is the world's ADDRESSABILITY entry only (`{ key, labelPath }`) — no ctx0
16
+ * webServer instance, no index gate; the adapter world-plugins' call sites
17
+ * were updated in the same round.
18
+ *
19
+ * No selection state: the key is the world's own identity, fixed at spawn.
20
+ */
1
21
  const mounts = new Map();
2
22
  /** Publish the host side of one world mount (idempotent replace). */
3
23
  export function registerHostMount(mount) {
@@ -26,10 +46,11 @@ export function listHostMounts() {
26
46
  }
27
47
  const worldFetchHandlers = new Map();
28
48
  /**
29
- * Publish one world's shared `/api` fetch handler so the carrier can forward
30
- * non-envelope traffic on `/<label>/api` into the world's registered routes
31
- * (session-log export and friends). Called from inside the world root
32
- * (`world-entry`); read from the host root (`carrier`). Idempotent replace.
49
+ * Publish one world's shared `/api` fetch handler so the hub's `/hub` family
50
+ * can forward non-envelope traffic (`?agent=<label>` GET/HEAD) into the
51
+ * world's registered routes (session-log export and friends). Called from
52
+ * inside the world root (`world-entry`); read from the host root
53
+ * (`carrier`). Idempotent replace.
33
54
  */
34
55
  export function publishWorldFetch(key, handler) {
35
56
  worldFetchHandlers.set(key, handler);
@@ -9,14 +9,18 @@
9
9
  * adapter's `/world` entry is deliberately inert and is joined HERE).
10
10
  *
11
11
  * 1. roster membership (activation IS membership, spec S2);
12
- * 2. ctx0 publishes the host mount (real webServer instance) before spawn;
12
+ * 2. ctx0 publishes the host mount record — the world's addressability
13
+ * entry only since T-D (no webServer instance, no fence: those legs
14
+ * retired with the world pages);
13
15
  * 3. `spawnWorld` boots the sibling ROOT from the world's own nested home
14
16
  * (`<home>/agents/<key>/profiles/web` — provisioned here via
15
17
  * `provisionWorldProfile`, or by the line bootstrap when the adapter
16
18
  * package is not resolvable from this module), with the world mount
17
- * patches (no listener, virtual webServer);
18
- * 4. the world's gateway becomes a foreign target; the carrier answers
19
- * `/<key>/api` + `/<key>/api/remote.mux` in ctx0's auth domain.
19
+ * patches (no listener, no webui rows — T-D);
20
+ * 4. the world's gateway becomes a foreign target; the hub's `/hub` family
21
+ * answers `?agent=<key>` traffic in ctx0's auth domain (T-C: the
22
+ * per-label `/<key>/api` + `/<key>/api/remote.mux` mounts are retired —
23
+ * `/hub` is the sole entry).
20
24
  *
21
25
  * Cordis identifies a plugin by its module, so ONE joiner row per tree — a
22
26
  * second joined world needs either its own adapter-side plugin (omp/codex
@@ -33,7 +37,6 @@ import { registerForeignTarget } from './targets.js';
33
37
  import { spawnWorld } from './spawn-world.js';
34
38
  import { provisionWorldProfile, resolveInstallAnchor } from './world-provision.js';
35
39
  import { registerHostMount } from './world-host.js';
36
- import { mountWorld } from './carrier.js';
37
40
  import { worldMountPatches } from './world-mount.js';
38
41
  /** Stable Cordis plugin name. */
39
42
  export const name = 'superd-join';
@@ -63,22 +66,10 @@ export function apply(ctx, config) {
63
66
  worldHome,
64
67
  });
65
68
  const world = (async () => {
66
- // Wait for ctx0's listening stack: the mount needs the real webServer and
67
- // the browser-trust fence from the live connection service.
68
- const host = await new Promise((resolve) => {
69
- ctx.inject(['webServer', 'connection'], (hostCtx) => { resolve(hostCtx); });
70
- });
71
- const real = host['webServer'];
72
- const connection = host['connection'];
73
- const dropHostMount = registerHostMount({
74
- key,
75
- labelPath: `/${key}`,
76
- real,
77
- // ctx0's index gate, applied by the mount to this world's pages and
78
- // assets: the world is reached in-ctx and owns no listener, so ctx0
79
- // decides auth (one auth domain).
80
- authorize: (req, res) => connection.authorizeIndex(req, res),
81
- });
69
+ // T-D: the mount record is addressability only — no ctx0 listening-stack
70
+ // wait, no webServer instance, no authorize leg (the /hub family wires
71
+ // its own gate in ctx0, see gateway.ts).
72
+ const dropHostMount = registerHostMount({ key, labelPath: `/${key}` });
82
73
  const ctxW = await spawnWorld({
83
74
  appName: `superd-${key}`,
84
75
  profileName: 'web',
@@ -93,16 +84,10 @@ export function apply(ctx, config) {
93
84
  });
94
85
  const gateway = ctxW.get('typertGateway');
95
86
  registerForeignTarget({ key, gateway });
96
- const mounted = mountWorld({
97
- real,
98
- label: key,
99
- gateway,
100
- requestRejection: (request) => connection
101
- .requestRejection(request),
102
- });
87
+ // T-C: no per-label mount anymore — the gateway above is the world's
88
+ // whole ingress, reached through the /hub family's `?agent=<key>` demux.
103
89
  setReady(key, true);
104
90
  ctx.effect?.(() => () => {
105
- mounted.dispose();
106
91
  dropHostMount();
107
92
  }, `superd-join: ${key} mount`);
108
93
  return ctxW;
@@ -1,19 +1,37 @@
1
1
  /**
2
- * World composition patches for the mount (AW-B DL1/DL3).
2
+ * World composition patches for the mount (AW-B DL1/DL3 → path-separation T-D).
3
3
  *
4
- * A mounted world runs with NO listener and provides the virtual webServer
5
- * from `<pkg>/world`. Three patches make that composition work:
6
- *
7
- * 1. `webserver` disabled — the world owns no socket; ctx0's listener is
8
- * the only ingress.
9
- * 2. `modules` inject webServer — client-modules probes
10
- * `ctx.get('webServer')` WITHOUT declaring the dependency
11
- * (`client/modules/src/index.ts:576`), so without this patch its row
12
- * activates before the provider exists and boot fails. Patching the row's
13
- * `inject` makes cordis WAIT for the provider, order-independent.
14
- * 3. insert the world mount row — provides the virtual webServer inside the
15
- * world root and translates every route its plugins declare.
4
+ * A mounted world is a PURE DATA PLANE: no listener (it never had a socket)
5
+ * and since T-D no webui composition either ("disable their webui build, just
6
+ * like disable their webserver" — 2026-09-26 user ruling). The rows that gave
7
+ * the world tree its own web surface are DISABLED here:
16
8
  *
9
+ * 1. `webserver` disabled — the world owns no socket; ctx0's listener is
10
+ * the only ingress (pre-T-D posture, kept).
11
+ * 2. `hmr` disabled — a world's composition is a spawn-time fact;
12
+ * the profile-hmr reload chain must never arm.
13
+ * 3. `web-runtime` disabled — the web-app glue row: it mounted the
14
+ * frontend-static fallback owner over the
15
+ * virtual server, printed the URL line, opened
16
+ * the browser, and registered the web-surface
17
+ * prompt section. Its ONE data-plane leg — the
18
+ * `webRuntime` values the `connection` row
19
+ * injects — moved into the world mount row
20
+ * (neutral facts, see `world-entry.ts`).
21
+ * 4. `client-hmr` disabled — the client-plugin reload chain; nothing ever
22
+ * loads a world page to reload.
23
+ * 5. `modules` still waits — the client-modules row (and any other row
24
+ * that injects `webServer`) binds against the
25
+ * VIRTUAL per-world server the mount row
26
+ * provides; the virtual server swallows every
27
+ * registration (T-C), so the tree boots
28
+ * unchanged while nothing is ever served.
29
+ * 6. insert the world rows — the mount row (virtual `webServer` + neutral
30
+ * `webRuntime` provider) and the HUB row (the
31
+ * `/api/agent-runtime` face /hub can reach
32
+ * through the world's own data plane). The
33
+ * world page-trust row is GONE (T-D): its only
34
+ * consumer was the world page.
17
35
  * Patch layers are plain data: the patch engine applies arbitrary entry
18
36
  * overrides (`vendor/include/src/index.ts:77-121`).
19
37
  */
@@ -25,10 +43,13 @@ export declare const WORLD_MOUNT_PLUGIN = "@pgmi-builds/superd-hub/world";
25
43
  export declare const WORLD_HUB_ROW_ID = "superd-hub";
26
44
  /** Plugin name of the hub itself — one UI, one roster, every runtime. */
27
45
  export declare const WORLD_HUB_PLUGIN = "@pgmi-builds/superd-hub";
28
- /** Id of the inserted page-trust row (world trees; ctx0 composes its own). */
29
- export declare const WORLD_WEB_TRUST_ROW_ID = "superd-web-trust";
30
- /** Page-trust component subpath — world pages emit index-inject on their own root. */
31
- export declare const WORLD_WEB_TRUST_PLUGIN = "@pgmi-builds/superd-hub/web-trust";
46
+ /**
47
+ * Parse the deploy-level trusted-authority list the world's connection fence
48
+ * was seeded with (`SUPERD_TRUSTED_HOSTS`, whitespace/comma separated) — the
49
+ * same values `spawnWorld` feeds the world tree as `--trusted-host` extras.
50
+ * Shared so the fence facts keep a single derivation.
51
+ */
52
+ export declare function superdTrustedHosts(value: string | undefined): string[];
32
53
  /** One patch layer understood by the loader (structural; no app-boot import). */
33
54
  export type WorldPatchLayer = {
34
55
  id: string;
@@ -43,17 +64,18 @@ export type WorldPatchLayer = {
43
64
  }>;
44
65
  };
45
66
  /**
46
- * The layers that turn a listener-owning world into a mounted one:
67
+ * The layers that turn a listener-owning world into a mounted, webui-less
68
+ * data plane:
47
69
  *
48
70
  * 1. `webserver` off — the world owns no socket (the hub serves its face);
49
- * 2. `modules` waits for the virtual `webServer` the entry row provides;
50
- * 3. the entry row itself (the world's mount identity);
51
- * 4. the HUB ROW — the same `@pgmi-builds/superd-hub` native ctx0 composes, so
52
- * the foreign agent gets the *identical* selector UI, and the roster it
53
- * renders is read from the hub over the world's own `/api` channel;
54
- * 5. the PAGE-TRUST row — the same component ctx0 composes through the
55
- * composite bundle, so a trusted non-loopback page (Caddy domain / LAN
56
- * IP) keeps its loopback-equivalent verdict in the WORLD's UI too.
71
+ * 2. `hmr` off — the composition is a spawn-time fact;
72
+ * 3. `web-runtime` off — no frontend-static mount, no URL line, no browser
73
+ * handoff, no web-surface prompt (T-D; its `webRuntime` provider moved
74
+ * into the mount row);
75
+ * 4. `client-hmr` off — no client reload chain (T-D);
76
+ * 5. `modules` waits for the virtual `webServer` the mount row provides;
77
+ * 6. the world rows: the mount (virtual `webServer` + neutral `webRuntime`)
78
+ * and the hub (`/api/agent-runtime` face on the world's data plane).
57
79
  * @param key - runtime key (`omp`, `codex`, …) — the mount label.
58
80
  * @returns patch layers to append to the world's composition.
59
81
  */
@@ -1,19 +1,37 @@
1
1
  /**
2
- * World composition patches for the mount (AW-B DL1/DL3).
2
+ * World composition patches for the mount (AW-B DL1/DL3 → path-separation T-D).
3
3
  *
4
- * A mounted world runs with NO listener and provides the virtual webServer
5
- * from `<pkg>/world`. Three patches make that composition work:
6
- *
7
- * 1. `webserver` disabled — the world owns no socket; ctx0's listener is
8
- * the only ingress.
9
- * 2. `modules` inject webServer — client-modules probes
10
- * `ctx.get('webServer')` WITHOUT declaring the dependency
11
- * (`client/modules/src/index.ts:576`), so without this patch its row
12
- * activates before the provider exists and boot fails. Patching the row's
13
- * `inject` makes cordis WAIT for the provider, order-independent.
14
- * 3. insert the world mount row — provides the virtual webServer inside the
15
- * world root and translates every route its plugins declare.
4
+ * A mounted world is a PURE DATA PLANE: no listener (it never had a socket)
5
+ * and since T-D no webui composition either ("disable their webui build, just
6
+ * like disable their webserver" — 2026-09-26 user ruling). The rows that gave
7
+ * the world tree its own web surface are DISABLED here:
16
8
  *
9
+ * 1. `webserver` disabled — the world owns no socket; ctx0's listener is
10
+ * the only ingress (pre-T-D posture, kept).
11
+ * 2. `hmr` disabled — a world's composition is a spawn-time fact;
12
+ * the profile-hmr reload chain must never arm.
13
+ * 3. `web-runtime` disabled — the web-app glue row: it mounted the
14
+ * frontend-static fallback owner over the
15
+ * virtual server, printed the URL line, opened
16
+ * the browser, and registered the web-surface
17
+ * prompt section. Its ONE data-plane leg — the
18
+ * `webRuntime` values the `connection` row
19
+ * injects — moved into the world mount row
20
+ * (neutral facts, see `world-entry.ts`).
21
+ * 4. `client-hmr` disabled — the client-plugin reload chain; nothing ever
22
+ * loads a world page to reload.
23
+ * 5. `modules` still waits — the client-modules row (and any other row
24
+ * that injects `webServer`) binds against the
25
+ * VIRTUAL per-world server the mount row
26
+ * provides; the virtual server swallows every
27
+ * registration (T-C), so the tree boots
28
+ * unchanged while nothing is ever served.
29
+ * 6. insert the world rows — the mount row (virtual `webServer` + neutral
30
+ * `webRuntime` provider) and the HUB row (the
31
+ * `/api/agent-runtime` face /hub can reach
32
+ * through the world's own data plane). The
33
+ * world page-trust row is GONE (T-D): its only
34
+ * consumer was the world page.
17
35
  * Patch layers are plain data: the patch engine applies arbitrary entry
18
36
  * overrides (`vendor/include/src/index.ts:77-121`).
19
37
  */
@@ -25,22 +43,28 @@ export const WORLD_MOUNT_PLUGIN = '@pgmi-builds/superd-hub/world';
25
43
  export const WORLD_HUB_ROW_ID = 'superd-hub';
26
44
  /** Plugin name of the hub itself — one UI, one roster, every runtime. */
27
45
  export const WORLD_HUB_PLUGIN = '@pgmi-builds/superd-hub';
28
- /** Id of the inserted page-trust row (world trees; ctx0 composes its own). */
29
- export const WORLD_WEB_TRUST_ROW_ID = 'superd-web-trust';
30
- /** Page-trust component subpath — world pages emit index-inject on their own root. */
31
- export const WORLD_WEB_TRUST_PLUGIN = '@pgmi-builds/superd-hub/web-trust';
32
46
  /**
33
- * The layers that turn a listener-owning world into a mounted one:
47
+ * Parse the deploy-level trusted-authority list the world's connection fence
48
+ * was seeded with (`SUPERD_TRUSTED_HOSTS`, whitespace/comma separated) — the
49
+ * same values `spawnWorld` feeds the world tree as `--trusted-host` extras.
50
+ * Shared so the fence facts keep a single derivation.
51
+ */
52
+ export function superdTrustedHosts(value) {
53
+ return (value ?? '').split(/[\s,]+/).filter(Boolean);
54
+ }
55
+ /**
56
+ * The layers that turn a listener-owning world into a mounted, webui-less
57
+ * data plane:
34
58
  *
35
59
  * 1. `webserver` off — the world owns no socket (the hub serves its face);
36
- * 2. `modules` waits for the virtual `webServer` the entry row provides;
37
- * 3. the entry row itself (the world's mount identity);
38
- * 4. the HUB ROW — the same `@pgmi-builds/superd-hub` native ctx0 composes, so
39
- * the foreign agent gets the *identical* selector UI, and the roster it
40
- * renders is read from the hub over the world's own `/api` channel;
41
- * 5. the PAGE-TRUST row — the same component ctx0 composes through the
42
- * composite bundle, so a trusted non-loopback page (Caddy domain / LAN
43
- * IP) keeps its loopback-equivalent verdict in the WORLD's UI too.
60
+ * 2. `hmr` off — the composition is a spawn-time fact;
61
+ * 3. `web-runtime` off — no frontend-static mount, no URL line, no browser
62
+ * handoff, no web-surface prompt (T-D; its `webRuntime` provider moved
63
+ * into the mount row);
64
+ * 4. `client-hmr` off — no client reload chain (T-D);
65
+ * 5. `modules` waits for the virtual `webServer` the mount row provides;
66
+ * 6. the world rows: the mount (virtual `webServer` + neutral `webRuntime`)
67
+ * and the hub (`/api/agent-runtime` face on the world's data plane).
44
68
  * @param key - runtime key (`omp`, `codex`, …) — the mount label.
45
69
  * @returns patch layers to append to the world's composition.
46
70
  */
@@ -63,11 +87,19 @@ export function worldMountPatches(key) {
63
87
  // worldMountPatches (webserver re-enabled on 3080, world rows gone).
64
88
  // Worlds must stay hmr-less: their composition is a spawn-time fact.
65
89
  { id: 'hmr', disabled: true },
90
+ // T-D (2026-09-26): the world webui rows off. The `web-runtime` row is the
91
+ // web-app glue that mounted frontend-static over the virtual server and
92
+ // announced a URL nobody can reach (`/hub` is the sole entry); the world
93
+ // keeps only its data plane. Its `webRuntime` provider — the ONE
94
+ // data-plane leg (the `connection` row injects it) — is re-provided by the
95
+ // mount row with the same neutral facts (loopback bind ⇒ no LAN
96
+ // literals; the deploy-level trusted-host extras ride along).
97
+ { id: 'web-runtime', disabled: true },
98
+ { id: 'client-hmr', disabled: true },
66
99
  { id: 'modules', inject: ['webServer'] },
67
100
  { insert: [
68
101
  { id: WORLD_MOUNT_ROW_ID, name: WORLD_MOUNT_PLUGIN, config: { key } },
69
102
  { id: WORLD_HUB_ROW_ID, name: WORLD_HUB_PLUGIN },
70
- { id: WORLD_WEB_TRUST_ROW_ID, name: WORLD_WEB_TRUST_PLUGIN },
71
103
  ] },
72
104
  ];
73
105
  }
@@ -148,10 +148,11 @@ function provisionWorldProfileUnchecked(opts) {
148
148
  //
149
149
  // 0.1.7: the profile hmr row arms itself wherever a profileContext exists,
150
150
  // and its config reload recomposes the tree from THE PROFILE LAYERS ALONE —
151
- // spawn-time extraPatches do not survive it. The zero-listener posture is
152
- // therefore PERSISTED in this layer (webserver disabled + ephemeral port,
153
- // hmr itself off — a world's composition is a spawn-time fact and must not
154
- // be re-derived), exactly mirroring worldMountPatches.
151
+ // spawn-time extraPatches do not survive it. The world posture is therefore
152
+ // PERSISTED in this layer (webserver disabled + ephemeral port, hmr itself
153
+ // off, and — T-D — the webui rows `web-runtime`/`client-hmr` off: a world's
154
+ // composition is a spawn-time fact and must not be re-derived), exactly
155
+ // mirroring worldMountPatches.
155
156
  writeFileSync(join(profDir, 'cordis.patch.yml'), [
156
157
  '# Per-world home pinning (dshHomePath is this tree\'s nested home).',
157
158
  ...['settings', 'credentials', 'attachment-local', 'shell-env', 'skill-filesystem'].flatMap((id) => [`- id: ${id}`, ' config:', ' dshHome: !!js dshHomePath()']),
@@ -164,6 +165,12 @@ function provisionWorldProfileUnchecked(opts) {
164
165
  ' port: 0',
165
166
  '- id: hmr',
166
167
  ' disabled: true',
168
+ '# Webui-less posture (T-D): the world page rows stay off across any',
169
+ '# recomposition — worlds are pure data planes, `/hub` is the sole entry.',
170
+ '- id: web-runtime',
171
+ ' disabled: true',
172
+ '- id: client-hmr',
173
+ ' disabled: true',
167
174
  '',
168
175
  ].join('\n'));
169
176
  // @pgmi-builds links, plugin-add shape: adapter + hub into the world