super-dsh 0.3.2 → 0.3.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.
Files changed (61) hide show
  1. package/README.md +15 -14
  2. package/agent-agy/dist/agent.d.ts +4 -1
  3. package/agent-agy/dist/agent.js +15 -1
  4. package/agent-agy/dist/index.js +5 -8
  5. package/agent-agy/package.json +6 -6
  6. package/agent-agy-sdk/dist/agent.d.ts +4 -1
  7. package/agent-agy-sdk/dist/agent.js +15 -1
  8. package/agent-agy-sdk/dist/index.js +5 -8
  9. package/agent-agy-sdk/package.json +5 -5
  10. package/agent-claude/dist/agent.js +15 -1
  11. package/agent-claude/package.json +8 -8
  12. package/agent-codex/dist/agent.js +15 -1
  13. package/agent-codex/package.json +7 -7
  14. package/agent-codex-sdk/dist/agent.js +15 -1
  15. package/agent-codex-sdk/dist/index.js +5 -11
  16. package/agent-codex-sdk/package.json +7 -7
  17. package/agent-hermes/dist/agent.js +15 -1
  18. package/agent-hermes/dist/index.js +5 -8
  19. package/agent-hermes/package.json +7 -7
  20. package/agent-omp/dist/agent.js +26 -2
  21. package/agent-omp/package.json +8 -8
  22. package/agent-omp-sdk/dist/agent.d.ts +4 -1
  23. package/agent-omp-sdk/dist/agent.js +15 -1
  24. package/agent-omp-sdk/package.json +8 -8
  25. package/agent-pi/dist/agent.js +20 -2
  26. package/agent-pi/dist/index.js +5 -11
  27. package/agent-pi/package.json +7 -7
  28. package/client/index.js +106 -249
  29. package/cordis.patch.yml +0 -6
  30. package/package.json +22 -27
  31. package/remote/hub-pty-pump.mjs +97 -0
  32. package/remote/plugin.d.ts +476 -200
  33. package/remote/plugin.js +1448 -667
  34. package/remote/provenance.json +22 -17
  35. package/superd-hub/dist/agent-model-face.d.ts +93 -0
  36. package/superd-hub/dist/agent-model-face.js +113 -0
  37. package/superd-hub/dist/exec.d.ts +3 -2
  38. package/superd-hub/dist/exec.js +6 -5
  39. package/superd-hub/dist/fusion-transport.js +0 -1
  40. package/superd-hub/dist/hub-tool.d.ts +1 -1
  41. package/superd-hub/dist/hub-tool.js +6 -6
  42. package/superd-hub/dist/index.d.ts +1 -0
  43. package/superd-hub/dist/index.js +1 -0
  44. package/superd-hub/dist/remote-provider.js +70 -36
  45. package/superd-hub/dist/world-entry.js +30 -0
  46. package/superd-hub/lib/client/index.js +106 -249
  47. package/superd-hub/package.json +14 -10
  48. package/superd-hub/dist/bundle-setup.d.ts +0 -27
  49. package/superd-hub/dist/bundle-setup.js +0 -94
  50. package/superd-hub/dist/client/companion-api.d.ts +0 -5
  51. package/superd-hub/dist/client/companion-api.js +0 -30
  52. package/superd-hub/dist/companion-contract.d.ts +0 -9
  53. package/superd-hub/dist/companion-contract.js +0 -1
  54. package/superd-hub/dist/companions.d.ts +0 -30
  55. package/superd-hub/dist/companions.js +0 -211
  56. package/superd-hub/dist/exec-pty-channel.d.ts +0 -58
  57. package/superd-hub/dist/exec-pty-channel.js +0 -162
  58. package/superd-hub/dist/exec-pty-framing.d.ts +0 -34
  59. package/superd-hub/dist/exec-pty-framing.js +0 -89
  60. package/superd-hub/dist/exec-pty-session.d.ts +0 -78
  61. package/superd-hub/dist/exec-pty-session.js +0 -228
@@ -2271,145 +2271,6 @@ async function removeProvider(agentKey, namespace, id, doFetch) {
2271
2271
  return requireProvidersView(await callRuntimeSettings(agentKey, namespace, "remove", { request: { id } }, doFetch));
2272
2272
  }
2273
2273
 
