@augmentcode/auggie-sdk 0.1.2 → 0.1.4

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 (3) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +16 -31
  3. package/package.json +35 -37
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Augment Code Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
package/README.md CHANGED
@@ -36,10 +36,9 @@ pnpm add /path/to/auggie-sdk
36
36
  import { Auggie } from "@augmentcode/auggie-sdk";
37
37
 
38
38
  async function main() {
39
- // Create and initialize Auggie (automatically connects and creates a session)
39
+ // Create and initialize Auggie instance
40
40
  const client = await Auggie.create({
41
41
  model: "sonnet4.5", // Optional: haiku4.5, opus4.1, sonnet4.5, sonnet4
42
- debug: false, // Optional: enable debug logging
43
42
  apiKey: "your-api-key", // Optional: API key for authentication
44
43
  apiUrl: "https://api.augmentcode.com", // Optional: API URL
45
44
  });
@@ -51,7 +50,7 @@ async function main() {
51
50
  });
52
51
 
53
52
  // Send a prompt
54
- const response = await client.sendPrompt("What files are in the current directory?");
53
+ const response = await client.prompt("What files are in the current directory?");
55
54
  console.log("Response:", response);
56
55
 
57
56
  // Close the connection
@@ -126,14 +125,14 @@ const weatherTool = tool({
126
125
  });
127
126
 
