braintrust 3.27.0 → 3.28.0
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/dev/dist/index.d.mts +519 -186
- package/dev/dist/index.d.ts +519 -186
- package/dev/dist/index.js +1837 -1009
- package/dev/dist/index.mjs +1172 -344
- package/dist/apply-auto-instrumentation.js +262 -210
- package/dist/apply-auto-instrumentation.mjs +54 -2
- package/dist/auto-instrumentations/bundler/esbuild.cjs +81 -2
- package/dist/auto-instrumentations/bundler/esbuild.mjs +2 -2
- package/dist/auto-instrumentations/bundler/next.cjs +81 -2
- package/dist/auto-instrumentations/bundler/next.mjs +3 -3
- package/dist/auto-instrumentations/bundler/rollup.cjs +81 -2
- package/dist/auto-instrumentations/bundler/rollup.mjs +2 -2
- package/dist/auto-instrumentations/bundler/vite.cjs +81 -2
- package/dist/auto-instrumentations/bundler/vite.mjs +2 -2
- package/dist/auto-instrumentations/bundler/webpack-loader.cjs +81 -2
- package/dist/auto-instrumentations/bundler/webpack.cjs +81 -2
- package/dist/auto-instrumentations/bundler/webpack.mjs +3 -3
- package/dist/auto-instrumentations/{chunk-XEYKUBLY.mjs → chunk-26PKVUKB.mjs} +80 -2
- package/dist/auto-instrumentations/{chunk-BW33ULMW.mjs → chunk-HD35AM3M.mjs} +1 -1
- package/dist/auto-instrumentations/{chunk-ZNHTSSGI.mjs → chunk-NP7V4XB2.mjs} +2 -1
- package/dist/auto-instrumentations/hook.mjs +236 -30
- package/dist/auto-instrumentations/index.cjs +2 -1
- package/dist/auto-instrumentations/index.mjs +1 -1
- package/dist/browser.d.mts +628 -53
- package/dist/browser.d.ts +628 -53
- package/dist/browser.js +2301 -284
- package/dist/browser.mjs +2301 -284
- package/dist/{chunk-MF7NU6BT.js → chunk-BBE7SNRV.js} +34 -4
- package/dist/{chunk-QRHGVBKU.js → chunk-OBBWQW6K.js} +1799 -1023
- package/dist/{chunk-YKD22IMR.mjs → chunk-UPFNQCGB.mjs} +966 -190
- package/dist/{chunk-CZM5JIQL.mjs → chunk-ZHUHZWFY.mjs} +33 -3
- package/dist/cli.js +1224 -398
- package/dist/edge-light.d.mts +1 -1
- package/dist/edge-light.d.ts +1 -1
- package/dist/edge-light.js +2301 -284
- package/dist/edge-light.mjs +2301 -284
- package/dist/index.d.mts +1212 -637
- package/dist/index.d.ts +1212 -637
- package/dist/index.js +1880 -590
- package/dist/index.mjs +1450 -160
- package/dist/instrumentation/index.d.mts +190 -6
- package/dist/instrumentation/index.d.ts +190 -6
- package/dist/instrumentation/index.js +823 -116
- package/dist/instrumentation/index.mjs +823 -116
- package/dist/vitest-evals-reporter.js +16 -16
- package/dist/vitest-evals-reporter.mjs +2 -2
- package/dist/workerd.d.mts +1 -1
- package/dist/workerd.d.ts +1 -1
- package/dist/workerd.js +2301 -284
- package/dist/workerd.mjs +2301 -284
- package/package.json +2 -3
- package/util/dist/index.d.mts +1545 -100
- package/util/dist/index.d.ts +1545 -100
|
@@ -84,7 +84,10 @@ var envIntegrationAliases = {
|
|
|
84
84
|
"langchain-js": "langchain",
|
|
85
85
|
"@langchain": "langchain",
|
|
86
86
|
langgraph: "langgraph",
|
|
87
|
-
langsmith: "langsmith"
|
|
87
|
+
langsmith: "langsmith",
|
|
88
|
+
voyage: "voyageai",
|
|
89
|
+
"voyage-ai": "voyageai",
|
|
90
|
+
voyageai: "voyageai"
|
|
88
91
|
};
|
|
89
92
|
function readDisabledInstrumentationEnvConfig(disabledList) {
|
|
90
93
|
const integrations = {};
|
|
@@ -1775,7 +1778,8 @@ var AclObjectType = z6.union([
|
|
|
1775
1778
|
"org_member",
|
|
1776
1779
|
"project_log",
|
|
1777
1780
|
"org_project",
|
|
1778
|
-
"org_audit_logs"
|
|
1781
|
+
"org_audit_logs",
|
|
1782
|
+
"project_group"
|
|
1779
1783
|
]),
|
|
1780
1784
|
z6.null()
|
|
1781
1785
|
]);
|
|
@@ -1904,7 +1908,8 @@ var AsyncScoringState = z6.union([
|
|
|
1904
1908
|
token: z6.string(),
|
|
1905
1909
|
function_ids: z6.array(z6.unknown()),
|
|
1906
1910
|
skip_logging: z6.union([z6.boolean(), z6.null()]).optional(),
|
|
1907
|
-
triggered_functions: z6.union([z6.record(TriggeredFunctionState), z6.null()]).optional()
|
|
1911
|
+
triggered_functions: z6.union([z6.record(TriggeredFunctionState), z6.null()]).optional(),
|
|
1912
|
+
last_triggered_xact_id: z6.union([z6.string(), z6.number(), z6.null()]).optional()
|
|
1908
1913
|
}),
|
|
1909
1914
|
z6.object({ status: z6.literal("disabled") }),
|
|
1910
1915
|
z6.null(),
|
|
@@ -1973,7 +1978,7 @@ var FunctionTypeEnum = z6.enum([
|
|
|
1973
1978
|
"parameters",
|
|
1974
1979
|
"sandbox"
|
|
1975
1980
|
]);
|
|
1976
|
-
var
|
|
1981
|
+
var FacetPreprocessorId = z6.union([
|
|
1977
1982
|
z6.object({
|
|
1978
1983
|
type: z6.literal("function"),
|
|
1979
1984
|
id: z6.string(),
|
|
@@ -1984,10 +1989,23 @@ var NullableSavedFunctionId = z6.union([
|
|
|
1984
1989
|
name: z6.string(),
|
|
1985
1990
|
function_type: FunctionTypeEnum.optional().default("scorer")
|
|
1986
1991
|
}),
|
|
1992
|
+
z6.object({ type: z6.literal("inline"), code: z6.string().min(1) }),
|
|
1987
1993
|
z6.null()
|
|
1988
1994
|
]);
|
|
1995
|
+
var SavedFunctionId = z6.union([
|
|
1996
|
+
z6.object({
|
|
1997
|
+
type: z6.literal("function"),
|
|
1998
|
+
id: z6.string(),
|
|
1999
|
+
version: z6.string().optional()
|
|
2000
|
+
}),
|
|
2001
|
+
z6.object({
|
|
2002
|
+
type: z6.literal("global"),
|
|
2003
|
+
name: z6.string(),
|
|
2004
|
+
function_type: FunctionTypeEnum.optional().default("scorer")
|
|
2005
|
+
})
|
|
2006
|
+
]);
|
|
1989
2007
|
var TopicMapGenerationSettings = z6.object({
|
|
1990
|
-
algorithm: z6.enum(["hdbscan", "kmeans"]),
|
|
2008
|
+
algorithm: z6.enum(["hdbscan", "kmeans", "community"]),
|
|
1991
2009
|
dimension_reduction: z6.enum(["umap", "pca", "none"]),
|
|
1992
2010
|
sample_size: z6.number().int().gt(0).optional(),
|
|
1993
2011
|
n_clusters: z6.number().int().gt(0).optional(),
|
|
@@ -1999,6 +2017,7 @@ var TopicMapGenerationSettings = z6.object({
|
|
|
1999
2017
|
var TopicMapData = z6.object({
|
|
2000
2018
|
type: z6.literal("topic_map"),
|
|
2001
2019
|
source_facet: z6.string(),
|
|
2020
|
+
source_facet_function: SavedFunctionId.and(z6.unknown()).optional(),
|
|
2002
2021
|
embedding_model: z6.string(),
|
|
2003
2022
|
bundle_key: z6.string().optional(),
|
|
2004
2023
|
report_key: z6.string().optional(),
|
|
@@ -2012,7 +2031,7 @@ var TopicMapData = z6.object({
|
|
|
2012
2031
|
});
|
|
2013
2032
|
var BatchedFacetData = z6.object({
|
|
2014
2033
|
type: z6.literal("batched_facet"),
|
|
2015
|
-
preprocessor:
|
|
2034
|
+
preprocessor: FacetPreprocessorId.optional(),
|
|
2016
2035
|
facets: z6.array(
|
|
2017
2036
|
z6.object({
|
|
2018
2037
|
name: z6.string(),
|
|
@@ -2273,18 +2292,6 @@ var ObjectReferenceNullish = z6.union([
|
|
|
2273
2292
|
}),
|
|
2274
2293
|
z6.null()
|
|
2275
2294
|
]);
|
|
2276
|
-
var SavedFunctionId = z6.union([
|
|
2277
|
-
z6.object({
|
|
2278
|
-
type: z6.literal("function"),
|
|
2279
|
-
id: z6.string(),
|
|
2280
|
-
version: z6.string().optional()
|
|
2281
|
-
}),
|
|
2282
|
-
z6.object({
|
|
2283
|
-
type: z6.literal("global"),
|
|
2284
|
-
name: z6.string(),
|
|
2285
|
-
function_type: FunctionTypeEnum.optional().default("scorer")
|
|
2286
|
-
})
|
|
2287
|
-
]);
|
|
2288
2295
|
var DatasetEvent = z6.object({
|
|
2289
2296
|
id: z6.string(),
|
|
2290
2297
|
_xact_id: z6.string(),
|
|
@@ -2506,7 +2513,7 @@ var ExtendedSavedFunctionId = z6.union([
|
|
|
2506
2513
|
]);
|
|
2507
2514
|
var FacetData = z6.object({
|
|
2508
2515
|
type: z6.literal("facet"),
|
|
2509
|
-
preprocessor:
|
|
2516
|
+
preprocessor: FacetPreprocessorId.optional(),
|
|
2510
2517
|
prompt: z6.string(),
|
|
2511
2518
|
model: z6.string().optional(),
|
|
2512
2519
|
embedding_model: z6.string().optional(),
|
|
@@ -3011,6 +3018,19 @@ var MessageRole = z6.enum([
|
|
|
3011
3018
|
"model",
|
|
3012
3019
|
"developer"
|
|
3013
3020
|
]);
|
|
3021
|
+
var NullableSavedFunctionId = z6.union([
|
|
3022
|
+
z6.object({
|
|
3023
|
+
type: z6.literal("function"),
|
|
3024
|
+
id: z6.string(),
|
|
3025
|
+
version: z6.string().optional()
|
|
3026
|
+
}),
|
|
3027
|
+
z6.object({
|
|
3028
|
+
type: z6.literal("global"),
|
|
3029
|
+
name: z6.string(),
|
|
3030
|
+
function_type: FunctionTypeEnum.optional().default("scorer")
|
|
3031
|
+
}),
|
|
3032
|
+
z6.null()
|
|
3033
|
+
]);
|
|
3014
3034
|
var ObjectReference = z6.object({
|
|
3015
3035
|
object_type: z6.enum([
|
|
3016
3036
|
"project_logs",
|
|
@@ -3032,6 +3052,7 @@ var TraceScope = z6.object({
|
|
|
3032
3052
|
});
|
|
3033
3053
|
var OnlineScoreConfig = z6.union([
|
|
3034
3054
|
z6.object({
|
|
3055
|
+
status: AutomationStatus.optional(),
|
|
3035
3056
|
sampling_rate: z6.number().gte(0).lte(1),
|
|
3036
3057
|
scorers: z6.array(SavedFunctionId),
|
|
3037
3058
|
btql_filter: z6.union([z6.string(), z6.null()]).optional(),
|
|
@@ -3112,6 +3133,72 @@ var Project = z6.object({
|
|
|
3112
3133
|
user_id: z6.union([z6.string(), z6.null()]).optional(),
|
|
3113
3134
|
settings: ProjectSettings.optional()
|
|
3114
3135
|
});
|
|
3136
|
+
var WindowedAutomationConfig = z6.object({
|
|
3137
|
+
event_type: z6.literal("windowed"),
|
|
3138
|
+
product_origin: z6.union([z6.literal("patterns"), z6.null()]).optional(),
|
|
3139
|
+
status: AutomationStatus.optional(),
|
|
3140
|
+
threshold: z6.object({
|
|
3141
|
+
calculation: z6.object({
|
|
3142
|
+
type: z6.literal("btql"),
|
|
3143
|
+
btql_query: z6.string().min(1),
|
|
3144
|
+
output: z6.object({
|
|
3145
|
+
type: z6.literal("scalar"),
|
|
3146
|
+
value_column: z6.string().min(1)
|
|
3147
|
+
})
|
|
3148
|
+
}),
|
|
3149
|
+
policy: z6.object({
|
|
3150
|
+
condition: z6.object({
|
|
3151
|
+
type: z6.literal("threshold"),
|
|
3152
|
+
operator: z6.enum(["lt", "lte", "gt", "gte", "eq", "neq"]),
|
|
3153
|
+
threshold: z6.number()
|
|
3154
|
+
}),
|
|
3155
|
+
pending_seconds: z6.number().int().gte(0).lte(2592e3),
|
|
3156
|
+
no_data_behavior: z6.enum(["keep_last", "resolve", "alert"]),
|
|
3157
|
+
renotify_interval_seconds: z6.union([z6.number(), z6.null()]).optional(),
|
|
3158
|
+
notify_on_recovery: z6.boolean().optional().default(true)
|
|
3159
|
+
})
|
|
3160
|
+
}).optional(),
|
|
3161
|
+
window: z6.object({
|
|
3162
|
+
window_seconds: z6.number().int().gte(1).lte(2592e3),
|
|
3163
|
+
schedule: z6.union([
|
|
3164
|
+
z6.object({
|
|
3165
|
+
type: z6.literal("interval"),
|
|
3166
|
+
evaluation_interval_seconds: z6.number().int().gte(1).lte(2592e3)
|
|
3167
|
+
}),
|
|
3168
|
+
z6.object({
|
|
3169
|
+
type: z6.literal("cron"),
|
|
3170
|
+
cron_expression: z6.string().min(1),
|
|
3171
|
+
timezone: z6.union([z6.string(), z6.null()]).optional()
|
|
3172
|
+
})
|
|
3173
|
+
]),
|
|
3174
|
+
evaluation_delay_seconds: z6.number().int().gte(0).lte(2592e3)
|
|
3175
|
+
}),
|
|
3176
|
+
loop: z6.object({
|
|
3177
|
+
prompt: z6.string().min(1).max(1e4),
|
|
3178
|
+
include_trigger_input: z6.boolean().optional().default(false),
|
|
3179
|
+
agent_slug: z6.string().min(1),
|
|
3180
|
+
auto_approve_tools: z6.array(z6.string().min(1)).optional().default([]),
|
|
3181
|
+
harness: z6.enum(["native", "codex", "claude-code"]).optional(),
|
|
3182
|
+
model: z6.string().min(1).optional(),
|
|
3183
|
+
reasoning_effort: z6.enum(["none", "minimal", "low", "medium", "high", "xhigh", "max"]).optional()
|
|
3184
|
+
}).optional(),
|
|
3185
|
+
actions: z6.array(
|
|
3186
|
+
z6.union([
|
|
3187
|
+
z6.object({
|
|
3188
|
+
type: z6.literal("webhook"),
|
|
3189
|
+
url: z6.string(),
|
|
3190
|
+
formatting_prompt: z6.string().min(1).max(1e4).optional()
|
|
3191
|
+
}),
|
|
3192
|
+
z6.object({
|
|
3193
|
+
type: z6.literal("slack"),
|
|
3194
|
+
workspace_id: z6.string(),
|
|
3195
|
+
channel: z6.string(),
|
|
3196
|
+
message_template: z6.string().optional(),
|
|
3197
|
+
formatting_prompt: z6.string().min(1).max(1e4).optional()
|
|
3198
|
+
})
|
|
3199
|
+
])
|
|
3200
|
+
).max(20).optional().default([])
|
|
3201
|
+
});
|
|
3115
3202
|
var TopicAutomationFacetModel = z6.union([
|
|
3116
3203
|
z6.enum(["brain-facet-latest", "brain-facet-1", "brain-facet-2"]),
|
|
3117
3204
|
z6.null()
|
|
@@ -3153,7 +3240,8 @@ var TopicDigestAutomationConfig = z6.object({
|
|
|
3153
3240
|
type: z6.literal("slack"),
|
|
3154
3241
|
workspace_id: z6.string(),
|
|
3155
3242
|
channel: z6.string(),
|
|
3156
|
-
message_template: z6.string().optional()
|
|
3243
|
+
message_template: z6.string().optional(),
|
|
3244
|
+
formatting_prompt: z6.string().min(1).max(1e4).optional()
|
|
3157
3245
|
}),
|
|
3158
3246
|
topic_map_function_ids: z6.array(z6.string()).max(10).optional()
|
|
3159
3247
|
});
|
|
@@ -3167,15 +3255,21 @@ var ProjectAutomation = z6.object({
|
|
|
3167
3255
|
config: z6.union([
|
|
3168
3256
|
z6.object({
|
|
3169
3257
|
event_type: z6.literal("logs"),
|
|
3258
|
+
status: AutomationStatus.optional(),
|
|
3170
3259
|
btql_filter: z6.string(),
|
|
3171
3260
|
interval_seconds: z6.number().gte(1).lte(2592e3),
|
|
3172
3261
|
action: z6.union([
|
|
3173
|
-
z6.object({
|
|
3262
|
+
z6.object({
|
|
3263
|
+
type: z6.literal("webhook"),
|
|
3264
|
+
url: z6.string(),
|
|
3265
|
+
formatting_prompt: z6.string().min(1).max(1e4).optional()
|
|
3266
|
+
}),
|
|
3174
3267
|
z6.object({
|
|
3175
3268
|
type: z6.literal("slack"),
|
|
3176
3269
|
workspace_id: z6.string(),
|
|
3177
3270
|
channel: z6.string(),
|
|
3178
|
-
message_template: z6.string().optional()
|
|
3271
|
+
message_template: z6.string().optional(),
|
|
3272
|
+
formatting_prompt: z6.string().min(1).max(1e4).optional()
|
|
3179
3273
|
})
|
|
3180
3274
|
])
|
|
3181
3275
|
}),
|
|
@@ -3226,21 +3320,38 @@ var ProjectAutomation = z6.object({
|
|
|
3226
3320
|
}),
|
|
3227
3321
|
z6.object({
|
|
3228
3322
|
event_type: z6.literal("environment_update"),
|
|
3323
|
+
status: AutomationStatus.optional(),
|
|
3229
3324
|
environment_filter: z6.array(z6.string()).optional(),
|
|
3230
3325
|
action: z6.union([
|
|
3231
|
-
z6.object({
|
|
3326
|
+
z6.object({
|
|
3327
|
+
type: z6.literal("webhook"),
|
|
3328
|
+
url: z6.string(),
|
|
3329
|
+
formatting_prompt: z6.string().min(1).max(1e4).optional()
|
|
3330
|
+
}),
|
|
3232
3331
|
z6.object({
|
|
3233
3332
|
type: z6.literal("slack"),
|
|
3234
3333
|
workspace_id: z6.string(),
|
|
3235
3334
|
channel: z6.string(),
|
|
3236
|
-
message_template: z6.string().optional()
|
|
3335
|
+
message_template: z6.string().optional(),
|
|
3336
|
+
formatting_prompt: z6.string().min(1).max(1e4).optional()
|
|
3237
3337
|
})
|
|
3238
3338
|
])
|
|
3239
3339
|
}),
|
|
3340
|
+
WindowedAutomationConfig,
|
|
3240
3341
|
TopicAutomationConfig,
|
|
3241
3342
|
TopicDigestAutomationConfig
|
|
3242
3343
|
])
|
|
3243
3344
|
});
|
|
3345
|
+
var ProjectGroup = z6.object({
|
|
3346
|
+
id: z6.string().uuid(),
|
|
3347
|
+
org_id: z6.string().uuid(),
|
|
3348
|
+
user_id: z6.union([z6.string(), z6.null()]).optional(),
|
|
3349
|
+
created: z6.union([z6.string(), z6.null()]).optional(),
|
|
3350
|
+
name: z6.string(),
|
|
3351
|
+
description: z6.union([z6.string(), z6.null()]).optional(),
|
|
3352
|
+
deleted_at: z6.union([z6.string(), z6.null()]).optional(),
|
|
3353
|
+
member_projects: z6.array(z6.string().uuid()).max(1e4)
|
|
3354
|
+
});
|
|
3244
3355
|
var ProjectLogsEvent = z6.object({
|
|
3245
3356
|
id: z6.string(),
|
|
3246
3357
|
_xact_id: z6.string(),
|
|
@@ -3458,7 +3569,8 @@ var RunEval = z6.object({
|
|
|
3458
3569
|
dataset_environment: z6.union([z6.string(), z6.null()]).optional(),
|
|
3459
3570
|
_internal_btql: z6.union([z6.object({}).partial().passthrough(), z6.null()]).optional()
|
|
3460
3571
|
}),
|
|
3461
|
-
z6.object({ data: z6.array(z6.unknown()) })
|
|
3572
|
+
z6.object({ data: z6.array(z6.unknown()) }),
|
|
3573
|
+
z6.object({ experiment_name: z6.string() })
|
|
3462
3574
|
]),
|
|
3463
3575
|
name: z6.string().optional(),
|
|
3464
3576
|
parameters: z6.object({}).partial().passthrough().optional(),
|
|
@@ -3663,7 +3775,9 @@ var View = z6.object({
|
|
|
3663
3775
|
"for_review_datasets"
|
|
3664
3776
|
]),
|
|
3665
3777
|
name: z6.string(),
|
|
3778
|
+
description: z6.union([z6.string(), z6.null()]).optional(),
|
|
3666
3779
|
created: z6.union([z6.string(), z6.null()]).optional(),
|
|
3780
|
+
updated_at: z6.union([z6.string(), z6.null()]).optional(),
|
|
3667
3781
|
view_data: ViewData.optional(),
|
|
3668
3782
|
options: ViewOptions.optional(),
|
|
3669
3783
|
user_id: z6.union([z6.string(), z6.null()]).optional(),
|
|
@@ -4762,12 +4876,13 @@ var INSTRUMENTATION_NAMES = {
|
|
|
4762
4876
|
OPENROUTER: "openrouter",
|
|
4763
4877
|
OPENROUTER_AGENT: "openrouter-agent",
|
|
4764
4878
|
PI_CODING_AGENT: "pi-coding-agent",
|
|
4765
|
-
STRANDS_AGENT_SDK: "strands-agent-sdk"
|
|
4879
|
+
STRANDS_AGENT_SDK: "strands-agent-sdk",
|
|
4880
|
+
VOYAGEAI: "voyageai"
|
|
4766
4881
|
};
|
|
4767
4882
|
var INTERNAL_SPAN_INSTRUMENTATION_NAME = /* @__PURE__ */ Symbol.for(
|
|
4768
4883
|
"braintrust.spanInstrumentationName"
|
|
4769
4884
|
);
|
|
4770
|
-
var SDK_VERSION = true ? "3.
|
|
4885
|
+
var SDK_VERSION = true ? "3.28.0" : "0.0.0";
|
|
4771
4886
|
function withSpanInstrumentationName(args, instrumentationName) {
|
|
4772
4887
|
return {
|
|
4773
4888
|
...args,
|
|
@@ -4962,6 +5077,9 @@ function applyMaskingToField(maskingFunction, data, fieldName) {
|
|
|
4962
5077
|
var INITIAL_SPAN_WRITE_AS_MERGE = /* @__PURE__ */ Symbol(
|
|
4963
5078
|
"braintrust.initial-span-write-as-merge"
|
|
4964
5079
|
);
|
|
5080
|
+
var RESUME_SPAN_WITHOUT_INITIAL_WRITE = /* @__PURE__ */ Symbol(
|
|
5081
|
+
"braintrust.resume-span-without-initial-write"
|
|
5082
|
+
);
|
|
4965
5083
|
var INTERNAL_SPAN_CONTEXT = /* @__PURE__ */ Symbol("braintrust.internal-span-context");
|
|
4966
5084
|
var BRAINTRUST_CURRENT_SPAN_STORE = /* @__PURE__ */ Symbol.for(
|
|
4967
5085
|
"braintrust.currentSpanStore"
|
|
@@ -7734,7 +7852,7 @@ var ObjectFetcher = class {
|
|
|
7734
7852
|
const objectId = await this.id;
|
|
7735
7853
|
const batchLimit = batchSize ?? DEFAULT_FETCH_BATCH_SIZE;
|
|
7736
7854
|
const internalLimit = getInternalBtqlLimit(this._internal_btql);
|
|
7737
|
-
|
|
7855
|
+
let remainingLimit = internalLimit;
|
|
7738
7856
|
const internalBtqlWithoutReservedQueryKeys = Object.fromEntries(
|
|
7739
7857
|
Object.entries(this._internal_btql ?? {}).filter(
|
|
7740
7858
|
([key]) => key !== "cursor" && key !== "limit" && key !== "select" && key !== "from"
|
|
@@ -7743,6 +7861,10 @@ var ObjectFetcher = class {
|
|
|
7743
7861
|
let cursor = void 0;
|
|
7744
7862
|
let iterations = 0;
|
|
7745
7863
|
while (true) {
|
|
7864
|
+
if (remainingLimit !== void 0 && remainingLimit <= 0) {
|
|
7865
|
+
return;
|
|
7866
|
+
}
|
|
7867
|
+
const limit = remainingLimit === void 0 ? batchLimit : Math.min(batchLimit, remainingLimit);
|
|
7746
7868
|
const resp = await state2.apiConn().post(
|
|
7747
7869
|
`btql`,
|
|
7748
7870
|
{
|
|
@@ -7782,7 +7904,14 @@ var ObjectFetcher = class {
|
|
|
7782
7904
|
const respJson = await resp.json();
|
|
7783
7905
|
const mutate = this.mutateRecord;
|
|
7784
7906
|
for (const record of respJson.data ?? []) {
|
|
7785
|
-
|
|
7907
|
+
if (remainingLimit !== void 0 && remainingLimit <= 0) {
|
|
7908
|
+
return;
|
|
7909
|
+
}
|
|
7910
|
+
const mutatedRecord = mutate ? mutate(record) : record;
|
|
7911
|
+
if (remainingLimit !== void 0) {
|
|
7912
|
+
remainingLimit--;
|
|
7913
|
+
}
|
|
7914
|
+
yield mutatedRecord;
|
|
7786
7915
|
}
|
|
7787
7916
|
if (!respJson.cursor) {
|
|
7788
7917
|
break;
|
|
@@ -8259,7 +8388,9 @@ var SpanImpl = class _SpanImpl {
|
|
|
8259
8388
|
this._rootSpanId = resolvedIds.rootSpanId;
|
|
8260
8389
|
this._spanParents = resolvedIds.spanParents;
|
|
8261
8390
|
this.isMerge = args[INITIAL_SPAN_WRITE_AS_MERGE] === true;
|
|
8262
|
-
|
|
8391
|
+
if (!args[RESUME_SPAN_WITHOUT_INITIAL_WRITE]) {
|
|
8392
|
+
this.logInternal({ event, internalData });
|
|
8393
|
+
}
|
|
8263
8394
|
this.isMerge = true;
|
|
8264
8395
|
}
|
|
8265
8396
|
getParentInfo() {
|
|
@@ -12629,6 +12760,77 @@ var strandsAgentSDKConfigs = [
|
|
|
12629
12760
|
}
|
|
12630
12761
|
];
|
|
12631
12762
|
|
|
12763
|
+
// src/instrumentation/plugins/voyageai-channels.ts
|
|
12764
|
+
var voyageAIChannels = defineChannels(
|
|
12765
|
+
"voyageai",
|
|
12766
|
+
{
|
|
12767
|
+
embed: channel({
|
|
12768
|
+
channelName: "embed",
|
|
12769
|
+
kind: "async"
|
|
12770
|
+
}),
|
|
12771
|
+
multimodalEmbed: channel({
|
|
12772
|
+
channelName: "multimodalEmbed",
|
|
12773
|
+
kind: "async"
|
|
12774
|
+
}),
|
|
12775
|
+
rerank: channel({
|
|
12776
|
+
channelName: "rerank",
|
|
12777
|
+
kind: "async"
|
|
12778
|
+
}),
|
|
12779
|
+
contextualizedEmbed: channel({
|
|
12780
|
+
channelName: "contextualizedEmbed",
|
|
12781
|
+
kind: "async"
|
|
12782
|
+
})
|
|
12783
|
+
},
|
|
12784
|
+
{ instrumentationName: INSTRUMENTATION_NAMES.VOYAGEAI }
|
|
12785
|
+
);
|
|
12786
|
+
|
|
12787
|
+
// src/auto-instrumentations/configs/voyageai.ts
|
|
12788
|
+
var GENERATED_CLIENT_MODULES = [
|
|
12789
|
+
"dist/cjs/Client.js",
|
|
12790
|
+
"dist/esm/Client.mjs"
|
|
12791
|
+
];
|
|
12792
|
+
var generatedClientOperations = [
|
|
12793
|
+
{
|
|
12794
|
+
channelName: voyageAIChannels.embed.channelName,
|
|
12795
|
+
methodName: "embed",
|
|
12796
|
+
versionRange: ">=0.2.0 <1.0.0"
|
|
12797
|
+
},
|
|
12798
|
+
{
|
|
12799
|
+
channelName: voyageAIChannels.multimodalEmbed.channelName,
|
|
12800
|
+
methodName: "multimodalEmbed",
|
|
12801
|
+
versionRange: ">=0.2.0 <1.0.0"
|
|
12802
|
+
},
|
|
12803
|
+
{
|
|
12804
|
+
channelName: voyageAIChannels.rerank.channelName,
|
|
12805
|
+
methodName: "rerank",
|
|
12806
|
+
versionRange: ">=0.2.0 <1.0.0"
|
|
12807
|
+
},
|
|
12808
|
+
{
|
|
12809
|
+
channelName: voyageAIChannels.contextualizedEmbed.channelName,
|
|
12810
|
+
methodName: "contextualizedEmbed",
|
|
12811
|
+
versionRange: ">=0.2.0 <1.0.0"
|
|
12812
|
+
}
|
|
12813
|
+
];
|
|
12814
|
+
var voyageAIConfigs = [
|
|
12815
|
+
...GENERATED_CLIENT_MODULES.flatMap(
|
|
12816
|
+
(filePath) => generatedClientOperations.map(
|
|
12817
|
+
({ channelName, methodName, versionRange: versionRange2 }) => ({
|
|
12818
|
+
channelName,
|
|
12819
|
+
module: {
|
|
12820
|
+
name: "voyageai",
|
|
12821
|
+
versionRange: versionRange2,
|
|
12822
|
+
filePath
|
|
12823
|
+
},
|
|
12824
|
+
functionQuery: {
|
|
12825
|
+
className: "VoyageAIClient",
|
|
12826
|
+
methodName,
|
|
12827
|
+
kind: "Async"
|
|
12828
|
+
}
|
|
12829
|
+
})
|
|
12830
|
+
)
|
|
12831
|
+
)
|
|
12832
|
+
];
|
|
12833
|
+
|
|
12632
12834
|
// src/auto-instrumentations/configs/all.ts
|
|
12633
12835
|
var defaultInstrumentationConfigGroups = [
|
|
12634
12836
|
{ integrations: ["openai"], configs: openaiConfigs },
|
|
@@ -12708,6 +12910,10 @@ var defaultInstrumentationConfigGroups = [
|
|
|
12708
12910
|
{
|
|
12709
12911
|
integrations: ["flue"],
|
|
12710
12912
|
configs: flueConfigs
|
|
12913
|
+
},
|
|
12914
|
+
{
|
|
12915
|
+
integrations: ["voyageai"],
|
|
12916
|
+
configs: voyageAIConfigs
|
|
12711
12917
|
}
|
|
12712
12918
|
// Note: `@mastra/core` is not listed here because its instrumentation
|
|
12713
12919
|
// doesn't go through the AST `code-transformer` matcher — Mastra's
|
|
@@ -822,7 +822,8 @@ var INSTRUMENTATION_NAMES = {
|
|
|
822
822
|
OPENROUTER: "openrouter",
|
|
823
823
|
OPENROUTER_AGENT: "openrouter-agent",
|
|
824
824
|
PI_CODING_AGENT: "pi-coding-agent",
|
|
825
|
-
STRANDS_AGENT_SDK: "strands-agent-sdk"
|
|
825
|
+
STRANDS_AGENT_SDK: "strands-agent-sdk",
|
|
826
|
+
VOYAGEAI: "voyageai"
|
|
826
827
|
};
|
|
827
828
|
|
|
828
829
|
// src/instrumentation/plugins/openai-channels.ts
|