@leo000001/opencode-quota-sidebar 1.0.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/CHANGELOG.md +70 -0
- package/CONTRIBUTING.md +102 -0
- package/LICENSE +21 -0
- package/README.md +216 -0
- package/SECURITY.md +26 -0
- package/dist/cache.d.ts +6 -0
- package/dist/cache.js +22 -0
- package/dist/cost.d.ts +13 -0
- package/dist/cost.js +76 -0
- package/dist/format.d.ts +21 -0
- package/dist/format.js +426 -0
- package/dist/helpers.d.ts +14 -0
- package/dist/helpers.js +50 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +699 -0
- package/dist/period.d.ts +1 -0
- package/dist/period.js +14 -0
- package/dist/providers/common.d.ts +24 -0
- package/dist/providers/common.js +114 -0
- package/dist/providers/core/anthropic.d.ts +2 -0
- package/dist/providers/core/anthropic.js +46 -0
- package/dist/providers/core/copilot.d.ts +2 -0
- package/dist/providers/core/copilot.js +117 -0
- package/dist/providers/core/openai.d.ts +2 -0
- package/dist/providers/core/openai.js +159 -0
- package/dist/providers/index.d.ts +8 -0
- package/dist/providers/index.js +14 -0
- package/dist/providers/registry.d.ts +9 -0
- package/dist/providers/registry.js +38 -0
- package/dist/providers/third_party/rightcode.d.ts +2 -0
- package/dist/providers/third_party/rightcode.js +230 -0
- package/dist/providers/types.d.ts +58 -0
- package/dist/providers/types.js +1 -0
- package/dist/quota.d.ts +49 -0
- package/dist/quota.js +116 -0
- package/dist/quota_render.d.ts +5 -0
- package/dist/quota_render.js +85 -0
- package/dist/storage.d.ts +32 -0
- package/dist/storage.js +328 -0
- package/dist/storage_chunks.d.ts +9 -0
- package/dist/storage_chunks.js +147 -0
- package/dist/storage_dates.d.ts +9 -0
- package/dist/storage_dates.js +88 -0
- package/dist/storage_parse.d.ts +4 -0
- package/dist/storage_parse.js +149 -0
- package/dist/storage_paths.d.ts +14 -0
- package/dist/storage_paths.js +31 -0
- package/dist/title.d.ts +8 -0
- package/dist/title.js +38 -0
- package/dist/types.d.ts +116 -0
- package/dist/types.js +1 -0
- package/dist/usage.d.ts +51 -0
- package/dist/usage.js +243 -0
- package/package.json +68 -0
- package/quota-sidebar.config.example.json +25 -0
package/package.json
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@leo000001/opencode-quota-sidebar",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "OpenCode plugin that shows quota and token usage in session titles",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist/*.js",
|
|
16
|
+
"dist/*.d.ts",
|
|
17
|
+
"dist/providers/**/*.js",
|
|
18
|
+
"dist/providers/**/*.d.ts",
|
|
19
|
+
"LICENSE",
|
|
20
|
+
"CHANGELOG.md",
|
|
21
|
+
"CONTRIBUTING.md",
|
|
22
|
+
"SECURITY.md",
|
|
23
|
+
"README.md",
|
|
24
|
+
"quota-sidebar.config.example.json"
|
|
25
|
+
],
|
|
26
|
+
"scripts": {
|
|
27
|
+
"clean": "node -e \"const fs=require('fs'); fs.rmSync('dist',{recursive:true,force:true}); fs.rmSync('tsconfig.tsbuildinfo',{force:true});\"",
|
|
28
|
+
"build": "npm run clean && tsc -p tsconfig.json",
|
|
29
|
+
"prepare": "npm run build",
|
|
30
|
+
"prepack": "npm run build",
|
|
31
|
+
"prepublishOnly": "npm run typecheck && npm run build && npm test",
|
|
32
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
33
|
+
"test": "node -e \"const fs=require('fs'); const path=require('path'); const {spawnSync}=require('child_process'); const dir=path.join('dist','__tests__'); const files=fs.existsSync(dir)?fs.readdirSync(dir).filter(f=>f.endsWith('.test.js')).map(f=>path.join(dir,f)):[]; if(files.length===0){ console.error('No test files found under dist/__tests__. Run: npm run build'); process.exit(1);} const res=spawnSync(process.execPath,['--test',...files],{stdio:'inherit'}); process.exit(typeof res.status==='number'?res.status:1);\""
|
|
34
|
+
},
|
|
35
|
+
"keywords": [
|
|
36
|
+
"opencode",
|
|
37
|
+
"plugin",
|
|
38
|
+
"quota",
|
|
39
|
+
"sidebar",
|
|
40
|
+
"token-usage"
|
|
41
|
+
],
|
|
42
|
+
"license": "MIT",
|
|
43
|
+
"repository": {
|
|
44
|
+
"type": "git",
|
|
45
|
+
"url": "https://github.com/xihuai18/opencode-quota-sidebar.git"
|
|
46
|
+
},
|
|
47
|
+
"homepage": "https://github.com/xihuai18/opencode-quota-sidebar#readme",
|
|
48
|
+
"bugs": {
|
|
49
|
+
"url": "https://github.com/xihuai18/opencode-quota-sidebar/issues"
|
|
50
|
+
},
|
|
51
|
+
"author": "xihuai18",
|
|
52
|
+
"publishConfig": {
|
|
53
|
+
"access": "public"
|
|
54
|
+
},
|
|
55
|
+
"engines": {
|
|
56
|
+
"node": ">=18"
|
|
57
|
+
},
|
|
58
|
+
"peerDependencies": {
|
|
59
|
+
"@opencode-ai/plugin": "^1.2.10",
|
|
60
|
+
"@opencode-ai/sdk": "^1.2.10"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@opencode-ai/plugin": "^1.2.10",
|
|
64
|
+
"@opencode-ai/sdk": "^1.2.10",
|
|
65
|
+
"@types/node": "^22.13.10",
|
|
66
|
+
"typescript": "^5.8.2"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"sidebar": {
|
|
3
|
+
"enabled": true,
|
|
4
|
+
"width": 36,
|
|
5
|
+
"showCost": true,
|
|
6
|
+
"showQuota": true
|
|
7
|
+
},
|
|
8
|
+
"quota": {
|
|
9
|
+
"refreshMs": 300000,
|
|
10
|
+
"includeOpenAI": true,
|
|
11
|
+
"includeCopilot": true,
|
|
12
|
+
"includeAnthropic": true,
|
|
13
|
+
"providers": {
|
|
14
|
+
"rightcode": {
|
|
15
|
+
"enabled": true
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"refreshAccessToken": false,
|
|
19
|
+
"requestTimeoutMs": 8000
|
|
20
|
+
},
|
|
21
|
+
"toast": {
|
|
22
|
+
"durationMs": 12000
|
|
23
|
+
},
|
|
24
|
+
"retentionDays": 730
|
|
25
|
+
}
|