dsh-wsr-execution 0.2.8 → 0.2.10

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
@@ -21,6 +21,6 @@ and exact MIT provenance are documented under
21
21
  `src/client/delivery-inventory/UPSTREAM.md`.
22
22
 
23
23
  The compatible `wsr-execution@^0.2.0` peer comes from the immutable GitHub
24
- `0.2.6` release asset recorded in `package.json`, not ambient npm resolution. Install that
24
+ `0.2.7` release asset recorded in `package.json`, not ambient npm resolution. Install that
25
25
  asset as an explicit DSH profile root alongside this adapter; its required
26
- SHA-256 is `0b889b707b5fdc84d934e6c807ce101b4edaa356409253a1f48d6ffca7f53420`.
26
+ SHA-256 is `bb3718360946d114251def2f1a975ee783974c2c0d959dbb4289e8955f4b5acc`.
package/lib/client.js CHANGED
@@ -3364,7 +3364,7 @@ function projectDeliveryInventory(state, { selectedSessionId } = {}) {
3364
3364
 
3365
3365
  // packages/execution/src/client/delivery-inventory/sidebar.js
3366
3366
  var STYLE_ID = "dsh-wsr-execution-delivery-inventory";
3367
- var CSS = ".wsr-sidebar-resources{min-height:0;flex:1;display:flex;flex-direction:column;gap:4px}.wsr-sidebar-resource{min-height:0;display:flex;flex-direction:column}.wsr-sidebar-resource:first-child{flex:1}.wsr-sidebar-resource-header{box-sizing:border-box;width:100%;height:36px;cursor:pointer;color:var(--dsw-alias-label-tertiary);background:transparent;border:0;border-radius:8px;display:flex;align-items:center;gap:6px;padding:0 8px;font-size:13px;text-align:left}.wsr-sidebar-resource-header:hover{background:var(--dsw-alias-interactive-bg-hover)}.wsr-delivery-row{box-sizing:border-box;width:100%;height:32px;cursor:pointer;color:var(--dsw-alias-label-primary);background:transparent;border:0;border-radius:8px;display:flex;align-items:center;gap:6px;padding:0 8px;font-size:14px;line-height:20px;text-align:left}.wsr-delivery-row:hover,.wsr-delivery-row[aria-current=page]{background:var(--dsw-alias-interactive-bg-hover)}.wsr-delivery-row:disabled{cursor:default}.wsr-delivery-row>span:first-child{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden;flex:1}.wsr-delivery-status{color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:20px}.wsr-delivery-status-recoverable{color:var(--dsw-alias-state-warning-primary)}";
3367
+ var CSS = ".wsr-sidebar-resources{box-sizing:border-box;height:100%;min-height:0;flex:1 1 0;overflow:hidden;display:flex;flex-direction:column;gap:4px}.wsr-sidebar-resource{min-height:36px;flex:0 0 auto;overflow:hidden;display:flex;flex-direction:column}.wsr-sidebar-resource[data-expanded=true]{min-height:0;flex:1 1 0}.wsr-sidebar-resource-content{min-height:0;flex:1 1 auto;overflow:auto;overscroll-behavior:contain}.wsr-sidebar-resource-header{box-sizing:border-box;width:100%;height:36px;flex:0 0 36px;cursor:pointer;color:var(--dsw-alias-label-tertiary);background:transparent;border:0;border-radius:8px;display:flex;align-items:center;gap:6px;padding:0 8px;font-size:13px;text-align:left}.wsr-sidebar-resource-header:hover{background:var(--dsw-alias-interactive-bg-hover)}.wsr-delivery-row{box-sizing:border-box;width:100%;height:32px;cursor:pointer;color:var(--dsw-alias-label-primary);background:transparent;border:0;border-radius:8px;display:flex;align-items:center;gap:6px;padding:0 8px;font-size:14px;line-height:20px;text-align:left}.wsr-delivery-row:hover,.wsr-delivery-row[aria-current=page]{background:var(--dsw-alias-interactive-bg-hover)}.wsr-delivery-row:disabled{cursor:default}.wsr-delivery-row>span:first-child{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden;flex:1}.wsr-delivery-status{color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:20px}.wsr-delivery-status-recoverable{color:var(--dsw-alias-state-warning-primary)}";
3368
3368
  function installStyle() {
3369
3369
  if (typeof document === "undefined" || document.getElementById(STYLE_ID) !== null) return;
3370
3370
  const tag = document.createElement("style");
@@ -3421,16 +3421,17 @@ function createSidebarResources(React2, WorkspaceBrowser, inventory) {
3421
3421
  { className: "wsr-sidebar-resources", "data-wsr-sidebar-resources": "true" },
3422
3422
  React2.createElement(
3423
3423
  "section",
3424
- { className: "wsr-sidebar-resource", "aria-label": "Workspace" },
3424
+ { className: "wsr-sidebar-resource", "data-expanded": workspaceExpanded, "aria-label": "Workspace" },
3425
3425
  header("wsr-sidebar-workspace", "Workspace", workspaceExpanded, "workspace"),
3426
- workspaceExpanded && React2.createElement("div", { id: "wsr-sidebar-workspace" }, React2.createElement(WorkspaceBrowser, props))
3426
+ workspaceExpanded && React2.createElement("div", { id: "wsr-sidebar-workspace", className: "wsr-sidebar-resource-content" }, React2.createElement(WorkspaceBrowser, props))
3427
3427
  ),
3428
3428
  React2.createElement(
3429
3429
  "section",
3430
- { className: "wsr-sidebar-resource", "aria-label": "Delivery" },
3430
+ { className: "wsr-sidebar-resource", "data-expanded": deliveryExpanded, "aria-label": "Delivery" },
3431
3431
  header("wsr-sidebar-delivery", "Delivery", deliveryExpanded, "delivery"),
3432
3432
  deliveryExpanded && React2.createElement("div", {
3433
3433
  id: "wsr-sidebar-delivery",
3434
+ className: "wsr-sidebar-resource-content",
3434
3435
  role: view.kind === "error" ? "alert" : "region",
3435
3436
  "aria-live": "polite"
3436
3437
  }, view.kind === "ready" ? React2.createElement("div", { role: "list", "aria-label": "Deliveries" }, view.rows.map((row) => React2.createElement("button", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-wsr-execution",
3
- "version": "0.2.8",
3
+ "version": "0.2.10",
4
4
  "description": "DeepSeek Harness adapter bundle for WSR Intake, Delivery resources, Session state, Actions, and final results.",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
@@ -39,10 +39,10 @@
39
39
  "displayName": "WSR",
40
40
  "role": "execution-adapter",
41
41
  "foundationOnly": false,
42
- "ownerRevision": "0e8d937570de451f32764a99e9f6c5dfdb55474f",
42
+ "ownerRevision": "de2335c7a869aff7c010100bcb809fe2d499dced",
43
43
  "ownerAsset": {
44
- "url": "https://github.com/firestige/wsr-execution/releases/download/0.2.6/wsr-execution-0.2.6.tgz",
45
- "sha256": "8aee92d34018a9e48ec52630faf9774f02e563b846d910a77e8adab165eb468e"
44
+ "url": "https://github.com/firestige/wsr-execution/releases/download/0.2.7/wsr-execution-0.2.7.tgz",
45
+ "sha256": "bb3718360946d114251def2f1a975ee783974c2c0d959dbb4289e8955f4b5acc"
46
46
  }
47
47
  },
48
48
  "dependencies": {
@@ -1,7 +1,7 @@
1
1
  import { projectDeliveryInventory } from "./model.js";
2
2
 
3
3
  const STYLE_ID = "dsh-wsr-execution-delivery-inventory";
4
- const CSS = ".wsr-sidebar-resources{min-height:0;flex:1;display:flex;flex-direction:column;gap:4px}.wsr-sidebar-resource{min-height:0;display:flex;flex-direction:column}.wsr-sidebar-resource:first-child{flex:1}.wsr-sidebar-resource-header{box-sizing:border-box;width:100%;height:36px;cursor:pointer;color:var(--dsw-alias-label-tertiary);background:transparent;border:0;border-radius:8px;display:flex;align-items:center;gap:6px;padding:0 8px;font-size:13px;text-align:left}.wsr-sidebar-resource-header:hover{background:var(--dsw-alias-interactive-bg-hover)}.wsr-delivery-row{box-sizing:border-box;width:100%;height:32px;cursor:pointer;color:var(--dsw-alias-label-primary);background:transparent;border:0;border-radius:8px;display:flex;align-items:center;gap:6px;padding:0 8px;font-size:14px;line-height:20px;text-align:left}.wsr-delivery-row:hover,.wsr-delivery-row[aria-current=page]{background:var(--dsw-alias-interactive-bg-hover)}.wsr-delivery-row:disabled{cursor:default}.wsr-delivery-row>span:first-child{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden;flex:1}.wsr-delivery-status{color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:20px}.wsr-delivery-status-recoverable{color:var(--dsw-alias-state-warning-primary)}";
4
+ const CSS = ".wsr-sidebar-resources{box-sizing:border-box;height:100%;min-height:0;flex:1 1 0;overflow:hidden;display:flex;flex-direction:column;gap:4px}.wsr-sidebar-resource{min-height:36px;flex:0 0 auto;overflow:hidden;display:flex;flex-direction:column}.wsr-sidebar-resource[data-expanded=true]{min-height:0;flex:1 1 0}.wsr-sidebar-resource-content{min-height:0;flex:1 1 auto;overflow:auto;overscroll-behavior:contain}.wsr-sidebar-resource-header{box-sizing:border-box;width:100%;height:36px;flex:0 0 36px;cursor:pointer;color:var(--dsw-alias-label-tertiary);background:transparent;border:0;border-radius:8px;display:flex;align-items:center;gap:6px;padding:0 8px;font-size:13px;text-align:left}.wsr-sidebar-resource-header:hover{background:var(--dsw-alias-interactive-bg-hover)}.wsr-delivery-row{box-sizing:border-box;width:100%;height:32px;cursor:pointer;color:var(--dsw-alias-label-primary);background:transparent;border:0;border-radius:8px;display:flex;align-items:center;gap:6px;padding:0 8px;font-size:14px;line-height:20px;text-align:left}.wsr-delivery-row:hover,.wsr-delivery-row[aria-current=page]{background:var(--dsw-alias-interactive-bg-hover)}.wsr-delivery-row:disabled{cursor:default}.wsr-delivery-row>span:first-child{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden;flex:1}.wsr-delivery-status{color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:20px}.wsr-delivery-status-recoverable{color:var(--dsw-alias-state-warning-primary)}";
5
5
 
6
6
  function installStyle() {
7
7
  if (typeof document === "undefined" || document.getElementById(STYLE_ID) !== null) return;
@@ -50,13 +50,14 @@ export function createSidebarResources(React, WorkspaceBrowser, inventory) {
50
50
  },
51
51
  }, React.createElement("span", { "aria-hidden": "true" }, expanded ? "▾" : "▸"), label);
52
52
  return React.createElement("div", { className: "wsr-sidebar-resources", "data-wsr-sidebar-resources": "true" },
53
- React.createElement("section", { className: "wsr-sidebar-resource", "aria-label": "Workspace" },
53
+ React.createElement("section", { className: "wsr-sidebar-resource", "data-expanded": workspaceExpanded, "aria-label": "Workspace" },
54
54
  header("wsr-sidebar-workspace", "Workspace", workspaceExpanded, "workspace"),
55
- workspaceExpanded && React.createElement("div", { id: "wsr-sidebar-workspace" }, React.createElement(WorkspaceBrowser, props))),
56
- React.createElement("section", { className: "wsr-sidebar-resource", "aria-label": "Delivery" },
55
+ workspaceExpanded && React.createElement("div", { id: "wsr-sidebar-workspace", className: "wsr-sidebar-resource-content" }, React.createElement(WorkspaceBrowser, props))),
56
+ React.createElement("section", { className: "wsr-sidebar-resource", "data-expanded": deliveryExpanded, "aria-label": "Delivery" },
57
57
  header("wsr-sidebar-delivery", "Delivery", deliveryExpanded, "delivery"),
58
58
  deliveryExpanded && React.createElement("div", {
59
- id: "wsr-sidebar-delivery", role: view.kind === "error" ? "alert" : "region", "aria-live": "polite",
59
+ id: "wsr-sidebar-delivery", className: "wsr-sidebar-resource-content",
60
+ role: view.kind === "error" ? "alert" : "region", "aria-live": "polite",
60
61
  }, view.kind === "ready"
61
62
  ? React.createElement("div", { role: "list", "aria-label": "Deliveries" }, view.rows.map((row) => React.createElement("button", {
62
63
  key: row.deliveryId, type: "button", role: "listitem", className: "wsr-delivery-row",
@@ -214,6 +214,40 @@ export class IntakeSessionBindingRepository {
214
214
  return candidate;
215
215
  }
216
216
 
217
+ async archiveTerminalResult(sessionKey, result) {
218
+ this.#ready();
219
+ if (typeof sessionKey !== "string" || sessionKey.length === 0
220
+ || result === null || typeof result !== "object" || Array.isArray(result)
221
+ || result.kind !== "TERMINAL"
222
+ || typeof result.deliveryId !== "string" || result.deliveryId.length === 0
223
+ || typeof result.worktree !== "string" || !isAbsolute(result.worktree)
224
+ || !["SUCCEEDED", "FAILED", "CANCELLED"].includes(result.outcome)) {
225
+ throw new IntakeBindingError("INTAKE_BINDING_INVARIANT_VIOLATION");
226
+ }
227
+ const worktree = resolve(result.worktree);
228
+ const historical = this.#historical.find((entry) => entry.deliveryId === result.deliveryId);
229
+ if (historical !== undefined) {
230
+ if (historical.sessionKey === sessionKey && historical.worktree === worktree) return historical;
231
+ throw new IntakeBindingError("INTAKE_BINDING_INVARIANT_VIOLATION");
232
+ }
233
+ const active = this.#active.find((entry) => entry.deliveryId === result.deliveryId);
234
+ if (active === undefined || active.sessionKey !== sessionKey || active.worktree !== worktree) {
235
+ throw new IntakeBindingError("INTAKE_BINDING_INVARIANT_VIOLATION");
236
+ }
237
+ const candidate = exactHistorical({
238
+ sessionKey: active.sessionKey,
239
+ correlation: active.correlation,
240
+ deliveryId: active.deliveryId,
241
+ deliveryBindingIdentity: active.deliveryBindingIdentity,
242
+ worktree: active.worktree,
243
+ });
244
+ this.#active.splice(this.#active.indexOf(active), 1);
245
+ this.#historical.push(candidate);
246
+ validateTogether(this.#active, this.#historical);
247
+ await this.#persist();
248
+ return candidate;
249
+ }
250
+
217
251
  async markDetached(deliveryId) {
218
252
  this.#ready();
219
253
  const index = this.#active.findIndex((entry) => entry.deliveryId === deliveryId);
@@ -181,6 +181,16 @@ export function recordConsumedActionReply(agent, message) {
181
181
  agent.session.append("user/message", message, { surfaceOp: "append" });
182
182
  }
183
183
 
184
+ export function consumeWsrCommandBeforeModel(payload) {
185
+ const messages = Array.isArray(payload?.messages)
186
+ ? payload.messages.filter((message) => message?.source?.kind === "user")
187
+ : [];
188
+ const command = messages.find((message) => message.source?.workflowCommand === "wsr");
189
+ if (command === undefined) return false;
190
+ recordConsumedActionReply(payload.agent, command);
191
+ return true;
192
+ }
193
+
184
194
  const PRESENTATION_VERSION = "wsr.presentation@1.0.0";
185
195
  const PRESENTATION_KINDS = new Set(["command-accepted", "delivery-running", "delivery-list", "delivery-status", "action-output", "action-input-request", "terminal-result", "error"]);
186
196
 
@@ -465,7 +475,7 @@ export async function createPluginRuntime(config, options = {}) {
465
475
  const result = await service.invoke(Object.freeze({ operation: "abandon", deliveryId, correlation }));
466
476
  if (result.kind === "TERMINAL") {
467
477
  const detached = await bindings.byDelivery(deliveryId);
468
- if (detached !== undefined) await archiveTerminal(detached.sessionKey, detached.correlation, deliveryId);
478
+ if (detached !== undefined) await bindings.archiveTerminalResult(detached.sessionKey, result);
469
479
  if (detached !== undefined) sessionByCorrelation.delete(detached.correlation);
470
480
  }
471
481
  return result;
@@ -502,7 +512,7 @@ function commandTurn(rawInput) {
502
512
  }
503
513
 
504
514
  export async function recordWsrCommandInput(agent, rawInput, attachments = [], createId = () => `message-workflow-execution-${randomUUID()}`) {
505
- if (agent === null || typeof agent !== "object" || typeof agent.session?.append !== "function"
515
+ if (agent === null || typeof agent !== "object" || typeof agent.followup !== "function" || typeof agent.whenIdle !== "function"
506
516
  || typeof rawInput !== "string" || !Array.isArray(attachments) || typeof createId !== "function") {
507
517
  throw new TypeError("DSH_INTAKE_USER_INPUT_INVALID");
508
518
  }
@@ -515,7 +525,8 @@ export async function recordWsrCommandInput(agent, rawInput, attachments = [], c
515
525
  ...attachments,
516
526
  ]),
517
527
  });
518
- agent.session.append("user/message", message, { surfaceOp: "append" });
528
+ agent.followup(message);
529
+ await agent.whenIdle();
519
530
  return message;
520
531
  }
521
532
 
@@ -615,11 +626,7 @@ export async function apply(ctx, config) {
615
626
  }));
616
627
  const preStep = ctx.on?.("agent/pre-step", async (payload, next) => {
617
628
  const messages = payload.messages.filter((message) => message.source?.kind === "user");
618
- const command = messages.find((message) => message.source?.workflowCommand === "wsr");
619
- if (command !== undefined) {
620
- recordConsumedActionReply(payload.agent, command);
621
- return { kind: "reject" };
622
- }
629
+ if (consumeWsrCommandBeforeModel(payload)) return { kind: "reject" };
623
630
  if (await runtime.bindings.bySession(String(payload.agent.id)) === undefined) return next();
624
631
  if (messages.length !== 1) return next();
625
632
  try {