@sealant/api-contracts-next 0.40.0-next.813 → 0.40.0-next.815

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.
@@ -7,12 +7,23 @@ export declare const requestBudgetRefusalSchema: Schema.Struct<{
7
7
  }>;
8
8
  /** Admission metadata absent from older servers and non-admission budget errors. */
9
9
  export type RequestBudgetRefusal = typeof requestBudgetRefusalSchema.Type;
10
+ /** What every budget refusal says: which limit, and when there is room again. */
11
+ export declare const budgetExceededFields: {
12
+ message: Schema.String;
13
+ budget: Schema.String;
14
+ limit: Schema.Number;
15
+ retryAfterSeconds: Schema.Number;
16
+ refusal: Schema.optional<Schema.Struct<{
17
+ readonly phase: Schema.Literal<"before-work">;
18
+ readonly bucket: Schema.Literals<readonly ["owner", "unowned", "key", "principal"]>;
19
+ }>>;
20
+ };
10
21
  declare const BudgetExceededError_base: Schema.Class<BudgetExceededError, Schema.TaggedStruct<"BudgetExceededError", {
11
- readonly message: Schema.String;
12
- readonly budget: Schema.String;
13
- readonly limit: Schema.Number;
14
- readonly retryAfterSeconds: Schema.Number;
15
- readonly refusal: Schema.optional<Schema.Struct<{
22
+ message: Schema.String;
23
+ budget: Schema.String;
24
+ limit: Schema.Number;
25
+ retryAfterSeconds: Schema.Number;
26
+ refusal: Schema.optional<Schema.Struct<{
16
27
  readonly phase: Schema.Literal<"before-work">;
17
28
  readonly bucket: Schema.Literals<readonly ["owner", "unowned", "key", "principal"]>;
18
29
  }>>;
@@ -5,18 +5,20 @@ export const requestBudgetRefusalSchema = Schema.Struct({
5
5
  phase: Schema.Literal("before-work"),
6
6
  bucket: Schema.Literals(["owner", "unowned", "key", "principal"]),
7
7
  });
8
- /**
9
- * A budget refused new work (429). Nothing already running was stopped. `budget` names which
10
- * limit, `retryAfterSeconds` when there is room again: the rest of a rate window, or an estimate
11
- * for a concurrency ceiling that only frees when the owner's own work settles.
12
- */
13
- export class BudgetExceededError extends Schema.TaggedError()("BudgetExceededError", {
8
+ /** What every budget refusal says: which limit, and when there is room again. */
9
+ export const budgetExceededFields = {
14
10
  message: Schema.String,
15
11
  budget: Schema.String,
16
12
  limit: Schema.Number,
17
13
  retryAfterSeconds: Schema.Number,
18
14
  refusal: Schema.optional(requestBudgetRefusalSchema),
19
- }, { httpApiStatus: 429 }) {
15
+ };
16
+ /**
17
+ * A budget refused new work (429). Nothing already running was stopped. `budget` names which
18
+ * limit, `retryAfterSeconds` when there is room again: the rest of a rate window, or an estimate
19
+ * for a concurrency ceiling that only frees when the owner's own work settles.
20
+ */
21
+ export class BudgetExceededError extends Schema.TaggedError()("BudgetExceededError", budgetExceededFields, { httpApiStatus: 429 }) {
20
22
  }
21
23
  /** Declares request admission failures on every control-plane endpoint. */
22
24
  export class RequestBudget extends HttpApiMiddleware.Service()("@sealant/api-contracts/RequestBudget", { error: BudgetExceededError }) {
@@ -24,12 +24,16 @@ export type ConnectedAccountCredential = typeof connectedAccountCredentialSchema
24
24
  /** What the person pays with: their subscription's login, or an API key billed per token. */
25
25
  export declare const connectedAccountLoginClassSchema: Schema.Literals<readonly ["subscription", "api-key"]>;
26
26
  export type ConnectedAccountLoginClass = typeof connectedAccountLoginClassSchema.Type;
27
- /** A Claude or Codex account's login class; a key with its last four characters. */
27
+ /**
28
+ * A Claude or Codex account's login class; a key with its last four characters, and the host of the
29
+ * endpoint it sends its requests to when it has one (the endpoint's full URL is never in a summary).
30
+ */
28
31
  export declare const connectedAccountLoginSchema: Schema.Union<readonly [Schema.Struct<{
29
32
  readonly kind: Schema.Literal<"subscription">;
30
33
  }>, Schema.Struct<{
31
34
  readonly kind: Schema.Literal<"api-key">;
32
35
  readonly suffix: Schema.String;
36
+ readonly endpointHost: Schema.optional<Schema.String>;
33
37
  }>]>;
34
38
  export type ConnectedAccountLogin = typeof connectedAccountLoginSchema.Type;
35
39
  export declare const connectedAccountSummarySchema: Schema.Struct<{
@@ -68,6 +72,7 @@ export declare const connectedAccountSummarySchema: Schema.Struct<{
68
72
  }>, Schema.Struct<{
69
73
  readonly kind: Schema.Literal<"api-key">;
70
74
  readonly suffix: Schema.String;
75
+ readonly endpointHost: Schema.optional<Schema.String>;
71
76
  }>]>>;
72
77
  }>;
73
78
  export type ConnectedAccountSummary = typeof connectedAccountSummarySchema.Type;
@@ -94,6 +99,13 @@ export declare const createConnectedAccountRequestSchema: Schema.Struct<{
94
99
  */
95
100
  readonly login: Schema.optional<Schema.Literals<readonly ["subscription", "api-key"]>>;
96
101
  readonly secret: Schema.String;
102
+ /**
103
+ * Claude and Codex API keys only: the base URL of a compatible endpoint to send this login's
104
+ * requests to, such as a company gateway (an `EndpointUrl`; anything else is refused with a
105
+ * `400`). With one, the key may be any value without spaces, for an endpoint that takes no real
106
+ * key. A reconnect without it stores the login without an endpoint.
107
+ */
108
+ readonly endpoint: Schema.optional<Schema.String>;
97
109
  }>;
98
110
  export type CreateConnectedAccountRequest = typeof createConnectedAccountRequestSchema.Type;
99
111
  export declare const listConnectedAccountsQuerySchema: Schema.Struct<{
@@ -137,6 +149,7 @@ export declare const listConnectedAccountsResponseSchema: Schema.Struct<{
137
149
  }>, Schema.Struct<{
138
150
  readonly kind: Schema.Literal<"api-key">;
139
151
  readonly suffix: Schema.String;
152
+ readonly endpointHost: Schema.optional<Schema.String>;
140
153
  }>]>>;
141
154
  }>>;
142
155
  /**
@@ -191,6 +204,7 @@ export declare const markConnectedAccountInvalidResponseSchema: Schema.Struct<{
191
204
  }>, Schema.Struct<{
192
205
  readonly kind: Schema.Literal<"api-key">;
193
206
  readonly suffix: Schema.String;
207
+ readonly endpointHost: Schema.optional<Schema.String>;
194
208
  }>]>>;
195
209
  /** `marked`: the account is now invalid. `superseded`: a newer credential, left as it was. */
196
210
  readonly outcome: Schema.optional<Schema.Literals<readonly ["marked", "superseded"]>>;
@@ -274,6 +288,7 @@ export declare const ConnectedAccountsGroup: HttpApiGroup.HttpApiGroup<"connecte
274
288
  }>, Schema.Struct<{
275
289
  readonly kind: Schema.Literal<"api-key">;
276
290
  readonly suffix: Schema.String;
291
+ readonly endpointHost: Schema.optional<Schema.String>;
277
292
  }>]>>;
