@augmentcode/auggie-sdk 0.1.4 → 0.1.6

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 CHANGED
@@ -1,27 +1,52 @@
1
1
  # Auggie SDK
2
2
 
3
- A TypeScript SDK for connecting to Auggie as an ACP (Agent Client Protocol) server with support for custom tools via MCP (Model Context Protocol).
3
+ A TypeScript SDK for building AI-powered developer tools with Auggie.
4
4
 
5
- ## Overview
5
+ ## Features
6
6
 
7
- This SDK provides a simple way to:
8
- 1. Launch Auggie in ACP mode
9
- 2. Establish a bidirectional communication channel
10
- 3. Initialize sessions with custom tools
11
- 4. Send prompts and receive responses
12
- 5. Handle session updates and permission requests
13
- 6. Integrate custom tools using the AI SDK tool format
7
+ ### 🤖 Agent Interaction (ACP)
8
+ **Requires: Local Auggie installation**
9
+
10
+ - Launch Auggie in ACP mode and communicate bidirectionally
11
+ - Send prompts and receive streaming responses
12
+ - Integrate custom tools using the AI SDK tool format
13
+ - Handle session updates and permission requests
14
+
15
+ ### 🔍 Context Modes
16
+ Two different ways to index and search code:
17
+
18
+ 1. **Direct Context** - API-based indexing with state persistence
19
+ **Requires: API credentials only (no local Auggie needed)**
20
+ - Explicitly add files to the index
21
+ - Export/import state to avoid re-indexing
22
+ - Perfect for embedded search in applications
23
+
24
+ 2. **FileSystem Context** - Local directory retrieval via MCP
25
+ **Requires: Local Auggie installation**
26
+ - Automatically index a workspace directory
27
+ - Spawns `auggie --mcp` for local search
28
+ - Ideal for IDE extensions and local tools
14
29
 
15
30
  ## Installation
16
31
 
17
- ### From tarball (recommended for distribution)
32
+ ### Install Auggie CLI
33
+
34
+ Install the Auggie CLI:
35
+
36
+ ```bash
37
+ npm install -g @augmentcode/auggie
38
+ ```
39
+
40
+ ### Install the SDK
41
+
42
+ #### From tarball (recommended for distribution)
18
43
  ```bash
19
44
  npm install /path/to/augmentcode-auggie-sdk-0.1.0.tgz
20
45
  # or
21
46
  pnpm add /path/to/augmentcode-auggie-sdk-0.1.0.tgz
22
47
  ```
23
48
 
24
- ### From local directory (for development)
49
+ #### From local directory (for development)
25
50
  ```bash
26
51
  npm install /path/to/auggie-sdk
27
52
  # or
@@ -30,7 +55,11 @@ pnpm add /path/to/auggie-sdk
30
55
 
31
56
  ## Usage
32
57
 
33
- ### Basic Example
58
+ ### Agent Interaction (ACP)
59
+
60
+ **⚠️ Requires Local Auggie Installation**
61
+
62
+ For complex agent tasks with tools and codebase context:
34
63
 
35
64
  ```typescript
36
65
  import { Auggie } from "@augmentcode/auggie-sdk";
