@agent-api/sdk 1.4.4 → 1.4.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog — @agent-api/sdk
2
2
 
3
+ ## 1.4.5
4
+
5
+ ### Fixed
6
+
7
+ - Made local workdir summaries honor `maxDepth`, and aligned model-facing summarize options with the direct SDK API.
8
+
3
9
  ## 1.4.4
4
10
 
5
11
  ### Added
package/README.md CHANGED
@@ -219,7 +219,7 @@ await workdir.patchLines("src/index.ts", {
219
219
  replacement: "console.log('patched');",
220
220
  });
221
221
 
222
- const summary = await workdir.summarize();
222
+ const summary = await workdir.summarize({ maxDepth: 3, maxFiles: 500 });
223
223
  ```
224
224
 
225
225
  For project/workdir roots, prefer `local.workdir()` so SDK defaults protect common generated directories such as `.git`, `node_modules`, `dist`, and build caches.
@@ -157,6 +157,7 @@ export interface LocalSummarizeParams {
157
157
  maxPreviews?: number;
158
158
  previewBytes?: number;
159
159
  topPaths?: number;
160
+ maxDepth?: number;
160
161
  ignore?: LocalListOptions["ignore"];
161
162
  }
162
163
  export interface LocalSummaryPreview {
@@ -374,7 +374,7 @@ export class LocalFileStore {
374
374
  const maxPreviews = positiveInt(params.maxPreviews, 20);
375
375
  const previewBytes = positiveInt(params.previewBytes, 4096);
376
376
  const topPaths = positiveInt(params.topPaths, 20);
377
- const stats = await this.list(params.path ?? ".", { recursive: true, ignore: params.ignore });
377
+ const stats = await this.list(params.path ?? ".", { recursive: true, maxDepth: params.maxDepth, ignore: params.ignore });
378
378
  const files = stats.filter((item) => item.type === "file").slice(0, maxFiles);
379
379
  const scanTruncated = stats.filter((item) => item.type === "file").length > files.length;
380
380
  const totalBytes = files.reduce((sum, item) => sum + item.size, 0);
@@ -202,6 +202,9 @@ function summaryArgs(args) {
202
202
  path: optionalStringArg(args, "path"),
203
203
  maxFiles: optionalNumberArg(args, "maxFiles", "max_files"),
204
204
  maxPreviews: optionalNumberArg(args, "maxPreviews", "max_previews"),
205
+ previewBytes: optionalNumberArg(args, "previewBytes", "preview_bytes"),
206
+ topPaths: optionalNumberArg(args, "topPaths", "top_paths"),
207
+ maxDepth: optionalNumberArg(args, "maxDepth", "max_depth"),
205
208
  };
206
209
  }
207
210
  function grepArgs(args) {
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.4.4";
2
- export declare const USER_AGENT = "@agent-api/sdk/1.4.4";
1
+ export declare const VERSION = "1.4.5";
2
+ export declare const USER_AGENT = "@agent-api/sdk/1.4.5";
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = "1.4.4";
1
+ export const VERSION = "1.4.5";
2
2
  export const USER_AGENT = `@agent-api/sdk/${VERSION}`;
@@ -389,7 +389,7 @@ class LocalFileStore {
389
389
  const maxPreviews = positiveInt(params.maxPreviews, 20);
390
390
  const previewBytes = positiveInt(params.previewBytes, 4096);
391
391
  const topPaths = positiveInt(params.topPaths, 20);
392
- const stats = await this.list(params.path ?? ".", { recursive: true, ignore: params.ignore });
392
+ const stats = await this.list(params.path ?? ".", { recursive: true, maxDepth: params.maxDepth, ignore: params.ignore });
393
393
  const files = stats.filter((item) => item.type === "file").slice(0, maxFiles);
394
394
  const scanTruncated = stats.filter((item) => item.type === "file").length > files.length;
395
395
  const totalBytes = files.reduce((sum, item) => sum + item.size, 0);
@@ -209,6 +209,9 @@ function summaryArgs(args) {
209
209
  path: optionalStringArg(args, "path"),
210
210
  maxFiles: optionalNumberArg(args, "maxFiles", "max_files"),
211
211
  maxPreviews: optionalNumberArg(args, "maxPreviews", "max_previews"),
212
+ previewBytes: optionalNumberArg(args, "previewBytes", "preview_bytes"),
213
+ topPaths: optionalNumberArg(args, "topPaths", "top_paths"),
214
+ maxDepth: optionalNumberArg(args, "maxDepth", "max_depth"),
212
215
  };
213
216
  }
214
217
  function grepArgs(args) {
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.USER_AGENT = exports.VERSION = void 0;
4
- exports.VERSION = "1.4.4";
4
+ exports.VERSION = "1.4.5";
5
5
  exports.USER_AGENT = `@agent-api/sdk/${exports.VERSION}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-api/sdk",
3
- "version": "1.4.4",
3
+ "version": "1.4.5",
4
4
  "description": "Production JavaScript SDK for the Managed Agent API",
5
5
  "license": "MIT",
6
6
  "repository": {