@superbfowle/bash-history-mcp-test 0.1.3 → 0.1.5
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/index.ts +6 -0
- package/{opencode-plugin.ts → opencode.ts} +11 -4
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
|
|
3
|
+
import { OpencodeBashHistoryPlugin } from './opencode'
|
|
4
|
+
|
|
3
5
|
/**
|
|
4
6
|
* Claude Code PostToolUse hook for atuin integration
|
|
5
7
|
* Adds bash commands to atuin history
|
|
@@ -70,3 +72,7 @@ async function main() {
|
|
|
70
72
|
}
|
|
71
73
|
|
|
72
74
|
main();
|
|
75
|
+
|
|
76
|
+
export const opencodePlugins = {
|
|
77
|
+
OpencodeBashHistoryPlugin
|
|
78
|
+
}
|
|
@@ -3,6 +3,13 @@ import type { Plugin } from "@opencode-ai/plugin";
|
|
|
3
3
|
export const OpencodeBashHistoryPlugin: Plugin = async ({ client }) => {
|
|
4
4
|
return {
|
|
5
5
|
"tool.execute.after": async (input, output) => {
|
|
6
|
+
await client.app.log({
|
|
7
|
+
service: "bash-history",
|
|
8
|
+
level: "info",
|
|
9
|
+
message: "Bash-history debug",
|
|
10
|
+
extra: { input, output },
|
|
11
|
+
});
|
|
12
|
+
|
|
6
13
|
if (input.tool !== "bash") {
|
|
7
14
|
return;
|
|
8
15
|
}
|
|
@@ -27,7 +34,7 @@ export const OpencodeBashHistoryPlugin: Plugin = async ({ client }) => {
|
|
|
27
34
|
service: "bash-history",
|
|
28
35
|
level: "error",
|
|
29
36
|
message: "Failed to start atuin history entry",
|
|
30
|
-
extra: { error: stderr }
|
|
37
|
+
extra: { error: stderr },
|
|
31
38
|
});
|
|
32
39
|
return;
|
|
33
40
|
}
|
|
@@ -47,7 +54,7 @@ export const OpencodeBashHistoryPlugin: Plugin = async ({ client }) => {
|
|
|
47
54
|
],
|
|
48
55
|
{
|
|
49
56
|
stderr: "pipe",
|
|
50
|
-
}
|
|
57
|
+
},
|
|
51
58
|
);
|
|
52
59
|
|
|
53
60
|
const endExitCode = await endProc.exited;
|
|
@@ -57,7 +64,7 @@ export const OpencodeBashHistoryPlugin: Plugin = async ({ client }) => {
|
|
|
57
64
|
service: "bash-history",
|
|
58
65
|
level: "error",
|
|
59
66
|
message: "Failed to end atuin history entry",
|
|
60
|
-
extra: { error: stderr }
|
|
67
|
+
extra: { error: stderr },
|
|
61
68
|
});
|
|
62
69
|
}
|
|
63
70
|
} catch (error) {
|
|
@@ -65,7 +72,7 @@ export const OpencodeBashHistoryPlugin: Plugin = async ({ client }) => {
|
|
|
65
72
|
service: "bash-history",
|
|
66
73
|
level: "error",
|
|
67
74
|
message: "Bash history plugin error",
|
|
68
|
-
extra: { error: String(error) }
|
|
75
|
+
extra: { error: String(error) },
|
|
69
76
|
});
|
|
70
77
|
}
|
|
71
78
|
},
|