@raindrop-ai/claude-code 0.0.3 → 0.0.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/README.md +4 -0
- package/dist/cli.js +433 -46
- package/dist/index.cjs +423 -33
- package/dist/index.d.cts +60 -2
- package/dist/index.d.ts +60 -2
- package/dist/index.js +415 -28
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -227,6 +227,8 @@ interface ConfigFile {
|
|
|
227
227
|
user_id?: string;
|
|
228
228
|
debug?: boolean;
|
|
229
229
|
enabled?: boolean;
|
|
230
|
+
event_name?: string;
|
|
231
|
+
custom_properties?: Record<string, unknown>;
|
|
230
232
|
}
|
|
231
233
|
interface RaindropConfig {
|
|
232
234
|
writeKey: string;
|
|
@@ -234,6 +236,8 @@ interface RaindropConfig {
|
|
|
234
236
|
userId: string;
|
|
235
237
|
debug: boolean;
|
|
236
238
|
enabled: boolean;
|
|
239
|
+
eventName: string;
|
|
240
|
+
customProperties: Record<string, unknown>;
|
|
237
241
|
}
|
|
238
242
|
/**
|
|
239
243
|
* Load config with precedence (low -> high):
|
|
@@ -271,15 +275,69 @@ interface HookPayload {
|
|
|
271
275
|
agent_transcript_path?: string;
|
|
272
276
|
trigger?: string;
|
|
273
277
|
compact_summary?: string;
|
|
278
|
+
file_path?: string;
|
|
279
|
+
memory_type?: string;
|
|
280
|
+
load_reason?: string;
|
|
274
281
|
}
|
|
275
282
|
interface MapperConfig {
|
|
276
283
|
userId: string;
|
|
277
284
|
debug: boolean;
|
|
285
|
+
eventName: string;
|
|
286
|
+
customProperties: Record<string, unknown>;
|
|
278
287
|
}
|
|
279
288
|
declare function mapHookToRaindrop(payload: HookPayload, config: MapperConfig, eventShipper: EventShipper, traceShipper: TraceShipper): Promise<void>;
|
|
289
|
+
/**
|
|
290
|
+
* Parse command-line args for --append-system-prompt and
|
|
291
|
+
* --append-system-prompt-file flags. Handles both space-separated form
|
|
292
|
+
* (--flag value) and equals form (--flag=value). Supports both flags
|
|
293
|
+
* appearing together (they concatenate).
|
|
294
|
+
*
|
|
295
|
+
* Exported for testing.
|
|
296
|
+
*/
|
|
297
|
+
declare function extractAppendSystemPrompt(args: string[]): string | undefined;
|
|
280
298
|
|
|
281
299
|
declare const PACKAGE_NAME = "@raindrop-ai/claude-code";
|
|
282
|
-
declare const PACKAGE_VERSION = "0.0.
|
|
300
|
+
declare const PACKAGE_VERSION = "0.0.5";
|
|
301
|
+
|
|
302
|
+
interface TranscriptSummary {
|
|
303
|
+
/** Aggregated token usage across all turns */
|
|
304
|
+
totalInputTokens: number;
|
|
305
|
+
totalOutputTokens: number;
|
|
306
|
+
totalCacheReadTokens: number;
|
|
307
|
+
totalCacheCreationTokens: number;
|
|
308
|
+
/** Token usage for the most recent turn only */
|
|
309
|
+
lastTurnInputTokens?: number;
|
|
310
|
+
lastTurnOutputTokens?: number;
|
|
311
|
+
lastTurnCacheReadTokens?: number;
|
|
312
|
+
/** Model used (from most recent assistant message) */
|
|
313
|
+
model?: string;
|
|
314
|
+
/** Service tier */
|
|
315
|
+
serviceTier?: string;
|
|
316
|
+
/** Number of API turns (assistant messages) */
|
|
317
|
+
turnCount: number;
|
|
318
|
+
/** Unique tool names used in the session */
|
|
319
|
+
toolsUsed: string[];
|
|
320
|
+
/** Stop reason from last assistant message */
|
|
321
|
+
stopReason?: string;
|
|
322
|
+
/** Total turn duration in ms (from system entries) */
|
|
323
|
+
totalDurationMs?: number;
|
|
324
|
+
/** Claude Code version */
|
|
325
|
+
codeVersion?: string;
|
|
326
|
+
/** Git branch */
|
|
327
|
+
gitBranch?: string;
|
|
328
|
+
/** Whether thinking/reasoning content was used */
|
|
329
|
+
hasThinking: boolean;
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Parse a Claude Code transcript JSONL file and extract a summary.
|
|
333
|
+
* Returns undefined if the file doesn't exist or can't be parsed.
|
|
334
|
+
*/
|
|
335
|
+
declare function parseTranscript(transcriptPath: string): TranscriptSummary | undefined;
|
|
336
|
+
/**
|
|
337
|
+
* Convert a TranscriptSummary into a flat properties object
|
|
338
|
+
* suitable for merging into event properties.
|
|
339
|
+
*/
|
|
340
|
+
declare function transcriptToProperties(summary: TranscriptSummary): Record<string, unknown>;
|
|
283
341
|
|
|
284
342
|
interface LocalDebuggerResult {
|
|
285
343
|
/** The resolved base URL (e.g. "http://localhost:5899/v1/"), or null if not detected. */
|
|
@@ -302,4 +360,4 @@ declare function detectLocalDebugger(debug: boolean): Promise<LocalDebuggerResul
|
|
|
302
360
|
*/
|
|
303
361
|
declare function mirrorEventToLocalDebugger(baseUrl: string, payload: Record<string, unknown>, debug: boolean): void;
|
|
304
362
|
|
|
305
|
-
export { EventShipper, type HookPayload, type LocalDebuggerResult, type MapperConfig, PACKAGE_NAME, PACKAGE_VERSION, type RaindropConfig, type SetupScope, TraceShipper, detectLocalDebugger, getConfigPath, loadConfig, mapHookToRaindrop, mirrorEventToLocalDebugger, updateConfig };
|
|
363
|
+
export { EventShipper, type HookPayload, type LocalDebuggerResult, type MapperConfig, PACKAGE_NAME, PACKAGE_VERSION, type RaindropConfig, type SetupScope, TraceShipper, type TranscriptSummary, detectLocalDebugger, extractAppendSystemPrompt, getConfigPath, loadConfig, mapHookToRaindrop, mirrorEventToLocalDebugger, parseTranscript, transcriptToProperties, updateConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -227,6 +227,8 @@ interface ConfigFile {
|
|
|
227
227
|
user_id?: string;
|
|
228
228
|
debug?: boolean;
|
|
229
229
|
enabled?: boolean;
|
|
230
|
+
event_name?: string;
|
|
231
|
+
custom_properties?: Record<string, unknown>;
|
|
230
232
|
}
|
|
231
233
|
interface RaindropConfig {
|
|
232
234
|
writeKey: string;
|
|
@@ -234,6 +236,8 @@ interface RaindropConfig {
|
|
|
234
236
|
userId: string;
|
|
235
237
|
debug: boolean;
|
|
236
238
|
enabled: boolean;
|
|
239
|
+
eventName: string;
|
|
240
|
+
customProperties: Record<string, unknown>;
|
|
237
241
|
}
|
|
238
242
|
/**
|
|
239
243
|
* Load config with precedence (low -> high):
|
|
@@ -271,15 +275,69 @@ interface HookPayload {
|
|
|
271
275
|
agent_transcript_path?: string;
|
|
272
276
|
trigger?: string;
|
|
273
277
|
compact_summary?: string;
|
|
278
|
+
file_path?: string;
|
|
279
|
+
memory_type?: string;
|
|
280
|
+
load_reason?: string;
|
|
274
281
|
}
|
|
275
282
|
interface MapperConfig {
|
|
276
283
|
userId: string;
|
|
277
284
|
debug: boolean;
|
|
285
|
+
eventName: string;
|
|
286
|
+
customProperties: Record<string, unknown>;
|
|
278
287
|
}
|
|
279
288
|
declare function mapHookToRaindrop(payload: HookPayload, config: MapperConfig, eventShipper: EventShipper, traceShipper: TraceShipper): Promise<void>;
|
|
289
|
+
/**
|
|
290
|
+
* Parse command-line args for --append-system-prompt and
|
|
291
|
+
* --append-system-prompt-file flags. Handles both space-separated form
|
|
292
|
+
* (--flag value) and equals form (--flag=value). Supports both flags
|
|
293
|
+
* appearing together (they concatenate).
|
|
294
|
+
*
|
|
295
|
+
* Exported for testing.
|
|
296
|
+
*/
|
|
297
|
+
declare function extractAppendSystemPrompt(args: string[]): string | undefined;
|
|
280
298
|
|
|
281
299
|
declare const PACKAGE_NAME = "@raindrop-ai/claude-code";
|
|
282
|
-
declare const PACKAGE_VERSION = "0.0.
|
|
300
|
+
declare const PACKAGE_VERSION = "0.0.5";
|
|
301
|
+
|
|
302
|
+
interface TranscriptSummary {
|
|
303
|
+
/** Aggregated token usage across all turns */
|
|
304
|
+
totalInputTokens: number;
|
|
305
|
+
totalOutputTokens: number;
|
|
306
|
+
totalCacheReadTokens: number;
|
|
307
|
+
totalCacheCreationTokens: number;
|
|
308
|
+
/** Token usage for the most recent turn only */
|
|
309
|
+
lastTurnInputTokens?: number;
|
|
310
|
+
lastTurnOutputTokens?: number;
|
|
311
|
+
lastTurnCacheReadTokens?: number;
|
|
312
|
+
/** Model used (from most recent assistant message) */
|
|
313
|
+
model?: string;
|
|
314
|
+
/** Service tier */
|
|
315
|
+
serviceTier?: string;
|
|
316
|
+
/** Number of API turns (assistant messages) */
|
|
317
|
+
turnCount: number;
|
|
318
|
+
/** Unique tool names used in the session */
|
|
319
|
+
toolsUsed: string[];
|
|
320
|
+
/** Stop reason from last assistant message */
|
|
321
|
+
stopReason?: string;
|
|
322
|
+
/** Total turn duration in ms (from system entries) */
|
|
323
|
+
totalDurationMs?: number;
|
|
324
|
+
/** Claude Code version */
|
|
325
|
+
codeVersion?: string;
|
|
326
|
+
/** Git branch */
|
|
327
|
+
gitBranch?: string;
|
|
328
|
+
/** Whether thinking/reasoning content was used */
|
|
329
|
+
hasThinking: boolean;
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Parse a Claude Code transcript JSONL file and extract a summary.
|
|
333
|
+
* Returns undefined if the file doesn't exist or can't be parsed.
|
|
334
|
+
*/
|
|
335
|
+
declare function parseTranscript(transcriptPath: string): TranscriptSummary | undefined;
|
|
336
|
+
/**
|
|
337
|
+
* Convert a TranscriptSummary into a flat properties object
|
|
338
|
+
* suitable for merging into event properties.
|
|
339
|
+
*/
|
|
340
|
+
declare function transcriptToProperties(summary: TranscriptSummary): Record<string, unknown>;
|
|
283
341
|
|
|
284
342
|
interface LocalDebuggerResult {
|
|
285
343
|
/** The resolved base URL (e.g. "http://localhost:5899/v1/"), or null if not detected. */
|
|
@@ -302,4 +360,4 @@ declare function detectLocalDebugger(debug: boolean): Promise<LocalDebuggerResul
|
|
|
302
360
|
*/
|
|
303
361
|
declare function mirrorEventToLocalDebugger(baseUrl: string, payload: Record<string, unknown>, debug: boolean): void;
|
|
304
362
|
|
|
305
|
-
export { EventShipper, type HookPayload, type LocalDebuggerResult, type MapperConfig, PACKAGE_NAME, PACKAGE_VERSION, type RaindropConfig, type SetupScope, TraceShipper, detectLocalDebugger, getConfigPath, loadConfig, mapHookToRaindrop, mirrorEventToLocalDebugger, updateConfig };
|
|
363
|
+
export { EventShipper, type HookPayload, type LocalDebuggerResult, type MapperConfig, PACKAGE_NAME, PACKAGE_VERSION, type RaindropConfig, type SetupScope, TraceShipper, type TranscriptSummary, detectLocalDebugger, extractAppendSystemPrompt, getConfigPath, loadConfig, mapHookToRaindrop, mirrorEventToLocalDebugger, parseTranscript, transcriptToProperties, updateConfig };
|