@raindrop-ai/deep-agents 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/README.md CHANGED
@@ -70,6 +70,34 @@ const raindrop = createRaindropDeepAgents({
70
70
 
71
71
  This sets the `X-Raindrop-Project-Id` header on every event. Omit it (or pass `"default"`) to use your org's default **Production** project — the existing behavior. Single-project orgs need nothing new.
72
72
 
73
+
74
+ ## Application Git identity
75
+
76
+ Each client reports the application commit SHA when it can determine one. Local Git discovery runs in the background and never delays or fails application calls. Automatic branch discovery is off by default.
77
+
78
+ Use `appGit` to override detection or opt out:
79
+
80
+ ```ts
81
+ const raindrop = createRaindropDeepAgents({
82
+ writeKey: "your-write-key",
83
+ appGit: {
84
+ commitSha: "0123456789abcdef0123456789abcdef01234567",
85
+ commitDirty: false,
86
+ branch: "main",
87
+ detectBranch: true,
88
+ sourceDirectory: "/path/to/application",
89
+ },
90
+ });
91
+
92
+ // Disable all application Git reporting.
93
+ const withoutGit = createRaindropDeepAgents({
94
+ writeKey: "your-write-key",
95
+ appGit: false,
96
+ });
97
+ ```
98
+
99
+ `commitSha`, `commitDirty`, and `branch` are explicit overrides. `detectBranch` opts into automatic branch lookup, `sourceDirectory` selects the application repository, and `autoDetect: false` disables automatic sources while retaining explicit values.
100
+
73
101
  ## LangGraph Support
74
102
 
75
103
  Deep Agents is built on LangGraph. The handler automatically:
package/dist/index.d.mts CHANGED
@@ -42,6 +42,64 @@ type SpanIds = {
42
42
  spanIdB64: string;
43
43
  parentSpanIdB64?: string;
44
44
  };
45
+ /** Kept structural so public integration declarations do not depend on private schemas. */
46
+ type AppGitOptions = {
47
+ commitSha?: string | null;
48
+ commitDirty?: boolean | null;
49
+ branch?: string | null;
50
+ detectBranch?: boolean;
51
+ sourceDirectory?: string;
52
+ autoDetect?: boolean;
53
+ };
54
+ type AppGitSnapshot = Readonly<Record<string, unknown>>;
55
+ type AppGitEnvironment = Readonly<Record<string, string | undefined>>;
56
+ type AppGitLocalResult = {
57
+ commitSha?: string;
58
+ commitDirty?: boolean;
59
+ branch?: string;
60
+ };
61
+ type AppGitOperationOwner = string;
62
+ type AppGitLocalResolver = (sourceDirectory: string | undefined, detectBranch: boolean, completed: (result: AppGitLocalResult) => void) => () => void;
63
+ /** One client owns its defaults; operation snapshots never wait for discovery. */
64
+ declare class AppGitContextImpl {
65
+ private defaults;
66
+ private explicit;
67
+ private explicitKeys;
68
+ private cancel;
69
+ private disposed;
70
+ private operations;
71
+ private operationOverflow;
72
+ private detectBranch;
73
+ private replayBranch;
74
+ private disabled;
75
+ constructor(options: AppGitOptions | false | undefined, runtime?: {
76
+ allowLocalGit?: boolean;
77
+ resolveLocal?: AppGitLocalResolver;
78
+ env?: AppGitEnvironment;
79
+ captureLegacyReplayBranch?: boolean;
80
+ allowDiscovery?: boolean;
81
+ });
82
+ private accept;
83
+ snapshot(properties?: Readonly<Record<string, unknown>>): AppGitSnapshot;
84
+ /** Safe defaults when no operation/span start was observed; never infer identity. */
85
+ snapshotExplicit(properties?: Readonly<Record<string, unknown>>, eventId?: string): AppGitSnapshot;
86
+ /** Existing replay branch reporting stays separate from opt-in event properties. */
87
+ snapshotForReplay(): AppGitSnapshot;
88
+ /** Merge a frozen span snapshot without losing client-authored provenance. */
89
+ mergeSnapshot(base: AppGitSnapshot, properties?: Readonly<Record<string, unknown>>, explicitKeys?: ReadonlySet<string>): AppGitSnapshot;
90
+ /** Shippers belonging to one client share this bounded operation registry. */
91
+ forOperation(eventId: string | undefined, properties?: Readonly<Record<string, unknown>>, owner?: AppGitOperationOwner): AppGitSnapshot;
92
+ releaseOperation(eventId: string, owner: AppGitOperationOwner): void;
93
+ finishOperation(eventId: string): void;
94
+ dispose(): void;
95
+ }
96
+ /** Structural at package boundaries: public SDK bundles contain independent copies of core. */
97
+ type AppGitContext = Pick<AppGitContextImpl, "snapshot" | "snapshotForReplay" | "forOperation" | "finishOperation" | "dispose"> & {
98
+ snapshotExplicit?: AppGitContextImpl["snapshotExplicit"];
99
+ mergeSnapshot?: AppGitContextImpl["mergeSnapshot"];
100
+ releaseOperation?: (eventId: string, owner: AppGitOperationOwner) => void;
101
+ };
102
+ declare const AppGitContext: typeof AppGitContextImpl;
45
103
  type Attachment = {
46
104
  type: string;
47
105
  role: string;
@@ -83,6 +141,9 @@ type SignalInput = {
83
141
  after?: string;
84
142
  };
85
143
  type EventShipperOptions = {
144
+ appGit?: AppGitOptions | false;
145
+ /** Share with the trace shipper so one operation uses one source snapshot. */
146
+ appGitContext?: AppGitContext;
86
147
  writeKey?: string;
87
148
  endpoint?: string;
88
149
  enabled?: boolean;
@@ -114,6 +175,9 @@ type EventShipperOptions = {
114
175
  maxTextFieldChars?: number;
115
176
  };
116
177
  declare class EventShipper {
178
+ private appGitContext;
179
+ private ownsAppGitContext;
180
+ private readonly appGitOwner;
117
181
  private baseUrl;
118
182
  private writeKey?;
119
183
  private enabled;
@@ -144,6 +208,7 @@ declare class EventShipper {
144
208
  /** URL of the local debugger / Workshop daemon, when one is reachable. */
145
209
  private localDebuggerUrl;
146
210
  constructor(opts: EventShipperOptions);
211
+ protected ownAppGitContextForShutdown(): void;
147
212
  isDebugEnabled(): boolean;
148
213
  private authHeaders;
149
214
  private requestHeaders;
@@ -197,6 +262,8 @@ type InternalSpan = {
197
262
  attributes: Array<OtlpKeyValue | undefined>;
198
263
  };
199
264
  type TraceShipperOptions = {
265
+ appGit?: AppGitOptions | false;
266
+ appGitContext?: AppGitContext;
200
267
  writeKey?: string;
201
268
  endpoint?: string;
202
269
  enabled?: boolean;
@@ -265,6 +332,13 @@ type TraceShipperOptions = {
265
332
  maxTextFieldChars?: number;
266
333
  };
267
334
  declare class TraceShipper {
335
+ private appGitContext;
336
+ protected ownsAppGitContext: boolean;
337
+ private readonly appGitOwner;
338
+ private appGitEventIds;
339
+ private appGitActiveSpans;
340
+ private appGitCaptured;
341
+ private appGitAdded;
268
342
  private baseUrl;
269
343
  private writeKey?;
270
344
  private enabled;
@@ -513,6 +587,8 @@ interface DeepAgentsOptions {
513
587
  */
514
588
  projectId?: string;
515
589
  traceChains?: boolean;
590
+ /** Application Git identity. Auto-detects commit SHA by default; pass `false` to disable. */
591
+ appGit?: AppGitOptions | false;
516
592
  }
517
593
  type RaindropDeepAgentsClient = {
518
594
  /**
package/dist/index.d.ts CHANGED
@@ -42,6 +42,64 @@ type SpanIds = {
42
42
  spanIdB64: string;
43
43
  parentSpanIdB64?: string;
44
44
  };
45
+ /** Kept structural so public integration declarations do not depend on private schemas. */
46
+ type AppGitOptions = {
47
+ commitSha?: string | null;
48
+ commitDirty?: boolean | null;
49
+ branch?: string | null;
50
+ detectBranch?: boolean;
51
+ sourceDirectory?: string;
52
+ autoDetect?: boolean;
53
+ };
54
+ type AppGitSnapshot = Readonly<Record<string, unknown>>;
55
+ type AppGitEnvironment = Readonly<Record<string, string | undefined>>;
56
+ type AppGitLocalResult = {
57
+ commitSha?: string;
58
+ commitDirty?: boolean;
59
+ branch?: string;
60
+ };
61
+ type AppGitOperationOwner = string;
62
+ type AppGitLocalResolver = (sourceDirectory: string | undefined, detectBranch: boolean, completed: (result: AppGitLocalResult) => void) => () => void;
63
+ /** One client owns its defaults; operation snapshots never wait for discovery. */
64
+ declare class AppGitContextImpl {
65
+ private defaults;
66
+ private explicit;
67
+ private explicitKeys;
68
+ private cancel;
69
+ private disposed;
70
+ private operations;
71
+ private operationOverflow;
72
+ private detectBranch;
73
+ private replayBranch;
74
+ private disabled;
75
+ constructor(options: AppGitOptions | false | undefined, runtime?: {
76
+ allowLocalGit?: boolean;
77
+ resolveLocal?: AppGitLocalResolver;
78
+ env?: AppGitEnvironment;
79
+ captureLegacyReplayBranch?: boolean;
80
+ allowDiscovery?: boolean;
81
+ });
82
+ private accept;
83
+ snapshot(properties?: Readonly<Record<string, unknown>>): AppGitSnapshot;
84
+ /** Safe defaults when no operation/span start was observed; never infer identity. */
85
+ snapshotExplicit(properties?: Readonly<Record<string, unknown>>, eventId?: string): AppGitSnapshot;
86
+ /** Existing replay branch reporting stays separate from opt-in event properties. */
87
+ snapshotForReplay(): AppGitSnapshot;
88
+ /** Merge a frozen span snapshot without losing client-authored provenance. */
89
+ mergeSnapshot(base: AppGitSnapshot, properties?: Readonly<Record<string, unknown>>, explicitKeys?: ReadonlySet<string>): AppGitSnapshot;
90
+ /** Shippers belonging to one client share this bounded operation registry. */
91
+ forOperation(eventId: string | undefined, properties?: Readonly<Record<string, unknown>>, owner?: AppGitOperationOwner): AppGitSnapshot;
92
+ releaseOperation(eventId: string, owner: AppGitOperationOwner): void;
93
+ finishOperation(eventId: string): void;
94
+ dispose(): void;
95
+ }
96
+ /** Structural at package boundaries: public SDK bundles contain independent copies of core. */
97
+ type AppGitContext = Pick<AppGitContextImpl, "snapshot" | "snapshotForReplay" | "forOperation" | "finishOperation" | "dispose"> & {
98
+ snapshotExplicit?: AppGitContextImpl["snapshotExplicit"];
99
+ mergeSnapshot?: AppGitContextImpl["mergeSnapshot"];
100
+ releaseOperation?: (eventId: string, owner: AppGitOperationOwner) => void;
101
+ };
102
+ declare const AppGitContext: typeof AppGitContextImpl;
45
103
  type Attachment = {
46
104
  type: string;
47
105
  role: string;
@@ -83,6 +141,9 @@ type SignalInput = {
83
141
  after?: string;
84
142
  };
85
143
  type EventShipperOptions = {
144
+ appGit?: AppGitOptions | false;
145
+ /** Share with the trace shipper so one operation uses one source snapshot. */
146
+ appGitContext?: AppGitContext;
86
147
  writeKey?: string;
87
148
  endpoint?: string;
88
149
  enabled?: boolean;
@@ -114,6 +175,9 @@ type EventShipperOptions = {
114
175
  maxTextFieldChars?: number;
115
176
  };
116
177
  declare class EventShipper {
178
+ private appGitContext;
179
+ private ownsAppGitContext;
180
+ private readonly appGitOwner;
117
181
  private baseUrl;
118
182
  private writeKey?;
119
183
  private enabled;
@@ -144,6 +208,7 @@ declare class EventShipper {
144
208
  /** URL of the local debugger / Workshop daemon, when one is reachable. */
145
209
  private localDebuggerUrl;
146
210
  constructor(opts: EventShipperOptions);
211
+ protected ownAppGitContextForShutdown(): void;
147
212
  isDebugEnabled(): boolean;
148
213
  private authHeaders;
149
214
  private requestHeaders;
@@ -197,6 +262,8 @@ type InternalSpan = {
197
262
  attributes: Array<OtlpKeyValue | undefined>;
198
263
  };
199
264
  type TraceShipperOptions = {
265
+ appGit?: AppGitOptions | false;
266
+ appGitContext?: AppGitContext;
200
267
  writeKey?: string;
201
268
  endpoint?: string;
202
269
  enabled?: boolean;
@@ -265,6 +332,13 @@ type TraceShipperOptions = {
265
332
  maxTextFieldChars?: number;
266
333
  };
267
334
  declare class TraceShipper {
335
+ private appGitContext;
336
+ protected ownsAppGitContext: boolean;
337
+ private readonly appGitOwner;
338
+ private appGitEventIds;
339
+ private appGitActiveSpans;
340
+ private appGitCaptured;
341
+ private appGitAdded;
268
342
  private baseUrl;
269
343
  private writeKey?;
270
344
  private enabled;
@@ -513,6 +587,8 @@ interface DeepAgentsOptions {
513
587
  */
514
588
  projectId?: string;
515
589
  traceChains?: boolean;
590
+ /** Application Git identity. Auto-detects commit SHA by default; pass `false` to disable. */
591
+ appGit?: AppGitOptions | false;
516
592
  }
517
593
  type RaindropDeepAgentsClient = {
518
594
  /**