super-dsh 0.1.1 → 0.1.3-c

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.
@@ -17,6 +17,8 @@ import { basename, dirname, join, resolve } from "node:path";
17
17
  /** Prod homes that must never be resolved into (repo red line). */
18
18
  const PROD_HOMES = [join(homedir(), ".dsh"), join(homedir(), ".superd")];
19
19
  function assertNotProdHome(path, label) {
20
+ if (process.env.SUPERD_DEV_REDLINE !== "1")
21
+ return; // published install: the host dsh home (~/.dsh on consumers) is authoritative — the S3/S7 world layout lives under it. Dev lines set SUPERD_DEV_REDLINE=1 (repo red line: ~/.dsh is Dash prod).
20
22
  if (PROD_HOMES.includes(path) || PROD_HOMES.some((p) => path.startsWith(`${p}/`))) {
21
23
  throw new Error(`agy-sessions: refusing prod home as ${label}: ${path}`);
22
24
  }
@@ -14,6 +14,7 @@
14
14
  * ctx0's auth domain and dispatches into this world's gateway instance.
15
15
  */
16
16
  import { mkdirSync } from 'node:fs';
17
+ import { resolveDshHome } from '@deepseek-ai/dsh-home-paths';
17
18
  import { join } from 'node:path';
18
19
  import { spawnWorld, registerAgent, setReady, registerForeignTarget, registerHostMount, mountWorld, worldMountPatches, provisionWorldProfile, } from '../../agent-hub/dist/index.js';
19
20
  export const name = 'aw.agent-adapter-agy';
@@ -23,7 +24,10 @@ const ANCHOR = process.env.SUPERD_DSH_ANCHOR
23
24
  ?? '/home/u1/.local/lib/node_modules/@deepseek-ai/dsh/package.json';
24
25
  export function apply(ctx) {
25
26
  registerAgent({ key: KEY, label: 'Antigravity', ready: false });
26
- const root = process.env.DSH_HOME ?? join(process.cwd(), '.tests', 'aw');
27
+ // Harness resolver (env ~/.dsh): a consumer install has no DSH_HOME and
28
+ // no cwd contract — deriving the world root from cwd spawns worlds into a
29
+ // garbage tree or throws inside apply() and kills the whole host boot.
30
+ const root = resolveDshHome();
27
31
  // Nested home: the world's DSH data lives INSIDE `agents/<label>` (sessions
28
32
  // / settings / workspaces, and the adapter's dsh-sessions.json mapping).
29
33
  // agy: RUNTIME data lives in the SDK (google-antigravity localharness reads is the native ~/.pi (2026-09-17 ruling) — ~/.gemini read-only). Nothing is
@@ -83,6 +87,11 @@ export function apply(ctx) {
83
87
  dropHostMount();
84
88
  }, `aw.agent-adapter-${KEY}: mount`);
85
89
  return ctxW;
86
- })();
90
+ })().catch((cause) => {
91
+ // A failed world degrades to a not-ready roster row; a rejected provided
92
+ // promise would fail the entire host boot (loader entry apply).
93
+ console.error(`[super-dsh] ${KEY} world failed:`, cause);
94
+ return null;
95
+ });
87
96
  ctx.provide(`aw.world.${KEY}`, world);
88
97
  }
@@ -12,6 +12,8 @@ import { join, resolve } from "node:path";
12
12
  const PROD_HOMES = [join(homedir(), ".dsh"), join(homedir(), ".superd")];
13
13
  /** Refuse any path that resolves into a production DSH home (repo red line). */
