@raindrop-ai/deep-agents 0.1.0 → 0.1.1

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
@@ -120,17 +120,7 @@ The `createRaindropDeepAgents()` factory returns:
120
120
  pnpm test -- tests/handler.test.ts
121
121
  ```
122
122
 
123
- **E2E tests** run REAL Deep Agents workflows via `createDeepAgent()` against a REAL LLM (OpenAI gpt-4o-mini) and verify events / tool calls / traces against the production dashboard TRPC API. They skip automatically when any of `RAINDROP_WRITE_KEY`, `OPENAI_API_KEY`, or `RAINDROP_DASHBOARD_TOKEN` is missing.
124
-
125
- ```bash
126
- # E2E — requires all three keys
127
- RAINDROP_WRITE_KEY=xxx \
128
- OPENAI_API_KEY=sk-... \
129
- RAINDROP_DASHBOARD_TOKEN=eyJ... \
130
- pnpm test -- tests/e2e.test.ts
131
- ```
132
-
133
- The dashboard token comes from `app.raindrop.ai` → DevTools → Network → any `backend.raindrop.ai` request → `Authorization: Bearer ...` (expires every ~30 min, so grab a fresh one immediately before running).
123
+ End-to-end coverage runs through the cross-SDK [conformance harness](https://github.com/invisible-tools/raindrop-sdk-harness). The `deep-agents` conformance driver (`conformance/deep-agents-driver.mjs`) maps the shared scenario corpus onto this package's public API. The fault lane runs locally and on every PR against a fault-injecting fake ingest; the prod lane verifies real ingest through the public Query API readback. See [`conformance/README.md`](../../conformance/README.md) and the harness [README](https://github.com/invisible-tools/raindrop-sdk-harness/blob/main/README.md) / [HOW-IT-WORKS](https://github.com/invisible-tools/raindrop-sdk-harness/blob/main/docs/HOW-IT-WORKS.md).
134
124
 
135
125
  ## Python
136
126
 
package/dist/index.d.mts CHANGED
@@ -52,6 +52,10 @@ type IdentifyInput = {
52
52
  userId: string;
53
53
  traits?: Record<string, unknown>;
54
54
  };
55
+ type EventUsage = {
56
+ promptTokens?: number;
57
+ completionTokens?: number;
58
+ };
55
59
  type Patch = {
56
60
  eventName?: string;
57
61
  userId?: string;
@@ -59,6 +63,8 @@ type Patch = {
59
63
  input?: string;
60
64
  output?: string;
61
65
  model?: string;
66
+ usage?: EventUsage;
67
+ error?: unknown;
62
68
  properties?: Record<string, unknown>;
63
69
  featureFlags?: Record<string, string>;
64
70
  attachments?: Attachment[];
@@ -157,13 +163,7 @@ declare class EventShipper {
157
163
  */
158
164
  private requestOpts;
159
165
  patch(eventId: string, patch: Patch): Promise<void>;
160
- finish(eventId: string, patch: {
161
- output?: string;
162
- model?: string;
163
- properties?: Record<string, unknown>;
164
- featureFlags?: Record<string, string>;
165
- userId?: string;
166
- }): Promise<void>;
166
+ finish(eventId: string, patch: Pick<Patch, "output" | "model" | "usage" | "error" | "properties" | "featureFlags" | "userId">): Promise<void>;
167
167
  flush(): Promise<void>;
168
168
  shutdown(): Promise<void>;
169
169
  trackSignal(signal: SignalInput): Promise<void>;
@@ -336,6 +336,9 @@ declare class TraceShipper {
336
336
  spanIdB64: string;
337
337
  };
338
338
  eventId: string;
339
+ userId?: string;
340
+ convoId?: string;
341
+ eventName?: string;
339
342
  operationId?: string;
340
343
  attributes?: Array<OtlpKeyValue | undefined>;
341
344
  startTimeUnixNano?: string;
@@ -354,6 +357,9 @@ declare class TraceShipper {
354
357
  spanIdB64: string;
355
358
  };
356
359
  eventId: string;
360
+ userId?: string;
361
+ convoId?: string;
362
+ eventName?: string;
357
363
  startTimeUnixNano: string;
358
364
  endTimeUnixNano: string;
359
365
  attributes?: Array<OtlpKeyValue | undefined>;
@@ -463,6 +469,7 @@ declare class RaindropDeepAgentsHandler extends BaseCallbackHandler {
463
469
  private getParent;
464
470
  private cleanup;
465
471
  private finalizeEventIfRoot;
472
+ private rootErrorPatch;
466
473
  handleLLMStart(llm: Serialized, prompts: string[], runId: string, parentRunId?: string, _extraParams?: Record<string, unknown>, tags?: string[], metadata?: Record<string, unknown>, runName?: string): Promise<void>;
467
474
  handleChatModelStart(llm: Serialized, messages: BaseMessage[][], runId: string, parentRunId?: string, _extraParams?: Record<string, unknown>, tags?: string[], metadata?: Record<string, unknown>, runName?: string): Promise<void>;
468
475
  handleLLMEnd(output: LLMResult, runId: string, _parentRunId?: string): Promise<void>;
package/dist/index.d.ts CHANGED
@@ -52,6 +52,10 @@ type IdentifyInput = {
52
52
  userId: string;
53
53
  traits?: Record<string, unknown>;
54
54
  };
55
+ type EventUsage = {
56
+ promptTokens?: number;
57
+ completionTokens?: number;
58
+ };
55
59
  type Patch = {
56
60
  eventName?: string;
57
61
  userId?: string;
@@ -59,6 +63,8 @@ type Patch = {
59
63
  input?: string;
60
64
  output?: string;
61
65
  model?: string;
66
+ usage?: EventUsage;
67
+ error?: unknown;
62
68
  properties?: Record<string, unknown>;
63
69
  featureFlags?: Record<string, string>;
64
70
  attachments?: Attachment[];
@@ -157,13 +163,7 @@ declare class EventShipper {
157
163
  */
158
164
  private requestOpts;
159
165
  patch(eventId: string, patch: Patch): Promise<void>;
160
- finish(eventId: string, patch: {
161
- output?: string;
162
- model?: string;
163
- properties?: Record<string, unknown>;
164
- featureFlags?: Record<string, string>;
165
- userId?: string;
166
- }): Promise<void>;
166
+ finish(eventId: string, patch: Pick<Patch, "output" | "model" | "usage" | "error" | "properties" | "featureFlags" | "userId">): Promise<void>;
167
167
  flush(): Promise<void>;
168
168
  shutdown(): Promise<void>;
169
169
  trackSignal(signal: SignalInput): Promise<void>;
@@ -336,6 +336,9 @@ declare class TraceShipper {
336
336
  spanIdB64: string;
337
337
  };
338
338
  eventId: string;
339
+ userId?: string;
340
+ convoId?: string;
341
+ eventName?: string;
339
342
  operationId?: string;
340
343
  attributes?: Array<OtlpKeyValue | undefined>;
341
344
  startTimeUnixNano?: string;
@@ -354,6 +357,9 @@ declare class TraceShipper {
354
357
  spanIdB64: string;
355
358
  };
356
359
  eventId: string;
360
+ userId?: string;
361
+ convoId?: string;
362
+ eventName?: string;
357
363
  startTimeUnixNano: string;
358
364
  endTimeUnixNano: string;
359
365
  attributes?: Array<OtlpKeyValue | undefined>;
@@ -463,6 +469,7 @@ declare class RaindropDeepAgentsHandler extends BaseCallbackHandler {
463
469
  private getParent;
464
470
  private cleanup;
465
471
  private finalizeEventIfRoot;
472
+ private rootErrorPatch;
466
473
  handleLLMStart(llm: Serialized, prompts: string[], runId: string, parentRunId?: string, _extraParams?: Record<string, unknown>, tags?: string[], metadata?: Record<string, unknown>, runName?: string): Promise<void>;
467
474
  handleChatModelStart(llm: Serialized, messages: BaseMessage[][], runId: string, parentRunId?: string, _extraParams?: Record<string, unknown>, tags?: string[], metadata?: Record<string, unknown>, runName?: string): Promise<void>;
468
475
  handleLLMEnd(output: LLMResult, runId: string, _parentRunId?: string): Promise<void>;