bitfab 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-G4LWALQ7.js → chunk-FZNRSEMN.js} +2 -2
- package/dist/{chunk-2C7M3Y3H.js → chunk-KPALXSAF.js} +3 -3
- package/dist/{chunk-MEJOPEKV.js → chunk-Q7HDNYYY.js} +65 -60
- package/dist/chunk-Q7HDNYYY.js.map +1 -0
- package/dist/{chunk-EGWJYCNT.js → chunk-RCHSYWKI.js} +2 -19
- package/dist/chunk-RCHSYWKI.js.map +1 -0
- package/dist/{chunk-RUBVHBIK.js → chunk-VW7MA7DS.js} +2 -8
- package/dist/{chunk-RUBVHBIK.js.map → chunk-VW7MA7DS.js.map} +1 -1
- package/dist/{chunk-FMUJONTQ.js → chunk-YKOD4GWI.js} +2 -9
- package/dist/{chunk-FMUJONTQ.js.map → chunk-YKOD4GWI.js.map} +1 -1
- package/dist/{http-AXPT27DO.js → http-42KAFBUN.js} +2 -2
- package/dist/{http-JQN2LHHF.js → http-7PF6XCJR.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-DOG4KV7I.js → replay-5RHBDIEK.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-MEJOPEKV.js.map +0 -1
- /package/dist/{chunk-G4LWALQ7.js.map → chunk-FZNRSEMN.js.map} +0 -0
- /package/dist/{chunk-2C7M3Y3H.js.map → chunk-KPALXSAF.js.map} +0 -0
- /package/dist/{http-AXPT27DO.js.map → http-42KAFBUN.js.map} +0 -0
- /package/dist/{http-JQN2LHHF.js.map → http-7PF6XCJR.js.map} +0 -0
- /package/dist/{replay-DOG4KV7I.js.map → replay-5RHBDIEK.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
|
@@ -30,8 +30,8 @@ import {
|
|
|
30
30
|
getCurrentTrace,
|
|
31
31
|
reseedFromRegistry,
|
|
32
32
|
seedFromRegistry
|
|
33
|
-
} from "./chunk-
|
|
34
|
-
import "./chunk-
|
|
33
|
+
} from "./chunk-Q7HDNYYY.js";
|
|
34
|
+
import "./chunk-RCHSYWKI.js";
|
|
35
35
|
import {
|
|
36
36
|
BITFAB_PROGRESS_PREFIX,
|
|
37
37
|
DbBranchReplayError,
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
ReplayError,
|
|
40
40
|
reportReplayProgress,
|
|
41
41
|
serializeReplayResult
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-FZNRSEMN.js";
|
|
43
43
|
import {
|
|
44
44
|
BitfabError,
|
|
45
45
|
DEFAULT_SERVICE_URL,
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
MixedTracingError,
|
|
48
48
|
__version__,
|
|
49
49
|
flushTraces
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-YKOD4GWI.js";
|
|
51
51
|
import "./chunk-VCRFFCLY.js";
|
|
52
52
|
export {
|
|
53
53
|
AssertionCategoriesClient,
|
package/dist/node.cjs
CHANGED
|
@@ -97,7 +97,7 @@ var __version__, __packageName__;
|
|
|
97
97
|
var init_version_generated = __esm({
|
|
98
98
|
"src/version.generated.ts"() {
|
|
99
99
|
"use strict";
|
|
100
|
-
__version__ = "0.54.
|
|
100
|
+
__version__ = "0.54.13";
|
|
101
101
|
__packageName__ = "bitfab";
|
|
102
102
|
}
|
|
103
103
|
});
|
|
@@ -2673,12 +2673,6 @@ var init_http = __esm({
|
|
|
2673
2673
|
async lookupFunction(name) {
|
|
2674
2674
|
return this.request("/api/sdk/functions/lookup", { name });
|
|
2675
2675
|
}
|
|
2676
|
-
async getAutoTracePolicy(traceFunctionKey, protocol) {
|
|
2677
|
-
return this.request("/api/sdk/auto-trace/policy", {
|
|
2678
|
-
traceFunctionKey,
|
|
2679
|
-
protocol
|
|
2680
|
-
});
|
|
2681
|
-
}
|
|
2682
2676
|
async getSimulationPlan() {
|
|
2683
2677
|
return this.get(
|
|
2684
2678
|
"/api/sdk/sim-plan",
|
|
@@ -5209,21 +5203,6 @@ function currentAutoTraceScope() {
|
|
|
5209
5203
|
initializeAutoTraceStorage();
|
|
5210
5204
|
return autoTraceState.storage?.getStore() ?? autoTraceState.browserScope;
|
|
5211
5205
|
}
|
|
5212
|
-
function __setBitfabAutoTraceCapturePolicy(client, traceFunctionKey, functionIds) {
|
|
5213
|
-
const policies = autoTraceState.capturePolicies.get(client) ?? /* @__PURE__ */ new Map();
|
|
5214
|
-
if (functionIds === void 0) {
|
|
5215
|
-
policies.delete(traceFunctionKey);
|
|
5216
|
-
if (policies.size === 0) {
|
|
5217
|
-
autoTraceState.capturePolicies.delete(client);
|
|
5218
|
-
}
|
|
5219
|
-
return;
|
|
5220
|
-
}
|
|
5221
|
-
policies.set(traceFunctionKey, new Set(functionIds));
|
|
5222
|
-
autoTraceState.capturePolicies.set(client, policies);
|
|
5223
|
-
}
|
|
5224
|
-
function getAutoTraceCapturePolicy(client, traceFunctionKey) {
|
|
5225
|
-
return autoTraceState.capturePolicies.get(client)?.get(traceFunctionKey);
|
|
5226
|
-
}
|
|
5227
5206
|
|
|
5228
5207
|
// src/optionalPeer.ts
|
|
5229
5208
|
function importOptionalPeer(specifierParts) {
|
|
@@ -7072,7 +7051,6 @@ function openAiAgentsParentSpanId(bitfabTraceId, enclosingSpanIds) {
|
|
|
7072
7051
|
}
|
|
7073
7052
|
|
|
7074
7053
|
// src/client.ts
|
|
7075
|
-
init_policyRefresh();
|
|
7076
7054
|
init_randomUuid();
|
|
7077
7055
|
init_replay();
|
|
7078
7056
|
|
|
@@ -7220,18 +7198,42 @@ var RIVET_TOP_LEVEL_EFFECTS = [
|
|
|
7220
7198
|
"broadcast",
|
|
7221
7199
|
"saveState",
|
|
7222
7200
|
"sleep",
|
|
7223
|
-
"destroy"
|
|
7201
|
+
"destroy",
|
|
7202
|
+
"step",
|
|
7203
|
+
"tryStep",
|
|
7204
|
+
"try",
|
|
7205
|
+
"loop",
|
|
7206
|
+
"sleepUntil",
|
|
7207
|
+
"rollbackCheckpoint",
|
|
7208
|
+
"join",
|
|
7209
|
+
"race",
|
|
7210
|
+
"removed",
|
|
7211
|
+
"getVersion"
|
|
7224
7212
|
];
|
|
7225
7213
|
var TOP_LEVEL_UNAVAILABLE_CAPABILITIES = /* @__PURE__ */ new Set([
|
|
7226
7214
|
"conn",
|
|
7227
7215
|
"conns",
|
|
7228
|
-
"log",
|
|
7229
7216
|
"request",
|
|
7230
7217
|
"actorRuntimeSocket",
|
|
7231
7218
|
"keepAwake",
|
|
7232
7219
|
"waitUntil",
|
|
7233
7220
|
"client"
|
|
7234
7221
|
]);
|
|
7222
|
+
var replayLog = () => void 0;
|
|
7223
|
+
var replayLogger = {
|
|
7224
|
+
level: "silent",
|
|
7225
|
+
msgPrefix: void 0,
|
|
7226
|
+
fatal: replayLog,
|
|
7227
|
+
trace: replayLog,
|
|
7228
|
+
silent: replayLog,
|
|
7229
|
+
debug: replayLog,
|
|
7230
|
+
info: replayLog,
|
|
7231
|
+
warn: replayLog,
|
|
7232
|
+
error: replayLog,
|
|
7233
|
+
child: () => replayLogger,
|
|
7234
|
+
bindings: () => ({}),
|
|
7235
|
+
isLevelEnabled: () => false
|
|
7236
|
+
};
|
|
7235
7237
|
var SYNC_VOID_EFFECTS = /* @__PURE__ */ new Set([
|
|
7236
7238
|
"broadcast",
|
|
7237
7239
|
"sleep",
|
|
@@ -7261,16 +7263,28 @@ function snapshotContext(context) {
|
|
|
7261
7263
|
"state",
|
|
7262
7264
|
"vars",
|
|
7263
7265
|
"actorId",
|
|
7266
|
+
"workflowId",
|
|
7264
7267
|
"name",
|
|
7265
7268
|
"key",
|
|
7266
|
-
"region"
|
|
7267
|
-
"aborted"
|
|
7269
|
+
"region"
|
|
7268
7270
|
]) {
|
|
7269
7271
|
const value = readProperty(source, property);
|
|
7270
7272
|
if (value !== void 0) {
|
|
7271
7273
|
snapshot[property] = value;
|
|
7272
7274
|
}
|
|
7273
7275
|
}
|
|
7276
|
+
const aborted = readProperty(source, "aborted");
|
|
7277
|
+
if (typeof aborted === "boolean") {
|
|
7278
|
+
snapshot.aborted = aborted;
|
|
7279
|
+
} else {
|
|
7280
|
+
const abortSignal = readProperty(source, "abortSignal");
|
|
7281
|
+
if (isRecord5(abortSignal)) {
|
|
7282
|
+
const signalAborted = readProperty(abortSignal, "aborted");
|
|
7283
|
+
if (typeof signalAborted === "boolean") {
|
|
7284
|
+
snapshot.aborted = signalAborted;
|
|
7285
|
+
}
|
|
7286
|
+
}
|
|
7287
|
+
}
|
|
7274
7288
|
return snapshot;
|
|
7275
7289
|
}
|
|
7276
7290
|
function unavailableCapability(path) {
|
|
@@ -7362,7 +7376,8 @@ var BitfabRivetIntegration = class {
|
|
|
7362
7376
|
}
|
|
7363
7377
|
/**
|
|
7364
7378
|
* Adapt a traced function into a Rivet handler whose first argument is the
|
|
7365
|
-
* live actor context. The context is not added to the traced
|
|
7379
|
+
* live actor or workflow context. The context is not added to the traced
|
|
7380
|
+
* root's inputs.
|
|
7366
7381
|
*/
|
|
7367
7382
|
bind(fn) {
|
|
7368
7383
|
const integration = this;
|
|
@@ -7373,7 +7388,8 @@ var BitfabRivetIntegration = class {
|
|
|
7373
7388
|
/**
|
|
7374
7389
|
* Return the current Rivet context proxy. In production it delegates to the
|
|
7375
7390
|
* bound live context. During replay it hydrates recorded actor state and
|
|
7376
|
-
* intercepts supported effects without requiring a live Rivet actor
|
|
7391
|
+
* intercepts supported effects without requiring a live Rivet actor or
|
|
7392
|
+
* workflow.
|
|
7377
7393
|
*/
|
|
7378
7394
|
getContext() {
|
|
7379
7395
|
const replay2 = getReplayContext();
|
|
@@ -7457,6 +7473,12 @@ var BitfabRivetIntegration = class {
|
|
|
7457
7473
|
if (property === "setPreventSleep" && replay2) {
|
|
7458
7474
|
return (_preventSleep) => void 0;
|
|
7459
7475
|
}
|
|
7476
|
+
if (property === "isEvicted" && replay2) {
|
|
7477
|
+
return () => replayTarget.abortSignal?.aborted === true;
|
|
7478
|
+
}
|
|
7479
|
+
if (property === "log" && replay2) {
|
|
7480
|
+
return replayLogger;
|
|
7481
|
+
}
|
|
7460
7482
|
if (replay2 && typeof property === "string" && TOP_LEVEL_UNAVAILABLE_CAPABILITIES.has(property)) {
|
|
7461
7483
|
throw unavailableCapability(property);
|
|
7462
7484
|
}
|
|
@@ -7630,7 +7652,7 @@ var BitfabRivetIntegration = class {
|
|
|
7630
7652
|
return { ...value, complete };
|
|
7631
7653
|
}
|
|
7632
7654
|
queueCallIsCompletable(effect, args) {
|
|
7633
|
-
const options = effect === "queue.waitForNames" ? args[1] : args[0];
|
|
7655
|
+
const options = effect === "queue.waitForNames" || (effect === "queue.next" || effect === "queue.nextBatch") && typeof args[0] === "string" ? args[1] : args[0];
|
|
7634
7656
|
return isRecord5(options) && options.completable === true;
|
|
7635
7657
|
}
|
|
7636
7658
|
createQueueIterator(queue, options) {
|
|
@@ -8612,8 +8634,6 @@ function readBooleanEnv(name) {
|
|
|
8612
8634
|
var DEFAULT_AUTO_TRACE_MAX_DEPTH = 30;
|
|
8613
8635
|
var DEFAULT_AUTO_TRACE_MAX_SPANS = 500;
|
|
8614
8636
|
var AUTO_TRACE_PROTOCOL = "ts-auto-v1";
|
|
8615
|
-
var AUTO_TRACE_POLICY_REFRESH_MS = 6e4;
|
|
8616
|
-
var AUTO_TRACE_POLICY_RETRY_MS = 1e4;
|
|
8617
8637
|
function spanOwnerName(receiver) {
|
|
8618
8638
|
if (typeof receiver === "function") {
|
|
8619
8639
|
return receiver.name !== "" ? receiver.name : void 0;
|
|
@@ -8646,7 +8666,6 @@ var Bitfab = class {
|
|
|
8646
8666
|
constructor(config) {
|
|
8647
8667
|
/** Gate the empty-key warning to fire at most once. */
|
|
8648
8668
|
this.apiKeyWarned = false;
|
|
8649
|
-
this.autoTracePolicyRefreshes = /* @__PURE__ */ new Map();
|
|
8650
8669
|
/**
|
|
8651
8670
|
* Mock overrides registered via {@link Bitfab.registerMockOverride}, applied
|
|
8652
8671
|
* to every `replay` on this client (after any per-call `mockOverride`). In
|
|
@@ -8695,12 +8714,12 @@ var Bitfab = class {
|
|
|
8695
8714
|
*
|
|
8696
8715
|
* Build instrumentation turns repository functions called beneath this
|
|
8697
8716
|
* method into nested spans that capture inputs, outputs, and errors by
|
|
8698
|
-
* default.
|
|
8699
|
-
*
|
|
8717
|
+
* default. Source exclusions and sim-plan capture-off decisions are explicit
|
|
8718
|
+
* opt-outs from that default.
|
|
8700
8719
|
* Without a compatible build transform, this still records the decorated
|
|
8701
8720
|
* method as a normal rich root span but cannot discover child calls.
|
|
8702
8721
|
*
|
|
8703
|
-
* @param traceFunctionKey - Groups traces and their capture
|
|
8722
|
+
* @param traceFunctionKey - Groups traces and their capture controls.
|
|
8704
8723
|
* @param options - Root presentation, subtree bounds, and exclusions.
|
|
8705
8724
|
* @experimental Automatic child-call instrumentation is experimental.
|
|
8706
8725
|
*/
|
|
@@ -8858,11 +8877,6 @@ var Bitfab = class {
|
|
|
8858
8877
|
traceFunctionKey,
|
|
8859
8878
|
spanOptions,
|
|
8860
8879
|
function(...args) {
|
|
8861
|
-
const capturePolicy = getAutoTraceCapturePolicy(
|
|
8862
|
-
self,
|
|
8863
|
-
traceFunctionKey
|
|
8864
|
-
);
|
|
8865
|
-
self.refreshAutoTraceCapturePolicy(traceFunctionKey);
|
|
8866
8880
|
self.simulationPlan.refresh();
|
|
8867
8881
|
let spansUsed = 0;
|
|
8868
8882
|
let truncated = false;
|
|
@@ -8942,7 +8956,7 @@ var Bitfab = class {
|
|
|
8942
8956
|
surface: "opt-out",
|
|
8943
8957
|
instrumentation: "trace",
|
|
8944
8958
|
functionId: definition.id,
|
|
8945
|
-
captureContent:
|
|
8959
|
+
captureContent: true,
|
|
8946
8960
|
autoTraceDefinition: definition,
|
|
8947
8961
|
...nodeConfiguration?.testRunId !== void 0 && {
|
|
8948
8962
|
testRunId: nodeConfiguration.testRunId
|
|
@@ -9041,34 +9055,6 @@ var Bitfab = class {
|
|
|
9041
9055
|
applySimulationPlan(payload, submit) {
|
|
9042
9056
|
this.simulationPlan.send(payload, rootTraceFunctionKeyOf(payload), submit);
|
|
9043
9057
|
}
|
|
9044
|
-
refreshAutoTraceCapturePolicy(traceFunctionKey) {
|
|
9045
|
-
const state2 = this.autoTracePolicyRefreshes.get(traceFunctionKey) ?? new PolicyRefresh();
|
|
9046
|
-
this.autoTracePolicyRefreshes.set(traceFunctionKey, state2);
|
|
9047
|
-
state2.run(
|
|
9048
|
-
() => this.httpClient.getAutoTracePolicy(
|
|
9049
|
-
traceFunctionKey,
|
|
9050
|
-
AUTO_TRACE_PROTOCOL
|
|
9051
|
-
),
|
|
9052
|
-
(policy) => {
|
|
9053
|
-
if (policy.protocol !== AUTO_TRACE_PROTOCOL) {
|
|
9054
|
-
state2.hold(AUTO_TRACE_POLICY_RETRY_MS);
|
|
9055
|
-
return;
|
|
9056
|
-
}
|
|
9057
|
-
const functionIds = Array.isArray(policy.functionIds) ? policy.functionIds.filter(
|
|
9058
|
-
(id) => typeof id === "string" && id.startsWith(`${AUTO_TRACE_PROTOCOL}:`)
|
|
9059
|
-
).slice(0, DEFAULT_AUTO_TRACE_MAX_SPANS) : [];
|
|
9060
|
-
__setBitfabAutoTraceCapturePolicy(
|
|
9061
|
-
this,
|
|
9062
|
-
traceFunctionKey,
|
|
9063
|
-
policy.revision === null ? void 0 : functionIds
|
|
9064
|
-
);
|
|
9065
|
-
state2.hold(AUTO_TRACE_POLICY_REFRESH_MS);
|
|
9066
|
-
},
|
|
9067
|
-
() => {
|
|
9068
|
-
state2.hold(AUTO_TRACE_POLICY_RETRY_MS);
|
|
9069
|
-
}
|
|
9070
|
-
);
|
|
9071
|
-
}
|
|
9072
9058
|
/**
|
|
9073
9059
|
* Flush and permanently close this client's tracing resources: its pending
|
|
9074
9060
|
* requests and the single span-transport worker shared by its decorators and
|
|
@@ -9371,9 +9357,9 @@ var Bitfab = class {
|
|
|
9371
9357
|
});
|
|
9372
9358
|
}
|
|
9373
9359
|
/**
|
|
9374
|
-
* Get the first-class Rivet actor-context integration for an
|
|
9375
|
-
* root. The integration binds context and records effect
|
|
9376
|
-
* creates another root.
|
|
9360
|
+
* Get the first-class Rivet actor/workflow-context integration for an
|
|
9361
|
+
* existing trace root. The integration binds context and records effect
|
|
9362
|
+
* spans; it never creates another root.
|
|
9377
9363
|
*
|
|
9378
9364
|
* @param traceFunctionKey - Key used by the enclosing `withTrace()` root
|
|
9379
9365
|
* @param options - Explicit per-context-path replay mocking policy
|