pi-deepseek-tariff 0.3.1 → 0.3.2
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/README.md +2 -0
- package/extensions/deepseek-peak.ts +27 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -62,6 +62,8 @@ Then run `/dsp`. Afterwards `pi list`, `pi update --extensions`, `pi remove …`
|
|
|
62
62
|
| `/dsp en` / `ru` | switch the panel language (persisted) |
|
|
63
63
|
| `/dsp footer on` / `off` (or `/dsp footeron` / `footeroff`) | show or hide the footer line (persisted) |
|
|
64
64
|
|
|
65
|
+
Type `/dsp ` and press Tab: the arguments above are offered as completions, with a short description each (`/dsp footer <Tab>` completes `on` and `off`).
|
|
66
|
+
|
|
65
67
|
## What it does
|
|
66
68
|
|
|
67
69
|
- **Footer line** — one compact status line: `● DeepSeek Off-peak for 11h 59m`, or `● DeepSeek Peak for 1h 40m` during peak. The text is always yellow and only the dot changes colour — green for off-peak, red for peak. Shown only while a DeepSeek model is active; `/dsp footer off` hides it for good.
|
|
@@ -166,11 +166,37 @@ export default function deepseekPeak(pi: ExtensionAPI) {
|
|
|
166
166
|
render(ctx);
|
|
167
167
|
};
|
|
168
168
|
|
|
169
|
+
// Tab completion for the documented arguments, so `/dsp <TAB>` lists what the
|
|
170
|
+
// handler actually accepts instead of leaving them buried in the README.
|
|
171
|
+
const ARGUMENTS = [
|
|
172
|
+
{ value: "on", label: "on", description: "Show the panel · Показать панель" },
|
|
173
|
+
{ value: "off", label: "off", description: "Hide the panel · Скрыть панель" },
|
|
174
|
+
{ value: "refresh", label: "refresh", description: "Re-parse prices now · Обновить цены сейчас" },
|
|
175
|
+
{ value: "en", label: "en", description: "Panel language: English · Язык панели: английский" },
|
|
176
|
+
{ value: "ru", label: "ru", description: "Panel language: Russian · Язык панели: русский" },
|
|
177
|
+
{ value: "footer", label: "footer", description: "Footer line: on|off · Строка футера: on|off" },
|
|
178
|
+
];
|
|
179
|
+
const FOOTER_ARGUMENTS = ARGUMENTS.filter((item) => item.value === "on" || item.value === "off");
|
|
180
|
+
|
|
181
|
+
const getArgumentCompletions = (prefix: string) => {
|
|
182
|
+
const words = prefix.trimStart().split(/\s+/);
|
|
183
|
+
if (words.length > 2) return null;
|
|
184
|
+
const [head, tail] = words;
|
|
185
|
+
if (head === undefined || head === "") return ARGUMENTS;
|
|
186
|
+
if (tail === undefined) {
|
|
187
|
+
const matches = ARGUMENTS.filter((item) => item.value.startsWith(head.toLowerCase()));
|
|
188
|
+
return matches.length > 0 ? matches : null;
|
|
189
|
+
}
|
|
190
|
+
if (head.toLowerCase() !== "footer") return null;
|
|
191
|
+
const matches = FOOTER_ARGUMENTS.filter((item) => item.value.startsWith(tail.toLowerCase()));
|
|
192
|
+
return matches.length > 0 ? matches : null;
|
|
193
|
+
};
|
|
194
|
+
|
|
169
195
|
const description = "DeepSeek peak/off-peak panel · Панель DeepSeek peak/off-peak";
|
|
170
196
|
// `/dsp` is the short form; `deepseek-peek` accepts the spelling people reach
|
|
171
197
|
// for when they type "peak" wrong, so the command still resolves.
|
|
172
198
|
for (const name of ["deepseek-peak", "dsp", "deepseek-peek"]) {
|
|
173
|
-
pi.registerCommand(name, { description, handler: commandHandler });
|
|
199
|
+
pi.registerCommand(name, { description, handler: commandHandler, getArgumentCompletions });
|
|
174
200
|
}
|
|
175
201
|
}
|
|
176
202
|
|
package/package.json
CHANGED