@meetkai/mka1 0.54.44 → 0.54.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) hide show
  1. package/README.md +315 -303
  2. package/bin/mcp-server.js +3140 -2631
  3. package/bin/mcp-server.js.map +23 -12
  4. package/dist/commonjs/funcs/analyticsEventsSearch.d.ts +21 -0
  5. package/dist/commonjs/funcs/analyticsEventsSearch.d.ts.map +1 -0
  6. package/dist/commonjs/funcs/analyticsEventsSearch.js +140 -0
  7. package/dist/commonjs/funcs/analyticsEventsSearch.js.map +1 -0
  8. package/dist/commonjs/funcs/analyticsVisitorsSearch.d.ts +21 -0
  9. package/dist/commonjs/funcs/analyticsVisitorsSearch.d.ts.map +1 -0
  10. package/dist/commonjs/funcs/analyticsVisitorsSearch.js +140 -0
  11. package/dist/commonjs/funcs/analyticsVisitorsSearch.js.map +1 -0
  12. package/dist/commonjs/funcs/llmModelsListEffectivePrices.d.ts +1 -1
  13. package/dist/commonjs/funcs/llmModelsListEffectivePrices.js +1 -1
  14. package/dist/commonjs/lib/config.d.ts +2 -2
  15. package/dist/commonjs/lib/config.js +2 -2
  16. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  17. package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
  18. package/dist/commonjs/mcp-server/server.js +5 -1
  19. package/dist/commonjs/mcp-server/server.js.map +1 -1
  20. package/dist/commonjs/mcp-server/tools/analyticsEventsSearch.d.ts +8 -0
  21. package/dist/commonjs/mcp-server/tools/analyticsEventsSearch.d.ts.map +1 -0
  22. package/dist/commonjs/mcp-server/tools/analyticsEventsSearch.js +64 -0
  23. package/dist/commonjs/mcp-server/tools/analyticsEventsSearch.js.map +1 -0
  24. package/dist/commonjs/mcp-server/tools/analyticsVisitorsSearch.d.ts +8 -0
  25. package/dist/commonjs/mcp-server/tools/analyticsVisitorsSearch.d.ts.map +1 -0
  26. package/dist/commonjs/mcp-server/tools/analyticsVisitorsSearch.js +64 -0
  27. package/dist/commonjs/mcp-server/tools/analyticsVisitorsSearch.js.map +1 -0
  28. package/dist/commonjs/mcp-server/tools/llmModelsListEffectivePrices.js +1 -1
  29. package/dist/commonjs/mcp-server/tools/llmModelsListEffectivePrices.js.map +1 -1
  30. package/dist/commonjs/models/components/analyticsevent.d.ts +2 -2
  31. package/dist/commonjs/models/components/analyticseventsearchrequest.d.ts +110 -0
  32. package/dist/commonjs/models/components/analyticseventsearchrequest.d.ts.map +1 -0
  33. package/dist/commonjs/models/components/analyticseventsearchrequest.js +130 -0
  34. package/dist/commonjs/models/components/analyticseventsearchrequest.js.map +1 -0
  35. package/dist/commonjs/models/components/analyticseventsearchresponse.d.ts +26 -0
  36. package/dist/commonjs/models/components/analyticseventsearchresponse.d.ts.map +1 -0
  37. package/dist/commonjs/models/components/analyticseventsearchresponse.js +70 -0
  38. package/dist/commonjs/models/components/analyticseventsearchresponse.js.map +1 -0
  39. package/dist/commonjs/models/components/analyticsvisitor.d.ts +35 -0
  40. package/dist/commonjs/models/components/analyticsvisitor.d.ts.map +1 -0
  41. package/dist/commonjs/models/components/analyticsvisitor.js +79 -0
  42. package/dist/commonjs/models/components/analyticsvisitor.js.map +1 -0
  43. package/dist/commonjs/models/components/analyticsvisitorsearchrequest.d.ts +105 -0
  44. package/dist/commonjs/models/components/analyticsvisitorsearchrequest.d.ts.map +1 -0
  45. package/dist/commonjs/models/components/analyticsvisitorsearchrequest.js +126 -0
  46. package/dist/commonjs/models/components/analyticsvisitorsearchrequest.js.map +1 -0
  47. package/dist/commonjs/models/components/analyticsvisitorsearchresponse.d.ts +26 -0
  48. package/dist/commonjs/models/components/analyticsvisitorsearchresponse.d.ts.map +1 -0
  49. package/dist/commonjs/models/components/analyticsvisitorsearchresponse.js +70 -0
  50. package/dist/commonjs/models/components/analyticsvisitorsearchresponse.js.map +1 -0
  51. package/dist/commonjs/models/components/effectivepricerow.d.ts +3 -0
  52. package/dist/commonjs/models/components/effectivepricerow.d.ts.map +1 -1
  53. package/dist/commonjs/models/components/effectivepricerow.js +11 -0
  54. package/dist/commonjs/models/components/effectivepricerow.js.map +1 -1
  55. package/dist/commonjs/models/components/index.d.ts +5 -0
  56. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  57. package/dist/commonjs/models/components/index.js +5 -0
  58. package/dist/commonjs/models/components/index.js.map +1 -1
  59. package/dist/commonjs/models/operations/analyticseventssearch.d.ts +23 -0
  60. package/dist/commonjs/models/operations/analyticseventssearch.d.ts.map +1 -0
  61. package/dist/commonjs/models/operations/analyticseventssearch.js +70 -0
  62. package/dist/commonjs/models/operations/analyticseventssearch.js.map +1 -0
  63. package/dist/commonjs/models/operations/analyticsvisitorssearch.d.ts +23 -0
  64. package/dist/commonjs/models/operations/analyticsvisitorssearch.d.ts.map +1 -0
  65. package/dist/commonjs/models/operations/analyticsvisitorssearch.js +70 -0
  66. package/dist/commonjs/models/operations/analyticsvisitorssearch.js.map +1 -0
  67. package/dist/commonjs/models/operations/index.d.ts +2 -0
  68. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  69. package/dist/commonjs/models/operations/index.js +2 -0
  70. package/dist/commonjs/models/operations/index.js.map +1 -1
  71. package/dist/commonjs/react-query/analyticsEventsSearch.d.ts +30 -0
  72. package/dist/commonjs/react-query/analyticsEventsSearch.d.ts.map +1 -0
  73. package/dist/commonjs/react-query/analyticsEventsSearch.js +47 -0
  74. package/dist/commonjs/react-query/analyticsEventsSearch.js.map +1 -0
  75. package/dist/commonjs/react-query/analyticsVisitorsSearch.d.ts +30 -0
  76. package/dist/commonjs/react-query/analyticsVisitorsSearch.d.ts.map +1 -0
  77. package/dist/commonjs/react-query/analyticsVisitorsSearch.js +47 -0
  78. package/dist/commonjs/react-query/analyticsVisitorsSearch.js.map +1 -0
  79. package/dist/commonjs/react-query/index.d.ts +2 -0
  80. package/dist/commonjs/react-query/index.d.ts.map +1 -1
  81. package/dist/commonjs/react-query/index.js +2 -0
  82. package/dist/commonjs/react-query/index.js.map +1 -1
  83. package/dist/commonjs/react-query/llmModelsListEffectivePrices.d.ts +2 -2
  84. package/dist/commonjs/react-query/llmModelsListEffectivePrices.js +2 -2
  85. package/dist/commonjs/sdk/analytics.d.ts +6 -0
  86. package/dist/commonjs/sdk/analytics.d.ts.map +1 -1
  87. package/dist/commonjs/sdk/analytics.js +8 -0
  88. package/dist/commonjs/sdk/analytics.js.map +1 -1
  89. package/dist/commonjs/sdk/events.d.ts +13 -0
  90. package/dist/commonjs/sdk/events.d.ts.map +1 -0
  91. package/dist/commonjs/sdk/events.js +22 -0
  92. package/dist/commonjs/sdk/events.js.map +1 -0
  93. package/dist/commonjs/sdk/models.d.ts +1 -1
  94. package/dist/commonjs/sdk/models.js +1 -1
  95. package/dist/commonjs/sdk/visitors.d.ts +13 -0
  96. package/dist/commonjs/sdk/visitors.d.ts.map +1 -0
  97. package/dist/commonjs/sdk/visitors.js +22 -0
  98. package/dist/commonjs/sdk/visitors.js.map +1 -0
  99. package/dist/esm/funcs/analyticsEventsSearch.d.ts +21 -0
  100. package/dist/esm/funcs/analyticsEventsSearch.d.ts.map +1 -0
  101. package/dist/esm/funcs/analyticsEventsSearch.js +104 -0
  102. package/dist/esm/funcs/analyticsEventsSearch.js.map +1 -0
  103. package/dist/esm/funcs/analyticsVisitorsSearch.d.ts +21 -0
  104. package/dist/esm/funcs/analyticsVisitorsSearch.d.ts.map +1 -0
  105. package/dist/esm/funcs/analyticsVisitorsSearch.js +104 -0
  106. package/dist/esm/funcs/analyticsVisitorsSearch.js.map +1 -0
  107. package/dist/esm/funcs/llmModelsListEffectivePrices.d.ts +1 -1
  108. package/dist/esm/funcs/llmModelsListEffectivePrices.js +1 -1
  109. package/dist/esm/lib/config.d.ts +2 -2
  110. package/dist/esm/lib/config.js +2 -2
  111. package/dist/esm/mcp-server/mcp-server.js +1 -1
  112. package/dist/esm/mcp-server/server.d.ts.map +1 -1
  113. package/dist/esm/mcp-server/server.js +5 -1
  114. package/dist/esm/mcp-server/server.js.map +1 -1
  115. package/dist/esm/mcp-server/tools/analyticsEventsSearch.d.ts +8 -0
  116. package/dist/esm/mcp-server/tools/analyticsEventsSearch.d.ts.map +1 -0
  117. package/dist/esm/mcp-server/tools/analyticsEventsSearch.js +28 -0
  118. package/dist/esm/mcp-server/tools/analyticsEventsSearch.js.map +1 -0
  119. package/dist/esm/mcp-server/tools/analyticsVisitorsSearch.d.ts +8 -0
  120. package/dist/esm/mcp-server/tools/analyticsVisitorsSearch.d.ts.map +1 -0
  121. package/dist/esm/mcp-server/tools/analyticsVisitorsSearch.js +28 -0
  122. package/dist/esm/mcp-server/tools/analyticsVisitorsSearch.js.map +1 -0
  123. package/dist/esm/mcp-server/tools/llmModelsListEffectivePrices.js +1 -1
  124. package/dist/esm/mcp-server/tools/llmModelsListEffectivePrices.js.map +1 -1
  125. package/dist/esm/models/components/analyticsevent.d.ts +2 -2
  126. package/dist/esm/models/components/analyticseventsearchrequest.d.ts +110 -0
  127. package/dist/esm/models/components/analyticseventsearchrequest.d.ts.map +1 -0
  128. package/dist/esm/models/components/analyticseventsearchrequest.js +88 -0
  129. package/dist/esm/models/components/analyticseventsearchrequest.js.map +1 -0
  130. package/dist/esm/models/components/analyticseventsearchresponse.d.ts +26 -0
  131. package/dist/esm/models/components/analyticseventsearchresponse.d.ts.map +1 -0
  132. package/dist/esm/models/components/analyticseventsearchresponse.js +32 -0
  133. package/dist/esm/models/components/analyticseventsearchresponse.js.map +1 -0
  134. package/dist/esm/models/components/analyticsvisitor.d.ts +35 -0
  135. package/dist/esm/models/components/analyticsvisitor.d.ts.map +1 -0
  136. package/dist/esm/models/components/analyticsvisitor.js +41 -0
  137. package/dist/esm/models/components/analyticsvisitor.js.map +1 -0
  138. package/dist/esm/models/components/analyticsvisitorsearchrequest.d.ts +105 -0
  139. package/dist/esm/models/components/analyticsvisitorsearchrequest.d.ts.map +1 -0
  140. package/dist/esm/models/components/analyticsvisitorsearchrequest.js +84 -0
  141. package/dist/esm/models/components/analyticsvisitorsearchrequest.js.map +1 -0
  142. package/dist/esm/models/components/analyticsvisitorsearchresponse.d.ts +26 -0
  143. package/dist/esm/models/components/analyticsvisitorsearchresponse.d.ts.map +1 -0
  144. package/dist/esm/models/components/analyticsvisitorsearchresponse.js +32 -0
  145. package/dist/esm/models/components/analyticsvisitorsearchresponse.js.map +1 -0
  146. package/dist/esm/models/components/effectivepricerow.d.ts +3 -0
  147. package/dist/esm/models/components/effectivepricerow.d.ts.map +1 -1
  148. package/dist/esm/models/components/effectivepricerow.js +11 -0
  149. package/dist/esm/models/components/effectivepricerow.js.map +1 -1
  150. package/dist/esm/models/components/index.d.ts +5 -0
  151. package/dist/esm/models/components/index.d.ts.map +1 -1
  152. package/dist/esm/models/components/index.js +5 -0
  153. package/dist/esm/models/components/index.js.map +1 -1
  154. package/dist/esm/models/operations/analyticseventssearch.d.ts +23 -0
  155. package/dist/esm/models/operations/analyticseventssearch.d.ts.map +1 -0
  156. package/dist/esm/models/operations/analyticseventssearch.js +32 -0
  157. package/dist/esm/models/operations/analyticseventssearch.js.map +1 -0
  158. package/dist/esm/models/operations/analyticsvisitorssearch.d.ts +23 -0
  159. package/dist/esm/models/operations/analyticsvisitorssearch.d.ts.map +1 -0
  160. package/dist/esm/models/operations/analyticsvisitorssearch.js +32 -0
  161. package/dist/esm/models/operations/analyticsvisitorssearch.js.map +1 -0
  162. package/dist/esm/models/operations/index.d.ts +2 -0
  163. package/dist/esm/models/operations/index.d.ts.map +1 -1
  164. package/dist/esm/models/operations/index.js +2 -0
  165. package/dist/esm/models/operations/index.js.map +1 -1
  166. package/dist/esm/react-query/analyticsEventsSearch.d.ts +30 -0
  167. package/dist/esm/react-query/analyticsEventsSearch.d.ts.map +1 -0
  168. package/dist/esm/react-query/analyticsEventsSearch.js +42 -0
  169. package/dist/esm/react-query/analyticsEventsSearch.js.map +1 -0
  170. package/dist/esm/react-query/analyticsVisitorsSearch.d.ts +30 -0
  171. package/dist/esm/react-query/analyticsVisitorsSearch.d.ts.map +1 -0
  172. package/dist/esm/react-query/analyticsVisitorsSearch.js +42 -0
  173. package/dist/esm/react-query/analyticsVisitorsSearch.js.map +1 -0
  174. package/dist/esm/react-query/index.d.ts +2 -0
  175. package/dist/esm/react-query/index.d.ts.map +1 -1
  176. package/dist/esm/react-query/index.js +2 -0
  177. package/dist/esm/react-query/index.js.map +1 -1
  178. package/dist/esm/react-query/llmModelsListEffectivePrices.d.ts +2 -2
  179. package/dist/esm/react-query/llmModelsListEffectivePrices.js +2 -2
  180. package/dist/esm/sdk/analytics.d.ts +6 -0
  181. package/dist/esm/sdk/analytics.d.ts.map +1 -1
  182. package/dist/esm/sdk/analytics.js +8 -0
  183. package/dist/esm/sdk/analytics.js.map +1 -1
  184. package/dist/esm/sdk/events.d.ts +13 -0
  185. package/dist/esm/sdk/events.d.ts.map +1 -0
  186. package/dist/esm/sdk/events.js +18 -0
  187. package/dist/esm/sdk/events.js.map +1 -0
  188. package/dist/esm/sdk/models.d.ts +1 -1
  189. package/dist/esm/sdk/models.js +1 -1
  190. package/dist/esm/sdk/visitors.d.ts +13 -0
  191. package/dist/esm/sdk/visitors.d.ts.map +1 -0
  192. package/dist/esm/sdk/visitors.js +18 -0
  193. package/dist/esm/sdk/visitors.js.map +1 -0
  194. package/jsr.json +1 -1
  195. package/package.json +1 -1
  196. package/src/funcs/analyticsEventsSearch.ts +199 -0
  197. package/src/funcs/analyticsVisitorsSearch.ts +199 -0
  198. package/src/funcs/llmModelsListEffectivePrices.ts +1 -1
  199. package/src/lib/config.ts +2 -2
  200. package/src/mcp-server/mcp-server.ts +1 -1
  201. package/src/mcp-server/server.ts +5 -1
  202. package/src/mcp-server/tools/analyticsEventsSearch.ts +37 -0
  203. package/src/mcp-server/tools/analyticsVisitorsSearch.ts +37 -0
  204. package/src/mcp-server/tools/llmModelsListEffectivePrices.ts +1 -1
  205. package/src/models/components/analyticsevent.ts +2 -2
  206. package/src/models/components/analyticseventsearchrequest.ts +249 -0
  207. package/src/models/components/analyticseventsearchresponse.ts +78 -0
  208. package/src/models/components/analyticsvisitor.ts +90 -0
  209. package/src/models/components/analyticsvisitorsearchrequest.ts +241 -0
  210. package/src/models/components/analyticsvisitorsearchresponse.ts +78 -0
  211. package/src/models/components/effectivepricerow.ts +13 -0
  212. package/src/models/components/index.ts +5 -0
  213. package/src/models/operations/analyticseventssearch.ts +72 -0
  214. package/src/models/operations/analyticsvisitorssearch.ts +73 -0
  215. package/src/models/operations/index.ts +2 -0
  216. package/src/react-query/analyticsEventsSearch.ts +112 -0
  217. package/src/react-query/analyticsVisitorsSearch.ts +112 -0
  218. package/src/react-query/index.ts +2 -0
  219. package/src/react-query/llmModelsListEffectivePrices.ts +2 -2
  220. package/src/sdk/analytics.ts +12 -0
  221. package/src/sdk/events.ts +28 -0
  222. package/src/sdk/models.ts +1 -1
  223. package/src/sdk/visitors.ts +28 -0