278
293
  }>>, Schema.toCodecJson<typeof ConnectedAccountNotFoundError | typeof ConnectedAccountInternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"createConnectedAccount", "POST", "/", never, never, Schema.toCodecJson<Schema.Struct<{
279
294
  readonly ownerUserId: Schema.String;
@@ -298,6 +313,13 @@ export declare const ConnectedAccountsGroup: HttpApiGroup.HttpApiGroup<"connecte
298
313
  */
299
314
  readonly login: Schema.optional<Schema.Literals<readonly ["subscription", "api-key"]>>;
300
315
  readonly secret: Schema.String;
316
+ /**
317
+ * Claude and Codex API keys only: the base URL of a compatible endpoint to send this login's
318
+ * requests to, such as a company gateway (an `EndpointUrl`; anything else is refused with a
319
+ * `400`). With one, the key may be any value without spaces, for an endpoint that takes no real
320
+ * key. A reconnect without it stores the login without an endpoint.
321
+ */
322
+ readonly endpoint: Schema.optional<Schema.String>;
301
323
  }>>, never, Schema.toCodecJson<Schema.Struct<{
302
324
  readonly connectedAccountId: Schema.String;
303
325
  readonly ownerUserId: Schema.String;
@@ -334,6 +356,7 @@ export declare const ConnectedAccountsGroup: HttpApiGroup.HttpApiGroup<"connecte
334
356
  }>, Schema.Struct<{
335
357
  readonly kind: Schema.Literal<"api-key">;
336
358
  readonly suffix: Schema.String;
359
+ readonly endpointHost: Schema.optional<Schema.String>;
337
360
  }>]>>;
338
361
  }>>, Schema.toCodecJson<typeof ConnectedAccountBadRequestError | typeof ConnectedAccountNotFoundError | typeof ConnectedAccountConflictError | typeof ConnectedAccountServiceUnavailableError | typeof ConnectedAccountInternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"listConnectedAccounts", "GET", "/", never, Schema.toCodecStringTree<Schema.Struct<{
339
362
  readonly ownerUserId: Schema.String;
@@ -374,6 +397,7 @@ export declare const ConnectedAccountsGroup: HttpApiGroup.HttpApiGroup<"connecte
374
397
  }>, Schema.Struct<{
375
398
  readonly kind: Schema.Literal<"api-key">;
376
399
  readonly suffix: Schema.String;
400
+ readonly endpointHost: Schema.optional<Schema.String>;
377
401
  }>]>>;
378
402
  }>>;
379
403
  /**
@@ -426,6 +450,7 @@ export declare const ConnectedAccountsGroup: HttpApiGroup.HttpApiGroup<"connecte
426
450
  }>, Schema.Struct<{
427
451
  readonly kind: Schema.Literal<"api-key">;
428
452
  readonly suffix: Schema.String;
453
+ readonly endpointHost: Schema.optional<Schema.String>;
429
454
  }>]>>;
430
455
  /** `marked`: the account is now invalid. `superseded`: a newer credential, left as it was. */
431
456
  readonly outcome: Schema.optional<Schema.Literals<readonly ["marked", "superseded"]>>;
@@ -470,6 +495,7 @@ export declare const ConnectedAccountsGroup: HttpApiGroup.HttpApiGroup<"connecte
470
495
  }>, Schema.Struct<{
471
496
  readonly kind: Schema.Literal<"api-key">;
472
497
  readonly suffix: Schema.String;
498
+ readonly endpointHost: Schema.optional<Schema.String>;
473
499
  }>]>>;
474
500
  }>>, Schema.toCodecJson<typeof ConnectedAccountNotFoundError | typeof ConnectedAccountConflictError | typeof ConnectedAccountInternalServerError>, never, never>, false>;
475
501
  export {};
@@ -39,10 +39,17 @@ export const connectedAccountCredentialSchema = Schema.Struct({
39
39
  });
40
40
  /** What the person pays with: their subscription's login, or an API key billed per token. */
41
41
  export const connectedAccountLoginClassSchema = Schema.Literals(["subscription", "api-key"]);
42
- /** A Claude or Codex account's login class; a key with its last four characters. */
42
+ /**
43
+ * A Claude or Codex account's login class; a key with its last four characters, and the host of the
44
+ * endpoint it sends its requests to when it has one (the endpoint's full URL is never in a summary).
45
+ */
43
46
  export const connectedAccountLoginSchema = Schema.Union([
44
47
  Schema.Struct({ kind: Schema.Literal("subscription") }),
45
- Schema.Struct({ kind: Schema.Literal("api-key"), suffix: NonEmptyString }),
48
+ Schema.Struct({
49
+ kind: Schema.Literal("api-key"),
50
+ suffix: NonEmptyString,
51
+ endpointHost: Schema.optional(NonEmptyString),
52
+ }),
46
53
  ]);
47
54
  export const connectedAccountSummarySchema = Schema.Struct({
48
55
  connectedAccountId: NonEmptyString,
@@ -98,6 +105,13 @@ export const createConnectedAccountRequestSchema = Schema.Struct({
98
105
  // never stored or echoed back as-is. Not trimmed here — pasted credential files are stored
99
106
  // verbatim.
100
107
  secret: Schema.String.check(Schema.isNonEmpty()),
108
+ /**
109
+ * Claude and Codex API keys only: the base URL of a compatible endpoint to send this login's
110
+ * requests to, such as a company gateway (an `EndpointUrl`; anything else is refused with a
111
+ * `400`). With one, the key may be any value without spaces, for an endpoint that takes no real
112
+ * key. A reconnect without it stores the login without an endpoint.
113
+ */
114
+ endpoint: Schema.optional(Schema.String),
101
115
  });
102
116
  export const listConnectedAccountsQuerySchema = Schema.Struct({
103
117
  ownerUserId: PersonId,
@@ -72,6 +72,7 @@ export declare const ControlPlaneAPI: HttpApi.HttpApi<"sealantControlPlaneApi",
72
72
  }>, import("effect/Schema").Struct<{
73
73
  readonly kind: import("effect/Schema").Literal<"api-key">;
74
74
  readonly suffix: import("effect/Schema").String;
75
+ readonly endpointHost: import("effect/Schema").optional<import("effect/Schema").String>;
75
76
  }>]>>;
76
77
  }>>, import("effect/Schema").toCodecJson<typeof import("./connected-accounts.js").ConnectedAccountNotFoundError | typeof import("./connected-accounts.js").ConnectedAccountInternalServerError>, RequestBudget | RequestRefusal, never> | import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"createConnectedAccount", "POST", "/v1/connected-accounts/", never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
77
78
  readonly ownerUserId: import("effect/Schema").String;
@@ -81,6 +82,7 @@ export declare const ControlPlaneAPI: HttpApi.HttpApi<"sealantControlPlaneApi",
81
82
  readonly makeDefault: import("effect/Schema").optional<import("effect/Schema").Boolean>;
82
83
  readonly login: import("effect/Schema").optional<import("effect/Schema").Literals<readonly ["subscription", "api-key"]>>;
83
84
  readonly secret: import("effect/Schema").String;
85
+ readonly endpoint: import("effect/Schema").optional<import("effect/Schema").String>;
84
86
  }>>, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
85
87
  readonly connectedAccountId: import("effect/Schema").String;
86
88
  readonly ownerUserId: import("effect/Schema").String;
@@ -106,6 +108,7 @@ export declare const ControlPlaneAPI: HttpApi.HttpApi<"sealantControlPlaneApi",
106
108
  }>, import("effect/Schema").Struct<{
107
109
  readonly kind: import("effect/Schema").Literal<"api-key">;
108
110
  readonly suffix: import("effect/Schema").String;
111
+ readonly endpointHost: import("effect/Schema").optional<import("effect/Schema").String>;
109
112
  }>]>>;
110
113
  }>>, import("effect/Schema").toCodecJson<typeof import("./connected-accounts.js").ConnectedAccountBadRequestError | typeof import("./connected-accounts.js").ConnectedAccountNotFoundError | typeof import("./connected-accounts.js").ConnectedAccountConflictError | typeof import("./connected-accounts.js").ConnectedAccountServiceUnavailableError | typeof import("./connected-accounts.js").ConnectedAccountInternalServerError>, RequestBudget | RequestRefusal, never> | import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"listConnectedAccounts", "GET", "/v1/connected-accounts/", never, import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
