@veryfront/ext-content-mdx 0.1.1186 → 0.1.1189

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.
Files changed (163) hide show
  1. package/esm/_dnt.polyfills.d.ts +6 -6
  2. package/esm/_dnt.polyfills.d.ts.map +1 -1
  3. package/esm/deno.d.ts +18 -0
  4. package/esm/deno.js +30 -9
  5. package/esm/src/config/defaults.d.ts +31 -24
  6. package/esm/src/config/defaults.d.ts.map +1 -1
  7. package/esm/src/config/defaults.js +25 -18
  8. package/esm/src/errors/diagnostic-policy.d.ts +35 -0
  9. package/esm/src/errors/diagnostic-policy.d.ts.map +1 -0
  10. package/esm/src/errors/diagnostic-policy.js +100 -0
  11. package/esm/src/errors/error-registry/boundary.d.ts +2 -0
  12. package/esm/src/errors/error-registry/boundary.d.ts.map +1 -1
  13. package/esm/src/errors/error-registry/boundary.js +8 -0
  14. package/esm/src/errors/error-registry/config.d.ts.map +1 -1
  15. package/esm/src/errors/error-registry/config.js +3 -3
  16. package/esm/src/errors/error-registry/deploy.js +1 -1
  17. package/esm/src/errors/error-registry/server.d.ts +2 -0
  18. package/esm/src/errors/error-registry/server.d.ts.map +1 -1
  19. package/esm/src/errors/error-registry/server.js +8 -0
  20. package/esm/src/errors/error-registry-helpers.d.ts +11 -2
  21. package/esm/src/errors/error-registry-helpers.d.ts.map +1 -1
  22. package/esm/src/errors/error-registry-helpers.js +70 -1
  23. package/esm/src/errors/error-registry.d.ts +85 -73
  24. package/esm/src/errors/error-registry.d.ts.map +1 -1
  25. package/esm/src/errors/error-registry.js +2 -14
  26. package/esm/src/errors/types.d.ts +44 -5
  27. package/esm/src/errors/types.d.ts.map +1 -1
  28. package/esm/src/errors/types.js +148 -24
  29. package/esm/src/errors/veryfront-error.d.ts +25 -2
  30. package/esm/src/errors/veryfront-error.d.ts.map +1 -1
  31. package/esm/src/errors/veryfront-error.js +638 -28
  32. package/esm/src/observability/limits.d.ts +20 -0
  33. package/esm/src/observability/limits.d.ts.map +1 -0
  34. package/esm/src/observability/limits.js +19 -0
  35. package/esm/src/observability/telemetry-error.d.ts +22 -0
  36. package/esm/src/observability/telemetry-error.d.ts.map +1 -0
  37. package/esm/src/observability/telemetry-error.js +377 -0
  38. package/esm/src/observability/tracing/api-shim.d.ts +39 -0
  39. package/esm/src/observability/tracing/api-shim.d.ts.map +1 -1
  40. package/esm/src/observability/tracing/api-shim.js +196 -69
  41. package/esm/src/observability/tracing/context-callback.d.ts +14 -0
  42. package/esm/src/observability/tracing/context-callback.d.ts.map +1 -0
  43. package/esm/src/observability/tracing/context-callback.js +111 -0
  44. package/esm/src/observability/tracing/otlp-setup.d.ts.map +1 -1
  45. package/esm/src/observability/tracing/otlp-setup.js +190 -46
  46. package/esm/src/platform/adapters/base.d.ts +51 -7
  47. package/esm/src/platform/adapters/base.d.ts.map +1 -1
  48. package/esm/src/platform/adapters/base.js +4 -2
  49. package/esm/src/platform/adapters/bounded-file-read.d.ts +9 -0
  50. package/esm/src/platform/adapters/bounded-file-read.d.ts.map +1 -1
  51. package/esm/src/platform/adapters/bounded-file-read.js +11 -5
  52. package/esm/src/platform/adapters/file-snapshot-error.d.ts +2 -0
  53. package/esm/src/platform/adapters/file-snapshot-error.d.ts.map +1 -1
  54. package/esm/src/platform/adapters/file-snapshot-error.js +2 -0
  55. package/esm/src/platform/adapters/file-system-capabilities.d.ts +74 -0
  56. package/esm/src/platform/adapters/file-system-capabilities.d.ts.map +1 -0
  57. package/esm/src/platform/adapters/file-system-capabilities.js +508 -0
  58. package/esm/src/platform/adapters/native-file-system-provenance.d.ts +6 -0
  59. package/esm/src/platform/adapters/native-file-system-provenance.d.ts.map +1 -0
  60. package/esm/src/platform/adapters/native-file-system-provenance.js +15 -0
  61. package/esm/src/platform/adapters/runtime/deno/filesystem-adapter.d.ts +45 -0
  62. package/esm/src/platform/adapters/runtime/deno/filesystem-adapter.d.ts.map +1 -0
  63. package/esm/src/platform/adapters/runtime/deno/filesystem-adapter.js +291 -0
  64. package/esm/src/platform/adapters/runtime/shared/node-filesystem-adapter.d.ts +71 -0
  65. package/esm/src/platform/adapters/runtime/shared/node-filesystem-adapter.d.ts.map +1 -0
  66. package/esm/src/platform/adapters/runtime/shared/node-filesystem-adapter.js +471 -0
  67. package/esm/src/platform/adapters/runtime/shared/shared-watcher.d.ts +16 -0
  68. package/esm/src/platform/adapters/runtime/shared/shared-watcher.d.ts.map +1 -0
  69. package/esm/src/platform/adapters/runtime/shared/shared-watcher.js +140 -0
  70. package/esm/src/platform/adapters/runtime/shared/temp-dir.d.ts +2 -0
  71. package/esm/src/platform/adapters/runtime/shared/temp-dir.d.ts.map +1 -0
  72. package/esm/src/platform/adapters/runtime/shared/temp-dir.js +10 -0
  73. package/esm/src/platform/adapters/runtime/shared/watcher-queue.d.ts +5 -0
  74. package/esm/src/platform/adapters/runtime/shared/watcher-queue.d.ts.map +1 -0
  75. package/esm/src/platform/adapters/runtime/shared/watcher-queue.js +75 -0
  76. package/esm/src/platform/compat/abort-signal.d.ts +20 -0
  77. package/esm/src/platform/compat/abort-signal.d.ts.map +1 -0
  78. package/esm/src/platform/compat/abort-signal.js +64 -0
  79. package/esm/src/platform/compat/constants.d.ts +2 -2
  80. package/esm/src/platform/compat/constants.d.ts.map +1 -1
  81. package/esm/src/platform/compat/constants.js +2 -2
  82. package/esm/src/platform/compat/error-introspection.d.ts +37 -0
  83. package/esm/src/platform/compat/error-introspection.d.ts.map +1 -0
  84. package/esm/src/platform/compat/error-introspection.js +258 -0
  85. package/esm/src/platform/compat/fs.d.ts +29 -8
  86. package/esm/src/platform/compat/fs.d.ts.map +1 -1
  87. package/esm/src/platform/compat/fs.js +123 -57
  88. package/esm/src/platform/compat/native-brand-checks.d.ts +14 -0
  89. package/esm/src/platform/compat/native-brand-checks.d.ts.map +1 -0
  90. package/esm/src/platform/compat/native-brand-checks.js +68 -0
  91. package/esm/src/platform/compat/not-found-error.d.ts +8 -3
  92. package/esm/src/platform/compat/not-found-error.d.ts.map +1 -1
  93. package/esm/src/platform/compat/not-found-error.js +164 -31
  94. package/esm/src/platform/compat/path/security.d.ts.map +1 -1
  95. package/esm/src/platform/compat/path/security.js +3 -5
  96. package/esm/src/platform/compat/process/command.d.ts +24 -1
  97. package/esm/src/platform/compat/process/command.d.ts.map +1 -1
  98. package/esm/src/platform/compat/process/command.js +393 -78
  99. package/esm/src/platform/compat/process/env.d.ts +11 -0
  100. package/esm/src/platform/compat/process/env.d.ts.map +1 -1
  101. package/esm/src/platform/compat/process/env.js +28 -38
  102. package/esm/src/platform/compat/process/global-error.d.ts +19 -0
  103. package/esm/src/platform/compat/process/global-error.d.ts.map +1 -0
  104. package/esm/src/platform/compat/process/global-error.js +57 -0
  105. package/esm/src/platform/compat/process/lifecycle.d.ts +10 -3
  106. package/esm/src/platform/compat/process/lifecycle.d.ts.map +1 -1
  107. package/esm/src/platform/compat/process/lifecycle.js +74 -23
  108. package/esm/src/platform/compat/process/project-env-contract.d.ts +19 -0
  109. package/esm/src/platform/compat/process/project-env-contract.d.ts.map +1 -0
  110. package/esm/src/platform/compat/process/project-env-contract.js +19 -0
  111. package/esm/src/platform/compat/runtime.d.ts +14 -5
  112. package/esm/src/platform/compat/runtime.d.ts.map +1 -1
  113. package/esm/src/platform/compat/runtime.js +34 -9
  114. package/esm/src/platform/compat/std/front-matter-yaml.d.ts +12 -0
  115. package/esm/src/platform/compat/std/front-matter-yaml.d.ts.map +1 -1
  116. package/esm/src/platform/compat/std/front-matter-yaml.js +35 -3
  117. package/esm/src/platform/compat/temp-directory-prefix.d.ts +8 -0
  118. package/esm/src/platform/compat/temp-directory-prefix.d.ts.map +1 -0
  119. package/esm/src/platform/compat/temp-directory-prefix.js +15 -0
  120. package/esm/src/utils/abort.d.ts +10 -0
  121. package/esm/src/utils/abort.d.ts.map +1 -0
  122. package/esm/src/utils/abort.js +35 -0
  123. package/esm/src/utils/constants/build.d.ts +3 -0
  124. package/esm/src/utils/constants/build.d.ts.map +1 -1
  125. package/esm/src/utils/constants/build.js +5 -1
  126. package/esm/src/utils/constants/cache.d.ts +21 -0
  127. package/esm/src/utils/constants/cache.d.ts.map +1 -1
  128. package/esm/src/utils/constants/cache.js +101 -39
  129. package/esm/src/utils/constants/css.d.ts +20 -0
  130. package/esm/src/utils/constants/css.d.ts.map +1 -0
  131. package/esm/src/utils/constants/css.js +19 -0
  132. package/esm/src/utils/constants/limits.d.ts +4 -0
  133. package/esm/src/utils/constants/limits.d.ts.map +1 -1
  134. package/esm/src/utils/constants/limits.js +4 -0
  135. package/esm/src/utils/constants/project-identity.d.ts +5 -0
  136. package/esm/src/utils/constants/project-identity.d.ts.map +1 -0
  137. package/esm/src/utils/constants/project-identity.js +4 -0
  138. package/esm/src/utils/constants/retry.d.ts +18 -0
  139. package/esm/src/utils/constants/retry.d.ts.map +1 -1
  140. package/esm/src/utils/constants/retry.js +18 -0
  141. package/esm/src/utils/constants/security.d.ts +4 -0
  142. package/esm/src/utils/constants/security.d.ts.map +1 -1
  143. package/esm/src/utils/constants/security.js +4 -0
  144. package/esm/src/utils/index.d.ts +3 -1
  145. package/esm/src/utils/index.d.ts.map +1 -1
  146. package/esm/src/utils/index.js +3 -1
  147. package/esm/src/utils/logger/core.d.ts +5 -0
  148. package/esm/src/utils/logger/core.d.ts.map +1 -1
  149. package/esm/src/utils/logger/core.js +67 -2
  150. package/esm/src/utils/logger/redact.d.ts +36 -13
  151. package/esm/src/utils/logger/redact.d.ts.map +1 -1
  152. package/esm/src/utils/logger/redact.js +573 -83
  153. package/esm/src/utils/parallel.d.ts.map +1 -1
  154. package/esm/src/utils/parallel.js +11 -1
  155. package/esm/src/utils/project-identity.d.ts +11 -0
  156. package/esm/src/utils/project-identity.d.ts.map +1 -0
  157. package/esm/src/utils/project-identity.js +69 -0
  158. package/esm/src/utils/version-constant.d.ts +1 -1
  159. package/esm/src/utils/version-constant.js +1 -1
  160. package/package.json +3 -3
  161. package/esm/src/platform/adapters/runtime/shared/native-file-capabilities.d.ts +0 -33
  162. package/esm/src/platform/adapters/runtime/shared/native-file-capabilities.d.ts.map +0 -1
  163. package/esm/src/platform/adapters/runtime/shared/native-file-capabilities.js +0 -205
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Resource limits owned by the observability boundary.
3
+ *
4
+ * OpenTelemetry's stable default attribute-count limit is 128. The remaining
5
+ * limits keep core-owned snapshots and asynchronous file-log work bounded
6
+ * before an exporter or filesystem adapter receives them.
7
+ */
8
+ export declare const MAX_TELEMETRY_ATTRIBUTE_COUNT = 128;
9
+ export declare const MAX_TELEMETRY_ATTRIBUTE_KEY_LENGTH = 255;
10
+ export declare const MAX_TELEMETRY_ATTRIBUTE_ARRAY_LENGTH = 128;
11
+ export declare const MAX_STRUCTURED_TELEMETRY_DEPTH = 16;
12
+ export declare const MAX_STRUCTURED_TELEMETRY_CONTAINER_ENTRIES = 1024;
13
+ export declare const MAX_STRUCTURED_TELEMETRY_NODES = 4096;
14
+ export declare const MAX_FILE_LOG_PENDING_WRITES = 256;
15
+ export declare const MAX_FILE_LOG_RETAINED_FAILURES = 16;
16
+ export declare const MAX_OBSERVABILITY_CONFIG_TEXT_LENGTH = 4096;
17
+ export declare const MAX_OBSERVABILITY_NAME_LENGTH = 255;
18
+ export declare const MAX_APPLICATION_ERROR_CONTEXT_VALUE_LENGTH = 1000;
19
+ export declare const MAX_REQUEST_PROFILE_PHASES = 128;
20
+ //# sourceMappingURL=limits.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../../../src/src/observability/limits.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,6BAA6B,MAAM,CAAC;AACjD,eAAO,MAAM,kCAAkC,MAAM,CAAC;AACtD,eAAO,MAAM,oCAAoC,MAAM,CAAC;AAExD,eAAO,MAAM,8BAA8B,KAAK,CAAC;AACjD,eAAO,MAAM,0CAA0C,OAAQ,CAAC;AAChE,eAAO,MAAM,8BAA8B,OAAQ,CAAC;AAEpD,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAC/C,eAAO,MAAM,8BAA8B,KAAK,CAAC;AAEjD,eAAO,MAAM,oCAAoC,OAAQ,CAAC;AAC1D,eAAO,MAAM,6BAA6B,MAAM,CAAC;AACjD,eAAO,MAAM,0CAA0C,OAAQ,CAAC;AAChE,eAAO,MAAM,0BAA0B,MAAM,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Resource limits owned by the observability boundary.
3
+ *
4
+ * OpenTelemetry's stable default attribute-count limit is 128. The remaining
5
+ * limits keep core-owned snapshots and asynchronous file-log work bounded
6
+ * before an exporter or filesystem adapter receives them.
7
+ */
8
+ export const MAX_TELEMETRY_ATTRIBUTE_COUNT = 128;
9
+ export const MAX_TELEMETRY_ATTRIBUTE_KEY_LENGTH = 255;
10
+ export const MAX_TELEMETRY_ATTRIBUTE_ARRAY_LENGTH = 128;
11
+ export const MAX_STRUCTURED_TELEMETRY_DEPTH = 16;
12
+ export const MAX_STRUCTURED_TELEMETRY_CONTAINER_ENTRIES = 1_024;
13
+ export const MAX_STRUCTURED_TELEMETRY_NODES = 4_096;
14
+ export const MAX_FILE_LOG_PENDING_WRITES = 256;
15
+ export const MAX_FILE_LOG_RETAINED_FAILURES = 16;
16
+ export const MAX_OBSERVABILITY_CONFIG_TEXT_LENGTH = 4_096;
17
+ export const MAX_OBSERVABILITY_NAME_LENGTH = 255;
18
+ export const MAX_APPLICATION_ERROR_CONTEXT_VALUE_LENGTH = 1_000;
19
+ export const MAX_REQUEST_PROFILE_PHASES = 128;
@@ -0,0 +1,22 @@
1
+ export type TelemetryAttributeValue = string | number | boolean | readonly (string | number | boolean)[] | undefined;
2
+ /** Redact and bound text before retaining it or handing it to a provider. */
3
+ export declare function sanitizeTelemetryText(value: string, maxLength: number): string;
4
+ /** Redact a single flattened telemetry attribute. */
5
+ export declare function sanitizeTelemetryAttributeValue(key: string, value: TelemetryAttributeValue): TelemetryAttributeValue;
6
+ /** Return a redacted copy of a flattened telemetry attribute record. */
7
+ export declare function sanitizeTelemetryAttributes<T extends Record<string, TelemetryAttributeValue> | undefined>(attributes: T): T;
8
+ /**
9
+ * Return a detached, fail-closed snapshot suitable for retained logs and
10
+ * errors. Credential-like keys and URL credentials are redacted recursively.
11
+ */
12
+ export declare function sanitizeStructuredTelemetryData<T>(value: T): T;
13
+ /**
14
+ * Create an error safe to send to telemetry backends without mutating or
15
+ * replacing the application error that will be returned to the caller.
16
+ *
17
+ * Native errors are classified through a hook-free runtime brand check. Older
18
+ * supported runtimes use the platform compatibility implementation instead of
19
+ * the unsafe `instanceof` fallback that executes Proxy traps.
20
+ */
21
+ export declare function sanitizeErrorForTelemetry(error: unknown): Error;
22
+ //# sourceMappingURL=telemetry-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry-error.d.ts","sourceRoot":"","sources":["../../../src/src/observability/telemetry-error.ts"],"names":[],"mappings":"AAiJA,MAAM,MAAM,uBAAuB,GAC/B,MAAM,GACN,MAAM,GACN,OAAO,GACP,SAAS,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,EAAE,GACtC,SAAS,CAAC;AAUd,6EAA6E;AAC7E,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAK9E;AAED,qDAAqD;AACrD,wBAAgB,+BAA+B,CAC7C,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,uBAAuB,GAC7B,uBAAuB,CAyBzB;AAED,wEAAwE;AACxE,wBAAgB,2BAA2B,CACzC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,GAAG,SAAS,EAC7D,UAAU,EAAE,CAAC,GAAG,CAAC,CAyClB;AA4JD;;;GAGG;AACH,wBAAgB,+BAA+B,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAc9D;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,CAwB/D"}
@@ -0,0 +1,377 @@
1
+ import { isSensitiveKey, REDACTED, sanitizeUrlCredentials, } from "../utils/logger/redact.js";
2
+ import { LOG_PREVIEW_MAX_LENGTH_CHARS, MAX_STRING_DISPLAY_LENGTH, MAX_TRACE_ATTRIBUTE_VALUE_SIZE, } from "../utils/constants/index.js";
3
+ import { MAX_OBSERVABILITY_CONFIG_TEXT_LENGTH, MAX_STRUCTURED_TELEMETRY_CONTAINER_ENTRIES, MAX_STRUCTURED_TELEMETRY_DEPTH, MAX_STRUCTURED_TELEMETRY_NODES, MAX_TELEMETRY_ATTRIBUTE_ARRAY_LENGTH, MAX_TELEMETRY_ATTRIBUTE_COUNT, MAX_TELEMETRY_ATTRIBUTE_KEY_LENGTH, } from "./limits.js";
4
+ import { isNativeErrorWithoutHooks, isProxyWithoutHooks, readNativeErrorNameWithoutHooks, readNativeErrorStackWithoutHooks, } from "../platform/compat/error-introspection.js";
5
+ const apply = Reflect.apply;
6
+ const createObject = Object.create;
7
+ const defineProperty = Object.defineProperty;
8
+ const getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
9
+ const objectKeys = Object.keys;
10
+ const deleteProperty = Reflect.deleteProperty;
11
+ const mathMax = Math.max;
12
+ const NativeDate = Date;
13
+ const NativeError = Error;
14
+ const NativeString = String;
15
+ const NativeURL = URL;
16
+ const dateGetTime = Date.prototype.getTime;
17
+ const objectHasOwnProperty = Object.prototype.hasOwnProperty;
18
+ const stringSlice = String.prototype.slice;
19
+ const ERROR_PROTOTYPE = NativeError.prototype;
20
+ const URL_HREF_GETTER = readOwnDescriptorGetter(NativeURL.prototype, "href");
21
+ const INVALID_ERROR_FIELD = Symbol("invalid-error-field");
22
+ function hasOwn(object, key) {
23
+ return apply(objectHasOwnProperty, object, [key]);
24
+ }
25
+ function readOwnDescriptorGetter(object, key) {
26
+ try {
27
+ const descriptor = getOwnPropertyDescriptor(object, key);
28
+ if (!descriptor || !hasOwn(descriptor, "get"))
29
+ return undefined;
30
+ const getter = descriptor.get;
31
+ return typeof getter === "function" ? getter : undefined;
32
+ }
33
+ catch (_) {
34
+ return undefined;
35
+ }
36
+ }
37
+ function readOwnErrorString(error, key) {
38
+ try {
39
+ const descriptor = getOwnPropertyDescriptor(error, key);
40
+ if (!descriptor)
41
+ return undefined;
42
+ if (!hasOwn(descriptor, "value"))
43
+ return INVALID_ERROR_FIELD;
44
+ const value = descriptor.value;
45
+ return typeof value === "string" ? value : INVALID_ERROR_FIELD;
46
+ }
47
+ catch (_) {
48
+ return INVALID_ERROR_FIELD;
49
+ }
50
+ }
51
+ function readNativeErrorMessage(error) {
52
+ const ownMessage = readOwnErrorString(error, "message");
53
+ if (typeof ownMessage === "string")
54
+ return ownMessage;
55
+ if (ownMessage === INVALID_ERROR_FIELD)
56
+ return "Unknown error";
57
+ return "";
58
+ }
59
+ function readNativeErrorStack(error) {
60
+ // Real runtime errors expose `stack` as an accessor, so the descriptor's
61
+ // value alone never carries one. The compat reader invokes the runtime's own
62
+ // getter behind a shadowed formatter and fails closed on foreign accessors.
63
+ return readNativeErrorStackWithoutHooks(error);
64
+ }
65
+ function primitiveErrorMessage(error) {
66
+ if ((typeof error === "object" && error !== null) ||
67
+ typeof error === "function") {
68
+ return "Unknown error";
69
+ }
70
+ try {
71
+ return NativeString(error);
72
+ }
73
+ catch (_) {
74
+ return "Unknown error";
75
+ }
76
+ }
77
+ function createDataDescriptor(value) {
78
+ const descriptor = createObject(null);
79
+ descriptor.configurable = true;
80
+ descriptor.enumerable = false;
81
+ descriptor.value = value;
82
+ descriptor.writable = true;
83
+ return descriptor;
84
+ }
85
+ function createErrorShapedRecord(message, name, stack) {
86
+ const sanitized = createObject(ERROR_PROTOTYPE);
87
+ defineProperty(sanitized, "message", createDataDescriptor(message));
88
+ defineProperty(sanitized, "name", createDataDescriptor(name));
89
+ defineProperty(sanitized, "stack", createDataDescriptor(stack));
90
+ return sanitized;
91
+ }
92
+ function createDetachedTelemetryError(message, name, stack) {
93
+ const sanitized = new NativeError();
94
+ // Deleting V8's configurable lazy stack does not materialize it. Redefining
95
+ // the property directly does on older V8 releases and can therefore execute
96
+ // Error.prepareStackTrace.
97
+ if (!deleteProperty(sanitized, "stack")) {
98
+ return createErrorShapedRecord(message, name, stack);
99
+ }
100
+ defineProperty(sanitized, "message", createDataDescriptor(message));
101
+ defineProperty(sanitized, "name", createDataDescriptor(name));
102
+ defineProperty(sanitized, "stack", createDataDescriptor(stack));
103
+ return sanitized;
104
+ }
105
+ const SEMANTIC_TOKEN_COUNT_ATTRIBUTE = /(?:^|[._-])(?:input|output|total|prompt|completion)[._-]?tokens?$/i;
106
+ function isNumericSemanticTokenCount(key, value) {
107
+ return typeof value === "number" && Number.isFinite(value) &&
108
+ SEMANTIC_TOKEN_COUNT_ATTRIBUTE.test(key);
109
+ }
110
+ /** Redact and bound text before retaining it or handing it to a provider. */
111
+ export function sanitizeTelemetryText(value, maxLength) {
112
+ const sanitized = sanitizeUrlCredentials(value);
113
+ if (sanitized.length <= maxLength)
114
+ return sanitized;
115
+ const end = apply(mathMax, Math, [0, maxLength - 1]);
116
+ return `${apply(stringSlice, sanitized, [0, end])}…`;
117
+ }
118
+ /** Redact a single flattened telemetry attribute. */
119
+ export function sanitizeTelemetryAttributeValue(key, value) {
120
+ if (isSensitiveKey(key) && !isNumericSemanticTokenCount(key, value))
121
+ return REDACTED;
122
+ if (typeof value === "string") {
123
+ return sanitizeTelemetryText(value, MAX_TRACE_ATTRIBUTE_VALUE_SIZE);
124
+ }
125
+ if (typeof value === "number" && !Number.isFinite(value))
126
+ return undefined;
127
+ if (Array.isArray(value)) {
128
+ try {
129
+ if (value.length > MAX_TELEMETRY_ATTRIBUTE_ARRAY_LENGTH)
130
+ return REDACTED;
131
+ const sanitized = [];
132
+ for (let index = 0; index < value.length; index++) {
133
+ const item = value[index];
134
+ if (typeof item === "number" && !Number.isFinite(item))
135
+ return REDACTED;
136
+ sanitized.push(typeof item === "string"
137
+ ? sanitizeTelemetryText(item, MAX_TRACE_ATTRIBUTE_VALUE_SIZE)
138
+ : item);
139
+ }
140
+ return sanitized;
141
+ }
142
+ catch (_) {
143
+ return REDACTED;
144
+ }
145
+ }
146
+ return value;
147
+ }
148
+ /** Return a redacted copy of a flattened telemetry attribute record. */
149
+ export function sanitizeTelemetryAttributes(attributes) {
150
+ if (!attributes)
151
+ return attributes;
152
+ let keys;
153
+ try {
154
+ keys = objectKeys(attributes);
155
+ }
156
+ catch (_) {
157
+ return {};
158
+ }
159
+ const sanitized = {};
160
+ const retainedKeys = new Set();
161
+ const keyCount = keys.length < MAX_TELEMETRY_ATTRIBUTE_COUNT
162
+ ? keys.length
163
+ : MAX_TELEMETRY_ATTRIBUTE_COUNT;
164
+ for (let index = 0; index < keyCount; index++) {
165
+ const key = keys[index];
166
+ if (key === undefined)
167
+ continue;
168
+ const boundedKey = key.length <= MAX_TELEMETRY_ATTRIBUTE_KEY_LENGTH
169
+ ? key
170
+ : apply(stringSlice, key, [0, MAX_TELEMETRY_ATTRIBUTE_KEY_LENGTH]);
171
+ if (!boundedKey || retainedKeys.has(boundedKey))
172
+ continue;
173
+ let value = REDACTED;
174
+ if (!isSensitiveKey(key) || SEMANTIC_TOKEN_COUNT_ATTRIBUTE.test(key)) {
175
+ try {
176
+ value = sanitizeTelemetryAttributeValue(key, attributes[key]);
177
+ }
178
+ catch (_) {
179
+ value = REDACTED;
180
+ }
181
+ }
182
+ if (value === undefined)
183
+ continue;
184
+ defineProperty(sanitized, boundedKey, {
185
+ configurable: true,
186
+ enumerable: true,
187
+ value,
188
+ writable: true,
189
+ });
190
+ retainedKeys.add(boundedKey);
191
+ }
192
+ return sanitized;
193
+ }
194
+ function cloneNativeDate(value) {
195
+ try {
196
+ const timestamp = apply(dateGetTime, value, []);
197
+ return new NativeDate(timestamp);
198
+ }
199
+ catch (_) {
200
+ return undefined;
201
+ }
202
+ }
203
+ const NOT_NATIVE_URL = Symbol("not-native-url");
204
+ function cloneNativeUrl(value) {
205
+ if (!URL_HREF_GETTER)
206
+ return NOT_NATIVE_URL;
207
+ let href;
208
+ try {
209
+ href = apply(URL_HREF_GETTER, value, []);
210
+ }
211
+ catch (_) {
212
+ return NOT_NATIVE_URL;
213
+ }
214
+ if (typeof href !== "string")
215
+ return REDACTED;
216
+ try {
217
+ const sanitizedHref = sanitizeUrlCredentials(href);
218
+ if (sanitizedHref.length > MAX_OBSERVABILITY_CONFIG_TEXT_LENGTH)
219
+ return REDACTED;
220
+ return new NativeURL(sanitizedHref);
221
+ }
222
+ catch (_) {
223
+ return REDACTED;
224
+ }
225
+ }
226
+ function snapshotStructuredError(value) {
227
+ const snapshot = sanitizeErrorForTelemetry(value);
228
+ return {
229
+ message: snapshot.message,
230
+ name: snapshot.name,
231
+ stack: snapshot.stack,
232
+ };
233
+ }
234
+ function sanitizeStructuredValue(value, depth, seen, budget) {
235
+ if (budget.remainingNodes <= 0) {
236
+ budget.exhausted = true;
237
+ return REDACTED;
238
+ }
239
+ budget.remainingNodes--;
240
+ if (typeof value === "string") {
241
+ return sanitizeTelemetryText(value, MAX_STRING_DISPLAY_LENGTH);
242
+ }
243
+ if (value === null || value === undefined || typeof value === "number" ||
244
+ typeof value === "boolean" || typeof value === "bigint") {
245
+ return value;
246
+ }
247
+ if (typeof value === "symbol" || typeof value === "function")
248
+ return REDACTED;
249
+ if (depth >= MAX_STRUCTURED_TELEMETRY_DEPTH || seen.has(value))
250
+ return REDACTED;
251
+ if (isProxyWithoutHooks(value))
252
+ return REDACTED;
253
+ if (isNativeErrorWithoutHooks(value))
254
+ return snapshotStructuredError(value);
255
+ const clonedDate = cloneNativeDate(value);
256
+ if (clonedDate)
257
+ return clonedDate;
258
+ const clonedUrl = cloneNativeUrl(value);
259
+ if (clonedUrl !== NOT_NATIVE_URL)
260
+ return clonedUrl;
261
+ seen.add(value);
262
+ try {
263
+ let toJSON;
264
+ try {
265
+ toJSON = value.toJSON;
266
+ }
267
+ catch (_) {
268
+ return REDACTED;
269
+ }
270
+ if (typeof toJSON === "function") {
271
+ try {
272
+ return sanitizeStructuredValue(toJSON.call(value), depth + 1, seen, budget);
273
+ }
274
+ catch (_) {
275
+ return REDACTED;
276
+ }
277
+ }
278
+ if (Array.isArray(value)) {
279
+ if (value.length > MAX_STRUCTURED_TELEMETRY_CONTAINER_ENTRIES) {
280
+ return REDACTED;
281
+ }
282
+ const copy = [];
283
+ for (let index = 0; index < value.length; index++) {
284
+ try {
285
+ copy.push(sanitizeStructuredValue(value[index], depth + 1, seen, budget));
286
+ }
287
+ catch (_) {
288
+ copy.push(REDACTED);
289
+ }
290
+ if (budget.exhausted)
291
+ return REDACTED;
292
+ }
293
+ return copy;
294
+ }
295
+ let keys;
296
+ try {
297
+ keys = objectKeys(value);
298
+ }
299
+ catch (_) {
300
+ return REDACTED;
301
+ }
302
+ if (keys.length > MAX_STRUCTURED_TELEMETRY_CONTAINER_ENTRIES) {
303
+ return REDACTED;
304
+ }
305
+ const copy = {};
306
+ const retainedKeys = new Set();
307
+ for (const key of keys) {
308
+ const boundedKey = sanitizeTelemetryText(key, LOG_PREVIEW_MAX_LENGTH_CHARS);
309
+ if (retainedKeys.has(boundedKey))
310
+ return REDACTED;
311
+ let child = REDACTED;
312
+ if (!isSensitiveKey(key)) {
313
+ try {
314
+ child = sanitizeStructuredValue(value[key], depth + 1, seen, budget);
315
+ }
316
+ catch (_) {
317
+ child = REDACTED;
318
+ }
319
+ }
320
+ if (budget.exhausted)
321
+ return REDACTED;
322
+ defineProperty(copy, boundedKey, {
323
+ configurable: true,
324
+ enumerable: true,
325
+ value: child,
326
+ writable: true,
327
+ });
328
+ retainedKeys.add(boundedKey);
329
+ }
330
+ return copy;
331
+ }
332
+ finally {
333
+ seen.delete(value);
334
+ }
335
+ }
336
+ /**
337
+ * Return a detached, fail-closed snapshot suitable for retained logs and
338
+ * errors. Credential-like keys and URL credentials are redacted recursively.
339
+ */
340
+ export function sanitizeStructuredTelemetryData(value) {
341
+ try {
342
+ return sanitizeStructuredValue(value, 0, new Set(), {
343
+ exhausted: false,
344
+ remainingNodes: MAX_STRUCTURED_TELEMETRY_NODES,
345
+ });
346
+ }
347
+ catch (_) {
348
+ return REDACTED;
349
+ }
350
+ }
351
+ /**
352
+ * Create an error safe to send to telemetry backends without mutating or
353
+ * replacing the application error that will be returned to the caller.
354
+ *
355
+ * Native errors are classified through a hook-free runtime brand check. Older
356
+ * supported runtimes use the platform compatibility implementation instead of
357
+ * the unsafe `instanceof` fallback that executes Proxy traps.
358
+ */
359
+ export function sanitizeErrorForTelemetry(error) {
360
+ try {
361
+ const isError = isNativeErrorWithoutHooks(error);
362
+ const source = isError ? error : undefined;
363
+ const message = sanitizeTelemetryText(source ? readNativeErrorMessage(source) : primitiveErrorMessage(error), MAX_STRING_DISPLAY_LENGTH);
364
+ const name = source
365
+ ? sanitizeTelemetryText(readNativeErrorNameWithoutHooks(source), LOG_PREVIEW_MAX_LENGTH_CHARS)
366
+ : "Unknown";
367
+ const sourceStack = source ? readNativeErrorStack(source) : undefined;
368
+ const stack = sourceStack === undefined
369
+ ? undefined
370
+ : sanitizeTelemetryText(sourceStack, MAX_STRING_DISPLAY_LENGTH);
371
+ return createDetachedTelemetryError(message, name, stack);
372
+ }
373
+ catch (_) {
374
+ // Telemetry is best effort and must never replace the application outcome.
375
+ return createErrorShapedRecord("Unknown error", "Unknown");
376
+ }
377
+ }
@@ -110,6 +110,7 @@ export interface Histogram {
110
110
  }
