@meetkai/mka1 0.54.49 → 0.54.50

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 (191) hide show
  1. package/bin/mcp-server.js +71 -13
  2. package/bin/mcp-server.js.map +21 -20
  3. package/dist/commonjs/funcs/flagsEnvironmentsGenerateEvaluationKey.d.ts +1 -1
  4. package/dist/commonjs/funcs/flagsEnvironmentsGenerateEvaluationKey.js +1 -1
  5. package/dist/commonjs/funcs/reposCreate.d.ts +3 -1
  6. package/dist/commonjs/funcs/reposCreate.d.ts.map +1 -1
  7. package/dist/commonjs/funcs/reposCreate.js +3 -1
  8. package/dist/commonjs/funcs/reposCreate.js.map +1 -1
  9. package/dist/commonjs/funcs/reposList.d.ts +3 -1
  10. package/dist/commonjs/funcs/reposList.d.ts.map +1 -1
  11. package/dist/commonjs/funcs/reposList.js +8 -2
  12. package/dist/commonjs/funcs/reposList.js.map +1 -1
  13. package/dist/commonjs/funcs/reposUpdate.d.ts +12 -3
  14. package/dist/commonjs/funcs/reposUpdate.d.ts.map +1 -1
  15. package/dist/commonjs/funcs/reposUpdate.js +12 -3
  16. package/dist/commonjs/funcs/reposUpdate.js.map +1 -1
  17. package/dist/commonjs/lib/config.d.ts +2 -2
  18. package/dist/commonjs/lib/config.js +2 -2
  19. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  20. package/dist/commonjs/mcp-server/server.js +1 -1
  21. package/dist/commonjs/mcp-server/tools/flagsEnvironmentsGenerateEvaluationKey.js +1 -1
  22. package/dist/commonjs/mcp-server/tools/flagsEnvironmentsGenerateEvaluationKey.js.map +1 -1
  23. package/dist/commonjs/mcp-server/tools/reposCreate.d.ts.map +1 -1
  24. package/dist/commonjs/mcp-server/tools/reposCreate.js +3 -1
  25. package/dist/commonjs/mcp-server/tools/reposCreate.js.map +1 -1
  26. package/dist/commonjs/mcp-server/tools/reposList.d.ts.map +1 -1
  27. package/dist/commonjs/mcp-server/tools/reposList.js +3 -1
  28. package/dist/commonjs/mcp-server/tools/reposList.js.map +1 -1
  29. package/dist/commonjs/mcp-server/tools/reposUpdate.d.ts.map +1 -1
  30. package/dist/commonjs/mcp-server/tools/reposUpdate.js +12 -3
  31. package/dist/commonjs/mcp-server/tools/reposUpdate.js.map +1 -1
  32. package/dist/commonjs/models/components/createreporequest.d.ts +23 -0
  33. package/dist/commonjs/models/components/createreporequest.d.ts.map +1 -1
  34. package/dist/commonjs/models/components/createreporequest.js +16 -1
  35. package/dist/commonjs/models/components/createreporequest.js.map +1 -1
  36. package/dist/commonjs/models/components/featureflagenvironment.d.ts +10 -0
  37. package/dist/commonjs/models/components/featureflagenvironment.d.ts.map +1 -1
  38. package/dist/commonjs/models/components/featureflagenvironment.js +8 -0
  39. package/dist/commonjs/models/components/featureflagenvironment.js.map +1 -1
  40. package/dist/commonjs/models/components/index.d.ts +1 -0
  41. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  42. package/dist/commonjs/models/components/index.js +1 -0
  43. package/dist/commonjs/models/components/index.js.map +1 -1
  44. package/dist/commonjs/models/components/patchreporequest.d.ts +9 -0
  45. package/dist/commonjs/models/components/patchreporequest.d.ts.map +1 -1
  46. package/dist/commonjs/models/components/patchreporequest.js +3 -0
  47. package/dist/commonjs/models/components/patchreporequest.js.map +1 -1
  48. package/dist/commonjs/models/components/repo.d.ts +10 -0
  49. package/dist/commonjs/models/components/repo.d.ts.map +1 -1
  50. package/dist/commonjs/models/components/repo.js +3 -0
  51. package/dist/commonjs/models/components/repo.js.map +1 -1
  52. package/dist/commonjs/models/components/repokind.d.ts +36 -0
  53. package/dist/commonjs/models/components/repokind.d.ts.map +1 -0
  54. package/dist/commonjs/models/components/repokind.js +63 -0
  55. package/dist/commonjs/models/components/repokind.js.map +1 -0
  56. package/dist/commonjs/models/operations/listrepos.d.ts +8 -0
  57. package/dist/commonjs/models/operations/listrepos.d.ts.map +1 -1
  58. package/dist/commonjs/models/operations/listrepos.js +2 -0
  59. package/dist/commonjs/models/operations/listrepos.js.map +1 -1
  60. package/dist/commonjs/react-query/flagsEnvironmentsGenerateEvaluationKey.d.ts +1 -1
  61. package/dist/commonjs/react-query/flagsEnvironmentsGenerateEvaluationKey.js +1 -1
  62. package/dist/commonjs/react-query/reposCreate.d.ts +3 -1
  63. package/dist/commonjs/react-query/reposCreate.d.ts.map +1 -1
  64. package/dist/commonjs/react-query/reposCreate.js +3 -1
  65. package/dist/commonjs/react-query/reposCreate.js.map +1 -1
  66. package/dist/commonjs/react-query/reposList.core.d.ts +2 -0
  67. package/dist/commonjs/react-query/reposList.core.d.ts.map +1 -1
  68. package/dist/commonjs/react-query/reposList.core.js +4 -1
  69. package/dist/commonjs/react-query/reposList.core.js.map +1 -1
  70. package/dist/commonjs/react-query/reposList.d.ts +14 -5
  71. package/dist/commonjs/react-query/reposList.d.ts.map +1 -1
  72. package/dist/commonjs/react-query/reposList.js +6 -2
  73. package/dist/commonjs/react-query/reposList.js.map +1 -1
  74. package/dist/commonjs/react-query/reposUpdate.d.ts +12 -3
  75. package/dist/commonjs/react-query/reposUpdate.d.ts.map +1 -1
  76. package/dist/commonjs/react-query/reposUpdate.js +12 -3
  77. package/dist/commonjs/react-query/reposUpdate.js.map +1 -1
  78. package/dist/commonjs/sdk/environments.d.ts +1 -1
  79. package/dist/commonjs/sdk/environments.js +1 -1
  80. package/dist/commonjs/sdk/repos.d.ts +18 -5
  81. package/dist/commonjs/sdk/repos.d.ts.map +1 -1
  82. package/dist/commonjs/sdk/repos.js +18 -5
  83. package/dist/commonjs/sdk/repos.js.map +1 -1
  84. package/dist/esm/funcs/flagsEnvironmentsGenerateEvaluationKey.d.ts +1 -1
  85. package/dist/esm/funcs/flagsEnvironmentsGenerateEvaluationKey.js +1 -1
  86. package/dist/esm/funcs/reposCreate.d.ts +3 -1
  87. package/dist/esm/funcs/reposCreate.d.ts.map +1 -1
  88. package/dist/esm/funcs/reposCreate.js +3 -1
  89. package/dist/esm/funcs/reposCreate.js.map +1 -1
  90. package/dist/esm/funcs/reposList.d.ts +3 -1
  91. package/dist/esm/funcs/reposList.d.ts.map +1 -1
  92. package/dist/esm/funcs/reposList.js +9 -3
  93. package/dist/esm/funcs/reposList.js.map +1 -1
  94. package/dist/esm/funcs/reposUpdate.d.ts +12 -3
  95. package/dist/esm/funcs/reposUpdate.d.ts.map +1 -1
  96. package/dist/esm/funcs/reposUpdate.js +12 -3
  97. package/dist/esm/funcs/reposUpdate.js.map +1 -1
  98. package/dist/esm/lib/config.d.ts +2 -2
  99. package/dist/esm/lib/config.js +2 -2
  100. package/dist/esm/mcp-server/mcp-server.js +1 -1
  101. package/dist/esm/mcp-server/server.js +1 -1
  102. package/dist/esm/mcp-server/tools/flagsEnvironmentsGenerateEvaluationKey.js +1 -1
  103. package/dist/esm/mcp-server/tools/flagsEnvironmentsGenerateEvaluationKey.js.map +1 -1
  104. package/dist/esm/mcp-server/tools/reposCreate.d.ts.map +1 -1
  105. package/dist/esm/mcp-server/tools/reposCreate.js +3 -1
  106. package/dist/esm/mcp-server/tools/reposCreate.js.map +1 -1
  107. package/dist/esm/mcp-server/tools/reposList.d.ts.map +1 -1
  108. package/dist/esm/mcp-server/tools/reposList.js +3 -1
  109. package/dist/esm/mcp-server/tools/reposList.js.map +1 -1
  110. package/dist/esm/mcp-server/tools/reposUpdate.d.ts.map +1 -1
  111. package/dist/esm/mcp-server/tools/reposUpdate.js +12 -3
  112. package/dist/esm/mcp-server/tools/reposUpdate.js.map +1 -1
  113. package/dist/esm/models/components/createreporequest.d.ts +23 -0
  114. package/dist/esm/models/components/createreporequest.d.ts.map +1 -1
  115. package/dist/esm/models/components/createreporequest.js +15 -0
  116. package/dist/esm/models/components/createreporequest.js.map +1 -1
  117. package/dist/esm/models/components/featureflagenvironment.d.ts +10 -0
  118. package/dist/esm/models/components/featureflagenvironment.d.ts.map +1 -1
  119. package/dist/esm/models/components/featureflagenvironment.js +8 -0
  120. package/dist/esm/models/components/featureflagenvironment.js.map +1 -1
  121. package/dist/esm/models/components/index.d.ts +1 -0
  122. package/dist/esm/models/components/index.d.ts.map +1 -1
  123. package/dist/esm/models/components/index.js +1 -0
  124. package/dist/esm/models/components/index.js.map +1 -1
  125. package/dist/esm/models/components/patchreporequest.d.ts +9 -0
  126. package/dist/esm/models/components/patchreporequest.d.ts.map +1 -1
  127. package/dist/esm/models/components/patchreporequest.js +3 -0
  128. package/dist/esm/models/components/patchreporequest.js.map +1 -1
  129. package/dist/esm/models/components/repo.d.ts +10 -0
  130. package/dist/esm/models/components/repo.d.ts.map +1 -1
  131. package/dist/esm/models/components/repo.js +3 -0
  132. package/dist/esm/models/components/repo.js.map +1 -1
  133. package/dist/esm/models/components/repokind.d.ts +36 -0
  134. package/dist/esm/models/components/repokind.d.ts.map +1 -0
  135. package/dist/esm/models/components/repokind.js +27 -0
  136. package/dist/esm/models/components/repokind.js.map +1 -0
  137. package/dist/esm/models/operations/listrepos.d.ts +8 -0
  138. package/dist/esm/models/operations/listrepos.d.ts.map +1 -1
  139. package/dist/esm/models/operations/listrepos.js +2 -0
  140. package/dist/esm/models/operations/listrepos.js.map +1 -1
  141. package/dist/esm/react-query/flagsEnvironmentsGenerateEvaluationKey.d.ts +1 -1
  142. package/dist/esm/react-query/flagsEnvironmentsGenerateEvaluationKey.js +1 -1
  143. package/dist/esm/react-query/reposCreate.d.ts +3 -1
  144. package/dist/esm/react-query/reposCreate.d.ts.map +1 -1
  145. package/dist/esm/react-query/reposCreate.js +3 -1
  146. package/dist/esm/react-query/reposCreate.js.map +1 -1
  147. package/dist/esm/react-query/reposList.core.d.ts +2 -0
  148. package/dist/esm/react-query/reposList.core.d.ts.map +1 -1
  149. package/dist/esm/react-query/reposList.core.js +4 -1
  150. package/dist/esm/react-query/reposList.core.js.map +1 -1
  151. package/dist/esm/react-query/reposList.d.ts +14 -5
  152. package/dist/esm/react-query/reposList.d.ts.map +1 -1
  153. package/dist/esm/react-query/reposList.js +6 -2
  154. package/dist/esm/react-query/reposList.js.map +1 -1
  155. package/dist/esm/react-query/reposUpdate.d.ts +12 -3
  156. package/dist/esm/react-query/reposUpdate.d.ts.map +1 -1
  157. package/dist/esm/react-query/reposUpdate.js +12 -3
  158. package/dist/esm/react-query/reposUpdate.js.map +1 -1
  159. package/dist/esm/sdk/environments.d.ts +1 -1
  160. package/dist/esm/sdk/environments.js +1 -1
  161. package/dist/esm/sdk/repos.d.ts +18 -5
  162. package/dist/esm/sdk/repos.d.ts.map +1 -1
  163. package/dist/esm/sdk/repos.js +18 -5
  164. package/dist/esm/sdk/repos.js.map +1 -1
  165. package/jsr.json +1 -1
  166. package/package.json +1 -1
  167. package/src/funcs/flagsEnvironmentsGenerateEvaluationKey.ts +1 -1
  168. package/src/funcs/reposCreate.ts +3 -1
  169. package/src/funcs/reposList.ts +10 -3
  170. package/src/funcs/reposUpdate.ts +12 -3
  171. package/src/lib/config.ts +2 -2
  172. package/src/mcp-server/mcp-server.ts +1 -1
  173. package/src/mcp-server/server.ts +1 -1
  174. package/src/mcp-server/tools/flagsEnvironmentsGenerateEvaluationKey.ts +1 -1
  175. package/src/mcp-server/tools/reposCreate.ts +3 -1
  176. package/src/mcp-server/tools/reposList.ts +3 -1
  177. package/src/mcp-server/tools/reposUpdate.ts +12 -3
  178. package/src/models/components/createreporequest.ts +31 -0
  179. package/src/models/components/featureflagenvironment.ts +18 -0
  180. package/src/models/components/index.ts +1 -0
  181. package/src/models/components/patchreporequest.ts +15 -0
  182. package/src/models/components/repo.ts +16 -0
  183. package/src/models/components/repokind.ts +43 -0
  184. package/src/models/operations/listrepos.ts +10 -0
  185. package/src/react-query/flagsEnvironmentsGenerateEvaluationKey.ts +1 -1
  186. package/src/react-query/reposCreate.ts +3 -1
  187. package/src/react-query/reposList.core.ts +9 -2
  188. package/src/react-query/reposList.ts +17 -4
  189. package/src/react-query/reposUpdate.ts +12 -3
  190. package/src/sdk/environments.ts +1 -1
  191. package/src/sdk/repos.ts +18 -5
