@crazyhappyone/dsh-tui 0.1.0-alpha.12 → 0.1.0-alpha.13
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/dist/index.js +19 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -80507,8 +80507,8 @@ var SEARCH_DEBOUNCE_MS = 120;
|
|
|
80507
80507
|
var LOCAL_COMMANDS = [
|
|
80508
80508
|
{ name: "export", description: "Export this session to a Markdown file" },
|
|
80509
80509
|
{ 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" },
|
|
80510
|
+
{ name: "key", description: "Set or update API key", input: { hint: "[KEY_NAME] <SECRET>" } },
|
|
80511
|
+
{ name: "login", description: "Set or update API key", input: { hint: "[KEY_NAME] <SECRET>" } },
|
|
80512
80512
|
{ name: "model", description: "Switch the active model" },
|
|
80513
80513
|
{ name: "reload", description: "Relaunch this process and resume the session" },
|
|
80514
80514
|
{ name: "resume", description: "Switch or resume a session" },
|
|
@@ -83515,9 +83515,19 @@ var RuntimeController = class _RuntimeController {
|
|
|
83515
83515
|
return;
|
|
83516
83516
|
}
|
|
83517
83517
|
if (query.startsWith("key ") || query.startsWith("login ")) {
|
|
83518
|
-
const
|
|
83519
|
-
if (
|
|
83520
|
-
|
|
83518
|
+
const rest = query.replace(/^(?:key|login)\s+/, "").trim();
|
|
83519
|
+
if (rest.length > 0) {
|
|
83520
|
+
const parts = rest.split(/\s+/);
|
|
83521
|
+
const first = parts[0];
|
|
83522
|
+
if (first !== void 0 && parts.length >= 2 && isCredentialRefName(first)) {
|
|
83523
|
+
const secret = rest.slice(first.length).trim();
|
|
83524
|
+
this.applyOnboardingKey(first, secret);
|
|
83525
|
+
} else if (first !== void 0 && parts.length === 1 && isCredentialRefName(first) && !first.startsWith("sk-")) {
|
|
83526
|
+
if (this.blockingHead() !== void 0) return;
|
|
83527
|
+
this.openApiKeyPane(first);
|
|
83528
|
+
} else {
|
|
83529
|
+
this.applyOnboardingKey(ONBOARDING_KEY, rest);
|
|
83530
|
+
}
|
|
83521
83531
|
return;
|
|
83522
83532
|
}
|
|
83523
83533
|
}
|
|
@@ -83802,7 +83812,7 @@ var RuntimeController = class _RuntimeController {
|
|
|
83802
83812
|
this.settingsOpen = false;
|
|
83803
83813
|
this.settingsEditing = false;
|
|
83804
83814
|
this.settingsUpdateError = void 0;
|
|
83805
|
-
this.setFeedback("\u2713 \u5DF2\u4FDD\u5B58 API key");
|
|
83815
|
+
this.setFeedback(field === ONBOARDING_KEY ? "\u2713 \u5DF2\u4FDD\u5B58 API key" : `\u2713 \u5DF2\u4FDD\u5B58 ${field}`);
|
|
83806
83816
|
this.openModelPane();
|
|
83807
83817
|
} catch (error51) {
|
|
83808
83818
|
if (this.closed) return;
|
|
@@ -83868,15 +83878,16 @@ var RuntimeController = class _RuntimeController {
|
|
|
83868
83878
|
}
|
|
83869
83879
|
/**
|
|
83870
83880
|
* Open the API-key configuration overlay directly from /key or /login.
|
|
83881
|
+
* @param targetField - credential reference name (defaults to DEEPSEEK_API_KEY).
|
|
83871
83882
|
*/
|
|
83872
|
-
openApiKeyPane() {
|
|
83883
|
+
openApiKeyPane(targetField = ONBOARDING_KEY) {
|
|
83873
83884
|
this.closeOtherPanels();
|
|
83874
83885
|
this.settingsOnboarding = true;
|
|
83875
83886
|
this.settingsEditing = true;
|
|
83876
83887
|
this.settingsUpdateError = void 0;
|
|
83877
83888
|
this.settingsRows = [{
|
|
83878
83889
|
namespace: "credentials",
|
|
83879
|
-
field:
|
|
83890
|
+
field: targetField,
|
|
83880
83891
|
value: ""
|
|
83881
83892
|
}];
|
|
83882
83893
|
this.settingsSelectedIndex = 0;
|