super-dsh 0.3.0-d → 0.3.0-f

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 CHANGED
@@ -22,62 +22,20 @@ six primary `@pgmi-builds/agent-*` packages and three OPTIONAL SDK halves).
22
22
  Restart the profile after replacing a loaded package. Each foreign world's
23
23
  DSH home is created under `<DSH_HOME>/agents/<label>/` on first boot.
24
24
 
25
- ## Better Dash delivery and native Web defaults
26
-
27
- Super Dash declares [Better Dash](../better-dsh/) at the synchronized exact
28
- version in ordinary npm `dependencies`; it contains no Better files or archive.
29
- One `npm install super-dsh@<version>` or native Plugin Manager installation
30
- resolves both packages from the configured registry. Publish Better first, then
31
- Super. Pi's prebuilt SDK dependency tree retains its separate bundled delivery.
32
-
33
- DSH does not recursively expose transitive bundles. On startup the coordinator
34
- registers the already downloaded exact Better version using native profile
35
- package operations **offline**, without installation hooks or another registry
36
- fetch. This automatic local registration is separate from the user's single
37
- installation command. Missing cached data reports a failure instead of falling
38
- back to online fetching. Replacing loaded code or promoting loaded provenance
39
- requires the documented cold restart.
40
-
41
- The Plugin Manager shows both packages as parallel installed bundles with their
42
- own YAML and independent switches. Better's Code source is `better-dsh@<version>`.
43
- Updates retain disablement and same-version explicit uninstall; removing Super
44
- retains the directly registered Better. Old `bundle-artifacts/` caches are left
45
- intact for previous installations, but new releases do not write them. With Super
46
- disabled, registration waits until Super is enabled. dev WebMCP is
47
- separate and test-only.
48
-
49
- Both packages use the same local dual-build pipeline. Tests serve the exact
50
- unpublished artifact pair through a read-only local registry, without modifying
51
- the release manifest or preinstalling Better. Current iteration: **0.3.0-f**.
52
-
53
- For a tarball URL installation in the native Web UI, put the `.tgz` URL in the
54
- main Add plugin input and keep the separate Registry selection on the official
55
- npm registry. A tarball file server is not an npm registry.
56
-
57
- Disabling Better restores native Web binding, trusted-host, login and onboarding
58
- policies. Remote deployments must supply native DSH trusted-host configuration;
59
- Super does not take ownership of those Better policies.
60
-
61
- Better Dash owns the native DSH policies: `dashr-web-trust` retains cookie
62
- authentication while accepting authenticated serving Host/Origin values; its
63
- password page provides new-client login. Cookie expiry and authority binding remain.
64
- `dashr-webserver` defaults to `0.0.0.0`; native `--port` and explicit loopback
65
- `--host` overrides are preserved. Super Dash carries no duplicate WebTrust.
66
- To restore the native address fence, set `dashr-web-trust`'s `trustAllHosts: false`.
67
-
68
- Better Dash also disables automatic credential onboarding and acknowledges the
69
- installed Models client's current welcome version before the listener opens.
70
- Manual model configuration remains available. To restore native welcome behavior:
71
-
72
- ```yaml
73
- - id: dashr-welcome-notice
74
- disabled: true
75
- ```
25
+ ## Better Dash delivery
26
+
27
+ Super installs [Better Dash](../better-dsh/) at runtime through the native DSH
28
+ Plugin Manager, requesting its installed Super version first, then `better-dsh@latest`, then bare
29
+ `better-dsh` after each preceding failure. The packages have no dependency edge or shared physical payload;
30
+ both retain independent native Plugin Manager rows and component switches.
31
+
32
+ First-use intent lives under `$DSH_HOME/superd/companions/`, so manual removal
33
+ remains removed across restarts and upgrades. Hub Settings offers explicit
34
+ reinstallation. Both packages ship at synchronized versions; publish Better
35
+ before Super. Pi's prebuilt SDK retains its separate bundled delivery.
76
36
 
77
- Version-only upstream bumps adapt at the next startup. A renamed private constant
78
- or changed bundle layout fails explicitly and requires adaptation or disabling the
79
- entry. Dev WebMCP lives in the root `dev-webmcp/` directory and is included
80
- only as an extra development profile bundle, never in either release tarball.
37
+ Better's welcome policy uses the official client onboarding slot. Native
38
+ WebServer and HMR stay in place; listener configuration belongs to deployment.
81
39
 
