@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.
Files changed (62) hide show
  1. package/README.md +56 -1
  2. package/dist/auggie/sdk-acp-client.d.ts +7 -6
  3. package/dist/auggie/sdk-acp-client.js +299 -332
  4. package/dist/auggie/sdk-mcp-server.d.ts +5 -3
  5. package/dist/auggie/sdk-mcp-server.js +102 -112
  6. package/dist/context/direct-context.d.ts +82 -22
  7. package/dist/context/direct-context.js +675 -562
  8. package/dist/context/filesystem-context.d.ts +5 -3
  9. package/dist/context/filesystem-context.js +187 -209
  10. package/dist/context/internal/__mocks__/api-client.d.ts +17 -11
  11. package/dist/context/internal/__mocks__/api-client.js +104 -91
  12. package/dist/context/internal/api-client.d.ts +14 -11
  13. package/dist/context/internal/api-client.js +234 -239
  14. package/dist/context/internal/blob-name-calculator.d.ts +5 -4
  15. package/dist/context/internal/blob-name-calculator.js +41 -38
  16. package/dist/context/internal/chat-utils.d.ts +6 -3
  17. package/dist/context/internal/chat-utils.js +5 -18
  18. package/dist/context/internal/credentials.d.ts +5 -4
  19. package/dist/context/internal/credentials.js +24 -38
  20. package/dist/context/internal/retry-utils.d.ts +5 -4
  21. package/dist/context/internal/retry-utils.js +60 -114
  22. package/dist/context/internal/search-utils.d.ts +3 -2
  23. package/dist/context/internal/search-utils.js +8 -9
  24. package/dist/context/internal/session-reader.d.ts +4 -3
  25. package/dist/context/internal/session-reader.js +14 -22
  26. package/dist/context/types.d.ts +132 -13
  27. package/dist/context/types.js +0 -5
  28. package/dist/index.d.ts +8 -7
  29. package/dist/index.js +14 -9
  30. package/dist/version.d.ts +3 -2
  31. package/dist/version.js +24 -38
  32. package/package.json +3 -2
  33. package/dist/auggie/sdk-acp-client.d.ts.map +0 -1
  34. package/dist/auggie/sdk-acp-client.js.map +0 -1
  35. package/dist/auggie/sdk-mcp-server.d.ts.map +0 -1
  36. package/dist/auggie/sdk-mcp-server.js.map +0 -1
  37. package/dist/context/direct-context.d.ts.map +0 -1
  38. package/dist/context/direct-context.js.map +0 -1
  39. package/dist/context/filesystem-context.d.ts.map +0 -1
  40. package/dist/context/filesystem-context.js.map +0 -1
  41. package/dist/context/internal/__mocks__/api-client.d.ts.map +0 -1
  42. package/dist/context/internal/__mocks__/api-client.js.map +0 -1
  43. package/dist/context/internal/api-client.d.ts.map +0 -1
  44. package/dist/context/internal/api-client.js.map +0 -1
  45. package/dist/context/internal/blob-name-calculator.d.ts.map +0 -1
  46. package/dist/context/internal/blob-name-calculator.js.map +0 -1
  47. package/dist/context/internal/chat-utils.d.ts.map +0 -1
  48. package/dist/context/internal/chat-utils.js.map +0 -1
  49. package/dist/context/internal/credentials.d.ts.map +0 -1
  50. package/dist/context/internal/credentials.js.map +0 -1
  51. package/dist/context/internal/retry-utils.d.ts.map +0 -1
  52. package/dist/context/internal/retry-utils.js.map +0 -1
  53. package/dist/context/internal/search-utils.d.ts.map +0 -1
  54. package/dist/context/internal/search-utils.js.map +0 -1
  55. package/dist/context/internal/session-reader.d.ts.map +0 -1
  56. package/dist/context/internal/session-reader.js.map +0 -1
  57. package/dist/context/types.d.ts.map +0 -1
  58. package/dist/context/types.js.map +0 -1
  59. package/dist/index.d.ts.map +0 -1
  60. package/dist/index.js.map +0 -1
  61. package/dist/version.d.ts.map +0 -1
  62. 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 { type SessionNotification } from "@agentclientprotocol/sdk";
2
- import type { Tool } from "ai";
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
- export 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
+ 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
- export type ToolIdentifier = PredefinedToolType | string;
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
- export { Auggie };
117
- //# sourceMappingURL=sdk-acp-client.d.ts.map
117
+
118
+ export { Auggie, type PredefinedToolType, type ToolIdentifier };