@cortexkit/aft-opencode 0.47.3 → 0.48.0
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.d.ts.map +1 -1
- package/dist/index.js +26 -55
- package/dist/tools/bash.d.ts.map +1 -1
- package/dist/tools/bash_watch.d.ts.map +1 -1
- package/package.json +8 -8
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAiNlD;;;;;;;;;;;;;;;;GAgBG;AAQH,QAAA,MAAM,MAAM,EAAE,MAA6D,CAAC;AAsjC5E,eAAe,MAAM,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -35040,7 +35040,6 @@ function astTools(ctx) {
|
|
|
35040
35040
|
}
|
|
35041
35041
|
|
|
35042
35042
|
// src/tools/bash.ts
|
|
35043
|
-
import * as fs4 from "node:fs/promises";
|
|
35044
35043
|
import { tool as tool4 } from "@opencode-ai/plugin";
|
|
35045
35044
|
|
|
35046
35045
|
// src/shared/subagent-detect.ts
|
|
@@ -35367,19 +35366,15 @@ A completion reminder will be delivered automatically; don't poll.`;
|
|
|
35367
35366
|
return text;
|
|
35368
35367
|
}
|
|
35369
35368
|
async function formatPtyStatus(_runtime, taskId, data, requestedOutputMode) {
|
|
35370
|
-
const outputPath = data.output_path;
|
|
35371
|
-
if (!outputPath)
|
|
35372
|
-
return `
|
|
35373
|
-
[PTY output path unavailable]`;
|
|
35374
35369
|
const outputMode = requestedOutputMode ?? "screen";
|
|
35375
|
-
const raw =
|
|
35370
|
+
const raw = typeof data.pty_raw === "string" ? data.pty_raw : "";
|
|
35376
35371
|
let suffix = "";
|
|
35377
35372
|
if (outputMode === "raw") {
|
|
35378
|
-
suffix = raw
|
|
35379
|
-
${raw
|
|
35373
|
+
suffix = raw.length > 0 ? `
|
|
35374
|
+
${raw}` : "";
|
|
35380
35375
|
} else if (outputMode === "both") {
|
|
35381
35376
|
suffix = `
|
|
35382
|
-
${JSON.stringify({ screen: String(data.pty_screen ?? ""), raw
|
|
35377
|
+
${JSON.stringify({ screen: String(data.pty_screen ?? ""), raw }, null, 2)}`;
|
|
35383
35378
|
} else {
|
|
35384
35379
|
const screen = data.pty_screen;
|
|
35385
35380
|
suffix = screen ? `
|
|
@@ -35453,12 +35448,11 @@ function conflictTools(ctx) {
|
|
|
35453
35448
|
}
|
|
35454
35449
|
|
|
35455
35450
|
// src/tools/hoisted.ts
|
|
35456
|
-
import * as
|
|
35451
|
+
import * as fs4 from "node:fs";
|
|
35457
35452
|
import * as path4 from "node:path";
|
|
35458
35453
|
import { tool as tool8 } from "@opencode-ai/plugin";
|
|
35459
35454
|
|
|
35460
35455
|
// src/tools/bash_watch.ts
|
|
35461
|
-
import * as fs5 from "node:fs/promises";
|
|
35462
35456
|
import { tool as tool6 } from "@opencode-ai/plugin";
|
|
35463
35457
|
var z6 = tool6.schema;
|
|
35464
35458
|
var BASH_WAIT_POLL_INTERVAL_MS = 100;
|
|
@@ -35590,8 +35584,13 @@ ${preview2}`;
|
|
|
35590
35584
|
}
|
|
35591
35585
|
return text;
|
|
35592
35586
|
}
|
|
35593
|
-
async function bashStatusSnapshot2(ctx, runtime, taskId, outputMode, options) {
|
|
35594
|
-
const data = await callBashBridge(ctx, runtime, "bash_status", {
|
|
35587
|
+
async function bashStatusSnapshot2(ctx, runtime, taskId, outputMode, cursor, options) {
|
|
35588
|
+
const data = await callBashBridge(ctx, runtime, "bash_status", {
|
|
35589
|
+
task_id: taskId,
|
|
35590
|
+
output_mode: outputMode,
|
|
35591
|
+
output_offset: cursor?.output,
|
|
35592
|
+
stderr_offset: cursor?.stderr
|
|
35593
|
+
}, options);
|
|
35595
35594
|
if (data.success === false)
|
|
35596
35595
|
throw new Error(data.message ?? "bash_status failed");
|
|
35597
35596
|
return data;
|
|
@@ -35616,7 +35615,7 @@ async function waitForBashStatus(ctx, runtime, taskId, outputMode, waitFor, effe
|
|
|
35616
35615
|
while (true) {
|
|
35617
35616
|
let data;
|
|
35618
35617
|
try {
|
|
35619
|
-
data = await bashStatusSnapshot2(ctx, runtime, taskId, outputMode, bridgeOptions);
|
|
35618
|
+
data = await bashStatusSnapshot2(ctx, runtime, taskId, outputMode, waitFor ? spillCursor : undefined, bridgeOptions);
|
|
35620
35619
|
} catch (err) {
|
|
35621
35620
|
if (!isBridgeTransportTimeout(err))
|
|
35622
35621
|
throw err;
|
|
@@ -35695,14 +35694,9 @@ async function waitForBashStatus(ctx, runtime, taskId, outputMode, waitFor, effe
|
|
|
35695
35694
|
}
|
|
35696
35695
|
}
|
|
35697
35696
|
async function readNewTaskOutput(data, cursor) {
|
|
35698
|
-
const
|
|
35699
|
-
const
|
|
35700
|
-
if (
|
|
35701
|
-
return;
|
|
35702
|
-
const stdoutBytes = outputPath ? await readFileBytesFrom(outputPath, cursor.output) : Buffer.alloc(0);
|
|
35703
|
-
const stderrBytes = stderrPath ? await readFileBytesFrom(stderrPath, cursor.stderr) : Buffer.alloc(0);
|
|
35704
|
-
const bytesRead = stdoutBytes.length + stderrBytes.length;
|
|
35705
|
-
if (bytesRead === 0)
|
|
35697
|
+
const stdoutBytes = typeof data.output_chunk_base64 === "string" ? Buffer.from(data.output_chunk_base64, "base64") : Buffer.alloc(0);
|
|
35698
|
+
const stderrBytes = typeof data.stderr_chunk_base64 === "string" ? Buffer.from(data.stderr_chunk_base64, "base64") : Buffer.alloc(0);
|
|
35699
|
+
if (stdoutBytes.length + stderrBytes.length === 0)
|
|
35706
35700
|
return;
|
|
35707
35701
|
const chunks = [];
|
|
35708
35702
|
if (stdoutBytes.length > 0) {
|
|
@@ -35722,31 +35716,11 @@ async function readNewTaskOutput(data, cursor) {
|
|
|
35722
35716
|
return {
|
|
35723
35717
|
chunks,
|
|
35724
35718
|
nextCursor: {
|
|
35725
|
-
output: cursor.output + stdoutBytes.length,
|
|
35726
|
-
stderr: cursor.stderr + stderrBytes.length
|
|
35719
|
+
output: typeof data.output_next_offset === "number" ? data.output_next_offset : cursor.output + stdoutBytes.length,
|
|
35720
|
+
stderr: typeof data.stderr_next_offset === "number" ? data.stderr_next_offset : cursor.stderr + stderrBytes.length
|
|
35727
35721
|
}
|
|
35728
35722
|
};
|
|
35729
35723
|
}
|
|
35730
|
-
async function readFileBytesFrom(outputPath, cursor) {
|
|
35731
|
-
const handle = await fs5.open(outputPath, "r");
|
|
35732
|
-
try {
|
|
35733
|
-
const chunks = [];
|
|
35734
|
-
let offset = cursor;
|
|
35735
|
-
while (true) {
|
|
35736
|
-
const buffer2 = Buffer.allocUnsafe(64 * 1024);
|
|
35737
|
-
const { bytesRead } = await handle.read(buffer2, 0, buffer2.length, offset);
|
|
35738
|
-
if (bytesRead === 0)
|
|
35739
|
-
break;
|
|
35740
|
-
chunks.push(Buffer.from(buffer2.subarray(0, bytesRead)));
|
|
35741
|
-
offset += bytesRead;
|
|
35742
|
-
}
|
|
35743
|
-
return Buffer.concat(chunks);
|
|
35744
|
-
} finally {
|
|
35745
|
-
await handle.close().catch(() => {
|
|
35746
|
-
return;
|
|
35747
|
-
});
|
|
35748
|
-
}
|
|
35749
|
-
}
|
|
35750
35724
|
function parseWaitPattern(value) {
|
|
35751
35725
|
if (typeof value === "string")
|
|
35752
35726
|
return { kind: "substring", value };
|
|
@@ -36025,7 +35999,7 @@ function diagnosticsOnEditDefault(ctx) {
|
|
|
36025
35999
|
}
|
|
36026
36000
|
async function readCurrentFileForPreview(filePath) {
|
|
36027
36001
|
try {
|
|
36028
|
-
return await
|
|
36002
|
+
return await fs4.promises.readFile(filePath, "utf-8");
|
|
36029
36003
|
} catch (error53) {
|
|
36030
36004
|
if (error53 && typeof error53 === "object" && "code" in error53 && error53.code === "ENOENT") {
|
|
36031
36005
|
return "";
|
|
@@ -37407,7 +37381,7 @@ function safetyTools(ctx) {
|
|
|
37407
37381
|
}
|
|
37408
37382
|
|
|
37409
37383
|
// src/tools/search.ts
|
|
37410
|
-
import * as
|
|
37384
|
+
import * as fs5 from "node:fs";
|
|
37411
37385
|
import * as path6 from "node:path";
|
|
37412
37386
|
function arg2(schema) {
|
|
37413
37387
|
return schema;
|
|
@@ -37416,7 +37390,7 @@ function absoluteSearchPath(projectRoot, target) {
|
|
|
37416
37390
|
return resolvePathFromProjectRoot(projectRoot, expandTilde2(target));
|
|
37417
37391
|
}
|
|
37418
37392
|
function searchPathExists(projectRoot, target) {
|
|
37419
|
-
return
|
|
37393
|
+
return fs5.existsSync(absoluteSearchPath(projectRoot, target));
|
|
37420
37394
|
}
|
|
37421
37395
|
function splitSearchPathArg(projectRoot, raw) {
|
|
37422
37396
|
if (searchPathExists(projectRoot, raw) || !/\s/.test(raw)) {
|
|
@@ -37459,7 +37433,7 @@ ${note}` : note;
|
|
|
37459
37433
|
}
|
|
37460
37434
|
function searchPathKind(projectRoot, target, defaultKind) {
|
|
37461
37435
|
try {
|
|
37462
|
-
const stat2 =
|
|
37436
|
+
const stat2 = fs5.lstatSync(absoluteSearchPath(projectRoot, target));
|
|
37463
37437
|
if (defaultKind === "file") {
|
|
37464
37438
|
return stat2.isDirectory() ? "directory" : "file";
|
|
37465
37439
|
}
|
|
@@ -37754,14 +37728,11 @@ var PLUGIN_VERSION = (() => {
|
|
|
37754
37728
|
return "0.0.0";
|
|
37755
37729
|
}
|
|
37756
37730
|
})();
|
|
37757
|
-
var ANNOUNCEMENT_VERSION = "0.
|
|
37731
|
+
var ANNOUNCEMENT_VERSION = "0.48.0";
|
|
37758
37732
|
var ANNOUNCEMENT_FEATURES = [
|
|
37759
|
-
"
|
|
37760
|
-
"Fixed:
|
|
37761
|
-
"Fixed:
|
|
37762
|
-
"Fixed: aft_inspect no longer counts TODO markers inside strings and now reports self-import cycles; trace_data no longer reports a flow after the variable is overwritten.",
|
|
37763
|
-
"Long-running daemon sessions fully reclaim idle projects (lower memory), and daemon restarts no longer trigger a re-embedding storm.",
|
|
37764
|
-
"Faster indexed search, tool dispatch, call trees, and duplicate scans across the board."
|
|
37733
|
+
"New (beta, off by default): an optional native sandbox for hoisted bash. Confines commands to your project and blocks reads of your credentials (~/.ssh, ~/.aws, cloud configs). Enable with sandbox.enabled in aft.jsonc — macOS and Linux; see docs/config.md for the platform matrix.",
|
|
37734
|
+
"Fixed: Windows background bash tasks could report failed with no exit code after a detach/rebind — completion is now recorded reliably.",
|
|
37735
|
+
"Fixed: search no longer rebuilds its index unnecessarily for repositories with grafted history."
|
|
37765
37736
|
];
|
|
37766
37737
|
var ANNOUNCEMENT_FOOTER = "Join us on Discord: https://discord.gg/DSa65w8wuf";
|
|
37767
37738
|
var plugin = async (input) => initializePluginForDirectory(input);
|
package/dist/tools/bash.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bash.d.ts","sourceRoot":"","sources":["../../src/tools/bash.ts"],"names":[],"mappings":"
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bash_watch.d.ts","sourceRoot":"","sources":["../../src/tools/bash_watch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bash_watch.d.ts","sourceRoot":"","sources":["../../src/tools/bash_watch.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAavE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AASjD,MAAM,MAAM,eAAe,GACvB;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACpC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AACtC,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,cAAc,GAAG,aAAa,CAAC;IAC1E,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;CACpC,CAAC;AAUF,KAAK,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAAE,MAAM,CAAC,EAAE,gBAAgB,CAAA;CAAE,CAAC;AAMlF,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CA0GtE;AAuHD,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,aAAa,EAClB,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,OAAO,EAAE,eAAe,GAAG,SAAS,EACpC,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC,kBAAkB,CAAC,CA2H7B;AA6CD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,GAAG,SAAS,CAI5E;AAkGD,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,eAAe,GACvB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAEtC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortexkit/aft-opencode",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.48.0",
|
|
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.
|
|
37
|
+
"@cortexkit/aft-bridge": "0.48.0",
|
|
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.
|
|
47
|
-
"@cortexkit/aft-darwin-x64": "0.
|
|
48
|
-
"@cortexkit/aft-linux-arm64": "0.
|
|
49
|
-
"@cortexkit/aft-linux-x64": "0.
|
|
50
|
-
"@cortexkit/aft-win32-arm64": "0.
|
|
51
|
-
"@cortexkit/aft-win32-x64": "0.
|
|
46
|
+
"@cortexkit/aft-darwin-arm64": "0.48.0",
|
|
47
|
+
"@cortexkit/aft-darwin-x64": "0.48.0",
|
|
48
|
+
"@cortexkit/aft-linux-arm64": "0.48.0",
|
|
49
|
+
"@cortexkit/aft-linux-x64": "0.48.0",
|
|
50
|
+
"@cortexkit/aft-win32-arm64": "0.48.0",
|
|
51
|
+
"@cortexkit/aft-win32-x64": "0.48.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@opencode-ai/plugin": "^1.17.11",
|