14
14
  export function assertNotProdHome(path, label) {
15
+ if (process.env.SUPERD_DEV_REDLINE !== "1")
16
+ return; // published install: the host dsh home (~/.dsh on consumers) is authoritative — the S3/S7 world layout lives under it. Dev lines set SUPERD_DEV_REDLINE=1 (repo red line: ~/.dsh is Dash prod).
15
17
  const p = resolve(path);
16
18
  if (PROD_HOMES.includes(p) || PROD_HOMES.some((prod) => p.startsWith(`${prod}/`))) {
17
19
  throw new Error(`agent-claude: refusing prod home "${p}" for ${label} — set DSH_HOME to the test home`);
@@ -22,6 +22,8 @@ import { join, resolve } from "node:path";
22
22
  /** Prod homes that must never be resolved into (repo red line). */
23
23
  const PROD_HOMES = [join(homedir(), ".dsh"), join(homedir(), ".superd")];
24
24
  export function assertNotProdHome(path, label) {
25
+ if (process.env.SUPERD_DEV_REDLINE !== "1")
26
+ return; // published install: the host dsh home (~/.dsh on consumers) is authoritative — the S3/S7 world layout lives under it. Dev lines set SUPERD_DEV_REDLINE=1 (repo red line: ~/.dsh is Dash prod).
25
27
  if (PROD_HOMES.includes(path) || PROD_HOMES.some((p) => path.startsWith(`${p}/`))) {
26
28
  throw new Error(`codex-store: refusing prod home as ${label}: ${path}`);
27
29
  }
@@ -14,6 +14,7 @@
14
14
  * ctx0's auth domain and dispatches into this world's gateway instance.
15
15
  */
16
16
  import { mkdirSync } from 'node:fs';
17
+ import { resolveDshHome } from '@deepseek-ai/dsh-home-paths';
17
18
  import { join } from 'node:path';
18
19
  import { spawnWorld, registerAgent, setReady, registerForeignTarget, registerHostMount, mountWorld, worldMountPatches, provisionWorldProfile, } from '../../agent-hub/dist/index.js';
19
20
  export const name = 'aw.agent-adapter-codex';
@@ -23,7 +24,10 @@ const ANCHOR = process.env.SUPERD_DSH_ANCHOR
23
24
  ?? '/home/u1/.local/lib/node_modules/@deepseek-ai/dsh/package.json';
24
25
  export function apply(ctx) {
25
26
  registerAgent({ key: KEY, label: 'Codex', ready: false });
26
- const root = process.env.DSH_HOME ?? join(process.cwd(), '.tests', 'aw');
27
+ // Harness resolver (env ~/.dsh): a consumer install has no DSH_HOME and
28
+ // no cwd contract — deriving the world root from cwd spawns worlds into a
29
+ // garbage tree or throws inside apply() and kills the whole host boot.
30
+ const root = resolveDshHome();
27
31
  // S7 nested home: every runtime owns one root under `agents/<label>`; the
28
32
  // world's DSH data lives INSIDE it (sessions / settings / workspaces) and the
29
33
  // foreign app's own store (`.codex`) sits in the same root.
@@ -82,6 +86,11 @@ export function apply(ctx) {
82
86
  dropHostMount();
83
87
  }, `aw.agent-adapter-${KEY}: mount`);
84
88
  return ctxW;
85
- })();
89
+ })().catch((cause) => {
90
+ // A failed world degrades to a not-ready roster row; a rejected provided
91
+ // promise would fail the entire host boot (loader entry apply).
92
+ console.error(`[super-dsh] ${KEY} world failed:`, cause);
93
+ return null;
94
+ });
86
95
  ctx.provide(`aw.world.${KEY}`, world);
87
96
  }
@@ -24,6 +24,8 @@ import { basename, dirname, join, resolve } from "node:path";
24
24
  /** Prod homes that must never be resolved into (repo red line). */
25
25
  const PROD_HOMES = [join(homedir(), ".dsh"), join(homedir(), ".superd")];
26
26
  function assertNotProdHome(path, label) {
27
+ if (process.env.SUPERD_DEV_REDLINE !== "1")
28
+ return; // published install: the host dsh home (~/.dsh on consumers) is authoritative — the S3/S7 world layout lives under it. Dev lines set SUPERD_DEV_REDLINE=1 (repo red line: ~/.dsh is Dash prod).
27
29
  if (PROD_HOMES.includes(path) || PROD_HOMES.some((p) => path.startsWith(`${p}/`))) {
28
30
  throw new Error(`hermes-store: refusing prod home as ${label}: ${path}`);
29
31
  }
@@ -15,6 +15,7 @@
15
15
  * ctx0's auth domain and dispatches into this world's gateway instance.
16
16
  */
17
17
  import { mkdirSync } from 'node:fs';
18
+ import { resolveDshHome } from '@deepseek-ai/dsh-home-paths';
18
19
  import { join } from 'node:path';
19
20
  import { spawnWorld, registerAgent, setReady, registerForeignTarget, registerHostMount, mountWorld, worldMountPatches, provisionWorldProfile, } from '../../agent-hub/dist/index.js';
20
21
  export const name = 'aw.agent-adapter-hermes';
@@ -24,7 +25,10 @@ const ANCHOR = process.env.SUPERD_DSH_ANCHOR
24
25
  ?? '/home/u1/.local/lib/node_modules/@deepseek-ai/dsh/package.json';
25
26
  export function apply(ctx) {
26
27
  registerAgent({ key: KEY, label: 'Hermes', ready: false });
27
- const root = process.env.DSH_HOME ?? join(process.cwd(), '.tests', 'aw');
28
+ // Harness resolver (env ~/.dsh): a consumer install has no DSH_HOME and
29
+ // no cwd contract — deriving the world root from cwd spawns worlds into a
30
+ // garbage tree or throws inside apply() and kills the whole host boot.
31
+ const root = resolveDshHome();
28
32
  // S7 nested home: every runtime owns one root under `agents/<label>`; this
29
33
  // directory is the WORLD's DSH home (spawnWorld home/dataHome) — DSH-side
30
34
  // world data (sessions / settings / workspaces) and the adapter's identity
@@ -87,6 +91,11 @@ export function apply(ctx) {
87
91
  dropHostMount();
88
92
  }, `aw.agent-adapter-${KEY}: mount`);
89
93
  return ctxW;
90
- })();
94
+ })().catch((cause) => {
95
+ // A failed world degrades to a not-ready roster row; a rejected provided
96
+ // promise would fail the entire host boot (loader entry apply).
97
+ console.error(`[super-dsh] ${KEY} world failed:`, cause);
98
+ return null;
99
+ });
91
100
  ctx.provide(`aw.world.${KEY}`, world);
