@posthog/cli 0.7.28 → 0.7.29
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/CHANGELOG.md +6 -0
- package/lib/posthog-api-cli.mjs +240 -85
- package/npm-shrinkwrap.json +2 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# posthog-cli
|
|
2
2
|
|
|
3
|
+
## 0.7.29 — 2026-06-19
|
|
4
|
+
|
|
5
|
+
### Patch changes
|
|
6
|
+
|
|
7
|
+
- [8c030733b1](https://github.com/PostHog/posthog/commit/8c030733b14ad4281505634ab7c1a21e4128ff51) Quiet agent API discovery commands — Thanks @cvolzer3!
|
|
8
|
+
|
|
3
9
|
## 0.7.28 — 2026-06-18
|
|
4
10
|
|
|
5
11
|
### Patch changes
|
package/lib/posthog-api-cli.mjs
CHANGED
|
@@ -27228,7 +27228,7 @@ function isPostHogCodeConsumer(mcpConsumer) {
|
|
|
27228
27228
|
return new MCPClientProfile({ consumer: mcpConsumer }).isPostHogCodeConsumer();
|
|
27229
27229
|
}
|
|
27230
27230
|
|
|
27231
|
-
// ../../node_modules/.pnpm/@posthog+mcp@0.
|
|
27231
|
+
// ../../node_modules/.pnpm/@posthog+mcp@0.4.0_@modelcontextprotocol+sdk@1.29.0_@cfworker+json-schema@4.1.1_zod@4.3.6__posthog-node@5.25.0/node_modules/@posthog/mcp/dist/extensions/logger.mjs
|
|
27232
27232
|
var activeLogger;
|
|
27233
27233
|
function log(message) {
|
|
27234
27234
|
if (activeLogger) try {
|
|
@@ -27237,7 +27237,7 @@ function log(message) {
|
|
|
27237
27237
|
}
|
|
27238
27238
|
}
|
|
27239
27239
|
|
|
27240
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
27240
|
+
// ../../node_modules/.pnpm/@posthog+core@1.35.1/node_modules/@posthog/core/dist/utils/type-utils.mjs
|
|
27241
27241
|
var nativeIsArray = Array.isArray;
|
|
27242
27242
|
var ObjProto = Object.prototype;
|
|
27243
27243
|
var type_utils_hasOwnProperty = ObjProto.hasOwnProperty;
|
|
@@ -27271,7 +27271,7 @@ function isInstanceOf(candidate, base) {
|
|
|
27271
27271
|
}
|
|
27272
27272
|
}
|
|
27273
27273
|
|
|
27274
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
27274
|
+
// ../../node_modules/.pnpm/@posthog+core@1.35.1/node_modules/@posthog/core/dist/vendor/uuidv7.mjs
|
|
27275
27275
|
var DIGITS = "0123456789abcdef";
|
|
27276
27276
|
var UUID = class _UUID {
|
|
27277
27277
|
constructor(bytes) {
|
|
@@ -27433,7 +27433,7 @@ var defaultGenerator;
|
|
|
27433
27433
|
var uuidv72 = () => uuidv7obj().toString();
|
|
27434
27434
|
var uuidv7obj = () => (defaultGenerator || (defaultGenerator = new V7Generator())).generate();
|
|
27435
27435
|
|
|
27436
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
27436
|
+
// ../../node_modules/.pnpm/@posthog+core@1.35.1/node_modules/@posthog/core/dist/utils/user-agent-utils.mjs
|
|
27437
27437
|
var MOBILE = "Mobile";
|
|
27438
27438
|
var IOS = "iOS";
|
|
27439
27439
|
var ANDROID = "Android";
|
|
@@ -27722,10 +27722,10 @@ var osMatchers = [
|
|
|
27722
27722
|
]
|
|
27723
27723
|
];
|
|
27724
27724
|
|
|
27725
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
27725
|
+
// ../../node_modules/.pnpm/@posthog+core@1.35.1/node_modules/@posthog/core/dist/utils/index.mjs
|
|
27726
27726
|
var isError = (x) => x instanceof Error;
|
|
27727
27727
|
|
|
27728
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
27728
|
+
// ../../node_modules/.pnpm/@posthog+core@1.35.1/node_modules/@posthog/core/dist/logs/logs-utils.mjs
|
|
27729
27729
|
var OTLP_SEVERITY_MAP = {
|
|
27730
27730
|
trace: {
|
|
27731
27731
|
text: "TRACE",
|
|
@@ -27754,7 +27754,7 @@ var OTLP_SEVERITY_MAP = {
|
|
|
27754
27754
|
};
|
|
27755
27755
|
var DEFAULT_OTLP_SEVERITY = OTLP_SEVERITY_MAP.info;
|
|
27756
27756
|
|
|
27757
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
27757
|
+
// ../../node_modules/.pnpm/@posthog+core@1.35.1/node_modules/@posthog/core/dist/error-tracking/index.mjs
|
|
27758
27758
|
var error_tracking_exports = {};
|
|
27759
27759
|
__export(error_tracking_exports, {
|
|
27760
27760
|
DEFAULT_EXCEPTION_STEPS_CONFIG: () => DEFAULT_EXCEPTION_STEPS_CONFIG,
|
|
@@ -27784,7 +27784,7 @@ __export(error_tracking_exports, {
|
|
|
27784
27784
|
winjsStackLineParser: () => winjsStackLineParser
|
|
27785
27785
|
});
|
|
27786
27786
|
|
|
27787
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
27787
|
+
// ../../node_modules/.pnpm/@posthog+core@1.35.1/node_modules/@posthog/core/dist/error-tracking/chunk-ids.mjs
|
|
27788
27788
|
var parsedStackResults;
|
|
27789
27789
|
var lastKeysCount;
|
|
27790
27790
|
var cachedFilenameChunkIds;
|
|
@@ -27819,7 +27819,7 @@ function getFilenameToChunkIdMap(stackParser) {
|
|
|
27819
27819
|
return cachedFilenameChunkIds;
|
|
27820
27820
|
}
|
|
27821
27821
|
|
|
27822
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
27822
|
+
// ../../node_modules/.pnpm/@posthog+core@1.35.1/node_modules/@posthog/core/dist/error-tracking/error-properties-builder.mjs
|
|
27823
27823
|
var MAX_CAUSE_RECURSION = 4;
|
|
27824
27824
|
var ErrorPropertiesBuilder = class {
|
|
27825
27825
|
constructor(coercers, stackParser, modifiers = []) {
|
|
@@ -27930,7 +27930,7 @@ var ErrorPropertiesBuilder = class {
|
|
|
27930
27930
|
}
|
|
27931
27931
|
};
|
|
27932
27932
|
|
|
27933
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
27933
|
+
// ../../node_modules/.pnpm/@posthog+core@1.35.1/node_modules/@posthog/core/dist/error-tracking/parsers/base.mjs
|
|
27934
27934
|
var UNKNOWN_FUNCTION = "?";
|
|
27935
27935
|
function createFrame(platform, filename, func, lineno, colno) {
|
|
27936
27936
|
const frame = {
|
|
@@ -27944,7 +27944,7 @@ function createFrame(platform, filename, func, lineno, colno) {
|
|
|
27944
27944
|
return frame;
|
|
27945
27945
|
}
|
|
27946
27946
|
|
|
27947
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
27947
|
+
// ../../node_modules/.pnpm/@posthog+core@1.35.1/node_modules/@posthog/core/dist/error-tracking/parsers/safari.mjs
|
|
27948
27948
|
var extractSafariExtensionDetails = (func, filename) => {
|
|
27949
27949
|
const isSafariExtension = -1 !== func.indexOf("safari-extension");
|
|
27950
27950
|
const isSafariWebExtension = -1 !== func.indexOf("safari-web-extension");
|
|
@@ -27957,7 +27957,7 @@ var extractSafariExtensionDetails = (func, filename) => {
|
|
|
27957
27957
|
];
|
|
27958
27958
|
};
|
|
27959
27959
|
|
|
27960
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
27960
|
+
// ../../node_modules/.pnpm/@posthog+core@1.35.1/node_modules/@posthog/core/dist/error-tracking/parsers/chrome.mjs
|
|
27961
27961
|
var chromeRegexNoFnName = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i;
|
|
27962
27962
|
var chromeRegex = /^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i;
|
|
27963
27963
|
var chromeEvalRegex = /\((\S*)(?::(\d+))(?::(\d+))\)/;
|
|
@@ -27983,7 +27983,7 @@ var chromeStackLineParser = (line, platform) => {
|
|
|
27983
27983
|
}
|
|
27984
27984
|
};
|
|
27985
27985
|
|
|
27986
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
27986
|
+
// ../../node_modules/.pnpm/@posthog+core@1.35.1/node_modules/@posthog/core/dist/error-tracking/parsers/gecko.mjs
|
|
27987
27987
|
var geckoREgex = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i;
|
|
27988
27988
|
var geckoEvalRegex = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i;
|
|
27989
27989
|
var geckoStackLineParser = (line, platform) => {
|
|
@@ -28006,14 +28006,14 @@ var geckoStackLineParser = (line, platform) => {
|
|
|
28006
28006
|
}
|
|
28007
28007
|
};
|
|
28008
28008
|
|
|
28009
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
28009
|
+
// ../../node_modules/.pnpm/@posthog+core@1.35.1/node_modules/@posthog/core/dist/error-tracking/parsers/winjs.mjs
|
|
28010
28010
|
var winjsRegex = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i;
|
|
28011
28011
|
var winjsStackLineParser = (line, platform) => {
|
|
28012
28012
|
const parts = winjsRegex.exec(line);
|
|
28013
28013
|
return parts ? createFrame(platform, parts[2], parts[1] || UNKNOWN_FUNCTION, +parts[3], parts[4] ? +parts[4] : void 0) : void 0;
|
|
28014
28014
|
};
|
|
28015
28015
|
|
|
28016
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
28016
|
+
// ../../node_modules/.pnpm/@posthog+core@1.35.1/node_modules/@posthog/core/dist/error-tracking/parsers/opera.mjs
|
|
28017
28017
|
var opera10Regex = / line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i;
|
|
28018
28018
|
var opera10StackLineParser = (line, platform) => {
|
|
28019
28019
|
const parts = opera10Regex.exec(line);
|
|
@@ -28025,7 +28025,7 @@ var opera11StackLineParser = (line, platform) => {
|
|
|
28025
28025
|
return parts ? createFrame(platform, parts[5], parts[3] || parts[4] || UNKNOWN_FUNCTION, +parts[1], +parts[2]) : void 0;
|
|
28026
28026
|
};
|
|
28027
28027
|
|
|
28028
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
28028
|
+
// ../../node_modules/.pnpm/@posthog+core@1.35.1/node_modules/@posthog/core/dist/error-tracking/parsers/node.mjs
|
|
28029
28029
|
var FILENAME_MATCH = /^\s*[-]{4,}$/;
|
|
28030
28030
|
var FULL_MATCH = /at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;
|
|
28031
28031
|
var nodeStackLineParser = (line, platform) => {
|
|
@@ -28090,7 +28090,7 @@ function _parseIntOrUndefined(input) {
|
|
|
28090
28090
|
return parseInt(input || "", 10) || void 0;
|
|
28091
28091
|
}
|
|
28092
28092
|
|
|
28093
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
28093
|
+
// ../../node_modules/.pnpm/@posthog+core@1.35.1/node_modules/@posthog/core/dist/error-tracking/parsers/index.mjs
|
|
28094
28094
|
var WEBPACK_ERROR_REGEXP = /\(error: (.*)\)/;
|
|
28095
28095
|
var STACKTRACE_FRAME_LIMIT = 50;
|
|
28096
28096
|
function reverseAndStripFrames(stack) {
|
|
@@ -28132,7 +28132,7 @@ function createStackParser(platform, ...parsers) {
|
|
|
28132
28132
|
};
|
|
28133
28133
|
}
|
|
28134
28134
|
|
|
28135
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
28135
|
+
// ../../node_modules/.pnpm/@posthog+core@1.35.1/node_modules/@posthog/core/dist/error-tracking/coercers/dom-exception-coercer.mjs
|
|
28136
28136
|
var DOMExceptionCoercer = class {
|
|
28137
28137
|
match(err2) {
|
|
28138
28138
|
return this.isDOMException(err2) || this.isDOMError(err2);
|
|
@@ -28163,7 +28163,7 @@ var DOMExceptionCoercer = class {
|
|
|
28163
28163
|
}
|
|
28164
28164
|
};
|
|
28165
28165
|
|
|
28166
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
28166
|
+
// ../../node_modules/.pnpm/@posthog+core@1.35.1/node_modules/@posthog/core/dist/error-tracking/coercers/error-coercer.mjs
|
|
28167
28167
|
var ErrorCoercer = class {
|
|
28168
28168
|
match(err2) {
|
|
28169
28169
|
return isPlainError(err2);
|
|
@@ -28190,7 +28190,7 @@ var ErrorCoercer = class {
|
|
|
28190
28190
|
}
|
|
28191
28191
|
};
|
|
28192
28192
|
|
|
28193
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
28193
|
+
// ../../node_modules/.pnpm/@posthog+core@1.35.1/node_modules/@posthog/core/dist/error-tracking/coercers/error-event-coercer.mjs
|
|
28194
28194
|
var ErrorEventCoercer = class {
|
|
28195
28195
|
constructor() {
|
|
28196
28196
|
}
|
|
@@ -28209,7 +28209,7 @@ var ErrorEventCoercer = class {
|
|
|
28209
28209
|
}
|
|
28210
28210
|
};
|
|
28211
28211
|
|
|
28212
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
28212
|
+
// ../../node_modules/.pnpm/@posthog+core@1.35.1/node_modules/@posthog/core/dist/error-tracking/coercers/string-coercer.mjs
|
|
28213
28213
|
var ERROR_TYPES_PATTERN = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;
|
|
28214
28214
|
var StringCoercer = class {
|
|
28215
28215
|
match(input) {
|
|
@@ -28239,7 +28239,7 @@ var StringCoercer = class {
|
|
|
28239
28239
|
}
|
|
28240
28240
|
};
|
|
28241
28241
|
|
|
28242
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
28242
|
+
// ../../node_modules/.pnpm/@posthog+core@1.35.1/node_modules/@posthog/core/dist/error-tracking/types.mjs
|
|
28243
28243
|
var severityLevels = [
|
|
28244
28244
|
"fatal",
|
|
28245
28245
|
"error",
|
|
@@ -28249,7 +28249,7 @@ var severityLevels = [
|
|
|
28249
28249
|
"debug"
|
|
28250
28250
|
];
|
|
28251
28251
|
|
|
28252
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
28252
|
+
// ../../node_modules/.pnpm/@posthog+core@1.35.1/node_modules/@posthog/core/dist/error-tracking/coercers/utils.mjs
|
|
28253
28253
|
function extractExceptionKeysForMessage(err2, maxLength = 40) {
|
|
28254
28254
|
const keys = Object.keys(err2);
|
|
28255
28255
|
keys.sort();
|
|
@@ -28264,7 +28264,7 @@ function extractExceptionKeysForMessage(err2, maxLength = 40) {
|
|
|
28264
28264
|
return "";
|
|
28265
28265
|
}
|
|
28266
28266
|
|
|
28267
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
28267
|
+
// ../../node_modules/.pnpm/@posthog+core@1.35.1/node_modules/@posthog/core/dist/error-tracking/coercers/object-coercer.mjs
|
|
28268
28268
|
var ObjectCoercer = class {
|
|
28269
28269
|
match(candidate) {
|
|
28270
28270
|
return "object" == typeof candidate && null !== candidate;
|
|
@@ -28313,7 +28313,7 @@ var ObjectCoercer = class {
|
|
|
28313
28313
|
}
|
|
28314
28314
|
};
|
|
28315
28315
|
|
|
28316
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
28316
|
+
// ../../node_modules/.pnpm/@posthog+core@1.35.1/node_modules/@posthog/core/dist/error-tracking/coercers/event-coercer.mjs
|
|
28317
28317
|
var EventCoercer = class {
|
|
28318
28318
|
match(err2) {
|
|
28319
28319
|
return isEvent(err2);
|
|
@@ -28329,7 +28329,7 @@ var EventCoercer = class {
|
|
|
28329
28329
|
}
|
|
28330
28330
|
};
|
|
28331
28331
|
|
|
28332
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
28332
|
+
// ../../node_modules/.pnpm/@posthog+core@1.35.1/node_modules/@posthog/core/dist/error-tracking/coercers/primitive-coercer.mjs
|
|
28333
28333
|
var PrimitiveCoercer = class {
|
|
28334
28334
|
match(candidate) {
|
|
28335
28335
|
return isPrimitive(candidate);
|
|
@@ -28344,7 +28344,7 @@ var PrimitiveCoercer = class {
|
|
|
28344
28344
|
}
|
|
28345
28345
|
};
|
|
28346
28346
|
|
|
28347
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
28347
|
+
// ../../node_modules/.pnpm/@posthog+core@1.35.1/node_modules/@posthog/core/dist/error-tracking/coercers/promise-rejection-event.mjs
|
|
28348
28348
|
var PromiseRejectionEventCoercer = class {
|
|
28349
28349
|
match(err2) {
|
|
28350
28350
|
return isBuiltin(err2, "PromiseRejectionEvent") || this.isCustomEventWrappingRejection(err2);
|
|
@@ -28378,7 +28378,7 @@ var PromiseRejectionEventCoercer = class {
|
|
|
28378
28378
|
}
|
|
28379
28379
|
};
|
|
28380
28380
|
|
|
28381
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
28381
|
+
// ../../node_modules/.pnpm/@posthog+core@1.35.1/node_modules/@posthog/core/dist/error-tracking/utils.mjs
|
|
28382
28382
|
var ReduceableCache = class {
|
|
28383
28383
|
constructor(_maxSize2) {
|
|
28384
28384
|
this._maxSize = _maxSize2;
|
|
@@ -28402,7 +28402,7 @@ var ReduceableCache = class {
|
|
|
28402
28402
|
}
|
|
28403
28403
|
};
|
|
28404
28404
|
|
|
28405
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
28405
|
+
// ../../node_modules/.pnpm/@posthog+core@1.35.1/node_modules/@posthog/core/dist/error-tracking/exception-steps.mjs
|
|
28406
28406
|
var EXCEPTION_STEP_INTERNAL_FIELDS = {
|
|
28407
28407
|
MESSAGE: "$message",
|
|
28408
28408
|
TIMESTAMP: "$timestamp"
|
|
@@ -28540,7 +28540,8 @@ function getUtf8ByteLength(value) {
|
|
|
28540
28540
|
return byteLength;
|
|
28541
28541
|
}
|
|
28542
28542
|
|
|
28543
|
-
// ../../node_modules/.pnpm/@posthog+mcp@0.
|
|
28543
|
+
// ../../node_modules/.pnpm/@posthog+mcp@0.4.0_@modelcontextprotocol+sdk@1.29.0_@cfworker+json-schema@4.1.1_zod@4.3.6__posthog-node@5.25.0/node_modules/@posthog/mcp/dist/extensions/constants.mjs
|
|
28544
|
+
var DEFAULT_CONTEXT_PARAMETER_DESCRIPTION = `Explain why you are calling this tool and how it fits into the user's overall goal. This parameter is used for analytics and user intent tracking. YOU MUST provide 15-25 words (count carefully). NEVER use first person ('I', 'we', 'you') - maintain third-person perspective. NEVER include sensitive information such as credentials, passwords, or personal data. Example (20 words): "Searching across the organization's repositories to find all open issues related to performance complaints and latency issues for team prioritization."`;
|
|
28544
28545
|
var POSTHOG_MCP_ANALYTICS_SOURCE = "posthog_mcp_analytics";
|
|
28545
28546
|
var PostHogMCPAnalyticsEvent = {
|
|
28546
28547
|
Custom: "$mcp_custom",
|
|
@@ -28571,11 +28572,12 @@ var PostHogMCPAnalyticsProperty = {
|
|
|
28571
28572
|
ServerVersion: "$mcp_server_version",
|
|
28572
28573
|
SessionId: "$session_id",
|
|
28573
28574
|
Source: "$mcp_source",
|
|
28575
|
+
ToolCategory: "$mcp_tool_category",
|
|
28574
28576
|
ToolDescription: "$mcp_tool_description",
|
|
28575
28577
|
ToolName: "$mcp_tool_name"
|
|
28576
28578
|
};
|
|
28577
28579
|
|
|
28578
|
-
// ../../node_modules/.pnpm/@posthog+mcp@0.
|
|
28580
|
+
// ../../node_modules/.pnpm/@posthog+mcp@0.4.0_@modelcontextprotocol+sdk@1.29.0_@cfworker+json-schema@4.1.1_zod@4.3.6__posthog-node@5.25.0/node_modules/@posthog/mcp/dist/extensions/event-types.mjs
|
|
28579
28581
|
var MCPAnalyticsEventType = {
|
|
28580
28582
|
identify: "posthog:identify",
|
|
28581
28583
|
custom: "posthog:custom",
|
|
@@ -28589,7 +28591,7 @@ var MCPAnalyticsEventType = {
|
|
|
28589
28591
|
mcpToolsList: "mcp:tools/list"
|
|
28590
28592
|
};
|
|
28591
28593
|
|
|
28592
|
-
// ../../node_modules/.pnpm/@posthog+mcp@0.
|
|
28594
|
+
// ../../node_modules/.pnpm/@posthog+mcp@0.4.0_@modelcontextprotocol+sdk@1.29.0_@cfworker+json-schema@4.1.1_zod@4.3.6__posthog-node@5.25.0/node_modules/@posthog/mcp/dist/extensions/posthog-events.mjs
|
|
28593
28595
|
var BUILT_IN_EVENT_NAME_BY_TYPE = {
|
|
28594
28596
|
[MCPAnalyticsEventType.custom]: PostHogMCPAnalyticsEvent.Custom,
|
|
28595
28597
|
[MCPAnalyticsEventType.identify]: PostHogMCPAnalyticsEvent.Identify,
|
|
@@ -28653,6 +28655,7 @@ function addCommonEventProperties(event, properties) {
|
|
|
28653
28655
|
if (event.eventType === MCPAnalyticsEventType.mcpToolsCall) properties[PostHogMCPAnalyticsProperty.ToolName] = event.resourceName;
|
|
28654
28656
|
}
|
|
28655
28657
|
if (event.toolDescription && event.eventType === MCPAnalyticsEventType.mcpToolsCall) properties[PostHogMCPAnalyticsProperty.ToolDescription] = event.toolDescription;
|
|
28658
|
+
if (event.toolCategory && event.eventType === MCPAnalyticsEventType.mcpToolsCall) properties[PostHogMCPAnalyticsProperty.ToolCategory] = event.toolCategory;
|
|
28656
28659
|
if (event.listedToolNames && event.listedToolNames.length > 0 && event.eventType === MCPAnalyticsEventType.mcpToolsList) properties[PostHogMCPAnalyticsProperty.ListedToolNames] = event.listedToolNames;
|
|
28657
28660
|
if (void 0 !== event.duration) properties[PostHogMCPAnalyticsProperty.DurationMs] = event.duration;
|
|
28658
28661
|
if (event.serverName) properties[PostHogMCPAnalyticsProperty.ServerName] = event.serverName;
|
|
@@ -28685,6 +28688,7 @@ function buildExceptionEvent(event) {
|
|
|
28685
28688
|
if (event.eventType === MCPAnalyticsEventType.mcpToolsCall) properties[PostHogMCPAnalyticsProperty.ToolName] = event.resourceName;
|
|
28686
28689
|
}
|
|
28687
28690
|
if (event.toolDescription && event.eventType === MCPAnalyticsEventType.mcpToolsCall) properties[PostHogMCPAnalyticsProperty.ToolDescription] = event.toolDescription;
|
|
28691
|
+
if (event.toolCategory && event.eventType === MCPAnalyticsEventType.mcpToolsCall) properties[PostHogMCPAnalyticsProperty.ToolCategory] = event.toolCategory;
|
|
28688
28692
|
if (event.serverName) properties[PostHogMCPAnalyticsProperty.ServerName] = event.serverName;
|
|
28689
28693
|
if (event.serverVersion) properties[PostHogMCPAnalyticsProperty.ServerVersion] = event.serverVersion;
|
|
28690
28694
|
if (event.clientName) properties[PostHogMCPAnalyticsProperty.ClientName] = event.clientName;
|
|
@@ -28699,12 +28703,12 @@ function buildExceptionEvent(event) {
|
|
|
28699
28703
|
};
|
|
28700
28704
|
}
|
|
28701
28705
|
|
|
28702
|
-
// ../../node_modules/.pnpm/@posthog+mcp@0.
|
|
28706
|
+
// ../../node_modules/.pnpm/@posthog+mcp@0.4.0_@modelcontextprotocol+sdk@1.29.0_@cfworker+json-schema@4.1.1_zod@4.3.6__posthog-node@5.25.0/node_modules/@posthog/mcp/dist/extensions/ids.mjs
|
|
28703
28707
|
function newPrefixedId(prefix) {
|
|
28704
28708
|
return `${prefix}_${uuidv72()}`;
|
|
28705
28709
|
}
|
|
28706
28710
|
|
|
28707
|
-
// ../../node_modules/.pnpm/@posthog+mcp@0.
|
|
28711
|
+
// ../../node_modules/.pnpm/@posthog+mcp@0.4.0_@modelcontextprotocol+sdk@1.29.0_@cfworker+json-schema@4.1.1_zod@4.3.6__posthog-node@5.25.0/node_modules/@posthog/mcp/dist/extensions/mcp-payloads.mjs
|
|
28708
28712
|
var REDACTED_VALUE = "[redacted]";
|
|
28709
28713
|
var BASE64_PATTERN = /^[A-Za-z0-9+/\n\r]+=*$/;
|
|
28710
28714
|
var SIZE_GATE = 10240;
|
|
@@ -28728,7 +28732,7 @@ function sanitizeCapturedValue(value) {
|
|
|
28728
28732
|
return result;
|
|
28729
28733
|
}
|
|
28730
28734
|
|
|
28731
|
-
// ../../node_modules/.pnpm/@posthog+mcp@0.
|
|
28735
|
+
// ../../node_modules/.pnpm/@posthog+mcp@0.4.0_@modelcontextprotocol+sdk@1.29.0_@cfworker+json-schema@4.1.1_zod@4.3.6__posthog-node@5.25.0/node_modules/@posthog/mcp/dist/extensions/sanitization.mjs
|
|
28732
28736
|
function isRecord(value) {
|
|
28733
28737
|
return !!value && "object" == typeof value && !Array.isArray(value);
|
|
28734
28738
|
}
|
|
@@ -28738,6 +28742,7 @@ function sanitizeEvent(event) {
|
|
|
28738
28742
|
};
|
|
28739
28743
|
if (null != result.response) result.response = sanitizeResponse(result.response);
|
|
28740
28744
|
if (null != result.parameters) result.parameters = sanitizeParameters(result.parameters);
|
|
28745
|
+
if (null != result.userIntent) result.userIntent = sanitizeCapturedValue(result.userIntent);
|
|
28741
28746
|
return result;
|
|
28742
28747
|
}
|
|
28743
28748
|
function sanitizeResponse(response) {
|
|
@@ -28790,7 +28795,7 @@ function sanitizeParameters(obj) {
|
|
|
28790
28795
|
return sanitizeCapturedValue(obj);
|
|
28791
28796
|
}
|
|
28792
28797
|
|
|
28793
|
-
// ../../node_modules/.pnpm/@posthog+mcp@0.
|
|
28798
|
+
// ../../node_modules/.pnpm/@posthog+mcp@0.4.0_@modelcontextprotocol+sdk@1.29.0_@cfworker+json-schema@4.1.1_zod@4.3.6__posthog-node@5.25.0/node_modules/@posthog/mcp/dist/extensions/truncation.mjs
|
|
28794
28799
|
var MAX_DEPTH = 10;
|
|
28795
28800
|
var MAX_BREADTH = 100;
|
|
28796
28801
|
var MAX_STRING_LENGTH = 32768;
|
|
@@ -29019,7 +29024,7 @@ function truncateEvent(event) {
|
|
|
29019
29024
|
return truncateToSize(result);
|
|
29020
29025
|
}
|
|
29021
29026
|
|
|
29022
|
-
// ../../node_modules/.pnpm/@posthog+mcp@0.
|
|
29027
|
+
// ../../node_modules/.pnpm/@posthog+mcp@0.4.0_@modelcontextprotocol+sdk@1.29.0_@cfworker+json-schema@4.1.1_zod@4.3.6__posthog-node@5.25.0/node_modules/@posthog/mcp/dist/extensions/sink.mjs
|
|
29023
29028
|
async function processMcpEvent(event, options) {
|
|
29024
29029
|
let processed = event;
|
|
29025
29030
|
try {
|
|
@@ -29079,7 +29084,84 @@ var McpEventSink = class {
|
|
|
29079
29084
|
}
|
|
29080
29085
|
};
|
|
29081
29086
|
|
|
29082
|
-
// ../../node_modules/.pnpm/@posthog+mcp@0.
|
|
29087
|
+
// ../../node_modules/.pnpm/@posthog+mcp@0.4.0_@modelcontextprotocol+sdk@1.29.0_@cfworker+json-schema@4.1.1_zod@4.3.6__posthog-node@5.25.0/node_modules/@posthog/mcp/dist/extensions/tools.mjs
|
|
29088
|
+
var GET_MORE_TOOLS_NAME = "get_more_tools";
|
|
29089
|
+
function getReportMissingToolDescriptor(name = GET_MORE_TOOLS_NAME) {
|
|
29090
|
+
return {
|
|
29091
|
+
name,
|
|
29092
|
+
description: "Check for additional tools whenever your task might benefit from specialized capabilities - even if existing tools could work as a fallback.",
|
|
29093
|
+
inputSchema: {
|
|
29094
|
+
type: "object",
|
|
29095
|
+
properties: {
|
|
29096
|
+
context: {
|
|
29097
|
+
type: "string",
|
|
29098
|
+
description: "A description of your goal and what kind of tool would help accomplish it."
|
|
29099
|
+
}
|
|
29100
|
+
},
|
|
29101
|
+
required: [
|
|
29102
|
+
"context"
|
|
29103
|
+
]
|
|
29104
|
+
},
|
|
29105
|
+
annotations: {
|
|
29106
|
+
title: "Get More Tools",
|
|
29107
|
+
readOnlyHint: true,
|
|
29108
|
+
openWorldHint: true,
|
|
29109
|
+
idempotentHint: true,
|
|
29110
|
+
destructiveHint: false
|
|
29111
|
+
}
|
|
29112
|
+
};
|
|
29113
|
+
}
|
|
29114
|
+
|
|
29115
|
+
// ../../node_modules/.pnpm/@posthog+mcp@0.4.0_@modelcontextprotocol+sdk@1.29.0_@cfworker+json-schema@4.1.1_zod@4.3.6__posthog-node@5.25.0/node_modules/@posthog/mcp/dist/extensions/context-parameters.mjs
|
|
29116
|
+
function isContextEnabled(context) {
|
|
29117
|
+
return false !== context;
|
|
29118
|
+
}
|
|
29119
|
+
function getContextDescription(context) {
|
|
29120
|
+
return "object" == typeof context ? context.description : void 0;
|
|
29121
|
+
}
|
|
29122
|
+
function addContextParameterToTool(tool14, contextDescriptionOverride) {
|
|
29123
|
+
const modifiedTool = {
|
|
29124
|
+
...tool14
|
|
29125
|
+
};
|
|
29126
|
+
const toolName = tool14.name || "unknown";
|
|
29127
|
+
const schema19 = modifiedTool.inputSchema;
|
|
29128
|
+
if (schema19?.properties?.context) {
|
|
29129
|
+
log(`WARN: Tool "${toolName}" already has 'context' parameter. Skipping context injection.`);
|
|
29130
|
+
return modifiedTool;
|
|
29131
|
+
}
|
|
29132
|
+
if (schema19?.oneOf || schema19?.allOf || schema19?.anyOf) {
|
|
29133
|
+
log(`WARN: Tool "${toolName}" has complex schema (oneOf/allOf/anyOf). Skipping context injection.`);
|
|
29134
|
+
return modifiedTool;
|
|
29135
|
+
}
|
|
29136
|
+
if (!modifiedTool.inputSchema) modifiedTool.inputSchema = {
|
|
29137
|
+
type: "object",
|
|
29138
|
+
properties: {},
|
|
29139
|
+
required: []
|
|
29140
|
+
};
|
|
29141
|
+
const contextDescription = contextDescriptionOverride || DEFAULT_CONTEXT_PARAMETER_DESCRIPTION;
|
|
29142
|
+
modifiedTool.inputSchema = JSON.parse(JSON.stringify(modifiedTool.inputSchema));
|
|
29143
|
+
const inputSchema = modifiedTool.inputSchema;
|
|
29144
|
+
if (!inputSchema.properties) inputSchema.properties = {};
|
|
29145
|
+
if (false === inputSchema.additionalProperties) inputSchema.additionalProperties = void 0;
|
|
29146
|
+
inputSchema.properties.context = {
|
|
29147
|
+
type: "string",
|
|
29148
|
+
description: contextDescription
|
|
29149
|
+
};
|
|
29150
|
+
if (Array.isArray(inputSchema.required)) {
|
|
29151
|
+
if (!inputSchema.required.includes("context")) inputSchema.required.push("context");
|
|
29152
|
+
} else inputSchema.required = [
|
|
29153
|
+
"context"
|
|
29154
|
+
];
|
|
29155
|
+
return modifiedTool;
|
|
29156
|
+
}
|
|
29157
|
+
function addContextParameterToTools(tools, contextDescriptionOverride) {
|
|
29158
|
+
return tools.map((tool14) => {
|
|
29159
|
+
if ("get_more_tools" === tool14.name) return tool14;
|
|
29160
|
+
return addContextParameterToTool(tool14, contextDescriptionOverride);
|
|
29161
|
+
});
|
|
29162
|
+
}
|
|
29163
|
+
|
|
29164
|
+
// ../../node_modules/.pnpm/@posthog+mcp@0.4.0_@modelcontextprotocol+sdk@1.29.0_@cfworker+json-schema@4.1.1_zod@4.3.6__posthog-node@5.25.0/node_modules/@posthog/mcp/dist/extensions/exceptions.mjs
|
|
29083
29165
|
var errorPropertiesBuilder = new error_tracking_exports.ErrorPropertiesBuilder([
|
|
29084
29166
|
new error_tracking_exports.EventCoercer(),
|
|
29085
29167
|
new error_tracking_exports.ErrorCoercer(),
|
|
@@ -29103,7 +29185,7 @@ function extractCallToolResultMessage(result) {
|
|
|
29103
29185
|
return result.content.filter(isTextContentPart).map((contentPart) => contentPart.text).join(" ").trim() || "Unknown error";
|
|
29104
29186
|
}
|
|
29105
29187
|
|
|
29106
|
-
// ../../node_modules/.pnpm/@posthog+mcp@0.
|
|
29188
|
+
// ../../node_modules/.pnpm/@posthog+mcp@0.4.0_@modelcontextprotocol+sdk@1.29.0_@cfworker+json-schema@4.1.1_zod@4.3.6__posthog-node@5.25.0/node_modules/@posthog/mcp/dist/extensions/instrument-highlevel.mjs
|
|
29107
29189
|
var MCP_ANALYTICS_PROCESSED = Symbol("__posthog_mcp_analytics_processed__");
|
|
29108
29190
|
|
|
29109
29191
|
// ../../node_modules/.pnpm/posthog-node@5.25.0/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
@@ -32909,17 +32991,24 @@ var PostHog = class extends PostHogBackendClient {
|
|
|
32909
32991
|
}
|
|
32910
32992
|
};
|
|
32911
32993
|
|
|
32912
|
-
// ../../node_modules/.pnpm/@posthog+mcp@0.
|
|
32994
|
+
// ../../node_modules/.pnpm/@posthog+mcp@0.4.0_@modelcontextprotocol+sdk@1.29.0_@cfworker+json-schema@4.1.1_zod@4.3.6__posthog-node@5.25.0/node_modules/@posthog/mcp/dist/extensions/posthog-mcp.mjs
|
|
32913
32995
|
var PostHogMCP = class extends PostHog {
|
|
32914
32996
|
#sink;
|
|
32997
|
+
#missingCapabilityToolName;
|
|
32998
|
+
constructor(apiKey, options = {}) {
|
|
32999
|
+
super(apiKey, options), this.#sink = new McpEventSink(this);
|
|
33000
|
+
this.#missingCapabilityToolName = options.missingCapabilityToolName ?? GET_MORE_TOOLS_NAME;
|
|
33001
|
+
}
|
|
32915
33002
|
captureToolCall(data) {
|
|
32916
33003
|
const event = baseEvent(MCPAnalyticsEventType.mcpToolsCall, data);
|
|
32917
33004
|
event.resourceName = data.toolName;
|
|
32918
33005
|
event.toolDescription = data.toolDescription;
|
|
33006
|
+
event.toolCategory = data.category;
|
|
32919
33007
|
event.parameters = data.parameters;
|
|
32920
33008
|
event.response = data.response;
|
|
32921
33009
|
event.duration = data.durationMs;
|
|
32922
33010
|
event.isError = data.isError;
|
|
33011
|
+
applyIntent(event, data.intent, data.intentSource);
|
|
32923
33012
|
if (data.isError) event.error = captureException(data.error ?? `Tool ${data.toolName} returned an error`);
|
|
32924
33013
|
this.#emit(event);
|
|
32925
33014
|
}
|
|
@@ -32932,14 +33021,49 @@ var PostHogMCP = class extends PostHog {
|
|
|
32932
33021
|
event.duration = data.durationMs;
|
|
32933
33022
|
this.#emit(event);
|
|
32934
33023
|
}
|
|
33024
|
+
captureToolsList(data) {
|
|
33025
|
+
const event = baseEvent(MCPAnalyticsEventType.mcpToolsList, data);
|
|
33026
|
+
event.listedToolNames = data.toolNames;
|
|
33027
|
+
event.parameters = data.parameters;
|
|
33028
|
+
event.response = data.response;
|
|
33029
|
+
event.duration = data.durationMs;
|
|
33030
|
+
event.isError = data.isError;
|
|
33031
|
+
if (data.isError) event.error = captureException(data.error ?? "tools/list failed");
|
|
33032
|
+
this.#emit(event);
|
|
33033
|
+
}
|
|
33034
|
+
prepareToolList(tools, options = {}) {
|
|
33035
|
+
const contextOption = options.context ?? true;
|
|
33036
|
+
let prepared = isContextEnabled(contextOption) ? addContextParameterToTools(tools, getContextDescription(contextOption)) : [
|
|
33037
|
+
...tools
|
|
33038
|
+
];
|
|
33039
|
+
if (options.reportMissing && !prepared.some((tool14) => tool14?.name === this.#missingCapabilityToolName)) prepared = [
|
|
33040
|
+
...prepared,
|
|
33041
|
+
getReportMissingToolDescriptor(this.#missingCapabilityToolName)
|
|
33042
|
+
];
|
|
33043
|
+
return prepared;
|
|
33044
|
+
}
|
|
33045
|
+
prepareToolCall(name, args) {
|
|
33046
|
+
const rawContext = args?.context;
|
|
33047
|
+
const intent = "string" == typeof rawContext && rawContext.trim() ? rawContext.trim() : void 0;
|
|
33048
|
+
return {
|
|
33049
|
+
intent,
|
|
33050
|
+
intentSource: intent ? "context_parameter" : void 0,
|
|
33051
|
+
args: stripContext(args),
|
|
33052
|
+
isMissingCapability: name === this.#missingCapabilityToolName
|
|
33053
|
+
};
|
|
33054
|
+
}
|
|
33055
|
+
captureMissingCapability(data) {
|
|
33056
|
+
const event = baseEvent(MCPAnalyticsEventType.mcpMissingCapability, data);
|
|
33057
|
+
event.resourceName = this.#missingCapabilityToolName;
|
|
33058
|
+
event.parameters = data.parameters;
|
|
33059
|
+
applyIntent(event, data.context, "context_parameter");
|
|
33060
|
+
this.#emit(event);
|
|
33061
|
+
}
|
|
32935
33062
|
#emit(event) {
|
|
32936
33063
|
this.#sink.capture(event, {
|
|
32937
33064
|
enableExceptionAutocapture: this.options.enableExceptionAutocapture ?? true
|
|
32938
33065
|
}).catch((error48) => log(`Warning: PostHogMCP failed to capture event - ${error48}`));
|
|
32939
33066
|
}
|
|
32940
|
-
constructor(...args) {
|
|
32941
|
-
super(...args), this.#sink = new McpEventSink(this);
|
|
32942
|
-
}
|
|
32943
33067
|
};
|
|
32944
33068
|
function baseEvent(eventType, common) {
|
|
32945
33069
|
const event = {
|
|
@@ -32953,6 +33077,17 @@ function baseEvent(eventType, common) {
|
|
|
32953
33077
|
if (common.setProperties && Object.keys(common.setProperties).length > 0) event.identifyActorData = common.setProperties;
|
|
32954
33078
|
return event;
|
|
32955
33079
|
}
|
|
33080
|
+
function applyIntent(event, intent, source) {
|
|
33081
|
+
const trimmed = "string" == typeof intent ? intent.trim() : "";
|
|
33082
|
+
if (!trimmed) return;
|
|
33083
|
+
event.userIntent = trimmed;
|
|
33084
|
+
event.userIntentSource = source ?? "context_parameter";
|
|
33085
|
+
}
|
|
33086
|
+
function stripContext(args) {
|
|
33087
|
+
if (!args || !("context" in args)) return args;
|
|
33088
|
+
const { context: _context, ...rest } = args;
|
|
33089
|
+
return rest;
|
|
33090
|
+
}
|
|
32956
33091
|
|
|
32957
33092
|
// cf-stub:cloudflare:workers
|
|
32958
33093
|
var env = void 0;
|
|
@@ -33605,6 +33740,9 @@ function createExecTool(allTools, context, toolDescription, commandReference, mc
|
|
|
33605
33740
|
if (!rest) {
|
|
33606
33741
|
throw new Error("Usage: call [--json] [--confirm] <tool_name> <json_input>");
|
|
33607
33742
|
}
|
|
33743
|
+
if (!context) {
|
|
33744
|
+
throw new Error("Cannot call PostHog tools without an API context");
|
|
33745
|
+
}
|
|
33608
33746
|
const { forceJson, confirmed, rest: callArgs } = parseCallFlags(rest);
|
|
33609
33747
|
if (!callArgs) {
|
|
33610
33748
|
throw new Error("Usage: call [--json] [--confirm] <tool_name> <json_input>");
|
|
@@ -43242,7 +43380,7 @@ var package_default = {
|
|
|
43242
43380
|
"@hono/node-server": "^2.0.2",
|
|
43243
43381
|
"@modelcontextprotocol/ext-apps": "^1.5.0",
|
|
43244
43382
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
43245
|
-
"@posthog/mcp-analytics": "npm:@posthog/mcp@0.
|
|
43383
|
+
"@posthog/mcp-analytics": "npm:@posthog/mcp@0.4.0",
|
|
43246
43384
|
"@posthog/quill": "workspace:*",
|
|
43247
43385
|
"@posthog/quill-charts": "workspace:*",
|
|
43248
43386
|
"@toon-format/toon": "^2.1.0",
|
|
@@ -89646,21 +89784,21 @@ var ExternalDataSchemasPartialUpdateParams = /* @__PURE__ */ object({
|
|
|
89646
89784
|
var ExternalDataSchemasPartialUpdateBody = /* @__PURE__ */ object({
|
|
89647
89785
|
should_sync: boolean2().optional(),
|
|
89648
89786
|
sync_type: union([
|
|
89649
|
-
_enum2(["full_refresh", "incremental", "append", "webhook", "cdc"]).describe(
|
|
89650
|
-
"* `full_refresh` - full_refresh\n* `incremental` - incremental\n* `append` - append\n* `webhook` - webhook\n* `cdc` - cdc"
|
|
89787
|
+
_enum2(["full_refresh", "incremental", "append", "webhook", "cdc", "xmin"]).describe(
|
|
89788
|
+
"* `full_refresh` - full_refresh\n* `incremental` - incremental\n* `append` - append\n* `webhook` - webhook\n* `cdc` - cdc\n* `xmin` - xmin"
|
|
89651
89789
|
),
|
|
89652
89790
|
_null3()
|
|
89653
89791
|
]).optional().describe(
|
|
89654
|
-
"Sync strategy: incremental, full_refresh, append, or cdc.\n\n* `full_refresh` - full_refresh\n* `incremental` - incremental\n* `append` - append\n* `webhook` - webhook\n* `cdc` - cdc"
|
|
89792
|
+
"Sync strategy: incremental, full_refresh, append, or cdc.\n\n* `full_refresh` - full_refresh\n* `incremental` - incremental\n* `append` - append\n* `webhook` - webhook\n* `cdc` - cdc\n* `xmin` - xmin"
|
|
89655
89793
|
),
|
|
89656
89794
|
incremental_field: string2().nullish().describe("Column name used to track sync progress."),
|
|
89657
89795
|
incremental_field_type: union([
|
|
89658
|
-
_enum2(["integer", "numeric", "datetime", "date", "timestamp", "objectid"]).describe(
|
|
89659
|
-
"* `integer` - integer\n* `numeric` - numeric\n* `datetime` - datetime\n* `date` - date\n* `timestamp` - timestamp\n* `objectid` - objectid"
|
|
89796
|
+
_enum2(["integer", "numeric", "datetime", "date", "timestamp", "objectid", "xid"]).describe(
|
|
89797
|
+
"* `integer` - integer\n* `numeric` - numeric\n* `datetime` - datetime\n* `date` - date\n* `timestamp` - timestamp\n* `objectid` - objectid\n* `xid` - xid"
|
|
89660
89798
|
),
|
|
89661
89799
|
_null3()
|
|
89662
89800
|
]).optional().describe(
|
|
89663
|
-
"Data type of the incremental field.\n\n* `integer` - integer\n* `numeric` - numeric\n* `datetime` - datetime\n* `date` - date\n* `timestamp` - timestamp\n* `objectid` - objectid"
|
|
89801
|
+
"Data type of the incremental field.\n\n* `integer` - integer\n* `numeric` - numeric\n* `datetime` - datetime\n* `date` - date\n* `timestamp` - timestamp\n* `objectid` - objectid\n* `xid` - xid"
|
|
89664
89802
|
),
|
|
89665
89803
|
sync_frequency: union([
|
|
89666
89804
|
_enum2([
|
|
@@ -89714,21 +89852,21 @@ var ExternalDataSchemasCancelCreateParams = /* @__PURE__ */ object({
|
|
|
89714
89852
|
var ExternalDataSchemasCancelCreateBody = /* @__PURE__ */ object({
|
|
89715
89853
|
should_sync: boolean2().optional(),
|
|
89716
89854
|
sync_type: union([
|
|
89717
|
-
_enum2(["full_refresh", "incremental", "append", "webhook", "cdc"]).describe(
|
|
89718
|
-
"* `full_refresh` - full_refresh\n* `incremental` - incremental\n* `append` - append\n* `webhook` - webhook\n* `cdc` - cdc"
|
|
89855
|
+
_enum2(["full_refresh", "incremental", "append", "webhook", "cdc", "xmin"]).describe(
|
|
89856
|
+
"* `full_refresh` - full_refresh\n* `incremental` - incremental\n* `append` - append\n* `webhook` - webhook\n* `cdc` - cdc\n* `xmin` - xmin"
|
|
89719
89857
|
),
|
|
89720
89858
|
_null3()
|
|
89721
89859
|
]).optional().describe(
|
|
89722
|
-
"Sync strategy: incremental, full_refresh, append, or cdc.\n\n* `full_refresh` - full_refresh\n* `incremental` - incremental\n* `append` - append\n* `webhook` - webhook\n* `cdc` - cdc"
|
|
89860
|
+
"Sync strategy: incremental, full_refresh, append, or cdc.\n\n* `full_refresh` - full_refresh\n* `incremental` - incremental\n* `append` - append\n* `webhook` - webhook\n* `cdc` - cdc\n* `xmin` - xmin"
|
|
89723
89861
|
),
|
|
89724
89862
|
incremental_field: string2().nullish().describe("Column name used to track sync progress."),
|
|
89725
89863
|
incremental_field_type: union([
|
|
89726
|
-
_enum2(["integer", "numeric", "datetime", "date", "timestamp", "objectid"]).describe(
|
|
89727
|
-
"* `integer` - integer\n* `numeric` - numeric\n* `datetime` - datetime\n* `date` - date\n* `timestamp` - timestamp\n* `objectid` - objectid"
|
|
89864
|
+
_enum2(["integer", "numeric", "datetime", "date", "timestamp", "objectid", "xid"]).describe(
|
|
89865
|
+
"* `integer` - integer\n* `numeric` - numeric\n* `datetime` - datetime\n* `date` - date\n* `timestamp` - timestamp\n* `objectid` - objectid\n* `xid` - xid"
|
|
89728
89866
|
),
|
|
89729
89867
|
_null3()
|
|
89730
89868
|
]).optional().describe(
|
|
89731
|
-
"Data type of the incremental field.\n\n* `integer` - integer\n* `numeric` - numeric\n* `datetime` - datetime\n* `date` - date\n* `timestamp` - timestamp\n* `objectid` - objectid"
|
|
89869
|
+
"Data type of the incremental field.\n\n* `integer` - integer\n* `numeric` - numeric\n* `datetime` - datetime\n* `date` - date\n* `timestamp` - timestamp\n* `objectid` - objectid\n* `xid` - xid"
|
|
89732
89870
|
),
|
|
89733
89871
|
sync_frequency: union([
|
|
89734
89872
|
_enum2([
|
|
@@ -89788,21 +89926,21 @@ var ExternalDataSchemasIncrementalFieldsCreateParams = /* @__PURE__ */ object({
|
|
|
89788
89926
|
var ExternalDataSchemasIncrementalFieldsCreateBody = /* @__PURE__ */ object({
|
|
89789
89927
|
should_sync: boolean2().optional(),
|
|
89790
89928
|
sync_type: union([
|
|
89791
|
-
_enum2(["full_refresh", "incremental", "append", "webhook", "cdc"]).describe(
|
|
89792
|
-
"* `full_refresh` - full_refresh\n* `incremental` - incremental\n* `append` - append\n* `webhook` - webhook\n* `cdc` - cdc"
|
|
89929
|
+
_enum2(["full_refresh", "incremental", "append", "webhook", "cdc", "xmin"]).describe(
|
|
89930
|
+
"* `full_refresh` - full_refresh\n* `incremental` - incremental\n* `append` - append\n* `webhook` - webhook\n* `cdc` - cdc\n* `xmin` - xmin"
|
|
89793
89931
|
),
|
|
89794
89932
|
_null3()
|
|
89795
89933
|
]).optional().describe(
|
|
89796
|
-
"Sync strategy: incremental, full_refresh, append, or cdc.\n\n* `full_refresh` - full_refresh\n* `incremental` - incremental\n* `append` - append\n* `webhook` - webhook\n* `cdc` - cdc"
|
|
89934
|
+
"Sync strategy: incremental, full_refresh, append, or cdc.\n\n* `full_refresh` - full_refresh\n* `incremental` - incremental\n* `append` - append\n* `webhook` - webhook\n* `cdc` - cdc\n* `xmin` - xmin"
|
|
89797
89935
|
),
|
|
89798
89936
|
incremental_field: string2().nullish().describe("Column name used to track sync progress."),
|
|
89799
89937
|
incremental_field_type: union([
|
|
89800
|
-
_enum2(["integer", "numeric", "datetime", "date", "timestamp", "objectid"]).describe(
|
|
89801
|
-
"* `integer` - integer\n* `numeric` - numeric\n* `datetime` - datetime\n* `date` - date\n* `timestamp` - timestamp\n* `objectid` - objectid"
|
|
89938
|
+
_enum2(["integer", "numeric", "datetime", "date", "timestamp", "objectid", "xid"]).describe(
|
|
89939
|
+
"* `integer` - integer\n* `numeric` - numeric\n* `datetime` - datetime\n* `date` - date\n* `timestamp` - timestamp\n* `objectid` - objectid\n* `xid` - xid"
|
|
89802
89940
|
),
|
|
89803
89941
|
_null3()
|
|
89804
89942
|
]).optional().describe(
|
|
89805
|
-
"Data type of the incremental field.\n\n* `integer` - integer\n* `numeric` - numeric\n* `datetime` - datetime\n* `date` - date\n* `timestamp` - timestamp\n* `objectid` - objectid"
|
|
89943
|
+
"Data type of the incremental field.\n\n* `integer` - integer\n* `numeric` - numeric\n* `datetime` - datetime\n* `date` - date\n* `timestamp` - timestamp\n* `objectid` - objectid\n* `xid` - xid"
|
|
89806
89944
|
),
|
|
89807
89945
|
sync_frequency: union([
|
|
89808
89946
|
_enum2([
|
|
@@ -89856,21 +89994,21 @@ var ExternalDataSchemasReloadCreateParams = /* @__PURE__ */ object({
|
|
|
89856
89994
|
var ExternalDataSchemasReloadCreateBody = /* @__PURE__ */ object({
|
|
89857
89995
|
should_sync: boolean2().optional(),
|
|
89858
89996
|
sync_type: union([
|
|
89859
|
-
_enum2(["full_refresh", "incremental", "append", "webhook", "cdc"]).describe(
|
|
89860
|
-
"* `full_refresh` - full_refresh\n* `incremental` - incremental\n* `append` - append\n* `webhook` - webhook\n* `cdc` - cdc"
|
|
89997
|
+
_enum2(["full_refresh", "incremental", "append", "webhook", "cdc", "xmin"]).describe(
|
|
89998
|
+
"* `full_refresh` - full_refresh\n* `incremental` - incremental\n* `append` - append\n* `webhook` - webhook\n* `cdc` - cdc\n* `xmin` - xmin"
|
|
89861
89999
|
),
|
|
89862
90000
|
_null3()
|
|
89863
90001
|
]).optional().describe(
|
|
89864
|
-
"Sync strategy: incremental, full_refresh, append, or cdc.\n\n* `full_refresh` - full_refresh\n* `incremental` - incremental\n* `append` - append\n* `webhook` - webhook\n* `cdc` - cdc"
|
|
90002
|
+
"Sync strategy: incremental, full_refresh, append, or cdc.\n\n* `full_refresh` - full_refresh\n* `incremental` - incremental\n* `append` - append\n* `webhook` - webhook\n* `cdc` - cdc\n* `xmin` - xmin"
|
|
89865
90003
|
),
|
|
89866
90004
|
incremental_field: string2().nullish().describe("Column name used to track sync progress."),
|
|
89867
90005
|
incremental_field_type: union([
|
|
89868
|
-
_enum2(["integer", "numeric", "datetime", "date", "timestamp", "objectid"]).describe(
|
|
89869
|
-
"* `integer` - integer\n* `numeric` - numeric\n* `datetime` - datetime\n* `date` - date\n* `timestamp` - timestamp\n* `objectid` - objectid"
|
|
90006
|
+
_enum2(["integer", "numeric", "datetime", "date", "timestamp", "objectid", "xid"]).describe(
|
|
90007
|
+
"* `integer` - integer\n* `numeric` - numeric\n* `datetime` - datetime\n* `date` - date\n* `timestamp` - timestamp\n* `objectid` - objectid\n* `xid` - xid"
|
|
89870
90008
|
),
|
|
89871
90009
|
_null3()
|
|
89872
90010
|
]).optional().describe(
|
|
89873
|
-
"Data type of the incremental field.\n\n* `integer` - integer\n* `numeric` - numeric\n* `datetime` - datetime\n* `date` - date\n* `timestamp` - timestamp\n* `objectid` - objectid"
|
|
90011
|
+
"Data type of the incremental field.\n\n* `integer` - integer\n* `numeric` - numeric\n* `datetime` - datetime\n* `date` - date\n* `timestamp` - timestamp\n* `objectid` - objectid\n* `xid` - xid"
|
|
89874
90012
|
),
|
|
89875
90013
|
sync_frequency: union([
|
|
89876
90014
|
_enum2([
|
|
@@ -89924,21 +90062,21 @@ var ExternalDataSchemasResyncCreateParams = /* @__PURE__ */ object({
|
|
|
89924
90062
|
var ExternalDataSchemasResyncCreateBody = /* @__PURE__ */ object({
|
|
89925
90063
|
should_sync: boolean2().optional(),
|
|
89926
90064
|
sync_type: union([
|
|
89927
|
-
_enum2(["full_refresh", "incremental", "append", "webhook", "cdc"]).describe(
|
|
89928
|
-
"* `full_refresh` - full_refresh\n* `incremental` - incremental\n* `append` - append\n* `webhook` - webhook\n* `cdc` - cdc"
|
|
90065
|
+
_enum2(["full_refresh", "incremental", "append", "webhook", "cdc", "xmin"]).describe(
|
|
90066
|
+
"* `full_refresh` - full_refresh\n* `incremental` - incremental\n* `append` - append\n* `webhook` - webhook\n* `cdc` - cdc\n* `xmin` - xmin"
|
|
89929
90067
|
),
|
|
89930
90068
|
_null3()
|
|
89931
90069
|
]).optional().describe(
|
|
89932
|
-
"Sync strategy: incremental, full_refresh, append, or cdc.\n\n* `full_refresh` - full_refresh\n* `incremental` - incremental\n* `append` - append\n* `webhook` - webhook\n* `cdc` - cdc"
|
|
90070
|
+
"Sync strategy: incremental, full_refresh, append, or cdc.\n\n* `full_refresh` - full_refresh\n* `incremental` - incremental\n* `append` - append\n* `webhook` - webhook\n* `cdc` - cdc\n* `xmin` - xmin"
|
|
89933
90071
|
),
|
|
89934
90072
|
incremental_field: string2().nullish().describe("Column name used to track sync progress."),
|
|
89935
90073
|
incremental_field_type: union([
|
|
89936
|
-
_enum2(["integer", "numeric", "datetime", "date", "timestamp", "objectid"]).describe(
|
|
89937
|
-
"* `integer` - integer\n* `numeric` - numeric\n* `datetime` - datetime\n* `date` - date\n* `timestamp` - timestamp\n* `objectid` - objectid"
|
|
90074
|
+
_enum2(["integer", "numeric", "datetime", "date", "timestamp", "objectid", "xid"]).describe(
|
|
90075
|
+
"* `integer` - integer\n* `numeric` - numeric\n* `datetime` - datetime\n* `date` - date\n* `timestamp` - timestamp\n* `objectid` - objectid\n* `xid` - xid"
|
|
89938
90076
|
),
|
|
89939
90077
|
_null3()
|
|
89940
90078
|
]).optional().describe(
|
|
89941
|
-
"Data type of the incremental field.\n\n* `integer` - integer\n* `numeric` - numeric\n* `datetime` - datetime\n* `date` - date\n* `timestamp` - timestamp\n* `objectid` - objectid"
|
|
90079
|
+
"Data type of the incremental field.\n\n* `integer` - integer\n* `numeric` - numeric\n* `datetime` - datetime\n* `date` - date\n* `timestamp` - timestamp\n* `objectid` - objectid\n* `xid` - xid"
|
|
89942
90080
|
),
|
|
89943
90081
|
sync_frequency: union([
|
|
89944
90082
|
_enum2([
|
|
@@ -100165,6 +100303,20 @@ function printResult(result) {
|
|
|
100165
100303
|
process.stdout.write(`${JSON.stringify(result, null, 2)}
|
|
100166
100304
|
`);
|
|
100167
100305
|
}
|
|
100306
|
+
function buildStaticExec() {
|
|
100307
|
+
const tools = getCliTools();
|
|
100308
|
+
const execTool = createExecTool(
|
|
100309
|
+
tools,
|
|
100310
|
+
void 0,
|
|
100311
|
+
"Execute a PostHog CLI command",
|
|
100312
|
+
COMMAND_REFERENCE,
|
|
100313
|
+
"posthog-cli",
|
|
100314
|
+
void 0,
|
|
100315
|
+
[],
|
|
100316
|
+
{ requireDestructiveConfirmation: true }
|
|
100317
|
+
);
|
|
100318
|
+
return { execTool, tools };
|
|
100319
|
+
}
|
|
100168
100320
|
async function buildExec(config2 = resolveCliConfig()) {
|
|
100169
100321
|
const context = await buildCliContext(config2);
|
|
100170
100322
|
const aiConsentGiven = await context.stateManager.getAiConsentGiven();
|
|
@@ -100188,12 +100340,15 @@ async function buildExec(config2 = resolveCliConfig()) {
|
|
|
100188
100340
|
[],
|
|
100189
100341
|
{ requireDestructiveConfirmation: true }
|
|
100190
100342
|
);
|
|
100191
|
-
return {
|
|
100343
|
+
return { context, execTool, tools };
|
|
100192
100344
|
}
|
|
100193
|
-
|
|
100194
|
-
|
|
100195
|
-
|
|
100196
|
-
|
|
100345
|
+
function buildAgentHelpForStaticCatalog() {
|
|
100346
|
+
return buildAgentHelp(getCliTools());
|
|
100347
|
+
}
|
|
100348
|
+
async function runStaticExecCommand(command) {
|
|
100349
|
+
const { execTool } = buildStaticExec();
|
|
100350
|
+
const result = await execTool.handler(void 0, { command });
|
|
100351
|
+
printResult(result);
|
|
100197
100352
|
}
|
|
100198
100353
|
async function runExecCommand(command) {
|
|
100199
100354
|
const config2 = resolveCliConfig();
|
|
@@ -100212,7 +100367,7 @@ async function runDryCall(args) {
|
|
|
100212
100367
|
if (!toolName) {
|
|
100213
100368
|
throw new Error("Usage: posthog-cli api call --dry-run [--json] [--confirm] <tool> <json>");
|
|
100214
100369
|
}
|
|
100215
|
-
const { tools } =
|
|
100370
|
+
const { tools } = buildStaticExec();
|
|
100216
100371
|
const tool14 = tools.find((candidate) => candidate.name === toolName);
|
|
100217
100372
|
if (!tool14) {
|
|
100218
100373
|
throw new Error(`Unknown tool: "${toolName}". Run "posthog-cli api search <term>".`);
|
|
@@ -100283,16 +100438,16 @@ async function main() {
|
|
|
100283
100438
|
return;
|
|
100284
100439
|
}
|
|
100285
100440
|
if (command === "agent-help" || command === "--agent-help") {
|
|
100286
|
-
process.stdout.write(`${
|
|
100441
|
+
process.stdout.write(`${buildAgentHelpForStaticCatalog()}
|
|
100287
100442
|
`);
|
|
100288
100443
|
return;
|
|
100289
100444
|
}
|
|
100290
100445
|
switch (command) {
|
|
100291
100446
|
case "tools":
|
|
100292
|
-
await
|
|
100447
|
+
await runStaticExecCommand("tools");
|
|
100293
100448
|
return;
|
|
100294
100449
|
case "search":
|
|
100295
|
-
await
|
|
100450
|
+
await runStaticExecCommand(`search ${args.join(" ")}`);
|
|
100296
100451
|
return;
|
|
100297
100452
|
case "info": {
|
|
100298
100453
|
const json2 = takeFlag(args, "--json");
|
|
@@ -100300,7 +100455,7 @@ async function main() {
|
|
|
100300
100455
|
if (!toolName) {
|
|
100301
100456
|
throw new Error("Usage: posthog-cli api info [--json] <tool>");
|
|
100302
100457
|
}
|
|
100303
|
-
await
|
|
100458
|
+
await runStaticExecCommand(`info ${json2 ? "--json " : ""}${toolName}`);
|
|
100304
100459
|
return;
|
|
100305
100460
|
}
|
|
100306
100461
|
case "schema": {
|
|
@@ -100308,7 +100463,7 @@ async function main() {
|
|
|
100308
100463
|
if (!toolName) {
|
|
100309
100464
|
throw new Error("Usage: posthog-cli api schema <tool> [field.path]");
|
|
100310
100465
|
}
|
|
100311
|
-
await
|
|
100466
|
+
await runStaticExecCommand(`schema ${toolName}${args[0] ? ` ${args[0]}` : ""}`);
|
|
100312
100467
|
return;
|
|
100313
100468
|
}
|
|
100314
100469
|
case "call": {
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"hasInstallScript": true,
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"name": "@posthog/cli",
|
|
22
|
-
"version": "0.7.
|
|
22
|
+
"version": "0.7.29"
|
|
23
23
|
},
|
|
24
24
|
"node_modules/detect-libc": {
|
|
25
25
|
"engines": {
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
"requires": true,
|
|
51
|
-
"version": "0.7.
|
|
51
|
+
"version": "0.7.29"
|
|
52
52
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"artifactDownloadUrls": [
|
|
3
|
-
"https://github.com/PostHog/posthog/releases/download/posthog-cli/v0.7.
|
|
3
|
+
"https://github.com/PostHog/posthog/releases/download/posthog-cli/v0.7.29"
|
|
4
4
|
],
|
|
5
5
|
"bin": {
|
|
6
6
|
"posthog-cli": "run-posthog-cli.js"
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
"zipExt": ".tar.gz"
|
|
115
115
|
}
|
|
116
116
|
},
|
|
117
|
-
"version": "0.7.
|
|
117
|
+
"version": "0.7.29",
|
|
118
118
|
"volta": {
|
|
119
119
|
"node": "18.14.1",
|
|
120
120
|
"npm": "9.5.0"
|