82
40
  ## Runtimes
83
41
 
package/client/index.js CHANGED
@@ -331,7 +331,7 @@ function RuntimeMark({ runtimeId, agentKey, size }) {
331
331
  function statusColor(status) {
332
332
  if (status === "reachable") return "var(--dsw-alias-state-success-primary)";
333
333
  if (status === "auth-expired") return "var(--dsw-alias-state-error-primary)";
334
- if (status === "unreachable") return "var(--dsw-alias-state-warn-primary)";
334
+ if (status === "unreachable") return "var(--dsw-alias-label-caption)";
335
335
  return "var(--dsw-alias-label-caption)";
336
336
  }
337
337
  /** The word the icon replaces — tooltip and accessibility text. */
@@ -614,7 +614,8 @@ async function addMachine(input) {
614
614
  headers: { "content-type": "application/json" },
615
615
  body: JSON.stringify({
616
616
  name: input.name,
617
- tokenUrl: input.tokenUrl
617
+ tokenUrl: input.tokenUrl,
618
+ ...pageOrigin() === "" ? {} : { origin: pageOrigin() }
618
619
  })
619
620
  });
620
621
  if (!response.ok) throw new Error(await errorText(response));
@@ -623,9 +624,21 @@ async function addMachine(input) {
623
624
  const raw = body.mutual;
624
625
  return { mutual: {
625
626
  ok: raw.ok === true,
627
+ ...raw.skipped === "self" || raw.skipped === "already-paired" ? { skipped: raw.skipped } : {},
626
628
  ...typeof raw.error === "string" && raw.error !== "" ? { error: raw.error } : {}
627
629
  } };
628
630
  }
631
+ /** Preserve shell schemes whose WHATWG origin is opaque; this is an address, not a reachability verdict. */
632
+ function pageOrigin() {
633
+ if (typeof location === "undefined") return "";
634
+ if (location.origin !== "null" && location.origin !== "") return location.origin;
635
+ try {
636
+ const url = new URL(location.href);
637
+ return url.protocol + "//" + url.host;
638
+ } catch {
639
+ return "";
640
+ }
641
+ }
629
642
  /**
630
643
  * DELETE one remote row by id (`{removed: boolean}` answers even for
631
644
  * unknown ids — a false removal is a reload, not an error).
@@ -671,7 +684,7 @@ const AUTO_REFRESH_NOTE = "auto-refreshes every 5 min";
671
684
  * face's public `authenticatedUrl` — this client never sees the raw token
672
685
  * anywhere else.
673
686
  *
674
- * @param origin - the page's own origin (`location.origin`), a bare http(s) origin.
687
+ * @param origin - the page's own host address, including a desktop scheme.
675
688
  * @returns the tokenized pairing URL.
676
689
  * @throws Error(body.error) on a non-2xx answer (validation or missing host face).
677
690
  */
@@ -692,9 +705,9 @@ async function fetchPairingUrl(origin) {
692
705
  }