92
101
  }
@@ -26,6 +26,7 @@
26
26
  * registers and mounts what that profile composes.
27
27
  */
28
28
  import { mkdirSync } from 'node:fs';
29
+ import { resolveDshHome } from '@deepseek-ai/dsh-home-paths';
29
30
  import { join } from 'node:path';
30
31
  import { registerAgent, setReady } from './roster.js';
31
32
  import { registerForeignTarget } from './targets.js';
@@ -50,7 +51,10 @@ export function apply(ctx, config) {
50
51
  // S7 nested home: the world's whole tree lives under `agents/<key>` (its
51
52
  // profiles were provisioned there by the line bootstrap; DSH data lands
52
53
  // inside the same root via spawnWorld's dataHome override).
53
- const root = process.env.DSH_HOME ?? join(process.cwd(), '.tests', 'aw');
54
+ // Harness resolver (env ~/.dsh): a consumer install has no DSH_HOME and
55
+ // no cwd contract — deriving the world root from cwd spawns worlds into a
56
+ // garbage tree or throws inside apply() and kills the whole host boot.
57
+ const root = resolveDshHome();
54
58
  const worldHome = join(root, 'agents', key);
55
59
  mkdirSync(join(worldHome, 'profiles'), { recursive: true });
56
60
  // Publish story: a foreign install has no line bootstrap, so the nested
@@ -107,7 +111,12 @@ export function apply(ctx, config) {
107
111
  dropHostMount();
108
112
  }, `aw.world.join: ${key} mount`);
109
113
  return ctxW;
110
- })();
114
+ })().catch((cause) => {
115
+ // A failed world degrades to a not-ready roster row; a rejected provided
116
+ // promise would fail the entire host boot (loader entry apply).
117
+ console.error(`[super-dsh] ${key} world failed:`, cause);
118
+ return null;
119
+ });
111
120
  ctx.provide(`aw.world.${key}`, world);
112
121
  }
113
122
  export default apply;
@@ -12,5 +12,9 @@ export interface ProvisionWorldOptions {
12
12
  * Provision one world's nested profile (idempotent: rewrites profile files,
13
13
  * re-links packages — lstat-safe against dangling links). Returns the
14
14
  * `bareModuleBaseUrl` for {@link spawnWorld}, or null when unresolvable.
15
+ *
16
+ * Never throws: any provisioning failure is logged and returns null so the
17
+ * calling world plugin degrades to a not-ready roster row instead of failing
18
+ * the loader entry — a failed apply would take down the whole host boot.
15
19
  */
16
20
  export declare function provisionWorldProfile(opts: ProvisionWorldOptions): string | null;
@@ -32,10 +32,10 @@
32
32
  * or null when the adapter sibling does not exist next to the hub (a foreign
33
33
  * composition this module does not own — keep the caller's env/fallback path).
34
34
  */
35
- import { existsSync, lstatSync, mkdirSync, rmSync, symlinkSync, writeFileSync } from 'node:fs';
35
+ import { existsSync, lstatSync, mkdirSync, readdirSync, rmSync, symlinkSync, writeFileSync } from 'node:fs';
36
36
  import { dirname, join } from 'node:path';
37
37
  import { fileURLToPath } from 'node:url';
38
- import { createRequire } from 'node:module';
38
+ import { resolveDshHome } from '@deepseek-ai/dsh-home-paths';
39
39
  const HUB_SCOPE = '@pgmi-builds';
40
40
  const HARNESS_SCOPE = '@deepseek-ai';
41
41
  /** The profile bundles every world tree composes besides its adapter. */
@@ -44,8 +44,21 @@ const WORLD_BASE_BUNDLES = ['@deepseek-ai/dsh-base', '@deepseek-ai/dsh-web-app']
44
44
  * Provision one world's nested profile (idempotent: rewrites profile files,
45
45
  * re-links packages — lstat-safe against dangling links). Returns the
