@cortexkit/aft-opencode 0.49.0 → 0.49.2

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.
@@ -18,6 +18,7 @@ export interface BgCompletion {
18
18
  original_tokens?: number;
19
19
  compressed_tokens?: number;
20
20
  tokens_skipped?: boolean;
21
+ status_reason?: string;
21
22
  mode?: "pipes" | "pty" | string;
22
23
  output_path?: string;
23
24
  }
@@ -1 +1 @@
1
- {"version":3,"file":"bg-notifications.d.ts","sourceRoot":"","sources":["../src/bg-notifications.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAWhD,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qEAAqE;IACrE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAG3B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,IAAI,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,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"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAoMlD;;;;;;;;;;;;;;;;GAgBG;AAQH,QAAA,MAAM,MAAM,EAAE,MAA6D,CAAC;AAghC5E,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAoMlD;;;;;;;;;;;;;;;;GAgBG;AAQH,QAAA,MAAM,MAAM,EAAE,MAA6D,CAAC;AAshC5E,eAAe,MAAM,CAAC"}
package/dist/index.js CHANGED
@@ -7871,6 +7871,7 @@ function sleep(ms) {
7871
7871
  return new Promise((resolve) => setTimeout(resolve, ms));
7872
7872
  }
7873
7873
  // ../aft-bridge/dist/bash-hints.js
7874
+ import * as fs from "node:fs";
7874
7875
  import * as os from "node:os";
7875
7876
  import * as path from "node:path";
7876
7877
  var CONFLICT_HINT = `
@@ -7879,6 +7880,7 @@ var CONFLICT_HINT = `
7879
7880
  var GREP_SEARCH_AFT_SEARCH_HINT = "DO NOT search code by running grep/rg in bash — it is unindexed, unranked, and serial. Use the `aft_search` tool instead (it auto-routes concepts, identifiers, regex, and literals).";
7880
7881
  var GREP_SEARCH_GREP_HINT = "DO NOT search code by running grep/rg in bash — it is unindexed, unranked, and serial. Use the `grep` tool instead (indexed and ranked).";
7881
7882
  var GREP_SEARCH_HINT_PREFIX = "DO NOT search code by running grep/rg in bash —";
7883
+ var GREP_SEARCH_FRESHNESS_WINDOW_MS = 60000;
7882
7884
  function maybeAppendConflictsHint(output) {
7883
7885
  if (!output.includes("Automatic merge failed; fix conflicts"))
7884
7886
  return output;
@@ -7950,12 +7952,19 @@ function shouldSuppressGrepSearchHint(command, projectRoot) {
7950
7952
  const operands = collectPathOperands(firstStage, firstToken.end);
7951
7953
  if (operands.length === 0)
7952
7954
  return false;
7955
+ let sawInProjectOperand = false;
7953
7956
  for (const operand of operands) {
7954
7957
  if (isDynamicPathOperand(operand))
7955
7958
  continue;
7956
- if (isPathInsideProject(resolvedRoot, effectiveCwd, operand))
7957
- return false;
7959
+ const resolvedOperand = resolvePathOperand(effectiveCwd, operand);
7960
+ if (!isPathInsideProject(resolvedRoot, effectiveCwd, operand))
7961
+ continue;
7962
+ sawInProjectOperand = true;
7963
+ if (shouldSuppressResolvedPath(resolvedOperand))
7964
+ return true;
7958
7965
  }
7966
+ if (sawInProjectOperand)
7967
+ return false;
7959
7968
  }
7960
7969
  return sawCodeSearchStatement;
7961
7970
  }
@@ -8054,6 +8063,17 @@ function isPathInsideProject(resolvedRoot, baseCwd, operand) {
8054
8063
  const rel = path.relative(resolvedRoot, resolved);
8055
8064
  return rel === "" || !rel.startsWith("..") && !path.isAbsolute(rel);
8056
8065
  }
8066
+ function shouldSuppressResolvedPath(resolved) {
8067
+ try {
8068
+ const stats = fs.statSync(resolved);
8069
+ if (stats.isFile())
8070
+ return true;
8071
+ const ageMs = Date.now() - stats.mtimeMs;
8072
+ return ageMs >= 0 && ageMs < GREP_SEARCH_FRESHNESS_WINDOW_MS;
8073
+ } catch {
8074
+ return false;
8075
+ }
8076
+ }
8057
8077
  function splitTopLevelStatements(command) {
8058
8078
  const statements = [];
8059
8079
  let start = 0;
@@ -9388,7 +9408,7 @@ function formatDroppedKeyWarnings(dropped) {
9388
9408
  // ../aft-bridge/dist/downloader.js
9389
9409
  import { spawnSync } from "node:child_process";
9390
9410
  import { createHash as createHash2, randomUUID } from "node:crypto";
9391
- import { chmodSync, closeSync, copyFileSync, createWriteStream, existsSync as existsSync2, mkdirSync, openSync, readFileSync as readFileSync3, renameSync, rmSync, statSync, unlinkSync, writeSync } from "node:fs";
9411
+ import { chmodSync, closeSync, copyFileSync, createWriteStream, existsSync as existsSync2, mkdirSync, openSync, readFileSync as readFileSync3, renameSync, rmSync, statSync as statSync2, unlinkSync, writeSync } from "node:fs";
9392
9412
  import { homedir as homedir3 } from "node:os";
9393
9413
  import { join as join3 } from "node:path";
9394
9414
  import { Readable } from "node:stream";
@@ -9421,7 +9441,7 @@ function readBinaryVersion(binaryPath) {
9421
9441
  const result = spawnSync(binaryPath, ["--version"], {
9422
9442
  encoding: "utf-8",
9423
9443
  stdio: ["pipe", "pipe", "pipe"],
9424
- timeout: 5000
9444
+ timeout: 60000
9425
9445
  });
9426
9446
  const stdoutVersion = result.stdout?.trim();
9427
9447
  const stderrVersion = result.stderr?.trim();
@@ -9626,7 +9646,7 @@ async function acquireDownloadLock(lockPath) {
9626
9646
  if (code !== "EEXIST")
9627
9647
  throw err;
9628
9648
  try {
9629
- const ageMs = Date.now() - statSync(lockPath).mtimeMs;
9649
+ const ageMs = Date.now() - statSync2(lockPath).mtimeMs;
9630
9650
  if (ageMs > DOWNLOAD_LOCK_STALE_MS) {
9631
9651
  rmSync(lockPath, { force: true });
9632
9652
  continue;
@@ -9816,7 +9836,7 @@ function stripJsoncSymbols(value) {
9816
9836
  }
9817
9837
  // ../aft-bridge/dist/migration.js
9818
9838
  import { spawnSync as spawnSync2 } from "node:child_process";
9819
- import { closeSync as closeSync3, existsSync as existsSync5, mkdirSync as mkdirSync4, openSync as openSync3, readFileSync as readFileSync5, renameSync as renameSync4, rmSync as rmSync2, statSync as statSync2, unlinkSync as unlinkSync3, writeFileSync as writeFileSync2 } from "node:fs";
9839
+ import { closeSync as closeSync3, existsSync as existsSync5, mkdirSync as mkdirSync4, openSync as openSync3, readFileSync as readFileSync5, renameSync as renameSync4, rmSync as rmSync2, statSync as statSync3, unlinkSync as unlinkSync3, writeFileSync as writeFileSync2 } from "node:fs";
9820
9840
  import { homedir as homedir7, tmpdir } from "node:os";
9821
9841
  import { basename, dirname as dirname3, join as join7, resolve as resolve4 } from "node:path";
9822
9842
 
@@ -10316,7 +10336,7 @@ function acquireConfigMigrationLock(lockDir) {
10316
10336
  if (code !== "EEXIST")
10317
10337
  throw err;
10318
10338
  try {
10319
- const ageMs = Date.now() - statSync2(lockDir).mtimeMs;
10339
+ const ageMs = Date.now() - statSync3(lockDir).mtimeMs;
10320
10340
  if (ageMs > 60000) {
10321
10341
  rmSync2(lockDir, { recursive: true, force: true });
10322
10342
  continue;
@@ -10602,7 +10622,7 @@ async function ensureStorageMigrated(opts) {
10602
10622
  throw new Error(`AFT storage migration failed (${detail}). ` + `Harness: ${opts.harness}. Legacy: ${legacyRoot}. Target: ${newRoot}. ` + `See log: ${logPath}. ` + `Plugin load aborted to prevent legacy/new state divergence.` + (stderrTail ? ` Stderr tail: ${stderrTail}` : "") + (stdoutTail ? ` Stdout tail: ${stdoutTail}` : ""));
10603
10623
  }
10604
10624
  // ../aft-bridge/dist/npm-resolver.js
10605
- import { readdirSync, statSync as statSync3 } from "node:fs";
10625
+ import { readdirSync, statSync as statSync4 } from "node:fs";
10606
10626
  import { homedir as homedir8 } from "node:os";
10607
10627
  import { delimiter, dirname as dirname4, isAbsolute as isAbsolute3, join as join8 } from "node:path";
10608
10628
  function defaultDeps() {
@@ -10618,7 +10638,7 @@ function npmBinaryName(platform) {
10618
10638
  }
10619
10639
  function isFile(p) {
10620
10640
  try {
10621
- return statSync3(p).isFile();
10641
+ return statSync4(p).isFile();
10622
10642
  } catch {
10623
10643
  return false;
10624
10644
  }
@@ -10721,7 +10741,7 @@ function isNpmAvailable(deps = defaultDeps()) {
10721
10741
  // ../aft-bridge/dist/onnx-runtime.js
10722
10742
  import { execFileSync } from "node:child_process";
10723
10743
  import { createHash as createHash3 } from "node:crypto";
10724
- import { chmodSync as chmodSync3, closeSync as closeSync4, copyFileSync as copyFileSync3, createWriteStream as createWriteStream2, existsSync as existsSync6, lstatSync, mkdirSync as mkdirSync5, openSync as openSync4, readdirSync as readdirSync2, readFileSync as readFileSync6, readlinkSync, realpathSync, rmSync as rmSync3, statSync as statSync4, symlinkSync, unlinkSync as unlinkSync4, writeFileSync as writeFileSync3 } from "node:fs";
10744
+ import { chmodSync as chmodSync3, closeSync as closeSync4, copyFileSync as copyFileSync3, createWriteStream as createWriteStream2, existsSync as existsSync6, lstatSync, mkdirSync as mkdirSync5, openSync as openSync4, readdirSync as readdirSync2, readFileSync as readFileSync6, readlinkSync, realpathSync, rmSync as rmSync3, statSync as statSync5, symlinkSync, unlinkSync as unlinkSync4, writeFileSync as writeFileSync3 } from "node:fs";
10725
10745
  import { basename as basename2, dirname as dirname5, isAbsolute as isAbsolute4, join as join9, relative as relative2, resolve as resolve5, win32 } from "node:path";
10726
10746
  import { Readable as Readable2 } from "node:stream";
10727
10747
  import { pipeline as pipeline2 } from "node:stream/promises";
@@ -10854,7 +10874,7 @@ function cleanupAbandonedStagingDirs(onnxBaseDir) {
10854
10874
  abandoned = true;
10855
10875
  } else {
10856
10876
  try {
10857
- const ageMs = Date.now() - statSync4(stagingDir).mtimeMs;
10877
+ const ageMs = Date.now() - statSync5(stagingDir).mtimeMs;
10858
10878
  abandoned = ageMs > STALE_LOCK_MS;
10859
10879
  } catch {
10860
10880
  abandoned = true;
@@ -11287,7 +11307,7 @@ function writeOnnxInstalledMeta(installDir, version, sha256, archiveSha256) {
11287
11307
  function readOnnxInstalledMeta(installDir) {
11288
11308
  const path2 = join9(installDir, ONNX_INSTALLED_META_FILE);
11289
11309
  try {
11290
- if (!statSync4(path2).isFile())
11310
+ if (!statSync5(path2).isFile())
11291
11311
  return null;
11292
11312
  const raw = readFileSync6(path2, "utf8");
11293
11313
  const parsed = JSON.parse(raw);
@@ -11338,7 +11358,7 @@ ${new Date().toISOString()}
11338
11358
  const parsed = Number.parseInt(firstLine, 10);
11339
11359
  if (Number.isFinite(parsed) && parsed > 0)
11340
11360
  owningPid = parsed;
11341
- lockMtimeMs = statSync4(lockPath).mtimeMs;
11361
+ lockMtimeMs = statSync5(lockPath).mtimeMs;
11342
11362
  } catch {
11343
11363
  return tryClaim();
11344
11364
  }
@@ -11610,11 +11630,14 @@ function prepareCanonicalEditArguments(toolName, rawArguments) {
11610
11630
  throw new InvalidRequestError(formatUnknownKeys(unknownRootKeys));
11611
11631
  }
11612
11632
  const modes = editModesPresent(record);
11633
+ if (hasOrphanedSymbolContent(record)) {
11634
+ throw new InvalidRequestError("edit: 'content' requires a non-empty string 'symbol' when symbol mode is selected");
11635
+ }
11613
11636
  if (modes.length > 1) {
11614
- throw new InvalidRequestError(`edit: conflicting modes: ${modes.join(", ")}`);
11637
+ throw new InvalidRequestError(`edit: conflicting modes: ${modes.join(", ")}. ${OMIT_OPTIONAL_FIELDS_STEERING}`);
11615
11638
  }
11616
11639
  if (modes.length === 0) {
11617
- throw new InvalidRequestError("edit: exactly one of `appendContent`, `edits`, or `symbol` plus `content` is required");
11640
+ throw new InvalidRequestError("edit: exactly one of `appendContent`, `edits`, or `symbol` plus `content` is required. " + OMIT_OPTIONAL_FIELDS_STEERING);
11618
11641
  }
11619
11642
  const mode = modes[0];
11620
11643
  if (mode === "appendContent") {
@@ -11679,18 +11702,83 @@ function formatUnknownKeys(keys) {
11679
11702
  return `Unrecognized keys: ${keys.map((key) => `"${key}"`).join(", ")}`;
11680
11703
  }
11681
11704
  function editModesPresent(record) {
11705
+ const hasAppendContent = isNonEmptyString(record.appendContent);
11706
+ if (!hasAppendContent)
11707
+ delete record.appendContent;
11708
+ const hasEdits = normalizeEditArraySentinels(record);
11709
+ if (!hasEdits)
11710
+ delete record.edits;
11711
+ const hasSymbol = isNonEmptyString(record.symbol);
11712
+ if (!hasSymbol) {
11713
+ delete record.symbol;
11714
+ if (record.content === null || record.content === "")
11715
+ delete record.content;
11716
+ } else if (record.content === null) {
11717
+ delete record.content;
11718
+ }
11719
+ const hasSingleEdit = isNonEmptyString(record.oldString);
11720
+ if (!hasSingleEdit) {
11721
+ for (const key of EDIT_ROOT_COMPATIBILITY_KEYS)
11722
+ delete record[key];
11723
+ } else {
11724
+ for (const key of ["newString", "replaceAll", "occurrence"]) {
11725
+ if (record[key] === null)
11726
+ delete record[key];
11727
+ }
11728
+ }
11682
11729
  const modes = [];
11683
- if (hasOwn(record, "appendContent"))
11730
+ if (hasAppendContent)
11684
11731
  modes.push("appendContent");
11685
- if (hasOwn(record, "edits"))
11732
+ if (hasEdits)
11686
11733
  modes.push("edits");
11687
- if (hasOwn(record, "symbol") || hasOwn(record, "content"))
11734
+ if (hasSymbol)
11688
11735
  modes.push("symbol/content");
11689
- if (["oldString", "newString", "replaceAll", "occurrence"].some((key) => hasOwn(record, key))) {
11736
+ if (hasSingleEdit)
11690
11737
  modes.push("oldString/newString");
11691
- }
11692
11738
  return modes;
11693
11739
  }
11740
+ function isNonEmptyString(value) {
11741
+ return typeof value === "string" && value.length > 0;
11742
+ }
11743
+ var OMIT_OPTIONAL_FIELDS_STEERING = "Omit unused optional fields entirely; do not send empty strings or empty arrays for them.";
11744
+ function isEditSentinelItem(item) {
11745
+ if (!item || typeof item !== "object" || Array.isArray(item))
11746
+ return false;
11747
+ const record = item;
11748
+ if (record.oldString !== "")
11749
+ return false;
11750
+ const newStringEmpty = !hasOwn(record, "newString") || record.newString === "" || record.newString === null;
11751
+ if (!newStringEmpty)
11752
+ return false;
11753
+ return !hasOwn(record, "content") || record.content === "" || record.content === null;
11754
+ }
11755
+ function normalizeEditArraySentinels(record) {
11756
+ const value = record.edits;
11757
+ if (Array.isArray(value)) {
11758
+ const survivors = value.filter((item) => !isEditSentinelItem(item));
11759
+ if (survivors.length === 0)
11760
+ return false;
11761
+ record.edits = survivors;
11762
+ return true;
11763
+ }
11764
+ if (typeof value !== "string" || value.length === 0)
11765
+ return false;
11766
+ try {
11767
+ const parsed = JSON.parse(value);
11768
+ if (!Array.isArray(parsed))
11769
+ return true;
11770
+ const survivors = parsed.filter((item) => !isEditSentinelItem(item));
11771
+ if (survivors.length === 0)
11772
+ return false;
11773
+ record.edits = survivors;
11774
+ return true;
11775
+ } catch {
11776
+ return true;
11777
+ }
11778
+ }
11779
+ function hasOrphanedSymbolContent(record) {
11780
+ return isNonEmptyString(record.content) && !isNonEmptyString(record.symbol);
11781
+ }
11694
11782
  function parseEditArray(value) {
11695
11783
  if (typeof value === "string") {
11696
11784
  let parsed;
@@ -12273,7 +12361,7 @@ class RevivableProjectTransport {
12273
12361
  }
12274
12362
  }
12275
12363
  // ../../node_modules/.bun/@cortexkit+subc-client@0.5.0/node_modules/@cortexkit/subc-client/dist/client.js
12276
- import { promises as fs2 } from "node:fs";
12364
+ import { promises as fs3 } from "node:fs";
12277
12365
  import { debuglog } from "node:util";
12278
12366
 
12279
12367
  // ../../node_modules/.bun/@cortexkit+subc-client@0.5.0/node_modules/@cortexkit/subc-client/dist/auth.js
@@ -12341,7 +12429,7 @@ async function authenticateClient(sock, conn, deadlineMs) {
12341
12429
  }
12342
12430
 
12343
12431
  // ../../node_modules/.bun/@cortexkit+subc-client@0.5.0/node_modules/@cortexkit/subc-client/dist/connection-file.js
12344
- import { promises as fs } from "node:fs";
12432
+ import { promises as fs2 } from "node:fs";
12345
12433
 
12346
12434
  // ../../node_modules/.bun/@cortexkit+subc-client@0.5.0/node_modules/@cortexkit/subc-client/dist/envelope.js
12347
12435
  var PROTOCOL_VERSION = 2;
@@ -12509,7 +12597,7 @@ function validate(info) {
12509
12597
  async function verifyOwnerOnly(path2) {
12510
12598
  if (process.platform === "win32")
12511
12599
  return;
12512
- const stat2 = await fs.stat(path2);
12600
+ const stat2 = await fs2.stat(path2);
12513
12601
  const mode = stat2.mode & 511;
12514
12602
  if ((mode & 63) !== 0) {
12515
12603
  throw new ConnectionFileError(`connection file ${path2} has insecure permissions 0o${mode.toString(8)}; expected owner-only 0600`);
@@ -12517,7 +12605,7 @@ async function verifyOwnerOnly(path2) {
12517
12605
  }
12518
12606
  async function readConnectionFile(path2) {
12519
12607
  await verifyOwnerOnly(path2);
12520
- const raw = await fs.readFile(path2, "utf8");
12608
+ const raw = await fs2.readFile(path2, "utf8");
12521
12609
  let parsed;
12522
12610
  try {
12523
12611
  parsed = JSON.parse(raw);
@@ -13580,7 +13668,7 @@ function isRetryableRouteOpenCode(code) {
13580
13668
  }
13581
13669
  async function connectionFileExists(path2) {
13582
13670
  try {
13583
- await fs2.access(path2);
13671
+ await fs3.access(path2);
13584
13672
  return true;
13585
13673
  } catch {
13586
13674
  return false;
@@ -31699,7 +31787,7 @@ import {
31699
31787
  readFileSync as readFileSync11,
31700
31788
  renameSync as renameSync6,
31701
31789
  rmSync as rmSync5,
31702
- statSync as statSync6,
31790
+ statSync as statSync7,
31703
31791
  writeFileSync as writeFileSync7
31704
31792
  } from "node:fs";
31705
31793
  import { dirname as dirname8 } from "node:path";
@@ -31713,7 +31801,7 @@ var import_comment_json3 = __toESM(require_src2(), 1);
31713
31801
 
31714
31802
  // src/hooks/auto-update-checker/checker.ts
31715
31803
  var import_comment_json2 = __toESM(require_src2(), 1);
31716
- import { existsSync as existsSync10, readFileSync as readFileSync9, statSync as statSync5, writeFileSync as writeFileSync5 } from "node:fs";
31804
+ import { existsSync as existsSync10, readFileSync as readFileSync9, statSync as statSync6, writeFileSync as writeFileSync5 } from "node:fs";
31717
31805
  import { homedir as homedir13 } from "node:os";
31718
31806
  import { dirname as dirname6, isAbsolute as isAbsolute7, join as join13, resolve as resolve8 } from "node:path";
31719
31807
  import { fileURLToPath } from "node:url";
@@ -31840,7 +31928,7 @@ function getLocalDevPath(directory) {
31840
31928
  }
31841
31929
  function findPackageJsonUp(startPath) {
31842
31930
  try {
31843
- const stat2 = statSync5(startPath);
31931
+ const stat2 = statSync6(startPath);
31844
31932
  let dir = stat2.isDirectory() ? startPath : dirname6(startPath);
31845
31933
  for (let i = 0;i < 10; i++) {
31846
31934
  const pkgPath = join13(dir, "package.json");
@@ -32321,7 +32409,7 @@ function isOrphanedCheckLock(lockPath) {
32321
32409
  }
32322
32410
  }
32323
32411
  function readCheckLockState(lockPath) {
32324
- const fallbackStartedMs = statSync6(lockPath).mtimeMs;
32412
+ const fallbackStartedMs = statSync7(lockPath).mtimeMs;
32325
32413
  try {
32326
32414
  const parsed = JSON.parse(readFileSync11(lockPath, "utf-8"));
32327
32415
  const pid = Number.isSafeInteger(parsed.pid) && (parsed.pid ?? 0) > 0 ? parsed.pid ?? null : null;
@@ -32455,7 +32543,7 @@ import {
32455
32543
  readFileSync as readFileSync14,
32456
32544
  renameSync as renameSync7,
32457
32545
  rmSync as rmSync6,
32458
- statSync as statSync8,
32546
+ statSync as statSync9,
32459
32547
  writeFileSync as writeFileSync9
32460
32548
  } from "node:fs";
32461
32549
  import { join as join17 } from "node:path";
@@ -32466,7 +32554,7 @@ import {
32466
32554
  mkdirSync as mkdirSync7,
32467
32555
  openSync as openSync6,
32468
32556
  readFileSync as readFileSync12,
32469
- statSync as statSync7,
32557
+ statSync as statSync8,
32470
32558
  unlinkSync as unlinkSync6,
32471
32559
  writeFileSync as writeFileSync8
32472
32560
  } from "node:fs";
@@ -32499,7 +32587,7 @@ function lspBinDir(npmPackage) {
32499
32587
  function isInstalled(npmPackage, binary) {
32500
32588
  for (const candidate of lspBinaryCandidates(binary)) {
32501
32589
  try {
32502
- if (statSync7(join15(lspBinDir(npmPackage), candidate)).isFile())
32590
+ if (statSync8(join15(lspBinDir(npmPackage), candidate)).isFile())
32503
32591
  return true;
32504
32592
  } catch {}
32505
32593
  }
@@ -32527,7 +32615,7 @@ function writeInstalledMetaIn(installDir, version2, sha256) {
32527
32615
  function readInstalledMetaIn(installDir) {
32528
32616
  const path3 = join15(installDir, INSTALLED_META_FILE);
32529
32617
  try {
32530
- if (!statSync7(path3).isFile())
32618
+ if (!statSync8(path3).isFile())
32531
32619
  return null;
32532
32620
  const raw = readFileSync12(path3, "utf8");
32533
32621
  const parsed = JSON.parse(raw);
@@ -32584,7 +32672,7 @@ ${new Date().toISOString()}
32584
32672
  const parsed = Number.parseInt(firstLine, 10);
32585
32673
  if (Number.isFinite(parsed) && parsed > 0)
32586
32674
  owningPid = parsed;
32587
- lockMtimeMs = statSync7(lock).mtimeMs;
32675
+ lockMtimeMs = statSync8(lock).mtimeMs;
32588
32676
  } catch {
32589
32677
  return tryClaim();
32590
32678
  }
@@ -33189,7 +33277,7 @@ function hashInstalledBinary(spec) {
33189
33277
  let pathToHash = null;
33190
33278
  for (const p of candidates) {
33191
33279
  try {
33192
- if (statSync8(p).isFile()) {
33280
+ if (statSync9(p).isFile()) {
33193
33281
  pathToHash = p;
33194
33282
  break;
33195
33283
  }
@@ -33215,7 +33303,7 @@ function installedBinaryPath(spec) {
33215
33303
  ] : [lspBinaryPath(spec.npm, spec.binary)];
33216
33304
  for (const candidate of candidates) {
33217
33305
  try {
33218
- if (statSync8(candidate).isFile())
33306
+ if (statSync9(candidate).isFile())
33219
33307
  return candidate;
33220
33308
  } catch {}
33221
33309
  }
@@ -33327,7 +33415,7 @@ import {
33327
33415
  realpathSync as realpathSync3,
33328
33416
  renameSync as renameSync8,
33329
33417
  rmSync as rmSync7,
33330
- statSync as statSync9,
33418
+ statSync as statSync10,
33331
33419
  unlinkSync as unlinkSync7,
33332
33420
  writeFileSync as writeFileSync10
33333
33421
  } from "node:fs";
@@ -33440,7 +33528,7 @@ function ghBinaryPath(spec, platform3) {
33440
33528
  function isGithubInstalled(spec, platform3) {
33441
33529
  for (const candidate of ghBinaryCandidates(spec, platform3)) {
33442
33530
  try {
33443
- if (statSync9(join18(ghBinDir(spec), candidate)).isFile())
33531
+ if (statSync10(join18(ghBinDir(spec), candidate)).isFile())
33444
33532
  return true;
33445
33533
  } catch {}
33446
33534
  }
@@ -33454,7 +33542,7 @@ function ghBinaryCandidates(spec, platform3) {
33454
33542
  function readGithubInstalledMetaIn(installDir) {
33455
33543
  try {
33456
33544
  const path3 = join18(installDir, INSTALLED_META_FILE2);
33457
- if (!statSync9(path3).isFile())
33545
+ if (!statSync10(path3).isFile())
33458
33546
  return null;
33459
33547
  const parsed = JSON.parse(readFileSync15(path3, "utf8"));
33460
33548
  if (typeof parsed.version !== "string" || parsed.version.length === 0)
@@ -33832,7 +33920,7 @@ function validateCachedGithubInstall(spec, platform3) {
33832
33920
  const meta3 = readGithubInstalledMetaIn(packageDir);
33833
33921
  const binaryPath = ghBinaryCandidates(spec, platform3).map((candidate) => join18(ghBinDir(spec), candidate)).find((candidate) => {
33834
33922
  try {
33835
- return statSync9(candidate).isFile();
33923
+ return statSync10(candidate).isFile();
33836
33924
  } catch {
33837
33925
  return false;
33838
33926
  }
@@ -35053,7 +35141,7 @@ import { tool as tool3 } from "@opencode-ai/plugin";
35053
35141
 
35054
35142
  // src/tools/permissions.ts
35055
35143
  import { execFileSync as execFileSync3 } from "node:child_process";
35056
- import * as fs3 from "node:fs";
35144
+ import * as fs4 from "node:fs";
35057
35145
  import { tmpdir as tmpdir3 } from "node:os";
35058
35146
  import * as path3 from "node:path";
35059
35147
  var UNSUPPORTED_ASK_HOST = "AFT requires OpenCode 1.15.5 or newer for permission asks; please upgrade OpenCode";
@@ -35089,11 +35177,22 @@ function resolveAbsolutePath(context, target) {
35089
35177
  const expanded = expandTilde2(target);
35090
35178
  return path3.isAbsolute(expanded) ? expanded : path3.resolve(projectRootFor(context), expanded);
35091
35179
  }
35180
+ function permissionPath(context, target) {
35181
+ const projectRoot = path3.resolve(projectRootFor(context));
35182
+ const absolutePath = path3.resolve(resolveAbsolutePath(context, target));
35183
+ if (projectRoot === path3.parse(projectRoot).root)
35184
+ return absolutePath;
35185
+ const relativePath = path3.relative(projectRoot, absolutePath);
35186
+ if (relativePath !== "" && relativePath !== ".." && !relativePath.startsWith(`..${path3.sep}`) && !path3.isAbsolute(relativePath)) {
35187
+ return relativePath;
35188
+ }
35189
+ return relativePath === "" ? "." : absolutePath;
35190
+ }
35092
35191
  function resolveRelativePattern(context, target) {
35093
- return path3.relative(projectRootFor(context), resolveAbsolutePath(context, target)) || ".";
35192
+ return permissionPath(context, target);
35094
35193
  }
35095
35194
  function resolveRelativePatternFromAbsolute(context, absolutePath) {
35096
- return path3.relative(projectRootFor(context), absolutePath) || ".";
35195
+ return permissionPath(context, absolutePath);
35097
35196
  }
35098
35197
  function resolveRelativePatterns(context, targets) {
35099
35198
  const seen = new Set;
@@ -35165,7 +35264,7 @@ function windowsPath(p) {
35165
35264
  function normalizePath(p) {
35166
35265
  const resolved = path3.resolve(windowsPath(p));
35167
35266
  try {
35168
- return fs3.realpathSync.native(resolved);
35267
+ return fs4.realpathSync.native(resolved);
35169
35268
  } catch {
35170
35269
  return normalizeNearestExistingParent(resolved);
35171
35270
  }
@@ -35175,7 +35274,7 @@ function normalizeNearestExistingParent(resolved) {
35175
35274
  let current = resolved;
35176
35275
  while (true) {
35177
35276
  try {
35178
- const realParent = fs3.realpathSync.native(current);
35277
+ const realParent = fs4.realpathSync.native(current);
35179
35278
  return missingTail.length === 0 ? realParent : path3.join(realParent, ...missingTail.reverse());
35180
35279
  } catch {
35181
35280
  const parent = path3.dirname(current);
@@ -35249,7 +35348,7 @@ function gitRootForNearestExistingParent(resolved) {
35249
35348
  const nearest = normalizeNearestExistingParent(resolved);
35250
35349
  let cwd = nearest;
35251
35350
  try {
35252
- if (fs3.statSync(nearest).isFile())
35351
+ if (fs4.statSync(nearest).isFile())
35253
35352
  cwd = path3.dirname(nearest);
35254
35353
  } catch {}
35255
35354
  try {
@@ -35609,6 +35708,21 @@ function orchestratedTransportTimeoutMs(blockToCompletion, wait, effectiveTimeou
35609
35708
  const waitBudget = blockToCompletion || wait ? effectiveTimeout ?? DEFAULT_HARD_TIMEOUT_MS : foregroundWaitMs;
35610
35709
  return waitBudget + BASH_TRANSPORT_MARGIN_MS;
35611
35710
  }
35711
+ function listenForForegroundAbort(ctx, runtime, enabled) {
35712
+ if (!enabled)
35713
+ return () => {};
35714
+ let fired = false;
35715
+ const onAbort = () => {
35716
+ if (fired)
35717
+ return;
35718
+ fired = true;
35719
+ callBashBridge(ctx, runtime, "bash_abort_inflight").catch(() => {});
35720
+ };
35721
+ runtime.abort.addEventListener("abort", onAbort, { once: true });
35722
+ if (runtime.abort.aborted)
35723
+ onAbort();
35724
+ return () => runtime.abort.removeEventListener("abort", onAbort);
35725
+ }
35612
35726
  function bashToolDescription(aftSearchRegistered, compressionOn, backgroundOn) {
35613
35727
  const searchSteer = aftSearchRegistered ? "use aft_search (concepts, identifiers, regex, literals), read, aft_outline, or aft_zoom instead" : "use the grep tool, read, aft_outline, or aft_zoom instead";
35614
35728
  const compression = compressionOn ? " Output is compressed by default; pass compressed: false for raw output. Piped commands run verbatim and show the pipeline's output; for AFT's test/build summary, run the runner without | head, | tail, or | grep." : "";
@@ -35753,30 +35867,36 @@ function createBashTool(ctx, aftSearchRegisteredOverride) {
35753
35867
  sessionLog(context.sessionID, "[bash] subagent + background:true → converting to foreground (subagent would lose task_id)");
35754
35868
  }
35755
35869
  const shellEnv = await ctx.plugin?.trigger?.("shell.env", { cwd, sessionID: context.sessionID, callID: getCallID(context) }, { env: {} });
35756
- const data = await withPermissionLoop(ctx, context, {
35757
- command,
35758
- timeout: effectiveTimeout,
35759
- workdir: args2.workdir,
35760
- env: shellEnv?.env ?? {},
35761
- description,
35762
- background: effectiveBackground,
35763
- notify_on_completion: effectiveBackground,
35764
- compressed,
35765
- pty: requestedPty,
35766
- pty_rows: ptyRows,
35767
- pty_cols: ptyCols,
35768
- permissions_requested: true,
35769
- foreground_orchestrate: true,
35770
- block_to_completion: blockToCompletion,
35771
- wait: requestedWait,
35772
- sandbox: args2.sandbox
35773
- }, callBashBridge, {
35774
- transportTimeoutMs: orchestratedTransportTimeoutMs(blockToCompletion, requestedWait, effectiveTimeout, foregroundWaitMs),
35775
- onProgress: ({ text }) => {
35776
- accumulatedOutput = preview(accumulatedOutput + text);
35777
- metadata?.({ output: accumulatedOutput, description });
35778
- }
35779
- });
35870
+ const removeAbortListener = listenForForegroundAbort(ctx, context, !effectiveBackground && !requestedPty);
35871
+ let data;
35872
+ try {
35873
+ data = await withPermissionLoop(ctx, context, {
35874
+ command,
35875
+ timeout: effectiveTimeout,
35876
+ workdir: args2.workdir,
35877
+ env: shellEnv?.env ?? {},
35878
+ description,
35879
+ background: effectiveBackground,
35880
+ notify_on_completion: effectiveBackground,
35881
+ compressed,
35882
+ pty: requestedPty,
35883
+ pty_rows: ptyRows,
35884
+ pty_cols: ptyCols,
35885
+ permissions_requested: true,
35886
+ foreground_orchestrate: true,
35887
+ block_to_completion: blockToCompletion,
35888
+ wait: requestedWait,
35889
+ sandbox: args2.sandbox
35890
+ }, callBashBridge, {
35891
+ transportTimeoutMs: orchestratedTransportTimeoutMs(blockToCompletion, requestedWait, effectiveTimeout, foregroundWaitMs),
35892
+ onProgress: ({ text }) => {
35893
+ accumulatedOutput = preview(accumulatedOutput + text);
35894
+ metadata?.({ output: accumulatedOutput, description });
35895
+ }
35896
+ });
35897
+ } finally {
35898
+ removeAbortListener();
35899
+ }
35780
35900
  if (data.success === false) {
35781
35901
  throw new Error(data.message || "bash failed");
35782
35902
  }
@@ -36586,7 +36706,7 @@ function createWriteTool(ctx, editToolName = "edit") {
36586
36706
  const projectRoot = await resolveProjectRoot(ctx, context);
36587
36707
  const filePath = resolvePathFromProjectRoot(projectRoot, file2);
36588
36708
  persistFilePathAlias(argsRecord, context);
36589
- const relPath = path4.relative(projectRoot, filePath);
36709
+ const permissionPattern = permissionPath(context, filePath);
36590
36710
  {
36591
36711
  const denial2 = await assertExternalDirectoryPermission(ctx, context, filePath);
36592
36712
  if (denial2)
@@ -36597,7 +36717,7 @@ function createWriteTool(ctx, editToolName = "edit") {
36597
36717
  if (preview2.success === false) {
36598
36718
  throw toolErrorFromResponse("write", preview2);
36599
36719
  }
36600
- const denial = await askEditPermission(context, [relPath], {
36720
+ const denial = await askEditPermission(context, [permissionPattern], {
36601
36721
  filepath: filePath,
36602
36722
  diff: typeof preview2.preview_diff === "string" ? preview2.preview_diff : ""
36603
36723
  });
@@ -36705,7 +36825,7 @@ function createEditTool(ctx, writeToolName = "write") {
36705
36825
  const projectRoot = await resolveProjectRoot(ctx, context);
36706
36826
  const filePath = resolvePathFromProjectRoot(projectRoot, file2);
36707
36827
  persistFilePathAlias(argsRecord, context);
36708
- const relPath = path4.relative(projectRoot, filePath);
36828
+ const permissionPattern = permissionPath(context, filePath);
36709
36829
  {
36710
36830
  const denial2 = await assertExternalDirectoryPermission(ctx, context, filePath);
36711
36831
  if (denial2)
@@ -36720,7 +36840,7 @@ function createEditTool(ctx, writeToolName = "write") {
36720
36840
  if (preview2.success === false) {
36721
36841
  throw toolErrorFromResponse("edit", preview2);
36722
36842
  }
36723
- const denial = await askEditPermission(context, [relPath], {
36843
+ const denial = await askEditPermission(context, [permissionPattern], {
36724
36844
  filepath: filePath,
36725
36845
  diff: typeof preview2.preview_diff === "string" ? preview2.preview_diff : ""
36726
36846
  });
@@ -36834,9 +36954,11 @@ function createApplyPatchTool(ctx) {
36834
36954
  return permissionDeniedResponse(denial2);
36835
36955
  }
36836
36956
  const affectedRelPaths = stringArray(preview2.affected_rel_paths);
36837
- const denial = await askEditPermission(context, affectedRelPaths, {
36957
+ const affectedPaths = stringArray(preview2.affected_paths);
36958
+ const permissionPatterns = (affectedPaths.length > 0 ? affectedPaths : affectedRelPaths).map((filePath) => permissionPath(context, filePath));
36959
+ const denial = await askEditPermission(context, permissionPatterns, {
36838
36960
  diff: typeof preview2.preview_diff === "string" ? preview2.preview_diff : "",
36839
- filepath: typeof preview2.filepath === "string" ? preview2.filepath : affectedRelPaths[0]
36961
+ filepath: typeof preview2.filepath === "string" ? preview2.filepath : affectedPaths[0] ?? affectedRelPaths[0]
36840
36962
  });
36841
36963
  if (denial)
36842
36964
  return permissionDeniedResponse(denial);
@@ -37786,7 +37908,7 @@ function safetyTools(ctx) {
37786
37908
  }
37787
37909
 
37788
37910
  // src/tools/search.ts
37789
- import * as fs4 from "node:fs";
37911
+ import * as fs5 from "node:fs";
37790
37912
  import * as path6 from "node:path";
37791
37913
  function arg2(schema) {
37792
37914
  return schema;
@@ -37795,7 +37917,7 @@ function absoluteSearchPath(projectRoot, target) {
37795
37917
  return resolvePathFromProjectRoot(projectRoot, expandTilde2(target));
37796
37918
  }
37797
37919
  function searchPathExists(projectRoot, target) {
37798
- return fs4.existsSync(absoluteSearchPath(projectRoot, target));
37920
+ return fs5.existsSync(absoluteSearchPath(projectRoot, target));
37799
37921
  }
37800
37922
  function splitSearchPathArg(projectRoot, raw) {
37801
37923
  if (searchPathExists(projectRoot, raw) || !/\s/.test(raw)) {
@@ -37838,7 +37960,7 @@ ${note}` : note;
37838
37960
  }
37839
37961
  function searchPathKind(projectRoot, target, defaultKind) {
37840
37962
  try {
37841
- const stat2 = fs4.lstatSync(absoluteSearchPath(projectRoot, target));
37963
+ const stat2 = fs5.lstatSync(absoluteSearchPath(projectRoot, target));
37842
37964
  if (defaultKind === "file") {
37843
37965
  return stat2.isDirectory() ? "directory" : "file";
37844
37966
  }
@@ -38128,6 +38250,18 @@ function buildHintsFromConfig(config2, disabledTools) {
38128
38250
  disabledTools
38129
38251
  });
38130
38252
  }
38253
+ function appendHintsToSystem(system, hintsBlock) {
38254
+ if (!hintsBlock)
38255
+ return;
38256
+ if (system.length > 0) {
38257
+ const last = system.length - 1;
38258
+ system[last] = `${system[last]}
38259
+
38260
+ ${hintsBlock}`;
38261
+ } else {
38262
+ system.push(hintsBlock);
38263
+ }
38264
+ }
38131
38265
 
38132
38266
  // src/index.ts
38133
38267
  setActiveLogger(bridgeLogger);
@@ -38156,11 +38290,11 @@ var PLUGIN_VERSION = (() => {
38156
38290
  return "0.0.0";
38157
38291
  }
38158
38292
  })();
38159
- var ANNOUNCEMENT_VERSION = "0.49.0";
38293
+ var ANNOUNCEMENT_VERSION = "0.49.2";
38160
38294
  var ANNOUNCEMENT_FEATURES = [
38161
- "One unified tool surface: every tool now takes `path` (old spellings keep working), `edit` has one calling shape, and `occurrence` is 1-based. Fewer ways for models to get a call wrong; prompt caches re-warm once after this upgrade.",
38162
- "aft_search now routes queries itself the hint parameter is gone, and searches that find no exact match are re-ranked by their terms instead of returning nothing.",
38163
- "Corporate and custom certificate authorities now work: HTTPS requests verify through the OS trust store (Keychain, Windows certificate store, SSL_CERT_FILE on Linux)."
38295
+ "No more zombie tasks: background commands die with their session reclaimed worktrees and aborted calls both terminate their process groups, while deliberately backgrounded tasks keep surviving restarts.",
38296
+ "aft_inspect stops crying wolf: diagnostics from a still-warming analyzer no longer count as errors (rust-analyzer's readiness signal is now consumed), so E-counts match what the compiler actually says.",
38297
+ "Piped commands can't hide failures: when an upstream command fails behind a successful pipe tail, the output says so. Plus zoom into nested JSON paths, range hints on large reads, and better edit errors (thanks @iceteaSA)."
38164
38298
  ];
38165
38299
  var ANNOUNCEMENT_FOOTER = "Join us on Discord: https://discord.gg/DSa65w8wuf";
38166
38300
  var plugin = async (input) => initializePluginForDirectory(input);
@@ -38661,15 +38795,15 @@ Install: ${getManualInstallHint()}`).catch(() => {});
38661
38795
  return {
38662
38796
  tool: allTools,
38663
38797
  "experimental.chat.system.transform": async (_input, output) => {
38664
- if (hintsBlock) {
38665
- output.system.push(hintsBlock);
38666
- }
38798
+ if (!hintsBlock)
38799
+ return;
38800
+ appendHintsToSystem(output.system, hintsBlock);
38667
38801
  },
38668
38802
  event: async (eventInput) => {
38669
38803
  await autoUpdateEventHook(eventInput);
38670
38804
  const eventType = eventInput.event.type;
38671
38805
  const sessionID = extractSessionID(eventInput.event.properties);
38672
- if ((eventType === "session.deleted" || eventType === "session.shutdown") && sessionID) {
38806
+ if (eventType === "session.deleted" && sessionID) {
38673
38807
  inspectTier2Idle.clear(sessionID);
38674
38808
  clearStatusBarSession(sessionID);
38675
38809
  pool.closeSession(input.directory, sessionID).catch(() => {});
@@ -1 +1 @@
1
- {"version":3,"file":"bash.d.ts","sourceRoot":"","sources":["../../src/tools/bash.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAe,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAMvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAuCjD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,CACjC,mBAAmB,EAAE,OAAO,EAC5B,aAAa,EAAE,OAAO,EACtB,YAAY,EAAE,OAAO,GACpB,MAAM,CAaR;AAwGD,wBAAgB,cAAc,CAC5B,GAAG,EAAE,aAAa,EAClB,2BAA2B,CAAC,EAAE,OAAO,GACpC,cAAc,CAkOhB;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CA2BvE;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CAwBrE"}
1
+ {"version":3,"file":"bash.d.ts","sourceRoot":"","sources":["../../src/tools/bash.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAe,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAMvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AA+DjD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,CACjC,mBAAmB,EAAE,OAAO,EAC5B,aAAa,EAAE,OAAO,EACtB,YAAY,EAAE,OAAO,GACpB,MAAM,CAaR;AAwGD,wBAAgB,cAAc,CAC5B,GAAG,EAAE,aAAa,EAClB,2BAA2B,CAAC,EAAE,OAAO,GACpC,cAAc,CA4OhB;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CA2BvE;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CAwBrE"}
@@ -1 +1 @@
1
- {"version":3,"file":"hoisted.d.ts","sourceRoot":"","sources":["../../src/tools/hoisted.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EAAe,cAAc,EAAc,MAAM,qBAAqB,CAAC;AAInF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAgDjD,wEAAwE;AACxE,eAAO,MAAM,wBAAwB,GAAI,IAAI,MAAM,EAAE,QAAQ,MAAM,EAAE,OAAO,MAAM,KAAG,MAChD,CAAC;AA+OtC;;GAEG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CAoIjE;AAsmBD;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CA0B/E;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CA4BnF"}
1
+ {"version":3,"file":"hoisted.d.ts","sourceRoot":"","sources":["../../src/tools/hoisted.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EAAe,cAAc,EAAc,MAAM,qBAAqB,CAAC;AAInF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAiDjD,wEAAwE;AACxE,eAAO,MAAM,wBAAwB,GAAI,IAAI,MAAM,EAAE,QAAQ,MAAM,EAAE,OAAO,MAAM,KAAG,MAChD,CAAC;AA+OtC;;GAEG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CAoIjE;AA6mBD;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CA0B/E;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CA4BnF"}
@@ -14,6 +14,7 @@ import type { PluginContext } from "../types.js";
14
14
  */
15
15
  export declare function runAsk(maybe: Promise<void>): Promise<void>;
16
16
  export declare function resolveAbsolutePath(context: ToolContext, target: string): string;
17
+ export declare function permissionPath(context: ToolContext, target: string): string;
17
18
  export declare function resolveRelativePattern(context: ToolContext, target: string): string;
18
19
  export declare function resolveRelativePatternFromAbsolute(context: ToolContext, absolutePath: string): string;
19
20
  export declare function resolveRelativePatterns(context: ToolContext, targets: string[]): string[];
@@ -1 +1 @@
1
- {"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../src/tools/permissions.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGvD,OAAO,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EACd,OAAO,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;IAAC,mBAAmB,CAAC,EAAE,OAAO,CAAA;CAAE,GACvE,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAiF7B;AAwBD;;;;;GAKG;AACH,wBAAsB,iCAAiC,CACrD,GAAG,EAAE,aAAa,EAClB,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAsE7B;AAkCD;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAO,GACjD,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAE7B;AAED;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAO,GACjD,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAE7B;AAED;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,GAC/B,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAkB7B;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAOhE"}
@@ -27,4 +27,14 @@ export declare function buildWorkflowHints(opts: WorkflowHintsOpts): string | nu
27
27
  * `bash.background` setting controls whether the hint appears.
28
28
  */
29
29
  export declare function buildHintsFromConfig(config: AftConfig, disabledTools: Set<string>): string | null;
30
+ /**
31
+ * Fold the hints block into a host `system[]` array in place.
32
+ *
33
+ * Each `system[]` entry becomes its own `role:"system"` message on the wire,
34
+ * and Qwen-family chat templates (vLLM/SGLang, and LiteLLM fronting them)
35
+ * reject any system message past index 0 — so the block must extend the
36
+ * existing entry rather than arrive as a second message. Exported separately
37
+ * from the plugin wiring so the single-message property is unit-testable.
38
+ */
39
+ export declare function appendHintsToSystem(system: string[], hintsBlock: string): void;
30
40
  //# sourceMappingURL=workflow-hints.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"workflow-hints.d.ts","sourceRoot":"","sources":["../src/workflow-hints.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,aAAa,CAAC;AAEhE,MAAM,WAAW,iBAAiB;IAChC,oEAAoE;IACpE,WAAW,EAAE,SAAS,GAAG,aAAa,GAAG,KAAK,CAAC;IAC/C,4EAA4E;IAC5E,aAAa,EAAE,OAAO,CAAC;IACvB,mEAAmE;IACnE,eAAe,EAAE,OAAO,CAAC;IACzB,2DAA2D;IAC3D,qBAAqB,EAAE,OAAO,CAAC;IAC/B,sCAAsC;IACtC,sBAAsB,EAAE,OAAO,CAAC;IAChC,4DAA4D;IAC5D,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAC5B;AAID;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI,CAgIzE;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,IAAI,CASjG"}
1
+ {"version":3,"file":"workflow-hints.d.ts","sourceRoot":"","sources":["../src/workflow-hints.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,aAAa,CAAC;AAEhE,MAAM,WAAW,iBAAiB;IAChC,oEAAoE;IACpE,WAAW,EAAE,SAAS,GAAG,aAAa,GAAG,KAAK,CAAC;IAC/C,4EAA4E;IAC5E,aAAa,EAAE,OAAO,CAAC;IACvB,mEAAmE;IACnE,eAAe,EAAE,OAAO,CAAC;IACzB,2DAA2D;IAC3D,qBAAqB,EAAE,OAAO,CAAC;IAC/B,sCAAsC;IACtC,sBAAsB,EAAE,OAAO,CAAC;IAChC,4DAA4D;IAC5D,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAC5B;AAID;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI,CAgIzE;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,IAAI,CASjG;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAQ9E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cortexkit/aft-opencode",
3
- "version": "0.49.0",
3
+ "version": "0.49.2",
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.49.0",
37
+ "@cortexkit/aft-bridge": "0.49.2",
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.49.0",
47
- "@cortexkit/aft-darwin-x64": "0.49.0",
48
- "@cortexkit/aft-linux-arm64": "0.49.0",
49
- "@cortexkit/aft-linux-x64": "0.49.0",
50
- "@cortexkit/aft-win32-arm64": "0.49.0",
51
- "@cortexkit/aft-win32-x64": "0.49.0"
46
+ "@cortexkit/aft-darwin-arm64": "0.49.2",
47
+ "@cortexkit/aft-darwin-x64": "0.49.2",
48
+ "@cortexkit/aft-linux-arm64": "0.49.2",
49
+ "@cortexkit/aft-linux-x64": "0.49.2",
50
+ "@cortexkit/aft-win32-arm64": "0.49.2",
51
+ "@cortexkit/aft-win32-x64": "0.49.2"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@opencode-ai/plugin": "^1.17.11",