@sentry/core 10.39.0 → 10.41.0-beta.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.
Files changed (88) hide show
  1. package/build/cjs/client.js +1 -0
  2. package/build/cjs/client.js.map +1 -1
  3. package/build/cjs/exports.js +4 -2
  4. package/build/cjs/exports.js.map +1 -1
  5. package/build/cjs/fetch.js +8 -4
  6. package/build/cjs/fetch.js.map +1 -1
  7. package/build/cjs/index.js +3 -0
  8. package/build/cjs/index.js.map +1 -1
  9. package/build/cjs/integrations/consola.js.map +1 -1
  10. package/build/cjs/tracing/ai/mediaStripping.js +135 -0
  11. package/build/cjs/tracing/ai/mediaStripping.js.map +1 -0
  12. package/build/cjs/tracing/ai/messageTruncation.js +18 -60
  13. package/build/cjs/tracing/ai/messageTruncation.js.map +1 -1
  14. package/build/cjs/tracing/anthropic-ai/index.js +1 -1
  15. package/build/cjs/tracing/anthropic-ai/index.js.map +1 -1
  16. package/build/cjs/tracing/google-genai/index.js +1 -1
  17. package/build/cjs/tracing/google-genai/index.js.map +1 -1
  18. package/build/cjs/tracing/langgraph/index.js +1 -1
  19. package/build/cjs/tracing/langgraph/index.js.map +1 -1
  20. package/build/cjs/tracing/openai/index.js +1 -1
  21. package/build/cjs/tracing/openai/index.js.map +1 -1
  22. package/build/cjs/utils/misc.js +7 -0
  23. package/build/cjs/utils/misc.js.map +1 -1
  24. package/build/cjs/utils/node-stack-trace.js +11 -2
  25. package/build/cjs/utils/node-stack-trace.js.map +1 -1
  26. package/build/cjs/utils/tunnel.js +74 -0
  27. package/build/cjs/utils/tunnel.js.map +1 -0
  28. package/build/cjs/utils/version.js +1 -1
  29. package/build/cjs/utils/version.js.map +1 -1
  30. package/build/cjs/utils/worldwide.js.map +1 -1
  31. package/build/esm/client.js +1 -0
  32. package/build/esm/client.js.map +1 -1
  33. package/build/esm/exports.js +4 -2
  34. package/build/esm/exports.js.map +1 -1
  35. package/build/esm/fetch.js +8 -4
  36. package/build/esm/fetch.js.map +1 -1
  37. package/build/esm/index.js +2 -1
  38. package/build/esm/index.js.map +1 -1
  39. package/build/esm/integrations/consola.js.map +1 -1
  40. package/build/esm/package.json +1 -1
  41. package/build/esm/tracing/ai/mediaStripping.js +132 -0
  42. package/build/esm/tracing/ai/mediaStripping.js.map +1 -0
  43. package/build/esm/tracing/ai/messageTruncation.js +12 -54
  44. package/build/esm/tracing/ai/messageTruncation.js.map +1 -1
  45. package/build/esm/tracing/anthropic-ai/index.js +1 -1
  46. package/build/esm/tracing/anthropic-ai/index.js.map +1 -1
  47. package/build/esm/tracing/google-genai/index.js +1 -1
  48. package/build/esm/tracing/google-genai/index.js.map +1 -1
  49. package/build/esm/tracing/langgraph/index.js +1 -1
  50. package/build/esm/tracing/langgraph/index.js.map +1 -1
  51. package/build/esm/tracing/openai/index.js +1 -1
  52. package/build/esm/tracing/openai/index.js.map +1 -1
  53. package/build/esm/utils/misc.js +7 -1
  54. package/build/esm/utils/misc.js.map +1 -1
  55. package/build/esm/utils/node-stack-trace.js +11 -2
  56. package/build/esm/utils/node-stack-trace.js.map +1 -1
  57. package/build/esm/utils/tunnel.js +72 -0
  58. package/build/esm/utils/tunnel.js.map +1 -0
  59. package/build/esm/utils/version.js +1 -1
  60. package/build/esm/utils/version.js.map +1 -1
  61. package/build/esm/utils/worldwide.js.map +1 -1
  62. package/build/types/client.d.ts.map +1 -1
  63. package/build/types/exports.d.ts.map +1 -1
  64. package/build/types/fetch.d.ts.map +1 -1
  65. package/build/types/index.d.ts +3 -1
  66. package/build/types/index.d.ts.map +1 -1
  67. package/build/types/integrations/consola.d.ts +8 -1
  68. package/build/types/integrations/consola.d.ts.map +1 -1
  69. package/build/types/tracing/ai/mediaStripping.d.ts +40 -0
  70. package/build/types/tracing/ai/mediaStripping.d.ts.map +1 -0
  71. package/build/types/tracing/ai/messageTruncation.d.ts.map +1 -1
  72. package/build/types/types-hoist/replay.d.ts +1 -0
  73. package/build/types/types-hoist/replay.d.ts.map +1 -1
  74. package/build/types/utils/misc.d.ts +7 -0
  75. package/build/types/utils/misc.d.ts.map +1 -1
  76. package/build/types/utils/node-stack-trace.d.ts.map +1 -1
  77. package/build/types/utils/tunnel.d.ts +16 -0
  78. package/build/types/utils/tunnel.d.ts.map +1 -0
  79. package/build/types/utils/worldwide.d.ts +0 -2
  80. package/build/types/utils/worldwide.d.ts.map +1 -1
  81. package/build/types-ts3.8/index.d.ts +3 -1
  82. package/build/types-ts3.8/integrations/consola.d.ts +8 -1
  83. package/build/types-ts3.8/tracing/ai/mediaStripping.d.ts +40 -0
  84. package/build/types-ts3.8/types-hoist/replay.d.ts +4 -0
  85. package/build/types-ts3.8/utils/misc.d.ts +7 -0
  86. package/build/types-ts3.8/utils/tunnel.d.ts +16 -0
  87. package/build/types-ts3.8/utils/worldwide.d.ts +0 -2
  88. package/package.json +2 -3
