@refactorlabs/recount 0.11.0 → 0.11.2
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 +1 -0
- package/dist/{chunk-XKR3GXTH.js → chunk-GLYQDK5L.js} +11 -3
- package/dist/chunk-GLYQDK5L.js.map +1 -0
- package/dist/index.cjs +339 -58
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -3
- package/dist/index.d.ts +15 -3
- package/dist/index.js +332 -59
- package/dist/index.js.map +1 -1
- package/dist/integrations/anthropic.js +1 -1
- package/dist/integrations/mongodb.js +1 -1
- package/dist/integrations/openai.js +1 -1
- package/llms.md +7 -4
- package/package.json +1 -1
- package/dist/chunk-XKR3GXTH.js.map +0 -1
package/README.md
CHANGED
|
@@ -140,6 +140,7 @@ Recording a trace never changes how your code behaves:
|
|
|
140
140
|
|
|
141
141
|
- Without an API key, the SDK logs one warning and every call does nothing.
|
|
142
142
|
- The SDK doesn't throw errors of its own, and errors from your code pass through unchanged.
|
|
143
|
+
- A span that can't be sent as JSON (such as one holding a cycle) or that's past a trace's 500 spans is dropped, and the rest of the trace is sent.
|
|
143
144
|
- A trace that can't be sent, because of a network error, a rejected payload or a timeout, is dropped. Set `RECOUNT_DEBUG` to see why.
|
|
144
145
|
- Rate-limited uploads are retried up to twice, within `timeoutMs` (30 seconds by default).
|
|
145
146
|
|
|
@@ -8,6 +8,14 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
|
|
|
8
8
|
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
9
9
|
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
10
10
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
11
|
+
var __privateWrapper = (obj, member, setter, getter) => ({
|
|
12
|
+
set _(value) {
|
|
13
|
+
__privateSet(obj, member, value, setter);
|
|
14
|
+
},
|
|
15
|
+
get _() {
|
|
16
|
+
return __privateGet(obj, member, getter);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
11
19
|
var _key = /* @__PURE__ */ Symbol.for("@refactorlabs/recount.storage");
|
|
12
20
|
var _nameKey = /* @__PURE__ */ Symbol.for("@refactorlabs/recount.spanName");
|
|
13
21
|
var _g = globalThis;
|
|
@@ -28,6 +36,6 @@ function runWithSpanName(name, fn) {
|
|
|
28
36
|
return nameStorage.run(name, fn);
|
|
29
37
|
}
|
|
30
38
|
|
|
31
|
-
export { __privateAdd, __privateGet, __privateMethod, __privateSet, getActiveTrace, getNextSpanName, runWithSpanName, runWithTrace };
|
|
32
|
-
//# sourceMappingURL=chunk-
|
|
33
|
-
//# sourceMappingURL=chunk-
|
|
39
|
+
export { __privateAdd, __privateGet, __privateMethod, __privateSet, __privateWrapper, getActiveTrace, getNextSpanName, runWithSpanName, runWithTrace };
|
|
40
|
+
//# sourceMappingURL=chunk-GLYQDK5L.js.map
|
|
41
|
+
//# sourceMappingURL=chunk-GLYQDK5L.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/context.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAKA,IAAM,IAAA,mBAAO,MAAA,CAAO,GAAA,CAAI,+BAA+B,CAAA;AACvD,IAAM,QAAA,mBAAW,MAAA,CAAO,GAAA,CAAI,gCAAgC,CAAA;AAC5D,IAAM,EAAA,GAAK,UAAA;AACX,IAAI,CAAC,GAAG,IAAI,CAAA,KAAM,IAAI,CAAA,GAAI,IAAI,iBAAA,EAAyB;AACvD,IAAI,CAAC,GAAG,QAAQ,CAAA,KAAM,QAAQ,CAAA,GAAI,IAAI,iBAAA,EAA0B;AAChE,IAAM,OAAA,GAAU,GAAG,IAAI,CAAA;AACvB,IAAM,WAAA,GAAc,GAAG,QAAQ,CAAA;AAExB,SAAS,cAAA,GAAoC;AAClD,EAAA,OAAO,QAAQ,QAAA,EAAS;AAC1B;AAEO,SAAS,YAAA,CACd,OACA,EAAA,EACY;AACZ,EAAA,OAAO,OAAA,CAAQ,GAAA,CAAI,KAAA,EAAO,EAAE,CAAA;AAC9B;AAEO,SAAS,eAAA,GAAsC;AACpD,EAAA,OAAO,YAAY,QAAA,EAAS;AAC9B;AAEO,SAAS,eAAA,CACd,MACA,EAAA,EACY;AACZ,EAAA,OAAO,WAAA,CAAY,GAAA,CAAI,IAAA,EAAM,EAAE,CAAA;AACjC","file":"chunk-GLYQDK5L.js","sourcesContent":["import { AsyncLocalStorage } from 'node:async_hooks';\n\nimport type { Trace } from '../trace.ts';\n\n// Global singleton ensures all CJS entry points share one AsyncLocalStorage instance.\nconst _key = Symbol.for('@refactorlabs/recount.storage');\nconst _nameKey = Symbol.for('@refactorlabs/recount.spanName');\nconst _g = globalThis as Record<symbol, AsyncLocalStorage<unknown>>;\nif (!_g[_key]) _g[_key] = new AsyncLocalStorage<Trace>();\nif (!_g[_nameKey]) _g[_nameKey] = new AsyncLocalStorage<string>();\nconst storage = _g[_key] as AsyncLocalStorage<Trace>;\nconst nameStorage = _g[_nameKey] as AsyncLocalStorage<string>;\n\nexport function getActiveTrace(): Trace | undefined {\n return storage.getStore();\n}\n\nexport function runWithTrace<T>(\n trace: Trace,\n fn: () => Promise<T>\n): Promise<T> {\n return storage.run(trace, fn);\n}\n\nexport function getNextSpanName(): string | undefined {\n return nameStorage.getStore();\n}\n\nexport function runWithSpanName<T>(\n name: string,\n fn: () => Promise<T>\n): Promise<T> {\n return nameStorage.run(name, fn);\n}\n"]}
|