@design.estate/dees-catalog 6.3.0 → 6.5.0

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.
Files changed (23) hide show
  1. package/dist_bundle/bundle.js +237 -52
  2. package/dist_ts_web/00_commitinfo_data.js +1 -1
  3. package/dist_ts_web/elements/00group-dataview/dees-dataview-codebox/dees-dataview-codebox.d.ts +9 -2
  4. package/dist_ts_web/elements/00group-dataview/dees-dataview-codebox/dees-dataview-codebox.js +133 -30
  5. package/dist_ts_web/elements/00group-harness/dees-harness-message-list/dees-harness-message-list.d.ts +1 -1
  6. package/dist_ts_web/elements/00group-harness/dees-harness-message-list/dees-harness-message-list.js +28 -4
  7. package/dist_ts_web/elements/00group-harness/dees-harness-tool-card/dees-harness-tool-card.d.ts +10 -0
  8. package/dist_ts_web/elements/00group-harness/dees-harness-tool-card/dees-harness-tool-card.js +77 -9
  9. package/dist_ts_web/elements/00group-harness/dees-harness-tool-card/renderers.d.ts +2 -0
  10. package/dist_ts_web/elements/00group-harness/dees-harness-tool-card/renderers.js +31 -4
  11. package/dist_ts_web/elements/00group-harness/interfaces.d.ts +7 -0
  12. package/dist_ts_web/elements/00group-harness/toolregistry.d.ts +2 -0
  13. package/dist_ts_web/elements/00group-harness/toolregistry.js +2 -2
  14. package/package.json +1 -1
  15. package/readme.hints.md +2 -1
  16. package/readme.md +5 -3
  17. package/ts_web/00_commitinfo_data.ts +1 -1
  18. package/ts_web/elements/00group-dataview/dees-dataview-codebox/dees-dataview-codebox.ts +135 -31
  19. package/ts_web/elements/00group-harness/dees-harness-message-list/dees-harness-message-list.ts +46 -5
  20. package/ts_web/elements/00group-harness/dees-harness-tool-card/dees-harness-tool-card.ts +74 -7
  21. package/ts_web/elements/00group-harness/dees-harness-tool-card/renderers.ts +43 -4
  22. package/ts_web/elements/00group-harness/interfaces.ts +8 -0
  23. package/ts_web/elements/00group-harness/toolregistry.ts +8 -2
@@ -166563,9 +166563,9 @@ init_dist_ts12();
166563
166563
  init_services();
166564
166564
  init_dees_tile();
166565
166565
  init_dees_icon();
166566
- var _highlightVersion_dec, _expandedFolds_dec, _copied_dec, _highlightedCode_dec, _diffView_dec, _unifiedDiff_dec, _codeBefore_dec, _codeToDisplay_dec, _filename_dec, _progLang_dec, _a63, _DeesDataviewCodebox_decorators, _init64, _progLang, _filename, _codeToDisplay, _codeBefore, _unifiedDiff, _diffView, _highlightedCode, _copied, _expandedFolds, _highlightVersion;
166566
+ var _highlightVersion_dec, _expandedFolds_dec, _copied_dec, _highlightedCode_dec, _showDiffLineNumbers_dec, _diffView_dec, _unifiedDiff_dec, _codeBefore_dec, _codeToDisplay_dec, _filename_dec, _progLang_dec, _a63, _DeesDataviewCodebox_decorators, _init64, _progLang, _filename, _codeToDisplay, _codeBefore, _unifiedDiff, _diffView, _showDiffLineNumbers, _highlightedCode, _copied, _expandedFolds, _highlightVersion;
166567
166567
  _DeesDataviewCodebox_decorators = [customElement("dees-dataview-codebox")];
