@bitfab/sdk 0.75.0 → 0.76.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.
Files changed (58) hide show
  1. package/dist/{autoTrace-kHOBg49M.js → autoTrace-BgN0zCQf.js} +565 -69
  2. package/dist/autoTrace-BgN0zCQf.js.map +1 -0
  3. package/dist/{autoTrace-DPWV1Xzr.cjs → autoTrace-pZKu5Nk2.cjs} +612 -68
  4. package/dist/autoTrace-pZKu5Nk2.cjs.map +1 -0
  5. package/dist/autoTrace.cjs +2 -1
  6. package/dist/autoTrace.d.cts +20 -24
  7. package/dist/autoTrace.d.ts +20 -24
  8. package/dist/autoTrace.js +1 -1
  9. package/dist/{babelPlugin-C0Im6AZ2.cjs → babelPlugin-BpEeVvk4.cjs} +73 -25
  10. package/dist/babelPlugin-BpEeVvk4.cjs.map +1 -0
  11. package/dist/{babelPlugin-hS2Hb2vt.js → babelPlugin-PgjdBuQe.js} +73 -25
  12. package/dist/babelPlugin-PgjdBuQe.js.map +1 -0
  13. package/dist/{http-Cotx6kLL.js → http-DS1QjBvx.js} +3 -3
  14. package/dist/{http-Cotx6kLL.js.map → http-DS1QjBvx.js.map} +1 -1
  15. package/dist/{http-BkL24D7v.cjs → http-ykHGNcju.cjs} +3 -3
  16. package/dist/{http-BkL24D7v.cjs.map → http-ykHGNcju.cjs.map} +1 -1
  17. package/dist/{index-V6ECPulQ.d.cts → index-BYv4DSsY.d.cts} +286 -17
  18. package/dist/{index-V6ECPulQ.d.ts → index-BYv4DSsY.d.ts} +286 -17
  19. package/dist/index.cjs +2 -2
  20. package/dist/index.d.cts +2 -2
  21. package/dist/index.d.ts +2 -2
  22. package/dist/index.js +2 -2
  23. package/dist/node.cjs +3 -3
  24. package/dist/node.d.cts +2 -2
  25. package/dist/node.d.ts +2 -2
  26. package/dist/node.js +3 -3
  27. package/dist/{registryCommand-DdE8cNOX.js → registryCommand-D1VgfJjC.js} +341 -46
  28. package/dist/registryCommand-D1VgfJjC.js.map +1 -0
  29. package/dist/replayCli.js +1 -1
  30. package/dist/seedCli.js +1 -1
  31. package/dist/{src-CrV0INwT.js → src-BJjbR3Nq.js} +72 -34
  32. package/dist/src-BJjbR3Nq.js.map +1 -0
  33. package/dist/{src-BJ5a-chk.cjs → src-CLkegn-P.cjs} +78 -40
  34. package/dist/src-CLkegn-P.cjs.map +1 -0
  35. package/dist/transform/babel.cjs +1 -1
  36. package/dist/transform/babel.d.cts +2 -9
  37. package/dist/transform/babel.d.ts +2 -9
  38. package/dist/transform/babel.js +1 -1
  39. package/dist/transform/loaderRuntime.cjs +2 -2
  40. package/dist/transform/loaderRuntime.js +2 -2
  41. package/dist/transform/nodeLoader.js +72 -24
  42. package/dist/transform/nodeLoader.js.map +1 -1
  43. package/dist/transform/swc.cjs +1 -1
  44. package/dist/transform/swc.js +1 -1
  45. package/dist/transform/unplugin.cjs +2 -2
  46. package/dist/transform/unplugin.js +2 -2
  47. package/dist/{transform-BL1fJW-C.js → transform-BhazCKOg.js} +2 -2
  48. package/dist/{transform-BL1fJW-C.js.map → transform-BhazCKOg.js.map} +1 -1
  49. package/dist/{transform-C4H7TKW-.cjs → transform-Cdg7CSbP.cjs} +2 -2
  50. package/dist/{transform-C4H7TKW-.cjs.map → transform-Cdg7CSbP.cjs.map} +1 -1
  51. package/package.json +1 -1
  52. package/dist/autoTrace-DPWV1Xzr.cjs.map +0 -1
  53. package/dist/autoTrace-kHOBg49M.js.map +0 -1
  54. package/dist/babelPlugin-C0Im6AZ2.cjs.map +0 -1
  55. package/dist/babelPlugin-hS2Hb2vt.js.map +0 -1
  56. package/dist/registryCommand-DdE8cNOX.js.map +0 -1
  57. package/dist/src-BJ5a-chk.cjs.map +0 -1
  58. package/dist/src-CrV0INwT.js.map +0 -1