693
706
  /**
694
707
  * Client-side pre-check before a pairing submit: a parseable absolute
695
- * http(s) URL carrying a non-empty `token` query param. The server re-parses
708
+ * host-bearing URL carrying a non-empty `token` query param. The server re-parses
696
709
  * authoritatively (mesh-link's parseTokenUrl); this only keeps obviously
697
- * dead drafts off the wire.
710
+ * malformed drafts off the wire.
698
711
  *
699
712
  * @param input - the raw token-URL draft (trim before calling).
700
713
  * @returns whether the draft is submit-shaped.
@@ -707,7 +720,7 @@ function validTokenUrl(input) {
707
720
  } catch {
708
721
  return false;
709
722
  }
710
- if (url.protocol !== "http:" && url.protocol !== "https:") return false;
723
+ if (url.host === "") return false;
711
724
  const token = url.searchParams.get("token");
712
725
  return token !== null && token !== "";
713
726
  }
@@ -2185,6 +2198,145 @@ async function removeProvider(agentKey, namespace, id, doFetch) {
2185
2198
  return requireProvidersView(await callRuntimeSettings(agentKey, namespace, "remove", { request: { id } }, doFetch));
2186
2199
  }
2187
2200
 
2201
+ //#endregion
2202
+ //#region src/client/companion-api.ts
2203
+ async function callCompanion(operation, doFetch) {
2204
+ const method = `superdCompanions/${operation}`;
2205
+ const response = await (doFetch ?? ((path, init) => fetch(path, init)))(`/api/${method}`, {
2206
+ method: "POST",
2207
+ credentials: "same-origin",
2208
+ headers: { "content-type": "application/json" },
2209
+ body: JSON.stringify({
2210
+ type: "client-request",
2211
+ rpcId: mintRpcId(),
2212
+ method,
2213
+ payload: { args: {} }
2214
+ })
2215
+ });
2216
+ if (!response.ok) throw new Error(`Better Dash: HTTP ${response.status}`);
2217
+ let body;
2218
+ try {
2219
+ body = JSON.parse(await response.text());
2220
+ } catch {
2221
+ throw new Error("Better Dash: unreadable response");
2222
+ }
2223
+ const result = body?.result;
2224
+ if (result?.ok !== true) throw new Error(result?.error?.message ?? "Better Dash: request failed");
2225
+ const value = result.value;
2226
+ if (value === null || typeof value !== "object" || typeof value.installed !== "boolean" || typeof value.installing !== "boolean" || typeof value.requestedVersion !== "string" || value.version !== void 0 && typeof value.version !== "string" || value.enabled !== void 0 && typeof value.enabled !== "boolean" || value.error !== void 0 && typeof value.error !== "string") throw new Error("Better Dash: invalid status");
2227
+ return value;
2228
+ }
2229
+
2230
+ //#endregion
2231
+ //#region src/client/CompanionSettings.tsx
2232
+ /** Native plugin switches remain in Plugin Manager; this row provides explicit recovery. */
2233
+ function CompanionSettings() {
2234
+ const [status, setStatus] = react.default.useState();
2235
+ const [error, setError] = react.default.useState();
2236
+ const [busy, setBusy] = react.default.useState(false);
2237
+ const live = react.default.useRef(false);
2238
+ const operation = react.default.useRef(false);
2239
+ react.default.useEffect(() => {
2240
+ live.current = true;
2241
+ let reading = false;
2242
+ const refresh = async () => {
2243
+ if (reading || operation.current) return;
2244
+ reading = true;
2245
+ try {
2246
+ const next = await callCompanion("getBetterDash");
2247
+ if (live.current) {
2248
+ setStatus(next);
2249
+ setError(next.error);
2250
+ }
2251
+ } catch (cause) {
2252
+ if (live.current) setError(cause instanceof Error ? cause.message : String(cause));
2253
+ } finally {
2254
+ reading = false;
2255
+ }
2256
+ };
2257
+ refresh();
2258
+ const timer = window.setInterval(() => {
2259
+ refresh();
2260
+ }, 5e3);
2261
+ return () => {
2262
+ live.current = false;
2263
+ window.clearInterval(timer);
2264
+ };
2265
+ }, []);
2266
+ const install = async () => {
2267
+ if (operation.current) return;
2268
+ operation.current = true;
2269
+ setBusy(true);
2270
+ setError(void 0);
2271
+ try {
2272
+ const next = await callCompanion("installBetterDash");
2273
+ if (live.current) {
2274
+ setStatus(next);
2275
+ setError(next.error);
2276
+ }
2277
+ } catch (cause) {
2278
+ if (live.current) setError(cause instanceof Error ? cause.message : String(cause));
2279
+ } finally {
2280
+ operation.current = false;
2281
+ if (live.current) setBusy(false);
2282
+ }
2283
+ };
2284
+ const installing = busy || status?.installing === true;
2285
+ const label = status === void 0 ? "Loading…" : status.installed ? `Installed${status.version ? " · " + status.version : ""}${status.enabled === false ? " · Disabled" : ""}` : "Not installed";
2286
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2287
+ style: {
2288
+ borderRadius: 12,
2289
+ padding: "12px 14px",
2290
+ background: "var(--dsw-alias-interactive-bg-hover)"
2291
+ },
2292
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2293
+ style: {
2294
+ display: "flex",
2295
+ alignItems: "center",
2296
+ gap: 16
2297
+ },
2298
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2299
+ style: { flex: 1 },
2300
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2301
+ style: {
2302
+ fontSize: 14,
2303
+ fontWeight: 600
2304
+ },
2305
+ children: "Better Dash"
2306
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2307
+ role: "status",
2308
+ style: {
2309
+ fontSize: 12,
2310
+ color: "var(--dsw-alias-label-secondary)",
2311
+ marginTop: 4
2312
+ },
2313
+ children: installing ? "Installing…" : label
2314
+ })]
2315
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
2316
+ type: "button",
2317
+ disabled: installing || status?.installed === true,
2318
+ onClick: () => {
2319
+ install();
2320
+ },
2321
+ style: {
2322
+ padding: "6px 12px",
2323
+ borderRadius: 8,
2324
+ cursor: installing || status?.installed ? "default" : "pointer"
2325
+ },
2326
+ children: installing ? "Installing…" : status?.installed ? "Installed" : "Install"
2327
+ })]
2328
+ }), error && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
2329
+ role: "alert",
2330
+ style: {
2331
+ fontSize: 12,
2332
+ margin: "8px 0 0",
2333
+ color: "var(--dsw-alias-state-error-primary)"
2334
+ },
2335
+ children: error
2336
+ })]
2337
+ });
2338
+ }
2339
+
2188
2340
  //#endregion
