@tyvm/knowhow 0.0.60 → 0.0.62
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/package.json +1 -1
- package/src/agents/setup/setup.ts +9 -2
- package/src/agents/tools/textSearch.ts +4 -1
- package/src/chat/CliChatService.ts +5 -6
- package/src/chat/modules/SystemModule.ts +1 -1
- package/src/clients/anthropic.ts +12 -0
- package/src/config.ts +5 -0
- package/src/plugins/language.ts +4 -0
- package/src/processors/JsonCompressor.ts +496 -0
- package/src/processors/TokenCompressor.ts +194 -125
- package/src/processors/index.ts +1 -0
- package/src/services/Mcp.ts +1 -0
- package/src/services/Tools.ts +5 -3
- package/src/types.ts +1 -0
- package/src/utils/InputQueueManager.ts +119 -95
- package/tests/compressor/bigstring.test.ts +352 -2
- package/tests/compressor/githubjson.txt +1 -0
- package/ts_build/package.json +1 -1
- package/ts_build/src/agents/setup/setup.js +9 -2
- package/ts_build/src/agents/setup/setup.js.map +1 -1
- package/ts_build/src/agents/tools/textSearch.js +2 -1
- package/ts_build/src/agents/tools/textSearch.js.map +1 -1
- package/ts_build/src/chat/CliChatService.d.ts +1 -1
- package/ts_build/src/chat/CliChatService.js +6 -6
- package/ts_build/src/chat/CliChatService.js.map +1 -1
- package/ts_build/src/chat/modules/SystemModule.js +1 -1
- package/ts_build/src/chat/modules/SystemModule.js.map +1 -1
- package/ts_build/src/clients/anthropic.js +12 -0
- package/ts_build/src/clients/anthropic.js.map +1 -1
- package/ts_build/src/config.js +5 -0
- package/ts_build/src/config.js.map +1 -1
- package/ts_build/src/plugins/language.js +4 -0
- package/ts_build/src/plugins/language.js.map +1 -1
- package/ts_build/src/processors/JsonCompressor.d.ts +36 -0
- package/ts_build/src/processors/JsonCompressor.js +295 -0
- package/ts_build/src/processors/JsonCompressor.js.map +1 -0
- package/ts_build/src/processors/TokenCompressor.d.ts +23 -5
- package/ts_build/src/processors/TokenCompressor.js +106 -70
- package/ts_build/src/processors/TokenCompressor.js.map +1 -1
- package/ts_build/src/processors/index.d.ts +1 -0
- package/ts_build/src/processors/index.js +3 -1
- package/ts_build/src/processors/index.js.map +1 -1
- package/ts_build/src/services/Mcp.js.map +1 -1
- package/ts_build/src/services/Tools.js +1 -1
- package/ts_build/src/services/Tools.js.map +1 -1
- package/ts_build/src/types.d.ts +1 -0
- package/ts_build/src/types.js +1 -0
- package/ts_build/src/types.js.map +1 -1
- package/ts_build/src/utils/InputQueueManager.d.ts +4 -1
- package/ts_build/src/utils/InputQueueManager.js +93 -78
- package/ts_build/src/utils/InputQueueManager.js.map +1 -1
- package/ts_build/tests/compressor/bigstring.test.js +209 -0
- package/ts_build/tests/compressor/bigstring.test.js.map +1 -1
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { readFile } from "../../src/utils";
|
|
2
|
-
import { TokenCompressor } from "../../src/processors/TokenCompressor";
|
|
2
|
+
import { TokenCompressor, KeyInfo } from "../../src/processors/TokenCompressor";
|
|
3
3
|
import { services } from "../../src/services";
|
|
4
|
+
import { Message } from "../../src/clients/types";
|
|
4
5
|
|
|
5
6
|
describe("TokenCompressor - Large File Test", () => {
|
|
6
7
|
let tokenCompressor: TokenCompressor;
|
|
7
8
|
const bigstringPath = "tests/compressor/bigstring.txt";
|
|
9
|
+
const jsonPath = "tests/compressor/githubjson.txt";
|
|
8
10
|
|
|
9
11
|
beforeAll(() => {
|
|
10
12
|
const { Tools } = services();
|
|
@@ -64,7 +66,9 @@ describe("TokenCompressor - Large File Test", () => {
|
|
|
64
66
|
// Remove the NEXT_CHUNK_KEY marker and add content
|
|
65
67
|
const nextKey = nextKeyMatch[1];
|
|
66
68
|
const retrieved = await tokenCompressor.retrieveString(nextKey);
|
|
67
|
-
console.log(
|
|
69
|
+
console.log(
|
|
70
|
+
`Retrieved chunk ${chunkCount} with key: ${nextKey}, length: ${retrieved.length}`
|
|
71
|
+
);
|
|
68
72
|
} else {
|
|
69
73
|
// Last chunk
|
|
70
74
|
reconstructed += currentChunk;
|
|
@@ -97,4 +101,350 @@ describe("TokenCompressor - Large File Test", () => {
|
|
|
97
101
|
const compressionRatio = compressed.length / fileContents.length;
|
|
98
102
|
expect(compressionRatio).toBeLessThan(0.01); // Less than 1% of original size
|
|
99
103
|
});
|
|
104
|
+
|
|
105
|
+
test("should handle json compression", async () => {
|
|
106
|
+
const fileBuffer = await readFile(jsonPath);
|
|
107
|
+
const fileContents = fileBuffer.toString();
|
|
108
|
+
|
|
109
|
+
// Test that it compresses when above threshold
|
|
110
|
+
const estimatedTokens = Math.ceil(fileContents.length / 4);
|
|
111
|
+
expect(estimatedTokens).toBeGreaterThan(4000); // Default threshold
|
|
112
|
+
|
|
113
|
+
const compressed = tokenCompressor.compressContent(fileContents);
|
|
114
|
+
|
|
115
|
+
console.log({ compressedJson: compressed });
|
|
116
|
+
|
|
117
|
+
// Should return JSON object (not a string marker) for MCP format
|
|
118
|
+
const compressedObj = JSON.parse(compressed);
|
|
119
|
+
expect(compressedObj._mcp_format).toBe(true);
|
|
120
|
+
expect(compressedObj._data).toBeDefined();
|
|
121
|
+
expect(compressedObj._schema_key).toBeDefined();
|
|
122
|
+
|
|
123
|
+
// The compression should result in a smaller representation
|
|
124
|
+
const compressionRatio = compressed.length / fileContents.length;
|
|
125
|
+
expect(compressionRatio).toBeLessThan(0.5); // Less than 50% of original size
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
test("should detect json", async () => {
|
|
129
|
+
const fileBuffer = await readFile(jsonPath);
|
|
130
|
+
const fileContents = fileBuffer.toString();
|
|
131
|
+
|
|
132
|
+
const compressed = tokenCompressor.tryParseJson(fileContents);
|
|
133
|
+
|
|
134
|
+
expect(compressed).toBeTruthy();
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
test("should analyze githubjson.txt compression with key chain utilities", async () => {
|
|
138
|
+
const fileBuffer = await readFile(jsonPath);
|
|
139
|
+
const fileContents = fileBuffer.toString();
|
|
140
|
+
|
|
141
|
+
console.log(`\n=== GitHub JSON Compression Analysis ===`);
|
|
142
|
+
console.log(`Original file size: ${fileContents.length} characters`);
|
|
143
|
+
console.log(`Estimated tokens: ${Math.ceil(fileContents.length / 4)}`);
|
|
144
|
+
|
|
145
|
+
// Compress the content
|
|
146
|
+
const compressed = tokenCompressor.compressContent(fileContents);
|
|
147
|
+
|
|
148
|
+
console.log(
|
|
149
|
+
`\nCompressed representation length: ${compressed.length} characters`
|
|
150
|
+
);
|
|
151
|
+
console.log(`\nCompressed output:\n${compressed.substring(0, 500)}...\n`);
|
|
152
|
+
|
|
153
|
+
// Extract root keys from the compressed output
|
|
154
|
+
const rootKeys = tokenCompressor.extractKeys(compressed);
|
|
155
|
+
console.log(`\nRoot keys found: ${rootKeys.length}`);
|
|
156
|
+
console.log(`Keys: ${rootKeys.join(", ")}\n`);
|
|
157
|
+
|
|
158
|
+
expect(rootKeys.length).toBeGreaterThan(0);
|
|
159
|
+
|
|
160
|
+
// Analyze the key chain for each root key
|
|
161
|
+
for (const rootKey of rootKeys) {
|
|
162
|
+
console.log(`\n--- Analyzing key chain for: ${rootKey} ---`);
|
|
163
|
+
const keyChain = tokenCompressor.getKeyChain(rootKey);
|
|
164
|
+
|
|
165
|
+
console.log(`Total keys in chain: ${keyChain.length}`);
|
|
166
|
+
|
|
167
|
+
// Group keys by depth
|
|
168
|
+
const byDepth = keyChain.reduce((acc, info) => {
|
|
169
|
+
if (!acc[info.depth]) {
|
|
170
|
+
acc[info.depth] = [];
|
|
171
|
+
}
|
|
172
|
+
acc[info.depth].push(info);
|
|
173
|
+
return acc;
|
|
174
|
+
}, {} as Record<number, KeyInfo[]>);
|
|
175
|
+
|
|
176
|
+
console.log(`\nKeys by depth:`);
|
|
177
|
+
for (const [depth, infos] of Object.entries(byDepth)) {
|
|
178
|
+
console.log(` Depth ${depth}: ${infos.length} keys`);
|
|
179
|
+
for (const info of infos) {
|
|
180
|
+
console.log(` - ${info.key}:`);
|
|
181
|
+
console.log(
|
|
182
|
+
` Size: ${info.size} chars (${info.tokens} tokens)`
|
|
183
|
+
);
|
|
184
|
+
console.log(` Type: ${info.type}`);
|
|
185
|
+
console.log(` Child keys: ${info.childKeys.length}`);
|
|
186
|
+
if (info.nextChunkKey) {
|
|
187
|
+
console.log(` Next chunk: ${info.nextChunkKey}`);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// Verify chunk sizes are reasonable
|
|
193
|
+
for (const info of keyChain) {
|
|
194
|
+
const data = await tokenCompressor.retrieveString(info.key);
|
|
195
|
+
console.log({ data });
|
|
196
|
+
|
|
197
|
+
// Chunks should not be unnecessarily small (at least 25% of threshold unless it's the last chunk)
|
|
198
|
+
// Allow smaller chunks for next_chunk types at the end of chains
|
|
199
|
+
if (info.type === "child") {
|
|
200
|
+
expect(info.tokens).toBeGreaterThan(1000); // Child chunks should be substantial
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// Chunks should not exceed the max tokens significantly
|
|
204
|
+
expect(info.tokens).toBeLessThan(tokenCompressor.maxTokens * 1.5);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// Calculate total size
|
|
208
|
+
const totalSize = keyChain.reduce((sum, info) => sum + info.size, 0);
|
|
209
|
+
const totalTokens = keyChain.reduce((sum, info) => sum + info.tokens, 0);
|
|
210
|
+
console.log(
|
|
211
|
+
`\nTotal stored size: ${totalSize} characters (${totalTokens} tokens)`
|
|
212
|
+
);
|
|
213
|
+
console.log(
|
|
214
|
+
`Storage efficiency: Stored ${keyChain.length} chunks for original content`
|
|
215
|
+
);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// Verify storage state
|
|
219
|
+
console.log(`\n=== Storage State ===`);
|
|
220
|
+
console.log(`Total keys in storage: ${tokenCompressor.getStorageSize()}`);
|
|
221
|
+
console.log(
|
|
222
|
+
`All storage keys: ${tokenCompressor.getStorageKeys().join(", ")}`
|
|
223
|
+
);
|
|
224
|
+
|
|
225
|
+
expect(tokenCompressor.getStorageSize()).toBeGreaterThan(0);
|
|
226
|
+
|
|
227
|
+
// Test extractKeys utility - with new schema format, compressed is a JSON object
|
|
228
|
+
// Parse it to find actual data keys
|
|
229
|
+
const parsedCompressed = tokenCompressor.tryParseJson(compressed);
|
|
230
|
+
expect(parsedCompressed).toBeTruthy();
|
|
231
|
+
|
|
232
|
+
// Look for keys in the parsed structure
|
|
233
|
+
let dataKeys: string[] = [];
|
|
234
|
+
if (parsedCompressed && typeof parsedCompressed === "object") {
|
|
235
|
+
// Extract all keys from the object recursively
|
|
236
|
+
const extractAllKeys = (obj: any): string[] => {
|
|
237
|
+
const keys: string[] = [];
|
|
238
|
+
const str = JSON.stringify(obj);
|
|
239
|
+
keys.push(...tokenCompressor.extractKeys(str));
|
|
240
|
+
return keys;
|
|
241
|
+
};
|
|
242
|
+
dataKeys = extractAllKeys(parsedCompressed);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
console.log(`\nKeys found in compressed structure: ${dataKeys.length}`);
|
|
246
|
+
const storedContent =
|
|
247
|
+
dataKeys.length > 0 ? tokenCompressor.retrieveString(dataKeys[0]) : null;
|
|
248
|
+
|
|
249
|
+
const embeddedKeys = tokenCompressor.extractKeys(storedContent!);
|
|
250
|
+
console.log(
|
|
251
|
+
`\nKeys embedded in first stored chunk: ${embeddedKeys.length}`
|
|
252
|
+
);
|
|
253
|
+
if (embeddedKeys.length > 0) {
|
|
254
|
+
console.log(`Embedded keys: ${embeddedKeys.join(", ")}`);
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
test("should demonstrate improved compression with schema and low-signal detection", async () => {
|
|
259
|
+
const fileBuffer = await readFile(jsonPath);
|
|
260
|
+
const fileContents = fileBuffer.toString();
|
|
261
|
+
|
|
262
|
+
console.log(`\n=== Compression Performance Analysis ===`);
|
|
263
|
+
console.log(`Original file size: ${fileContents.length} characters`);
|
|
264
|
+
console.log(`Estimated tokens: ${Math.ceil(fileContents.length / 4)}`);
|
|
265
|
+
|
|
266
|
+
// Compress the content
|
|
267
|
+
const compressed = tokenCompressor.compressContent(fileContents);
|
|
268
|
+
|
|
269
|
+
console.log(`\nCompressed representation: ${compressed.length} characters`);
|
|
270
|
+
const compressionRatio = (
|
|
271
|
+
(1 - compressed.length / fileContents.length) *
|
|
272
|
+
100
|
|
273
|
+
).toFixed(2);
|
|
274
|
+
console.log(`Compression ratio: ${compressionRatio}%`);
|
|
275
|
+
|
|
276
|
+
// Parse the compressed output
|
|
277
|
+
console.log(
|
|
278
|
+
`\nCompressed output preview:\n${compressed.substring(0, 800)}`
|
|
279
|
+
);
|
|
280
|
+
|
|
281
|
+
const compressedObj = JSON.parse(compressed);
|
|
282
|
+
|
|
283
|
+
console.log(`\n=== Schema Information ===`);
|
|
284
|
+
if (compressedObj._schema_key) {
|
|
285
|
+
console.log(`Schema key found: ${compressedObj._schema_key}`);
|
|
286
|
+
// The _schema_key already includes the full key with _schema suffix
|
|
287
|
+
const schema = tokenCompressor.retrieveString(compressedObj._schema_key);
|
|
288
|
+
if (schema) {
|
|
289
|
+
console.log(`Schema structure:`);
|
|
290
|
+
console.log(JSON.stringify(schema, null, 2).substring(0, 1000));
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
console.log(`\n=== Low-Signal Property Compression ===`);
|
|
295
|
+
// Check first item in the data array for compression metadata
|
|
296
|
+
if (compressedObj._data && Array.isArray(compressedObj._data)) {
|
|
297
|
+
const firstItem = compressedObj._data[0];
|
|
298
|
+
if (
|
|
299
|
+
typeof firstItem === "string" &&
|
|
300
|
+
firstItem.includes("COMPRESSED_JSON")
|
|
301
|
+
) {
|
|
302
|
+
// Extract the key and retrieve the object
|
|
303
|
+
const keyMatch = firstItem.match(/Key: (compressed_[a-z0-9_]+)/);
|
|
304
|
+
if (keyMatch) {
|
|
305
|
+
const itemKey = keyMatch[1];
|
|
306
|
+
const itemData = tokenCompressor.retrieveString(itemKey);
|
|
307
|
+
if (itemData) {
|
|
308
|
+
const item = JSON.parse(itemData);
|
|
309
|
+
const innerItem = JSON.parse(item.text);
|
|
310
|
+
|
|
311
|
+
// Check for compressed properties in array items
|
|
312
|
+
if (Array.isArray(innerItem)) {
|
|
313
|
+
const sampleItem = innerItem[0];
|
|
314
|
+
if (sampleItem._compressed_properties_key) {
|
|
315
|
+
console.log(
|
|
316
|
+
`Sample item has ${sampleItem._compressed_property_names.length} compressed properties`
|
|
317
|
+
);
|
|
318
|
+
console.log(
|
|
319
|
+
`Compressed properties: ${sampleItem._compressed_property_names
|
|
320
|
+
.slice(0, 10)
|
|
321
|
+
.join(", ")}...`
|
|
322
|
+
);
|
|
323
|
+
console.log(`Info: ${sampleItem._compression_info}`);
|
|
324
|
+
|
|
325
|
+
// Retrieve the compressed properties
|
|
326
|
+
const compressedProps = tokenCompressor.getCompressedProperties(
|
|
327
|
+
sampleItem._compressed_properties_key
|
|
328
|
+
);
|
|
329
|
+
if (compressedProps) {
|
|
330
|
+
const propNames = Object.keys(
|
|
331
|
+
compressedProps.compressed_properties
|
|
332
|
+
);
|
|
333
|
+
console.log(
|
|
334
|
+
`\nRetrieved ${propNames.length} compressed properties successfully`
|
|
335
|
+
);
|
|
336
|
+
console.log(
|
|
337
|
+
`Sample compressed property keys: ${propNames
|
|
338
|
+
.slice(0, 5)
|
|
339
|
+
.join(", ")}`
|
|
340
|
+
);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
console.log(`\n=== Storage Analysis ===`);
|
|
350
|
+
const totalKeys = tokenCompressor.getStorageSize();
|
|
351
|
+
console.log(`Total storage keys: ${totalKeys}`);
|
|
352
|
+
|
|
353
|
+
// Calculate total stored size
|
|
354
|
+
let totalStoredSize = 0;
|
|
355
|
+
for (const key of tokenCompressor.getStorageKeys()) {
|
|
356
|
+
const data = tokenCompressor.retrieveString(key);
|
|
357
|
+
if (data) {
|
|
358
|
+
totalStoredSize += data.length;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
console.log(`Total stored data: ${totalStoredSize} characters`);
|
|
363
|
+
console.log(`Compressed representation: ${compressed.length} characters`);
|
|
364
|
+
console.log(
|
|
365
|
+
`Storage overhead ratio: ${(
|
|
366
|
+
(totalStoredSize / fileContents.length) *
|
|
367
|
+
100
|
|
368
|
+
).toFixed(2)}%`
|
|
369
|
+
);
|
|
370
|
+
console.log(`Initial view compression: ${compressionRatio}%`);
|
|
371
|
+
|
|
372
|
+
// Verify we achieved good compression (showing first instance for usability)
|
|
373
|
+
expect(parseFloat(compressionRatio)).toBeGreaterThan(60); // At least 60% compression
|
|
374
|
+
|
|
375
|
+
// Verify schema is accessible
|
|
376
|
+
if (compressedObj._schema_key) {
|
|
377
|
+
const schema = tokenCompressor.retrieveString(compressedObj._schema_key);
|
|
378
|
+
expect(schema).toBeTruthy();
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
// Verify low-signal compression happened
|
|
382
|
+
expect(totalKeys).toBeGreaterThan(5); // Should have multiple compression keys
|
|
383
|
+
|
|
384
|
+
console.log(`\n✓ Compression improvements verified!`);
|
|
385
|
+
});
|
|
386
|
+
|
|
387
|
+
test("should not double-compress already compressed content", async () => {
|
|
388
|
+
// Load the githubjson.txt which contains a Message object
|
|
389
|
+
const fileBuffer = await readFile(jsonPath);
|
|
390
|
+
const fileContents = fileBuffer.toString();
|
|
391
|
+
|
|
392
|
+
console.log(`\n=== Testing Double Compression Prevention ===`);
|
|
393
|
+
console.log(`Original file size: ${fileContents.length} characters`);
|
|
394
|
+
|
|
395
|
+
// Parse the message from the file
|
|
396
|
+
const message = JSON.parse(fileContents) as Message;
|
|
397
|
+
|
|
398
|
+
// Create a copy of the message to compress
|
|
399
|
+
const messageToCompress: Message = JSON.parse(JSON.stringify(message));
|
|
400
|
+
|
|
401
|
+
// First compression
|
|
402
|
+
await tokenCompressor.compressMessage(messageToCompress);
|
|
403
|
+
|
|
404
|
+
const firstCompression = (messageToCompress.content as any[])[0].text;
|
|
405
|
+
console.log(`\nAfter first compression: ${firstCompression.length} characters`);
|
|
406
|
+
console.log(`First compression preview:\n${firstCompression.substring(0, 300)}...`);
|
|
407
|
+
|
|
408
|
+
// Parse the first compression result
|
|
409
|
+
const firstParsed = tokenCompressor.tryParseJson(firstCompression);
|
|
410
|
+
expect(firstParsed).toBeTruthy();
|
|
411
|
+
expect(firstParsed._schema_key).toBeDefined();
|
|
412
|
+
expect(firstParsed.data).toBeDefined();
|
|
413
|
+
|
|
414
|
+
// Second compression - this should NOT compress again
|
|
415
|
+
await tokenCompressor.compressMessage(messageToCompress);
|
|
416
|
+
|
|
417
|
+
const secondCompression = (messageToCompress.content as any[])[0].text;
|
|
418
|
+
console.log(`\nAfter second compression: ${secondCompression.length} characters`);
|
|
419
|
+
console.log(`Second compression preview:\n${secondCompression.substring(0, 300)}...`);
|
|
420
|
+
|
|
421
|
+
// Parse the second compression result
|
|
422
|
+
const secondParsed = tokenCompressor.tryParseJson(secondCompression);
|
|
423
|
+
expect(secondParsed).toBeTruthy();
|
|
424
|
+
|
|
425
|
+
console.log(`\nSecond parsed structure keys:`, Object.keys(secondParsed));
|
|
426
|
+
console.log(`Full structure:`, JSON.stringify(secondParsed, null, 2).substring(0, 500));
|
|
427
|
+
|
|
428
|
+
// Check if we get the over-compressed bug: only metadata, no data
|
|
429
|
+
const isOverCompressed =
|
|
430
|
+
Object.keys(secondParsed).length === 3 &&
|
|
431
|
+
secondParsed._mcp_format === true &&
|
|
432
|
+
secondParsed._raw_structure !== undefined &&
|
|
433
|
+
secondParsed._schema_key !== undefined;
|
|
434
|
+
|
|
435
|
+
console.log(`\nIs over-compressed: ${isOverCompressed}`);
|
|
436
|
+
|
|
437
|
+
// After the fix, second compression should be identical to first (no re-compression)
|
|
438
|
+
expect(secondCompression).toBe(firstCompression);
|
|
439
|
+
|
|
440
|
+
// Both should have the same structure with data
|
|
441
|
+
expect(secondParsed).toEqual(firstParsed);
|
|
442
|
+
expect(secondParsed.data).toBeDefined();
|
|
443
|
+
expect(Array.isArray(secondParsed.data)).toBe(true);
|
|
444
|
+
|
|
445
|
+
// Should NOT be over-compressed
|
|
446
|
+
expect(isOverCompressed).toBe(false);
|
|
447
|
+
|
|
448
|
+
console.log(`\n✓ Double compression prevention verified!`);
|
|
449
|
+
});
|
|
100
450
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"content":[{"type":"text","text":"[\n {\n \"id\": 111111111,\n \"node_id\": \"MOCK_NODE_ID_001\",\n \"name\": \"gpt-browser\",\n \"full_name\": \"mock-org/gpt-browser\",\n \"private\": true,\n \"owner\": {\n \"login\": \"mock-org\",\n \"id\": 999999999,\n \"node_id\": \"MOCK_ORG_ID\",\n \"avatar_url\": \"https://avatars.mockserver.com/u/999999999\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.mockserver.com/users/mock-org\",\n \"html_url\": \"https://mockserver.com/mock-org\",\n \"followers_url\": \"https://api.mockserver.com/users/mock-org/followers\",\n \"following_url\": \"https://api.mockserver.com/users/mock-org/following{/other_user}\",\n \"gists_url\": \"https://api.mockserver.com/users/mock-org/gists{/gist_id}\",\n \"starred_url\": \"https://api.mockserver.com/users/mock-org/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.mockserver.com/users/mock-org/subscriptions\",\n \"organizations_url\": \"https://api.mockserver.com/users/mock-org/orgs\",\n \"repos_url\": \"https://api.mockserver.com/users/mock-org/repos\",\n \"events_url\": \"https://api.mockserver.com/users/mock-org/events{/privacy}\",\n \"received_events_url\": \"https://api.mockserver.com/users/mock-org/received_events\",\n \"type\": \"Organization\",\n \"user_view_type\": \"public\",\n \"site_admin\": false\n },\n \"html_url\": \"https://mockserver.com/mock-org/gpt-browser\",\n \"description\": null,\n \"fork\": false,\n \"url\": \"https://api.mockserver.com/repos/mock-org/gpt-browser\",\n \"forks_url\": \"https://api.mockserver.com/repos/mock-org/gpt-browser/forks\",\n \"keys_url\": \"https://api.mockserver.com/repos/mock-org/gpt-browser/keys{/key_id}\",\n \"collaborators_url\": \"https://api.mockserver.com/repos/mock-org/gpt-browser/collaborators{/collaborator}\",\n \"teams_url\": \"https://api.mockserver.com/repos/mock-org/gpt-browser/teams\",\n \"hooks_url\": \"https://api.mockserver.com/repos/mock-org/gpt-browser/hooks\",\n \"issue_events_url\": \"https://api.mockserver.com/repos/mock-org/gpt-browser/issues/events{/number}\",\n \"events_url\": \"https://api.mockserver.com/repos/mock-org/gpt-browser/events\",\n \"assignees_url\": \"https://api.mockserver.com/repos/mock-org/gpt-browser/assignees{/user}\",\n \"branches_url\": \"https://api.mockserver.com/repos/mock-org/gpt-browser/branches{/branch}\",\n \"tags_url\": \"https://api.mockserver.com/repos/mock-org/gpt-browser/tags\",\n \"blobs_url\": \"https://api.mockserver.com/repos/mock-org/gpt-browser/git/blobs{/sha}\",\n \"git_tags_url\": \"https://api.mockserver.com/repos/mock-org/gpt-browser/git/tags{/sha}\",\n \"git_refs_url\": \"https://api.mockserver.com/repos/mock-org/gpt-browser/git/refs{/sha}\",\n \"trees_url\": \"https://api.mockserver.com/repos/mock-org/gpt-browser/git/trees{/sha}\",\n \"statuses_url\": \"https://api.mockserver.com/repos/mock-org/gpt-browser/statuses/{sha}\",\n \"languages_url\": \"https://api.mockserver.com/repos/mock-org/gpt-browser/languages\",\n \"stargazers_url\": \"https://api.mockserver.com/repos/mock-org/gpt-browser/stargazers\",\n \"contributors_url\": \"https://api.mockserver.com/repos/mock-org/gpt-browser/contributors\",\n \"subscribers_url\": \"https://api.mockserver.com/repos/mock-org/gpt-browser/subscribers\",\n \"subscription_url\": \"https://api.mockserver.com/repos/mock-org/gpt-browser/subscription\",\n \"commits_url\": \"https://api.mockserver.com/repos/mock-org/gpt-browser/commits{/sha}\",\n \"git_commits_url\": \"https://api.mockserver.com/repos/mock-org/gpt-browser/git/commits{/sha}\",\n \"comments_url\": \"https://api.mockserver.com/repos/mock-org/gpt-browser/comments{/number}\",\n \"issue_comment_url\": \"https://api.mockserver.com/repos/mock-org/gpt-browser/issues/comments{/number}\",\n \"contents_url\": \"https://api.mockserver.com/repos/mock-org/gpt-browser/contents/{+path}\",\n \"compare_url\": \"https://api.mockserver.com/repos/mock-org/gpt-browser/compare/{base}...{head}\",\n \"merges_url\": \"https://api.mockserver.com/repos/mock-org/gpt-browser/merges\",\n \"archive_url\": \"https://api.mockserver.com/repos/mock-org/gpt-browser/{archive_format}{/ref}\",\n \"downloads_url\": \"https://api.mockserver.com/repos/mock-org/gpt-browser/downloads\",\n \"issues_url\": \"https://api.mockserver.com/repos/mock-org/gpt-browser/issues{/number}\",\n \"pulls_url\": \"https://api.mockserver.com/repos/mock-org/gpt-browser/pulls{/number}\",\n \"milestones_url\": \"https://api.mockserver.com/repos/mock-org/gpt-browser/milestones{/number}\",\n \"notifications_url\": \"https://api.mockserver.com/repos/mock-org/gpt-browser/notifications{?since,all,participating}\",\n \"labels_url\": \"https://api.mockserver.com/repos/mock-org/gpt-browser/labels{/name}\",\n \"releases_url\": \"https://api.mockserver.com/repos/mock-org/gpt-browser/releases{/id}\",\n \"deployments_url\": \"https://api.mockserver.com/repos/mock-org/gpt-browser/deployments\",\n \"created_at\": \"2023-04-16T01:48:54Z\",\n \"updated_at\": \"2023-04-16T01:49:30Z\",\n \"pushed_at\": \"2024-02-13T20:46:27Z\",\n \"git_url\": \"git://mockserver.com/mock-org/gpt-browser.git\",\n \"ssh_url\": \"git@mockserver.com:mock-org/gpt-browser.git\",\n \"clone_url\": \"https://mockserver.com/mock-org/gpt-browser.git\",\n \"svn_url\": \"https://mockserver.com/mock-org/gpt-browser\",\n \"homepage\": null,\n \"size\": 351,\n \"stargazers_count\": 0,\n \"watchers_count\": 0,\n \"language\": \"TypeScript\",\n \"has_issues\": true,\n \"has_projects\": true,\n \"has_downloads\": true,\n \"has_wiki\": false,\n \"has_pages\": false,\n \"has_discussions\": false,\n \"forks_count\": 0,\n \"mirror_url\": null,\n \"archived\": false,\n \"disabled\": false,\n \"open_issues_count\": 0,\n \"license\": null,\n \"allow_forking\": false,\n \"is_template\": false,\n \"web_commit_signoff_required\": false,\n \"topics\": [],\n \"visibility\": \"private\",\n \"forks\": 0,\n \"open_issues\": 0,\n \"watchers\": 0,\n \"default_branch\": \"master\",\n \"permissions\": {\n \"admin\": true,\n \"maintain\": true,\n \"push\": true,\n \"triage\": true,\n \"pull\": true\n }\n },\n {\n \"id\": 222222222,\n \"node_id\": \"MOCK_NODE_ID_002\",\n \"name\": \"nugget\",\n \"full_name\": \"mock-org/nugget\",\n \"private\": true,\n \"owner\": {\n \"login\": \"mock-org\",\n \"id\": 999999999,\n \"node_id\": \"MOCK_ORG_ID\",\n \"avatar_url\": \"https://avatars.mockserver.com/u/999999999\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.mockserver.com/users/mock-org\",\n \"html_url\": \"https://mockserver.com/mock-org\",\n \"followers_url\": \"https://api.mockserver.com/users/mock-org/followers\",\n \"following_url\": \"https://api.mockserver.com/users/mock-org/following{/other_user}\",\n \"gists_url\": \"https://api.mockserver.com/users/mock-org/gists{/gist_id}\",\n \"starred_url\": \"https://api.mockserver.com/users/mock-org/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.mockserver.com/users/mock-org/subscriptions\",\n \"organizations_url\": \"https://api.mockserver.com/users/mock-org/orgs\",\n \"repos_url\": \"https://api.mockserver.com/users/mock-org/repos\",\n \"events_url\": \"https://api.mockserver.com/users/mock-org/events{/privacy}\",\n \"received_events_url\": \"https://api.mockserver.com/users/mock-org/received_events\",\n \"type\": \"Organization\",\n \"user_view_type\": \"public\",\n \"site_admin\": false\n },\n \"html_url\": \"https://mockserver.com/mock-org/nugget\",\n \"description\": \"repo with nugget extension that intercepts api calls on the page\",\n \"fork\": false,\n \"url\": \"https://api.mockserver.com/repos/mock-org/nugget\",\n \"forks_url\": \"https://api.mockserver.com/repos/mock-org/nugget/forks\",\n \"keys_url\": \"https://api.mockserver.com/repos/mock-org/nugget/keys{/key_id}\",\n \"collaborators_url\": \"https://api.mockserver.com/repos/mock-org/nugget/collaborators{/collaborator}\",\n \"teams_url\": \"https://api.mockserver.com/repos/mock-org/nugget/teams\",\n \"hooks_url\": \"https://api.mockserver.com/repos/mock-org/nugget/hooks\",\n \"issue_events_url\": \"https://api.mockserver.com/repos/mock-org/nugget/issues/events{/number}\",\n \"events_url\": \"https://api.mockserver.com/repos/mock-org/nugget/events\",\n \"assignees_url\": \"https://api.mockserver.com/repos/mock-org/nugget/assignees{/user}\",\n \"branches_url\": \"https://api.mockserver.com/repos/mock-org/nugget/branches{/branch}\",\n \"tags_url\": \"https://api.mockserver.com/repos/mock-org/nugget/tags\",\n \"blobs_url\": \"https://api.mockserver.com/repos/mock-org/nugget/git/blobs{/sha}\",\n \"git_tags_url\": \"https://api.mockserver.com/repos/mock-org/nugget/git/tags{/sha}\",\n \"git_refs_url\": \"https://api.mockserver.com/repos/mock-org/nugget/git/refs{/sha}\",\n \"trees_url\": \"https://api.mockserver.com/repos/mock-org/nugget/git/trees{/sha}\",\n \"statuses_url\": \"https://api.mockserver.com/repos/mock-org/nugget/statuses/{sha}\",\n \"languages_url\": \"https://api.mockserver.com/repos/mock-org/nugget/languages\",\n \"stargazers_url\": \"https://api.mockserver.com/repos/mock-org/nugget/stargazers\",\n \"contributors_url\": \"https://api.mockserver.com/repos/mock-org/nugget/contributors\",\n \"subscribers_url\": \"https://api.mockserver.com/repos/mock-org/nugget/subscribers\",\n \"subscription_url\": \"https://api.mockserver.com/repos/mock-org/nugget/subscription\",\n \"commits_url\": \"https://api.mockserver.com/repos/mock-org/nugget/commits{/sha}\",\n \"git_commits_url\": \"https://api.mockserver.com/repos/mock-org/nugget/git/commits{/sha}\",\n \"comments_url\": \"https://api.mockserver.com/repos/mock-org/nugget/comments{/number}\",\n \"issue_comment_url\": \"https://api.mockserver.com/repos/mock-org/nugget/issues/comments{/number}\",\n \"contents_url\": \"https://api.mockserver.com/repos/mock-org/nugget/contents/{+path}\",\n \"compare_url\": \"https://api.mockserver.com/repos/mock-org/nugget/compare/{base}...{head}\",\n \"merges_url\": \"https://api.mockserver.com/repos/mock-org/nugget/merges\",\n \"archive_url\": \"https://api.mockserver.com/repos/mock-org/nugget/{archive_format}{/ref}\",\n \"downloads_url\": \"https://api.mockserver.com/repos/mock-org/nugget/downloads\",\n \"issues_url\": \"https://api.mockserver.com/repos/mock-org/nugget/issues{/number}\",\n \"pulls_url\": \"https://api.mockserver.com/repos/mock-org/nugget/pulls{/number}\",\n \"milestones_url\": \"https://api.mockserver.com/repos/mock-org/nugget/milestones{/number}\",\n \"notifications_url\": \"https://api.mockserver.com/repos/mock-org/nugget/notifications{?since,all,participating}\",\n \"labels_url\": \"https://api.mockserver.com/repos/mock-org/nugget/labels{/name}\",\n \"releases_url\": \"https://api.mockserver.com/repos/mock-org/nugget/releases{/id}\",\n \"deployments_url\": \"https://api.mockserver.com/repos/mock-org/nugget/deployments\",\n \"created_at\": \"2023-10-12T05:10:08Z\",\n \"updated_at\": \"2023-10-12T05:10:28Z\",\n \"pushed_at\": \"2023-10-17T22:46:06Z\",\n \"git_url\": \"git://mockserver.com/mock-org/nugget.git\",\n \"ssh_url\": \"git@mockserver.com:mock-org/nugget.git\",\n \"clone_url\": \"https://mockserver.com/mock-org/nugget.git\",\n \"svn_url\": \"https://mockserver.com/mock-org/nugget\",\n \"homepage\": null,\n \"size\": 130,\n \"stargazers_count\": 0,\n \"watchers_count\": 0,\n \"language\": \"TypeScript\",\n \"has_issues\": true,\n \"has_projects\": true,\n \"has_downloads\": true,\n \"has_wiki\": false,\n \"has_pages\": false,\n \"has_discussions\": false,\n \"forks_count\": 0,\n \"mirror_url\": null,\n \"archived\": false,\n \"disabled\": false,\n \"open_issues_count\": 1,\n \"license\": null,\n \"allow_forking\": false,\n \"is_template\": false,\n \"web_commit_signoff_required\": false,\n \"topics\": [],\n \"visibility\": \"private\",\n \"forks\": 0,\n \"open_issues\": 1,\n \"watchers\": 0,\n \"default_branch\": \"master\",\n \"permissions\": {\n \"admin\": true,\n \"maintain\": true,\n \"push\": true,\n \"triage\": true,\n \"pull\": true\n }\n },\n {\n \"id\": 333333333,\n \"node_id\": \"MOCK_NODE_ID_003\",\n \"name\": \"pill-buddy\",\n \"full_name\": \"mock-org/pill-buddy\",\n \"private\": true,\n \"owner\": {\n \"login\": \"mock-org\",\n \"id\": 999999999,\n \"node_id\": \"MOCK_ORG_ID\",\n \"avatar_url\": \"https://avatars.mockserver.com/u/999999999\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.mockserver.com/users/mock-org\",\n \"html_url\": \"https://mockserver.com/mock-org\",\n \"followers_url\": \"https://api.mockserver.com/users/mock-org/followers\",\n \"following_url\": \"https://api.mockserver.com/users/mock-org/following{/other_user}\",\n \"gists_url\": \"https://api.mockserver.com/users/mock-org/gists{/gist_id}\",\n \"starred_url\": \"https://api.mockserver.com/users/mock-org/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.mockserver.com/users/mock-org/subscriptions\",\n \"organizations_url\": \"https://api.mockserver.com/users/mock-org/orgs\",\n \"repos_url\": \"https://api.mockserver.com/users/mock-org/repos\",\n \"events_url\": \"https://api.mockserver.com/users/mock-org/events{/privacy}\",\n \"received_events_url\": \"https://api.mockserver.com/users/mock-org/received_events\",\n \"type\": \"Organization\",\n \"user_view_type\": \"public\",\n \"site_admin\": false\n },\n \"html_url\": \"https://mockserver.com/mock-org/pill-buddy\",\n \"description\": null,\n \"fork\": false,\n \"url\": \"https://api.mockserver.com/repos/mock-org/pill-buddy\",\n \"forks_url\": \"https://api.mockserver.com/repos/mock-org/pill-buddy/forks\",\n \"keys_url\": \"https://api.mockserver.com/repos/mock-org/pill-buddy/keys{/key_id}\",\n \"collaborators_url\": \"https://api.mockserver.com/repos/mock-org/pill-buddy/collaborators{/collaborator}\",\n \"teams_url\": \"https://api.mockserver.com/repos/mock-org/pill-buddy/teams\",\n \"hooks_url\": \"https://api.mockserver.com/repos/mock-org/pill-buddy/hooks\",\n \"issue_events_url\": \"https://api.mockserver.com/repos/mock-org/pill-buddy/issues/events{/number}\",\n \"events_url\": \"https://api.mockserver.com/repos/mock-org/pill-buddy/events\",\n \"assignees_url\": \"https://api.mockserver.com/repos/mock-org/pill-buddy/assignees{/user}\",\n \"branches_url\": \"https://api.mockserver.com/repos/mock-org/pill-buddy/branches{/branch}\",\n \"tags_url\": \"https://api.mockserver.com/repos/mock-org/pill-buddy/tags\",\n \"blobs_url\": \"https://api.mockserver.com/repos/mock-org/pill-buddy/git/blobs{/sha}\",\n \"git_tags_url\": \"https://api.mockserver.com/repos/mock-org/pill-buddy/git/tags{/sha}\",\n \"git_refs_url\": \"https://api.mockserver.com/repos/mock-org/pill-buddy/git/refs{/sha}\",\n \"trees_url\": \"https://api.mockserver.com/repos/mock-org/pill-buddy/git/trees{/sha}\",\n \"statuses_url\": \"https://api.mockserver.com/repos/mock-org/pill-buddy/statuses/{sha}\",\n \"languages_url\": \"https://api.mockserver.com/repos/mock-org/pill-buddy/languages\",\n \"stargazers_url\": \"https://api.mockserver.com/repos/mock-org/pill-buddy/stargazers\",\n \"contributors_url\": \"https://api.mockserver.com/repos/mock-org/pill-buddy/contributors\",\n \"subscribers_url\": \"https://api.mockserver.com/repos/mock-org/pill-buddy/subscribers\",\n \"subscription_url\": \"https://api.mockserver.com/repos/mock-org/pill-buddy/subscription\",\n \"commits_url\": \"https://api.mockserver.com/repos/mock-org/pill-buddy/commits{/sha}\",\n \"git_commits_url\": \"https://api.mockserver.com/repos/mock-org/pill-buddy/git/commits{/sha}\",\n \"comments_url\": \"https://api.mockserver.com/repos/mock-org/pill-buddy/comments{/number}\",\n \"issue_comment_url\": \"https://api.mockserver.com/repos/mock-org/pill-buddy/issues/comments{/number}\",\n \"contents_url\": \"https://api.mockserver.com/repos/mock-org/pill-buddy/contents/{+path}\",\n \"compare_url\": \"https://api.mockserver.com/repos/mock-org/pill-buddy/compare/{base}...{head}\",\n \"merges_url\": \"https://api.mockserver.com/repos/mock-org/pill-buddy/merges\",\n \"archive_url\": \"https://api.mockserver.com/repos/mock-org/pill-buddy/{archive_format}{/ref}\",\n \"downloads_url\": \"https://api.mockserver.com/repos/mock-org/pill-buddy/downloads\",\n \"issues_url\": \"https://api.mockserver.com/repos/mock-org/pill-buddy/issues{/number}\",\n \"pulls_url\": \"https://api.mockserver.com/repos/mock-org/pill-buddy/pulls{/number}\",\n \"milestones_url\": \"https://api.mockserver.com/repos/mock-org/pill-buddy/milestones{/number}\",\n \"notifications_url\": \"https://api.mockserver.com/repos/mock-org/pill-buddy/notifications{?since,all,participating}\",\n \"labels_url\": \"https://api.mockserver.com/repos/mock-org/pill-buddy/labels{/name}\",\n \"releases_url\": \"https://api.mockserver.com/repos/mock-org/pill-buddy/releases{/id}\",\n \"deployments_url\": \"https://api.mockserver.com/repos/mock-org/pill-buddy/deployments\",\n \"created_at\": \"2023-04-24T12:04:33Z\",\n \"updated_at\": \"2023-04-24T12:26:53Z\",\n \"pushed_at\": \"2023-04-27T13:28:39Z\",\n \"git_url\": \"git://mockserver.com/mock-org/pill-buddy.git\",\n \"ssh_url\": \"git@mockserver.com:mock-org/pill-buddy.git\",\n \"clone_url\": \"https://mockserver.com/mock-org/pill-buddy.git\",\n \"svn_url\": \"https://mockserver.com/mock-org/pill-buddy\",\n \"homepage\": null,\n \"size\": 229,\n \"stargazers_count\": 0,\n \"watchers_count\": 0,\n \"language\": \"TypeScript\",\n \"has_issues\": true,\n \"has_projects\": true,\n \"has_downloads\": true,\n \"has_wiki\": false,\n \"has_pages\": false,\n \"has_discussions\": false,\n \"forks_count\": 0,\n \"mirror_url\": null,\n \"archived\": false,\n \"disabled\": false,\n \"open_issues_count\": 0,\n \"license\": null,\n \"allow_forking\": false,\n \"is_template\": false,\n \"web_commit_signoff_required\": false,\n \"topics\": [],\n \"visibility\": \"private\",\n \"forks\": 0,\n \"open_issues\": 0,\n \"watchers\": 0,\n \"default_branch\": \"master\",\n \"permissions\": {\n \"admin\": true,\n \"maintain\": true,\n \"push\": true,\n \"triage\": true,\n \"pull\": true\n }\n },\n {\n \"id\": 444444444,\n \"node_id\": \"MOCK_NODE_ID_004\",\n \"name\": \"summary-cast\",\n \"full_name\": \"mock-org/summary-cast\",\n \"private\": true,\n \"owner\": {\n \"login\": \"mock-org\",\n \"id\": 999999999,\n \"node_id\": \"MOCK_ORG_ID\",\n \"avatar_url\": \"https://avatars.mockserver.com/u/999999999\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.mockserver.com/users/mock-org\",\n \"html_url\": \"https://mockserver.com/mock-org\",\n \"followers_url\": \"https://api.mockserver.com/users/mock-org/followers\",\n \"following_url\": \"https://api.mockserver.com/users/mock-org/following{/other_user}\",\n \"gists_url\": \"https://api.mockserver.com/users/mock-org/gists{/gist_id}\",\n \"starred_url\": \"https://api.mockserver.com/users/mock-org/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.mockserver.com/users/mock-org/subscriptions\",\n \"organizations_url\": \"https://api.mockserver.com/users/mock-org/orgs\",\n \"repos_url\": \"https://api.mockserver.com/users/mock-org/repos\",\n \"events_url\": \"https://api.mockserver.com/users/mock-org/events{/privacy}\",\n \"received_events_url\": \"https://api.mockserver.com/users/mock-org/received_events\",\n \"type\": \"Organization\",\n \"user_view_type\": \"public\",\n \"site_admin\": false\n },\n \"html_url\": \"https://mockserver.com/mock-org/summary-cast\",\n \"description\": null,\n \"fork\": false,\n \"url\": \"https://api.mockserver.com/repos/mock-org/summary-cast\",\n \"forks_url\": \"https://api.mockserver.com/repos/mock-org/summary-cast/forks\",\n \"keys_url\": \"https://api.mockserver.com/repos/mock-org/summary-cast/keys{/key_id}\",\n \"collaborators_url\": \"https://api.mockserver.com/repos/mock-org/summary-cast/collaborators{/collaborator}\",\n \"teams_url\": \"https://api.mockserver.com/repos/mock-org/summary-cast/teams\",\n \"hooks_url\": \"https://api.mockserver.com/repos/mock-org/summary-cast/hooks\",\n \"issue_events_url\": \"https://api.mockserver.com/repos/mock-org/summary-cast/issues/events{/number}\",\n \"events_url\": \"https://api.mockserver.com/repos/mock-org/summary-cast/events\",\n \"assignees_url\": \"https://api.mockserver.com/repos/mock-org/summary-cast/assignees{/user}\",\n \"branches_url\": \"https://api.mockserver.com/repos/mock-org/summary-cast/branches{/branch}\",\n \"tags_url\": \"https://api.mockserver.com/repos/mock-org/summary-cast/tags\",\n \"blobs_url\": \"https://api.mockserver.com/repos/mock-org/summary-cast/git/blobs{/sha}\",\n \"git_tags_url\": \"https://api.mockserver.com/repos/mock-org/summary-cast/git/tags{/sha}\",\n \"git_refs_url\": \"https://api.mockserver.com/repos/mock-org/summary-cast/git/refs{/sha}\",\n \"trees_url\": \"https://api.mockserver.com/repos/mock-org/summary-cast/git/trees{/sha}\",\n \"statuses_url\": \"https://api.mockserver.com/repos/mock-org/summary-cast/statuses/{sha}\",\n \"languages_url\": \"https://api.mockserver.com/repos/mock-org/summary-cast/languages\",\n \"stargazers_url\": \"https://api.mockserver.com/repos/mock-org/summary-cast/stargazers\",\n \"contributors_url\": \"https://api.mockserver.com/repos/mock-org/summary-cast/contributors\",\n \"subscribers_url\": \"https://api.mockserver.com/repos/mock-org/summary-cast/subscribers\",\n \"subscription_url\": \"https://api.mockserver.com/repos/mock-org/summary-cast/subscription\",\n \"commits_url\": \"https://api.mockserver.com/repos/mock-org/summary-cast/commits{/sha}\",\n \"git_commits_url\": \"https://api.mockserver.com/repos/mock-org/summary-cast/git/commits{/sha}\",\n \"comments_url\": \"https://api.mockserver.com/repos/mock-org/summary-cast/comments{/number}\",\n \"issue_comment_url\": \"https://api.mockserver.com/repos/mock-org/summary-cast/issues/comments{/number}\",\n \"contents_url\": \"https://api.mockserver.com/repos/mock-org/summary-cast/contents/{+path}\",\n \"compare_url\": \"https://api.mockserver.com/repos/mock-org/summary-cast/compare/{base}...{head}\",\n \"merges_url\": \"https://api.mockserver.com/repos/mock-org/summary-cast/merges\",\n \"archive_url\": \"https://api.mockserver.com/repos/mock-org/summary-cast/{archive_format}{/ref}\",\n \"downloads_url\": \"https://api.mockserver.com/repos/mock-org/summary-cast/downloads\",\n \"issues_url\": \"https://api.mockserver.com/repos/mock-org/summary-cast/issues{/number}\",\n \"pulls_url\": \"https://api.mockserver.com/repos/mock-org/summary-cast/pulls{/number}\",\n \"milestones_url\": \"https://api.mockserver.com/repos/mock-org/summary-cast/milestones{/number}\",\n \"notifications_url\": \"https://api.mockserver.com/repos/mock-org/summary-cast/notifications{?since,all,participating}\",\n \"labels_url\": \"https://api.mockserver.com/repos/mock-org/summary-cast/labels{/name}\",\n \"releases_url\": \"https://api.mockserver.com/repos/mock-org/summary-cast/releases{/id}\",\n \"deployments_url\": \"https://api.mockserver.com/repos/mock-org/summary-cast/deployments\",\n \"created_at\": \"2023-04-28T04:40:22Z\",\n \"updated_at\": \"2023-04-28T04:41:13Z\",\n \"pushed_at\": \"2023-05-01T04:04:54Z\",\n \"git_url\": \"git://mockserver.com/mock-org/summary-cast.git\",\n \"ssh_url\": \"git@mockserver.com:mock-org/summary-cast.git\",\n \"clone_url\": \"https://mockserver.com/mock-org/summary-cast.git\",\n \"svn_url\": \"https://mockserver.com/mock-org/summary-cast\",\n \"homepage\": null,\n \"size\": 51565,\n \"stargazers_count\": 0,\n \"watchers_count\": 0,\n \"language\": \"TypeScript\",\n \"has_issues\": true,\n \"has_projects\": true,\n \"has_downloads\": true,\n \"has_wiki\": false,\n \"has_pages\": false,\n \"has_discussions\": false,\n \"forks_count\": 0,\n \"mirror_url\": null,\n \"archived\": false,\n \"disabled\": false,\n \"open_issues_count\": 0,\n \"license\": null,\n \"allow_forking\": false,\n \"is_template\": false,\n \"web_commit_signoff_required\": false,\n \"topics\": [],\n \"visibility\": \"private\",\n \"forks\": 0,\n \"open_issues\": 0,\n \"watchers\": 0,\n \"default_branch\": \"master\",\n \"permissions\": {\n \"admin\": true,\n \"maintain\": true,\n \"push\": true,\n \"triage\": true,\n \"pull\": true\n }\n },\n {\n \"id\": 555555555,\n \"node_id\": \"MOCK_NODE_ID_005\",\n \"name\": \"tyvm\",\n \"full_name\": \"mock-org/tyvm\",\n \"private\": true,\n \"owner\": {\n \"login\": \"mock-org\",\n \"id\": 999999999,\n \"node_id\": \"MOCK_ORG_ID\",\n \"avatar_url\": \"https://avatars.mockserver.com/u/999999999\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.mockserver.com/users/mock-org\",\n \"html_url\": \"https://mockserver.com/mock-org\",\n \"followers_url\": \"https://api.mockserver.com/users/mock-org/followers\",\n \"following_url\": \"https://api.mockserver.com/users/mock-org/following{/other_user}\",\n \"gists_url\": \"https://api.mockserver.com/users/mock-org/gists{/gist_id}\",\n \"starred_url\": \"https://api.mockserver.com/users/mock-org/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.mockserver.com/users/mock-org/subscriptions\",\n \"organizations_url\": \"https://api.mockserver.com/users/mock-org/orgs\",\n \"repos_url\": \"https://api.mockserver.com/users/mock-org/repos\",\n \"events_url\": \"https://api.mockserver.com/users/mock-org/events{/privacy}\",\n \"received_events_url\": \"https://api.mockserver.com/users/mock-org/received_events\",\n \"type\": \"Organization\",\n \"user_view_type\": \"public\",\n \"site_admin\": false\n },\n \"html_url\": \"https://mockserver.com/mock-org/tyvm\",\n \"description\": null,\n \"fork\": false,\n \"url\": \"https://api.mockserver.com/repos/mock-org/tyvm\",\n \"forks_url\": \"https://api.mockserver.com/repos/mock-org/tyvm/forks\",\n \"keys_url\": \"https://api.mockserver.com/repos/mock-org/tyvm/keys{/key_id}\",\n \"collaborators_url\": \"https://api.mockserver.com/repos/mock-org/tyvm/collaborators{/collaborator}\",\n \"teams_url\": \"https://api.mockserver.com/repos/mock-org/tyvm/teams\",\n \"hooks_url\": \"https://api.mockserver.com/repos/mock-org/tyvm/hooks\",\n \"issue_events_url\": \"https://api.mockserver.com/repos/mock-org/tyvm/issues/events{/number}\",\n \"events_url\": \"https://api.mockserver.com/repos/mock-org/tyvm/events\",\n \"assignees_url\": \"https://api.mockserver.com/repos/mock-org/tyvm/assignees{/user}\",\n \"branches_url\": \"https://api.mockserver.com/repos/mock-org/tyvm/branches{/branch}\",\n \"tags_url\": \"https://api.mockserver.com/repos/mock-org/tyvm/tags\",\n \"blobs_url\": \"https://api.mockserver.com/repos/mock-org/tyvm/git/blobs{/sha}\",\n \"git_tags_url\": \"https://api.mockserver.com/repos/mock-org/tyvm/git/tags{/sha}\",\n \"git_refs_url\": \"https://api.mockserver.com/repos/mock-org/tyvm/git/refs{/sha}\",\n \"trees_url\": \"https://api.mockserver.com/repos/mock-org/tyvm/git/trees{/sha}\",\n \"statuses_url\": \"https://api.mockserver.com/repos/mock-org/tyvm/statuses/{sha}\",\n \"languages_url\": \"https://api.mockserver.com/repos/mock-org/tyvm/languages\",\n \"stargazers_url\": \"https://api.mockserver.com/repos/mock-org/tyvm/stargazers\",\n \"contributors_url\": \"https://api.mockserver.com/repos/mock-org/tyvm/contributors\",\n \"subscribers_url\": \"https://api.mockserver.com/repos/mock-org/tyvm/subscribers\",\n \"subscription_url\": \"https://api.mockserver.com/repos/mock-org/tyvm/subscription\",\n \"commits_url\": \"https://api.mockserver.com/repos/mock-org/tyvm/commits{/sha}\",\n \"git_commits_url\": \"https://api.mockserver.com/repos/mock-org/tyvm/git/commits{/sha}\",\n \"comments_url\": \"https://api.mockserver.com/repos/mock-org/tyvm/comments{/number}\",\n \"issue_comment_url\": \"https://api.mockserver.com/repos/mock-org/tyvm/issues/comments{/number}\",\n \"contents_url\": \"https://api.mockserver.com/repos/mock-org/tyvm/contents/{+path}\",\n \"compare_url\": \"https://api.mockserver.com/repos/mock-org/tyvm/compare/{base}...{head}\",\n \"merges_url\": \"https://api.mockserver.com/repos/mock-org/tyvm/merges\",\n \"archive_url\": \"https://api.mockserver.com/repos/mock-org/tyvm/{archive_format}{/ref}\",\n \"downloads_url\": \"https://api.mockserver.com/repos/mock-org/tyvm/downloads\",\n \"issues_url\": \"https://api.mockserver.com/repos/mock-org/tyvm/issues{/number}\",\n \"pulls_url\": \"https://api.mockserver.com/repos/mock-org/tyvm/pulls{/number}\",\n \"milestones_url\": \"https://api.mockserver.com/repos/mock-org/tyvm/milestones{/number}\",\n \"notifications_url\": \"https://api.mockserver.com/repos/mock-org/tyvm/notifications{?since,all,participating}\",\n \"labels_url\": \"https://api.mockserver.com/repos/mock-org/tyvm/labels{/name}\",\n \"releases_url\": \"https://api.mockserver.com/repos/mock-org/tyvm/releases{/id}\",\n \"deployments_url\": \"https://api.mockserver.com/repos/mock-org/tyvm/deployments\",\n \"created_at\": \"2023-01-02T22:24:05Z\",\n \"updated_at\": \"2026-02-12T02:27:28Z\",\n \"pushed_at\": \"2023-01-13T20:40:14Z\",\n \"git_url\": \"git://mockserver.com/mock-org/tyvm.git\",\n \"ssh_url\": \"git@mockserver.com:mock-org/tyvm.git\",\n \"clone_url\": \"https://mockserver.com/mock-org/tyvm.git\",\n \"svn_url\": \"https://mockserver.com/mock-org/tyvm\",\n \"homepage\": null,\n \"size\": 1706,\n \"stargazers_count\": 0,\n \"watchers_count\": 0,\n \"language\": \"TypeScript\",\n \"has_issues\": true,\n \"has_projects\": true,\n \"has_downloads\": true,\n \"has_wiki\": false,\n \"has_pages\": false,\n \"has_discussions\": false,\n \"forks_count\": 0,\n \"mirror_url\": null,\n \"archived\": false,\n \"disabled\": false,\n \"open_issues_count\": 1,\n \"license\": null,\n \"allow_forking\": false,\n \"is_template\": false,\n \"web_commit_signoff_required\": false,\n \"topics\": [],\n \"visibility\": \"private\",\n \"forks\": 0,\n \"open_issues\": 1,\n \"watchers\": 0,\n \"default_branch\": \"main\",\n \"permissions\": {\n \"admin\": true,\n \"maintain\": true,\n \"push\": true,\n \"triage\": true,\n \"pull\": true\n }\n },\n {\n \"id\": 666666666,\n \"node_id\": \"MOCK_NODE_ID_006\",\n \"name\": \"tyvm-primitives\",\n \"full_name\": \"mock-org/tyvm-primitives\",\n \"private\": true,\n \"owner\": {\n \"login\": \"mock-org\",\n \"id\": 999999999,\n \"node_id\": \"MOCK_ORG_ID\",\n \"avatar_url\": \"https://avatars.mockserver.com/u/999999999\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.mockserver.com/users/mock-org\",\n \"html_url\": \"https://mockserver.com/mock-org\",\n \"followers_url\": \"https://api.mockserver.com/users/mock-org/followers\",\n \"following_url\": \"https://api.mockserver.com/users/mock-org/following{/other_user}\",\n \"gists_url\": \"https://api.mockserver.com/users/mock-org/gists{/gist_id}\",\n \"starred_url\": \"https://api.mockserver.com/users/mock-org/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.mockserver.com/users/mock-org/subscriptions\",\n \"organizations_url\": \"https://api.mockserver.com/users/mock-org/orgs\",\n \"repos_url\": \"https://api.mockserver.com/users/mock-org/repos\",\n \"events_url\": \"https://api.mockserver.com/users/mock-org/events{/privacy}\",\n \"received_events_url\": \"https://api.mockserver.com/users/mock-org/received_events\",\n \"type\": \"Organization\",\n \"user_view_type\": \"public\",\n \"site_admin\": false\n },\n \"html_url\": \"https://mockserver.com/mock-org/tyvm-primitives\",\n \"description\": null,\n \"fork\": false,\n \"url\": \"https://api.mockserver.com/repos/mock-org/tyvm-primitives\",\n \"forks_url\": \"https://api.mockserver.com/repos/mock-org/tyvm-primitives/forks\",\n \"keys_url\": \"https://api.mockserver.com/repos/mock-org/tyvm-primitives/keys{/key_id}\",\n \"collaborators_url\": \"https://api.mockserver.com/repos/mock-org/tyvm-primitives/collaborators{/collaborator}\",\n \"teams_url\": \"https://api.mockserver.com/repos/mock-org/tyvm-primitives/teams\",\n \"hooks_url\": \"https://api.mockserver.com/repos/mock-org/tyvm-primitives/hooks\",\n \"issue_events_url\": \"https://api.mockserver.com/repos/mock-org/tyvm-primitives/issues/events{/number}\",\n \"events_url\": \"https://api.mockserver.com/repos/mock-org/tyvm-primitives/events\",\n \"assignees_url\": \"https://api.mockserver.com/repos/mock-org/tyvm-primitives/assignees{/user}\",\n \"branches_url\": \"https://api.mockserver.com/repos/mock-org/tyvm-primitives/branches{/branch}\",\n \"tags_url\": \"https://api.mockserver.com/repos/mock-org/tyvm-primitives/tags\",\n \"blobs_url\": \"https://api.mockserver.com/repos/mock-org/tyvm-primitives/git/blobs{/sha}\",\n \"git_tags_url\": \"https://api.mockserver.com/repos/mock-org/tyvm-primitives/git/tags{/sha}\",\n \"git_refs_url\": \"https://api.mockserver.com/repos/mock-org/tyvm-primitives/git/refs{/sha}\",\n \"trees_url\": \"https://api.mockserver.com/repos/mock-org/tyvm-primitives/git/trees{/sha}\",\n \"statuses_url\": \"https://api.mockserver.com/repos/mock-org/tyvm-primitives/statuses/{sha}\",\n \"languages_url\": \"https://api.mockserver.com/repos/mock-org/tyvm-primitives/languages\",\n \"stargazers_url\": \"https://api.mockserver.com/repos/mock-org/tyvm-primitives/stargazers\",\n \"contributors_url\": \"https://api.mockserver.com/repos/mock-org/tyvm-primitives/contributors\",\n \"subscribers_url\": \"https://api.mockserver.com/repos/mock-org/tyvm-primitives/subscribers\",\n \"subscription_url\": \"https://api.mockserver.com/repos/mock-org/tyvm-primitives/subscription\",\n \"commits_url\": \"https://api.mockserver.com/repos/mock-org/tyvm-primitives/commits{/sha}\",\n \"git_commits_url\": \"https://api.mockserver.com/repos/mock-org/tyvm-primitives/git/commits{/sha}\",\n \"comments_url\": \"https://api.mockserver.com/repos/mock-org/tyvm-primitives/comments{/number}\",\n \"issue_comment_url\": \"https://api.mockserver.com/repos/mock-org/tyvm-primitives/issues/comments{/number}\",\n \"contents_url\": \"https://api.mockserver.com/repos/mock-org/tyvm-primitives/contents/{+path}\",\n \"compare_url\": \"https://api.mockserver.com/repos/mock-org/tyvm-primitives/compare/{base}...{head}\",\n \"merges_url\": \"https://api.mockserver.com/repos/mock-org/tyvm-primitives/merges\",\n \"archive_url\": \"https://api.mockserver.com/repos/mock-org/tyvm-primitives/{archive_format}{/ref}\",\n \"downloads_url\": \"https://api.mockserver.com/repos/mock-org/tyvm-primitives/downloads\",\n \"issues_url\": \"https://api.mockserver.com/repos/mock-org/tyvm-primitives/issues{/number}\",\n \"pulls_url\": \"https://api.mockserver.com/repos/mock-org/tyvm-primitives/pulls{/number}\",\n \"milestones_url\": \"https://api.mockserver.com/repos/mock-org/tyvm-primitives/milestones{/number}\",\n \"notifications_url\": \"https://api.mockserver.com/repos/mock-org/tyvm-primitives/notifications{?since,all,participating}\",\n \"labels_url\": \"https://api.mockserver.com/repos/mock-org/tyvm-primitives/labels{/name}\",\n \"releases_url\": \"https://api.mockserver.com/repos/mock-org/tyvm-primitives/releases{/id}\",\n \"deployments_url\": \"https://api.mockserver.com/repos/mock-org/tyvm-primitives/deployments\",\n \"created_at\": \"2023-09-25T23:17:26Z\",\n \"updated_at\": \"2023-09-27T02:27:06Z\",\n \"pushed_at\": \"2023-12-19T17:56:07Z\",\n \"git_url\": \"git://mockserver.com/mock-org/tyvm-primitives.git\",\n \"ssh_url\": \"git@mockserver.com:mock-org/tyvm-primitives.git\",\n \"clone_url\": \"https://mockserver.com/mock-org/tyvm-primitives.git\",\n \"svn_url\": \"https://mockserver.com/mock-org/tyvm-primitives\",\n \"homepage\": null,\n \"size\": 603,\n \"stargazers_count\": 0,\n \"watchers_count\": 0,\n \"language\": \"TypeScript\",\n \"has_issues\": true,\n \"has_projects\": true,\n \"has_downloads\": true,\n \"has_wiki\": false,\n \"has_pages\": false,\n \"has_discussions\": false,\n \"forks_count\": 0,\n \"mirror_url\": null,\n \"archived\": false,\n \"disabled\": false,\n \"open_issues_count\": 0,\n \"license\": null,\n \"allow_forking\": false,\n \"is_template\": false,\n \"web_commit_signoff_required\": false,\n \"topics\": [],\n \"visibility\": \"private\",\n \"forks\": 0,\n \"open_issues\": 0,\n \"watchers\": 0,\n \"default_branch\": \"master\",\n \"permissions\": {\n \"admin\": true,\n \"maintain\": true,\n \"push\": true,\n \"triage\": true,\n \"pull\": true\n }\n }\n]\n"}]}
|
package/ts_build/package.json
CHANGED
|
@@ -39,15 +39,22 @@ class SetupAgent extends base_1.BaseAgent {
|
|
|
39
39
|
|
|
40
40
|
Always ask the user to approve what you're going to do to the config, that way you can get feedback via askHuman before modifying the config
|
|
41
41
|
|
|
42
|
+
After using askHuman and them providing their feedback of what you'd like to do, only follow what they say. We want to make the minimum set of changes to the config.
|
|
43
|
+
|
|
44
|
+
For codebase embeddings you don't want to use prompt, as that'd embed a transformation of the code, you want to embed the actual source, so don't use prompt.
|
|
45
|
+
For embeddings prompt would only be used for generating an embedding from transformed data, like if you wanted to summarize a transcript and make embeddings from the summary, then you'd use prompt on the embeddings, otherwise you should not need it.
|
|
46
|
+
|
|
42
47
|
When setting up the language plugin for a user you should come up with phrases they're likely to say, like frontend/backend/schema etc that will signal we should load in guides or rules for that type of task. You should put any of your rules/analses in .knowhow/docs and the language plugin should reference those.
|
|
43
48
|
|
|
49
|
+
The language plugin can only read in files, not directories, so do not add entries to language plugin unless you've first written some markdown files to load in as guidance. The files loaded by the language plugin should give quick tips to any unusual things about the project, commands that should be run to rebuild any auto-generated code, quirks about codebase behavior etc.
|
|
50
|
+
|
|
44
51
|
If a user is vauge about setting up, you should give them some options of what all you could help them setup with a brief explanation of what those setups would enable.
|
|
45
52
|
|
|
46
53
|
Only suggest embeddings that include a folder path with many elements, ie src/**/*.ts, never suggest entries with one element
|
|
47
54
|
|
|
48
|
-
If a user is requesting help with setting up a coding project, you can look at their package.json to setup the lintCommands so that we get feedback on file edits, and embeddings for the source code as those two features are the highest impact
|
|
55
|
+
If a user is requesting help with setting up a coding project, you can look at their package.json, or language specific config to setup the lintCommands so that we get feedback on file edits, and embeddings for the source code as those two features are the highest impact
|
|
49
56
|
|
|
50
|
-
If the user just says setup fast, try to get a general idea of the project file structure and setup one source code embedding for the whole
|
|
57
|
+
If the user just says setup fast, try to get a general idea of the project file structure and setup one source code embedding for the whole codebase and linter commands if possible. Try not do dig too deep if they want fast, just get the highest impact features setup
|
|
51
58
|
|
|
52
59
|
`,
|
|
53
60
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../../../src/agents/setup/setup.ts"],"names":[],"mappings":";;;;;;AACA,uCAAuD;AACvD,2CAA6C;AAC7C,gGAAiE;AACjE,iCAAkC;AAElC,MAAa,UAAW,SAAQ,gBAAS;IACvC,IAAI,GAAG,OAAO,CAAC;IACf,WAAW,GAAG,4CAA4C,CAAC;IAE3D,YAAY,OAAqB;QAC/B,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,mBAAmB,CAAC;YACvB,EAAE,KAAK,EAAE,WAAM,CAAC,SAAS,CAAC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE;YAC1D;gBACE,KAAK,EAAE,WAAM,CAAC,MAAM,CAAC,WAAW;gBAChC,QAAQ,EAAE,QAAQ;aACnB;SACF,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,SAAiB;QACxC,OAAO;YACL;gBACE,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,GAAG,oBAAW;;;;yCAIU,+BAAc
|
|
1
|
+
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../../../src/agents/setup/setup.ts"],"names":[],"mappings":";;;;;;AACA,uCAAuD;AACvD,2CAA6C;AAC7C,gGAAiE;AACjE,iCAAkC;AAElC,MAAa,UAAW,SAAQ,gBAAS;IACvC,IAAI,GAAG,OAAO,CAAC;IACf,WAAW,GAAG,4CAA4C,CAAC;IAE3D,YAAY,OAAqB;QAC/B,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,mBAAmB,CAAC;YACvB,EAAE,KAAK,EAAE,WAAM,CAAC,SAAS,CAAC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE;YAC1D;gBACE,KAAK,EAAE,WAAM,CAAC,MAAM,CAAC,WAAW;gBAChC,QAAQ,EAAE,QAAQ;aACnB;SACF,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,SAAiB;QACxC,OAAO;YACL;gBACE,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,GAAG,oBAAW;;;;yCAIU,+BAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;SA2B9C;aACF;YACD,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE;SACxB,CAAC;IACjB,CAAC;CACF;AAxDD,gCAwDC"}
|
|
@@ -5,7 +5,8 @@ const embeddings_1 = require("../../embeddings");
|
|
|
5
5
|
const execCommand_1 = require("./execCommand");
|
|
6
6
|
async function textSearch(searchTerm) {
|
|
7
7
|
try {
|
|
8
|
-
const
|
|
8
|
+
const escapedTerm = searchTerm.replace(/'/g, "'\\''");
|
|
9
|
+
const command = `ag -m 3 -Q '${escapedTerm}'`;
|
|
9
10
|
const output = await (0, execCommand_1.execCommand)(command);
|
|
10
11
|
return output;
|
|
11
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textSearch.js","sourceRoot":"","sources":["../../../../src/agents/tools/textSearch.ts"],"names":[],"mappings":";;;AAAA,iDAA2D;AAC3D,+CAA4C;AAErC,KAAK,UAAU,UAAU,CAAC,UAAU;IACzC,IAAI;
|
|
1
|
+
{"version":3,"file":"textSearch.js","sourceRoot":"","sources":["../../../../src/agents/tools/textSearch.ts"],"names":[],"mappings":";;;AAAA,iDAA2D;AAC3D,+CAA4C;AAErC,KAAK,UAAU,UAAU,CAAC,UAAU;IACzC,IAAI;QAGF,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACtD,MAAM,OAAO,GAAG,eAAe,WAAW,GAAG,CAAC;QAC9C,MAAM,MAAM,GAAG,MAAM,IAAA,yBAAW,EAAC,OAAO,CAAC,CAAC;QAC1C,OAAO,MAAM,CAAC;KACf;IAAC,OAAO,GAAG,EAAE;QACZ,OAAO,CAAC,GAAG,CACT,mEAAmE,CACpE,CAAC;QACF,MAAM,eAAe,GAAG,UAAU,CAAC,WAAW,EAAE,CAAC;QACjD,MAAM,UAAU,GAAG,MAAM,IAAA,oCAAuB,GAAE,CAAC;QACnD,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CAC9C,SAAS,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC,CACvD,CAAC;QACF,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;QACxC,OAAO,OAAO,CAAC;KAChB;AACH,CAAC;AApBD,gCAoBC"}
|
|
@@ -27,7 +27,7 @@ export declare class CliChatService implements ChatService {
|
|
|
27
27
|
processInput(input: string): Promise<boolean>;
|
|
28
28
|
enableMode(name: string): void;
|
|
29
29
|
disableMode(name: string): void;
|
|
30
|
-
getInput(prompt?: string, options?: string[]
|
|
30
|
+
getInput(prompt?: string, options?: string[]): Promise<string>;
|
|
31
31
|
clearHistory(): void;
|
|
32
32
|
getChatHistory(): ChatInteraction[];
|
|
33
33
|
getInputHistory(): string[];
|
|
@@ -43,8 +43,8 @@ class CliChatService {
|
|
|
43
43
|
try {
|
|
44
44
|
if (fs_1.default.existsSync(this.historyFile)) {
|
|
45
45
|
const historyData = fs_1.default.readFileSync(this.historyFile, "utf8");
|
|
46
|
-
const
|
|
47
|
-
this.inputHistory =
|
|
46
|
+
const parsedHistory = JSON.parse(historyData);
|
|
47
|
+
this.inputHistory = parsedHistory.inputs || [];
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
catch (error) {
|
|
@@ -58,10 +58,10 @@ class CliChatService {
|
|
|
58
58
|
if (!fs_1.default.existsSync(dir)) {
|
|
59
59
|
fs_1.default.mkdirSync(dir, { recursive: true });
|
|
60
60
|
}
|
|
61
|
-
const
|
|
61
|
+
const inputHistory = {
|
|
62
62
|
inputs: this.inputHistory,
|
|
63
63
|
};
|
|
64
|
-
fs_1.default.writeFileSync(this.historyFile, JSON.stringify(
|
|
64
|
+
fs_1.default.writeFileSync(this.historyFile, JSON.stringify(inputHistory, null, 2));
|
|
65
65
|
}
|
|
66
66
|
catch (error) {
|
|
67
67
|
console.error("Error saving input history:", error);
|
|
@@ -143,7 +143,7 @@ class CliChatService {
|
|
|
143
143
|
mode.active = false;
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
|
-
async getInput(prompt = "> ", options = []
|
|
146
|
+
async getInput(prompt = "> ", options = []) {
|
|
147
147
|
if (this.context.inputMethod) {
|
|
148
148
|
return await this.context.inputMethod.getInput(prompt);
|
|
149
149
|
}
|
|
@@ -197,7 +197,7 @@ class CliChatService {
|
|
|
197
197
|
? `\nAsk knowhow ${this.context.currentAgent}: `
|
|
198
198
|
: `\nAsk knowhow: `;
|
|
199
199
|
try {
|
|
200
|
-
const input = await this.getInput(promptText, commandNames
|
|
200
|
+
const input = await this.getInput(promptText, commandNames);
|
|
201
201
|
if (input.trim() === "") {
|
|
202
202
|
continue;
|
|
203
203
|
}
|