@xmoon76/dsh-pi-tui 0.5.2-rc.1 → 0.5.3

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.
@@ -1,5 +1,5 @@
1
1
  import { t as cancellationError } from "./tasks-D_z5Yjjr.mjs";
2
- import { J as shortSessionId, N as systemContextBody, P as toolCardHeader, Q as sanitizeSessionSearchInput, U as formatSessionAge, W as sanitizeTerminalText, X as buildSessionTree, Y as workspaceKey, Z as sameWorkspace, ct as PROVIDER_DEFAULT, ft as projectModelDirectory, gt as contextFormOf, i as projectTranscriptStructure, lt as effortChoicesOf, mt as runSyncDisposalSteps, nt as TSP_CONTINUED_INSPECTION_LABEL, o as contextPresentationKind, ot as isBuiltInPresetRow, st as presetDisplayText, t as contextClusterSummaryParts, ut as initialEffortOf } from "./context-summary-CxQnkDEN.mjs";
2
+ import { $ as sameWorkspace, F as systemContextBody, G as formatSessionAge, I as toolCardHeader, K as sanitizeTerminalText, Q as buildSessionTree, St as contextFormOf, X as shortSessionId, Z as workspaceKey, a as projectTranscriptStructure, bt as runSyncDisposalSteps, c as contextPresentationKind, ct as isBuiltInPresetRow, dt as effortChoicesOf, et as sanitizeSessionSearchInput, ft as initialEffortOf, ht as sanitizedPhysicalLine, it as TSP_CONTINUED_INSPECTION_LABEL, lt as presetDisplayText, mt as projectModelDirectory, t as contextClusterSummaryParts, ut as PROVIDER_DEFAULT, vt as sanitizeDisplayText } from "./context-summary-CxUpNkA9.mjs";
3
3
  import { View, connect, span, ui } from "@stencil-hq/tern";
4
4
  //#region src/tui/tsp/editor.ts
5
5
  /** The grapheme segmenter (`Intl.Segmenter` on Node 24; one shared instance). */