@@ -16,7 +16,9 @@ export const tool$reposCreate: ToolDefinition<typeof args> = {
16
16
 
17
17
  Provisions a repository (org owner/admin only): DB insert
18
18
  (authoritative) → Gitea create (rolled back on failure). The repository
19
- belongs to the caller's org.
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).
20
22
  `,
21
23
  args,
22
24
  tool: async (client, args, ctx) => {
@@ -15,7 +15,9 @@ 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.
18
+ Pure DB read. With \`kind\`, only repositories of that kind; an untyped
19
+ (legacy, \`kind: null\`) repository appears in the unfiltered listing
20
+ only.
19
21
  `,
20
22
  args,
21
23
  tool: async (client, args, ctx) => {
@@ -14,9 +14,18 @@ export const tool$reposUpdate: ToolDefinition<typeof args> = {
14
14
  name: "repos-update",
15
15
  description: `Update a repository's labels
16
16
 
17
- Applies a label-only update (name/description); org owner/admin only.
18
- The repository id is stable, so a rename is a one-row DB update — no
19
- Gitea write. Omitted fields are left unchanged.
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.
20
+
21
+ \`kind\` is the ONE way a repository's kind changes after creation (the
22
+ protocol planes never change it): it types a legacy \`kind: null\`
23
+ repository and corrects a wrong kind. \`repo\`, \`model\` and \`dataset\`
24
+ convert freely and any repository may become \`image\`; a repository
25
+ that still holds container-image content can be given no other kind
26
+ — leaving \`image\`, or typing a legacy \`null\` row as anything else, is
27
+ refused with \`409 kind_has_content\` (delete the tags through the
28
+ registry first). A kind is never un-set.
20
29
  `,
21
30
  args,
22
31
  tool: async (client, args, ctx) => {
@@ -4,11 +4,30 @@
4
4
 
5
5
  import * as z from "zod/v3";
6
6
  import { safeParse } from "../../lib/schemas.js";
7
+ import { ClosedEnum } from "../../types/enums.js";
7
8
  import { Result as SafeParseResult } from "../../types/fp.js";
8
9
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
10
 
11
+ /**
12
+ * What the repository will hold. Defaults to `repo`.
13
+ */
14
+ export const CreateRepoRequestKind = {
15
+ Repo: "repo",
16
+ Model: "model",
17
+ Dataset: "dataset",
18
+ Image: "image",
19
+ } as const;
20
+ /**
21
+ * What the repository will hold. Defaults to `repo`.
22
+ */
23
+ export type CreateRepoRequestKind = ClosedEnum<typeof CreateRepoRequestKind>;
24
+
10
25
  export type CreateRepoRequest = {
11
26
  description?: string | undefined;
27
+ /**
28
+ * What the repository will hold. Defaults to `repo`.
29
+ */
30
+ kind?: CreateRepoRequestKind | undefined;
12
31
  /**
13
32
  * The repository name. Must start with an alphanumeric character and
14
33
  *
@@ -18,6 +37,15 @@ export type CreateRepoRequest = {
18
37
  name: string;
19
38
  };
20
39
 
40
+ /** @internal */
41
+ export const CreateRepoRequestKind$inboundSchema: z.ZodNativeEnum<
42
+ typeof CreateRepoRequestKind
43
+ > = z.nativeEnum(CreateRepoRequestKind);
44
+ /** @internal */
45
+ export const CreateRepoRequestKind$outboundSchema: z.ZodNativeEnum<
46
+ typeof CreateRepoRequestKind
47
+ > = CreateRepoRequestKind$inboundSchema;
48
+
21
49
  /** @internal */
22
50
  export const CreateRepoRequest$inboundSchema: z.ZodType<
23
51
  CreateRepoRequest,
@@ -25,11 +53,13 @@ export const CreateRepoRequest$inboundSchema: z.ZodType<
25
53
  unknown
26
54
  > = z.object({
27
55
  description: z.string().optional(),
56
+ kind: CreateRepoRequestKind$inboundSchema.default("repo"),
28
57
  name: z.string(),
29
58
  });
30
59
  /** @internal */
31
60
  export type CreateRepoRequest$Outbound = {
32
61
  description?: string | undefined;
62
+ kind: string;
33
63
  name: string;
34
64
  };
35
65
 
@@ -40,6 +70,7 @@ export const CreateRepoRequest$outboundSchema: z.ZodType<
40
70
  CreateRepoRequest
41
71
  > = z.object({
42
72
  description: z.string().optional(),
73
+ kind: CreateRepoRequestKind$outboundSchema.default("repo"),
43
74
  name: z.string(),
44
75
  });
45
76
 
@@ -10,6 +10,14 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
10
 
11
11
  export type FeatureFlagEnvironment = {
12
12
  createdAt: Date;
13
+ /**
14
+ * Whether the environment has an active evaluation key.
15
+ */
16
+ evaluationKeyConfigured: boolean;
17
+ /**
18
+ * The active key's prefix plus the first and last four characters of its payload, for display. Null when no key is configured, or when the active key was generated before hints were recorded.
19
+ */
20
+ evaluationKeyHint: string | null;
13
21
  id: string;
14
22
  key: string;
15
23
  name: string;
@@ -23,6 +31,8 @@ export const FeatureFlagEnvironment$inboundSchema: z.ZodType<
23
31
  unknown
24
32
  > = z.object({
25
33
  created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
34
+ evaluation_key_configured: z.boolean(),
35
+ evaluation_key_hint: z.nullable(z.string()),
26
36
  id: z.string(),
27
37
  key: z.string(),
28
38
  name: z.string(),
@@ -30,12 +40,16 @@ export const FeatureFlagEnvironment$inboundSchema: z.ZodType<
30
40
  }).transform((v) => {
31
41
  return remap$(v, {
32
42
  "created_at": "createdAt",
43
+ "evaluation_key_configured": "evaluationKeyConfigured",
44
+ "evaluation_key_hint": "evaluationKeyHint",
33
45
  "updated_at": "updatedAt",
34
46
  });
35
47
  });
36
48
  /** @internal */
37
49
  export type FeatureFlagEnvironment$Outbound = {
38
50
  created_at: string;
51
+ evaluation_key_configured: boolean;
52
+ evaluation_key_hint: string | null;
39
53
  id: string;
40
54
  key: string;
41
55
  name: string;
@@ -49,6 +63,8 @@ export const FeatureFlagEnvironment$outboundSchema: z.ZodType<
49
63
  FeatureFlagEnvironment
50
64
  > = z.object({
51
65
  createdAt: z.date().transform(v => v.toISOString()),
66
+ evaluationKeyConfigured: z.boolean(),
67
+ evaluationKeyHint: z.nullable(z.string()),
52
68
  id: z.string(),
53
69
  key: z.string(),
54
70
  name: z.string(),
@@ -56,6 +72,8 @@ export const FeatureFlagEnvironment$outboundSchema: z.ZodType<
56
72
  }).transform((v) => {
57
73
  return remap$(v, {
58
74
  createdAt: "created_at",
75
+ evaluationKeyConfigured: "evaluation_key_configured",
76
+ evaluationKeyHint: "evaluation_key_hint",
59
77
  updatedAt: "updated_at",
60
78
  });
61
79
  });
@@ -521,6 +521,7 @@ export * from "./registrymodelorigin.js";
521
521
  export * from "./registrysource.js";
522
522
  export * from "./reinforcementhyperparameters.js";
523
523
  export * from "./repo.js";
524
+ export * from "./repokind.js";
524
525
  export * from "./repositorylist.js";
525
526
  export * from "./requestcounts.js";
526
527
  export * from "./resolvedreference.js";
@@ -6,6 +6,11 @@ import * as z from "zod/v3";
6
6
  import { safeParse } from "../../lib/schemas.js";
7
7
  import { Result as SafeParseResult } from "../../types/fp.js";
8
8
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+ import {
10
+ RepoKind,
11
+ RepoKind$inboundSchema,
12
+ RepoKind$outboundSchema,
13
+ } from "./repokind.js";
9
14
 
10
15
  /**
11
16
  * A partial update. Every field is optional; an omitted field is left
@@ -15,6 +20,13 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
15
20
  */
16
21
  export type PatchRepoRequest = {
17
22
  description?: string | undefined;
23
+ /**
24
+ * Switch the repository's kind (see the operation description for
25
+ *
26
+ * @remarks
27
+ * the rules). Cannot be `null`: a kind is never un-set.
28
+ */
29
+ kind?: RepoKind | undefined;
18
30
  name?: string | undefined;
19
31
  };
20
32
 
@@ -25,11 +37,13 @@ export const PatchRepoRequest$inboundSchema: z.ZodType<
25
37
  unknown
26
38
  > = z.object({
27
39
  description: z.string().optional(),
40
+ kind: RepoKind$inboundSchema.optional(),
28
41
  name: z.string().optional(),
29
42
  });
30
43
  /** @internal */
31
44
  export type PatchRepoRequest$Outbound = {
32
45
  description?: string | undefined;
46
+ kind?: string | undefined;
33
47
  name?: string | undefined;
34
48
  };
35
49
 
@@ -40,6 +54,7 @@ export const PatchRepoRequest$outboundSchema: z.ZodType<
40
54
  PatchRepoRequest
41
55
  > = z.object({
42
56
  description: z.string().optional(),
57
+ kind: RepoKind$outboundSchema.optional(),
43
58
  name: z.string().optional(),
44
59
  });
45
60
 
@@ -7,6 +7,11 @@ import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
8
  import { Result as SafeParseResult } from "../../types/fp.js";
9
9
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import {
11
+ RepoKind,
12
+ RepoKind$inboundSchema,
13
+ RepoKind$outboundSchema,
14
+ } from "./repokind.js";
10
15
 
11
16
  export type Repo = {
12
17
  createdAt: Date;
@@ -15,6 +20,14 @@ export type Repo = {
15
20
  * Opaque, stable repository id (the canonical key; not a user label).
16
21
  */
17
22
  id: string;
23
+ /**
24
+ * The repository's kind, or `null` for a legacy repository created
25
+ *
26
+ * @remarks
27
+ * before kinds existed and not yet typed through PATCH. An untyped
28
+ * repository is served by every plane.
29
+ */
30
+ kind: RepoKind | null;
18
31
  /**
19
32
  * The repository name (URL label).
20
33
  */
@@ -33,6 +46,7 @@ export const Repo$inboundSchema: z.ZodType<Repo, z.ZodTypeDef, unknown> = z
33
46
  ),
34
47
  description: z.string(),
35
48
  id: z.string(),
49
+ kind: z.nullable(RepoKind$inboundSchema),
36
50
  name: z.string(),
37
51
  org: z.string(),
38
52
  }).transform((v) => {
@@ -45,6 +59,7 @@ export type Repo$Outbound = {
45
59
  created_at: string;
46
60
  description: string;
47
61
  id: string;
62
+ kind: string | null;
48
63
  name: string;
49
64
  org: string;
50
65
  };
@@ -55,6 +70,7 @@ export const Repo$outboundSchema: z.ZodType<Repo$Outbound, z.ZodTypeDef, Repo> =
55
70
  createdAt: z.date().transform(v => v.toISOString()),
56
71
  description: z.string(),
57
72
  id: z.string(),
73
+ kind: z.nullable(RepoKind$outboundSchema),
58
74
  name: z.string(),
59
75
  org: z.string(),
60
76
  }).transform((v) => {
@@ -0,0 +1,43 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { ClosedEnum } from "../../types/enums.js";
7
+
8
+ /**
9
+ * What a repository holds — a property of the content, not of the
10
+ *
11
+ * @remarks
12
+ * client that made it. `repo` is a plain git repository (git, `gh`);
13
+ * `model` and `dataset` are git repositories in the Hugging Face
14
+ * layouts, served under `/api/models` and `/api/datasets` respectively;
15
+ * `image` holds container images served by the OCI registry. Every kind
16
+ * is reachable over git; the HF and OCI planes answer only for their
17
+ * own kinds.
18
+ */
19
+ export const RepoKind = {
20
+ Repo: "repo",
21
+ Model: "model",
22
+ Dataset: "dataset",
23
+ Image: "image",
24
+ } as const;
25
+ /**
26
+ * What a repository holds — a property of the content, not of the
27
+ *
28
+ * @remarks
29
+ * client that made it. `repo` is a plain git repository (git, `gh`);
30
+ * `model` and `dataset` are git repositories in the Hugging Face
31
+ * layouts, served under `/api/models` and `/api/datasets` respectively;
32
+ * `image` holds container images served by the OCI registry. Every kind
33
+ * is reachable over git; the HF and OCI planes answer only for their
34
+ * own kinds.
35
+ */
36
+ export type RepoKind = ClosedEnum<typeof RepoKind>;
37
+
38
+ /** @internal */
39
+ export const RepoKind$inboundSchema: z.ZodNativeEnum<typeof RepoKind> = z
40
+ .nativeEnum(RepoKind);
41
+ /** @internal */
42
+ export const RepoKind$outboundSchema: z.ZodNativeEnum<typeof RepoKind> =
43
+ RepoKind$inboundSchema;
@@ -10,6 +10,13 @@ import * as components from "../components/index.js";
10
10
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
11
 
12
12
  export type ListReposRequest = {
13
+ /**
14
+ * Narrow the listing to one kind. Omit it for every repository,
15
+ *
16
+ * @remarks
17
+ * untyped ones included.
18
+ */
19
+ kind?: components.RepoKind | undefined;
13
20
  /**
14
21
  * Optional external end-user identifier forwarded by the API gateway.
15
22
  */
@@ -29,6 +36,7 @@ export const ListReposRequest$inboundSchema: z.ZodType<
29
36
  z.ZodTypeDef,
30
37
  unknown
31
38
  > = z.object({
39
+ kind: components.RepoKind$inboundSchema.optional(),
32
40
  "X-On-Behalf-Of": z.string().optional(),
33
41
  }).transform((v) => {
34
42
  return remap$(v, {
@@ -37,6 +45,7 @@ export const ListReposRequest$inboundSchema: z.ZodType<
37
45
  });
38
46
  /** @internal */
39
47
  export type ListReposRequest$Outbound = {
48
+ kind?: string | undefined;
40
49
  "X-On-Behalf-Of"?: string | undefined;
41
50
  };
42
51
 
@@ -46,6 +55,7 @@ export const ListReposRequest$outboundSchema: z.ZodType<
46
55
  z.ZodTypeDef,
47
56
  ListReposRequest
48
57
  > = z.object({
58
+ kind: components.RepoKind$outboundSchema.optional(),
49
59
  xOnBehalfOf: z.string().optional(),
50
60
  }).transform((v) => {
51
61
  return remap$(v, {
@@ -50,7 +50,7 @@ export type FlagsEnvironmentsGenerateEvaluationKeyMutationError =
50
50
  * Generate or replace an environment evaluation key
51
51
  *
52
52
  * @remarks
53
- * Returns the new plaintext key once. Only its SHA-256 digest is stored; generating another key immediately replaces the previous credential on this replica.
53
+ * Returns the new plaintext key once. Only its SHA-256 digest and a display hint are stored; generating another key immediately replaces the previous credential on this replica.
54
54
  */
55
55
  export function useFlagsEnvironmentsGenerateEvaluationKeyMutation(
56
56
  options?: MutationHookOptions<
@@ -52,7 +52,9 @@ export type ReposCreateMutationError =
52
52
  * @remarks
53
53
  * Provisions a repository (org owner/admin only): DB insert
54
54
  * (authoritative) → Gitea create (rolled back on failure). The repository
55
- * belongs to the caller's org.
55
+ * belongs to the caller's org. `kind` says what it will hold and defaults
56
+ * to `repo` (a plain git repository); it decides which protocol planes
57
+ * answer for the name (see the `Repo` schema).
56
58
  */
57
59
  export function useReposCreateMutation(
58
60
  options?: MutationHookOptions<
@@ -11,6 +11,7 @@ import { SDKCore } from "../core.js";
11
11
  import { reposList } from "../funcs/reposList.js";
12
12
  import { combineSignals } from "../lib/primitives.js";
13
13
  import { RequestOptions } from "../lib/sdks.js";
14
+ import * as components from "../models/components/index.js";
14
15
  import * as operations from "../models/operations/index.js";
15
16
  import { unwrapAsync } from "../types/fp.js";
16
17
  export type ReposListQueryData = operations.ListReposResponseBody;
@@ -39,7 +40,10 @@ export function buildReposListQuery(
39
40
  queryFn: (context: QueryFunctionContext) => Promise<ReposListQueryData>;
40
41
  } {
41
42
  return {
42
- queryKey: queryKeyReposList({ xOnBehalfOf: request.xOnBehalfOf }),
43
+ queryKey: queryKeyReposList({
44
+ kind: request.kind,
45
+ xOnBehalfOf: request.xOnBehalfOf,
46
+ }),
43
47
  queryFn: async function reposListQueryFn(ctx): Promise<ReposListQueryData> {
44
48
  const sig = combineSignals(
45
49
  ctx.signal,
@@ -62,7 +66,10 @@ export function buildReposListQuery(
62
66
  }
63
67
 
64
68
  export function queryKeyReposList(
65
- parameters: { xOnBehalfOf?: string | undefined },
69
+ parameters: {
70
+ kind?: components.RepoKind | undefined;
71
+ xOnBehalfOf?: string | undefined;
72
+ },
66
73
  ): QueryKey {
67
74
  return ["@meetkai/mka1", "repos", "list", parameters];
68
75
  }
@@ -10,6 +10,7 @@ import {
10
10
  useSuspenseQuery,
11
11
  UseSuspenseQueryResult,
12
12
  } from "@tanstack/react-query";
13
+ import * as components from "../models/components/index.js";
13
14
  import {
14
15
  ConnectionError,
15
16
  InvalidRequestError,
@@ -57,7 +58,9 @@ export type ReposListQueryError =
57
58
  *
58
59
  * @remarks
59
60
  * Returns every repository in the caller's org (org owner/admin only).
60
- * Pure DB read.
61
+ * Pure DB read. With `kind`, only repositories of that kind; an untyped
62
+ * (legacy, `kind: null`) repository appears in the unfiltered listing
63
+ * only.
61
64
  */
62
65
  export function useReposList(
63
66
  request: operations.ListReposRequest,
@@ -79,7 +82,9 @@ export function useReposList(
79
82
  *
80
83
  * @remarks
81
84
  * Returns every repository in the caller's org (org owner/admin only).
82
- * Pure DB read.
85
+ * Pure DB read. With `kind`, only repositories of that kind; an untyped
86
+ * (legacy, `kind: null`) repository appears in the unfiltered listing
87
+ * only.
83
88
  */
84
89
  export function useReposListSuspense(
85
90
  request: operations.ListReposRequest,
@@ -98,7 +103,12 @@ export function useReposListSuspense(
98
103
 
99
104
  export function setReposListData(
100
105
  client: QueryClient,
101
- queryKeyBase: [parameters: { xOnBehalfOf?: string | undefined }],
106
+ queryKeyBase: [
107
+ parameters: {
108
+ kind?: components.RepoKind | undefined;
109
+ xOnBehalfOf?: string | undefined;
110
+ },
111
+ ],
102
112
  data: ReposListQueryData,
103
113
  ): ReposListQueryData | undefined {
104
114
  const key = queryKeyReposList(...queryKeyBase);
@@ -109,7 +119,10 @@ export function setReposListData(
109
119
  export function invalidateReposList(
110
120
  client: QueryClient,
111
121
  queryKeyBase: TupleToPrefixes<
112
- [parameters: { xOnBehalfOf?: string | undefined }]
122
+ [parameters: {
123
+ kind?: components.RepoKind | undefined;
124
+ xOnBehalfOf?: string | undefined;
125
+ }]
113
126
  >,
114
127
  filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
115
128
  ): Promise<void> {
@@ -50,9 +50,18 @@ export type ReposUpdateMutationError =
50
50
  * Update a repository's labels
51
51
  *
52
52
  * @remarks
53
- * Applies a label-only update (name/description); org owner/admin only.
54
- * The repository id is stable, so a rename is a one-row DB update — no
55
- * Gitea write. Omitted fields are left unchanged.
53
+ * Applies a label-only update (name/description/kind); org owner/admin
54
+ * only. The repository id is stable, so a rename is a one-row DB update
55
+ * — no Gitea write. Omitted fields are left unchanged.
56
+ *
57
+ * `kind` is the ONE way a repository's kind changes after creation (the
58
+ * protocol planes never change it): it types a legacy `kind: null`
59
+ * repository and corrects a wrong kind. `repo`, `model` and `dataset`
60
+ * convert freely and any repository may become `image`; a repository
61
+ * that still holds container-image content can be given no other kind
62
+ * — leaving `image`, or typing a legacy `null` row as anything else, is
63
+ * refused with `409 kind_has_content` (delete the tags through the
64
+ * registry first). A kind is never un-set.
56
65
  */
57
66
  export function useReposUpdateMutation(
58
67
  options?: MutationHookOptions<
@@ -131,7 +131,7 @@ export class Environments extends ClientSDK {
131
131
  * Generate or replace an environment evaluation key
132
132
  *
133
133
  * @remarks
134
- * Returns the new plaintext key once. Only its SHA-256 digest is stored; generating another key immediately replaces the previous credential on this replica.
134
+ * Returns the new plaintext key once. Only its SHA-256 digest and a display hint are stored; generating another key immediately replaces the previous credential on this replica.
135
135
  */
136
136
  async generateEvaluationKey(
137
137
  request: operations.GenerateFeatureFlagEvaluationKeyRequest,
package/src/sdk/repos.ts CHANGED
@@ -18,7 +18,9 @@ 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.
21
+ * Pure DB read. With `kind`, only repositories of that kind; an untyped
22
+ * (legacy, `kind: null`) repository appears in the unfiltered listing
23
+ * only.
22
24
  */
23
25
  async list(
24
26
  request: operations.ListReposRequest,
@@ -37,7 +39,9 @@ export class Repos extends ClientSDK {
37
39
  * @remarks
38
40
  * Provisions a repository (org owner/admin only): DB insert
39
41
  * (authoritative) → Gitea create (rolled back on failure). The repository
40
- * belongs to the caller's org.
42
+ * belongs to the caller's org. `kind` says what it will hold and defaults
43
+ * to `repo` (a plain git repository); it decides which protocol planes
44
+ * answer for the name (see the `Repo` schema).
41
45
  */
42
46
  async create(
43
47
  request: operations.CreateRepoRequest,
@@ -90,9 +94,18 @@ export class Repos extends ClientSDK {
90
94
  * Update a repository's labels
91
95
  *
92
96
  * @remarks
93
- * Applies a label-only update (name/description); org owner/admin only.
94
- * The repository id is stable, so a rename is a one-row DB update — no
95
- * Gitea write. Omitted fields are left unchanged.
97
+ * Applies a label-only update (name/description/kind); org owner/admin
98
+ * only. The repository id is stable, so a rename is a one-row DB update
99
+ * — no Gitea write. Omitted fields are left unchanged.
100
+ *
101
+ * `kind` is the ONE way a repository's kind changes after creation (the
102
+ * protocol planes never change it): it types a legacy `kind: null`
103
+ * repository and corrects a wrong kind. `repo`, `model` and `dataset`
104
+ * convert freely and any repository may become `image`; a repository
105
+ * that still holds container-image content can be given no other kind
106
+ * — leaving `image`, or typing a legacy `null` row as anything else, is
107
+ * refused with `409 kind_has_content` (delete the tags through the
108
+ * registry first). A kind is never un-set.
96
109
  */
97
110
  async update(
98
111
  request: operations.PatchRepoRequest,