@cortexkit/aft 0.56.1 → 0.56.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAY3D,OAAO,EAEL,kBAAkB,EAClB,KAAK,gBAAgB,EAKtB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAYrE,OAAO,EAAE,KAAK,WAAW,EAAkB,MAAM,qBAAqB,CAAC;AAMvE,OAAO,EAAyB,KAAK,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEhG,MAAM,MAAM,iBAAiB,GAAG,cAAc,GAAG,WAAW,GAAG,cAAc,CAAC;AAE9E,eAAO,MAAM,2BAA2B,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,iBAAiB,CAAA;CAAE,EAapF,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,iBAAiB,EAAqB,CAAC;AAEhF,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,EAAE,OAAO,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,0FAA0F;IAC1F,eAAe,CAAC,EAAE,OAAO,yBAAyB,CAAC;IACnD,kBAAkB,CAAC,EAAE,OAAO,kBAAkB,CAAC;IAC/C,oBAAoB,CAAC,EAAE,OAAO,oBAAoB,CAAC;IACnD,kBAAkB,CAAC,EAAE,MAAM,qBAAqB,CAAC;CAClD;AA8BD,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,C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const OPENCODE_LOAD_PATHS: readonly ["root-default", "export-server-
|
|
2
|
+
export declare const OPENCODE_LOAD_PATHS: readonly ["root-default", "export-server-effect-bun", "export-server-effect-node"];
|
|
3
3
|
export type OpenCodeLoadPath = (typeof OPENCODE_LOAD_PATHS)[number];
|
|
4
4
|
export interface OpenCodeDoctorInput {
|
|
5
5
|
detection: OpenCodeHostDetection;
|
|
@@ -8,6 +8,7 @@ export interface OpenCodeDoctorInput {
|
|
|
8
8
|
pluginCachePath: string;
|
|
9
9
|
cachedPluginVersion?: string;
|
|
10
10
|
expectedPluginEntry?: string;
|
|
11
|
+
acceptExplicitPluginVersion?: boolean;
|
|
11
12
|
}
|
|
12
13
|
export interface OpenCodeDoctorResult {
|
|
13
14
|
expectedLoadPath: OpenCodeLoadPath | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opencode.d.ts","sourceRoot":"","sources":["../../src/doctor/opencode.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,qBAAqB,EAAuB,MAAM,6BAA6B,CAAC;AAG9F,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"opencode.d.ts","sourceRoot":"","sources":["../../src/doctor/opencode.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,qBAAqB,EAAuB,MAAM,6BAA6B,CAAC;AAG9F,eAAO,MAAM,mBAAmB,oFAItB,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpE,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,qBAAqB,CAAC;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,2BAA2B,CAAC,EAAE,OAAO,CAAC;CACvC;AAED,MAAM,WAAW,oBAAoB;IACnC,gBAAgB,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC1C,aAAa,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACvC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAmGD,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,qBAAqB,GAC/B,gBAAgB,GAAG,IAAI,CAQzB;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,mBAAmB,GAAG,oBAAoB,CA8CrF"}
|
package/dist/index.js
CHANGED
|
@@ -366,6 +366,7 @@ var init_bridge = __esm(() => {
|
|
|
366
366
|
pending = new Map;
|
|
367
367
|
outstandingBackgroundTaskIds = new Set;
|
|
368
368
|
nextId = 1;
|
|
369
|
+
processGeneration = 0;
|
|
369
370
|
stdoutBuffer = "";
|
|
370
371
|
stdoutReadOffset = 0;
|
|
371
372
|
stderrBuffer = "";
|
|
@@ -678,6 +679,7 @@ var init_bridge = __esm(() => {
|
|
|
678
679
|
}
|
|
679
680
|
}
|
|
680
681
|
const id = String(this.nextId++);
|
|
682
|
+
const tool = command === "tool_call" && typeof params.name === "string" ? params.name : command;
|
|
681
683
|
let request;
|
|
682
684
|
if (command === "cancel_request" || Object.hasOwn(params, "command") || Object.hasOwn(params, "method")) {
|
|
683
685
|
const nested = { ...params };
|
|
@@ -731,14 +733,20 @@ var init_bridge = __esm(() => {
|
|
|
731
733
|
return;
|
|
732
734
|
}
|
|
733
735
|
entry.reject(new Error(`${this.errorPrefix} Request "${command}" (id=${id}) timed out after ${effectiveTimeoutMs}ms`));
|
|
734
|
-
this.handleTimeout(
|
|
736
|
+
this.handleTimeout({
|
|
737
|
+
requestId: id,
|
|
738
|
+
tool: entry.tool,
|
|
739
|
+
generation: entry.generation
|
|
740
|
+
}, requestSessionId);
|
|
735
741
|
}, effectiveTimeoutMs);
|
|
736
742
|
const entry = {
|
|
737
743
|
resolve,
|
|
738
744
|
reject,
|
|
739
745
|
timer,
|
|
740
746
|
onProgress: options?.onProgress,
|
|
741
|
-
command
|
|
747
|
+
command,
|
|
748
|
+
tool,
|
|
749
|
+
generation: this.processGeneration
|
|
742
750
|
};
|
|
743
751
|
this.pending.set(id, entry);
|
|
744
752
|
if (!child?.stdin?.writable) {
|
|
@@ -1041,6 +1049,7 @@ var init_bridge = __esm(() => {
|
|
|
1041
1049
|
this.handleCrash();
|
|
1042
1050
|
});
|
|
1043
1051
|
this.process = child;
|
|
1052
|
+
this.processGeneration += 1;
|
|
1044
1053
|
this.spawnedBinaryFingerprint = readBinaryFingerprint(this.binaryPath);
|
|
1045
1054
|
this.lastBinaryFingerprintCheckAt = Date.now();
|
|
1046
1055
|
this.stdoutBuffer = "";
|
|
@@ -1212,10 +1221,15 @@ var init_bridge = __esm(() => {
|
|
|
1212
1221
|
this.outstandingBackgroundTaskIds.add(taskId);
|
|
1213
1222
|
}
|
|
1214
1223
|
}
|
|
1215
|
-
handleTimeout(triggeringSessionId) {
|
|
1224
|
+
handleTimeout(trigger, triggeringSessionId) {
|
|
1216
1225
|
this.consecutiveRequestTimeouts = 0;
|
|
1217
1226
|
this.spawnedBinaryFingerprint = null;
|
|
1218
|
-
|
|
1227
|
+
const abortedSiblings = Array.from(this.pending, ([requestId, entry]) => ({
|
|
1228
|
+
request_id: requestId,
|
|
1229
|
+
tool: entry.tool
|
|
1230
|
+
}));
|
|
1231
|
+
const attribution = `triggering_request_id=${trigger.requestId} ` + `triggering_tool=${JSON.stringify(trigger.tool)} ` + `bridge_generation=${trigger.generation} ` + `aborted_siblings=${JSON.stringify(abortedSiblings)}`;
|
|
1232
|
+
this.rejectAllPending(new BridgeTransportUnknownOutcomeError(`${this.errorPrefix} bridge killed during sibling timeout — request aborted; ${attribution}`));
|
|
1219
1233
|
this.outstandingBackgroundTaskIds.clear();
|
|
1220
1234
|
if (this.process) {
|
|
1221
1235
|
this.process.kill("SIGKILL");
|
|
@@ -1225,17 +1239,11 @@ var init_bridge = __esm(() => {
|
|
|
1225
1239
|
this.configured = false;
|
|
1226
1240
|
const tail = this.formatStderrTail();
|
|
1227
1241
|
this.stderrTail = [];
|
|
1228
|
-
const killedMsg = tail ? `Bridge killed after timeout.${tail}` : `Bridge killed after timeout (see ${this.getLogFilePathVia()})`;
|
|
1229
|
-
if (
|
|
1230
|
-
|
|
1231
|
-
this.sessionErrorVia(triggeringSessionId, killedMsg);
|
|
1232
|
-
} else {
|
|
1233
|
-
this.errorVia(killedMsg);
|
|
1234
|
-
}
|
|
1235
|
-
} else if (triggeringSessionId) {
|
|
1236
|
-
this.sessionWarnVia(triggeringSessionId, killedMsg);
|
|
1242
|
+
const killedMsg = tail ? `Bridge killed after timeout; ${attribution}.${tail}` : `Bridge killed after timeout; ${attribution} (see ${this.getLogFilePathVia()})`;
|
|
1243
|
+
if (triggeringSessionId) {
|
|
1244
|
+
this.sessionErrorVia(triggeringSessionId, killedMsg);
|
|
1237
1245
|
} else {
|
|
1238
|
-
this.
|
|
1246
|
+
this.errorVia(killedMsg);
|
|
1239
1247
|
}
|
|
1240
1248
|
}
|
|
1241
1249
|
handleCrash(cause) {
|
|
@@ -12110,6 +12118,13 @@ function snapshotOperatorState(operatorHome) {
|
|
|
12110
12118
|
logs: snapshotTree(join13(operatorHome, ".local", "share", "opencode", "log"))
|
|
12111
12119
|
});
|
|
12112
12120
|
}
|
|
12121
|
+
function probeCreatedIsolatedState(dataRoot, stateRoot) {
|
|
12122
|
+
return [dataRoot, stateRoot].some((root) => {
|
|
12123
|
+
const opencodeRoot = join13(root, "opencode");
|
|
12124
|
+
const database = join13(opencodeRoot, "opencode.db");
|
|
12125
|
+
return [database, `${database}-wal`, `${database}-shm`, join13(opencodeRoot, "log")].some(existsSync11);
|
|
12126
|
+
});
|
|
12127
|
+
}
|
|
12113
12128
|
function probeOpenCodeV1Version(executable, options = {}) {
|
|
12114
12129
|
const operatorHome = options.operatorHome ?? homedir9();
|
|
12115
12130
|
const before = snapshotOperatorState(operatorHome);
|
|
@@ -12151,10 +12166,14 @@ function probeOpenCodeV1Version(executable, options = {}) {
|
|
|
12151
12166
|
probeError = error;
|
|
12152
12167
|
}
|
|
12153
12168
|
const after = snapshotOperatorState(operatorHome);
|
|
12169
|
+
const createdIsolatedState = probeCreatedIsolatedState(data, state);
|
|
12154
12170
|
rmSync3(root, { recursive: true, force: true });
|
|
12155
|
-
if (after !== before) {
|
|
12171
|
+
if (after !== before && env.AFT_LOAD_MATRIX_ALLOW_LIVE_OPERATOR === "0") {
|
|
12156
12172
|
throw new Error("OpenCode host probe changed the operator database or log directory");
|
|
12157
12173
|
}
|
|
12174
|
+
if (after !== before && !createdIsolatedState) {
|
|
12175
|
+
console.warn("OpenCode operator state changed during an isolated host probe while its data and state roots stayed empty; an active host may be writing concurrently");
|
|
12176
|
+
}
|
|
12158
12177
|
if (probeError)
|
|
12159
12178
|
throw probeError;
|
|
12160
12179
|
if (!result || result.error || result.status !== 0)
|
|
@@ -14317,19 +14336,16 @@ function pluginManifest(entry, cachePath) {
|
|
|
14317
14336
|
return manifestFromLocalPath(localRoot);
|
|
14318
14337
|
return readManifest(join16(cachePath, "node_modules", "@cortexkit", "aft-opencode", "package.json"));
|
|
14319
14338
|
}
|
|
14320
|
-
function
|
|
14321
|
-
|
|
14322
|
-
|
|
14323
|
-
const discovered = manifest["oc-plugin"];
|
|
14324
|
-
const exports = manifest.exports;
|
|
14325
|
-
return Array.isArray(discovered) && discovered.includes("server") && typeof exports === "object" && exports !== null && Object.hasOwn(exports, "./server");
|
|
14339
|
+
function hasExplicitSemver(entry) {
|
|
14340
|
+
const version = configuredVersion(entry);
|
|
14341
|
+
return Boolean(version && /^\d+\.\d+\.\d+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/.test(version));
|
|
14326
14342
|
}
|
|
14327
14343
|
function latestLoggedLoadPath(logPath) {
|
|
14328
14344
|
if (!existsSync14(logPath))
|
|
14329
14345
|
return null;
|
|
14330
14346
|
try {
|
|
14331
14347
|
const text = readFileSync11(logPath, "utf8");
|
|
14332
|
-
const pattern = /(?:load path|load_path)\s*[:=]\s*(root-default|export-server-
|
|
14348
|
+
const pattern = /(?:load path|load_path)\s*[:=]\s*(root-default|export-server-effect-bun|export-server-effect-node)/gi;
|
|
14333
14349
|
let latest = null;
|
|
14334
14350
|
for (const match of text.matchAll(pattern)) {
|
|
14335
14351
|
const value = match[1];
|
|
@@ -14346,7 +14362,7 @@ function detectedV2Runtime(detection) {
|
|
|
14346
14362
|
}
|
|
14347
14363
|
function expectedOpenCodeLoadPath(detection) {
|
|
14348
14364
|
if (detection.status === "v1")
|
|
14349
|
-
return "
|
|
14365
|
+
return "root-default";
|
|
14350
14366
|
if (detection.status === "v2") {
|
|
14351
14367
|
return detectedV2Runtime(detection) === "bun" ? "export-server-effect-bun" : "export-server-effect-node";
|
|
14352
14368
|
}
|
|
@@ -14360,7 +14376,7 @@ function diagnoseOpenCodeLoad(input) {
|
|
|
14360
14376
|
const logged = latestLoggedLoadPath(input.logPath);
|
|
14361
14377
|
let takenLoadPath = logged;
|
|
14362
14378
|
if (!takenLoadPath && input.detection.status === "v1") {
|
|
14363
|
-
takenLoadPath =
|
|
14379
|
+
takenLoadPath = "root-default";
|
|
14364
14380
|
} else if (!takenLoadPath && input.detection.status === "v2") {
|
|
14365
14381
|
takenLoadPath = expectedLoadPath;
|
|
14366
14382
|
}
|
|
@@ -14369,7 +14385,7 @@ function diagnoseOpenCodeLoad(input) {
|
|
|
14369
14385
|
if (config && Object.hasOwn(config, "plugins")) {
|
|
14370
14386
|
problems.push("config uses unsupported `plugins`; run doctor --fix to migrate it to `plugin`");
|
|
14371
14387
|
}
|
|
14372
|
-
if (entry && isAftNpmEntry(entry) && input.expectedPluginEntry && entry !== input.expectedPluginEntry) {
|
|
14388
|
+
if (entry && isAftNpmEntry(entry) && input.expectedPluginEntry && entry !== input.expectedPluginEntry && !(input.acceptExplicitPluginVersion && hasExplicitSemver(entry))) {
|
|
14373
14389
|
problems.push(`plugin entry ${entry} is not the required exact pin ${input.expectedPluginEntry}`);
|
|
14374
14390
|
}
|
|
14375
14391
|
if (input.detection.status === "ambiguous") {
|
|
@@ -14388,7 +14404,6 @@ var init_opencode2 = __esm(() => {
|
|
|
14388
14404
|
init_opencode_config();
|
|
14389
14405
|
OPENCODE_LOAD_PATHS = [
|
|
14390
14406
|
"root-default",
|
|
14391
|
-
"export-server-v1",
|
|
14392
14407
|
"export-server-effect-bun",
|
|
14393
14408
|
"export-server-effect-node"
|
|
14394
14409
|
];
|
|
@@ -16147,7 +16162,8 @@ async function runDoctor(options) {
|
|
|
16147
16162
|
logPath: opencodeHarness.logFile.path,
|
|
16148
16163
|
pluginCachePath: opencodeHarness.pluginCache.path,
|
|
16149
16164
|
cachedPluginVersion: opencodeHarness.pluginCache.cached,
|
|
16150
|
-
expectedPluginEntry: opencodeAdapter.pluginEntryWithVersion
|
|
16165
|
+
expectedPluginEntry: hostDetection.status === "v1" ? `${opencodeAdapter.pluginPackageName}@latest` : opencodeAdapter.pluginEntryWithVersion,
|
|
16166
|
+
acceptExplicitPluginVersion: hostDetection.status === "v1"
|
|
16151
16167
|
}) : null;
|
|
16152
16168
|
log2.info(`AFT CLI v${report.cliVersion}, AFT binary ${report.binaryVersion ?? "unknown"}`);
|
|
16153
16169
|
if (!report.binaryVersion) {
|
|
@@ -37,8 +37,9 @@ export interface V1VersionProbeOptions {
|
|
|
37
37
|
}
|
|
38
38
|
export declare function findExecutableOnPath(name: "opencode" | "opencode2", pathValue?: string, platform?: NodeJS.Platform): string | null;
|
|
39
39
|
/**
|
|
40
|
-
* Run the V1 version probe in disposable host roots.
|
|
41
|
-
*
|
|
40
|
+
* Run the V1 version probe in disposable host roots. CI can enable the strict
|
|
41
|
+
* operator canary used by the load matrix, while production tolerates writes
|
|
42
|
+
* from an OpenCode process that is already using the live operator store.
|
|
42
43
|
*/
|
|
43
44
|
export declare function probeOpenCodeV1Version(executable: string, options?: V1VersionProbeOptions): string | null;
|
|
44
45
|
export declare function detectOpenCodeHostGeneration(dependencies?: HostGenerationDependencies): OpenCodeHostDetection;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host-generation.d.ts","sourceRoot":"","sources":["../../src/setup/host-generation.ts"],"names":[],"mappings":"AAuBA,MAAM,MAAM,sBAAsB,GAAG,IAAI,GAAG,IAAI,CAAC;AACjD,MAAM,MAAM,mBAAmB,GAAG,KAAK,GAAG,MAAM,CAAC;AAEjD,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,sBAAsB,CAAC;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,mBAAmB,CAAC;IAC7B,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,sBAAsB,GAAG,WAAW,GAAG,SAAS,CAAC;IACzD,WAAW,EAAE,sBAAsB,EAAE,CAAC;IACtC,QAAQ,EAAE,oBAAoB,EAAE,CAAC;CAClC;AAOD,MAAM,WAAW,0BAA0B;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC;IAC3B,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,GAAG,WAAW,KAAK,MAAM,GAAG,IAAI,CAAC;IACnE,cAAc,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;CACxD;AAED,UAAU,WAAW;IACnB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAChC,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED,MAAM,WAAW,qBAAqB;IACpC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IAC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+1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortexkit/aft",
|
|
3
|
-
"version": "0.56.
|
|
3
|
+
"version": "0.56.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Unified CLI for Agent File Tools (AFT) — setup, one-shot index snapshots, doctor, and diagnostics across supported agent harnesses (OpenCode, Pi)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@clack/prompts": "^1.6.0",
|
|
27
|
-
"@cortexkit/aft-bridge": "0.56.
|
|
27
|
+
"@cortexkit/aft-bridge": "0.56.2",
|
|
28
28
|
"comment-json": "^4.6.2"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|