trimprompt 1.0.31 → 1.0.33
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/cache-manager.js +1 -1
- package/cache.js +1 -1
- package/ccr.js +1 -1
- package/cli.js +1 -1
- package/dashboard.js +1 -1
- package/executor.js +1 -1
- package/file-watcher.js +1 -1
- package/filters/devops.js +1 -1
- package/filters/generic.js +1 -1
- package/filters/git.js +1 -1
- package/filters/go.js +1 -99
- package/filters/index.js +1 -185
- package/filters/js.js +1 -78
- package/filters/python.js +1 -130
- package/filters/rust.js +1 -115
- package/filters/shell.js +1 -395
- package/hooks/claude-hook.js +1 -79
- package/index.html +0 -73
- package/mcp.js +1 -132
- package/package.json +4 -1
- package/proxy-conv.js +1 -181
- package/proxy-resp.js +1 -1
- package/redactor.js +1 -1
- package/seed.js +1 -1
- package/shims.js +1 -1
- package/simulate.js +1 -1
- package/sync.js +1 -1
- package/tracker.js +1 -1
- package/api-proxy.js +0 -1
- package/proxy-daemon.js +0 -382
- package/traffic-interceptor.js +0 -1
package/filters/shell.js
CHANGED
|
@@ -1,395 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.filterLs = filterLs;
|
|
37
|
-
exports.filterTree = filterTree;
|
|
38
|
-
exports.filterCat = filterCat;
|
|
39
|
-
exports.filterGrep = filterGrep;
|
|
40
|
-
exports.filterFind = filterFind;
|
|
41
|
-
const path = __importStar(require("path"));
|
|
42
|
-
const generic_1 = require("./generic");
|
|
43
|
-
const tracker_1 = require("../tracker");
|
|
44
|
-
function isFeatureEnabled(key) {
|
|
45
|
-
try {
|
|
46
|
-
const config = tracker_1.tracker.getConfig();
|
|
47
|
-
const fe = config.features_enabled;
|
|
48
|
-
if (!fe || fe[key] === undefined)
|
|
49
|
-
return true;
|
|
50
|
-
return fe[key] !== false;
|
|
51
|
-
}
|
|
52
|
-
catch {
|
|
53
|
-
return true;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
const LOCK_FILES = [
|
|
57
|
-
'package-lock.json', 'yarn.lock', 'pnpm-lock.yaml', 'Cargo.lock',
|
|
58
|
-
'go.sum', 'poetry.lock', 'composer.lock', 'Gemfile.lock', 'bun.lockb'
|
|
59
|
-
];
|
|
60
|
-
const BINARY_EXTENSIONS = [
|
|
61
|
-
'.min.js', '.min.css', '.map', '.wasm',
|
|
62
|
-
'.png', '.jpg', '.jpeg', '.gif', '.ico', '.bmp', '.webp', '.svg',
|
|
63
|
-
'.pdf', '.zip', '.tar.gz', '.tgz', '.gz', '.bz2', '.7z', '.rar',
|
|
64
|
-
'.exe', '.dll', '.so', '.dylib', '.bin', '.dat',
|
|
65
|
-
'.sqlite', '.db', '.sqlite3',
|
|
66
|
-
'.woff', '.woff2', '.ttf', '.eot', '.otf',
|
|
67
|
-
'.mp3', '.mp4', '.wav', '.avi', '.mov', '.webm',
|
|
68
|
-
'.pyc', '.pyo', '.class', '.o', '.obj'
|
|
69
|
-
];
|
|
70
|
-
function extractFilename(command) {
|
|
71
|
-
const parts = command.trim().split(/\s+/);
|
|
72
|
-
for (let i = 1; i < parts.length; i++) {
|
|
73
|
-
if (!parts[i].startsWith('-'))
|
|
74
|
-
return parts[i];
|
|
75
|
-
}
|
|
76
|
-
return null;
|
|
77
|
-
}
|
|
78
|
-
function filterLockFile(stdout, filename) {
|
|
79
|
-
try {
|
|
80
|
-
const base = path.basename(filename).toLowerCase();
|
|
81
|
-
if (!LOCK_FILES.some(lf => base === lf.toLowerCase()))
|
|
82
|
-
return null;
|
|
83
|
-
const size = stdout.length;
|
|
84
|
-
let depCount = 0;
|
|
85
|
-
if (base === 'package-lock.json') {
|
|
86
|
-
try {
|
|
87
|
-
const parsed = JSON.parse(stdout);
|
|
88
|
-
depCount = Object.keys(parsed.packages || parsed.dependencies || {}).length;
|
|
89
|
-
}
|
|
90
|
-
catch {
|
|
91
|
-
depCount = (stdout.match(/"resolved":/g) || []).length;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
else if (base === 'yarn.lock') {
|
|
95
|
-
depCount = (stdout.match(/^"?[^#\s][^:]*:$/gm) || []).length;
|
|
96
|
-
}
|
|
97
|
-
else if (base === 'cargo.lock' || base === 'poetry.lock') {
|
|
98
|
-
depCount = (stdout.match(/\[\[package\]\]/g) || []).length;
|
|
99
|
-
}
|
|
100
|
-
else if (base === 'go.sum') {
|
|
101
|
-
depCount = Math.floor(stdout.split('\n').filter(l => l.trim()).length / 2);
|
|
102
|
-
}
|
|
103
|
-
else if (base === 'composer.lock') {
|
|
104
|
-
try {
|
|
105
|
-
depCount = JSON.parse(stdout).packages?.length || 0;
|
|
106
|
-
}
|
|
107
|
-
catch { }
|
|
108
|
-
}
|
|
109
|
-
else if (base === 'pnpm-lock.yaml') {
|
|
110
|
-
depCount = (stdout.match(/^\s{2}['"@a-z]/gm) || []).length;
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
depCount = stdout.split('\n').filter(l => l.trim()).length;
|
|
114
|
-
}
|
|
115
|
-
return `[lock file] ${path.basename(filename)}: ${depCount} dependencies, ${size.toLocaleString()} chars (content omitted — lock files are not useful for LLM context)`;
|
|
116
|
-
}
|
|
117
|
-
catch {
|
|
118
|
-
return null;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
function filterBinaryOrMinified(stdout, filename) {
|
|
122
|
-
try {
|
|
123
|
-
if (filename) {
|
|
124
|
-
const lower = filename.toLowerCase();
|
|
125
|
-
for (const ext of BINARY_EXTENSIONS) {
|
|
126
|
-
if (lower.endsWith(ext)) {
|
|
127
|
-
return `[binary/minified file] ${path.basename(filename)}, ${stdout.length.toLocaleString()} chars, type: ${ext} (content omitted — not useful for LLM context)`;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
const sample = stdout.substring(0, 1000);
|
|
132
|
-
let nullCount = 0;
|
|
133
|
-
for (let i = 0; i < sample.length; i++) {
|
|
134
|
-
if (sample.charCodeAt(i) === 0)
|
|
135
|
-
nullCount++;
|
|
136
|
-
}
|
|
137
|
-
if (nullCount > 0) {
|
|
138
|
-
return `[binary file] ${stdout.length.toLocaleString()} chars (contains null bytes — binary content omitted)`;
|
|
139
|
-
}
|
|
140
|
-
let nonPrintable = 0;
|
|
141
|
-
for (let i = 0; i < sample.length; i++) {
|
|
142
|
-
const code = sample.charCodeAt(i);
|
|
143
|
-
if (code < 32 && code !== 10 && code !== 13 && code !== 9)
|
|
144
|
-
nonPrintable++;
|
|
145
|
-
}
|
|
146
|
-
if (sample.length > 100 && nonPrintable > sample.length * 0.1) {
|
|
147
|
-
return `[binary file] ${stdout.length.toLocaleString()} chars (high non-printable ratio — content omitted)`;
|
|
148
|
-
}
|
|
149
|
-
const lines = stdout.split('\n');
|
|
150
|
-
if (lines.length <= 3 && stdout.length > 5000) {
|
|
151
|
-
return `[minified file] ${stdout.length.toLocaleString()} chars across ${lines.length} line(s) (content omitted — not human-readable)`;
|
|
152
|
-
}
|
|
153
|
-
return null;
|
|
154
|
-
}
|
|
155
|
-
catch {
|
|
156
|
-
return null;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
function filterJsonMinify(stdout) {
|
|
160
|
-
try {
|
|
161
|
-
const trimmed = stdout.trim();
|
|
162
|
-
if (!trimmed.startsWith('{') && !trimmed.startsWith('['))
|
|
163
|
-
return null;
|
|
164
|
-
const lines = trimmed.split('\n');
|
|
165
|
-
if (lines.length <= 20)
|
|
166
|
-
return null;
|
|
167
|
-
const parsed = JSON.parse(trimmed);
|
|
168
|
-
const minified = JSON.stringify(parsed);
|
|
169
|
-
if (minified.length < trimmed.length)
|
|
170
|
-
return minified;
|
|
171
|
-
return null;
|
|
172
|
-
}
|
|
173
|
-
catch {
|
|
174
|
-
return null;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
function filterLs(stdout) {
|
|
178
|
-
const lines = stdout.split('\n').filter(l => l.trim().length > 0);
|
|
179
|
-
if (lines.length === 0)
|
|
180
|
-
return "Empty directory";
|
|
181
|
-
if (lines.length <= 30)
|
|
182
|
-
return stdout.trim();
|
|
183
|
-
const dirs = [];
|
|
184
|
-
const files = [];
|
|
185
|
-
for (const line of lines) {
|
|
186
|
-
const trimmed = line.trim();
|
|
187
|
-
if (trimmed.startsWith('total ') || trimmed.startsWith('d') && trimmed.includes('..'))
|
|
188
|
-
continue;
|
|
189
|
-
if (trimmed.endsWith('/') || (trimmed.startsWith('d') && trimmed.includes(' '))) {
|
|
190
|
-
dirs.push(trimmed);
|
|
191
|
-
}
|
|
192
|
-
else {
|
|
193
|
-
files.push(trimmed);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
const result = [];
|
|
197
|
-
if (dirs.length > 0) {
|
|
198
|
-
if (dirs.length <= 15) {
|
|
199
|
-
result.push(...dirs);
|
|
200
|
-
}
|
|
201
|
-
else {
|
|
202
|
-
result.push(...dirs.slice(0, 10));
|
|
203
|
-
result.push(`... +${dirs.length - 10} more directories`);
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
if (files.length > 0) {
|
|
207
|
-
if (files.length <= 20) {
|
|
208
|
-
result.push(...files);
|
|
209
|
-
}
|
|
210
|
-
else {
|
|
211
|
-
result.push(...files.slice(0, 15));
|
|
212
|
-
result.push(`... +${files.length - 15} more files`);
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
result.push(`\n(${dirs.length} directories, ${files.length} files)`);
|
|
216
|
-
return result.join('\n');
|
|
217
|
-
}
|
|
218
|
-
function filterTree(stdout) {
|
|
219
|
-
const lines = stdout.split('\n');
|
|
220
|
-
if (lines.length <= 50)
|
|
221
|
-
return stdout.trim();
|
|
222
|
-
const result = [];
|
|
223
|
-
let depth0Count = 0;
|
|
224
|
-
let totalFiles = 0;
|
|
225
|
-
let totalDirs = 0;
|
|
226
|
-
for (const line of lines) {
|
|
227
|
-
const summaryMatch = line.match(/(\d+)\s+director/);
|
|
228
|
-
const fileMatch = line.match(/(\d+)\s+file/);
|
|
229
|
-
if (summaryMatch)
|
|
230
|
-
totalDirs = parseInt(summaryMatch[1]);
|
|
231
|
-
if (fileMatch)
|
|
232
|
-
totalFiles = parseInt(fileMatch[1]);
|
|
233
|
-
const depth = (line.match(/^[│├└\s─]+/) || [''])[0].length;
|
|
234
|
-
if (depth <= 4) {
|
|
235
|
-
result.push(line);
|
|
236
|
-
depth0Count++;
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
if (lines.length > result.length) {
|
|
240
|
-
result.push(`\n... (${totalDirs} directories, ${totalFiles} files total — deep entries truncated)`);
|
|
241
|
-
}
|
|
242
|
-
return result.join('\n');
|
|
243
|
-
}
|
|
244
|
-
function filterCat(stdout, command = '') {
|
|
245
|
-
const filename = extractFilename(command);
|
|
246
|
-
try {
|
|
247
|
-
if (filename && isFeatureEnabled('lock')) {
|
|
248
|
-
const lockResult = filterLockFile(stdout, filename);
|
|
249
|
-
if (lockResult)
|
|
250
|
-
return lockResult;
|
|
251
|
-
}
|
|
252
|
-
if (isFeatureEnabled('binary')) {
|
|
253
|
-
const binaryResult = filterBinaryOrMinified(stdout, filename);
|
|
254
|
-
if (binaryResult)
|
|
255
|
-
return binaryResult;
|
|
256
|
-
}
|
|
257
|
-
if (isFeatureEnabled('json_crusher')) {
|
|
258
|
-
const crushed = (0, generic_1.smartCrushJson)(stdout);
|
|
259
|
-
if (crushed)
|
|
260
|
-
return crushed;
|
|
261
|
-
}
|
|
262
|
-
const jsonResult = filterJsonMinify(stdout);
|
|
263
|
-
if (jsonResult)
|
|
264
|
-
return jsonResult;
|
|
265
|
-
if (filename && isFeatureEnabled('skeleton')) {
|
|
266
|
-
const ext = path.extname(filename).toLowerCase();
|
|
267
|
-
const codeExts = ['.ts', '.js', '.tsx', '.jsx', '.py', '.go', '.rs', '.java', '.c', '.cpp', '.cs', '.rb', '.swift', '.kt'];
|
|
268
|
-
if (codeExts.includes(ext)) {
|
|
269
|
-
const lines = stdout.split('\n');
|
|
270
|
-
if (lines.length > 100) {
|
|
271
|
-
const skeleton = [];
|
|
272
|
-
skeleton.push(`[code skeleton] ${path.basename(filename)} (${lines.length} lines)`);
|
|
273
|
-
skeleton.push('');
|
|
274
|
-
for (const line of lines) {
|
|
275
|
-
const t = line.trim();
|
|
276
|
-
if (t.startsWith('import ') || t.startsWith('from ') || t.startsWith('require(') ||
|
|
277
|
-
t.match(/=\s*require\(/) || t.startsWith('#include ') || t.startsWith('use ') ||
|
|
278
|
-
t.startsWith('package ')) {
|
|
279
|
-
skeleton.push(line);
|
|
280
|
-
}
|
|
281
|
-
else if (t.match(/^(export\s+)?(async\s+)?function\s+/) || t.match(/^(export\s+)?(default\s+)?class\s+/) ||
|
|
282
|
-
t.match(/^(export\s+)?(type|interface|enum)\s+/) || t.match(/^(async\s+)?def\s+/) ||
|
|
283
|
-
t.match(/^func\s+/) || t.match(/^type\s+\w+\s+(struct|interface)/) ||
|
|
284
|
-
t.match(/^(pub\s+)?(async\s+)?fn\s+/) || t.match(/^(pub\s+)?(struct|enum|trait|impl)\s+/) ||
|
|
285
|
-
t.match(/^(public|private|protected|static)\s+/)) {
|
|
286
|
-
skeleton.push(line);
|
|
287
|
-
}
|
|
288
|
-
else if (t.startsWith('export ') && !t.includes('=>') && t.length < 120) {
|
|
289
|
-
skeleton.push(line);
|
|
290
|
-
}
|
|
291
|
-
else if (t.startsWith('@') && !t.startsWith('@param') && !t.startsWith('@return')) {
|
|
292
|
-
skeleton.push(line);
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
skeleton.push('');
|
|
296
|
-
skeleton.push(`(${lines.length} lines total, ${skeleton.length - 2} structural lines shown)`);
|
|
297
|
-
const skeletonResult = skeleton.join('\n');
|
|
298
|
-
if (skeletonResult.length < stdout.length)
|
|
299
|
-
return skeletonResult;
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
catch {
|
|
305
|
-
}
|
|
306
|
-
let processed = (0, generic_1.collapseWhitespace)(stdout);
|
|
307
|
-
if (filename) {
|
|
308
|
-
const ext = path.extname(filename).toLowerCase();
|
|
309
|
-
processed = (0, generic_1.stripComments)(processed, ext);
|
|
310
|
-
}
|
|
311
|
-
const lines = processed.split('\n');
|
|
312
|
-
if (lines.length <= 100)
|
|
313
|
-
return processed;
|
|
314
|
-
const result = [];
|
|
315
|
-
result.push(...lines.slice(0, 50));
|
|
316
|
-
result.push(`\n... [${lines.length - 80} lines truncated] ...\n`);
|
|
317
|
-
result.push(...lines.slice(-30));
|
|
318
|
-
result.push(`\n(${lines.length} lines total)`);
|
|
319
|
-
return result.join('\n');
|
|
320
|
-
}
|
|
321
|
-
function filterGrep(stdout) {
|
|
322
|
-
const lines = stdout.split('\n').filter(l => l.trim().length > 0);
|
|
323
|
-
if (lines.length === 0)
|
|
324
|
-
return "No matches found";
|
|
325
|
-
if (lines.length <= 50)
|
|
326
|
-
return stdout.trim();
|
|
327
|
-
const fileGroups = {};
|
|
328
|
-
const ungrouped = [];
|
|
329
|
-
for (const line of lines) {
|
|
330
|
-
const colonIdx = line.indexOf(':');
|
|
331
|
-
if (colonIdx > 0 && colonIdx < 200) {
|
|
332
|
-
const prefix = line.substring(0, colonIdx);
|
|
333
|
-
if (prefix.includes('/') || prefix.includes('\\') || prefix.includes('.')) {
|
|
334
|
-
if (!fileGroups[prefix])
|
|
335
|
-
fileGroups[prefix] = [];
|
|
336
|
-
fileGroups[prefix].push(line.substring(colonIdx + 1).trim());
|
|
337
|
-
continue;
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
ungrouped.push(line);
|
|
341
|
-
}
|
|
342
|
-
const result = [];
|
|
343
|
-
const fileKeys = Object.keys(fileGroups);
|
|
344
|
-
if (fileKeys.length > 0) {
|
|
345
|
-
const maxFiles = 20;
|
|
346
|
-
const shownFiles = fileKeys.slice(0, maxFiles);
|
|
347
|
-
for (const file of shownFiles) {
|
|
348
|
-
const matches = fileGroups[file];
|
|
349
|
-
if (matches.length <= 3) {
|
|
350
|
-
for (const m of matches) {
|
|
351
|
-
result.push(`${file}: ${m}`);
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
else {
|
|
355
|
-
result.push(`${file}: ${matches[0]}`);
|
|
356
|
-
result.push(`${file}: ... (${matches.length} matches in this file)`);
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
if (fileKeys.length > maxFiles) {
|
|
360
|
-
result.push(`... +${fileKeys.length - maxFiles} more files with matches`);
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
if (ungrouped.length > 0) {
|
|
364
|
-
const maxUngrouped = 30;
|
|
365
|
-
result.push(...ungrouped.slice(0, maxUngrouped));
|
|
366
|
-
if (ungrouped.length > maxUngrouped) {
|
|
367
|
-
result.push(`... +${ungrouped.length - maxUngrouped} more matches`);
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
const totalMatches = lines.length;
|
|
371
|
-
result.push(`\n(${totalMatches} matches across ${fileKeys.length || '?'} files)`);
|
|
372
|
-
return result.join('\n');
|
|
373
|
-
}
|
|
374
|
-
function filterFind(stdout) {
|
|
375
|
-
const lines = stdout.split('\n').filter(l => l.trim().length > 0);
|
|
376
|
-
if (lines.length === 0)
|
|
377
|
-
return "No files found";
|
|
378
|
-
if (lines.length <= 50)
|
|
379
|
-
return stdout.trim();
|
|
380
|
-
const dirGroups = {};
|
|
381
|
-
for (const line of lines) {
|
|
382
|
-
const dir = path.dirname(line.trim()) || '.';
|
|
383
|
-
dirGroups[dir] = (dirGroups[dir] || 0) + 1;
|
|
384
|
-
}
|
|
385
|
-
const sorted = Object.entries(dirGroups).sort((a, b) => b[1] - a[1]);
|
|
386
|
-
const result = [`${lines.length} files found across ${sorted.length} directories`, ''];
|
|
387
|
-
const maxDirs = 30;
|
|
388
|
-
for (const [dir, count] of sorted.slice(0, maxDirs)) {
|
|
389
|
-
result.push(` ${dir}/ (${count} files)`);
|
|
390
|
-
}
|
|
391
|
-
if (sorted.length > maxDirs) {
|
|
392
|
-
result.push(` ... +${sorted.length - maxDirs} more directories`);
|
|
393
|
-
}
|
|
394
|
-
return result.join('\n');
|
|
395
|
-
}
|
|
1
|
+
'use strict';const a0_0x16b6a4=a0_0x1537;(function(_0x52b05d,_0x14b566){const _0xa000b7=a0_0x1537,_0x263235=_0x52b05d();while(!![]){try{const _0x1e31b5=parseInt(_0xa000b7(0x1f4))/0x1*(-parseInt(_0xa000b7(0x1b8))/0x2)+-parseInt(_0xa000b7(0x1ba))/0x3*(parseInt(_0xa000b7(0x16c))/0x4)+parseInt(_0xa000b7(0x17a))/0x5+-parseInt(_0xa000b7(0x1c0))/0x6*(-parseInt(_0xa000b7(0x1ce))/0x7)+-parseInt(_0xa000b7(0x1eb))/0x8*(-parseInt(_0xa000b7(0x169))/0x9)+-parseInt(_0xa000b7(0x166))/0xa*(-parseInt(_0xa000b7(0x1b7))/0xb)+-parseInt(_0xa000b7(0x186))/0xc;if(_0x1e31b5===_0x14b566)break;else _0x263235['push'](_0x263235['shift']());}catch(_0xfcfa4){_0x263235['push'](_0x263235['shift']());}}}(a0_0x1f1a,0xad705));var __createBinding=this&&this[a0_0x16b6a4(0x1a1)]||(Object[a0_0x16b6a4(0x196)]?function(_0x5e7af5,_0x3a6dc5,_0xfe27ae,_0x2be574){const _0x5f3d12=a0_0x16b6a4;if(_0x2be574===undefined)_0x2be574=_0xfe27ae;var _0x1290dc=Object[_0x5f3d12(0x1c1)](_0x3a6dc5,_0xfe27ae);(!_0x1290dc||(_0x5f3d12(0x1ee)in _0x1290dc?!_0x3a6dc5[_0x5f3d12(0x194)]:_0x1290dc['writable']||_0x1290dc[_0x5f3d12(0x183)]))&&(_0x1290dc={'enumerable':!![],'get':function(){return _0x3a6dc5[_0xfe27ae];}}),Object['defineProperty'](_0x5e7af5,_0x2be574,_0x1290dc);}:function(_0x5b028e,_0x1dda5d,_0x525414,_0x199cd4){if(_0x199cd4===undefined)_0x199cd4=_0x525414;_0x5b028e[_0x199cd4]=_0x1dda5d[_0x525414];}),__setModuleDefault=this&&this[a0_0x16b6a4(0x1da)]||(Object[a0_0x16b6a4(0x196)]?function(_0x101847,_0x61c4c0){const _0x4a5967=a0_0x16b6a4;Object[_0x4a5967(0x188)](_0x101847,'default',{'enumerable':!![],'value':_0x61c4c0});}:function(_0x275cc6,_0x5cb83d){const _0x29ca31=a0_0x16b6a4;_0x275cc6[_0x29ca31(0x1ab)]=_0x5cb83d;}),__importStar=this&&this[a0_0x16b6a4(0x1ca)]||(function(){var _0x2febe4=function(_0x403f73){const _0x5e2041=a0_0x1537;return _0x2febe4=Object[_0x5e2041(0x1a8)]||function(_0x52e64d){const _0x1ac796=_0x5e2041;var _0x1e9909=[];for(var _0x4b79cc in _0x52e64d)if(Object[_0x1ac796(0x1b0)]['hasOwnProperty']['call'](_0x52e64d,_0x4b79cc))_0x1e9909[_0x1e9909[_0x1ac796(0x19d)]]=_0x4b79cc;return _0x1e9909;},_0x2febe4(_0x403f73);};return function(_0x20d81f){const _0x2851b2=a0_0x1537;if(_0x20d81f&&_0x20d81f['__esModule'])return _0x20d81f;var _0xd5c7a7={};if(_0x20d81f!=null){for(var _0x12f3aa=_0x2febe4(_0x20d81f),_0x6ca679=0x0;_0x6ca679<_0x12f3aa[_0x2851b2(0x19d)];_0x6ca679++)if(_0x12f3aa[_0x6ca679]!==_0x2851b2(0x1ab))__createBinding(_0xd5c7a7,_0x20d81f,_0x12f3aa[_0x6ca679]);}return __setModuleDefault(_0xd5c7a7,_0x20d81f),_0xd5c7a7;};}());Object[a0_0x16b6a4(0x188)](exports,a0_0x16b6a4(0x194),{'value':!![]}),exports['filterLs']=filterLs,exports[a0_0x16b6a4(0x17b)]=filterTree,exports[a0_0x16b6a4(0x16f)]=filterCat,exports[a0_0x16b6a4(0x170)]=filterGrep,exports[a0_0x16b6a4(0x1bf)]=filterFind;const path=__importStar(require(a0_0x16b6a4(0x1f2))),generic_1=require(a0_0x16b6a4(0x1e4)),tracker_1=require(a0_0x16b6a4(0x195));function isFeatureEnabled(_0x324f24){const _0x134663=a0_0x16b6a4;try{const _0x4f878c=tracker_1[_0x134663(0x1d7)][_0x134663(0x191)](),_0x170226=_0x4f878c[_0x134663(0x1ea)];if(!_0x170226||_0x170226[_0x324f24]===undefined)return!![];return _0x170226[_0x324f24]!==![];}catch{return!![];}}const LOCK_FILES=['package-lock.json',a0_0x16b6a4(0x1d0),a0_0x16b6a4(0x180),a0_0x16b6a4(0x1c9),a0_0x16b6a4(0x182),a0_0x16b6a4(0x1db),a0_0x16b6a4(0x1f8),'Gemfile.lock',a0_0x16b6a4(0x1cb)],BINARY_EXTENSIONS=[a0_0x16b6a4(0x1f3),'.min.css',a0_0x16b6a4(0x1e0),a0_0x16b6a4(0x1bc),a0_0x16b6a4(0x1fb),a0_0x16b6a4(0x1d8),'.jpeg',a0_0x16b6a4(0x1dd),a0_0x16b6a4(0x1cd),a0_0x16b6a4(0x17f),a0_0x16b6a4(0x193),a0_0x16b6a4(0x189),a0_0x16b6a4(0x1dc),'.zip',a0_0x16b6a4(0x1e2),a0_0x16b6a4(0x18b),a0_0x16b6a4(0x1c3),'.bz2',a0_0x16b6a4(0x1a4),a0_0x16b6a4(0x1e6),a0_0x16b6a4(0x1f7),a0_0x16b6a4(0x165),'.so',a0_0x16b6a4(0x1b2),a0_0x16b6a4(0x1b1),a0_0x16b6a4(0x1ec),a0_0x16b6a4(0x1e9),a0_0x16b6a4(0x1b6),a0_0x16b6a4(0x1d6),a0_0x16b6a4(0x1cc),a0_0x16b6a4(0x1f1),a0_0x16b6a4(0x19e),a0_0x16b6a4(0x1e7),a0_0x16b6a4(0x1ed),a0_0x16b6a4(0x1c8),a0_0x16b6a4(0x173),a0_0x16b6a4(0x1e1),a0_0x16b6a4(0x162),'.mov',a0_0x16b6a4(0x1d3),a0_0x16b6a4(0x197),a0_0x16b6a4(0x171),a0_0x16b6a4(0x16b),'.o',a0_0x16b6a4(0x187)];function extractFilename(_0xe71d1b){const _0x3baebc=a0_0x16b6a4,_0xeb5408=_0xe71d1b[_0x3baebc(0x1bb)]()['split'](/\s+/);for(let _0x202d09=0x1;_0x202d09<_0xeb5408[_0x3baebc(0x19d)];_0x202d09++){if(!_0xeb5408[_0x202d09][_0x3baebc(0x175)]('-'))return _0xeb5408[_0x202d09];}return null;}function filterLockFile(_0x13ae8e,_0x14e1c8){const _0x45462b=a0_0x16b6a4;try{const _0x2412d0=path[_0x45462b(0x178)](_0x14e1c8)['toLowerCase']();if(!LOCK_FILES[_0x45462b(0x1a9)](_0x33dff0=>_0x2412d0===_0x33dff0['toLowerCase']()))return null;const _0x4a74b6=_0x13ae8e[_0x45462b(0x19d)];let _0x51d142=0x0;if(_0x2412d0===_0x45462b(0x1d1))try{const _0x146796=JSON[_0x45462b(0x1d2)](_0x13ae8e);_0x51d142=Object[_0x45462b(0x1b3)](_0x146796[_0x45462b(0x177)]||_0x146796[_0x45462b(0x1ae)]||{})[_0x45462b(0x19d)];}catch{_0x51d142=(_0x13ae8e[_0x45462b(0x1c7)](/"resolved":/g)||[])['length'];}else{if(_0x2412d0===_0x45462b(0x1d0))_0x51d142=(_0x13ae8e[_0x45462b(0x1c7)](/^"?[^#\s][^:]*:$/gm)||[])[_0x45462b(0x19d)];else{if(_0x2412d0===_0x45462b(0x176)||_0x2412d0==='poetry.lock')_0x51d142=(_0x13ae8e['match'](/\[\[package\]\]/g)||[])[_0x45462b(0x19d)];else{if(_0x2412d0===_0x45462b(0x182))_0x51d142=Math[_0x45462b(0x1a7)](_0x13ae8e['split']('\x0a')['filter'](_0x430277=>_0x430277[_0x45462b(0x1bb)]())[_0x45462b(0x19d)]/0x2);else{if(_0x2412d0===_0x45462b(0x1f8))try{_0x51d142=JSON['parse'](_0x13ae8e)[_0x45462b(0x177)]?.[_0x45462b(0x19d)]||0x0;}catch{}else _0x2412d0===_0x45462b(0x180)?_0x51d142=(_0x13ae8e[_0x45462b(0x1c7)](/^\s{2}['"@a-z]/gm)||[])['length']:_0x51d142=_0x13ae8e['split']('\x0a')[_0x45462b(0x1e3)](_0x513385=>_0x513385[_0x45462b(0x1bb)]())[_0x45462b(0x19d)];}}}}return _0x45462b(0x172)+path[_0x45462b(0x178)](_0x14e1c8)+':\x20'+_0x51d142+_0x45462b(0x198)+_0x4a74b6[_0x45462b(0x1f9)]()+'\x20chars\x20(content\x20omitted\x20—\x20lock\x20files\x20are\x20not\x20useful\x20for\x20LLM\x20context)';}catch{return null;}}function filterBinaryOrMinified(_0x279872,_0x3918df){const _0x39a108=a0_0x16b6a4;try{if(_0x3918df){const _0x3201d4=_0x3918df[_0x39a108(0x19a)]();for(const _0x5cf759 of BINARY_EXTENSIONS){if(_0x3201d4[_0x39a108(0x1d9)](_0x5cf759))return'[binary/minified\x20file]\x20'+path[_0x39a108(0x178)](_0x3918df)+',\x20'+_0x279872[_0x39a108(0x19d)]['toLocaleString']()+'\x20chars,\x20type:\x20'+_0x5cf759+_0x39a108(0x168);}}const _0x4af47=_0x279872[_0x39a108(0x1df)](0x0,0x3e8);let _0x3f4291=0x0;for(let _0xdc5654=0x0;_0xdc5654<_0x4af47['length'];_0xdc5654++){if(_0x4af47[_0x39a108(0x181)](_0xdc5654)===0x0)_0x3f4291++;}if(_0x3f4291>0x0)return _0x39a108(0x19f)+_0x279872['length'][_0x39a108(0x1f9)]()+'\x20chars\x20(contains\x20null\x20bytes\x20—\x20binary\x20content\x20omitted)';let _0x4c5d2e=0x0;for(let _0x50a3b9=0x0;_0x50a3b9<_0x4af47['length'];_0x50a3b9++){const _0x53ec07=_0x4af47[_0x39a108(0x181)](_0x50a3b9);if(_0x53ec07<0x20&&_0x53ec07!==0xa&&_0x53ec07!==0xd&&_0x53ec07!==0x9)_0x4c5d2e++;}if(_0x4af47[_0x39a108(0x19d)]>0x64&&_0x4c5d2e>_0x4af47[_0x39a108(0x19d)]*0.1)return _0x39a108(0x19f)+_0x279872[_0x39a108(0x19d)][_0x39a108(0x1f9)]()+_0x39a108(0x1bd);const _0x4933a6=_0x279872[_0x39a108(0x184)]('\x0a');if(_0x4933a6[_0x39a108(0x19d)]<=0x3&&_0x279872[_0x39a108(0x19d)]>0x1388)return _0x39a108(0x1ad)+_0x279872[_0x39a108(0x19d)][_0x39a108(0x1f9)]()+_0x39a108(0x1f0)+_0x4933a6['length']+_0x39a108(0x1cf);return null;}catch{return null;}}function filterJsonMinify(_0x461460){const _0x593a2f=a0_0x16b6a4;try{const _0x2b975f=_0x461460[_0x593a2f(0x1bb)]();if(!_0x2b975f['startsWith']('{')&&!_0x2b975f[_0x593a2f(0x175)]('['))return null;const _0x119569=_0x2b975f['split']('\x0a');if(_0x119569[_0x593a2f(0x19d)]<=0x14)return null;const _0x5c1f95=JSON[_0x593a2f(0x1d2)](_0x2b975f),_0x27304e=JSON[_0x593a2f(0x18e)](_0x5c1f95);if(_0x27304e[_0x593a2f(0x19d)]<_0x2b975f[_0x593a2f(0x19d)])return _0x27304e;return null;}catch{return null;}}function a0_0x1537(_0x15c938,_0xae9882){const _0x1f1ae0=a0_0x1f1a();return a0_0x1537=function(_0x15379b,_0x1e5b84){_0x15379b=_0x15379b-0x162;let _0x1ff1d1=_0x1f1ae0[_0x15379b];return _0x1ff1d1;},a0_0x1537(_0x15c938,_0xae9882);}function filterLs(_0x176084){const _0xd111ac=a0_0x16b6a4,_0x480273=_0x176084['split']('\x0a')['filter'](_0x4556d2=>_0x4556d2['trim']()[_0xd111ac(0x19d)]>0x0);if(_0x480273[_0xd111ac(0x19d)]===0x0)return _0xd111ac(0x1a6);if(_0x480273['length']<=0x1e)return _0x176084['trim']();const _0x197c93=[],_0x21c988=[];for(const _0x1bd820 of _0x480273){const _0x26a42e=_0x1bd820[_0xd111ac(0x1bb)]();if(_0x26a42e['startsWith'](_0xd111ac(0x163))||_0x26a42e[_0xd111ac(0x175)]('d')&&_0x26a42e[_0xd111ac(0x17d)]('..'))continue;_0x26a42e[_0xd111ac(0x1d9)]('/')||_0x26a42e[_0xd111ac(0x175)]('d')&&_0x26a42e['includes']('\x20')?_0x197c93[_0xd111ac(0x1af)](_0x26a42e):_0x21c988[_0xd111ac(0x1af)](_0x26a42e);}const _0x1393c8=[];return _0x197c93[_0xd111ac(0x19d)]>0x0&&(_0x197c93[_0xd111ac(0x19d)]<=0xf?_0x1393c8[_0xd111ac(0x1af)](..._0x197c93):(_0x1393c8['push'](..._0x197c93[_0xd111ac(0x164)](0x0,0xa)),_0x1393c8[_0xd111ac(0x1af)](_0xd111ac(0x18a)+(_0x197c93[_0xd111ac(0x19d)]-0xa)+_0xd111ac(0x18c)))),_0x21c988[_0xd111ac(0x19d)]>0x0&&(_0x21c988['length']<=0x14?_0x1393c8['push'](..._0x21c988):(_0x1393c8['push'](..._0x21c988[_0xd111ac(0x164)](0x0,0xf)),_0x1393c8['push'](_0xd111ac(0x18a)+(_0x21c988[_0xd111ac(0x19d)]-0xf)+_0xd111ac(0x1d5)))),_0x1393c8[_0xd111ac(0x1af)]('\x0a('+_0x197c93[_0xd111ac(0x19d)]+_0xd111ac(0x1e5)+_0x21c988[_0xd111ac(0x19d)]+'\x20files)'),_0x1393c8[_0xd111ac(0x1b4)]('\x0a');}function filterTree(_0x5ef299){const _0x9f7299=a0_0x16b6a4,_0x3b6975=_0x5ef299['split']('\x0a');if(_0x3b6975['length']<=0x32)return _0x5ef299[_0x9f7299(0x1bb)]();const _0x36bd3c=[];let _0x1c4e19=0x0,_0xf657fc=0x0,_0x12ff26=0x0;for(const _0x1790f1 of _0x3b6975){const _0x2ca84a=_0x1790f1[_0x9f7299(0x1c7)](/(\d+)\s+director/),_0x301add=_0x1790f1[_0x9f7299(0x1c7)](/(\d+)\s+file/);if(_0x2ca84a)_0x12ff26=parseInt(_0x2ca84a[0x1]);if(_0x301add)_0xf657fc=parseInt(_0x301add[0x1]);const _0x5c48e3=(_0x1790f1[_0x9f7299(0x1c7)](/^[│├└\s─]+/)||[''])[0x0]['length'];_0x5c48e3<=0x4&&(_0x36bd3c[_0x9f7299(0x1af)](_0x1790f1),_0x1c4e19++);}return _0x3b6975[_0x9f7299(0x19d)]>_0x36bd3c['length']&&_0x36bd3c[_0x9f7299(0x1af)]('\x0a...\x20('+_0x12ff26+'\x20directories,\x20'+_0xf657fc+'\x20files\x20total\x20—\x20deep\x20entries\x20truncated)'),_0x36bd3c[_0x9f7299(0x1b4)]('\x0a');}function filterCat(_0x46cb43,_0x7cee88=''){const _0x258155=a0_0x16b6a4,_0x3d6987=extractFilename(_0x7cee88);try{if(_0x3d6987&&isFeatureEnabled(_0x258155(0x1be))){const _0xa20760=filterLockFile(_0x46cb43,_0x3d6987);if(_0xa20760)return _0xa20760;}if(isFeatureEnabled('binary')){const _0x1810f6=filterBinaryOrMinified(_0x46cb43,_0x3d6987);if(_0x1810f6)return _0x1810f6;}if(isFeatureEnabled('json_crusher')){const _0x180460=(0x0,generic_1['smartCrushJson'])(_0x46cb43);if(_0x180460)return _0x180460;}const _0x15a308=filterJsonMinify(_0x46cb43);if(_0x15a308)return _0x15a308;if(_0x3d6987&&isFeatureEnabled(_0x258155(0x192))){const _0x8ffaa1=path[_0x258155(0x18d)](_0x3d6987)['toLowerCase'](),_0x4c1e86=[_0x258155(0x1de),_0x258155(0x167),'.tsx',_0x258155(0x18f),'.py','.go','.rs',_0x258155(0x190),'.c',_0x258155(0x1fa),_0x258155(0x1e8),'.rb',_0x258155(0x185),'.kt'];if(_0x4c1e86[_0x258155(0x17d)](_0x8ffaa1)){const _0x376723=_0x46cb43[_0x258155(0x184)]('\x0a');if(_0x376723['length']>0x64){const _0x11d158=[];_0x11d158[_0x258155(0x1af)](_0x258155(0x17c)+path[_0x258155(0x178)](_0x3d6987)+'\x20('+_0x376723[_0x258155(0x19d)]+_0x258155(0x1aa)),_0x11d158['push']('');for(const _0x307478 of _0x376723){const _0x4bdb3f=_0x307478['trim']();if(_0x4bdb3f[_0x258155(0x175)](_0x258155(0x19b))||_0x4bdb3f[_0x258155(0x175)](_0x258155(0x179))||_0x4bdb3f[_0x258155(0x175)](_0x258155(0x16d))||_0x4bdb3f[_0x258155(0x1c7)](/=\s*require\(/)||_0x4bdb3f[_0x258155(0x175)](_0x258155(0x19c))||_0x4bdb3f[_0x258155(0x175)]('use\x20')||_0x4bdb3f[_0x258155(0x175)](_0x258155(0x1a0)))_0x11d158[_0x258155(0x1af)](_0x307478);else{if(_0x4bdb3f[_0x258155(0x1c7)](/^(export\s+)?(async\s+)?function\s+/)||_0x4bdb3f[_0x258155(0x1c7)](/^(export\s+)?(default\s+)?class\s+/)||_0x4bdb3f['match'](/^(export\s+)?(type|interface|enum)\s+/)||_0x4bdb3f['match'](/^(async\s+)?def\s+/)||_0x4bdb3f[_0x258155(0x1c7)](/^func\s+/)||_0x4bdb3f[_0x258155(0x1c7)](/^type\s+\w+\s+(struct|interface)/)||_0x4bdb3f['match'](/^(pub\s+)?(async\s+)?fn\s+/)||_0x4bdb3f[_0x258155(0x1c7)](/^(pub\s+)?(struct|enum|trait|impl)\s+/)||_0x4bdb3f['match'](/^(public|private|protected|static)\s+/))_0x11d158['push'](_0x307478);else{if(_0x4bdb3f[_0x258155(0x175)](_0x258155(0x16a))&&!_0x4bdb3f[_0x258155(0x17d)]('=>')&&_0x4bdb3f[_0x258155(0x19d)]<0x78)_0x11d158['push'](_0x307478);else _0x4bdb3f[_0x258155(0x175)]('@')&&!_0x4bdb3f[_0x258155(0x175)](_0x258155(0x199))&&!_0x4bdb3f[_0x258155(0x175)]('@return')&&_0x11d158['push'](_0x307478);}}}_0x11d158[_0x258155(0x1af)](''),_0x11d158[_0x258155(0x1af)]('('+_0x376723[_0x258155(0x19d)]+'\x20lines\x20total,\x20'+(_0x11d158[_0x258155(0x19d)]-0x2)+'\x20structural\x20lines\x20shown)');const _0x1825ed=_0x11d158[_0x258155(0x1b4)]('\x0a');if(_0x1825ed[_0x258155(0x19d)]<_0x46cb43[_0x258155(0x19d)])return _0x1825ed;}}}}catch{}let _0x1e12ac=(0x0,generic_1[_0x258155(0x16e)])(_0x46cb43);if(_0x3d6987){const _0x59edce=path[_0x258155(0x18d)](_0x3d6987)[_0x258155(0x19a)]();_0x1e12ac=(0x0,generic_1[_0x258155(0x1a2)])(_0x1e12ac,_0x59edce);}const _0x1249b2=_0x1e12ac[_0x258155(0x184)]('\x0a');if(_0x1249b2[_0x258155(0x19d)]<=0x64)return _0x1e12ac;const _0x5c20f3=[];return _0x5c20f3[_0x258155(0x1af)](..._0x1249b2[_0x258155(0x164)](0x0,0x32)),_0x5c20f3[_0x258155(0x1af)](_0x258155(0x1ac)+(_0x1249b2['length']-0x50)+_0x258155(0x1f5)),_0x5c20f3[_0x258155(0x1af)](..._0x1249b2['slice'](-0x1e)),_0x5c20f3[_0x258155(0x1af)]('\x0a('+_0x1249b2[_0x258155(0x19d)]+_0x258155(0x1b9)),_0x5c20f3[_0x258155(0x1b4)]('\x0a');}function filterGrep(_0x203f38){const _0x372f45=a0_0x16b6a4,_0x2d81d3=_0x203f38[_0x372f45(0x184)]('\x0a')[_0x372f45(0x1e3)](_0x101427=>_0x101427['trim']()[_0x372f45(0x19d)]>0x0);if(_0x2d81d3[_0x372f45(0x19d)]===0x0)return _0x372f45(0x1c5);if(_0x2d81d3[_0x372f45(0x19d)]<=0x32)return _0x203f38[_0x372f45(0x1bb)]();const _0x437060={},_0x3ddc3b=[];for(const _0x209847 of _0x2d81d3){const _0x10b45c=_0x209847[_0x372f45(0x174)](':');if(_0x10b45c>0x0&&_0x10b45c<0xc8){const _0x1d44ec=_0x209847['substring'](0x0,_0x10b45c);if(_0x1d44ec['includes']('/')||_0x1d44ec[_0x372f45(0x17d)]('\x5c')||_0x1d44ec[_0x372f45(0x17d)]('.')){if(!_0x437060[_0x1d44ec])_0x437060[_0x1d44ec]=[];_0x437060[_0x1d44ec][_0x372f45(0x1af)](_0x209847[_0x372f45(0x1df)](_0x10b45c+0x1)[_0x372f45(0x1bb)]());continue;}}_0x3ddc3b[_0x372f45(0x1af)](_0x209847);}const _0x8ca53e=[],_0xc2f5c3=Object[_0x372f45(0x1b3)](_0x437060);if(_0xc2f5c3[_0x372f45(0x19d)]>0x0){const _0x2f3aca=0x14,_0x3651b8=_0xc2f5c3['slice'](0x0,_0x2f3aca);for(const _0x13e547 of _0x3651b8){const _0x4bc7d6=_0x437060[_0x13e547];if(_0x4bc7d6[_0x372f45(0x19d)]<=0x3)for(const _0x474f49 of _0x4bc7d6){_0x8ca53e[_0x372f45(0x1af)](_0x13e547+':\x20'+_0x474f49);}else _0x8ca53e[_0x372f45(0x1af)](_0x13e547+':\x20'+_0x4bc7d6[0x0]),_0x8ca53e[_0x372f45(0x1af)](_0x13e547+_0x372f45(0x17e)+_0x4bc7d6['length']+'\x20matches\x20in\x20this\x20file)');}_0xc2f5c3[_0x372f45(0x19d)]>_0x2f3aca&&_0x8ca53e['push'](_0x372f45(0x18a)+(_0xc2f5c3[_0x372f45(0x19d)]-_0x2f3aca)+_0x372f45(0x1a3));}if(_0x3ddc3b[_0x372f45(0x19d)]>0x0){const _0x3f97d4=0x1e;_0x8ca53e[_0x372f45(0x1af)](..._0x3ddc3b[_0x372f45(0x164)](0x0,_0x3f97d4)),_0x3ddc3b[_0x372f45(0x19d)]>_0x3f97d4&&_0x8ca53e[_0x372f45(0x1af)](_0x372f45(0x18a)+(_0x3ddc3b[_0x372f45(0x19d)]-_0x3f97d4)+_0x372f45(0x1f6));}const _0x4cdc9c=_0x2d81d3['length'];return _0x8ca53e[_0x372f45(0x1af)]('\x0a('+_0x4cdc9c+'\x20matches\x20across\x20'+(_0xc2f5c3[_0x372f45(0x19d)]||'?')+_0x372f45(0x1c4)),_0x8ca53e[_0x372f45(0x1b4)]('\x0a');}function filterFind(_0x4b1f60){const _0xaa8187=a0_0x16b6a4,_0x54c42e=_0x4b1f60[_0xaa8187(0x184)]('\x0a')[_0xaa8187(0x1e3)](_0x241174=>_0x241174[_0xaa8187(0x1bb)]()[_0xaa8187(0x19d)]>0x0);if(_0x54c42e[_0xaa8187(0x19d)]===0x0)return _0xaa8187(0x1c2);if(_0x54c42e[_0xaa8187(0x19d)]<=0x32)return _0x4b1f60[_0xaa8187(0x1bb)]();const _0x52fd9e={};for(const _0x33226 of _0x54c42e){const _0x1116c9=path['dirname'](_0x33226['trim']())||'.';_0x52fd9e[_0x1116c9]=(_0x52fd9e[_0x1116c9]||0x0)+0x1;}const _0x46d4b6=Object['entries'](_0x52fd9e)[_0xaa8187(0x1b5)]((_0x2cf30e,_0x48aa05)=>_0x48aa05[0x1]-_0x2cf30e[0x1]),_0x43a01a=[_0x54c42e[_0xaa8187(0x19d)]+_0xaa8187(0x1a5)+_0x46d4b6[_0xaa8187(0x19d)]+_0xaa8187(0x1c6),''],_0x19ed7d=0x1e;for(const [_0x526600,_0x979f67]of _0x46d4b6[_0xaa8187(0x164)](0x0,_0x19ed7d)){_0x43a01a['push']('\x20\x20'+_0x526600+_0xaa8187(0x1d4)+_0x979f67+_0xaa8187(0x1c4));}return _0x46d4b6[_0xaa8187(0x19d)]>_0x19ed7d&&_0x43a01a[_0xaa8187(0x1af)](_0xaa8187(0x1ef)+(_0x46d4b6['length']-_0x19ed7d)+_0xaa8187(0x18c)),_0x43a01a[_0xaa8187(0x1b4)]('\x0a');}function a0_0x1f1a(){const _0x5090da=['export\x20','.class','1704704BxtZOj','require(','collapseWhitespace','filterCat','filterGrep','.pyo','[lock\x20file]\x20','.mp4','indexOf','startsWith','cargo.lock','packages','basename','from\x20','6863990lsswSV','filterTree','[code\x20skeleton]\x20','includes',':\x20...\x20(','.bmp','pnpm-lock.yaml','charCodeAt','go.sum','configurable','split','.swift','19736868kxySCd','.obj','defineProperty','.svg','...\x20+','.tgz','\x20more\x20directories','extname','stringify','.jsx','.java','getConfig','skeleton','.webp','__esModule','../tracker','create','.pyc','\x20dependencies,\x20','@param','toLowerCase','import\x20','#include\x20','length','.ttf','[binary\x20file]\x20','package\x20','__createBinding','stripComments','\x20more\x20files\x20with\x20matches','.7z','\x20files\x20found\x20across\x20','Empty\x20directory','floor','getOwnPropertyNames','some','\x20lines)','default','\x0a...\x20[','[minified\x20file]\x20','dependencies','push','prototype','.bin','.dylib','keys','join','sort','.db','11slAbtK','821950lYiiGc','\x20lines\x20total)','3XwqMdV','trim','.wasm','\x20chars\x20(high\x20non-printable\x20ratio\x20—\x20content\x20omitted)','lock','filterFind','3220458moMGdE','getOwnPropertyDescriptor','No\x20files\x20found','.gz','\x20files)','No\x20matches\x20found','\x20directories','match','.mp3','Cargo.lock','__importStar','bun.lockb','.woff','.ico','7aZjCQZ','\x20line(s)\x20(content\x20omitted\x20—\x20not\x20human-readable)','yarn.lock','package-lock.json','parse','.webm','/\x20(','\x20more\x20files','.sqlite3','tracker','.jpg','endsWith','__setModuleDefault','poetry.lock','.pdf','.gif','.ts','substring','.map','.wav','.tar.gz','filter','./generic','\x20directories,\x20','.rar','.eot','.cs','.sqlite','features_enabled','104taYdqX','.dat','.otf','get','\x20\x20...\x20+','\x20chars\x20across\x20','.woff2','path','.min.js','1rZzKZv','\x20lines\x20truncated]\x20...\x0a','\x20more\x20matches','.exe','composer.lock','toLocaleString','.cpp','.png','.avi','total\x20','slice','.dll','9561550iUxUlu','.js','\x20(content\x20omitted\x20—\x20not\x20useful\x20for\x20LLM\x20context)','226107PGaASt'];a0_0x1f1a=function(){return _0x5090da;};return a0_0x1f1a();}
|
package/hooks/claude-hook.js
CHANGED
|
@@ -1,79 +1 @@
|
|
|
1
|
-
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.installClaudeHooks = installClaudeHooks;
|
|
37
|
-
const fs = __importStar(require("fs"));
|
|
38
|
-
const path = __importStar(require("path"));
|
|
39
|
-
const os = __importStar(require("os"));
|
|
40
|
-
function installClaudeHooks() {
|
|
41
|
-
try {
|
|
42
|
-
const claudeHooksDir = path.join(os.homedir(), '.claude', 'hooks');
|
|
43
|
-
if (!fs.existsSync(claudeHooksDir)) {
|
|
44
|
-
fs.mkdirSync(claudeHooksDir, { recursive: true });
|
|
45
|
-
}
|
|
46
|
-
const hookScriptPath = path.join(claudeHooksDir, 'post_tool_use.js');
|
|
47
|
-
const hookCode = `// TrimPrompt Native PostToolUse Hook for Claude Code
|
|
48
|
-
const fs = require('fs');
|
|
49
|
-
const path = require('path');
|
|
50
|
-
const os = require('os');
|
|
51
|
-
|
|
52
|
-
module.exports = async function postToolUse(event) {
|
|
53
|
-
try {
|
|
54
|
-
if (!event || !event.result) return event;
|
|
55
|
-
let contentStr = typeof event.result === 'string' ? event.result : JSON.stringify(event.result);
|
|
56
|
-
if (contentStr.length > 500) {
|
|
57
|
-
const cacheDir = path.join(os.homedir(), '.trimprompt', 'cache');
|
|
58
|
-
if (!fs.existsSync(cacheDir)) fs.mkdirSync(cacheDir, { recursive: true });
|
|
59
|
-
const chunkId = 'chunk_' + Math.random().toString(36).substring(2, 11);
|
|
60
|
-
fs.writeFileSync(path.join(cacheDir, chunkId + '.json'), JSON.stringify({ raw_payload: contentStr, timestamp: new Date().toISOString() }));
|
|
61
|
-
|
|
62
|
-
const snippet = contentStr.substring(0, 200).replace(/\\n/g, ' ');
|
|
63
|
-
const replacement = \`> [!NOTE]\\n> **[TrimPrompt Context Offloaded]** Raw tool output (\${contentStr.length.toLocaleString()} chars) side-cached locally.\\n> Preview: \${snippet}...\\n> Retrieve raw: \`trim retrieve \${chunkId}\`\`;
|
|
64
|
-
|
|
65
|
-
if (typeof event.result === 'string') {
|
|
66
|
-
event.result = replacement;
|
|
67
|
-
} else if (event.result && typeof event.result === 'object') {
|
|
68
|
-
event.result.content = replacement;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
} catch (e) {}
|
|
72
|
-
return event;
|
|
73
|
-
};
|
|
74
|
-
`;
|
|
75
|
-
fs.writeFileSync(hookScriptPath, hookCode, 'utf8');
|
|
76
|
-
}
|
|
77
|
-
catch (err) {
|
|
78
|
-
}
|
|
79
|
-
}
|
|
1
|
+
'use strict';var a0_0x7c96f7=a0_0x28ac;(function(_0x301f63,_0xafecc8){var _0xb67752=a0_0x28ac,_0x18a4b9=_0x301f63();while(!![]){try{var _0x474df9=-parseInt(_0xb67752(0x121))/0x1*(parseInt(_0xb67752(0x122))/0x2)+-parseInt(_0xb67752(0x115))/0x3+parseInt(_0xb67752(0x113))/0x4*(-parseInt(_0xb67752(0x116))/0x5)+parseInt(_0xb67752(0x11c))/0x6*(-parseInt(_0xb67752(0x107))/0x7)+parseInt(_0xb67752(0x111))/0x8+-parseInt(_0xb67752(0x10c))/0x9*(parseInt(_0xb67752(0x11d))/0xa)+-parseInt(_0xb67752(0x10e))/0xb*(-parseInt(_0xb67752(0x118))/0xc);if(_0x474df9===_0xafecc8)break;else _0x18a4b9['push'](_0x18a4b9['shift']());}catch(_0x2ea1b1){_0x18a4b9['push'](_0x18a4b9['shift']());}}}(a0_0x418c,0xdc513));function a0_0x418c(){var _0x3d6f13=['9CzsPuR','utf8','227436Ardihw','__importStar','default','5035432AcGvOP','.claude','284gNuXIz','writeFileSync','714291QKDpie','9245NBlxzG','getOwnPropertyDescriptor','1824GZlZts','getOwnPropertyNames','configurable','path','1902LYaWDS','10622510XvQlcA','hooks','get','hasOwnProperty','42869uVgzIC','66mbkZzp','writable','mkdirSync','installClaudeHooks','__esModule','__createBinding','518RdwkQf','length','create','join','//\x20TrimPrompt\x20Native\x20PostToolUse\x20Hook\x20for\x20Claude\x20Code\x0aconst\x20fs\x20=\x20require(\x27fs\x27);\x0aconst\x20path\x20=\x20require(\x27path\x27);\x0aconst\x20os\x20=\x20require(\x27os\x27);\x0a\x0amodule.exports\x20=\x20async\x20function\x20postToolUse(event)\x20{\x0a\x20\x20try\x20{\x0a\x20\x20\x20\x20if\x20(!event\x20||\x20!event.result)\x20return\x20event;\x0a\x20\x20\x20\x20let\x20contentStr\x20=\x20typeof\x20event.result\x20===\x20\x27string\x27\x20?\x20event.result\x20:\x20JSON.stringify(event.result);\x0a\x20\x20\x20\x20if\x20(contentStr.length\x20>\x20500)\x20{\x0a\x20\x20\x20\x20\x20\x20const\x20cacheDir\x20=\x20path.join(os.homedir(),\x20\x27.trimprompt\x27,\x20\x27cache\x27);\x0a\x20\x20\x20\x20\x20\x20if\x20(!fs.existsSync(cacheDir))\x20fs.mkdirSync(cacheDir,\x20{\x20recursive:\x20true\x20});\x0a\x20\x20\x20\x20\x20\x20const\x20chunkId\x20=\x20\x27chunk_\x27\x20+\x20Math.random().toString(36).substring(2,\x2011);\x0a\x20\x20\x20\x20\x20\x20fs.writeFileSync(path.join(cacheDir,\x20chunkId\x20+\x20\x27.json\x27),\x20JSON.stringify({\x20raw_payload:\x20contentStr,\x20timestamp:\x20new\x20Date().toISOString()\x20}));\x0a\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20const\x20snippet\x20=\x20contentStr.substring(0,\x20200).replace(/\x5cn/g,\x20\x27\x20\x27);\x0a\x20\x20\x20\x20\x20\x20const\x20replacement\x20=\x20`>\x20[!NOTE]\x5cn>\x20**[TrimPrompt\x20Context\x20Offloaded]**\x20Raw\x20tool\x20output\x20(${contentStr.length.toLocaleString()}\x20chars)\x20side-cached\x20locally.\x5cn>\x20Preview:\x20${snippet}...\x5cn>\x20Retrieve\x20raw:\x20`trim\x20retrieve\x20${chunkId}``;\x0a\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20if\x20(typeof\x20event.result\x20===\x20\x27string\x27)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20event.result\x20=\x20replacement;\x0a\x20\x20\x20\x20\x20\x20}\x20else\x20if\x20(event.result\x20&&\x20typeof\x20event.result\x20===\x20\x27object\x27)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20event.result.content\x20=\x20replacement;\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x20catch\x20(e)\x20{}\x0a\x20\x20return\x20event;\x0a};\x0a'];a0_0x418c=function(){return _0x3d6f13;};return a0_0x418c();}function a0_0x28ac(_0x2a7760,_0x5c2c02){var _0x418c93=a0_0x418c();return a0_0x28ac=function(_0x28acc7,_0x39be35){_0x28acc7=_0x28acc7-0x103;var _0x2c6be2=_0x418c93[_0x28acc7];return _0x2c6be2;},a0_0x28ac(_0x2a7760,_0x5c2c02);}var __createBinding=this&&this[a0_0x7c96f7(0x106)]||(Object[a0_0x7c96f7(0x109)]?function(_0xb64f9c,_0x108a05,_0x35ac34,_0x36b0eb){var _0x3145a5=a0_0x7c96f7;if(_0x36b0eb===undefined)_0x36b0eb=_0x35ac34;var _0x2d0aae=Object[_0x3145a5(0x117)](_0x108a05,_0x35ac34);(!_0x2d0aae||(_0x3145a5(0x11f)in _0x2d0aae?!_0x108a05[_0x3145a5(0x105)]:_0x2d0aae[_0x3145a5(0x123)]||_0x2d0aae[_0x3145a5(0x11a)]))&&(_0x2d0aae={'enumerable':!![],'get':function(){return _0x108a05[_0x35ac34];}}),Object['defineProperty'](_0xb64f9c,_0x36b0eb,_0x2d0aae);}:function(_0x3388a2,_0x40bcc3,_0x135f2a,_0x2290de){if(_0x2290de===undefined)_0x2290de=_0x135f2a;_0x3388a2[_0x2290de]=_0x40bcc3[_0x135f2a];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object[a0_0x7c96f7(0x109)]?function(_0x3cdbe1,_0x29258b){var _0x35109a=a0_0x7c96f7;Object['defineProperty'](_0x3cdbe1,_0x35109a(0x110),{'enumerable':!![],'value':_0x29258b});}:function(_0x181182,_0x51a3e4){var _0x37e02b=a0_0x7c96f7;_0x181182[_0x37e02b(0x110)]=_0x51a3e4;}),__importStar=this&&this[a0_0x7c96f7(0x10f)]||(function(){var _0x83a32e=function(_0x49ce8d){var _0x404f76=a0_0x28ac;return _0x83a32e=Object[_0x404f76(0x119)]||function(_0x129c01){var _0x343b3c=_0x404f76,_0x4ae22b=[];for(var _0x591107 in _0x129c01)if(Object['prototype'][_0x343b3c(0x120)]['call'](_0x129c01,_0x591107))_0x4ae22b[_0x4ae22b['length']]=_0x591107;return _0x4ae22b;},_0x83a32e(_0x49ce8d);};return function(_0x4f4bc1){var _0x3bd7a7=a0_0x28ac;if(_0x4f4bc1&&_0x4f4bc1[_0x3bd7a7(0x105)])return _0x4f4bc1;var _0x1251ca={};if(_0x4f4bc1!=null){for(var _0x36f46f=_0x83a32e(_0x4f4bc1),_0x24b361=0x0;_0x24b361<_0x36f46f[_0x3bd7a7(0x108)];_0x24b361++)if(_0x36f46f[_0x24b361]!==_0x3bd7a7(0x110))__createBinding(_0x1251ca,_0x4f4bc1,_0x36f46f[_0x24b361]);}return __setModuleDefault(_0x1251ca,_0x4f4bc1),_0x1251ca;};}());Object['defineProperty'](exports,a0_0x7c96f7(0x105),{'value':!![]}),exports[a0_0x7c96f7(0x104)]=installClaudeHooks;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x7c96f7(0x11b))),os=__importStar(require('os'));function installClaudeHooks(){var _0x4b11da=a0_0x7c96f7;try{const _0x3e21dd=path[_0x4b11da(0x10a)](os['homedir'](),_0x4b11da(0x112),_0x4b11da(0x11e));!fs['existsSync'](_0x3e21dd)&&fs[_0x4b11da(0x103)](_0x3e21dd,{'recursive':!![]});const _0x101266=path[_0x4b11da(0x10a)](_0x3e21dd,'post_tool_use.js'),_0x2e00e6=_0x4b11da(0x10b);fs[_0x4b11da(0x114)](_0x101266,_0x2e00e6,_0x4b11da(0x10d));}catch(_0x3f10a0){}}
|
package/index.html
CHANGED
|
@@ -799,75 +799,6 @@
|
|
|
799
799
|
]},
|
|
800
800
|
];
|
|
801
801
|
|
|
802
|
-
let proxyRunning = false;
|
|
803
|
-
// Cache last-rendered proxy HTML so the periodic full rebuild of the CSA list
|
|
804
|
-
// can repaint these async-filled areas instantly instead of flashing empty.
|
|
805
|
-
let lastProxyToggleHtml = '';
|
|
806
|
-
let lastProxySavingsHtml = '';
|
|
807
|
-
|
|
808
|
-
async function updateProxyToggle() {
|
|
809
|
-
const area = document.getElementById('proxy-toggle-area');
|
|
810
|
-
if (!area) return;
|
|
811
|
-
try {
|
|
812
|
-
const resp = await fetch('/api/proxy/status');
|
|
813
|
-
const status = await resp.json();
|
|
814
|
-
proxyRunning = status.running;
|
|
815
|
-
const color = proxyRunning ? 'var(--emerald)' : '#64748B';
|
|
816
|
-
const label = proxyRunning ? `Running on port ${status.port}` : 'Stopped';
|
|
817
|
-
const html = `
|
|
818
|
-
<span style="display:inline-flex;align-items:center;gap:8px;font-family:'Inter',sans-serif;font-size:12px;font-weight:500;text-transform:none;letter-spacing:0;">
|
|
819
|
-
<span style="color:${color};">${label}</span>
|
|
820
|
-
<label class="csa-toggle" style="transform:scale(0.85);">
|
|
821
|
-
<input type="checkbox" ${proxyRunning ? 'checked' : ''} onchange="toggleProxy(this.checked)">
|
|
822
|
-
<span class="slider"></span>
|
|
823
|
-
</label>
|
|
824
|
-
</span>`;
|
|
825
|
-
// Only touch the DOM when the markup actually changed, to avoid flicker.
|
|
826
|
-
if (html !== lastProxyToggleHtml) {
|
|
827
|
-
lastProxyToggleHtml = html;
|
|
828
|
-
area.innerHTML = html;
|
|
829
|
-
}
|
|
830
|
-
} catch { }
|
|
831
|
-
}
|
|
832
|
-
|
|
833
|
-
async function updateProxySavings() {
|
|
834
|
-
const card = document.getElementById('proxy-savings-card');
|
|
835
|
-
if (!card) return;
|
|
836
|
-
try {
|
|
837
|
-
const model = document.getElementById('model-select').value;
|
|
838
|
-
const resp = await fetch('/api/stats/proxy-summary?model=' + encodeURIComponent(model));
|
|
839
|
-
const s = await resp.json();
|
|
840
|
-
const cell = (label, val, color) =>
|
|
841
|
-
`<div style="flex:1;text-align:center;padding:10px 6px;">
|
|
842
|
-
<div style="font-size:18px;font-weight:700;color:${color};font-family:'Inter',sans-serif;">${val}</div>
|
|
843
|
-
<div style="font-size:10px;color:#64748B;text-transform:uppercase;letter-spacing:0.5px;margin-top:2px;">${label}</div>
|
|
844
|
-
</div>`;
|
|
845
|
-
const html = `
|
|
846
|
-
<div style="display:flex;gap:8px;margin:10px 0 14px;background:rgba(127,119,221,0.06);border:1px solid rgba(127,119,221,0.18);border-radius:10px;">
|
|
847
|
-
${cell('Requests', (s.requests || 0).toLocaleString(), '#7F77DD')}
|
|
848
|
-
${cell('Tokens Saved', (s.total_tokens_saved || 0).toLocaleString(), '#10B981')}
|
|
849
|
-
${cell('Saved', '$' + (s.money_saved_usd || 0).toFixed(2), '#10B981')}
|
|
850
|
-
${cell('Reduction', (s.savings_percentage || 0) + '%', 'var(--indigo)')}
|
|
851
|
-
</div>`;
|
|
852
|
-
// Only touch the DOM when the markup actually changed, to avoid flicker.
|
|
853
|
-
if (html !== lastProxySavingsHtml) {
|
|
854
|
-
lastProxySavingsHtml = html;
|
|
855
|
-
card.innerHTML = html;
|
|
856
|
-
}
|
|
857
|
-
} catch { }
|
|
858
|
-
}
|
|
859
|
-
|
|
860
|
-
async function toggleProxy(enable) {
|
|
861
|
-
try {
|
|
862
|
-
if (enable) {
|
|
863
|
-
await fetch('/api/proxy/start', { method: 'POST' });
|
|
864
|
-
} else {
|
|
865
|
-
await fetch('/api/proxy/stop', { method: 'POST' });
|
|
866
|
-
}
|
|
867
|
-
setTimeout(updateProxyToggle, 500);
|
|
868
|
-
} catch {}
|
|
869
|
-
}
|
|
870
|
-
|
|
871
802
|
let csaOpen = false;
|
|
872
803
|
function toggleCsa() {
|
|
873
804
|
csaOpen = !csaOpen;
|
|
@@ -1028,10 +959,6 @@
|
|
|
1028
959
|
const totalCount = CSA_FEATURES.reduce((s, c) => s + c.features.length, 0);
|
|
1029
960
|
document.getElementById('csa-count-badge').textContent = `${activeCount}/${totalCount} active`;
|
|
1030
961
|
|
|
1031
|
-
// Proxy toggle + dedicated savings card
|
|
1032
|
-
updateProxyToggle();
|
|
1033
|
-
updateProxySavings();
|
|
1034
|
-
|
|
1035
962
|
document.getElementById('csa-summary').innerHTML = `
|
|
1036
963
|
<div class="csa-summary-card">
|
|
1037
964
|
<div class="csa-sum-label">Tokens Saved</div>
|