bitfab 0.16.2 → 0.17.0
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-4WJPQT2X.js → chunk-M6N633CX.js} +6 -6
- package/dist/chunk-M6N633CX.js.map +1 -0
- package/dist/index.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -6
- package/dist/index.d.ts +14 -6
- package/dist/index.js +1 -1
- package/dist/node.cjs +5 -5
- package/dist/node.cjs.map +1 -1
- package/dist/node.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-4WJPQT2X.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -147,9 +147,12 @@ declare class BitfabClaudeAgentHandler {
|
|
|
147
147
|
/**
|
|
148
148
|
* Per-trace database snapshot ref capture.
|
|
149
149
|
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
*
|
|
150
|
+
* Every root span carries a `DbSnapshotRef` that pins the DB state at trace
|
|
151
|
+
* open by wall-clock timestamp. Capturing the timestamp is free (no IO) and
|
|
152
|
+
* harmless, so it happens on every trace regardless of configuration: that
|
|
153
|
+
* lets any trace be replayed against a historical branch later. A `provider`
|
|
154
|
+
* is attached only when the customer configured `dbSnapshot`; when absent it
|
|
155
|
+
* is resolved at replay time. The Bitfab service uses the timestamp to
|
|
153
156
|
* materialize an ephemeral branch from `customer-main`.
|
|
154
157
|
*/
|
|
155
158
|
declare const SUPPORTED_PROVIDERS: readonly ["neon"];
|
|
@@ -159,14 +162,19 @@ interface DbSnapshotConfig {
|
|
|
159
162
|
provider: DbSnapshotProvider;
|
|
160
163
|
}
|
|
161
164
|
interface DbSnapshotRef {
|
|
162
|
-
provider: DbSnapshotProvider;
|
|
163
165
|
/**
|
|
164
166
|
* The wall-clock ISO timestamp the SDK observed immediately before
|
|
165
167
|
* invoking the wrapped function. The name encodes its provenance:
|
|
166
168
|
* SDK-observed, wall clock (not monotonic), captured before user code
|
|
167
|
-
* began executing.
|
|
169
|
+
* began executing. Always present.
|
|
168
170
|
*/
|
|
169
171
|
sdkWallClockBeforeFn: string;
|
|
172
|
+
/**
|
|
173
|
+
* The configured provider for server-side branch resolution. Only set when
|
|
174
|
+
* the customer configured `dbSnapshot`; otherwise the provider is resolved
|
|
175
|
+
* at replay time.
|
|
176
|
+
*/
|
|
177
|
+
provider?: DbSnapshotProvider;
|
|
170
178
|
}
|
|
171
179
|
|
|
172
180
|
/**
|
|
@@ -1043,7 +1051,7 @@ declare class BitfabFunction {
|
|
|
1043
1051
|
/**
|
|
1044
1052
|
* SDK version from package.json (injected at build time)
|
|
1045
1053
|
*/
|
|
1046
|
-
declare const __version__ = "0.
|
|
1054
|
+
declare const __version__ = "0.17.0";
|
|
1047
1055
|
|
|
1048
1056
|
/**
|
|
1049
1057
|
* Constants for the Bitfab SDK.
|
package/dist/index.d.ts
CHANGED
|
@@ -147,9 +147,12 @@ declare class BitfabClaudeAgentHandler {
|
|
|
147
147
|
/**
|
|
148
148
|
* Per-trace database snapshot ref capture.
|
|
149
149
|
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
*
|
|
150
|
+
* Every root span carries a `DbSnapshotRef` that pins the DB state at trace
|
|
151
|
+
* open by wall-clock timestamp. Capturing the timestamp is free (no IO) and
|
|
152
|
+
* harmless, so it happens on every trace regardless of configuration: that
|
|
153
|
+
* lets any trace be replayed against a historical branch later. A `provider`
|
|
154
|
+
* is attached only when the customer configured `dbSnapshot`; when absent it
|
|
155
|
+
* is resolved at replay time. The Bitfab service uses the timestamp to
|
|
153
156
|
* materialize an ephemeral branch from `customer-main`.
|
|
154
157
|
*/
|
|
155
158
|
declare const SUPPORTED_PROVIDERS: readonly ["neon"];
|
|
@@ -159,14 +162,19 @@ interface DbSnapshotConfig {
|
|
|
159
162
|
provider: DbSnapshotProvider;
|
|
160
163
|
}
|
|
161
164
|
interface DbSnapshotRef {
|
|
162
|
-
provider: DbSnapshotProvider;
|
|
163
165
|
/**
|
|
164
166
|
* The wall-clock ISO timestamp the SDK observed immediately before
|
|
165
167
|
* invoking the wrapped function. The name encodes its provenance:
|
|
166
168
|
* SDK-observed, wall clock (not monotonic), captured before user code
|
|
167
|
-
* began executing.
|
|
169
|
+
* began executing. Always present.
|
|
168
170
|
*/
|
|
169
171
|
sdkWallClockBeforeFn: string;
|
|
172
|
+
/**
|
|
173
|
+
* The configured provider for server-side branch resolution. Only set when
|
|
174
|
+
* the customer configured `dbSnapshot`; otherwise the provider is resolved
|
|
175
|
+
* at replay time.
|
|
176
|
+
*/
|
|
177
|
+
provider?: DbSnapshotProvider;
|
|
170
178
|
}
|
|
171
179
|
|
|
172
180
|
/**
|
|
@@ -1043,7 +1051,7 @@ declare class BitfabFunction {
|
|
|
1043
1051
|
/**
|
|
1044
1052
|
* SDK version from package.json (injected at build time)
|
|
1045
1053
|
*/
|
|
1046
|
-
declare const __version__ = "0.
|
|
1054
|
+
declare const __version__ = "0.17.0";
|
|
1047
1055
|
|
|
1048
1056
|
/**
|
|
1049
1057
|
* Constants for the Bitfab SDK.
|
package/dist/index.js
CHANGED
package/dist/node.cjs
CHANGED
|
@@ -456,7 +456,7 @@ registerAsyncLocalStorageClass(
|
|
|
456
456
|
);
|
|
457
457
|
|
|
458
458
|
// src/version.generated.ts
|
|
459
|
-
var __version__ = "0.
|
|
459
|
+
var __version__ = "0.17.0";
|
|
460
460
|
|
|
461
461
|
// src/constants.ts
|
|
462
462
|
var DEFAULT_SERVICE_URL = "https://bitfab.ai";
|
|
@@ -1571,8 +1571,8 @@ function validateDbSnapshotConfig(config) {
|
|
|
1571
1571
|
}
|
|
1572
1572
|
function buildSnapshotRef(config, sdkWallClockBeforeFn) {
|
|
1573
1573
|
return {
|
|
1574
|
-
|
|
1575
|
-
|
|
1574
|
+
sdkWallClockBeforeFn,
|
|
1575
|
+
...config && { provider: config.provider }
|
|
1576
1576
|
};
|
|
1577
1577
|
}
|
|
1578
1578
|
|
|
@@ -2947,7 +2947,7 @@ var Bitfab = class {
|
|
|
2947
2947
|
const startedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
2948
2948
|
if (isRootSpan && !activeTraceStates.has(traceId)) {
|
|
2949
2949
|
const replayCtxAtRoot = getReplayContext();
|
|
2950
|
-
const dbSnapshotRef =
|
|
2950
|
+
const dbSnapshotRef = buildSnapshotRef(self.dbSnapshot, startedAt);
|
|
2951
2951
|
activeTraceStates.set(traceId, {
|
|
2952
2952
|
traceId,
|
|
2953
2953
|
startedAt,
|
|
@@ -2958,7 +2958,7 @@ var Bitfab = class {
|
|
|
2958
2958
|
...replayCtxAtRoot?.inputSourceTraceId && {
|
|
2959
2959
|
inputSourceTraceId: replayCtxAtRoot.inputSourceTraceId
|
|
2960
2960
|
},
|
|
2961
|
-
|
|
2961
|
+
dbSnapshotRef
|
|
2962
2962
|
});
|
|
2963
2963
|
pendingSpanPromises.set(traceId, []);
|
|
2964
2964
|
}
|