@agent-api/sdk 1.4.2 → 1.4.3

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.3
4
+
5
+ ### Fixed
6
+
7
+ - Made successful `local_workdir.apply_edits` results compact by keeping rollback backups internal and reporting changed files plus edit counts.
8
+
3
9
  ## 1.4.2
4
10
 
5
11
  ### Added
@@ -229,10 +229,8 @@ export interface LocalWorkdirEditPlan {
229
229
  }
230
230
  export interface LocalWorkdirEditResult {
231
231
  applied: LocalFileLinesPatch[];
232
- backups: Array<{
233
- path: string;
234
- content: string;
235
- }>;
232
+ changed_files: string[];
233
+ edit_count: number;
236
234
  }
237
235
  export type LocalPathSensitivity = "normal" | "sensitive" | "secret";
238
236
  export interface LocalPathSensitivityInfo {
@@ -647,7 +647,11 @@ export class LocalWorkdir {
647
647
  }
648
648
  throw error;
649
649
  }
650
- return { applied, backups };
650
+ return {
651
+ applied,
652
+ changed_files: uniqueStrings(applied.map((patch) => patch.path)),
653
+ edit_count: applied.length,
654
+ };
651
655
  }
652
656
  classifyPath(relativePath) {
653
657
  return classifyLocalPathSensitivity(relativePath);
@@ -1092,6 +1096,9 @@ function selectLineRange(lines, startLine, endLine) {
1092
1096
  }
1093
1097
  return { lines: lines.slice(startLine - 1, end), endLine: end };
1094
1098
  }
1099
+ function uniqueStrings(values) {
1100
+ return Array.from(new Set(values));
1101
+ }
1095
1102
  function patchLineRange(content, startLine, endLine, replacement) {
1096
1103
  const lines = splitLines(content);
1097
1104
  const selected = selectLineRange(lines, startLine, endLine);
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.4.2";
2
- export declare const USER_AGENT = "@agent-api/sdk/1.4.2";
1
+ export declare const VERSION = "1.4.3";
2
+ export declare const USER_AGENT = "@agent-api/sdk/1.4.3";
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = "1.4.2";
1
+ export const VERSION = "1.4.3";
2
2
  export const USER_AGENT = `@agent-api/sdk/${VERSION}`;
@@ -665,7 +665,11 @@ class LocalWorkdir {
665
665
  }
666
666
  throw error;
667
667
  }
668
- return { applied, backups };
668
+ return {
669
+ applied,
670
+ changed_files: uniqueStrings(applied.map((patch) => patch.path)),
671
+ edit_count: applied.length,
672
+ };
669
673
  }
670
674
  classifyPath(relativePath) {
671
675
  return classifyLocalPathSensitivity(relativePath);
@@ -1112,6 +1116,9 @@ function selectLineRange(lines, startLine, endLine) {
1112
1116
  }
1113
1117
  return { lines: lines.slice(startLine - 1, end), endLine: end };
1114
1118
  }
1119
+ function uniqueStrings(values) {
1120
+ return Array.from(new Set(values));
1121
+ }
1115
1122
  function patchLineRange(content, startLine, endLine, replacement) {
1116
1123
  const lines = splitLines(content);
1117
1124
  const selected = selectLineRange(lines, startLine, endLine);
@@ -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.2";
4
+ exports.VERSION = "1.4.3";
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.2",
3
+ "version": "1.4.3",
4
4
  "description": "Production JavaScript SDK for the Managed Agent API",
5
5
  "license": "MIT",
6
6
  "repository": {