@meetkai/mka1 0.54.71 → 0.54.73

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 (179) hide show
  1. package/README.md +307 -304
  2. package/bin/mcp-server.js +1691 -1486
  3. package/bin/mcp-server.js.map +23 -18
  4. package/dist/commonjs/funcs/llmEvalsMeasureSuiteTokens.d.ts +20 -0
  5. package/dist/commonjs/funcs/llmEvalsMeasureSuiteTokens.d.ts.map +1 -0
  6. package/dist/commonjs/funcs/llmEvalsMeasureSuiteTokens.js +137 -0
  7. package/dist/commonjs/funcs/llmEvalsMeasureSuiteTokens.js.map +1 -0
  8. package/dist/commonjs/funcs/reposCreate.d.ts +5 -5
  9. package/dist/commonjs/funcs/reposCreate.js +5 -5
  10. package/dist/commonjs/funcs/reposDelete.d.ts +2 -2
  11. package/dist/commonjs/funcs/reposDelete.js +2 -2
  12. package/dist/commonjs/funcs/reposList.d.ts +1 -1
  13. package/dist/commonjs/funcs/reposList.js +1 -1
  14. package/dist/commonjs/funcs/reposUpdate.d.ts +3 -3
  15. package/dist/commonjs/funcs/reposUpdate.js +3 -3
  16. package/dist/commonjs/lib/config.d.ts +2 -2
  17. package/dist/commonjs/lib/config.js +2 -2
  18. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  19. package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
  20. package/dist/commonjs/mcp-server/server.js +3 -1
  21. package/dist/commonjs/mcp-server/server.js.map +1 -1
  22. package/dist/commonjs/mcp-server/tools/llmEvalsMeasureSuiteTokens.d.ts +8 -0
  23. package/dist/commonjs/mcp-server/tools/llmEvalsMeasureSuiteTokens.d.ts.map +1 -0
  24. package/dist/commonjs/mcp-server/tools/llmEvalsMeasureSuiteTokens.js +64 -0
  25. package/dist/commonjs/mcp-server/tools/llmEvalsMeasureSuiteTokens.js.map +1 -0
  26. package/dist/commonjs/mcp-server/tools/reposCreate.js +5 -5
  27. package/dist/commonjs/mcp-server/tools/reposDelete.js +2 -2
  28. package/dist/commonjs/mcp-server/tools/reposList.js +1 -1
  29. package/dist/commonjs/mcp-server/tools/reposUpdate.js +3 -3
  30. package/dist/commonjs/models/components/evalsampleobject.d.ts +5 -0
  31. package/dist/commonjs/models/components/evalsampleobject.d.ts.map +1 -1
  32. package/dist/commonjs/models/components/evalsampleobject.js +4 -0
  33. package/dist/commonjs/models/components/evalsampleobject.js.map +1 -1
  34. package/dist/commonjs/models/components/evalsuitetokenmeasurement.d.ts +34 -0
  35. package/dist/commonjs/models/components/evalsuitetokenmeasurement.d.ts.map +1 -0
  36. package/dist/commonjs/models/components/evalsuitetokenmeasurement.js +81 -0
  37. package/dist/commonjs/models/components/evalsuitetokenmeasurement.js.map +1 -0
  38. package/dist/commonjs/models/components/index.d.ts +2 -0
  39. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  40. package/dist/commonjs/models/components/index.js +2 -0
  41. package/dist/commonjs/models/components/index.js.map +1 -1
  42. package/dist/commonjs/models/components/measureevalsuitetokensbody.d.ts +20 -0
  43. package/dist/commonjs/models/components/measureevalsuitetokensbody.d.ts.map +1 -0
  44. package/dist/commonjs/models/components/measureevalsuitetokensbody.js +58 -0
  45. package/dist/commonjs/models/components/measureevalsuitetokensbody.js.map +1 -0
  46. package/dist/commonjs/models/components/repo.d.ts +1 -1
  47. package/dist/commonjs/models/operations/index.d.ts +1 -0
  48. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  49. package/dist/commonjs/models/operations/index.js +1 -0
  50. package/dist/commonjs/models/operations/index.js.map +1 -1
  51. package/dist/commonjs/models/operations/measureevalsuitetokens.d.ts +25 -0
  52. package/dist/commonjs/models/operations/measureevalsuitetokens.d.ts.map +1 -0
  53. package/dist/commonjs/models/operations/measureevalsuitetokens.js +76 -0
  54. package/dist/commonjs/models/operations/measureevalsuitetokens.js.map +1 -0
  55. package/dist/commonjs/react-query/index.d.ts +1 -0
  56. package/dist/commonjs/react-query/index.d.ts.map +1 -1
  57. package/dist/commonjs/react-query/index.js +1 -0
  58. package/dist/commonjs/react-query/index.js.map +1 -1
  59. package/dist/commonjs/react-query/llmEvalsMeasureSuiteTokens.d.ts +29 -0
  60. package/dist/commonjs/react-query/llmEvalsMeasureSuiteTokens.d.ts.map +1 -0
  61. package/dist/commonjs/react-query/llmEvalsMeasureSuiteTokens.js +47 -0
  62. package/dist/commonjs/react-query/llmEvalsMeasureSuiteTokens.js.map +1 -0
  63. package/dist/commonjs/react-query/reposCreate.d.ts +5 -5
  64. package/dist/commonjs/react-query/reposCreate.js +5 -5
  65. package/dist/commonjs/react-query/reposDelete.d.ts +2 -2
  66. package/dist/commonjs/react-query/reposDelete.js +2 -2
  67. package/dist/commonjs/react-query/reposList.d.ts +2 -2
  68. package/dist/commonjs/react-query/reposList.js +2 -2
  69. package/dist/commonjs/react-query/reposUpdate.d.ts +3 -3
  70. package/dist/commonjs/react-query/reposUpdate.js +3 -3
  71. package/dist/commonjs/sdk/evals.d.ts +7 -0
  72. package/dist/commonjs/sdk/evals.d.ts.map +1 -1
  73. package/dist/commonjs/sdk/evals.js +10 -0
  74. package/dist/commonjs/sdk/evals.js.map +1 -1
  75. package/dist/commonjs/sdk/repos.d.ts +11 -11
  76. package/dist/commonjs/sdk/repos.js +11 -11
  77. package/dist/esm/funcs/llmEvalsMeasureSuiteTokens.d.ts +20 -0
  78. package/dist/esm/funcs/llmEvalsMeasureSuiteTokens.d.ts.map +1 -0
  79. package/dist/esm/funcs/llmEvalsMeasureSuiteTokens.js +101 -0
  80. package/dist/esm/funcs/llmEvalsMeasureSuiteTokens.js.map +1 -0
  81. package/dist/esm/funcs/reposCreate.d.ts +5 -5
  82. package/dist/esm/funcs/reposCreate.js +5 -5
  83. package/dist/esm/funcs/reposDelete.d.ts +2 -2
  84. package/dist/esm/funcs/reposDelete.js +2 -2
  85. package/dist/esm/funcs/reposList.d.ts +1 -1
  86. package/dist/esm/funcs/reposList.js +1 -1
  87. package/dist/esm/funcs/reposUpdate.d.ts +3 -3
  88. package/dist/esm/funcs/reposUpdate.js +3 -3
  89. package/dist/esm/lib/config.d.ts +2 -2
  90. package/dist/esm/lib/config.js +2 -2
  91. package/dist/esm/mcp-server/mcp-server.js +1 -1
  92. package/dist/esm/mcp-server/server.d.ts.map +1 -1
  93. package/dist/esm/mcp-server/server.js +3 -1
  94. package/dist/esm/mcp-server/server.js.map +1 -1
  95. package/dist/esm/mcp-server/tools/llmEvalsMeasureSuiteTokens.d.ts +8 -0
  96. package/dist/esm/mcp-server/tools/llmEvalsMeasureSuiteTokens.d.ts.map +1 -0
  97. package/dist/esm/mcp-server/tools/llmEvalsMeasureSuiteTokens.js +28 -0
  98. package/dist/esm/mcp-server/tools/llmEvalsMeasureSuiteTokens.js.map +1 -0
  99. package/dist/esm/mcp-server/tools/reposCreate.js +5 -5
  100. package/dist/esm/mcp-server/tools/reposDelete.js +2 -2
  101. package/dist/esm/mcp-server/tools/reposList.js +1 -1
  102. package/dist/esm/mcp-server/tools/reposUpdate.js +3 -3
  103. package/dist/esm/models/components/evalsampleobject.d.ts +5 -0
  104. package/dist/esm/models/components/evalsampleobject.d.ts.map +1 -1
  105. package/dist/esm/models/components/evalsampleobject.js +4 -0
  106. package/dist/esm/models/components/evalsampleobject.js.map +1 -1
  107. package/dist/esm/models/components/evalsuitetokenmeasurement.d.ts +34 -0
  108. package/dist/esm/models/components/evalsuitetokenmeasurement.d.ts.map +1 -0
  109. package/dist/esm/models/components/evalsuitetokenmeasurement.js +43 -0
  110. package/dist/esm/models/components/evalsuitetokenmeasurement.js.map +1 -0
  111. package/dist/esm/models/components/index.d.ts +2 -0
  112. package/dist/esm/models/components/index.d.ts.map +1 -1
  113. package/dist/esm/models/components/index.js +2 -0
  114. package/dist/esm/models/components/index.js.map +1 -1
  115. package/dist/esm/models/components/measureevalsuitetokensbody.d.ts +20 -0
  116. package/dist/esm/models/components/measureevalsuitetokensbody.d.ts.map +1 -0
  117. package/dist/esm/models/components/measureevalsuitetokensbody.js +20 -0
  118. package/dist/esm/models/components/measureevalsuitetokensbody.js.map +1 -0
  119. package/dist/esm/models/components/repo.d.ts +1 -1
  120. package/dist/esm/models/operations/index.d.ts +1 -0
  121. package/dist/esm/models/operations/index.d.ts.map +1 -1
  122. package/dist/esm/models/operations/index.js +1 -0
  123. package/dist/esm/models/operations/index.js.map +1 -1
  124. package/dist/esm/models/operations/measureevalsuitetokens.d.ts +25 -0
  125. package/dist/esm/models/operations/measureevalsuitetokens.d.ts.map +1 -0
  126. package/dist/esm/models/operations/measureevalsuitetokens.js +38 -0
  127. package/dist/esm/models/operations/measureevalsuitetokens.js.map +1 -0
  128. package/dist/esm/react-query/index.d.ts +1 -0
  129. package/dist/esm/react-query/index.d.ts.map +1 -1
  130. package/dist/esm/react-query/index.js +1 -0
  131. package/dist/esm/react-query/index.js.map +1 -1
  132. package/dist/esm/react-query/llmEvalsMeasureSuiteTokens.d.ts +29 -0
  133. package/dist/esm/react-query/llmEvalsMeasureSuiteTokens.d.ts.map +1 -0
  134. package/dist/esm/react-query/llmEvalsMeasureSuiteTokens.js +42 -0
  135. package/dist/esm/react-query/llmEvalsMeasureSuiteTokens.js.map +1 -0
  136. package/dist/esm/react-query/reposCreate.d.ts +5 -5
  137. package/dist/esm/react-query/reposCreate.js +5 -5
  138. package/dist/esm/react-query/reposDelete.d.ts +2 -2
  139. package/dist/esm/react-query/reposDelete.js +2 -2
  140. package/dist/esm/react-query/reposList.d.ts +2 -2
  141. package/dist/esm/react-query/reposList.js +2 -2
  142. package/dist/esm/react-query/reposUpdate.d.ts +3 -3
  143. package/dist/esm/react-query/reposUpdate.js +3 -3
  144. package/dist/esm/sdk/evals.d.ts +7 -0
  145. package/dist/esm/sdk/evals.d.ts.map +1 -1
  146. package/dist/esm/sdk/evals.js +10 -0
  147. package/dist/esm/sdk/evals.js.map +1 -1
  148. package/dist/esm/sdk/repos.d.ts +11 -11
  149. package/dist/esm/sdk/repos.js +11 -11
  150. package/jsr.json +1 -1
  151. package/package.json +1 -1
  152. package/src/funcs/llmEvalsMeasureSuiteTokens.ts +191 -0
  153. package/src/funcs/reposCreate.ts +5 -5
  154. package/src/funcs/reposDelete.ts +2 -2
  155. package/src/funcs/reposList.ts +1 -1
  156. package/src/funcs/reposUpdate.ts +3 -3
  157. package/src/lib/config.ts +2 -2
  158. package/src/mcp-server/mcp-server.ts +1 -1
  159. package/src/mcp-server/server.ts +3 -1
  160. package/src/mcp-server/tools/llmEvalsMeasureSuiteTokens.ts +37 -0
  161. package/src/mcp-server/tools/reposCreate.ts +5 -5
  162. package/src/mcp-server/tools/reposDelete.ts +2 -2
  163. package/src/mcp-server/tools/reposList.ts +1 -1
  164. package/src/mcp-server/tools/reposUpdate.ts +3 -3
  165. package/src/models/components/evalsampleobject.ts +9 -0
  166. package/src/models/components/evalsuitetokenmeasurement.ts +91 -0
  167. package/src/models/components/index.ts +2 -0
  168. package/src/models/components/measureevalsuitetokensbody.ts +54 -0
  169. package/src/models/components/repo.ts +1 -1
  170. package/src/models/operations/index.ts +1 -0
  171. package/src/models/operations/measureevalsuitetokens.ts +80 -0
  172. package/src/react-query/index.ts +1 -0
  173. package/src/react-query/llmEvalsMeasureSuiteTokens.ts +110 -0
  174. package/src/react-query/reposCreate.ts +5 -5
  175. package/src/react-query/reposDelete.ts +2 -2
  176. package/src/react-query/reposList.ts +2 -2
  177. package/src/react-query/reposUpdate.ts +3 -3
  178. package/src/sdk/evals.ts +18 -0
  179. package/src/sdk/repos.ts +11 -11
