@sentry/cloudflare 10.68.0 → 10.69.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 (135) hide show
  1. package/build/cjs/client.js +5 -0
  2. package/build/cjs/client.js.map +1 -1
  3. package/build/cjs/durableobject.js +131 -96
  4. package/build/cjs/durableobject.js.map +1 -1
  5. package/build/cjs/index.js +3 -0
  6. package/build/cjs/index.js.map +1 -1
  7. package/build/cjs/instrumentations/agents/index.js +14 -0
  8. package/build/cjs/instrumentations/agents/index.js.map +1 -0
  9. package/build/cjs/instrumentations/agents/instrumentAgentCallableRpc.js +52 -0
  10. package/build/cjs/instrumentations/agents/instrumentAgentCallableRpc.js.map +1 -0
  11. package/build/cjs/instrumentations/agents/instrumentChatAgentConversation.js +31 -0
  12. package/build/cjs/instrumentations/agents/instrumentChatAgentConversation.js.map +1 -0
  13. package/build/cjs/instrumentations/agents/types.js +32 -0
  14. package/build/cjs/instrumentations/agents/types.js.map +1 -0
  15. package/build/cjs/instrumentations/instrumentDurableObjectStorage.js +6 -0
  16. package/build/cjs/instrumentations/instrumentDurableObjectStorage.js.map +1 -1
  17. package/build/cjs/instrumentations/instrumentSqlStorage.js +1 -1
  18. package/build/cjs/instrumentations/instrumentSqlStorage.js.map +1 -1
  19. package/build/cjs/integrations/spotlight.js +64 -0
  20. package/build/cjs/integrations/spotlight.js.map +1 -0
  21. package/build/cjs/nodejs_compat/index.js +5 -2
  22. package/build/cjs/nodejs_compat/index.js.map +1 -1
  23. package/build/cjs/options.js +14 -1
  24. package/build/cjs/options.js.map +1 -1
  25. package/build/cjs/sdk.js +8 -0
  26. package/build/cjs/sdk.js.map +1 -1
  27. package/build/cjs/utils/internalSqlQuery.js +13 -7
  28. package/build/cjs/utils/internalSqlQuery.js.map +1 -1
  29. package/build/cjs/utils/internalStorageKey.js +44 -0
  30. package/build/cjs/utils/internalStorageKey.js.map +1 -0
  31. package/build/cjs/vite/agentClass.js +114 -0
  32. package/build/cjs/vite/agentClass.js.map +1 -0
  33. package/build/cjs/vite/autoInstrument.js +17 -4
  34. package/build/cjs/vite/autoInstrument.js.map +1 -1
  35. package/build/cjs/vite/index.js +1 -1
  36. package/build/cjs/vite/index.js.map +1 -1
  37. package/build/cjs/vite/moduleShape.js +231 -0
  38. package/build/cjs/vite/moduleShape.js.map +1 -0
  39. package/build/cjs/vite/transform.js +6 -1
  40. package/build/cjs/vite/transform.js.map +1 -1
  41. package/build/cjs/vite/wranglerConfig.js +1 -1
  42. package/build/cjs/vite/wranglerConfig.js.map +1 -1
  43. package/build/esm/client.js +6 -1
  44. package/build/esm/client.js.map +1 -1
  45. package/build/esm/durableobject.js +129 -97
  46. package/build/esm/durableobject.js.map +1 -1
  47. package/build/esm/index.js +2 -1
  48. package/build/esm/index.js.map +1 -1
  49. package/build/esm/instrumentations/agents/index.js +12 -0
  50. package/build/esm/instrumentations/agents/index.js.map +1 -0
  51. package/build/esm/instrumentations/agents/instrumentAgentCallableRpc.js +50 -0
  52. package/build/esm/instrumentations/agents/instrumentAgentCallableRpc.js.map +1 -0
  53. package/build/esm/instrumentations/agents/instrumentChatAgentConversation.js +29 -0
  54. package/build/esm/instrumentations/agents/instrumentChatAgentConversation.js.map +1 -0
  55. package/build/esm/instrumentations/agents/types.js +26 -0
  56. package/build/esm/instrumentations/agents/types.js.map +1 -0
  57. package/build/esm/instrumentations/instrumentDurableObjectStorage.js +7 -1
  58. package/build/esm/instrumentations/instrumentDurableObjectStorage.js.map +1 -1
  59. package/build/esm/instrumentations/instrumentSqlStorage.js +1 -1
  60. package/build/esm/instrumentations/instrumentSqlStorage.js.map +1 -1
  61. package/build/esm/integrations/spotlight.js +61 -0
  62. package/build/esm/integrations/spotlight.js.map +1 -0
  63. package/build/esm/nodejs_compat/index.js +2 -1
  64. package/build/esm/nodejs_compat/index.js.map +1 -1
  65. package/build/esm/options.js +14 -1
  66. package/build/esm/options.js.map +1 -1
  67. package/build/esm/package.json +1 -1
  68. package/build/esm/sdk.js +8 -0
  69. package/build/esm/sdk.js.map +1 -1
  70. package/build/esm/utils/internalSqlQuery.js +13 -7
  71. package/build/esm/utils/internalSqlQuery.js.map +1 -1
  72. package/build/esm/utils/internalStorageKey.js +41 -0
  73. package/build/esm/utils/internalStorageKey.js.map +1 -0
  74. package/build/esm/utils/traceLinks.js +1 -1
  75. package/build/esm/vite/agentClass.js +111 -0
  76. package/build/esm/vite/agentClass.js.map +1 -0
  77. package/build/esm/vite/autoInstrument.js +17 -4
  78. package/build/esm/vite/autoInstrument.js.map +1 -1
  79. package/build/esm/vite/index.js +1 -1
  80. package/build/esm/vite/index.js.map +1 -1
  81. package/build/esm/vite/moduleShape.js +227 -0
  82. package/build/esm/vite/moduleShape.js.map +1 -0
  83. package/build/esm/vite/transform.js +6 -1
  84. package/build/esm/vite/transform.js.map +1 -1
  85. package/build/esm/vite/wranglerConfig.js +1 -1
  86. package/build/esm/vite/wranglerConfig.js.map +1 -1
  87. package/build/types/client.d.ts +37 -0
  88. package/build/types/client.d.ts.map +1 -1
  89. package/build/types/durableobject.d.ts +81 -0
  90. package/build/types/durableobject.d.ts.map +1 -1
  91. package/build/types/index.d.ts +2 -1
  92. package/build/types/index.d.ts.map +1 -1
  93. package/build/types/instrumentations/agents/index.d.ts +24 -0
  94. package/build/types/instrumentations/agents/index.d.ts.map +1 -0
  95. package/build/types/instrumentations/agents/instrumentAgentCallableRpc.d.ts +11 -0
  96. package/build/types/instrumentations/agents/instrumentAgentCallableRpc.d.ts.map +1 -0
  97. package/build/types/instrumentations/agents/instrumentChatAgentConversation.d.ts +22 -0
  98. package/build/types/instrumentations/agents/instrumentChatAgentConversation.d.ts.map +1 -0
  99. package/build/types/instrumentations/agents/types.d.ts +49 -0
  100. package/build/types/instrumentations/agents/types.d.ts.map +1 -0
  101. package/build/types/instrumentations/instrumentDurableObjectStorage.d.ts.map +1 -1
  102. package/build/types/integrations/spotlight.d.ts +22 -0
  103. package/build/types/integrations/spotlight.d.ts.map +1 -0
  104. package/build/types/options.d.ts.map +1 -1
  105. package/build/types/sdk.d.ts.map +1 -1
  106. package/build/types/utils/internalSqlQuery.d.ts +4 -2
  107. package/build/types/utils/internalSqlQuery.d.ts.map +1 -1
  108. package/build/types/utils/internalStorageKey.d.ts +22 -0
  109. package/build/types/utils/internalStorageKey.d.ts.map +1 -0
  110. package/build/types/vite/agentClass.d.ts +41 -0
  111. package/build/types/vite/agentClass.d.ts.map +1 -0
  112. package/build/types/vite/autoInstrument.d.ts +7 -6
  113. package/build/types/vite/autoInstrument.d.ts.map +1 -1
  114. package/build/types/vite/index.d.ts +14 -4
  115. package/build/types/vite/index.d.ts.map +1 -1
  116. package/build/types/vite/moduleShape.d.ts +52 -0
  117. package/build/types/vite/moduleShape.d.ts.map +1 -0
  118. package/build/types/vite/transform.d.ts +6 -1
  119. package/build/types/vite/transform.d.ts.map +1 -1
  120. package/build/types-ts3.8/client.d.ts +37 -0
  121. package/build/types-ts3.8/durableobject.d.ts +81 -0
  122. package/build/types-ts3.8/index.d.ts +2 -1
  123. package/build/types-ts3.8/instrumentations/agents/index.d.ts +24 -0
  124. package/build/types-ts3.8/instrumentations/agents/instrumentAgentCallableRpc.d.ts +11 -0
  125. package/build/types-ts3.8/instrumentations/agents/instrumentChatAgentConversation.d.ts +22 -0
  126. package/build/types-ts3.8/instrumentations/agents/types.d.ts +49 -0
  127. package/build/types-ts3.8/integrations/spotlight.d.ts +22 -0
  128. package/build/types-ts3.8/utils/internalSqlQuery.d.ts +4 -2
  129. package/build/types-ts3.8/utils/internalStorageKey.d.ts +22 -0
  130. package/build/types-ts3.8/vite/agentClass.d.ts +41 -0
  131. package/build/types-ts3.8/vite/autoInstrument.d.ts +7 -6
  132. package/build/types-ts3.8/vite/index.d.ts +14 -4
  133. package/build/types-ts3.8/vite/moduleShape.d.ts +52 -0
  134. package/build/types-ts3.8/vite/transform.d.ts +6 -1
  135. package/package.json +3 -3