46
46
  * `bareModuleBaseUrl` for {@link spawnWorld}, or null when unresolvable.
47
+ *
48
+ * Never throws: any provisioning failure is logged and returns null so the
49
+ * calling world plugin degrades to a not-ready roster row instead of failing
50
+ * the loader entry — a failed apply would take down the whole host boot.
47
51
  */
48
52
  export function provisionWorldProfile(opts) {
53
+ try {
54
+ return provisionWorldProfileUnchecked(opts);
55
+ }
56
+ catch (cause) {
57
+ console.error(`[super-dsh] provisioning world '${opts.key}' failed:`, cause);
58
+ return null;
59
+ }
60
+ }
61
+ function provisionWorldProfileUnchecked(opts) {
49
62
  // Single-pack topology: this module lives at `<line>/agent-hub/dist/`, and
50
63
  // every adapter is a SIBLING directory (`<line>/agent-<key>`) — the same
51
64
  // layout in the repo (dev link: lines) and inside the published `super-dsh`
@@ -90,20 +103,33 @@ export function provisionWorldProfile(opts) {
90
103
  rmSync(dst, { recursive: true, force: true });
91
104
  symlinkSync(target, dst);
92
105
  }
93
- // The harness scope rides along as ONE scope-level link into the first
94
- // `@deepseek-ai` directory visible from this module (the shared heal farm
95
- // in a dsh home, the repo farm in dev) every `@deepseek-ai/*` row of the
96
- // world composition resolves through it without farming per package.
97
- for (const searchPath of createRequire(import.meta.url).resolve.paths(`${HARNESS_SCOPE}/x`) ?? []) {
98
- const scopeDir = join(searchPath, HARNESS_SCOPE);
99
- if (!existsSync(scopeDir))
106
+ // The harness scope for the world tree is a REAL scope directory of
107
+ // per-package symlinks UNIONED from two authoritative sources (farm first,
108
+ // installation fills the gaps dev3 evidence: farm 244 entries missing 16
109
+ // newer packages the install's 260 has; ctx0 survives via the app-boot
110
+ // install-anchored resolver fallback, but a tree with an explicit bare
111
+ // base gets no such fallback). A single scope-level link cannot express
112
+ // that union, and a resolve.paths() walk from this module can pick the
113
+ // PROFILE's own partial pnpm scope (2 entries on dev3) — never use it.
114
+ const ANCHOR = process.env.SUPERD_DSH_ANCHOR
115
+ ?? '/home/u1/.local/lib/node_modules/@deepseek-ai/dsh/package.json';
116
+ const scopeSources = [
117
+ join(resolveDshHome(), 'profiles', 'node_modules', HARNESS_SCOPE),
118
+ join(dirname(ANCHOR), 'node_modules', HARNESS_SCOPE),
119
+ ];
120
+ const scopeDst = join(linkRoot, HARNESS_SCOPE);
121
+ rmSync(scopeDst, { recursive: true, force: true });
122
+ mkdirSync(scopeDst, { recursive: true });
123
+ const linked = new Set();
124
+ for (const scopeSrc of scopeSources) {
125
+ if (!existsSync(scopeSrc))
100
126
  continue;
101
- const dst = join(linkRoot, HARNESS_SCOPE);
102
- const st = lstatSync(dst, { throwIfNoEntry: false });
103
- if (st)
104
- rmSync(dst, { recursive: true, force: true });
105
- symlinkSync(scopeDir, dst);
106
- break;
127
+ for (const name of readdirSync(scopeSrc)) {
128
+ if (name.startsWith('.') || linked.has(name))
129
+ continue;
130
+ symlinkSync(join(scopeSrc, name), join(scopeDst, name));
131
+ linked.add(name);
132
+ }
107
133
  }
108
134
  return join(opts.worldHome, 'profiles', 'node_modules') + '/';
109
135
  }
@@ -13,6 +13,7 @@
13
13
  * ctx0's auth domain and dispatches into this world's gateway instance.
14
14
  */
15
15
  import { mkdirSync } from 'node:fs';
16
+ import { resolveDshHome } from '@deepseek-ai/dsh-home-paths';
16
17
  import { join } from 'node:path';
17
18
  import { spawnWorld, registerAgent, setReady, registerForeignTarget, registerHostMount, mountWorld, worldMountPatches, provisionWorldProfile, } from '../../agent-hub/dist/index.js';
18
19
  export const name = 'aw.agent-adapter-omp';
@@ -22,7 +23,10 @@ const ANCHOR = process.env.SUPERD_DSH_ANCHOR
22
23
  ?? '/home/u1/.local/lib/node_modules/@deepseek-ai/dsh/package.json';
23
24
  export function apply(ctx) {
24
25
  registerAgent({ key: KEY, label: 'OMP', ready: false });
25
- const root = process.env.DSH_HOME ?? join(process.cwd(), '.tests', 'aw');
26
+ // Harness resolver (env ~/.dsh): a consumer install has no DSH_HOME and
27
+ // no cwd contract — deriving the world root from cwd spawns worlds into a
28
+ // garbage tree or throws inside apply() and kills the whole host boot.
29
+ const root = resolveDshHome();
26
30
  // S7 nested home: every runtime owns one root under `agents/<label>`, and the
27
31
  // world's DSH data lives INSIDE it (sessions / settings / workspaces), so no
28
32
  // two runtimes ever share a session list. The foreign app's own store sits in
@@ -82,6 +86,11 @@ export function apply(ctx) {
82
86
  dropHostMount();
83
87
  }, `aw.agent-adapter-${KEY}: mount`);
84
88
  return ctxW;
85
- })();
89
+ })().catch((cause) => {
90
+ // A failed world degrades to a not-ready roster row; a rejected provided
91
+ // promise would fail the entire host boot (loader entry apply).
92
+ console.error(`[super-dsh] ${KEY} world failed:`, cause);
93
+ return null;
94
+ });
86
95
  ctx.provide(`aw.world.${KEY}`, world);
