@raindrop-ai/claude-code 0.0.9 → 0.0.11

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.
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "raindrop",
3
+ "version": "0.0.11",
4
+ "description": "Observability for Claude Code \u2014 automatic session, tool call, and prompt tracing",
5
+ "author": {
6
+ "name": "Raindrop AI",
7
+ "email": "support@raindrop.ai"
8
+ },
9
+ "homepage": "https://docs.raindrop.ai/sdk/claude-code",
10
+ "repository": "https://github.com/raindrop-ai/claude-code-plugin",
11
+ "license": "MIT",
12
+ "hooks": "./hooks/hooks.json",
13
+ "mcpServers": "./.mcp.json"
14
+ }
package/.mcp.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "mcpServers": {
3
+ "raindrop-diagnostics": {
4
+ "command": "${CLAUDE_PLUGIN_ROOT}/dist/cli.js",
5
+ "args": [
6
+ "mcp-serve"
7
+ ],
8
+ "transport": "stdio"
9
+ }
10
+ }
11
+ }
package/dist/cli.js CHANGED
@@ -654,7 +654,7 @@ globalThis.RAINDROP_ASYNC_LOCAL_STORAGE = AsyncLocalStorage;
654
654
 
655
655
  // src/package-info.ts
656
656
  var PACKAGE_NAME = "@raindrop-ai/claude-code";
657
- var PACKAGE_VERSION = "0.0.8";
657
+ var PACKAGE_VERSION = "0.0.11";
658
658
 
659
659
  // src/shipper.ts