166568
- var _DeesDataviewCodebox = class _DeesDataviewCodebox extends (_a63 = DeesElement, _progLang_dec = [n5()], _filename_dec = [n5()], _codeToDisplay_dec = [n5({ type: String })], _codeBefore_dec = [n5({ type: String })], _unifiedDiff_dec = [n5({ type: String })], _diffView_dec = [n5({ type: String })], _highlightedCode_dec = [r5()], _copied_dec = [r5()], _expandedFolds_dec = [r5()], _highlightVersion_dec = [r5()], _a63) {
166568
+ var _DeesDataviewCodebox = class _DeesDataviewCodebox extends (_a63 = DeesElement, _progLang_dec = [n5()], _filename_dec = [n5()], _codeToDisplay_dec = [n5({ type: String })], _codeBefore_dec = [n5({ type: String })], _unifiedDiff_dec = [n5({ type: String })], _diffView_dec = [n5({ type: String })], _showDiffLineNumbers_dec = [n5({ type: Boolean })], _highlightedCode_dec = [r5()], _copied_dec = [r5()], _expandedFolds_dec = [r5()], _highlightVersion_dec = [r5()], _a63) {
166569
166569
  constructor() {
166570
166570
  super(...arguments);
166571
166571
  __privateAdd(this, _progLang, __runInitializers(_init64, 8, this, "typescript")), __runInitializers(_init64, 11, this);
@@ -166574,10 +166574,11 @@ var _DeesDataviewCodebox = class _DeesDataviewCodebox extends (_a63 = DeesElemen
166574
166574
  __privateAdd(this, _codeBefore, __runInitializers(_init64, 20, this, "")), __runInitializers(_init64, 23, this);
166575
166575
  __privateAdd(this, _unifiedDiff, __runInitializers(_init64, 24, this, "")), __runInitializers(_init64, 27, this);
166576
166576
  __privateAdd(this, _diffView, __runInitializers(_init64, 28, this, "")), __runInitializers(_init64, 31, this);
166577
- __privateAdd(this, _highlightedCode, __runInitializers(_init64, 32, this, "")), __runInitializers(_init64, 35, this);
166578
- __privateAdd(this, _copied, __runInitializers(_init64, 36, this, false)), __runInitializers(_init64, 39, this);
166579
- __privateAdd(this, _expandedFolds, __runInitializers(_init64, 40, this, /* @__PURE__ */ new Set())), __runInitializers(_init64, 43, this);
166580
- __privateAdd(this, _highlightVersion, __runInitializers(_init64, 44, this, 0)), __runInitializers(_init64, 47, this);
166577
+ __privateAdd(this, _showDiffLineNumbers, __runInitializers(_init64, 32, this, true)), __runInitializers(_init64, 35, this);
166578
+ __privateAdd(this, _highlightedCode, __runInitializers(_init64, 36, this, "")), __runInitializers(_init64, 39, this);
166579
+ __privateAdd(this, _copied, __runInitializers(_init64, 40, this, false)), __runInitializers(_init64, 43, this);
166580
+ __privateAdd(this, _expandedFolds, __runInitializers(_init64, 44, this, /* @__PURE__ */ new Set())), __runInitializers(_init64, 47, this);
166581
+ __privateAdd(this, _highlightVersion, __runInitializers(_init64, 48, this, 0)), __runInitializers(_init64, 51, this);
166581
166582
  __publicField(this, "processedCode", "");
166582
166583
  __publicField(this, "highlightJs", null);
166583
166584
  __publicField(this, "highlightToken", 0);
@@ -166639,6 +166640,22 @@ var _DeesDataviewCodebox = class _DeesDataviewCodebox extends (_a63 = DeesElemen
166639
166640
  <div slot="header" class="appbar">
166640
166641
  <div class="fileName">${this.filename}</div>
166641
166642
  <div class="actions">
166643
+ ${this.isDiffActive ? b2`
166644
+ <div class="viewToggle" role="group" aria-label="Diff layout">
166645
+ <button
166646
+ class="viewButton ${this.effectiveDiffView === "inline" ? "active" : ""}"
166647
+ type="button"
166648
+ aria-pressed=${String(this.effectiveDiffView === "inline")}
166649
+ @click=${() => this.setDiffView("inline")}
166650
+ >Inline</button>
166651
+ <button
166652
+ class="viewButton ${this.effectiveDiffView === "split" ? "active" : ""}"
166653
+ type="button"
166654
+ aria-pressed=${String(this.effectiveDiffView === "split")}
166655
+ @click=${() => this.setDiffView("split")}
166656
+ >Split</button>
166657
+ </div>
166658
+ ` : ""}
166642
166659
  <div
166643
166660
  class="copyButton ${this.copied ? "copied" : ""}"
166644
166661
  title="Copy code"
@@ -166682,15 +166699,11 @@ var _DeesDataviewCodebox = class _DeesDataviewCodebox extends (_a63 = DeesElemen
166682
166699
  }
166683
166700
  renderDiff() {
166684
166701
  const displayRows = this.displayRowsWithFolds();
166685
- return b2`
166686
- <div class="diffScroll">
166687
- ${this.effectiveDiffView === "split" ? this.renderSplitGrid(displayRows) : this.renderInlineGrid(displayRows)}
166688
- </div>
166689
- `;
166702
+ return this.effectiveDiffView === "split" ? this.renderSplitGrid(displayRows) : b2`<div class="diffScroll">${this.renderInlineGrid(displayRows)}</div>`;
166690
166703
  }
166691
166704
  renderInlineGrid(displayRows) {
166692
166705
  return b2`
166693
- <div class="diffGrid inline">
166706
+ <div class="diffGrid inline ${this.showDiffLineNumbers ? "" : "withoutLineNumbers"}">
166694
166707
  ${displayRows.map((displayRow) => {
166695
166708
  if (displayRow.kind === "fold") {
166696
166709
  return this.renderFoldRow(displayRow.rows.length, displayRow.ordinal ?? 0);
@@ -166700,8 +166713,10 @@ var _DeesDataviewCodebox = class _DeesDataviewCodebox extends (_a63 = DeesElemen
166700
166713
  }
166701
166714
  const rowClass = displayRow.kind === "add" ? "row-add" : displayRow.kind === "remove" ? "row-remove" : "";
166702
166715
  return b2`
166703
- <div class="diffNum ${rowClass}">${displayRow.oldLine ?? ""}</div>
166704
- <div class="diffNum ${rowClass}">${displayRow.newLine ?? ""}</div>
166716
+ ${this.showDiffLineNumbers ? b2`
166717
+ <div class="diffNum ${rowClass}">${displayRow.oldLine ?? ""}</div>
166718
+ <div class="diffNum ${rowClass}">${displayRow.newLine ?? ""}</div>
166719
+ ` : ""}
166705
166720
  <div class="diffSign ${rowClass}">${displayRow.kind === "add" ? "+" : displayRow.kind === "remove" ? "\u2212" : ""}</div>
166706
166721
  <div class="diffText ${rowClass}">${this.renderDiffLine(displayRow.text, displayRow.segments, displayRow.kind)}</div>
166707
166722
  `;
@@ -166710,17 +166725,17 @@ var _DeesDataviewCodebox = class _DeesDataviewCodebox extends (_a63 = DeesElemen
166710
166725
  `;
166711
166726
  }
166712
166727
  renderSplitGrid(displayRows) {
166713
- const rendered = [];
166728
+ const leftRendered = [];
166729
+ const rightRendered = [];
166714
166730
  let run3 = [];
166715
166731
  const flushRun = /* @__PURE__ */ __name(() => {
166716
166732
  for (const splitRow of buildSplitRows(run3)) {
166717
166733
  if (splitRow.kind === "hunk") {
166718
- rendered.push(b2`<div class="diffHunk">${splitRow.text}</div>`);
166734
+ leftRendered.push(b2`<div class="diffHunk">${splitRow.text}</div>`);
166735
+ rightRendered.push(b2`<div class="diffHunk">${splitRow.text}</div>`);
166719
166736
  } else {
166720
- rendered.push(b2`
166721
- ${this.renderSplitCell(splitRow.left, "left")}
166722
- ${this.renderSplitCell(splitRow.right, "right")}
166723
- `);
166737
+ leftRendered.push(this.renderSplitCell(splitRow.left));
166738
+ rightRendered.push(this.renderSplitCell(splitRow.right));
166724
166739
  }
166725
166740
  }
166726
166741
  run3 = [];
@@ -166728,26 +166743,37 @@ var _DeesDataviewCodebox = class _DeesDataviewCodebox extends (_a63 = DeesElemen
166728
166743
  for (const displayRow of displayRows) {
166729
166744
  if (displayRow.kind === "fold") {
166730
166745
  flushRun();
166731
- rendered.push(this.renderFoldRow(displayRow.rows.length, displayRow.ordinal ?? 0));
166746
+ leftRendered.push(this.renderFoldRow(displayRow.rows.length, displayRow.ordinal ?? 0));
166747
+ rightRendered.push(this.renderFoldRow(displayRow.rows.length, displayRow.ordinal ?? 0));
166732
166748
  } else {
166733
166749
  run3.push(displayRow);
166734
166750
  }
166735
166751
  }
166736
166752
  flushRun();
166737
- return b2`<div class="diffGrid split">${rendered}</div>`;
166753
+ const lineNumberClass = this.showDiffLineNumbers ? "" : "withoutLineNumbers";
166754
+ return b2`
166755
+ <div class="diffSplit">
166756
+ <div class="diffSplitPane" data-side="left" aria-label="Before">
166757
+ <div class="diffGrid splitSide ${lineNumberClass}">${leftRendered}</div>
166758
+ </div>
166759
+ <div class="diffSplitDivider" aria-hidden="true"></div>
166760
+ <div class="diffSplitPane" data-side="right" aria-label="After">
166761
+ <div class="diffGrid splitSide ${lineNumberClass}">${rightRendered}</div>
166762
+ </div>
166763
+ </div>
166764
+ `;
166738
166765
  }
166739
- renderSplitCell(cell2, side) {
166740
- const separatorClass = side === "right" ? "diffSplitSep" : "";
166766
+ renderSplitCell(cell2) {
166741
166767
  if (!cell2) {
166742
166768
  return b2`
166743
- <div class="diffNum row-filler ${separatorClass}"></div>
166769
+ ${this.showDiffLineNumbers ? b2`<div class="diffNum row-filler"></div>` : ""}
166744
166770
  <div class="diffSign row-filler"></div>
166745
166771
  <div class="diffText row-filler"></div>
166746
166772
  `;
166747
166773
  }
166748
166774
  const rowClass = cell2.kind === "add" ? "row-add" : cell2.kind === "remove" ? "row-remove" : "";
166749
166775
  return b2`
166750
- <div class="diffNum ${rowClass} ${separatorClass}">${cell2.line || ""}</div>
166776
+ ${this.showDiffLineNumbers ? b2`<div class="diffNum ${rowClass}">${cell2.line || ""}</div>` : ""}
166751
166777
  <div class="diffSign ${rowClass}">${cell2.kind === "add" ? "+" : cell2.kind === "remove" ? "\u2212" : ""}</div>
166752
166778
  <div class="diffText ${rowClass}">${this.renderDiffLine(cell2.text, cell2.segments, cell2.kind)}</div>
166753
166779
  `;
@@ -166785,6 +166811,15 @@ var _DeesDataviewCodebox = class _DeesDataviewCodebox extends (_a63 = DeesElemen
166785
166811
  get effectiveDiffView() {
166786
166812
  return this.diffView === "split" ? "split" : "inline";
166787
166813
  }
166814
+ setDiffView(diffViewArg) {
166815
+ if (this.effectiveDiffView === diffViewArg) return;
166816
+ this.diffView = diffViewArg;
166817
+ this.dispatchEvent(new CustomEvent("diff-view-change", {
166818
+ detail: { diffView: diffViewArg },
166819
+ bubbles: true,
166820
+ composed: true
166821
+ }));
166822
+ }
166788
166823
  willUpdate(changedProperties) {
166789
166824
  super.willUpdate(changedProperties);
166790
166825
  if (changedProperties.has("codeToDisplay")) {
@@ -166913,6 +166948,7 @@ _codeToDisplay = new WeakMap();
166913
166948
  _codeBefore = new WeakMap();
166914
166949
  _unifiedDiff = new WeakMap();
166915
166950
  _diffView = new WeakMap();
166951
+ _showDiffLineNumbers = new WeakMap();
166916
166952
  _highlightedCode = new WeakMap();
166917
166953
  _copied = new WeakMap();
166918
166954
  _expandedFolds = new WeakMap();
@@ -166923,6 +166959,7 @@ __decorateElement(_init64, 4, "codeToDisplay", _codeToDisplay_dec, _DeesDataview
166923
166959
  __decorateElement(_init64, 4, "codeBefore", _codeBefore_dec, _DeesDataviewCodebox, _codeBefore);
166924
166960
  __decorateElement(_init64, 4, "unifiedDiff", _unifiedDiff_dec, _DeesDataviewCodebox, _unifiedDiff);
166925
166961
  __decorateElement(_init64, 4, "diffView", _diffView_dec, _DeesDataviewCodebox, _diffView);
166962
+ __decorateElement(_init64, 4, "showDiffLineNumbers", _showDiffLineNumbers_dec, _DeesDataviewCodebox, _showDiffLineNumbers);
166926
166963
  __decorateElement(_init64, 4, "highlightedCode", _highlightedCode_dec, _DeesDataviewCodebox, _highlightedCode);
166927
166964
  __decorateElement(_init64, 4, "copied", _copied_dec, _DeesDataviewCodebox, _copied);
166928
166965
  __decorateElement(_init64, 4, "expandedFolds", _expandedFolds_dec, _DeesDataviewCodebox, _expandedFolds);
@@ -166971,9 +167008,40 @@ __publicField(_DeesDataviewCodebox, "styles", [
166971
167008
  .appbar .actions {
166972
167009
  grid-column: 3;
166973
167010
  display: flex;
167011
+ align-items: center;
167012
+ gap: var(--dees-spacing-sm);
166974
167013
  justify-content: flex-end;
166975
167014
  }
166976
167015
 
167016
+ .viewToggle {
167017
+ display: flex;
167018
+ padding: 2px;
167019
+ border: 1px solid var(--dees-color-border-subtle);
167020
+ border-radius: var(--dees-radius-md);
167021
+ background: var(--dees-color-bg-tertiary);
167022
+ }
167023
+
167024
+ .viewButton {
167025
+ padding: 3px 7px;
167026
+ border: 0;
167027
+ border-radius: calc(var(--dees-radius-md) - 2px);
167028
+ background: transparent;
167029
+ color: var(--dees-color-text-muted);
167030
+ cursor: pointer;
167031
+ font: inherit;
167032
+ font-size: var(--dees-font-caption2-size);
167033
+ line-height: 1.2;
167034
+ }
167035
+
167036
+ .viewButton:hover {
167037
+ color: var(--dees-color-text-primary);
167038
+ }
167039
+
167040
+ .viewButton.active {
167041
+ background: var(--dees-color-active);
167042
+ color: var(--dees-color-text-primary);
167043
+ }
167044
+
166977
167045
  .copyButton {
166978
167046
  display: flex;
166979
167047
  align-items: center;
@@ -167095,8 +167163,37 @@ __publicField(_DeesDataviewCodebox, "styles", [
167095
167163
  grid-template-columns: minmax(3ch, auto) minmax(3ch, auto) 2ch minmax(0, 1fr);
167096
167164
  }
167097
167165
 
167098
- .diffGrid.split {
167099
- grid-template-columns: minmax(3ch, auto) 2ch minmax(24ch, 1fr) minmax(3ch, auto) 2ch minmax(24ch, 1fr);
167166
+ .diffGrid.inline.withoutLineNumbers {
167167
+ grid-template-columns: 2ch minmax(0, 1fr);
167168
+ }
167169
+
167170
+ .diffSplit {
167171
+ display: grid;
167172
+ grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
167173
+ align-items: start;
167174
+ min-width: 0;
167175
+ padding: var(--dees-spacing-sm) 0;
167176
+ }
167177
+
167178
+ .diffSplitDivider {
167179
+ align-self: stretch;
167180
+ background: var(--dees-color-border-default);
167181
+ }
167182
+
167183
+ .diffSplitPane {
167184
+ min-width: 0;
167185
+ overflow-x: auto;
167186
+ overflow-y: hidden;
167187
+ scrollbar-width: thin;
167188
+ scrollbar-color: var(--dees-color-scrollbar-thumb) transparent;
167189
+ }
167190
+
167191
+ .diffGrid.splitSide {
167192
+ grid-template-columns: minmax(3ch, auto) 2ch minmax(24ch, 1fr);
167193
+ }
167194
+
167195
+ .diffGrid.splitSide.withoutLineNumbers {
167196
+ grid-template-columns: 2ch minmax(24ch, 1fr);
167100
167197
  }
167101
167198
 
167102
167199
  .diffGrid > div {
@@ -167184,10 +167281,6 @@ __publicField(_DeesDataviewCodebox, "styles", [
167184
167281
  color: var(--dees-color-link-hover);
167185
167282
  }
167186
167283
 
167187
- .diffSplitSep {
167188
- border-left: 1px solid var(--dees-color-border-subtle);
167189
- }
167190
-
167191
167284
  .diffStat {
167192
167285
  font-weight: 600;
167193
167286
  }
@@ -173278,7 +173371,7 @@ var filePathOf = /* @__PURE__ */ __name((call) => inputField(call, "path") || in
173278
173371
  var defaultDescriptors = [
173279
173372
  {
173280
173373
  kind: "terminal",
173281
- names: ["run_command", "bash", "shell", "exec"],
173374
+ names: ["run_command", "run_shell", "bash", "shell", "exec"],
173282
173375
  label: "Shell",
173283
173376
  icon: "lucide:Terminal",
173284
173377
  subtitle: /* @__PURE__ */ __name((call) => {
@@ -175959,11 +176052,14 @@ var parseApplyPatch = /* @__PURE__ */ __name((patchText) => {
175959
176052
  let current = null;
175960
176053
  const flush = /* @__PURE__ */ __name(() => {
175961
176054
  if (!current) return;
176055
+ const unifiedDiff = current.op === "update" && current.sawHunk && current.lineNumbersKnown ? [`--- a/${current.path}`, `+++ b/${current.path}`, ...current.patch].join("\n") : void 0;
175962
176056
  files.push({
175963
176057
  op: current.op,
175964
176058
  path: current.path,
175965
176059
  before: current.before.join("\n"),
175966
- after: current.after.join("\n")
176060
+ after: current.after.join("\n"),
176061
+ unifiedDiff,
176062
+ lineNumbersKnown: Boolean(unifiedDiff)
175967
176063
  });
175968
176064
  current = null;
175969
176065
  }, "flush");
@@ -175975,16 +176071,28 @@ var parseApplyPatch = /* @__PURE__ */ __name((patchText) => {
175975
176071
  op: header[1].toLowerCase(),
175976
176072
  path: header[2].trim(),
175977
176073
  before: [],
175978
- after: []
176074
+ after: [],
176075
+ patch: [],
176076
+ sawHunk: false,
176077
+ lineNumbersKnown: true
175979
176078
  };
175980
176079
  continue;
175981
176080
  }
175982
- if (/^\*\*\* (Begin|End) Patch/.test(line) || /^\*\*\* Move to: /.test(line)) {
176081
+ if (/^\*\*\* (Begin|End) Patch/.test(line) || line === "*** End of File" || /^\*\*\* Move to: /.test(line)) {
175983
176082
  if (/End Patch/.test(line)) flush();
175984
176083
  continue;
175985
176084
  }
175986
176085
  if (!current) continue;
175987
- if (line.startsWith("@@")) continue;
176086
+ if (line.startsWith("@@")) {
176087
+ current.sawHunk = true;
176088
+ if (/^@@ -\d+(?:,\d+)? \+\d+(?:,\d+)? @@/.test(line)) {
176089
+ current.patch.push(line);
176090
+ } else {
176091
+ current.lineNumbersKnown = false;
176092
+ }
176093
+ continue;
176094
+ }
176095
+ current.patch.push(line);
175988
176096
  if (line.startsWith("+")) {
175989
176097
  current.after.push(line.slice(1));
175990
176098
  } else if (line.startsWith("-")) {
@@ -176051,7 +176159,9 @@ var renderFileWrite = /* @__PURE__ */ __name((call, helpers) => {
176051
176159
  return helpers.diffBlock(file.before, file.after, {
176052
176160
  language: patchLanguage,
176053
176161
  filename: patchFilename,
176054
- view: "split"
176162
+ view: "split",
176163
+ unifiedDiff: file.unifiedDiff,
176164
+ showLineNumbers: file.lineNumbersKnown
176055
176165
  });
176056
176166
  }
176057
176167
  if (file.op === "add") {
@@ -176071,7 +176181,13 @@ var renderFileWrite = /* @__PURE__ */ __name((call, helpers) => {
176071
176181
  const filename = path2.split("/").pop() || void 0;
176072
176182
  const language = harnessLanguageForPath(path2);
176073
176183
  if (previousContent) {
176074
- return helpers.diffBlock(previousContent, newContent, { language, filename, view: "split" });
176184
+ const isStringReplacement = input.oldString !== void 0 || input.old_string !== void 0;
176185
+ return helpers.diffBlock(previousContent, newContent, {
176186
+ language,
176187
+ filename,
176188
+ view: "split",
176189
+ showLineNumbers: !isStringReplacement
176190
+ });
176075
176191
  }
176076
176192
  if (newContent) {
176077
176193
  return helpers.codeBlock(newContent, language, filename);
@@ -176546,9 +176662,9 @@ var DeesHarnessToolFullscreen = _DeesHarnessToolFullscreen;
176546
176662
  init_dist_ts26();
176547
176663
  init_theme();
176548
176664
  init_dees_icon();
176549
- var _outcomeScanTone_dec, _returnFlash_dec, _bodyOverflowing_dec, _uncapped_dec, _bodyCapPx_dec, _bodyMounted_dec, _outputExpanded_dec, _expanded_dec2, _allowSubtaskStreams_dec, _toolRegistry_dec2, _call_dec2, _a81, _DeesHarnessToolCard_decorators, _init82, _call2, _toolRegistry2, _allowSubtaskStreams, _expanded2, _outputExpanded, _bodyMounted, _bodyCapPx, _uncapped, _bodyOverflowing, _returnFlash, _outcomeScanTone;
176665
+ var _diffViewOverride_dec, _outcomeScanTone_dec, _returnFlash_dec, _bodyOverflowing_dec, _uncapped_dec, _bodyCapPx_dec, _bodyMounted_dec, _outputExpanded_dec, _expanded_dec2, _allowSubtaskStreams_dec, _toolRegistry_dec2, _call_dec2, _a81, _DeesHarnessToolCard_decorators, _init82, _call2, _toolRegistry2, _allowSubtaskStreams, _expanded2, _outputExpanded, _bodyMounted, _bodyCapPx, _uncapped, _bodyOverflowing, _returnFlash, _outcomeScanTone, _diffViewOverride;
176550
176666
  _DeesHarnessToolCard_decorators = [customElement("dees-harness-tool-card")];
176551
- var _DeesHarnessToolCard = class _DeesHarnessToolCard extends (_a81 = DeesElement, _call_dec2 = [n5({ attribute: false })], _toolRegistry_dec2 = [n5({ attribute: false })], _allowSubtaskStreams_dec = [n5({ type: Boolean })], _expanded_dec2 = [r5()], _outputExpanded_dec = [r5()], _bodyMounted_dec = [r5()], _bodyCapPx_dec = [n5({ type: Number })], _uncapped_dec = [n5({ type: Boolean })], _bodyOverflowing_dec = [r5()], _returnFlash_dec = [r5()], _outcomeScanTone_dec = [r5()], _a81) {
176667
+ var _DeesHarnessToolCard = class _DeesHarnessToolCard extends (_a81 = DeesElement, _call_dec2 = [n5({ attribute: false })], _toolRegistry_dec2 = [n5({ attribute: false })], _allowSubtaskStreams_dec = [n5({ type: Boolean })], _expanded_dec2 = [r5()], _outputExpanded_dec = [r5()], _bodyMounted_dec = [r5()], _bodyCapPx_dec = [n5({ type: Number })], _uncapped_dec = [n5({ type: Boolean })], _bodyOverflowing_dec = [r5()], _returnFlash_dec = [r5()], _outcomeScanTone_dec = [r5()], _diffViewOverride_dec = [r5()], _a81) {
176552
176668
  constructor() {
176553
176669
  super(...arguments);
176554
176670
  __privateAdd(this, _call2, __runInitializers(_init82, 8, this, { id: "", name: "", status: "pending" })), __runInitializers(_init82, 11, this);
@@ -176562,12 +176678,16 @@ var _DeesHarnessToolCard = class _DeesHarnessToolCard extends (_a81 = DeesElemen
176562
176678
  __privateAdd(this, _bodyOverflowing, __runInitializers(_init82, 40, this, false)), __runInitializers(_init82, 43, this);
176563
176679
  __privateAdd(this, _returnFlash, __runInitializers(_init82, 44, this, false)), __runInitializers(_init82, 47, this);
176564
176680
  __privateAdd(this, _outcomeScanTone, __runInitializers(_init82, 48, this, null)), __runInitializers(_init82, 51, this);
176681
+ __privateAdd(this, _diffViewOverride, __runInitializers(_init82, 52, this, null)), __runInitializers(_init82, 55, this);
176565
176682
  __publicField(this, "bodyResizeObserver", null);
176566
176683
  __publicField(this, "observedBodyInner", null);
176567
176684
  __publicField(this, "fullscreenPortal", null);
176568
176685
  __publicField(this, "disclosureFrame", null);
176569
176686
  __publicField(this, "subtaskResultElement", null);
176570
176687
  __publicField(this, "subtaskResultResizeObserver", null);
176688
+ __publicField(this, "terminalTailFollowing", true);
176689
+ __publicField(this, "terminalTailReturnTimeout", null);
176690
+ __publicField(this, "terminalTailReturnDelayMs", 5e3);
176571
176691
  __publicField(this, "toggleDisclosure", /* @__PURE__ */ __name(() => {
176572
176692
  if (this.isOpen) {
176573
176693
  if (this.disclosureFrame !== null) cancelAnimationFrame(this.disclosureFrame);
@@ -176621,6 +176741,29 @@ var _DeesHarnessToolCard = class _DeesHarnessToolCard extends (_a81 = DeesElemen
176621
176741
  this.scrollIntoView({ block: "center", behavior: "smooth" });
176622
176742
  });
176623
176743
  }, "closeFullscreen"));
176744
+ __publicField(this, "handleBodyScroll", /* @__PURE__ */ __name((eventArg) => {
176745
+ if (this.descriptor.kind !== "terminal" || this.uncapped) return;
176746
+ const frame = eventArg.currentTarget;
176747
+ this.terminalTailFollowing = frame.scrollHeight - frame.scrollTop - frame.clientHeight <= 2;
176748
+ if (this.terminalTailFollowing) this.cancelTerminalTailReturn();
176749
+ }, "handleBodyScroll"));
176750
+ __publicField(this, "scheduleTerminalTailReturn", /* @__PURE__ */ __name(() => {
176751
+ if (this.descriptor.kind !== "terminal" || this.terminalTailFollowing || this.uncapped) return;
176752
+ this.cancelTerminalTailReturn();
176753
+ this.terminalTailReturnTimeout = setTimeout(() => {
176754
+ this.terminalTailReturnTimeout = null;
176755
+ this.terminalTailFollowing = true;
176756
+ this.scrollTerminalToTail();
176757
+ }, this.terminalTailReturnDelayMs);
176758
+ }, "scheduleTerminalTailReturn"));
176759
+ __publicField(this, "cancelTerminalTailReturn", /* @__PURE__ */ __name(() => {
176760
+ if (!this.terminalTailReturnTimeout) return;
176761
+ clearTimeout(this.terminalTailReturnTimeout);
176762
+ this.terminalTailReturnTimeout = null;
176763
+ }, "cancelTerminalTailReturn"));
176764
+ __publicField(this, "handleDiffViewChange", /* @__PURE__ */ __name((eventArg) => {
176765
+ this.diffViewOverride = eventArg.detail.diffView;
176766
+ }, "handleDiffViewChange"));
176624
176767
  __publicField(this, "syncSubtaskResultScroll", /* @__PURE__ */ __name(() => {
176625
176768
  const result = this.subtaskResultElement;
176626
176769
  if (!result) return;
@@ -176671,6 +176814,8 @@ var _DeesHarnessToolCard = class _DeesHarnessToolCard extends (_a81 = DeesElemen
176671
176814
  const duration = harnessFormatDuration(call.startedAt, call.finishedAt);
176672
176815
  return b2`
176673
176816
  <div class="harness-card status-${effectiveStatus} ${descriptor.destructive ? "destructive" : ""} ${this.hasSubtaskPreview ? "subtaskPreviewCard" : ""} ${this.hasSubtaskPreview && open ? "subtaskPreviewOpen" : ""} ${this.returnFlash ? "returnFlash" : ""} ${this.outcomeScanTone ? `outcomeScan outcomeScan-${this.outcomeScanTone}` : ""}"
176817
+ @mouseenter=${this.cancelTerminalTailReturn}
176818
+ @mouseleave=${this.scheduleTerminalTailReturn}
176674
176819
  @animationend=${(event) => {
176675
176820
  if (event.animationName === "harness-card-return-flash") {
176676
176821
  this.endReturnFlash();
@@ -176710,6 +176855,7 @@ var _DeesHarnessToolCard = class _DeesHarnessToolCard extends (_a81 = DeesElemen
176710
176855
  <div
176711
176856
  class="bodyClipFrame"
176712
176857
  style=${this.uncapped || this.activeSubtaskPreview ? "" : `max-height: ${this.bodyCapPx}px;`}
176858
+ @scroll=${this.handleBodyScroll}
176713
176859
  >
176714
176860
  <div class=${`body bodyInner ${this.hasLiveSubtaskPreview ? "liveSubtaskBody" : ""}`}>
176715
176861
  ${this.renderBody(call)}
@@ -176755,7 +176901,13 @@ var _DeesHarnessToolCard = class _DeesHarnessToolCard extends (_a81 = DeesElemen
176755
176901
  willUpdate(changedProperties) {
176756
176902
  super.willUpdate(changedProperties);
176757
176903
  const previousCall = changedProperties.get("call");
176758
- if (!previousCall || previousCall.id !== this.call.id) return;
176904
+ if (!previousCall) return;
176905
+ if (previousCall.id !== this.call.id) {
176906
+ this.diffViewOverride = null;
176907
+ this.terminalTailFollowing = true;
176908
+ this.cancelTerminalTailReturn();
176909
+ return;
176910
+ }
176759
176911
  const previousStatus = harnessEffectiveToolStatus(previousCall);
176760
176912
  const currentStatus = harnessEffectiveToolStatus(this.call);
176761
176913
  const wasActive = previousStatus === "pending" || previousStatus === "running";
@@ -176781,7 +176933,12 @@ var _DeesHarnessToolCard = class _DeesHarnessToolCard extends (_a81 = DeesElemen
176781
176933
  return;
176782
176934
  }
176783
176935
  const bodyInner = this.shadowRoot?.querySelector(".bodyInner") ?? null;
176784
- if (bodyInner === this.observedBodyInner) return;
176936
+ if (bodyInner === this.observedBodyInner) {
176937
+ if ((changedProperties.has("call") || changedProperties.has("bodyCapPx")) && this.terminalTailFollowing) {
176938
+ this.scrollTerminalToTail();
176939
+ }
176940
+ return;
176941
+ }
176785
176942
  this.bodyResizeObserver?.disconnect();
176786
176943
  this.observedBodyInner = bodyInner;
176787
176944
  if (!bodyInner) {
@@ -176792,8 +176949,16 @@ var _DeesHarnessToolCard = class _DeesHarnessToolCard extends (_a81 = DeesElemen
176792
176949
  const inner = this.observedBodyInner;
176793
176950
  if (!inner) return;
176794
176951
  this.bodyOverflowing = inner.scrollHeight > this.bodyCapPx + 24;
176952
+ if (this.terminalTailFollowing) this.scrollTerminalToTail();
176795
176953
  });
176796
176954
  this.bodyResizeObserver.observe(bodyInner);
176955
+ if (this.terminalTailFollowing) this.scrollTerminalToTail();
176956
+ }
176957
+ scrollTerminalToTail() {
176958
+ if (this.descriptor.kind !== "terminal" || this.uncapped || !this.isOpen) return;
176959
+ const frame = this.shadowRoot?.querySelector(".bodyClipFrame");
176960
+ if (!frame) return;
176961
+ frame.scrollTop = frame.scrollHeight;
176797
176962
  }
176798
176963
  connectSubtaskResultScroll() {
176799
176964
  const nextResult = this.shadowRoot?.querySelector(
@@ -176830,6 +176995,7 @@ var _DeesHarnessToolCard = class _DeesHarnessToolCard extends (_a81 = DeesElemen
176830
176995
  clearTimeout(this.outcomeScanFallbackTimeout);
176831
176996
  this.outcomeScanFallbackTimeout = null;
176832
176997
  }
176998
+ this.cancelTerminalTailReturn();
176833
176999
  this.fullscreenPortal?.remove();
176834
177000
  this.fullscreenPortal = null;
176835
177001
  this.bodyResizeObserver?.disconnect();
@@ -176942,9 +177108,12 @@ var _DeesHarnessToolCard = class _DeesHarnessToolCard extends (_a81 = DeesElemen
176942
177108
  <dees-dataview-codebox
176943
177109
  .progLang=${options2?.language ?? "plaintext"}
176944
177110
  .filename=${options2?.filename ?? ""}
176945
- .diffView=${options2?.view ?? "inline"}
177111
+ .diffView=${this.diffViewOverride ?? options2?.view ?? "inline"}
177112
+ .unifiedDiff=${options2?.unifiedDiff ?? ""}
177113
+ .showDiffLineNumbers=${options2?.showLineNumbers ?? true}
176946
177114
  .codeBefore=${before}
176947
177115
  .codeToDisplay=${after}
177116
+ @diff-view-change=${this.handleDiffViewChange}
176948
177117
  ></dees-dataview-codebox>
176949
177118
  `, "diffBlock"),
176950
177119
  monoBlock: /* @__PURE__ */ __name((text8, options2) => {
@@ -176994,6 +177163,7 @@ _uncapped = new WeakMap();
176994
177163
  _bodyOverflowing = new WeakMap();
176995
177164
  _returnFlash = new WeakMap();
176996
177165
  _outcomeScanTone = new WeakMap();
177166
+ _diffViewOverride = new WeakMap();
176997
177167
  __decorateElement(_init82, 4, "call", _call_dec2, _DeesHarnessToolCard, _call2);
176998
177168
  __decorateElement(_init82, 4, "toolRegistry", _toolRegistry_dec2, _DeesHarnessToolCard, _toolRegistry2);
176999
177169
  __decorateElement(_init82, 4, "allowSubtaskStreams", _allowSubtaskStreams_dec, _DeesHarnessToolCard, _allowSubtaskStreams);
@@ -177005,6 +177175,7 @@ __decorateElement(_init82, 4, "uncapped", _uncapped_dec, _DeesHarnessToolCard, _
177005
177175
  __decorateElement(_init82, 4, "bodyOverflowing", _bodyOverflowing_dec, _DeesHarnessToolCard, _bodyOverflowing);
177006
177176
  __decorateElement(_init82, 4, "returnFlash", _returnFlash_dec, _DeesHarnessToolCard, _returnFlash);
177007
177177
  __decorateElement(_init82, 4, "outcomeScanTone", _outcomeScanTone_dec, _DeesHarnessToolCard, _outcomeScanTone);
177178
+ __decorateElement(_init82, 4, "diffViewOverride", _diffViewOverride_dec, _DeesHarnessToolCard, _diffViewOverride);
177008
177179
  _DeesHarnessToolCard = __decorateElement(_init82, 0, "DeesHarnessToolCard", _DeesHarnessToolCard_decorators, _DeesHarnessToolCard);
177009
177180
  __name(_DeesHarnessToolCard, "DeesHarnessToolCard");
177010
177181
  __publicField(_DeesHarnessToolCard, "demo", demoFunc56);
@@ -177407,7 +177578,7 @@ __publicField(_DeesHarnessToolCard, "styles", [
177407
177578
  border: 1px solid var(--dees-color-border-subtle);
177408
177579
  border-radius: var(--dees-radius-md);
177409
177580
  corner-shape: var(--dees-corner-shape);
177410
- background: var(--dees-color-code-block-bg, #0c0c0e);
177581
+ background: #0c0c0e;
177411
177582
  overflow: hidden;
177412
177583
  font-family: var(--dees-font-family-mono);
177413
177584
  font-size: var(--dees-font-control-size-sm, 12px);
@@ -177417,7 +177588,7 @@ __publicField(_DeesHarnessToolCard, "styles", [
177417
177588
  .harness-terminal-command {
177418
177589
  padding: var(--dees-spacing-xs) var(--dees-spacing-md);
177419
177590
  border-bottom: 1px solid var(--dees-color-border-subtle);
177420
- color: var(--dees-color-text-primary);
177591
+ color: #f5f5f7;
177421
177592
  font-weight: 600;
177422
177593
  white-space: pre-wrap;
177423
177594
  overflow-wrap: anywhere;
@@ -177432,7 +177603,7 @@ __publicField(_DeesHarnessToolCard, "styles", [
177432
177603
  margin: 0;
177433
177604
  padding: var(--dees-spacing-xs) var(--dees-spacing-md) var(--dees-spacing-sm);
177434
177605
  max-height: 100%;
177435
- color: var(--dees-color-text-secondary);
177606
+ color: #c7c7cc;
177436
177607
  white-space: pre-wrap;
177437
177608
  overflow-wrap: anywhere;
177438
177609
  }
@@ -177446,7 +177617,7 @@ __publicField(_DeesHarnessToolCard, "styles", [
177446
177617
  align-items: center;
177447
177618
  gap: var(--dees-spacing-xs);
177448
177619
  padding: var(--dees-spacing-xs) var(--dees-spacing-md) var(--dees-spacing-sm);
177449
- color: var(--dees-color-text-muted);
177620
+ color: #8e8e93;
177450
177621
  }
177451
177622
 
177452
177623
  .harness-terminal-running .cursor {
@@ -178970,11 +179141,12 @@ var _DeesHarnessMessageList = class _DeesHarnessMessageList extends (_a86 = Dees
178970
179141
  this.lastObservedScrollTop = top;
178971
179142
  }, "handleScroll"));
178972
179143
  }
178973
- /** messages and permissions merged chronologically (stable ids as keys) */
179144
+ /** Messages and requests merged chronologically (stable ids as keys). */
178974
179145
  get timelineItems() {
178975
- const items = this.messages.map((message2) => ({
179146
+ const items = this.messages.map((message2, insertionIndex) => ({
178976
179147
  kind: "message",
178977
179148
  time: message2.createdAt || 0,
179149
+ insertionIndex,
178978
179150
  key: `message:${message2.id}`,
178979
179151
  message: message2,
178980
179152
  toolLayout: message2.toolCall ? this.toolRegistry.resolveLayout(message2.toolCall) : null
@@ -178985,6 +179157,7 @@ var _DeesHarnessMessageList = class _DeesHarnessMessageList extends (_a86 = Dees
178985
179157
  // pending requests pin to the end (action required); answered ones
178986
179158
  // freeze at their response time in the flow
178987
179159
  time: request.response ? request.respondedAt ?? request.createdAt ?? 0 : Number.MAX_SAFE_INTEGER,
179160
+ insertionIndex: items.length,
178988
179161
  key: `permission:${request.id}`,
178989
179162
  request
178990
179163
  });
@@ -178993,11 +179166,23 @@ var _DeesHarnessMessageList = class _DeesHarnessMessageList extends (_a86 = Dees
178993
179166
  items.push({
178994
179167
  kind: "question",
178995
179168
  time: question.response ? question.respondedAt ?? question.createdAt ?? 0 : Number.MAX_SAFE_INTEGER,
179169
+ insertionIndex: items.length,
178996
179170
  key: `question:${question.id}`,
178997
179171
  question
178998
179172
  });
178999
179173
  }
179000
- return items.sort((left, right) => left.time - right.time);
179174
+ items.sort((left, right) => left.time - right.time || left.insertionIndex - right.insertionIndex);
179175
+ const orderedSlots = [];
179176
+ const orderedMessages = [];
179177
+ for (const [index3, item] of items.entries()) {
179178
+ if (item.kind === "message" && Number.isSafeInteger(item.message.order?.messageIndex) && Number(item.message.order?.messageIndex) >= 0 && Number.isSafeInteger(item.message.order?.partIndex) && Number(item.message.order?.partIndex) >= 0) {
179179
+ orderedSlots.push(index3);
179180
+ orderedMessages.push(item);
179181
+ }
179182
+ }
179183
+ orderedMessages.sort((left, right) => left.message.order.messageIndex - right.message.order.messageIndex || left.message.order.partIndex - right.message.order.partIndex || left.insertionIndex - right.insertionIndex);
179184
+ for (const [index3, slot] of orderedSlots.entries()) items[slot] = orderedMessages[index3];
179185
+ return items;
179001
179186
  }
179002
179187
  buildTimelineRenderItems() {
179003
179188
  const items = this.timelineItems;
@@ -205457,7 +205642,7 @@ init_group_runtime();
205457
205642
  // ts_web/00_commitinfo_data.ts
205458
205643
  var commitinfo = {
205459
205644
  name: "@design.estate/dees-catalog",
205460
- version: "6.3.0",
205645
+ version: "6.5.0",
205461
205646
  description: "A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript."
205462
205647
  };
205463
205648
 
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@design.estate/dees-catalog',
6
- version: '6.3.0',
6
+ version: '6.5.0',
7
7
  description: 'A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.'
8
8
  };
9
9
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHNfd2ViLzAwX2NvbW1pdGluZm9fZGF0YS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUNILE1BQU0sQ0FBQyxNQUFNLFVBQVUsR0FBRztJQUN4QixJQUFJLEVBQUUsNkJBQTZCO0lBQ25DLE9BQU8sRUFBRSxPQUFPO0lBQ2hCLFdBQVcsRUFBRSxzSkFBc0o7Q0FDcEssQ0FBQSJ9
@@ -6,6 +6,10 @@ declare global {
6
6
  'dees-dataview-codebox': DeesDataviewCodebox;
7
7
  }
8
8
  }
9
+ export type TDiffView = 'inline' | 'split';
10
+ export interface IDiffViewChangeDetail {
11
+ diffView: TDiffView;
12
+ }
9
13
  export declare class DeesDataviewCodebox extends DeesElement {
10
14
  static demo: () => TemplateResult<1>;
11
15
  static demoGroups: string[];
@@ -22,7 +26,9 @@ export declare class DeesDataviewCodebox extends DeesElement {
22
26
  accessor codeBefore: string;
23
27
  accessor unifiedDiff: string;
24
28
  /** '' = regular code view; 'inline' = unified rows; 'split' = side by side */
25
- accessor diffView: '' | 'inline' | 'split';
29
+ accessor diffView: '' | TDiffView;
30
+ /** Hide gutters when a diff source does not provide trustworthy positions. */
31
+ accessor showDiffLineNumbers: boolean;
26
32
  accessor highlightedCode: string;
27
33
  accessor copied: boolean;
28
34
  accessor expandedFolds: ReadonlySet<number>;
@@ -46,7 +52,8 @@ export declare class DeesDataviewCodebox extends DeesElement {
46
52
  private diffHighlightCache;
47
53
  /** Diff mode is active when a diff input or an explicit diffView is set. */
48
54
  get isDiffActive(): boolean;
49
- get effectiveDiffView(): 'inline' | 'split';
55
+ get effectiveDiffView(): TDiffView;
56
+ private setDiffView;
50
57
  willUpdate(changedProperties: Map<string, any>): void;
51
58
  private displayRowsWithFolds;
52
59
  updated(changedProperties: Map<string, any>): Promise<void>;