@wibeco/bridge 0.1.1 → 0.1.2
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/cli.js +11 -1
- package/package.json +1 -1
- package/templates/cursor/README.md +2 -0
- package/templates/cursor/hooks.json.example +22 -11
package/dist/cli.js
CHANGED
|
@@ -37,6 +37,11 @@ async function main() {
|
|
|
37
37
|
const eventName = option(args, "--event");
|
|
38
38
|
if (!eventName) throw new Error("--event is required");
|
|
39
39
|
result = await emitCommand(adapter, eventName, await readJsonStdin());
|
|
40
|
+
process.stderr.write(`${result.message}
|
|
41
|
+
`);
|
|
42
|
+
process.stdout.write("{}\n");
|
|
43
|
+
process.exitCode = 0;
|
|
44
|
+
return;
|
|
40
45
|
} else if (command === "doctor") {
|
|
41
46
|
result = await doctorCommand(process.cwd(), option(args, "--repository"));
|
|
42
47
|
} else {
|
|
@@ -69,5 +74,10 @@ async function readJsonStdin() {
|
|
|
69
74
|
main().catch((error) => {
|
|
70
75
|
process.stderr.write(`wibe-bridge: ${error instanceof Error ? error.message : String(error)}
|
|
71
76
|
`);
|
|
72
|
-
process.
|
|
77
|
+
if (process.argv[2] === "emit") {
|
|
78
|
+
process.stdout.write("{}\n");
|
|
79
|
+
process.exitCode = 0;
|
|
80
|
+
} else {
|
|
81
|
+
process.exitCode = 1;
|
|
82
|
+
}
|
|
73
83
|
});
|
package/package.json
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
These files are reviewable setup templates. Wibe installs them only when the destination does not
|
|
4
4
|
already exist; otherwise merge `hooks.json.example` into `.cursor/hooks.json` yourself. Hook commands
|
|
5
5
|
run `npx -y @wibeco/bridge@latest emit`, which normalizes, redacts, queues, and delivers activity.
|
|
6
|
+
The emit command always returns a valid empty JSON object to Cursor and fails open, so telemetry
|
|
7
|
+
delivery can never block an agent tool call.
|
|
6
8
|
|
|
7
9
|
Run `wibe setup` to authorize a revocable, project-scoped device token. Interactive credentials are
|
|
8
10
|
stored in the operating-system keychain; hooks do not require repository secrets. The mapper drops
|
|
@@ -3,57 +3,68 @@
|
|
|
3
3
|
"hooks": {
|
|
4
4
|
"sessionStart": [
|
|
5
5
|
{
|
|
6
|
-
"command": "npx -y @wibeco/bridge@latest emit --adapter cursor --event session-start"
|
|
6
|
+
"command": "npx -y @wibeco/bridge@latest emit --adapter cursor --event session-start",
|
|
7
|
+
"failClosed": false
|
|
7
8
|
}
|
|
8
9
|
],
|
|
9
10
|
"sessionEnd": [
|
|
10
11
|
{
|
|
11
|
-
"command": "npx -y @wibeco/bridge@latest emit --adapter cursor --event session-end"
|
|
12
|
+
"command": "npx -y @wibeco/bridge@latest emit --adapter cursor --event session-end",
|
|
13
|
+
"failClosed": false
|
|
12
14
|
}
|
|
13
15
|
],
|
|
14
16
|
"beforeSubmitPrompt": [
|
|
15
17
|
{
|
|
16
|
-
"command": "npx -y @wibeco/bridge@latest emit --adapter cursor --event before-submit-prompt"
|
|
18
|
+
"command": "npx -y @wibeco/bridge@latest emit --adapter cursor --event before-submit-prompt",
|
|
19
|
+
"failClosed": false
|
|
17
20
|
}
|
|
18
21
|
],
|
|
19
22
|
"afterAgentResponse": [
|
|
20
23
|
{
|
|
21
|
-
"command": "npx -y @wibeco/bridge@latest emit --adapter cursor --event after-agent-response"
|
|
24
|
+
"command": "npx -y @wibeco/bridge@latest emit --adapter cursor --event after-agent-response",
|
|
25
|
+
"failClosed": false
|
|
22
26
|
}
|
|
23
27
|
],
|
|
24
28
|
"preToolUse": [
|
|
25
29
|
{
|
|
26
|
-
"command": "npx -y @wibeco/bridge@latest emit --adapter cursor --event before-tool"
|
|
30
|
+
"command": "npx -y @wibeco/bridge@latest emit --adapter cursor --event before-tool",
|
|
31
|
+
"failClosed": false
|
|
27
32
|
}
|
|
28
33
|
],
|
|
29
34
|
"postToolUse": [
|
|
30
35
|
{
|
|
31
|
-
"command": "npx -y @wibeco/bridge@latest emit --adapter cursor --event after-tool"
|
|
36
|
+
"command": "npx -y @wibeco/bridge@latest emit --adapter cursor --event after-tool",
|
|
37
|
+
"failClosed": false
|
|
32
38
|
}
|
|
33
39
|
],
|
|
34
40
|
"afterFileEdit": [
|
|
35
41
|
{
|
|
36
|
-
"command": "npx -y @wibeco/bridge@latest emit --adapter cursor --event after-file-edit"
|
|
42
|
+
"command": "npx -y @wibeco/bridge@latest emit --adapter cursor --event after-file-edit",
|
|
43
|
+
"failClosed": false
|
|
37
44
|
}
|
|
38
45
|
],
|
|
39
46
|
"beforeShellExecution": [
|
|
40
47
|
{
|
|
41
|
-
"command": "npx -y @wibeco/bridge@latest emit --adapter cursor --event before-shell-execution"
|
|
48
|
+
"command": "npx -y @wibeco/bridge@latest emit --adapter cursor --event before-shell-execution",
|
|
49
|
+
"failClosed": false
|
|
42
50
|
}
|
|
43
51
|
],
|
|
44
52
|
"afterShellExecution": [
|
|
45
53
|
{
|
|
46
|
-
"command": "npx -y @wibeco/bridge@latest emit --adapter cursor --event after-shell-execution"
|
|
54
|
+
"command": "npx -y @wibeco/bridge@latest emit --adapter cursor --event after-shell-execution",
|
|
55
|
+
"failClosed": false
|
|
47
56
|
}
|
|
48
57
|
],
|
|
49
58
|
"beforeMCPExecution": [
|
|
50
59
|
{
|
|
51
|
-
"command": "npx -y @wibeco/bridge@latest emit --adapter cursor --event before-mcp-execution"
|
|
60
|
+
"command": "npx -y @wibeco/bridge@latest emit --adapter cursor --event before-mcp-execution",
|
|
61
|
+
"failClosed": false
|
|
52
62
|
}
|
|
53
63
|
],
|
|
54
64
|
"afterMCPExecution": [
|
|
55
65
|
{
|
|
56
|
-
"command": "npx -y @wibeco/bridge@latest emit --adapter cursor --event after-mcp-execution"
|
|
66
|
+
"command": "npx -y @wibeco/bridge@latest emit --adapter cursor --event after-mcp-execution",
|
|
67
|
+
"failClosed": false
|
|
57
68
|
}
|
|
58
69
|
]
|
|
59
70
|
}
|