@@ -0,0 +1,199 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { SDKCore } from "../core.js";
6
+ import { encodeJSON, encodeSimple } from "../lib/encodings.js";
7
+ import { matchStatusCode } from "../lib/http.js";
8
+ import * as M from "../lib/matchers.js";
9
+ import { compactMap } from "../lib/primitives.js";
10
+ import { safeParse } from "../lib/schemas.js";
11
+ import { RequestOptions } from "../lib/sdks.js";
12
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
13
+ import { pathToFunc } from "../lib/url.js";
14
+ import * as components from "../models/components/index.js";
15
+ import {
16
+ ConnectionError,
17
+ InvalidRequestError,
18
+ RequestAbortedError,
19
+ RequestTimeoutError,
20
+ UnexpectedClientError,
21
+ } from "../models/errors/httpclienterrors.js";
22
+ import * as errors from "../models/errors/index.js";
23
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
24
+ import { SDKError } from "../models/errors/sdkerror.js";
25
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
26
+ import * as operations from "../models/operations/index.js";
27
+ import { APICall, APIPromise } from "../types/async.js";
28
+ import { Result } from "../types/fp.js";
29
+
30
+ /**
31
+ * Search visitors in a time range
32
+ *
33
+ * @remarks
34
+ * List visitors with matching events in a time range, most recently active first. Each visitor is one distinct_id with the timestamps of its first and last matching event and its event count over the whole range, so for a range that receives no further events the number of visitors across all pages equals the unique_visitors query for the same range and filters. The range includes from and excludes to, and duplicate event IDs are counted once. A page holds up to 100 visitors; pass next_cursor as cursor for the following page until it is null. The first page takes a snapshot from ClickHouse's clock before reading its rows and its cursor carries it, so every page of the sequence, the first included, reads only deliveries received at or before that snapshot and ages events out of retention as of it: a visitor keeps the position, first_seen, last_seen and event_count the sequence started with, no visitor repeats or is skipped, and activity received after the snapshot appears only when paging restarts without a cursor. One window blurs that boundary: ClickHouse stamps a receipt at whole seconds when an insert starts and commits its rows when it finishes, so a delivery stamped in or before the snapshot's second that commits after the first page was read is inside the sequence but missing from the first page; it joins from the next page, where an unlisted visitor it adds or moves ahead of the cursor is skipped and a listed visitor whose winning delivery a lower-hash redelivery moves behind the cursor repeats with revised totals; a listed visitor's totals otherwise stay as listed. A cursor that does not decode, or one from another list, returns 400.
35
+ *
36
+ * If set, this operation will use {@link Security.bearerAuth} from the global security.
37
+ */
38
+ export function analyticsVisitorsSearch(
39
+ client: SDKCore,
40
+ request: operations.AnalyticsVisitorsSearchRequest,
41
+ options?: RequestOptions,
42
+ ): APIPromise<
43
+ Result<
44
+ components.AnalyticsVisitorSearchResponse,
45
+ | errors.AnalyticsError
46
+ | SDKError
47
+ | ResponseValidationError
48
+ | ConnectionError
49
+ | RequestAbortedError
50
+ | RequestTimeoutError
51
+ | InvalidRequestError
52
+ | UnexpectedClientError
53
+ | SDKValidationError
54
+ >
55
+ > {
56
+ return new APIPromise($do(
57
+ client,
58
+ request,
59
+ options,
60
+ ));
61
+ }
62
+
63
+ async function $do(
64
+ client: SDKCore,
65
+ request: operations.AnalyticsVisitorsSearchRequest,
66
+ options?: RequestOptions,
67
+ ): Promise<
68
+ [
69
+ Result<
70
+ components.AnalyticsVisitorSearchResponse,
71
+ | errors.AnalyticsError
72
+ | SDKError
73
+ | ResponseValidationError
74
+ | ConnectionError
75
+ | RequestAbortedError
76
+ | RequestTimeoutError
77
+ | InvalidRequestError
78
+ | UnexpectedClientError
79
+ | SDKValidationError
80
+ >,
81
+ APICall,
82
+ ]
83
+ > {
84
+ const parsed = safeParse(
85
+ request,
86
+ (value) =>
87
+ operations.AnalyticsVisitorsSearchRequest$outboundSchema.parse(value),
88
+ "Input validation failed",
89
+ );
90
+ if (!parsed.ok) {
91
+ return [parsed, { status: "invalid" }];
92
+ }
93
+ const payload = parsed.value;
94
+ const body = encodeJSON("body", payload.AnalyticsVisitorSearchRequest, {
95
+ explode: true,
96
+ });
97
+
98
+ const pathParams = {
99
+ id: encodeSimple("id", payload.id, {
100
+ explode: false,
101
+ charEncoding: "percent",
102
+ }),
103
+ };
104
+ const path = pathToFunc("/api/v1/analytics/projects/{id}/visitors/search")(
105
+ pathParams,
106
+ );
107
+
108
+ const headers = new Headers(compactMap({
109
+ "Content-Type": "application/json",
110
+ Accept: "application/json",
111
+ }));
112
+
113
+ const secConfig = await extractSecurity(client._options.bearerAuth);
114
+ const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
115
+ const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
116
+
117
+ const context = {
118
+ options: client._options,
119
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
120
+ operationID: "analytics_visitors_search",
121
+ oAuth2Scopes: null,
122
+
123
+ resolvedSecurity: requestSecurity,
124
+
125
+ securitySource: client._options.bearerAuth,
126
+ retryConfig: options?.retries
127
+ || client._options.retryConfig
128
+ || {
129
+ strategy: "backoff",
130
+ backoff: {
131
+ initialInterval: 500,
132
+ maxInterval: 5000,
133
+ exponent: 1.5,
134
+ maxElapsedTime: 15000,
135
+ },
136
+ retryConnectionErrors: true,
137
+ }
138
+ || { strategy: "none" },
139
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
140
+ };
141
+
142
+ const requestRes = client._createRequest(context, {
143
+ security: requestSecurity,
144
+ method: "POST",
145
+ baseURL: options?.serverURL,
146
+ path: path,
147
+ headers: headers,
148
+ body: body,
149
+ userAgent: client._options.userAgent,
150
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
151
+ }, options);
152
+ if (!requestRes.ok) {
153
+ return [requestRes, { status: "invalid" }];
154
+ }
155
+ const req = requestRes.value;
156
+
157
+ const doResult = await client._do(req, {
158
+ context,
159
+ isErrorStatusCode: (statusCode: number) =>
160
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
161
+ retryConfig: context.retryConfig,
162
+ retryCodes: context.retryCodes,
163
+ });
164
+ if (!doResult.ok) {
165
+ return [doResult, { status: "request-error", request: req }];
166
+ }
167
+ const response = doResult.value;
168
+
169
+ const responseFields = {
170
+ HttpMeta: { Response: response, Request: req },
171
+ };
172
+
173
+ const [result] = await M.match<
174
+ components.AnalyticsVisitorSearchResponse,
175
+ | errors.AnalyticsError
176
+ | SDKError
177
+ | ResponseValidationError
178
+ | ConnectionError
179
+ | RequestAbortedError
180
+ | RequestTimeoutError
181
+ | InvalidRequestError
182
+ | UnexpectedClientError
183
+ | SDKValidationError
184
+ >(
185
+ M.json(200, components.AnalyticsVisitorSearchResponse$inboundSchema),
186
+ M.jsonErr(
187
+ [400, 401, 403, 404, 409, 413, 415, 429],
188
+ errors.AnalyticsError$inboundSchema,
189
+ ),
190
+ M.jsonErr([500, 503], errors.AnalyticsError$inboundSchema),
191
+ M.fail("4XX"),
192
+ M.fail("5XX"),
193
+ )(response, req, { extraFields: responseFields });
194
+ if (!result.ok) {
195
+ return [result, { status: "complete", request: req, response }];
196
+ }
197
+
198
+ return [result, { status: "complete", request: req, response }];
199
+ }
@@ -30,7 +30,7 @@ import { Result } from "../types/fp.js";
30
30
  * List effective prices for the caller's models
