@cortexkit/aft 0.35.3 → 0.36.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/README.md +4 -4
- package/dist/index.js +94 -63
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -5,10 +5,10 @@ Unified CLI for [Agent File Tools (AFT)](https://github.com/cortexkit/aft) — s
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npx @cortexkit/aft setup # interactive setup for one or more harnesses
|
|
9
|
-
npx @cortexkit/aft doctor # check and fix configuration issues
|
|
10
|
-
npx @cortexkit/aft doctor --force # force clear plugin cache
|
|
11
|
-
npx @cortexkit/aft doctor --issue # collect diagnostics and open a GitHub issue
|
|
8
|
+
npx @cortexkit/aft@latest setup # interactive setup for one or more harnesses
|
|
9
|
+
npx @cortexkit/aft@latest doctor # check and fix configuration issues
|
|
10
|
+
npx @cortexkit/aft@latest doctor --force # force clear plugin cache
|
|
11
|
+
npx @cortexkit/aft@latest doctor --issue # collect diagnostics and open a GitHub issue
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
By default the CLI auto-detects which harnesses are installed on your system (OpenCode, Pi). When multiple are detected, it prompts you to choose. Use `--harness opencode` or `--harness pi` to target one explicitly.
|
package/dist/index.js
CHANGED
|
@@ -326,6 +326,9 @@ var init_bridge = __esm(() => {
|
|
|
326
326
|
hasPendingRequests() {
|
|
327
327
|
return this.pending.size > 0;
|
|
328
328
|
}
|
|
329
|
+
getCwd() {
|
|
330
|
+
return this.cwd;
|
|
331
|
+
}
|
|
329
332
|
getCachedStatus() {
|
|
330
333
|
return this.cachedStatus;
|
|
331
334
|
}
|
|
@@ -669,6 +672,7 @@ var init_bridge = __esm(() => {
|
|
|
669
672
|
const remaining = stdoutDecoder.end();
|
|
670
673
|
if (remaining)
|
|
671
674
|
this.onStdoutData(remaining);
|
|
675
|
+
this.flushStdoutBuffer();
|
|
672
676
|
});
|
|
673
677
|
const stderrDecoder = new StringDecoder("utf8");
|
|
674
678
|
child.stderr?.on("data", (chunk) => {
|
|
@@ -691,6 +695,7 @@ var init_bridge = __esm(() => {
|
|
|
691
695
|
return;
|
|
692
696
|
if (this._shuttingDown)
|
|
693
697
|
return;
|
|
698
|
+
this.flushStdoutBuffer();
|
|
694
699
|
this.logVia(`Process exited: code=${code}, signal=${signal}`);
|
|
695
700
|
if (signal === "SIGTERM" || signal === "SIGKILL" || signal === "SIGHUP" || signal === "SIGINT") {
|
|
696
701
|
this.process = null;
|
|
@@ -759,71 +764,81 @@ var init_bridge = __esm(() => {
|
|
|
759
764
|
this.stdoutBuffer = this.stdoutBuffer.slice(newlineIdx + 1);
|
|
760
765
|
if (!line)
|
|
761
766
|
continue;
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
}
|
|
796
|
-
if (response.type === "bash_pattern_match") {
|
|
797
|
-
this.onBashPatternMatch?.(response, this);
|
|
798
|
-
continue;
|
|
799
|
-
}
|
|
800
|
-
if (response.type === "configure_warnings") {
|
|
801
|
-
this.handleConfigureWarningsFrame(response).catch((err) => {
|
|
802
|
-
this.warnVia(`configure warning delivery failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
767
|
+
this.processStdoutLine(line);
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
flushStdoutBuffer() {
|
|
771
|
+
const line = this.stdoutBuffer.trim();
|
|
772
|
+
this.stdoutBuffer = "";
|
|
773
|
+
if (!line)
|
|
774
|
+
return;
|
|
775
|
+
this.processStdoutLine(line);
|
|
776
|
+
}
|
|
777
|
+
processStdoutLine(line) {
|
|
778
|
+
try {
|
|
779
|
+
const response = JSON.parse(line);
|
|
780
|
+
this.lastChildActivityAt = Date.now();
|
|
781
|
+
if (response.type === "progress") {
|
|
782
|
+
const requestId = response.request_id;
|
|
783
|
+
const entry = requestId ? this.pending.get(requestId) : undefined;
|
|
784
|
+
const kind = response.kind === "stderr" ? "stderr" : "stdout";
|
|
785
|
+
const text = typeof response.chunk === "string" ? response.chunk : "";
|
|
786
|
+
entry?.onProgress?.({ kind, text });
|
|
787
|
+
return;
|
|
788
|
+
}
|
|
789
|
+
if (response.type === "permission_ask") {
|
|
790
|
+
const requestId = response.request_id;
|
|
791
|
+
const entry = requestId ? this.pending.get(requestId) : undefined;
|
|
792
|
+
if (requestId && entry) {
|
|
793
|
+
this.pending.delete(requestId);
|
|
794
|
+
clearTimeout(entry.timer);
|
|
795
|
+
entry.resolve({
|
|
796
|
+
success: false,
|
|
797
|
+
code: "permission_required",
|
|
798
|
+
message: "bash command requires permission",
|
|
799
|
+
asks: response.asks
|
|
803
800
|
});
|
|
804
|
-
continue;
|
|
805
801
|
}
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
this.
|
|
823
|
-
}
|
|
824
|
-
|
|
825
|
-
|
|
802
|
+
return;
|
|
803
|
+
}
|
|
804
|
+
if (response.type === "bash_completed") {
|
|
805
|
+
this.onBashCompletion?.(response, this);
|
|
806
|
+
return;
|
|
807
|
+
}
|
|
808
|
+
if (response.type === "bash_long_running") {
|
|
809
|
+
this.onBashLongRunning?.(response, this);
|
|
810
|
+
return;
|
|
811
|
+
}
|
|
812
|
+
if (response.type === "bash_pattern_match") {
|
|
813
|
+
this.onBashPatternMatch?.(response, this);
|
|
814
|
+
return;
|
|
815
|
+
}
|
|
816
|
+
if (response.type === "configure_warnings") {
|
|
817
|
+
this.handleConfigureWarningsFrame(response).catch((err) => {
|
|
818
|
+
this.warnVia(`configure warning delivery failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
819
|
+
});
|
|
820
|
+
return;
|
|
821
|
+
}
|
|
822
|
+
if (response.type === "status_changed") {
|
|
823
|
+
this.handleStatusChangedFrame(response);
|
|
824
|
+
return;
|
|
826
825
|
}
|
|
826
|
+
const id = response.id;
|
|
827
|
+
if (id && this.pending.has(id)) {
|
|
828
|
+
const entry = this.pending.get(id);
|
|
829
|
+
if (!entry)
|
|
830
|
+
return;
|
|
831
|
+
this.pending.delete(id);
|
|
832
|
+
clearTimeout(entry.timer);
|
|
833
|
+
this.consecutiveRequestTimeouts = 0;
|
|
834
|
+
this.scheduleRestartCountReset();
|
|
835
|
+
this.captureStatusBar(response);
|
|
836
|
+
entry.resolve(response);
|
|
837
|
+
} else if (typeof response.type === "string") {
|
|
838
|
+
this.logVia(`Ignoring unknown stdout push frame type: ${response.type}`);
|
|
839
|
+
}
|
|
840
|
+
} catch (_err) {
|
|
841
|
+
this.warnVia(`Failed to parse stdout line: ${line}`);
|
|
827
842
|
}
|
|
828
843
|
}
|
|
829
844
|
captureStatusBar(response) {
|
|
@@ -912,7 +927,6 @@ var init_bridge = __esm(() => {
|
|
|
912
927
|
}
|
|
913
928
|
};
|
|
914
929
|
});
|
|
915
|
-
|
|
916
930
|
// ../aft-bridge/dist/platform.js
|
|
917
931
|
var init_platform = () => {};
|
|
918
932
|
|
|
@@ -1133,6 +1147,22 @@ var init_onnx_runtime = __esm(() => {
|
|
|
1133
1147
|
};
|
|
1134
1148
|
});
|
|
1135
1149
|
|
|
1150
|
+
// ../aft-bridge/dist/pipe-strip.js
|
|
1151
|
+
var NOISE_FILTERS, GREP_GUARD_FLAGS;
|
|
1152
|
+
var init_pipe_strip = __esm(() => {
|
|
1153
|
+
NOISE_FILTERS = new Set(["grep", "rg", "head", "tail", "cat", "less", "more"]);
|
|
1154
|
+
GREP_GUARD_FLAGS = new Set([
|
|
1155
|
+
"c",
|
|
1156
|
+
"count",
|
|
1157
|
+
"q",
|
|
1158
|
+
"quiet",
|
|
1159
|
+
"o",
|
|
1160
|
+
"only-matching",
|
|
1161
|
+
"l",
|
|
1162
|
+
"files-with-matches"
|
|
1163
|
+
]);
|
|
1164
|
+
});
|
|
1165
|
+
|
|
1136
1166
|
// ../aft-bridge/dist/pool.js
|
|
1137
1167
|
import { realpathSync } from "node:fs";
|
|
1138
1168
|
|
|
@@ -1324,6 +1354,7 @@ var init_dist = __esm(() => {
|
|
|
1324
1354
|
init_npm_resolver();
|
|
1325
1355
|
init_onnx_runtime();
|
|
1326
1356
|
init_paths();
|
|
1357
|
+
init_pipe_strip();
|
|
1327
1358
|
init_platform();
|
|
1328
1359
|
init_pool();
|
|
1329
1360
|
init_resolver();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortexkit/aft",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.36.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Unified CLI for Agent File Tools (AFT) — setup, doctor, and diagnostics across supported agent harnesses (OpenCode, Pi)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@clack/prompts": "^1.2.0",
|
|
27
|
-
"@cortexkit/aft-bridge": "0.
|
|
27
|
+
"@cortexkit/aft-bridge": "0.36.0",
|
|
28
28
|
"comment-json": "^4.6.2"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|