111
111
  export interface ObservableGauge {
112
112
  addCallback(callback: (result: ObservableResult) => void): void;
113
+ removeCallback?(callback: (result: ObservableResult) => void): void;
113
114
  }
114
115
  export interface Meter {
115
116
  createCounter(name: string, options?: {
@@ -136,6 +137,42 @@ export interface Meter {
136
137
  export interface MetricsAPI {
137
138
  getMeter(name: string | undefined, version?: string): Meter;
138
139
  }
140
+ /** Complete provider facade installed into the process-wide telemetry shim. */
141
+ export interface GlobalTelemetryAPIConfig {
142
+ tracerProvider?: TracerProvider | null;
143
+ metricsApi?: MetricsAPI | null;
144
+ contextAccessor?: ContextAccessor | null;
145
+ activeSpanAccessor?: ActiveSpanAccessor | null;
146
+ propagator?: TextMapPropagator | null;
147
+ }
148
+ /** Opaque ownership identity for one installed telemetry generation. */
149
+ export interface GlobalTelemetryAPIOwner {
150
+ readonly generation: number;
151
+ readonly token: symbol;
152
+ }
153
+ /** Handle returned by an atomic telemetry API installation. */
154
+ export interface GlobalTelemetryAPIInstallation extends GlobalTelemetryAPIOwner {
155
+ /** Clear this generation if it is still current. Stale handles return false. */
156
+ dispose(): boolean;
157
+ }
158
+ /** Immutable point-in-time view of the currently installed telemetry facade. */
159
+ export interface GlobalTelemetryAPISnapshot {
160
+ readonly generation: number;
161
+ readonly tracerProviderRevision: number;
162
+ readonly metricsApiRevision: number;
163
+ readonly tracerProviderInstalled: boolean;
164
+ readonly tracerProvider: TracerProvider;
165
+ readonly metricsApi: MetricsAPI | null;
166
+ readonly contextAccessor: ContextAccessor | null;
167
+ readonly activeSpanAccessor: ActiveSpanAccessor | null;
168
+ readonly propagator: TextMapPropagator | null;
169
+ }
170
+ /** Atomically install one complete telemetry facade and return its owner handle. */
171
+ export declare function installGlobalTelemetryAPI(config: GlobalTelemetryAPIConfig): GlobalTelemetryAPIInstallation;
172
+ /** Clear the current generation without allowing stale owners to clobber it. */
173
+ export declare function clearGlobalTelemetryAPI(owner: GlobalTelemetryAPIOwner): boolean;
174
+ /** Read one internally consistent telemetry facade snapshot. */
175
+ export declare function getGlobalTelemetryAPISnapshot(): GlobalTelemetryAPISnapshot;
139
176
  /**
140
177
  * Register the real OTel trace API's span accessors. Called by the
141
178
  * ext-observability-opentelemetry extension after it wires the SDK so that the shim's
@@ -187,5 +224,7 @@ export declare const defaultTextMapSetter: TextMapSetter<Record<string, string>>
187
224
  */
188
225
  export declare function setGlobalMetricsAPI(api: MetricsAPI): void;
189
226
  export declare function getGlobalMetricsAPI(): MetricsAPI | null;
227
+ /** Monotonic revision used by lazy instruments to detect provider changes. */
228
+ export declare function getMetricsApiRevision(): number;
190
229
  export declare function _resetShimForTests(): void;
191
230
  //# sourceMappingURL=api-shim.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"api-shim.d.ts","sourceRoot":"","sources":["../../../../src/src/observability/tracing/api-shim.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AASH,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAC3D,MAAM,MAAM,cAAc,GAAG,kBAAkB,GAAG,SAAS,kBAAkB,EAAE,GAAG,SAAS,CAAC;AAE5F,MAAM,WAAW,IAAI;IACnB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,GAAG,IAAI,CAAC;IACvD,aAAa,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,GAAG,IAAI,CAAC;IAC3D,SAAS,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC5D,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,GAAG,IAAI,CAAC;IACrE,GAAG,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,WAAW,IAAI,WAAW,CAAC;IAC3B,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,MAAM;IACrB,SAAS,CACP,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE;QACR,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,UAAU,CAAC,EAA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