@@ -1,5 +1,44 @@
1
1
  import type { DurableObject } from 'cloudflare:workers';
2
2
  import type { CloudflareOptions } from './client';
3
+ /**
4
+ * The instrumented context passed between the shared construction helpers.
5
+ *
6
+ * This is intentionally `any` rather than `ReturnType<typeof instrumentContext<DurableObjectState>>`.
7
+ * A concrete `DurableObjectState` here forces `tsc` to structurally relate its `storage: SqlStorage`
8
+ * graph against the `ExecutionContext | InstrumentedDurableObjectState` parameter of
9
+ * `wrapMethodWithSentry`, while the RPC-branded `DurableObject` from `cloudflare:workers` is also in
10
+ * scope. That union comparison explodes (1296×1296) and hangs the type build. The original inline
11
+ * implementation avoided this only incidentally, because `ctx` reached it as `any` through the Proxy
12
+ * `construct` trap. Keeping the shared context `any` preserves that behavior.
13
+ */
14
+ type InstrumentedDurableObjectContext = any;
15
+ /**
16
+ * Constructs a Durable Object instance and instruments its built-in handler methods
17
+ * (`fetch`, `alarm`, `webSocketMessage`, `webSocketClose`, `webSocketError`).
18
+ *
19
+ * This is the shared construction path used by both {@link instrumentDurableObjectWithSentry}
20
+ * and {@link instrumentAgentWithSentry}. It intentionally does NOT apply the RPC prototype-method
21
+ * proxy — callers apply that last via {@link finalizeWithRpcInstrumentation}, after any additional
22
+ * per-instance instrumentation has been layered onto the returned object.
23
+ *
24
+ * @internal
25
+ */
26
+ export declare function constructInstrumentedDurableObject<E, T extends DurableObject<E>>(target: new (state: DurableObjectState, env: E) => T, ctx: DurableObjectState, env: E, newTarget: NewableFunction, optionsCallback: (env: E) => CloudflareOptions): {
27
+ obj: T;
28
+ options: CloudflareOptions;
29
+ context: InstrumentedDurableObjectContext;
30
+ };
31
+ /**
32
+ * Wraps a constructed (and already handler-instrumented) Durable Object instance with the RPC
33
+ * prototype-method proxy, when RPC trace propagation is enabled. Returns the object unchanged when
34
+ * RPC instrumentation is disabled.
35
+ *
36
+ * This must be applied last, so that any per-instance instrumentation (own properties such as
37
+ * `fetch`, `alarm`, or Agent-specific handlers) is excluded from RPC method tracing.
38
+ *
39
+ * @internal
40
+ */
41
+ export declare function finalizeWithRpcInstrumentation<T extends object>(obj: T, options: CloudflareOptions, context: InstrumentedDurableObjectContext): T;
3
42
  /**
4
43
  * Instruments a Durable Object class to capture errors and performance data.
5
44
  *
@@ -34,4 +73,46 @@ import type { CloudflareOptions } from './client';
34
73
  * ```
35
74
  */
36
75
  export declare function instrumentDurableObjectWithSentry<E, T extends DurableObject<E>, C extends new (state: DurableObjectState, env: E) => T>(optionsCallback: (env: E) => CloudflareOptions, DurableObjectClass: C): C;