660
660
  var EventShipper2 = class extends EventShipper {
@@ -1549,7 +1549,7 @@ import { homedir, userInfo } from "os";
1549
1549
  import { dirname, join as join2 } from "path";
1550
1550
  var CONFIG_PATH = join2(homedir(), ".config", "raindrop", "config.json");
1551
1551
  function loadConfig() {
1552
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
1552
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
1553
1553
  let file = {};
1554
1554
  try {
1555
1555
  if (existsSync3(CONFIG_PATH)) {
@@ -1592,8 +1592,14 @@ function loadConfig() {
1592
1592
  userId: (_g = (_f = process.env["RAINDROP_USER_ID"]) != null ? _f : file.user_id) != null ? _g : systemUser,
1593
1593
  convoId: ((_h = process.env["RAINDROP_CONVO_ID"]) == null ? void 0 : _h.trim()) || void 0,
1594
1594
  debug: process.env["RAINDROP_DEBUG"] === "true" ? true : (_i = file.debug) != null ? _i : false,
1595
- enabled: (_j = file.enabled) != null ? _j : true,
1596
- eventName: (_l = (_k = process.env["RAINDROP_EVENT_NAME"]) != null ? _k : file.event_name) != null ? _l : "claude_code_session",
1595
+ enabled: (() => {
1596
+ var _a2;
1597
+ const env = process.env["RAINDROP_ENABLED"];
1598
+ if (!env) return (_a2 = file.enabled) != null ? _a2 : true;
1599
+ const lower = env.toLowerCase();
1600
+ return lower !== "false" && env !== "0";
1601
+ })(),
1602
+ eventName: (_k = (_j = process.env["RAINDROP_EVENT_NAME"]) != null ? _j : file.event_name) != null ? _k : "claude_code_session",
1597
1603
  customProperties,
1598
1604
  selfDiagnostics
1599
1605
  };
@@ -2047,6 +2053,62 @@ async function runSetup(args2) {
2047
2053
  `);
2048
2054
  }
2049
2055
  }
2056
+ function runUninstall(scope = "user") {
2057
+ const settingsPath = getClaudeSettingsPath(scope, process.cwd());
2058
+ const scopeLabel = scope === "project" ? "project" : "global";
2059
+ if (!existsSync6(settingsPath)) {
2060
+ console.log(`
2061
+ No settings file found at ${settingsPath}. Nothing to uninstall.
2062
+ `);
2063
+ return;
2064
+ }
2065
+ let settings;
2066
+ try {
2067
+ settings = JSON.parse(readFileSync6(settingsPath, "utf-8"));
2068
+ } catch (e) {
2069
+ console.error(` Could not parse ${settingsPath}`);
2070
+ process.exit(1);
2071
+ }
2072
+ const hooks = settings["hooks"];
2073
+ let removedHooks = 0;
2074
+ if (hooks) {
2075
+ for (const event of Object.keys(hooks)) {
2076
+ const groups = hooks[event];
2077
+ if (!Array.isArray(groups)) continue;
2078
+ const original = groups.length;
2079
+ hooks[event] = groups.filter((group) => {
2080
+ var _a;
2081
+ const hookList = (_a = group.hooks) != null ? _a : [];
2082
+ return !hookList.some(
2083
+ (h) => typeof h["command"] === "string" && h["command"].includes("raindrop-claude-code")
2084
+ );
2085
+ });
2086
+ removedHooks += original - hooks[event].length;
2087
+ if (hooks[event].length === 0) {
2088
+ delete hooks[event];
2089
+ }
2090
+ }
2091
+ if (Object.keys(hooks).length === 0) {
2092
+ delete settings["hooks"];
2093
+ }
2094
+ }
2095
+ writeFileSync4(settingsPath, JSON.stringify(settings, null, 2) + "\n", "utf-8");
2096
+ let mcpRemoved = false;
2097
+ try {
2098
+ execSync2(`claude mcp remove raindrop-diagnostics --scope ${scope}`, { stdio: "ignore" });
2099
+ mcpRemoved = true;
2100
+ } catch (e) {
2101
+ }
2102
+ console.log(`
2103
+ Raindrop uninstalled (${scopeLabel}):`);
2104
+ console.log(` - ${removedHooks} hook entries removed from ${settingsPath}`);
2105
+ if (mcpRemoved) {
2106
+ console.log(` - raindrop-diagnostics MCP server deregistered`);
2107
+ }
2108
+ console.log(`
2109
+ To reinstall, run: raindrop-claude-code setup
2110
+ `);
2111
+ }
2050
2112
  var DEBUG_LOG_PATH = "/tmp/raindrop-hooks.log";
2051
2113
  var DEBUG_PREFIX = "RAINDROP_DEBUG=true ";
2052
2114
  var TEE_SUFFIX = ` 2>&1 | tee -a ${DEBUG_LOG_PATH} || true`;
@@ -2452,6 +2514,11 @@ async function main() {
2452
2514
  console.log(" Raindrop hooks disabled.");
2453
2515
  break;
2454
2516
  }
2517
+ case "uninstall": {
2518
+ const uninstallScope = parseFlag("scope") === "project" ? "project" : "user";
2519
+ runUninstall(uninstallScope);
2520
+ break;
2521
+ }
2455
2522
  case "debug-on": {
2456
2523
  const debugScope = parseFlag("scope") === "project" ? "project" : "user";
2457
2524
  toggleDebug(true, debugScope);
@@ -2488,6 +2555,8 @@ async function main() {
2488
2555
  hook Handle a Claude Code hook event (reads JSON from stdin)
2489
2556
  mcp-serve Start the self-diagnostics MCP server (stdio)
2490
2557
  status Check local debugger connectivity
2558
+ uninstall Remove all Raindrop hooks from settings.json
2559
+ --scope=SCOPE "user" (default) or "project"
2491
2560
  enable Enable Raindrop hooks
2492
2561
  disable Disable Raindrop hooks
2493
2562
  debug-on Enable debug logging to /tmp/raindrop-hooks.log
@@ -2501,9 +2570,11 @@ async function main() {
2501
2570
  RAINDROP_CONVO_ID Conversation/thread ID override
2502
2571
  RAINDROP_EVENT_NAME Custom event name (default: "claude_code_session")
2503
2572
  RAINDROP_PROPERTIES JSON object merged into every event's properties
2573
+ RAINDROP_ENABLED Set to "false" to disable all telemetry
2504
2574
  RAINDROP_API_URL Custom API endpoint
2505
2575
  RAINDROP_LOCAL_DEBUGGER Local debugger URL (auto-detected if running on :5899)
2506
2576
  RAINDROP_DEBUG Set to "true" for verbose logging
2577
+ RAINDROP_SELF_DIAGNOSTICS JSON object to customize self-diagnostics signal categories
2507
2578
  `);
2508
2579
  if (!command || command === "help" || command === "--help" || command === "-h") {
2509
2580
  process.exit(0);
package/dist/index.cjs CHANGED
@@ -690,7 +690,7 @@ globalThis.RAINDROP_ASYNC_LOCAL_STORAGE = import_async_hooks.AsyncLocalStorage;
690
690
 
691
691
  // src/package-info.ts
692
692
  var PACKAGE_NAME = "@raindrop-ai/claude-code";
693
- var PACKAGE_VERSION = "0.0.8";
693
+ var PACKAGE_VERSION = "0.0.11";
694
694
 
695
695
  // src/shipper.ts
696
696
  var EventShipper2 = class extends EventShipper {
@@ -733,7 +733,7 @@ var import_node_os = require("os");
733
733
  var import_node_path = require("path");
734
734
  var CONFIG_PATH = (0, import_node_path.join)((0, import_node_os.homedir)(), ".config", "raindrop", "config.json");
735
735
  function loadConfig() {
736
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
736
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
737
737
  let file = {};
738
738
  try {
739
739
  if ((0, import_node_fs.existsSync)(CONFIG_PATH)) {
@@ -776,8 +776,14 @@ function loadConfig() {
776
776
  userId: (_g = (_f = process.env["RAINDROP_USER_ID"]) != null ? _f : file.user_id) != null ? _g : systemUser,
777
777
  convoId: ((_h = process.env["RAINDROP_CONVO_ID"]) == null ? void 0 : _h.trim()) || void 0,
778
778
  debug: process.env["RAINDROP_DEBUG"] === "true" ? true : (_i = file.debug) != null ? _i : false,
779
- enabled: (_j = file.enabled) != null ? _j : true,
780
- eventName: (_l = (_k = process.env["RAINDROP_EVENT_NAME"]) != null ? _k : file.event_name) != null ? _l : "claude_code_session",
779
+ enabled: (() => {
780
+ var _a2;
781
+ const env = process.env["RAINDROP_ENABLED"];
782
+ if (!env) return (_a2 = file.enabled) != null ? _a2 : true;
783
+ const lower = env.toLowerCase();
784
+ return lower !== "false" && env !== "0";
785
+ })(),
786
+ eventName: (_k = (_j = process.env["RAINDROP_EVENT_NAME"]) != null ? _j : file.event_name) != null ? _k : "claude_code_session",
781
787
  customProperties,
782
788
  selfDiagnostics
783
789
  };
package/dist/index.d.cts CHANGED
@@ -310,7 +310,7 @@ declare function mapHookToRaindrop(payload: HookPayload, config: MapperConfig, e
310
310
  declare function extractAppendSystemPrompt(args: string[]): string | undefined;
311
311
 
312
312
  declare const PACKAGE_NAME = "@raindrop-ai/claude-code";
313
- declare const PACKAGE_VERSION = "0.0.8";
313
+ declare const PACKAGE_VERSION = "0.0.11";
314
314
 
315
315
  /** A tool call extracted from an assistant message content block. */
316
316
  interface LLMToolCall {
package/dist/index.d.ts CHANGED
@@ -310,7 +310,7 @@ declare function mapHookToRaindrop(payload: HookPayload, config: MapperConfig, e
310
310
  declare function extractAppendSystemPrompt(args: string[]): string | undefined;
311
311
 
312
312
  declare const PACKAGE_NAME = "@raindrop-ai/claude-code";
313
- declare const PACKAGE_VERSION = "0.0.8";
313
+ declare const PACKAGE_VERSION = "0.0.11";
314
314
 
315
315
  /** A tool call extracted from an assistant message content block. */
316
316
  interface LLMToolCall {
package/dist/index.js CHANGED
@@ -645,7 +645,7 @@ globalThis.RAINDROP_ASYNC_LOCAL_STORAGE = AsyncLocalStorage;
645
645
 
646
646
  // src/package-info.ts
647
647
  var PACKAGE_NAME = "@raindrop-ai/claude-code";
648
- var PACKAGE_VERSION = "0.0.8";
648
+ var PACKAGE_VERSION = "0.0.11";
649
649
 
650
650
  // src/shipper.ts
651
651
  var EventShipper2 = class extends EventShipper {
@@ -688,7 +688,7 @@ import { homedir, userInfo } from "os";
688
688
  import { dirname, join } from "path";
689
689
  var CONFIG_PATH = join(homedir(), ".config", "raindrop", "config.json");
690
690
  function loadConfig() {
691
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
691
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
692
692
  let file = {};
693
693
  try {
694
694
  if (existsSync(CONFIG_PATH)) {
@@ -731,8 +731,14 @@ function loadConfig() {
731
731
  userId: (_g = (_f = process.env["RAINDROP_USER_ID"]) != null ? _f : file.user_id) != null ? _g : systemUser,
732
732
  convoId: ((_h = process.env["RAINDROP_CONVO_ID"]) == null ? void 0 : _h.trim()) || void 0,
733
733
  debug: process.env["RAINDROP_DEBUG"] === "true" ? true : (_i = file.debug) != null ? _i : false,
734
- enabled: (_j = file.enabled) != null ? _j : true,
735
- eventName: (_l = (_k = process.env["RAINDROP_EVENT_NAME"]) != null ? _k : file.event_name) != null ? _l : "claude_code_session",
734
+ enabled: (() => {
735
+ var _a2;
736
+ const env = process.env["RAINDROP_ENABLED"];
737
+ if (!env) return (_a2 = file.enabled) != null ? _a2 : true;
738
+ const lower = env.toLowerCase();
739
+ return lower !== "false" && env !== "0";
740
+ })(),
741
+ eventName: (_k = (_j = process.env["RAINDROP_EVENT_NAME"]) != null ? _j : file.event_name) != null ? _k : "claude_code_session",
736
742
  customProperties,
737
743
  selfDiagnostics
738
744
  };
@@ -0,0 +1,147 @@
1
+ {
2
+ "hooks": {
3
+ "SessionStart": [
4
+ {
5
+ "hooks": [
6
+ {
7
+ "type": "command",
8
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/dist/cli.js\" hook",
9
+ "timeout": 10
10
+ }
11
+ ]
12
+ }
13
+ ],
14
+ "UserPromptSubmit": [
15
+ {
16
+ "hooks": [
17
+ {
18
+ "type": "command",
19
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/dist/cli.js\" hook",
20
+ "timeout": 10
21
+ }
22
+ ]
23
+ }
24
+ ],
25
+ "PreToolUse": [
26
+ {
27
+ "hooks": [
28
+ {
29
+ "type": "command",
30
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/dist/cli.js\" hook",
31
+ "timeout": 10
32
+ }
33
+ ]
34
+ }
35
+ ],
36
+ "PostToolUse": [
37
+ {
38
+ "hooks": [
39
+ {
40
+ "type": "command",
41
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/dist/cli.js\" hook",
42
+ "timeout": 10
43
+ }
44
+ ]
45
+ }
46
+ ],
47
+ "PostToolUseFailure": [
48
+ {
49
+ "hooks": [
50
+ {
51
+ "type": "command",
52
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/dist/cli.js\" hook",
53
+ "timeout": 10
54
+ }
55
+ ]
56
+ }
57
+ ],
58
+ "SubagentStart": [
59
+ {
60
+ "hooks": [
61
+ {
62
+ "type": "command",
63
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/dist/cli.js\" hook",
64
+ "timeout": 10
65
+ }
66
+ ]
67
+ }
68
+ ],
69
+ "SubagentStop": [
70
+ {
71
+ "hooks": [
72
+ {
73
+ "type": "command",
74
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/dist/cli.js\" hook",
75
+ "timeout": 10
76
+ }
77
+ ]
78
+ }
79
+ ],
80
+ "Stop": [
81
+ {
82
+ "hooks": [
83
+ {
84
+ "type": "command",
85
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/dist/cli.js\" hook",
86
+ "timeout": 10
87
+ }
88
+ ]
89
+ }
90
+ ],
91
+ "StopFailure": [
92
+ {
93
+ "hooks": [
94
+ {
95
+ "type": "command",
96
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/dist/cli.js\" hook",
97
+ "timeout": 10
98
+ }
99
+ ]
100
+ }
101
+ ],
102
+ "SessionEnd": [
103
+ {
104
+ "hooks": [
105
+ {
106
+ "type": "command",
107
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/dist/cli.js\" hook",
108
+ "timeout": 10
109
+ }
110
+ ]
111
+ }
112
+ ],
113
+ "PostCompact": [
114
+ {
115
+ "hooks": [
116
+ {
117
+ "type": "command",
118
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/dist/cli.js\" hook",
119
+ "timeout": 10
120
+ }
121
+ ]
122
+ }
123
+ ],
124
+ "InstructionsLoaded": [
125
+ {
126
+ "hooks": [
127
+ {
128
+ "type": "command",
129
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/dist/cli.js\" hook",
130
+ "timeout": 10
131
+ }
132
+ ]
133
+ }
134
+ ],
135
+ "PermissionDenied": [
136
+ {
137
+ "hooks": [
138
+ {
139
+ "type": "command",
140
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/dist/cli.js\" hook",
141
+ "timeout": 10
142
+ }
143
+ ]
144
+ }
145
+ ]
146
+ }
147
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raindrop-ai/claude-code",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "description": "Raindrop observability for Claude Code CLI \u2014 automatic session, tool call, and prompt tracing via hooks",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -25,7 +25,10 @@
25
25
  "sideEffects": false,
26
26
  "files": [
27
27
  "dist/**",
28
- "README.md"
28
+ "README.md",
29
+ ".claude-plugin/**",
30
+ "hooks/**",
31
+ ".mcp.json"
29
32
  ],
30
33
  "keywords": [
31
34
  "raindrop",