@@ -10,7 +10,7 @@ export declare class Repos extends ClientSDK {
10
10
  *
11
11
  * @remarks
12
12
  * Returns every repository in the caller's org (org owner/admin only).
13
- * Pure DB read. With `kind`, only repositories of that kind; an untyped
13
+ * Read-only. With `kind`, only repositories of that kind; an untyped
14
14
  * (legacy, `kind: null`) repository appears in the unfiltered listing
15
15
  * only.
16
16
  */
@@ -19,19 +19,19 @@ export declare class Repos extends ClientSDK {
19
19
  * Create a repository
20
20
  *
21
21
  * @remarks
22
- * Provisions a repository (org owner/admin only): DB insert
23
- * (authoritative) → Gitea create (rolled back on failure). The repository
24
- * belongs to the caller's org. `kind` says what it will hold and defaults
25
- * to `repo` (a plain git repository); it decides which protocol planes
26
- * answer for the name (see the `Repo` schema).
22
+ * Provisions a repository (org owner/admin only); a failed provision is
23
+ * rolled back best-effort (see the `502`). The repository belongs to the
24
+ * caller's org. `kind` says what it will hold and defaults to `repo` (a
25
+ * plain git repository); it decides which protocol planes answer for the
26
+ * name (see the `Repo` schema).
27
27
  */
28
28
  create(request: operations.CreateRepoRequest, options?: RequestOptions): Promise<components.Repo>;
29
29
  /**
30
30
  * Delete a repository
31
31
  *
32
32
  * @remarks
33
- * Removes a repository; org owner/admin only. The DB delete is
34
- * authoritative; the Gitea teardown is best-effort cleanup.
33
+ * Removes a repository; org owner/admin only. The deletion is
34
+ * authoritative; the contents are cleaned up best-effort.
35
35
  */
36
36
  delete(request: operations.DeleteRepoRequest, options?: RequestOptions): Promise<void>;
37
37
  /**
@@ -47,15 +47,15 @@ export declare class Repos extends ClientSDK {
47
47
  *
48
48
  * @remarks
49
49
  * Applies a label-only update (name/description/kind); org owner/admin
50
- * only. The repository id is stable, so a rename is a one-row DB update
51
- * — no Gitea write. Omitted fields are left unchanged.
50
+ * only. The repository id is stable, so a rename touches no contents.
51
+ * Omitted fields are left unchanged.
52
52
  *
53
53
  * `kind` is the ONE way a repository's kind changes after creation (the
54
54
  * protocol planes never change it): it types a legacy `kind: null`
55
55
  * repository and corrects a wrong kind. `repo`, `model` and `dataset`
56
56
  * convert freely and any repository may become `image`; a repository
57
57
  * whose container images are still named by a tag can be given no
58
- * other kind — leaving `image`, or typing a legacy `null` row as
58
+ * other kind — leaving `image`, or typing a legacy `null` repository as
59
59
  * anything else, is refused with `409 kind_has_content` (list and
60
60
  * delete the tags through this API first). A switch away from `image`
61
61
  * collects every image no tag reaches before it is judged, so an image
@@ -18,7 +18,7 @@ export class Repos extends ClientSDK {
18
18
  *
19
19
  * @remarks
20
20
  * Returns every repository in the caller's org (org owner/admin only).
21
- * Pure DB read. With `kind`, only repositories of that kind; an untyped
21
+ * Read-only. With `kind`, only repositories of that kind; an untyped
22
22
  * (legacy, `kind: null`) repository appears in the unfiltered listing
23
23
  * only.
24
24
  */
@@ -29,11 +29,11 @@ export class Repos extends ClientSDK {
29
29
  * Create a repository
30
30
  *
31
31
  * @remarks
32
- * Provisions a repository (org owner/admin only): DB insert
33
- * (authoritative) → Gitea create (rolled back on failure). The repository
34
- * belongs to the caller's org. `kind` says what it will hold and defaults
35
- * to `repo` (a plain git repository); it decides which protocol planes
36
- * answer for the name (see the `Repo` schema).
32
+ * Provisions a repository (org owner/admin only); a failed provision is
33
+ * rolled back best-effort (see the `502`). The repository belongs to the
34
+ * caller's org. `kind` says what it will hold and defaults to `repo` (a
35
+ * plain git repository); it decides which protocol planes answer for the
36
+ * name (see the `Repo` schema).
37
37
  */
38
38
  async create(request, options) {
39
39
  return unwrapAsync(reposCreate(this, request, options));
@@ -42,8 +42,8 @@ export class Repos extends ClientSDK {
42
42
  * Delete a repository
43
43
  *
44
44
  * @remarks
45
- * Removes a repository; org owner/admin only. The DB delete is
46
- * authoritative; the Gitea teardown is best-effort cleanup.
45
+ * Removes a repository; org owner/admin only. The deletion is
46
+ * authoritative; the contents are cleaned up best-effort.
47
47
  */
48
48
  async delete(request, options) {
49
49
  return unwrapAsync(reposDelete(this, request, options));
@@ -63,15 +63,15 @@ export class Repos extends ClientSDK {
63
63
  *
64
64
  * @remarks
65
65
  * Applies a label-only update (name/description/kind); org owner/admin
66
- * only. The repository id is stable, so a rename is a one-row DB update
67
- * — no Gitea write. Omitted fields are left unchanged.
66
+ * only. The repository id is stable, so a rename touches no contents.
67
+ * Omitted fields are left unchanged.
68
68
  *
69
69
  * `kind` is the ONE way a repository's kind changes after creation (the
70
70
  * protocol planes never change it): it types a legacy `kind: null`
71
71
  * repository and corrects a wrong kind. `repo`, `model` and `dataset`
72
72
  * convert freely and any repository may become `image`; a repository
73
73
  * whose container images are still named by a tag can be given no
74
- * other kind — leaving `image`, or typing a legacy `null` row as
74
+ * other kind — leaving `image`, or typing a legacy `null` repository as
75
75
  * anything else, is refused with `409 kind_has_content` (list and
76
76
  * delete the tags through this API first). A switch away from `image`
77
77
  * collects every image no tag reaches before it is judged, so an image
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@meetkai/mka1",
5
- "version": "0.54.71",
5
+ "version": "0.54.73",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./models/errors": "./src/models/errors/index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meetkai/mka1",
3
- "version": "0.54.71",
3
+ "version": "0.54.73",
4
4
  "author": "Daniel Wilder <dauncy@gmail.com>",
5
5
  "homepage": "https://docs.mka1.com",
6
6
  "publishConfig": {
@@ -0,0 +1,191 @@
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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
23
+ import { SDKError } from "../models/errors/sdkerror.js";
24
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
25
+ import * as operations from "../models/operations/index.js";
26
+ import { APICall, APIPromise } from "../types/async.js";
27
+ import { Result } from "../types/fp.js";
28
+
29
+ /**
30
+ * Count tokens from stored text for a suite's unmeasured samples
31
+ *
32
+ * @remarks
33
+ * Backfill for rows written before the gateway recorded usage. For samples of the suite's completed runs that have answer or reasoning text but no token figure, counts prompt, reasoning and answer tokens from the stored text (tiktoken o200k_base, one ruler for every model), marks them `tokens_estimated`, and refreshes each run's per-task `tokens` and run totals so the leaderboard's efficiency figures appear. Processes `limit` runs per call, oldest run id first; call again until `remaining_runs` is 0. Samples the provider or the import already measured are left alone, and a sample with no text stays unmeasured. New rows get the same figures at generation or import time, so this is a no-op on a suite with nothing to measure.
34
+ *
35
+ * If set, this operation will use {@link Security.bearerAuth} from the global security.
36
+ */
37
+ export function llmEvalsMeasureSuiteTokens(
38
+ client: SDKCore,
39
+ request: operations.MeasureEvalSuiteTokensRequest,
40
+ options?: RequestOptions,
41
+ ): APIPromise<
42
+ Result<
43
+ components.EvalSuiteTokenMeasurement,
44
+ | SDKError
45
+ | ResponseValidationError
46
+ | ConnectionError
47
+ | RequestAbortedError
48
+ | RequestTimeoutError
49
+ | InvalidRequestError
50
+ | UnexpectedClientError
51
+ | SDKValidationError
52
+ >
53
+ > {
54
+ return new APIPromise($do(
55
+ client,
56
+ request,
57
+ options,
58
+ ));
59
+ }
60
+
61
+ async function $do(
62
+ client: SDKCore,
63
+ request: operations.MeasureEvalSuiteTokensRequest,
64
+ options?: RequestOptions,
65
+ ): Promise<
66
+ [
67
+ Result<
68
+ components.EvalSuiteTokenMeasurement,
69
+ | SDKError
70
+ | ResponseValidationError
71
+ | ConnectionError
72
+ | RequestAbortedError
73
+ | RequestTimeoutError
74
+ | InvalidRequestError
75
+ | UnexpectedClientError
76
+ | SDKValidationError
77
+ >,
78
+ APICall,
79
+ ]
80
+ > {
81
+ const parsed = safeParse(
82
+ request,
83
+ (value) =>
84
+ operations.MeasureEvalSuiteTokensRequest$outboundSchema.parse(value),
85
+ "Input validation failed",
86
+ );
87
+ if (!parsed.ok) {
88
+ return [parsed, { status: "invalid" }];
89
+ }
90
+ const payload = parsed.value;
91
+ const body = encodeJSON("body", payload.MeasureEvalSuiteTokensBody, {
92
+ explode: true,
93
+ });
94
+
95
+ const pathParams = {
96
+ suite_id: encodeSimple("suite_id", payload.suite_id, {
97
+ explode: false,
98
+ charEncoding: "percent",
99
+ }),
100
+ };
101
+ const path = pathToFunc("/api/v1/llm/evals/suites/{suite_id}/tokens/measure")(
102
+ pathParams,
103
+ );
104
+
105
+ const headers = new Headers(compactMap({
106
+ "Content-Type": "application/json",
107
+ Accept: "application/json",
108
+ "X-On-Behalf-Of": encodeSimple(
109
+ "X-On-Behalf-Of",
110
+ payload["X-On-Behalf-Of"],
111
+ { explode: false, charEncoding: "none" },
112
+ ),
113
+ }));
114
+
115
+ const secConfig = await extractSecurity(client._options.bearerAuth);
116
+ const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
117
+ const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
118
+
119
+ const context = {
120
+ options: client._options,
121
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
122
+ operationID: "measureEvalSuiteTokens",
123
+ oAuth2Scopes: null,
124
+
125
+ resolvedSecurity: requestSecurity,
126
+
127
+ securitySource: client._options.bearerAuth,
128
+ retryConfig: options?.retries
129
+ || client._options.retryConfig
130
+ || {
131
+ strategy: "backoff",
132
+ backoff: {
133
+ initialInterval: 500,
134
+ maxInterval: 5000,
135
+ exponent: 1.5,
136
+ maxElapsedTime: 15000,
137
+ },
138
+ retryConnectionErrors: true,
139
+ }
140
+ || { strategy: "none" },
141
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
142
+ };
143
+
144
+ const requestRes = client._createRequest(context, {
145
+ security: requestSecurity,
146
+ method: "POST",
147
+ baseURL: options?.serverURL,
148
+ path: path,
149
+ headers: headers,
150
+ body: body,
151
+ userAgent: client._options.userAgent,
152
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
153
+ }, options);
154
+ if (!requestRes.ok) {
155
+ return [requestRes, { status: "invalid" }];
156
+ }
157
+ const req = requestRes.value;
158
+
159
+ const doResult = await client._do(req, {
160
+ context,
161
+ isErrorStatusCode: (statusCode: number) =>
162
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
163
+ retryConfig: context.retryConfig,
164
+ retryCodes: context.retryCodes,
165
+ });
166
+ if (!doResult.ok) {
167
+ return [doResult, { status: "request-error", request: req }];
168
+ }
169
+ const response = doResult.value;
170
+
171
+ const [result] = await M.match<
172
+ components.EvalSuiteTokenMeasurement,
173
+ | SDKError
174
+ | ResponseValidationError
175
+ | ConnectionError
176
+ | RequestAbortedError
177
+ | RequestTimeoutError
178
+ | InvalidRequestError
179
+ | UnexpectedClientError
180
+ | SDKValidationError
181
+ >(
182
+ M.json(200, components.EvalSuiteTokenMeasurement$inboundSchema),
183
+ M.fail("4XX"),
184
+ M.fail("5XX"),
185
+ )(response, req);
186
+ if (!result.ok) {
187
+ return [result, { status: "complete", request: req, response }];
188
+ }
189
+
190
+ return [result, { status: "complete", request: req, response }];
191
+ }
@@ -31,11 +31,11 @@ import { Result } from "../types/fp.js";
31
31
  * Create a repository
32
32
  *
33
33
  * @remarks
34
- * Provisions a repository (org owner/admin only): DB insert
35
- * (authoritative) → Gitea create (rolled back on failure). The repository
36
- * belongs to the caller's org. `kind` says what it will hold and defaults
37
- * to `repo` (a plain git repository); it decides which protocol planes
38
- * answer for the name (see the `Repo` schema).
34
+ * Provisions a repository (org owner/admin only); a failed provision is
35
+ * rolled back best-effort (see the `502`). The repository belongs to the
36
+ * caller's org. `kind` says what it will hold and defaults to `repo` (a
37
+ * plain git repository); it decides which protocol planes answer for the
38
+ * name (see the `Repo` schema).
39
39
  *
40
40
  * If set, this operation will use {@link Security.bearerAuth} from the global security.
41
41
  */
@@ -31,8 +31,8 @@ import { Result } from "../types/fp.js";
31
31
  * Delete a repository
32
32
  *
33
33
  * @remarks
34
- * Removes a repository; org owner/admin only. The DB delete is
35
- * authoritative; the Gitea teardown is best-effort cleanup.
34
+ * Removes a repository; org owner/admin only. The deletion is
35
+ * authoritative; the contents are cleaned up best-effort.
36
36
  *
37
37
  * If set, this operation will use {@link Security.bearerAuth} from the global security.
38
38
  */
@@ -31,7 +31,7 @@ import { Result } from "../types/fp.js";
31
31
  *
32
32
  * @remarks
33
33
  * Returns every repository in the caller's org (org owner/admin only).
34
- * Pure DB read. With `kind`, only repositories of that kind; an untyped
34
+ * Read-only. With `kind`, only repositories of that kind; an untyped
35
35
  * (legacy, `kind: null`) repository appears in the unfiltered listing
36
36
  * only.
37
37
  *
@@ -32,15 +32,15 @@ import { Result } from "../types/fp.js";
32
32
  *
33
33
  * @remarks
34
34
  * Applies a label-only update (name/description/kind); org owner/admin
35
- * only. The repository id is stable, so a rename is a one-row DB update
36
- * — no Gitea write. Omitted fields are left unchanged.
35
+ * only. The repository id is stable, so a rename touches no contents.
36
+ * Omitted fields are left unchanged.
37
37
  *
38
38
  * `kind` is the ONE way a repository's kind changes after creation (the
39
39
  * protocol planes never change it): it types a legacy `kind: null`
40
40
  * repository and corrects a wrong kind. `repo`, `model` and `dataset`
41
41
  * convert freely and any repository may become `image`; a repository
42
42
  * whose container images are still named by a tag can be given no
43
- * other kind — leaving `image`, or typing a legacy `null` row as
43
+ * other kind — leaving `image`, or typing a legacy `null` repository as
44
44
  * anything else, is refused with `409 kind_has_content` (list and
45
45
  * delete the tags through this API first). A switch away from `image`
46
46
  * collects every image no tag reaches before it is judged, so an image
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.71",
68
+ sdkVersion: "0.54.73",
69
69
  genVersion: "2.943.0",
70
- userAgent: "speakeasy-sdk/typescript 0.54.71 2.943.0 1.1.0 @meetkai/mka1",
70
+ userAgent: "speakeasy-sdk/typescript 0.54.73 2.943.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.71",
22
+ currentVersion: "0.54.73",
23
23
  },
24
24
  });
