@bitfab/sdk 0.54.12 → 0.54.13
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/autoTrace.cjs +0 -19
- package/dist/autoTrace.cjs.map +1 -1
- package/dist/autoTrace.d.cts +1 -3
- package/dist/autoTrace.d.ts +1 -3
- package/dist/autoTrace.js +1 -5
- package/dist/{chunk-Q3X54UPA.js → chunk-BUGCOUK6.js} +3 -3
- package/dist/{chunk-JEFU6FTD.js → chunk-IOLVW3PT.js} +11 -50
- package/dist/chunk-IOLVW3PT.js.map +1 -0
- package/dist/{chunk-XTUINMAL.js → chunk-M7HWCJVO.js} +2 -2
- package/dist/{chunk-GZI455WP.js → chunk-N5T6NDR3.js} +2 -8
- package/dist/{chunk-GZI455WP.js.map → chunk-N5T6NDR3.js.map} +1 -1
- package/dist/{chunk-EGWJYCNT.js → chunk-RCHSYWKI.js} +2 -19
- package/dist/chunk-RCHSYWKI.js.map +1 -0
- package/dist/{chunk-I5NJU64I.js → chunk-WDSOB57F.js} +2 -9
- package/dist/{chunk-I5NJU64I.js.map → chunk-WDSOB57F.js.map} +1 -1
- package/dist/{http-X4YOOM54.js → http-4W2BM7GE.js} +2 -2
- package/dist/{http-FJVBYZES.js → http-Y6UGNXSO.js} +2 -2
- package/dist/index.cjs +5 -63
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -11
- package/dist/index.d.ts +8 -11
- package/dist/index.js +4 -4
- package/dist/node.cjs +5 -63
- package/dist/node.cjs.map +1 -1
- package/dist/node.js +4 -4
- package/dist/{replay-IA5VRWHD.js → replay-YJBLRMQD.js} +3 -3
- package/dist/replayCli.js +2 -2
- package/dist/seedCli.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-EGWJYCNT.js.map +0 -1
- package/dist/chunk-JEFU6FTD.js.map +0 -1
- /package/dist/{chunk-Q3X54UPA.js.map → chunk-BUGCOUK6.js.map} +0 -0
- /package/dist/{chunk-XTUINMAL.js.map → chunk-M7HWCJVO.js.map} +0 -0
- /package/dist/{http-FJVBYZES.js.map → http-4W2BM7GE.js.map} +0 -0
- /package/dist/{http-X4YOOM54.js.map → http-Y6UGNXSO.js.map} +0 -0
- /package/dist/{replay-IA5VRWHD.js.map → replay-YJBLRMQD.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -557,7 +557,6 @@ declare class HttpClient {
|
|
|
557
557
|
* Blocks until complete - needed for function execution.
|
|
558
558
|
*/
|
|
559
559
|
lookupFunction<T>(name: string): Promise<T>;
|
|
560
|
-
getAutoTracePolicy<T>(traceFunctionKey: string, protocol: string): Promise<T>;
|
|
561
560
|
getSimulationPlan(): Promise<SimulationPlanResponse>;
|
|
562
561
|
getTraceSpan(traceId: string, lookup: SpanLookup): Promise<CapturedSpan | null>;
|
|
563
562
|
/**
|
|
@@ -2904,7 +2903,6 @@ declare class Bitfab {
|
|
|
2904
2903
|
readonly graders: GradersClient;
|
|
2905
2904
|
private readonly bamlClient;
|
|
2906
2905
|
private readonly dbSnapshot;
|
|
2907
|
-
private readonly autoTracePolicyRefreshes;
|
|
2908
2906
|
private readonly simulationPlan;
|
|
2909
2907
|
/**
|
|
2910
2908
|
* Mock overrides registered via {@link Bitfab.registerMockOverride}, applied
|
|
@@ -2923,12 +2921,12 @@ declare class Bitfab {
|
|
|
2923
2921
|
*
|
|
2924
2922
|
* Build instrumentation turns repository functions called beneath this
|
|
2925
2923
|
* method into nested spans that capture inputs, outputs, and errors by
|
|
2926
|
-
* default.
|
|
2927
|
-
*
|
|
2924
|
+
* default. Source exclusions and sim-plan capture-off decisions are explicit
|
|
2925
|
+
* opt-outs from that default.
|
|
2928
2926
|
* Without a compatible build transform, this still records the decorated
|
|
2929
2927
|
* method as a normal rich root span but cannot discover child calls.
|
|
2930
2928
|
*
|
|
2931
|
-
* @param traceFunctionKey - Groups traces and their capture
|
|
2929
|
+
* @param traceFunctionKey - Groups traces and their capture controls.
|
|
2932
2930
|
* @param options - Root presentation, subtree bounds, and exclusions.
|
|
2933
2931
|
* @experimental Automatic child-call instrumentation is experimental.
|
|
2934
2932
|
*/
|
|
@@ -2939,11 +2937,11 @@ declare class Bitfab {
|
|
|
2939
2937
|
* This is the function-oriented equivalent of {@link Bitfab.trace}. Build
|
|
2940
2938
|
* instrumentation turns repository functions called beneath the wrapped
|
|
2941
2939
|
* function into nested spans that capture inputs, outputs, and errors by
|
|
2942
|
-
* default.
|
|
2943
|
-
*
|
|
2944
|
-
* normal rich root span and runs the function unchanged.
|
|
2940
|
+
* default. Source exclusions and sim-plan capture-off decisions are explicit
|
|
2941
|
+
* opt-outs from that default. Without a compatible transform, this still
|
|
2942
|
+
* records one normal rich root span and runs the function unchanged.
|
|
2945
2943
|
*
|
|
2946
|
-
* @param traceFunctionKey - Groups traces and their capture
|
|
2944
|
+
* @param traceFunctionKey - Groups traces and their capture controls.
|
|
2947
2945
|
* @param optionsOrFn - Options or the workflow entrypoint to wrap.
|
|
2948
2946
|
* @param maybeFn - Workflow entrypoint when options are provided.
|
|
2949
2947
|
* @experimental Automatic child-call instrumentation is experimental.
|
|
@@ -2982,7 +2980,6 @@ declare class Bitfab {
|
|
|
2982
2980
|
private createAutoTraceNode;
|
|
2983
2981
|
private createAutoTraceRoot;
|
|
2984
2982
|
private applySimulationPlan;
|
|
2985
|
-
private refreshAutoTraceCapturePolicy;
|
|
2986
2983
|
/**
|
|
2987
2984
|
* Flush and permanently close this client's tracing resources: its pending
|
|
2988
2985
|
* requests and the single span-transport worker shared by its decorators and
|
|
@@ -3604,7 +3601,7 @@ interface CommitRef {
|
|
|
3604
3601
|
/**
|
|
3605
3602
|
* SDK version from package.json (injected at build time)
|
|
3606
3603
|
*/
|
|
3607
|
-
declare const __version__ = "0.54.
|
|
3604
|
+
declare const __version__ = "0.54.13";
|
|
3608
3605
|
|
|
3609
3606
|
/**
|
|
3610
3607
|
* Constants for the Bitfab SDK.
|
package/dist/index.d.ts
CHANGED
|
@@ -557,7 +557,6 @@ declare class HttpClient {
|
|
|
557
557
|
* Blocks until complete - needed for function execution.
|
|
558
558
|
*/
|
|
559
559
|
lookupFunction<T>(name: string): Promise<T>;
|
|
560
|
-
getAutoTracePolicy<T>(traceFunctionKey: string, protocol: string): Promise<T>;
|
|
561
560
|
getSimulationPlan(): Promise<SimulationPlanResponse>;
|
|
562
561
|
getTraceSpan(traceId: string, lookup: SpanLookup): Promise<CapturedSpan | null>;
|
|
563
562
|
/**
|
|
@@ -2904,7 +2903,6 @@ declare class Bitfab {
|
|
|
2904
2903
|
readonly graders: GradersClient;
|
|
2905
2904
|
private readonly bamlClient;
|
|
2906
2905
|
private readonly dbSnapshot;
|
|
2907
|
-
private readonly autoTracePolicyRefreshes;
|
|
2908
2906
|
private readonly simulationPlan;
|
|
2909
2907
|
/**
|
|
2910
2908
|
* Mock overrides registered via {@link Bitfab.registerMockOverride}, applied
|
|
@@ -2923,12 +2921,12 @@ declare class Bitfab {
|
|
|
2923
2921
|
*
|
|
2924
2922
|
* Build instrumentation turns repository functions called beneath this
|
|
2925
2923
|
* method into nested spans that capture inputs, outputs, and errors by
|
|
2926
|
-
* default.
|
|
2927
|
-
*
|
|
2924
|
+
* default. Source exclusions and sim-plan capture-off decisions are explicit
|
|
2925
|
+
* opt-outs from that default.
|
|
2928
2926
|
* Without a compatible build transform, this still records the decorated
|
|
2929
2927
|
* method as a normal rich root span but cannot discover child calls.
|
|
2930
2928
|
*
|
|
2931
|
-
* @param traceFunctionKey - Groups traces and their capture
|
|
2929
|
+
* @param traceFunctionKey - Groups traces and their capture controls.
|
|
2932
2930
|
* @param options - Root presentation, subtree bounds, and exclusions.
|
|
2933
2931
|
* @experimental Automatic child-call instrumentation is experimental.
|
|
2934
2932
|
*/
|
|
@@ -2939,11 +2937,11 @@ declare class Bitfab {
|
|
|
2939
2937
|
* This is the function-oriented equivalent of {@link Bitfab.trace}. Build
|
|
2940
2938
|
* instrumentation turns repository functions called beneath the wrapped
|
|
2941
2939
|
* function into nested spans that capture inputs, outputs, and errors by
|
|
2942
|
-
* default.
|
|
2943
|
-
*
|
|
2944
|
-
* normal rich root span and runs the function unchanged.
|
|
2940
|
+
* default. Source exclusions and sim-plan capture-off decisions are explicit
|
|
2941
|
+
* opt-outs from that default. Without a compatible transform, this still
|
|
2942
|
+
* records one normal rich root span and runs the function unchanged.
|
|
2945
2943
|
*
|
|
2946
|
-
* @param traceFunctionKey - Groups traces and their capture
|
|
2944
|
+
* @param traceFunctionKey - Groups traces and their capture controls.
|
|
2947
2945
|
* @param optionsOrFn - Options or the workflow entrypoint to wrap.
|
|
2948
2946
|
* @param maybeFn - Workflow entrypoint when options are provided.
|
|
2949
2947
|
* @experimental Automatic child-call instrumentation is experimental.
|
|
@@ -2982,7 +2980,6 @@ declare class Bitfab {
|
|
|
2982
2980
|
private createAutoTraceNode;
|
|
2983
2981
|
private createAutoTraceRoot;
|
|
2984
2982
|
private applySimulationPlan;
|
|
2985
|
-
private refreshAutoTraceCapturePolicy;
|
|
2986
2983
|
/**
|
|
2987
2984
|
* Flush and permanently close this client's tracing resources: its pending
|
|
2988
2985
|
* requests and the single span-transport worker shared by its decorators and
|
|
@@ -3604,7 +3601,7 @@ interface CommitRef {
|
|
|
3604
3601
|
/**
|
|
3605
3602
|
* SDK version from package.json (injected at build time)
|
|
3606
3603
|
*/
|
|
3607
|
-
declare const __version__ = "0.54.
|
|
3604
|
+
declare const __version__ = "0.54.13";
|
|
3608
3605
|
|
|
3609
3606
|
/**
|
|
3610
3607
|
* Constants for the Bitfab SDK.
|
package/dist/index.js
CHANGED
|
@@ -21,8 +21,8 @@ import {
|
|
|
21
21
|
getCurrentTrace,
|
|
22
22
|
reseedFromRegistry,
|
|
23
23
|
seedFromRegistry
|
|
24
|
-
} from "./chunk-
|
|
25
|
-
import "./chunk-
|
|
24
|
+
} from "./chunk-IOLVW3PT.js";
|
|
25
|
+
import "./chunk-RCHSYWKI.js";
|
|
26
26
|
import {
|
|
27
27
|
BITFAB_PROGRESS_PREFIX,
|
|
28
28
|
DbBranchReplayError,
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
ReplayError,
|
|
31
31
|
reportReplayProgress,
|
|
32
32
|
serializeReplayResult
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-M7HWCJVO.js";
|
|
34
34
|
import {
|
|
35
35
|
BitfabError,
|
|
36
36
|
DEFAULT_SERVICE_URL,
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
MixedTracingError,
|
|
39
39
|
__version__,
|
|
40
40
|
flushTraces
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-WDSOB57F.js";
|
|
42
42
|
import "./chunk-VCRFFCLY.js";
|
|
43
43
|
export {
|
|
44
44
|
AssertionCategoriesClient,
|
package/dist/node.cjs
CHANGED
|
@@ -88,7 +88,7 @@ var __version__, __packageName__;
|
|
|
88
88
|
var init_version_generated = __esm({
|
|
89
89
|
"src/version.generated.ts"() {
|
|
90
90
|
"use strict";
|
|
91
|
-
__version__ = "0.54.
|
|
91
|
+
__version__ = "0.54.13";
|
|
92
92
|
__packageName__ = "@bitfab/sdk";
|
|
93
93
|
}
|
|
94
94
|
});
|
|
@@ -2664,12 +2664,6 @@ var init_http = __esm({
|
|
|
2664
2664
|
async lookupFunction(name) {
|
|
2665
2665
|
return this.request("/api/sdk/functions/lookup", { name });
|
|
2666
2666
|
}
|
|
2667
|
-
async getAutoTracePolicy(traceFunctionKey, protocol) {
|
|
2668
|
-
return this.request("/api/sdk/auto-trace/policy", {
|
|
2669
|
-
traceFunctionKey,
|
|
2670
|
-
protocol
|
|
2671
|
-
});
|
|
2672
|
-
}
|
|
2673
2667
|
async getSimulationPlan() {
|
|
2674
2668
|
return this.get(
|
|
2675
2669
|
"/api/sdk/sim-plan",
|
|
@@ -5200,21 +5194,6 @@ function currentAutoTraceScope() {
|
|
|
5200
5194
|
initializeAutoTraceStorage();
|
|
5201
5195
|
return autoTraceState.storage?.getStore() ?? autoTraceState.browserScope;
|
|
5202
5196
|
}
|
|
5203
|
-
function __setBitfabAutoTraceCapturePolicy(client, traceFunctionKey, functionIds) {
|
|
5204
|
-
const policies = autoTraceState.capturePolicies.get(client) ?? /* @__PURE__ */ new Map();
|
|
5205
|
-
if (functionIds === void 0) {
|
|
5206
|
-
policies.delete(traceFunctionKey);
|
|
5207
|
-
if (policies.size === 0) {
|
|
5208
|
-
autoTraceState.capturePolicies.delete(client);
|
|
5209
|
-
}
|
|
5210
|
-
return;
|
|
5211
|
-
}
|
|
5212
|
-
policies.set(traceFunctionKey, new Set(functionIds));
|
|
5213
|
-
autoTraceState.capturePolicies.set(client, policies);
|
|
5214
|
-
}
|
|
5215
|
-
function getAutoTraceCapturePolicy(client, traceFunctionKey) {
|
|
5216
|
-
return autoTraceState.capturePolicies.get(client)?.get(traceFunctionKey);
|
|
5217
|
-
}
|
|
5218
5197
|
|
|
5219
5198
|
// src/optionalPeer.ts
|
|
5220
5199
|
function importOptionalPeer(specifierParts) {
|
|
@@ -7063,7 +7042,6 @@ function openAiAgentsParentSpanId(bitfabTraceId, enclosingSpanIds) {
|
|
|
7063
7042
|
}
|
|
7064
7043
|
|
|
7065
7044
|
// src/client.ts
|
|
7066
|
-
init_policyRefresh();
|
|
7067
7045
|
init_randomUuid();
|
|
7068
7046
|
init_replay();
|
|
7069
7047
|
|
|
@@ -8647,8 +8625,6 @@ function readBooleanEnv(name) {
|
|
|
8647
8625
|
var DEFAULT_AUTO_TRACE_MAX_DEPTH = 30;
|
|
8648
8626
|
var DEFAULT_AUTO_TRACE_MAX_SPANS = 500;
|
|
8649
8627
|
var AUTO_TRACE_PROTOCOL = "ts-auto-v1";
|
|
8650
|
-
var AUTO_TRACE_POLICY_REFRESH_MS = 6e4;
|
|
8651
|
-
var AUTO_TRACE_POLICY_RETRY_MS = 1e4;
|
|
8652
8628
|
function spanOwnerName(receiver) {
|
|
8653
8629
|
if (typeof receiver === "function") {
|
|
8654
8630
|
return receiver.name !== "" ? receiver.name : void 0;
|
|
@@ -8681,7 +8657,6 @@ var Bitfab = class {
|
|
|
8681
8657
|
constructor(config) {
|
|
8682
8658
|
/** Gate the empty-key warning to fire at most once. */
|
|
8683
8659
|
this.apiKeyWarned = false;
|
|
8684
|
-
this.autoTracePolicyRefreshes = /* @__PURE__ */ new Map();
|
|
8685
8660
|
/**
|
|
8686
8661
|
* Mock overrides registered via {@link Bitfab.registerMockOverride}, applied
|
|
8687
8662
|
* to every `replay` on this client (after any per-call `mockOverride`). In
|
|
@@ -8730,12 +8705,12 @@ var Bitfab = class {
|
|
|
8730
8705
|
*
|
|
8731
8706
|
* Build instrumentation turns repository functions called beneath this
|
|
8732
8707
|
* method into nested spans that capture inputs, outputs, and errors by
|
|
8733
|
-
* default.
|
|
8734
|
-
*
|
|
8708
|
+
* default. Source exclusions and sim-plan capture-off decisions are explicit
|
|
8709
|
+
* opt-outs from that default.
|
|
8735
8710
|
* Without a compatible build transform, this still records the decorated
|
|
8736
8711
|
* method as a normal rich root span but cannot discover child calls.
|
|
8737
8712
|
*
|
|
8738
|
-
* @param traceFunctionKey - Groups traces and their capture
|
|
8713
|
+
* @param traceFunctionKey - Groups traces and their capture controls.
|
|
8739
8714
|
* @param options - Root presentation, subtree bounds, and exclusions.
|
|
8740
8715
|
* @experimental Automatic child-call instrumentation is experimental.
|
|
8741
8716
|
*/
|
|
@@ -8893,11 +8868,6 @@ var Bitfab = class {
|
|
|
8893
8868
|
traceFunctionKey,
|
|
8894
8869
|
spanOptions,
|
|
8895
8870
|
function(...args) {
|
|
8896
|
-
const capturePolicy = getAutoTraceCapturePolicy(
|
|
8897
|
-
self,
|
|
8898
|
-
traceFunctionKey
|
|
8899
|
-
);
|
|
8900
|
-
self.refreshAutoTraceCapturePolicy(traceFunctionKey);
|
|
8901
8871
|
self.simulationPlan.refresh();
|
|
8902
8872
|
let spansUsed = 0;
|
|
8903
8873
|
let truncated = false;
|
|
@@ -8977,7 +8947,7 @@ var Bitfab = class {
|
|
|
8977
8947
|
surface: "opt-out",
|
|
8978
8948
|
instrumentation: "trace",
|
|
8979
8949
|
functionId: definition.id,
|
|
8980
|
-
captureContent:
|
|
8950
|
+
captureContent: true,
|
|
8981
8951
|
autoTraceDefinition: definition,
|
|
8982
8952
|
...nodeConfiguration?.testRunId !== void 0 && {
|
|
8983
8953
|
testRunId: nodeConfiguration.testRunId
|
|
@@ -9076,34 +9046,6 @@ var Bitfab = class {
|
|
|
9076
9046
|
applySimulationPlan(payload, submit) {
|
|
9077
9047
|
this.simulationPlan.send(payload, rootTraceFunctionKeyOf(payload), submit);
|
|
9078
9048
|
}
|
|
9079
|
-
refreshAutoTraceCapturePolicy(traceFunctionKey) {
|
|
9080
|
-
const state2 = this.autoTracePolicyRefreshes.get(traceFunctionKey) ?? new PolicyRefresh();
|
|
9081
|
-
this.autoTracePolicyRefreshes.set(traceFunctionKey, state2);
|
|
9082
|
-
state2.run(
|
|
9083
|
-
() => this.httpClient.getAutoTracePolicy(
|
|
9084
|
-
traceFunctionKey,
|
|
9085
|
-
AUTO_TRACE_PROTOCOL
|
|
9086
|
-
),
|
|
9087
|
-
(policy) => {
|
|
9088
|
-
if (policy.protocol !== AUTO_TRACE_PROTOCOL) {
|
|
9089
|
-
state2.hold(AUTO_TRACE_POLICY_RETRY_MS);
|
|
9090
|
-
return;
|
|
9091
|
-
}
|
|
9092
|
-
const functionIds = Array.isArray(policy.functionIds) ? policy.functionIds.filter(
|
|
9093
|
-
(id) => typeof id === "string" && id.startsWith(`${AUTO_TRACE_PROTOCOL}:`)
|
|
9094
|
-
).slice(0, DEFAULT_AUTO_TRACE_MAX_SPANS) : [];
|
|
9095
|
-
__setBitfabAutoTraceCapturePolicy(
|
|
9096
|
-
this,
|
|
9097
|
-
traceFunctionKey,
|
|
9098
|
-
policy.revision === null ? void 0 : functionIds
|
|
9099
|
-
);
|
|
9100
|
-
state2.hold(AUTO_TRACE_POLICY_REFRESH_MS);
|
|
9101
|
-
},
|
|
9102
|
-
() => {
|
|
9103
|
-
state2.hold(AUTO_TRACE_POLICY_RETRY_MS);
|
|
9104
|
-
}
|
|
9105
|
-
);
|
|
9106
|
-
}
|
|
9107
9049
|
/**
|
|
9108
9050
|
* Flush and permanently close this client's tracing resources: its pending
|
|
9109
9051
|
* requests and the single span-transport worker shared by its decorators and
|