@crazyhappyone/dsh-tui 0.1.0-alpha.12 → 0.1.0-alpha.14

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 (2) hide show
  1. package/dist/index.js +25 -11
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -71655,14 +71655,17 @@ function transcriptOverlay(tier, synchronizedFrameEnded) {
71655
71655
  }
71656
71656
  return cells === "" ? "" : `\x1B7${cells}\x1B8`;
71657
71657
  }
71658
+ const railCol = next.geometry.rail?.col ?? next.geometry.columns;
71659
+ const guardCol = railCol > 1 ? railCol - 1 : railCol;
71658
71660
  for (const change of diff2.changes) {
71659
71661
  const nextWidth = change.line === void 0 ? 0 : change.line.backgroundColumns ?? change.line.displayWidth;
71660
- const staleColumns = change.clearColumns - nextWidth;
71662
+ const targetColumns = Math.max(change.clearColumns, guardCol - change.col);
71663
+ const padColumns = targetColumns - nextWidth;
71661
71664
  if (change.line !== void 0) {
71662
71665
  cells += `\x1B[${String(change.row)};${String(change.col)}H` + paintPhysicalLine(change.line, tier);
71663
71666
  }
71664
- if (staleColumns > 0) {
71665
- cells += `\x1B[${String(change.row)};${String(change.col + nextWidth)}H` + styled(" ".repeat(staleColumns), "bg", tier);
71667
+ if (padColumns > 0) {
71668
+ cells += `\x1B[${String(change.row)};${String(change.col + nextWidth)}H` + styled(" ".repeat(padColumns), "bg", tier);
71666
71669
  }
71667
71670
  }
71668
71671
  return cells === "" ? "" : `\x1B7${cells}\x1B8`;
@@ -80507,8 +80510,8 @@ var SEARCH_DEBOUNCE_MS = 120;
80507
80510
  var LOCAL_COMMANDS = [
80508
80511
  { name: "export", description: "Export this session to a Markdown file" },
80509
80512
  { name: "help", description: "Show command help and key bindings" },
80510
- { name: "key", description: "Set or update API key" },
80511
- { name: "login", description: "Set or update API key" },
80513
+ { name: "key", description: "Set or update API key", input: { hint: "[KEY_NAME] <SECRET>" } },
80514
+ { name: "login", description: "Set or update API key", input: { hint: "[KEY_NAME] <SECRET>" } },
80512
80515
  { name: "model", description: "Switch the active model" },
80513
80516
  { name: "reload", description: "Relaunch this process and resume the session" },
80514
80517
  { name: "resume", description: "Switch or resume a session" },
@@ -83515,9 +83518,19 @@ var RuntimeController = class _RuntimeController {
83515
83518
  return;
83516
83519
  }
83517
83520
  if (query.startsWith("key ") || query.startsWith("login ")) {
83518
- const token = query.replace(/^(?:key|login)\s+/, "").trim();
83519
- if (token.length > 0) {
83520
- this.applyOnboardingKey(ONBOARDING_KEY, token);
83521
+ const rest = query.replace(/^(?:key|login)\s+/, "").trim();
83522
+ if (rest.length > 0) {
83523
+ const parts = rest.split(/\s+/);
83524
+ const first = parts[0];
83525
+ if (first !== void 0 && parts.length >= 2 && isCredentialRefName(first)) {
83526
+ const secret = rest.slice(first.length).trim();
83527
+ this.applyOnboardingKey(first, secret);
83528
+ } else if (first !== void 0 && parts.length === 1 && isCredentialRefName(first) && !first.startsWith("sk-")) {
83529
+ if (this.blockingHead() !== void 0) return;
83530
+ this.openApiKeyPane(first);
83531
+ } else {
83532
+ this.applyOnboardingKey(ONBOARDING_KEY, rest);
83533
+ }
83521
83534
  return;
83522
83535
  }
83523
83536
  }
@@ -83802,7 +83815,7 @@ var RuntimeController = class _RuntimeController {
83802
83815
  this.settingsOpen = false;
83803
83816
  this.settingsEditing = false;
83804
83817
  this.settingsUpdateError = void 0;
83805
- this.setFeedback("\u2713 \u5DF2\u4FDD\u5B58 API key");
83818
+ this.setFeedback(field === ONBOARDING_KEY ? "\u2713 \u5DF2\u4FDD\u5B58 API key" : `\u2713 \u5DF2\u4FDD\u5B58 ${field}`);
83806
83819
  this.openModelPane();
83807
83820
  } catch (error51) {
83808
83821
  if (this.closed) return;
@@ -83868,15 +83881,16 @@ var RuntimeController = class _RuntimeController {
83868
83881
  }
83869
83882
  /**
83870
83883
  * Open the API-key configuration overlay directly from /key or /login.
83884
+ * @param targetField - credential reference name (defaults to DEEPSEEK_API_KEY).
83871
83885
  */
83872
- openApiKeyPane() {
83886
+ openApiKeyPane(targetField = ONBOARDING_KEY) {
83873
83887
  this.closeOtherPanels();
83874
83888
  this.settingsOnboarding = true;
83875
83889
  this.settingsEditing = true;
83876
83890
  this.settingsUpdateError = void 0;
83877
83891
  this.settingsRows = [{
83878
83892
  namespace: "credentials",
83879
- field: ONBOARDING_KEY,
83893
+ field: targetField,
83880
83894
  value: ""
83881
83895
  }];
83882
83896
  this.settingsSelectedIndex = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crazyhappyone/dsh-tui",
3
- "version": "0.1.0-alpha.12",
3
+ "version": "0.1.0-alpha.14",
4
4
  "description": "Source-runtime launcher for the DeepSeek Harness terminal interface",
5
5
  "type": "module",
6
6
  "license": "MIT",