128
127
  async function main() {
129
- // Pass tools when creating the instance
128
+ // Create the instance with tools
130
129
  const client = await Auggie.create({
131
130
  model: "sonnet4.5",
132
- toolsMap: { weather_tool: weatherTool }
131
+ toolsMap: { weather_tool: weatherTool },
133
132
  });
134
133
 
135
134
  try {
136
- const response = await client.sendPrompt("What's the weather in San Francisco?");
135
+ const response = await client.prompt("What's the weather in San Francisco?");
137
136
  console.log(response);
138
137
 
139
138
  await client.close();
@@ -152,10 +151,10 @@ When the agent uses tools (like file operations, web searches, etc.), you can ch
152
151
 
153
152
  ```typescript
154
153
  // Get all agent responses (default behavior)
155
- const fullResponse = await client.sendPrompt("List all TypeScript files in this project");
154
+ const fullResponse = await client.prompt("List all TypeScript files in this project");
156
155
 
157
156
  // Get only the final response after tool calls
158
- const finalAnswer = await client.sendPrompt(
157
+ const finalAnswer = await client.prompt(
159
158
  "List all TypeScript files in this project",
160
159
  { isAnswerOnly: true }
161
160
  );
@@ -209,7 +208,6 @@ const client = await Auggie.create({
209
208
  auggiePath: "/path/to/auggie",
210
209
  workspaceRoot: "/path/to/workspace",
211
210
  model: "sonnet4.5",
212
- debug: true,
213
211
  allowIndexing: true,
214
212
  apiKey: "your-api-key", // Optional
215
213
  apiUrl: "https://api.augmentcode.com", // Optional
@@ -226,40 +224,28 @@ const client = await Auggie.create({
226
224
  static async create(options?: AuggieOptions): Promise<Auggie>
227
225
  ```
228
226
 
229
- Creates a new Auggie instance and automatically connects and initializes a session.
227
+ Creates and initializes a new Auggie instance. This method automatically connects to the ACP server and creates a session before returning.
230
228
 
231
229
  **Options:**
232
230
  - `auggiePath?: string` - Path to the Auggie executable (default: "auggie")
233
231
  - `workspaceRoot?: string` - Working directory for the Auggie process (default: `process.cwd()`)
234
- - `debug?: boolean` - Enable debug logging (default: false)
235
232
  - `model?: "haiku4.5" | "opus4.1" | "sonnet4.5" | "sonnet4"` - Model to use (default: "haiku4.5")
236
233
  - `allowIndexing?: boolean` - Allow codebase indexing (default: true)
237
234
  - `toolsMap?: Record<string, Tool>` - Custom tools to provide to Auggie (optional)
238
235
  - `apiKey?: string` - API key for authentication (optional, sets AUGMENT_API_TOKEN)
239
236
  - `apiUrl?: string` - API URL for authentication (optional, sets AUGMENT_API_URL)
240
237
 
241
- #### Methods
242
-
243
- ##### `connect(): Promise<void>`
244
-
245
- Launches Auggie in ACP mode and establishes a connection. (Called automatically by `create()`)
246
-
247
- ##### `createSession(toolsMap?: Record<string, Tool>): Promise<string>`
238
+ When `toolsMap` is provided, an MCP server is automatically started and connected to the session.
248
239
 
249
- Creates a new session. (Called automatically by `create()`)
240
+ **Note:** The constructor is private. Always use `Auggie.create()` to instantiate the class.
250
241
 
251
- Creates a new conversation session with the agent.
252
-
253
- - `toolsMap`: Optional map of tool names to AI SDK Tool objects
254
- - Returns: Session ID
255
-
256
- When tools are provided, an MCP server is automatically started and connected to the session.
242
+ #### Methods
257
243
 
258
- ##### `sendPrompt(prompt: string, options?: { isAnswerOnly?: boolean }): Promise<string>`
244
+ ##### `prompt(message: string, options?: { isAnswerOnly?: boolean }): Promise<string>`
259
245
 
260
246
  Sends a prompt to the agent and waits for completion.
261
247
 
262
- - `prompt`: The text prompt to send
248
+ - `message`: The text prompt to send
263
249
  - `options.isAnswerOnly`: Optional boolean (default: `false`). When set to `true`, returns only the final response after all tool calls complete. When `false` or omitted, returns all agent message chunks including any intermediate responses.
264
250
  - Returns: The accumulated text response from the agent
265
251
 
@@ -334,8 +320,7 @@ const weatherTool = tool({
334
320
  async function main() {
335
321
  const client = await Auggie.create({
336
322
  model: "sonnet4.5",
337
- debug: true,
338
- toolsMap: { weather_tool: weatherTool }
323
+ toolsMap: { weather_tool: weatherTool },
339
324
  });
340
325
 
341
326
  try {
@@ -357,7 +342,7 @@ async function main() {
357
342
  }
358
343
  });
359
344
 
360
- const response = await client.sendPrompt(
345
+ const response = await client.prompt(
361
346
  "What's the weather in Tokyo?",
362
347
  { isAnswerOnly: true }
363
348
  );
@@ -378,7 +363,7 @@ main();
378
363
  ```typescript
379
364
  try {
380
365
  const client = await Auggie.create();
381
- await client.sendPrompt("Hello!");
366
+ await client.prompt("Hello!");
382
367
  await client.close();
383
368
  } catch (error) {
384
369
  if (error instanceof Error) {
package/package.json CHANGED
@@ -1,39 +1,37 @@
1
1
  {
2
- "name": "@augmentcode/auggie-sdk",
3
- "version": "0.1.2",
4
- "description": "TypeScript SDK for Auggie",
5
- "type": "module",
6
- "main": "./dist/index.js",
7
- "module": "./dist/index.js",
8
- "types": "./dist/index.d.ts",
9
- "exports": {
10
- ".": {
11
- "types": "./dist/index.d.ts",
12
- "import": "./dist/index.js"
13
- }
14
- },
15
- "files": [
16
- "dist"
17
- ],
18
- "scripts": {
19
- "build": "tsc --project tsconfig.build.json",
20
- "dev": "bun ./examples/dev.ts",
21
- "silent": "bun ./examples/silent.ts",
22
- "prepare": "husky"
23
- },
24
- "devDependencies": {
25
- "@biomejs/biome": "2.3.4",
26
- "@types/bun": "latest",
27
- "husky": "^9.1.7",
28
- "ultracite": "6.3.0"
29
- },
30
- "peerDependencies": {
31
- "typescript": "^5"
32
- },
33
- "dependencies": {
34
- "@agentclientprotocol/sdk": "^0.5.1",
35
- "@mastra/mcp": "^0.14.1",
36
- "ai": "^5.0.86",
37
- "zod": "^4.1.12"
38
- }
2
+ "name": "@augmentcode/auggie-sdk",
3
+ "version": "0.1.4",
4
+ "description": "TypeScript SDK for Auggie",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js"
13
+ }
14
+ },
15
+ "files": ["dist"],
16
+ "scripts": {
17
+ "build": "tsc --project tsconfig.build.json",
18
+ "dev": "bun ./examples/dev.ts",
19
+ "silent": "bun ./examples/silent.ts",
20
+ "prepare": "husky"
21
+ },
22
+ "devDependencies": {
23
+ "@biomejs/biome": "2.3.4",
24
+ "@types/bun": "latest",
25
+ "husky": "^9.1.7",
26
+ "ultracite": "6.3.0"
27
+ },
28
+ "peerDependencies": {
29
+ "typescript": "^5"
30
+ },
31
+ "dependencies": {
32
+ "@agentclientprotocol/sdk": "^0.5.1",
33
+ "@mastra/mcp": "^0.14.1",
34
+ "ai": "^5.0.86",
35
+ "zod": "^4.1.12"
36
+ }
39
37
  }