@@ -961,15 +961,15 @@ function createTspInteractionSeat(options) {
961
961
  const approvalOverlay = (slot) => {
962
962
  const body = [ui.text({
963
963
  key: "tool",
964
- text: `tool: ${slot.request.toolName}`
964
+ text: sanitizedPhysicalLine(`tool: ${slot.request.toolName}`)
965
965
  })];
966
966
  if (slot.request.reason !== void 0 && slot.request.reason !== "") body.push(ui.text({
967
967
  key: "reason",
968
- text: slot.request.reason
968
+ text: sanitizeDisplayText(slot.request.reason)
969
969
  }));
970
970
  if (slot.request.arguments !== void 0) body.push(ui.code({
971
971
  key: "args",
972
- text: slot.request.arguments
972
+ text: sanitizeDisplayText(slot.request.arguments)
973
973
  }));
974
974
  if (slot.request.danger === true) body.push(ui.text({
975
975
  key: "danger",
@@ -1000,7 +1000,7 @@ function createTspInteractionSeat(options) {
1000
1000
  const draft = slot.drafts[index];
1001
1001
  body.push(ui.text({
1002
1002
  key: `answer-${index}`,
1003
- text: `${index + 1}. ${answerSummary(question, draft)}`
1003
+ text: sanitizeDisplayText(`${index + 1}. ${answerSummary(question, draft)}`)
1004
1004
  }));
1005
1005
  }
1006
1006
  body.push(ui.text({
@@ -1024,25 +1024,25 @@ function createTspInteractionSeat(options) {
1024
1024
  const statusText = slot.status?.text;
1025
1025
  if (statusText !== void 0 && statusText !== "") body.push(ui.text({
1026
1026
  key: "status",
1027
- text: statusText
1027
+ text: sanitizedPhysicalLine(statusText)
1028
1028
  }));
1029
1029
  if (question.header !== void 0) body.push(ui.text({
1030
1030
  key: "header",
1031
- text: question.header
1031
+ text: sanitizedPhysicalLine(question.header)
1032
1032
  }));
1033
1033
  body.push(ui.text({
1034
1034
  key: "question",
1035
- text: question.question
1035
+ text: sanitizeDisplayText(question.question)
1036
1036
  }));
1037
1037
  if (question.detail !== void 0) body.push(ui.text({
1038
1038
  key: "detail",
1039
- text: question.detail
1039
+ text: sanitizeDisplayText(question.detail)
1040
1040
  }));
1041
1041
  const seat = seatRows(slot);
1042
1042
  if (slot.editing === slot.tab) {
1043
1043
  for (const [index, row] of seat.entries()) body.push(ui.text({
1044
1044
  key: `row-${index}`,
1045
- text: `${index === slot.highlight ? "❯" : " "} ${row.label}`
1045
+ text: `${index === slot.highlight ? "❯" : " "} ${sanitizedPhysicalLine(row.label)}`
1046
1046
  }));
1047
1047
  const masked = question.masked === true;
1048
1048
  body.push(ui.input({
@@ -1068,7 +1068,7 @@ function createTspInteractionSeat(options) {
1068
1068
  const shown = question.masked === true ? maskedValue(draft.custom) : draft.custom;
1069
1069
  body.push(ui.text({
1070
1070
  key: "free",
1071
- text: shown === "" ? "(type an answer)" : shown
1071
+ text: sanitizeDisplayText(shown === "" ? "(type an answer)" : shown)
1072
1072
  }));
1073
1073
  body.push(ui.text({
1074
1074
  key: "hint",
@@ -1089,7 +1089,7 @@ function createTspInteractionSeat(options) {
1089
1089
  const recommended = row.recommended ? " [recommended]" : "";
1090
1090
  body.push(ui.text({
1091
1091
  key: `row-${index}`,
1092
- text: `${pointer} ${marker}${row.label}${recommended}${description}`
1092
+ text: `${pointer} ${marker}${sanitizedPhysicalLine(row.label)}${sanitizeDisplayText(`${recommended}${description}`)}`
1093
1093
  }));
1094
1094
  }
1095
1095
  const custom = draft.custom;
@@ -1097,7 +1097,7 @@ function createTspInteractionSeat(options) {
1097
1097
  const shown = custom.trim() === "" ? "(skipped)" : question.masked === true ? maskedValue(custom) : custom;
1098
1098
  body.push(ui.text({
1099
1099
  key: "other-value",
1100
- text: `other: ${shown}`
1100
+ text: sanitizeDisplayText(`other: ${shown}`)
1101
1101
  }));
1102
1102
  }
1103
1103
  body.push(ui.text({
@@ -1116,7 +1116,7 @@ function createTspInteractionSeat(options) {
1116
1116
  const { rows, index } = listState(callbacks);
1117
1117
  const body = rows.map((row, position) => ui.text({
1118
1118
  key: `continued-${position}`,
1119
- text: `${position === index ? "❯" : " "} ${row.sessionId} · ${row.callId}`
1119
+ text: sanitizeDisplayText(`${position === index ? "❯" : " "} ${row.sessionId} · ${row.callId}`)
1120
1120
  }));
1121
1121
  body.push(ui.text({
1122
1122
  key: "hint",
@@ -2038,10 +2038,10 @@ function rowIntent$1(panel, item, kind) {
2038
2038
  function failureItem(failure) {
2039
2039
  return {
2040
2040
  id: failureRowId(failure.providerId),
2041
- label: `${failure.providerName} · unavailable`,
2042
- detail: failure.message,
2043
- title: failure.message,
2044
- disabled: failure.message,
2041
+ label: `${sanitizedPhysicalLine(failure.providerName)} · unavailable`,
2042
+ detail: sanitizedPhysicalLine(failure.message),
2043
+ title: sanitizedPhysicalLine(failure.message),
2044
+ disabled: sanitizedPhysicalLine(failure.message),
2045
2045
  dot: "error"
2046
2046
  };
2047
2047
  }
@@ -2083,7 +2083,7 @@ function modelOrder(panel) {
2083
2083
  if (rows.length === 0) continue;
2084
2084
  order.push({
2085
2085
  group: group.id,
2086
- label: group.name,
2086
+ label: sanitizedPhysicalLine(group.name),
2087
2087
  count: rows.length
2088
2088
  });
2089
2089
  for (const row of rows) order.push(modelRowId(row));
@@ -2112,14 +2112,20 @@ function modelOrder(panel) {
2112
2112
  * the one read-only Retry row.
2113
2113
  */
2114
2114
  function modelItems(panel) {
2115
- const items = visibleModels(panel).map((row) => ({
2116
- id: modelRowId(row),
2117
- label: row.modelName,
2118
- mark: providerMark(row),
2119
- detail: row.providerName,
2120
- title: row.modelId,
2121
- badges: [...row.isCurrent ? [{ text: "current" }] : [], ...row.isDefault ? [{ text: "default" }] : []]
2122
- }));
2115
+ const items = visibleModels(panel).map((row) => {
2116
+ const mark = providerMark(row);
2117
+ return {
2118
+ id: modelRowId(row),
2119
+ label: sanitizedPhysicalLine(row.modelName),
2120
+ mark: {
2121
+ text: sanitizedPhysicalLine(mark.text),
2122
+ seed: mark.seed
2123
+ },
2124
+ detail: sanitizedPhysicalLine(row.providerName),
2125
+ title: sanitizedPhysicalLine(row.modelId),
2126
+ badges: [...row.isCurrent ? [{ text: "current" }] : [], ...row.isDefault ? [{ text: "default" }] : []]
2127
+ };
2128
+ });
2123
2129
  items.push(...panel.failures.map(failureItem));
2124
2130
  if (retryRowOffered(panel)) items.push({
2125
2131
  id: FAILURE_RETRY_ID,
@@ -2159,7 +2165,7 @@ function nativeFocus(panel) {
2159
2165
  function pickerState$1(panel) {
2160
2166
  return {
2161
2167
  state: panel.phase === "loading" ? "loading" : panel.phase === "error" ? "error" : "ready",
2162
- ...panel.notice === void 0 ? {} : { message: panel.notice.text },
2168
+ ...panel.notice === void 0 ? {} : { message: sanitizedPhysicalLine(panel.notice.text) },
2163
2169
  empty: "No model is advertised by the configured providers."
2164
2170
  };
2165
2171
  }
@@ -2201,18 +2207,18 @@ function detailsReader(panel, deps) {
2201
2207
  const scope = `${panel.serial}-${panel.readerEpoch}`;
2202
2208
  return ui.overlay({
2203
2209
  key: `${MODEL_DETAILS_READER_KEY}-${scope}`,
2204
- head: readerHead(panel),
2210
+ head: sanitizedPhysicalLine(readerHead(panel)),
2205
2211
  size: "lg",
2206
2212
  modal: true
2207
2213
  }, ui.row({
2208
2214
  key: `${MODEL_DETAILS_BACK_KEY}-${scope}`,
2209
2215
  onClick: deps.bind({ kind: "back" })
2210
- }, ui.text(span("Back", "accent"))), ui.col({ key: `${MODEL_DETAILS_BODY_KEY_PREFIX}${scope}` }, ...row === void 0 ? [ui.text(span("No model is selected.", "muted"))] : [...panel.notice === void 0 ? [] : [ui.text({ wrap: "word" }, span(panel.notice.text, panel.notice.tone))], ...groups.flatMap((group, index) => [ui.col({
2216
+ }, ui.text(span("Back", "accent"))), ui.col({ key: `${MODEL_DETAILS_BODY_KEY_PREFIX}${scope}` }, ...row === void 0 ? [ui.text(span("No model is selected.", "muted"))] : [...panel.notice === void 0 ? [] : [ui.text({ wrap: "word" }, span(sanitizeDisplayText(panel.notice.text), panel.notice.tone))], ...groups.flatMap((group, index) => [ui.col({
2211
2217
  key: `reader-group-${group.id}`,
2212
2218
  gap: "xs"
2213
- }, ui.text(span(group.head, "muted")), ...group.facts.flatMap((fact) => [...fact.label === void 0 ? [] : [ui.text(span(fact.label, "muted"))], ui.text({
2219
+ }, ui.text(span(sanitizeDisplayText(group.head), "muted")), ...group.facts.flatMap((fact) => [...fact.label === void 0 ? [] : [ui.text(span(sanitizeDisplayText(fact.label), "muted"))], ui.text({
2214
2220
  key: fact.id,
2215
- text: fact.value,
2221
+ text: sanitizeDisplayText(fact.value),
2216
2222
  wrap: fact.wrap
2217
2223
  })])), ...index === groups.length - 1 ? [] : [ui.rule(), ui.spacer({ size: "lg" })]])]));
2218
2224
  }
@@ -2232,11 +2238,14 @@ function modelListPicker(panel, deps, key) {
2232
2238
  total: catalogueTotal(panel),
2233
2239
  ...stripOffered(panel) ? { strip: {
2234
2240
  label: STRIP_LABEL,
2235
- items: stripItems(panel, stripLabelColumns(deps.paneWidth))
2241
+ items: stripItems(panel, stripLabelColumns(deps.paneWidth)).map((item) => ({
2242
+ ...item,
2243
+ label: sanitizedPhysicalLine(item.label)
2244
+ }))
2236
2245
  } } : {},
2237
2246
  selected: panel.selected,
2238
2247
  current: panel.rows.filter((item) => item.isCurrent).map(modelRowId),
2239
- subtitle: pickerSubtitle$2(panel),
2248
+ subtitle: sanitizedPhysicalLine(pickerSubtitle$2(panel)),
2240
2249
  focus: nativeFocus(panel),
2241
2250
  ...pickerState$1(panel),
2242
2251
  actions: renderedActions$1(panel)
@@ -3468,7 +3477,7 @@ function pickerState(panel) {
3468
3477
  const message = statusMessage(panel);
3469
3478
  return {
3470
3479
  state: panel.phase === "loading" ? "loading" : panel.phase === "error" ? "error" : "ready",
3471
- ...message === "" ? {} : { message },
3480
+ ...message === "" ? {} : { message: sanitizedPhysicalLine(message) },
3472
3481
  empty: "No agent presets configured."
3473
3482
  };
3474
3483
  }
@@ -3490,7 +3499,12 @@ function renderedActions(panel) {
3490
3499
  function cataloguePicker(panel) {
3491
3500
  const row = highlightedRow(panel);
3492
3501
  const current = currentId(panel);
3493
- const items = presetItems(panel);
3502
+ const items = presetItems(panel).map((item) => ({
3503
+ ...item,
3504
+ label: typeof item.label === "string" ? sanitizedPhysicalLine(item.label) : item.label,
3505
+ ...typeof item.detail === "string" ? { detail: sanitizedPhysicalLine(item.detail) } : {},
3506
+ ...item.title === void 0 ? {} : { title: sanitizedPhysicalLine(item.title) }
3507
+ }));
3494
3508
  const props = {
3495
3509
  key: pickerKey(panel),
3496
3510
  title: "Agent presets",
@@ -3542,11 +3556,11 @@ function detailsIdentity(panel, row) {
3542
3556
  gap: "xs"
3543
3557
  }, ui.text(span("Name", "muted")), ui.text({
3544
3558
  key: "details-name",
3545
- text: row.name,
3559
+ text: sanitizeDisplayText(row.name),
3546
3560
  wrap: "char"
3547
3561
  }), ui.text(span("ID", "muted")), ui.text({
3548
3562
  key: "details-id",
3549
- text: row.id,
3563
+ text: sanitizeDisplayText(row.id),
3550
3564
  wrap: "char"
3551
3565
  }), ui.text(span("Type", "muted")), ui.text({
3552
3566
  key: "details-type",
@@ -3561,10 +3575,10 @@ function detailsIdentity(panel, row) {
3561
3575
  ]
3562
3576
  }), ...relations.flatMap((relation) => [ui.text({
3563
3577
  key: relation.id,
3564
- spans: [span(`${relation.label}: `, "muted"), span(relation.value)]
3578
+ spans: [span(`${relation.label}: `, "muted"), span(sanitizeDisplayText(relation.value))]
3565
3579
  })]), ...row.broken === void 0 ? [] : [ui.text(span("Failed to load", "muted")), ui.text({
3566
3580
  key: "details-broken",
3567
- text: row.broken,
3581
+ text: sanitizeDisplayText(row.broken),
3568
3582
  wrap: "word"
3569
3583
  })])];
3570
3584
  }
@@ -3581,7 +3595,7 @@ function detailsOverlay(panel, deps) {
3581
3595
  const markdown = guideMarkdown(panel);
3582
3596
  return ui.overlay({
3583
3597
  key: `preset-details-${readingScope(panel)}`,
3584
- head: detailsHead(panel),
3598
+ head: sanitizedPhysicalLine(detailsHead(panel)),
3585
3599
  size: "lg",
3586
3600
  modal: true
3587
3601
  }, detailsBackRow(panel, deps), ui.col({
@@ -3590,18 +3604,18 @@ function detailsOverlay(panel, deps) {
3590
3604
  }, ...notice === "" ? [] : [ui.text({
3591
3605
  key: "details-notice",
3592
3606
  wrap: "word"
3593
- }, span(notice, "muted"))], ...row === void 0 ? [ui.text(span("No preset is selected.", "muted"))] : [
3607
+ }, span(sanitizeDisplayText(notice), "muted"))], ...row === void 0 ? [ui.text(span("No preset is selected.", "muted"))] : [
3594
3608
  ...detailsIdentity(panel, row),
3595
3609
  ui.rule(),
3596
3610
  ui.spacer({ size: "sm" }),
3597
3611
  ...row.description === void 0 || row.description.trim() === "" ? [ui.text(span("No description provided.", "muted"))] : [ui.text(span("Description", "muted")), ui.text({
3598
3612
  key: "details-description",
3599
- text: row.description,
3613
+ text: sanitizeDisplayText(row.description),
3600
3614
  wrap: "word"
3601
3615
  })],
3602
3616
  ...markdown === void 0 ? [] : [ui.md({
3603
3617
  key: `preset-details-guide-${readingScope(panel)}`,
3604
- text: markdown
3618
+ text: sanitizeDisplayText(markdown)
3605
3619
  })]
3606
3620
  ]));
3607
3621
  }
@@ -4161,9 +4175,11 @@ function actionList(panel) {
4161
4175
  }
4162
4176
  function rowItem(row, depth, result) {
4163
4177
  const title = row.title === void 0 || row.title.trim() === "" ? shortSessionId(row.id) : row.title;
4178
+ const migration = row.formatStatus === "migration-required" ? "Migration required" : void 0;
4164
4179
  const detail = [
4165
4180
  workspaceKey(row.cwd),
4166
4181
  `Updated ${formatSessionAge(row.updatedAt)}`,
4182
+ migration,
4167
4183
  row.preset === void 0 ? void 0 : `Preset ${row.preset}`,
4168
4184
  row.live ? "Live" : "Persisted",
4169
4185
  shortSessionId(row.id)
@@ -4174,13 +4190,18 @@ function rowItem(row, depth, result) {
4174
4190
  tone: "muted"
4175
4191
  });
4176
4192
  if (result !== void 0) badges.push({
4177
- text: result.source,
4193
+ text: sanitizeTerminalText(result.source),
4178
4194
  tone: result.source === "Content" ? "info" : "muted"
4179
4195
  });
4180
4196
  return {
4181
4197
  id: `session:${row.id}`,
4182
4198
  label: sanitizeTerminalText(title),
4183
- detail: result?.snippet === void 0 ? detail : `${workspaceKey(row.cwd)} · Updated ${formatSessionAge(row.updatedAt)} · ${sanitizeTerminalText(result.snippet)}`,
4199
+ detail: result?.snippet === void 0 ? detail : [
4200
+ workspaceKey(row.cwd),
4201
+ `Updated ${formatSessionAge(row.updatedAt)}`,
4202
+ migration,
4203
+ sanitizeTerminalText(result.snippet)
4204
+ ].filter((part) => part !== void 0).join(" · "),
4184
4205
  title: sanitizeTerminalText(row.id),
4185
4206
  ...depth === void 0 ? {} : { depth },
4186
4207
  ...badges.length === 0 ? {} : { badges }
@@ -4282,6 +4303,13 @@ function pickerLayer(panel) {
4282
4303
  function detailResult(panel, row) {
4283
4304
  return panel.snapshot.searchResults.find((result) => result.row.id === row.id);
4284
4305
  }
4306
+ /** The existing Identity `State` value, extended with the Host-authoritative
4307
+ * on-disk format state when the Client reported one. `current` and absent add
4308
+ * nothing; no new fact group or control is introduced. */
4309
+ function rowStateText(panel, row) {
4310
+ const base = row.id === panel.request.subject.currentSessionId ? "Current session" : row.live ? "Live session" : "Persisted session";
4311
+ return row.formatStatus === "migration-required" ? `${base} · Migration required` : base;
4312
+ }
4285
4313
  function detailReader(panel, bind) {
4286
4314
  const row = rowFor(panel, panel.selected);
4287
4315
  const scope = `${panel.serial}-${panel.readerEpoch}`;
@@ -4295,7 +4323,7 @@ function detailReader(panel, bind) {
4295
4323
  facts: [
4296
4324
  ["Session ID", row.id],
4297
4325
  ["Title", title],
4298
- ["State", row.id === panel.request.subject.currentSessionId ? "Current session" : row.live ? "Live session" : "Persisted session"],
4326
+ ["State", rowStateText(panel, row)],
4299
4327
  ["Workspace", row.cwd === void 0 ? "Unknown workspace" : row.cwd]
4300
4328
  ]
4301
4329
  },
@@ -4334,7 +4362,7 @@ function detailReader(panel, bind) {
4334
4362
  }, ...row === void 0 ? [ui.text(span("The selected session is no longer available.", "muted"))] : groups.map((group) => ui.col({
4335
4363
  key: `session-browser-group-${group.id}`,
4336
4364
  gap: "xs"
4337
- }, ui.text(span(group.head, "muted")), ...group.facts.flatMap(([label, value]) => [ui.text(span(label, "muted")), ui.text({ wrap: "word" }, sanitizeTerminalText(value))]))))));
4365
+ }, ui.text(span(sanitizeTerminalText(group.head), "muted")), ...group.facts.flatMap(([label, value]) => [ui.text(span(label, "muted")), ui.text({ wrap: "word" }, sanitizeTerminalText(value))]))))));
4338
4366
  }
4339
4367
  function layer(panel, bind) {
4340
4368
  return panel.page === "details" ? detailReader(panel, bind) : pickerLayer(panel);
@@ -4785,12 +4813,12 @@ function toolBodyNodes(message, options) {
4785
4813
  const nodes = [];
4786
4814
  if (message.args !== "") nodes.push(ui.code({
4787
4815
  key: "args",
4788
- text: message.args
4816
+ text: sanitizeDisplayText(message.args)
4789
4817
  }));
4790
4818
  const result = shownToolResult(message, options);
4791
4819
  if (result !== "") nodes.push(ui.code({
4792
4820
  key: "result",
4793
- text: result
4821
+ text: sanitizeDisplayText(result)
4794
4822
  }));
4795
4823
  return nodes;
4796
4824
  }
@@ -4814,7 +4842,7 @@ function toolNode(message, key, options) {
4814
4842
  const provenance = message.origin === "tool-not-started" ? "not started" : "unmatched result";
4815
4843
  return ui.card({
4816
4844
  key,
4817
- head: header.title,
4845
+ head: sanitizedPhysicalLine(header.title),
4818
4846
  tone: "warning"
4819
4847
  }, ui.badge({
4820
4848
  key: "provenance",
@@ -4823,11 +4851,11 @@ function toolNode(message, key, options) {
4823
4851
  }
4824
4852
  return ui.tool({
4825
4853
  key,
4826
- name: message.name,
4827
- title: header.title,
4854
+ name: sanitizedPhysicalLine(message.name),
4855
+ title: sanitizedPhysicalLine(header.title),
4828
4856
  status: toolStatus(message.status),
4829
4857
  ...header.summary === "" ? {} : {
4830
- target: header.summary,
4858
+ target: sanitizedPhysicalLine(header.summary),
4831
4859
  targetKind: "text"
4832
4860
  }
4833
4861
  }, ...body);
@@ -4841,18 +4869,18 @@ function contextBodyNodes(message) {
4841
4869
  const body = systemContextBody(message.text);
4842
4870
  if (body === void 0) return [ui.md({
4843
4871
  key: "body",
4844
- text: message.text
4872
+ text: sanitizeDisplayText(message.text)
4845
4873
  })];
4846
4874
  if (body.length === 0) return [];
4847
4875
  return [ui.code({
4848
4876
  key: "body",
4849
- text: body.join("\n")
4877
+ text: sanitizeDisplayText(body.join("\n"))
4850
4878
  })];
4851
4879
  }
4852
4880
  function systemNode(message, key) {
4853
4881
  if (message.context === true) {
4854
4882
  const kind = contextPresentationKind(message);
4855
- const head = message.label ?? contextFormOf(message) ?? "Context";
4883
+ const head = sanitizedPhysicalLine(message.label ?? contextFormOf(message) ?? "Context");
4856
4884
  return ui.card({
4857
4885
  key,
4858
4886
  head
@@ -4866,17 +4894,17 @@ function systemNode(message, key) {
4866
4894
  head: message.origin ?? "System"
4867
4895
  }, ui.md({
4868
4896
  key: "body",
4869
- text: message.text
4897
+ text: sanitizeDisplayText(message.text)
4870
4898
  }));
4871
4899
  }
4872
4900
  function commandNode(message, key) {
4873
4901
  const name = message.name ?? "command";
4874
- const head = message.args === null || message.args === "" ? `/${name}` : `/${name} ${message.args}`;
4902
+ const head = sanitizedPhysicalLine(message.args === null || message.args === "" ? `/${name}` : `/${name} ${message.args}`);
4875
4903
  const outcome = message.outcome;
4876
4904
  const status = outcome === null ? "running" : outcome.kind === "error" ? "error" : "done";
4877
4905
  const body = outcome?.text === void 0 || outcome.text === "" ? [] : [ui.md({
4878
4906
  key: "body",
4879
- text: outcome.text
4907
+ text: sanitizeDisplayText(outcome.text)
4880
4908
  })];
4881
4909
  return ui.card({
4882
4910
  key,
@@ -4888,7 +4916,7 @@ function compactionNode(message, key) {
4888
4916
  const status = message.error !== void 0 && message.error !== "" ? "error" : message.running === true ? "running" : "done";
4889
4917
  const body = message.text === "" ? [] : [ui.md({
4890
4918
  key: "body",
4891
- text: message.text
4919
+ text: sanitizeDisplayText(message.text)
4892
4920
  })];
4893
4921
  return ui.card({
4894
4922
  key,
@@ -4902,7 +4930,7 @@ function compactionNode(message, key) {
4902
4930
  function workflowNode(message, key) {
4903
4931
  return ui.card({
4904
4932
  key,
4905
- head: message.name
4933
+ head: sanitizedPhysicalLine(message.name)
4906
4934
  }, ui.badge({
4907
4935
  key: "state",
4908
4936
  text: message.status
@@ -4919,14 +4947,14 @@ function messageNode(message, key, options) {
4919
4947
  head: "You"
4920
4948
  }, ui.md({
4921
4949
  key: "body",
4922
- text: message.text
4950
+ text: sanitizeDisplayText(message.text)
4923
4951
  }));
4924
4952
  case "assistant": return ui.card({
4925
4953
  key,
4926
4954
  head: "Assistant"
4927
4955
  }, ui.md({
4928
4956
  key: "body",
4929
- text: message.text
4957
+ text: sanitizeDisplayText(message.text)
4930
4958
  }));
4931
4959
  case "thinking": return ui.card({
4932
4960
  key,
@@ -4934,7 +4962,7 @@ function messageNode(message, key, options) {
4934
4962
  ...message.running === true ? { status: "running" } : {}
4935
4963
  }, ui.md({
4936
4964
  key: "body",
4937
- text: message.text,
4965
+ text: sanitizeDisplayText(message.text),
4938
4966
  ...message.running === true ? { stream: true } : {}
4939
4967
  }));
4940
4968
  case "tool": return toolNode(message, key, options);
@@ -4947,24 +4975,26 @@ function messageNode(message, key, options) {
4947
4975
  head: "Earlier turns"
4948
4976
  }, ui.md({
4949
4977
  key: "body",
4950
- text: message.text
4978
+ text: sanitizeDisplayText(message.text)
4951
4979
  }));
4952
4980
  }
4953
4981
  }
4954
- /** One native Work container keyed by its canonical span owner. */
4982
+ /** One native Work container keyed by its canonical span owner. Its ordered
4983
+ * structural parts place a carried snapshot-only Context cluster as a nested
4984
+ * `clusterNode` card; the flat member sequence is never re-derived here. */
4955
4985
  function workNode(span, keys, options, prefix) {
4956
4986
  const head = ["Work", ` · turn ${span.turn}`];
4957
4987
  return ui.section({
4958
4988
  key: `${prefix}work-${keys.keyFor(span.owner)}`,
4959
4989
  head
4960
- }, ...span.members.map((member) => messageNode(member, keys.keyFor(member), options)));
4990
+ }, ...span.parts.map((part) => part.kind === "message" ? messageNode(part.message, keys.keyFor(part.message), options) : clusterNode(part.cluster, keys, options, prefix)));
4961
4991
  }
4962
4992
  /** One native Context container keyed by its canonical cluster owner. */
4963
4993
  function clusterNode(cluster, keys, options, prefix) {
4964
4994
  const parts = contextClusterSummaryParts(cluster);
4965
4995
  return ui.card({
4966
4996
  key: `${prefix}ctx-${keys.keyFor(cluster.owner)}`,
4967
- head: parts.length === 0 ? "Context" : parts.join(" · ")
4997
+ head: parts.length === 0 ? "Context" : sanitizedPhysicalLine(parts.join(" · "))
4968
4998
  }, ...cluster.members.map((member) => messageNode(member, keys.keyFor(member), options)));
4969
4999
  }
4970
5000
  /**
@@ -5299,16 +5329,16 @@ function mountTspRenderer(session, options) {
5299
5329
  const model = facts.model === void 0 ? "" : ` · ${facts.model}`;
5300
5330
  lines.push(ui.text({
5301
5331
  key: `welcome-${facts.sessionId}`,
5302
- text: `DSH session ${facts.sessionId}${model}`
5332
+ text: sanitizeDisplayText(`DSH session ${facts.sessionId}${model}`)
5303
5333
  }));
5304
5334
  }
5305
5335
  for (const item of pending.queued) lines.push(ui.text({
5306
5336
  key: `queue-${item.id}`,
5307
- text: `queued (${item.mode}): ${item.text}`
5337
+ text: sanitizeDisplayText(`queued (${item.mode}): ${item.text}`)
5308
5338
  }));
5309
5339
  for (const [index, row] of pending.tail.entries()) lines.push(ui.text({
5310
5340
  key: `tail-${index}`,
5311
- text: pendingRowText(row, index)
5341
+ text: sanitizeDisplayText(pendingRowText(row, index))
5312
5342
  }));
5313
5343
  if (pending.running && pending.queued.length === 0 && pending.tail.length === 0) lines.push(ui.text({
5314
5344
  key: "pending-running",
@@ -5320,16 +5350,19 @@ function mountTspRenderer(session, options) {
5320
5350
  }));
5321
5351
  if (dock.statusLine !== "") lines.push(ui.text({
5322
5352
  key: "status",
5323
- text: dock.statusLine
5353
+ text: sanitizeDisplayText(dock.statusLine)
5324
5354
  }));
5325
5355
  if (seat.attentionCount() > 0) lines.push(ui.text({
5326
5356
  key: "question-attention",
5327
5357
  text: `Continued questions: ${seat.attentionCount()} · ${TSP_CONTINUED_INSPECTION_LABEL}`
5328
5358
  }));
5329
- for (const notice of dock.notices) lines.push(ui.text({
5330
- key: `notice-${notice.id}`,
5331
- text: notice.kind === "error" ? `! ${notice.text}` : notice.text
5332
- }));
5359
+ for (const notice of dock.notices) {
5360
+ const noticeText = sanitizeDisplayText(notice.text);
5361
+ lines.push(ui.text({
5362
+ key: `notice-${notice.id}`,
5363
+ text: notice.kind === "error" ? `! ${noticeText}` : noticeText
5364
+ }));
5365
+ }
5333
5366
  lines.push(ui.editor({
5334
5367
  key: "composer",
5335
5368
  text: composer.state().text,
@@ -23,14 +23,20 @@ var dsh_compat_matrix_default = {
23
23
  "target and the recovery wording. The floor and the target are distinct values and",
24
24
  "must stay independently derived. Consumed by src/startup.ts (inlined by the bundler)",
25
25
  "and, through scripts/lib/dsh-compat.mjs, by the release tooling, the",
26
- "installation-doc gate and the release-notes tests."
26
+ "installation-doc gate and the release-notes tests.",
27
+ "package.json restates the newest row's `dshFrom` as `engines.dsh` `>=<dshFrom>`; DSH",
28
+ "prefers that field over the DSH peer ranges and only falls back to the peers when it",
29
+ "is absent, so the peers keep the npm-level fallback in sync with the same floor",
30
+ "rather than defining a second one. Upstream matches `engines.dsh` with prereleases",
31
+ "included, which is broader than npm's peer prerelease-tuple rule; an equal range does",
32
+ "not by itself qualify every such prerelease."
27
33
  ],
28
34
  current: {
29
- "since": "0.5.2-rc.1",
30
- "requires": "DeepSeek Harness 0.2.0-rc.2 or later",
31
- "upgradeDsh": "0.2.0-rc.2",
32
- "upgradeCommand": "npm install -g --allow-scripts=@deepseek-ai/dsh-subprocess-local,koffi,node-pty @deepseek-ai/dsh@0.2.0-rc.2",
33
- "guidance": "This 0.5.2-rc.1 line requires the published DeepSeek Harness 0.2.0-rc.2 family and is validated against that exact distribution; see docs/dsh-compatibility.md."
35
+ "since": "0.5.3",
36
+ "requires": "DeepSeek Harness 0.2.1-rc.2 or later",
37
+ "upgradeDsh": "0.2.1-rc.2",
38
+ "upgradeCommand": "npm install -g --allow-scripts=@deepseek-ai/dsh-subprocess-local,koffi,node-pty @deepseek-ai/dsh@0.2.1-rc.2",
39
+ "guidance": "This 0.5.3 release requires the published DeepSeek Harness 0.2.1-rc.2 family; see docs/dsh-compatibility.md for the pairing table."
34
40
  },
35
41
  floor: {
36
42
  "below": "0.1.0-rc.8",
@@ -108,6 +114,15 @@ var dsh_compat_matrix_default = {
108
114
  "dshFrom": "0.2.0-rc.2",
109
115
  "tui": "0.5.2-rc.1",
110
116
  "versions": ["0.2.0-rc.2"]
117
+ },
118
+ {
119
+ "dshFrom": "0.2.1-rc.1",
120
+ "versions": ["0.2.1-rc.1"]
121
+ },
122
+ {
123
+ "dshFrom": "0.2.1-rc.2",
124
+ "tui": "0.5.3",
125
+ "versions": ["0.2.1-rc.2"]
111
126
  }
112
127
  ]
113
128
  };
@@ -19,8 +19,7 @@ declare const inject: string[];
19
19
  * bundle's own version cannot be read, so the message stays truthful.
20
20
  *
21
21
  * The current line has a minimum of the published npm release
22
- * dsh-v0.2.0-rc.2 (M3-3B: the Question lifecycle consumes rc.2-only
23
- * published contracts). The recovery guidance names the recommended published
22
+ * dsh-v0.2.1-rc.2. The recovery guidance names the recommended published
24
23
  * upgrade target — which may be NEWER than the floor — and allows its native
25
24
  * install scripts. The already-published 0.5.0 line keeps its own
26
25
  * rc.1-era contract and remains the compatible fallback for a
package/dist/startup.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { a as harnessCompatEntryFor, c as name, i as bundleVersionLabel, n as TUI_STARTUP_SERVICE, o as incompatibleHarnessMessage, r as apply, s as inject, t as HARNESS_COMPAT } from "./startup-CWQl0-0n.mjs";
1
+ import { a as harnessCompatEntryFor, c as name, i as bundleVersionLabel, n as TUI_STARTUP_SERVICE, o as incompatibleHarnessMessage, r as apply, s as inject, t as HARNESS_COMPAT } from "./startup-D5Xu8diR.mjs";
2
2
  export { HARNESS_COMPAT, TUI_STARTUP_SERVICE, apply, bundleVersionLabel, harnessCompatEntryFor, incompatibleHarnessMessage, inject, name };