87
96
  }
@@ -21,6 +21,8 @@ import { join, resolve } from "node:path";
21
21
  /** Prod homes that must never be resolved into (repo red line). */
22
22
  const PROD_HOMES = [join(homedir(), ".dsh"), join(homedir(), ".superd")];
23
23
  export function assertNotProdHome(path, label) {
24
+ if (process.env.SUPERD_DEV_REDLINE !== "1")
25
+ return; // published install: the host dsh home (~/.dsh on consumers) is authoritative — the S3/S7 world layout lives under it. Dev lines set SUPERD_DEV_REDLINE=1 (repo red line: ~/.dsh is Dash prod).
24
26
  if (PROD_HOMES.includes(path) || PROD_HOMES.some((p) => path.startsWith(`${p}/`))) {
25
27
  throw new Error(`pi-home: refusing prod home as ${label}: ${path}`);
26
28
  }
@@ -14,6 +14,7 @@
14
14
  * ctx0's auth domain and dispatches into this world's gateway instance.
15
15
  */
16
16
  import { mkdirSync } from 'node:fs';
17
+ import { resolveDshHome } from '@deepseek-ai/dsh-home-paths';
17
18
  import { join } from 'node:path';
18
19
  import { spawnWorld, registerAgent, setReady, registerForeignTarget, registerHostMount, mountWorld, worldMountPatches, provisionWorldProfile, } from '../../agent-hub/dist/index.js';
19
20
  export const name = 'aw.agent-adapter-pi';
@@ -23,7 +24,10 @@ const ANCHOR = process.env.SUPERD_DSH_ANCHOR
23
24
  ?? '/home/u1/.local/lib/node_modules/@deepseek-ai/dsh/package.json';
24
25
  export function apply(ctx) {
25
26
  registerAgent({ key: KEY, label: 'Pi', ready: false });
26
- const root = process.env.DSH_HOME ?? join(process.cwd(), '.tests', 'aw');
27
+ // Harness resolver (env ~/.dsh): a consumer install has no DSH_HOME and
28
+ // no cwd contract — deriving the world root from cwd spawns worlds into a
29
+ // garbage tree or throws inside apply() and kills the whole host boot.
30
+ const root = resolveDshHome();
27
31
  // Nested home: the world's DSH data lives INSIDE `agents/<label>` (sessions
28
32
  // / settings / workspaces, and the adapter's dsh-sessions.json mapping).
29
33
  // pi's RUNTIME home is the native ~/.pi (2026-09-17 ruling) — nothing is
@@ -83,6 +87,11 @@ export function apply(ctx) {
83
87
  dropHostMount();
84
88
  }, `aw.agent-adapter-${KEY}: mount`);
85
89
  return ctxW;
86
- })();
90
+ })().catch((cause) => {
91
+ // A failed world degrades to a not-ready roster row; a rejected provided
92
+ // promise would fail the entire host boot (loader entry apply).
93
+ console.error(`[super-dsh] ${KEY} world failed:`, cause);
94
+ return null;
95
+ });
87
96
  ctx.provide(`aw.world.${KEY}`, world);
88
97
  }