111
114
  readonly ownerUserId: import("effect/Schema").String;
@@ -135,6 +138,7 @@ export declare const ControlPlaneAPI: HttpApi.HttpApi<"sealantControlPlaneApi",
135
138
  }>, import("effect/Schema").Struct<{
136
139
  readonly kind: import("effect/Schema").Literal<"api-key">;
137
140
  readonly suffix: import("effect/Schema").String;
141
+ readonly endpointHost: import("effect/Schema").optional<import("effect/Schema").String>;
138
142
  }>]>>;
139
143
  }>>;
140
144
  readonly hasApiKeyHistory: import("effect/Schema").optional<import("effect/Schema").Boolean>;
@@ -168,6 +172,7 @@ export declare const ControlPlaneAPI: HttpApi.HttpApi<"sealantControlPlaneApi",
168
172
  }>, import("effect/Schema").Struct<{
169
173
  readonly kind: import("effect/Schema").Literal<"api-key">;
170
174
  readonly suffix: import("effect/Schema").String;
175
+ readonly endpointHost: import("effect/Schema").optional<import("effect/Schema").String>;
171
176
  }>]>>;
172
177
  readonly outcome: import("effect/Schema").optional<import("effect/Schema").Literals<readonly ["marked", "superseded"]>>;
173
178
  }>>, import("effect/Schema").toCodecJson<typeof import("./connected-accounts.js").ConnectedAccountNotFoundError | typeof import("./connected-accounts.js").ConnectedAccountInternalServerError>, RequestBudget | RequestRefusal, never> | import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"setConnectedAccountDefault", "PUT", "/v1/connected-accounts/defaults/:provider", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
@@ -200,6 +205,7 @@ export declare const ControlPlaneAPI: HttpApi.HttpApi<"sealantControlPlaneApi",
200
205
  }>, import("effect/Schema").Struct<{
201
206
  readonly kind: import("effect/Schema").Literal<"api-key">;
202
207
  readonly suffix: import("effect/Schema").String;
208
+ readonly endpointHost: import("effect/Schema").optional<import("effect/Schema").String>;
203
209
  }>]>>;
204
210
  }>>, import("effect/Schema").toCodecJson<typeof import("./connected-accounts.js").ConnectedAccountNotFoundError | typeof import("./connected-accounts.js").ConnectedAccountConflictError | typeof import("./connected-accounts.js").ConnectedAccountInternalServerError>, RequestBudget | RequestRefusal, never>, false> | import("effect/http-api/HttpApiGroup").HttpApiGroup<"github", import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"handleWebhook", "POST", "/v1/github/webhooks", never, never, import("effect/Schema").toCodecJson<import("effect/Schema").String>, import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
205
211
  readonly "x-github-delivery": import("effect/Schema").optional<import("effect/Schema").String>;
@@ -282,6 +288,7 @@ export declare const ControlPlaneAPI: HttpApi.HttpApi<"sealantControlPlaneApi",
282
288
  readonly type: import("effect/Schema").Literal<"json">;
283
289
  readonly schema: import("effect/Schema").optional<import("effect/Schema").Unknown>;
284
290
  }>>;
291
+ readonly allowedLogin: import("effect/Schema").optional<import("effect/Schema").Literals<readonly ["subscription", "any"]>>;
285
292
  readonly sessionId: import("effect/Schema").optional<import("effect/Schema").String>;
286
293
  readonly toolResults: import("effect/Schema").optional<import("effect/Schema").$Array<import("effect/Schema").Struct<{
287
294
  readonly toolCallId: import("effect/Schema").String;
@@ -306,7 +313,12 @@ export declare const ControlPlaneAPI: HttpApi.HttpApi<"sealantControlPlaneApi",
306
313
  readonly inputTokens: import("effect/Schema").Number;
307
314
  readonly outputTokens: import("effect/Schema").Number;
308
315
  }>>;
309
- }>>, import("effect/Schema").toCodecJson<typeof import("./budgets.js").BudgetExceededError | typeof import("./inference.js").InferenceBadRequestError | typeof import("./inference.js").InferenceNotFoundError | typeof import("./inference.js").InferenceConflictError | typeof import("./inference.js").InferenceUnavailableError | typeof import("./inference.js").InferenceInternalServerError>, RequestBudget | RequestRefusal, never>, false> | import("effect/http-api/HttpApiGroup").HttpApiGroup<"packages", import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"resolvePackage", "GET", "/v1/packages/resolve", never, import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
316
+ readonly receipt: import("effect/Schema").optional<import("effect/Schema").Struct<{
317
+ readonly accountId: import("effect/Schema").String;
318
+ readonly revision: import("effect/Schema").Number;
319
+ readonly login: import("effect/Schema").Literals<readonly ["subscription", "api-key"]>;
320
+ }>>;
321
+ }>>, import("effect/Schema").toCodecJson<typeof import("./inference.js").InferenceBudgetExceededError | typeof import("./inference.js").InferenceBadRequestError | typeof import("./inference.js").InferenceNotFoundError | typeof import("./inference.js").InferenceConflictError | typeof import("./inference.js").InferenceUnavailableError | typeof import("./inference.js").InferenceInternalServerError>, RequestBudget | RequestRefusal, never>, false> | import("effect/http-api/HttpApiGroup").HttpApiGroup<"packages", import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"resolvePackage", "GET", "/v1/packages/resolve", never, import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
310
322
  readonly query: import("effect/Schema").String;
311
323
  readonly targetOs: import("effect/Schema").optional<import("effect/Schema").Literals<readonly ["arch", "fedora", "nix", "ubuntu"]>>;
312
324
  }>>, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
@@ -389,6 +401,7 @@ export declare const ControlPlaneAPI: HttpApi.HttpApi<"sealantControlPlaneApi",
389
401
  }>, import("effect/Schema").Struct<{
390
402
  readonly kind: import("effect/Schema").Literal<"api-key">;
391
403
  readonly suffix: import("effect/Schema").String;
404
+ readonly endpointHost: import("effect/Schema").optional<import("effect/Schema").String>;
392
405
  }>]>>;
393
406
  }>;
394
407
  }>>;
@@ -442,6 +455,7 @@ export declare const ControlPlaneAPI: HttpApi.HttpApi<"sealantControlPlaneApi",
442
455
  }>, import("effect/Schema").Struct<{
443
456
  readonly kind: import("effect/Schema").Literal<"api-key">;
444
457
  readonly suffix: import("effect/Schema").String;
458
+ readonly endpointHost: import("effect/Schema").optional<import("effect/Schema").String>;
445
459
  }>]>>;
446
460
  }>;
447
461
  }>>;
@@ -1404,6 +1418,8 @@ export declare const ControlPlaneAPI: HttpApi.HttpApi<"sealantControlPlaneApi",
1404
1418
  readonly kubernetesPersonLayout: import("effect/Schema").optional<import("effect/Schema").Boolean>;
1405
1419
  readonly credentialPlacements: import("effect/Schema").optional<import("effect/Schema").Boolean>;
1406
1420
  readonly connectedAccountApiKeys: import("effect/Schema").optional<import("effect/Schema").Boolean>;
1421
+ readonly connectedAccountEndpoints: import("effect/Schema").optional<import("effect/Schema").Boolean>;
1422
+ readonly inferenceAllowedLogin: import("effect/Schema").optional<import("effect/Schema").Boolean>;
1407
1423
  }>>;
1408
1424
  }>>, never, RequestBudget | RequestRefusal, never> | import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"getSetupState", "GET", "/v1/system/setup-state", never, never, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
1409
1425
  readonly needsSetup: import("effect/Schema").Boolean;
@@ -2195,6 +2211,7 @@ export declare const ControlPlaneAPI: HttpApi.HttpApi<"sealantControlPlaneApi",
2195
2211
  readonly kind: import("effect/Schema").Literal<"api-key">;
2196
2212
  readonly suffix: import("effect/Schema").String;
2197
2213
  readonly keyPath: import("effect/Schema").optional<import("effect/Schema").String>;