76
+ /**
77
+ * Instruments a Cloudflare [`agents`](https://www.npmjs.com/package/agents) Agent class with Sentry.
78
+ *
79
+ * An `Agent` is a Durable Object under the hood, so this applies the same instrumentation as
80
+ * {@link instrumentDurableObjectWithSentry} (request transactions, `alarm`, WebSocket handlers, RPC
81
+ * trace propagation, SQL spans) and additionally captures Agent-specific telemetry via
82
+ * `instrumentCloudflareAgent`:
83
+ *
84
+ * - **Callable RPC spans** — a span (op `rpc`) for each `@callable()` method invoked over WebSocket.
85
+ * - **Breadcrumbs** — for every Agent observability event (`rpc`, `state:update`, `connect`,
86
+ * `disconnect`, `schedule:*`, `queue:*`, `workflow:*`, `email:*`, `mcp:*`, ...).
87
+ *
88
+ * Cloudflare Workers cannot auto-instrument, so the Agent class must be wrapped manually.
89
+ *
90
+ * @param optionsCallback Function that returns the options for the SDK initialization.
91
+ * @param AgentClass The Agent class to instrument.
92
+ * @returns The instrumented Agent class.
93
+ *
94
+ * @example
95
+ * ```ts
96
+ * import { Agent, callable, routeAgentRequest } from 'agents';
97
+ * import * as Sentry from '@sentry/cloudflare';
98
+ *
99
+ * class MyAgentBase extends Agent<Env> {
100
+ * @callable()
101
+ * async greet(name: string): Promise<string> {
102
+ * return `Hello, ${name}!`;
103
+ * }
104
+ * }
105
+ *
106
+ * export const MyAgent = Sentry.instrumentAgentWithSentry(
107
+ * env => ({
108
+ * dsn: env.SENTRY_DSN,
109
+ * tracesSampleRate: 1.0,
110
+ * enableRpcTracePropagation: true,
111
+ * }),
112
+ * MyAgentBase,
113
+ * );
114
+ * ```
115
+ */
116
+ export declare function instrumentAgentWithSentry<E, T extends DurableObject<E>, C extends new (state: DurableObjectState, env: E) => T>(optionsCallback: (env: E) => CloudflareOptions, AgentClass: C): C;
117
+ export {};
37
118
  //# sourceMappingURL=durableobject.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"durableobject.d.ts","sourceRoot":"","sources":["../../src/durableobject.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAUlD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,iCAAiC,CAC/C,CAAC,EACD,CAAC,SAAS,aAAa,CAAC,CAAC,CAAC,EAC1B,CAAC,SAAS,KAAK,KAAK,EAAE,kBAAkB,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,EACtD,eAAe,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,iBAAiB,EAAE,kBAAkB,EAAE,CAAC,GAAG,CAAC,CAuK1E"}
