@sessionbus/dsh 0.1.0-pre.7 → 0.1.0-pre.8

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 (2) hide show
  1. package/install.mjs +11 -4
  2. package/package.json +1 -1
package/install.mjs CHANGED
@@ -141,7 +141,8 @@ export function install(profileNames = [], options = {}) {
141
141
  if (!validProfile(name)) throw new Error(`invalid profile name ${JSON.stringify(name)}`);
142
142
  const profile = path.join(home, "profiles", name);
143
143
  const manifestFile = path.join(profile, "package.json");
144
- let manifest = existsSync(manifestFile) ? JSON.parse(readFileSync(manifestFile, "utf8")) : null;
144
+ const existed = existsSync(manifestFile);
145
+ let manifest = existed ? JSON.parse(readFileSync(manifestFile, "utf8")) : null;
145
146
  if (!manifest?.dependencies?.["@sessionbus/dsh"]) {
146
147
  const result = run(["plugin", "--profile", name, "add", "@sessionbus/dsh"]);
147
148
  if (result.status !== 0) throw new Error(String(result.stderr || "dsh plugin add failed").trim());
@@ -153,12 +154,18 @@ export function install(profileNames = [], options = {}) {
153
154
  if (name !== "web") convergePatch(patch, noUploadsID, noUploadsPatch);
154
155
  continue;
155
156
  }
156
- manifest = {
157
- name: "dsh-profile-sessionbus",
158
- private: true,
157
+ if (!existed) manifest = {
158
+ name: "dsh-profile-sessionbus", private: true,
159
159
  dependencies: { "@sessionbus/dsh": manifest.dependencies["@sessionbus/dsh"] },
160
160
  dsh: { profile: { bundles: ["@deepseek-ai/dsh-base"], patchReload: "startup" } },
161
161
  };
162
+ else {
163
+ manifest.dsh ??= {};
164
+ manifest.dsh.profile ??= {};
165
+ manifest.dsh.profile.bundles ??= [];
166
+ if (!Array.isArray(manifest.dsh.profile.bundles)) throw new Error("sessionbus profile bundles must be an array");
167
+ if (!manifest.dsh.profile.bundles.includes("@deepseek-ai/dsh-base")) manifest.dsh.profile.bundles.push("@deepseek-ai/dsh-base");
168
+ }
162
169
  writeChanged(manifestFile, `${JSON.stringify(manifest, null, 2)}\n`);
163
170
  writeChanged(path.join(profile, "cordis.patch.yml"), profilePatch(laneProduct));
164
171
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sessionbus/dsh",
3
- "version": "0.1.0-pre.7",
3
+ "version": "0.1.0-pre.8",
4
4
  "type": "commonjs",
5
5
  "main": "plugin.cjs",
6
6
  "exports": "./plugin.cjs",