@superbfowle/bash-history-mcp-test 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Plugin } from "@opencode-ai/plugin";
|
|
2
2
|
|
|
3
|
-
export const OpencodeBashHistoryPlugin: Plugin = async ({
|
|
3
|
+
export const OpencodeBashHistoryPlugin: Plugin = async ({ client }) => {
|
|
4
4
|
return {
|
|
5
5
|
"tool.execute.after": async (input, output) => {
|
|
6
6
|
if (input.tool !== "bash") {
|
|
@@ -23,7 +23,12 @@ export const OpencodeBashHistoryPlugin: Plugin = async ({ $ }) => {
|
|
|
23
23
|
const startExitCode = await startProc.exited;
|
|
24
24
|
if (startExitCode !== 0) {
|
|
25
25
|
const stderr = await Bun.readableStreamToText(startProc.stderr);
|
|
26
|
-
await
|
|
26
|
+
await client.app.log({
|
|
27
|
+
service: "bash-history",
|
|
28
|
+
level: "error",
|
|
29
|
+
message: "Failed to start atuin history entry",
|
|
30
|
+
extra: { error: stderr }
|
|
31
|
+
});
|
|
27
32
|
return;
|
|
28
33
|
}
|
|
29
34
|
|
|
@@ -48,10 +53,20 @@ export const OpencodeBashHistoryPlugin: Plugin = async ({ $ }) => {
|
|
|
48
53
|
const endExitCode = await endProc.exited;
|
|
49
54
|
if (endExitCode !== 0) {
|
|
50
55
|
const stderr = await Bun.readableStreamToText(endProc.stderr);
|
|
51
|
-
await
|
|
56
|
+
await client.app.log({
|
|
57
|
+
service: "bash-history",
|
|
58
|
+
level: "error",
|
|
59
|
+
message: "Failed to end atuin history entry",
|
|
60
|
+
extra: { error: stderr }
|
|
61
|
+
});
|
|
52
62
|
}
|
|
53
63
|
} catch (error) {
|
|
54
|
-
await
|
|
64
|
+
await client.app.log({
|
|
65
|
+
service: "bash-history",
|
|
66
|
+
level: "error",
|
|
67
|
+
message: "Bash history plugin error",
|
|
68
|
+
extra: { error: String(error) }
|
|
69
|
+
});
|
|
55
70
|
}
|
|
56
71
|
},
|
|
57
72
|
};
|