@aiwayds/dsh-opentui 0.29.0 → 0.29.2

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/CHANGELOG.md CHANGED
@@ -5,6 +5,31 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.29.1] - 2026-11-26
9
+
10
+ ### Fixed
11
+
12
+ - **`session.steer` now sends a real bridge request and surfaces a typed
13
+ rejection.**
14
+ - **Failed, aborted and stopped turns no longer falsely mark a steer
15
+ `Delivered` or keep pumping the queue.**
16
+ - **Late errors from an old turn no longer contaminate the next turn.**
17
+ - **The queue pump no longer steals the scrollback.**
18
+
19
+ ### Changed
20
+
21
+ - **The 0.29 E2E suite was expanded to 17 scenarios, and the `NOT RUN` / live
22
+ contract was corrected.**
23
+
24
+ ### Known Risks
25
+
26
+ - **An unconsumed steer may remain in the host inbox after an abort or turn
27
+ error and be consumed on the next turn.** This is accepted: the host has no
28
+ removal API, so the UI keeps the steer `Injected` and never marks it
29
+ `Delivered` across turns.
30
+ - **The full-package typecheck still reports 58 pre-existing `tui-base` errors
31
+ from 0.29.0.** The entry typecheck passes.
32
+
8
33
  ## [0.29.0] - 2026-11-26
9
34
 
10
35
  ### Added
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@aiwayds/dsh-opentui-bridge",
3
3
  "version": "0.1.0",
4
- "sha256": "fcc1af91c7a63794bba58f110b396dafbba8e9885023ca4e6118997ccc1acad3"
4
+ "sha256": "2e6f512fe4b83f9691262845ab1ce5038556592aa7c1e118bf159ea7e4aafd8d"
5
5
  }
@@ -3108,103 +3108,110 @@ var ledger_default = {
3108
3108
  },
