@sessionbus/dsh 0.1.0-pre.4 → 0.1.0-pre.6

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 (3) hide show
  1. package/README.md +17 -7
  2. package/install.mjs +5 -4
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -20,12 +20,22 @@ lifetime (trusted host).
20
20
  See [Installing a DSH lane host](docs/HOST-INSTALL.md) for the complete
21
21
  preflight, installation, verification, and rollback procedure.
22
22
 
23
- Create the base-only lane profile with:
23
+ Create the base-only lane profile for the package-owned `sessionbus-dsh`
24
+ product with:
24
25
 
25
26
  ```sh
26
27
  dsh plugin --profile sessionbus add @sessionbus/dsh && dsh plugin --profile sessionbus exec sessionbus-dsh-install
27
28
  ```
28
29
 
30
+ On a host that already uses dashi, one product can own both peers and lanes:
31
+
32
+ ```sh
33
+ dsh plugin --profile sessionbus add @sessionbus/dsh && dsh plugin --profile sessionbus exec sessionbus-dsh-install --product dashi
34
+ ```
35
+
36
+ In that form `SESSIONBUS_PRODUCTS` contains `dashi`, not `sessionbus-dsh`,
37
+ and the daemon maps it to `@antst/dashi-launcher`'s `dashi` bin.
38
+
29
39
  Add the peer plugin to another profile, such as `web`, with:
30
40
 
31
41
  ```sh
@@ -41,12 +51,12 @@ operator-chosen identifier matching `^[a-z0-9][a-z0-9-]{0,31}$`.
41
51
  Non-web profiles also receive the no-upload provider required by DSH's Session
42
52
  Controller; ordinary text prompts work while file-upload receipts are rejected.
43
53
 
44
- Register the daemon's `sessionbus-dsh` product command as the package's
45
- `sessionbus-dsh` bin. With a launch token it selects the installed `sessionbus`
46
- profile; without one it forwards arguments to `dsh` unchanged.
47
- The daemon finds that command on `PATH`, so install this package alongside
48
- `dsh` at the host level too—for example, run `pnpm add @sessionbus/dsh` in the
49
- directory where `dsh` is installed—so both bins share one `node_modules/.bin`.
54
+ For the two-product form, register the daemon's `sessionbus-dsh` product as the
55
+ package's `sessionbus-dsh` bin. For the one-product form, register only `dashi`
56
+ as the `dashi` bin. Both launchers select the installed `sessionbus` profile
57
+ when given a launch token. Install the selected launcher alongside `dsh` at the
58
+ host level and put their shared `node_modules/.bin` on the daemon service's
59
+ `PATH`; the `dashi` launcher resolves its child `dsh` by name.
50
60
 
51
61
  Uninstall without invoking DSH by running the installed bin from the profile:
52
62
 
package/install.mjs CHANGED
@@ -6,7 +6,7 @@ import path from "node:path";
6
6
  import { fileURLToPath } from "node:url";
7
7
  import { spawnSync } from "node:child_process";
8
8
 
9
- const profilePatch = `- id: system-prompt
9
+ const profilePatch = (product) => `- id: system-prompt
10
10
  config:
11
11
  persona: >-
12
12
  You are a coding agent powered by the {{model}} model. Your working directory is {{cwd}}.
@@ -26,7 +26,7 @@ const profilePatch = `- id: system-prompt
26
26
  - { id: session-controller, name: '@deepseek-ai/dsh-api-session-controller' }
27
27
  - id: sessionbus
28
28
  name: '@sessionbus/dsh'
29
- config: { mode: lane, product: sessionbus-dsh }
29
+ config: { mode: lane, product: ${product} }
30
30
  `;
31
31
  const peerPatch = (product) => `- insert:
32
32
  - { id: sessionbus, name: '@sessionbus/dsh', config: { product: ${product} } }
@@ -133,8 +133,9 @@ export function install(profileNames = [], options = {}) {
133
133
  const root = options.root || path.dirname(fileURLToPath(import.meta.url));
134
134
  const run = options.run || ((args) => spawnSync("dsh", args, { cwd: root, encoding: "utf8" }));
135
135
  const names = [...new Set(profileNames.length ? profileNames : ["sessionbus"])];
136
+ const laneProduct = options.product ?? "sessionbus-dsh";
136
137
  if (options.product !== undefined && (typeof options.product !== "string" || !productPattern.test(options.product))) throw new Error(`invalid product ${JSON.stringify(options.product)}; expected ^[a-z0-9][a-z0-9-]{0,31}$`);
137
- if (names.includes("sessionbus") && options.product !== undefined && options.product !== "sessionbus-dsh") throw new Error("the sessionbus profile product must be sessionbus-dsh");
138
+ if (names.includes("sessionbus") && !["sessionbus-dsh", "dashi"].includes(laneProduct)) throw new Error("the sessionbus profile product must be sessionbus-dsh or dashi");
138
139
  if (names.some((name) => name !== "sessionbus") && options.product === undefined) throw new Error("--product is required for peer profiles");
139
140
  for (const name of names) {
140
141
  if (!validProfile(name)) throw new Error(`invalid profile name ${JSON.stringify(name)}`);
@@ -159,7 +160,7 @@ export function install(profileNames = [], options = {}) {
159
160
  dsh: { profile: { bundles: ["@deepseek-ai/dsh-base"], patchReload: "startup" } },
160
161
  };
161
162
  writeChanged(manifestFile, `${JSON.stringify(manifest, null, 2)}\n`);
162
- writeChanged(path.join(profile, "cordis.patch.yml"), profilePatch);
163
+ writeChanged(path.join(profile, "cordis.patch.yml"), profilePatch(laneProduct));
163
164
  }
164
165
  }
165
166
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sessionbus/dsh",
3
- "version": "0.1.0-pre.4",
3
+ "version": "0.1.0-pre.6",
4
4
  "type": "commonjs",
5
5
  "main": "plugin.cjs",
6
6
  "exports": "./plugin.cjs",