@@ -0,0 +1,242 @@
1
+ window.__ModuleLoader__.load({ id: "super-dsh", factory: (require) => {
2
+ var module = { exports: {} }; var exports = module.exports;
3
+ //#region rolldown:runtime
4
+ var __create = Object.create;
5
+ var __defProp = Object.defineProperty;
6
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
+ var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getProtoOf = Object.getPrototypeOf;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
12
+ key = keys[i];
13
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
+ get: ((k) => from[k]).bind(null, key),
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
21
+ value: mod,
22
+ enumerable: true
23
+ }) : target, mod));
24
+
25
+ //#endregion
26
+ let react = require("react");
27
+ react = __toESM(react);
28
+ let react_jsx_runtime = require("react/jsx-runtime");
29
+ react_jsx_runtime = __toESM(react_jsx_runtime);
30
+
31
+ //#region src/client/RuntimeSeat.tsx
32
+ const NATIVE = {
33
+ key: "native",
34
+ label: "DSH",
35
+ path: "/"
36
+ };
37
+ /** Fallback labels for the read-only face (which only reports keys). */
38
+ const RUNTIME_LABELS = {
39
+ native: "DSH",
40
+ omp: "OMP",
41
+ codex: "Codex"
42
+ };
43
+ function fromGlobal() {
44
+ const agents = globalThis.__DSH_AGENT_ROSTER__?.agents;
45
+ if (!Array.isArray(agents)) return void 0;
46
+ const links = [];
47
+ for (const entry of agents) {
48
+ if (typeof entry !== "object" || entry === null) continue;
49
+ const { key, label, path } = entry;
50
+ if (typeof key !== "string" || typeof path !== "string") continue;
51
+ links.push({
52
+ key,
53
+ label: typeof label === "string" ? label : RUNTIME_LABELS[key] ?? key,
54
+ path
55
+ });
56
+ }
57
+ return links.length > 0 ? links : void 0;
58
+ }
59
+ /** Normalize the current mount root: `/omp` and `/omp/` are the same page. */
60
+ function currentPath() {
61
+ const pathname = typeof location === "undefined" ? "/" : location.pathname;
62
+ if (pathname === "" || pathname === "/") return "/";
63
+ return pathname.endsWith("/") ? pathname : `${pathname}/`;
64
+ }
65
+ function RuntimeSeat({ wide }) {
66
+ const [agents, setAgents] = react.useState(() => fromGlobal() ?? [NATIVE]);
67
+ const [open, setOpen] = react.useState(false);
68
+ const rootRef = react.useRef(null);
69
+ react.useEffect(() => {
70
+ let cancelled = false;
71
+ fetch("/api/agent-runtime", { credentials: "same-origin" }).then((r) => r.ok ? r.json() : Promise.reject(/* @__PURE__ */ new Error(`HTTP ${r.status}`))).then((j) => {
72
+ if (cancelled) return;
73
+ if (Array.isArray(j?.agents)) {
74
+ const listed = [];
75
+ for (const entry of j.agents) {
76
+ if (typeof entry !== "object" || entry === null) continue;
77
+ const { key, label, path } = entry;
78
+ if (typeof key !== "string" || typeof path !== "string") continue;
79
+ listed.push({
80
+ key,
81
+ label: typeof label === "string" ? label : RUNTIME_LABELS[key] ?? key,
82
+ path
83
+ });
84
+ }
85
+ if (listed.length > 0) {
86
+ setAgents(listed);
87
+ return;
88
+ }
89
+ }
90
+ if (!Array.isArray(j?.available)) return;
91
+ const links = [];
92
+ for (const key of j.available) {
93
+ if (typeof key !== "string") continue;
94
+ links.push(key === "native" ? NATIVE : {
95
+ key,
96
+ label: RUNTIME_LABELS[key] ?? key,
97
+ path: `/${key}/`
98
+ });
99
+ }
100
+ if (links.length > 0) setAgents(links);
101
+ }).catch(() => {});
102
+ return () => {
103
+ cancelled = true;
104
+ };
105
+ }, []);
106
+ react.useEffect(() => {
107
+ if (!open) return;
108
+ const onDown = (event) => {
109
+ if (rootRef.current !== null && !rootRef.current.contains(event.target)) setOpen(false);
110
+ };
111
+ document.addEventListener("mousedown", onDown);
112
+ return () => document.removeEventListener("mousedown", onDown);
113
+ }, [open]);
114
+ const here = currentPath();
115
+ const active = agents.find((agent) => agent.path === here) ?? NATIVE;
116
+ const styleBase = {
117
+ display: "flex",
118
+ alignItems: "center",
119
+ gap: 8,
120
+ width: "100%",
121
+ padding: wide ? "7px 10px" : "7px 0",
122
+ justifyContent: wide ? "flex-start" : "center",
123
+ border: "none",
124
+ borderRadius: 8,
125
+ background: "transparent",
126
+ color: "inherit",
127
+ font: "inherit",
128
+ fontSize: 13,
129
+ cursor: "pointer",
130
+ position: "relative"
131
+ };
132
+ const styleBadge = {
133
+ fontSize: 10,
134
+ lineHeight: 1.4,
135
+ padding: "1px 6px",
136
+ borderRadius: 999,
137
+ background: "color-mix(in srgb, currentColor 12%, transparent)",
138
+ whiteSpace: "nowrap"
139
+ };
140
+ const styleMenu = {
141
+ position: "absolute",
142
+ bottom: "calc(100% + 6px)",
143
+ left: 6,
144
+ right: 6,
145
+ zIndex: 40,
146
+ background: "var(--dsh-surface, #26262b)",
147
+ border: "1px solid color-mix(in srgb, currentColor 18%, transparent)",
148
+ borderRadius: 10,
149
+ boxShadow: "0 8px 24px rgba(0,0,0,.35)",
150
+ overflow: "hidden"
151
+ };
152
+ const styleItem = (isActive) => ({
153
+ display: "block",
154
+ width: "100%",
155
+ padding: "8px 12px",
156
+ border: "none",
157
+ background: isActive ? "color-mix(in srgb, currentColor 10%, transparent)" : "transparent",
158
+ color: "inherit",
159
+ font: "inherit",
160
+ fontSize: 13,
161
+ textAlign: "left",
162
+ cursor: "pointer"
163
+ });
164
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
165
+ ref: rootRef,
166
+ style: {
167
+ position: "relative",
168
+ width: "100%"
169
+ },
170
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
171
+ type: "button",
172
+ style: styleBase,
173
+ title: "Agent runtime — picking one opens that runtime's mount (/omp/, /codex/, …)",
174
+ onClick: () => {
175
+ setOpen((v) => !v);
176
+ },
177
+ children: wide ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
178
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
179
+ "aria-hidden": true,
180
+ children: "⌘"
181
+ }),
182
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
183
+ style: {
184
+ flex: 1,
185
+ textAlign: "left",
186
+ whiteSpace: "nowrap",
187
+ overflow: "hidden",
188
+ textOverflow: "ellipsis"
189
+ },
190
+ children: ["Agent · ", active.label]
191
+ }),
192
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
193
+ style: styleBadge,
194
+ children: "open"
195
+ })
196
+ ] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
197
+ "aria-hidden": true,
198
+ children: "⌘"
199
+ })
200
+ }), open && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
201
+ style: styleMenu,
202
+ children: agents.map((agent) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
203
+ href: agent.path,
204
+ style: {
205
+ ...styleItem(agent.path === here),
206
+ textDecoration: "none"
207
+ },
208
+ "aria-current": agent.path === here ? "page" : void 0,
209
+ onClick: () => {
210
+ setOpen(false);
211
+ },
212
+ children: agent.path === here ? `${agent.label} ✓` : agent.label
213
+ }, agent.key))
214
+ })]
215
+ });
216
+ }
217
+
218
+ //#endregion
219
+ //#region src/client/index.ts
220
+ /** Required services (cordis fiber inject): the slot registry. */
221
+ const inject = ["slots"];
222
+ /**
223
+ * Mount the selector. Degrades silently when the slot service is absent (a
224
+ * composition without the sidebar renders nothing — a footer action is an
225
+ * optional occupant by contract).
226
+ *
227
+ * @param ctx - client root context.
228
+ */
229
+ function apply(ctx) {
230
+ ctx.inject(["slots"], (raw) => {
231
+ const scope = raw;
232
+ scope.effect(() => scope.slots.inject("sidebar.footer.action", () => scope.slots.register({
233
+ name: "sidebar.footer.action",
234
+ id: "agent-runtime"
235
+ }, RuntimeSeat)), "agent-hub: runtime footer action");
236
+ });
237
+ }
238
+
239
+ //#endregion
240
+ exports.apply = apply;
241
+ exports.inject = inject;
242
+ return module.exports; } });
package/cordis.patch.yml CHANGED
@@ -16,8 +16,11 @@
16
16
  # Profile-layer values (webserver port/host, settings path) stay in the USER's