3109
3109
  wired_protocol: {
3110
3110
  mark: "bridge-protocol (ADR-0010)",
3111
- count: 14,
3111
+ count: 15,
3112
3112
  methods: [
3113
3113
  {
3114
3114
  method: "bridge.ping",
3115
3115
  kind: "meta",
3116
- source_line: 5682,
3116
+ source_line: 5747,
3117
3117
  capir_id: null,
3118
3118
  note: "protocol version negotiation (no host call)"
3119
3119
  },
3120
3120
  {
3121
3121
  method: "bridge.hello",
3122
3122
  kind: "meta",
3123
- source_line: 5691,
3123
+ source_line: 5756,
3124
3124
  capir_id: null,
3125
3125
  note: "protocol version negotiation (no host call)"
3126
3126
  },
3127
3127
  {
3128
3128
  method: "session.prune.plan",
3129
3129
  kind: "business",
3130
- source_line: 5725,
3130
+ source_line: 5790,
3131
3131
  capir_id: null,
3132
3132
  note: "retention P1 read-only dry run: session.list drain + sessionPersistence.stat locations + read-only path gates; no CapIR id, no host write, no deletion"
3133
3133
  },
3134
3134
  {
3135
3135
  method: "session.prune.apply",
3136
3136
  kind: "business",
3137
- source_line: 5731,
3137
+ source_line: 5796,
3138
3138
  capir_id: null,
3139
3139
  note: "retention P2 host-recomputed trash apply: fingerprint/max-age/config checks + host-side apply lock + rename-to-trash with rollback/journal; client entries/policy rejected; no CapIR id"
3140
3140
  },
3141
3141
  {
3142
3142
  method: "session.prune.purge",
3143
3143
  kind: "business",
3144
- source_line: 5737,
3144
+ source_line: 5802,
3145
3145
  capir_id: null,
3146
3146
  note: "retention P3 trash-only deletion: server-issued single-use HMAC token + host re-validation of trash realpath/header/manifest/residence + full gate re-probe (live agent, live path, flock) + recursive delete with per-entry failure and crash manifest; client path/policy rejected; no CapIR id"
3147
3147
  },
3148
3148
  {
3149
3149
  method: "session.prune.restore",
3150
3150
  kind: "business",
3151
- source_line: 5743,
3151
+ source_line: 5808,
3152
3152
  capir_id: null,
3153
3153
  note: "retention B4/C7 trash restore by entry id: read-only list of {id,movedAt,size?} (no path) + host re-validation of trash realpath/manifest/artifact header.id/live roster/live destination containment + refuse-if-exists + read-only flock probe + reverse rename; client path/policy rejected; no CapIR id"
3154
3154
  },
3155
3155
  {
3156
3156
  method: "subagents.interrupt",
3157
3157
  kind: "business",
3158
- source_line: 5810,
3158
+ source_line: 5875,
3159
3159
  capir_id: null,
3160
3160
  note: "L1 0.23.1 added; subagent authorization gate (binding ownership) + index reconcile + per-child cancel"
3161
3161
  },
3162
3162
  {
3163
3163
  method: "subagents.stopChildren",
3164
3164
  kind: "business",
3165
- source_line: 5814,
3165
+ source_line: 5879,
3166
3166
  capir_id: null,
3167
3167
  note: "L1 0.23.1 added; subagent authorization gate (binding ownership) + index reconcile + per-child cancel"
3168
3168
  },
3169
3169
  {
3170
3170
  method: "session.open",
3171
3171
  kind: "business",
3172
- source_line: 5818,
3172
+ source_line: 5883,
3173
3173
  capir_id: null,
3174
3174
  note: "binding orchestration (agents.create/resume + push relay/grants); multi-step, stateful"
3175
3175
  },
3176
3176
  {
3177
3177
  method: "session.send",
3178
3178
  kind: "business",
3179
- source_line: 5822,
3179
+ source_line: 5887,
3180
3180
  capir_id: null,
3181
3181
  note: "single in-flight turn state machine + streaming turn"
3182
3182
  },
3183
+ {
3184
+ method: "session.steer",
3185
+ kind: "business",
3186
+ source_line: 5891,
3187
+ capir_id: null,
3188
+ note: "029 A: bridge-owned steer into the running turn; accepts only a live non-aborting turn with agent.status==='running', calls agent.steer(createBridgeUserMessage(text)) directly, no turn id / inFlightTurnId / turn.start, no followup downgrade; typed STEER_IDLE / STEER_ENDED / STEER_ABORTING rejections never reach the host"
3189
+ },
3183
3190
  {
3184
3191
  method: "session.close",
3185
3192
  kind: "business",
3186
- source_line: 5826,
3193
+ source_line: 5895,
3187
3194
  capir_id: null,
3188
3195
  note: "binding dispose"
3189
3196
  },
3190
3197
  {
3191
3198
  method: "turn.abort",
3192
3199
  kind: "business",
3193
- source_line: 5830,
3200
+ source_line: 5899,
3194
3201
  capir_id: null,
3195
3202
  note: "turn state machine + terminalTurnIds FIFO idempotency + fire-and-forget agent.cancel"
3196
3203
  },
3197
3204
  {
3198
3205
  method: "ask.response",
3199
3206
  kind: "business",
3200
- source_line: 5834,
3207
+ source_line: 5903,
3201
3208
  capir_id: null,
3202
3209
  note: "bridge-internal AskRegistry settlement (no host call)"
3203
3210
  },
3204
3211
  {
3205
3212
  method: "journal.replay",
3206
3213
  kind: "business",
3207
- source_line: 5838,
3214
+ source_line: 5907,
3208
3215
  capir_id: null,
3209
3216
  note: "I-class persistence read (persistence.open(id,'read')); no same-name CapIR id"
3210
3217
  }
@@ -9621,7 +9628,7 @@ function getAskRegistry(ctx) {
9621
9628
  var PROTOCOL_VERSION = 1;
9622
9629
  var STDIO_SWITCH = "DSH_OPENTUI_BRIDGE_STDIO";
9623
9630
  var CAP_SMOKE_SWITCH = "DSH_OPENTUI_CAP_SMOKE";
9624
- var BRIDGE_CAPABILITIES = ["subagents.interrupt", "subagents.stopChildren"];
9631
+ var BRIDGE_CAPABILITIES = ["subagents.interrupt", "subagents.stopChildren", "session.steer"];
9625
9632
  var TERMINAL_TURN_ID_LIMIT = 64;
9626
9633
  function findPackageVersion(entryFile, wantedName) {
9627
9634
  try {
@@ -10087,7 +10094,7 @@ function apply(ctx, config) {
10087
10094
  catalog: "@deepseek-ai/dsh-api-session-controller#session/modelCatalog",
10088
10095
  select: "@deepseek-ai/dsh-api-session-controller#session/selectModel",
10089
10096
  initDefault: "@deepseek-ai/dsh-api-session-controller#session/initializeDefaultModel",
10090
- unwired: "@deepseek-ai/dsh-api-session-controller#session/create"
10097
+ unwired: "@deepseek-ai/dsh-api-session-controller#session/control"
10091
10098
  };
10092
10099
  const invoke = createCapInvoke(ctx);
10093
10100
  const probe = async (id, params) => {
@@ -11608,6 +11615,47 @@ function apply(ctx, config) {
11608
11615
  replyError(req.id, "INTERNAL", err instanceof Error ? err.message : String(err));
11609
11616
  }
11610
11617
  }
11618
+ async function handleSteer(req) {
11619
+ if (binding === undefined) {
11620
+ replyError(req.id, "SESSION_NOT_OPEN", "no open session; call session.open first");
11621
+ return;
11622
+ }
11623
+ const text = req.params.text;
11624
+ if (typeof text !== "string" || text.trim() === "") {
11625
+ replyError(req.id, "BAD_PARAMS", "session.steer requires a non-empty text string");
11626
+ return;
11627
+ }
11628
+ const state = activeTurn;
11629
+ const turnId = inFlightTurnId;
11630
+ const lastTerminalTurnId = [...terminalTurnIds].at(-1);
11631
+ if (turnId === undefined || state === undefined || state.ended || turnId !== state.turnId) {
11632
+ const ended = state !== undefined && state.ended || terminalTurnIds.size > 0;
11633
+ replyError(req.id, ended ? "STEER_ENDED" : "STEER_IDLE", ended ? "the turn has already ended; no running turn to steer" : "no turn in flight; steer requires a running turn", { turnId: turnId ?? lastTerminalTurnId ?? null });
11634
+ return;
11635
+ }
11636
+ if (state.abortRequested) {
11637
+ replyError(req.id, "STEER_ABORTING", "the in-flight turn is aborting; steer refused", { turnId });
11638
+ return;
11639
+ }
11640
+ const agent = binding.handle.agent;
11641
+ if (agent.status !== "running") {
11642
+ replyError(req.id, "STEER_IDLE", "agent is not running; steer refused", { turnId });
11643
+ return;
11644
+ }
11645
+ if (typeof agent.steer !== "function") {
11646
+ replyError(req.id, "UNSUPPORTED", "open agent has no steer() seam", { capability: "session.steer" });
11647
+ return;
11648
+ }
11649
+ const message = createBridgeUserMessage(text);
11650
+ try {
11651
+ agent.steer(message);
11652
+ logger.info("[dsh-opentui-bridge] session.steer ok turnId=%s messageId=%s", turnId, message.id);
11653
+ replyOk(req.id, { accepted: true, turnId, messageId: message.id });
11654
+ } catch (err) {
11655
+ logger.error("[dsh-opentui-bridge] session.steer failed: %s", err);
11656
+ replyError(req.id, "INTERNAL", err instanceof Error ? err.message : String(err));
11657
+ }
11658
+ }
11611
11659
  async function handleClose(req) {
11612
11660
  if (binding === undefined) {
11613
11661
  replyError(req.id, "SESSION_NOT_OPEN", "no open session");
@@ -12443,6 +12491,10 @@ function apply(ctx, config) {
12443
12491
  await handleSend(req);
12444
12492
  return;
12445
12493
  }
12494
+ if (req.method === "session.steer") {
12495
+ await handleSteer(req);
12496
+ return;
12497
+ }
12446
12498
  if (req.method === "session.close") {
12447
12499
  await handleClose(req);
12448
12500
  return;