@posthog/mcp
Advanced tools
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"instrumentation.d.ts","sourceRoot":"","sources":["../../src/extensions/instrumentation.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,2BAA2B,EAC3B,6BAA6B,EAC7B,uBAAuB,EACvB,gBAAgB,EAChB,cAAc,EACd,aAAa,EAId,MAAM,UAAU,CAAA;AAcjB,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAIrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AASxC;;;;;;GAMG;AAEH,KAAK,iBAAiB,GAAG,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,CAAC,EAAE,6BAA6B,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;AAE7G,2EAA2E;AAC3E,KAAK,YAAY,GAAG,CAAC,iBAAiB,EAAE,cAAc,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;AAE3E,UAAU,mBAAmB;IAC3B,MAAM,EAAE,aAAa,CAAA;IACrB,IAAI,EAAE,gBAAgB,CAAA;IACtB,OAAO,EAAE,cAAc,CAAA;IACvB,KAAK,CAAC,EAAE,6BAA6B,CAAA;IACrC,OAAO,EAAE,YAAY,CAAA;IACrB,2FAA2F;IAC3F,kBAAkB,CAAC,EAAE,2BAA2B,CAAA;IAChD;;;;OAIG;IACH,SAAS,CAAC,EAAE,qBAAqB,CAAA;IACjC;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,MAAM,OAAO,CAAA;CAClC;AAED;;;;;;;GAOG;AACH,wBAAsB,eAAe,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC,CA8DnF;AAiOD;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,CACzB,MAAM,EAAE,aAAa,EACrB,eAAe,EAAE,iBAAiB,EAClC,OAAO,EAAE,cAAc,EACv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AE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAC1B,KAAK,EAAE,uBAAuB,CAAC,OAAO,CAAC,GAAG,SAAS,GAClD,IAAI,CAUN;AAuHD;;;GAGG;AACH,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,aAAa,EACrB,yBAAyB,EAAE,iBAAiB,EAC5C,OAAO,EAAE,cAAc,EACvB,KAAK,EAAE,6BAA6B,GAAG,SAAS,EAChD,MAAM,EAAE,QAAQ,GACf,OAAO,CAAC,OAAO,CAAC,CA2ElB"} |
@@ -102,4 +102,2 @@ "use strict"; | ||
| const sessionInfo = (0, external_session_js_namespaceObject.getSessionInfo)(server, data, sessionId); | ||
| const identity = await (0, external_internal_js_namespaceObject.handleIdentify)(server, data, sessionId, request, sessionInfo, extra, !!conversation.conversationId); | ||
| const requestAttribution = (0, external_internal_js_namespaceObject.withIdentity)(sessionInfo, identity); | ||
| const toolName = request.params?.name; | ||
@@ -118,2 +116,4 @@ const event = { | ||
| (0, external_transport_identity_js_namespaceObject.stampTransportIdentity)(event, extra); | ||
| const identity = await (0, external_internal_js_namespaceObject.handleIdentify)(server, data, sessionId, request, sessionInfo, extra, !!conversation.conversationId); | ||
| const requestAttribution = (0, external_internal_js_namespaceObject.withIdentity)(sessionInfo, identity); | ||
| await (0, external_tracing_helpers_js_namespaceObject.applyResolvedMetadata)(event, data, request, extra); | ||
@@ -400,4 +400,2 @@ (0, external_intent_js_namespaceObject.setEventIntent)(event, await (0, external_intent_js_namespaceObject.resolveToolCallIntent)(data, request, canCaptureContextIntent, extra)); | ||
| }; | ||
| const identity = await (0, external_internal_js_namespaceObject.handleIdentify)(server, data, sessionId, request, requestSessionInfo, extra); | ||
| const requestAttribution = (0, external_internal_js_namespaceObject.withIdentity)(requestSessionInfo, identity); | ||
| const event = { | ||
@@ -411,3 +409,7 @@ sessionId, | ||
| (0, external_client_identity_js_namespaceObject.stampClientIdentity)(event, request, extra, server); | ||
| if (initializeClientInfo?.name) event.clientName = initializeClientInfo.name; | ||
| if (initializeClientInfo?.version) event.clientVersion = initializeClientInfo.version; | ||
| (0, external_transport_identity_js_namespaceObject.stampTransportIdentity)(event, extra); | ||
| const identity = await (0, external_internal_js_namespaceObject.handleIdentify)(server, data, sessionId, request, requestSessionInfo, extra); | ||
| const requestAttribution = (0, external_internal_js_namespaceObject.withIdentity)(requestSessionInfo, identity); | ||
| await (0, external_tracing_helpers_js_namespaceObject.applyResolvedMetadata)(event, data, request, extra); | ||
@@ -414,0 +416,0 @@ const result = await originalInitializeHandler(request, extra); |
@@ -66,4 +66,2 @@ import { getAnalyticsParameterOwnership, stripOwnedAnalyticsArguments } from "./analytics-parameters.mjs"; | ||
| const sessionInfo = getSessionInfo(server, data, sessionId); | ||
| const identity = await handleIdentify(server, data, sessionId, request, sessionInfo, extra, !!conversation.conversationId); | ||
| const requestAttribution = withIdentity(sessionInfo, identity); | ||
| const toolName = request.params?.name; | ||
@@ -82,2 +80,4 @@ const event = { | ||
| stampTransportIdentity(event, extra); | ||
| const identity = await handleIdentify(server, data, sessionId, request, sessionInfo, extra, !!conversation.conversationId); | ||
| const requestAttribution = withIdentity(sessionInfo, identity); | ||
| await applyResolvedMetadata(event, data, request, extra); | ||
@@ -364,4 +364,2 @@ setEventIntent(event, await resolveToolCallIntent(data, request, canCaptureContextIntent, extra)); | ||
| }; | ||
| const identity = await handleIdentify(server, data, sessionId, request, requestSessionInfo, extra); | ||
| const requestAttribution = withIdentity(requestSessionInfo, identity); | ||
| const event = { | ||
@@ -375,3 +373,7 @@ sessionId, | ||
| stampClientIdentity(event, request, extra, server); | ||
| if (initializeClientInfo?.name) event.clientName = initializeClientInfo.name; | ||
| if (initializeClientInfo?.version) event.clientVersion = initializeClientInfo.version; | ||
| stampTransportIdentity(event, extra); | ||
| const identity = await handleIdentify(server, data, sessionId, request, requestSessionInfo, extra); | ||
| const requestAttribution = withIdentity(requestSessionInfo, identity); | ||
| await applyResolvedMetadata(event, data, request, extra); | ||
@@ -378,0 +380,0 @@ const result = await originalInitializeHandler(request, extra); |
@@ -1,2 +0,2 @@ | ||
| export declare const version = "0.11.5"; | ||
| export declare const version = "0.11.6"; | ||
| //# sourceMappingURL=version.d.ts.map |
+1
-1
@@ -29,3 +29,3 @@ "use strict"; | ||
| }); | ||
| const version = '0.11.5'; | ||
| const version = '0.11.6'; | ||
| exports.version = __webpack_exports__.version; | ||
@@ -32,0 +32,0 @@ for(var __webpack_i__ in __webpack_exports__)if (-1 === [ |
+1
-1
@@ -1,2 +0,2 @@ | ||
| const version = '0.11.5'; | ||
| const version = '0.11.6'; | ||
| export { version }; |
+1
-1
| { | ||
| "name": "@posthog/mcp", | ||
| "version": "0.11.5", | ||
| "version": "0.11.6", | ||
| "bugs": { | ||
@@ -5,0 +5,0 @@ "url": "https://github.com/PostHog/posthog-js/issues" |
@@ -228,12 +228,2 @@ // Portions of this file are derived from agentcathq/agentcat-typescript-sdk | ||
| const sessionInfo = getSessionInfo(server, data, sessionId) | ||
| const identity = await handleIdentify( | ||
| server, | ||
| data, | ||
| sessionId, | ||
| request, | ||
| sessionInfo, | ||
| extra, | ||
| !!conversation.conversationId | ||
| ) | ||
| const requestAttribution = withIdentity(sessionInfo, identity) | ||
@@ -253,3 +243,8 @@ const toolName = request.params?.name | ||
| // `_meta` on every request rather than at `initialize`; stamp them onto this | ||
| // event now so concurrent requests can't cross-attribute it. | ||
| // event now so concurrent requests can't cross-attribute it. Stamped before | ||
| // the identify await below for the same reason the snapshot is: the chain's | ||
| // last link is the server's own `getClientVersion()`, which a concurrent | ||
| // `initialize` can replace while an identify callback is in flight — and | ||
| // `captureEvent` prefers a stamped value over `sessionInfo`, so a late stamp | ||
| // would win with the wrong client's name. | ||
| stampClientIdentity(event, request, extra, server) | ||
@@ -260,2 +255,13 @@ // Which *surface* of the client made this call lives only in the request | ||
| const identity = await handleIdentify( | ||
| server, | ||
| data, | ||
| sessionId, | ||
| request, | ||
| sessionInfo, | ||
| extra, | ||
| !!conversation.conversationId | ||
| ) | ||
| const requestAttribution = withIdentity(sessionInfo, identity) | ||
| await applyResolvedMetadata(event, data, request, extra) | ||
@@ -876,5 +882,2 @@ setEventIntent(event, await resolveToolCallIntent(data, request, canCaptureContextIntent, extra)) | ||
| } | ||
| const identity = await handleIdentify(server, data, sessionId, request, requestSessionInfo, extra) | ||
| const requestAttribution = withIdentity(requestSessionInfo, identity) | ||
| const event: McpEvent = { | ||
@@ -887,8 +890,26 @@ sessionId, | ||
| } | ||
| // Harmless for a legacy `initialize` (client info rides the body there, and the | ||
| // negotiated protocol version below overrides any `_meta` one); picks up client | ||
| // info if a client also sends it in `_meta`. | ||
| // Picks up client info if a client also sends it in `_meta` (the negotiated | ||
| // protocol version below overrides any `_meta` one). Stamped before the | ||
| // identify await for the same reason the snapshot is taken there: the chain's | ||
| // last link is the server's own `getClientVersion()`, which a concurrent | ||
| // `initialize` can replace while an identify callback is in flight. | ||
| stampClientIdentity(event, request, extra, server) | ||
| // A legacy `initialize` carries its client in the request body, which is the | ||
| // one place the chain does not read. That body is this request's own answer, | ||
| // so it outranks the accessor — which on a server that already handshaked | ||
| // still names the *previous* client, because the SDK only records this one | ||
| // when its handler runs further below. Without this, the second and every | ||
| // later handshake on a shared instance reports the first client's name, since | ||
| // `captureEvent` prefers a stamped value over `requestSessionInfo`. | ||
| if (initializeClientInfo?.name) { | ||
| event.clientName = initializeClientInfo.name | ||
| } | ||
| if (initializeClientInfo?.version) { | ||
| event.clientVersion = initializeClientInfo.version | ||
| } | ||
| stampTransportIdentity(event, extra) | ||
| const identity = await handleIdentify(server, data, sessionId, request, requestSessionInfo, extra) | ||
| const requestAttribution = withIdentity(requestSessionInfo, identity) | ||
| await applyResolvedMetadata(event, data, request, extra) | ||
@@ -895,0 +916,0 @@ |
+1
-1
@@ -1,1 +0,1 @@ | ||
| export const version = '0.11.5' | ||
| export const version = '0.11.6' |
718588
0.23%14394
0.17%