dsh-taskbridge 1.5.2 → 1.5.4

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/src/mcp/wait.js CHANGED
@@ -180,17 +180,22 @@ export function compactTask(task) {
180
180
  // what a host needs to act, and the body is read on demand through `delegate_result`.
181
181
  // The object is kept (with `noteOmitted`) so an old client cannot read "no note" as
182
182
  // "not reviewed", and `reviewPersistence` states whether the conclusion is durable yet.
183
+ // A recorded summary is reported the same way, only when one exists, so an old shape holds.
183
184
  const acceptance = out.hostAcceptance;
184
185
  if (acceptance !== null && typeof acceptance === 'object' && !Array.isArray(acceptance)) {
186
+ const summaryChars = acceptance.completionSummaryChars
187
+ ?? (typeof acceptance.completionSummary === 'string' ? Array.from(acceptance.completionSummary).length : 0);
185
188
  out.hostAcceptance = {
186
189
  accepted: acceptance.accepted === true,
187
190
  state: acceptance.state ?? null,
188
191
  acceptedAt: acceptance.acceptedAt ?? null,
189
192
  by: acceptance.by ?? null,
190
- // Counted from the body when it is here, so the summary states the REAL length even
191
- // on a view that carries the full note.
193
+ // Counted from the body when it is here, so the real length is stated.
192
194
  noteChars: acceptance.noteChars ?? (typeof acceptance.note === 'string' ? Array.from(acceptance.note).length : 0),
193
195
  noteOmitted: true,
196
+ ...(summaryChars > 0
197
+ ? { completionSummaryChars: summaryChars, completionSummaryOmitted: true }
198
+ : {}),
194
199
  };
195
200
  }
196
201
  if (task.reviewPersistence !== undefined) out.reviewPersistence = task.reviewPersistence;