2274
- //#endregion
2275
- //#region src/client/companion-api.ts
2276
- async function callCompanion(operation, doFetch) {
2277
- const method = `superdCompanions/${operation}`;
2278
- const response = await (doFetch ?? ((path, init) => fetch(path, init)))(`/api/${method}`, {
2279
- method: "POST",
2280
- credentials: "same-origin",
2281
- headers: { "content-type": "application/json" },
2282
- body: JSON.stringify({
2283
- type: "client-request",
2284
- rpcId: mintRpcId(),
2285
- method,
2286
- payload: { args: {} }
2287
- })
2288
- });
2289
- if (!response.ok) throw new Error(`Better Dash: HTTP ${response.status}`);
2290
- let body;
2291
- try {
2292
- body = JSON.parse(await response.text());
2293
- } catch {
2294
- throw new Error("Better Dash: unreadable response");
2295
- }
2296
- const result = body?.result;
2297
- if (result?.ok !== true) throw new Error(result?.error?.message ?? "Better Dash: request failed");
2298
- const value = result.value;
2299
- 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");
2300
- return value;
2301
- }
2302
-
2303
- //#endregion
2304
- //#region src/client/CompanionSettings.tsx
2305
- /** Native plugin switches remain in Plugin Manager; this row provides explicit recovery. */
2306
- function CompanionSettings() {
2307
- const [status, setStatus] = react.default.useState();
2308
- const [error, setError] = react.default.useState();
2309
- const [busy, setBusy] = react.default.useState(false);
2310
- const live = react.default.useRef(false);
2311
- const operation = react.default.useRef(false);
2312
- react.default.useEffect(() => {
2313
- live.current = true;
2314
- let reading = false;
2315
- const refresh = async () => {
2316
- if (reading || operation.current) return;
2317
- reading = true;
2318
- try {
2319
- const next = await callCompanion("getBetterDash");
2320
- if (live.current) {
2321
- setStatus(next);
2322
- setError(next.error);
2323
- }
2324
- } catch (cause) {
2325
- if (live.current) setError(cause instanceof Error ? cause.message : String(cause));
2326
- } finally {
2327
- reading = false;
2328
- }
2329
- };
2330
- refresh();
2331
- const timer = window.setInterval(() => {
2332
- refresh();
2333
- }, 5e3);
2334
- return () => {
2335
- live.current = false;
2336
- window.clearInterval(timer);
2337
- };
2338
- }, []);
2339
- const install = async () => {
2340
- if (operation.current) return;
2341
- operation.current = true;
2342
- setBusy(true);
2343
- setError(void 0);
2344
- try {
2345
- const next = await callCompanion("installBetterDash");
2346
- if (live.current) {
2347
- setStatus(next);
2348
- setError(next.error);
2349
- }
2350
- } catch (cause) {
2351
- if (live.current) setError(cause instanceof Error ? cause.message : String(cause));
2352
- } finally {
2353
- operation.current = false;
2354
- if (live.current) setBusy(false);
2355
- }
2356
- };
2357
- const installing = busy || status?.installing === true;
2358
- const label = status === void 0 ? "Loading…" : status.installed ? `Installed${status.version ? " · " + status.version : ""}${status.enabled === false ? " · Disabled" : ""}` : "Not installed";
2359
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2360
- style: {
2361
- borderRadius: 12,
2362
- padding: "12px 14px",
2363
- background: "var(--dsw-alias-interactive-bg-hover)"
2364
- },
2365
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2366
- style: {
2367
- display: "flex",
2368
- alignItems: "center",
2369
- gap: 16
2370
- },
2371
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2372
- style: { flex: 1 },
2373
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2374
- style: {
2375
- fontSize: 14,
2376
- fontWeight: 600
2377
- },
2378
- children: "Better Dash"
2379
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2380
- role: "status",
2381
- style: {
2382
- fontSize: 12,
2383
- color: "var(--dsw-alias-label-secondary)",
2384
- marginTop: 4
2385
- },
2386
- children: installing ? "Installing…" : label
2387
- })]
2388
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
2389
- type: "button",
2390
- disabled: installing || status?.installed === true,
2391
- onClick: () => {
2392
- install();
2393
- },
2394
- style: {
2395
- padding: "6px 12px",
2396
- borderRadius: 8,
2397
- cursor: installing || status?.installed ? "default" : "pointer"
2398
- },
2399
- children: installing ? "Installing…" : status?.installed ? "Installed" : "Install"
2400
- })]
2401
- }), error && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
2402
- role: "alert",
2403
- style: {
2404
- fontSize: 12,
2405
- margin: "8px 0 0",
2406
- color: "var(--dsw-alias-state-error-primary)"
2407
- },
2408
- children: error
2409
- })]
2410
- });
2411
- }
2412
-
2413
2274
  //#endregion
