@augmentcode/auggie-sdk 0.1.9 → 0.1.11

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 (61) hide show
  1. package/dist/auggie/sdk-acp-client.d.ts +7 -6
  2. package/dist/auggie/sdk-acp-client.js +299 -332
  3. package/dist/auggie/sdk-mcp-server.d.ts +5 -3
  4. package/dist/auggie/sdk-mcp-server.js +102 -112
  5. package/dist/context/direct-context.d.ts +19 -15
  6. package/dist/context/direct-context.js +556 -567
  7. package/dist/context/filesystem-context.d.ts +5 -3
  8. package/dist/context/filesystem-context.js +187 -209
  9. package/dist/context/internal/__mocks__/api-client.d.ts +17 -11
  10. package/dist/context/internal/__mocks__/api-client.js +104 -91
  11. package/dist/context/internal/api-client.d.ts +15 -15
  12. package/dist/context/internal/api-client.js +233 -224
  13. package/dist/context/internal/blob-name-calculator.d.ts +5 -4
  14. package/dist/context/internal/blob-name-calculator.js +41 -38
  15. package/dist/context/internal/chat-utils.d.ts +6 -3
  16. package/dist/context/internal/chat-utils.js +5 -18
  17. package/dist/context/internal/credentials.d.ts +5 -4
  18. package/dist/context/internal/credentials.js +24 -38
  19. package/dist/context/internal/retry-utils.d.ts +5 -4
  20. package/dist/context/internal/retry-utils.js +60 -114
  21. package/dist/context/internal/search-utils.d.ts +3 -2
  22. package/dist/context/internal/search-utils.js +8 -9
  23. package/dist/context/internal/session-reader.d.ts +4 -3
  24. package/dist/context/internal/session-reader.js +14 -22
  25. package/dist/context/types.d.ts +17 -12
  26. package/dist/context/types.js +0 -5
  27. package/dist/index.d.ts +8 -7
  28. package/dist/index.js +14 -9
  29. package/dist/version.d.ts +3 -2
  30. package/dist/version.js +24 -38
  31. package/package.json +3 -2
  32. package/dist/auggie/sdk-acp-client.d.ts.map +0 -1
  33. package/dist/auggie/sdk-acp-client.js.map +0 -1
  34. package/dist/auggie/sdk-mcp-server.d.ts.map +0 -1
  35. package/dist/auggie/sdk-mcp-server.js.map +0 -1
  36. package/dist/context/direct-context.d.ts.map +0 -1
  37. package/dist/context/direct-context.js.map +0 -1
  38. package/dist/context/filesystem-context.d.ts.map +0 -1
  39. package/dist/context/filesystem-context.js.map +0 -1
  40. package/dist/context/internal/__mocks__/api-client.d.ts.map +0 -1
  41. package/dist/context/internal/__mocks__/api-client.js.map +0 -1
  42. package/dist/context/internal/api-client.d.ts.map +0 -1
  43. package/dist/context/internal/api-client.js.map +0 -1
  44. package/dist/context/internal/blob-name-calculator.d.ts.map +0 -1
  45. package/dist/context/internal/blob-name-calculator.js.map +0 -1
  46. package/dist/context/internal/chat-utils.d.ts.map +0 -1
  47. package/dist/context/internal/chat-utils.js.map +0 -1
  48. package/dist/context/internal/credentials.d.ts.map +0 -1
  49. package/dist/context/internal/credentials.js.map +0 -1
  50. package/dist/context/internal/retry-utils.d.ts.map +0 -1
  51. package/dist/context/internal/retry-utils.js.map +0 -1
  52. package/dist/context/internal/search-utils.d.ts.map +0 -1
  53. package/dist/context/internal/search-utils.js.map +0 -1
  54. package/dist/context/internal/session-reader.d.ts.map +0 -1
  55. package/dist/context/internal/session-reader.js.map +0 -1
  56. package/dist/context/types.d.ts.map +0 -1
  57. package/dist/context/types.js.map +0 -1
  58. package/dist/index.d.ts.map +0 -1
  59. package/dist/index.js.map +0 -1
  60. package/dist/version.d.ts.map +0 -1
  61. package/dist/version.js.map +0 -1
