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.
- package/README.md +6 -7
- package/agent-agy/dist/world-plugin.js +18 -33
- package/agent-codex/dist/world-plugin.js +18 -33
- package/agent-hermes/dist/world-plugin.js +18 -34
- package/agent-omp/dist/world-plugin.js +16 -32
- package/agent-pi/dist/world-plugin.js +18 -33
- package/client/index.js +2086 -0
- package/cordis.patch.yml +21 -7
- package/package.json +13 -3
- package/superd-hub/dist/agent-roster.d.ts +3 -1
- package/superd-hub/dist/agent-roster.js +4 -2
- package/superd-hub/dist/carrier.d.ts +41 -28
- package/superd-hub/dist/carrier.js +148 -202
- package/superd-hub/dist/fusion-transport.d.ts +150 -0
- package/superd-hub/dist/fusion-transport.js +369 -0
- package/superd-hub/dist/gateway.d.ts +7 -2
- package/superd-hub/dist/gateway.js +28 -2
- package/superd-hub/dist/hub-route.d.ts +74 -0
- package/superd-hub/dist/hub-route.js +188 -0
- package/superd-hub/dist/index.d.ts +10 -4
- package/superd-hub/dist/index.js +10 -4
- package/superd-hub/dist/roster.d.ts +2 -2
- package/superd-hub/dist/spawn-world.js +5 -3
- package/superd-hub/dist/switch-core.d.ts +630 -0
- package/superd-hub/dist/switch-core.js +734 -0
- package/superd-hub/dist/web-trust.d.ts +5 -5
- package/superd-hub/dist/web-trust.js +5 -5
- package/superd-hub/dist/world-entry.d.ts +20 -13
- package/superd-hub/dist/world-entry.js +15 -19
- package/superd-hub/dist/world-host.d.ts +15 -20
- package/superd-hub/dist/world-host.js +25 -4
- package/superd-hub/dist/world-join.js +14 -29
- package/superd-hub/dist/world-mount.d.ts +48 -26
- package/superd-hub/dist/world-mount.js +59 -27
- package/superd-hub/dist/world-provision.js +11 -4
- package/superd-hub/dist/world-web-server.d.ts +57 -106
- package/superd-hub/dist/world-web-server.js +61 -216
- package/superd-hub/lib/client/index.js +2086 -0
- package/superd-hub/package.json +12 -0
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# super-dsh — Super D agent hub for the DeepSeek Harness
|
|
2
2
|
|
|
3
3
|
One [DSH](https://www.npmjs.com/package/@deepseek-ai/dsh) plugin that joins local
|
|
4
|
-
foreign-agent runtimes into the DSH Web UI:
|
|
5
|
-
mounted under `/<label>` —
|
|
4
|
+
foreign-agent runtimes into the DSH Web UI: a runtime selector in the sidebar,
|
|
5
|
+
a live roster, and one zero-port world per runtime mounted under `/<label>` —
|
|
6
6
|
same browser shell, same auth domain, per-world session separation.
|
|
7
7
|
|
|
8
8
|
**Owns no runtimes and stores no conversations.** Every adapter keeps its
|
|
@@ -14,12 +14,12 @@ the foreign store.
|
|
|
14
14
|
## Install
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
|
-
dsh plugin --profile <name> add super-dsh@0.1.
|
|
17
|
+
dsh plugin --profile <name> add super-dsh@0.1.0
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
That single package composes the whole line (`@pgmi-builds/superd-hub` plus the
|
|
21
|
-
six `@pgmi-builds/agent-*` packages). Restart the profile and
|
|
22
|
-
provisions its own nested DSH
|
|
21
|
+
six `@pgmi-builds/agent-*` packages). Restart the profile and the
|
|
22
|
+
sidebar gains the runtime selector; each world provisions its own nested DSH
|
|
23
23
|
home under `<DSH_HOME>/agents/<label>/` on first boot.
|
|
24
24
|
|
|
25
25
|
## Runtimes
|
|
@@ -35,8 +35,7 @@ home under `<DSH_HOME>/agents/<label>/` on first boot.
|
|
|
35
35
|
|
|
36
36
|
## Design
|
|
37
37
|
|
|
38
|
-
- **S1**
|
|
39
|
-
path; the dispatcher never addresses sessions.
|
|
38
|
+
- **S1** selector handoff is one hop; the dispatcher never addresses sessions.
|
|
40
39
|
- **S2** activation is roster membership; worlds spawn as sibling roots
|
|
41
40
|
(`boot()` on the CTX0 tree), never through `runProfile()`.
|
|
42
41
|
- **S3/S7** `<DSH_HOME>/agents/<runtime>/` is that runtime's whole world; native
|
|
@@ -2,21 +2,26 @@
|
|
|
2
2
|
* agent-agy — the Antigravity (agy) adapter's WORLD plugin (spec S2):
|
|
3
3
|
* activation IS roster membership.
|
|
4
4
|
*
|
|
5
|
-
* AW-B
|
|
6
|
-
* and `@pgmi-builds/agent-codex/world` so the
|
|
7
|
-
* runtime through one shape: the world is spawned as a
|
|
8
|
-
* with NO listener
|
|
5
|
+
* AW-B data-plane shape (DL1–DL5 → path-separation T-D), mirroring
|
|
6
|
+
* `@pgmi-builds/agent-omp/world` and `@pgmi-builds/agent-codex/world` so the
|
|
7
|
+
* hub sees every foreign runtime through one shape: the world is spawned as a
|
|
8
|
+
* sibling ROOT context with NO listener and NO webui composition
|
|
9
|
+
* (`worldMountPatches`) — a pure data plane behind the hub's `/hub` family.
|
|
9
10
|
*
|
|
10
|
-
* 1. ctx0 publishes the host mount (
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
11
|
+
* 1. ctx0 publishes the host mount record (the world's addressability
|
|
12
|
+
* entry — no webServer, no fence: those legs retired with the world
|
|
13
|
+
* pages) before spawn;
|
|
14
|
+
* 2. the world's entry row provides the virtual `webServer` (a silent
|
|
15
|
+
* sink) plus the neutral `webRuntime` facts its connection row injects;
|
|
16
|
+
* 3. the hub's `/hub` family answers `?agent=agy` traffic in ctx0's auth
|
|
17
|
+
* domain and dispatches into this world's gateway instance (the
|
|
18
|
+
* per-label `/<label>/api` + `/<label>/api/remote.mux` mounts retired
|
|
19
|
+
* in T-C, `mountWorld` deleted in T-D).
|
|
15
20
|
*/
|
|
16
21
|
import { mkdirSync } from 'node:fs';
|
|
17
22
|
import { resolveDshHome } from '@deepseek-ai/dsh-home-paths';
|
|
18
23
|
import { join } from 'node:path';
|
|
19
|
-
import { spawnWorld, registerAgent, setReady, registerForeignTarget, registerHostMount,
|
|
24
|
+
import { spawnWorld, registerAgent, setReady, registerForeignTarget, registerHostMount, worldMountPatches, provisionWorldProfile, resolveInstallAnchor, } from '../../superd-hub/dist/index.js';
|
|
20
25
|
export const name = 'agent-agy';
|
|
21
26
|
/** Runtime key — also the mount label. */
|
|
22
27
|
const KEY = 'agy';
|
|
@@ -40,21 +45,9 @@ export function apply(ctx) {
|
|
|
40
45
|
worldHome,
|
|
41
46
|
});
|
|
42
47
|
const world = (async () => {
|
|
43
|
-
//
|
|
44
|
-
// the
|
|
45
|
-
const
|
|
46
|
-
ctx.inject(['webServer', 'connection'], (hostCtx) => { resolve(hostCtx); });
|
|
47
|
-
});
|
|
48
|
-
const real = host['webServer'];
|
|
49
|
-
const connection = host['connection'];
|
|
50
|
-
const dropHostMount = registerHostMount({
|
|
51
|
-
key: KEY,
|
|
52
|
-
labelPath: `/${KEY}`,
|
|
53
|
-
real,
|
|
54
|
-
// ctx0's index gate, applied by the mount to this world's pages and assets:
|
|
55
|
-
// the world is reached in-ctx and owns no listener, so ctx0 decides auth.
|
|
56
|
-
authorize: (req, res) => connection.authorizeIndex(req, res),
|
|
57
|
-
});
|
|
48
|
+
// T-D: no ctx0 listening-stack wait — the mount record is addressability
|
|
49
|
+
// only and the /hub family wires its own gate in ctx0 (gateway.ts).
|
|
50
|
+
const dropHostMount = registerHostMount({ key: KEY, labelPath: `/${KEY}` });
|
|
58
51
|
const ctxW = await spawnWorld({
|
|
59
52
|
appName: `superd-${KEY}`,
|
|
60
53
|
profileName: 'web',
|
|
@@ -69,16 +62,8 @@ export function apply(ctx) {
|
|
|
69
62
|
});
|
|
70
63
|
const gateway = ctxW.get('typertGateway');
|
|
71
64
|
registerForeignTarget({ key: KEY, gateway });
|
|
72
|
-
const mounted = mountWorld({
|
|
73
|
-
real,
|
|
74
|
-
label: KEY,
|
|
75
|
-
gateway,
|
|
76
|
-
requestRejection: (request) => connection
|
|
77
|
-
.requestRejection(request),
|
|
78
|
-
});
|
|
79
65
|
setReady(KEY, true);
|
|
80
66
|
ctx.effect?.(() => () => {
|
|
81
|
-
mounted.dispose();
|
|
82
67
|
dropHostMount();
|
|
83
68
|
}, `agent-${KEY}: mount`);
|
|
84
69
|
return ctxW;
|
|
@@ -2,21 +2,26 @@
|
|
|
2
2
|
* agent-codex — the Codex adapter's WORLD plugin (spec S2):
|
|
3
3
|
* activation IS roster membership.
|
|
4
4
|
*
|
|
5
|
-
* AW-B
|
|
6
|
-
* so the hub sees both foreign runtimes through
|
|
7
|
-
* as a sibling ROOT context with NO listener
|
|
8
|
-
*
|
|
5
|
+
* AW-B data-plane shape (DL1–DL5 → path-separation T-D), mirroring
|
|
6
|
+
* `@pgmi-builds/agent-omp/world` so the hub sees both foreign runtimes through
|
|
7
|
+
* one shape: the world is spawned as a sibling ROOT context with NO listener
|
|
8
|
+
* and NO webui composition (`worldMountPatches`) — a pure data plane behind
|
|
9
|
+
* the hub's `/hub` family —
|
|
9
10
|
*
|
|
10
|
-
* 1. ctx0 publishes the host mount (
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
11
|
+
* 1. ctx0 publishes the host mount record (the world's addressability
|
|
12
|
+
* entry — no webServer, no fence: those legs retired with the world
|
|
13
|
+
* pages) before spawn;
|
|
14
|
+
* 2. the world's entry row provides the virtual `webServer` (a silent
|
|
15
|
+
* sink) plus the neutral `webRuntime` facts its connection row injects;
|
|
16
|
+
* 3. the hub's `/hub` family answers `?agent=codex` traffic in ctx0's auth
|
|
17
|
+
* domain and dispatches into this world's gateway instance (the
|
|
18
|
+
* per-label `/<label>/api` + `/<label>/api/remote.mux` mounts retired
|
|
19
|
+
* in T-C, `mountWorld` deleted in T-D).
|
|
15
20
|
*/
|
|
16
21
|
import { mkdirSync } from 'node:fs';
|
|
17
22
|
import { resolveDshHome } from '@deepseek-ai/dsh-home-paths';
|
|
18
23
|
import { join } from 'node:path';
|
|
19
|
-
import { spawnWorld, registerAgent, setReady, registerForeignTarget, registerHostMount,
|
|
24
|
+
import { spawnWorld, registerAgent, setReady, registerForeignTarget, registerHostMount, worldMountPatches, provisionWorldProfile, resolveInstallAnchor, } from '../../superd-hub/dist/index.js';
|
|
20
25
|
export const name = 'agent-codex';
|
|
21
26
|
/** Runtime key — also the mount label. */
|
|
22
27
|
const KEY = 'codex';
|
|
@@ -39,21 +44,9 @@ export function apply(ctx) {
|
|
|
39
44
|
worldHome,
|
|
40
45
|
});
|
|
41
46
|
const world = (async () => {
|
|
42
|
-
//
|
|
43
|
-
// the
|
|
44
|
-
const
|
|
45
|
-
ctx.inject(['webServer', 'connection'], (hostCtx) => { resolve(hostCtx); });
|
|
46
|
-
});
|
|
47
|
-
const real = host['webServer'];
|
|
48
|
-
const connection = host['connection'];
|
|
49
|
-
const dropHostMount = registerHostMount({
|
|
50
|
-
key: KEY,
|
|
51
|
-
labelPath: `/${KEY}`,
|
|
52
|
-
real,
|
|
53
|
-
// ctx0's index gate, applied by the mount to this world's pages and assets:
|
|
54
|
-
// the world is reached in-ctx and owns no listener, so ctx0 decides auth.
|
|
55
|
-
authorize: (req, res) => connection.authorizeIndex(req, res),
|
|
56
|
-
});
|
|
47
|
+
// T-D: no ctx0 listening-stack wait — the mount record is addressability
|
|
48
|
+
// only and the /hub family wires its own gate in ctx0 (gateway.ts).
|
|
49
|
+
const dropHostMount = registerHostMount({ key: KEY, labelPath: `/${KEY}` });
|
|
57
50
|
const ctxW = await spawnWorld({
|
|
58
51
|
appName: `superd-${KEY}`,
|
|
59
52
|
profileName: 'web',
|
|
@@ -68,16 +61,8 @@ export function apply(ctx) {
|
|
|
68
61
|
});
|
|
69
62
|
const gateway = ctxW.get('typertGateway');
|
|
70
63
|
registerForeignTarget({ key: KEY, gateway });
|
|
71
|
-
const mounted = mountWorld({
|
|
72
|
-
real,
|
|
73
|
-
label: KEY,
|
|
74
|
-
gateway,
|
|
75
|
-
requestRejection: (request) => connection
|
|
76
|
-
.requestRejection(request),
|
|
77
|
-
});
|
|
78
64
|
setReady(KEY, true);
|
|
79
65
|
ctx.effect?.(() => () => {
|
|
80
|
-
mounted.dispose();
|
|
81
66
|
dropHostMount();
|
|
82
67
|
}, `agent-${KEY}: mount`);
|
|
83
68
|
return ctxW;
|
|
@@ -2,22 +2,26 @@
|
|
|
2
2
|
* agent-hermes — the Hermes adapter's WORLD plugin (spec S2):
|
|
3
3
|
* activation IS roster membership.
|
|
4
4
|
*
|
|
5
|
-
* AW-B
|
|
6
|
-
* and `@pgmi-builds/agent-codex/world` so the
|
|
7
|
-
* runtime through one shape: the world is spawned as a
|
|
8
|
-
* with NO listener
|
|
9
|
-
*
|
|
5
|
+
* AW-B data-plane shape (DL1–DL5 → path-separation T-D), mirroring
|
|
6
|
+
* `@pgmi-builds/agent-omp/world` and `@pgmi-builds/agent-codex/world` so the
|
|
7
|
+
* hub sees every foreign runtime through one shape: the world is spawned as a
|
|
8
|
+
* sibling ROOT context with NO listener and NO webui composition
|
|
9
|
+
* (`worldMountPatches`) — a pure data plane behind the hub's `/hub` family —
|
|
10
10
|
*
|
|
11
|
-
* 1. ctx0 publishes the host mount (
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
11
|
+
* 1. ctx0 publishes the host mount record (the world's addressability
|
|
12
|
+
* entry — no webServer, no fence: those legs retired with the world
|
|
13
|
+
* pages) before spawn;
|
|
14
|
+
* 2. the world's entry row provides the virtual `webServer` (a silent
|
|
15
|
+
* sink) plus the neutral `webRuntime` facts its connection row injects;
|
|
16
|
+
* 3. the hub's `/hub` family answers `?agent=hermes` traffic in ctx0's auth
|
|
17
|
+
* domain and dispatches into this world's gateway instance (the
|
|
18
|
+
* per-label `/<label>/api` + `/<label>/api/remote.mux` mounts retired
|
|
19
|
+
* in T-C, `mountWorld` deleted in T-D).
|
|
16
20
|
*/
|
|
17
21
|
import { mkdirSync } from 'node:fs';
|
|
18
22
|
import { resolveDshHome } from '@deepseek-ai/dsh-home-paths';
|
|
19
23
|
import { join } from 'node:path';
|
|
20
|
-
import { spawnWorld, registerAgent, setReady, registerForeignTarget, registerHostMount,
|
|
24
|
+
import { spawnWorld, registerAgent, setReady, registerForeignTarget, registerHostMount, worldMountPatches, provisionWorldProfile, resolveInstallAnchor, } from '../../superd-hub/dist/index.js';
|
|
21
25
|
export const name = 'agent-hermes';
|
|
22
26
|
/** Runtime key — also the mount label. */
|
|
23
27
|
const KEY = 'hermes';
|
|
@@ -44,21 +48,9 @@ export function apply(ctx) {
|
|
|
44
48
|
worldHome,
|
|
45
49
|
});
|
|
46
50
|
const world = (async () => {
|
|
47
|
-
//
|
|
48
|
-
// the
|
|
49
|
-
const
|
|
50
|
-
ctx.inject(['webServer', 'connection'], (hostCtx) => { resolve(hostCtx); });
|
|
51
|
-
});
|
|
52
|
-
const real = host['webServer'];
|
|
53
|
-
const connection = host['connection'];
|
|
54
|
-
const dropHostMount = registerHostMount({
|
|
55
|
-
key: KEY,
|
|
56
|
-
labelPath: `/${KEY}`,
|
|
57
|
-
real,
|
|
58
|
-
// ctx0's index gate, applied by the mount to this world's pages and assets:
|
|
59
|
-
// the world is reached in-ctx and owns no listener, so ctx0 decides auth.
|
|
60
|
-
authorize: (req, res) => connection.authorizeIndex(req, res),
|
|
61
|
-
});
|
|
51
|
+
// T-D: no ctx0 listening-stack wait — the mount record is addressability
|
|
52
|
+
// only and the /hub family wires its own gate in ctx0 (gateway.ts).
|
|
53
|
+
const dropHostMount = registerHostMount({ key: KEY, labelPath: `/${KEY}` });
|
|
62
54
|
const ctxW = await spawnWorld({
|
|
63
55
|
appName: `superd-${KEY}`,
|
|
64
56
|
profileName: 'web',
|
|
@@ -73,16 +65,8 @@ export function apply(ctx) {
|
|
|
73
65
|
});
|
|
74
66
|
const gateway = ctxW.get('typertGateway');
|
|
75
67
|
registerForeignTarget({ key: KEY, gateway });
|
|
76
|
-
const mounted = mountWorld({
|
|
77
|
-
real,
|
|
78
|
-
label: KEY,
|
|
79
|
-
gateway,
|
|
80
|
-
requestRejection: (request) => connection
|
|
81
|
-
.requestRejection(request),
|
|
82
|
-
});
|
|
83
68
|
setReady(KEY, true);
|
|
84
69
|
ctx.effect?.(() => () => {
|
|
85
|
-
mounted.dispose();
|
|
86
70
|
dropHostMount();
|
|
87
71
|
}, `agent-${KEY}: mount`);
|
|
88
72
|
return ctxW;
|
|
@@ -2,20 +2,24 @@
|
|
|
2
2
|
* agent-omp — the adapter's world plugin (spec S2): activation IS
|
|
3
3
|
* roster membership.
|
|
4
4
|
*
|
|
5
|
-
* AW-B (DL1–DL5): the world is spawned as a sibling
|
|
6
|
-
*
|
|
7
|
-
* the hub:
|
|
5
|
+
* AW-B (DL1–DL5) → path-separation T-D: the world is spawned as a sibling
|
|
6
|
+
* ROOT context with NO listener and NO webui composition (see
|
|
7
|
+
* `worldMountPatches`) — a pure data plane behind the hub's `/hub` family:
|
|
8
8
|
*
|
|
9
|
-
* 1. ctx0 publishes the host mount (
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
9
|
+
* 1. ctx0 publishes the host mount record (the world's addressability
|
|
10
|
+
* entry — no webServer, no fence: those legs retired with the world
|
|
11
|
+
* pages) before spawn.
|
|
12
|
+
* 2. the world's entry row provides the virtual `webServer` (a silent
|
|
13
|
+
* sink) plus the neutral `webRuntime` facts its connection row injects.
|
|
14
|
+
* 3. the hub's `/hub` family answers `?agent=omp` traffic in ctx0's auth
|
|
15
|
+
* domain and dispatches into this world's gateway instance (the
|
|
16
|
+
* per-label `/<label>/api` + `/<label>/api/remote.mux` mounts retired
|
|
17
|
+
* in T-C, `mountWorld` deleted in T-D).
|
|
14
18
|
*/
|
|
15
19
|
import { mkdirSync } from 'node:fs';
|
|
16
20
|
import { resolveDshHome } from '@deepseek-ai/dsh-home-paths';
|
|
17
21
|
import { join } from 'node:path';
|
|
18
|
-
import { spawnWorld, registerAgent, setReady, registerForeignTarget, registerHostMount,
|
|
22
|
+
import { spawnWorld, registerAgent, setReady, registerForeignTarget, registerHostMount, worldMountPatches, provisionWorldProfile, resolveInstallAnchor, } from '../../superd-hub/dist/index.js';
|
|
19
23
|
export const name = 'agent-omp';
|
|
20
24
|
/** Runtime key — also the mount label. */
|
|
21
25
|
const KEY = 'omp';
|
|
@@ -39,21 +43,9 @@ export function apply(ctx) {
|
|
|
39
43
|
worldHome,
|
|
40
44
|
});
|
|
41
45
|
const world = (async () => {
|
|
42
|
-
//
|
|
43
|
-
// the
|
|
44
|
-
const
|
|
45
|
-
ctx.inject(['webServer', 'connection'], (hostCtx) => { resolve(hostCtx); });
|
|
46
|
-
});
|
|
47
|
-
const real = host['webServer'];
|
|
48
|
-
const connection = host['connection'];
|
|
49
|
-
const dropHostMount = registerHostMount({
|
|
50
|
-
key: KEY,
|
|
51
|
-
labelPath: `/${KEY}`,
|
|
52
|
-
real,
|
|
53
|
-
// ctx0's index gate, applied by the mount to this world's pages and assets:
|
|
54
|
-
// the world is reached in-ctx and owns no listener, so ctx0 decides auth.
|
|
55
|
-
authorize: (req, res) => connection.authorizeIndex(req, res),
|
|
56
|
-
});
|
|
46
|
+
// T-D: no ctx0 listening-stack wait — the mount record is addressability
|
|
47
|
+
// only and the /hub family wires its own gate in ctx0 (gateway.ts).
|
|
48
|
+
const dropHostMount = registerHostMount({ key: KEY, labelPath: `/${KEY}` });
|
|
57
49
|
const ctxW = await spawnWorld({
|
|
58
50
|
appName: `superd-${KEY}`,
|
|
59
51
|
profileName: 'web',
|
|
@@ -68,16 +60,8 @@ export function apply(ctx) {
|
|
|
68
60
|
});
|
|
69
61
|
const gateway = ctxW.get('typertGateway');
|
|
70
62
|
registerForeignTarget({ key: KEY, gateway });
|
|
71
|
-
const mounted = mountWorld({
|
|
72
|
-
real,
|
|
73
|
-
label: KEY,
|
|
74
|
-
gateway,
|
|
75
|
-
requestRejection: (request) => connection
|
|
76
|
-
.requestRejection(request),
|
|
77
|
-
});
|
|
78
63
|
setReady(KEY, true);
|
|
79
64
|
ctx.effect?.(() => () => {
|
|
80
|
-
mounted.dispose();
|
|
81
65
|
dropHostMount();
|
|
82
66
|
}, `agent-${KEY}: mount`);
|
|
83
67
|
return ctxW;
|
|
@@ -2,21 +2,26 @@
|
|
|
2
2
|
* agent-pi — the Pi adapter's WORLD plugin (spec S2):
|
|
3
3
|
* activation IS roster membership.
|
|
4
4
|
*
|
|
5
|
-
* AW-B
|
|
6
|
-
* and `@pgmi-builds/agent-codex/world` so the
|
|
7
|
-
* runtime through one shape: the world is spawned as a
|
|
8
|
-
* with NO listener
|
|
5
|
+
* AW-B data-plane shape (DL1–DL5 → path-separation T-D), mirroring
|
|
6
|
+
* `@pgmi-builds/agent-omp/world` and `@pgmi-builds/agent-codex/world` so the
|
|
7
|
+
* hub sees every foreign runtime through one shape: the world is spawned as a
|
|
8
|
+
* sibling ROOT context with NO listener and NO webui composition
|
|
9
|
+
* (`worldMountPatches`) — a pure data plane behind the hub's `/hub` family.
|
|
9
10
|
*
|
|
10
|
-
* 1. ctx0 publishes the host mount (
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
11
|
+
* 1. ctx0 publishes the host mount record (the world's addressability
|
|
12
|
+
* entry — no webServer, no fence: those legs retired with the world
|
|
13
|
+
* pages) before spawn;
|
|
14
|
+
* 2. the world's entry row provides the virtual `webServer` (a silent
|
|
15
|
+
* sink) plus the neutral `webRuntime` facts its connection row injects;
|
|
16
|
+
* 3. the hub's `/hub` family answers `?agent=pi` traffic in ctx0's auth
|
|
17
|
+
* domain and dispatches into this world's gateway instance (the
|
|
18
|
+
* per-label `/<label>/api` + `/<label>/api/remote.mux` mounts retired
|
|
19
|
+
* in T-C, `mountWorld` deleted in T-D).
|
|
15
20
|
*/
|
|
16
21
|
import { mkdirSync } from 'node:fs';
|
|
17
22
|
import { resolveDshHome } from '@deepseek-ai/dsh-home-paths';
|
|
18
23
|
import { join } from 'node:path';
|
|
19
|
-
import { spawnWorld, registerAgent, setReady, registerForeignTarget, registerHostMount,
|
|
24
|
+
import { spawnWorld, registerAgent, setReady, registerForeignTarget, registerHostMount, worldMountPatches, provisionWorldProfile, resolveInstallAnchor, } from '../../superd-hub/dist/index.js';
|
|
20
25
|
export const name = 'agent-pi';
|
|
21
26
|
/** Runtime key — also the mount label. */
|
|
22
27
|
const KEY = 'pi';
|
|
@@ -40,21 +45,9 @@ export function apply(ctx) {
|
|
|
40
45
|
worldHome,
|
|
41
46
|
});
|
|
42
47
|
const world = (async () => {
|
|
43
|
-
//
|
|
44
|
-
// the
|
|
45
|
-
const
|
|
46
|
-
ctx.inject(['webServer', 'connection'], (hostCtx) => { resolve(hostCtx); });
|
|
47
|
-
});
|
|
48
|
-
const real = host['webServer'];
|
|
49
|
-
const connection = host['connection'];
|
|
50
|
-
const dropHostMount = registerHostMount({
|
|
51
|
-
key: KEY,
|
|
52
|
-
labelPath: `/${KEY}`,
|
|
53
|
-
real,
|
|
54
|
-
// ctx0's index gate, applied by the mount to this world's pages and assets:
|
|
55
|
-
// the world is reached in-ctx and owns no listener, so ctx0 decides auth.
|
|
56
|
-
authorize: (req, res) => connection.authorizeIndex(req, res),
|
|
57
|
-
});
|
|
48
|
+
// T-D: no ctx0 listening-stack wait — the mount record is addressability
|
|
49
|
+
// only and the /hub family wires its own gate in ctx0 (gateway.ts).
|
|
50
|
+
const dropHostMount = registerHostMount({ key: KEY, labelPath: `/${KEY}` });
|
|
58
51
|
const ctxW = await spawnWorld({
|
|
59
52
|
appName: `superd-${KEY}`,
|
|
60
53
|
profileName: 'web',
|
|
@@ -69,16 +62,8 @@ export function apply(ctx) {
|
|
|
69
62
|
});
|
|
70
63
|
const gateway = ctxW.get('typertGateway');
|
|
71
64
|
registerForeignTarget({ key: KEY, gateway });
|
|
72
|
-
const mounted = mountWorld({
|
|
73
|
-
real,
|
|
74
|
-
label: KEY,
|
|
75
|
-
gateway,
|
|
76
|
-
requestRejection: (request) => connection
|
|
77
|
-
.requestRejection(request),
|
|
78
|
-
});
|
|
79
65
|
setReady(KEY, true);
|
|
80
66
|
ctx.effect?.(() => () => {
|
|
81
|
-
mounted.dispose();
|
|
82
67
|
dropHostMount();
|
|
83
68
|
}, `agent-${KEY}: mount`);
|
|
84
69
|
return ctxW;
|