2414
2275
  //#region src/client/HubPage.tsx
2415
2276
  const EMPTY_DRAFT = {
@@ -2440,6 +2301,16 @@ const chipMonoId = {
2440
2301
  fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace",
2441
2302
  fontSize: 10.5
2442
2303
  };
2304
+ /** Machine-row display name: shrinkable, so an arbitrarily long name can
2305
+ * never force the row wider than the viewport — it ellipsizes like the
2306
+ * origin URL beside it. */
2307
+ const rowNameStyle = {
2308
+ fontWeight: 500,
2309
+ whiteSpace: "nowrap",
2310
+ minWidth: 0,
2311
+ overflow: "hidden",
2312
+ textOverflow: "ellipsis"
2313
+ };
2443
2314
  /** The status dot's fixed part (the color is decided per row). */
2444
2315
  const dotStyle = {
2445
2316
  width: 8,
@@ -2449,7 +2320,7 @@ const dotStyle = {
2449
2320
  };
2450
2321
  /** The machine origin column: monospace, eats the leftover row width. */
2451
2322
  const originStyle = {
2452
- flex: 1,
2323
+ flex: "1 1 150px",
2453
2324
  minWidth: 0,
2454
2325
  overflow: "hidden",
2455
2326
  textOverflow: "ellipsis",
@@ -2563,7 +2434,7 @@ const sectionHeadStyle = {
2563
2434
  * keeps the surface lit while its panel is open, so the open row stays
2564
2435
  * identifiable after the pointer leaves. The switch lives in the row's button.
2565
2436
  */
2566
- function HoverRow({ children, onClick, clickable, expanded }) {
2437
+ function HoverRow({ children, onClick, clickable, expanded, wrap }) {
2567
2438
  const [hover, setHover] = react.useState(false);
2568
2439
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
2569
2440
  onClick,
@@ -2577,7 +2448,8 @@ function HoverRow({ children, onClick, clickable, expanded }) {
2577
2448
  style: {
2578
2449
  display: "flex",
2579
2450
  alignItems: "center",
2580
- gap: 12,
2451
+ flexWrap: wrap ? "wrap" : "nowrap",
2452
+ gap: wrap ? "4px 12px" : 12,
2581
2453
  margin: "0 -8px",
2582
2454
  padding: "9px 8px",
2583
2455
  borderRadius: 12,
@@ -3573,11 +3445,7 @@ function HubPage() {
3573
3445
  gap: 4,
3574
3446
  borderBottom: "1px solid var(--dsw-alias-border-l3)"
3575
3447
  },
3576
- children: [
3577
- ["home", "Home"],
3578
- ["workflows", "Workflows"],
3579
- ["settings", "Settings"]
3580
- ].map(([id, label]) => {
3448
+ children: [["home", "Home"], ["workflows", "Workflows"]].map(([id, label]) => {
3581
3449
  const active = tab === id;
3582
3450
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
3583
3451
  type: "button",
@@ -3619,17 +3487,6 @@ function HubPage() {
3619
3487
  children: "Orchestration across the machines and runtimes above — workflow authoring lands with the hub service."
3620
3488
  })]
3621
3489
  }),
3622
- tab === "settings" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
3623
- style: {
3624
- display: "flex",
3625
- flexDirection: "column",
3626
- gap: 8
3627
- },
3628
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(GroupHead, {
3629
- title: "Settings",
3630
- count: 1
3631
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CompanionSettings, {})]
3632
- }),
3633
3490
  tab === "home" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
3634
3491
  style: {
3635
3492
  display: "flex",
@@ -3716,98 +3573,98 @@ function HubPage() {
3716
3573
  },
3717
3574
  children: "No machines yet — add the first one with its token URL."
3718
3575
  }),
3719
- mesh.self !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(HoverRow, { children: [
3720
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3721
- "aria-hidden": true,
3722
- style: {
3723
- ...dotStyle,
3724
- background: "var(--dsw-alias-state-success-primary)"
3725
- }
3726
- }),
3727
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3728
- style: {
3729
- fontWeight: 500,
3730
- whiteSpace: "nowrap"
3731
- },
3732
- children: mesh.self.label
3733
- }),
3734
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
3735
- style: {
3736
- ...originStyle,
3737
- flex: "0 0 auto"
3738
- },
3739
- children: [hereOrigin, mesh.self.tokenPreview !== void 0 ? `/?token=${mesh.self.tokenPreview}` : ""]
3740
- }),
3741
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
3742
- type: "button",
3743
- "aria-label": "Copy this machine's pairing URL",
3744
- title: pairingBusy ? "Minting pairing URL…" : "Copy the token URL another machine can Add machine with",
3745
- disabled: pairingBusy,
3746
- onClick: () => {
3747
- copyPairingUrl();
3748
- },
3749
- style: iconActionStyle,
3750
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.IconCopyOutlineRegular, { size: 15 })
3751
- }),
3752
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { style: { flex: 1 } }),
3753
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3754
- style: chipMonoId,
3755
- children: mesh.self.id
3756
- }),
3757
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3758
- style: chipSelf,
3759
- children: "self"
3760
- })
3761
- ] }),
3762
- mesh.machines.map((machine) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(HoverRow, { children: [
3763
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3764
- title: machine.status,
3765
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StatusMark, {
3766
- status: machine.status,
3767
- size: 16
3576
+ mesh.self !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(HoverRow, {
3577
+ wrap: true,
3578
+ children: [
3579
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3580
+ "aria-hidden": true,
3581
+ style: {
3582
+ ...dotStyle,
3583
+ background: "var(--dsw-alias-state-success-primary)"
3584
+ }
3585
+ }),
3586
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3587
+ style: rowNameStyle,
3588
+ children: mesh.self.label
3589
+ }),
3590
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
3591
+ style: {
3592
+ ...originStyle,
3593
+ flex: "0 1 auto"
3594
+ },
3595
+ children: [hereOrigin, mesh.self.tokenPreview !== void 0 ? `/?token=${mesh.self.tokenPreview}` : ""]
3596
+ }),
3597
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
3598
+ type: "button",
3599
+ "aria-label": "Copy this machine's pairing URL",
3600
+ title: pairingBusy ? "Minting pairing URL…" : "Copy the token URL another machine can Add machine with",
3601
+ disabled: pairingBusy,
3602
+ onClick: () => {
3603
+ copyPairingUrl();
3604
+ },
3605
+ style: iconActionStyle,
3606
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.IconCopyOutlineRegular, { size: 15 })
3607
+ }),
3608
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { style: { flex: 1 } }),
3609
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3610
+ style: chipMonoId,
3611
+ children: mesh.self.id
3612
+ }),
3613
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3614
+ style: chipSelf,
3615
+ children: "self"
3768
3616
  })