2189
2341
  //#region src/client/HubPage.tsx
2190
2342
  const EMPTY_DRAFT = {
@@ -3143,7 +3295,7 @@ function HubPage() {
3143
3295
  });
3144
3296
  }, [fusion]);
3145
3297
  const here = currentMountPath();
3146
- const hereOrigin = typeof location === "undefined" ? "" : location.origin;
3298
+ const hereOrigin = pageOrigin();
3147
3299
  const isActive = (agent) => hubRowActive({
3148
3300
  fusion,
3149
3301
  agentKey: agent.key,
@@ -3254,8 +3406,9 @@ function HubPage() {
3254
3406
  setShowAdd(false);
3255
3407
  setMeshError(null);
3256
3408
  reloadMachines();
3257
- if (out.mutual !== void 0 && !out.mutual.ok) showSuperdToast(`Super D: paired with ${name}, but the mutual half failed (${out.mutual.error}) — add this machine from the peer manually.`);
3258
- else showSuperdToast(`Super D: paired with ${name} — the peer also added this machine (mutual).`, { tone: "success" });
3409
+ if (out.mutual !== void 0 && !out.mutual.ok) showSuperdToast(`Super D: paired with ${name}; reverse connection unavailable.`);
3410
+ else if (out.mutual?.ok && out.mutual.skipped !== "self") showSuperdToast(`Super D: paired with ${name} — the peer also added this machine (mutual).`, { tone: "success" });
3411
+ else showSuperdToast(`Super D: paired with ${name}.`, { tone: "success" });
3259
3412
  }).catch((err) => {
3260
3413
  setMeshError(errText(err));
3261
3414
  }).finally(() => {
@@ -3282,7 +3435,7 @@ function HubPage() {
3282
3435
  * GET), one clipboard write, the outcome on the shared toast. */
3283
3436
  const copyPairingUrl = () => {
3284
3437
  if (pairingBusy) return;
3285
- const origin = typeof location === "undefined" ? "" : location.origin;
3438
+ const origin = pageOrigin();
3286
3439
  if (origin === "") return;
3287
3440
  setPairingBusy(true);
3288
3441
  fetchPairingUrl(origin).then((url) => (0, __deepseek_ai_dsh_client_ui_primitives.writeClipboard)(url)).then((copied) => {
@@ -3401,16 +3554,8 @@ function HubPage() {
3401
3554
  },
3402
3555
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(GroupHead, {
3403
3556
  title: "Settings",
3404
- count: 0
3405
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
3406
- style: {
3407
- margin: 0,
3408
- fontSize: 13,
3409
- lineHeight: "20px",
3410
- color: "var(--dsw-alias-label-tertiary)"
3411
- },
3412
- children: "Hub preferences — pairing, runtime visibility, and orchestration defaults land with the hub service."
3413
- })]
3557
+ count: 1
3558
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CompanionSettings, {})]
3414
3559
  }),
3415
3560
  tab === "home" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
3416
3561
  style: {
@@ -3463,7 +3608,7 @@ function HubPage() {
3463
3608
  color: "var(--dsw-alias-label-tertiary)"
3464
3609
  },
3465
3610
  children: [
3466
- "Add another DSH from remote machines, provide the token URL. Pairing is mutual — the peer adds this machine back automatically. Status ",
3611
+ "Add another DSH with its token URL. The peer attempts to connect back. Status ",
3467
3612
  AUTO_REFRESH_NOTE,
3468
3613
  "."
3469
3614
  ]
package/cordis.patch.yml CHANGED
@@ -12,8 +12,8 @@
12
12
  # zero-port sibling root, mounted under /<label>
13
13
  # - super-dsh/join the generic hub joiner for the standalone
14
14
  # claude adapter (R2)
15
- # DSH-only WebTrust, WebServer and onboarding policies belong to the exact registry
16
- # Better Dash dependency, registered as an independent profile bundle.
15
+ # DSH-only WebTrust and onboarding policies belong to independently installed
16
+ # Better Dash; the native Plugin Manager owns its package and enablement.
17
17
  # - super-dsh/a2a the agent-facing A2A tool face (mesh P3): the
18
18
  # single `superd-hub` model tool on ctx0's tools
19
19
  # service (dormant without tools; world trees
@@ -22,7 +22,7 @@
22
22
  # Profile-layer values (webserver port/host, settings path) stay in the USER's
23
23
  # profile patch layer, never here.
24
24
  - insert:
25
- # Register the already installed exact registry companion as an independent native bundle.
25
+ # Expose native companion management and perform first-use installation.
26
26
  - id: superd-bundle-setup
27
27
  name: 'super-dsh/setup'
28
28
  # BARE package row: subpath rows (…/agents/omp) are permanently not client
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "super-dsh",
3
- "version": "0.3.0-d",
3
+ "version": "0.3.0-f",
4
4
  "description": "Super D for the DeepSeek Harness (DSH) — one dsh plugin that mounts the superd hub (runtime selector, roster, per-runtime agents) 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",
@@ -68,8 +68,7 @@
68
68
  "agent-agy-sdk/dist",
69
69
  "agent-agy-sdk/package.json",
70
70
  "agent-agy-sdk/cordis.patch.yml",
71
- "agent-agy-sdk/bridge",
72
- "superd-hub/scripts/register-companion.mjs"
71
+ "agent-agy-sdk/bridge"
73
72
  ],
74
73
  "dsh": {
75
74
  "bundle": {
@@ -83,7 +82,6 @@
83
82
  }
84
83
  },
85
84
  "dependencies": {
86
- "better-dsh": "0.3.0-d",
87
85
  "@earendil-works/pi-coding-agent": "0.84.2",
88
86
  "zod": "4.4.3",
89
87
  "@modelcontextprotocol/sdk": "^1.29.0"
@@ -1,13 +1,23 @@
1
+ /** Better Dash is installed by the current profile's native Plugin Manager. */
1
2
  import type { Context } from '@deepseek-ai/cordis';
2
- import type { ProfileContext } from '@deepseek-ai/dsh-app-boot';
3
+ import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
4
+ import { BetterDashCompanion } from './companions.js';
5
+ import type { BetterDashStatus } from './companion-contract.js';
6
+ export { BetterDashCompanion } from './companions.js';
7
+ export type { BetterDashStatus } from './companion-contract.js';
3
8
  export declare const name = "superd-bundle-setup";
4
9
  export declare const inject: string[];
5
- interface DeliveryResult {
6
- installed: string[];
7
- restartRequired: boolean;
10
+ declare module '@deepseek-ai/cordis' {
11
+ interface Context {
12
+ superdCompanions: SuperdCompanions;
13
+ }
14
+ }
15
+ export declare class SuperdCompanions extends TypertRemoteService {
16
+ private readonly companion;
17
+ constructor(ctx: Context, companion: BetterDashCompanion);
18
+ getBetterDash(): Promise<BetterDashStatus>;
19
+ installBetterDash(): Promise<BetterDashStatus>;
8
20
  }
9
- /** First registration enables a companion; native reconciliation preserves retained disablement. */
10
- export declare function reconcileRegistryCompanions(profile: ProfileContext, signal?: AbortSignal): Promise<DeliveryResult>;
11
21
  export declare function apply(ctx: Context): void;
12
22
  declare const _default: {
13
23
  name: string;