@augmentcode/auggie-sdk 0.1.10 → 0.1.12
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/README.md +56 -1
- package/dist/auggie/sdk-acp-client.d.ts +7 -6
- package/dist/auggie/sdk-acp-client.js +299 -332
- package/dist/auggie/sdk-mcp-server.d.ts +5 -3
- package/dist/auggie/sdk-mcp-server.js +102 -112
- package/dist/context/direct-context.d.ts +82 -22
- package/dist/context/direct-context.js +675 -562
- package/dist/context/filesystem-context.d.ts +5 -3
- package/dist/context/filesystem-context.js +187 -209
- package/dist/context/internal/__mocks__/api-client.d.ts +17 -11
- package/dist/context/internal/__mocks__/api-client.js +104 -91
- package/dist/context/internal/api-client.d.ts +14 -11
- package/dist/context/internal/api-client.js +234 -239
- package/dist/context/internal/blob-name-calculator.d.ts +5 -4
- package/dist/context/internal/blob-name-calculator.js +41 -38
- package/dist/context/internal/chat-utils.d.ts +6 -3
- package/dist/context/internal/chat-utils.js +5 -18
- package/dist/context/internal/credentials.d.ts +5 -4
- package/dist/context/internal/credentials.js +24 -38
- package/dist/context/internal/retry-utils.d.ts +5 -4
- package/dist/context/internal/retry-utils.js +60 -114
- package/dist/context/internal/search-utils.d.ts +3 -2
- package/dist/context/internal/search-utils.js +8 -9
- package/dist/context/internal/session-reader.d.ts +4 -3
- package/dist/context/internal/session-reader.js +14 -22
- package/dist/context/types.d.ts +132 -13
- package/dist/context/types.js +0 -5
- package/dist/index.d.ts +8 -7
- package/dist/index.js +14 -9
- package/dist/version.d.ts +3 -2
- package/dist/version.js +24 -38
- package/package.json +3 -2
- package/dist/auggie/sdk-acp-client.d.ts.map +0 -1
- package/dist/auggie/sdk-acp-client.js.map +0 -1
- package/dist/auggie/sdk-mcp-server.d.ts.map +0 -1
- package/dist/auggie/sdk-mcp-server.js.map +0 -1
- package/dist/context/direct-context.d.ts.map +0 -1
- package/dist/context/direct-context.js.map +0 -1
- package/dist/context/filesystem-context.d.ts.map +0 -1
- package/dist/context/filesystem-context.js.map +0 -1
- package/dist/context/internal/__mocks__/api-client.d.ts.map +0 -1
- package/dist/context/internal/__mocks__/api-client.js.map +0 -1
- package/dist/context/internal/api-client.d.ts.map +0 -1
- package/dist/context/internal/api-client.js.map +0 -1
- package/dist/context/internal/blob-name-calculator.d.ts.map +0 -1
- package/dist/context/internal/blob-name-calculator.js.map +0 -1
- package/dist/context/internal/chat-utils.d.ts.map +0 -1
- package/dist/context/internal/chat-utils.js.map +0 -1
- package/dist/context/internal/credentials.d.ts.map +0 -1
- package/dist/context/internal/credentials.js.map +0 -1
- package/dist/context/internal/retry-utils.d.ts.map +0 -1
- package/dist/context/internal/retry-utils.js.map +0 -1
- package/dist/context/internal/search-utils.d.ts.map +0 -1
- package/dist/context/internal/search-utils.js.map +0 -1
- package/dist/context/internal/session-reader.d.ts.map +0 -1
- package/dist/context/internal/session-reader.js.map +0 -1
- package/dist/context/types.d.ts.map +0 -1
- package/dist/context/types.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/version.d.ts.map +0 -1
- package/dist/version.js.map +0 -1
package/README.md
CHANGED
|
@@ -334,11 +334,27 @@ import { DirectContext } from "@augmentcode/auggie-sdk";
|
|
|
334
334
|
// 3. Or pass credentials directly in options
|
|
335
335
|
const context = await DirectContext.create();
|
|
336
336
|
|
|
337
|
-
// Add files to index
|
|
337
|
+
// Add files to index (waits indefinitely by default)
|
|
338
338
|
await context.addToIndex([
|
|
339
339
|
{ path: "src/main.ts", contents: "..." }
|
|
340
340
|
]);
|
|
341
341
|
|
|
342
|
+
// Optionally set a timeout
|
|
343
|
+
await context.addToIndex(files, {
|
|
344
|
+
timeout: 10 * 60 * 1000 // 10 minutes in milliseconds
|
|
345
|
+
});
|
|
346
|
+
|
|
347
|
+
// Track progress during indexing
|
|
348
|
+
await context.addToIndex(files, {
|
|
349
|
+
onProgress: (progress) => {
|
|
350
|
+
console.log(`[${progress.stage}] Uploaded: ${progress.uploaded}/${progress.total}, Indexed: ${progress.indexed}/${progress.total}`);
|
|
351
|
+
if (progress.stage === 'uploading') {
|
|
352
|
+
console.log(` Current file: ${progress.currentFile}`);
|
|
353
|
+
console.log(` Bytes uploaded: ${progress.bytesUploaded}`);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
});
|
|
357
|
+
|
|
342
358
|
// Search - returns results in a formatted string ready for LLM use or display
|
|
343
359
|
const results = await context.search("authentication logic");
|
|
344
360
|
console.log(results);
|
|
@@ -352,8 +368,47 @@ console.log(answer);
|
|
|
352
368
|
|
|
353
369
|
// Export state to avoid re-indexing
|
|
354
370
|
await context.exportToFile("/tmp/state.json");
|
|
371
|
+
|
|
372
|
+
// For search-only use cases, export lightweight state
|
|
373
|
+
await context.exportToFile("/tmp/search-state.json", { mode: "search-only" });
|
|
355
374
|
```
|
|
356
375
|
|
|
376
|
+
#### Search-Only Export (Optimized for Storage)
|
|
377
|
+
|
|
378
|
+
For applications that only need to search an existing index (without adding or removing files), you can export a lightweight search-only state that excludes the large blobs array:
|
|
379
|
+
|
|
380
|
+
```typescript
|
|
381
|
+
import { DirectContext } from "@augmentcode/auggie-sdk";
|
|
382
|
+
|
|
383
|
+
// Create and index files normally
|
|
384
|
+
const context = await DirectContext.create();
|
|
385
|
+
await context.addToIndex(files);
|
|
386
|
+
|
|
387
|
+
// Export search-only state (much smaller for large codebases)
|
|
388
|
+
const searchState = context.export({ mode: "search-only" });
|
|
389
|
+
// or
|
|
390
|
+
await context.exportToFile("search-state.json", { mode: "search-only" });
|
|
391
|
+
|
|
392
|
+
// Later, import the search-only state
|
|
393
|
+
const searchContext = await DirectContext.import(searchState);
|
|
394
|
+
// or
|
|
395
|
+
const searchContext = await DirectContext.importFromFile("search-state.json");
|
|
396
|
+
|
|
397
|
+
// Search operations work normally
|
|
398
|
+
const results = await searchContext.search("authentication logic");
|
|
399
|
+
|
|
400
|
+
// But indexing operations will throw errors
|
|
401
|
+
// await searchContext.addToIndex(files); // ❌ Error: requires full state
|
|
402
|
+
// await searchContext.removeFromIndex(paths); // ❌ Error: requires full state
|
|
403
|
+
// searchContext.getIndexedPaths(); // ❌ Error: requires full state
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
**When to use search-only export:**
|
|
407
|
+
- ✅ Search-only applications (e.g., documentation search, code Q&A)
|
|
408
|
+
- ✅ Distributed systems where indexing happens centrally
|
|
409
|
+
- ✅ Reducing index size for large codebases
|
|
410
|
+
- ❌ Applications that need to add/remove files from the index
|
|
411
|
+
|
|
357
412
|
### FileSystem Context
|
|
358
413
|
|
|
359
414
|
**⚠️ Requires Local Auggie Installation**
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { SessionNotification } from '@agentclientprotocol/sdk';
|
|
2
|
+
import { Tool } from 'ai';
|
|
3
|
+
|
|
3
4
|
type models = "haiku4.5" | "sonnet4.5" | "sonnet4" | "gpt5";
|
|
4
5
|
/**
|
|
5
6
|
* Predefined tool types that can be excluded from the Auggie agent.
|
|
6
7
|
* These are the built-in tools provided by Auggie.
|
|
7
8
|
*/
|
|
8
|
-
|
|
9
|
+
type PredefinedToolType = "remove-files" | "save-file" | "str-replace-editor" | "view" | "launch-process" | "kill-process" | "read-process" | "write-process" | "list-processes" | "web-search" | "add_tasks" | "update_tasks" | "reorganize_tasklist" | "view_tasklist";
|
|
9
10
|
/**
|
|
10
11
|
* Tool identifier type - can be a predefined tool or a custom tool name.
|
|
11
12
|
*/
|
|
12
|
-
|
|
13
|
+
type ToolIdentifier = PredefinedToolType | string;
|
|
13
14
|
type AuggieOptions = {
|
|
14
15
|
auggiePath?: string;
|
|
15
16
|
workspaceRoot?: string;
|
|
@@ -113,5 +114,5 @@ declare class Auggie {
|
|
|
113
114
|
*/
|
|
114
115
|
private killProcess;
|
|
115
116
|
}
|
|
116
|
-
|
|
117
|
-
|
|
117
|
+
|
|
118
|
+
export { Auggie, type PredefinedToolType, type ToolIdentifier };
|