@icaruk/zai-peak-hours 0.0.1 → 0.0.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.
Files changed (2) hide show
  1. package/README.md +20 -58
  2. package/package.json +1 -2
package/README.md CHANGED
@@ -2,24 +2,17 @@
2
2
 
3
3
  OpenCode TUI plugin that displays z.ai peak hours information with automatic timezone detection via toast notifications.
4
4
 
5
- ## Quick Start
5
+ ## Installation
6
6
 
7
- Add this to your `~/.config/opencode/tui.json`:
7
+ Add to your `~/.config/opencode/tui.json`:
8
8
 
9
- **After npm publication:**
10
- ```jsonc
9
+ ```json
11
10
  {
11
+ "$schema": "https://opencode.ai/tui.json",
12
12
  "plugin": ["@icaruk/zai-peak-hours"]
13
13
  }
14
14
  ```
15
15
 
16
- **Local development (before npm publication):**
17
- ```jsonc
18
- {
19
- "plugin": ["file://D:/Dev/zai-peak-hours/dist/index.js"]
20
- }
21
- ```
22
-
23
16
  ## Features
24
17
 
25
18
  - 🌍 Automatic timezone detection (UTC+8 / Asia/Shanghai)
@@ -29,51 +22,14 @@ Add this to your `~/.config/opencode/tui.json`:
29
22
  - ⚙️ Configurable update interval
30
23
  - 🛠️ Manual commands for on-demand status checks
31
24
 
32
- ## TUI vs Regular Plugins
33
-
34
- This is a **TUI plugin** (runs in the OpenCode client/terminal UI), not a regular server-side plugin.
35
-
36
- | | TUI Plugin (this) | Regular Plugin |
37
- | ------------- | ------------------------ | -------------------------- |
38
- | **Config** | `tui.json` | `opencode.jsonc` |
39
- | **Dónde corre** | Client/TUI | Server/backend |
40
- | **Acceso UI** | Sí (toasts, comandos) | No |
41
- | **Custom tools** | No | Sí |
42
- | **Hook en tools** | No | Sí |
43
-
44
- TUI plugins can display toasts, register slash commands, and show UI elements directly in the terminal.
45
-
46
25
  ## Commands
47
26
 
48
27
  - `/peak_hours` - Display current peak hours status
49
28
  - `/peak_hours_status` - Display plugin diagnostics and configuration
50
29
 
51
- ## Configuration
52
-
53
- Configuration is optional - the plugin works out of the box.
54
-
55
- To customize, create `~/.config/opencode/peak-hours.json`:
56
-
57
- ```json
58
- {
59
- "enabled": true,
60
- "updateIntervalMinutes": 15
61
- }
62
- ```
63
-
64
- ### Options
65
-
66
- - `enabled` (boolean, default: `true`) - Enable or disable the plugin
67
- - `updateIntervalMinutes` (number, default: `15`) - Update interval in minutes
68
-
69
- ## Peak Hours Schedule
70
-
71
- - **Peak Hours**: 14:00-18:00 UTC+8 (Asia/Shanghai timezone)
72
- - **Off-Peak Hours**: All other times
73
-
74
30
  ## Messages
75
31
 
76
- The plugin displays toast notifications in the following format:
32
+ The plugin displays toast notifications:
77
33
 
78
34
  **Peak Hours:**
79
35
  ```
@@ -87,30 +43,36 @@ Currently in off-peak hours. X hours Y minutes remaining
87
43
 
88
44
  ## Development
89
45
 
90
- For local development and testing:
91
-
92
46
  ```bash
93
- # Clone the repository
47
+ # Clone
94
48
  git clone https://github.com/Icaruk/zai-peak-hours.git
95
49
  cd zai-peak-hours
96
50
 
97
- # Install dependencies
51
+ # Install
98
52
  npm install
99
53
 
100
- # Build the plugin
54
+ # Build
101
55
  npm run build
102
56
 
103
- # Run in watch mode for development
57
+ # Watch
104
58
  npm run dev
105
59
  ```
106
60
 
107
- Then use the local development path in `tui.json`:
108
- ```jsonc
61
+ Add local config in `tui.json`
62
+
63
+ ```json
109
64
  {
110
- "plugin": ["file://D:/Dev/zai-peak-hours/dist/index.js"]
65
+ "$schema": "https://opencode.ai/tui.json",
66
+ "plugin": [
67
+ "D:/Dev/zai-peak-hours/dist/index.js"
68
+ ]
111
69
  }
112
70
  ```
113
71
 
72
+ ## npm package
73
+
74
+ https://www.npmjs.com/package/@icaruk/zai-peak-hours
75
+
114
76
  ## License
115
77
 
116
78
  MIT
package/package.json CHANGED
@@ -1,11 +1,10 @@
1
1
  {
2
2
  "name": "@icaruk/zai-peak-hours",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "type": "module",
5
5
  "description": "OpenCode plugin to display z.ai peak hours information with automatic timezone detection",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
- "tui": "dist/index.js",
9
8
  "exports": {
10
9
  ".": {
11
10
  "import": "./dist/index.js",