@@ -1,40 +1,26 @@
1
- import { readSessionFile } from "./session-reader";
2
- /**
3
- * Resolve API credentials from options, environment, or session file
4
- *
5
- * Priority order:
6
- * 1. options.apiKey and options.apiUrl (if provided)
7
- * 2. AUGMENT_API_TOKEN and AUGMENT_API_URL environment variables
8
- * 3. ~/.augment/session.json (created by `auggie login`)
9
- *
10
- * @param options - Optional credential options
11
- * @returns Resolved credentials
12
- * @throws Error if credentials cannot be resolved
13
- */
14
- export async function resolveCredentials(options = {}) {
15
- let apiKey = options.apiKey || process.env.AUGMENT_API_TOKEN;
16
- let apiUrl = options.apiUrl || process.env.AUGMENT_API_URL;
17
- // If credentials not provided, try session.json
18
- if (!(apiKey && apiUrl)) {
19
- const session = await readSessionFile();
20
- if (session) {
21
- apiKey = apiKey || session.accessToken;
22
- apiUrl = apiUrl || session.tenantURL;
23
- }
1
+ import { readSessionFile } from "./session-reader.js";
2
+ async function resolveCredentials(options = {}) {
3
+ let apiKey = options.apiKey || process.env.AUGMENT_API_TOKEN;
4
+ let apiUrl = options.apiUrl || process.env.AUGMENT_API_URL;
5
+ if (!(apiKey && apiUrl)) {
6
+ const session = await readSessionFile();
7
+ if (session) {
8
+ apiKey = apiKey || session.accessToken;
9
+ apiUrl = apiUrl || session.tenantURL;
24
10
  }
25
- // Validate we have credentials
26
- if (!apiKey) {
27
- throw new Error("API key is required. Provide it via:\n" +
28
- "1. options.apiKey parameter\n" +
29
- "2. AUGMENT_API_TOKEN environment variable\n" +
30
- "3. Run 'auggie login' to create ~/.augment/session.json");
31
- }
32
- if (!apiUrl) {
33
- throw new Error("API URL is required. Provide it via:\n" +
34
- "1. options.apiUrl parameter\n" +
35
- "2. AUGMENT_API_URL environment variable\n" +
36
- "3. Run 'auggie login' to create ~/.augment/session.json");
37
- }
38
- return { apiKey, apiUrl };
11
+ }
12
+ if (!apiKey) {
13
+ throw new Error(
14
+ "API key is required. Provide it via:\n1. options.apiKey parameter\n2. AUGMENT_API_TOKEN environment variable\n3. Run 'auggie login' to create ~/.augment/session.json"
15
+ );
16
+ }
17
+ if (!apiUrl) {
18
+ throw new Error(
19
+ "API URL is required. Provide it via:\n1. options.apiUrl parameter\n2. AUGMENT_API_URL environment variable\n3. Run 'auggie login' to create ~/.augment/session.json"
20
+ );
21
+ }
22
+ return { apiKey, apiUrl };
39
23
  }
40
- //# sourceMappingURL=credentials.js.map
24
+ export {
25
+ resolveCredentials
26
+ };
@@ -2,7 +2,7 @@
2
2
  * Retry utilities with exponential backoff
3
3
  * Based on clients/sidecar/libs/src/utils/promise-utils.ts
4
4
  */
5
- export type BackoffParams = {
5
+ type BackoffParams = {
6
6
  initialMS: number;
7
7
  mult: number;
8
8
  maxMS: number;
@@ -18,7 +18,7 @@ export type BackoffParams = {
18
18
  * @param backoffParams Backoff parameters
19
19
  * @returns Promise that resolves to the function's return value
20
20
  */
21
- export declare function retryWithBackoff<T>(fn: () => Promise<T>, debug?: boolean, backoffParams?: BackoffParams): Promise<T>;
21
+ declare function retryWithBackoff<T>(fn: () => Promise<T>, debug?: boolean, backoffParams?: BackoffParams): Promise<T>;
22
22
  /**
23
23
  * Retry a chat function with exponential backoff
24
24
  * Uses chat-specific retry logic that includes 429 and 529 status codes
@@ -28,5 +28,6 @@ export declare function retryWithBackoff<T>(fn: () => Promise<T>, debug?: boolea
28
28
  * @param backoffParams Backoff parameters (defaults to chat-optimized settings)
29
29
  * @returns Promise that resolves to the function's return value
30
30
  */
31
- export declare function retryChat<T>(fn: () => Promise<T>, debug?: boolean, backoffParams?: BackoffParams): Promise<T>;
32
- //# sourceMappingURL=retry-utils.d.ts.map
31
+ declare function retryChat<T>(fn: () => Promise<T>, debug?: boolean, backoffParams?: BackoffParams): Promise<T>;
32
+
33
+ export { type BackoffParams, retryChat, retryWithBackoff };
@@ -1,125 +1,71 @@
1
- /**
2
- * Retry utilities with exponential backoff
3
- * Based on clients/sidecar/libs/src/utils/promise-utils.ts
4
- */
5
1
  const defaultBackoffParams = {
6
- initialMS: 100,
7
- mult: 2,
8
- maxMS: 30000,
2
+ initialMS: 100,
3
+ mult: 2,
4
+ maxMS: 3e4
9
5
  };
10
- /**
11
- * Delay for the specified number of milliseconds
12
- */
13
6
  function delayMs(ms) {
14
- if (ms === 0) {
15
- return Promise.resolve();
16
- }
17
- return new Promise((resolve) => {
18
- setTimeout(resolve, ms);
19
- });
7
+ if (ms === 0) {
8
+ return Promise.resolve();
9
+ }
10
+ return new Promise((resolve) => {
11
+ setTimeout(resolve, ms);
12
+ });
20
13
  }
21
- /**
22
- * Check if an error is retriable based on its properties
23
- * Retriable errors include network errors and server errors (5xx)
24
- */
25
14
  function isRetriableError(e) {
26
- // Check for HTTP status codes
27
- if (e && typeof e === "object" && "status" in e) {
28
- const status = e.status;
29
- // Match the default VSCode client retry logic:
30
- // - 499 (cancelled)
31
- // - 503 (unavailable)
32
- // - 5xx (unavailable)
33
- //
34
- // Note: We do NOT retry 429 or 504 by default
35
- // (only chat streams retry those)
36
- return status === 499 || status === 503 || (status >= 500 && status < 600);
37
- }
38
- return false;
15
+ if (e && typeof e === "object" && "status" in e) {
16
+ const status = e.status;
17
+ return status === 499 || status === 503 || status >= 500 && status < 600;
18
+ }
19
+ return false;
39
20
  }
40
- /**
41
- * Check if an error is retriable for chat streaming endpoints
42
- * Chat streams retry additional status codes beyond the default retry logic
43
- */
44
21
  function isChatRetriableError(e) {
45
- // Check for HTTP status codes
46
- if (e && typeof e === "object" && "status" in e) {
47
- const status = e.status;
48
- // Chat streams retry:
49
- // - 429 (rate limit)
50
- // - 499 (cancelled)
51
- // - 503 (unavailable)
52
- // - 529 (overloaded)
53
- // - 5xx (server errors)
54
- return (status === 429 ||
55
- status === 499 ||
56
- status === 503 ||
57
- status === 529 ||
58
- (status >= 500 && status < 600));
59
- }
60
- return false;
22
+ if (e && typeof e === "object" && "status" in e) {
23
+ const status = e.status;
24
+ return status === 429 || status === 499 || status === 503 || status === 529 || status >= 500 && status < 600;
25
+ }
26
+ return false;
61
27
  }
62
- /**
63
- * Retry a function with exponential backoff
64
- *
65
- * @param fn The function to retry
66
- * @param debug Whether to log debug messages
67
- * @param backoffParams Backoff parameters
68
- * @returns Promise that resolves to the function's return value
69
- */
70
- export async function retryWithBackoff(fn, debug = false, backoffParams = defaultBackoffParams) {
71
- const canRetryFn = backoffParams.canRetry ?? isRetriableError;
72
- let backoffMs = 0;
73
- const startTime = Date.now();
74
- for (let tries = 0;; tries++) {
75
- try {
76
- const ret = await fn();
77
- if (tries > 0 && debug) {
78
- console.log(`[RetryUtils] Operation succeeded after ${tries} transient failures`);
79
- }
80
- return ret;
81
- }
82
- catch (e) {
83
- const currTryCount = tries + 1;
84
- // Check if we have exceeded the max number of retries
85
- if (backoffParams.maxTries !== undefined &&
86
- currTryCount >= backoffParams.maxTries) {
87
- throw e;
88
- }
89
- // Check if we should retry this error
90
- if (!canRetryFn(e)) {
91
- throw e;
92
- }
93
- // Calculate backoff delay
94
- backoffMs =
95
- backoffMs === 0
96
- ? backoffParams.initialMS
97
- : Math.min(backoffMs * backoffParams.mult, backoffParams.maxMS);
98
- if (debug) {
99
- console.log(`[RetryUtils] Operation failed with error ${e}, retrying in ${backoffMs} ms; retries = ${tries}`);
100
- }
101
- // Check if the backoff delay will exceed total time
102
- if (backoffParams.maxTotalMs !== undefined &&
103
- Date.now() - startTime + backoffMs > backoffParams.maxTotalMs) {
104
- throw e;
105
- }
106
- await delayMs(backoffMs);
107
- }
28
+ async function retryWithBackoff(fn, debug = false, backoffParams = defaultBackoffParams) {
29
+ const canRetryFn = backoffParams.canRetry ?? isRetriableError;
30
+ let backoffMs = 0;
31
+ const startTime = Date.now();
32
+ for (let tries = 0; ; tries++) {
33
+ try {
34
+ const ret = await fn();
35
+ if (tries > 0 && debug) {
36
+ console.log(
37
+ `[RetryUtils] Operation succeeded after ${tries} transient failures`
38
+ );
39
+ }
40
+ return ret;
41
+ } catch (e) {
42
+ const currTryCount = tries + 1;
43
+ if (backoffParams.maxTries !== void 0 && currTryCount >= backoffParams.maxTries) {
44
+ throw e;
45
+ }
46
+ if (!canRetryFn(e)) {
47
+ throw e;
48
+ }
49
+ backoffMs = backoffMs === 0 ? backoffParams.initialMS : Math.min(backoffMs * backoffParams.mult, backoffParams.maxMS);
50
+ if (debug) {
51
+ console.log(
52
+ `[RetryUtils] Operation failed with error ${e}, retrying in ${backoffMs} ms; retries = ${tries}`
53
+ );
54
+ }
55
+ if (backoffParams.maxTotalMs !== void 0 && Date.now() - startTime + backoffMs > backoffParams.maxTotalMs) {
56
+ throw e;
57
+ }
58
+ await delayMs(backoffMs);
108
59
  }
60
+ }
109
61
  }
110
- /**
111
- * Retry a chat function with exponential backoff
112
- * Uses chat-specific retry logic that includes 429 and 529 status codes
113
- *
114
- * @param fn The function to retry
115
- * @param debug Whether to log debug messages
116
- * @param backoffParams Backoff parameters (defaults to chat-optimized settings)
117
- * @returns Promise that resolves to the function's return value
118
- */
119
- export function retryChat(fn, debug = false, backoffParams = defaultBackoffParams) {
120
- return retryWithBackoff(fn, debug, {
121
- ...backoffParams,
122
- canRetry: isChatRetriableError,
123
- });
62
+ function retryChat(fn, debug = false, backoffParams = defaultBackoffParams) {
63
+ return retryWithBackoff(fn, debug, {
64
+ ...backoffParams,
65
+ canRetry: isChatRetriableError
66
+ });
124
67
  }
125
- //# sourceMappingURL=retry-utils.js.map
68
+ export {
69
+ retryChat,
70
+ retryWithBackoff
71
+ };
@@ -4,5 +4,6 @@
4
4
  /**
5
5
  * Format a question and search results into a prompt for the LLM
6
6
  */
7
- export declare function formatSearchPrompt(question: string, results: string): string;
8
- //# sourceMappingURL=search-utils.d.ts.map
7
+ declare function formatSearchPrompt(question: string, results: string): string;
8
+
9
+ export { formatSearchPrompt };
@@ -1,10 +1,9 @@
1
- /**
2
- * Shared utilities for search functionality across context modes
3
- */
4
- /**
5
- * Format a question and search results into a prompt for the LLM
6
- */
7
- export function formatSearchPrompt(question, results) {
8
- return `Relevant context:\n${results}\n\n${question}`;
1
+ function formatSearchPrompt(question, results) {
2
+ return `Relevant context:
3
+ ${results}
4
+
5
+ ${question}`;
9
6
  }
10
- //# sourceMappingURL=search-utils.js.map
7
+ export {
8
+ formatSearchPrompt
9
+ };
@@ -4,7 +4,7 @@
4
4
  /**
5
5
  * Structure of the session.json file created by `auggie login`
6
6
  */
7
- export type SessionData = {
7
+ type SessionData = {
8
8
  accessToken: string;
9
9
  tenantURL: string;
10
10
  scopes?: string[];
@@ -13,5 +13,6 @@ export type SessionData = {
13
13
  * Read session data from ~/.augment/session.json
14
14
  * Returns null if the file doesn't exist or can't be read
15
15
  */
16
- export declare function readSessionFile(): Promise<SessionData | null>;
17
- //# sourceMappingURL=session-reader.d.ts.map
16
+ declare function readSessionFile(): Promise<SessionData | null>;
17
+
18
+ export { type SessionData, readSessionFile };
@@ -1,27 +1,19 @@
1
- /**
2
- * Utility for reading Augment session file
3
- */
4
1
  import { readFile } from "node:fs/promises";
5
2
  import { homedir } from "node:os";
6
3
  import { join } from "node:path";
7
- /**
8
- * Read session data from ~/.augment/session.json
9
- * Returns null if the file doesn't exist or can't be read
10
- */
11
- export async function readSessionFile() {
12
- try {
13
- const sessionPath = join(homedir(), ".augment", "session.json");
14
- const content = await readFile(sessionPath, "utf-8");
15
- const data = JSON.parse(content);
16
- // Validate required fields
17
- if (!(data.accessToken && data.tenantURL)) {
18
- return null;
19
- }
20
- return data;
21
- }
22
- catch {
23
- // File doesn't exist or can't be read
24
- return null;
4
+ async function readSessionFile() {
5
+ try {
6
+ const sessionPath = join(homedir(), ".augment", "session.json");
7
+ const content = await readFile(sessionPath, "utf-8");
8
+ const data = JSON.parse(content);
9
+ if (!(data.accessToken && data.tenantURL)) {
10
+ return null;
25
11
  }
12
+ return data;
13
+ } catch {
14
+ return null;
15
+ }
26
16
  }
27
- //# sourceMappingURL=session-reader.js.map
17
+ export {
18
+ readSessionFile
19
+ };
@@ -4,7 +4,7 @@
4
4
  /**
5
5
  * Represents a file with path and contents (source-agnostic)
6
6
  */
7
- export type File = {
7
+ type File = {
8
8
  /** Relative path (e.g., "src/main.py") */
9
9
  path: string;
10
10
  /** File contents as string */
@@ -13,7 +13,7 @@ export type File = {
13
13
  /**
14
14
  * A single code chunk from the retrieval results
15
15
  */
16
- export type Chunk = {
16
+ type Chunk = {
17
17
  /** File path relative to workspace root */
18
18
  path: string;
19
19
  /** Starting line number (1-based) */
@@ -26,7 +26,7 @@ export type Chunk = {
26
26
  /**
27
27
  * Result from a codebase search query
28
28
  */
29
- export type SearchResult = {
29
+ type SearchResult = {
30
30
  /** Formatted retrieval results as markdown text */
31
31
  formattedRetrieval: string;
32
32
  /** Structured list of code chunks */
@@ -35,20 +35,24 @@ export type SearchResult = {
35
35
  /**
36
36
  * Blob information for a file
37
37
  */
38
- export type BlobInfo = {
38
+ type BlobInfo = {
39
39
  /** SHA-256 hash of the file path and contents */
40
40
  blobName: string;
41
41
  /** Relative path from workspace root */
42
42
  relativePath: string;
43
43
  };
44
44
  /**
45
- * Blob entry in persistent state - tuple of [blobName, path]
45
+ * Blob entry in persistent state - tuple of [serverBlobId, path, clientBlobId?]
46
+ *
47
+ * The third element (clientBlobId) is optional for backwards compatibility.
48
+ * When present, it indicates the server computed a different blob ID than the client.
49
+ * When absent, assume clientBlobId === serverBlobId.
46
50
  */
47
- export type BlobEntry = [blobName: string, path: string];
51
+ type BlobEntry = [serverBlobId: string, path: string, clientBlobId?: string];
48
52
  /**
49
53
  * Blobs payload for API requests
50
54
  */
51
- export type Blobs = {
55
+ type Blobs = {
52
56
  /** Optional checkpoint ID from previous indexing */
53
57
  checkpointId?: string;
54
58
  /** List of added blob names */
@@ -59,7 +63,7 @@ export type Blobs = {
59
63
  /**
60
64
  * Result from addToIndex operation
61
65
  */
62
- export type IndexingResult = {
66
+ type IndexingResult = {
63
67
  /** Paths that were newly uploaded to the backend (queued for indexing) */
64
68
  newlyUploaded: string[];
65
69
  /** Paths that were already uploaded (content unchanged or already on server) */
@@ -68,7 +72,7 @@ export type IndexingResult = {
68
72
  /**
69
73
  * Options for configuring the Direct Context
70
74
  */
71
- export type DirectContextOptions = {
75
+ type DirectContextOptions = {
72
76
  /**
73
77
  * API key for authentication
74
78
  * Optional - falls back to AUGMENT_API_TOKEN env var, then ~/.augment/session.json
@@ -89,7 +93,7 @@ export type DirectContextOptions = {
89
93
  /**
90
94
  * State for Direct Context that can be exported/imported
91
95
  */
92
- export type DirectContextState = {
96
+ type DirectContextState = {
93
97
  /** Current checkpoint ID */
94
98
  checkpointId?: string;
95
99
  /** Array of blob names that have been added (pending checkpoint) */
@@ -102,7 +106,7 @@ export type DirectContextState = {
102
106
  /**
103
107
  * Options for FileSystem Context (MCP mode)
104
108
  */
105
- export type FileSystemContextOptions = {
109
+ type FileSystemContextOptions = {
106
110
  /** Path to the workspace directory to index */
107
111
  directory: string;
108
112
  /** Path to auggie executable (default: "auggie") */
@@ -110,4 +114,5 @@ export type FileSystemContextOptions = {
110
114
  /** Enable debug logging */
111
115
  debug?: boolean;
112
116
  };
113
- //# sourceMappingURL=types.d.ts.map
117
+
118
+ export type { BlobEntry, BlobInfo, Blobs, Chunk, DirectContextOptions, DirectContextState, File, FileSystemContextOptions, IndexingResult, SearchResult };
@@ -1,5 +0,0 @@
1
- /**
2
- * Types for the Context SDK
3
- */
4
- export {};
5
- //# sourceMappingURL=types.js.map
package/dist/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
- export { Auggie, type PredefinedToolType, type ToolIdentifier, } from "./auggie/sdk-acp-client";
2
- export { DirectContext } from "./context/direct-context";
3
- export { FileSystemContext } from "./context/filesystem-context";
4
- export { APIError } from "./context/internal/api-client";
5
- export { BlobTooLargeError } from "./context/internal/blob-name-calculator";
6
- export type { BlobEntry, BlobInfo, Blobs, DirectContextOptions, DirectContextState, File, FileSystemContextOptions, IndexingResult, } from "./context/types";
7
- //# sourceMappingURL=index.d.ts.map
1
+ export { Auggie, PredefinedToolType, ToolIdentifier } from './auggie/sdk-acp-client.js';
2
+ export { DirectContext } from './context/direct-context.js';
3
+ export { FileSystemContext } from './context/filesystem-context.js';
4
+ export { APIError } from './context/internal/api-client.js';
5
+ export { BlobTooLargeError } from './context/internal/blob-name-calculator.js';
6
+ export { BlobEntry, BlobInfo, Blobs, DirectContextOptions, DirectContextState, File, FileSystemContextOptions, IndexingResult } from './context/types.js';
7
+ import '@agentclientprotocol/sdk';
8
+ import 'ai';
package/dist/index.js CHANGED
@@ -1,9 +1,14 @@
1
- // ACP Client (existing)
2
- export { Auggie, } from "./auggie/sdk-acp-client";
3
- // Context Modes
4
- export { DirectContext } from "./context/direct-context";
5
- export { FileSystemContext } from "./context/filesystem-context";
6
- // Context Errors
7
- export { APIError } from "./context/internal/api-client";
8
- export { BlobTooLargeError } from "./context/internal/blob-name-calculator";
9
- //# sourceMappingURL=index.js.map
1
+ import {
2
+ Auggie
3
+ } from "./auggie/sdk-acp-client.js";
4
+ import { DirectContext } from "./context/direct-context.js";
5
+ import { FileSystemContext } from "./context/filesystem-context.js";
6
+ import { APIError } from "./context/internal/api-client.js";
7
+ import { BlobTooLargeError } from "./context/internal/blob-name-calculator.js";
8
+ export {
9
+ APIError,
10
+ Auggie,
11
+ BlobTooLargeError,
12
+ DirectContext,
13
+ FileSystemContext
14
+ };
package/dist/version.d.ts CHANGED
@@ -12,5 +12,6 @@
12
12
  *
13
13
  * @returns The version string from package.json, or "unknown" if it cannot be read
14
14
  */
15
- export declare function getSDKVersion(): string;
16
- //# sourceMappingURL=version.d.ts.map
15
+ declare function getSDKVersion(): string;
16
+
17
+ export { getSDKVersion };
package/dist/version.js CHANGED
@@ -1,43 +1,29 @@
1
- /**
2
- * Version information for the Auggie TypeScript SDK
3
- *
4
- * This module provides the SDK version by reading it from package.json.
5
- * The version is read at runtime to ensure it stays in sync with the package.json version.
6
- */
7
1
  import { readFileSync } from "node:fs";
8
2
  import { dirname, join } from "node:path";
9
3
  import { fileURLToPath } from "node:url";
10
4
  let cachedVersion;
11
- /**
12
- * Get the SDK version from package.json
13
- *
14
- * This function reads the version from package.json at runtime and caches it.
15
- * It works in both development and production environments.
16
- *
17
- * @returns The version string from package.json, or "unknown" if it cannot be read
18
- */
19
- export function getSDKVersion() {
20
- if (cachedVersion) {
21
- return cachedVersion;
22
- }
23
- try {
24
- // Get the directory of this file
25
- const currentFileUrl = import.meta.url;
26
- const currentFilePath = fileURLToPath(currentFileUrl);
27
- const currentDir = dirname(currentFilePath);
28
- // Navigate up to the package root
29
- // In development: typescript-sdk/src/version.ts -> typescript-sdk/package.json
30
- // In production: typescript-sdk/dist/version.js -> typescript-sdk/package.json
31
- const packageJsonPath = join(currentDir, "..", "package.json");
32
- const packageJsonContent = readFileSync(packageJsonPath, "utf-8");
33
- const packageJson = JSON.parse(packageJsonContent);
34
- cachedVersion = packageJson.version || "unknown";
35
- return cachedVersion;
36
- }
37
- catch (error) {
38
- console.warn("Failed to read SDK version from package.json:", error instanceof Error ? error.message : String(error));
39
- cachedVersion = "unknown";
40
- return cachedVersion;
41
- }
5
+ function getSDKVersion() {
6
+ if (cachedVersion) {
7
+ return cachedVersion;
8
+ }
9
+ try {
10
+ const currentFileUrl = import.meta.url;
11
+ const currentFilePath = fileURLToPath(currentFileUrl);
12
+ const currentDir = dirname(currentFilePath);
13
+ const packageJsonPath = join(currentDir, "..", "package.json");
14
+ const packageJsonContent = readFileSync(packageJsonPath, "utf-8");
15
+ const packageJson = JSON.parse(packageJsonContent);
16
+ cachedVersion = packageJson.version || "unknown";
17
+ return cachedVersion;
18
+ } catch (error) {
19
+ console.warn(
20
+ "Failed to read SDK version from package.json:",
21
+ error instanceof Error ? error.message : String(error)
22
+ );
23
+ cachedVersion = "unknown";
24
+ return cachedVersion;
25
+ }
42
26
  }
43
- //# sourceMappingURL=version.js.map
27
+ export {
28
+ getSDKVersion
29
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@augmentcode/auggie-sdk",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "description": "TypeScript SDK for Auggie",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -16,7 +16,7 @@
16
16
  "dist"
17
17
  ],
18
18
  "scripts": {
19
- "build": "tsc --project tsconfig.build.json",
19
+ "build": "tsup",
20
20
  "prepublishOnly": "bun run build",
21
21
  "dev": "bun ./examples/dev.ts",
22
22
  "silent": "bun ./examples/silent.ts",
@@ -27,6 +27,7 @@
27
27
  "@biomejs/biome": "2.3.4",
28
28
  "@types/bun": "latest",
29
29
  "husky": "^9.1.7",
30
+ "tsup": "^8.5.1",
30
31
  "ultracite": "6.3.0"
31
32
  },
32
33
  "peerDependencies": {
@@ -1 +0,0 @@
1
- {"version":3,"file":"sdk-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