2214
+ readonly baseUrl: import("effect/Schema").optional<import("effect/Schema").brand<import("effect/Schema").decodeTo<import("effect/Schema").toType<import("effect/Schema").String>, import("effect/Schema").String, never, never>, "EndpointUrl">>;
2198
2215
  }>]>;
2199
2216
  readonly pinned: import("effect/Schema").Boolean;
2200
2217
  readonly provider: import("effect/Schema").Literals<readonly ["claude", "codex", "github", "pi", "opencode"]>;
@@ -2367,6 +2384,7 @@ export declare const ControlPlaneAPI: HttpApi.HttpApi<"sealantControlPlaneApi",
2367
2384
  readonly kind: import("effect/Schema").Literal<"api-key">;
2368
2385
  readonly suffix: import("effect/Schema").String;
2369
2386
  readonly keyPath: import("effect/Schema").optional<import("effect/Schema").String>;
2387
+ readonly baseUrl: import("effect/Schema").optional<import("effect/Schema").brand<import("effect/Schema").decodeTo<import("effect/Schema").toType<import("effect/Schema").String>, import("effect/Schema").String, never, never>, "EndpointUrl">>;
2370
2388
  }>]>;
2371
2389
  readonly pinned: import("effect/Schema").Boolean;
2372
2390
  readonly provider: import("effect/Schema").Literals<readonly ["claude", "codex", "github", "pi", "opencode"]>;
@@ -2425,6 +2443,7 @@ export declare const ControlPlaneAPI: HttpApi.HttpApi<"sealantControlPlaneApi",
2425
2443
  readonly kind: import("effect/Schema").Literal<"api-key">;
2426
2444
  readonly suffix: import("effect/Schema").String;
2427
2445
  readonly keyPath: import("effect/Schema").optional<import("effect/Schema").String>;
2446
+ readonly baseUrl: import("effect/Schema").optional<import("effect/Schema").brand<import("effect/Schema").decodeTo<import("effect/Schema").toType<import("effect/Schema").String>, import("effect/Schema").String, never, never>, "EndpointUrl">>;
2428
2447
  }>]>;
2429
2448
  readonly pinned: import("effect/Schema").Boolean;
2430
2449
  readonly provider: import("effect/Schema").Literals<readonly ["claude", "codex", "github", "pi", "opencode"]>;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * The base URL of a compatible endpoint an API-key login sends its requests to, such as a company
3
+ * gateway: Anthropic-compatible for a Claude login, OpenAI-compatible for a Codex login.
4
+ */
5
+ import { Schema } from "effect";
6
+ /**
7
+ * An absolute `http:` or `https:` URL with a host, and no user name, password, query string or
8
+ * fragment. Decoding normalizes it: the host as the URL standard writes it, and the path without a
9
+ * trailing slash. `http:` is allowed, since an endpoint on a private network often has no TLS.
10
+ */
11
+ export declare const EndpointUrl: Schema.brand<Schema.decodeTo<Schema.toType<Schema.String>, Schema.String, never, never>, "EndpointUrl">;
12
+ export type EndpointUrl = typeof EndpointUrl.Type;
13
+ /** The endpoint's host, with its port when that is not the scheme's default. */
14
+ export declare const endpointHostOf: (url: EndpointUrl) => string;
15
+ /** A pasted endpoint as an {@link EndpointUrl}, or the reason it is not one, for a person to read. */
16
+ export declare const parseEndpointUrl: (raw: string) => {
17
+ readonly valid: true;
18
+ readonly url: EndpointUrl;
19
+ } | {
20
+ readonly valid: false;
21
+ readonly reason: string;
22
+ };
@@ -0,0 +1,54 @@
1
+ /**
2
+ * The base URL of a compatible endpoint an API-key login sends its requests to, such as a company
3
+ * gateway: Anthropic-compatible for a Claude login, OpenAI-compatible for a Codex login.
4
+ */
5
+ import { Schema, SchemaGetter } from "effect";
6
+ const parsed = (value) => {
7
+ try {
8
+ return new URL(value);
9
+ }
10
+ catch {
11
+ return undefined;
12
+ }
13
+ };
14
+ /** Why `value` is not an endpoint URL, or `undefined` when it is one. */
15
+ const endpointUrlProblem = (value) => {
16
+ const url = parsed(value);
17
+ if (url === undefined || (url.protocol !== "http:" && url.protocol !== "https:")) {
18
+ return "must be an absolute http: or https: URL";
19
+ }
20
+ if (url.hostname === "")
21
+ return "must name a host";
22
+ if (url.username !== "" || url.password !== "") {
23
+ return "must not carry a user name or password; the key is sent on its own";
24
+ }
25
+ if (url.search !== "" || value.includes("?"))
26
+ return "must not have a query string";
27
+ if (url.hash !== "" || value.includes("#"))
28
+ return "must not have a fragment";
29
+ return undefined;
30
+ };
31
+ /** Scheme, host (with a port that is not the scheme's default) and path, without a trailing slash. */
32
+ const canonicalEndpointUrl = (value) => {
33
+ const url = new URL(value);
34
+ return `${url.protocol}//${url.host}${url.pathname.replace(/\/+$/, "")}`;
35
+ };
36
+ /**
37
+ * An absolute `http:` or `https:` URL with a host, and no user name, password, query string or
38
+ * fragment. Decoding normalizes it: the host as the URL standard writes it, and the path without a
39
+ * trailing slash. `http:` is allowed, since an endpoint on a private network often has no TLS.
40
+ */
41
+ export const EndpointUrl = Schema.String.check(Schema.makeFilter(endpointUrlProblem)).pipe(Schema.decode({
42
+ decode: SchemaGetter.transform(canonicalEndpointUrl),
43
+ encode: SchemaGetter.passthrough(),
44
+ }), Schema.brand("EndpointUrl"));
45
+ /** The endpoint's host, with its port when that is not the scheme's default. */
46
+ export const endpointHostOf = (url) => new URL(url).host;
47
+ const decodeEndpointUrl = Schema.decodeSync(EndpointUrl);
48
+ /** A pasted endpoint as an {@link EndpointUrl}, or the reason it is not one, for a person to read. */
49
+ export const parseEndpointUrl = (raw) => {
50
+ const problem = endpointUrlProblem(raw);
51
+ return problem === undefined
52
+ ? { valid: true, url: decodeEndpointUrl(raw) }
53
+ : { valid: false, reason: `The endpoint ${problem}.` };
54
+ };
@@ -21,7 +21,6 @@
21
21
  */
22
22
  import { Schema } from "effect";
23
23
  import { HttpApiEndpoint, HttpApiGroup } from "effect/http-api";
24
- import { BudgetExceededError } from "./budgets.js";
25
24
  /**
26
25
  * Connected-account selection — the same reference shape as workspace creation: values are account
27
26
  * ids (`cacc_…`) or per-provider account names; explicit entries win over the profile's bindings.
@@ -84,6 +83,12 @@ export declare const inferenceRespondRequestSchema: Schema.Struct<{
84
83
  readonly type: Schema.Literal<"json">;
85
84
  readonly schema: Schema.optional<Schema.Unknown>;
86
85
  }>>;
86
+ /**
87
+ * Which login a new exchange may run on: `subscription` refuses an account holding an API key
88
+ * (409, `login-not-allowed`, before any provider request); `any` (the default) runs on either.
89
+ * Checked against the account the selection resolved to.
90
+ */
91
+ readonly allowedLogin: Schema.optional<Schema.Literals<readonly ["subscription", "any"]>>;
87
92
  readonly sessionId: Schema.optional<Schema.String>;
