@cortexkit/aft-opencode 0.51.1 → 0.51.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/config.d.ts +6 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/index.js +76 -20
- package/dist/tools/inspect.d.ts +1 -0
- package/dist/tools/inspect.d.ts.map +1 -1
- package/package.json +8 -8
package/dist/config.d.ts
CHANGED
|
@@ -7,6 +7,9 @@ export declare const ConfigureWarningsDeliveryEnum: z.ZodEnum<{
|
|
|
7
7
|
chat: "chat";
|
|
8
8
|
}>;
|
|
9
9
|
export type ConfigureWarningsDelivery = z.infer<typeof ConfigureWarningsDeliveryEnum>;
|
|
10
|
+
export declare const DEFAULT_INSPECT_DIAGNOSTICS_TIMEOUT_MS = 120000;
|
|
11
|
+
export declare const MIN_INSPECT_DIAGNOSTICS_TIMEOUT_MS = 10000;
|
|
12
|
+
export declare const MAX_INSPECT_DIAGNOSTICS_TIMEOUT_MS = 600000;
|
|
10
13
|
export declare const AftConfigSchema: z.ZodPreprocess<z.ZodObject<{
|
|
11
14
|
$schema: z.ZodOptional<z.ZodString>;
|
|
12
15
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -62,6 +65,7 @@ export declare const AftConfigSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
62
65
|
callgraph_chunk_size: z.ZodOptional<z.ZodNumber>;
|
|
63
66
|
inspect: z.ZodOptional<z.ZodObject<{
|
|
64
67
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
68
|
+
diagnostics_timeout_ms: z.ZodPipe<z.ZodOptional<z.ZodNumber>, z.ZodTransform<number | undefined, number | undefined>>;
|
|
65
69
|
tier2_idle_minutes: z.ZodOptional<z.ZodNumber>;
|
|
66
70
|
categories: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
|
|
67
71
|
tier2_soft_deadline_ms: z.ZodOptional<z.ZodNumber>;
|
|
@@ -150,6 +154,8 @@ export declare const AftConfigSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
150
154
|
}, z.core.$strip>>;
|
|
151
155
|
}, z.core.$strict>>;
|
|
152
156
|
export type AftConfig = z.infer<typeof AftConfigSchema>;
|
|
157
|
+
/** Resolve the blocking diagnostics deadline for tools that wait on `aft_inspect`. */
|
|
158
|
+
export declare function resolveInspectDiagnosticsTimeoutMs(config: AftConfig): number;
|
|
153
159
|
export interface ConfigureLspServer {
|
|
154
160
|
id: string;
|
|
155
161
|
/** Omitted when overriding a built-in server to inherit its extensions. */
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,4BAA4B,EACjC,KAAK,UAAU,EAQhB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiCxB,oGAAoG;AACpG,eAAO,MAAM,6BAA6B;;;;EAAmC,CAAC;AAC9E,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,4BAA4B,EACjC,KAAK,UAAU,EAQhB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiCxB,oGAAoG;AACpG,eAAO,MAAM,6BAA6B;;;;EAAmC,CAAC;AAC9E,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAkMtF,eAAO,MAAM,sCAAsC,SAAU,CAAC;AAC9D,eAAO,MAAM,kCAAkC,QAAS,CAAC;AACzD,eAAO,MAAM,kCAAkC,SAAU,CAAC;AAsD1D,eAAO,MAAM,eAAe;;;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 -8532,6 +8532,13 @@ class BridgeTransportUnavailableError extends Error {
|
|
|
8532
8532
|
this.name = "BridgeTransportUnavailableError";
|
|
8533
8533
|
}
|
|
8534
8534
|
}
|
|
8535
|
+
|
|
8536
|
+
class BridgeTransportUnknownOutcomeError extends BridgeTransportUnavailableError {
|
|
8537
|
+
constructor(message, options) {
|
|
8538
|
+
super(message, options);
|
|
8539
|
+
this.name = "BridgeTransportUnknownOutcomeError";
|
|
8540
|
+
}
|
|
8541
|
+
}
|
|
8535
8542
|
function isBridgeTransportTimeout(err) {
|
|
8536
8543
|
return err instanceof Error && err.code === "transport_timeout";
|
|
8537
8544
|
}
|
|
@@ -8685,7 +8692,7 @@ class BinaryBridge {
|
|
|
8685
8692
|
this.clearRestartResetTimer();
|
|
8686
8693
|
this.configured = false;
|
|
8687
8694
|
this.outstandingBackgroundTaskIds.clear();
|
|
8688
|
-
this.rejectAllPending(error2);
|
|
8695
|
+
this.rejectAllPending(error2 instanceof BridgeTransportUnknownOutcomeError ? error2 : new BridgeTransportUnknownOutcomeError(error2.message, { cause: error2 }));
|
|
8689
8696
|
}
|
|
8690
8697
|
hasPendingRequests() {
|
|
8691
8698
|
return this.pending.size > 0;
|
|
@@ -8808,6 +8815,12 @@ class BinaryBridge {
|
|
|
8808
8815
|
if (!this.configured) {
|
|
8809
8816
|
if (command !== "configure" && command !== "version") {
|
|
8810
8817
|
if (!this._configurePromise) {
|
|
8818
|
+
const configuringChild = this.process;
|
|
8819
|
+
const requireConfiguringChild = () => {
|
|
8820
|
+
if (this.process !== configuringChild) {
|
|
8821
|
+
throw new BridgeTransportUnavailableError(`${this.errorPrefix} Bridge process changed during configure; retry on replacement`);
|
|
8822
|
+
}
|
|
8823
|
+
};
|
|
8811
8824
|
const sessionIdForConfigure = typeof params.session_id === "string" ? params.session_id : undefined;
|
|
8812
8825
|
this._configurePromise = (async () => {
|
|
8813
8826
|
try {
|
|
@@ -8816,11 +8829,14 @@ class BinaryBridge {
|
|
|
8816
8829
|
...this.configOverrides,
|
|
8817
8830
|
...sessionIdForConfigure ? { session_id: sessionIdForConfigure } : {}
|
|
8818
8831
|
}, implicitTransportOptions);
|
|
8832
|
+
requireConfiguringChild();
|
|
8819
8833
|
if (configResult.success === false) {
|
|
8820
8834
|
throw new Error(`${this.errorPrefix} Configure failed: ${configResult.message ?? "unknown error"}`);
|
|
8821
8835
|
}
|
|
8822
8836
|
await this.deliverConfigureWarnings(configResult, params, options);
|
|
8837
|
+
requireConfiguringChild();
|
|
8823
8838
|
await this.checkVersion(implicitTransportOptions);
|
|
8839
|
+
requireConfiguringChild();
|
|
8824
8840
|
if (!this.isAlive()) {
|
|
8825
8841
|
throw new BridgeTransportUnavailableError(`${this.errorPrefix} Bridge died during version check. Check logs: ${this.getLogFilePathVia()}`);
|
|
8826
8842
|
}
|
|
@@ -8899,19 +8915,26 @@ class BinaryBridge {
|
|
|
8899
8915
|
return;
|
|
8900
8916
|
}
|
|
8901
8917
|
requestSentAt = Date.now();
|
|
8902
|
-
|
|
8903
|
-
|
|
8904
|
-
|
|
8905
|
-
|
|
8906
|
-
|
|
8907
|
-
|
|
8908
|
-
|
|
8909
|
-
|
|
8910
|
-
}
|
|
8911
|
-
if (this.process === child)
|
|
8912
|
-
this.invalidateTransportProcess(error2);
|
|
8918
|
+
const handleWriteFailure = (cause) => {
|
|
8919
|
+
const writeError = cause instanceof Error ? cause : new Error(String(cause));
|
|
8920
|
+
const error2 = new BridgeTransportUnknownOutcomeError(`${this.errorPrefix} Failed to write to stdin: ${writeError.message}`, { cause: writeError });
|
|
8921
|
+
const entry = this.pending.get(id);
|
|
8922
|
+
if (entry) {
|
|
8923
|
+
this.pending.delete(id);
|
|
8924
|
+
clearTimeout(entry.timer);
|
|
8925
|
+
entry.reject(error2);
|
|
8913
8926
|
}
|
|
8914
|
-
|
|
8927
|
+
if (this.process === child)
|
|
8928
|
+
this.invalidateTransportProcess(error2);
|
|
8929
|
+
};
|
|
8930
|
+
try {
|
|
8931
|
+
child.stdin.write(line, (err) => {
|
|
8932
|
+
if (err)
|
|
8933
|
+
handleWriteFailure(err);
|
|
8934
|
+
});
|
|
8935
|
+
} catch (err) {
|
|
8936
|
+
handleWriteFailure(err);
|
|
8937
|
+
}
|
|
8915
8938
|
});
|
|
8916
8939
|
if (command === "configure" && response.success === true && options?.markConfiguredOnSuccess !== false) {
|
|
8917
8940
|
this.configured = true;
|
|
@@ -9126,9 +9149,13 @@ class BinaryBridge {
|
|
|
9126
9149
|
const currentChild = child;
|
|
9127
9150
|
const stdoutDecoder = new StringDecoder("utf8");
|
|
9128
9151
|
child.stdout?.on("data", (chunk) => {
|
|
9152
|
+
if (this.process !== currentChild)
|
|
9153
|
+
return;
|
|
9129
9154
|
this.onStdoutData(stdoutDecoder.write(chunk));
|
|
9130
9155
|
});
|
|
9131
9156
|
child.stdout?.on("end", () => {
|
|
9157
|
+
if (this.process !== currentChild)
|
|
9158
|
+
return;
|
|
9132
9159
|
const remaining = stdoutDecoder.end();
|
|
9133
9160
|
if (remaining)
|
|
9134
9161
|
this.onStdoutData(remaining);
|
|
@@ -9136,9 +9163,13 @@ class BinaryBridge {
|
|
|
9136
9163
|
});
|
|
9137
9164
|
const stderrDecoder = new StringDecoder("utf8");
|
|
9138
9165
|
child.stderr?.on("data", (chunk) => {
|
|
9166
|
+
if (this.process !== currentChild)
|
|
9167
|
+
return;
|
|
9139
9168
|
this.onStderrData(stderrDecoder.write(chunk));
|
|
9140
9169
|
});
|
|
9141
9170
|
child.stderr?.on("end", () => {
|
|
9171
|
+
if (this.process !== currentChild)
|
|
9172
|
+
return;
|
|
9142
9173
|
const remaining = stderrDecoder.end();
|
|
9143
9174
|
if (remaining)
|
|
9144
9175
|
this.onStderrData(remaining);
|
|
@@ -9161,7 +9192,7 @@ class BinaryBridge {
|
|
|
9161
9192
|
this.process = null;
|
|
9162
9193
|
this.configured = false;
|
|
9163
9194
|
this.clearRestartResetTimer();
|
|
9164
|
-
this.rejectAllPending(new
|
|
9195
|
+
this.rejectAllPending(new BridgeTransportUnknownOutcomeError(`${this.errorPrefix} Binary killed by ${signal}`));
|
|
9165
9196
|
return;
|
|
9166
9197
|
}
|
|
9167
9198
|
this.handleCrash();
|
|
@@ -9339,7 +9370,7 @@ class BinaryBridge {
|
|
|
9339
9370
|
handleTimeout(triggeringSessionId) {
|
|
9340
9371
|
this.consecutiveRequestTimeouts = 0;
|
|
9341
9372
|
this.spawnedBinaryFingerprint = null;
|
|
9342
|
-
this.rejectAllPending(new
|
|
9373
|
+
this.rejectAllPending(new BridgeTransportUnknownOutcomeError(`${this.errorPrefix} bridge killed during sibling timeout — request aborted`));
|
|
9343
9374
|
this.outstandingBackgroundTaskIds.clear();
|
|
9344
9375
|
if (this.process) {
|
|
9345
9376
|
this.process.kill("SIGKILL");
|
|
@@ -9376,7 +9407,7 @@ class BinaryBridge {
|
|
|
9376
9407
|
if (tail) {
|
|
9377
9408
|
this.errorVia(`Binary crashed (restarts: ${this._restartCount})${cause ? `: ${cause.message}` : ""}.${tail}`);
|
|
9378
9409
|
}
|
|
9379
|
-
this.rejectAllPending(new
|
|
9410
|
+
this.rejectAllPending(new BridgeTransportUnknownOutcomeError(`${this.errorPrefix} Binary crashed (restarts: ${this._restartCount})${cause ? `: ${cause.message}` : ""} (see ${this.getLogFilePathVia()})`, { cause }));
|
|
9380
9411
|
if (this._retiringDueToBinaryChange) {
|
|
9381
9412
|
this.logVia("Binary exited while retiring after an on-disk update; skipping auto-restart");
|
|
9382
9413
|
return;
|
|
@@ -13969,6 +14000,7 @@ function toolErrorFromResponse(command, response) {
|
|
|
13969
14000
|
}
|
|
13970
14001
|
var BASH_TRANSPORT_DISPOSITION = "The transport to the AFT daemon was interrupted; no background task was created for this command and no task ID exists. Re-run the command. Do not poll bash_status for it.";
|
|
13971
14002
|
var SUBC_MODULE_RESTART_DISPOSITION = "The AFT daemon module restarted while this call was in flight, so its outcome is UNKNOWN: it may or may not have executed. Verify actual state before re-running, and never blind-retry a mutation.";
|
|
14003
|
+
var BRIDGE_TRANSPORT_UNKNOWN_OUTCOME_DISPOSITION = "The standalone AFT transport failed after this call may have been sent, so its outcome is UNKNOWN: it may or may not have executed. Verify actual state before re-running, and never blind-retry a mutation.";
|
|
13972
14004
|
function isRouteGoodbyeError(error2) {
|
|
13973
14005
|
if (!(error2 instanceof SubcError))
|
|
13974
14006
|
return false;
|
|
@@ -13991,6 +14023,8 @@ function isBashTransportDeadError(error2) {
|
|
|
13991
14023
|
if (!(error2 instanceof Error) || hasEngineResponse(error2) || isRouteGoodbyeError(error2)) {
|
|
13992
14024
|
return false;
|
|
13993
14025
|
}
|
|
14026
|
+
if (error2 instanceof BridgeTransportUnknownOutcomeError)
|
|
14027
|
+
return false;
|
|
13994
14028
|
return error2 instanceof BridgeTransportUnavailableError || error2 instanceof SubcTransportShuttingDownError || isConsumerReconnectTransient(error2) || error2 instanceof StaleRouteHandleError || error2 instanceof SubcRootGenerationExpiredError || error2 instanceof SubcRootReapedError;
|
|
13995
14029
|
}
|
|
13996
14030
|
function isTransportClassError(error2) {
|
|
@@ -13999,6 +14033,12 @@ function isTransportClassError(error2) {
|
|
|
13999
14033
|
function adaptToolError(command, error2) {
|
|
14000
14034
|
if (!(error2 instanceof Error))
|
|
14001
14035
|
return error2;
|
|
14036
|
+
if (error2 instanceof BridgeTransportUnknownOutcomeError) {
|
|
14037
|
+
if (error2.message.includes(BRIDGE_TRANSPORT_UNKNOWN_OUTCOME_DISPOSITION))
|
|
14038
|
+
return error2;
|
|
14039
|
+
error2.message = error2.message ? `${error2.message} ${BRIDGE_TRANSPORT_UNKNOWN_OUTCOME_DISPOSITION}` : BRIDGE_TRANSPORT_UNKNOWN_OUTCOME_DISPOSITION;
|
|
14040
|
+
return error2;
|
|
14041
|
+
}
|
|
14002
14042
|
if (isRouteGoodbyeError(error2)) {
|
|
14003
14043
|
if (error2.message.includes(SUBC_MODULE_RESTART_DISPOSITION))
|
|
14004
14044
|
return error2;
|
|
@@ -32343,8 +32383,15 @@ var SubcConfigSchema = exports_external.object({
|
|
|
32343
32383
|
connection_file: exports_external.string().optional(),
|
|
32344
32384
|
client_reaper: exports_external.boolean().optional()
|
|
32345
32385
|
});
|
|
32386
|
+
var DEFAULT_INSPECT_DIAGNOSTICS_TIMEOUT_MS = 120000;
|
|
32387
|
+
var MIN_INSPECT_DIAGNOSTICS_TIMEOUT_MS = 1e4;
|
|
32388
|
+
var MAX_INSPECT_DIAGNOSTICS_TIMEOUT_MS = 600000;
|
|
32389
|
+
function clampInspectDiagnosticsTimeoutMs(value) {
|
|
32390
|
+
return Math.min(MAX_INSPECT_DIAGNOSTICS_TIMEOUT_MS, Math.max(MIN_INSPECT_DIAGNOSTICS_TIMEOUT_MS, value));
|
|
32391
|
+
}
|
|
32346
32392
|
var InspectConfigSchema = exports_external.object({
|
|
32347
32393
|
enabled: exports_external.boolean().optional(),
|
|
32394
|
+
diagnostics_timeout_ms: exports_external.number().int().positive().optional().transform((value) => value === undefined ? undefined : clampInspectDiagnosticsTimeoutMs(value)),
|
|
32348
32395
|
tier2_idle_minutes: exports_external.number().min(0).optional(),
|
|
32349
32396
|
categories: exports_external.record(exports_external.string(), exports_external.boolean()).optional(),
|
|
32350
32397
|
tier2_soft_deadline_ms: exports_external.number().int().positive().optional(),
|
|
@@ -32392,6 +32439,9 @@ var AftConfigSchema = exports_external.preprocess((value) => stripHarnessSpecifi
|
|
|
32392
32439
|
bridge: BridgeConfigSchema.optional(),
|
|
32393
32440
|
subc: SubcConfigSchema.optional()
|
|
32394
32441
|
}).strict());
|
|
32442
|
+
function resolveInspectDiagnosticsTimeoutMs(config2) {
|
|
32443
|
+
return clampInspectDiagnosticsTimeoutMs(config2.inspect?.diagnostics_timeout_ms ?? DEFAULT_INSPECT_DIAGNOSTICS_TIMEOUT_MS);
|
|
32444
|
+
}
|
|
32395
32445
|
var FOREGROUND_WAIT_WINDOW_DEFAULT_MS = 15000;
|
|
32396
32446
|
var FOREGROUND_WAIT_WINDOW_MIN_MS = 5000;
|
|
32397
32447
|
function resolveBashConfig(config2) {
|
|
@@ -32719,9 +32769,12 @@ function mergeWorktreeConfig(baseWorktree, overrideWorktree) {
|
|
|
32719
32769
|
return { ...baseWorktree, ...overrideWorktree };
|
|
32720
32770
|
}
|
|
32721
32771
|
function mergeInspectConfig(baseInspect, overrideInspect) {
|
|
32772
|
+
const diagnosticsTimeoutConfigured = baseInspect?.diagnostics_timeout_ms !== undefined || overrideInspect?.diagnostics_timeout_ms !== undefined;
|
|
32773
|
+
const diagnosticsTimeoutMs = Math.max(clampInspectDiagnosticsTimeoutMs(baseInspect?.diagnostics_timeout_ms ?? DEFAULT_INSPECT_DIAGNOSTICS_TIMEOUT_MS), clampInspectDiagnosticsTimeoutMs(overrideInspect?.diagnostics_timeout_ms ?? DEFAULT_INSPECT_DIAGNOSTICS_TIMEOUT_MS));
|
|
32722
32774
|
const inspect = {
|
|
32723
32775
|
...baseInspect,
|
|
32724
32776
|
...overrideInspect,
|
|
32777
|
+
...diagnosticsTimeoutConfigured ? { diagnostics_timeout_ms: diagnosticsTimeoutMs } : {},
|
|
32725
32778
|
duplicates: baseInspect?.duplicates || overrideInspect?.duplicates ? {
|
|
32726
32779
|
...baseInspect?.duplicates,
|
|
32727
32780
|
...overrideInspect?.duplicates
|
|
@@ -38997,6 +39050,7 @@ function importTools(ctx) {
|
|
|
38997
39050
|
// src/tools/inspect.ts
|
|
38998
39051
|
import { tool as tool10 } from "@opencode-ai/plugin";
|
|
38999
39052
|
var z10 = tool10.schema;
|
|
39053
|
+
var INSPECT_TRANSPORT_HEADROOM_MS = 30000;
|
|
39000
39054
|
function arg(schema) {
|
|
39001
39055
|
return schema;
|
|
39002
39056
|
}
|
|
@@ -39175,12 +39229,12 @@ function createInspectTier2IdleScheduler(options) {
|
|
|
39175
39229
|
}
|
|
39176
39230
|
function inspectTools(ctx) {
|
|
39177
39231
|
const inspectTool = {
|
|
39178
|
-
description: "Blocking-fresh codebase health inspection. Each call completes current analysis and produces exactly one terminal result: FRESH includes a wait-stamp and completed phases; INTERRUPTED and PHASE-FAILED retain completed phases, with PHASE-FAILED also reporting its phase attribution and failure reason. `sections` selects drill-down detail, not the categories verified.\n\n" + "Use `scope=` to narrow returned results.
|
|
39232
|
+
description: "Blocking-fresh codebase health inspection. Each call completes current analysis and produces exactly one terminal result: FRESH includes a wait-stamp and completed phases; INTERRUPTED and PHASE-FAILED retain completed phases, with PHASE-FAILED also reporting its phase attribution and failure reason. `sections` selects drill-down detail, not the categories verified.\n\n" + "Use `scope=` to narrow returned results. Scope filters rendered diagnostics; it does not change collection work. Scoped files no producer has authoritatively analyzed are reported as named gaps (complete: false). Passive health changes use the alert channel; do not infer inspect completion from that channel.\n\n" + `Use when: starting work on unfamiliar code, after multi-edit batches to check diagnostics, before a refactor, before review, or to verify cleanup completeness.
|
|
39179
39233
|
|
|
39180
39234
|
` + "Treat `dead_code` as a hint, not proof: reachability is call-based, so symbols reached only via method dispatch or referenced only in type position may be false positives — verify before deleting.",
|
|
39181
39235
|
args: {
|
|
39182
39236
|
sections: arg(z10.union([z10.string(), z10.array(z10.string())]).optional().describe("Categories to include in detailed drill-down (e.g. 'todos' or ['todos', 'dead_code', 'cycles']). Use 'all' for every active category. Omit for summary-only mode. `sections` changes detail, not the categories verified.")),
|
|
39183
|
-
scope: arg(z10.union([z10.string(), z10.array(z10.string())]).optional().describe("Restrict returned results to paths under this scope (file or directory, absolute or relative to project root). `scope=` narrows results; it does not
|
|
39237
|
+
scope: arg(z10.union([z10.string(), z10.array(z10.string())]).optional().describe("Restrict returned results to paths under this scope (file or directory, absolute or relative to project root). `scope=` narrows results; it does not change the diagnostic collection work. Scoped files no producer has authoritatively analyzed are reported as named gaps (complete: false), never as a clean empty result.")),
|
|
39184
39238
|
topK: arg(z10.number().int().positive().max(100).optional().describe("Max drill-down items per category. Default 20, max 100."))
|
|
39185
39239
|
},
|
|
39186
39240
|
execute: async (args, context) => {
|
|
@@ -39195,7 +39249,9 @@ function inspectTools(ctx) {
|
|
|
39195
39249
|
rawArgs.scope = scoped.scope;
|
|
39196
39250
|
if (args.topK !== undefined && args.topK !== null)
|
|
39197
39251
|
rawArgs.topK = args.topK;
|
|
39198
|
-
const response = await callToolCall(ctx, context, "inspect", rawArgs
|
|
39252
|
+
const response = await callToolCall(ctx, context, "inspect", rawArgs, {
|
|
39253
|
+
transportTimeoutMs: resolveInspectDiagnosticsTimeoutMs(ctx.config) + INSPECT_TRANSPORT_HEADROOM_MS
|
|
39254
|
+
});
|
|
39199
39255
|
const terminal = parseInspectTerminal(response);
|
|
39200
39256
|
if (terminal)
|
|
39201
39257
|
return renderInspectTerminal(terminal, response.text);
|
|
@@ -40206,7 +40262,7 @@ var PLUGIN_VERSION = (() => {
|
|
|
40206
40262
|
return "0.0.0";
|
|
40207
40263
|
}
|
|
40208
40264
|
})();
|
|
40209
|
-
var ANNOUNCEMENT_VERSION = "0.51.
|
|
40265
|
+
var ANNOUNCEMENT_VERSION = "0.51.3";
|
|
40210
40266
|
var ANNOUNCEMENT_FEATURES = [
|
|
40211
40267
|
"Callgraph stays consistent under load: edits arriving mid-rebuild can no longer be silently lost from navigation results.",
|
|
40212
40268
|
"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/dist/tools/inspect.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../../src/tools/inspect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../../src/tools/inspect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAG1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAWjD,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,aAAa,GAAG,cAAc,CAAC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CAAgC;IAC/C,SAAS,EAAE,MAAM,OAAO,CAAC;IACzB,WAAW,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;IACtC,GAAG,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,WAAW,CAAC;IAClE,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;CAC3C;AAED,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,gCAAgC;0BAiB1D,MAAM,KAAG,IAAI;uBAZhB,MAAM,KAAG,IAAI;oBAOlB,IAAI;EAsB1B;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAuD/E"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortexkit/aft-opencode",
|
|
3
|
-
"version": "0.51.
|
|
3
|
+
"version": "0.51.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",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@clack/prompts": "^1.6.0",
|
|
37
|
-
"@cortexkit/aft-bridge": "0.51.
|
|
37
|
+
"@cortexkit/aft-bridge": "0.51.3",
|
|
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.
|
|
47
|
-
"@cortexkit/aft-darwin-x64": "0.51.
|
|
48
|
-
"@cortexkit/aft-linux-arm64": "0.51.
|
|
49
|
-
"@cortexkit/aft-linux-x64": "0.51.
|
|
50
|
-
"@cortexkit/aft-win32-arm64": "0.51.
|
|
51
|
-
"@cortexkit/aft-win32-x64": "0.51.
|
|
46
|
+
"@cortexkit/aft-darwin-arm64": "0.51.3",
|
|
47
|
+
"@cortexkit/aft-darwin-x64": "0.51.3",
|
|
48
|
+
"@cortexkit/aft-linux-arm64": "0.51.3",
|
|
49
|
+
"@cortexkit/aft-linux-x64": "0.51.3",
|
|
50
|
+
"@cortexkit/aft-win32-arm64": "0.51.3",
|
|
51
|
+
"@cortexkit/aft-win32-x64": "0.51.3"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@opencode-ai/plugin": "^1.17.11",
|