@bitfab/sdk 0.41.0 → 0.43.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-U3AKIFW3.js → chunk-5BBJ5BQD.js} +180 -67
- package/dist/chunk-5BBJ5BQD.js.map +1 -0
- package/dist/{chunk-IFYX3KW6.js → chunk-6EM2S5H5.js} +18 -6
- package/dist/chunk-6EM2S5H5.js.map +1 -0
- package/dist/{chunk-VEA6JOKL.js → chunk-BBJSKBVJ.js} +18 -6
- package/dist/chunk-BBJSKBVJ.js.map +1 -0
- package/dist/{chunk-RWZYZRYI.js → chunk-BXBRVWWW.js} +49 -13
- package/dist/chunk-BXBRVWWW.js.map +1 -0
- package/dist/{http-UCJCOKW7.js → http-IO3Y7ROJ.js} +2 -2
- package/dist/{http-JSBWHPNA.js → http-R553H2H2.js} +2 -2
- package/dist/index.cjs +244 -80
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +45 -54
- package/dist/index.d.ts +45 -54
- package/dist/index.js +3 -3
- package/dist/node.cjs +244 -80
- 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 +3 -3
- package/dist/{replay-HMMWDSLB.js → replay-LM4GIDVD.js} +3 -3
- package/dist/replayCli.js +47 -12
- package/dist/replayCli.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-IFYX3KW6.js.map +0 -1
- package/dist/chunk-RWZYZRYI.js.map +0 -1
- package/dist/chunk-U3AKIFW3.js.map +0 -1
- package/dist/chunk-VEA6JOKL.js.map +0 -1
- /package/dist/{http-JSBWHPNA.js.map → http-IO3Y7ROJ.js.map} +0 -0
- /package/dist/{http-UCJCOKW7.js.map → http-R553H2H2.js.map} +0 -0
- /package/dist/{replay-HMMWDSLB.js.map → replay-LM4GIDVD.js.map} +0 -0
package/dist/node.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ActiveSpanContext, AdaptContext, AdaptInputsFn, AddDatasetGradersResult, AddDatasetTracesResult, AllowedEnvVars, BITFAB_PROGRESS_PREFIX, BamlExecutionResult, Bitfab, BitfabClaudeAgentHandler, BitfabConfig, BitfabError, BitfabFunction, BitfabLangChainCallbackHandler, BitfabLangChainCallbackHandler as BitfabLangGraphCallbackHandler, BitfabLangGraphIntegration, BitfabLanguageModelMiddleware, BitfabOpenAIAgentHandler, BitfabOpenAITracingProcessor, BitfabVercelAiHandler, CaptureWhen, CapturedSpan, CodeChangeFile, CurrentSpan, CurrentTrace, DEFAULT_SERVICE_URL, Dataset, DatasetGraderRef, DatasetTraceIds, DatasetsClient, DbBranchOptions, DbBranchReplayError, DbBranchTimings, DbSnapshotConfig, DbSnapshotProvider, DbSnapshotRef, DetachedTrace, GraderRerun, GraderRerunProgress, GraderRerunResult, GraderRerunStatus, HttpClient, LangGraphIntegrationOptions, ListDatasetsParams, 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, SaveDatasetParams, SaveDatasetResult, SeedCase, SeedResult, SpanLookup, SpanMethodDecorator, SpanMethodDecoratorContext, SpanNodeMeta, SpanOccurrence, SpanOptions, SpanType, TokenUsage, TraceIngestionType, TraceResponse, 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, 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, LangGraphIntegrationOptions, ListDatasetsParams, 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, SaveDatasetParams, SaveDatasetResult, SeedCase, SeedCaseOptions, SeedResult, SeedRunOptions, SpanLookup, SpanMethodDecorator, SpanMethodDecoratorContext, SpanNodeMeta, SpanOccurrence, SpanOptions, SpanType, TokenUsage, TraceIngestionType, TraceResponse, 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, BITFAB_PROGRESS_PREFIX, BamlExecutionResult, Bitfab, BitfabClaudeAgentHandler, BitfabConfig, BitfabError, BitfabFunction, BitfabLangChainCallbackHandler, BitfabLangChainCallbackHandler as BitfabLangGraphCallbackHandler, BitfabLangGraphIntegration, BitfabLanguageModelMiddleware, BitfabOpenAIAgentHandler, BitfabOpenAITracingProcessor, BitfabVercelAiHandler, CaptureWhen, CapturedSpan, CodeChangeFile, CurrentSpan, CurrentTrace, DEFAULT_SERVICE_URL, Dataset, DatasetGraderRef, DatasetTraceIds, DatasetsClient, DbBranchOptions, DbBranchReplayError, DbBranchTimings, DbSnapshotConfig, DbSnapshotProvider, DbSnapshotRef, DetachedTrace, GraderRerun, GraderRerunProgress, GraderRerunResult, GraderRerunStatus, HttpClient, LangGraphIntegrationOptions, ListDatasetsParams, 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, SaveDatasetParams, SaveDatasetResult, SeedCase, SeedResult, SpanLookup, SpanMethodDecorator, SpanMethodDecoratorContext, SpanNodeMeta, SpanOccurrence, SpanOptions, SpanType, TokenUsage, TraceIngestionType, TraceResponse, 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, 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, LangGraphIntegrationOptions, ListDatasetsParams, 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, SaveDatasetParams, SaveDatasetResult, SeedCase, SeedCaseOptions, SeedResult, SeedRunOptions, SpanLookup, SpanMethodDecorator, SpanMethodDecoratorContext, SpanNodeMeta, SpanOccurrence, SpanOptions, SpanType, TokenUsage, TraceIngestionType, TraceResponse, TracingProcessor, VercelCallParams, VercelGenerateResult, VercelStreamResult, WrapBAMLOptions, WrappedBamlFn, __version__, defineReplayRegistry, finalizers, flushTraces, getCurrentReplayBranch, getCurrentSpan, getCurrentTrace, reportReplayProgress, seedFromRegistry, serializeReplayResult } from './index.js';
|
package/dist/node.js
CHANGED
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
getCurrentSpan,
|
|
16
16
|
getCurrentTrace,
|
|
17
17
|
seedFromRegistry
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-5BBJ5BQD.js";
|
|
19
19
|
import "./chunk-ZUD7OFYB.js";
|
|
20
20
|
import {
|
|
21
21
|
BITFAB_PROGRESS_PREFIX,
|
|
@@ -24,14 +24,14 @@ import {
|
|
|
24
24
|
ReplayError,
|
|
25
25
|
reportReplayProgress,
|
|
26
26
|
serializeReplayResult
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-BXBRVWWW.js";
|
|
28
28
|
import {
|
|
29
29
|
BitfabError,
|
|
30
30
|
DEFAULT_SERVICE_URL,
|
|
31
31
|
HttpClient,
|
|
32
32
|
__version__,
|
|
33
33
|
flushTraces
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-6EM2S5H5.js";
|
|
35
35
|
import {
|
|
36
36
|
assertAsyncStorageRegistered,
|
|
37
37
|
registerAsyncLocalStorageClass
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
serializeReplayResult,
|
|
8
8
|
sleepForReplayPersistence,
|
|
9
9
|
waitForReplayPersistence
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-BXBRVWWW.js";
|
|
11
|
+
import "./chunk-6EM2S5H5.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-LM4GIDVD.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-BBJSKBVJ.js";
|
|
5
5
|
|
|
6
6
|
// src/replayCli.ts
|
|
7
7
|
import { tsImport } from "tsx/esm/api";
|
|
@@ -71,6 +71,7 @@ function serializeReplayResult(result) {
|
|
|
71
71
|
// src/replayRegistry.ts
|
|
72
72
|
var VALUE_FLAGS = /* @__PURE__ */ new Set([
|
|
73
73
|
"--limit",
|
|
74
|
+
"--attempts",
|
|
74
75
|
"--trace-ids",
|
|
75
76
|
"--name",
|
|
76
77
|
"--concurrency",
|
|
@@ -90,11 +91,13 @@ var BOOLEAN_FLAGS = /* @__PURE__ */ new Set([
|
|
|
90
91
|
"--dry-run"
|
|
91
92
|
]);
|
|
92
93
|
var HELP_FLAGS = /* @__PURE__ */ new Set(["--help", "-h"]);
|
|
94
|
+
var MAX_ATTEMPTS = 100;
|
|
93
95
|
function usage(registry) {
|
|
94
96
|
return `Usage: bitfab-replay --registry <path> <${Object.keys(registry).join("|")}> [options]
|
|
95
97
|
|
|
96
98
|
Options:
|
|
97
99
|
--limit N
|
|
100
|
+
--attempts N (replay each trace N times in this run, max ${MAX_ATTEMPTS})
|
|
98
101
|
--trace-ids id1,id2
|
|
99
102
|
--name NAME
|
|
100
103
|
--concurrency N, --max-concurrency N
|
|
@@ -111,7 +114,7 @@ Options:
|
|
|
111
114
|
}
|
|
112
115
|
var ReplayCliHelp = class extends Error {
|
|
113
116
|
};
|
|
114
|
-
function parseSeedCases(raw, path) {
|
|
117
|
+
function parseSeedCases(raw, path, run) {
|
|
115
118
|
const trimmed = raw.trim();
|
|
116
119
|
if (trimmed.length === 0) {
|
|
117
120
|
throw new BitfabError(`Seed file '${path}' is empty.`);
|
|
@@ -129,10 +132,15 @@ function parseSeedCases(raw, path) {
|
|
|
129
132
|
`Seed case ${index} in '${path}' is missing an "input" array. Wrap a single argument as [arg].`
|
|
130
133
|
);
|
|
131
134
|
}
|
|
135
|
+
if (run && "expected" in value) {
|
|
136
|
+
throw new BitfabError(
|
|
137
|
+
`Seed case ${index} in '${path}' carries "expected", which --run does not record: the case is run once and its output is what the run produced. Remove the field, or drop --run to record the case without running it.`
|
|
138
|
+
);
|
|
139
|
+
}
|
|
132
140
|
return value;
|
|
133
141
|
});
|
|
134
142
|
}
|
|
135
|
-
async function seedFromRegistry(registry, pipeline, cases) {
|
|
143
|
+
async function seedFromRegistry(registry, pipeline, cases, options = {}) {
|
|
136
144
|
const registration = registry[pipeline];
|
|
137
145
|
if (registration === void 0) {
|
|
138
146
|
throw new BitfabError(
|
|
@@ -140,6 +148,19 @@ async function seedFromRegistry(registry, pipeline, cases) {
|
|
|
140
148
|
);
|
|
141
149
|
}
|
|
142
150
|
const traceFunctionKey = resolveTraceFunctionKey(registration);
|
|
151
|
+
if (options.run === true) {
|
|
152
|
+
const traceIds2 = [];
|
|
153
|
+
for (const seedCase of cases) {
|
|
154
|
+
traceIds2.push(
|
|
155
|
+
await registration.client.seedTrace(traceFunctionKey, registration.fn, {
|
|
156
|
+
args: seedCase.input,
|
|
157
|
+
metadata: seedCase.metadata,
|
|
158
|
+
sessionId: seedCase.sessionId
|
|
159
|
+
})
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
return { pipeline, traceFunctionKey, traceIds: traceIds2 };
|
|
163
|
+
}
|
|
143
164
|
const traceIds = cases.map(
|
|
144
165
|
(seedCase) => registration.client.seedTrace(traceFunctionKey, {
|
|
145
166
|
input: seedCase.input,
|
|
@@ -149,11 +170,11 @@ async function seedFromRegistry(registry, pipeline, cases) {
|
|
|
149
170
|
sessionId: seedCase.sessionId
|
|
150
171
|
})
|
|
151
172
|
);
|
|
152
|
-
const { flushTraces: flushTraces2 } = await import("./http-
|
|
173
|
+
const { flushTraces: flushTraces2 } = await import("./http-R553H2H2.js");
|
|
153
174
|
await flushTraces2(3e4);
|
|
154
175
|
return { pipeline, traceFunctionKey, traceIds };
|
|
155
176
|
}
|
|
156
|
-
var SEED_USAGE = 'Usage: bitfab-replay --registry <path> <pipeline> --seed <cases.jsonl
|
|
177
|
+
var SEED_USAGE = 'Usage: bitfab-replay --registry <path> <pipeline> --seed <cases.jsonl> [--run]\n\nEach case is a JSON object with an "input" array, plus optional "expected", "metadata", and "sessionId". A JSON array of those objects works too.\n\nWithout --run, each case is written as a trace directly: "input" becomes the root span input and "expected" its output, and nothing executes.\n\nWith --run, each case is run once through the registered function with capture off and the execution is recorded, so the output is what the run produced. Cases carrying "expected" are rejected.';
|
|
157
178
|
async function runSeedCli(registry, argv, io = {}) {
|
|
158
179
|
const stdout = io.stdout ?? console.log;
|
|
159
180
|
const stderr = io.stderr ?? console.error;
|
|
@@ -169,23 +190,29 @@ async function runSeedCli(registry, argv, io = {}) {
|
|
|
169
190
|
if (casesPath === void 0 || casesPath.startsWith("--")) {
|
|
170
191
|
throw new BitfabError("--seed requires a path to a cases file.");
|
|
171
192
|
}
|
|
193
|
+
const run = argv.includes("--run");
|
|
172
194
|
const readFile = io.readFile ?? defaultReadFile;
|
|
173
|
-
const cases = parseSeedCases(await readFile(casesPath), casesPath);
|
|
174
|
-
stderr(`[seed] Seeding ${cases.length} case(s) into "${pipeline}"...`);
|
|
175
|
-
const result = await seedFromRegistry(registry, pipeline, cases);
|
|
195
|
+
const cases = parseSeedCases(await readFile(casesPath), casesPath, run);
|
|
176
196
|
stderr(
|
|
177
|
-
`[seed]
|
|
197
|
+
run ? `[seed] Running ${cases.length} case(s) through "${pipeline}"...` : `[seed] Seeding ${cases.length} case(s) into "${pipeline}"...`
|
|
198
|
+
);
|
|
199
|
+
const result = await seedFromRegistry(registry, pipeline, cases, { run });
|
|
200
|
+
stderr(
|
|
201
|
+
`[seed] ${run ? "Recorded" : "Wrote"} ${result.traceIds.length} trace(s) for "${result.traceFunctionKey}". Replay them with --trace-ids ${result.traceIds.slice(0, 3).join(",")}${result.traceIds.length > 3 ? ",..." : ""}`
|
|
178
202
|
);
|
|
179
203
|
stdout(JSON.stringify(result, null, 2));
|
|
180
204
|
return result;
|
|
181
205
|
}
|
|
182
|
-
function requirePositiveInteger(flag, raw) {
|
|
206
|
+
function requirePositiveInteger(flag, raw, max) {
|
|
183
207
|
const value = Number(raw);
|
|
184
208
|
if (!Number.isInteger(value) || value < 1) {
|
|
185
209
|
throw new BitfabError(
|
|
186
210
|
`${flag} must be a positive integer (received '${raw}').`
|
|
187
211
|
);
|
|
188
212
|
}
|
|
213
|
+
if (max !== void 0 && value > max) {
|
|
214
|
+
throw new BitfabError(`${flag} must be at most ${max} (received '${raw}').`);
|
|
215
|
+
}
|
|
189
216
|
return value;
|
|
190
217
|
}
|
|
191
218
|
function commaSeparated(flag, raw) {
|
|
@@ -248,6 +275,9 @@ ${usage(registry)}`
|
|
|
248
275
|
case "--limit":
|
|
249
276
|
parsed.limit = requirePositiveInteger(flag, raw);
|
|
250
277
|
break;
|
|
278
|
+
case "--attempts":
|
|
279
|
+
parsed.attempts = requirePositiveInteger(flag, raw, MAX_ATTEMPTS);
|
|
280
|
+
break;
|
|
251
281
|
case "--trace-ids":
|
|
252
282
|
parsed.traceIds = commaSeparated(flag, raw);
|
|
253
283
|
break;
|
|
@@ -395,6 +425,9 @@ function renderSummary(pipeline, result, stderr) {
|
|
|
395
425
|
stderr("\n\u2500\u2500\u2500 Summary \u2500\u2500\u2500");
|
|
396
426
|
stderr(` Pipeline: ${pipeline}`);
|
|
397
427
|
stderr(` Replayed: ${result.items.length}`);
|
|
428
|
+
if (result.attempts > 1) {
|
|
429
|
+
stderr(` Attempts: ${result.attempts}`);
|
|
430
|
+
}
|
|
398
431
|
if (same > 0 || changed > 0 || matched + missed === 0) {
|
|
399
432
|
stderr(` Same: ${same}`);
|
|
400
433
|
stderr(` Changed: ${changed}`);
|
|
@@ -457,6 +490,7 @@ async function runReplayCli(registry, argv = typeof process === "undefined" ? []
|
|
|
457
490
|
const options = {
|
|
458
491
|
...registrationOptions,
|
|
459
492
|
...args.name === void 0 ? {} : { name: args.name },
|
|
493
|
+
...args.attempts === void 0 ? {} : { attempts: args.attempts },
|
|
460
494
|
...args.maxConcurrency === void 0 ? {} : { maxConcurrency: args.maxConcurrency },
|
|
461
495
|
...args.experimentGroupId === void 0 ? {} : { experimentGroupId: args.experimentGroupId },
|
|
462
496
|
...args.datasetId === void 0 ? {} : { datasetId: args.datasetId },
|
|
@@ -490,8 +524,9 @@ async function runReplayCli(registry, argv = typeof process === "undefined" ? []
|
|
|
490
524
|
} else {
|
|
491
525
|
options.limit = registrationOptions.limit ?? 10;
|
|
492
526
|
}
|
|
527
|
+
const attemptsSuffix = options.attempts !== void 0 && options.attempts > 1 ? ` (${options.attempts} attempts each)` : "";
|
|
493
528
|
stderr(
|
|
494
|
-
`[replay] ${args.dryRun === true ? "Resolving inputs for" : "Replaying"} ${options.traceIds?.length ?? options.limit ?? "dataset"} traces from "${traceFunctionKey}"...`
|
|
529
|
+
`[replay] ${args.dryRun === true ? "Resolving inputs for" : "Replaying"} ${options.traceIds?.length ?? options.limit ?? "dataset"} traces from "${traceFunctionKey}"${attemptsSuffix}...`
|
|
495
530
|
);
|
|
496
531
|
try {
|
|
497
532
|
const result = await registration.client.replay(
|
|
@@ -520,7 +555,7 @@ async function runReplayCli(registry, argv = typeof process === "undefined" ? []
|
|
|
520
555
|
}
|
|
521
556
|
|
|
522
557
|
// src/replayCli.ts
|
|
523
|
-
var USAGE = "Usage: bitfab-replay --registry <path> <pipeline> [options]\n bitfab-replay --registry <path> <pipeline> --seed <cases.jsonl
|
|
558
|
+
var USAGE = "Usage: bitfab-replay --registry <path> <pipeline> [options]\n bitfab-replay --registry <path> <pipeline> --seed <cases.jsonl> [--run]\nRun bitfab-replay --registry <path> --help to list replay options.";
|
|
524
559
|
async function parseCommandArgs(argv) {
|
|
525
560
|
if (argv.some((value) => value === "--help" || value === "-h") && !argv.includes("--registry")) {
|
|
526
561
|
throw new ReplayCliHelp(USAGE);
|