package/dist/node.d.cts CHANGED
@@ -1,2 +1,2 @@
1
- import { $ as RivetEffectType, $n as ScenarioSource, $r as VercelStreamResult, $t as LabelSource, A as SpanMethodDecoratorContext, Ai as DbSnapshotRef, An as AssertionVerdictEvidence, Ar as AddDatasetTracesResult, At as LangGraphIntegrationOptions, B as getCurrentTrace, Bi as ApprovalState, Bn as SavedTraceAssertion, Br as GraderRerunTimeoutError, Bt as GraderVerdictSource, C as NodeMethodDecorator, Ci as NO_MOCK_OVERRIDE, Cn as AssertionGenerationError, Cr as ExperimentSummaryFacts, Ct as PiIntegrationOptions, D as SeedCaseOptions, Di as MixedTracingError, Dn as AssertionLabelEvidence, Dr as ExperimentsClient, Dt as BitfabAgentMiddleware, E as ReseedResult, Ei as BitfabError, En as AssertionKind, Er as ExperimentTotals, Et as BitfabOpenAIAgentHandler, F as WrapOpenAIResponsesOptions, Fi as SelectiveReplayReport, Fn as SaveAssertionsParams, Fr as GraderRerun, Ft as GraderLabelOutcome, G as TracingProcessor, Gn as ScenarioData, Gr as RerunGradersResult, Gt as AssertionVerdict, H as ActiveSpanContext, Hi as Assignee, Hn as ScenarioAction, Hr as RemoveDatasetGradersResult, Ht as GradersClient, I as WrapOpenRouterOptions, Ii as AllowedEnvVars, In as SaveScenarioActualOutcome, Ir as GraderRerunError, It as GraderLabelSource, J as SpanListParams, Jn as ScenarioDataSources, Jr as UpdateDatasetParams, Jt as HumanVerdictOutcome, K as ListedSpan, Kn as ScenarioDataAppend, Kr as SaveDatasetParams, Kt as HumanLabelOutcome, L as WrappedBamlFn, Li as BamlExecutionResult, Ln as SaveScenarioData, Lr as GraderRerunProgress, Lt as GraderLabelUpdate, M as WrapAnthropicOptions, Mi as ReplayNodeIdentity, Mn as GenerateScenarioOptions, Mr as DatasetGraderRef, Mt as GetGraderLabelsParams, N as WrapBAMLOptions, Ni as SelectiveReplayDecision, Nn as SaveAssertion, Nr as DatasetTraceIds, Nt as GetGraderVerdictsParams, O as SeedRunOptions, Oi as DbSnapshotConfig, On as AssertionRewrite, Or as ListExperimentsParams, Ot as BitfabLangGraphAgent, P as WrapJevOptions, Pi as SelectiveReplayOptions, Pn as SaveAssertionsAllParams, Pr as DatasetsClient, Pt as GraderLabel, Q as RivetContextLike, Qn as ScenarioRecordInput, Qr as VercelGenerateResult, Qt as LabelOutcome, R as getCurrentReplayBranch, Ri as ProviderDefinition, Rn as SaveScenarioHistoryEntry, Rr as GraderRerunResult, Rt as GraderVerdict, S as DetachedTrace, Si as MockValue, Sn as AssertionGeneration, Sr as ExperimentSummaryExampleTrace, St as BitfabPiIntegration, T as ReseedOptions, Ti as SpanNodeMeta, Tn as AssertionGenerationTimeoutError, Tr as ExperimentTally, Tt as OrganizationMembersClient, U as BitfabOpenAITracingProcessor, Ui as Justification, Un as ScenarioActualOutcome, Ur as RemoveDatasetTracesResult, Ut as ArchiveLabelTarget, V as CaptureSurface, Vi as Approver, Vn as Scenario, Vr as ListDatasetsParams, Vt as GraderVerdictUpdate, W as TraceResponse, Wi as JustificationSpan, Wn as ScenarioCreationStatus, Wr as RerunGradersOptions, Wt as ArchiveVerdictTarget, X as SpansClient, Xn as ScenarioHistoryEntry, Xr as BitfabVercelAiHandler, Xt as LabelAction, Y as SpanListResult, Yn as ScenarioGeneration, Yr as BitfabLanguageModelMiddleware, Yt as HumanVerdictUpdate, Z as BitfabRivetIntegration, Zn as ScenarioRecord, Zr as VercelCallParams, Zt as LabelConfidence, _ as BitfabConfig, _i as DbBranchTimings, _n as VerdictsClient, _r as ExperimentRollupResult, _t as TraceIngestionType, a as ReplayRegistryOptions, ai as Category, an as TraceLabels, ar as TraceSearchFilters, at as DbBranchOptions, b as CurrentSpan, bi as MockOverrideInput, bn as AssertionCodeDraft, br as ExperimentSummary, bt as ReplayInterrupt, c as SeedResult, ci as SaveCategoryParams, cn as VerdictAction, cr as TraceTarget, ct as ReplayError, d as seedFromRegistry, di as HttpClient, dn as VerdictEvidenceItem, dr as Experiment, dt as ReplayItemFinishProgress, ei as BitfabClaudeAgentHandler, en as LabelStatus, er as ScenarioTrigger, et as RivetIntegrationOptions, f as finalizers, fi as SpanLookup, fn as VerdictOutcome, fr as ExperimentCategoryTally, ft as ReplayItemStartProgress, g as Bitfab, gi as flushTraces, gn as VerdictUpdate, gr as ExperimentRollup, gt as ReplayResult, h as CommitRef, hi as TokenUsage, hn as VerdictTarget, hr as ExperimentPage, ht as ReplayProgressItem, i as ReplayRegistryContext, ii as CategoriesClient, in as PassFailVerdict, ir as TraceAssertionsUpdate, it as BITFAB_PROGRESS_PREFIX, j as SpanOptions, ji as SUPPORTED_PROVIDERS, jn as GenerateAssertionsOptions, jr as Dataset, jt as BitfabLangGraphCallbackHandler, k as SpanMethodDecorator, ki as DbSnapshotProvider, kn as AssertionRewriteStatus, kr as AddDatasetGradersResult, kt as BitfabLangGraphIntegration, l as defineReplayRegistry, li as CapturedSpan, ln as VerdictConfidence, lr as TraceTargetOccurrence, lt as ReplayExperiment, m as __version__, mi as SpanType, mn as VerdictStatus, mr as ExperimentJitter, mt as ReplayProgress, n as ReplayRegistration, ni as AssertionCategory, nn as LabelUpdate, nr as TraceAssertionSource, nt as AdaptContext, o as ReseedRegistryResult, oi as CategorySummary, on as TraceVerdicts, or as TraceSearchParams, ot as DbBranchReplayError, p as DEFAULT_SERVICE_URL, pi as SpanOccurrence, pn as VerdictSource, pr as ExperimentCodeChangeTotals, pt as ReplayOptions, q as SpanListField, qn as ScenarioDataOrigin, qr as SaveDatasetResult, qt as HumanLabelUpdate, r as ReplayRegistry, ri as AssertionCategorySummary, rn as LabelsClient, rr as TraceAssertionsResult, rt as AdaptInputsFn, s as SeedCase, si as SaveAssertionCategoryParams, sn as Verdict, sr as TraceSearchResult, st as MockStrategy, t as ReplayOptionsFactory, ti as AssertionCategoriesClient, tn as LabelTarget, tr as TraceAssertion, tt as ReplayBranch, u as reseedFromRegistry, ui as CodeChangeFile, un as VerdictEvidence, ur as TracesClient, ut as ReplayItem, v as BitfabFunction, vi as MockOverride, vn as ArchiveAssertionsParams, vr as ExperimentRunBy, vt as reportReplayProgress, w as NodeOptions, wi as NodeMatcher, wn as AssertionGenerationStatus, wr as ExperimentSummaryResult, wt as OrganizationMember, x as CurrentTrace, xi as MockOverrideResolver, xn as AssertionEvidenceParameter, xr as ExperimentSummaryBeforeAfter, xt as ReplayInterruptSignal, y as CaptureWhen, yi as MockOverrideCtx, yn as AssertionCode, yr as ExperimentStatus, yt as serializeReplayResult, z as getCurrentSpan, zi as ApprovalFields, zn as SaveScenarioParams, zr as GraderRerunStatus, zt as GraderVerdictOutcome } from "./index-V6ECPulQ.cjs";
2
- export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, type ApprovalFields, type ApprovalState, type Approver, type ArchiveAssertionsParams, type ArchiveLabelTarget, type ArchiveVerdictTarget, AssertionCategoriesClient, type AssertionCategory, type AssertionCategorySummary, type AssertionCode, type AssertionCodeDraft, type AssertionEvidenceParameter, type AssertionGeneration, AssertionGenerationError, type AssertionGenerationStatus, AssertionGenerationTimeoutError, type AssertionKind, type AssertionLabelEvidence, type AssertionRewrite, type AssertionRewriteStatus, type AssertionVerdict, type AssertionVerdictEvidence, type Assignee, BITFAB_PROGRESS_PREFIX, type BamlExecutionResult, Bitfab, type BitfabAgentMiddleware, BitfabClaudeAgentHandler, type BitfabConfig, BitfabError, BitfabFunction, BitfabLangGraphCallbackHandler as BitfabLangChainCallbackHandler, BitfabLangGraphCallbackHandler, type BitfabLangGraphAgent, BitfabLangGraphIntegration, type BitfabLanguageModelMiddleware, BitfabOpenAIAgentHandler, BitfabOpenAITracingProcessor, BitfabPiIntegration, BitfabRivetIntegration, BitfabVercelAiHandler, type CaptureSurface, type CaptureWhen, type CapturedSpan, CategoriesClient, type Category, type CategorySummary, type CodeChangeFile, type CommitRef, type CurrentSpan, type CurrentTrace, DEFAULT_SERVICE_URL, type Dataset, type DatasetGraderRef, type DatasetTraceIds, DatasetsClient, type DbBranchOptions, DbBranchReplayError, type DbBranchTimings, type DbSnapshotConfig, type DbSnapshotProvider, type DbSnapshotRef, type DetachedTrace, type Experiment, type ExperimentCategoryTally, type ExperimentCodeChangeTotals, type ExperimentJitter, type ExperimentPage, type ExperimentRollup, type ExperimentRollupResult, type ExperimentRunBy, type ExperimentStatus, type ExperimentSummary, type ExperimentSummaryBeforeAfter, type ExperimentSummaryExampleTrace, type ExperimentSummaryFacts, type ExperimentSummaryResult, type ExperimentTally, type ExperimentTotals, ExperimentsClient, type GenerateAssertionsOptions, type GenerateScenarioOptions, type GetGraderLabelsParams, type GetGraderVerdictsParams, type GraderLabel, type GraderLabelOutcome, type GraderLabelSource, type GraderLabelUpdate, type GraderRerun, GraderRerunError, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, GraderRerunTimeoutError, type GraderVerdict, type GraderVerdictOutcome, type GraderVerdictSource, type GraderVerdictUpdate, GradersClient, HttpClient, type HumanLabelOutcome, type HumanLabelUpdate, type HumanVerdictOutcome, type HumanVerdictUpdate, type Justification, type JustificationSpan, type LabelAction, type LabelConfidence, type LabelOutcome, type LabelSource, type LabelStatus, type LabelTarget, type LabelUpdate, LabelsClient, type LangGraphIntegrationOptions, type ListDatasetsParams, type ListExperimentsParams, type ListedSpan, MixedTracingError, type MockOverride, type MockOverrideCtx, type MockOverrideInput, type MockOverrideResolver, type MockStrategy, type MockValue, NO_MOCK_OVERRIDE, type NodeMatcher, type NodeMethodDecorator, type NodeOptions, type OrganizationMember, OrganizationMembersClient, type PassFailVerdict, type PiIntegrationOptions, type ProviderDefinition, type RemoveDatasetGradersResult, type RemoveDatasetTracesResult, type ReplayBranch, ReplayError, type ReplayExperiment, type ReplayInterrupt, type ReplayInterruptSignal, type ReplayItem, type ReplayItemFinishProgress, type ReplayItemStartProgress, type ReplayNodeIdentity, type ReplayOptions, type ReplayOptionsFactory, type ReplayProgress, type ReplayProgressItem, type ReplayRegistration, type ReplayRegistry, type ReplayRegistryContext, type ReplayRegistryOptions, type ReplayResult, type RerunGradersOptions, type RerunGradersResult, type ReseedOptions, type ReseedRegistryResult, type ReseedResult, type RivetContextLike, type RivetEffectType, type RivetIntegrationOptions, SUPPORTED_PROVIDERS, type SaveAssertion, type SaveAssertionCategoryParams, type SaveAssertionsAllParams, type SaveAssertionsParams, type SaveCategoryParams, type SaveDatasetParams, type SaveDatasetResult, type SaveScenarioActualOutcome, type SaveScenarioData, type SaveScenarioHistoryEntry, type SaveScenarioParams, type SavedTraceAssertion, type Scenario, type ScenarioAction, type ScenarioActualOutcome, type ScenarioCreationStatus, type ScenarioData, type ScenarioDataAppend, type ScenarioDataOrigin, type ScenarioDataSources, type ScenarioGeneration, type ScenarioHistoryEntry, type ScenarioRecord, type ScenarioRecordInput, type ScenarioSource, type ScenarioTrigger, type SeedCase, type SeedCaseOptions, type SeedResult, type SeedRunOptions, type SelectiveReplayDecision, type SelectiveReplayOptions, type SelectiveReplayReport, type SpanListField, type SpanListParams, type SpanListResult, type SpanLookup, type SpanMethodDecorator, type SpanMethodDecoratorContext, type SpanNodeMeta, type SpanOccurrence, type SpanOptions, type SpanType, SpansClient, type TokenUsage, type TraceAssertion, type TraceAssertionSource, type TraceAssertionsResult, type TraceAssertionsUpdate, type TraceIngestionType, type TraceLabels, type TraceResponse, type TraceSearchFilters, type TraceSearchParams, type TraceSearchResult, type TraceTarget, type TraceTargetOccurrence, type TraceVerdicts, TracesClient, type TracingProcessor, type UpdateDatasetParams, type VercelCallParams, type VercelGenerateResult, type VercelStreamResult, type Verdict, type VerdictAction, type VerdictConfidence, type VerdictEvidence, type VerdictEvidenceItem, type VerdictOutcome, type VerdictSource, type VerdictStatus, type VerdictTarget, type VerdictUpdate, VerdictsClient, type WrapAnthropicOptions, type WrapBAMLOptions, type WrapJevOptions, type WrapOpenAIResponsesOptions, type WrapOpenRouterOptions, type WrappedBamlFn, __version__, defineReplayRegistry, finalizers, flushTraces, getCurrentReplayBranch, getCurrentSpan, getCurrentTrace, reportReplayProgress, reseedFromRegistry, seedFromRegistry, serializeReplayResult };
1
+ import { $ as SpanListResult, $n as ScenarioGeneration, $r as BitfabLanguageModelMiddleware, $t as HumanVerdictUpdate, A as SpanMethodDecoratorContext, Ai as BitfabError, An as AssertionKind, Ar as ExperimentTotals, At as BitfabOpenAIAgentHandler, B as WrapOpenRouterOptions, Bi as AllowedEnvVars, Bn as SaveScenarioActualOutcome, Br as GraderRerunError, Bt as GraderLabelSource, C as NodeMethodDecorator, Ci as MockOverrideCtx, Cn as AssertionCode, Cr as ExperimentStatus, Ct as serializeReplayResult, D as SeedCaseOptions, Di as NO_MOCK_OVERRIDE, Dn as AssertionGenerationError, Dr as ExperimentSummaryFacts, Dt as PiIntegrationOptions, E as ReseedResult, Ei as MockValue, En as AssertionGeneration, Er as ExperimentSummaryExampleTrace, Et as BitfabPiIntegration, F as WrapJevOptions, Fi as SUPPORTED_PROVIDERS, Fn as GenerateAssertionsOptions, Fr as Dataset, Ft as BitfabLangGraphCallbackHandler, G as CaptureSurface, Gi as Approver, Gn as Scenario, Gr as ListDatasetsParams, Gt as GraderVerdictUpdate, H as getCurrentReplayBranch, Hi as ProviderDefinition, Hn as SaveScenarioHistoryEntry, Hr as GraderRerunResult, Ht as GraderVerdict, I as WrapOpenAIChatOptions, Ii as ReplayNodeIdentity, In as GenerateScenarioOptions, Ir as DatasetGraderRef, It as GetGraderLabelsParams, J as TraceResponse, Ji as JustificationSpan, Jn as ScenarioCreationStatus, Jr as RerunGradersOptions, Jt as ArchiveVerdictTarget, K as ActiveSpanContext, Ki as Assignee, Kn as ScenarioAction, Kr as RemoveDatasetGradersResult, Kt as GradersClient, L as WrapOpenAIEmbeddingsOptions, Li as SelectiveReplayDecision, Ln as SaveAssertion, Lr as DatasetTraceIds, Lt as GetGraderVerdictsParams, M as WrapAnthropicOptions, Mi as DbSnapshotConfig, Mn as AssertionRewrite, Mr as ListExperimentsParams, Mt as BitfabLangGraphAgent, N as WrapBAMLOptions, Ni as DbSnapshotProvider, Nn as AssertionRewriteStatus, Nr as AddDatasetGradersResult, Nt as BitfabLangGraphIntegration, O as SeedRunOptions, Oi as NodeMatcher, On as AssertionGenerationStatus, Or as ExperimentSummaryResult, Ot as OrganizationMember, P as WrapGeminiOptions, Pi as DbSnapshotRef, Pn as AssertionVerdictEvidence, Pr as AddDatasetTracesResult, Pt as LangGraphIntegrationOptions, Q as SpanListParams, Qn as ScenarioDataSources, Qr as UpdateDatasetParams, Qt as HumanVerdictOutcome, R as WrapOpenAIResponsesOptions, Ri as SelectiveReplayOptions, Rn as SaveAssertionsAllParams, Rr as DatasetsClient, Rt as GraderLabel, S as DetachedTrace, Si as MockOverride, Sn as ArchiveAssertionsParams, Sr as ExperimentRunBy, St as reportReplayProgress, T as ReseedOptions, Ti as MockOverrideResolver, Tn as AssertionEvidenceParameter, Tr as ExperimentSummaryBeforeAfter, Tt as ReplayInterruptSignal, U as getCurrentSpan, Ui as ApprovalFields, Un as SaveScenarioParams, Ur as GraderRerunStatus, Ut as GraderVerdictOutcome, V as WrappedBamlFn, Vi as BamlExecutionResult, Vn as SaveScenarioData, Vr as GraderRerunProgress, Vt as GraderLabelUpdate, W as getCurrentTrace, Wi as ApprovalState, Wn as SavedTraceAssertion, Wr as GraderRerunTimeoutError, Wt as GraderVerdictSource, X as ListedSpan, Xn as ScenarioDataAppend, Xr as SaveDatasetParams, Xt as HumanLabelOutcome, Y as TracingProcessor, Yn as ScenarioData, Yr as RerunGradersResult, Yt as AssertionVerdict, Z as SpanListField, Zn as ScenarioDataOrigin, Zr as SaveDatasetResult, Zt as HumanLabelUpdate, _ as BitfabConfig, _i as SpanOccurrence, _n as VerdictSource, _r as ExperimentCodeChangeTotals, _t as ReplayOptions, a as ReplayRegistryOptions, ai as AssertionCategoriesClient, an as LabelTarget, ar as TraceAssertion, at as ReplayBranch, b as CurrentSpan, bi as flushTraces, bn as VerdictUpdate, br as ExperimentRollup, bt as ReplayResult, c as SeedResult, ci as CategoriesClient, cn as PassFailVerdict, cr as TraceAssertionsUpdate, ct as BITFAB_PROGRESS_PREFIX, d as seedFromRegistry, di as SaveAssertionCategoryParams, dn as Verdict, dr as TraceSearchResult, dt as MockStrategy, ei as BitfabVercelAiHandler, en as LabelAction, er as ScenarioHistoryEntry, et as SpansClient, f as finalizers, fi as SaveCategoryParams, fn as VerdictAction, fr as TraceTarget, ft as ReplayError, g as Bitfab, gi as SpanLookup, gn as VerdictOutcome, gr as ExperimentCategoryTally, gt as ReplayItemStartProgress, h as CommitRef, hi as HttpClient, hn as VerdictEvidenceItem, hr as Experiment, ht as ReplayItemFinishProgress, i as ReplayRegistryContext, ii as BitfabClaudeAgentHandler, in as LabelStatus, ir as ScenarioTrigger, it as RivetIntegrationOptions, j as SpanOptions, ji as MixedTracingError, jn as AssertionLabelEvidence, jr as ExperimentsClient, jt as BitfabAgentMiddleware, k as SpanMethodDecorator, ki as SpanNodeMeta, kn as AssertionGenerationTimeoutError, kr as ExperimentTally, kt as OrganizationMembersClient, l as defineReplayRegistry, li as Category, ln as TraceLabels, lr as TraceSearchFilters, lt as DbBranchOptions, m as __version__, mi as CodeChangeFile, mn as VerdictEvidence, mr as TracesClient, mt as ReplayItem, n as ReplayRegistration, ni as VercelGenerateResult, nn as LabelOutcome, nr as ScenarioRecordInput, nt as RivetContextLike, o as ReseedRegistryResult, oi as AssertionCategory, on as LabelUpdate, or as TraceAssertionSource, ot as AdaptContext, p as DEFAULT_SERVICE_URL, pi as CapturedSpan, pn as VerdictConfidence, pr as TraceTargetOccurrence, pt as ReplayExperiment, q as BitfabOpenAITracingProcessor, qi as Justification, qn as ScenarioActualOutcome, qr as RemoveDatasetTracesResult, qt as ArchiveLabelTarget, r as ReplayRegistry, ri as VercelStreamResult, rn as LabelSource, rr as ScenarioSource, rt as RivetEffectType, s as SeedCase, si as AssertionCategorySummary, sn as LabelsClient, sr as TraceAssertionsResult, st as AdaptInputsFn, t as ReplayOptionsFactory, ti as VercelCallParams, tn as LabelConfidence, tr as ScenarioRecord, tt as BitfabRivetIntegration, u as reseedFromRegistry, ui as CategorySummary, un as TraceVerdicts, ur as TraceSearchParams, ut as DbBranchReplayError, v as BitfabFunction, vi as SpanType, vn as VerdictStatus, vr as ExperimentJitter, vt as ReplayProgress, w as NodeOptions, wi as MockOverrideInput, wn as AssertionCodeDraft, wr as ExperimentSummary, wt as ReplayInterrupt, x as CurrentTrace, xi as DbBranchTimings, xn as VerdictsClient, xr as ExperimentRollupResult, xt as TraceIngestionType, y as CaptureWhen, yi as TokenUsage, yn as VerdictTarget, yr as ExperimentPage, yt as ReplayProgressItem, z as WrapOpenAITranscriptionsOptions, zi as SelectiveReplayReport, zn as SaveAssertionsParams, zr as GraderRerun, zt as GraderLabelOutcome } from "./index-BYv4DSsY.cjs";
2
+ export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, type ApprovalFields, type ApprovalState, type Approver, type ArchiveAssertionsParams, type ArchiveLabelTarget, type ArchiveVerdictTarget, AssertionCategoriesClient, type AssertionCategory, type AssertionCategorySummary, type AssertionCode, type AssertionCodeDraft, type AssertionEvidenceParameter, type AssertionGeneration, AssertionGenerationError, type AssertionGenerationStatus, AssertionGenerationTimeoutError, type AssertionKind, type AssertionLabelEvidence, type AssertionRewrite, type AssertionRewriteStatus, type AssertionVerdict, type AssertionVerdictEvidence, type Assignee, BITFAB_PROGRESS_PREFIX, type BamlExecutionResult, Bitfab, type BitfabAgentMiddleware, BitfabClaudeAgentHandler, type BitfabConfig, BitfabError, BitfabFunction, BitfabLangGraphCallbackHandler as BitfabLangChainCallbackHandler, BitfabLangGraphCallbackHandler, type BitfabLangGraphAgent, BitfabLangGraphIntegration, type BitfabLanguageModelMiddleware, BitfabOpenAIAgentHandler, BitfabOpenAITracingProcessor, BitfabPiIntegration, BitfabRivetIntegration, BitfabVercelAiHandler, type CaptureSurface, type CaptureWhen, type CapturedSpan, CategoriesClient, type Category, type CategorySummary, type CodeChangeFile, type CommitRef, type CurrentSpan, type CurrentTrace, DEFAULT_SERVICE_URL, type Dataset, type DatasetGraderRef, type DatasetTraceIds, DatasetsClient, type DbBranchOptions, DbBranchReplayError, type DbBranchTimings, type DbSnapshotConfig, type DbSnapshotProvider, type DbSnapshotRef, type DetachedTrace, type Experiment, type ExperimentCategoryTally, type ExperimentCodeChangeTotals, type ExperimentJitter, type ExperimentPage, type ExperimentRollup, type ExperimentRollupResult, type ExperimentRunBy, type ExperimentStatus, type ExperimentSummary, type ExperimentSummaryBeforeAfter, type ExperimentSummaryExampleTrace, type ExperimentSummaryFacts, type ExperimentSummaryResult, type ExperimentTally, type ExperimentTotals, ExperimentsClient, type GenerateAssertionsOptions, type GenerateScenarioOptions, type GetGraderLabelsParams, type GetGraderVerdictsParams, type GraderLabel, type GraderLabelOutcome, type GraderLabelSource, type GraderLabelUpdate, type GraderRerun, GraderRerunError, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, GraderRerunTimeoutError, type GraderVerdict, type GraderVerdictOutcome, type GraderVerdictSource, type GraderVerdictUpdate, GradersClient, HttpClient, type HumanLabelOutcome, type HumanLabelUpdate, type HumanVerdictOutcome, type HumanVerdictUpdate, type Justification, type JustificationSpan, type LabelAction, type LabelConfidence, type LabelOutcome, type LabelSource, type LabelStatus, type LabelTarget, type LabelUpdate, LabelsClient, type LangGraphIntegrationOptions, type ListDatasetsParams, type ListExperimentsParams, type ListedSpan, MixedTracingError, type MockOverride, type MockOverrideCtx, type MockOverrideInput, type MockOverrideResolver, type MockStrategy, type MockValue, NO_MOCK_OVERRIDE, type NodeMatcher, type NodeMethodDecorator, type NodeOptions, type OrganizationMember, OrganizationMembersClient, type PassFailVerdict, type PiIntegrationOptions, type ProviderDefinition, type RemoveDatasetGradersResult, type RemoveDatasetTracesResult, type ReplayBranch, ReplayError, type ReplayExperiment, type ReplayInterrupt, type ReplayInterruptSignal, type ReplayItem, type ReplayItemFinishProgress, type ReplayItemStartProgress, type ReplayNodeIdentity, type ReplayOptions, type ReplayOptionsFactory, type ReplayProgress, type ReplayProgressItem, type ReplayRegistration, type ReplayRegistry, type ReplayRegistryContext, type ReplayRegistryOptions, type ReplayResult, type RerunGradersOptions, type RerunGradersResult, type ReseedOptions, type ReseedRegistryResult, type ReseedResult, type RivetContextLike, type RivetEffectType, type RivetIntegrationOptions, SUPPORTED_PROVIDERS, type SaveAssertion, type SaveAssertionCategoryParams, type SaveAssertionsAllParams, type SaveAssertionsParams, type SaveCategoryParams, type SaveDatasetParams, type SaveDatasetResult, type SaveScenarioActualOutcome, type SaveScenarioData, type SaveScenarioHistoryEntry, type SaveScenarioParams, type SavedTraceAssertion, type Scenario, type ScenarioAction, type ScenarioActualOutcome, type ScenarioCreationStatus, type ScenarioData, type ScenarioDataAppend, type ScenarioDataOrigin, type ScenarioDataSources, type ScenarioGeneration, type ScenarioHistoryEntry, type ScenarioRecord, type ScenarioRecordInput, type ScenarioSource, type ScenarioTrigger, type SeedCase, type SeedCaseOptions, type SeedResult, type SeedRunOptions, type SelectiveReplayDecision, type SelectiveReplayOptions, type SelectiveReplayReport, type SpanListField, type SpanListParams, type SpanListResult, type SpanLookup, type SpanMethodDecorator, type SpanMethodDecoratorContext, type SpanNodeMeta, type SpanOccurrence, type SpanOptions, type SpanType, SpansClient, type TokenUsage, type TraceAssertion, type TraceAssertionSource, type TraceAssertionsResult, type TraceAssertionsUpdate, type TraceIngestionType, type TraceLabels, type TraceResponse, type TraceSearchFilters, type TraceSearchParams, type TraceSearchResult, type TraceTarget, type TraceTargetOccurrence, type TraceVerdicts, TracesClient, type TracingProcessor, type UpdateDatasetParams, type VercelCallParams, type VercelGenerateResult, type VercelStreamResult, type Verdict, type VerdictAction, type VerdictConfidence, type VerdictEvidence, type VerdictEvidenceItem, type VerdictOutcome, type VerdictSource, type VerdictStatus, type VerdictTarget, type VerdictUpdate, VerdictsClient, type WrapAnthropicOptions, type WrapBAMLOptions, type WrapGeminiOptions, type WrapJevOptions, type WrapOpenAIChatOptions, type WrapOpenAIEmbeddingsOptions, type WrapOpenAIResponsesOptions, type WrapOpenAITranscriptionsOptions, type WrapOpenRouterOptions, type WrappedBamlFn, __version__, defineReplayRegistry, finalizers, flushTraces, getCurrentReplayBranch, getCurrentSpan, getCurrentTrace, reportReplayProgress, reseedFromRegistry, seedFromRegistry, serializeReplayResult };
package/dist/node.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { $ as RivetEffectType, $n as ScenarioSource, $r as VercelStreamResult, $t as LabelSource, A as SpanMethodDecoratorContext, Ai as DbSnapshotRef, An as AssertionVerdictEvidence, Ar as AddDatasetTracesResult, At as LangGraphIntegrationOptions, B as getCurrentTrace, Bi as ApprovalState, Bn as SavedTraceAssertion, Br as GraderRerunTimeoutError, Bt as GraderVerdictSource, C as NodeMethodDecorator, Ci as NO_MOCK_OVERRIDE, Cn as AssertionGenerationError, Cr as ExperimentSummaryFacts, Ct as PiIntegrationOptions, D as SeedCaseOptions, Di as MixedTracingError, Dn as AssertionLabelEvidence, Dr as ExperimentsClient, Dt as BitfabAgentMiddleware, E as ReseedResult, Ei as BitfabError, En as AssertionKind, Er as ExperimentTotals, Et as BitfabOpenAIAgentHandler, F as WrapOpenAIResponsesOptions, Fi as SelectiveReplayReport, Fn as SaveAssertionsParams, Fr as GraderRerun, Ft as GraderLabelOutcome, G as TracingProcessor, Gn as ScenarioData, Gr as RerunGradersResult, Gt as AssertionVerdict, H as ActiveSpanContext, Hi as Assignee, Hn as ScenarioAction, Hr as RemoveDatasetGradersResult, Ht as GradersClient, I as WrapOpenRouterOptions, Ii as AllowedEnvVars, In as SaveScenarioActualOutcome, Ir as GraderRerunError, It as GraderLabelSource, J as SpanListParams, Jn as ScenarioDataSources, Jr as UpdateDatasetParams, Jt as HumanVerdictOutcome, K as ListedSpan, Kn as ScenarioDataAppend, Kr as SaveDatasetParams, Kt as HumanLabelOutcome, L as WrappedBamlFn, Li as BamlExecutionResult, Ln as SaveScenarioData, Lr as GraderRerunProgress, Lt as GraderLabelUpdate, M as WrapAnthropicOptions, Mi as ReplayNodeIdentity, Mn as GenerateScenarioOptions, Mr as DatasetGraderRef, Mt as GetGraderLabelsParams, N as WrapBAMLOptions, Ni as SelectiveReplayDecision, Nn as SaveAssertion, Nr as DatasetTraceIds, Nt as GetGraderVerdictsParams, O as SeedRunOptions, Oi as DbSnapshotConfig, On as AssertionRewrite, Or as ListExperimentsParams, Ot as BitfabLangGraphAgent, P as WrapJevOptions, Pi as SelectiveReplayOptions, Pn as SaveAssertionsAllParams, Pr as DatasetsClient, Pt as GraderLabel, Q as RivetContextLike, Qn as ScenarioRecordInput, Qr as VercelGenerateResult, Qt as LabelOutcome, R as getCurrentReplayBranch, Ri as ProviderDefinition, Rn as SaveScenarioHistoryEntry, Rr as GraderRerunResult, Rt as GraderVerdict, S as DetachedTrace, Si as MockValue, Sn as AssertionGeneration, Sr as ExperimentSummaryExampleTrace, St as BitfabPiIntegration, T as ReseedOptions, Ti as SpanNodeMeta, Tn as AssertionGenerationTimeoutError, Tr as ExperimentTally, Tt as OrganizationMembersClient, U as BitfabOpenAITracingProcessor, Ui as Justification, Un as ScenarioActualOutcome, Ur as RemoveDatasetTracesResult, Ut as ArchiveLabelTarget, V as CaptureSurface, Vi as Approver, Vn as Scenario, Vr as ListDatasetsParams, Vt as GraderVerdictUpdate, W as TraceResponse, Wi as JustificationSpan, Wn as ScenarioCreationStatus, Wr as RerunGradersOptions, Wt as ArchiveVerdictTarget, X as SpansClient, Xn as ScenarioHistoryEntry, Xr as BitfabVercelAiHandler, Xt as LabelAction, Y as SpanListResult, Yn as ScenarioGeneration, Yr as BitfabLanguageModelMiddleware, Yt as HumanVerdictUpdate, Z as BitfabRivetIntegration, Zn as ScenarioRecord, Zr as VercelCallParams, Zt as LabelConfidence, _ as BitfabConfig, _i as DbBranchTimings, _n as VerdictsClient, _r as ExperimentRollupResult, _t as TraceIngestionType, a as ReplayRegistryOptions, ai as Category, an as TraceLabels, ar as TraceSearchFilters, at as DbBranchOptions, b as CurrentSpan, bi as MockOverrideInput, bn as AssertionCodeDraft, br as ExperimentSummary, bt as ReplayInterrupt, c as SeedResult, ci as SaveCategoryParams, cn as VerdictAction, cr as TraceTarget, ct as ReplayError, d as seedFromRegistry, di as HttpClient, dn as VerdictEvidenceItem, dr as Experiment, dt as ReplayItemFinishProgress, ei as BitfabClaudeAgentHandler, en as LabelStatus, er as ScenarioTrigger, et as RivetIntegrationOptions, f as finalizers, fi as SpanLookup, fn as VerdictOutcome, fr as ExperimentCategoryTally, ft as ReplayItemStartProgress, g as Bitfab, gi as flushTraces, gn as VerdictUpdate, gr as ExperimentRollup, gt as ReplayResult, h as CommitRef, hi as TokenUsage, hn as VerdictTarget, hr as ExperimentPage, ht as ReplayProgressItem, i as ReplayRegistryContext, ii as CategoriesClient, in as PassFailVerdict, ir as TraceAssertionsUpdate, it as BITFAB_PROGRESS_PREFIX, j as SpanOptions, ji as SUPPORTED_PROVIDERS, jn as GenerateAssertionsOptions, jr as Dataset, jt as BitfabLangGraphCallbackHandler, k as SpanMethodDecorator, ki as DbSnapshotProvider, kn as AssertionRewriteStatus, kr as AddDatasetGradersResult, kt as BitfabLangGraphIntegration, l as defineReplayRegistry, li as CapturedSpan, ln as VerdictConfidence, lr as TraceTargetOccurrence, lt as ReplayExperiment, m as __version__, mi as SpanType, mn as VerdictStatus, mr as ExperimentJitter, mt as ReplayProgress, n as ReplayRegistration, ni as AssertionCategory, nn as LabelUpdate, nr as TraceAssertionSource, nt as AdaptContext, o as ReseedRegistryResult, oi as CategorySummary, on as TraceVerdicts, or as TraceSearchParams, ot as DbBranchReplayError, p as DEFAULT_SERVICE_URL, pi as SpanOccurrence, pn as VerdictSource, pr as ExperimentCodeChangeTotals, pt as ReplayOptions, q as SpanListField, qn as ScenarioDataOrigin, qr as SaveDatasetResult, qt as HumanLabelUpdate, r as ReplayRegistry, ri as AssertionCategorySummary, rn as LabelsClient, rr as TraceAssertionsResult, rt as AdaptInputsFn, s as SeedCase, si as SaveAssertionCategoryParams, sn as Verdict, sr as TraceSearchResult, st as MockStrategy, t as ReplayOptionsFactory, ti as AssertionCategoriesClient, tn as LabelTarget, tr as TraceAssertion, tt as ReplayBranch, u as reseedFromRegistry, ui as CodeChangeFile, un as VerdictEvidence, ur as TracesClient, ut as ReplayItem, v as BitfabFunction, vi as MockOverride, vn as ArchiveAssertionsParams, vr as ExperimentRunBy, vt as reportReplayProgress, w as NodeOptions, wi as NodeMatcher, wn as AssertionGenerationStatus, wr as ExperimentSummaryResult, wt as OrganizationMember, x as CurrentTrace, xi as MockOverrideResolver, xn as AssertionEvidenceParameter, xr as ExperimentSummaryBeforeAfter, xt as ReplayInterruptSignal, y as CaptureWhen, yi as MockOverrideCtx, yn as AssertionCode, yr as ExperimentStatus, yt as serializeReplayResult, z as getCurrentSpan, zi as ApprovalFields, zn as SaveScenarioParams, zr as GraderRerunStatus, zt as GraderVerdictOutcome } from "./index-V6ECPulQ.js";
2
- export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, type ApprovalFields, type ApprovalState, type Approver, type ArchiveAssertionsParams, type ArchiveLabelTarget, type ArchiveVerdictTarget, AssertionCategoriesClient, type AssertionCategory, type AssertionCategorySummary, type AssertionCode, type AssertionCodeDraft, type AssertionEvidenceParameter, type AssertionGeneration, AssertionGenerationError, type AssertionGenerationStatus, AssertionGenerationTimeoutError, type AssertionKind, type AssertionLabelEvidence, type AssertionRewrite, type AssertionRewriteStatus, type AssertionVerdict, type AssertionVerdictEvidence, type Assignee, BITFAB_PROGRESS_PREFIX, type BamlExecutionResult, Bitfab, type BitfabAgentMiddleware, BitfabClaudeAgentHandler, type BitfabConfig, BitfabError, BitfabFunction, BitfabLangGraphCallbackHandler as BitfabLangChainCallbackHandler, BitfabLangGraphCallbackHandler, type BitfabLangGraphAgent, BitfabLangGraphIntegration, type BitfabLanguageModelMiddleware, BitfabOpenAIAgentHandler, BitfabOpenAITracingProcessor, BitfabPiIntegration, BitfabRivetIntegration, BitfabVercelAiHandler, type CaptureSurface, type CaptureWhen, type CapturedSpan, CategoriesClient, type Category, type CategorySummary, type CodeChangeFile, type CommitRef, type CurrentSpan, type CurrentTrace, DEFAULT_SERVICE_URL, type Dataset, type DatasetGraderRef, type DatasetTraceIds, DatasetsClient, type DbBranchOptions, DbBranchReplayError, type DbBranchTimings, type DbSnapshotConfig, type DbSnapshotProvider, type DbSnapshotRef, type DetachedTrace, type Experiment, type ExperimentCategoryTally, type ExperimentCodeChangeTotals, type ExperimentJitter, type ExperimentPage, type ExperimentRollup, type ExperimentRollupResult, type ExperimentRunBy, type ExperimentStatus, type ExperimentSummary, type ExperimentSummaryBeforeAfter, type ExperimentSummaryExampleTrace, type ExperimentSummaryFacts, type ExperimentSummaryResult, type ExperimentTally, type ExperimentTotals, ExperimentsClient, type GenerateAssertionsOptions, type GenerateScenarioOptions, type GetGraderLabelsParams, type GetGraderVerdictsParams, type GraderLabel, type GraderLabelOutcome, type GraderLabelSource, type GraderLabelUpdate, type GraderRerun, GraderRerunError, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, GraderRerunTimeoutError, type GraderVerdict, type GraderVerdictOutcome, type GraderVerdictSource, type GraderVerdictUpdate, GradersClient, HttpClient, type HumanLabelOutcome, type HumanLabelUpdate, type HumanVerdictOutcome, type HumanVerdictUpdate, type Justification, type JustificationSpan, type LabelAction, type LabelConfidence, type LabelOutcome, type LabelSource, type LabelStatus, type LabelTarget, type LabelUpdate, LabelsClient, type LangGraphIntegrationOptions, type ListDatasetsParams, type ListExperimentsParams, type ListedSpan, MixedTracingError, type MockOverride, type MockOverrideCtx, type MockOverrideInput, type MockOverrideResolver, type MockStrategy, type MockValue, NO_MOCK_OVERRIDE, type NodeMatcher, type NodeMethodDecorator, type NodeOptions, type OrganizationMember, OrganizationMembersClient, type PassFailVerdict, type PiIntegrationOptions, type ProviderDefinition, type RemoveDatasetGradersResult, type RemoveDatasetTracesResult, type ReplayBranch, ReplayError, type ReplayExperiment, type ReplayInterrupt, type ReplayInterruptSignal, type ReplayItem, type ReplayItemFinishProgress, type ReplayItemStartProgress, type ReplayNodeIdentity, type ReplayOptions, type ReplayOptionsFactory, type ReplayProgress, type ReplayProgressItem, type ReplayRegistration, type ReplayRegistry, type ReplayRegistryContext, type ReplayRegistryOptions, type ReplayResult, type RerunGradersOptions, type RerunGradersResult, type ReseedOptions, type ReseedRegistryResult, type ReseedResult, type RivetContextLike, type RivetEffectType, type RivetIntegrationOptions, SUPPORTED_PROVIDERS, type SaveAssertion, type SaveAssertionCategoryParams, type SaveAssertionsAllParams, type SaveAssertionsParams, type SaveCategoryParams, type SaveDatasetParams, type SaveDatasetResult, type SaveScenarioActualOutcome, type SaveScenarioData, type SaveScenarioHistoryEntry, type SaveScenarioParams, type SavedTraceAssertion, type Scenario, type ScenarioAction, type ScenarioActualOutcome, type ScenarioCreationStatus, type ScenarioData, type ScenarioDataAppend, type ScenarioDataOrigin, type ScenarioDataSources, type ScenarioGeneration, type ScenarioHistoryEntry, type ScenarioRecord, type ScenarioRecordInput, type ScenarioSource, type ScenarioTrigger, type SeedCase, type SeedCaseOptions, type SeedResult, type SeedRunOptions, type SelectiveReplayDecision, type SelectiveReplayOptions, type SelectiveReplayReport, type SpanListField, type SpanListParams, type SpanListResult, type SpanLookup, type SpanMethodDecorator, type SpanMethodDecoratorContext, type SpanNodeMeta, type SpanOccurrence, type SpanOptions, type SpanType, SpansClient, type TokenUsage, type TraceAssertion, type TraceAssertionSource, type TraceAssertionsResult, type TraceAssertionsUpdate, type TraceIngestionType, type TraceLabels, type TraceResponse, type TraceSearchFilters, type TraceSearchParams, type TraceSearchResult, type TraceTarget, type TraceTargetOccurrence, type TraceVerdicts, TracesClient, type TracingProcessor, type UpdateDatasetParams, type VercelCallParams, type VercelGenerateResult, type VercelStreamResult, type Verdict, type VerdictAction, type VerdictConfidence, type VerdictEvidence, type VerdictEvidenceItem, type VerdictOutcome, type VerdictSource, type VerdictStatus, type VerdictTarget, type VerdictUpdate, VerdictsClient, type WrapAnthropicOptions, type WrapBAMLOptions, type WrapJevOptions, type WrapOpenAIResponsesOptions, type WrapOpenRouterOptions, type WrappedBamlFn, __version__, defineReplayRegistry, finalizers, flushTraces, getCurrentReplayBranch, getCurrentSpan, getCurrentTrace, reportReplayProgress, reseedFromRegistry, seedFromRegistry, serializeReplayResult };
1
+ import { $ as SpanListResult, $n as ScenarioGeneration, $r as BitfabLanguageModelMiddleware, $t as HumanVerdictUpdate, A as SpanMethodDecoratorContext, Ai as BitfabError, An as AssertionKind, Ar as ExperimentTotals, At as BitfabOpenAIAgentHandler, B as WrapOpenRouterOptions, Bi as AllowedEnvVars, Bn as SaveScenarioActualOutcome, Br as GraderRerunError, Bt as GraderLabelSource, C as NodeMethodDecorator, Ci as MockOverrideCtx, Cn as AssertionCode, Cr as ExperimentStatus, Ct as serializeReplayResult, D as SeedCaseOptions, Di as NO_MOCK_OVERRIDE, Dn as AssertionGenerationError, Dr as ExperimentSummaryFacts, Dt as PiIntegrationOptions, E as ReseedResult, Ei as MockValue, En as AssertionGeneration, Er as ExperimentSummaryExampleTrace, Et as BitfabPiIntegration, F as WrapJevOptions, Fi as SUPPORTED_PROVIDERS, Fn as GenerateAssertionsOptions, Fr as Dataset, Ft as BitfabLangGraphCallbackHandler, G as CaptureSurface, Gi as Approver, Gn as Scenario, Gr as ListDatasetsParams, Gt as GraderVerdictUpdate, H as getCurrentReplayBranch, Hi as ProviderDefinition, Hn as SaveScenarioHistoryEntry, Hr as GraderRerunResult, Ht as GraderVerdict, I as WrapOpenAIChatOptions, Ii as ReplayNodeIdentity, In as GenerateScenarioOptions, Ir as DatasetGraderRef, It as GetGraderLabelsParams, J as TraceResponse, Ji as JustificationSpan, Jn as ScenarioCreationStatus, Jr as RerunGradersOptions, Jt as ArchiveVerdictTarget, K as ActiveSpanContext, Ki as Assignee, Kn as ScenarioAction, Kr as RemoveDatasetGradersResult, Kt as GradersClient, L as WrapOpenAIEmbeddingsOptions, Li as SelectiveReplayDecision, Ln as SaveAssertion, Lr as DatasetTraceIds, Lt as GetGraderVerdictsParams, M as WrapAnthropicOptions, Mi as DbSnapshotConfig, Mn as AssertionRewrite, Mr as ListExperimentsParams, Mt as BitfabLangGraphAgent, N as WrapBAMLOptions, Ni as DbSnapshotProvider, Nn as AssertionRewriteStatus, Nr as AddDatasetGradersResult, Nt as BitfabLangGraphIntegration, O as SeedRunOptions, Oi as NodeMatcher, On as AssertionGenerationStatus, Or as ExperimentSummaryResult, Ot as OrganizationMember, P as WrapGeminiOptions, Pi as DbSnapshotRef, Pn as AssertionVerdictEvidence, Pr as AddDatasetTracesResult, Pt as LangGraphIntegrationOptions, Q as SpanListParams, Qn as ScenarioDataSources, Qr as UpdateDatasetParams, Qt as HumanVerdictOutcome, R as WrapOpenAIResponsesOptions, Ri as SelectiveReplayOptions, Rn as SaveAssertionsAllParams, Rr as DatasetsClient, Rt as GraderLabel, S as DetachedTrace, Si as MockOverride, Sn as ArchiveAssertionsParams, Sr as ExperimentRunBy, St as reportReplayProgress, T as ReseedOptions, Ti as MockOverrideResolver, Tn as AssertionEvidenceParameter, Tr as ExperimentSummaryBeforeAfter, Tt as ReplayInterruptSignal, U as getCurrentSpan, Ui as ApprovalFields, Un as SaveScenarioParams, Ur as GraderRerunStatus, Ut as GraderVerdictOutcome, V as WrappedBamlFn, Vi as BamlExecutionResult, Vn as SaveScenarioData, Vr as GraderRerunProgress, Vt as GraderLabelUpdate, W as getCurrentTrace, Wi as ApprovalState, Wn as SavedTraceAssertion, Wr as GraderRerunTimeoutError, Wt as GraderVerdictSource, X as ListedSpan, Xn as ScenarioDataAppend, Xr as SaveDatasetParams, Xt as HumanLabelOutcome, Y as TracingProcessor, Yn as ScenarioData, Yr as RerunGradersResult, Yt as AssertionVerdict, Z as SpanListField, Zn as ScenarioDataOrigin, Zr as SaveDatasetResult, Zt as HumanLabelUpdate, _ as BitfabConfig, _i as SpanOccurrence, _n as VerdictSource, _r as ExperimentCodeChangeTotals, _t as ReplayOptions, a as ReplayRegistryOptions, ai as AssertionCategoriesClient, an as LabelTarget, ar as TraceAssertion, at as ReplayBranch, b as CurrentSpan, bi as flushTraces, bn as VerdictUpdate, br as ExperimentRollup, bt as ReplayResult, c as SeedResult, ci as CategoriesClient, cn as PassFailVerdict, cr as TraceAssertionsUpdate, ct as BITFAB_PROGRESS_PREFIX, d as seedFromRegistry, di as SaveAssertionCategoryParams, dn as Verdict, dr as TraceSearchResult, dt as MockStrategy, ei as BitfabVercelAiHandler, en as LabelAction, er as ScenarioHistoryEntry, et as SpansClient, f as finalizers, fi as SaveCategoryParams, fn as VerdictAction, fr as TraceTarget, ft as ReplayError, g as Bitfab, gi as SpanLookup, gn as VerdictOutcome, gr as ExperimentCategoryTally, gt as ReplayItemStartProgress, h as CommitRef, hi as HttpClient, hn as VerdictEvidenceItem, hr as Experiment, ht as ReplayItemFinishProgress, i as ReplayRegistryContext, ii as BitfabClaudeAgentHandler, in as LabelStatus, ir as ScenarioTrigger, it as RivetIntegrationOptions, j as SpanOptions, ji as MixedTracingError, jn as AssertionLabelEvidence, jr as ExperimentsClient, jt as BitfabAgentMiddleware, k as SpanMethodDecorator, ki as SpanNodeMeta, kn as AssertionGenerationTimeoutError, kr as ExperimentTally, kt as OrganizationMembersClient, l as defineReplayRegistry, li as Category, ln as TraceLabels, lr as TraceSearchFilters, lt as DbBranchOptions, m as __version__, mi as CodeChangeFile, mn as VerdictEvidence, mr as TracesClient, mt as ReplayItem, n as ReplayRegistration, ni as VercelGenerateResult, nn as LabelOutcome, nr as ScenarioRecordInput, nt as RivetContextLike, o as ReseedRegistryResult, oi as AssertionCategory, on as LabelUpdate, or as TraceAssertionSource, ot as AdaptContext, p as DEFAULT_SERVICE_URL, pi as CapturedSpan, pn as VerdictConfidence, pr as TraceTargetOccurrence, pt as ReplayExperiment, q as BitfabOpenAITracingProcessor, qi as Justification, qn as ScenarioActualOutcome, qr as RemoveDatasetTracesResult, qt as ArchiveLabelTarget, r as ReplayRegistry, ri as VercelStreamResult, rn as LabelSource, rr as ScenarioSource, rt as RivetEffectType, s as SeedCase, si as AssertionCategorySummary, sn as LabelsClient, sr as TraceAssertionsResult, st as AdaptInputsFn, t as ReplayOptionsFactory, ti as VercelCallParams, tn as LabelConfidence, tr as ScenarioRecord, tt as BitfabRivetIntegration, u as reseedFromRegistry, ui as CategorySummary, un as TraceVerdicts, ur as TraceSearchParams, ut as DbBranchReplayError, v as BitfabFunction, vi as SpanType, vn as VerdictStatus, vr as ExperimentJitter, vt as ReplayProgress, w as NodeOptions, wi as MockOverrideInput, wn as AssertionCodeDraft, wr as ExperimentSummary, wt as ReplayInterrupt, x as CurrentTrace, xi as DbBranchTimings, xn as VerdictsClient, xr as ExperimentRollupResult, xt as TraceIngestionType, y as CaptureWhen, yi as TokenUsage, yn as VerdictTarget, yr as ExperimentPage, yt as ReplayProgressItem, z as WrapOpenAITranscriptionsOptions, zi as SelectiveReplayReport, zn as SaveAssertionsParams, zr as GraderRerun, zt as GraderLabelOutcome } from "./index-BYv4DSsY.js";
2
+ export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, type ApprovalFields, type ApprovalState, type Approver, type ArchiveAssertionsParams, type ArchiveLabelTarget, type ArchiveVerdictTarget, AssertionCategoriesClient, type AssertionCategory, type AssertionCategorySummary, type AssertionCode, type AssertionCodeDraft, type AssertionEvidenceParameter, type AssertionGeneration, AssertionGenerationError, type AssertionGenerationStatus, AssertionGenerationTimeoutError, type AssertionKind, type AssertionLabelEvidence, type AssertionRewrite, type AssertionRewriteStatus, type AssertionVerdict, type AssertionVerdictEvidence, type Assignee, BITFAB_PROGRESS_PREFIX, type BamlExecutionResult, Bitfab, type BitfabAgentMiddleware, BitfabClaudeAgentHandler, type BitfabConfig, BitfabError, BitfabFunction, BitfabLangGraphCallbackHandler as BitfabLangChainCallbackHandler, BitfabLangGraphCallbackHandler, type BitfabLangGraphAgent, BitfabLangGraphIntegration, type BitfabLanguageModelMiddleware, BitfabOpenAIAgentHandler, BitfabOpenAITracingProcessor, BitfabPiIntegration, BitfabRivetIntegration, BitfabVercelAiHandler, type CaptureSurface, type CaptureWhen, type CapturedSpan, CategoriesClient, type Category, type CategorySummary, type CodeChangeFile, type CommitRef, type CurrentSpan, type CurrentTrace, DEFAULT_SERVICE_URL, type Dataset, type DatasetGraderRef, type DatasetTraceIds, DatasetsClient, type DbBranchOptions, DbBranchReplayError, type DbBranchTimings, type DbSnapshotConfig, type DbSnapshotProvider, type DbSnapshotRef, type DetachedTrace, type Experiment, type ExperimentCategoryTally, type ExperimentCodeChangeTotals, type ExperimentJitter, type ExperimentPage, type ExperimentRollup, type ExperimentRollupResult, type ExperimentRunBy, type ExperimentStatus, type ExperimentSummary, type ExperimentSummaryBeforeAfter, type ExperimentSummaryExampleTrace, type ExperimentSummaryFacts, type ExperimentSummaryResult, type ExperimentTally, type ExperimentTotals, ExperimentsClient, type GenerateAssertionsOptions, type GenerateScenarioOptions, type GetGraderLabelsParams, type GetGraderVerdictsParams, type GraderLabel, type GraderLabelOutcome, type GraderLabelSource, type GraderLabelUpdate, type GraderRerun, GraderRerunError, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, GraderRerunTimeoutError, type GraderVerdict, type GraderVerdictOutcome, type GraderVerdictSource, type GraderVerdictUpdate, GradersClient, HttpClient, type HumanLabelOutcome, type HumanLabelUpdate, type HumanVerdictOutcome, type HumanVerdictUpdate, type Justification, type JustificationSpan, type LabelAction, type LabelConfidence, type LabelOutcome, type LabelSource, type LabelStatus, type LabelTarget, type LabelUpdate, LabelsClient, type LangGraphIntegrationOptions, type ListDatasetsParams, type ListExperimentsParams, type ListedSpan, MixedTracingError, type MockOverride, type MockOverrideCtx, type MockOverrideInput, type MockOverrideResolver, type MockStrategy, type MockValue, NO_MOCK_OVERRIDE, type NodeMatcher, type NodeMethodDecorator, type NodeOptions, type OrganizationMember, OrganizationMembersClient, type PassFailVerdict, type PiIntegrationOptions, type ProviderDefinition, type RemoveDatasetGradersResult, type RemoveDatasetTracesResult, type ReplayBranch, ReplayError, type ReplayExperiment, type ReplayInterrupt, type ReplayInterruptSignal, type ReplayItem, type ReplayItemFinishProgress, type ReplayItemStartProgress, type ReplayNodeIdentity, type ReplayOptions, type ReplayOptionsFactory, type ReplayProgress, type ReplayProgressItem, type ReplayRegistration, type ReplayRegistry, type ReplayRegistryContext, type ReplayRegistryOptions, type ReplayResult, type RerunGradersOptions, type RerunGradersResult, type ReseedOptions, type ReseedRegistryResult, type ReseedResult, type RivetContextLike, type RivetEffectType, type RivetIntegrationOptions, SUPPORTED_PROVIDERS, type SaveAssertion, type SaveAssertionCategoryParams, type SaveAssertionsAllParams, type SaveAssertionsParams, type SaveCategoryParams, type SaveDatasetParams, type SaveDatasetResult, type SaveScenarioActualOutcome, type SaveScenarioData, type SaveScenarioHistoryEntry, type SaveScenarioParams, type SavedTraceAssertion, type Scenario, type ScenarioAction, type ScenarioActualOutcome, type ScenarioCreationStatus, type ScenarioData, type ScenarioDataAppend, type ScenarioDataOrigin, type ScenarioDataSources, type ScenarioGeneration, type ScenarioHistoryEntry, type ScenarioRecord, type ScenarioRecordInput, type ScenarioSource, type ScenarioTrigger, type SeedCase, type SeedCaseOptions, type SeedResult, type SeedRunOptions, type SelectiveReplayDecision, type SelectiveReplayOptions, type SelectiveReplayReport, type SpanListField, type SpanListParams, type SpanListResult, type SpanLookup, type SpanMethodDecorator, type SpanMethodDecoratorContext, type SpanNodeMeta, type SpanOccurrence, type SpanOptions, type SpanType, SpansClient, type TokenUsage, type TraceAssertion, type TraceAssertionSource, type TraceAssertionsResult, type TraceAssertionsUpdate, type TraceIngestionType, type TraceLabels, type TraceResponse, type TraceSearchFilters, type TraceSearchParams, type TraceSearchResult, type TraceTarget, type TraceTargetOccurrence, type TraceVerdicts, TracesClient, type TracingProcessor, type UpdateDatasetParams, type VercelCallParams, type VercelGenerateResult, type VercelStreamResult, type Verdict, type VerdictAction, type VerdictConfidence, type VerdictEvidence, type VerdictEvidenceItem, type VerdictOutcome, type VerdictSource, type VerdictStatus, type VerdictTarget, type VerdictUpdate, VerdictsClient, type WrapAnthropicOptions, type WrapBAMLOptions, type WrapGeminiOptions, type WrapJevOptions, type WrapOpenAIChatOptions, type WrapOpenAIEmbeddingsOptions, type WrapOpenAIResponsesOptions, type WrapOpenAITranscriptionsOptions, type WrapOpenRouterOptions, type WrappedBamlFn, __version__, defineReplayRegistry, finalizers, flushTraces, getCurrentReplayBranch, getCurrentSpan, getCurrentTrace, reportReplayProgress, reseedFromRegistry, seedFromRegistry, serializeReplayResult };
package/dist/node.js CHANGED
@@ -1,6 +1,6 @@
1
- import { A as VerdictsClient, C as OrganizationMembersClient, D as BitfabLangGraphCallbackHandler, E as BitfabLangGraphIntegration, F as GraderRerunTimeoutError, I as BitfabClaudeAgentHandler, L as DEFAULT_SERVICE_URL, M as SUPPORTED_PROVIDERS, N as DatasetsClient, O as GradersClient, P as GraderRerunError, R as AssertionCategoriesClient, S as BitfabPiIntegration, T as NO_MOCK_OVERRIDE, _ as BITFAB_PROGRESS_PREFIX, a as Bitfab, b as reportReplayProgress, c as getCurrentSpan, d as BitfabOpenAITracingProcessor, f as AssertionGenerationError, g as BitfabRivetIntegration, h as SpansClient, i as finalizers, j as ExperimentsClient, k as LabelsClient, l as getCurrentTrace, m as TracesClient, n as reseedFromRegistry, o as BitfabFunction, p as AssertionGenerationTimeoutError, r as seedFromRegistry, s as getCurrentReplayBranch, t as defineReplayRegistry, u as BitfabVercelAiHandler, v as DbBranchReplayError, w as BitfabOpenAIAgentHandler, x as serializeReplayResult, y as ReplayError, z as CategoriesClient } from "./src-CrV0INwT.js";
2
- import { C as BitfabError, E as __version__, i as flushTraces, t as HttpClient, w as MixedTracingError } from "./http-Cotx6kLL.js";
3
- import { U as registerAsyncLocalStorageClass, z as assertAsyncStorageRegistered } from "./autoTrace-kHOBg49M.js";
1
+ import { A as VerdictsClient, C as OrganizationMembersClient, D as BitfabLangGraphCallbackHandler, E as BitfabLangGraphIntegration, F as GraderRerunTimeoutError, I as BitfabClaudeAgentHandler, L as DEFAULT_SERVICE_URL, M as SUPPORTED_PROVIDERS, N as DatasetsClient, O as GradersClient, P as GraderRerunError, R as AssertionCategoriesClient, S as BitfabPiIntegration, T as NO_MOCK_OVERRIDE, _ as BITFAB_PROGRESS_PREFIX, a as Bitfab, b as reportReplayProgress, c as getCurrentSpan, d as BitfabOpenAITracingProcessor, f as AssertionGenerationError, g as BitfabRivetIntegration, h as SpansClient, i as finalizers, j as ExperimentsClient, k as LabelsClient, l as getCurrentTrace, m as TracesClient, n as reseedFromRegistry, o as BitfabFunction, p as AssertionGenerationTimeoutError, r as seedFromRegistry, s as getCurrentReplayBranch, t as defineReplayRegistry, u as BitfabVercelAiHandler, v as DbBranchReplayError, w as BitfabOpenAIAgentHandler, x as serializeReplayResult, y as ReplayError, z as CategoriesClient } from "./src-BJjbR3Nq.js";
2
+ import { C as BitfabError, E as __version__, i as flushTraces, t as HttpClient, w as MixedTracingError } from "./http-DS1QjBvx.js";
3
+ import { Z as registerAsyncLocalStorageClass, q as assertAsyncStorageRegistered } from "./autoTrace-BgN0zCQf.js";
4
4
  import { AsyncLocalStorage } from "async_hooks";