3769
- }),
3770
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3771
- style: {
3772
- fontWeight: 500,
3773
- whiteSpace: "nowrap"
3774
- },
3775
- children: machine.name
3776
- }),
3777
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3778
- style: originStyle,
3779
- children: machine.origin
3780
- }),
3781
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3782
- style: chipMonoId,
3783
- children: machine.id
3784
- }),
3785
- machineVersionChip(machine) !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3786
- style: chipWarn,
3787
- title: `machine ${machine.id}`,
3788
- children: machine.versionWarning
3789
- }),
3790
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
3791
- type: "button",
3792
- "aria-label": `Refresh ${machine.name}`,
3793
- title: `Refresh ${machine.name}`,
3794
- onClick: () => {
3795
- reprobeRemote(machine.id);
3796
- },
3797
- style: iconActionStyle,
3798
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.IconRefreshOutlineRegular, { size: 15 })
3799
- }),
3800
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
3801
- type: "button",
3802
- "aria-label": `Remove ${machine.name}`,
3803
- title: `Remove ${machine.name}`,
3804
- onClick: () => {
3805
- removeRemote(machine.id);
3806
- },
3807
- style: iconActionStyle,
3808
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.IconTrashOutlineRegular, { size: 15 })
3809
- })
3810
- ] }, machine.id))
3617
+ ]
3618
+ }),
3619
+ mesh.machines.map((machine) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(HoverRow, {
3620
+ wrap: true,
3621
+ children: [
3622
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3623
+ title: machine.status,
3624
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StatusMark, {
3625
+ status: machine.status,
3626
+ size: 16
3627
+ })
3628
+ }),
3629
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3630
+ style: rowNameStyle,
3631
+ children: machine.name
3632
+ }),
3633
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3634
+ style: originStyle,
3635
+ children: machine.origin
3636
+ }),
3637
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3638
+ style: chipMonoId,
3639
+ children: machine.id
3640
+ }),
3641
+ machineVersionChip(machine) !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3642
+ style: chipWarn,
3643
+ title: `machine ${machine.id}`,
3644
+ children: machine.versionWarning
3645
+ }),
3646
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
3647
+ type: "button",
3648
+ "aria-label": `Refresh ${machine.name}`,
3649
+ title: `Refresh ${machine.name}`,
3650
+ onClick: () => {
3651
+ reprobeRemote(machine.id);
3652
+ },
3653
+ style: iconActionStyle,
3654
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.IconRefreshOutlineRegular, { size: 15 })
3655
+ }),
3656
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
3657
+ type: "button",
3658
+ "aria-label": `Remove ${machine.name}`,
3659
+ title: `Remove ${machine.name}`,
3660
+ onClick: () => {
3661
+ removeRemote(machine.id);
3662
+ },
3663
+ style: iconActionStyle,
3664
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.IconTrashOutlineRegular, { size: 15 })
3665
+ })
3666
+ ]
3667
+ }, machine.id))
3811
3668
  ]
