@cortexkit/aft-pi 0.29.1 → 0.30.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/bg-notifications.d.ts +56 -0
- package/dist/bg-notifications.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4401 -68
- package/dist/shared/pty-cache.d.ts +18 -0
- package/dist/shared/pty-cache.d.ts.map +1 -0
- package/dist/tools/bash.d.ts +67 -1
- package/dist/tools/bash.d.ts.map +1 -1
- package/dist/workflow-hints.d.ts.map +1 -1
- package/package.json +10 -9
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as fs from "node:fs/promises";
|
|
2
|
+
import { Terminal } from "@xterm/headless";
|
|
3
|
+
export interface PtyTerminalState {
|
|
4
|
+
terminal: Terminal;
|
|
5
|
+
fileHandle: fs.FileHandle;
|
|
6
|
+
offset: number;
|
|
7
|
+
rows: number;
|
|
8
|
+
cols: number;
|
|
9
|
+
lastAccessMs: number;
|
|
10
|
+
}
|
|
11
|
+
export declare function getOrCreatePtyTerminal(key: string, outputPath: string, rows?: number, cols?: number): Promise<PtyTerminalState>;
|
|
12
|
+
export declare function readPtyBytes(state: PtyTerminalState): Promise<Buffer>;
|
|
13
|
+
export declare function disposePtyTerminal(key: string): Promise<void>;
|
|
14
|
+
export declare function disposeAllPtyTerminals(): Promise<void>;
|
|
15
|
+
export declare function renderScreen(state: PtyTerminalState, rows?: number, cols?: number): string;
|
|
16
|
+
export declare function __resetPtyCacheForTests(): void;
|
|
17
|
+
export declare function __ptyCacheSizeForTests(): number;
|
|
18
|
+
//# sourceMappingURL=pty-cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pty-cache.d.ts","sourceRoot":"","sources":["../../src/shared/pty-cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAM3C,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;CACtB;AAID,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,MAAM,EAClB,IAAI,SAAe,EACnB,IAAI,SAAe,GAClB,OAAO,CAAC,gBAAgB,CAAC,CAuB3B;AAED,wBAAsB,YAAY,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CAa3E;AAED,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAMnE;AAED,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC,CAE5D;AAED,wBAAgB,YAAY,CAC1B,KAAK,EAAE,gBAAgB,EACvB,IAAI,SAAa,EACjB,IAAI,SAAa,GAChB,MAAM,CAiBR;AAED,wBAAgB,uBAAuB,IAAI,IAAI,CAM9C;AAED,wBAAgB,sBAAsB,IAAI,MAAM,CAE/C"}
|
package/dist/tools/bash.d.ts
CHANGED
|
@@ -4,6 +4,31 @@ import type { PluginContext } from "../types.js";
|
|
|
4
4
|
declare const BashTaskParams: Type.TObject<{
|
|
5
5
|
task_id: Type.TString;
|
|
6
6
|
}>;
|
|
7
|
+
declare const BashStatusParams: Type.TObject<{
|
|
8
|
+
task_id: Type.TString;
|
|
9
|
+
output_mode: Type.TOptional<Type.TUnion<[Type.TLiteral<"screen">, Type.TLiteral<"raw">, Type.TLiteral<"both">]>>;
|
|
10
|
+
}>;
|
|
11
|
+
declare const BashWatchParams: Type.TObject<{
|
|
12
|
+
task_id: Type.TString;
|
|
13
|
+
pattern: Type.TOptional<Type.TUnion<[Type.TString, Type.TObject<{
|
|
14
|
+
regex: Type.TString;
|
|
15
|
+
}>]>>;
|
|
16
|
+
background: Type.TOptional<Type.TBoolean>;
|
|
17
|
+
timeout_ms: Type.TOptional<Type.TInteger>;
|
|
18
|
+
once: Type.TOptional<Type.TBoolean>;
|
|
19
|
+
}>;
|
|
20
|
+
declare const BashWriteParams: Type.TObject<{
|
|
21
|
+
task_id: Type.TString;
|
|
22
|
+
input: Type.TUnion<[Type.TString, Type.TArray<Type.TUnion<[Type.TString, Type.TObject<{
|
|
23
|
+
key: Type.TString;
|
|
24
|
+
}>]>>]>;
|
|
25
|
+
}>;
|
|
26
|
+
interface BashStatusWaited {
|
|
27
|
+
reason: "matched" | "exited" | "timeout";
|
|
28
|
+
elapsed_ms: number;
|
|
29
|
+
match?: string;
|
|
30
|
+
match_offset?: number;
|
|
31
|
+
}
|
|
7
32
|
interface BashStatusDetails {
|
|
8
33
|
success: boolean;
|
|
9
34
|
status: string;
|
|
@@ -11,11 +36,22 @@ interface BashStatusDetails {
|
|
|
11
36
|
duration_ms?: number;
|
|
12
37
|
output_preview?: string;
|
|
13
38
|
command?: string;
|
|
39
|
+
mode?: string;
|
|
40
|
+
output_path?: string;
|
|
41
|
+
pty_rows?: number;
|
|
42
|
+
pty_cols?: number;
|
|
43
|
+
waited?: BashStatusWaited;
|
|
44
|
+
}
|
|
45
|
+
interface BashWriteDetails {
|
|
46
|
+
success: boolean;
|
|
47
|
+
bytes_written?: number;
|
|
14
48
|
}
|
|
15
49
|
interface BashKillDetails {
|
|
16
50
|
success: boolean;
|
|
17
51
|
status: string;
|
|
18
52
|
}
|
|
53
|
+
interface BashWatchDetails extends Record<string, unknown> {
|
|
54
|
+
}
|
|
19
55
|
export declare function registerBashTool(pi: ExtensionAPI, ctx: PluginContext): void;
|
|
20
56
|
export declare function createBashStatusTool(ctx: PluginContext): {
|
|
21
57
|
name: string;
|
|
@@ -24,8 +60,38 @@ export declare function createBashStatusTool(ctx: PluginContext): {
|
|
|
24
60
|
promptSnippet: string;
|
|
25
61
|
parameters: Type.TObject<{
|
|
26
62
|
task_id: Type.TString;
|
|
63
|
+
output_mode: Type.TOptional<Type.TUnion<[Type.TLiteral<"screen">, Type.TLiteral<"raw">, Type.TLiteral<"both">]>>;
|
|
64
|
+
}>;
|
|
65
|
+
execute(_toolCallId: string, params: Static<typeof BashStatusParams>, _signal: AbortSignal | undefined, _onUpdate: ((update: AgentToolResult<BashStatusDetails>) => void) | undefined, extCtx: ExtensionContext): Promise<AgentToolResult<BashStatusDetails>>;
|
|
66
|
+
};
|
|
67
|
+
export declare function createBashWatchTool(ctx: PluginContext): {
|
|
68
|
+
name: string;
|
|
69
|
+
label: string;
|
|
70
|
+
description: string;
|
|
71
|
+
promptSnippet: string;
|
|
72
|
+
parameters: Type.TObject<{
|
|
73
|
+
task_id: Type.TString;
|
|
74
|
+
pattern: Type.TOptional<Type.TUnion<[Type.TString, Type.TObject<{
|
|
75
|
+
regex: Type.TString;
|
|
76
|
+
}>]>>;
|
|
77
|
+
background: Type.TOptional<Type.TBoolean>;
|
|
78
|
+
timeout_ms: Type.TOptional<Type.TInteger>;
|
|
79
|
+
once: Type.TOptional<Type.TBoolean>;
|
|
80
|
+
}>;
|
|
81
|
+
execute(_toolCallId: string, params: Static<typeof BashWatchParams>, _signal: AbortSignal | undefined, _onUpdate: ((update: AgentToolResult<BashWatchDetails>) => void) | undefined, extCtx: ExtensionContext): Promise<AgentToolResult<BashWatchDetails>>;
|
|
82
|
+
};
|
|
83
|
+
export declare function createBashWriteTool(ctx: PluginContext): {
|
|
84
|
+
name: string;
|
|
85
|
+
label: string;
|
|
86
|
+
description: string;
|
|
87
|
+
promptSnippet: string;
|
|
88
|
+
parameters: Type.TObject<{
|
|
89
|
+
task_id: Type.TString;
|
|
90
|
+
input: Type.TUnion<[Type.TString, Type.TArray<Type.TUnion<[Type.TString, Type.TObject<{
|
|
91
|
+
key: Type.TString;
|
|
92
|
+
}>]>>]>;
|
|
27
93
|
}>;
|
|
28
|
-
execute(_toolCallId: string, params: Static<typeof
|
|
94
|
+
execute(_toolCallId: string, params: Static<typeof BashWriteParams>, _signal: AbortSignal | undefined, _onUpdate: ((update: AgentToolResult<BashWriteDetails>) => void) | undefined, extCtx: ExtensionContext): Promise<AgentToolResult<BashWriteDetails>>;
|
|
29
95
|
};
|
|
30
96
|
export declare function createBashKillTool(ctx: PluginContext): {
|
|
31
97
|
name: string;
|
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":"AAEA,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACZ,gBAAgB,EAEjB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,KAAK,MAAM,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAgB5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AA8FjD,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,EA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AC,GAAG,SAAS,UACpE,gBAAgB;EAe7B;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,aAAa;;;;;;;;yBASlC,MAAM,UACX,MAAM,CAAC,OAAO,cAAc,CAAC,WAC5B,WAAW,GAAG,SAAS,aACrB,CAAC,CAAC,MAAM,EAAE,eAAe,CAAC,eAAe,CAAC,KAAK,IAAI,CAAC,GAAG,SAAS,UACnE,gBAAgB;EAe7B"}
|
|
@@ -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,CA8DzE;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,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,CA8BN"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortexkit/aft-pi",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.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",
|
|
@@ -22,19 +22,20 @@
|
|
|
22
22
|
"prepublishOnly": "bun run build"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@cortexkit/aft-bridge": "0.
|
|
26
|
-
"
|
|
25
|
+
"@cortexkit/aft-bridge": "0.30.0",
|
|
26
|
+
"@xterm/headless": "^5.5.0",
|
|
27
27
|
"comment-json": "^5.0.0",
|
|
28
28
|
"diff": "^8.0.4",
|
|
29
|
+
"typebox": "^1.1.24",
|
|
29
30
|
"zod": "^4.1.8"
|
|
30
31
|
},
|
|
31
32
|
"optionalDependencies": {
|
|
32
|
-
"@cortexkit/aft-darwin-arm64": "0.
|
|
33
|
-
"@cortexkit/aft-darwin-x64": "0.
|
|
34
|
-
"@cortexkit/aft-linux-arm64": "0.
|
|
35
|
-
"@cortexkit/aft-linux-x64": "0.
|
|
36
|
-
"@cortexkit/aft-win32-arm64": "0.
|
|
37
|
-
"@cortexkit/aft-win32-x64": "0.
|
|
33
|
+
"@cortexkit/aft-darwin-arm64": "0.30.0",
|
|
34
|
+
"@cortexkit/aft-darwin-x64": "0.30.0",
|
|
35
|
+
"@cortexkit/aft-linux-arm64": "0.30.0",
|
|
36
|
+
"@cortexkit/aft-linux-x64": "0.30.0",
|
|
37
|
+
"@cortexkit/aft-win32-arm64": "0.30.0",
|
|
38
|
+
"@cortexkit/aft-win32-x64": "0.30.0"
|
|
38
39
|
},
|
|
39
40
|
"devDependencies": {
|
|
40
41
|
"@earendil-works/pi-coding-agent": "*",
|