@osfactory/otel-hook 0.12.0 → 0.13.1
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/README.md +6 -4
- package/dist/{adapter-DQiPu8xF.d.ts → adapter-DyCb7y1N.d.ts} +1 -1
- package/dist/cli.js +260 -74
- package/dist/cli.js.map +1 -1
- package/dist/{export-destinations-CI7z4n3i.d.ts → export-destinations-DUeQKr_C.d.ts} +2 -2
- package/dist/{filesystem-store-CmnUlj1O.d.ts → filesystem-store-B3CpiIRl.d.ts} +1 -1
- package/dist/{hook-vM_cgqS2.d.ts → hook-D5imE0Qc.d.ts} +3 -3
- package/dist/index.d.ts +10 -10
- package/dist/index.js +252 -66
- package/dist/index.js.map +1 -1
- package/dist/install.d.ts +3 -3
- package/dist/install.js +14 -2
- package/dist/install.js.map +1 -1
- package/dist/integration.d.ts +7 -7
- package/dist/integration.js +211 -58
- package/dist/integration.js.map +1 -1
- package/dist/lifecycle.d.ts +9 -2
- package/dist/lifecycle.js +10 -3
- package/dist/lifecycle.js.map +1 -1
- package/dist/{memory-DdU1U91y.d.ts → memory-B3r6sZtC.d.ts} +1 -1
- package/dist/{metric-model-C9lLqqpI.d.ts → metric-model-B4lIuk6i.d.ts} +10 -1
- package/dist/{payload-BT19hiVZ.d.ts → payload-CdDKeRpH.d.ts} +1 -1
- package/dist/{ports-C3k_5eOQ.d.ts → ports-DhpSDIkp.d.ts} +8 -1
- package/dist/providers.d.ts +27 -11
- package/dist/providers.js +132 -43
- package/dist/providers.js.map +1 -1
- package/dist/{registry-gyJqaWmp.d.ts → registry-BKQhhIO3.d.ts} +1 -1
- package/dist/runtime.d.ts +6 -6
- package/dist/runtime.js +12 -2
- package/dist/runtime.js.map +1 -1
- package/dist/state.d.ts +3 -3
- package/dist/state.js +20 -6
- package/dist/state.js.map +1 -1
- package/dist/telemetry.d.ts +3 -3
- package/dist/telemetry.js +72 -6
- package/dist/telemetry.js.map +1 -1
- package/dist/testing.d.ts +6 -6
- package/dist/testing.js +63 -8
- package/dist/testing.js.map +1 -1
- package/package.json +2 -1
package/dist/state.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { S as StoreNamespace } from './keys-Dej5bN3L.js';
|
|
2
|
-
import { L as LockingStateStore } from './filesystem-store-
|
|
3
|
-
export { F as FilesystemStateStore, a as FilesystemStateStoreOptions, S as StateStoreDependencies, c as createFilesystemStateStore, i as isLockingStateStore, w as withOptionalSessionLock } from './filesystem-store-
|
|
4
|
-
import { C as Clock } from './ports-
|
|
2
|
+
import { L as LockingStateStore } from './filesystem-store-B3CpiIRl.js';
|
|
3
|
+
export { F as FilesystemStateStore, a as FilesystemStateStoreOptions, S as StateStoreDependencies, c as createFilesystemStateStore, i as isLockingStateStore, w as withOptionalSessionLock } from './filesystem-store-B3CpiIRl.js';
|
|
4
|
+
import { C as Clock } from './ports-DhpSDIkp.js';
|
|
5
5
|
import 'zod';
|
|
6
6
|
import './errors.js';
|
|
7
7
|
import './primitives-CJ8-rn-f.js';
|
package/dist/state.js
CHANGED
|
@@ -1016,7 +1016,7 @@ var createBoundedMemoryStateStore = (options) => {
|
|
|
1016
1016
|
|
|
1017
1017
|
// src/state/filesystem-store.ts
|
|
1018
1018
|
import { randomBytes } from "crypto";
|
|
1019
|
-
import { mkdir, open, readFile, readdir, rename, unlink, writeFile } from "fs/promises";
|
|
1019
|
+
import { mkdir, open, readFile, readdir, rename, stat, unlink, writeFile } from "fs/promises";
|
|
1020
1020
|
import * as path from "path";
|
|
1021
1021
|
|
|
1022
1022
|
// src/state/keys.ts
|
|
@@ -1038,8 +1038,7 @@ var keyDigest = (key) => createHash("sha256").update(key, "utf8").digest("hex");
|
|
|
1038
1038
|
// src/state/filesystem-store.ts
|
|
1039
1039
|
var isErrnoException = (thrown, code) => thrown instanceof Error && thrown.code === code;
|
|
1040
1040
|
var sleep = (millis) => new Promise((resolve) => {
|
|
1041
|
-
|
|
1042
|
-
timer.unref?.();
|
|
1041
|
+
setTimeout(resolve, millis);
|
|
1043
1042
|
});
|
|
1044
1043
|
var wrapFsError = (thrown, operation) => {
|
|
1045
1044
|
if (thrown instanceof Error) {
|
|
@@ -1159,14 +1158,29 @@ var createFilesystemStateStore = (options) => {
|
|
|
1159
1158
|
}
|
|
1160
1159
|
}
|
|
1161
1160
|
const stale = await (async () => {
|
|
1161
|
+
let raw;
|
|
1162
|
+
try {
|
|
1163
|
+
raw = await readFile(filePath, "utf8");
|
|
1164
|
+
} catch (thrown) {
|
|
1165
|
+
return isErrnoException(thrown, "ENOENT") ? "gone" : true;
|
|
1166
|
+
}
|
|
1162
1167
|
try {
|
|
1163
|
-
const raw = await readFile(filePath, "utf8");
|
|
1164
1168
|
const parsed = JSON.parse(raw);
|
|
1165
|
-
|
|
1169
|
+
if (typeof parsed.acquiredAt === "number") {
|
|
1170
|
+
return options.clock.now() - parsed.acquiredAt > lockStaleMillis;
|
|
1171
|
+
}
|
|
1166
1172
|
} catch {
|
|
1167
|
-
|
|
1173
|
+
}
|
|
1174
|
+
try {
|
|
1175
|
+
const stats = await stat(filePath);
|
|
1176
|
+
return Date.now() - stats.mtimeMs > lockStaleMillis;
|
|
1177
|
+
} catch {
|
|
1178
|
+
return "gone";
|
|
1168
1179
|
}
|
|
1169
1180
|
})();
|
|
1181
|
+
if (stale === "gone") {
|
|
1182
|
+
continue;
|
|
1183
|
+
}
|
|
1170
1184
|
if (stale) {
|
|
1171
1185
|
await unlink(filePath).catch(() => void 0);
|
|
1172
1186
|
continue;
|