pi-deepseek-tariff 0.3.0 → 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 CHANGED
@@ -3,6 +3,7 @@
3
3
  [![npm](https://img.shields.io/npm/v/pi-deepseek-tariff?color=blue)](https://www.npmjs.com/package/pi-deepseek-tariff)
4
4
  [![license](https://img.shields.io/badge/license-MIT-green)](LICENSE)
5
5
  [![pi-package](https://img.shields.io/badge/pi-package-8a2be2)](https://pi.dev/packages)
6
+ [![changelog](https://img.shields.io/badge/changelog-Keep%20a%20Changelog-orange)](CHANGELOG.md)
6
7
 
7
8
  A [pi](https://pi.dev) extension that shows the current **DeepSeek API tariff window** — peak or off-peak — with a countdown, and a panel with live prices parsed from the official DeepSeek pricing page.
8
9
 
@@ -61,6 +62,8 @@ Then run `/dsp`. Afterwards `pi list`, `pi update --extensions`, `pi remove …`
61
62
  | `/dsp en` / `ru` | switch the panel language (persisted) |
62
63
  | `/dsp footer on` / `off` (or `/dsp footeron` / `footeroff`) | show or hide the footer line (persisted) |
63
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
+
64
67
  ## What it does
65
68
 
66
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.
@@ -132,12 +135,12 @@ Git tags and npm versions are kept in lockstep: the tag `vX.Y.Z` always points a
132
135
  the commit whose `package.json` says `X.Y.Z`, and npm publishes that same version.
133
136
 
134
137
  ```bash
135
- # 1. bump package.json + README, commit
136
- npm version 0.3.1 --no-git-tag-version # or edit by hand
137
- git commit -am "chore: release 0.3.1"
138
+ # 1. bump package.json, add a CHANGELOG entry, commit
139
+ npm version 0.3.2 --no-git-tag-version # or edit by hand
140
+ git commit -am "chore: release 0.3.2"
138
141
 
139
142
  # 2. tag the release commit and push
140
- git tag -a v0.3.1 -m v0.3.1
143
+ git tag -a v0.3.2 -m v0.3.2
141
144
  git push origin main --tags
142
145
 
143
146
  # 3. publish the tag to npm (2FA prompt, or --otp=123456)
@@ -148,7 +151,7 @@ npm publish --access public
148
151
  Check the result:
149
152
 
150
153
  ```bash
151
- npm view pi-deepseek-tariff dist-tags # { latest: '0.3.1' }
154
+ npm view pi-deepseek-tariff dist-tags # { latest: '0.3.2' }
152
155
  npm view pi-deepseek-tariff versions
153
156
  ```
154
157
 
@@ -156,9 +159,14 @@ npm view pi-deepseek-tariff versions
156
159
  `NPM_TOKEN` secret is configured; with trusted publishing enabled on npmjs.com the
157
160
  token is not needed at all and the build is signed with provenance.
158
161
 
159
- Tags are pinnable with `pi install git:…@v0.3.1`. Published versions show up in the
162
+ Tags are pinnable with `pi install git:…@v0.3.2`. Published versions show up in the
160
163
  [pi package gallery](https://pi.dev/packages) through the `pi-package` keyword.
161
164
 
165
+ ## Changelog
166
+
167
+ See [CHANGELOG.md](CHANGELOG.md). Git tags and npm versions are kept in lockstep, so
168
+ `vX.Y.Z` always matches the published `X.Y.Z`.
169
+
162
170
  ## License
163
171
 
164
172
  MIT
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-deepseek-tariff",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "DeepSeek peak/off-peak tariff panel for pi: local clock, next window, live per-model prices and Search & Fetch rates",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -30,7 +30,8 @@
30
30
  "pi": {
31
31
  "extensions": [
32
32
  "./extensions/deepseek-peak.ts"
33
- ]
33
+ ],
34
+ "image": "https://raw.githubusercontent.com/valderan/pi-deepseek-tariff/main/assets/banner.png"
34
35
  },
35
36
  "peerDependencies": {
36
37
  "@earendil-works/pi-coding-agent": "*",