17
17
  # profile patch layer, never here.
18
18
  - insert:
19
+ # BARE package row: subpath rows (…/world/omp) are permanently not client
20
+ # rows in client-modules' scan (exactPackageSpecifier), so THIS row is
21
+ # what registers the package's client half — the sidebar selector.
19
22
  - id: agent-hub
20
- name: 'super-dsh/hub'
23
+ name: 'super-dsh'
21
24
  - id: aw-agent-adapter-omp
22
25
  name: 'super-dsh/world/omp'
23
26
  - id: aw-agent-adapter-codex
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "super-dsh",
3
- "version": "0.1.1",
3
+ "version": "0.1.3-c",
4
4
  "description": "Agent Worlds for the DeepSeek Harness (DSH) — one dsh plugin that mounts the agent hub (runtime selector, roster, per-runtime worlds) and joins local foreign-agent runtimes (OMP, Codex, Claude, Pi, Hermes, Antigravity) into the DSH Web UI. Each runtime keeps its native home and session store; the hub only bridges.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -9,6 +9,7 @@
9
9
  "url": "git+https://github.com/pgmi-builds/superd.git"
10
10
  },
11
11
  "exports": {
12
+ ".": "./agent-hub/dist/index.js",
12
13
  "./hub": "./agent-hub/dist/index.js",
13
14
  "./join": "./agent-hub/dist/world-join.js",
14
15
  "./world/omp": "./agent-omp/dist/world-plugin.js",
@@ -17,12 +18,13 @@
17
18
  "./world/pi": "./agent-pi/dist/world-plugin.js",
18
19
  "./world/hermes": "./agent-hermes/dist/world-plugin.js",
19
20
  "./world/agy": "./agent-agy/dist/world-plugin.js",
20
- "./client": "./agent-hub/lib/client/index.js",
21
+ "./client": "./client/index.js",
21
22
  "./cordis.patch.yml": "./cordis.patch.yml",
22
23
  "./package.json": "./package.json"
23
24
  },
