@cortexkit/aft-pi 0.34.0 → 0.35.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config.d.ts +8 -6
- package/dist/config.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +238 -34
- package/dist/status-bar-inject.d.ts +12 -0
- package/dist/status-bar-inject.d.ts.map +1 -0
- package/dist/tools/bash.d.ts.map +1 -1
- package/dist/tools/inspect.d.ts.map +1 -1
- package/dist/workflow-hints.d.ts.map +1 -1
- package/package.json +8 -8
package/dist/config.d.ts
CHANGED
|
@@ -15,8 +15,10 @@ export interface SemanticConfig {
|
|
|
15
15
|
}
|
|
16
16
|
export interface LspServerConfig {
|
|
17
17
|
id: string;
|
|
18
|
-
extensions
|
|
19
|
-
|
|
18
|
+
/** Omitted when overriding a built-in server to inherit its extensions. */
|
|
19
|
+
extensions?: string[];
|
|
20
|
+
/** Omitted when overriding a built-in server to inherit its binary. */
|
|
21
|
+
binary?: string;
|
|
20
22
|
args: string[];
|
|
21
23
|
root_markers: string[];
|
|
22
24
|
disabled: boolean;
|
|
@@ -184,8 +186,8 @@ export declare const FOREGROUND_WAIT_WINDOW_MIN_MS = 5000;
|
|
|
184
186
|
*/
|
|
185
187
|
export declare function resolveBashConfig(config: AftConfig): ResolvedBashConfig;
|
|
186
188
|
export declare const LspServerSchema: z.ZodObject<{
|
|
187
|
-
extensions: z.ZodArray<z.ZodString
|
|
188
|
-
binary: z.ZodString
|
|
189
|
+
extensions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
190
|
+
binary: z.ZodOptional<z.ZodString>;
|
|
189
191
|
args: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
190
192
|
root_markers: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
191
193
|
disabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
@@ -276,8 +278,8 @@ export declare const AftConfigSchema: z.ZodObject<{
|
|
|
276
278
|
}, z.core.$strip>>;
|
|
277
279
|
lsp: z.ZodOptional<z.ZodObject<{
|
|
278
280
|
servers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
279
|
-
extensions: z.ZodArray<z.ZodString
|
|
280
|
-
binary: z.ZodString
|
|
281
|
+
extensions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
282
|
+
binary: z.ZodOptional<z.ZodString>;
|
|
281
283
|
args: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
282
284
|
root_markers: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
283
285
|
disabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,MAAM,MAAM,SAAS,GACjB,OAAO,GACP,OAAO,GACP,UAAU,GACV,MAAM,GACN,MAAM,GACN,OAAO,GACP,SAAS,GACT,WAAW,GACX,OAAO,GACP,MAAM,CAAC;AAEX,MAAM,MAAM,OAAO,GACf,KAAK,GACL,MAAM,GACN,OAAO,GACP,SAAS,GACT,MAAM,GACN,OAAO,GACP,IAAI,GACJ,aAAa,GACb,MAAM,CAAC;AAEX,gFAAgF;AAChF,MAAM,MAAM,yBAAyB,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;AAEjE,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,mBAAmB,GAAG,QAAQ,CAAC;AAE3E,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CA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AQ,EAAE,OAAO,EAAE,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,IAAI,CAAC,CAiChB;AAED;;;;;;;;GAQG;AACH,iBAAS,kBAAkB,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,aAAa,CAAC,GAAG;IACrE,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAwEA;AAED;;;;GAIG;AACH,yBAA+B,EAAE,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA4c9D;AAED,eAAO,MAAM,QAAQ;;;;;;CAMpB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -11674,11 +11674,76 @@ function error(message, meta) {
|
|
|
11674
11674
|
console.error(`[aft-bridge] ERROR: ${message}`);
|
|
11675
11675
|
}
|
|
11676
11676
|
}
|
|
11677
|
+
// ../aft-bridge/dist/bash-hints.js
|
|
11678
|
+
var CONFLICT_HINT = `
|
|
11679
|
+
|
|
11680
|
+
[Hint] Use aft_conflicts to see all conflict regions across files in a single call.`;
|
|
11681
|
+
var GREP_HINT = `
|
|
11682
|
+
|
|
11683
|
+
[Hint] Use the grep tool instead of bash for faster indexed search.`;
|
|
11684
|
+
function maybeAppendConflictsHint(output) {
|
|
11685
|
+
if (!output.includes("Automatic merge failed; fix conflicts"))
|
|
11686
|
+
return output;
|
|
11687
|
+
if (!/^CONFLICT \(|^error: could not apply /m.test(output))
|
|
11688
|
+
return output;
|
|
11689
|
+
return output + CONFLICT_HINT;
|
|
11690
|
+
}
|
|
11691
|
+
function maybeAppendGrepHint(output, command) {
|
|
11692
|
+
const probe = command !== undefined ? command : output.slice(0, 300).split(`
|
|
11693
|
+
`)[0] ?? "";
|
|
11694
|
+
if (!/\b(rg|grep)\s/.test(probe))
|
|
11695
|
+
return output;
|
|
11696
|
+
return output + GREP_HINT;
|
|
11697
|
+
}
|
|
11677
11698
|
// ../aft-bridge/dist/bridge.js
|
|
11678
11699
|
import { spawn } from "node:child_process";
|
|
11679
11700
|
import { homedir } from "node:os";
|
|
11680
11701
|
import { join } from "node:path";
|
|
11681
11702
|
import { StringDecoder } from "node:string_decoder";
|
|
11703
|
+
|
|
11704
|
+
// ../aft-bridge/dist/status-bar.js
|
|
11705
|
+
var STATUS_BAR_HEARTBEAT_CALLS = 15;
|
|
11706
|
+
function createStatusBarEmitState() {
|
|
11707
|
+
return { callsSinceEmit: 0 };
|
|
11708
|
+
}
|
|
11709
|
+
function parseStatusBarCounts(value) {
|
|
11710
|
+
if (!value || typeof value !== "object")
|
|
11711
|
+
return;
|
|
11712
|
+
const record = value;
|
|
11713
|
+
const num = (key) => {
|
|
11714
|
+
const raw = record[key];
|
|
11715
|
+
return typeof raw === "number" && Number.isFinite(raw) ? raw : 0;
|
|
11716
|
+
};
|
|
11717
|
+
return {
|
|
11718
|
+
errors: num("errors"),
|
|
11719
|
+
warnings: num("warnings"),
|
|
11720
|
+
dead_code: num("dead_code"),
|
|
11721
|
+
unused_exports: num("unused_exports"),
|
|
11722
|
+
duplicates: num("duplicates"),
|
|
11723
|
+
todos: num("todos"),
|
|
11724
|
+
tier2_stale: record.tier2_stale === true
|
|
11725
|
+
};
|
|
11726
|
+
}
|
|
11727
|
+
function countsEqual(a, b) {
|
|
11728
|
+
return a.errors === b.errors && a.warnings === b.warnings && a.dead_code === b.dead_code && a.unused_exports === b.unused_exports && a.duplicates === b.duplicates && a.todos === b.todos && a.tier2_stale === b.tier2_stale;
|
|
11729
|
+
}
|
|
11730
|
+
function shouldEmitStatusBar(state, next) {
|
|
11731
|
+
const changed = state.last === undefined || !countsEqual(state.last, next);
|
|
11732
|
+
state.callsSinceEmit += 1;
|
|
11733
|
+
const heartbeat = state.callsSinceEmit >= STATUS_BAR_HEARTBEAT_CALLS;
|
|
11734
|
+
if (changed || heartbeat) {
|
|
11735
|
+
state.last = next;
|
|
11736
|
+
state.callsSinceEmit = 0;
|
|
11737
|
+
return true;
|
|
11738
|
+
}
|
|
11739
|
+
return false;
|
|
11740
|
+
}
|
|
11741
|
+
function formatStatusBar(counts) {
|
|
11742
|
+
const staleMark = counts.tier2_stale ? "~" : "";
|
|
11743
|
+
return `[AFT E${counts.errors} W${counts.warnings} | ` + `${staleMark}D${counts.dead_code} U${counts.unused_exports} C${counts.duplicates} | ` + `T${counts.todos}]`;
|
|
11744
|
+
}
|
|
11745
|
+
|
|
11746
|
+
// ../aft-bridge/dist/bridge.js
|
|
11682
11747
|
var DEFAULT_BRIDGE_TIMEOUT_MS = 30000;
|
|
11683
11748
|
var BRIDGE_HANG_TIMEOUT_THRESHOLD = 2;
|
|
11684
11749
|
var SEMANTIC_TIMEOUT_SAFETY_MARGIN_MS = 5000;
|
|
@@ -11789,6 +11854,7 @@ class BinaryBridge {
|
|
|
11789
11854
|
configureWarningClients = new Map;
|
|
11790
11855
|
restartResetTimer = null;
|
|
11791
11856
|
lastChildActivityAt = 0;
|
|
11857
|
+
lastStatusBar;
|
|
11792
11858
|
consecutiveRequestTimeouts = 0;
|
|
11793
11859
|
errorPrefix;
|
|
11794
11860
|
logger;
|
|
@@ -12166,6 +12232,7 @@ class BinaryBridge {
|
|
|
12166
12232
|
this.spawnProcess(triggeringSessionId);
|
|
12167
12233
|
}
|
|
12168
12234
|
spawnProcess(triggeringSessionId) {
|
|
12235
|
+
this.lastStatusBar = undefined;
|
|
12169
12236
|
if (triggeringSessionId) {
|
|
12170
12237
|
this.sessionLogVia(triggeringSessionId, `Spawning binary: ${this.binaryPath} (cwd: ${this.cwd})`);
|
|
12171
12238
|
} else {
|
|
@@ -12367,6 +12434,7 @@ class BinaryBridge {
|
|
|
12367
12434
|
clearTimeout(entry.timer);
|
|
12368
12435
|
this.consecutiveRequestTimeouts = 0;
|
|
12369
12436
|
this.scheduleRestartCountReset();
|
|
12437
|
+
this.captureStatusBar(response);
|
|
12370
12438
|
entry.resolve(response);
|
|
12371
12439
|
} else if (typeof response.type === "string") {
|
|
12372
12440
|
this.logVia(`Ignoring unknown stdout push frame type: ${response.type}`);
|
|
@@ -12376,6 +12444,14 @@ class BinaryBridge {
|
|
|
12376
12444
|
}
|
|
12377
12445
|
}
|
|
12378
12446
|
}
|
|
12447
|
+
captureStatusBar(response) {
|
|
12448
|
+
const parsed = parseStatusBarCounts(response.status_bar);
|
|
12449
|
+
if (parsed)
|
|
12450
|
+
this.lastStatusBar = parsed;
|
|
12451
|
+
}
|
|
12452
|
+
getStatusBar() {
|
|
12453
|
+
return this.lastStatusBar;
|
|
12454
|
+
}
|
|
12379
12455
|
handleTimeout(triggeringSessionId) {
|
|
12380
12456
|
this.consecutiveRequestTimeouts = 0;
|
|
12381
12457
|
this.rejectAllPending(new Error(`${this.errorPrefix} bridge killed during sibling timeout — request aborted`));
|
|
@@ -12747,6 +12823,20 @@ function compressionSavingsPercent(original, compressed) {
|
|
|
12747
12823
|
const saved = Math.max(0, original - compressed);
|
|
12748
12824
|
return Math.round(saved / original * 100);
|
|
12749
12825
|
}
|
|
12826
|
+
// ../aft-bridge/dist/jsonc.js
|
|
12827
|
+
function stripJsoncSymbols(value) {
|
|
12828
|
+
if (Array.isArray(value)) {
|
|
12829
|
+
return value.map((item) => stripJsoncSymbols(item));
|
|
12830
|
+
}
|
|
12831
|
+
if (value !== null && typeof value === "object") {
|
|
12832
|
+
const out = {};
|
|
12833
|
+
for (const [key, val] of Object.entries(value)) {
|
|
12834
|
+
out[key] = stripJsoncSymbols(val);
|
|
12835
|
+
}
|
|
12836
|
+
return out;
|
|
12837
|
+
}
|
|
12838
|
+
return value;
|
|
12839
|
+
}
|
|
12750
12840
|
// ../aft-bridge/dist/migration.js
|
|
12751
12841
|
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
12752
12842
|
import { existsSync as existsSync4, mkdirSync as mkdirSync4 } from "node:fs";
|
|
@@ -12805,7 +12895,7 @@ function markAnnouncementSeen(storageRoot, harness, currentVersion) {
|
|
|
12805
12895
|
|
|
12806
12896
|
// ../aft-bridge/dist/resolver.js
|
|
12807
12897
|
import { execSync } from "node:child_process";
|
|
12808
|
-
import { chmodSync as chmodSync2, copyFileSync as copyFileSync2, existsSync as existsSync3, mkdirSync as mkdirSync3, renameSync as renameSync3, unlinkSync as unlinkSync2 } from "node:fs";
|
|
12898
|
+
import { chmodSync as chmodSync2, closeSync as closeSync2, copyFileSync as copyFileSync2, existsSync as existsSync3, mkdirSync as mkdirSync3, openSync as openSync2, readSync, renameSync as renameSync3, unlinkSync as unlinkSync2 } from "node:fs";
|
|
12809
12899
|
import { createRequire as createRequire2 } from "node:module";
|
|
12810
12900
|
import { homedir as homedir3 } from "node:os";
|
|
12811
12901
|
import { join as join4 } from "node:path";
|
|
@@ -12886,6 +12976,37 @@ function probeBinaryCandidate(binaryPath, source, expectedVersion) {
|
|
|
12886
12976
|
function parsePathLookupOutput(output) {
|
|
12887
12977
|
return output.split(/\r?\n/).map((candidate) => candidate.trim()).filter(Boolean);
|
|
12888
12978
|
}
|
|
12979
|
+
function isNativeExecutable(binaryPath) {
|
|
12980
|
+
let fd = null;
|
|
12981
|
+
try {
|
|
12982
|
+
fd = openSync2(binaryPath, "r");
|
|
12983
|
+
const buf = Buffer.alloc(4);
|
|
12984
|
+
const read = readSync(fd, buf, 0, 4, 0);
|
|
12985
|
+
if (read < 2)
|
|
12986
|
+
return false;
|
|
12987
|
+
const b0 = buf[0];
|
|
12988
|
+
const b1 = buf[1];
|
|
12989
|
+
if (b0 === 35 && b1 === 33)
|
|
12990
|
+
return false;
|
|
12991
|
+
const m32 = buf.readUInt32BE(0);
|
|
12992
|
+
const machO = new Set([4277009102, 4277009103, 3472551422, 3489328638, 3405691582]);
|
|
12993
|
+
if (read >= 4 && machO.has(m32))
|
|
12994
|
+
return true;
|
|
12995
|
+
if (read >= 4 && m32 === 2135247942)
|
|
12996
|
+
return true;
|
|
12997
|
+
if (b0 === 77 && b1 === 90)
|
|
12998
|
+
return true;
|
|
12999
|
+
return false;
|
|
13000
|
+
} catch {
|
|
13001
|
+
return false;
|
|
13002
|
+
} finally {
|
|
13003
|
+
if (fd !== null) {
|
|
13004
|
+
try {
|
|
13005
|
+
closeSync2(fd);
|
|
13006
|
+
} catch {}
|
|
13007
|
+
}
|
|
13008
|
+
}
|
|
13009
|
+
}
|
|
12889
13010
|
function platformKey(platform = process.platform, arch = process.arch) {
|
|
12890
13011
|
const archMap = PLATFORM_ARCH_MAP[platform];
|
|
12891
13012
|
if (!archMap) {
|
|
@@ -12939,6 +13060,10 @@ function findBinarySync(expectedVersion) {
|
|
|
12939
13060
|
stdio: ["pipe", "pipe", "pipe"]
|
|
12940
13061
|
}).trim();
|
|
12941
13062
|
for (const candidate of parsePathLookupOutput(result)) {
|
|
13063
|
+
if (!isNativeExecutable(candidate)) {
|
|
13064
|
+
warn(`PATH binary at ${candidate} is not a native executable (script shim?); skipping`);
|
|
13065
|
+
continue;
|
|
13066
|
+
}
|
|
12942
13067
|
const usable = probeBinaryCandidate(candidate, "PATH", expectedVersion);
|
|
12943
13068
|
if (usable)
|
|
12944
13069
|
return usable;
|
|
@@ -13088,7 +13213,7 @@ async function ensureStorageMigrated(opts) {
|
|
|
13088
13213
|
// ../aft-bridge/dist/onnx-runtime.js
|
|
13089
13214
|
import { execFileSync } from "node:child_process";
|
|
13090
13215
|
import { createHash as createHash2 } from "node:crypto";
|
|
13091
|
-
import { chmodSync as chmodSync3, closeSync as
|
|
13216
|
+
import { chmodSync as chmodSync3, closeSync as closeSync3, copyFileSync as copyFileSync3, createWriteStream as createWriteStream2, existsSync as existsSync5, lstatSync, mkdirSync as mkdirSync5, openSync as openSync3, readdirSync, readFileSync as readFileSync3, readlinkSync, realpathSync, rmSync as rmSync2, statSync as statSync2, symlinkSync, unlinkSync as unlinkSync3, writeFileSync as writeFileSync2 } from "node:fs";
|
|
13092
13217
|
import { basename, dirname as dirname3, isAbsolute, join as join6, relative, resolve, win32 } from "node:path";
|
|
13093
13218
|
import { Readable as Readable2 } from "node:stream";
|
|
13094
13219
|
import { pipeline as pipeline2 } from "node:stream/promises";
|
|
@@ -13660,13 +13785,13 @@ function sha256File(path) {
|
|
|
13660
13785
|
function acquireLock(lockPath) {
|
|
13661
13786
|
const tryClaim = () => {
|
|
13662
13787
|
try {
|
|
13663
|
-
const fd =
|
|
13788
|
+
const fd = openSync3(lockPath, "wx");
|
|
13664
13789
|
try {
|
|
13665
13790
|
writeFileSync2(fd, `${process.pid}
|
|
13666
13791
|
${new Date().toISOString()}
|
|
13667
13792
|
`);
|
|
13668
13793
|
} finally {
|
|
13669
|
-
|
|
13794
|
+
closeSync3(fd);
|
|
13670
13795
|
}
|
|
13671
13796
|
return true;
|
|
13672
13797
|
} catch (err) {
|
|
@@ -13824,7 +13949,8 @@ class BridgePool {
|
|
|
13824
13949
|
onBashLongRunning: options.onBashLongRunning,
|
|
13825
13950
|
onBashPatternMatch: options.onBashPatternMatch,
|
|
13826
13951
|
errorPrefix: options.errorPrefix,
|
|
13827
|
-
logger: options.logger
|
|
13952
|
+
logger: options.logger,
|
|
13953
|
+
childEnv: options.childEnv
|
|
13828
13954
|
};
|
|
13829
13955
|
this.configOverrides = configOverrides;
|
|
13830
13956
|
if (Number.isFinite(this.idleTimeoutMs)) {
|
|
@@ -13957,6 +14083,9 @@ class BridgePool {
|
|
|
13957
14083
|
_testGetConfigOverrides() {
|
|
13958
14084
|
return { ...this.configOverrides };
|
|
13959
14085
|
}
|
|
14086
|
+
_testGetBridgeOptions() {
|
|
14087
|
+
return { ...this.bridgeOptions };
|
|
14088
|
+
}
|
|
13960
14089
|
}
|
|
13961
14090
|
function normalizeKey(projectRoot) {
|
|
13962
14091
|
const stripped = projectRoot.replace(/[/\\]+$/, "");
|
|
@@ -14694,7 +14823,7 @@ import {
|
|
|
14694
14823
|
// package.json
|
|
14695
14824
|
var package_default = {
|
|
14696
14825
|
name: "@cortexkit/aft-pi",
|
|
14697
|
-
version: "0.
|
|
14826
|
+
version: "0.35.1",
|
|
14698
14827
|
type: "module",
|
|
14699
14828
|
description: "Pi coding agent extension for Agent File Tools (AFT) — tree-sitter and LSP-powered code analysis",
|
|
14700
14829
|
main: "dist/index.js",
|
|
@@ -14717,7 +14846,7 @@ var package_default = {
|
|
|
14717
14846
|
"test:unit": "bun test src/__tests__ --path-ignore-patterns 'src/__tests__/e2e/**'"
|
|
14718
14847
|
},
|
|
14719
14848
|
dependencies: {
|
|
14720
|
-
"@cortexkit/aft-bridge": "0.
|
|
14849
|
+
"@cortexkit/aft-bridge": "0.35.1",
|
|
14721
14850
|
"@xterm/headless": "^5.5.0",
|
|
14722
14851
|
"comment-json": "^5.0.0",
|
|
14723
14852
|
diff: "^8.0.4",
|
|
@@ -14725,12 +14854,12 @@ var package_default = {
|
|
|
14725
14854
|
zod: "^4.1.8"
|
|
14726
14855
|
},
|
|
14727
14856
|
optionalDependencies: {
|
|
14728
|
-
"@cortexkit/aft-darwin-arm64": "0.
|
|
14729
|
-
"@cortexkit/aft-darwin-x64": "0.
|
|
14730
|
-
"@cortexkit/aft-linux-arm64": "0.
|
|
14731
|
-
"@cortexkit/aft-linux-x64": "0.
|
|
14732
|
-
"@cortexkit/aft-win32-arm64": "0.
|
|
14733
|
-
"@cortexkit/aft-win32-x64": "0.
|
|
14857
|
+
"@cortexkit/aft-darwin-arm64": "0.35.1",
|
|
14858
|
+
"@cortexkit/aft-darwin-x64": "0.35.1",
|
|
14859
|
+
"@cortexkit/aft-linux-arm64": "0.35.1",
|
|
14860
|
+
"@cortexkit/aft-linux-x64": "0.35.1",
|
|
14861
|
+
"@cortexkit/aft-win32-arm64": "0.35.1",
|
|
14862
|
+
"@cortexkit/aft-win32-x64": "0.35.1"
|
|
14734
14863
|
},
|
|
14735
14864
|
devDependencies: {
|
|
14736
14865
|
"@earendil-works/pi-coding-agent": "*",
|
|
@@ -15376,10 +15505,10 @@ function registerStatusCommand(pi, ctx) {
|
|
|
15376
15505
|
}
|
|
15377
15506
|
|
|
15378
15507
|
// src/config.ts
|
|
15379
|
-
var import_comment_json = __toESM(require_src2(), 1);
|
|
15380
15508
|
import { existsSync as existsSync6, readFileSync as readFileSync4, renameSync as renameSync4, unlinkSync as unlinkSync4, writeFileSync as writeFileSync3 } from "node:fs";
|
|
15381
15509
|
import { homedir as homedir6 } from "node:os";
|
|
15382
15510
|
import { join as join8 } from "node:path";
|
|
15511
|
+
var import_comment_json = __toESM(require_src2(), 1);
|
|
15383
15512
|
|
|
15384
15513
|
// ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/classic/external.js
|
|
15385
15514
|
var exports_external = {};
|
|
@@ -29000,8 +29129,8 @@ var LspExtensionSchema = exports_external.string().trim().min(1).refine((value)
|
|
|
29000
29129
|
message: "Extension must include characters other than leading dots"
|
|
29001
29130
|
});
|
|
29002
29131
|
var LspServerEntrySchema = exports_external.object({
|
|
29003
|
-
extensions: exports_external.array(LspExtensionSchema).min(1),
|
|
29004
|
-
binary: exports_external.string().trim().min(1),
|
|
29132
|
+
extensions: exports_external.array(LspExtensionSchema).min(1).optional(),
|
|
29133
|
+
binary: exports_external.string().trim().min(1).optional(),
|
|
29005
29134
|
args: exports_external.array(exports_external.string()).optional().default([]),
|
|
29006
29135
|
root_markers: exports_external.array(exports_external.string().trim().min(1)).optional().default([".git"]),
|
|
29007
29136
|
disabled: exports_external.boolean().optional().default(false),
|
|
@@ -29103,12 +29232,16 @@ function resolveLspConfigForConfigure(config2) {
|
|
|
29103
29232
|
const servers = Object.entries(config2.lsp?.servers ?? {}).map(([id, server]) => {
|
|
29104
29233
|
const entry = {
|
|
29105
29234
|
id,
|
|
29106
|
-
extensions: server.extensions.map(normalizeLspExtension),
|
|
29107
|
-
binary: server.binary,
|
|
29108
29235
|
args: server.args,
|
|
29109
29236
|
root_markers: server.root_markers,
|
|
29110
29237
|
disabled: server.disabled
|
|
29111
29238
|
};
|
|
29239
|
+
if (server.extensions && server.extensions.length > 0) {
|
|
29240
|
+
entry.extensions = server.extensions.map(normalizeLspExtension);
|
|
29241
|
+
}
|
|
29242
|
+
if (server.binary) {
|
|
29243
|
+
entry.binary = server.binary;
|
|
29244
|
+
}
|
|
29112
29245
|
if (server.env && Object.keys(server.env).length > 0) {
|
|
29113
29246
|
entry.env = server.env;
|
|
29114
29247
|
}
|
|
@@ -29312,14 +29445,15 @@ function loadConfigFromPath(configPath) {
|
|
|
29312
29445
|
return null;
|
|
29313
29446
|
}
|
|
29314
29447
|
migrateRawConfig(rawConfig, configPath, { log: log2, warn: warn2 });
|
|
29315
|
-
const
|
|
29448
|
+
const cleanConfig = stripJsoncSymbols(rawConfig);
|
|
29449
|
+
const result = AftConfigSchema.safeParse(cleanConfig);
|
|
29316
29450
|
if (result.success) {
|
|
29317
29451
|
log2(`Config loaded from ${configPath}`);
|
|
29318
29452
|
return result.data;
|
|
29319
29453
|
}
|
|
29320
29454
|
const errorMsg = result.error.issues.map((i) => `${i.path.join(".")}: ${i.message}`).join(", ");
|
|
29321
29455
|
warn2(`Config validation error in ${configPath}: ${errorMsg}`);
|
|
29322
|
-
return parseConfigPartially(
|
|
29456
|
+
return parseConfigPartially(cleanConfig);
|
|
29323
29457
|
} catch (err) {
|
|
29324
29458
|
const errorMsg = err instanceof Error ? err.message : String(err);
|
|
29325
29459
|
error2(`Error loading config from ${configPath}: ${errorMsg}`);
|
|
@@ -29547,9 +29681,9 @@ import { join as join11 } from "node:path";
|
|
|
29547
29681
|
|
|
29548
29682
|
// src/lsp-cache.ts
|
|
29549
29683
|
import {
|
|
29550
|
-
closeSync as
|
|
29684
|
+
closeSync as closeSync4,
|
|
29551
29685
|
mkdirSync as mkdirSync6,
|
|
29552
|
-
openSync as
|
|
29686
|
+
openSync as openSync4,
|
|
29553
29687
|
readFileSync as readFileSync5,
|
|
29554
29688
|
statSync as statSync3,
|
|
29555
29689
|
unlinkSync as unlinkSync5,
|
|
@@ -29642,13 +29776,13 @@ function acquireInstallLock(lockKey) {
|
|
|
29642
29776
|
const lock = lockPath(lockKey);
|
|
29643
29777
|
const tryClaim = () => {
|
|
29644
29778
|
try {
|
|
29645
|
-
const fd =
|
|
29779
|
+
const fd = openSync4(lock, "wx");
|
|
29646
29780
|
try {
|
|
29647
29781
|
writeFileSync4(fd, `${process.pid}
|
|
29648
29782
|
${new Date().toISOString()}
|
|
29649
29783
|
`);
|
|
29650
29784
|
} finally {
|
|
29651
|
-
|
|
29785
|
+
closeSync4(fd);
|
|
29652
29786
|
}
|
|
29653
29787
|
return true;
|
|
29654
29788
|
} catch (err) {
|
|
@@ -31305,6 +31439,21 @@ function sendFeatureAnnouncement(version2, features, footer, storageDir) {
|
|
|
31305
31439
|
markAnnouncementSeen(storageDir, "pi", version2);
|
|
31306
31440
|
}
|
|
31307
31441
|
|
|
31442
|
+
// src/status-bar-inject.ts
|
|
31443
|
+
var DEFAULT_SESSION = "__default__";
|
|
31444
|
+
var emitStateBySession = new Map;
|
|
31445
|
+
function statusBarBlockForSession(sessionID, counts) {
|
|
31446
|
+
if (!counts)
|
|
31447
|
+
return;
|
|
31448
|
+
const key = sessionID ?? DEFAULT_SESSION;
|
|
31449
|
+
let state = emitStateBySession.get(key);
|
|
31450
|
+
if (!state) {
|
|
31451
|
+
state = createStatusBarEmitState();
|
|
31452
|
+
emitStateBySession.set(key, state);
|
|
31453
|
+
}
|
|
31454
|
+
return shouldEmitStatusBar(state, counts) ? formatStatusBar(counts) : undefined;
|
|
31455
|
+
}
|
|
31456
|
+
|
|
31308
31457
|
// src/shared/pty-cache.ts
|
|
31309
31458
|
var import_headless = __toESM(require_xterm_headless(), 1);
|
|
31310
31459
|
import * as fs2 from "node:fs/promises";
|
|
@@ -32568,7 +32717,7 @@ function registerBashTool(pi, ctx) {
|
|
|
32568
32717
|
throw new Error(status.message ?? "bash_status failed");
|
|
32569
32718
|
}
|
|
32570
32719
|
if (isTerminalStatus(status.status)) {
|
|
32571
|
-
return bashResult(formatForegroundResult(status), {
|
|
32720
|
+
return bashResult(withBashHints(formatForegroundResult(status), params.command), {
|
|
32572
32721
|
exit_code: status.exit_code,
|
|
32573
32722
|
duration_ms: status.duration_ms,
|
|
32574
32723
|
truncated: status.output_truncated,
|
|
@@ -32597,7 +32746,7 @@ function registerBashTool(pi, ctx) {
|
|
|
32597
32746
|
task_id: taskId
|
|
32598
32747
|
};
|
|
32599
32748
|
const output = response.output ?? "";
|
|
32600
|
-
return bashResult(output, details);
|
|
32749
|
+
return bashResult(withBashHints(output, params.command), details);
|
|
32601
32750
|
},
|
|
32602
32751
|
renderCall(args, theme, context) {
|
|
32603
32752
|
return renderBashCall(args?.command, args?.description, theme, context);
|
|
@@ -32624,6 +32773,11 @@ function formatPromotionMessage(taskId, timeout, waitWindowMs) {
|
|
|
32624
32773
|
function formatSeconds(ms) {
|
|
32625
32774
|
return `${Number((ms / 1000).toFixed(1))}s`;
|
|
32626
32775
|
}
|
|
32776
|
+
function withBashHints(output, command) {
|
|
32777
|
+
let result = maybeAppendConflictsHint(output);
|
|
32778
|
+
result = maybeAppendGrepHint(result, command);
|
|
32779
|
+
return result;
|
|
32780
|
+
}
|
|
32627
32781
|
function formatForegroundResult(data) {
|
|
32628
32782
|
const output = data.output_preview ?? "";
|
|
32629
32783
|
const outputPath = data.output_path;
|
|
@@ -33490,6 +33644,45 @@ function tier2SummaryPart(summary, key, label) {
|
|
|
33490
33644
|
const status = asString(section?.status);
|
|
33491
33645
|
return `${label} ${status ?? "unavailable"}`;
|
|
33492
33646
|
}
|
|
33647
|
+
function shortDupOccurrence(entry) {
|
|
33648
|
+
const [path2] = entry.split(":");
|
|
33649
|
+
return path2?.split("/").pop() ?? entry;
|
|
33650
|
+
}
|
|
33651
|
+
function tier2TopPreview(summary, theme) {
|
|
33652
|
+
const lines = [];
|
|
33653
|
+
const dup = asRecord2(summary?.duplicates);
|
|
33654
|
+
const dupTop = Array.isArray(dup?.top) ? dup.top : [];
|
|
33655
|
+
for (const group of dupTop) {
|
|
33656
|
+
const record2 = asRecord2(group);
|
|
33657
|
+
const files = Array.isArray(record2?.files) ? record2.files : [];
|
|
33658
|
+
const cost = asNumber(record2?.cost);
|
|
33659
|
+
if (files.length < 2)
|
|
33660
|
+
continue;
|
|
33661
|
+
const a = shortDupOccurrence(String(files[0]));
|
|
33662
|
+
const b = shortDupOccurrence(String(files[1]));
|
|
33663
|
+
lines.push(` dup ${a} ↔ ${b}${cost !== undefined ? ` (${cost})` : ""}`);
|
|
33664
|
+
}
|
|
33665
|
+
for (const [key, label] of [
|
|
33666
|
+
["dead_code", "dead"],
|
|
33667
|
+
["unused_exports", "unused"]
|
|
33668
|
+
]) {
|
|
33669
|
+
const section = asRecord2(summary?.[key]);
|
|
33670
|
+
const top = Array.isArray(section?.top) ? section.top : [];
|
|
33671
|
+
for (const item of top) {
|
|
33672
|
+
const record2 = asRecord2(item);
|
|
33673
|
+
const file2 = asString(record2?.file);
|
|
33674
|
+
const symbol2 = asString(record2?.symbol);
|
|
33675
|
+
if (!file2 || !symbol2)
|
|
33676
|
+
continue;
|
|
33677
|
+
lines.push(` ${label} ${symbol2} (${file2.split("/").pop()})`);
|
|
33678
|
+
}
|
|
33679
|
+
}
|
|
33680
|
+
if (lines.length === 0)
|
|
33681
|
+
return;
|
|
33682
|
+
return `${theme.fg("muted", "top findings:")}
|
|
33683
|
+
${lines.join(`
|
|
33684
|
+
`)}`;
|
|
33685
|
+
}
|
|
33493
33686
|
function tier2RefreshCategories(response) {
|
|
33494
33687
|
const scannerState = asRecord2(response.scanner_state);
|
|
33495
33688
|
const categories = new Set;
|
|
@@ -33558,6 +33751,9 @@ function buildInspectSections(payload, theme) {
|
|
|
33558
33751
|
if (stale > 0 || pending > 0) {
|
|
33559
33752
|
sections.push(theme.fg("warning", `scanner state: ${stale} stale · ${pending} pending`));
|
|
33560
33753
|
}
|
|
33754
|
+
const topPreview = tier2TopPreview(summary, theme);
|
|
33755
|
+
if (topPreview)
|
|
33756
|
+
sections.push(topPreview);
|
|
33561
33757
|
const details = asRecord2(response.details);
|
|
33562
33758
|
if (details) {
|
|
33563
33759
|
const names = Object.keys(details);
|
|
@@ -34894,6 +35090,7 @@ function buildWorkflowHints(opts) {
|
|
|
34894
35090
|
}
|
|
34895
35091
|
if (hasInspect) {
|
|
34896
35092
|
sections.push("**Codebase health & diagnostics**: AFT does not surface compile/type errors automatically after edits — pull them with `aft_inspect`. Run it after a batch of edits and before you run tests or commit, when starting in unfamiliar code, or before a refactor/review. One call summarizes diagnostics (compile/type errors), TODOs, metrics, dead code, unused exports, and duplicates; pass `sections` for focused drill-down and `scope` to actively pull diagnostics for a specific file or directory. Its diagnostics are a fast checkpoint, not the authority — a clean `tsc` / `cargo check` / `pyright` run is the real gate. Treat `stale_categories` as a genuine stale-cache signal while an async Tier 2 refresh catches up.");
|
|
35093
|
+
sections.push("**AFT status bar**: tool results may end with a one-line health bar `[AFT E<errors> W<warnings> | D<dead-code> U<unused-exports> C<clone/dup-groups> | T<todos>]` — an IDE-style glance that appears when a count changes. `E`/`W` are live LSP diagnostics for files touched this session (your universal compile-error signal across every language with an LSP). A `~` before `D` means the dead-code/unused/dup counts predate your latest edit — run `aft_inspect` for current numbers and detail. When `E>0`, you likely just introduced errors; investigate before moving on.");
|
|
34897
35094
|
}
|
|
34898
35095
|
if (hasNavigate) {
|
|
34899
35096
|
sections.push([
|
|
@@ -35003,13 +35200,14 @@ var PLUGIN_VERSION = (() => {
|
|
|
35003
35200
|
return "0.0.0";
|
|
35004
35201
|
}
|
|
35005
35202
|
})();
|
|
35006
|
-
var ANNOUNCEMENT_VERSION = "0.
|
|
35203
|
+
var ANNOUNCEMENT_VERSION = "0.35.0";
|
|
35007
35204
|
var ANNOUNCEMENT_FEATURES = [
|
|
35008
|
-
"
|
|
35009
|
-
"New
|
|
35010
|
-
"`
|
|
35011
|
-
"
|
|
35012
|
-
"`
|
|
35205
|
+
"Leaner semantic indexing — local embedding now uses about half the CPU and a fraction of the peak memory, with no change to results and no re-index needed.",
|
|
35206
|
+
"New IDE-style status bar on tool results — live LSP errors/warnings plus dead-code, unused-export, duplicate, and TODO counts at a glance.",
|
|
35207
|
+
"`aft_inspect` is more accurate (dead-code reachability, duplicate collapse, ranked findings) and a background scheduler keeps its counts fresh during long sessions.",
|
|
35208
|
+
"The `aft_conflicts` and `grep` bash-output hints now fire on Pi too.",
|
|
35209
|
+
"`npx @cortexkit/aft --version` reports CLI, binary, and per-harness versions; `doctor --issue` can scope its report to a single session.",
|
|
35210
|
+
"New SCSS support and `.inc` files parsed as PHP."
|
|
35013
35211
|
];
|
|
35014
35212
|
var ANNOUNCEMENT_FOOTER = "Join us on Discord: https://discord.gg/DSa65w8wuf";
|
|
35015
35213
|
var ALL_ONLY_TOOLS = new Set([
|
|
@@ -35372,8 +35570,14 @@ ${lines}
|
|
|
35372
35570
|
registerWorkflowHints(pi, config2, surface);
|
|
35373
35571
|
registerStatusCommand(pi, ctx);
|
|
35374
35572
|
pi.on("tool_result", async (event, extCtx) => {
|
|
35375
|
-
const
|
|
35376
|
-
|
|
35573
|
+
const sessionID = resolveSessionId(extCtx);
|
|
35574
|
+
const bgContent = await appendToolResultBgCompletions({ ctx, directory: extCtx.cwd, sessionID }, event.content);
|
|
35575
|
+
let content = bgContent ?? event.content;
|
|
35576
|
+
const activeBridge = pool.getActiveBridgeForRoot(extCtx.cwd);
|
|
35577
|
+
const bar = statusBarBlockForSession(sessionID, activeBridge?.getStatusBar());
|
|
35578
|
+
if (bar)
|
|
35579
|
+
content = [...content, { type: "text", text: bar }];
|
|
35580
|
+
if (content === event.content)
|
|
35377
35581
|
return;
|
|
35378
35582
|
return { content, details: event.details, isError: event.isError };
|
|
35379
35583
|
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type StatusBarCounts } from "@cortexkit/aft-bridge";
|
|
2
|
+
/**
|
|
3
|
+
* Decide whether to surface the bar for this session+counts and, if so, return
|
|
4
|
+
* the formatted bar line (no leading newlines — Pi appends it as its own
|
|
5
|
+
* content block). Returns `undefined` when suppressed (unchanged since last
|
|
6
|
+
* emit and heartbeat not elapsed) or when counts are absent (no inspect scan
|
|
7
|
+
* has populated Tier-2 yet).
|
|
8
|
+
*/
|
|
9
|
+
export declare function statusBarBlockForSession(sessionID: string | undefined, counts: StatusBarCounts | undefined): string | undefined;
|
|
10
|
+
/** Drop a session's emit state (on session shutdown). */
|
|
11
|
+
export declare function clearStatusBarSession(sessionID: string | undefined): void;
|
|
12
|
+
//# sourceMappingURL=status-bar-inject.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status-bar-inject.d.ts","sourceRoot":"","sources":["../src/status-bar-inject.ts"],"names":[],"mappings":"AASA,OAAO,EAGL,KAAK,eAAe,EAGrB,MAAM,uBAAuB,CAAC;AAQ/B;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,MAAM,EAAE,eAAe,GAAG,SAAS,GAClC,MAAM,GAAG,SAAS,CASpB;AAED,yDAAyD;AACzD,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAEzE"}
|
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":"AAOA,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACZ,gBAAgB,EAEjB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,KAAK,MAAM,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAiB5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAkFjD,QAAA,MAAM,cAAc;;EAIlB,CAAC;AAEH,QAAA,MAAM,gBAAgB;;;EAUpB,CAAC;AAEH,QAAA,MAAM,eAAe;;;;;;;;EAQnB,CAAC;AAEH,QAAA,MAAM,eAAe;;;;;EA+BnB,CAAC;AAWH,UAAU,gBAAgB;IACxB,MAAM,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;IACzC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,iBAAiB;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC3B;AAED,UAAU,gBAAgB;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,UAAU,eAAe;IACvB,OAAO,EAAE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Root":"","sources":["../../src/tools/inspect.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EAEZ,KAAK,EACN,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,KAAK,MAAM,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,OAAO,EAML,KAAK,iBAAiB,EAIvB,MAAM,qBAAqB,CAAC;AAE7B,QAAA,MAAM,aAAa;;;;EAqBjB,CAAC;
|
|
1
|
+
{"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../../src/tools/inspect.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EAEZ,KAAK,EACN,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,KAAK,MAAM,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,OAAO,EAML,KAAK,iBAAiB,EAIvB,MAAM,qBAAqB,CAAC;AAE7B,QAAA,MAAM,aAAa;;;;EAqBjB,CAAC;AAuPH,wCAAwC;AACxC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG,MAAM,EAAE,CA8C7E;AAED,wCAAwC;AACxC,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,CAAC,OAAO,aAAa,CAAC,EAClC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,iBAAiB,yCAe3B;AAED,wCAAwC;AACxC,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,eAAe,CAAC,OAAO,CAAC,EAChC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,iBAAiB,sFAI3B;AAED,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,YAAY,EAAE,GAAG,EAAE,aAAa,GAAG,IAAI,CAmC9E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-hints.d.ts","sourceRoot":"","sources":["../src/workflow-hints.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAI7C,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,SAAS,GAAG,aAAa,GAAG,KAAK,CAAC;IAC/C,aAAa,EAAE,OAAO,CAAC;IACvB,eAAe,EAAE,OAAO,CAAC;IACzB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,kEAAkE;IAClE,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAC1B;AAID,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"workflow-hints.d.ts","sourceRoot":"","sources":["../src/workflow-hints.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAI7C,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,SAAS,GAAG,aAAa,GAAG,KAAK,CAAC;IAC/C,aAAa,EAAE,OAAO,CAAC;IACvB,eAAe,EAAE,OAAO,CAAC;IACzB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,kEAAkE;IAClE,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAC1B;AAID,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI,CA+EzE;AAED,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,SAAS,EACjB,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,EACxB,aAAa,EAAE,OAAO,GACrB,MAAM,GAAG,IAAI,CAYf;AAMD,UAAU,gBAAgB;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,EAAE,EAAE,YAAY,EAChB,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,gBAAgB,GACxB,IAAI,CA+BN"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortexkit/aft-pi",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.35.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Pi coding agent extension for Agent File Tools (AFT) — tree-sitter and LSP-powered code analysis",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"test:unit": "bun test src/__tests__ --path-ignore-patterns 'src/__tests__/e2e/**'"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@cortexkit/aft-bridge": "0.
|
|
26
|
+
"@cortexkit/aft-bridge": "0.35.1",
|
|
27
27
|
"@xterm/headless": "^5.5.0",
|
|
28
28
|
"comment-json": "^5.0.0",
|
|
29
29
|
"diff": "^8.0.4",
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
"zod": "^4.1.8"
|
|
32
32
|
},
|
|
33
33
|
"optionalDependencies": {
|
|
34
|
-
"@cortexkit/aft-darwin-arm64": "0.
|
|
35
|
-
"@cortexkit/aft-darwin-x64": "0.
|
|
36
|
-
"@cortexkit/aft-linux-arm64": "0.
|
|
37
|
-
"@cortexkit/aft-linux-x64": "0.
|
|
38
|
-
"@cortexkit/aft-win32-arm64": "0.
|
|
39
|
-
"@cortexkit/aft-win32-x64": "0.
|
|
34
|
+
"@cortexkit/aft-darwin-arm64": "0.35.1",
|
|
35
|
+
"@cortexkit/aft-darwin-x64": "0.35.1",
|
|
36
|
+
"@cortexkit/aft-linux-arm64": "0.35.1",
|
|
37
|
+
"@cortexkit/aft-linux-x64": "0.35.1",
|
|
38
|
+
"@cortexkit/aft-win32-arm64": "0.35.1",
|
|
39
|
+
"@cortexkit/aft-win32-x64": "0.35.1"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@earendil-works/pi-coding-agent": "*",
|