3812
3669
  }),
3813
3670
  showAdd && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
@@ -45,16 +45,17 @@
45
45
  "peerDependencies": {
46
46
  "@earendil-works/pi-coding-agent": "0.84.2",
47
47
  "@deepseek-ai/cordis": "*",
48
- "@deepseek-ai/dsh-api-gateway": ">=0.1.5-0 <0.3.0-0",
49
- "@deepseek-ai/dsh-home-paths": ">=0.1.5-0 <0.3.0-0",
50
- "@deepseek-ai/dsh-host-webserver": ">=0.1.5-0 <0.3.0-0",
51
- "@deepseek-ai/dsh-tools": ">=0.1.5-0 <0.3.0-0",
52
- "@deepseek-ai/dsh-typert-protocol": ">=0.1.5-0 <0.3.0-0",
53
- "@deepseek-ai/dsh-client-connection": ">=0.1.5-0 <0.3.0-0",
54
- "@deepseek-ai/dsh-app-boot": ">=0.1.5-0 <0.3.0-0",
55
- "@deepseek-ai/dsh-atomic-write": ">=0.1.5-0 <0.3.0-0",
56
- "@deepseek-ai/dsh-cmdline": ">=0.1.5-0 <0.3.0-0",
57
- "@deepseek-ai/dsh-plugin-manager": ">=0.1.5-0 <0.3.0-0"
48
+ "@deepseek-ai/dsh-agent": ">=0.2.0-0 <1.0.0-0",
49
+ "@deepseek-ai/dsh-api-gateway": ">=0.2.0-0 <1.0.0-0",
50
+ "@deepseek-ai/dsh-home-paths": ">=0.2.0-0 <1.0.0-0",
51
+ "@deepseek-ai/dsh-host-webserver": ">=0.2.0-0 <1.0.0-0",
52
+ "@deepseek-ai/dsh-tools": ">=0.2.0-0 <1.0.0-0",
53
+ "@deepseek-ai/dsh-typert-protocol": ">=0.2.0-0 <1.0.0-0",
54
+ "@deepseek-ai/dsh-client-connection": ">=0.2.0-0 <1.0.0-0",
55
+ "@deepseek-ai/dsh-app-boot": ">=0.2.0-0 <1.0.0-0",
56
+ "@deepseek-ai/dsh-atomic-write": ">=0.2.0-0 <1.0.0-0",
57
+ "@deepseek-ai/dsh-cmdline": ">=0.2.0-0 <1.0.0-0",
58
+ "@deepseek-ai/dsh-plugin-manager": ">=0.2.0-0 <1.0.0-0"
58
59
  },
