opencode-deepseek-peak 0.1.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.
- package/LICENSE +21 -0
- package/README.md +79 -0
- package/dist/index.js +47817 -0
- package/dist/index.js.map +7 -0
- package/dist/rpc.js +77 -0
- package/dist/rpc.js.map +7 -0
- package/dist/tui.js +760 -0
- package/dist/tui.js.map +7 -0
- package/index.js +1 -0
- package/install.mjs +63 -0
- package/package.json +70 -0
- package/src/api-signal.ts +32 -0
- package/src/core/display.ts +59 -0
- package/src/i18n.ts +248 -0
- package/src/index.ts +131 -0
- package/src/panel/FooterStatus.tsx +32 -0
- package/src/panel/PeakPanel.tsx +59 -0
- package/src/rpc.ts +74 -0
- package/src/schedule.ts +66 -0
- package/src/tui.tsx +112 -0
- package/src/types.ts +29 -0
- package/src/v2/commands.ts +83 -0
- package/src/v2/settings-menu.ts +110 -0
- package/tui/index.js +6 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 aiev
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# OpenCode DeepSeek Peak
|
|
2
|
+
|
|
3
|
+
OpenCode V2 plugin that reports whether a DeepSeek request is in the official
|
|
4
|
+
peak or off-peak pricing period.
|
|
5
|
+
|
|
6
|
+
The current official schedule is peak from **01:00–04:00 UTC** and
|
|
7
|
+
**06:00–10:00 UTC**, Monday through Friday, excluding Chinese public holidays.
|
|
8
|
+
All other times are off-peak.
|
|
9
|
+
|
|
10
|
+
The plugin also watches API response headers. The official DeepSeek API does
|
|
11
|
+
not currently document a peak/off-peak response header, so the schedule remains
|
|
12
|
+
the source unless DeepSeek or a local proxy returns one of:
|
|
13
|
+
|
|
14
|
+
- `x-deepseek-pricing-tier: peak|off-peak`
|
|
15
|
+
- `x-deepseek-price-period: peak|off-peak`
|
|
16
|
+
- `x-deepseek-peak: true|false`
|
|
17
|
+
- `x-pricing-tier: peak|off-peak`
|
|
18
|
+
|
|
19
|
+
When such a header exists, it becomes the source of truth and the indicator
|
|
20
|
+
marks disagreements with `⚠`.
|
|
21
|
+
|
|
22
|
+
## Commands
|
|
23
|
+
|
|
24
|
+
- `/deepseek-peak` — show the last observed status and evidence.
|
|
25
|
+
- `/deepseek-peak-sections` — toggle toast, footer indicator, sidebar indicator,
|
|
26
|
+
sidebar evidence, and toast frequency.
|
|
27
|
+
- `/deepseek-peak-lang` — switch the display language.
|
|
28
|
+
|
|
29
|
+
## Language
|
|
30
|
+
|
|
31
|
+
The interface follows the environment language (`LANG`/`LC_ALL`) and defaults
|
|
32
|
+
to English. English, Portuguese, Simplified Chinese, Japanese, and Korean are
|
|
33
|
+
available; change it from `/deepseek-peak-lang` or the sections menu. Chinese
|
|
34
|
+
public holidays are localized too (for example `中秋节` in Chinese and
|
|
35
|
+
`Mid-Autumn Festival` in English).
|
|
36
|
+
|
|
37
|
+
## Installation
|
|
38
|
+
|
|
39
|
+
Once published to npm:
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
npm install -g opencode-deepseek-peak
|
|
43
|
+
opencode-deepseek-peak
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
The installer adds the package to the OpenCode server and CLI configurations,
|
|
47
|
+
preserving existing settings. Restart OpenCode after installation.
|
|
48
|
+
|
|
49
|
+
For manual configuration, add the package to both plugin lists:
|
|
50
|
+
|
|
51
|
+
```jsonc
|
|
52
|
+
{
|
|
53
|
+
"plugins": ["opencode-deepseek-peak"]
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Optional server settings:
|
|
58
|
+
|
|
59
|
+
```jsonc
|
|
60
|
+
{
|
|
61
|
+
"plugins": [{
|
|
62
|
+
"package": "opencode-deepseek-peak",
|
|
63
|
+
"options": {
|
|
64
|
+
"providerIDs": ["deepseek"],
|
|
65
|
+
"apiSignalHeaders": ["x-deepseek-pricing-tier"],
|
|
66
|
+
"apiSignalTtlMs": 300000
|
|
67
|
+
}
|
|
68
|
+
}]
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Development
|
|
73
|
+
|
|
74
|
+
```sh
|
|
75
|
+
npm install
|
|
76
|
+
npm run typecheck
|
|
77
|
+
npm test
|
|
78
|
+
npm run build
|
|
79
|
+
```
|