opencode-tps-meter 0.1.0 → 0.1.1
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 +33 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.mjs +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -41,31 +41,27 @@ A live tokens-per-second meter plugin for OpenCode. Track AI token throughput in
|
|
|
41
41
|
|
|
42
42
|
## Installation
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
### From NPM (Recommended)
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
The easiest way to install is from the NPM registry:
|
|
47
47
|
|
|
48
48
|
```bash
|
|
49
|
-
#
|
|
50
|
-
|
|
49
|
+
# Using bun
|
|
50
|
+
bun add opencode-tps-meter
|
|
51
51
|
|
|
52
|
-
#
|
|
53
|
-
|
|
54
|
-
bun run build
|
|
52
|
+
# Using npm
|
|
53
|
+
npm install opencode-tps-meter
|
|
55
54
|
|
|
56
|
-
#
|
|
57
|
-
|
|
55
|
+
# Using yarn
|
|
56
|
+
yarn add opencode-tps-meter
|
|
58
57
|
```
|
|
59
58
|
|
|
60
|
-
Then
|
|
61
|
-
|
|
62
|
-
```bash
|
|
63
|
-
# Link the plugin locally
|
|
64
|
-
bun link opencode-tps-meter
|
|
65
|
-
```
|
|
59
|
+
Then add to your OpenCode configuration (see [Quick Start](#quick-start) below).
|
|
66
60
|
|
|
67
61
|
### From Git Repository
|
|
68
62
|
|
|
63
|
+
If you prefer to install directly from GitHub:
|
|
64
|
+
|
|
69
65
|
```bash
|
|
70
66
|
# Install directly from git
|
|
71
67
|
bun add github:ChiR24/opencode-tps-meter
|
|
@@ -74,9 +70,29 @@ bun add github:ChiR24/opencode-tps-meter
|
|
|
74
70
|
npm install github:ChiR24/opencode-tps-meter
|
|
75
71
|
```
|
|
76
72
|
|
|
77
|
-
###
|
|
73
|
+
### From Local Directory (Development)
|
|
74
|
+
|
|
75
|
+
For local development or testing:
|
|
78
76
|
|
|
79
|
-
|
|
77
|
+
```bash
|
|
78
|
+
# Clone the repository
|
|
79
|
+
git clone https://github.com/ChiR24/opencode-tps-meter.git
|
|
80
|
+
cd opencode-tps-meter
|
|
81
|
+
|
|
82
|
+
# Install dependencies and build
|
|
83
|
+
bun install
|
|
84
|
+
bun run build
|
|
85
|
+
|
|
86
|
+
# Link for local development
|
|
87
|
+
bun link
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Then in your OpenCode project:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# Link the plugin locally
|
|
94
|
+
bun link opencode-tps-meter
|
|
95
|
+
```
|
|
80
96
|
|
|
81
97
|
---
|
|
82
98
|
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EAKf,MAAM,YAAY,CAAC;AAoHpB;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CACpC,OAAO,EAAE,aAAa,GACrB,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EAKf,MAAM,YAAY,CAAC;AAoHpB;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CACpC,OAAO,EAAE,aAAa,GACrB,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAkWxC;AAGD,YAAY,EACV,WAAW,EACX,iBAAiB,EACjB,UAAU,EACV,SAAS,EACT,YAAY,EACZ,MAAM,EACN,cAAc,EACd,YAAY,EACZ,aAAa,EACb,MAAM,EACN,YAAY,EACZ,cAAc,GACf,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -620,6 +620,10 @@ function TpsMeterPlugin(context) {
|
|
|
620
620
|
logger.warn("[TpsMeter] Failed to load config, using defaults:", error instanceof Error ? error.message : String(error));
|
|
621
621
|
config = defaultConfig;
|
|
622
622
|
}
|
|
623
|
+
if (!config) {
|
|
624
|
+
logger.warn("[TpsMeter] Config is undefined, using defaults");
|
|
625
|
+
config = defaultConfig;
|
|
626
|
+
}
|
|
623
627
|
if (!config.enabled) {
|
|
624
628
|
logger.debug("[TpsMeter] Plugin disabled by configuration");
|
|
625
629
|
return {};
|
package/dist/index.mjs
CHANGED
|
@@ -571,6 +571,10 @@ function TpsMeterPlugin(context) {
|
|
|
571
571
|
logger.warn("[TpsMeter] Failed to load config, using defaults:", error instanceof Error ? error.message : String(error));
|
|
572
572
|
config = defaultConfig;
|
|
573
573
|
}
|
|
574
|
+
if (!config) {
|
|
575
|
+
logger.warn("[TpsMeter] Config is undefined, using defaults");
|
|
576
|
+
config = defaultConfig;
|
|
577
|
+
}
|
|
574
578
|
if (!config.enabled) {
|
|
575
579
|
logger.debug("[TpsMeter] Plugin disabled by configuration");
|
|
576
580
|
return {};
|