@bitfab/sdk 0.13.6 → 0.13.7
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-TMSVIA5J.js → chunk-EGRWBJYR.js} +5 -5
- package/dist/chunk-EGRWBJYR.js.map +1 -0
- package/dist/{chunk-6757PVPS.js → chunk-LUZVIGER.js} +6 -31
- package/dist/chunk-LUZVIGER.js.map +1 -0
- package/dist/index.cjs +9 -34
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -25
- package/dist/index.d.ts +5 -25
- package/dist/index.js +2 -2
- package/dist/node.cjs +9 -34
- package/dist/node.cjs.map +1 -1
- package/dist/node.js +2 -2
- package/dist/{replay-UBXCO6QU.js → replay-VXZJBR34.js} +4 -4
- package/dist/{replay-UBXCO6QU.js.map → replay-VXZJBR34.js.map} +1 -1
- package/package.json +1 -1
- package/dist/chunk-6757PVPS.js.map +0 -1
- package/dist/chunk-TMSVIA5J.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -151,14 +151,8 @@ declare class BitfabClaudeAgentHandler {
|
|
|
151
151
|
* `DbSnapshotRef` that pins the DB state at trace open by wall-clock
|
|
152
152
|
* timestamp. The Bitfab service uses that timestamp at replay time to
|
|
153
153
|
* materialize an ephemeral branch from `customer-main`.
|
|
154
|
-
*
|
|
155
|
-
* v0 is timestamp-only. LSN-based pinning is intentionally not exposed
|
|
156
|
-
* yet — the customer-LSN to replica-LSN mapping isn't built, so the
|
|
157
|
-
* mapping primitive would have no resolver to consume it. The
|
|
158
|
-
* `DbSnapshotRef.ref` field is reserved for that future use.
|
|
159
154
|
*/
|
|
160
|
-
|
|
161
|
-
declare const SUPPORTED_PROVIDERS: readonly ["neon", "ardent", "dolt", "gfs", "mongodb-atlas", "dynamodb", "snowflake", "bigquery"];
|
|
155
|
+
declare const SUPPORTED_PROVIDERS: readonly ["neon"];
|
|
162
156
|
type DbSnapshotProvider = (typeof SUPPORTED_PROVIDERS)[number];
|
|
163
157
|
interface DbSnapshotConfig {
|
|
164
158
|
/** Discriminator for the server-side resolver. */
|
|
@@ -168,18 +162,11 @@ interface DbSnapshotRef {
|
|
|
168
162
|
provider: DbSnapshotProvider;
|
|
169
163
|
/**
|
|
170
164
|
* The wall-clock ISO timestamp the SDK observed immediately before
|
|
171
|
-
* invoking the wrapped function.
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
* before user code began executing — distinct from server-side or
|
|
175
|
-
* DB-side timestamps recorded elsewhere on the trace.
|
|
165
|
+
* invoking the wrapped function. The name encodes its provenance:
|
|
166
|
+
* SDK-observed, wall clock (not monotonic), captured before user code
|
|
167
|
+
* began executing.
|
|
176
168
|
*/
|
|
177
169
|
sdkWallClockBeforeFn: string;
|
|
178
|
-
/**
|
|
179
|
-
* Reserved for future provider-specific opaque payload (e.g. customer
|
|
180
|
-
* LSN once a source-to-replica mapping exists). Unused in v0.
|
|
181
|
-
*/
|
|
182
|
-
ref?: Record<string, unknown>;
|
|
183
170
|
}
|
|
184
171
|
|
|
185
172
|
/**
|
|
@@ -317,7 +304,6 @@ interface ReplayEnvironmentSnapshot {
|
|
|
317
304
|
providerConsoleUrl?: string;
|
|
318
305
|
readOnly?: boolean;
|
|
319
306
|
traceId: string;
|
|
320
|
-
precision: "timestamp" | "lsn";
|
|
321
307
|
}
|
|
322
308
|
declare class ReplayEnvironment {
|
|
323
309
|
/**
|
|
@@ -337,12 +323,6 @@ declare class ReplayEnvironment {
|
|
|
337
323
|
get readOnly(): boolean | undefined;
|
|
338
324
|
/** The historical trace ID that produced the input for this replay item. */
|
|
339
325
|
get traceId(): string;
|
|
340
|
-
/**
|
|
341
|
-
* How the resolver pinned this branch.
|
|
342
|
-
* - "timestamp": snapshot at SDK wall clock; bounded by replication lag.
|
|
343
|
-
* - "lsn": customer LSN mapped to a replica snapshot (future).
|
|
344
|
-
*/
|
|
345
|
-
get precision(): "timestamp" | "lsn";
|
|
346
326
|
/** True when read inside a replay item that has a resolved branch. */
|
|
347
327
|
get active(): boolean;
|
|
348
328
|
/** Non-throwing variant for callers that handle the inactive case. */
|
|
@@ -1010,7 +990,7 @@ declare class BitfabFunction {
|
|
|
1010
990
|
/**
|
|
1011
991
|
* SDK version from package.json (injected at build time)
|
|
1012
992
|
*/
|
|
1013
|
-
declare const __version__ = "0.13.
|
|
993
|
+
declare const __version__ = "0.13.7";
|
|
1014
994
|
|
|
1015
995
|
/**
|
|
1016
996
|
* Constants for the Bitfab SDK.
|
package/dist/index.d.ts
CHANGED
|
@@ -151,14 +151,8 @@ declare class BitfabClaudeAgentHandler {
|
|
|
151
151
|
* `DbSnapshotRef` that pins the DB state at trace open by wall-clock
|
|
152
152
|
* timestamp. The Bitfab service uses that timestamp at replay time to
|
|
153
153
|
* materialize an ephemeral branch from `customer-main`.
|
|
154
|
-
*
|
|
155
|
-
* v0 is timestamp-only. LSN-based pinning is intentionally not exposed
|
|
156
|
-
* yet — the customer-LSN to replica-LSN mapping isn't built, so the
|
|
157
|
-
* mapping primitive would have no resolver to consume it. The
|
|
158
|
-
* `DbSnapshotRef.ref` field is reserved for that future use.
|
|
159
154
|
*/
|
|
160
|
-
|
|
161
|
-
declare const SUPPORTED_PROVIDERS: readonly ["neon", "ardent", "dolt", "gfs", "mongodb-atlas", "dynamodb", "snowflake", "bigquery"];
|
|
155
|
+
declare const SUPPORTED_PROVIDERS: readonly ["neon"];
|
|
162
156
|
type DbSnapshotProvider = (typeof SUPPORTED_PROVIDERS)[number];
|
|
163
157
|
interface DbSnapshotConfig {
|
|
164
158
|
/** Discriminator for the server-side resolver. */
|
|
@@ -168,18 +162,11 @@ interface DbSnapshotRef {
|
|
|
168
162
|
provider: DbSnapshotProvider;
|
|
169
163
|
/**
|
|
170
164
|
* The wall-clock ISO timestamp the SDK observed immediately before
|
|
171
|
-
* invoking the wrapped function.
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
* before user code began executing — distinct from server-side or
|
|
175
|
-
* DB-side timestamps recorded elsewhere on the trace.
|
|
165
|
+
* invoking the wrapped function. The name encodes its provenance:
|
|
166
|
+
* SDK-observed, wall clock (not monotonic), captured before user code
|
|
167
|
+
* began executing.
|
|
176
168
|
*/
|
|
177
169
|
sdkWallClockBeforeFn: string;
|
|
178
|
-
/**
|
|
179
|
-
* Reserved for future provider-specific opaque payload (e.g. customer
|
|
180
|
-
* LSN once a source-to-replica mapping exists). Unused in v0.
|
|
181
|
-
*/
|
|
182
|
-
ref?: Record<string, unknown>;
|
|
183
170
|
}
|
|
184
171
|
|
|
185
172
|
/**
|
|
@@ -317,7 +304,6 @@ interface ReplayEnvironmentSnapshot {
|
|
|
317
304
|
providerConsoleUrl?: string;
|
|
318
305
|
readOnly?: boolean;
|
|
319
306
|
traceId: string;
|
|
320
|
-
precision: "timestamp" | "lsn";
|
|
321
307
|
}
|
|
322
308
|
declare class ReplayEnvironment {
|
|
323
309
|
/**
|
|
@@ -337,12 +323,6 @@ declare class ReplayEnvironment {
|
|
|
337
323
|
get readOnly(): boolean | undefined;
|
|
338
324
|
/** The historical trace ID that produced the input for this replay item. */
|
|
339
325
|
get traceId(): string;
|
|
340
|
-
/**
|
|
341
|
-
* How the resolver pinned this branch.
|
|
342
|
-
* - "timestamp": snapshot at SDK wall clock; bounded by replication lag.
|
|
343
|
-
* - "lsn": customer LSN mapped to a replica snapshot (future).
|
|
344
|
-
*/
|
|
345
|
-
get precision(): "timestamp" | "lsn";
|
|
346
326
|
/** True when read inside a replay item that has a resolved branch. */
|
|
347
327
|
get active(): boolean;
|
|
348
328
|
/** Non-throwing variant for callers that handle the inactive case. */
|
|
@@ -1010,7 +990,7 @@ declare class BitfabFunction {
|
|
|
1010
990
|
/**
|
|
1011
991
|
* SDK version from package.json (injected at build time)
|
|
1012
992
|
*/
|
|
1013
|
-
declare const __version__ = "0.13.
|
|
993
|
+
declare const __version__ = "0.13.7";
|
|
1014
994
|
|
|
1015
995
|
/**
|
|
1016
996
|
* Constants for the Bitfab SDK.
|
package/dist/index.js
CHANGED
|
@@ -8,13 +8,13 @@ import {
|
|
|
8
8
|
SUPPORTED_PROVIDERS,
|
|
9
9
|
getCurrentSpan,
|
|
10
10
|
getCurrentTrace
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-LUZVIGER.js";
|
|
12
12
|
import {
|
|
13
13
|
BitfabError,
|
|
14
14
|
DEFAULT_SERVICE_URL,
|
|
15
15
|
__version__,
|
|
16
16
|
flushTraces
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-EGRWBJYR.js";
|
|
18
18
|
export {
|
|
19
19
|
Bitfab,
|
|
20
20
|
BitfabClaudeAgentHandler,
|
package/dist/node.cjs
CHANGED
|
@@ -81,7 +81,7 @@ var __version__;
|
|
|
81
81
|
var init_version_generated = __esm({
|
|
82
82
|
"src/version.generated.ts"() {
|
|
83
83
|
"use strict";
|
|
84
|
-
__version__ = "0.13.
|
|
84
|
+
__version__ = "0.13.7";
|
|
85
85
|
}
|
|
86
86
|
});
|
|
87
87
|
|
|
@@ -430,11 +430,11 @@ var init_http = __esm({
|
|
|
430
430
|
{ timeout: 9e4 }
|
|
431
431
|
);
|
|
432
432
|
}
|
|
433
|
-
/** Release a previously-resolved DB branch
|
|
434
|
-
async releaseDbBranchLease(
|
|
433
|
+
/** Release a previously-resolved DB branch by deleting its Neon branch. Idempotent server-side. */
|
|
434
|
+
async releaseDbBranchLease(neonBranchId) {
|
|
435
435
|
await this.request(
|
|
436
436
|
"/api/sdk/replay/releaseDbBranchLease",
|
|
437
|
-
{
|
|
437
|
+
{ neonBranchId },
|
|
438
438
|
{ timeout: 3e4 }
|
|
439
439
|
);
|
|
440
440
|
}
|
|
@@ -615,11 +615,11 @@ async function processItem(httpClient, serverItem, fn, testRunId, mockStrategy,
|
|
|
615
615
|
} finally {
|
|
616
616
|
if (lease) {
|
|
617
617
|
try {
|
|
618
|
-
await httpClient.releaseDbBranchLease(lease.
|
|
618
|
+
await httpClient.releaseDbBranchLease(lease.neonBranchId);
|
|
619
619
|
} catch (e) {
|
|
620
620
|
try {
|
|
621
621
|
console.warn(
|
|
622
|
-
`Bitfab: failed to release DB branch
|
|
622
|
+
`Bitfab: failed to release DB branch ${lease.neonBranchId} (TTL janitor will catch it): ${e instanceof Error ? e.message : String(e)}`
|
|
623
623
|
);
|
|
624
624
|
} catch {
|
|
625
625
|
}
|
|
@@ -1512,16 +1512,7 @@ init_constants();
|
|
|
1512
1512
|
|
|
1513
1513
|
// src/dbSnapshot.ts
|
|
1514
1514
|
init_errors();
|
|
1515
|
-
var SUPPORTED_PROVIDERS = [
|
|
1516
|
-
"neon",
|
|
1517
|
-
"ardent",
|
|
1518
|
-
"dolt",
|
|
1519
|
-
"gfs",
|
|
1520
|
-
"mongodb-atlas",
|
|
1521
|
-
"dynamodb",
|
|
1522
|
-
"snowflake",
|
|
1523
|
-
"bigquery"
|
|
1524
|
-
];
|
|
1515
|
+
var SUPPORTED_PROVIDERS = ["neon"];
|
|
1525
1516
|
function validateDbSnapshotConfig(config) {
|
|
1526
1517
|
if (!SUPPORTED_PROVIDERS.includes(config.provider)) {
|
|
1527
1518
|
throw new BitfabError(
|
|
@@ -2048,14 +2039,6 @@ var ReplayEnvironment = class {
|
|
|
2048
2039
|
get traceId() {
|
|
2049
2040
|
return this.require().traceId;
|
|
2050
2041
|
}
|
|
2051
|
-
/**
|
|
2052
|
-
* How the resolver pinned this branch.
|
|
2053
|
-
* - "timestamp": snapshot at SDK wall clock; bounded by replication lag.
|
|
2054
|
-
* - "lsn": customer LSN mapped to a replica snapshot (future).
|
|
2055
|
-
*/
|
|
2056
|
-
get precision() {
|
|
2057
|
-
return this.require().precision;
|
|
2058
|
-
}
|
|
2059
2042
|
/** True when read inside a replay item that has a resolved branch. */
|
|
2060
2043
|
get active() {
|
|
2061
2044
|
return this.read() !== null;
|
|
@@ -2079,8 +2062,7 @@ var ReplayEnvironment = class {
|
|
|
2079
2062
|
expiresAt: lease.expiresAt,
|
|
2080
2063
|
providerConsoleUrl: lease.providerConsoleUrl,
|
|
2081
2064
|
readOnly: lease.readOnly,
|
|
2082
|
-
traceId
|
|
2083
|
-
precision: lease.precision
|
|
2065
|
+
traceId
|
|
2084
2066
|
};
|
|
2085
2067
|
}
|
|
2086
2068
|
require() {
|
|
@@ -2932,7 +2914,6 @@ var Bitfab = class {
|
|
|
2932
2914
|
try {
|
|
2933
2915
|
const endedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
2934
2916
|
const replayCtx = getReplayContext();
|
|
2935
|
-
const dbSnapshotRefForSpan = isRootSpan ? activeTraceStates.get(traceId)?.dbSnapshotRef : void 0;
|
|
2936
2917
|
const spanPromise = self.sendWrapperSpan({
|
|
2937
2918
|
...baseSpanParams,
|
|
2938
2919
|
...params,
|
|
@@ -2942,9 +2923,6 @@ var Bitfab = class {
|
|
|
2942
2923
|
...replayCtx?.testRunId && { testRunId: replayCtx.testRunId },
|
|
2943
2924
|
...replayCtx?.inputSourceSpanId && {
|
|
2944
2925
|
inputSourceSpanId: replayCtx.inputSourceSpanId
|
|
2945
|
-
},
|
|
2946
|
-
...dbSnapshotRefForSpan && {
|
|
2947
|
-
dbSnapshotRef: dbSnapshotRefForSpan
|
|
2948
2926
|
}
|
|
2949
2927
|
});
|
|
2950
2928
|
if (isRootSpan) {
|
|
@@ -3172,10 +3150,7 @@ var Bitfab = class {
|
|
|
3172
3150
|
...params.contexts && params.contexts.length > 0 && {
|
|
3173
3151
|
contexts: params.contexts
|
|
3174
3152
|
},
|
|
3175
|
-
...params.prompt !== void 0 && { prompt: params.prompt }
|
|
3176
|
-
...params.dbSnapshotRef && {
|
|
3177
|
-
db_snapshot_ref: params.dbSnapshotRef
|
|
3178
|
-
}
|
|
3153
|
+
...params.prompt !== void 0 && { prompt: params.prompt }
|
|
3179
3154
|
}
|
|
3180
3155
|
};
|
|
3181
3156
|
if (params.parentSpanId) {
|