@@ -34,6 +34,8 @@ export { hasSpansEnabled } from './utils/hasSpansEnabled';
34
34
  export { isSentryRequestUrl } from './utils/isSentryRequestUrl';
35
35
  export { handleCallbackErrors } from './utils/handleCallbackErrors';
36
36
  export { parameterize, fmt } from './utils/parameterize';
37
+ export { HandleTunnelRequestOptions } from './utils/tunnel';
38
+ export { handleTunnelRequest } from './utils/tunnel';
37
39
  export { addAutoIpAddressToSession } from './utils/ipAddress';
38
40
  export { addAutoIpAddressToUser } from './utils/ipAddress';
39
41
  export { convertSpanLinksForEnvelope, spanToTraceHeader, spanToJSON, spanIsSampled, spanToTraceContext, getSpanDescendants, getStatusMessage, getRootSpan, getActiveSpan, addChildSpanToSpan, spanTimeInputToSeconds, updateSpanName, } from './utils/spanUtils';
@@ -115,7 +117,7 @@ export { isDOMError, isDOMException, isElement, isError, isErrorEvent, isEvent,
115
117
  export { isBrowser } from './utils/isBrowser';
116
118
  export { CONSOLE_LEVELS, consoleSandbox, debug, originalConsoleMethods } from './utils/debug-logger';
117
119
  export { SentryDebugLogger } from './utils/debug-logger';
118
- export { addContextToFrame, addExceptionMechanism, addExceptionTypeValue, checkOrSetAlreadyCaught, getEventDescription, parseSemver, uuid4, } from './utils/misc';
120
+ export { addContextToFrame, addExceptionMechanism, addExceptionTypeValue, checkOrSetAlreadyCaught, isAlreadyCaptured, getEventDescription, parseSemver, uuid4, } from './utils/misc';
119
121
  export { isNodeEnv, loadModule } from './utils/node';
120
122
  export { normalize, normalizeToSize, normalizeUrlToBase } from './utils/normalize';
121
123
  export { addNonEnumerableProperty, convertToPlainObject, dropUndefinedKeys, extractExceptionKeysForMessage, fill, getOriginalFunction, markFunctionWrapped, objectify, } from './utils/object';
@@ -112,13 +112,20 @@ export interface ConsolaLogObject {
112
112
  /**
113
113
  * The raw arguments passed to the log method.
114
114
  *
115
- * When `message` is not provided, these args are typically formatted into the final message.
115
+ * These args are typically formatted into the final `message`. In Consola reporters, `message` is not provided.
116
116
  *
117
117
  * @example
118
118
  * ```ts
119
119
  * consola.info('Hello', 'world', { user: 'john' });
120
120
  * // args = ['Hello', 'world', { user: 'john' }]
121
121
  * ```
122
+ *
123
+ * @example
124
+ * ```ts
125
+ * // `message` is a reserved property in Consola
126
+ * consola.log({ message: 'Hello' });
127
+ * // args = ['Hello']
128
+ * ```
122
129
  */
123
130
  args?: unknown[];
124
131
  /**
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Inline media content source, with a potentially very large base64
3
+ * blob or data: uri.
4
+ */
5
+ export type ContentMedia = Record<string, unknown> & ({
6
+ media_type: string;
7
+ data: string;
8
+ } | {
9
+ image_url: string;
10
+ } | {
11
+ image_url: {
12
+ url: string;
13
+ };
14
+ } | {
15
+ type: 'blob' | 'base64';
16
+ content: string;
17
+ } | {
18
+ b64_json: string;
19
+ } | {
20
+ uri: string;
21
+ } | {
22
+ type: 'input_audio';
23
+ input_audio: {
24
+ data: string;
25
+ };
26
+ } | {
27
+ type: 'file';
28
+ file: {
29
+ file_data?: string;
30
+ };
31
+ });
32
+ /**
33
+ * Check if a content part is an OpenAI/Anthropic media source
34
+ */
35
+ export declare function isContentMedia(part: unknown): part is ContentMedia;
36
+ /**
37
+ * Replace inline binary data in a single media content part with a placeholder.
38
+ */
39
+ export declare function stripInlineMediaFromSingleMessage(part: ContentMedia): ContentMedia;
40
+ //# sourceMappingURL=mediaStripping.d.ts.map
@@ -8,6 +8,10 @@ export interface ReplayEvent extends Event {
8
8
  replay_start_timestamp?: number;
9
9
  error_ids: string[];
10
10
  trace_ids: string[];
11
+ traces_by_timestamp: [
12
+ number,
13
+ string
14
+ ][];
11
15
  replay_id: string;
12
16
  segment_id: number;
13
17
  replay_type: ReplayRecordingMode;
@@ -76,5 +76,12 @@ export declare function addContextToFrame(lines: string[], frame: StackFrame, li
76
76
  * @returns `true` if the exception has already been captured, `false` if not (with the side effect of marking it seen)
77
77
  */
78
78
  export declare function checkOrSetAlreadyCaught(exception: unknown): boolean;
79
+ /**
80
+ * Checks whether we've already captured the given exception (note: not an identical exception - the very object).
81
+ * It is considered already captured if it has the `__sentry_captured__` property set to `true`.
82
+ *
83
+ * @internal Only considered for internal usage
84
+ */
85
+ export declare function isAlreadyCaptured(exception: unknown): boolean | void;
79
86
  export {};
80
87
  //# sourceMappingURL=misc.d.ts.map
@@ -0,0 +1,16 @@
1
+ export interface HandleTunnelRequestOptions {
2
+ /** Incoming request containing the Sentry envelope as its body */
3
+ request: Request;
4
+ /** Pre-parsed array of allowed DSN strings */
5
+ allowedDsns: Array<string>;
6
+ }
7
+ /**
8
+ * Core Sentry tunnel handler - framework agnostic.
9
+ *
10
+ * Validates the envelope DSN against allowed DSNs, then forwards the
11
+ * envelope to the Sentry ingest endpoint.
12
+ *
13
+ * @returns A `Response` — either the upstream Sentry response on success, or an error response.
14
+ */
15
+ export declare function handleTunnelRequest(options: HandleTunnelRequestOptions): Promise<Response>;
16
+ //# sourceMappingURL=tunnel.d.ts.map
@@ -53,8 +53,6 @@ export type InternalGlobal = {
53
53
  */
54
54
  _sentryModuleMetadata?: Record<string, any>;
55
55
  _sentryEsmLoaderHookRegistered?: boolean;
56
- _sentryInjectLoaderHookRegister?: () => void;
57
- _sentryInjectLoaderHookRegistered?: boolean;
58
56
  } & Carrier;
59
57
  /** Get's the global object for the current JavaScript runtime */
60
58
  export declare const GLOBAL_OBJ: InternalGlobal;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/core",
3
- "version": "10.39.0",
3
+ "version": "10.41.0-beta.0",
4
4
  "description": "Base implementation for all Sentry JavaScript SDKs",
5
5
  "repository": "git://github.com/getsentry/sentry-javascript.git",
6
6
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/core",
@@ -45,10 +45,9 @@
45
45
  "build:types": "run-s build:types:core build:types:downlevel",
46
46
  "build:types:core": "tsc -p tsconfig.types.json",
47
47
  "build:types:downlevel": "yarn downlevel-dts build/types build/types-ts3.8 --to ts3.8",
48
- "build:watch": "run-p build:transpile:watch build:types:watch",
48
+ "build:watch": "run-p build:transpile:watch",
49
49
  "build:dev:watch": "yarn build:watch",
50
50
  "build:transpile:watch": "rollup -c rollup.npm.config.mjs --watch",
51
- "build:types:watch": "tsc -p tsconfig.types.json --watch",
52
51
  "build:tarball": "npm pack",
53
52
  "circularDepCheck": "madge --circular src/index.ts",
54
53
  "clean": "rimraf build coverage sentry-core-*.tgz",