opencode-statboard 2.9.6 → 2.10.4

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.
@@ -0,0 +1,79 @@
1
+ const fs = require('fs');
2
+ const c = fs.readFileSync('server.js', 'utf8');
3
+
4
+ // Find the tryListen function start
5
+ const tryListenStart = c.indexOf('function tryListen(port, maxPort) {');
6
+ if (tryListenStart === -1) {
7
+ console.log('Could not find tryListen function');
8
+ process.exit(1);
9
+ }
10
+
11
+ // Find the end of tryListen function
12
+ let braceCount = 0;
13
+ let tryListenEnd = -1;
14
+ for (let i = tryListenStart; i < c.length; i++) {
15
+ if (c[i] === '{') braceCount++;
16
+ else if (c[i] === '}') {
17
+ braceCount--;
18
+ if (braceCount === 0) {
19
+ tryListenEnd = i + 1; // Include the closing brace
20
+ break;
21
+ }
22
+ }
23
+
24
+ if (tryListenEnd === -1) {
25
+ console.log('Could not find end of tryListen function');
26
+ process.exit(1);
27
+ }
28
+
29
+ // Find the IIFE start
30
+ const iifeStart = c.indexOf('(async () => {');
31
+ if (iifeStart === -1) {
32
+ console.log('Could not find IIFE start');
33
+ process.exit(1);
34
+ }
35
+
36
+ // Find the end of the IIFE (the closing })();)
37
+ let braceCount = 0;
38
+ let iifeEnd = -1;
39
+ for (let i = c.indexOf('(async () => {'); i < c.length; i++) {
40
+ if (c[i] === '{') braceCount++;
41
+ else if (c[i] === '}') {
42
+ braceCount--;
43
+ if (braceCount === 0) {
44
+ // Check if next chars are })();
45
+ const nextChars = c.substring(i, i + 10);
46
+ if (nextChars.startsWith('})();')) {
47
+ iifeEnd = i + 5; // Include })();
48
+ break;
49
+ }
50
+ }
51
+ }
52
+
53
+ if (iifeEnd === -1) {
54
+ console.log('Could not find end of IIFE');
55
+ process.exit(1);
56
+ }
57
+
58
+ // Build new content
59
+ const beforeTryListen = c.substring(0, tryListenStart);
60
+ const afterIifeEnd = c.substring(iifeEnd);
61
+
62
+ const newContent = beforeTryListen + `
63
+ async function startServer() {
64
+ return new Promise((resolve, reject) => {
65
+ server.listen(PORT, '127.0.0.1', () => {
66
+ console.log('opencode stats dashboard: http://127.0.0.1:' + PORT);
67
+ resolve(PORT);
68
+ });
69
+ server.once('error', (e) => {
70
+ console.error('Server error:', e.message);
71
+ process.exit(1);
72
+ });
73
+ });
74
+ }
75
+
76
+ ` + c.substring(iifeStart);
77
+
78
+ fs.writeFileSync('server.js', newContent);
79
+ console.log('Fixed server.js - replaced tryListen with fixed port listener');
@@ -0,0 +1,79 @@
1
+ const fs = require('fs');
2
+ const c = fs.readFileSync('server.js', 'utf8');
3
+
4
+ // Find the tryListen function start
5
+ const tryListenStart = c.indexOf('function tryListen(port, maxPort) {');
6
+ if (tryListenStart === -1) {
7
+ console.log('Could not find tryListen function');
8
+ process.exit(1);
9
+ }
10
+
11
+ // Find the end of tryListen function
12
+ let braceCount = 0;
13
+ let tryListenEnd = -1;
14
+ for (let i = tryListenStart; i < c.length; i++) {
15
+ if (c[i] === '{') braceCount++;
16
+ else if (c[i] === '}') {
17
+ braceCount--;
18
+ if (braceCount === 0) {
19
+ tryListenEnd = i + 1; // Include the closing brace
20
+ break;
21
+ }
22
+ }
23
+
24
+ if (tryListenEnd === -1) {
25
+ console.log('Could not find end of tryListen function');
26
+ process.exit(1);
27
+ }
28
+
29
+ // Find the IIFE start
30
+ const iifeStart = c.indexOf('(async () => {');
31
+ if (iifeStart === -1) {
32
+ console.log('Could not find IIFE start');
33
+ process.exit(1);
34
+ }
35
+
36
+ // Find the end of the IIFE (the closing })();)
37
+ let braceCount = 0;
38
+ let iifeEnd = -1;
39
+ for (let i = c.indexOf('(async () => {'); i < c.length; i++) {
40
+ if (c[i] === '{') braceCount++;
41
+ else if (c[i] === '}') {
42
+ braceCount--;
43
+ if (braceCount === 0) {
44
+ // Check if next chars are })();
45
+ const nextChars = c.substring(i, i + 10);
46
+ if (nextChars.startsWith('})();')) {
47
+ iifeEnd = i + 5; // Include })();
48
+ break;
49
+ }
50
+ }
51
+ }
52
+
53
+ if (iifeEnd === -1) {
54
+ console.log('Could not find end of IIFE');
55
+ process.exit(1);
56
+ }
57
+
58
+ // Build new content
59
+ const beforeTryListen = c.substring(0, tryListenStart);
60
+ const afterIifeEnd = c.substring(iifeEnd);
61
+
62
+ const newContent = c.substring(0, tryListenStart) + `
63
+ async function startServer() {
64
+ return new Promise((resolve, reject) => {
65
+ server.listen(PORT, '127.0.0.1', () => {
66
+ console.log('opencode stats dashboard: http://127.0.0.1:' + PORT);
67
+ resolve(PORT);
68
+ });
69
+ server.once('error', (e) => {
70
+ console.error('Server error:', e.message);
71
+ process.exit(1);
72
+ });
73
+ });
74
+ }
75
+
76
+ ` + c.substring(iifeStart);
77
+
78
+ fs.writeFileSync('server.js', newContent);
79
+ console.log('Fixed server.js - replaced tryListen with fixed port listener');
@@ -0,0 +1,79 @@
1
+ const fs = require('fs');
2
+ const c = fs.readFileSync('server.js', 'utf8');
3
+
4
+ // Find the tryListen function start
5
+ const tryListenStart = c.indexOf('function tryListen(port, maxPort) {');
6
+ if (tryListenStart === -1) {
7
+ console.log('Could not find tryListen function');
8
+ process.exit(1);
9
+ }
10
+
11
+ // Find the end of tryListen function
12
+ let braceCount = 0;
13
+ let tryListenEnd = -1;
14
+ for (let i = tryListenStart; i < c.length; i++) {
15
+ if (c[i] === '{') braceCount++;
16
+ else if (c[i] === '}') {
17
+ braceCount--;
18
+ if (braceCount === 0) {
19
+ tryListenEnd = i + 1; // Include the closing brace
20
+ break;
21
+ }
22
+ }
23
+
24
+ if (tryListenEnd === -1) {
25
+ console.log('Could not find end of tryListen function');
26
+ process.exit(1);
27
+ }
28
+
29
+ // Find the IIFE start
30
+ const iifeStart = c.indexOf('(async () => {');
31
+ if (iifeStart === -1) {
32
+ console.log('Could not find IIFE start');
33
+ process.exit(1);
34
+ }
35
+
36
+ // Find the end of the IIFE (the closing })();)
37
+ let braceCount = 0;
38
+ let iifeEnd = -1;
39
+ for (let i = c.indexOf('(async () => {'); i < c.length; i++) {
40
+ if (c[i] === '{') braceCount++;
41
+ else if (c[i] === '}') {
42
+ braceCount--;
43
+ if (braceCount === 0) {
44
+ // Check if next chars are })();
45
+ const nextChars = c.substring(i, i + 10);
46
+ if (nextChars.startsWith('})();')) {
47
+ iifeEnd = i + 5; // Include })();
48
+ break;
49
+ }
50
+ }
51
+ }
52
+
53
+ if (iifeEnd === -1) {
54
+ console.log('Could not find end of IIFE');
55
+ process.exit(1);
56
+ }
57
+
58
+ // Build new content
59
+ const beforeTryListen = c.substring(0, tryListenStart);
60
+ const afterIifeEnd = c.substring(iifeEnd);
61
+
62
+ const newContent = c.substring(0, tryListenStart) + `
63
+ async function startServer() {
64
+ return new Promise((resolve, reject) => {
65
+ server.listen(PORT, '127.0.0.1', () => {
66
+ console.log('opencode stats dashboard: http://127.0.0.1:' + PORT);
67
+ resolve(PORT);
68
+ });
69
+ server.once('error', (e) => {
70
+ console.error('Server error:', e.message);
71
+ process.exit(1);
72
+ });
73
+ });
74
+ }
75
+
76
+ ` + c.substring(iifeStart);
77
+
78
+ fs.writeFileSync('server.js', newContent);
79
+ console.log('Fixed server.js - replaced tryListen with fixed port listener');
@@ -0,0 +1,79 @@
1
+ const fs = require('fs');
2
+ const c = fs.readFileSync('server.js', 'utf8');
3
+
4
+ // Find the tryListen function start
5
+ const tryListenStart = c.indexOf('function tryListen(port, maxPort) {');
6
+ if (tryListenStart === -1) {
7
+ console.log('Could not find tryListen function');
8
+ process.exit(1);
9
+ }
10
+
11
+ // Find the end of tryListen function
12
+ let braceCount = 0;
13
+ let tryListenEnd = -1;
14
+ for (let i = tryListenStart; i < c.length; i++) {
15
+ if (c[i] === '{') braceCount++;
16
+ else if (c[i] === '}') {
17
+ braceCount--;
18
+ if (braceCount === 0) {
19
+ tryListenEnd = i + 1; // Include the closing brace
20
+ break;
21
+ }
22
+ }
23
+
24
+ if (tryListenEnd === -1) {
25
+ console.log('Could not find end of tryListen function');
26
+ process.exit(1);
27
+ }
28
+
29
+ // Find the IIFE start
30
+ const iifeStart = c.indexOf('(async () => {');
31
+ if (iifeStart === -1) {
32
+ console.log('Could not find IIFE start');
33
+ process.exit(1);
34
+ }
35
+
36
+ // Find the end of the IIFE (the closing })();)
37
+ let braceCount = 0;
38
+ let iifeEnd = -1;
39
+ for (let i = c.indexOf('(async () => {'); i < c.length; i++) {
40
+ if (c[i] === '{') braceCount++;
41
+ else if (c[i] === '}') {
42
+ braceCount--;
43
+ if (braceCount === 0) {
44
+ // Check if next chars are })();
45
+ const nextChars = c.substring(i, i + 10);
46
+ if (nextChars.startsWith('})();')) {
47
+ iifeEnd = i + 5; // Include })();
48
+ break;
49
+ }
50
+ }
51
+ }
52
+
53
+ if (iifeEnd === -1) {
54
+ console.log('Could not find end of IIFE');
55
+ process.exit(1);
56
+ }
57
+
58
+ // Build new content
59
+ const beforeTryListen = c.substring(0, tryListenStart);
60
+ const afterIifeEnd = c.substring(iifeEnd);
61
+
62
+ const newContent = c.substring(0, tryListenStart) + `
63
+ async function startServer() {
64
+ return new Promise((resolve, reject) => {
65
+ server.listen(PORT, '127.0.0.1', () => {
66
+ console.log('opencode stats dashboard: http://127.0.0.1:' + PORT);
67
+ resolve(PORT);
68
+ });
69
+ server.once('error', (e) => {
70
+ console.error('Server error:', e.message);
71
+ process.exit(1);
72
+ });
73
+ });
74
+ }
75
+
76
+ ` + c.substring(iifeStart);
77
+
78
+ fs.writeFileSync('server.js', newContent);
79
+ console.log('Fixed server.js - replaced tryListen with fixed port listener');
@@ -0,0 +1,79 @@
1
+ const fs = require('fs');
2
+ const c = fs.readFileSync('server.js', 'utf8');
3
+
4
+ // Find the tryListen function start
5
+ const tryListenStart = c.indexOf('function tryListen(port, maxPort) {');
6
+ if (tryListenStart === -1) {
7
+ console.log('Could not find tryListen function');
8
+ process.exit(1);
9
+ }
10
+
11
+ // Find the end of tryListen function
12
+ let braceCount = 0;
13
+ let tryListenEnd = -1;
14
+ for (let i = tryListenStart; i < c.length; i++) {
15
+ if (c[i] === '{') braceCount++;
16
+ else if (c[i] === '}') {
17
+ braceCount--;
18
+ if (braceCount === 0) {
19
+ tryListenEnd = i + 1; // Include the closing brace
20
+ break;
21
+ }
22
+ }
23
+
24
+ if (tryListenEnd === -1) {
25
+ console.log('Could not find end of tryListen function');
26
+ process.exit(1);
27
+ }
28
+
29
+ // Find the IIFE start
30
+ const iifeStart = c.indexOf('(async () => {');
31
+ if (iifeStart === -1) {
32
+ console.log('Could not find IIFE start');
33
+ process.exit(1);
34
+ }
35
+
36
+ // Find the end of the IIFE (the closing })();)
37
+ let braceCount = 0;
38
+ let iifeEnd = -1;
39
+ for (let i = c.indexOf('(async () => {'); i < c.length; i++) {
40
+ if (c[i] === '{') braceCount++;
41
+ else if (c[i] === '}') {
42
+ braceCount--;
43
+ if (braceCount === 0) {
44
+ // Check if next chars are })();
45
+ const nextChars = c.substring(i, i + 10);
46
+ if (nextChars.startsWith('})();')) {
47
+ iifeEnd = i + 5; // Include })();
48
+ break;
49
+ }
50
+ }
51
+ }
52
+
53
+ if (iifeEnd === -1) {
54
+ console.log('Could not find end of IIFE');
55
+ process.exit(1);
56
+ }
57
+
58
+ // Build new content
59
+ const beforeTryListen = c.substring(0, tryListenStart);
60
+ const afterIifeEnd = c.substring(iifeEnd);
61
+
62
+ const newContent = c.substring(0, tryListenStart) + `
63
+ async function startServer() {
64
+ return new Promise((resolve, reject) => {
65
+ server.listen(PORT, '127.0.0.1', () => {
66
+ console.log('opencode stats dashboard: http://127.0.0.1:' + PORT);
67
+ resolve(PORT);
68
+ });
69
+ server.once('error', (e) => {
70
+ console.error('Server error:', e.message);
71
+ process.exit(1);
72
+ });
73
+ });
74
+ }
75
+
76
+ ` + c.substring(iifeStart);
77
+
78
+ fs.writeFileSync('server.js', newContent);
79
+ console.log('Fixed server.js - replaced tryListen with fixed port listener');
package/fix-port-v2.js ADDED
@@ -0,0 +1,58 @@
1
+ const fs = require('fs');
2
+ const c = fs.readFileSync('server.js', 'utf8');
3
+
4
+ // Find the tryListen function and the IIFE start
5
+ const tryListenStart = c.indexOf('function tryListen(port, maxPort) {');
6
+ const iifeStart = c.indexOf('(async () => {');
7
+
8
+ if (tryListenStart >= 0 && iifeStart >= 0) {
9
+ // Find the end of tryListen function (the closing brace of the function)
10
+ let braceCount = 0;
11
+ let tryListenEnd = -1;
12
+ for (let i = tryListenStart; i < c.length; i++) {
13
+ if (c[i] === '{') {
14
+ braceCount++;
15
+ } else if (c[i] === '}') {
16
+ braceCount--;
17
+ if (braceCount === 0) {
18
+ tryListenEnd = i + 1; // Include the closing brace
19
+ break;
20
+ }
21
+ }
22
+ }
23
+
24
+ if (tryListenEnd === -1) {
25
+ console.log('Could not find end of tryListen function');
26
+ process.exit(1);
27
+ }
28
+
29
+ // Find the start of the IIFE (the opening parenthesis)
30
+ const iifeParenStart = c.indexOf('(', iifeStart) + 1;
31
+
32
+ // Build the new content
33
+ const beforeTryListen = c.substring(0, tryListenStart);
34
+ const afterIifeStart = c.substring(iifeStart); // Keep the IIFE
35
+
36
+ const newContent = beforeTryListen + `
37
+ async function startServer() {
38
+ return new Promise((resolve, reject) => {
39
+ server.listen(PORT, '127.0.0.1', () => {
40
+ console.log('opencode stats dashboard: http://127.0.0.1:' + PORT);
41
+ resolve(PORT);
42
+ });
43
+ server.once('error', (e) => {
44
+ console.error('Server error:', e.message);
45
+ process.exit(1);
46
+ });
47
+ });
48
+ }
49
+
50
+ ` + c.substring(iifeStart);
51
+
52
+ fs.writeFileSync('server.js', newContent);
53
+ console.log('Fixed server.js - replaced tryListen with fixed port listener');
54
+ } else {
55
+ console.log('Could not find tryListen or IIFE start');
56
+ console.log('tryListenStart:', tryListenStart);
57
+ console.log('iifeStart:', iifeStart);
58
+ }
package/fix-port-v3.js ADDED
@@ -0,0 +1,79 @@
1
+ const fs = require('fs');
2
+ const c = fs.readFileSync('server.js', 'utf8');
3
+
4
+ // Find the tryListen function start
5
+ const tryListenStart = c.indexOf('function tryListen(port, maxPort) {');
6
+ if (tryListenStart === -1) {
7
+ console.log('Could not find tryListen function');
8
+ process.exit(1);
9
+ }
10
+
11
+ // Find the end of tryListen function
12
+ let braceCount = 0;
13
+ let tryListenEnd = -1;
14
+ for (let i = tryListenStart; i < c.length; i++) {
15
+ if (c[i] === '{') braceCount++;
16
+ else if (c[i] === '}') {
17
+ braceCount--;
18
+ if (braceCount === 0) {
19
+ tryListenEnd = i + 1; // Include the closing brace
20
+ break;
21
+ }
22
+ }
23
+
24
+ if (tryListenEnd === -1) {
25
+ console.log('Could not find end of tryListen function');
26
+ process.exit(1);
27
+ }
28
+
29
+ // Find the IIFE start
30
+ const iifeStart = c.indexOf('(async () => {');
31
+ if (iifeStart === -1) {
32
+ console.log('Could not find IIFE start');
33
+ process.exit(1);
34
+ }
35
+
36
+ // Find the end of the IIFE
37
+ braceCount = 0;
38
+ let iifeEnd = -1;
39
+ for (let i = iifeStart; i < c.length; i++) {
40
+ if (c[i] === '{') braceCount++;
41
+ else if (c[i] === '}') {
42
+ braceCount--;
43
+ if (braceCount === 0) {
44
+ // Find the closing })();
45
+ const nextChars = c.substring(i, i + 10);
46
+ if (nextChars.startsWith('})();')) {
47
+ tryListenEnd = i + 5; // Include })();
48
+ break;
49
+ }
50
+ }
51
+ }
52
+
53
+ if (tryListenEnd === -1) {
54
+ console.log('Could not find end of IIFE');
55
+ process.exit(1);
56
+ }
57
+
58
+ // Build new content
59
+ const beforeTryListen = c.substring(0, tryListenStart);
60
+ const afterIifeEnd = c.substring(iifeEnd);
61
+
62
+ const newContent = beforeTryListen + `
63
+ async function startServer() {
64
+ return new Promise((resolve, reject) => {
65
+ server.listen(PORT, '127.0.0.1', () => {
66
+ console.log('opencode stats dashboard: http://127.0.0.1:' + PORT);
67
+ resolve(PORT);
68
+ });
69
+ server.once('error', (e) => {
70
+ console.error('Server error:', e.message);
71
+ process.exit(1);
72
+ });
73
+ });
74
+ }
75
+
76
+ ` + c.substring(iifeStart);
77
+
78
+ fs.writeFileSync('server.js', newContent);
79
+ console.log('Fixed server.js - replaced tryListen with fixed port listener');
package/fix-port.js ADDED
@@ -0,0 +1,32 @@
1
+ const fs = require('fs');
2
+ const c = fs.readFileSync('server.js', 'utf8');
3
+
4
+ // Find the tryListen function start
5
+ const tryListenStart = c.indexOf('function tryListen(port, maxPort) {');
6
+ const iifeStart = c.indexOf('(async () => {');
7
+
8
+ if (tryListenStart >= 0 && iifeStart >= 0) {
9
+ const beforeTryListen = c.substring(0, tryListenStart);
10
+ const afterIifeStart = c.substring(iifeStart);
11
+
12
+ const newContent = beforeTryListen + `
13
+ async function startServer() {
14
+ return new Promise((resolve, reject) => {
15
+ server.listen(PORT, '127.0.0.1', () => {
16
+ console.log('opencode stats dashboard: http://127.0.0.1:' + PORT);
17
+ resolve(PORT);
18
+ });
19
+ server.once('error', (e) => {
20
+ console.error('Server error:', e.message);
21
+ process.exit(1);
22
+ });
23
+ });
24
+ };
25
+
26
+ ` + afterIifeStart;
27
+
28
+ fs.writeFileSync('server.js', newContent);
29
+ console.log('Fixed server.js - replaced tryListen with fixed port listener');
30
+ } else {
31
+ console.log('Could not find tryListen or IIFE start');
32
+ }
package/package.json CHANGED
@@ -1,21 +1,26 @@
1
1
  {
2
2
  "name": "opencode-statboard",
3
- "version": "2.9.6",
3
+ "version": "2.10.4",
4
4
  "description": "Real-time dashboard for opencode token usage and cost statistics",
5
5
  "main": "server.js",
6
6
  "bin": {
7
- "opencode-dashboard": "server.js"
7
+ "opencode-dashboard": "server.js",
8
+ "opencode-tui": "tui-dashboard.js"
8
9
  },
9
10
  "scripts": {
10
11
  "start": "node server.js",
11
- "test": "node --check server.js && node --check check-lib.js && node --check pricing.js && node --check check-stats-verify.js && node --check check-trend-verify.js && node --check check-report-verify.js && node --check check-frontend-smoke.js"
12
+ "tui": "node tui-dashboard.js",
13
+ "tui:web": "node tui-dashboard.js --web",
14
+ "both": "node tui-dashboard.js --both",
15
+ "test": "node --check server.js && node --check check-lib.js && node --check pricing.js && node --check check-stats-verify.js && node --check check-trend-verify.js && node --check check-report-verify.js && node --check check-frontend-smoke.js && node --check tui-dashboard.js"
12
16
  },
13
17
  "keywords": [
14
18
  "opencode",
15
19
  "dashboard",
16
20
  "tokens",
17
21
  "usage",
18
- "statistics"
22
+ "statistics",
23
+ "tui"
19
24
  ],
20
25
  "author": "thumb2086",
21
26
  "license": "MIT",
@@ -24,6 +29,7 @@
24
29
  "url": "git+https://github.com/thumb2086/opencode-usage-dashboard.git"
25
30
  },
26
31
  "dependencies": {
27
- "better-sqlite3": "^13.0.3"
32
+ "better-sqlite3": "^13.0.3",
33
+ "blessed": "^0.1.81"
28
34
  }
29
35
  }
package/server.js CHANGED
@@ -1535,33 +1535,22 @@ setInterval(() => {
1535
1535
  try { autoBackupIfDue(); } catch (_) {}
1536
1536
  }, CACHE_CLEANUP_MS);
1537
1537
 
1538
- function tryListen(port, maxPort) {
1539
- return new Promise((resolve) => {
1540
- server.once('error', (e) => {
1541
- if (e.code === 'EADDRINUSE') {
1542
- console.log(`port ${port} in use, trying ${port + 1}...`);
1543
- server.removeAllListeners('error');
1544
- if (port < (maxPort || port + 5)) {
1545
- resolve(tryListen(port + 1, maxPort));
1546
- } else {
1547
- console.error(`all ports ${PORT}-${maxPort || PORT + 5} in use`);
1548
- process.exit(1);
1549
- }
1550
- } else {
1551
- console.error(e);
1552
- process.exit(1);
1553
- }
1538
+ async function startServer() {
1539
+ return new Promise((resolve, reject) => {
1540
+ server.listen(PORT, '127.0.0.1', () => {
1541
+ console.log('opencode stats dashboard: http://127.0.0.1:' + PORT);
1542
+ resolve(PORT);
1554
1543
  });
1555
- server.listen(port, '127.0.0.1', () => {
1556
- console.log(`opencode stats dashboard: http://127.0.0.1:${port}`);
1557
- resolve(port);
1544
+ server.once('error', (e) => {
1545
+ console.error('Server error:', e.message);
1546
+ process.exit(1);
1558
1547
  });
1559
1548
  });
1560
1549
  }
1561
1550
 
1562
1551
  (async () => {
1563
1552
  try {
1564
- const actualPort = await tryListen(PORT, PORT + 5);
1553
+ await startServer();
1565
1554
  // Serve the persisted bundle + tool counts IMMEDIATELY. Nothing on this
1566
1555
  // path touches the live DB, so the first request answers in milliseconds
1567
1556
  // instead of waiting out a 3-29s scan.