88
93
  readonly toolResults: Schema.optional<Schema.$Array<Schema.Struct<{
89
94
  readonly toolCallId: Schema.String;
@@ -118,6 +123,17 @@ export declare const inferenceUsageSchema: Schema.Struct<{
118
123
  readonly outputTokens: Schema.Number;
119
124
  }>;
120
125
  export type InferenceUsage = typeof inferenceUsageSchema.Type;
126
+ /**
127
+ * The login an exchange runs on, fixed when it starts: every continuation runs on it and is judged
128
+ * by it, even after the account is reconnected. `revision` is the account's credential revision at
129
+ * the start.
130
+ */
131
+ export declare const inferenceReceiptSchema: Schema.Struct<{
132
+ readonly accountId: Schema.String;
133
+ readonly revision: Schema.Number;
134
+ readonly login: Schema.Literals<readonly ["subscription", "api-key"]>;
135
+ }>;
136
+ export type InferenceReceipt = typeof inferenceReceiptSchema.Type;
121
137
  export declare const inferenceRespondResponseSchema: Schema.Struct<{
122
138
  readonly sessionId: Schema.String;
123
139
  readonly turn: Schema.Union<readonly [Schema.Struct<{
@@ -137,27 +153,78 @@ export declare const inferenceRespondResponseSchema: Schema.Struct<{
137
153
  readonly inputTokens: Schema.Number;
138
154
  readonly outputTokens: Schema.Number;
139
155
  }>>;
156
+ /** The exchange's login. Absent from a control plane that predates receipts. */
157
+ readonly receipt: Schema.optional<Schema.Struct<{
158
+ readonly accountId: Schema.String;
159
+ readonly revision: Schema.Number;
160
+ readonly login: Schema.Literals<readonly ["subscription", "api-key"]>;
161
+ }>>;
140
162
  }>;
141
163
  export type InferenceRespondResponse = typeof inferenceRespondResponseSchema.Type;
164
+ declare const InferenceBudgetExceededError_base: Schema.Class<InferenceBudgetExceededError, Schema.TaggedStruct<"BudgetExceededError", {
165
+ readonly message: Schema.String;
166
+ readonly budget: Schema.String;
167
+ readonly limit: Schema.Number;
168
+ readonly retryAfterSeconds: Schema.Number;
169
+ readonly refusal: Schema.optional<Schema.Struct<{
170
+ readonly phase: Schema.Literal<"before-work">;
171
+ readonly bucket: Schema.Literals<readonly ["owner", "unowned", "key", "principal"]>;
172
+ }>>;
173
+ readonly receipt: Schema.optional<Schema.Struct<{
174
+ readonly accountId: Schema.String;
175
+ readonly revision: Schema.Number;
176
+ readonly login: Schema.Literals<readonly ["subscription", "api-key"]>;
177
+ }>>;
178
+ }>, import("effect/Cause").YieldableError>;
179
+ /**
180
+ * A budget refused the exchange (429): the same `BudgetExceededError` every other route answers,
181
+ * plus the exchange's login when the refusal came after the account was resolved (the owner's
182
+ * launch budget). The daily token budget refuses before any account is read, so it has none.
183
+ */
184
+ export declare class InferenceBudgetExceededError extends InferenceBudgetExceededError_base {
185
+ }
142
186
  declare const InferenceBadRequestError_base: Schema.Class<InferenceBadRequestError, Schema.TaggedStruct<"InferenceBadRequestError", {
143
187
  readonly message: Schema.String;
188
+ readonly receipt: Schema.optional<Schema.Struct<{
189
+ readonly accountId: Schema.String;
190
+ readonly revision: Schema.Number;
191
+ readonly login: Schema.Literals<readonly ["subscription", "api-key"]>;
192
+ }>>;
144
193
  }>, import("effect/Cause").YieldableError>;
145
194
  export declare class InferenceBadRequestError extends InferenceBadRequestError_base {
146
195
  }
147
196
  declare const InferenceNotFoundError_base: Schema.Class<InferenceNotFoundError, Schema.TaggedStruct<"InferenceNotFoundError", {
148
197
  readonly message: Schema.String;
198
+ readonly receipt: Schema.optional<Schema.Struct<{
199
+ readonly accountId: Schema.String;
200
+ readonly revision: Schema.Number;
201
+ readonly login: Schema.Literals<readonly ["subscription", "api-key"]>;
202
+ }>>;
149
203
  }>, import("effect/Cause").YieldableError>;
150
204
  /** Unknown account/profile (uniform for foreign owners) or an expired/unknown inference session. */
151
205
  export declare class InferenceNotFoundError extends InferenceNotFoundError_base {
152
206
  }
153
207
  declare const InferenceConflictError_base: Schema.Class<InferenceConflictError, Schema.TaggedStruct<"InferenceConflictError", {
154
208
  readonly message: Schema.String;
155
- readonly code: Schema.optional<Schema.Literals<readonly ["connected-account-unsupported"]>>;
209
+ readonly code: Schema.optional<Schema.Literals<readonly ["connected-account-unsupported", "connected-account-refused", "connected-account-superseded", "login-not-allowed"]>>;
210
+ readonly receipt: Schema.optional<Schema.Struct<{
211
+ readonly accountId: Schema.String;
212
+ readonly revision: Schema.Number;
213
+ readonly login: Schema.Literals<readonly ["subscription", "api-key"]>;
214
+ }>>;
156
215
  }>, import("effect/Cause").YieldableError>;
157
216
  /**
158
- * The selected account exists but is not usable: its status is "invalid" (reconnect it), or, with
159
- * `code` `connected-account-unsupported`, it is a login this control plane cannot run on yet (a
160
- * Claude API key).
217
+ * The selected account exists but is not usable: its status is "invalid" (reconnect it), or the
218
+ * provider refused it. `code`, when set:
219
+ *
220
+ * - `connected-account-unsupported`: a login this control plane cannot run on (from a control plane
221
+ * that predates Claude API keys in inference).
222
+ * - `connected-account-refused`: the provider refused an API key with a 401; the account is now
223
+ * invalid.
224
+ * - `connected-account-superseded`: the provider refused an API key with a 401, but the account
225
+ * changed after the exchange started (`receipt.revision` is older), so nothing was marked.
226
+ * - `login-not-allowed`: the request's `allowedLogin` is `subscription` and the account holds an
227
+ * API key; nothing was sent to the provider.
161
228
  */
162
229
  export declare class InferenceConflictError extends InferenceConflictError_base {
163
230
  }
@@ -168,6 +235,11 @@ export declare class InferenceUnavailableError extends InferenceUnavailableError
168
235
  }
169
236
  declare const InferenceInternalServerError_base: Schema.Class<InferenceInternalServerError, Schema.TaggedStruct<"InferenceInternalServerError", {
170
237
  readonly message: Schema.String;
238
+ readonly receipt: Schema.optional<Schema.Struct<{
239
+ readonly accountId: Schema.String;
240
+ readonly revision: Schema.Number;
241
+ readonly login: Schema.Literals<readonly ["subscription", "api-key"]>;
242
+ }>>;
171
243
  }>, import("effect/Cause").YieldableError>;
172
244
  export declare class InferenceInternalServerError extends InferenceInternalServerError_base {
173
245
  }
@@ -199,6 +271,12 @@ export declare const InferenceGroup: HttpApiGroup.HttpApiGroup<"inference", Http
199
271
  readonly type: Schema.Literal<"json">;
200
272
  readonly schema: Schema.optional<Schema.Unknown>;
201
273
  }>>;
274
+ /**
275
+ * Which login a new exchange may run on: `subscription` refuses an account holding an API key
276
+ * (409, `login-not-allowed`, before any provider request); `any` (the default) runs on either.
277
+ * Checked against the account the selection resolved to.
278
+ */
279
+ readonly allowedLogin: Schema.optional<Schema.Literals<readonly ["subscription", "any"]>>;
202
280
  readonly sessionId: Schema.optional<Schema.String>;
203
281
  readonly toolResults: Schema.optional<Schema.$Array<Schema.Struct<{
204
282
  readonly toolCallId: Schema.String;
@@ -224,5 +302,11 @@ export declare const InferenceGroup: HttpApiGroup.HttpApiGroup<"inference", Http
224
302
  readonly inputTokens: Schema.Number;
225
303
  readonly outputTokens: Schema.Number;
226
304
  }>>;
227
- }>>, Schema.toCodecJson<typeof BudgetExceededError | typeof InferenceBadRequestError | typeof InferenceNotFoundError | typeof InferenceConflictError | typeof InferenceUnavailableError | typeof InferenceInternalServerError>, never, never>, false>;
305
+ /** The exchange's login. Absent from a control plane that predates receipts. */
306
+ readonly receipt: Schema.optional<Schema.Struct<{
307
+ readonly accountId: Schema.String;
308
+ readonly revision: Schema.Number;
309
+ readonly login: Schema.Literals<readonly ["subscription", "api-key"]>;
310
+ }>>;
311
+ }>>, Schema.toCodecJson<typeof InferenceBudgetExceededError | typeof InferenceBadRequestError | typeof InferenceNotFoundError | typeof InferenceConflictError | typeof InferenceUnavailableError | typeof InferenceInternalServerError>, never, never>, false>;
228
312
  export {};