5
5
  //#region src/asyncStorageNode.ts
6
6
  registerAsyncLocalStorageClass(AsyncLocalStorage);
@@ -279,6 +279,12 @@ spanGlobal.__bitfabOpenAiAgentsSpansV1 = spanGlobal.__bitfabOpenAiAgentsSpansV1
279
279
  //#endregion
280
280
  //#region src/clientCalls.ts
281
281
  const OPENROUTER_HOSTNAME = "openrouter.ai";
282
+ const RESPONSE_DONE_EVENTS = [
283
+ "response.completed",
284
+ "response.incomplete",
285
+ "response.failed"
286
+ ];
287
+ const TRANSCRIPT_DONE_EVENT = "transcript.text.done";
282
288
  function isRecord(value) {
283
289
  return typeof value === "object" && value !== null;
284
290
  }
@@ -292,11 +298,8 @@ function numberField(value, name) {
292
298
  function nonEmptyString(value) {
293
299
  return typeof value === "string" && value !== "" ? value : void 0;
294
300
  }
295
- function presentFields(base, values, durationMs) {
296
- const context = { ...base };
297
- for (const [key, value] of Object.entries(values)) if (value !== void 0) context[key] = value;
298
- context.durationMs = durationMs;
299
- return context;
301
+ function presentFields(values) {
302
+ return Object.fromEntries(Object.entries(values).filter(([, value]) => value !== void 0));
300
303
  }
301
304
  function sumOfPresent(values) {
302
305
  const present = values.filter((value) => value !== void 0);
@@ -315,9 +318,41 @@ function roleEntries(items) {
315
318
  }];
316
319
  });
