@bitfab/sdk 0.48.0 → 0.51.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/dist/{chunk-I6MWT34L.js → chunk-4CLJF2DZ.js} +9 -5
- package/dist/{chunk-I6MWT34L.js.map → chunk-4CLJF2DZ.js.map} +1 -1
- package/dist/{chunk-LUDC6WMA.js → chunk-DNYZJLNY.js} +23 -5
- package/dist/chunk-DNYZJLNY.js.map +1 -0
- package/dist/{chunk-OKSCUFJ6.js → chunk-RGC7IEOI.js} +9 -5
- package/dist/{chunk-OKSCUFJ6.js.map → chunk-RGC7IEOI.js.map} +1 -1
- package/dist/{chunk-ZIPITG22.js → chunk-VXD27AJ3.js} +62 -6
- package/dist/chunk-VXD27AJ3.js.map +1 -0
- package/dist/{http-CGTUTKK3.js → http-AKFJONE7.js} +2 -2
- package/dist/{http-MO5ZRPA6.js → http-HLRWCSFF.js} +2 -2
- package/dist/index.cjs +89 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +77 -9
- package/dist/index.d.ts +77 -9
- package/dist/index.js +5 -3
- package/dist/node.cjs +89 -7
- package/dist/node.cjs.map +1 -1
- package/dist/node.d.cts +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.js +5 -3
- package/dist/node.js.map +1 -1
- package/dist/{replay-QFH4XW4T.js → replay-ISXRCXUP.js} +3 -3
- package/dist/replayCli.js +40 -14
- package/dist/replayCli.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-LUDC6WMA.js.map +0 -1
- package/dist/chunk-ZIPITG22.js.map +0 -1
- /package/dist/{http-CGTUTKK3.js.map → http-AKFJONE7.js.map} +0 -0
- /package/dist/{http-MO5ZRPA6.js.map → http-HLRWCSFF.js.map} +0 -0
- /package/dist/{replay-QFH4XW4T.js.map → replay-ISXRCXUP.js.map} +0 -0
package/dist/node.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ActiveSpanContext, AdaptContext, AdaptInputsFn, AddDatasetGradersResult, AddDatasetTracesResult, AllowedEnvVars, ArchiveAssertionsParams, BITFAB_PROGRESS_PREFIX, BamlExecutionResult, Bitfab, BitfabClaudeAgentHandler, BitfabConfig, BitfabError, BitfabFunction, BitfabLangChainCallbackHandler, BitfabLangChainCallbackHandler as BitfabLangGraphCallbackHandler, BitfabLangGraphIntegration, BitfabLanguageModelMiddleware, BitfabOpenAIAgentHandler, BitfabOpenAITracingProcessor, BitfabVercelAiHandler, CaptureSurface, CaptureWhen, CapturedSpan, CodeChangeFile, CurrentSpan, CurrentTrace, DEFAULT_SERVICE_URL, Dataset, DatasetGraderRef, DatasetTraceIds, DatasetsClient, DbBranchOptions, DbBranchReplayError, DbBranchTimings, DbSnapshotConfig, DbSnapshotProvider, DbSnapshotRef, DetachedTrace, GraderRerun, GraderRerunProgress, GraderRerunResult, GraderRerunStatus, HttpClient, LabelAction, LabelConfidence, LabelOutcome, LabelUpdate, LabelsClient, LangGraphIntegrationOptions, ListDatasetsParams, MixedTracingError, MockOverride, MockOverrideCtx, MockOverrideInput, MockOverrideResolver, MockStrategy, MockValue, NO_MOCK_OVERRIDE, NodeMatcher, NodeMethodDecorator, NodeOptions, ProviderDefinition, RemoveDatasetGradersResult, RemoveDatasetTracesResult, ReplayBranch, ReplayError, ReplayItem, ReplayItemFinishProgress, ReplayItemStartProgress, ReplayOptions, ReplayOptionsFactory, ReplayProgress, ReplayProgressItem, ReplayRegistration, ReplayRegistry, ReplayRegistryContext, ReplayRegistryOptions, ReplayResult, RerunGradersOptions, RerunGradersResult, SUPPORTED_PROVIDERS, SaveAssertion, SaveAssertionsParams, SaveDatasetParams, SaveDatasetResult, SeedCase, SeedCaseOptions, SeedResult, SeedRunOptions, SpanLookup, SpanMethodDecorator, SpanMethodDecoratorContext, SpanNodeMeta, SpanOccurrence, SpanOptions, SpanType, TokenUsage, TraceAssertion, TraceAssertionSource, TraceAssertionsResult, TraceIngestionType, TraceOutline, TraceOutlineSpan, TraceOutlineSpanError, TraceResponse, TraceTarget, TraceTargetOccurrence, TracesClient, TracingProcessor, VercelCallParams, VercelGenerateResult, VercelStreamResult, WrapBAMLOptions, WrappedBamlFn, __version__, defineReplayRegistry, finalizers, flushTraces, getCurrentReplayBranch, getCurrentSpan, getCurrentTrace, reportReplayProgress, seedFromRegistry, serializeReplayResult } from './index.cjs';
|
|
1
|
+
export { ActiveSpanContext, AdaptContext, AdaptInputsFn, AddDatasetGradersResult, AddDatasetTracesResult, AllowedEnvVars, ArchiveAssertionsParams, AssertionVerdict, BITFAB_PROGRESS_PREFIX, BamlExecutionResult, Bitfab, BitfabClaudeAgentHandler, BitfabConfig, BitfabError, BitfabFunction, BitfabLangChainCallbackHandler, BitfabLangChainCallbackHandler as BitfabLangGraphCallbackHandler, BitfabLangGraphIntegration, BitfabLanguageModelMiddleware, BitfabOpenAIAgentHandler, BitfabOpenAITracingProcessor, BitfabVercelAiHandler, CaptureSurface, CaptureWhen, CapturedSpan, CodeChangeFile, CurrentSpan, CurrentTrace, DEFAULT_SERVICE_URL, Dataset, DatasetGraderRef, DatasetTraceIds, DatasetsClient, DbBranchOptions, DbBranchReplayError, DbBranchTimings, DbSnapshotConfig, DbSnapshotProvider, DbSnapshotRef, DetachedTrace, GetGraderLabelsParams, GraderLabel, GraderLabelSource, GraderRerun, GraderRerunProgress, GraderRerunResult, GraderRerunStatus, GradersClient, HttpClient, HumanLabelOutcome, HumanLabelUpdate, LabelAction, LabelConfidence, LabelOutcome, LabelSource, LabelStatus, LabelUpdate, LabelsClient, LangGraphIntegrationOptions, ListDatasetsParams, MixedTracingError, MockOverride, MockOverrideCtx, MockOverrideInput, MockOverrideResolver, MockStrategy, MockValue, NO_MOCK_OVERRIDE, NodeMatcher, NodeMethodDecorator, NodeOptions, ProviderDefinition, RemoveDatasetGradersResult, RemoveDatasetTracesResult, ReplayBranch, ReplayError, ReplayItem, ReplayItemFinishProgress, ReplayItemStartProgress, ReplayOptions, ReplayOptionsFactory, ReplayProgress, ReplayProgressItem, ReplayRegistration, ReplayRegistry, ReplayRegistryContext, ReplayRegistryOptions, ReplayResult, RerunGradersOptions, RerunGradersResult, SUPPORTED_PROVIDERS, SaveAssertion, SaveAssertionsParams, SaveDatasetParams, SaveDatasetResult, SeedCase, SeedCaseOptions, SeedResult, SeedRunOptions, SpanLookup, SpanMethodDecorator, SpanMethodDecoratorContext, SpanNodeMeta, SpanOccurrence, SpanOptions, SpanType, TokenUsage, TraceAssertion, TraceAssertionSource, TraceAssertionsResult, TraceIngestionType, TraceLabels, TraceOutline, TraceOutlineSpan, TraceOutlineSpanError, TraceResponse, TraceTarget, TraceTargetOccurrence, TracesClient, TracingProcessor, VercelCallParams, VercelGenerateResult, VercelStreamResult, WrapBAMLOptions, WrappedBamlFn, __version__, defineReplayRegistry, finalizers, flushTraces, getCurrentReplayBranch, getCurrentSpan, getCurrentTrace, reportReplayProgress, seedFromRegistry, serializeReplayResult } from './index.cjs';
|
package/dist/node.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ActiveSpanContext, AdaptContext, AdaptInputsFn, AddDatasetGradersResult, AddDatasetTracesResult, AllowedEnvVars, ArchiveAssertionsParams, BITFAB_PROGRESS_PREFIX, BamlExecutionResult, Bitfab, BitfabClaudeAgentHandler, BitfabConfig, BitfabError, BitfabFunction, BitfabLangChainCallbackHandler, BitfabLangChainCallbackHandler as BitfabLangGraphCallbackHandler, BitfabLangGraphIntegration, BitfabLanguageModelMiddleware, BitfabOpenAIAgentHandler, BitfabOpenAITracingProcessor, BitfabVercelAiHandler, CaptureSurface, CaptureWhen, CapturedSpan, CodeChangeFile, CurrentSpan, CurrentTrace, DEFAULT_SERVICE_URL, Dataset, DatasetGraderRef, DatasetTraceIds, DatasetsClient, DbBranchOptions, DbBranchReplayError, DbBranchTimings, DbSnapshotConfig, DbSnapshotProvider, DbSnapshotRef, DetachedTrace, GraderRerun, GraderRerunProgress, GraderRerunResult, GraderRerunStatus, HttpClient, LabelAction, LabelConfidence, LabelOutcome, LabelUpdate, LabelsClient, LangGraphIntegrationOptions, ListDatasetsParams, MixedTracingError, MockOverride, MockOverrideCtx, MockOverrideInput, MockOverrideResolver, MockStrategy, MockValue, NO_MOCK_OVERRIDE, NodeMatcher, NodeMethodDecorator, NodeOptions, ProviderDefinition, RemoveDatasetGradersResult, RemoveDatasetTracesResult, ReplayBranch, ReplayError, ReplayItem, ReplayItemFinishProgress, ReplayItemStartProgress, ReplayOptions, ReplayOptionsFactory, ReplayProgress, ReplayProgressItem, ReplayRegistration, ReplayRegistry, ReplayRegistryContext, ReplayRegistryOptions, ReplayResult, RerunGradersOptions, RerunGradersResult, SUPPORTED_PROVIDERS, SaveAssertion, SaveAssertionsParams, SaveDatasetParams, SaveDatasetResult, SeedCase, SeedCaseOptions, SeedResult, SeedRunOptions, SpanLookup, SpanMethodDecorator, SpanMethodDecoratorContext, SpanNodeMeta, SpanOccurrence, SpanOptions, SpanType, TokenUsage, TraceAssertion, TraceAssertionSource, TraceAssertionsResult, TraceIngestionType, TraceOutline, TraceOutlineSpan, TraceOutlineSpanError, TraceResponse, TraceTarget, TraceTargetOccurrence, TracesClient, TracingProcessor, VercelCallParams, VercelGenerateResult, VercelStreamResult, WrapBAMLOptions, WrappedBamlFn, __version__, defineReplayRegistry, finalizers, flushTraces, getCurrentReplayBranch, getCurrentSpan, getCurrentTrace, reportReplayProgress, seedFromRegistry, serializeReplayResult } from './index.js';
|
|
1
|
+
export { ActiveSpanContext, AdaptContext, AdaptInputsFn, AddDatasetGradersResult, AddDatasetTracesResult, AllowedEnvVars, ArchiveAssertionsParams, AssertionVerdict, BITFAB_PROGRESS_PREFIX, BamlExecutionResult, Bitfab, BitfabClaudeAgentHandler, BitfabConfig, BitfabError, BitfabFunction, BitfabLangChainCallbackHandler, BitfabLangChainCallbackHandler as BitfabLangGraphCallbackHandler, BitfabLangGraphIntegration, BitfabLanguageModelMiddleware, BitfabOpenAIAgentHandler, BitfabOpenAITracingProcessor, BitfabVercelAiHandler, CaptureSurface, CaptureWhen, CapturedSpan, CodeChangeFile, CurrentSpan, CurrentTrace, DEFAULT_SERVICE_URL, Dataset, DatasetGraderRef, DatasetTraceIds, DatasetsClient, DbBranchOptions, DbBranchReplayError, DbBranchTimings, DbSnapshotConfig, DbSnapshotProvider, DbSnapshotRef, DetachedTrace, GetGraderLabelsParams, GraderLabel, GraderLabelSource, GraderRerun, GraderRerunProgress, GraderRerunResult, GraderRerunStatus, GradersClient, HttpClient, HumanLabelOutcome, HumanLabelUpdate, LabelAction, LabelConfidence, LabelOutcome, LabelSource, LabelStatus, LabelUpdate, LabelsClient, LangGraphIntegrationOptions, ListDatasetsParams, MixedTracingError, MockOverride, MockOverrideCtx, MockOverrideInput, MockOverrideResolver, MockStrategy, MockValue, NO_MOCK_OVERRIDE, NodeMatcher, NodeMethodDecorator, NodeOptions, ProviderDefinition, RemoveDatasetGradersResult, RemoveDatasetTracesResult, ReplayBranch, ReplayError, ReplayItem, ReplayItemFinishProgress, ReplayItemStartProgress, ReplayOptions, ReplayOptionsFactory, ReplayProgress, ReplayProgressItem, ReplayRegistration, ReplayRegistry, ReplayRegistryContext, ReplayRegistryOptions, ReplayResult, RerunGradersOptions, RerunGradersResult, SUPPORTED_PROVIDERS, SaveAssertion, SaveAssertionsParams, SaveDatasetParams, SaveDatasetResult, SeedCase, SeedCaseOptions, SeedResult, SeedRunOptions, SpanLookup, SpanMethodDecorator, SpanMethodDecoratorContext, SpanNodeMeta, SpanOccurrence, SpanOptions, SpanType, TokenUsage, TraceAssertion, TraceAssertionSource, TraceAssertionsResult, TraceIngestionType, TraceLabels, TraceOutline, TraceOutlineSpan, TraceOutlineSpanError, TraceResponse, TraceTarget, TraceTargetOccurrence, TracesClient, TracingProcessor, VercelCallParams, VercelGenerateResult, VercelStreamResult, WrapBAMLOptions, WrappedBamlFn, __version__, defineReplayRegistry, finalizers, flushTraces, getCurrentReplayBranch, getCurrentSpan, getCurrentTrace, reportReplayProgress, seedFromRegistry, serializeReplayResult } from './index.js';
|
package/dist/node.js
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
BitfabOpenAITracingProcessor,
|
|
9
9
|
BitfabVercelAiHandler,
|
|
10
10
|
DatasetsClient,
|
|
11
|
+
GradersClient,
|
|
11
12
|
LabelsClient,
|
|
12
13
|
SUPPORTED_PROVIDERS,
|
|
13
14
|
TracesClient,
|
|
@@ -17,7 +18,7 @@ import {
|
|
|
17
18
|
getCurrentSpan,
|
|
18
19
|
getCurrentTrace,
|
|
19
20
|
seedFromRegistry
|
|
20
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-VXD27AJ3.js";
|
|
21
22
|
import "./chunk-ZUD7OFYB.js";
|
|
22
23
|
import {
|
|
23
24
|
BITFAB_PROGRESS_PREFIX,
|
|
@@ -26,7 +27,7 @@ import {
|
|
|
26
27
|
ReplayError,
|
|
27
28
|
reportReplayProgress,
|
|
28
29
|
serializeReplayResult
|
|
29
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-DNYZJLNY.js";
|
|
30
31
|
import {
|
|
31
32
|
BitfabError,
|
|
32
33
|
DEFAULT_SERVICE_URL,
|
|
@@ -34,7 +35,7 @@ import {
|
|
|
34
35
|
MixedTracingError,
|
|
35
36
|
__version__,
|
|
36
37
|
flushTraces
|
|
37
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-RGC7IEOI.js";
|
|
38
39
|
import {
|
|
39
40
|
assertAsyncStorageRegistered,
|
|
40
41
|
registerAsyncLocalStorageClass
|
|
@@ -63,6 +64,7 @@ export {
|
|
|
63
64
|
DEFAULT_SERVICE_URL,
|
|
64
65
|
DatasetsClient,
|
|
65
66
|
DbBranchReplayError,
|
|
67
|
+
GradersClient,
|
|
66
68
|
HttpClient,
|
|
67
69
|
LabelsClient,
|
|
68
70
|
MixedTracingError,
|
package/dist/node.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/asyncStorageNode.ts","../src/node.ts"],"sourcesContent":["/**\n * Synchronous AsyncLocalStorage registration for Node.js.\n *\n * This module is a side-effect-only import: it registers the Node.js\n * AsyncLocalStorage class into the shared registry so span nesting\n * works immediately - no async gap, no microtask delay.\n *\n * It is imported by `node.ts` (the Node.js-specific entry point) as\n * the FIRST import, before `index.ts` or `client.ts` are evaluated.\n *\n * This file must ONLY be imported in Node.js environments (not browsers).\n * It uses a static `import` of `node:async_hooks`, which will fail in\n * browser bundlers. The `node.ts` entry point is conditionally selected\n * via package.json `exports` conditions, so browsers never see this file.\n */\n\nimport { AsyncLocalStorage } from \"node:async_hooks\"\nimport type { AsyncLocalStorageLike } from \"./asyncStorage.js\"\nimport { registerAsyncLocalStorageClass } from \"./asyncStorage.js\"\n\nregisterAsyncLocalStorageClass(\n AsyncLocalStorage as unknown as new () => AsyncLocalStorageLike<unknown>,\n)\n","/**\n * Node.js-specific entry point for the Bitfab SDK.\n *\n * Selected automatically via package.json `exports` conditions when the\n * consumer's runtime or bundler supports the \"node\" condition (Node.js,\n * most server-side bundlers).\n *\n * This entry point differs from the default (`index.ts`) in one way:\n * it synchronously registers Node.js's `AsyncLocalStorage` before any\n * other SDK code evaluates. This eliminates the async initialization\n * gap that the default entry point has (where the first span might\n * execute before the dynamic import of `node:async_hooks` resolves).\n *\n * The default entry point (`index.ts`) is used for browsers and other\n * environments where `node:async_hooks` is unavailable. There, span\n * nesting degrades gracefully to a shared stack (correct for sequential\n * async, but not for concurrent Promise.all patterns).\n */\n\n// ⚠️ IMPORT ORDER MATTERS\n// asyncStorageNode MUST be imported before index.js.\n// It registers the AsyncLocalStorage class synchronously during module\n// evaluation. index.js (via client.ts) reads from that registration at\n// span creation time. If this import is moved after index.js or removed,\n// span nesting silently degrades to the browser fallback (flat spans).\nimport \"./asyncStorageNode.js\"\n\nexport * from \"./index.js\"\n\n// Verify registration succeeded. This turns a silent degradation into a\n// loud error if someone reorders the imports above or if asyncStorageNode.ts\n// fails to register for any reason. Only runs in the Node.js entry point\n// where we know node:async_hooks must be available.\nimport { assertAsyncStorageRegistered } from \"./asyncStorage.js\"\n\nassertAsyncStorageRegistered()\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/asyncStorageNode.ts","../src/node.ts"],"sourcesContent":["/**\n * Synchronous AsyncLocalStorage registration for Node.js.\n *\n * This module is a side-effect-only import: it registers the Node.js\n * AsyncLocalStorage class into the shared registry so span nesting\n * works immediately - no async gap, no microtask delay.\n *\n * It is imported by `node.ts` (the Node.js-specific entry point) as\n * the FIRST import, before `index.ts` or `client.ts` are evaluated.\n *\n * This file must ONLY be imported in Node.js environments (not browsers).\n * It uses a static `import` of `node:async_hooks`, which will fail in\n * browser bundlers. The `node.ts` entry point is conditionally selected\n * via package.json `exports` conditions, so browsers never see this file.\n */\n\nimport { AsyncLocalStorage } from \"node:async_hooks\"\nimport type { AsyncLocalStorageLike } from \"./asyncStorage.js\"\nimport { registerAsyncLocalStorageClass } from \"./asyncStorage.js\"\n\nregisterAsyncLocalStorageClass(\n AsyncLocalStorage as unknown as new () => AsyncLocalStorageLike<unknown>,\n)\n","/**\n * Node.js-specific entry point for the Bitfab SDK.\n *\n * Selected automatically via package.json `exports` conditions when the\n * consumer's runtime or bundler supports the \"node\" condition (Node.js,\n * most server-side bundlers).\n *\n * This entry point differs from the default (`index.ts`) in one way:\n * it synchronously registers Node.js's `AsyncLocalStorage` before any\n * other SDK code evaluates. This eliminates the async initialization\n * gap that the default entry point has (where the first span might\n * execute before the dynamic import of `node:async_hooks` resolves).\n *\n * The default entry point (`index.ts`) is used for browsers and other\n * environments where `node:async_hooks` is unavailable. There, span\n * nesting degrades gracefully to a shared stack (correct for sequential\n * async, but not for concurrent Promise.all patterns).\n */\n\n// ⚠️ IMPORT ORDER MATTERS\n// asyncStorageNode MUST be imported before index.js.\n// It registers the AsyncLocalStorage class synchronously during module\n// evaluation. index.js (via client.ts) reads from that registration at\n// span creation time. If this import is moved after index.js or removed,\n// span nesting silently degrades to the browser fallback (flat spans).\nimport \"./asyncStorageNode.js\"\n\nexport * from \"./index.js\"\n\n// Verify registration succeeded. This turns a silent degradation into a\n// loud error if someone reorders the imports above or if asyncStorageNode.ts\n// fails to register for any reason. Only runs in the Node.js entry point\n// where we know node:async_hooks must be available.\nimport { assertAsyncStorageRegistered } from \"./asyncStorage.js\"\n\nassertAsyncStorageRegistered()\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,SAAS,yBAAyB;AAIlC;AAAA,EACE;AACF;;;ACaA,6BAA6B;","names":[]}
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
serializeReplayResult,
|
|
8
8
|
sleepForReplayPersistence,
|
|
9
9
|
waitForReplayPersistence
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-DNYZJLNY.js";
|
|
11
|
+
import "./chunk-RGC7IEOI.js";
|
|
12
12
|
import "./chunk-H6LZRFMN.js";
|
|
13
13
|
export {
|
|
14
14
|
BITFAB_PROGRESS_PREFIX,
|
|
@@ -20,4 +20,4 @@ export {
|
|
|
20
20
|
sleepForReplayPersistence,
|
|
21
21
|
waitForReplayPersistence
|
|
22
22
|
};
|
|
23
|
-
//# sourceMappingURL=replay-
|
|
23
|
+
//# sourceMappingURL=replay-ISXRCXUP.js.map
|
package/dist/replayCli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
BitfabError
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-4CLJF2DZ.js";
|
|
5
5
|
|
|
6
6
|
// src/replayCli.ts
|
|
7
7
|
import { tsImport } from "tsx/esm/api";
|
|
@@ -79,6 +79,7 @@ var VALUE_FLAGS = /* @__PURE__ */ new Set([
|
|
|
79
79
|
"--code-change",
|
|
80
80
|
"--experiment-group-id",
|
|
81
81
|
"--dataset-id",
|
|
82
|
+
"--dataset-ids",
|
|
82
83
|
"--grader-ids",
|
|
83
84
|
"--mock",
|
|
84
85
|
"--param",
|
|
@@ -104,7 +105,7 @@ Options:
|
|
|
104
105
|
--concurrency N, --max-concurrency N
|
|
105
106
|
--code-change PATH, --no-code-change
|
|
106
107
|
--experiment-group-id UUID
|
|
107
|
-
--dataset-id
|
|
108
|
+
--dataset-ids uuid1,uuid2 (--dataset-id is the same flag)
|
|
108
109
|
--grader-ids id1,id2
|
|
109
110
|
--only-with-assertions (replay only traces carrying an assertion)
|
|
110
111
|
--mock none|all|marked
|
|
@@ -172,7 +173,7 @@ async function seedFromRegistry(registry, pipeline, cases, options = {}) {
|
|
|
172
173
|
sessionId: seedCase.sessionId
|
|
173
174
|
})
|
|
174
175
|
);
|
|
175
|
-
const { flushTraces: flushTraces2 } = await import("./http-
|
|
176
|
+
const { flushTraces: flushTraces2 } = await import("./http-AKFJONE7.js");
|
|
176
177
|
await flushTraces2(3e4);
|
|
177
178
|
return { pipeline, traceFunctionKey, traceIds };
|
|
178
179
|
}
|
|
@@ -300,7 +301,8 @@ ${usage(registry)}`
|
|
|
300
301
|
parsed.experimentGroupId = raw;
|
|
301
302
|
break;
|
|
302
303
|
case "--dataset-id":
|
|
303
|
-
|
|
304
|
+
case "--dataset-ids":
|
|
305
|
+
parsed.datasetIds = commaSeparated(flag, raw);
|
|
304
306
|
break;
|
|
305
307
|
case "--grader-ids":
|
|
306
308
|
parsed.graderIds = commaSeparated(flag, raw);
|
|
@@ -321,9 +323,9 @@ ${usage(registry)}`
|
|
|
321
323
|
break;
|
|
322
324
|
}
|
|
323
325
|
}
|
|
324
|
-
if (parsed.traceIds !== void 0 && parsed.
|
|
326
|
+
if (parsed.traceIds !== void 0 && parsed.datasetIds !== void 0) {
|
|
325
327
|
throw new BitfabError(
|
|
326
|
-
"--trace-ids and --dataset-
|
|
328
|
+
"--trace-ids and --dataset-ids select different replay sources and cannot be used together."
|
|
327
329
|
);
|
|
328
330
|
}
|
|
329
331
|
if (parsed.codeChangePath !== void 0 && parsed.noCodeChange === true) {
|
|
@@ -333,6 +335,27 @@ ${usage(registry)}`
|
|
|
333
335
|
}
|
|
334
336
|
return parsed;
|
|
335
337
|
}
|
|
338
|
+
function resolveRegistrationDatasetIds(options) {
|
|
339
|
+
if (options.datasetId !== void 0 && options.datasetIds !== void 0) {
|
|
340
|
+
throw new BitfabError(
|
|
341
|
+
"Replay registry options datasetId and datasetIds are the same selector: set one of them."
|
|
342
|
+
);
|
|
343
|
+
}
|
|
344
|
+
if (options.datasetId !== void 0) {
|
|
345
|
+
return [options.datasetId];
|
|
346
|
+
}
|
|
347
|
+
return options.datasetIds;
|
|
348
|
+
}
|
|
349
|
+
function describeSelection(options) {
|
|
350
|
+
if (options.traceIds !== void 0) {
|
|
351
|
+
return `${options.traceIds.length} traces`;
|
|
352
|
+
}
|
|
353
|
+
if (options.limit !== void 0) {
|
|
354
|
+
return `${options.limit} traces`;
|
|
355
|
+
}
|
|
356
|
+
const datasetCount = options.datasetIds?.length ?? 1;
|
|
357
|
+
return datasetCount > 1 ? `${datasetCount} datasets' traces` : "dataset traces";
|
|
358
|
+
}
|
|
336
359
|
function resolveTraceFunctionKey(registration) {
|
|
337
360
|
const wrappedKey = registration.fn._bitfabTraceFunctionKey;
|
|
338
361
|
const key = registration.traceFunctionKey ?? wrappedKey;
|
|
@@ -486,11 +509,13 @@ async function runReplayCli(registry, argv = typeof process === "undefined" ? []
|
|
|
486
509
|
...registration.options,
|
|
487
510
|
...dynamicOptions
|
|
488
511
|
};
|
|
489
|
-
|
|
512
|
+
const registrationDatasetIds = resolveRegistrationDatasetIds(registrationOptions);
|
|
513
|
+
if (registrationOptions.traceIds !== void 0 && registrationDatasetIds !== void 0) {
|
|
490
514
|
throw new BitfabError(
|
|
491
|
-
"Replay registry options traceIds and
|
|
515
|
+
"Replay registry options traceIds and datasetIds select different sources and cannot be used together."
|
|
492
516
|
);
|
|
493
517
|
}
|
|
518
|
+
const selectedDatasetIds = args.datasetIds ?? registrationDatasetIds;
|
|
494
519
|
const codeChange = await loadCodeChange(args.codeChangePath, readFile);
|
|
495
520
|
const options = {
|
|
496
521
|
...registrationOptions,
|
|
@@ -498,7 +523,8 @@ async function runReplayCli(registry, argv = typeof process === "undefined" ? []
|
|
|
498
523
|
...args.attempts === void 0 ? {} : { attempts: args.attempts },
|
|
499
524
|
...args.maxConcurrency === void 0 ? {} : { maxConcurrency: args.maxConcurrency },
|
|
500
525
|
...args.experimentGroupId === void 0 ? {} : { experimentGroupId: args.experimentGroupId },
|
|
501
|
-
|
|
526
|
+
datasetId: void 0,
|
|
527
|
+
datasetIds: selectedDatasetIds,
|
|
502
528
|
...args.graderIds === void 0 ? {} : { graderIds: args.graderIds },
|
|
503
529
|
...args.onlyWithAssertions === void 0 ? {} : { onlyWithAssertions: args.onlyWithAssertions },
|
|
504
530
|
...args.mock === void 0 ? {} : { mock: args.mock },
|
|
@@ -516,23 +542,23 @@ async function runReplayCli(registry, argv = typeof process === "undefined" ? []
|
|
|
516
542
|
};
|
|
517
543
|
if (args.traceIds !== void 0) {
|
|
518
544
|
options.traceIds = args.traceIds;
|
|
519
|
-
options.
|
|
545
|
+
options.datasetIds = void 0;
|
|
520
546
|
options.limit = void 0;
|
|
521
|
-
} else if (args.
|
|
547
|
+
} else if (args.datasetIds !== void 0) {
|
|
522
548
|
options.traceIds = void 0;
|
|
523
549
|
options.limit = void 0;
|
|
524
550
|
} else if (args.limit !== void 0) {
|
|
525
551
|
options.traceIds = void 0;
|
|
526
|
-
options.
|
|
552
|
+
options.datasetIds = void 0;
|
|
527
553
|
options.limit = args.limit;
|
|
528
|
-
} else if (registrationOptions.traceIds !== void 0 ||
|
|
554
|
+
} else if (registrationOptions.traceIds !== void 0 || registrationDatasetIds !== void 0) {
|
|
529
555
|
options.limit = void 0;
|
|
530
556
|
} else {
|
|
531
557
|
options.limit = registrationOptions.limit ?? 10;
|
|
532
558
|
}
|
|
533
559
|
const attemptsSuffix = options.attempts !== void 0 && options.attempts > 1 ? ` (${options.attempts} attempts each)` : "";
|
|
534
560
|
stderr(
|
|
535
|
-
`[replay] ${args.dryRun === true ? "Resolving inputs for" : "Replaying"} ${options
|
|
561
|
+
`[replay] ${args.dryRun === true ? "Resolving inputs for" : "Replaying"} ${describeSelection(options)} from "${traceFunctionKey}"${attemptsSuffix}...`
|
|
536
562
|
);
|
|
537
563
|
try {
|
|
538
564
|
const result = await registration.client.replay(
|