@raindrop-ai/claude-code 0.0.19 → 0.0.20
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/.claude-plugin/plugin.json +1 -1
- package/README.md +4 -0
- package/dist/cli.js +1005 -115
- package/dist/index.cjs +966 -93
- package/dist/index.d.cts +91 -1
- package/dist/index.d.ts +91 -1
- package/dist/index.js +965 -93
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -35,6 +35,69 @@ type SpanIds = {
|
|
|
35
35
|
spanIdB64: string;
|
|
36
36
|
parentSpanIdB64?: string;
|
|
37
37
|
};
|
|
38
|
+
/** Kept structural so public integration declarations do not depend on private schemas. */
|
|
39
|
+
type AppGitOptions = {
|
|
40
|
+
commitSha?: string | null;
|
|
41
|
+
commitDirty?: boolean | null;
|
|
42
|
+
branch?: string | null;
|
|
43
|
+
detectBranch?: boolean;
|
|
44
|
+
sourceDirectory?: string;
|
|
45
|
+
autoDetect?: boolean;
|
|
46
|
+
};
|
|
47
|
+
type AppGitSnapshot = Readonly<Record<string, unknown>>;
|
|
48
|
+
type AppGitEnvironment = Readonly<Record<string, string | undefined>>;
|
|
49
|
+
type AppGitLocalResult = {
|
|
50
|
+
commitSha?: string;
|
|
51
|
+
commitDirty?: boolean;
|
|
52
|
+
branch?: string;
|
|
53
|
+
};
|
|
54
|
+
type AppGitOperationOwner = string;
|
|
55
|
+
type AppGitLocalResolver = (sourceDirectory: string | undefined, detectBranch: boolean, completed: (result: AppGitLocalResult) => void) => () => void;
|
|
56
|
+
/** One client owns its defaults; operation snapshots never wait for discovery. */
|
|
57
|
+
declare class AppGitContextImpl {
|
|
58
|
+
private defaults;
|
|
59
|
+
private explicit;
|
|
60
|
+
private explicitKeys;
|
|
61
|
+
private cancel;
|
|
62
|
+
private disposed;
|
|
63
|
+
private operations;
|
|
64
|
+
private operationOverflow;
|
|
65
|
+
private detectBranch;
|
|
66
|
+
private replayBranch;
|
|
67
|
+
private disabled;
|
|
68
|
+
constructor(options: AppGitOptions | false | undefined, runtime?: {
|
|
69
|
+
allowLocalGit?: boolean;
|
|
70
|
+
resolveLocal?: AppGitLocalResolver;
|
|
71
|
+
env?: AppGitEnvironment;
|
|
72
|
+
captureLegacyReplayBranch?: boolean;
|
|
73
|
+
allowDiscovery?: boolean;
|
|
74
|
+
});
|
|
75
|
+
private accept;
|
|
76
|
+
snapshot(properties?: Readonly<Record<string, unknown>>): AppGitSnapshot;
|
|
77
|
+
/** Safe defaults when no operation/span start was observed; never infer identity. */
|
|
78
|
+
snapshotExplicit(properties?: Readonly<Record<string, unknown>>, eventId?: string): AppGitSnapshot;
|
|
79
|
+
/** Existing replay branch reporting stays separate from opt-in event properties. */
|
|
80
|
+
snapshotForReplay(): AppGitSnapshot;
|
|
81
|
+
/** Merge a frozen span snapshot without losing client-authored provenance. */
|
|
82
|
+
mergeSnapshot(base: AppGitSnapshot, properties?: Readonly<Record<string, unknown>>, explicitKeys?: ReadonlySet<string>): AppGitSnapshot;
|
|
83
|
+
/** Shippers belonging to one client share this bounded operation registry. */
|
|
84
|
+
forOperation(eventId: string | undefined, properties?: Readonly<Record<string, unknown>>, owner?: AppGitOperationOwner): AppGitSnapshot;
|
|
85
|
+
releaseOperation(eventId: string, owner: AppGitOperationOwner): void;
|
|
86
|
+
finishOperation(eventId: string): void;
|
|
87
|
+
dispose(): void;
|
|
88
|
+
}
|
|
89
|
+
/** Structural at package boundaries: public SDK bundles contain independent copies of core. */
|
|
90
|
+
type AppGitContext = Pick<AppGitContextImpl, "snapshot" | "snapshotForReplay" | "forOperation" | "finishOperation" | "dispose"> & {
|
|
91
|
+
snapshotExplicit?: AppGitContextImpl["snapshotExplicit"];
|
|
92
|
+
mergeSnapshot?: AppGitContextImpl["mergeSnapshot"];
|
|
93
|
+
releaseOperation?: (eventId: string, owner: AppGitOperationOwner) => void;
|
|
94
|
+
};
|
|
95
|
+
declare const AppGitContext: typeof AppGitContextImpl;
|
|
96
|
+
declare function createAppGitContext(options?: AppGitOptions | false, runtime?: {
|
|
97
|
+
allowLocalGit?: boolean;
|
|
98
|
+
captureLegacyReplayBranch?: boolean;
|
|
99
|
+
allowDiscovery?: boolean;
|
|
100
|
+
}): AppGitContext;
|
|
38
101
|
type Attachment = {
|
|
39
102
|
type: string;
|
|
40
103
|
role: string;
|
|
@@ -76,6 +139,9 @@ type SignalInput = {
|
|
|
76
139
|
after?: string;
|
|
77
140
|
};
|
|
78
141
|
type EventShipperOptions = {
|
|
142
|
+
appGit?: AppGitOptions | false;
|
|
143
|
+
/** Share with the trace shipper so one operation uses one source snapshot. */
|
|
144
|
+
appGitContext?: AppGitContext;
|
|
79
145
|
writeKey?: string;
|
|
80
146
|
endpoint?: string;
|
|
81
147
|
enabled?: boolean;
|
|
@@ -107,6 +173,9 @@ type EventShipperOptions = {
|
|
|
107
173
|
maxTextFieldChars?: number;
|
|
108
174
|
};
|
|
109
175
|
declare class EventShipper$1 {
|
|
176
|
+
private appGitContext;
|
|
177
|
+
private ownsAppGitContext;
|
|
178
|
+
private readonly appGitOwner;
|
|
110
179
|
private baseUrl;
|
|
111
180
|
private writeKey?;
|
|
112
181
|
private enabled;
|
|
@@ -137,6 +206,7 @@ declare class EventShipper$1 {
|
|
|
137
206
|
/** URL of the local debugger / Workshop daemon, when one is reachable. */
|
|
138
207
|
private localDebuggerUrl;
|
|
139
208
|
constructor(opts: EventShipperOptions);
|
|
209
|
+
protected ownAppGitContextForShutdown(): void;
|
|
140
210
|
isDebugEnabled(): boolean;
|
|
141
211
|
private authHeaders;
|
|
142
212
|
private requestHeaders;
|
|
@@ -190,6 +260,8 @@ type InternalSpan = {
|
|
|
190
260
|
attributes: Array<OtlpKeyValue | undefined>;
|
|
191
261
|
};
|
|
192
262
|
type TraceShipperOptions = {
|
|
263
|
+
appGit?: AppGitOptions | false;
|
|
264
|
+
appGitContext?: AppGitContext;
|
|
193
265
|
writeKey?: string;
|
|
194
266
|
endpoint?: string;
|
|
195
267
|
enabled?: boolean;
|
|
@@ -258,6 +330,13 @@ type TraceShipperOptions = {
|
|
|
258
330
|
maxTextFieldChars?: number;
|
|
259
331
|
};
|
|
260
332
|
declare class TraceShipper$1 {
|
|
333
|
+
private appGitContext;
|
|
334
|
+
protected ownsAppGitContext: boolean;
|
|
335
|
+
private readonly appGitOwner;
|
|
336
|
+
private appGitEventIds;
|
|
337
|
+
private appGitActiveSpans;
|
|
338
|
+
private appGitCaptured;
|
|
339
|
+
private appGitAdded;
|
|
261
340
|
private baseUrl;
|
|
262
341
|
private writeKey?;
|
|
263
342
|
private enabled;
|
|
@@ -436,6 +515,14 @@ declare class TraceShipper extends TraceShipper$1 {
|
|
|
436
515
|
enqueue(span: OtlpSpan): void;
|
|
437
516
|
}
|
|
438
517
|
|
|
518
|
+
type AppGitFileOptions = {
|
|
519
|
+
commit_sha?: string | null;
|
|
520
|
+
commit_dirty?: boolean | null;
|
|
521
|
+
branch?: string | null;
|
|
522
|
+
detect_branch?: boolean;
|
|
523
|
+
source_directory?: string;
|
|
524
|
+
auto_detect?: boolean;
|
|
525
|
+
};
|
|
439
526
|
interface SelfDiagnosticsSignalDef {
|
|
440
527
|
description: string;
|
|
441
528
|
sentiment?: "POSITIVE" | "NEGATIVE";
|
|
@@ -455,6 +542,7 @@ interface ConfigFile {
|
|
|
455
542
|
event_name?: string;
|
|
456
543
|
custom_properties?: Record<string, unknown>;
|
|
457
544
|
self_diagnostics?: SelfDiagnosticsConfig;
|
|
545
|
+
app_git?: AppGitFileOptions | false;
|
|
458
546
|
}
|
|
459
547
|
interface RaindropConfig {
|
|
460
548
|
writeKey: string;
|
|
@@ -473,6 +561,8 @@ interface RaindropConfig {
|
|
|
473
561
|
eventName: string;
|
|
474
562
|
customProperties: Record<string, unknown>;
|
|
475
563
|
selfDiagnostics?: SelfDiagnosticsConfig;
|
|
564
|
+
/** Application Git identity override. false disables enrichment. */
|
|
565
|
+
appGit?: AppGitOptions | false;
|
|
476
566
|
}
|
|
477
567
|
/**
|
|
478
568
|
* Load config with precedence (low -> high):
|
|
@@ -687,4 +777,4 @@ declare const TOOL_SCHEMA: {
|
|
|
687
777
|
};
|
|
688
778
|
declare function startMcpServer(): Promise<void>;
|
|
689
779
|
|
|
690
|
-
export { DEFAULT_CATEGORY_KEYS, EventShipper, type HookPayload, type LLMCallPhase, type LLMToolCall, type LocalDebuggerResult, type MapperConfig, PACKAGE_NAME, PACKAGE_VERSION, type RaindropConfig, type SelfDiagnosticsConfig, type SelfDiagnosticsSignalDef, type SetupScope, TOOL_SCHEMA, TraceShipper, type TranscriptSummary, detectLocalDebugger, executeTool, extractAppendSystemPrompt, getConfigPath, loadConfig, mapHookToRaindrop, mirrorEventToLocalDebugger, normalizeSignals, parseTranscript, resolveCurrentEventId, resolveToolConfig, startMcpServer, transcriptToProperties, updateConfig };
|
|
780
|
+
export { type AppGitOptions, DEFAULT_CATEGORY_KEYS, EventShipper, type HookPayload, type LLMCallPhase, type LLMToolCall, type LocalDebuggerResult, type MapperConfig, PACKAGE_NAME, PACKAGE_VERSION, type RaindropConfig, type SelfDiagnosticsConfig, type SelfDiagnosticsSignalDef, type SetupScope, TOOL_SCHEMA, TraceShipper, type TranscriptSummary, createAppGitContext, detectLocalDebugger, executeTool, extractAppendSystemPrompt, getConfigPath, loadConfig, mapHookToRaindrop, mirrorEventToLocalDebugger, normalizeSignals, parseTranscript, resolveCurrentEventId, resolveToolConfig, startMcpServer, transcriptToProperties, updateConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -35,6 +35,69 @@ type SpanIds = {
|
|
|
35
35
|
spanIdB64: string;
|
|
36
36
|
parentSpanIdB64?: string;
|
|
37
37
|
};
|
|
38
|
+
/** Kept structural so public integration declarations do not depend on private schemas. */
|
|
39
|
+
type AppGitOptions = {
|
|
40
|
+
commitSha?: string | null;
|
|
41
|
+
commitDirty?: boolean | null;
|
|
42
|
+
branch?: string | null;
|
|
43
|
+
detectBranch?: boolean;
|
|
44
|
+
sourceDirectory?: string;
|
|
45
|
+
autoDetect?: boolean;
|
|
46
|
+
};
|
|
47
|
+
type AppGitSnapshot = Readonly<Record<string, unknown>>;
|
|
48
|
+
type AppGitEnvironment = Readonly<Record<string, string | undefined>>;
|
|
49
|
+
type AppGitLocalResult = {
|
|
50
|
+
commitSha?: string;
|
|
51
|
+
commitDirty?: boolean;
|
|
52
|
+
branch?: string;
|
|
53
|
+
};
|
|
54
|
+
type AppGitOperationOwner = string;
|
|
55
|
+
type AppGitLocalResolver = (sourceDirectory: string | undefined, detectBranch: boolean, completed: (result: AppGitLocalResult) => void) => () => void;
|
|
56
|
+
/** One client owns its defaults; operation snapshots never wait for discovery. */
|
|
57
|
+
declare class AppGitContextImpl {
|
|
58
|
+
private defaults;
|
|
59
|
+
private explicit;
|
|
60
|
+
private explicitKeys;
|
|
61
|
+
private cancel;
|
|
62
|
+
private disposed;
|
|
63
|
+
private operations;
|
|
64
|
+
private operationOverflow;
|
|
65
|
+
private detectBranch;
|
|
66
|
+
private replayBranch;
|
|
67
|
+
private disabled;
|
|
68
|
+
constructor(options: AppGitOptions | false | undefined, runtime?: {
|
|
69
|
+
allowLocalGit?: boolean;
|
|
70
|
+
resolveLocal?: AppGitLocalResolver;
|
|
71
|
+
env?: AppGitEnvironment;
|
|
72
|
+
captureLegacyReplayBranch?: boolean;
|
|
73
|
+
allowDiscovery?: boolean;
|
|
74
|
+
});
|
|
75
|
+
private accept;
|
|
76
|
+
snapshot(properties?: Readonly<Record<string, unknown>>): AppGitSnapshot;
|
|
77
|
+
/** Safe defaults when no operation/span start was observed; never infer identity. */
|
|
78
|
+
snapshotExplicit(properties?: Readonly<Record<string, unknown>>, eventId?: string): AppGitSnapshot;
|
|
79
|
+
/** Existing replay branch reporting stays separate from opt-in event properties. */
|
|
80
|
+
snapshotForReplay(): AppGitSnapshot;
|
|
81
|
+
/** Merge a frozen span snapshot without losing client-authored provenance. */
|
|
82
|
+
mergeSnapshot(base: AppGitSnapshot, properties?: Readonly<Record<string, unknown>>, explicitKeys?: ReadonlySet<string>): AppGitSnapshot;
|
|
83
|
+
/** Shippers belonging to one client share this bounded operation registry. */
|
|
84
|
+
forOperation(eventId: string | undefined, properties?: Readonly<Record<string, unknown>>, owner?: AppGitOperationOwner): AppGitSnapshot;
|
|
85
|
+
releaseOperation(eventId: string, owner: AppGitOperationOwner): void;
|
|
86
|
+
finishOperation(eventId: string): void;
|
|
87
|
+
dispose(): void;
|
|
88
|
+
}
|
|
89
|
+
/** Structural at package boundaries: public SDK bundles contain independent copies of core. */
|
|
90
|
+
type AppGitContext = Pick<AppGitContextImpl, "snapshot" | "snapshotForReplay" | "forOperation" | "finishOperation" | "dispose"> & {
|
|
91
|
+
snapshotExplicit?: AppGitContextImpl["snapshotExplicit"];
|
|
92
|
+
mergeSnapshot?: AppGitContextImpl["mergeSnapshot"];
|
|
93
|
+
releaseOperation?: (eventId: string, owner: AppGitOperationOwner) => void;
|
|
94
|
+
};
|
|
95
|
+
declare const AppGitContext: typeof AppGitContextImpl;
|
|
96
|
+
declare function createAppGitContext(options?: AppGitOptions | false, runtime?: {
|
|
97
|
+
allowLocalGit?: boolean;
|
|
98
|
+
captureLegacyReplayBranch?: boolean;
|
|
99
|
+
allowDiscovery?: boolean;
|
|
100
|
+
}): AppGitContext;
|
|
38
101
|
type Attachment = {
|
|
39
102
|
type: string;
|
|
40
103
|
role: string;
|
|
@@ -76,6 +139,9 @@ type SignalInput = {
|
|
|
76
139
|
after?: string;
|
|
77
140
|
};
|
|
78
141
|
type EventShipperOptions = {
|
|
142
|
+
appGit?: AppGitOptions | false;
|
|
143
|
+
/** Share with the trace shipper so one operation uses one source snapshot. */
|
|
144
|
+
appGitContext?: AppGitContext;
|
|
79
145
|
writeKey?: string;
|
|
80
146
|
endpoint?: string;
|
|
81
147
|
enabled?: boolean;
|
|
@@ -107,6 +173,9 @@ type EventShipperOptions = {
|
|
|
107
173
|
maxTextFieldChars?: number;
|
|
108
174
|
};
|
|
109
175
|
declare class EventShipper$1 {
|
|
176
|
+
private appGitContext;
|
|
177
|
+
private ownsAppGitContext;
|
|
178
|
+
private readonly appGitOwner;
|
|
110
179
|
private baseUrl;
|
|
111
180
|
private writeKey?;
|
|
112
181
|
private enabled;
|
|
@@ -137,6 +206,7 @@ declare class EventShipper$1 {
|
|
|
137
206
|
/** URL of the local debugger / Workshop daemon, when one is reachable. */
|
|
138
207
|
private localDebuggerUrl;
|
|
139
208
|
constructor(opts: EventShipperOptions);
|
|
209
|
+
protected ownAppGitContextForShutdown(): void;
|
|
140
210
|
isDebugEnabled(): boolean;
|
|
141
211
|
private authHeaders;
|
|
142
212
|
private requestHeaders;
|
|
@@ -190,6 +260,8 @@ type InternalSpan = {
|
|
|
190
260
|
attributes: Array<OtlpKeyValue | undefined>;
|
|
191
261
|
};
|
|
192
262
|
type TraceShipperOptions = {
|
|
263
|
+
appGit?: AppGitOptions | false;
|
|
264
|
+
appGitContext?: AppGitContext;
|
|
193
265
|
writeKey?: string;
|
|
194
266
|
endpoint?: string;
|
|
195
267
|
enabled?: boolean;
|
|
@@ -258,6 +330,13 @@ type TraceShipperOptions = {
|
|
|
258
330
|
maxTextFieldChars?: number;
|
|
259
331
|
};
|
|
260
332
|
declare class TraceShipper$1 {
|
|
333
|
+
private appGitContext;
|
|
334
|
+
protected ownsAppGitContext: boolean;
|
|
335
|
+
private readonly appGitOwner;
|
|
336
|
+
private appGitEventIds;
|
|
337
|
+
private appGitActiveSpans;
|
|
338
|
+
private appGitCaptured;
|
|
339
|
+
private appGitAdded;
|
|
261
340
|
private baseUrl;
|
|
262
341
|
private writeKey?;
|
|
263
342
|
private enabled;
|
|
@@ -436,6 +515,14 @@ declare class TraceShipper extends TraceShipper$1 {
|
|
|
436
515
|
enqueue(span: OtlpSpan): void;
|
|
437
516
|
}
|
|
438
517
|
|
|
518
|
+
type AppGitFileOptions = {
|
|
519
|
+
commit_sha?: string | null;
|
|
520
|
+
commit_dirty?: boolean | null;
|
|
521
|
+
branch?: string | null;
|
|
522
|
+
detect_branch?: boolean;
|
|
523
|
+
source_directory?: string;
|
|
524
|
+
auto_detect?: boolean;
|
|
525
|
+
};
|
|
439
526
|
interface SelfDiagnosticsSignalDef {
|
|
440
527
|
description: string;
|
|
441
528
|
sentiment?: "POSITIVE" | "NEGATIVE";
|
|
@@ -455,6 +542,7 @@ interface ConfigFile {
|
|
|
455
542
|
event_name?: string;
|
|
456
543
|
custom_properties?: Record<string, unknown>;
|
|
457
544
|
self_diagnostics?: SelfDiagnosticsConfig;
|
|
545
|
+
app_git?: AppGitFileOptions | false;
|
|
458
546
|
}
|
|
459
547
|
interface RaindropConfig {
|
|
460
548
|
writeKey: string;
|
|
@@ -473,6 +561,8 @@ interface RaindropConfig {
|
|
|
473
561
|
eventName: string;
|
|
474
562
|
customProperties: Record<string, unknown>;
|
|
475
563
|
selfDiagnostics?: SelfDiagnosticsConfig;
|
|
564
|
+
/** Application Git identity override. false disables enrichment. */
|
|
565
|
+
appGit?: AppGitOptions | false;
|
|
476
566
|
}
|
|
477
567
|
/**
|
|
478
568
|
* Load config with precedence (low -> high):
|
|
@@ -687,4 +777,4 @@ declare const TOOL_SCHEMA: {
|
|
|
687
777
|
};
|
|
688
778
|
declare function startMcpServer(): Promise<void>;
|
|
689
779
|
|
|
690
|
-
export { DEFAULT_CATEGORY_KEYS, EventShipper, type HookPayload, type LLMCallPhase, type LLMToolCall, type LocalDebuggerResult, type MapperConfig, PACKAGE_NAME, PACKAGE_VERSION, type RaindropConfig, type SelfDiagnosticsConfig, type SelfDiagnosticsSignalDef, type SetupScope, TOOL_SCHEMA, TraceShipper, type TranscriptSummary, detectLocalDebugger, executeTool, extractAppendSystemPrompt, getConfigPath, loadConfig, mapHookToRaindrop, mirrorEventToLocalDebugger, normalizeSignals, parseTranscript, resolveCurrentEventId, resolveToolConfig, startMcpServer, transcriptToProperties, updateConfig };
|
|
780
|
+
export { type AppGitOptions, DEFAULT_CATEGORY_KEYS, EventShipper, type HookPayload, type LLMCallPhase, type LLMToolCall, type LocalDebuggerResult, type MapperConfig, PACKAGE_NAME, PACKAGE_VERSION, type RaindropConfig, type SelfDiagnosticsConfig, type SelfDiagnosticsSignalDef, type SetupScope, TOOL_SCHEMA, TraceShipper, type TranscriptSummary, createAppGitContext, detectLocalDebugger, executeTool, extractAppendSystemPrompt, getConfigPath, loadConfig, mapHookToRaindrop, mirrorEventToLocalDebugger, normalizeSignals, parseTranscript, resolveCurrentEventId, resolveToolConfig, startMcpServer, transcriptToProperties, updateConfig };
|