317
320
  }
321
+ function isNil(value) {
322
+ return value === void 0 || value === null;
323
+ }
324
+ function isBlank(content) {
325
+ return isNil(content) || content === "" || Array.isArray(content) && content.length === 0;
326
+ }
327
+ function systemEntry(content) {
328
+ return isBlank(content) ? [] : [{
329
+ role: "system",
330
+ content: textOf(content)
331
+ }];
332
+ }
333
+ function userEntries(content) {
334
+ if (isBlank(content)) return [];
335
+ if (Array.isArray(content) && content.every((item) => typeof item === "string")) return content.map((item) => ({
336
+ role: "user",
337
+ content: item
338
+ }));
339
+ return [{
340
+ role: "user",
341
+ content: textOf(content)
342
+ }];
343
+ }
318
344
  function renderedPrompt(entries) {
319
345
  return entries.length > 0 ? JSON.stringify(entries) : void 0;
320
346
  }
347
+ function modelOf(body, response) {
348
+ return nonEmptyString(field(response, "model")) ?? nonEmptyString(field(body, "model"));
349
+ }
350
+ function lastMatching(items, matches) {
351
+ for (let index = items.length - 1; index >= 0; index -= 1) if (matches(items[index])) return items[index];
352
+ }
353
+ function lastWith(events, name) {
354
+ return lastMatching(events, (event) => !isNil(field(event, name)));
355
+ }
321
356
  function clientOf(receiver) {
322
357
  try {
323
358
  return field(receiver, "_client");
@@ -344,48 +379,143 @@ function isOpenRouterBaseUrl(baseUrl) {
344
379
  return false;
345
380
  }
346
381
  }
347
- function isOpenRouterCompletions(receiver) {
382
+ function isOpenRouterResource(receiver) {
348
383
  try {
349
384
  return isOpenRouterBaseUrl(field(clientOf(receiver), "baseURL"));
350
385
  } catch {
351
386
  return false;
352
387
  }
353
388
  }
354
- function isAnthropicMessages(receiver) {
355
- return typeof clientClassStatic(receiver, "HUMAN_PROMPT") === "string";
389
+ function isAnthropicResource(receiver) {
390
+ return typeof clientClassStatic(receiver, "AnthropicError") === "function" || typeof clientClassStatic(receiver, "HUMAN_PROMPT") === "string";
356
391
  }
357
- function isOpenAIResponses(receiver) {
392
+ function isOpenAIResource(receiver) {
358
393
  return typeof clientClassStatic(receiver, "OpenAI") === "function";
359
394
  }
360
- function openRouterPrompt(body) {
395
+ function isGeminiModels(receiver) {
396
+ try {
397
+ return isRecord(receiver) && isRecord(receiver.apiClient) && typeof receiver.generateContent === "function" && typeof receiver.generateContentStream === "function";
398
+ } catch {
399
+ return false;
400
+ }
401
+ }
402
+ function isChatCompletion(response) {
403
+ return isRecord(response) && Array.isArray(response.choices);
404
+ }
405
+ function chatCompletionPrompt(body) {
361
406
  const messages = field(body, "messages");
362
407
  return Array.isArray(messages) ? renderedPrompt(roleEntries(messages)) : void 0;
363
408
  }
364
- function openRouterContext(body, response, durationMs) {
409
+ function chatCompletionUsage(body, response) {
365
410
  const usage = field(response, "usage");
366
- return presentFields({ provider: "openrouter" }, {
367
- model: nonEmptyString(field(response, "model")) ?? nonEmptyString(field(body, "model")),
411
+ return {
412
+ model: modelOf(body, response),
368
413
  upstreamProvider: nonEmptyString(field(response, "provider")),
369
414
  inputTokens: numberField(usage, "prompt_tokens"),
370
415
  outputTokens: numberField(usage, "completion_tokens"),
371
416
  cachedInputTokens: numberField(field(usage, "prompt_tokens_details"), "cached_tokens"),
372
417
  reasoningTokens: numberField(field(usage, "completion_tokens_details"), "reasoning_tokens"),
373
418
  costUsd: numberField(usage, "cost")
374
- }, durationMs);
419
+ };
420
+ }
421
+ function chatToolCalls(chunks) {
422
+ const slots = /* @__PURE__ */ new Map();
423
+ for (const chunk of chunks) {
424
+ const toolCalls = field(field(firstChoice(chunk), "delta"), "tool_calls");
425
+ if (!Array.isArray(toolCalls)) continue;
426
+ for (const toolCall of toolCalls) {
427
+ const index = numberField(toolCall, "index") ?? 0;
428
+ const slot = slots.get(index) ?? { arguments: "" };
429
+ const fn = field(toolCall, "function");
430
+ const name = nonEmptyString(field(fn, "name"));
431
+ const args = nonEmptyString(field(fn, "arguments"));
432
+ slots.set(index, {
433
+ name: name ?? slot.name,
434
+ arguments: slot.arguments + (args ?? "")
435
+ });
436
+ }
437
+ }
438
+ return [...slots.entries()].sort(([left], [right]) => left - right).map(([, slot]) => ({
439
+ type: "function",
440
+ function: {
441
+ name: slot.name,
442
+ arguments: slot.arguments
443
+ }
444
+ }));
445
+ }
446
+ function firstChoice(chunk) {
447
+ const choices = field(chunk, "choices");
448
+ return Array.isArray(choices) ? choices[0] : void 0;
449
+ }
450
+ function chatStreamSummary(chunks) {
451
+ if (chunks.length === 0) return;
452
+ const last = lastWith(chunks, "usage") ?? chunks[chunks.length - 1];
453
+ const text = chunks.map((chunk) => field(field(firstChoice(chunk), "delta"), "content")).filter((content) => typeof content === "string").join("");
454
+ const finishReason = lastMatching(chunks.map((chunk) => field(firstChoice(chunk), "finish_reason")), (reason) => typeof reason === "string");
455
+ const toolCalls = chatToolCalls(chunks);
456
+ return {
457
+ object: "chat.completion",
458
+ model: field(last, "model"),
459
+ provider: field(last, "provider"),
460
+ choices: [{
461
+ index: 0,
462
+ message: {
463
+ role: "assistant",
464
+ content: text,
465
+ ...toolCalls.length > 0 && { tool_calls: toolCalls }
466
+ },
467
+ finish_reason: finishReason ?? null
468
+ }],
469
+ usage: field(last, "usage")
470
+ };
471
+ }
472
+ function isEmbeddingList(response) {
473
+ return field(response, "object") === "list" && Array.isArray(field(response, "data"));
474
+ }
475
+ function embeddingPrompt(body) {
476
+ return renderedPrompt(userEntries(field(body, "input")));
477
+ }
478
+ function embeddingUsage(body, response) {
479
+ const usage = field(response, "usage");
480
+ const inputTokens = numberField(usage, "prompt_tokens");
481
+ return {
482
+ model: modelOf(body, response),
483
+ upstreamProvider: nonEmptyString(field(response, "provider")),
484
+ inputTokens,
485
+ outputTokens: inputTokens === void 0 ? void 0 : 0,
486
+ costUsd: numberField(usage, "cost")
487
+ };
488
+ }
489
+ function isTranscription(response) {
490
+ return typeof field(response, "text") === "string";
491
+ }
492
+ function transcriptionPrompt(body) {
493
+ return renderedPrompt(userEntries(field(body, "prompt")));
494
+ }
495
+ function transcriptionUsage(body, response) {
496
+ const usage = field(response, "usage");
497
+ return {
498
+ model: modelOf(body, response),
499
+ inputTokens: numberField(usage, "input_tokens"),
500
+ outputTokens: numberField(usage, "output_tokens"),
501
+ audioSeconds: numberField(usage, "seconds")
502
+ };
503
+ }
504
+ function transcriptionStreamSummary(events) {
505
+ return lastMatching(events, (event) => field(event, "type") === TRANSCRIPT_DONE_EVENT);
506
+ }
507
+ function isAnthropicMessage(response) {
508
+ return field(response, "type") === "message" && Array.isArray(field(response, "content"));
375
509
  }
376
510
  function anthropicPrompt(body) {
377
- const system = field(body, "system");
378
511
  const messages = field(body, "messages");
379
- return renderedPrompt([...system === void 0 || system === null ? [] : [{
380
- role: "system",
381
- content: textOf(system)
382
- }], ...Array.isArray(messages) ? roleEntries(messages) : []]);
512
+ return renderedPrompt([...systemEntry(field(body, "system")), ...Array.isArray(messages) ? roleEntries(messages) : []]);
383
513
  }
384
- function anthropicContext(body, response, durationMs) {
514
+ function anthropicUsage(body, response) {
385
515
  const usage = field(response, "usage");
386
516
  const cacheRead = numberField(usage, "cache_read_input_tokens");
387
- return presentFields({ provider: "anthropic" }, {
388
- model: nonEmptyString(field(response, "model")) ?? nonEmptyString(field(body, "model")),
517
+ return {
518
+ model: modelOf(body, response),
389
519
  inputTokens: sumOfPresent([
390
520
  numberField(usage, "input_tokens"),
391
521
  cacheRead,
@@ -393,16 +523,48 @@ function anthropicContext(body, response, durationMs) {
393
523
  ]),
394
524
  outputTokens: numberField(usage, "output_tokens"),
395
525
  cachedInputTokens: cacheRead
396
- }, durationMs);
526
+ };
527
+ }
528
+ function anthropicStreamSummary(events) {
529
+ const message = field(events.find((event) => field(event, "type") === "message_start"), "message");
530
+ if (!isRecord(message)) return;
531
+ let usage = { ...isRecord(message.usage) ? message.usage : {} };
532
+ let stopReason = null;
533
+ const text = [];
534
+ for (const event of events) {
535
+ const type = field(event, "type");
536
+ if (type === "message_delta") {
537
+ const deltaUsage = field(event, "usage");
538
+ usage = {
539
+ ...usage,
540
+ ...isRecord(deltaUsage) ? presentFields(deltaUsage) : {}
541
+ };
542
+ stopReason = field(field(event, "delta"), "stop_reason") ?? stopReason;
543
+ }
544
+ if (type === "content_block_delta") {
545
+ const deltaText = field(field(event, "delta"), "text");
546
+ if (typeof deltaText === "string") text.push(deltaText);
547
+ }
548
+ }
549
+ return {
550
+ type: "message",
551
+ role: "assistant",
552
+ model: message.model,
553
+ content: [{
554
+ type: "text",
555
+ text: text.join("")
556
+ }],
557
+ stop_reason: stopReason,
558
+ usage
559
+ };
560
+ }
561
+ function isOpenAIResponse(response) {
562
+ return field(response, "object") === "response";
397
563
  }
398
564
  function openAIResponsesPrompt(body) {
399
- const instructions = field(body, "instructions");
400
565
  const input = field(body, "input");
401
566
  return renderedPrompt([
402
- ...typeof instructions === "string" ? [{
403
- role: "system",
404
- content: instructions
405
- }] : [],
567
+ ...systemEntry(field(body, "instructions")),
406
568
  ...typeof input === "string" ? [{
407
569
  role: "user",
408
570
  content: input
@@ -410,43 +572,176 @@ function openAIResponsesPrompt(body) {
410
572
  ...Array.isArray(input) ? roleEntries(input) : []
411
573
  ]);
412
574
  }
413
- function openAIResponsesContext(body, response, durationMs) {
575
+ function openAIResponsesUsage(body, response) {
414
576
  const usage = field(response, "usage");
415
- return presentFields({ provider: "openai" }, {
416
- model: nonEmptyString(field(response, "model")) ?? nonEmptyString(field(body, "model")),
577
+ return {
578
+ model: modelOf(body, response),
417
579
  inputTokens: numberField(usage, "input_tokens"),
418
580
  outputTokens: numberField(usage, "output_tokens"),
419
581
  cachedInputTokens: numberField(field(usage, "input_tokens_details"), "cached_tokens"),
420
582
  reasoningTokens: numberField(field(usage, "output_tokens_details"), "reasoning_tokens"),
421
583
  costUsd: numberField(usage, "cost")
422
- }, durationMs);
584
+ };
585
+ }
586
+ function openAIResponsesStreamSummary(events) {
587
+ return field(lastMatching(events, (event) => RESPONSE_DONE_EVENTS.some((type) => field(event, "type") === type)), "response");
423
588
  }
424
- new Map([
589
+ function isGeminiResponse(response) {
590
+ return field(response, "usageMetadata") !== void 0 || Array.isArray(field(response, "candidates"));
591
+ }
592
+ function geminiContentText(content) {
593
+ if (isNil(content)) return;
594
+ if (typeof content === "string") return content;
595
+ const parts = field(content, "parts");
596
+ if (Array.isArray(parts)) {
597
+ const texts = parts.map((part) => field(part, "text"));
598
+ if (texts.every((text) => typeof text === "string")) return texts.join("");
599
+ }
600
+ const text = field(content, "text");
601
+ return typeof text === "string" ? text : textOf(content);
602
+ }
603
+ function geminiEntries(contents) {
604
+ if (isNil(contents)) return [];
605
+ return (Array.isArray(contents) ? contents : [contents]).map((item) => ({
606
+ role: nonEmptyString(field(item, "role")) ?? "user",
607
+ content: geminiContentText(item) ?? ""
608
+ }));
609
+ }
610
+ function geminiPrompt(body) {
611
+ return renderedPrompt([...systemEntry(geminiContentText(field(field(body, "config"), "systemInstruction"))), ...geminiEntries(field(body, "contents"))]);
612
+ }
613
+ function geminiModel(body, response) {
614
+ const model = nonEmptyString(field(response, "modelVersion")) ?? nonEmptyString(field(body, "model"));
615
+ return model === void 0 ? void 0 : model.slice(model.lastIndexOf("/") + 1);
616
+ }
617
+ function geminiUsage(body, response) {
618
+ const usage = field(response, "usageMetadata");
619
+ const thoughts = numberField(usage, "thoughtsTokenCount");
620
+ return {
621
+ model: geminiModel(body, response),
622
+ inputTokens: sumOfPresent([numberField(usage, "promptTokenCount"), numberField(usage, "toolUsePromptTokenCount")]),
623
+ outputTokens: sumOfPresent([numberField(usage, "candidatesTokenCount"), thoughts]),
624
+ cachedInputTokens: numberField(usage, "cachedContentTokenCount"),
625
+ reasoningTokens: thoughts
626
+ };
627
+ }
628
+ function geminiChunkText(chunk) {
629
+ const candidates = field(chunk, "candidates");
630
+ return Array.isArray(candidates) ? geminiContentText(field(candidates[0], "content")) ?? "" : "";
631
+ }
632
+ function geminiStreamSummary(chunks) {
633
+ if (chunks.length === 0) return;
634
+ const last = lastWith(chunks, "usageMetadata") ?? chunks[chunks.length - 1];
635
+ return {
636
+ modelVersion: field(last, "modelVersion"),
637
+ text: chunks.map(geminiChunkText).join(""),
638
+ usageMetadata: field(last, "usageMetadata")
639
+ };
640
+ }
641
+ const OPENROUTER = {
642
+ key: "openrouter",
643
+ provider: "openrouter",
644
+ library: "openai",
645
+ endpoint: "chat.completions",
646
+ methods: ["create", "parse"],
647
+ streamMethods: ["stream"],
648
+ streamEvents: ["chunk"],
649
+ spanMethods: { stream: "create" },
650
+ matchesReceiver: isOpenRouterResource,
651
+ isResponse: isChatCompletion,
652
+ prompt: chatCompletionPrompt,
653
+ usage: chatCompletionUsage,
654
+ streamSummary: chatStreamSummary
655
+ };
656
+ const OPENAI_CHAT = {
657
+ ...OPENROUTER,
658
+ key: "openai-chat",
659
+ provider: "openai",
660
+ matchesReceiver: isOpenAIResource
661
+ };
662
+ const OPENROUTER_EMBEDDINGS = {
663
+ key: "openrouter-embeddings",
664
+ provider: "openrouter",
665
+ library: "openai",
666
+ endpoint: "embeddings",
667
+ methods: ["create"],
668
+ streamMethods: [],
669
+ streamEvents: [],
670
+ matchesReceiver: isOpenRouterResource,
671
+ isResponse: isEmbeddingList,
672
+ prompt: embeddingPrompt,
673
+ usage: embeddingUsage
674
+ };
675
+ const CLIENT_CALL_PROVIDERS = [
676
+ OPENROUTER,
677
+ OPENAI_CHAT,
678
+ OPENROUTER_EMBEDDINGS,
425
679
  {
426
- key: "openrouter",
680
+ ...OPENROUTER_EMBEDDINGS,
681
+ key: "openai-embeddings",
682
+ provider: "openai",
683
+ matchesReceiver: isOpenAIResource
684
+ },
685
+ {
686
+ key: "openai-transcriptions",
687
+ provider: "openai",
427
688
  library: "openai",
428
- matchesReceiver: isOpenRouterCompletions,
429
- isResponse: (response) => isRecord(response) && Array.isArray(response.choices),
430
- prompt: openRouterPrompt,
431
- context: openRouterContext
689
+ endpoint: "audio.transcriptions",
690
+ methods: ["create"],
691
+ streamMethods: [],
692
+ streamEvents: [],
693
+ matchesReceiver: isOpenAIResource,
694
+ isResponse: isTranscription,
695
+ prompt: transcriptionPrompt,
696
+ usage: transcriptionUsage,
697
+ streamSummary: transcriptionStreamSummary
432
698
  },
433
699
  {
434
700
  key: "anthropic",
701
+ provider: "anthropic",
435
702
  library: "@anthropic-ai/sdk",
436
- matchesReceiver: isAnthropicMessages,
437
- isResponse: (response) => field(response, "type") === "message" && Array.isArray(field(response, "content")),
703
+ endpoint: "messages",
704
+ methods: ["create", "parse"],
705
+ streamMethods: ["stream"],
706
+ streamEvents: ["streamEvent"],
707
+ matchesReceiver: isAnthropicResource,
708
+ isResponse: isAnthropicMessage,
438
709
  prompt: anthropicPrompt,
439
- context: anthropicContext
710
+ usage: anthropicUsage,
711
+ streamSummary: anthropicStreamSummary
440
712
  },
441
713
  {
442
714
  key: "openai-responses",
715
+ provider: "openai",
443
716
  library: "openai",
444
- matchesReceiver: isOpenAIResponses,
445
- isResponse: (response) => field(response, "object") === "response",
717
+ endpoint: "responses",
718
+ methods: ["create", "parse"],
719
+ streamMethods: ["stream"],
720
+ streamEvents: RESPONSE_DONE_EVENTS,
721
+ spanMethods: { stream: "create" },
722
+ matchesReceiver: isOpenAIResource,
723
+ isResponse: isOpenAIResponse,
446
724
  prompt: openAIResponsesPrompt,
447
- context: openAIResponsesContext
725
+ usage: openAIResponsesUsage,
726
+ streamSummary: openAIResponsesStreamSummary
727
+ },
728
+ {
729
+ key: "gemini",
730
+ provider: "gemini",
731
+ library: "@google/genai",
732
+ endpoint: "models",
733
+ methods: ["generateContent"],
734
+ streamMethods: ["generateContentStream"],
735
+ streamEvents: [],
736
+ matchesReceiver: isGeminiModels,
737
+ isResponse: isGeminiResponse,
738
+ prompt: geminiPrompt,
739
+ usage: geminiUsage,
740
+ streamSummary: geminiStreamSummary
448
741
  }
449
- ].map((provider) => [provider.key, provider]));
742
+ ];
743
+ new Map(CLIENT_CALL_PROVIDERS.map((provider) => [provider.key, provider]));
744
+ typeof FinalizationRegistry === "function" && new FinalizationRegistry((recording) => recording.finish(void 0));
450
745
  //#endregion
451
746
  //#region src/autoTrace.ts
452
747
  const autoTraceGlobal = globalThis;
@@ -1339,4 +1634,4 @@ function runIfEntrypoint(moduleUrl, main) {
1339
1634
  //#endregion
1340
1635
  export { runRegistryMain as a, runSeedCli as c, runIfEntrypoint as i, parseRegistryCommandArgs as n, checkReplayCliArgs as o, resolveRegistry as r, runReplayCli as s, importRegistry as t };
1341
1636
 
1342
- //# sourceMappingURL=registryCommand-DdE8cNOX.js.map
1637
+ //# sourceMappingURL=registryCommand-D1VgfJjC.js.map