59
60
  "peerDependenciesMeta": {
60
61
  "@earendil-works/pi-coding-agent": {
@@ -66,6 +67,9 @@
66
67
  "@deepseek-ai/dsh-api-gateway": {
67
68
  "optional": true
68
69
  },
70
+ "@deepseek-ai/dsh-agent": {
71
+ "optional": true
72
+ },
69
73
  "@deepseek-ai/dsh-home-paths": {
70
74
  "optional": true
71
75
  },
@@ -1,27 +0,0 @@
1
- /** Better Dash is installed by the current profile's native Plugin Manager. */
2
- import type { Context } from '@deepseek-ai/cordis';
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';
8
- export declare const name = "superd-bundle-setup";
9
- export declare const inject: string[];
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>;
20
- }
21
- export declare function apply(ctx: Context): void;
22
- declare const _default: {
23
- name: string;
24
- inject: string[];
25
- apply: typeof apply;
26
- };
27
- export default _default;
@@ -1,94 +0,0 @@
1
- var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
2
- var useValue = arguments.length > 2;
3
- for (var i = 0; i < initializers.length; i++) {
4
- value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
5
- }
6
- return useValue ? value : void 0;
7
- };
8
- var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
9
- function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
10
- var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
11
- var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
12
- var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
13
- var _, done = false;
14
- for (var i = decorators.length - 1; i >= 0; i--) {
15
- var context = {};
16
- for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
17
- for (var p in contextIn.access) context.access[p] = contextIn.access[p];
18
- context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
19
- var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
20
- if (kind === "accessor") {
21
- if (result === void 0) continue;
22
- if (result === null || typeof result !== "object") throw new TypeError("Object expected");
23
- if (_ = accept(result.get)) descriptor.get = _;
24
- if (_ = accept(result.set)) descriptor.set = _;
25
- if (_ = accept(result.init)) initializers.unshift(_);
26
- }
27
- else if (_ = accept(result)) {
28
- if (kind === "field") initializers.unshift(_);
29
- else descriptor[key] = _;
30
- }
31
- }
32
- if (target) Object.defineProperty(target, contextIn.name, descriptor);
33
- done = true;
34
- };
35
- import { Remote, TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
36
- import { BetterDashCompanion } from './companions.js';
37
- import { PACK_VERSION } from './pack-version.js';
38
- export { BetterDashCompanion } from './companions.js';
39
- export const name = 'superd-bundle-setup';
40
- export const inject = ['profileContext', 'appReady'];
41
- let SuperdCompanions = (() => {
42
- let _classSuper = TypertRemoteService;
43
- let _instanceExtraInitializers = [];
44
- let _getBetterDash_decorators;
45
- let _installBetterDash_decorators;
46
- return class SuperdCompanions extends _classSuper {
47
- static {
48
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
49
- _getBetterDash_decorators = [Remote];
50
- _installBetterDash_decorators = [Remote];
51
- __esDecorate(this, null, _getBetterDash_decorators, { kind: "method", name: "getBetterDash", static: false, private: false, access: { has: obj => "getBetterDash" in obj, get: obj => obj.getBetterDash }, metadata: _metadata }, null, _instanceExtraInitializers);
52
- __esDecorate(this, null, _installBetterDash_decorators, { kind: "method", name: "installBetterDash", static: false, private: false, access: { has: obj => "installBetterDash" in obj, get: obj => obj.installBetterDash }, metadata: _metadata }, null, _instanceExtraInitializers);
53
- if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
54
- }
55
- companion = __runInitializers(this, _instanceExtraInitializers);
56
- constructor(ctx, companion) {
57
- super(ctx, 'superdCompanions');
58
- this.companion = companion;
59
- }
60
- getBetterDash() { return this.companion.getBetterDash(); }
61
- installBetterDash() { return this.companion.installBetterDash(); }
62
- };
63
- })();
64
- export { SuperdCompanions };
65
- export function apply(ctx) {
66
- const companion = new BetterDashCompanion(ctx.profileContext, PACK_VERSION, () => ctx.get('pluginManager'));
67
- new SuperdCompanions(ctx, companion);
68
- ctx.effect(() => {
69
- let ready = false, registering = true;
70
- const start = () => {
71
- void companion.ensureAutomatic().then(status => {
72
- if (status.error !== undefined)
73
- ctx.logger.warn(status.error);
74
- }).catch(error => ctx.logger.warn('Better Dash companion status failed', error));
75
- };
76
- const offReady = ctx.appReady.onReady(() => {
77
- ready = true;
78
- // Cold readiness occurs after boot, outside HMR. A live mount gets an
79
- // immediate callback while its parent HMR transaction is still active:
80
- // wait for the native changed notification below instead.
81
- if (!registering)
82
- start();
83
- });
84
- registering = false;
85
- const offChange = ctx.on('plugin-manager/changed', () => {
86
- // Native configure/HMR has finished here, but the parent's profile lock
87
- // is still held. Return immediately; child install queues that lock.
88
- if (ready)
89
- start();
90
- });
91
- return () => { offReady(); offChange(); companion.dispose(); };
92
- }, 'bundle-delivery: native companions');
93
- }
94
- export default { name, inject, apply };
@@ -1,5 +0,0 @@
1
- /** Local ctx0 companion management, independent of the selected agent world. */
2
- import { type FetchLike } from './runtime-settings-api.js';
3
- import type { BetterDashStatus } from '../companion-contract.js';
4
- export type CompanionOperation = 'getBetterDash' | 'installBetterDash';
5
- export declare function callCompanion(operation: CompanionOperation, doFetch?: FetchLike): Promise<BetterDashStatus>;
@@ -1,30 +0,0 @@
1
- /** Local ctx0 companion management, independent of the selected agent world. */
2
- import { mintRpcId } from './runtime-settings-api.js';
3
- export async function callCompanion(operation, doFetch) {
4
- const method = `superdCompanions/${operation}`;
5
- const send = doFetch ?? ((path, init) => fetch(path, init));
6
- const response = await send(`/api/${method}`, {
7
- method: 'POST', credentials: 'same-origin', headers: { 'content-type': 'application/json' },
8
- body: JSON.stringify({ type: 'client-request', rpcId: mintRpcId(), method, payload: { args: {} } }),
9
- });
10
- if (!response.ok)
11
- throw new Error(`Better Dash: HTTP ${response.status}`);
12
- let body;
13
- try {
14
- body = JSON.parse(await response.text());
15
- }
16
- catch {
17
- throw new Error('Better Dash: unreadable response');
18
- }
19
- const result = body?.result;
20
- if (result?.ok !== true)
21
- throw new Error(result?.error?.message ?? 'Better Dash: request failed');
22
- const value = result.value;
23
- if (value === null || typeof value !== 'object' || typeof value.installed !== 'boolean'
24
- || typeof value.installing !== 'boolean' || typeof value.requestedVersion !== 'string'
25
- || (value.version !== undefined && typeof value.version !== 'string')
26
- || (value.enabled !== undefined && typeof value.enabled !== 'boolean')
27
- || (value.error !== undefined && typeof value.error !== 'string'))
28
- throw new Error('Better Dash: invalid status');
29
- return value;
30
- }
@@ -1,9 +0,0 @@
1
- /** Browser-safe ctx0 companion status returned by the native unary API. */
2
- export interface BetterDashStatus {
3
- installed: boolean;
4
- version?: string;
5
- enabled?: boolean;
6
- installing: boolean;
7
- error?: string;
8
- requestedVersion: string;
9
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,30 +0,0 @@
1
- import type { ProfileContext } from '@deepseek-ai/dsh-app-boot';
2
- import type { PluginManager } from '@deepseek-ai/dsh-plugin-manager';
3
- import type { BetterDashStatus } from './companion-contract.js';
4
- type Manager = Pick<PluginManager, 'listBundles' | 'installBundle'>;
5
- /** One controller per native profile; no package, registry, HMR or selection writer of its own. */
6
- export declare class BetterDashCompanion {
7
- private readonly version;
8
- private readonly manager;
9
- private readonly directory;
10
- private readonly receipt;
11
- private readonly legacy;
12
- private initialized?;
13
- private intent;
14
- private active?;
15
- private stopped;
16
- private restartNotice?;
17
- constructor(profile: Pick<ProfileContext, 'home' | 'dir'>, version: string, manager: () => Manager | undefined);
18
- private initialize;
19
- private cleanLegacy;
20
- private save;
21
- getBetterDash(): Promise<BetterDashStatus>;
22
- ensureAutomatic(): Promise<BetterDashStatus>;
23
- installBetterDash(): Promise<BetterDashStatus>;
24
- private run;
25
- private install;
26
- /** Read-only observation: an intermediate native event must never trigger reinstatement. */
27
- observeNativeChange(): Promise<BetterDashStatus>;
28
- dispose(): void;
29
- }
30
- export {};