@claudexor/schema 2.0.0 → 2.1.1

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 (128) hide show
  1. package/dist/agent-capabilities.d.ts +24 -24
  2. package/dist/attachment.d.ts +13 -13
  3. package/dist/auth.d.ts +21 -0
  4. package/dist/auth.d.ts.map +1 -1
  5. package/dist/auth.js +54 -0
  6. package/dist/auth.js.map +1 -1
  7. package/dist/budget.d.ts +17 -5
  8. package/dist/budget.d.ts.map +1 -1
  9. package/dist/budget.js +15 -0
  10. package/dist/budget.js.map +1 -1
  11. package/dist/config.d.ts +380 -20
  12. package/dist/config.d.ts.map +1 -1
  13. package/dist/config.js +81 -0
  14. package/dist/config.js.map +1 -1
  15. package/dist/control-gc.d.ts +185 -0
  16. package/dist/control-gc.d.ts.map +1 -0
  17. package/dist/control-gc.js +81 -0
  18. package/dist/control-gc.js.map +1 -0
  19. package/dist/control-operation-responses.d.ts +155 -29
  20. package/dist/control-operation-responses.d.ts.map +1 -1
  21. package/dist/control-run-detail.d.ts +140 -32
  22. package/dist/control-run-detail.d.ts.map +1 -1
  23. package/dist/control-spec.d.ts +6 -6
  24. package/dist/control-thread-apply.d.ts +2 -2
  25. package/dist/control.d.ts +427 -586
  26. package/dist/control.d.ts.map +1 -1
  27. package/dist/control.js +155 -54
  28. package/dist/control.js.map +1 -1
  29. package/dist/credential-profile.d.ts +454 -0
  30. package/dist/credential-profile.d.ts.map +1 -0
  31. package/dist/credential-profile.js +140 -0
  32. package/dist/credential-profile.js.map +1 -0
  33. package/dist/events.d.ts +20 -6
  34. package/dist/events.d.ts.map +1 -1
  35. package/dist/events.js +22 -0
  36. package/dist/events.js.map +1 -1
  37. package/dist/gate.d.ts +3 -3
  38. package/dist/harness.d.ts +243 -88
  39. package/dist/harness.d.ts.map +1 -1
  40. package/dist/harness.js +124 -46
  41. package/dist/harness.js.map +1 -1
  42. package/dist/index.d.ts +4 -0
  43. package/dist/index.d.ts.map +1 -1
  44. package/dist/index.js +4 -0
  45. package/dist/index.js.map +1 -1
  46. package/dist/orchestrate.d.ts +23 -0
  47. package/dist/orchestrate.d.ts.map +1 -1
  48. package/dist/orchestrate.js +56 -0
  49. package/dist/orchestrate.js.map +1 -1
  50. package/dist/project.d.ts +2 -2
  51. package/dist/quota.d.ts +27 -9
  52. package/dist/quota.d.ts.map +1 -1
  53. package/dist/quota.js +14 -2
  54. package/dist/quota.js.map +1 -1
  55. package/dist/readiness.d.ts +596 -0
  56. package/dist/readiness.d.ts.map +1 -0
  57. package/dist/readiness.js +87 -0
  58. package/dist/readiness.js.map +1 -0
  59. package/dist/request-requirements.d.ts +8 -8
  60. package/dist/request-requirements.d.ts.map +1 -1
  61. package/dist/request-requirements.js +4 -1
  62. package/dist/request-requirements.js.map +1 -1
  63. package/dist/route.d.ts +4 -4
  64. package/dist/setup.d.ts +69 -24
  65. package/dist/setup.d.ts.map +1 -1
  66. package/dist/setup.js +25 -0
  67. package/dist/setup.js.map +1 -1
  68. package/dist/spec.d.ts +4 -4
  69. package/dist/task.d.ts +99 -4
  70. package/dist/task.d.ts.map +1 -1
  71. package/dist/task.js +48 -1
  72. package/dist/task.js.map +1 -1
  73. package/dist/telemetry.d.ts +309 -67
  74. package/dist/telemetry.d.ts.map +1 -1
  75. package/dist/telemetry.js +97 -1
  76. package/dist/telemetry.js.map +1 -1
  77. package/dist/thread.d.ts +26 -15
  78. package/dist/thread.d.ts.map +1 -1
  79. package/dist/thread.js +11 -0
  80. package/dist/thread.js.map +1 -1
  81. package/dist/tool-ref.d.ts +45 -0
  82. package/dist/tool-ref.d.ts.map +1 -0
  83. package/dist/tool-ref.js +45 -0
  84. package/dist/tool-ref.js.map +1 -0
  85. package/dist/workspace.d.ts +2 -2
  86. package/generated/BudgetObservation.schema.json +16 -0
  87. package/generated/ControlCredentialProfileCreateRequest.schema.json +32 -0
  88. package/generated/ControlCredentialProfileCreateResponse.schema.json +142 -0
  89. package/generated/ControlCredentialProfileDeleteResponse.schema.json +107 -0
  90. package/generated/ControlCredentialProfilesResponse.schema.json +155 -0
  91. package/generated/ControlGcReceipt.schema.json +170 -0
  92. package/generated/ControlGcRequest.schema.json +18 -0
  93. package/generated/ControlHarnessListResponse.schema.json +95 -2
  94. package/generated/ControlHarnessModelsResponse.schema.json +19 -0
  95. package/generated/ControlHarnessSettingsPatch.schema.json +9 -0
  96. package/generated/ControlQuotaResponse.schema.json +3 -2
  97. package/generated/ControlRunAgainDraft.schema.json +40 -0
  98. package/generated/ControlRunDetail.schema.json +178 -6
  99. package/generated/ControlRunListResponse.schema.json +174 -3
  100. package/generated/ControlRunStartRequest.schema.json +40 -0
  101. package/generated/ControlRunSummary.schema.json +174 -3
  102. package/generated/ControlSettingsSnapshot.schema.json +10 -0
  103. package/generated/ControlSettingsUpdateRequest.schema.json +9 -0
  104. package/generated/ControlSetupJob.schema.json +8 -0
  105. package/generated/ControlSetupJobCreateRequest.schema.json +5 -0
  106. package/generated/ControlSetupJobEvent.schema.json +8 -0
  107. package/generated/ControlSetupJobListResponse.schema.json +8 -0
  108. package/generated/ControlSetupJobSnapshot.schema.json +8 -0
  109. package/generated/ControlThread.schema.json +16 -4
  110. package/generated/ControlThreadCreateRequest.schema.json +6 -2
  111. package/generated/ControlThreadDetail.schema.json +32 -8
  112. package/generated/ControlThreadListResponse.schema.json +16 -4
  113. package/generated/ControlThreadTurnRequest.schema.json +40 -0
  114. package/generated/ControlThreadUpdateRequest.schema.json +11 -0
  115. package/generated/CredentialProfile.schema.json +78 -0
  116. package/generated/CredentialProfileStatus.schema.json +61 -0
  117. package/generated/GlobalConfig.schema.json +136 -0
  118. package/generated/HarnessEvent.schema.json +62 -5
  119. package/generated/HarnessManifest.schema.json +33 -2
  120. package/generated/HarnessModel.schema.json +19 -0
  121. package/generated/HarnessStatusDto.schema.json +95 -2
  122. package/generated/RunEvent.schema.json +3 -0
  123. package/generated/RunTelemetry.schema.json +202 -2
  124. package/generated/Session.schema.json +14 -0
  125. package/generated/TaskContract.schema.json +65 -4
  126. package/generated/Thread.schema.json +17 -5
  127. package/generated/ThreadHeadPing.schema.json +40 -0
  128. package/package.json +3 -2
