@cortexkit/aft-opencode 0.51.0 → 0.51.1

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 (2) hide show
  1. package/dist/index.js +31 -7
  2. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -8673,6 +8673,20 @@ class BinaryBridge {
8673
8673
  isAlive() {
8674
8674
  return this.process !== null && this.process.exitCode === null && !this.process.killed;
8675
8675
  }
8676
+ invalidateTransportProcess(error2) {
8677
+ const proc = this.process;
8678
+ if (!proc)
8679
+ return;
8680
+ this.process = null;
8681
+ this.spawnedBinaryFingerprint = null;
8682
+ if (proc.exitCode === null && !proc.killed) {
8683
+ proc.kill("SIGKILL");
8684
+ }
8685
+ this.clearRestartResetTimer();
8686
+ this.configured = false;
8687
+ this.outstandingBackgroundTaskIds.clear();
8688
+ this.rejectAllPending(error2);
8689
+ }
8676
8690
  hasPendingRequests() {
8677
8691
  return this.pending.size > 0;
8678
8692
  }
@@ -8838,6 +8852,7 @@ class BinaryBridge {
8838
8852
  `;
8839
8853
  const keepBridgeOnTimeout = passive || options?.keepBridgeOnTimeout === true;
8840
8854
  let requestSentAt = Date.now();
8855
+ const child = this.process;
8841
8856
  const response = await new Promise((resolve2, reject) => {
8842
8857
  const timer = setTimeout(() => {
8843
8858
  const entry = this.pending.get(id);
@@ -8874,21 +8889,27 @@ class BinaryBridge {
8874
8889
  this.handleTimeout(requestSessionId);
8875
8890
  }, effectiveTimeoutMs);
8876
8891
  this.pending.set(id, { resolve: resolve2, reject, timer, onProgress: options?.onProgress, command });
8877
- if (!this.process?.stdin?.writable) {
8892
+ if (!child?.stdin?.writable) {
8878
8893
  this.pending.delete(id);
8879
8894
  clearTimeout(timer);
8880
- reject(new BridgeTransportUnavailableError(`${this.errorPrefix} stdin not writable for command "${command}"`));
8895
+ const error2 = new BridgeTransportUnavailableError(`${this.errorPrefix} stdin not writable for command "${command}"`);
8896
+ reject(error2);
8897
+ if (this.process === child)
8898
+ this.invalidateTransportProcess(error2);
8881
8899
  return;
8882
8900
  }
8883
8901
  requestSentAt = Date.now();
8884
- this.process.stdin.write(line, (err) => {
8902
+ child.stdin.write(line, (err) => {
8885
8903
  if (err) {
8904
+ const error2 = new BridgeTransportUnavailableError(`${this.errorPrefix} Failed to write to stdin: ${err.message}`, { cause: err });
8886
8905
  const entry = this.pending.get(id);
8887
8906
  if (entry) {
8888
8907
  this.pending.delete(id);
8889
8908
  clearTimeout(entry.timer);
8890
- entry.reject(new BridgeTransportUnavailableError(`${this.errorPrefix} Failed to write to stdin: ${err.message}`, { cause: err }));
8909
+ entry.reject(error2);
8891
8910
  }
8911
+ if (this.process === child)
8912
+ this.invalidateTransportProcess(error2);
8892
8913
  }
8893
8914
  });
8894
8915
  });
@@ -9048,8 +9069,11 @@ class BinaryBridge {
9048
9069
  });
9049
9070
  }
9050
9071
  ensureSpawned(triggeringSessionId) {
9051
- if (this.isAlive())
9072
+ if (this.isAlive() && this.process?.stdin?.writable)
9052
9073
  return;
9074
+ if (this.process !== null) {
9075
+ this.invalidateTransportProcess(new BridgeTransportUnavailableError(`${this.errorPrefix} Child stdin is not writable`));
9076
+ }
9053
9077
  this.spawnProcess(triggeringSessionId);
9054
9078
  }
9055
9079
  spawnProcess(triggeringSessionId) {
@@ -39979,7 +40003,7 @@ function semanticTools(ctx) {
39979
40003
  query: arg3(z15.string().describe("Concept, regex, literal text, filename, or capability to find. Examples: 'fuzzy match with whitespace tolerance', '^export', 'Cargo.lock'.")),
39980
40004
  topK: arg3(optionalInt(1, 100).describe("Number of results (default: 10, max: 100)")),
39981
40005
  includeTests: arg3(z15.boolean().optional().describe("Include test files (*.test.*, *_test.rs, __tests__/, …) plus test-support, fixture, mock, snapshot, and corpus files. Defaults to false.")),
39982
- path: arg3(z15.string().optional().describe("Search a different project root (absolute or ~ path). Requires that project to have been indexed by AFT."))
40006
+ path: arg3(z15.string().optional().describe("Only set this to search a different Git project (absolute or ~ path). Omit it for the current configured workspace, including non-Git workspace roots; this is not a subdirectory filter. Unindexed external projects use a bounded lexical fallback."))
39983
40007
  },
39984
40008
  execute: async (args, context) => {
39985
40009
  if (isEmptyParam(args.query) || typeof args.query !== "string" || args.query.trim().length === 0) {
@@ -40182,7 +40206,7 @@ var PLUGIN_VERSION = (() => {
40182
40206
  return "0.0.0";
40183
40207
  }
40184
40208
  })();
40185
- var ANNOUNCEMENT_VERSION = "0.51.0";
40209
+ var ANNOUNCEMENT_VERSION = "0.51.1";
40186
40210
  var ANNOUNCEMENT_FEATURES = [
40187
40211
  "Callgraph stays consistent under load: edits arriving mid-rebuild can no longer be silently lost from navigation results.",
40188
40212
  "aft_zoom handles real-world .jsonc: files with comment banners above the opening brace now resolve, and not-found errors point at the segment that actually failed (thanks @iceteaSA).",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cortexkit/aft-opencode",
3
- "version": "0.51.0",
3
+ "version": "0.51.1",
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",
@@ -34,7 +34,7 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@clack/prompts": "^1.6.0",
37
- "@cortexkit/aft-bridge": "0.51.0",
37
+ "@cortexkit/aft-bridge": "0.51.1",
38
38
  "@opentui/core": "0.4.3",
39
39
  "@opentui/solid": "0.4.3",
40
40
  "comment-json": "^4.6.2",
@@ -43,12 +43,12 @@
43
43
  "zod": "^4.4.3"
44
44
  },
45
45
  "optionalDependencies": {
46
- "@cortexkit/aft-darwin-arm64": "0.51.0",
47
- "@cortexkit/aft-darwin-x64": "0.51.0",
48
- "@cortexkit/aft-linux-arm64": "0.51.0",
49
- "@cortexkit/aft-linux-x64": "0.51.0",
50
- "@cortexkit/aft-win32-arm64": "0.51.0",
51
- "@cortexkit/aft-win32-x64": "0.51.0"
46
+ "@cortexkit/aft-darwin-arm64": "0.51.1",
47
+ "@cortexkit/aft-darwin-x64": "0.51.1",
48
+ "@cortexkit/aft-linux-arm64": "0.51.1",
49
+ "@cortexkit/aft-linux-x64": "0.51.1",
50
+ "@cortexkit/aft-win32-arm64": "0.51.1",
51
+ "@cortexkit/aft-win32-x64": "0.51.1"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@opencode-ai/plugin": "^1.17.11",