bitfab 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
|
@@ -17,13 +17,13 @@ import {
|
|
|
17
17
|
SUPPORTED_PROVIDERS,
|
|
18
18
|
getCurrentSpan,
|
|
19
19
|
getCurrentTrace
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-LUZVIGER.js";
|
|
21
21
|
import {
|
|
22
22
|
BitfabError,
|
|
23
23
|
DEFAULT_SERVICE_URL,
|
|
24
24
|
__version__,
|
|
25
25
|
flushTraces
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-EGRWBJYR.js";
|
|
27
27
|
export {
|
|
28
28
|
Bitfab,
|
|
29
29
|
BitfabClaudeAgentHandler,
|
package/dist/node.cjs
CHANGED
|
@@ -90,7 +90,7 @@ var __version__;
|
|
|
90
90
|
var init_version_generated = __esm({
|
|
91
91
|
"src/version.generated.ts"() {
|
|
92
92
|
"use strict";
|
|
93
|
-
__version__ = "0.13.
|
|
93
|
+
__version__ = "0.13.7";
|
|
94
94
|
}
|
|
95
95
|
});
|
|
96
96
|
|
|
@@ -439,11 +439,11 @@ var init_http = __esm({
|
|
|
439
439
|
{ timeout: 9e4 }
|
|
440
440
|
);
|
|
441
441
|
}
|
|
442
|
-
/** Release a previously-resolved DB branch
|
|
443
|
-
async releaseDbBranchLease(
|
|
442
|
+
/** Release a previously-resolved DB branch by deleting its Neon branch. Idempotent server-side. */
|
|
443
|
+
async releaseDbBranchLease(neonBranchId) {
|
|
444
444
|
await this.request(
|
|
445
445
|
"/api/sdk/replay/releaseDbBranchLease",
|
|
446
|
-
{
|
|
446
|
+
{ neonBranchId },
|
|
447
447
|
{ timeout: 3e4 }
|
|
448
448
|
);
|
|
449
449
|
}
|
|
@@ -624,11 +624,11 @@ async function processItem(httpClient, serverItem, fn, testRunId, mockStrategy,
|
|
|
624
624
|
} finally {
|
|
625
625
|
if (lease) {
|
|
626
626
|
try {
|
|
627
|
-
await httpClient.releaseDbBranchLease(lease.
|
|
627
|
+
await httpClient.releaseDbBranchLease(lease.neonBranchId);
|
|
628
628
|
} catch (e) {
|
|
629
629
|
try {
|
|
630
630
|
console.warn(
|
|
631
|
-
`Bitfab: failed to release DB branch
|
|
631
|
+
`Bitfab: failed to release DB branch ${lease.neonBranchId} (TTL janitor will catch it): ${e instanceof Error ? e.message : String(e)}`
|
|
632
632
|
);
|
|
633
633
|
} catch {
|
|
634
634
|
}
|
|
@@ -1521,16 +1521,7 @@ init_constants();
|
|
|
1521
1521
|
|
|
1522
1522
|
// src/dbSnapshot.ts
|
|
1523
1523
|
init_errors();
|
|
1524
|
-
var SUPPORTED_PROVIDERS = [
|
|
1525
|
-
"neon",
|
|
1526
|
-
"ardent",
|
|
1527
|
-
"dolt",
|
|
1528
|
-
"gfs",
|
|
1529
|
-
"mongodb-atlas",
|
|
1530
|
-
"dynamodb",
|
|
1531
|
-
"snowflake",
|
|
1532
|
-
"bigquery"
|
|
1533
|
-
];
|
|
1524
|
+
var SUPPORTED_PROVIDERS = ["neon"];
|
|
1534
1525
|
function validateDbSnapshotConfig(config) {
|
|
1535
1526
|
if (!SUPPORTED_PROVIDERS.includes(config.provider)) {
|
|
1536
1527
|
throw new BitfabError(
|
|
@@ -2057,14 +2048,6 @@ var ReplayEnvironment = class {
|
|
|
2057
2048
|
get traceId() {
|
|
2058
2049
|
return this.require().traceId;
|
|
2059
2050
|
}
|
|
2060
|
-
/**
|
|
2061
|
-
* How the resolver pinned this branch.
|
|
2062
|
-
* - "timestamp": snapshot at SDK wall clock; bounded by replication lag.
|
|
2063
|
-
* - "lsn": customer LSN mapped to a replica snapshot (future).
|
|
2064
|
-
*/
|
|
2065
|
-
get precision() {
|
|
2066
|
-
return this.require().precision;
|
|
2067
|
-
}
|
|
2068
2051
|
/** True when read inside a replay item that has a resolved branch. */
|
|
2069
2052
|
get active() {
|
|
2070
2053
|
return this.read() !== null;
|
|
@@ -2088,8 +2071,7 @@ var ReplayEnvironment = class {
|
|
|
2088
2071
|
expiresAt: lease.expiresAt,
|
|
2089
2072
|
providerConsoleUrl: lease.providerConsoleUrl,
|
|
2090
2073
|
readOnly: lease.readOnly,
|
|
2091
|
-
traceId
|
|
2092
|
-
precision: lease.precision
|
|
2074
|
+
traceId
|
|
2093
2075
|
};
|
|
2094
2076
|
}
|
|
2095
2077
|
require() {
|
|
@@ -2941,7 +2923,6 @@ var Bitfab = class {
|
|
|
2941
2923
|
try {
|
|
2942
2924
|
const endedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
2943
2925
|
const replayCtx = getReplayContext();
|
|
2944
|
-
const dbSnapshotRefForSpan = isRootSpan ? activeTraceStates.get(traceId)?.dbSnapshotRef : void 0;
|
|
2945
2926
|
const spanPromise = self.sendWrapperSpan({
|
|
2946
2927
|
...baseSpanParams,
|
|
2947
2928
|
...params,
|
|
@@ -2951,9 +2932,6 @@ var Bitfab = class {
|
|
|
2951
2932
|
...replayCtx?.testRunId && { testRunId: replayCtx.testRunId },
|
|
2952
2933
|
...replayCtx?.inputSourceSpanId && {
|
|
2953
2934
|
inputSourceSpanId: replayCtx.inputSourceSpanId
|
|
2954
|
-
},
|
|
2955
|
-
...dbSnapshotRefForSpan && {
|
|
2956
|
-
dbSnapshotRef: dbSnapshotRefForSpan
|
|
2957
2935
|
}
|
|
2958
2936
|
});
|
|
2959
2937
|
if (isRootSpan) {
|
|
@@ -3181,10 +3159,7 @@ var Bitfab = class {
|
|
|
3181
3159
|
...params.contexts && params.contexts.length > 0 && {
|
|
3182
3160
|
contexts: params.contexts
|
|
3183
3161
|
},
|
|
3184
|
-
...params.prompt !== void 0 && { prompt: params.prompt }
|
|
3185
|
-
...params.dbSnapshotRef && {
|
|
3186
|
-
db_snapshot_ref: params.dbSnapshotRef
|
|
3187
|
-
}
|
|
3162
|
+
...params.prompt !== void 0 && { prompt: params.prompt }
|
|
3188
3163
|
}
|
|
3189
3164
|
};
|
|
3190
3165
|
if (params.parentSpanId) {
|