@sealant/api-contracts-next 0.40.0-next.763 → 0.40.0-next.764
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core-api/connected-accounts.d.ts +95 -4
- package/dist/core-api/connected-accounts.js +29 -6
- package/dist/core-api/control-plane.d.ts +1269 -1224
- package/dist/core-api/inference.d.ts +6 -1
- package/dist/core-api/inference.js +9 -2
- package/dist/core-api/profiles.d.ts +24 -0
- package/dist/core-api/system.d.ts +12 -0
- package/dist/core-api/system.js +6 -0
- package/dist/core-api/workspaces.d.ts +8 -6
- package/dist/core-api/workspaces.js +8 -6
- package/package.json +2 -2
|
@@ -21,6 +21,17 @@ export declare const connectedAccountCredentialSchema: Schema.Struct<{
|
|
|
21
21
|
readonly lastRefreshOutcome: Schema.NullOr<Schema.Literals<readonly ["refreshed", "fresh", "failed"]>>;
|
|
22
22
|
}>;
|
|
23
23
|
export type ConnectedAccountCredential = typeof connectedAccountCredentialSchema.Type;
|
|
24
|
+
/** What the person pays with: their subscription's login, or an API key billed per token. */
|
|
25
|
+
export declare const connectedAccountLoginClassSchema: Schema.Literals<readonly ["subscription", "api-key"]>;
|
|
26
|
+
export type ConnectedAccountLoginClass = typeof connectedAccountLoginClassSchema.Type;
|
|
27
|
+
/** A Claude or Codex account's login class; a key with its last four characters. */
|
|
28
|
+
export declare const connectedAccountLoginSchema: Schema.Union<readonly [Schema.Struct<{
|
|
29
|
+
readonly kind: Schema.Literal<"subscription">;
|
|
30
|
+
}>, Schema.Struct<{
|
|
31
|
+
readonly kind: Schema.Literal<"api-key">;
|
|
32
|
+
readonly suffix: Schema.String;
|
|
33
|
+
}>]>;
|
|
34
|
+
export type ConnectedAccountLogin = typeof connectedAccountLoginSchema.Type;
|
|
24
35
|
export declare const connectedAccountSummarySchema: Schema.Struct<{
|
|
25
36
|
readonly connectedAccountId: Schema.String;
|
|
26
37
|
readonly ownerUserId: Schema.String;
|
|
@@ -51,6 +62,13 @@ export declare const connectedAccountSummarySchema: Schema.Struct<{
|
|
|
51
62
|
* stores different bytes. Absent from older control planes.
|
|
52
63
|
*/
|
|
53
64
|
readonly credentialRevision: Schema.optional<Schema.Int>;
|
|
65
|
+
/** Claude and Codex only: the account's login class. Absent from older control planes. */
|
|
66
|
+
readonly login: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
67
|
+
readonly kind: Schema.Literal<"subscription">;
|
|
68
|
+
}>, Schema.Struct<{
|
|
69
|
+
readonly kind: Schema.Literal<"api-key">;
|
|
70
|
+
readonly suffix: Schema.String;
|
|
71
|
+
}>]>>;
|
|
54
72
|
}>;
|
|
55
73
|
export type ConnectedAccountSummary = typeof connectedAccountSummarySchema.Type;
|
|
56
74
|
export declare const createConnectedAccountRequestSchema: Schema.Struct<{
|
|
@@ -60,14 +78,21 @@ export declare const createConnectedAccountRequestSchema: Schema.Struct<{
|
|
|
60
78
|
* The account to connect or replace by name; a new name is a new account, and `default` names
|
|
61
79
|
* the owner's chosen default. The owner's first account for the provider is named `default`
|
|
62
80
|
* whatever this says. With neither `name` nor `accountId` (or `default` while none is chosen),
|
|
63
|
-
* the owner's only account is replaced,
|
|
64
|
-
*
|
|
81
|
+
* the owner's only account of the secret's login class is replaced, so a key never replaces a
|
|
82
|
+
* subscription. With none of that class a new account is made, named `api-key` or
|
|
83
|
+
* `subscription` (with a number when the name is taken), and with several the connect is
|
|
84
|
+
* refused (`409`, `connected-account-ambiguous`, with `candidateAccountIds`).
|
|
65
85
|
*/
|
|
66
86
|
readonly name: Schema.optional<Schema.String>;
|
|
67
87
|
/** Replace this account (the owner's, of `provider`). Not with `name`. */
|
|
68
88
|
readonly accountId: Schema.optional<Schema.String>;
|
|
69
89
|
/** Make the connected account the owner's default for the provider, in the same write. */
|
|
70
90
|
readonly makeDefault: Schema.optional<Schema.Boolean>;
|
|
91
|
+
/**
|
|
92
|
+
* Claude and Codex only: the login class the caller expects the secret to be. A secret of the
|
|
93
|
+
* other class is refused (`400`) before anything is stored.
|
|
94
|
+
*/
|
|
95
|
+
readonly login: Schema.optional<Schema.Literals<readonly ["subscription", "api-key"]>>;
|
|
71
96
|
readonly secret: Schema.String;
|
|
72
97
|
}>;
|
|
73
98
|
export type CreateConnectedAccountRequest = typeof createConnectedAccountRequestSchema.Type;
|
|
@@ -106,7 +131,19 @@ export declare const listConnectedAccountsResponseSchema: Schema.Struct<{
|
|
|
106
131
|
* stores different bytes. Absent from older control planes.
|
|
107
132
|
*/
|
|
108
133
|
readonly credentialRevision: Schema.optional<Schema.Int>;
|
|
134
|
+
/** Claude and Codex only: the account's login class. Absent from older control planes. */
|
|
135
|
+
readonly login: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
136
|
+
readonly kind: Schema.Literal<"subscription">;
|
|
137
|
+
}>, Schema.Struct<{
|
|
138
|
+
readonly kind: Schema.Literal<"api-key">;
|
|
139
|
+
readonly suffix: Schema.String;
|
|
140
|
+
}>]>>;
|
|
109
141
|
}>>;
|
|
142
|
+
/**
|
|
143
|
+
* Whether the owner ever connected an API key, archived ones included, so a surface keeps saying
|
|
144
|
+
* which login a turn spent after the key is gone. Absent from older control planes.
|
|
145
|
+
*/
|
|
146
|
+
readonly hasApiKeyHistory: Schema.optional<Schema.Boolean>;
|
|
110
147
|
}>;
|
|
111
148
|
export type ListConnectedAccountsResponse = typeof listConnectedAccountsResponseSchema.Type;
|
|
112
149
|
export declare const markConnectedAccountInvalidRequestSchema: Schema.Struct<{
|
|
@@ -148,6 +185,13 @@ export declare const markConnectedAccountInvalidResponseSchema: Schema.Struct<{
|
|
|
148
185
|
* stores different bytes. Absent from older control planes.
|
|
149
186
|
*/
|
|
150
187
|
readonly credentialRevision: Schema.optional<Schema.Int>;
|
|
188
|
+
/** Claude and Codex only: the account's login class. Absent from older control planes. */
|
|
189
|
+
readonly login: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
190
|
+
readonly kind: Schema.Literal<"subscription">;
|
|
191
|
+
}>, Schema.Struct<{
|
|
192
|
+
readonly kind: Schema.Literal<"api-key">;
|
|
193
|
+
readonly suffix: Schema.String;
|
|
194
|
+
}>]>>;
|
|
151
195
|
/** `marked`: the account is now invalid. `superseded`: a newer credential, left as it was. */
|
|
152
196
|
readonly outcome: Schema.optional<Schema.Literals<readonly ["marked", "superseded"]>>;
|
|
153
197
|
}>;
|
|
@@ -224,6 +268,13 @@ export declare const ConnectedAccountsGroup: HttpApiGroup.HttpApiGroup<"connecte
|
|
|
224
268
|
* stores different bytes. Absent from older control planes.
|
|
225
269
|
*/
|
|
226
270
|
readonly credentialRevision: Schema.optional<Schema.Int>;
|
|
271
|
+
/** Claude and Codex only: the account's login class. Absent from older control planes. */
|
|
272
|
+
readonly login: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
273
|
+
readonly kind: Schema.Literal<"subscription">;
|
|
274
|
+
}>, Schema.Struct<{
|
|
275
|
+
readonly kind: Schema.Literal<"api-key">;
|
|
276
|
+
readonly suffix: Schema.String;
|
|
277
|
+
}>]>>;
|
|
227
278
|
}>>, Schema.toCodecJson<typeof ConnectedAccountNotFoundError | typeof ConnectedAccountInternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"createConnectedAccount", "POST", "/", never, never, Schema.toCodecJson<Schema.Struct<{
|
|
228
279
|
readonly ownerUserId: Schema.String;
|
|
229
280
|
readonly provider: Schema.Literals<readonly ["claude", "codex", "github"]>;
|
|
@@ -231,14 +282,21 @@ export declare const ConnectedAccountsGroup: HttpApiGroup.HttpApiGroup<"connecte
|
|
|
231
282
|
* The account to connect or replace by name; a new name is a new account, and `default` names
|
|
232
283
|
* the owner's chosen default. The owner's first account for the provider is named `default`
|
|
233
284
|
* whatever this says. With neither `name` nor `accountId` (or `default` while none is chosen),
|
|
234
|
-
* the owner's only account is replaced,
|
|
235
|
-
*
|
|
285
|
+
* the owner's only account of the secret's login class is replaced, so a key never replaces a
|
|
286
|
+
* subscription. With none of that class a new account is made, named `api-key` or
|
|
287
|
+
* `subscription` (with a number when the name is taken), and with several the connect is
|
|
288
|
+
* refused (`409`, `connected-account-ambiguous`, with `candidateAccountIds`).
|
|
236
289
|
*/
|
|
237
290
|
readonly name: Schema.optional<Schema.String>;
|
|
238
291
|
/** Replace this account (the owner's, of `provider`). Not with `name`. */
|
|
239
292
|
readonly accountId: Schema.optional<Schema.String>;
|
|
240
293
|
/** Make the connected account the owner's default for the provider, in the same write. */
|
|
241
294
|
readonly makeDefault: Schema.optional<Schema.Boolean>;
|
|
295
|
+
/**
|
|
296
|
+
* Claude and Codex only: the login class the caller expects the secret to be. A secret of the
|
|
297
|
+
* other class is refused (`400`) before anything is stored.
|
|
298
|
+
*/
|
|
299
|
+
readonly login: Schema.optional<Schema.Literals<readonly ["subscription", "api-key"]>>;
|
|
242
300
|
readonly secret: Schema.String;
|
|
243
301
|
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
244
302
|
readonly connectedAccountId: Schema.String;
|
|
@@ -270,6 +328,13 @@ export declare const ConnectedAccountsGroup: HttpApiGroup.HttpApiGroup<"connecte
|
|
|
270
328
|
* stores different bytes. Absent from older control planes.
|
|
271
329
|
*/
|
|
272
330
|
readonly credentialRevision: Schema.optional<Schema.Int>;
|
|
331
|
+
/** Claude and Codex only: the account's login class. Absent from older control planes. */
|
|
332
|
+
readonly login: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
333
|
+
readonly kind: Schema.Literal<"subscription">;
|
|
334
|
+
}>, Schema.Struct<{
|
|
335
|
+
readonly kind: Schema.Literal<"api-key">;
|
|
336
|
+
readonly suffix: Schema.String;
|
|
337
|
+
}>]>>;
|
|
273
338
|
}>>, Schema.toCodecJson<typeof ConnectedAccountBadRequestError | typeof ConnectedAccountNotFoundError | typeof ConnectedAccountConflictError | typeof ConnectedAccountServiceUnavailableError | typeof ConnectedAccountInternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"listConnectedAccounts", "GET", "/", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
274
339
|
readonly ownerUserId: Schema.String;
|
|
275
340
|
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
@@ -303,7 +368,19 @@ export declare const ConnectedAccountsGroup: HttpApiGroup.HttpApiGroup<"connecte
|
|
|
303
368
|
* stores different bytes. Absent from older control planes.
|
|
304
369
|
*/
|
|
305
370
|
readonly credentialRevision: Schema.optional<Schema.Int>;
|
|
371
|
+
/** Claude and Codex only: the account's login class. Absent from older control planes. */
|
|
372
|
+
readonly login: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
373
|
+
readonly kind: Schema.Literal<"subscription">;
|
|
374
|
+
}>, Schema.Struct<{
|
|
375
|
+
readonly kind: Schema.Literal<"api-key">;
|
|
376
|
+
readonly suffix: Schema.String;
|
|
377
|
+
}>]>>;
|
|
306
378
|
}>>;
|
|
379
|
+
/**
|
|
380
|
+
* Whether the owner ever connected an API key, archived ones included, so a surface keeps saying
|
|
381
|
+
* which login a turn spent after the key is gone. Absent from older control planes.
|
|
382
|
+
*/
|
|
383
|
+
readonly hasApiKeyHistory: Schema.optional<Schema.Boolean>;
|
|
307
384
|
}>>, Schema.toCodecJson<typeof ConnectedAccountInternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"markConnectedAccountInvalid", "POST", "/:connectedAccountId/mark-invalid", Schema.toCodecStringTree<Schema.Struct<{
|
|
308
385
|
readonly connectedAccountId: Schema.String;
|
|
309
386
|
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
@@ -343,6 +420,13 @@ export declare const ConnectedAccountsGroup: HttpApiGroup.HttpApiGroup<"connecte
|
|
|
343
420
|
* stores different bytes. Absent from older control planes.
|
|
344
421
|
*/
|
|
345
422
|
readonly credentialRevision: Schema.optional<Schema.Int>;
|
|
423
|
+
/** Claude and Codex only: the account's login class. Absent from older control planes. */
|
|
424
|
+
readonly login: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
425
|
+
readonly kind: Schema.Literal<"subscription">;
|
|
426
|
+
}>, Schema.Struct<{
|
|
427
|
+
readonly kind: Schema.Literal<"api-key">;
|
|
428
|
+
readonly suffix: Schema.String;
|
|
429
|
+
}>]>>;
|
|
346
430
|
/** `marked`: the account is now invalid. `superseded`: a newer credential, left as it was. */
|
|
347
431
|
readonly outcome: Schema.optional<Schema.Literals<readonly ["marked", "superseded"]>>;
|
|
348
432
|
}>>, Schema.toCodecJson<typeof ConnectedAccountNotFoundError | typeof ConnectedAccountInternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"setConnectedAccountDefault", "PUT", "/defaults/:provider", Schema.toCodecStringTree<Schema.Struct<{
|
|
@@ -380,5 +464,12 @@ export declare const ConnectedAccountsGroup: HttpApiGroup.HttpApiGroup<"connecte
|
|
|
380
464
|
* stores different bytes. Absent from older control planes.
|
|
381
465
|
*/
|
|
382
466
|
readonly credentialRevision: Schema.optional<Schema.Int>;
|
|
467
|
+
/** Claude and Codex only: the account's login class. Absent from older control planes. */
|
|
468
|
+
readonly login: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
469
|
+
readonly kind: Schema.Literal<"subscription">;
|
|
470
|
+
}>, Schema.Struct<{
|
|
471
|
+
readonly kind: Schema.Literal<"api-key">;
|
|
472
|
+
readonly suffix: Schema.String;
|
|
473
|
+
}>]>>;
|
|
383
474
|
}>>, Schema.toCodecJson<typeof ConnectedAccountNotFoundError | typeof ConnectedAccountConflictError | typeof ConnectedAccountInternalServerError>, never, never>, false>;
|
|
384
475
|
export {};
|
|
@@ -36,12 +36,20 @@ export const connectedAccountCredentialSchema = Schema.Struct({
|
|
|
36
36
|
/** What that attempt did: `refreshed`, `fresh` (nothing to do), or `failed`. */
|
|
37
37
|
lastRefreshOutcome: Schema.NullOr(Schema.Literals(["refreshed", "fresh", "failed"])),
|
|
38
38
|
});
|
|
39
|
+
/** What the person pays with: their subscription's login, or an API key billed per token. */
|
|
40
|
+
export const connectedAccountLoginClassSchema = Schema.Literals(["subscription", "api-key"]);
|
|
41
|
+
/** A Claude or Codex account's login class; a key with its last four characters. */
|
|
42
|
+
export const connectedAccountLoginSchema = Schema.Union([
|
|
43
|
+
Schema.Struct({ kind: Schema.Literal("subscription") }),
|
|
44
|
+
Schema.Struct({ kind: Schema.Literal("api-key"), suffix: NonEmptyString }),
|
|
45
|
+
]);
|
|
39
46
|
export const connectedAccountSummarySchema = Schema.Struct({
|
|
40
47
|
connectedAccountId: NonEmptyString,
|
|
41
48
|
ownerUserId: NonEmptyString,
|
|
42
49
|
provider: connectedAccountProviderSchema,
|
|
43
50
|
name: NonEmptyString,
|
|
44
|
-
// "oauth-token" | "credentials-json" (claude) | "auth-json" (codex) | "gh-cli-token" (github)
|
|
51
|
+
// "oauth-token" | "credentials-json" (claude) | "auth-json" (codex) | "gh-cli-token" (github) |
|
|
52
|
+
// "api-key" (claude, codex).
|
|
45
53
|
kind: NonEmptyString,
|
|
46
54
|
status: connectedAccountStatusSchema,
|
|
47
55
|
// NON-secret display/ops data (claude token suffix, codex account id/email, github login+scopes).
|
|
@@ -59,6 +67,8 @@ export const connectedAccountSummarySchema = Schema.Struct({
|
|
|
59
67
|
* stores different bytes. Absent from older control planes.
|
|
60
68
|
*/
|
|
61
69
|
credentialRevision: Schema.optional(Schema.Int),
|
|
70
|
+
/** Claude and Codex only: the account's login class. Absent from older control planes. */
|
|
71
|
+
login: Schema.optional(connectedAccountLoginSchema),
|
|
62
72
|
});
|
|
63
73
|
export const createConnectedAccountRequestSchema = Schema.Struct({
|
|
64
74
|
ownerUserId: NonEmptyString,
|
|
@@ -67,17 +77,25 @@ export const createConnectedAccountRequestSchema = Schema.Struct({
|
|
|
67
77
|
* The account to connect or replace by name; a new name is a new account, and `default` names
|
|
68
78
|
* the owner's chosen default. The owner's first account for the provider is named `default`
|
|
69
79
|
* whatever this says. With neither `name` nor `accountId` (or `default` while none is chosen),
|
|
70
|
-
* the owner's only account is replaced,
|
|
71
|
-
*
|
|
80
|
+
* the owner's only account of the secret's login class is replaced, so a key never replaces a
|
|
81
|
+
* subscription. With none of that class a new account is made, named `api-key` or
|
|
82
|
+
* `subscription` (with a number when the name is taken), and with several the connect is
|
|
83
|
+
* refused (`409`, `connected-account-ambiguous`, with `candidateAccountIds`).
|
|
72
84
|
*/
|
|
73
85
|
name: Schema.optional(NonEmptyString),
|
|
74
86
|
/** Replace this account (the owner's, of `provider`). Not with `name`. */
|
|
75
87
|
accountId: Schema.optional(NonEmptyString),
|
|
76
88
|
/** Make the connected account the owner's default for the provider, in the same write. */
|
|
77
89
|
makeDefault: Schema.optional(Schema.Boolean),
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
90
|
+
/**
|
|
91
|
+
* Claude and Codex only: the login class the caller expects the secret to be. A secret of the
|
|
92
|
+
* other class is refused (`400`) before anything is stored.
|
|
93
|
+
*/
|
|
94
|
+
login: Schema.optional(connectedAccountLoginClassSchema),
|
|
95
|
+
// Provider-shaped plaintext: claude setup-token, API key or verbatim .credentials.json contents /
|
|
96
|
+
// verbatim codex auth.json contents or an OpenAI API key / github token. Encrypted server-side;
|
|
97
|
+
// never stored or echoed back as-is. Not trimmed here — pasted credential files are stored
|
|
98
|
+
// verbatim.
|
|
81
99
|
secret: Schema.String.check(Schema.isNonEmpty()),
|
|
82
100
|
});
|
|
83
101
|
export const listConnectedAccountsQuerySchema = Schema.Struct({
|
|
@@ -85,6 +103,11 @@ export const listConnectedAccountsQuerySchema = Schema.Struct({
|
|
|
85
103
|
});
|
|
86
104
|
export const listConnectedAccountsResponseSchema = Schema.Struct({
|
|
87
105
|
items: Schema.Array(connectedAccountSummarySchema),
|
|
106
|
+
/**
|
|
107
|
+
* Whether the owner ever connected an API key, archived ones included, so a surface keeps saying
|
|
108
|
+
* which login a turn spent after the key is gone. Absent from older control planes.
|
|
109
|
+
*/
|
|
110
|
+
hasApiKeyHistory: Schema.optional(Schema.Boolean),
|
|
88
111
|
});
|
|
89
112
|
export const markConnectedAccountInvalidRequestSchema = Schema.Struct({
|
|
90
113
|
ownerUserId: NonEmptyString,
|