bridge-agent 0.13.2 → 0.13.3
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/dist/index.js +58 -59
- package/dist/opencode-worker.js +2 -0
- package/package.json +4 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var s=require("node:worker_threads");function u(){try{return require("better-sqlite3")}catch{return null}}var o=u();s.parentPort?.on("message",n=>{if(n.type!=="scan")return;if(!o){let t={type:"error",message:"better-sqlite3 not available"};s.parentPort.postMessage(t);return}let e;try{e=new o(n.dbPath,{readonly:!0});let t=e.prepare(`SELECT sum(tokens_input + tokens_output + tokens_reasoning) AS spent
|
|
2
|
+
FROM session WHERE time_updated >= ?`).get(n.cutoffMs),r=e.prepare("SELECT sum(tokens_input + tokens_output + tokens_reasoning) AS total FROM session").get(),a={type:"result",tokensSpent5h:t?.spent??0,tokensTotal:r?.total??0};s.parentPort.postMessage(a)}catch(t){let r={type:"error",message:String(t)};s.parentPort.postMessage(r)}finally{if(e)try{e.close()}catch{}}});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bridge-agent",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.3",
|
|
4
4
|
"description": "Bridge local agent — connects your AI tools to Jerico",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -52,7 +52,8 @@
|
|
|
52
52
|
"pkg": {
|
|
53
53
|
"scripts": [
|
|
54
54
|
"dist/index.js",
|
|
55
|
-
"dist/bridge-mcp.cjs"
|
|
55
|
+
"dist/bridge-mcp.cjs",
|
|
56
|
+
"dist/opencode-worker.js"
|
|
56
57
|
],
|
|
57
58
|
"assets": [
|
|
58
59
|
"dist/scripts/**/*.sh",
|
|
@@ -71,6 +72,7 @@
|
|
|
71
72
|
"@types/node": "^20.0.0",
|
|
72
73
|
"@types/which": "^3.0.4",
|
|
73
74
|
"@types/ws": "^8.5.10",
|
|
75
|
+
"@yao-pkg/pkg": "^6.20.0",
|
|
74
76
|
"commander": "^12.0.0",
|
|
75
77
|
"esbuild": "^0.27.4",
|
|
76
78
|
"typescript": "^5.4.0",
|