24
25
  "files": [
25
26
  "cordis.patch.yml",
27
+ "client",
26
28
  "README.md",
27
29
  "agent-hub/dist",
28
30
  "agent-hub/lib",
@@ -68,7 +70,8 @@
68
70
  "@openai/codex-sdk": "0.154.0",
69
71
  "bun": "^1.4.2",
70
72
  "ws": "^8.21.0",
71
- "zod": "3.25.76"
73
+ "zod": "3.25.76",
74
+ "@modelcontextprotocol/sdk": "^1.29.0"
72
75
  },
73
76
  "peerDependencies": {
74
77
  "@deepseek-ai/cordis": "^4.0.1",
@@ -87,20 +90,48 @@
87
90
  "@deepseek-ai/dsh-user-questions": "0.1.5-rc.2"
88
91
  },
89
92
  "peerDependenciesMeta": {
90
- "@deepseek-ai/cordis": { "optional": true },
91
- "@deepseek-ai/dsh-agent": { "optional": true },
92
- "@deepseek-ai/dsh-agent-presets": { "optional": true },
93
- "@deepseek-ai/dsh-api-gateway": { "optional": true },
94
- "@deepseek-ai/dsh-commands": { "optional": true },
95
- "@deepseek-ai/dsh-home-paths": { "optional": true },
96
- "@deepseek-ai/dsh-host-webserver": { "optional": true },
97
- "@deepseek-ai/dsh-llm": { "optional": true },
98
- "@deepseek-ai/dsh-scope": { "optional": true },
99
- "@deepseek-ai/dsh-session": { "optional": true },
100
- "@deepseek-ai/dsh-session-persistence": { "optional": true },
101
- "@deepseek-ai/dsh-typert-protocol": { "optional": true },
102
- "@deepseek-ai/dsh-user-approval": { "optional": true },
103
- "@deepseek-ai/dsh-user-questions": { "optional": true }
93
+ "@deepseek-ai/cordis": {
94
+ "optional": true
95
+ },
96
+ "@deepseek-ai/dsh-agent": {
97
+ "optional": true
98
+ },
99
+ "@deepseek-ai/dsh-agent-presets": {
100
+ "optional": true
101
+ },
102
+ "@deepseek-ai/dsh-api-gateway": {
103
+ "optional": true
104
+ },
105
+ "@deepseek-ai/dsh-commands": {
106
+ "optional": true
107
+ },
108
+ "@deepseek-ai/dsh-home-paths": {
109
+ "optional": true
110
+ },
111
+ "@deepseek-ai/dsh-host-webserver": {
112
+ "optional": true
113
+ },
114
+ "@deepseek-ai/dsh-llm": {
115
+ "optional": true
116
+ },
117
+ "@deepseek-ai/dsh-scope": {
118
+ "optional": true
119
+ },
120
+ "@deepseek-ai/dsh-session": {
121
+ "optional": true
122
+ },
123
+ "@deepseek-ai/dsh-session-persistence": {
124
+ "optional": true
125
+ },
126
+ "@deepseek-ai/dsh-typert-protocol": {
127
+ "optional": true
128
+ },
129
+ "@deepseek-ai/dsh-user-approval": {
130
+ "optional": true
131
+ },
132
+ "@deepseek-ai/dsh-user-questions": {
133
+ "optional": true
134
+ }
104
135
  },
105
136
  "publishConfig": {
106
137
  "access": "public"