@@ -21,7 +21,8 @@
21
21
  */
22
22
  import { Schema } from "effect";
23
23
  import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/http-api";
24
- import { BudgetExceededError } from "./budgets.js";
24
+ import { budgetExceededFields } from "./budgets.js";
25
+ import { connectedAccountLoginClassSchema } from "./connected-accounts.js";
25
26
  import { PersonId } from "./person-id.js";
26
27
  const NonEmptyString = Schema.String.check(Schema.isNonEmpty(), Schema.isTrimmed());
27
28
  /**
@@ -75,6 +76,12 @@ export const inferenceRespondRequestSchema = Schema.Struct({
75
76
  type: Schema.Literal("json"),
76
77
  schema: Schema.optional(Schema.Unknown),
77
78
  })),
79
+ /**
80
+ * Which login a new exchange may run on: `subscription` refuses an account holding an API key
81
+ * (409, `login-not-allowed`, before any provider request); `any` (the default) runs on either.
82
+ * Checked against the account the selection resolved to.
83
+ */
84
+ allowedLogin: Schema.optional(Schema.Literals(["subscription", "any"])),
78
85
  sessionId: Schema.optional(NonEmptyString),
79
86
  toolResults: Schema.optional(Schema.Array(inferenceToolResultSchema).check(Schema.isNonEmpty())),
80
87
  });
@@ -100,33 +107,68 @@ export const inferenceUsageSchema = Schema.Struct({
100
107
  inputTokens: Schema.Number,
101
108
  outputTokens: Schema.Number,
102
109
  });
110
+ /**
111
+ * The login an exchange runs on, fixed when it starts: every continuation runs on it and is judged
112
+ * by it, even after the account is reconnected. `revision` is the account's credential revision at
113
+ * the start.
114
+ */
115
+ export const inferenceReceiptSchema = Schema.Struct({
116
+ accountId: NonEmptyString,
117
+ revision: Schema.Number.check(Schema.isInt()),
118
+ login: connectedAccountLoginClassSchema,
119
+ });
103
120
  export const inferenceRespondResponseSchema = Schema.Struct({
104
121
  sessionId: NonEmptyString,
105
122
  turn: inferenceTurnSchema,
106
123
  /** Usage for the exchange so far; present on the final (text) turn. */
107
124
  usage: Schema.optional(inferenceUsageSchema),
125
+ /** The exchange's login. Absent from a control plane that predates receipts. */
126
+ receipt: Schema.optional(inferenceReceiptSchema),
108
127
  });
109
128
  // ---------------------------------------------------------------------------------------------
110
129
  // Errors
111
130
  // ---------------------------------------------------------------------------------------------
112
- export class InferenceBadRequestError extends Schema.TaggedError()("InferenceBadRequestError", { message: Schema.String }, { httpApiStatus: 400 }) {
131
+ /** On an error after the account was resolved: the exchange's login. */
132
+ const errorReceipt = Schema.optional(inferenceReceiptSchema);
133
+ /**
134
+ * A budget refused the exchange (429): the same `BudgetExceededError` every other route answers,
135
+ * plus the exchange's login when the refusal came after the account was resolved (the owner's
136
+ * launch budget). The daily token budget refuses before any account is read, so it has none.
137
+ */
138
+ export class InferenceBudgetExceededError extends Schema.TaggedError("InferenceBudgetExceededError")("BudgetExceededError", { ...budgetExceededFields, receipt: errorReceipt }, { httpApiStatus: 429 }) {
139
+ }
140
+ export class InferenceBadRequestError extends Schema.TaggedError()("InferenceBadRequestError", { message: Schema.String, receipt: errorReceipt }, { httpApiStatus: 400 }) {
113
141
  }
114
142
  /** Unknown account/profile (uniform for foreign owners) or an expired/unknown inference session. */
115
- export class InferenceNotFoundError extends Schema.TaggedError()("InferenceNotFoundError", { message: Schema.String }, { httpApiStatus: 404 }) {
143
+ export class InferenceNotFoundError extends Schema.TaggedError()("InferenceNotFoundError", { message: Schema.String, receipt: errorReceipt }, { httpApiStatus: 404 }) {
116
144
  }
117
145
  /**
118
- * The selected account exists but is not usable: its status is "invalid" (reconnect it), or, with
119
- * `code` `connected-account-unsupported`, it is a login this control plane cannot run on yet (a
120
- * Claude API key).
146
+ * The selected account exists but is not usable: its status is "invalid" (reconnect it), or the
147
+ * provider refused it. `code`, when set:
148
+ *
149
+ * - `connected-account-unsupported`: a login this control plane cannot run on (from a control plane
150
+ * that predates Claude API keys in inference).
151
+ * - `connected-account-refused`: the provider refused an API key with a 401; the account is now
152
+ * invalid.
153
+ * - `connected-account-superseded`: the provider refused an API key with a 401, but the account
154
+ * changed after the exchange started (`receipt.revision` is older), so nothing was marked.
155
+ * - `login-not-allowed`: the request's `allowedLogin` is `subscription` and the account holds an
156
+ * API key; nothing was sent to the provider.
121
157
  */
122
158
  export class InferenceConflictError extends Schema.TaggedError()("InferenceConflictError", {
123
159
  message: Schema.String,
124
- code: Schema.optional(Schema.Literals(["connected-account-unsupported"])),
160
+ code: Schema.optional(Schema.Literals([
161
+ "connected-account-unsupported",
162
+ "connected-account-refused",
163
+ "connected-account-superseded",
164
+ "login-not-allowed",
165
+ ])),
166
+ receipt: errorReceipt,
125
167
  }, { httpApiStatus: 409 }) {
126
168
  }
127
169
  export class InferenceUnavailableError extends Schema.TaggedError()("InferenceUnavailableError", { message: Schema.String }, { httpApiStatus: 503 }) {
128
170
  }
129
- export class InferenceInternalServerError extends Schema.TaggedError()("InferenceInternalServerError", { message: Schema.String }, { httpApiStatus: 500 }) {
171
+ export class InferenceInternalServerError extends Schema.TaggedError()("InferenceInternalServerError", { message: Schema.String, receipt: errorReceipt }, { httpApiStatus: 500 }) {
130
172
  }
131
173
  // ---------------------------------------------------------------------------------------------
132
174
  // Group
@@ -136,7 +178,7 @@ export const InferenceGroup = HttpApiGroup.make("inference")
136
178
  payload: inferenceRespondRequestSchema,
137
179
  success: inferenceRespondResponseSchema.pipe(HttpApiSchema.status(200)),
138
180
  error: [
139
- BudgetExceededError,
181
+ InferenceBudgetExceededError,
140
182
  InferenceBadRequestError,
141
183
  InferenceNotFoundError,
142
184
  InferenceConflictError,
@@ -61,6 +61,7 @@ export declare const profileCredentialBindingWithAccountSchema: Schema.Struct<{
61
61
  }>, Schema.Struct<{
62
62
  readonly kind: Schema.Literal<"api-key">;
63
63
  readonly suffix: Schema.String;
64
+ readonly endpointHost: Schema.optional<Schema.String>;
64
65
  }>]>>;
65
66
  }>;
66
67
  }>;
@@ -95,6 +96,7 @@ export declare const listProfileCredentialBindingsResponseSchema: Schema.Struct<
95
96
  }>, Schema.Struct<{
96
97
  readonly kind: Schema.Literal<"api-key">;
97
98
  readonly suffix: Schema.String;
99
+ readonly endpointHost: Schema.optional<Schema.String>;
98
100
  }>]>>;
