@bitfab/sdk 0.54.11 → 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-EG2BK73V.js → chunk-BUGCOUK6.js} +3 -3
- package/dist/{chunk-NLJLEF7Q.js → chunk-IOLVW3PT.js} +65 -60
- package/dist/chunk-IOLVW3PT.js.map +1 -0
- package/dist/{chunk-WEUG3N7A.js → chunk-M7HWCJVO.js} +2 -2
- package/dist/{chunk-GQNLAY72.js → chunk-N5T6NDR3.js} +2 -8
- package/dist/{chunk-GQNLAY72.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-MC2NKYDY.js → chunk-WDSOB57F.js} +2 -9
- package/dist/{chunk-MC2NKYDY.js.map → chunk-WDSOB57F.js.map} +1 -1
- package/dist/{http-L357FQLN.js → http-4W2BM7GE.js} +2 -2
- package/dist/{http-3NVEDIBT.js → http-Y6UGNXSO.js} +2 -2
- package/dist/index.cjs +59 -73
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +20 -21
- package/dist/index.d.ts +20 -21
- package/dist/index.js +4 -4
- package/dist/node.cjs +59 -73
- package/dist/node.cjs.map +1 -1
- package/dist/node.js +4 -4
- package/dist/{replay-ZXA5AA2M.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-NLJLEF7Q.js.map +0 -1
- /package/dist/{chunk-EG2BK73V.js.map → chunk-BUGCOUK6.js.map} +0 -0
- /package/dist/{chunk-WEUG3N7A.js.map → chunk-M7HWCJVO.js.map} +0 -0
- /package/dist/{http-3NVEDIBT.js.map → http-4W2BM7GE.js.map} +0 -0
- /package/dist/{http-L357FQLN.js.map → http-Y6UGNXSO.js.map} +0 -0
- /package/dist/{replay-ZXA5AA2M.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
|
/**
|
|
@@ -2214,18 +2213,18 @@ declare const RIVET_GROUP_EFFECT_METHODS: {
|
|
|
2214
2213
|
readonly queue: readonly ["send", "next", "nextBatch", "waitForNames", "waitForAvailable", "complete", "enqueueAndWait", "tryNext", "tryNextBatch"];
|
|
2215
2214
|
readonly run: readonly ["setWakeAt"];
|
|
2216
2215
|
};
|
|
2217
|
-
declare const RIVET_TOP_LEVEL_EFFECTS: readonly ["broadcast", "saveState", "sleep", "destroy"];
|
|
2216
|
+
declare const RIVET_TOP_LEVEL_EFFECTS: readonly ["broadcast", "saveState", "sleep", "destroy", "step", "tryStep", "try", "loop", "sleepUntil", "rollbackCheckpoint", "join", "race", "removed", "getVersion"];
|
|
2218
2217
|
type RivetGroup = keyof typeof RIVET_GROUP_EFFECT_METHODS;
|
|
2219
2218
|
type RivetGroupEffectType = {
|
|
2220
2219
|
[TGroup in RivetGroup]: `${TGroup}.${(typeof RIVET_GROUP_EFFECT_METHODS)[TGroup][number]}`;
|
|
2221
2220
|
}[RivetGroup];
|
|
2222
|
-
/**
|
|
2221
|
+
/** Rivet context operations supported as replay effects. */
|
|
2223
2222
|
type RivetEffectType = RivetGroupEffectType | (typeof RIVET_TOP_LEVEL_EFFECTS)[number] | "db.transaction.execute" | "queue.message.complete";
|
|
2224
2223
|
/** Configuration for {@link BitfabRivetIntegration}. */
|
|
2225
2224
|
interface RivetIntegrationOptions {
|
|
2226
2225
|
/**
|
|
2227
2226
|
* Context operations whose recorded outputs replay should serve instead of
|
|
2228
|
-
* executing against a live actor. Nothing is marked by default.
|
|
2227
|
+
* executing against a live actor or workflow. Nothing is marked by default.
|
|
2229
2228
|
*/
|
|
2230
2229
|
mockOnReplay?: readonly RivetEffectType[];
|
|
2231
2230
|
}
|
|
@@ -2246,8 +2245,8 @@ interface RivetIntegrationRuntime {
|
|
|
2246
2245
|
recordRootFixture(context: Record<string, unknown>, recordedRoots: Set<string>): void;
|
|
2247
2246
|
}
|
|
2248
2247
|
/**
|
|
2249
|
-
* Binds a live Rivet actor context to an existing traced function
|
|
2250
|
-
* replay-aware proxies for supported context operations.
|
|
2248
|
+
* Binds a live Rivet actor or workflow context to an existing traced function
|
|
2249
|
+
* and exposes replay-aware proxies for supported context operations.
|
|
2251
2250
|
*
|
|
2252
2251
|
* The integration never creates a trace root. Use it with the same
|
|
2253
2252
|
* `BitfabFunction` handle whose `withTrace()` wrapper is the production and
|
|
@@ -2267,13 +2266,15 @@ declare class BitfabRivetIntegration<TContext extends object = RivetContextLike>
|
|
|
2267
2266
|
withContext<TReturn>(context: TContext, fn: () => TReturn): TReturn;
|
|
2268
2267
|
/**
|
|
2269
2268
|
* Adapt a traced function into a Rivet handler whose first argument is the
|
|
2270
|
-
* live actor context. The context is not added to the traced
|
|
2269
|
+
* live actor or workflow context. The context is not added to the traced
|
|
2270
|
+
* root's inputs.
|
|
2271
2271
|
*/
|
|
2272
2272
|
bind<This, TArgs extends unknown[], TReturn>(fn: (this: This, ...args: TArgs) => TReturn): (this: This, context: TContext, ...args: TArgs) => TReturn;
|
|
2273
2273
|
/**
|
|
2274
2274
|
* Return the current Rivet context proxy. In production it delegates to the
|
|
2275
2275
|
* bound live context. During replay it hydrates recorded actor state and
|
|
2276
|
-
* intercepts supported effects without requiring a live Rivet actor
|
|
2276
|
+
* intercepts supported effects without requiring a live Rivet actor or
|
|
2277
|
+
* workflow.
|
|
2277
2278
|
*/
|
|
2278
2279
|
getContext(): TContext;
|
|
2279
2280
|
private createContextProxy;
|
|
@@ -2902,7 +2903,6 @@ declare class Bitfab {
|
|
|
2902
2903
|
readonly graders: GradersClient;
|
|
2903
2904
|
private readonly bamlClient;
|
|
2904
2905
|
private readonly dbSnapshot;
|
|
2905
|
-
private readonly autoTracePolicyRefreshes;
|
|
2906
2906
|
private readonly simulationPlan;
|
|
2907
2907
|
/**
|
|
2908
2908
|
* Mock overrides registered via {@link Bitfab.registerMockOverride}, applied
|
|
@@ -2921,12 +2921,12 @@ declare class Bitfab {
|
|
|
2921
2921
|
*
|
|
2922
2922
|
* Build instrumentation turns repository functions called beneath this
|
|
2923
2923
|
* method into nested spans that capture inputs, outputs, and errors by
|
|
2924
|
-
* default.
|
|
2925
|
-
*
|
|
2924
|
+
* default. Source exclusions and sim-plan capture-off decisions are explicit
|
|
2925
|
+
* opt-outs from that default.
|
|
2926
2926
|
* Without a compatible build transform, this still records the decorated
|
|
2927
2927
|
* method as a normal rich root span but cannot discover child calls.
|
|
2928
2928
|
*
|
|
2929
|
-
* @param traceFunctionKey - Groups traces and their capture
|
|
2929
|
+
* @param traceFunctionKey - Groups traces and their capture controls.
|
|
2930
2930
|
* @param options - Root presentation, subtree bounds, and exclusions.
|
|
2931
2931
|
* @experimental Automatic child-call instrumentation is experimental.
|
|
2932
2932
|
*/
|
|
@@ -2937,11 +2937,11 @@ declare class Bitfab {
|
|
|
2937
2937
|
* This is the function-oriented equivalent of {@link Bitfab.trace}. Build
|
|
2938
2938
|
* instrumentation turns repository functions called beneath the wrapped
|
|
2939
2939
|
* function into nested spans that capture inputs, outputs, and errors by
|
|
2940
|
-
* default.
|
|
2941
|
-
*
|
|
2942
|
-
* 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.
|
|
2943
2943
|
*
|
|
2944
|
-
* @param traceFunctionKey - Groups traces and their capture
|
|
2944
|
+
* @param traceFunctionKey - Groups traces and their capture controls.
|
|
2945
2945
|
* @param optionsOrFn - Options or the workflow entrypoint to wrap.
|
|
2946
2946
|
* @param maybeFn - Workflow entrypoint when options are provided.
|
|
2947
2947
|
* @experimental Automatic child-call instrumentation is experimental.
|
|
@@ -2980,7 +2980,6 @@ declare class Bitfab {
|
|
|
2980
2980
|
private createAutoTraceNode;
|
|
2981
2981
|
private createAutoTraceRoot;
|
|
2982
2982
|
private applySimulationPlan;
|
|
2983
|
-
private refreshAutoTraceCapturePolicy;
|
|
2984
2983
|
/**
|
|
2985
2984
|
* Flush and permanently close this client's tracing resources: its pending
|
|
2986
2985
|
* requests and the single span-transport worker shared by its decorators and
|
|
@@ -3123,9 +3122,9 @@ declare class Bitfab {
|
|
|
3123
3122
|
*/
|
|
3124
3123
|
getLangGraphIntegration(traceFunctionKey: string, options?: LangGraphIntegrationOptions): BitfabLangGraphIntegration;
|
|
3125
3124
|
/**
|
|
3126
|
-
* Get the first-class Rivet actor-context integration for an
|
|
3127
|
-
* root. The integration binds context and records effect
|
|
3128
|
-
* creates another root.
|
|
3125
|
+
* Get the first-class Rivet actor/workflow-context integration for an
|
|
3126
|
+
* existing trace root. The integration binds context and records effect
|
|
3127
|
+
* spans; it never creates another root.
|
|
3129
3128
|
*
|
|
3130
3129
|
* @param traceFunctionKey - Key used by the enclosing `withTrace()` root
|
|
3131
3130
|
* @param options - Explicit per-context-path replay mocking policy
|
|
@@ -3602,7 +3601,7 @@ interface CommitRef {
|
|
|
3602
3601
|
/**
|
|
3603
3602
|
* SDK version from package.json (injected at build time)
|
|
3604
3603
|
*/
|
|
3605
|
-
declare const __version__ = "0.54.
|
|
3604
|
+
declare const __version__ = "0.54.13";
|
|
3606
3605
|
|
|
3607
3606
|
/**
|
|
3608
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
|
/**
|
|
@@ -2214,18 +2213,18 @@ declare const RIVET_GROUP_EFFECT_METHODS: {
|
|
|
2214
2213
|
readonly queue: readonly ["send", "next", "nextBatch", "waitForNames", "waitForAvailable", "complete", "enqueueAndWait", "tryNext", "tryNextBatch"];
|
|
2215
2214
|
readonly run: readonly ["setWakeAt"];
|
|
2216
2215
|
};
|
|
2217
|
-
declare const RIVET_TOP_LEVEL_EFFECTS: readonly ["broadcast", "saveState", "sleep", "destroy"];
|
|
2216
|
+
declare const RIVET_TOP_LEVEL_EFFECTS: readonly ["broadcast", "saveState", "sleep", "destroy", "step", "tryStep", "try", "loop", "sleepUntil", "rollbackCheckpoint", "join", "race", "removed", "getVersion"];
|
|
2218
2217
|
type RivetGroup = keyof typeof RIVET_GROUP_EFFECT_METHODS;
|
|
2219
2218
|
type RivetGroupEffectType = {
|
|
2220
2219
|
[TGroup in RivetGroup]: `${TGroup}.${(typeof RIVET_GROUP_EFFECT_METHODS)[TGroup][number]}`;
|
|
2221
2220
|
}[RivetGroup];
|
|
2222
|
-
/**
|
|
2221
|
+
/** Rivet context operations supported as replay effects. */
|
|
2223
2222
|
type RivetEffectType = RivetGroupEffectType | (typeof RIVET_TOP_LEVEL_EFFECTS)[number] | "db.transaction.execute" | "queue.message.complete";
|
|
2224
2223
|
/** Configuration for {@link BitfabRivetIntegration}. */
|
|
2225
2224
|
interface RivetIntegrationOptions {
|
|
2226
2225
|
/**
|
|
2227
2226
|
* Context operations whose recorded outputs replay should serve instead of
|
|
2228
|
-
* executing against a live actor. Nothing is marked by default.
|
|
2227
|
+
* executing against a live actor or workflow. Nothing is marked by default.
|
|
2229
2228
|
*/
|
|
2230
2229
|
mockOnReplay?: readonly RivetEffectType[];
|
|
2231
2230
|
}
|
|
@@ -2246,8 +2245,8 @@ interface RivetIntegrationRuntime {
|
|
|
2246
2245
|
recordRootFixture(context: Record<string, unknown>, recordedRoots: Set<string>): void;
|
|
2247
2246
|
}
|
|
2248
2247
|
/**
|
|
2249
|
-
* Binds a live Rivet actor context to an existing traced function
|
|
2250
|
-
* replay-aware proxies for supported context operations.
|
|
2248
|
+
* Binds a live Rivet actor or workflow context to an existing traced function
|
|
2249
|
+
* and exposes replay-aware proxies for supported context operations.
|
|
2251
2250
|
*
|
|
2252
2251
|
* The integration never creates a trace root. Use it with the same
|
|
2253
2252
|
* `BitfabFunction` handle whose `withTrace()` wrapper is the production and
|
|
@@ -2267,13 +2266,15 @@ declare class BitfabRivetIntegration<TContext extends object = RivetContextLike>
|
|
|
2267
2266
|
withContext<TReturn>(context: TContext, fn: () => TReturn): TReturn;
|
|
2268
2267
|
/**
|
|
2269
2268
|
* Adapt a traced function into a Rivet handler whose first argument is the
|
|
2270
|
-
* live actor context. The context is not added to the traced
|
|
2269
|
+
* live actor or workflow context. The context is not added to the traced
|
|
2270
|
+
* root's inputs.
|
|
2271
2271
|
*/
|
|
2272
2272
|
bind<This, TArgs extends unknown[], TReturn>(fn: (this: This, ...args: TArgs) => TReturn): (this: This, context: TContext, ...args: TArgs) => TReturn;
|
|
2273
2273
|
/**
|
|
2274
2274
|
* Return the current Rivet context proxy. In production it delegates to the
|
|
2275
2275
|
* bound live context. During replay it hydrates recorded actor state and
|
|
2276
|
-
* intercepts supported effects without requiring a live Rivet actor
|
|
2276
|
+
* intercepts supported effects without requiring a live Rivet actor or
|
|
2277
|
+
* workflow.
|
|
2277
2278
|
*/
|
|
2278
2279
|
getContext(): TContext;
|
|
2279
2280
|
private createContextProxy;
|
|
@@ -2902,7 +2903,6 @@ declare class Bitfab {
|
|
|
2902
2903
|
readonly graders: GradersClient;
|
|
2903
2904
|
private readonly bamlClient;
|
|
2904
2905
|
private readonly dbSnapshot;
|
|
2905
|
-
private readonly autoTracePolicyRefreshes;
|
|
2906
2906
|
private readonly simulationPlan;
|
|
2907
2907
|
/**
|
|
2908
2908
|
* Mock overrides registered via {@link Bitfab.registerMockOverride}, applied
|
|
@@ -2921,12 +2921,12 @@ declare class Bitfab {
|
|
|
2921
2921
|
*
|
|
2922
2922
|
* Build instrumentation turns repository functions called beneath this
|
|
2923
2923
|
* method into nested spans that capture inputs, outputs, and errors by
|
|
2924
|
-
* default.
|
|
2925
|
-
*
|
|
2924
|
+
* default. Source exclusions and sim-plan capture-off decisions are explicit
|
|
2925
|
+
* opt-outs from that default.
|
|
2926
2926
|
* Without a compatible build transform, this still records the decorated
|
|
2927
2927
|
* method as a normal rich root span but cannot discover child calls.
|
|
2928
2928
|
*
|
|
2929
|
-
* @param traceFunctionKey - Groups traces and their capture
|
|
2929
|
+
* @param traceFunctionKey - Groups traces and their capture controls.
|
|
2930
2930
|
* @param options - Root presentation, subtree bounds, and exclusions.
|
|
2931
2931
|
* @experimental Automatic child-call instrumentation is experimental.
|
|
2932
2932
|
*/
|
|
@@ -2937,11 +2937,11 @@ declare class Bitfab {
|
|
|
2937
2937
|
* This is the function-oriented equivalent of {@link Bitfab.trace}. Build
|
|
2938
2938
|
* instrumentation turns repository functions called beneath the wrapped
|
|
2939
2939
|
* function into nested spans that capture inputs, outputs, and errors by
|
|
2940
|
-
* default.
|
|
2941
|
-
*
|
|
2942
|
-
* 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.
|
|
2943
2943
|
*
|
|
2944
|
-
* @param traceFunctionKey - Groups traces and their capture
|
|
2944
|
+
* @param traceFunctionKey - Groups traces and their capture controls.
|
|
2945
2945
|
* @param optionsOrFn - Options or the workflow entrypoint to wrap.
|
|
2946
2946
|
* @param maybeFn - Workflow entrypoint when options are provided.
|
|
2947
2947
|
* @experimental Automatic child-call instrumentation is experimental.
|
|
@@ -2980,7 +2980,6 @@ declare class Bitfab {
|
|
|
2980
2980
|
private createAutoTraceNode;
|
|
2981
2981
|
private createAutoTraceRoot;
|
|
2982
2982
|
private applySimulationPlan;
|
|
2983
|
-
private refreshAutoTraceCapturePolicy;
|
|
2984
2983
|
/**
|
|
2985
2984
|
* Flush and permanently close this client's tracing resources: its pending
|
|
2986
2985
|
* requests and the single span-transport worker shared by its decorators and
|
|
@@ -3123,9 +3122,9 @@ declare class Bitfab {
|
|
|
3123
3122
|
*/
|
|
3124
3123
|
getLangGraphIntegration(traceFunctionKey: string, options?: LangGraphIntegrationOptions): BitfabLangGraphIntegration;
|
|
3125
3124
|
/**
|
|
3126
|
-
* Get the first-class Rivet actor-context integration for an
|
|
3127
|
-
* root. The integration binds context and records effect
|
|
3128
|
-
* creates another root.
|
|
3125
|
+
* Get the first-class Rivet actor/workflow-context integration for an
|
|
3126
|
+
* existing trace root. The integration binds context and records effect
|
|
3127
|
+
* spans; it never creates another root.
|
|
3129
3128
|
*
|
|
3130
3129
|
* @param traceFunctionKey - Key used by the enclosing `withTrace()` root
|
|
3131
3130
|
* @param options - Explicit per-context-path replay mocking policy
|
|
@@ -3602,7 +3601,7 @@ interface CommitRef {
|
|
|
3602
3601
|
/**
|
|
3603
3602
|
* SDK version from package.json (injected at build time)
|
|
3604
3603
|
*/
|
|
3605
|
-
declare const __version__ = "0.54.
|
|
3604
|
+
declare const __version__ = "0.54.13";
|
|
3606
3605
|
|
|
3607
3606
|
/**
|
|
3608
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
|
|
|
@@ -7211,18 +7189,42 @@ var RIVET_TOP_LEVEL_EFFECTS = [
|
|
|
7211
7189
|
"broadcast",
|
|
7212
7190
|
"saveState",
|
|
7213
7191
|
"sleep",
|
|
7214
|
-
"destroy"
|
|
7192
|
+
"destroy",
|
|
7193
|
+
"step",
|
|
7194
|
+
"tryStep",
|
|
7195
|
+
"try",
|
|
7196
|
+
"loop",
|
|
7197
|
+
"sleepUntil",
|
|
7198
|
+
"rollbackCheckpoint",
|
|
7199
|
+
"join",
|
|
7200
|
+
"race",
|
|
7201
|
+
"removed",
|
|
7202
|
+
"getVersion"
|
|
7215
7203
|
];
|
|
7216
7204
|
var TOP_LEVEL_UNAVAILABLE_CAPABILITIES = /* @__PURE__ */ new Set([
|
|
7217
7205
|
"conn",
|
|
7218
7206
|
"conns",
|
|
7219
|
-
"log",
|
|
7220
7207
|
"request",
|
|
7221
7208
|
"actorRuntimeSocket",
|
|
7222
7209
|
"keepAwake",
|
|
7223
7210
|
"waitUntil",
|
|
7224
7211
|
"client"
|
|
7225
7212
|
]);
|
|
7213
|
+
var replayLog = () => void 0;
|
|
7214
|
+
var replayLogger = {
|
|
7215
|
+
level: "silent",
|
|
7216
|
+
msgPrefix: void 0,
|
|
7217
|
+
fatal: replayLog,
|
|
7218
|
+
trace: replayLog,
|
|
7219
|
+
silent: replayLog,
|
|
7220
|
+
debug: replayLog,
|
|
7221
|
+
info: replayLog,
|
|
7222
|
+
warn: replayLog,
|
|
7223
|
+
error: replayLog,
|
|
7224
|
+
child: () => replayLogger,
|
|
7225
|
+
bindings: () => ({}),
|
|
7226
|
+
isLevelEnabled: () => false
|
|
7227
|
+
};
|
|
7226
7228
|
var SYNC_VOID_EFFECTS = /* @__PURE__ */ new Set([
|
|
7227
7229
|
"broadcast",
|
|
7228
7230
|
"sleep",
|
|
@@ -7252,16 +7254,28 @@ function snapshotContext(context) {
|
|
|
7252
7254
|
"state",
|
|
7253
7255
|
"vars",
|
|
7254
7256
|
"actorId",
|
|
7257
|
+
"workflowId",
|
|
7255
7258
|
"name",
|
|
7256
7259
|
"key",
|
|
7257
|
-
"region"
|
|
7258
|
-
"aborted"
|
|
7260
|
+
"region"
|
|
7259
7261
|
]) {
|
|
7260
7262
|
const value = readProperty(source, property);
|
|
7261
7263
|
if (value !== void 0) {
|
|
7262
7264
|
snapshot[property] = value;
|
|
7263
7265
|
}
|
|
7264
7266
|
}
|
|
7267
|
+
const aborted = readProperty(source, "aborted");
|
|
7268
|
+
if (typeof aborted === "boolean") {
|
|
7269
|
+
snapshot.aborted = aborted;
|
|
7270
|
+
} else {
|
|
7271
|
+
const abortSignal = readProperty(source, "abortSignal");
|
|
7272
|
+
if (isRecord5(abortSignal)) {
|
|
7273
|
+
const signalAborted = readProperty(abortSignal, "aborted");
|
|
7274
|
+
if (typeof signalAborted === "boolean") {
|
|
7275
|
+
snapshot.aborted = signalAborted;
|
|
7276
|
+
}
|
|
7277
|
+
}
|
|
7278
|
+
}
|
|
7265
7279
|
return snapshot;
|
|
7266
7280
|
}
|
|
7267
7281
|
function unavailableCapability(path) {
|
|
@@ -7353,7 +7367,8 @@ var BitfabRivetIntegration = class {
|
|
|
7353
7367
|
}
|
|
7354
7368
|
/**
|
|
7355
7369
|
* Adapt a traced function into a Rivet handler whose first argument is the
|
|
7356
|
-
* live actor context. The context is not added to the traced
|
|
7370
|
+
* live actor or workflow context. The context is not added to the traced
|
|
7371
|
+
* root's inputs.
|
|
7357
7372
|
*/
|
|
7358
7373
|
bind(fn) {
|
|
7359
7374
|
const integration = this;
|
|
@@ -7364,7 +7379,8 @@ var BitfabRivetIntegration = class {
|
|
|
7364
7379
|
/**
|
|
7365
7380
|
* Return the current Rivet context proxy. In production it delegates to the
|
|
7366
7381
|
* bound live context. During replay it hydrates recorded actor state and
|
|
7367
|
-
* intercepts supported effects without requiring a live Rivet actor
|
|
7382
|
+
* intercepts supported effects without requiring a live Rivet actor or
|
|
7383
|
+
* workflow.
|
|
7368
7384
|
*/
|
|
7369
7385
|
getContext() {
|
|
7370
7386
|
const replay2 = getReplayContext();
|
|
@@ -7448,6 +7464,12 @@ var BitfabRivetIntegration = class {
|
|
|
7448
7464
|
if (property === "setPreventSleep" && replay2) {
|
|
7449
7465
|
return (_preventSleep) => void 0;
|
|
7450
7466
|
}
|
|
7467
|
+
if (property === "isEvicted" && replay2) {
|
|
7468
|
+
return () => replayTarget.abortSignal?.aborted === true;
|
|
7469
|
+
}
|
|
7470
|
+
if (property === "log" && replay2) {
|
|
7471
|
+
return replayLogger;
|
|
7472
|
+
}
|
|
7451
7473
|
if (replay2 && typeof property === "string" && TOP_LEVEL_UNAVAILABLE_CAPABILITIES.has(property)) {
|
|
7452
7474
|
throw unavailableCapability(property);
|
|
7453
7475
|
}
|
|
@@ -7621,7 +7643,7 @@ var BitfabRivetIntegration = class {
|
|
|
7621
7643
|
return { ...value, complete };
|
|
7622
7644
|
}
|
|
7623
7645
|
queueCallIsCompletable(effect, args) {
|
|
7624
|
-
const options = effect === "queue.waitForNames" ? args[1] : args[0];
|
|
7646
|
+
const options = effect === "queue.waitForNames" || (effect === "queue.next" || effect === "queue.nextBatch") && typeof args[0] === "string" ? args[1] : args[0];
|
|
7625
7647
|
return isRecord5(options) && options.completable === true;
|
|
7626
7648
|
}
|
|
7627
7649
|
createQueueIterator(queue, options) {
|
|
@@ -8603,8 +8625,6 @@ function readBooleanEnv(name) {
|
|
|
8603
8625
|
var DEFAULT_AUTO_TRACE_MAX_DEPTH = 30;
|
|
8604
8626
|
var DEFAULT_AUTO_TRACE_MAX_SPANS = 500;
|
|
8605
8627
|
var AUTO_TRACE_PROTOCOL = "ts-auto-v1";
|
|
8606
|
-
var AUTO_TRACE_POLICY_REFRESH_MS = 6e4;
|
|
8607
|
-
var AUTO_TRACE_POLICY_RETRY_MS = 1e4;
|
|
8608
8628
|
function spanOwnerName(receiver) {
|
|
8609
8629
|
if (typeof receiver === "function") {
|
|
8610
8630
|
return receiver.name !== "" ? receiver.name : void 0;
|
|
@@ -8637,7 +8657,6 @@ var Bitfab = class {
|
|
|
8637
8657
|
constructor(config) {
|
|
8638
8658
|
/** Gate the empty-key warning to fire at most once. */
|
|
8639
8659
|
this.apiKeyWarned = false;
|
|
8640
|
-
this.autoTracePolicyRefreshes = /* @__PURE__ */ new Map();
|
|
8641
8660
|
/**
|
|
8642
8661
|
* Mock overrides registered via {@link Bitfab.registerMockOverride}, applied
|
|
8643
8662
|
* to every `replay` on this client (after any per-call `mockOverride`). In
|
|
@@ -8686,12 +8705,12 @@ var Bitfab = class {
|
|
|
8686
8705
|
*
|
|
8687
8706
|
* Build instrumentation turns repository functions called beneath this
|
|
8688
8707
|
* method into nested spans that capture inputs, outputs, and errors by
|
|
8689
|
-
* default.
|
|
8690
|
-
*
|
|
8708
|
+
* default. Source exclusions and sim-plan capture-off decisions are explicit
|
|
8709
|
+
* opt-outs from that default.
|
|
8691
8710
|
* Without a compatible build transform, this still records the decorated
|
|
8692
8711
|
* method as a normal rich root span but cannot discover child calls.
|
|
8693
8712
|
*
|
|
8694
|
-
* @param traceFunctionKey - Groups traces and their capture
|
|
8713
|
+
* @param traceFunctionKey - Groups traces and their capture controls.
|
|
8695
8714
|
* @param options - Root presentation, subtree bounds, and exclusions.
|
|
8696
8715
|
* @experimental Automatic child-call instrumentation is experimental.
|
|
8697
8716
|
*/
|
|
@@ -8849,11 +8868,6 @@ var Bitfab = class {
|
|
|
8849
8868
|
traceFunctionKey,
|
|
8850
8869
|
spanOptions,
|
|
8851
8870
|
function(...args) {
|
|
8852
|
-
const capturePolicy = getAutoTraceCapturePolicy(
|
|
8853
|
-
self,
|
|
8854
|
-
traceFunctionKey
|
|
8855
|
-
);
|
|
8856
|
-
self.refreshAutoTraceCapturePolicy(traceFunctionKey);
|
|
8857
8871
|
self.simulationPlan.refresh();
|
|
8858
8872
|
let spansUsed = 0;
|
|
8859
8873
|
let truncated = false;
|
|
@@ -8933,7 +8947,7 @@ var Bitfab = class {
|
|
|
8933
8947
|
surface: "opt-out",
|
|
8934
8948
|
instrumentation: "trace",
|
|
8935
8949
|
functionId: definition.id,
|
|
8936
|
-
captureContent:
|
|
8950
|
+
captureContent: true,
|
|
8937
8951
|
autoTraceDefinition: definition,
|
|
8938
8952
|
...nodeConfiguration?.testRunId !== void 0 && {
|
|
8939
8953
|
testRunId: nodeConfiguration.testRunId
|
|
@@ -9032,34 +9046,6 @@ var Bitfab = class {
|
|
|
9032
9046
|
applySimulationPlan(payload, submit) {
|
|
9033
9047
|
this.simulationPlan.send(payload, rootTraceFunctionKeyOf(payload), submit);
|
|
9034
9048
|
}
|
|
9035
|
-
refreshAutoTraceCapturePolicy(traceFunctionKey) {
|
|
9036
|
-
const state2 = this.autoTracePolicyRefreshes.get(traceFunctionKey) ?? new PolicyRefresh();
|
|
9037
|
-
this.autoTracePolicyRefreshes.set(traceFunctionKey, state2);
|
|
9038
|
-
state2.run(
|
|
9039
|
-
() => this.httpClient.getAutoTracePolicy(
|
|
9040
|
-
traceFunctionKey,
|
|
9041
|
-
AUTO_TRACE_PROTOCOL
|
|
9042
|
-
),
|
|
9043
|
-
(policy) => {
|
|
9044
|
-
if (policy.protocol !== AUTO_TRACE_PROTOCOL) {
|
|
9045
|
-
state2.hold(AUTO_TRACE_POLICY_RETRY_MS);
|
|
9046
|
-
return;
|
|
9047
|
-
}
|
|
9048
|
-
const functionIds = Array.isArray(policy.functionIds) ? policy.functionIds.filter(
|
|
9049
|
-
(id) => typeof id === "string" && id.startsWith(`${AUTO_TRACE_PROTOCOL}:`)
|
|
9050
|
-
).slice(0, DEFAULT_AUTO_TRACE_MAX_SPANS) : [];
|
|
9051
|
-
__setBitfabAutoTraceCapturePolicy(
|
|
9052
|
-
this,
|
|
9053
|
-
traceFunctionKey,
|
|
9054
|
-
policy.revision === null ? void 0 : functionIds
|
|
9055
|
-
);
|
|
9056
|
-
state2.hold(AUTO_TRACE_POLICY_REFRESH_MS);
|
|
9057
|
-
},
|
|
9058
|
-
() => {
|
|
9059
|
-
state2.hold(AUTO_TRACE_POLICY_RETRY_MS);
|
|
9060
|
-
}
|
|
9061
|
-
);
|
|
9062
|
-
}
|
|
9063
9049
|
/**
|
|
9064
9050
|
* Flush and permanently close this client's tracing resources: its pending
|
|
9065
9051
|
* requests and the single span-transport worker shared by its decorators and
|
|
@@ -9362,9 +9348,9 @@ var Bitfab = class {
|
|
|
9362
9348
|
});
|
|
9363
9349
|
}
|
|
9364
9350
|
/**
|
|
9365
|
-
* Get the first-class Rivet actor-context integration for an
|
|
9366
|
-
* root. The integration binds context and records effect
|
|
9367
|
-
* creates another root.
|
|
9351
|
+
* Get the first-class Rivet actor/workflow-context integration for an
|
|
9352
|
+
* existing trace root. The integration binds context and records effect
|
|
9353
|
+
* spans; it never creates another root.
|
|
9368
9354
|
*
|
|
9369
9355
|
* @param traceFunctionKey - Key used by the enclosing `withTrace()` root
|
|
9370
9356
|
* @param options - Explicit per-context-path replay mocking policy
|