@@ -0,0 +1,454 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * The credential transport a profile isolates (INV-135). `config_dir_login` is
4
+ * a vendor-owned login living in a Claudexor-scoped config dir (claude
5
+ * CLAUDE_CONFIG_DIR / codex CODEX_HOME); `oauth_token` and `api_key` are
6
+ * secret-store references. The default vendor dirs (~/.claude, native codex
7
+ * home) are NEVER a profile's isolation locator — profiles are additive.
8
+ */
9
+ export declare const CredentialKind: z.ZodEnum<["config_dir_login", "oauth_token", "api_key"]>;
10
+ export type CredentialKind = z.infer<typeof CredentialKind>;
11
+ /**
12
+ * Durable, NON-SECRET registry entry for one credential identity of one
13
+ * harness (INV-135). Secret material never lives here: `config_dir_login`
14
+ * points at a vendor-owned directory, token/key kinds point at a namespaced
15
+ * secret-store name. Readiness is intentionally NOT durable — it is the
16
+ * doctor's `CredentialProfileStatus` projection.
17
+ */
18
+ export declare const CredentialProfile: z.ZodEffects<z.ZodObject<{
19
+ profile_id: z.ZodString;
20
+ harness_id: z.ZodString;
21
+ display_name: z.ZodString;
22
+ credential_kind: z.ZodEnum<["config_dir_login", "oauth_token", "api_key"]>;
23
+ isolation_locator: z.ZodDefault<z.ZodNullable<z.ZodString>>;
24
+ secret_ref: z.ZodDefault<z.ZodNullable<z.ZodString>>;
25
+ enabled: z.ZodDefault<z.ZodBoolean>;
26
+ created_at: z.ZodDefault<z.ZodNullable<z.ZodString>>;
27
+ }, "strict", z.ZodTypeAny, {
28
+ profile_id: string;
29
+ harness_id: string;
30
+ display_name: string;
31
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
32
+ isolation_locator: string | null;
33
+ secret_ref: string | null;
34
+ enabled: boolean;
35
+ created_at: string | null;
36
+ }, {
37
+ profile_id: string;
38
+ harness_id: string;
39
+ display_name: string;
40
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
41
+ isolation_locator?: string | null | undefined;
42
+ secret_ref?: string | null | undefined;
43
+ enabled?: boolean | undefined;
44
+ created_at?: string | null | undefined;
45
+ }>, {
46
+ profile_id: string;
47
+ harness_id: string;
48
+ display_name: string;
49
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
50
+ isolation_locator: string | null;
51
+ secret_ref: string | null;
52
+ enabled: boolean;
53
+ created_at: string | null;
54
+ }, {
55
+ profile_id: string;
56
+ harness_id: string;
57
+ display_name: string;
58
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
59
+ isolation_locator?: string | null | undefined;
60
+ secret_ref?: string | null | undefined;
61
+ enabled?: boolean | undefined;
62
+ created_at?: string | null | undefined;
63
+ }>;
64
+ export type CredentialProfile = z.infer<typeof CredentialProfile>;
65
+ /**
66
+ * Doctor-owned readiness projection for one profile — deliberately separate
67
+ * from the durable registry entry so stored config never asserts liveness.
68
+ */
69
+ export declare const CredentialProfileStatus: z.ZodObject<{
70
+ profile_id: z.ZodString;
71
+ harness_id: z.ZodString;
72
+ availability: z.ZodEnum<["available", "unavailable", "unknown"]>;
73
+ verification: z.ZodEnum<["passed", "failed", "not_run"]>;
74
+ detail: z.ZodOptional<z.ZodString>;
75
+ last_verified_at: z.ZodDefault<z.ZodNullable<z.ZodString>>;
76
+ }, "strict", z.ZodTypeAny, {
77
+ availability: "unknown" | "available" | "unavailable";
78
+ verification: "passed" | "failed" | "not_run";
79
+ profile_id: string;
80
+ harness_id: string;
81
+ last_verified_at: string | null;
82
+ detail?: string | undefined;
83
+ }, {
84
+ availability: "unknown" | "available" | "unavailable";
85
+ verification: "passed" | "failed" | "not_run";
86
+ profile_id: string;
87
+ harness_id: string;
88
+ detail?: string | undefined;
89
+ last_verified_at?: string | null | undefined;
90
+ }>;
91
+ export type CredentialProfileStatus = z.infer<typeof CredentialProfileStatus>;
92
+ /** Control response: every registered profile with its doctor projection. */
93
+ export declare const ControlCredentialProfilesResponse: z.ZodObject<{
94
+ profiles: z.ZodArray<z.ZodObject<{
95
+ profile: z.ZodEffects<z.ZodObject<{
96
+ profile_id: z.ZodString;
97
+ harness_id: z.ZodString;
98
+ display_name: z.ZodString;
99
+ credential_kind: z.ZodEnum<["config_dir_login", "oauth_token", "api_key"]>;
100
+ isolation_locator: z.ZodDefault<z.ZodNullable<z.ZodString>>;
101
+ secret_ref: z.ZodDefault<z.ZodNullable<z.ZodString>>;
102
+ enabled: z.ZodDefault<z.ZodBoolean>;
103
+ created_at: z.ZodDefault<z.ZodNullable<z.ZodString>>;
104
+ }, "strict", z.ZodTypeAny, {
105
+ profile_id: string;
106
+ harness_id: string;
107
+ display_name: string;
108
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
109
+ isolation_locator: string | null;
110
+ secret_ref: string | null;
111
+ enabled: boolean;
112
+ created_at: string | null;
113
+ }, {
114
+ profile_id: string;
115
+ harness_id: string;
116
+ display_name: string;
117
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
118
+ isolation_locator?: string | null | undefined;
119
+ secret_ref?: string | null | undefined;
120
+ enabled?: boolean | undefined;
121
+ created_at?: string | null | undefined;
122
+ }>, {
123
+ profile_id: string;
124
+ harness_id: string;
125
+ display_name: string;
126
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
127
+ isolation_locator: string | null;
128
+ secret_ref: string | null;
129
+ enabled: boolean;
130
+ created_at: string | null;
131
+ }, {
132
+ profile_id: string;
133
+ harness_id: string;
134
+ display_name: string;
135
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
136
+ isolation_locator?: string | null | undefined;
137
+ secret_ref?: string | null | undefined;
138
+ enabled?: boolean | undefined;
139
+ created_at?: string | null | undefined;
140
+ }>;
141
+ status: z.ZodObject<{
142
+ profile_id: z.ZodString;
143
+ harness_id: z.ZodString;
144
+ availability: z.ZodEnum<["available", "unavailable", "unknown"]>;
145
+ verification: z.ZodEnum<["passed", "failed", "not_run"]>;
146
+ detail: z.ZodOptional<z.ZodString>;
147
+ last_verified_at: z.ZodDefault<z.ZodNullable<z.ZodString>>;
148
+ }, "strict", z.ZodTypeAny, {
149
+ availability: "unknown" | "available" | "unavailable";
150
+ verification: "passed" | "failed" | "not_run";
151
+ profile_id: string;
152
+ harness_id: string;
153
+ last_verified_at: string | null;
154
+ detail?: string | undefined;
155
+ }, {
156
+ availability: "unknown" | "available" | "unavailable";
157
+ verification: "passed" | "failed" | "not_run";
158
+ profile_id: string;
159
+ harness_id: string;
160
+ detail?: string | undefined;
161
+ last_verified_at?: string | null | undefined;
162
+ }>;
163
+ }, "strict", z.ZodTypeAny, {
164
+ status: {
165
+ availability: "unknown" | "available" | "unavailable";
166
+ verification: "passed" | "failed" | "not_run";
167
+ profile_id: string;
168
+ harness_id: string;
169
+ last_verified_at: string | null;
170
+ detail?: string | undefined;
171
+ };
172
+ profile: {
173
+ profile_id: string;
174
+ harness_id: string;
175
+ display_name: string;
176
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
177
+ isolation_locator: string | null;
178
+ secret_ref: string | null;
179
+ enabled: boolean;
180
+ created_at: string | null;
181
+ };
182
+ }, {
183
+ status: {
184
+ availability: "unknown" | "available" | "unavailable";
185
+ verification: "passed" | "failed" | "not_run";
186
+ profile_id: string;
187
+ harness_id: string;
188
+ detail?: string | undefined;
189
+ last_verified_at?: string | null | undefined;
190
+ };
191
+ profile: {
192
+ profile_id: string;
193
+ harness_id: string;
194
+ display_name: string;
195
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
196
+ isolation_locator?: string | null | undefined;
197
+ secret_ref?: string | null | undefined;
198
+ enabled?: boolean | undefined;
199
+ created_at?: string | null | undefined;
200
+ };
201
+ }>, "many">;
202
+ }, "strict", z.ZodTypeAny, {
203
+ profiles: {
204
+ status: {
205
+ availability: "unknown" | "available" | "unavailable";
206
+ verification: "passed" | "failed" | "not_run";
207
+ profile_id: string;
208
+ harness_id: string;
209
+ last_verified_at: string | null;
210
+ detail?: string | undefined;
211
+ };
212
+ profile: {
213
+ profile_id: string;
214
+ harness_id: string;
215
+ display_name: string;
216
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
217
+ isolation_locator: string | null;
218
+ secret_ref: string | null;
219
+ enabled: boolean;
220
+ created_at: string | null;
221
+ };
222
+ }[];
223
+ }, {
224
+ profiles: {
225
+ status: {
226
+ availability: "unknown" | "available" | "unavailable";
227
+ verification: "passed" | "failed" | "not_run";
228
+ profile_id: string;
229
+ harness_id: string;
230
+ detail?: string | undefined;
231
+ last_verified_at?: string | null | undefined;
232
+ };
233
+ profile: {
234
+ profile_id: string;
235
+ harness_id: string;
236
+ display_name: string;
237
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
238
+ isolation_locator?: string | null | undefined;
239
+ secret_ref?: string | null | undefined;
240
+ enabled?: boolean | undefined;
241
+ created_at?: string | null | undefined;
242
+ };
243
+ }[];
244
+ }>;
245
+ export type ControlCredentialProfilesResponse = z.infer<typeof ControlCredentialProfilesResponse>;
246
+ /** Register a config-dir login profile (claude/codex) from a UI surface —
247
+ * the same ONE locked registration owner `claudexor profiles add` uses. */
248
+ export declare const ControlCredentialProfileCreateRequest: z.ZodObject<{
249
+ harnessId: z.ZodString;
250
+ profileId: z.ZodString;
251
+ displayName: z.ZodOptional<z.ZodString>;
252
+ }, "strict", z.ZodTypeAny, {
253
+ harnessId: string;
254
+ profileId: string;
255
+ displayName?: string | undefined;
256
+ }, {
257
+ harnessId: string;
258
+ profileId: string;
259
+ displayName?: string | undefined;
260
+ }>;
261
+ export type ControlCredentialProfileCreateRequest = z.infer<typeof ControlCredentialProfileCreateRequest>;
262
+ /** DELETE /credential-profiles/:harness/:id — removes the registry entry and
263
+ * the profile's OWN credential material (its scoped login dir, or its
264
+ * namespaced secret). The default vendor store is untouchable by design. */
265
+ export declare const ControlCredentialProfileDeleteResponse: z.ZodObject<{
266
+ profile: z.ZodEffects<z.ZodObject<{
267
+ profile_id: z.ZodString;
268
+ harness_id: z.ZodString;
269
+ display_name: z.ZodString;
270
+ credential_kind: z.ZodEnum<["config_dir_login", "oauth_token", "api_key"]>;
271
+ isolation_locator: z.ZodDefault<z.ZodNullable<z.ZodString>>;
272
+ secret_ref: z.ZodDefault<z.ZodNullable<z.ZodString>>;
273
+ enabled: z.ZodDefault<z.ZodBoolean>;
274
+ created_at: z.ZodDefault<z.ZodNullable<z.ZodString>>;
275
+ }, "strict", z.ZodTypeAny, {
276
+ profile_id: string;
277
+ harness_id: string;
278
+ display_name: string;
279
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
280
+ isolation_locator: string | null;
281
+ secret_ref: string | null;
282
+ enabled: boolean;
283
+ created_at: string | null;
284
+ }, {
285
+ profile_id: string;
286
+ harness_id: string;
287
+ display_name: string;
288
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
289
+ isolation_locator?: string | null | undefined;
290
+ secret_ref?: string | null | undefined;
291
+ enabled?: boolean | undefined;
292
+ created_at?: string | null | undefined;
293
+ }>, {
294
+ profile_id: string;
295
+ harness_id: string;
296
+ display_name: string;
297
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
298
+ isolation_locator: string | null;
299
+ secret_ref: string | null;
300
+ enabled: boolean;
301
+ created_at: string | null;
302
+ }, {
303
+ profile_id: string;
304
+ harness_id: string;
305
+ display_name: string;
306
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
307
+ isolation_locator?: string | null | undefined;
308
+ secret_ref?: string | null | undefined;
309
+ enabled?: boolean | undefined;
310
+ created_at?: string | null | undefined;
311
+ }>;
312
+ removed: z.ZodLiteral<true>;
313
+ credentialCleanup: z.ZodEnum<["config_dir_removed", "secret_deleted", "none"]>;
314
+ cleanupWarning: z.ZodOptional<z.ZodString>;
315
+ }, "strict", z.ZodTypeAny, {
316
+ profile: {
317
+ profile_id: string;
318
+ harness_id: string;
319
+ display_name: string;
320
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
321
+ isolation_locator: string | null;
322
+ secret_ref: string | null;
323
+ enabled: boolean;
324
+ created_at: string | null;
325
+ };
326
+ removed: true;
327
+ credentialCleanup: "none" | "config_dir_removed" | "secret_deleted";
328
+ cleanupWarning?: string | undefined;
329
+ }, {
330
+ profile: {
331
+ profile_id: string;
332
+ harness_id: string;
333
+ display_name: string;
334
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
335
+ isolation_locator?: string | null | undefined;
336
+ secret_ref?: string | null | undefined;
337
+ enabled?: boolean | undefined;
338
+ created_at?: string | null | undefined;
339
+ };
340
+ removed: true;
341
+ credentialCleanup: "none" | "config_dir_removed" | "secret_deleted";
342
+ cleanupWarning?: string | undefined;
343
+ }>;
344
+ export type ControlCredentialProfileDeleteResponse = z.infer<typeof ControlCredentialProfileDeleteResponse>;
345
+ export declare const ControlCredentialProfileCreateResponse: z.ZodObject<{
346
+ profile: z.ZodEffects<z.ZodObject<{
347
+ profile_id: z.ZodString;
348
+ harness_id: z.ZodString;
349
+ display_name: z.ZodString;
350
+ credential_kind: z.ZodEnum<["config_dir_login", "oauth_token", "api_key"]>;
351
+ isolation_locator: z.ZodDefault<z.ZodNullable<z.ZodString>>;
352
+ secret_ref: z.ZodDefault<z.ZodNullable<z.ZodString>>;
353
+ enabled: z.ZodDefault<z.ZodBoolean>;
354
+ created_at: z.ZodDefault<z.ZodNullable<z.ZodString>>;
355
+ }, "strict", z.ZodTypeAny, {
356
+ profile_id: string;
357
+ harness_id: string;
358
+ display_name: string;
359
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
360
+ isolation_locator: string | null;
361
+ secret_ref: string | null;
362
+ enabled: boolean;
363
+ created_at: string | null;
364
+ }, {
365
+ profile_id: string;
366
+ harness_id: string;
367
+ display_name: string;
368
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
369
+ isolation_locator?: string | null | undefined;
370
+ secret_ref?: string | null | undefined;
371
+ enabled?: boolean | undefined;
372
+ created_at?: string | null | undefined;
373
+ }>, {
374
+ profile_id: string;
375
+ harness_id: string;
376
+ display_name: string;
377
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
378
+ isolation_locator: string | null;
379
+ secret_ref: string | null;
380
+ enabled: boolean;
381
+ created_at: string | null;
382
+ }, {
383
+ profile_id: string;
384
+ harness_id: string;
385
+ display_name: string;
386
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
387
+ isolation_locator?: string | null | undefined;
388
+ secret_ref?: string | null | undefined;
389
+ enabled?: boolean | undefined;
390
+ created_at?: string | null | undefined;
391
+ }>;
392
+ status: z.ZodObject<{
393
+ profile_id: z.ZodString;
394
+ harness_id: z.ZodString;
395
+ availability: z.ZodEnum<["available", "unavailable", "unknown"]>;
396
+ verification: z.ZodEnum<["passed", "failed", "not_run"]>;
397
+ detail: z.ZodOptional<z.ZodString>;
398
+ last_verified_at: z.ZodDefault<z.ZodNullable<z.ZodString>>;
399
+ }, "strict", z.ZodTypeAny, {
400
+ availability: "unknown" | "available" | "unavailable";
401
+ verification: "passed" | "failed" | "not_run";
402
+ profile_id: string;
403
+ harness_id: string;
404
+ last_verified_at: string | null;
405
+ detail?: string | undefined;
406
+ }, {
407
+ availability: "unknown" | "available" | "unavailable";
408
+ verification: "passed" | "failed" | "not_run";
409
+ profile_id: string;
410
+ harness_id: string;
411
+ detail?: string | undefined;
412
+ last_verified_at?: string | null | undefined;
413
+ }>;
414
+ }, "strict", z.ZodTypeAny, {
415
+ status: {
416
+ availability: "unknown" | "available" | "unavailable";
417
+ verification: "passed" | "failed" | "not_run";
418
+ profile_id: string;
419
+ harness_id: string;
420
+ last_verified_at: string | null;
421
+ detail?: string | undefined;
422
+ };
423
+ profile: {
424
+ profile_id: string;
425
+ harness_id: string;
426
+ display_name: string;
427
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
428
+ isolation_locator: string | null;
429
+ secret_ref: string | null;
430
+ enabled: boolean;
431
+ created_at: string | null;
432
+ };
433
+ }, {
434
+ status: {
435
+ availability: "unknown" | "available" | "unavailable";
436
+ verification: "passed" | "failed" | "not_run";
437
+ profile_id: string;
438
+ harness_id: string;
439
+ detail?: string | undefined;
440
+ last_verified_at?: string | null | undefined;
441
+ };
442
+ profile: {
443
+ profile_id: string;
444
+ harness_id: string;
445
+ display_name: string;
446
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
447
+ isolation_locator?: string | null | undefined;
448
+ secret_ref?: string | null | undefined;
449
+ enabled?: boolean | undefined;
450
+ created_at?: string | null | undefined;
451
+ };
452
+ }>;
453
+ export type ControlCredentialProfileCreateResponse = z.infer<typeof ControlCredentialProfileCreateResponse>;
454
+ //# sourceMappingURL=credential-profile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credential-profile.d.ts","sourceRoot":"","sources":["../src/credential-profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,2DAIxB,CAAC;AACJ,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE5D;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6D3B,CAAC;AACJ,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE;;;GAGG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;EAY8D,CAAC;AACnG,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE9E,6EAA6E;AAC7E,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOuC,CAAC;AACtF,MAAM,MAAM,iCAAiC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAElG;2EAC2E;AAC3E,eAAO,MAAM,qCAAqC;;;;;;;;;;;;EAWQ,CAAC;AAC3D,MAAM,MAAM,qCAAqC,GAAG,CAAC,CAAC,KAAK,CACzD,OAAO,qCAAqC,CAC7C,CAAC;AAEF;;4EAE4E;AAC5E,eAAO,MAAM,sCAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAaK,CAAC;AACzD,MAAM,MAAM,sCAAsC,GAAG,CAAC,CAAC,KAAK,CAC1D,OAAO,sCAAsC,CAC9C,CAAC;AAEF,eAAO,MAAM,sCAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGgC,CAAC;AACpF,MAAM,MAAM,sCAAsC,GAAG,CAAC,CAAC,KAAK,CAC1D,OAAO,sCAAsC,CAC9C,CAAC"}
@@ -0,0 +1,140 @@
1
+ import { z } from "zod";
2
+ import { namespacedSecretRefBase } from "@claudexor/util";
3
+ import { Id, IsoTimestamp } from "./primitives.js";
4
+ import { AuthAvailability, AuthVerification } from "./auth.js";
5
+ /**
6
+ * The credential transport a profile isolates (INV-135). `config_dir_login` is
7
+ * a vendor-owned login living in a Claudexor-scoped config dir (claude
8
+ * CLAUDE_CONFIG_DIR / codex CODEX_HOME); `oauth_token` and `api_key` are
9
+ * secret-store references. The default vendor dirs (~/.claude, native codex
10
+ * home) are NEVER a profile's isolation locator — profiles are additive.
11
+ */
12
+ export const CredentialKind = z
13
+ .enum(["config_dir_login", "oauth_token", "api_key"])
14
+ .describe("Credential transport a profile isolates: a scoped vendor config-dir login, a stored OAuth token, or a stored API key.");
15
+ /**
16
+ * Durable, NON-SECRET registry entry for one credential identity of one
17
+ * harness (INV-135). Secret material never lives here: `config_dir_login`
18
+ * points at a vendor-owned directory, token/key kinds point at a namespaced
19
+ * secret-store name. Readiness is intentionally NOT durable — it is the
20
+ * doctor's `CredentialProfileStatus` projection.
21
+ */
22
+ export const CredentialProfile = z
23
+ .object({
24
+ profile_id: Id.describe("Stable user-chosen profile identifier (unique per harness)."),
25
+ harness_id: Id.describe("Harness family this profile belongs to."),
26
+ display_name: z.string().min(1).describe("Human label shown wherever the profile appears."),
27
+ credential_kind: CredentialKind,
28
+ isolation_locator: z
29
+ .string()
30
+ .nullable()
31
+ .default(null)
32
+ .describe("Canonical absolute config-dir path for config_dir_login profiles; null for secret-ref kinds."),
33
+ secret_ref: z
34
+ .string()
35
+ .nullable()
36
+ .default(null)
37
+ .describe("Namespaced secret-store name (e.g. claude_oauth:work) for oauth_token/api_key profiles; null for config_dir_login."),
38
+ enabled: z.boolean().default(true).describe("Disabled profiles are never routable."),
39
+ created_at: IsoTimestamp.nullable()
40
+ .default(null)
41
+ .describe("When the profile was registered; null for hand-written config entries."),
42
+ })
43
+ .strict()
44
+ .superRefine((profile, ctx) => {
45
+ if (profile.credential_kind === "config_dir_login") {
46
+ if (!profile.isolation_locator)
47
+ ctx.addIssue({
48
+ code: "custom",
49
+ message: "config_dir_login profiles require isolation_locator (the scoped config dir)",
50
+ });
51
+ if (profile.secret_ref)
52
+ ctx.addIssue({
53
+ code: "custom",
54
+ message: "config_dir_login profiles must not carry secret_ref",
55
+ });
56
+ }
57
+ else {
58
+ if (!profile.secret_ref)
59
+ ctx.addIssue({
60
+ code: "custom",
61
+ message: `${profile.credential_kind} profiles require secret_ref`,
62
+ });
63
+ // Release wave round-15 #5: a profile's ref must be NAMESPACED
64
+ // (`base:profile`). A bare engine-default slot (e.g. "anthropic") would
65
+ // silently alias the default credential — profiles are ADDITIVE.
66
+ else if (namespacedSecretRefBase(profile.secret_ref) === null)
67
+ ctx.addIssue({
68
+ code: "custom",
69
+ message: `secret_ref "${profile.secret_ref}" must be a namespaced managed slot (base:profile, e.g. claude_oauth:work); bare engine-default slots would alias the default credential`,
70
+ });
71
+ if (profile.isolation_locator)
72
+ ctx.addIssue({
73
+ code: "custom",
74
+ message: `${profile.credential_kind} profiles must not carry isolation_locator`,
75
+ });
76
+ }
77
+ })
78
+ .describe("Durable non-secret registry entry for one credential identity of one harness; secret material lives in the vendor dir or the secret store, never here.");
79
+ /**
80
+ * Doctor-owned readiness projection for one profile — deliberately separate
81
+ * from the durable registry entry so stored config never asserts liveness.
82
+ */
83
+ export const CredentialProfileStatus = z
84
+ .object({
85
+ profile_id: Id,
86
+ harness_id: Id,
87
+ availability: AuthAvailability,
88
+ verification: AuthVerification,
89
+ detail: z.string().optional().describe("Redacted human-readable probe evidence."),
90
+ last_verified_at: IsoTimestamp.nullable()
91
+ .default(null)
92
+ .describe("When a probe last verified this profile; null = never verified."),
93
+ })
94
+ .strict()
95
+ .describe("Doctor-owned readiness projection for one credential profile; never durable config.");
96
+ /** Control response: every registered profile with its doctor projection. */
97
+ export const ControlCredentialProfilesResponse = z
98
+ .object({
99
+ profiles: z
100
+ .array(z.object({ profile: CredentialProfile, status: CredentialProfileStatus }).strict())
101
+ .describe("Every registered credential profile paired with its doctor readiness projection."),
102
+ })
103
+ .strict()
104
+ .describe("Credential-profile registry listing with per-profile doctor readiness.");
105
+ /** Register a config-dir login profile (claude/codex) from a UI surface —
106
+ * the same ONE locked registration owner `claudexor profiles add` uses. */
107
+ export const ControlCredentialProfileCreateRequest = z
108
+ .object({
109
+ harnessId: Id.describe("Harness family (claude | codex) for the config-dir login profile."),
110
+ profileId: Id.describe("New profile id (bounded slug, unique per harness)."),
111
+ displayName: z
112
+ .string()
113
+ .min(1)
114
+ .optional()
115
+ .describe("Human label shown wherever the account appears; defaults to the id."),
116
+ })
117
+ .strict()
118
+ .describe("Request body for POST /credential-profiles.");
119
+ /** DELETE /credential-profiles/:harness/:id — removes the registry entry and
120
+ * the profile's OWN credential material (its scoped login dir, or its
121
+ * namespaced secret). The default vendor store is untouchable by design. */
122
+ export const ControlCredentialProfileDeleteResponse = z
123
+ .object({
124
+ profile: CredentialProfile.describe("The removed registry entry."),
125
+ removed: z.literal(true),
126
+ credentialCleanup: z
127
+ .enum(["config_dir_removed", "secret_deleted", "none"])
128
+ .describe("What credential material was deleted alongside the registry entry."),
129
+ cleanupWarning: z
130
+ .string()
131
+ .optional()
132
+ .describe("Present when the registry entry was removed but cleanup failed (orphan left)."),
133
+ })
134
+ .strict()
135
+ .describe("Receipt for a credential-profile removal.");
136
+ export const ControlCredentialProfileCreateResponse = z
137
+ .object({ profile: CredentialProfile, status: CredentialProfileStatus })
138
+ .strict()
139
+ .describe("The registered profile with its initial doctor readiness projection.");
140
+ //# sourceMappingURL=credential-profile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credential-profile.js","sourceRoot":"","sources":["../src/credential-profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,EAAE,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE/D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC;KAC5B,IAAI,CAAC,CAAC,kBAAkB,EAAE,aAAa,EAAE,SAAS,CAAC,CAAC;KACpD,QAAQ,CACP,uHAAuH,CACxH,CAAC;AAGJ;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC;KAC/B,MAAM,CAAC;IACN,UAAU,EAAE,EAAE,CAAC,QAAQ,CAAC,6DAA6D,CAAC;IACtF,UAAU,EAAE,EAAE,CAAC,QAAQ,CAAC,yCAAyC,CAAC;IAClE,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC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