99
101
  }>;
100
102
  }>>;
@@ -165,6 +167,7 @@ export declare const ProfilesGroup: HttpApiGroup.HttpApiGroup<"profiles", HttpAp
165
167
  }>, Schema.Struct<{
166
168
  readonly kind: Schema.Literal<"api-key">;
167
169
  readonly suffix: Schema.String;
170
+ readonly endpointHost: Schema.optional<Schema.String>;
168
171
  }>]>>;
169
172
  }>;
170
173
  }>>;
@@ -223,6 +226,7 @@ export declare const ProfilesGroup: HttpApiGroup.HttpApiGroup<"profiles", HttpAp
223
226
  }>, Schema.Struct<{
224
227
  readonly kind: Schema.Literal<"api-key">;
225
228
  readonly suffix: Schema.String;
229
+ readonly endpointHost: Schema.optional<Schema.String>;
226
230
  }>]>>;
227
231
  }>;
228
232
  }>>;
@@ -71,6 +71,19 @@ export declare const systemIndexResponseSchema: Schema.Struct<{
71
71
  * Codex's own key file. A `$HOME` launch still refuses a Claude key.
72
72
  */
73
73
  readonly connectedAccountApiKeys: Schema.optional<Schema.Boolean>;
74
+ /**
75
+ * A Claude or Codex API key connects with an `endpoint`, the base URL of a compatible
76
+ * endpoint its requests go to: the summary's `login` carries its `endpointHost`, a placement
77
+ * receipt its `baseUrl`, and inference sends the exchange there. Without it, `endpoint` on
78
+ * a connect is dropped unread.
79
+ */
80
+ readonly connectedAccountEndpoints: Schema.optional<Schema.Boolean>;
81
+ /**
82
+ * Inference takes `allowedLogin` and refuses a key when it says `subscription`, answers and
83
+ * errors carry the exchange's `receipt`, and a Claude API key runs inference. Without it,
84
+ * `allowedLogin` is dropped unread.
85
+ */
86
+ readonly inferenceAllowedLogin: Schema.optional<Schema.Boolean>;
74
87
  }>>;
75
88
  }>;
76
89
  export type SystemIndexResponse = typeof systemIndexResponseSchema.Type;
@@ -169,6 +182,19 @@ export declare const SystemGroup: HttpApiGroup.HttpApiGroup<"system", HttpApiEnd
169
182
  * Codex's own key file. A `$HOME` launch still refuses a Claude key.
170
183
  */
171
184
  readonly connectedAccountApiKeys: Schema.optional<Schema.Boolean>;
185
+ /**
186
+ * A Claude or Codex API key connects with an `endpoint`, the base URL of a compatible
187
+ * endpoint its requests go to: the summary's `login` carries its `endpointHost`, a placement
188
+ * receipt its `baseUrl`, and inference sends the exchange there. Without it, `endpoint` on
189
+ * a connect is dropped unread.
190
+ */
191
+ readonly connectedAccountEndpoints: Schema.optional<Schema.Boolean>;
192
+ /**
193
+ * Inference takes `allowedLogin` and refuses a key when it says `subscription`, answers and
194
+ * errors carry the exchange's `receipt`, and a Claude API key runs inference. Without it,
195
+ * `allowedLogin` is dropped unread.
196
+ */
197
+ readonly inferenceAllowedLogin: Schema.optional<Schema.Boolean>;
172
198
  }>>;
173
199
  }>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getSetupState", "GET", "/v1/system/setup-state", never, never, never, never, Schema.toCodecJson<Schema.Struct<{
174
200
  readonly needsSetup: Schema.Boolean;
@@ -72,6 +72,19 @@ export const systemIndexResponseSchema = Schema.Struct({
72
72
  * Codex's own key file. A `$HOME` launch still refuses a Claude key.
73
73
  */
74
74
  connectedAccountApiKeys: Schema.optional(Schema.Boolean),
75
+ /**
76
+ * A Claude or Codex API key connects with an `endpoint`, the base URL of a compatible
77
+ * endpoint its requests go to: the summary's `login` carries its `endpointHost`, a placement
78
+ * receipt its `baseUrl`, and inference sends the exchange there. Without it, `endpoint` on
79
+ * a connect is dropped unread.
80
+ */
81
+ connectedAccountEndpoints: Schema.optional(Schema.Boolean),
82
+ /**
83
+ * Inference takes `allowedLogin` and refuses a key when it says `subscription`, answers and
84
+ * errors carry the exchange's `receipt`, and a Claude API key runs inference. Without it,
85
+ * `allowedLogin` is dropped unread.
86
+ */
87
+ inferenceAllowedLogin: Schema.optional(Schema.Boolean),
75
88
  })),
76
89
  });
77
90
  export const systemHealthResponseSchema = Schema.Struct({
@@ -973,7 +973,8 @@ export declare const putWorkspaceCredentialsRequestSchema: Schema.Struct<{
973
973
  export type PutWorkspaceCredentialsRequest = typeof putWorkspaceCredentialsRequestSchema.Type;
974
974
  /**
975
975
  * What a placed login spends. A key carries its last four characters; a Claude key also its file's
976
- * absolute path, which Claude reads through an `apiKeyHelper` such as `cat <keyPath>`.
976
+ * absolute path, which Claude reads through an `apiKeyHelper` such as `cat <keyPath>`. A key with an
977
+ * endpoint carries its `baseUrl`, which nothing in the home holds: the harness's launch sets it.
977
978
  */
978
979
  export declare const credentialPlacementLoginSchema: Schema.Union<readonly [Schema.Struct<{
979
980
  readonly kind: Schema.Literal<"subscription">;
@@ -981,6 +982,7 @@ export declare const credentialPlacementLoginSchema: Schema.Union<readonly [Sche
981
982
  readonly kind: Schema.Literal<"api-key">;
982
983
  readonly suffix: Schema.String;
983
984
  readonly keyPath: Schema.optional<Schema.String>;
985
+ readonly baseUrl: Schema.optional<Schema.brand<Schema.decodeTo<Schema.toType<Schema.String>, Schema.String, never, never>, "EndpointUrl">>;
984
986
  }>]>;
985
987
  export type CredentialPlacementLogin = typeof credentialPlacementLoginSchema.Type;
986
988
  /** One login written into one home: its id stays the same while a refresh moves its revision. */
@@ -994,6 +996,7 @@ export declare const credentialPlacementReceiptSchema: Schema.Struct<{
994
996
  readonly kind: Schema.Literal<"api-key">;
995
997
  readonly suffix: Schema.String;
996
998
  readonly keyPath: Schema.optional<Schema.String>;
999
+ readonly baseUrl: Schema.optional<Schema.brand<Schema.decodeTo<Schema.toType<Schema.String>, Schema.String, never, never>, "EndpointUrl">>;
997
1000
  }>]>;
998
1001
  readonly pinned: Schema.Boolean;
999
1002
  }>;
@@ -1009,6 +1012,7 @@ export declare const workspaceCredentialPlacementReceiptSchema: Schema.Struct<{
1009
1012
  readonly kind: Schema.Literal<"api-key">;
1010
1013
  readonly suffix: Schema.String;
1011
1014
  readonly keyPath: Schema.optional<Schema.String>;
1015
+ readonly baseUrl: Schema.optional<Schema.brand<Schema.decodeTo<Schema.toType<Schema.String>, Schema.String, never, never>, "EndpointUrl">>;
1012
1016
  }>]>;
1013
1017
  readonly pinned: Schema.Boolean;
1014
1018
  readonly provider: Schema.Literals<readonly ["claude", "codex", "github", "pi", "opencode"]>;
@@ -1037,6 +1041,7 @@ export declare const workspaceCredentialHomeSchema: Schema.Struct<{
1037
1041
  readonly kind: Schema.Literal<"api-key">;
1038
1042
  readonly suffix: Schema.String;
1039
1043
  readonly keyPath: Schema.optional<Schema.String>;
1044
+ readonly baseUrl: Schema.optional<Schema.brand<Schema.decodeTo<Schema.toType<Schema.String>, Schema.String, never, never>, "EndpointUrl">>;
1040
1045
  }>]>;
