@raindrop-ai/ai-sdk 0.0.41 → 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/dist/{chunk-3EYXAZ2H.mjs → chunk-NU5KYBJA.mjs} +74 -11
- package/dist/{index-BCojLiWV.d.mts → index-BQwgg9kQ.d.mts} +53 -1
- package/dist/{index-BCojLiWV.d.ts → index-BQwgg9kQ.d.ts} +53 -1
- package/dist/index.browser.d.mts +53 -1
- package/dist/index.browser.d.ts +53 -1
- package/dist/index.browser.js +74 -10
- package/dist/index.browser.mjs +74 -11
- package/dist/index.node.d.mts +1 -1
- package/dist/index.node.d.ts +1 -1
- package/dist/index.node.js +74 -10
- package/dist/index.node.mjs +1 -1
- package/dist/index.workers.d.mts +1 -1
- package/dist/index.workers.d.ts +1 -1
- package/dist/index.workers.js +74 -10
- package/dist/index.workers.mjs +1 -1
- package/package.json +2 -2
package/dist/index.browser.d.ts
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
type FeatureFlagValue = string | number | boolean;
|
|
2
|
+
type FeatureFlags = string[] | Record<string, FeatureFlagValue>;
|
|
3
|
+
/**
|
|
4
|
+
* Normalizes feature flags from the two accepted input forms into a
|
|
5
|
+
* canonical `Record<string, string>` ready for the wire payload.
|
|
6
|
+
*
|
|
7
|
+
* - Array form: `["a", "b"]` → `{"a": "true", "b": "true"}`
|
|
8
|
+
* - Object form: `{ a: "v2", b: true, c: 3 }` → `{"a": "v2", "b": "true", "c": "3"}`
|
|
9
|
+
*/
|
|
10
|
+
declare function normalizeFeatureFlags(input: FeatureFlags): Record<string, string>;
|
|
11
|
+
|
|
1
12
|
type OtlpAnyValue = {
|
|
2
13
|
stringValue?: string;
|
|
3
14
|
intValue?: string;
|
|
@@ -53,6 +64,7 @@ type Patch = {
|
|
|
53
64
|
output?: string;
|
|
54
65
|
model?: string;
|
|
55
66
|
properties?: Record<string, unknown>;
|
|
67
|
+
featureFlags?: Record<string, string>;
|
|
56
68
|
attachments?: Attachment$1[];
|
|
57
69
|
isPending?: boolean;
|
|
58
70
|
timestamp?: string;
|
|
@@ -153,6 +165,7 @@ declare class EventShipper$1 {
|
|
|
153
165
|
output?: string;
|
|
154
166
|
model?: string;
|
|
155
167
|
properties?: Record<string, unknown>;
|
|
168
|
+
featureFlags?: Record<string, string>;
|
|
156
169
|
userId?: string;
|
|
157
170
|
}): Promise<void>;
|
|
158
171
|
flush(): Promise<void>;
|
|
@@ -490,6 +503,37 @@ declare class TraceShipper extends TraceShipper$1 {
|
|
|
490
503
|
constructor(opts: ConstructorParameters<typeof TraceShipper$1>[0]);
|
|
491
504
|
}
|
|
492
505
|
|
|
506
|
+
/**
|
|
507
|
+
* Raindrop telemetry integration for AI SDK v7+
|
|
508
|
+
*
|
|
509
|
+
* Implements the AI SDK's `Telemetry` interface (formerly `TelemetryIntegration`
|
|
510
|
+
* before v7 beta.111) to capture traces and events natively, replacing the
|
|
511
|
+
* Proxy-based wrapping used for v4-v6.
|
|
512
|
+
*
|
|
513
|
+
* Modeled after the upstream OpenTelemetry integration but uses Raindrop's
|
|
514
|
+
* TraceShipper (OTLP/HTTP) + EventShipper instead of the OTel Tracer API.
|
|
515
|
+
*
|
|
516
|
+
* Compatibility: this class targets the latest published v7 build but also
|
|
517
|
+
* exposes the older v7 callback names as aliases so it works on every v7
|
|
518
|
+
* beta/canary released to date:
|
|
519
|
+
* - `onToolCallStart`/`onToolCallFinish` (< beta.111) alongside
|
|
520
|
+
* `onToolExecutionStart`/`onToolExecutionEnd` (>= beta.111).
|
|
521
|
+
* - Current `onToolExecutionEnd` events use the `toolOutput` discriminated
|
|
522
|
+
* union; older builds used top-level `success`/`output`/`error` fields.
|
|
523
|
+
* - `onFinish`/`onEmbedFinish` (< canary.159) alongside `onEnd`/`onEmbedEnd`
|
|
524
|
+
* (>= canary.159, vercel/ai renamed the operation finalizers).
|
|
525
|
+
* - `onAbort` (added as a telemetry-integration callback on the v7 canary
|
|
526
|
+
* line, post-beta.116) finalizes open spans + the pending event when a
|
|
527
|
+
* `streamText` call is cancelled via its `AbortSignal`. Builds that don't
|
|
528
|
+
* dispatch it to integrations simply never call it, so it's a no-op there.
|
|
529
|
+
*
|
|
530
|
+
* Step-end note: we intentionally implement only `onStepFinish` (not the newer
|
|
531
|
+
* `onStepEnd`). The latest canary dispatcher fans every step-end event out to
|
|
532
|
+
* BOTH `onStepEnd` and the deprecated `onStepFinish` on each integration, so
|
|
533
|
+
* implementing both names would double-close the step span. `onStepFinish`
|
|
534
|
+
* alone is dispatched on every published v7 beta/canary to date.
|
|
535
|
+
*/
|
|
536
|
+
|
|
493
537
|
type Listener<T> = (event: T) => PromiseLike<void> | void;
|
|
494
538
|
type ToolExecutionEndEvent = {
|
|
495
539
|
callId: string;
|
|
@@ -563,6 +607,7 @@ type RaindropTelemetryIntegrationOptions = {
|
|
|
563
607
|
eventName?: string;
|
|
564
608
|
convoId?: string;
|
|
565
609
|
properties?: Record<string, unknown>;
|
|
610
|
+
featureFlags?: FeatureFlags;
|
|
566
611
|
};
|
|
567
612
|
};
|
|
568
613
|
declare class RaindropTelemetryIntegration implements TelemetryIntegration {
|
|
@@ -839,6 +884,8 @@ type EventMetadataOptions = {
|
|
|
839
884
|
eventName?: string;
|
|
840
885
|
/** Additional properties to merge with wrap-time properties */
|
|
841
886
|
properties?: Record<string, unknown>;
|
|
887
|
+
/** Feature flags to attach to this event (merged with wrap-time flags; call-time wins) */
|
|
888
|
+
featureFlags?: FeatureFlags;
|
|
842
889
|
};
|
|
843
890
|
/**
|
|
844
891
|
* Creates metadata for use with the AI SDK's `experimental_telemetry.metadata` option.
|
|
@@ -1042,6 +1089,7 @@ type RaindropAISDKContext = {
|
|
|
1042
1089
|
eventName?: string;
|
|
1043
1090
|
convoId?: string;
|
|
1044
1091
|
properties?: Record<string, unknown>;
|
|
1092
|
+
featureFlags?: FeatureFlags;
|
|
1045
1093
|
attachments?: Attachment[];
|
|
1046
1094
|
};
|
|
1047
1095
|
|
|
@@ -1051,6 +1099,7 @@ type BuildEventPatch = {
|
|
|
1051
1099
|
output?: string;
|
|
1052
1100
|
model?: string;
|
|
1053
1101
|
properties?: Record<string, unknown>;
|
|
1102
|
+
featureFlags?: Record<string, string>;
|
|
1054
1103
|
attachments?: Attachment[];
|
|
1055
1104
|
};
|
|
1056
1105
|
/**
|
|
@@ -1215,6 +1264,7 @@ type EventPatch = {
|
|
|
1215
1264
|
output?: string;
|
|
1216
1265
|
model?: string;
|
|
1217
1266
|
properties?: Record<string, unknown>;
|
|
1267
|
+
featureFlags?: Record<string, string>;
|
|
1218
1268
|
attachments?: Attachment[];
|
|
1219
1269
|
isPending?: boolean;
|
|
1220
1270
|
timestamp?: string;
|
|
@@ -1247,10 +1297,12 @@ type RaindropAISDKClient = {
|
|
|
1247
1297
|
patch(eventId: string, patch: EventPatch): Promise<void>;
|
|
1248
1298
|
addAttachments(eventId: string, attachments: Attachment[]): Promise<void>;
|
|
1249
1299
|
setProperties(eventId: string, properties: Record<string, unknown>): Promise<void>;
|
|
1300
|
+
setFeatureFlags(eventId: string, featureFlags: FeatureFlags): Promise<void>;
|
|
1250
1301
|
finish(eventId: string, patch: {
|
|
1251
1302
|
output?: string;
|
|
1252
1303
|
model?: string;
|
|
1253
1304
|
properties?: Record<string, unknown>;
|
|
1305
|
+
featureFlags?: Record<string, string>;
|
|
1254
1306
|
}): Promise<void>;
|
|
1255
1307
|
};
|
|
1256
1308
|
/**
|
|
@@ -1361,4 +1413,4 @@ type RaindropTelemetryOptions = RaindropAISDKOptions & {
|
|
|
1361
1413
|
*/
|
|
1362
1414
|
declare function raindrop(options?: RaindropTelemetryOptions): RaindropTelemetryIntegration;
|
|
1363
1415
|
|
|
1364
|
-
export { type AISDKChatRequestLike, type AISDKChatRequestMessageLike, type AISDKMessage, type AgentCallMetadata, type AgentWithMetadata, type Attachment, type BuildEventPatch, ContextManager, type ContextSpan, type CreateSpanArgs, DEFAULT_MAX_TEXT_FIELD_CHARS, DEFAULT_REDACT_ATTRIBUTE_KEYS, DEFAULT_SECRET_KEY_NAMES, type EndSpanArgs, type EventBuilder, type EventMetadataOptions, type IdentifyInput, type OtlpAnyValue, type OtlpSpan, type ParentToolContext, REDACTED_PLACEHOLDER, type RaindropAISDKClient, type RaindropAISDKContext, type RaindropAISDKOptions, type RaindropCallMetadata, RaindropTelemetryIntegration, type RaindropTelemetryIntegrationOptions, type RaindropTelemetryOptions, type SelfDiagnosticsOptions, type SelfDiagnosticsSignalDefinition, type SelfDiagnosticsSignalDefinitions, type SelfDiagnosticsTool, type SelfDiagnosticsToolInput, type SelfDiagnosticsToolOptions, type SelfDiagnosticsToolResult, type StartSpanArgs, TRUNCATION_MARKER, type TraceSpan, type TransformSpanHook, type WrapAISDKOptions, type WrappedAI, type WrappedAISDK, _resetParentToolContextStorage, _resetRaindropCallMetadataStorage, _resetWarnedMissingUserId, boundedStringify, capText, clearParentToolContext, createRaindropAISDK, currentSpan, defaultTransformSpan, enterParentToolContext, eventMetadata, eventMetadataFromChatRequest, getContextManager, getCurrentParentToolContext, getCurrentRaindropCallMetadata, raindrop, readRaindropCallMetadataFromArgs, redactJsonAttributeValue, redactSecretsInObject, runWithParentToolContext, runWithRaindropCallMetadata, withCurrent };
|
|
1416
|
+
export { type AISDKChatRequestLike, type AISDKChatRequestMessageLike, type AISDKMessage, type AgentCallMetadata, type AgentWithMetadata, type Attachment, type BuildEventPatch, ContextManager, type ContextSpan, type CreateSpanArgs, DEFAULT_MAX_TEXT_FIELD_CHARS, DEFAULT_REDACT_ATTRIBUTE_KEYS, DEFAULT_SECRET_KEY_NAMES, type EndSpanArgs, type EventBuilder, type EventMetadataOptions, type FeatureFlagValue, type FeatureFlags, type IdentifyInput, type OtlpAnyValue, type OtlpSpan, type ParentToolContext, REDACTED_PLACEHOLDER, type RaindropAISDKClient, type RaindropAISDKContext, type RaindropAISDKOptions, type RaindropCallMetadata, RaindropTelemetryIntegration, type RaindropTelemetryIntegrationOptions, type RaindropTelemetryOptions, type SelfDiagnosticsOptions, type SelfDiagnosticsSignalDefinition, type SelfDiagnosticsSignalDefinitions, type SelfDiagnosticsTool, type SelfDiagnosticsToolInput, type SelfDiagnosticsToolOptions, type SelfDiagnosticsToolResult, type StartSpanArgs, TRUNCATION_MARKER, type TraceSpan, type TransformSpanHook, type WrapAISDKOptions, type WrappedAI, type WrappedAISDK, _resetParentToolContextStorage, _resetRaindropCallMetadataStorage, _resetWarnedMissingUserId, boundedStringify, capText, clearParentToolContext, createRaindropAISDK, currentSpan, defaultTransformSpan, enterParentToolContext, eventMetadata, eventMetadataFromChatRequest, getContextManager, getCurrentParentToolContext, getCurrentRaindropCallMetadata, normalizeFeatureFlags, raindrop, readRaindropCallMetadataFromArgs, redactJsonAttributeValue, redactSecretsInObject, runWithParentToolContext, runWithRaindropCallMetadata, withCurrent };
|
package/dist/index.browser.js
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
// ../core/dist/chunk-
|
|
3
|
+
// ../core/dist/chunk-Y5LUB7OE.js
|
|
4
|
+
function normalizeFeatureFlags(input) {
|
|
5
|
+
if (Array.isArray(input)) {
|
|
6
|
+
return Object.fromEntries(input.map((name) => [name, "true"]));
|
|
7
|
+
}
|
|
8
|
+
return Object.fromEntries(
|
|
9
|
+
Object.entries(input).map(([k, v]) => [k, String(v)])
|
|
10
|
+
);
|
|
11
|
+
}
|
|
4
12
|
function getCrypto() {
|
|
5
13
|
const c = globalThis.crypto;
|
|
6
14
|
return c;
|
|
@@ -435,13 +443,16 @@ function projectIdHeaders(projectId) {
|
|
|
435
443
|
var SHUTDOWN_DEADLINE_MS = 1e4;
|
|
436
444
|
var POST_SHUTDOWN_TIMEOUT_MS = 5e3;
|
|
437
445
|
function mergePatches(target, source) {
|
|
438
|
-
var _a, _b, _c, _d;
|
|
446
|
+
var _a, _b, _c, _d, _e, _f;
|
|
439
447
|
const out = { ...target, ...source };
|
|
440
448
|
if (target.properties || source.properties) {
|
|
441
449
|
out.properties = { ...(_a = target.properties) != null ? _a : {}, ...(_b = source.properties) != null ? _b : {} };
|
|
442
450
|
}
|
|
451
|
+
if (target.featureFlags || source.featureFlags) {
|
|
452
|
+
out.featureFlags = { ...(_c = target.featureFlags) != null ? _c : {}, ...(_d = source.featureFlags) != null ? _d : {} };
|
|
453
|
+
}
|
|
443
454
|
if (target.attachments || source.attachments) {
|
|
444
|
-
out.attachments = [...(
|
|
455
|
+
out.attachments = [...(_e = target.attachments) != null ? _e : [], ...(_f = source.attachments) != null ? _f : []];
|
|
445
456
|
}
|
|
446
457
|
return out;
|
|
447
458
|
}
|
|
@@ -711,6 +722,7 @@ var EventShipper = class {
|
|
|
711
722
|
...wizardSession ? { "raindrop.wizardSession": wizardSession } : {},
|
|
712
723
|
$context: this.context
|
|
713
724
|
},
|
|
725
|
+
...accumulated.featureFlags && Object.keys(accumulated.featureFlags).length > 0 ? { feature_flags: accumulated.featureFlags } : {},
|
|
714
726
|
attachments: accumulated.attachments,
|
|
715
727
|
is_pending: isPending
|
|
716
728
|
};
|
|
@@ -1299,7 +1311,7 @@ async function* asyncGeneratorWithCurrent(span, gen) {
|
|
|
1299
1311
|
// package.json
|
|
1300
1312
|
var package_default = {
|
|
1301
1313
|
name: "@raindrop-ai/ai-sdk",
|
|
1302
|
-
version: "0.
|
|
1314
|
+
version: "0.1.1"};
|
|
1303
1315
|
|
|
1304
1316
|
// src/internal/version.ts
|
|
1305
1317
|
var libraryName = package_default.name;
|
|
@@ -2721,6 +2733,20 @@ var RaindropTelemetryIntegration = class {
|
|
|
2721
2733
|
} else if (properties && typeof properties === "object") {
|
|
2722
2734
|
result.properties = properties;
|
|
2723
2735
|
}
|
|
2736
|
+
const featureFlags = metadata["raindrop.featureFlags"];
|
|
2737
|
+
if (typeof featureFlags === "string") {
|
|
2738
|
+
try {
|
|
2739
|
+
const parsed = JSON.parse(featureFlags);
|
|
2740
|
+
if (parsed && typeof parsed === "object") {
|
|
2741
|
+
result.featureFlags = normalizeFeatureFlags(parsed);
|
|
2742
|
+
}
|
|
2743
|
+
} catch (e) {
|
|
2744
|
+
}
|
|
2745
|
+
} else if (featureFlags && typeof featureFlags === "object") {
|
|
2746
|
+
result.featureFlags = normalizeFeatureFlags(
|
|
2747
|
+
featureFlags
|
|
2748
|
+
);
|
|
2749
|
+
}
|
|
2724
2750
|
return result;
|
|
2725
2751
|
}
|
|
2726
2752
|
/**
|
|
@@ -2935,7 +2961,7 @@ var RaindropTelemetryIntegration = class {
|
|
|
2935
2961
|
* same event ID into a separate canonical row.
|
|
2936
2962
|
*/
|
|
2937
2963
|
finalizeGenerateEvent(state, output, model, keepPending = false) {
|
|
2938
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
2964
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
2939
2965
|
const suppressSubagentEvent = state.subagentName !== void 0 && state.subagentToolCallSpan !== void 0;
|
|
2940
2966
|
if (!this.sendEvents || suppressSubagentEvent) return;
|
|
2941
2967
|
const callMeta = this.extractRaindropMetadata(state.metadata);
|
|
@@ -2948,7 +2974,11 @@ var RaindropTelemetryIntegration = class {
|
|
|
2948
2974
|
...(_f = this.defaultContext) == null ? void 0 : _f.properties,
|
|
2949
2975
|
...callMeta.properties
|
|
2950
2976
|
};
|
|
2951
|
-
const
|
|
2977
|
+
const featureFlags = {
|
|
2978
|
+
...((_g = this.defaultContext) == null ? void 0 : _g.featureFlags) ? normalizeFeatureFlags(this.defaultContext.featureFlags) : {},
|
|
2979
|
+
...callMeta.featureFlags
|
|
2980
|
+
};
|
|
2981
|
+
const convoId = (_i = callMeta.convoId) != null ? _i : (_h = this.defaultContext) == null ? void 0 : _h.convoId;
|
|
2952
2982
|
void this.eventShipper.patch(state.eventId, {
|
|
2953
2983
|
eventName,
|
|
2954
2984
|
userId,
|
|
@@ -2957,6 +2987,7 @@ var RaindropTelemetryIntegration = class {
|
|
|
2957
2987
|
output: cappedOutput,
|
|
2958
2988
|
model,
|
|
2959
2989
|
properties: Object.keys(properties).length > 0 ? properties : void 0,
|
|
2990
|
+
featureFlags: Object.keys(featureFlags).length > 0 ? featureFlags : void 0,
|
|
2960
2991
|
isPending: keepPending
|
|
2961
2992
|
}).catch((err) => {
|
|
2962
2993
|
if (this.debug) {
|
|
@@ -3280,6 +3311,20 @@ function extractRaindropMetadata(metadata) {
|
|
|
3280
3311
|
} else if (properties && typeof properties === "object") {
|
|
3281
3312
|
result.properties = properties;
|
|
3282
3313
|
}
|
|
3314
|
+
const featureFlags = metadata["raindrop.featureFlags"];
|
|
3315
|
+
if (typeof featureFlags === "string") {
|
|
3316
|
+
try {
|
|
3317
|
+
const parsed = JSON.parse(featureFlags);
|
|
3318
|
+
if (parsed && typeof parsed === "object") {
|
|
3319
|
+
result.featureFlags = normalizeFeatureFlags(parsed);
|
|
3320
|
+
}
|
|
3321
|
+
} catch (e) {
|
|
3322
|
+
}
|
|
3323
|
+
} else if (featureFlags && typeof featureFlags === "object") {
|
|
3324
|
+
result.featureFlags = normalizeFeatureFlags(
|
|
3325
|
+
featureFlags
|
|
3326
|
+
);
|
|
3327
|
+
}
|
|
3283
3328
|
return result;
|
|
3284
3329
|
}
|
|
3285
3330
|
function mergeContexts(wrapTime, callTime) {
|
|
@@ -3294,6 +3339,10 @@ function mergeContexts(wrapTime, callTime) {
|
|
|
3294
3339
|
...callTime.properties
|
|
3295
3340
|
};
|
|
3296
3341
|
}
|
|
3342
|
+
if (callTime.featureFlags) {
|
|
3343
|
+
const wrapTimeFlags = wrapTime.featureFlags ? normalizeFeatureFlags(wrapTime.featureFlags) : {};
|
|
3344
|
+
result.featureFlags = { ...wrapTimeFlags, ...callTime.featureFlags };
|
|
3345
|
+
}
|
|
3297
3346
|
return result;
|
|
3298
3347
|
}
|
|
3299
3348
|
function detectAISDKVersion(aiSDK) {
|
|
@@ -3606,6 +3655,7 @@ function createFinalize(params) {
|
|
|
3606
3655
|
output: defaultOutput,
|
|
3607
3656
|
model,
|
|
3608
3657
|
properties: setup.ctx.properties,
|
|
3658
|
+
featureFlags: setup.ctx.featureFlags ? normalizeFeatureFlags(setup.ctx.featureFlags) : void 0,
|
|
3609
3659
|
attachments: mergeAttachments(setup.ctx.attachments, inputAttachments, outputAttachments)
|
|
3610
3660
|
};
|
|
3611
3661
|
const built = await maybeBuildEvent(options.buildEvent, allMessages);
|
|
@@ -3659,6 +3709,7 @@ function createFinalize(params) {
|
|
|
3659
3709
|
output,
|
|
3660
3710
|
model: finalModel,
|
|
3661
3711
|
properties: patch.properties,
|
|
3712
|
+
featureFlags: patch.featureFlags,
|
|
3662
3713
|
attachments: patch.attachments,
|
|
3663
3714
|
isPending: keepEventPending
|
|
3664
3715
|
}).catch((err) => {
|
|
@@ -3890,7 +3941,8 @@ function wrapAISDK(aiSDK, deps) {
|
|
|
3890
3941
|
eventId: wrapTimeCtx.eventId,
|
|
3891
3942
|
eventName: wrapTimeCtx.eventName,
|
|
3892
3943
|
convoId: wrapTimeCtx.convoId,
|
|
3893
|
-
properties: wrapTimeCtx.properties
|
|
3944
|
+
properties: wrapTimeCtx.properties,
|
|
3945
|
+
featureFlags: wrapTimeCtx.featureFlags ? normalizeFeatureFlags(wrapTimeCtx.featureFlags) : void 0
|
|
3894
3946
|
}
|
|
3895
3947
|
});
|
|
3896
3948
|
const registerFn = resolveRegisterTelemetry(aiSDK);
|
|
@@ -4166,6 +4218,7 @@ function wrapAgentGenerate(generate, instance, agentSettings, className, aiSDK,
|
|
|
4166
4218
|
output: outputText,
|
|
4167
4219
|
model,
|
|
4168
4220
|
properties: ctx.properties,
|
|
4221
|
+
featureFlags: ctx.featureFlags ? normalizeFeatureFlags(ctx.featureFlags) : void 0,
|
|
4169
4222
|
attachments: mergeAttachments(ctx.attachments, inputAttachments, outputAttachments)
|
|
4170
4223
|
};
|
|
4171
4224
|
const built = await maybeBuildEvent(deps.options.buildEvent, allMessages);
|
|
@@ -4233,6 +4286,7 @@ function wrapAgentGenerate(generate, instance, agentSettings, className, aiSDK,
|
|
|
4233
4286
|
output,
|
|
4234
4287
|
model: finalModel,
|
|
4235
4288
|
properties: patch.properties,
|
|
4289
|
+
featureFlags: patch.featureFlags,
|
|
4236
4290
|
attachments: patch.attachments,
|
|
4237
4291
|
isPending: false
|
|
4238
4292
|
}).catch((err) => {
|
|
@@ -4374,6 +4428,7 @@ function wrapAgentStream(stream, instance, agentSettings, className, aiSDK, deps
|
|
|
4374
4428
|
output: outputText,
|
|
4375
4429
|
model,
|
|
4376
4430
|
properties: ctx.properties,
|
|
4431
|
+
featureFlags: ctx.featureFlags ? normalizeFeatureFlags(ctx.featureFlags) : void 0,
|
|
4377
4432
|
attachments: mergeAttachments(ctx.attachments, inputAttachments, outputAttachments)
|
|
4378
4433
|
};
|
|
4379
4434
|
const built = await maybeBuildEvent(deps.options.buildEvent, allMessages);
|
|
@@ -4441,6 +4496,7 @@ function wrapAgentStream(stream, instance, agentSettings, className, aiSDK, deps
|
|
|
4441
4496
|
output,
|
|
4442
4497
|
model: finalModel,
|
|
4443
4498
|
properties: patch.properties,
|
|
4499
|
+
featureFlags: patch.featureFlags,
|
|
4444
4500
|
attachments: patch.attachments,
|
|
4445
4501
|
isPending: false
|
|
4446
4502
|
}).catch((err) => {
|
|
@@ -5038,7 +5094,7 @@ async function maybeBuildEvent(buildEvent, messages) {
|
|
|
5038
5094
|
}
|
|
5039
5095
|
}
|
|
5040
5096
|
function mergeBuildEventPatch(defaults, override) {
|
|
5041
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
5097
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
5042
5098
|
if (!override) return defaults;
|
|
5043
5099
|
return {
|
|
5044
5100
|
eventName: (_a = override.eventName) != null ? _a : defaults.eventName,
|
|
@@ -5046,7 +5102,8 @@ function mergeBuildEventPatch(defaults, override) {
|
|
|
5046
5102
|
output: (_c = override.output) != null ? _c : defaults.output,
|
|
5047
5103
|
model: (_d = override.model) != null ? _d : defaults.model,
|
|
5048
5104
|
properties: override.properties !== void 0 ? { ...(_e = defaults.properties) != null ? _e : {}, ...(_f = override.properties) != null ? _f : {} } : defaults.properties,
|
|
5049
|
-
|
|
5105
|
+
featureFlags: override.featureFlags !== void 0 ? { ...(_g = defaults.featureFlags) != null ? _g : {}, ...(_h = override.featureFlags) != null ? _h : {} } : defaults.featureFlags,
|
|
5106
|
+
attachments: override.attachments !== void 0 ? [...(_i = defaults.attachments) != null ? _i : [], ...(_j = override.attachments) != null ? _j : []] : defaults.attachments
|
|
5050
5107
|
};
|
|
5051
5108
|
}
|
|
5052
5109
|
function mergeAttachments(...groups) {
|
|
@@ -5077,6 +5134,8 @@ function eventMetadata(options) {
|
|
|
5077
5134
|
if (options.convoId) result["raindrop.convoId"] = options.convoId;
|
|
5078
5135
|
if (options.eventName) result["raindrop.eventName"] = options.eventName;
|
|
5079
5136
|
if (options.properties) result["raindrop.properties"] = JSON.stringify(options.properties);
|
|
5137
|
+
if (options.featureFlags)
|
|
5138
|
+
result["raindrop.featureFlags"] = JSON.stringify(normalizeFeatureFlags(options.featureFlags));
|
|
5080
5139
|
return result;
|
|
5081
5140
|
}
|
|
5082
5141
|
function deriveChatTurnMessageId(request) {
|
|
@@ -5181,7 +5240,8 @@ function createRaindropAISDK(opts) {
|
|
|
5181
5240
|
"eventId",
|
|
5182
5241
|
"eventName",
|
|
5183
5242
|
"convoId",
|
|
5184
|
-
"properties"
|
|
5243
|
+
"properties",
|
|
5244
|
+
"featureFlags"
|
|
5185
5245
|
];
|
|
5186
5246
|
let context;
|
|
5187
5247
|
let subagentWrapping;
|
|
@@ -5213,6 +5273,9 @@ function createRaindropAISDK(opts) {
|
|
|
5213
5273
|
async setProperties(eventId, properties) {
|
|
5214
5274
|
await eventShipper.patch(eventId, { properties });
|
|
5215
5275
|
},
|
|
5276
|
+
async setFeatureFlags(eventId, featureFlags) {
|
|
5277
|
+
await eventShipper.patch(eventId, { featureFlags: normalizeFeatureFlags(featureFlags) });
|
|
5278
|
+
},
|
|
5216
5279
|
async finish(eventId, patch) {
|
|
5217
5280
|
await eventShipper.finish(eventId, patch);
|
|
5218
5281
|
}
|
|
@@ -5334,6 +5397,7 @@ exports.eventMetadataFromChatRequest = eventMetadataFromChatRequest;
|
|
|
5334
5397
|
exports.getContextManager = getContextManager;
|
|
5335
5398
|
exports.getCurrentParentToolContext = getCurrentParentToolContext;
|
|
5336
5399
|
exports.getCurrentRaindropCallMetadata = getCurrentRaindropCallMetadata;
|
|
5400
|
+
exports.normalizeFeatureFlags = normalizeFeatureFlags;
|
|
5337
5401
|
exports.raindrop = raindrop;
|
|
5338
5402
|
exports.readRaindropCallMetadataFromArgs = readRaindropCallMetadataFromArgs;
|
|
5339
5403
|
exports.redactJsonAttributeValue = redactJsonAttributeValue;
|
package/dist/index.browser.mjs
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
// ../core/dist/chunk-
|
|
1
|
+
// ../core/dist/chunk-Y5LUB7OE.js
|
|
2
|
+
function normalizeFeatureFlags(input) {
|
|
3
|
+
if (Array.isArray(input)) {
|
|
4
|
+
return Object.fromEntries(input.map((name) => [name, "true"]));
|
|
5
|
+
}
|
|
6
|
+
return Object.fromEntries(
|
|
7
|
+
Object.entries(input).map(([k, v]) => [k, String(v)])
|
|
8
|
+
);
|
|
9
|
+
}
|
|
2
10
|
function getCrypto() {
|
|
3
11
|
const c = globalThis.crypto;
|
|
4
12
|
return c;
|
|
@@ -433,13 +441,16 @@ function projectIdHeaders(projectId) {
|
|
|
433
441
|
var SHUTDOWN_DEADLINE_MS = 1e4;
|
|
434
442
|
var POST_SHUTDOWN_TIMEOUT_MS = 5e3;
|
|
435
443
|
function mergePatches(target, source) {
|
|
436
|
-
var _a, _b, _c, _d;
|
|
444
|
+
var _a, _b, _c, _d, _e, _f;
|
|
437
445
|
const out = { ...target, ...source };
|
|
438
446
|
if (target.properties || source.properties) {
|
|
439
447
|
out.properties = { ...(_a = target.properties) != null ? _a : {}, ...(_b = source.properties) != null ? _b : {} };
|
|
440
448
|
}
|
|
449
|
+
if (target.featureFlags || source.featureFlags) {
|
|
450
|
+
out.featureFlags = { ...(_c = target.featureFlags) != null ? _c : {}, ...(_d = source.featureFlags) != null ? _d : {} };
|
|
451
|
+
}
|
|
441
452
|
if (target.attachments || source.attachments) {
|
|
442
|
-
out.attachments = [...(
|
|
453
|
+
out.attachments = [...(_e = target.attachments) != null ? _e : [], ...(_f = source.attachments) != null ? _f : []];
|
|
443
454
|
}
|
|
444
455
|
return out;
|
|
445
456
|
}
|
|
@@ -709,6 +720,7 @@ var EventShipper = class {
|
|
|
709
720
|
...wizardSession ? { "raindrop.wizardSession": wizardSession } : {},
|
|
710
721
|
$context: this.context
|
|
711
722
|
},
|
|
723
|
+
...accumulated.featureFlags && Object.keys(accumulated.featureFlags).length > 0 ? { feature_flags: accumulated.featureFlags } : {},
|
|
712
724
|
attachments: accumulated.attachments,
|
|
713
725
|
is_pending: isPending
|
|
714
726
|
};
|
|
@@ -1297,7 +1309,7 @@ async function* asyncGeneratorWithCurrent(span, gen) {
|
|
|
1297
1309
|
// package.json
|
|
1298
1310
|
var package_default = {
|
|
1299
1311
|
name: "@raindrop-ai/ai-sdk",
|
|
1300
|
-
version: "0.
|
|
1312
|
+
version: "0.1.1"};
|
|
1301
1313
|
|
|
1302
1314
|
// src/internal/version.ts
|
|
1303
1315
|
var libraryName = package_default.name;
|
|
@@ -2719,6 +2731,20 @@ var RaindropTelemetryIntegration = class {
|
|
|
2719
2731
|
} else if (properties && typeof properties === "object") {
|
|
2720
2732
|
result.properties = properties;
|
|
2721
2733
|
}
|
|
2734
|
+
const featureFlags = metadata["raindrop.featureFlags"];
|
|
2735
|
+
if (typeof featureFlags === "string") {
|
|
2736
|
+
try {
|
|
2737
|
+
const parsed = JSON.parse(featureFlags);
|
|
2738
|
+
if (parsed && typeof parsed === "object") {
|
|
2739
|
+
result.featureFlags = normalizeFeatureFlags(parsed);
|
|
2740
|
+
}
|
|
2741
|
+
} catch (e) {
|
|
2742
|
+
}
|
|
2743
|
+
} else if (featureFlags && typeof featureFlags === "object") {
|
|
2744
|
+
result.featureFlags = normalizeFeatureFlags(
|
|
2745
|
+
featureFlags
|
|
2746
|
+
);
|
|
2747
|
+
}
|
|
2722
2748
|
return result;
|
|
2723
2749
|
}
|
|
2724
2750
|
/**
|
|
@@ -2933,7 +2959,7 @@ var RaindropTelemetryIntegration = class {
|
|
|
2933
2959
|
* same event ID into a separate canonical row.
|
|
2934
2960
|
*/
|
|
2935
2961
|
finalizeGenerateEvent(state, output, model, keepPending = false) {
|
|
2936
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
2962
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
2937
2963
|
const suppressSubagentEvent = state.subagentName !== void 0 && state.subagentToolCallSpan !== void 0;
|
|
2938
2964
|
if (!this.sendEvents || suppressSubagentEvent) return;
|
|
2939
2965
|
const callMeta = this.extractRaindropMetadata(state.metadata);
|
|
@@ -2946,7 +2972,11 @@ var RaindropTelemetryIntegration = class {
|
|
|
2946
2972
|
...(_f = this.defaultContext) == null ? void 0 : _f.properties,
|
|
2947
2973
|
...callMeta.properties
|
|
2948
2974
|
};
|
|
2949
|
-
const
|
|
2975
|
+
const featureFlags = {
|
|
2976
|
+
...((_g = this.defaultContext) == null ? void 0 : _g.featureFlags) ? normalizeFeatureFlags(this.defaultContext.featureFlags) : {},
|
|
2977
|
+
...callMeta.featureFlags
|
|
2978
|
+
};
|
|
2979
|
+
const convoId = (_i = callMeta.convoId) != null ? _i : (_h = this.defaultContext) == null ? void 0 : _h.convoId;
|
|
2950
2980
|
void this.eventShipper.patch(state.eventId, {
|
|
2951
2981
|
eventName,
|
|
2952
2982
|
userId,
|
|
@@ -2955,6 +2985,7 @@ var RaindropTelemetryIntegration = class {
|
|
|
2955
2985
|
output: cappedOutput,
|
|
2956
2986
|
model,
|
|
2957
2987
|
properties: Object.keys(properties).length > 0 ? properties : void 0,
|
|
2988
|
+
featureFlags: Object.keys(featureFlags).length > 0 ? featureFlags : void 0,
|
|
2958
2989
|
isPending: keepPending
|
|
2959
2990
|
}).catch((err) => {
|
|
2960
2991
|
if (this.debug) {
|
|
@@ -3278,6 +3309,20 @@ function extractRaindropMetadata(metadata) {
|
|
|
3278
3309
|
} else if (properties && typeof properties === "object") {
|
|
3279
3310
|
result.properties = properties;
|
|
3280
3311
|
}
|
|
3312
|
+
const featureFlags = metadata["raindrop.featureFlags"];
|
|
3313
|
+
if (typeof featureFlags === "string") {
|
|
3314
|
+
try {
|
|
3315
|
+
const parsed = JSON.parse(featureFlags);
|
|
3316
|
+
if (parsed && typeof parsed === "object") {
|
|
3317
|
+
result.featureFlags = normalizeFeatureFlags(parsed);
|
|
3318
|
+
}
|
|
3319
|
+
} catch (e) {
|
|
3320
|
+
}
|
|
3321
|
+
} else if (featureFlags && typeof featureFlags === "object") {
|
|
3322
|
+
result.featureFlags = normalizeFeatureFlags(
|
|
3323
|
+
featureFlags
|
|
3324
|
+
);
|
|
3325
|
+
}
|
|
3281
3326
|
return result;
|
|
3282
3327
|
}
|
|
3283
3328
|
function mergeContexts(wrapTime, callTime) {
|
|
@@ -3292,6 +3337,10 @@ function mergeContexts(wrapTime, callTime) {
|
|
|
3292
3337
|
...callTime.properties
|
|
3293
3338
|
};
|
|
3294
3339
|
}
|
|
3340
|
+
if (callTime.featureFlags) {
|
|
3341
|
+
const wrapTimeFlags = wrapTime.featureFlags ? normalizeFeatureFlags(wrapTime.featureFlags) : {};
|
|
3342
|
+
result.featureFlags = { ...wrapTimeFlags, ...callTime.featureFlags };
|
|
3343
|
+
}
|
|
3295
3344
|
return result;
|
|
3296
3345
|
}
|
|
3297
3346
|
function detectAISDKVersion(aiSDK) {
|
|
@@ -3604,6 +3653,7 @@ function createFinalize(params) {
|
|
|
3604
3653
|
output: defaultOutput,
|
|
3605
3654
|
model,
|
|
3606
3655
|
properties: setup.ctx.properties,
|
|
3656
|
+
featureFlags: setup.ctx.featureFlags ? normalizeFeatureFlags(setup.ctx.featureFlags) : void 0,
|
|
3607
3657
|
attachments: mergeAttachments(setup.ctx.attachments, inputAttachments, outputAttachments)
|
|
3608
3658
|
};
|
|
3609
3659
|
const built = await maybeBuildEvent(options.buildEvent, allMessages);
|
|
@@ -3657,6 +3707,7 @@ function createFinalize(params) {
|
|
|
3657
3707
|
output,
|
|
3658
3708
|
model: finalModel,
|
|
3659
3709
|
properties: patch.properties,
|
|
3710
|
+
featureFlags: patch.featureFlags,
|
|
3660
3711
|
attachments: patch.attachments,
|
|
3661
3712
|
isPending: keepEventPending
|
|
3662
3713
|
}).catch((err) => {
|
|
@@ -3888,7 +3939,8 @@ function wrapAISDK(aiSDK, deps) {
|
|
|
3888
3939
|
eventId: wrapTimeCtx.eventId,
|
|
3889
3940
|
eventName: wrapTimeCtx.eventName,
|
|
3890
3941
|
convoId: wrapTimeCtx.convoId,
|
|
3891
|
-
properties: wrapTimeCtx.properties
|
|
3942
|
+
properties: wrapTimeCtx.properties,
|
|
3943
|
+
featureFlags: wrapTimeCtx.featureFlags ? normalizeFeatureFlags(wrapTimeCtx.featureFlags) : void 0
|
|
3892
3944
|
}
|
|
3893
3945
|
});
|
|
3894
3946
|
const registerFn = resolveRegisterTelemetry(aiSDK);
|
|
@@ -4164,6 +4216,7 @@ function wrapAgentGenerate(generate, instance, agentSettings, className, aiSDK,
|
|
|
4164
4216
|
output: outputText,
|
|
4165
4217
|
model,
|
|
4166
4218
|
properties: ctx.properties,
|
|
4219
|
+
featureFlags: ctx.featureFlags ? normalizeFeatureFlags(ctx.featureFlags) : void 0,
|
|
4167
4220
|
attachments: mergeAttachments(ctx.attachments, inputAttachments, outputAttachments)
|
|
4168
4221
|
};
|
|
4169
4222
|
const built = await maybeBuildEvent(deps.options.buildEvent, allMessages);
|
|
@@ -4231,6 +4284,7 @@ function wrapAgentGenerate(generate, instance, agentSettings, className, aiSDK,
|
|
|
4231
4284
|
output,
|
|
4232
4285
|
model: finalModel,
|
|
4233
4286
|
properties: patch.properties,
|
|
4287
|
+
featureFlags: patch.featureFlags,
|
|
4234
4288
|
attachments: patch.attachments,
|
|
4235
4289
|
isPending: false
|
|
4236
4290
|
}).catch((err) => {
|
|
@@ -4372,6 +4426,7 @@ function wrapAgentStream(stream, instance, agentSettings, className, aiSDK, deps
|
|
|
4372
4426
|
output: outputText,
|
|
4373
4427
|
model,
|
|
4374
4428
|
properties: ctx.properties,
|
|
4429
|
+
featureFlags: ctx.featureFlags ? normalizeFeatureFlags(ctx.featureFlags) : void 0,
|
|
4375
4430
|
attachments: mergeAttachments(ctx.attachments, inputAttachments, outputAttachments)
|
|
4376
4431
|
};
|
|
4377
4432
|
const built = await maybeBuildEvent(deps.options.buildEvent, allMessages);
|
|
@@ -4439,6 +4494,7 @@ function wrapAgentStream(stream, instance, agentSettings, className, aiSDK, deps
|
|
|
4439
4494
|
output,
|
|
4440
4495
|
model: finalModel,
|
|
4441
4496
|
properties: patch.properties,
|
|
4497
|
+
featureFlags: patch.featureFlags,
|
|
4442
4498
|
attachments: patch.attachments,
|
|
4443
4499
|
isPending: false
|
|
4444
4500
|
}).catch((err) => {
|
|
@@ -5036,7 +5092,7 @@ async function maybeBuildEvent(buildEvent, messages) {
|
|
|
5036
5092
|
}
|
|
5037
5093
|
}
|
|
5038
5094
|
function mergeBuildEventPatch(defaults, override) {
|
|
5039
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
5095
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
5040
5096
|
if (!override) return defaults;
|
|
5041
5097
|
return {
|
|
5042
5098
|
eventName: (_a = override.eventName) != null ? _a : defaults.eventName,
|
|
@@ -5044,7 +5100,8 @@ function mergeBuildEventPatch(defaults, override) {
|
|
|
5044
5100
|
output: (_c = override.output) != null ? _c : defaults.output,
|
|
5045
5101
|
model: (_d = override.model) != null ? _d : defaults.model,
|
|
5046
5102
|
properties: override.properties !== void 0 ? { ...(_e = defaults.properties) != null ? _e : {}, ...(_f = override.properties) != null ? _f : {} } : defaults.properties,
|
|
5047
|
-
|
|
5103
|
+
featureFlags: override.featureFlags !== void 0 ? { ...(_g = defaults.featureFlags) != null ? _g : {}, ...(_h = override.featureFlags) != null ? _h : {} } : defaults.featureFlags,
|
|
5104
|
+
attachments: override.attachments !== void 0 ? [...(_i = defaults.attachments) != null ? _i : [], ...(_j = override.attachments) != null ? _j : []] : defaults.attachments
|
|
5048
5105
|
};
|
|
5049
5106
|
}
|
|
5050
5107
|
function mergeAttachments(...groups) {
|
|
@@ -5075,6 +5132,8 @@ function eventMetadata(options) {
|
|
|
5075
5132
|
if (options.convoId) result["raindrop.convoId"] = options.convoId;
|
|
5076
5133
|
if (options.eventName) result["raindrop.eventName"] = options.eventName;
|
|
5077
5134
|
if (options.properties) result["raindrop.properties"] = JSON.stringify(options.properties);
|
|
5135
|
+
if (options.featureFlags)
|
|
5136
|
+
result["raindrop.featureFlags"] = JSON.stringify(normalizeFeatureFlags(options.featureFlags));
|
|
5078
5137
|
return result;
|
|
5079
5138
|
}
|
|
5080
5139
|
function deriveChatTurnMessageId(request) {
|
|
@@ -5179,7 +5238,8 @@ function createRaindropAISDK(opts) {
|
|
|
5179
5238
|
"eventId",
|
|
5180
5239
|
"eventName",
|
|
5181
5240
|
"convoId",
|
|
5182
|
-
"properties"
|
|
5241
|
+
"properties",
|
|
5242
|
+
"featureFlags"
|
|
5183
5243
|
];
|
|
5184
5244
|
let context;
|
|
5185
5245
|
let subagentWrapping;
|
|
@@ -5211,6 +5271,9 @@ function createRaindropAISDK(opts) {
|
|
|
5211
5271
|
async setProperties(eventId, properties) {
|
|
5212
5272
|
await eventShipper.patch(eventId, { properties });
|
|
5213
5273
|
},
|
|
5274
|
+
async setFeatureFlags(eventId, featureFlags) {
|
|
5275
|
+
await eventShipper.patch(eventId, { featureFlags: normalizeFeatureFlags(featureFlags) });
|
|
5276
|
+
},
|
|
5214
5277
|
async finish(eventId, patch) {
|
|
5215
5278
|
await eventShipper.finish(eventId, patch);
|
|
5216
5279
|
}
|
|
@@ -5311,4 +5374,4 @@ function raindrop(options = {}) {
|
|
|
5311
5374
|
return client.createTelemetryIntegration({ context, subagentWrapping });
|
|
5312
5375
|
}
|
|
5313
5376
|
|
|
5314
|
-
export { DEFAULT_MAX_TEXT_FIELD_CHARS2 as DEFAULT_MAX_TEXT_FIELD_CHARS, DEFAULT_REDACT_ATTRIBUTE_KEYS, DEFAULT_SECRET_KEY_NAMES, REDACTED_PLACEHOLDER, RaindropTelemetryIntegration, TRUNCATION_MARKER2 as TRUNCATION_MARKER, _resetParentToolContextStorage, _resetRaindropCallMetadataStorage, _resetWarnedMissingUserId, boundedStringify, capText2 as capText, clearParentToolContext, createRaindropAISDK, currentSpan, defaultTransformSpan, enterParentToolContext, eventMetadata, eventMetadataFromChatRequest, getContextManager, getCurrentParentToolContext, getCurrentRaindropCallMetadata, raindrop, readRaindropCallMetadataFromArgs, redactJsonAttributeValue, redactSecretsInObject, runWithParentToolContext, runWithRaindropCallMetadata, withCurrent };
|
|
5377
|
+
export { DEFAULT_MAX_TEXT_FIELD_CHARS2 as DEFAULT_MAX_TEXT_FIELD_CHARS, DEFAULT_REDACT_ATTRIBUTE_KEYS, DEFAULT_SECRET_KEY_NAMES, REDACTED_PLACEHOLDER, RaindropTelemetryIntegration, TRUNCATION_MARKER2 as TRUNCATION_MARKER, _resetParentToolContextStorage, _resetRaindropCallMetadataStorage, _resetWarnedMissingUserId, boundedStringify, capText2 as capText, clearParentToolContext, createRaindropAISDK, currentSpan, defaultTransformSpan, enterParentToolContext, eventMetadata, eventMetadataFromChatRequest, getContextManager, getCurrentParentToolContext, getCurrentRaindropCallMetadata, normalizeFeatureFlags, raindrop, readRaindropCallMetadataFromArgs, redactJsonAttributeValue, redactSecretsInObject, runWithParentToolContext, runWithRaindropCallMetadata, withCurrent };
|
package/dist/index.node.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as AISDKChatRequestLike, a as AISDKChatRequestMessageLike, b as AISDKMessage, c as AgentCallMetadata, d as AgentWithMetadata, e as Attachment, B as BuildEventPatch, C as ContextManager, f as ContextSpan, g as CreateSpanArgs, D as DEFAULT_MAX_TEXT_FIELD_CHARS, h as DEFAULT_REDACT_ATTRIBUTE_KEYS, i as DEFAULT_SECRET_KEY_NAMES, E as EndSpanArgs, j as EventBuilder, k as EventMetadataOptions, I as IdentifyInput, O as OtlpAnyValue,
|
|
1
|
+
export { A as AISDKChatRequestLike, a as AISDKChatRequestMessageLike, b as AISDKMessage, c as AgentCallMetadata, d as AgentWithMetadata, e as Attachment, B as BuildEventPatch, C as ContextManager, f as ContextSpan, g as CreateSpanArgs, D as DEFAULT_MAX_TEXT_FIELD_CHARS, h as DEFAULT_REDACT_ATTRIBUTE_KEYS, i as DEFAULT_SECRET_KEY_NAMES, E as EndSpanArgs, j as EventBuilder, k as EventMetadataOptions, F as FeatureFlagValue, l as FeatureFlags, I as IdentifyInput, O as OtlpAnyValue, m as OtlpSpan, P as ParentToolContext, R as REDACTED_PLACEHOLDER, n as RaindropAISDKClient, o as RaindropAISDKContext, p as RaindropAISDKOptions, q as RaindropCallMetadata, r as RaindropTelemetryIntegration, s as RaindropTelemetryIntegrationOptions, t as RaindropTelemetryOptions, S as SelfDiagnosticsOptions, u as SelfDiagnosticsSignalDefinition, v as SelfDiagnosticsSignalDefinitions, w as SelfDiagnosticsTool, x as SelfDiagnosticsToolInput, y as SelfDiagnosticsToolOptions, z as SelfDiagnosticsToolResult, G as StartSpanArgs, T as TRUNCATION_MARKER, H as TraceSpan, J as TransformSpanHook, W as WrapAISDKOptions, K as WrappedAI, L as WrappedAISDK, _ as _resetParentToolContextStorage, M as _resetRaindropCallMetadataStorage, N as _resetWarnedMissingUserId, Q as boundedStringify, U as capText, V as clearParentToolContext, X as createRaindropAISDK, Y as currentSpan, Z as defaultTransformSpan, $ as enterParentToolContext, a0 as eventMetadata, a1 as eventMetadataFromChatRequest, a2 as getContextManager, a3 as getCurrentParentToolContext, a4 as getCurrentRaindropCallMetadata, a5 as normalizeFeatureFlags, a6 as raindrop, a7 as readRaindropCallMetadataFromArgs, a8 as redactJsonAttributeValue, a9 as redactSecretsInObject, aa as runWithParentToolContext, ab as runWithRaindropCallMetadata, ac as withCurrent } from './index-BQwgg9kQ.mjs';
|
|
2
2
|
|
|
3
3
|
declare global {
|
|
4
4
|
var RAINDROP_ASYNC_LOCAL_STORAGE: (new <T>() => {
|
package/dist/index.node.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as AISDKChatRequestLike, a as AISDKChatRequestMessageLike, b as AISDKMessage, c as AgentCallMetadata, d as AgentWithMetadata, e as Attachment, B as BuildEventPatch, C as ContextManager, f as ContextSpan, g as CreateSpanArgs, D as DEFAULT_MAX_TEXT_FIELD_CHARS, h as DEFAULT_REDACT_ATTRIBUTE_KEYS, i as DEFAULT_SECRET_KEY_NAMES, E as EndSpanArgs, j as EventBuilder, k as EventMetadataOptions, I as IdentifyInput, O as OtlpAnyValue,
|
|
1
|
+
export { A as AISDKChatRequestLike, a as AISDKChatRequestMessageLike, b as AISDKMessage, c as AgentCallMetadata, d as AgentWithMetadata, e as Attachment, B as BuildEventPatch, C as ContextManager, f as ContextSpan, g as CreateSpanArgs, D as DEFAULT_MAX_TEXT_FIELD_CHARS, h as DEFAULT_REDACT_ATTRIBUTE_KEYS, i as DEFAULT_SECRET_KEY_NAMES, E as EndSpanArgs, j as EventBuilder, k as EventMetadataOptions, F as FeatureFlagValue, l as FeatureFlags, I as IdentifyInput, O as OtlpAnyValue, m as OtlpSpan, P as ParentToolContext, R as REDACTED_PLACEHOLDER, n as RaindropAISDKClient, o as RaindropAISDKContext, p as RaindropAISDKOptions, q as RaindropCallMetadata, r as RaindropTelemetryIntegration, s as RaindropTelemetryIntegrationOptions, t as RaindropTelemetryOptions, S as SelfDiagnosticsOptions, u as SelfDiagnosticsSignalDefinition, v as SelfDiagnosticsSignalDefinitions, w as SelfDiagnosticsTool, x as SelfDiagnosticsToolInput, y as SelfDiagnosticsToolOptions, z as SelfDiagnosticsToolResult, G as StartSpanArgs, T as TRUNCATION_MARKER, H as TraceSpan, J as TransformSpanHook, W as WrapAISDKOptions, K as WrappedAI, L as WrappedAISDK, _ as _resetParentToolContextStorage, M as _resetRaindropCallMetadataStorage, N as _resetWarnedMissingUserId, Q as boundedStringify, U as capText, V as clearParentToolContext, X as createRaindropAISDK, Y as currentSpan, Z as defaultTransformSpan, $ as enterParentToolContext, a0 as eventMetadata, a1 as eventMetadataFromChatRequest, a2 as getContextManager, a3 as getCurrentParentToolContext, a4 as getCurrentRaindropCallMetadata, a5 as normalizeFeatureFlags, a6 as raindrop, a7 as readRaindropCallMetadataFromArgs, a8 as redactJsonAttributeValue, a9 as redactSecretsInObject, aa as runWithParentToolContext, ab as runWithRaindropCallMetadata, ac as withCurrent } from './index-BQwgg9kQ.js';
|
|
2
2
|
|
|
3
3
|
declare global {
|
|
4
4
|
var RAINDROP_ASYNC_LOCAL_STORAGE: (new <T>() => {
|