31
31
  *
32
32
  * @remarks
33
- * For every active model, returns its registry-aware price: an org row, a cluster default for cluster lineage, or unpriced ($0).
33
+ * For every active model, returns its registry-aware price: an org row, a cluster default for cluster lineage, or unpriced ($0). Also lists the `auto` routing alias, priced at the per-metric maximum across every model it can be billed as (`resolves_to`): a judge policy's active candidates, or the direct/YAML target plus any reroute target it can fall through to.
34
34
  *
35
35
  * If set, this operation will use {@link Security.bearerAuth} from the global security.
36
36
  */
package/src/lib/config.ts CHANGED
@@ -65,7 +65,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
65
65
  export const SDK_METADATA = {
66
66
  language: "typescript",
67
67
  openapiDocVersion: "1.1.0",
68
- sdkVersion: "0.54.44",
68
+ sdkVersion: "0.54.46",
69
69
  genVersion: "2.938.0",
70
- userAgent: "speakeasy-sdk/typescript 0.54.44 2.938.0 1.1.0 @meetkai/mka1",
70
+ userAgent: "speakeasy-sdk/typescript 0.54.46 2.938.0 1.1.0 @meetkai/mka1",
71
71
  } as const;
@@ -19,7 +19,7 @@ const routes = buildRouteMap({
19
19
  export const app = buildApplication(routes, {
20
20
  name: "mcp",
21
21
  versionInfo: {
22
- currentVersion: "0.54.44",
22
+ currentVersion: "0.54.46",
23
23
  },
24
24
  });
25
25
 
@@ -40,6 +40,7 @@ import { tool$agentsUpdateAgent } from "./tools/agentsUpdateAgent.js";
40
40
  import { tool$agentVersionsGetAgentVersion } from "./tools/agentVersionsGetAgentVersion.js";
41
41
  import { tool$agentVersionsListAgentVersions } from "./tools/agentVersionsListAgentVersions.js";
42
42
  import { tool$agentVersionsRollbackAgentVersion } from "./tools/agentVersionsRollbackAgentVersion.js";
43
+ import { tool$analyticsEventsSearch } from "./tools/analyticsEventsSearch.js";
43
44
  import { tool$analyticsKeysCreate } from "./tools/analyticsKeysCreate.js";
44
45
  import { tool$analyticsKeysList } from "./tools/analyticsKeysList.js";
45
46
  import { tool$analyticsKeysRevoke } from "./tools/analyticsKeysRevoke.js";
@@ -49,6 +50,7 @@ import { tool$analyticsProjectsGet } from "./tools/analyticsProjectsGet.js";
49
50
  import { tool$analyticsProjectsList } from "./tools/analyticsProjectsList.js";
50
51
  import { tool$analyticsProjectsUpdate } from "./tools/analyticsProjectsUpdate.js";
51
52
  import { tool$analyticsQuery } from "./tools/analyticsQuery.js";
53
+ import { tool$analyticsVisitorsSearch } from "./tools/analyticsVisitorsSearch.js";
52
54
  import { tool$authApiKeyGetJwtFromKey } from "./tools/authApiKeyGetJwtFromKey.js";
53
55
  import { tool$authApiKeysCreate } from "./tools/authApiKeysCreate.js";
54
56
  import { tool$authApiKeysExchangeToken } from "./tools/authApiKeysExchangeToken.js";
@@ -440,7 +442,7 @@ export function createMCPServer(deps: {
440
442
  }) {
441
443
  const server = new McpServer({
442
444
  name: "SDK",
443
- version: "0.54.44",
445
+ version: "0.54.46",
444
446
  });
445
447
 
446
448
  const client = new SDKCore({
@@ -898,6 +900,8 @@ export function createMCPServer(deps: {
898
900
  tool(tool$analyticsKeysCreate);
899
901
  tool(tool$analyticsKeysList);
900
902
  tool(tool$analyticsKeysRevoke);
903
+ tool(tool$analyticsEventsSearch);
904
+ tool(tool$analyticsVisitorsSearch);
901
905
 
902
906
  return server;
903
907
  }
@@ -0,0 +1,37 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { analyticsEventsSearch } from "../../funcs/analyticsEventsSearch.js";
6
+ import * as operations from "../../models/operations/index.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: operations.AnalyticsEventsSearchRequest$inboundSchema,
11
+ };
12
+
13
+ export const tool$analyticsEventsSearch: ToolDefinition<typeof args> = {
14
+ name: "analytics-events-search",
15
+ description: `Search events in a time range
16
+
17
+ List individual events in a time range, newest first, with their properties. Optionally filter by event name, event properties, or one visitor's distinct_id. The range includes from and excludes to, and duplicate event IDs are returned once, so a search over a chart bucket's range with the same filters lists exactly the events that bucket counted. A page holds up to 100 events; pass next_cursor as cursor for the following page until it is null. The first page takes a snapshot from ClickHouse's clock before reading its rows and its cursor carries it, so every page of the sequence, the first included, reads only deliveries received at or before that snapshot and ages events out of retention as of it: no event repeats or is skipped, and events received after the snapshot, including a redelivery that revises a listed event, appear only when paging restarts without a cursor. One window blurs that boundary: ClickHouse stamps a receipt at whole seconds when an insert starts and commits its rows when it finishes, so a delivery stamped in or before the snapshot's second that commits after the first page was read is inside the sequence but missing from the first page; it joins from the next page, where an unlisted event it adds or moves ahead of the cursor is skipped and a listed event that a lower-hash redelivery moves behind the cursor repeats at its revised position. A cursor that does not decode, or one from another list, returns 400. A page whose events exceed the response size limit returns 413; request a smaller limit.`,
18
+ args,
19
+ tool: async (client, args, ctx) => {
20
+ const [result, apiCall] = await analyticsEventsSearch(
21
+ client,
22
+ args.request,
23
+ { fetchOptions: { signal: ctx.signal } },
24
+ ).$inspect();
25
+
26
+ if (!result.ok) {
27
+ return {
28
+ content: [{ type: "text", text: result.error.message }],
29
+ isError: true,
30
+ };
31
+ }
32
+
33
+ const value = result.value;
34
+
35
+ return formatResult(value, apiCall);
36
+ },
37
+ };
@@ -0,0 +1,37 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { analyticsVisitorsSearch } from "../../funcs/analyticsVisitorsSearch.js";
6
+ import * as operations from "../../models/operations/index.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: operations.AnalyticsVisitorsSearchRequest$inboundSchema,
11
+ };
12
+
13
+ export const tool$analyticsVisitorsSearch: ToolDefinition<typeof args> = {
14
+ name: "analytics-visitors-search",
15
+ description: `Search visitors in a time range
16
+
17
+ List visitors with matching events in a time range, most recently active first. Each visitor is one distinct_id with the timestamps of its first and last matching event and its event count over the whole range, so for a range that receives no further events the number of visitors across all pages equals the unique_visitors query for the same range and filters. The range includes from and excludes to, and duplicate event IDs are counted once. A page holds up to 100 visitors; pass next_cursor as cursor for the following page until it is null. The first page takes a snapshot from ClickHouse's clock before reading its rows and its cursor carries it, so every page of the sequence, the first included, reads only deliveries received at or before that snapshot and ages events out of retention as of it: a visitor keeps the position, first_seen, last_seen and event_count the sequence started with, no visitor repeats or is skipped, and activity received after the snapshot appears only when paging restarts without a cursor. One window blurs that boundary: ClickHouse stamps a receipt at whole seconds when an insert starts and commits its rows when it finishes, so a delivery stamped in or before the snapshot's second that commits after the first page was read is inside the sequence but missing from the first page; it joins from the next page, where an unlisted visitor it adds or moves ahead of the cursor is skipped and a listed visitor whose winning delivery a lower-hash redelivery moves behind the cursor repeats with revised totals; a listed visitor's totals otherwise stay as listed. A cursor that does not decode, or one from another list, returns 400.`,
18
+ args,
19
+ tool: async (client, args, ctx) => {
20
+ const [result, apiCall] = await analyticsVisitorsSearch(
21
+ client,
22
+ args.request,
23
+ { fetchOptions: { signal: ctx.signal } },
24
+ ).$inspect();
25
+
26
+ if (!result.ok) {
27
+ return {
28
+ content: [{ type: "text", text: result.error.message }],
29
+ isError: true,
30
+ };
31
+ }
32
+
33
+ const value = result.value;
34
+
35
+ return formatResult(value, apiCall);
36
+ },
37
+ };
@@ -14,7 +14,7 @@ export const tool$llmModelsListEffectivePrices: ToolDefinition<typeof args> = {
14
14
  name: "llm-models-list-effective-prices",
15
15
  description: `List effective prices for the caller's models
16
16
 
17
- For every active model, returns its registry-aware price: an org row, a cluster default for cluster lineage, or unpriced ($0).`,
17
+ For every active model, returns its registry-aware price: an org row, a cluster default for cluster lineage, or unpriced ($0). Also lists the \`auto\` routing alias, priced at the per-metric maximum across every model it can be billed as (\`resolves_to\`): a judge policy's active candidates, or the direct/YAML target plus any reroute target it can fall through to.`,
18
18
  args,
19
19
  tool: async (client, args, ctx) => {
20
20
  const [result, apiCall] = await llmModelsListEffectivePrices(
@@ -20,11 +20,11 @@ export type AnalyticsEvent = {
20
20
  */
21
21
  eventName: string;
22
22
  /**
23
- * When the event occurred. Use an ISO 8601 timestamp with Z for UTC or an offset such as -07:00. Send current timestamps for new events.
23
+ * When the event occurred. Use an ISO 8601 timestamp with Z for UTC or an offset such as -07:00. Send current timestamps for new events. Event search returns it in UTC with milliseconds, ending in Z.
24
24
  */
25
25
  timestamp: Date;
26
26
  /**
27
- * Your identifier for the visitor. Unique visitor queries count distinct values of this field.
27
+ * Your identifier for the visitor. Unique visitor queries count distinct values of this field, and visitor search lists one visitor per value.
28
28
  */
29
29
  distinctId: string;
30
30
  /**
@@ -0,0 +1,249 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { ClosedEnum } from "../../types/enums.js";
9
+ import { Result as SafeParseResult } from "../../types/fp.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ /**
13
+ * Comparison operator. gt, gte, lt, and lte require a numeric value. exists and not_exists check whether the property is present and do not take a value.
14
+ */
15
+ export const AnalyticsEventSearchRequestOp = {
16
+ Eq: "eq",
17
+ Neq: "neq",
18
+ Gt: "gt",
19
+ Gte: "gte",
20
+ Lt: "lt",
21
+ Lte: "lte",
22
+ Exists: "exists",
23
+ NotExists: "not_exists",
24
+ } as const;
25
+ /**
26
+ * Comparison operator. gt, gte, lt, and lte require a numeric value. exists and not_exists check whether the property is present and do not take a value.
27
+ */
28
+ export type AnalyticsEventSearchRequestOp = ClosedEnum<
29
+ typeof AnalyticsEventSearchRequestOp
30
+ >;
31
+
32
+ /**
33
+ * Value to compare. The number 1 differs from the string '1'. Omit for exists and not_exists.
34
+ */
35
+ export type AnalyticsEventSearchRequestValue = string | number | boolean;
36
+
37
+ export type AnalyticsEventSearchRequestFilters = {
38
+ /**
39
+ * Event property to filter. Property names are literal keys, not nested paths.
40
+ */
41
+ property: string;
42
+ /**
43
+ * Comparison operator. gt, gte, lt, and lte require a numeric value. exists and not_exists check whether the property is present and do not take a value.
44
+ */
45
+ op: AnalyticsEventSearchRequestOp;
46
+ /**
47
+ * Value to compare. The number 1 differs from the string '1'. Omit for exists and not_exists.
48
+ */
49
+ value?: string | number | boolean | null | undefined;
50
+ };
51
+
52
+ export type AnalyticsEventSearchRequest = {
53
+ /**
54
+ * Start of the time range, inclusive. Use an ISO 8601 timestamp with Z for UTC or an offset such as -07:00. Must be before to.
55
+ */
56
+ from: Date;
57
+ /**
58
+ * End of the time range, exclusive. Use an ISO 8601 timestamp with Z for UTC or an offset such as -07:00. Must be after from.
59
+ */
60
+ to: Date;
61
+ /**
62
+ * Only include events with this exact name. Omit to include all event names.
63
+ */
64
+ eventName?: string | undefined;
65
+ /**
66
+ * Property filters combined with AND. An event must match every filter.
67
+ */
68
+ filters?: Array<AnalyticsEventSearchRequestFilters> | undefined;
69
+ /**
70
+ * Only include events sent with this exact distinct_id.
71
+ */
72
+ distinctId?: string | undefined;
73
+ /**
74
+ * Maximum number of rows in this page.
75
+ */
76
+ limit?: number | undefined;
77
+ /**
78
+ * Opaque cursor of at most 4096 characters, copied from next_cursor of the previous page. Omit for the first page, which takes the snapshot the whole sequence reads at. Cursors belong to one list and one sort order; a cursor that does not decode, or one from another list, returns 400. A cursor is a position, not a capability: one that decodes only moves the caller within the same project.
79
+ */
80
+ cursor?: string | undefined;
81
+ };
82
+
83
+ /** @internal */
84
+ export const AnalyticsEventSearchRequestOp$inboundSchema: z.ZodNativeEnum<
85
+ typeof AnalyticsEventSearchRequestOp
86
+ > = z.nativeEnum(AnalyticsEventSearchRequestOp);
87
+ /** @internal */
88
+ export const AnalyticsEventSearchRequestOp$outboundSchema: z.ZodNativeEnum<
89
+ typeof AnalyticsEventSearchRequestOp
90
+ > = AnalyticsEventSearchRequestOp$inboundSchema;
91
+
92
+ /** @internal */
93
+ export const AnalyticsEventSearchRequestValue$inboundSchema: z.ZodType<
94
+ AnalyticsEventSearchRequestValue,
95
+ z.ZodTypeDef,
96
+ unknown
97
+ > = z.union([z.string(), z.number(), z.boolean()]);
98
+ /** @internal */
99
+ export type AnalyticsEventSearchRequestValue$Outbound =
100
+ | string
101
+ | number
102
+ | boolean;
103
+
104
+ /** @internal */
105
+ export const AnalyticsEventSearchRequestValue$outboundSchema: z.ZodType<
106
+ AnalyticsEventSearchRequestValue$Outbound,
107
+ z.ZodTypeDef,
108
+ AnalyticsEventSearchRequestValue
109
+ > = z.union([z.string(), z.number(), z.boolean()]);
110
+
111
+ export function analyticsEventSearchRequestValueToJSON(
112
+ analyticsEventSearchRequestValue: AnalyticsEventSearchRequestValue,
113
+ ): string {
114
+ return JSON.stringify(
115
+ AnalyticsEventSearchRequestValue$outboundSchema.parse(
116
+ analyticsEventSearchRequestValue,
117
+ ),
118
+ );
119
+ }
120
+ export function analyticsEventSearchRequestValueFromJSON(
121
+ jsonString: string,
122
+ ): SafeParseResult<AnalyticsEventSearchRequestValue, SDKValidationError> {
123
+ return safeParse(
124
+ jsonString,
125
+ (x) => AnalyticsEventSearchRequestValue$inboundSchema.parse(JSON.parse(x)),
126
+ `Failed to parse 'AnalyticsEventSearchRequestValue' from JSON`,
127
+ );
128
+ }
129
+
130
+ /** @internal */
131
+ export const AnalyticsEventSearchRequestFilters$inboundSchema: z.ZodType<
132
+ AnalyticsEventSearchRequestFilters,
133
+ z.ZodTypeDef,
134
+ unknown
135
+ > = z.object({
136
+ property: z.string(),
137
+ op: AnalyticsEventSearchRequestOp$inboundSchema,
138
+ value: z.nullable(z.union([z.string(), z.number(), z.boolean()])).optional(),
139
+ });
140
+ /** @internal */
141
+ export type AnalyticsEventSearchRequestFilters$Outbound = {
142
+ property: string;
143
+ op: string;
144
+ value?: string | number | boolean | null | undefined;
145
+ };
146
+
147
+ /** @internal */
148
+ export const AnalyticsEventSearchRequestFilters$outboundSchema: z.ZodType<
149
+ AnalyticsEventSearchRequestFilters$Outbound,
150
+ z.ZodTypeDef,
151
+ AnalyticsEventSearchRequestFilters
152
+ > = z.object({
153
+ property: z.string(),
154
+ op: AnalyticsEventSearchRequestOp$outboundSchema,
155
+ value: z.nullable(z.union([z.string(), z.number(), z.boolean()])).optional(),
156
+ });
157
+
158
+ export function analyticsEventSearchRequestFiltersToJSON(
159
+ analyticsEventSearchRequestFilters: AnalyticsEventSearchRequestFilters,
160
+ ): string {
161
+ return JSON.stringify(
162
+ AnalyticsEventSearchRequestFilters$outboundSchema.parse(
163
+ analyticsEventSearchRequestFilters,
164
+ ),
165
+ );
166
+ }
167
+ export function analyticsEventSearchRequestFiltersFromJSON(
168
+ jsonString: string,
169
+ ): SafeParseResult<AnalyticsEventSearchRequestFilters, SDKValidationError> {
170
+ return safeParse(
171
+ jsonString,
172
+ (x) =>
173
+ AnalyticsEventSearchRequestFilters$inboundSchema.parse(JSON.parse(x)),
174
+ `Failed to parse 'AnalyticsEventSearchRequestFilters' from JSON`,
175
+ );
176
+ }
177
+
178
+ /** @internal */
179
+ export const AnalyticsEventSearchRequest$inboundSchema: z.ZodType<
180
+ AnalyticsEventSearchRequest,
181
+ z.ZodTypeDef,
182
+ unknown
183
+ > = z.object({
184
+ from: z.string().datetime({ offset: true }).transform(v => new Date(v)),
185
+ to: z.string().datetime({ offset: true }).transform(v => new Date(v)),
186
+ event_name: z.string().optional(),
187
+ filters: z.array(
188
+ z.lazy(() => AnalyticsEventSearchRequestFilters$inboundSchema),
189
+ ).optional(),
190
+ distinct_id: z.string().optional(),
191
+ limit: z.number().int().default(50),
192
+ cursor: z.string().optional(),
193
+ }).transform((v) => {
194
+ return remap$(v, {
195
+ "event_name": "eventName",
196
+ "distinct_id": "distinctId",
197
+ });
198
+ });
199
+ /** @internal */
200
+ export type AnalyticsEventSearchRequest$Outbound = {
201
+ from: string;
202
+ to: string;
203
+ event_name?: string | undefined;
204
+ filters?: Array<AnalyticsEventSearchRequestFilters$Outbound> | undefined;
205
+ distinct_id?: string | undefined;
206
+ limit: number;
207
+ cursor?: string | undefined;
208
+ };
209
+
210
+ /** @internal */
211
+ export const AnalyticsEventSearchRequest$outboundSchema: z.ZodType<
212
+ AnalyticsEventSearchRequest$Outbound,
213
+ z.ZodTypeDef,
214
+ AnalyticsEventSearchRequest
215
+ > = z.object({
216
+ from: z.date().transform(v => v.toISOString()),
217
+ to: z.date().transform(v => v.toISOString()),
218
+ eventName: z.string().optional(),
219
+ filters: z.array(
220
+ z.lazy(() => AnalyticsEventSearchRequestFilters$outboundSchema),
221
+ ).optional(),
222
+ distinctId: z.string().optional(),
223
+ limit: z.number().int().default(50),
224
+ cursor: z.string().optional(),
225
+ }).transform((v) => {
226
+ return remap$(v, {
227
+ eventName: "event_name",
228
+ distinctId: "distinct_id",
229
+ });
230
+ });
231
+
232
+ export function analyticsEventSearchRequestToJSON(
233
+ analyticsEventSearchRequest: AnalyticsEventSearchRequest,
234
+ ): string {
235
+ return JSON.stringify(
236
+ AnalyticsEventSearchRequest$outboundSchema.parse(
237
+ analyticsEventSearchRequest,
238
+ ),
239
+ );
240
+ }
241
+ export function analyticsEventSearchRequestFromJSON(
242
+ jsonString: string,
243
+ ): SafeParseResult<AnalyticsEventSearchRequest, SDKValidationError> {
244
+ return safeParse(
245
+ jsonString,
246
+ (x) => AnalyticsEventSearchRequest$inboundSchema.parse(JSON.parse(x)),
247
+ `Failed to parse 'AnalyticsEventSearchRequest' from JSON`,
248
+ );
249
+ }