@sentry/cloudflare 10.70.0 → 11.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -7
- package/build/cjs/{sdk.js → dev/baseSdk.js} +27 -17
- package/build/cjs/dev/baseSdk.js.map +1 -0
- package/build/cjs/dev/client.js.map +1 -0
- package/build/cjs/dev/debug-build.js.map +1 -0
- package/build/cjs/dev/defineCloudflareOptions.js.map +1 -0
- package/build/cjs/{durableobject.js → dev/durableobject.js} +21 -20
- package/build/cjs/dev/durableobject.js.map +1 -0
- package/build/cjs/dev/flush.js.map +1 -0
- package/build/cjs/{index.js → dev/index.js} +16 -17
- package/build/cjs/{index.js.map → dev/index.js.map} +1 -1
- package/build/cjs/dev/instrument.js.map +1 -0
- package/build/cjs/dev/instrumentations/agents/index.js.map +1 -0
- package/build/cjs/dev/instrumentations/agents/instrumentAgentCallableRpc.js.map +1 -0
- package/build/cjs/dev/instrumentations/agents/instrumentAgentRequestConversation.js.map +1 -0
- package/build/cjs/dev/instrumentations/agents/instrumentChatAgentConversation.js.map +1 -0
- package/build/cjs/{instrumentations → dev/instrumentations}/agents/types.js +4 -4
- package/build/cjs/dev/instrumentations/agents/types.js.map +1 -0
- package/build/cjs/dev/instrumentations/instrumentDurableObjectNamespace.js.map +1 -0
- package/build/cjs/dev/instrumentations/instrumentDurableObjectStorage.js.map +1 -0
- package/build/cjs/dev/instrumentations/instrumentDurableObjectSyncKvStorage.js.map +1 -0
- package/build/cjs/dev/instrumentations/instrumentSqlStorage.js.map +1 -0
- package/build/cjs/{instrumentations → dev/instrumentations}/instrumentWorkerEntrypoint.js +3 -3
- package/build/cjs/dev/instrumentations/instrumentWorkerEntrypoint.js.map +1 -0
- package/build/cjs/{instrumentations → dev/instrumentations}/worker/instrumentD1.js +0 -4
- package/build/cjs/dev/instrumentations/worker/instrumentD1.js.map +1 -0
- package/build/cjs/{instrumentations → dev/instrumentations}/worker/instrumentEmail.js +3 -1
- package/build/cjs/dev/instrumentations/worker/instrumentEmail.js.map +1 -0
- package/build/cjs/{instrumentations → dev/instrumentations}/worker/instrumentEnv.js +3 -4
- package/build/cjs/dev/instrumentations/worker/instrumentEnv.js.map +1 -0
- package/build/cjs/{instrumentations → dev/instrumentations}/worker/instrumentFetch.js +9 -3
- package/build/cjs/dev/instrumentations/worker/instrumentFetch.js.map +1 -0
- package/build/cjs/dev/instrumentations/worker/instrumentFetcher.js.map +1 -0
- package/build/cjs/{instrumentations → dev/instrumentations}/worker/instrumentQueue.js +3 -2
- package/build/cjs/dev/instrumentations/worker/instrumentQueue.js.map +1 -0
- package/build/cjs/dev/instrumentations/worker/instrumentQueueProducer.js.map +1 -0
- package/build/cjs/dev/instrumentations/worker/instrumentR2.js.map +1 -0
- package/build/cjs/dev/instrumentations/worker/instrumentRateLimit.js.map +1 -0
- package/build/cjs/{instrumentations → dev/instrumentations}/worker/instrumentScheduled.js +3 -1
- package/build/cjs/dev/instrumentations/worker/instrumentScheduled.js.map +1 -0
- package/build/cjs/dev/instrumentations/worker/instrumentTail.js.map +1 -0
- package/build/cjs/{integrations → dev/integrations}/fetch.js +1 -1
- package/build/cjs/dev/integrations/fetch.js.map +1 -0
- package/build/cjs/{integrations → dev/integrations}/httpServer.js +5 -4
- package/build/cjs/dev/integrations/httpServer.js.map +1 -0
- package/build/cjs/dev/integrations/spotlight.js.map +1 -0
- package/build/cjs/{nodejs_compat → dev}/integrations/tracing/vercelai.js +6 -6
- package/build/cjs/dev/integrations/tracing/vercelai.js.map +1 -0
- package/build/cjs/dev/opentelemetry/tracer.js.map +1 -0
- package/build/cjs/{options.js → dev/options.js} +8 -0
- package/build/cjs/dev/options.js.map +1 -0
- package/build/cjs/{pages-plugin.js → dev/pages-plugin.js} +8 -3
- package/build/cjs/dev/pages-plugin.js.map +1 -0
- package/build/cjs/{request.js → dev/request.js} +20 -10
- package/build/cjs/dev/request.js.map +1 -0
- package/build/cjs/dev/scope-utils.js.map +1 -0
- package/build/cjs/dev/sdk.js +19 -0
- package/build/cjs/dev/sdk.js.map +1 -0
- package/build/cjs/dev/transport.js.map +1 -0
- package/build/cjs/{utils → dev/utils}/instrumentContext.js +8 -13
- package/build/cjs/dev/utils/instrumentContext.js.map +1 -0
- package/build/cjs/dev/utils/internalSqlQuery.js.map +1 -0
- package/build/cjs/dev/utils/internalStorageKey.js.map +1 -0
- package/build/cjs/dev/utils/invocationScope.js.map +1 -0
- package/build/cjs/dev/utils/isBinding.js.map +1 -0
- package/build/cjs/dev/utils/isCloudflareClass.js.map +1 -0
- package/build/cjs/dev/utils/rpcMeta.js.map +1 -0
- package/build/cjs/dev/utils/streaming.js.map +1 -0
- package/build/cjs/dev/utils/traceLinks.js.map +1 -0
- package/build/cjs/dev/vendor/stacktrace.js.map +1 -0
- package/build/cjs/dev/vite/agentClass.js.map +1 -0
- package/build/cjs/dev/vite/autoInstrument.js.map +1 -0
- package/build/cjs/{vite → dev/vite}/index.js +4 -2
- package/build/cjs/dev/vite/index.js.map +1 -0
- package/build/cjs/dev/vite/instrumentFile.js.map +1 -0
- package/build/cjs/dev/vite/moduleShape.js.map +1 -0
- package/build/cjs/dev/vite/transform.js.map +1 -0
- package/build/cjs/dev/vite/workerEntrypoint.js.map +1 -0
- package/build/cjs/dev/vite/wranglerConfig.js.map +1 -0
- package/build/cjs/{withSentry.js → dev/withSentry.js} +2 -19
- package/build/cjs/dev/withSentry.js.map +1 -0
- package/build/cjs/{workflows.js → dev/workflows.js} +8 -3
- package/build/cjs/dev/workflows.js.map +1 -0
- package/build/cjs/dev/wrapMethodWithSentry.js.map +1 -0
- package/build/cjs/prod/baseSdk.js +73 -0
- package/build/cjs/prod/baseSdk.js.map +1 -0
- package/build/cjs/prod/client.js +122 -0
- package/build/cjs/prod/client.js.map +1 -0
- package/build/cjs/prod/debug-build.js +6 -0
- package/build/cjs/prod/debug-build.js.map +1 -0
- package/build/cjs/prod/defineCloudflareOptions.js +11 -0
- package/build/cjs/prod/defineCloudflareOptions.js.map +1 -0
- package/build/cjs/prod/durableobject.js +234 -0
- package/build/cjs/prod/durableobject.js.map +1 -0
- package/build/cjs/prod/flush.js +87 -0
- package/build/cjs/prod/flush.js.map +1 -0
- package/build/cjs/{nodejs_compat → prod}/index.js +34 -37
- package/build/cjs/{nodejs_compat → prod}/index.js.map +1 -1
- package/build/cjs/prod/instrument.js +52 -0
- package/build/cjs/prod/instrument.js.map +1 -0
- package/build/cjs/prod/instrumentations/agents/index.js +16 -0
- package/build/cjs/prod/instrumentations/agents/index.js.map +1 -0
- package/build/cjs/prod/instrumentations/agents/instrumentAgentCallableRpc.js +52 -0
- package/build/cjs/prod/instrumentations/agents/instrumentAgentCallableRpc.js.map +1 -0
- package/build/cjs/prod/instrumentations/agents/instrumentAgentRequestConversation.js +19 -0
- package/build/cjs/prod/instrumentations/agents/instrumentAgentRequestConversation.js.map +1 -0
- package/build/cjs/prod/instrumentations/agents/instrumentChatAgentConversation.js +31 -0
- package/build/cjs/prod/instrumentations/agents/instrumentChatAgentConversation.js.map +1 -0
- package/build/cjs/prod/instrumentations/agents/types.js +77 -0
- package/build/cjs/prod/instrumentations/agents/types.js.map +1 -0
- package/build/cjs/prod/instrumentations/instrumentDurableObjectNamespace.js +41 -0
- package/build/cjs/prod/instrumentations/instrumentDurableObjectNamespace.js.map +1 -0
- package/build/cjs/prod/instrumentations/instrumentDurableObjectStorage.js +72 -0
- package/build/cjs/prod/instrumentations/instrumentDurableObjectStorage.js.map +1 -0
- package/build/cjs/prod/instrumentations/instrumentDurableObjectSyncKvStorage.js +40 -0
- package/build/cjs/prod/instrumentations/instrumentDurableObjectSyncKvStorage.js.map +1 -0
- package/build/cjs/prod/instrumentations/instrumentSqlStorage.js +42 -0
- package/build/cjs/prod/instrumentations/instrumentSqlStorage.js.map +1 -0
- package/build/cjs/prod/instrumentations/instrumentWorkerEntrypoint.js +139 -0
- package/build/cjs/prod/instrumentations/instrumentWorkerEntrypoint.js.map +1 -0
- package/build/cjs/prod/instrumentations/worker/instrumentD1.js +161 -0
- package/build/cjs/prod/instrumentations/worker/instrumentD1.js.map +1 -0
- package/build/cjs/prod/instrumentations/worker/instrumentEmail.js +63 -0
- package/build/cjs/prod/instrumentations/worker/instrumentEmail.js.map +1 -0
- package/build/cjs/prod/instrumentations/worker/instrumentEnv.js +90 -0
- package/build/cjs/prod/instrumentations/worker/instrumentEnv.js.map +1 -0
- package/build/cjs/prod/instrumentations/worker/instrumentFetch.js +54 -0
- package/build/cjs/prod/instrumentations/worker/instrumentFetch.js.map +1 -0
- package/build/cjs/prod/instrumentations/worker/instrumentFetcher.js +24 -0
- package/build/cjs/prod/instrumentations/worker/instrumentFetcher.js.map +1 -0
- package/build/cjs/prod/instrumentations/worker/instrumentQueue.js +82 -0
- package/build/cjs/prod/instrumentations/worker/instrumentQueue.js.map +1 -0
- package/build/cjs/prod/instrumentations/worker/instrumentQueueProducer.js +80 -0
- package/build/cjs/prod/instrumentations/worker/instrumentQueueProducer.js.map +1 -0
- package/build/cjs/prod/instrumentations/worker/instrumentR2.js +124 -0
- package/build/cjs/prod/instrumentations/worker/instrumentR2.js.map +1 -0
- package/build/cjs/prod/instrumentations/worker/instrumentRateLimit.js +29 -0
- package/build/cjs/prod/instrumentations/worker/instrumentRateLimit.js.map +1 -0
- package/build/cjs/prod/instrumentations/worker/instrumentScheduled.js +78 -0
- package/build/cjs/prod/instrumentations/worker/instrumentScheduled.js.map +1 -0
- package/build/cjs/prod/instrumentations/worker/instrumentTail.js +60 -0
- package/build/cjs/prod/instrumentations/worker/instrumentTail.js.map +1 -0
- package/build/cjs/prod/integrations/fetch.js +119 -0
- package/build/cjs/prod/integrations/fetch.js.map +1 -0
- package/build/cjs/prod/integrations/httpServer.js +36 -0
- package/build/cjs/prod/integrations/httpServer.js.map +1 -0
- package/build/cjs/prod/integrations/spotlight.js +64 -0
- package/build/cjs/prod/integrations/spotlight.js.map +1 -0
- package/build/cjs/{integrations → prod/integrations}/tracing/vercelai.js +5 -5
- package/build/cjs/prod/integrations/tracing/vercelai.js.map +1 -0
- package/build/cjs/prod/opentelemetry/tracer.js +49 -0
- package/build/cjs/prod/opentelemetry/tracer.js.map +1 -0
- package/build/cjs/prod/options.js +33 -0
- package/build/cjs/prod/options.js.map +1 -0
- package/build/cjs/prod/pages-plugin.js +24 -0
- package/build/cjs/prod/pages-plugin.js.map +1 -0
- package/build/cjs/prod/request.js +132 -0
- package/build/cjs/prod/request.js.map +1 -0
- package/build/cjs/prod/scope-utils.js +22 -0
- package/build/cjs/prod/scope-utils.js.map +1 -0
- package/build/cjs/prod/sdk.js +19 -0
- package/build/cjs/prod/sdk.js.map +1 -0
- package/build/cjs/prod/transport.js +75 -0
- package/build/cjs/prod/transport.js.map +1 -0
- package/build/cjs/prod/utils/instrumentContext.js +63 -0
- package/build/cjs/prod/utils/instrumentContext.js.map +1 -0
- package/build/cjs/prod/utils/internalSqlQuery.js +25 -0
- package/build/cjs/prod/utils/internalSqlQuery.js.map +1 -0
- package/build/cjs/prod/utils/internalStorageKey.js +44 -0
- package/build/cjs/prod/utils/internalStorageKey.js.map +1 -0
- package/build/cjs/prod/utils/invocationScope.js +12 -0
- package/build/cjs/prod/utils/invocationScope.js.map +1 -0
- package/build/cjs/prod/utils/isBinding.js +37 -0
- package/build/cjs/prod/utils/isBinding.js.map +1 -0
- package/build/cjs/prod/utils/isCloudflareClass.js +23 -0
- package/build/cjs/prod/utils/isCloudflareClass.js.map +1 -0
- package/build/cjs/prod/utils/rpcMeta.js +39 -0
- package/build/cjs/prod/utils/rpcMeta.js.map +1 -0
- package/build/cjs/prod/utils/streaming.js +16 -0
- package/build/cjs/prod/utils/streaming.js.map +1 -0
- package/build/cjs/prod/utils/traceLinks.js +54 -0
- package/build/cjs/prod/utils/traceLinks.js.map +1 -0
- package/build/cjs/prod/vendor/stacktrace.js +28 -0
- package/build/cjs/prod/vendor/stacktrace.js.map +1 -0
- package/build/cjs/prod/vite/agentClass.js +114 -0
- package/build/cjs/prod/vite/agentClass.js.map +1 -0
- package/build/cjs/prod/vite/autoInstrument.js +94 -0
- package/build/cjs/prod/vite/autoInstrument.js.map +1 -0
- package/build/cjs/prod/vite/index.js +16 -0
- package/build/cjs/prod/vite/index.js.map +1 -0
- package/build/cjs/prod/vite/instrumentFile.js +31 -0
- package/build/cjs/prod/vite/instrumentFile.js.map +1 -0
- package/build/cjs/prod/vite/moduleShape.js +231 -0
- package/build/cjs/prod/vite/moduleShape.js.map +1 -0
- package/build/cjs/prod/vite/transform.js +149 -0
- package/build/cjs/prod/vite/transform.js.map +1 -0
- package/build/cjs/prod/vite/workerEntrypoint.js +66 -0
- package/build/cjs/prod/vite/workerEntrypoint.js.map +1 -0
- package/build/cjs/prod/vite/wranglerConfig.js +54 -0
- package/build/cjs/prod/vite/wranglerConfig.js.map +1 -0
- package/build/cjs/prod/withSentry.js +29 -0
- package/build/cjs/prod/withSentry.js.map +1 -0
- package/build/cjs/prod/workflows.js +139 -0
- package/build/cjs/prod/workflows.js.map +1 -0
- package/build/cjs/prod/wrapMethodWithSentry.js +134 -0
- package/build/cjs/prod/wrapMethodWithSentry.js.map +1 -0
- package/build/esm/{sdk.js → dev/baseSdk.js} +26 -17
- package/build/esm/dev/baseSdk.js.map +1 -0
- package/build/esm/dev/client.js.map +1 -0
- package/build/esm/dev/debug-build.js.map +1 -0
- package/build/esm/dev/defineCloudflareOptions.js.map +1 -0
- package/build/esm/{durableobject.js → dev/durableobject.js} +21 -20
- package/build/esm/dev/durableobject.js.map +1 -0
- package/build/esm/dev/flush.js.map +1 -0
- package/build/esm/dev/index.js +15 -0
- package/build/esm/{index.js.map → dev/index.js.map} +1 -1
- package/build/esm/dev/instrument.js.map +1 -0
- package/build/esm/dev/instrumentations/agents/index.js.map +1 -0
- package/build/esm/dev/instrumentations/agents/instrumentAgentCallableRpc.js.map +1 -0
- package/build/esm/dev/instrumentations/agents/instrumentAgentRequestConversation.js.map +1 -0
- package/build/esm/dev/instrumentations/agents/instrumentChatAgentConversation.js.map +1 -0
- package/build/esm/{instrumentations → dev/instrumentations}/agents/types.js +2 -2
- package/build/esm/dev/instrumentations/agents/types.js.map +1 -0
- package/build/esm/dev/instrumentations/instrumentDurableObjectNamespace.js.map +1 -0
- package/build/esm/dev/instrumentations/instrumentDurableObjectStorage.js.map +1 -0
- package/build/esm/dev/instrumentations/instrumentDurableObjectSyncKvStorage.js.map +1 -0
- package/build/esm/dev/instrumentations/instrumentSqlStorage.js.map +1 -0
- package/build/esm/{instrumentations → dev/instrumentations}/instrumentWorkerEntrypoint.js +2 -2
- package/build/esm/dev/instrumentations/instrumentWorkerEntrypoint.js.map +1 -0
- package/build/esm/{instrumentations → dev/instrumentations}/worker/instrumentD1.js +1 -4
- package/build/esm/dev/instrumentations/worker/instrumentD1.js.map +1 -0
- package/build/esm/{instrumentations → dev/instrumentations}/worker/instrumentEmail.js +3 -1
- package/build/esm/dev/instrumentations/worker/instrumentEmail.js.map +1 -0
- package/build/esm/{instrumentations → dev/instrumentations}/worker/instrumentEnv.js +3 -4
- package/build/esm/dev/instrumentations/worker/instrumentEnv.js.map +1 -0
- package/build/esm/{instrumentations → dev/instrumentations}/worker/instrumentFetch.js +10 -4
- package/build/esm/dev/instrumentations/worker/instrumentFetch.js.map +1 -0
- package/build/esm/dev/instrumentations/worker/instrumentFetcher.js.map +1 -0
- package/build/esm/{instrumentations → dev/instrumentations}/worker/instrumentQueue.js +4 -3
- package/build/esm/dev/instrumentations/worker/instrumentQueue.js.map +1 -0
- package/build/esm/dev/instrumentations/worker/instrumentQueueProducer.js.map +1 -0
- package/build/esm/dev/instrumentations/worker/instrumentR2.js.map +1 -0
- package/build/esm/dev/instrumentations/worker/instrumentRateLimit.js.map +1 -0
- package/build/esm/{instrumentations → dev/instrumentations}/worker/instrumentScheduled.js +3 -1
- package/build/esm/dev/instrumentations/worker/instrumentScheduled.js.map +1 -0
- package/build/esm/dev/instrumentations/worker/instrumentTail.js.map +1 -0
- package/build/esm/{integrations → dev/integrations}/fetch.js +1 -1
- package/build/esm/dev/integrations/fetch.js.map +1 -0
- package/build/esm/{integrations → dev/integrations}/httpServer.js +5 -4
- package/build/esm/dev/integrations/httpServer.js.map +1 -0
- package/build/esm/dev/integrations/spotlight.js.map +1 -0
- package/build/esm/{integrations → dev/integrations}/tracing/vercelai.js +5 -5
- package/build/esm/dev/integrations/tracing/vercelai.js.map +1 -0
- package/build/esm/dev/opentelemetry/tracer.js.map +1 -0
- package/build/esm/{options.js → dev/options.js} +8 -0
- package/build/esm/dev/options.js.map +1 -0
- package/build/esm/dev/package.json +1 -0
- package/build/esm/{pages-plugin.js → dev/pages-plugin.js} +8 -3
- package/build/esm/dev/pages-plugin.js.map +1 -0
- package/build/esm/{request.js → dev/request.js} +21 -12
- package/build/esm/dev/request.js.map +1 -0
- package/build/esm/dev/scope-utils.js.map +1 -0
- package/build/esm/dev/sdk.js +16 -0
- package/build/esm/dev/sdk.js.map +1 -0
- package/build/esm/dev/transport.js.map +1 -0
- package/build/esm/{utils → dev/utils}/instrumentContext.js +8 -13
- package/build/esm/dev/utils/instrumentContext.js.map +1 -0
- package/build/esm/dev/utils/internalSqlQuery.js.map +1 -0
- package/build/esm/dev/utils/internalStorageKey.js.map +1 -0
- package/build/esm/dev/utils/invocationScope.js.map +1 -0
- package/build/esm/dev/utils/isBinding.js.map +1 -0
- package/build/esm/dev/utils/isCloudflareClass.js.map +1 -0
- package/build/esm/dev/utils/rpcMeta.js.map +1 -0
- package/build/esm/dev/utils/streaming.js.map +1 -0
- package/build/esm/{utils → dev/utils}/traceLinks.js +1 -1
- package/build/esm/dev/utils/traceLinks.js.map +1 -0
- package/build/esm/dev/vendor/stacktrace.js.map +1 -0
- package/build/esm/dev/vite/agentClass.js.map +1 -0
- package/build/esm/dev/vite/autoInstrument.js.map +1 -0
- package/build/esm/{vite → dev/vite}/index.js +4 -2
- package/build/esm/dev/vite/index.js.map +1 -0
- package/build/esm/dev/vite/instrumentFile.js.map +1 -0
- package/build/esm/dev/vite/moduleShape.js.map +1 -0
- package/build/esm/dev/vite/transform.js.map +1 -0
- package/build/esm/dev/vite/workerEntrypoint.js.map +1 -0
- package/build/esm/dev/vite/wranglerConfig.js.map +1 -0
- package/build/esm/{withSentry.js → dev/withSentry.js} +1 -18
- package/build/esm/dev/withSentry.js.map +1 -0
- package/build/esm/{workflows.js → dev/workflows.js} +7 -2
- package/build/esm/dev/workflows.js.map +1 -0
- package/build/esm/dev/wrapMethodWithSentry.js.map +1 -0
- package/build/esm/prod/baseSdk.js +69 -0
- package/build/esm/prod/baseSdk.js.map +1 -0
- package/build/esm/prod/client.js +120 -0
- package/build/esm/prod/client.js.map +1 -0
- package/build/esm/prod/debug-build.js +4 -0
- package/build/esm/prod/debug-build.js.map +1 -0
- package/build/esm/prod/defineCloudflareOptions.js +9 -0
- package/build/esm/prod/defineCloudflareOptions.js.map +1 -0
- package/build/esm/prod/durableobject.js +229 -0
- package/build/esm/prod/durableobject.js.map +1 -0
- package/build/esm/prod/flush.js +83 -0
- package/build/esm/prod/flush.js.map +1 -0
- package/build/esm/prod/index.js +15 -0
- package/build/esm/{nodejs_compat → prod}/index.js.map +1 -1
- package/build/esm/prod/instrument.js +48 -0
- package/build/esm/prod/instrument.js.map +1 -0
- package/build/esm/prod/instrumentations/agents/index.js +14 -0
- package/build/esm/prod/instrumentations/agents/index.js.map +1 -0
- package/build/esm/prod/instrumentations/agents/instrumentAgentCallableRpc.js +50 -0
- package/build/esm/prod/instrumentations/agents/instrumentAgentCallableRpc.js.map +1 -0
- package/build/esm/prod/instrumentations/agents/instrumentAgentRequestConversation.js +17 -0
- package/build/esm/prod/instrumentations/agents/instrumentAgentRequestConversation.js.map +1 -0
- package/build/esm/prod/instrumentations/agents/instrumentChatAgentConversation.js +29 -0
- package/build/esm/prod/instrumentations/agents/instrumentChatAgentConversation.js.map +1 -0
- package/build/esm/prod/instrumentations/agents/types.js +69 -0
- package/build/esm/prod/instrumentations/agents/types.js.map +1 -0
- package/build/esm/prod/instrumentations/instrumentDurableObjectNamespace.js +38 -0
- package/build/esm/prod/instrumentations/instrumentDurableObjectNamespace.js.map +1 -0
- package/build/esm/prod/instrumentations/instrumentDurableObjectStorage.js +70 -0
- package/build/esm/prod/instrumentations/instrumentDurableObjectStorage.js.map +1 -0
- package/build/esm/prod/instrumentations/instrumentDurableObjectSyncKvStorage.js +38 -0
- package/build/esm/prod/instrumentations/instrumentDurableObjectSyncKvStorage.js.map +1 -0
- package/build/esm/prod/instrumentations/instrumentSqlStorage.js +40 -0
- package/build/esm/prod/instrumentations/instrumentSqlStorage.js.map +1 -0
- package/build/esm/prod/instrumentations/instrumentWorkerEntrypoint.js +137 -0
- package/build/esm/prod/instrumentations/instrumentWorkerEntrypoint.js.map +1 -0
- package/build/esm/prod/instrumentations/worker/instrumentD1.js +159 -0
- package/build/esm/prod/instrumentations/worker/instrumentD1.js.map +1 -0
- package/build/esm/prod/instrumentations/worker/instrumentEmail.js +61 -0
- package/build/esm/prod/instrumentations/worker/instrumentEmail.js.map +1 -0
- package/build/esm/prod/instrumentations/worker/instrumentEnv.js +88 -0
- package/build/esm/prod/instrumentations/worker/instrumentEnv.js.map +1 -0
- package/build/esm/prod/instrumentations/worker/instrumentFetch.js +51 -0
- package/build/esm/prod/instrumentations/worker/instrumentFetch.js.map +1 -0
- package/build/esm/prod/instrumentations/worker/instrumentFetcher.js +22 -0
- package/build/esm/prod/instrumentations/worker/instrumentFetcher.js.map +1 -0
- package/build/esm/prod/instrumentations/worker/instrumentQueue.js +79 -0
- package/build/esm/prod/instrumentations/worker/instrumentQueue.js.map +1 -0
- package/build/esm/prod/instrumentations/worker/instrumentQueueProducer.js +78 -0
- package/build/esm/prod/instrumentations/worker/instrumentQueueProducer.js.map +1 -0
- package/build/esm/prod/instrumentations/worker/instrumentR2.js +122 -0
- package/build/esm/prod/instrumentations/worker/instrumentR2.js.map +1 -0
- package/build/esm/prod/instrumentations/worker/instrumentRateLimit.js +27 -0
- package/build/esm/prod/instrumentations/worker/instrumentRateLimit.js.map +1 -0
- package/build/esm/prod/instrumentations/worker/instrumentScheduled.js +75 -0
- package/build/esm/prod/instrumentations/worker/instrumentScheduled.js.map +1 -0
- package/build/esm/prod/instrumentations/worker/instrumentTail.js +57 -0
- package/build/esm/prod/instrumentations/worker/instrumentTail.js.map +1 -0
- package/build/esm/prod/integrations/fetch.js +117 -0
- package/build/esm/prod/integrations/fetch.js.map +1 -0
- package/build/esm/prod/integrations/httpServer.js +33 -0
- package/build/esm/prod/integrations/httpServer.js.map +1 -0
- package/build/esm/prod/integrations/spotlight.js +61 -0
- package/build/esm/prod/integrations/spotlight.js.map +1 -0
- package/build/esm/prod/integrations/tracing/vercelai.js +16 -0
- package/build/esm/prod/integrations/tracing/vercelai.js.map +1 -0
- package/build/esm/prod/opentelemetry/tracer.js +47 -0
- package/build/esm/prod/opentelemetry/tracer.js.map +1 -0
- package/build/esm/prod/options.js +31 -0
- package/build/esm/prod/options.js.map +1 -0
- package/build/esm/prod/package.json +1 -0
- package/build/esm/prod/pages-plugin.js +22 -0
- package/build/esm/prod/pages-plugin.js.map +1 -0
- package/build/esm/prod/request.js +129 -0
- package/build/esm/prod/request.js.map +1 -0
- package/build/esm/prod/scope-utils.js +18 -0
- package/build/esm/prod/scope-utils.js.map +1 -0
- package/build/esm/prod/sdk.js +16 -0
- package/build/esm/prod/sdk.js.map +1 -0
- package/build/esm/prod/transport.js +72 -0
- package/build/esm/prod/transport.js.map +1 -0
- package/build/esm/prod/utils/instrumentContext.js +61 -0
- package/build/esm/prod/utils/instrumentContext.js.map +1 -0
- package/build/esm/prod/utils/internalSqlQuery.js +23 -0
- package/build/esm/prod/utils/internalSqlQuery.js.map +1 -0
- package/build/esm/prod/utils/internalStorageKey.js +41 -0
- package/build/esm/prod/utils/internalStorageKey.js.map +1 -0
- package/build/esm/prod/utils/invocationScope.js +10 -0
- package/build/esm/prod/utils/invocationScope.js.map +1 -0
- package/build/esm/prod/utils/isBinding.js +29 -0
- package/build/esm/prod/utils/isBinding.js.map +1 -0
- package/build/esm/prod/utils/isCloudflareClass.js +21 -0
- package/build/esm/prod/utils/isCloudflareClass.js.map +1 -0
- package/build/esm/prod/utils/rpcMeta.js +35 -0
- package/build/esm/prod/utils/rpcMeta.js.map +1 -0
- package/build/esm/prod/utils/streaming.js +14 -0
- package/build/esm/prod/utils/streaming.js.map +1 -0
- package/build/esm/prod/utils/traceLinks.js +49 -0
- package/build/esm/prod/utils/traceLinks.js.map +1 -0
- package/build/esm/prod/vendor/stacktrace.js +25 -0
- package/build/esm/prod/vendor/stacktrace.js.map +1 -0
- package/build/esm/prod/vite/agentClass.js +111 -0
- package/build/esm/prod/vite/agentClass.js.map +1 -0
- package/build/esm/prod/vite/autoInstrument.js +92 -0
- package/build/esm/prod/vite/autoInstrument.js.map +1 -0
- package/build/esm/prod/vite/index.js +14 -0
- package/build/esm/prod/vite/index.js.map +1 -0
- package/build/esm/prod/vite/instrumentFile.js +27 -0
- package/build/esm/prod/vite/instrumentFile.js.map +1 -0
- package/build/esm/prod/vite/moduleShape.js +227 -0
- package/build/esm/prod/vite/moduleShape.js.map +1 -0
- package/build/esm/prod/vite/transform.js +147 -0
- package/build/esm/prod/vite/transform.js.map +1 -0
- package/build/esm/prod/vite/workerEntrypoint.js +64 -0
- package/build/esm/prod/vite/workerEntrypoint.js.map +1 -0
- package/build/esm/prod/vite/wranglerConfig.js +52 -0
- package/build/esm/prod/vite/wranglerConfig.js.map +1 -0
- package/build/esm/prod/withSentry.js +27 -0
- package/build/esm/prod/withSentry.js.map +1 -0
- package/build/esm/prod/workflows.js +136 -0
- package/build/esm/prod/workflows.js.map +1 -0
- package/build/esm/prod/wrapMethodWithSentry.js +132 -0
- package/build/esm/prod/wrapMethodWithSentry.js.map +1 -0
- package/build/types/baseSdk.d.ts +28 -0
- package/build/types/baseSdk.d.ts.map +1 -0
- package/build/types/client.d.ts +12 -39
- package/build/types/client.d.ts.map +1 -1
- package/build/types/defineCloudflareOptions.d.ts +2 -2
- package/build/types/defineCloudflareOptions.d.ts.map +1 -1
- package/build/types/durableobject.d.ts +5 -4
- package/build/types/durableobject.d.ts.map +1 -1
- package/build/types/index.d.ts +3 -5
- package/build/types/index.d.ts.map +1 -1
- package/build/types/instrumentations/agents/types.d.ts.map +1 -1
- package/build/types/instrumentations/instrumentDurableObjectStorage.d.ts.map +1 -1
- package/build/types/instrumentations/instrumentSqlStorage.d.ts.map +1 -1
- package/build/types/instrumentations/instrumentWorkerEntrypoint.d.ts +2 -1
- package/build/types/instrumentations/instrumentWorkerEntrypoint.d.ts.map +1 -1
- package/build/types/instrumentations/worker/instrumentD1.d.ts +0 -16
- package/build/types/instrumentations/worker/instrumentD1.d.ts.map +1 -1
- package/build/types/instrumentations/worker/instrumentEmail.d.ts +2 -2
- package/build/types/instrumentations/worker/instrumentEmail.d.ts.map +1 -1
- package/build/types/instrumentations/worker/instrumentEnv.d.ts.map +1 -1
- package/build/types/instrumentations/worker/instrumentFetch.d.ts +2 -2
- package/build/types/instrumentations/worker/instrumentFetch.d.ts.map +1 -1
- package/build/types/instrumentations/worker/instrumentQueue.d.ts +2 -2
- package/build/types/instrumentations/worker/instrumentQueue.d.ts.map +1 -1
- package/build/types/instrumentations/worker/instrumentScheduled.d.ts +2 -2
- package/build/types/instrumentations/worker/instrumentScheduled.d.ts.map +1 -1
- package/build/types/instrumentations/worker/instrumentTail.d.ts +2 -2
- package/build/types/instrumentations/worker/instrumentTail.d.ts.map +1 -1
- package/build/types/integrations/httpServer.d.ts.map +1 -1
- package/build/types/integrations/spotlight.d.ts +1 -1
- package/build/types/integrations/tracing/vercelai.d.ts +2 -10
- package/build/types/integrations/tracing/vercelai.d.ts.map +1 -1
- package/build/types/options.d.ts.map +1 -1
- package/build/types/pages-plugin.d.ts +1 -1
- package/build/types/pages-plugin.d.ts.map +1 -1
- package/build/types/request.d.ts +17 -2
- package/build/types/request.d.ts.map +1 -1
- package/build/types/sdk.d.ts +8 -3
- package/build/types/sdk.d.ts.map +1 -1
- package/build/types/transport.d.ts.map +1 -1
- package/build/types/types.d.ts +85 -0
- package/build/types/types.d.ts.map +1 -0
- package/build/types/utils/instrumentContext.d.ts.map +1 -1
- package/build/types/utils/isCloudflareClass.d.ts +1 -1
- package/build/types/utils/isCloudflareClass.d.ts.map +1 -1
- package/build/types/vite/autoInstrument.d.ts.map +1 -1
- package/build/types/vite/index.d.ts +37 -61
- package/build/types/vite/index.d.ts.map +1 -1
- package/build/types/withSentry.d.ts +2 -2
- package/build/types/withSentry.d.ts.map +1 -1
- package/build/types/workflows.d.ts +5 -4
- package/build/types/workflows.d.ts.map +1 -1
- package/package.json +28 -51
- package/build/cjs/async.js +0 -63
- package/build/cjs/async.js.map +0 -1
- package/build/cjs/client.js.map +0 -1
- package/build/cjs/debug-build.js.map +0 -1
- package/build/cjs/defineCloudflareOptions.js.map +0 -1
- package/build/cjs/durableobject.js.map +0 -1
- package/build/cjs/flush.js.map +0 -1
- package/build/cjs/instrument.js.map +0 -1
- package/build/cjs/instrumentations/agents/index.js.map +0 -1
- package/build/cjs/instrumentations/agents/instrumentAgentCallableRpc.js.map +0 -1
- package/build/cjs/instrumentations/agents/instrumentAgentRequestConversation.js.map +0 -1
- package/build/cjs/instrumentations/agents/instrumentChatAgentConversation.js.map +0 -1
- package/build/cjs/instrumentations/agents/types.js.map +0 -1
- package/build/cjs/instrumentations/instrumentDurableObjectNamespace.js.map +0 -1
- package/build/cjs/instrumentations/instrumentDurableObjectStorage.js.map +0 -1
- package/build/cjs/instrumentations/instrumentDurableObjectSyncKvStorage.js.map +0 -1
- package/build/cjs/instrumentations/instrumentSqlStorage.js.map +0 -1
- package/build/cjs/instrumentations/instrumentWorkerEntrypoint.js.map +0 -1
- package/build/cjs/instrumentations/worker/instrumentD1.js.map +0 -1
- package/build/cjs/instrumentations/worker/instrumentEmail.js.map +0 -1
- package/build/cjs/instrumentations/worker/instrumentEnv.js.map +0 -1
- package/build/cjs/instrumentations/worker/instrumentFetch.js.map +0 -1
- package/build/cjs/instrumentations/worker/instrumentFetcher.js.map +0 -1
- package/build/cjs/instrumentations/worker/instrumentQueue.js.map +0 -1
- package/build/cjs/instrumentations/worker/instrumentQueueProducer.js.map +0 -1
- package/build/cjs/instrumentations/worker/instrumentR2.js.map +0 -1
- package/build/cjs/instrumentations/worker/instrumentRateLimit.js.map +0 -1
- package/build/cjs/instrumentations/worker/instrumentScheduled.js.map +0 -1
- package/build/cjs/instrumentations/worker/instrumentTail.js.map +0 -1
- package/build/cjs/integrations/fetch.js.map +0 -1
- package/build/cjs/integrations/hono.js +0 -52
- package/build/cjs/integrations/hono.js.map +0 -1
- package/build/cjs/integrations/httpServer.js.map +0 -1
- package/build/cjs/integrations/spotlight.js.map +0 -1
- package/build/cjs/integrations/tracing/vercelai.js.map +0 -1
- package/build/cjs/nodejs_compat/integrations/tracing/vercelai.js.map +0 -1
- package/build/cjs/opentelemetry/tracer.js.map +0 -1
- package/build/cjs/options.js.map +0 -1
- package/build/cjs/pages-plugin.js.map +0 -1
- package/build/cjs/request.js.map +0 -1
- package/build/cjs/scope-utils.js.map +0 -1
- package/build/cjs/sdk.js.map +0 -1
- package/build/cjs/transport.js.map +0 -1
- package/build/cjs/utils/instrumentContext.js.map +0 -1
- package/build/cjs/utils/internalSqlQuery.js.map +0 -1
- package/build/cjs/utils/internalStorageKey.js.map +0 -1
- package/build/cjs/utils/invocationScope.js.map +0 -1
- package/build/cjs/utils/isBinding.js.map +0 -1
- package/build/cjs/utils/isCloudflareClass.js.map +0 -1
- package/build/cjs/utils/rpcMeta.js.map +0 -1
- package/build/cjs/utils/rpcOptions.js +0 -26
- package/build/cjs/utils/rpcOptions.js.map +0 -1
- package/build/cjs/utils/streaming.js.map +0 -1
- package/build/cjs/utils/traceLinks.js.map +0 -1
- package/build/cjs/vendor/stacktrace.js.map +0 -1
- package/build/cjs/vite/agentClass.js.map +0 -1
- package/build/cjs/vite/autoInstrument.js.map +0 -1
- package/build/cjs/vite/index.js.map +0 -1
- package/build/cjs/vite/instrumentFile.js.map +0 -1
- package/build/cjs/vite/moduleShape.js.map +0 -1
- package/build/cjs/vite/transform.js.map +0 -1
- package/build/cjs/vite/workerEntrypoint.js.map +0 -1
- package/build/cjs/vite/wranglerConfig.js.map +0 -1
- package/build/cjs/withSentry.js.map +0 -1
- package/build/cjs/workflows.js.map +0 -1
- package/build/cjs/wrapMethodWithSentry.js.map +0 -1
- package/build/esm/async.js +0 -61
- package/build/esm/async.js.map +0 -1
- package/build/esm/client.js.map +0 -1
- package/build/esm/debug-build.js.map +0 -1
- package/build/esm/defineCloudflareOptions.js.map +0 -1
- package/build/esm/durableobject.js.map +0 -1
- package/build/esm/flush.js.map +0 -1
- package/build/esm/index.js +0 -17
- package/build/esm/instrument.js.map +0 -1
- package/build/esm/instrumentations/agents/index.js.map +0 -1
- package/build/esm/instrumentations/agents/instrumentAgentCallableRpc.js.map +0 -1
- package/build/esm/instrumentations/agents/instrumentAgentRequestConversation.js.map +0 -1
- package/build/esm/instrumentations/agents/instrumentChatAgentConversation.js.map +0 -1
- package/build/esm/instrumentations/agents/types.js.map +0 -1
- package/build/esm/instrumentations/instrumentDurableObjectNamespace.js.map +0 -1
- package/build/esm/instrumentations/instrumentDurableObjectStorage.js.map +0 -1
- package/build/esm/instrumentations/instrumentDurableObjectSyncKvStorage.js.map +0 -1
- package/build/esm/instrumentations/instrumentSqlStorage.js.map +0 -1
- package/build/esm/instrumentations/instrumentWorkerEntrypoint.js.map +0 -1
- package/build/esm/instrumentations/worker/instrumentD1.js.map +0 -1
- package/build/esm/instrumentations/worker/instrumentEmail.js.map +0 -1
- package/build/esm/instrumentations/worker/instrumentEnv.js.map +0 -1
- package/build/esm/instrumentations/worker/instrumentFetch.js.map +0 -1
- package/build/esm/instrumentations/worker/instrumentFetcher.js.map +0 -1
- package/build/esm/instrumentations/worker/instrumentQueue.js.map +0 -1
- package/build/esm/instrumentations/worker/instrumentQueueProducer.js.map +0 -1
- package/build/esm/instrumentations/worker/instrumentR2.js.map +0 -1
- package/build/esm/instrumentations/worker/instrumentRateLimit.js.map +0 -1
- package/build/esm/instrumentations/worker/instrumentScheduled.js.map +0 -1
- package/build/esm/instrumentations/worker/instrumentTail.js.map +0 -1
- package/build/esm/integrations/fetch.js.map +0 -1
- package/build/esm/integrations/hono.js +0 -49
- package/build/esm/integrations/hono.js.map +0 -1
- package/build/esm/integrations/httpServer.js.map +0 -1
- package/build/esm/integrations/spotlight.js.map +0 -1
- package/build/esm/integrations/tracing/vercelai.js.map +0 -1
- package/build/esm/nodejs_compat/index.js +0 -18
- package/build/esm/nodejs_compat/integrations/tracing/vercelai.js +0 -16
- package/build/esm/nodejs_compat/integrations/tracing/vercelai.js.map +0 -1
- package/build/esm/opentelemetry/tracer.js.map +0 -1
- package/build/esm/options.js.map +0 -1
- package/build/esm/package.json +0 -1
- package/build/esm/pages-plugin.js.map +0 -1
- package/build/esm/request.js.map +0 -1
- package/build/esm/scope-utils.js.map +0 -1
- package/build/esm/sdk.js.map +0 -1
- package/build/esm/transport.js.map +0 -1
- package/build/esm/utils/instrumentContext.js.map +0 -1
- package/build/esm/utils/internalSqlQuery.js.map +0 -1
- package/build/esm/utils/internalStorageKey.js.map +0 -1
- package/build/esm/utils/invocationScope.js.map +0 -1
- package/build/esm/utils/isBinding.js.map +0 -1
- package/build/esm/utils/isCloudflareClass.js.map +0 -1
- package/build/esm/utils/rpcMeta.js.map +0 -1
- package/build/esm/utils/rpcOptions.js +0 -24
- package/build/esm/utils/rpcOptions.js.map +0 -1
- package/build/esm/utils/streaming.js.map +0 -1
- package/build/esm/utils/traceLinks.js.map +0 -1
- package/build/esm/vendor/stacktrace.js.map +0 -1
- package/build/esm/vite/agentClass.js.map +0 -1
- package/build/esm/vite/autoInstrument.js.map +0 -1
- package/build/esm/vite/index.js.map +0 -1
- package/build/esm/vite/instrumentFile.js.map +0 -1
- package/build/esm/vite/moduleShape.js.map +0 -1
- package/build/esm/vite/transform.js.map +0 -1
- package/build/esm/vite/workerEntrypoint.js.map +0 -1
- package/build/esm/vite/wranglerConfig.js.map +0 -1
- package/build/esm/withSentry.js.map +0 -1
- package/build/esm/workflows.js.map +0 -1
- package/build/esm/wrapMethodWithSentry.js.map +0 -1
- package/build/types/async.d.ts +0 -11
- package/build/types/async.d.ts.map +0 -1
- package/build/types/integrations/hono.d.ts +0 -42
- package/build/types/integrations/hono.d.ts.map +0 -1
- package/build/types/nodejs_compat/index.d.ts +0 -4
- package/build/types/nodejs_compat/index.d.ts.map +0 -1
- package/build/types/nodejs_compat/integrations/tracing/vercelai.d.ts +0 -37
- package/build/types/nodejs_compat/integrations/tracing/vercelai.d.ts.map +0 -1
- package/build/types/utils/rpcOptions.d.ts +0 -13
- package/build/types/utils/rpcOptions.d.ts.map +0 -1
- package/build/types-ts3.8/async.d.ts +0 -11
- package/build/types-ts3.8/client.d.ts +0 -203
- package/build/types-ts3.8/debug-build.d.ts +0 -7
- package/build/types-ts3.8/defineCloudflareOptions.d.ts +0 -38
- package/build/types-ts3.8/durableobject.d.ts +0 -127
- package/build/types-ts3.8/executionContext.d.ts +0 -13
- package/build/types-ts3.8/flush.d.ts +0 -47
- package/build/types-ts3.8/index.d.ts +0 -19
- package/build/types-ts3.8/instrument.d.ts +0 -20
- package/build/types-ts3.8/instrumentations/agents/index.d.ts +0 -25
- package/build/types-ts3.8/instrumentations/agents/instrumentAgentCallableRpc.d.ts +0 -14
- package/build/types-ts3.8/instrumentations/agents/instrumentAgentRequestConversation.d.ts +0 -16
- package/build/types-ts3.8/instrumentations/agents/instrumentChatAgentConversation.d.ts +0 -23
- package/build/types-ts3.8/instrumentations/agents/types.d.ts +0 -94
- package/build/types-ts3.8/instrumentations/instrumentDurableObjectNamespace.d.ts +0 -13
- package/build/types-ts3.8/instrumentations/instrumentDurableObjectStorage.d.ts +0 -19
- package/build/types-ts3.8/instrumentations/instrumentDurableObjectSyncKvStorage.d.ts +0 -3
- package/build/types-ts3.8/instrumentations/instrumentSqlStorage.d.ts +0 -9
- package/build/types-ts3.8/instrumentations/instrumentWorkerEntrypoint.d.ts +0 -42
- package/build/types-ts3.8/instrumentations/worker/instrumentD1.d.ts +0 -19
- package/build/types-ts3.8/instrumentations/worker/instrumentEmail.d.ts +0 -8
- package/build/types-ts3.8/instrumentations/worker/instrumentEnv.d.ts +0 -18
- package/build/types-ts3.8/instrumentations/worker/instrumentFetch.d.ts +0 -12
- package/build/types-ts3.8/instrumentations/worker/instrumentFetcher.d.ts +0 -10
- package/build/types-ts3.8/instrumentations/worker/instrumentQueue.d.ts +0 -12
- package/build/types-ts3.8/instrumentations/worker/instrumentQueueProducer.d.ts +0 -10
- package/build/types-ts3.8/instrumentations/worker/instrumentR2.d.ts +0 -9
- package/build/types-ts3.8/instrumentations/worker/instrumentRateLimit.d.ts +0 -6
- package/build/types-ts3.8/instrumentations/worker/instrumentScheduled.d.ts +0 -12
- package/build/types-ts3.8/instrumentations/worker/instrumentTail.d.ts +0 -12
- package/build/types-ts3.8/integrations/fetch.d.ts +0 -19
- package/build/types-ts3.8/integrations/hono.d.ts +0 -42
- package/build/types-ts3.8/integrations/httpServer.d.ts +0 -63
- package/build/types-ts3.8/integrations/spotlight.d.ts +0 -22
- package/build/types-ts3.8/integrations/tracing/vercelai.d.ts +0 -47
- package/build/types-ts3.8/nodejs_compat/index.d.ts +0 -4
- package/build/types-ts3.8/nodejs_compat/integrations/tracing/vercelai.d.ts +0 -37
- package/build/types-ts3.8/opentelemetry/tracer.d.ts +0 -6
- package/build/types-ts3.8/options.d.ts +0 -17
- package/build/types-ts3.8/pages-plugin.d.ts +0 -34
- package/build/types-ts3.8/request.d.ts +0 -25
- package/build/types-ts3.8/scope-utils.d.ts +0 -15
- package/build/types-ts3.8/sdk.d.ts +0 -10
- package/build/types-ts3.8/transport.d.ts +0 -34
- package/build/types-ts3.8/utils/instrumentContext.d.ts +0 -16
- package/build/types-ts3.8/utils/internalSqlQuery.d.ts +0 -20
- package/build/types-ts3.8/utils/internalStorageKey.d.ts +0 -22
- package/build/types-ts3.8/utils/invocationScope.d.ts +0 -24
- package/build/types-ts3.8/utils/isBinding.d.ts +0 -77
- package/build/types-ts3.8/utils/isCloudflareClass.d.ts +0 -30
- package/build/types-ts3.8/utils/rpcMeta.d.ts +0 -23
- package/build/types-ts3.8/utils/rpcOptions.d.ts +0 -13
- package/build/types-ts3.8/utils/streaming.d.ts +0 -17
- package/build/types-ts3.8/utils/traceLinks.d.ts +0 -28
- package/build/types-ts3.8/vendor/stacktrace.d.ts +0 -11
- package/build/types-ts3.8/vite/agentClass.d.ts +0 -41
- package/build/types-ts3.8/vite/autoInstrument.d.ts +0 -22
- package/build/types-ts3.8/vite/index.d.ts +0 -98
- package/build/types-ts3.8/vite/instrumentFile.d.ts +0 -22
- package/build/types-ts3.8/vite/moduleShape.d.ts +0 -52
- package/build/types-ts3.8/vite/transform.d.ts +0 -65
- package/build/types-ts3.8/vite/workerEntrypoint.d.ts +0 -12
- package/build/types-ts3.8/vite/wranglerConfig.d.ts +0 -43
- package/build/types-ts3.8/withSentry.d.ts +0 -16
- package/build/types-ts3.8/workflows.d.ts +0 -25
- package/build/types-ts3.8/wrapMethodWithSentry.d.ts +0 -43
- /package/build/cjs/{client.js → dev/client.js} +0 -0
- /package/build/cjs/{debug-build.js → dev/debug-build.js} +0 -0
- /package/build/cjs/{defineCloudflareOptions.js → dev/defineCloudflareOptions.js} +0 -0
- /package/build/cjs/{flush.js → dev/flush.js} +0 -0
- /package/build/cjs/{instrument.js → dev/instrument.js} +0 -0
- /package/build/cjs/{instrumentations → dev/instrumentations}/agents/index.js +0 -0
- /package/build/cjs/{instrumentations → dev/instrumentations}/agents/instrumentAgentCallableRpc.js +0 -0
- /package/build/cjs/{instrumentations → dev/instrumentations}/agents/instrumentAgentRequestConversation.js +0 -0
- /package/build/cjs/{instrumentations → dev/instrumentations}/agents/instrumentChatAgentConversation.js +0 -0
- /package/build/cjs/{instrumentations → dev/instrumentations}/instrumentDurableObjectNamespace.js +0 -0
- /package/build/cjs/{instrumentations → dev/instrumentations}/instrumentDurableObjectStorage.js +0 -0
- /package/build/cjs/{instrumentations → dev/instrumentations}/instrumentDurableObjectSyncKvStorage.js +0 -0
- /package/build/cjs/{instrumentations → dev/instrumentations}/instrumentSqlStorage.js +0 -0
- /package/build/cjs/{instrumentations → dev/instrumentations}/worker/instrumentFetcher.js +0 -0
- /package/build/cjs/{instrumentations → dev/instrumentations}/worker/instrumentQueueProducer.js +0 -0
- /package/build/cjs/{instrumentations → dev/instrumentations}/worker/instrumentR2.js +0 -0
- /package/build/cjs/{instrumentations → dev/instrumentations}/worker/instrumentRateLimit.js +0 -0
- /package/build/cjs/{instrumentations → dev/instrumentations}/worker/instrumentTail.js +0 -0
- /package/build/cjs/{integrations → dev/integrations}/spotlight.js +0 -0
- /package/build/cjs/{opentelemetry → dev/opentelemetry}/tracer.js +0 -0
- /package/build/cjs/{scope-utils.js → dev/scope-utils.js} +0 -0
- /package/build/cjs/{transport.js → dev/transport.js} +0 -0
- /package/build/cjs/{utils → dev/utils}/internalSqlQuery.js +0 -0
- /package/build/cjs/{utils → dev/utils}/internalStorageKey.js +0 -0
- /package/build/cjs/{utils → dev/utils}/invocationScope.js +0 -0
- /package/build/cjs/{utils → dev/utils}/isBinding.js +0 -0
- /package/build/cjs/{utils → dev/utils}/isCloudflareClass.js +0 -0
- /package/build/cjs/{utils → dev/utils}/rpcMeta.js +0 -0
- /package/build/cjs/{utils → dev/utils}/streaming.js +0 -0
- /package/build/cjs/{utils → dev/utils}/traceLinks.js +0 -0
- /package/build/cjs/{vendor → dev/vendor}/stacktrace.js +0 -0
- /package/build/cjs/{vite → dev/vite}/agentClass.js +0 -0
- /package/build/cjs/{vite → dev/vite}/autoInstrument.js +0 -0
- /package/build/cjs/{vite → dev/vite}/instrumentFile.js +0 -0
- /package/build/cjs/{vite → dev/vite}/moduleShape.js +0 -0
- /package/build/cjs/{vite → dev/vite}/transform.js +0 -0
- /package/build/cjs/{vite → dev/vite}/workerEntrypoint.js +0 -0
- /package/build/cjs/{vite → dev/vite}/wranglerConfig.js +0 -0
- /package/build/cjs/{wrapMethodWithSentry.js → dev/wrapMethodWithSentry.js} +0 -0
- /package/build/esm/{client.js → dev/client.js} +0 -0
- /package/build/esm/{debug-build.js → dev/debug-build.js} +0 -0
- /package/build/esm/{defineCloudflareOptions.js → dev/defineCloudflareOptions.js} +0 -0
- /package/build/esm/{flush.js → dev/flush.js} +0 -0
- /package/build/esm/{instrument.js → dev/instrument.js} +0 -0
- /package/build/esm/{instrumentations → dev/instrumentations}/agents/index.js +0 -0
- /package/build/esm/{instrumentations → dev/instrumentations}/agents/instrumentAgentCallableRpc.js +0 -0
- /package/build/esm/{instrumentations → dev/instrumentations}/agents/instrumentAgentRequestConversation.js +0 -0
- /package/build/esm/{instrumentations → dev/instrumentations}/agents/instrumentChatAgentConversation.js +0 -0
- /package/build/esm/{instrumentations → dev/instrumentations}/instrumentDurableObjectNamespace.js +0 -0
- /package/build/esm/{instrumentations → dev/instrumentations}/instrumentDurableObjectStorage.js +0 -0
- /package/build/esm/{instrumentations → dev/instrumentations}/instrumentDurableObjectSyncKvStorage.js +0 -0
- /package/build/esm/{instrumentations → dev/instrumentations}/instrumentSqlStorage.js +0 -0
- /package/build/esm/{instrumentations → dev/instrumentations}/worker/instrumentFetcher.js +0 -0
- /package/build/esm/{instrumentations → dev/instrumentations}/worker/instrumentQueueProducer.js +0 -0
- /package/build/esm/{instrumentations → dev/instrumentations}/worker/instrumentR2.js +0 -0
- /package/build/esm/{instrumentations → dev/instrumentations}/worker/instrumentRateLimit.js +0 -0
- /package/build/esm/{instrumentations → dev/instrumentations}/worker/instrumentTail.js +0 -0
- /package/build/esm/{integrations → dev/integrations}/spotlight.js +0 -0
- /package/build/esm/{opentelemetry → dev/opentelemetry}/tracer.js +0 -0
- /package/build/esm/{scope-utils.js → dev/scope-utils.js} +0 -0
- /package/build/esm/{transport.js → dev/transport.js} +0 -0
- /package/build/esm/{utils → dev/utils}/internalSqlQuery.js +0 -0
- /package/build/esm/{utils → dev/utils}/internalStorageKey.js +0 -0
- /package/build/esm/{utils → dev/utils}/invocationScope.js +0 -0
- /package/build/esm/{utils → dev/utils}/isBinding.js +0 -0
- /package/build/esm/{utils → dev/utils}/isCloudflareClass.js +0 -0
- /package/build/esm/{utils → dev/utils}/rpcMeta.js +0 -0
- /package/build/esm/{utils → dev/utils}/streaming.js +0 -0
- /package/build/esm/{vendor → dev/vendor}/stacktrace.js +0 -0
- /package/build/esm/{vite → dev/vite}/agentClass.js +0 -0
- /package/build/esm/{vite → dev/vite}/autoInstrument.js +0 -0
- /package/build/esm/{vite → dev/vite}/instrumentFile.js +0 -0
- /package/build/esm/{vite → dev/vite}/moduleShape.js +0 -0
- /package/build/esm/{vite → dev/vite}/transform.js +0 -0
- /package/build/esm/{vite → dev/vite}/workerEntrypoint.js +0 -0
- /package/build/esm/{vite → dev/vite}/wranglerConfig.js +0 -0
- /package/build/esm/{wrapMethodWithSentry.js → dev/wrapMethodWithSentry.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instrumentContext.js","sources":["../../../../src/utils/instrumentContext.ts"],"sourcesContent":["import { type DurableObjectState, type DurableObjectStorage, type ExecutionContext } from '@cloudflare/workers-types';\nimport { instrumentDurableObjectStorage } from '../instrumentations/instrumentDurableObjectStorage';\n\ntype ContextType = ExecutionContext | DurableObjectState;\ntype OverridesStore<T extends ContextType> = Map<keyof T, (...args: unknown[]) => unknown>;\n\n/**\n * Instruments an execution context or DurableObjectState with Sentry tracing.\n *\n * Creates a copy of the context that:\n * - Allows overriding of methods (e.g., waitUntil)\n * - For DurableObjectState: instruments storage operations (get, put, delete, list, etc.)\n * to create Sentry spans automatically\n *\n * @param ctx - The execution context or DurableObjectState to instrument\n * @returns An instrumented copy of the context\n */\nexport function instrumentContext<T extends ContextType>(ctx: T): T {\n if (!ctx) return ctx;\n\n const overrides: OverridesStore<T> = new Map();\n const contextPrototype = Object.getPrototypeOf(ctx);\n const prototypeMethodNames = Object.getOwnPropertyNames(contextPrototype) as unknown as (keyof T)[];\n const ownPropertyNames = Object.getOwnPropertyNames(ctx) as unknown as (keyof T)[];\n const instrumented = new Set<unknown>(['constructor']);\n const descriptors: PropertyDescriptorMap = {};\n\n for (const methodName of [...ownPropertyNames, ...prototypeMethodNames]) {\n if (instrumented.has(methodName) || typeof ctx[methodName] !== 'function') {\n continue;\n }\n\n instrumented.add(methodName);\n descriptors[methodName as string] = makeOverridableDescriptor(overrides, ctx, methodName);\n }\n\n // Check if this is a DurableObjectState context with a storage property\n // If so, wrap the storage with instrumentation\n if ('storage' in ctx && ctx.storage) {\n const originalStorage = ctx.storage;\n const waitUntil = 'waitUntil' in ctx && typeof ctx.waitUntil === 'function' ? ctx.waitUntil.bind(ctx) : undefined;\n let instrumentedStorage: DurableObjectStorage | undefined;\n descriptors.storage = {\n configurable: true,\n enumerable: true,\n get: () => {\n if (!instrumentedStorage) {\n instrumentedStorage = instrumentDurableObjectStorage(originalStorage, waitUntil);\n }\n return instrumentedStorage;\n },\n };\n // Expose the original uninstrumented storage for internal Sentry operations\n // This avoids creating spans for internal storage operations\n descriptors.originalStorage = {\n configurable: true,\n enumerable: false,\n get: () => originalStorage,\n };\n }\n\n return Object.create(ctx, descriptors);\n}\n\n/**\n * Creates a property descriptor that allows overriding of a method on the given context object.\n *\n * This descriptor supports property overriding with functions only. It delegates method calls to\n * the provided store if an override exists or to the original method on the context otherwise.\n *\n * @param {OverridesStore<ContextType>} store - The storage for overridden methods specific to the context type.\n * @param {ContextType} ctx - The context object that contains the method to be overridden.\n * @param {keyof ContextType} method - The method on the context object to create the overridable descriptor for.\n * @return {PropertyDescriptor} A property descriptor enabling the overriding of the specified method.\n */\nfunction makeOverridableDescriptor<T extends ContextType>(\n store: OverridesStore<T>,\n ctx: T,\n method: keyof T,\n): PropertyDescriptor {\n return {\n configurable: true,\n enumerable: true,\n set: newValue => {\n if (typeof newValue == 'function') {\n store.set(method, newValue);\n return;\n }\n Reflect.set(ctx, method, newValue);\n },\n\n get: () => {\n if (store.has(method)) return store.get(method);\n const methodFunction = Reflect.get(ctx, method);\n if (typeof methodFunction !== 'function') return methodFunction;\n // We should do bind() to make sure that the method is bound to the context object - otherwise it will not work\n return methodFunction.bind(ctx);\n },\n };\n}\n"],"names":["instrumentDurableObjectStorage"],"mappings":";;;;AAiBO,SAAS,kBAAyC,GAAA,EAAW;AAClE,EAAA,IAAI,CAAC,KAAK,OAAO,GAAA;AAEjB,EAAA,MAAM,SAAA,uBAAmC,GAAA,EAAI;AAC7C,EAAA,MAAM,gBAAA,GAAmB,MAAA,CAAO,cAAA,CAAe,GAAG,CAAA;AAClD,EAAA,MAAM,oBAAA,GAAuB,MAAA,CAAO,mBAAA,CAAoB,gBAAgB,CAAA;AACxE,EAAA,MAAM,gBAAA,GAAmB,MAAA,CAAO,mBAAA,CAAoB,GAAG,CAAA;AACvD,EAAA,MAAM,YAAA,mBAAe,IAAI,GAAA,CAAa,CAAC,aAAa,CAAC,CAAA;AACrD,EAAA,MAAM,cAAqC,EAAC;AAE5C,EAAA,KAAA,MAAW,cAAc,CAAC,GAAG,gBAAA,EAAkB,GAAG,oBAAoB,CAAA,EAAG;AACvE,IAAA,IAAI,YAAA,CAAa,IAAI,UAAU,CAAA,IAAK,OAAO,GAAA,CAAI,UAAU,MAAM,UAAA,EAAY;AACzE,MAAA;AAAA,IACF;AAEA,IAAA,YAAA,CAAa,IAAI,UAAU,CAAA;AAC3B,IAAA,WAAA,CAAY,UAAoB,CAAA,GAAI,yBAAA,CAA0B,SAAA,EAAW,KAAK,UAAU,CAAA;AAAA,EAC1F;AAIA,EAAA,IAAI,SAAA,IAAa,GAAA,IAAO,GAAA,CAAI,OAAA,EAAS;AACnC,IAAA,MAAM,kBAAkB,GAAA,CAAI,OAAA;AAC5B,IAAA,MAAM,SAAA,GAAY,WAAA,IAAe,GAAA,IAAO,OAAO,GAAA,CAAI,SAAA,KAAc,UAAA,GAAa,GAAA,CAAI,SAAA,CAAU,IAAA,CAAK,GAAG,CAAA,GAAI,MAAA;AACxG,IAAA,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 -0,0 +1,25 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const core = require('@sentry/core');
|
|
4
|
+
|
|
5
|
+
function targetsCloudflareInternalTable(querySummary, allowlist, queryText) {
|
|
6
|
+
if (!querySummary) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
const indexedTable = queryText ? CREATE_INDEX_TABLE_RE.exec(queryText)?.groups?.["table"] : void 0;
|
|
10
|
+
if (indexedTable) {
|
|
11
|
+
return isCloudflareInternalTable(indexedTable, allowlist);
|
|
12
|
+
}
|
|
13
|
+
const [, ...tables] = querySummary.split(" ");
|
|
14
|
+
return tables.some((table) => isCloudflareInternalTable(table, allowlist));
|
|
15
|
+
}
|
|
16
|
+
const CREATE_INDEX_TABLE_RE = /^\s*CREATE\s+(?:UNIQUE\s+)?INDEX(?:\s+IF\s+(?:NOT\s+)?EXISTS)?\s+[^\s(,;)]+\s+ON\s+(?<table>[^\s(,;)]+)/i;
|
|
17
|
+
function isCloudflareInternalTable(table, allowlist) {
|
|
18
|
+
if (!table.toLowerCase().startsWith("cf_")) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
return !allowlist?.length || !core.stringMatchesSomePattern(table, allowlist, true);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
exports.targetsCloudflareInternalTable = targetsCloudflareInternalTable;
|
|
25
|
+
//# sourceMappingURL=internalSqlQuery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internalSqlQuery.js","sources":["../../../../src/utils/internalSqlQuery.ts"],"sourcesContent":["import { stringMatchesSomePattern } from '@sentry/core';\n\n/**\n * Cloudflare frameworks that build on Durable Objects (`agents`, `partyserver`, ...) manage their\n * own internal SQLite tables, all namespaced with a `cf_` prefix — e.g. `cf_agents_schedules`,\n * `cf_agent_state`, `cf_ai_chat_stream_chunks`. Queries against them (schedule polling, chat-stream\n * persistence, state bookkeeping) are framework implementation details that otherwise flood traces\n * with dozens of zero-signal `db.query` spans per request. The exact set of tables even varies\n * between framework versions, so we match the reserved prefix rather than an enumerated list.\n *\n * The `cf_` prefix is a reserved convention for framework-managed tables, so user tables should not\n * use it. In case a user table does collide with the prefix, the `durableObjectSqlSpanAllowlist`\n * option lets them opt those tables back into instrumentation.\n *\n * The check operates on the query summary produced by `getSqlQuerySummary` (`{operation} {table} ...`,\n * the same value used as the span name), so table targets are already isolated from the rest of the\n * query. The one exception is `CREATE INDEX`: its summary carries the index name, not the indexed\n * table (upstream OTel convention), so the `cf_` target only appears in the ON clause of the full\n * statement, which `queryText` is needed for.\n */\nexport function targetsCloudflareInternalTable(\n querySummary: string | undefined,\n allowlist?: Array<string | RegExp>,\n queryText?: string,\n): boolean {\n if (!querySummary) {\n return false;\n }\n\n const indexedTable = queryText ? CREATE_INDEX_TABLE_RE.exec(queryText)?.groups?.['table'] : undefined;\n if (indexedTable) {\n return isCloudflareInternalTable(indexedTable, allowlist);\n }\n\n const [, ...tables] = querySummary.split(' ');\n\n return tables.some(table => isCloudflareInternalTable(table, allowlist));\n}\n\n// `CREATE [UNIQUE] INDEX [IF NOT EXISTS] <name> ON <table>` — the IF EXISTS shape mirrors DDL_RE\n// in @sentry/core.\nconst CREATE_INDEX_TABLE_RE =\n /^\\s*CREATE\\s+(?:UNIQUE\\s+)?INDEX(?:\\s+IF\\s+(?:NOT\\s+)?EXISTS)?\\s+[^\\s(,;)]+\\s+ON\\s+(?<table>[^\\s(,;)]+)/i;\n\nfunction isCloudflareInternalTable(table: string, allowlist?: Array<string | RegExp>): boolean {\n if (!table.toLowerCase().startsWith('cf_')) {\n return false;\n }\n\n // A table on the allowlist is treated as a user table and stays instrumented, even though it\n // matches the reserved prefix.\n return !allowlist?.length || !stringMatchesSomePattern(table, allowlist, true);\n}\n"],"names":["stringMatchesSomePattern"],"mappings":";;;;AAoBO,SAAS,8BAAA,CACd,YAAA,EACA,SAAA,EACA,SAAA,EACS;AACT,EAAA,IAAI,CAAC,YAAA,EAAc;AACjB,IAAA,OAAO,KAAA;AAAA,EACT;AAEA,EAAA,MAAM,YAAA,GAAe,YAAY,qBAAA,CAAsB,IAAA,CAAK,SAAS,CAAA,EAAG,MAAA,GAAS,OAAO,CAAA,GAAI,MAAA;AAC5F,EAAA,IAAI,YAAA,EAAc;AAChB,IAAA,OAAO,yBAAA,CAA0B,cAAc,SAAS,CAAA;AAAA,EAC1D;AAEA,EAAA,MAAM,GAAG,GAAG,MAAM,CAAA,GAAI,YAAA,CAAa,MAAM,GAAG,CAAA;AAE5C,EAAA,OAAO,OAAO,IAAA,CAAK,CAAA,KAAA,KAAS,yBAAA,CAA0B,KAAA,EAAO,SAAS,CAAC,CAAA;AACzE;AAIA,MAAM,qBAAA,GACJ,0GAAA;AAEF,SAAS,yBAAA,CAA0B,OAAe,SAAA,EAA6C;AAC7F,EAAA,IAAI,CAAC,KAAA,CAAM,WAAA,EAAY,CAAE,UAAA,CAAW,KAAK,CAAA,EAAG;AAC1C,IAAA,OAAO,KAAA;AAAA,EACT;AAIA,EAAA,OAAO,CAAC,SAAA,EAAW,MAAA,IAAU,CAACA,6BAAA,CAAyB,KAAA,EAAO,WAAW,IAAI,CAAA;AAC/E;;;;"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const core = require('@sentry/core');
|
|
4
|
+
|
|
5
|
+
function targetsCloudflareInternalKey(key, allowlist) {
|
|
6
|
+
if (!key) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
const isFrameworkKey = key.startsWith("cf_") || key.startsWith("cf:") || key.startsWith("__ps_") || key.startsWith("/");
|
|
10
|
+
if (!isFrameworkKey) {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
return !allowlist?.length || !core.stringMatchesSomePattern(key, allowlist, true);
|
|
14
|
+
}
|
|
15
|
+
function getStorageKeys(methodName, args) {
|
|
16
|
+
const [first] = args;
|
|
17
|
+
if (methodName === "get" || methodName === "delete") {
|
|
18
|
+
if (typeof first === "string") {
|
|
19
|
+
return [first];
|
|
20
|
+
}
|
|
21
|
+
if (Array.isArray(first)) {
|
|
22
|
+
return first.filter((k) => typeof k === "string");
|
|
23
|
+
}
|
|
24
|
+
return void 0;
|
|
25
|
+
}
|
|
26
|
+
if (methodName === "put") {
|
|
27
|
+
if (typeof first === "string") {
|
|
28
|
+
return [first];
|
|
29
|
+
}
|
|
30
|
+
if (first && typeof first === "object" && !Array.isArray(first)) {
|
|
31
|
+
return Object.keys(first);
|
|
32
|
+
}
|
|
33
|
+
return void 0;
|
|
34
|
+
}
|
|
35
|
+
if (methodName === "list") {
|
|
36
|
+
const prefix = first && typeof first === "object" ? first.prefix : void 0;
|
|
37
|
+
return typeof prefix === "string" ? [prefix] : void 0;
|
|
38
|
+
}
|
|
39
|
+
return void 0;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
exports.getStorageKeys = getStorageKeys;
|
|
43
|
+
exports.targetsCloudflareInternalKey = targetsCloudflareInternalKey;
|
|
44
|
+
//# sourceMappingURL=internalStorageKey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internalStorageKey.js","sources":["../../../../src/utils/internalStorageKey.ts"],"sourcesContent":["import { stringMatchesSomePattern } from '@sentry/core';\n\n/**\n * Cloudflare frameworks that build on Durable Objects (`agents`, `partyserver`, ...) also manage\n * their own internal KV entries alongside their internal SQLite tables, namespaced with a reserved\n * prefix — e.g. `cf_agents_state`, `cf_agents_mcp_servers`, `__ps_name`. Reads/writes of these\n * (message persistence, MCP connection bookkeeping, name hydration) are framework implementation\n * details that otherwise flood traces with dozens of zero-signal `durable_object_storage_*` spans\n * per request, so we match the reserved prefixes rather than an enumerated list. This mirrors the\n * `cf_` convention used for internal SQL tables (see `targetsCloudflareInternalTable`).\n *\n * The prefixes are a reserved convention for framework-managed entries, so user keys should not use\n * them. In case a user key does collide, the `durableObjectStorageSpanAllowlist` option lets them\n * opt those keys back into instrumentation.\n */\nexport function targetsCloudflareInternalKey(key: string | undefined, allowlist?: Array<string | RegExp>): boolean {\n if (!key) {\n return false;\n }\n\n // Framework-managed KV namespaces:\n // - `cf_` — agents / ai-chat internal state (mirrors the internal SQL table convention)\n // - `cf:` — agents chat-recovery entries (`cf:chat-recovery:*`, `cf:chat:*`); the same reserved\n // `cf` namespace, but colon-separated instead of underscore-separated\n // - `__ps_` — partyserver internals (e.g. `__ps_name`)\n // - `/` — MCP OAuth client state (`/<clientName>/<serverId>/{token,client_info,state,...}`),\n // read on every MCP tool call. User keys on an Agent rarely use a leading slash; if one does,\n // the allowlist opts it back in.\n const isFrameworkKey =\n key.startsWith('cf_') || key.startsWith('cf:') || key.startsWith('__ps_') || key.startsWith('/');\n if (!isFrameworkKey) {\n return false;\n }\n\n // A key on the allowlist is treated as a user key and stays instrumented, even though it matches\n // a reserved prefix.\n return !allowlist?.length || !stringMatchesSomePattern(key, allowlist, true);\n}\n\n/**\n * Extracts the KV keys a Durable Object storage call targets, so the caller can decide whether the\n * operation only touches framework-internal entries. Returns `undefined` when the keys can't be\n * determined from the arguments (e.g. `list()` without a prefix), in which case the call is treated\n * as user work and stays instrumented.\n */\nexport function getStorageKeys(methodName: string, args: unknown[]): string[] | undefined {\n const [first] = args;\n\n if (methodName === 'get' || methodName === 'delete') {\n // get(key) / get(keys[]) / delete(key) / delete(keys[])\n if (typeof first === 'string') {\n return [first];\n }\n if (Array.isArray(first)) {\n return first.filter((k): k is string => typeof k === 'string');\n }\n return undefined;\n }\n\n if (methodName === 'put') {\n // put(key, value) or put({ key: value, ... })\n if (typeof first === 'string') {\n return [first];\n }\n if (first && typeof first === 'object' && !Array.isArray(first)) {\n return Object.keys(first);\n }\n return undefined;\n }\n\n if (methodName === 'list') {\n // list({ prefix })\n const prefix = first && typeof first === 'object' ? (first as { prefix?: unknown }).prefix : undefined;\n return typeof prefix === 'string' ? [prefix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AO,KAAK,KAAK,CAAA;AAAA,IAC1B;AACA,IAAA,OAAO,MAAA;AAAA,EACT;AAEA,EAAA,IAAI,eAAe,MAAA,EAAQ;AAEzB,IAAA,MAAM,SAAS,KAAA,IAAS,OAAO,KAAA,KAAU,QAAA,GAAY,MAA+B,MAAA,GAAS,MAAA;AAC7F,IAAA,OAAO,OAAO,MAAA,KAAW,QAAA,GAAW,CAAC,MAAM,CAAA,GAAI,MAAA;AAAA,EACjD;AAEA,EAAA,OAAO,MAAA;AACT;;;;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const core = require('@sentry/core');
|
|
4
|
+
|
|
5
|
+
function withInvocationIsolationScope(callback) {
|
|
6
|
+
const isolationScope = core.getIsolationScope();
|
|
7
|
+
const newIsolationScope = isolationScope === core.getDefaultIsolationScope() ? isolationScope.clone() : isolationScope;
|
|
8
|
+
return core.withIsolationScope(newIsolationScope, () => callback(newIsolationScope));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
exports.withInvocationIsolationScope = withInvocationIsolationScope;
|
|
12
|
+
//# sourceMappingURL=invocationScope.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invocationScope.js","sources":["../../../../src/utils/invocationScope.ts"],"sourcesContent":["import { getDefaultIsolationScope, getIsolationScope, type Scope, withIsolationScope } from '@sentry/core';\n\n/**\n * Runs `callback` on the isolation scope for the current invocation.\n *\n * An instrumented handler is either the entry point of an invocation or reentrant — reached from\n * another instrumented handler already serving the same invocation (a Durable Object method calling\n * its own `fetch`, an RPC method reaching a sibling method). Only the entry point may fork:\n *\n * - Forking at the entry point is mandatory. `setUser`/`setTag` write to the isolation scope, and a\n * Durable Object's isolation scope outlives the invocation that touched it, so without a fork one\n * invocation's user and tags reappear on the next invocation's events in the same isolate.\n * Forking clones, so request data set by an enclosing wrapper is still inherited.\n * - Forking again when reentrant would be wrong. Everything below the entry point is one logical\n * unit of work: a nested call must see what the caller set and be able to add to it, the way it\n * would if the SDK were not wrapping it at all.\n *\n * The AsyncLocalStorage strategy hands the default isolation scope back whenever no invocation is in\n * flight, and a forked one while inside `withIsolationScope`. Reference-comparing against the default\n * is therefore enough to tell the two cases apart. The stack fallback does not fork, so it reports the\n * default scope even inside an invocation; there the fork degrades to a no-op, which the stack strategy\n * tolerates. This matches the approach used by `patchEventHandler` in Nuxt.\n */\nexport function withInvocationIsolationScope<T>(callback: (scope: Scope) => T): T {\n const isolationScope = getIsolationScope();\n\n const newIsolationScope = isolationScope === getDefaultIsolationScope() ? isolationScope.clone() : isolationScope;\n\n return withIsolationScope(newIsolationScope, () => callback(newIsolationScope));\n}\n"],"names":["getIsolationScope","getDefaultIsolationScope","withIsolationScope"],"mappings":";;;;AAuBO,SAAS,6BAAgC,QAAA,EAAkC;AAChF,EAAA,MAAM,iBAAiBA,sBAAA,EAAkB;AAEzC,EAAA,MAAM,oBAAoB,cAAA,KAAmBC,6BAAA,EAAyB,GAAI,cAAA,CAAe,OAAM,GAAI,cAAA;AAEnG,EAAA,OAAOC,uBAAA,CAAmB,iBAAA,EAAmB,MAAM,QAAA,CAAS,iBAAiB,CAAC,CAAA;AAChF;;;;"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
function isJSRPC(item) {
|
|
4
|
+
try {
|
|
5
|
+
return !!item[`__some_property_that_will_never_exist__${Math.random()}`];
|
|
6
|
+
} catch {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
const isNotJSRPC = (item) => !isJSRPC(item);
|
|
11
|
+
function isDurableObjectNamespace(item) {
|
|
12
|
+
return item != null && isNotJSRPC(item) && typeof item.idFromName === "function";
|
|
13
|
+
}
|
|
14
|
+
function isQueue(item) {
|
|
15
|
+
return item != null && isNotJSRPC(item) && typeof item.send === "function" && typeof item.sendBatch === "function";
|
|
16
|
+
}
|
|
17
|
+
function isD1Database(item) {
|
|
18
|
+
return item != null && isNotJSRPC(item) && typeof item.prepare === "function" && typeof item.batch === "function" && typeof item.exec === "function";
|
|
19
|
+
}
|
|
20
|
+
function isAiBinding(item) {
|
|
21
|
+
return item != null && isNotJSRPC(item) && typeof item.run === "function" && typeof item.gateway === "function" && typeof item.toMarkdown === "function";
|
|
22
|
+
}
|
|
23
|
+
function isR2Bucket(item) {
|
|
24
|
+
return item != null && isNotJSRPC(item) && typeof item.head === "function" && typeof item.put === "function" && typeof item.createMultipartUpload === "function";
|
|
25
|
+
}
|
|
26
|
+
function isRateLimit(item) {
|
|
27
|
+
return item != null && isNotJSRPC(item) && typeof item.limit === "function";
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
exports.isAiBinding = isAiBinding;
|
|
31
|
+
exports.isD1Database = isD1Database;
|
|
32
|
+
exports.isDurableObjectNamespace = isDurableObjectNamespace;
|
|
33
|
+
exports.isJSRPC = isJSRPC;
|
|
34
|
+
exports.isQueue = isQueue;
|
|
35
|
+
exports.isR2Bucket = isR2Bucket;
|
|
36
|
+
exports.isRateLimit = isRateLimit;
|
|
37
|
+
//# sourceMappingURL=isBinding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isBinding.js","sources":["../../../../src/utils/isBinding.ts"],"sourcesContent":["/**\n * Adapted from https://github.com/evanderkoogh/otel-cf-workers/blob/effeb549f0a4ed1c55ea0c4f0d8e8e37e5494fb3/src/instrumentation/env.ts\n *\n * BSD 3-Clause License\n *\n * Copyright (c) 2023, Erwin van der Koogh\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport type { Ai, D1Database, DurableObjectNamespace, Queue, R2Bucket, RateLimit } from '@cloudflare/workers-types';\n\n/**\n * Checks if a value is a JSRPC proxy (service binding).\n *\n * JSRPC proxies return a truthy value for ANY property access, including\n * properties that don't exist. This makes other duck-type checks unreliable\n * unless we exclude JSRPC first.\n *\n * Must be checked before other binding type checks.\n */\nexport function isJSRPC(item: unknown): item is Service {\n try {\n return !!(item as Record<string, unknown>)[`__some_property_that_will_never_exist__${Math.random()}`];\n } catch {\n return false;\n }\n}\n\nconst isNotJSRPC = (item: unknown): item is Record<string, unknown> => !isJSRPC(item);\n\n/**\n * Duck-type check for DurableObjectNamespace bindings.\n * DurableObjectNamespace has `idFromName`, `idFromString`, `get`, `newUniqueId`.\n */\nexport function isDurableObjectNamespace(item: unknown): item is DurableObjectNamespace {\n return item != null && isNotJSRPC(item) && typeof item.idFromName === 'function';\n}\n\n/**\n * Duck-type check for Queue producer bindings.\n * Queue has `send` and `sendBatch` async methods.\n */\nexport function isQueue(item: unknown): item is Queue {\n return item != null && isNotJSRPC(item) && typeof item.send === 'function' && typeof item.sendBatch === 'function';\n}\n\n/**\n * Duck-type check for D1Database bindings.\n * D1Database has `prepare`, `batch`, and `exec` methods.\n */\nexport function isD1Database(item: unknown): item is D1Database {\n return (\n item != null &&\n isNotJSRPC(item) &&\n typeof item.prepare === 'function' &&\n typeof item.batch === 'function' &&\n typeof item.exec === 'function'\n );\n}\n\n/**\n * Duck-type check for Workers AI bindings.\n * The Ai binding has `run`, `gateway`, and `toMarkdown` methods.\n */\nexport function isAiBinding(item: unknown): item is Ai {\n return (\n item != null &&\n isNotJSRPC(item) &&\n typeof item.run === 'function' &&\n typeof item.gateway === 'function' &&\n typeof item.toMarkdown === 'function'\n );\n}\n\n/**\n * Duck-type check for R2 Bucket bindings.\n * R2Bucket has `head`, `put`, and `createMultipartUpload` methods.\n */\nexport function isR2Bucket(item: unknown): item is R2Bucket {\n return (\n item != null &&\n isNotJSRPC(item) &&\n typeof item.head === 'function' &&\n typeof item.put === 'function' &&\n typeof item.createMultipartUpload === 'function'\n );\n}\n\n/**\n * Duck-type check for RateLimit bindings.\n * RateLimit only exposes a single `limit` method. Because that is a fairly\n * common method name, this check is intentionally run after the more specific\n * binding checks (Queue, R2, D1) in `instrumentEnv`, so those win when a binding\n * also happens to expose `limit`.\n */\nexport function isRateLimit(item: unknown): item is RateLimit {\n return item != null && isNotJSRPC(item) && typeof item.limit === 'function';\n}\n"],"names":[],"mappings":";;AA4CO,SAAS,QAAQ,IAAA,EAAgC;AACtD,EAAA,IAAI;AACF,IAAA,OAAO,CAAC,CAAE,IAAA,CAAiC,0CAA0C,IAAA,CAAK,MAAA,EAAQ,CAAA,CAAE,CAAA;AAAA,EACtG,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,KAAA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 -0,0 +1,23 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
function isCloudflareClass(value, className) {
|
|
4
|
+
if (!value || typeof value !== "function") {
|
|
5
|
+
return false;
|
|
6
|
+
}
|
|
7
|
+
if (value.name === className) {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
let proto = value.prototype;
|
|
11
|
+
while (proto) {
|
|
12
|
+
const ctor = proto.constructor;
|
|
13
|
+
const constructorName = ctor?.name;
|
|
14
|
+
if (constructorName === className) {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
proto = Object.getPrototypeOf(proto);
|
|
18
|
+
}
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
exports.isCloudflareClass = isCloudflareClass;
|
|
23
|
+
//# sourceMappingURL=isCloudflareClass.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isCloudflareClass.js","sources":["../../../../src/utils/isCloudflareClass.ts"],"sourcesContent":["import type { DurableObject, WorkflowEntrypoint } from 'cloudflare:workers';\nimport type { WorkerEntrypointConstructor } from '../instrumentations/instrumentWorkerEntrypoint';\ntype CloudflareClassName = 'WorkerEntrypoint' | 'DurableObject' | 'WorkflowEntrypoint';\n\n/**\n * Checks if a class constructor extends a specific Cloudflare base class.\n *\n * Uses prototype chain walking with constructor names rather than instanceof,\n * so it works in Node at build time without requiring the cloudflare:workers\n * module (which only exists in the Workers runtime).\n *\n * This is used to differentiate between different Cloudflare worker types:\n * - WorkerEntrypoint: Class-based workers (used with instrumentWorkerEntrypoint)\n * - DurableObject: Durable Object classes\n * - Workflow: Workflow classes\n *\n * For ExportedHandler (plain objects), this will return false for all types.\n *\n * @param value - The value to check (typically a class constructor)\n * @param className - The Cloudflare base class name to check against\n * @returns true if the value is a class that extends the specified Cloudflare class\n *\n * @example\n * ```ts\n * isCloudflareClass(MyWorker, 'WorkerEntrypoint') // true if MyWorker extends WorkerEntrypoint\n * isCloudflareClass(MyDO, 'DurableObject') // true if MyDO extends DurableObject\n * ```\n */\nexport function isCloudflareClass(\n value: unknown,\n className: 'WorkerEntrypoint',\n // oxlint-disable-next-line typescript/no-explicit-any\n): value is WorkerEntrypointConstructor<any, any>;\nexport function isCloudflareClass(\n value: unknown,\n className: 'DurableObject',\n): value is new (...args: unknown[]) => DurableObject;\nexport function isCloudflareClass(\n value: unknown,\n className: 'WorkflowEntrypoint',\n): value is new (...args: unknown[]) => WorkflowEntrypoint;\nexport function isCloudflareClass(value: unknown, className: CloudflareClassName): boolean {\n if (!value || typeof value !== 'function') {\n return false;\n }\n\n if (value.name === className) {\n return false;\n }\n\n let proto: object | null = value.prototype;\n\n while (proto) {\n const ctor = (proto as { constructor?: { name?: string } }).constructor;\n const constructorName = ctor?.name;\n\n if (constructorName === className) {\n return true;\n }\n\n proto = Object.getPrototypeOf(proto);\n }\n\n return false;\n}\n"],"names":[],"mappings":";;AAyCO,SAAS,iBAAA,CAAkB,OAAgB,SAAA,EAAyC;AACzF,EAAA,IAAI,CAAC,KAAA,IAAS,OAAO,KAAA,KAAU,UAAA,EAAY;AACzC,IAAA,OAAO,KAAA;AAAA,EACT;AAEA,EAAA,IAAI,KAAA,CAAM,SAAS,SAAA,EAAW;AAC5B,IAAA,OAAO,KAAA;AAAA,EACT;AAEA,EAAA,IAAI,QAAuB,KAAA,CAAM,SAAA;AAEjC,EAAA,OAAO,KAAA,EAAO;AACZ,IAAA,MAAM,OAAQ,KAAA,CAA8C,WAAA;AAC5D,IAAA,MAAM,kBAAkB,IAAA,EAAM,IAAA;AAE9B,IAAA,IAAI,oBAAoB,SAAA,EAAW;AACjC,MAAA,OAAO,IAAA;AAAA,IACT;AAEA,IAAA,KAAA,GAAQ,MAAA,CAAO,eAAe,KAAK,CAAA;AAAA,EACrC;AAEA,EAAA,OAAO,KAAA;AACT;;;;"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const core = require('@sentry/core');
|
|
4
|
+
|
|
5
|
+
const SENTRY_RPC_META_KEY = "__sentry_rpc_meta__";
|
|
6
|
+
function isSentryRpcMeta(value) {
|
|
7
|
+
if (!core.isObjectLike(value) || !(SENTRY_RPC_META_KEY in value)) {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
return core.isObjectLike(value[SENTRY_RPC_META_KEY]);
|
|
11
|
+
}
|
|
12
|
+
function appendRpcMeta(args) {
|
|
13
|
+
const traceData = core.getTraceData();
|
|
14
|
+
if (!traceData["sentry-trace"]) {
|
|
15
|
+
return args;
|
|
16
|
+
}
|
|
17
|
+
return [...args, { [SENTRY_RPC_META_KEY]: traceData }];
|
|
18
|
+
}
|
|
19
|
+
function hasRpcMeta(args) {
|
|
20
|
+
return args.length > 0 && isSentryRpcMeta(args[args.length - 1]);
|
|
21
|
+
}
|
|
22
|
+
function extractRpcMeta(args) {
|
|
23
|
+
if (args.length === 0) {
|
|
24
|
+
return { args };
|
|
25
|
+
}
|
|
26
|
+
const last = args[args.length - 1];
|
|
27
|
+
if (isSentryRpcMeta(last)) {
|
|
28
|
+
return {
|
|
29
|
+
args: args.slice(0, -1),
|
|
30
|
+
rpcMeta: last.__sentry_rpc_meta__
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
return { args };
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
exports.appendRpcMeta = appendRpcMeta;
|
|
37
|
+
exports.extractRpcMeta = extractRpcMeta;
|
|
38
|
+
exports.hasRpcMeta = hasRpcMeta;
|
|
39
|
+
//# sourceMappingURL=rpcMeta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpcMeta.js","sources":["../../../../src/utils/rpcMeta.ts"],"sourcesContent":["import { getTraceData, isObjectLike, type SerializedTraceData } from '@sentry/core';\n\n/**\n * Key used to identify Sentry RPC metadata in a trailing argument.\n * This enables transparent trace propagation across Cloudflare Workers RPC\n * calls (Cap'n Proto), which have no native header/metadata support.\n */\nconst SENTRY_RPC_META_KEY = '__sentry_rpc_meta__';\n\ninterface SentryRpcMeta {\n __sentry_rpc_meta__: SerializedTraceData;\n}\n\nfunction isSentryRpcMeta(value: unknown): value is SentryRpcMeta {\n if (!isObjectLike(value) || !(SENTRY_RPC_META_KEY in value)) {\n return false;\n }\n return isObjectLike(value[SENTRY_RPC_META_KEY]);\n}\n\n/**\n * Appends Sentry RPC metadata to an args array for trace propagation.\n * If no active trace exists, returns the original args unchanged.\n */\nexport function appendRpcMeta(args: unknown[]): unknown[] {\n const traceData = getTraceData();\n\n if (!traceData['sentry-trace']) {\n return args;\n }\n\n return [...args, { [SENTRY_RPC_META_KEY]: traceData }];\n}\n\n/**\n * Whether the trailing argument carries Sentry RPC metadata.\n *\n * Separate from {@link extractRpcMeta} because the RPC method wrappers run this check on every\n * call — including the instance's own internal method calls, which never carry metadata — and\n * must not allocate on that path.\n */\nexport function hasRpcMeta(args: unknown[]): boolean {\n return args.length > 0 && isSentryRpcMeta(args[args.length - 1]);\n}\n\n/**\n * Extracts Sentry RPC metadata from the trailing argument of an args array.\n * Returns cleaned args (without meta) and the extracted trace data if found.\n */\nexport function extractRpcMeta<T extends unknown[]>(\n args: T,\n): {\n args: T;\n rpcMeta?: SerializedTraceData;\n} {\n if (args.length === 0) {\n return { args };\n }\n\n const last = args[args.length - 1];\n if (isSentryRpcMeta(last)) {\n return {\n args: args.slice(0, -1) as T,\n rpcMeta: last.__sentry_rpc_meta__,\n };\n }\n\n return { args };\n}\n"],"names":["isObjectLike","getTraceData"],"mappings":";;;;AAOA,MAAM,mBAAA,GAAsB,qBAAA;AAM5B,SAAS,gBAAgB,KAAA,EAAwC;AAC/D,EAAA,IAAI,CAACA,iBAAA,CAAa,KAAK,CAAA,IAAK,EAAE,uBAAuB,KAAA,CAAA,EAAQ;AAC3D,IAAA,OAAO,KAAA;AAAA,EACT;AACA,EAAA,OAAOA,iBAAA,CAAa,KAAA,CAAM,mBAAmB,CAAC,CAAA;AAChD;AAMO,SAAS,cAAc,IAAA,EAA4B;AACxD,EAAA,MAAM,YAAYC,iBAAA,EAAa;AAE/B,EAAA,IAAI,CAAC,SAAA,CAAU,cAAc,CAAA,EAAG;AAC9B,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,OAAO,CAAC,GAAG,IAAA,EAAM,EAAE,CAAC,mBAAmB,GAAG,WAAW,CAAA;AACvD;AASO,SAAS,WAAW,IAAA,EAA0B;AACnD,EAAA,OAAO,IAAA,CAAK,SAAS,CAAA,IAAK,eAAA,CAAgB,KAAK,IAAA,CAAK,MAAA,GAAS,CAAC,CAAC,CAAA;AACjE;AAMO,SAAS,eACd,IAAA,EAIA;AACA,EAAA,IAAI,IAAA,CAAK,WAAW,CAAA,EAAG;AACrB,IAAA,OAAO,EAAE,IAAA,EAAK;AAAA,EAChB;AAEA,EAAA,MAAM,IAAA,GAAO,IAAA,CAAK,IAAA,CAAK,MAAA,GAAS,CAAC,CAAA;AACjC,EAAA,IAAI,eAAA,CAAgB,IAAI,CAAA,EAAG;AACzB,IAAA,OAAO;AAAA,MACL,IAAA,EAAM,IAAA,CAAK,KAAA,CAAM,CAAA,EAAG,EAAE,CAAA;AAAA,MACtB,SAAS,IAAA,CAAK;AAAA,KAChB;AAAA,EACF;AAEA,EAAA,OAAO,EAAE,IAAA,EAAK;AAChB;;;;;;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
function classifyResponseStreaming(res) {
|
|
4
|
+
if (!res.body) {
|
|
5
|
+
return { isStreaming: false };
|
|
6
|
+
}
|
|
7
|
+
const contentType = res.headers.get("content-type") ?? "";
|
|
8
|
+
const contentLength = res.headers.get("content-length");
|
|
9
|
+
if (/^text\/event-stream\b/i.test(contentType) || /^application\/(x-)?ndjson\b/i.test(contentType) || /^application\/stream\+json\b/i.test(contentType) || /^text\/plain\b/i.test(contentType) && !contentLength) {
|
|
10
|
+
return { isStreaming: true };
|
|
11
|
+
}
|
|
12
|
+
return { isStreaming: false };
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
exports.classifyResponseStreaming = classifyResponseStreaming;
|
|
16
|
+
//# sourceMappingURL=streaming.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streaming.js","sources":["../../../../src/utils/streaming.ts"],"sourcesContent":["export type StreamingGuess = {\n isStreaming: boolean;\n};\n\n/**\n * Classifies a Response as streaming or non-streaming.\n *\n * Heuristics:\n * - No body → not streaming\n * - Known streaming Content-Types → streaming (SSE, NDJSON, JSON streaming)\n * - text/plain without Content-Length → streaming (some AI APIs)\n * - Otherwise → not streaming (conservative default, including HTML/SSR)\n *\n * We avoid probing the stream to prevent blocking on transform streams (like injectTraceMetaTags)\n * or SSR streams that may not have data ready immediately.\n */\nexport function classifyResponseStreaming(res: Response): StreamingGuess {\n if (!res.body) {\n return { isStreaming: false };\n }\n\n const contentType = res.headers.get('content-type') ?? '';\n const contentLength = res.headers.get('content-length');\n\n // Streaming: Known streaming content types\n // - text/event-stream: Server-Sent Events (Vercel AI SDK, real-time APIs)\n // - application/x-ndjson, application/ndjson: Newline-delimited JSON\n // - application/stream+json: JSON streaming\n // - text/plain (without Content-Length): Some AI APIs use this for streaming text\n if (\n /^text\\/event-stream\\b/i.test(contentType) ||\n /^application\\/(x-)?ndjson\\b/i.test(contentType) ||\n /^application\\/stream\\+json\\b/i.test(contentType) ||\n (/^text\\/plain\\b/i.test(contentType) && !contentLength)\n ) {\n return { isStreaming: true };\n }\n\n // Default: treat as non-streaming\n return { isStreaming: false };\n}\n"],"names":[],"mappings":";;AAgBO,SAAS,0BAA0B,GAAA,EAA+B;AACvE,EAAA,IAAI,CAAC,IAAI,IAAA,EAAM;AACb,IAAA,OAAO,EAAE,aAAa,KAAA,EAAM;AAAA,EAC9B;AAEA,EAAA,MAAM,WAAA,GAAc,GAAA,CAAI,OAAA,CAAQ,GAAA,CAAI,cAAc,CAAA,IAAK,EAAA;AACvD,EAAA,MAAM,aAAA,GAAgB,GAAA,CAAI,OAAA,CAAQ,GAAA,CAAI,gBAAgB,CAAA;AAOtD,EAAA,IACE,yBAAyB,IAAA,CAAK,WAAW,CAAA,IACzC,8BAAA,CAA+B,KAAK,WAAW,CAAA,IAC/C,+BAAA,CAAgC,IAAA,CAAK,WAAW,CAAA,IAC/C,iBAAA,CAAkB,KAAK,WAAW,CAAA,IAAK,CAAC,aAAA,EACzC;AACA,IAAA,OAAO,EAAE,aAAa,IAAA,EAAK;AAAA,EAC7B;AAGA,EAAA,OAAO,EAAE,aAAa,KAAA,EAAM;AAC9B;;;;"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const api = require('@opentelemetry/api');
|
|
4
|
+
const core = require('@sentry/core');
|
|
5
|
+
const debugBuild = require('../debug-build.js');
|
|
6
|
+
|
|
7
|
+
const SENTRY_TRACE_LINK_KEY_PREFIX = "__SENTRY_TRACE_LINK__";
|
|
8
|
+
function getTraceLinkKey(methodName) {
|
|
9
|
+
return `${SENTRY_TRACE_LINK_KEY_PREFIX}${methodName}`;
|
|
10
|
+
}
|
|
11
|
+
function storeSpanContext(originalStorage, methodName) {
|
|
12
|
+
try {
|
|
13
|
+
const activeSpan = core.getActiveSpan();
|
|
14
|
+
if (activeSpan) {
|
|
15
|
+
const spanContext = activeSpan.spanContext();
|
|
16
|
+
const storedContext = {
|
|
17
|
+
traceId: spanContext.traceId,
|
|
18
|
+
spanId: spanContext.spanId,
|
|
19
|
+
sampled: core.spanIsSampled(activeSpan)
|
|
20
|
+
};
|
|
21
|
+
originalStorage.kv.put(getTraceLinkKey(methodName), storedContext);
|
|
22
|
+
}
|
|
23
|
+
} catch (error) {
|
|
24
|
+
debugBuild.DEBUG_BUILD && core.debug.log(`[CloudflareClient] Error storing span context for method ${methodName}`, error);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function getStoredSpanContext(originalStorage, methodName) {
|
|
28
|
+
try {
|
|
29
|
+
return originalStorage.kv.get(getTraceLinkKey(methodName));
|
|
30
|
+
} catch (error) {
|
|
31
|
+
debugBuild.DEBUG_BUILD && core.debug.log(`[CloudflareClient] Error retrieving span context for method ${methodName}`, error);
|
|
32
|
+
return void 0;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function buildSpanLinks(storedContext) {
|
|
36
|
+
return [
|
|
37
|
+
{
|
|
38
|
+
context: {
|
|
39
|
+
traceId: storedContext.traceId,
|
|
40
|
+
spanId: storedContext.spanId,
|
|
41
|
+
traceFlags: storedContext.sampled ? api.TraceFlags.SAMPLED : api.TraceFlags.NONE
|
|
42
|
+
},
|
|
43
|
+
attributes: {
|
|
44
|
+
[core.SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE]: "previous_trace"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
exports.buildSpanLinks = buildSpanLinks;
|
|
51
|
+
exports.getStoredSpanContext = getStoredSpanContext;
|
|
52
|
+
exports.getTraceLinkKey = getTraceLinkKey;
|
|
53
|
+
exports.storeSpanContext = storeSpanContext;
|
|
54
|
+
//# sourceMappingURL=traceLinks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"traceLinks.js","sources":["../../../../src/utils/traceLinks.ts"],"sourcesContent":["import type { DurableObjectStorage } from '@cloudflare/workers-types';\nimport { TraceFlags } from '@opentelemetry/api';\nimport type { SpanLink } from '@sentry/core';\nimport { debug, getActiveSpan, SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE, spanIsSampled } from '@sentry/core';\nimport { DEBUG_BUILD } from '../debug-build';\n\n/** Storage key prefix for the span context that links consecutive method invocations */\nconst SENTRY_TRACE_LINK_KEY_PREFIX = '__SENTRY_TRACE_LINK__';\n\n/** Stored span context for creating span links */\nexport interface StoredSpanContext {\n traceId: string;\n spanId: string;\n sampled: boolean;\n}\n\n/**\n * Gets the storage key for a specific method's trace link.\n */\nexport function getTraceLinkKey(methodName: string): string {\n return `${SENTRY_TRACE_LINK_KEY_PREFIX}${methodName}`;\n}\n\n/**\n * Stores the current span context in Durable Object storage for trace linking.\n * Uses the original uninstrumented storage to avoid creating spans for internal operations.\n * Errors are silently ignored to prevent internal storage failures from propagating to user code.\n */\nexport function storeSpanContext(originalStorage: DurableObjectStorage, methodName: string): void {\n try {\n const activeSpan = getActiveSpan();\n if (activeSpan) {\n const spanContext = activeSpan.spanContext();\n const storedContext: StoredSpanContext = {\n traceId: spanContext.traceId,\n spanId: spanContext.spanId,\n sampled: spanIsSampled(activeSpan),\n };\n\n originalStorage.kv.put(getTraceLinkKey(methodName), storedContext);\n }\n } catch (error) {\n // Silently ignore storage errors to prevent internal failures from affecting user code\n DEBUG_BUILD && debug.log(`[CloudflareClient] Error storing span context for method ${methodName}`, error);\n }\n}\n\n/**\n * Retrieves a stored span context from Durable Object storage.\n * Errors are silently ignored to prevent internal storage failures from propagating to user code.\n */\nexport function getStoredSpanContext(\n originalStorage: DurableObjectStorage,\n methodName: string,\n): StoredSpanContext | undefined {\n try {\n return originalStorage.kv.get<StoredSpanContext>(getTraceLinkKey(methodName));\n } catch (error) {\n // Silently ignore storage errors to prevent internal failures from affecting user code\n DEBUG_BUILD && debug.log(`[CloudflareClient] Error retrieving span context for method ${methodName}`, error);\n return undefined;\n }\n}\n\n/**\n * Builds span links from a stored span context.\n */\nexport function buildSpanLinks(storedContext: StoredSpanContext): SpanLink[] {\n return [\n {\n context: {\n traceId: storedContext.traceId,\n spanId: storedContext.spanId,\n traceFlags: storedContext.sampled ? TraceFlags.SAMPLED : TraceFlags.NONE,\n },\n attributes: {\n [SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE]: 'previous_trace',\n },\n },\n ];\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AAAA,QACP,SAAS,aAAA,CAAc,OAAA;AAAA,QACvB,QAAQ,aAAA,CAAc,MAAA;AAAA,QACtB,UAAA,EAAY,aAAA,CAAc,OAAA,GAAUC,cAAA,CAAW,UAAUA,cAAA,CAAW;AAAA,OACtE;AAAA,MACA,UAAA,EAAY;AAAA,QACV,CAACC,sCAAiC,GAAG;AAAA;AACvC;AACF,GACF;AACF;;;;;;;"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const core = require('@sentry/core');
|
|
4
|
+
|
|
5
|
+
function workersStackLineParser(getModule2) {
|
|
6
|
+
const [arg1, arg2] = core.nodeStackLineParser(getModule2);
|
|
7
|
+
const fn = (line) => {
|
|
8
|
+
const result = arg2(line);
|
|
9
|
+
if (result) {
|
|
10
|
+
const filename = result.filename;
|
|
11
|
+
result.abs_path = filename !== void 0 && !filename.startsWith("/") ? `/${filename}` : filename;
|
|
12
|
+
result.in_app = filename !== void 0;
|
|
13
|
+
}
|
|
14
|
+
return result;
|
|
15
|
+
};
|
|
16
|
+
return [arg1, fn];
|
|
17
|
+
}
|
|
18
|
+
function getModule(filename) {
|
|
19
|
+
if (!filename) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
return core.basename(filename, ".js");
|
|
23
|
+
}
|
|
24
|
+
const defaultStackParser = core.createStackParser(workersStackLineParser(getModule));
|
|
25
|
+
|
|
26
|
+
exports.defaultStackParser = defaultStackParser;
|
|
27
|
+
exports.getModule = getModule;
|
|
28
|
+
//# sourceMappingURL=stacktrace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stacktrace.js","sources":["../../../../src/vendor/stacktrace.ts"],"sourcesContent":["// Vendored from https://github.com/robertcepa/toucan-js/blob/036568729e49d0a937de527dc32d73580d9a41b3/packages/toucan-js/src/stacktrace.ts\n// Copyright (c) 2022 Robert Cepa\n// SPDX-License-Identifier: MIT\n\nimport type { StackLineParser, StackLineParserFn, StackParser } from '@sentry/core';\nimport { basename, createStackParser, nodeStackLineParser } from '@sentry/core';\n\ntype GetModuleFn = (filename: string | undefined) => string | undefined;\n\n/**\n * Stack line parser for Cloudflare Workers.\n * This wraps node stack parser and adjusts root paths to match with source maps.\n *\n */\nfunction workersStackLineParser(getModule?: GetModuleFn): StackLineParser {\n const [arg1, arg2] = nodeStackLineParser(getModule);\n\n const fn: StackLineParserFn = line => {\n const result = arg2(line);\n if (result) {\n const filename = result.filename;\n // Workers runtime runs a single bundled file that is always in a virtual root\n result.abs_path = filename !== undefined && !filename.startsWith('/') ? `/${filename}` : filename;\n // There is no way to tell what code is in_app and what comes from dependencies (node_modules), since we have one bundled file.\n // So everything is in_app, unless an error comes from runtime function (ie. JSON.parse), which is determined by the presence of filename.\n result.in_app = filename !== undefined;\n }\n return result;\n };\n\n return [arg1, fn];\n}\n\n/**\n * Gets the module from filename.\n *\n * @param filename\n * @returns Module name\n */\nexport function getModule(filename: string | undefined): string | undefined {\n if (!filename) {\n return;\n }\n\n // In Cloudflare Workers there is always only one bundled file\n return basename(filename, '.js');\n}\n\n/** Cloudflare Workers stack parser */\nexport const defaultStackParser: StackParser = createStackParser(workersStackLineParser(getModule));\n"],"names":["getModule","nodeStackLineParser","basename","createStackParser"],"mappings":";;;;AAcA,SAAS,uBAAuBA,UAAAA,EAA0C;AACxE,EAAA,MAAM,CAAC,IAAA,EAAM,IAAI,CAAA,GAAIC,yBAAoBD,UAAS,CAAA;AAElD,EAAA,MAAM,KAAwB,CAAA,IAAA,KAAQ;AACpC,IAAA,MAAM,MAAA,GAAS,KAAK,IAAI,CAAA;AACxB,IAAA,IAAI,MAAA,EAAQ;AACV,MAAA,MAAM,WAAW,MAAA,CAAO,QAAA;AAExB,MAAA,MAAA,CAAO,QAAA,GAAW,QAAA,KAAa,MAAA,IAAa,CAAC,QAAA,CAAS,WAAW,GAAG,CAAA,GAAI,CAAA,CAAA,EAAI,QAAQ,CAAA,CAAA,GAAK,QAAA;AAGzF,MAAA,MAAA,CAAO,SAAS,QAAA,KAAa,MAAA;AAAA,IAC/B;AACA,IAAA,OAAO,MAAA;AAAA,EACT,CAAA;AAEA,EAAA,OAAO,CAAC,MAAM,EAAE,CAAA;AAClB;AAQO,SAAS,UAAU,QAAA,EAAkD;AAC1E,EAAA,IAAI,CAAC,QAAA,EAAU;AACb,IAAA;AAAA,EACF;AAGA,EAAA,OAAOE,aAAA,CAAS,UAAU,KAAK,CAAA;AACjC;AAGO,MAAM,kBAAA,GAAkCC,sBAAA,CAAkB,sBAAA,CAAuB,SAAS,CAAC;;;;;"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const node_fs = require('node:fs');
|
|
4
|
+
const moduleShape = require('./moduleShape.js');
|
|
5
|
+
|
|
6
|
+
const AGENT_BASE_CLASSES = {
|
|
7
|
+
agents: /* @__PURE__ */ new Set(["Agent"]),
|
|
8
|
+
"agents/mcp": /* @__PURE__ */ new Set(["McpAgent"]),
|
|
9
|
+
"@cloudflare/ai-chat": /* @__PURE__ */ new Set(["AIChatAgent"]),
|
|
10
|
+
"@cloudflare/think": /* @__PURE__ */ new Set(["Think"])
|
|
11
|
+
};
|
|
12
|
+
const MAX_DEPTH = 8;
|
|
13
|
+
async function detectAgentClasses(ast, entryId, candidates, resolver) {
|
|
14
|
+
const ctx = { resolver, modules: /* @__PURE__ */ new Map([[entryId, moduleShape.shapeFromAst(ast)]]) };
|
|
15
|
+
const detected = /* @__PURE__ */ new Set();
|
|
16
|
+
for (const name of candidates) {
|
|
17
|
+
if (await isAgentBinding(ctx, entryId, name, 0, /* @__PURE__ */ new Set())) {
|
|
18
|
+
detected.add(name);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return detected;
|
|
22
|
+
}
|
|
23
|
+
function collectAgentCandidates(ast, configuredNames) {
|
|
24
|
+
const shape = moduleShape.shapeFromAst(ast);
|
|
25
|
+
const candidates = /* @__PURE__ */ new Set();
|
|
26
|
+
for (const configured of configuredNames) {
|
|
27
|
+
if (shape.classes.has(configured)) {
|
|
28
|
+
candidates.add(configured);
|
|
29
|
+
}
|
|
30
|
+
const local = shape.localExports.get(configured);
|
|
31
|
+
if (local && shape.classes.has(local)) {
|
|
32
|
+
candidates.add(local);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return candidates;
|
|
36
|
+
}
|
|
37
|
+
async function isAgentBinding(ctx, moduleId, name, depth, visited) {
|
|
38
|
+
if (depth > MAX_DEPTH) return false;
|
|
39
|
+
const key = `${moduleId} ${name}`;
|
|
40
|
+
if (visited.has(key)) return false;
|
|
41
|
+
visited.add(key);
|
|
42
|
+
const shape = await getModuleShape(ctx, moduleId);
|
|
43
|
+
if (!shape) return false;
|
|
44
|
+
if (shape.classes.has(name)) {
|
|
45
|
+
return extendsAgent(ctx, shape, moduleId, shape.classes.get(name), depth, visited);
|
|
46
|
+
}
|
|
47
|
+
const imported = shape.imports.get(name);
|
|
48
|
+
if (imported) {
|
|
49
|
+
return followImport(ctx, moduleId, imported.source, imported.imported, depth, visited);
|
|
50
|
+
}
|
|
51
|
+
if (name === moduleShape.DEFAULT_EXPORT) {
|
|
52
|
+
if (shape.defaultExportIsClass) {
|
|
53
|
+
return extendsAgent(ctx, shape, moduleId, shape.defaultExportSuper, depth, visited);
|
|
54
|
+
}
|
|
55
|
+
if (shape.defaultExportName) {
|
|
56
|
+
return isAgentBinding(ctx, moduleId, shape.defaultExportName, depth + 1, visited);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
const localName = shape.localExports.get(name);
|
|
60
|
+
if (localName) {
|
|
61
|
+
return isAgentBinding(ctx, moduleId, localName, depth + 1, visited);
|
|
62
|
+
}
|
|
63
|
+
const reexport = shape.reexports.get(name);
|
|
64
|
+
if (reexport) {
|
|
65
|
+
return followImport(ctx, moduleId, reexport.source, reexport.imported, depth, visited);
|
|
66
|
+
}
|
|
67
|
+
for (const source of shape.starExports) {
|
|
68
|
+
if (await followImport(ctx, moduleId, source, name, depth, visited)) {
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
async function extendsAgent(ctx, shape, moduleId, superClass, depth, visited) {
|
|
75
|
+
if (!superClass) return false;
|
|
76
|
+
if (superClass.kind === "identifier") {
|
|
77
|
+
return isAgentBinding(ctx, moduleId, superClass.name, depth + 1, visited);
|
|
78
|
+
}
|
|
79
|
+
const source = shape.namespaces.get(superClass.object);
|
|
80
|
+
if (source) {
|
|
81
|
+
return followImport(ctx, moduleId, source, superClass.property, depth, visited);
|
|
82
|
+
}
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
async function followImport(ctx, importerId, source, importedName, depth, visited) {
|
|
86
|
+
if (AGENT_BASE_CLASSES[source]?.has(importedName)) return true;
|
|
87
|
+
if (!ctx.resolver.resolve) return false;
|
|
88
|
+
let resolved;
|
|
89
|
+
try {
|
|
90
|
+
resolved = await ctx.resolver.resolve(source, importerId);
|
|
91
|
+
} catch {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
if (!resolved?.id) return false;
|
|
95
|
+
if (resolved.id.includes("/node_modules/") || resolved.id.includes("\\node_modules\\")) return false;
|
|
96
|
+
return isAgentBinding(ctx, resolved.id, importedName, depth + 1, visited);
|
|
97
|
+
}
|
|
98
|
+
async function getModuleShape(ctx, moduleId) {
|
|
99
|
+
if (ctx.modules.has(moduleId)) return ctx.modules.get(moduleId);
|
|
100
|
+
let shape;
|
|
101
|
+
try {
|
|
102
|
+
const code = ctx.resolver.readFile ? ctx.resolver.readFile(moduleId) : node_fs.readFileSync(moduleId.replace(/[?#].*$/, ""), "utf8");
|
|
103
|
+
if (typeof code === "string") {
|
|
104
|
+
shape = moduleShape.shapeFromSource(code);
|
|
105
|
+
}
|
|
106
|
+
} catch {
|
|
107
|
+
}
|
|
108
|
+
ctx.modules.set(moduleId, shape);
|
|
109
|
+
return shape;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
exports.collectAgentCandidates = collectAgentCandidates;
|
|
113
|
+
exports.detectAgentClasses = detectAgentClasses;
|
|
114
|
+
//# sourceMappingURL=agentClass.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agentClass.js","sources":["../../../../src/vite/agentClass.ts"],"sourcesContent":["import { readFileSync } from 'node:fs';\nimport { DEFAULT_EXPORT, type ModuleShape, shapeFromAst, shapeFromSource, type SuperRef } from './moduleShape';\nimport type { ProgramBody } from './transform';\n\n/**\n * Agent base classes, keyed by the module specifier they are imported from. A class extending any\n * of these — directly or through a chain of local/imported subclasses — is an `agents` Agent rather\n * than a plain Durable Object.\n *\n * `McpAgent`, `AIChatAgent` and `Think` all extend `Agent` themselves, but they live in packages\n * whose sources we never walk into (see {@link followImport}), so each needs its own entry.\n */\nconst AGENT_BASE_CLASSES: Record<string, ReadonlySet<string>> = {\n agents: new Set(['Agent']),\n 'agents/mcp': new Set(['McpAgent']),\n '@cloudflare/ai-chat': new Set(['AIChatAgent']),\n '@cloudflare/think': new Set(['Think']),\n};\n\n/**\n * How many modules deep the base-class chain is followed. Guards against pathological module graphs;\n * real Agent hierarchies are only a few levels deep.\n */\nconst MAX_DEPTH = 8;\n\n/**\n * The subset of the Vite/Rollup plugin context needed to walk the module graph.\n *\n * `resolve` is optional: without it detection still works, but only for base-class chains declared\n * inside the entry module itself. `readFile` is injectable for tests and defaults to reading disk.\n *\n * Deliberately **no `load`**: awaiting the plugin context's `load()` from inside a `transform` hook\n * deadlocks the build — the module cannot finish loading while its own transform is still pending\n * (Rollup documents this hazard, and Vite's Rolldown pipeline is stricter still). Sibling modules\n * are therefore read straight off disk; see {@link getModuleShape}.\n */\nexport interface ModuleResolver {\n parse(code: string): ProgramBody;\n resolve?(source: string, importer: string): Promise<{ id: string } | null | undefined>;\n readFile?(id: string): string | undefined;\n}\n\ninterface DetectContext {\n resolver: ModuleResolver;\n modules: Map<string, ModuleShape | undefined>;\n}\n\n/**\n * Find which of `candidates` (top-level class names in the entry module) are Cloudflare\n * [`agents`](https://www.npmjs.com/package/agents) Agents.\n *\n * An Agent is a Durable Object under the hood, so wrangler configures it as one and the transform\n * would otherwise reach for `instrumentDurableObjectWithSentry`. Detecting the Agent base chain lets\n * it pick `instrumentAgentWithSentry` instead, which adds the Agent-specific telemetry on top.\n *\n * Unlike `WorkerEntrypoint` detection, the chain is followed *across* modules: base classes commonly\n * live in their own file (`import { MyBase } from './base'`), and there is no runtime fallback that\n * would catch a missed one. Resolution stops at package boundaries — a base class imported from\n * `node_modules` is only recognized when it is one of {@link AGENT_BASE_CLASSES}.\n */\nexport async function detectAgentClasses(\n ast: ProgramBody,\n entryId: string,\n candidates: Iterable<string>,\n resolver: ModuleResolver,\n): Promise<Set<string>> {\n // The entry's shape comes from the AST Vite already handed us (TypeScript stripped, full\n // fidelity); only sibling modules fall back to source scanning.\n const ctx: DetectContext = { resolver, modules: new Map([[entryId, shapeFromAst(ast)]]) };\n\n const detected = new Set<string>();\n for (const name of candidates) {\n // A fresh cycle guard per candidate: a shared one would record \"not an Agent\" for bindings\n // visited while resolving an earlier candidate that turned out to be unrelated.\n if (await isAgentBinding(ctx, entryId, name, 0, new Set())) {\n detected.add(name);\n }\n }\n return detected;\n}\n\n/**\n * The local class names in the entry that a configured class name could refer to — either declared\n * under that name directly, or aliased to it by an `export { Local as Configured }` specifier.\n *\n * Keeps detection (which reads and scans other modules) off classes that no binding points at.\n */\nexport function collectAgentCandidates(ast: ProgramBody, configuredNames: Iterable<string>): Set<string> {\n const shape = shapeFromAst(ast);\n const candidates = new Set<string>();\n\n for (const configured of configuredNames) {\n if (shape.classes.has(configured)) {\n candidates.add(configured);\n }\n const local = shape.localExports.get(configured);\n if (local && shape.classes.has(local)) {\n candidates.add(local);\n }\n }\n\n return candidates;\n}\n\nasync function isAgentBinding(\n ctx: DetectContext,\n moduleId: string,\n name: string,\n depth: number,\n visited: Set<string>,\n): Promise<boolean> {\n if (depth > MAX_DEPTH) return false;\n\n const key = `${moduleId} ${name}`;\n if (visited.has(key)) return false;\n visited.add(key);\n\n const shape = await getModuleShape(ctx, moduleId);\n if (!shape) return false;\n\n if (shape.classes.has(name)) {\n return extendsAgent(ctx, shape, moduleId, shape.classes.get(name), depth, visited);\n }\n\n const imported = shape.imports.get(name);\n if (imported) {\n return followImport(ctx, moduleId, imported.source, imported.imported, depth, visited);\n }\n\n if (name === DEFAULT_EXPORT) {\n if (shape.defaultExportIsClass) {\n return extendsAgent(ctx, shape, moduleId, shape.defaultExportSuper, depth, visited);\n }\n if (shape.defaultExportName) {\n return isAgentBinding(ctx, moduleId, shape.defaultExportName, depth + 1, visited);\n }\n }\n\n // `export { Local as Requested }` — the caller asked by exported name.\n const localName = shape.localExports.get(name);\n if (localName) {\n return isAgentBinding(ctx, moduleId, localName, depth + 1, visited);\n }\n\n const reexport = shape.reexports.get(name);\n if (reexport) {\n return followImport(ctx, moduleId, reexport.source, reexport.imported, depth, visited);\n }\n\n // Barrel modules (`export * from './base'`) don't name the binding, so every star source is a\n // candidate home for it.\n for (const source of shape.starExports) {\n if (await followImport(ctx, moduleId, source, name, depth, visited)) {\n return true;\n }\n }\n\n return false;\n}\n\n/**\n * Whether a superclass reference resolves to an Agent base — a bare identifier (imported, or a\n * subclass declared in the same module) or `ns.Agent` off a namespace import.\n */\nasync function extendsAgent(\n ctx: DetectContext,\n shape: ModuleShape,\n moduleId: string,\n superClass: SuperRef | undefined,\n depth: number,\n visited: Set<string>,\n): Promise<boolean> {\n if (!superClass) return false;\n\n if (superClass.kind === 'identifier') {\n return isAgentBinding(ctx, moduleId, superClass.name, depth + 1, visited);\n }\n\n const source = shape.namespaces.get(superClass.object);\n if (source) {\n return followImport(ctx, moduleId, source, superClass.property, depth, visited);\n }\n\n return false;\n}\n\n/** Resolve an import to its module and continue the search there, stopping at package boundaries. */\nasync function followImport(\n ctx: DetectContext,\n importerId: string,\n source: string,\n importedName: string,\n depth: number,\n visited: Set<string>,\n): Promise<boolean> {\n if (AGENT_BASE_CLASSES[source]?.has(importedName)) return true;\n\n if (!ctx.resolver.resolve) return false;\n\n let resolved: { id: string } | null | undefined;\n try {\n resolved = await ctx.resolver.resolve(source, importerId);\n } catch {\n return false;\n }\n if (!resolved?.id) return false;\n\n // Third-party sources are not walked: they are large, may not be plain JS by the time we see\n // them, and any Agent base worth knowing about is listed in AGENT_BASE_CLASSES.\n if (resolved.id.includes('/node_modules/') || resolved.id.includes('\\\\node_modules\\\\')) return false;\n\n return isAgentBinding(ctx, resolved.id, importedName, depth + 1, visited);\n}\n\nasync function getModuleShape(ctx: DetectContext, moduleId: string): Promise<ModuleShape | undefined> {\n if (ctx.modules.has(moduleId)) return ctx.modules.get(moduleId);\n\n let shape: ModuleShape | undefined;\n try {\n const code = ctx.resolver.readFile\n ? ctx.resolver.readFile(moduleId)\n : readFileSync(moduleId.replace(/[?#].*$/, ''), 'utf8');\n if (typeof code === 'string') {\n shape = shapeFromSource(code);\n }\n } catch {\n // Unreadable or not a source file — treat as \"not an Agent\" rather than failing the build.\n }\n\n ctx.modules.set(moduleId, shape);\n return shape;\n}\n"],"names":["shapeFromAst","DEFAULT_EXPORT","readFileSync","shapeFromSource"],"mappings":";;;;;AAYA,MAAM,kBAAA,GAA0D;AAAA,EAC9D,MAAA,kBAAQ,IAAI,GAAA,CAAI,CAAC,OAAO,CAAC,CAAA;AAAA,EACzB,YAAA,kBAAc,IAAI,GAAA,CAAI,CAAC,UAAU,CAAC,CAAA;AAAA,EAClC,qBAAA,kBAAuB,IAAI,GAAA,CAAI,CAAC,aAAa,CAAC,CAAA;AAAA,EAC9C,mBAAA,kBAAqB,IAAI,GAAA,CAAI,CAAC,OAAO,CAAC;AACxC,CAAA;AAMA,MAAM,SAAA,GAAY,CAAA;AAqClB,eAAsB,kBAAA,CACpB,GAAA,EACA,OAAA,EACA,UAAA,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