@sessionbus/dsh 0.1.0-pre.6 → 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.
- package/README.md +6 -0
- package/install.mjs +11 -4
- package/package.json +1 -1
- package/plugin.cjs +12 -3
package/README.md
CHANGED
|
@@ -19,6 +19,8 @@ lifetime (trusted host).
|
|
|
19
19
|
|
|
20
20
|
See [Installing a DSH lane host](docs/HOST-INSTALL.md) for the complete
|
|
21
21
|
preflight, installation, verification, and rollback procedure.
|
|
22
|
+
Its provider-parity step must be completed for both the lane and plain peer
|
|
23
|
+
profiles before either one runs a model turn.
|
|
22
24
|
|
|
23
25
|
Create the base-only lane profile for the package-owned `sessionbus-dsh`
|
|
24
26
|
product with:
|
|
@@ -72,4 +74,8 @@ installer removes the package first, then strips its managed `sessionbus` and
|
|
|
72
74
|
`SESSIONBUS_GROUPS` configures peer identities only. Lane membership is owned
|
|
73
75
|
by the daemon; the plugin accepts and does not consume groups in `session.open`.
|
|
74
76
|
|
|
77
|
+
## Run results
|
|
78
|
+
|
|
79
|
+
A DSH error before its input commit returns `failed`, native stop reason `error`, and result `<code>: <message>` verbatim from the durable `turn/end`.
|
|
80
|
+
|
|
75
81
|
See [Lane without a TUI](docs/LANE-WITHOUT-TUI.md) for the daemon launch contract.
|
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
|
-
|
|
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
package/plugin.cjs
CHANGED
|
@@ -191,15 +191,23 @@ class NativeSession {
|
|
|
191
191
|
run.turn = run.openTurn;
|
|
192
192
|
}
|
|
193
193
|
if (event.type === "assistant/message" && run.turn === event.data.turn) run.output += textOf(event.data.message);
|
|
194
|
-
|
|
195
|
-
|
|
194
|
+
const earlyError = event.type === "turn/end" && run.turn === null && run.openTurn === event.data.turn && event.data.reason?.kind === "error";
|
|
195
|
+
if (event.type === "turn/end" && (run.turn === event.data.turn || earlyError)) {
|
|
196
|
+
try {
|
|
197
|
+
run.end = terminal(event.data.reason);
|
|
198
|
+
if (earlyError) run.output = `${event.data.reason.error.code}: ${event.data.reason.error.message}`;
|
|
199
|
+
}
|
|
196
200
|
catch (error) { run.endError = error; }
|
|
197
201
|
}
|
|
198
202
|
}
|
|
199
203
|
|
|
200
204
|
async run(cancel, token, input) {
|
|
201
205
|
if (token.Interrupted()) return { outcome: "interrupted", result: "" };
|
|
202
|
-
|
|
206
|
+
// @sessionbus/kit sdk/js/index.js:108-120 passes its text or delivery seed here.
|
|
207
|
+
const delivery = typeof input?.delivery?.body === "string" ? input.delivery : undefined;
|
|
208
|
+
const body = typeof input === "string" ? input : typeof input?.text === "string" ? input.text : delivery?.body;
|
|
209
|
+
if (body === undefined) throw new Error("sessionbus received an unexpected run input seed shape");
|
|
210
|
+
const message = this.message(body);
|
|
203
211
|
const record = { message, openTurn: null, turn: null, output: "", cancelled: deferred() };
|
|
204
212
|
const receipt = this.receipt(message, this.agent.session, cancel);
|
|
205
213
|
this.active = record;
|
|
@@ -211,6 +219,7 @@ class NativeSession {
|
|
|
211
219
|
try { this.agent.followup(message); }
|
|
212
220
|
catch (error) { receipt.reject(error); throw error; }
|
|
213
221
|
await receipt.promise;
|
|
222
|
+
if (delivery) await token.ReportDelivery({ disposition: "injected" });
|
|
214
223
|
const idle = this.agent.whenIdle();
|
|
215
224
|
idle.catch(() => {});
|
|
216
225
|
await Promise.race([idle, record.cancelled.promise]);
|