@@ -40,7 +69,7 @@ async function main() {
40
69
  const client = await Auggie.create({
41
70
  model: "sonnet4.5", // Optional: haiku4.5, opus4.1, sonnet4.5, sonnet4
42
71
  apiKey: "your-api-key", // Optional: API key for authentication
43
- apiUrl: "https://api.augmentcode.com", // Optional: API URL
72
+ apiUrl: "https://your-tenant.api.augmentcode.com", // Required when apiKey is provided
44
73
  });
45
74
 
46
75
  try {
@@ -81,7 +110,7 @@ This stores your OAuth session and is automatically used by the SDK.
81
110
  ```typescript
82
111
  const client = await Auggie.create({
83
112
  apiKey: "your-api-key",
84
- apiUrl: "https://api.augmentcode.com",
113
+ apiUrl: "https://your-tenant.api.augmentcode.com", // Your tenant-specific URL
85
114
  model: "sonnet4.5",
86
115
  });
87
116
  ```
@@ -90,7 +119,7 @@ const client = await Auggie.create({
90
119
 
91
120
  ```bash
92
121
  export AUGMENT_API_TOKEN="your-api-key"
93
- export AUGMENT_API_URL="https://api.augmentcode.com"
122
+ export AUGMENT_API_URL="https://your-tenant.api.augmentcode.com" # Your tenant-specific URL
94
123
  ```
95
124
 
96
125
  Then create the client without specifying credentials:
@@ -128,7 +157,7 @@ async function main() {
128
157
  // Create the instance with tools
129
158
  const client = await Auggie.create({
130
159
  model: "sonnet4.5",
131
- toolsMap: { weather_tool: weatherTool },
160
+ tools: { weather_tool: weatherTool },
132
161
  });
133
162
 
134
163
  try {
@@ -145,6 +174,78 @@ async function main() {
145
174
  main();
146
175
  ```
147
176
 
177
+ ### Excluding Tools
178
+
179
+ You can disable specific tools by providing a list of tool identifiers to exclude. This is useful when you want to restrict the agent's capabilities or prevent it from using certain integrations.
180
+
181
+ ```typescript
182
+ import { Auggie } from "@augmentcode/auggie-sdk";
183
+
184
+ async function main() {
185
+ // Exclude integration tools
186
+ const client = await Auggie.create({
187
+ model: "sonnet4.5",
188
+ excludedTools: ["web-search", "linear", "notion"],
189
+ });
190
+
191
+ try {
192
+ const response = await client.prompt("What tools do you have available?");
193
+ console.log(response);
194
+
195
+ await client.close();
196
+ } catch (error) {
197
+ console.error("Error:", error);
198
+ await client.close();
199
+ }
200
+ }
201
+
202
+ main();
203
+ ```
204
+
205
+ #### Available Tool Types
206
+
207
+ The SDK provides TypeScript types for all predefined tools:
208
+
209
+ ```typescript
210
+ import { Auggie, type PredefinedToolType, type ToolIdentifier } from "@augmentcode/auggie-sdk";
211
+
212
+ // PredefinedToolType includes:
213
+ // File operation tools: "remove-files", "save-file", "str-replace-editor", "view"
214
+ // Process management tools: "launch-process", "kill-process", "read-process", "write-process", "list-processes"
215
+ // Integration tools: "web-search"
216
+ // Task management tools: "add_tasks", "update_tasks", "reorganize_tasklist", "view_tasklist"
217
+
218
+ // You can also exclude custom tool names (strings)
219
+ const client = await Auggie.create({
220
+ excludedTools: ["launch-process", "my-custom-tool"],
221
+ });
222
+ ```
223
+
224
+ #### Common Use Cases
225
+
226
+ **Disable process execution tools for security:**
227
+ ```typescript
228
+ const client = await Auggie.create({
229
+ excludedTools: ["launch-process", "kill-process", "read-process", "write-process", "list-processes"],
230
+ });
231
+ ```
232
+
233
+ **Disable integration tools:**
234
+ ```typescript
235
+ const INTEGRATION_TOOLS = ["web-search"];
236
+
237
+ const client = await Auggie.create({
238
+ excludedTools: INTEGRATION_TOOLS,
239
+ });
240
+ ```
241
+
242
+ **Disable file modification tools:**
243
+ ```typescript
244
+ const client = await Auggie.create({
245
+ excludedTools: ["save-file", "str-replace-editor", "remove-files"],
246
+ });
247
+ ```
248
+
148
249
  ### Getting Only the Final Response
149
250
 
150
251
  When the agent uses tools (like file operations, web searches, etc.), you can choose to get only the final answer after all tool executions complete:
@@ -198,7 +299,7 @@ npm run dev "What's the weather in Tokyo?"
198
299
  npm run silent "What's the weather in Paris?"
199
300
 
200
301
  # Run with API key authentication
201
- AUGMENT_API_TOKEN=your-key AUGMENT_API_URL=https://api.augmentcode.com npm run with-api-key "List files"
302
+ AUGMENT_API_TOKEN=your-key AUGMENT_API_URL=https://your-tenant.api.augmentcode.com npm run with-api-key "List files"
202
303
  ```
203
304
 
204
305
  ### Custom Auggie Path and Workspace
@@ -210,8 +311,74 @@ const client = await Auggie.create({
210
311
  model: "sonnet4.5",
211
312
  allowIndexing: true,
212
313
  apiKey: "your-api-key", // Optional
213
- apiUrl: "https://api.augmentcode.com", // Optional
314
+ apiUrl: "https://your-tenant.api.augmentcode.com", // Required when apiKey is provided
315
+ });
316
+ ```
317
+
318
+ ## Context Modes
319
+
320
+ The SDK provides two context modes for codebase indexing and search.
321
+
322
+ ### Direct Context
323
+
324
+ **✅ No Local Auggie Required - API Only**
325
+
326
+ API-based indexing with state persistence:
327
+
328
+ ```typescript
329
+ import { DirectContext } from "@augmentcode/auggie-sdk";
330
+
331
+ // Authentication is automatic via:
332
+ // 1. Environment variables (AUGMENT_API_TOKEN, AUGMENT_API_URL)
333
+ // 2. ~/.augment/session.json (created by `auggie login`)
334
+ // 3. Or pass credentials directly in options
335
+ const context = await DirectContext.create();
336
+
337
+ // Add files to index
338
+ await context.addToIndex([
339
+ { path: "src/main.ts", contents: "..." }
340
+ ]);
341
+
342
+ // Search - returns results in a formatted string ready for LLM use or display
343
+ const results = await context.search("authentication logic");
344
+ console.log(results);
345
+
346
+ // Or use searchAndAsk for one-step Q&A
347
+ const answer = await context.searchAndAsk(
348
+ "authentication logic",
349
+ "How does authentication work?"
350
+ );
351
+ console.log(answer);
352
+
353
+ // Export state to avoid re-indexing
354
+ await context.exportToFile("/tmp/state.json");
355
+ ```
356
+
357
+ ### FileSystem Context
358
+
359
+ **⚠️ Requires Local Auggie Installation**
360
+
361
+ Local directory retrieval via MCP:
362
+
363
+ ```typescript
364
+ import { FileSystemContext } from "@augmentcode/auggie-sdk";
365
+
366
+ const context = await FileSystemContext.create({
367
+ directory: "/path/to/workspace",
214
368
  });
369
+
370
+ // Search workspace - returns formatted string ready for LLM use or display
371
+ const results = await context.search("authentication logic");
372
+ console.log(results);
373
+
374
+ // Or use searchAndAsk for one-step Q&A
375
+ const answer = await context.searchAndAsk(
376
+ "authentication logic",
377
+ "How does authentication work?"
378
+ );
379
+ console.log(answer);
380
+
381
+ await context.close();
215
382
  ```
216
383
 
217
384
  ## API Reference
@@ -231,11 +398,13 @@ Creates and initializes a new Auggie instance. This method automatically connect
231
398
  - `workspaceRoot?: string` - Working directory for the Auggie process (default: `process.cwd()`)
232
399
  - `model?: "haiku4.5" | "opus4.1" | "sonnet4.5" | "sonnet4"` - Model to use (default: "haiku4.5")
233
400
  - `allowIndexing?: boolean` - Allow codebase indexing (default: true)
234
- - `toolsMap?: Record<string, Tool>` - Custom tools to provide to Auggie (optional)
401
+ - `tools?: Record<string, Tool>` - Custom tools to provide to Auggie (optional)
402
+ - `toolsMap?: Record<string, Tool>` - **Deprecated:** Use `tools` instead. Kept for backwards compatibility.
235
403
  - `apiKey?: string` - API key for authentication (optional, sets AUGMENT_API_TOKEN)
236
404
  - `apiUrl?: string` - API URL for authentication (optional, sets AUGMENT_API_URL)
405
+ - `excludedTools?: ToolIdentifier[]` - List of tool identifiers to exclude/disable (optional)
237
406
 
238
- When `toolsMap` is provided, an MCP server is automatically started and connected to the session.
407
+ When `tools` (or `toolsMap`) is provided, an MCP server is automatically started and connected to the session.
239
408
 
240
409
  **Note:** The constructor is private. Always use `Auggie.create()` to instantiate the class.
241
410
 
@@ -320,7 +489,7 @@ const weatherTool = tool({
320
489
  async function main() {
321
490
  const client = await Auggie.create({
322
491
  model: "sonnet4.5",
323
- toolsMap: { weather_tool: weatherTool },
492
+ tools: { weather_tool: weatherTool },
324
493
  });
325
494
 
326
495
  try {
@@ -374,9 +543,16 @@ try {
374
543
 
375
544
  ## Requirements
376
545
 
546
+ ### All Features
377
547
  - Node.js 18+
378
- - Auggie CLI installed and accessible in PATH (or provide custom path)
379
- - Auggie must be authenticated (`auggie login`)
548
+
549
+ ### Agent Interaction (ACP) & FileSystem Context
550
+ - Auggie CLI installed and accessible in PATH (or provide custom path via `auggiePath` option)
551
+ - Auggie must be authenticated (`auggie login`) or provide API credentials
552
+
553
+ ### Direct Context Only
554
+ - API credentials (via `auggie login`, environment variables, or passed directly)
555
+ - **No local Auggie installation required**
380
556
 
381
557
  ## Building the Package
382
558
 
@@ -421,7 +597,7 @@ This starts Auggie in ACP server mode, communicating via stdio using newline-del
421
597
  - [Agent Client Protocol Documentation](https://agentclientprotocol.com/)
422
598
  - [ACP TypeScript SDK](https://github.com/agentclientprotocol/typescript-sdk)
423
599
  - [AI SDK Documentation](https://sdk.vercel.ai/docs)
424
- - [Mastra MCP Documentation](https://mastra.ai/docs/mcp)
600
+ - [Mastra MCP Documentation](https://mastra.ai/docs/mcp/overview)
425
601
 
426
602
  ## License
427
603
 
@@ -1,14 +1,144 @@
1
1
  import { type SessionNotification } from "@agentclientprotocol/sdk";
2
2
  import type { Tool } from "ai";
3
- type models = "haiku4.5" | "opus4.1" | "sonnet4.5" | "sonnet4";
3
+ type models = "haiku4.5" | "sonnet4.5" | "sonnet4" | "gpt5";
4
+ /**
5
+ * Predefined tool types that can be excluded from the Auggie agent.
6
+ * These are the built-in tools provided by Auggie.
7
+ */
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
+ /**
10
+ * Tool identifier type - can be a predefined tool or a custom tool name.
11
+ */
12
+ export type ToolIdentifier = PredefinedToolType | string;
13
+ /**
14
+ * Tool permission types that control how tools are executed.
15
+ */
16
+ export type ToolPermission = {
17
+ /** Always allow the tool to run without approval */
18
+ type: "allow";
19
+ } | {
20
+ /** Always deny the tool from running */
21
+ type: "deny";
22
+ } | {
23
+ /** Require user approval before running (default behavior) */
24
+ type: "ask-user";
25
+ } | {
26
+ /** Use a webhook to determine if the tool should run */
27
+ type: "webhook-policy";
28
+ /** URL of the webhook endpoint */
29
+ webhookUrl: string;
30
+ } | {
31
+ /** Use a script to determine if the tool should run */
32
+ type: "script-policy";
33
+ /** Path to the script file */
34
+ script: string;
35
+ };
36
+ /**
37
+ * Tool permission rule that specifies permissions for a specific tool.
38
+ *
39
+ * @example
40
+ * ```typescript
41
+ * // Allow a tool to run without approval
42
+ * { toolName: "view", permission: { type: "allow" } }
43
+ *
44
+ * // Deny a tool from running
45
+ * { toolName: "launch-process", permission: { type: "deny" } }
46
+ *
47
+ * // Require user approval
48
+ * { toolName: "remove-files", permission: { type: "ask-user" } }
49
+ *
50
+ * // Use a webhook for dynamic permission checking
51
+ * {
52
+ * toolName: "github-api",
53
+ * permission: {
54
+ * type: "webhook-policy",
55
+ * webhookUrl: "https://example.com/webhook"
56
+ * }
57
+ * }
58
+ *
59
+ * // Use a script for custom permission logic
60
+ * {
61
+ * toolName: "launch-process",
62
+ * permission: {
63
+ * type: "script-policy",
64
+ * script: "/path/to/policy.sh"
65
+ * }
66
+ * }
67
+ * ```
68
+ */
69
+ export interface ToolPermissionRule {
70
+ /** Name of the tool to apply the permission to */
71
+ toolName: string;
72
+ /** Permission policy for the tool */
73
+ permission: ToolPermission;
74
+ }
4
75
  type AuggieOptions = {
5
76
  auggiePath?: string;
6
77
  workspaceRoot?: string;
7
78
  model?: models;
8
79
  allowIndexing?: boolean;
80
+ tools?: Record<string, Tool>;
81
+ /** @deprecated Use 'tools' instead. Kept for backwards compatibility. */
9
82
  toolsMap?: Record<string, Tool>;
10
83
  apiKey?: string;
11
84
  apiUrl?: string;
85
+ rules?: string[];
86
+ /**
87
+ * List of tool identifiers to exclude/disable from the agent.
88
+ * These tools will not be available to the agent during the session.
89
+ *
90
+ * @example
91
+ * ```typescript
92
+ * // Exclude integration tools
93
+ * excludedTools: ["web-search", "linear", "notion"]
94
+ *
95
+ * // Exclude process management tools
96
+ * excludedTools: ["launch-process", "kill-process"]
97
+ *
98
+ * // Exclude custom tools
99
+ * excludedTools: ["my-custom-tool"]
100
+ * ```
101
+ */
102
+ excludedTools?: ToolIdentifier[];
103
+ /**
104
+ * Tool permission rules that control how tools are executed.
105
+ * These rules allow you to automatically allow, deny, or require approval for specific tools.
106
+ *
107
+ * @example
108
+ * ```typescript
109
+ * toolPermissions: [
110
+ * // Auto-allow safe read-only tools
111
+ * { toolName: "view", permission: { type: "allow" } },
112
+ * { toolName: "codebase-retrieval", permission: { type: "allow" } },
113
+ *
114
+ * // Deny dangerous tools
115
+ * { toolName: "launch-process", permission: { type: "deny" } },
116
+ *
117
+ * // Require approval for file modifications
118
+ * { toolName: "save-file", permission: { type: "ask-user" } },
119
+ * { toolName: "remove-files", permission: { type: "ask-user" } },
120
+ *
121
+ * // Use webhook for dynamic permission checking
122
+ * {
123
+ * toolName: "github-api",
124
+ * permission: {
125
+ * type: "webhook-policy",
126
+ * webhookUrl: "https://example.com/webhook"
127
+ * }
128
+ * },
129
+ *
130
+ * // Use script for custom permission logic
131
+ * {
132
+ * toolName: "str-replace-editor",
133
+ * permission: {
134
+ * type: "script-policy",
135
+ * script: "/path/to/policy.sh"
136
+ * }
137
+ * }
138
+ * ]
139
+ * ```
140
+ */
141
+ toolPermissions?: ToolPermissionRule[];
12
142
  };
13
143
  /**
14
144
  * ACP Client for connecting to Auggie as an ACP server
@@ -33,6 +163,9 @@ declare class Auggie {
33
163
  private readonly allowIndexing;
34
164
  private readonly apiKey;
35
165
  private readonly apiUrl;
166
+ private readonly rules;
167
+ private readonly excludedTools;
168
+ private readonly toolPermissions;
36
169
  private constructor();
37
170
  /**
38
171
  * Create and initialize a new Auggie instance
@@ -42,7 +175,7 @@ declare class Auggie {
42
175
  /**
43
176
  * Connect to Auggie ACP server
44
177
  */
45
- connect(): Promise<void>;
178
+ private connect;
46
179
  /**
47
180
  * Create a Client implementation to handle agent requests
48
181
  */
@@ -50,19 +183,19 @@ declare class Auggie {
50
183
  /**
51
184
  * Initialize the ACP connection
52
185
  */
53
- private initialize;
186
+ private initializeConnection;
54
187
  /**
55
188
  * Create a new session
56
189
  */
57
- createSession(toolsMap?: Record<string, Tool>): Promise<string>;
190
+ private createSession;
58
191
  /**
59
192
  * Send a prompt to the agent and accumulate the text response
60
- * @param prompt - The text prompt to send to the agent
193
+ * @param message - The text prompt to send to the agent
61
194
  * @param isAnswerOnly - If true, returns only the final response after all tool calls complete.
62
195
  * If false or undefined, returns all agent message chunks (default: false)
63
196
  * @returns The accumulated text response from the agent
64
197
  */
65
- sendPrompt(prompt: string, { isAnswerOnly }?: {
198
+ prompt(message: string, { isAnswerOnly }?: {
66
199
  isAnswerOnly?: boolean;
67
200
  } | undefined): Promise<string>;
68
201
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"sdk-acp-client.d.ts","sourceRoot":"","sources":["../../src/auggie/sdk-acp-client.ts"],"names":[],"mappings":"AAEA,OAAO,EAUL,KAAK,mBAAmB,EACzB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAG/B,KAAK,MAAM,GAAG,UAAU,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,CAAC;AAE/D,KAAK,aAAa,GAAG;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,M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AC5C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAuB;IAC7C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA+B;IAC7D,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAmC;IAEnE,OAAO;IAsBP;;;OAGG;WACU,MAAM,CAAC,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;IASjE;;OAEG;YACW,OAAO;IAgGrB;;OAEG;IACH,OAAO,CAAC,YAAY;IAqCpB;;OAEG;YACW,oBAAoB;IAoBlC;;OAEG;YACW,aAAa;IA2C3B;;;;;;OAMG;IACG,MAAM,CACX,OAAO,EAAE,MAAM,EACf,EAAE,YAAoB,EAAE,GAAE;QAAE,YAAY,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,SAEtD,GACC,OAAO,CAAC,MAAM,CAAC;IAoFlB;;OAEG;IACH,eAAe,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,mBAAmB,KAAK,IAAI,GAAG,IAAI;IAItE;;OAEG;IACG,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAc7B;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IA0B5B;;OAEG;IACH,OAAO,CAAC,WAAW;CAOnB;AAED,OAAO,EAAE,MAAM,EAAE,CAAC"}
@@ -1,7 +1,32 @@
1
1
  import { spawn } from "node:child_process";
2
+ import { existsSync } from "node:fs";
2
3
  import { Readable, Writable } from "node:stream";
3
4
  import { ClientSideConnection, ndJsonStream, PROTOCOL_VERSION, } from "@agentclientprotocol/sdk";
5
+ import { getSDKVersion } from "../version";
4
6
  import { AuggieMCPServer } from "./sdk-mcp-server";
7
+ /**
8
+ * Formats a tool permission rule into a CLI argument string.
9
+ * @param rule - The tool permission rule to format
10
+ * @returns The formatted CLI argument string (e.g., "tool-name:allow")
11
+ */
12
+ function formatPermissionRule(rule) {
13
+ const { toolName, permission } = rule;
14
+ switch (permission.type) {
15
+ case "allow":
16
+ case "deny":
17
+ case "ask-user":
18
+ return `${toolName}:${permission.type}`;
19
+ case "webhook-policy":
20
+ return `${toolName}:webhook-policy(${permission.webhookUrl})`;
21
+ case "script-policy":
22
+ return `${toolName}:script-policy(${permission.script})`;
23
+ default: {
24
+ // TypeScript exhaustiveness check
25
+ const _exhaustive = permission;
26
+ throw new Error(`Unknown permission type: ${JSON.stringify(_exhaustive)}`);
27
+ }
28
+ }
29
+ }
5
30
  /**
6
31
  * ACP Client for connecting to Auggie as an ACP server
7
32
  *
@@ -12,9 +37,7 @@ import { AuggieMCPServer } from "./sdk-mcp-server";
12
37
  * 4. Send prompts and receive responses
13
38
  */
14
39
  class Auggie {
15
- constructor({ auggiePath = "auggie", workspaceRoot,
16
- // debug = false,
17
- model = "haiku4.5", allowIndexing = true, apiKey, apiUrl, } = {}) {
40
+ constructor({ auggiePath = "auggie", workspaceRoot, model = "haiku4.5", allowIndexing = true, apiKey, apiUrl = process.env.AUGMENT_API_URL || "https://api.augmentcode.com", rules, excludedTools, toolPermissions, } = {}) {
18
41
  this.connection = null;
19
42
  this.sessionId = null;
20
43
  this.workspaceRoot = undefined;
@@ -28,6 +51,9 @@ class Auggie {
28
51
  this.allowIndexing = allowIndexing;
29
52
  this.apiKey = apiKey;
30
53
  this.apiUrl = apiUrl;
54
+ this.rules = rules;
55
+ this.excludedTools = excludedTools;
56
+ this.toolPermissions = toolPermissions;
31
57
  }
32
58
  /**
33
59
  * Create and initialize a new Auggie instance
@@ -36,14 +62,16 @@ class Auggie {
36
62
  static async create(options = {}) {
37
63
  const instance = new Auggie(options);
38
64
  await instance.connect();
39
- await instance.createSession(options.toolsMap);
65
+ // Support both 'tools' and 'toolsMap' for backwards compatibility
66
+ const tools = options.tools || options.toolsMap;
67
+ await instance.createSession(tools);
40
68
  return instance;
41
69
  }
42
70
  /**
43
71
  * Connect to Auggie ACP server
44
72
  */
45
73
  async connect() {
46
- const args = ["--acp"];
74
+ const args = ["--acp", "--log-level=debug"];
47
75
  if (this.model) {
48
76
  args.push("--model", this.model);
49
77
  }
@@ -53,6 +81,28 @@ class Auggie {
53
81
  if (this.workspaceRoot) {
54
82
  args.push("--workspace-root", this.workspaceRoot);
55
83
  }
84
+ if (this.rules && this.rules.length > 0) {
85
+ // Validate that all rule files exist before proceeding
86
+ for (const rulePath of this.rules) {
87
+ if (!existsSync(rulePath)) {
88
+ throw new Error(`Rule file does not exist: ${rulePath}`);
89
+ }
90
+ args.push("--rules", rulePath);
91
+ }
92
+ }
93
+ if (this.excludedTools && this.excludedTools.length > 0) {
94
+ // Add each excluded tool as a separate --remove-tool argument
95
+ for (const tool of this.excludedTools) {
96
+ args.push("--remove-tool", tool);
97
+ }
98
+ }
99
+ if (this.toolPermissions && this.toolPermissions.length > 0) {
100
+ // Add each permission rule as a separate --permission argument
101
+ for (const rule of this.toolPermissions) {
102
+ const formattedRule = formatPermissionRule(rule);
103
+ args.push("--permission", formattedRule);
104
+ }
105
+ }
56
106
  // Parse auggiePath to handle cases where it includes arguments (e.g., "node /path/to/file.js")
57
107
  const pathParts = this.auggiePath.trim().split(Auggie.PATH_SPLIT_REGEX);
58
108
  if (pathParts.length === 0 || !pathParts[0]) {
@@ -96,7 +146,7 @@ class Auggie {
96
146
  console.log("Connected to Auggie ACP server");
97
147
  }
98
148
  // Initialize the connection
99
- await this.initialize();
149
+ await this.initializeConnection();
100
150
  }
101
151
  /**
102
152
  * Create a Client implementation to handle agent requests
@@ -136,7 +186,7 @@ class Auggie {
136
186
  /**
137
187
  * Initialize the ACP connection
138
188
  */
139
- async initialize() {
189
+ async initializeConnection() {
140
190
  if (!this.connection) {
141
191
  throw new Error("Not connected. Call connect() first.");
142
192
  }
@@ -145,8 +195,8 @@ class Auggie {
145
195
  const initResponse = await this.connection.initialize({
146
196
  protocolVersion: PROTOCOL_VERSION,
147
197
  clientInfo: {
148
- name: "auggie-sdk-client",
149
- version: "0.1.0",
198
+ name: "auggie-sdk-typescript",
199
+ version: getSDKVersion(),
150
200
  },
151
201
  clientCapabilities: {},
152
202
  });
@@ -156,7 +206,7 @@ class Auggie {
156
206
  /**
157
207
  * Create a new session
158
208
  */
159
- async createSession(toolsMap) {
209
+ async createSession(tools) {
160
210
  if (!this.connection) {
161
211
  throw new Error("Not connected. Call connect() first.");
162
212
  }
@@ -165,17 +215,17 @@ class Auggie {
165
215
  // Build MCP servers array for the session
166
216
  const mcpServers = [];
167
217
  // If tools are provided, create and start an MCP server
168
- if (toolsMap && Object.keys(toolsMap).length > 0) {
218
+ if (tools && Object.keys(tools).length > 0) {
169
219
  if (this.debug)
170
220
  console.log("Starting MCP server with provided tools...");
171
- this.mcpServer = new AuggieMCPServer(toolsMap, undefined);
221
+ this.mcpServer = new AuggieMCPServer(tools, undefined);
172
222
  const serverUrl = await this.mcpServer.start();
173
223
  if (this.debug)
174
224
  console.log(`MCP server started at: ${serverUrl}`);
175
225
  // Add the MCP server to the session configuration
176
226
  mcpServers.push({
177
227
  type: "http",
178
- name: "custom_tool",
228
+ name: "auggie_sdk",
179
229
  url: serverUrl,
180
230
  headers: [],
181
231
  });
@@ -193,19 +243,19 @@ class Auggie {
193
243
  }
194
244
  /**
195
245
  * Send a prompt to the agent and accumulate the text response
196
- * @param prompt - The text prompt to send to the agent
246
+ * @param message - The text prompt to send to the agent
197
247
  * @param isAnswerOnly - If true, returns only the final response after all tool calls complete.
198
248
  * If false or undefined, returns all agent message chunks (default: false)
199
249
  * @returns The accumulated text response from the agent
200
250
  */
201
- async sendPrompt(prompt, { isAnswerOnly = false } = {
251
+ async prompt(message, { isAnswerOnly = false } = {
202
252
  isAnswerOnly: false,
203
253
  }) {
204
254
  if (!(this.connection && this.sessionId)) {
205
- throw new Error("Not connected or no session. Call connect() and createSession() first.");
255
+ throw new Error("Not connected or no session. Initialization failed.");
206
256
  }
207
257
  if (this.debug)
208
- console.log(`\nSending prompt: "${prompt}"`);
258
+ console.log(`\nSending prompt: "${message}"`);
209
259
  // Accumulator for text responses
210
260
  let accumulatedText = "";
211
261
  // Track the final response separately (text after the last tool call)
@@ -244,7 +294,7 @@ class Auggie {
244
294
  const content = [
245
295
  {
246
296
  type: "text",
247
- text: prompt,
297
+ text: message,
248
298
  },
249
299
  ];
250
300
  // Send the prompt and wait for response
@@ -1 +1 @@
1
- {"version":3,"file":"sdk-acp-client.js","sourceRoot":"","sources":["../../src/auggie/sdk-acp-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAGL,oBAAoB,EAGpB,YAAY,EACZ,gBAAgB,GAIjB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAcnD;;;;;;;;GAQG;AACH,MAAM,MAAM;IAiBV,YAAoB,EAClB,UAAU,GAAG,QAAQ,EACrB,aAAa;IACb,iBAAiB;IACjB,KAAK,GAAG,UAAU,EAClB,aAAa,GAAG,IAAI,EACpB,MAAM,EACN,MAAM,MACW,EAAE;QAvBb,eAAU,GAAgC,IAAI,CAAC;QAC/C,cAAS,GAAkB,IAAI,CAAC;QAEvB,kBAAa,GAAuB,SAAS,CAAC;QACvD,kBAAa,GAAwB,IAAI,CAAC;QAC1C,0BAAqB,GAElB,IAAI,CAAC;QACC,UAAK,GAAY,KAAK,CAAC;QAChC,cAAS,GAA2B,IAAI,CAAC;QAe/C,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,UAAyB,EAAE;QAC7C,MAAM,QAAQ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AAC;YAC1D,wCAAwC;YACxC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACpC,CAAC;IACF,CAAC;;AApauB,uBAAgB,GAAG,KAAK,AAAR,CAAS;AAualD,OAAO,EAAE,MAAM,EAAE,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { Auggie } from "./auggie/sdk-acp-client";
1
+ export { Auggie, type PredefinedToolType, type ToolIdentifier, type ToolPermission, type ToolPermissionRule, } from "./auggie/sdk-acp-client";
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,MAAM,EACN,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,kBAAkB,GACvB,MAAM,yBAAyB,CAAC"}
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { Auggie } from "./auggie/sdk-acp-client";
1
+ export { Auggie, } from "./auggie/sdk-acp-client";
2
2
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,MAAM,GAKN,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,16 @@
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
+ /**
8
+ * Get the SDK version from package.json
9
+ *
10
+ * This function reads the version from package.json at runtime and caches it.
11
+ * It works in both development and production environments.
12
+ *
13
+ * @returns The version string from package.json, or "unknown" if it cannot be read
14
+ */
15
+ export declare function getSDKVersion(): string;
16
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH;;;;;;;GAOG;AACH,wBAAgB,aAAa,IAAI,MAAM,CA6BtC"}
@@ -0,0 +1,43 @@
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
+ import { readFileSync } from "node:fs";
8
+ import { dirname, join } from "node:path";
9
+ import { fileURLToPath } from "node:url";
10
+ 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
+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F,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@augmentcode/auggie-sdk",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "TypeScript SDK for Auggie",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -12,11 +12,14 @@
12
12
  "import": "./dist/index.js"
13
13
  }
14
14
  },
15
- "files": ["dist"],
15
+ "files": [
16
+ "dist"
17
+ ],
16
18
  "scripts": {
17
19
  "build": "tsc --project tsconfig.build.json",
18
20
  "dev": "bun ./examples/dev.ts",
19
21
  "silent": "bun ./examples/silent.ts",
22
+ "test": "bun test",
20
23
  "prepare": "husky"
21
24
  },
22
25
  "devDependencies": {
@@ -32,6 +35,7 @@
32
35
  "@agentclientprotocol/sdk": "^0.5.1",
33
36
  "@mastra/mcp": "^0.14.1",
34
37
  "ai": "^5.0.86",
38
+ "async-mutex": "^0.5.0",
35
39
  "zod": "^4.1.12"
36
40
  }
37
41
  }