@cortexkit/aft-opencode 0.15.1 → 0.15.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/dist/index.js CHANGED
@@ -24487,12 +24487,39 @@ ${diagLines}`);
24487
24487
  }
24488
24488
  const callID = getCallID(context);
24489
24489
  if (callID) {
24490
+ const diffByPath = new Map(perFileDiffs.map((d) => [d.filePath, d]));
24491
+ const countAddDel = (patch) => {
24492
+ let additions = 0;
24493
+ let deletions = 0;
24494
+ for (const line of patch.split(`
24495
+ `)) {
24496
+ if (line.startsWith("---") || line.startsWith("+++"))
24497
+ continue;
24498
+ if (line.startsWith("+"))
24499
+ additions++;
24500
+ else if (line.startsWith("-"))
24501
+ deletions++;
24502
+ }
24503
+ return { additions, deletions };
24504
+ };
24490
24505
  const files = hunks.map((h) => {
24491
- const relPath = path4.relative(context.worktree, path4.resolve(context.directory, h.path));
24506
+ const filePath = path4.resolve(context.directory, h.path);
24507
+ const rawMovePath = h.type === "update" ? h.move_path : undefined;
24508
+ const movePath = rawMovePath ? path4.resolve(context.directory, rawMovePath) : undefined;
24509
+ const displayPath = movePath ?? filePath;
24510
+ const relPath = path4.relative(context.worktree, displayPath);
24511
+ const diffEntry = diffByPath.get(filePath);
24512
+ const patch = diffEntry ? buildUnifiedDiff(displayPath, diffEntry.before, diffEntry.after) : "";
24513
+ const { additions, deletions } = countAddDel(patch);
24514
+ const uiType = h.type === "update" && rawMovePath ? "move" : h.type;
24492
24515
  return {
24493
- filePath: path4.resolve(context.directory, h.path),
24516
+ filePath,
24494
24517
  relativePath: relPath,
24495
- type: h.type
24518
+ type: uiType,
24519
+ patch,
24520
+ additions,
24521
+ deletions,
24522
+ ...movePath ? { movePath } : {}
24496
24523
  };
24497
24524
  });
24498
24525
  const fileList = files.map((f) => {
@@ -24502,7 +24529,7 @@ ${diagLines}`);
24502
24529
  `);
24503
24530
  const title = `Success. Updated the following files:
24504
24531
  ${fileList}`;
24505
- const diffText = perFileDiffs.map((d) => buildUnifiedDiff(d.filePath, d.before, d.after)).join(`
24532
+ const diffText = files.map((f) => f.patch).filter(Boolean).join(`
24506
24533
  `);
24507
24534
  storeToolMetadata(context.sessionID, callID, {
24508
24535
  title,
@@ -1 +1 @@
1
- {"version":3,"file":"hoisted.d.ts","sourceRoot":"","sources":["../../src/tools/hoisted.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAI1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AA6EjD;;GAEG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CA4IjE;AAkqBD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAS/E;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAuBnF"}
1
+ {"version":3,"file":"hoisted.d.ts","sourceRoot":"","sources":["../../src/tools/hoisted.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAI1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AA6EjD;;GAEG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CA4IjE;AAutBD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAS/E;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAuBnF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cortexkit/aft-opencode",
3
- "version": "0.15.1",
3
+ "version": "0.15.3",
4
4
  "type": "module",
5
5
  "description": "OpenCode plugin for Agent File Tools (AFT) — tree-sitter and lsp powered code analysis",
6
6
  "main": "dist/index.js",
@@ -32,11 +32,11 @@
32
32
  "zod": "^4.1.8"
33
33
  },
34
34
  "optionalDependencies": {
35
- "@cortexkit/aft-darwin-arm64": "0.15.1",
36
- "@cortexkit/aft-darwin-x64": "0.15.1",
37
- "@cortexkit/aft-linux-arm64": "0.15.1",
38
- "@cortexkit/aft-linux-x64": "0.15.1",
39
- "@cortexkit/aft-win32-x64": "0.15.1"
35
+ "@cortexkit/aft-darwin-arm64": "0.15.3",
36
+ "@cortexkit/aft-darwin-x64": "0.15.3",
37
+ "@cortexkit/aft-linux-arm64": "0.15.3",
38
+ "@cortexkit/aft-linux-x64": "0.15.3",
39
+ "@cortexkit/aft-win32-x64": "0.15.3"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@types/node": "^22.0.0",