@sentry/server-utils 11.16.0 → 11.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/chunks/config.js +62 -2
- package/build/cjs/chunks/config.js.map +1 -1
- package/build/cjs/chunks/exports.js +231 -66
- package/build/cjs/chunks/exports.js.map +1 -1
- package/build/cjs/chunks/moduleInjectedTransform.js +8 -0
- package/build/cjs/chunks/moduleInjectedTransform.js.map +1 -1
- package/build/cjs/index.js +447 -199
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.no-diagnostic-channels.js +1 -0
- package/build/cjs/index.request-handler.js +48 -3
- package/build/cjs/index.request-handler.js.map +1 -1
- package/build/esm/ai/langchain/embeddings.js +23 -8
- package/build/esm/ai/langchain/embeddings.js.map +1 -1
- package/build/esm/ai/langchain/index.js +41 -30
- package/build/esm/ai/langchain/index.js.map +1 -1
- package/build/esm/ai/langchain/utils.js +1 -5
- package/build/esm/ai/langchain/utils.js.map +1 -1
- package/build/esm/ai/langgraph/agent-span.js +6 -2
- package/build/esm/ai/langgraph/agent-span.js.map +1 -1
- package/build/esm/ai/langgraph/index.js +5 -1
- package/build/esm/ai/langgraph/index.js.map +1 -1
- package/build/esm/ai/langgraph/stream.js +4 -1
- package/build/esm/ai/langgraph/stream.js.map +1 -1
- package/build/esm/ai/mistral/streaming.js.map +1 -1
- package/build/esm/ai/pi-durable/index.js +10 -13
- package/build/esm/ai/pi-durable/index.js.map +1 -1
- package/build/esm/ai/pi-durable/runs.js +6 -5
- package/build/esm/ai/pi-durable/runs.js.map +1 -1
- package/build/esm/ai/pi-durable/tools.js +21 -17
- package/build/esm/ai/pi-durable/tools.js.map +1 -1
- package/build/esm/exports.js +2 -1
- package/build/esm/index.js +5 -2
- package/build/esm/index.js.map +1 -1
- package/build/esm/index.no-diagnostic-channels.js +2 -1
- package/build/esm/index.request-handler.js +3 -1
- package/build/esm/integrations/amqplib.js.map +1 -1
- package/build/esm/integrations/anthropic.js.map +1 -1
- package/build/esm/integrations/bullmq/tracer.js.map +1 -1
- package/build/esm/integrations/clickhouse-sql.js +31 -0
- package/build/esm/integrations/clickhouse-sql.js.map +1 -0
- package/build/esm/integrations/clickhouse.js +88 -0
- package/build/esm/integrations/clickhouse.js.map +1 -0
- package/build/esm/integrations/express/instrumentation.js +1 -0
- package/build/esm/integrations/express/instrumentation.js.map +1 -1
- package/build/esm/integrations/fastify/instrumentation.js +3 -1
- package/build/esm/integrations/fastify/instrumentation.js.map +1 -1
- package/build/esm/integrations/graphql/utils.js.map +1 -1
- package/build/esm/integrations/hapi/hapi-utils.js +6 -9
- package/build/esm/integrations/hapi/hapi-utils.js.map +1 -1
- package/build/esm/integrations/hapi/index.js +15 -1
- package/build/esm/integrations/hapi/index.js.map +1 -1
- package/build/esm/integrations/hono/isMiddleware.js.map +1 -1
- package/build/esm/integrations/hono/middlewareHandlers.js +3 -1
- package/build/esm/integrations/hono/middlewareHandlers.js.map +1 -1
- package/build/esm/integrations/hono/patchRoute.js +2 -1
- package/build/esm/integrations/hono/patchRoute.js.map +1 -1
- package/build/esm/integrations/hono/unwrapThrownValue.js +20 -0
- package/build/esm/integrations/hono/unwrapThrownValue.js.map +1 -0
- package/build/esm/integrations/index.js +2 -0
- package/build/esm/integrations/index.js.map +1 -1
- package/build/esm/integrations/langchain.js +10 -3
- package/build/esm/integrations/langchain.js.map +1 -1
- package/build/esm/integrations/mongodb/mongodb-span.js +7 -9
- package/build/esm/integrations/mongodb/mongodb-span.js.map +1 -1
- package/build/esm/integrations/pino.js +2 -2
- package/build/esm/integrations/pino.js.map +1 -1
- package/build/esm/integrations/prisma/tracing-helper.js.map +1 -1
- package/build/esm/integrations/serveTunnel.js +2 -2
- package/build/esm/integrations/serveTunnel.js.map +1 -1
- package/build/esm/integrations/vercel-ai/extract.js +88 -0
- package/build/esm/integrations/vercel-ai/extract.js.map +1 -0
- package/build/esm/integrations/vercel-ai/util.js +5 -1
- package/build/esm/integrations/vercel-ai/util.js.map +1 -1
- package/build/esm/integrations/vercel-ai/vercel-ai-dc-subscriber.js +19 -9
- package/build/esm/integrations/vercel-ai/vercel-ai-dc-subscriber.js.map +1 -1
- package/build/esm/integrations/winston.js +2 -2
- package/build/esm/integrations/winston.js.map +1 -1
- package/build/esm/orchestrion/channels.js +2 -0
- package/build/esm/orchestrion/channels.js.map +1 -1
- package/build/esm/orchestrion/config/channel-integration-definitions.js +8 -0
- package/build/esm/orchestrion/config/channel-integration-definitions.js.map +1 -1
- package/build/esm/orchestrion/config/clickhouse.js +51 -0
- package/build/esm/orchestrion/config/clickhouse.js.map +1 -0
- package/build/esm/orchestrion/config/hono.js +2 -2
- package/build/esm/orchestrion/config/hono.js.map +1 -1
- package/build/esm/orchestrion/config/index.js +2 -0
- package/build/esm/orchestrion/config/index.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/esm/utils/installedModules.js +87 -0
- package/build/esm/utils/installedModules.js.map +1 -0
- package/build/esm/utils/module.js +29 -0
- package/build/esm/utils/module.js.map +1 -0
- package/build/esm/utils/serverTimingTraceHeader.js +49 -0
- package/build/esm/utils/serverTimingTraceHeader.js.map +1 -0
- package/build/esm/utils/sql.js +41 -19
- package/build/esm/utils/sql.js.map +1 -1
- package/build/esm/utils/tunnelServer.js +3 -3
- package/build/esm/utils/tunnelServer.js.map +1 -1
- package/build/esm/utils/wrapServerRequestHandler.js +5 -4
- package/build/esm/utils/wrapServerRequestHandler.js.map +1 -1
- package/build/types/ai/langchain/embeddings.d.ts +2 -2
- package/build/types/ai/langchain/embeddings.d.ts.map +1 -1
- package/build/types/ai/langchain/index.d.ts.map +1 -1
- package/build/types/ai/langchain/types.d.ts +8 -4
- package/build/types/ai/langchain/types.d.ts.map +1 -1
- package/build/types/ai/langchain/utils.d.ts.map +1 -1
- package/build/types/ai/langgraph/agent-span.d.ts +5 -2
- package/build/types/ai/langgraph/agent-span.d.ts.map +1 -1
- package/build/types/ai/langgraph/index.d.ts.map +1 -1
- package/build/types/ai/langgraph/stream.d.ts.map +1 -1
- package/build/types/ai/langgraph/types.d.ts +10 -2
- package/build/types/ai/langgraph/types.d.ts.map +1 -1
- package/build/types/ai/mistral/streaming.d.ts.map +1 -1
- package/build/types/ai/pi-durable/index.d.ts.map +1 -1
- package/build/types/ai/pi-durable/runs.d.ts +4 -2
- package/build/types/ai/pi-durable/runs.d.ts.map +1 -1
- package/build/types/ai/pi-durable/tools.d.ts +4 -6
- package/build/types/ai/pi-durable/tools.d.ts.map +1 -1
- package/build/types/ai/pi-durable/types.d.ts +10 -1
- package/build/types/ai/pi-durable/types.d.ts.map +1 -1
- package/build/types/exports.d.ts +1 -0
- package/build/types/exports.d.ts.map +1 -1
- package/build/types/index.d.ts +5 -3
- package/build/types/index.d.ts.map +1 -1
- package/build/types/index.request-handler.d.ts +1 -0
- package/build/types/index.request-handler.d.ts.map +1 -1
- package/build/types/integrations/amqplib.d.ts.map +1 -1
- package/build/types/integrations/anthropic.d.ts.map +1 -1
- package/build/types/integrations/bullmq/tracer.d.ts.map +1 -1
- package/build/types/integrations/clickhouse-sql.d.ts +8 -0
- package/build/types/integrations/clickhouse-sql.d.ts.map +1 -0
- package/build/types/integrations/clickhouse.d.ts +11 -0
- package/build/types/integrations/clickhouse.d.ts.map +1 -0
- package/build/types/integrations/express/types.d.ts +1 -0
- package/build/types/integrations/express/types.d.ts.map +1 -1
- package/build/types/integrations/fastify/instrumentation.d.ts.map +1 -1
- package/build/types/integrations/hapi/hapi-utils.d.ts.map +1 -1
- package/build/types/integrations/hapi/index.d.ts +12 -0
- package/build/types/integrations/hapi/index.d.ts.map +1 -1
- package/build/types/integrations/hono/isMiddleware.d.ts.map +1 -1
- package/build/types/integrations/hono/middlewareHandlers.d.ts.map +1 -1
- package/build/types/integrations/hono/patchRoute.d.ts.map +1 -1
- package/build/types/integrations/hono/unwrapThrownValue.d.ts +10 -0
- package/build/types/integrations/hono/unwrapThrownValue.d.ts.map +1 -0
- package/build/types/integrations/index.d.ts.map +1 -1
- package/build/types/integrations/langchain.d.ts.map +1 -1
- package/build/types/integrations/mongodb/mongodb-span.d.ts.map +1 -1
- package/build/types/integrations/prisma/tracing-helper.d.ts.map +1 -1
- package/build/types/integrations/vercel-ai/extract.d.ts +27 -0
- package/build/types/integrations/vercel-ai/extract.d.ts.map +1 -0
- package/build/types/integrations/vercel-ai/util.d.ts +2 -0
- package/build/types/integrations/vercel-ai/util.d.ts.map +1 -1
- package/build/types/integrations/vercel-ai/vercel-ai-dc-subscriber.d.ts +1 -1
- package/build/types/integrations/vercel-ai/vercel-ai-dc-subscriber.d.ts.map +1 -1
- package/build/types/orchestrion/channels.d.ts +12 -0
- package/build/types/orchestrion/channels.d.ts.map +1 -1
- package/build/types/orchestrion/config/channel-integration-definitions.d.ts +3 -0
- package/build/types/orchestrion/config/channel-integration-definitions.d.ts.map +1 -1
- package/build/types/orchestrion/config/clickhouse.d.ts +18 -0
- package/build/types/orchestrion/config/clickhouse.d.ts.map +1 -0
- package/build/types/orchestrion/config/index.d.ts.map +1 -1
- package/build/types/utils/installedModules.d.ts +17 -0
- package/build/types/utils/installedModules.d.ts.map +1 -0
- package/build/types/utils/module.d.ts +3 -0
- package/build/types/utils/module.d.ts.map +1 -0
- package/build/types/utils/serverTimingTraceHeader.d.ts +18 -0
- package/build/types/utils/serverTimingTraceHeader.d.ts.map +1 -0
- package/build/types/utils/sql.d.ts +28 -3
- package/build/types/utils/sql.d.ts.map +1 -1
- package/build/types/utils/tunnelServer.d.ts.map +1 -1
- package/build/types/utils/wrapServerRequestHandler.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { DEBUG_BUILD } from "../debug-build.js";
|
|
2
2
|
import { monitorStream } from "./monitorStream.js";
|
|
3
|
+
import { withServerTimingTraceHeader } from "./serverTimingTraceHeader.js";
|
|
3
4
|
import { CLIENT_ADDRESS, CLIENT_PORT, HTTP_REQUEST_BODY_SIZE, NETWORK_PROTOCOL_NAME, SENTRY_KIND, SENTRY_OP, SENTRY_SEGMENT_NAME_SOURCE, USER_AGENT_ORIGINAL } from "@sentry/conventions/attributes";
|
|
4
5
|
import { HTTP_SPAN_NAME_FALLBACK, SPAN_STATUS_ERROR, captureBodyFromWinterCGRequest, captureException, continueTrace, getCurrentScope, getHttpSpanDetailsFromUrlObject, hasSpanStreamingEnabled, hasSpansEnabled, httpHeadersToSpanAttributes, parseStringToURLObject, safeCallback, setHttpStatus, startSpanManual, winterCGHeadersToDict, winterCGRequestToRequestData, withIsolationScope, withScope } from "@sentry/core";
|
|
5
6
|
import { HTTP_SERVER } from "@sentry/conventions/op";
|
|
6
|
-
import {
|
|
7
|
+
import { classifyResponseStreaming, getClientIPAddress, isServedTunnelRequest, isStaticAssetRequest, startRequestSession } from "@sentry/core/server";
|
|
7
8
|
// src/utils/wrapServerRequestHandler.ts
|
|
8
9
|
/**
|
|
9
10
|
* Wraps a handler of a web `Request`, as used by `Deno.serve`, `Bun.serve` and Cloudflare Workers.
|
|
@@ -33,7 +34,7 @@ async function wrapServerRequestHandler(config, handler) {
|
|
|
33
34
|
ipAddress: socketAddress?.address
|
|
34
35
|
});
|
|
35
36
|
isolationScope.setContext("response", null);
|
|
36
|
-
if (
|
|
37
|
+
if (isServedTunnelRequest(request, client)) {
|
|
37
38
|
let response;
|
|
38
39
|
try {
|
|
39
40
|
response = await handler();
|
|
@@ -83,7 +84,7 @@ async function wrapServerRequestHandler(config, handler) {
|
|
|
83
84
|
if (!createSpan) {
|
|
84
85
|
let response;
|
|
85
86
|
try {
|
|
86
|
-
response = await handler();
|
|
87
|
+
response = withServerTimingTraceHeader(client, await handler());
|
|
87
88
|
} catch (e) {
|
|
88
89
|
captureError(e);
|
|
89
90
|
finish(void 0);
|
|
@@ -121,7 +122,7 @@ async function wrapServerRequestHandler(config, handler) {
|
|
|
121
122
|
if (onSpanCreated) safeCallback(DEBUG_BUILD ? "Error in `onSpanCreated`:" : "", () => onSpanCreated(span, request), () => void 0);
|
|
122
123
|
let response;
|
|
123
124
|
try {
|
|
124
|
-
response = await handler();
|
|
125
|
+
response = withServerTimingTraceHeader(client, await handler());
|
|
125
126
|
} catch (e) {
|
|
126
127
|
span.setStatus({
|
|
127
128
|
code: SPAN_STATUS_ERROR,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrapServerRequestHandler.js","names":["isServedTunnelRequest"],"sources":["../../../src/utils/wrapServerRequestHandler.ts"],"sourcesContent":["import {\n CLIENT_ADDRESS,\n CLIENT_PORT,\n HTTP_REQUEST_BODY_SIZE,\n NETWORK_PROTOCOL_NAME,\n SENTRY_KIND,\n SENTRY_OP,\n SENTRY_SEGMENT_NAME_SOURCE,\n USER_AGENT_ORIGINAL,\n} from '@sentry/conventions/attributes';\nimport { HTTP_SERVER } from '@sentry/conventions/op';\nimport type { Client, Mechanism, Scope, SpanAttributes } from '@sentry/core';\nimport {\n captureBodyFromWinterCGRequest,\n captureException,\n continueTrace,\n getCurrentScope,\n getHttpSpanDetailsFromUrlObject,\n hasSpansEnabled,\n hasSpanStreamingEnabled,\n httpHeadersToSpanAttributes,\n HTTP_SPAN_NAME_FALLBACK,\n parseStringToURLObject,\n safeCallback,\n setHttpStatus,\n SPAN_STATUS_ERROR,\n startSpanManual,\n winterCGHeadersToDict,\n winterCGRequestToRequestData,\n withIsolationScope,\n withScope,\n} from '@sentry/core';\nimport type { ServerRequestOptions } from '@sentry/core/server';\nimport {\n _INTERNAL_isServedTunnelRequest as isServedTunnelRequest,\n classifyResponseStreaming,\n getClientIPAddress,\n isStaticAssetRequest,\n startRequestSession,\n} from '@sentry/core/server';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { monitorStream } from './monitorStream';\n\nexport interface ServerRequestHandlerConfig {\n request: Request;\n client: Client;\n /** The isolation scope of this request. */\n isolationScope: Scope;\n /** The options of the runtime's integration for incoming requests. */\n options: ServerRequestOptions<Request, Response> | undefined;\n /** Origin of the span, e.g. `auto.http.deno`. */\n origin: string;\n /** Mechanism of errors that the handler or the response stream throws. Omit to not capture them. */\n mechanism?: Mechanism;\n /** The address and port of the socket, if the runtime knows them. */\n getSocketAddress?: () => { address: string; port?: number } | undefined;\n /** The matched route of the server framework, e.g. `/users/:id`. Sets `http.route` and the span name. */\n routeName?: string;\n /** Span attributes that only the runtime knows, e.g. the route parameters. */\n attributes?: SpanAttributes;\n /**\n * Called in the scope of the continued trace, before the span starts. Lets the runtime continue\n * its own trace, e.g. the trace that Cloudflare exports for the invocation.\n */\n onTraceContinued?: () => void;\n /** Whether the response streams. Return `undefined` to use the default classification. */\n isStreamingResponse?: (response: Response) => boolean | undefined;\n /**\n * Called once when the request is done: when the response is returned, when a streamed body\n * finishes, or when the handler throws (then without a response).\n */\n onDone?: (response: Response | undefined) => void;\n}\n\n/**\n * Wraps a handler of a web `Request`, as used by `Deno.serve`, `Bun.serve` and Cloudflare Workers.\n *\n * It records the request session, attaches the request data and body, continues the incoming\n * trace, creates the `http.server` span, and captures errors that the handler throws. The rules\n * follow core's `node:http` server code:\n *\n * - `OPTIONS` and `HEAD` requests get no span and no body capture.\n * - The static asset filter applies only to `GET`.\n * - The span and the session of a streamed response end when the stream finishes.\n *\n * The handler can return no response, as Bun's `fetch` does after a WebSocket upgrade.\n */\nexport async function wrapServerRequestHandler<R extends Response | undefined = Response>(\n config: ServerRequestHandlerConfig,\n handler: () => R | Promise<R>,\n): Promise<R> {\n const { request, client, isolationScope, options, mechanism } = config;\n\n const method = request.method.toUpperCase();\n const captureError = (error: unknown): void => {\n if (mechanism) {\n captureException(error, { mechanism });\n }\n };\n\n const socketAddress = config.getSocketAddress?.();\n // Without `AsyncLocalStorage`, all requests share one isolation scope, so clear what an earlier\n // request left on it: the merge keeps its body, and its response context would stay set.\n isolationScope.setSDKProcessingMetadata({\n normalizedRequest: { ...winterCGRequestToRequestData(request), data: undefined },\n ipAddress: socketAddress?.address,\n });\n isolationScope.setContext('response', null);\n\n // Tunnel requests get no session, body or span, whether the SDK or the app answers them. The app answers them with\n // `intercept: false`, from its own code, so its errors are still captured.\n if (isServedTunnelRequest(request, client)) {\n let response: R | undefined;\n try {\n response = await handler();\n return response;\n } catch (e) {\n captureError(e);\n throw e;\n } finally {\n config.onDone?.(response);\n }\n }\n\n const endSession = options?.sessions\n ? startRequestSession(client, {\n requestIsolationScope: isolationScope,\n sessionFlushingDelayMS: options.sessionFlushingDelayMS,\n })\n : undefined;\n const finish = (response: Response | undefined): void => {\n endSession?.();\n config.onDone?.(response);\n };\n const isStreamingResponse = (response: Response): boolean => {\n const classification = config.isStreamingResponse?.(response);\n return typeof classification === 'boolean' ? classification : classifyResponseStreaming(response).isStreaming;\n };\n\n if (method === 'OPTIONS' || method === 'HEAD') {\n let response: R | undefined;\n try {\n response = await handler();\n return response;\n } catch (e) {\n captureError(e);\n throw e;\n } finally {\n finish(response);\n }\n }\n\n const dataCollection = client.getDataCollectionOptions();\n const effectiveBodySize =\n options?.maxRequestBodySize ?? (dataCollection.httpBodies.includes('incomingRequest') ? 'medium' : 'none');\n const ignoreRequestBody = options?.ignoreRequestBody;\n if (\n method !== 'GET' &&\n effectiveBodySize !== 'none' &&\n // If the filter throws, skip the body so it cannot leak data the filter was meant to hide.\n !(\n ignoreRequestBody &&\n safeCallback(\n DEBUG_BUILD ? 'Error in `ignoreRequestBody`, skipping the body:' : '',\n () => ignoreRequestBody(request.url, request),\n () => true,\n )\n )\n ) {\n await captureBodyFromWinterCGRequest(request, isolationScope, effectiveBodySize);\n }\n\n const urlObject = parseStringToURLObject(request.url);\n const urlPath = urlObject ? `${urlObject.pathname}${urlObject.search}` : '/';\n const createSpan = shouldCreateSpan(client, options, request, urlPath);\n\n return continueTrace(\n {\n sentryTrace: request.headers.get('sentry-trace') || '',\n baggage: request.headers.get('baggage'),\n },\n async () => {\n config.onTraceContinued?.();\n\n if (!createSpan) {\n let response: R;\n try {\n response = await handler();\n } catch (e) {\n captureError(e);\n finish(undefined);\n throw e;\n }\n if (response) {\n isolationScope.setContext('response', { status_code: response.status });\n }\n const inRequestScope = bindToRequestScope(isolationScope);\n return onResponseDone(\n response,\n !!response && isStreamingResponse(response),\n inRequestScope(() => finish(response)),\n inRequestScope(captureError),\n );\n }\n\n const [rawName, attributes] = getHttpSpanDetailsFromUrlObject(\n urlObject,\n 'server',\n config.origin,\n request,\n config.routeName,\n client,\n );\n // With span streaming, span names have to be low cardinality, so we can't fall back to the URL.\n // A `route` source means the name already is (e.g. the `/` path), so it is kept as-is.\n const name =\n attributes[SENTRY_SEGMENT_NAME_SOURCE] === 'route' || !hasSpanStreamingEnabled(client)\n ? rawName\n : method || HTTP_SPAN_NAME_FALLBACK;\n\n const contentLength = request.headers.get('content-length');\n if (contentLength) {\n attributes[HTTP_REQUEST_BODY_SIZE] = parseInt(contentLength, 10);\n }\n const userAgent = request.headers.get('user-agent');\n if (userAgent) {\n attributes[USER_AGENT_ORIGINAL] = userAgent;\n }\n\n const headers = winterCGHeadersToDict(request.headers);\n if (dataCollection.userInfo) {\n // `client.address` is the originating client, so a forwarding header wins over the socket, which\n // behind a proxy holds the proxy's address. The socket port is the proxy's too, so `client.port`\n // stays unset then.\n const forwardedAddress = getClientIPAddress(headers);\n if (forwardedAddress) {\n attributes[CLIENT_ADDRESS] = forwardedAddress;\n } else if (socketAddress) {\n attributes[CLIENT_ADDRESS] = socketAddress.address;\n if (socketAddress.port !== undefined) {\n attributes[CLIENT_PORT] = socketAddress.port;\n }\n }\n }\n\n // describes the OSI application-layer protocol (http), not the scheme (might be https)\n attributes[NETWORK_PROTOCOL_NAME] = 'http';\n Object.assign(attributes, httpHeadersToSpanAttributes(headers, dataCollection));\n Object.assign(attributes, config.attributes);\n attributes[SENTRY_OP] = HTTP_SERVER;\n attributes[SENTRY_KIND] = 'server';\n\n return startSpanManual({ name, attributes }, async span => {\n const { onSpanCreated, onSpanEnd } = options ?? {};\n if (onSpanCreated) {\n safeCallback(\n DEBUG_BUILD ? 'Error in `onSpanCreated`:' : '',\n () => onSpanCreated(span, request),\n () => undefined,\n );\n }\n\n let response: R;\n try {\n response = await handler();\n } catch (e) {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' });\n span.end();\n captureError(e);\n finish(undefined);\n throw e;\n }\n\n if (response) {\n setHttpStatus(span, response.status);\n isolationScope.setContext('response', { status_code: response.status });\n span.setAttributes(\n httpHeadersToSpanAttributes(responseHeadersToDict(response.headers), dataCollection, 'response'),\n );\n }\n\n const inRequestScope = bindToRequestScope(isolationScope);\n return onResponseDone(\n response,\n !!response && isStreamingResponse(response),\n inRequestScope(() => {\n if (onSpanEnd && response) {\n safeCallback(\n DEBUG_BUILD ? 'Error in `onSpanEnd`:' : '',\n () => onSpanEnd(span, request, response),\n () => undefined,\n );\n }\n span.end();\n finish(response);\n }),\n inRequestScope((error: unknown) => {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' });\n captureError(error);\n }),\n );\n });\n },\n );\n}\n\n/**\n * Returns a function that binds a callback to the request's isolation scope and the current scope.\n *\n * A streamed body finishes after the handler returns. Without `AsyncLocalStorage` (Cloudflare\n * Workers without `nodejs_compat`), its callbacks then run outside the request's scopes, where\n * `getClient()` finds no client: the segment span would be sent as a transaction, and a captured\n * error would not update the request session.\n */\nfunction bindToRequestScope(\n isolationScope: Scope,\n): <A extends unknown[]>(fn: (...args: A) => void) => (...args: A) => void {\n const scope = getCurrentScope();\n return fn =>\n (...args) =>\n withIsolationScope(isolationScope, () => withScope(scope, () => fn(...args)));\n}\n\nfunction shouldCreateSpan(\n client: Client,\n options: ServerRequestOptions<Request, Response> | undefined,\n request: Request,\n urlPath: string,\n): boolean {\n if (!(options?.spans ?? hasSpansEnabled(client.getOptions()))) {\n return false;\n }\n if (options?.ignoreStaticAssets && request.method.toUpperCase() === 'GET' && isStaticAssetRequest(urlPath)) {\n return false;\n }\n const ignoreIncomingRequests = options?.ignoreIncomingRequests;\n return !(\n ignoreIncomingRequests &&\n safeCallback(\n DEBUG_BUILD ? 'Error in `ignoreIncomingRequests`, creating the span:' : '',\n () => ignoreIncomingRequests(urlPath, request),\n () => false,\n )\n );\n}\n\n/**\n * Calls `onDone` when the response is done: at once, or when a streamed body finishes.\n * Returns the response to send.\n */\nfunction onResponseDone<R extends Response | undefined>(\n response: R,\n isStreaming: boolean,\n onDone: () => void,\n onStreamError: (error: unknown) => void,\n): R {\n if (isStreaming && response?.body && !response.body.locked) {\n try {\n // Passing the original response as the init keeps its status, status text and headers, and\n // on Cloudflare also `encodeBody: 'manual'`, so workerd does not compress a compressed body again.\n return new Response(monitorStream(response.body, onDone, onStreamError), response) as R;\n } catch {\n // Workers with a compatibility date before 2022-11-30 and without the\n // `streams_enable_constructors` flag cannot construct a `ReadableStream`, so end at once.\n }\n }\n onDone();\n return response;\n}\n\n// `Headers.forEach` lists each `Set-Cookie` header on its own, so a plain dict keeps only the last one.\nfunction responseHeadersToDict(headers: Headers): Record<string, string | string[]> {\n const dict: Record<string, string | string[]> = winterCGHeadersToDict(headers);\n const setCookie = typeof headers.getSetCookie === 'function' ? headers.getSetCookie() : [];\n if (setCookie.length) {\n dict['set-cookie'] = setCookie;\n }\n return dict;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAuFA,eAAsB,yBACpB,QACA,SACY;CACZ,MAAM,EAAE,SAAS,QAAQ,gBAAgB,SAAS,cAAc;CAEhE,MAAM,SAAS,QAAQ,OAAO,YAAY;CAC1C,MAAM,gBAAgB,UAAyB;EAC7C,IAAI,WACF,iBAAiB,OAAO,EAAE,UAAU,CAAC;CAEzC;CAEA,MAAM,gBAAgB,OAAO,mBAAmB;CAGhD,eAAe,yBAAyB;EACtC,mBAAmB;GAAE,GAAG,6BAA6B,OAAO;GAAG,MAAM,KAAA;EAAU;EAC/E,WAAW,eAAe;CAC5B,CAAC;CACD,eAAe,WAAW,YAAY,IAAI;CAI1C,IAAIA,gCAAsB,SAAS,MAAM,GAAG;EAC1C,IAAI;EACJ,IAAI;GACF,WAAW,MAAM,QAAQ;GACzB,OAAO;EACT,SAAS,GAAG;GACV,aAAa,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QAClD,IAAI;EAGF,OAAO,IAAI,SAAS,cAAc,SAAS,MAAM,QAAQ,aAAa,GAAG,QAAQ;CACnF,QAAQ,CAGR;CAEF,OAAO;CACP,OAAO;AACT;AAGA,SAAS,sBAAsB,SAAqD;CAClF,MAAM,OAA0C,sBAAsB,OAAO;CAC7E,MAAM,YAAY,OAAO,QAAQ,iBAAiB,aAAa,QAAQ,aAAa,IAAI,CAAC;CACzF,IAAI,UAAU,QACZ,KAAK,gBAAgB;CAEvB,OAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"wrapServerRequestHandler.js","names":[],"sources":["../../../src/utils/wrapServerRequestHandler.ts"],"sourcesContent":["import {\n CLIENT_ADDRESS,\n CLIENT_PORT,\n HTTP_REQUEST_BODY_SIZE,\n NETWORK_PROTOCOL_NAME,\n SENTRY_KIND,\n SENTRY_OP,\n SENTRY_SEGMENT_NAME_SOURCE,\n USER_AGENT_ORIGINAL,\n} from '@sentry/conventions/attributes';\nimport { HTTP_SERVER } from '@sentry/conventions/op';\nimport type { Client, Mechanism, Scope, SpanAttributes } from '@sentry/core';\nimport {\n captureBodyFromWinterCGRequest,\n captureException,\n continueTrace,\n getCurrentScope,\n getHttpSpanDetailsFromUrlObject,\n hasSpansEnabled,\n hasSpanStreamingEnabled,\n httpHeadersToSpanAttributes,\n HTTP_SPAN_NAME_FALLBACK,\n parseStringToURLObject,\n safeCallback,\n setHttpStatus,\n SPAN_STATUS_ERROR,\n startSpanManual,\n winterCGHeadersToDict,\n winterCGRequestToRequestData,\n withIsolationScope,\n withScope,\n} from '@sentry/core';\nimport type { ServerRequestOptions } from '@sentry/core/server';\nimport {\n isServedTunnelRequest,\n classifyResponseStreaming,\n getClientIPAddress,\n isStaticAssetRequest,\n startRequestSession,\n} from '@sentry/core/server';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { monitorStream } from './monitorStream';\nimport { withServerTimingTraceHeader } from './serverTimingTraceHeader';\n\nexport interface ServerRequestHandlerConfig {\n request: Request;\n client: Client;\n /** The isolation scope of this request. */\n isolationScope: Scope;\n /** The options of the runtime's integration for incoming requests. */\n options: ServerRequestOptions<Request, Response> | undefined;\n /** Origin of the span, e.g. `auto.http.deno`. */\n origin: string;\n /** Mechanism of errors that the handler or the response stream throws. Omit to not capture them. */\n mechanism?: Mechanism;\n /** The address and port of the socket, if the runtime knows them. */\n getSocketAddress?: () => { address: string; port?: number } | undefined;\n /** The matched route of the server framework, e.g. `/users/:id`. Sets `http.route` and the span name. */\n routeName?: string;\n /** Span attributes that only the runtime knows, e.g. the route parameters. */\n attributes?: SpanAttributes;\n /**\n * Called in the scope of the continued trace, before the span starts. Lets the runtime continue\n * its own trace, e.g. the trace that Cloudflare exports for the invocation.\n */\n onTraceContinued?: () => void;\n /** Whether the response streams. Return `undefined` to use the default classification. */\n isStreamingResponse?: (response: Response) => boolean | undefined;\n /**\n * Called once when the request is done: when the response is returned, when a streamed body\n * finishes, or when the handler throws (then without a response).\n */\n onDone?: (response: Response | undefined) => void;\n}\n\n/**\n * Wraps a handler of a web `Request`, as used by `Deno.serve`, `Bun.serve` and Cloudflare Workers.\n *\n * It records the request session, attaches the request data and body, continues the incoming\n * trace, creates the `http.server` span, and captures errors that the handler throws. The rules\n * follow core's `node:http` server code:\n *\n * - `OPTIONS` and `HEAD` requests get no span and no body capture.\n * - The static asset filter applies only to `GET`.\n * - The span and the session of a streamed response end when the stream finishes.\n *\n * The handler can return no response, as Bun's `fetch` does after a WebSocket upgrade.\n */\nexport async function wrapServerRequestHandler<R extends Response | undefined = Response>(\n config: ServerRequestHandlerConfig,\n handler: () => R | Promise<R>,\n): Promise<R> {\n const { request, client, isolationScope, options, mechanism } = config;\n\n const method = request.method.toUpperCase();\n const captureError = (error: unknown): void => {\n if (mechanism) {\n captureException(error, { mechanism });\n }\n };\n\n const socketAddress = config.getSocketAddress?.();\n // Without `AsyncLocalStorage`, all requests share one isolation scope, so clear what an earlier\n // request left on it: the merge keeps its body, and its response context would stay set.\n isolationScope.setSDKProcessingMetadata({\n normalizedRequest: { ...winterCGRequestToRequestData(request), data: undefined },\n ipAddress: socketAddress?.address,\n });\n isolationScope.setContext('response', null);\n\n // Tunnel requests get no session, body or span, whether the SDK or the app answers them. The app answers them with\n // `intercept: false`, from its own code, so its errors are still captured.\n if (isServedTunnelRequest(request, client)) {\n let response: R | undefined;\n try {\n response = await handler();\n return response;\n } catch (e) {\n captureError(e);\n throw e;\n } finally {\n config.onDone?.(response);\n }\n }\n\n const endSession = options?.sessions\n ? startRequestSession(client, {\n requestIsolationScope: isolationScope,\n sessionFlushingDelayMS: options.sessionFlushingDelayMS,\n })\n : undefined;\n const finish = (response: Response | undefined): void => {\n endSession?.();\n config.onDone?.(response);\n };\n const isStreamingResponse = (response: Response): boolean => {\n const classification = config.isStreamingResponse?.(response);\n return typeof classification === 'boolean' ? classification : classifyResponseStreaming(response).isStreaming;\n };\n\n if (method === 'OPTIONS' || method === 'HEAD') {\n let response: R | undefined;\n try {\n response = await handler();\n return response;\n } catch (e) {\n captureError(e);\n throw e;\n } finally {\n finish(response);\n }\n }\n\n const dataCollection = client.getDataCollectionOptions();\n const effectiveBodySize =\n options?.maxRequestBodySize ?? (dataCollection.httpBodies.includes('incomingRequest') ? 'medium' : 'none');\n const ignoreRequestBody = options?.ignoreRequestBody;\n if (\n method !== 'GET' &&\n effectiveBodySize !== 'none' &&\n // If the filter throws, skip the body so it cannot leak data the filter was meant to hide.\n !(\n ignoreRequestBody &&\n safeCallback(\n DEBUG_BUILD ? 'Error in `ignoreRequestBody`, skipping the body:' : '',\n () => ignoreRequestBody(request.url, request),\n () => true,\n )\n )\n ) {\n await captureBodyFromWinterCGRequest(request, isolationScope, effectiveBodySize);\n }\n\n const urlObject = parseStringToURLObject(request.url);\n const urlPath = urlObject ? `${urlObject.pathname}${urlObject.search}` : '/';\n const createSpan = shouldCreateSpan(client, options, request, urlPath);\n\n return continueTrace(\n {\n sentryTrace: request.headers.get('sentry-trace') || '',\n baggage: request.headers.get('baggage'),\n },\n async () => {\n config.onTraceContinued?.();\n\n if (!createSpan) {\n let response: R;\n try {\n response = withServerTimingTraceHeader(client, await handler());\n } catch (e) {\n captureError(e);\n finish(undefined);\n throw e;\n }\n if (response) {\n isolationScope.setContext('response', { status_code: response.status });\n }\n const inRequestScope = bindToRequestScope(isolationScope);\n return onResponseDone(\n response,\n !!response && isStreamingResponse(response),\n inRequestScope(() => finish(response)),\n inRequestScope(captureError),\n );\n }\n\n const [rawName, attributes] = getHttpSpanDetailsFromUrlObject(\n urlObject,\n 'server',\n config.origin,\n request,\n config.routeName,\n client,\n );\n // With span streaming, span names have to be low cardinality, so we can't fall back to the URL.\n // A `route` source means the name already is (e.g. the `/` path), so it is kept as-is.\n const name =\n attributes[SENTRY_SEGMENT_NAME_SOURCE] === 'route' || !hasSpanStreamingEnabled(client)\n ? rawName\n : method || HTTP_SPAN_NAME_FALLBACK;\n\n const contentLength = request.headers.get('content-length');\n if (contentLength) {\n attributes[HTTP_REQUEST_BODY_SIZE] = parseInt(contentLength, 10);\n }\n const userAgent = request.headers.get('user-agent');\n if (userAgent) {\n attributes[USER_AGENT_ORIGINAL] = userAgent;\n }\n\n const headers = winterCGHeadersToDict(request.headers);\n if (dataCollection.userInfo) {\n // `client.address` is the originating client, so a forwarding header wins over the socket, which\n // behind a proxy holds the proxy's address. The socket port is the proxy's too, so `client.port`\n // stays unset then.\n const forwardedAddress = getClientIPAddress(headers);\n if (forwardedAddress) {\n attributes[CLIENT_ADDRESS] = forwardedAddress;\n } else if (socketAddress) {\n attributes[CLIENT_ADDRESS] = socketAddress.address;\n if (socketAddress.port !== undefined) {\n attributes[CLIENT_PORT] = socketAddress.port;\n }\n }\n }\n\n // describes the OSI application-layer protocol (http), not the scheme (might be https)\n attributes[NETWORK_PROTOCOL_NAME] = 'http';\n Object.assign(attributes, httpHeadersToSpanAttributes(headers, dataCollection));\n Object.assign(attributes, config.attributes);\n attributes[SENTRY_OP] = HTTP_SERVER;\n attributes[SENTRY_KIND] = 'server';\n\n return startSpanManual({ name, attributes }, async span => {\n const { onSpanCreated, onSpanEnd } = options ?? {};\n if (onSpanCreated) {\n safeCallback(\n DEBUG_BUILD ? 'Error in `onSpanCreated`:' : '',\n () => onSpanCreated(span, request),\n () => undefined,\n );\n }\n\n let response: R;\n try {\n response = withServerTimingTraceHeader(client, await handler());\n } catch (e) {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' });\n span.end();\n captureError(e);\n finish(undefined);\n throw e;\n }\n\n if (response) {\n setHttpStatus(span, response.status);\n isolationScope.setContext('response', { status_code: response.status });\n span.setAttributes(\n httpHeadersToSpanAttributes(responseHeadersToDict(response.headers), dataCollection, 'response'),\n );\n }\n\n const inRequestScope = bindToRequestScope(isolationScope);\n return onResponseDone(\n response,\n !!response && isStreamingResponse(response),\n inRequestScope(() => {\n if (onSpanEnd && response) {\n safeCallback(\n DEBUG_BUILD ? 'Error in `onSpanEnd`:' : '',\n () => onSpanEnd(span, request, response),\n () => undefined,\n );\n }\n span.end();\n finish(response);\n }),\n inRequestScope((error: unknown) => {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' });\n captureError(error);\n }),\n );\n });\n },\n );\n}\n\n/**\n * Returns a function that binds a callback to the request's isolation scope and the current scope.\n *\n * A streamed body finishes after the handler returns. Without `AsyncLocalStorage` (Cloudflare\n * Workers without `nodejs_compat`), its callbacks then run outside the request's scopes, where\n * `getClient()` finds no client: the segment span would be sent as a transaction, and a captured\n * error would not update the request session.\n */\nfunction bindToRequestScope(\n isolationScope: Scope,\n): <A extends unknown[]>(fn: (...args: A) => void) => (...args: A) => void {\n const scope = getCurrentScope();\n return fn =>\n (...args) =>\n withIsolationScope(isolationScope, () => withScope(scope, () => fn(...args)));\n}\n\nfunction shouldCreateSpan(\n client: Client,\n options: ServerRequestOptions<Request, Response> | undefined,\n request: Request,\n urlPath: string,\n): boolean {\n if (!(options?.spans ?? hasSpansEnabled(client.getOptions()))) {\n return false;\n }\n if (options?.ignoreStaticAssets && request.method.toUpperCase() === 'GET' && isStaticAssetRequest(urlPath)) {\n return false;\n }\n const ignoreIncomingRequests = options?.ignoreIncomingRequests;\n return !(\n ignoreIncomingRequests &&\n safeCallback(\n DEBUG_BUILD ? 'Error in `ignoreIncomingRequests`, creating the span:' : '',\n () => ignoreIncomingRequests(urlPath, request),\n () => false,\n )\n );\n}\n\n/**\n * Calls `onDone` when the response is done: at once, or when a streamed body finishes.\n * Returns the response to send.\n */\nfunction onResponseDone<R extends Response | undefined>(\n response: R,\n isStreaming: boolean,\n onDone: () => void,\n onStreamError: (error: unknown) => void,\n): R {\n if (isStreaming && response?.body && !response.body.locked) {\n try {\n // Passing the original response as the init keeps its status, status text and headers, and\n // on Cloudflare also `encodeBody: 'manual'`, so workerd does not compress a compressed body again.\n return new Response(monitorStream(response.body, onDone, onStreamError), response) as R;\n } catch {\n // Workers with a compatibility date before 2022-11-30 and without the\n // `streams_enable_constructors` flag cannot construct a `ReadableStream`, so end at once.\n }\n }\n onDone();\n return response;\n}\n\n// `Headers.forEach` lists each `Set-Cookie` header on its own, so a plain dict keeps only the last one.\nfunction responseHeadersToDict(headers: Headers): Record<string, string | string[]> {\n const dict: Record<string, string | string[]> = winterCGHeadersToDict(headers);\n const setCookie = typeof headers.getSetCookie === 'function' ? headers.getSetCookie() : [];\n if (setCookie.length) {\n dict['set-cookie'] = setCookie;\n }\n return dict;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAwFA,eAAsB,yBACpB,QACA,SACY;CACZ,MAAM,EAAE,SAAS,QAAQ,gBAAgB,SAAS,cAAc;CAEhE,MAAM,SAAS,QAAQ,OAAO,YAAY;CAC1C,MAAM,gBAAgB,UAAyB;EAC7C,IAAI,WACF,iBAAiB,OAAO,EAAE,UAAU,CAAC;CAEzC;CAEA,MAAM,gBAAgB,OAAO,mBAAmB;CAGhD,eAAe,yBAAyB;EACtC,mBAAmB;GAAE,GAAG,6BAA6B,OAAO;GAAG,MAAM,KAAA;EAAU;EAC/E,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AqB,OAAO,GACvG,OAAO;CAET,MAAM,yBAAyB,SAAS;CACxC,OAAO,EACL,0BACA,aACE,cAAc,0DAA0D,UAClE,uBAAuB,SAAS,OAAO,SACvC,KACR;AAEJ;;;;;AAMA,SAAS,eACP,UACA,aACA,QACA,eACG;CACH,IAAI,eAAe,UAAU,QAAQ,CAAC,SAAS,KAAK,QAClD,IAAI;EAGF,OAAO,IAAI,SAAS,cAAc,SAAS,MAAM,QAAQ,aAAa,GAAG,QAAQ;CACnF,QAAQ,CAGR;CAEF,OAAO;CACP,OAAO;AACT;AAGA,SAAS,sBAAsB,SAAqD;CAClF,MAAM,OAA0C,sBAAsB,OAAO;CAC7E,MAAM,YAAY,OAAO,QAAQ,iBAAiB,aAAa,QAAQ,aAAa,IAAI,CAAC;CACzF,IAAI,UAAU,QACZ,KAAK,gBAAgB;CAEvB,OAAO;AACT"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { SpanAttributeValue } from '@sentry/core';
|
|
2
|
-
import type { LangChainOptions } from './types';
|
|
2
|
+
import type { LangChainEmbeddingsCallInfo, LangChainOptions } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* Builds the span options for a LangChain embedding call from the embeddings instance and input.
|
|
5
5
|
*
|
|
6
6
|
* @internal Exported so the diagnostics-channel (orchestrion) instrumentation can build the same
|
|
7
7
|
* span as the prototype-patching path below.
|
|
8
8
|
*/
|
|
9
|
-
export declare function _INTERNAL_getLangChainEmbeddingsSpanOptions(instance: unknown,
|
|
9
|
+
export declare function _INTERNAL_getLangChainEmbeddingsSpanOptions(instance: unknown, call: LangChainEmbeddingsCallInfo, options?: LangChainOptions): {
|
|
10
10
|
name: string;
|
|
11
11
|
attributes: Record<string, SpanAttributeValue>;
|
|
12
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embeddings.d.ts","sourceRoot":"","sources":["../../../../src/ai/langchain/embeddings.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"embeddings.d.ts","sourceRoot":"","sources":["../../../../src/ai/langchain/embeddings.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAiBvD,OAAO,KAAK,EAAE,2BAA2B,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AA0C7E;;;;;GAKG;AACH,wBAAgB,2CAA2C,CACzD,QAAQ,EAAE,OAAO,EACjB,IAAI,EAAE,2BAA2B,EACjC,OAAO,GAAE,gBAAqB,GAC7B;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAA;CAAE,CAmBlE;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,cAAc,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,OAAO,CAAC,EACxD,OAAO,GAAE,gBAAqB,GAC7B,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAmB1C;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,6BAA6B,CAAC,CAAC,SAAS,MAAM,EAAE,QAAQ,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,CAAC,CAkB1G"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ai/langchain/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ai/langchain/index.ts"],"names":[],"mappings":"AAyCA,OAAO,KAAK,EACV,wBAAwB,EAIxB,gBAAgB,EAEjB,MAAM,SAAS,CAAC;AAwBjB;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAAC,OAAO,GAAE,gBAAqB,GAAG,wBAAwB,CAydvG;AAED,OAAO,EAAE,6BAA6B,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { GenAiSpanHooks } from '../core/span-hooks';
|
|
1
2
|
import type { GenAiCallOptions } from '../core/utils';
|
|
2
3
|
/** What LangChain passes to every start callback of a run, besides the component's input. */
|
|
3
4
|
interface LangChainRunCallInfo {
|
|
@@ -31,21 +32,24 @@ interface LangChainToolCallInfo extends LangChainRunCallInfo {
|
|
|
31
32
|
input: string;
|
|
32
33
|
}
|
|
33
34
|
/** `embedQuery`/`embedDocuments` */
|
|
34
|
-
interface LangChainEmbeddingsCallInfo {
|
|
35
|
+
export interface LangChainEmbeddingsCallInfo {
|
|
35
36
|
operation: 'embeddings';
|
|
36
37
|
input: unknown;
|
|
37
38
|
}
|
|
38
39
|
/**
|
|
39
|
-
* The call that `recordInputs`/`recordOutputs` decide on: the gen_ai operation and the
|
|
40
|
-
* start callback as passed, or the argument of `embedQuery`/`embedDocuments`.
|
|
40
|
+
* The call that `recordInputs`/`recordOutputs` decide on, and that the span hooks get: the gen_ai operation and the
|
|
41
|
+
* arguments of the LangChain start callback as passed, or the argument of `embedQuery`/`embedDocuments`.
|
|
41
42
|
*/
|
|
42
43
|
export type LangChainCallInfo = LangChainChatModelCallInfo | LangChainLLMCallInfo | LangChainChainCallInfo | LangChainToolCallInfo | LangChainEmbeddingsCallInfo;
|
|
43
44
|
/**
|
|
44
45
|
* Options for the LangChain integration. The handler decides in each start callback, which LangChain awaits
|
|
45
46
|
* inline in the async context of the call that started the run. Runs inside a LangGraph graph use the
|
|
46
47
|
* decision of the graph's `invoke()`/`stream()` call instead.
|
|
48
|
+
*
|
|
49
|
+
* `onSpanEnd` gets the output of the run's end callback as LangChain passed it, such as the `LLMResult` of a
|
|
50
|
+
* chat model or the output of a tool, or the vectors that `embedQuery`/`embedDocuments` resolved with.
|
|
47
51
|
*/
|
|
48
|
-
export type LangChainOptions = GenAiCallOptions<LangChainCallInfo>;
|
|
52
|
+
export type LangChainOptions = GenAiCallOptions<LangChainCallInfo> & GenAiSpanHooks<LangChainCallInfo>;
|
|
49
53
|
/**
|
|
50
54
|
* LangChain Serialized type (compatible with @langchain/core)
|
|
51
55
|
* Uses general types to be compatible with LangChain's Serialized interface.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/ai/langchain/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD,6FAA6F;AAC7F,UAAU,oBAAoB;IAC5B,wFAAwF;IACxF,UAAU,EAAE,mBAAmB,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,6BAA6B;AAC7B,UAAU,0BAA2B,SAAQ,oBAAoB;IAC/D,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,gBAAgB,EAAE,EAAE,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACvC;AAED,uBAAuB;AACvB,UAAU,oBAAqB,SAAQ,oBAAoB;IACzD,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACvC;AAED,yBAAyB;AACzB,UAAU,sBAAuB,SAAQ,oBAAoB;IAC3D,SAAS,EAAE,cAAc,GAAG,QAAQ,CAAC;IACrC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED,wBAAwB;AACxB,UAAU,qBAAsB,SAAQ,oBAAoB;IAC1D,SAAS,EAAE,cAAc,CAAC;IAC1B,KAAK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AAO,GAAG,OAAO,CAYlG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Span, SpanAttributes } from '@sentry/core';
|
|
2
2
|
import type { GenAiOptions } from '../core/utils';
|
|
3
3
|
import type { BaseChatModel, LangChainMessage } from '../langchain/types';
|
|
4
|
-
import type { CompiledGraph, LangGraphOptions } from './types';
|
|
4
|
+
import type { CompiledGraph, LangGraphCallInfo, LangGraphOptions } from './types';
|
|
5
5
|
/** Runs the original invoke() of `graph`, so its internal stream() call can be recognised. */
|
|
6
6
|
export declare function callInvoke<T>(graph: object, invoke: () => T): T;
|
|
7
7
|
/** Whether this stream() call on `graph` is the one its invoke() makes internally. */
|
|
@@ -12,7 +12,10 @@ export declare function getAgentSpanOptions(args: unknown[], extraAttributes?: S
|
|
|
12
12
|
attributes: SpanAttributes;
|
|
13
13
|
};
|
|
14
14
|
/** Decides for one `invoke()`/`stream()` call, from its arguments as passed. */
|
|
15
|
-
export declare function resolveGraphCallRecording(options: LangGraphOptions, args: unknown[]):
|
|
15
|
+
export declare function resolveGraphCallRecording(options: LangGraphOptions, args: unknown[]): {
|
|
16
|
+
call: LangGraphCallInfo;
|
|
17
|
+
recording: Required<GenAiOptions>;
|
|
18
|
+
};
|
|
16
19
|
/** Sets the request attributes on an agent span and injects the callback handler into the call's config. */
|
|
17
20
|
export declare function prepareAgentSpan(span: Span, args: unknown[], graphInstance: CompiledGraph, compileOptions: Record<string, unknown>, recording: Required<GenAiOptions>, llm: BaseChatModel | null | undefined, sentryCallbackHandler: unknown): LangChainMessage[] | null;
|
|
18
21
|
//# sourceMappingURL=agent-span.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-span.d.ts","sourceRoot":"","sources":["../../../../src/ai/langgraph/agent-span.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAczD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe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C,MAAM,EAAE,OAAO,CAAC,EACvC,SAAS,EAAE,QAAQ,CAAC,YAAY,CAAC,EACjC,GAAG,EAAE,aAAa,GAAG,IAAI,GAAG,SAAS,EACrC,qBAAqB,EAAE,OAAO,GAC7B,gBAAgB,EAAE,GAAG,IAAI,CAqE3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ai/langgraph/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ai/langgraph/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGxD,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAgB/D,4GAA4G;AAC5G,wBAAgB,sCAAsC,IAAI,OAAO,CAEhE;AAYD;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,eAAe,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,aAAa,EACtD,OAAO,EAAE,gBAAgB,GACxB,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,aAAa,CAwBvC;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,OAAO,EACd,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACvC,OAAO,EAAE,gBAAgB,EACzB,GAAG,EAAE,aAAa,GAAG,IAAI,GAAG,SAAS,EACrC,qBAAqB,EAAE,OAAO,GAC7B,IAAI,CA4BN;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CAC3C,cAAc,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,OAAO,CAAC,EACxD,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACvC,OAAO,EAAE,gBAAgB,EACzB,GAAG,CAAC,EAAE,aAAa,GAAG,IAAI,EAC1B,qBAAqB,CAAC,EAAE,OAAO,GAC9B,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAkC1C;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,wBAAwB,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,aAAa,EAC/D,OAAO,GAAE,gBAAqB,GAC7B,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,aAAa,CA6BvC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS;IAAE,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;CAAE,EACjF,UAAU,EAAE,CAAC,EACb,OAAO,GAAE,gBAAqB,GAC7B,CAAC,CAIH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../../../../src/ai/langgraph/stream.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../../../../src/ai/langgraph/stream.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAoB,MAAM,oBAAoB,CAAC;AAG1E,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAG/D;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAC3C,cAAc,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,OAAO,CAAC,EACxD,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACvC,OAAO,EAAE,gBAAgB,EACzB,GAAG,CAAC,EAAE,aAAa,GAAG,IAAI,EAC1B,qBAAqB,CAAC,EAAE,OAAO,GAC9B,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CA6F1C"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import type { GenAiSpanHooks } from '../core/span-hooks';
|
|
1
2
|
import type { GenAiCallOptions } from '../core/utils';
|
|
2
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* The call that `recordInputs`/`recordOutputs` decide on, and that the span hooks get: an `invoke()` or `stream()`
|
|
5
|
+
* call of a compiled graph.
|
|
6
|
+
*/
|
|
3
7
|
export interface LangGraphCallInfo {
|
|
4
8
|
operation: 'invoke_agent';
|
|
5
9
|
/** The graph input, the first argument of `invoke()`/`stream()` as passed. */
|
|
@@ -10,8 +14,12 @@ export interface LangGraphCallInfo {
|
|
|
10
14
|
/**
|
|
11
15
|
* Options for the LangGraph integration. Each `invoke()`/`stream()` call decides once, and the decision covers the
|
|
12
16
|
* whole graph run, including its chat model and tool spans.
|
|
17
|
+
*
|
|
18
|
+
* The span hooks only run for the `invoke_agent` span of the call. `onSpanEnd` gets the final graph state: what
|
|
19
|
+
* `invoke()` resolved with, or the output of the run for `stream()`, which is `undefined` when the caller stopped
|
|
20
|
+
* reading early.
|
|
13
21
|
*/
|
|
14
|
-
export type LangGraphOptions = GenAiCallOptions<LangGraphCallInfo>;
|
|
22
|
+
export type LangGraphOptions = GenAiCallOptions<LangGraphCallInfo> & GenAiSpanHooks<LangGraphCallInfo>;
|
|
15
23
|
/**
|
|
16
24
|
* LangGraph Tool definition from lc_kwargs
|
|
17
25
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/ai/langgraph/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/ai/langgraph/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM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H,MAAM,WAAW,iBAAiB;IAChC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,KAAK,CAAC,EAAE,eAAe,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAClD,MAAM,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAClD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE;QACV,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IACF,OAAO,CAAC,EAAE,iBAAiB,CAAC;CAC7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streaming.d.ts","sourceRoot":"","sources":["../../../../src/ai/mistral/streaming.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAwB1D,KAAK,mBAAmB,GAAG;IAAE,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,MAAM,aAAa,CAAC,OAAO,CAAC,CAAA;CAAE,CAAC;AAepF,uDAAuD;AACvD,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,mBAAmB,CAE5E;
|
|
1
|
+
{"version":3,"file":"streaming.d.ts","sourceRoot":"","sources":["../../../../src/ai/mistral/streaming.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAwB1D,KAAK,mBAAmB,GAAG;IAAE,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,MAAM,aAAa,CAAC,OAAO,CAAC,CAAA;CAAE,CAAC;AAepF,uDAAuD;AACvD,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,mBAAmB,CAE5E;AAoLD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,IAAI,EACV,aAAa,EAAE,OAAO,EACtB,WAAW,CAAC,EAAE,WAAW,EACzB,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,CAAC,KAAK,CAAC,KAAK,IAAI,GACvD,OAAO,CAgGT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ai/pi-durable/index.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAKzD,OAAO,KAAK,EACV,iBAAiB,EAEjB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ai/pi-durable/index.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAKzD,OAAO,KAAK,EACV,iBAAiB,EAEjB,gBAAgB,EAQhB,qBAAqB,EACtB,MAAM,SAAS,CAAC;AAIjB;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,GAAG,gBAAgB,CAAC,iBAAiB,CAAC,GAChE,cAAc,CAAC,iBAAiB,EAAE,kBAAkB,GAAG,qBAAqB,CAAC,CAAC;AAKhF;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iCAAiC,CAAC,CAAC,SAAS,gBAAgB,EAC1E,cAAc,EAAE,CAAC,EACjB,OAAO,GAAE,gBAAqB,GAC7B,CAAC,CAmBH;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,cAAc,EAAE,gBAAgB,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAsBvF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { MaybeWeakRef, Scope, Span, SpanStatus } from '@sentry/core';
|
|
2
|
-
import type { PiTaskRuntime } from './types';
|
|
2
|
+
import type { PiTaskRuntime, PiToolResultMessage } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* One run: the work from an input to its answer. It spans several `pi.generation` tasks (run control
|
|
5
5
|
* moves to a new one after every tool round) and their `pi.tool` tasks, so it is tracked per
|
|
@@ -66,6 +66,8 @@ export interface PiToolCall {
|
|
|
66
66
|
endTimestamp?: number;
|
|
67
67
|
/** Set once `execute()` settled. Runs `onSpanEnd` with its result. */
|
|
68
68
|
onSpanEnd?: () => void;
|
|
69
|
+
/** What `execute()` returned, the result of a call that commits no result entry. */
|
|
70
|
+
returned?: PiToolResultMessage;
|
|
69
71
|
}
|
|
70
72
|
export declare function createRuns(): PiRuns;
|
|
71
73
|
export declare function toSentryConversationId(runs: PiRuns, conversationId: unknown): string;
|
|
@@ -89,5 +91,5 @@ export declare function endRun(run: PiRun, runs: PiRuns, status?: SpanStatus): v
|
|
|
89
91
|
* or ends a run edits `pi.live` through `tx.doc()`, so reading that draft after the commit's change
|
|
90
92
|
* function returns shows whether the run survived the commit.
|
|
91
93
|
*/
|
|
92
|
-
export declare function observeRunControl(runtime: PiTaskRuntime, run: PiRun, runs: PiRuns):
|
|
94
|
+
export declare function observeRunControl(runtime: PiTaskRuntime, run: PiRun, runs: PiRuns): () => void;
|
|
93
95
|
//# sourceMappingURL=runs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runs.d.ts","sourceRoot":"","sources":["../../../../src/ai/pi-durable/runs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAgB1E,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"runs.d.ts","sourceRoot":"","sources":["../../../../src/ai/pi-durable/runs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAgB1E,OAAO,KAAK,EAMV,aAAa,EACb,mBAAmB,EACpB,MAAM,SAAS,CAAC;AAajB;;;;GAIG;AACH,MAAM,WAAW,KAAK;IACpB,cAAc,EAAE,OAAO,CAAC;IACxB,IAAI,EAAE,IAAI,CAAC;IACX,cAAc,EAAE,KAAK,CAAC;IACtB,+EAA+E;IAC/E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kFAAkF;IAClF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,UAAU,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,UAAU,CAAA;KAAE,CAAC;CACtC;AAED,yEAAyE;AACzE,MAAM,WAAW,MAAM;IACrB;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC5B;;;;;OAKG;IACH,MAAM,EAAE,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9B;;;OAGG;IACH,SAAS,EAAE,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,CAAC,CAAC;CACvC;AAED,uDAAuD;AACvD,MAAM,WAAW,OAAO;IACtB;;;OAGG;IACH,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;IACzB,kGAAkG;IAClG,WAAW,EAAE,MAAM,CAAC;IACpB,yEAAyE;IACzE,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B;AAED,iCAAiC;AACjC,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,OAAO,CAAC;IACvB,mGAAmG;IACnG,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,6DAA6D;IAC7D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,oFAAoF;IACpF,QAAQ,CAAC,EAAE,mBAAmB,CAAC;CAChC;AAED,wBAAgB,UAAU,IAAI,MAAM,CAOnC;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO,GAAG,MAAM,CAEpF;AAED;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAWjH;AAED,4GAA4G;AAC5G,wBAAgB,QAAQ,CAAC,cAAc,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,KAAK,CAuCrE;AAED,wBAAgB,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,UAAU,GAAG,IAAI,CAU1E;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,aAAa,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,IAAI,CA0E9F"}
|
|
@@ -6,13 +6,11 @@ export declare function markBuiltInTool(tool: unknown): void;
|
|
|
6
6
|
/**
|
|
7
7
|
* Prepare the runtime of a `pi.tool` phase. The tool task resolves the called tool from its agent,
|
|
8
8
|
* so the runtime hands out traced tools, and it collects the result entries the phase commits.
|
|
9
|
-
*
|
|
10
|
-
* after `execute()` returns: from `api.output()`, through `afterTool` hooks and
|
|
9
|
+
* The returned function ends the phase's tool spans with the result the model receives, which
|
|
10
|
+
* pi-durable builds after `execute()` returns: from `api.output()`, through `afterTool` hooks and
|
|
11
|
+
* output limits.
|
|
11
12
|
*/
|
|
12
|
-
export declare function instrumentToolPhase(runtime: PiTaskRuntime, runs: PiRuns, wrapTool: (tool: PiTool) => PiTool):
|
|
13
|
-
runtime: PiTaskRuntime;
|
|
14
|
-
finish: () => void;
|
|
15
|
-
};
|
|
13
|
+
export declare function instrumentToolPhase(runtime: PiTaskRuntime, runs: PiRuns, wrapTool: (tool: PiTool) => PiTool, isNested: boolean): () => void;
|
|
16
14
|
/** Wrap a tool so each call gets a `gen_ai.execute_tool` span. */
|
|
17
15
|
export declare function instrumentTool(tool: PiTool, runs: PiRuns, options: GenAiCallOptions<PiDurableCallInfo> & GenAiSpanHooks<PiDurableCallInfo, PiToolExecutionResult>): PiTool;
|
|
18
16
|
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../../src/ai/pi-durable/tools.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAItD,OAAO,KAAK,EAAE,MAAM,EAAc,MAAM,QAAQ,CAAC;AAEjD,OAAO,KAAK,EAGV,iBAAiB,EAEjB,aAAa,EACb,MAAM,EAEN,qBAAqB,EAEtB,MAAM,SAAS,CAAC;AAWjB,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAInD;AAED
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../../src/ai/pi-durable/tools.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAItD,OAAO,KAAK,EAAE,MAAM,EAAc,MAAM,QAAQ,CAAC;AAEjD,OAAO,KAAK,EAGV,iBAAiB,EAEjB,aAAa,EACb,MAAM,EAEN,qBAAqB,EAEtB,MAAM,SAAS,CAAC;AAWjB,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAInD;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,aAAa,EACtB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,EAClC,QAAQ,EAAE,OAAO,GAChB,MAAM,IAAI,CA4CZ;AAED,kEAAkE;AAClE,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,gBAAgB,CAAC,iBAAiB,CAAC,GAAG,cAAc,CAAC,iBAAiB,EAAE,qBAAqB,CAAC,GACtG,MAAM,CAyER"}
|
|
@@ -23,6 +23,15 @@ export interface PiTool {
|
|
|
23
23
|
}
|
|
24
24
|
export interface PiAgent {
|
|
25
25
|
tools?: readonly PiTool[];
|
|
26
|
+
/** The tools that other tools can call with `api.executeTool()`, in pi-durable 1.2.0 and later. */
|
|
27
|
+
callable?: readonly PiTool[];
|
|
28
|
+
}
|
|
29
|
+
/** The input of a `pi.tool` task. `nested` is a call that a tool made with `api.executeTool()`. */
|
|
30
|
+
export interface PiToolTaskInput {
|
|
31
|
+
kind?: string;
|
|
32
|
+
/** The task of the calling tool. */
|
|
33
|
+
parent?: unknown;
|
|
34
|
+
parentCallId?: string;
|
|
26
35
|
}
|
|
27
36
|
/** The tool result the model receives, as pi-durable commits it in a `pi.tool-result` entry. */
|
|
28
37
|
export interface PiToolResultMessage {
|
|
@@ -59,7 +68,7 @@ export interface PiTaskRuntime {
|
|
|
59
68
|
readonly conversationId: unknown;
|
|
60
69
|
readonly signal?: AbortSignal;
|
|
61
70
|
agent(context: unknown): Promise<PiAgent>;
|
|
62
|
-
commit(change: PiCommitChange, context: unknown): Promise<void>;
|
|
71
|
+
commit(change: PiCommitChange, context: unknown, ...rest: unknown[]): Promise<void>;
|
|
63
72
|
snapshot?(token: PiDocToken, ownerId: unknown, ...rest: unknown[]): Promise<unknown>;
|
|
64
73
|
}
|
|
65
74
|
export type PiPhaseHandler = (task: unknown, runtime: PiTaskRuntime, context: unknown) => Promise<unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/ai/pi-durable/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,qBAAqB;IACpC,wFAAwF;IACxF,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC;IACnB,8FAA8F;IAC9F,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC9E;AAED,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,kBAAkB,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;CACnG;AAED,MAAM,WAAW,OAAO;IACtB,KAAK,CAAC,EAAE,SAAS,MAA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ummary, sanitizeSqlQuery, getSqlQueryAttributes, getSqlSpanName } from './utils/sql';
|
|
6
6
|
export type { SqlDialect } from './utils/sql';
|
|
7
7
|
export { isBun, isCloudflareWorkers, isDeno } from './utils/runtime';
|
|
8
|
+
export { collectInstalledModules } from './utils/installedModules';
|
|
8
9
|
export { instrumentPostgresJsSql } from './integrations/postgresjs-wrapper';
|
|
9
10
|
export type { PostgresConnectionContext } from './integrations/postgresjs-wrapper';
|
|
10
11
|
export { applyHonoPatches, earlyPatchHono } from './integrations/hono/applyPatches';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../src/exports.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,+BAA+B,EAAE,MAAM,yCAAyC,CAAC;AAC1F,OAAO,EAAE,wCAAwC,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAClF,cAAc,MAAM,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC1G,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,YAAY,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAMnF,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AACpF,OAAO,EAAE,2BAA2B,EAAE,MAAM,0CAA0C,CAAC;AACvF,YAAY,EAAE,kCAAkC,EAAE,MAAM,0CAA0C,CAAC;AACnG,YAAY,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../src/exports.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,+BAA+B,EAAE,MAAM,yCAAyC,CAAC;AAC1F,OAAO,EAAE,wCAAwC,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAClF,cAAc,MAAM,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC1G,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,YAAY,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAMnF,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AACpF,OAAO,EAAE,2BAA2B,EAAE,MAAM,0CAA0C,CAAC;AACvF,YAAY,EAAE,kCAAkC,EAAE,MAAM,0CAA0C,CAAC;AACnG,YAAY,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC"}
|
package/build/types/index.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export { cron } from './cron';
|
|
|
32
32
|
export { BullMQTelemetry } from './integrations/bullmq';
|
|
33
33
|
export { googleGenAIIntegration } from './integrations/google-genai';
|
|
34
34
|
export { graphqlIntegration } from './integrations/graphql';
|
|
35
|
-
export { hapiIntegration } from './integrations/hapi';
|
|
35
|
+
export { hapiIntegration, setupHapiErrorHandler, } from './integrations/hapi';
|
|
36
36
|
export { honoIntegration, honoMiddleware } from './integrations/hono';
|
|
37
37
|
export type { HonoIntegrationOptions } from './integrations/hono';
|
|
38
38
|
export { koaIntegration } from './integrations/koa';
|
|
@@ -48,8 +48,9 @@ export { piDurableIntegration } from './integrations/pi-durable';
|
|
|
48
48
|
export type { FlueOptions } from './ai/flue';
|
|
49
49
|
export { mastraIntegration } from './integrations/mastra';
|
|
50
50
|
export { mcpServerIntegration } from './integrations/mcp-server';
|
|
51
|
-
export { instrumentTunnelServers
|
|
52
|
-
export { instrumentTunnelServer
|
|
51
|
+
export { instrumentTunnelServers, makeServeTunnelIntegration } from './integrations/serveTunnel';
|
|
52
|
+
export { instrumentTunnelServer } from './utils/tunnelServer';
|
|
53
|
+
export { createGetModuleFromFilename } from './utils/module';
|
|
53
54
|
export { SentryMastraExporter } from './ai/mastra';
|
|
54
55
|
export { lruMemoizerIntegration } from './integrations/lru-memoizer';
|
|
55
56
|
export { mongoIntegration } from './integrations/mongodb';
|
|
@@ -66,6 +67,7 @@ export { openAIIntegration } from './integrations/openai';
|
|
|
66
67
|
export { postgresIntegration } from './integrations/pg';
|
|
67
68
|
export { postgresJsIntegration } from './integrations/postgresjs';
|
|
68
69
|
export { neonIntegration } from './integrations/neon';
|
|
70
|
+
export { clickhouseIntegration } from './integrations/clickhouse';
|
|
69
71
|
export { tediousIntegration } from './integrations/tedious';
|
|
70
72
|
export { vercelAIIntegration } from './integrations/vercel-ai';
|
|
71
73
|
export { expressIntegration } from './integrations/express';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAG1B,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,sBAAsB,IAAI,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAC3G,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,YAAY,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAC;AACvE,YAAY,EAAE,q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1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,YAAY,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAE9E,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAErG,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAEpE,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { wrapServerRequestHandler } from './utils/wrapServerRequestHandler';
|
|
2
2
|
export type { ServerRequestHandlerConfig } from './utils/wrapServerRequestHandler';
|
|
3
|
+
export { addServerTimingTraceHeader } from './utils/serverTimingTraceHeader';
|
|
3
4
|
//# sourceMappingURL=index.request-handler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.request-handler.d.ts","sourceRoot":"","sources":["../../src/index.request-handler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,YAAY,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.request-handler.d.ts","sourceRoot":"","sources":["../../src/index.request-handler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,YAAY,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AACnF,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"amqplib.d.ts","sourceRoot":"","sources":["../../../src/integrations/amqplib.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"amqplib.d.ts","sourceRoot":"","sources":["../../../src/integrations/amqplib.ts"],"names":[],"mappings":"AA8mBA;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAGnH;AAoCD;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB;;CAAyC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic.d.ts","sourceRoot":"","sources":["../../../src/integrations/anthropic.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAuB,kBAAkB,EAAuB,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"anthropic.d.ts","sourceRoot":"","sources":["../../../src/integrations/anthropic.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAuB,kBAAkB,EAAuB,MAAM,0BAA0B,CAAC;AA6R7G;;;;GAIG;AACH,eAAO,MAAM,sBAAsB;;CAA6C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tracer.d.ts","sourceRoot":"","sources":["../../../../src/integrations/bullmq/tracer.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"tracer.d.ts","sourceRoot":"","sources":["../../../../src/integrations/bullmq/tracer.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAwCjF,qBAAa,kBAAmB,YAAW,MAAM,CAAC,aAAa,CAAC;IACvD,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,aAAa,CAiC5F;CACF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SqlLexerRules } from '../utils/sql';
|
|
2
|
+
/**
|
|
3
|
+
* ClickHouse SQL: `"` quotes an identifier as in `standard`, but `\` escapes the next character, `#`
|
|
4
|
+
* starts a line comment, block comments nest, and `$$…$$` heredocs open a literal. Numbers can have
|
|
5
|
+
* `_` separators.
|
|
6
|
+
*/
|
|
7
|
+
export declare const CLICKHOUSE_SQL_RULES: SqlLexerRules;
|
|
8
|
+
//# sourceMappingURL=clickhouse-sql.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clickhouse-sql.d.ts","sourceRoot":"","sources":["../../../src/integrations/clickhouse-sql.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAUlD;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,EAAE,aAyBlC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Diagnostics-channel-based `@clickhouse/client` and `@clickhouse/client-web` integration.
|
|
3
|
+
*
|
|
4
|
+
* Subscribes to the channels Sentry's code transform injects into `ClickHouseClient`'s `query`,
|
|
5
|
+
* `command`, `exec` and `insert` methods, and emits a `db` span for each call. Requires the Sentry
|
|
6
|
+
* runtime hook or bundler plugin to be active.
|
|
7
|
+
*/
|
|
8
|
+
export declare const clickhouseIntegration: () => import("@sentry/core").Integration & {
|
|
9
|
+
name: "ClickHouse";
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=clickhouse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clickhouse.d.ts","sourceRoot":"","sources":["../../../src/integrations/clickhouse.ts"],"names":[],"mappings":"AAqJA;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB;;CAA4C,CAAC"}
|