25
25
 
@@ -247,6 +247,7 @@ import { tool$llmEvalsListSchedules } from "./tools/llmEvalsListSchedules.js";
247
247
  import { tool$llmEvalsListSuiteLeaderboardRuns } from "./tools/llmEvalsListSuiteLeaderboardRuns.js";
248
248
  import { tool$llmEvalsListSuites } from "./tools/llmEvalsListSuites.js";
249
249
  import { tool$llmEvalsListSuiteVersions } from "./tools/llmEvalsListSuiteVersions.js";
250
+ import { tool$llmEvalsMeasureSuiteTokens } from "./tools/llmEvalsMeasureSuiteTokens.js";
250
251
  import { tool$llmEvalsRerunFailedSamples } from "./tools/llmEvalsRerunFailedSamples.js";
251
252
  import { tool$llmEvalsRetryFailedRun } from "./tools/llmEvalsRetryFailedRun.js";
252
253
  import { tool$llmEvalsTriggerSchedule } from "./tools/llmEvalsTriggerSchedule.js";
@@ -473,7 +474,7 @@ export function createMCPServer(deps: {
473
474
  }) {
474
475
  const server = new McpServer({
475
476
  name: "SDK",
476
- version: "0.54.71",
477
+ version: "0.54.73",
477
478
  });
478
479
 
479
480
  const client = new SDKCore({
@@ -683,6 +684,7 @@ export function createMCPServer(deps: {
683
684
  tool(tool$llmEvalsGetSuiteVersion);
684
685
  tool(tool$llmEvalsListSuiteLeaderboardRuns);
685
686
  tool(tool$llmEvalsGetSuiteLeaderboard);
687
+ tool(tool$llmEvalsMeasureSuiteTokens);
686
688
  tool(tool$llmEvalsCreateRun);
687
689
  tool(tool$llmEvalsListRuns);
688
690
  tool(tool$llmEvalsGetRun);
@@ -0,0 +1,37 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { llmEvalsMeasureSuiteTokens } from "../../funcs/llmEvalsMeasureSuiteTokens.js";
6
+ import * as operations from "../../models/operations/index.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: operations.MeasureEvalSuiteTokensRequest$inboundSchema,
11
+ };
12
+
13
+ export const tool$llmEvalsMeasureSuiteTokens: ToolDefinition<typeof args> = {
14
+ name: "llm-evals-measure-suite-tokens",
15
+ description: `Count tokens from stored text for a suite's unmeasured samples
16
+
17
+ Backfill for rows written before the gateway recorded usage. For samples of the suite's completed runs that have answer or reasoning text but no token figure, counts prompt, reasoning and answer tokens from the stored text (tiktoken o200k_base, one ruler for every model), marks them \`tokens_estimated\`, and refreshes each run's per-task \`tokens\` and run totals so the leaderboard's efficiency figures appear. Processes \`limit\` runs per call, oldest run id first; call again until \`remaining_runs\` is 0. Samples the provider or the import already measured are left alone, and a sample with no text stays unmeasured. New rows get the same figures at generation or import time, so this is a no-op on a suite with nothing to measure.`,
18
+ args,
19
+ tool: async (client, args, ctx) => {
20
+ const [result, apiCall] = await llmEvalsMeasureSuiteTokens(
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,11 +14,11 @@ export const tool$reposCreate: ToolDefinition<typeof args> = {
14
14
  name: "repos-create",
15
15
  description: `Create a repository
16
16
 
17
- Provisions a repository (org owner/admin only): DB insert
18
- (authoritative) → Gitea create (rolled back on failure). The repository
19
- belongs to the caller's org. \`kind\` says what it will hold and defaults
20
- to \`repo\` (a plain git repository); it decides which protocol planes
21
- answer for the name (see the \`Repo\` schema).
17
+ Provisions a repository (org owner/admin only); a failed provision is
18
+ rolled back best-effort (see the \`502\`). The repository belongs to the
19
+ caller's org. \`kind\` says what it will hold and defaults to \`repo\` (a
20
+ plain git repository); it decides which protocol planes answer for the
21
+ name (see the \`Repo\` schema).
22
22
  `,
23
23
  args,
24
24
  tool: async (client, args, ctx) => {
@@ -14,8 +14,8 @@ export const tool$reposDelete: ToolDefinition<typeof args> = {
14
14
  name: "repos-delete",
15
15
  description: `Delete a repository
16
16
 
17
- Removes a repository; org owner/admin only. The DB delete is
18
- authoritative; the Gitea teardown is best-effort cleanup.
17
+ Removes a repository; org owner/admin only. The deletion is
18
+ authoritative; the contents are cleaned up best-effort.
19
19
  `,
20
20
  args,
21
21
  tool: async (client, args, ctx) => {
@@ -15,7 +15,7 @@ export const tool$reposList: ToolDefinition<typeof args> = {
15
15
  description: `List the caller's org's repositories
16
16
 
17
17
  Returns every repository in the caller's org (org owner/admin only).
18
- Pure DB read. With \`kind\`, only repositories of that kind; an untyped
18
+ Read-only. With \`kind\`, only repositories of that kind; an untyped
19
19
  (legacy, \`kind: null\`) repository appears in the unfiltered listing
20
20
  only.
21
21
  `,
@@ -15,15 +15,15 @@ export const tool$reposUpdate: ToolDefinition<typeof args> = {
15
15
  description: `Update a repository's labels
16
16
 
17
17
  Applies a label-only update (name/description/kind); org owner/admin
18
- only. The repository id is stable, so a rename is a one-row DB update
19
- — no Gitea write. Omitted fields are left unchanged.
18
+ only. The repository id is stable, so a rename touches no contents.
19
+ Omitted fields are left unchanged.
20
20
 
21
21
  \`kind\` is the ONE way a repository's kind changes after creation (the
22
22
  protocol planes never change it): it types a legacy \`kind: null\`
23
23
  repository and corrects a wrong kind. \`repo\`, \`model\` and \`dataset\`
24
24
  convert freely and any repository may become \`image\`; a repository
25
25
  whose container images are still named by a tag can be given no
26
- other kind — leaving \`image\`, or typing a legacy \`null\` row as
26
+ other kind — leaving \`image\`, or typing a legacy \`null\` repository as
27
27
  anything else, is refused with \`409 kind_has_content\` (list and
28
28
  delete the tags through this API first). A switch away from \`image\`
29
29
  collects every image no tag reaches before it is judged, so an image
@@ -57,6 +57,10 @@ export type EvalSampleObject = {
57
57
  * The share of `output_tokens` the provider attributed to reasoning. Null when it reported no split.
58
58
  */
59
59
  reasoningTokens: number | null;
60
+ /**
61
+ * True when the token figures were counted from the stored text by the gateway (tiktoken o200k_base, one ruler for every model) because neither the provider nor the imported row reported usage. Comparable verbosity, not a billing count.
62
+ */
63
+ tokensEstimated: boolean;
60
64
  /**
61
65
  * Per-phase wall clock for a harness trial: `environment_setup`, `agent_setup`, `agent_execution`, `verifier`, each `{ started_at, finished_at }` as ISO 8601 timestamps exactly as the harness recorded them. A phase the harness did not time is absent rather than null. Drives the trial timing bar. Null outside harness runs.
62
66
  */
@@ -94,6 +98,7 @@ export const EvalSampleObject$inboundSchema: z.ZodType<
94
98
  output_tokens: z.nullable(z.number().int()),
95
99
  cached_tokens: z.nullable(z.number().int()),
96
100
  reasoning_tokens: z.nullable(z.number().int()),
101
+ tokens_estimated: z.boolean(),
97
102
  phase_timings: z.nullable(z.record(z.any())),
98
103
  created_at: z.number().int(),
99
104
  started_at: z.nullable(z.number().int()),
@@ -112,6 +117,7 @@ export const EvalSampleObject$inboundSchema: z.ZodType<
112
117
  "output_tokens": "outputTokens",
113
118
  "cached_tokens": "cachedTokens",
114
119
  "reasoning_tokens": "reasoningTokens",
120
+ "tokens_estimated": "tokensEstimated",
115
121
  "phase_timings": "phaseTimings",
116
122
  "created_at": "createdAt",
117
123
  "started_at": "startedAt",
@@ -142,6 +148,7 @@ export type EvalSampleObject$Outbound = {
142
148
  output_tokens: number | null;
143
149
  cached_tokens: number | null;
144
150
  reasoning_tokens: number | null;
151
+ tokens_estimated: boolean;
145
152
  phase_timings: { [k: string]: any } | null;
146
153
  created_at: number;
147
154
  started_at: number | null;
@@ -176,6 +183,7 @@ export const EvalSampleObject$outboundSchema: z.ZodType<
176
183
  outputTokens: z.nullable(z.number().int()),
177
184
  cachedTokens: z.nullable(z.number().int()),
178
185
  reasoningTokens: z.nullable(z.number().int()),
186
+ tokensEstimated: z.boolean(),
179
187
  phaseTimings: z.nullable(z.record(z.any())),
180
188
  createdAt: z.number().int(),
181
189
  startedAt: z.nullable(z.number().int()),
@@ -194,6 +202,7 @@ export const EvalSampleObject$outboundSchema: z.ZodType<
194
202
  outputTokens: "output_tokens",
195
203
  cachedTokens: "cached_tokens",
196
204
  reasoningTokens: "reasoning_tokens",
205
+ tokensEstimated: "tokens_estimated",
197
206
  phaseTimings: "phase_timings",
198
207
  createdAt: "created_at",
199
208
  startedAt: "started_at",