@cortexkit/aft-pi 0.15.4 → 0.16.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/bridge.d.ts +16 -3
- package/dist/bridge.d.ts.map +1 -1
- package/dist/config.d.ts +51 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +336 -59
- package/dist/notifications.d.ts +17 -0
- package/dist/notifications.d.ts.map +1 -0
- package/dist/pool.d.ts.map +1 -1
- package/dist/tools/_shared.d.ts.map +1 -1
- package/dist/tools/ast.d.ts +2 -2
- package/dist/tools/ast.d.ts.map +1 -1
- package/dist/tools/semantic.d.ts.map +1 -1
- package/package.json +6 -6
package/dist/bridge.d.ts
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
* Returns: negative if a < b, 0 if equal, positive if a > b.
|
|
4
4
|
*/
|
|
5
5
|
export declare function compareSemver(a: string, b: string): number;
|
|
6
|
+
interface ConfigureWarningsContext {
|
|
7
|
+
projectRoot: string;
|
|
8
|
+
sessionId?: string;
|
|
9
|
+
client?: unknown;
|
|
10
|
+
warnings: unknown[];
|
|
11
|
+
}
|
|
6
12
|
export interface BridgeOptions {
|
|
7
13
|
/** Request timeout in milliseconds. Default: 30000 */
|
|
8
14
|
timeoutMs?: number;
|
|
@@ -12,6 +18,12 @@ export interface BridgeOptions {
|
|
|
12
18
|
minVersion?: string;
|
|
13
19
|
/** Called when binary version is older than minVersion. Receives (binaryVersion, minVersion). */
|
|
14
20
|
onVersionMismatch?: (binaryVersion: string, minVersion: string) => void;
|
|
21
|
+
/** Called after the first successful configure returns user-visible warnings. */
|
|
22
|
+
onConfigureWarnings?: (context: ConfigureWarningsContext) => void | Promise<void>;
|
|
23
|
+
}
|
|
24
|
+
interface SendOptions {
|
|
25
|
+
timeoutMs?: number;
|
|
26
|
+
configureWarningClient?: unknown;
|
|
15
27
|
}
|
|
16
28
|
/**
|
|
17
29
|
* Manages a persistent `aft` child process, communicating via NDJSON over
|
|
@@ -39,6 +51,7 @@ export declare class BinaryBridge {
|
|
|
39
51
|
private configOverrides;
|
|
40
52
|
private minVersion;
|
|
41
53
|
private onVersionMismatch;
|
|
54
|
+
private onConfigureWarnings;
|
|
42
55
|
private restartResetTimer;
|
|
43
56
|
constructor(binaryPath: string, cwd: string, options?: BridgeOptions, configOverrides?: Record<string, unknown>);
|
|
44
57
|
/** Number of times the binary has been restarted after a crash. */
|
|
@@ -49,9 +62,8 @@ export declare class BinaryBridge {
|
|
|
49
62
|
* Send a command to the binary and return the parsed response.
|
|
50
63
|
* Lazy-spawns the binary on first call.
|
|
51
64
|
*/
|
|
52
|
-
send(command: string, params?: Record<string, unknown>, options?:
|
|
53
|
-
|
|
54
|
-
}): Promise<Record<string, unknown>>;
|
|
65
|
+
send(command: string, params?: Record<string, unknown>, options?: SendOptions): Promise<Record<string, unknown>>;
|
|
66
|
+
private deliverConfigureWarnings;
|
|
55
67
|
/** Kill the child process and reject all pending requests. */
|
|
56
68
|
shutdown(): Promise<void>;
|
|
57
69
|
/** Query binary version and compare against minVersion. Calls onVersionMismatch if outdated. */
|
|
@@ -67,4 +79,5 @@ export declare class BinaryBridge {
|
|
|
67
79
|
private scheduleRestartCountReset;
|
|
68
80
|
private clearRestartResetTimer;
|
|
69
81
|
}
|
|
82
|
+
export {};
|
|
70
83
|
//# sourceMappingURL=bridge.d.ts.map
|
package/dist/bridge.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../src/bridge.ts"],"names":[],"mappings":"AAmBA;;;GAGG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAkC1D;AA4CD,MAAM,WAAW,aAAa;IAC5B,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,WAAW,CAAC,EAAE,MAAM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CAAC,WAAW;IA8CnB,OAAO,CAAC,gBAAgB;IAQxB,OAAO,CAAC,yBAAyB;IAQjC,OAAO,CAAC,sBAAsB;CAM/B"}
|
package/dist/config.d.ts
CHANGED
|
@@ -10,6 +10,26 @@ export interface SemanticConfig {
|
|
|
10
10
|
timeout_ms?: number;
|
|
11
11
|
max_batch_size?: number;
|
|
12
12
|
}
|
|
13
|
+
export interface LspServerConfig {
|
|
14
|
+
id: string;
|
|
15
|
+
extensions: string[];
|
|
16
|
+
binary: string;
|
|
17
|
+
args: string[];
|
|
18
|
+
root_markers: string[];
|
|
19
|
+
disabled: boolean;
|
|
20
|
+
env?: Record<string, string>;
|
|
21
|
+
initialization_options?: unknown;
|
|
22
|
+
}
|
|
23
|
+
export interface LspConfig {
|
|
24
|
+
servers?: Record<string, Omit<LspServerConfig, "id">>;
|
|
25
|
+
disabled?: string[];
|
|
26
|
+
python?: "pyright" | "ty" | "auto";
|
|
27
|
+
}
|
|
28
|
+
export interface ConfigureLspOverrides {
|
|
29
|
+
experimental_lsp_ty?: boolean;
|
|
30
|
+
lsp_servers?: LspServerConfig[];
|
|
31
|
+
disabled_lsp?: string[];
|
|
32
|
+
}
|
|
13
33
|
export type ToolSurface = "minimal" | "recommended" | "all";
|
|
14
34
|
export interface AftConfig {
|
|
15
35
|
format_on_edit?: boolean;
|
|
@@ -21,6 +41,8 @@ export interface AftConfig {
|
|
|
21
41
|
restrict_to_project_root?: boolean;
|
|
22
42
|
experimental_search_index?: boolean;
|
|
23
43
|
experimental_semantic_search?: boolean;
|
|
44
|
+
experimental_lsp_ty?: boolean;
|
|
45
|
+
lsp?: LspConfig;
|
|
24
46
|
url_fetch_allow_private?: boolean;
|
|
25
47
|
semantic?: SemanticConfig;
|
|
26
48
|
/**
|
|
@@ -30,6 +52,16 @@ export interface AftConfig {
|
|
|
30
52
|
*/
|
|
31
53
|
max_callgraph_files?: number;
|
|
32
54
|
}
|
|
55
|
+
export declare const LspServerSchema: z.ZodObject<{
|
|
56
|
+
extensions: z.ZodArray<z.ZodString>;
|
|
57
|
+
binary: z.ZodString;
|
|
58
|
+
args: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
59
|
+
root_markers: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
60
|
+
disabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
61
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
62
|
+
initialization_options: z.ZodOptional<z.ZodUnknown>;
|
|
63
|
+
id: z.ZodString;
|
|
64
|
+
}, z.core.$strip>;
|
|
33
65
|
export declare const AftConfigSchema: z.ZodObject<{
|
|
34
66
|
format_on_edit: z.ZodOptional<z.ZodBoolean>;
|
|
35
67
|
validate_on_edit: z.ZodOptional<z.ZodEnum<{
|
|
@@ -66,6 +98,24 @@ export declare const AftConfigSchema: z.ZodObject<{
|
|
|
66
98
|
restrict_to_project_root: z.ZodOptional<z.ZodBoolean>;
|
|
67
99
|
experimental_search_index: z.ZodOptional<z.ZodBoolean>;
|
|
68
100
|
experimental_semantic_search: z.ZodOptional<z.ZodBoolean>;
|
|
101
|
+
experimental_lsp_ty: z.ZodOptional<z.ZodBoolean>;
|
|
102
|
+
lsp: z.ZodOptional<z.ZodObject<{
|
|
103
|
+
servers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
104
|
+
extensions: z.ZodArray<z.ZodString>;
|
|
105
|
+
binary: z.ZodString;
|
|
106
|
+
args: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
107
|
+
root_markers: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
108
|
+
disabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
109
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
110
|
+
initialization_options: z.ZodOptional<z.ZodUnknown>;
|
|
111
|
+
}, z.core.$strip>>>;
|
|
112
|
+
disabled: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
113
|
+
python: z.ZodOptional<z.ZodEnum<{
|
|
114
|
+
pyright: "pyright";
|
|
115
|
+
ty: "ty";
|
|
116
|
+
auto: "auto";
|
|
117
|
+
}>>;
|
|
118
|
+
}, z.core.$strip>>;
|
|
69
119
|
url_fetch_allow_private: z.ZodOptional<z.ZodBoolean>;
|
|
70
120
|
semantic: z.ZodOptional<z.ZodObject<{
|
|
71
121
|
backend: z.ZodOptional<z.ZodEnum<{
|
|
@@ -81,6 +131,7 @@ export declare const AftConfigSchema: z.ZodObject<{
|
|
|
81
131
|
}, z.core.$strip>>;
|
|
82
132
|
max_callgraph_files: z.ZodOptional<z.ZodNumber>;
|
|
83
133
|
}, z.core.$strip>;
|
|
134
|
+
export declare function resolveLspConfigForConfigure(config: AftConfig): ConfigureLspOverrides;
|
|
84
135
|
/**
|
|
85
136
|
* Load AFT config:
|
|
86
137
|
* 1. User-level: ~/.pi/agent/aft.jsonc (or .json)
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,MAAM,MAAM,SAAS,GACjB,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,OAAO,GACP,SAAS,GACT,MAAM,GACN,OAAO,GACP,IAAI,GACJ,aAAa,GACb,MAAM,CAAC;AAEX,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,CAAC;IACf,QAAQ,CAAC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AAM,EAAE,OAAO,CAAC,CAAC;IAClC,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAwDD,eAAO,MAAM,eAAe;;;;;;;;;iBAE1B,CAAC;AAQH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAe1B,CAAC;AAMH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,SAAS,GAAG,qBAAqB,CAgDrF;AA0LD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,gBAAgB,EAAE,MAAM,GAAG,SAAS,CA4BjE"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AA2JlE;;;;GAIG;AACH,yBAA+B,EAAE,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA+I9D"}
|
package/dist/index.js
CHANGED
|
@@ -18,7 +18,7 @@ var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
|
18
18
|
// src/index.ts
|
|
19
19
|
import { createRequire as createRequire3 } from "node:module";
|
|
20
20
|
import { homedir as homedir7 } from "node:os";
|
|
21
|
-
import { join as
|
|
21
|
+
import { join as join9 } from "node:path";
|
|
22
22
|
|
|
23
23
|
// src/shared/status.ts
|
|
24
24
|
function asRecord(value) {
|
|
@@ -184,7 +184,11 @@ async function callBridge(bridge, command, params = {}, extCtx) {
|
|
|
184
184
|
if (sessionId) {
|
|
185
185
|
merged.session_id = sessionId;
|
|
186
186
|
}
|
|
187
|
-
const
|
|
187
|
+
const sendOptions = {
|
|
188
|
+
...timeoutMs !== undefined ? { timeoutMs } : {},
|
|
189
|
+
configureWarningClient: extCtx
|
|
190
|
+
};
|
|
191
|
+
const response = await bridge.send(command, merged, Object.keys(sendOptions).length > 0 ? sendOptions : undefined);
|
|
188
192
|
if (response.success === false) {
|
|
189
193
|
const message = typeof response.message === "string" && response.message.length > 0 ? response.message : `${command} failed`;
|
|
190
194
|
throw new Error(message);
|
|
@@ -13858,6 +13862,26 @@ var SemanticConfigSchema = exports_external.object({
|
|
|
13858
13862
|
timeout_ms: exports_external.number().int().positive().optional(),
|
|
13859
13863
|
max_batch_size: exports_external.number().int().positive().optional()
|
|
13860
13864
|
});
|
|
13865
|
+
var LspExtensionSchema = exports_external.string().trim().min(1).refine((value) => value.replace(/^\.+/, "").length > 0, {
|
|
13866
|
+
message: "Extension must include characters other than leading dots"
|
|
13867
|
+
});
|
|
13868
|
+
var LspServerEntrySchema = exports_external.object({
|
|
13869
|
+
extensions: exports_external.array(LspExtensionSchema).min(1),
|
|
13870
|
+
binary: exports_external.string().trim().min(1),
|
|
13871
|
+
args: exports_external.array(exports_external.string()).optional().default([]),
|
|
13872
|
+
root_markers: exports_external.array(exports_external.string().trim().min(1)).optional().default([".git"]),
|
|
13873
|
+
disabled: exports_external.boolean().optional().default(false),
|
|
13874
|
+
env: exports_external.record(exports_external.string().min(1), exports_external.string()).optional(),
|
|
13875
|
+
initialization_options: exports_external.unknown().optional()
|
|
13876
|
+
});
|
|
13877
|
+
var LspServerSchema = LspServerEntrySchema.extend({
|
|
13878
|
+
id: exports_external.string().trim().min(1)
|
|
13879
|
+
});
|
|
13880
|
+
var LspConfigSchema = exports_external.object({
|
|
13881
|
+
servers: exports_external.record(exports_external.string().trim().min(1), LspServerEntrySchema).optional(),
|
|
13882
|
+
disabled: exports_external.array(exports_external.string().trim().min(1)).optional(),
|
|
13883
|
+
python: exports_external.enum(["pyright", "ty", "auto"]).optional()
|
|
13884
|
+
});
|
|
13861
13885
|
var AftConfigSchema = exports_external.object({
|
|
13862
13886
|
format_on_edit: exports_external.boolean().optional(),
|
|
13863
13887
|
validate_on_edit: exports_external.enum(["syntax", "full"]).optional(),
|
|
@@ -13868,10 +13892,59 @@ var AftConfigSchema = exports_external.object({
|
|
|
13868
13892
|
restrict_to_project_root: exports_external.boolean().optional(),
|
|
13869
13893
|
experimental_search_index: exports_external.boolean().optional(),
|
|
13870
13894
|
experimental_semantic_search: exports_external.boolean().optional(),
|
|
13895
|
+
experimental_lsp_ty: exports_external.boolean().optional(),
|
|
13896
|
+
lsp: LspConfigSchema.optional(),
|
|
13871
13897
|
url_fetch_allow_private: exports_external.boolean().optional(),
|
|
13872
13898
|
semantic: SemanticConfigSchema.optional(),
|
|
13873
13899
|
max_callgraph_files: exports_external.number().int().positive().optional()
|
|
13874
13900
|
});
|
|
13901
|
+
function normalizeLspExtension(extension) {
|
|
13902
|
+
return extension.trim().replace(/^\.+/, "");
|
|
13903
|
+
}
|
|
13904
|
+
function resolveLspConfigForConfigure(config2) {
|
|
13905
|
+
const overrides = {};
|
|
13906
|
+
const disabled = new Set(config2.lsp?.disabled ?? []);
|
|
13907
|
+
let experimentalTy = config2.experimental_lsp_ty;
|
|
13908
|
+
switch (config2.lsp?.python ?? "auto") {
|
|
13909
|
+
case "ty":
|
|
13910
|
+
experimentalTy = true;
|
|
13911
|
+
disabled.add("pyright");
|
|
13912
|
+
break;
|
|
13913
|
+
case "pyright":
|
|
13914
|
+
experimentalTy = false;
|
|
13915
|
+
disabled.add("ty");
|
|
13916
|
+
break;
|
|
13917
|
+
case "auto":
|
|
13918
|
+
break;
|
|
13919
|
+
}
|
|
13920
|
+
if (experimentalTy !== undefined) {
|
|
13921
|
+
overrides.experimental_lsp_ty = experimentalTy;
|
|
13922
|
+
}
|
|
13923
|
+
const servers = Object.entries(config2.lsp?.servers ?? {}).map(([id, server]) => {
|
|
13924
|
+
const entry = {
|
|
13925
|
+
id,
|
|
13926
|
+
extensions: server.extensions.map(normalizeLspExtension),
|
|
13927
|
+
binary: server.binary,
|
|
13928
|
+
args: server.args,
|
|
13929
|
+
root_markers: server.root_markers,
|
|
13930
|
+
disabled: server.disabled
|
|
13931
|
+
};
|
|
13932
|
+
if (server.env && Object.keys(server.env).length > 0) {
|
|
13933
|
+
entry.env = server.env;
|
|
13934
|
+
}
|
|
13935
|
+
if (server.initialization_options !== undefined) {
|
|
13936
|
+
entry.initialization_options = server.initialization_options;
|
|
13937
|
+
}
|
|
13938
|
+
return entry;
|
|
13939
|
+
});
|
|
13940
|
+
if (servers.length > 0) {
|
|
13941
|
+
overrides.lsp_servers = servers;
|
|
13942
|
+
}
|
|
13943
|
+
if (disabled.size > 0) {
|
|
13944
|
+
overrides.disabled_lsp = [...disabled];
|
|
13945
|
+
}
|
|
13946
|
+
return overrides;
|
|
13947
|
+
}
|
|
13875
13948
|
function stripJsonc(input) {
|
|
13876
13949
|
let result = "";
|
|
13877
13950
|
let i = 0;
|
|
@@ -13992,12 +14065,21 @@ function mergeConfigs(base, override) {
|
|
|
13992
14065
|
const formatter = { ...base.formatter, ...override.formatter };
|
|
13993
14066
|
const checker = { ...base.checker, ...override.checker };
|
|
13994
14067
|
const semantic = mergeSemanticConfig(base.semantic, override.semantic);
|
|
14068
|
+
const lspServers = { ...base.lsp?.servers, ...override.lsp?.servers };
|
|
14069
|
+
const disabledLsp = [...base.lsp?.disabled ?? [], ...override.lsp?.disabled ?? []];
|
|
14070
|
+
const lsp = {
|
|
14071
|
+
...base.lsp,
|
|
14072
|
+
...override.lsp,
|
|
14073
|
+
...Object.keys(lspServers).length > 0 ? { servers: lspServers } : {},
|
|
14074
|
+
...disabledLsp.length > 0 ? { disabled: [...new Set(disabledLsp)] } : {}
|
|
14075
|
+
};
|
|
13995
14076
|
const { semantic: _stripSemantic, ...safeOverride } = override;
|
|
13996
14077
|
return {
|
|
13997
14078
|
...base,
|
|
13998
14079
|
...safeOverride,
|
|
13999
14080
|
...Object.keys(formatter).length > 0 ? { formatter } : {},
|
|
14000
14081
|
...Object.keys(checker).length > 0 ? { checker } : {},
|
|
14082
|
+
...Object.values(lsp).some((value) => value !== undefined) ? { lsp } : {},
|
|
14001
14083
|
semantic,
|
|
14002
14084
|
...disabledTools.length > 0 ? { disabled_tools: [...new Set(disabledTools)] } : {}
|
|
14003
14085
|
};
|
|
@@ -14023,9 +14105,107 @@ function loadAftConfig(projectDirectory) {
|
|
|
14023
14105
|
return config2;
|
|
14024
14106
|
}
|
|
14025
14107
|
|
|
14026
|
-
// src/
|
|
14027
|
-
import {
|
|
14108
|
+
// src/notifications.ts
|
|
14109
|
+
import { existsSync as existsSync2, mkdirSync, readFileSync as readFileSync2, writeFileSync } from "node:fs";
|
|
14028
14110
|
import { join as join3 } from "node:path";
|
|
14111
|
+
var WARNING_MARKER = "\uD83D\uDD27 AFT: ⚠️";
|
|
14112
|
+
var WARNED_TOOLS_FILE = "warned_tools.json";
|
|
14113
|
+
function sendIgnoredMessage(client, _sessionId, text) {
|
|
14114
|
+
const typedClient = client;
|
|
14115
|
+
if (typeof typedClient.ui?.notify !== "function")
|
|
14116
|
+
return false;
|
|
14117
|
+
try {
|
|
14118
|
+
typedClient.ui.notify(text, "warning");
|
|
14119
|
+
return true;
|
|
14120
|
+
} catch (err) {
|
|
14121
|
+
log(`[aft-pi] notification send failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
14122
|
+
return false;
|
|
14123
|
+
}
|
|
14124
|
+
}
|
|
14125
|
+
function readWarnedTools(storageDir) {
|
|
14126
|
+
try {
|
|
14127
|
+
const warnedToolsPath = join3(storageDir, WARNED_TOOLS_FILE);
|
|
14128
|
+
if (!existsSync2(warnedToolsPath))
|
|
14129
|
+
return {};
|
|
14130
|
+
const parsed = JSON.parse(readFileSync2(warnedToolsPath, "utf-8"));
|
|
14131
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
|
|
14132
|
+
return {};
|
|
14133
|
+
const warned = {};
|
|
14134
|
+
for (const [key, version2] of Object.entries(parsed)) {
|
|
14135
|
+
if (typeof version2 === "string") {
|
|
14136
|
+
warned[key] = version2;
|
|
14137
|
+
}
|
|
14138
|
+
}
|
|
14139
|
+
return warned;
|
|
14140
|
+
} catch {
|
|
14141
|
+
return {};
|
|
14142
|
+
}
|
|
14143
|
+
}
|
|
14144
|
+
function writeWarnedTools(storageDir, warned) {
|
|
14145
|
+
try {
|
|
14146
|
+
mkdirSync(storageDir, { recursive: true });
|
|
14147
|
+
const warnedToolsPath = join3(storageDir, WARNED_TOOLS_FILE);
|
|
14148
|
+
writeFileSync(warnedToolsPath, `${JSON.stringify(warned, null, 2)}
|
|
14149
|
+
`);
|
|
14150
|
+
} catch {}
|
|
14151
|
+
}
|
|
14152
|
+
function warningKey(warning, projectRoot) {
|
|
14153
|
+
return [
|
|
14154
|
+
projectRoot ?? "_",
|
|
14155
|
+
warning.kind,
|
|
14156
|
+
warning.language ?? warning.server ?? "_",
|
|
14157
|
+
warning.tool ?? warning.binary ?? "_",
|
|
14158
|
+
warning.hint
|
|
14159
|
+
].map((part) => encodeURIComponent(part)).join(":");
|
|
14160
|
+
}
|
|
14161
|
+
function warningTitle(warning) {
|
|
14162
|
+
switch (warning.kind) {
|
|
14163
|
+
case "formatter_not_installed":
|
|
14164
|
+
return "Formatter is not installed";
|
|
14165
|
+
case "checker_not_installed":
|
|
14166
|
+
return "Checker is not installed";
|
|
14167
|
+
case "lsp_binary_missing":
|
|
14168
|
+
return "LSP binary is missing";
|
|
14169
|
+
}
|
|
14170
|
+
}
|
|
14171
|
+
function formatConfigureWarning(warning) {
|
|
14172
|
+
const details = [];
|
|
14173
|
+
if (warning.language)
|
|
14174
|
+
details.push(`language: ${warning.language}`);
|
|
14175
|
+
if (warning.server)
|
|
14176
|
+
details.push(`server: ${warning.server}`);
|
|
14177
|
+
if (warning.tool)
|
|
14178
|
+
details.push(`tool: ${warning.tool}`);
|
|
14179
|
+
if (warning.binary && warning.binary !== warning.tool) {
|
|
14180
|
+
details.push(`binary: ${warning.binary}`);
|
|
14181
|
+
}
|
|
14182
|
+
const suffix = details.length > 0 ? ` (${details.join(", ")})` : "";
|
|
14183
|
+
return `${WARNING_MARKER} ${warningTitle(warning)}${suffix}
|
|
14184
|
+
${warning.hint}`;
|
|
14185
|
+
}
|
|
14186
|
+
async function deliverConfigureWarnings(opts, warnings) {
|
|
14187
|
+
if (warnings.length === 0)
|
|
14188
|
+
return;
|
|
14189
|
+
const warned = readWarnedTools(opts.storageDir);
|
|
14190
|
+
let changed = false;
|
|
14191
|
+
for (const warning of warnings) {
|
|
14192
|
+
const key = warningKey(warning, opts.projectRoot);
|
|
14193
|
+
if (Object.hasOwn(warned, key))
|
|
14194
|
+
continue;
|
|
14195
|
+
if (!sendIgnoredMessage(opts.client, opts.sessionId, formatConfigureWarning(warning))) {
|
|
14196
|
+
continue;
|
|
14197
|
+
}
|
|
14198
|
+
warned[key] = opts.pluginVersion;
|
|
14199
|
+
changed = true;
|
|
14200
|
+
}
|
|
14201
|
+
if (changed) {
|
|
14202
|
+
writeWarnedTools(opts.storageDir, warned);
|
|
14203
|
+
}
|
|
14204
|
+
}
|
|
14205
|
+
|
|
14206
|
+
// src/onnx-runtime.ts
|
|
14207
|
+
import { chmodSync, existsSync as existsSync3, mkdirSync as mkdirSync2, readdirSync, unlinkSync } from "node:fs";
|
|
14208
|
+
import { join as join4 } from "node:path";
|
|
14029
14209
|
var ORT_VERSION = "1.24.4";
|
|
14030
14210
|
var ORT_REPO = "microsoft/onnxruntime";
|
|
14031
14211
|
var ORT_PLATFORM_MAP = {
|
|
@@ -14078,9 +14258,9 @@ function getManualInstallHint() {
|
|
|
14078
14258
|
}
|
|
14079
14259
|
async function ensureOnnxRuntime(storageDir) {
|
|
14080
14260
|
const info = getPlatformInfo();
|
|
14081
|
-
const ortDir =
|
|
14082
|
-
const libPath =
|
|
14083
|
-
if (
|
|
14261
|
+
const ortDir = join4(storageDir, "onnxruntime", ORT_VERSION);
|
|
14262
|
+
const libPath = join4(ortDir, info?.libName ?? "libonnxruntime.dylib");
|
|
14263
|
+
if (existsSync3(libPath)) {
|
|
14084
14264
|
log(`ONNX Runtime found at ${ortDir}`);
|
|
14085
14265
|
return ortDir;
|
|
14086
14266
|
}
|
|
@@ -14105,7 +14285,7 @@ function findSystemOnnxRuntime(libName) {
|
|
|
14105
14285
|
searchPaths.push("/usr/lib", "/usr/lib/x86_64-linux-gnu", "/usr/lib/aarch64-linux-gnu", "/usr/local/lib");
|
|
14106
14286
|
}
|
|
14107
14287
|
for (const dir of searchPaths) {
|
|
14108
|
-
if (
|
|
14288
|
+
if (existsSync3(join4(dir, libName))) {
|
|
14109
14289
|
return dir;
|
|
14110
14290
|
}
|
|
14111
14291
|
}
|
|
@@ -14116,8 +14296,8 @@ async function downloadOnnxRuntime(info, targetDir) {
|
|
|
14116
14296
|
log(`Downloading ONNX Runtime v${ORT_VERSION} for ${process.platform}/${process.arch}...`);
|
|
14117
14297
|
try {
|
|
14118
14298
|
const tmpDir = `${targetDir}.tmp.${process.pid}`;
|
|
14119
|
-
|
|
14120
|
-
const archivePath =
|
|
14299
|
+
mkdirSync2(tmpDir, { recursive: true });
|
|
14300
|
+
const archivePath = join4(tmpDir, `onnxruntime.${info.archiveType}`);
|
|
14121
14301
|
const { execFileSync } = await import("node:child_process");
|
|
14122
14302
|
execFileSync("curl", ["-fsSL", url2, "-o", archivePath], {
|
|
14123
14303
|
stdio: "pipe",
|
|
@@ -14128,17 +14308,17 @@ async function downloadOnnxRuntime(info, targetDir) {
|
|
|
14128
14308
|
} else {
|
|
14129
14309
|
await extractZipArchive(archivePath, tmpDir);
|
|
14130
14310
|
}
|
|
14131
|
-
const extractedDir =
|
|
14132
|
-
if (!
|
|
14311
|
+
const extractedDir = join4(tmpDir, info.assetName, "lib");
|
|
14312
|
+
if (!existsSync3(extractedDir)) {
|
|
14133
14313
|
throw new Error(`Expected directory not found: ${extractedDir}`);
|
|
14134
14314
|
}
|
|
14135
|
-
|
|
14315
|
+
mkdirSync2(targetDir, { recursive: true });
|
|
14136
14316
|
const libFiles = readdirSync(extractedDir).filter((f) => f.startsWith("libonnxruntime") || f.startsWith("onnxruntime"));
|
|
14137
14317
|
const { lstatSync, symlinkSync, readlinkSync, copyFileSync: cpFile } = await import("node:fs");
|
|
14138
14318
|
const realFiles = [];
|
|
14139
14319
|
const symlinks = [];
|
|
14140
14320
|
for (const libFile of libFiles) {
|
|
14141
|
-
const src =
|
|
14321
|
+
const src = join4(extractedDir, libFile);
|
|
14142
14322
|
try {
|
|
14143
14323
|
const stat = lstatSync(src);
|
|
14144
14324
|
log(`ORT extract: ${libFile} — isSymlink=${stat.isSymbolicLink()}, isFile=${stat.isFile()}, size=${stat.size}`);
|
|
@@ -14153,8 +14333,8 @@ async function downloadOnnxRuntime(info, targetDir) {
|
|
|
14153
14333
|
}
|
|
14154
14334
|
}
|
|
14155
14335
|
for (const libFile of realFiles) {
|
|
14156
|
-
const src =
|
|
14157
|
-
const dst =
|
|
14336
|
+
const src = join4(extractedDir, libFile);
|
|
14337
|
+
const dst = join4(targetDir, libFile);
|
|
14158
14338
|
try {
|
|
14159
14339
|
cpFile(src, dst);
|
|
14160
14340
|
if (process.platform !== "win32") {
|
|
@@ -14165,7 +14345,7 @@ async function downloadOnnxRuntime(info, targetDir) {
|
|
|
14165
14345
|
}
|
|
14166
14346
|
}
|
|
14167
14347
|
for (const link of symlinks) {
|
|
14168
|
-
const dst =
|
|
14348
|
+
const dst = join4(targetDir, link.name);
|
|
14169
14349
|
try {
|
|
14170
14350
|
unlinkSync(dst);
|
|
14171
14351
|
} catch {}
|
|
@@ -14223,7 +14403,7 @@ import { realpathSync } from "node:fs";
|
|
|
14223
14403
|
// src/bridge.ts
|
|
14224
14404
|
import { spawn } from "node:child_process";
|
|
14225
14405
|
import { homedir as homedir2 } from "node:os";
|
|
14226
|
-
import { join as
|
|
14406
|
+
import { join as join5 } from "node:path";
|
|
14227
14407
|
var DEFAULT_BRIDGE_TIMEOUT_MS = 30000;
|
|
14228
14408
|
var SEMANTIC_TIMEOUT_SAFETY_MARGIN_MS = 5000;
|
|
14229
14409
|
var MAX_STDOUT_BUFFER = 64 * 1024 * 1024;
|
|
@@ -14311,6 +14491,7 @@ class BinaryBridge {
|
|
|
14311
14491
|
configOverrides;
|
|
14312
14492
|
minVersion;
|
|
14313
14493
|
onVersionMismatch;
|
|
14494
|
+
onConfigureWarnings;
|
|
14314
14495
|
restartResetTimer = null;
|
|
14315
14496
|
constructor(binaryPath, cwd, options, configOverrides) {
|
|
14316
14497
|
this.binaryPath = binaryPath;
|
|
@@ -14320,6 +14501,7 @@ class BinaryBridge {
|
|
|
14320
14501
|
this.configOverrides = clampSemanticTimeout(configOverrides ?? {}, this.timeoutMs);
|
|
14321
14502
|
this.minVersion = options?.minVersion;
|
|
14322
14503
|
this.onVersionMismatch = options?.onVersionMismatch;
|
|
14504
|
+
this.onConfigureWarnings = options?.onConfigureWarnings;
|
|
14323
14505
|
}
|
|
14324
14506
|
get restartCount() {
|
|
14325
14507
|
return this._restartCount;
|
|
@@ -14344,6 +14526,7 @@ class BinaryBridge {
|
|
|
14344
14526
|
if (configResult.success === false) {
|
|
14345
14527
|
throw new Error(`[aft-pi] Configure failed: ${configResult.message ?? "unknown error"}`);
|
|
14346
14528
|
}
|
|
14529
|
+
await this.deliverConfigureWarnings(configResult, params, options);
|
|
14347
14530
|
await this.checkVersion();
|
|
14348
14531
|
if (!this.isAlive()) {
|
|
14349
14532
|
throw new Error(`[aft-pi] Bridge died during version check. Check logs: ${getLogFilePath()}`);
|
|
@@ -14388,6 +14571,23 @@ class BinaryBridge {
|
|
|
14388
14571
|
});
|
|
14389
14572
|
});
|
|
14390
14573
|
}
|
|
14574
|
+
async deliverConfigureWarnings(configResult, params, options) {
|
|
14575
|
+
if (!this.onConfigureWarnings || !Array.isArray(configResult.warnings))
|
|
14576
|
+
return;
|
|
14577
|
+
if (configResult.warnings.length === 0)
|
|
14578
|
+
return;
|
|
14579
|
+
try {
|
|
14580
|
+
const sessionId = typeof params.session_id === "string" ? params.session_id : undefined;
|
|
14581
|
+
await this.onConfigureWarnings({
|
|
14582
|
+
projectRoot: this.cwd,
|
|
14583
|
+
sessionId,
|
|
14584
|
+
client: options?.configureWarningClient,
|
|
14585
|
+
warnings: configResult.warnings
|
|
14586
|
+
});
|
|
14587
|
+
} catch (err) {
|
|
14588
|
+
warn(`configure warning delivery failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
14589
|
+
}
|
|
14590
|
+
}
|
|
14391
14591
|
async shutdown() {
|
|
14392
14592
|
this._shuttingDown = true;
|
|
14393
14593
|
this.clearRestartResetTimer();
|
|
@@ -14445,14 +14645,14 @@ class BinaryBridge {
|
|
|
14445
14645
|
})();
|
|
14446
14646
|
const useFastembedBackend = semanticBackend === undefined || semanticBackend === "fastembed" || semanticBackend === "";
|
|
14447
14647
|
const ortDir = typeof this.configOverrides._ort_dylib_dir === "string" && useFastembedBackend ? this.configOverrides._ort_dylib_dir : null;
|
|
14448
|
-
const ortLibraryPath = ortDir == null ? null :
|
|
14648
|
+
const ortLibraryPath = ortDir == null ? null : join5(ortDir, process.platform === "win32" ? "onnxruntime.dll" : process.platform === "darwin" ? "libonnxruntime.dylib" : "libonnxruntime.so");
|
|
14449
14649
|
const envPath = process.platform === "win32" && ortDir ? `${ortDir};${process.env.PATH ?? ""}` : process.env.PATH;
|
|
14450
14650
|
const env = {
|
|
14451
14651
|
...process.env,
|
|
14452
14652
|
...envPath ? { PATH: envPath } : {}
|
|
14453
14653
|
};
|
|
14454
14654
|
if (useFastembedBackend) {
|
|
14455
|
-
env.FASTEMBED_CACHE_DIR = process.env.FASTEMBED_CACHE_DIR || (typeof this.configOverrides.storage_dir === "string" ?
|
|
14655
|
+
env.FASTEMBED_CACHE_DIR = process.env.FASTEMBED_CACHE_DIR || (typeof this.configOverrides.storage_dir === "string" ? join5(this.configOverrides.storage_dir, "semantic", "models") : join5(homedir2() || "", ".cache", "fastembed"));
|
|
14456
14656
|
if (ortLibraryPath) {
|
|
14457
14657
|
env.ORT_DYLIB_PATH = ortLibraryPath;
|
|
14458
14658
|
}
|
|
@@ -14630,7 +14830,8 @@ class BridgePool {
|
|
|
14630
14830
|
timeoutMs: options.timeoutMs,
|
|
14631
14831
|
maxRestarts: options.maxRestarts,
|
|
14632
14832
|
minVersion: options.minVersion,
|
|
14633
|
-
onVersionMismatch: options.onVersionMismatch
|
|
14833
|
+
onVersionMismatch: options.onVersionMismatch,
|
|
14834
|
+
onConfigureWarnings: options.onConfigureWarnings
|
|
14634
14835
|
};
|
|
14635
14836
|
this.configOverrides = configOverrides;
|
|
14636
14837
|
if (Number.isFinite(this.idleTimeoutMs)) {
|
|
@@ -14722,15 +14923,15 @@ function canonicalKey(directory) {
|
|
|
14722
14923
|
|
|
14723
14924
|
// src/resolver.ts
|
|
14724
14925
|
import { execSync, spawnSync } from "node:child_process";
|
|
14725
|
-
import { chmodSync as chmodSync3, copyFileSync, existsSync as
|
|
14926
|
+
import { chmodSync as chmodSync3, copyFileSync, existsSync as existsSync5, mkdirSync as mkdirSync4, renameSync } from "node:fs";
|
|
14726
14927
|
import { createRequire as createRequire2 } from "node:module";
|
|
14727
14928
|
import { homedir as homedir4 } from "node:os";
|
|
14728
|
-
import { join as
|
|
14929
|
+
import { join as join7 } from "node:path";
|
|
14729
14930
|
|
|
14730
14931
|
// src/downloader.ts
|
|
14731
|
-
import { chmodSync as chmodSync2, existsSync as
|
|
14932
|
+
import { chmodSync as chmodSync2, existsSync as existsSync4, mkdirSync as mkdirSync3, unlinkSync as unlinkSync2 } from "node:fs";
|
|
14732
14933
|
import { homedir as homedir3 } from "node:os";
|
|
14733
|
-
import { join as
|
|
14934
|
+
import { join as join6 } from "node:path";
|
|
14734
14935
|
|
|
14735
14936
|
// src/platform.ts
|
|
14736
14937
|
var PLATFORM_ARCH_MAP = {
|
|
@@ -14751,11 +14952,11 @@ var REPO = "cortexkit/aft";
|
|
|
14751
14952
|
function getCacheDir() {
|
|
14752
14953
|
if (process.platform === "win32") {
|
|
14753
14954
|
const localAppData = process.env.LOCALAPPDATA || process.env.APPDATA;
|
|
14754
|
-
const base2 = localAppData ||
|
|
14755
|
-
return
|
|
14955
|
+
const base2 = localAppData || join6(homedir3(), "AppData", "Local");
|
|
14956
|
+
return join6(base2, "aft", "bin");
|
|
14756
14957
|
}
|
|
14757
|
-
const base = process.env.XDG_CACHE_HOME ||
|
|
14758
|
-
return
|
|
14958
|
+
const base = process.env.XDG_CACHE_HOME || join6(homedir3(), ".cache");
|
|
14959
|
+
return join6(base, "aft", "bin");
|
|
14759
14960
|
}
|
|
14760
14961
|
function getBinaryName() {
|
|
14761
14962
|
return process.platform === "win32" ? "aft.exe" : "aft";
|
|
@@ -14763,8 +14964,8 @@ function getBinaryName() {
|
|
|
14763
14964
|
function getCachedBinaryPath(version2) {
|
|
14764
14965
|
if (!version2)
|
|
14765
14966
|
return null;
|
|
14766
|
-
const binaryPath =
|
|
14767
|
-
return
|
|
14967
|
+
const binaryPath = join6(getCacheDir(), version2, getBinaryName());
|
|
14968
|
+
return existsSync4(binaryPath) ? binaryPath : null;
|
|
14768
14969
|
}
|
|
14769
14970
|
async function downloadBinary(version2) {
|
|
14770
14971
|
const platformKey = `${process.platform}-${process.arch}`;
|
|
@@ -14778,18 +14979,18 @@ async function downloadBinary(version2) {
|
|
|
14778
14979
|
error48("Could not determine latest release version.");
|
|
14779
14980
|
return null;
|
|
14780
14981
|
}
|
|
14781
|
-
const versionedCacheDir =
|
|
14982
|
+
const versionedCacheDir = join6(getCacheDir(), tag);
|
|
14782
14983
|
const binaryName = getBinaryName();
|
|
14783
|
-
const binaryPath =
|
|
14784
|
-
if (
|
|
14984
|
+
const binaryPath = join6(versionedCacheDir, binaryName);
|
|
14985
|
+
if (existsSync4(binaryPath)) {
|
|
14785
14986
|
return binaryPath;
|
|
14786
14987
|
}
|
|
14787
14988
|
const downloadUrl = `https://github.com/${REPO}/releases/download/${tag}/${assetName}`;
|
|
14788
14989
|
const checksumUrl = `https://github.com/${REPO}/releases/download/${tag}/checksums.sha256`;
|
|
14789
14990
|
log(`Downloading AFT binary (${tag}) for ${platformKey}...`);
|
|
14790
14991
|
try {
|
|
14791
|
-
if (!
|
|
14792
|
-
|
|
14992
|
+
if (!existsSync4(versionedCacheDir)) {
|
|
14993
|
+
mkdirSync3(versionedCacheDir, { recursive: true });
|
|
14793
14994
|
}
|
|
14794
14995
|
const [binaryResponse, checksumResponse] = await Promise.all([
|
|
14795
14996
|
fetch(downloadUrl, { redirect: "follow" }),
|
|
@@ -14816,8 +15017,8 @@ async function downloadBinary(version2) {
|
|
|
14816
15017
|
}
|
|
14817
15018
|
log(`Checksum verified (SHA-256: ${actualHash.slice(0, 16)}...)`);
|
|
14818
15019
|
const tmpPath = `${binaryPath}.tmp`;
|
|
14819
|
-
const { writeFileSync } = await import("node:fs");
|
|
14820
|
-
|
|
15020
|
+
const { writeFileSync: writeFileSync2 } = await import("node:fs");
|
|
15021
|
+
writeFileSync2(tmpPath, Buffer.from(arrayBuffer));
|
|
14821
15022
|
if (process.platform !== "win32") {
|
|
14822
15023
|
chmodSync2(tmpPath, 493);
|
|
14823
15024
|
}
|
|
@@ -14829,7 +15030,7 @@ async function downloadBinary(version2) {
|
|
|
14829
15030
|
const msg = err instanceof Error ? err.message : String(err);
|
|
14830
15031
|
error48(`Failed to download AFT binary: ${msg}`);
|
|
14831
15032
|
const tmpPath = `${binaryPath}.tmp`;
|
|
14832
|
-
if (
|
|
15033
|
+
if (existsSync4(tmpPath)) {
|
|
14833
15034
|
try {
|
|
14834
15035
|
unlinkSync2(tmpPath);
|
|
14835
15036
|
} catch {}
|
|
@@ -14896,12 +15097,12 @@ function copyToVersionedCache(npmBinaryPath) {
|
|
|
14896
15097
|
const version2 = rawVersion.replace(/^aft\s+/, "");
|
|
14897
15098
|
const tag = version2.startsWith("v") ? version2 : `v${version2}`;
|
|
14898
15099
|
const cacheDir = getCacheDir();
|
|
14899
|
-
const versionedDir =
|
|
15100
|
+
const versionedDir = join7(cacheDir, tag);
|
|
14900
15101
|
const ext = process.platform === "win32" ? ".exe" : "";
|
|
14901
|
-
const cachedPath =
|
|
14902
|
-
if (
|
|
15102
|
+
const cachedPath = join7(versionedDir, `aft${ext}`);
|
|
15103
|
+
if (existsSync5(cachedPath))
|
|
14903
15104
|
return cachedPath;
|
|
14904
|
-
|
|
15105
|
+
mkdirSync4(versionedDir, { recursive: true });
|
|
14905
15106
|
const tmpPath = `${cachedPath}.tmp`;
|
|
14906
15107
|
copyFileSync(npmBinaryPath, tmpPath);
|
|
14907
15108
|
if (process.platform !== "win32") {
|
|
@@ -14946,7 +15147,7 @@ function findBinarySync() {
|
|
|
14946
15147
|
const packageBin = `@cortexkit/aft-${key}/bin/aft${ext}`;
|
|
14947
15148
|
const req = createRequire2(import.meta.url);
|
|
14948
15149
|
const resolved = req.resolve(packageBin);
|
|
14949
|
-
if (
|
|
15150
|
+
if (existsSync5(resolved)) {
|
|
14950
15151
|
const copied = copyToVersionedCache(resolved);
|
|
14951
15152
|
return copied ?? resolved;
|
|
14952
15153
|
}
|
|
@@ -14960,8 +15161,8 @@ function findBinarySync() {
|
|
|
14960
15161
|
if (result)
|
|
14961
15162
|
return result;
|
|
14962
15163
|
} catch {}
|
|
14963
|
-
const cargoPath =
|
|
14964
|
-
if (
|
|
15164
|
+
const cargoPath = join7(homedir4(), ".cargo", "bin", `aft${ext}`);
|
|
15165
|
+
if (existsSync5(cargoPath))
|
|
14965
15166
|
return cargoPath;
|
|
14966
15167
|
return null;
|
|
14967
15168
|
}
|
|
@@ -15260,6 +15461,18 @@ var ReplaceParams = Type.Object({
|
|
|
15260
15461
|
globs: Type.Optional(Type.Array(Type.String(), { description: "Include/exclude globs" })),
|
|
15261
15462
|
dryRun: Type.Optional(Type.Boolean({ description: "Preview without applying (default: false)" }))
|
|
15262
15463
|
});
|
|
15464
|
+
function appendScopeSections(response, sections, theme) {
|
|
15465
|
+
if (response.no_files_matched_scope === true) {
|
|
15466
|
+
sections.push(theme.fg("warning", "No files matched the scope (paths/globs resolved to zero files)"));
|
|
15467
|
+
}
|
|
15468
|
+
const warnings = asRecords(response.scope_warnings);
|
|
15469
|
+
const warningStrings = Array.isArray(response.scope_warnings) ? response.scope_warnings.filter((w) => typeof w === "string") : warnings.map((w) => asString(w.warning) ?? "").filter(Boolean);
|
|
15470
|
+
if (warningStrings.length > 0) {
|
|
15471
|
+
sections.push(`${theme.fg("muted", "Scope warnings:")}
|
|
15472
|
+
${warningStrings.map((w) => ` ${w}`).join(`
|
|
15473
|
+
`)}`);
|
|
15474
|
+
}
|
|
15475
|
+
}
|
|
15263
15476
|
function buildAstSearchSections(payload, theme) {
|
|
15264
15477
|
const response = asRecord2(payload);
|
|
15265
15478
|
if (!response)
|
|
@@ -15273,8 +15486,11 @@ function buildAstSearchSections(payload, theme) {
|
|
|
15273
15486
|
theme.fg("accent", `${filesWithMatches} file${filesWithMatches === 1 ? "" : "s"}`),
|
|
15274
15487
|
filesSearched !== undefined ? theme.fg("muted", `${filesSearched} searched`) : undefined
|
|
15275
15488
|
].filter(Boolean).join(" · ");
|
|
15276
|
-
if (matches.length === 0)
|
|
15277
|
-
|
|
15489
|
+
if (matches.length === 0) {
|
|
15490
|
+
const sections2 = [header, theme.fg("muted", "No AST matches found.")];
|
|
15491
|
+
appendScopeSections(response, sections2, theme);
|
|
15492
|
+
return sections2;
|
|
15493
|
+
}
|
|
15278
15494
|
const grouped = groupByFile(matches, (match) => asString(match.file));
|
|
15279
15495
|
const sections = [header];
|
|
15280
15496
|
for (const [file2, fileMatches] of grouped.entries()) {
|
|
@@ -15320,6 +15536,7 @@ function buildAstReplaceSections(payload, theme) {
|
|
|
15320
15536
|
const sections = [headerParts.filter(Boolean).join(" ")];
|
|
15321
15537
|
if (files.length === 0) {
|
|
15322
15538
|
sections.push(theme.fg("muted", "No files changed."));
|
|
15539
|
+
appendScopeSections(response, sections, theme);
|
|
15323
15540
|
return sections;
|
|
15324
15541
|
}
|
|
15325
15542
|
files.forEach((fileResult) => {
|
|
@@ -16090,7 +16307,7 @@ function registerLspTools(pi, ctx) {
|
|
|
16090
16307
|
pi.registerTool({
|
|
16091
16308
|
name: "lsp_diagnostics",
|
|
16092
16309
|
label: "lsp diagnostics",
|
|
16093
|
-
description: "
|
|
16310
|
+
description: "On-demand LSP file/scope check. Spawns the relevant language server (if registered for the extension), opens the document, prefers LSP 3.17 pull diagnostics where supported, falls back to push + waitMs otherwise. NOT a project-wide type checker — for full coverage run `tsc --noEmit`, `cargo check`, `pyright`, etc.\n\nResponse fields: `diagnostics`, `total`, `files_with_errors`, `complete` (true = trustable absence), `lsp_servers_used` (per-server status, e.g. `pull_ok`, `push_only`, `binary_not_installed: bash-language-server`, `no_root_marker (...)`), and (directory mode) `unchecked_files`.\n\nReading honestly: `total: 0` + empty `lsp_servers_used` means **nothing was checked** — install the relevant LSP server. `total: 0` + `pull_ok` means the file is genuinely clean.\n\nProvide `filePath` for a single file, `directory` for files under a path (workspace pull from active servers + 200-file walk for unchecked listing), or omit both to dump cached diagnostics.",
|
|
16094
16311
|
parameters: LspDiagnosticsParams,
|
|
16095
16312
|
async execute(_toolCallId, params, _signal, _onUpdate, extCtx) {
|
|
16096
16313
|
const hasFile = typeof params.filePath === "string" && params.filePath.length > 0;
|
|
@@ -16286,7 +16503,7 @@ import { Type as Type8 } from "@sinclair/typebox";
|
|
|
16286
16503
|
|
|
16287
16504
|
// src/shared/discover-files.ts
|
|
16288
16505
|
import { readdir } from "node:fs/promises";
|
|
16289
|
-
import { extname, join as
|
|
16506
|
+
import { extname, join as join8 } from "node:path";
|
|
16290
16507
|
var OUTLINE_EXTENSIONS = new Set([
|
|
16291
16508
|
".ts",
|
|
16292
16509
|
".tsx",
|
|
@@ -16358,12 +16575,12 @@ async function discoverSourceFiles(dir, maxFiles = 200) {
|
|
|
16358
16575
|
return;
|
|
16359
16576
|
if (entry.isDirectory()) {
|
|
16360
16577
|
if (!SKIP_DIRS.has(entry.name) && !entry.name.startsWith(".")) {
|
|
16361
|
-
await walk(
|
|
16578
|
+
await walk(join8(current, entry.name));
|
|
16362
16579
|
}
|
|
16363
16580
|
} else if (entry.isFile()) {
|
|
16364
16581
|
const ext = extname(entry.name).toLowerCase();
|
|
16365
16582
|
if (OUTLINE_EXTENSIONS.has(ext)) {
|
|
16366
|
-
files.push(
|
|
16583
|
+
files.push(join8(current, entry.name));
|
|
16367
16584
|
}
|
|
16368
16585
|
}
|
|
16369
16586
|
}
|
|
@@ -16487,14 +16704,14 @@ function registerReadingTools(pi, ctx, surface) {
|
|
|
16487
16704
|
return textResult(`No source files found under ${dirArg}`);
|
|
16488
16705
|
}
|
|
16489
16706
|
const response2 = await callBridge(bridge, "outline", { files }, extCtx);
|
|
16490
|
-
return textResult(response2
|
|
16707
|
+
return textResult(formatOutlineText(response2));
|
|
16491
16708
|
}
|
|
16492
16709
|
if (hasFiles) {
|
|
16493
16710
|
const response2 = await callBridge(bridge, "outline", { files: params.files }, extCtx);
|
|
16494
|
-
return textResult(response2
|
|
16711
|
+
return textResult(formatOutlineText(response2));
|
|
16495
16712
|
}
|
|
16496
16713
|
const response = await callBridge(bridge, "outline", { file: params.filePath }, extCtx);
|
|
16497
|
-
return textResult(response
|
|
16714
|
+
return textResult(formatOutlineText(response));
|
|
16498
16715
|
},
|
|
16499
16716
|
renderCall(args, theme, context) {
|
|
16500
16717
|
return renderOutlineCall(args, theme, context);
|
|
@@ -16538,6 +16755,20 @@ function registerReadingTools(pi, ctx, surface) {
|
|
|
16538
16755
|
});
|
|
16539
16756
|
}
|
|
16540
16757
|
}
|
|
16758
|
+
function formatOutlineText(response) {
|
|
16759
|
+
const text = response.text ?? "";
|
|
16760
|
+
const skipped = response.skipped_files;
|
|
16761
|
+
if (!skipped || skipped.length === 0) {
|
|
16762
|
+
return text;
|
|
16763
|
+
}
|
|
16764
|
+
const lines = skipped.map(({ file: file2, reason }) => ` ${file2} — ${reason}`).join(`
|
|
16765
|
+
`);
|
|
16766
|
+
const header = text.length > 0 ? `${text}
|
|
16767
|
+
|
|
16768
|
+
` : "";
|
|
16769
|
+
return `${header}Skipped ${skipped.length} file(s):
|
|
16770
|
+
${lines}`;
|
|
16771
|
+
}
|
|
16541
16772
|
|
|
16542
16773
|
// src/tools/refactor.ts
|
|
16543
16774
|
import { StringEnum as StringEnum5 } from "@mariozechner/pi-ai";
|
|
@@ -16790,7 +17021,9 @@ function registerSafetyTool(pi, ctx) {
|
|
|
16790
17021
|
// src/tools/semantic.ts
|
|
16791
17022
|
import { Type as Type11 } from "@sinclair/typebox";
|
|
16792
17023
|
var SearchParams2 = Type11.Object({
|
|
16793
|
-
query: Type11.String({
|
|
17024
|
+
query: Type11.String({
|
|
17025
|
+
description: "Concept or capability to find, phrased as a programmer would describe the code. Examples: 'fuzzy match with whitespace tolerance', 'undo backup before edit', 'retry failed network request'."
|
|
17026
|
+
}),
|
|
16794
17027
|
topK: Type11.Optional(Type11.Number({ description: "Maximum number of results (default: 10, max: 100)" }))
|
|
16795
17028
|
});
|
|
16796
17029
|
function buildSemanticSections(args, payload, theme) {
|
|
@@ -16844,7 +17077,24 @@ function registerSemanticTool(pi, ctx) {
|
|
|
16844
17077
|
pi.registerTool({
|
|
16845
17078
|
name: "aft_search",
|
|
16846
17079
|
label: "semantic search",
|
|
16847
|
-
description:
|
|
17080
|
+
description: [
|
|
17081
|
+
"Find symbols by concept when grep keywords fall short. Returns ranked code matches with similarity scores.",
|
|
17082
|
+
"",
|
|
17083
|
+
"When to reach for it:",
|
|
17084
|
+
"- Exploring an unfamiliar area: 'where is rate limiting handled', 'how does auth flow work'",
|
|
17085
|
+
"- Concept doesn't appear as a literal string: 'retry logic', 'cache invalidation', 'graceful shutdown'",
|
|
17086
|
+
"- After 2+ grep attempts that came back empty or noisy",
|
|
17087
|
+
"- You know roughly what the function does but not what it's named",
|
|
17088
|
+
"",
|
|
17089
|
+
"When NOT to use:",
|
|
17090
|
+
"- You have a specific symbol name → use grep",
|
|
17091
|
+
"- You have an error message or stack trace → use grep",
|
|
17092
|
+
"- You want the file/module structure → use aft_outline",
|
|
17093
|
+
"- You're following a call chain → use aft_navigate",
|
|
17094
|
+
"",
|
|
17095
|
+
"Scores below ~0.4 are usually weak matches; treat them as 'maybe relevant' and verify with read."
|
|
17096
|
+
].join(`
|
|
17097
|
+
`),
|
|
16848
17098
|
parameters: SearchParams2,
|
|
16849
17099
|
async execute(_toolCallId, params, _signal, _onUpdate, extCtx) {
|
|
16850
17100
|
const bridge = bridgeFor(ctx, extCtx.cwd);
|
|
@@ -17012,8 +17262,17 @@ var ALL_ONLY_TOOLS = new Set([
|
|
|
17012
17262
|
"aft_transform",
|
|
17013
17263
|
"aft_refactor"
|
|
17014
17264
|
]);
|
|
17265
|
+
function isConfigureWarning(value) {
|
|
17266
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
17267
|
+
return false;
|
|
17268
|
+
const warning = value;
|
|
17269
|
+
return (warning.kind === "formatter_not_installed" || warning.kind === "checker_not_installed" || warning.kind === "lsp_binary_missing") && typeof warning.hint === "string";
|
|
17270
|
+
}
|
|
17271
|
+
function coerceConfigureWarnings(warnings) {
|
|
17272
|
+
return warnings.filter(isConfigureWarning);
|
|
17273
|
+
}
|
|
17015
17274
|
function resolveStorageDir() {
|
|
17016
|
-
return
|
|
17275
|
+
return join9(homedir7(), ".pi", "agent", "aft");
|
|
17017
17276
|
}
|
|
17018
17277
|
function resolveToolSurface(config2) {
|
|
17019
17278
|
const surface = config2.tool_surface ?? "recommended";
|
|
@@ -17098,13 +17357,31 @@ async function src_default(pi) {
|
|
|
17098
17357
|
}
|
|
17099
17358
|
const configOverrides = {
|
|
17100
17359
|
...config2,
|
|
17360
|
+
...resolveLspConfigForConfigure(config2),
|
|
17101
17361
|
restrict_to_project_root: config2.restrict_to_project_root ?? true,
|
|
17102
17362
|
storage_dir: storageDir
|
|
17103
17363
|
};
|
|
17364
|
+
delete configOverrides.lsp;
|
|
17104
17365
|
if (ortDylibDir) {
|
|
17105
17366
|
configOverrides._ort_dylib_dir = ortDylibDir;
|
|
17106
17367
|
}
|
|
17107
|
-
const pool = new BridgePool(binaryPath, {
|
|
17368
|
+
const pool = new BridgePool(binaryPath, {
|
|
17369
|
+
minVersion: PLUGIN_VERSION,
|
|
17370
|
+
onConfigureWarnings: async ({ projectRoot, sessionId, client, warnings }) => {
|
|
17371
|
+
if (!sessionId || !client)
|
|
17372
|
+
return;
|
|
17373
|
+
const validWarnings = coerceConfigureWarnings(warnings);
|
|
17374
|
+
if (validWarnings.length === 0)
|
|
17375
|
+
return;
|
|
17376
|
+
await deliverConfigureWarnings({
|
|
17377
|
+
client,
|
|
17378
|
+
sessionId,
|
|
17379
|
+
storageDir,
|
|
17380
|
+
pluginVersion: PLUGIN_VERSION,
|
|
17381
|
+
projectRoot
|
|
17382
|
+
}, validWarnings);
|
|
17383
|
+
}
|
|
17384
|
+
}, configOverrides);
|
|
17108
17385
|
const ctx = { pool, config: config2, storageDir };
|
|
17109
17386
|
const surface = resolveToolSurface(config2);
|
|
17110
17387
|
registerHoistedTools(pi, ctx, surface);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface ConfigureWarning {
|
|
2
|
+
kind: "formatter_not_installed" | "checker_not_installed" | "lsp_binary_missing";
|
|
3
|
+
language?: string;
|
|
4
|
+
server?: string;
|
|
5
|
+
tool?: string;
|
|
6
|
+
binary?: string;
|
|
7
|
+
hint: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ConfigureWarningOptions {
|
|
10
|
+
client: unknown;
|
|
11
|
+
sessionId: string;
|
|
12
|
+
storageDir: string;
|
|
13
|
+
pluginVersion: string;
|
|
14
|
+
projectRoot?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function deliverConfigureWarnings(opts: ConfigureWarningOptions, warnings: ConfigureWarning[]): Promise<void>;
|
|
17
|
+
//# sourceMappingURL=notifications.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../src/notifications.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,yBAAyB,GAAG,uBAAuB,GAAG,oBAAoB,CAAC;IACjF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AA0FD,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,uBAAuB,EAC7B,QAAQ,EAAE,gBAAgB,EAAE,GAC3B,OAAO,CAAC,IAAI,CAAC,CAqBf"}
|
package/dist/pool.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pool.d.ts","sourceRoot":"","sources":["../src/pool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAY/D,MAAM,WAAW,WA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AQ,CAAC,CAE3B;AAED,8DAA8D;AAC9D,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAGvF"}
|
package/dist/tools/ast.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import type { PluginContext } from "../types.js";
|
|
|
8
8
|
import { type RenderContextLike } from "./render-helpers.js";
|
|
9
9
|
declare const SearchParams: import("@sinclair/typebox").TObject<{
|
|
10
10
|
pattern: import("@sinclair/typebox").TString;
|
|
11
|
-
lang: import("@sinclair/typebox").TUnsafe<"go" | "
|
|
11
|
+
lang: import("@sinclair/typebox").TUnsafe<"go" | "python" | "typescript" | "tsx" | "javascript" | "rust">;
|
|
12
12
|
paths: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
|
13
13
|
globs: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
|
14
14
|
contextLines: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
@@ -16,7 +16,7 @@ declare const SearchParams: import("@sinclair/typebox").TObject<{
|
|
|
16
16
|
declare const ReplaceParams: import("@sinclair/typebox").TObject<{
|
|
17
17
|
pattern: import("@sinclair/typebox").TString;
|
|
18
18
|
rewrite: import("@sinclair/typebox").TString;
|
|
19
|
-
lang: import("@sinclair/typebox").TUnsafe<"go" | "
|
|
19
|
+
lang: import("@sinclair/typebox").TUnsafe<"go" | "python" | "typescript" | "tsx" | "javascript" | "rust">;
|
|
20
20
|
paths: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
|
21
21
|
globs: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
|
22
22
|
dryRun: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
package/dist/tools/ast.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../../src/tools/ast.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAC1F,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,EASL,KAAK,iBAAiB,EAMvB,MAAM,qBAAqB,CAAC;AAM7B,QAAA,MAAM,YAAY;;;;;;EAehB,CAAC;AAEH,QAAA,MAAM,aAAa;;;;;;;EAOjB,CAAC;AAEH,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;CACrB;
|
|
1
|
+
{"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../../src/tools/ast.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAC1F,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,EASL,KAAK,iBAAiB,EAMvB,MAAM,qBAAqB,CAAC;AAM7B,QAAA,MAAM,YAAY;;;;;;EAehB,CAAC;AAEH,QAAA,MAAM,aAAa;;;;;;;EAOjB,CAAC;AAEH,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;CACrB;AAqBD,wCAAwC;AACxC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG,MAAM,EAAE,CAoD/E;AAED,wCAAwC;AACxC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG,MAAM,EAAE,CAkDhF;AAED,wCAAwC;AACxC,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,iBAAiB,GAAG,kBAAkB,EAChD,IAAI,EAAE,MAAM,CAAC,OAAO,YAAY,CAAC,GAAG,MAAM,CAAC,OAAO,aAAa,CAAC,EAChE,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,iBAAiB,uCAa3B;AAED,wCAAwC;AACxC,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,iBAAiB,GAAG,kBAAkB,EAChD,MAAM,EAAE,eAAe,CAAC,OAAO,CAAC,EAChC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,iBAAiB,kFAiB3B;AAED,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,YAAY,EAAE,GAAG,EAAE,aAAa,EAAE,OAAO,EAAE,UAAU,GAAG,IAAI,CAsEhG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"semantic.d.ts","sourceRoot":"","sources":["../../src/tools/semantic.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAC1F,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,EAOL,KAAK,iBAAiB,EAKvB,MAAM,qBAAqB,CAAC;AAE7B,QAAA,MAAM,YAAY;;;
|
|
1
|
+
{"version":3,"file":"semantic.d.ts","sourceRoot":"","sources":["../../src/tools/semantic.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAC1F,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,EAOL,KAAK,iBAAiB,EAKvB,MAAM,qBAAqB,CAAC;AAE7B,QAAA,MAAM,YAAY;;;EAQhB,CAAC;AAEH,wCAAwC;AACxC,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,CAAC,OAAO,YAAY,CAAC,EACjC,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,GACX,MAAM,EAAE,CA6CV;AAED,wCAAwC;AACxC,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,CAAC,OAAO,YAAY,CAAC,EACjC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,iBAAiB,uCAG3B;AAED,wCAAwC;AACxC,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,eAAe,CAAC,OAAO,CAAC,EAChC,IAAI,EAAE,MAAM,CAAC,OAAO,YAAY,CAAC,EACjC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,iBAAiB,kFAO3B;AAED,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,YAAY,EAAE,GAAG,EAAE,aAAa,GAAG,IAAI,CA0C/E"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortexkit/aft-pi",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
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",
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
"zod": "^4.1.8"
|
|
27
27
|
},
|
|
28
28
|
"optionalDependencies": {
|
|
29
|
-
"@cortexkit/aft-darwin-arm64": "0.
|
|
30
|
-
"@cortexkit/aft-darwin-x64": "0.
|
|
31
|
-
"@cortexkit/aft-linux-arm64": "0.
|
|
32
|
-
"@cortexkit/aft-linux-x64": "0.
|
|
33
|
-
"@cortexkit/aft-win32-x64": "0.
|
|
29
|
+
"@cortexkit/aft-darwin-arm64": "0.16.0",
|
|
30
|
+
"@cortexkit/aft-darwin-x64": "0.16.0",
|
|
31
|
+
"@cortexkit/aft-linux-arm64": "0.16.0",
|
|
32
|
+
"@cortexkit/aft-linux-x64": "0.16.0",
|
|
33
|
+
"@cortexkit/aft-win32-x64": "0.16.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@mariozechner/pi-coding-agent": "*",
|