1041
1046
  readonly pinned: Schema.Boolean;
1042
1047
  readonly provider: Schema.Literals<readonly ["claude", "codex", "github", "pi", "opencode"]>;
@@ -1110,6 +1115,7 @@ export declare const putWorkspaceCredentialsResponseSchema: Schema.Struct<{
1110
1115
  readonly kind: Schema.Literal<"api-key">;
1111
1116
  readonly suffix: Schema.String;
1112
1117
  readonly keyPath: Schema.optional<Schema.String>;
1118
+ readonly baseUrl: Schema.optional<Schema.brand<Schema.decodeTo<Schema.toType<Schema.String>, Schema.String, never, never>, "EndpointUrl">>;
1113
1119
  }>]>;
1114
1120
  readonly pinned: Schema.Boolean;
1115
1121
  readonly provider: Schema.Literals<readonly ["claude", "codex", "github", "pi", "opencode"]>;
@@ -1189,6 +1195,7 @@ export declare const pruneWorkspaceCredentialsResponseSchema: Schema.Struct<{
1189
1195
  readonly kind: Schema.Literal<"api-key">;
1190
1196
  readonly suffix: Schema.String;
1191
1197
  readonly keyPath: Schema.optional<Schema.String>;
1198
+ readonly baseUrl: Schema.optional<Schema.brand<Schema.decodeTo<Schema.toType<Schema.String>, Schema.String, never, never>, "EndpointUrl">>;
1192
1199
  }>]>;
1193
1200
  readonly pinned: Schema.Boolean;
1194
1201
  readonly provider: Schema.Literals<readonly ["claude", "codex", "github", "pi", "opencode"]>;
@@ -1268,6 +1275,7 @@ export declare const listWorkspaceCredentialsResponseSchema: Schema.Struct<{
1268
1275
  readonly kind: Schema.Literal<"api-key">;
1269
1276
  readonly suffix: Schema.String;
1270
1277
  readonly keyPath: Schema.optional<Schema.String>;
1278
+ readonly baseUrl: Schema.optional<Schema.brand<Schema.decodeTo<Schema.toType<Schema.String>, Schema.String, never, never>, "EndpointUrl">>;
1271
1279
  }>]>;
1272
1280
  readonly pinned: Schema.Boolean;
1273
1281
  readonly provider: Schema.Literals<readonly ["claude", "codex", "github", "pi", "opencode"]>;
@@ -3647,6 +3655,7 @@ export declare const WorkspacesGroup: HttpApiGroup.HttpApiGroup<"workspaces", Ht
3647
3655
  readonly kind: Schema.Literal<"api-key">;
3648
3656
  readonly suffix: Schema.String;
3649
3657
  readonly keyPath: Schema.optional<Schema.String>;
3658
+ readonly baseUrl: Schema.optional<Schema.brand<Schema.decodeTo<Schema.toType<Schema.String>, Schema.String, never, never>, "EndpointUrl">>;
3650
3659
  }>]>;
3651
3660
  readonly pinned: Schema.Boolean;
3652
3661
  readonly provider: Schema.Literals<readonly ["claude", "codex", "github", "pi", "opencode"]>;
@@ -3868,6 +3877,7 @@ export declare const WorkspacesGroup: HttpApiGroup.HttpApiGroup<"workspaces", Ht
3868
3877
  readonly kind: Schema.Literal<"api-key">;
3869
3878
  readonly suffix: Schema.String;
3870
3879
  readonly keyPath: Schema.optional<Schema.String>;
3880
+ readonly baseUrl: Schema.optional<Schema.brand<Schema.decodeTo<Schema.toType<Schema.String>, Schema.String, never, never>, "EndpointUrl">>;
3871
3881
  }>]>;
3872
3882
  readonly pinned: Schema.Boolean;
3873
3883
  readonly provider: Schema.Literals<readonly ["claude", "codex", "github", "pi", "opencode"]>;
@@ -3975,6 +3985,7 @@ export declare const WorkspacesGroup: HttpApiGroup.HttpApiGroup<"workspaces", Ht
3975
3985
  readonly kind: Schema.Literal<"api-key">;
3976
3986
  readonly suffix: Schema.String;
3977
3987
  readonly keyPath: Schema.optional<Schema.String>;
3988
+ readonly baseUrl: Schema.optional<Schema.brand<Schema.decodeTo<Schema.toType<Schema.String>, Schema.String, never, never>, "EndpointUrl">>;
3978
3989
  }>]>;
3979
3990
  readonly pinned: Schema.Boolean;
3980
3991
  readonly provider: Schema.Literals<readonly ["claude", "codex", "github", "pi", "opencode"]>;
@@ -2,6 +2,7 @@ import { Schema } from "effect";
2
2
  import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/http-api";
3
3
  import { BudgetExceededError } from "./budgets.js";
4
4
  import { connectedAccountProviderSchema } from "./connected-accounts.js";
5
+ import { EndpointUrl } from "./endpoint-url.js";
5
6
  import { PersonId } from "./person-id.js";
6
7
  import { runCommandSchema, runSchema } from "./runs.js";
7
8
  import { workspaceProcessUserSchema } from "./sessions.js";
@@ -805,7 +806,8 @@ export const putWorkspaceCredentialsRequestSchema = Schema.Struct({
805
806
  });
806
807
  /**
807
808
  * What a placed login spends. A key carries its last four characters; a Claude key also its file's
808
- * absolute path, which Claude reads through an `apiKeyHelper` such as `cat <keyPath>`.
809
+ * absolute path, which Claude reads through an `apiKeyHelper` such as `cat <keyPath>`. A key with an
810
+ * endpoint carries its `baseUrl`, which nothing in the home holds: the harness's launch sets it.
809
811
  */
810
812
  export const credentialPlacementLoginSchema = Schema.Union([
811
813
  Schema.Struct({ kind: Schema.Literal("subscription") }),
@@ -813,6 +815,7 @@ export const credentialPlacementLoginSchema = Schema.Union([
813
815
  kind: Schema.Literal("api-key"),
814
816
  suffix: NonEmptyString,
815
817
  keyPath: Schema.optional(NonEmptyString),
818
+ baseUrl: Schema.optional(EndpointUrl),
816
819
  }),
817
820
  ]);
818
821
  /** One login written into one home: its id stays the same while a refresh moves its revision. */
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from "./core-api/connected-accounts.js";
2
2
  export * from "./core-api/control-plane.js";
3
+ export * from "./core-api/endpoint-url.js";
3
4
  export * from "./core-api/github.js";
4
5
  export * from "./core-api/inference.js";
5
6
  export * from "./core-api/packages.js";
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from "./core-api/connected-accounts.js";
2
2
  export * from "./core-api/control-plane.js";
3
+ export * from "./core-api/endpoint-url.js";
3
4
  export * from "./core-api/github.js";
4
5
  export * from "./core-api/inference.js";
5
6
  export * from "./core-api/packages.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sealant/api-contracts-next",
3
- "version": "0.40.0-next.813",
3
+ "version": "0.40.0-next.815",
4
4
  "description": "Contract-first HTTP API definitions for Sealant services",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -36,7 +36,7 @@
36
36
  "peerDependencies": {
37
37
  "effect": "^4.0.5"
38
38
  },
39
- "gitHead": "186c31b8393a0294caed6c80bfdf8afda7b1d31d",
39
+ "gitHead": "7c62e60f6ddc96a2de5cc52c43586676818dd971",
40
40
  "publishConfig": {
41
41
  "access": "public"
42
42
  }