1
+ {"version":3,"file":"durableobject.d.ts","sourceRoot":"","sources":["../../src/durableobject.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAWlD;;;;;;;;;;GAUG;AAEH,KAAK,gCAAgC,GAAG,GAAG,CAAC;AAE5C;;;;;;;;;;GAUG;AACH,wBAAgB,kCAAkC,CAAC,CAAC,EAAE,CAAC,SAAS,aAAa,CAAC,CAAC,CAAC,EAC9E,MAAM,EAAE,KAAK,KAAK,EAAE,kBAAkB,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,EACpD,GAAG,EAAE,kBAAkB,EACvB,GAAG,EAAE,CAAC,EACN,SAAS,EAAE,eAAe,EAC1B,eAAe,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,iBAAiB,GAC7C;IAAE,GAAG,EAAE,CAAC,CAAC;IAAC,OAAO,EAAE,iBAAiB,CAAC;IAAC,OAAO,EAAE,gCAAgC,CAAA;CAAE,CAiBnF;AAgFD;;;;;;;;;GASG;AACH,wBAAgB,8BAA8B,CAAC,CAAC,SAAS,MAAM,EAC7D,GAAG,EAAE,CAAC,EACN,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,gCAAgC,GACxC,CAAC,CAoFH;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,iCAAiC,CAC/C,CAAC,EACD,CAAC,SAAS,aAAa,CAAC,CAAC,CAAC,EAC1B,CAAC,SAAS,KAAK,KAAK,EAAE,kBAAkB,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,EACtD,eAAe,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,iBAAiB,EAAE,kBAAkB,EAAE,CAAC,GAAG,CAAC,CAc1E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,yBAAyB,CACvC,CAAC,EACD,CAAC,SAAS,aAAa,CAAC,CAAC,CAAC,EAC1B,CAAC,SAAS,KAAK,KAAK,EAAE,kBAAkB,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,EACtD,eAAe,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,iBAAiB,EAAE,UAAU,EAAE,CAAC,GAAG,CAAC,CAkBlE"}
@@ -3,13 +3,14 @@ export type { CloudflareOptions } from './client';
3
3
  export { addEventProcessor, addBreadcrumb, addIntegration, captureException, captureEvent, captureMessage, captureFeedback, close, createTransport, lastEventId, flush, getClient, isInitialized, isEnabled, getCurrentScope, getGlobalScope, getIsolationScope, setCurrentClient, Scope, SDK_VERSION, setContext, setExtra, setExtras, setTag, setTags, setAttribute, setAttributes, setUser, setConversationId, getSpanStatusFromHttpCode, setHttpStatus, withScope, withIsolationScope, captureCheckIn, withMonitor, setMeasurement, getActiveSpan, getRootSpan, getTraceData, getTraceMetaTags, startSpan, startInactiveSpan, startSpanManual, startNewTrace, bindScopeToEmitter, suppressTracing, withActiveSpan, getSpanDescendants, continueTrace, functionToStringIntegration, inboundFiltersIntegration, instrumentOpenAiClient, instrumentGoogleGenAIClient, instrumentAnthropicAiClient, eventFiltersIntegration, linkedErrorsIntegration, requestDataIntegration, extraErrorDataIntegration, dedupeIntegration, rewriteFramesIntegration, captureConsoleIntegration, moduleMetadataIntegration, supabaseIntegration, instrumentSupabaseClient, instrumentPostgresJsSql, zodErrorsIntegration, consoleIntegration, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, trpcMiddleware, spanToJSON, spanToTraceHeader, spanToBaggageHeader, updateSpanName, wrapMcpServerWithSentry, consoleLoggingIntegration, createConsolaReporter, createLangChainCallbackHandler, instrumentLangChainEmbeddings, featureFlagsIntegration, growthbookIntegration, logger, metrics, withStreamedSpan, spanStreamingIntegration, instrumentStateGraph, instrumentLangGraph, instrumentCreateReactAgent, } from '@sentry/core';
4
4
  export { withSentry } from './withSentry';
5
5
  export { defineCloudflareOptions } from './defineCloudflareOptions';
6
- export { instrumentDurableObjectWithSentry } from './durableobject';
6
+ export { instrumentAgentWithSentry, instrumentDurableObjectWithSentry } from './durableobject';
7
7
  export { sentryPagesPlugin } from './pages-plugin';
8
8
  export { wrapRequestHandler } from './request';
9
9
  export { CloudflareClient } from './client';
10
10
  export { getDefaultIntegrations } from './sdk';
11
11
  export { httpServerIntegration } from './integrations/httpServer';
12
12
  export { fetchIntegration } from './integrations/fetch';
13
+ export { spotlightIntegration } from './integrations/spotlight';
13
14
  export { vercelAIIntegration } from './integrations/tracing/vercelai';
14
15
  export { honoIntegration } from './integrations/hono';
15
16
  export { instrumentD1WithSentry } from './instrumentations/worker/instrumentD1';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,OAAO,EACP,KAAK,EACL,SAAS,EACT,UAAU,EACV,SAAS,EACT,uBAAuB,EACvB,OAAO,EACP,aAAa,EACb,IAAI,EACJ,UAAU,EACV,UAAU,EACV,MAAM,EACN,IAAI,EACJ,MAAM,EACN,kCAAkC,EAClC,cAAc,GACf,MAAM,cAAc,CAAC;AAEtB,YAAY,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,eAAe,EACf,KAAK,EACL,eAAe,EACf,WAAW,EACX,KAAK,EACL,SAAS,EACT,aAAa,EACb,SAAS,EACT,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,EACL,WAAW,EACX,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,YAAY,EACZ,aAAa,EACb,OAAO,EACP,iBAAiB,EACjB,yBAAyB,EACzB,aAAa,EACb,SAAS,EACT,kBAAkB,EAClB,cAAc,EACd,WAAW,EACX,cAAc,EACd,aAAa,EACb,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,2BAA2B,EAE3B,yBAAyB,EACzB,sBAAsB,EACtB,2BAA2B,EAC3B,2BAA2B,EAC3B,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,yBAAyB,EACzB,iBAAiB,EACjB,wBAAwB,EACxB,yBAAyB,EACzB,yBAAyB,EACzB,mBAAmB,EACnB,wBAAwB,EACxB,uBAAuB,EACvB,oBAA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AuB,EACvB,yBAAyB,EACzB,qBAAqB,EACrB,8BAA8B,EAC9B,6BAA6B,EAC7B,uBAAuB,EACvB,qBAAqB,EACrB,MAAM,EACN,OAAO,EACP,gBAAgB,EAChB,wBAAwB,EACxB,oBAAoB,EAEpB,mBAAmB,EACnB,0BAA0B,GAC3B,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,yBAAyB,EAAE,iCAAiC,EAAE,MAAM,iBAAiB,CAAC;AAC/F,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEtE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAEhF,OAAO,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC;AAE3D,OAAO,EAAE,wCAAwC,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Instruments an instance of a Cloudflare [`agents`](https://www.npmjs.com/package/agents) `Agent`
3
+ * with Sentry, adding telemetry that is specific to the Agent's runtime behavior:
4
+ *
5
+ * - **Callable RPC spans** — a span (op `rpc`) for each `@callable()` method invoked over WebSocket.
6
+ * - **Conversation correlation** — sets the conversation id on the scope for each unit of agent
7
+ * work — chat turn or callable RPC call — so `gen_ai` spans created within it are correlated, for
8
+ * chat and plain agents alike. Defaults to the instance `name` and is rotated when the chat is
9
+ * cleared (the `message:clear` observability event).
10
+ *
11
+ * It only hooks the `agents` package internals and uses Sentry's tracing primitives. On Cloudflare
12
+ * Workers, prefer `instrumentAgentWithSentry`, which additionally instruments the Durable Object
13
+ * handlers and initializes the SDK; that function calls this one internally.
14
+ *
15
+ * The hooks replace own-properties on the instance and defer to the original implementation, so
16
+ * they compose with any other instrumentation applied to the same instance.
17
+ *
18
+ * @param agent The `agents` `Agent` instance to instrument.
19
+ * @returns The same instance, instrumented.
20
+ *
21
+ * @internal Use `instrumentAgentWithSentry` instead — this is called internally by it.
22
+ */
23
+ export declare function instrumentCloudflareAgent<T extends object>(agent: T): T;
24
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/instrumentations/agents/index.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAOvE"}
@@ -0,0 +1,11 @@
1
+ import { type AgentInternals } from './types';
2
+ /**
3
+ * Wraps the Agent's `onMessage` handler to create a span for each `@callable()` RPC invocation.
4
+ * RPC requests arrive as WebSocket messages, so this span nests under the active transaction for
5
+ * the WebSocket message (on Cloudflare, the instrumented Durable Object `webSocketMessage` hook).
6
+ *
7
+ * Also sets the conversation id on the scope for the duration of the call: callable methods are the
8
+ * unit of work for plain (non-chat) agents, which run LLM calls just like chat turns do.
9
+ */
10
+ export declare function instrumentAgentCallableRpc(obj: AgentInternals): void;
11
+ //# sourceMappingURL=instrumentAgentCallableRpc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instrumentAgentCallableRpc.d.ts","sourceRoot":"","sources":["../../../../src/instrumentations/agents/instrumentAgentCallableRpc.ts"],"names":[],"mappings":"AAEA,OAAO,EAAqB,KAAK,cAAc,EAA8C,MAAM,SAAS,CAAC;AAE7G;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI,CA+BpE"}
@@ -0,0 +1,22 @@
1
+ import { type AgentInternals } from './types';
2
+ /**
3
+ * For chat agents (`AIChatAgent` from `@cloudflare/ai-chat`), correlates each chat turn's AI spans
4
+ * with a conversation id on the active scope.
5
+ *
6
+ * In the Agents model one agent instance is one long-lived conversation, so the instance `name` is
7
+ * the base conversation id. When the user clears the chat, they expect a fresh conversation — but
8
+ * recreating the Durable Object for that would also drop the MCP/OAuth state stored per instance
9
+ * (GitHub/Sentry sign-in). To get a fresh conversation id *without* losing that state, we rotate an
10
+ * in-memory id on the instance when the SDK reports a cleared chat, and stamp that (falling back to
11
+ * the instance `name` before the first clear).
12
+ *
13
+ * The id itself is not attached to spans here — the SDK's `conversationIdIntegration` reads it off
14
+ * the scope at `spanStart` and stamps `gen_ai.conversation.id` onto the AI spans created inside the
15
+ * turn (e.g. by the Workers AI instrumentation), which correlates a turn's model and tool calls.
16
+ *
17
+ * Plain (non-chat) `Agent`s do not define `onChatMessage`, so they are skipped here — their unit
18
+ * of work is the callable RPC method, where `instrumentAgentCallableRpc` sets the conversation id
19
+ * instead.
20
+ */
21
+ export declare function instrumentChatAgentConversation(obj: AgentInternals): void;
22
+ //# sourceMappingURL=instrumentChatAgentConversation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instrumentChatAgentConversation.d.ts","sourceRoot":"","sources":["../../../../src/instrumentations/agents/instrumentChatAgentConversation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAA0B,MAAM,SAAS,CAAC;AAEtE;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,+BAA+B,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI,CAgCzE"}
@@ -0,0 +1,49 @@
1
+ export declare const AGENT_SPAN_ORIGIN = "auto.faas.cloudflare.agents";
2
+ export declare const AGENT_CLASS_ATTRIBUTE = "cloudflare.agent.class";
3
+ export declare const AGENT_NAME_ATTRIBUTE = "cloudflare.agent.name";
4
+ /**
5
+ * The subset of the `agents` `Agent` instance internals that we instrument. These are runtime
6
+ * implementation details of the `agents` package (v0.13.x) rather than part of its public type
7
+ * surface, so every access is guarded and wrapping degrades gracefully if a name changes upstream.
8
+ */
9
+ export interface AgentInternals {
10
+ /** Central choke-point through which all `agents:*` observability events are published. */
11
+ _emit?: (type: string, payload?: Record<string, unknown>) => void;
12
+ /** WebSocket message handler; dispatches `@callable()` RPC requests. */
13
+ onMessage?: (...args: unknown[]) => unknown;
14
+ /**
15
+ * Chat-turn handler. Only `AIChatAgent` (from `@cloudflare/ai-chat`) defines this; a plain `Agent`
16
+ * does not, so its presence discriminates a chat agent.
17
+ */
18
+ onChatMessage?: (...args: unknown[]) => unknown;
19
+ /** The user's Agent class (used by the SDK for the observability event `agent` field). */
20
+ _ParentClass?: {
21
+ name?: string;
22
+ };
23
+ /** The Agent instance name, which in the Agents model identifies the conversation/thread. */
24
+ name?: string;
25
+ /**
26
+ * Internal: the active conversation id, rotated when the chat is cleared (the `message:clear`
27
+ * observability event) so a reset chat groups as a fresh conversation while the instance (and its
28
+ * MCP/OAuth state) stays put. Set by `instrumentChatAgentConversation`; falls back to `name`
29
+ * before the first clear.
30
+ */
31
+ __sentryConversationId?: string;
32
+ }
33
+ /** Reads best-effort agent identity attributes from the instance, tolerating missing internals. */
34
+ export declare function getAgentAttributes(instance: AgentInternals): Record<string, string>;
35
+ /**
36
+ * Sets the agent instance's conversation id on the current scope for the duration of the
37
+ * surrounding unit of work (chat turn, callable RPC call). In the Agents model one instance is one
38
+ * conversation, so the instance `name` is the natural conversation id — for chat and plain agents
39
+ * alike, since plain agents run LLM calls too (e.g. inside `@callable()` methods). Once the chat
40
+ * has been cleared, the rotated `__sentryConversationId` takes precedence so LLM calls from any
41
+ * unit of work group under the fresh conversation.
42
+ *
43
+ * `conversationIdIntegration` reads the id off the scope at `spanStart` and stamps
44
+ * `gen_ai.conversation.id` onto AI spans created within the unit of work, correlating its model
45
+ * and tool calls. Callers run inside a per-event forked scope (`wrapMethodWithSentry`), so the id
46
+ * does not leak into unrelated events.
47
+ */
48
+ export declare function setAgentConversationId(instance: AgentInternals): void;
49
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/instrumentations/agents/types.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,gCAAgC,CAAC;AAC/D,eAAO,MAAM,qBAAqB,2BAA2B,CAAC;AAC9D,eAAO,MAAM,oBAAoB,0BAA0B,CAAC;AAE5D;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,2FAA2F;IAC3F,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IAClE,wEAAwE;IACxE,SAAS,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC;IAC5C;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC;IAChD,0FAA0F;IAC1F,YAAY,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACjC,6FAA6F;IAC7F,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,mGAAmG;AACnG,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAcnF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAMrE"}
@@ -1 +1 @@
1
- {"version":3,"file":"instrumentDurableObjectStorage.d.ts","sourceRoot":"","sources":["../../../src/instrumentations/instrumentDurableObjectStorage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAA6B,MAAM,2BAA2B,CAAC;AAUjG,KAAK,SAAS,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;AAErD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,oBAAoB,EAC7B,SAAS,CAAC,EAAE,SAAS,GACpB,oBAAoB,CAwEtB"}
1
+ {"version":3,"file":"instrumentDurableObjectStorage.d.ts","sourceRoot":"","sources":["../../../src/instrumentations/instrumentDurableObjectStorage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAA6B,MAAM,2BAA2B,CAAC;AAYjG,KAAK,SAAS,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;AAErD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,oBAAoB,EAC7B,SAAS,CAAC,EAAE,SAAS,GACpB,oBAAoB,CAiFtB"}
@@ -0,0 +1,22 @@
1
+ type SpotlightConnectionOptions = {
2
+ /**
3
+ * Set this if the Spotlight Sidecar is not running on localhost:8969.
4
+ * By default, the URL is set to http://localhost:8969/stream
5
+ */
6
+ sidecarUrl?: string;
7
+ };
8
+ export declare const INTEGRATION_NAME: "Spotlight";
9
+ /**
10
+ * Use this integration to send errors and transactions to Spotlight.
11
+ *
12
+ * Learn more about spotlight at https://spotlightjs.com
13
+ *
14
+ * Important: This integration is intended for local development only.
15
+ * Each forwarded envelope counts as a Worker subrequest (50 free / 1000 paid
16
+ * per invocation), so it should not be enabled in production.
17
+ */
18
+ export declare const spotlightIntegration: (options?: Partial<SpotlightConnectionOptions> | undefined) => import("@sentry/core").Integration & {
19
+ name: "Spotlight";
20
+ };
21
+ export {};
22
+ //# sourceMappingURL=spotlight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spotlight.d.ts","sourceRoot":"","sources":["../../../src/integrations/spotlight.ts"],"names":[],"mappings":"AAIA,KAAK,0BAA0B,GAAG;IAChC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAG,WAAoB,CAAC;AAcrD;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB;;CAA2C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/options.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAyBlD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,iBAAiB,YAAK,EAAE,GAAG,EAAE,OAAO,GAAG,iBAAiB,CAyBpG"}
1
+ {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/options.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAyBlD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,iBAAiB,YAAK,EAAE,GAAG,EAAE,OAAO,GAAG,iBAAiB,CAgCpG"}
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/sdk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAchD,OAAO,KAAK,EAA2B,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AA0B5C,2DAA2D;AAC3D,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,iBAAiB,GAAG,WAAW,EAAE,CA8BhF;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,iBAAiB,GAAG,gBAAgB,GAAG,SAAS,CA4B7E"}
1
+ {"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/sdk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAchD,OAAO,KAAK,EAA2B,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AA2B5C,2DAA2D;AAC3D,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,iBAAiB,GAAG,WAAW,EAAE,CA8BhF;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,iBAAiB,GAAG,gBAAgB,GAAG,SAAS,CAoC7E"}
@@ -12,7 +12,9 @@
12
12
  *
13
13
  * The check operates on the query summary produced by `getSqlQuerySummary` (`{operation} {table} ...`,
14
14
  * the same value used as the span name), so table targets are already isolated from the rest of the
15
- * query.
15
+ * query. The one exception is `CREATE INDEX`: its summary carries the index name, not the indexed
16
+ * table (upstream OTel convention), so the `cf_` target only appears in the ON clause of the full
17
+ * statement, which `queryText` is needed for.
16
18
  */
17
- export declare function targetsCloudflareInternalTable(querySummary: string | undefined, allowlist?: Array<string | RegExp>): boolean;
19
+ export declare function targetsCloudflareInternalTable(querySummary: string | undefined, allowlist?: Array<string | RegExp>, queryText?: string): boolean;
18
20
  //# sourceMappingURL=internalSqlQuery.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"internalSqlQuery.d.ts","sourceRoot":"","sources":["../../../src/utils/internalSqlQuery.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,8BAA8B,CAC5C,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,SAAS,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,GACjC,OAAO,CAgBT"}
1
+ {"version":3,"file":"internalSqlQuery.d.ts","sourceRoot":"","sources":["../../../src/utils/internalSqlQuery.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,8BAA8B,CAC5C,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,SAAS,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,EAClC,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAaT"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Cloudflare frameworks that build on Durable Objects (`agents`, `partyserver`, ...) also manage
3
+ * their own internal KV entries alongside their internal SQLite tables, namespaced with a reserved
4
+ * prefix — e.g. `cf_agents_state`, `cf_agents_mcp_servers`, `__ps_name`. Reads/writes of these
5
+ * (message persistence, MCP connection bookkeeping, name hydration) are framework implementation
6
+ * details that otherwise flood traces with dozens of zero-signal `durable_object_storage_*` spans
7
+ * per request, so we match the reserved prefixes rather than an enumerated list. This mirrors the
8
+ * `cf_` convention used for internal SQL tables (see `targetsCloudflareInternalTable`).
9
+ *
10
+ * The prefixes are a reserved convention for framework-managed entries, so user keys should not use
11
+ * them. In case a user key does collide, the `durableObjectStorageSpanAllowlist` option lets them
12
+ * opt those keys back into instrumentation.
13
+ */
14
+ export declare function targetsCloudflareInternalKey(key: string | undefined, allowlist?: Array<string | RegExp>): boolean;
15
+ /**
16
+ * Extracts the KV keys a Durable Object storage call targets, so the caller can decide whether the
17
+ * operation only touches framework-internal entries. Returns `undefined` when the keys can't be
18
+ * determined from the arguments (e.g. `list()` without a prefix), in which case the call is treated
19
+ * as user work and stays instrumented.
20
+ */
21
+ export declare function getStorageKeys(methodName: string, args: unknown[]): string[] | undefined;
22
+ //# sourceMappingURL=internalStorageKey.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internalStorageKey.d.ts","sourceRoot":"","sources":["../../../src/utils/internalStorageKey.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,wBAAgB,4BAA4B,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,EAAE,SAAS,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,OAAO,CAsBjH;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,EAAE,GAAG,SAAS,CAgCxF"}
@@ -0,0 +1,41 @@
1
+ import type { ProgramBody } from './transform';
2
+ /**
3
+ * The subset of the Vite/Rollup plugin context needed to walk the module graph.
4
+ *
5
+ * `resolve` is optional: without it detection still works, but only for base-class chains declared
6
+ * inside the entry module itself. `readFile` is injectable for tests and defaults to reading disk.
7
+ *
8
+ * Deliberately **no `load`**: awaiting the plugin context's `load()` from inside a `transform` hook
9
+ * deadlocks the build — the module cannot finish loading while its own transform is still pending
10
+ * (Rollup documents this hazard, and Vite's Rolldown pipeline is stricter still). Sibling modules
11
+ * are therefore read straight off disk; see {@link getModuleShape}.
12
+ */
13
+ export interface ModuleResolver {
14
+ parse(code: string): ProgramBody;
15
+ resolve?(source: string, importer: string): Promise<{
16
+ id: string;
17
+ } | null | undefined>;
18
+ readFile?(id: string): string | undefined;
19
+ }
20
+ /**
21
+ * Find which of `candidates` (top-level class names in the entry module) are Cloudflare
22
+ * [`agents`](https://www.npmjs.com/package/agents) Agents.
23
+ *
24
+ * An Agent is a Durable Object under the hood, so wrangler configures it as one and the transform
25
+ * would otherwise reach for `instrumentDurableObjectWithSentry`. Detecting the Agent base chain lets
26
+ * it pick `instrumentAgentWithSentry` instead, which adds the Agent-specific telemetry on top.
27
+ *
28
+ * Unlike `WorkerEntrypoint` detection, the chain is followed *across* modules: base classes commonly
29
+ * live in their own file (`import { MyBase } from './base'`), and there is no runtime fallback that
30
+ * would catch a missed one. Resolution stops at package boundaries — a base class imported from
31
+ * `node_modules` is only recognized when it is one of {@link AGENT_BASE_CLASSES}.
32
+ */
33
+ export declare function detectAgentClasses(ast: ProgramBody, entryId: string, candidates: Iterable<string>, resolver: ModuleResolver): Promise<Set<string>>;
34
+ /**
35
+ * The local class names in the entry that a configured class name could refer to — either declared
36
+ * under that name directly, or aliased to it by an `export { Local as Configured }` specifier.
37
+ *
38
+ * Keeps detection (which reads and scans other modules) off classes that no binding points at.
39
+ */
40
+ export declare function collectAgentCandidates(ast: ProgramBody, configuredNames: Iterable<string>): Set<string>;
41
+ //# sourceMappingURL=agentClass.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentClass.d.ts","sourceRoot":"","sources":["../../../src/vite/agentClass.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAuB/C;;;;;;;;;;GAUG;AACH,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IACjC,OAAO,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;IACvF,QAAQ,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CAC3C;AAOD;;;;;;;;;;;;GAYG;AACH,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,WAAW,EAChB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,EAC5B,QAAQ,EAAE,cAAc,GACvB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CActB;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,WAAW,EAAE,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,CAevG"}
@@ -1,5 +1,7 @@
1
- import { type ProgramBody } from './transform';
2
- export declare function sentryCloudflareAutoInstrumentPlugin(): {
1
+ import { type ModuleResolver } from './agentClass';
2
+ export declare function sentryCloudflareAutoInstrumentPlugin(options?: {
3
+ wranglerConfigPath?: string;
4
+ }): {
3
5
  name: string;
4
6
  configResolved(config: {
5
7
  root: string;
@@ -7,15 +9,14 @@ export declare function sentryCloudflareAutoInstrumentPlugin(): {
7
9
  warn(msg: string): void;
8
10
  };
9
11
  }): void;
10
- transform(this: {
11
- parse(code: string): ProgramBody;
12
+ transform(this: ModuleResolver & {
12
13
  warn?(msg: string): void;
13
14
  environment?: {
14
15
  name?: string;
15
16
  };
16
- }, code: string, id: string): {
17
+ }, code: string, id: string): Promise<{
17
18
  code: string;
18
19
  map: unknown;
19
- } | undefined;
20
+ } | undefined>;
20
21
  };
21
22
  //# sourceMappingURL=autoInstrument.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"autoInstrument.d.ts","sourceRoot":"","sources":["../../../src/vite/autoInstrument.ts"],"names":[],"mappings":"AACA,OAAO,EAAwD,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAcrG,wBAAgB,oCAAoC;;2BAUzB;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE;YAAE,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;SAAE,CAAA;KAAE,GAAG,IAAI;oBAyB5E;QAAE,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;QAAC,IAAI,CAAC,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,WAAW,CAAC,EAAE;YAAE,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,QAC/F,MAAM,MACR,MAAM,GACT;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,OAAO,CAAA;KAAE,GAAG,SAAS;EA6DhD"}
1
+ {"version":3,"file":"autoInstrument.d.ts","sourceRoot":"","sources":["../../../src/vite/autoInstrument.ts"],"names":[],"mappings":"AACA,OAAO,EAA8C,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAgB/F,wBAAgB,oCAAoC,CAAC,OAAO,GAAE;IAAE,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAAO;;2BAUvE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE;YAAE,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;SAAE,CAAA;KAAE,GAAG,IAAI;oBAkC5E,cAAc,GAAG;QAAE,IAAI,CAAC,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,WAAW,CAAC,EAAE;YAAE,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,QAC9E,MAAM,MACR,MAAM,GACT,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,OAAO,CAAA;KAAE,GAAG,SAAS,CAAC;EAiFzD"}
@@ -2,6 +2,17 @@
2
2
  * Options for {@link sentryCloudflareVitePlugin}.
3
3
  */
4
4
  export interface SentryCloudflareVitePluginOptions {
5
+ /**
6
+ * Path to the wrangler config, relative to the Vite root (or absolute).
7
+ * Set this when your config doesn't use a default name — e.g. when you
8
+ * pass `configPath: './wrangler.agent.jsonc'` to `@cloudflare/vite-plugin`,
9
+ * which the Sentry plugin cannot see. When set, only this file is read
10
+ * (no default-name probing), and a warning is emitted if it is missing or
11
+ * unparseable.
12
+ *
13
+ * @default undefined (probes `wrangler.json`, `wrangler.jsonc`, `wrangler.toml` at the Vite root)
14
+ */
15
+ wranglerConfigPath?: string;
5
16
  /**
6
17
  * Experimental options that may change or be removed without notice.
7
18
  */
@@ -74,15 +85,14 @@ export declare function sentryCloudflareVitePlugin(options?: SentryCloudflareVit
74
85
  warn(msg: string): void;
75
86
  };
76
87
  }): void;
77
- transform(this: {
78
- parse(code: string): import("./transform").ProgramBody;
88
+ transform(this: import("./agentClass").ModuleResolver & {
79
89
  warn?(msg: string): void;
80
90
  environment?: {
81
91
  name?: string;
82
92
  };
83
- }, code: string, id: string): {
93
+ }, code: string, id: string): Promise<{
84
94
  code: string;
85
95
  map: unknown;
86
- } | undefined;
96
+ } | undefined>;
87
97
  } | import("vite").Plugin<any>)[];
88
98
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/vite/index.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,MAAM,WAAW,iCAAiC;IAChD;;OAEG;IACH,aAAa,CAAC,EAAE;QACd;;;;;;;;;;;;;WAaG;QACH,8BAA8B,CAAC,EAAE,OAAO,CAAC;QACzC;;;;;;;;;;WAUG;QACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;KAC/B,CAAC;CACH;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,GAAE,iCAAsC;;;;cAvDpC,CAAC;;;;;;YAoB7B,CAAA;mBAKf,CAAC;gBAAQ,CAAC;;;;;;kCAqCpB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/vite/index.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,MAAM,WAAW,iCAAiC;IAChD;;;;;;;;;OASG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,aAAa,CAAC,EAAE;QACd;;;;;;;;;;;;;WAaG;QACH,8BAA8B,CAAC,EAAE,OAAO,CAAC;QACzC;;;;;;;;;;WAUG;QACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;KAC/B,CAAC;CACH;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,GAAE,iCAAsC;;;;cA5DlF,CAAC;;;;;YAiCgE,CAAC;mBAChD,CAAC;gBAAS,CAAA;;;;;;kCAmCnC"}
@@ -0,0 +1,52 @@
1
+ import type { ProgramBody } from './transform';
2
+ /** Binding name used for a module's default export. */
3
+ export declare const DEFAULT_EXPORT = "default";
4
+ /** A resolved superclass reference: a bare identifier or a `ns.Member` expression. */
5
+ export type SuperRef = {
6
+ kind: 'identifier';
7
+ name: string;
8
+ } | {
9
+ kind: 'member';
10
+ object: string;
11
+ property: string;
12
+ };
13
+ /** The declarations of a single module that binding resolution needs. */
14
+ export interface ModuleShape {
15
+ /** Top-level class names → their superclass reference (absent when the class has no `extends`). */
16
+ classes: Map<string, SuperRef | undefined>;
17
+ /** Local binding name → the import it came from (`imported` is `default` for a default import). */
18
+ imports: Map<string, {
19
+ source: string;
20
+ imported: string;
21
+ }>;
22
+ /** Local binding name → module specifier, for `import * as ns from '...'`. */
23
+ namespaces: Map<string, string>;
24
+ /** Exported name → the re-export it came from, for `export { x as y } from '...'`. */
25
+ reexports: Map<string, {
26
+ source: string;
27
+ imported: string;
28
+ }>;
29
+ /** Exported name → local binding name, for `export { x as y }` without a source. */
30
+ localExports: Map<string, string>;
31
+ /** Module specifiers of bare `export * from '...'` declarations. */
32
+ starExports: string[];
33
+ /** `export default <Identifier>` — the local name it refers to. */
34
+ defaultExportName?: string;
35
+ /** True when the module's default export is a class declaration/expression. */
36
+ defaultExportIsClass?: boolean;
37
+ /** Superclass of an anonymous `export default class extends X`. */
38
+ defaultExportSuper?: SuperRef;
39
+ }
40
+ /** Collect the shape of a module from its parsed AST — used for the already-parsed entry module. */
41
+ export declare function shapeFromAst(ast: ProgramBody): ModuleShape;
42
+ /**
43
+ * Extract the module shape from **unprocessed source**.
44
+ *
45
+ * Sibling modules are read straight from disk (the plugin context's `load()` would deadlock inside a
46
+ * transform hook), so they may still be TypeScript — which no JS parser will accept. Only
47
+ * import/export statements and `class X extends Y` headers matter here, and those are
48
+ * declaration-level syntax a scan can pick out reliably; class bodies, type annotations and generics
49
+ * are irrelevant and simply skipped.
50
+ */
51
+ export declare function shapeFromSource(rawCode: string): ModuleShape;
52
+ //# sourceMappingURL=moduleShape.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"moduleShape.d.ts","sour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D;AAiED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,CAgD5D"}
@@ -18,7 +18,7 @@ export interface ProgramBody {
18
18
  * config providing only a fallback for self-bound entrypoints whose base class
19
19
  * lives in another module.
20
20
  */
21
- export type ClassWrapperKind = 'durableObject' | 'workflow' | 'workerEntrypoint';
21
+ export type ClassWrapperKind = 'durableObject' | 'agent' | 'workflow' | 'workerEntrypoint';
22
22
  export interface TransformContext {
23
23
  /**
24
24
  * Exported class name → the kind of Sentry wrapper to apply. Populated from
@@ -26,6 +26,11 @@ export interface TransformContext {
26
26
  * each class's base type.
27
27
  */
28
28
  classWrappers: Map<string, ClassWrapperKind>;
29
+ /**
30
+ * Local class names detected as `agents` Agents. An Agent is configured as a Durable Object in
31
+ * wrangler, so this upgrades those entries from `durableObject` to `agent`.
32
+ */
33
+ agentClasses?: ReadonlySet<string>;
29
34
  optionsFn: string;
30
35
  /** Import statement prepended when `optionsFn` references a separate module. */
31
36
  optionsImport?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../../src/vite/transform.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,cAAc,CAAC;AAOvC,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,QAAQ,EAAE,CAAC;CAClB;AAuDD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,gBAAgB,GAAG,eAAe,GAAG,UAAU,GAAG,kBAAkB,CAAC;AAajF,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB,gFAAgF;IAChF,aAAa,CAAC,EAAE,MAAM,CAAC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GAeG;AACH,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,WAAW,EAChB,GAAG,EAAE,gBAAgB,GACpB,eAAe,GAAG,SAAS,CA8C7B"}
@@ -41,6 +41,8 @@ export declare class CloudflareClient extends ServerRuntimeClient {
41
41
  * After calling dispose(), the client should not be used anymore.
42
42
  */
43
43
  dispose(): void;
44
+ /** @inheritDoc */
45
+ protected _setupIntegrations(): void;
44
46
  /**
45
47
  * Resets the span completion promise and resolve function.
46
48
  */
@@ -132,6 +134,30 @@ interface BaseCloudflareOptions {
132
134
  * ```
133
135
  */
134
136
  durableObjectSqlSpanAllowlist?: Array<string | RegExp>;
137
+ /**
138
+ * KV keys that should stay instrumented even though they match a reserved prefix used by Durable
139
+ * Object frameworks (`agents`, `partyserver`, ...) for their internal storage entries.
140
+ *
141
+ * By default, KV reads/writes (`get`, `put`, `delete`, `list`) of `cf_`- or `__ps_`-prefixed keys
142
+ * are treated as framework noise and no `durable_object_storage_*` span is created for them,
143
+ * mirroring how `cf_`-prefixed SQL tables are handled (see {@link durableObjectSqlSpanAllowlist}).
144
+ * If one of your own keys happens to use such a prefix, add it here to opt it back into
145
+ * instrumentation. Strings must match exactly, while regular expressions give you prefix/pattern
146
+ * matching.
147
+ *
148
+ * @default []
149
+ * @example
150
+ * ```ts
151
+ * export default Sentry.withSentry(
152
+ * (env) => ({
153
+ * dsn: env.SENTRY_DSN,
154
+ * durableObjectStorageSpanAllowlist: ['cf_my_key', /^cf_reports_/],
155
+ * }),
156
+ * handler,
157
+ * );
158
+ * ```
159
+ */
160
+ durableObjectStorageSpanAllowlist?: Array<string | RegExp>;
135
161
  /**
136
162
  * @deprecated Use `enableRpcTracePropagation` instead. This option will be removed in a future major version.
137
163
  *
@@ -145,6 +171,17 @@ interface BaseCloudflareOptions {
145
171
  * @default false
146
172
  */
147
173
  instrumentPrototypeMethods?: boolean | string[];
174
+ /**
175
+ * If you use Spotlight by Sentry during development, use
176
+ * this option to forward captured Sentry events to Spotlight.
177
+ *
178
+ * Either set it to true, or provide a specific Spotlight Sidecar URL.
179
+ *
180
+ * More details: https://spotlightjs.com/
181
+ *
182
+ * IMPORTANT: Only set this option to `true` while developing, not in production!
183
+ */
184
+ spotlight?: boolean | string;
148
185
  }
149
186
  /**
150
187
  * Configuration options for the Sentry Cloudflare SDK